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);
+int mgmt_device_name_update(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *name,
+ u8 name_len);
#endif
u8 hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, u16 latency,
} __packed;
/* RSSI monitoring */
+/* EVENTS */
+
+/* For device name update changes */
+#define MGMT_EV_DEVICE_NAME_UPDATE (TIZEN_EV_BASE + 0x01)
+struct mgmt_ev_device_name_update {
+ struct mgmt_addr_info addr;
+ __le16 eir_len;
+ __u8 eir[0];
+} __packed;
+/* Device name update changes */
+
/* For handling of RSSI Events */
#define MGMT_EV_RSSI_ALERT (TIZEN_EV_BASE + 0x04)
struct mgmt_ev_vendor_specific_rssi_alert {
struct discovery_state *discov = &hdev->discovery;
struct inquiry_entry *e;
+#ifdef TIZEN_BT
/* Update the mgmt connected state if necessary. Be careful with
* conn objects that exist but are not (yet) connected however.
* Only those in BT_CONFIG or BT_CONNECTED states can be
* considered connected.
*/
if (conn &&
+ (conn->state == BT_CONFIG || conn->state == BT_CONNECTED)) {
+ if (!test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags))
+ mgmt_device_connected(hdev, conn, 0, name, name_len);
+ else
+ mgmt_device_name_update(hdev, bdaddr, name, name_len);
+ }
+#else
+ if (conn &&
(conn->state == BT_CONFIG || conn->state == BT_CONNECTED) &&
!test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags))
mgmt_device_connected(hdev, conn, 0, name, name_len);
+#endif
if (discov->state == DISCOVERY_STOPPED)
return;
return eir_len;
}
+#ifdef TIZEN_BT
+int mgmt_device_name_update(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *name,
+ u8 name_len)
+{
+ char buf[512];
+ struct mgmt_ev_device_name_update *ev = (void *)buf;
+ u16 eir_len = 0;
+
+ if (name_len <= 0)
+ return -EINVAL;
+
+ bacpy(&ev->addr.bdaddr, bdaddr);
+ ev->addr.type = BDADDR_BREDR;
+
+ eir_len = eir_append_data(ev->eir, 0, EIR_NAME_COMPLETE, name,
+ name_len);
+
+ ev->eir_len = cpu_to_le16(eir_len);
+
+ return mgmt_event(MGMT_EV_DEVICE_NAME_UPDATE, hdev, buf,
+ sizeof(*ev) + eir_len, NULL);
+}
+#endif
+
static void read_local_oob_ext_data_complete(struct hci_dev *hdev, u8 status,
u16 opcode, struct sk_buff *skb)
{