aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/bluetooth/btusb.c333
-rw-r--r--drivers/net/ieee802154/at86rf230.c226
-rw-r--r--include/linux/ieee802154.h2
-rw-r--r--include/net/bluetooth/bluetooth.h3
-rw-r--r--include/net/bluetooth/hci.h22
-rw-r--r--include/net/bluetooth/hci_core.h59
-rw-r--r--include/net/bluetooth/mgmt.h2
-rw-r--r--net/bluetooth/af_bluetooth.c9
-rw-r--r--net/bluetooth/hci_conn.c18
-rw-r--r--net/bluetooth/hci_core.c230
-rw-r--r--net/bluetooth/hci_debugfs.c10
-rw-r--r--net/bluetooth/hci_event.c127
-rw-r--r--net/bluetooth/hci_request.c34
-rw-r--r--net/bluetooth/hci_sock.c108
-rw-r--r--net/bluetooth/l2cap_core.c10
-rw-r--r--net/bluetooth/mgmt.c1947
-rw-r--r--net/bluetooth/sco.c2
-rw-r--r--net/bluetooth/smp.c62
-rw-r--r--net/ieee802154/6lowpan/core.c2
-rw-r--r--net/ieee802154/core.c5
-rw-r--r--net/ieee802154/nl-mac.c1
-rw-r--r--net/ieee802154/sysfs.c49
-rw-r--r--net/mac802154/util.c13
23 files changed, 1888 insertions, 1386 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 8c1bf6190533..6fa9338745cf 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -52,6 +52,7 @@ static struct usb_driver btusb_driver;
52#define BTUSB_SWAVE 0x1000 52#define BTUSB_SWAVE 0x1000
53#define BTUSB_INTEL_NEW 0x2000 53#define BTUSB_INTEL_NEW 0x2000
54#define BTUSB_AMP 0x4000 54#define BTUSB_AMP 0x4000
55#define BTUSB_QCA_ROME 0x8000
55 56
56static const struct usb_device_id btusb_table[] = { 57static const struct usb_device_id btusb_table[] = {
57 /* Generic Bluetooth USB device */ 58 /* Generic Bluetooth USB device */
@@ -213,6 +214,10 @@ static const struct usb_device_id blacklist_table[] = {
213 { USB_DEVICE(0x0489, 0xe036), .driver_info = BTUSB_ATH3012 }, 214 { USB_DEVICE(0x0489, 0xe036), .driver_info = BTUSB_ATH3012 },
214 { USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 }, 215 { USB_DEVICE(0x0489, 0xe03c), .driver_info = BTUSB_ATH3012 },
215 216
217 /* QCA ROME chipset */
218 { USB_DEVICE(0x0cf3, 0xe300), .driver_info = BTUSB_QCA_ROME},
219 { USB_DEVICE(0x0cf3, 0xe360), .driver_info = BTUSB_QCA_ROME},
220
216 /* Broadcom BCM2035 */ 221 /* Broadcom BCM2035 */
217 { USB_DEVICE(0x0a5c, 0x2009), .driver_info = BTUSB_BCM92035 }, 222 { USB_DEVICE(0x0a5c, 0x2009), .driver_info = BTUSB_BCM92035 },
218 { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU }, 223 { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU },
@@ -338,6 +343,8 @@ struct btusb_data {
338 343
339 int (*recv_event)(struct hci_dev *hdev, struct sk_buff *skb); 344 int (*recv_event)(struct hci_dev *hdev, struct sk_buff *skb);
340 int (*recv_bulk)(struct btusb_data *data, void *buffer, int count); 345 int (*recv_bulk)(struct btusb_data *data, void *buffer, int count);
346
347 int (*setup_on_usb)(struct hci_dev *hdev);
341}; 348};
342 349
343static inline void btusb_free_frags(struct btusb_data *data) 350static inline void btusb_free_frags(struct btusb_data *data)
@@ -879,6 +886,15 @@ static int btusb_open(struct hci_dev *hdev)
879 886
880 BT_DBG("%s", hdev->name); 887 BT_DBG("%s", hdev->name);
881 888
889 /* Patching USB firmware files prior to starting any URBs of HCI path
890 * It is more safe to use USB bulk channel for downloading USB patch
891 */
892 if (data->setup_on_usb) {
893 err = data->setup_on_usb(hdev);
894 if (err <0)
895 return err;
896 }
897
882 err = usb_autopm_get_interface(data->intf); 898 err = usb_autopm_get_interface(data->intf);
883 if (err < 0) 899 if (err < 0)
884 return err; 900 return err;
@@ -1254,6 +1270,28 @@ static void btusb_waker(struct work_struct *work)
1254 usb_autopm_put_interface(data->intf); 1270 usb_autopm_put_interface(data->intf);
1255} 1271}
1256 1272
1273static struct sk_buff *btusb_read_local_version(struct hci_dev *hdev)
1274{
1275 struct sk_buff *skb;
1276
1277 skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL,
1278 HCI_INIT_TIMEOUT);
1279 if (IS_ERR(skb)) {
1280 BT_ERR("%s: HCI_OP_READ_LOCAL_VERSION failed (%ld)",
1281 hdev->name, PTR_ERR(skb));
1282 return skb;
1283 }
1284
1285 if (skb->len != sizeof(struct hci_rp_read_local_version)) {
1286 BT_ERR("%s: HCI_OP_READ_LOCAL_VERSION event length mismatch",
1287 hdev->name);
1288 kfree_skb(skb);
1289 return ERR_PTR(-EIO);
1290 }
1291
1292 return skb;
1293}
1294
1257static int btusb_setup_bcm92035(struct hci_dev *hdev) 1295static int btusb_setup_bcm92035(struct hci_dev *hdev)
1258{ 1296{
1259 struct sk_buff *skb; 1297 struct sk_buff *skb;
@@ -1278,12 +1316,9 @@ static int btusb_setup_csr(struct hci_dev *hdev)
1278 1316
1279 BT_DBG("%s", hdev->name); 1317 BT_DBG("%s", hdev->name);
1280 1318
1281 skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL, 1319 skb = btusb_read_local_version(hdev);
1282 HCI_INIT_TIMEOUT); 1320 if (IS_ERR(skb))
1283 if (IS_ERR(skb)) {
1284 BT_ERR("Reading local version failed (%ld)", -PTR_ERR(skb));
1285 return -PTR_ERR(skb); 1321 return -PTR_ERR(skb);
1286 }
1287 1322
1288 rp = (struct hci_rp_read_local_version *)skb->data; 1323 rp = (struct hci_rp_read_local_version *)skb->data;
1289 1324
@@ -2414,21 +2449,9 @@ static int btusb_setup_bcm_patchram(struct hci_dev *hdev)
2414 kfree_skb(skb); 2449 kfree_skb(skb);
2415 2450
2416 /* Read Local Version Info */ 2451 /* Read Local Version Info */
2417 skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL, 2452 skb = btusb_read_local_version(hdev);
2418 HCI_INIT_TIMEOUT); 2453 if (IS_ERR(skb))
2419 if (IS_ERR(skb)) { 2454 return PTR_ERR(skb);
2420 ret = PTR_ERR(skb);
2421 BT_ERR("%s: HCI_OP_READ_LOCAL_VERSION failed (%ld)",
2422 hdev->name, ret);
2423 return ret;
2424 }
2425
2426 if (skb->len != sizeof(*ver)) {
2427 BT_ERR("%s: HCI_OP_READ_LOCAL_VERSION event length mismatch",
2428 hdev->name);
2429 kfree_skb(skb);
2430 return -EIO;
2431 }
2432 2455
2433 ver = (struct hci_rp_read_local_version *)skb->data; 2456 ver = (struct hci_rp_read_local_version *)skb->data;
2434 rev = le16_to_cpu(ver->hci_rev); 2457 rev = le16_to_cpu(ver->hci_rev);
@@ -2516,20 +2539,9 @@ reset_fw:
2516 kfree_skb(skb); 2539 kfree_skb(skb);
2517 2540
2518 /* Read Local Version Info */ 2541 /* Read Local Version Info */
2519 skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_VERSION, 0, NULL, 2542 skb = btusb_read_local_version(hdev);
2520 HCI_INIT_TIMEOUT);
2521 if (IS_ERR(skb)) { 2543 if (IS_ERR(skb)) {
2522 ret = PTR_ERR(skb); 2544 ret = PTR_ERR(skb);
2523 BT_ERR("%s: HCI_OP_READ_LOCAL_VERSION failed (%ld)",
2524 hdev->name, ret);
2525 goto done;
2526 }
2527
2528 if (skb->len != sizeof(*ver)) {
2529 BT_ERR("%s: HCI_OP_READ_LOCAL_VERSION event length mismatch",
2530 hdev->name);
2531 kfree_skb(skb);
2532 ret = -EIO;
2533 goto done; 2545 goto done;
2534 } 2546 }
2535 2547
@@ -2628,6 +2640,258 @@ static int btusb_set_bdaddr_ath3012(struct hci_dev *hdev,
2628 return 0; 2640 return 0;
2629} 2641}
2630 2642
2643#define QCA_DFU_PACKET_LEN 4096
2644
2645#define QCA_GET_TARGET_VERSION 0x09
2646#define QCA_CHECK_STATUS 0x05
2647#define QCA_DFU_DOWNLOAD 0x01
2648<