Skip to content

Commit

Permalink
[bluetooth] Remove non-upstream version querying that confuses blueto…
Browse files Browse the repository at this point in the history
…othd

Revert "Bluetooth: Reading remote device lmp_version from controller."

This reverts commit d888141.

Conflicts:
	include/net/bluetooth/hci_core.h
	include/net/bluetooth/mgmt.h
	net/bluetooth/hci_event.c
	net/bluetooth/mgmt.c

Signed-off-by: Hannu Mallat <hannu.mallat@jollamobile.com>
  • Loading branch information
Hannu Mallat authored and RealJohnGalt committed Apr 27, 2016
1 parent 0b3ae7f commit bf22f4a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 47 deletions.
2 changes: 0 additions & 2 deletions include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1069,8 +1069,6 @@ int mgmt_encrypt_change(u16 index, bdaddr_t *bdaddr, u8 status);
/* LE SMP Management interface */
int le_user_confirm_reply(struct hci_conn *conn, u16 mgmt_op, void *cp);
int mgmt_remote_class(u16 index, bdaddr_t *bdaddr, u8 dev_class[3]);
int mgmt_remote_version(u16 index, bdaddr_t *bdaddr, u8 ver, u16 mnf,
u16 sub_ver);
int mgmt_remote_features(u16 index, bdaddr_t *bdaddr, u8 features[8]);

/* HCI info for socket */
Expand Down
8 changes: 0 additions & 8 deletions include/net/bluetooth/mgmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,14 +392,6 @@ struct mgmt_ev_remote_class {
__u8 dev_class[3];
} __packed;

#define MGMT_EV_REMOTE_VERSION 0x0018
struct mgmt_ev_remote_version {
bdaddr_t bdaddr;
__u8 lmp_ver;
__u16 manufacturer;
__u16 lmp_subver;
} __packed;

#define MGMT_EV_REMOTE_FEATURES 0x0019
struct mgmt_ev_remote_features {
bdaddr_t bdaddr;
Expand Down
27 changes: 5 additions & 22 deletions net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1665,14 +1665,14 @@ static inline void hci_conn_complete_evt(struct hci_dev *hdev, struct sk_buff *s
if (test_bit(HCI_ENCRYPT, &hdev->flags))
conn->link_mode |= HCI_LM_ENCRYPT;

/* Get remote version */
/* Get remote features */
if (conn->type == ACL_LINK) {
struct hci_cp_read_remote_version cp;
struct hci_cp_read_remote_features cp;
cp.handle = ev->handle;
hci_send_cmd(hdev, HCI_OP_READ_CLOCK_OFFSET,
sizeof(cp), &cp);
hci_send_cmd(hdev, HCI_OP_READ_REMOTE_VERSION,
sizeof(cp), &cp);
hci_send_cmd(hdev, HCI_OP_READ_REMOTE_FEATURES,
sizeof(cp), &cp);
}

/* Set packet type for incoming connection */
Expand Down Expand Up @@ -2070,24 +2070,7 @@ static inline void hci_remote_features_evt(struct hci_dev *hdev, struct sk_buff

static inline void hci_remote_version_evt(struct hci_dev *hdev, struct sk_buff *skb)
{
struct hci_ev_remote_version *ev = (void *) skb->data;
struct hci_cp_read_remote_features cp;
struct hci_conn *conn;
BT_DBG("%s status %d", hdev->name, ev->status);

hci_dev_lock(hdev);
cp.handle = ev->handle;
hci_send_cmd(hdev, HCI_OP_READ_REMOTE_FEATURES,
sizeof(cp), &cp);

conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(ev->handle));
if (!conn)
goto unlock;
if (!ev->status)
mgmt_remote_version(hdev->id, &conn->dst, ev->lmp_ver,
ev->manufacturer, ev->lmp_subver);
unlock:
hci_dev_unlock(hdev);
BT_DBG("%s", hdev->name);
}

static inline void hci_qos_setup_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
Expand Down
15 changes: 0 additions & 15 deletions net/bluetooth/mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -3399,21 +3399,6 @@ int mgmt_remote_class(u16 index, bdaddr_t *bdaddr, u8 dev_class[3])
return mgmt_event(MGMT_EV_REMOTE_CLASS, index, &ev, sizeof(ev), NULL);
}

int mgmt_remote_version(u16 index, bdaddr_t *bdaddr, u8 ver, u16 mnf,
u16 sub_ver)
{
struct mgmt_ev_remote_version ev;

memset(&ev, 0, sizeof(ev));

bacpy(&ev.bdaddr, bdaddr);
ev.lmp_ver = ver;
ev.manufacturer = mnf;
ev.lmp_subver = sub_ver;

return mgmt_event(MGMT_EV_REMOTE_VERSION, index, &ev, sizeof(ev), NULL);
}

int mgmt_remote_features(u16 index, bdaddr_t *bdaddr, u8 features[8])
{
struct mgmt_ev_remote_features ev;
Expand Down

0 comments on commit bf22f4a

Please sign in to comment.