diff options
author | John W. Linville <linville@tuxdriver.com> | 2013-07-31 15:11:50 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-07-31 15:11:50 -0400 |
commit | 704278ccb5c9fcbe09d1be3657950c17fad18ba8 (patch) | |
tree | 1e15c5196541b928f076ae8d50e56a4cf9fbe7b8 /drivers | |
parent | d6158a55738863b3fe2d48bbb3bf33005ef834b8 (diff) | |
parent | 53e21fbc288218a423959f878c86471a0e323a9a (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
Conflicts:
net/bluetooth/hci_core.c
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/bluetooth/ath3k.c | 46 | ||||
-rw-r--r-- | drivers/bluetooth/btusb.c | 18 |
2 files changed, 48 insertions, 16 deletions
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index 11f467c00d0a..a12b923bbaca 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c | |||
@@ -91,6 +91,10 @@ static struct usb_device_id ath3k_table[] = { | |||
91 | { USB_DEVICE(0x0489, 0xe04e) }, | 91 | { USB_DEVICE(0x0489, 0xe04e) }, |
92 | { USB_DEVICE(0x0489, 0xe056) }, | 92 | { USB_DEVICE(0x0489, 0xe056) }, |
93 | { USB_DEVICE(0x0489, 0xe04d) }, | 93 | { USB_DEVICE(0x0489, 0xe04d) }, |
94 | { USB_DEVICE(0x04c5, 0x1330) }, | ||
95 | { USB_DEVICE(0x13d3, 0x3402) }, | ||
96 | { USB_DEVICE(0x0cf3, 0x3121) }, | ||
97 | { USB_DEVICE(0x0cf3, 0xe003) }, | ||
94 | 98 | ||
95 | /* Atheros AR5BBU12 with sflash firmware */ | 99 | /* Atheros AR5BBU12 with sflash firmware */ |
96 | { USB_DEVICE(0x0489, 0xE02C) }, | 100 | { USB_DEVICE(0x0489, 0xE02C) }, |
@@ -128,6 +132,10 @@ static struct usb_device_id ath3k_blist_tbl[] = { | |||
128 | { USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 }, | 132 | { USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 }, |
129 | { USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 }, | 133 | { USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 }, |
130 | { USB_DEVICE(0x0489, 0xe04d), .driver_info = BTUSB_ATH3012 }, | 134 | { USB_DEVICE(0x0489, 0xe04d), .driver_info = BTUSB_ATH3012 }, |
135 | { USB_DEVICE(0x04c5, 0x1330), .driver_info = BTUSB_ATH3012 }, | ||
136 | { USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 }, | ||
137 | { USB_DEVICE(0x0cf3, 0x3121), .driver_info = BTUSB_ATH3012 }, | ||
138 | { USB_DEVICE(0x0cf3, 0xe003), .driver_info = BTUSB_ATH3012 }, | ||
131 | 139 | ||
132 | /* Atheros AR5BBU22 with sflash firmware */ | 140 | /* Atheros AR5BBU22 with sflash firmware */ |
133 | { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 }, | 141 | { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 }, |
@@ -193,24 +201,44 @@ error: | |||
193 | 201 | ||
194 | static int ath3k_get_state(struct usb_device *udev, unsigned char *state) | 202 | static int ath3k_get_state(struct usb_device *udev, unsigned char *state) |
195 | { | 203 | { |
196 | int pipe = 0; | 204 | int ret, pipe = 0; |
205 | char *buf; | ||
206 | |||
207 | buf = kmalloc(sizeof(*buf), GFP_KERNEL); | ||
208 | if (!buf) | ||
209 | return -ENOMEM; | ||
197 | 210 | ||
198 | pipe = usb_rcvctrlpipe(udev, 0); | 211 | pipe = usb_rcvctrlpipe(udev, 0); |
199 | return usb_control_msg(udev, pipe, ATH3K_GETSTATE, | 212 | ret = usb_control_msg(udev, pipe, ATH3K_GETSTATE, |
200 | USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, | 213 | USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, |
201 | state, 0x01, USB_CTRL_SET_TIMEOUT); | 214 | buf, sizeof(*buf), USB_CTRL_SET_TIMEOUT); |
215 | |||
216 | *state = *buf; | ||
217 | kfree(buf); | ||
218 | |||
219 | return ret; | ||
202 | } | 220 | } |
203 | 221 | ||
204 | static int ath3k_get_version(struct usb_device *udev, | 222 | static int ath3k_get_version(struct usb_device *udev, |
205 | struct ath3k_version *version) | 223 | struct ath3k_version *version) |
206 | { | 224 | { |
207 | int pipe = 0; | 225 | int ret, pipe = 0; |
226 | struct ath3k_version *buf; | ||
227 | const int size = sizeof(*buf); | ||
228 | |||
229 | buf = kmalloc(size, GFP_KERNEL); | ||
230 | if (!buf) | ||
231 | return -ENOMEM; | ||
208 | 232 | ||
209 | pipe = usb_rcvctrlpipe(udev, 0); | 233 | pipe = usb_rcvctrlpipe(udev, 0); |
210 | return usb_control_msg(udev, pipe, ATH3K_GETVERSION, | 234 | ret = usb_control_msg(udev, pipe, ATH3K_GETVERSION, |
211 | USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, version, | 235 | USB_TYPE_VENDOR | USB_DIR_IN, 0, 0, |
212 | sizeof(struct ath3k_version), | 236 | buf, size, USB_CTRL_SET_TIMEOUT); |
213 | USB_CTRL_SET_TIMEOUT); | 237 | |
238 | memcpy(version, buf, size); | ||
239 | kfree(buf); | ||
240 | |||
241 | return ret; | ||
214 | } | 242 | } |
215 | 243 | ||
216 | static int ath3k_load_fwfile(struct usb_device *udev, | 244 | static int ath3k_load_fwfile(struct usb_device *udev, |
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index de4cf4daa2f4..8e16f0af6358 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
@@ -154,6 +154,10 @@ static struct usb_device_id blacklist_table[] = { | |||
154 | { USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 }, | 154 | { USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 }, |
155 | { USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 }, | 155 | { USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 }, |
156 | { USB_DEVICE(0x0489, 0xe04d), .driver_info = BTUSB_ATH3012 }, | 156 | { USB_DEVICE(0x0489, 0xe04d), .driver_info = BTUSB_ATH3012 }, |
157 | { USB_DEVICE(0x04c5, 0x1330), .driver_info = BTUSB_ATH3012 }, | ||
158 | { USB_DEVICE(0x13d3, 0x3402), .driver_info = BTUSB_ATH3012 }, | ||
159 | { USB_DEVICE(0x0cf3, 0x3121), .driver_info = BTUSB_ATH3012 }, | ||
160 | { USB_DEVICE(0x0cf3, 0xe003), .driver_info = BTUSB_ATH3012 }, | ||
157 | 161 | ||
158 | /* Atheros AR5BBU12 with sflash firmware */ | 162 | /* Atheros AR5BBU12 with sflash firmware */ |
159 | { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, | 163 | { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, |
@@ -1095,7 +1099,7 @@ static int btusb_setup_intel_patching(struct hci_dev *hdev, | |||
1095 | if (IS_ERR(skb)) { | 1099 | if (IS_ERR(skb)) { |
1096 | BT_ERR("%s sending Intel patch command (0x%4.4x) failed (%ld)", | 1100 | BT_ERR("%s sending Intel patch command (0x%4.4x) failed (%ld)", |
1097 | hdev->name, cmd->opcode, PTR_ERR(skb)); | 1101 | hdev->name, cmd->opcode, PTR_ERR(skb)); |
1098 | return -PTR_ERR(skb); | 1102 | return PTR_ERR(skb); |
1099 | } | 1103 | } |
1100 | 1104 | ||
1101 | /* It ensures that the returned event matches the event data read from | 1105 | /* It ensures that the returned event matches the event data read from |
@@ -1147,7 +1151,7 @@ static int btusb_setup_intel(struct hci_dev *hdev) | |||
1147 | if (IS_ERR(skb)) { | 1151 | if (IS_ERR(skb)) { |
1148 | BT_ERR("%s sending initial HCI reset command failed (%ld)", | 1152 | BT_ERR("%s sending initial HCI reset command failed (%ld)", |
1149 | hdev->name, PTR_ERR(skb)); | 1153 | hdev->name, PTR_ERR(skb)); |
1150 | return -PTR_ERR(skb); | 1154 | return PTR_ERR(skb); |
1151 | } | 1155 | } |
1152 | kfree_skb(skb); | 1156 | kfree_skb(skb); |
1153 | 1157 | ||
@@ -1161,7 +1165,7 @@ static int btusb_setup_intel(struct hci_dev *hdev) | |||
1161 | if (IS_ERR(skb)) { | 1165 | if (IS_ERR(skb)) { |
1162 | BT_ERR("%s reading Intel fw version command failed (%ld)", | 1166 | BT_ERR("%s reading Intel fw version command failed (%ld)", |
1163 | hdev->name, PTR_ERR(skb)); | 1167 | hdev->name, PTR_ERR(skb)); |
1164 | return -PTR_ERR(skb); | 1168 | return PTR_ERR(skb); |
1165 | } | 1169 | } |
1166 | 1170 | ||
1167 | if (skb->len != sizeof(*ver)) { | 1171 | if (skb->len != sizeof(*ver)) { |
@@ -1219,7 +1223,7 @@ static int btusb_setup_intel(struct hci_dev *hdev) | |||
1219 | BT_ERR("%s entering Intel manufacturer mode failed (%ld)", | 1223 | BT_ERR("%s entering Intel manufacturer mode failed (%ld)", |
1220 | hdev->name, PTR_ERR(skb)); | 1224 | hdev->name, PTR_ERR(skb)); |
1221 | release_firmware(fw); | 1225 | release_firmware(fw); |
1222 | return -PTR_ERR(skb); | 1226 | return PTR_ERR(skb); |
1223 | } | 1227 | } |
1224 | 1228 | ||
1225 | if (skb->data[0]) { | 1229 | if (skb->data[0]) { |
@@ -1276,7 +1280,7 @@ static int btusb_setup_intel(struct hci_dev *hdev) | |||
1276 | if (IS_ERR(skb)) { | 1280 | if (IS_ERR(skb)) { |
1277 | BT_ERR("%s exiting Intel manufacturer mode failed (%ld)", | 1281 | BT_ERR("%s exiting Intel manufacturer mode failed (%ld)", |
1278 | hdev->name, PTR_ERR(skb)); | 1282 | hdev->name, PTR_ERR(skb)); |
1279 | return -PTR_ERR(skb); | 1283 | return PTR_ERR(skb); |
1280 | } | 1284 | } |
1281 | kfree_skb(skb); | 1285 | kfree_skb(skb); |
1282 | 1286 | ||
@@ -1292,7 +1296,7 @@ exit_mfg_disable: | |||
1292 | if (IS_ERR(skb)) { | 1296 | if (IS_ERR(skb)) { |
1293 | BT_ERR("%s exiting Intel manufacturer mode failed (%ld)", | 1297 | BT_ERR("%s exiting Intel manufacturer mode failed (%ld)", |
1294 | hdev->name, PTR_ERR(skb)); | 1298 | hdev->name, PTR_ERR(skb)); |
1295 | return -PTR_ERR(skb); | 1299 | return PTR_ERR(skb); |
1296 | } | 1300 | } |
1297 | kfree_skb(skb); | 1301 | kfree_skb(skb); |
1298 | 1302 | ||
@@ -1310,7 +1314,7 @@ exit_mfg_deactivate: | |||
1310 | if (IS_ERR(skb)) { | 1314 | if (IS_ERR(skb)) { |
1311 | BT_ERR("%s exiting Intel manufacturer mode failed (%ld)", | 1315 | BT_ERR("%s exiting Intel manufacturer mode failed (%ld)", |
1312 | hdev->name, PTR_ERR(skb)); | 1316 | hdev->name, PTR_ERR(skb)); |
1313 | return -PTR_ERR(skb); | 1317 | return PTR_ERR(skb); |
1314 | } | 1318 | } |
1315 | kfree_skb(skb); | 1319 | kfree_skb(skb); |
1316 | 1320 | ||