diff options
| author | John W. Linville <linville@tuxdriver.com> | 2012-04-27 15:16:43 -0400 |
|---|---|---|
| committer | John W. Linville <linville@tuxdriver.com> | 2012-04-27 15:16:43 -0400 |
| commit | 4dcc0637fc3c36c1f58ffdcaf2dc0dc7de72449f (patch) | |
| tree | 587ffa9493e4b6af014f9acb2c09177c2c54af3b | |
| parent | afa762f6871a8cb05fbef5d0f83fac14304aa816 (diff) | |
| parent | 985140369be1e886754d8ac0375dd64e4f727311 (diff) | |
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
| -rw-r--r-- | drivers/bluetooth/ath3k.c | 4 | ||||
| -rw-r--r-- | drivers/bluetooth/btusb.c | 6 | ||||
| -rw-r--r-- | include/net/bluetooth/hci_core.h | 3 | ||||
| -rw-r--r-- | net/bluetooth/hci_core.c | 27 | ||||
| -rw-r--r-- | net/bluetooth/hci_event.c | 3 | ||||
| -rw-r--r-- | net/bluetooth/mgmt.c | 2 |
6 files changed, 29 insertions, 16 deletions
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index ae9edca7b56d..57fd867553d7 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c | |||
| @@ -75,6 +75,8 @@ static struct usb_device_id ath3k_table[] = { | |||
| 75 | { USB_DEVICE(0x0CF3, 0x311D) }, | 75 | { USB_DEVICE(0x0CF3, 0x311D) }, |
| 76 | { USB_DEVICE(0x13d3, 0x3375) }, | 76 | { USB_DEVICE(0x13d3, 0x3375) }, |
| 77 | { USB_DEVICE(0x04CA, 0x3005) }, | 77 | { USB_DEVICE(0x04CA, 0x3005) }, |
| 78 | { USB_DEVICE(0x13d3, 0x3362) }, | ||
| 79 | { USB_DEVICE(0x0CF3, 0xE004) }, | ||
| 78 | 80 | ||
| 79 | /* Atheros AR5BBU12 with sflash firmware */ | 81 | /* Atheros AR5BBU12 with sflash firmware */ |
| 80 | { USB_DEVICE(0x0489, 0xE02C) }, | 82 | { USB_DEVICE(0x0489, 0xE02C) }, |
| @@ -94,6 +96,8 @@ static struct usb_device_id ath3k_blist_tbl[] = { | |||
| 94 | { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 }, | 96 | { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 }, |
| 95 | { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, | 97 | { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, |
| 96 | { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, | 98 | { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, |
| 99 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, | ||
| 100 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, | ||
| 97 | 101 | ||
| 98 | { } /* Terminating entry */ | 102 | { } /* Terminating entry */ |
| 99 | }; | 103 | }; |
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 3311b812a0c6..9217121362e1 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
| @@ -101,12 +101,16 @@ static struct usb_device_id btusb_table[] = { | |||
| 101 | { USB_DEVICE(0x0c10, 0x0000) }, | 101 | { USB_DEVICE(0x0c10, 0x0000) }, |
| 102 | 102 | ||
| 103 | /* Broadcom BCM20702A0 */ | 103 | /* Broadcom BCM20702A0 */ |
| 104 | { USB_DEVICE(0x0489, 0xe042) }, | ||
| 104 | { USB_DEVICE(0x0a5c, 0x21e3) }, | 105 | { USB_DEVICE(0x0a5c, 0x21e3) }, |
| 105 | { USB_DEVICE(0x0a5c, 0x21e6) }, | 106 | { USB_DEVICE(0x0a5c, 0x21e6) }, |
| 106 | { USB_DEVICE(0x0a5c, 0x21e8) }, | 107 | { USB_DEVICE(0x0a5c, 0x21e8) }, |
| 107 | { USB_DEVICE(0x0a5c, 0x21f3) }, | 108 | { USB_DEVICE(0x0a5c, 0x21f3) }, |
| 108 | { USB_DEVICE(0x413c, 0x8197) }, | 109 | { USB_DEVICE(0x413c, 0x8197) }, |
| 109 | 110 | ||
| 111 | /* Foxconn - Hon Hai */ | ||
| 112 | { USB_DEVICE(0x0489, 0xe033) }, | ||
| 113 | |||
| 110 | { } /* Terminating entry */ | 114 | { } /* Terminating entry */ |
| 111 | }; | 115 | }; |
| 112 | 116 | ||
| @@ -133,6 +137,8 @@ static struct usb_device_id blacklist_table[] = { | |||
| 133 | { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 }, | 137 | { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 }, |
| 134 | { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, | 138 | { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, |
| 135 | { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, | 139 | { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, |
| 140 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, | ||
| 141 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, | ||
| 136 | 142 | ||
| 137 | /* Atheros AR5BBU12 with sflash firmware */ | 143 | /* Atheros AR5BBU12 with sflash firmware */ |
| 138 | { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, | 144 | { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 6822d2595aff..db1c5df45224 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
| @@ -314,6 +314,7 @@ struct hci_conn { | |||
| 314 | 314 | ||
| 315 | __u8 remote_cap; | 315 | __u8 remote_cap; |
| 316 | __u8 remote_auth; | 316 | __u8 remote_auth; |
| 317 | bool flush_key; | ||
| 317 | 318 | ||
| 318 | unsigned int sent; | 319 | unsigned int sent; |
| 319 | 320 | ||
| @@ -980,7 +981,7 @@ int mgmt_discoverable(struct hci_dev *hdev, u8 discoverable); | |||
| 980 | int mgmt_connectable(struct hci_dev *hdev, u8 connectable); | 981 | int mgmt_connectable(struct hci_dev *hdev, u8 connectable); |
| 981 | int mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status); | 982 | int mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status); |
| 982 | int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, | 983 | int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, |
| 983 | u8 persistent); | 984 | bool persistent); |
| 984 | int mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | 985 | int mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
| 985 | u8 addr_type, u32 flags, u8 *name, u8 name_len, | 986 | u8 addr_type, u32 flags, u8 *name, u8 name_len, |
| 986 | u8 *dev_class); | 987 | u8 *dev_class); |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 92a857e3786d..edfd61addcec 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
| @@ -1215,40 +1215,40 @@ struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr) | |||
| 1215 | return NULL; | 1215 | return NULL; |
| 1216 | } | 1216 | } |
| 1217 | 1217 | ||
| 1218 | static int hci_persistent_key(struct hci_dev *hdev, struct hci_conn *conn, | 1218 | static bool hci_persistent_key(struct hci_dev *hdev, struct hci_conn *conn, |
| 1219 | u8 key_type, u8 old_key_type) | 1219 | u8 key_type, u8 old_key_type) |
| 1220 | { | 1220 | { |
| 1221 | /* Legacy key */ | 1221 | /* Legacy key */ |
| 1222 | if (key_type < 0x03) | 1222 | if (key_type < 0x03) |
| 1223 | return 1; | 1223 | return true; |
| 1224 | 1224 | ||
| 1225 | /* Debug keys are insecure so don't store them persistently */ | 1225 | /* Debug keys are insecure so don't store them persistently */ |
| 1226 | if (key_type == HCI_LK_DEBUG_COMBINATION) | 1226 | if (key_type == HCI_LK_DEBUG_COMBINATION) |
| 1227 | return 0; | 1227 | return false; |
| 1228 | 1228 | ||
| 1229 | /* Changed combination key and there's no previous one */ | 1229 | /* Changed combination key and there's no previous one */ |
| 1230 | if (key_type == HCI_LK_CHANGED_COMBINATION && old_key_type == 0xff) | 1230 | if (key_type == HCI_LK_CHANGED_COMBINATION && old_key_type == 0xff) |
| 1231 | return 0; | 1231 | return false; |
| 1232 | 1232 | ||
| 1233 | /* Security mode 3 case */ | 1233 | /* Security mode 3 case */ |
| 1234 | if (!conn) | 1234 | if (!conn) |
| 1235 | return 1; | 1235 | return true; |
| 1236 | 1236 | ||
| 1237 | /* Neither local nor remote side had no-bonding as requirement */ | 1237 | /* Neither local nor remote side had no-bonding as requirement */ |
| 1238 | if (conn->auth_type > 0x01 && conn->remote_auth > 0x01) | 1238 | if (conn->auth_type > 0x01 && conn->remote_auth > 0x01) |
| 1239 | return 1; | 1239 | return true; |
| 1240 | 1240 | ||
| 1241 | /* Local side had dedicated bonding as requirement */ | 1241 | /* Local side had dedicated bonding as requirement */ |
| 1242 | if (conn->auth_type == 0x02 || conn->auth_type == 0x03) | 1242 | if (conn->auth_type == 0x02 || conn->auth_type == 0x03) |
| 1243 | return 1; | 1243 | return true; |
| 1244 | 1244 | ||
| 1245 | /* Remote side had dedicated bonding as requirement */ | 1245 | /* Remote side had dedicated bonding as requirement */ |
| 1246 | if (conn->remote_auth == 0x02 || conn->remote_auth == 0x03) | 1246 | if (conn->remote_auth == 0x02 || conn->remote_auth == 0x03) |
| 1247 | return 1; | 1247 | return true; |
| 1248 | 1248 | ||
| 1249 | /* If none of the above criteria match, then don't store the key | 1249 | /* If none of the above criteria match, then don't store the key |
| 1250 | * persistently */ | 1250 | * persistently */ |
| 1251 | return 0; | 1251 | return false; |
| 1252 | } | 1252 | } |
| 1253 | 1253 | ||
| 1254 | struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8]) | 1254 | struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8]) |
| @@ -1285,7 +1285,8 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, | |||
| 1285 | bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len) | 1285 | bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len) |
| 1286 | { | 1286 | { |
| 1287 | struct link_key *key, *old_key; | 1287 | struct link_key *key, *old_key; |
| 1288 | u8 old_key_type, persistent; | 1288 | u8 old_key_type; |
| 1289 | bool persistent; | ||
| 1289 | 1290 | ||
| 1290 | old_key = hci_find_link_key(hdev, bdaddr); | 1291 | old_key = hci_find_link_key(hdev, bdaddr); |
| 1291 | if (old_key) { | 1292 | if (old_key) { |
| @@ -1328,10 +1329,8 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, | |||
| 1328 | 1329 | ||
| 1329 | mgmt_new_link_key(hdev, key, persistent); | 1330 | mgmt_new_link_key(hdev, key, persistent); |
| 1330 | 1331 | ||
| 1331 | if (!persistent) { | 1332 | if (conn) |
| 1332 | list_del(&key->list); | 1333 | conn->flush_key = !persistent; |
| 1333 | kfree(key); | ||
| 1334 | } | ||
| 1335 | 1334 | ||
| 1336 | return 0; | 1335 | return 0; |
| 1337 | } | 1336 | } |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index b37531094c49..6c065254afc0 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
| @@ -1901,6 +1901,8 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff | |||
| 1901 | } | 1901 | } |
| 1902 | 1902 | ||
