Bluetooth: fix vendor ext rssi link alert event 73/306573/1
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 28 Sep 2016 16:59:05 +0000 (01:59 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Fri, 23 Feb 2024 02:13:24 +0000 (11:13 +0900)
This patch fixes style for rssi link alert event from vendor
specific group ext.

Change-Id: Ib78a778cef9233bd7c63dae4ffcd49aeb167c1b0
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
include/net/bluetooth/hci.h
include/net/bluetooth/hci_core.h
net/bluetooth/hci_event.c
net/bluetooth/mgmt.c

index 33446aa..6640c46 100644 (file)
@@ -2264,12 +2264,6 @@ struct hci_cc_rsp_enable_rssi {
        __u8    le_ext_opcode;
 } __packed;
 
-struct hci_ev_vendor_specific_rssi_alert {
-       __le16  conn_handle;
-       __s8    alert_type;
-       __s8    rssi_dbm;
-} __packed;
-
 /*
  * Vendor Specific HCI Command
  * Vendor: Broadcom
@@ -2691,6 +2685,11 @@ struct hci_ev_ext_vendor_specific {
 } __packed;
 
 #define LE_RSSI_LINK_ALERT 0x02
+struct hci_ev_vendor_specific_rssi_alert {
+       __le16  conn_handle;
+       __s8    alert_type;
+       __s8    rssi_dbm;
+} __packed;
 #endif
 
 #define HCI_EV_LE_CONN_COMPLETE                0x01
index 5a10159..44bef8e 100644 (file)
@@ -2376,7 +2376,8 @@ void mgmt_rssi_disable_success(struct sock *sk, struct hci_dev *hdev,
                void *data, struct hci_cc_rsp_enable_rssi *rp, int success);
 int mgmt_set_rssi_threshold(struct sock *sk, struct hci_dev *hdev,
                void *data, u16 len);
-void mgmt_rssi_alert_evt(struct hci_dev *hdev, struct sk_buff *skb);
+void mgmt_rssi_alert_evt(struct hci_dev *hdev, u16 conn_handle,
+               s8 alert_type, s8 rssi_dbm);
 void mgmt_raw_rssi_response(struct hci_dev *hdev,
                struct hci_cc_rp_get_raw_rssi *rp, int success);
 void mgmt_enable_rssi_cc(struct hci_dev *hdev, void *response, u8 status);
index 02fbc7c..c53bdb0 100644 (file)
@@ -2265,6 +2265,17 @@ static u8 hci_cc_get_raw_rssi(struct hci_dev *hdev, void *data,
        return rp->status;
 }
 
+static void hci_vendor_ext_rssi_link_alert_evt(struct hci_dev *hdev,
+                                              struct sk_buff *skb)
+{
+       struct hci_ev_vendor_specific_rssi_alert *ev = (void *)skb->data;
+
+       BT_DBG("RSSI event LE_RSSI_LINK_ALERT %X", LE_RSSI_LINK_ALERT);
+
+       mgmt_rssi_alert_evt(hdev, ev->conn_handle, ev->alert_type,
+                           ev->rssi_dbm);
+}
+
 static void hci_vendor_specific_group_ext_evt(struct hci_dev *hdev,
                                              struct sk_buff *skb)
 {
@@ -2279,9 +2290,7 @@ static void hci_vendor_specific_group_ext_evt(struct hci_dev *hdev,
 
        switch (event_le_ext_sub_code) {
        case LE_RSSI_LINK_ALERT:
-               BT_DBG("RSSI event LE_RSSI_LINK_ALERT %X",
-                      LE_RSSI_LINK_ALERT);
-               mgmt_rssi_alert_evt(hdev, skb);
+               hci_vendor_ext_rssi_link_alert_evt(hdev, skb);
                break;
 
        default:
index 43b23ab..52d4ecd 100644 (file)
@@ -8271,16 +8271,16 @@ unlocked:
        return err;
 }
 
-void mgmt_rssi_alert_evt(struct hci_dev *hdev, struct sk_buff *skb)
+void mgmt_rssi_alert_evt(struct hci_dev *hdev, u16 conn_handle,
+               s8 alert_type, s8 rssi_dbm)
 {
-       struct hci_ev_vendor_specific_rssi_alert *ev = (void *)skb->data;
        struct mgmt_ev_vendor_specific_rssi_alert mgmt_ev;
        struct hci_conn *conn;
 
        BT_DBG("RSSI alert [%2.2X %2.2X %2.2X]",
-                       ev->conn_handle, ev->alert_type, ev->rssi_dbm);
+                       conn_handle, alert_type, rssi_dbm);
 
-       conn = hci_conn_hash_lookup_handle(hdev, ev->conn_handle);
+       conn = hci_conn_hash_lookup_handle(hdev, conn_handle);
 
        if (!conn) {
                BT_ERR("RSSI alert Error: Device not found for handle");
@@ -8293,8 +8293,8 @@ void mgmt_rssi_alert_evt(struct hci_dev *hdev, struct sk_buff *skb)
        else
                mgmt_ev.link_type = 0x00;
 
-       mgmt_ev.alert_type = ev->alert_type;
-       mgmt_ev.rssi_dbm = ev->rssi_dbm;
+       mgmt_ev.alert_type = alert_type;
+       mgmt_ev.rssi_dbm = rssi_dbm;
 
        mgmt_event(MGMT_EV_RSSI_ALERT, hdev, &mgmt_ev,
                        sizeof(struct mgmt_ev_vendor_specific_rssi_alert),