diff options
Diffstat (limited to 'drivers/bluetooth/hci_ldisc.c')
-rw-r--r-- | drivers/bluetooth/hci_ldisc.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c index 1363dc616ace..b1e8083044ce 100644 --- a/drivers/bluetooth/hci_ldisc.c +++ b/drivers/bluetooth/hci_ldisc.c | |||
@@ -264,10 +264,36 @@ static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb) | |||
264 | static int hci_uart_setup(struct hci_dev *hdev) | 264 | static int hci_uart_setup(struct hci_dev *hdev) |
265 | { | 265 | { |
266 | struct hci_uart *hu = hci_get_drvdata(hdev); | 266 | struct hci_uart *hu = hci_get_drvdata(hdev); |
267 | struct hci_rp_read_local_version *ver; | ||
268 | struct sk_buff *skb; | ||
267 | 269 | ||
268 | if (hu->proto->setup) | 270 | if (hu->proto->setup) |
269 | return hu->proto->setup(hu); | 271 | return hu->proto->setup(hu); |
270 | 272 | ||
273 | if (!test_bit(HCI_UART_VND_DETECT, &hu->hdev_flags)) | ||
274 | return 0; | ||
275 | |||
276 | skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL, | ||
277 | HCI_INIT_TIMEOUT); | ||
278 | if (IS_ERR(skb)) { | ||
279 | BT_ERR("%s: Reading local version information failed (%ld)", | ||
280 | hdev->name, PTR_ERR(skb)); | ||
281 | return 0; | ||
282 | } | ||
283 | |||
284 | if (skb->len != sizeof(*ver)) { | ||
285 | BT_ERR("%s: Event length mismatch for version information", | ||
286 | hdev->name); | ||
287 | goto done; | ||
288 | } | ||
289 | |||
290 | ver = (struct hci_rp_read_local_version *)skb->data; | ||
291 | |||
292 | switch (le16_to_cpu(ver->manufacturer)) { | ||
293 | } | ||
294 | |||
295 | done: | ||
296 | kfree_skb(skb); | ||
271 | return 0; | 297 | return 0; |
272 | } | 298 | } |
273 | 299 | ||
@@ -497,7 +523,8 @@ static int hci_uart_set_flags(struct hci_uart *hu, unsigned long flags) | |||
497 | BIT(HCI_UART_RESET_ON_INIT) | | 523 | BIT(HCI_UART_RESET_ON_INIT) | |
498 | BIT(HCI_UART_CREATE_AMP) | | 524 | BIT(HCI_UART_CREATE_AMP) | |
499 | BIT(HCI_UART_INIT_PENDING) | | 525 | BIT(HCI_UART_INIT_PENDING) | |
500 | BIT(HCI_UART_EXT_CONFIG); | 526 | BIT(HCI_UART_EXT_CONFIG) | |
527 | BIT(HCI_UART_VND_DETECT); | ||
501 | 528 | ||
502 | if (flags & ~valid_flags) | 529 | if (flags & ~valid_flags) |
503 | return -EINVAL; | 530 | return -EINVAL; |