Skip to content

Commit 3fd0202

Browse files
committed
Merge tag 'master-2014-07-25' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
John W. Linville says: ==================== pull request: wireless-next 2014-07-25 Please pull this batch of updates intended for the 3.17 stream! For the mac80211 bits, Johannes says: "We have a lot of TDLS patches, among them a fix that should make hwsim tests happy again. The rest, this time, is mostly small fixes." For the Bluetooth bits, Gustavo says: "Some more patches for 3.17. The most important change here is the move of the 6lowpan code to net/6lowpan. It has been agreed with Davem that this change will go through the bluetooth tree. The rest are mostly clean up and fixes." and, "Here follows some more patches for 3.17. These are mostly fixes to what we've sent to you before for next merge window." For the iwlwifi bits, Emmanuel says: "I have the usual amount of BT Coex stuff. Arik continues to work on TDLS and Ariej contributes a few things for HS2.0. I added a few more things to the firmware debugging infrastructure. Eran fixes a small bug - pretty normal content." And for the Atheros bits, Kalle says: "For ath6kl me and Jessica added support for ar6004 hw3.0, our latest version of ar6004. For ath10k Janusz added a printout so that it's easier to check what ath10k kconfig options are enabled. He also added a debugfs file to configure maximum amsdu and ampdu values. Also we had few fixes as usual." On top of that is the usual large batch of various driver updates -- brcmfmac, mwifiex, the TI drivers, and wil6210 all get some action. Rafał has also been very busy with b43 and related updates. Also, I pulled the wireless tree into this in order to resolve a merge conflict... P.S. The change to fs/compat_ioctl.c reflects a name change in a Bluetooth header file... ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents a67eed5 + 9a24440 commit 3fd0202

178 files changed

Lines changed: 6583 additions & 2761 deletions

File tree

Some content is hidden

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

‎MAINTAINERS‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ L: linux-scsi@vger.kernel.org
148148
S: Maintained
149149
F: drivers/scsi/53c700*
150150

151+
6LOWPAN GENERIC (BTLE/IEEE 802.15.4)
152+
M: Alexander Aring <alex.aring@gmail.com>
153+
L: linux-zigbee-devel@lists.sourceforge.net (moderated for non-subscribers)
154+
L: linux-bluetooth@vger.kernel.org
155+
S: Maintained
156+
F: net/6lowpan/
157+
151158
6PACK NETWORK DRIVER FOR AX.25
152159
M: Andreas Koensgen <ajk@comnets.uni-bremen.de>
153160
L: linux-hams@vger.kernel.org

‎drivers/bcma/driver_chipcommon_pmu.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ void bcma_pmu_spuravoid_pllupdate(struct bcma_drv_cc *cc, int spuravoid)
603603
tmp = BCMA_CC_PMU_CTL_PLL_UPD | BCMA_CC_PMU_CTL_NOILPONW;
604604
break;
605605

606+
case BCMA_CHIP_ID_BCM43217:
606607
case BCMA_CHIP_ID_BCM43227:
607608
case BCMA_CHIP_ID_BCM43228:
608609
case BCMA_CHIP_ID_BCM43428:

‎drivers/bcma/host_pci.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ static const struct pci_device_id bcma_pci_bridge_tbl[] = {
279279
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4358) },
280280
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4359) },
281281
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4365) },
282+
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) },
282283
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) },
283284
{ 0, },
284285
};

‎drivers/bcma/sprom.c‎

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,23 @@ static int bcma_sprom_valid(struct bcma_bus *bus, const u16 *sprom,
201201
SPEX(_field[7], _offset + 14, _mask, _shift); \
202202
} while (0)
203203

