Skip to content

Commit 29a3060

Browse files
committed
Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
Johan Hedberg says: ==================== pull request: bluetooth-next 2015-07-30 Here's a set of Bluetooth & 802.15.4 patches intended for the 4.3 kernel. - Cleanups & fixes to mac802154 - Refactoring of Intel Bluetooth HCI driver - Various coding style fixes to Bluetooth HCI drivers - Support for Intel Lightning Peak Bluetooth devices - Generic class code in interface descriptor in btusb to match more HW - Refactoring of Bluetooth HS code together with a new config option - Support for BCM4330B1 Broadcom UART controller Let me know if there are any issues pulling. Thanks. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 8013d1d + 5857d1d commit 29a3060

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1167
-331
lines changed

drivers/bluetooth/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ config BT_HCIUART_3WIRE
132132
config BT_HCIUART_INTEL
133133
bool "Intel protocol support"
134134
depends on BT_HCIUART
135+
select BT_HCIUART_H4
135136
select BT_INTEL
136137
help
137138
The Intel protocol support enables Bluetooth HCI over serial

drivers/bluetooth/bfusb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ static int bfusb_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
492492
case HCI_SCODATA_PKT:
493493
hdev->stat.sco_tx++;
494494
break;
495-
};
495+
}
496496

497497
/* Prepend skb with frame type */
498498
memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);

drivers/bluetooth/bt3c_cs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ static int bt3c_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
427427
case HCI_SCODATA_PKT:
428428
hdev->stat.sco_tx++;
429429
break;
430-
};
430+
}
431431

432432
/* Prepend skb with frame type */
433433
memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);

drivers/bluetooth/btbcm.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
#define BDADDR_BCM20702A0 (&(bdaddr_t) {{0x00, 0xa0, 0x02, 0x70, 0x20, 0x00}})
3636
#define BDADDR_BCM4324B3 (&(bdaddr_t) {{0x00, 0x00, 0x00, 0xb3, 0x24, 0x43}})
37+
#define BDADDR_BCM4330B1 (&(bdaddr_t) {{0x00, 0x00, 0x00, 0xb1, 0x30, 0x43}})
3738

