Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'wireless-drivers-next-for-davem-2019-04-18' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next

Kalle Valo says:

====================
wireless-drivers-next patches for 5.2

Nothing really special standing out this time, iwlwifi being the most
active driver.

Major changes:

iwlwifi

* send NO_DATA events so they can be captured in radiotap

* support for multiple BSSID

* support for some new FW API versions

* support new hardware

* debugfs cleanups by Greg-KH

qtnfmac

* allow each MAC to specify its own regulatory rules
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+1978 -1141
+3 -3
drivers/net/wireless/broadcom/b43/phy_lp.c
··· 1835 1835 static void lpphy_papd_cal_txpwr(struct b43_wldev *dev) 1836 1836 { 1837 1837 struct b43_phy_lp *lpphy = dev->phy.lp; 1838 - struct lpphy_tx_gains gains, oldgains; 1838 + struct lpphy_tx_gains oldgains; 1839 1839 int old_txpctl, old_afe_ovr, old_rf, old_bbmult; 1840 1840 1841 1841 lpphy_read_tx_pctl_mode_from_hardware(dev); ··· 1849 1849 lpphy_set_tx_power_control(dev, B43_LPPHY_TXPCTL_OFF); 1850 1850 1851 1851 if (dev->dev->chip_id == 0x4325 && dev->dev->chip_rev == 0) 1852 - lpphy_papd_cal(dev, gains, 0, 1, 30); 1852 + lpphy_papd_cal(dev, oldgains, 0, 1, 30); 1853 1853 else 1854 - lpphy_papd_cal(dev, gains, 0, 1, 65); 1854 + lpphy_papd_cal(dev, oldgains, 0, 1, 65); 1855 1855 1856 1856 if (old_afe_ovr) 1857 1857 lpphy_set_tx_gains(dev, oldgains);
+9 -2
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c
··· 490 490 return -ENOMEM; 491 491 } 492 492 493 - void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr) 493 + void brcmf_proto_bcdc_detach_pre_delif(struct brcmf_pub *drvr) 494 + { 495 + struct brcmf_bcdc *bcdc = drvr->proto->pd; 496 + 497 + brcmf_fws_detach_pre_delif(bcdc->fws); 498 + } 499 + 500 + void brcmf_proto_bcdc_detach_post_delif(struct brcmf_pub *drvr) 494 501 { 495 502 struct brcmf_bcdc *bcdc = drvr->proto->pd; 496 503 497 504 drvr->proto->pd = NULL; 498 - brcmf_fws_detach(bcdc->fws); 505 + brcmf_fws_detach_post_delif(bcdc->fws); 499 506 kfree(bcdc); 500 507 }
+4 -2
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.h
··· 18 18 19 19 #ifdef CONFIG_BRCMFMAC_PROTO_BCDC 20 20 int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr); 21 - void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr); 21 + void brcmf_proto_bcdc_detach_pre_delif(struct brcmf_pub *drvr); 22 + void brcmf_proto_bcdc_detach_post_delif(struct brcmf_pub *drvr); 22 23 void brcmf_proto_bcdc_txflowblock(struct device *dev, bool state); 23 24 void brcmf_proto_bcdc_txcomplete(struct device *dev, struct sk_buff *txp, 24 25 bool success); 25 26 struct brcmf_fws_info *drvr_to_fws(struct brcmf_pub *drvr); 26 27 #else 27 28 static inline int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr) { return 0; } 28 - static inline void brcmf_proto_bcdc_detach(struct brcmf_pub *drvr) {} 29 + static void brcmf_proto_bcdc_detach_pre_delif(struct brcmf_pub *drvr) {}; 30 + static inline void brcmf_proto_bcdc_detach_post_delif(struct brcmf_pub *drvr) {} 29 31 #endif 30 32 31 33 #endif /* BRCMFMAC_BCDC_H */
+3 -5
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
··· 628 628 629 629 err = brcmf_sdiod_set_backplane_window(sdiodev, addr); 630 630 if (err) 631 - return err; 631 + goto out; 632 632 633 633 addr &= SBSDIO_SB_OFT_ADDR_MASK; 634 634 addr |= SBSDIO_SB_ACCESS_2_4B_FLAG; 635 635 636 - if (!err) 637 - err = brcmf_sdiod_skbuff_write(sdiodev, sdiodev->func2, addr, 638 - mypkt); 639 - 636 + err = brcmf_sdiod_skbuff_write(sdiodev, sdiodev->func2, addr, mypkt); 637 + out: 640 638 brcmu_pkt_buf_free_skb(mypkt); 641 639 642 640 return err;
+12
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
··· 91 91 int (*get_fwname)(struct device *dev, const char *ext, 92 92 unsigned char *fw_name); 93 93 void (*debugfs_create)(struct device *dev); 94 + int (*reset)(struct device *dev); 94 95 }; 95 96 96 97 ··· 246 245 return bus->ops->debugfs_create(bus->dev); 247 246 } 248 247 248 + static inline 249 + int brcmf_bus_reset(struct brcmf_bus *bus) 250 + { 251 + if (!bus->ops->reset) 252 + return -EOPNOTSUPP; 253 + 254 + return bus->ops->reset(bus->dev); 255 + } 256 + 249 257 /* 250 258 * interface functions from common layer 251 259 */ ··· 272 262 void brcmf_dev_reset(struct device *dev); 273 263 /* Request from bus module to initiate a coredump */ 274 264 void brcmf_dev_coredump(struct device *dev); 265 + /* Indication that firmware has halted or crashed */ 266 + void brcmf_fw_crashed(struct device *dev); 275 267 276 268 /* Configure the "global" bus state used by upper layers */ 277 269 void brcmf_bus_change_state(struct brcmf_bus *bus, enum brcmf_bus_state state);
+4
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
··· 5464 5464 conn_info->req_ie = 5465 5465 kmemdup(cfg->extra_buf, conn_info->req_ie_len, 5466 5466 GFP_KERNEL); 5467 + if (!conn_info->req_ie) 5468 + conn_info->req_ie_len = 0; 5467 5469 } else { 5468 5470 conn_info->req_ie_len = 0; 5469 5471 conn_info->req_ie = NULL; ··· 5482 5480 conn_info->resp_ie = 5483 5481 kmemdup(cfg->extra_buf, conn_info->resp_ie_len, 5484 5482 GFP_KERNEL); 5483 + if (!conn_info->resp_ie) 5484 + conn_info->resp_ie_len = 0; 5485 5485 } else { 5486 5486 conn_info->resp_ie_len = 0; 5487 5487 conn_info->resp_ie = NULL;
+32 -4
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
··· 841 841 bool rtnl_locked) 842 842 { 843 843 struct brcmf_if *ifp; 844 + int ifidx; 844 845 845 846 ifp = drvr->iflist[bsscfgidx]; 846 - drvr->iflist[bsscfgidx] = NULL; 847 847 if (!ifp) { 848 848 bphy_err(drvr, "Null interface, bsscfgidx=%d\n", bsscfgidx); 849 849 return; 850 850 } 851 851 brcmf_dbg(TRACE, "Enter, bsscfgidx=%d, ifidx=%d\n", bsscfgidx, 852 852 ifp->ifidx); 853 - if (drvr->if2bss[ifp->ifidx] == bsscfgidx) 854 - drvr->if2bss[ifp->ifidx] = BRCMF_BSSIDX_INVALID; 853 + ifidx = ifp->ifidx; 854 + 855 855 if (ifp->ndev) { 856 856 if (bsscfgidx == 0) { 857 857 if (ifp->ndev->netdev_ops == &brcmf_netdev_ops_pri) { ··· 879 879 brcmf_p2p_ifp_removed(ifp, rtnl_locked); 880 880 kfree(ifp); 881 881 } 882 + 883 + drvr->iflist[bsscfgidx] = NULL; 884 + if (drvr->if2bss[ifidx] == bsscfgidx) 885 + drvr->if2bss[ifidx] = BRCMF_BSSIDX_INVALID; 882 886 } 883 887 884 888 void brcmf_remove_interface(struct brcmf_if *ifp, bool rtnl_locked) ··· 1088 1084 return 0; 1089 1085 } 1090 1086 1087 + static void brcmf_core_bus_reset(struct work_struct *work) 1088 + { 1089 + struct brcmf_pub *drvr = container_of(work, struct brcmf_pub, 1090 + bus_reset); 1091 + 1092 + brcmf_bus_reset(drvr->bus_if); 1093 + } 1094 + 1091 1095 static int brcmf_bus_started(struct brcmf_pub *drvr, struct cfg80211_ops *ops) 1092 1096 { 1093 1097 int ret = -1; ··· 1166 1154 } 1167 1155 #endif 1168 1156 #endif /* CONFIG_INET */ 1157 + 1158 + INIT_WORK(&drvr->bus_reset, brcmf_core_bus_reset); 1169 1159 1170 1160 /* populate debugfs */ 1171 1161 brcmf_debugfs_add_entry(drvr, "revinfo", brcmf_revinfo_read); ··· 1287 1273 brcmf_dbg(TRACE, "failed to create coredump\n"); 1288 1274 } 1289 1275 1276 + void brcmf_fw_crashed(struct device *dev) 1277 + { 1278 + struct brcmf_bus *bus_if = dev_get_drvdata(dev); 1279 + struct brcmf_pub *drvr = bus_if->drvr; 1280 + 1281 + bphy_err(drvr, "Firmware has halted or crashed\n"); 1282 + 1283 + brcmf_dev_coredump(dev); 1284 + 1285 + schedule_work(&drvr->bus_reset); 1286 + } 1287 + 1290 1288 void brcmf_detach(struct device *dev) 1291 1289 { 1292 1290 s32 i; ··· 1325 1299 1326 1300 brcmf_bus_change_state(bus_if, BRCMF_BUS_DOWN); 1327 1301 1302 + brcmf_proto_detach_pre_delif(drvr); 1303 + 1328 1304 /* make sure primary interface removed last */ 1329 1305 for (i = BRCMF_MAX_IFS-1; i > -1; i--) 1330 1306 brcmf_remove_interface(drvr->iflist[i], false); ··· 1336 1308 1337 1309 brcmf_bus_stop(drvr->bus_if); 1338 1310 1339 - brcmf_proto_detach(drvr); 1311 + brcmf_proto_detach_post_delif(drvr); 1340 1312 1341 1313 bus_if->drvr = NULL; 1342 1314 wiphy_free(drvr->wiphy);
+2
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
··· 143 143 struct notifier_block inet6addr_notifier; 144 144 struct brcmf_mp_device *settings; 145 145 146 + struct work_struct bus_reset; 147 + 146 148 u8 clmver[BRCMF_DCMD_SMLEN]; 147 149 }; 148 150
+2 -3
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
··· 711 711 size_t mp_path_len; 712 712 u32 i, j; 713 713 char end = '\0'; 714 - size_t reqsz; 715 714 716 715 for (i = 0; i < table_size; i++) { 717 716 if (mapping_table[i].chipid == chip && ··· 725 726 return NULL; 726 727 } 727 728 728 - reqsz = sizeof(*fwreq) + n_fwnames * sizeof(struct brcmf_fw_item); 729 - fwreq = kzalloc(reqsz, GFP_KERNEL); 729 + fwreq = kzalloc(struct_size(fwreq, items, n_fwnames), GFP_KERNEL); 730 730 if (!fwreq) 731 731 return NULL; 732 732 ··· 741 743 742 744 for (j = 0; j < n_fwnames; j++) { 743 745 fwreq->items[j].path = fwnames[j].path; 746 + fwnames[j].path[0] = '\0'; 744 747 /* check if firmware path is provided by module parameter */ 745 748 if (brcmf_mp_global.firmware_path[0] != '\0') { 746 749 strlcpy(fwnames[j].path, mp_path,
+36 -22
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c
··· 580 580 return ifidx == *(int *)arg; 581 581 } 582 582 583 - static void brcmf_fws_psq_flush(struct brcmf_fws_info *fws, struct pktq *q, 584 - int ifidx) 585 - { 586 - bool (*matchfn)(struct sk_buff *, void *) = NULL; 587 - struct sk_buff *skb; 588 - int prec; 589 - 590 - if (ifidx != -1) 591 - matchfn = brcmf_fws_ifidx_match; 592 - for (prec = 0; prec < q->num_prec; prec++) { 593 - skb = brcmu_pktq_pdeq_match(q, prec, matchfn, &ifidx); 594 - while (skb) { 595 - brcmu_pkt_buf_free_skb(skb); 596 - skb = brcmu_pktq_pdeq_match(q, prec, matchfn, &ifidx); 597 - } 598 - } 599 - } 600 - 601 583 static void brcmf_fws_hanger_init(struct brcmf_fws_hanger *hanger) 602 584 { 603 585 int i; ··· 649 667 h->popped++; 650 668 } 651 669 return 0; 670 + } 671 + 672 + static void brcmf_fws_psq_flush(struct brcmf_fws_info *fws, struct pktq *q, 673 + int ifidx) 674 + { 675 + bool (*matchfn)(struct sk_buff *, void *) = NULL; 676 + struct sk_buff *skb; 677 + int prec; 678 + u32 hslot; 679 + 680 + if (ifidx != -1) 681 + matchfn = brcmf_fws_ifidx_match; 682 + for (prec = 0; prec < q->num_prec; prec++) { 683 + skb = brcmu_pktq_pdeq_match(q, prec, matchfn, &ifidx); 684 + while (skb) { 685 + hslot = brcmf_skb_htod_tag_get_field(skb, HSLOT); 686 + brcmf_fws_hanger_poppkt(&fws->hanger, hslot, &skb, 687 + true); 688 + brcmu_pkt_buf_free_skb(skb); 689 + skb = brcmu_pktq_pdeq_match(q, prec, matchfn, &ifidx); 690 + } 691 + } 652 692 } 653 693 654 694 static int brcmf_fws_hanger_mark_suppressed(struct brcmf_fws_hanger *h, ··· 2204 2200 brcmf_fws_lock(fws); 2205 2201 ifp->fws_desc = NULL; 2206 2202 brcmf_dbg(TRACE, "deleting %s\n", entry->name); 2203 + brcmf_fws_macdesc_cleanup(fws, &fws->desc.iface[ifp->ifidx], 2204 + ifp->ifidx); 2207 2205 brcmf_fws_macdesc_deinit(entry); 2208 2206 brcmf_fws_cleanup(fws, ifp->ifidx); 2209 2207 brcmf_fws_unlock(fws); ··· 2443 2437 return fws; 2444 2438 2445 2439 fail: 2446 - brcmf_fws_detach(fws); 2440 + brcmf_fws_detach_pre_delif(fws); 2441 + brcmf_fws_detach_post_delif(fws); 2447 2442 return ERR_PTR(rc); 2448 2443 } 2449 2444 2450 - void brcmf_fws_detach(struct brcmf_fws_info *fws) 2445 + void brcmf_fws_detach_pre_delif(struct brcmf_fws_info *fws) 2451 2446 { 2452 2447 if (!fws) 2453 2448 return; 2454 - 2455 - if (fws->fws_wq) 2449 + if (fws->fws_wq) { 2456 2450 destroy_workqueue(fws->fws_wq); 2451 + fws->fws_wq = NULL; 2452 + } 2453 + } 2454 + 2455 + void brcmf_fws_detach_post_delif(struct brcmf_fws_info *fws) 2456 + { 2457 + if (!fws) 2458 + return; 2457 2459 2458 2460 /* cleanup */ 2459 2461 brcmf_fws_lock(fws);
+2 -1
drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h
··· 19 19 #define FWSIGNAL_H_ 20 20 21 21 struct brcmf_fws_info *brcmf_fws_attach(struct brcmf_pub *drvr); 22 - void brcmf_fws_detach(struct brcmf_fws_info *fws); 22 + void brcmf_fws_detach_pre_delif(struct brcmf_fws_info *fws); 23 + void brcmf_fws_detach_post_delif(struct brcmf_fws_info *fws); 23 24 void brcmf_fws_debugfs_create(struct brcmf_pub *drvr); 24 25 bool brcmf_fws_queue_skbs(struct brcmf_fws_info *fws); 25 26 bool brcmf_fws_fc_active(struct brcmf_fws_info *fws);
+36 -1
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c
··· 345 345 BRCMF_D2H_MSGRING_RX_COMPLETE_ITEMSIZE 346 346 }; 347 347 348 + static void brcmf_pcie_setup(struct device *dev, int ret, 349 + struct brcmf_fw_request *fwreq); 350 + static struct brcmf_fw_request * 351 + brcmf_pcie_prepare_fw_request(struct brcmf_pciedev_info *devinfo); 348 352 349 353 static u32 350 354 brcmf_pcie_read_reg32(struct brcmf_pciedev_info *devinfo, u32 reg_offset) ··· 734 730 } 735 731 if (dtoh_mb_data & BRCMF_D2H_DEV_FWHALT) { 736 732 brcmf_dbg(PCIE, "D2H_MB_DATA: FW HALT\n"); 737 - brcmf_dev_coredump(&devinfo->pdev->dev); 733 + brcmf_fw_crashed(&devinfo->pdev->dev); 738 734 } 739 735 } 740 736 ··· 1413 1409 return 0; 1414 1410 } 1415 1411 1412 + static int brcmf_pcie_reset(struct device *dev) 1413 + { 1414 + struct brcmf_bus *bus_if = dev_get_drvdata(dev); 1415 + struct brcmf_pciedev *buspub = bus_if->bus_priv.pcie; 1416 + struct brcmf_pciedev_info *devinfo = buspub->devinfo; 1417 + struct brcmf_fw_request *fwreq; 1418 + int err; 1419 + 1420 + brcmf_detach(dev); 1421 + 1422 + brcmf_pcie_release_irq(devinfo); 1423 + brcmf_pcie_release_scratchbuffers(devinfo); 1424 + brcmf_pcie_release_ringbuffers(devinfo); 1425 + brcmf_pcie_reset_device(devinfo); 1426 + 1427 + fwreq = brcmf_pcie_prepare_fw_request(devinfo); 1428 + if (!fwreq) { 1429 + dev_err(dev, "Failed to prepare FW request\n"); 1430 + return -ENOMEM; 1431 + } 1432 + 1433 + err = brcmf_fw_get_firmwares(dev, fwreq, brcmf_pcie_setup); 1434 + if (err) { 1435 + dev_err(dev, "Failed to prepare FW request\n"); 1436 + kfree(fwreq); 1437 + } 1438 + 1439 + return err; 1440 + } 1441 + 1416 1442 static const struct brcmf_bus_ops brcmf_pcie_bus_ops = { 1417 1443 .txdata = brcmf_pcie_tx, 1418 1444 .stop = brcmf_pcie_down, ··· 1452 1418 .get_ramsize = brcmf_pcie_get_ramsize, 1453 1419 .get_memdump = brcmf_pcie_get_memdump, 1454 1420 .get_fwname = brcmf_pcie_get_fwname, 1421 + .reset = brcmf_pcie_reset, 1455 1422 }; 1456 1423 1457 1424
+8 -2
drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.c
··· 67 67 return -ENOMEM; 68 68 } 69 69 70 - void brcmf_proto_detach(struct brcmf_pub *drvr) 70 + void brcmf_proto_detach_post_delif(struct brcmf_pub *drvr) 71 71 { 72 72 brcmf_dbg(TRACE, "Enter\n"); 73 73 74 74 if (drvr->proto) { 75 75 if (drvr->bus_if->proto_type == BRCMF_PROTO_BCDC) 76 - brcmf_proto_bcdc_detach(drvr); 76 + brcmf_proto_bcdc_detach_post_delif(drvr); 77 77 else if (drvr->bus_if->proto_type == BRCMF_PROTO_MSGBUF) 78 78 brcmf_proto_msgbuf_detach(drvr); 79 79 kfree(drvr->proto); 80 80 drvr->proto = NULL; 81 81 } 82 + } 83 + 84 + void brcmf_proto_detach_pre_delif(struct brcmf_pub *drvr) 85 + { 86 + if (drvr->proto && drvr->bus_if->proto_type == BRCMF_PROTO_BCDC) 87 + brcmf_proto_bcdc_detach_pre_delif(drvr); 82 88 }
+2 -1
drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h
··· 54 54 55 55 56 56 int brcmf_proto_attach(struct brcmf_pub *drvr); 57 - void brcmf_proto_detach(struct brcmf_pub *drvr); 57 + void brcmf_proto_detach_pre_delif(struct brcmf_pub *drvr); 58 + void brcmf_proto_detach_post_delif(struct brcmf_pub *drvr); 58 59 59 60 static inline int brcmf_proto_hdrpull(struct brcmf_pub *drvr, bool do_fws, 60 61 struct sk_buff *skb,
+5 -3
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
··· 622 622 /* Note the names are not postfixed with a1 for backward compatibility */ 623 623 BRCMF_FW_DEF(43430A1, "brcmfmac43430-sdio"); 624 624 BRCMF_FW_DEF(43455, "brcmfmac43455-sdio"); 625 + BRCMF_FW_DEF(43456, "brcmfmac43456-sdio"); 625 626 BRCMF_FW_DEF(4354, "brcmfmac4354-sdio"); 626 627 BRCMF_FW_DEF(4356, "brcmfmac4356-sdio"); 627 628 BRCMF_FW_DEF(4373, "brcmfmac4373-sdio"); ··· 643 642 BRCMF_FW_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339), 644 643 BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0x00000001, 43430A0), 645 644 BRCMF_FW_ENTRY(BRCM_CC_43430_CHIP_ID, 0xFFFFFFFE, 43430A1), 646 - BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFFC0, 43455), 645 + BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0x00000200, 43456), 646 + BRCMF_FW_ENTRY(BRCM_CC_4345_CHIP_ID, 0xFFFFFDC0, 43455), 647 647 BRCMF_FW_ENTRY(BRCM_CC_4354_CHIP_ID, 0xFFFFFFFF, 4354), 648 648 BRCMF_FW_ENTRY(BRCM_CC_4356_CHIP_ID, 0xFFFFFFFF, 4356), 649 649 BRCMF_FW_ENTRY(CY_CC_4373_CHIP_ID, 0xFFFFFFFF, 4373), ··· 1092 1090 1093 1091 /* dongle indicates the firmware has halted/crashed */ 1094 1092 if (hmb_data & HMB_DATA_FWHALT) { 1095 - brcmf_err("mailbox indicates firmware halted\n"); 1096 - brcmf_dev_coredump(&sdiod->func1->dev); 1093 + brcmf_dbg(SDIO, "mailbox indicates firmware halted\n"); 1094 + brcmf_fw_crashed(&sdiod->func1->dev); 1097 1095 } 1098 1096 1099 1097 /* Dongle recomposed rx frames, accept them again */
+22 -22
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
··· 160 160 161 161 struct usb_device *usbdev; 162 162 struct device *dev; 163 - struct mutex dev_init_lock; 163 + struct completion dev_init_done; 164 164 165 165 int ctl_in_pipe, ctl_out_pipe; 166 166 struct urb *ctl_urb; /* URB for control endpoint */ ··· 445 445 446 446 } 447 447 448 - static void brcmf_usb_free_q(struct list_head *q, bool pending) 448 + static void brcmf_usb_free_q(struct list_head *q) 449 449 { 450 450 struct brcmf_usbreq *req, *next; 451 - int i = 0; 451 + 452 452 list_for_each_entry_safe(req, next, q, list) { 453 453 if (!req->urb) { 454 454 brcmf_err("bad req\n"); 455 455 break; 456 456 } 457 - i++; 458 - if (pending) { 459 - usb_kill_urb(req->urb); 460 - } else { 461 - usb_free_urb(req->urb); 462 - list_del_init(&req->list); 463 - } 457 + usb_free_urb(req->urb); 458 + list_del_init(&req->list); 464 459 } 465 460 } 466 461 ··· 677 682 678 683 static void brcmf_cancel_all_urbs(struct brcmf_usbdev_info *devinfo) 679 684 { 685 + int i; 686 + 680 687 if (devinfo->ctl_urb) 681 688 usb_kill_urb(devinfo->ctl_urb); 682 689 if (devinfo->bulk_urb) 683 690 usb_kill_urb(devinfo->bulk_urb); 684 - brcmf_usb_free_q(&devinfo->tx_postq, true); 685 - brcmf_usb_free_q(&devinfo->rx_postq, true); 691 + if (devinfo->tx_reqs) 692 + for (i = 0; i < devinfo->bus_pub.ntxq; i++) 693 + usb_kill_urb(devinfo->tx_reqs[i].urb); 694 + if (devinfo->rx_reqs) 695 + for (i = 0; i < devinfo->bus_pub.nrxq; i++) 696 + usb_kill_urb(devinfo->rx_reqs[i].urb); 686 697 } 687 698 688 699 static void brcmf_usb_down(struct device *dev) ··· 1024 1023 brcmf_dbg(USB, "Enter, devinfo %p\n", devinfo); 1025 1024 1026 1025 /* free the URBS */ 1027 - brcmf_usb_free_q(&devinfo->rx_freeq, false); 1028 - brcmf_usb_free_q(&devinfo->tx_freeq, false); 1026 + brcmf_usb_free_q(&devinfo->rx_freeq); 1027 + brcmf_usb_free_q(&devinfo->tx_freeq); 1029 1028 1030 1029 usb_free_urb(devinfo->ctl_urb); 1031 1030 usb_free_urb(devinfo->bulk_urb); ··· 1194 1193 if (ret) 1195 1194 goto error; 1196 1195 1197 - mutex_unlock(&devinfo->dev_init_lock); 1196 + complete(&devinfo->dev_init_done); 1198 1197 return; 1199 1198 error: 1200 1199 brcmf_dbg(TRACE, "failed: dev=%s, err=%d\n", dev_name(dev), ret); 1201 - mutex_unlock(&devinfo->dev_init_lock); 1200 + complete(&devinfo->dev_init_done); 1202 1201 device_release_driver(dev); 1203 1202 } 1204 1203 ··· 1266 1265 if (ret) 1267 1266 goto fail; 1268 1267 /* we are done */ 1269 - mutex_unlock(&devinfo->dev_init_lock); 1268 + complete(&devinfo->dev_init_done); 1270 1269 return 0; 1271 1270 } 1272 1271 bus->chip = bus_pub->devid; ··· 1326 1325 1327 1326 devinfo->usbdev = usb; 1328 1327 devinfo->dev = &usb->dev; 1329 - /* Take an init lock, to protect for disconnect while still loading. 1328 + /* Init completion, to protect for disconnect while still loading. 1330 1329 * Necessary because of the asynchronous firmware load construction 1331 1330 */ 1332 - mutex_init(&devinfo->dev_init_lock); 1333 - mutex_lock(&devinfo->dev_init_lock); 1331 + init_completion(&devinfo->dev_init_done); 1334 1332 1335 1333 usb_set_intfdata(intf, devinfo); 1336 1334 ··· 1407 1407 return 0; 1408 1408 1409 1409 fail: 1410 - mutex_unlock(&devinfo->dev_init_lock); 1410 + complete(&devinfo->dev_init_done); 1411 1411 kfree(devinfo); 1412 1412 usb_set_intfdata(intf, NULL); 1413 1413 return ret; ··· 1422 1422 devinfo = (struct brcmf_usbdev_info *)usb_get_intfdata(intf); 1423 1423 1424 1424 if (devinfo) { 1425 - mutex_lock(&devinfo->dev_init_lock); 1425 + wait_for_completion(&devinfo->dev_init_done); 1426 1426 /* Make sure that devinfo still exists. Firmware probe routines 1427 1427 * may have released the device and cleared the intfdata. 1428 1428 */
-1
drivers/net/wireless/intel/iwlegacy/4965.c
··· 577 577 sign = -sign; 578 578 denom = -denom; 579 579 } 580 - *res = 1; 581 580 *res = ((num * 2 + denom) / (denom * 2)) * sign; 582 581 583 582 return 1;
+19 -3
drivers/net/wireless/intel/iwlwifi/cfg/22000.c
··· 89 89 #define IWL_22000_SO_A_HR_B_FW_PRE "iwlwifi-so-a0-hr-b0-" 90 90 #define IWL_22000_SO_A_GF_A_FW_PRE "iwlwifi-so-a0-gf-a0-" 91 91 #define IWL_22000_TY_A_GF_A_FW_PRE "iwlwifi-ty-a0-gf-a0-" 92 + #define IWL_22000_SO_A_GF4_A_FW_PRE "iwlwifi-so-a0-gf4-a0-" 92 93 93 94 #define IWL_22000_HR_MODULE_FIRMWARE(api) \ 94 95 IWL_22000_HR_FW_PRE __stringify(api) ".ucode" ··· 181 180 .dbgc_supported = true, \ 182 181 .min_umac_error_event_table = 0x400000, \ 183 182 .d3_debug_data_base_addr = 0x401000, \ 184 - .d3_debug_data_length = 60 * 1024 183 + .d3_debug_data_length = 60 * 1024, \ 184 + .fw_mon_smem_write_ptr_addr = 0xa0c16c, \ 185 + .fw_mon_smem_write_ptr_msk = 0xfffff, \ 186 + .fw_mon_smem_cycle_cnt_ptr_addr = 0xa0c174, \ 187 + .fw_mon_smem_cycle_cnt_ptr_msk = 0xfffff 185 188 186 189 #define IWL_DEVICE_AX200_COMMON \ 187 190 IWL_DEVICE_22000_COMMON, \ ··· 195 190 IWL_DEVICE_22000_COMMON, \ 196 191 .device_family = IWL_DEVICE_FAMILY_22000, \ 197 192 .base_params = &iwl_22000_base_params, \ 198 - .csr = &iwl_csr_v1 193 + .csr = &iwl_csr_v1, \ 194 + .gp2_reg_addr = 0xa02c68 199 195 200 196 #define IWL_DEVICE_22560 \ 201 197 IWL_DEVICE_22000_COMMON, \ ··· 209 203 .device_family = IWL_DEVICE_FAMILY_AX210, \ 210 204 .base_params = &iwl_22000_base_params, \ 211 205 .csr = &iwl_csr_v1, \ 212 - .min_txq_size = 128 206 + .min_txq_size = 128, \ 207 + .gp2_reg_addr = 0xd02c68, \ 208 + .min_256_ba_txq_size = 512 213 209 214 210 const struct iwl_cfg iwl22000_2ac_cfg_hr = { 215 211 .name = "Intel(R) Dual Band Wireless AC 22000", ··· 448 440 const struct iwl_cfg iwlax210_2ax_cfg_so_gf_a0 = { 449 441 .name = "Intel(R) Wi-Fi 7 AX211 160MHz", 450 442 .fw_name_pre = IWL_22000_SO_A_GF_A_FW_PRE, 443 + .uhb_supported = true, 451 444 IWL_DEVICE_AX210, 452 445 }; 453 446 454 447 const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0 = { 455 448 .name = "Intel(R) Wi-Fi 7 AX210 160MHz", 456 449 .fw_name_pre = IWL_22000_TY_A_GF_A_FW_PRE, 450 + .uhb_supported = true, 451 + IWL_DEVICE_AX210, 452 + }; 453 + 454 + const struct iwl_cfg iwlax210_2ax_cfg_so_gf4_a0 = { 455 + .name = "Intel(R) Wi-Fi 7 AX210 160MHz", 456 + .fw_name_pre = IWL_22000_SO_A_GF4_A_FW_PRE, 457 457 IWL_DEVICE_AX210, 458 458 }; 459 459
+7 -3
drivers/net/wireless/intel/iwlwifi/cfg/9000.c
··· 6 6 * GPL LICENSE SUMMARY 7 7 * 8 8 * Copyright(c) 2015-2017 Intel Deutschland GmbH 9 - * Copyright (C) 2018 Intel Corporation 9 + * Copyright (C) 2018 - 2019 Intel Corporation 10 10 * 11 11 * This program is free software; you can redistribute it and/or modify 12 12 * it under the terms of version 2 of the GNU General Public License as ··· 20 20 * BSD LICENSE 21 21 * 22 22 * Copyright(c) 2015-2017 Intel Deutschland GmbH 23 - * Copyright (C) 2018 Intel Corporation 23 + * Copyright (C) 2018 - 2019 Intel Corporation 24 24 * All rights reserved. 25 25 * 26 26 * Redistribution and use in source and binary forms, with or without ··· 148 148 .d3_debug_data_length = 92 * 1024, \ 149 149 .ht_params = &iwl9000_ht_params, \ 150 150 .nvm_ver = IWL9000_NVM_VERSION, \ 151 - .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K 151 + .max_ht_ampdu_exponent = IEEE80211_HT_MAX_AMPDU_64K, \ 152 + .fw_mon_smem_write_ptr_addr = 0xa0476c, \ 153 + .fw_mon_smem_write_ptr_msk = 0xfffff, \ 154 + .fw_mon_smem_cycle_cnt_ptr_addr = 0xa04774, \ 155 + .fw_mon_smem_cycle_cnt_ptr_msk = 0xfffff 152 156 153 157 154 158 const struct iwl_cfg iwl9160_2ac_cfg = {
+118 -59
drivers/net/wireless/intel/iwlwifi/fw/api/dbg-tlv.h
··· 60 60 61 61 #include <linux/bitops.h> 62 62 63 - /* 63 + /** 64 64 * struct iwl_fw_ini_header: Common Header for all debug group TLV's structures 65 + * 65 66 * @tlv_version: version info 66 67 * @apply_point: &enum iwl_fw_ini_apply_point 67 68 * @data: TLV data followed 68 - **/ 69 + */ 69 70 struct iwl_fw_ini_header { 70 71 __le32 tlv_version; 71 72 __le32 apply_point; ··· 74 73 } __packed; /* FW_DEBUG_TLV_HEADER_S */ 75 74 76 75 /** 77 - * struct iwl_fw_ini_allocation_tlv - (IWL_FW_INI_TLV_TYPE_BUFFER_ALLOCATION) 76 + * struct iwl_fw_ini_allocation_tlv - (IWL_UCODE_TLV_TYPE_BUFFER_ALLOCATION) 78 77 * buffer allocation TLV - for debug 79 78 * 80 79 * @iwl_fw_ini_header: header ··· 85 84 * @max_fragments: the maximum allowed fragmentation in the desired memory 86 85 * allocation above 87 86 * @min_frag_size: the minimum allowed fragmentation size in bytes 88 - */ 87 + */ 89 88 struct iwl_fw_ini_allocation_tlv { 90 89 struct iwl_fw_ini_header header; 91 90 __le32 allocation_id; ··· 96 95 } __packed; /* FW_DEBUG_TLV_BUFFER_ALLOCATION_TLV_S_VER_1 */ 97 96 98 97 /** 99 - * struct iwl_fw_ini_hcmd (IWL_FW_INI_TLV_TYPE_HCMD) 100 - * Generic Host command pass through TLV 98 + * enum iwl_fw_ini_dbg_domain - debug domains 99 + * allows to send host cmd or collect memory region if a given domain is enabled 100 + * 101 + * @IWL_FW_INI_DBG_DOMAIN_ALWAYS_ON: the default domain, always on 102 + * @IWL_FW_INI_DBG_DOMAIN_REPORT_PS: power save domain 103 + */ 104 + enum iwl_fw_ini_dbg_domain { 105 + IWL_FW_INI_DBG_DOMAIN_ALWAYS_ON = 0, 106 + IWL_FW_INI_DBG_DOMAIN_REPORT_PS, 107 + }; /* FW_DEBUG_TLV_DOMAIN_API_E_VER_1 */ 108 + 109 + /** 110 + * struct iwl_fw_ini_hcmd 101 111 * 102 112 * @id: the debug configuration command type for instance: 0xf6 / 0xf5 / DHC 103 113 * @group: the desired cmd group 104 - * @padding: all zeros for dword alignment 105 - * @data: all of the relevant command (0xf6/0xf5) to be sent 106 - */ 114 + * @reserved: to align to FW struct 115 + * @data: all of the relevant command data to be sent 116 + */ 107 117 struct iwl_fw_ini_hcmd { 108 118 u8 id; 109 119 u8 group; 110 - __le16 padding; 120 + __le16 reserved; 111 121 u8 data[0]; 112 - } __packed; /* FW_DEBUG_TLV_HCMD_DATA_S */ 122 + } __packed; /* FW_DEBUG_TLV_HCMD_DATA_API_S_VER_1 */ 113 123 114 124 /** 115 - * struct iwl_fw_ini_hcmd_tlv 125 + * struct iwl_fw_ini_hcmd_tlv - (IWL_UCODE_TLV_TYPE_HCMD) 126 + * Generic Host command pass through TLV 127 + * 116 128 * @header: header 129 + * @domain: send command only if the specific domain is enabled 130 + * &enum iwl_fw_ini_dbg_domain 131 + * @period_msec: period in which the hcmd will be sent to FW. Measured in msec 132 + * (0 = one time command). 117 133 * @hcmd: a variable length host-command to be sent to apply the configuration. 118 134 */ 119 135 struct iwl_fw_ini_hcmd_tlv { 120 136 struct iwl_fw_ini_header header; 137 + __le32 domain; 138 + __le32 period_msec; 121 139 struct iwl_fw_ini_hcmd hcmd; 122 - } __packed; /* FW_DEBUG_TLV_HCMD_S_VER_1 */ 140 + } __packed; /* FW_DEBUG_TLV_HCMD_API_S_VER_1 */ 123 141 124 - /* 125 - * struct iwl_fw_ini_debug_flow_tlv (IWL_FW_INI_TLV_TYPE_DEBUG_FLOW) 142 + /** 143 + * struct iwl_fw_ini_debug_flow_tlv - (IWL_UCODE_TLV_TYPE_DEBUG_FLOW) 126 144 * 127 145 * @header: header 128 146 * @debug_flow_cfg: &enum iwl_fw_ini_debug_flow ··· 155 135 #define IWL_FW_INI_MAX_NAME 32 156 136 157 137 /** 138 + * struct iwl_fw_ini_region_cfg_dhc - defines dhc response to dump. 139 + * 140 + * @id_and_grp: id and group of dhc response. 141 + * @desc: dhc response descriptor. 142 + */ 143 + struct iwl_fw_ini_region_cfg_dhc { 144 + __le32 id_and_grp; 145 + __le32 desc; 146 + } __packed; /* FW_DEBUG_TLV_REGION_DHC_API_S_VER_1 */ 147 + 148 + /** 158 149 * struct iwl_fw_ini_region_cfg_internal - meta data of internal memory region 150 + * 159 151 * @num_of_range: the amount of ranges in the region 160 152 * @range_data_size: size of the data to read per range, in bytes. 161 153 */ ··· 178 146 179 147 /** 180 148 * struct iwl_fw_ini_region_cfg_fifos - meta data of fifos region 149 + * 181 150 * @fid1: fifo id 1 - bitmap of lmac tx/rx fifos to include in the region 182 151 * @fid2: fifo id 2 - bitmap of umac rx fifos to include in the region. 183 152 * It is unused for tx. ··· 196 163 197 164 /** 198 165 * struct iwl_fw_ini_region_cfg 166 + * 199 167 * @region_id: ID of this dump configuration 200 168 * @region_type: &enum iwl_fw_ini_region_type 201 - * @num_regions: amount of regions in the address array. 169 + * @domain: dump this region only if the specific domain is enabled 170 + * &enum iwl_fw_ini_dbg_domain 202 171 * @name_len: name length 203 172 * @name: file name to use for this region 204 173 * @internal: used in case the region uses internal memory. 205 174 * @allocation_id: For DRAM type field substitutes for allocation_id 206 175 * @fifos: used in case of fifos region. 176 + * @dhc_desc: dhc response descriptor. 177 + * @notif_id_and_grp: dump this region only if the specific notification 178 + * occurred. 207 179 * @offset: offset to use for each memory base address 208 180 * @start_addr: array of addresses. 209 181 */ 210 182 struct iwl_fw_ini_region_cfg { 211 183 __le32 region_id; 212 184 __le32 region_type; 185 + __le32 domain; 213 186 __le32 name_len; 214 187 u8 name[IWL_FW_INI_MAX_NAME]; 215 188 union { 216 189 struct iwl_fw_ini_region_cfg_internal internal; 217 190 __le32 allocation_id; 218 191 struct iwl_fw_ini_region_cfg_fifos fifos; 219 - }; 192 + struct iwl_fw_ini_region_cfg_dhc dhc_desc; 193 + __le32 notif_id_and_grp; 194 + }; /* FW_DEBUG_TLV_REGION_EXT_INT_PARAMS_API_U_VER_1 */ 220 195 __le32 offset; 221 196 __le32 start_addr[]; 222 - } __packed; /* FW_DEBUG_TLV_REGION_CONFIG_S */ 197 + } __packed; /* FW_DEBUG_TLV_REGION_CONFIG_API_S_VER_1 */ 223 198 224 199 /** 225 - * struct iwl_fw_ini_region_tlv - (IWL_FW_INI_TLV_TYPE_REGION_CFG) 226 - * DUMP sections define IDs and triggers that use those IDs TLV 200 + * struct iwl_fw_ini_region_tlv - (IWL_UCODE_TLV_TYPE_REGIONS) 201 + * defines memory regions to dump 202 + * 227 203 * @header: header 228 204 * @num_regions: how many different region section and IDs are coming next 229 205 * @region_config: list of dump configurations ··· 241 199 struct iwl_fw_ini_header header; 242 200 __le32 num_regions; 243 201 struct iwl_fw_ini_region_cfg region_config[]; 244 - } __packed; /* FW_DEBUG_TLV_REGIONS_S_VER_1 */ 202 + } __packed; /* FW_DEBUG_TLV_REGIONS_API_S_VER_1 */ 245 203 246 204 /** 247 - * struct iwl_fw_ini_trigger - (IWL_FW_INI_TLV_TYPE_DUMP_CFG) 248 - * Region sections define IDs and triggers that use those IDs TLV 205 + * struct iwl_fw_ini_trigger 249 206 * 250 - * @trigger_id: enum &iwl_fw_ini_tigger_id 207 + * @trigger_id: &enum iwl_fw_ini_trigger_id 251 208 * @override_trig: determines how apply trigger in case a trigger with the 252 209 * same id is already in use. Using the first 2 bytes: 253 210 * Byte 0: if 0, override trigger configuration, otherwise use the ··· 255 214 * existing trigger. 256 215 * @dump_delay: delay from trigger fire to dump, in usec 257 216 * @occurrences: max amount of times to be fired 217 + * @reserved: to align to FW struct 258 218 * @ignore_consec: ignore consecutive triggers, in usec 259 219 * @force_restart: force FW restart 260 220 * @multi_dut: initiate debug dump data on several DUTs ··· 268 226 __le32 override_trig; 269 227 __le32 dump_delay; 270 228 __le32 occurrences; 229 + __le32 reserved; 271 230 __le32 ignore_consec; 272 231 __le32 force_restart; 273 232 __le32 multi_dut; 274 233 __le32 trigger_data; 275 234 __le32 num_regions; 276 235 __le32 data[]; 277 - } __packed; /* FW_TLV_DEBUG_TRIGGER_CONFIG_S */ 236 + } __packed; /* FW_TLV_DEBUG_TRIGGER_CONFIG_API_S_VER_1 */ 278 237 279 238 /** 280 - * struct iwl_fw_ini_trigger_tlv - (IWL_FW_INI_TLV_TYPE_TRIGGERS_CFG) 281 - * DUMP sections define IDs and triggers that use those IDs TLV 239 + * struct iwl_fw_ini_trigger_tlv - (IWL_UCODE_TLV_TYPE_TRIGGERS) 240 + * Triggers that hold memory regions to dump in case a trigger fires 282 241 * 283 242 * @header: header 284 243 * @num_triggers: how many different triggers section and IDs are coming next ··· 289 246 struct iwl_fw_ini_header header; 290 247 __le32 num_triggers; 291 248 struct iwl_fw_ini_trigger trigger_config[]; 292 - } __packed; /* FW_TLV_DEBUG_TRIGGERS_S_VER_1 */ 249 + } __packed; /* FW_TLV_DEBUG_TRIGGERS_API_S_VER_1 */ 293 250 294 251 /** 295 252 * enum iwl_fw_ini_trigger_id 253 + * 296 254 * @IWL_FW_TRIGGER_ID_FW_ASSERT: FW assert 297 255 * @IWL_FW_TRIGGER_ID_FW_HW_ERROR: HW assert 298 256 * @IWL_FW_TRIGGER_ID_FW_TFD_Q_HANG: TFD queue hang 299 257 * @IWL_FW_TRIGGER_ID_FW_DEBUG_HOST_TRIGGER: FW debug notification 300 - * @IWL_FW_TRIGGER_ID_FW_GENERIC_NOTIFOCATION: FW generic notification 258 + * @IWL_FW_TRIGGER_ID_FW_GENERIC_NOTIFICATION: FW generic notification 301 259 * @IWL_FW_TRIGGER_ID_USER_TRIGGER: User trigger 260 + * @IWL_FW_TRIGGER_ID_PERIODIC_TRIGGER: triggers periodically 302 261 * @IWL_FW_TRIGGER_ID_HOST_PEER_CLIENT_INACTIVITY: peer inactivity 303 262 * @IWL_FW_TRIGGER_ID_HOST_TX_LATENCY_THRESHOLD_CROSSED: TX latency 304 263 * threshold was crossed ··· 344 299 345 300 /* FW triggers */ 346 301 IWL_FW_TRIGGER_ID_FW_DEBUG_HOST_TRIGGER = 4, 347 - IWL_FW_TRIGGER_ID_FW_GENERIC_NOTIFOCATION = 5, 302 + IWL_FW_TRIGGER_ID_FW_GENERIC_NOTIFICATION = 5, 348 303 349 304 /* User trigger */ 350 305 IWL_FW_TRIGGER_ID_USER_TRIGGER = 6, 351 306 307 + /* periodic uses the data field for the interval time */ 308 + IWL_FW_TRIGGER_ID_PERIODIC_TRIGGER = 7, 309 + 352 310 /* Host triggers */ 353 - IWL_FW_TRIGGER_ID_HOST_PEER_CLIENT_INACTIVITY = 7, 354 - IWL_FW_TRIGGER_ID_HOST_TX_LATENCY_THRESHOLD_CROSSED = 8, 355 - IWL_FW_TRIGGER_ID_HOST_TX_RESPONSE_STATUS_FAILED = 9, 356 - IWL_FW_TRIGGER_ID_HOST_OS_REQ_DEAUTH_PEER = 10, 357 - IWL_FW_TRIGGER_ID_HOST_STOP_GO_REQUEST = 11, 358 - IWL_FW_TRIGGER_ID_HOST_START_GO_REQUEST = 12, 359 - IWL_FW_TRIGGER_ID_HOST_JOIN_GROUP_REQUEST = 13, 360 - IWL_FW_TRIGGER_ID_HOST_SCAN_START = 14, 361 - IWL_FW_TRIGGER_ID_HOST_SCAN_SUBMITTED = 15, 362 - IWL_FW_TRIGGER_ID_HOST_SCAN_PARAMS = 16, 363 - IWL_FW_TRIGGER_ID_HOST_CHECK_FOR_HANG = 17, 364 - IWL_FW_TRIGGER_ID_HOST_BAR_RECEIVED = 18, 365 - IWL_FW_TRIGGER_ID_HOST_AGG_TX_RESPONSE_STATUS_FAILED = 19, 366 - IWL_FW_TRIGGER_ID_HOST_EAPOL_TX_RESPONSE_FAILED = 20, 367 - IWL_FW_TRIGGER_ID_HOST_FAKE_TX_RESPONSE_SUSPECTED = 21, 368 - IWL_FW_TRIGGER_ID_HOST_AUTH_REQ_FROM_ASSOC_CLIENT = 22, 369 - IWL_FW_TRIGGER_ID_HOST_ROAM_COMPLETE = 23, 370 - IWL_FW_TRIGGER_ID_HOST_AUTH_ASSOC_FAST_FAILED = 24, 371 - IWL_FW_TRIGGER_ID_HOST_D3_START = 25, 372 - IWL_FW_TRIGGER_ID_HOST_D3_END = 26, 373 - IWL_FW_TRIGGER_ID_HOST_BSS_MISSED_BEACONS = 27, 374 - IWL_FW_TRIGGER_ID_HOST_P2P_CLIENT_MISSED_BEACONS = 28, 375 - IWL_FW_TRIGGER_ID_HOST_PEER_CLIENT_TX_FAILURES = 29, 376 - IWL_FW_TRIGGER_ID_HOST_TX_WFD_ACTION_FRAME_FAILED = 30, 377 - IWL_FW_TRIGGER_ID_HOST_AUTH_ASSOC_FAILED = 31, 378 - IWL_FW_TRIGGER_ID_HOST_SCAN_COMPLETE = 32, 379 - IWL_FW_TRIGGER_ID_HOST_SCAN_ABORT = 33, 380 - IWL_FW_TRIGGER_ID_HOST_NIC_ALIVE = 34, 381 - IWL_FW_TRIGGER_ID_HOST_CHANNEL_SWITCH_COMPLETE = 35, 311 + IWL_FW_TRIGGER_ID_HOST_PEER_CLIENT_INACTIVITY = 8, 312 + IWL_FW_TRIGGER_ID_HOST_TX_LATENCY_THRESHOLD_CROSSED = 9, 313 + IWL_FW_TRIGGER_ID_HOST_TX_RESPONSE_STATUS_FAILED = 10, 314 + IWL_FW_TRIGGER_ID_HOST_OS_REQ_DEAUTH_PEER = 11, 315 + IWL_FW_TRIGGER_ID_HOST_STOP_GO_REQUEST = 12, 316 + IWL_FW_TRIGGER_ID_HOST_START_GO_REQUEST = 13, 317 + IWL_FW_TRIGGER_ID_HOST_JOIN_GROUP_REQUEST = 14, 318 + IWL_FW_TRIGGER_ID_HOST_SCAN_START = 15, 319 + IWL_FW_TRIGGER_ID_HOST_SCAN_SUBMITTED = 16, 320 + IWL_FW_TRIGGER_ID_HOST_SCAN_PARAMS = 17, 321 + IWL_FW_TRIGGER_ID_HOST_CHECK_FOR_HANG = 18, 322 + IWL_FW_TRIGGER_ID_HOST_BAR_RECEIVED = 19, 323 + IWL_FW_TRIGGER_ID_HOST_AGG_TX_RESPONSE_STATUS_FAILED = 20, 324 + IWL_FW_TRIGGER_ID_HOST_EAPOL_TX_RESPONSE_FAILED = 21, 325 + IWL_FW_TRIGGER_ID_HOST_FAKE_TX_RESPONSE_SUSPECTED = 22, 326 + IWL_FW_TRIGGER_ID_HOST_AUTH_REQ_FROM_ASSOC_CLIENT = 23, 327 + IWL_FW_TRIGGER_ID_HOST_ROAM_COMPLETE = 24, 328 + IWL_FW_TRIGGER_ID_HOST_AUTH_ASSOC_FAST_FAILED = 25, 329 + IWL_FW_TRIGGER_ID_HOST_D3_START = 26, 330 + IWL_FW_TRIGGER_ID_HOST_D3_END = 27, 331 + IWL_FW_TRIGGER_ID_HOST_BSS_MISSED_BEACONS = 28, 332 + IWL_FW_TRIGGER_ID_HOST_P2P_CLIENT_MISSED_BEACONS = 29, 333 + IWL_FW_TRIGGER_ID_HOST_PEER_CLIENT_TX_FAILURES = 30, 334 + IWL_FW_TRIGGER_ID_HOST_TX_WFD_ACTION_FRAME_FAILED = 31, 335 + IWL_FW_TRIGGER_ID_HOST_AUTH_ASSOC_FAILED = 32, 336 + IWL_FW_TRIGGER_ID_HOST_SCAN_COMPLETE = 33, 337 + IWL_FW_TRIGGER_ID_HOST_SCAN_ABORT = 34, 338 + IWL_FW_TRIGGER_ID_HOST_NIC_ALIVE = 35, 339 + IWL_FW_TRIGGER_ID_HOST_CHANNEL_SWITCH_COMPLETE = 36, 382 340 383 341 IWL_FW_TRIGGER_ID_NUM, 384 342 }; /* FW_DEBUG_TLV_TRIGGER_ID_E_VER_1 */ 385 343 386 344 /** 387 345 * enum iwl_fw_ini_apply_point 346 + * 388 347 * @IWL_FW_INI_APPLY_INVALID: invalid 389 348 * @IWL_FW_INI_APPLY_EARLY: pre loading FW 390 349 * @IWL_FW_INI_APPLY_AFTER_ALIVE: first cmd from host after alive ··· 409 360 410 361 /** 411 362 * enum iwl_fw_ini_allocation_id 363 + * 412 364 * @IWL_FW_INI_ALLOCATION_INVALID: invalid 413 365 * @IWL_FW_INI_ALLOCATION_ID_DBGC1: allocation meant for DBGC1 configuration 414 366 * @IWL_FW_INI_ALLOCATION_ID_DBGC2: allocation meant for DBGC2 configuration ··· 430 380 431 381 /** 432 382 * enum iwl_fw_ini_buffer_location 383 + * 433 384 * @IWL_FW_INI_LOCATION_INVALID: invalid 434 385 * @IWL_FW_INI_LOCATION_SRAM_PATH: SRAM location 435 386 * @IWL_FW_INI_LOCATION_DRAM_PATH: DRAM location 387 + * @IWL_FW_INI_LOCATION_NPK_PATH: NPK location 436 388 */ 437 389 enum iwl_fw_ini_buffer_location { 438 390 IWL_FW_INI_LOCATION_INVALID, 439 391 IWL_FW_INI_LOCATION_SRAM_PATH, 440 392 IWL_FW_INI_LOCATION_DRAM_PATH, 393 + IWL_FW_INI_LOCATION_NPK_PATH, 441 394 }; /* FW_DEBUG_TLV_BUFFER_LOCATION_E_VER_1 */ 442 395 443 396 /** 444 397 * enum iwl_fw_ini_debug_flow 398 + * 445 399 * @IWL_FW_INI_DEBUG_INVALID: invalid 446 400 * @IWL_FW_INI_DEBUG_DBTR_FLOW: undefined 447 401 * @IWL_FW_INI_DEBUG_TB2DTF_FLOW: undefined ··· 458 404 459 405 /** 460 406 * enum iwl_fw_ini_region_type 407 + * 461 408 * @IWL_FW_INI_REGION_INVALID: invalid 462 409 * @IWL_FW_INI_REGION_DEVICE_MEMORY: device internal memory 463 410 * @IWL_FW_INI_REGION_PERIPHERY_MAC: periphery registers of MAC ··· 471 416 * @IWL_FW_INI_REGION_RXF: RX fifo 472 417 * @IWL_FW_INI_REGION_PAGING: paging memory 473 418 * @IWL_FW_INI_REGION_CSR: CSR registers 419 + * @IWL_FW_INI_REGION_NOTIFICATION: FW notification data 420 + * @IWL_FW_INI_REGION_DHC: dhc response to dump 474 421 * @IWL_FW_INI_REGION_NUM: number of region types 475 422 */ 476 423 enum iwl_fw_ini_region_type { ··· 488 431 IWL_FW_INI_REGION_RXF, 489 432 IWL_FW_INI_REGION_PAGING, 490 433 IWL_FW_INI_REGION_CSR, 434 + IWL_FW_INI_REGION_NOTIFICATION, 435 + IWL_FW_INI_REGION_DHC, 491 436 IWL_FW_INI_REGION_NUM 492 437 }; /* FW_DEBUG_TLV_REGION_TYPE_E_VER_1 */ 493 438
+76 -1
drivers/net/wireless/intel/iwlwifi/fw/api/mac.h
··· 542 542 #define IWL_HE_HTC_LINK_ADAP_BOTH (3 << IWL_HE_HTC_LINK_ADAP_POS) 543 543 544 544 /** 545 + * struct iwl_he_sta_context_cmd_v1 - configure FW to work with HE AP 546 + * @sta_id: STA id 547 + * @tid_limit: max num of TIDs in TX HE-SU multi-TID agg 548 + * 0 - bad value, 1 - multi-tid not supported, 2..8 - tid limit 549 + * @reserved1: reserved byte for future use 550 + * @reserved2: reserved byte for future use 551 + * @flags: see %iwl_11ax_sta_ctxt_flags 552 + * @ref_bssid_addr: reference BSSID used by the AP 553 + * @reserved0: reserved 2 bytes for aligning the ref_bssid_addr field to 8 bytes 554 + * @htc_flags: which features are supported in HTC 555 + * @frag_flags: frag support in A-MSDU 556 + * @frag_level: frag support level 557 + * @frag_max_num: max num of "open" MSDUs in the receiver (in power of 2) 558 + * @frag_min_size: min frag size (except last frag) 559 + * @pkt_ext: optional, exists according to PPE-present bit in the HE-PHY capa 560 + * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame 561 + * @htc_trig_based_pkt_ext: default PE in 4us units 562 + * @frame_time_rts_th: HE duration RTS threshold, in units of 32us 563 + * @rand_alloc_ecwmin: random CWmin = 2**ECWmin-1 564 + * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1 565 + * @reserved3: reserved byte for future use 566 + * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues 567 + */ 568 + struct iwl_he_sta_context_cmd_v1 { 569 + u8 sta_id; 570 + u8 tid_limit; 571 + u8 reserved1; 572 + u8 reserved2; 573 + __le32 flags; 574 + 575 + /* The below fields are set via Multiple BSSID IE */ 576 + u8 ref_bssid_addr[6]; 577 + __le16 reserved0; 578 + 579 + /* The below fields are set via HE-capabilities IE */ 580 + __le32 htc_flags; 581 + 582 + u8 frag_flags; 583 + u8 frag_level; 584 + u8 frag_max_num; 585 + u8 frag_min_size; 586 + 587 + /* The below fields are set via PPE thresholds element */ 588 + struct iwl_he_pkt_ext pkt_ext; 589 + 590 + /* The below fields are set via HE-Operation IE */ 591 + u8 bss_color; 592 + u8 htc_trig_based_pkt_ext; 593 + __le16 frame_time_rts_th; 594 + 595 + /* Random access parameter set (i.e. RAPS) */ 596 + u8 rand_alloc_ecwmin; 597 + u8 rand_alloc_ecwmax; 598 + __le16 reserved3; 599 + 600 + /* The below fields are set via MU EDCA parameter set element */ 601 + struct iwl_he_backoff_conf trig_based_txf[AC_NUM]; 602 + } __packed; /* STA_CONTEXT_DOT11AX_API_S_VER_1 */ 603 + 604 + /** 545 605 * struct iwl_he_sta_context_cmd - configure FW to work with HE AP 546 606 * @sta_id: STA id 547 607 * @tid_limit: max num of TIDs in TX HE-SU multi-TID agg ··· 624 564 * @rand_alloc_ecwmax: random CWmax = 2**ECWmax-1 625 565 * @reserved3: reserved byte for future use 626 566 * @trig_based_txf: MU EDCA Parameter set for the trigger based traffic queues 567 + * @max_bssid_indicator: indicator of the max bssid supported on the associated 568 + * bss 569 + * @bssid_index: index of the associated VAP 570 + * @ema_ap: AP supports enhanced Multi BSSID advertisement 571 + * @profile_periodicity: number of Beacon periods that are needed to receive the 572 + * complete VAPs info 573 + * @bssid_count: actual number of VAPs in the MultiBSS Set 574 + * @reserved4: alignment 627 575 */ 628 576 struct iwl_he_sta_context_cmd { 629 577 u8 sta_id; ··· 667 599 668 600 /* The below fields are set via MU EDCA parameter set element */ 669 601 struct iwl_he_backoff_conf trig_based_txf[AC_NUM]; 670 - } __packed; /* STA_CONTEXT_DOT11AX_API_S */ 602 + 603 + u8 max_bssid_indicator; 604 + u8 bssid_index; 605 + u8 ema_ap; 606 + u8 profile_periodicity; 607 + u8 bssid_count; 608 + u8 reserved4[3]; 609 + } __packed; /* STA_CONTEXT_DOT11AX_API_S_VER_2 */ 671 610 672 611 /** 673 612 * struct iwl_he_monitor_cmd - configure air sniffer for HE
+33 -6
drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
··· 8 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright (C) 2018 Intel Corporation 11 + * Copyright(C) 2018 - 2019 Intel Corporation 12 12 * 13 13 * This program is free software; you can redistribute it and/or modify 14 14 * it under the terms of version 2 of the GNU General Public License as ··· 31 31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 32 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 33 33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 34 - * Copyright (C) 2018 Intel Corporation 34 + * Copyright(C) 2018 - 2019 Intel Corporation 35 35 * All rights reserved. 36 36 * 37 37 * Redistribution and use in source and binary forms, with or without ··· 233 233 __le32 rx_chains; 234 234 } __packed; /* REGULATORY_NVM_GET_INFO_PHY_SKU_SECTION_S_VER_1 */ 235 235 236 - #define IWL_NUM_CHANNELS (51) 236 + #define IWL_NUM_CHANNELS_V1 51 237 + #define IWL_NUM_CHANNELS 110 237 238 238 239 /** 239 240 * struct iwl_nvm_get_info_regulatory - regulatory information ··· 242 241 * @channel_profile: regulatory data of this channel 243 242 * @reserved: reserved 244 243 */ 245 - struct iwl_nvm_get_info_regulatory { 244 + struct iwl_nvm_get_info_regulatory_v1 { 246 245 __le32 lar_enabled; 247 - __le16 channel_profile[IWL_NUM_CHANNELS]; 246 + __le16 channel_profile[IWL_NUM_CHANNELS_V1]; 248 247 __le16 reserved; 249 248 } __packed; /* REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_1 */ 249 + 250 + /** 251 + * struct iwl_nvm_get_info_regulatory - regulatory information 252 + * @lar_enabled: is LAR enabled 253 + * @n_channels: number of valid channels in the array 254 + * @channel_profile: regulatory data of this channel 255 + */ 256 + struct iwl_nvm_get_info_regulatory { 257 + __le32 lar_enabled; 258 + __le32 n_channels; 259 + __le32 channel_profile[IWL_NUM_CHANNELS]; 260 + } __packed; /* REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_2 */ 261 + 262 + /** 263 + * struct iwl_nvm_get_info_rsp_v3 - response to get NVM data 264 + * @general: general NVM data 265 + * @mac_sku: data relating to MAC sku 266 + * @phy_sku: data relating to PHY sku 267 + * @regulatory: regulatory data 268 + */ 269 + struct iwl_nvm_get_info_rsp_v3 { 270 + struct iwl_nvm_get_info_general general; 271 + struct iwl_nvm_get_info_sku mac_sku; 272 + struct iwl_nvm_get_info_phy phy_sku; 273 + struct iwl_nvm_get_info_regulatory_v1 regulatory; 274 + } __packed; /* REGULATORY_NVM_GET_INFO_RSP_API_S_VER_3 */ 250 275 251 276 /** 252 277 * struct iwl_nvm_get_info_rsp - response to get NVM data ··· 286 259 struct iwl_nvm_get_info_sku mac_sku; 287 260 struct iwl_nvm_get_info_phy phy_sku; 288 261 struct iwl_nvm_get_info_regulatory regulatory; 289 - } __packed; /* REGULATORY_NVM_GET_INFO_RSP_API_S_VER_3 */ 262 + } __packed; /* REGULATORY_NVM_GET_INFO_RSP_API_S_VER_4 */ 290 263 291 264 /** 292 265 * struct iwl_nvm_access_complete_cmd - NVM_ACCESS commands are completed
+2 -65
drivers/net/wireless/intel/iwlwifi/fw/api/rx.h
··· 8 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 Intel Corporation 11 + * Copyright(c) 2018 - 2019 Intel Corporation 12 12 * 13 13 * This program is free software; you can redistribute it and/or modify 14 14 * it under the terms of version 2 of the GNU General Public License as ··· 31 31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 32 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 33 33 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 34 - * Copyright(c) 2018 Intel Corporation 34 + * Copyright(c) 2018 - 2019 Intel Corporation 35 35 * All rights reserved. 36 36 * 37 37 * Redistribution and use in source and binary forms, with or without ··· 688 688 689 689 #define IWL_RX_DESC_SIZE_V1 offsetofend(struct iwl_rx_mpdu_desc, v1) 690 690 691 - #define IWL_CD_STTS_OPTIMIZED_POS 0 692 - #define IWL_CD_STTS_OPTIMIZED_MSK 0x01 693 - #define IWL_CD_STTS_TRANSFER_STATUS_POS 1 694 - #define IWL_CD_STTS_TRANSFER_STATUS_MSK 0x0E 695 - #define IWL_CD_STTS_WIFI_STATUS_POS 4 696 - #define IWL_CD_STTS_WIFI_STATUS_MSK 0xF0 697 - 698 691 #define RX_NO_DATA_CHAIN_A_POS 0 699 692 #define RX_NO_DATA_CHAIN_A_MSK (0xff << RX_NO_DATA_CHAIN_A_POS) 700 693 #define RX_NO_DATA_CHAIN_B_POS 8 ··· 739 746 __le32 phy_info[2]; 740 747 __le32 rx_vec[2]; 741 748 } __packed; /* RX_NO_DATA_NTFY_API_S_VER_1 */ 742 - 743 - /** 744 - * enum iwl_completion_desc_transfer_status - transfer status (bits 1-3) 745 - * @IWL_CD_STTS_UNUSED: unused 746 - * @IWL_CD_STTS_UNUSED_2: unused 747 - * @IWL_CD_STTS_END_TRANSFER: successful transfer complete. 748 - * In sniffer mode, when split is used, set in last CD completion. (RX) 749 - * @IWL_CD_STTS_OVERFLOW: In sniffer mode, when using split - used for 750 - * all CD completion. (RX) 751 - * @IWL_CD_STTS_ABORTED: CR abort / close flow. (RX) 752 - * @IWL_CD_STTS_ERROR: general error (RX) 753 - */ 754 - enum iwl_completion_desc_transfer_status { 755 - IWL_CD_STTS_UNUSED, 756 - IWL_CD_STTS_UNUSED_2, 757 - IWL_CD_STTS_END_TRANSFER, 758 - IWL_CD_STTS_OVERFLOW, 759 - IWL_CD_STTS_ABORTED, 760 - IWL_CD_STTS_ERROR, 761 - }; 762 - 763 - /** 764 - * enum iwl_completion_desc_wifi_status - wifi status (bits 4-7) 765 - * @IWL_CD_STTS_VALID: the packet is valid (RX) 766 - * @IWL_CD_STTS_FCS_ERR: frame check sequence error (RX) 767 - * @IWL_CD_STTS_SEC_KEY_ERR: error handling the security key of rx (RX) 768 - * @IWL_CD_STTS_DECRYPTION_ERR: error decrypting the frame (RX) 769 - * @IWL_CD_STTS_DUP: duplicate packet (RX) 770 - * @IWL_CD_STTS_ICV_MIC_ERR: MIC error (RX) 771 - * @IWL_CD_STTS_INTERNAL_SNAP_ERR: problems removing the snap (RX) 772 - * @IWL_CD_STTS_SEC_PORT_FAIL: security port fail (RX) 773 - * @IWL_CD_STTS_BA_OLD_SN: block ack received old SN (RX) 774 - * @IWL_CD_STTS_QOS_NULL: QoS null packet (RX) 775 - * @IWL_CD_STTS_MAC_HDR_ERR: MAC header conversion error (RX) 776 - * @IWL_CD_STTS_MAX_RETRANS: reached max number of retransmissions (TX) 777 - * @IWL_CD_STTS_EX_LIFETIME: exceeded lifetime (TX) 778 - * @IWL_CD_STTS_NOT_USED: completed but not used (RX) 779 - * @IWL_CD_STTS_REPLAY_ERR: pn check failed, replay error (RX) 780 - */ 781 - enum iwl_completion_desc_wifi_status { 782 - IWL_CD_STTS_VALID, 783 - IWL_CD_STTS_FCS_ERR, 784 - IWL_CD_STTS_SEC_KEY_ERR, 785 - IWL_CD_STTS_DECRYPTION_ERR, 786 - IWL_CD_STTS_DUP, 787 - IWL_CD_STTS_ICV_MIC_ERR, 788 - IWL_CD_STTS_INTERNAL_SNAP_ERR, 789 - IWL_CD_STTS_SEC_PORT_FAIL, 790 - IWL_CD_STTS_BA_OLD_SN, 791 - IWL_CD_STTS_QOS_NULL, 792 - IWL_CD_STTS_MAC_HDR_ERR, 793 - IWL_CD_STTS_MAX_RETRANS, 794 - IWL_CD_STTS_EX_LIFETIME, 795 - IWL_CD_STTS_NOT_USED, 796 - IWL_CD_STTS_REPLAY_ERR, 797 - }; 798 749 799 750 struct iwl_frame_release { 800 751 u8 baid;
+50 -4
drivers/net/wireless/intel/iwlwifi/fw/api/scan.h
··· 788 788 __le32 reserved; 789 789 } __packed; /* SCAN_COMPLETE_NTF_UMAC_API_S_VER_1 */ 790 790 791 - #define SCAN_OFFLOAD_MATCHING_CHANNELS_LEN 5 791 + #define SCAN_OFFLOAD_MATCHING_CHANNELS_LEN_V1 5 792 + #define SCAN_OFFLOAD_MATCHING_CHANNELS_LEN 7 793 + 794 + /** 795 + * struct iwl_scan_offload_profile_match_v1 - match information 796 + * @bssid: matched bssid 797 + * @reserved: reserved 798 + * @channel: channel where the match occurred 799 + * @energy: energy 800 + * @matching_feature: feature matches 801 + * @matching_channels: bitmap of channels that matched, referencing 802 + * the channels passed in the scan offload request. 803 + */ 804 + struct iwl_scan_offload_profile_match_v1 { 805 + u8 bssid[ETH_ALEN]; 806 + __le16 reserved; 807 + u8 channel; 808 + u8 energy; 809 + u8 matching_feature; 810 + u8 matching_channels[SCAN_OFFLOAD_MATCHING_CHANNELS_LEN_V1]; 811 + } __packed; /* SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S_VER_1 */ 812 + 813 + /** 814 + * struct iwl_scan_offload_profiles_query_v1 - match results query response 815 + * @matched_profiles: bitmap of matched profiles, referencing the 816 + * matches passed in the scan offload request 817 + * @last_scan_age: age of the last offloaded scan 818 + * @n_scans_done: number of offloaded scans done 819 + * @gp2_d0u: GP2 when D0U occurred 820 + * @gp2_invoked: GP2 when scan offload was invoked 821 + * @resume_while_scanning: not used 822 + * @self_recovery: obsolete 823 + * @reserved: reserved 824 + * @matches: array of match information, one for each match 825 + */ 826 + struct iwl_scan_offload_profiles_query_v1 { 827 + __le32 matched_profiles; 828 + __le32 last_scan_age; 829 + __le32 n_scans_done; 830 + __le32 gp2_d0u; 831 + __le32 gp2_invoked; 832 + u8 resume_while_scanning; 833 + u8 self_recovery; 834 + __le16 reserved; 835 + struct iwl_scan_offload_profile_match_v1 matches[IWL_SCAN_MAX_PROFILES]; 836 + } __packed; /* SCAN_OFFLOAD_PROFILES_QUERY_RSP_S_VER_2 */ 837 + 792 838 /** 793 839 * struct iwl_scan_offload_profile_match - match information 794 840 * @bssid: matched bssid ··· 843 797 * @energy: energy 844 798 * @matching_feature: feature matches 845 799 * @matching_channels: bitmap of channels that matched, referencing 846 - * the channels passed in tue scan offload request 800 + * the channels passed in the scan offload request. 847 801 */ 848 802 struct iwl_scan_offload_profile_match { 849 803 u8 bssid[ETH_ALEN]; ··· 852 806 u8 energy; 853 807 u8 matching_feature; 854 808 u8 matching_channels[SCAN_OFFLOAD_MATCHING_CHANNELS_LEN]; 855 - } __packed; /* SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S_VER_1 */ 809 + } __packed; /* SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S_VER_2 */ 856 810 857 811 /** 858 812 * struct iwl_scan_offload_profiles_query - match results query response ··· 877 831 u8 self_recovery; 878 832 __le16 reserved; 879 833 struct iwl_scan_offload_profile_match matches[IWL_SCAN_MAX_PROFILES]; 880 - } __packed; /* SCAN_OFFLOAD_PROFILES_QUERY_RSP_S_VER_2 */ 834 + } __packed; /* SCAN_OFFLOAD_PROFILES_QUERY_RSP_S_VER_3 */ 881 835 882 836 /** 883 837 * struct iwl_umac_scan_iter_complete_notif - notifies end of scanning iteration
+280 -150
drivers/net/wireless/intel/iwlwifi/fw/dbg.c
··· 804 804 } 805 805 806 806 static struct iwl_fw_error_dump_file * 807 - _iwl_fw_error_dump(struct iwl_fw_runtime *fwrt, 808 - struct iwl_fw_dump_ptrs *fw_error_dump) 807 + iwl_fw_error_dump_file(struct iwl_fw_runtime *fwrt, 808 + struct iwl_fw_dump_ptrs *fw_error_dump) 809 809 { 810 810 struct iwl_fw_error_dump_file *dump_file; 811 811 struct iwl_fw_error_dump_data *dump_data; ··· 967 967 if (fifo_len) { 968 968 iwl_fw_dump_rxf(fwrt, &dump_data); 969 969 iwl_fw_dump_txf(fwrt, &dump_data); 970 - if (radio_len) 971 - iwl_read_radio_regs(fwrt, &dump_data); 972 970 } 971 + 972 + if (radio_len) 973 + iwl_read_radio_regs(fwrt, &dump_data); 973 974 974 975 if (iwl_fw_dbg_type_on(fwrt, IWL_FW_ERROR_DUMP_ERROR_INFO) && 975 976 fwrt->dump.desc) { ··· 1050 1049 { 1051 1050 struct iwl_fw_ini_error_dump_range *range = range_ptr; 1052 1051 __le32 *val = range->data; 1053 - u32 addr, prph_val, offset = le32_to_cpu(reg->offset); 1052 + u32 prph_val; 1053 + u32 addr = le32_to_cpu(reg->start_addr[idx]) + le32_to_cpu(reg->offset); 1054 1054 int i; 1055 1055 1056 - range->start_addr = reg->start_addr[idx]; 1056 + range->start_addr = cpu_to_le64(addr); 1057 1057 range->range_data_size = reg->internal.range_data_size; 1058 1058 for (i = 0; i < le32_to_cpu(reg->internal.range_data_size); i += 4) { 1059 - addr = le32_to_cpu(range->start_addr) + i; 1060 - prph_val = iwl_read_prph(fwrt->trans, addr + offset); 1059 + prph_val = iwl_read_prph(fwrt->trans, addr + i); 1061 1060 if (prph_val == 0x5a5a5a5a) 1062 1061 return -EBUSY; 1063 1062 *val++ = cpu_to_le32(prph_val); ··· 1072 1071 { 1073 1072 struct iwl_fw_ini_error_dump_range *range = range_ptr; 1074 1073 __le32 *val = range->data; 1075 - u32 addr, offset = le32_to_cpu(reg->offset); 1074 + u32 addr = le32_to_cpu(reg->start_addr[idx]) + le32_to_cpu(reg->offset); 1076 1075 int i; 1077 1076 1078 - range->start_addr = reg->start_addr[idx]; 1077 + range->start_addr = cpu_to_le64(addr); 1079 1078 range->range_data_size = reg->internal.range_data_size; 1080 - for (i = 0; i < le32_to_cpu(reg->internal.range_data_size); i += 4) { 1081 - addr = le32_to_cpu(range->start_addr) + i; 1082 - *val++ = cpu_to_le32(iwl_trans_read32(fwrt->trans, 1083 - addr + offset)); 1084 - } 1079 + for (i = 0; i < le32_to_cpu(reg->internal.range_data_size); i += 4) 1080 + *val++ = cpu_to_le32(iwl_trans_read32(fwrt->trans, addr + i)); 1085 1081 1086 1082 return sizeof(*range) + le32_to_cpu(range->range_data_size); 1087 1083 } ··· 1088 1090 void *range_ptr, int idx) 1089 1091 { 1090 1092 struct iwl_fw_ini_error_dump_range *range = range_ptr; 1091 - u32 addr = le32_to_cpu(range->start_addr); 1092 - u32 offset = le32_to_cpu(reg->offset); 1093 + u32 addr = le32_to_cpu(reg->start_addr[idx]) + le32_to_cpu(reg->offset); 1093 1094 1094 - range->start_addr = reg->start_addr[idx]; 1095 + range->start_addr = cpu_to_le64(addr); 1095 1096 range->range_data_size = reg->internal.range_data_size; 1096 - iwl_trans_read_mem_bytes(fwrt->trans, addr + offset, range->data, 1097 + iwl_trans_read_mem_bytes(fwrt->trans, addr, range->data, 1097 1098 le32_to_cpu(reg->internal.range_data_size)); 1098 1099 1099 1100 return sizeof(*range) + le32_to_cpu(range->range_data_size); ··· 1106 1109 struct iwl_fw_ini_error_dump_range *range = range_ptr; 1107 1110 u32 page_size = fwrt->trans->init_dram.paging[idx].size; 1108 1111 1109 - range->start_addr = cpu_to_le32(idx); 1112 + range->start_addr = cpu_to_le64(idx); 1110 1113 range->range_data_size = cpu_to_le32(page_size); 1111 1114 memcpy(range->data, fwrt->trans->init_dram.paging[idx].block, 1112 1115 page_size); ··· 1126 1129 dma_addr_t addr = fwrt->fw_paging_db[idx].fw_paging_phys; 1127 1130 u32 page_size = fwrt->fw_paging_db[idx].fw_paging_size; 1128 1131 1129 - range->start_addr = cpu_to_le32(idx); 1132 + range->start_addr = cpu_to_le64(idx); 1130 1133 range->range_data_size = cpu_to_le32(page_size); 1131 1134 dma_sync_single_for_cpu(fwrt->trans->dev, addr, page_size, 1132 1135 DMA_BIDIRECTIONAL); ··· 1149 1152 if (start_addr == 0x5a5a5a5a) 1150 1153 return -EBUSY; 1151 1154 1152 - range->start_addr = cpu_to_le32(start_addr); 1155 + range->start_addr = cpu_to_le64(start_addr); 1153 1156 range->range_data_size = cpu_to_le32(fwrt->trans->fw_mon[idx].size); 1154 1157 1155 1158 memcpy(range->data, fwrt->trans->fw_mon[idx].block, ··· 1225 1228 { 1226 1229 struct iwl_fw_ini_fifo_error_dump_range *range = range_ptr; 1227 1230 struct iwl_ini_txf_iter_data *iter; 1231 + struct iwl_fw_ini_error_dump_register *reg_dump = (void *)range->data; 1228 1232 u32 offs = le32_to_cpu(reg->offset), addr; 1229 1233 u32 registers_size = 1230 - le32_to_cpu(reg->fifos.num_of_registers) * sizeof(__le32); 1231 - __le32 *val = range->data; 1234 + le32_to_cpu(reg->fifos.num_of_registers) * sizeof(*reg_dump); 1235 + __le32 *data; 1232 1236 unsigned long flags; 1233 1237 int i; 1234 1238 ··· 1247 1249 1248 1250 iwl_write_prph_no_grab(fwrt->trans, TXF_LARC_NUM + offs, iter->fifo); 1249 1251 1250 - /* read txf registers */ 1252 + /* 1253 + * read txf registers. for each register, write to the dump the 1254 + * register address and its value 1255 + */ 1251 1256 for (i = 0; i < le32_to_cpu(reg->fifos.num_of_registers); i++) { 1252 1257 addr = le32_to_cpu(reg->start_addr[i]) + offs; 1253 1258 1254 - *val++ = cpu_to_le32(iwl_read_prph_no_grab(fwrt->trans, addr)); 1259 + reg_dump->addr = cpu_to_le32(addr); 1260 + reg_dump->data = cpu_to_le32(iwl_read_prph_no_grab(fwrt->trans, 1261 + addr)); 1262 + 1263 + reg_dump++; 1255 1264 } 1256 1265 1257 1266 if (reg->fifos.header_only) { ··· 1275 1270 1276 1271 /* Read FIFO */ 1277 1272 addr = TXF_READ_MODIFY_DATA + offs; 1278 - for (i = 0; i < iter->fifo_size; i += sizeof(__le32)) 1279 - *val++ = cpu_to_le32(iwl_read_prph_no_grab(fwrt->trans, addr)); 1273 + data = (void *)reg_dump; 1274 + for (i = 0; i < iter->fifo_size; i += sizeof(*data)) 1275 + *data++ = cpu_to_le32(iwl_read_prph_no_grab(fwrt->trans, addr)); 1280 1276 1281 1277 out: 1282 1278 iwl_trans_release_nic_access(fwrt->trans, &flags); ··· 1333 1327 { 1334 1328 struct iwl_fw_ini_fifo_error_dump_range *range = range_ptr; 1335 1329 struct iwl_ini_rxf_data rxf_data; 1330 + struct iwl_fw_ini_error_dump_register *reg_dump = (void *)range->data; 1336 1331 u32 offs = le32_to_cpu(reg->offset), addr; 1337 1332 u32 registers_size = 1338 - le32_to_cpu(reg->fifos.num_of_registers) * sizeof(__le32); 1339 - __le32 *val = range->data; 1333 + le32_to_cpu(reg->fifos.num_of_registers) * sizeof(*reg_dump); 1334 + __le32 *data; 1340 1335 unsigned long flags; 1341 1336 int i; 1342 1337 ··· 1348 1341 if (!iwl_trans_grab_nic_access(fwrt->trans, &flags)) 1349 1342 return -EBUSY; 1350 1343 1351 - offs += rxf_data.offset; 1352 - 1353 1344 range->fifo_num = cpu_to_le32(rxf_data.fifo_num); 1354 1345 range->num_of_registers = reg->fifos.num_of_registers; 1355 1346 range->range_data_size = cpu_to_le32(rxf_data.size + registers_size); 1356 1347 1357 - /* read rxf registers */ 1348 + /* 1349 + * read rxf registers. for each register, write to the dump the 1350 + * register address and its value 1351 + */ 1358 1352 for (i = 0; i < le32_to_cpu(reg->fifos.num_of_registers); i++) { 1359 1353 addr = le32_to_cpu(reg->start_addr[i]) + offs; 1360 1354 1361 - *val++ = cpu_to_le32(iwl_read_prph_no_grab(fwrt->trans, addr)); 1355 + reg_dump->addr = cpu_to_le32(addr); 1356 + reg_dump->data = cpu_to_le32(iwl_read_prph_no_grab(fwrt->trans, 1357 + addr)); 1358 + 1359 + reg_dump++; 1362 1360 } 1363 1361 1364 1362 if (reg->fifos.header_only) { 1365 1363 range->range_data_size = cpu_to_le32(registers_size); 1366 1364 goto out; 1367 1365 } 1366 + 1367 + /* 1368 + * region register have absolute value so apply rxf offset after 1369 + * reading the registers 1370 + */ 1371 + offs += rxf_data.offset; 1368 1372 1369 1373 /* Lock fence */ 1370 1374 iwl_write_prph_no_grab(fwrt->trans, RXF_SET_FENCE_MODE + offs, 0x1); ··· 1387 1369 1388 1370 /* Read FIFO */ 1389 1371 addr = RXF_FIFO_RD_FENCE_INC + offs; 1390 - for (i = 0; i < rxf_data.size; i += sizeof(__le32)) 1391 - *val++ = cpu_to_le32(iwl_read_prph_no_grab(fwrt->trans, addr)); 1372 + data = (void *)reg_dump; 1373 + for (i = 0; i < rxf_data.size; i += sizeof(*data)) 1374 + *data++ = cpu_to_le32(iwl_read_prph_no_grab(fwrt->trans, addr)); 1392 1375 1393 1376 out: 1394 1377 iwl_trans_release_nic_access(fwrt->trans, &flags); ··· 1403 1384 { 1404 1385 struct iwl_fw_ini_error_dump *dump = data; 1405 1386 1387 + dump->header.version = cpu_to_le32(IWL_INI_DUMP_MEM_VER); 1388 + 1406 1389 return dump->ranges; 1390 + } 1391 + 1392 + static void 1393 + *iwl_dump_ini_mon_fill_header(struct iwl_fw_runtime *fwrt, 1394 + struct iwl_fw_ini_region_cfg *reg, 1395 + struct iwl_fw_ini_monitor_dump *data, 1396 + u32 write_ptr_addr, u32 write_ptr_msk, 1397 + u32 cycle_cnt_addr, u32 cycle_cnt_msk) 1398 + { 1399 + u32 write_ptr, cycle_cnt; 1400 + unsigned long flags; 1401 + 1402 + if (!iwl_trans_grab_nic_access(fwrt->trans, &flags)) { 1403 + IWL_ERR(fwrt, "Failed to get monitor header\n"); 1404 + return NULL; 1405 + } 1406 + 1407 + write_ptr = iwl_read_prph_no_grab(fwrt->trans, write_ptr_addr); 1408 + cycle_cnt = iwl_read_prph_no_grab(fwrt->trans, cycle_cnt_addr); 1409 + 1410 + iwl_trans_release_nic_access(fwrt->trans, &flags); 1411 + 1412 + data->header.version = cpu_to_le32(IWL_INI_DUMP_MONITOR_VER); 1413 + data->write_ptr = cpu_to_le32(write_ptr & write_ptr_msk); 1414 + data->cycle_cnt = cpu_to_le32(cycle_cnt & cycle_cnt_msk); 1415 + 1416 + return data->ranges; 1407 1417 } 1408 1418 1409 1419 static void ··· 1440 1392 struct iwl_fw_ini_region_cfg *reg, 1441 1393 void *data) 1442 1394 { 1443 - struct iwl_fw_ini_monitor_dram_dump *mon_dump = (void *)data; 1444 - u32 write_ptr, cycle_cnt; 1445 - unsigned long flags; 1395 + struct iwl_fw_ini_monitor_dump *mon_dump = (void *)data; 1396 + u32 write_ptr_addr, write_ptr_msk, cycle_cnt_addr, cycle_cnt_msk; 1446 1397 1447 - if (!iwl_trans_grab_nic_access(fwrt->trans, &flags)) { 1448 - IWL_ERR(fwrt, "Failed to get DRAM monitor header\n"); 1398 + switch (fwrt->trans->cfg->device_family) { 1399 + case IWL_DEVICE_FAMILY_9000: 1400 + case IWL_DEVICE_FAMILY_22000: 1401 + write_ptr_addr = MON_BUFF_WRPTR_VER2; 1402 + write_ptr_msk = -1; 1403 + cycle_cnt_addr = MON_BUFF_CYCLE_CNT_VER2; 1404 + cycle_cnt_msk = -1; 1405 + break; 1406 + default: 1407 + IWL_ERR(fwrt, "Unsupported device family %d\n", 1408 + fwrt->trans->cfg->device_family); 1449 1409 return NULL; 1450 1410 } 1451 - write_ptr = iwl_read_umac_prph_no_grab(fwrt->trans, 1452 - MON_BUFF_WRPTR_VER2); 1453 - cycle_cnt = iwl_read_umac_prph_no_grab(fwrt->trans, 1454 - MON_BUFF_CYCLE_CNT_VER2); 1455 - iwl_trans_release_nic_access(fwrt->trans, &flags); 1456 1411 1457 - mon_dump->write_ptr = cpu_to_le32(write_ptr); 1458 - mon_dump->cycle_cnt = cpu_to_le32(cycle_cnt); 1412 + return iwl_dump_ini_mon_fill_header(fwrt, reg, mon_dump, write_ptr_addr, 1413 + write_ptr_msk, cycle_cnt_addr, 1414 + cycle_cnt_msk); 1415 + } 1459 1416 1460 - return mon_dump->ranges; 1417 + static void 1418 + *iwl_dump_ini_mon_smem_fill_header(struct iwl_fw_runtime *fwrt, 1419 + struct iwl_fw_ini_region_cfg *reg, 1420 + void *data) 1421 + { 1422 + struct iwl_fw_ini_monitor_dump *mon_dump = (void *)data; 1423 + const struct iwl_cfg *cfg = fwrt->trans->cfg; 1424 + 1425 + if (fwrt->trans->cfg->device_family != IWL_DEVICE_FAMILY_9000 && 1426 + fwrt->trans->cfg->device_family != IWL_DEVICE_FAMILY_22000) { 1427 + IWL_ERR(fwrt, "Unsupported device family %d\n", 1428 + fwrt->trans->cfg->device_family); 1429 + return NULL; 1430 + } 1431 + 1432 + return iwl_dump_ini_mon_fill_header(fwrt, reg, mon_dump, 1433 + cfg->fw_mon_smem_write_ptr_addr, 1434 + cfg->fw_mon_smem_write_ptr_msk, 1435 + cfg->fw_mon_smem_cycle_cnt_ptr_addr, 1436 + cfg->fw_mon_smem_cycle_cnt_ptr_msk); 1437 + 1461 1438 } 1462 1439 1463 1440 static void *iwl_dump_ini_fifo_fill_header(struct iwl_fw_runtime *fwrt, ··· 1490 1417 void *data) 1491 1418 { 1492 1419 struct iwl_fw_ini_fifo_error_dump *dump = data; 1420 + 1421 + dump->header.version = cpu_to_le32(IWL_INI_DUMP_FIFO_VER); 1493 1422 1494 1423 return dump->ranges; 1495 1424 } ··· 1584 1509 static u32 iwl_dump_ini_mon_dram_get_size(struct iwl_fw_runtime *fwrt, 1585 1510 struct iwl_fw_ini_region_cfg *reg) 1586 1511 { 1587 - u32 size = sizeof(struct iwl_fw_ini_monitor_dram_dump); 1512 + u32 size = sizeof(struct iwl_fw_ini_monitor_dump) + 1513 + sizeof(struct iwl_fw_ini_error_dump_range); 1588 1514 1589 1515 if (fwrt->trans->num_blocks) 1590 1516 size += fwrt->trans->fw_mon[0].size; 1591 1517 1592 1518 return size; 1519 + } 1520 + 1521 + static u32 iwl_dump_ini_mon_smem_get_size(struct iwl_fw_runtime *fwrt, 1522 + struct iwl_fw_ini_region_cfg *reg) 1523 + { 1524 + return sizeof(struct iwl_fw_ini_monitor_dump) + 1525 + iwl_dump_ini_mem_ranges(fwrt, reg) * 1526 + (sizeof(struct iwl_fw_ini_error_dump_range) + 1527 + le32_to_cpu(reg->internal.range_data_size)); 1593 1528 } 1594 1529 1595 1530 static u32 iwl_dump_ini_txf_get_size(struct iwl_fw_runtime *fwrt, ··· 1609 1524 void *fifo_iter = fwrt->dump.fifo_iter; 1610 1525 u32 size = 0; 1611 1526 u32 fifo_hdr = sizeof(struct iwl_fw_ini_fifo_error_dump_range) + 1612 - le32_to_cpu(reg->fifos.num_of_registers) * sizeof(__le32); 1527 + le32_to_cpu(reg->fifos.num_of_registers) * sizeof(__le32) * 2; 1613 1528 1614 1529 fwrt->dump.fifo_iter = &iter; 1615 1530 while (iwl_ini_txf_iter(fwrt, reg)) { ··· 1632 1547 struct iwl_ini_rxf_data rx_data; 1633 1548 u32 size = sizeof(struct iwl_fw_ini_fifo_error_dump) + 1634 1549 sizeof(struct iwl_fw_ini_fifo_error_dump_range) + 1635 - le32_to_cpu(reg->fifos.num_of_registers) * sizeof(__le32); 1550 + le32_to_cpu(reg->fifos.num_of_registers) * sizeof(__le32) * 2; 1636 1551 1637 1552 if (reg->fifos.header_only) 1638 1553 return size; ··· 1669 1584 * @fwrt: fw runtime struct. 1670 1585 * @data: dump memory data. 1671 1586 * @reg: region to copy to the dump. 1587 + * @ops: memory dump operations. 1672 1588 */ 1673 1589 static void 1674 1590 iwl_dump_ini_mem(struct iwl_fw_runtime *fwrt, 1675 - enum iwl_fw_ini_region_type type, 1676 1591 struct iwl_fw_error_dump_data **data, 1677 1592 struct iwl_fw_ini_region_cfg *reg, 1678 1593 struct iwl_dump_ini_mem_ops *ops) 1679 1594 { 1680 1595 struct iwl_fw_ini_error_dump_header *header = (void *)(*data)->data; 1596 + u32 num_of_ranges, i, type = le32_to_cpu(reg->region_type); 1681 1597 void *range; 1682 - u32 num_of_ranges, i; 1683 1598 1684 1599 if (WARN_ON(!ops || !ops->get_num_of_ranges || !ops->get_size || 1685 1600 !ops->fill_mem_hdr || !ops->fill_range)) ··· 1690 1605 (*data)->type = cpu_to_le32(type | INI_DUMP_BIT); 1691 1606 (*data)->len = cpu_to_le32(ops->get_size(fwrt, reg)); 1692 1607 1608 + header->region_id = reg->region_id; 1693 1609 header->num_of_ranges = cpu_to_le32(num_of_ranges); 1694 1610 header->name_len = cpu_to_le32(min_t(int, IWL_FW_INI_MAX_NAME, 1695 1611 le32_to_cpu(reg->name_len))); ··· 1729 1643 for (i = 0; i < le32_to_cpu(trigger->num_regions); i++) { 1730 1644 u32 reg_id = le32_to_cpu(trigger->data[i]); 1731 1645 struct iwl_fw_ini_region_cfg *reg; 1732 - enum iwl_fw_ini_region_type type; 1733 1646 1734 1647 if (WARN_ON(reg_id >= ARRAY_SIZE(fwrt->dump.active_regs))) 1735 1648 continue; ··· 1737 1652 if (WARN(!reg, "Unassigned region %d\n", reg_id)) 1738 1653 continue; 1739 1654 1740 - type = le32_to_cpu(reg->region_type); 1741 - switch (type) { 1655 + switch (le32_to_cpu(reg->region_type)) { 1742 1656 case IWL_FW_INI_REGION_DEVICE_MEMORY: 1743 1657 case IWL_FW_INI_REGION_PERIPHERY_MAC: 1744 1658 case IWL_FW_INI_REGION_PERIPHERY_PHY: 1745 1659 case IWL_FW_INI_REGION_PERIPHERY_AUX: 1746 - case IWL_FW_INI_REGION_INTERNAL_BUFFER: 1747 1660 case IWL_FW_INI_REGION_CSR: 1748 1661 size += hdr_len + iwl_dump_ini_mem_get_size(fwrt, reg); 1749 1662 break; ··· 1751 1668 case IWL_FW_INI_REGION_RXF: 1752 1669 size += hdr_len + iwl_dump_ini_rxf_get_size(fwrt, reg); 1753 1670 break; 1754 - case IWL_FW_INI_REGION_PAGING: { 1671 + case IWL_FW_INI_REGION_PAGING: 1755 1672 size += hdr_len; 1756 1673 if (iwl_fw_dbg_is_paging_enabled(fwrt)) { 1757 1674 size += iwl_dump_ini_paging_get_size(fwrt, reg); ··· 1760 1677 reg); 1761 1678 } 1762 1679 break; 1763 - } 1764 1680 case IWL_FW_INI_REGION_DRAM_BUFFER: 1765 1681 if (!fwrt->trans->num_blocks) 1766 1682 break; 1767 1683 size += hdr_len + 1768 1684 iwl_dump_ini_mon_dram_get_size(fwrt, reg); 1685 + break; 1686 + case IWL_FW_INI_REGION_INTERNAL_BUFFER: 1687 + size += hdr_len + 1688 + iwl_dump_ini_mon_smem_get_size(fwrt, reg); 1769 1689 break; 1770 1690 case IWL_FW_INI_REGION_DRAM_IMR: 1771 1691 /* Undefined yet */ ··· 1787 1701 1788 1702 for (i = 0; i < num; i++) { 1789 1703 u32 reg_id = le32_to_cpu(trigger->data[i]); 1790 - enum iwl_fw_ini_region_type type; 1791 1704 struct iwl_fw_ini_region_cfg *reg; 1792 1705 struct iwl_dump_ini_mem_ops ops; 1793 1706 ··· 1798 1713 if (!reg) 1799 1714 continue; 1800 1715 1801 - type = le32_to_cpu(reg->region_type); 1802 - switch (type) { 1716 + /* currently the driver supports always on domain only */ 1717 + if (le32_to_cpu(reg->domain) != IWL_FW_INI_DBG_DOMAIN_ALWAYS_ON) 1718 + continue; 1719 + 1720 + switch (le32_to_cpu(reg->region_type)) { 1803 1721 case IWL_FW_INI_REGION_DEVICE_MEMORY: 1804 - case IWL_FW_INI_REGION_INTERNAL_BUFFER: 1805 1722 ops.get_num_of_ranges = iwl_dump_ini_mem_ranges; 1806 1723 ops.get_size = iwl_dump_ini_mem_get_size; 1807 1724 ops.fill_mem_hdr = iwl_dump_ini_mem_fill_header; 1808 1725 ops.fill_range = iwl_dump_ini_dev_mem_iter; 1809 - iwl_dump_ini_mem(fwrt, type, data, reg, &ops); 1726 + iwl_dump_ini_mem(fwrt, data, reg, &ops); 1810 1727 break; 1811 1728 case IWL_FW_INI_REGION_PERIPHERY_MAC: 1812 1729 case IWL_FW_INI_REGION_PERIPHERY_PHY: ··· 1817 1730 ops.get_size = iwl_dump_ini_mem_get_size; 1818 1731 ops.fill_mem_hdr = iwl_dump_ini_mem_fill_header; 1819 1732 ops.fill_range = iwl_dump_ini_prph_iter; 1820 - iwl_dump_ini_mem(fwrt, type, data, reg, &ops); 1733 + iwl_dump_ini_mem(fwrt, data, reg, &ops); 1821 1734 break; 1822 1735 case IWL_FW_INI_REGION_DRAM_BUFFER: 1823 1736 ops.get_num_of_ranges = iwl_dump_ini_mon_dram_ranges; 1824 1737 ops.get_size = iwl_dump_ini_mon_dram_get_size; 1825 1738 ops.fill_mem_hdr = iwl_dump_ini_mon_dram_fill_header; 1826 1739 ops.fill_range = iwl_dump_ini_mon_dram_iter; 1827 - iwl_dump_ini_mem(fwrt, type, data, reg, &ops); 1740 + iwl_dump_ini_mem(fwrt, data, reg, &ops); 1828 1741 break; 1829 - case IWL_FW_INI_REGION_PAGING: { 1742 + case IWL_FW_INI_REGION_INTERNAL_BUFFER: 1743 + ops.get_num_of_ranges = iwl_dump_ini_mem_ranges; 1744 + ops.get_size = iwl_dump_ini_mon_smem_get_size; 1745 + ops.fill_mem_hdr = iwl_dump_ini_mon_smem_fill_header; 1746 + ops.fill_range = iwl_dump_ini_dev_mem_iter; 1747 + iwl_dump_ini_mem(fwrt, data, reg, &ops); 1748 + break; 1749 + case IWL_FW_INI_REGION_PAGING: 1830 1750 ops.fill_mem_hdr = iwl_dump_ini_mem_fill_header; 1831 1751 if (iwl_fw_dbg_is_paging_enabled(fwrt)) { 1832 1752 ops.get_num_of_ranges = ··· 1848 1754 ops.fill_range = iwl_dump_ini_paging_gen2_iter; 1849 1755 } 1850 1756 1851 - iwl_dump_ini_mem(fwrt, type, data, reg, &ops); 1757 + iwl_dump_ini_mem(fwrt, data, reg, &ops); 1852 1758 break; 1853 - } 1854 1759 case IWL_FW_INI_REGION_TXF: { 1855 1760 struct iwl_ini_txf_iter_data iter = { .init = true }; 1856 1761 void *fifo_iter = fwrt->dump.fifo_iter; ··· 1859 1766 ops.get_size = iwl_dump_ini_txf_get_size; 1860 1767 ops.fill_mem_hdr = iwl_dump_ini_fifo_fill_header; 1861 1768 ops.fill_range = iwl_dump_ini_txf_iter; 1862 - iwl_dump_ini_mem(fwrt, type, data, reg, &ops); 1769 + iwl_dump_ini_mem(fwrt, data, reg, &ops); 1863 1770 fwrt->dump.fifo_iter = fifo_iter; 1864 1771 break; 1865 1772 } ··· 1868 1775 ops.get_size = iwl_dump_ini_rxf_get_size; 1869 1776 ops.fill_mem_hdr = iwl_dump_ini_fifo_fill_header; 1870 1777 ops.fill_range = iwl_dump_ini_rxf_iter; 1871 - iwl_dump_ini_mem(fwrt, type, data, reg, &ops); 1778 + iwl_dump_ini_mem(fwrt, data, reg, &ops); 1872 1779 break; 1873 1780 case IWL_FW_INI_REGION_CSR: 1874 1781 ops.get_num_of_ranges = iwl_dump_ini_mem_ranges; 1875 1782 ops.get_size = iwl_dump_ini_mem_get_size; 1876 1783 ops.fill_mem_hdr = iwl_dump_ini_mem_fill_header; 1877 1784 ops.fill_range = iwl_dump_ini_csr_iter; 1878 - iwl_dump_ini_mem(fwrt, type, data, reg, &ops); 1785 + iwl_dump_ini_mem(fwrt, data, reg, &ops); 1879 1786 break; 1880 1787 case IWL_FW_INI_REGION_DRAM_IMR: 1881 1788 /* This is undefined yet */ ··· 1886 1793 } 1887 1794 1888 1795 static struct iwl_fw_error_dump_file * 1889 - _iwl_fw_error_ini_dump(struct iwl_fw_runtime *fwrt, 1890 - struct iwl_fw_dump_ptrs *fw_error_dump) 1796 + iwl_fw_error_ini_dump_file(struct iwl_fw_runtime *fwrt) 1891 1797 { 1892 - int size, id = le32_to_cpu(fwrt->dump.desc->trig_desc.type); 1798 + int size; 1893 1799 struct iwl_fw_error_dump_data *dump_data; 1894 1800 struct iwl_fw_error_dump_file *dump_file; 1895 1801 struct iwl_fw_ini_trigger *trigger; 1896 - 1897 - if (id == FW_DBG_TRIGGER_FW_ASSERT) 1898 - id = IWL_FW_TRIGGER_ID_FW_ASSERT; 1802 + enum iwl_fw_ini_trigger_id id = fwrt->dump.ini_trig_id; 1899 1803 1900 1804 if (!iwl_fw_ini_trigger_on(fwrt, id)) 1901 1805 return NULL; ··· 1909 1819 if (!dump_file) 1910 1820 return NULL; 1911 1821 1912 - fw_error_dump->fwrt_ptr = dump_file; 1913 - 1914 1822 dump_file->barker = cpu_to_le32(IWL_FW_ERROR_DUMP_BARKER); 1915 1823 dump_data = (void *)dump_file->data; 1916 1824 dump_file->file_len = cpu_to_le32(size); ··· 1918 1830 return dump_file; 1919 1831 } 1920 1832 1921 - void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt) 1833 + static void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt) 1922 1834 { 1923 - struct iwl_fw_dump_ptrs *fw_error_dump; 1835 + struct iwl_fw_dump_ptrs fw_error_dump = {}; 1924 1836 struct iwl_fw_error_dump_file *dump_file; 1925 1837 struct scatterlist *sg_dump_data; 1926 1838 u32 file_len; 1927 1839 u32 dump_mask = fwrt->fw->dbg.dump_mask; 1928 1840 1929 - IWL_DEBUG_INFO(fwrt, "WRT dump start\n"); 1930 - 1931 - /* there's no point in fw dump if the bus is dead */ 1932 - if (test_bit(STATUS_TRANS_DEAD, &fwrt->trans->status)) { 1933 - IWL_ERR(fwrt, "Skip fw error dump since bus is dead\n"); 1841 + dump_file = iwl_fw_error_dump_file(fwrt, &fw_error_dump); 1842 + if (!dump_file) 1934 1843 goto out; 1935 - } 1936 - 1937 - fw_error_dump = kzalloc(sizeof(*fw_error_dump), GFP_KERNEL); 1938 - if (!fw_error_dump) 1939 - goto out; 1940 - 1941 - if (fwrt->trans->ini_valid) 1942 - dump_file = _iwl_fw_error_ini_dump(fwrt, fw_error_dump); 1943 - else 1944 - dump_file = _iwl_fw_error_dump(fwrt, fw_error_dump); 1945 - 1946 - if (!dump_file) { 1947 - kfree(fw_error_dump); 1948 - goto out; 1949 - } 1950 1844 1951 1845 if (!fwrt->trans->ini_valid && fwrt->dump.monitor_only) 1952 1846 dump_mask &= IWL_FW_ERROR_DUMP_FW_MONITOR; 1953 1847 1954 - if (!fwrt->trans->ini_valid) 1955 - fw_error_dump->trans_ptr = 1956 - iwl_trans_dump_data(fwrt->trans, dump_mask); 1957 - 1848 + fw_error_dump.trans_ptr = iwl_trans_dump_data(fwrt->trans, dump_mask); 1958 1849 file_len = le32_to_cpu(dump_file->file_len); 1959 - fw_error_dump->fwrt_len = file_len; 1960 - if (fw_error_dump->trans_ptr) { 1961 - file_len += fw_error_dump->trans_ptr->len; 1850 + fw_error_dump.fwrt_len = file_len; 1851 + 1852 + if (fw_error_dump.trans_ptr) { 1853 + file_len += fw_error_dump.trans_ptr->len; 1962 1854 dump_file->file_len = cpu_to_le32(file_len); 1963 1855 } 1964 1856 ··· 1946 1878 if (sg_dump_data) { 1947 1879 sg_pcopy_from_buffer(sg_dump_data, 1948 1880 sg_nents(sg_dump_data), 1949 - fw_error_dump->fwrt_ptr, 1950 - fw_error_dump->fwrt_len, 0); 1951 - if (fw_error_dump->trans_ptr) 1881 + fw_error_dump.fwrt_ptr, 1882 + fw_error_dump.fwrt_len, 0); 1883 + if (fw_error_dump.trans_ptr) 1952 1884 sg_pcopy_from_buffer(sg_dump_data, 1953 1885 sg_nents(sg_dump_data), 1954 - fw_error_dump->trans_ptr->data, 1955 - fw_error_dump->trans_ptr->len, 1956 - fw_error_dump->fwrt_len); 1886 + fw_error_dump.trans_ptr->data, 1887 + fw_error_dump.trans_ptr->len, 1888 + fw_error_dump.fwrt_len); 1957 1889 dev_coredumpsg(fwrt->trans->dev, sg_dump_data, file_len, 1958 1890 GFP_KERNEL); 1959 1891 } 1960 - vfree(fw_error_dump->fwrt_ptr); 1961 - vfree(fw_error_dump->trans_ptr); 1962 - kfree(fw_error_dump); 1892 + vfree(fw_error_dump.fwrt_ptr); 1893 + vfree(fw_error_dump.trans_ptr); 1963 1894 1964 1895 out: 1965 1896 iwl_fw_free_dump_desc(fwrt); 1966 1897 clear_bit(IWL_FWRT_STATUS_DUMPING, &fwrt->status); 1967 - IWL_DEBUG_INFO(fwrt, "WRT dump done\n"); 1968 1898 } 1969 - IWL_EXPORT_SYMBOL(iwl_fw_error_dump); 1899 + 1900 + static void iwl_fw_error_ini_dump(struct iwl_fw_runtime *fwrt) 1901 + { 1902 + struct iwl_fw_error_dump_file *dump_file; 1903 + struct scatterlist *sg_dump_data; 1904 + u32 file_len; 1905 + 1906 + dump_file = iwl_fw_error_ini_dump_file(fwrt); 1907 + if (!dump_file) 1908 + goto out; 1909 + 1910 + file_len = le32_to_cpu(dump_file->file_len); 1911 + 1912 + sg_dump_data = alloc_sgtable(file_len); 1913 + if (sg_dump_data) { 1914 + sg_pcopy_from_buffer(sg_dump_data, sg_nents(sg_dump_data), 1915 + dump_file, file_len, 0); 1916 + dev_coredumpsg(fwrt->trans->dev, sg_dump_data, file_len, 1917 + GFP_KERNEL); 1918 + } 1919 + vfree(dump_file); 1920 + out: 1921 + fwrt->dump.ini_trig_id = IWL_FW_TRIGGER_ID_INVALID; 1922 + clear_bit(IWL_FWRT_STATUS_DUMPING, &fwrt->status); 1923 + } 1970 1924 1971 1925 const struct iwl_fw_dump_desc iwl_dump_desc_assert = { 1972 1926 .trig_desc = { ··· 2002 1912 bool monitor_only, 2003 1913 unsigned int delay) 2004 1914 { 1915 + u32 trig_type = le32_to_cpu(desc->trig_desc.type); 1916 + int ret; 1917 + 1918 + if (fwrt->trans->ini_valid) { 1919 + ret = iwl_fw_dbg_ini_collect(fwrt, trig_type); 1920 + if (!ret) 1921 + iwl_fw_free_dump_desc(fwrt); 1922 + 1923 + return ret; 1924 + } 1925 + 2005 1926 if (test_and_set_bit(IWL_FWRT_STATUS_DUMPING, &fwrt->status)) 2006 1927 return -EBUSY; 2007 1928 ··· 2054 1953 } 2055 1954 IWL_EXPORT_SYMBOL(iwl_fw_dbg_error_collect); 2056 1955 2057 - int _iwl_fw_dbg_collect(struct iwl_fw_runtime *fwrt, 2058 - enum iwl_fw_dbg_trigger trig, 2059 - const char *str, size_t len, 2060 - struct iwl_fw_dbg_trigger_tlv *trigger) 1956 + int iwl_fw_dbg_collect(struct iwl_fw_runtime *fwrt, 1957 + enum iwl_fw_dbg_trigger trig, 1958 + const char *str, size_t len, 1959 + struct iwl_fw_dbg_trigger_tlv *trigger) 2061 1960 { 2062 1961 struct iwl_fw_dump_desc *desc; 2063 1962 unsigned int delay = 0; ··· 2094 1993 2095 1994 return iwl_fw_dbg_collect_desc(fwrt, desc, monitor_only, delay); 2096 1995 } 2097 - IWL_EXPORT_SYMBOL(_iwl_fw_dbg_collect); 1996 + IWL_EXPORT_SYMBOL(iwl_fw_dbg_collect); 2098 1997 2099 - int iwl_fw_dbg_collect(struct iwl_fw_runtime *fwrt, 2100 - u32 id, const char *str, size_t len) 1998 + int _iwl_fw_dbg_ini_collect(struct iwl_fw_runtime *fwrt, 1999 + enum iwl_fw_ini_trigger_id id) 2101 2000 { 2102 - struct iwl_fw_dump_desc *desc; 2103 2001 struct iwl_fw_ini_active_triggers *active; 2104 2002 u32 occur, delay; 2105 2003 2106 - if (!fwrt->trans->ini_valid) 2107 - return _iwl_fw_dbg_collect(fwrt, id, str, len, NULL); 2108 - 2109 - if (id == FW_DBG_TRIGGER_USER) 2110 - id = IWL_FW_TRIGGER_ID_USER_TRIGGER; 2111 - 2112 - active = &fwrt->dump.active_trigs[id]; 2113 - 2114 - if (WARN_ON(!active->active)) 2004 + if (WARN_ON(!iwl_fw_ini_trigger_on(fwrt, id))) 2115 2005 return -EINVAL; 2116 2006 2007 + if (test_and_set_bit(IWL_FWRT_STATUS_DUMPING, &fwrt->status)) 2008 + return -EBUSY; 2009 + 2010 + active = &fwrt->dump.active_trigs[id]; 2117 2011 delay = le32_to_cpu(active->trig->dump_delay); 2118 2012 occur = le32_to_cpu(active->trig->occurrences); 2119 2013 if (!occur) 2120 2014 return 0; 2015 + 2016 + active->trig->occurrences = cpu_to_le32(--occur); 2121 2017 2122 2018 if (le32_to_cpu(active->trig->force_restart)) { 2123 2019 IWL_WARN(fwrt, "Force restart: trigger %d fired.\n", id); ··· 2122 2024 return 0; 2123 2025 } 2124 2026 2125 - desc = kzalloc(sizeof(*desc) + len, GFP_ATOMIC); 2126 - if (!desc) 2127 - return -ENOMEM; 2027 + fwrt->dump.ini_trig_id = id; 2128 2028 2129 - active->trig->occurrences = cpu_to_le32(--occur); 2029 + IWL_WARN(fwrt, "Collecting data: ini trigger %d fired.\n", id); 2130 2030 2131 - desc->len = len; 2132 - desc->trig_desc.type = cpu_to_le32(id); 2133 - memcpy(desc->trig_desc.data, str, len); 2031 + schedule_delayed_work(&fwrt->dump.wk, usecs_to_jiffies(delay)); 2134 2032 2135 - return iwl_fw_dbg_collect_desc(fwrt, desc, true, delay); 2033 + return 0; 2136 2034 } 2137 - IWL_EXPORT_SYMBOL(iwl_fw_dbg_collect); 2035 + IWL_EXPORT_SYMBOL(_iwl_fw_dbg_ini_collect); 2036 + 2037 + int iwl_fw_dbg_ini_collect(struct iwl_fw_runtime *fwrt, u32 legacy_trigger_id) 2038 + { 2039 + int id; 2040 + 2041 + switch (legacy_trigger_id) { 2042 + case FW_DBG_TRIGGER_FW_ASSERT: 2043 + case FW_DBG_TRIGGER_ALIVE_TIMEOUT: 2044 + case FW_DBG_TRIGGER_DRIVER: 2045 + id = IWL_FW_TRIGGER_ID_FW_ASSERT; 2046 + break; 2047 + case FW_DBG_TRIGGER_USER: 2048 + id = IWL_FW_TRIGGER_ID_USER_TRIGGER; 2049 + break; 2050 + default: 2051 + return -EIO; 2052 + } 2053 + 2054 + return _iwl_fw_dbg_ini_collect(fwrt, id); 2055 + } 2056 + IWL_EXPORT_SYMBOL(iwl_fw_dbg_ini_collect); 2138 2057 2139 2058 int iwl_fw_dbg_collect_trig(struct iwl_fw_runtime *fwrt, 2140 2059 struct iwl_fw_dbg_trigger_tlv *trigger, ··· 2179 2064 len = strlen(buf) + 1; 2180 2065 } 2181 2066 2182 - ret = _iwl_fw_dbg_collect(fwrt, le32_to_cpu(trigger->id), buf, len, 2183 - trigger); 2067 + ret = iwl_fw_dbg_collect(fwrt, le32_to_cpu(trigger->id), buf, len, 2068 + trigger); 2184 2069 2185 2070 if (ret) 2186 2071 return ret; ··· 2254 2139 return; 2255 2140 } 2256 2141 2142 + /* there's no point in fw dump if the bus is dead */ 2143 + if (test_bit(STATUS_TRANS_DEAD, &fwrt->trans->status)) { 2144 + IWL_ERR(fwrt, "Skip fw error dump since bus is dead\n"); 2145 + return; 2146 + } 2147 + 2257 2148 iwl_fw_dbg_stop_recording(fwrt, &params); 2258 2149 2259 - iwl_fw_error_dump(fwrt); 2150 + IWL_DEBUG_INFO(fwrt, "WRT dump start\n"); 2151 + if (fwrt->trans->ini_valid) 2152 + iwl_fw_error_ini_dump(fwrt); 2153 + else 2154 + iwl_fw_error_dump(fwrt); 2155 + IWL_DEBUG_INFO(fwrt, "WRT dump done\n"); 2260 2156 2261 2157 /* start recording again if the firmware is not crashed */ 2262 2158 if (!test_bit(STATUS_FW_ERROR, &fwrt->trans->status) && ··· 2410 2284 .len = { len, }, 2411 2285 .data = { data->data, }, 2412 2286 }; 2287 + 2288 + /* currently the driver supports always on domain only */ 2289 + if (le32_to_cpu(hcmd_tlv->domain) != IWL_FW_INI_DBG_DOMAIN_ALWAYS_ON) 2290 + return; 2413 2291 2414 2292 iwl_trans_send_cmd(fwrt->trans, &hcmd); 2415 2293 }
+17 -10
drivers/net/wireless/intel/iwlwifi/fw/dbg.h
··· 108 108 fwrt->dump.umac_err_id = 0; 109 109 } 110 110 111 - void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt); 112 111 int iwl_fw_dbg_collect_desc(struct iwl_fw_runtime *fwrt, 113 112 const struct iwl_fw_dump_desc *desc, 114 113 bool monitor_only, unsigned int delay); 115 114 int iwl_fw_dbg_error_collect(struct iwl_fw_runtime *fwrt, 116 115 enum iwl_fw_dbg_trigger trig_type); 117 - int _iwl_fw_dbg_collect(struct iwl_fw_runtime *fwrt, 118 - enum iwl_fw_dbg_trigger trig, 119 - const char *str, size_t len, 120 - struct iwl_fw_dbg_trigger_tlv *trigger); 116 + int _iwl_fw_dbg_ini_collect(struct iwl_fw_runtime *fwrt, 117 + enum iwl_fw_ini_trigger_id id); 118 + int iwl_fw_dbg_ini_collect(struct iwl_fw_runtime *fwrt, u32 legacy_trigger_id); 121 119 int iwl_fw_dbg_collect(struct iwl_fw_runtime *fwrt, 122 - u32 id, const char *str, size_t len); 120 + enum iwl_fw_dbg_trigger trig, const char *str, 121 + size_t len, struct iwl_fw_dbg_trigger_tlv *trigger); 123 122 int iwl_fw_dbg_collect_trig(struct iwl_fw_runtime *fwrt, 124 123 struct iwl_fw_dbg_trigger_tlv *trigger, 125 124 const char *fmt, ...) __printf(3, 4); ··· 228 229 struct iwl_fw_ini_trigger *trig; 229 230 u32 usec; 230 231 231 - 232 - 233 - if (!fwrt->trans->ini_valid || id >= IWL_FW_TRIGGER_ID_NUM || 234 - !fwrt->dump.active_trigs[id].active) 232 + if (!fwrt->trans->ini_valid || id == IWL_FW_TRIGGER_ID_INVALID || 233 + id >= IWL_FW_TRIGGER_ID_NUM || !fwrt->dump.active_trigs[id].active) 235 234 return false; 236 235 237 236 trig = fwrt->dump.active_trigs[id].trig; ··· 457 460 458 461 /* This bit is used to differentiate the legacy dump from the ini dump */ 459 462 #define INI_DUMP_BIT BIT(31) 463 + 464 + static inline void iwl_fw_error_collect(struct iwl_fw_runtime *fwrt) 465 + { 466 + if (fwrt->trans->ini_valid && fwrt->trans->hw_error) { 467 + _iwl_fw_dbg_ini_collect(fwrt, IWL_FW_TRIGGER_ID_FW_HW_ERROR); 468 + fwrt->trans->hw_error = false; 469 + } else { 470 + iwl_fw_dbg_collect_desc(fwrt, &iwl_dump_desc_assert, false, 0); 471 + } 472 + } 460 473 461 474 #endif /* __iwl_fw_dbg_h__ */
+31 -8
drivers/net/wireless/intel/iwlwifi/fw/error-dump.h
··· 211 211 * @fw_mon_wr_ptr: the position of the write pointer in the cyclic buffer 212 212 * @fw_mon_base_ptr: base pointer of the data 213 213 * @fw_mon_cycle_cnt: number of wraparounds 214 + * @fw_mon_base_high_ptr: used in AX210 devices, the base adderss is 64 bit 215 + * so fw_mon_base_ptr holds LSB 32 bits and fw_mon_base_high_ptr hold 216 + * MSB 32 bits 214 217 * @reserved: for future use 215 218 * @data: captured data 216 219 */ ··· 221 218 __le32 fw_mon_wr_ptr; 222 219 __le32 fw_mon_base_ptr; 223 220 __le32 fw_mon_cycle_cnt; 224 - __le32 reserved[3]; 221 + __le32 fw_mon_base_high_ptr; 222 + __le32 reserved[2]; 225 223 u8 data[]; 226 224 } __packed; 227 225 ··· 278 274 u8 data[]; 279 275 }; 280 276 277 + #define IWL_INI_DUMP_MEM_VER 1 278 + #define IWL_INI_DUMP_MONITOR_VER 1 279 + #define IWL_INI_DUMP_FIFO_VER 1 280 + 281 281 /** 282 282 * struct iwl_fw_ini_error_dump_range - range of memory 283 - * @start_addr: the start address of this range 284 283 * @range_data_size: the size of this range, in bytes 284 + * @start_addr: the start address of this range 285 285 * @data: the actual memory 286 286 */ 287 287 struct iwl_fw_ini_error_dump_range { 288 - __le32 start_addr; 289 288 __le32 range_data_size; 289 + __le64 start_addr; 290 290 __le32 data[]; 291 291 } __packed; 292 292 293 293 /** 294 294 * struct iwl_fw_ini_error_dump_header - ini region dump header 295 + * @version: dump version 296 + * @region_id: id of the region 295 297 * @num_of_ranges: number of ranges in this region 296 298 * @name_len: number of bytes allocated to the name string of this region 297 299 * @name: name of the region 298 300 */ 299 301 struct iwl_fw_ini_error_dump_header { 302 + __le32 version; 303 + __le32 region_id; 300 304 __le32 num_of_ranges; 301 305 __le32 name_len; 302 306 u8 name[IWL_FW_INI_MAX_NAME]; ··· 324 312 #define IWL_RXF_UMAC_BIT BIT(31) 325 313 326 314 /** 315 + * struct iwl_fw_ini_error_dump_register - ini register dump 316 + * @addr: address of the register 317 + * @data: data of the register 318 + */ 319 + struct iwl_fw_ini_error_dump_register { 320 + __le32 addr; 321 + __le32 data; 322 + } __packed; 323 + 324 + /** 327 325 * struct iwl_fw_ini_fifo_error_dump_range - ini fifo range dump 328 326 * @fifo_num: the fifo num. In case of rxf and umac rxf, set BIT(31) to 329 327 * distinguish between lmac and umac 330 328 * @num_of_registers: num of registers to dump, dword size each 331 - * @range_data_size: the size of the registers and fifo data 332 - * @data: fifo data 329 + * @range_data_size: the size of the data 330 + * @data: consist of 331 + * num_of_registers * (register address + register value) + fifo data 333 332 */ 334 333 struct iwl_fw_ini_fifo_error_dump_range { 335 334 __le32 fifo_num; ··· 374 351 }; 375 352 376 353 /** 377 - * struct iwl_fw_ini_monitor_dram_dump - ini dram monitor dump 354 + * struct iwl_fw_ini_monitor_dump - ini monitor dump 378 355 * @header - header of the region 379 - * @write_ptr - write pointer position in the dram 356 + * @write_ptr - write pointer position in the buffer 380 357 * @cycle_cnt - cycles count 381 358 * @ranges - the memory ranges of this this region 382 359 */ 383 - struct iwl_fw_ini_monitor_dram_dump { 360 + struct iwl_fw_ini_monitor_dump { 384 361 struct iwl_fw_ini_error_dump_header header; 385 362 __le32 write_ptr; 386 363 __le32 cycle_cnt;
+12
drivers/net/wireless/intel/iwlwifi/fw/file.h
··· 272 272 * version of the beacon notification. 273 273 * @IWL_UCODE_TLV_API_BEACON_FILTER_V4: This ucode supports v4 of 274 274 * BEACON_FILTER_CONFIG_API_S_VER_4. 275 + * @IWL_UCODE_TLV_API_REGULATORY_NVM_INFO: This ucode supports v4 of 276 + * REGULATORY_NVM_GET_INFO_RSP_API_S. 275 277 * @IWL_UCODE_TLV_API_FTM_NEW_RANGE_REQ: This ucode supports v7 of 276 278 * LOCATION_RANGE_REQ_CMD_API_S and v6 of LOCATION_RANGE_RESP_NTFY_API_S. 279 + * @IWL_UCODE_TLV_API_SCAN_OFFLOAD_CHANS: This ucode supports v2 of 280 + * SCAN_OFFLOAD_PROFILE_MATCH_RESULTS_S and v3 of 281 + * SCAN_OFFLOAD_PROFILES_QUERY_RSP_S. 282 + * @IWL_UCODE_TLV_API_MBSSID_HE: This ucode supports v2 of 283 + * STA_CONTEXT_DOT11AX_API_S 277 284 * 278 285 * @NUM_IWL_UCODE_TLV_API: number of bits used 279 286 */ ··· 307 300 IWL_UCODE_TLV_API_REDUCE_TX_POWER = (__force iwl_ucode_tlv_api_t)45, 308 301 IWL_UCODE_TLV_API_SHORT_BEACON_NOTIF = (__force iwl_ucode_tlv_api_t)46, 309 302 IWL_UCODE_TLV_API_BEACON_FILTER_V4 = (__force iwl_ucode_tlv_api_t)47, 303 + IWL_UCODE_TLV_API_REGULATORY_NVM_INFO = (__force iwl_ucode_tlv_api_t)48, 310 304 IWL_UCODE_TLV_API_FTM_NEW_RANGE_REQ = (__force iwl_ucode_tlv_api_t)49, 305 + IWL_UCODE_TLV_API_SCAN_OFFLOAD_CHANS = (__force iwl_ucode_tlv_api_t)50, 306 + IWL_UCODE_TLV_API_MBSSID_HE = (__force iwl_ucode_tlv_api_t)52, 311 307 312 308 NUM_IWL_UCODE_TLV_API 313 309 #ifdef __CHECKER__ ··· 360 350 * IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD: firmware supports CSA command 361 351 * @IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS: firmware supports ultra high band 362 352 * (6 GHz). 353 + * @IWL_UCODE_TLV_CAPA_CS_MODIFY: firmware supports modify action CSA command 363 354 * @IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE: extended DTS measurement 364 355 * @IWL_UCODE_TLV_CAPA_SHORT_PM_TIMEOUTS: supports short PM timeouts 365 356 * @IWL_UCODE_TLV_CAPA_BT_MPLUT_SUPPORT: supports bt-coex Multi-priority LUT ··· 431 420 IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD = (__force iwl_ucode_tlv_capa_t)46, 432 421 IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS = (__force iwl_ucode_tlv_capa_t)48, 433 422 IWL_UCODE_TLV_CAPA_FTM_CALIBRATED = (__force iwl_ucode_tlv_capa_t)47, 423 + IWL_UCODE_TLV_CAPA_CS_MODIFY = (__force iwl_ucode_tlv_capa_t)49, 434 424 435 425 /* set 2 */ 436 426 IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE = (__force iwl_ucode_tlv_capa_t)64,
+1
drivers/net/wireless/intel/iwlwifi/fw/runtime.h
··· 145 145 u32 lmac_err_id[MAX_NUM_LMAC]; 146 146 u32 umac_err_id; 147 147 void *fifo_iter; 148 + enum iwl_fw_ini_trigger_id ini_trig_id; 148 149 } dump; 149 150 #ifdef CONFIG_IWLWIFI_DEBUGFS 150 151 struct {
+12 -1
drivers/net/wireless/intel/iwlwifi/iwl-config.h
··· 383 383 * @bisr_workaround: BISR hardware workaround (for 22260 series devices) 384 384 * @min_txq_size: minimum number of slots required in a TX queue 385 385 * @umac_prph_offset: offset to add to UMAC periphery address 386 + * @uhb_supported: ultra high band channels supported 387 + * @min_256_ba_txq_size: minimum number of slots required in a TX queue which 388 + * supports 256 BA aggregation 386 389 * 387 390 * We enable the driver to be backward compatible wrt. hardware features. 388 391 * API differences in uCode shouldn't be handled here but through TLVs ··· 436 433 gen2:1, 437 434 cdb:1, 438 435 dbgc_supported:1, 439 - bisr_workaround:1; 436 + bisr_workaround:1, 437 + uhb_supported:1; 440 438 u8 valid_tx_ant; 441 439 u8 valid_rx_ant; 442 440 u8 non_shared_ant; ··· 454 450 u32 d3_debug_data_length; 455 451 u32 min_txq_size; 456 452 u32 umac_prph_offset; 453 + u32 fw_mon_smem_write_ptr_addr; 454 + u32 fw_mon_smem_write_ptr_msk; 455 + u32 fw_mon_smem_cycle_cnt_ptr_addr; 456 + u32 fw_mon_smem_cycle_cnt_ptr_msk; 457 + u32 gp2_reg_addr; 458 + u32 min_256_ba_txq_size; 457 459 }; 458 460 459 461 extern const struct iwl_csr_params iwl_csr_v1; ··· 583 573 extern const struct iwl_cfg iwlax210_2ax_cfg_so_hr_a0; 584 574 extern const struct iwl_cfg iwlax210_2ax_cfg_so_gf_a0; 585 575 extern const struct iwl_cfg iwlax210_2ax_cfg_ty_gf_a0; 576 + extern const struct iwl_cfg iwlax210_2ax_cfg_so_gf4_a0; 586 577 #endif /* CPTCFG_IWLMVM || CPTCFG_IWLFMAC */ 587 578 588 579 #endif /* __IWL_CONFIG_H__ */
+3 -2
drivers/net/wireless/intel/iwlwifi/iwl-csr.h
··· 8 8 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2016 Intel Deutschland GmbH 11 - * Copyright(c) 2018 Intel Corporation 11 + * Copyright(c) 2018 - 2019 Intel Corporation 12 12 * 13 13 * This program is free software; you can redistribute it and/or modify 14 14 * it under the terms of version 2 of the GNU General Public License as ··· 30 30 * 31 31 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. 32 32 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 33 - * Copyright(c) 2018 Intel Corporation 33 + * Copyright(c) 2018 - 2019 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 337 337 #define CSR_HW_RF_ID_TYPE_HR (0x0010A000) 338 338 #define CSR_HW_RF_ID_TYPE_HRCDB (0x00109F00) 339 339 #define CSR_HW_RF_ID_TYPE_GF (0x0010D000) 340 + #define CSR_HW_RF_ID_TYPE_GF4 (0x0010E000) 340 341 341 342 /* HW_RF CHIP ID */ 342 343 #define CSR_HW_RF_ID_TYPE_CHIP_ID(_val) (((_val) >> 12) & 0xFFF)
+8 -2
drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c
··· 5 5 * 6 6 * GPL LICENSE SUMMARY 7 7 * 8 - * Copyright (C) 2018 Intel Corporation 8 + * Copyright (C) 2018 - 2019 Intel Corporation 9 9 * 10 10 * This program is free software; you can redistribute it and/or modify 11 11 * it under the terms of version 2 of the GNU General Public License as ··· 28 28 * 29 29 * BSD LICENSE 30 30 * 31 - * Copyright (C) 2018 Intel Corporation 31 + * Copyright (C) 2018 - 2019 Intel Corporation 32 32 * All rights reserved. 33 33 * 34 34 * Redistribution and use in source and binary forms, with or without ··· 72 72 73 73 int copy_size = le32_to_cpu(tlv->length) + sizeof(*tlv); 74 74 int offset_size = copy_size; 75 + 76 + if (le32_to_cpu(header->tlv_version) != 1) 77 + return; 75 78 76 79 if (WARN_ONCE(apply_point >= IWL_FW_INI_APPLY_NUM, 77 80 "Invalid apply point id %d\n", apply_point)) ··· 134 131 135 132 hdr = (void *)&tlv->data[0]; 136 133 apply = le32_to_cpu(hdr->apply_point); 134 + 135 + if (le32_to_cpu(hdr->tlv_version) != 1) 136 + continue; 137 137 138 138 IWL_DEBUG_FW(trans, "Read TLV %x, apply point %d\n", 139 139 le32_to_cpu(tlv->type), apply);
+82 -62
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
··· 130 130 /* 131 131 * These are the channel numbers in the order that they are stored in the NVM 132 132 */ 133 - static const u8 iwl_nvm_channels[] = { 133 + static const u16 iwl_nvm_channels[] = { 134 134 /* 2.4 GHz */ 135 135 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 136 136 /* 5 GHz */ ··· 139 139 149, 153, 157, 161, 165 140 140 }; 141 141 142 - static const u8 iwl_ext_nvm_channels[] = { 142 + static const u16 iwl_ext_nvm_channels[] = { 143 143 /* 2.4 GHz */ 144 144 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 145 145 /* 5 GHz */ ··· 148 148 149, 153, 157, 161, 165, 169, 173, 177, 181 149 149 }; 150 150 151 + static const u16 iwl_uhb_nvm_channels[] = { 152 + /* 2.4 GHz */ 153 + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 154 + /* 5 GHz */ 155 + 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 156 + 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 157 + 149, 153, 157, 161, 165, 169, 173, 177, 181, 158 + /* 6-7 GHz */ 159 + 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 233, 237, 241, 160 + 245, 249, 253, 257, 261, 265, 269, 273, 277, 281, 285, 289, 293, 297, 161 + 301, 305, 309, 313, 317, 321, 325, 329, 333, 337, 341, 345, 349, 353, 162 + 357, 361, 365, 369, 373, 377, 381, 385, 389, 393, 397, 401, 405, 409, 163 + 413, 417, 421 164 + }; 165 + 151 166 #define IWL_NVM_NUM_CHANNELS ARRAY_SIZE(iwl_nvm_channels) 152 167 #define IWL_NVM_NUM_CHANNELS_EXT ARRAY_SIZE(iwl_ext_nvm_channels) 168 + #define IWL_NVM_NUM_CHANNELS_UHB ARRAY_SIZE(iwl_uhb_nvm_channels) 153 169 #define NUM_2GHZ_CHANNELS 14 154 - #define NUM_2GHZ_CHANNELS_EXT 14 155 170 #define FIRST_2GHZ_HT_MINUS 5 156 171 #define LAST_2GHZ_HT_PLUS 9 157 - #define LAST_5GHZ_HT 165 158 - #define LAST_5GHZ_HT_FAMILY_8000 181 159 172 #define N_HW_ADDR_MASK 0xF 160 173 161 174 /* rate data (static) */ ··· 226 213 }; 227 214 228 215 static inline void iwl_nvm_print_channel_flags(struct device *dev, u32 level, 229 - int chan, u16 flags) 216 + int chan, u32 flags) 230 217 { 231 218 #define CHECK_AND_PRINT_I(x) \ 232 219 ((flags & NVM_CHANNEL_##x) ? " " #x : "") ··· 257 244 } 258 245 259 246 static u32 iwl_get_channel_flags(u8 ch_num, int ch_idx, bool is_5ghz, 260 - u16 nvm_flags, const struct iwl_cfg *cfg) 247 + u32 nvm_flags, const struct iwl_cfg *cfg) 261 248 { 262 249 u32 flags = IEEE80211_CHAN_NO_HT40; 263 - u32 last_5ghz_ht = LAST_5GHZ_HT; 264 - 265 - if (cfg->nvm_type == IWL_NVM_EXT) 266 - last_5ghz_ht = LAST_5GHZ_HT_FAMILY_8000; 267 250 268 251 if (!is_5ghz && (nvm_flags & NVM_CHANNEL_40MHZ)) { 269 252 if (ch_num <= LAST_2GHZ_HT_PLUS) 270 253 flags &= ~IEEE80211_CHAN_NO_HT40PLUS; 271 254 if (ch_num >= FIRST_2GHZ_HT_MINUS) 272 255 flags &= ~IEEE80211_CHAN_NO_HT40MINUS; 273 - } else if (ch_num <= last_5ghz_ht && (nvm_flags & NVM_CHANNEL_40MHZ)) { 256 + } else if (nvm_flags & NVM_CHANNEL_40MHZ) { 274 257 if ((ch_idx - NUM_2GHZ_CHANNELS) % 2 == 0) 275 258 flags &= ~IEEE80211_CHAN_NO_HT40PLUS; 276 259 else ··· 301 292 302 293 static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg, 303 294 struct iwl_nvm_data *data, 304 - const __le16 * const nvm_ch_flags, 305 - u32 sbands_flags) 295 + const void * const nvm_ch_flags, 296 + u32 sbands_flags, bool v4) 306 297 { 307 298 int ch_idx; 308 299 int n_channels = 0; 309 300 struct ieee80211_channel *channel; 310 - u16 ch_flags; 311 - int num_of_ch, num_2ghz_channels; 312 - const u8 *nvm_chan; 301 + u32 ch_flags; 302 + int num_of_ch, num_2ghz_channels = NUM_2GHZ_CHANNELS; 303 + const u16 *nvm_chan; 313 304 314 - if (cfg->nvm_type != IWL_NVM_EXT) { 315 - num_of_ch = IWL_NVM_NUM_CHANNELS; 316 - nvm_chan = &iwl_nvm_channels[0]; 317 - num_2ghz_channels = NUM_2GHZ_CHANNELS; 318 - } else { 305 + if (cfg->uhb_supported) { 306 + num_of_ch = IWL_NVM_NUM_CHANNELS_UHB; 307 + nvm_chan = iwl_uhb_nvm_channels; 308 + } else if (cfg->nvm_type == IWL_NVM_EXT) { 319 309 num_of_ch = IWL_NVM_NUM_CHANNELS_EXT; 320 - nvm_chan = &iwl_ext_nvm_channels[0]; 321 - num_2ghz_channels = NUM_2GHZ_CHANNELS_EXT; 310 + nvm_chan = iwl_ext_nvm_channels; 311 + } else { 312 + num_of_ch = IWL_NVM_NUM_CHANNELS; 313 + nvm_chan = iwl_nvm_channels; 322 314 } 323 315 324 316 for (ch_idx = 0; ch_idx < num_of_ch; ch_idx++) { 325 317 bool is_5ghz = (ch_idx >= num_2ghz_channels); 326 318 327 - ch_flags = __le16_to_cpup(nvm_ch_flags + ch_idx); 319 + if (v4) 320 + ch_flags = 321 + __le32_to_cpup((__le32 *)nvm_ch_flags + ch_idx); 322 + else 323 + ch_flags = 324 + __le16_to_cpup((__le16 *)nvm_ch_flags + ch_idx); 328 325 329 326 if (is_5ghz && !data->sku_cap_band_52ghz_enable) 330 327 continue; ··· 651 636 static void iwl_init_he_hw_capab(struct ieee80211_supported_band *sband, 652 637 u8 tx_chains, u8 rx_chains) 653 638 { 654 - if (sband->band == NL80211_BAND_2GHZ || 655 - sband->band == NL80211_BAND_5GHZ) 656 - sband->iftype_data = iwl_he_capa; 657 - else 658 - return; 659 - 639 + sband->iftype_data = iwl_he_capa; 660 640 sband->n_iftype_data = ARRAY_SIZE(iwl_he_capa); 661 641 662 642 /* If not 2x2, we need to indicate 1x1 in the Midamble RX Max NSTS */ ··· 671 661 672 662 static void iwl_init_sbands(struct device *dev, const struct iwl_cfg *cfg, 673 663 struct iwl_nvm_data *data, 674 - const __le16 *nvm_ch_flags, u8 tx_chains, 675 - u8 rx_chains, u32 sbands_flags) 664 + const void *nvm_ch_flags, u8 tx_chains, 665 + u8 rx_chains, u32 sbands_flags, bool v4) 676 666 { 677 667 int n_channels; 678 668 int n_used = 0; 679 669 struct ieee80211_supported_band *sband; 680 670 681 671 n_channels = iwl_init_channel_map(dev, cfg, data, nvm_ch_flags, 682 - sbands_flags); 672 + sbands_flags, v4); 683 673 sband = &data->bands[NL80211_BAND_2GHZ]; 684 674 sband->band = NL80211_BAND_2GHZ; 685 675 sband->bitrates = &iwl_cfg80211_rates[RATES_24_OFFS]; ··· 1016 1006 sbands_flags |= IWL_NVM_SBANDS_FLAGS_NO_WIDE_IN_5GHZ; 1017 1007 1018 1008 iwl_init_sbands(dev, cfg, data, ch_section, tx_chains, rx_chains, 1019 - sbands_flags); 1009 + sbands_flags, false); 1020 1010 data->calib_version = 255; 1021 1011 1022 1012 return data; 1023 1013 } 1024 1014 IWL_EXPORT_SYMBOL(iwl_parse_nvm_data); 1025 1015 1026 - static u32 iwl_nvm_get_regdom_bw_flags(const u8 *nvm_chan, 1016 + static u32 iwl_nvm_get_regdom_bw_flags(const u16 *nvm_chan, 1027 1017 int ch_idx, u16 nvm_flags, 1028 1018 const struct iwl_cfg *cfg) 1029 1019 { 1030 1020 u32 flags = NL80211_RRF_NO_HT40; 1031 - u32 last_5ghz_ht = LAST_5GHZ_HT; 1032 - 1033 - if (cfg->nvm_type == IWL_NVM_EXT) 1034 - last_5ghz_ht = LAST_5GHZ_HT_FAMILY_8000; 1035 1021 1036 1022 if (ch_idx < NUM_2GHZ_CHANNELS && 1037 1023 (nvm_flags & NVM_CHANNEL_40MHZ)) { ··· 1035 1029 flags &= ~NL80211_RRF_NO_HT40PLUS; 1036 1030 if (nvm_chan[ch_idx] >= FIRST_2GHZ_HT_MINUS) 1037 1031 flags &= ~NL80211_RRF_NO_HT40MINUS; 1038 - } else if (nvm_chan[ch_idx] <= last_5ghz_ht && 1039 - (nvm_flags & NVM_CHANNEL_40MHZ)) { 1032 + } else if (nvm_flags & NVM_CHANNEL_40MHZ) { 1040 1033 if ((ch_idx - NUM_2GHZ_CHANNELS) % 2 == 0) 1041 1034 flags &= ~NL80211_RRF_NO_HT40PLUS; 1042 1035 else ··· 1079 1074 int ch_idx; 1080 1075 u16 ch_flags; 1081 1076 u32 reg_rule_flags, prev_reg_rule_flags = 0; 1082 - const u8 *nvm_chan = cfg->nvm_type == IWL_NVM_EXT ? 1083 - iwl_ext_nvm_channels : iwl_nvm_channels; 1077 + const u16 *nvm_chan; 1084 1078 struct ieee80211_regdomain *regd, *copy_rd; 1085 - int size_of_regd, regd_to_copy; 1086 1079 struct ieee80211_reg_rule *rule; 1087 1080 struct regdb_ptrs *regdb_ptrs; 1088 1081 enum nl80211_band band; 1089 1082 int center_freq, prev_center_freq = 0; 1090 1083 int valid_rules = 0; 1091 1084 bool new_rule; 1092 - int max_num_ch = cfg->nvm_type == IWL_NVM_EXT ? 1093 - IWL_NVM_NUM_CHANNELS_EXT : IWL_NVM_NUM_CHANNELS; 1085 + int max_num_ch; 1086 + 1087 + if (cfg->uhb_supported) { 1088 + max_num_ch = IWL_NVM_NUM_CHANNELS_UHB; 1089 + nvm_chan = iwl_uhb_nvm_channels; 1090 + } else if (cfg->nvm_type == IWL_NVM_EXT) { 1091 + max_num_ch = IWL_NVM_NUM_CHANNELS_EXT; 1092 + nvm_chan = iwl_ext_nvm_channels; 1093 + } else { 1094 + max_num_ch = IWL_NVM_NUM_CHANNELS; 1095 + nvm_chan = iwl_nvm_channels; 1096 + } 1094 1097 1095 1098 if (WARN_ON(num_of_ch > max_num_ch)) 1096 1099 num_of_ch = max_num_ch; ··· 1110 1097 num_of_ch); 1111 1098 1112 1099 /* build a regdomain rule for every valid channel */ 1113 - size_of_regd = 1114 - sizeof(struct ieee80211_regdomain) + 1115 - num_of_ch * sizeof(struct ieee80211_reg_rule); 1116 - 1117 - regd = kzalloc(size_of_regd, GFP_KERNEL); 1100 + regd = kzalloc(struct_size(regd, reg_rules, num_of_ch), GFP_KERNEL); 1118 1101 if (!regd) 1119 1102 return ERR_PTR(-ENOMEM); 1120 1103 ··· 1186 1177 * Narrow down regdom for unused regulatory rules to prevent hole 1187 1178 * between reg rules to wmm rules. 1188 1179 */ 1189 - regd_to_copy = sizeof(struct ieee80211_regdomain) + 1190 - valid_rules * sizeof(struct ieee80211_reg_rule); 1191 - 1192 - copy_rd = kmemdup(regd, regd_to_copy, GFP_KERNEL); 1193 - if (!copy_rd) { 1180 + copy_rd = kmemdup(regd, struct_size(regd, reg_rules, valid_rules), 1181 + GFP_KERNEL); 1182 + if (!copy_rd) 1194 1183 copy_rd = ERR_PTR(-ENOMEM); 1195 - goto out; 1196 - } 1197 1184 1198 1185 out: 1199 1186 kfree(regdb_ptrs); ··· 1398 1393 const struct iwl_fw *fw) 1399 1394 { 1400 1395 struct iwl_nvm_get_info cmd = {}; 1401 - struct iwl_nvm_get_info_rsp *rsp; 1402 1396 struct iwl_nvm_data *nvm; 1403 1397 struct iwl_host_cmd hcmd = { 1404 1398 .flags = CMD_WANT_SKB | CMD_SEND_IN_RFKILL, ··· 1412 1408 bool empty_otp; 1413 1409 u32 mac_flags; 1414 1410 u32 sbands_flags = 0; 1411 + /* 1412 + * All the values in iwl_nvm_get_info_rsp v4 are the same as 1413 + * in v3, except for the channel profile part of the 1414 + * regulatory. So we can just access the new struct, with the 1415 + * exception of the latter. 1416 + */ 1417 + struct iwl_nvm_get_info_rsp *rsp; 1418 + struct iwl_nvm_get_info_rsp_v3 *rsp_v3; 1419 + bool v4 = fw_has_api(&fw->ucode_capa, 1420 + IWL_UCODE_TLV_API_REGULATORY_NVM_INFO); 1421 + size_t rsp_size = v4 ? sizeof(*rsp) : sizeof(*rsp_v3); 1422 + void *channel_profile; 1415 1423 1416 1424 ret = iwl_trans_send_cmd(trans, &hcmd); 1417 1425 if (ret) 1418 1426 return ERR_PTR(ret); 1419 1427 1420 - if (WARN(iwl_rx_packet_payload_len(hcmd.resp_pkt) != sizeof(*rsp), 1428 + if (WARN(iwl_rx_packet_payload_len(hcmd.resp_pkt) != rsp_size, 1421 1429 "Invalid payload len in NVM response from FW %d", 1422 1430 iwl_rx_packet_payload_len(hcmd.resp_pkt))) { 1423 1431 ret = -EINVAL; ··· 1491 1475 sbands_flags |= IWL_NVM_SBANDS_FLAGS_LAR; 1492 1476 } 1493 1477 1478 + rsp_v3 = (void *)rsp; 1479 + channel_profile = v4 ? (void *)rsp->regulatory.channel_profile : 1480 + (void *)rsp_v3->regulatory.channel_profile; 1481 + 1494 1482 iwl_init_sbands(trans->dev, trans->cfg, nvm, 1495 1483 rsp->regulatory.channel_profile, 1496 1484 nvm->valid_tx_ant & fw->valid_tx_ant, 1497 1485 nvm->valid_rx_ant & fw->valid_rx_ant, 1498 - sbands_flags); 1486 + sbands_flags, v4); 1499 1487 1500 1488 iwl_free_resp(&hcmd); 1501 1489 return nvm;
+6
drivers/net/wireless/intel/iwlwifi/iwl-prph.h
··· 368 368 #define MON_BUFF_WRPTR_VER2 (0xa03c24) 369 369 #define MON_BUFF_CYCLE_CNT_VER2 (0xa03c28) 370 370 #define MON_BUFF_SHIFT_VER2 (0x8) 371 + /* FW monitor familiy AX210 and on */ 372 + #define DBGC_CUR_DBGBUF_BASE_ADDR_LSB (0xd03c20) 373 + #define DBGC_CUR_DBGBUF_BASE_ADDR_MSB (0xd03c24) 374 + #define DBGC_CUR_DBGBUF_STATUS (0xd03c1c) 375 + #define DBGC_DBGBUF_WRAP_AROUND (0xd03c2c) 376 + #define DBGC_CUR_DBGBUF_STATUS_OFFSET_MSK (0x00ffffff) 371 377 372 378 #define MON_DMARB_RD_CTL_ADDR (0xa03c60) 373 379 #define MON_DMARB_RD_DATA_ADDR (0xa03c5c)
+2 -1
drivers/net/wireless/intel/iwlwifi/iwl-trans.h
··· 274 274 bool _page_stolen; 275 275 u32 _rx_page_order; 276 276 unsigned int truesize; 277 - u8 status; 278 277 }; 279 278 280 279 static inline void *rxb_addr(struct iwl_rx_cmd_buffer *r) ··· 767 768 * @umac_error_event_table: addr of umac error table 768 769 * @error_event_table_tlv_status: bitmap that indicates what error table 769 770 * pointers was recevied via TLV. use enum &iwl_error_event_table_status 771 + * @hw_error: equals true if hw error interrupt was received from the FW 770 772 */ 771 773 struct iwl_trans { 772 774 const struct iwl_trans_ops *ops; ··· 830 830 u32 lmac_error_event_table[2]; 831 831 u32 umac_error_event_table; 832 832 unsigned int error_event_table_tlv_status; 833 + bool hw_error; 833 834 834 835 /* pointer to trans specific struct */ 835 836 /*Ensure that this pointer will always be aligned to sizeof pointer */
+74 -16
drivers/net/wireless/intel/iwlwifi/mvm/d3.c
··· 8 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 Intel Corporation 11 + * Copyright(c) 2018 - 2019 Intel Corporation 12 12 * 13 13 * This program is free software; you can redistribute it and/or modify 14 14 * it under the terms of version 2 of the GNU General Public License as ··· 31 31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 32 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 33 33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 34 - * Copyright(c) 2018 Intel Corporation 34 + * Copyright(c) 2018 - 2019 Intel Corporation 35 35 * All rights reserved. 36 36 * 37 37 * Redistribution and use in source and binary forms, with or without ··· 1728 1728 iwl_mvm_iter_d0i3_ap_keys(mvm, vif, iwl_mvm_d3_update_keys, &gtkdata); 1729 1729 } 1730 1730 1731 + #define ND_QUERY_BUF_LEN (sizeof(struct iwl_scan_offload_profile_match) * \ 1732 + IWL_SCAN_MAX_PROFILES) 1733 + 1731 1734 struct iwl_mvm_nd_query_results { 1732 1735 u32 matched_profiles; 1733 - struct iwl_scan_offload_profile_match matches[IWL_SCAN_MAX_PROFILES]; 1736 + u8 matches[ND_QUERY_BUF_LEN]; 1734 1737 }; 1735 1738 1736 1739 static int ··· 1746 1743 .flags = CMD_WANT_SKB, 1747 1744 }; 1748 1745 int ret, len; 1746 + size_t query_len, matches_len; 1749 1747 1750 1748 ret = iwl_mvm_send_cmd(mvm, &cmd); 1751 1749 if (ret) { ··· 1754 1750 return ret; 1755 1751 } 1756 1752 1753 + if (fw_has_api(&mvm->fw->ucode_capa, 1754 + IWL_UCODE_TLV_API_SCAN_OFFLOAD_CHANS)) { 1755 + query_len = sizeof(struct iwl_scan_offload_profiles_query); 1756 + matches_len = sizeof(struct iwl_scan_offload_profile_match) * 1757 + IWL_SCAN_MAX_PROFILES; 1758 + } else { 1759 + query_len = sizeof(struct iwl_scan_offload_profiles_query_v1); 1760 + matches_len = sizeof(struct iwl_scan_offload_profile_match_v1) * 1761 + IWL_SCAN_MAX_PROFILES; 1762 + } 1763 + 1757 1764 len = iwl_rx_packet_payload_len(cmd.resp_pkt); 1758 - if (len < sizeof(*query)) { 1765 + if (len < query_len) { 1759 1766 IWL_ERR(mvm, "Invalid scan offload profiles query response!\n"); 1760 1767 ret = -EIO; 1761 1768 goto out_free_resp; ··· 1775 1760 query = (void *)cmd.resp_pkt->data; 1776 1761 1777 1762 results->matched_profiles = le32_to_cpu(query->matched_profiles); 1778 - memcpy(results->matches, query->matches, sizeof(results->matches)); 1763 + memcpy(results->matches, query->matches, matches_len); 1779 1764 1780 1765 #ifdef CONFIG_IWLWIFI_DEBUGFS 1781 1766 mvm->last_netdetect_scans = le32_to_cpu(query->n_scans_done); ··· 1784 1769 out_free_resp: 1785 1770 iwl_free_resp(&cmd); 1786 1771 return ret; 1772 + } 1773 + 1774 + static int iwl_mvm_query_num_match_chans(struct iwl_mvm *mvm, 1775 + struct iwl_mvm_nd_query_results *query, 1776 + int idx) 1777 + { 1778 + int n_chans = 0, i; 1779 + 1780 + if (fw_has_api(&mvm->fw->ucode_capa, 1781 + IWL_UCODE_TLV_API_SCAN_OFFLOAD_CHANS)) { 1782 + struct iwl_scan_offload_profile_match *matches = 1783 + (struct iwl_scan_offload_profile_match *)query->matches; 1784 + 1785 + for (i = 0; i < SCAN_OFFLOAD_MATCHING_CHANNELS_LEN; i++) 1786 + n_chans += hweight8(matches[idx].matching_channels[i]); 1787 + } else { 1788 + struct iwl_scan_offload_profile_match_v1 *matches = 1789 + (struct iwl_scan_offload_profile_match_v1 *)query->matches; 1790 + 1791 + for (i = 0; i < SCAN_OFFLOAD_MATCHING_CHANNELS_LEN_V1; i++) 1792 + n_chans += hweight8(matches[idx].matching_channels[i]); 1793 + } 1794 + 1795 + return n_chans; 1796 + } 1797 + 1798 + static void iwl_mvm_query_set_freqs(struct iwl_mvm *mvm, 1799 + struct iwl_mvm_nd_query_results *query, 1800 + struct cfg80211_wowlan_nd_match *match, 1801 + int idx) 1802 + { 1803 + int i; 1804 + 1805 + if (fw_has_api(&mvm->fw->ucode_capa, 1806 + IWL_UCODE_TLV_API_SCAN_OFFLOAD_CHANS)) { 1807 + struct iwl_scan_offload_profile_match *matches = 1808 + (struct iwl_scan_offload_profile_match *)query->matches; 1809 + 1810 + for (i = 0; i < SCAN_OFFLOAD_MATCHING_CHANNELS_LEN * 8; i++) 1811 + if (matches[idx].matching_channels[i / 8] & (BIT(i % 8))) 1812 + match->channels[match->n_channels++] = 1813 + mvm->nd_channels[i]->center_freq; 1814 + } else { 1815 + struct iwl_scan_offload_profile_match_v1 *matches = 1816 + (struct iwl_scan_offload_profile_match_v1 *)query->matches; 1817 + 1818 + for (i = 0; i < SCAN_OFFLOAD_MATCHING_CHANNELS_LEN_V1 * 8; i++) 1819 + if (matches[idx].matching_channels[i / 8] & (BIT(i % 8))) 1820 + match->channels[match->n_channels++] = 1821 + mvm->nd_channels[i]->center_freq; 1822 + } 1787 1823 } 1788 1824 1789 1825 static void iwl_mvm_query_netdetect_reasons(struct iwl_mvm *mvm, ··· 1849 1783 struct iwl_wowlan_status *fw_status; 1850 1784 unsigned long matched_profiles; 1851 1785 u32 reasons = 0; 1852 - int i, j, n_matches, ret; 1786 + int i, n_matches, ret; 1853 1787 1854 1788 fw_status = iwl_mvm_get_wakeup_status(mvm); 1855 1789 if (!IS_ERR_OR_NULL(fw_status)) { ··· 1883 1817 goto out_report_nd; 1884 1818 1885 1819 for_each_set_bit(i, &matched_profiles, mvm->n_nd_match_sets) { 1886 - struct iwl_scan_offload_profile_match *fw_match; 1887 1820 struct cfg80211_wowlan_nd_match *match; 1888 1821 int idx, n_channels = 0; 1889 1822 1890 - fw_match = &query.matches[i]; 1891 - 1892 - for (j = 0; j < SCAN_OFFLOAD_MATCHING_CHANNELS_LEN; j++) 1893 - n_channels += hweight8(fw_match->matching_channels[j]); 1823 + n_channels = iwl_mvm_query_num_match_chans(mvm, &query, i); 1894 1824 1895 1825 match = kzalloc(struct_size(match, channels, n_channels), 1896 1826 GFP_KERNEL); ··· 1906 1844 if (mvm->n_nd_channels < n_channels) 1907 1845 continue; 1908 1846 1909 - for (j = 0; j < SCAN_OFFLOAD_MATCHING_CHANNELS_LEN * 8; j++) 1910 - if (fw_match->matching_channels[j / 8] & (BIT(j % 8))) 1911 - match->channels[match->n_channels++] = 1912 - mvm->nd_channels[j]->center_freq; 1847 + iwl_mvm_query_set_freqs(mvm, &query, match, i); 1913 1848 } 1914 1849 1915 1850 out_report_nd: ··· 2089 2030 * 2. We are using a unified image but had an error while exiting D3 2090 2031 */ 2091 2032 set_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status); 2092 - set_bit(IWL_MVM_STATUS_D3_RECONFIG, &mvm->status); 2093 2033 /* 2094 2034 * When switching images we return 1, which causes mac80211 2095 2035 * to do a reconfig with IEEE80211_RECONFIG_TYPE_RESTART.
+2 -15
drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
··· 743 743 #define MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz) \ 744 744 _MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz, struct ieee80211_vif) 745 745 #define MVM_DEBUGFS_ADD_FILE_VIF(name, parent, mode) do { \ 746 - if (!debugfs_create_file(#name, mode, parent, vif, \ 747 - &iwl_dbgfs_##name##_ops)) \ 748 - goto err; \ 746 + debugfs_create_file(#name, mode, parent, vif, \ 747 + &iwl_dbgfs_##name##_ops); \ 749 748 } while (0) 750 749 751 750 MVM_DEBUGFS_READ_FILE_OPS(mac_params); ··· 773 774 return; 774 775 775 776 mvmvif->dbgfs_dir = debugfs_create_dir("iwlmvm", dbgfs_dir); 776 - 777 - if (!mvmvif->dbgfs_dir) { 778 - IWL_ERR(mvm, "Failed to create debugfs directory under %pd\n", 779 - dbgfs_dir); 780 - return; 781 - } 782 777 783 778 if (iwlmvm_mod_params.power_scheme != IWL_POWER_SCHEME_CAM && 784 779 ((vif->type == NL80211_IFTYPE_STATION && !vif->p2p) || ··· 805 812 806 813 mvmvif->dbgfs_slink = debugfs_create_symlink(dbgfs_dir->d_name.name, 807 814 mvm->debugfs_dir, buf); 808 - if (!mvmvif->dbgfs_slink) 809 - IWL_ERR(mvm, "Can't create debugfs symbolic link under %pd\n", 810 - dbgfs_dir); 811 - return; 812 - err: 813 - IWL_ERR(mvm, "Can't create debugfs entity\n"); 814 815 } 815 816 816 817 void iwl_mvm_vif_dbgfs_clean(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
+31 -60
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
··· 1349 1349 return 0; 1350 1350 1351 1351 iwl_fw_dbg_collect(&mvm->fwrt, FW_DBG_TRIGGER_USER, buf, 1352 - (count - 1)); 1352 + (count - 1), NULL); 1353 1353 1354 1354 iwl_mvm_unref(mvm, IWL_MVM_REF_PRPH_WRITE); 1355 1355 ··· 1696 1696 #define MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz) \ 1697 1697 _MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz, struct iwl_mvm) 1698 1698 #define MVM_DEBUGFS_ADD_FILE_ALIAS(alias, name, parent, mode) do { \ 1699 - if (!debugfs_create_file(alias, mode, parent, mvm, \ 1700 - &iwl_dbgfs_##name##_ops)) \ 1701 - goto err; \ 1699 + debugfs_create_file(alias, mode, parent, mvm, \ 1700 + &iwl_dbgfs_##name##_ops); \ 1702 1701 } while (0) 1703 1702 #define MVM_DEBUGFS_ADD_FILE(name, parent, mode) \ 1704 1703 MVM_DEBUGFS_ADD_FILE_ALIAS(#name, name, parent, mode) ··· 1708 1709 _MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz, struct ieee80211_sta) 1709 1710 1710 1711 #define MVM_DEBUGFS_ADD_STA_FILE_ALIAS(alias, name, parent, mode) do { \ 1711 - if (!debugfs_create_file(alias, mode, parent, sta, \ 1712 - &iwl_dbgfs_##name##_ops)) \ 1713 - goto err; \ 1712 + debugfs_create_file(alias, mode, parent, sta, \ 1713 + &iwl_dbgfs_##name##_ops); \ 1714 1714 } while (0) 1715 1715 #define MVM_DEBUGFS_ADD_STA_FILE(name, parent, mode) \ 1716 1716 MVM_DEBUGFS_ADD_STA_FILE_ALIAS(#name, name, parent, mode) ··· 2090 2092 2091 2093 if (iwl_mvm_has_tlc_offload(mvm)) 2092 2094 MVM_DEBUGFS_ADD_STA_FILE(rs_data, dir, 0400); 2093 - 2094 - return; 2095 - err: 2096 - IWL_ERR(mvm, "Can't create the mvm station debugfs entry\n"); 2097 2095 } 2098 2096 2099 - int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir) 2097 + void iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir) 2100 2098 { 2101 2099 struct dentry *bcast_dir __maybe_unused; 2102 2100 char buf[100]; ··· 2136 2142 #endif 2137 2143 MVM_DEBUGFS_ADD_FILE(he_sniffer_params, mvm->debugfs_dir, 0600); 2138 2144 2139 - if (!debugfs_create_bool("enable_scan_iteration_notif", 2140 - 0600, 2141 - mvm->debugfs_dir, 2142 - &mvm->scan_iter_notif_enabled)) 2143 - goto err; 2144 - if (!debugfs_create_bool("drop_bcn_ap_mode", 0600, 2145 - mvm->debugfs_dir, &mvm->drop_bcn_ap_mode)) 2146 - goto err; 2145 + debugfs_create_bool("enable_scan_iteration_notif", 0600, 2146 + mvm->debugfs_dir, &mvm->scan_iter_notif_enabled); 2147 + debugfs_create_bool("drop_bcn_ap_mode", 0600, mvm->debugfs_dir, 2148 + &mvm->drop_bcn_ap_mode); 2147 2149 2148 2150 MVM_DEBUGFS_ADD_FILE(uapsd_noagg_bssids, mvm->debugfs_dir, S_IRUSR); 2149 2151 ··· 2147 2157 if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BCAST_FILTERING) { 2148 2158 bcast_dir = debugfs_create_dir("bcast_filtering", 2149 2159 mvm->debugfs_dir); 2150 - if (!bcast_dir) 2151 - goto err; 2152 2160 2153 - if (!debugfs_create_bool("override", 0600, 2154 - bcast_dir, 2155 - &mvm->dbgfs_bcast_filtering.override)) 2156 - goto err; 2161 + debugfs_create_bool("override", 0600, bcast_dir, 2162 + &mvm->dbgfs_bcast_filtering.override); 2157 2163 2158 2164 MVM_DEBUGFS_ADD_FILE_ALIAS("filters", bcast_filters, 2159 2165 bcast_dir, 0600); ··· 2161 2175 #ifdef CONFIG_PM_SLEEP 2162 2176 MVM_DEBUGFS_ADD_FILE(d3_sram, mvm->debugfs_dir, 0600); 2163 2177 MVM_DEBUGFS_ADD_FILE(d3_test, mvm->debugfs_dir, 0400); 2164 - if (!debugfs_create_bool("d3_wake_sysassert", 0600, 2165 - mvm->debugfs_dir, &mvm->d3_wake_sysassert)) 2166 - goto err; 2167 - if (!debugfs_create_u32("last_netdetect_scans", 0400, 2168 - mvm->debugfs_dir, &mvm->last_netdetect_scans)) 2169 - goto err; 2178 + debugfs_create_bool("d3_wake_sysassert", 0600, mvm->debugfs_dir, 2179 + &mvm->d3_wake_sysassert); 2180 + debugfs_create_u32("last_netdetect_scans", 0400, mvm->debugfs_dir, 2181 + &mvm->last_netdetect_scans); 2170 2182 #endif 2171 2183 2172 - if (!debugfs_create_u8("ps_disabled", 0400, 2173 - mvm->debugfs_dir, &mvm->ps_disabled)) 2174 - goto err; 2175 - if (!debugfs_create_blob("nvm_hw", 0400, 2176 - mvm->debugfs_dir, &mvm->nvm_hw_blob)) 2177 - goto err; 2178 - if (!debugfs_create_blob("nvm_sw", 0400, 2179 - mvm->debugfs_dir, &mvm->nvm_sw_blob)) 2180 - goto err; 2181 - if (!debugfs_create_blob("nvm_calib", 0400, 2182 - mvm->debugfs_dir, &mvm->nvm_calib_blob)) 2183 - goto err; 2184 - if (!debugfs_create_blob("nvm_prod", 0400, 2185 - mvm->debugfs_dir, &mvm->nvm_prod_blob)) 2186 - goto err; 2187 - if (!debugfs_create_blob("nvm_phy_sku", 0400, 2188 - mvm->debugfs_dir, &mvm->nvm_phy_sku_blob)) 2189 - goto err; 2190 - if (!debugfs_create_blob("nvm_reg", S_IRUSR, 2191 - mvm->debugfs_dir, &mvm->nvm_reg_blob)) 2192 - goto err; 2184 + debugfs_create_u8("ps_disabled", 0400, mvm->debugfs_dir, 2185 + &mvm->ps_disabled); 2186 + debugfs_create_blob("nvm_hw", 0400, mvm->debugfs_dir, 2187 + &mvm->nvm_hw_blob); 2188 + debugfs_create_blob("nvm_sw", 0400, mvm->debugfs_dir, 2189 + &mvm->nvm_sw_blob); 2190 + debugfs_create_blob("nvm_calib", 0400, mvm->debugfs_dir, 2191 + &mvm->nvm_calib_blob); 2192 + debugfs_create_blob("nvm_prod", 0400, mvm->debugfs_dir, 2193 + &mvm->nvm_prod_blob); 2194 + debugfs_create_blob("nvm_phy_sku", 0400, mvm->debugfs_dir, 2195 + &mvm->nvm_phy_sku_blob); 2196 + debugfs_create_blob("nvm_reg", S_IRUSR, 2197 + mvm->debugfs_dir, &mvm->nvm_reg_blob); 2193 2198 2194 2199 debugfs_create_file("mem", 0600, dbgfs_dir, mvm, &iwl_dbgfs_mem_ops); 2195 2200 ··· 2189 2212 * exists (before the opmode exists which removes the target.) 2190 2213 */ 2191 2214 snprintf(buf, 100, "../../%pd2", dbgfs_dir->d_parent); 2192 - if (!debugfs_create_symlink("iwlwifi", mvm->hw->wiphy->debugfsdir, buf)) 2193 - goto err; 2194 - 2195 - return 0; 2196 - err: 2197 - IWL_ERR(mvm, "Can't create the mvm debugfs directory\n"); 2198 - return -ENOMEM; 2215 + debugfs_create_symlink("iwlwifi", mvm->hw->wiphy->debugfsdir, buf); 2199 2216 }
+8 -39
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
··· 8 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 Intel Corporation 11 + * Copyright(c) 2018 - 2019 Intel Corporation 12 12 * 13 13 * This program is free software; you can redistribute it and/or modify 14 14 * it under the terms of version 2 of the GNU General Public License as ··· 31 31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 32 32 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 33 33 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 34 - * Copyright(c) 2018 Intel Corporation 34 + * Copyright(c) 2018 - 2019 Intel Corporation 35 35 * All rights reserved. 36 36 * 37 37 * Redistribution and use in source and binary forms, with or without ··· 262 262 .preferred_tsf = NUM_TSF_IDS, 263 263 .found_vif = false, 264 264 }; 265 - u32 ac; 266 - int ret, i, queue_limit; 267 - unsigned long used_hw_queues; 265 + int ret, i; 268 266 269 267 lockdep_assert_held(&mvm->mutex); 270 268 ··· 339 341 INIT_LIST_HEAD(&mvmvif->time_event_data.list); 340 342 mvmvif->time_event_data.id = TE_MAX; 341 343 342 - /* No need to allocate data queues to P2P Device MAC.*/ 343 - if (vif->type == NL80211_IFTYPE_P2P_DEVICE) { 344 - for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) 345 - vif->hw_queue[ac] = IEEE80211_INVAL_HW_QUEUE; 346 - 344 + /* No need to allocate data queues to P2P Device MAC and NAN.*/ 345 + if (vif->type == NL80211_IFTYPE_P2P_DEVICE) 347 346 return 0; 348 - } 349 - 350 - /* 351 - * queues in mac80211 almost entirely independent of 352 - * the ones here - no real limit 353 - */ 354 - queue_limit = IEEE80211_MAX_QUEUES; 355 - 356 - /* 357 - * Find available queues, and allocate them to the ACs. When in 358 - * DQA-mode they aren't really used, and this is done only so the 359 - * mac80211 ieee80211_check_queues() function won't fail 360 - */ 361 - for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { 362 - u8 queue = find_first_zero_bit(&used_hw_queues, queue_limit); 363 - 364 - if (queue >= queue_limit) { 365 - IWL_ERR(mvm, "Failed to allocate queue\n"); 366 - ret = -EIO; 367 - goto exit_fail; 368 - } 369 - 370 - __set_bit(queue, &used_hw_queues); 371 - vif->hw_queue[ac] = queue; 372 - } 373 347 374 348 /* Allocate the CAB queue for softAP and GO interfaces */ 375 349 if (vif->type == NL80211_IFTYPE_AP || ··· 1113 1143 ieee80211_tu_to_usec(data.beacon_int * rand / 1114 1144 100); 1115 1145 } else { 1116 - mvmvif->ap_beacon_time = 1117 - iwl_read_prph(mvm->trans, 1118 - DEVICE_SYSTEM_TIME_REG); 1146 + mvmvif->ap_beacon_time = iwl_mvm_get_systime(mvm); 1119 1147 } 1120 1148 } 1121 1149 ··· 1541 1573 1542 1574 rcu_read_lock(); 1543 1575 vif = rcu_dereference(mvm->vif_id_to_mac[mac_id]); 1576 + mvmvif = iwl_mvm_vif_from_mac80211(vif); 1544 1577 1545 1578 switch (vif->type) { 1546 1579 case NL80211_IFTYPE_AP: ··· 1550 1581 csa_vif != vif)) 1551 1582 goto out_unlock; 1552 1583 1553 - mvmvif = iwl_mvm_vif_from_mac80211(csa_vif); 1554 1584 csa_id = FW_CMD_ID_AND_COLOR(mvmvif->id, mvmvif->color); 1555 1585 if (WARN(csa_id != id_n_color, 1556 1586 "channel switch noa notification on unexpected vif (csa_vif=%d, notif=%d)", ··· 1570 1602 return; 1571 1603 case NL80211_IFTYPE_STATION: 1572 1604 iwl_mvm_csa_client_absent(mvm, vif); 1605 + cancel_delayed_work_sync(&mvmvif->csa_work); 1573 1606 ieee80211_chswitch_done(vif, true); 1574 1607 break; 1575 1608 default:
+170 -58
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
··· 8 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 Intel Corporation 11 + * Copyright(c) 2018 - 2019 Intel Corporation 12 12 * 13 13 * This program is free software; you can redistribute it and/or modify 14 14 * it under the terms of version 2 of the GNU General Public License as ··· 31 31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 32 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 33 33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 34 - * Copyright(c) 2018 Intel Corporation 34 + * Copyright(c) 2018 - 2019 Intel Corporation 35 35 * All rights reserved. 36 36 * 37 37 * Redistribution and use in source and binary forms, with or without ··· 420 420 421 421 const static u8 he_if_types_ext_capa_sta[] = { 422 422 [0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING, 423 + [2] = WLAN_EXT_CAPA3_MULTI_BSSID_SUPPORT, 423 424 [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF, 424 425 [9] = WLAN_EXT_CAPA10_TWT_REQUESTER_SUPPORT, 425 426 }; ··· 598 597 BIT(NL80211_IFTYPE_ADHOC); 599 598 600 599 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; 600 + wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_VHT_IBSS); 601 + hw->wiphy->features |= NL80211_FEATURE_HT_IBSS; 602 + 601 603 hw->wiphy->regulatory_flags |= REGULATORY_ENABLE_RELAX_NO_IR; 602 604 if (iwl_mvm_is_lar_supported(mvm)) 603 605 hw->wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED; ··· 736 732 hw->wiphy->iftype_ext_capab = he_iftypes_ext_capa; 737 733 hw->wiphy->num_iftype_ext_capab = 738 734 ARRAY_SIZE(he_iftypes_ext_capa); 735 + 736 + ieee80211_hw_set(hw, SUPPORTS_MULTI_BSSID); 737 + ieee80211_hw_set(hw, SUPPORTS_ONLY_HE_MULTI_BSSID); 739 738 } 740 739 741 740 mvm->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; ··· 1198 1191 1199 1192 static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm) 1200 1193 { 1201 - /* clear the D3 reconfig, we only need it to avoid dumping a 1202 - * firmware coredump on reconfiguration, we shouldn't do that 1203 - * on D3->D0 transition 1204 - */ 1205 - if (!test_and_clear_bit(IWL_MVM_STATUS_D3_RECONFIG, &mvm->status)) { 1206 - mvm->fwrt.dump.desc = &iwl_dump_desc_assert; 1207 - iwl_fw_error_dump(&mvm->fwrt); 1208 - } 1209 - 1210 1194 /* cleanup all stale references (scan, roc), but keep the 1211 1195 * ucode_down ref until reconfig is complete 1212 1196 */ ··· 1498 1500 return iwl_mvm_send_cmd_pdu(mvm, REDUCE_TX_POWER_CMD, 0, len, &cmd); 1499 1501 } 1500 1502 1503 + static int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw, 1504 + struct ieee80211_vif *vif) 1505 + { 1506 + struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 1507 + struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); 1508 + int ret; 1509 + 1510 + mutex_lock(&mvm->mutex); 1511 + 1512 + if (mvmvif->csa_failed) { 1513 + mvmvif->csa_failed = false; 1514 + ret = -EIO; 1515 + goto out_unlock; 1516 + } 1517 + 1518 + if (vif->type == NL80211_IFTYPE_STATION) { 1519 + struct iwl_mvm_sta *mvmsta; 1520 + 1521 + mvmvif->csa_bcn_pending = false; 1522 + mvmsta = iwl_mvm_sta_from_staid_protected(mvm, 1523 + mvmvif->ap_sta_id); 1524 + 1525 + if (WARN_ON(!mvmsta)) { 1526 + ret = -EIO; 1527 + goto out_unlock; 1528 + } 1529 + 1530 + iwl_mvm_sta_modify_disable_tx(mvm, mvmsta, false); 1531 + 1532 + iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); 1533 + 1534 + ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0); 1535 + if (ret) 1536 + goto out_unlock; 1537 + 1538 + iwl_mvm_stop_session_protection(mvm, vif); 1539 + } 1540 + 1541 + mvmvif->ps_disabled = false; 1542 + 1543 + ret = iwl_mvm_power_update_ps(mvm); 1544 + 1545 + out_unlock: 1546 + mutex_unlock(&mvm->mutex); 1547 + 1548 + return ret; 1549 + } 1550 + 1551 + static void iwl_mvm_abort_channel_switch(struct ieee80211_hw *hw, 1552 + struct ieee80211_vif *vif) 1553 + { 1554 + struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); 1555 + struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 1556 + struct iwl_chan_switch_te_cmd cmd = { 1557 + .mac_id = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, 1558 + mvmvif->color)), 1559 + .action = cpu_to_le32(FW_CTXT_ACTION_REMOVE), 1560 + }; 1561 + 1562 + IWL_DEBUG_MAC80211(mvm, "Abort CSA on mac %d\n", mvmvif->id); 1563 + 1564 + mutex_lock(&mvm->mutex); 1565 + WARN_ON(iwl_mvm_send_cmd_pdu(mvm, 1566 + WIDE_ID(MAC_CONF_GROUP, 1567 + CHANNEL_SWITCH_TIME_EVENT_CMD), 1568 + 0, sizeof(cmd), &cmd)); 1569 + mutex_unlock(&mvm->mutex); 1570 + 1571 + WARN_ON(iwl_mvm_post_channel_switch(hw, vif)); 1572 + } 1573 + 1574 + static void iwl_mvm_channel_switch_disconnect_wk(struct work_struct *wk) 1575 + { 1576 + struct iwl_mvm *mvm; 1577 + struct iwl_mvm_vif *mvmvif; 1578 + struct ieee80211_vif *vif; 1579 + 1580 + mvmvif = container_of(wk, struct iwl_mvm_vif, csa_work.work); 1581 + vif = container_of((void *)mvmvif, struct ieee80211_vif, drv_priv); 1582 + mvm = mvmvif->mvm; 1583 + 1584 + iwl_mvm_abort_channel_switch(mvm->hw, vif); 1585 + ieee80211_chswitch_done(vif, false); 1586 + } 1587 + 1501 1588 static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw, 1502 1589 struct ieee80211_vif *vif) 1503 1590 { ··· 1709 1626 } 1710 1627 1711 1628 iwl_mvm_tcm_add_vif(mvm, vif); 1629 + INIT_DELAYED_WORK(&mvmvif->csa_work, 1630 + iwl_mvm_channel_switch_disconnect_wk); 1712 1631 1713 1632 if (vif->type == NL80211_IFTYPE_MONITOR) 1714 1633 mvm->monitor_on = true; ··· 2212 2127 .frame_time_rts_th = 2213 2128 cpu_to_le16(vif->bss_conf.frame_time_rts_th), 2214 2129 }; 2130 + int size = fw_has_api(&mvm->fw->ucode_capa, 2131 + IWL_UCODE_TLV_API_MBSSID_HE) ? 2132 + sizeof(sta_ctxt_cmd) : 2133 + sizeof(struct iwl_he_sta_context_cmd_v1); 2215 2134 struct ieee80211_sta *sta; 2216 2135 u32 flags; 2217 2136 int i; ··· 2343 2254 2344 2255 /* Set the PPE thresholds accordingly */ 2345 2256 if (low_th >= 0 && high_th >= 0) { 2346 - u8 ***pkt_ext_qam = 2347 - (void *)sta_ctxt_cmd.pkt_ext.pkt_ext_qam_th; 2257 + struct iwl_he_pkt_ext *pkt_ext = 2258 + (struct iwl_he_pkt_ext *)&sta_ctxt_cmd.pkt_ext; 2348 2259 2349 2260 for (i = 0; i < MAX_HE_SUPP_NSS; i++) { 2350 2261 u8 bw; 2351 2262 2352 2263 for (bw = 0; bw < MAX_HE_CHANNEL_BW_INDX; 2353 2264 bw++) { 2354 - pkt_ext_qam[i][bw][0] = low_th; 2355 - pkt_ext_qam[i][bw][1] = high_th; 2265 + pkt_ext->pkt_ext_qam_th[i][bw][0] = 2266 + low_th; 2267 + pkt_ext->pkt_ext_qam_th[i][bw][1] = 2268 + high_th; 2356 2269 } 2357 2270 } 2358 2271 ··· 2399 2308 (vif->bss_conf.uora_ocw_range >> 3) & 0x7; 2400 2309 } 2401 2310 2402 - /* TODO: support Multi BSSID IE */ 2311 + if (vif->bss_conf.nontransmitted) { 2312 + flags |= STA_CTXT_HE_REF_BSSID_VALID; 2313 + ether_addr_copy(sta_ctxt_cmd.ref_bssid_addr, 2314 + vif->bss_conf.transmitter_bssid); 2315 + sta_ctxt_cmd.max_bssid_indicator = 2316 + vif->bss_conf.bssid_indicator; 2317 + sta_ctxt_cmd.bssid_index = vif->bss_conf.bssid_index; 2318 + sta_ctxt_cmd.ema_ap = vif->bss_conf.ema_ap; 2319 + sta_ctxt_cmd.profile_periodicity = 2320 + vif->bss_conf.profile_periodicity; 2321 + } 2403 2322 2404 2323 sta_ctxt_cmd.flags = cpu_to_le32(flags); 2405 2324 2406 2325 if (iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(STA_HE_CTXT_CMD, 2407 2326 DATA_PATH_GROUP, 0), 2408 - 0, sizeof(sta_ctxt_cmd), &sta_ctxt_cmd)) 2327 + 0, size, &sta_ctxt_cmd)) 2409 2328 IWL_ERR(mvm, "Failed to config FW to work HE!\n"); 2410 2329 } 2411 2330 ··· 3713 3612 struct ieee80211_vif *vif, 3714 3613 int duration) 3715 3614 { 3716 - int res, time_reg = DEVICE_SYSTEM_TIME_REG; 3615 + int res; 3717 3616 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 3718 3617 struct iwl_mvm_time_event_data *te_data = &mvmvif->hs_time_event_data; 3719 3618 static const u16 time_event_response[] = { HOT_SPOT_CMD }; ··· 3739 3638 0); 3740 3639 3741 3640 /* Set the time and duration */ 3742 - tail->apply_time = cpu_to_le32(iwl_read_prph(mvm->trans, time_reg)); 3641 + tail->apply_time = cpu_to_le32(iwl_mvm_get_systime(mvm)); 3743 3642 3744 3643 delay = AUX_ROC_MIN_DELAY; 3745 3644 req_dur = MSEC_TO_TU(duration); ··· 4543 4442 .action = cpu_to_le32(FW_CTXT_ACTION_ADD), 4544 4443 .tsf = cpu_to_le32(chsw->timestamp), 4545 4444 .cs_count = chsw->count, 4445 + .cs_mode = chsw->block_tx, 4546 4446 }; 4547 4447 4548 4448 lockdep_assert_held(&mvm->mutex); 4449 + 4450 + if (chsw->delay) 4451 + cmd.cs_delayed_bcn_count = 4452 + DIV_ROUND_UP(chsw->delay, vif->bss_conf.beacon_int); 4549 4453 4550 4454 return iwl_mvm_send_cmd_pdu(mvm, 4551 4455 WIDE_ID(MAC_CONF_GROUP, ··· 4558 4452 0, sizeof(cmd), &cmd); 4559 4453 } 4560 4454 4455 + #define IWL_MAX_CSA_BLOCK_TX 1500 4561 4456 static int iwl_mvm_pre_channel_switch(struct ieee80211_hw *hw, 4562 4457 struct ieee80211_vif *vif, 4563 4458 struct ieee80211_channel_switch *chsw) ··· 4623 4516 ((vif->bss_conf.beacon_int * (chsw->count - 1) - 4624 4517 IWL_MVM_CHANNEL_SWITCH_TIME_CLIENT) * 1024); 4625 4518 4626 - if (chsw->block_tx) 4519 + if (chsw->block_tx) { 4627 4520 iwl_mvm_csa_client_absent(mvm, vif); 4521 + /* 4522 + * In case of undetermined / long time with immediate 4523 + * quiet monitor status to gracefully disconnect 4524 + */ 4525 + if (!chsw->count || 4526 + chsw->count * vif->bss_conf.beacon_int > 4527 + IWL_MAX_CSA_BLOCK_TX) 4528 + schedule_delayed_work(&mvmvif->csa_work, 4529 + msecs_to_jiffies(IWL_MAX_CSA_BLOCK_TX)); 4530 + } 4628 4531 4629 4532 if (mvmvif->bf_data.bf_enabled) { 4630 4533 ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0); ··· 4649 4532 iwl_mvm_schedule_csa_period(mvm, vif, 4650 4533 vif->bss_conf.beacon_int, 4651 4534 apply_time); 4535 + 4536 + mvmvif->csa_count = chsw->count; 4537 + mvmvif->csa_misbehave = false; 4652 4538 break; 4653 4539 default: 4654 4540 break; ··· 4672 4552 return ret; 4673 4553 } 4674 4554 4675 - static int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw, 4676 - struct ieee80211_vif *vif) 4555 + static void iwl_mvm_channel_switch_rx_beacon(struct ieee80211_hw *hw, 4556 + struct ieee80211_vif *vif, 4557 + struct ieee80211_channel_switch *chsw) 4677 4558 { 4678 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 4679 4559 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); 4680 - int ret; 4560 + struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 4561 + struct iwl_chan_switch_te_cmd cmd = { 4562 + .mac_id = cpu_to_le32(FW_CMD_ID_AND_COLOR(mvmvif->id, 4563 + mvmvif->color)), 4564 + .action = cpu_to_le32(FW_CTXT_ACTION_MODIFY), 4565 + .tsf = cpu_to_le32(chsw->timestamp), 4566 + .cs_count = chsw->count, 4567 + .cs_mode = chsw->block_tx, 4568 + }; 4681 4569 4682 - mutex_lock(&mvm->mutex); 4570 + if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_CS_MODIFY)) 4571 + return; 4683 4572 4684 - if (mvmvif->csa_failed) { 4685 - mvmvif->csa_failed = false; 4686 - ret = -EIO; 4687 - goto out_unlock; 4688 - } 4689 - 4690 - if (vif->type == NL80211_IFTYPE_STATION) { 4691 - struct iwl_mvm_sta *mvmsta; 4692 - 4693 - mvmvif->csa_bcn_pending = false; 4694 - mvmsta = iwl_mvm_sta_from_staid_protected(mvm, 4695 - mvmvif->ap_sta_id); 4696 - 4697 - if (WARN_ON(!mvmsta)) { 4698 - ret = -EIO; 4699 - goto out_unlock; 4573 + if (chsw->count >= mvmvif->csa_count && chsw->block_tx) { 4574 + if (mvmvif->csa_misbehave) { 4575 + /* Second time, give up on this AP*/ 4576 + iwl_mvm_abort_channel_switch(hw, vif); 4577 + ieee80211_chswitch_done(vif, false); 4578 + mvmvif->csa_misbehave = false; 4579 + return; 4700 4580 } 4701 - 4702 - iwl_mvm_sta_modify_disable_tx(mvm, mvmsta, false); 4703 - 4704 - iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL); 4705 - 4706 - ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0); 4707 - if (ret) 4708 - goto out_unlock; 4709 - 4710 - iwl_mvm_stop_session_protection(mvm, vif); 4581 + mvmvif->csa_misbehave = true; 4711 4582 } 4583 + mvmvif->csa_count = chsw->count; 4712 4584 4713 - mvmvif->ps_disabled = false; 4585 + IWL_DEBUG_MAC80211(mvm, "Modify CSA on mac %d\n", mvmvif->id); 4714 4586 4715 - ret = iwl_mvm_power_update_ps(mvm); 4716 - 4717 - out_unlock: 4718 - mutex_unlock(&mvm->mutex); 4719 - 4720 - return ret; 4587 + WARN_ON(iwl_mvm_send_cmd_pdu(mvm, 4588 + WIDE_ID(MAC_CONF_GROUP, 4589 + CHANNEL_SWITCH_TIME_EVENT_CMD), 4590 + CMD_ASYNC, sizeof(cmd), &cmd)); 4721 4591 } 4722 4592 4723 4593 static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop) ··· 5166 5056 .channel_switch = iwl_mvm_channel_switch, 5167 5057 .pre_channel_switch = iwl_mvm_pre_channel_switch, 5168 5058 .post_channel_switch = iwl_mvm_post_channel_switch, 5059 + .abort_channel_switch = iwl_mvm_abort_channel_switch, 5060 + .channel_switch_rx_beacon = iwl_mvm_channel_switch_rx_beacon, 5169 5061 5170 5062 .tdls_channel_switch = iwl_mvm_tdls_channel_switch, 5171 5063 .tdls_cancel_channel_switch = iwl_mvm_tdls_cancel_channel_switch,
+11 -21
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
··· 8 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 Intel Corporation 11 + * Copyright(c) 2018 - 2019 Intel Corporation 12 12 * 13 13 * This program is free software; you can redistribute it and/or modify 14 14 * it under the terms of version 2 of the GNU General Public License as ··· 31 31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 32 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 33 33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 34 - * Copyright(c) 2018 Intel Corporation 34 + * Copyright(c) 2018 - 2019 Intel Corporation 35 35 * All rights reserved. 36 36 * 37 37 * Redistribution and use in source and binary forms, with or without ··· 490 490 bool csa_countdown; 491 491 bool csa_failed; 492 492 u16 csa_target_freq; 493 + u16 csa_count; 494 + u16 csa_misbehave; 495 + struct delayed_work csa_work; 493 496 494 497 /* Indicates that we are waiting for a beacon on a new channel */ 495 498 bool csa_bcn_pending; ··· 1202 1199 * @IWL_MVM_STATUS_IN_HW_RESTART: HW restart is active 1203 1200 * @IWL_MVM_STATUS_IN_D0I3: NIC is in D0i3 1204 1201 * @IWL_MVM_STATUS_ROC_AUX_RUNNING: AUX remain-on-channel is running 1205 - * @IWL_MVM_STATUS_D3_RECONFIG: D3 reconfiguration is being done 1206 1202 * @IWL_MVM_STATUS_FIRMWARE_RUNNING: firmware is running 1207 1203 * @IWL_MVM_STATUS_NEED_FLUSH_P2P: need to flush P2P bcast STA 1208 1204 */ ··· 1213 1211 IWL_MVM_STATUS_IN_HW_RESTART, 1214 1212 IWL_MVM_STATUS_IN_D0I3, 1215 1213 IWL_MVM_STATUS_ROC_AUX_RUNNING, 1216 - IWL_MVM_STATUS_D3_RECONFIG, 1217 1214 IWL_MVM_STATUS_FIRMWARE_RUNNING, 1218 1215 IWL_MVM_STATUS_NEED_FLUSH_P2P, 1219 1216 }; ··· 1538 1537 u8 first_antenna(u8 mask); 1539 1538 u8 iwl_mvm_next_antenna(struct iwl_mvm *mvm, u8 valid, u8 last_idx); 1540 1539 void iwl_mvm_get_sync_time(struct iwl_mvm *mvm, u32 *gp2, u64 *boottime); 1540 + u32 iwl_mvm_get_systime(struct iwl_mvm *mvm); 1541 1541 1542 1542 /* Tx / Host Commands */ 1543 1543 int __must_check iwl_mvm_send_cmd(struct iwl_mvm *mvm, ··· 1651 1649 struct iwl_rx_cmd_buffer *rxb); 1652 1650 void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi, 1653 1651 struct iwl_rx_cmd_buffer *rxb, int queue); 1654 - void iwl_mvm_rx_monitor_ndp(struct iwl_mvm *mvm, struct napi_struct *napi, 1655 - struct iwl_rx_cmd_buffer *rxb, int queue); 1652 + void iwl_mvm_rx_monitor_no_data(struct iwl_mvm *mvm, struct napi_struct *napi, 1653 + struct iwl_rx_cmd_buffer *rxb, int queue); 1656 1654 void iwl_mvm_rx_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi, 1657 1655 struct iwl_rx_cmd_buffer *rxb, int queue); 1658 1656 int iwl_mvm_notify_rx_queue(struct iwl_mvm *mvm, u32 rxq_mask, ··· 1786 1784 1787 1785 /* MVM debugfs */ 1788 1786 #ifdef CONFIG_IWLWIFI_DEBUGFS 1789 - int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir); 1787 + void iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir); 1790 1788 void iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif); 1791 1789 void iwl_mvm_vif_dbgfs_clean(struct iwl_mvm *mvm, struct ieee80211_vif *vif); 1792 1790 #else 1793 - static inline int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, 1794 - struct dentry *dbgfs_dir) 1791 + static inline void iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, 1792 + struct dentry *dbgfs_dir) 1795 1793 { 1796 - return 0; 1797 1794 } 1798 1795 static inline void 1799 1796 iwl_mvm_vif_dbgfs_register(struct iwl_mvm *mvm, struct ieee80211_vif *vif) ··· 2024 2023 static inline void iwl_mvm_stop_device(struct iwl_mvm *mvm) 2025 2024 { 2026 2025 lockdep_assert_held(&mvm->mutex); 2027 - /* If IWL_MVM_STATUS_HW_RESTART_REQUESTED bit is set then we received 2028 - * an assert. Since we failed to bring the interface up, mac80211 2029 - * will not attempt to reconfig the device, 2030 - * which handles the dump collection in assert flow, 2031 - * so trigger dump collection here. 2032 - */ 2033 - if (test_and_clear_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, 2034 - &mvm->status)) 2035 - iwl_fw_dbg_collect_desc(&mvm->fwrt, &iwl_dump_desc_assert, 2036 - false, 0); 2037 - 2038 2026 iwl_fw_cancel_timestamp(&mvm->fwrt); 2039 2027 clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); 2040 2028 iwl_fwrt_stop_device(&mvm->fwrt);
+7 -16
drivers/net/wireless/intel/iwlwifi/mvm/ops.c
··· 8 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 Intel Corporation 11 + * Copyright(c) 2018 - 2019 Intel Corporation 12 12 * 13 13 * This program is free software; you can redistribute it and/or modify 14 14 * it under the terms of version 2 of the GNU General Public License as ··· 31 31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 32 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 33 33 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 34 - * Copyright(c) 2018 Intel Corporation 34 + * Copyright(c) 2018 - 2019 Intel Corporation 35 35 * All rights reserved. 36 36 * 37 37 * Redistribution and use in source and binary forms, with or without ··· 862 862 min_backoff = iwl_mvm_min_backoff(mvm); 863 863 iwl_mvm_thermal_initialize(mvm, min_backoff); 864 864 865 - err = iwl_mvm_dbgfs_register(mvm, dbgfs_dir); 866 - if (err) 867 - goto out_unregister; 865 + iwl_mvm_dbgfs_register(mvm, dbgfs_dir); 868 866 869 867 if (!iwl_mvm_has_new_rx_stats_api(mvm)) 870 868 memset(&mvm->rx_stats_v3, 0, ··· 879 881 880 882 return op_mode; 881 883 882 - out_unregister: 883 - if (iwlmvm_mod_params.init_dbg) 884 - return op_mode; 885 - 886 - ieee80211_unregister_hw(mvm->hw); 887 - mvm->hw_registered = false; 888 - iwl_mvm_leds_exit(mvm); 889 - iwl_mvm_thermal_exit(mvm); 890 884 out_free: 891 885 iwl_fw_flush_dump(&mvm->fwrt); 892 886 iwl_fw_runtime_free(&mvm->fwrt); ··· 1095 1105 else if (cmd == WIDE_ID(LEGACY_GROUP, FRAME_RELEASE)) 1096 1106 iwl_mvm_rx_frame_release(mvm, napi, rxb, 0); 1097 1107 else if (cmd == WIDE_ID(DATA_PATH_GROUP, RX_NO_DATA_NOTIF)) 1098 - iwl_mvm_rx_monitor_ndp(mvm, napi, rxb, 0); 1108 + iwl_mvm_rx_monitor_no_data(mvm, napi, rxb, 0); 1099 1109 else 1100 1110 iwl_mvm_rx_common(mvm, rxb, pkt); 1101 1111 } ··· 1281 1291 * can't recover this since we're already half suspended. 1282 1292 */ 1283 1293 if (!mvm->fw_restart && fw_error) { 1284 - iwl_fw_dbg_collect_desc(&mvm->fwrt, &iwl_dump_desc_assert, 1285 - false, 0); 1294 + iwl_fw_error_collect(&mvm->fwrt); 1286 1295 } else if (test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)) { 1287 1296 struct iwl_mvm_reprobe *reprobe; 1288 1297 ··· 1328 1339 src_size); 1329 1340 } 1330 1341 } 1342 + 1343 + iwl_fw_error_collect(&mvm->fwrt); 1331 1344 1332 1345 if (fw_error && mvm->fw_restart > 0) 1333 1346 mvm->fw_restart--;
+41 -3
drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c
··· 6 6 * GPL LICENSE SUMMARY 7 7 * 8 8 * Copyright(c) 2017 Intel Deutschland GmbH 9 - * Copyright(c) 2018 Intel Corporation 9 + * Copyright(c) 2018 - 2019 Intel Corporation 10 10 * 11 11 * This program is free software; you can redistribute it and/or modify 12 12 * it under the terms of version 2 of the GNU General Public License as ··· 27 27 * BSD LICENSE 28 28 * 29 29 * Copyright(c) 2017 Intel Deutschland GmbH 30 - * Copyright(c) 2018 Intel Corporation 30 + * Copyright(c) 2018 - 2019 Intel Corporation 31 31 * All rights reserved. 32 32 * 33 33 * Redistribution and use in source and binary forms, with or without ··· 345 345 rcu_read_unlock(); 346 346 } 347 347 348 + static u16 rs_fw_get_max_amsdu_len(struct ieee80211_sta *sta) 349 + { 350 + const struct ieee80211_sta_vht_cap *vht_cap = &sta->vht_cap; 351 + const struct ieee80211_sta_ht_cap *ht_cap = &sta->ht_cap; 352 + 353 + if (vht_cap && vht_cap->vht_supported) { 354 + switch (vht_cap->cap & IEEE80211_VHT_CAP_MAX_MPDU_MASK) { 355 + case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454: 356 + return IEEE80211_MAX_MPDU_LEN_VHT_11454; 357 + case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991: 358 + return IEEE80211_MAX_MPDU_LEN_VHT_7991; 359 + default: 360 + return IEEE80211_MAX_MPDU_LEN_VHT_3895; 361 + } 362 + 363 + } else if (ht_cap && ht_cap->ht_supported) { 364 + if (ht_cap->cap & IEEE80211_HT_CAP_MAX_AMSDU) 365 + /* 366 + * agg is offloaded so we need to assume that agg 367 + * are enabled and max mpdu in ampdu is 4095 368 + * (spec 802.11-2016 9.3.2.1) 369 + */ 370 + return IEEE80211_MAX_MPDU_LEN_HT_BA; 371 + else 372 + return IEEE80211_MAX_MPDU_LEN_HT_3839; 373 + } 374 + 375 + /* in legacy mode no amsdu is enabled so return zero */ 376 + return 0; 377 + } 378 + 348 379 void rs_fw_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta, 349 380 enum nl80211_band band, bool update) 350 381 { ··· 384 353 struct iwl_lq_sta_rs_fw *lq_sta = &mvmsta->lq_sta.rs_fw; 385 354 u32 cmd_id = iwl_cmd_id(TLC_MNG_CONFIG_CMD, DATA_PATH_GROUP, 0); 386 355 struct ieee80211_supported_band *sband; 356 + u16 max_amsdu_len = rs_fw_get_max_amsdu_len(sta); 387 357 struct iwl_tlc_config_cmd cfg_cmd = { 388 358 .sta_id = mvmsta->sta_id, 389 359 .max_ch_width = update ? 390 360 rs_fw_bw_from_sta_bw(sta) : RATE_MCS_CHAN_WIDTH_20, 391 361 .flags = cpu_to_le16(rs_fw_set_config_flags(mvm, sta)), 392 362 .chains = rs_fw_set_active_chains(iwl_mvm_get_valid_tx_ant(mvm)), 393 - .max_mpdu_len = cpu_to_le16(sta->max_amsdu_len), 394 363 .sgi_ch_width_supp = rs_fw_sgi_cw_support(sta), 364 + .max_mpdu_len = cpu_to_le16(max_amsdu_len), 395 365 .amsdu = iwl_mvm_is_csum_supported(mvm), 396 366 }; 397 367 int ret; ··· 404 372 #endif 405 373 sband = hw->wiphy->bands[band]; 406 374 rs_fw_set_supp_rates(sta, sband, &cfg_cmd); 375 + 376 + /* 377 + * since TLC offload works with one mode we can assume 378 + * that only vht/ht is used and also set it as station max amsdu 379 + */ 380 + sta->max_amsdu_len = max_amsdu_len; 407 381 408 382 ret = iwl_mvm_send_cmd_pdu(mvm, cmd_id, 0, sizeof(cfg_cmd), &cfg_cmd); 409 383 if (ret)
+2 -6
drivers/net/wireless/intel/iwlwifi/mvm/rs.c
··· 4078 4078 #define MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz) \ 4079 4079 _MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz, struct iwl_lq_sta) 4080 4080 #define MVM_DEBUGFS_ADD_FILE_RS(name, parent, mode) do { \ 4081 - if (!debugfs_create_file(#name, mode, parent, lq_sta, \ 4082 - &iwl_dbgfs_##name##_ops)) \ 4083 - goto err; \ 4081 + debugfs_create_file(#name, mode, parent, lq_sta, \ 4082 + &iwl_dbgfs_##name##_ops); \ 4084 4083 } while (0) 4085 4084 4086 4085 MVM_DEBUGFS_READ_WRITE_FILE_OPS(ss_force, 32); ··· 4107 4108 &lq_sta->pers.dbg_fixed_txp_reduction); 4108 4109 4109 4110 MVM_DEBUGFS_ADD_FILE_RS(ss_force, dir, 0600); 4110 - return; 4111 - err: 4112 - IWL_ERR((struct iwl_mvm *)mvm, "Can't create debugfs entity\n"); 4113 4111 } 4114 4112 4115 4113 void rs_remove_sta_debugfs(void *mvm, void *mvm_sta)
+20 -11
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
··· 8 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 Intel Corporation 11 + * Copyright(c) 2018 - 2019 Intel Corporation 12 12 * 13 13 * This program is free software; you can redistribute it and/or modify 14 14 * it under the terms of version 2 of the GNU General Public License as ··· 31 31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 32 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 33 33 * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 34 - * Copyright(c) 2018 Intel Corporation 34 + * Copyright(c) 2018 - 2019 Intel Corporation 35 35 * All rights reserved. 36 36 * 37 37 * Redistribution and use in source and binary forms, with or without ··· 1679 1679 rcu_read_unlock(); 1680 1680 } 1681 1681 1682 - void iwl_mvm_rx_monitor_ndp(struct iwl_mvm *mvm, struct napi_struct *napi, 1683 - struct iwl_rx_cmd_buffer *rxb, int queue) 1682 + void iwl_mvm_rx_monitor_no_data(struct iwl_mvm *mvm, struct napi_struct *napi, 1683 + struct iwl_rx_cmd_buffer *rxb, int queue) 1684 1684 { 1685 1685 struct ieee80211_rx_status *rx_status; 1686 1686 struct iwl_rx_packet *pkt = rxb_addr(rxb); ··· 1699 1699 }; 1700 1700 1701 1701 if (unlikely(test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))) 1702 - return; 1703 - 1704 - /* Currently only NDP type is supported */ 1705 - if (info_type != RX_NO_DATA_INFO_TYPE_NDP) 1706 1702 return; 1707 1703 1708 1704 energy_a = (rssi & RX_NO_DATA_CHAIN_A_MSK) >> RX_NO_DATA_CHAIN_A_POS; ··· 1722 1726 1723 1727 /* 0-length PSDU */ 1724 1728 rx_status->flag |= RX_FLAG_NO_PSDU; 1725 - /* currently this is the only type for which we get this notif */ 1726 - rx_status->zero_length_psdu_type = 1727 - IEEE80211_RADIOTAP_ZERO_LEN_PSDU_SOUNDING; 1729 + 1730 + switch (info_type) { 1731 + case RX_NO_DATA_INFO_TYPE_NDP: 1732 + rx_status->zero_length_psdu_type = 1733 + IEEE80211_RADIOTAP_ZERO_LEN_PSDU_SOUNDING; 1734 + break; 1735 + case RX_NO_DATA_INFO_TYPE_MU_UNMATCHED: 1736 + case RX_NO_DATA_INFO_TYPE_HE_TB_UNMATCHED: 1737 + rx_status->zero_length_psdu_type = 1738 + IEEE80211_RADIOTAP_ZERO_LEN_PSDU_NOT_CAPTURED; 1739 + break; 1740 + default: 1741 + rx_status->zero_length_psdu_type = 1742 + IEEE80211_RADIOTAP_ZERO_LEN_PSDU_VENDOR; 1743 + break; 1744 + } 1728 1745 1729 1746 /* This may be overridden by iwl_mvm_rx_he() to HE_RU */ 1730 1747 switch (rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK) {
+15 -10
drivers/net/wireless/intel/iwlwifi/mvm/scan.c
··· 1082 1082 dwell->extended = IWL_SCAN_DWELL_EXTENDED; 1083 1083 } 1084 1084 1085 - static void iwl_mvm_fill_channels(struct iwl_mvm *mvm, u8 *channels) 1085 + static void iwl_mvm_fill_channels(struct iwl_mvm *mvm, u8 *channels, 1086 + u32 max_channels) 1086 1087 { 1087 1088 struct ieee80211_supported_band *band; 1088 1089 int i, j = 0; 1089 1090 1090 1091 band = &mvm->nvm_data->bands[NL80211_BAND_2GHZ]; 1091 - for (i = 0; i < band->n_channels; i++, j++) 1092 + for (i = 0; i < band->n_channels && j < max_channels; i++, j++) 1092 1093 channels[j] = band->channels[i].hw_value; 1093 1094 band = &mvm->nvm_data->bands[NL80211_BAND_5GHZ]; 1094 - for (i = 0; i < band->n_channels; i++, j++) 1095 + for (i = 0; i < band->n_channels && j < max_channels; i++, j++) 1095 1096 channels[j] = band->channels[i].hw_value; 1096 1097 } 1097 1098 1098 1099 static void iwl_mvm_fill_scan_config_v1(struct iwl_mvm *mvm, void *config, 1099 - u32 flags, u8 channel_flags) 1100 + u32 flags, u8 channel_flags, 1101 + u32 max_channels) 1100 1102 { 1101 1103 enum iwl_mvm_scan_type type = iwl_mvm_get_scan_type(mvm, NULL); 1102 1104 struct iwl_scan_config_v1 *cfg = config; ··· 1117 1115 cfg->bcast_sta_id = mvm->aux_sta.sta_id; 1118 1116 cfg->channel_flags = channel_flags; 1119 1117 1120 - iwl_mvm_fill_channels(mvm, cfg->channel_array); 1118 + iwl_mvm_fill_channels(mvm, cfg->channel_array, max_channels); 1121 1119 } 1122 1120 1123 1121 static void iwl_mvm_fill_scan_config(struct iwl_mvm *mvm, void *config, 1124 - u32 flags, u8 channel_flags) 1122 + u32 flags, u8 channel_flags, 1123 + u32 max_channels) 1125 1124 { 1126 1125 struct iwl_scan_config *cfg = config; 1127 1126 ··· 1165 1162 cfg->bcast_sta_id = mvm->aux_sta.sta_id; 1166 1163 cfg->channel_flags = channel_flags; 1167 1164 1168 - iwl_mvm_fill_channels(mvm, cfg->channel_array); 1165 + iwl_mvm_fill_channels(mvm, cfg->channel_array, max_channels); 1169 1166 } 1170 1167 1171 1168 int iwl_mvm_config_scan(struct iwl_mvm *mvm) ··· 1184 1181 u8 channel_flags; 1185 1182 1186 1183 if (WARN_ON(num_channels > mvm->fw->ucode_capa.n_scan_channels)) 1187 - return -ENOBUFS; 1184 + num_channels = mvm->fw->ucode_capa.n_scan_channels; 1188 1185 1189 1186 if (iwl_mvm_is_cdb_supported(mvm)) { 1190 1187 type = iwl_mvm_get_scan_type_band(mvm, NULL, ··· 1237 1234 flags |= (iwl_mvm_is_scan_fragmented(hb_type)) ? 1238 1235 SCAN_CONFIG_FLAG_SET_LMAC2_FRAGMENTED : 1239 1236 SCAN_CONFIG_FLAG_CLEAR_LMAC2_FRAGMENTED; 1240 - iwl_mvm_fill_scan_config(mvm, cfg, flags, channel_flags); 1237 + iwl_mvm_fill_scan_config(mvm, cfg, flags, channel_flags, 1238 + num_channels); 1241 1239 } else { 1242 - iwl_mvm_fill_scan_config_v1(mvm, cfg, flags, channel_flags); 1240 + iwl_mvm_fill_scan_config_v1(mvm, cfg, flags, channel_flags, 1241 + num_channels); 1243 1242 } 1244 1243 1245 1244 cmd.data[0] = cfg;
+2 -1
drivers/net/wireless/intel/iwlwifi/mvm/sta.c
··· 2277 2277 static const u8 _maddr[] = {0x03, 0x00, 0x00, 0x00, 0x00, 0x00}; 2278 2278 const u8 *maddr = _maddr; 2279 2279 struct iwl_trans_txq_scd_cfg cfg = { 2280 - .fifo = IWL_MVM_TX_FIFO_MCAST, 2280 + .fifo = vif->type == NL80211_IFTYPE_AP ? 2281 + IWL_MVM_TX_FIFO_MCAST : IWL_MVM_TX_FIFO_BE, 2281 2282 .sta_id = msta->sta_id, 2282 2283 .tid = 0, 2283 2284 .aggregate = false,
+3 -4
drivers/net/wireless/intel/iwlwifi/mvm/tdls.c
··· 7 7 * 8 8 * Copyright(c) 2014 Intel Mobile Communications GmbH 9 9 * Copyright(c) 2017 Intel Deutschland GmbH 10 - * Copyright(C) 2018 Intel Corporation 10 + * Copyright(C) 2018 - 2019 Intel Corporation 11 11 * 12 12 * This program is free software; you can redistribute it and/or modify 13 13 * it under the terms of version 2 of the GNU General Public License as ··· 29 29 * 30 30 * Copyright(c) 2014 Intel Mobile Communications GmbH 31 31 * Copyright(c) 2017 Intel Deutschland GmbH 32 - * Copyright(C) 2018 Intel Corporation 32 + * Copyright(C) 2018 - 2019 Intel Corporation 33 33 * All rights reserved. 34 34 * 35 35 * Redistribution and use in source and binary forms, with or without ··· 252 252 253 253 /* we only send requests to our switching peer - update sent time */ 254 254 if (state == IWL_MVM_TDLS_SW_REQ_SENT) 255 - mvm->tdls_cs.peer.sent_timestamp = 256 - iwl_read_prph(mvm->trans, DEVICE_SYSTEM_TIME_REG); 255 + mvm->tdls_cs.peer.sent_timestamp = iwl_mvm_get_systime(mvm); 257 256 258 257 if (state == IWL_MVM_TDLS_SW_IDLE) 259 258 mvm->tdls_cs.cur_sta_id = IWL_MVM_INVALID_STA;
+3 -2
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c
··· 8 8 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 10 10 * Copyright(c) 2017 Intel Deutschland GmbH 11 - * Copyright(c) 2018 Intel Corporation 11 + * Copyright(c) 2018 - 2019 Intel Corporation 12 12 * 13 13 * This program is free software; you can redistribute it and/or modify 14 14 * it under the terms of version 2 of the GNU General Public License as ··· 31 31 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 32 32 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 33 33 * Copyright(c) 2017 Intel Deutschland GmbH 34 - * Copyright(c) 2018 Intel Corporation 34 + * Copyright(c) 2018 - 2019 Intel Corporation 35 35 * All rights reserved. 36 36 * 37 37 * Redistribution and use in source and binary forms, with or without ··· 234 234 break; 235 235 } 236 236 iwl_mvm_csa_client_absent(mvm, te_data->vif); 237 + cancel_delayed_work_sync(&mvmvif->csa_work); 237 238 ieee80211_chswitch_done(te_data->vif, true); 238 239 break; 239 240 default:
+11 -1
drivers/net/wireless/intel/iwlwifi/mvm/utils.c
··· 1418 1418 cancel_delayed_work_sync(&mvmvif->uapsd_nonagg_detected_wk); 1419 1419 } 1420 1420 1421 + u32 iwl_mvm_get_systime(struct iwl_mvm *mvm) 1422 + { 1423 + u32 reg_addr = DEVICE_SYSTEM_TIME_REG; 1424 + 1425 + if (mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22000 && 1426 + mvm->trans->cfg->gp2_reg_addr) 1427 + reg_addr = mvm->trans->cfg->gp2_reg_addr; 1428 + 1429 + return iwl_read_prph(mvm->trans, reg_addr); 1430 + } 1421 1431 1422 1432 void iwl_mvm_get_sync_time(struct iwl_mvm *mvm, u32 *gp2, u64 *boottime) 1423 1433 { ··· 1442 1432 iwl_mvm_power_update_device(mvm); 1443 1433 } 1444 1434 1445 - *gp2 = iwl_read_prph(mvm->trans, DEVICE_SYSTEM_TIME_REG); 1435 + *gp2 = iwl_mvm_get_systime(mvm); 1446 1436 *boottime = ktime_get_boot_ns(); 1447 1437 1448 1438 if (!ps_disabled) {
+1 -8
drivers/net/wireless/intel/iwlwifi/pcie/drv.c
··· 963 963 {IWL_PCI_DEVICE(0x2723, 0x4080, iwl_ax200_cfg_cc)}, 964 964 {IWL_PCI_DEVICE(0x2723, 0x4088, iwl_ax200_cfg_cc)}, 965 965 966 - {IWL_PCI_DEVICE(0x1a56, 0x1653, killer1650w_2ax_cfg)}, 967 - {IWL_PCI_DEVICE(0x1a56, 0x1654, killer1650x_2ax_cfg)}, 968 - 969 966 {IWL_PCI_DEVICE(0x2725, 0x0090, iwlax210_2ax_cfg_so_hr_a0)}, 970 967 {IWL_PCI_DEVICE(0x7A70, 0x0090, iwlax210_2ax_cfg_so_hr_a0)}, 971 968 {IWL_PCI_DEVICE(0x7A70, 0x0310, iwlax210_2ax_cfg_so_hr_a0)}, ··· 1044 1047 } 1045 1048 1046 1049 /* register transport layer debugfs here */ 1047 - ret = iwl_trans_pcie_dbgfs_register(iwl_trans); 1048 - if (ret) 1049 - goto out_free_drv; 1050 + iwl_trans_pcie_dbgfs_register(iwl_trans); 1050 1051 1051 1052 /* if RTPM is in use, enable it in our device */ 1052 1053 if (iwl_trans->runtime_pm_mode != IWL_PLAT_PM_MODE_DISABLED) { ··· 1073 1078 1074 1079 return 0; 1075 1080 1076 - out_free_drv: 1077 - iwl_drv_stop(iwl_trans->drv); 1078 1081 out_free_trans: 1079 1082 iwl_trans_pcie_free(iwl_trans); 1080 1083 return ret;
+9 -28
drivers/net/wireless/intel/iwlwifi/pcie/internal.h
··· 106 106 * @page: driver's pointer to the rxb page 107 107 * @invalid: rxb is in driver ownership - not owned by HW 108 108 * @vid: index of this rxb in the global table 109 - * @size: size used from the buffer 110 109 */ 111 110 struct iwl_rx_mem_buffer { 112 111 dma_addr_t page_dma; ··· 113 114 u16 vid; 114 115 bool invalid; 115 116 struct list_head list; 116 - u32 size; 117 117 }; 118 118 119 119 /** ··· 133 135 u32 unhandled; 134 136 }; 135 137 136 - #define IWL_RX_TD_TYPE_MSK 0xff000000 137 - #define IWL_RX_TD_SIZE_MSK 0x00ffffff 138 - #define IWL_RX_TD_SIZE_2K BIT(11) 139 - #define IWL_RX_TD_TYPE 0 140 - 141 138 /** 142 139 * struct iwl_rx_transfer_desc - transfer descriptor 143 - * @type_n_size: buffer type (bit 0: external buff valid, 144 - * bit 1: optional footer valid, bit 2-7: reserved) 145 - * and buffer size 146 140 * @addr: ptr to free buffer start address 147 141 * @rbid: unique tag of the buffer 148 142 * @reserved: reserved 149 143 */ 150 144 struct iwl_rx_transfer_desc { 151 - __le32 type_n_size; 152 - __le64 addr; 153 145 __le16 rbid; 154 - __le16 reserved; 146 + __le16 reserved[3]; 147 + __le64 addr; 155 148 } __packed; 156 149 157 - #define IWL_RX_CD_SIZE 0xffffff00 150 + #define IWL_RX_CD_FLAGS_FRAGMENTED BIT(0) 158 151 159 152 /** 160 153 * struct iwl_rx_completion_desc - completion descriptor 161 - * @type: buffer type (bit 0: external buff valid, 162 - * bit 1: optional footer valid, bit 2-7: reserved) 163 - * @status: status of the completion 164 154 * @reserved1: reserved 165 155 * @rbid: unique tag of the received buffer 166 - * @size: buffer size, masked by IWL_RX_CD_SIZE 156 + * @flags: flags (0: fragmented, all others: reserved) 167 157 * @reserved2: reserved 168 158 */ 169 159 struct iwl_rx_completion_desc { 170 - u8 type; 171 - u8 status; 172 - __le16 reserved1; 160 + __le32 reserved1; 173 161 __le16 rbid; 174 - __le32 size; 175 - u8 reserved2[22]; 162 + u8 flags; 163 + u8 reserved2[25]; 176 164 } __packed; 177 165 178 166 /** ··· 1030 1046 void iwl_trans_pcie_sync_nmi(struct iwl_trans *trans); 1031 1047 1032 1048 #ifdef CONFIG_IWLWIFI_DEBUGFS 1033 - int iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans); 1049 + void iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans); 1034 1050 #else 1035 - static inline int iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans) 1036 - { 1037 - return 0; 1038 - } 1051 + static inline void iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans) { } 1039 1052 #endif 1040 1053 1041 1054 int iwl_pci_fw_exit_d0i3(struct iwl_trans *trans);
+5 -9
drivers/net/wireless/intel/iwlwifi/pcie/rx.c
··· 282 282 if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) { 283 283 struct iwl_rx_transfer_desc *bd = rxq->bd; 284 284 285 - bd[rxq->write].type_n_size = 286 - cpu_to_le32((IWL_RX_TD_TYPE & IWL_RX_TD_TYPE_MSK) | 287 - ((IWL_RX_TD_SIZE_2K >> 8) & IWL_RX_TD_SIZE_MSK)); 285 + BUILD_BUG_ON(sizeof(*bd) != 2 * sizeof(u64)); 286 + 288 287 bd[rxq->write].addr = cpu_to_le64(rxb->page_dma); 289 288 bd[rxq->write].rbid = cpu_to_le16(rxb->vid); 290 289 } else { ··· 1264 1265 .truesize = max_len, 1265 1266 }; 1266 1267 1267 - if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) 1268 - rxcb.status = rxq->cd[i].status; 1269 - 1270 1268 pkt = rxb_addr(&rxcb); 1271 1269 1272 1270 if (pkt->len_n_flags == cpu_to_le32(FH_RSCSR_FRAME_INVALID)) { ··· 1390 1394 struct iwl_rx_mem_buffer *rxb; 1391 1395 u16 vid; 1392 1396 1397 + BUILD_BUG_ON(sizeof(struct iwl_rx_completion_desc) != 32); 1398 + 1393 1399 if (!trans->cfg->mq_rx_supported) { 1394 1400 rxb = rxq->queue[i]; 1395 1401 rxq->queue[i] = NULL; ··· 1412 1414 goto out_err; 1413 1415 1414 1416 IWL_DEBUG_RX(trans, "Got virtual RB ID %u\n", (u32)rxb->vid); 1415 - 1416 - if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) 1417 - rxb->size = le32_to_cpu(rxq->cd[i].size) & IWL_RX_CD_SIZE; 1418 1417 1419 1418 rxb->invalid = true; 1420 1419 ··· 2207 2212 "Hardware error detected. Restarting.\n"); 2208 2213 2209 2214 isr_stats->hw++; 2215 + trans->hw_error = true; 2210 2216 iwl_pcie_irq_handle_error(trans); 2211 2217 } 2212 2218
+29 -19
drivers/net/wireless/intel/iwlwifi/pcie/trans.c
··· 2442 2442 #ifdef CONFIG_IWLWIFI_DEBUGFS 2443 2443 /* create and remove of files */ 2444 2444 #define DEBUGFS_ADD_FILE(name, parent, mode) do { \ 2445 - if (!debugfs_create_file(#name, mode, parent, trans, \ 2446 - &iwl_dbgfs_##name##_ops)) \ 2447 - goto err; \ 2445 + debugfs_create_file(#name, mode, parent, trans, \ 2446 + &iwl_dbgfs_##name##_ops); \ 2448 2447 } while (0) 2449 2448 2450 2449 /* file operation */ ··· 2846 2847 }; 2847 2848 2848 2849 /* Create the debugfs files and directories */ 2849 - int iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans) 2850 + void iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans) 2850 2851 { 2851 2852 struct dentry *dir = trans->dbgfs_dir; 2852 2853 ··· 2857 2858 DEBUGFS_ADD_FILE(fh_reg, dir, 0400); 2858 2859 DEBUGFS_ADD_FILE(rfkill, dir, 0600); 2859 2860 DEBUGFS_ADD_FILE(monitor_data, dir, 0400); 2860 - return 0; 2861 - 2862 - err: 2863 - IWL_ERR(trans, "failed to create the trans debugfs entry\n"); 2864 - return -ENOMEM; 2865 2861 } 2866 2862 2867 2863 static void iwl_trans_pcie_debugfs_cleanup(struct iwl_trans *trans) ··· 3006 3012 iwl_trans_pcie_dump_pointers(struct iwl_trans *trans, 3007 3013 struct iwl_fw_error_dump_fw_mon *fw_mon_data) 3008 3014 { 3009 - u32 base, write_ptr, wrap_cnt; 3015 + u32 base, base_high, write_ptr, write_ptr_val, wrap_cnt; 3010 3016 3011 - /* If there was a dest TLV - use the values from there */ 3012 - if (trans->ini_valid) { 3017 + if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_AX210) { 3018 + base = DBGC_CUR_DBGBUF_BASE_ADDR_LSB; 3019 + base_high = DBGC_CUR_DBGBUF_BASE_ADDR_MSB; 3020 + write_ptr = DBGC_CUR_DBGBUF_STATUS; 3021 + wrap_cnt = DBGC_DBGBUF_WRAP_AROUND; 3022 + } else if (trans->ini_valid) { 3013 3023 base = iwl_umac_prph(trans, MON_BUFF_BASE_ADDR_VER2); 3014 3024 write_ptr = iwl_umac_prph(trans, MON_BUFF_WRPTR_VER2); 3015 3025 wrap_cnt = iwl_umac_prph(trans, MON_BUFF_CYCLE_CNT_VER2); ··· 3026 3028 write_ptr = MON_BUFF_WRPTR; 3027 3029 wrap_cnt = MON_BUFF_CYCLE_CNT; 3028 3030 } 3029 - fw_mon_data->fw_mon_wr_ptr = 3030 - cpu_to_le32(iwl_read_prph(trans, write_ptr)); 3031 + 3032 + write_ptr_val = iwl_read_prph(trans, write_ptr); 3031 3033 fw_mon_data->fw_mon_cycle_cnt = 3032 3034 cpu_to_le32(iwl_read_prph(trans, wrap_cnt)); 3033 3035 fw_mon_data->fw_mon_base_ptr = 3034 3036 cpu_to_le32(iwl_read_prph(trans, base)); 3037 + if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_AX210) { 3038 + fw_mon_data->fw_mon_base_high_ptr = 3039 + cpu_to_le32(iwl_read_prph(trans, base_high)); 3040 + write_ptr_val &= DBGC_CUR_DBGBUF_STATUS_OFFSET_MSK; 3041 + } 3042 + fw_mon_data->fw_mon_wr_ptr = cpu_to_le32(write_ptr_val); 3035 3043 } 3036 3044 3037 3045 static u32 ··· 3048 3044 u32 len = 0; 3049 3045 3050 3046 if ((trans->num_blocks && 3051 - trans->cfg->device_family == IWL_DEVICE_FAMILY_7000) || 3052 - (trans->dbg_dest_tlv && !trans->ini_valid) || 3053 - (trans->ini_valid && trans->num_blocks)) { 3047 + (trans->cfg->device_family == IWL_DEVICE_FAMILY_7000 || 3048 + trans->cfg->device_family >= IWL_DEVICE_FAMILY_AX210 || 3049 + trans->ini_valid)) || 3050 + (trans->dbg_dest_tlv && !trans->ini_valid)) { 3054 3051 struct iwl_fw_error_dump_fw_mon *fw_mon_data; 3055 3052 3056 3053 (*data)->type = cpu_to_le32(IWL_FW_ERROR_DUMP_FW_MONITOR); ··· 3170 3165 len = sizeof(*dump_data); 3171 3166 3172 3167 /* host commands */ 3173 - len += sizeof(*data) + 3174 - cmdq->n_window * (sizeof(*txcmd) + TFD_MAX_PAYLOAD_SIZE); 3168 + if (dump_mask & BIT(IWL_FW_ERROR_DUMP_TXCMD)) 3169 + len += sizeof(*data) + 3170 + cmdq->n_window * (sizeof(*txcmd) + 3171 + TFD_MAX_PAYLOAD_SIZE); 3175 3172 3176 3173 /* FW monitor */ 3177 3174 if (dump_mask & BIT(IWL_FW_ERROR_DUMP_FW_MONITOR)) ··· 3547 3540 } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) == 3548 3541 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_GF)) { 3549 3542 trans->cfg = &iwlax210_2ax_cfg_so_gf_a0; 3543 + } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) == 3544 + CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_GF4)) { 3545 + trans->cfg = &iwlax210_2ax_cfg_so_gf4_a0; 3550 3546 } 3551 3547 } else if (cfg == &iwl_ax101_cfg_qu_hr) { 3552 3548 if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) ==
+4 -2
drivers/net/wireless/intel/iwlwifi/pcie/tx.c
··· 999 999 slots_num = max_t(u32, TFD_CMD_SLOTS, 1000 1000 trans->cfg->min_txq_size); 1001 1001 else 1002 - slots_num = TFD_TX_CMD_SLOTS; 1002 + slots_num = max_t(u32, TFD_TX_CMD_SLOTS, 1003 + trans->cfg->min_256_ba_txq_size); 1003 1004 trans_pcie->txq[txq_id] = &trans_pcie->txq_memory[txq_id]; 1004 1005 ret = iwl_pcie_txq_alloc(trans, trans_pcie->txq[txq_id], 1005 1006 slots_num, cmd_queue); ··· 1053 1052 slots_num = max_t(u32, TFD_CMD_SLOTS, 1054 1053 trans->cfg->min_txq_size); 1055 1054 else 1056 - slots_num = TFD_TX_CMD_SLOTS; 1055 + slots_num = max_t(u32, TFD_TX_CMD_SLOTS, 1056 + trans->cfg->min_256_ba_txq_size); 1057 1057 ret = iwl_pcie_txq_init(trans, trans_pcie->txq[txq_id], 1058 1058 slots_num, cmd_queue); 1059 1059 if (ret) {
+5 -1
drivers/net/wireless/marvell/mwifiex/cfg80211.c
··· 4082 4082 4083 4083 if (mwifiex_send_cmd(priv, 0, 0, 0, hostcmd, true)) { 4084 4084 dev_err(priv->adapter->dev, "Failed to process hostcmd\n"); 4085 + kfree(hostcmd); 4085 4086 return -EFAULT; 4086 4087 } 4087 4088 4088 4089 /* process hostcmd response*/ 4089 4090 skb = cfg80211_testmode_alloc_reply_skb(wiphy, hostcmd->len); 4090 - if (!skb) 4091 + if (!skb) { 4092 + kfree(hostcmd); 4091 4093 return -ENOMEM; 4094 + } 4092 4095 err = nla_put(skb, MWIFIEX_TM_ATTR_DATA, 4093 4096 hostcmd->len, hostcmd->cmd); 4094 4097 if (err) { 4098 + kfree(hostcmd); 4095 4099 kfree_skb(skb); 4096 4100 return -EMSGSIZE; 4097 4101 }
+6
drivers/net/wireless/marvell/mwifiex/cmdevt.c
··· 341 341 sleep_cfm_tmp = 342 342 dev_alloc_skb(sizeof(struct mwifiex_opt_sleep_confirm) 343 343 + MWIFIEX_TYPE_LEN); 344 + if (!sleep_cfm_tmp) { 345 + mwifiex_dbg(adapter, ERROR, 346 + "SLEEP_CFM: dev_alloc_skb failed\n"); 347 + return -ENOMEM; 348 + } 349 + 344 350 skb_put(sleep_cfm_tmp, sizeof(struct mwifiex_opt_sleep_confirm) 345 351 + MWIFIEX_TYPE_LEN); 346 352 put_unaligned_le32(MWIFIEX_USB_TYPE_CMD, sleep_cfm_tmp->data);
+2 -1
drivers/net/wireless/marvell/mwifiex/sta_rx.c
··· 250 250 local_rx_pd->nf); 251 251 } 252 252 } else { 253 - if (rx_pkt_type != PKT_TYPE_BAR) 253 + if (rx_pkt_type != PKT_TYPE_BAR && 254 + local_rx_pd->priority < MAX_NUM_TID) 254 255 priv->rx_seq[local_rx_pd->priority] = seq_num; 255 256 memcpy(ta, priv->curr_bss_params.bss_descriptor.mac_address, 256 257 ETH_ALEN);
+21 -4
drivers/net/wireless/quantenna/qtnfmac/bus.h
··· 13 13 #define QTNF_MAX_MAC 3 14 14 15 15 enum qtnf_fw_state { 16 - QTNF_FW_STATE_RESET, 17 - QTNF_FW_STATE_FW_DNLD_DONE, 16 + QTNF_FW_STATE_DETACHED, 18 17 QTNF_FW_STATE_BOOT_DONE, 19 18 QTNF_FW_STATE_ACTIVE, 20 - QTNF_FW_STATE_DETACHED, 21 - QTNF_FW_STATE_EP_DEAD, 19 + QTNF_FW_STATE_RUNNING, 20 + QTNF_FW_STATE_DEAD, 22 21 }; 23 22 24 23 struct qtnf_bus; ··· 49 50 struct napi_struct mux_napi; 50 51 struct net_device mux_dev; 51 52 struct workqueue_struct *workqueue; 53 + struct workqueue_struct *hprio_workqueue; 52 54 struct work_struct fw_work; 53 55 struct work_struct event_work; 54 56 struct mutex bus_lock; /* lock during command/event processing */ ··· 57 57 /* bus private data */ 58 58 char bus_priv[0] __aligned(sizeof(void *)); 59 59 }; 60 + 61 + static inline bool qtnf_fw_is_up(struct qtnf_bus *bus) 62 + { 63 + enum qtnf_fw_state state = bus->fw_state; 64 + 65 + return ((state == QTNF_FW_STATE_ACTIVE) || 66 + (state == QTNF_FW_STATE_RUNNING)); 67 + } 68 + 69 + static inline bool qtnf_fw_is_attached(struct qtnf_bus *bus) 70 + { 71 + enum qtnf_fw_state state = bus->fw_state; 72 + 73 + return ((state == QTNF_FW_STATE_ACTIVE) || 74 + (state == QTNF_FW_STATE_RUNNING) || 75 + (state == QTNF_FW_STATE_DEAD)); 76 + } 60 77 61 78 static inline void *get_bus_priv(struct qtnf_bus *bus) 62 79 {
+39 -47
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
··· 144 144 { 145 145 struct net_device *netdev = wdev->netdev; 146 146 struct qtnf_vif *vif; 147 + struct sk_buff *skb; 147 148 148 149 if (WARN_ON(!netdev)) 149 150 return -EFAULT; ··· 157 156 netif_tx_stop_all_queues(netdev); 158 157 if (netif_carrier_ok(netdev)) 159 158 netif_carrier_off(netdev); 159 + 160 + while ((skb = skb_dequeue(&vif->high_pri_tx_queue))) 161 + dev_kfree_skb_any(skb); 162 + 163 + cancel_work_sync(&vif->high_pri_tx_work); 160 164 161 165 if (netdev->reg_state == NETREG_REGISTERED) 162 166 unregister_netdevice(netdev); ··· 430 424 *cookie = short_cookie; 431 425 432 426 if (params->offchan) 433 - flags |= QLINK_MGMT_FRAME_TX_FLAG_OFFCHAN; 427 + flags |= QLINK_FRAME_TX_FLAG_OFFCHAN; 434 428 435 429 if (params->no_cck) 436 - flags |= QLINK_MGMT_FRAME_TX_FLAG_NO_CCK; 430 + flags |= QLINK_FRAME_TX_FLAG_NO_CCK; 437 431 438 432 if (params->dont_wait_for_ack) 439 - flags |= QLINK_MGMT_FRAME_TX_FLAG_ACK_NOWAIT; 433 + flags |= QLINK_FRAME_TX_FLAG_ACK_NOWAIT; 440 434 441 435 /* If channel is not specified, pass "freq = 0" to tell device 442 436 * firmware to use current channel. ··· 451 445 le16_to_cpu(mgmt_frame->frame_control), mgmt_frame->da, 452 446 params->len, short_cookie, flags); 453 447 454 - return qtnf_cmd_send_mgmt_frame(vif, short_cookie, flags, 455 - freq, 456 - params->buf, params->len); 448 + return qtnf_cmd_send_frame(vif, short_cookie, flags, 449 + freq, params->buf, params->len); 457 450 } 458 451 459 452 static int ··· 998 993 #endif 999 994 }; 1000 995 1001 - static void qtnf_cfg80211_reg_notifier(struct wiphy *wiphy_in, 996 + static void qtnf_cfg80211_reg_notifier(struct wiphy *wiphy, 1002 997 struct regulatory_request *req) 1003 998 { 1004 - struct qtnf_wmac *mac = wiphy_priv(wiphy_in); 1005 - struct qtnf_bus *bus = mac->bus; 1006 - struct wiphy *wiphy; 1007 - unsigned int mac_idx; 999 + struct qtnf_wmac *mac = wiphy_priv(wiphy); 1008 1000 enum nl80211_band band; 1009 1001 int ret; 1010 1002 1011 1003 pr_debug("MAC%u: initiator=%d alpha=%c%c\n", mac->macid, req->initiator, 1012 1004 req->alpha2[0], req->alpha2[1]); 1013 1005 1014 - ret = qtnf_cmd_reg_notify(bus, req); 1006 + ret = qtnf_cmd_reg_notify(mac, req); 1015 1007 if (ret) { 1016 - if (ret == -EOPNOTSUPP) { 1017 - pr_warn("reg update not supported\n"); 1018 - } else if (ret == -EALREADY) { 1019 - pr_info("regulatory domain is already set to %c%c", 1020 - req->alpha2[0], req->alpha2[1]); 1021 - } else { 1022 - pr_err("failed to update reg domain to %c%c\n", 1023 - req->alpha2[0], req->alpha2[1]); 1024 - } 1025 - 1008 + pr_err("MAC%u: failed to update region to %c%c: %d\n", 1009 + mac->macid, req->alpha2[0], req->alpha2[1], ret); 1026 1010 return; 1027 1011 } 1028 1012 1029 - for (mac_idx = 0; mac_idx < QTNF_MAX_MAC; ++mac_idx) { 1030 - if (!(bus->hw_info.mac_bitmap & (1 << mac_idx))) 1013 + for (band = 0; band < NUM_NL80211_BANDS; ++band) { 1014 + if (!wiphy->bands[band]) 1031 1015 continue; 1032 1016 1033 - mac = bus->mac[mac_idx]; 1034 - if (!mac) 1035 - continue; 1036 - 1037 - wiphy = priv_to_wiphy(mac); 1038 - 1039 - for (band = 0; band < NUM_NL80211_BANDS; ++band) { 1040 - if (!wiphy->bands[band]) 1041 - continue; 1042 - 1043 - ret = qtnf_cmd_band_info_get(mac, wiphy->bands[band]); 1044 - if (ret) 1045 - pr_err("failed to get chan info for mac %u band %u\n", 1046 - mac_idx, band); 1047 - } 1017 + ret = qtnf_cmd_band_info_get(mac, wiphy->bands[band]); 1018 + if (ret) 1019 + pr_err("MAC%u: failed to update band %u\n", 1020 + mac->macid, band); 1048 1021 } 1049 1022 } 1050 1023 ··· 1078 1095 struct wiphy *wiphy = priv_to_wiphy(mac); 1079 1096 struct qtnf_mac_info *macinfo = &mac->macinfo; 1080 1097 int ret; 1098 + bool regdomain_is_known; 1081 1099 1082 1100 if (!wiphy) { 1083 1101 pr_err("invalid wiphy pointer\n"); ··· 1111 1127 WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD | 1112 1128 WIPHY_FLAG_AP_UAPSD | 1113 1129 WIPHY_FLAG_HAS_CHANNEL_SWITCH | 1114 - WIPHY_FLAG_4ADDR_STATION; 1130 + WIPHY_FLAG_4ADDR_STATION | 1131 + WIPHY_FLAG_NETNS_OK; 1115 1132 wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; 1116 1133 1117 1134 if (hw_info->hw_capab & QLINK_HW_CAPAB_DFS_OFFLOAD) ··· 1151 1166 wiphy->wowlan = macinfo->wowlan; 1152 1167 #endif 1153 1168 1169 + regdomain_is_known = isalpha(mac->rd->alpha2[0]) && 1170 + isalpha(mac->rd->alpha2[1]); 1171 + 1154 1172 if (hw_info->hw_capab & QLINK_HW_CAPAB_REG_UPDATE) { 1155 - wiphy->regulatory_flags |= REGULATORY_STRICT_REG | 1156 - REGULATORY_CUSTOM_REG; 1157 1173 wiphy->reg_notifier = qtnf_cfg80211_reg_notifier; 1158 - wiphy_apply_custom_regulatory(wiphy, hw_info->rd); 1174 + 1175 + if (mac->rd->alpha2[0] == '9' && mac->rd->alpha2[1] == '9') { 1176 + wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG | 1177 + REGULATORY_STRICT_REG; 1178 + wiphy_apply_custom_regulatory(wiphy, mac->rd); 1179 + } else if (regdomain_is_known) { 1180 + wiphy->regulatory_flags |= REGULATORY_STRICT_REG; 1181 + } 1159 1182 } else { 1160 1183 wiphy->regulatory_flags |= REGULATORY_WIPHY_SELF_MANAGED; 1161 1184 } ··· 1186 1193 goto out; 1187 1194 1188 1195 if (wiphy->regulatory_flags & REGULATORY_WIPHY_SELF_MANAGED) 1189 - ret = regulatory_set_wiphy_regd(wiphy, hw_info->rd); 1190 - else if (isalpha(hw_info->rd->alpha2[0]) && 1191 - isalpha(hw_info->rd->alpha2[1])) 1192 - ret = regulatory_hint(wiphy, hw_info->rd->alpha2); 1196 + ret = regulatory_set_wiphy_regd(wiphy, mac->rd); 1197 + else if (regdomain_is_known) 1198 + ret = regulatory_hint(wiphy, mac->rd->alpha2); 1193 1199 1194 1200 out: 1195 1201 return ret;
+184 -189
drivers/net/wireless/quantenna/qtnfmac/commands.c
··· 11 11 #include "bus.h" 12 12 #include "commands.h" 13 13 14 + #define QTNF_SCAN_TIME_AUTO 0 15 + 16 + /* Let device itself to select best values for current conditions */ 17 + #define QTNF_SCAN_DWELL_ACTIVE_DEFAULT QTNF_SCAN_TIME_AUTO 18 + #define QTNF_SCAN_DWELL_PASSIVE_DEFAULT QTNF_SCAN_TIME_AUTO 19 + #define QTNF_SCAN_SAMPLE_DURATION_DEFAULT QTNF_SCAN_TIME_AUTO 20 + 14 21 static int qtnf_cmd_check_reply_header(const struct qlink_resp *resp, 15 22 u16 cmd_id, u8 mac_id, u8 vif_id, 16 23 size_t resp_size) ··· 96 89 97 90 pr_debug("VIF%u.%u cmd=0x%.4X\n", mac_id, vif_id, cmd_id); 98 91 99 - if (bus->fw_state != QTNF_FW_STATE_ACTIVE && 100 - cmd_id != QLINK_CMD_FW_INIT) { 92 + if (!qtnf_fw_is_up(bus) && cmd_id != QLINK_CMD_FW_INIT) { 101 93 pr_warn("VIF%u.%u: drop cmd 0x%.4X in fw state %d\n", 102 94 mac_id, vif_id, cmd_id, bus->fw_state); 103 95 dev_kfree_skb(cmd_skb); ··· 183 177 memcpy(tlv->ie_data, buf, len); 184 178 } 185 179 186 - static inline size_t qtnf_cmd_acl_data_size(const struct cfg80211_acl_data *acl) 187 - { 188 - size_t size = sizeof(struct qlink_acl_data) + 189 - acl->n_acl_entries * sizeof(struct qlink_mac_address); 190 - 191 - return size; 192 - } 193 - 194 180 static bool qtnf_cmd_start_ap_can_fit(const struct qtnf_vif *vif, 195 181 const struct cfg80211_ap_settings *s) 196 182 { ··· 201 203 202 204 if (s->acl) 203 205 len += sizeof(struct qlink_tlv_hdr) + 204 - qtnf_cmd_acl_data_size(s->acl); 206 + struct_size(s->acl, mac_addrs, s->acl->n_acl_entries); 205 207 206 208 if (len > (sizeof(struct qlink_cmd) + QTNF_MAX_CMD_BUF_SIZE)) { 207 209 pr_err("VIF%u.%u: can not fit AP settings: %u\n", ··· 308 310 } 309 311 310 312 if (s->acl) { 311 - size_t acl_size = qtnf_cmd_acl_data_size(s->acl); 313 + size_t acl_size = struct_size(s->acl, mac_addrs, 314 + s->acl->n_acl_entries); 312 315 struct qlink_tlv_hdr *tlv = 313 316 skb_put(cmd_skb, sizeof(*tlv) + acl_size); 314 317 ··· 381 382 return ret; 382 383 } 383 384 384 - int qtnf_cmd_send_mgmt_frame(struct qtnf_vif *vif, u32 cookie, u16 flags, 385 - u16 freq, const u8 *buf, size_t len) 385 + int qtnf_cmd_send_frame(struct qtnf_vif *vif, u32 cookie, u16 flags, 386 + u16 freq, const u8 *buf, size_t len) 386 387 { 387 388 struct sk_buff *cmd_skb; 388 - struct qlink_cmd_mgmt_frame_tx *cmd; 389 + struct qlink_cmd_frame_tx *cmd; 389 390 int ret; 390 391 391 392 if (sizeof(*cmd) + len > QTNF_MAX_CMD_BUF_SIZE) { ··· 395 396 } 396 397 397 398 cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid, 398 - QLINK_CMD_SEND_MGMT_FRAME, 399 + QLINK_CMD_SEND_FRAME, 399 400 sizeof(*cmd)); 400 401 if (!cmd_skb) 401 402 return -ENOMEM; 402 403 403 404 qtnf_bus_lock(vif->mac->bus); 404 405 405 - cmd = (struct qlink_cmd_mgmt_frame_tx *)cmd_skb->data; 406 + cmd = (struct qlink_cmd_frame_tx *)cmd_skb->data; 406 407 cmd->cookie = cpu_to_le32(cookie); 407 408 cmd->freq = cpu_to_le16(freq); 408 409 cmd->flags = cpu_to_le16(flags); ··· 785 786 int use4addr, 786 787 u8 *mac_addr) 787 788 { 788 - return qtnf_cmd_send_add_change_intf(vif, iftype, use4addr, mac_addr, 789 - QLINK_CMD_CHANGE_INTF); 789 + int ret; 790 + 791 + ret = qtnf_cmd_send_add_change_intf(vif, iftype, use4addr, mac_addr, 792 + QLINK_CMD_CHANGE_INTF); 793 + 794 + /* Regulatory settings may be different for different interface types */ 795 + if (ret == 0 && vif->wdev.iftype != iftype) { 796 + enum nl80211_band band; 797 + struct wiphy *wiphy = priv_to_wiphy(vif->mac); 798 + 799 + for (band = 0; band < NUM_NL80211_BANDS; ++band) { 800 + if (!wiphy->bands[band]) 801 + continue; 802 + 803 + qtnf_cmd_band_info_get(vif->mac, wiphy->bands[band]); 804 + } 805 + } 806 + 807 + return ret; 790 808 } 791 809 792 810 int qtnf_cmd_send_del_intf(struct qtnf_vif *vif) ··· 847 831 return ret; 848 832 } 849 833 850 - static u32 qtnf_cmd_resp_reg_rule_flags_parse(u32 qflags) 851 - { 852 - u32 flags = 0; 853 - 854 - if (qflags & QLINK_RRF_NO_OFDM) 855 - flags |= NL80211_RRF_NO_OFDM; 856 - 857 - if (qflags & QLINK_RRF_NO_CCK) 858 - flags |= NL80211_RRF_NO_CCK; 859 - 860 - if (qflags & QLINK_RRF_NO_INDOOR) 861 - flags |= NL80211_RRF_NO_INDOOR; 862 - 863 - if (qflags & QLINK_RRF_NO_OUTDOOR) 864 - flags |= NL80211_RRF_NO_OUTDOOR; 865 - 866 - if (qflags & QLINK_RRF_DFS) 867 - flags |= NL80211_RRF_DFS; 868 - 869 - if (qflags & QLINK_RRF_PTP_ONLY) 870 - flags |= NL80211_RRF_PTP_ONLY; 871 - 872 - if (qflags & QLINK_RRF_PTMP_ONLY) 873 - flags |= NL80211_RRF_PTMP_ONLY; 874 - 875 - if (qflags & QLINK_RRF_NO_IR) 876 - flags |= NL80211_RRF_NO_IR; 877 - 878 - if (qflags & QLINK_RRF_AUTO_BW) 879 - flags |= NL80211_RRF_AUTO_BW; 880 - 881 - if (qflags & QLINK_RRF_IR_CONCURRENT) 882 - flags |= NL80211_RRF_IR_CONCURRENT; 883 - 884 - if (qflags & QLINK_RRF_NO_HT40MINUS) 885 - flags |= NL80211_RRF_NO_HT40MINUS; 886 - 887 - if (qflags & QLINK_RRF_NO_HT40PLUS) 888 - flags |= NL80211_RRF_NO_HT40PLUS; 889 - 890 - if (qflags & QLINK_RRF_NO_80MHZ) 891 - flags |= NL80211_RRF_NO_80MHZ; 892 - 893 - if (qflags & QLINK_RRF_NO_160MHZ) 894 - flags |= NL80211_RRF_NO_160MHZ; 895 - 896 - return flags; 897 - } 898 - 899 834 static int 900 835 qtnf_cmd_resp_proc_hw_info(struct qtnf_bus *bus, 901 836 const struct qlink_resp_get_hw_info *resp, ··· 854 887 { 855 888 struct qtnf_hw_info *hwinfo = &bus->hw_info; 856 889 const struct qlink_tlv_hdr *tlv; 857 - const struct qlink_tlv_reg_rule *tlv_rule; 858 890 const char *bld_name = NULL; 859 891 const char *bld_rev = NULL; 860 892 const char *bld_type = NULL; ··· 864 898 const char *calibration_ver = NULL; 865 899 const char *uboot_ver = NULL; 866 900 u32 hw_ver = 0; 867 - struct ieee80211_reg_rule *rule; 868 901 u16 tlv_type; 869 902 u16 tlv_value_len; 870 - unsigned int rule_idx = 0; 871 - 872 - if (WARN_ON(resp->n_reg_rules > NL80211_MAX_SUPP_REG_RULES)) 873 - return -E2BIG; 874 - 875 - hwinfo->rd = kzalloc(struct_size(hwinfo->rd, reg_rules, 876 - resp->n_reg_rules), GFP_KERNEL); 877 - 878 - if (!hwinfo->rd) 879 - return -ENOMEM; 880 903 881 904 hwinfo->num_mac = resp->num_mac; 882 905 hwinfo->mac_bitmap = resp->mac_bitmap; ··· 874 919 hwinfo->total_tx_chain = resp->total_tx_chain; 875 920 hwinfo->total_rx_chain = resp->total_rx_chain; 876 921 hwinfo->hw_capab = le32_to_cpu(resp->hw_capab); 877 - hwinfo->rd->n_reg_rules = resp->n_reg_rules; 878 - hwinfo->rd->alpha2[0] = resp->alpha2[0]; 879 - hwinfo->rd->alpha2[1] = resp->alpha2[1]; 880 922 881 923 bld_tmstamp = le32_to_cpu(resp->bld_tmstamp); 882 924 plat_id = le32_to_cpu(resp->plat_id); 883 925 hw_ver = le32_to_cpu(resp->hw_ver); 884 - 885 - switch (resp->dfs_region) { 886 - case QLINK_DFS_FCC: 887 - hwinfo->rd->dfs_region = NL80211_DFS_FCC; 888 - break; 889 - case QLINK_DFS_ETSI: 890 - hwinfo->rd->dfs_region = NL80211_DFS_ETSI; 891 - break; 892 - case QLINK_DFS_JP: 893 - hwinfo->rd->dfs_region = NL80211_DFS_JP; 894 - break; 895 - case QLINK_DFS_UNSET: 896 - default: 897 - hwinfo->rd->dfs_region = NL80211_DFS_UNSET; 898 - break; 899 - } 900 926 901 927 tlv = (const struct qlink_tlv_hdr *)resp->info; 902 928 ··· 892 956 } 893 957 894 958 switch (tlv_type) { 895 - case QTN_TLV_ID_REG_RULE: 896 - if (rule_idx >= resp->n_reg_rules) { 897 - pr_warn("unexpected number of rules: %u\n", 898 - resp->n_reg_rules); 899 - return -EINVAL; 900 - } 901 - 902 - if (tlv_value_len != sizeof(*tlv_rule) - sizeof(*tlv)) { 903 - pr_warn("malformed TLV 0x%.2X; LEN: %u\n", 904 - tlv_type, tlv_value_len); 905 - return -EINVAL; 906 - } 907 - 908 - tlv_rule = (const struct qlink_tlv_reg_rule *)tlv; 909 - rule = &hwinfo->rd->reg_rules[rule_idx++]; 910 - 911 - rule->freq_range.start_freq_khz = 912 - le32_to_cpu(tlv_rule->start_freq_khz); 913 - rule->freq_range.end_freq_khz = 914 - le32_to_cpu(tlv_rule->end_freq_khz); 915 - rule->freq_range.max_bandwidth_khz = 916 - le32_to_cpu(tlv_rule->max_bandwidth_khz); 917 - rule->power_rule.max_antenna_gain = 918 - le32_to_cpu(tlv_rule->max_antenna_gain); 919 - rule->power_rule.max_eirp = 920 - le32_to_cpu(tlv_rule->max_eirp); 921 - rule->dfs_cac_ms = 922 - le32_to_cpu(tlv_rule->dfs_cac_ms); 923 - rule->flags = qtnf_cmd_resp_reg_rule_flags_parse( 924 - le32_to_cpu(tlv_rule->flags)); 925 - break; 926 959 case QTN_TLV_ID_BUILD_NAME: 927 960 bld_name = (const void *)tlv->val; 928 961 break; ··· 924 1019 tlv = (struct qlink_tlv_hdr *)(tlv->val + tlv_value_len); 925 1020 } 926 1021 927 - if (rule_idx != resp->n_reg_rules) { 928 - pr_warn("unexpected number of rules: expected %u got %u\n", 929 - resp->n_reg_rules, rule_idx); 930 - kfree(hwinfo->rd); 931 - hwinfo->rd = NULL; 932 - return -EINVAL; 933 - } 934 - 935 - pr_info("fw_version=%d, MACs map %#x, alpha2=\"%c%c\", chains Tx=%u Rx=%u, capab=0x%x\n", 1022 + pr_info("fw_version=%d, MACs map %#x, chains Tx=%u Rx=%u, capab=0x%x\n", 936 1023 hwinfo->fw_ver, hwinfo->mac_bitmap, 937 - hwinfo->rd->alpha2[0], hwinfo->rd->alpha2[1], 938 1024 hwinfo->total_tx_chain, hwinfo->total_rx_chain, 939 1025 hwinfo->hw_capab); 940 1026 ··· 938 1042 "\nHardware ID: %s" \ 939 1043 "\nCalibration version: %s" \ 940 1044 "\nU-Boot version: %s" \ 941 - "\nHardware version: 0x%08x", 1045 + "\nHardware version: 0x%08x\n", 942 1046 bld_name, bld_rev, bld_type, bld_label, 943 1047 (unsigned long)bld_tmstamp, 944 1048 (unsigned long)plat_id, ··· 981 1085 } 982 1086 } 983 1087 984 - static int qtnf_parse_variable_mac_info(struct qtnf_wmac *mac, 985 - const u8 *tlv_buf, size_t tlv_buf_size) 1088 + static int 1089 + qtnf_parse_variable_mac_info(struct qtnf_wmac *mac, 1090 + const struct qlink_resp_get_mac_info *resp, 1091 + size_t tlv_buf_size) 986 1092 { 1093 + const u8 *tlv_buf = resp->var_info; 987 1094 struct ieee80211_iface_combination *comb = NULL; 988 1095 size_t n_comb = 0; 989 1096 struct ieee80211_iface_limit *limits; ··· 1004 1105 u8 ext_capa_len = 0; 1005 1106 u8 ext_capa_mask_len = 0; 1006 1107 int i = 0; 1108 + struct ieee80211_reg_rule *rule; 1109 + unsigned int rule_idx = 0; 1110 + const struct qlink_tlv_reg_rule *tlv_rule; 1111 + 1112 + if (WARN_ON(resp->n_reg_rules > NL80211_MAX_SUPP_REG_RULES)) 1113 + return -E2BIG; 1114 + 1115 + mac->rd = kzalloc(sizeof(*mac->rd) + 1116 + sizeof(struct ieee80211_reg_rule) * 1117 + resp->n_reg_rules, GFP_KERNEL); 1118 + if (!mac->rd) 1119 + return -ENOMEM; 1120 + 1121 + mac->rd->n_reg_rules = resp->n_reg_rules; 1122 + mac->rd->alpha2[0] = resp->alpha2[0]; 1123 + mac->rd->alpha2[1] = resp->alpha2[1]; 1124 + 1125 + switch (resp->dfs_region) { 1126 + case QLINK_DFS_FCC: 1127 + mac->rd->dfs_region = NL80211_DFS_FCC; 1128 + break; 1129 + case QLINK_DFS_ETSI: 1130 + mac->rd->dfs_region = NL80211_DFS_ETSI; 1131 + break; 1132 + case QLINK_DFS_JP: 1133 + mac->rd->dfs_region = NL80211_DFS_JP; 1134 + break; 1135 + case QLINK_DFS_UNSET: 1136 + default: 1137 + mac->rd->dfs_region = NL80211_DFS_UNSET; 1138 + break; 1139 + } 1007 1140 1008 1141 tlv = (const struct qlink_tlv_hdr *)tlv_buf; 1009 1142 while (tlv_buf_size >= sizeof(struct qlink_tlv_hdr)) { ··· 1156 1225 mac->macinfo.wowlan = NULL; 1157 1226 qtnf_parse_wowlan_info(mac, wowlan); 1158 1227 break; 1228 + case QTN_TLV_ID_REG_RULE: 1229 + if (rule_idx >= resp->n_reg_rules) { 1230 + pr_warn("unexpected number of rules: %u\n", 1231 + resp->n_reg_rules); 1232 + return -EINVAL; 1233 + } 1234 + 1235 + if (tlv_value_len != sizeof(*tlv_rule) - sizeof(*tlv)) { 1236 + pr_warn("malformed TLV 0x%.2X; LEN: %u\n", 1237 + tlv_type, tlv_value_len); 1238 + return -EINVAL; 1239 + } 1240 + 1241 + tlv_rule = (const struct qlink_tlv_reg_rule *)tlv; 1242 + rule = &mac->rd->reg_rules[rule_idx++]; 1243 + qlink_utils_regrule_q2nl(rule, tlv_rule); 1244 + break; 1159 1245 default: 1160 1246 pr_warn("MAC%u: unknown TLV type %u\n", 1161 1247 mac->macid, tlv_type); ··· 1198 1250 if (ext_capa_len != ext_capa_mask_len) { 1199 1251 pr_err("MAC%u: ext_capa/_mask lengths mismatch: %u != %u\n", 1200 1252 mac->macid, ext_capa_len, ext_capa_mask_len); 1253 + return -EINVAL; 1254 + } 1255 + 1256 + if (rule_idx != resp->n_reg_rules) { 1257 + pr_warn("unexpected number of rules: expected %u got %u\n", 1258 + resp->n_reg_rules, rule_idx); 1201 1259 return -EINVAL; 1202 1260 } 1203 1261 ··· 1617 1663 1618 1664 resp = (const struct qlink_resp_get_mac_info *)resp_skb->data; 1619 1665 qtnf_cmd_resp_proc_mac_info(mac, resp); 1620 - ret = qtnf_parse_variable_mac_info(mac, resp->var_info, var_data_len); 1666 + ret = qtnf_parse_variable_mac_info(mac, resp, var_data_len); 1621 1667 1622 1668 out: 1623 1669 qtnf_bus_unlock(mac->bus); ··· 1663 1709 struct qlink_resp_band_info_get *resp; 1664 1710 size_t info_len = 0; 1665 1711 int ret = 0; 1666 - u8 qband; 1667 - 1668 - switch (band->band) { 1669 - case NL80211_BAND_2GHZ: 1670 - qband = QLINK_BAND_2GHZ; 1671 - break; 1672 - case NL80211_BAND_5GHZ: 1673 - qband = QLINK_BAND_5GHZ; 1674 - break; 1675 - case NL80211_BAND_60GHZ: 1676 - qband = QLINK_BAND_60GHZ; 1677 - break; 1678 - default: 1679 - return -EINVAL; 1680 - } 1712 + u8 qband = qlink_utils_band_cfg2q(band->band); 1681 1713 1682 1714 cmd_skb = qtnf_cmd_alloc_new_cmdskb(mac->macid, 0, 1683 1715 QLINK_CMD_BAND_INFO_GET, ··· 2047 2107 static void qtnf_cmd_channel_tlv_add(struct sk_buff *cmd_skb, 2048 2108 const struct ieee80211_channel *sc) 2049 2109 { 2050 - struct qlink_tlv_channel *qchan; 2051 - u32 flags = 0; 2110 + struct qlink_tlv_channel *tlv; 2111 + struct qlink_channel *qch; 2052 2112 2053 - qchan = skb_put_zero(cmd_skb, sizeof(*qchan)); 2054 - qchan->hdr.type = cpu_to_le16(QTN_TLV_ID_CHANNEL); 2055 - qchan->hdr.len = cpu_to_le16(sizeof(*qchan) - sizeof(qchan->hdr)); 2056 - qchan->chan.center_freq = cpu_to_le16(sc->center_freq); 2057 - qchan->chan.hw_value = cpu_to_le16(sc->hw_value); 2113 + tlv = skb_put_zero(cmd_skb, sizeof(*tlv)); 2114 + qch = &tlv->chan; 2115 + tlv->hdr.type = cpu_to_le16(QTN_TLV_ID_CHANNEL); 2116 + tlv->hdr.len = cpu_to_le16(sizeof(*qch)); 2058 2117 2059 - if (sc->flags & IEEE80211_CHAN_NO_IR) 2060 - flags |= QLINK_CHAN_NO_IR; 2061 - 2062 - if (sc->flags & IEEE80211_CHAN_RADAR) 2063 - flags |= QLINK_CHAN_RADAR; 2064 - 2065 - qchan->chan.flags = cpu_to_le32(flags); 2118 + qch->center_freq = cpu_to_le16(sc->center_freq); 2119 + qch->hw_value = cpu_to_le16(sc->hw_value); 2120 + qch->band = qlink_utils_band_cfg2q(sc->band); 2121 + qch->max_power = sc->max_power; 2122 + qch->max_reg_power = sc->max_reg_power; 2123 + qch->max_antenna_gain = sc->max_antenna_gain; 2124 + qch->beacon_found = sc->beacon_found; 2125 + qch->dfs_state = qlink_utils_dfs_state_cfg2q(sc->dfs_state); 2126 + qch->flags = cpu_to_le32(qlink_utils_chflags_cfg2q(sc->flags)); 2066 2127 } 2067 2128 2068 2129 static void qtnf_cmd_randmac_tlv_add(struct sk_buff *cmd_skb, ··· 2080 2139 2081 2140 memcpy(randmac->mac_addr, mac_addr, ETH_ALEN); 2082 2141 memcpy(randmac->mac_addr_mask, mac_addr_mask, ETH_ALEN); 2142 + } 2143 + 2144 + static void qtnf_cmd_scan_set_dwell(struct qtnf_wmac *mac, 2145 + struct sk_buff *cmd_skb) 2146 + { 2147 + struct cfg80211_scan_request *scan_req = mac->scan_req; 2148 + u16 dwell_active = QTNF_SCAN_DWELL_ACTIVE_DEFAULT; 2149 + u16 dwell_passive = QTNF_SCAN_DWELL_PASSIVE_DEFAULT; 2150 + u16 duration = QTNF_SCAN_SAMPLE_DURATION_DEFAULT; 2151 + 2152 + if (scan_req->duration) { 2153 + dwell_active = scan_req->duration; 2154 + dwell_passive = scan_req->duration; 2155 + } 2156 + 2157 + pr_debug("MAC%u: %s scan dwell active=%u, passive=%u, duration=%u\n", 2158 + mac->macid, 2159 + scan_req->duration_mandatory ? "mandatory" : "max", 2160 + dwell_active, dwell_passive, duration); 2161 + 2162 + qtnf_cmd_skb_put_tlv_u16(cmd_skb, 2163 + QTN_TLV_ID_SCAN_DWELL_ACTIVE, 2164 + dwell_active); 2165 + qtnf_cmd_skb_put_tlv_u16(cmd_skb, 2166 + QTN_TLV_ID_SCAN_DWELL_PASSIVE, 2167 + dwell_passive); 2168 + qtnf_cmd_skb_put_tlv_u16(cmd_skb, 2169 + QTN_TLV_ID_SCAN_SAMPLE_DURATION, 2170 + duration); 2083 2171 } 2084 2172 2085 2173 int qtnf_cmd_send_scan(struct qtnf_wmac *mac) ··· 2162 2192 } 2163 2193 } 2164 2194 2195 + qtnf_cmd_scan_set_dwell(mac, cmd_skb); 2196 + 2165 2197 if (scan_req->flags & NL80211_SCAN_FLAG_RANDOM_ADDR) { 2166 2198 pr_debug("MAC%u: scan with random addr=%pM, mask=%pM\n", 2167 2199 mac->macid, ··· 2177 2205 pr_debug("MAC%u: flush cache before scan\n", mac->macid); 2178 2206 2179 2207 qtnf_cmd_skb_put_tlv_tag(cmd_skb, QTN_TLV_ID_SCAN_FLUSH); 2180 - } 2181 - 2182 - if (scan_req->duration) { 2183 - pr_debug("MAC%u: %s scan duration %u\n", mac->macid, 2184 - scan_req->duration_mandatory ? "mandatory" : "max", 2185 - scan_req->duration); 2186 - 2187 - qtnf_cmd_skb_put_tlv_u16(cmd_skb, QTN_TLV_ID_SCAN_DWELL, 2188 - scan_req->duration); 2189 2208 } 2190 2209 2191 2210 ret = qtnf_cmd_send(mac->bus, cmd_skb); ··· 2367 2404 return ret; 2368 2405 } 2369 2406 2370 - int qtnf_cmd_reg_notify(struct qtnf_bus *bus, struct regulatory_request *req) 2407 + int qtnf_cmd_reg_notify(struct qtnf_wmac *mac, struct regulatory_request *req) 2371 2408 { 2409 + struct wiphy *wiphy = priv_to_wiphy(mac); 2410 + struct qtnf_bus *bus = mac->bus; 2372 2411 struct sk_buff *cmd_skb; 2373 2412 int ret; 2374 2413 struct qlink_cmd_reg_notify *cmd; 2414 + enum nl80211_band band; 2415 + const struct ieee80211_supported_band *cfg_band; 2375 2416 2376 - cmd_skb = qtnf_cmd_alloc_new_cmdskb(QLINK_MACID_RSVD, QLINK_VIFID_RSVD, 2417 + cmd_skb = qtnf_cmd_alloc_new_cmdskb(mac->macid, QLINK_VIFID_RSVD, 2377 2418 QLINK_CMD_REG_NOTIFY, 2378 2419 sizeof(*cmd)); 2379 2420 if (!cmd_skb) ··· 2414 2447 break; 2415 2448 } 2416 2449 2450 + switch (req->dfs_region) { 2451 + case NL80211_DFS_FCC: 2452 + cmd->dfs_region = QLINK_DFS_FCC; 2453 + break; 2454 + case NL80211_DFS_ETSI: 2455 + cmd->dfs_region = QLINK_DFS_ETSI; 2456 + break; 2457 + case NL80211_DFS_JP: 2458 + cmd->dfs_region = QLINK_DFS_JP; 2459 + break; 2460 + default: 2461 + cmd->dfs_region = QLINK_DFS_UNSET; 2462 + break; 2463 + } 2464 + 2465 + cmd->num_channels = 0; 2466 + 2467 + for (band = 0; band < NUM_NL80211_BANDS; band++) { 2468 + unsigned int i; 2469 + 2470 + cfg_band = wiphy->bands[band]; 2471 + if (!cfg_band) 2472 + continue; 2473 + 2474 + cmd->num_channels += cfg_band->n_channels; 2475 + 2476 + for (i = 0; i < cfg_band->n_channels; ++i) { 2477 + qtnf_cmd_channel_tlv_add(cmd_skb, 2478 + &cfg_band->channels[i]); 2479 + } 2480 + } 2481 + 2417 2482 qtnf_bus_lock(bus); 2418 2483 ret = qtnf_cmd_send(bus, cmd_skb); 2419 - if (ret) 2420 - goto out; 2421 - 2422 - out: 2423 2484 qtnf_bus_unlock(bus); 2424 2485 2425 2486 return ret; ··· 2587 2592 struct qtnf_bus *bus = vif->mac->bus; 2588 2593 struct sk_buff *cmd_skb; 2589 2594 struct qlink_tlv_hdr *tlv; 2590 - size_t acl_size = qtnf_cmd_acl_data_size(params); 2595 + size_t acl_size = struct_size(params, mac_addrs, params->n_acl_entries); 2591 2596 int ret; 2592 2597 2593 2598 cmd_skb = qtnf_cmd_alloc_new_cmdskb(vif->mac->macid, vif->vifid,
+3 -3
drivers/net/wireless/quantenna/qtnfmac/commands.h
··· 27 27 const struct cfg80211_ap_settings *s); 28 28 int qtnf_cmd_send_stop_ap(struct qtnf_vif *vif); 29 29 int qtnf_cmd_send_register_mgmt(struct qtnf_vif *vif, u16 frame_type, bool reg); 30 - int qtnf_cmd_send_mgmt_frame(struct qtnf_vif *vif, u32 cookie, u16 flags, 31 - u16 freq, const u8 *buf, size_t len); 30 + int qtnf_cmd_send_frame(struct qtnf_vif *vif, u32 cookie, u16 flags, 31 + u16 freq, const u8 *buf, size_t len); 32 32 int qtnf_cmd_send_mgmt_set_appie(struct qtnf_vif *vif, u8 frame_type, 33 33 const u8 *buf, size_t len); 34 34 int qtnf_cmd_get_sta_info(struct qtnf_vif *vif, const u8 *sta_mac, ··· 57 57 u16 reason_code); 58 58 int qtnf_cmd_send_updown_intf(struct qtnf_vif *vif, 59 59 bool up); 60 - int qtnf_cmd_reg_notify(struct qtnf_bus *bus, struct regulatory_request *req); 60 + int qtnf_cmd_reg_notify(struct qtnf_wmac *mac, struct regulatory_request *req); 61 61 int qtnf_cmd_get_chan_stats(struct qtnf_wmac *mac, u16 channel, 62 62 struct qtnf_chan_stats *stats); 63 63 int qtnf_cmd_send_chan_switch(struct qtnf_vif *vif,
+48 -8
drivers/net/wireless/quantenna/qtnfmac/core.c
··· 368 368 qtnf_mac_scan_finish(mac, true); 369 369 } 370 370 371 + static void qtnf_vif_send_data_high_pri(struct work_struct *work) 372 + { 373 + struct qtnf_vif *vif = 374 + container_of(work, struct qtnf_vif, high_pri_tx_work); 375 + struct sk_buff *skb; 376 + 377 + if (!vif->netdev || 378 + vif->wdev.iftype == NL80211_IFTYPE_UNSPECIFIED) 379 + return; 380 + 381 + while ((skb = skb_dequeue(&vif->high_pri_tx_queue))) { 382 + qtnf_cmd_send_frame(vif, 0, QLINK_FRAME_TX_FLAG_8023, 383 + 0, skb->data, skb->len); 384 + dev_kfree_skb_any(skb); 385 + } 386 + } 387 + 371 388 static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus, 372 389 unsigned int macid) 373 390 { ··· 412 395 vif->mac = mac; 413 396 vif->vifid = i; 414 397 qtnf_sta_list_init(&vif->sta_list); 415 - 398 + INIT_WORK(&vif->high_pri_tx_work, qtnf_vif_send_data_high_pri); 399 + skb_queue_head_init(&vif->high_pri_tx_queue); 416 400 vif->stats64 = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats); 417 401 if (!vif->stats64) 418 402 pr_warn("VIF%u.%u: per cpu stats allocation failed\n", ··· 517 499 qtnf_mac_iface_comb_free(mac); 518 500 qtnf_mac_ext_caps_free(mac); 519 501 kfree(mac->macinfo.wowlan); 502 + kfree(mac->rd); 503 + mac->rd = NULL; 520 504 wiphy_free(wiphy); 521 505 bus->mac[macid] = NULL; 522 506 } ··· 607 587 int ret; 608 588 609 589 qtnf_trans_init(bus); 610 - 611 - bus->fw_state = QTNF_FW_STATE_BOOT_DONE; 612 590 qtnf_bus_data_rx_start(bus); 613 591 614 592 bus->workqueue = alloc_ordered_workqueue("QTNF_BUS", 0); 615 593 if (!bus->workqueue) { 616 594 pr_err("failed to alloc main workqueue\n"); 595 + ret = -ENOMEM; 596 + goto error; 597 + } 598 + 599 + bus->hprio_workqueue = alloc_workqueue("QTNF_HPRI", WQ_HIGHPRI, 0); 600 + if (!bus->hprio_workqueue) { 601 + pr_err("failed to alloc high prio workqueue\n"); 617 602 ret = -ENOMEM; 618 603 goto error; 619 604 } ··· 632 607 } 633 608 634 609 bus->fw_state = QTNF_FW_STATE_ACTIVE; 635 - 636 610 ret = qtnf_cmd_get_hw_info(bus); 637 611 if (ret) { 638 612 pr_err("failed to get HW info: %d\n", ret); ··· 661 637 } 662 638 } 663 639 640 + bus->fw_state = QTNF_FW_STATE_RUNNING; 664 641 return 0; 665 642 666 643 error: 667 644 qtnf_core_detach(bus); 668 - 669 645 return ret; 670 646 } 671 647 EXPORT_SYMBOL_GPL(qtnf_core_attach); ··· 679 655 for (macid = 0; macid < QTNF_MAX_MAC; macid++) 680 656 qtnf_core_mac_detach(bus, macid); 681 657 682 - if (bus->fw_state == QTNF_FW_STATE_ACTIVE) 658 + if (qtnf_fw_is_up(bus)) 683 659 qtnf_cmd_send_deinit_fw(bus); 684 660 685 661 bus->fw_state = QTNF_FW_STATE_DETACHED; ··· 687 663 if (bus->workqueue) { 688 664 flush_workqueue(bus->workqueue); 689 665 destroy_workqueue(bus->workqueue); 666 + bus->workqueue = NULL; 690 667 } 691 668 692 - kfree(bus->hw_info.rd); 693 - bus->hw_info.rd = NULL; 669 + if (bus->hprio_workqueue) { 670 + flush_workqueue(bus->hprio_workqueue); 671 + destroy_workqueue(bus->hprio_workqueue); 672 + bus->hprio_workqueue = NULL; 673 + } 694 674 695 675 qtnf_trans_free(bus); 696 676 } ··· 711 683 struct net_device *ndev = NULL; 712 684 struct qtnf_wmac *mac; 713 685 struct qtnf_vif *vif; 686 + 687 + if (unlikely(bus->fw_state != QTNF_FW_STATE_RUNNING)) 688 + return NULL; 714 689 715 690 meta = (struct qtnf_frame_meta_info *) 716 691 (skb_tail_pointer(skb) - sizeof(*meta)); ··· 829 798 u64_stats_update_end(&stats64->syncp); 830 799 } 831 800 EXPORT_SYMBOL_GPL(qtnf_update_tx_stats); 801 + 802 + void qtnf_packet_send_hi_pri(struct sk_buff *skb) 803 + { 804 + struct qtnf_vif *vif = qtnf_netdev_get_priv(skb->dev); 805 + 806 + skb_queue_tail(&vif->high_pri_tx_queue, skb); 807 + queue_work(vif->mac->bus->hprio_workqueue, &vif->high_pri_tx_work); 808 + } 809 + EXPORT_SYMBOL_GPL(qtnf_packet_send_hi_pri); 832 810 833 811 MODULE_AUTHOR("Quantenna Communications"); 834 812 MODULE_DESCRIPTION("Quantenna 802.11 wireless LAN FullMAC driver.");
+4 -1
drivers/net/wireless/quantenna/qtnfmac/core.h
··· 63 63 struct qtnf_wmac *mac; 64 64 65 65 struct work_struct reset_work; 66 + struct work_struct high_pri_tx_work; 67 + struct sk_buff_head high_pri_tx_queue; 66 68 struct qtnf_sta_list sta_list; 67 69 unsigned long cons_tx_timeout_cnt; 68 70 int generation; ··· 114 112 struct cfg80211_scan_request *scan_req; 115 113 struct mutex mac_lock; /* lock during wmac speicific ops */ 116 114 struct delayed_work scan_timeout; 115 + struct ieee80211_regdomain *rd; 117 116 }; 118 117 119 118 struct qtnf_hw_info { ··· 123 120 u8 mac_bitmap; 124 121 u32 fw_ver; 125 122 u32 hw_capab; 126 - struct ieee80211_regdomain *rd; 127 123 u8 total_tx_chain; 128 124 u8 total_rx_chain; 129 125 char fw_version[ETHTOOL_FWVERS_LEN]; ··· 151 149 152 150 void qtnf_netdev_updown(struct net_device *ndev, bool up); 153 151 void qtnf_scan_done(struct qtnf_wmac *mac, bool aborted); 152 + void qtnf_packet_send_hi_pri(struct sk_buff *skb); 154 153 155 154 static inline struct qtnf_vif *qtnf_netdev_get_priv(struct net_device *dev) 156 155 {
+11 -21
drivers/net/wireless/quantenna/qtnfmac/pcie/pcie.c
··· 56 56 57 57 if (ret == -ETIMEDOUT) { 58 58 pr_err("EP firmware is dead\n"); 59 - bus->fw_state = QTNF_FW_STATE_EP_DEAD; 59 + bus->fw_state = QTNF_FW_STATE_DEAD; 60 60 } 61 61 62 62 return ret; ··· 128 128 return 0; 129 129 } 130 130 131 - void qtnf_pcie_fw_boot_done(struct qtnf_bus *bus, bool boot_success) 131 + int qtnf_pcie_fw_boot_done(struct qtnf_bus *bus) 132 132 { 133 - struct qtnf_pcie_bus_priv *priv = get_bus_priv(bus); 134 - struct pci_dev *pdev = priv->pdev; 135 133 int ret; 136 134 137 - if (boot_success) { 138 - bus->fw_state = QTNF_FW_STATE_FW_DNLD_DONE; 139 - 140 - ret = qtnf_core_attach(bus); 141 - if (ret) { 142 - pr_err("failed to attach core\n"); 143 - boot_success = false; 144 - } 145 - } 146 - 147 - if (boot_success) { 135 + bus->fw_state = QTNF_FW_STATE_BOOT_DONE; 136 + ret = qtnf_core_attach(bus); 137 + if (ret) { 138 + pr_err("failed to attach core\n"); 139 + } else { 148 140 qtnf_debugfs_init(bus, DRV_NAME); 149 141 qtnf_debugfs_add_entry(bus, "mps", qtnf_dbg_mps_show); 150 142 qtnf_debugfs_add_entry(bus, "msi_enabled", qtnf_dbg_msi_show); 151 143 qtnf_debugfs_add_entry(bus, "shm_stats", qtnf_dbg_shm_stats); 152 - } else { 153 - bus->fw_state = QTNF_FW_STATE_DETACHED; 154 144 } 155 145 156 - put_device(&pdev->dev); 146 + return ret; 157 147 } 158 148 159 149 static void qtnf_tune_pcie_mps(struct pci_dev *pdev) ··· 334 344 pcie_priv = get_bus_priv(bus); 335 345 pci_set_drvdata(pdev, bus); 336 346 bus->dev = &pdev->dev; 337 - bus->fw_state = QTNF_FW_STATE_RESET; 347 + bus->fw_state = QTNF_FW_STATE_DETACHED; 338 348 pcie_priv->pdev = pdev; 339 349 pcie_priv->tx_stopped = 0; 340 350 pcie_priv->rx_bd_num = rx_bd_size_param; ··· 354 364 pcie_priv->pcie_irq_count = 0; 355 365 pcie_priv->tx_reclaim_done = 0; 356 366 pcie_priv->tx_reclaim_req = 0; 367 + pcie_priv->tx_eapol = 0; 357 368 358 369 pcie_priv->workqueue = create_singlethread_workqueue("QTNF_PCIE"); 359 370 if (!pcie_priv->workqueue) { ··· 410 419 411 420 cancel_work_sync(&bus->fw_work); 412 421 413 - if (bus->fw_state == QTNF_FW_STATE_ACTIVE || 414 - bus->fw_state == QTNF_FW_STATE_EP_DEAD) 422 + if (qtnf_fw_is_attached(bus)) 415 423 qtnf_core_detach(bus); 416 424 417 425 netif_napi_del(&bus->mux_napi);
+2 -1
drivers/net/wireless/quantenna/qtnfmac/pcie/pcie_priv.h
··· 62 62 u32 tx_done_count; 63 63 u32 tx_reclaim_done; 64 64 u32 tx_reclaim_req; 65 + u32 tx_eapol; 65 66 66 67 u8 msi_enabled; 67 68 u8 tx_stopped; ··· 71 70 72 71 int qtnf_pcie_control_tx(struct qtnf_bus *bus, struct sk_buff *skb); 73 72 int qtnf_pcie_alloc_skb_array(struct qtnf_pcie_bus_priv *priv); 74 - void qtnf_pcie_fw_boot_done(struct qtnf_bus *bus, bool boot_success); 73 + int qtnf_pcie_fw_boot_done(struct qtnf_bus *bus); 75 74 void qtnf_pcie_init_shm_ipc(struct qtnf_pcie_bus_priv *priv, 76 75 struct qtnf_shm_ipc_region __iomem *ipc_tx_reg, 77 76 struct qtnf_shm_ipc_region __iomem *ipc_rx_reg,
+11 -12
drivers/net/wireless/quantenna/qtnfmac/pcie/pearl_pcie.c
··· 980 980 { 981 981 struct qtnf_bus *bus = container_of(work, struct qtnf_bus, fw_work); 982 982 struct qtnf_pcie_pearl_state *ps = (void *)get_bus_priv(bus); 983 + u32 state = QTN_RC_FW_LOADRDY | QTN_RC_FW_QLINK; 984 + const char *fwname = QTN_PCI_PEARL_FW_NAME; 983 985 struct pci_dev *pdev = ps->base.pdev; 984 986 const struct firmware *fw; 985 987 int ret; 986 - u32 state = QTN_RC_FW_LOADRDY | QTN_RC_FW_QLINK; 987 - const char *fwname = QTN_PCI_PEARL_FW_NAME; 988 - bool fw_boot_success = false; 989 988 990 989 if (ps->base.flashboot) { 991 990 state |= QTN_RC_FW_FLASHBOOT; ··· 1030 1031 goto fw_load_exit; 1031 1032 } 1032 1033 1033 - pr_info("firmware is up and running\n"); 1034 - 1035 1034 if (qtnf_poll_state(&ps->bda->bda_ep_state, 1036 1035 QTN_EP_FW_QLINK_DONE, QTN_FW_QLINK_TIMEOUT_MS)) { 1037 1036 pr_err("firmware runtime failure\n"); 1038 1037 goto fw_load_exit; 1039 1038 } 1040 1039 1041 - fw_boot_success = true; 1040 + pr_info("firmware is up and running\n"); 1041 + 1042 + ret = qtnf_pcie_fw_boot_done(bus); 1043 + if (ret) 1044 + goto fw_load_exit; 1045 + 1046 + qtnf_debugfs_add_entry(bus, "hdp_stats", qtnf_dbg_hdp_stats); 1047 + qtnf_debugfs_add_entry(bus, "irq_stats", qtnf_dbg_irq_stats); 1042 1048 1043 1049 fw_load_exit: 1044 - qtnf_pcie_fw_boot_done(bus, fw_boot_success); 1045 - 1046 - if (fw_boot_success) { 1047 - qtnf_debugfs_add_entry(bus, "hdp_stats", qtnf_dbg_hdp_stats); 1048 - qtnf_debugfs_add_entry(bus, "irq_stats", qtnf_dbg_irq_stats); 1049 - } 1050 + put_device(&pdev->dev); 1050 1051 } 1051 1052 1052 1053 static void qtnf_pearl_reclaim_tasklet_fn(unsigned long data)
+22 -9
drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
··· 498 498 int len; 499 499 int i; 500 500 501 + if (unlikely(skb->protocol == htons(ETH_P_PAE))) { 502 + qtnf_packet_send_hi_pri(skb); 503 + qtnf_update_tx_stats(skb->dev, skb); 504 + priv->tx_eapol++; 505 + return NETDEV_TX_OK; 506 + } 507 + 501 508 spin_lock_irqsave(&priv->tx_lock, flags); 502 509 503 510 if (!qtnf_tx_queue_ready(ts)) { ··· 768 761 seq_printf(s, "tx_done_count(%u)\n", priv->tx_done_count); 769 762 seq_printf(s, "tx_reclaim_done(%u)\n", priv->tx_reclaim_done); 770 763 seq_printf(s, "tx_reclaim_req(%u)\n", priv->tx_reclaim_req); 764 + seq_printf(s, "tx_eapol(%u)\n", priv->tx_eapol); 771 765 772 766 seq_printf(s, "tx_bd_r_index(%u)\n", priv->tx_bd_r_index); 773 767 seq_printf(s, "tx_done_index(%u)\n", tx_done_index); ··· 1031 1023 { 1032 1024 struct qtnf_bus *bus = container_of(work, struct qtnf_bus, fw_work); 1033 1025 struct qtnf_pcie_topaz_state *ts = (void *)get_bus_priv(bus); 1034 - int ret; 1035 1026 int bootloader_needed = readl(&ts->bda->bda_flags) & QTN_BDA_XMIT_UBOOT; 1027 + struct pci_dev *pdev = ts->base.pdev; 1028 + int ret; 1036 1029 1037 1030 qtnf_set_state(&ts->bda->bda_bootstate, QTN_BDA_FW_TARGET_BOOT); 1038 1031 ··· 1082 1073 } 1083 1074 } 1084 1075 1076 + ret = qtnf_post_init_ep(ts); 1077 + if (ret) { 1078 + pr_err("FW runtime failure\n"); 1079 + goto fw_load_exit; 1080 + } 1081 + 1085 1082 pr_info("firmware is up and running\n"); 1086 1083 1087 - ret = qtnf_post_init_ep(ts); 1084 + ret = qtnf_pcie_fw_boot_done(bus); 1088 1085 if (ret) 1089 - pr_err("FW runtime failure\n"); 1086 + goto fw_load_exit; 1087 + 1088 + qtnf_debugfs_add_entry(bus, "pkt_stats", qtnf_dbg_pkt_stats); 1089 + qtnf_debugfs_add_entry(bus, "irq_stats", qtnf_dbg_irq_stats); 1090 1090 1091 1091 fw_load_exit: 1092 - qtnf_pcie_fw_boot_done(bus, ret ? false : true); 1093 - 1094 - if (ret == 0) { 1095 - qtnf_debugfs_add_entry(bus, "pkt_stats", qtnf_dbg_pkt_stats); 1096 - qtnf_debugfs_add_entry(bus, "irq_stats", qtnf_dbg_irq_stats); 1097 - } 1092 + put_device(&pdev->dev); 1098 1093 } 1099 1094 1100 1095 static void qtnf_reclaim_tasklet_fn(unsigned long data)
+54 -31
drivers/net/wireless/quantenna/qtnfmac/qlink.h
··· 6 6 7 7 #include <linux/ieee80211.h> 8 8 9 - #define QLINK_PROTO_VER 13 9 + #define QLINK_PROTO_VER 15 10 10 11 11 #define QLINK_MACID_RSVD 0xFF 12 12 #define QLINK_VIFID_RSVD 0xFF ··· 206 206 * execution status (one of &enum qlink_cmd_result). Reply message 207 207 * may also contain data payload specific to the command type. 208 208 * 209 + * @QLINK_CMD_SEND_FRAME: send specified frame over the air; firmware will 210 + * encapsulate 802.3 packet into 802.11 frame automatically. 209 211 * @QLINK_CMD_BAND_INFO_GET: for the specified MAC and specified band, get 210 212 * the band's description including number of operational channels and 211 213 * info on each channel, HT/VHT capabilities, supported rates etc. ··· 222 220 QLINK_CMD_FW_INIT = 0x0001, 223 221 QLINK_CMD_FW_DEINIT = 0x0002, 224 222 QLINK_CMD_REGISTER_MGMT = 0x0003, 225 - QLINK_CMD_SEND_MGMT_FRAME = 0x0004, 223 + QLINK_CMD_SEND_FRAME = 0x0004, 226 224 QLINK_CMD_MGMT_SET_APPIE = 0x0005, 227 225 QLINK_CMD_PHY_PARAMS_GET = 0x0011, 228 226 QLINK_CMD_PHY_PARAMS_SET = 0x0012, ··· 323 321 u8 do_register; 324 322 } __packed; 325 323 326 - enum qlink_mgmt_frame_tx_flags { 327 - QLINK_MGMT_FRAME_TX_FLAG_NONE = 0, 328 - QLINK_MGMT_FRAME_TX_FLAG_OFFCHAN = BIT(0), 329 - QLINK_MGMT_FRAME_TX_FLAG_NO_CCK = BIT(1), 330 - QLINK_MGMT_FRAME_TX_FLAG_ACK_NOWAIT = BIT(2), 324 + /** 325 + * @QLINK_FRAME_TX_FLAG_8023: frame has a 802.3 header; if not set, frame 326 + * is a 802.11 encapsulated. 327 + */ 328 + enum qlink_frame_tx_flags { 329 + QLINK_FRAME_TX_FLAG_OFFCHAN = BIT(0), 330 + QLINK_FRAME_TX_FLAG_NO_CCK = BIT(1), 331 + QLINK_FRAME_TX_FLAG_ACK_NOWAIT = BIT(2), 332 + QLINK_FRAME_TX_FLAG_8023 = BIT(3), 331 333 }; 332 334 333 335 /** 334 - * struct qlink_cmd_mgmt_frame_tx - data for QLINK_CMD_SEND_MGMT_FRAME command 336 + * struct qlink_cmd_frame_tx - data for QLINK_CMD_SEND_FRAME command 335 337 * 336 338 * @cookie: opaque request identifier. 337 339 * @freq: Frequency to use for frame transmission. 338 - * @flags: Transmission flags, one of &enum qlink_mgmt_frame_tx_flags. 340 + * @flags: Transmission flags, one of &enum qlink_frame_tx_flags. 339 341 * @frame_data: frame to transmit. 340 342 */ 341 - struct qlink_cmd_mgmt_frame_tx { 343 + struct qlink_cmd_frame_tx { 342 344 struct qlink_cmd chdr; 343 345 __le32 cookie; 344 346 __le16 freq; ··· 586 580 * @initiator: which entity sent the request, one of &enum qlink_reg_initiator. 587 581 * @user_reg_hint_type: type of hint for QLINK_REGDOM_SET_BY_USER request, one 588 582 * of &enum qlink_user_reg_hint_type. 583 + * @num_channels: number of &struct qlink_tlv_channel in a variable portion of a 584 + * payload. 585 + * @dfs_region: one of &enum qlink_dfs_regions. 586 + * @info: variable portion of regulatory notifier callback. 589 587 */ 590 588 struct qlink_cmd_reg_notify { 591 589 struct qlink_cmd chdr; 592 590 u8 alpha2[2]; 593 591 u8 initiator; 594 592 u8 user_reg_hint_type; 593 + u8 num_channels; 594 + u8 dfs_region; 595 + u8 rsvd[2]; 596 + u8 info[0]; 595 597 } __packed; 596 598 597 599 /** ··· 779 765 } __packed; 780 766 781 767 /** 768 + * enum qlink_dfs_regions - regulatory DFS regions 769 + * 770 + * Corresponds to &enum nl80211_dfs_regions. 771 + */ 772 + enum qlink_dfs_regions { 773 + QLINK_DFS_UNSET = 0, 774 + QLINK_DFS_FCC = 1, 775 + QLINK_DFS_ETSI = 2, 776 + QLINK_DFS_JP = 3, 777 + }; 778 + 779 + /** 782 780 * struct qlink_resp_get_mac_info - response for QLINK_CMD_MAC_INFO command 783 781 * 784 782 * Data describing specific physical device providing wireless MAC ··· 805 779 * @bands_cap: wireless bands WMAC can operate in, bitmap of &enum qlink_band. 806 780 * @max_ap_assoc_sta: Maximum number of associations supported by WMAC. 807 781 * @radar_detect_widths: bitmask of channels BW for which WMAC can detect radar. 782 + * @alpha2: country code ID firmware is configured to. 783 + * @n_reg_rules: number of regulatory rules TLVs in variable portion of the 784 + * message. 785 + * @dfs_region: regulatory DFS region, one of &enum qlink_dfs_regions. 808 786 * @var_info: variable-length WMAC info data. 809 787 */ 810 788 struct qlink_resp_get_mac_info { ··· 822 792 __le16 radar_detect_widths; 823 793 __le32 max_acl_mac_addrs; 824 794 u8 bands_cap; 795 + u8 alpha2[2]; 796 + u8 n_reg_rules; 797 + u8 dfs_region; 825 798 u8 rsvd[1]; 826 799 u8 var_info[0]; 827 800 } __packed; 828 - 829 - /** 830 - * enum qlink_dfs_regions - regulatory DFS regions 831 - * 832 - * Corresponds to &enum nl80211_dfs_regions. 833 - */ 834 - enum qlink_dfs_regions { 835 - QLINK_DFS_UNSET = 0, 836 - QLINK_DFS_FCC = 1, 837 - QLINK_DFS_ETSI = 2, 838 - QLINK_DFS_JP = 3, 839 - }; 840 801 841 802 /** 842 803 * struct qlink_resp_get_hw_info - response for QLINK_CMD_GET_HW_INFO command ··· 841 820 * @mac_bitmap: Bitmap of MAC IDs that are active and can be used in firmware. 842 821 * @total_tx_chains: total number of transmit chains used by device. 843 822 * @total_rx_chains: total number of receive chains. 844 - * @alpha2: country code ID firmware is configured to. 845 - * @n_reg_rules: number of regulatory rules TLVs in variable portion of the 846 - * message. 847 - * @dfs_region: regulatory DFS region, one of @enum qlink_dfs_region. 848 - * @info: variable-length HW info, can contain QTN_TLV_ID_REG_RULE. 823 + * @info: variable-length HW info. 849 824 */ 850 825 struct qlink_resp_get_hw_info { 851 826 struct qlink_resp rhdr; ··· 855 838 u8 mac_bitmap; 856 839 u8 total_tx_chain; 857 840 u8 total_rx_chain; 858 - u8 alpha2[2]; 859 - u8 n_reg_rules; 860 - u8 dfs_region; 861 841 u8 info[0]; 862 842 } __packed; 863 843 ··· 1162 1148 * carried by QTN_TLV_ID_STA_STATS_MAP. 1163 1149 * @QTN_TLV_ID_MAX_SCAN_SSIDS: maximum number of SSIDs the device can scan 1164 1150 * for in any given scan. 1151 + * @QTN_TLV_ID_SCAN_DWELL_ACTIVE: time spent on a single channel for an active 1152 + * scan. 1153 + * @QTN_TLV_ID_SCAN_DWELL_PASSIVE: time spent on a single channel for a passive 1154 + * scan. 1155 + * @QTN_TLV_ID_SCAN_SAMPLE_DURATION: total duration of sampling a single channel 1156 + * during a scan including off-channel dwell time and operating channel 1157 + * time. 1165 1158 */ 1166 1159 enum qlink_tlv_id { 1167 1160 QTN_TLV_ID_FRAG_THRESH = 0x0201, ··· 1201 1180 QTN_TLV_ID_WOWLAN_CAPAB = 0x0410, 1202 1181 QTN_TLV_ID_WOWLAN_PATTERN = 0x0411, 1203 1182 QTN_TLV_ID_SCAN_FLUSH = 0x0412, 1204 - QTN_TLV_ID_SCAN_DWELL = 0x0413, 1183 + QTN_TLV_ID_SCAN_DWELL_ACTIVE = 0x0413, 1184 + QTN_TLV_ID_SCAN_DWELL_PASSIVE = 0x0416, 1185 + QTN_TLV_ID_SCAN_SAMPLE_DURATION = 0x0417, 1205 1186 }; 1206 1187 1207 1188 struct qlink_tlv_hdr {
+5
drivers/net/wireless/realtek/rtlwifi/base.c
··· 448 448 /* <2> work queue */ 449 449 rtlpriv->works.hw = hw; 450 450 rtlpriv->works.rtl_wq = alloc_workqueue("%s", 0, 0, rtlpriv->cfg->name); 451 + if (unlikely(!rtlpriv->works.rtl_wq)) { 452 + pr_err("Failed to allocate work queue\n"); 453 + return; 454 + } 455 + 451 456 INIT_DELAYED_WORK(&rtlpriv->works.watchdog_wq, 452 457 (void *)rtl_watchdog_wq_callback); 453 458 INIT_DELAYED_WORK(&rtlpriv->works.ips_nic_off_wq,
+3 -3
drivers/net/wireless/realtek/rtlwifi/pci.c
··· 499 499 500 500 memset(&tcb_desc, 0, sizeof(struct rtl_tcb_desc)); 501 501 502 - spin_lock_bh(&rtlpriv->locks.waitq_lock); 502 + spin_lock(&rtlpriv->locks.waitq_lock); 503 503 if (!skb_queue_empty(&mac->skb_waitq[tid]) && 504 504 (ring->entries - skb_queue_len(&ring->queue) > 505 505 rtlhal->max_earlymode_num)) { 506 506 skb = skb_dequeue(&mac->skb_waitq[tid]); 507 507 } else { 508 - spin_unlock_bh(&rtlpriv->locks.waitq_lock); 508 + spin_unlock(&rtlpriv->locks.waitq_lock); 509 509 break; 510 510 } 511 - spin_unlock_bh(&rtlpriv->locks.waitq_lock); 511 + spin_unlock(&rtlpriv->locks.waitq_lock); 512 512 513 513 /* Some macaddr can't do early mode. like 514 514 * multicast/broadcast/no_qos data
+2
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
··· 600 600 u1rsvdpageloc, 3); 601 601 602 602 skb = dev_alloc_skb(totalpacketlen); 603 + if (!skb) 604 + return; 603 605 skb_put_data(skb, &reserved_page_packet, totalpacketlen); 604 606 605 607 rtstatus = rtl_cmd_send_packet(hw, skb);
+9 -8
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c
··· 372 372 struct rtl_priv *rtlpriv = rtl_priv(hw); 373 373 struct rx_fwinfo_88e *p_drvinfo; 374 374 struct ieee80211_hdr *hdr; 375 - 375 + u8 wake_match; 376 376 u32 phystatus = GET_RX_DESC_PHYST(pdesc); 377 + 377 378 status->packet_report_type = (u8)GET_RX_STATUS_DESC_RPT_SEL(pdesc); 378 379 if (status->packet_report_type == TX_REPORT2) 379 380 status->length = (u16)GET_RX_RPT2_DESC_PKT_LEN(pdesc); ··· 400 399 status->is_cck = RTL8188_RX_HAL_IS_CCK_RATE(status->rate); 401 400 402 401 status->macid = GET_RX_DESC_MACID(pdesc); 403 - if (GET_RX_STATUS_DESC_MAGIC_MATCH(pdesc)) 404 - status->wake_match = BIT(2); 402 + if (GET_RX_STATUS_DESC_PATTERN_MATCH(pdesc)) 403 + wake_match = BIT(2); 405 404 else if (GET_RX_STATUS_DESC_MAGIC_MATCH(pdesc)) 406 - status->wake_match = BIT(1); 405 + wake_match = BIT(1); 407 406 else if (GET_RX_STATUS_DESC_UNICAST_MATCH(pdesc)) 408 - status->wake_match = BIT(0); 407 + wake_match = BIT(0); 409 408 else 410 - status->wake_match = 0; 411 - if (status->wake_match) 409 + wake_match = 0; 410 + if (wake_match) 412 411 RT_TRACE(rtlpriv, COMP_RXDESC, DBG_LOUD, 413 412 "GGGGGGGGGGGGGet Wakeup Packet!! WakeMatch=%d\n", 414 - status->wake_match); 413 + wake_match); 415 414 rx_status->freq = hw->conf.chandef.chan->center_freq; 416 415 rx_status->band = hw->conf.chandef.chan->band; 417 416
+2
drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
··· 623 623 u1rsvdpageloc, 3); 624 624 625 625 skb = dev_alloc_skb(totalpacketlen); 626 + if (!skb) 627 + return; 626 628 skb_put_data(skb, &reserved_page_packet, totalpacketlen); 627 629 628 630 if (cmd_send_packet)
+2
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
··· 744 744 u1rsvdpageloc, 3); 745 745 746 746 skb = dev_alloc_skb(totalpacketlen); 747 + if (!skb) 748 + return; 747 749 skb_put_data(skb, &reserved_page_packet, totalpacketlen); 748 750 749 751 rtstatus = rtl_cmd_send_packet(hw, skb);
+8 -7
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
··· 331 331 struct rx_fwinfo *p_drvinfo; 332 332 struct ieee80211_hdr *hdr; 333 333 u32 phystatus = GET_RX_DESC_PHYST(pdesc); 334 + u8 wake_match; 334 335 335 336 if (GET_RX_STATUS_DESC_RPT_SEL(pdesc) == 0) 336 337 status->packet_report_type = NORMAL_RX; ··· 351 350 status->is_cck = RTL92EE_RX_HAL_IS_CCK_RATE(status->rate); 352 351 353 352 status->macid = GET_RX_DESC_MACID(pdesc); 354 - if (GET_RX_STATUS_DESC_MAGIC_MATCH(pdesc)) 355 - status->wake_match = BIT(2); 353 + if (GET_RX_STATUS_DESC_PATTERN_MATCH(pdesc)) 354 + wake_match = BIT(2); 356 355 else if (GET_RX_STATUS_DESC_MAGIC_MATCH(pdesc)) 357 - status->wake_match = BIT(1); 356 + wake_match = BIT(1); 358 357 else if (GET_RX_STATUS_DESC_UNICAST_MATCH(pdesc)) 359 - status->wake_match = BIT(0); 358 + wake_match = BIT(0); 360 359 else 361 - status->wake_match = 0; 362 - if (status->wake_match) 360 + wake_match = 0; 361 + if (wake_match) 363 362 RT_TRACE(rtlpriv, COMP_RXDESC, DBG_LOUD, 364 363 "GGGGGGGGGGGGGet Wakeup Packet!! WakeMatch=%d\n", 365 - status->wake_match); 364 + wake_match); 366 365 rx_status->freq = hw->conf.chandef.chan->center_freq; 367 366 rx_status->band = hw->conf.chandef.chan->band; 368 367
+1 -1
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/dm.c
··· 663 663 664 664 } 665 665 666 - void rtl8723e_dm_refresh_rate_adaptive_mask(struct ieee80211_hw *hw) 666 + static void rtl8723e_dm_refresh_rate_adaptive_mask(struct ieee80211_hw *hw) 667 667 { 668 668 struct rtl_priv *rtlpriv = rtl_priv(hw); 669 669 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
+2
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
··· 448 448 u1rsvdpageloc, 3); 449 449 450 450 skb = dev_alloc_skb(totalpacketlen); 451 + if (!skb) 452 + return; 451 453 skb_put_data(skb, &reserved_page_packet, totalpacketlen); 452 454 453 455 rtstatus = rtl_cmd_send_packet(hw, skb);
+2
drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
··· 562 562 u1rsvdpageloc, sizeof(u1rsvdpageloc)); 563 563 564 564 skb = dev_alloc_skb(totalpacketlen); 565 + if (!skb) 566 + return; 565 567 skb_put_data(skb, &reserved_page_packet, totalpacketlen); 566 568 567 569 rtstatus = rtl_cmd_send_packet(hw, skb);
+8 -8
drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.c
··· 300 300 struct rtl_priv *rtlpriv = rtl_priv(hw); 301 301 struct rx_fwinfo_8723be *p_drvinfo; 302 302 struct ieee80211_hdr *hdr; 303 - 303 + u8 wake_match; 304 304 u32 phystatus = GET_RX_DESC_PHYST(pdesc); 305 305 306 306 status->length = (u16)GET_RX_DESC_PKT_LEN(pdesc); ··· 329 329 status->packet_report_type = NORMAL_RX; 330 330 331 331 332 - if (GET_RX_STATUS_DESC_MAGIC_MATCH(pdesc)) 333 - status->wake_match = BIT(2); 332 + if (GET_RX_STATUS_DESC_PATTERN_MATCH(pdesc)) 333 + wake_match = BIT(2); 334 334 else if (GET_RX_STATUS_DESC_MAGIC_MATCH(pdesc)) 335 - status->wake_match = BIT(1); 335 + wake_match = BIT(1); 336 336 else if (GET_RX_STATUS_DESC_UNICAST_MATCH(pdesc)) 337 - status->wake_match = BIT(0); 337 + wake_match = BIT(0); 338 338 else 339 - status->wake_match = 0; 340 - if (status->wake_match) 339 + wake_match = 0; 340 + if (wake_match) 341 341 RT_TRACE(rtlpriv, COMP_RXDESC, DBG_LOUD, 342 342 "GGGGGGGGGGGGGet Wakeup Packet!! WakeMatch=%d\n", 343 - status->wake_match); 343 + wake_match); 344 344 rx_status->freq = hw->conf.chandef.chan->center_freq; 345 345 rx_status->band = hw->conf.chandef.chan->band; 346 346
+4
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
··· 1623 1623 &reserved_page_packet_8812[0], totalpacketlen); 1624 1624 1625 1625 skb = dev_alloc_skb(totalpacketlen); 1626 + if (!skb) 1627 + return; 1626 1628 skb_put_data(skb, &reserved_page_packet_8812, totalpacketlen); 1627 1629 1628 1630 rtstatus = rtl_cmd_send_packet(hw, skb); ··· 1761 1759 &reserved_page_packet_8821[0], totalpacketlen); 1762 1760 1763 1761 skb = dev_alloc_skb(totalpacketlen); 1762 + if (!skb) 1763 + return; 1764 1764 skb_put_data(skb, &reserved_page_packet_8821, totalpacketlen); 1765 1765 1766 1766 rtstatus = rtl_cmd_send_packet(hw, skb);
+7 -7
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c
··· 436 436 struct rtl_priv *rtlpriv = rtl_priv(hw); 437 437 struct rx_fwinfo_8821ae *p_drvinfo; 438 438 struct ieee80211_hdr *hdr; 439 - 439 + u8 wake_match; 440 440 u32 phystatus = GET_RX_DESC_PHYST(pdesc); 441 441 442 442 status->length = (u16)GET_RX_DESC_PKT_LEN(pdesc); ··· 473 473 status->packet_report_type = NORMAL_RX; 474 474 475 475 if (GET_RX_STATUS_DESC_PATTERN_MATCH(pdesc)) 476 - status->wake_match = BIT(2); 476 + wake_match = BIT(2); 477 477 else if (GET_RX_STATUS_DESC_MAGIC_MATCH(pdesc)) 478 - status->wake_match = BIT(1); 478 + wake_match = BIT(1); 479 479 else if (GET_RX_STATUS_DESC_UNICAST_MATCH(pdesc)) 480 - status->wake_match = BIT(0); 480 + wake_match = BIT(0); 481 481 else 482 - status->wake_match = 0; 482 + wake_match = 0; 483 483 484 - if (status->wake_match) 484 + if (wake_match) 485 485 RT_TRACE(rtlpriv, COMP_RXDESC, DBG_LOUD, 486 486 "GGGGGGGGGGGGGet Wakeup Packet!! WakeMatch=%d\n", 487 - status->wake_match); 487 + wake_match); 488 488 rx_status->freq = hw->conf.chandef.chan->center_freq; 489 489 rx_status->band = hw->conf.chandef.chan->band; 490 490
-1
drivers/net/wireless/realtek/rtlwifi/wifi.h
··· 2138 2138 u8 packet_report_type; 2139 2139 2140 2140 u32 macid; 2141 - u8 wake_match; 2142 2141 u32 bt_rx_rssi_percentage; 2143 2142 u32 macid_valid_entry[2]; 2144 2143 };