204+
static s8 sprom_extract_antgain(const u16 *in, u16 offset, u16 mask, u16 shift)
205+
{
206+
u16 v;
207+
u8 gain;
208+
209+
v = in[SPOFF(offset)];
210+
gain = (v & mask) >> shift;
211+
if (gain == 0xFF) {
212+
gain = 8; /* If unset use 2dBm */
213+
} else {
214+
/* Q5.2 Fractional part is stored in 0xC0 */
215+
gain = ((gain & 0xC0) >> 6) | ((gain & 0x3F) << 2);
216+
}
217+
218+
return (s8)gain;
219+
}
220+
204221
static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom)
205222
{
206223
u16 v, o;
@@ -381,14 +398,22 @@ static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom)
381398
SPEX32(ofdm5ghpo, SSB_SPROM8_OFDM5GHPO, ~0, 0);
382399

383400
/* Extract the antenna gain values. */
384-
SPEX(antenna_gain.a0, SSB_SPROM8_AGAIN01,
385-
SSB_SPROM8_AGAIN0, SSB_SPROM8_AGAIN0_SHIFT);
386-
SPEX(antenna_gain.a1, SSB_SPROM8_AGAIN01,
387-
SSB_SPROM8_AGAIN1, SSB_SPROM8_AGAIN1_SHIFT);
388-
SPEX(antenna_gain.a2, SSB_SPROM8_AGAIN23,
389-
SSB_SPROM8_AGAIN2, SSB_SPROM8_AGAIN2_SHIFT);
390-
SPEX(antenna_gain.a3, SSB_SPROM8_AGAIN23,
391-
SSB_SPROM8_AGAIN3, SSB_SPROM8_AGAIN3_SHIFT);
401+
bus->sprom.antenna_gain.a0 = sprom_extract_antgain(sprom,
402+
SSB_SPROM8_AGAIN01,
403+
SSB_SPROM8_AGAIN0,
404+
SSB_SPROM8_AGAIN0_SHIFT);
405+
bus->sprom.antenna_gain.a1 = sprom_extract_antgain(sprom,
406+
SSB_SPROM8_AGAIN01,
407+
SSB_SPROM8_AGAIN1,
408+
SSB_SPROM8_AGAIN1_SHIFT);
409+
bus->sprom.antenna_gain.a2 = sprom_extract_antgain(sprom,
410+
SSB_SPROM8_AGAIN23,
411+
SSB_SPROM8_AGAIN2,
412+
SSB_SPROM8_AGAIN2_SHIFT);
413+
bus->sprom.antenna_gain.a3 = sprom_extract_antgain(sprom,
414+
SSB_SPROM8_AGAIN23,
415+
SSB_SPROM8_AGAIN3,
416+
SSB_SPROM8_AGAIN3_SHIFT);
392417

393418
SPEX(leddc_on_time, SSB_SPROM8_LEDDC, SSB_SPROM8_LEDDC_ON,
394419
SSB_SPROM8_LEDDC_ON_SHIFT);
@@ -509,6 +534,7 @@ static bool bcma_sprom_onchip_available(struct bcma_bus *bus)
509534
/* for these chips OTP is always available */
510535
present = true;
511536
break;
537+
case BCMA_CHIP_ID_BCM43217:
512538
case BCMA_CHIP_ID_BCM43227:
513539
case BCMA_CHIP_ID_BCM43228:
514540
case BCMA_CHIP_ID_BCM43428:

‎drivers/bluetooth/ath3k.c‎

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include <linux/device.h>
2828
#include <linux/firmware.h>
2929
#include <linux/usb.h>
30+
#include <asm/unaligned.h>
3031
#include <net/bluetooth/bluetooth.h>
3132

3233
#define VERSION "1.0"
@@ -50,12 +51,12 @@
5051
#define ATH3K_NAME_LEN 0xFF
5152

5253
struct ath3k_version {
53-
unsigned int rom_version;
54-
unsigned int build_version;
55-
unsigned int ram_version;
56-
unsigned char ref_clock;
57-
unsigned char reserved[0x07];
58-
};
54+
__le32 rom_version;
55+
__le32 build_version;
56+
__le32 ram_version;
57+
__u8 ref_clock;
58+
__u8 reserved[7];
59+
} __packed;
5960