3839
int btbcm_check_bdaddr(struct hci_dev *hdev)
3940
{
@@ -66,9 +67,13 @@ int btbcm_check_bdaddr(struct hci_dev *hdev)
6667
*
6768
* The address 43:24:B3:00:00:00 indicates a BCM4324B3 controller
6869
* with waiting for configuration state.
70+
*
71+
* The address 43:30:B1:00:00:00 indicates a BCM4330B1 controller
72+
* with waiting for configuration state.
6973
*/
7074
if (!bacmp(&bda->bdaddr, BDADDR_BCM20702A0) ||
71-
!bacmp(&bda->bdaddr, BDADDR_BCM4324B3)) {
75+
!bacmp(&bda->bdaddr, BDADDR_BCM4324B3) ||
76+
!bacmp(&bda->bdaddr, BDADDR_BCM4330B1)) {
7277
BT_INFO("%s: BCM: Using default device address (%pMR)",
7378
hdev->name, &bda->bdaddr);
7479
set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks);
@@ -241,6 +246,7 @@ static const struct {
241246
u16 subver;
242247
const char *name;
243248
} bcm_uart_subver_table[] = {
249+
{ 0x4103, "BCM4330B1" }, /* 002.001.003 */
244250
{ 0x410e, "BCM43341B0" }, /* 002.001.014 */
245251
{ 0x4406, "BCM4324B3" }, /* 002.004.006 */
246252
{ 0x610c, "BCM4354" }, /* 003.001.012 */

drivers/bluetooth/btintel.c

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,86 @@ int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
8989
}
9090
EXPORT_SYMBOL_GPL(btintel_set_bdaddr);
9191

92+
void btintel_hw_error(struct hci_dev *hdev, u8 code)
93+
{
94+
struct sk_buff *skb;
95+
u8 type = 0x00;
96+
97+
BT_ERR("%s: Hardware error 0x%2.2x", hdev->name, code);
98+
99+
skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT);
100+
if (IS_ERR(skb)) {
101+
BT_ERR("%s: Reset after hardware error failed (%ld)",
102+
hdev->name, PTR_ERR(skb));
103+
return;
104+
}
105+
kfree_skb(skb);
106+
107+
skb = __hci_cmd_sync(hdev, 0xfc22, 1, &type, HCI_INIT_TIMEOUT);
108+
if (IS_ERR(skb)) {
109+
BT_ERR("%s: Retrieving Intel exception info failed (%ld)",
110+
hdev->name, PTR_ERR(skb));
111+
return;
112+
}
113+
114+
if (skb->len != 13) {
115+
BT_ERR("%s: Exception info size mismatch", hdev->name);
116+
kfree_skb(skb);
117+
return;
118+
}
119+
120+
BT_ERR("%s: Exception info %s", hdev->name, (char *)(skb->data + 1));
121+
122+
kfree_skb(skb);
123+
}
124+
EXPORT_SYMBOL_GPL(btintel_hw_error);
125+
126+
void btintel_version_info(struct hci_dev *hdev, struct intel_version *ver)
127+
{
128+
const char *variant;
129+
130+
switch (ver->fw_variant) {
131+
case 0x06:
132+
variant = "Bootloader";
133+
break;
134+
case 0x23:
135+
variant = "Firmware";
136+
break;
137+
default:
138+
return;
139+
}
140+
141+
BT_INFO("%s: %s revision %u.%u build %u week %u %u", hdev->name,
142+
variant, ver->fw_revision >> 4, ver->fw_revision & 0x0f,
143+
ver->fw_build_num, ver->fw_build_ww, 2000 + ver->fw_build_yy);
144+
}
145+
EXPORT_SYMBOL_GPL(btintel_version_info);
146+
147+
int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type, u32 plen,
148+
const void *param)
149+
{
150+
while (plen > 0) {
151+
struct sk_buff *skb;
152+
u8 cmd_param[253], fragment_len = (plen > 252) ? 252 : plen;
153+
154+
cmd_param[0] = fragment_type;
155+
memcpy(cmd_param + 1, param, fragment_len);
156+
157+
skb = __hci_cmd_sync(hdev, 0xfc09, fragment_len + 1,
158+
cmd_param, HCI_INIT_TIMEOUT);
159+
if (IS_ERR(skb))
160+
return PTR_ERR(skb);
161+
162+
kfree_skb(skb);
163+
164+
plen -= fragment_len;
165+
param += fragment_len;
166+
}
167+
168+
return 0;
169+
}
170+
EXPORT_SYMBOL_GPL(btintel_secure_send);
171+
92172
MODULE_AUTHOR("Marcel Holtmann <[email protected]>");
93173
MODULE_DESCRIPTION("Bluetooth support for Intel devices ver " VERSION);
94174
MODULE_VERSION(VERSION);

drivers/bluetooth/btintel.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ struct intel_secure_send_result {
7373

7474
int btintel_check_bdaddr(struct hci_dev *hdev);
7575
int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
76+
void btintel_hw_error(struct hci_dev *hdev, u8 code);
77+
78+
void btintel_version_info(struct hci_dev *hdev, struct intel_version *ver);
79+
int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type, u32 plen,
80+
const void *param);
7681

7782
#else
7883

@@ -86,4 +91,18 @@ static inline int btintel_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdadd
8691
return -EOPNOTSUPP;
8792
}
8893

94+
static inline void btintel_hw_error(struct hci_dev *hdev, u8 code)
95+
{
96+
}
97+
98+
static void btintel_version_info(struct hci_dev *hdev, struct intel_version *ver)
99+
{
100+
}
101+
102+
static inline int btintel_secure_send(struct hci_dev *hdev, u8 fragment_type,
103+
u32 plen, const void *param)
104+
{
105+
return -EOPNOTSUPP;
106+
}
107+
89108
#endif

