diff options
author | John W. Linville <linville@tuxdriver.com> | 2013-09-27 13:09:17 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-09-27 13:11:17 -0400 |
commit | 0a878747e18d4d14c5b772dcddddd86bb4c26f8f (patch) | |
tree | b214678a35945e2c84a82192df79472923fdbcba | |
parent | f875691640cd3fa67f7ad1d3130ff9fa7fdca042 (diff) | |
parent | c7515d2365a6b8a018950198ebe1f5be793cd4bb (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless into for-davem
Also fixed-up a badly indented closing brace...
Signed-off-by: John W. Linville <linville@tuxdriver.com>
27 files changed, 128 insertions, 147 deletions
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c index c9fd6943ce45..50329d1057ed 100644 --- a/drivers/bcma/driver_pci.c +++ b/drivers/bcma/driver_pci.c | |||
@@ -210,25 +210,6 @@ static void bcma_core_pci_config_fixup(struct bcma_drv_pci *pc) | |||
210 | } | 210 | } |
211 | } | 211 | } |
212 | 212 | ||
213 | static void bcma_core_pci_power_save(struct bcma_drv_pci *pc, bool up) | ||
214 | { | ||
215 | u16 data; | ||
216 | |||
217 | if (pc->core->id.rev >= 15 && pc->core->id.rev <= 20) { | ||
218 | data = up ? 0x74 : 0x7C; | ||
219 | bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, | ||
220 | BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7F64); | ||
221 | bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, | ||
222 | BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data); | ||
223 | } else if (pc->core->id.rev >= 21 && pc->core->id.rev <= 22) { | ||
224 | data = up ? 0x75 : 0x7D; | ||
225 | bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, | ||
226 | BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7E65); | ||
227 | bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, | ||
228 | BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data); | ||
229 | } | ||
230 | } | ||
231 | |||
232 | /************************************************** | 213 | /************************************************** |
233 | * Init. | 214 | * Init. |
234 | **************************************************/ | 215 | **************************************************/ |
@@ -255,6 +236,32 @@ void bcma_core_pci_init(struct bcma_drv_pci *pc) | |||
255 | bcma_core_pci_clientmode_init(pc); | 236 | bcma_core_pci_clientmode_init(pc); |
256 | } | 237 | } |
257 | 238 | ||
239 | void bcma_core_pci_power_save(struct bcma_bus *bus, bool up) | ||
240 | { | ||
241 | struct bcma_drv_pci *pc; | ||
242 | u16 data; | ||
243 | |||
244 | if (bus->hosttype != BCMA_HOSTTYPE_PCI) | ||
245 | return; | ||
246 | |||
247 | pc = &bus->drv_pci[0]; | ||
248 | |||
249 | if (pc->core->id.rev >= 15 && pc->core->id.rev <= 20) { | ||
250 | data = up ? 0x74 : 0x7C; | ||
251 | bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, | ||
252 | BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7F64); | ||
253 | bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, | ||
254 | BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data); | ||
255 | } else if (pc->core->id.rev >= 21 && pc->core->id.rev <= 22) { | ||
256 | data = up ? 0x75 : 0x7D; | ||
257 | bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, | ||
258 | BCMA_CORE_PCI_MDIO_BLK1_MGMT1, 0x7E65); | ||
259 | bcma_pcie_mdio_writeread(pc, BCMA_CORE_PCI_MDIO_BLK1, | ||
260 | BCMA_CORE_PCI_MDIO_BLK1_MGMT3, data); | ||
261 | } | ||
262 | } | ||
263 | EXPORT_SYMBOL_GPL(bcma_core_pci_power_save); | ||
264 | |||
258 | int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core, | 265 | int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core, |
259 | bool enable) | 266 | bool enable) |
260 | { | 267 | { |
@@ -310,8 +317,6 @@ void bcma_core_pci_up(struct bcma_bus *bus) | |||
310 | 317 | ||
311 | pc = &bus->drv_pci[0]; | 318 | pc = &bus->drv_pci[0]; |
312 | 319 | ||
313 | bcma_core_pci_power_save(pc, true); | ||
314 | |||
315 | bcma_core_pci_extend_L1timer(pc, true); | 320 | bcma_core_pci_extend_L1timer(pc, true); |
316 | } | 321 | } |
317 | EXPORT_SYMBOL_GPL(bcma_core_pci_up); | 322 | EXPORT_SYMBOL_GPL(bcma_core_pci_up); |
@@ -326,7 +331,5 @@ void bcma_core_pci_down(struct bcma_bus *bus) | |||
326 | pc = &bus->drv_pci[0]; | 331 | pc = &bus->drv_pci[0]; |
327 | 332 | ||
328 | bcma_core_pci_extend_L1timer(pc, false); | 333 | bcma_core_pci_extend_L1timer(pc, false); |
329 | |||
330 | bcma_core_pci_power_save(pc, false); | ||
331 | } | 334 | } |
332 | EXPORT_SYMBOL_GPL(bcma_core_pci_down); | 335 | EXPORT_SYMBOL_GPL(bcma_core_pci_down); |
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index a12b923bbaca..0a327f4154a2 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c | |||
@@ -85,6 +85,7 @@ static struct usb_device_id ath3k_table[] = { | |||
85 | { USB_DEVICE(0x04CA, 0x3008) }, | 85 | { USB_DEVICE(0x04CA, 0x3008) }, |
86 | { USB_DEVICE(0x13d3, 0x3362) }, | 86 | { USB_DEVICE(0x13d3, 0x3362) }, |
87 | { USB_DEVICE(0x0CF3, 0xE004) }, | 87 | { USB_DEVICE(0x0CF3, 0xE004) }, |
88 | { USB_DEVICE(0x0CF3, 0xE005) }, | ||
88 | { USB_DEVICE(0x0930, 0x0219) }, | 89 | { USB_DEVICE(0x0930, 0x0219) }, |
89 | { USB_DEVICE(0x0489, 0xe057) }, | 90 | { USB_DEVICE(0x0489, 0xe057) }, |
90 | { USB_DEVICE(0x13d3, 0x3393) }, | 91 | { USB_DEVICE(0x13d3, 0x3393) }, |
@@ -126,6 +127,7 @@ static struct usb_device_id ath3k_blist_tbl[] = { | |||
126 | { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, | 127 | { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, |
127 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, | 128 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, |
128 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, | 129 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, |
130 | { USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 }, | ||
129 | { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, | 131 | { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, |
130 | { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 }, | 132 | { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 }, |
131 | { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 }, | 133 | { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 }, |
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 8e16f0af6358..f3dfc0a88fdc 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
@@ -102,6 +102,7 @@ static struct usb_device_id btusb_table[] = { | |||
102 | 102 | ||
103 | /* Broadcom BCM20702A0 */ | 103 | /* Broadcom BCM20702A0 */ |
104 | { USB_DEVICE(0x0b05, 0x17b5) }, | 104 | { USB_DEVICE(0x0b05, 0x17b5) }, |
105 | { USB_DEVICE(0x0b05, 0x17cb) }, | ||
105 | { USB_DEVICE(0x04ca, 0x2003) }, | 106 | { USB_DEVICE(0x04ca, 0x2003) }, |
106 | { USB_DEVICE(0x0489, 0xe042) }, | 107 | { USB_DEVICE(0x0489, 0xe042) }, |
107 | { USB_DEVICE(0x413c, 0x8197) }, | 108 | { USB_DEVICE(0x413c, 0x8197) }, |
@@ -112,6 +113,9 @@ static struct usb_device_id btusb_table[] = { | |||
112 | /*Broadcom devices with vendor specific id */ | 113 | /*Broadcom devices with vendor specific id */ |
113 | { USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01) }, | 114 | { USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01) }, |
114 | 115 | ||
116 | /* Belkin F8065bf - Broadcom based */ | ||
117 | { USB_VENDOR_AND_INTERFACE_INFO(0x050d, 0xff, 0x01, 0x01) }, | ||
118 | |||
115 | { } /* Terminating entry */ | 119 | { } /* Terminating entry */ |
116 | }; | 120 | }; |
117 | 121 | ||
@@ -148,6 +152,7 @@ static struct usb_device_id blacklist_table[] = { | |||
148 | { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, | 152 | { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, |
149 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, | 153 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, |
150 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, | 154 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, |
155 | { USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 }, | ||
151 | { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, | 156 | { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, |
152 | { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 }, | 157 | { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 }, |
153 | { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 }, | 158 | { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 }, |
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 4ee472a5a4e4..ab9e3a8410bc 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -1270,13 +1270,6 @@ static void ath9k_antenna_check(struct ath_softc *sc, | |||
1270 | return; | 1270 | return; |
1271 | 1271 | ||
1272 | /* | 1272 | /* |
1273 | * All MPDUs in an aggregate will use the same LNA | ||
1274 | * as the first MPDU. | ||
1275 | */ | ||
1276 | if (rs->rs_isaggr && !rs->rs_firstaggr) | ||
1277 | return; | ||
1278 | |||
1279 | /* | ||
1280 | * Change the default rx antenna if rx diversity | 1273 | * Change the default rx antenna if rx diversity |
1281 | * chooses the other antenna 3 times in a row. | 1274 | * chooses the other antenna 3 times in a row. |
1282 | */ | 1275 | */ |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 35b515fe3ffa..5ac713d2ff5d 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -399,6 +399,7 @@ static struct ath_buf* ath_clone_txbuf(struct ath_softc *sc, struct ath_buf *bf) | |||
399 | tbf->bf_buf_addr = bf->bf_buf_addr; | 399 | tbf->bf_buf_addr = bf->bf_buf_addr; |
400 | memcpy(tbf->bf_desc, bf->bf_desc, sc->sc_ah->caps.tx_desc_len); | 400 | memcpy(tbf->bf_desc, bf->bf_desc, sc->sc_ah->caps.tx_desc_len); |
401 | tbf->bf_state = bf->bf_state; | 401 | tbf->bf_state = bf->bf_state; |
402 | tbf->bf_state.stale = false; | ||
402 | 403 | ||
403 | return tbf; | 404 | return tbf; |
404 | } | 405 | } |
@@ -1389,11 +1390,15 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, | |||
1389 | u16 tid, u16 *ssn) | 1390 | u16 tid, u16 *ssn) |
1390 | { | 1391 | { |
1391 | struct ath_atx_tid *txtid; | 1392 | struct ath_atx_tid *txtid; |
1393 | struct ath_txq *txq; | ||
1392 | struct ath_node *an; | 1394 | struct ath_node *an; |
1393 | u8 density; | 1395 | u8 density; |
1394 | 1396 | ||
1395 | an = (struct ath_node *)sta->drv_priv; | 1397 | an = (struct ath_node *)sta->drv_priv; |
1396 | txtid = ATH_AN_2_TID(an, tid); | 1398 | txtid = ATH_AN_2_TID(an, tid); |
1399 | txq = txtid->ac->txq; | ||
1400 | |||
1401 | ath_txq_lock(sc, txq); | ||
1397 | 1402 | ||
1398 | /* update ampdu factor/density, they may have changed. This may happen | 1403 | /* update ampdu factor/density, they may have changed. This may happen |
1399 | * in HT IBSS when a beacon with HT-info is received after the station | 1404 | * in HT IBSS when a beacon with HT-info is received after the station |
@@ -1417,6 +1422,8 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, | |||
1417 | memset(txtid->tx_buf, 0, sizeof(txtid->tx_buf)); | 1422 | memset(txtid->tx_buf, 0, sizeof(txtid->tx_buf)); |
1418 | txtid->baw_head = txtid->baw_tail = 0; | 1423 | txtid->baw_head = txtid->baw_tail = 0; |
1419 | 1424 | ||
1425 | ath_txq_unlock_complete(sc, txq); | ||
1426 | |||
1420 | return 0; | 1427 | return 0; |
1421 | } | 1428 | } |
1422 | 1429 | ||
@@ -1555,8 +1562,10 @@ void ath9k_release_buffered_frames(struct ieee80211_hw *hw, | |||
1555 | __skb_unlink(bf->bf_mpdu, tid_q); | 1562 | __skb_unlink(bf->bf_mpdu, tid_q); |
1556 | list_add_tail(&bf->list, &bf_q); | 1563 | list_add_tail(&bf->list, &bf_q); |
1557 | ath_set_rates(tid->an->vif, tid->an->sta, bf); | 1564 | ath_set_rates(tid->an->vif, tid->an->sta, bf); |
1558 | ath_tx_addto_baw(sc, tid, bf); | 1565 | if (bf_isampdu(bf)) { |
1559 | bf->bf_state.bf_type &= ~BUF_AGGR; | 1566 | ath_tx_addto_baw(sc, tid, bf); |
1567 | bf->bf_state.bf_type &= ~BUF_AGGR; | ||
1568 | } | ||
1560 | if (bf_tail) | 1569 | if (bf_tail) |
1561 | bf_tail->bf_next = bf; | 1570 | bf_tail->bf_next = bf; |
1562 | 1571 | ||
@@ -1950,7 +1959,9 @@ static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, | |||
1950 | if (bf_is_ampdu_not_probing(bf)) | 1959 | if (bf_is_ampdu_not_probing(bf)) |
1951 | txq->axq_ampdu_depth++; | 1960 | txq->axq_ampdu_depth++; |
1952 | 1961 | ||
1953 | bf = bf->bf_lastbf->bf_next; | 1962 | bf_last = bf->bf_lastbf; |
1963 | bf = bf_last->bf_next; | ||
1964 | bf_last->bf_next = NULL; | ||
1954 | } | 1965 | } |
1955 | } | 1966 | } |
1956 | } | 1967 | } |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c index 64f4a2bc8dde..c3462b75bd08 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c | |||
@@ -464,8 +464,6 @@ static struct sdio_driver brcmf_sdmmc_driver = { | |||
464 | 464 | ||
465 | static int brcmf_sdio_pd_probe(struct platform_device *pdev) | 465 | static int brcmf_sdio_pd_probe(struct platform_device *pdev) |
466 | { | 466 | { |
467 | int ret; | ||
468 | |||
469 | brcmf_dbg(SDIO, "Enter\n"); | 467 | brcmf_dbg(SDIO, "Enter\n"); |
470 | 468 | ||
471 | brcmfmac_sdio_pdata = pdev->dev.platform_data; | 469 | brcmfmac_sdio_pdata = pdev->dev.platform_data; |
@@ -473,11 +471,7 @@ static int brcmf_sdio_pd_probe(struct platform_device *pdev) | |||
473 | if (brcmfmac_sdio_pdata->power_on) | 471 | if (brcmfmac_sdio_pdata->power_on) |
474 | brcmfmac_sdio_pdata->power_on(); | 472 | brcmfmac_sdio_pdata->power_on(); |
475 | 473 | ||
476 | ret = sdio_register_driver(&brcmf_sdmmc_driver); | 474 | return 0; |
477 | if (ret) | ||
478 | brcmf_err("sdio_register_driver failed: %d\n", ret); | ||
479 | |||
480 | return ret; | ||
481 | } | 475 | } |
482 | 476 | ||
483 | static int brcmf_sdio_pd_remove(struct platform_device *pdev) | 477 | static int brcmf_sdio_pd_remove(struct platform_device *pdev) |
@@ -500,6 +494,15 @@ static struct platform_driver brcmf_sdio_pd = { | |||
500 | } | 494 | } |
501 | }; | 495 | }; |
502 | 496 | ||
497 | void brcmf_sdio_register(void) | ||
498 | { | ||
499 | int ret; | ||
500 | |||
501 | ret = sdio_register_driver(&brcmf_sdmmc_driver); | ||
502 | if (ret) | ||
503 | brcmf_err("sdio_register_driver failed: %d\n", ret); | ||
504 | } | ||
505 | |||
503 | void brcmf_sdio_exit(void) | 506 | void brcmf_sdio_exit(void) |
504 | { | 507 | { |
505 | brcmf_dbg(SDIO, "Enter\n"); | 508 | brcmf_dbg(SDIO, "Enter\n"); |
@@ -510,18 +513,13 @@ void brcmf_sdio_exit(void) | |||
510 | sdio_unregister_driver(&brcmf_sdmmc_driver); | 513 | sdio_unregister_driver(&brcmf_sdmmc_driver); |
511 | } | 514 | } |
512 | 515 | ||
513 | void brcmf_sdio_init(void) | 516 | void __init brcmf_sdio_init(void) |
514 | { | 517 | { |
515 | int ret; | 518 | int ret; |
516 | 519 | ||
517 | brcmf_dbg(SDIO, "Enter\n"); | 520 | brcmf_dbg(SDIO, "Enter\n"); |
518 | 521 | ||
519 | ret = platform_driver_probe(&brcmf_sdio_pd, brcmf_sdio_pd_probe); | 522 | ret = platform_driver_probe(&brcmf_sdio_pd, brcmf_sdio_pd_probe); |
520 | if (ret == -ENODEV) { | 523 | if (ret == -ENODEV) |
521 | brcmf_dbg(SDIO, "No platform data available, registering without.\n"); | 524 | brcmf_dbg(SDIO, "No platform data available.\n"); |
522 | ret = sdio_register_driver(&brcmf_sdmmc_driver); | ||
523 | } | ||
524 | |||
525 | if (ret) | ||
526 | brcmf_err("driver registration failed: %d\n", ret); | ||
527 | } | 525 | } |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h index f7c1985844e4..74156f84180c 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h | |||
@@ -156,10 +156,11 @@ extern int brcmf_bus_start(struct device *dev); | |||
156 | #ifdef CONFIG_BRCMFMAC_SDIO | 156 | #ifdef CONFIG_BRCMFMAC_SDIO |
157 | extern void brcmf_sdio_exit(void); | 157 | extern void brcmf_sdio_exit(void); |
158 | extern void brcmf_sdio_init(void); | 158 | extern void brcmf_sdio_init(void); |
159 | extern void brcmf_sdio_register(void); | ||
159 | #endif | 160 | #endif |
160 | #ifdef CONFIG_BRCMFMAC_USB | 161 | #ifdef CONFIG_BRCMFMAC_USB |
161 | extern void brcmf_usb_exit(void); | 162 | extern void brcmf_usb_exit(void); |
162 | extern void brcmf_usb_init(void); | 163 | extern void brcmf_usb_register(void); |
163 | #endif | 164 | #endif |
164 | 165 | ||
165 | #endif /* _BRCMF_BUS_H_ */ | 166 | #endif /* _BRCMF_BUS_H_ */ |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c index e067aec1fbf1..40e7f854e10f 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | |||
@@ -1231,21 +1231,23 @@ u32 brcmf_get_chip_info(struct brcmf_if *ifp) | |||
1231 | return bus->chip << 4 | bus->chiprev; | 1231 | return bus->chip << 4 | bus->chiprev; |
1232 | } | 1232 | } |
1233 | 1233 | ||
1234 | static void brcmf_driver_init(struct work_struct *work) | 1234 | static void brcmf_driver_register(struct work_struct *work) |
1235 | { | 1235 | { |
1236 | brcmf_debugfs_init(); | ||
1237 | |||
1238 | #ifdef CONFIG_BRCMFMAC_SDIO | 1236 | #ifdef CONFIG_BRCMFMAC_SDIO |
1239 | brcmf_sdio_init(); | 1237 | brcmf_sdio_register(); |
1240 | #endif | 1238 | #endif |
1241 | #ifdef CONFIG_BRCMFMAC_USB | 1239 | #ifdef CONFIG_BRCMFMAC_USB |
1242 | brcmf_usb_init(); | 1240 | brcmf_usb_register(); |
1243 | #endif | 1241 | #endif |
1244 | } | 1242 | } |
1245 | static DECLARE_WORK(brcmf_driver_work, brcmf_driver_init); | 1243 | static DECLARE_WORK(brcmf_driver_work, brcmf_driver_register); |
1246 | 1244 | ||
1247 | static int __init brcmfmac_module_init(void) | 1245 | static int __init brcmfmac_module_init(void) |
1248 | { | 1246 | { |
1247 | brcmf_debugfs_init(); | ||
1248 | #ifdef CONFIG_BRCMFMAC_SDIO | ||
1249 | brcmf_sdio_init(); | ||
1250 | #endif | ||
1249 | if (!schedule_work(&brcmf_driver_work)) | 1251 | if (!schedule_work(&brcmf_driver_work)) |
1250 | return -EBUSY; | 1252 | return -EBUSY; |
1251 | 1253 | ||
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/brcm80211/brcmfmac/usb.c index 39e01a7c8556..f4aea47e0730 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c | |||
@@ -1539,7 +1539,7 @@ void brcmf_usb_exit(void) | |||
1539 | brcmf_release_fw(&fw_image_list); | 1539 | brcmf_release_fw(&fw_image_list); |
1540 | } | 1540 | } |
1541 | 1541 | ||
1542 | void brcmf_usb_init(void) | 1542 | void brcmf_usb_register(void) |
1543 | { | 1543 | { |
1544 | brcmf_dbg(USB, "Enter\n"); | 1544 | brcmf_dbg(USB, "Enter\n"); |
1545 | INIT_LIST_HEAD(&fw_image_list); | 1545 | INIT_LIST_HEAD(&fw_image_list); |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c index 3a6544710c8a..edc5d105ff98 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c | |||
@@ -457,6 +457,8 @@ static int brcms_ops_start(struct ieee80211_hw *hw) | |||
457 | if (err != 0) | 457 | if (err != 0) |
458 | brcms_err(wl->wlc->hw->d11core, "%s: brcms_up() returned %d\n", | 458 | brcms_err(wl->wlc->hw->d11core, "%s: brcms_up() returned %d\n", |
459 | __func__, err); | 459 | __func__, err); |
460 | |||
461 | bcma_core_pci_power_save(wl->wlc->hw->d11core->bus, true); | ||
460 | return err; | 462 | return err; |
461 | } | 463 | } |
462 | 464 | ||
@@ -479,6 +481,8 @@ static void brcms_ops_stop(struct ieee80211_hw *hw) | |||
479 | return; | 481 | return; |
480 | } | 482 | } |
481 | 483 | ||
484 | bcma_core_pci_power_save(wl->wlc->hw->d11core->bus, false); | ||
485 | |||
482 | /* put driver in down state */ | 486 | /* put driver in down state */ |
483 | spin_lock_bh(&wl->lock); | 487 | spin_lock_bh(&wl->lock); |
484 | brcms_down(wl); | 488 | brcms_down(wl); |
diff --git a/drivers/net/wireless/cw1200/cw1200_spi.c b/drivers/net/wireless/cw1200/cw1200_spi.c index f5e6b489ed32..899cad34ccd3 100644 --- a/drivers/net/wireless/cw1200/cw1200_spi.c +++ b/drivers/net/wireless/cw1200/cw1200_spi.c | |||
@@ -42,7 +42,6 @@ struct hwbus_priv { | |||
42 | spinlock_t lock; /* Serialize all bus operations */ | 42 | spinlock_t lock; /* Serialize all bus operations */ |
43 | wait_queue_head_t wq; | 43 | wait_queue_head_t wq; |
44 | int claimed; | 44 | int claimed; |
45 | int irq_disabled; | ||
46 | }; | 45 | }; |
47 | 46 | ||
48 | #define SDIO_TO_SPI_ADDR(addr) ((addr & 0x1f)>>2) | 47 | #define SDIO_TO_SPI_ADDR(addr) ((addr & 0x1f)>>2) |
@@ -238,8 +237,6 @@ static irqreturn_t cw1200_spi_irq_handler(int irq, void *dev_id) | |||
238 | struct hwbus_priv *self = dev_id; | 237 | struct hwbus_priv *self = dev_id; |
239 | 238 | ||
240 | if (self->core) { | 239 | if (self->core) { |
241 | disable_irq_nosync(self->func->irq); | ||
242 | self->irq_disabled = 1; | ||
243 | cw1200_irq_handler(self->core); | 240 | cw1200_irq_handler(self->core); |
244 | return IRQ_HANDLED; | 241 | return IRQ_HANDLED; |
245 | } else { | 242 | } else { |
@@ -253,9 +250,10 @@ static int cw1200_spi_irq_subscribe(struct hwbus_priv *self) | |||
253 | 250 | ||
254 | pr_debug("SW IRQ subscribe\n"); | 251 | pr_debug("SW IRQ subscribe\n"); |
255 | 252 | ||
256 | ret = request_any_context_irq(self->func->irq, cw1200_spi_irq_handler, | 253 | ret = request_threaded_irq(self->func->irq, NULL, |
257 | IRQF_TRIGGER_HIGH, | 254 | cw1200_spi_irq_handler, |
258 | "cw1200_wlan_irq", self); | 255 | IRQF_TRIGGER_HIGH | IRQF_ONESHOT, |
256 | "cw1200_wlan_irq", self); | ||
259 | if (WARN_ON(ret < 0)) | 257 | if (WARN_ON(ret < 0)) |
260 | goto exit; | 258 | goto exit; |
261 | 259 | ||
@@ -273,22 +271,13 @@ exit: | |||
273 | 271 | ||
274 | static int cw1200_spi_irq_unsubscribe(struct hwbus_priv *self) | 272 | static int cw1200_spi_irq_unsubscribe(struct hwbus_priv *self) |
275 | { | 273 | { |
274 | int ret = 0; | ||
275 | |||
276 | pr_debug("SW IRQ unsubscribe\n"); | 276 | pr_debug("SW IRQ unsubscribe\n"); |
277 | disable_irq_wake(self->func->irq); | 277 | disable_irq_wake(self->func->irq); |
278 | free_irq(self->func->irq, self); | 278 | free_irq(self->func->irq, self); |
279 | 279 | ||
280 | return 0; | 280 | return ret; |
281 | } | ||
282 | |||
283 | static int cw1200_spi_irq_enable(struct hwbus_priv *self, int enable) | ||
284 | { | ||
285 | /* Disables are handled by the interrupt handler */ | ||
286 | if (enable && self->irq_disabled) { | ||
287 | enable_irq(self->func->irq); | ||
288 | self->irq_disabled = 0; | ||
289 | } | ||
290 | |||
291 | return 0; | ||
292 | } | 281 | } |
293 | 282 | ||
294 | static int cw1200_spi_off(const struct cw1200_platform_data_spi *pdata) | 283 | static int cw1200_spi_off(const struct cw1200_platform_data_spi *pdata) |
@@ -368,7 +357,6 @@ static struct hwbus_ops cw1200_spi_hwbus_ops = { | |||
368 | .unlock = cw1200_spi_unlock, | 357 | .unlock = cw1200_spi_unlock, |
369 | .align_size = cw1200_spi_align_size, | 358 | .align_size = cw1200_spi_align_size, |
370 | .power_mgmt = cw1200_spi_pm, | 359 | .power_mgmt = cw1200_spi_pm, |
371 | .irq_enable = cw1200_spi_irq_enable, | ||
372 | }; | 360 | }; |
373 | 361 | ||
374 | /* Probe Function to be called by SPI stack when device is discovered */ | 362 | /* Probe Function to be called by SPI stack when device is discovered */ |
diff --git a/drivers/net/wireless/cw1200/fwio.c b/drivers/net/wireless/cw1200/fwio.c index 0b2061bbc68b..acdff0f7f952 100644 --- a/drivers/net/wireless/cw1200/fwio.c +++ b/drivers/net/wireless/cw1200/fwio.c | |||
@@ -485,7 +485,7 @@ int cw1200_load_firmware(struct cw1200_common *priv) | |||
485 | 485 | ||
486 | /* Enable interrupt signalling */ | 486 | /* Enable interrupt signalling */ |
487 | priv->hwbus_ops->lock(priv->hwbus_priv); | 487 | priv->hwbus_ops->lock(priv->hwbus_priv); |
488 | ret = __cw1200_irq_enable(priv, 2); | 488 | ret = __cw1200_irq_enable(priv, 1); |
489 | priv->hwbus_ops->unlock(priv->hwbus_priv); | 489 | priv->hwbus_ops->unlock(priv->hwbus_priv); |
490 | if (ret < 0) | 490 | if (ret < 0) |
491 | goto unsubscribe; | 491 | goto unsubscribe; |
diff --git a/drivers/net/wireless/cw1200/hwbus.h b/drivers/net/wireless/cw1200/hwbus.h index 51dfb3a90735..8b2fc831c3de 100644 --- a/drivers/net/wireless/cw1200/hwbus.h +++ b/drivers/net/wireless/cw1200/hwbus.h | |||
@@ -28,7 +28,6 @@ struct hwbus_ops { | |||
28 | void (*unlock)(struct hwbus_priv *self); | 28 | void (*unlock)(struct hwbus_priv *self); |
29 | size_t (*align_size)(struct hwbus_priv *self, size_t size); | 29 | size_t (*align_size)(struct hwbus_priv *self, size_t size); |
30 | int (*power_mgmt)(struct hwbus_priv *self, bool suspend); | 30 | int (*power_mgmt)(struct hwbus_priv *self, bool suspend); |
31 | int (*irq_enable)(struct hwbus_priv *self, int enable); | ||
32 | }; | 31 | }; |
33 | 32 | ||
34 | #endif /* CW1200_HWBUS_H */ | 33 | #endif /* CW1200_HWBUS_H */ |
diff --git a/drivers/net/wireless/cw1200/hwio.c b/drivers/net/wireless/cw1200/hwio.c index 41bd7615ccaa..ff230b7aeedd 100644 --- a/drivers/net/wireless/cw1200/hwio.c +++ b/drivers/net/wireless/cw1200/hwio.c | |||
@@ -273,21 +273,6 @@ int __cw1200_irq_enable(struct cw1200_common *priv, int enable) | |||
273 | u16 val16; | 273 | u16 val16; |
274 | int ret; | 274 | int ret; |
275 | 275 | ||
276 | /* We need to do this hack because the SPI layer can sleep on I/O | ||
277 | and the general path involves I/O to the device in interrupt | ||
278 | context. | ||
279 | |||
280 | However, the initial enable call needs to go to the hardware. | ||
281 | |||
282 | We don't worry about shutdown because we do a full reset which | ||
283 | clears the interrupt enabled bits. | ||
284 | */ | ||
285 | if (priv->hwbus_ops->irq_enable) { | ||
286 | ret = priv->hwbus_ops->irq_enable(priv->hwbus_priv, enable); | ||
287 | if (ret || enable < 2) | ||
288 | return ret; | ||
289 | } | ||
290 | |||
291 | if (HIF_8601_SILICON == priv->hw_type) { | 276 | if (HIF_8601_SILICON == priv->hw_type) { |
292 | ret = __cw1200_reg_read_32(priv, ST90TDS_CONFIG_REG_ID, &val32); | 277 | ret = __cw1200_reg_read_32(priv, ST90TDS_CONFIG_REG_ID, &val32); |
293 | if (ret < 0) { | 278 | if (ret < 0) { |
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.c b/drivers/net/wireless/mwifiex/11n_aggr.c index 21c688264708..1214c587fd08 100644 --- a/drivers/net/wireless/mwifiex/11n_aggr.c +++ b/drivers/net/wireless/mwifiex/11n_aggr.c | |||
@@ -150,7 +150,7 @@ mwifiex_11n_form_amsdu_txpd(struct mwifiex_private *priv, | |||
150 | */ | 150 | */ |
151 | int | 151 | int |
152 | mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, | 152 | mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, |
153 | struct mwifiex_ra_list_tbl *pra_list, int headroom, | 153 | struct mwifiex_ra_list_tbl *pra_list, |
154 | int ptrindex, unsigned long ra_list_flags) | 154 | int ptrindex, unsigned long ra_list_flags) |
155 | __releases(&priv->wmm.ra_list_spinlock) | 155 | __releases(&priv->wmm.ra_list_spinlock) |
156 | { | 156 | { |
@@ -160,6 +160,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, | |||
160 | int pad = 0, ret; | 160 | int pad = 0, ret; |
161 | struct mwifiex_tx_param tx_param; | 161 | struct mwifiex_tx_param tx_param; |
162 | struct txpd *ptx_pd = NULL; | 162 | struct txpd *ptx_pd = NULL; |
163 | int headroom = adapter->iface_type == MWIFIEX_USB ? 0 : INTF_HEADER_LEN; | ||
163 | 164 | ||
164 | skb_src = skb_peek(&pra_list->skb_head); | 165 | skb_src = skb_peek(&pra_list->skb_head); |
165 | if (!skb_src) { | 166 | if (!skb_src) { |
diff --git a/drivers/net/wireless/mwifiex/11n_aggr.h b/drivers/net/wireless/mwifiex/11n_aggr.h index 900e1c62a0cc..892098d6a696 100644 --- a/drivers/net/wireless/mwifiex/11n_aggr.h +++ b/drivers/net/wireless/mwifiex/11n_aggr.h | |||
@@ -26,7 +26,7 @@ | |||
26 | int mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv, | 26 | int mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv, |
27 | struct sk_buff *skb); | 27 | struct sk_buff *skb); |
28 | int mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, | 28 | int mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, |
29 | struct mwifiex_ra_list_tbl *ptr, int headroom, | 29 | struct mwifiex_ra_list_tbl *ptr, |
30 | int ptr_index, unsigned long flags) | 30 | int ptr_index, unsigned long flags) |
31 | __releases(&priv->wmm.ra_list_spinlock); | 31 | __releases(&priv->wmm.ra_list_spinlock); |
32 | 32 | ||
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index 2d761477d15e..a6c46f3b6e3a 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c | |||
@@ -1155,7 +1155,7 @@ int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv, | |||
1155 | uint32_t conditions = le32_to_cpu(phs_cfg->params.hs_config.conditions); | 1155 | uint32_t conditions = le32_to_cpu(phs_cfg->params.hs_config.conditions); |
1156 | 1156 | ||
1157 | if (phs_cfg->action == cpu_to_le16(HS_ACTIVATE) && | 1157 | if (phs_cfg->action == cpu_to_le16(HS_ACTIVATE) && |
1158 | adapter->iface_type == MWIFIEX_SDIO) { | 1158 | adapter->iface_type != MWIFIEX_USB) { |
1159 | mwifiex_hs_activated_event(priv, true); | 1159 | mwifiex_hs_activated_event(priv, true); |
1160 | return 0; | 1160 | return 0; |
1161 | } else { | 1161 | } else { |
@@ -1167,8 +1167,7 @@ int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv, | |||
1167 | } | 1167 | } |
1168 | if (conditions != HS_CFG_CANCEL) { | 1168 | if (conditions != HS_CFG_CANCEL) { |
1169 | adapter->is_hs_configured = true; | 1169 | adapter->is_hs_configured = true; |
1170 | if (adapter->iface_type == MWIFIEX_USB || | 1170 | if (adapter->iface_type == MWIFIEX_USB) |
1171 | adapter->iface_type == MWIFIEX_PCIE) | ||
1172 | mwifiex_hs_activated_event(priv, true); | 1171 | mwifiex_hs_activated_event(priv, true); |
1173 | } else { | 1172 | } else { |
1174 | adapter->is_hs_configured = false; | 1173 | adapter->is_hs_configured = false; |
diff --git a/drivers/net/wireless/mwifiex/usb.c b/drivers/net/wireless/mwifiex/usb.c index 2472d4b7f00e..1c70b8d09227 100644 --- a/drivers/net/wireless/mwifiex/usb.c +++ b/drivers/net/wireless/mwifiex/usb.c | |||
@@ -447,9 +447,6 @@ static int mwifiex_usb_suspend(struct usb_interface *intf, pm_message_t message) | |||
447 | */ | 447 | */ |
448 | adapter->is_suspended = true; | 448 | adapter->is_suspended = true; |
449 | 449 | ||
450 | for (i = 0; i < adapter->priv_num; i++) | ||
451 | netif_carrier_off(adapter->priv[i]->netdev); | ||
452 | |||
453 | if (atomic_read(&card->rx_cmd_urb_pending) && card->rx_cmd.urb) | 450 | if (atomic_read(&card->rx_cmd_urb_pending) && card->rx_cmd.urb) |
454 | usb_kill_urb(card->rx_cmd.urb); | 451 | usb_kill_urb(card->rx_cmd.urb); |
455 | 452 | ||
@@ -509,10 +506,6 @@ static int mwifiex_usb_resume(struct usb_interface *intf) | |||
509 | MWIFIEX_RX_CMD_BUF_SIZE); | 506 | MWIFIEX_RX_CMD_BUF_SIZE); |
510 | } | 507 | } |
511 | 508 | ||
512 | for (i = 0; i < adapter->priv_num; i++) | ||
513 | if (adapter->priv[i]->media_connected) | ||
514 | netif_carrier_on(adapter->priv[i]->netdev); | ||
515 | |||
516 | /* Disable Host Sleep */ | 509 | /* Disable Host Sleep */ |
517 | if (adapter->hs_activated) | 510 | if (adapter->hs_activated) |
518 | mwifiex_cancel_hs(mwifiex_get_priv(adapter, | 511 | mwifiex_cancel_hs(mwifiex_get_priv(adapter, |
diff --git a/drivers/net/wireless/mwifiex/wmm.c b/drivers/net/wireless/mwifiex/wmm.c index 2e8f9cdea54d..95fa3599b407 100644 --- a/drivers/net/wireless/mwifiex/wmm.c +++ b/drivers/net/wireless/mwifiex/wmm.c | |||
@@ -1239,8 +1239,7 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter) | |||
1239 | if (enable_tx_amsdu && mwifiex_is_amsdu_allowed(priv, tid) && | 1239 | if (enable_tx_amsdu && mwifiex_is_amsdu_allowed(priv, tid) && |
1240 | mwifiex_is_11n_aggragation_possible(priv, ptr, | 1240 | mwifiex_is_11n_aggragation_possible(priv, ptr, |
1241 | adapter->tx_buf_size)) | 1241 | adapter->tx_buf_size)) |
1242 | mwifiex_11n_aggregate_pkt(priv, ptr, INTF_HEADER_LEN, | 1242 | mwifiex_11n_aggregate_pkt(priv, ptr, ptr_index, flags); |
1243 | ptr_index, flags); | ||
1244 | /* ra_list_spinlock has been freed in | 1243 | /* ra_list_spinlock has been freed in |
1245 | mwifiex_11n_aggregate_pkt() */ | 1244 | mwifiex_11n_aggregate_pkt() */ |
1246 | else | 1245 | else |
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index b9deef66cf4b..e328d3058c41 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c | |||
@@ -83,6 +83,7 @@ static struct usb_device_id p54u_table[] = { | |||
83 | {USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */ | 83 | {USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */ |
84 | {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */ | 84 | {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */ |
85 | {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ | 85 | {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ |
86 | {USB_DEVICE(0x07aa, 0x0020)}, /* Corega WLUSB2GTST USB */ | ||
86 | {USB_DEVICE(0x0803, 0x4310)}, /* Zoom 4410a */ | 87 | {USB_DEVICE(0x0803, 0x4310)}, /* Zoom 4410a */ |
87 | {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ | 88 | {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ |
88 | {USB_DEVICE(0x083a, 0x4531)}, /* T-Com Sinus 154 data II */ | 89 | {USB_DEVICE(0x083a, 0x4531)}, /* T-Com Sinus 154 data II */ |
@@ -979,6 +980,7 @@ static int p54u_load_firmware(struct ieee80211_hw *dev, | |||
979 | if (err) { | 980 | if (err) { |
980 | dev_err(&priv->udev->dev, "(p54usb) cannot load firmware %s " | 981 | dev_err(&priv->udev->dev, "(p54usb) cannot load firmware %s " |
981 | "(%d)!\n", p54u_fwlist[i].fw, err); | 982 | "(%d)!\n", p54u_fwlist[i].fw, err); |
983 | usb_put_dev(udev); | ||
982 | } | 984 | } |
983 | 985 | ||
984 | return err; | 986 | return err; |
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h index cc03e7c87cbe..703258742d28 100644 --- a/drivers/net/wireless/rtlwifi/wifi.h +++ b/drivers/net/wireless/rtlwifi/wifi.h | |||
@@ -2057,7 +2057,7 @@ struct rtl_priv { | |||
2057 | that it points to the data allocated | 2057 | that it points to the data allocated |
2058 | beyond this structure like: | 2058 | beyond this structure like: |
2059 | rtl_pci_priv or rtl_usb_priv */ | 2059 | rtl_pci_priv or rtl_usb_priv */ |
2060 | u8 priv[0]; | 2060 | u8 priv[0] __aligned(sizeof(void *)); |
2061 | }; | 2061 | }; |
2062 | 2062 | ||
2063 | #define rtl_priv(hw) (((struct rtl_priv *)(hw)->priv)) | 2063 | #define rtl_priv(hw) (((struct rtl_priv *)(hw)->priv)) |
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h index d66033f418c9..0333e605ea0d 100644 --- a/include/linux/bcma/bcma_driver_pci.h +++ b/include/linux/bcma/bcma_driver_pci.h | |||
@@ -242,6 +242,7 @@ extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, | |||
242 | struct bcma_device *core, bool enable); | 242 | struct bcma_device *core, bool enable); |
243 | extern void bcma_core_pci_up(struct bcma_bus *bus); | 243 | extern void bcma_core_pci_up(struct bcma_bus *bus); |
244 | extern void bcma_core_pci_down(struct bcma_bus *bus); | 244 | extern void bcma_core_pci_down(struct bcma_bus *bus); |
245 | extern void bcma_core_pci_power_save(struct bcma_bus *bus, bool up); | ||
245 | 246 | ||
246 | extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev); | 247 | extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev); |
247 | extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev); | 248 | extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev); |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index aaeaf0938ec0..15f10841e2b5 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -104,6 +104,7 @@ enum { | |||
104 | enum { | 104 | enum { |
105 | HCI_SETUP, | 105 | HCI_SETUP, |
106 | HCI_AUTO_OFF, | 106 | HCI_AUTO_OFF, |
107 | HCI_RFKILLED, | ||
107 | HCI_MGMT, | 108 | HCI_MGMT, |
108 | HCI_PAIRABLE, | 109 | HCI_PAIRABLE, |
109 | HCI_SERVICE_CACHE, | 110 | HCI_SERVICE_CACHE, |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 634debab4d54..fb7356fcfe51 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -1146,7 +1146,11 @@ int hci_dev_open(__u16 dev) | |||
1146 | goto done; | 1146 | goto done; |
1147 | } | 1147 | } |
1148 | 1148 | ||
1149 | if (hdev->rfkill && rfkill_blocked(hdev->rfkill)) { | 1149 | /* Check for rfkill but allow the HCI setup stage to proceed |
1150 | * (which in itself doesn't cause any RF activity). | ||
1151 | */ | ||
1152 | if (test_bit(HCI_RFKILLED, &hdev->dev_flags) && | ||
1153 | !test_bit(HCI_SETUP, &hdev->dev_flags)) { | ||
1150 | ret = -ERFKILL; | 1154 | ret = -ERFKILL; |
1151 | goto done; | 1155 | goto done; |
1152 | } | 1156 | } |
@@ -1566,10 +1570,13 @@ static int hci_rfkill_set_block(void *data, bool blocked) | |||
1566 | 1570 | ||
1567 | BT_DBG("%p name %s blocked %d", hdev, hdev->name, blocked); | 1571 | BT_DBG("%p name %s blocked %d", hdev, hdev->name, blocked); |
1568 | 1572 | ||
1569 | if (!blocked) | 1573 | if (blocked) { |
1570 | return 0; | 1574 | set_bit(HCI_RFKILLED, &hdev->dev_flags); |
1571 | 1575 | if (!test_bit(HCI_SETUP, &hdev->dev_flags)) | |
1572 | hci_dev_do_close(hdev); | 1576 | hci_dev_do_close(hdev); |
1577 | } else { | ||
1578 | clear_bit(HCI_RFKILLED, &hdev->dev_flags); | ||
1579 | } | ||
1573 | 1580 | ||
1574 | return 0; | 1581 | return 0; |
1575 | } | 1582 | } |
@@ -1591,9 +1598,13 @@ static void hci_power_on(struct work_struct *work) | |||
1591 | return; | 1598 | return; |
1592 | } | 1599 | } |
1593 | 1600 | ||
1594 | if (test_bit(HCI_AUTO_OFF, &hdev->dev_flags)) | 1601 | if (test_bit(HCI_RFKILLED, &hdev->dev_flags)) { |
1602 | clear_bit(HCI_AUTO_OFF, &hdev->dev_flags); | ||
1603 | hci_dev_do_close(hdev); | ||
1604 | } else if (test_bit(HCI_AUTO_OFF, &hdev->dev_flags)) { | ||
1595 | queue_delayed_work(hdev->req_workqueue, &hdev->power_off, | 1605 | queue_delayed_work(hdev->req_workqueue, &hdev->power_off, |
1596 | HCI_AUTO_OFF_TIMEOUT); | 1606 | HCI_AUTO_OFF_TIMEOUT); |
1607 | } | ||
1597 | 1608 | ||
1598 | if (test_and_clear_bit(HCI_SETUP, &hdev->dev_flags)) | 1609 | if (test_and_clear_bit(HCI_SETUP, &hdev->dev_flags)) |
1599 | mgmt_index_added(hdev); | 1610 | mgmt_index_added(hdev); |
@@ -2209,6 +2220,9 @@ int hci_register_dev(struct hci_dev *hdev) | |||
2209 | } | 2220 | } |
2210 | } | 2221 | } |
2211 | 2222 | ||
2223 | if (hdev->rfkill && rfkill_blocked(hdev->rfkill)) | ||
2224 | set_bit(HCI_RFKILLED, &hdev->dev_flags); | ||
2225 | |||
2212 | set_bit(HCI_SETUP, &hdev->dev_flags); | 2226 | set_bit(HCI_SETUP, &hdev->dev_flags); |
2213 | 2227 | ||
2214 | if (hdev->dev_type != HCI_AMP) | 2228 | if (hdev->dev_type != HCI_AMP) |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 94aab73f89d4..8db3e89fae35 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -3557,7 +3557,11 @@ static void hci_le_ltk_request_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
3557 | cp.handle = cpu_to_le16(conn->handle); | 3557 | cp.handle = cpu_to_le16(conn->handle); |
3558 | 3558 | ||
3559 | if (ltk->authenticated) | 3559 | if (ltk->authenticated) |
3560 | conn->sec_level = BT_SECURITY_HIGH; | 3560 | conn->pending_sec_level = BT_SECURITY_HIGH; |
3561 | else | ||
3562 | conn->pending_sec_level = BT_SECURITY_MEDIUM; | ||
3563 | |||
3564 | conn->enc_key_size = ltk->enc_size; | ||
3561 | 3565 | ||
3562 | hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp); | 3566 | hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp); |
3563 | 3567 | ||
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index b3bb7bca8e60..63fa11109a1c 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -3755,6 +3755,13 @@ static struct l2cap_chan *l2cap_connect(struct l2cap_conn *conn, | |||
3755 | 3755 | ||
3756 | sk = chan->sk; | 3756 | sk = chan->sk; |
3757 | 3757 | ||
3758 | /* For certain devices (ex: HID mouse), support for authentication, | ||
3759 | * pairing and bonding is optional. For such devices, inorder to avoid | ||
3760 | * the ACL alive for too long after L2CAP disconnection, reset the ACL | ||
3761 | * disc_timeout back to HCI_DISCONN_TIMEOUT during L2CAP connect. | ||
3762 | */ | ||
3763 | conn->hcon->disc_timeout = HCI_DISCONN_TIMEOUT; | ||
3764 | |||
3758 | bacpy(&bt_sk(sk)->src, conn->src); | 3765 | bacpy(&bt_sk(sk)->src, conn->src); |
3759 | bacpy(&bt_sk(sk)->dst, conn->dst); | 3766 | bacpy(&bt_sk(sk)->dst, conn->dst); |
3760 | chan->psm = psm; | 3767 | chan->psm = psm; |
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index 6d126faf145f..84fcf9fff3ea 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c | |||
@@ -569,7 +569,6 @@ static void rfcomm_dev_data_ready(struct rfcomm_dlc *dlc, struct sk_buff *skb) | |||
569 | static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err) | 569 | static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err) |
570 | { | 570 | { |
571 | struct rfcomm_dev *dev = dlc->owner; | 571 | struct rfcomm_dev *dev = dlc->owner; |
572 | struct tty_struct *tty; | ||
573 | if (!dev) | 572 | if (!dev) |
574 | return; | 573 | return; |
575 | 574 | ||
@@ -581,38 +580,8 @@ static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err) | |||
581 | DPM_ORDER_DEV_AFTER_PARENT); | 580 | DPM_ORDER_DEV_AFTER_PARENT); |
582 | 581 | ||
583 | wake_up_interruptible(&dev->port.open_wait); | 582 | wake_up_interruptible(&dev->port.open_wait); |
584 | } else if (dlc->state == BT_CLOSED) { | 583 | } else if (dlc->state == BT_CLOSED) |
585 | tty = tty_port_tty_get(&dev->port); | 584 | tty_port_tty_hangup(&dev->port, false); |
586 | if (!tty) { | ||
587 | if (test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags)) { | ||
588 | /* Drop DLC lock here to avoid deadlock | ||
589 | * 1. rfcomm_dev_get will take rfcomm_dev_lock | ||
590 | * but in rfcomm_dev_add there's lock order: | ||
591 | * rfcomm_dev_lock -> dlc lock | ||
592 | * 2. tty_port_put will deadlock if it's | ||
593 | * the last reference | ||
594 | * | ||
595 | * FIXME: when we release the lock anything | ||
596 | * could happen to dev, even its destruction | ||
597 | */ | ||
598 | rfcomm_dlc_unlock(dlc); | ||
599 | if (rfcomm_dev_get(dev->id) == NULL) { | ||
600 | rfcomm_dlc_lock(dlc); | ||
601 | return; | ||
602 | } | ||
603 | |||
604 | if (!test_and_set_bit(RFCOMM_TTY_RELEASED, | ||
605 | &dev->flags)) | ||
606 | tty_port_put(&dev->port); | ||
607 | |||
608 | tty_port_put(&dev->port); | ||
609 | rfcomm_dlc_lock(dlc); | ||
610 | } | ||
611 | } else { | ||
612 | tty_hangup(tty); | ||
613 | tty_kref_put(tty); | ||
614 | } | ||
615 | } | ||
616 | } | 585 | } |
617 | 586 | ||
618 | static void rfcomm_dev_modem_status(struct rfcomm_dlc *dlc, u8 v24_sig) | 587 | static void rfcomm_dev_modem_status(struct rfcomm_dlc *dlc, u8 v24_sig) |