6061
static const struct usb_device_id ath3k_table[] = {
6162
/* Atheros AR3011 */
@@ -349,7 +350,8 @@ static int ath3k_load_patch(struct usb_device *udev)
349350
unsigned char fw_state;
350351
char filename[ATH3K_NAME_LEN] = {0};
351352
const struct firmware *firmware;
352-
struct ath3k_version fw_version, pt_version;
353+
struct ath3k_version fw_version;
354+
__u32 pt_rom_version, pt_build_version;
353355
int ret;
354356

355357
ret = ath3k_get_state(udev, &fw_state);
@@ -370,20 +372,21 @@ static int ath3k_load_patch(struct usb_device *udev)
370372
}
371373

372374
snprintf(filename, ATH3K_NAME_LEN, "ar3k/AthrBT_0x%08x.dfu",
373-
le32_to_cpu(fw_version.rom_version));
375+
le32_to_cpu(fw_version.rom_version));
374376

375377
ret = request_firmware(&firmware, filename, &udev->dev);
376378
if (ret < 0) {
377379
BT_ERR("Patch file not found %s", filename);
378380
return ret;
379381
}
380382

381-
pt_version.rom_version = *(int *)(firmware->data + firmware->size - 8);
382-
pt_version.build_version = *(int *)
383-
(firmware->data + firmware->size - 4);
383+
pt_rom_version = get_unaligned_le32(firmware->data +
384+
firmware->size - 8);
385+
pt_build_version = get_unaligned_le32(firmware->data +
386+
firmware->size - 4);
384387

