Also fixed-up a badly indented closing brace...
Unified · Split
| @@ -210,25 +210,6 @@ static void bcma_core_pci_config_fixup(struct bcma_drv_pci *pc) · 209 unmodified lines | ||
| 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 | 214 | * Init. |
| 234 | 215 | **************************************************/ |
| @@ -255,6 +236,32 @@ void bcma_core_pci_init(struct bcma_drv_pci *pc) · 20 unmodified lines | ||
| 255 | 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 | 265 | int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core, |
| 259 | 266 | bool enable) |
| 260 | 267 | { |
| @@ -310,8 +317,6 @@ void bcma_core_pci_up(struct bcma_bus *bus) · 49 unmodified lines | ||
| 310 | 317 | |
| 311 | 318 | pc = &bus->drv_pci[0]; |
| 312 | 319 | |
| 313 | − bcma_core_pci_power_save(pc, true); | |
| 314 | − | |
| 315 | 320 | bcma_core_pci_extend_L1timer(pc, true); |
| 316 | 321 | } |
| 317 | 322 | EXPORT_SYMBOL_GPL(bcma_core_pci_up); |
| @@ -326,7 +331,5 @@ void bcma_core_pci_down(struct bcma_bus *bus) · 8 unmodified lines | ||
| 326 | 331 | pc = &bus->drv_pci[0]; |
| 327 | 332 | |
| 328 | 333 | bcma_core_pci_extend_L1timer(pc, false); |
| 329 | − | |
| 330 | − bcma_core_pci_power_save(pc, false); | |
| 331 | 334 | } |
| 332 | 335 | EXPORT_SYMBOL_GPL(bcma_core_pci_down); |
| @@ -85,6 +85,7 @@ static struct usb_device_id ath3k_table[] = { · 84 unmodified lines | ||
| 85 | 85 | { USB_DEVICE(0x04CA, 0x3008) }, |
| 86 | 86 | { USB_DEVICE(0x13d3, 0x3362) }, |
| 87 | 87 | { USB_DEVICE(0x0CF3, 0xE004) }, |
| 88 | + { USB_DEVICE(0x0CF3, 0xE005) }, | |
| 88 | 89 | { USB_DEVICE(0x0930, 0x0219) }, |
| 89 | 90 | { USB_DEVICE(0x0489, 0xe057) }, |
| 90 | 91 | { USB_DEVICE(0x13d3, 0x3393) }, |
| @@ -126,6 +127,7 @@ static struct usb_device_id ath3k_blist_tbl[] = { · 35 unmodified lines | ||
| 126 | 127 | { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, |
| 127 | 128 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, |
| 128 | 129 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, |
| 130 | + { USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 }, | |
| 129 | 131 | { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, |
| 130 | 132 | { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 }, |
| 131 | 133 | { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 }, |
| @@ -102,6 +102,7 @@ static struct usb_device_id btusb_table[] = { · 101 unmodified lines | ||
| 102 | 102 | |
| 103 | 103 | /* Broadcom BCM20702A0 */ |
| 104 | 104 | { USB_DEVICE(0x0b05, 0x17b5) }, |
| 105 | + { USB_DEVICE(0x0b05, 0x17cb) }, | |
| 105 | 106 | { USB_DEVICE(0x04ca, 0x2003) }, |
| 106 | 107 | { USB_DEVICE(0x0489, 0xe042) }, |
| 107 | 108 | { USB_DEVICE(0x413c, 0x8197) }, |
| @@ -112,6 +113,9 @@ static struct usb_device_id btusb_table[] = { · 4 unmodified lines | ||
| 112 | 113 | /*Broadcom devices with vendor specific id */ |
| 113 | 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 | 119 | { } /* Terminating entry */ |
| 116 | 120 | }; |
| 117 | 121 | |
| @@ -148,6 +152,7 @@ static struct usb_device_id blacklist_table[] = { · 30 unmodified lines | ||
| 148 | 152 | { USB_DEVICE(0x04ca, 0x3008), .driver_info = BTUSB_ATH3012 }, |
| 149 | 153 | { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 }, |
| 150 | 154 | { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 }, |
| 155 | + { USB_DEVICE(0x0cf3, 0xe005), .driver_info = BTUSB_ATH3012 }, | |
| 151 | 156 | { USB_DEVICE(0x0930, 0x0219), .driver_info = BTUSB_ATH3012 }, |
| 152 | 157 | { USB_DEVICE(0x0489, 0xe057), .driver_info = BTUSB_ATH3012 }, |
| 153 | 158 | { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 }, |
| @@ -1269,13 +1269,6 @@ static void ath9k_antenna_check(struct ath_softc *sc, · 1268 unmodified lines | ||
| 1269 | 1269 | if (!(ah->caps.hw_caps & ATH9K_HW_CAP_ANT_DIV_COMB)) |
| 1270 | 1270 | return; |
| 1271 | 1271 | |
| 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 | 1272 | /* |
| 1280 | 1273 | * Change the default rx antenna if rx diversity |
| 1281 | 1274 | * chooses the other antenna 3 times in a row. |
| @@ -399,6 +399,7 @@ static struct ath_buf* ath_clone_txbuf(struct ath_softc *sc, struct ath_buf *bf) · 398 unmodified lines | ||
| 399 | 399 | tbf->bf_buf_addr = bf->bf_buf_addr; |
| 400 | 400 | memcpy(tbf->bf_desc, bf->bf_desc, sc->sc_ah->caps.tx_desc_len); |
| 401 | 401 | tbf->bf_state = bf->bf_state; |
| 402 | + tbf->bf_state.stale = false; | |
| 402 | 403 | |
| 403 | 404 | return tbf; |
| 404 | 405 | } |
| @@ -1389,11 +1390,15 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, · 984 unmodified lines | ||
| 1389 | 1390 | u16 tid, u16 *ssn) |
| 1390 | 1391 | { |
| 1391 | 1392 | struct ath_atx_tid *txtid; |
| 1393 | + struct ath_txq *txq; | |
| 1392 | 1394 | struct ath_node *an; |
| 1393 | 1395 | u8 density; |
| 1394 | 1396 | |
| 1395 | 1397 | an = (struct ath_node *)sta->drv_priv; |
| 1396 | 1398 | txtid = ATH_AN_2_TID(an, tid); |
| 1399 | + txq = txtid->ac->txq; | |
| 1400 | + | |
| 1401 | + ath_txq_lock(sc, txq); | |
| 1397 | 1402 | |
| 1398 | 1403 | /* update ampdu factor/density, they may have changed. This may happen |
| 1399 | 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, · 17 unmodified lines | ||
| 1417 | 1422 | memset(txtid->tx_buf, 0, sizeof(txtid->tx_buf)); |
| 1418 | 1423 | txtid->baw_head = txtid->baw_tail = 0; |
| 1419 | 1424 | |
| 1425 | + ath_txq_unlock_complete(sc, txq); | |
| 1426 | + | |
| 1420 | 1427 | return 0; |
| 1421 | 1428 | } |
| 1422 | 1429 | |
| @@ -1555,8 +1562,10 @@ void ath9k_release_buffered_frames(struct ieee80211_hw *hw, · 132 unmodified lines | ||
| 1555 | 1562 | __skb_unlink(bf->bf_mpdu, tid_q); |
| 1556 | 1563 | list_add_tail(&bf->list, &bf_q); |
| 1557 | 1564 | ath_set_rates(tid->an->vif, tid->an->sta, bf); |
| 1558 | − ath_tx_addto_baw(sc, tid, bf); | |
| 1559 | − bf->bf_state.bf_type &= ~BUF_AGGR; | |
| 1565 | + if (bf_isampdu(bf)) { | |
| 1566 | + ath_tx_addto_baw(sc, tid, bf); | |
| 1567 | + bf->bf_state.bf_type &= ~BUF_AGGR; | |
| 1568 | + } | |
| 1560 | 1569 | if (bf_tail) |
| 1561 | 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, · 387 unmodified lines | ||
| 1950 | 1959 | if (bf_is_ampdu_not_probing(bf)) |
| 1951 | 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 | } |
| @@ -464,8 +464,6 @@ static struct sdio_driver brcmf_sdmmc_driver = { · 463 unmodified lines | ||
| 464 | 464 | |
| 465 | 465 | static int brcmf_sdio_pd_probe(struct platform_device *pdev) |
| 466 | 466 | { |
| 467 | − int ret; | |
| 468 | − | |
| 469 | 467 | brcmf_dbg(SDIO, "Enter\n"); |
| 470 | 468 | |
| 471 | 469 | brcmfmac_sdio_pdata = pdev->dev.platform_data; |
| @@ -473,11 +471,7 @@ static int brcmf_sdio_pd_probe(struct platform_device *pdev) · 1 unmodified line | ||
| 473 | 471 | if (brcmfmac_sdio_pdata->power_on) |
| 474 | 472 | brcmfmac_sdio_pdata->power_on(); |
| 475 | 473 | |
| 476 | − ret = sdio_register_driver(&brcmf_sdmmc_driver); | |
| 477 | − if (ret) | |
| 478 | − brcmf_err("sdio_register_driver failed: %d\n", ret); | |
| 479 | − | |
| 480 | − return ret; | |
| 474 | + return 0; | |
| 481 | 475 | } |
| 482 | 476 | |
| 483 | 477 | static int brcmf_sdio_pd_remove(struct platform_device *pdev) |
| @@ -500,6 +494,15 @@ static struct platform_driver brcmf_sdio_pd = { · 16 unmodified lines | ||
| 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 | 506 | void brcmf_sdio_exit(void) |
| 504 | 507 | { |
| 505 | 508 | brcmf_dbg(SDIO, "Enter\n"); |
| @@ -510,18 +513,13 @@ void brcmf_sdio_exit(void) · 4 unmodified lines | ||
| 510 | 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 | 518 | int ret; |
| 516 | 519 | |
| 517 | 520 | brcmf_dbg(SDIO, "Enter\n"); |
| 518 | 521 | |
| 519 | 522 | ret = platform_driver_probe(&brcmf_sdio_pd, brcmf_sdio_pd_probe); |
| 520 | − if (ret == -ENODEV) { | |
| 521 | − brcmf_dbg(SDIO, "No platform data available, registering without.\n"); | |
| 522 | − ret = sdio_register_driver(&brcmf_sdmmc_driver); | |
| 523 | − } | |
| 524 | − | |
| 525 | − if (ret) | |
| 526 | − brcmf_err("driver registration failed: %d\n", ret); | |
| 523 | + if (ret == -ENODEV) | |
| 524 | + brcmf_dbg(SDIO, "No platform data available.\n"); | |
| 527 | 525 | } |
| @@ -156,10 +156,11 @@ extern int brcmf_bus_start(struct device *dev); · 155 unmodified lines | ||
| 156 | 156 | #ifdef CONFIG_BRCMFMAC_SDIO |
| 157 | 157 | extern void brcmf_sdio_exit(void); |
| 158 | 158 | extern void brcmf_sdio_init(void); |
| 159 | +extern void brcmf_sdio_register(void); | |
| 159 | 160 | #endif |
| 160 | 161 | #ifdef CONFIG_BRCMFMAC_USB |
| 161 | 162 | extern void brcmf_usb_exit(void); |
| 162 | −extern void brcmf_usb_init(void); | |
| 163 | +extern void brcmf_usb_register(void); | |
| 163 | 164 | #endif |
| 164 | 165 | |
| 165 | 166 | #endif /* _BRCMF_BUS_H_ */ |
| @@ -1231,21 +1231,23 @@ u32 brcmf_get_chip_info(struct brcmf_if *ifp) · 1230 unmodified lines | ||
| 1231 | 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 | 1236 | #ifdef CONFIG_BRCMFMAC_SDIO |
| 1239 | − brcmf_sdio_init(); | |
| 1237 | + brcmf_sdio_register(); | |
| 1240 | 1238 | #endif |
| 1241 | 1239 | #ifdef CONFIG_BRCMFMAC_USB |
| 1242 | − brcmf_usb_init(); | |
| 1240 | + brcmf_usb_register(); | |
| 1243 | 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 | 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 | 1251 | if (!schedule_work(&brcmf_driver_work)) |
| 1250 | 1252 | return -EBUSY; |
| 1251 | 1253 | |
| @@ -1539,7 +1539,7 @@ void brcmf_usb_exit(void) · 1538 unmodified lines | ||
| 1539 | 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 | 1544 | brcmf_dbg(USB, "Enter\n"); |
| 1545 | 1545 | INIT_LIST_HEAD(&fw_image_list); |
| @@ -457,6 +457,8 @@ static int brcms_ops_start(struct ieee80211_hw *hw) · 456 unmodified lines | ||
| 457 | 457 | if (err != 0) |
| 458 | 458 | brcms_err(wl->wlc->hw->d11core, "%s: brcms_up() returned %d\n", |
| 459 | 459 | __func__, err); |
| 460 | + | |
| 461 | + bcma_core_pci_power_save(wl->wlc->hw->d11core->bus, true); | |
| 460 | 462 | return err; |
| 461 | 463 | } |
| 462 | 464 | |
| @@ -479,6 +481,8 @@ static void brcms_ops_stop(struct ieee80211_hw *hw) · 16 unmodified lines | ||
| 479 | 481 | return; |
| 480 | 482 | } |
| 481 | 483 | |
| 484 | + bcma_core_pci_power_save(wl->wlc->hw->d11core->bus, false); | |
| 485 | + | |
| 482 | 486 | /* put driver in down state */ |
| 483 | 487 | spin_lock_bh(&wl->lock); |
| 484 | 488 | brcms_down(wl); |
| @@ -42,7 +42,6 @@ struct hwbus_priv { · 41 unmodified lines | ||
| 42 | 42 | spinlock_t lock; /* Serialize all bus operations */ |
| 43 | 43 | wait_queue_head_t wq; |
| 44 | 44 | int claimed; |
| 45 | − int irq_disabled; | |
| 46 | 45 | }; |
| 47 | 46 | |
| 48 | 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) · 189 unmodified lines | ||
| 238 | 237 | struct hwbus_priv *self = dev_id; |
| 239 | 238 | |
| 240 | 239 | if (self->core) { |
| 241 | − disable_irq_nosync(self->func->irq); | |
| 242 | − self->irq_disabled = 1; | |
| 243 | 240 | cw1200_irq_handler(self->core); |
| 244 | 241 | return IRQ_HANDLED; |
| 245 | 242 | } else { |
| @@ -253,9 +250,10 @@ static int cw1200_spi_irq_subscribe(struct hwbus_priv *self) · 7 unmodified lines | ||
| 253 | 250 | |
| 254 | 251 | pr_debug("SW IRQ subscribe\n"); |
| 255 | 252 | |
| 256 | − ret = request_any_context_irq(self->func->irq, cw1200_spi_irq_handler, | |
| 257 | − IRQF_TRIGGER_HIGH, | |
| 258 | − "cw1200_wlan_irq", self); | |
| 253 | + ret = request_threaded_irq(self->func->irq, NULL, | |
| 254 | + cw1200_spi_irq_handler, | |
| 255 | + IRQF_TRIGGER_HIGH | IRQF_ONESHOT, | |
| 256 | + "cw1200_wlan_irq", self); | |
| 259 | 257 | if (WARN_ON(ret < 0)) |
| 260 | 258 | goto exit; |
| 261 | 259 | |
| @@ -273,22 +271,13 @@ exit: · 11 unmodified lines | ||
| 273 | 271 | |
| 274 | 272 | static int cw1200_spi_irq_unsubscribe(struct hwbus_priv *self) |
| 275 | 273 | { |
| 274 | + int ret = 0; | |
| 275 | + | |
| 276 | 276 | pr_debug("SW IRQ unsubscribe\n"); |
| 277 | 277 | disable_irq_wake(self->func->irq); |
| 278 | 278 | free_irq(self->func->irq, self); |
| 279 | 279 | |
| 280 | − return 0; | |
| 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; | |
| 280 | + return ret; | |
| 292 | 281 | } |
| 293 | 282 | |
| 294 | 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 = { · 73 unmodified lines | ||
| 368 | 357 | .unlock = cw1200_spi_unlock, |
| 369 | 358 | .align_size = cw1200_spi_align_size, |
| 370 | 359 | .power_mgmt = cw1200_spi_pm, |
| 371 | − .irq_enable = cw1200_spi_irq_enable, | |
| 372 | 360 | }; |
| 373 | 361 | |
| 374 | 362 | /* Probe Function to be called by SPI stack when device is discovered */ |
| @@ -485,7 +485,7 @@ int cw1200_load_firmware(struct cw1200_common *priv) · 484 unmodified lines | ||
| 485 | 485 | |
| 486 | 486 | /* Enable interrupt signalling */ |
| 487 | 487 | priv->hwbus_ops->lock(priv->hwbus_priv); |
| 488 | − ret = __cw1200_irq_enable(priv, 2); | |
| 488 | + ret = __cw1200_irq_enable(priv, 1); | |
| 489 | 489 | priv->hwbus_ops->unlock(priv->hwbus_priv); |
| 490 | 490 | if (ret < 0) |
| 491 | 491 | goto unsubscribe; |
| @@ -28,7 +28,6 @@ struct hwbus_ops { · 27 unmodified lines | ||
| 28 | 28 | void (*unlock)(struct hwbus_priv *self); |
| 29 | 29 | size_t (*align_size)(struct hwbus_priv *self, size_t size); |
| 30 | 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 | 33 | #endif /* CW1200_HWBUS_H */ |
| @@ -273,21 +273,6 @@ int __cw1200_irq_enable(struct cw1200_common *priv, int enable) · 272 unmodified lines | ||
| 273 | 273 | u16 val16; |
| 274 | 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 | 276 | if (HIF_8601_SILICON == priv->hw_type) { |
| 292 | 277 | ret = __cw1200_reg_read_32(priv, ST90TDS_CONFIG_REG_ID, &val32); |
| 293 | 278 | if (ret < 0) { |
| @@ -150,7 +150,7 @@ mwifiex_11n_form_amsdu_txpd(struct mwifiex_private *priv, · 149 unmodified lines | ||
| 150 | 150 | */ |
| 151 | 151 | int |
| 152 | 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 | 154 | int ptrindex, unsigned long ra_list_flags) |
| 155 | 155 | __releases(&priv->wmm.ra_list_spinlock) |
| 156 | 156 | { |
| @@ -160,6 +160,7 @@ mwifiex_11n_aggregate_pkt(struct mwifiex_private *priv, · 3 unmodified lines | ||
| 160 | 160 | int pad = 0, ret; |
| 161 | 161 | struct mwifiex_tx_param tx_param; |
| 162 | 162 | struct txpd *ptx_pd = NULL; |
| 163 | + int headroom = adapter->iface_type == MWIFIEX_USB ? 0 : INTF_HEADER_LEN; | |
| 163 | 164 | |
| 164 | 165 | skb_src = skb_peek(&pra_list->skb_head); |
| 165 | 166 | if (!skb_src) { |
| @@ -26,7 +26,7 @@ · 25 unmodified lines | ||
| 26 | 26 | int mwifiex_11n_deaggregate_pkt(struct mwifiex_private *priv, |
| 27 | 27 | struct sk_buff *skb); |
| 28 | 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 | 30 | int ptr_index, unsigned long flags) |
| 31 | 31 | __releases(&priv->wmm.ra_list_spinlock); |
| 32 | 32 | |
| @@ -1155,7 +1155,7 @@ int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv, · 1154 unmodified lines | ||
| 1155 | 1155 | uint32_t conditions = le32_to_cpu(phs_cfg->params.hs_config.conditions); |
| 1156 | 1156 | |
| 1157 | 1157 | if (phs_cfg->action == cpu_to_le16(HS_ACTIVATE) && |
| 1158 | − adapter->iface_type == MWIFIEX_SDIO) { | |
| 1158 | + adapter->iface_type != MWIFIEX_USB) { | |
| 1159 | 1159 | mwifiex_hs_activated_event(priv, true); |
| 1160 | 1160 | return 0; |
| 1161 | 1161 | } else { |
| @@ -1167,8 +1167,7 @@ int mwifiex_ret_802_11_hs_cfg(struct mwifiex_private *priv, · 5 unmodified lines | ||
| 1167 | 1167 | } |
| 1168 | 1168 | if (conditions != HS_CFG_CANCEL) { |
| 1169 | 1169 | adapter->is_hs_configured = true; |
| 1170 | − if (adapter->iface_type == MWIFIEX_USB || | |
| 1171 | − adapter->iface_type == MWIFIEX_PCIE) | |
| 1170 | + if (adapter->iface_type == MWIFIEX_USB) | |
| 1172 | 1171 | mwifiex_hs_activated_event(priv, true); |
| 1173 | 1172 | } else { |
| 1174 | 1173 | adapter->is_hs_configured = false; |
| @@ -447,9 +447,6 @@ static int mwifiex_usb_suspend(struct usb_interface *intf, pm_message_t message) · 446 unmodified lines | ||
| 447 | 447 | */ |
| 448 | 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 | 450 | if (atomic_read(&card->rx_cmd_urb_pending) && card->rx_cmd.urb) |
| 454 | 451 | usb_kill_urb(card->rx_cmd.urb); |
| 455 | 452 | |
| @@ -509,10 +506,6 @@ static int mwifiex_usb_resume(struct usb_interface *intf) · 53 unmodified lines | ||
| 509 | 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 | 509 | /* Disable Host Sleep */ |
| 517 | 510 | if (adapter->hs_activated) |
| 518 | 511 | mwifiex_cancel_hs(mwifiex_get_priv(adapter, |
| @@ -1239,8 +1239,7 @@ mwifiex_dequeue_tx_packet(struct mwifiex_adapter *adapter) · 1238 unmodified lines | ||
| 1239 | 1239 | if (enable_tx_amsdu && mwifiex_is_amsdu_allowed(priv, tid) && |
| 1240 | 1240 | mwifiex_is_11n_aggragation_possible(priv, ptr, |
| 1241 | 1241 | adapter->tx_buf_size)) |
| 1242 | − mwifiex_11n_aggregate_pkt(priv, ptr, INTF_HEADER_LEN, | |
| 1243 | − ptr_index, flags); | |
| 1242 | + mwifiex_11n_aggregate_pkt(priv, ptr, ptr_index, flags); | |
| 1244 | 1243 | /* ra_list_spinlock has been freed in |
| 1245 | 1244 | mwifiex_11n_aggregate_pkt() */ |
| 1246 | 1245 | else |
| @@ -83,6 +83,7 @@ static struct usb_device_id p54u_table[] = { · 82 unmodified lines | ||
| 83 | 83 | {USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */ |
| 84 | 84 | {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */ |
| 85 | 85 | {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */ |
| 86 | + {USB_DEVICE(0x07aa, 0x0020)}, /* Corega WLUSB2GTST USB */ | |
| 86 | 87 | {USB_DEVICE(0x0803, 0x4310)}, /* Zoom 4410a */ |
| 87 | 88 | {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */ |
| 88 | 89 | {USB_DEVICE(0x083a, 0x4531)}, /* T-Com Sinus 154 data II */ |
| @@ -979,6 +980,7 @@ static int p54u_load_firmware(struct ieee80211_hw *dev, · 890 unmodified lines | ||
| 979 | 980 | if (err) { |
| 980 | 981 | dev_err(&priv->udev->dev, "(p54usb) cannot load firmware %s " |
| 981 | 982 | "(%d)!\n", p54u_fwlist[i].fw, err); |
| 983 | + usb_put_dev(udev); | |
| 982 | 984 | } |
| 983 | 985 | |
| 984 | 986 | return err; |
| @@ -2057,7 +2057,7 @@ struct rtl_priv { · 2056 unmodified lines | ||
| 2057 | 2057 | that it points to the data allocated |
| 2058 | 2058 | beyond this structure like: |
| 2059 | 2059 | rtl_pci_priv or rtl_usb_priv */ |
| 2060 | − u8 priv[0]; | |
| 2060 | + u8 priv[0] __aligned(sizeof(void *)); | |
| 2061 | 2061 | }; |
| 2062 | 2062 | |
| 2063 | 2063 | #define rtl_priv(hw) (((struct rtl_priv *)(hw)->priv)) |
| @@ -242,6 +242,7 @@ extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, · 241 unmodified lines | ||
| 242 | 242 | struct bcma_device *core, bool enable); |
| 243 | 243 | extern void bcma_core_pci_up(struct bcma_bus *bus); |
| 244 | 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 | 247 | extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev); |
| 247 | 248 | extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev); |
| @@ -104,6 +104,7 @@ enum { · 103 unmodified lines | ||
| 104 | 104 | enum { |
| 105 | 105 | HCI_SETUP, |
| 106 | 106 | HCI_AUTO_OFF, |
| 107 | + HCI_RFKILLED, | |
| 107 | 108 | HCI_MGMT, |
| 108 | 109 | HCI_PAIRABLE, |
| 109 | 110 | HCI_SERVICE_CACHE, |
| @@ -1146,7 +1146,11 @@ int hci_dev_open(__u16 dev) · 1145 unmodified lines | ||
| 1146 | 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 | 1154 | ret = -ERFKILL; |
| 1151 | 1155 | goto done; |
| 1152 | 1156 | } |
| @@ -1566,10 +1570,13 @@ static int hci_rfkill_set_block(void *data, bool blocked) · 413 unmodified lines | ||
| 1566 | 1570 | |
| 1567 | 1571 | BT_DBG("%p name %s blocked %d", hdev, hdev->name, blocked); |
| 1568 | 1572 | |
| 1569 | − if (!blocked) | |
| 1570 | − return 0; | |
| 1571 | − | |
| 1572 | − hci_dev_do_close(hdev); | |
| 1573 | + if (blocked) { | |
| 1574 | + set_bit(HCI_RFKILLED, &hdev->dev_flags); | |
| 1575 | + if (!test_bit(HCI_SETUP, &hdev->dev_flags)) | |
| 1576 | + hci_dev_do_close(hdev); | |
| 1577 | + } else { | |
| 1578 | + clear_bit(HCI_RFKILLED, &hdev->dev_flags); | |
| 1579 | + } | |
| 1573 | 1580 | |
| 1574 | 1581 | return 0; |
| 1575 | 1582 | } |
| @@ -1591,9 +1598,13 @@ static void hci_power_on(struct work_struct *work) · 15 unmodified lines | ||
| 1591 | 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 | 1605 | queue_delayed_work(hdev->req_workqueue, &hdev->power_off, |
| 1596 | 1606 | HCI_AUTO_OFF_TIMEOUT); |
| 1607 | + } | |
| 1597 | 1608 | |
| 1598 | 1609 | if (test_and_clear_bit(HCI_SETUP, &hdev->dev_flags)) |
| 1599 | 1610 | mgmt_index_added(hdev); |
| @@ -2209,6 +2220,9 @@ int hci_register_dev(struct hci_dev *hdev) · 609 unmodified lines | ||
| 2209 | 2220 | } |
| 2210 | 2221 | } |
| 2211 | 2222 | |
| 2223 | + if (hdev->rfkill && rfkill_blocked(hdev->rfkill)) | |
| 2224 | + set_bit(HCI_RFKILLED, &hdev->dev_flags); | |
| 2225 | + | |
| 2212 | 2226 | set_bit(HCI_SETUP, &hdev->dev_flags); |
| 2213 | 2227 | |
| 2214 | 2228 | if (hdev->dev_type != HCI_AMP) |
| @@ -3557,7 +3557,11 @@ static void hci_le_ltk_request_evt(struct hci_dev *hdev, struct sk_buff *skb) · 3556 unmodified lines | ||
| 3557 | 3557 | cp.handle = cpu_to_le16(conn->handle); |
| 3558 | 3558 | |
| 3559 | 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 | 3566 | hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp); |
| 3563 | 3567 | |
| @@ -3755,6 +3755,13 @@ static struct l2cap_chan *l2cap_connect(struct l2cap_conn *conn, · 3754 unmodified lines | ||
| 3755 | 3755 | |
| 3756 | 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 | 3765 | bacpy(&bt_sk(sk)->src, conn->src); |
| 3759 | 3766 | bacpy(&bt_sk(sk)->dst, conn->dst); |
| 3760 | 3767 | chan->psm = psm; |
| @@ -569,7 +569,6 @@ static void rfcomm_dev_data_ready(struct rfcomm_dlc *dlc, struct sk_buff *skb) · 568 unmodified lines | ||
| 569 | 569 | static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err) |
| 570 | 570 | { |
| 571 | 571 | struct rfcomm_dev *dev = dlc->owner; |
| 572 | − struct tty_struct *tty; | |
| 573 | 572 | if (!dev) |
| 574 | 573 | return; |
| 575 | 574 | |
| @@ -581,38 +580,8 @@ static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err) · 5 unmodified lines | ||
| 581 | 580 | DPM_ORDER_DEV_AFTER_PARENT); |
| 582 | 581 | |
| 583 | 582 | wake_up_interruptible(&dev->port.open_wait); |
| 584 | − } else if (dlc->state == BT_CLOSED) { | |
| 585 | − tty = tty_port_tty_get(&dev->port); | |
| 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 | − } | |
| 583 | + } else if (dlc->state == BT_CLOSED) | |
| 584 | + tty_port_tty_hangup(&dev->port, false); | |
| 616 | 585 | } |
| 617 | 586 | |
| 618 | 587 | static void rfcomm_dev_modem_status(struct rfcomm_dlc *dlc, u8 v24_sig) |