drivers/bluetooth/btmrvl_drv.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ struct btmrvl_private {
9595
struct btmrvl_device btmrvl_dev;
9696
struct btmrvl_adapter *adapter;
9797
struct btmrvl_thread main_thread;
98-
int (*hw_host_to_card) (struct btmrvl_private *priv,
98+
int (*hw_host_to_card)(struct btmrvl_private *priv,
9999
u8 *payload, u16 nb);
100-
int (*hw_wakeup_firmware) (struct btmrvl_private *priv);
101-
int (*hw_process_int_status) (struct btmrvl_private *priv);
100+
int (*hw_wakeup_firmware)(struct btmrvl_private *priv);
101+
int (*hw_process_int_status)(struct btmrvl_private *priv);
102102
void (*firmware_dump)(struct btmrvl_private *priv);
103103
spinlock_t driver_lock; /* spinlock used by driver */
104104
#ifdef CONFIG_DEBUG_FS

drivers/bluetooth/btusb.c

Lines changed: 9 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ static const struct usb_device_id btusb_table[] = {
6868
/* Generic Bluetooth AMP device */
6969
{ USB_DEVICE_INFO(0xe0, 0x01, 0x04), .driver_info = BTUSB_AMP },
7070

71+
/* Generic Bluetooth USB interface */
72+
{ USB_INTERFACE_INFO(0xe0, 0x01, 0x01) },
73+
7174
/* Apple-specific (Broadcom) devices */
7275
{ USB_VENDOR_AND_INTERFACE_INFO(0x05ac, 0xff, 0x01, 0x01),
7376
.driver_info = BTUSB_BCM_APPLE },
@@ -1878,51 +1881,6 @@ static int btusb_send_frame_intel(struct hci_dev *hdev, struct sk_buff *skb)
18781881
return -EILSEQ;
18791882
}
18801883

1881-
static int btusb_intel_secure_send(struct hci_dev *hdev, u8 fragment_type,
1882-
u32 plen, const void *param)
1883-
{
1884-
while (plen > 0) {
1885-
struct sk_buff *skb;
1886-
u8 cmd_param[253], fragment_len = (plen > 252) ? 252 : plen;
1887-
1888-
cmd_param[0] = fragment_type;
1889-
memcpy(cmd_param + 1, param, fragment_len);
1890-
1891-
skb = __hci_cmd_sync(hdev, 0xfc09, fragment_len + 1,
1892-
cmd_param, HCI_INIT_TIMEOUT);
1893-
if (IS_ERR(skb))
1894-
return PTR_ERR(skb);
1895-
1896-
kfree_skb(skb);
1897-
1898-
plen -= fragment_len;
1899-
param += fragment_len;
1900-
}
1901-
1902-
return 0;
1903-
}
1904-
1905-
static void btusb_intel_version_info(struct hci_dev *hdev,
1906-
struct intel_version *ver)
1907-
{
1908-
const char *variant;
1909-
1910-
switch (ver->fw_variant) {
1911-
case 0x06:
1912-
variant = "Bootloader";
1913-
break;
1914-
case 0x23:
1915-
variant = "Firmware";
1916-
break;
1917-
default:
1918-
return;
1919-
}
1920-
1921-
BT_INFO("%s: %s revision %u.%u build %u week %u %u", hdev->name,
1922-
variant, ver->fw_revision >> 4, ver->fw_revision & 0x0f,
1923-
ver->fw_build_num, ver->fw_build_ww, 2000 + ver->fw_build_yy);
1924-
}
1925-
19261884
static int btusb_setup_intel_new(struct hci_dev *hdev)
19271885
{
19281886
static const u8 reset_param[] = { 0x00, 0x01, 0x00, 0x01,
@@ -1984,7 +1942,7 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
19841942
return -EINVAL;
19851943
}
19861944

1987-
btusb_intel_version_info(hdev, ver);
1945+
btintel_version_info(hdev, ver);
19881946

19891947
/* The firmware variant determines if the device is in bootloader
19901948
* mode or is running operational firmware. The value 0x06 identifies
@@ -2104,7 +2062,7 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
21042062
/* Start the firmware download transaction with the Init fragment
21052063
* represented by the 128 bytes of CSS header.
21062064
*/
2107-
err = btusb_intel_secure_send(hdev, 0x00, 128, fw->data);
2065+
err = btintel_secure_send(hdev, 0x00, 128, fw->data);
21082066
if (err < 0) {
21092067
BT_ERR("%s: Failed to send firmware header (%d)",
21102068
hdev->name, err);
@@ -2114,7 +2072,7 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
21142072
/* Send the 256 bytes of public key information from the firmware
21152073
* as the PKey fragment.
21162074
*/
2117-
err = btusb_intel_secure_send(hdev, 0x03, 256, fw->data + 128);
2075+
err = btintel_secure_send(hdev, 0x03, 256, fw->data + 128);
21182076
if (err < 0) {
21192077
BT_ERR("%s: Failed to send firmware public key (%d)",
21202078
hdev->name, err);
@@ -2124,7 +2082,7 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
21242082
/* Send the 256 bytes of signature information from the firmware
21252083
* as the Sign fragment.
21262084
*/
2127-
err = btusb_intel_secure_send(hdev, 0x02, 256, fw->data + 388);
2085+
err = btintel_secure_send(hdev, 0x02, 256, fw->data + 388);
21282086
if (err < 0) {
21292087
BT_ERR("%s: Failed to send firmware signature (%d)",
21302088
hdev->name, err);
@@ -2148,8 +2106,7 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
21482106
* firmware data buffer as a single Data fragement.
21492107
*/
21502108
if (!(frag_len % 4)) {
2151-
err = btusb_intel_secure_send(hdev, 0x01, frag_len,
2152-
fw_ptr);
2109+
err = btintel_secure_send(hdev, 0x01, frag_len, fw_ptr);
21532110
if (err < 0) {
21542111
BT_ERR("%s: Failed to send firmware data (%d)",
21552112
hdev->name, err);
@@ -2291,39 +2248,6 @@ static int btusb_setup_intel_new(struct hci_dev *hdev)
22912248
return 0;
22922249
}
22932250

2294-
static void btusb_hw_error_intel(struct hci_dev *hdev, u8 code)
2295-
{
2296-
struct sk_buff *skb;
2297-
u8 type = 0x00;
2298-
2299-
BT_ERR("%s: Hardware error 0x%2.2x", hdev->name, code);
2300-
2301-
skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT);
2302-
if (IS_ERR(skb)) {
2303-
BT_ERR("%s: Reset after hardware error failed (%ld)",
2304-
hdev->name, PTR_ERR(skb));
2305-
return;
2306-
}
2307-
kfree_skb(skb);
2308-
2309-
skb = __hci_cmd_sync(hdev, 0xfc22, 1, &type, HCI_INIT_TIMEOUT);
2310-
if (IS_ERR(skb)) {
2311-
BT_ERR("%s: Retrieving Intel exception info failed (%ld)",
2312-
hdev->name, PTR_ERR(skb));
2313-
return;
2314-
}
2315-
2316-
if (skb->len != 13) {
2317-
BT_ERR("%s: Exception info size mismatch", hdev->name);
2318-
kfree_skb(skb);
2319-
return;
2320-
}
2321-
2322-
BT_ERR("%s: Exception info %s", hdev->name, (char *)(skb->data + 1));
2323-
2324-
kfree_skb(skb);
2325-
}
2326-
23272251
static int btusb_shutdown_intel(struct hci_dev *hdev)
23282252
{
23292253
struct sk_buff *skb;
@@ -2783,7 +2707,7 @@ static int btusb_probe(struct usb_interface *intf,
27832707
if (id->driver_info & BTUSB_INTEL_NEW) {
27842708
hdev->send = btusb_send_frame_intel;
27852709
hdev->setup = btusb_setup_intel_new;
2786-
hdev->hw_error = btusb_hw_error_intel;
2710+
hdev->hw_error = btintel_hw_error;
27872711
hdev->set_bdaddr = btintel_set_bdaddr;
27882712
set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
27892713
}

drivers/bluetooth/dtl1_cs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ static void dtl1_control(struct dtl1_info *info, struct sk_buff *skb)
182182
int i;
183183

184184
printk(KERN_INFO "Bluetooth: Nokia control data =");
185-
for (i = 0; i < skb->len; i++) {
185+
for (i = 0; i < skb->len; i++)
186186
printk(" %02x", skb->data[i]);
187-
}
187+
188188
printk("\n");
189189

190190
/* transition to active state */
@@ -406,7 +406,7 @@ static int dtl1_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
406406
break;
407407
default:
408408
return -EILSEQ;
409-
};
409+
}
410410

411411
nsh.zero = 0;
412412
nsh.len = skb->len;

drivers/bluetooth/hci_h5.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ struct h5 {
7575
size_t rx_pending; /* Expecting more bytes */
7676
u8 rx_ack; /* Last ack number received */
7777

78-
int (*rx_func) (struct hci_uart *hu, u8 c);
78+
int (*rx_func)(struct hci_uart *hu, u8 c);
7979

8080
struct timer_list timer; /* Retransmission timer */
8181

0 commit comments

Comments
 (0)