385-
if ((pt_version.rom_version != fw_version.rom_version) ||
386-
(pt_version.build_version <= fw_version.build_version)) {
388+
if (pt_rom_version != le32_to_cpu(fw_version.rom_version) ||
389+
pt_build_version <= le32_to_cpu(fw_version.build_version)) {
387390
BT_ERR("Patch file version did not match with firmware");
388391
release_firmware(firmware);
389392
return -EINVAL;

‎drivers/bluetooth/btmrvl_drv.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ struct btmrvl_private {
9191

9292
/* Vendor specific Bluetooth commands */
9393
#define BT_CMD_PSCAN_WIN_REPORT_ENABLE 0xFC03
94+
#define BT_CMD_SET_BDADDR 0xFC22
9495
#define BT_CMD_AUTO_SLEEP_MODE 0xFC23
9596
#define BT_CMD_HOST_SLEEP_CONFIG 0xFC59
9697
#define BT_CMD_HOST_SLEEP_ENABLE 0xFC5A

‎drivers/bluetooth/btmrvl_main.c‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,29 @@ static int btmrvl_setup(struct hci_dev *hdev)
539539
return 0;
540540
}
541541

542+
static int btmrvl_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
543+
{
544+
struct sk_buff *skb;
545+
long ret;
546+
u8 buf[8];
547+
548+
buf[0] = MRVL_VENDOR_PKT;
549+
buf[1] = sizeof(bdaddr_t);
550+
memcpy(buf + 2, bdaddr, sizeof(bdaddr_t));
551+
552+
skb = __hci_cmd_sync(hdev, BT_CMD_SET_BDADDR, sizeof(buf), buf,
553+
HCI_INIT_TIMEOUT);
554+
if (IS_ERR(skb)) {
555+
ret = PTR_ERR(skb);
556+
BT_ERR("%s: changing btmrvl device address failed (%ld)",
557+
hdev->name, ret);
558+
return ret;
559+
}
560+
kfree_skb(skb);
561+
562+
return 0;
563+
}
564+
542565
/*
543566
* This function handles the event generated by firmware, rx data
544567
* received from firmware, and tx data sent from kernel.
@@ -632,6 +655,7 @@ int btmrvl_register_hdev(struct btmrvl_private *priv)
632655
hdev->flush = btmrvl_flush;
633656
hdev->send = btmrvl_send_frame;
634657
hdev->setup = btmrvl_setup;
658+
hdev->set_bdaddr = btmrvl_set_bdaddr;
635659

636660
hdev->dev_type = priv->btmrvl_dev.dev_type;
637661

‎drivers/bluetooth/btmrvl_sdio.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,17 +1169,17 @@ static int btmrvl_sdio_suspend(struct device *dev)
11691169
}
11701170

11711171
priv = card->priv;
1172+
hcidev = priv->btmrvl_dev.hcidev;
1173+
BT_DBG("%s: SDIO suspend", hcidev->name);
1174+
hci_suspend_dev(hcidev);
1175+
skb_queue_purge(&priv->adapter->tx_queue);
11721176

11731177
if (priv->adapter->hs_state != HS_ACTIVATED) {
11741178
if (btmrvl_enable_hs(priv)) {
11751179
BT_ERR("HS not actived, suspend failed!");
11761180
return -EBUSY;
11771181
}
11781182
}
1179-
hcidev = priv->btmrvl_dev.hcidev;
1180-
BT_DBG("%s: SDIO suspend", hcidev->name);
1181-
hci_suspend_dev(hcidev);
1182-
skb_queue_purge(&priv->adapter->tx_queue);
11831183

11841184
priv->adapter->is_suspended = true;
11851185

@@ -1221,13 +1221,13 @@ static int btmrvl_sdio_resume(struct device *dev)
12211221
return 0;
12221222
}
12231223

1224-
priv->adapter->is_suspended = false;
1225-
hcidev = priv->btmrvl_dev.hcidev;
1226-
BT_DBG("%s: SDIO resume", hcidev->name);
1227-
hci_resume_dev(hcidev);
12281224
priv->hw_wakeup_firmware(priv);
12291225
priv->adapter->hs_state = HS_DEACTIVATED;
1226+
hcidev = priv->btmrvl_dev.hcidev;
12301227
BT_DBG("%s: HS DEACTIVATED in resume!", hcidev->name);
1228+
priv->adapter->is_suspended = false;
1229+
BT_DBG("%s: SDIO resume", hcidev->name);
1230+
hci_resume_dev(hcidev);
12311231

12321232
return 0;
12331233
}

‎drivers/bluetooth/btusb.c‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ static struct usb_driver btusb_driver;
4848
#define BTUSB_INTEL 0x100
4949
#define BTUSB_INTEL_BOOT 0x200
5050
#define BTUSB_BCM_PATCHRAM 0x400
51+
#define BTUSB_MARVELL 0x800
5152

5253
static const struct usb_device_id btusb_table[] = {
5354
/* Generic Bluetooth USB device */
@@ -113,6 +114,9 @@ static const struct usb_device_id btusb_table[] = {
113114
{ USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01),
114115
.driver_info = BTUSB_BCM_PATCHRAM },
115116

117+
/* ASUSTek Computer - Broadcom based */
118+
{ USB_VENDOR_AND_INTERFACE_INFO(0x0b05, 0xff, 0x01, 0x01) },
119+
116120
/* Belkin F8065bf - Broadcom based */
117121
{ USB_VENDOR_AND_INTERFACE_INFO(0x050d, 0xff, 0x01, 0x01) },
118122

@@ -242,6 +246,10 @@ static const struct usb_device_id blacklist_table[] = {
242246
{ USB_DEVICE(0x8087, 0x07dc), .driver_info = BTUSB_INTEL },
243247
{ USB_DEVICE(0x8087, 0x0a2a), .driver_info = BTUSB_INTEL },
244248

249+
/* Marvell device */
250+
{ USB_DEVICE(0x1286, 0x2044), .driver_info = BTUSB_MARVELL },
251+
{ USB_DEVICE(0x1286, 0x2046), .driver_info = BTUSB_MARVELL },
252+
245253
{ } /* Terminating entry */
246254
};
247255

@@ -1455,6 +1463,29 @@ static int btusb_set_bdaddr_intel(struct hci_dev *hdev, const bdaddr_t *bdaddr)
14551463
return 0;
14561464
}
14571465

1466+
static int btusb_set_bdaddr_marvell(struct hci_dev *hdev,
1467+
const bdaddr_t *bdaddr)
1468+
{
1469+
struct sk_buff *skb;
1470+
u8 buf[8];
1471+
long ret;
1472+
1473+
buf[0] = 0xfe;
1474+
buf[1] = sizeof(bdaddr_t);
1475+
memcpy(buf + 2, bdaddr, sizeof(bdaddr_t));
1476+
1477+
skb = __hci_cmd_sync(hdev, 0xfc22, sizeof(buf), buf, HCI_INIT_TIMEOUT);
1478+
if (IS_ERR(skb)) {
1479+
ret = PTR_ERR(skb);
1480+
BT_ERR("%s: changing Marvell device address failed (%ld)",
1481+
hdev->name, ret);
1482+
return ret;
1483+
}
1484+
kfree_skb(skb);
1485+
1486+
return 0;
1487+
}
1488+
14581489
#define BDADDR_BCM20702A0 (&(bdaddr_t) {{0x00, 0xa0, 0x02, 0x70, 0x20, 0x00}})
14591490

14601491
static int btusb_setup_bcm_patchram(struct hci_dev *hdev)
@@ -1766,6 +1797,9 @@ static int btusb_probe(struct usb_interface *intf,
17661797
hdev->set_bdaddr = btusb_set_bdaddr_intel;
17671798
}
17681799

1800+
if (id->driver_info & BTUSB_MARVELL)
1801+
hdev->set_bdaddr = btusb_set_bdaddr_marvell;
1802+
17691803
if (id->driver_info & BTUSB_INTEL_BOOT)
17701804
set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
17711805

‎drivers/bluetooth/hci_ldisc.c‎

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,9 @@ static int hci_uart_register_dev(struct hci_uart *hu)
431431
if (test_bit(HCI_UART_RAW_DEVICE, &hu->hdev_flags))
432432
set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
433433

434+
if (test_bit(HCI_UART_EXT_CONFIG, &hu->hdev_flags))
435+
set_bit(HCI_QUIRK_EXTERNAL_CONFIG, &hdev->quirks);
436+
434437
if (!test_bit(HCI_UART_RESET_ON_INIT, &hu->hdev_flags))
435438
set_bit(HCI_QUIRK_RESET_ON_CLOSE, &hdev->quirks);
436439

@@ -477,6 +480,22 @@ static int hci_uart_set_proto(struct hci_uart *hu, int id)
477480
return 0;
478481
}
479482

483+
static int hci_uart_set_flags(struct hci_uart *hu, unsigned long flags)
484+
{
485+
unsigned long valid_flags = BIT(HCI_UART_RAW_DEVICE) |
486+
BIT(HCI_UART_RESET_ON_INIT) |
487+
BIT(HCI_UART_CREATE_AMP) |
488+
BIT(HCI_UART_INIT_PENDING) |
489+
BIT(HCI_UART_EXT_CONFIG);
490+
491+
if ((flags & ~valid_flags))
492+
return -EINVAL;
493+
494+
hu->hdev_flags = flags;
495+
496+
return 0;
497+
}
498+
480499
/* hci_uart_tty_ioctl()
481500
*
482501
* Process IOCTL system call for the tty device.
@@ -520,14 +539,16 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file * file,
520539
return -EUNATCH;
521540

522541
case HCIUARTGETDEVICE:
523-
if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
542+
if (test_bit(HCI_UART_REGISTERED, &hu->flags))
524543
return hu->hdev->id;
525544
return -EUNATCH;
526545

527546
case HCIUARTSETFLAGS:
528547
if (test_bit(HCI_UART_PROTO_SET, &hu->flags))
529548
return -EBUSY;
530-
hu->hdev_flags = arg;
549+
err = hci_uart_set_flags(hu, arg);
550+
if (err)
551+
return err;
531552
break;
532553

533554
case HCIUARTGETFLAGS:

0 commit comments

Comments
 (0)