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

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

Kalle Valo says:

====================
wireless-drivers-next patches for 5.1

First set of patches for 5.1. Lots of new features in various drivers
but nothing really special standing out.

Major changes:

brcmfmac

* DMI nvram filename quirk for PoV TAB-P1006W-232 tablet

rsi

* support for hardware scan offload

iwlwifi

* support for Target Wakeup Time (TWT) -- a feature that allows the AP
to specify when individual stations can access the medium

* support for mac80211 AMSDU handling

* some new PCI IDs

* relicense the pcie submodule to dual GPL/BSD

* reworked the TOF/CSI (channel estimation matrix) implementation

* Some product name updates in the human-readable strings

mt76

* energy detect regulatory compliance fixes

* preparation for MT7603 support

* channel switch announcement support

mwifiex

* support for sd8977 chipset

qtnfmac

* support for 4addr mode

* convert to SPDX license identifiers
====================

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

+4087 -3931
+4 -5
drivers/bcma/bcma_private.h
··· 10 10 #include <linux/delay.h> 11 11 12 12 #define bcma_err(bus, fmt, ...) \ 13 - pr_err("bus%d: " fmt, (bus)->num, ##__VA_ARGS__) 13 + dev_err((bus)->dev, "bus%d: " fmt, (bus)->num, ##__VA_ARGS__) 14 14 #define bcma_warn(bus, fmt, ...) \ 15 - pr_warn("bus%d: " fmt, (bus)->num, ##__VA_ARGS__) 15 + dev_warn((bus)->dev, "bus%d: " fmt, (bus)->num, ##__VA_ARGS__) 16 16 #define bcma_info(bus, fmt, ...) \ 17 - pr_info("bus%d: " fmt, (bus)->num, ##__VA_ARGS__) 17 + dev_info((bus)->dev, "bus%d: " fmt, (bus)->num, ##__VA_ARGS__) 18 18 #define bcma_debug(bus, fmt, ...) \ 19 - pr_debug("bus%d: " fmt, (bus)->num, ##__VA_ARGS__) 19 + dev_dbg((bus)->dev, "bus%d: " fmt, (bus)->num, ##__VA_ARGS__) 20 20 21 21 struct bcma_bus; 22 22 ··· 33 33 int bcma_bus_suspend(struct bcma_bus *bus); 34 34 int bcma_bus_resume(struct bcma_bus *bus); 35 35 #endif 36 - struct device *bcma_bus_get_host_dev(struct bcma_bus *bus); 37 36 38 37 /* scan.c */ 39 38 void bcma_detect_chip(struct bcma_bus *bus);
+1 -1
drivers/bcma/driver_gpio.c
··· 183 183 chip->direction_input = bcma_gpio_direction_input; 184 184 chip->direction_output = bcma_gpio_direction_output; 185 185 chip->owner = THIS_MODULE; 186 - chip->parent = bcma_bus_get_host_dev(bus); 186 + chip->parent = bus->dev; 187 187 #if IS_BUILTIN(CONFIG_OF) 188 188 chip->of_node = cc->core->dev.of_node; 189 189 #endif
+2
drivers/bcma/host_pci.c
··· 196 196 goto err_pci_release_regions; 197 197 } 198 198 199 + bus->dev = &dev->dev; 200 + 199 201 /* Map MMIO */ 200 202 err = -ENOMEM; 201 203 bus->mmio = pci_iomap(dev, 0, ~0UL);
+2 -2
drivers/bcma/host_soc.c
··· 179 179 /* Host specific */ 180 180 bus->hosttype = BCMA_HOSTTYPE_SOC; 181 181 bus->ops = &bcma_host_soc_ops; 182 - bus->host_pdev = NULL; 183 182 184 183 /* Initialize struct, detect chip */ 185 184 bcma_init_bus(bus); ··· 212 213 if (!bus) 213 214 return -ENOMEM; 214 215 216 + bus->dev = dev; 217 + 215 218 /* Map MMIO */ 216 219 bus->mmio = of_iomap(np, 0); 217 220 if (!bus->mmio) ··· 222 221 /* Host specific */ 223 222 bus->hosttype = BCMA_HOSTTYPE_SOC; 224 223 bus->ops = &bcma_host_soc_ops; 225 - bus->host_pdev = pdev; 226 224 227 225 /* Initialize struct, detect chip */ 228 226 bcma_init_bus(bus);
+10 -35
drivers/bcma/main.c
··· 223 223 mips_irq = bcma_core_mips_irq(core); 224 224 return mips_irq <= 4 ? mips_irq + 2 : 0; 225 225 } 226 - if (bus->host_pdev) 227 - return bcma_of_get_irq(&bus->host_pdev->dev, core, num); 226 + if (bus->dev) 227 + return bcma_of_get_irq(bus->dev, core, num); 228 228 return 0; 229 229 case BCMA_HOSTTYPE_SDIO: 230 230 return 0; ··· 239 239 core->dev.release = bcma_release_core_dev; 240 240 core->dev.bus = &bcma_bus_type; 241 241 dev_set_name(&core->dev, "bcma%d:%d", bus->num, core->core_index); 242 - core->dev.parent = bcma_bus_get_host_dev(bus); 243 - if (core->dev.parent) 244 - bcma_of_fill_device(core->dev.parent, core); 242 + core->dev.parent = bus->dev; 243 + if (bus->dev) 244 + bcma_of_fill_device(bus->dev, core); 245 245 246 246 switch (bus->hosttype) { 247 247 case BCMA_HOSTTYPE_PCI: 248 - core->dma_dev = &bus->host_pci->dev; 248 + core->dma_dev = bus->dev; 249 249 core->irq = bus->host_pci->irq; 250 250 break; 251 251 case BCMA_HOSTTYPE_SOC: 252 - if (IS_ENABLED(CONFIG_OF) && bus->host_pdev) { 253 - core->dma_dev = &bus->host_pdev->dev; 252 + if (IS_ENABLED(CONFIG_OF) && bus->dev) { 253 + core->dma_dev = bus->dev; 254 254 } else { 255 255 core->dev.dma_mask = &core->dev.coherent_dma_mask; 256 256 core->dma_dev = &core->dev; ··· 259 259 case BCMA_HOSTTYPE_SDIO: 260 260 break; 261 261 } 262 - } 263 - 264 - struct device *bcma_bus_get_host_dev(struct bcma_bus *bus) 265 - { 266 - switch (bus->hosttype) { 267 - case BCMA_HOSTTYPE_PCI: 268 - if (bus->host_pci) 269 - return &bus->host_pci->dev; 270 - else 271 - return NULL; 272 - case BCMA_HOSTTYPE_SOC: 273 - if (bus->host_pdev) 274 - return &bus->host_pdev->dev; 275 - else 276 - return NULL; 277 - case BCMA_HOSTTYPE_SDIO: 278 - if (bus->host_sdio) 279 - return &bus->host_sdio->dev; 280 - else 281 - return NULL; 282 - } 283 - return NULL; 284 262 } 285 263 286 264 void bcma_init_bus(struct bcma_bus *bus) ··· 380 402 { 381 403 int err; 382 404 struct bcma_device *core; 383 - struct device *dev; 384 405 385 406 /* Scan for devices (cores) */ 386 407 err = bcma_bus_scan(bus); ··· 402 425 bcma_core_pci_early_init(&bus->drv_pci[0]); 403 426 } 404 427 405 - dev = bcma_bus_get_host_dev(bus); 406 - if (dev) { 407 - of_platform_default_populate(dev->of_node, NULL, dev); 408 - } 428 + if (bus->dev) 429 + of_platform_default_populate(bus->dev->of_node, NULL, bus->dev); 409 430 410 431 /* Cores providing flash access go before SPROM init */ 411 432 list_for_each_entry(core, &bus->cores, list) {
+1 -1
drivers/net/wireless/ath/ath10k/wmi.h
··· 1986 1986 /* no default handler to allow compiler to check that the 1987 1987 * enum is fully handled 1988 1988 */ 1989 - }; 1989 + } 1990 1990 1991 1991 return "<unknown>"; 1992 1992 }
+1 -1
drivers/net/wireless/ath/ath6kl/init.c
··· 1140 1140 1141 1141 len -= ie_len; 1142 1142 data += ie_len; 1143 - }; 1143 + } 1144 1144 1145 1145 ret = 0; 1146 1146 out:
+8 -28
drivers/net/wireless/broadcom/b43/debugfs.c
··· 668 668 static void b43_add_dynamic_debug(struct b43_wldev *dev) 669 669 { 670 670 struct b43_dfsentry *e = dev->dfsentry; 671 - struct dentry *d; 672 671 673 - #define add_dyn_dbg(name, id, initstate) do { \ 674 - e->dyn_debug[id] = (initstate); \ 675 - d = debugfs_create_bool(name, 0600, e->subdir, \ 676 - &(e->dyn_debug[id])); \ 677 - if (!IS_ERR(d)) \ 678 - e->dyn_debug_dentries[id] = d; \ 679 - } while (0) 672 + #define add_dyn_dbg(name, id, initstate) do { \ 673 + e->dyn_debug[id] = (initstate); \ 674 + e->dyn_debug_dentries[id] = \ 675 + debugfs_create_bool(name, 0600, e->subdir, \ 676 + &(e->dyn_debug[id])); \ 677 + } while (0) 680 678 681 679 add_dyn_dbg("debug_xmitpower", B43_DBG_XMITPOWER, false); 682 680 add_dyn_dbg("debug_dmaoverflow", B43_DBG_DMAOVERFLOW, false); ··· 716 718 717 719 snprintf(devdir, sizeof(devdir), "%s", wiphy_name(dev->wl->hw->wiphy)); 718 720 e->subdir = debugfs_create_dir(devdir, rootdir); 719 - if (!e->subdir || IS_ERR(e->subdir)) { 720 - if (e->subdir == ERR_PTR(-ENODEV)) { 721 - b43dbg(dev->wl, "DebugFS (CONFIG_DEBUG_FS) not " 722 - "enabled in kernel config\n"); 723 - } else { 724 - b43err(dev->wl, "debugfs: cannot create %s directory\n", 725 - devdir); 726 - } 727 - dev->dfsentry = NULL; 728 - kfree(log->log); 729 - kfree(e); 730 - return; 731 - } 732 721 733 722 e->mmio16read_next = 0xFFFF; /* invalid address */ 734 723 e->mmio32read_next = 0xFFFF; /* invalid address */ ··· 726 741 727 742 #define ADD_FILE(name, mode) \ 728 743 do { \ 729 - struct dentry *d; \ 730 - d = debugfs_create_file(__stringify(name), \ 744 + e->file_##name.dentry = \ 745 + debugfs_create_file(__stringify(name), \ 731 746 mode, e->subdir, dev, \ 732 747 &fops_##name.fops); \ 733 - e->file_##name.dentry = NULL; \ 734 - if (!IS_ERR(d)) \ 735 - e->file_##name.dentry = d; \ 736 748 } while (0) 737 749 738 750 ··· 800 818 void b43_debugfs_init(void) 801 819 { 802 820 rootdir = debugfs_create_dir(KBUILD_MODNAME, NULL); 803 - if (IS_ERR(rootdir)) 804 - rootdir = NULL; 805 821 } 806 822 807 823 void b43_debugfs_exit(void)
+8 -27
drivers/net/wireless/broadcom/b43legacy/debugfs.c
··· 361 361 static void b43legacy_add_dynamic_debug(struct b43legacy_wldev *dev) 362 362 { 363 363 struct b43legacy_dfsentry *e = dev->dfsentry; 364 - struct dentry *d; 365 364 366 - #define add_dyn_dbg(name, id, initstate) do { \ 367 - e->dyn_debug[id] = (initstate); \ 368 - d = debugfs_create_bool(name, 0600, e->subdir, \ 369 - &(e->dyn_debug[id])); \ 370 - if (!IS_ERR(d)) \ 371 - e->dyn_debug_dentries[id] = d; \ 372 - } while (0) 365 + #define add_dyn_dbg(name, id, initstate) do { \ 366 + e->dyn_debug[id] = (initstate); \ 367 + e->dyn_debug_dentries[id] = \ 368 + debugfs_create_bool(name, 0600, e->subdir, \ 369 + &(e->dyn_debug[id])); \ 370 + } while (0) 373 371 374 372 add_dyn_dbg("debug_xmitpower", B43legacy_DBG_XMITPOWER, false); 375 373 add_dyn_dbg("debug_dmaoverflow", B43legacy_DBG_DMAOVERFLOW, false); ··· 406 408 407 409 snprintf(devdir, sizeof(devdir), "%s", wiphy_name(dev->wl->hw->wiphy)); 408 410 e->subdir = debugfs_create_dir(devdir, rootdir); 409 - if (!e->subdir || IS_ERR(e->subdir)) { 410 - if (e->subdir == ERR_PTR(-ENODEV)) { 411 - b43legacydbg(dev->wl, "DebugFS (CONFIG_DEBUG_FS) not " 412 - "enabled in kernel config\n"); 413 - } else { 414 - b43legacyerr(dev->wl, "debugfs: cannot create %s directory\n", 415 - devdir); 416 - } 417 - dev->dfsentry = NULL; 418 - kfree(log->log); 419 - kfree(e); 420 - return; 421 - } 422 411 423 412 #define ADD_FILE(name, mode) \ 424 413 do { \ 425 - struct dentry *d; \ 426 - d = debugfs_create_file(__stringify(name), \ 414 + e->file_##name.dentry = \ 415 + debugfs_create_file(__stringify(name), \ 427 416 mode, e->subdir, dev, \ 428 417 &fops_##name.fops); \ 429 418 e->file_##name.dentry = NULL; \ 430 - if (!IS_ERR(d)) \ 431 - e->file_##name.dentry = d; \ 432 419 } while (0) 433 420 434 421 ··· 475 492 void b43legacy_debugfs_init(void) 476 493 { 477 494 rootdir = debugfs_create_dir(KBUILD_MODNAME, NULL); 478 - if (IS_ERR(rootdir)) 479 - rootdir = NULL; 480 495 } 481 496 482 497 void b43legacy_debugfs_exit(void)
+2 -2
drivers/net/wireless/broadcom/brcm80211/brcmfmac/Makefile
··· 16 16 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 17 18 18 ccflags-y += \ 19 - -Idrivers/net/wireless/broadcom/brcm80211/brcmfmac \ 20 - -Idrivers/net/wireless/broadcom/brcm80211/include 19 + -I $(srctree)/$(src) \ 20 + -I $(srctree)/$(src)/../include 21 21 22 22 obj-$(CONFIG_BRCMFMAC) += brcmfmac.o 23 23 brcmfmac-objs += \
+1 -1
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c
··· 315 315 /* bail out as things are really fishy here */ 316 316 WARN(1, "invalid sdio function number: %d\n", func->num); 317 317 err = -ENOMEDIUM; 318 - }; 318 + } 319 319 320 320 if (err == -ENOMEDIUM) 321 321 brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_NOMEDIUM);
+1 -1
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
··· 149 149 return err; 150 150 } 151 151 152 - err = request_firmware(&clm, clm_name, bus->dev); 152 + err = firmware_request_nowarn(&clm, clm_name, bus->dev); 153 153 if (err) { 154 154 brcmf_info("no clm_blob available (err=%d), device may have limited channels available\n", 155 155 err);
+15
drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c
··· 43 43 BRCM_CC_43340_CHIP_ID, 2, "meegopad-t08" 44 44 }; 45 45 46 + static const struct brcmf_dmi_data pov_tab_p1006w_data = { 47 + BRCM_CC_43340_CHIP_ID, 2, "pov-tab-p1006w-data" 48 + }; 49 + 46 50 static const struct dmi_system_id dmi_platform_data[] = { 47 51 { 48 52 /* Match for the GPDwin which unfortunately uses somewhat ··· 84 80 DMI_MATCH(DMI_BOARD_VERSION, "V1.1"), 85 81 }, 86 82 .driver_data = (void *)&meegopad_t08_data, 83 + }, 84 + { 85 + /* Point of View TAB-P1006W-232 */ 86 + .matches = { 87 + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "Insyde"), 88 + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "BayTrail"), 89 + /* Note 105b is Foxcon's USB/PCI vendor id */ 90 + DMI_EXACT_MATCH(DMI_BOARD_VENDOR, "105B"), 91 + DMI_EXACT_MATCH(DMI_BOARD_NAME, "0E57"), 92 + }, 93 + .driver_data = (void *)&pov_tab_p1006w_data, 87 94 }, 88 95 {} 89 96 };
+5
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c
··· 496 496 brcmf_dbg(TRACE, "reqid=%llu\n", reqid); 497 497 498 498 pi = ifp_to_pno(ifp); 499 + 500 + /* No PNO request */ 501 + if (!pi->n_reqs) 502 + return 0; 503 + 499 504 err = brcmf_pno_remove_request(pi, reqid); 500 505 if (err) 501 506 return err;
+5 -1
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
··· 1550 1550 1551 1551 void brcmf_usb_register(void) 1552 1552 { 1553 + int ret; 1554 + 1553 1555 brcmf_dbg(USB, "Enter\n"); 1554 - usb_register(&brcmf_usbdrvr); 1556 + ret = usb_register(&brcmf_usbdrvr); 1557 + if (ret) 1558 + brcmf_err("usb_register failed %d\n", ret); 1555 1559 }
+3 -3
drivers/net/wireless/broadcom/brcm80211/brcmsmac/Makefile
··· 16 16 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 17 18 18 ccflags-y := \ 19 - -Idrivers/net/wireless/broadcom/brcm80211/brcmsmac \ 20 - -Idrivers/net/wireless/broadcom/brcm80211/brcmsmac/phy \ 21 - -Idrivers/net/wireless/broadcom/brcm80211/include 19 + -I $(srctree)/$(src) \ 20 + -I $(srctree)/$(src)/phy \ 21 + -I $(srctree)/$(src)/../include 22 22 23 23 brcmsmac-y := \ 24 24 mac80211_if.o \
+4 -22
drivers/net/wireless/broadcom/brcm80211/brcmsmac/debug.c
··· 37 37 void brcms_debugfs_init(void) 38 38 { 39 39 root_folder = debugfs_create_dir(KBUILD_MODNAME, NULL); 40 - if (IS_ERR(root_folder)) 41 - root_folder = NULL; 42 40 } 43 41 44 42 void brcms_debugfs_exit(void) 45 43 { 46 - if (!root_folder) 47 - return; 48 - 49 44 debugfs_remove_recursive(root_folder); 50 45 root_folder = NULL; 51 46 } 52 47 53 - int brcms_debugfs_attach(struct brcms_pub *drvr) 48 + void brcms_debugfs_attach(struct brcms_pub *drvr) 54 49 { 55 - if (!root_folder) 56 - return -ENODEV; 57 - 58 50 drvr->dbgfs_dir = debugfs_create_dir( 59 51 dev_name(&drvr->wlc->hw->d11core->dev), root_folder); 60 - return PTR_ERR_OR_ZERO(drvr->dbgfs_dir); 61 52 } 62 53 63 54 void brcms_debugfs_detach(struct brcms_pub *drvr) ··· 186 195 .llseek = seq_lseek 187 196 }; 188 197 189 - static int 198 + static void 190 199 brcms_debugfs_add_entry(struct brcms_pub *drvr, const char *fn, 191 200 int (*read_fn)(struct seq_file *seq, void *data)) 192 201 { ··· 194 203 struct dentry *dentry = drvr->dbgfs_dir; 195 204 struct brcms_debugfs_entry *entry; 196 205 197 - if (IS_ERR_OR_NULL(dentry)) 198 - return -ENOENT; 199 - 200 206 entry = devm_kzalloc(dev, sizeof(*entry), GFP_KERNEL); 201 207 if (!entry) 202 - return -ENOMEM; 208 + return; 203 209 204 210 entry->read = read_fn; 205 211 entry->drvr = drvr; 206 212 207 - dentry = debugfs_create_file(fn, 0444, dentry, entry, 208 - &brcms_debugfs_def_ops); 209 - 210 - return PTR_ERR_OR_ZERO(dentry); 213 + debugfs_create_file(fn, 0444, dentry, entry, &brcms_debugfs_def_ops); 211 214 } 212 215 213 216 void brcms_debugfs_create_files(struct brcms_pub *drvr) 214 217 { 215 - if (IS_ERR_OR_NULL(drvr->dbgfs_dir)) 216 - return; 217 - 218 218 brcms_debugfs_add_entry(drvr, "hardware", brcms_debugfs_hardware_read); 219 219 brcms_debugfs_add_entry(drvr, "macstat", brcms_debugfs_macstat_read); 220 220 }
+1 -1
drivers/net/wireless/broadcom/brcm80211/brcmsmac/debug.h
··· 68 68 struct brcms_pub; 69 69 void brcms_debugfs_init(void); 70 70 void brcms_debugfs_exit(void); 71 - int brcms_debugfs_attach(struct brcms_pub *drvr); 71 + void brcms_debugfs_attach(struct brcms_pub *drvr); 72 72 void brcms_debugfs_detach(struct brcms_pub *drvr); 73 73 struct dentry *brcms_debugfs_get_devdir(struct brcms_pub *drvr); 74 74 void brcms_debugfs_create_files(struct brcms_pub *drvr);
+2 -11
drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_lcn.c
··· 1199 1199 { 1200 1200 int wait_count = 0; 1201 1201 bool result = true; 1202 - u8 phybw40; 1203 - phybw40 = CHSPEC_IS40(pi->radio_chanspec); 1204 1202 1205 1203 mod_phy_reg(pi, 0x6da, (0x1 << 5), (1) << 5); 1206 1204 ··· 3080 3082 u8 bbmult; 3081 3083 struct phytbl_info tab; 3082 3084 s32 a1, b0, b1; 3083 - s32 tssi, pwr, maxtargetpwr, mintargetpwr; 3085 + s32 tssi, pwr, mintargetpwr; 3084 3086 bool suspend; 3085 3087 struct brcms_phy *pi = container_of(ppi, struct brcms_phy, pubpi_ro); 3086 3088 ··· 3117 3119 b0 = pi->txpa_2g[0]; 3118 3120 b1 = pi->txpa_2g[1]; 3119 3121 a1 = pi->txpa_2g[2]; 3120 - maxtargetpwr = wlc_lcnphy_tssi2dbm(10, a1, b0, b1); 3121 3122 mintargetpwr = wlc_lcnphy_tssi2dbm(125, a1, b0, b1); 3122 3123 3123 3124 tab.tbl_id = LCNPHY_TBL_ID_TXPWRCTL; ··· 4209 4212 s8 index; 4210 4213 struct phytbl_info tab; 4211 4214 s32 a1, b0, b1; 4212 - s32 tssi, pwr, maxtargetpwr, mintargetpwr; 4215 + s32 tssi, pwr, mintargetpwr; 4213 4216 struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy; 4214 4217 4215 4218 pi->phy_lastcal = pi->sh->now; ··· 4246 4249 b0 = pi->txpa_2g[0]; 4247 4250 b1 = pi->txpa_2g[1]; 4248 4251 a1 = pi->txpa_2g[2]; 4249 - maxtargetpwr = wlc_lcnphy_tssi2dbm(10, a1, b0, b1); 4250 4252 mintargetpwr = wlc_lcnphy_tssi2dbm(125, a1, b0, b1); 4251 4253 4252 4254 tab.tbl_id = LCNPHY_TBL_ID_TXPWRCTL; ··· 4618 4622 static void wlc_lcnphy_tbl_init(struct brcms_phy *pi) 4619 4623 { 4620 4624 uint idx; 4621 - u8 phybw40; 4622 4625 struct phytbl_info tab; 4623 4626 const struct phytbl_info *tb; 4624 4627 u32 val; 4625 - 4626 - phybw40 = CHSPEC_IS40(pi->radio_chanspec); 4627 4628 4628 4629 for (idx = 0; idx < dot11lcnphytbl_info_sz_rev0; idx++) 4629 4630 wlc_lcnphy_write_table(pi, &dot11lcnphytbl_info_rev0[idx]); ··· 4824 4831 4825 4832 void wlc_phy_init_lcnphy(struct brcms_phy *pi) 4826 4833 { 4827 - u8 phybw40; 4828 4834 struct brcms_phy_lcnphy *pi_lcn = pi->u.pi_lcnphy; 4829 - phybw40 = CHSPEC_IS40(pi->radio_chanspec); 4830 4835 4831 4836 pi_lcn->lcnphy_cal_counter = 0; 4832 4837 pi_lcn->lcnphy_cal_temper = pi_lcn->lcnphy_rawtempsense;
+1 -3
drivers/net/wireless/broadcom/brcm80211/brcmutil/Makefile
··· 15 15 # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 16 16 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 17 18 - ccflags-y := \ 19 - -Idrivers/net/wireless/broadcom/brcm80211/brcmutil \ 20 - -Idrivers/net/wireless/broadcom/brcm80211/include 18 + ccflags-y := -I $(srctree)/$(src)/../include 21 19 22 20 obj-$(CONFIG_BRCMUTIL) += brcmutil.o 23 21 brcmutil-objs = utils.o d11.o
+1 -4
drivers/net/wireless/intel/iwlegacy/3945-mac.c
··· 3756 3756 if (err) 3757 3757 goto out_remove_sysfs; 3758 3758 3759 - err = il_dbgfs_register(il, DRV_NAME); 3760 - if (err) 3761 - IL_ERR("failed to create debugfs files. Ignoring error: %d\n", 3762 - err); 3759 + il_dbgfs_register(il, DRV_NAME); 3763 3760 3764 3761 /* Start monitoring the killswitch */ 3765 3762 queue_delayed_work(il->workqueue, &il->_3945.rfkill_poll, 2 * HZ);
+1 -4
drivers/net/wireless/intel/iwlegacy/4965-mac.c
··· 4988 4988 if (err) 4989 4989 goto out_unbind; 4990 4990 4991 - err = il_dbgfs_register(il, DRV_NAME); 4992 - if (err) 4993 - IL_ERR("failed to create debugfs files. Ignoring error: %d\n", 4994 - err); 4991 + il_dbgfs_register(il, DRV_NAME); 4995 4992 4996 4993 err = sysfs_create_group(&il->pci_dev->dev.kobj, &il_attribute_group); 4997 4994 if (err) {
+2 -4
drivers/net/wireless/intel/iwlegacy/common.h
··· 2974 2974 #endif /* CONFIG_IWLEGACY_DEBUG */ 2975 2975 2976 2976 #ifdef CONFIG_IWLEGACY_DEBUGFS 2977 - int il_dbgfs_register(struct il_priv *il, const char *name); 2977 + void il_dbgfs_register(struct il_priv *il, const char *name); 2978 2978 void il_dbgfs_unregister(struct il_priv *il); 2979 2979 #else 2980 - static inline int 2981 - il_dbgfs_register(struct il_priv *il, const char *name) 2980 + static inline void il_dbgfs_register(struct il_priv *il, const char *name) 2982 2981 { 2983 - return 0; 2984 2982 } 2985 2983 2986 2984 static inline void
+4 -30
drivers/net/wireless/intel/iwlegacy/debug.c
··· 128 128 129 129 /* create and remove of files */ 130 130 #define DEBUGFS_ADD_FILE(name, parent, mode) do { \ 131 - if (!debugfs_create_file(#name, mode, parent, il, \ 132 - &il_dbgfs_##name##_ops)) \ 133 - goto err; \ 131 + debugfs_create_file(#name, mode, parent, il, \ 132 + &il_dbgfs_##name##_ops); \ 134 133 } while (0) 135 134 136 135 #define DEBUGFS_ADD_BOOL(name, parent, ptr) do { \ 137 - struct dentry *__tmp; \ 138 - __tmp = debugfs_create_bool(#name, 0600, parent, ptr); \ 139 - if (IS_ERR(__tmp) || !__tmp) \ 140 - goto err; \ 141 - } while (0) 142 - 143 - #define DEBUGFS_ADD_X32(name, parent, ptr) do { \ 144 - struct dentry *__tmp; \ 145 - __tmp = debugfs_create_x32(#name, 0600, parent, ptr); \ 146 - if (IS_ERR(__tmp) || !__tmp) \ 147 - goto err; \ 136 + debugfs_create_bool(#name, 0600, parent, ptr); \ 148 137 } while (0) 149 138 150 139 /* file operation */ ··· 1330 1341 * Create the debugfs files and directories 1331 1342 * 1332 1343 */ 1333 - int 1344 + void 1334 1345 il_dbgfs_register(struct il_priv *il, const char *name) 1335 1346 { 1336 1347 struct dentry *phyd = il->hw->wiphy->debugfsdir; 1337 1348 struct dentry *dir_drv, *dir_data, *dir_rf, *dir_debug; 1338 1349 1339 1350 dir_drv = debugfs_create_dir(name, phyd); 1340 - if (!dir_drv) 1341 - return -ENOMEM; 1342 - 1343 1351 il->debugfs_dir = dir_drv; 1344 1352 1345 1353 dir_data = debugfs_create_dir("data", dir_drv); 1346 - if (!dir_data) 1347 - goto err; 1348 1354 dir_rf = debugfs_create_dir("rf", dir_drv); 1349 - if (!dir_rf) 1350 - goto err; 1351 1355 dir_debug = debugfs_create_dir("debug", dir_drv); 1352 - if (!dir_debug) 1353 - goto err; 1354 1356 1355 1357 DEBUGFS_ADD_FILE(nvm, dir_data, 0400); 1356 1358 DEBUGFS_ADD_FILE(sram, dir_data, 0600); ··· 1379 1399 DEBUGFS_ADD_BOOL(disable_chain_noise, dir_rf, 1380 1400 &il->disable_chain_noise_cal); 1381 1401 DEBUGFS_ADD_BOOL(disable_tx_power, dir_rf, &il->disable_tx_power_cal); 1382 - return 0; 1383 - 1384 - err: 1385 - IL_ERR("Can't create the debugfs directory\n"); 1386 - il_dbgfs_unregister(il); 1387 - return -ENOMEM; 1388 1402 } 1389 1403 EXPORT_SYMBOL(il_dbgfs_register); 1390 1404
+72 -2
drivers/net/wireless/intel/iwlwifi/cfg/22000.c
··· 83 83 #define IWL_22000_HR_A0_FW_PRE "iwlwifi-QuQnj-a0-hr-a0-" 84 84 #define IWL_22000_SU_Z0_FW_PRE "iwlwifi-su-z0-" 85 85 #define IWL_QU_B_JF_B_FW_PRE "iwlwifi-Qu-b0-jf-b0-" 86 + #define IWL_CC_A_FW_PRE "iwlwifi-cc-a0-" 86 87 87 88 #define IWL_22000_HR_MODULE_FIRMWARE(api) \ 88 89 IWL_22000_HR_FW_PRE __stringify(api) ".ucode" ··· 105 104 IWL_22000_SU_Z0_FW_PRE __stringify(api) ".ucode" 106 105 #define IWL_QU_B_JF_B_MODULE_FIRMWARE(api) \ 107 106 IWL_QU_B_JF_B_FW_PRE __stringify(api) ".ucode" 107 + #define IWL_CC_A_MODULE_FIRMWARE(api) \ 108 + IWL_CC_A_FW_PRE __stringify(api) ".ucode" 108 109 109 110 static const struct iwl_base_params iwl_22000_base_params = { 110 111 .eeprom_size = OTP_LOW_IMAGE_SIZE_32K, ··· 198 195 IWL_DEVICE_22500, 199 196 }; 200 197 201 - const struct iwl_cfg iwl22000_2ax_cfg_hr = { 202 - .name = "Intel(R) Dual Band Wireless AX 22000", 198 + const struct iwl_cfg iwl22560_2ax_cfg_hr = { 199 + .name = "Intel(R) Wireless-AX 22560", 203 200 .fw_name_pre = IWL_22000_QU_B_HR_B_FW_PRE, 201 + IWL_DEVICE_22500, 202 + /* 203 + * This device doesn't support receiving BlockAck with a large bitmap 204 + * so we need to restrict the size of transmitted aggregation to the 205 + * HT size; mac80211 would otherwise pick the HE max (256) by default. 206 + */ 207 + .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 208 + }; 209 + 210 + const struct iwl_cfg iwl22260_2ax_cfg = { 211 + .name = "Intel(R) Wireless-AX 22260", 212 + .fw_name_pre = IWL_CC_A_FW_PRE, 213 + IWL_DEVICE_22500, 214 + /* 215 + * This device doesn't support receiving BlockAck with a large bitmap 216 + * so we need to restrict the size of transmitted aggregation to the 217 + * HT size; mac80211 would otherwise pick the HE max (256) by default. 218 + */ 219 + .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 220 + }; 221 + 222 + const struct iwl_cfg killer1650x_2ax_cfg = { 223 + .name = "Killer(R) Wireless-AX 1650x Wireless Network Adapter (22260NGW)", 224 + .fw_name_pre = IWL_CC_A_FW_PRE, 225 + IWL_DEVICE_22500, 226 + /* 227 + * This device doesn't support receiving BlockAck with a large bitmap 228 + * so we need to restrict the size of transmitted aggregation to the 229 + * HT size; mac80211 would otherwise pick the HE max (256) by default. 230 + */ 231 + .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 232 + }; 233 + 234 + const struct iwl_cfg killer1650w_2ax_cfg = { 235 + .name = "Killer(R) Wireless-AX 1650w Wireless Network Adapter (22260D2W)", 236 + .fw_name_pre = IWL_CC_A_FW_PRE, 204 237 IWL_DEVICE_22500, 205 238 /* 206 239 * This device doesn't support receiving BlockAck with a large bitmap ··· 269 230 IWL_DEVICE_22500, 270 231 }; 271 232 233 + const struct iwl_cfg iwl9560_2ac_160_cfg_qu_b0_jf_b0 = { 234 + .name = "Intel(R) Wireless-AC 9560 160MHz", 235 + .fw_name_pre = IWL_QU_B_JF_B_FW_PRE, 236 + IWL_DEVICE_22500, 237 + }; 238 + 272 239 const struct iwl_cfg killer1550i_2ac_cfg_qu_b0_jf_b0 = { 273 240 .name = "Killer (R) Wireless-AC 1550i Wireless Network Adapter (9560NGW)", 274 241 .fw_name_pre = IWL_QU_B_JF_B_FW_PRE, ··· 285 240 .name = "Killer (R) Wireless-AC 1550s Wireless Network Adapter (9560NGW)", 286 241 .fw_name_pre = IWL_QU_B_JF_B_FW_PRE, 287 242 IWL_DEVICE_22500, 243 + }; 244 + 245 + const struct iwl_cfg killer1650s_2ax_cfg_qu_b0_hr_b0 = { 246 + .name = "Killer(R) Wireless-AX 1650i Wireless Network Adapter (22560NGW)", 247 + .fw_name_pre = IWL_22000_QU_B_HR_B_FW_PRE, 248 + IWL_DEVICE_22500, 249 + /* 250 + * This device doesn't support receiving BlockAck with a large bitmap 251 + * so we need to restrict the size of transmitted aggregation to the 252 + * HT size; mac80211 would otherwise pick the HE max (256) by default. 253 + */ 254 + .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 255 + }; 256 + 257 + const struct iwl_cfg killer1650i_2ax_cfg_qu_b0_hr_b0 = { 258 + .name = "Killer(R) Wireless-AX 1650s Wireless Network Adapter (22560D2W)", 259 + .fw_name_pre = IWL_22000_QU_B_HR_B_FW_PRE, 260 + IWL_DEVICE_22500, 261 + /* 262 + * This device doesn't support receiving BlockAck with a large bitmap 263 + * so we need to restrict the size of transmitted aggregation to the 264 + * HT size; mac80211 would otherwise pick the HE max (256) by default. 265 + */ 266 + .max_tx_agg_size = IEEE80211_MAX_AMPDU_BUF_HT, 288 267 }; 289 268 290 269 const struct iwl_cfg iwl22000_2ax_cfg_jf = { ··· 393 324 MODULE_FIRMWARE(IWL_22000_HR_A0_QNJ_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 394 325 MODULE_FIRMWARE(IWL_22000_SU_Z0_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 395 326 MODULE_FIRMWARE(IWL_QU_B_JF_B_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX)); 327 + MODULE_FIRMWARE(IWL_CC_A_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));
+63 -76
drivers/net/wireless/intel/iwlwifi/cfg/9000.c
··· 73 73 #define IWL9000_SMEM_OFFSET 0x400000 74 74 #define IWL9000_SMEM_LEN 0x68000 75 75 76 - #define IWL9000A_FW_PRE "iwlwifi-9000-pu-a0-jf-a0-" 77 - #define IWL9000B_FW_PRE "iwlwifi-9000-pu-b0-jf-b0-" 78 - #define IWL9000RFB_FW_PRE "iwlwifi-9000-pu-a0-jf-b0-" 79 - #define IWL9260A_FW_PRE "iwlwifi-9260-th-a0-jf-a0-" 80 - #define IWL9260B_FW_PRE "iwlwifi-9260-th-b0-jf-b0-" 81 - #define IWL9000A_MODULE_FIRMWARE(api) \ 82 - IWL9000A_FW_PRE __stringify(api) ".ucode" 83 - #define IWL9000B_MODULE_FIRMWARE(api) \ 84 - IWL9000B_FW_PRE __stringify(api) ".ucode" 85 - #define IWL9000RFB_MODULE_FIRMWARE(api) \ 86 - IWL9000RFB_FW_PRE __stringify(api) ".ucode" 87 - #define IWL9260A_MODULE_FIRMWARE(api) \ 88 - IWL9260A_FW_PRE __stringify(api) ".ucode" 89 - #define IWL9260B_MODULE_FIRMWARE(api) \ 90 - IWL9260B_FW_PRE __stringify(api) ".ucode" 76 + #define IWL9000_FW_PRE "iwlwifi-9000-pu-b0-jf-b0-" 77 + #define IWL9260_FW_PRE "iwlwifi-9260-th-b0-jf-b0-" 78 + #define IWL9000_MODULE_FIRMWARE(api) \ 79 + IWL9000_FW_PRE __stringify(api) ".ucode" 80 + #define IWL9260_MODULE_FIRMWARE(api) \ 81 + IWL9260_FW_PRE __stringify(api) ".ucode" 91 82 92 83 static const struct iwl_base_params iwl9000_base_params = { 93 84 .eeprom_size = OTP_LOW_IMAGE_SIZE_32K, ··· 153 162 154 163 const struct iwl_cfg iwl9160_2ac_cfg = { 155 164 .name = "Intel(R) Dual Band Wireless AC 9160", 156 - .fw_name_pre = IWL9260A_FW_PRE, 157 - .fw_name_pre_b_or_c_step = IWL9260B_FW_PRE, 165 + .fw_name_pre = IWL9260_FW_PRE, 158 166 IWL_DEVICE_9000, 159 167 }; 160 168 161 169 const struct iwl_cfg iwl9260_2ac_cfg = { 162 170 .name = "Intel(R) Dual Band Wireless AC 9260", 163 - .fw_name_pre = IWL9260A_FW_PRE, 164 - .fw_name_pre_b_or_c_step = IWL9260B_FW_PRE, 171 + .fw_name_pre = IWL9260_FW_PRE, 172 + IWL_DEVICE_9000, 173 + }; 174 + 175 + const struct iwl_cfg iwl9260_2ac_160_cfg = { 176 + .name = "Intel(R) Wireless-AC 9260 160MHz", 177 + .fw_name_pre = IWL9260_FW_PRE, 165 178 IWL_DEVICE_9000, 166 179 }; 167 180 168 181 const struct iwl_cfg iwl9260_killer_2ac_cfg = { 169 182 .name = "Killer (R) Wireless-AC 1550 Wireless Network Adapter (9260NGW)", 170 - .fw_name_pre = IWL9260A_FW_PRE, 171 - .fw_name_pre_b_or_c_step = IWL9260B_FW_PRE, 183 + .fw_name_pre = IWL9260_FW_PRE, 172 184 IWL_DEVICE_9000, 173 185 }; 174 186 175 187 const struct iwl_cfg iwl9270_2ac_cfg = { 176 188 .name = "Intel(R) Dual Band Wireless AC 9270", 177 - .fw_name_pre = IWL9260A_FW_PRE, 178 - .fw_name_pre_b_or_c_step = IWL9260B_FW_PRE, 189 + .fw_name_pre = IWL9260_FW_PRE, 179 190 IWL_DEVICE_9000, 180 191 }; 181 192 182 193 const struct iwl_cfg iwl9460_2ac_cfg = { 183 194 .name = "Intel(R) Dual Band Wireless AC 9460", 184 - .fw_name_pre = IWL9260A_FW_PRE, 185 - .fw_name_pre_b_or_c_step = IWL9260B_FW_PRE, 195 + .fw_name_pre = IWL9260_FW_PRE, 186 196 IWL_DEVICE_9000, 187 197 }; 188 198 189 199 const struct iwl_cfg iwl9460_2ac_cfg_soc = { 190 200 .name = "Intel(R) Dual Band Wireless AC 9460", 191 - .fw_name_pre = IWL9000A_FW_PRE, 192 - .fw_name_pre_b_or_c_step = IWL9000B_FW_PRE, 193 - .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, 201 + .fw_name_pre = IWL9000_FW_PRE, 194 202 IWL_DEVICE_9000, 195 203 .integrated = true, 196 204 .soc_latency = 5000, 197 205 }; 198 206 199 207 const struct iwl_cfg iwl9461_2ac_cfg_soc = { 200 - .name = "Intel(R) Dual Band Wireless AC 9461", 201 - .fw_name_pre = IWL9000A_FW_PRE, 202 - .fw_name_pre_b_or_c_step = IWL9000B_FW_PRE, 203 - .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, 204 - IWL_DEVICE_9000, 205 - .integrated = true, 206 - .soc_latency = 5000, 208 + .name = "Intel(R) Dual Band Wireless AC 9461", 209 + .fw_name_pre = IWL9000_FW_PRE, 210 + IWL_DEVICE_9000, 211 + .integrated = true, 212 + .soc_latency = 5000, 207 213 }; 208 214 209 215 const struct iwl_cfg iwl9462_2ac_cfg_soc = { 210 - .name = "Intel(R) Dual Band Wireless AC 9462", 211 - .fw_name_pre = IWL9000A_FW_PRE, 212 - .fw_name_pre_b_or_c_step = IWL9000B_FW_PRE, 213 - .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, 214 - IWL_DEVICE_9000, 215 - .integrated = true, 216 - .soc_latency = 5000, 216 + .name = "Intel(R) Dual Band Wireless AC 9462", 217 + .fw_name_pre = IWL9000_FW_PRE, 218 + IWL_DEVICE_9000, 219 + .integrated = true, 220 + .soc_latency = 5000, 217 221 }; 218 222 219 223 const struct iwl_cfg iwl9560_2ac_cfg = { 220 224 .name = "Intel(R) Dual Band Wireless AC 9560", 221 - .fw_name_pre = IWL9260A_FW_PRE, 222 - .fw_name_pre_b_or_c_step = IWL9260B_FW_PRE, 225 + .fw_name_pre = IWL9260_FW_PRE, 226 + IWL_DEVICE_9000, 227 + }; 228 + 229 + const struct iwl_cfg iwl9560_2ac_160_cfg = { 230 + .name = "Intel(R) Wireless-AC 9560 160MHz", 231 + .fw_name_pre = IWL9260_FW_PRE, 223 232 IWL_DEVICE_9000, 224 233 }; 225 234 226 235 const struct iwl_cfg iwl9560_2ac_cfg_soc = { 227 236 .name = "Intel(R) Dual Band Wireless AC 9560", 228 - .fw_name_pre = IWL9000A_FW_PRE, 229 - .fw_name_pre_b_or_c_step = IWL9000B_FW_PRE, 230 - .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, 237 + .fw_name_pre = IWL9000_FW_PRE, 238 + IWL_DEVICE_9000, 239 + .integrated = true, 240 + .soc_latency = 5000, 241 + }; 242 + 243 + const struct iwl_cfg iwl9560_2ac_160_cfg_soc = { 244 + .name = "Intel(R) Wireless-AC 9560 160MHz", 245 + .fw_name_pre = IWL9000_FW_PRE, 231 246 IWL_DEVICE_9000, 232 247 .integrated = true, 233 248 .soc_latency = 5000, ··· 241 244 242 245 const struct iwl_cfg iwl9560_killer_2ac_cfg_soc = { 243 246 .name = "Killer (R) Wireless-AC 1550i Wireless Network Adapter (9560NGW)", 244 - .fw_name_pre = IWL9000A_FW_PRE, 245 - .fw_name_pre_b_or_c_step = IWL9000B_FW_PRE, 246 - .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, 247 + .fw_name_pre = IWL9000_FW_PRE, 247 248 IWL_DEVICE_9000, 248 249 .integrated = true, 249 250 .soc_latency = 5000, ··· 249 254 250 255 const struct iwl_cfg iwl9560_killer_s_2ac_cfg_soc = { 251 256 .name = "Killer (R) Wireless-AC 1550s Wireless Network Adapter (9560NGW)", 252 - .fw_name_pre = IWL9000A_FW_PRE, 253 - .fw_name_pre_b_or_c_step = IWL9000B_FW_PRE, 254 - .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, 257 + .fw_name_pre = IWL9000_FW_PRE, 255 258 IWL_DEVICE_9000, 256 259 .integrated = true, 257 260 .soc_latency = 5000, ··· 257 264 258 265 const struct iwl_cfg iwl9460_2ac_cfg_shared_clk = { 259 266 .name = "Intel(R) Dual Band Wireless AC 9460", 260 - .fw_name_pre = IWL9000A_FW_PRE, 261 - .fw_name_pre_b_or_c_step = IWL9000B_FW_PRE, 262 - .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, 267 + .fw_name_pre = IWL9000_FW_PRE, 263 268 IWL_DEVICE_9000, 264 269 .integrated = true, 265 270 .soc_latency = 5000, ··· 266 275 267 276 const struct iwl_cfg iwl9461_2ac_cfg_shared_clk = { 268 277 .name = "Intel(R) Dual Band Wireless AC 9461", 269 - .fw_name_pre = IWL9000A_FW_PRE, 270 - .fw_name_pre_b_or_c_step = IWL9000B_FW_PRE, 271 - .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, 278 + .fw_name_pre = IWL9000_FW_PRE, 272 279 IWL_DEVICE_9000, 273 280 .integrated = true, 274 281 .soc_latency = 5000, ··· 275 286 276 287 const struct iwl_cfg iwl9462_2ac_cfg_shared_clk = { 277 288 .name = "Intel(R) Dual Band Wireless AC 9462", 278 - .fw_name_pre = IWL9000A_FW_PRE, 279 - .fw_name_pre_b_or_c_step = IWL9000B_FW_PRE, 280 - .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, 289 + .fw_name_pre = IWL9000_FW_PRE, 281 290 IWL_DEVICE_9000, 282 291 .integrated = true, 283 292 .soc_latency = 5000, ··· 284 297 285 298 const struct iwl_cfg iwl9560_2ac_cfg_shared_clk = { 286 299 .name = "Intel(R) Dual Band Wireless AC 9560", 287 - .fw_name_pre = IWL9000A_FW_PRE, 288 - .fw_name_pre_b_or_c_step = IWL9000B_FW_PRE, 289 - .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, 300 + .fw_name_pre = IWL9000_FW_PRE, 301 + IWL_DEVICE_9000, 302 + .integrated = true, 303 + .soc_latency = 5000, 304 + .extra_phy_cfg_flags = FW_PHY_CFG_SHARED_CLK 305 + }; 306 + 307 + const struct iwl_cfg iwl9560_2ac_160_cfg_shared_clk = { 308 + .name = "Intel(R) Wireless-AC 9560 160MHz", 309 + .fw_name_pre = IWL9000_FW_PRE, 290 310 IWL_DEVICE_9000, 291 311 .integrated = true, 292 312 .soc_latency = 5000, ··· 302 308 303 309 const struct iwl_cfg iwl9560_killer_2ac_cfg_shared_clk = { 304 310 .name = "Killer (R) Wireless-AC 1550i Wireless Network Adapter (9560NGW)", 305 - .fw_name_pre = IWL9000A_FW_PRE, 306 - .fw_name_pre_b_or_c_step = IWL9000B_FW_PRE, 307 - .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, 311 + .fw_name_pre = IWL9000_FW_PRE, 308 312 IWL_DEVICE_9000, 309 313 .integrated = true, 310 314 .soc_latency = 5000, ··· 311 319 312 320 const struct iwl_cfg iwl9560_killer_s_2ac_cfg_shared_clk = { 313 321 .name = "Killer (R) Wireless-AC 1550s Wireless Network Adapter (9560NGW)", 314 - .fw_name_pre = IWL9000A_FW_PRE, 315 - .fw_name_pre_b_or_c_step = IWL9000B_FW_PRE, 316 - .fw_name_pre_rf_next_step = IWL9000RFB_FW_PRE, 322 + .fw_name_pre = IWL9000_FW_PRE, 317 323 IWL_DEVICE_9000, 318 324 .integrated = true, 319 325 .soc_latency = 5000, 320 326 .extra_phy_cfg_flags = FW_PHY_CFG_SHARED_CLK 321 327 }; 322 328 323 - MODULE_FIRMWARE(IWL9000A_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX)); 324 - MODULE_FIRMWARE(IWL9000B_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX)); 325 - MODULE_FIRMWARE(IWL9000RFB_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX)); 326 - MODULE_FIRMWARE(IWL9260A_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX)); 327 - MODULE_FIRMWARE(IWL9260B_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX)); 329 + MODULE_FIRMWARE(IWL9000_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX)); 330 + MODULE_FIRMWARE(IWL9260_MODULE_FIRMWARE(IWL9000_UCODE_API_MAX));
+1 -1
drivers/net/wireless/intel/iwlwifi/dvm/Makefile
··· 11 11 iwldvm-$(CONFIG_IWLWIFI_LEDS) += led.o 12 12 iwldvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o 13 13 14 - ccflags-y += -I$(src)/../ 14 + ccflags-y += -I $(srctree)/$(src)/../
+3 -20
drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c
··· 1 1 /****************************************************************************** 2 2 * 3 3 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 4 + * Copyright (C) 2018 Intel Corporation 4 5 * 5 6 * Portions of this file are derived from the ipw3945 project, as well 6 7 * as portions of the ieee80211 subsystem header files. ··· 711 710 return ret; 712 711 } 713 712 714 - static inline bool iwl_enable_rx_ampdu(const struct iwl_cfg *cfg) 715 - { 716 - if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_RXAGG) 717 - return false; 718 - return true; 719 - } 720 - 721 - static inline bool iwl_enable_tx_ampdu(const struct iwl_cfg *cfg) 722 - { 723 - if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG) 724 - return false; 725 - if (iwlwifi_mod_params.disable_11n & IWL_ENABLE_HT_TXAGG) 726 - return true; 727 - 728 - /* disabled by default */ 729 - return false; 730 - } 731 - 732 713 static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw, 733 714 struct ieee80211_vif *vif, 734 715 struct ieee80211_ampdu_params *params) ··· 735 752 736 753 switch (action) { 737 754 case IEEE80211_AMPDU_RX_START: 738 - if (!iwl_enable_rx_ampdu(priv->cfg)) 755 + if (!iwl_enable_rx_ampdu()) 739 756 break; 740 757 IWL_DEBUG_HT(priv, "start Rx\n"); 741 758 ret = iwl_sta_rx_agg_start(priv, sta, tid, *ssn); ··· 747 764 case IEEE80211_AMPDU_TX_START: 748 765 if (!priv->trans->ops->txq_enable) 749 766 break; 750 - if (!iwl_enable_tx_ampdu(priv->cfg)) 767 + if (!iwl_enable_tx_ampdu()) 751 768 break; 752 769 IWL_DEBUG_HT(priv, "start Tx\n"); 753 770 ret = iwlagn_tx_agg_start(priv, vif, sta, tid, ssn);
+1 -1
drivers/net/wireless/intel/iwlwifi/dvm/main.c
··· 1054 1054 ieee80211_restart_hw(priv->hw); 1055 1055 else 1056 1056 IWL_ERR(priv, 1057 - "Cannot request restart before registrating with mac80211\n"); 1057 + "Cannot request restart before registering with mac80211\n"); 1058 1058 } else { 1059 1059 WARN_ON(1); 1060 1060 }
+3 -2
drivers/net/wireless/intel/iwlwifi/dvm/tt.c
··· 1 1 /****************************************************************************** 2 2 * 3 3 * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. 4 + * Copyright (C) 2018 Intel Corporation 4 5 * 5 6 * Portions of this file are derived from the ipw3945 project, as well 6 7 * as portions of the ieee80211 subsystem header files. ··· 326 325 iwl_prepare_ct_kill_task(priv); 327 326 tt->state = old_state; 328 327 } 329 - } else if (old_state == IWL_TI_CT_KILL && 330 - tt->state != IWL_TI_CT_KILL) 328 + } else if (old_state == IWL_TI_CT_KILL) { 331 329 iwl_perform_ct_kill_task(priv, false); 330 + } 332 331 IWL_DEBUG_TEMP(priv, "Temperature state changed %u\n", 333 332 tt->state); 334 333 IWL_DEBUG_TEMP(priv, "Power Index change to %u\n",
+9 -14
drivers/net/wireless/intel/iwlwifi/fw/api/commands.h
··· 77 77 * @DATA_PATH_GROUP: data path group, uses command IDs from 78 78 * &enum iwl_data_path_subcmd_ids 79 79 * @NAN_GROUP: NAN group, uses command IDs from &enum iwl_nan_subcmd_ids 80 - * @TOF_GROUP: TOF group, uses command IDs from &enum iwl_tof_subcmd_ids 80 + * @LOCATION_GROUP: location group, uses command IDs from 81 + * &enum iwl_location_subcmd_ids 81 82 * @PROT_OFFLOAD_GROUP: protocol offload group, uses command IDs from 82 83 * &enum iwl_prot_offload_subcmd_ids 83 84 * @REGULATORY_AND_NVM_GROUP: regulatory/NVM group, uses command IDs from ··· 93 92 PHY_OPS_GROUP = 0x4, 94 93 DATA_PATH_GROUP = 0x5, 95 94 NAN_GROUP = 0x7, 96 - TOF_GROUP = 0x8, 95 + LOCATION_GROUP = 0x8, 97 96 PROT_OFFLOAD_GROUP = 0xb, 98 97 REGULATORY_AND_NVM_GROUP = 0xc, 99 98 DEBUG_GROUP = 0xf, ··· 354 353 PHY_DB_CMD = 0x6c, 355 354 356 355 /** 357 - * @TOF_CMD: &struct iwl_tof_config_cmd 358 - */ 359 - TOF_CMD = 0x10, 360 - 361 - /** 362 - * @TOF_NOTIFICATION: &struct iwl_tof_gen_resp_cmd 363 - */ 364 - TOF_NOTIFICATION = 0x11, 365 - 366 - /** 367 356 * @POWER_TABLE_CMD: &struct iwl_device_power_cmd 368 357 */ 369 358 POWER_TABLE_CMD = 0x77, ··· 406 415 TX_ANT_CONFIGURATION_CMD = 0x98, 407 416 408 417 /** 409 - * @STATISTICS_CMD: &struct iwl_statistics_cmd 418 + * @STATISTICS_CMD: 419 + * one of &struct iwl_statistics_cmd, 420 + * &struct iwl_notif_statistics_v11, 421 + * &struct iwl_notif_statistics_v10, 422 + * &struct iwl_notif_statistics 410 423 */ 411 424 STATISTICS_CMD = 0x9c, 412 425 ··· 418 423 * @STATISTICS_NOTIFICATION: 419 424 * one of &struct iwl_notif_statistics_v10, 420 425 * &struct iwl_notif_statistics_v11, 421 - * &struct iwl_notif_statistics_cdb 426 + * &struct iwl_notif_statistics 422 427 */ 423 428 STATISTICS_NOTIFICATION = 0x9d, 424 429
+10
drivers/net/wireless/intel/iwlwifi/fw/api/d3.h
··· 224 224 225 225 #define IWL_WOWLAN_MAX_PATTERNS 20 226 226 227 + /** 228 + * struct iwl_wowlan_patterns_cmd - WoWLAN wakeup patterns 229 + */ 227 230 struct iwl_wowlan_patterns_cmd { 231 + /** 232 + * @n_patterns: number of patterns 233 + */ 228 234 __le32 n_patterns; 235 + 236 + /** 237 + * @patterns: the patterns, array length in @n_patterns 238 + */ 229 239 struct iwl_wowlan_pattern patterns[]; 230 240 } __packed; /* WOWLAN_PATTERN_ARRAY_API_S_VER_1 */ 231 241
+55
drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h
··· 105 105 HE_AIR_SNIFFER_CONFIG_CMD = 0x13, 106 106 107 107 /** 108 + * @CHEST_COLLECTOR_FILTER_CONFIG_CMD: Configure the CSI 109 + * matrix collection, uses &struct iwl_channel_estimation_cfg 110 + */ 111 + CHEST_COLLECTOR_FILTER_CONFIG_CMD = 0x14, 112 + 113 + /** 108 114 * @RX_NO_DATA_NOTIF: &struct iwl_rx_no_data 109 115 */ 110 116 RX_NO_DATA_NOTIF = 0xF5, ··· 161 155 __le32 membership_status[2]; 162 156 __le32 user_position[4]; 163 157 } __packed; /* MU_GROUP_MNG_NTFY_API_S_VER_1 */ 158 + 159 + enum iwl_channel_estimation_flags { 160 + IWL_CHANNEL_ESTIMATION_ENABLE = BIT(0), 161 + IWL_CHANNEL_ESTIMATION_TIMER = BIT(1), 162 + IWL_CHANNEL_ESTIMATION_COUNTER = BIT(2), 163 + }; 164 + 165 + /** 166 + * struct iwl_channel_estimation_cfg - channel estimation reporting config 167 + */ 168 + struct iwl_channel_estimation_cfg { 169 + /** 170 + * @flags: flags, see &enum iwl_channel_estimation_flags 171 + */ 172 + __le32 flags; 173 + /** 174 + * @timer: if enabled via flags, automatically disable after this many 175 + * microseconds 176 + */ 177 + __le32 timer; 178 + /** 179 + * @count: if enabled via flags, automatically disable after this many 180 + * frames with channel estimation matrix were captured 181 + */ 182 + __le32 count; 183 + /** 184 + * @rate_n_flags_mask: only try to record the channel estimation matrix 185 + * if the rate_n_flags value for the received frame (let's call 186 + * that rx_rnf) matches the mask/value given here like this: 187 + * (rx_rnf & rate_n_flags_mask) == rate_n_flags_val. 188 + */ 189 + __le32 rate_n_flags_mask; 190 + /** 191 + * @rate_n_flags_val: see @rate_n_flags_mask 192 + */ 193 + __le32 rate_n_flags_val; 194 + /** 195 + * @reserved: reserved (for alignment) 196 + */ 197 + __le32 reserved; 198 + /** 199 + * @frame_types: bitmap of frame types to capture, the received frame's 200 + * subtype|type takes 6 bits in the frame and the corresponding bit 201 + * in this field must be set to 1 to capture channel estimation for 202 + * that frame type. Set to all-ones to enable capturing for all 203 + * frame types. 204 + */ 205 + __le64 frame_types; 206 + } __packed; /* CHEST_COLLECTOR_FILTER_CMD_API_S_VER_1 */ 164 207 165 208 #endif /* __iwl_fw_api_datapath_h__ */
+14 -19
drivers/net/wireless/intel/iwlwifi/fw/api/debug.h
··· 335 335 __le32 data[]; 336 336 } __packed; /* DEBUG_(U|L)MAC_RD_WR_RSP_API_S_VER_1 */ 337 337 338 - #define CONT_REC_COMMAND_SIZE 80 339 - #define ENABLE_CONT_RECORDING 0x15 340 - #define DISABLE_CONT_RECORDING 0x16 338 + #define LDBG_CFG_COMMAND_SIZE 80 341 339 #define BUFFER_ALLOCATION 0x27 342 340 #define START_DEBUG_RECORDING 0x29 343 341 #define STOP_DEBUG_RECORDING 0x2A 344 - 345 - /* 346 - * struct iwl_continuous_record_mode - recording mode 347 - */ 348 - struct iwl_continuous_record_mode { 349 - __le16 enable_recording; 350 - } __packed; 351 - 352 - /* 353 - * struct iwl_continuous_record_cmd - enable/disable continuous recording 354 - */ 355 - struct iwl_continuous_record_cmd { 356 - struct iwl_continuous_record_mode record_mode; 357 - u8 pad[CONT_REC_COMMAND_SIZE - 358 - sizeof(struct iwl_continuous_record_mode)]; 359 - } __packed; 360 342 361 343 /* maximum fragments to be allocated per target of allocationId */ 362 344 #define IWL_BUFFER_LOCATION_MAX_FRAGS 2 ··· 366 384 __le32 num_frags; 367 385 struct iwl_fragment_data fragments[IWL_BUFFER_LOCATION_MAX_FRAGS]; 368 386 } __packed; /* BUFFER_ALLOCATION_CMD_API_S_VER_1 */ 387 + 388 + /** 389 + * struct iwl_ldbg_config_cmd - LDBG config command 390 + * @type: configuration type 391 + * @pad: reserved space for type-dependent data 392 + */ 393 + struct iwl_ldbg_config_cmd { 394 + __le32 type; 395 + union { 396 + u8 pad[LDBG_CFG_COMMAND_SIZE - sizeof(__le32)]; 397 + struct iwl_buffer_allocation_cmd buffer_allocation; 398 + }; /* LDBG_CFG_BODY_API_U_VER_2 (partially) */ 399 + } __packed; /* LDBG_CFG_CMD_API_S_VER_2 */ 369 400 370 401 #endif /* __iwl_fw_api_debug_h__ */
+711
drivers/net/wireless/intel/iwlwifi/fw/api/location.h
··· 1 + /****************************************************************************** 2 + * 3 + * This file is provided under a dual BSD/GPLv2 license. When using or 4 + * redistributing this file, you may do so under either license. 5 + * 6 + * GPL LICENSE SUMMARY 7 + * 8 + * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 9 + * Copyright (C) 2018 Intel Corporation 10 + * 11 + * This program is free software; you can redistribute it and/or modify 12 + * it under the terms of version 2 of the GNU General Public License as 13 + * published by the Free Software Foundation. 14 + * 15 + * This program is distributed in the hope that it will be useful, but 16 + * WITHOUT ANY WARRANTY; without even the implied warranty of 17 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 + * General Public License for more details. 19 + * 20 + * The full GNU General Public License is included in this distribution 21 + * in the file called COPYING. 22 + * 23 + * Contact Information: 24 + * Intel Linux Wireless <linuxwifi@intel.com> 25 + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 26 + * 27 + * BSD LICENSE 28 + * 29 + * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 30 + * Copyright (C) 2018 Intel Corporation 31 + * All rights reserved. 32 + * 33 + * Redistribution and use in source and binary forms, with or without 34 + * modification, are permitted provided that the following conditions 35 + * are met: 36 + * 37 + * * Redistributions of source code must retain the above copyright 38 + * notice, this list of conditions and the following disclaimer. 39 + * * Redistributions in binary form must reproduce the above copyright 40 + * notice, this list of conditions and the following disclaimer in 41 + * the documentation and/or other materials provided with the 42 + * distribution. 43 + * * Neither the name Intel Corporation nor the names of its 44 + * contributors may be used to endorse or promote products derived 45 + * from this software without specific prior written permission. 46 + * 47 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 48 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 49 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 50 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 51 + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 52 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 53 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 54 + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 55 + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 56 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 57 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 58 + * 59 + *****************************************************************************/ 60 + #ifndef __iwl_fw_api_location_h__ 61 + #define __iwl_fw_api_location_h__ 62 + 63 + /** 64 + * enum iwl_location_subcmd_ids - location group command IDs 65 + */ 66 + enum iwl_location_subcmd_ids { 67 + /** 68 + * @TOF_RANGE_REQ_CMD: TOF ranging request, 69 + * uses &struct iwl_tof_range_req_cmd 70 + */ 71 + TOF_RANGE_REQ_CMD = 0x0, 72 + /** 73 + * @TOF_CONFIG_CMD: TOF configuration, uses &struct iwl_tof_config_cmd 74 + */ 75 + TOF_CONFIG_CMD = 0x1, 76 + /** 77 + * @TOF_RANGE_ABORT_CMD: abort ongoing ranging, uses 78 + * &struct iwl_tof_range_abort_cmd 79 + */ 80 + TOF_RANGE_ABORT_CMD = 0x2, 81 + /** 82 + * @TOF_RANGE_REQ_EXT_CMD: TOF extended ranging config, 83 + * uses &struct iwl_tof_range_request_ext_cmd 84 + */ 85 + TOF_RANGE_REQ_EXT_CMD = 0x3, 86 + /** 87 + * @TOF_RESPONDER_CONFIG_CMD: FTM responder configuration, 88 + * uses &struct iwl_tof_responder_config_cmd 89 + */ 90 + TOF_RESPONDER_CONFIG_CMD = 0x4, 91 + /** 92 + * @TOF_RESPONDER_DYN_CONFIG_CMD: FTM dynamic configuration, 93 + * uses &struct iwl_tof_responder_dyn_config_cmd 94 + */ 95 + TOF_RESPONDER_DYN_CONFIG_CMD = 0x5, 96 + /** 97 + * @CSI_HEADER_NOTIFICATION: CSI header 98 + */ 99 + CSI_HEADER_NOTIFICATION = 0xFA, 100 + /** 101 + * @CSI_CHUNKS_NOTIFICATION: CSI chunk, 102 + * uses &struct iwl_csi_chunk_notification 103 + */ 104 + CSI_CHUNKS_NOTIFICATION = 0xFB, 105 + /** 106 + * @TOF_LC_NOTIF: used for LCI/civic location, contains just 107 + * the action frame 108 + */ 109 + TOF_LC_NOTIF = 0xFC, 110 + /** 111 + * @TOF_RESPONDER_STATS: FTM responder statistics notification, 112 + * uses &struct iwl_ftm_responder_stats 113 + */ 114 + TOF_RESPONDER_STATS = 0xFD, 115 + /** 116 + * @TOF_MCSI_DEBUG_NOTIF: MCSI debug notification, uses 117 + * &struct iwl_tof_mcsi_notif 118 + */ 119 + TOF_MCSI_DEBUG_NOTIF = 0xFE, 120 + /** 121 + * @TOF_RANGE_RESPONSE_NOTIF: ranging response, using 122 + * &struct iwl_tof_range_rsp_ntfy 123 + */ 124 + TOF_RANGE_RESPONSE_NOTIF = 0xFF, 125 + }; 126 + 127 + /** 128 + * struct iwl_tof_config_cmd - ToF configuration 129 + * @tof_disabled: indicates if ToF is disabled (or not) 130 + * @one_sided_disabled: indicates if one-sided is disabled (or not) 131 + * @is_debug_mode: indiciates if debug mode is active 132 + * @is_buf_required: indicates if channel estimation buffer is required 133 + */ 134 + struct iwl_tof_config_cmd { 135 + u8 tof_disabled; 136 + u8 one_sided_disabled; 137 + u8 is_debug_mode; 138 + u8 is_buf_required; 139 + } __packed; 140 + 141 + /** 142 + * enum iwl_tof_bandwidth - values for iwl_tof_range_req_ap_entry.bandwidth 143 + * @IWL_TOF_BW_20_LEGACY: 20 MHz non-HT 144 + * @IWL_TOF_BW_20_HT: 20 MHz HT 145 + * @IWL_TOF_BW_40: 40 MHz 146 + * @IWL_TOF_BW_80: 80 MHz 147 + * @IWL_TOF_BW_160: 160 MHz 148 + */ 149 + enum iwl_tof_bandwidth { 150 + IWL_TOF_BW_20_LEGACY, 151 + IWL_TOF_BW_20_HT, 152 + IWL_TOF_BW_40, 153 + IWL_TOF_BW_80, 154 + IWL_TOF_BW_160, 155 + }; /* LOCAT_BW_TYPE_E */ 156 + 157 + /* 158 + * enum iwl_tof_algo_type - Algorithym type for range measurement request 159 + */ 160 + enum iwl_tof_algo_type { 161 + IWL_TOF_ALGO_TYPE_MAX_LIKE = 0, 162 + IWL_TOF_ALGO_TYPE_LINEAR_REG = 1, 163 + IWL_TOF_ALGO_TYPE_FFT = 2, 164 + 165 + /* Keep last */ 166 + IWL_TOF_ALGO_TYPE_INVALID, 167 + }; /* ALGO_TYPE_E */ 168 + 169 + /* 170 + * enum iwl_tof_mcsi_ntfy - Enable/Disable MCSI notifications 171 + */ 172 + enum iwl_tof_mcsi_enable { 173 + IWL_TOF_MCSI_DISABLED = 0, 174 + IWL_TOF_MCSI_ENABLED = 1, 175 + }; /* MCSI_ENABLE_E */ 176 + 177 + /** 178 + * enum iwl_tof_responder_cmd_valid_field - valid fields in the responder cfg 179 + * @IWL_TOF_RESPONDER_CMD_VALID_CHAN_INFO: channel info is valid 180 + * @IWL_TOF_RESPONDER_CMD_VALID_TOA_OFFSET: ToA offset is valid 181 + * @IWL_TOF_RESPONDER_CMD_VALID_COMMON_CALIB: common calibration mode is valid 182 + * @IWL_TOF_RESPONDER_CMD_VALID_SPECIFIC_CALIB: spefici calibration mode is 183 + * valid 184 + * @IWL_TOF_RESPONDER_CMD_VALID_BSSID: BSSID is valid 185 + * @IWL_TOF_RESPONDER_CMD_VALID_TX_ANT: TX antenna is valid 186 + * @IWL_TOF_RESPONDER_CMD_VALID_ALGO_TYPE: algorithm type is valid 187 + * @IWL_TOF_RESPONDER_CMD_VALID_NON_ASAP_SUPPORT: non-ASAP support is valid 188 + * @IWL_TOF_RESPONDER_CMD_VALID_STATISTICS_REPORT_SUPPORT: statistics report 189 + * support is valid 190 + * @IWL_TOF_RESPONDER_CMD_VALID_MCSI_NOTIF_SUPPORT: MCSI notification support 191 + * is valid 192 + * @IWL_TOF_RESPONDER_CMD_VALID_FAST_ALGO_SUPPORT: fast algorithm support 193 + * is valid 194 + * @IWL_TOF_RESPONDER_CMD_VALID_RETRY_ON_ALGO_FAIL: retry on algorithm failure 195 + * is valid 196 + * @IWL_TOF_RESPONDER_CMD_VALID_STA_ID: station ID is valid 197 + */ 198 + enum iwl_tof_responder_cmd_valid_field { 199 + IWL_TOF_RESPONDER_CMD_VALID_CHAN_INFO = BIT(0), 200 + IWL_TOF_RESPONDER_CMD_VALID_TOA_OFFSET = BIT(1), 201 + IWL_TOF_RESPONDER_CMD_VALID_COMMON_CALIB = BIT(2), 202 + IWL_TOF_RESPONDER_CMD_VALID_SPECIFIC_CALIB = BIT(3), 203 + IWL_TOF_RESPONDER_CMD_VALID_BSSID = BIT(4), 204 + IWL_TOF_RESPONDER_CMD_VALID_TX_ANT = BIT(5), 205 + IWL_TOF_RESPONDER_CMD_VALID_ALGO_TYPE = BIT(6), 206 + IWL_TOF_RESPONDER_CMD_VALID_NON_ASAP_SUPPORT = BIT(7), 207 + IWL_TOF_RESPONDER_CMD_VALID_STATISTICS_REPORT_SUPPORT = BIT(8), 208 + IWL_TOF_RESPONDER_CMD_VALID_MCSI_NOTIF_SUPPORT = BIT(9), 209 + IWL_TOF_RESPONDER_CMD_VALID_FAST_ALGO_SUPPORT = BIT(10), 210 + IWL_TOF_RESPONDER_CMD_VALID_RETRY_ON_ALGO_FAIL = BIT(11), 211 + IWL_TOF_RESPONDER_CMD_VALID_STA_ID = BIT(12), 212 + }; 213 + 214 + /** 215 + * enum iwl_tof_responder_cfg_flags - responder configuration flags 216 + * @IWL_TOF_RESPONDER_FLAGS_NON_ASAP_SUPPORT: non-ASAP support 217 + * @IWL_TOF_RESPONDER_FLAGS_REPORT_STATISTICS: report statistics 218 + * @IWL_TOF_RESPONDER_FLAGS_REPORT_MCSI: report MCSI 219 + * @IWL_TOF_RESPONDER_FLAGS_ALGO_TYPE: algorithm type 220 + * @IWL_TOF_RESPONDER_FLAGS_TOA_OFFSET_MODE: ToA offset mode 221 + * @IWL_TOF_RESPONDER_FLAGS_COMMON_CALIB_MODE: common calibration mode 222 + * @IWL_TOF_RESPONDER_FLAGS_SPECIFIC_CALIB_MODE: specific calibration mode 223 + * @IWL_TOF_RESPONDER_FLAGS_FAST_ALGO_SUPPORT: fast algorithm support 224 + * @IWL_TOF_RESPONDER_FLAGS_RETRY_ON_ALGO_FAIL: retry on algorithm fail 225 + * @IWL_TOF_RESPONDER_FLAGS_FTM_TX_ANT: TX antenna mask 226 + */ 227 + enum iwl_tof_responder_cfg_flags { 228 + IWL_TOF_RESPONDER_FLAGS_NON_ASAP_SUPPORT = BIT(0), 229 + IWL_TOF_RESPONDER_FLAGS_REPORT_STATISTICS = BIT(1), 230 + IWL_TOF_RESPONDER_FLAGS_REPORT_MCSI = BIT(2), 231 + IWL_TOF_RESPONDER_FLAGS_ALGO_TYPE = BIT(3) | BIT(4) | BIT(5), 232 + IWL_TOF_RESPONDER_FLAGS_TOA_OFFSET_MODE = BIT(6), 233 + IWL_TOF_RESPONDER_FLAGS_COMMON_CALIB_MODE = BIT(7), 234 + IWL_TOF_RESPONDER_FLAGS_SPECIFIC_CALIB_MODE = BIT(8), 235 + IWL_TOF_RESPONDER_FLAGS_FAST_ALGO_SUPPORT = BIT(9), 236 + IWL_TOF_RESPONDER_FLAGS_RETRY_ON_ALGO_FAIL = BIT(10), 237 + IWL_TOF_RESPONDER_FLAGS_FTM_TX_ANT = RATE_MCS_ANT_ABC_MSK, 238 + }; 239 + 240 + /** 241 + * struct iwl_tof_responder_config_cmd - ToF AP mode (for debug) 242 + * @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field 243 + * @responder_cfg_flags: &iwl_tof_responder_cfg_flags 244 + * @bandwidth: current AP Bandwidth: &enum iwl_tof_bandwidth 245 + * @rate: current AP rate 246 + * @channel_num: current AP Channel 247 + * @ctrl_ch_position: coding of the control channel position relative to 248 + * the center frequency, see iwl_mvm_get_ctrl_pos() 249 + * @sta_id: index of the AP STA when in AP mode 250 + * @reserved1: reserved 251 + * @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug 252 + * purposes, simulating station movement by adding various values 253 + * to this field 254 + * @common_calib: XVT: common calibration value 255 + * @specific_calib: XVT: specific calibration value 256 + * @bssid: Current AP BSSID 257 + * @reserved2: reserved 258 + */ 259 + struct iwl_tof_responder_config_cmd { 260 + __le32 cmd_valid_fields; 261 + __le32 responder_cfg_flags; 262 + u8 bandwidth; 263 + u8 rate; 264 + u8 channel_num; 265 + u8 ctrl_ch_position; 266 + u8 sta_id; 267 + u8 reserved1; 268 + __le16 toa_offset; 269 + __le16 common_calib; 270 + __le16 specific_calib; 271 + u8 bssid[ETH_ALEN]; 272 + __le16 reserved2; 273 + } __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_6 */ 274 + 275 + #define IWL_LCI_CIVIC_IE_MAX_SIZE 400 276 + 277 + /** 278 + * struct iwl_tof_responder_dyn_config_cmd - Dynamic responder settings 279 + * @lci_len: The length of the 1st (LCI) part in the @lci_civic buffer 280 + * @civic_len: The length of the 2nd (CIVIC) part in the @lci_civic buffer 281 + * @lci_civic: The LCI/CIVIC buffer. LCI data (if exists) comes first, then, if 282 + * needed, 0-padding such that the next part is dword-aligned, then CIVIC 283 + * data (if exists) follows, and then 0-padding again to complete a 284 + * 4-multiple long buffer. 285 + */ 286 + struct iwl_tof_responder_dyn_config_cmd { 287 + __le32 lci_len; 288 + __le32 civic_len; 289 + u8 lci_civic[]; 290 + } __packed; /* TOF_RESPONDER_DYN_CONFIG_CMD_API_S_VER_2 */ 291 + 292 + /** 293 + * struct iwl_tof_range_request_ext_cmd - extended range req for WLS 294 + * @tsf_timer_offset_msec: the recommended time offset (mSec) from the AP's TSF 295 + * @reserved: reserved 296 + * @min_delta_ftm: Minimal time between two consecutive measurements, 297 + * in units of 100us. 0 means no preference by station 298 + * @ftm_format_and_bw20M: FTM Channel Spacing/Format for 20MHz: recommended 299 + * value be sent to the AP 300 + * @ftm_format_and_bw40M: FTM Channel Spacing/Format for 40MHz: recommended 301 + * value to be sent to the AP 302 + * @ftm_format_and_bw80M: FTM Channel Spacing/Format for 80MHz: recommended 303 + * value to be sent to the AP 304 + */ 305 + struct iwl_tof_range_req_ext_cmd { 306 + __le16 tsf_timer_offset_msec; 307 + __le16 reserved; 308 + u8 min_delta_ftm; 309 + u8 ftm_format_and_bw20M; 310 + u8 ftm_format_and_bw40M; 311 + u8 ftm_format_and_bw80M; 312 + } __packed; 313 + 314 + /** 315 + * enum iwl_tof_location_query - values for query bitmap 316 + * @IWL_TOF_LOC_LCI: query LCI 317 + * @IWL_TOF_LOC_CIVIC: query civic 318 + */ 319 + enum iwl_tof_location_query { 320 + IWL_TOF_LOC_LCI = 0x01, 321 + IWL_TOF_LOC_CIVIC = 0x02, 322 + }; 323 + 324 + /** 325 + * struct iwl_tof_range_req_ap_entry - AP configuration parameters 326 + * @channel_num: Current AP Channel 327 + * @bandwidth: Current AP Bandwidth. One of iwl_tof_bandwidth. 328 + * @tsf_delta_direction: TSF relatively to the subject AP 329 + * @ctrl_ch_position: Coding of the control channel position relative to the 330 + * center frequency, see iwl_mvm_get_ctrl_pos(). 331 + * @bssid: AP's BSSID 332 + * @measure_type: Measurement type: 0 - two sided, 1 - One sided 333 + * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of the 334 + * number of measurement iterations (min 2^0 = 1, max 2^14) 335 + * @burst_period: Recommended value to be sent to the AP. Measurement 336 + * periodicity In units of 100ms. ignored if num_of_bursts = 0 337 + * @samples_per_burst: 2-sided: the number of FTMs pairs in single Burst (1-31); 338 + * 1-sided: how many rts/cts pairs should be used per burst. 339 + * @retries_per_sample: Max number of retries that the LMAC should send 340 + * in case of no replies by the AP. 341 + * @tsf_delta: TSF Delta in units of microseconds. 342 + * The difference between the AP TSF and the device local clock. 343 + * @location_req: Location Request Bit[0] LCI should be sent in the FTMR; 344 + * Bit[1] Civic should be sent in the FTMR 345 + * @asap_mode: 0 - non asap mode, 1 - asap mode (not relevant for one sided) 346 + * @enable_dyn_ack: Enable Dynamic ACK BW. 347 + * 0: Initiator interact with regular AP; 348 + * 1: Initiator interact with Responder machine: need to send the 349 + * Initiator Acks with HT 40MHz / 80MHz, since the Responder should 350 + * use it for its ch est measurement (this flag will be set when we 351 + * configure the opposite machine to be Responder). 352 + * @rssi: Last received value 353 + * legal values: -128-0 (0x7f). above 0x0 indicating an invalid value. 354 + * @algo_type: &enum iwl_tof_algo_type 355 + * @notify_mcsi: &enum iwl_tof_mcsi_ntfy. 356 + * @reserved: For alignment and future use 357 + */ 358 + struct iwl_tof_range_req_ap_entry { 359 + u8 channel_num; 360 + u8 bandwidth; 361 + u8 tsf_delta_direction; 362 + u8 ctrl_ch_position; 363 + u8 bssid[ETH_ALEN]; 364 + u8 measure_type; 365 + u8 num_of_bursts; 366 + __le16 burst_period; 367 + u8 samples_per_burst; 368 + u8 retries_per_sample; 369 + __le32 tsf_delta; 370 + u8 location_req; 371 + u8 asap_mode; 372 + u8 enable_dyn_ack; 373 + s8 rssi; 374 + u8 algo_type; 375 + u8 notify_mcsi; 376 + __le16 reserved; 377 + } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_3 */ 378 + 379 + /** 380 + * enum iwl_tof_response_mode 381 + * @IWL_MVM_TOF_RESPONSE_ASAP: report each AP measurement separately as soon as 382 + * possible (not supported for this release) 383 + * @IWL_MVM_TOF_RESPONSE_TIMEOUT: report all AP measurements as a batch upon 384 + * timeout expiration 385 + * @IWL_MVM_TOF_RESPONSE_COMPLETE: report all AP measurements as a batch at the 386 + * earlier of: measurements completion / timeout 387 + * expiration. 388 + */ 389 + enum iwl_tof_response_mode { 390 + IWL_MVM_TOF_RESPONSE_ASAP, 391 + IWL_MVM_TOF_RESPONSE_TIMEOUT, 392 + IWL_MVM_TOF_RESPONSE_COMPLETE, 393 + }; 394 + 395 + /** 396 + * enum iwl_tof_initiator_flags 397 + * 398 + * @IWL_TOF_INITIATOR_FLAGS_FAST_ALGO_DISABLED: disable fast algo, meaning run 399 + * the algo on ant A+B, instead of only one of them. 400 + * @IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_A: open RX antenna A for FTMs RX 401 + * @IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_B: open RX antenna B for FTMs RX 402 + * @IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_C: open RX antenna C for FTMs RX 403 + * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_A: use antenna A fo TX ACKs during FTM 404 + * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_B: use antenna B fo TX ACKs during FTM 405 + * @IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_C: use antenna C fo TX ACKs during FTM 406 + * @IWL_TOF_INITIATOR_FLAGS_MINDELTA_NO_PREF: no preference for minDeltaFTM 407 + */ 408 + enum iwl_tof_initiator_flags { 409 + IWL_TOF_INITIATOR_FLAGS_FAST_ALGO_DISABLED = BIT(0), 410 + IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_A = BIT(1), 411 + IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_B = BIT(2), 412 + IWL_TOF_INITIATOR_FLAGS_RX_CHAIN_SEL_C = BIT(3), 413 + IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_A = BIT(4), 414 + IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_B = BIT(5), 415 + IWL_TOF_INITIATOR_FLAGS_TX_CHAIN_SEL_C = BIT(6), 416 + IWL_TOF_INITIATOR_FLAGS_MINDELTA_NO_PREF = BIT(7), 417 + }; /* LOCATION_RANGE_REQ_CMD_API_S_VER_5 */ 418 + 419 + #define IWL_MVM_TOF_MAX_APS 5 420 + #define IWL_MVM_TOF_MAX_TWO_SIDED_APS 5 421 + 422 + /** 423 + * struct iwl_tof_range_req_cmd - start measurement cmd 424 + * @initiator_flags: see flags @ iwl_tof_initiator_flags 425 + * @request_id: A Token incremented per request. The same Token will be 426 + * sent back in the range response 427 + * @initiator: 0- NW initiated, 1 - Client Initiated 428 + * @one_sided_los_disable: '0'- run ML-Algo for both ToF/OneSided, 429 + * '1' - run ML-Algo for ToF only 430 + * @req_timeout: Requested timeout of the response in units of 100ms. 431 + * This is equivalent to the session time configured to the 432 + * LMAC in Initiator Request 433 + * @report_policy: Supported partially for this release: For current release - 434 + * the range report will be uploaded as a batch when ready or 435 + * when the session is done (successfully / partially). 436 + * one of iwl_tof_response_mode. 437 + * @reserved0: reserved 438 + * @num_of_ap: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS) 439 + * @macaddr_random: '0' Use default source MAC address (i.e. p2_p), 440 + * '1' Use MAC Address randomization according to the below 441 + * @range_req_bssid: ranging request BSSID 442 + * @macaddr_template: MAC address template to use for non-randomized bits 443 + * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template. 444 + * Bits set to 1 shall be randomized by the UMAC 445 + * @ftm_rx_chains: Rx chain to open to receive Responder's FTMs (XVT) 446 + * @ftm_tx_chains: Tx chain to send the ack to the Responder FTM (XVT) 447 + * @common_calib: The common calib value to inject to this measurement calc 448 + * @specific_calib: The specific calib value to inject to this measurement calc 449 + * @ap: per-AP request data 450 + */ 451 + struct iwl_tof_range_req_cmd { 452 + __le32 initiator_flags; 453 + u8 request_id; 454 + u8 initiator; 455 + u8 one_sided_los_disable; 456 + u8 req_timeout; 457 + u8 report_policy; 458 + u8 reserved0; 459 + u8 num_of_ap; 460 + u8 macaddr_random; 461 + u8 range_req_bssid[ETH_ALEN]; 462 + u8 macaddr_template[ETH_ALEN]; 463 + u8 macaddr_mask[ETH_ALEN]; 464 + u8 ftm_rx_chains; 465 + u8 ftm_tx_chains; 466 + __le16 common_calib; 467 + __le16 specific_calib; 468 + struct iwl_tof_range_req_ap_entry ap[IWL_MVM_TOF_MAX_APS]; 469 + } __packed; 470 + /* LOCATION_RANGE_REQ_CMD_API_S_VER_5 */ 471 + 472 + /* 473 + * enum iwl_tof_range_request_status - status of the sent request 474 + * @IWL_TOF_RANGE_REQUEST_STATUS_SUCCESSFUL - FW successfully received the 475 + * request 476 + * @IWL_TOF_RANGE_REQUEST_STATUS_BUSY - FW is busy with a previous request, the 477 + * sent request will not be handled 478 + */ 479 + enum iwl_tof_range_request_status { 480 + IWL_TOF_RANGE_REQUEST_STATUS_SUCCESS, 481 + IWL_TOF_RANGE_REQUEST_STATUS_BUSY, 482 + }; 483 + 484 + /** 485 + * enum iwl_tof_entry_status 486 + * 487 + * @IWL_TOF_ENTRY_SUCCESS: successful measurement. 488 + * @IWL_TOF_ENTRY_GENERAL_FAILURE: General failure. 489 + * @IWL_TOF_ENTRY_NO_RESPONSE: Responder didn't reply to the request. 490 + * @IWL_TOF_ENTRY_REQUEST_REJECTED: Responder rejected the request. 491 + * @IWL_TOF_ENTRY_NOT_SCHEDULED: Time event was scheduled but not called yet. 492 + * @IWL_TOF_ENTRY_TIMING_MEASURE_TIMEOUT: Time event triggered but no 493 + * measurement was completed. 494 + * @IWL_TOF_ENTRY_TARGET_DIFF_CH_CANNOT_CHANGE: No range due inability to switch 495 + * from the primary channel. 496 + * @IWL_TOF_ENTRY_RANGE_NOT_SUPPORTED: Device doesn't support FTM. 497 + * @IWL_TOF_ENTRY_REQUEST_ABORT_UNKNOWN_REASON: Request aborted due to unknown 498 + * reason. 499 + * @IWL_TOF_ENTRY_LOCATION_INVALID_T1_T4_TIME_STAMP: Failure due to invalid 500 + * T1/T4. 501 + * @IWL_TOF_ENTRY_11MC_PROTOCOL_FAILURE: Failure due to invalid FTM frame 502 + * structure. 503 + * @IWL_TOF_ENTRY_REQUEST_CANNOT_SCHED: Request cannot be scheduled. 504 + * @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE: Responder cannot serve the 505 + * initiator for some period, period supplied in @refusal_period. 506 + * @IWL_TOF_ENTRY_BAD_REQUEST_ARGS: Bad request arguments. 507 + * @IWL_TOF_ENTRY_WIFI_NOT_ENABLED: Wifi not enabled. 508 + * @IWL_TOF_ENTRY_RESPONDER_OVERRIDE_PARAMS: Responder override the original 509 + * parameters within the current session. 510 + */ 511 + enum iwl_tof_entry_status { 512 + IWL_TOF_ENTRY_SUCCESS = 0, 513 + IWL_TOF_ENTRY_GENERAL_FAILURE = 1, 514 + IWL_TOF_ENTRY_NO_RESPONSE = 2, 515 + IWL_TOF_ENTRY_REQUEST_REJECTED = 3, 516 + IWL_TOF_ENTRY_NOT_SCHEDULED = 4, 517 + IWL_TOF_ENTRY_TIMING_MEASURE_TIMEOUT = 5, 518 + IWL_TOF_ENTRY_TARGET_DIFF_CH_CANNOT_CHANGE = 6, 519 + IWL_TOF_ENTRY_RANGE_NOT_SUPPORTED = 7, 520 + IWL_TOF_ENTRY_REQUEST_ABORT_UNKNOWN_REASON = 8, 521 + IWL_TOF_ENTRY_LOCATION_INVALID_T1_T4_TIME_STAMP = 9, 522 + IWL_TOF_ENTRY_11MC_PROTOCOL_FAILURE = 10, 523 + IWL_TOF_ENTRY_REQUEST_CANNOT_SCHED = 11, 524 + IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE = 12, 525 + IWL_TOF_ENTRY_BAD_REQUEST_ARGS = 13, 526 + IWL_TOF_ENTRY_WIFI_NOT_ENABLED = 14, 527 + IWL_TOF_ENTRY_RESPONDER_OVERRIDE_PARAMS = 15, 528 + }; /* LOCATION_RANGE_RSP_AP_ENTRY_NTFY_API_S_VER_2 */ 529 + 530 + /** 531 + * struct iwl_tof_range_rsp_ap_entry_ntfy - AP parameters (response) 532 + * @bssid: BSSID of the AP 533 + * @measure_status: current APs measurement status, one of 534 + * &enum iwl_tof_entry_status. 535 + * @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz 536 + * @rtt: The Round Trip Time that took for the last measurement for 537 + * current AP [pSec] 538 + * @rtt_variance: The Variance of the RTT values measured for current AP 539 + * @rtt_spread: The Difference between the maximum and the minimum RTT 540 + * values measured for current AP in the current session [pSec] 541 + * @rssi: RSSI as uploaded in the Channel Estimation notification 542 + * @rssi_spread: The Difference between the maximum and the minimum RSSI values 543 + * measured for current AP in the current session 544 + * @reserved: reserved 545 + * @refusal_period: refusal period in case of 546 + * @IWL_TOF_ENTRY_RESPONDER_CANNOT_COLABORATE [sec] 547 + * @range: Measured range [cm] 548 + * @range_variance: Measured range variance [cm] 549 + * @timestamp: The GP2 Clock [usec] where Channel Estimation notification was 550 + * uploaded by the LMAC 551 + * @t2t3_initiator: as calculated from the algo in the initiator 552 + * @t1t4_responder: as calculated from the algo in the responder 553 + * @common_calib: Calib val that was used in for this AP measurement 554 + * @specific_calib: val that was used in for this AP measurement 555 + * @papd_calib_output: The result of the tof papd calibration that was injected 556 + * into the algorithm. 557 + */ 558 + struct iwl_tof_range_rsp_ap_entry_ntfy { 559 + u8 bssid[ETH_ALEN]; 560 + u8 measure_status; 561 + u8 measure_bw; 562 + __le32 rtt; 563 + __le32 rtt_variance; 564 + __le32 rtt_spread; 565 + s8 rssi; 566 + u8 rssi_spread; 567 + u8 reserved; 568 + u8 refusal_period; 569 + __le32 range; 570 + __le32 range_variance; 571 + __le32 timestamp; 572 + __le32 t2t3_initiator; 573 + __le32 t1t4_responder; 574 + __le16 common_calib; 575 + __le16 specific_calib; 576 + __le32 papd_calib_output; 577 + } __packed; /* LOCATION_RANGE_RSP_AP_ETRY_NTFY_API_S_VER_3 */ 578 + 579 + /** 580 + * enum iwl_tof_response_status - tof response status 581 + * 582 + * @IWL_TOF_RESPONSE_SUCCESS: successful range. 583 + * @IWL_TOF_RESPONSE_TIMEOUT: request aborted due to timeout expiration. 584 + * partial result of ranges done so far is included in the response. 585 + * @IWL_TOF_RESPONSE_ABORTED: Measurement aborted by command. 586 + * @IWL_TOF_RESPONSE_FAILED: Measurement request command failed. 587 + */ 588 + enum iwl_tof_response_status { 589 + IWL_TOF_RESPONSE_SUCCESS = 0, 590 + IWL_TOF_RESPONSE_TIMEOUT = 1, 591 + IWL_TOF_RESPONSE_ABORTED = 4, 592 + IWL_TOF_RESPONSE_FAILED = 5, 593 + }; /* LOCATION_RNG_RSP_STATUS */ 594 + 595 + /** 596 + * struct iwl_tof_range_rsp_ntfy - ranging response notification 597 + * @request_id: A Token ID of the corresponding Range request 598 + * @request_status: status of current measurement session, one of 599 + * &enum iwl_tof_response_status. 600 + * @last_in_batch: reprot policy (when not all responses are uploaded at once) 601 + * @num_of_aps: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS) 602 + * @ap: per-AP data 603 + */ 604 + struct iwl_tof_range_rsp_ntfy { 605 + u8 request_id; 606 + u8 request_status; 607 + u8 last_in_batch; 608 + u8 num_of_aps; 609 + struct iwl_tof_range_rsp_ap_entry_ntfy ap[IWL_MVM_TOF_MAX_APS]; 610 + } __packed; 611 + 612 + #define IWL_MVM_TOF_MCSI_BUF_SIZE (245) 613 + /** 614 + * struct iwl_tof_mcsi_notif - used for debug 615 + * @token: token ID for the current session 616 + * @role: '0' - initiator, '1' - responder 617 + * @reserved: reserved 618 + * @initiator_bssid: initiator machine 619 + * @responder_bssid: responder machine 620 + * @mcsi_buffer: debug data 621 + */ 622 + struct iwl_tof_mcsi_notif { 623 + u8 token; 624 + u8 role; 625 + __le16 reserved; 626 + u8 initiator_bssid[ETH_ALEN]; 627 + u8 responder_bssid[ETH_ALEN]; 628 + u8 mcsi_buffer[IWL_MVM_TOF_MCSI_BUF_SIZE * 4]; 629 + } __packed; 630 + 631 + /** 632 + * struct iwl_tof_range_abort_cmd 633 + * @request_id: corresponds to a range request 634 + * @reserved: reserved 635 + */ 636 + struct iwl_tof_range_abort_cmd { 637 + u8 request_id; 638 + u8 reserved[3]; 639 + } __packed; 640 + 641 + enum ftm_responder_stats_flags { 642 + FTM_RESP_STAT_NON_ASAP_STARTED = BIT(0), 643 + FTM_RESP_STAT_NON_ASAP_IN_WIN = BIT(1), 644 + FTM_RESP_STAT_NON_ASAP_OUT_WIN = BIT(2), 645 + FTM_RESP_STAT_TRIGGER_DUP = BIT(3), 646 + FTM_RESP_STAT_DUP = BIT(4), 647 + FTM_RESP_STAT_DUP_IN_WIN = BIT(5), 648 + FTM_RESP_STAT_DUP_OUT_WIN = BIT(6), 649 + FTM_RESP_STAT_SCHED_SUCCESS = BIT(7), 650 + FTM_RESP_STAT_ASAP_REQ = BIT(8), 651 + FTM_RESP_STAT_NON_ASAP_REQ = BIT(9), 652 + FTM_RESP_STAT_ASAP_RESP = BIT(10), 653 + FTM_RESP_STAT_NON_ASAP_RESP = BIT(11), 654 + FTM_RESP_STAT_FAIL_INITIATOR_INACTIVE = BIT(12), 655 + FTM_RESP_STAT_FAIL_INITIATOR_OUT_WIN = BIT(13), 656 + FTM_RESP_STAT_FAIL_INITIATOR_RETRY_LIM = BIT(14), 657 + FTM_RESP_STAT_FAIL_NEXT_SERVED = BIT(15), 658 + FTM_RESP_STAT_FAIL_TRIGGER_ERR = BIT(16), 659 + FTM_RESP_STAT_FAIL_GC = BIT(17), 660 + FTM_RESP_STAT_SUCCESS = BIT(18), 661 + FTM_RESP_STAT_INTEL_IE = BIT(19), 662 + FTM_RESP_STAT_INITIATOR_ACTIVE = BIT(20), 663 + FTM_RESP_STAT_MEASUREMENTS_AVAILABLE = BIT(21), 664 + FTM_RESP_STAT_TRIGGER_UNKNOWN = BIT(22), 665 + FTM_RESP_STAT_PROCESS_FAIL = BIT(23), 666 + FTM_RESP_STAT_ACK = BIT(24), 667 + FTM_RESP_STAT_NACK = BIT(25), 668 + FTM_RESP_STAT_INVALID_INITIATOR_ID = BIT(26), 669 + FTM_RESP_STAT_TIMER_MIN_DELTA = BIT(27), 670 + FTM_RESP_STAT_INITIATOR_REMOVED = BIT(28), 671 + FTM_RESP_STAT_INITIATOR_ADDED = BIT(29), 672 + FTM_RESP_STAT_ERR_LIST_FULL = BIT(30), 673 + FTM_RESP_STAT_INITIATOR_SCHED_NOW = BIT(31), 674 + }; /* RESP_IND_E */ 675 + 676 + /** 677 + * struct iwl_ftm_responder_stats - FTM responder statistics 678 + * @addr: initiator address 679 + * @success_ftm: number of successful ftm frames 680 + * @ftm_per_burst: num of FTM frames that were received 681 + * @flags: &enum ftm_responder_stats_flags 682 + * @duration: actual duration of FTM 683 + * @allocated_duration: time that was allocated for this FTM session 684 + * @bw: FTM request bandwidth 685 + * @rate: FTM request rate 686 + * @reserved: for alingment and future use 687 + */ 688 + struct iwl_ftm_responder_stats { 689 + u8 addr[ETH_ALEN]; 690 + u8 success_ftm; 691 + u8 ftm_per_burst; 692 + __le32 flags; 693 + __le32 duration; 694 + __le32 allocated_duration; 695 + u8 bw; 696 + u8 rate; 697 + __le16 reserved; 698 + } __packed; /* TOF_RESPONDER_STATISTICS_NTFY_S_VER_2 */ 699 + 700 + #define IWL_CSI_CHUNK_CTL_NUM_MASK 0x3 701 + #define IWL_CSI_CHUNK_CTL_IDX_MASK 0xc 702 + 703 + struct iwl_csi_chunk_notification { 704 + __le32 token; 705 + __le16 seq; 706 + __le16 ctl; 707 + __le32 size; 708 + u8 data[]; 709 + } __packed; /* CSI_CHUNKS_HDR_NTFY_API_S_VER_1 */ 710 + 711 + #endif /* __iwl_fw_api_location_h__ */
+41 -10
drivers/net/wireless/intel/iwlwifi/fw/api/phy-ctxt.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 12 * 12 13 * This program is free software; you can redistribute it and/or modify 13 14 * it under the terms of version 2 of the GNU General Public License as ··· 31 30 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 32 31 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 33 32 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 33 + * Copyright(c) 2018 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 97 95 #define PHY_VHT_CTRL_POS_4_ABOVE (0x7) 98 96 99 97 /* 98 + * struct iwl_fw_channel_info_v1 - channel information 99 + * 100 100 * @band: PHY_BAND_* 101 101 * @channel: channel number 102 102 * @width: PHY_[VHT|LEGACY]_CHANNEL_* 103 103 * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_* 104 104 */ 105 - struct iwl_fw_channel_info { 105 + struct iwl_fw_channel_info_v1 { 106 106 u8 band; 107 107 u8 channel; 108 108 u8 width; 109 109 u8 ctrl_pos; 110 - } __packed; 110 + } __packed; /* CHANNEL_CONFIG_API_S_VER_1 */ 111 + 112 + /* 113 + * struct iwl_fw_channel_info - channel information 114 + * 115 + * @channel: channel number 116 + * @band: PHY_BAND_* 117 + * @width: PHY_[VHT|LEGACY]_CHANNEL_* 118 + * @ctrl channel: PHY_[VHT|LEGACY]_CTRL_* 119 + * @reserved: for future use and alignment 120 + */ 121 + struct iwl_fw_channel_info { 122 + __le32 channel; 123 + u8 band; 124 + u8 width; 125 + u8 ctrl_pos; 126 + u8 reserved; 127 + } __packed; /*CHANNEL_CONFIG_API_S_VER_2 */ 111 128 112 129 #define PHY_RX_CHAIN_DRIVER_FORCE_POS (0) 113 130 #define PHY_RX_CHAIN_DRIVER_FORCE_MSK \ ··· 155 134 156 135 /* TODO: complete missing documentation */ 157 136 /** 137 + * struct iwl_phy_context_cmd_tail - tail of iwl_phy_ctx_cmd for alignment with 138 + * various channel structures. 139 + * 140 + * @txchain_info: ??? 141 + * @rxchain_info: ??? 142 + * @acquisition_data: ??? 143 + * @dsp_cfg_flags: set to 0 144 + */ 145 + struct iwl_phy_context_cmd_tail { 146 + __le32 txchain_info; 147 + __le32 rxchain_info; 148 + __le32 acquisition_data; 149 + __le32 dsp_cfg_flags; 150 + } __packed; 151 + 152 + /** 158 153 * struct iwl_phy_context_cmd - config of the PHY context 159 154 * ( PHY_CONTEXT_CMD = 0x8 ) 160 155 * @id_and_color: ID and color of the relevant Binding ··· 179 142 * other value means apply new params after X usecs 180 143 * @tx_param_color: ??? 181 144 * @ci: channel info 182 - * @txchain_info: ??? 183 - * @rxchain_info: ??? 184 - * @acquisition_data: ??? 185 - * @dsp_cfg_flags: set to 0 145 + * @tail: command tail 186 146 */ 187 147 struct iwl_phy_context_cmd { 188 148 /* COMMON_INDEX_HDR_API_S_VER_1 */ ··· 189 155 __le32 apply_time; 190 156 __le32 tx_param_color; 191 157 struct iwl_fw_channel_info ci; 192 - __le32 txchain_info; 193 - __le32 rxchain_info; 194 - __le32 acquisition_data; 195 - __le32 dsp_cfg_flags; 158 + struct iwl_phy_context_cmd_tail tail; 196 159 } __packed; /* PHY_CONTEXT_CMD_API_VER_1 */ 197 160 198 161 #endif /* __iwl_fw_api_phy_ctxt_h__ */
+6 -5
drivers/net/wireless/intel/iwlwifi/fw/api/rx.h
··· 209 209 * @RX_MPDU_RES_STATUS_CSUM_OK: checksum found no errors 210 210 * @RX_MPDU_RES_STATUS_STA_ID_MSK: station ID mask 211 211 * @RX_MDPU_RES_STATUS_STA_ID_SHIFT: station ID bit shift 212 - * @RX_MPDU_RES_STATUS_FILTERING_MSK: filter status 213 - * @RX_MPDU_RES_STATUS2_FILTERING_MSK: filter status 2 214 212 */ 215 213 enum iwl_mvm_rx_status { 216 214 RX_MPDU_RES_STATUS_CRC_OK = BIT(0), ··· 236 238 RX_MPDU_RES_STATUS_CSUM_OK = BIT(17), 237 239 RX_MDPU_RES_STATUS_STA_ID_SHIFT = 24, 238 240 RX_MPDU_RES_STATUS_STA_ID_MSK = 0x1f << RX_MDPU_RES_STATUS_STA_ID_SHIFT, 239 - RX_MPDU_RES_STATUS_FILTERING_MSK = (0xc00000), 240 - RX_MPDU_RES_STATUS2_FILTERING_MSK = (0xc0000000), 241 241 }; 242 242 243 243 /* 9000 series API */ ··· 333 337 IWL_RX_MPDU_PHY_AMPDU = BIT(5), 334 338 IWL_RX_MPDU_PHY_AMPDU_TOGGLE = BIT(6), 335 339 IWL_RX_MPDU_PHY_SHORT_PREAMBLE = BIT(7), 340 + /* short preamble is only for CCK, for non-CCK overridden by this */ 341 + IWL_RX_MPDU_PHY_NCCK_ADDTL_NTFY = BIT(7), 336 342 IWL_RX_MPDU_PHY_TSF_OVERLOAD = BIT(8), 337 343 }; 338 344 ··· 721 723 #define RX_NO_DATA_FRAME_TIME_POS 0 722 724 #define RX_NO_DATA_FRAME_TIME_MSK (0xfffff << RX_NO_DATA_FRAME_TIME_POS) 723 725 726 + #define RX_NO_DATA_RX_VEC0_HE_NSTS_MSK 0x03800000 727 + #define RX_NO_DATA_RX_VEC0_VHT_NSTS_MSK 0x38000000 728 + 724 729 /** 725 730 * struct iwl_rx_no_data - RX no data descriptor 726 731 * @info: 7:0 frame type, 15:8 RX error type ··· 744 743 __le32 fr_time; 745 744 __le32 rate; 746 745 __le32 phy_info[2]; 747 - __le32 rx_vec[3]; 746 + __le32 rx_vec[2]; 748 747 } __packed; /* RX_NO_DATA_NTFY_API_S_VER_1 */ 749 748 750 749 /**
+5 -10
drivers/net/wireless/intel/iwlwifi/fw/api/stats.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 12 * 12 13 * This program is free software; you can redistribute it and/or modify 13 14 * it under the terms of version 2 of the GNU General Public License as ··· 30 29 * 31 30 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 32 31 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 32 + * Copyright (C) 2018 Intel Corporation 33 33 * All rights reserved. 34 34 * 35 35 * Redistribution and use in source and binary forms, with or without ··· 365 363 u8 reserved[4 - (NUM_MAC_INDEX % 4)]; 366 364 } __packed; /* STATISTICS_GENERAL_API_S_VER_8 */ 367 365 368 - struct mvm_statistics_general_cdb_v9 { 369 - struct mvm_statistics_general_common_v19 common; 370 - __le32 beacon_counter[NUM_MAC_INDEX_CDB]; 371 - u8 beacon_average_energy[NUM_MAC_INDEX_CDB]; 372 - u8 reserved[4 - (NUM_MAC_INDEX_CDB % 4)]; 373 - } __packed; /* STATISTICS_GENERAL_API_S_VER_9 */ 374 - 375 - struct mvm_statistics_general_cdb { 366 + struct mvm_statistics_general { 376 367 struct mvm_statistics_general_common common; 377 368 __le32 beacon_counter[MAC_INDEX_AUX]; 378 369 u8 beacon_average_energy[MAC_INDEX_AUX]; ··· 430 435 struct mvm_statistics_load_v1 load_stats; 431 436 } __packed; /* STATISTICS_NTFY_API_S_VER_11 */ 432 437 433 - struct iwl_notif_statistics_cdb { 438 + struct iwl_notif_statistics { 434 439 __le32 flag; 435 440 struct mvm_statistics_rx rx; 436 441 struct mvm_statistics_tx tx; 437 - struct mvm_statistics_general_cdb general; 442 + struct mvm_statistics_general general; 438 443 struct mvm_statistics_load load_stats; 439 444 } __packed; /* STATISTICS_NTFY_API_S_VER_13 */ 440 445
+15 -4
drivers/net/wireless/intel/iwlwifi/fw/api/tdls.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 12 * 12 13 * This program is free software; you can redistribute it and/or modify 13 14 * it under the terms of version 2 of the GNU General Public License as ··· 31 30 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 32 31 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 33 32 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 33 + * Copyright(c) 2018 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 113 111 } __packed; /* TDLS_STA_CHANNEL_SWITCH_FRAME_API_S_VER_1 */ 114 112 115 113 /** 114 + * struct iwl_tdls_channel_switch_cmd_tail - tail of iwl_tdls_channel_switch_cmd 115 + * 116 + * @timing: timing related data for command 117 + * @frame: channel-switch request/response template, depending to switch_type 118 + */ 119 + struct iwl_tdls_channel_switch_cmd_tail { 120 + struct iwl_tdls_channel_switch_timing timing; 121 + struct iwl_tdls_channel_switch_frame frame; 122 + } __packed; 123 + 124 + /** 116 125 * struct iwl_tdls_channel_switch_cmd - TDLS channel switch command 117 126 * 118 127 * The command is sent to initiate a channel switch and also in response to ··· 132 119 * @switch_type: see &enum iwl_tdls_channel_switch_type 133 120 * @peer_sta_id: station id of TDLS peer 134 121 * @ci: channel we switch to 135 - * @timing: timing related data for command 136 - * @frame: channel-switch request/response template, depending to switch_type 122 + * @tail: command tail 137 123 */ 138 124 struct iwl_tdls_channel_switch_cmd { 139 125 u8 switch_type; 140 126 __le32 peer_sta_id; 141 127 struct iwl_fw_channel_info ci; 142 - struct iwl_tdls_channel_switch_timing timing; 143 - struct iwl_tdls_channel_switch_frame frame; 128 + struct iwl_tdls_channel_switch_cmd_tail tail; 144 129 } __packed; /* TDLS_STA_CHANNEL_SWITCH_CMD_API_S_VER_1 */ 145 130 146 131 /**
+22 -12
drivers/net/wireless/intel/iwlwifi/fw/api/time-event.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 12 * 12 13 * This program is free software; you can redistribute it and/or modify 13 14 * it under the terms of version 2 of the GNU General Public License as ··· 31 30 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 32 31 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 33 32 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 33 + * Copyright(c) 2018 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 320 318 } __packed; /* MAC_TIME_EVENT_NTFY_API_S_VER_1 */ 321 319 322 320 /* 321 + * struct iwl_hs20_roc_req_tail - tail of iwl_hs20_roc_req 322 + * 323 + * @node_addr: Our MAC Address 324 + * @reserved: reserved for alignment 325 + * @apply_time: GP2 value to start (should always be the current GP2 value) 326 + * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max 327 + * time by which start of the event is allowed to be postponed. 328 + * @duration: event duration in TU To calculate event duration: 329 + * timeEventDuration = min(duration, remainingQuota) 330 + */ 331 + struct iwl_hs20_roc_req_tail { 332 + u8 node_addr[ETH_ALEN]; 333 + __le16 reserved; 334 + __le32 apply_time; 335 + __le32 apply_time_max_delay; 336 + __le32 duration; 337 + } __packed; 338 + 339 + /* 323 340 * Aux ROC command 324 341 * 325 342 * Command requests the firmware to create a time event for a certain duration ··· 357 336 * @sta_id_and_color: station id and color, resumed during "Remain On Channel" 358 337 * activity. 359 338 * @channel_info: channel info 360 - * @node_addr: Our MAC Address 361 - * @reserved: reserved for alignment 362 - * @apply_time: GP2 value to start (should always be the current GP2 value) 363 - * @apply_time_max_delay: Maximum apply time delay value in TU. Defines max 364 - * time by which start of the event is allowed to be postponed. 365 - * @duration: event duration in TU To calculate event duration: 366 - * timeEventDuration = min(duration, remainingQuota) 367 339 */ 368 340 struct iwl_hs20_roc_req { 369 341 /* COMMON_INDEX_HDR_API_S_VER_1 hdr */ ··· 365 351 __le32 event_unique_id; 366 352 __le32 sta_id_and_color; 367 353 struct iwl_fw_channel_info channel_info; 368 - u8 node_addr[ETH_ALEN]; 369 - __le16 reserved; 370 - __le32 apply_time; 371 - __le32 apply_time_max_delay; 372 - __le32 duration; 354 + struct iwl_hs20_roc_req_tail tail; 373 355 } __packed; /* HOT_SPOT_CMD_API_S_VER_1 */ 374 356 375 357 /*
-393
drivers/net/wireless/intel/iwlwifi/fw/api/tof.h
··· 1 - /****************************************************************************** 2 - * 3 - * This file is provided under a dual BSD/GPLv2 license. When using or 4 - * redistributing this file, you may do so under either license. 5 - * 6 - * GPL LICENSE SUMMARY 7 - * 8 - * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 9 - * 10 - * This program is free software; you can redistribute it and/or modify 11 - * it under the terms of version 2 of the GNU General Public License as 12 - * published by the Free Software Foundation. 13 - * 14 - * This program is distributed in the hope that it will be useful, but 15 - * WITHOUT ANY WARRANTY; without even the implied warranty of 16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 - * General Public License for more details. 18 - * 19 - * The full GNU General Public License is included in this distribution 20 - * in the file called COPYING. 21 - * 22 - * Contact Information: 23 - * Intel Linux Wireless <linuxwifi@intel.com> 24 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 25 - * 26 - * BSD LICENSE 27 - * 28 - * Copyright(c) 2015 - 2017 Intel Deutschland GmbH 29 - * All rights reserved. 30 - * 31 - * Redistribution and use in source and binary forms, with or without 32 - * modification, are permitted provided that the following conditions 33 - * are met: 34 - * 35 - * * Redistributions of source code must retain the above copyright 36 - * notice, this list of conditions and the following disclaimer. 37 - * * Redistributions in binary form must reproduce the above copyright 38 - * notice, this list of conditions and the following disclaimer in 39 - * the documentation and/or other materials provided with the 40 - * distribution. 41 - * * Neither the name Intel Corporation nor the names of its 42 - * contributors may be used to endorse or promote products derived 43 - * from this software without specific prior written permission. 44 - * 45 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 46 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 47 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 48 - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 49 - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 50 - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 51 - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 52 - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 53 - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 54 - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 55 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 56 - * 57 - *****************************************************************************/ 58 - #ifndef __iwl_fw_api_tof_h__ 59 - #define __iwl_fw_api_tof_h__ 60 - 61 - /* ToF sub-group command IDs */ 62 - enum iwl_mvm_tof_sub_grp_ids { 63 - TOF_RANGE_REQ_CMD = 0x1, 64 - TOF_CONFIG_CMD = 0x2, 65 - TOF_RANGE_ABORT_CMD = 0x3, 66 - TOF_RANGE_REQ_EXT_CMD = 0x4, 67 - TOF_RESPONDER_CONFIG_CMD = 0x5, 68 - TOF_NW_INITIATED_RES_SEND_CMD = 0x6, 69 - TOF_NEIGHBOR_REPORT_REQ_CMD = 0x7, 70 - TOF_NEIGHBOR_REPORT_RSP_NOTIF = 0xFC, 71 - TOF_NW_INITIATED_REQ_RCVD_NOTIF = 0xFD, 72 - TOF_RANGE_RESPONSE_NOTIF = 0xFE, 73 - TOF_MCSI_DEBUG_NOTIF = 0xFB, 74 - }; 75 - 76 - /** 77 - * struct iwl_tof_config_cmd - ToF configuration 78 - * @tof_disabled: 0 enabled, 1 - disabled 79 - * @one_sided_disabled: 0 enabled, 1 - disabled 80 - * @is_debug_mode: 1 debug mode, 0 - otherwise 81 - * @is_buf_required: 1 channel estimation buffer required, 0 - otherwise 82 - */ 83 - struct iwl_tof_config_cmd { 84 - __le32 sub_grp_cmd_id; 85 - u8 tof_disabled; 86 - u8 one_sided_disabled; 87 - u8 is_debug_mode; 88 - u8 is_buf_required; 89 - } __packed; 90 - 91 - /** 92 - * struct iwl_tof_responder_config_cmd - ToF AP mode (for debug) 93 - * @burst_period: future use: (currently hard coded in the LMAC) 94 - * The interval between two sequential bursts. 95 - * @min_delta_ftm: future use: (currently hard coded in the LMAC) 96 - * The minimum delay between two sequential FTM Responses 97 - * in the same burst. 98 - * @burst_duration: future use: (currently hard coded in the LMAC) 99 - * The total time for all FTMs handshake in the same burst. 100 - * Affect the time events duration in the LMAC. 101 - * @num_of_burst_exp: future use: (currently hard coded in the LMAC) 102 - * The number of bursts for the current ToF request. Affect 103 - * the number of events allocations in the current iteration. 104 - * @get_ch_est: for xVT only, NA for driver 105 - * @abort_responder: when set to '1' - Responder will terminate its activity 106 - * (all other fields in the command are ignored) 107 - * @recv_sta_req_params: 1 - Responder will ignore the other Responder's 108 - * params and use the recomended Initiator params. 109 - * 0 - otherwise 110 - * @channel_num: current AP Channel 111 - * @bandwidth: current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz 112 - * @rate: current AP rate 113 - * @ctrl_ch_position: coding of the control channel position relative to 114 - * the center frequency: 115 - * 116 - * 40 MHz 117 - * 0 below center, 1 above center 118 - * 119 - * 80 MHz 120 - * bits [0..1] 121 - * * 0 the near 20MHz to the center, 122 - * * 1 the far 20MHz to the center 123 - * bit[2] 124 - * as above 40MHz 125 - * @ftm_per_burst: FTMs per Burst 126 - * @ftm_resp_ts_avail: '0' - we don't measure over the Initial FTM Response, 127 - * '1' - we measure over the Initial FTM Response 128 - * @asap_mode: ASAP / Non ASAP mode for the current WLS station 129 - * @sta_id: index of the AP STA when in AP mode 130 - * @tsf_timer_offset_msecs: The dictated time offset (mSec) from the AP's TSF 131 - * @toa_offset: Artificial addition [0.1nsec] for the ToA - to be used for debug 132 - * purposes, simulating station movement by adding various values 133 - * to this field 134 - * @bssid: Current AP BSSID 135 - */ 136 - struct iwl_tof_responder_config_cmd { 137 - __le32 sub_grp_cmd_id; 138 - __le16 burst_period; 139 - u8 min_delta_ftm; 140 - u8 burst_duration; 141 - u8 num_of_burst_exp; 142 - u8 get_ch_est; 143 - u8 abort_responder; 144 - u8 recv_sta_req_params; 145 - u8 channel_num; 146 - u8 bandwidth; 147 - u8 rate; 148 - u8 ctrl_ch_position; 149 - u8 ftm_per_burst; 150 - u8 ftm_resp_ts_avail; 151 - u8 asap_mode; 152 - u8 sta_id; 153 - __le16 tsf_timer_offset_msecs; 154 - __le16 toa_offset; 155 - u8 bssid[ETH_ALEN]; 156 - } __packed; 157 - 158 - /** 159 - * struct iwl_tof_range_request_ext_cmd - extended range req for WLS 160 - * @tsf_timer_offset_msec: the recommended time offset (mSec) from the AP's TSF 161 - * @reserved: reserved 162 - * @min_delta_ftm: Minimal time between two consecutive measurements, 163 - * in units of 100us. 0 means no preference by station 164 - * @ftm_format_and_bw20M: FTM Channel Spacing/Format for 20MHz: recommended 165 - * value be sent to the AP 166 - * @ftm_format_and_bw40M: FTM Channel Spacing/Format for 40MHz: recommended 167 - * value to be sent to the AP 168 - * @ftm_format_and_bw80M: FTM Channel Spacing/Format for 80MHz: recommended 169 - * value to be sent to the AP 170 - */ 171 - struct iwl_tof_range_req_ext_cmd { 172 - __le32 sub_grp_cmd_id; 173 - __le16 tsf_timer_offset_msec; 174 - __le16 reserved; 175 - u8 min_delta_ftm; 176 - u8 ftm_format_and_bw20M; 177 - u8 ftm_format_and_bw40M; 178 - u8 ftm_format_and_bw80M; 179 - } __packed; 180 - 181 - #define IWL_MVM_TOF_MAX_APS 21 182 - 183 - /** 184 - * struct iwl_tof_range_req_ap_entry - AP configuration parameters 185 - * @channel_num: Current AP Channel 186 - * @bandwidth: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz 187 - * @tsf_delta_direction: TSF relatively to the subject AP 188 - * @ctrl_ch_position: Coding of the control channel position relative to the 189 - * center frequency. 190 - * 40MHz 0 below center, 1 above center 191 - * 80MHz bits [0..1]: 0 the near 20MHz to the center, 192 - * 1 the far 20MHz to the center 193 - * bit[2] as above 40MHz 194 - * @bssid: AP's bss id 195 - * @measure_type: Measurement type: 0 - two sided, 1 - One sided 196 - * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of the 197 - * number of measurement iterations (min 2^0 = 1, max 2^14) 198 - * @burst_period: Recommended value to be sent to the AP. Measurement 199 - * periodicity In units of 100ms. ignored if num_of_bursts = 0 200 - * @samples_per_burst: 2-sided: the number of FTMs pairs in single Burst (1-31) 201 - * 1-sided: how many rts/cts pairs should be used per burst. 202 - * @retries_per_sample: Max number of retries that the LMAC should send 203 - * in case of no replies by the AP. 204 - * @tsf_delta: TSF Delta in units of microseconds. 205 - * The difference between the AP TSF and the device local clock. 206 - * @location_req: Location Request Bit[0] LCI should be sent in the FTMR 207 - * Bit[1] Civic should be sent in the FTMR 208 - * @asap_mode: 0 - non asap mode, 1 - asap mode (not relevant for one sided) 209 - * @enable_dyn_ack: Enable Dynamic ACK BW. 210 - * 0 Initiator interact with regular AP 211 - * 1 Initiator interact with Responder machine: need to send the 212 - * Initiator Acks with HT 40MHz / 80MHz, since the Responder should 213 - * use it for its ch est measurement (this flag will be set when we 214 - * configure the opposite machine to be Responder). 215 - * @rssi: Last received value 216 - * leagal values: -128-0 (0x7f). above 0x0 indicating an invalid value. 217 - */ 218 - struct iwl_tof_range_req_ap_entry { 219 - u8 channel_num; 220 - u8 bandwidth; 221 - u8 tsf_delta_direction; 222 - u8 ctrl_ch_position; 223 - u8 bssid[ETH_ALEN]; 224 - u8 measure_type; 225 - u8 num_of_bursts; 226 - __le16 burst_period; 227 - u8 samples_per_burst; 228 - u8 retries_per_sample; 229 - __le32 tsf_delta; 230 - u8 location_req; 231 - u8 asap_mode; 232 - u8 enable_dyn_ack; 233 - s8 rssi; 234 - } __packed; 235 - 236 - /** 237 - * enum iwl_tof_response_mode 238 - * @IWL_MVM_TOF_RESPOSE_ASAP: report each AP measurement separately as soon as 239 - * possible (not supported for this release) 240 - * @IWL_MVM_TOF_RESPOSE_TIMEOUT: report all AP measurements as a batch upon 241 - * timeout expiration 242 - * @IWL_MVM_TOF_RESPOSE_COMPLETE: report all AP measurements as a batch at the 243 - * earlier of: measurements completion / timeout 244 - * expiration. 245 - */ 246 - enum iwl_tof_response_mode { 247 - IWL_MVM_TOF_RESPOSE_ASAP = 1, 248 - IWL_MVM_TOF_RESPOSE_TIMEOUT, 249 - IWL_MVM_TOF_RESPOSE_COMPLETE, 250 - }; 251 - 252 - /** 253 - * struct iwl_tof_range_req_cmd - start measurement cmd 254 - * @request_id: A Token incremented per request. The same Token will be 255 - * sent back in the range response 256 - * @initiator: 0- NW initiated, 1 - Client Initiated 257 - * @one_sided_los_disable: '0'- run ML-Algo for both ToF/OneSided, 258 - * '1' - run ML-Algo for ToF only 259 - * @req_timeout: Requested timeout of the response in units of 100ms. 260 - * This is equivalent to the session time configured to the 261 - * LMAC in Initiator Request 262 - * @report_policy: Supported partially for this release: For current release - 263 - * the range report will be uploaded as a batch when ready or 264 - * when the session is done (successfully / partially). 265 - * one of iwl_tof_response_mode. 266 - * @num_of_ap: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS) 267 - * @macaddr_random: '0' Use default source MAC address (i.e. p2_p), 268 - * '1' Use MAC Address randomization according to the below 269 - * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template. 270 - * Bits set to 1 shall be randomized by the UMAC 271 - * @ap: per-AP request data 272 - */ 273 - struct iwl_tof_range_req_cmd { 274 - __le32 sub_grp_cmd_id; 275 - u8 request_id; 276 - u8 initiator; 277 - u8 one_sided_los_disable; 278 - u8 req_timeout; 279 - u8 report_policy; 280 - u8 los_det_disable; 281 - u8 num_of_ap; 282 - u8 macaddr_random; 283 - u8 macaddr_template[ETH_ALEN]; 284 - u8 macaddr_mask[ETH_ALEN]; 285 - struct iwl_tof_range_req_ap_entry ap[IWL_MVM_TOF_MAX_APS]; 286 - } __packed; 287 - 288 - /** 289 - * struct iwl_tof_gen_resp_cmd - generic ToF response 290 - */ 291 - struct iwl_tof_gen_resp_cmd { 292 - __le32 sub_grp_cmd_id; 293 - u8 data[]; 294 - } __packed; 295 - 296 - /** 297 - * struct iwl_tof_range_rsp_ap_entry_ntfy - AP parameters (response) 298 - * @bssid: BSSID of the AP 299 - * @measure_status: current APs measurement status, one of 300 - * &enum iwl_tof_entry_status. 301 - * @measure_bw: Current AP Bandwidth: 0 20MHz, 1 40MHz, 2 80MHz 302 - * @rtt: The Round Trip Time that took for the last measurement for 303 - * current AP [nSec] 304 - * @rtt_variance: The Variance of the RTT values measured for current AP 305 - * @rtt_spread: The Difference between the maximum and the minimum RTT 306 - * values measured for current AP in the current session [nsec] 307 - * @rssi: RSSI as uploaded in the Channel Estimation notification 308 - * @rssi_spread: The Difference between the maximum and the minimum RSSI values 309 - * measured for current AP in the current session 310 - * @reserved: reserved 311 - * @range: Measured range [cm] 312 - * @range_variance: Measured range variance [cm] 313 - * @timestamp: The GP2 Clock [usec] where Channel Estimation notification was 314 - * uploaded by the LMAC 315 - */ 316 - struct iwl_tof_range_rsp_ap_entry_ntfy { 317 - u8 bssid[ETH_ALEN]; 318 - u8 measure_status; 319 - u8 measure_bw; 320 - __le32 rtt; 321 - __le32 rtt_variance; 322 - __le32 rtt_spread; 323 - s8 rssi; 324 - u8 rssi_spread; 325 - __le16 reserved; 326 - __le32 range; 327 - __le32 range_variance; 328 - __le32 timestamp; 329 - } __packed; 330 - 331 - /** 332 - * struct iwl_tof_range_rsp_ntfy - 333 - * @request_id: A Token ID of the corresponding Range request 334 - * @request_status: status of current measurement session 335 - * @last_in_batch: reprot policy (when not all responses are uploaded at once) 336 - * @num_of_aps: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS) 337 - * @ap: per-AP data 338 - */ 339 - struct iwl_tof_range_rsp_ntfy { 340 - u8 request_id; 341 - u8 request_status; 342 - u8 last_in_batch; 343 - u8 num_of_aps; 344 - struct iwl_tof_range_rsp_ap_entry_ntfy ap[IWL_MVM_TOF_MAX_APS]; 345 - } __packed; 346 - 347 - #define IWL_MVM_TOF_MCSI_BUF_SIZE (245) 348 - /** 349 - * struct iwl_tof_mcsi_notif - used for debug 350 - * @token: token ID for the current session 351 - * @role: '0' - initiator, '1' - responder 352 - * @reserved: reserved 353 - * @initiator_bssid: initiator machine 354 - * @responder_bssid: responder machine 355 - * @mcsi_buffer: debug data 356 - */ 357 - struct iwl_tof_mcsi_notif { 358 - u8 token; 359 - u8 role; 360 - __le16 reserved; 361 - u8 initiator_bssid[ETH_ALEN]; 362 - u8 responder_bssid[ETH_ALEN]; 363 - u8 mcsi_buffer[IWL_MVM_TOF_MCSI_BUF_SIZE * 4]; 364 - } __packed; 365 - 366 - /** 367 - * struct iwl_tof_neighbor_report_notif 368 - * @bssid: BSSID of the AP which sent the report 369 - * @request_token: same token as the corresponding request 370 - * @status: 371 - * @report_ie_len: the length of the response frame starting from the Element ID 372 - * @data: the IEs 373 - */ 374 - struct iwl_tof_neighbor_report { 375 - u8 bssid[ETH_ALEN]; 376 - u8 request_token; 377 - u8 status; 378 - __le16 report_ie_len; 379 - u8 data[]; 380 - } __packed; 381 - 382 - /** 383 - * struct iwl_tof_range_abort_cmd 384 - * @request_id: corresponds to a range request 385 - * @reserved: reserved 386 - */ 387 - struct iwl_tof_range_abort_cmd { 388 - __le32 sub_grp_cmd_id; 389 - u8 request_id; 390 - u8 reserved[3]; 391 - } __packed; 392 - 393 - #endif
+158 -52
drivers/net/wireless/intel/iwlwifi/fw/dbg.c
··· 469 469 { .start = 0x00a02400, .end = 0x00a02758 }, 470 470 }; 471 471 472 + static const struct iwl_prph_range iwl_prph_dump_addr_22000[] = { 473 + { .start = 0x00a00000, .end = 0x00a00000 }, 474 + { .start = 0x00a0000c, .end = 0x00a00024 }, 475 + { .start = 0x00a0002c, .end = 0x00a00034 }, 476 + { .start = 0x00a0003c, .end = 0x00a0003c }, 477 + { .start = 0x00a00410, .end = 0x00a00418 }, 478 + { .start = 0x00a00420, .end = 0x00a00420 }, 479 + { .start = 0x00a00428, .end = 0x00a00428 }, 480 + { .start = 0x00a00430, .end = 0x00a0043c }, 481 + { .start = 0x00a00444, .end = 0x00a00444 }, 482 + { .start = 0x00a00840, .end = 0x00a00840 }, 483 + { .start = 0x00a00850, .end = 0x00a00858 }, 484 + { .start = 0x00a01004, .end = 0x00a01008 }, 485 + { .start = 0x00a01010, .end = 0x00a01010 }, 486 + { .start = 0x00a01018, .end = 0x00a01018 }, 487 + { .start = 0x00a01024, .end = 0x00a01024 }, 488 + { .start = 0x00a0102c, .end = 0x00a01034 }, 489 + { .start = 0x00a0103c, .end = 0x00a01040 }, 490 + { .start = 0x00a01048, .end = 0x00a01050 }, 491 + { .start = 0x00a01058, .end = 0x00a01058 }, 492 + { .start = 0x00a01060, .end = 0x00a01070 }, 493 + { .start = 0x00a0108c, .end = 0x00a0108c }, 494 + { .start = 0x00a01c20, .end = 0x00a01c28 }, 495 + { .start = 0x00a01d10, .end = 0x00a01d10 }, 496 + { .start = 0x00a01e28, .end = 0x00a01e2c }, 497 + { .start = 0x00a01e60, .end = 0x00a01e60 }, 498 + { .start = 0x00a01e80, .end = 0x00a01e80 }, 499 + { .start = 0x00a01ea0, .end = 0x00a01ea0 }, 500 + { .start = 0x00a02000, .end = 0x00a0201c }, 501 + { .start = 0x00a02024, .end = 0x00a02024 }, 502 + { .start = 0x00a02040, .end = 0x00a02048 }, 503 + { .start = 0x00a020c0, .end = 0x00a020e0 }, 504 + { .start = 0x00a02400, .end = 0x00a02404 }, 505 + { .start = 0x00a0240c, .end = 0x00a02414 }, 506 + { .start = 0x00a0241c, .end = 0x00a0243c }, 507 + { .start = 0x00a02448, .end = 0x00a024bc }, 508 + { .start = 0x00a024c4, .end = 0x00a024cc }, 509 + { .start = 0x00a02508, .end = 0x00a02508 }, 510 + { .start = 0x00a02510, .end = 0x00a02514 }, 511 + { .start = 0x00a0251c, .end = 0x00a0251c }, 512 + { .start = 0x00a0252c, .end = 0x00a0255c }, 513 + { .start = 0x00a02564, .end = 0x00a025a0 }, 514 + { .start = 0x00a025a8, .end = 0x00a025b4 }, 515 + { .start = 0x00a025c0, .end = 0x00a025c0 }, 516 + { .start = 0x00a025e8, .end = 0x00a025f4 }, 517 + { .start = 0x00a02c08, .end = 0x00a02c18 }, 518 + { .start = 0x00a02c2c, .end = 0x00a02c38 }, 519 + { .start = 0x00a02c68, .end = 0x00a02c78 }, 520 + { .start = 0x00a03000, .end = 0x00a03000 }, 521 + { .start = 0x00a03010, .end = 0x00a03014 }, 522 + { .start = 0x00a0301c, .end = 0x00a0302c }, 523 + { .start = 0x00a03034, .end = 0x00a03038 }, 524 + { .start = 0x00a03040, .end = 0x00a03044 }, 525 + { .start = 0x00a03060, .end = 0x00a03068 }, 526 + { .start = 0x00a03070, .end = 0x00a03070 }, 527 + { .start = 0x00a0307c, .end = 0x00a03084 }, 528 + { .start = 0x00a0308c, .end = 0x00a03090 }, 529 + { .start = 0x00a03098, .end = 0x00a03098 }, 530 + { .start = 0x00a030a0, .end = 0x00a030a0 }, 531 + { .start = 0x00a030a8, .end = 0x00a030b4 }, 532 + { .start = 0x00a030bc, .end = 0x00a030c0 }, 533 + { .start = 0x00a030c8, .end = 0x00a030f4 }, 534 + { .start = 0x00a03100, .end = 0x00a0312c }, 535 + { .start = 0x00a03c00, .end = 0x00a03c5c }, 536 + { .start = 0x00a04400, .end = 0x00a04454 }, 537 + { .start = 0x00a04460, .end = 0x00a04474 }, 538 + { .start = 0x00a044c0, .end = 0x00a044ec }, 539 + { .start = 0x00a04500, .end = 0x00a04504 }, 540 + { .start = 0x00a04510, .end = 0x00a04538 }, 541 + { .start = 0x00a04540, .end = 0x00a04548 }, 542 + { .start = 0x00a04560, .end = 0x00a04560 }, 543 + { .start = 0x00a04570, .end = 0x00a0457c }, 544 + { .start = 0x00a04590, .end = 0x00a04590 }, 545 + { .start = 0x00a04598, .end = 0x00a04598 }, 546 + { .start = 0x00a045c0, .end = 0x00a045f4 }, 547 + { .start = 0x00a0c000, .end = 0x00a0c018 }, 548 + { .start = 0x00a0c020, .end = 0x00a0c028 }, 549 + { .start = 0x00a0c038, .end = 0x00a0c094 }, 550 + { .start = 0x00a0c0c0, .end = 0x00a0c104 }, 551 + { .start = 0x00a0c10c, .end = 0x00a0c118 }, 552 + { .start = 0x00a0c150, .end = 0x00a0c174 }, 553 + { .start = 0x00a0c17c, .end = 0x00a0c188 }, 554 + { .start = 0x00a0c190, .end = 0x00a0c198 }, 555 + { .start = 0x00a0c1a0, .end = 0x00a0c1a8 }, 556 + { .start = 0x00a0c1b0, .end = 0x00a0c1b8 }, 557 + }; 558 + 472 559 static void iwl_read_prph_block(struct iwl_trans *trans, u32 start, 473 560 u32 len_bytes, __le32 *data) 474 561 { ··· 565 478 *data++ = cpu_to_le32(iwl_read_prph_no_grab(trans, start + i)); 566 479 } 567 480 568 - static void iwl_dump_prph(struct iwl_trans *trans, 569 - struct iwl_fw_error_dump_data **data, 481 + static void iwl_dump_prph(struct iwl_fw_runtime *fwrt, 570 482 const struct iwl_prph_range *iwl_prph_dump_addr, 571 - u32 range_len) 483 + u32 range_len, void *ptr) 572 484 { 573 485 struct iwl_fw_error_dump_prph *prph; 486 + struct iwl_trans *trans = fwrt->trans; 487 + struct iwl_fw_error_dump_data **data = 488 + (struct iwl_fw_error_dump_data **)ptr; 574 489 unsigned long flags; 575 490 u32 i; 491 + 492 + if (!data) 493 + return; 576 494 577 495 IWL_DEBUG_INFO(trans, "WRT PRPH dump\n"); 578 496 ··· 644 552 return table; 645 553 } 646 554 647 - static int iwl_fw_get_prph_len(struct iwl_fw_runtime *fwrt) 555 + static void iwl_fw_get_prph_len(struct iwl_fw_runtime *fwrt, 556 + const struct iwl_prph_range *iwl_prph_dump_addr, 557 + u32 range_len, void *ptr) 648 558 { 649 - u32 prph_len = 0; 650 - int i; 559 + u32 *prph_len = (u32 *)ptr; 560 + int i, num_bytes_in_chunk; 651 561 652 - for (i = 0; i < ARRAY_SIZE(iwl_prph_dump_addr_comm); 653 - i++) { 562 + if (!prph_len) 563 + return; 564 + 565 + for (i = 0; i < range_len; i++) { 654 566 /* The range includes both boundaries */ 655 - int num_bytes_in_chunk = 656 - iwl_prph_dump_addr_comm[i].end - 657 - iwl_prph_dump_addr_comm[i].start + 4; 567 + num_bytes_in_chunk = 568 + iwl_prph_dump_addr[i].end - 569 + iwl_prph_dump_addr[i].start + 4; 658 570 659 - prph_len += sizeof(struct iwl_fw_error_dump_data) + 571 + *prph_len += sizeof(struct iwl_fw_error_dump_data) + 660 572 sizeof(struct iwl_fw_error_dump_prph) + 661 573 num_bytes_in_chunk; 662 574 } 575 + } 663 576 664 - if (fwrt->trans->cfg->mq_rx_supported) { 665 - for (i = 0; i < 666 - ARRAY_SIZE(iwl_prph_dump_addr_9000); i++) { 667 - /* The range includes both boundaries */ 668 - int num_bytes_in_chunk = 669 - iwl_prph_dump_addr_9000[i].end - 670 - iwl_prph_dump_addr_9000[i].start + 4; 577 + static void iwl_fw_prph_handler(struct iwl_fw_runtime *fwrt, void *ptr, 578 + void (*handler)(struct iwl_fw_runtime *, 579 + const struct iwl_prph_range *, 580 + u32, void *)) 581 + { 582 + u32 range_len; 671 583 672 - prph_len += sizeof(struct iwl_fw_error_dump_data) + 673 - sizeof(struct iwl_fw_error_dump_prph) + 674 - num_bytes_in_chunk; 584 + if (fwrt->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22000) { 585 + range_len = ARRAY_SIZE(iwl_prph_dump_addr_22000); 586 + handler(fwrt, iwl_prph_dump_addr_22000, range_len, ptr); 587 + } else { 588 + range_len = ARRAY_SIZE(iwl_prph_dump_addr_comm); 589 + handler(fwrt, iwl_prph_dump_addr_comm, range_len, ptr); 590 + 591 + if (fwrt->trans->cfg->mq_rx_supported) { 592 + range_len = ARRAY_SIZE(iwl_prph_dump_addr_9000); 593 + handler(fwrt, iwl_prph_dump_addr_9000, range_len, ptr); 675 594 } 676 595 } 677 - return prph_len; 678 596 } 679 597 680 598 static void iwl_fw_dump_mem(struct iwl_fw_runtime *fwrt, ··· 748 646 ADD_LEN(fifo_len, mem_cfg->rxfifo2_size, hdr_len); 749 647 750 648 /* Count RXF1 sizes */ 649 + if (WARN_ON(mem_cfg->num_lmacs > MAX_NUM_LMAC)) 650 + mem_cfg->num_lmacs = MAX_NUM_LMAC; 651 + 751 652 for (i = 0; i < mem_cfg->num_lmacs; i++) 752 653 ADD_LEN(fifo_len, mem_cfg->lmac[i].rxfifo1_size, hdr_len); 753 654 ··· 769 664 goto dump_internal_txf; 770 665 771 666 /* Count TXF sizes */ 667 + if (WARN_ON(mem_cfg->num_lmacs > MAX_NUM_LMAC)) 668 + mem_cfg->num_lmacs = MAX_NUM_LMAC; 669 + 772 670 for (i = 0; i < mem_cfg->num_lmacs; i++) { 773 671 int j; 774 672 ··· 841 733 if (!fwrt->trans->cfg->dccm_offset || !fwrt->trans->cfg->dccm_len) { 842 734 const struct fw_img *img; 843 735 736 + if (fwrt->cur_fw_img >= IWL_UCODE_TYPE_MAX) 737 + return NULL; 844 738 img = &fwrt->fw->img[fwrt->cur_fw_img]; 845 739 sram_ofs = img->sec[IWL_UCODE_SECTION_DATA].offset; 846 740 sram_len = img->sec[IWL_UCODE_SECTION_DATA].len; ··· 857 747 fifo_len += iwl_fw_txf_len(fwrt, mem_cfg); 858 748 859 749 /* Make room for PRPH registers */ 860 - if (!fwrt->trans->cfg->gen2 && 861 - iwl_fw_dbg_type_on(fwrt, IWL_FW_ERROR_DUMP_PRPH)) 862 - prph_len += iwl_fw_get_prph_len(fwrt); 750 + if (iwl_fw_dbg_type_on(fwrt, IWL_FW_ERROR_DUMP_PRPH)) 751 + iwl_fw_prph_handler(fwrt, &prph_len, 752 + iwl_fw_get_prph_len); 863 753 864 754 if (fwrt->trans->cfg->device_family == IWL_DEVICE_FAMILY_7000 && 865 755 iwl_fw_dbg_type_on(fwrt, IWL_FW_ERROR_DUMP_RADIO_REG)) ··· 938 828 sizeof(dump_info->dev_human_readable) - 1); 939 829 strncpy(dump_info->bus_human_readable, fwrt->dev->bus->name, 940 830 sizeof(dump_info->bus_human_readable) - 1); 941 - dump_info->rt_status = cpu_to_le32(fwrt->dump.rt_status); 831 + dump_info->num_of_lmacs = fwrt->smem_cfg.num_lmacs; 832 + dump_info->lmac_err_id[0] = 833 + cpu_to_le32(fwrt->dump.lmac_err_id[0]); 834 + if (fwrt->smem_cfg.num_lmacs > 1) 835 + dump_info->lmac_err_id[1] = 836 + cpu_to_le32(fwrt->dump.lmac_err_id[1]); 837 + dump_info->umac_err_id = cpu_to_le32(fwrt->dump.umac_err_id); 942 838 943 839 dump_data = iwl_fw_error_next_data(dump_data); 944 840 } ··· 1051 935 if (iwl_fw_dbg_is_paging_enabled(fwrt)) 1052 936 iwl_dump_paging(fwrt, &dump_data); 1053 937 1054 - if (prph_len) { 1055 - iwl_dump_prph(fwrt->trans, &dump_data, 1056 - iwl_prph_dump_addr_comm, 1057 - ARRAY_SIZE(iwl_prph_dump_addr_comm)); 1058 - 1059 - if (fwrt->trans->cfg->mq_rx_supported) 1060 - iwl_dump_prph(fwrt->trans, &dump_data, 1061 - iwl_prph_dump_addr_9000, 1062 - ARRAY_SIZE(iwl_prph_dump_addr_9000)); 1063 - } 938 + if (prph_len) 939 + iwl_fw_prph_handler(fwrt, &dump_data, iwl_dump_prph); 1064 940 1065 941 out: 1066 942 dump_file->file_len = cpu_to_le32(file_len); ··· 1216 1108 iwl_dump_prph_ini(fwrt->trans, data, reg); 1217 1109 break; 1218 1110 case IWL_FW_INI_REGION_DRAM_BUFFER: 1219 - *dump_mask |= IWL_FW_ERROR_DUMP_FW_MONITOR; 1111 + *dump_mask |= BIT(IWL_FW_ERROR_DUMP_FW_MONITOR); 1220 1112 break; 1221 1113 case IWL_FW_INI_REGION_PAGING: 1222 1114 if (iwl_fw_dbg_is_paging_enabled(fwrt)) 1223 1115 iwl_dump_paging(fwrt, data); 1224 1116 else 1225 - *dump_mask |= IWL_FW_ERROR_DUMP_PAGING; 1117 + *dump_mask |= BIT(IWL_FW_ERROR_DUMP_PAGING); 1226 1118 break; 1227 1119 case IWL_FW_INI_REGION_TXF: 1228 1120 iwl_fw_dump_txf(fwrt, data); ··· 1254 1146 1255 1147 if (id == FW_DBG_TRIGGER_FW_ASSERT) 1256 1148 id = IWL_FW_TRIGGER_ID_FW_ASSERT; 1257 - else if (id == FW_DBG_TRIGGER_USER) 1258 - id = IWL_FW_TRIGGER_ID_USER_TRIGGER; 1259 - else if (id < FW_DBG_TRIGGER_MAX) 1260 - return NULL; 1261 1149 1262 1150 if (WARN_ON(id >= ARRAY_SIZE(fwrt->dump.active_trigs))) 1263 1151 return NULL; ··· 1489 1385 if (WARN_ON(!fwrt->dump.active_trigs[id].active)) 1490 1386 return -EINVAL; 1491 1387 1492 - delay = le32_to_cpu(fwrt->dump.active_trigs[id].conf->ignore_consec); 1388 + delay = le32_to_cpu(fwrt->dump.active_trigs[id].conf->dump_delay); 1493 1389 occur = le32_to_cpu(fwrt->dump.active_trigs[id].conf->occurrences); 1494 1390 if (!occur) 1495 1391 return 0; ··· 1674 1570 struct iwl_fw_ini_allocation_tlv *alloc) 1675 1571 { 1676 1572 struct iwl_trans *trans = fwrt->trans; 1677 - struct iwl_continuous_record_cmd cont_rec = {}; 1678 - struct iwl_buffer_allocation_cmd *cmd = (void *)&cont_rec.pad[0]; 1573 + struct iwl_ldbg_config_cmd ldbg_cmd = { 1574 + .type = cpu_to_le32(BUFFER_ALLOCATION), 1575 + }; 1576 + struct iwl_buffer_allocation_cmd *cmd = &ldbg_cmd.buffer_allocation; 1679 1577 struct iwl_host_cmd hcmd = { 1680 1578 .id = LDBG_CONFIG_CMD, 1681 1579 .flags = CMD_ASYNC, 1682 - .data[0] = &cont_rec, 1683 - .len[0] = sizeof(cont_rec), 1580 + .data[0] = &ldbg_cmd, 1581 + .len[0] = sizeof(ldbg_cmd), 1684 1582 }; 1685 1583 void *virtual_addr = NULL; 1686 1584 u32 size = le32_to_cpu(alloc->size); 1687 1585 dma_addr_t phys_addr; 1688 - 1689 - cont_rec.record_mode.enable_recording = cpu_to_le16(BUFFER_ALLOCATION); 1690 1586 1691 1587 if (!trans->num_blocks && 1692 1588 le32_to_cpu(alloc->buffer_location) != 1693 1589 IWL_FW_INI_LOCATION_DRAM_PATH) 1694 1590 return; 1695 1591 1696 - virtual_addr = dma_alloc_coherent(fwrt->trans->dev, size, 1697 - &phys_addr, GFP_KERNEL); 1592 + virtual_addr = 1593 + dma_alloc_coherent(fwrt->trans->dev, size, &phys_addr, 1594 + GFP_KERNEL | __GFP_NOWARN | __GFP_ZERO | 1595 + __GFP_COMP); 1698 1596 1699 1597 /* TODO: alloc fragments if needed */ 1700 1598 if (!virtual_addr)
+13 -9
drivers/net/wireless/intel/iwlwifi/fw/dbg.h
··· 102 102 if (fwrt->dump.desc != &iwl_dump_desc_assert) 103 103 kfree(fwrt->dump.desc); 104 104 fwrt->dump.desc = NULL; 105 - fwrt->dump.rt_status = 0; 105 + fwrt->dump.lmac_err_id[0] = 0; 106 + if (fwrt->smem_cfg.num_lmacs > 1) 107 + fwrt->dump.lmac_err_id[1] = 0; 108 + fwrt->dump.umac_err_id = 0; 106 109 } 107 110 108 111 void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt); ··· 269 266 iwl_fw_dbg_get_trigger((fwrt)->fw,\ 270 267 (trig))) 271 268 272 - static int iwl_fw_dbg_start_stop_hcmd(struct iwl_fw_runtime *fwrt, bool start) 269 + static inline int 270 + iwl_fw_dbg_start_stop_hcmd(struct iwl_fw_runtime *fwrt, bool start) 273 271 { 274 - struct iwl_continuous_record_cmd cont_rec = {}; 272 + struct iwl_ldbg_config_cmd cmd = { 273 + .type = start ? cpu_to_le32(START_DEBUG_RECORDING) : 274 + cpu_to_le32(STOP_DEBUG_RECORDING), 275 + }; 275 276 struct iwl_host_cmd hcmd = { 276 277 .id = LDBG_CONFIG_CMD, 277 278 .flags = CMD_ASYNC, 278 - .data[0] = &cont_rec, 279 - .len[0] = sizeof(cont_rec), 279 + .data[0] = &cmd, 280 + .len[0] = sizeof(cmd), 280 281 }; 281 - 282 - cont_rec.record_mode.enable_recording = start ? 283 - cpu_to_le16(START_DEBUG_RECORDING) : 284 - cpu_to_le16(STOP_DEBUG_RECORDING); 285 282 286 283 return iwl_trans_send_cmd(fwrt->trans, &hcmd); 287 284 } ··· 381 378 { 382 379 return iwl_fw_dbg_type_on(fwrt, IWL_FW_ERROR_DUMP_PAGING) && 383 380 !fwrt->trans->cfg->gen2 && 381 + fwrt->cur_fw_img < IWL_UCODE_TYPE_MAX && 384 382 fwrt->fw->img[fwrt->cur_fw_img].paging_mem_size && 385 383 fwrt->fw_paging_db[0].fw_paging_block; 386 384 }
+9 -2
drivers/net/wireless/intel/iwlwifi/fw/error-dump.h
··· 180 180 IWL_FW_ERROR_DUMP_FAMILY_8 = 8, 181 181 }; 182 182 183 + #define MAX_NUM_LMAC 2 184 + 183 185 /** 184 186 * struct iwl_fw_error_dump_info - info on the device / firmware 185 187 * @device_family: the family of the device (7 / 8) ··· 189 187 * @fw_human_readable: human readable FW version 190 188 * @dev_human_readable: name of the device 191 189 * @bus_human_readable: name of the bus used 192 - * @rt_status: the error_id/rt_status that that triggered the latest dump 190 + * @num_of_lmacs: the number of lmacs 191 + * @lmac_err_id: the lmac 0/1 error_id/rt_status that triggered the latest dump 192 + * if the dump collection was not initiated by an assert, the value is 0 193 + * @umac_err_id: the umac error_id/rt_status that triggered the latest dump 193 194 * if the dump collection was not initiated by an assert, the value is 0 194 195 */ 195 196 struct iwl_fw_error_dump_info { ··· 201 196 u8 fw_human_readable[FW_VER_HUMAN_READABLE_SZ]; 202 197 u8 dev_human_readable[64]; 203 198 u8 bus_human_readable[8]; 204 - __le32 rt_status; 199 + u8 num_of_lmacs; 200 + __le32 umac_err_id; 201 + __le32 lmac_err_id[MAX_NUM_LMAC]; 205 202 } __packed; 206 203 207 204 /**
+9 -3
drivers/net/wireless/intel/iwlwifi/fw/file.h
··· 303 303 * @IWL_UCODE_TLV_CAPA_LAR_SUPPORT: supports Location Aware Regulatory 304 304 * @IWL_UCODE_TLV_CAPA_UMAC_SCAN: supports UMAC scan. 305 305 * @IWL_UCODE_TLV_CAPA_BEAMFORMER: supports Beamformer 306 - * @IWL_UCODE_TLV_CAPA_TOF_SUPPORT: supports Time of Flight (802.11mc FTM) 307 306 * @IWL_UCODE_TLV_CAPA_TDLS_SUPPORT: support basic TDLS functionality 308 307 * @IWL_UCODE_TLV_CAPA_TXPOWER_INSERTION_SUPPORT: supports insertion of current 309 308 * tx power value into TPC Report action frame and Link Measurement Report ··· 333 334 * @IWL_UCODE_TLV_CAPA_TLC_OFFLOAD: firmware implements rate scaling algorithm 334 335 * @IWL_UCODE_TLV_CAPA_DYNAMIC_QUOTA: firmware implements quota related 335 336 * @IWL_UCODE_TLV_CAPA_COEX_SCHEMA_2: firmware implements Coex Schema 2 337 + * @IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS: firmware supports ultra high band 338 + * (6 GHz). 336 339 * @IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE: extended DTS measurement 337 340 * @IWL_UCODE_TLV_CAPA_SHORT_PM_TIMEOUTS: supports short PM timeouts 338 341 * @IWL_UCODE_TLV_CAPA_BT_MPLUT_SUPPORT: supports bt-coex Multi-priority LUT ··· 358 357 * @IWL_UCODE_TLV_CAPA_TX_POWER_ACK: reduced TX power API has larger 359 358 * command size (command version 4) that supports toggling ACK TX 360 359 * power reduction. 361 - * @IWL_UCODE_TLV_CAPA_MLME_OFFLOAD: supports MLME offload 362 360 * @IWL_UCODE_TLV_CAPA_D3_DEBUG: supports debug recording during D3 363 361 * @IWL_UCODE_TLV_CAPA_MCC_UPDATE_11AX_SUPPORT: MCC response support 11ax 364 362 * capability. 363 + * @IWL_UCODE_TLV_CAPA_CSI_REPORTING: firmware is capable of being configured 364 + * to report the CSI information with (certain) RX frames 365 + * 366 + * @IWL_UCODE_TLV_CAPA_MLME_OFFLOAD: supports MLME offload 365 367 * 366 368 * @NUM_IWL_UCODE_TLV_CAPA: number of bits used 367 369 */ ··· 373 369 IWL_UCODE_TLV_CAPA_LAR_SUPPORT = (__force iwl_ucode_tlv_capa_t)1, 374 370 IWL_UCODE_TLV_CAPA_UMAC_SCAN = (__force iwl_ucode_tlv_capa_t)2, 375 371 IWL_UCODE_TLV_CAPA_BEAMFORMER = (__force iwl_ucode_tlv_capa_t)3, 376 - IWL_UCODE_TLV_CAPA_TOF_SUPPORT = (__force iwl_ucode_tlv_capa_t)5, 377 372 IWL_UCODE_TLV_CAPA_TDLS_SUPPORT = (__force iwl_ucode_tlv_capa_t)6, 378 373 IWL_UCODE_TLV_CAPA_TXPOWER_INSERTION_SUPPORT = (__force iwl_ucode_tlv_capa_t)8, 379 374 IWL_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT = (__force iwl_ucode_tlv_capa_t)9, ··· 397 394 IWL_UCODE_TLV_CAPA_TLC_OFFLOAD = (__force iwl_ucode_tlv_capa_t)43, 398 395 IWL_UCODE_TLV_CAPA_DYNAMIC_QUOTA = (__force iwl_ucode_tlv_capa_t)44, 399 396 IWL_UCODE_TLV_CAPA_COEX_SCHEMA_2 = (__force iwl_ucode_tlv_capa_t)45, 397 + IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS = (__force iwl_ucode_tlv_capa_t)48, 400 398 IWL_UCODE_TLV_CAPA_EXTENDED_DTS_MEASURE = (__force iwl_ucode_tlv_capa_t)64, 401 399 IWL_UCODE_TLV_CAPA_SHORT_PM_TIMEOUTS = (__force iwl_ucode_tlv_capa_t)65, 402 400 IWL_UCODE_TLV_CAPA_BT_MPLUT_SUPPORT = (__force iwl_ucode_tlv_capa_t)67, ··· 416 412 IWL_UCODE_TLV_CAPA_D3_DEBUG = (__force iwl_ucode_tlv_capa_t)87, 417 413 IWL_UCODE_TLV_CAPA_LED_CMD_SUPPORT = (__force iwl_ucode_tlv_capa_t)88, 418 414 IWL_UCODE_TLV_CAPA_MCC_UPDATE_11AX_SUPPORT = (__force iwl_ucode_tlv_capa_t)89, 415 + IWL_UCODE_TLV_CAPA_CSI_REPORTING = (__force iwl_ucode_tlv_capa_t)90, 416 + 419 417 IWL_UCODE_TLV_CAPA_MLME_OFFLOAD = (__force iwl_ucode_tlv_capa_t)96, 420 418 421 419 NUM_IWL_UCODE_TLV_CAPA
+2 -1
drivers/net/wireless/intel/iwlwifi/fw/runtime.h
··· 142 142 u32 *d3_debug_data; 143 143 struct iwl_fw_ini_active_regs active_regs[IWL_FW_INI_MAX_REGION_ID]; 144 144 struct iwl_fw_ini_active_triggers active_trigs[IWL_FW_TRIGGER_ID_NUM]; 145 - u32 rt_status; 145 + u32 lmac_err_id[MAX_NUM_LMAC]; 146 + u32 umac_err_id; 146 147 } dump; 147 148 #ifdef CONFIG_IWLWIFI_DEBUGFS 148 149 struct {
+11 -6
drivers/net/wireless/intel/iwlwifi/iwl-config.h
··· 335 335 * @fw_name_pre: Firmware filename prefix. The api version and extension 336 336 * (.ucode) will be added to filename before loading from disk. The 337 337 * filename is constructed as fw_name_pre<api>.ucode. 338 - * @fw_name_pre_b_or_c_step: same as @fw_name_pre, only for b or c steps 339 - * (if supported) 340 - * @fw_name_pre_rf_next_step: same as @fw_name_pre_b_or_c_step, only for rf 341 - * next step. Supported only in integrated solutions. 342 338 * @ucode_api_max: Highest version of uCode API supported by driver. 343 339 * @ucode_api_min: Lowest version of uCode API supported by driver. 344 340 * @max_inst_size: The maximal length of the fw inst section (only DVM) ··· 388 392 /* params specific to an individual device within a device family */ 389 393 const char *name; 390 394 const char *fw_name_pre; 391 - const char *fw_name_pre_b_or_c_step; 392 - const char *fw_name_pre_rf_next_step; 393 395 /* params not likely to change within a device family */ 394 396 const struct iwl_base_params *base_params; 395 397 /* params likely to change within a device family */ ··· 545 551 extern const struct iwl_cfg iwl4165_2ac_cfg; 546 552 extern const struct iwl_cfg iwl9160_2ac_cfg; 547 553 extern const struct iwl_cfg iwl9260_2ac_cfg; 554 + extern const struct iwl_cfg iwl9260_2ac_160_cfg; 548 555 extern const struct iwl_cfg iwl9260_killer_2ac_cfg; 549 556 extern const struct iwl_cfg iwl9270_2ac_cfg; 550 557 extern const struct iwl_cfg iwl9460_2ac_cfg; 551 558 extern const struct iwl_cfg iwl9560_2ac_cfg; 559 + extern const struct iwl_cfg iwl9560_2ac_160_cfg; 552 560 extern const struct iwl_cfg iwl9460_2ac_cfg_soc; 553 561 extern const struct iwl_cfg iwl9461_2ac_cfg_soc; 554 562 extern const struct iwl_cfg iwl9462_2ac_cfg_soc; 555 563 extern const struct iwl_cfg iwl9560_2ac_cfg_soc; 564 + extern const struct iwl_cfg iwl9560_2ac_160_cfg_soc; 556 565 extern const struct iwl_cfg iwl9560_killer_2ac_cfg_soc; 557 566 extern const struct iwl_cfg iwl9560_killer_s_2ac_cfg_soc; 558 567 extern const struct iwl_cfg iwl9460_2ac_cfg_shared_clk; 559 568 extern const struct iwl_cfg iwl9461_2ac_cfg_shared_clk; 560 569 extern const struct iwl_cfg iwl9462_2ac_cfg_shared_clk; 561 570 extern const struct iwl_cfg iwl9560_2ac_cfg_shared_clk; 571 + extern const struct iwl_cfg iwl9560_2ac_160_cfg_shared_clk; 562 572 extern const struct iwl_cfg iwl9560_killer_2ac_cfg_shared_clk; 563 573 extern const struct iwl_cfg iwl9560_killer_s_2ac_cfg_shared_clk; 564 574 extern const struct iwl_cfg iwl22000_2ac_cfg_hr; 565 575 extern const struct iwl_cfg iwl22000_2ac_cfg_hr_cdb; 566 576 extern const struct iwl_cfg iwl22000_2ac_cfg_jf; 577 + extern const struct iwl_cfg iwl22560_2ax_cfg_hr; 567 578 extern const struct iwl_cfg iwl22000_2ax_cfg_hr; 579 + extern const struct iwl_cfg iwl22260_2ax_cfg; 580 + extern const struct iwl_cfg killer1650s_2ax_cfg_qu_b0_hr_b0; 581 + extern const struct iwl_cfg killer1650i_2ax_cfg_qu_b0_hr_b0; 582 + extern const struct iwl_cfg killer1650x_2ax_cfg; 583 + extern const struct iwl_cfg killer1650w_2ax_cfg; 568 584 extern const struct iwl_cfg iwl9461_2ac_cfg_qu_b0_jf_b0; 569 585 extern const struct iwl_cfg iwl9462_2ac_cfg_qu_b0_jf_b0; 570 586 extern const struct iwl_cfg iwl9560_2ac_cfg_qu_b0_jf_b0; 587 + extern const struct iwl_cfg iwl9560_2ac_160_cfg_qu_b0_jf_b0; 571 588 extern const struct iwl_cfg killer1550i_2ac_cfg_qu_b0_jf_b0; 572 589 extern const struct iwl_cfg killer1550s_2ac_cfg_qu_b0_jf_b0; 573 590 extern const struct iwl_cfg iwl22000_2ax_cfg_jf;
+1
drivers/net/wireless/intel/iwlwifi/iwl-csr.h
··· 325 325 #define CSR_HW_REV_TYPE_7265D (0x0000210) 326 326 #define CSR_HW_REV_TYPE_NONE (0x00001F0) 327 327 #define CSR_HW_REV_TYPE_QNJ (0x0000360) 328 + #define CSR_HW_REV_TYPE_QNJ_B0 (0x0000364) 328 329 #define CSR_HW_REV_TYPE_HR_CDB (0x0000340) 329 330 330 331 /* RF_ID value */
+11 -16
drivers/net/wireless/intel/iwlwifi/iwl-drv.c
··· 210 210 { 211 211 const struct iwl_cfg *cfg = drv->trans->cfg; 212 212 char tag[8]; 213 - const char *fw_pre_name; 214 213 215 214 if (drv->trans->cfg->device_family == IWL_DEVICE_FAMILY_9000 && 216 - (CSR_HW_REV_STEP(drv->trans->hw_rev) == SILICON_B_STEP || 217 - CSR_HW_REV_STEP(drv->trans->hw_rev) == SILICON_C_STEP)) 218 - fw_pre_name = cfg->fw_name_pre_b_or_c_step; 219 - else if (drv->trans->cfg->integrated && 220 - CSR_HW_RFID_STEP(drv->trans->hw_rf_id) == SILICON_B_STEP && 221 - cfg->fw_name_pre_rf_next_step) 222 - fw_pre_name = cfg->fw_name_pre_rf_next_step; 223 - else 224 - fw_pre_name = cfg->fw_name_pre; 215 + (CSR_HW_REV_STEP(drv->trans->hw_rev) != SILICON_B_STEP && 216 + CSR_HW_REV_STEP(drv->trans->hw_rev) != SILICON_C_STEP)) { 217 + IWL_ERR(drv, 218 + "Only HW steps B and C are currently supported (0x%0x)\n", 219 + drv->trans->hw_rev); 220 + return -EINVAL; 221 + } 225 222 226 223 if (first) { 227 224 drv->fw_index = cfg->ucode_api_max; ··· 232 235 IWL_ERR(drv, "no suitable firmware found!\n"); 233 236 234 237 if (cfg->ucode_api_min == cfg->ucode_api_max) { 235 - IWL_ERR(drv, "%s%d is required\n", fw_pre_name, 238 + IWL_ERR(drv, "%s%d is required\n", cfg->fw_name_pre, 236 239 cfg->ucode_api_max); 237 240 } else { 238 241 IWL_ERR(drv, "minimum version required: %s%d\n", 239 - fw_pre_name, 240 - cfg->ucode_api_min); 242 + cfg->fw_name_pre, cfg->ucode_api_min); 241 243 IWL_ERR(drv, "maximum version supported: %s%d\n", 242 - fw_pre_name, 243 - cfg->ucode_api_max); 244 + cfg->fw_name_pre, cfg->ucode_api_max); 244 245 } 245 246 246 247 IWL_ERR(drv, ··· 247 252 } 248 253 249 254 snprintf(drv->firmware_name, sizeof(drv->firmware_name), "%s%s.ucode", 250 - fw_pre_name, tag); 255 + cfg->fw_name_pre, tag); 251 256 252 257 IWL_DEBUG_INFO(drv, "attempting to load firmware '%s'\n", 253 258 drv->firmware_name);
+38 -3
drivers/net/wireless/intel/iwlwifi/iwl-io.c
··· 1 1 /****************************************************************************** 2 2 * 3 + * This file is provided under a dual BSD/GPLv2 license. When using or 4 + * redistributing this file, you may do so under either license. 5 + * 6 + * GPL LICENSE SUMMARY 7 + * 3 8 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 4 9 * Copyright(c) 2015 - 2016 Intel Deutschland GmbH 5 - * 6 - * Portions of this file are derived from the ipw3945 project. 7 10 * 8 11 * This program is free software; you can redistribute it and/or modify it 9 12 * under the terms of version 2 of the GNU General Public License as ··· 18 15 * more details. 19 16 * 20 17 * The full GNU General Public License is included in this distribution in the 21 - * file called LICENSE. 18 + * file called COPYING. 22 19 * 23 20 * Contact Information: 24 21 * Intel Linux Wireless <linuxwifi@intel.com> 25 22 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 23 + * 24 + * BSD LICENSE 25 + * 26 + * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 27 + * Copyright(c) 2015 - 2016 Intel Deutschland GmbH 28 + * All rights reserved. 29 + * 30 + * Redistribution and use in source and binary forms, with or without 31 + * modification, are permitted provided that the following conditions 32 + * are met: 33 + * 34 + * * Redistributions of source code must retain the above copyright 35 + * notice, this list of conditions and the following disclaimer. 36 + * * Redistributions in binary form must reproduce the above copyright 37 + * notice, this list of conditions and the following disclaimer in 38 + * the documentation and/or other materials provided with the 39 + * distribution. 40 + * * Neither the name Intel Corporation nor the names of its 41 + * contributors may be used to endorse or promote products derived 42 + * from this software without specific prior written permission. 43 + * 44 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 45 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 46 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 47 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 48 + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 49 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 50 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 51 + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 52 + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 53 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 54 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 55 * 27 56 *****************************************************************************/ 28 57 #include <linux/delay.h>
+34 -4
drivers/net/wireless/intel/iwlwifi/iwl-io.h
··· 1 1 /****************************************************************************** 2 2 * 3 - * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 3 + * This file is provided under a dual BSD/GPLv2 license. When using or 4 + * redistributing this file, you may do so under either license. 4 5 * 5 - * Portions of this file are derived from the ipw3945 project. 6 + * GPL LICENSE SUMMARY 6 7 * 7 8 * This program is free software; you can redistribute it and/or modify it 8 9 * under the terms of version 2 of the GNU General Public License as ··· 15 14 * more details. 16 15 * 17 16 * The full GNU General Public License is included in this distribution in the 18 - * file called LICENSE. 17 + * file called COPYING. 19 18 * 20 19 * Contact Information: 21 20 * Intel Linux Wireless <linuxwifi@intel.com> 22 21 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 23 22 * 23 + * BSD LICENSE 24 + * 25 + * All rights reserved. 26 + * 27 + * Redistribution and use in source and binary forms, with or without 28 + * modification, are permitted provided that the following conditions 29 + * are met: 30 + * 31 + * * Redistributions of source code must retain the above copyright 32 + * notice, this list of conditions and the following disclaimer. 33 + * * Redistributions in binary form must reproduce the above copyright 34 + * notice, this list of conditions and the following disclaimer in 35 + * the documentation and/or other materials provided with the 36 + * distribution. 37 + * * Neither the name Intel Corporation nor the names of its 38 + * contributors may be used to endorse or promote products derived 39 + * from this software without specific prior written permission. 40 + * 41 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 42 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 43 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 44 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 45 + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 46 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 47 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 48 + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 49 + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 50 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 51 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 52 + * 24 53 *****************************************************************************/ 25 - 26 54 #ifndef __iwl_io_h__ 27 55 #define __iwl_io_h__ 28 56
+18
drivers/net/wireless/intel/iwlwifi/iwl-modparams.h
··· 152 152 bool enable_ini; 153 153 }; 154 154 155 + static inline bool iwl_enable_rx_ampdu(void) 156 + { 157 + if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_RXAGG) 158 + return false; 159 + return true; 160 + } 161 + 162 + static inline bool iwl_enable_tx_ampdu(void) 163 + { 164 + if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG) 165 + return false; 166 + if (iwlwifi_mod_params.disable_11n & IWL_ENABLE_HT_TXAGG) 167 + return true; 168 + 169 + /* enabled by default */ 170 + return true; 171 + } 172 + 155 173 #endif /* #__iwl_modparams_h__ */
+2 -5
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
··· 569 569 .has_he = true, 570 570 .he_cap_elem = { 571 571 .mac_cap_info[0] = 572 - IEEE80211_HE_MAC_CAP0_HTC_HE | 573 - IEEE80211_HE_MAC_CAP0_TWT_RES, 572 + IEEE80211_HE_MAC_CAP0_HTC_HE, 574 573 .mac_cap_info[1] = 575 574 IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US | 576 575 IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8, ··· 1195 1196 regd_to_copy = sizeof(struct ieee80211_regdomain) + 1196 1197 valid_rules * sizeof(struct ieee80211_reg_rule); 1197 1198 1198 - copy_rd = kzalloc(regd_to_copy, GFP_KERNEL); 1199 + copy_rd = kmemdup(regd, regd_to_copy, GFP_KERNEL); 1199 1200 if (!copy_rd) { 1200 1201 copy_rd = ERR_PTR(-ENOMEM); 1201 1202 goto out; 1202 1203 } 1203 - 1204 - memcpy(copy_rd, regd, regd_to_copy); 1205 1204 1206 1205 out: 1207 1206 kfree(regdb_ptrs);
+2 -2
drivers/net/wireless/intel/iwlwifi/iwl-prph.h
··· 358 358 359 359 /* FW monitor */ 360 360 #define MON_BUFF_SAMPLE_CTL (0xa03c00) 361 - #define MON_BUFF_BASE_ADDR (0xa03c3c) 361 + #define MON_BUFF_BASE_ADDR (0xa03c1c) 362 362 #define MON_BUFF_END_ADDR (0xa03c40) 363 363 #define MON_BUFF_WRPTR (0xa03c44) 364 364 #define MON_BUFF_CYCLE_CNT (0xa03c48) 365 365 /* FW monitor family 8000 and on */ 366 - #define MON_BUFF_BASE_ADDR_VER2 (0xa03c3c) 366 + #define MON_BUFF_BASE_ADDR_VER2 (0xa03c1c) 367 367 #define MON_BUFF_END_ADDR_VER2 (0xa03c20) 368 368 #define MON_BUFF_WRPTR_VER2 (0xa03c24) 369 369 #define MON_BUFF_CYCLE_CNT_VER2 (0xa03c28)
+1 -2
drivers/net/wireless/intel/iwlwifi/mvm/Makefile
··· 7 7 iwlmvm-y += tt.o offloading.o tdls.o 8 8 iwlmvm-$(CONFIG_IWLWIFI_DEBUGFS) += debugfs.o debugfs-vif.o 9 9 iwlmvm-$(CONFIG_IWLWIFI_LEDS) += led.o 10 - iwlmvm-y += tof.o 11 10 iwlmvm-$(CONFIG_PM) += d3.o 12 11 13 - ccflags-y += -I$(src)/../ 12 + ccflags-y += -I $(srctree)/$(src)/../
+2 -6
drivers/net/wireless/intel/iwlwifi/mvm/d3.c
··· 2125 2125 2126 2126 file->private_data = inode->i_private; 2127 2127 2128 - ieee80211_stop_queues(mvm->hw); 2129 2128 synchronize_net(); 2130 2129 2131 2130 mvm->trans->system_pm_mode = IWL_PLAT_PM_MODE_D3; ··· 2139 2140 rtnl_unlock(); 2140 2141 if (err > 0) 2141 2142 err = -EINVAL; 2142 - if (err) { 2143 - ieee80211_wake_queues(mvm->hw); 2143 + if (err) 2144 2144 return err; 2145 - } 2145 + 2146 2146 mvm->d3_test_active = true; 2147 2147 mvm->keep_vif = NULL; 2148 2148 return 0; ··· 2220 2222 ieee80211_iterate_active_interfaces_atomic( 2221 2223 mvm->hw, IEEE80211_IFACE_ITER_NORMAL, 2222 2224 iwl_mvm_d3_test_disconn_work_iter, mvm->keep_vif); 2223 - 2224 - ieee80211_wake_queues(mvm->hw); 2225 2225 2226 2226 return 0; 2227 2227 }
+49 -774
drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
··· 60 60 * 61 61 *****************************************************************************/ 62 62 #include "mvm.h" 63 - #include "fw/api/tof.h" 64 63 #include "debugfs.h" 65 64 66 65 static void iwl_dbgfs_update_pm(struct iwl_mvm *mvm, ··· 522 523 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); 523 524 } 524 525 525 - static ssize_t iwl_dbgfs_tof_enable_write(struct ieee80211_vif *vif, 526 - char *buf, 527 - size_t count, loff_t *ppos) 528 - { 529 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 530 - struct iwl_mvm *mvm = mvmvif->mvm; 531 - u32 value; 532 - int ret = -EINVAL; 533 - char *data; 534 - 535 - mutex_lock(&mvm->mutex); 536 - 537 - data = iwl_dbgfs_is_match("tof_disabled=", buf); 538 - if (data) { 539 - ret = kstrtou32(data, 10, &value); 540 - if (ret == 0) 541 - mvm->tof_data.tof_cfg.tof_disabled = value; 542 - goto out; 543 - } 544 - 545 - data = iwl_dbgfs_is_match("one_sided_disabled=", buf); 546 - if (data) { 547 - ret = kstrtou32(data, 10, &value); 548 - if (ret == 0) 549 - mvm->tof_data.tof_cfg.one_sided_disabled = value; 550 - goto out; 551 - } 552 - 553 - data = iwl_dbgfs_is_match("is_debug_mode=", buf); 554 - if (data) { 555 - ret = kstrtou32(data, 10, &value); 556 - if (ret == 0) 557 - mvm->tof_data.tof_cfg.is_debug_mode = value; 558 - goto out; 559 - } 560 - 561 - data = iwl_dbgfs_is_match("is_buf=", buf); 562 - if (data) { 563 - ret = kstrtou32(data, 10, &value); 564 - if (ret == 0) 565 - mvm->tof_data.tof_cfg.is_buf_required = value; 566 - goto out; 567 - } 568 - 569 - data = iwl_dbgfs_is_match("send_tof_cfg=", buf); 570 - if (data) { 571 - ret = kstrtou32(data, 10, &value); 572 - if (ret == 0 && value) { 573 - ret = iwl_mvm_tof_config_cmd(mvm); 574 - goto out; 575 - } 576 - } 577 - 578 - out: 579 - mutex_unlock(&mvm->mutex); 580 - 581 - return ret ?: count; 582 - } 583 - 584 - static ssize_t iwl_dbgfs_tof_enable_read(struct file *file, 585 - char __user *user_buf, 586 - size_t count, loff_t *ppos) 587 - { 588 - struct ieee80211_vif *vif = file->private_data; 589 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 590 - struct iwl_mvm *mvm = mvmvif->mvm; 591 - char buf[256]; 592 - int pos = 0; 593 - const size_t bufsz = sizeof(buf); 594 - struct iwl_tof_config_cmd *cmd; 595 - 596 - cmd = &mvm->tof_data.tof_cfg; 597 - 598 - mutex_lock(&mvm->mutex); 599 - 600 - pos += scnprintf(buf + pos, bufsz - pos, "tof_disabled = %d\n", 601 - cmd->tof_disabled); 602 - pos += scnprintf(buf + pos, bufsz - pos, "one_sided_disabled = %d\n", 603 - cmd->one_sided_disabled); 604 - pos += scnprintf(buf + pos, bufsz - pos, "is_debug_mode = %d\n", 605 - cmd->is_debug_mode); 606 - pos += scnprintf(buf + pos, bufsz - pos, "is_buf_required = %d\n", 607 - cmd->is_buf_required); 608 - 609 - mutex_unlock(&mvm->mutex); 610 - 611 - return simple_read_from_buffer(user_buf, count, ppos, buf, pos); 612 - } 613 - 614 - static ssize_t iwl_dbgfs_tof_responder_params_write(struct ieee80211_vif *vif, 615 - char *buf, 616 - size_t count, loff_t *ppos) 617 - { 618 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 619 - struct iwl_mvm *mvm = mvmvif->mvm; 620 - u32 value; 621 - int ret = 0; 622 - char *data; 623 - 624 - mutex_lock(&mvm->mutex); 625 - 626 - data = iwl_dbgfs_is_match("burst_period=", buf); 627 - if (data) { 628 - ret = kstrtou32(data, 10, &value); 629 - if (!ret) 630 - mvm->tof_data.responder_cfg.burst_period = 631 - cpu_to_le16(value); 632 - goto out; 633 - } 634 - 635 - data = iwl_dbgfs_is_match("min_delta_ftm=", buf); 636 - if (data) { 637 - ret = kstrtou32(data, 10, &value); 638 - if (ret == 0) 639 - mvm->tof_data.responder_cfg.min_delta_ftm = value; 640 - goto out; 641 - } 642 - 643 - data = iwl_dbgfs_is_match("burst_duration=", buf); 644 - if (data) { 645 - ret = kstrtou32(data, 10, &value); 646 - if (ret == 0) 647 - mvm->tof_data.responder_cfg.burst_duration = value; 648 - goto out; 649 - } 650 - 651 - data = iwl_dbgfs_is_match("num_of_burst_exp=", buf); 652 - if (data) { 653 - ret = kstrtou32(data, 10, &value); 654 - if (ret == 0) 655 - mvm->tof_data.responder_cfg.num_of_burst_exp = value; 656 - goto out; 657 - } 658 - 659 - data = iwl_dbgfs_is_match("abort_responder=", buf); 660 - if (data) { 661 - ret = kstrtou32(data, 10, &value); 662 - if (ret == 0) 663 - mvm->tof_data.responder_cfg.abort_responder = value; 664 - goto out; 665 - } 666 - 667 - data = iwl_dbgfs_is_match("get_ch_est=", buf); 668 - if (data) { 669 - ret = kstrtou32(data, 10, &value); 670 - if (ret == 0) 671 - mvm->tof_data.responder_cfg.get_ch_est = value; 672 - goto out; 673 - } 674 - 675 - data = iwl_dbgfs_is_match("recv_sta_req_params=", buf); 676 - if (data) { 677 - ret = kstrtou32(data, 10, &value); 678 - if (ret == 0) 679 - mvm->tof_data.responder_cfg.recv_sta_req_params = value; 680 - goto out; 681 - } 682 - 683 - data = iwl_dbgfs_is_match("channel_num=", buf); 684 - if (data) { 685 - ret = kstrtou32(data, 10, &value); 686 - if (ret == 0) 687 - mvm->tof_data.responder_cfg.channel_num = value; 688 - goto out; 689 - } 690 - 691 - data = iwl_dbgfs_is_match("bandwidth=", buf); 692 - if (data) { 693 - ret = kstrtou32(data, 10, &value); 694 - if (ret == 0) 695 - mvm->tof_data.responder_cfg.bandwidth = value; 696 - goto out; 697 - } 698 - 699 - data = iwl_dbgfs_is_match("rate=", buf); 700 - if (data) { 701 - ret = kstrtou32(data, 10, &value); 702 - if (ret == 0) 703 - mvm->tof_data.responder_cfg.rate = value; 704 - goto out; 705 - } 706 - 707 - data = iwl_dbgfs_is_match("bssid=", buf); 708 - if (data) { 709 - u8 *mac = mvm->tof_data.responder_cfg.bssid; 710 - 711 - if (!mac_pton(data, mac)) { 712 - ret = -EINVAL; 713 - goto out; 714 - } 715 - } 716 - 717 - data = iwl_dbgfs_is_match("tsf_timer_offset_msecs=", buf); 718 - if (data) { 719 - ret = kstrtou32(data, 10, &value); 720 - if (ret == 0) 721 - mvm->tof_data.responder_cfg.tsf_timer_offset_msecs = 722 - cpu_to_le16(value); 723 - goto out; 724 - } 725 - 726 - data = iwl_dbgfs_is_match("toa_offset=", buf); 727 - if (data) { 728 - ret = kstrtou32(data, 10, &value); 729 - if (ret == 0) 730 - mvm->tof_data.responder_cfg.toa_offset = 731 - cpu_to_le16(value); 732 - goto out; 733 - } 734 - 735 - data = iwl_dbgfs_is_match("center_freq=", buf); 736 - if (data) { 737 - struct iwl_tof_responder_config_cmd *cmd = 738 - &mvm->tof_data.responder_cfg; 739 - 740 - ret = kstrtou32(data, 10, &value); 741 - if (ret == 0 && value) { 742 - enum nl80211_band band = (cmd->channel_num <= 14) ? 743 - NL80211_BAND_2GHZ : 744 - NL80211_BAND_5GHZ; 745 - struct ieee80211_channel chn = { 746 - .band = band, 747 - .center_freq = ieee80211_channel_to_frequency( 748 - cmd->channel_num, band), 749 - }; 750 - struct cfg80211_chan_def chandef = { 751 - .chan = &chn, 752 - .center_freq1 = 753 - ieee80211_channel_to_frequency(value, 754 - band), 755 - }; 756 - 757 - cmd->ctrl_ch_position = iwl_mvm_get_ctrl_pos(&chandef); 758 - } 759 - goto out; 760 - } 761 - 762 - data = iwl_dbgfs_is_match("ftm_per_burst=", buf); 763 - if (data) { 764 - ret = kstrtou32(data, 10, &value); 765 - if (ret == 0) 766 - mvm->tof_data.responder_cfg.ftm_per_burst = value; 767 - goto out; 768 - } 769 - 770 - data = iwl_dbgfs_is_match("ftm_resp_ts_avail=", buf); 771 - if (data) { 772 - ret = kstrtou32(data, 10, &value); 773 - if (ret == 0) 774 - mvm->tof_data.responder_cfg.ftm_resp_ts_avail = value; 775 - goto out; 776 - } 777 - 778 - data = iwl_dbgfs_is_match("asap_mode=", buf); 779 - if (data) { 780 - ret = kstrtou32(data, 10, &value); 781 - if (ret == 0) 782 - mvm->tof_data.responder_cfg.asap_mode = value; 783 - goto out; 784 - } 785 - 786 - data = iwl_dbgfs_is_match("send_responder_cfg=", buf); 787 - if (data) { 788 - ret = kstrtou32(data, 10, &value); 789 - if (ret == 0 && value) { 790 - ret = iwl_mvm_tof_responder_cmd(mvm, vif); 791 - goto out; 792 - } 793 - } 794 - 795 - out: 796 - mutex_unlock(&mvm->mutex); 797 - 798 - return ret ?: count; 799 - } 800 - 801 - static ssize_t iwl_dbgfs_tof_responder_params_read(struct file *file, 802 - char __user *user_buf, 803 - size_t count, loff_t *ppos) 804 - { 805 - struct ieee80211_vif *vif = file->private_data; 806 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 807 - struct iwl_mvm *mvm = mvmvif->mvm; 808 - char buf[256]; 809 - int pos = 0; 810 - const size_t bufsz = sizeof(buf); 811 - struct iwl_tof_responder_config_cmd *cmd; 812 - 813 - cmd = &mvm->tof_data.responder_cfg; 814 - 815 - mutex_lock(&mvm->mutex); 816 - 817 - pos += scnprintf(buf + pos, bufsz - pos, "burst_period = %d\n", 818 - le16_to_cpu(cmd->burst_period)); 819 - pos += scnprintf(buf + pos, bufsz - pos, "burst_duration = %d\n", 820 - cmd->burst_duration); 821 - pos += scnprintf(buf + pos, bufsz - pos, "bandwidth = %d\n", 822 - cmd->bandwidth); 823 - pos += scnprintf(buf + pos, bufsz - pos, "channel_num = %d\n", 824 - cmd->channel_num); 825 - pos += scnprintf(buf + pos, bufsz - pos, "ctrl_ch_position = 0x%x\n", 826 - cmd->ctrl_ch_position); 827 - pos += scnprintf(buf + pos, bufsz - pos, "bssid = %pM\n", 828 - cmd->bssid); 829 - pos += scnprintf(buf + pos, bufsz - pos, "min_delta_ftm = %d\n", 830 - cmd->min_delta_ftm); 831 - pos += scnprintf(buf + pos, bufsz - pos, "num_of_burst_exp = %d\n", 832 - cmd->num_of_burst_exp); 833 - pos += scnprintf(buf + pos, bufsz - pos, "rate = %d\n", cmd->rate); 834 - pos += scnprintf(buf + pos, bufsz - pos, "abort_responder = %d\n", 835 - cmd->abort_responder); 836 - pos += scnprintf(buf + pos, bufsz - pos, "get_ch_est = %d\n", 837 - cmd->get_ch_est); 838 - pos += scnprintf(buf + pos, bufsz - pos, "recv_sta_req_params = %d\n", 839 - cmd->recv_sta_req_params); 840 - pos += scnprintf(buf + pos, bufsz - pos, "ftm_per_burst = %d\n", 841 - cmd->ftm_per_burst); 842 - pos += scnprintf(buf + pos, bufsz - pos, "ftm_resp_ts_avail = %d\n", 843 - cmd->ftm_resp_ts_avail); 844 - pos += scnprintf(buf + pos, bufsz - pos, "asap_mode = %d\n", 845 - cmd->asap_mode); 846 - pos += scnprintf(buf + pos, bufsz - pos, 847 - "tsf_timer_offset_msecs = %d\n", 848 - le16_to_cpu(cmd->tsf_timer_offset_msecs)); 849 - pos += scnprintf(buf + pos, bufsz - pos, "toa_offset = %d\n", 850 - le16_to_cpu(cmd->toa_offset)); 851 - 852 - mutex_unlock(&mvm->mutex); 853 - 854 - return simple_read_from_buffer(user_buf, count, ppos, buf, pos); 855 - } 856 - 857 - static ssize_t iwl_dbgfs_tof_range_request_write(struct ieee80211_vif *vif, 858 - char *buf, size_t count, 859 - loff_t *ppos) 860 - { 861 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 862 - struct iwl_mvm *mvm = mvmvif->mvm; 863 - u32 value; 864 - int ret = 0; 865 - char *data; 866 - 867 - mutex_lock(&mvm->mutex); 868 - 869 - data = iwl_dbgfs_is_match("request_id=", buf); 870 - if (data) { 871 - ret = kstrtou32(data, 10, &value); 872 - if (ret == 0) 873 - mvm->tof_data.range_req.request_id = value; 874 - goto out; 875 - } 876 - 877 - data = iwl_dbgfs_is_match("initiator=", buf); 878 - if (data) { 879 - ret = kstrtou32(data, 10, &value); 880 - if (ret == 0) 881 - mvm->tof_data.range_req.initiator = value; 882 - goto out; 883 - } 884 - 885 - data = iwl_dbgfs_is_match("one_sided_los_disable=", buf); 886 - if (data) { 887 - ret = kstrtou32(data, 10, &value); 888 - if (ret == 0) 889 - mvm->tof_data.range_req.one_sided_los_disable = value; 890 - goto out; 891 - } 892 - 893 - data = iwl_dbgfs_is_match("req_timeout=", buf); 894 - if (data) { 895 - ret = kstrtou32(data, 10, &value); 896 - if (ret == 0) 897 - mvm->tof_data.range_req.req_timeout = value; 898 - goto out; 899 - } 900 - 901 - data = iwl_dbgfs_is_match("report_policy=", buf); 902 - if (data) { 903 - ret = kstrtou32(data, 10, &value); 904 - if (ret == 0) 905 - mvm->tof_data.range_req.report_policy = value; 906 - goto out; 907 - } 908 - 909 - data = iwl_dbgfs_is_match("macaddr_random=", buf); 910 - if (data) { 911 - ret = kstrtou32(data, 10, &value); 912 - if (ret == 0) 913 - mvm->tof_data.range_req.macaddr_random = value; 914 - goto out; 915 - } 916 - 917 - data = iwl_dbgfs_is_match("num_of_ap=", buf); 918 - if (data) { 919 - ret = kstrtou32(data, 10, &value); 920 - if (ret == 0) 921 - mvm->tof_data.range_req.num_of_ap = value; 922 - goto out; 923 - } 924 - 925 - data = iwl_dbgfs_is_match("macaddr_template=", buf); 926 - if (data) { 927 - u8 mac[ETH_ALEN]; 928 - 929 - if (!mac_pton(data, mac)) { 930 - ret = -EINVAL; 931 - goto out; 932 - } 933 - memcpy(mvm->tof_data.range_req.macaddr_template, mac, ETH_ALEN); 934 - goto out; 935 - } 936 - 937 - data = iwl_dbgfs_is_match("macaddr_mask=", buf); 938 - if (data) { 939 - u8 mac[ETH_ALEN]; 940 - 941 - if (!mac_pton(data, mac)) { 942 - ret = -EINVAL; 943 - goto out; 944 - } 945 - memcpy(mvm->tof_data.range_req.macaddr_mask, mac, ETH_ALEN); 946 - goto out; 947 - } 948 - 949 - data = iwl_dbgfs_is_match("ap=", buf); 950 - if (data) { 951 - struct iwl_tof_range_req_ap_entry ap = {}; 952 - int size = sizeof(struct iwl_tof_range_req_ap_entry); 953 - u16 burst_period; 954 - u8 *mac = ap.bssid; 955 - unsigned int i; 956 - 957 - if (sscanf(data, "%u %hhd %hhd %hhd" 958 - "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx" 959 - "%hhd %hhd %hd" 960 - "%hhd %hhd %d" 961 - "%hhx %hhd %hhd %hhd", 962 - &i, &ap.channel_num, &ap.bandwidth, 963 - &ap.ctrl_ch_position, 964 - mac, mac + 1, mac + 2, mac + 3, mac + 4, mac + 5, 965 - &ap.measure_type, &ap.num_of_bursts, 966 - &burst_period, 967 - &ap.samples_per_burst, &ap.retries_per_sample, 968 - &ap.tsf_delta, &ap.location_req, &ap.asap_mode, 969 - &ap.enable_dyn_ack, &ap.rssi) != 20) { 970 - ret = -EINVAL; 971 - goto out; 972 - } 973 - if (i >= IWL_MVM_TOF_MAX_APS) { 974 - IWL_ERR(mvm, "Invalid AP index %d\n", i); 975 - ret = -EINVAL; 976 - goto out; 977 - } 978 - 979 - ap.burst_period = cpu_to_le16(burst_period); 980 - 981 - memcpy(&mvm->tof_data.range_req.ap[i], &ap, size); 982 - goto out; 983 - } 984 - 985 - data = iwl_dbgfs_is_match("send_range_request=", buf); 986 - if (data) { 987 - ret = kstrtou32(data, 10, &value); 988 - if (ret == 0 && value) 989 - ret = iwl_mvm_tof_range_request_cmd(mvm, vif); 990 - goto out; 991 - } 992 - 993 - ret = -EINVAL; 994 - out: 995 - mutex_unlock(&mvm->mutex); 996 - return ret ?: count; 997 - } 998 - 999 - static ssize_t iwl_dbgfs_tof_range_request_read(struct file *file, 1000 - char __user *user_buf, 1001 - size_t count, loff_t *ppos) 1002 - { 1003 - struct ieee80211_vif *vif = file->private_data; 1004 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 1005 - struct iwl_mvm *mvm = mvmvif->mvm; 1006 - char buf[512]; 1007 - int pos = 0; 1008 - const size_t bufsz = sizeof(buf); 1009 - struct iwl_tof_range_req_cmd *cmd; 1010 - int i; 1011 - 1012 - cmd = &mvm->tof_data.range_req; 1013 - 1014 - mutex_lock(&mvm->mutex); 1015 - 1016 - pos += scnprintf(buf + pos, bufsz - pos, "request_id= %d\n", 1017 - cmd->request_id); 1018 - pos += scnprintf(buf + pos, bufsz - pos, "initiator= %d\n", 1019 - cmd->initiator); 1020 - pos += scnprintf(buf + pos, bufsz - pos, "one_sided_los_disable = %d\n", 1021 - cmd->one_sided_los_disable); 1022 - pos += scnprintf(buf + pos, bufsz - pos, "req_timeout= %d\n", 1023 - cmd->req_timeout); 1024 - pos += scnprintf(buf + pos, bufsz - pos, "report_policy= %d\n", 1025 - cmd->report_policy); 1026 - pos += scnprintf(buf + pos, bufsz - pos, "macaddr_random= %d\n", 1027 - cmd->macaddr_random); 1028 - pos += scnprintf(buf + pos, bufsz - pos, "macaddr_template= %pM\n", 1029 - cmd->macaddr_template); 1030 - pos += scnprintf(buf + pos, bufsz - pos, "macaddr_mask= %pM\n", 1031 - cmd->macaddr_mask); 1032 - pos += scnprintf(buf + pos, bufsz - pos, "num_of_ap= %d\n", 1033 - cmd->num_of_ap); 1034 - for (i = 0; i < cmd->num_of_ap; i++) { 1035 - struct iwl_tof_range_req_ap_entry *ap = &cmd->ap[i]; 1036 - 1037 - pos += scnprintf(buf + pos, bufsz - pos, 1038 - "ap %.2d: channel_num=%hhd bw=%hhd" 1039 - " control=%hhd bssid=%pM type=%hhd" 1040 - " num_of_bursts=%hhd burst_period=%hd ftm=%hhd" 1041 - " retries=%hhd tsf_delta=%d" 1042 - " tsf_delta_direction=%hhd location_req=0x%hhx " 1043 - " asap=%hhd enable=%hhd rssi=%hhd\n", 1044 - i, ap->channel_num, ap->bandwidth, 1045 - ap->ctrl_ch_position, ap->bssid, 1046 - ap->measure_type, ap->num_of_bursts, 1047 - ap->burst_period, ap->samples_per_burst, 1048 - ap->retries_per_sample, ap->tsf_delta, 1049 - ap->tsf_delta_direction, 1050 - ap->location_req, ap->asap_mode, 1051 - ap->enable_dyn_ack, ap->rssi); 1052 - } 1053 - 1054 - mutex_unlock(&mvm->mutex); 1055 - 1056 - return simple_read_from_buffer(user_buf, count, ppos, buf, pos); 1057 - } 1058 - 1059 - static ssize_t iwl_dbgfs_tof_range_req_ext_write(struct ieee80211_vif *vif, 1060 - char *buf, 1061 - size_t count, loff_t *ppos) 1062 - { 1063 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 1064 - struct iwl_mvm *mvm = mvmvif->mvm; 1065 - u32 value; 1066 - int ret = 0; 1067 - char *data; 1068 - 1069 - mutex_lock(&mvm->mutex); 1070 - 1071 - data = iwl_dbgfs_is_match("tsf_timer_offset_msec=", buf); 1072 - if (data) { 1073 - ret = kstrtou32(data, 10, &value); 1074 - if (ret == 0) 1075 - mvm->tof_data.range_req_ext.tsf_timer_offset_msec = 1076 - cpu_to_le16(value); 1077 - goto out; 1078 - } 1079 - 1080 - data = iwl_dbgfs_is_match("min_delta_ftm=", buf); 1081 - if (data) { 1082 - ret = kstrtou32(data, 10, &value); 1083 - if (ret == 0) 1084 - mvm->tof_data.range_req_ext.min_delta_ftm = value; 1085 - goto out; 1086 - } 1087 - 1088 - data = iwl_dbgfs_is_match("ftm_format_and_bw20M=", buf); 1089 - if (data) { 1090 - ret = kstrtou32(data, 10, &value); 1091 - if (ret == 0) 1092 - mvm->tof_data.range_req_ext.ftm_format_and_bw20M = 1093 - value; 1094 - goto out; 1095 - } 1096 - 1097 - data = iwl_dbgfs_is_match("ftm_format_and_bw40M=", buf); 1098 - if (data) { 1099 - ret = kstrtou32(data, 10, &value); 1100 - if (ret == 0) 1101 - mvm->tof_data.range_req_ext.ftm_format_and_bw40M = 1102 - value; 1103 - goto out; 1104 - } 1105 - 1106 - data = iwl_dbgfs_is_match("ftm_format_and_bw80M=", buf); 1107 - if (data) { 1108 - ret = kstrtou32(data, 10, &value); 1109 - if (ret == 0) 1110 - mvm->tof_data.range_req_ext.ftm_format_and_bw80M = 1111 - value; 1112 - goto out; 1113 - } 1114 - 1115 - data = iwl_dbgfs_is_match("send_range_req_ext=", buf); 1116 - if (data) { 1117 - ret = kstrtou32(data, 10, &value); 1118 - if (ret == 0 && value) 1119 - ret = iwl_mvm_tof_range_request_ext_cmd(mvm, vif); 1120 - goto out; 1121 - } 1122 - 1123 - ret = -EINVAL; 1124 - out: 1125 - mutex_unlock(&mvm->mutex); 1126 - return ret ?: count; 1127 - } 1128 - 1129 - static ssize_t iwl_dbgfs_tof_range_req_ext_read(struct file *file, 1130 - char __user *user_buf, 1131 - size_t count, loff_t *ppos) 1132 - { 1133 - struct ieee80211_vif *vif = file->private_data; 1134 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 1135 - struct iwl_mvm *mvm = mvmvif->mvm; 1136 - char buf[256]; 1137 - int pos = 0; 1138 - const size_t bufsz = sizeof(buf); 1139 - struct iwl_tof_range_req_ext_cmd *cmd; 1140 - 1141 - cmd = &mvm->tof_data.range_req_ext; 1142 - 1143 - mutex_lock(&mvm->mutex); 1144 - 1145 - pos += scnprintf(buf + pos, bufsz - pos, 1146 - "tsf_timer_offset_msec = %hd\n", 1147 - cmd->tsf_timer_offset_msec); 1148 - pos += scnprintf(buf + pos, bufsz - pos, "min_delta_ftm = %hhd\n", 1149 - cmd->min_delta_ftm); 1150 - pos += scnprintf(buf + pos, bufsz - pos, 1151 - "ftm_format_and_bw20M = %hhd\n", 1152 - cmd->ftm_format_and_bw20M); 1153 - pos += scnprintf(buf + pos, bufsz - pos, 1154 - "ftm_format_and_bw40M = %hhd\n", 1155 - cmd->ftm_format_and_bw40M); 1156 - pos += scnprintf(buf + pos, bufsz - pos, 1157 - "ftm_format_and_bw80M = %hhd\n", 1158 - cmd->ftm_format_and_bw80M); 1159 - 1160 - mutex_unlock(&mvm->mutex); 1161 - return simple_read_from_buffer(user_buf, count, ppos, buf, pos); 1162 - } 1163 - 1164 - static ssize_t iwl_dbgfs_tof_range_abort_write(struct ieee80211_vif *vif, 1165 - char *buf, 1166 - size_t count, loff_t *ppos) 1167 - { 1168 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 1169 - struct iwl_mvm *mvm = mvmvif->mvm; 1170 - u32 value; 1171 - int abort_id, ret = 0; 1172 - char *data; 1173 - 1174 - mutex_lock(&mvm->mutex); 1175 - 1176 - data = iwl_dbgfs_is_match("abort_id=", buf); 1177 - if (data) { 1178 - ret = kstrtou32(data, 10, &value); 1179 - if (ret == 0) 1180 - mvm->tof_data.last_abort_id = value; 1181 - goto out; 1182 - } 1183 - 1184 - data = iwl_dbgfs_is_match("send_range_abort=", buf); 1185 - if (data) { 1186 - ret = kstrtou32(data, 10, &value); 1187 - if (ret == 0 && value) { 1188 - abort_id = mvm->tof_data.last_abort_id; 1189 - ret = iwl_mvm_tof_range_abort_cmd(mvm, abort_id); 1190 - goto out; 1191 - } 1192 - } 1193 - 1194 - out: 1195 - mutex_unlock(&mvm->mutex); 1196 - return ret ?: count; 1197 - } 1198 - 1199 - static ssize_t iwl_dbgfs_tof_range_abort_read(struct file *file, 1200 - char __user *user_buf, 1201 - size_t count, loff_t *ppos) 1202 - { 1203 - struct ieee80211_vif *vif = file->private_data; 1204 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 1205 - struct iwl_mvm *mvm = mvmvif->mvm; 1206 - char buf[32]; 1207 - int pos = 0; 1208 - const size_t bufsz = sizeof(buf); 1209 - int last_abort_id; 1210 - 1211 - mutex_lock(&mvm->mutex); 1212 - last_abort_id = mvm->tof_data.last_abort_id; 1213 - mutex_unlock(&mvm->mutex); 1214 - 1215 - pos += scnprintf(buf + pos, bufsz - pos, "last_abort_id = %d\n", 1216 - last_abort_id); 1217 - return simple_read_from_buffer(user_buf, count, ppos, buf, pos); 1218 - } 1219 - 1220 - static ssize_t iwl_dbgfs_tof_range_response_read(struct file *file, 1221 - char __user *user_buf, 1222 - size_t count, loff_t *ppos) 1223 - { 1224 - struct ieee80211_vif *vif = file->private_data; 1225 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 1226 - struct iwl_mvm *mvm = mvmvif->mvm; 1227 - char *buf; 1228 - int pos = 0; 1229 - const size_t bufsz = sizeof(struct iwl_tof_range_rsp_ntfy) + 256; 1230 - struct iwl_tof_range_rsp_ntfy *cmd; 1231 - int i, ret; 1232 - 1233 - buf = kzalloc(bufsz, GFP_KERNEL); 1234 - if (!buf) 1235 - return -ENOMEM; 1236 - 1237 - mutex_lock(&mvm->mutex); 1238 - cmd = &mvm->tof_data.range_resp; 1239 - 1240 - pos += scnprintf(buf + pos, bufsz - pos, "request_id = %d\n", 1241 - cmd->request_id); 1242 - pos += scnprintf(buf + pos, bufsz - pos, "status = %d\n", 1243 - cmd->request_status); 1244 - pos += scnprintf(buf + pos, bufsz - pos, "last_in_batch = %d\n", 1245 - cmd->last_in_batch); 1246 - pos += scnprintf(buf + pos, bufsz - pos, "num_of_aps = %d\n", 1247 - cmd->num_of_aps); 1248 - for (i = 0; i < cmd->num_of_aps; i++) { 1249 - struct iwl_tof_range_rsp_ap_entry_ntfy *ap = &cmd->ap[i]; 1250 - 1251 - pos += scnprintf(buf + pos, bufsz - pos, 1252 - "ap %.2d: bssid=%pM status=%hhd bw=%hhd" 1253 - " rtt=%d rtt_var=%d rtt_spread=%d" 1254 - " rssi=%hhd rssi_spread=%hhd" 1255 - " range=%d range_var=%d" 1256 - " time_stamp=%d\n", 1257 - i, ap->bssid, ap->measure_status, 1258 - ap->measure_bw, 1259 - ap->rtt, ap->rtt_variance, ap->rtt_spread, 1260 - ap->rssi, ap->rssi_spread, ap->range, 1261 - ap->range_variance, ap->timestamp); 1262 - } 1263 - mutex_unlock(&mvm->mutex); 1264 - 1265 - ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); 1266 - kfree(buf); 1267 - return ret; 1268 - } 1269 - 1270 526 static ssize_t iwl_dbgfs_low_latency_write(struct ieee80211_vif *vif, char *buf, 1271 527 size_t count, loff_t *ppos) 1272 528 { ··· 543 1289 return count; 544 1290 } 545 1291 1292 + static ssize_t 1293 + iwl_dbgfs_low_latency_force_write(struct ieee80211_vif *vif, char *buf, 1294 + size_t count, loff_t *ppos) 1295 + { 1296 + struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 1297 + struct iwl_mvm *mvm = mvmvif->mvm; 1298 + u8 value; 1299 + int ret; 1300 + 1301 + ret = kstrtou8(buf, 0, &value); 1302 + if (ret) 1303 + return ret; 1304 + 1305 + if (value > NUM_LOW_LATENCY_FORCE) 1306 + return -EINVAL; 1307 + 1308 + mutex_lock(&mvm->mutex); 1309 + if (value == LOW_LATENCY_FORCE_UNSET) { 1310 + iwl_mvm_update_low_latency(mvm, vif, false, 1311 + LOW_LATENCY_DEBUGFS_FORCE); 1312 + iwl_mvm_update_low_latency(mvm, vif, false, 1313 + LOW_LATENCY_DEBUGFS_FORCE_ENABLE); 1314 + } else { 1315 + iwl_mvm_update_low_latency(mvm, vif, 1316 + value == LOW_LATENCY_FORCE_ON, 1317 + LOW_LATENCY_DEBUGFS_FORCE); 1318 + iwl_mvm_update_low_latency(mvm, vif, true, 1319 + LOW_LATENCY_DEBUGFS_FORCE_ENABLE); 1320 + } 1321 + mutex_unlock(&mvm->mutex); 1322 + return count; 1323 + } 1324 + 546 1325 static ssize_t iwl_dbgfs_low_latency_read(struct file *file, 547 1326 char __user *user_buf, 548 1327 size_t count, loff_t *ppos) 549 1328 { 550 1329 struct ieee80211_vif *vif = file->private_data; 551 1330 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 552 - char buf[30] = {}; 1331 + char format[] = "traffic=%d\ndbgfs=%d\nvcmd=%d\nvif_type=%d\n" 1332 + "dbgfs_force_enable=%d\ndbgfs_force=%d\nactual=%d\n"; 1333 + 1334 + /* 1335 + * all values in format are boolean so the size of format is enough 1336 + * for holding the result string 1337 + */ 1338 + char buf[sizeof(format) + 1] = {}; 553 1339 int len; 554 1340 555 - len = scnprintf(buf, sizeof(buf) - 1, 556 - "traffic=%d\ndbgfs=%d\nvcmd=%d\nvif_type=%d\n", 1341 + len = scnprintf(buf, sizeof(buf) - 1, format, 557 1342 !!(mvmvif->low_latency & LOW_LATENCY_TRAFFIC), 558 1343 !!(mvmvif->low_latency & LOW_LATENCY_DEBUGFS), 559 1344 !!(mvmvif->low_latency & LOW_LATENCY_VCMD), 560 - !!(mvmvif->low_latency & LOW_LATENCY_VIF_TYPE)); 1345 + !!(mvmvif->low_latency & LOW_LATENCY_VIF_TYPE), 1346 + !!(mvmvif->low_latency & 1347 + LOW_LATENCY_DEBUGFS_FORCE_ENABLE), 1348 + !!(mvmvif->low_latency & LOW_LATENCY_DEBUGFS_FORCE), 1349 + !!(mvmvif->low_latency_actual)); 561 1350 return simple_read_from_buffer(user_buf, count, ppos, buf, len); 562 1351 } 563 1352 ··· 753 1456 MVM_DEBUGFS_READ_WRITE_FILE_OPS(pm_params, 32); 754 1457 MVM_DEBUGFS_READ_WRITE_FILE_OPS(bf_params, 256); 755 1458 MVM_DEBUGFS_READ_WRITE_FILE_OPS(low_latency, 10); 1459 + MVM_DEBUGFS_WRITE_FILE_OPS(low_latency_force, 10); 756 1460 MVM_DEBUGFS_READ_WRITE_FILE_OPS(uapsd_misbehaving, 20); 757 1461 MVM_DEBUGFS_READ_WRITE_FILE_OPS(rx_phyinfo, 10); 758 - MVM_DEBUGFS_READ_WRITE_FILE_OPS(tof_enable, 32); 759 - MVM_DEBUGFS_READ_WRITE_FILE_OPS(tof_range_request, 512); 760 - MVM_DEBUGFS_READ_WRITE_FILE_OPS(tof_range_req_ext, 32); 761 - MVM_DEBUGFS_READ_WRITE_FILE_OPS(tof_range_abort, 32); 762 - MVM_DEBUGFS_READ_FILE_OPS(tof_range_response); 763 - MVM_DEBUGFS_READ_WRITE_FILE_OPS(tof_responder_params, 32); 764 1462 MVM_DEBUGFS_READ_WRITE_FILE_OPS(quota_min, 32); 765 1463 MVM_DEBUGFS_READ_FILE_OPS(os_device_timediff); 766 1464 ··· 789 1497 MVM_DEBUGFS_ADD_FILE_VIF(tx_pwr_lmt, mvmvif->dbgfs_dir, 0400); 790 1498 MVM_DEBUGFS_ADD_FILE_VIF(mac_params, mvmvif->dbgfs_dir, 0400); 791 1499 MVM_DEBUGFS_ADD_FILE_VIF(low_latency, mvmvif->dbgfs_dir, 0600); 1500 + MVM_DEBUGFS_ADD_FILE_VIF(low_latency_force, mvmvif->dbgfs_dir, 0600); 792 1501 MVM_DEBUGFS_ADD_FILE_VIF(uapsd_misbehaving, mvmvif->dbgfs_dir, 0600); 793 1502 MVM_DEBUGFS_ADD_FILE_VIF(rx_phyinfo, mvmvif->dbgfs_dir, 0600); 794 1503 MVM_DEBUGFS_ADD_FILE_VIF(quota_min, mvmvif->dbgfs_dir, 0600); ··· 798 1505 if (vif->type == NL80211_IFTYPE_STATION && !vif->p2p && 799 1506 mvmvif == mvm->bf_allowed_vif) 800 1507 MVM_DEBUGFS_ADD_FILE_VIF(bf_params, mvmvif->dbgfs_dir, 0600); 801 - 802 - if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TOF_SUPPORT) && 803 - !vif->p2p && (vif->type != NL80211_IFTYPE_P2P_DEVICE)) { 804 - if (IWL_MVM_TOF_IS_RESPONDER && vif->type == NL80211_IFTYPE_AP) 805 - MVM_DEBUGFS_ADD_FILE_VIF(tof_responder_params, 806 - mvmvif->dbgfs_dir, 0600); 807 - 808 - MVM_DEBUGFS_ADD_FILE_VIF(tof_range_request, mvmvif->dbgfs_dir, 809 - 0600); 810 - MVM_DEBUGFS_ADD_FILE_VIF(tof_range_req_ext, mvmvif->dbgfs_dir, 811 - 0600); 812 - MVM_DEBUGFS_ADD_FILE_VIF(tof_enable, mvmvif->dbgfs_dir, 813 - 0600); 814 - MVM_DEBUGFS_ADD_FILE_VIF(tof_range_abort, mvmvif->dbgfs_dir, 815 - 0600); 816 - MVM_DEBUGFS_ADD_FILE_VIF(tof_range_response, mvmvif->dbgfs_dir, 817 - 0400); 818 - } 819 1508 820 1509 /* 821 1510 * Create symlink for convenience pointing to interface specific
+47 -44
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
··· 69 69 #include "sta.h" 70 70 #include "iwl-io.h" 71 71 #include "debugfs.h" 72 + #include "iwl-modparams.h" 72 73 #include "fw/error-dump.h" 73 74 74 75 static ssize_t iwl_dbgfs_ctdp_budget_read(struct file *file, ··· 1207 1206 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); 1208 1207 } 1209 1208 1210 - /* 1211 - * Enable / Disable continuous recording. 1212 - * Cause the FW to start continuous recording, by sending the relevant hcmd. 1213 - * Enable: input of every integer larger than 0, ENABLE_CONT_RECORDING. 1214 - * Disable: for 0 as input, DISABLE_CONT_RECORDING. 1215 - */ 1216 - static ssize_t iwl_dbgfs_cont_recording_write(struct iwl_mvm *mvm, 1217 - char *buf, size_t count, 1218 - loff_t *ppos) 1219 - { 1220 - struct iwl_trans *trans = mvm->trans; 1221 - const struct iwl_fw_dbg_dest_tlv_v1 *dest = trans->dbg_dest_tlv; 1222 - struct iwl_continuous_record_cmd cont_rec = {}; 1223 - int ret, rec_mode; 1224 - 1225 - if (!iwl_mvm_firmware_running(mvm)) 1226 - return -EIO; 1227 - 1228 - if (!dest) 1229 - return -EOPNOTSUPP; 1230 - 1231 - if (dest->monitor_mode != SMEM_MODE || 1232 - trans->cfg->device_family < IWL_DEVICE_FAMILY_8000) 1233 - return -EOPNOTSUPP; 1234 - 1235 - ret = kstrtoint(buf, 0, &rec_mode); 1236 - if (ret) 1237 - return ret; 1238 - 1239 - cont_rec.record_mode.enable_recording = rec_mode ? 1240 - cpu_to_le16(ENABLE_CONT_RECORDING) : 1241 - cpu_to_le16(DISABLE_CONT_RECORDING); 1242 - 1243 - mutex_lock(&mvm->mutex); 1244 - ret = iwl_mvm_send_cmd_pdu(mvm, LDBG_CONFIG_CMD, 0, 1245 - sizeof(cont_rec), &cont_rec); 1246 - mutex_unlock(&mvm->mutex); 1247 - 1248 - return ret ?: count; 1249 - } 1250 - 1251 1209 static ssize_t iwl_dbgfs_fw_dbg_conf_write(struct iwl_mvm *mvm, 1252 1210 char *buf, size_t count, 1253 1211 loff_t *ppos) ··· 1682 1722 return ret ?: count; 1683 1723 } 1684 1724 1725 + struct iwl_mvm_sniffer_apply { 1726 + struct iwl_mvm *mvm; 1727 + u16 aid; 1728 + }; 1729 + 1730 + static bool iwl_mvm_sniffer_apply(struct iwl_notif_wait_data *notif_data, 1731 + struct iwl_rx_packet *pkt, void *data) 1732 + { 1733 + struct iwl_mvm_sniffer_apply *apply = data; 1734 + 1735 + apply->mvm->cur_aid = cpu_to_le16(apply->aid); 1736 + 1737 + return true; 1738 + } 1739 + 1685 1740 static ssize_t 1686 1741 iwl_dbgfs_he_sniffer_params_write(struct iwl_mvm *mvm, char *buf, 1687 - size_t count, loff_t *ppos) 1742 + size_t count, loff_t *ppos) 1688 1743 { 1744 + struct iwl_notification_wait wait; 1689 1745 struct iwl_he_monitor_cmd he_mon_cmd = {}; 1746 + struct iwl_mvm_sniffer_apply apply = { 1747 + .mvm = mvm, 1748 + }; 1749 + u16 wait_cmds[] = { 1750 + iwl_cmd_id(HE_AIR_SNIFFER_CONFIG_CMD, DATA_PATH_GROUP, 0), 1751 + }; 1690 1752 u32 aid; 1691 1753 int ret; 1692 1754 ··· 1724 1742 1725 1743 he_mon_cmd.aid = cpu_to_le16(aid); 1726 1744 1745 + apply.aid = aid; 1746 + 1727 1747 mutex_lock(&mvm->mutex); 1748 + 1749 + /* 1750 + * Use the notification waiter to get our function triggered 1751 + * in sequence with other RX. This ensures that frames we get 1752 + * on the RX queue _before_ the new configuration is applied 1753 + * still have mvm->cur_aid pointing to the old AID, and that 1754 + * frames on the RX queue _after_ the firmware processed the 1755 + * new configuration (and sent the response, synchronously) 1756 + * get mvm->cur_aid correctly set to the new AID. 1757 + */ 1758 + iwl_init_notification_wait(&mvm->notif_wait, &wait, 1759 + wait_cmds, ARRAY_SIZE(wait_cmds), 1760 + iwl_mvm_sniffer_apply, &apply); 1761 + 1728 1762 ret = iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(HE_AIR_SNIFFER_CONFIG_CMD, 1729 1763 DATA_PATH_GROUP, 0), 0, 1730 1764 sizeof(he_mon_cmd), &he_mon_cmd); 1765 + 1766 + /* no need to really wait, we already did anyway */ 1767 + iwl_remove_notification(&mvm->notif_wait, &wait); 1768 + 1731 1769 mutex_unlock(&mvm->mutex); 1732 1770 1733 1771 return ret ?: count; ··· 1802 1800 MVM_DEBUGFS_READ_WRITE_FILE_OPS(d0i3_refs, 8); 1803 1801 MVM_DEBUGFS_READ_WRITE_FILE_OPS(fw_dbg_conf, 8); 1804 1802 MVM_DEBUGFS_WRITE_FILE_OPS(fw_dbg_collect, 64); 1805 - MVM_DEBUGFS_WRITE_FILE_OPS(cont_recording, 8); 1806 1803 MVM_DEBUGFS_WRITE_FILE_OPS(max_amsdu_len, 8); 1807 1804 MVM_DEBUGFS_WRITE_FILE_OPS(indirection_tbl, 1808 1805 (IWL_RSS_INDIRECTION_TABLE_SIZE * 2)); ··· 2005 2004 MVM_DEBUGFS_ADD_FILE(fw_dbg_collect, mvm->debugfs_dir, 0200); 2006 2005 MVM_DEBUGFS_ADD_FILE(max_amsdu_len, mvm->debugfs_dir, 0200); 2007 2006 MVM_DEBUGFS_ADD_FILE(send_echo_cmd, mvm->debugfs_dir, 0200); 2008 - MVM_DEBUGFS_ADD_FILE(cont_recording, mvm->debugfs_dir, 0200); 2009 2007 MVM_DEBUGFS_ADD_FILE(indirection_tbl, mvm->debugfs_dir, 0200); 2010 2008 MVM_DEBUGFS_ADD_FILE(inject_packet, mvm->debugfs_dir, 0200); 2011 2009 #ifdef CONFIG_ACPI ··· 2070 2070 goto err; 2071 2071 if (!debugfs_create_blob("nvm_phy_sku", 0400, 2072 2072 mvm->debugfs_dir, &mvm->nvm_phy_sku_blob)) 2073 + goto err; 2074 + if (!debugfs_create_blob("nvm_reg", S_IRUSR, 2075 + mvm->debugfs_dir, &mvm->nvm_reg_blob)) 2073 2076 goto err; 2074 2077 2075 2078 debugfs_create_file("mem", 0600, dbgfs_dir, mvm, &iwl_dbgfs_mem_ops);
+3 -1
drivers/net/wireless/intel/iwlwifi/mvm/fw-api.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 12 * 12 13 * This program is free software; you can redistribute it and/or modify 13 14 * it under the terms of version 2 of the GNU General Public License as ··· 31 30 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 32 31 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 33 32 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 33 + * Copyright (C) 2018 Intel Corporation 34 34 * All rights reserved. 35 35 * 36 36 * Redistribution and use in source and binary forms, with or without ··· 91 89 #include "fw/api/sf.h" 92 90 #include "fw/api/sta.h" 93 91 #include "fw/api/stats.h" 94 - #include "fw/api/tof.h" 92 + #include "fw/api/location.h" 95 93 #include "fw/api/tx.h" 96 94 97 95 #endif /* __fw_api_h__ */
+2 -5
drivers/net/wireless/intel/iwlwifi/mvm/fw.c
··· 293 293 enum iwl_ucode_type ucode_type) 294 294 { 295 295 struct iwl_notification_wait alive_wait; 296 - struct iwl_mvm_alive_data alive_data; 296 + struct iwl_mvm_alive_data alive_data = {}; 297 297 const struct fw_img *fw; 298 - int ret, i; 298 + int ret; 299 299 enum iwl_ucode_type old_type = mvm->fwrt.cur_fw_img; 300 300 static const u16 alive_cmd[] = { MVM_ALIVE }; 301 301 ··· 372 372 */ 373 373 mvm->queue_info[IWL_MVM_DQA_CMD_QUEUE].tid_bitmap = 374 374 BIT(IWL_MAX_TID_COUNT + 2); 375 - 376 - for (i = 0; i < IEEE80211_MAX_QUEUES; i++) 377 - atomic_set(&mvm->mac80211_queue_stop_count[i], 0); 378 375 379 376 set_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status); 380 377 #ifdef CONFIG_IWLWIFI_DEBUGFS
+50 -150
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
··· 97 97 bool found_vif; 98 98 }; 99 99 100 - struct iwl_mvm_hw_queues_iface_iterator_data { 101 - struct ieee80211_vif *exclude_vif; 102 - unsigned long used_hw_queues; 103 - }; 104 - 105 100 static void iwl_mvm_mac_tsf_id_iter(void *_data, u8 *mac, 106 101 struct ieee80211_vif *vif) 107 102 { ··· 203 208 data->preferred_tsf = NUM_TSF_IDS; 204 209 } 205 210 206 - /* 207 - * Get the mask of the queues used by the vif 208 - */ 209 - u32 iwl_mvm_mac_get_queues_mask(struct ieee80211_vif *vif) 210 - { 211 - u32 qmask = 0, ac; 212 - 213 - if (vif->type == NL80211_IFTYPE_P2P_DEVICE) 214 - return BIT(IWL_MVM_OFFCHANNEL_QUEUE); 215 - 216 - for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) { 217 - if (vif->hw_queue[ac] != IEEE80211_INVAL_HW_QUEUE) 218 - qmask |= BIT(vif->hw_queue[ac]); 219 - } 220 - 221 - if (vif->type == NL80211_IFTYPE_AP || 222 - vif->type == NL80211_IFTYPE_ADHOC) 223 - qmask |= BIT(vif->cab_queue); 224 - 225 - return qmask; 226 - } 227 - 228 - static void iwl_mvm_iface_hw_queues_iter(void *_data, u8 *mac, 229 - struct ieee80211_vif *vif) 230 - { 231 - struct iwl_mvm_hw_queues_iface_iterator_data *data = _data; 232 - 233 - /* exclude the given vif */ 234 - if (vif == data->exclude_vif) 235 - return; 236 - 237 - data->used_hw_queues |= iwl_mvm_mac_get_queues_mask(vif); 238 - } 239 - 240 - unsigned long iwl_mvm_get_used_hw_queues(struct iwl_mvm *mvm, 241 - struct ieee80211_vif *exclude_vif) 242 - { 243 - struct iwl_mvm_hw_queues_iface_iterator_data data = { 244 - .exclude_vif = exclude_vif, 245 - .used_hw_queues = 246 - BIT(IWL_MVM_OFFCHANNEL_QUEUE) | 247 - BIT(mvm->aux_queue) | 248 - BIT(IWL_MVM_DQA_GCAST_QUEUE), 249 - }; 250 - 251 - lockdep_assert_held(&mvm->mutex); 252 - 253 - /* mark all VIF used hw queues */ 254 - ieee80211_iterate_active_interfaces_atomic( 255 - mvm->hw, IEEE80211_IFACE_ITER_RESUME_ALL, 256 - iwl_mvm_iface_hw_queues_iter, &data); 257 - 258 - return data.used_hw_queues; 259 - } 260 - 261 211 static void iwl_mvm_mac_iface_iterator(void *_data, u8 *mac, 262 212 struct ieee80211_vif *vif) 263 213 { ··· 300 360 mvm->hw, IEEE80211_IFACE_ITER_RESUME_ALL, 301 361 iwl_mvm_mac_iface_iterator, &data); 302 362 303 - used_hw_queues = iwl_mvm_get_used_hw_queues(mvm, vif); 304 - 305 363 /* 306 364 * In the case we're getting here during resume, it's similar to 307 365 * firmware restart, and with RESUME_ALL the iterator will find ··· 354 416 * the ones here - no real limit 355 417 */ 356 418 queue_limit = IEEE80211_MAX_QUEUES; 357 - BUILD_BUG_ON(IEEE80211_MAX_QUEUES > 358 - BITS_PER_BYTE * 359 - sizeof(mvm->hw_queue_to_mac80211[0])); 360 419 361 420 /* 362 421 * Find available queues, and allocate them to the ACs. When in ··· 381 446 * queue value (when queue is enabled). 382 447 */ 383 448 mvmvif->cab_queue = IWL_MVM_DQA_GCAST_QUEUE; 384 - vif->cab_queue = IWL_MVM_DQA_GCAST_QUEUE; 385 - } else { 386 - vif->cab_queue = IEEE80211_INVAL_HW_QUEUE; 387 449 } 388 450 389 451 mvmvif->bcast_sta.sta_id = IWL_MVM_INVALID_STA; ··· 394 462 395 463 exit_fail: 396 464 memset(mvmvif, 0, sizeof(struct iwl_mvm_vif)); 397 - memset(vif->hw_queue, IEEE80211_INVAL_HW_QUEUE, sizeof(vif->hw_queue)); 398 - vif->cab_queue = IEEE80211_INVAL_HW_QUEUE; 399 465 return ret; 400 466 } 401 467 ··· 708 778 709 779 if (vif->bss_conf.assoc && vif->bss_conf.he_support && 710 780 !iwlwifi_mod_params.disable_11ax) { 711 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 712 - u8 sta_id = mvmvif->ap_sta_id; 713 - 714 781 cmd.filter_flags |= cpu_to_le32(MAC_FILTER_IN_11AX); 715 - if (sta_id != IWL_MVM_INVALID_STA) { 716 - struct ieee80211_sta *sta; 717 - 718 - sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], 719 - lockdep_is_held(&mvm->mutex)); 720 - 721 - /* 722 - * TODO: we should check the ext cap IE but it is 723 - * unclear why the spec requires two bits (one in HE 724 - * cap IE, and one in the ext cap IE). In the meantime 725 - * rely on the HE cap IE only. 726 - */ 727 - if (sta && (sta->he_cap.he_cap_elem.mac_cap_info[0] & 728 - IEEE80211_HE_MAC_CAP0_TWT_RES)) 729 - ctxt_sta->data_policy |= 730 - cpu_to_le32(TWT_SUPPORTED); 731 - } 782 + if (vif->bss_conf.twt_requester) 783 + ctxt_sta->data_policy |= cpu_to_le32(TWT_SUPPORTED); 732 784 } 733 785 734 786 ··· 792 880 WARN_ON(vif->type != NL80211_IFTYPE_P2P_DEVICE); 793 881 794 882 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, NULL, action); 795 - 796 - cmd.protection_flags |= cpu_to_le32(MAC_PROT_FLG_TGG_PROTECT); 797 883 798 884 /* Override the filter flags to accept only probe requests */ 799 885 cmd.filter_flags = cpu_to_le32(MAC_FILTER_IN_PROBE_REQUEST); ··· 1113 1203 1114 1204 if (!fw_has_api(&mvm->fw->ucode_capa, 1115 1205 IWL_UCODE_TLV_API_STA_TYPE)) 1116 - ctxt_ap->mcast_qid = cpu_to_le32(vif->cab_queue); 1206 + ctxt_ap->mcast_qid = cpu_to_le32(mvmvif->cab_queue); 1117 1207 1118 1208 /* 1119 1209 * Only set the beacon time when the MAC is being added, when we ··· 1345 1435 agg_status = iwl_mvm_get_agg_status(mvm, beacon_notify_hdr); 1346 1436 status = le16_to_cpu(agg_status->status) & TX_STATUS_MSK; 1347 1437 IWL_DEBUG_RX(mvm, 1348 - "beacon status %#x retries:%d tsf:0x%16llX gp2:0x%X rate:%d\n", 1438 + "beacon status %#x retries:%d tsf:0x%016llX gp2:0x%X rate:%d\n", 1349 1439 status, beacon_notify_hdr->failure_frame, 1350 1440 le64_to_cpu(beacon->tsf), 1351 1441 mvm->ap_last_beacon_gp2, ··· 1382 1472 } 1383 1473 } 1384 1474 1385 - static void iwl_mvm_beacon_loss_iterator(void *_data, u8 *mac, 1386 - struct ieee80211_vif *vif) 1475 + void iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm, 1476 + struct iwl_rx_cmd_buffer *rxb) 1387 1477 { 1388 - struct iwl_missed_beacons_notif *missed_beacons = _data; 1389 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 1390 - struct iwl_mvm *mvm = mvmvif->mvm; 1478 + struct iwl_rx_packet *pkt = rxb_addr(rxb); 1479 + struct iwl_missed_beacons_notif *mb = (void *)pkt->data; 1391 1480 struct iwl_fw_dbg_trigger_missed_bcon *bcon_trig; 1392 1481 struct iwl_fw_dbg_trigger_tlv *trigger; 1393 1482 u32 stop_trig_missed_bcon, stop_trig_missed_bcon_since_rx; 1394 1483 u32 rx_missed_bcon, rx_missed_bcon_since_rx; 1484 + struct ieee80211_vif *vif; 1485 + u32 id = le32_to_cpu(mb->mac_id); 1395 1486 1396 - if (mvmvif->id != (u16)le32_to_cpu(missed_beacons->mac_id)) 1397 - return; 1487 + IWL_DEBUG_INFO(mvm, 1488 + "missed bcn mac_id=%u, consecutive=%u (%u, %u, %u)\n", 1489 + le32_to_cpu(mb->mac_id), 1490 + le32_to_cpu(mb->consec_missed_beacons), 1491 + le32_to_cpu(mb->consec_missed_beacons_since_last_rx), 1492 + le32_to_cpu(mb->num_recvd_beacons), 1493 + le32_to_cpu(mb->num_expected_beacons)); 1398 1494 1399 - rx_missed_bcon = le32_to_cpu(missed_beacons->consec_missed_beacons); 1495 + rcu_read_lock(); 1496 + 1497 + vif = iwl_mvm_rcu_dereference_vif_id(mvm, id, true); 1498 + if (!vif) 1499 + goto out; 1500 + 1501 + rx_missed_bcon = le32_to_cpu(mb->consec_missed_beacons); 1400 1502 rx_missed_bcon_since_rx = 1401 - le32_to_cpu(missed_beacons->consec_missed_beacons_since_last_rx); 1503 + le32_to_cpu(mb->consec_missed_beacons_since_last_rx); 1402 1504 /* 1403 1505 * TODO: the threshold should be adjusted based on latency conditions, 1404 1506 * and/or in case of a CS flow on one of the other AP vifs. 1405 1507 */ 1406 - if (le32_to_cpu(missed_beacons->consec_missed_beacons_since_last_rx) > 1407 - IWL_MVM_MISSED_BEACONS_THRESHOLD) 1508 + if (rx_missed_bcon > IWL_MVM_MISSED_BEACONS_THRESHOLD_LONG) 1509 + iwl_mvm_connection_loss(mvm, vif, "missed beacons"); 1510 + else if (rx_missed_bcon_since_rx > IWL_MVM_MISSED_BEACONS_THRESHOLD) 1408 1511 ieee80211_beacon_loss(vif); 1409 1512 1410 1513 trigger = iwl_fw_dbg_trigger_on(&mvm->fwrt, ieee80211_vif_to_wdev(vif), 1411 1514 FW_DBG_TRIGGER_MISSED_BEACONS); 1412 1515 if (!trigger) 1413 - return; 1516 + goto out; 1414 1517 1415 1518 bcon_trig = (void *)trigger->data; 1416 1519 stop_trig_missed_bcon = le32_to_cpu(bcon_trig->stop_consec_missed_bcon); ··· 1435 1512 if (rx_missed_bcon_since_rx >= stop_trig_missed_bcon_since_rx || 1436 1513 rx_missed_bcon >= stop_trig_missed_bcon) 1437 1514 iwl_fw_dbg_collect_trig(&mvm->fwrt, trigger, NULL); 1438 - } 1439 - 1440 - void iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm, 1441 - struct iwl_rx_cmd_buffer *rxb) 1442 - { 1443 - struct iwl_rx_packet *pkt = rxb_addr(rxb); 1444 - struct iwl_missed_beacons_notif *mb = (void *)pkt->data; 1445 - 1446 - IWL_DEBUG_INFO(mvm, 1447 - "missed bcn mac_id=%u, consecutive=%u (%u, %u, %u)\n", 1448 - le32_to_cpu(mb->mac_id), 1449 - le32_to_cpu(mb->consec_missed_beacons), 1450 - le32_to_cpu(mb->consec_missed_beacons_since_last_rx), 1451 - le32_to_cpu(mb->num_recvd_beacons), 1452 - le32_to_cpu(mb->num_expected_beacons)); 1453 - 1454 - ieee80211_iterate_active_interfaces_atomic(mvm->hw, 1455 - IEEE80211_IFACE_ITER_NORMAL, 1456 - iwl_mvm_beacon_loss_iterator, 1457 - mb); 1458 1515 1459 1516 iwl_fw_dbg_apply_point(&mvm->fwrt, IWL_FW_INI_APPLY_MISSED_BEACONS); 1517 + 1518 + out: 1519 + rcu_read_unlock(); 1460 1520 } 1461 1521 1462 1522 void iwl_mvm_rx_stored_beacon_notif(struct iwl_mvm *mvm, ··· 1481 1575 ieee80211_rx_napi(mvm->hw, NULL, skb, NULL); 1482 1576 } 1483 1577 1484 - static void iwl_mvm_probe_resp_data_iter(void *_data, u8 *mac, 1485 - struct ieee80211_vif *vif) 1578 + void iwl_mvm_probe_resp_data_notif(struct iwl_mvm *mvm, 1579 + struct iwl_rx_cmd_buffer *rxb) 1486 1580 { 1487 - struct iwl_probe_resp_data_notif *notif = _data; 1488 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 1581 + struct iwl_rx_packet *pkt = rxb_addr(rxb); 1582 + struct iwl_probe_resp_data_notif *notif = (void *)pkt->data; 1489 1583 struct iwl_probe_resp_data *old_data, *new_data; 1584 + int len = iwl_rx_packet_payload_len(pkt); 1585 + u32 id = le32_to_cpu(notif->mac_id); 1586 + struct ieee80211_vif *vif; 1587 + struct iwl_mvm_vif *mvmvif; 1490 1588 1491 - if (mvmvif->id != (u16)le32_to_cpu(notif->mac_id)) 1589 + if (WARN_ON_ONCE(len < sizeof(*notif))) 1492 1590 return; 1591 + 1592 + IWL_DEBUG_INFO(mvm, "Probe response data notif: noa %d, csa %d\n", 1593 + notif->noa_active, notif->csa_counter); 1594 + 1595 + vif = iwl_mvm_rcu_dereference_vif_id(mvm, id, false); 1596 + if (!vif) 1597 + return; 1598 + 1599 + mvmvif = iwl_mvm_vif_from_mac80211(vif); 1493 1600 1494 1601 new_data = kzalloc(sizeof(*new_data), GFP_KERNEL); 1495 1602 if (!new_data) ··· 1532 1613 if (notif->csa_counter != IWL_PROBE_RESP_DATA_NO_CSA && 1533 1614 notif->csa_counter >= 1) 1534 1615 ieee80211_csa_set_counter(vif, notif->csa_counter); 1535 - } 1536 - 1537 - void iwl_mvm_probe_resp_data_notif(struct iwl_mvm *mvm, 1538 - struct iwl_rx_cmd_buffer *rxb) 1539 - { 1540 - struct iwl_rx_packet *pkt = rxb_addr(rxb); 1541 - struct iwl_probe_resp_data_notif *notif = (void *)pkt->data; 1542 - int len = iwl_rx_packet_payload_len(pkt); 1543 - 1544 - if (WARN_ON_ONCE(len < sizeof(*notif))) 1545 - return; 1546 - 1547 - IWL_DEBUG_INFO(mvm, "Probe response data notif: noa %d, csa %d\n", 1548 - notif->noa_active, notif->csa_counter); 1549 - 1550 - ieee80211_iterate_active_interfaces(mvm->hw, 1551 - IEEE80211_IFACE_ITER_ACTIVE, 1552 - iwl_mvm_probe_resp_data_iter, 1553 - notif); 1554 1616 } 1555 1617 1556 1618 void iwl_mvm_channel_switch_noa_notif(struct iwl_mvm *mvm,
+190 -59
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
··· 395 395 return ret; 396 396 } 397 397 398 + const static u8 he_if_types_ext_capa_sta[] = { 399 + [0] = WLAN_EXT_CAPA1_EXT_CHANNEL_SWITCHING, 400 + [7] = WLAN_EXT_CAPA8_OPMODE_NOTIF, 401 + [9] = WLAN_EXT_CAPA10_TWT_REQUESTER_SUPPORT, 402 + }; 403 + 404 + const static struct wiphy_iftype_ext_capab he_iftypes_ext_capa[] = { 405 + { 406 + .iftype = NL80211_IFTYPE_STATION, 407 + .extended_capabilities = he_if_types_ext_capa_sta, 408 + .extended_capabilities_mask = he_if_types_ext_capa_sta, 409 + .extended_capabilities_len = sizeof(he_if_types_ext_capa_sta), 410 + }, 411 + }; 412 + 398 413 int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) 399 414 { 400 415 struct ieee80211_hw *hw = mvm->hw; ··· 425 410 ieee80211_hw_set(hw, SIGNAL_DBM); 426 411 ieee80211_hw_set(hw, SPECTRUM_MGMT); 427 412 ieee80211_hw_set(hw, REPORTS_TX_ACK_STATUS); 428 - ieee80211_hw_set(hw, QUEUE_CONTROL); 429 413 ieee80211_hw_set(hw, WANT_MONITOR_VIF); 430 414 ieee80211_hw_set(hw, SUPPORTS_PS); 431 415 ieee80211_hw_set(hw, SUPPORTS_DYNAMIC_PS); ··· 438 424 ieee80211_hw_set(hw, NEEDS_UNIQUE_STA_ADDR); 439 425 ieee80211_hw_set(hw, DEAUTH_NEED_MGD_TX_PREP); 440 426 ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW); 427 + ieee80211_hw_set(hw, BUFF_MMPDU_TXQ); 428 + ieee80211_hw_set(hw, STA_MMPDU_TXQ); 429 + ieee80211_hw_set(hw, TX_AMSDU); 430 + ieee80211_hw_set(hw, TX_FRAG_LIST); 441 431 442 432 if (iwl_mvm_has_tlc_offload(mvm)) { 443 433 ieee80211_hw_set(hw, TX_AMPDU_SETUP_IN_HW); ··· 487 469 488 470 hw->uapsd_queues = IWL_MVM_UAPSD_QUEUES; 489 471 hw->uapsd_max_sp_len = IWL_UAPSD_MAX_SP; 472 + hw->max_tx_fragments = mvm->trans->max_skb_frags; 490 473 491 474 BUILD_BUG_ON(ARRAY_SIZE(mvm->ciphers) < ARRAY_SIZE(mvm_ciphers) + 6); 492 475 memcpy(mvm->ciphers, mvm_ciphers, sizeof(mvm_ciphers)); ··· 553 534 hw->sta_data_size = sizeof(struct iwl_mvm_sta); 554 535 hw->vif_data_size = sizeof(struct iwl_mvm_vif); 555 536 hw->chanctx_data_size = sizeof(u16); 537 + hw->txq_data_size = sizeof(struct iwl_mvm_txq); 556 538 557 539 hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | 558 540 BIT(NL80211_IFTYPE_P2P_CLIENT) | ··· 693 673 NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE); 694 674 } 695 675 676 + if (mvm->nvm_data->sku_cap_11ax_enable && 677 + !iwlwifi_mod_params.disable_11ax) { 678 + hw->wiphy->iftype_ext_capab = he_iftypes_ext_capa; 679 + hw->wiphy->num_iftype_ext_capab = 680 + ARRAY_SIZE(he_iftypes_ext_capa); 681 + } 682 + 696 683 mvm->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD; 697 684 698 685 #ifdef CONFIG_PM_SLEEP ··· 803 776 goto out; 804 777 805 778 __skb_queue_tail(&mvm->d0i3_tx, skb); 806 - ieee80211_stop_queues(mvm->hw); 807 779 808 780 /* trigger wakeup */ 809 781 iwl_mvm_ref(mvm, IWL_MVM_REF_TX); ··· 822 796 struct ieee80211_sta *sta = control->sta; 823 797 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 824 798 struct ieee80211_hdr *hdr = (void *)skb->data; 799 + bool offchannel = IEEE80211_SKB_CB(skb)->flags & 800 + IEEE80211_TX_CTL_TX_OFFCHAN; 825 801 826 802 if (iwl_mvm_is_radio_killed(mvm)) { 827 803 IWL_DEBUG_DROP(mvm, "Dropping - RF/CT KILL\n"); 828 804 goto drop; 829 805 } 830 806 831 - if (info->hw_queue == IWL_MVM_OFFCHANNEL_QUEUE && 807 + if (offchannel && 832 808 !test_bit(IWL_MVM_STATUS_ROC_RUNNING, &mvm->status) && 833 809 !test_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status)) 834 810 goto drop; ··· 843 815 sta = NULL; 844 816 845 817 /* If there is no sta, and it's not offchannel - send through AP */ 846 - if (info->control.vif->type == NL80211_IFTYPE_STATION && 847 - info->hw_queue != IWL_MVM_OFFCHANNEL_QUEUE && !sta) { 818 + if (!sta && info->control.vif->type == NL80211_IFTYPE_STATION && 819 + !offchannel) { 848 820 struct iwl_mvm_vif *mvmvif = 849 821 iwl_mvm_vif_from_mac80211(info->control.vif); 850 822 u8 ap_sta_id = READ_ONCE(mvmvif->ap_sta_id); ··· 872 844 ieee80211_free_txskb(hw, skb); 873 845 } 874 846 875 - static inline bool iwl_enable_rx_ampdu(const struct iwl_cfg *cfg) 847 + void iwl_mvm_mac_itxq_xmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq) 876 848 { 877 - if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_RXAGG) 878 - return false; 879 - return true; 849 + struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); 850 + struct iwl_mvm_txq *mvmtxq = iwl_mvm_txq_from_mac80211(txq); 851 + struct sk_buff *skb = NULL; 852 + 853 + /* 854 + * No need for threads to be pending here, they can leave the first 855 + * taker all the work. 856 + * 857 + * mvmtxq->tx_request logic: 858 + * 859 + * If 0, no one is currently TXing, set to 1 to indicate current thread 860 + * will now start TX and other threads should quit. 861 + * 862 + * If 1, another thread is currently TXing, set to 2 to indicate to 863 + * that thread that there was another request. Since that request may 864 + * have raced with the check whether the queue is empty, the TXing 865 + * thread should check the queue's status one more time before leaving. 866 + * This check is done in order to not leave any TX hanging in the queue 867 + * until the next TX invocation (which may not even happen). 868 + * 869 + * If 2, another thread is currently TXing, and it will already double 870 + * check the queue, so do nothing. 871 + */ 872 + if (atomic_fetch_add_unless(&mvmtxq->tx_request, 1, 2)) 873 + return; 874 + 875 + rcu_read_lock(); 876 + do { 877 + while (likely(!mvmtxq->stopped && 878 + (mvm->trans->system_pm_mode == 879 + IWL_PLAT_PM_MODE_DISABLED))) { 880 + skb = ieee80211_tx_dequeue(hw, txq); 881 + 882 + if (!skb) 883 + break; 884 + 885 + if (!txq->sta) 886 + iwl_mvm_tx_skb_non_sta(mvm, skb); 887 + else 888 + iwl_mvm_tx_skb(mvm, skb, txq->sta); 889 + } 890 + } while (atomic_dec_return(&mvmtxq->tx_request)); 891 + rcu_read_unlock(); 880 892 } 881 893 882 - static inline bool iwl_enable_tx_ampdu(const struct iwl_cfg *cfg) 894 + static void iwl_mvm_mac_wake_tx_queue(struct ieee80211_hw *hw, 895 + struct ieee80211_txq *txq) 883 896 { 884 - if (iwlwifi_mod_params.disable_11n & IWL_DISABLE_HT_TXAGG) 885 - return false; 886 - if (iwlwifi_mod_params.disable_11n & IWL_ENABLE_HT_TXAGG) 887 - return true; 897 + struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); 898 + struct iwl_mvm_txq *mvmtxq = iwl_mvm_txq_from_mac80211(txq); 888 899 889 - /* enabled by default */ 890 - return true; 900 + /* 901 + * Please note that racing is handled very carefully here: 902 + * mvmtxq->txq_id is updated during allocation, and mvmtxq->list is 903 + * deleted afterwards. 904 + * This means that if: 905 + * mvmtxq->txq_id != INVALID_QUEUE && list_empty(&mvmtxq->list): 906 + * queue is allocated and we can TX. 907 + * mvmtxq->txq_id != INVALID_QUEUE && !list_empty(&mvmtxq->list): 908 + * a race, should defer the frame. 909 + * mvmtxq->txq_id == INVALID_QUEUE && list_empty(&mvmtxq->list): 910 + * need to allocate the queue and defer the frame. 911 + * mvmtxq->txq_id == INVALID_QUEUE && !list_empty(&mvmtxq->list): 912 + * queue is already scheduled for allocation, no need to allocate, 913 + * should defer the frame. 914 + */ 915 + 916 + /* If the queue is allocated TX and return. */ 917 + if (!txq->sta || mvmtxq->txq_id != IWL_MVM_INVALID_QUEUE) { 918 + /* 919 + * Check that list is empty to avoid a race where txq_id is 920 + * already updated, but the queue allocation work wasn't 921 + * finished 922 + */ 923 + if (unlikely(txq->sta && !list_empty(&mvmtxq->list))) 924 + return; 925 + 926 + iwl_mvm_mac_itxq_xmit(hw, txq); 927 + return; 928 + } 929 + 930 + /* The list is being deleted only after the queue is fully allocated. */ 931 + if (!list_empty(&mvmtxq->list)) 932 + return; 933 + 934 + list_add_tail(&mvmtxq->list, &mvm->add_stream_txqs); 935 + schedule_work(&mvm->add_stream_wk); 891 936 } 892 937 893 938 #define CHECK_BA_TRIGGER(_mvm, _trig, _tid_bm, _tid, _fmt...) \ ··· 1075 974 mvmvif = iwl_mvm_vif_from_mac80211(vif); 1076 975 cancel_delayed_work(&mvmvif->uapsd_nonagg_detected_wk); 1077 976 } 1078 - if (!iwl_enable_rx_ampdu(mvm->cfg)) { 977 + if (!iwl_enable_rx_ampdu()) { 1079 978 ret = -EINVAL; 1080 979 break; 1081 980 } ··· 1087 986 timeout); 1088 987 break; 1089 988 case IEEE80211_AMPDU_TX_START: 1090 - if (!iwl_enable_tx_ampdu(mvm->cfg)) { 989 + if (!iwl_enable_tx_ampdu()) { 1091 990 ret = -EINVAL; 1092 991 break; 1093 992 } ··· 1167 1066 1168 1067 iwl_mvm_stop_device(mvm); 1169 1068 1069 + mvm->cur_aid = 0; 1070 + 1170 1071 mvm->scan_status = 0; 1171 1072 mvm->ps_disabled = false; 1172 1073 mvm->calibrating = false; ··· 1188 1085 1189 1086 iwl_mvm_reset_phy_ctxts(mvm); 1190 1087 memset(mvm->fw_key_table, 0, sizeof(mvm->fw_key_table)); 1191 - memset(mvm->sta_deferred_frames, 0, sizeof(mvm->sta_deferred_frames)); 1192 1088 memset(&mvm->last_bt_notif, 0, sizeof(mvm->last_bt_notif)); 1193 1089 memset(&mvm->last_bt_ci_cmd, 0, sizeof(mvm->last_bt_ci_cmd)); 1194 1090 ··· 1493 1391 if (ret) 1494 1392 goto out_unlock; 1495 1393 1394 + rcu_assign_pointer(mvm->vif_id_to_mac[mvmvif->id], vif); 1395 + 1496 1396 /* Counting number of interfaces is needed for legacy PM */ 1497 1397 if (vif->type != NL80211_IFTYPE_P2P_DEVICE) 1498 1398 mvm->vif_count++; ··· 1685 1581 1686 1582 iwl_mvm_power_update_mac(mvm); 1687 1583 iwl_mvm_mac_ctxt_remove(mvm, vif); 1584 + 1585 + RCU_INIT_POINTER(mvm->vif_id_to_mac[mvmvif->id], NULL); 1688 1586 1689 1587 if (vif->type == NL80211_IFTYPE_MONITOR) 1690 1588 mvm->monitor_on = false; ··· 2252 2146 iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif); 2253 2147 } 2254 2148 2149 + /* Update MU EDCA params */ 2150 + if (changes & BSS_CHANGED_QOS && mvmvif->associated && 2151 + bss_conf->assoc && vif->bss_conf.he_support && 2152 + !iwlwifi_mod_params.disable_11ax) 2153 + iwl_mvm_cfg_he_sta(mvm, vif, mvmvif->ap_sta_id); 2154 + 2255 2155 /* 2256 2156 * If we're not associated yet, take the (new) BSSID before associating 2257 2157 * so the firmware knows. If we're already associated, then use the old ··· 2784 2672 return; 2785 2673 2786 2674 spin_lock_bh(&mvmsta->lock); 2787 - for (tid = 0; tid < IWL_MAX_TID_COUNT; tid++) { 2675 + for (tid = 0; tid < ARRAY_SIZE(mvmsta->tid_data); tid++) { 2788 2676 struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid]; 2789 2677 2790 2678 if (tid_data->txq_id == IWL_MVM_INVALID_QUEUE) ··· 2973 2861 peer_addr, action); 2974 2862 } 2975 2863 2976 - static void iwl_mvm_purge_deferred_tx_frames(struct iwl_mvm *mvm, 2977 - struct iwl_mvm_sta *mvm_sta) 2978 - { 2979 - struct iwl_mvm_tid_data *tid_data; 2980 - struct sk_buff *skb; 2981 - int i; 2982 - 2983 - spin_lock_bh(&mvm_sta->lock); 2984 - for (i = 0; i <= IWL_MAX_TID_COUNT; i++) { 2985 - tid_data = &mvm_sta->tid_data[i]; 2986 - 2987 - while ((skb = __skb_dequeue(&tid_data->deferred_tx_frames))) { 2988 - struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 2989 - 2990 - /* 2991 - * The first deferred frame should've stopped the MAC 2992 - * queues, so we should never get a second deferred 2993 - * frame for the RA/TID. 2994 - */ 2995 - iwl_mvm_start_mac_queues(mvm, BIT(info->hw_queue)); 2996 - ieee80211_free_txskb(mvm->hw, skb); 2997 - } 2998 - } 2999 - spin_unlock_bh(&mvm_sta->lock); 3000 - } 3001 - 3002 2864 static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw, 3003 2865 struct ieee80211_vif *vif, 3004 2866 struct ieee80211_sta *sta, ··· 3006 2920 */ 3007 2921 if (old_state == IEEE80211_STA_NONE && 3008 2922 new_state == IEEE80211_STA_NOTEXIST) { 3009 - iwl_mvm_purge_deferred_tx_frames(mvm, mvm_sta); 3010 2923 flush_work(&mvm->add_stream_wk); 3011 2924 3012 2925 /* ··· 3052 2967 iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr, 3053 2968 NL80211_TDLS_SETUP); 3054 2969 } 2970 + 2971 + sta->max_rc_amsdu_len = 1; 3055 2972 } else if (old_state == IEEE80211_STA_NONE && 3056 2973 new_state == IEEE80211_STA_AUTH) { 3057 2974 /* ··· 3123 3036 iwl_mvm_tdls_check_trigger(mvm, vif, sta->addr, 3124 3037 NL80211_TDLS_DISABLE_LINK); 3125 3038 } 3039 + 3040 + /* Remove STA key if this is an AP using WEP */ 3041 + if (vif->type == NL80211_IFTYPE_AP && mvmvif->ap_wep_key) { 3042 + int rm_ret = iwl_mvm_remove_sta_key(mvm, vif, sta, 3043 + mvmvif->ap_wep_key); 3044 + 3045 + if (!ret) 3046 + ret = rm_ret; 3047 + } 3048 + 3126 3049 } else { 3127 3050 ret = -EIO; 3128 3051 } ··· 3528 3431 .id_and_color = 3529 3432 cpu_to_le32(FW_CMD_ID_AND_COLOR(MAC_INDEX_AUX, 0)), 3530 3433 .sta_id_and_color = cpu_to_le32(mvm->aux_sta.sta_id), 3531 - /* Set the channel info data */ 3532 - .channel_info.band = (channel->band == NL80211_BAND_2GHZ) ? 3533 - PHY_BAND_24 : PHY_BAND_5, 3534 - .channel_info.channel = channel->hw_value, 3535 - .channel_info.width = PHY_VHT_CHANNEL_MODE20, 3536 - /* Set the time and duration */ 3537 - .apply_time = cpu_to_le32(iwl_read_prph(mvm->trans, time_reg)), 3538 - }; 3434 + }; 3435 + struct iwl_hs20_roc_req_tail *tail = iwl_mvm_chan_info_cmd_tail(mvm, 3436 + &aux_roc_req.channel_info); 3437 + u16 len = sizeof(aux_roc_req) - iwl_mvm_chan_info_padding(mvm); 3438 + 3439 + /* Set the channel info data */ 3440 + iwl_mvm_set_chan_info(mvm, &aux_roc_req.channel_info, channel->hw_value, 3441 + (channel->band == NL80211_BAND_2GHZ) ? 3442 + PHY_BAND_24 : PHY_BAND_5, 3443 + PHY_VHT_CHANNEL_MODE20, 3444 + 0); 3445 + 3446 + /* Set the time and duration */ 3447 + tail->apply_time = cpu_to_le32(iwl_read_prph(mvm->trans, time_reg)); 3539 3448 3540 3449 delay = AUX_ROC_MIN_DELAY; 3541 3450 req_dur = MSEC_TO_TU(duration); ··· 3566 3463 } 3567 3464 } 3568 3465 3569 - aux_roc_req.duration = cpu_to_le32(req_dur); 3570 - aux_roc_req.apply_time_max_delay = cpu_to_le32(delay); 3466 + tail->duration = cpu_to_le32(req_dur); 3467 + tail->apply_time_max_delay = cpu_to_le32(delay); 3571 3468 3572 3469 IWL_DEBUG_TE(mvm, 3573 3470 "ROC: Requesting to remain on channel %u for %ums (requested = %ums, max_delay = %ums, dtim_interval = %ums)\n", 3574 3471 channel->hw_value, req_dur, duration, delay, 3575 3472 dtim_interval); 3576 3473 /* Set the node address */ 3577 - memcpy(aux_roc_req.node_addr, vif->addr, ETH_ALEN); 3474 + memcpy(tail->node_addr, vif->addr, ETH_ALEN); 3578 3475 3579 3476 lockdep_assert_held(&mvm->mutex); 3580 3477 ··· 3605 3502 ARRAY_SIZE(time_event_response), 3606 3503 iwl_mvm_rx_aux_roc, te_data); 3607 3504 3608 - res = iwl_mvm_send_cmd_pdu(mvm, HOT_SPOT_CMD, 0, sizeof(aux_roc_req), 3505 + res = iwl_mvm_send_cmd_pdu(mvm, HOT_SPOT_CMD, 0, len, 3609 3506 &aux_roc_req); 3610 3507 3611 3508 if (res) { ··· 4759 4656 mutex_unlock(&mvm->mutex); 4760 4657 } 4761 4658 4659 + static bool iwl_mvm_can_hw_csum(struct sk_buff *skb) 4660 + { 4661 + u8 protocol = ip_hdr(skb)->protocol; 4662 + 4663 + if (!IS_ENABLED(CONFIG_INET)) 4664 + return false; 4665 + 4666 + return protocol == IPPROTO_TCP || protocol == IPPROTO_UDP; 4667 + } 4668 + 4669 + static bool iwl_mvm_mac_can_aggregate(struct ieee80211_hw *hw, 4670 + struct sk_buff *head, 4671 + struct sk_buff *skb) 4672 + { 4673 + struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); 4674 + 4675 + /* For now don't aggregate IPv6 in AMSDU */ 4676 + if (skb->protocol != htons(ETH_P_IP)) 4677 + return false; 4678 + 4679 + if (!iwl_mvm_is_csum_supported(mvm)) 4680 + return true; 4681 + 4682 + return iwl_mvm_can_hw_csum(skb) == iwl_mvm_can_hw_csum(head); 4683 + } 4684 + 4762 4685 const struct ieee80211_ops iwl_mvm_hw_ops = { 4763 4686 .tx = iwl_mvm_mac_tx, 4687 + .wake_tx_queue = iwl_mvm_mac_wake_tx_queue, 4764 4688 .ampdu_action = iwl_mvm_mac_ampdu_action, 4765 4689 .start = iwl_mvm_mac_start, 4766 4690 .reconfig_complete = iwl_mvm_mac_reconfig_complete, ··· 4861 4731 #endif 4862 4732 .get_survey = iwl_mvm_mac_get_survey, 4863 4733 .sta_statistics = iwl_mvm_mac_sta_statistics, 4734 + .can_aggregate_in_amsdu = iwl_mvm_mac_can_aggregate, 4864 4735 #ifdef CONFIG_IWLWIFI_DEBUGFS 4865 4736 .sta_add_debugfs = iwl_mvm_sta_add_debugfs, 4866 4737 #endif
+183 -20
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
··· 83 83 #include "sta.h" 84 84 #include "fw-api.h" 85 85 #include "constants.h" 86 - #include "tof.h" 87 86 #include "fw/runtime.h" 88 87 #include "fw/dbg.h" 89 88 #include "fw/acpi.h" ··· 94 95 /* RSSI offset for WkP */ 95 96 #define IWL_RSSI_OFFSET 50 96 97 #define IWL_MVM_MISSED_BEACONS_THRESHOLD 8 98 + #define IWL_MVM_MISSED_BEACONS_THRESHOLD_LONG 16 99 + 97 100 /* A TimeUnit is 1024 microsecond */ 98 101 #define MSEC_TO_TU(_msec) (_msec*1000/1024) 99 102 ··· 300 299 }; 301 300 302 301 /** 302 + * struct iwl_mvm_low_latency_force - low latency force mode set by debugfs 303 + * @LOW_LATENCY_FORCE_UNSET: unset force mode 304 + * @LOW_LATENCY_FORCE_ON: for low latency on 305 + * @LOW_LATENCY_FORCE_OFF: for low latency off 306 + * @NUM_LOW_LATENCY_FORCE: max num of modes 307 + */ 308 + enum iwl_mvm_low_latency_force { 309 + LOW_LATENCY_FORCE_UNSET, 310 + LOW_LATENCY_FORCE_ON, 311 + LOW_LATENCY_FORCE_OFF, 312 + NUM_LOW_LATENCY_FORCE 313 + }; 314 + 315 + /** 303 316 * struct iwl_mvm_low_latency_cause - low latency set causes 304 317 * @LOW_LATENCY_TRAFFIC: indicates low latency traffic was detected 305 318 * @LOW_LATENCY_DEBUGFS: low latency mode set from debugfs 306 319 * @LOW_LATENCY_VCMD: low latency mode set from vendor command 307 320 * @LOW_LATENCY_VIF_TYPE: low latency mode set because of vif type (ap) 321 + * @LOW_LATENCY_DEBUGFS_FORCE_ENABLE: indicate that force mode is enabled 322 + * the actual set/unset is done with LOW_LATENCY_DEBUGFS_FORCE 323 + * @LOW_LATENCY_DEBUGFS_FORCE: low latency force mode from debugfs 324 + * set this with LOW_LATENCY_DEBUGFS_FORCE_ENABLE flag 325 + * in low_latency. 308 326 */ 309 327 enum iwl_mvm_low_latency_cause { 310 328 LOW_LATENCY_TRAFFIC = BIT(0), 311 329 LOW_LATENCY_DEBUGFS = BIT(1), 312 330 LOW_LATENCY_VCMD = BIT(2), 313 331 LOW_LATENCY_VIF_TYPE = BIT(3), 332 + LOW_LATENCY_DEBUGFS_FORCE_ENABLE = BIT(4), 333 + LOW_LATENCY_DEBUGFS_FORCE = BIT(5), 314 334 }; 315 335 316 336 /** ··· 382 360 * @pm_enabled - Indicate if MAC power management is allowed 383 361 * @monitor_active: indicates that monitor context is configured, and that the 384 362 * interface should get quota etc. 385 - * @low_latency: indicates low latency is set, see 386 - * enum &iwl_mvm_low_latency_cause for causes. 363 + * @low_latency: bit flags for low latency 364 + * see enum &iwl_mvm_low_latency_cause for causes. 365 + * @low_latency_actual: boolean, indicates low latency is set, 366 + * as a result from low_latency bit flags and takes force into account. 387 367 * @ps_disabled: indicates that this interface requires PS to be disabled 388 368 * @queue_params: QoS params for this MAC 389 369 * @bcast_sta: station used for broadcast packets. Used by the following ··· 417 393 bool ap_ibss_active; 418 394 bool pm_enabled; 419 395 bool monitor_active; 420 - u8 low_latency; 396 + u8 low_latency: 6; 397 + u8 low_latency_actual: 1; 421 398 bool ps_disabled; 422 399 struct iwl_mvm_vif_bf_data bf_data; 423 400 ··· 803 778 u8 values[ACPI_GEO_TABLE_SIZE]; 804 779 }; 805 780 781 + struct iwl_mvm_txq { 782 + struct list_head list; 783 + u16 txq_id; 784 + atomic_t tx_request; 785 + bool stopped; 786 + }; 787 + 788 + static inline struct iwl_mvm_txq * 789 + iwl_mvm_txq_from_mac80211(struct ieee80211_txq *txq) 790 + { 791 + return (void *)txq->drv_priv; 792 + } 793 + 794 + static inline struct iwl_mvm_txq * 795 + iwl_mvm_txq_from_tid(struct ieee80211_sta *sta, u8 tid) 796 + { 797 + if (tid == IWL_MAX_TID_COUNT) 798 + tid = IEEE80211_NUM_TIDS; 799 + 800 + return (void *)sta->txq[tid]->drv_priv; 801 + } 802 + 803 + /** 804 + * struct iwl_mvm_tvqm_txq_info - maps TVQM hw queue to tid 805 + * 806 + * @sta_id: sta id 807 + * @txq_tid: txq tid 808 + */ 809 + struct iwl_mvm_tvqm_txq_info { 810 + u8 sta_id; 811 + u8 txq_tid; 812 + }; 813 + 806 814 struct iwl_mvm_dqa_txq_info { 807 815 u8 ra_sta_id; /* The RA this queue is mapped to, if exists */ 808 816 bool reserved; /* Is this the TXQ reserved for a STA */ ··· 901 843 u64 on_time_scan; 902 844 } radio_stats, accu_radio_stats; 903 845 904 - u16 hw_queue_to_mac80211[IWL_MAX_TVQM_QUEUES]; 905 - 906 - struct iwl_mvm_dqa_txq_info queue_info[IWL_MAX_HW_QUEUES]; 846 + struct list_head add_stream_txqs; 847 + union { 848 + struct iwl_mvm_dqa_txq_info queue_info[IWL_MAX_HW_QUEUES]; 849 + struct iwl_mvm_tvqm_txq_info tvqm_info[IWL_MAX_TVQM_QUEUES]; 850 + }; 907 851 struct work_struct add_stream_wk; /* To add streams to queues */ 908 - 909 - atomic_t mac80211_queue_stop_count[IEEE80211_MAX_QUEUES]; 910 852 911 853 const char *nvm_file_name; 912 854 struct iwl_nvm_data *nvm_data; ··· 921 863 /* data related to data path */ 922 864 struct iwl_rx_phy_info last_phy_info; 923 865 struct ieee80211_sta __rcu *fw_id_to_mac_id[IWL_MVM_STATION_COUNT]; 924 - unsigned long sta_deferred_frames[BITS_TO_LONGS(IWL_MVM_STATION_COUNT)]; 925 866 u8 rx_ba_sessions; 926 867 927 868 /* configured by mac80211 */ ··· 989 932 struct debugfs_blob_wrapper nvm_calib_blob; 990 933 struct debugfs_blob_wrapper nvm_prod_blob; 991 934 struct debugfs_blob_wrapper nvm_phy_sku_blob; 935 + struct debugfs_blob_wrapper nvm_reg_blob; 992 936 993 937 struct iwl_mvm_frame_stats drv_rx_stats; 994 938 spinlock_t drv_stats_lock; ··· 1013 955 u8 refs[IWL_MVM_REF_COUNT]; 1014 956 1015 957 u8 vif_count; 958 + struct ieee80211_vif __rcu *vif_id_to_mac[NUM_MAC_INDEX_DRIVER]; 1016 959 1017 960 /* -1 for always, 0 for never, >0 for that many times */ 1018 961 s8 fw_restart; ··· 1149 1090 1150 1091 u32 ciphers[IWL_MVM_NUM_CIPHERS]; 1151 1092 struct ieee80211_cipher_scheme cs[IWL_UCODE_MAX_CS]; 1152 - struct iwl_mvm_tof_data tof_data; 1153 1093 1154 1094 struct ieee80211_vif *nan_vif; 1155 1095 #define IWL_MAX_BAID 32 ··· 1164 1106 1165 1107 /* does a monitor vif exist (only one can exist hence bool) */ 1166 1108 bool monitor_on; 1109 + 1110 + /* sniffer data to include in radiotap */ 1111 + __le16 cur_aid; 1112 + 1167 1113 #ifdef CONFIG_ACPI 1168 1114 struct iwl_mvm_sar_profile sar_profiles[ACPI_SAR_PROFILE_NUM]; 1169 1115 struct iwl_mvm_geo_profile geo_profiles[ACPI_NUM_GEO_PROFILES]; ··· 1212 1150 IWL_MVM_INIT_STATUS_THERMAL_INIT_COMPLETE = BIT(0), 1213 1151 IWL_MVM_INIT_STATUS_LEDS_INIT_COMPLETE = BIT(1), 1214 1152 IWL_MVM_INIT_STATUS_REG_HW_INIT_COMPLETE = BIT(2), 1215 - IWL_MVM_INIT_STATUS_TOF_INIT_COMPLETE = BIT(3), 1216 1153 }; 1217 1154 1218 1155 static inline bool iwl_mvm_is_radio_killed(struct iwl_mvm *mvm) ··· 1266 1205 return NULL; 1267 1206 1268 1207 return iwl_mvm_sta_from_mac80211(sta); 1208 + } 1209 + 1210 + static inline struct ieee80211_vif * 1211 + iwl_mvm_rcu_dereference_vif_id(struct iwl_mvm *mvm, u8 vif_id, bool rcu) 1212 + { 1213 + if (WARN_ON(vif_id >= ARRAY_SIZE(mvm->vif_id_to_mac))) 1214 + return NULL; 1215 + 1216 + if (rcu) 1217 + return rcu_dereference(mvm->vif_id_to_mac[vif_id]); 1218 + 1219 + return rcu_dereference_protected(mvm->vif_id_to_mac[vif_id], 1220 + lockdep_is_held(&mvm->mutex)); 1269 1221 } 1270 1222 1271 1223 static inline bool iwl_mvm_is_d0i3_supported(struct iwl_mvm *mvm) ··· 1544 1470 void iwl_mvm_set_tx_cmd_rate(struct iwl_mvm *mvm, struct iwl_tx_cmd *tx_cmd, 1545 1471 struct ieee80211_tx_info *info, 1546 1472 struct ieee80211_sta *sta, __le16 fc); 1473 + void iwl_mvm_mac_itxq_xmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq); 1474 + unsigned int iwl_mvm_max_amsdu_size(struct iwl_mvm *mvm, 1475 + struct ieee80211_sta *sta, 1476 + unsigned int tid); 1477 + 1547 1478 #ifdef CONFIG_IWLWIFI_DEBUG 1548 1479 const char *iwl_mvm_get_tx_fail_reason(u32 status); 1549 1480 #else ··· 1678 1599 int iwl_mvm_mac_ctxt_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif, 1679 1600 bool force_assoc_off, const u8 *bssid_override); 1680 1601 int iwl_mvm_mac_ctxt_remove(struct iwl_mvm *mvm, struct ieee80211_vif *vif); 1681 - u32 iwl_mvm_mac_get_queues_mask(struct ieee80211_vif *vif); 1682 1602 int iwl_mvm_mac_ctxt_beacon_changed(struct iwl_mvm *mvm, 1683 1603 struct ieee80211_vif *vif); 1684 1604 void iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm, ··· 1693 1615 struct iwl_rx_cmd_buffer *rxb); 1694 1616 void iwl_mvm_mac_ctxt_recalc_tsf_id(struct iwl_mvm *mvm, 1695 1617 struct ieee80211_vif *vif); 1696 - unsigned long iwl_mvm_get_used_hw_queues(struct iwl_mvm *mvm, 1697 - struct ieee80211_vif *exclude_vif); 1698 1618 void iwl_mvm_probe_resp_data_notif(struct iwl_mvm *mvm, 1699 1619 struct iwl_rx_cmd_buffer *rxb); 1700 1620 void iwl_mvm_channel_switch_noa_notif(struct iwl_mvm *mvm, ··· 1946 1870 * binding, so this has no real impact. For now, just return 1947 1871 * the current desired low-latency state. 1948 1872 */ 1949 - return mvmvif->low_latency; 1873 + return mvmvif->low_latency_actual; 1950 1874 } 1951 1875 1952 1876 static inline 1953 1877 void iwl_mvm_vif_set_low_latency(struct iwl_mvm_vif *mvmvif, bool set, 1954 1878 enum iwl_mvm_low_latency_cause cause) 1955 1879 { 1880 + u8 new_state; 1881 + 1956 1882 if (set) 1957 1883 mvmvif->low_latency |= cause; 1958 1884 else 1959 1885 mvmvif->low_latency &= ~cause; 1886 + 1887 + /* 1888 + * if LOW_LATENCY_DEBUGFS_FORCE_ENABLE is enabled no changes are 1889 + * allowed to actual mode. 1890 + */ 1891 + if (mvmvif->low_latency & LOW_LATENCY_DEBUGFS_FORCE_ENABLE && 1892 + cause != LOW_LATENCY_DEBUGFS_FORCE_ENABLE) 1893 + return; 1894 + 1895 + if (cause == LOW_LATENCY_DEBUGFS_FORCE_ENABLE && set) 1896 + /* 1897 + * We enter force state 1898 + */ 1899 + new_state = !!(mvmvif->low_latency & 1900 + LOW_LATENCY_DEBUGFS_FORCE); 1901 + else 1902 + /* 1903 + * Check if any other one set low latency 1904 + */ 1905 + new_state = !!(mvmvif->low_latency & 1906 + ~(LOW_LATENCY_DEBUGFS_FORCE_ENABLE | 1907 + LOW_LATENCY_DEBUGFS_FORCE)); 1908 + 1909 + mvmvif->low_latency_actual = new_state; 1960 1910 } 1961 1911 1962 1912 /* Return a bitmask with all the hw supported queues, except for the ··· 1997 1895 static inline void iwl_mvm_stop_device(struct iwl_mvm *mvm) 1998 1896 { 1999 1897 lockdep_assert_held(&mvm->mutex); 1898 + /* If IWL_MVM_STATUS_HW_RESTART_REQUESTED bit is set then we received 1899 + * an assert. Since we failed to bring the interface up, mac80211 1900 + * will not attempt to reconfig the device, 1901 + * which handles the dump collection in assert flow, 1902 + * so trigger dump collection here. 1903 + */ 1904 + if (test_and_clear_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, 1905 + &mvm->status)) 1906 + iwl_fw_dbg_collect_desc(&mvm->fwrt, &iwl_dump_desc_assert, 1907 + false, 0); 2000 1908 /* calling this function without using dump_start/end since at this 2001 1909 * point we already hold the op mode mutex 2002 1910 */ ··· 2017 1905 iwl_fw_dump_conf_clear(&mvm->fwrt); 2018 1906 iwl_trans_stop_device(mvm->trans); 2019 1907 } 2020 - 2021 - /* Stop/start all mac queues in a given bitmap */ 2022 - void iwl_mvm_start_mac_queues(struct iwl_mvm *mvm, unsigned long mq); 2023 - void iwl_mvm_stop_mac_queues(struct iwl_mvm *mvm, unsigned long mq); 2024 1908 2025 1909 /* Re-configure the SCD for a queue that has already been configured */ 2026 1910 int iwl_mvm_reconfig_scd(struct iwl_mvm *mvm, int queue, int fifo, int sta_id, ··· 2122 2014 struct ieee80211_sta *sta, 2123 2015 struct dentry *dir); 2124 2016 #endif 2017 + 2018 + /* Channel info utils */ 2019 + static inline bool iwl_mvm_has_ultra_hb_channel(struct iwl_mvm *mvm) 2020 + { 2021 + return fw_has_capa(&mvm->fw->ucode_capa, 2022 + IWL_UCODE_TLV_CAPA_ULTRA_HB_CHANNELS); 2023 + } 2024 + 2025 + static inline void *iwl_mvm_chan_info_cmd_tail(struct iwl_mvm *mvm, 2026 + struct iwl_fw_channel_info *ci) 2027 + { 2028 + return (u8 *)ci + (iwl_mvm_has_ultra_hb_channel(mvm) ? 2029 + sizeof(struct iwl_fw_channel_info) : 2030 + sizeof(struct iwl_fw_channel_info_v1)); 2031 + } 2032 + 2033 + static inline size_t iwl_mvm_chan_info_padding(struct iwl_mvm *mvm) 2034 + { 2035 + return iwl_mvm_has_ultra_hb_channel(mvm) ? 0 : 2036 + sizeof(struct iwl_fw_channel_info) - 2037 + sizeof(struct iwl_fw_channel_info_v1); 2038 + } 2039 + 2040 + static inline void iwl_mvm_set_chan_info(struct iwl_mvm *mvm, 2041 + struct iwl_fw_channel_info *ci, 2042 + u32 chan, u8 band, u8 width, 2043 + u8 ctrl_pos) 2044 + { 2045 + if (iwl_mvm_has_ultra_hb_channel(mvm)) { 2046 + ci->channel = cpu_to_le32(chan); 2047 + ci->band = band; 2048 + ci->width = width; 2049 + ci->ctrl_pos = ctrl_pos; 2050 + } else { 2051 + struct iwl_fw_channel_info_v1 *ci_v1 = 2052 + (struct iwl_fw_channel_info_v1 *)ci; 2053 + 2054 + ci_v1->channel = chan; 2055 + ci_v1->band = band; 2056 + ci_v1->width = width; 2057 + ci_v1->ctrl_pos = ctrl_pos; 2058 + } 2059 + } 2060 + 2061 + static inline void 2062 + iwl_mvm_set_chan_info_chandef(struct iwl_mvm *mvm, 2063 + struct iwl_fw_channel_info *ci, 2064 + struct cfg80211_chan_def *chandef) 2065 + { 2066 + iwl_mvm_set_chan_info(mvm, ci, chandef->chan->hw_value, 2067 + (chandef->chan->band == NL80211_BAND_2GHZ ? 2068 + PHY_BAND_24 : PHY_BAND_5), 2069 + iwl_mvm_get_channel_width(chandef), 2070 + iwl_mvm_get_ctrl_pos(chandef)); 2071 + } 2125 2072 2126 2073 #endif /* __IWL_MVM_H__ */
+12 -3
drivers/net/wireless/intel/iwlwifi/mvm/nvm.c
··· 179 179 IWL_DEBUG_EEPROM(mvm->trans->dev, 180 180 "NVM access command failed with status %d (device: %s)\n", 181 181 ret, mvm->cfg->name); 182 - ret = -EIO; 182 + ret = -ENODATA; 183 183 } 184 184 goto exit; 185 185 } ··· 380 380 /* we override the constness for initial read */ 381 381 ret = iwl_nvm_read_section(mvm, section, nvm_buffer, 382 382 size_read); 383 - if (ret < 0) 383 + if (ret == -ENODATA) { 384 + ret = 0; 384 385 continue; 386 + } 387 + if (ret < 0) 388 + break; 385 389 size_read += ret; 386 390 temp = kmemdup(nvm_buffer, ret, GFP_KERNEL); 387 391 if (!temp) { ··· 415 411 case NVM_SECTION_TYPE_PHY_SKU: 416 412 mvm->nvm_phy_sku_blob.data = temp; 417 413 mvm->nvm_phy_sku_blob.size = ret; 414 + break; 415 + case NVM_SECTION_TYPE_REGULATORY_SDP: 416 + case NVM_SECTION_TYPE_REGULATORY: 417 + mvm->nvm_reg_blob.data = temp; 418 + mvm->nvm_reg_blob.size = ret; 418 419 break; 419 420 default: 420 421 if (section == mvm->cfg->nvm_hw_section_num) { ··· 463 454 IWL_DEBUG_EEPROM(mvm->trans->dev, "nvm version = %x\n", 464 455 mvm->nvm_data->nvm_version); 465 456 466 - return 0; 457 + return ret < 0 ? ret : 0; 467 458 } 468 459 469 460 struct iwl_mcc_update_resp *
+70 -46
drivers/net/wireless/intel/iwlwifi/mvm/ops.c
··· 301 301 RX_HANDLER_ASYNC_LOCKED), 302 302 RX_HANDLER(MFUART_LOAD_NOTIFICATION, iwl_mvm_rx_mfuart_notif, 303 303 RX_HANDLER_SYNC), 304 - RX_HANDLER(TOF_NOTIFICATION, iwl_mvm_tof_resp_handler, 305 - RX_HANDLER_ASYNC_LOCKED), 306 304 RX_HANDLER_GRP(DEBUG_GROUP, MFU_ASSERT_DUMP_NTF, 307 305 iwl_mvm_mfu_assert_dump_notif, RX_HANDLER_SYNC), 308 306 RX_HANDLER_GRP(PROT_OFFLOAD_GROUP, STORED_BEACON_NTF, ··· 327 329 HCMD_NAME(SCAN_REQ_UMAC), 328 330 HCMD_NAME(SCAN_ABORT_UMAC), 329 331 HCMD_NAME(SCAN_COMPLETE_UMAC), 330 - HCMD_NAME(TOF_CMD), 331 - HCMD_NAME(TOF_NOTIFICATION), 332 332 HCMD_NAME(BA_WINDOW_STATUS_NOTIFICATION_ID), 333 333 HCMD_NAME(ADD_STA_KEY), 334 334 HCMD_NAME(ADD_STA), ··· 445 449 HCMD_NAME(TRIGGER_RX_QUEUES_NOTIF_CMD), 446 450 HCMD_NAME(STA_HE_CTXT_CMD), 447 451 HCMD_NAME(RFH_QUEUE_CONFIG_CMD), 452 + HCMD_NAME(CHEST_COLLECTOR_FILTER_CONFIG_CMD), 448 453 HCMD_NAME(STA_PM_NOTIF), 449 454 HCMD_NAME(MU_GROUP_MGMT_NOTIF), 450 455 HCMD_NAME(RX_QUEUES_NOTIFICATION), ··· 456 459 */ 457 460 static const struct iwl_hcmd_names iwl_mvm_debug_names[] = { 458 461 HCMD_NAME(MFU_ASSERT_DUMP_NTF), 462 + }; 463 + 464 + /* Please keep this array *SORTED* by hex value. 465 + * Access is done through binary search 466 + */ 467 + static const struct iwl_hcmd_names iwl_mvm_location_names[] = { 468 + HCMD_NAME(TOF_RANGE_REQ_CMD), 469 + HCMD_NAME(TOF_CONFIG_CMD), 470 + HCMD_NAME(TOF_RANGE_ABORT_CMD), 471 + HCMD_NAME(TOF_RANGE_REQ_EXT_CMD), 472 + HCMD_NAME(TOF_RESPONDER_CONFIG_CMD), 473 + HCMD_NAME(TOF_RESPONDER_DYN_CONFIG_CMD), 474 + HCMD_NAME(TOF_LC_NOTIF), 475 + HCMD_NAME(TOF_RESPONDER_STATS), 476 + HCMD_NAME(TOF_MCSI_DEBUG_NOTIF), 477 + HCMD_NAME(TOF_RANGE_RESPONSE_NOTIF), 459 478 }; 460 479 461 480 /* Please keep this array *SORTED* by hex value. ··· 496 483 [MAC_CONF_GROUP] = HCMD_ARR(iwl_mvm_mac_conf_names), 497 484 [PHY_OPS_GROUP] = HCMD_ARR(iwl_mvm_phy_names), 498 485 [DATA_PATH_GROUP] = HCMD_ARR(iwl_mvm_data_path_names), 486 + [LOCATION_GROUP] = HCMD_ARR(iwl_mvm_location_names), 499 487 [PROT_OFFLOAD_GROUP] = HCMD_ARR(iwl_mvm_prot_offload_names), 500 488 [REGULATORY_AND_NVM_GROUP] = 501 489 HCMD_ARR(iwl_mvm_regulatory_and_nvm_names), ··· 699 685 INIT_DELAYED_WORK(&mvm->tdls_cs.dwork, iwl_mvm_tdls_ch_switch_work); 700 686 INIT_DELAYED_WORK(&mvm->scan_timeout_dwork, iwl_mvm_scan_timeout_wk); 701 687 INIT_WORK(&mvm->add_stream_wk, iwl_mvm_add_new_dqa_stream_wk); 688 + INIT_LIST_HEAD(&mvm->add_stream_txqs); 702 689 703 690 spin_lock_init(&mvm->d0i3_tx_lock); 704 691 spin_lock_init(&mvm->refs_lock); ··· 750 735 iwlwifi_mod_params.amsdu_size); 751 736 trans_cfg.rx_buf_size = rb_size_default; 752 737 } 738 + 739 + BUILD_BUG_ON(sizeof(struct iwl_ldbg_config_cmd) != 740 + LDBG_CFG_COMMAND_SIZE); 753 741 754 742 trans->wide_cmd_header = true; 755 743 trans_cfg.bc_table_dword = ··· 860 842 if (iwl_mvm_is_d0i3_supported(mvm)) 861 843 iwl_trans_unref(mvm->trans); 862 844 863 - iwl_mvm_tof_init(mvm); 864 - 865 845 iwl_mvm_toggle_tx_ant(mvm, &mvm->mgmt_last_antenna_idx); 866 846 867 847 return op_mode; ··· 924 908 kfree(mvm->nvm_sections[i].data); 925 909 926 910 cancel_delayed_work_sync(&mvm->tcm.work); 927 - 928 - iwl_mvm_tof_clean(mvm); 929 911 930 912 iwl_fw_runtime_free(&mvm->fwrt); 931 913 mutex_destroy(&mvm->mutex); ··· 1093 1079 iwl_mvm_rx_common(mvm, rxb, pkt); 1094 1080 } 1095 1081 1096 - void iwl_mvm_stop_mac_queues(struct iwl_mvm *mvm, unsigned long mq) 1097 - { 1098 - int q; 1099 - 1100 - if (WARN_ON_ONCE(!mq)) 1101 - return; 1102 - 1103 - for_each_set_bit(q, &mq, IEEE80211_MAX_QUEUES) { 1104 - if (atomic_inc_return(&mvm->mac80211_queue_stop_count[q]) > 1) { 1105 - IWL_DEBUG_TX_QUEUES(mvm, 1106 - "mac80211 %d already stopped\n", q); 1107 - continue; 1108 - } 1109 - 1110 - ieee80211_stop_queue(mvm->hw, q); 1111 - } 1112 - } 1113 - 1114 1082 static void iwl_mvm_async_cb(struct iwl_op_mode *op_mode, 1115 1083 const struct iwl_device_cmd *cmd) 1116 1084 { ··· 1105 1109 iwl_trans_block_txq_ptrs(mvm->trans, false); 1106 1110 } 1107 1111 1108 - static void iwl_mvm_stop_sw_queue(struct iwl_op_mode *op_mode, int hw_queue) 1112 + static void iwl_mvm_queue_state_change(struct iwl_op_mode *op_mode, 1113 + int hw_queue, bool start) 1109 1114 { 1110 1115 struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); 1111 - unsigned long mq = mvm->hw_queue_to_mac80211[hw_queue]; 1116 + struct ieee80211_sta *sta; 1117 + struct ieee80211_txq *txq; 1118 + struct iwl_mvm_txq *mvmtxq; 1119 + int i; 1120 + unsigned long tid_bitmap; 1121 + struct iwl_mvm_sta *mvmsta; 1122 + u8 sta_id; 1112 1123 1113 - iwl_mvm_stop_mac_queues(mvm, mq); 1114 - } 1124 + sta_id = iwl_mvm_has_new_tx_api(mvm) ? 1125 + mvm->tvqm_info[hw_queue].sta_id : 1126 + mvm->queue_info[hw_queue].ra_sta_id; 1115 1127 1116 - void iwl_mvm_start_mac_queues(struct iwl_mvm *mvm, unsigned long mq) 1117 - { 1118 - int q; 1119 - 1120 - if (WARN_ON_ONCE(!mq)) 1128 + if (WARN_ON_ONCE(sta_id >= ARRAY_SIZE(mvm->fw_id_to_mac_id))) 1121 1129 return; 1122 1130 1123 - for_each_set_bit(q, &mq, IEEE80211_MAX_QUEUES) { 1124 - if (atomic_dec_return(&mvm->mac80211_queue_stop_count[q]) > 0) { 1125 - IWL_DEBUG_TX_QUEUES(mvm, 1126 - "mac80211 %d still stopped\n", q); 1127 - continue; 1128 - } 1131 + rcu_read_lock(); 1129 1132 1130 - ieee80211_wake_queue(mvm->hw, q); 1133 + sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); 1134 + if (IS_ERR_OR_NULL(sta)) 1135 + goto out; 1136 + mvmsta = iwl_mvm_sta_from_mac80211(sta); 1137 + 1138 + if (iwl_mvm_has_new_tx_api(mvm)) { 1139 + int tid = mvm->tvqm_info[hw_queue].txq_tid; 1140 + 1141 + tid_bitmap = BIT(tid); 1142 + } else { 1143 + tid_bitmap = mvm->queue_info[hw_queue].tid_bitmap; 1131 1144 } 1145 + 1146 + for_each_set_bit(i, &tid_bitmap, IWL_MAX_TID_COUNT + 1) { 1147 + int tid = i; 1148 + 1149 + if (tid == IWL_MAX_TID_COUNT) 1150 + tid = IEEE80211_NUM_TIDS; 1151 + 1152 + txq = sta->txq[tid]; 1153 + mvmtxq = iwl_mvm_txq_from_mac80211(txq); 1154 + mvmtxq->stopped = !start; 1155 + 1156 + if (start && mvmsta->sta_state != IEEE80211_STA_NOTEXIST) 1157 + iwl_mvm_mac_itxq_xmit(mvm->hw, txq); 1158 + } 1159 + 1160 + out: 1161 + rcu_read_unlock(); 1162 + } 1163 + 1164 + static void iwl_mvm_stop_sw_queue(struct iwl_op_mode *op_mode, int hw_queue) 1165 + { 1166 + iwl_mvm_queue_state_change(op_mode, hw_queue, false); 1132 1167 } 1133 1168 1134 1169 static void iwl_mvm_wake_sw_queue(struct iwl_op_mode *op_mode, int hw_queue) 1135 1170 { 1136 - struct iwl_mvm *mvm = IWL_OP_MODE_GET_MVM(op_mode); 1137 - unsigned long mq = mvm->hw_queue_to_mac80211[hw_queue]; 1138 - 1139 - iwl_mvm_start_mac_queues(mvm, mq); 1171 + iwl_mvm_queue_state_change(op_mode, hw_queue, true); 1140 1172 } 1141 1173 1142 1174 static void iwl_mvm_set_rfkill_state(struct iwl_mvm *mvm)
+10 -14
drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c
··· 143 143 u8 chains_static, u8 chains_dynamic) 144 144 { 145 145 u8 active_cnt, idle_cnt; 146 + struct iwl_phy_context_cmd_tail *tail = 147 + iwl_mvm_chan_info_cmd_tail(mvm, &cmd->ci); 146 148 147 149 /* Set the channel info data */ 148 - cmd->ci.band = (chandef->chan->band == NL80211_BAND_2GHZ ? 149 - PHY_BAND_24 : PHY_BAND_5); 150 - 151 - cmd->ci.channel = chandef->chan->hw_value; 152 - cmd->ci.width = iwl_mvm_get_channel_width(chandef); 153 - cmd->ci.ctrl_pos = iwl_mvm_get_ctrl_pos(chandef); 150 + iwl_mvm_set_chan_info_chandef(mvm, &cmd->ci, chandef); 154 151 155 152 /* Set rx the chains */ 156 153 idle_cnt = chains_static; ··· 165 168 active_cnt = 2; 166 169 } 167 170 168 - cmd->rxchain_info = cpu_to_le32(iwl_mvm_get_valid_rx_ant(mvm) << 171 + tail->rxchain_info = cpu_to_le32(iwl_mvm_get_valid_rx_ant(mvm) << 169 172 PHY_RX_CHAIN_VALID_POS); 170 - cmd->rxchain_info |= cpu_to_le32(idle_cnt << PHY_RX_CHAIN_CNT_POS); 171 - cmd->rxchain_info |= cpu_to_le32(active_cnt << 173 + tail->rxchain_info |= cpu_to_le32(idle_cnt << PHY_RX_CHAIN_CNT_POS); 174 + tail->rxchain_info |= cpu_to_le32(active_cnt << 172 175 PHY_RX_CHAIN_MIMO_CNT_POS); 173 176 #ifdef CONFIG_IWLWIFI_DEBUGFS 174 177 if (unlikely(mvm->dbgfs_rx_phyinfo)) 175 - cmd->rxchain_info = cpu_to_le32(mvm->dbgfs_rx_phyinfo); 178 + tail->rxchain_info = cpu_to_le32(mvm->dbgfs_rx_phyinfo); 176 179 #endif 177 180 178 - cmd->txchain_info = cpu_to_le32(iwl_mvm_get_valid_tx_ant(mvm)); 181 + tail->txchain_info = cpu_to_le32(iwl_mvm_get_valid_tx_ant(mvm)); 179 182 } 180 183 181 184 /* ··· 192 195 { 193 196 struct iwl_phy_context_cmd cmd; 194 197 int ret; 198 + u16 len = sizeof(cmd) - iwl_mvm_chan_info_padding(mvm); 195 199 196 200 /* Set the command header fields */ 197 201 iwl_mvm_phy_ctxt_cmd_hdr(ctxt, &cmd, action, apply_time); ··· 201 203 iwl_mvm_phy_ctxt_cmd_data(mvm, &cmd, chandef, 202 204 chains_static, chains_dynamic); 203 205 204 - ret = iwl_mvm_send_cmd_pdu(mvm, PHY_CONTEXT_CMD, 0, 205 - sizeof(struct iwl_phy_context_cmd), 206 - &cmd); 206 + ret = iwl_mvm_send_cmd_pdu(mvm, PHY_CONTEXT_CMD, 0, len, &cmd); 207 207 if (ret) 208 208 IWL_ERR(mvm, "PHY ctxt cmd error. ret=%d\n", ret); 209 209 return ret;
+15 -6
drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c
··· 149 149 150 150 if (he_cap && he_cap->has_he && 151 151 (he_cap->he_cap_elem.phy_cap_info[3] & 152 - IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_TX_MASK)) { 152 + IEEE80211_HE_PHY_CAP3_DCM_MAX_CONST_RX_MASK)) 153 153 flags |= IWL_TLC_MNG_CFG_FLAGS_HE_DCM_NSS_1_MSK; 154 - 155 - if (he_cap->he_cap_elem.phy_cap_info[3] & 156 - IEEE80211_HE_PHY_CAP3_DCM_MAX_TX_NSS_2) 157 - flags |= IWL_TLC_MNG_CFG_FLAGS_HE_DCM_NSS_2_MSK; 158 - } 159 154 160 155 return flags; 161 156 } ··· 315 320 316 321 if (flags & IWL_TLC_NOTIF_FLAG_AMSDU) { 317 322 u16 size = le32_to_cpu(notif->amsdu_size); 323 + int i; 318 324 319 325 if (WARN_ON(sta->max_amsdu_len < size)) 320 326 goto out; 321 327 322 328 mvmsta->amsdu_enabled = le32_to_cpu(notif->amsdu_enabled); 323 329 mvmsta->max_amsdu_len = size; 330 + sta->max_rc_amsdu_len = mvmsta->max_amsdu_len; 331 + 332 + for (i = 0; i < IWL_MAX_TID_COUNT; i++) { 333 + if (mvmsta->amsdu_enabled & BIT(i)) 334 + sta->max_tid_amsdu_len[i] = 335 + iwl_mvm_max_amsdu_size(mvm, sta, i); 336 + else 337 + /* 338 + * Not so elegant, but this will effectively 339 + * prevent AMSDU on this TID 340 + */ 341 + sta->max_tid_amsdu_len[i] = 1; 342 + } 324 343 325 344 IWL_DEBUG_RATE(mvm, 326 345 "AMSDU update. AMSDU size: %d, AMSDU selected size: %d, AMSDU TID bitmap 0x%X\n",
+20 -6
drivers/net/wireless/intel/iwlwifi/mvm/rs.c
··· 1744 1744 enum rs_action scale_action) 1745 1745 { 1746 1746 struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); 1747 + int i; 1747 1748 1748 1749 /* 1749 1750 * In case TLC offload is not active amsdu_enabled is either 0xFFFF ··· 1758 1757 mvmsta->amsdu_enabled = 0xFFFF; 1759 1758 1760 1759 mvmsta->max_amsdu_len = sta->max_amsdu_len; 1760 + sta->max_rc_amsdu_len = mvmsta->max_amsdu_len; 1761 + 1762 + for (i = 0; i < IWL_MAX_TID_COUNT; i++) { 1763 + if (mvmsta->amsdu_enabled) 1764 + sta->max_tid_amsdu_len[i] = 1765 + iwl_mvm_max_amsdu_size(mvm, sta, i); 1766 + else 1767 + /* 1768 + * Not so elegant, but this will effectively 1769 + * prevent AMSDU on this TID 1770 + */ 1771 + sta->max_tid_amsdu_len[i] = 1; 1772 + } 1761 1773 } 1762 1774 1763 1775 /* ··· 3346 3332 /* Building the rate table is non trivial. When we're in MIMO2/VHT/80Mhz/SGI 3347 3333 * column the rate table should look like this: 3348 3334 * 3349 - * rate[0] 0x400D019 VHT | ANT: AB BW: 80Mhz MCS: 9 NSS: 2 SGI 3350 - * rate[1] 0x400D019 VHT | ANT: AB BW: 80Mhz MCS: 9 NSS: 2 SGI 3351 - * rate[2] 0x400D018 VHT | ANT: AB BW: 80Mhz MCS: 8 NSS: 2 SGI 3352 - * rate[3] 0x400D018 VHT | ANT: AB BW: 80Mhz MCS: 8 NSS: 2 SGI 3353 - * rate[4] 0x400D017 VHT | ANT: AB BW: 80Mhz MCS: 7 NSS: 2 SGI 3354 - * rate[5] 0x400D017 VHT | ANT: AB BW: 80Mhz MCS: 7 NSS: 2 SGI 3335 + * rate[0] 0x400F019 VHT | ANT: AB BW: 80Mhz MCS: 9 NSS: 2 SGI 3336 + * rate[1] 0x400F019 VHT | ANT: AB BW: 80Mhz MCS: 9 NSS: 2 SGI 3337 + * rate[2] 0x400F018 VHT | ANT: AB BW: 80Mhz MCS: 8 NSS: 2 SGI 3338 + * rate[3] 0x400F018 VHT | ANT: AB BW: 80Mhz MCS: 8 NSS: 2 SGI 3339 + * rate[4] 0x400F017 VHT | ANT: AB BW: 80Mhz MCS: 7 NSS: 2 SGI 3340 + * rate[5] 0x400F017 VHT | ANT: AB BW: 80Mhz MCS: 7 NSS: 2 SGI 3355 3341 * rate[6] 0x4005007 VHT | ANT: A BW: 80Mhz MCS: 7 NSS: 1 NGI 3356 3342 * rate[7] 0x4009006 VHT | ANT: B BW: 80Mhz MCS: 6 NSS: 1 NGI 3357 3343 * rate[8] 0x4005005 VHT | ANT: A BW: 80Mhz MCS: 5 NSS: 1 NGI
+5 -5
drivers/net/wireless/intel/iwlwifi/mvm/rx.c
··· 599 599 * data copied into the "data" struct, but rather the data from 600 600 * the notification directly. 601 601 */ 602 - if (iwl_mvm_is_cdb_supported(mvm)) { 603 - struct mvm_statistics_general_cdb *general = 602 + if (iwl_mvm_has_new_rx_stats_api(mvm)) { 603 + struct mvm_statistics_general *general = 604 604 data->general; 605 605 606 606 mvmvif->beacon_stats.num_beacons = ··· 723 723 else 724 724 expected_size = sizeof(struct iwl_notif_statistics_v10); 725 725 } else { 726 - expected_size = sizeof(struct iwl_notif_statistics_cdb); 726 + expected_size = sizeof(struct iwl_notif_statistics); 727 727 } 728 728 729 729 if (WARN_ONCE(iwl_rx_packet_payload_len(pkt) != expected_size, ··· 753 753 754 754 flags = stats->flag; 755 755 } else { 756 - struct iwl_notif_statistics_cdb *stats = (void *)&pkt->data; 756 + struct iwl_notif_statistics *stats = (void *)&pkt->data; 757 757 758 758 data.mac_id = stats->rx.general.mac_id; 759 759 data.beacon_filter_average_energy = ··· 792 792 bytes = (void *)&v11->load_stats.byte_count; 793 793 air_time = (void *)&v11->load_stats.air_time; 794 794 } else { 795 - struct iwl_notif_statistics_cdb *stats = (void *)&pkt->data; 795 + struct iwl_notif_statistics *stats = (void *)&pkt->data; 796 796 797 797 energy = (void *)&stats->load_stats.avg_energy; 798 798 bytes = (void *)&stats->load_stats.byte_count;
+72 -32
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
··· 192 192 } 193 193 } 194 194 195 + static void iwl_mvm_add_rtap_sniffer_config(struct iwl_mvm *mvm, 196 + struct sk_buff *skb) 197 + { 198 + struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb); 199 + struct ieee80211_vendor_radiotap *radiotap; 200 + int size = sizeof(*radiotap) + sizeof(__le16); 201 + 202 + if (!mvm->cur_aid) 203 + return; 204 + 205 + radiotap = skb_put(skb, size); 206 + radiotap->align = 1; 207 + /* Intel OUI */ 208 + radiotap->oui[0] = 0xf6; 209 + radiotap->oui[1] = 0x54; 210 + radiotap->oui[2] = 0x25; 211 + /* radiotap sniffer config sub-namespace */ 212 + radiotap->subns = 1; 213 + radiotap->present = 0x1; 214 + radiotap->len = size - sizeof(*radiotap); 215 + radiotap->pad = 0; 216 + 217 + /* fill the data now */ 218 + memcpy(radiotap->data, &mvm->cur_aid, sizeof(mvm->cur_aid)); 219 + 220 + rx_status->flag |= RX_FLAG_RADIOTAP_VENDOR_DATA; 221 + } 222 + 195 223 /* iwl_mvm_pass_packet_to_mac80211 - passes the packet for mac80211 */ 196 224 static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm, 197 225 struct napi_struct *napi, 198 226 struct sk_buff *skb, int queue, 199 - struct ieee80211_sta *sta) 227 + struct ieee80211_sta *sta, 228 + bool csi) 200 229 { 201 230 struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb); 202 231 203 232 if (!(rx_status->flag & RX_FLAG_NO_PSDU) && 204 - iwl_mvm_check_pn(mvm, skb, queue, sta)) { 233 + iwl_mvm_check_pn(mvm, skb, queue, sta)) 205 234 kfree_skb(skb); 206 - } else { 207 - unsigned int radiotap_len = 0; 208 - 209 - if (rx_status->flag & RX_FLAG_RADIOTAP_HE) 210 - radiotap_len += sizeof(struct ieee80211_radiotap_he); 211 - if (rx_status->flag & RX_FLAG_RADIOTAP_HE_MU) 212 - radiotap_len += sizeof(struct ieee80211_radiotap_he_mu); 213 - __skb_push(skb, radiotap_len); 235 + else 214 236 ieee80211_rx_napi(mvm->hw, sta, skb, napi); 215 - } 216 237 } 217 238 218 239 static void iwl_mvm_get_signal_strength(struct iwl_mvm *mvm, ··· 494 473 while ((skb = __skb_dequeue(skb_list))) { 495 474 iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, 496 475 reorder_buf->queue, 497 - sta); 476 + sta, false); 498 477 reorder_buf->num_stored--; 499 478 } 500 479 } ··· 687 666 * This also covers the case of receiving a Block Ack Request 688 667 * outside a BA session; we'll pass it to mac80211 and that 689 668 * then sends a delBA action frame. 669 + * This also covers pure monitor mode, in which case we won't 670 + * have any BA sessions. 690 671 */ 691 672 if (baid == IWL_RX_REORDER_DATA_INVALID_BAID) 692 673 return false; ··· 1181 1158 /* temporarily hide the radiotap data */ 1182 1159 __skb_pull(skb, radiotap_len); 1183 1160 1184 - if (phy_data->info_type == IWL_RX_PHY_INFO_TYPE_HE_SU) { 1185 - /* report the AMPDU-EOF bit on single frames */ 1186 - if (!queue && !(phy_info & IWL_RX_MPDU_PHY_AMPDU)) { 1187 - rx_status->flag |= RX_FLAG_AMPDU_DETAILS; 1188 - rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; 1189 - if (phy_data->d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF)) 1190 - rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; 1191 - } 1161 + /* report the AMPDU-EOF bit on single frames */ 1162 + if (!queue && !(phy_info & IWL_RX_MPDU_PHY_AMPDU)) { 1163 + rx_status->flag |= RX_FLAG_AMPDU_DETAILS; 1164 + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; 1165 + if (phy_data->d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF)) 1166 + rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; 1192 1167 } 1193 1168 1194 1169 if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD) ··· 1199 1178 bool toggle_bit = phy_info & IWL_RX_MPDU_PHY_AMPDU_TOGGLE; 1200 1179 1201 1180 /* toggle is switched whenever new aggregation starts */ 1202 - if (toggle_bit != mvm->ampdu_toggle && 1203 - (he_type == RATE_MCS_HE_TYPE_MU || 1204 - he_type == RATE_MCS_HE_TYPE_SU)) { 1181 + if (toggle_bit != mvm->ampdu_toggle) { 1205 1182 rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN; 1206 1183 if (phy_data->d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF)) 1207 1184 rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT; ··· 1333 1314 .d4 = desc->phy_data4, 1334 1315 .info_type = IWL_RX_PHY_INFO_TYPE_NONE, 1335 1316 }; 1317 + bool csi = false; 1336 1318 1337 1319 if (unlikely(test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status))) 1338 1320 return; ··· 1432 1412 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; 1433 1413 } 1434 1414 /* set the preamble flag if appropriate */ 1435 - if (phy_info & IWL_RX_MPDU_PHY_SHORT_PREAMBLE) 1415 + if (rate_n_flags & RATE_MCS_CCK_MSK && 1416 + phy_info & IWL_RX_MPDU_PHY_SHORT_PREAMBLE) 1436 1417 rx_status->enc_flags |= RX_ENC_FLAG_SHORTPRE; 1437 1418 1438 1419 if (likely(!(phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD))) { ··· 1462 1441 bool toggle_bit = phy_info & IWL_RX_MPDU_PHY_AMPDU_TOGGLE; 1463 1442 1464 1443 rx_status->flag |= RX_FLAG_AMPDU_DETAILS; 1465 - rx_status->ampdu_reference = mvm->ampdu_ref; 1466 - /* toggle is switched whenever new aggregation starts */ 1444 + /* 1445 + * Toggle is switched whenever new aggregation starts. Make 1446 + * sure ampdu_reference is never 0 so we can later use it to 1447 + * see if the frame was really part of an A-MPDU or not. 1448 + */ 1467 1449 if (toggle_bit != mvm->ampdu_toggle) { 1468 1450 mvm->ampdu_ref++; 1451 + if (mvm->ampdu_ref == 0) 1452 + mvm->ampdu_ref++; 1469 1453 mvm->ampdu_toggle = toggle_bit; 1470 1454 } 1455 + rx_status->ampdu_reference = mvm->ampdu_ref; 1471 1456 } 1457 + 1458 + if (unlikely(mvm->monitor_on)) 1459 + iwl_mvm_add_rtap_sniffer_config(mvm, skb); 1472 1460 1473 1461 rcu_read_lock(); 1474 1462 ··· 1632 1602 1633 1603 iwl_mvm_create_skb(skb, hdr, len, crypt_len, rxb); 1634 1604 if (!iwl_mvm_reorder(mvm, napi, queue, sta, skb, desc)) 1635 - iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta); 1605 + iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, 1606 + sta, csi); 1636 1607 out: 1637 1608 rcu_read_unlock(); 1638 1609 } ··· 1736 1705 } else if (rate_n_flags & RATE_MCS_VHT_MSK) { 1737 1706 u8 stbc = (rate_n_flags & RATE_MCS_STBC_MSK) >> 1738 1707 RATE_MCS_STBC_POS; 1739 - rx_status->nss = 1740 - ((rate_n_flags & RATE_VHT_MCS_NSS_MSK) >> 1741 - RATE_VHT_MCS_NSS_POS) + 1; 1742 1708 rx_status->rate_idx = rate_n_flags & RATE_VHT_MCS_RATE_CODE_MSK; 1743 1709 rx_status->encoding = RX_ENC_VHT; 1744 1710 rx_status->enc_flags |= stbc << RX_ENC_FLAG_STBC_SHIFT; 1745 1711 if (rate_n_flags & RATE_MCS_BF_MSK) 1746 1712 rx_status->enc_flags |= RX_ENC_FLAG_BF; 1747 - } else if (!(rate_n_flags & RATE_MCS_HE_MSK)) { 1713 + /* 1714 + * take the nss from the rx_vec since the rate_n_flags has 1715 + * only 2 bits for the nss which gives a max of 4 ss but 1716 + * there may be up to 8 spatial streams 1717 + */ 1718 + rx_status->nss = 1719 + le32_get_bits(desc->rx_vec[0], 1720 + RX_NO_DATA_RX_VEC0_VHT_NSTS_MSK) + 1; 1721 + } else if (rate_n_flags & RATE_MCS_HE_MSK) { 1722 + rx_status->nss = 1723 + le32_get_bits(desc->rx_vec[0], 1724 + RX_NO_DATA_RX_VEC0_HE_NSTS_MSK) + 1; 1725 + } else { 1748 1726 int rate = iwl_mvm_legacy_rate_to_mac80211_idx(rate_n_flags, 1749 1727 rx_status->band); 1750 1728 ··· 1766 1726 rx_status->rate_idx = rate; 1767 1727 } 1768 1728 1769 - iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta); 1729 + iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta, false); 1770 1730 out: 1771 1731 rcu_read_unlock(); 1772 1732 }
+3 -1
drivers/net/wireless/intel/iwlwifi/mvm/sf.c
··· 7 7 * 8 8 * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. 9 9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 10 + * Copyright (C) 2018 Intel Corporation 10 11 * 11 12 * This program is free software; you can redistribute it and/or modify 12 13 * it under the terms of version 2 of the GNU General Public License as ··· 29 28 * 30 29 * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. 31 30 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 31 + * Copyright (C) 2018 Intel Corporation 32 32 * All rights reserved. 33 33 * 34 34 * Redistribution and use in source and binary forms, with or without ··· 66 64 struct ieee80211_vif *ignore_vif; 67 65 u8 sta_vif_ap_sta_id; 68 66 enum iwl_sf_state sta_vif_state; 69 - int num_active_macs; 67 + u32 num_active_macs; 70 68 }; 71 69 72 70 /*
+151 -226
drivers/net/wireless/intel/iwlwifi/mvm/sta.c
··· 356 356 return ret; 357 357 } 358 358 359 - static int iwl_mvm_disable_txq(struct iwl_mvm *mvm, int queue, 360 - int mac80211_queue, u8 tid, u8 flags) 359 + static int iwl_mvm_disable_txq(struct iwl_mvm *mvm, struct ieee80211_sta *sta, 360 + int queue, u8 tid, u8 flags) 361 361 { 362 362 struct iwl_scd_txq_cfg_cmd cmd = { 363 363 .scd_queue = queue, 364 364 .action = SCD_CFG_DISABLE_QUEUE, 365 365 }; 366 - bool remove_mac_queue = mac80211_queue != IEEE80211_INVAL_HW_QUEUE; 367 366 int ret; 368 367 369 - if (WARN_ON(remove_mac_queue && mac80211_queue >= IEEE80211_MAX_QUEUES)) 370 - return -EINVAL; 371 - 372 368 if (iwl_mvm_has_new_tx_api(mvm)) { 373 - if (remove_mac_queue) 374 - mvm->hw_queue_to_mac80211[queue] &= 375 - ~BIT(mac80211_queue); 376 - 377 369 iwl_trans_txq_free(mvm->trans, queue); 378 370 379 371 return 0; ··· 376 384 377 385 mvm->queue_info[queue].tid_bitmap &= ~BIT(tid); 378 386 379 - /* 380 - * If there is another TID with the same AC - don't remove the MAC queue 381 - * from the mapping 382 - */ 383 - if (tid < IWL_MAX_TID_COUNT) { 384 - unsigned long tid_bitmap = 385 - mvm->queue_info[queue].tid_bitmap; 386 - int ac = tid_to_mac80211_ac[tid]; 387 - int i; 388 - 389 - for_each_set_bit(i, &tid_bitmap, IWL_MAX_TID_COUNT) { 390 - if (tid_to_mac80211_ac[i] == ac) 391 - remove_mac_queue = false; 392 - } 393 - } 394 - 395 - if (remove_mac_queue) 396 - mvm->hw_queue_to_mac80211[queue] &= 397 - ~BIT(mac80211_queue); 398 - 399 387 cmd.action = mvm->queue_info[queue].tid_bitmap ? 400 388 SCD_CFG_ENABLE_QUEUE : SCD_CFG_DISABLE_QUEUE; 401 389 if (cmd.action == SCD_CFG_DISABLE_QUEUE) 402 390 mvm->queue_info[queue].status = IWL_MVM_QUEUE_FREE; 403 391 404 392 IWL_DEBUG_TX_QUEUES(mvm, 405 - "Disabling TXQ #%d tids=0x%x (mac80211 map:0x%x)\n", 393 + "Disabling TXQ #%d tids=0x%x\n", 406 394 queue, 407 - mvm->queue_info[queue].tid_bitmap, 408 - mvm->hw_queue_to_mac80211[queue]); 395 + mvm->queue_info[queue].tid_bitmap); 409 396 410 397 /* If the queue is still enabled - nothing left to do in this func */ 411 398 if (cmd.action == SCD_CFG_ENABLE_QUEUE) ··· 394 423 cmd.tid = mvm->queue_info[queue].txq_tid; 395 424 396 425 /* Make sure queue info is correct even though we overwrite it */ 397 - WARN(mvm->queue_info[queue].tid_bitmap || 398 - mvm->hw_queue_to_mac80211[queue], 399 - "TXQ #%d info out-of-sync - mac map=0x%x, tids=0x%x\n", 400 - queue, mvm->hw_queue_to_mac80211[queue], 401 - mvm->queue_info[queue].tid_bitmap); 426 + WARN(mvm->queue_info[queue].tid_bitmap, 427 + "TXQ #%d info out-of-sync - tids=0x%x\n", 428 + queue, mvm->queue_info[queue].tid_bitmap); 402 429 403 430 /* If we are here - the queue is freed and we can zero out these vals */ 404 431 mvm->queue_info[queue].tid_bitmap = 0; 405 - mvm->hw_queue_to_mac80211[queue] = 0; 432 + 433 + if (sta) { 434 + struct iwl_mvm_txq *mvmtxq = 435 + iwl_mvm_txq_from_tid(sta, tid); 436 + 437 + mvmtxq->txq_id = IWL_MVM_INVALID_QUEUE; 438 + } 406 439 407 440 /* Regardless if this is a reserved TXQ for a STA - mark it as false */ 408 441 mvm->queue_info[queue].reserved = false; ··· 492 517 spin_lock_bh(&mvmsta->lock); 493 518 /* Unmap MAC queues and TIDs from this queue */ 494 519 for_each_set_bit(tid, &tid_bitmap, IWL_MAX_TID_COUNT + 1) { 520 + struct iwl_mvm_txq *mvmtxq = 521 + iwl_mvm_txq_from_tid(sta, tid); 522 + 495 523 if (mvmsta->tid_data[tid].state == IWL_AGG_ON) 496 524 disable_agg_tids |= BIT(tid); 497 525 mvmsta->tid_data[tid].txq_id = IWL_MVM_INVALID_QUEUE; 526 + 527 + mvmtxq->txq_id = IWL_MVM_INVALID_QUEUE; 498 528 } 499 529 500 530 mvmsta->tfd_queue_msk &= ~BIT(queue); /* Don't use this queue anymore */ ··· 521 541 } 522 542 523 543 static int iwl_mvm_free_inactive_queue(struct iwl_mvm *mvm, int queue, 544 + struct ieee80211_sta *old_sta, 524 545 u8 new_sta_id) 525 546 { 526 547 struct iwl_mvm_sta *mvmsta; 527 - u8 txq_curr_ac, sta_id, tid; 548 + u8 sta_id, tid; 528 549 unsigned long disable_agg_tids = 0; 529 550 bool same_sta; 530 551 int ret; ··· 535 554 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) 536 555 return -EINVAL; 537 556 538 - txq_curr_ac = mvm->queue_info[queue].mac80211_ac; 539 557 sta_id = mvm->queue_info[queue].ra_sta_id; 540 558 tid = mvm->queue_info[queue].txq_tid; 541 559 ··· 550 570 iwl_mvm_invalidate_sta_queue(mvm, queue, 551 571 disable_agg_tids, false); 552 572 553 - ret = iwl_mvm_disable_txq(mvm, queue, 554 - mvmsta->vif->hw_queue[txq_curr_ac], 555 - tid, 0); 573 + ret = iwl_mvm_disable_txq(mvm, old_sta, queue, tid, 0); 556 574 if (ret) { 557 575 IWL_ERR(mvm, 558 576 "Failed to free inactive queue %d (ret=%d)\n", ··· 640 662 * in such a case, otherwise - if no redirection required - it does nothing, 641 663 * unless the %force param is true. 642 664 */ 643 - static int iwl_mvm_scd_queue_redirect(struct iwl_mvm *mvm, int queue, int tid, 644 - int ac, int ssn, unsigned int wdg_timeout, 645 - bool force) 665 + static int iwl_mvm_redirect_queue(struct iwl_mvm *mvm, int queue, int tid, 666 + int ac, int ssn, unsigned int wdg_timeout, 667 + bool force, struct iwl_mvm_txq *txq) 646 668 { 647 669 struct iwl_scd_txq_cfg_cmd cmd = { 648 670 .scd_queue = queue, 649 671 .action = SCD_CFG_DISABLE_QUEUE, 650 672 }; 651 673 bool shared_queue; 652 - unsigned long mq; 653 674 int ret; 654 675 655 676 if (WARN_ON(iwl_mvm_has_new_tx_api(mvm))) ··· 672 695 cmd.sta_id = mvm->queue_info[queue].ra_sta_id; 673 696 cmd.tx_fifo = iwl_mvm_ac_to_tx_fifo[mvm->queue_info[queue].mac80211_ac]; 674 697 cmd.tid = mvm->queue_info[queue].txq_tid; 675 - mq = mvm->hw_queue_to_mac80211[queue]; 676 698 shared_queue = hweight16(mvm->queue_info[queue].tid_bitmap) > 1; 677 699 678 700 IWL_DEBUG_TX_QUEUES(mvm, "Redirecting TXQ #%d to FIFO #%d\n", 679 701 queue, iwl_mvm_ac_to_tx_fifo[ac]); 680 702 681 - /* Stop MAC queues and wait for this queue to empty */ 682 - iwl_mvm_stop_mac_queues(mvm, mq); 703 + /* Stop the queue and wait for it to empty */ 704 + txq->stopped = true; 705 + 683 706 ret = iwl_trans_wait_tx_queues_empty(mvm->trans, BIT(queue)); 684 707 if (ret) { 685 708 IWL_ERR(mvm, "Error draining queue %d before reconfig\n", ··· 720 743 iwl_trans_txq_set_shared_mode(mvm->trans, queue, true); 721 744 722 745 out: 723 - /* Continue using the MAC queues */ 724 - iwl_mvm_start_mac_queues(mvm, mq); 746 + /* Continue using the queue */ 747 + txq->stopped = false; 725 748 726 749 return ret; 727 750 } ··· 746 769 return -ENOSPC; 747 770 } 748 771 749 - static int iwl_mvm_tvqm_enable_txq(struct iwl_mvm *mvm, int mac80211_queue, 772 + static int iwl_mvm_tvqm_enable_txq(struct iwl_mvm *mvm, 750 773 u8 sta_id, u8 tid, unsigned int timeout) 751 774 { 752 775 int queue, size = IWL_DEFAULT_QUEUE_SIZE; ··· 769 792 IWL_DEBUG_TX_QUEUES(mvm, "Enabling TXQ #%d for sta %d tid %d\n", 770 793 queue, sta_id, tid); 771 794 772 - mvm->hw_queue_to_mac80211[queue] |= BIT(mac80211_queue); 773 - IWL_DEBUG_TX_QUEUES(mvm, 774 - "Enabling TXQ #%d (mac80211 map:0x%x)\n", 775 - queue, mvm->hw_queue_to_mac80211[queue]); 795 + IWL_DEBUG_TX_QUEUES(mvm, "Enabling TXQ #%d\n", queue); 776 796 777 797 return queue; 778 798 } ··· 779 805 int tid) 780 806 { 781 807 struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); 808 + struct iwl_mvm_txq *mvmtxq = 809 + iwl_mvm_txq_from_tid(sta, tid); 782 810 unsigned int wdg_timeout = 783 811 iwl_mvm_get_wd_timeout(mvm, mvmsta->vif, false, false); 784 - u8 mac_queue = mvmsta->vif->hw_queue[ac]; 785 812 int queue = -1; 786 813 787 814 lockdep_assert_held(&mvm->mutex); ··· 790 815 IWL_DEBUG_TX_QUEUES(mvm, 791 816 "Allocating queue for sta %d on tid %d\n", 792 817 mvmsta->sta_id, tid); 793 - queue = iwl_mvm_tvqm_enable_txq(mvm, mac_queue, mvmsta->sta_id, tid, 794 - wdg_timeout); 818 + queue = iwl_mvm_tvqm_enable_txq(mvm, mvmsta->sta_id, tid, wdg_timeout); 795 819 if (queue < 0) 796 820 return queue; 821 + 822 + if (sta) { 823 + mvmtxq->txq_id = queue; 824 + mvm->tvqm_info[queue].txq_tid = tid; 825 + mvm->tvqm_info[queue].sta_id = mvmsta->sta_id; 826 + } 797 827 798 828 IWL_DEBUG_TX_QUEUES(mvm, "Allocated queue is %d\n", queue); 799 829 ··· 809 829 return 0; 810 830 } 811 831 812 - static bool iwl_mvm_update_txq_mapping(struct iwl_mvm *mvm, int queue, 813 - int mac80211_queue, u8 sta_id, u8 tid) 832 + static bool iwl_mvm_update_txq_mapping(struct iwl_mvm *mvm, 833 + struct ieee80211_sta *sta, 834 + int queue, u8 sta_id, u8 tid) 814 835 { 815 836 bool enable_queue = true; 816 837 ··· 826 845 if (mvm->queue_info[queue].tid_bitmap) 827 846 enable_queue = false; 828 847 829 - if (mac80211_queue != IEEE80211_INVAL_HW_QUEUE) { 830 - WARN(mac80211_queue >= 831 - BITS_PER_BYTE * sizeof(mvm->hw_queue_to_mac80211[0]), 832 - "cannot track mac80211 queue %d (queue %d, sta %d, tid %d)\n", 833 - mac80211_queue, queue, sta_id, tid); 834 - mvm->hw_queue_to_mac80211[queue] |= BIT(mac80211_queue); 835 - } 836 - 837 848 mvm->queue_info[queue].tid_bitmap |= BIT(tid); 838 849 mvm->queue_info[queue].ra_sta_id = sta_id; 839 850 ··· 839 866 mvm->queue_info[queue].txq_tid = tid; 840 867 } 841 868 869 + if (sta) { 870 + struct iwl_mvm_txq *mvmtxq = 871 + iwl_mvm_txq_from_tid(sta, tid); 872 + 873 + mvmtxq->txq_id = queue; 874 + } 875 + 842 876 IWL_DEBUG_TX_QUEUES(mvm, 843 - "Enabling TXQ #%d tids=0x%x (mac80211 map:0x%x)\n", 844 - queue, mvm->queue_info[queue].tid_bitmap, 845 - mvm->hw_queue_to_mac80211[queue]); 877 + "Enabling TXQ #%d tids=0x%x\n", 878 + queue, mvm->queue_info[queue].tid_bitmap); 846 879 847 880 return enable_queue; 848 881 } 849 882 850 - static bool iwl_mvm_enable_txq(struct iwl_mvm *mvm, int queue, 851 - int mac80211_queue, u16 ssn, 883 + static bool iwl_mvm_enable_txq(struct iwl_mvm *mvm, struct ieee80211_sta *sta, 884 + int queue, u16 ssn, 852 885 const struct iwl_trans_txq_scd_cfg *cfg, 853 886 unsigned int wdg_timeout) 854 887 { ··· 874 895 return false; 875 896 876 897 /* Send the enabling command if we need to */ 877 - if (!iwl_mvm_update_txq_mapping(mvm, queue, mac80211_queue, 878 - cfg->sta_id, cfg->tid)) 898 + if (!iwl_mvm_update_txq_mapping(mvm, sta, queue, cfg->sta_id, cfg->tid)) 879 899 return false; 880 900 881 901 inc_ssn = iwl_trans_txq_enable_cfg(mvm->trans, queue, ssn, ··· 967 989 968 990 ssn = IEEE80211_SEQ_TO_SN(mvmsta->tid_data[tid].seq_number); 969 991 970 - ret = iwl_mvm_scd_queue_redirect(mvm, queue, tid, 971 - tid_to_mac80211_ac[tid], ssn, 972 - wdg_timeout, true); 992 + ret = iwl_mvm_redirect_queue(mvm, queue, tid, 993 + tid_to_mac80211_ac[tid], ssn, 994 + wdg_timeout, true, 995 + iwl_mvm_txq_from_tid(sta, tid)); 973 996 if (ret) { 974 997 IWL_ERR(mvm, "Failed to redirect TXQ %d\n", queue); 975 998 return; ··· 1047 1068 * Remove the ones that did. 1048 1069 */ 1049 1070 for_each_set_bit(tid, &tid_bitmap, IWL_MAX_TID_COUNT + 1) { 1050 - int mac_queue = mvmsta->vif->hw_queue[tid_to_mac80211_ac[tid]]; 1051 1071 u16 tid_bitmap; 1052 1072 1053 1073 mvmsta->tid_data[tid].txq_id = IWL_MVM_INVALID_QUEUE; 1054 - mvm->hw_queue_to_mac80211[queue] &= ~BIT(mac_queue); 1055 1074 mvm->queue_info[queue].tid_bitmap &= ~BIT(tid); 1056 1075 1057 1076 tid_bitmap = mvm->queue_info[queue].tid_bitmap; ··· 1082 1105 * sure all TIDs have existing corresponding mac queues enabled 1083 1106 */ 1084 1107 tid_bitmap = mvm->queue_info[queue].tid_bitmap; 1085 - for_each_set_bit(tid, &tid_bitmap, IWL_MAX_TID_COUNT + 1) { 1086 - mvm->hw_queue_to_mac80211[queue] |= 1087 - BIT(mvmsta->vif->hw_queue[tid_to_mac80211_ac[tid]]); 1088 - } 1089 1108 1090 1109 /* If the queue is marked as shared - "unshare" it */ 1091 1110 if (hweight16(mvm->queue_info[queue].tid_bitmap) == 1 && ··· 1109 1136 unsigned long unshare_queues = 0; 1110 1137 unsigned long changetid_queues = 0; 1111 1138 int i, ret, free_queue = -ENOSPC; 1139 + struct ieee80211_sta *queue_owner = NULL; 1112 1140 1113 1141 lockdep_assert_held(&mvm->mutex); 1114 1142 ··· 1175 1201 inactive_tid_bitmap, 1176 1202 &unshare_queues, 1177 1203 &changetid_queues); 1178 - if (ret >= 0 && free_queue < 0) 1204 + if (ret >= 0 && free_queue < 0) { 1205 + queue_owner = sta; 1179 1206 free_queue = ret; 1207 + } 1180 1208 /* only unlock sta lock - we still need the queue info lock */ 1181 1209 spin_unlock_bh(&mvmsta->lock); 1182 1210 } 1183 1211 1184 - rcu_read_unlock(); 1185 1212 1186 1213 /* Reconfigure queues requiring reconfiguation */ 1187 1214 for_each_set_bit(i, &unshare_queues, IWL_MAX_HW_QUEUES) ··· 1191 1216 iwl_mvm_change_queue_tid(mvm, i); 1192 1217 1193 1218 if (free_queue >= 0 && alloc_for_sta != IWL_MVM_INVALID_STA) { 1194 - ret = iwl_mvm_free_inactive_queue(mvm, free_queue, 1219 + ret = iwl_mvm_free_inactive_queue(mvm, free_queue, queue_owner, 1195 1220 alloc_for_sta); 1196 - if (ret) 1221 + if (ret) { 1222 + rcu_read_unlock(); 1197 1223 return ret; 1224 + } 1198 1225 } 1226 + 1227 + rcu_read_unlock(); 1199 1228 1200 1229 return free_queue; 1201 1230 } 1202 1231 1203 1232 static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm, 1204 - struct ieee80211_sta *sta, u8 ac, int tid, 1205 - struct ieee80211_hdr *hdr) 1233 + struct ieee80211_sta *sta, u8 ac, int tid) 1206 1234 { 1207 1235 struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); 1208 1236 struct iwl_trans_txq_scd_cfg cfg = { ··· 1216 1238 }; 1217 1239 unsigned int wdg_timeout = 1218 1240 iwl_mvm_get_wd_timeout(mvm, mvmsta->vif, false, false); 1219 - u8 mac_queue = mvmsta->vif->hw_queue[ac]; 1220 1241 int queue = -1; 1221 1242 unsigned long disable_agg_tids = 0; 1222 1243 enum iwl_mvm_agg_state queue_state; ··· 1234 1257 ssn = IEEE80211_SEQ_TO_SN(mvmsta->tid_data[tid].seq_number); 1235 1258 spin_unlock_bh(&mvmsta->lock); 1236 1259 1237 - /* 1238 - * Non-QoS, QoS NDP and MGMT frames should go to a MGMT queue, if one 1239 - * exists 1240 - */ 1241 - if (!ieee80211_is_data_qos(hdr->frame_control) || 1242 - ieee80211_is_qos_nullfunc(hdr->frame_control)) { 1260 + if (tid == IWL_MAX_TID_COUNT) { 1243 1261 queue = iwl_mvm_find_free_queue(mvm, mvmsta->sta_id, 1244 1262 IWL_MVM_DQA_MIN_MGMT_QUEUE, 1245 1263 IWL_MVM_DQA_MAX_MGMT_QUEUE); ··· 1313 1341 } 1314 1342 } 1315 1343 1316 - inc_ssn = iwl_mvm_enable_txq(mvm, queue, mac_queue, 1317 - ssn, &cfg, wdg_timeout); 1344 + inc_ssn = iwl_mvm_enable_txq(mvm, sta, queue, ssn, &cfg, wdg_timeout); 1318 1345 1319 1346 /* 1320 1347 * Mark queue as shared in transport if shared ··· 1355 1384 } 1356 1385 } else { 1357 1386 /* Redirect queue, if needed */ 1358 - ret = iwl_mvm_scd_queue_redirect(mvm, queue, tid, ac, ssn, 1359 - wdg_timeout, false); 1387 + ret = iwl_mvm_redirect_queue(mvm, queue, tid, ac, ssn, 1388 + wdg_timeout, false, 1389 + iwl_mvm_txq_from_tid(sta, tid)); 1360 1390 if (ret) 1361 1391 goto out_err; 1362 1392 } ··· 1365 1393 return 0; 1366 1394 1367 1395 out_err: 1368 - iwl_mvm_disable_txq(mvm, queue, mac_queue, tid, 0); 1396 + iwl_mvm_disable_txq(mvm, sta, queue, tid, 0); 1369 1397 1370 1398 return ret; 1371 1399 } ··· 1378 1406 return tid_to_mac80211_ac[tid]; 1379 1407 } 1380 1408 1381 - static void iwl_mvm_tx_deferred_stream(struct iwl_mvm *mvm, 1382 - struct ieee80211_sta *sta, int tid) 1383 - { 1384 - struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); 1385 - struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid]; 1386 - struct sk_buff *skb; 1387 - struct ieee80211_hdr *hdr; 1388 - struct sk_buff_head deferred_tx; 1389 - u8 mac_queue; 1390 - bool no_queue = false; /* Marks if there is a problem with the queue */ 1391 - u8 ac; 1392 - 1393 - lockdep_assert_held(&mvm->mutex); 1394 - 1395 - skb = skb_peek(&tid_data->deferred_tx_frames); 1396 - if (!skb) 1397 - return; 1398 - hdr = (void *)skb->data; 1399 - 1400 - ac = iwl_mvm_tid_to_ac_queue(tid); 1401 - mac_queue = IEEE80211_SKB_CB(skb)->hw_queue; 1402 - 1403 - if (tid_data->txq_id == IWL_MVM_INVALID_QUEUE && 1404 - iwl_mvm_sta_alloc_queue(mvm, sta, ac, tid, hdr)) { 1405 - IWL_ERR(mvm, 1406 - "Can't alloc TXQ for sta %d tid %d - dropping frame\n", 1407 - mvmsta->sta_id, tid); 1408 - 1409 - /* 1410 - * Mark queue as problematic so later the deferred traffic is 1411 - * freed, as we can do nothing with it 1412 - */ 1413 - no_queue = true; 1414 - } 1415 - 1416 - __skb_queue_head_init(&deferred_tx); 1417 - 1418 - /* Disable bottom-halves when entering TX path */ 1419 - local_bh_disable(); 1420 - spin_lock(&mvmsta->lock); 1421 - skb_queue_splice_init(&tid_data->deferred_tx_frames, &deferred_tx); 1422 - mvmsta->deferred_traffic_tid_map &= ~BIT(tid); 1423 - spin_unlock(&mvmsta->lock); 1424 - 1425 - while ((skb = __skb_dequeue(&deferred_tx))) 1426 - if (no_queue || iwl_mvm_tx_skb(mvm, skb, sta)) 1427 - ieee80211_free_txskb(mvm->hw, skb); 1428 - local_bh_enable(); 1429 - 1430 - /* Wake queue */ 1431 - iwl_mvm_start_mac_queues(mvm, BIT(mac_queue)); 1432 - } 1433 - 1434 1409 void iwl_mvm_add_new_dqa_stream_wk(struct work_struct *wk) 1435 1410 { 1436 1411 struct iwl_mvm *mvm = container_of(wk, struct iwl_mvm, 1437 1412 add_stream_wk); 1438 - struct ieee80211_sta *sta; 1439 - struct iwl_mvm_sta *mvmsta; 1440 - unsigned long deferred_tid_traffic; 1441 - int sta_id, tid; 1442 1413 1443 1414 mutex_lock(&mvm->mutex); 1444 1415 1445 1416 iwl_mvm_inactivity_check(mvm, IWL_MVM_INVALID_STA); 1446 1417 1447 - /* Go over all stations with deferred traffic */ 1448 - for_each_set_bit(sta_id, mvm->sta_deferred_frames, 1449 - IWL_MVM_STATION_COUNT) { 1450 - clear_bit(sta_id, mvm->sta_deferred_frames); 1451 - sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], 1452 - lockdep_is_held(&mvm->mutex)); 1453 - if (IS_ERR_OR_NULL(sta)) 1454 - continue; 1418 + while (!list_empty(&mvm->add_stream_txqs)) { 1419 + struct iwl_mvm_txq *mvmtxq; 1420 + struct ieee80211_txq *txq; 1421 + u8 tid; 1455 1422 1456 - mvmsta = iwl_mvm_sta_from_mac80211(sta); 1457 - deferred_tid_traffic = mvmsta->deferred_traffic_tid_map; 1423 + mvmtxq = list_first_entry(&mvm->add_stream_txqs, 1424 + struct iwl_mvm_txq, list); 1458 1425 1459 - for_each_set_bit(tid, &deferred_tid_traffic, 1460 - IWL_MAX_TID_COUNT + 1) 1461 - iwl_mvm_tx_deferred_stream(mvm, sta, tid); 1426 + txq = container_of((void *)mvmtxq, struct ieee80211_txq, 1427 + drv_priv); 1428 + tid = txq->tid; 1429 + if (tid == IEEE80211_NUM_TIDS) 1430 + tid = IWL_MAX_TID_COUNT; 1431 + 1432 + iwl_mvm_sta_alloc_queue(mvm, txq->sta, txq->ac, tid); 1433 + list_del_init(&mvmtxq->list); 1434 + iwl_mvm_mac_itxq_xmit(mvm->hw, txq); 1462 1435 } 1463 1436 1464 1437 mutex_unlock(&mvm->mutex); ··· 1459 1542 * Note that re-enabling aggregations isn't done in this function. 1460 1543 */ 1461 1544 static void iwl_mvm_realloc_queues_after_restart(struct iwl_mvm *mvm, 1462 - struct iwl_mvm_sta *mvm_sta) 1545 + struct ieee80211_sta *sta) 1463 1546 { 1464 - unsigned int wdg_timeout = 1465 - iwl_mvm_get_wd_timeout(mvm, mvm_sta->vif, false, false); 1547 + struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); 1548 + unsigned int wdg = 1549 + iwl_mvm_get_wd_timeout(mvm, mvm_sta->vif, false, false); 1466 1550 int i; 1467 1551 struct iwl_trans_txq_scd_cfg cfg = { 1468 1552 .sta_id = mvm_sta->sta_id, ··· 1479 1561 struct iwl_mvm_tid_data *tid_data = &mvm_sta->tid_data[i]; 1480 1562 int txq_id = tid_data->txq_id; 1481 1563 int ac; 1482 - u8 mac_queue; 1483 1564 1484 1565 if (txq_id == IWL_MVM_INVALID_QUEUE) 1485 1566 continue; 1486 1567 1487 - skb_queue_head_init(&tid_data->deferred_tx_frames); 1488 - 1489 1568 ac = tid_to_mac80211_ac[i]; 1490 - mac_queue = mvm_sta->vif->hw_queue[ac]; 1491 1569 1492 1570 if (iwl_mvm_has_new_tx_api(mvm)) { 1493 1571 IWL_DEBUG_TX_QUEUES(mvm, 1494 1572 "Re-mapping sta %d tid %d\n", 1495 1573 mvm_sta->sta_id, i); 1496 - txq_id = iwl_mvm_tvqm_enable_txq(mvm, mac_queue, 1497 - mvm_sta->sta_id, 1498 - i, wdg_timeout); 1574 + txq_id = iwl_mvm_tvqm_enable_txq(mvm, mvm_sta->sta_id, 1575 + i, wdg); 1499 1576 tid_data->txq_id = txq_id; 1500 1577 1501 1578 /* ··· 1513 1600 "Re-mapping sta %d tid %d to queue %d\n", 1514 1601 mvm_sta->sta_id, i, txq_id); 1515 1602 1516 - iwl_mvm_enable_txq(mvm, txq_id, mac_queue, seq, &cfg, 1517 - wdg_timeout); 1603 + iwl_mvm_enable_txq(mvm, sta, txq_id, seq, &cfg, wdg); 1518 1604 mvm->queue_info[txq_id].status = IWL_MVM_QUEUE_READY; 1519 1605 } 1520 1606 } ··· 1603 1691 if (ret) 1604 1692 goto err; 1605 1693 1606 - iwl_mvm_realloc_queues_after_restart(mvm, mvm_sta); 1694 + iwl_mvm_realloc_queues_after_restart(mvm, sta); 1607 1695 sta_update = true; 1608 1696 sta_flags = iwl_mvm_has_new_tx_api(mvm) ? 0 : STA_MODIFY_QUEUES; 1609 1697 goto update_fw; ··· 1636 1724 * frames until the queue is allocated 1637 1725 */ 1638 1726 mvm_sta->tid_data[i].txq_id = IWL_MVM_INVALID_QUEUE; 1639 - skb_queue_head_init(&mvm_sta->tid_data[i].deferred_tx_frames); 1640 1727 } 1641 - mvm_sta->deferred_traffic_tid_map = 0; 1728 + 1729 + for (i = 0; i < ARRAY_SIZE(sta->txq); i++) { 1730 + struct iwl_mvm_txq *mvmtxq = 1731 + iwl_mvm_txq_from_mac80211(sta->txq[i]); 1732 + 1733 + mvmtxq->txq_id = IWL_MVM_INVALID_QUEUE; 1734 + INIT_LIST_HEAD(&mvmtxq->list); 1735 + atomic_set(&mvmtxq->tx_request, 0); 1736 + } 1737 + 1642 1738 mvm_sta->agg_tids = 0; 1643 1739 1644 1740 if (iwl_mvm_has_new_rx_api(mvm) && ··· 1781 1861 1782 1862 static void iwl_mvm_disable_sta_queues(struct iwl_mvm *mvm, 1783 1863 struct ieee80211_vif *vif, 1784 - struct iwl_mvm_sta *mvm_sta) 1864 + struct ieee80211_sta *sta) 1785 1865 { 1786 - int ac; 1866 + struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); 1787 1867 int i; 1788 1868 1789 1869 lockdep_assert_held(&mvm->mutex); ··· 1792 1872 if (mvm_sta->tid_data[i].txq_id == IWL_MVM_INVALID_QUEUE) 1793 1873 continue; 1794 1874 1795 - ac = iwl_mvm_tid_to_ac_queue(i); 1796 - iwl_mvm_disable_txq(mvm, mvm_sta->tid_data[i].txq_id, 1797 - vif->hw_queue[ac], i, 0); 1875 + iwl_mvm_disable_txq(mvm, sta, mvm_sta->tid_data[i].txq_id, i, 1876 + 0); 1798 1877 mvm_sta->tid_data[i].txq_id = IWL_MVM_INVALID_QUEUE; 1878 + } 1879 + 1880 + for (i = 0; i < ARRAY_SIZE(sta->txq); i++) { 1881 + struct iwl_mvm_txq *mvmtxq = 1882 + iwl_mvm_txq_from_mac80211(sta->txq[i]); 1883 + 1884 + mvmtxq->txq_id = IWL_MVM_INVALID_QUEUE; 1799 1885 } 1800 1886 } 1801 1887 ··· 1864 1938 1865 1939 ret = iwl_mvm_drain_sta(mvm, mvm_sta, false); 1866 1940 1867 - iwl_mvm_disable_sta_queues(mvm, vif, mvm_sta); 1941 + iwl_mvm_disable_sta_queues(mvm, vif, sta); 1868 1942 1869 1943 /* If there is a TXQ still marked as reserved - free it */ 1870 1944 if (mvm_sta->reserved_queue != IEEE80211_INVAL_HW_QUEUE) { ··· 1970 2044 1971 2045 if (iwl_mvm_has_new_tx_api(mvm)) { 1972 2046 int tvqm_queue = 1973 - iwl_mvm_tvqm_enable_txq(mvm, *queue, sta_id, 2047 + iwl_mvm_tvqm_enable_txq(mvm, sta_id, 1974 2048 IWL_MAX_TID_COUNT, 1975 2049 wdg_timeout); 1976 2050 *queue = tvqm_queue; ··· 1983 2057 .frame_limit = IWL_FRAME_LIMIT, 1984 2058 }; 1985 2059 1986 - iwl_mvm_enable_txq(mvm, *queue, *queue, 0, &cfg, wdg_timeout); 2060 + iwl_mvm_enable_txq(mvm, NULL, *queue, 0, &cfg, wdg_timeout); 1987 2061 } 1988 2062 } 1989 2063 ··· 2061 2135 2062 2136 lockdep_assert_held(&mvm->mutex); 2063 2137 2064 - iwl_mvm_disable_txq(mvm, mvm->snif_queue, mvm->snif_queue, 2065 - IWL_MAX_TID_COUNT, 0); 2138 + iwl_mvm_disable_txq(mvm, NULL, mvm->snif_queue, IWL_MAX_TID_COUNT, 0); 2066 2139 ret = iwl_mvm_rm_sta_common(mvm, mvm->snif_sta.sta_id); 2067 2140 if (ret) 2068 2141 IWL_WARN(mvm, "Failed sending remove station\n"); ··· 2120 2195 2121 2196 bsta->tfd_queue_msk |= BIT(queue); 2122 2197 2123 - iwl_mvm_enable_txq(mvm, queue, vif->hw_queue[0], 0, 2124 - &cfg, wdg_timeout); 2198 + iwl_mvm_enable_txq(mvm, NULL, queue, 0, &cfg, wdg_timeout); 2125 2199 } 2126 2200 2127 2201 if (vif->type == NL80211_IFTYPE_ADHOC) ··· 2139 2215 * to firmware so enable queue here - after the station was added 2140 2216 */ 2141 2217 if (iwl_mvm_has_new_tx_api(mvm)) { 2142 - queue = iwl_mvm_tvqm_enable_txq(mvm, vif->hw_queue[0], 2143 - bsta->sta_id, 2218 + queue = iwl_mvm_tvqm_enable_txq(mvm, bsta->sta_id, 2144 2219 IWL_MAX_TID_COUNT, 2145 2220 wdg_timeout); 2146 2221 ··· 2177 2254 return; 2178 2255 } 2179 2256 2180 - iwl_mvm_disable_txq(mvm, queue, vif->hw_queue[0], IWL_MAX_TID_COUNT, 0); 2257 + iwl_mvm_disable_txq(mvm, NULL, queue, IWL_MAX_TID_COUNT, 0); 2181 2258 if (iwl_mvm_has_new_tx_api(mvm)) 2182 2259 return; 2183 2260 ··· 2300 2377 * Note that this is done here as we want to avoid making DQA 2301 2378 * changes in mac80211 layer. 2302 2379 */ 2303 - if (vif->type == NL80211_IFTYPE_ADHOC) { 2304 - vif->cab_queue = IWL_MVM_DQA_GCAST_QUEUE; 2305 - mvmvif->cab_queue = vif->cab_queue; 2306 - } 2380 + if (vif->type == NL80211_IFTYPE_ADHOC) 2381 + mvmvif->cab_queue = IWL_MVM_DQA_GCAST_QUEUE; 2307 2382 2308 2383 /* 2309 2384 * While in previous FWs we had to exclude cab queue from TFD queue ··· 2309 2388 */ 2310 2389 if (!iwl_mvm_has_new_tx_api(mvm) && 2311 2390 fw_has_api(&mvm->fw->ucode_capa, IWL_UCODE_TLV_API_STA_TYPE)) { 2312 - iwl_mvm_enable_txq(mvm, vif->cab_queue, vif->cab_queue, 0, 2313 - &cfg, timeout); 2314 - msta->tfd_queue_msk |= BIT(vif->cab_queue); 2391 + iwl_mvm_enable_txq(mvm, NULL, mvmvif->cab_queue, 0, &cfg, 2392 + timeout); 2393 + msta->tfd_queue_msk |= BIT(mvmvif->cab_queue); 2315 2394 } 2316 2395 ret = iwl_mvm_add_int_sta_common(mvm, msta, maddr, 2317 2396 mvmvif->id, mvmvif->color); ··· 2328 2407 * tfd_queue_mask. 2329 2408 */ 2330 2409 if (iwl_mvm_has_new_tx_api(mvm)) { 2331 - int queue = iwl_mvm_tvqm_enable_txq(mvm, vif->cab_queue, 2332 - msta->sta_id, 2410 + int queue = iwl_mvm_tvqm_enable_txq(mvm, msta->sta_id, 2333 2411 0, 2334 2412 timeout); 2335 2413 mvmvif->cab_queue = queue; 2336 2414 } else if (!fw_has_api(&mvm->fw->ucode_capa, 2337 2415 IWL_UCODE_TLV_API_STA_TYPE)) 2338 - iwl_mvm_enable_txq(mvm, vif->cab_queue, vif->cab_queue, 0, 2339 - &cfg, timeout); 2416 + iwl_mvm_enable_txq(mvm, NULL, mvmvif->cab_queue, 0, &cfg, 2417 + timeout); 2340 2418 2341 2419 if (mvmvif->ap_wep_key) { 2342 2420 u8 key_offset = iwl_mvm_set_fw_key_idx(mvm); ··· 2366 2446 2367 2447 iwl_mvm_flush_sta(mvm, &mvmvif->mcast_sta, true, 0); 2368 2448 2369 - iwl_mvm_disable_txq(mvm, mvmvif->cab_queue, vif->cab_queue, 2370 - 0, 0); 2449 + iwl_mvm_disable_txq(mvm, NULL, mvmvif->cab_queue, 0, 0); 2371 2450 2372 2451 ret = iwl_mvm_rm_sta_common(mvm, mvmvif->mcast_sta.sta_id); 2373 2452 if (ret) ··· 2700 2781 struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); 2701 2782 struct iwl_mvm_tid_data *tid_data; 2702 2783 u16 normalized_ssn; 2703 - int txq_id; 2784 + u16 txq_id; 2704 2785 int ret; 2705 2786 2706 2787 if (WARN_ON_ONCE(tid >= IWL_MAX_TID_COUNT)) ··· 2742 2823 */ 2743 2824 txq_id = mvmsta->tid_data[tid].txq_id; 2744 2825 if (txq_id == IWL_MVM_INVALID_QUEUE) { 2745 - txq_id = iwl_mvm_find_free_queue(mvm, mvmsta->sta_id, 2746 - IWL_MVM_DQA_MIN_DATA_QUEUE, 2747 - IWL_MVM_DQA_MAX_DATA_QUEUE); 2748 - if (txq_id < 0) { 2749 - ret = txq_id; 2826 + ret = iwl_mvm_find_free_queue(mvm, mvmsta->sta_id, 2827 + IWL_MVM_DQA_MIN_DATA_QUEUE, 2828 + IWL_MVM_DQA_MAX_DATA_QUEUE); 2829 + if (ret < 0) { 2750 2830 IWL_ERR(mvm, "Failed to allocate agg queue\n"); 2751 2831 goto out; 2752 2832 } 2753 2833 2834 + txq_id = ret; 2835 + 2754 2836 /* TXQ hasn't yet been enabled, so mark it only as reserved */ 2755 2837 mvm->queue_info[txq_id].status = IWL_MVM_QUEUE_RESERVED; 2838 + } else if (WARN_ON(txq_id >= IWL_MAX_HW_QUEUES)) { 2839 + ret = -ENXIO; 2840 + IWL_ERR(mvm, "tid_id %d out of range (0, %d)!\n", 2841 + tid, IWL_MAX_HW_QUEUES - 1); 2842 + goto out; 2843 + 2756 2844 } else if (unlikely(mvm->queue_info[txq_id].status == 2757 2845 IWL_MVM_QUEUE_SHARED)) { 2758 2846 ret = -ENXIO; ··· 2902 2976 } 2903 2977 2904 2978 if (alloc_queue) 2905 - iwl_mvm_enable_txq(mvm, queue, 2906 - vif->hw_queue[tid_to_mac80211_ac[tid]], ssn, 2979 + iwl_mvm_enable_txq(mvm, sta, queue, ssn, 2907 2980 &cfg, wdg_timeout); 2908 2981 2909 2982 /* Send ADD_STA command to enable aggs only if the queue isn't shared */
-4
drivers/net/wireless/intel/iwlwifi/mvm/sta.h
··· 297 297 298 298 /** 299 299 * struct iwl_mvm_tid_data - holds the states for each RA / TID 300 - * @deferred_tx_frames: deferred TX frames for this RA/TID 301 300 * @seq_number: the next WiFi sequence number to use 302 301 * @next_reclaimed: the WiFi sequence number of the next packet to be acked. 303 302 * This is basically (last acked packet++). ··· 317 318 * tpt_meas_start 318 319 */ 319 320 struct iwl_mvm_tid_data { 320 - struct sk_buff_head deferred_tx_frames; 321 321 u16 seq_number; 322 322 u16 next_reclaimed; 323 323 /* The rest is Tx AGG related */ ··· 424 426 struct ieee80211_vif *vif; 425 427 struct iwl_mvm_key_pn __rcu *ptk_pn[4]; 426 428 struct iwl_mvm_rxq_dup_data *dup_data; 427 - 428 - u16 deferred_traffic_tid_map; 429 429 430 430 u8 reserved_queue; 431 431
+15 -18
drivers/net/wireless/intel/iwlwifi/mvm/tdls.c
··· 399 399 struct ieee80211_tx_info *info; 400 400 struct ieee80211_hdr *hdr; 401 401 struct iwl_tdls_channel_switch_cmd cmd = {0}; 402 + struct iwl_tdls_channel_switch_cmd_tail *tail = 403 + iwl_mvm_chan_info_cmd_tail(mvm, &cmd.ci); 404 + u16 len = sizeof(cmd) - iwl_mvm_chan_info_padding(mvm); 402 405 int ret; 403 406 404 407 lockdep_assert_held(&mvm->mutex); ··· 417 414 } 418 415 419 416 cmd.switch_type = type; 420 - cmd.timing.frame_timestamp = cpu_to_le32(timestamp); 421 - cmd.timing.switch_time = cpu_to_le32(switch_time); 422 - cmd.timing.switch_timeout = cpu_to_le32(switch_timeout); 417 + tail->timing.frame_timestamp = cpu_to_le32(timestamp); 418 + tail->timing.switch_time = cpu_to_le32(switch_time); 419 + tail->timing.switch_timeout = cpu_to_le32(switch_timeout); 423 420 424 421 rcu_read_lock(); 425 422 sta = ieee80211_find_sta(vif, peer); ··· 451 448 } 452 449 } 453 450 454 - if (chandef) { 455 - cmd.ci.band = (chandef->chan->band == NL80211_BAND_2GHZ ? 456 - PHY_BAND_24 : PHY_BAND_5); 457 - cmd.ci.channel = chandef->chan->hw_value; 458 - cmd.ci.width = iwl_mvm_get_channel_width(chandef); 459 - cmd.ci.ctrl_pos = iwl_mvm_get_ctrl_pos(chandef); 460 - } 451 + if (chandef) 452 + iwl_mvm_set_chan_info_chandef(mvm, &cmd.ci, chandef); 461 453 462 454 /* keep quota calculation simple for now - 50% of DTIM for TDLS */ 463 - cmd.timing.max_offchan_duration = 455 + tail->timing.max_offchan_duration = 464 456 cpu_to_le32(TU_TO_US(vif->bss_conf.dtim_period * 465 457 vif->bss_conf.beacon_int) / 2); 466 458 467 459 /* Switch time is the first element in the switch-timing IE. */ 468 - cmd.frame.switch_time_offset = cpu_to_le32(ch_sw_tm_ie + 2); 460 + tail->frame.switch_time_offset = cpu_to_le32(ch_sw_tm_ie + 2); 469 461 470 462 info = IEEE80211_SKB_CB(skb); 471 463 hdr = (void *)skb->data; ··· 470 472 ret = -EINVAL; 471 473 goto out; 472 474 } 473 - iwl_mvm_set_tx_cmd_ccmp(info, &cmd.frame.tx_cmd); 475 + iwl_mvm_set_tx_cmd_ccmp(info, &tail->frame.tx_cmd); 474 476 } 475 477 476 - iwl_mvm_set_tx_cmd(mvm, skb, &cmd.frame.tx_cmd, info, 478 + iwl_mvm_set_tx_cmd(mvm, skb, &tail->frame.tx_cmd, info, 477 479 mvmsta->sta_id); 478 480 479 - iwl_mvm_set_tx_cmd_rate(mvm, &cmd.frame.tx_cmd, info, sta, 481 + iwl_mvm_set_tx_cmd_rate(mvm, &tail->frame.tx_cmd, info, sta, 480 482 hdr->frame_control); 481 483 rcu_read_unlock(); 482 484 483 - memcpy(cmd.frame.data, skb->data, skb->len); 485 + memcpy(tail->frame.data, skb->data, skb->len); 484 486 485 - ret = iwl_mvm_send_cmd_pdu(mvm, TDLS_CHANNEL_SWITCH_CMD, 0, 486 - sizeof(cmd), &cmd); 487 + ret = iwl_mvm_send_cmd_pdu(mvm, TDLS_CHANNEL_SWITCH_CMD, 0, len, &cmd); 487 488 if (ret) { 488 489 IWL_ERR(mvm, "Failed to send TDLS_CHANNEL_SWITCH cmd: %d\n", 489 490 ret);
+4 -1
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c
··· 334 334 switch (te_data->vif->type) { 335 335 case NL80211_IFTYPE_P2P_DEVICE: 336 336 ieee80211_remain_on_channel_expired(mvm->hw); 337 + set_bit(IWL_MVM_STATUS_NEED_FLUSH_P2P, &mvm->status); 337 338 iwl_mvm_roc_finished(mvm); 338 339 break; 339 340 case NL80211_IFTYPE_STATION: ··· 687 686 struct iwl_mvm_time_event_data *te_data) 688 687 { 689 688 struct iwl_hs20_roc_req aux_cmd = {}; 689 + u16 len = sizeof(aux_cmd) - iwl_mvm_chan_info_padding(mvm); 690 + 690 691 u32 uid; 691 692 int ret; 692 693 ··· 702 699 IWL_DEBUG_TE(mvm, "Removing BSS AUX ROC TE 0x%x\n", 703 700 le32_to_cpu(aux_cmd.event_unique_id)); 704 701 ret = iwl_mvm_send_cmd_pdu(mvm, HOT_SPOT_CMD, 0, 705 - sizeof(aux_cmd), &aux_cmd); 702 + len, &aux_cmd); 706 703 707 704 if (WARN_ON(ret)) 708 705 return;
-305
drivers/net/wireless/intel/iwlwifi/mvm/tof.c
··· 1 - /****************************************************************************** 2 - * 3 - * This file is provided under a dual BSD/GPLv2 license. When using or 4 - * redistributing this file, you may do so under either license. 5 - * 6 - * GPL LICENSE SUMMARY 7 - * 8 - * Copyright(c) 2015 Intel Deutschland GmbH 9 - * 10 - * This program is free software; you can redistribute it and/or modify 11 - * it under the terms of version 2 of the GNU General Public License as 12 - * published by the Free Software Foundation. 13 - * 14 - * This program is distributed in the hope that it will be useful, but 15 - * WITHOUT ANY WARRANTY; without even the implied warranty of 16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 - * General Public License for more details. 18 - * 19 - * The full GNU General Public License is included in this distribution 20 - * in the file called COPYING. 21 - * 22 - * Contact Information: 23 - * Intel Linux Wireless <linuxwifi@intel.com> 24 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 25 - * 26 - * BSD LICENSE 27 - * 28 - * Copyright(c) 2015 Intel Deutschland GmbH 29 - * All rights reserved. 30 - * 31 - * Redistribution and use in source and binary forms, with or without 32 - * modification, are permitted provided that the following conditions 33 - * are met: 34 - * 35 - * * Redistributions of source code must retain the above copyright 36 - * notice, this list of conditions and the following disclaimer. 37 - * * Redistributions in binary form must reproduce the above copyright 38 - * notice, this list of conditions and the following disclaimer in 39 - * the documentation and/or other materials provided with the 40 - * distribution. 41 - * * Neither the name Intel Corporation nor the names of its 42 - * contributors may be used to endorse or promote products derived 43 - * from this software without specific prior written permission. 44 - * 45 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 46 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 47 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 48 - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 49 - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 50 - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 51 - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 52 - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 53 - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 54 - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 55 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 56 - * 57 - *****************************************************************************/ 58 - #include "mvm.h" 59 - #include "fw/api/tof.h" 60 - 61 - #define IWL_MVM_TOF_RANGE_REQ_MAX_ID 256 62 - 63 - void iwl_mvm_tof_init(struct iwl_mvm *mvm) 64 - { 65 - struct iwl_mvm_tof_data *tof_data = &mvm->tof_data; 66 - 67 - if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TOF_SUPPORT)) 68 - return; 69 - 70 - memset(tof_data, 0, sizeof(*tof_data)); 71 - 72 - tof_data->tof_cfg.sub_grp_cmd_id = cpu_to_le32(TOF_CONFIG_CMD); 73 - 74 - #ifdef CONFIG_IWLWIFI_DEBUGFS 75 - if (IWL_MVM_TOF_IS_RESPONDER) { 76 - tof_data->responder_cfg.sub_grp_cmd_id = 77 - cpu_to_le32(TOF_RESPONDER_CONFIG_CMD); 78 - tof_data->responder_cfg.sta_id = IWL_MVM_INVALID_STA; 79 - } 80 - #endif 81 - 82 - tof_data->range_req.sub_grp_cmd_id = cpu_to_le32(TOF_RANGE_REQ_CMD); 83 - tof_data->range_req.req_timeout = 1; 84 - tof_data->range_req.initiator = 1; 85 - tof_data->range_req.report_policy = 3; 86 - 87 - tof_data->range_req_ext.sub_grp_cmd_id = 88 - cpu_to_le32(TOF_RANGE_REQ_EXT_CMD); 89 - 90 - mvm->tof_data.active_range_request = IWL_MVM_TOF_RANGE_REQ_MAX_ID; 91 - mvm->init_status |= IWL_MVM_INIT_STATUS_TOF_INIT_COMPLETE; 92 - } 93 - 94 - void iwl_mvm_tof_clean(struct iwl_mvm *mvm) 95 - { 96 - struct iwl_mvm_tof_data *tof_data = &mvm->tof_data; 97 - 98 - if (!fw_has_capa(&mvm->fw->ucode_capa, 99 - IWL_UCODE_TLV_CAPA_TOF_SUPPORT) || 100 - !(mvm->init_status & IWL_MVM_INIT_STATUS_TOF_INIT_COMPLETE)) 101 - return; 102 - 103 - memset(tof_data, 0, sizeof(*tof_data)); 104 - mvm->tof_data.active_range_request = IWL_MVM_TOF_RANGE_REQ_MAX_ID; 105 - mvm->init_status &= ~IWL_MVM_INIT_STATUS_TOF_INIT_COMPLETE; 106 - } 107 - 108 - static void iwl_tof_iterator(void *_data, u8 *mac, 109 - struct ieee80211_vif *vif) 110 - { 111 - bool *enabled = _data; 112 - 113 - /* non bss vif exists */ 114 - if (ieee80211_vif_type_p2p(vif) != NL80211_IFTYPE_STATION) 115 - *enabled = false; 116 - } 117 - 118 - int iwl_mvm_tof_config_cmd(struct iwl_mvm *mvm) 119 - { 120 - struct iwl_tof_config_cmd *cmd = &mvm->tof_data.tof_cfg; 121 - bool enabled; 122 - 123 - lockdep_assert_held(&mvm->mutex); 124 - 125 - if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TOF_SUPPORT)) 126 - return -EINVAL; 127 - 128 - ieee80211_iterate_active_interfaces_atomic(mvm->hw, 129 - IEEE80211_IFACE_ITER_NORMAL, 130 - iwl_tof_iterator, &enabled); 131 - if (!enabled) { 132 - IWL_DEBUG_INFO(mvm, "ToF is not supported (non bss vif)\n"); 133 - return -EINVAL; 134 - } 135 - 136 - mvm->tof_data.active_range_request = IWL_MVM_TOF_RANGE_REQ_MAX_ID; 137 - return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_CMD, 138 - IWL_ALWAYS_LONG_GROUP, 0), 139 - 0, sizeof(*cmd), cmd); 140 - } 141 - 142 - int iwl_mvm_tof_range_abort_cmd(struct iwl_mvm *mvm, u8 id) 143 - { 144 - struct iwl_tof_range_abort_cmd cmd = { 145 - .sub_grp_cmd_id = cpu_to_le32(TOF_RANGE_ABORT_CMD), 146 - .request_id = id, 147 - }; 148 - 149 - lockdep_assert_held(&mvm->mutex); 150 - 151 - if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TOF_SUPPORT)) 152 - return -EINVAL; 153 - 154 - if (id != mvm->tof_data.active_range_request) { 155 - IWL_ERR(mvm, "Invalid range request id %d (active %d)\n", 156 - id, mvm->tof_data.active_range_request); 157 - return -EINVAL; 158 - } 159 - 160 - /* after abort is sent there's no active request anymore */ 161 - mvm->tof_data.active_range_request = IWL_MVM_TOF_RANGE_REQ_MAX_ID; 162 - 163 - return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_CMD, 164 - IWL_ALWAYS_LONG_GROUP, 0), 165 - 0, sizeof(cmd), &cmd); 166 - } 167 - 168 - #ifdef CONFIG_IWLWIFI_DEBUGFS 169 - int iwl_mvm_tof_responder_cmd(struct iwl_mvm *mvm, 170 - struct ieee80211_vif *vif) 171 - { 172 - struct iwl_tof_responder_config_cmd *cmd = &mvm->tof_data.responder_cfg; 173 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 174 - 175 - lockdep_assert_held(&mvm->mutex); 176 - 177 - if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TOF_SUPPORT)) 178 - return -EINVAL; 179 - 180 - if (vif->p2p || vif->type != NL80211_IFTYPE_AP || 181 - !mvmvif->ap_ibss_active) { 182 - IWL_ERR(mvm, "Cannot start responder, not in AP mode\n"); 183 - return -EIO; 184 - } 185 - 186 - cmd->sta_id = mvmvif->bcast_sta.sta_id; 187 - memcpy(cmd->bssid, vif->addr, ETH_ALEN); 188 - return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_CMD, 189 - IWL_ALWAYS_LONG_GROUP, 0), 190 - 0, sizeof(*cmd), cmd); 191 - } 192 - #endif 193 - 194 - int iwl_mvm_tof_range_request_cmd(struct iwl_mvm *mvm, 195 - struct ieee80211_vif *vif) 196 - { 197 - struct iwl_host_cmd cmd = { 198 - .id = iwl_cmd_id(TOF_CMD, IWL_ALWAYS_LONG_GROUP, 0), 199 - .len = { sizeof(mvm->tof_data.range_req), }, 200 - /* no copy because of the command size */ 201 - .dataflags = { IWL_HCMD_DFL_NOCOPY, }, 202 - }; 203 - 204 - lockdep_assert_held(&mvm->mutex); 205 - 206 - if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TOF_SUPPORT)) 207 - return -EINVAL; 208 - 209 - if (ieee80211_vif_type_p2p(vif) != NL80211_IFTYPE_STATION) { 210 - IWL_ERR(mvm, "Cannot send range request, not STA mode\n"); 211 - return -EIO; 212 - } 213 - 214 - /* nesting of range requests is not supported in FW */ 215 - if (mvm->tof_data.active_range_request != 216 - IWL_MVM_TOF_RANGE_REQ_MAX_ID) { 217 - IWL_ERR(mvm, "Cannot send range req, already active req %d\n", 218 - mvm->tof_data.active_range_request); 219 - return -EIO; 220 - } 221 - 222 - mvm->tof_data.active_range_request = mvm->tof_data.range_req.request_id; 223 - 224 - cmd.data[0] = &mvm->tof_data.range_req; 225 - return iwl_mvm_send_cmd(mvm, &cmd); 226 - } 227 - 228 - int iwl_mvm_tof_range_request_ext_cmd(struct iwl_mvm *mvm, 229 - struct ieee80211_vif *vif) 230 - { 231 - lockdep_assert_held(&mvm->mutex); 232 - 233 - if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TOF_SUPPORT)) 234 - return -EINVAL; 235 - 236 - if (ieee80211_vif_type_p2p(vif) != NL80211_IFTYPE_STATION) { 237 - IWL_ERR(mvm, "Cannot send ext range req, not in STA mode\n"); 238 - return -EIO; 239 - } 240 - 241 - return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_CMD, 242 - IWL_ALWAYS_LONG_GROUP, 0), 243 - 0, sizeof(mvm->tof_data.range_req_ext), 244 - &mvm->tof_data.range_req_ext); 245 - } 246 - 247 - static int iwl_mvm_tof_range_resp(struct iwl_mvm *mvm, void *data) 248 - { 249 - struct iwl_tof_range_rsp_ntfy *resp = (void *)data; 250 - 251 - if (resp->request_id != mvm->tof_data.active_range_request) { 252 - IWL_ERR(mvm, "Request id mismatch, got %d, active %d\n", 253 - resp->request_id, mvm->tof_data.active_range_request); 254 - return -EIO; 255 - } 256 - 257 - memcpy(&mvm->tof_data.range_resp, resp, 258 - sizeof(struct iwl_tof_range_rsp_ntfy)); 259 - mvm->tof_data.active_range_request = IWL_MVM_TOF_RANGE_REQ_MAX_ID; 260 - 261 - return 0; 262 - } 263 - 264 - static int iwl_mvm_tof_mcsi_notif(struct iwl_mvm *mvm, void *data) 265 - { 266 - struct iwl_tof_mcsi_notif *resp = (struct iwl_tof_mcsi_notif *)data; 267 - 268 - IWL_DEBUG_INFO(mvm, "MCSI notification, token %d\n", resp->token); 269 - return 0; 270 - } 271 - 272 - static int iwl_mvm_tof_nb_report_notif(struct iwl_mvm *mvm, void *data) 273 - { 274 - struct iwl_tof_neighbor_report *report = 275 - (struct iwl_tof_neighbor_report *)data; 276 - 277 - IWL_DEBUG_INFO(mvm, "NB report, bssid %pM, token %d, status 0x%x\n", 278 - report->bssid, report->request_token, report->status); 279 - return 0; 280 - } 281 - 282 - void iwl_mvm_tof_resp_handler(struct iwl_mvm *mvm, 283 - struct iwl_rx_cmd_buffer *rxb) 284 - { 285 - struct iwl_rx_packet *pkt = rxb_addr(rxb); 286 - struct iwl_tof_gen_resp_cmd *resp = (void *)pkt->data; 287 - 288 - lockdep_assert_held(&mvm->mutex); 289 - 290 - switch (le32_to_cpu(resp->sub_grp_cmd_id)) { 291 - case TOF_RANGE_RESPONSE_NOTIF: 292 - iwl_mvm_tof_range_resp(mvm, resp->data); 293 - break; 294 - case TOF_MCSI_DEBUG_NOTIF: 295 - iwl_mvm_tof_mcsi_notif(mvm, resp->data); 296 - break; 297 - case TOF_NEIGHBOR_REPORT_RSP_NOTIF: 298 - iwl_mvm_tof_nb_report_notif(mvm, resp->data); 299 - break; 300 - default: 301 - IWL_ERR(mvm, "Unknown sub-group command 0x%x\n", 302 - resp->sub_grp_cmd_id); 303 - break; 304 - } 305 - }
-89
drivers/net/wireless/intel/iwlwifi/mvm/tof.h
··· 1 - /****************************************************************************** 2 - * 3 - * This file is provided under a dual BSD/GPLv2 license. When using or 4 - * redistributing this file, you may do so under either license. 5 - * 6 - * GPL LICENSE SUMMARY 7 - * 8 - * Copyright(c) 2015 Intel Deutschland GmbH 9 - * 10 - * This program is free software; you can redistribute it and/or modify 11 - * it under the terms of version 2 of the GNU General Public License as 12 - * published by the Free Software Foundation. 13 - * 14 - * This program is distributed in the hope that it will be useful, but 15 - * WITHOUT ANY WARRANTY; without even the implied warranty of 16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 - * General Public License for more details. 18 - * 19 - * The full GNU General Public License is included in this distribution 20 - * in the file called COPYING. 21 - * 22 - * Contact Information: 23 - * Intel Linux Wireless <linuxwifi@intel.com> 24 - * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 25 - * 26 - * BSD LICENSE 27 - * 28 - * Copyright(c) 2015 Intel Deutschland GmbH 29 - * All rights reserved. 30 - * 31 - * Redistribution and use in source and binary forms, with or without 32 - * modification, are permitted provided that the following conditions 33 - * are met: 34 - * 35 - * * Redistributions of source code must retain the above copyright 36 - * notice, this list of conditions and the following disclaimer. 37 - * * Redistributions in binary form must reproduce the above copyright 38 - * notice, this list of conditions and the following disclaimer in 39 - * the documentation and/or other materials provided with the 40 - * distribution. 41 - * * Neither the name Intel Corporation nor the names of its 42 - * contributors may be used to endorse or promote products derived 43 - * from this software without specific prior written permission. 44 - * 45 - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 46 - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 47 - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 48 - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 49 - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 50 - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 51 - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 52 - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 53 - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 54 - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 55 - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 56 - * 57 - *****************************************************************************/ 58 - #ifndef __tof_h__ 59 - #define __tof_h__ 60 - 61 - #include "fw/api/tof.h" 62 - 63 - struct iwl_mvm_tof_data { 64 - struct iwl_tof_config_cmd tof_cfg; 65 - struct iwl_tof_range_req_cmd range_req; 66 - struct iwl_tof_range_req_ext_cmd range_req_ext; 67 - #ifdef CONFIG_IWLWIFI_DEBUGFS 68 - struct iwl_tof_responder_config_cmd responder_cfg; 69 - #endif 70 - struct iwl_tof_range_rsp_ntfy range_resp; 71 - u8 last_abort_id; 72 - u16 active_range_request; 73 - }; 74 - 75 - void iwl_mvm_tof_init(struct iwl_mvm *mvm); 76 - void iwl_mvm_tof_clean(struct iwl_mvm *mvm); 77 - int iwl_mvm_tof_config_cmd(struct iwl_mvm *mvm); 78 - int iwl_mvm_tof_range_abort_cmd(struct iwl_mvm *mvm, u8 id); 79 - int iwl_mvm_tof_range_request_cmd(struct iwl_mvm *mvm, 80 - struct ieee80211_vif *vif); 81 - void iwl_mvm_tof_resp_handler(struct iwl_mvm *mvm, 82 - struct iwl_rx_cmd_buffer *rxb); 83 - int iwl_mvm_tof_range_request_ext_cmd(struct iwl_mvm *mvm, 84 - struct ieee80211_vif *vif); 85 - #ifdef CONFIG_IWLWIFI_DEBUGFS 86 - int iwl_mvm_tof_responder_cmd(struct iwl_mvm *mvm, 87 - struct ieee80211_vif *vif); 88 - #endif 89 - #endif /* __tof_h__ */
+69 -92
drivers/net/wireless/intel/iwlwifi/mvm/tx.c
··· 533 533 534 534 /* 535 535 * For data packets rate info comes from the fw. Only 536 - * set rate/antenna during connection establishment. 536 + * set rate/antenna during connection establishment or in case 537 + * no station is given. 537 538 */ 538 - if (sta && (!ieee80211_is_data(hdr->frame_control) || 539 - mvmsta->sta_state < IEEE80211_STA_AUTHORIZED)) { 539 + if (!sta || !ieee80211_is_data(hdr->frame_control) || 540 + mvmsta->sta_state < IEEE80211_STA_AUTHORIZED) { 540 541 flags |= IWL_TX_FLAGS_CMD_RATE; 541 542 rate_n_flags = 542 543 iwl_mvm_get_tx_rate_n_flags(mvm, info, sta, ··· 603 602 } 604 603 605 604 static int iwl_mvm_get_ctrl_vif_queue(struct iwl_mvm *mvm, 606 - struct ieee80211_tx_info *info, __le16 fc) 605 + struct ieee80211_tx_info *info, 606 + struct ieee80211_hdr *hdr) 607 607 { 608 - struct iwl_mvm_vif *mvmvif; 609 - 610 - mvmvif = iwl_mvm_vif_from_mac80211(info->control.vif); 608 + struct iwl_mvm_vif *mvmvif = 609 + iwl_mvm_vif_from_mac80211(info->control.vif); 610 + __le16 fc = hdr->frame_control; 611 611 612 612 switch (info->control.vif->type) { 613 613 case NL80211_IFTYPE_AP: ··· 627 625 (!ieee80211_is_bufferable_mmpdu(fc) || 628 626 ieee80211_is_deauth(fc) || ieee80211_is_disassoc(fc))) 629 627 return mvm->probe_queue; 630 - if (info->hw_queue == info->control.vif->cab_queue) 628 + 629 + if (!ieee80211_has_order(fc) && !ieee80211_is_probe_req(fc) && 630 + is_multicast_ether_addr(hdr->addr1)) 631 631 return mvmvif->cab_queue; 632 632 633 633 WARN_ONCE(info->control.vif->type != NL80211_IFTYPE_ADHOC, ··· 638 634 case NL80211_IFTYPE_P2P_DEVICE: 639 635 if (ieee80211_is_mgmt(fc)) 640 636 return mvm->p2p_dev_queue; 641 - if (info->hw_queue == info->control.vif->cab_queue) 642 - return mvmvif->cab_queue; 643 637 644 638 WARN_ON_ONCE(1); 645 639 return mvm->p2p_dev_queue; ··· 715 713 u8 sta_id; 716 714 int hdrlen = ieee80211_hdrlen(hdr->frame_control); 717 715 __le16 fc = hdr->frame_control; 716 + bool offchannel = IEEE80211_SKB_CB(skb)->flags & 717 + IEEE80211_TX_CTL_TX_OFFCHAN; 718 718 int queue = -1; 719 719 720 720 memcpy(&info, skb->cb, sizeof(info)); 721 721 722 722 if (WARN_ON_ONCE(info.flags & IEEE80211_TX_CTL_AMPDU)) 723 - return -1; 724 - 725 - if (WARN_ON_ONCE(info.flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM && 726 - (!info.control.vif || 727 - info.hw_queue != info.control.vif->cab_queue))) 728 723 return -1; 729 724 730 725 if (info.control.vif) { ··· 736 737 else 737 738 sta_id = mvmvif->mcast_sta.sta_id; 738 739 739 - queue = iwl_mvm_get_ctrl_vif_queue(mvm, &info, 740 - hdr->frame_control); 741 - 740 + queue = iwl_mvm_get_ctrl_vif_queue(mvm, &info, hdr); 742 741 } else if (info.control.vif->type == NL80211_IFTYPE_MONITOR) { 743 742 queue = mvm->snif_queue; 744 743 sta_id = mvm->snif_sta.sta_id; 745 744 } else if (info.control.vif->type == NL80211_IFTYPE_STATION && 746 - info.hw_queue == IWL_MVM_OFFCHANNEL_QUEUE) { 745 + offchannel) { 747 746 /* 748 747 * IWL_MVM_OFFCHANNEL_QUEUE is used for ROC packets 749 748 * that can be used in 2 different types of vifs, P2P & ··· 755 758 } 756 759 } 757 760 758 - if (queue < 0) 761 + if (queue < 0) { 762 + IWL_ERR(mvm, "No queue was found. Dropping TX\n"); 759 763 return -1; 764 + } 760 765 761 766 if (unlikely(ieee80211_is_probe_resp(fc))) 762 767 iwl_mvm_probe_resp_set_noa(mvm, skb); ··· 778 779 } 779 780 780 781 return 0; 782 + } 783 + 784 + unsigned int iwl_mvm_max_amsdu_size(struct iwl_mvm *mvm, 785 + struct ieee80211_sta *sta, unsigned int tid) 786 + { 787 + struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); 788 + enum nl80211_band band = mvmsta->vif->bss_conf.chandef.chan->band; 789 + u8 ac = tid_to_mac80211_ac[tid]; 790 + unsigned int txf; 791 + int lmac = IWL_LMAC_24G_INDEX; 792 + 793 + if (iwl_mvm_is_cdb_supported(mvm) && 794 + band == NL80211_BAND_5GHZ) 795 + lmac = IWL_LMAC_5G_INDEX; 796 + 797 + /* For HE redirect to trigger based fifos */ 798 + if (sta->he_cap.has_he && !WARN_ON(!iwl_mvm_has_new_tx_api(mvm))) 799 + ac += 4; 800 + 801 + txf = iwl_mvm_mac_ac_to_tx_fifo(mvm, ac); 802 + 803 + /* 804 + * Don't send an AMSDU that will be longer than the TXF. 805 + * Add a security margin of 256 for the TX command + headers. 806 + * We also want to have the start of the next packet inside the 807 + * fifo to be able to send bursts. 808 + */ 809 + return min_t(unsigned int, mvmsta->max_amsdu_len, 810 + mvm->fwrt.smem_cfg.lmac[lmac].txfifo_size[txf] - 256); 781 811 } 782 812 783 813 #ifdef CONFIG_INET ··· 876 848 } 877 849 878 850 return 0; 879 - } 880 - 881 - static unsigned int iwl_mvm_max_amsdu_size(struct iwl_mvm *mvm, 882 - struct ieee80211_sta *sta, 883 - unsigned int tid) 884 - { 885 - struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); 886 - enum nl80211_band band = mvmsta->vif->bss_conf.chandef.chan->band; 887 - u8 ac = tid_to_mac80211_ac[tid]; 888 - unsigned int txf; 889 - int lmac = IWL_LMAC_24G_INDEX; 890 - 891 - if (iwl_mvm_is_cdb_supported(mvm) && 892 - band == NL80211_BAND_5GHZ) 893 - lmac = IWL_LMAC_5G_INDEX; 894 - 895 - /* For HE redirect to trigger based fifos */ 896 - if (sta->he_cap.has_he && !WARN_ON(!iwl_mvm_has_new_tx_api(mvm))) 897 - ac += 4; 898 - 899 - txf = iwl_mvm_mac_ac_to_tx_fifo(mvm, ac); 900 - 901 - /* 902 - * Don't send an AMSDU that will be longer than the TXF. 903 - * Add a security margin of 256 for the TX command + headers. 904 - * We also want to have the start of the next packet inside the 905 - * fifo to be able to send bursts. 906 - */ 907 - return min_t(unsigned int, mvmsta->max_amsdu_len, 908 - mvm->fwrt.smem_cfg.lmac[lmac].txfifo_size[txf] - 256); 909 851 } 910 852 911 853 static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb, ··· 1000 1002 } 1001 1003 #endif 1002 1004 1003 - static void iwl_mvm_tx_add_stream(struct iwl_mvm *mvm, 1004 - struct iwl_mvm_sta *mvm_sta, u8 tid, 1005 - struct sk_buff *skb) 1006 - { 1007 - struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1008 - u8 mac_queue = info->hw_queue; 1009 - struct sk_buff_head *deferred_tx_frames; 1010 - 1011 - lockdep_assert_held(&mvm_sta->lock); 1012 - 1013 - mvm_sta->deferred_traffic_tid_map |= BIT(tid); 1014 - set_bit(mvm_sta->sta_id, mvm->sta_deferred_frames); 1015 - 1016 - deferred_tx_frames = &mvm_sta->tid_data[tid].deferred_tx_frames; 1017 - 1018 - skb_queue_tail(deferred_tx_frames, skb); 1019 - 1020 - /* 1021 - * The first deferred frame should've stopped the MAC queues, so we 1022 - * should never get a second deferred frame for the RA/TID. 1023 - * In case of GSO the first packet may have been split, so don't warn. 1024 - */ 1025 - if (skb_queue_len(deferred_tx_frames) == 1) { 1026 - iwl_mvm_stop_mac_queues(mvm, BIT(mac_queue)); 1027 - schedule_work(&mvm->add_stream_wk); 1028 - } 1029 - } 1030 - 1031 1005 /* Check if there are any timed-out TIDs on a given shared TXQ */ 1032 1006 static bool iwl_mvm_txq_should_update(struct iwl_mvm *mvm, int txq_id) 1033 1007 { ··· 1024 1054 int airtime) 1025 1055 { 1026 1056 int mac = mvmsta->mac_id_n_color & FW_CTXT_ID_MSK; 1027 - struct iwl_mvm_tcm_mac *mdata = &mvm->tcm.data[mac]; 1057 + struct iwl_mvm_tcm_mac *mdata; 1058 + 1059 + if (mac >= NUM_MAC_INDEX_DRIVER) 1060 + return; 1061 + 1062 + mdata = &mvm->tcm.data[mac]; 1028 1063 1029 1064 if (mvm->tcm.paused) 1030 1065 return; ··· 1040 1065 mdata->tx.airtime += airtime; 1041 1066 } 1042 1067 1043 - static void iwl_mvm_tx_pkt_queued(struct iwl_mvm *mvm, 1044 - struct iwl_mvm_sta *mvmsta, int tid) 1068 + static int iwl_mvm_tx_pkt_queued(struct iwl_mvm *mvm, 1069 + struct iwl_mvm_sta *mvmsta, int tid) 1045 1070 { 1046 1071 u32 ac = tid_to_mac80211_ac[tid]; 1047 1072 int mac = mvmsta->mac_id_n_color & FW_CTXT_ID_MSK; 1048 - struct iwl_mvm_tcm_mac *mdata = &mvm->tcm.data[mac]; 1073 + struct iwl_mvm_tcm_mac *mdata; 1074 + 1075 + if (mac >= NUM_MAC_INDEX_DRIVER) 1076 + return -EINVAL; 1077 + 1078 + mdata = &mvm->tcm.data[mac]; 1049 1079 1050 1080 mdata->tx.pkts[ac]++; 1081 + 1082 + return 0; 1051 1083 } 1052 1084 1053 1085 /* ··· 1070 1088 __le16 fc; 1071 1089 u16 seq_number = 0; 1072 1090 u8 tid = IWL_MAX_TID_COUNT; 1073 - u16 txq_id = info->hw_queue; 1091 + u16 txq_id; 1074 1092 bool is_ampdu = false; 1075 1093 int hdrlen; 1076 1094 ··· 1134 1152 1135 1153 WARN_ON_ONCE(info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM); 1136 1154 1137 - /* Check if TXQ needs to be allocated or re-activated */ 1138 - if (unlikely(txq_id == IWL_MVM_INVALID_QUEUE)) { 1139 - iwl_mvm_tx_add_stream(mvm, mvmsta, tid, skb); 1140 - 1141 - /* 1142 - * The frame is now deferred, and the worker scheduled 1143 - * will re-allocate it, so we can free it for now. 1144 - */ 1155 + if (WARN_ON_ONCE(txq_id == IWL_MVM_INVALID_QUEUE)) { 1145 1156 iwl_trans_free_tx_cmd(mvm->trans, dev_cmd); 1146 1157 spin_unlock(&mvmsta->lock); 1147 1158 return 0; ··· 1174 1199 1175 1200 spin_unlock(&mvmsta->lock); 1176 1201 1177 - iwl_mvm_tx_pkt_queued(mvm, mvmsta, tid == IWL_MAX_TID_COUNT ? 0 : tid); 1202 + if (iwl_mvm_tx_pkt_queued(mvm, mvmsta, 1203 + tid == IWL_MAX_TID_COUNT ? 0 : tid)) 1204 + goto drop; 1178 1205 1179 1206 return 0; 1180 1207
+19 -18
drivers/net/wireless/intel/iwlwifi/mvm/utils.c
··· 248 248 IWL_ERR(mvm, "FW Error notification: seq 0x%04X service 0x%08X\n", 249 249 le16_to_cpu(err_resp->bad_cmd_seq_num), 250 250 le32_to_cpu(err_resp->error_service)); 251 - IWL_ERR(mvm, "FW Error notification: timestamp 0x%16llX\n", 251 + IWL_ERR(mvm, "FW Error notification: timestamp 0x%016llX\n", 252 252 le64_to_cpu(err_resp->timestamp)); 253 253 } 254 254 ··· 463 463 iwl_trans_read_mem_bytes(trans, mvm->umac_error_event_table, &table, 464 464 sizeof(table)); 465 465 466 + if (table.valid) 467 + mvm->fwrt.dump.umac_err_id = table.error_id; 468 + 466 469 if (ERROR_START_OFFSET <= table.valid * ERROR_ELEM_SIZE) { 467 470 IWL_ERR(trans, "Start IWL Error Log Dump:\n"); 468 471 IWL_ERR(trans, "Status: 0x%08lX, count: %d\n", ··· 489 486 IWL_ERR(mvm, "0x%08X | isr status reg\n", table.nic_isr_pref); 490 487 } 491 488 492 - static void iwl_mvm_dump_lmac_error_log(struct iwl_mvm *mvm, u32 base) 489 + static void iwl_mvm_dump_lmac_error_log(struct iwl_mvm *mvm, u8 lmac_num) 493 490 { 494 491 struct iwl_trans *trans = mvm->trans; 495 492 struct iwl_error_event_table table; 496 - u32 val; 493 + u32 val, base = mvm->error_event_table[lmac_num]; 497 494 498 495 if (mvm->fwrt.cur_fw_img == IWL_UCODE_INIT) { 499 496 if (!base) ··· 544 541 iwl_trans_read_mem_bytes(trans, base, &table, sizeof(table)); 545 542 546 543 if (table.valid) 547 - mvm->fwrt.dump.rt_status = table.error_id; 544 + mvm->fwrt.dump.lmac_err_id[lmac_num] = table.error_id; 548 545 549 546 if (ERROR_START_OFFSET <= table.valid * ERROR_ELEM_SIZE) { 550 547 IWL_ERR(trans, "Start IWL Error Log Dump:\n"); ··· 601 598 return; 602 599 } 603 600 604 - iwl_mvm_dump_lmac_error_log(mvm, mvm->error_event_table[0]); 601 + iwl_mvm_dump_lmac_error_log(mvm, 0); 605 602 606 603 if (mvm->error_event_table[1]) 607 - iwl_mvm_dump_lmac_error_log(mvm, mvm->error_event_table[1]); 604 + iwl_mvm_dump_lmac_error_log(mvm, 1); 608 605 609 606 iwl_mvm_dump_umac_error_log(mvm); 610 607 } ··· 1136 1133 "AP isn't using AMPDU with uAPSD enabled"); 1137 1134 } 1138 1135 1139 - static void iwl_mvm_uapsd_agg_disconnect_iter(void *data, u8 *mac, 1140 - struct ieee80211_vif *vif) 1136 + static void iwl_mvm_uapsd_agg_disconnect(struct iwl_mvm *mvm, 1137 + struct ieee80211_vif *vif) 1141 1138 { 1142 1139 struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); 1143 - struct iwl_mvm *mvm = mvmvif->mvm; 1144 - int *mac_id = data; 1145 1140 1146 1141 if (vif->type != NL80211_IFTYPE_STATION) 1147 - return; 1148 - 1149 - if (mvmvif->id != *mac_id) 1150 1142 return; 1151 1143 1152 1144 if (!vif->bss_conf.assoc) ··· 1153 1155 !mvmvif->queue_params[IEEE80211_AC_BK].uapsd) 1154 1156 return; 1155 1157 1156 - if (mvm->tcm.data[*mac_id].uapsd_nonagg_detect.detected) 1158 + if (mvm->tcm.data[mvmvif->id].uapsd_nonagg_detect.detected) 1157 1159 return; 1158 1160 1159 - mvm->tcm.data[*mac_id].uapsd_nonagg_detect.detected = true; 1161 + mvm->tcm.data[mvmvif->id].uapsd_nonagg_detect.detected = true; 1160 1162 IWL_INFO(mvm, 1161 1163 "detected AP should do aggregation but isn't, likely due to U-APSD\n"); 1162 1164 schedule_delayed_work(&mvmvif->uapsd_nonagg_detected_wk, 15 * HZ); ··· 1169 1171 u64 bytes = mvm->tcm.data[mac].uapsd_nonagg_detect.rx_bytes; 1170 1172 u64 tpt; 1171 1173 unsigned long rate; 1174 + struct ieee80211_vif *vif; 1172 1175 1173 1176 rate = ewma_rate_read(&mvm->tcm.data[mac].uapsd_nonagg_detect.rate); 1174 1177 ··· 1198 1199 return; 1199 1200 } 1200 1201 1201 - ieee80211_iterate_active_interfaces_atomic( 1202 - mvm->hw, IEEE80211_IFACE_ITER_NORMAL, 1203 - iwl_mvm_uapsd_agg_disconnect_iter, &mac); 1202 + rcu_read_lock(); 1203 + vif = rcu_dereference(mvm->vif_id_to_mac[mac]); 1204 + if (vif) 1205 + iwl_mvm_uapsd_agg_disconnect(mvm, vif); 1206 + rcu_read_unlock(); 1204 1207 } 1205 1208 1206 1209 static void iwl_mvm_tcm_iterator(void *_data, u8 *mac,
+158 -108
drivers/net/wireless/intel/iwlwifi/pcie/drv.c
··· 513 513 {IWL_PCI_DEVICE(0x24FD, 0x9074, iwl8265_2ac_cfg)}, 514 514 515 515 /* 9000 Series */ 516 - {IWL_PCI_DEVICE(0x02F0, 0x0030, iwl9560_2ac_cfg_soc)}, 516 + {IWL_PCI_DEVICE(0x02F0, 0x0030, iwl9560_2ac_160_cfg_soc)}, 517 517 {IWL_PCI_DEVICE(0x02F0, 0x0034, iwl9560_2ac_cfg_soc)}, 518 - {IWL_PCI_DEVICE(0x02F0, 0x0038, iwl9560_2ac_cfg_soc)}, 519 - {IWL_PCI_DEVICE(0x02F0, 0x003C, iwl9560_2ac_cfg_soc)}, 518 + {IWL_PCI_DEVICE(0x02F0, 0x0038, iwl9560_2ac_160_cfg_soc)}, 519 + {IWL_PCI_DEVICE(0x02F0, 0x003C, iwl9560_2ac_160_cfg_soc)}, 520 520 {IWL_PCI_DEVICE(0x02F0, 0x0060, iwl9461_2ac_cfg_soc)}, 521 521 {IWL_PCI_DEVICE(0x02F0, 0x0064, iwl9461_2ac_cfg_soc)}, 522 522 {IWL_PCI_DEVICE(0x02F0, 0x00A0, iwl9462_2ac_cfg_soc)}, ··· 531 531 {IWL_PCI_DEVICE(0x02F0, 0x02A4, iwl9462_2ac_cfg_soc)}, 532 532 {IWL_PCI_DEVICE(0x02F0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, 533 533 {IWL_PCI_DEVICE(0x02F0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, 534 - {IWL_PCI_DEVICE(0x02F0, 0x2030, iwl9560_2ac_cfg_soc)}, 535 - {IWL_PCI_DEVICE(0x02F0, 0x2034, iwl9560_2ac_cfg_soc)}, 536 - {IWL_PCI_DEVICE(0x02F0, 0x4030, iwl9560_2ac_cfg_soc)}, 537 - {IWL_PCI_DEVICE(0x02F0, 0x4034, iwl9560_2ac_cfg_soc)}, 534 + {IWL_PCI_DEVICE(0x02F0, 0x2030, iwl9560_2ac_160_cfg_soc)}, 535 + {IWL_PCI_DEVICE(0x02F0, 0x2034, iwl9560_2ac_160_cfg_soc)}, 536 + {IWL_PCI_DEVICE(0x02F0, 0x4030, iwl9560_2ac_160_cfg_soc)}, 537 + {IWL_PCI_DEVICE(0x02F0, 0x4034, iwl9560_2ac_160_cfg_soc)}, 538 538 {IWL_PCI_DEVICE(0x02F0, 0x40A4, iwl9462_2ac_cfg_soc)}, 539 539 {IWL_PCI_DEVICE(0x02F0, 0x4234, iwl9560_2ac_cfg_soc)}, 540 540 {IWL_PCI_DEVICE(0x02F0, 0x42A4, iwl9462_2ac_cfg_soc)}, 541 - {IWL_PCI_DEVICE(0x06F0, 0x0030, iwl9560_2ac_cfg_soc)}, 541 + {IWL_PCI_DEVICE(0x06F0, 0x0030, iwl9560_2ac_160_cfg_soc)}, 542 542 {IWL_PCI_DEVICE(0x06F0, 0x0034, iwl9560_2ac_cfg_soc)}, 543 - {IWL_PCI_DEVICE(0x06F0, 0x0038, iwl9560_2ac_cfg_soc)}, 544 - {IWL_PCI_DEVICE(0x06F0, 0x003C, iwl9560_2ac_cfg_soc)}, 543 + {IWL_PCI_DEVICE(0x06F0, 0x0038, iwl9560_2ac_160_cfg_soc)}, 544 + {IWL_PCI_DEVICE(0x06F0, 0x003C, iwl9560_2ac_160_cfg_soc)}, 545 545 {IWL_PCI_DEVICE(0x06F0, 0x0060, iwl9461_2ac_cfg_soc)}, 546 546 {IWL_PCI_DEVICE(0x06F0, 0x0064, iwl9461_2ac_cfg_soc)}, 547 547 {IWL_PCI_DEVICE(0x06F0, 0x00A0, iwl9462_2ac_cfg_soc)}, ··· 556 556 {IWL_PCI_DEVICE(0x06F0, 0x02A4, iwl9462_2ac_cfg_soc)}, 557 557 {IWL_PCI_DEVICE(0x06F0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, 558 558 {IWL_PCI_DEVICE(0x06F0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, 559 - {IWL_PCI_DEVICE(0x06F0, 0x2030, iwl9560_2ac_cfg_soc)}, 560 - {IWL_PCI_DEVICE(0x06F0, 0x2034, iwl9560_2ac_cfg_soc)}, 561 - {IWL_PCI_DEVICE(0x06F0, 0x4030, iwl9560_2ac_cfg_soc)}, 562 - {IWL_PCI_DEVICE(0x06F0, 0x4034, iwl9560_2ac_cfg_soc)}, 559 + {IWL_PCI_DEVICE(0x06F0, 0x2030, iwl9560_2ac_160_cfg_soc)}, 560 + {IWL_PCI_DEVICE(0x06F0, 0x2034, iwl9560_2ac_160_cfg_soc)}, 561 + {IWL_PCI_DEVICE(0x06F0, 0x4030, iwl9560_2ac_160_cfg_soc)}, 562 + {IWL_PCI_DEVICE(0x06F0, 0x4034, iwl9560_2ac_160_cfg_soc)}, 563 563 {IWL_PCI_DEVICE(0x06F0, 0x40A4, iwl9462_2ac_cfg_soc)}, 564 564 {IWL_PCI_DEVICE(0x06F0, 0x4234, iwl9560_2ac_cfg_soc)}, 565 565 {IWL_PCI_DEVICE(0x06F0, 0x42A4, iwl9462_2ac_cfg_soc)}, 566 - {IWL_PCI_DEVICE(0x2526, 0x0010, iwl9260_2ac_cfg)}, 567 - {IWL_PCI_DEVICE(0x2526, 0x0014, iwl9260_2ac_cfg)}, 568 - {IWL_PCI_DEVICE(0x2526, 0x0018, iwl9260_2ac_cfg)}, 569 - {IWL_PCI_DEVICE(0x2526, 0x0030, iwl9560_2ac_cfg)}, 566 + {IWL_PCI_DEVICE(0x2526, 0x0010, iwl9260_2ac_160_cfg)}, 567 + {IWL_PCI_DEVICE(0x2526, 0x0014, iwl9260_2ac_160_cfg)}, 568 + {IWL_PCI_DEVICE(0x2526, 0x0018, iwl9260_2ac_160_cfg)}, 569 + {IWL_PCI_DEVICE(0x2526, 0x001C, iwl9260_2ac_160_cfg)}, 570 + {IWL_PCI_DEVICE(0x2526, 0x0030, iwl9560_2ac_160_cfg)}, 570 571 {IWL_PCI_DEVICE(0x2526, 0x0034, iwl9560_2ac_cfg)}, 571 - {IWL_PCI_DEVICE(0x2526, 0x0038, iwl9560_2ac_cfg)}, 572 - {IWL_PCI_DEVICE(0x2526, 0x003C, iwl9560_2ac_cfg)}, 572 + {IWL_PCI_DEVICE(0x2526, 0x0038, iwl9560_2ac_160_cfg)}, 573 + {IWL_PCI_DEVICE(0x2526, 0x003C, iwl9560_2ac_160_cfg)}, 573 574 {IWL_PCI_DEVICE(0x2526, 0x0060, iwl9460_2ac_cfg)}, 574 575 {IWL_PCI_DEVICE(0x2526, 0x0064, iwl9460_2ac_cfg)}, 575 576 {IWL_PCI_DEVICE(0x2526, 0x00A0, iwl9460_2ac_cfg)}, ··· 594 593 {IWL_PCI_DEVICE(0x2526, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, 595 594 {IWL_PCI_DEVICE(0x2526, 0x1552, iwl9560_killer_2ac_cfg_soc)}, 596 595 {IWL_PCI_DEVICE(0x2526, 0x1610, iwl9270_2ac_cfg)}, 597 - {IWL_PCI_DEVICE(0x2526, 0x2030, iwl9560_2ac_cfg_soc)}, 598 - {IWL_PCI_DEVICE(0x2526, 0x2034, iwl9560_2ac_cfg_soc)}, 599 - {IWL_PCI_DEVICE(0x2526, 0x4010, iwl9260_2ac_cfg)}, 600 - {IWL_PCI_DEVICE(0x2526, 0x4030, iwl9560_2ac_cfg)}, 601 - {IWL_PCI_DEVICE(0x2526, 0x4034, iwl9560_2ac_cfg_soc)}, 596 + {IWL_PCI_DEVICE(0x2526, 0x2030, iwl9560_2ac_160_cfg_soc)}, 597 + {IWL_PCI_DEVICE(0x2526, 0x2034, iwl9560_2ac_160_cfg_soc)}, 598 + {IWL_PCI_DEVICE(0x2526, 0x4010, iwl9260_2ac_160_cfg)}, 599 + {IWL_PCI_DEVICE(0x2526, 0x401C, iwl9260_2ac_160_cfg)}, 600 + {IWL_PCI_DEVICE(0x2526, 0x4030, iwl9560_2ac_160_cfg)}, 601 + {IWL_PCI_DEVICE(0x2526, 0x4034, iwl9560_2ac_160_cfg_soc)}, 602 602 {IWL_PCI_DEVICE(0x2526, 0x40A4, iwl9460_2ac_cfg)}, 603 603 {IWL_PCI_DEVICE(0x2526, 0x4234, iwl9560_2ac_cfg_soc)}, 604 604 {IWL_PCI_DEVICE(0x2526, 0x42A4, iwl9462_2ac_cfg_soc)}, 605 - {IWL_PCI_DEVICE(0x2526, 0x8014, iwl9260_2ac_cfg)}, 606 - {IWL_PCI_DEVICE(0x2526, 0xA014, iwl9260_2ac_cfg)}, 605 + {IWL_PCI_DEVICE(0x2526, 0x8014, iwl9260_2ac_160_cfg)}, 606 + {IWL_PCI_DEVICE(0x2526, 0x8010, iwl9260_2ac_160_cfg)}, 607 + {IWL_PCI_DEVICE(0x2526, 0xA014, iwl9260_2ac_160_cfg)}, 607 608 {IWL_PCI_DEVICE(0x271B, 0x0010, iwl9160_2ac_cfg)}, 608 609 {IWL_PCI_DEVICE(0x271B, 0x0014, iwl9160_2ac_cfg)}, 609 610 {IWL_PCI_DEVICE(0x271B, 0x0210, iwl9160_2ac_cfg)}, 610 611 {IWL_PCI_DEVICE(0x271B, 0x0214, iwl9260_2ac_cfg)}, 611 612 {IWL_PCI_DEVICE(0x271C, 0x0214, iwl9260_2ac_cfg)}, 612 - {IWL_PCI_DEVICE(0x2720, 0x0034, iwl9560_2ac_cfg)}, 613 - {IWL_PCI_DEVICE(0x2720, 0x0038, iwl9560_2ac_cfg)}, 614 - {IWL_PCI_DEVICE(0x2720, 0x003C, iwl9560_2ac_cfg)}, 613 + {IWL_PCI_DEVICE(0x2720, 0x0034, iwl9560_2ac_160_cfg)}, 614 + {IWL_PCI_DEVICE(0x2720, 0x0038, iwl9560_2ac_160_cfg)}, 615 + {IWL_PCI_DEVICE(0x2720, 0x003C, iwl9560_2ac_160_cfg)}, 615 616 {IWL_PCI_DEVICE(0x2720, 0x0060, iwl9461_2ac_cfg_soc)}, 616 617 {IWL_PCI_DEVICE(0x2720, 0x0064, iwl9461_2ac_cfg_soc)}, 617 618 {IWL_PCI_DEVICE(0x2720, 0x00A0, iwl9462_2ac_cfg_soc)}, ··· 631 628 {IWL_PCI_DEVICE(0x2720, 0x1210, iwl9260_2ac_cfg)}, 632 629 {IWL_PCI_DEVICE(0x2720, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, 633 630 {IWL_PCI_DEVICE(0x2720, 0x1552, iwl9560_killer_2ac_cfg_soc)}, 634 - {IWL_PCI_DEVICE(0x2720, 0x2030, iwl9560_2ac_cfg_soc)}, 635 - {IWL_PCI_DEVICE(0x2720, 0x2034, iwl9560_2ac_cfg_soc)}, 636 - {IWL_PCI_DEVICE(0x2720, 0x4030, iwl9560_2ac_cfg)}, 637 - {IWL_PCI_DEVICE(0x2720, 0x4034, iwl9560_2ac_cfg_soc)}, 631 + {IWL_PCI_DEVICE(0x2720, 0x2030, iwl9560_2ac_160_cfg_soc)}, 632 + {IWL_PCI_DEVICE(0x2720, 0x2034, iwl9560_2ac_160_cfg_soc)}, 633 + {IWL_PCI_DEVICE(0x2720, 0x4030, iwl9560_2ac_160_cfg)}, 634 + {IWL_PCI_DEVICE(0x2720, 0x4034, iwl9560_2ac_160_cfg_soc)}, 638 635 {IWL_PCI_DEVICE(0x2720, 0x40A4, iwl9462_2ac_cfg_soc)}, 639 636 {IWL_PCI_DEVICE(0x2720, 0x4234, iwl9560_2ac_cfg_soc)}, 640 637 {IWL_PCI_DEVICE(0x2720, 0x42A4, iwl9462_2ac_cfg_soc)}, 641 - {IWL_PCI_DEVICE(0x30DC, 0x0030, iwl9560_2ac_cfg_soc)}, 638 + {IWL_PCI_DEVICE(0x30DC, 0x0030, iwl9560_2ac_160_cfg_soc)}, 642 639 {IWL_PCI_DEVICE(0x30DC, 0x0034, iwl9560_2ac_cfg_soc)}, 643 - {IWL_PCI_DEVICE(0x30DC, 0x0038, iwl9560_2ac_cfg_soc)}, 644 - {IWL_PCI_DEVICE(0x30DC, 0x003C, iwl9560_2ac_cfg_soc)}, 640 + {IWL_PCI_DEVICE(0x30DC, 0x0038, iwl9560_2ac_160_cfg_soc)}, 641 + {IWL_PCI_DEVICE(0x30DC, 0x003C, iwl9560_2ac_160_cfg_soc)}, 645 642 {IWL_PCI_DEVICE(0x30DC, 0x0060, iwl9460_2ac_cfg_soc)}, 646 643 {IWL_PCI_DEVICE(0x30DC, 0x0064, iwl9461_2ac_cfg_soc)}, 647 644 {IWL_PCI_DEVICE(0x30DC, 0x00A0, iwl9462_2ac_cfg_soc)}, ··· 659 656 {IWL_PCI_DEVICE(0x30DC, 0x1210, iwl9260_2ac_cfg)}, 660 657 {IWL_PCI_DEVICE(0x30DC, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, 661 658 {IWL_PCI_DEVICE(0x30DC, 0x1552, iwl9560_killer_2ac_cfg_soc)}, 662 - {IWL_PCI_DEVICE(0x30DC, 0x2030, iwl9560_2ac_cfg_soc)}, 663 - {IWL_PCI_DEVICE(0x30DC, 0x2034, iwl9560_2ac_cfg_soc)}, 664 - {IWL_PCI_DEVICE(0x30DC, 0x4030, iwl9560_2ac_cfg_soc)}, 665 - {IWL_PCI_DEVICE(0x30DC, 0x4034, iwl9560_2ac_cfg_soc)}, 659 + {IWL_PCI_DEVICE(0x30DC, 0x2030, iwl9560_2ac_160_cfg_soc)}, 660 + {IWL_PCI_DEVICE(0x30DC, 0x2034, iwl9560_2ac_160_cfg_soc)}, 661 + {IWL_PCI_DEVICE(0x30DC, 0x4030, iwl9560_2ac_160_cfg_soc)}, 662 + {IWL_PCI_DEVICE(0x30DC, 0x4034, iwl9560_2ac_160_cfg_soc)}, 666 663 {IWL_PCI_DEVICE(0x30DC, 0x40A4, iwl9462_2ac_cfg_soc)}, 667 664 {IWL_PCI_DEVICE(0x30DC, 0x4234, iwl9560_2ac_cfg_soc)}, 668 665 {IWL_PCI_DEVICE(0x30DC, 0x42A4, iwl9462_2ac_cfg_soc)}, 669 - {IWL_PCI_DEVICE(0x31DC, 0x0030, iwl9560_2ac_cfg_shared_clk)}, 666 + {IWL_PCI_DEVICE(0x31DC, 0x0030, iwl9560_2ac_160_cfg_shared_clk)}, 670 667 {IWL_PCI_DEVICE(0x31DC, 0x0034, iwl9560_2ac_cfg_shared_clk)}, 671 - {IWL_PCI_DEVICE(0x31DC, 0x0038, iwl9560_2ac_cfg_shared_clk)}, 672 - {IWL_PCI_DEVICE(0x31DC, 0x003C, iwl9560_2ac_cfg_shared_clk)}, 668 + {IWL_PCI_DEVICE(0x31DC, 0x0038, iwl9560_2ac_160_cfg_shared_clk)}, 669 + {IWL_PCI_DEVICE(0x31DC, 0x003C, iwl9560_2ac_160_cfg_shared_clk)}, 673 670 {IWL_PCI_DEVICE(0x31DC, 0x0060, iwl9460_2ac_cfg_shared_clk)}, 674 671 {IWL_PCI_DEVICE(0x31DC, 0x0064, iwl9461_2ac_cfg_shared_clk)}, 675 672 {IWL_PCI_DEVICE(0x31DC, 0x00A0, iwl9462_2ac_cfg_shared_clk)}, ··· 687 684 {IWL_PCI_DEVICE(0x31DC, 0x1210, iwl9260_2ac_cfg)}, 688 685 {IWL_PCI_DEVICE(0x31DC, 0x1551, iwl9560_killer_s_2ac_cfg_shared_clk)}, 689 686 {IWL_PCI_DEVICE(0x31DC, 0x1552, iwl9560_killer_2ac_cfg_shared_clk)}, 690 - {IWL_PCI_DEVICE(0x31DC, 0x2030, iwl9560_2ac_cfg_shared_clk)}, 691 - {IWL_PCI_DEVICE(0x31DC, 0x2034, iwl9560_2ac_cfg_shared_clk)}, 692 - {IWL_PCI_DEVICE(0x31DC, 0x4030, iwl9560_2ac_cfg_shared_clk)}, 693 - {IWL_PCI_DEVICE(0x31DC, 0x4034, iwl9560_2ac_cfg_shared_clk)}, 687 + {IWL_PCI_DEVICE(0x31DC, 0x2030, iwl9560_2ac_160_cfg_shared_clk)}, 688 + {IWL_PCI_DEVICE(0x31DC, 0x2034, iwl9560_2ac_160_cfg_shared_clk)}, 689 + {IWL_PCI_DEVICE(0x31DC, 0x4030, iwl9560_2ac_160_cfg_shared_clk)}, 690 + {IWL_PCI_DEVICE(0x31DC, 0x4034, iwl9560_2ac_160_cfg_shared_clk)}, 694 691 {IWL_PCI_DEVICE(0x31DC, 0x40A4, iwl9462_2ac_cfg_shared_clk)}, 695 692 {IWL_PCI_DEVICE(0x31DC, 0x4234, iwl9560_2ac_cfg_shared_clk)}, 696 693 {IWL_PCI_DEVICE(0x31DC, 0x42A4, iwl9462_2ac_cfg_shared_clk)}, 697 694 698 - {IWL_PCI_DEVICE(0x34F0, 0x0030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, 695 + {IWL_PCI_DEVICE(0x34F0, 0x0030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, 699 696 {IWL_PCI_DEVICE(0x34F0, 0x0034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, 700 - {IWL_PCI_DEVICE(0x34F0, 0x0038, iwl9560_2ac_cfg_qu_b0_jf_b0)}, 701 - {IWL_PCI_DEVICE(0x34F0, 0x003C, iwl9560_2ac_cfg_qu_b0_jf_b0)}, 697 + {IWL_PCI_DEVICE(0x34F0, 0x0038, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, 698 + {IWL_PCI_DEVICE(0x34F0, 0x003C, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, 702 699 {IWL_PCI_DEVICE(0x34F0, 0x0060, iwl9461_2ac_cfg_qu_b0_jf_b0)}, 703 700 {IWL_PCI_DEVICE(0x34F0, 0x0064, iwl9461_2ac_cfg_qu_b0_jf_b0)}, 704 701 {IWL_PCI_DEVICE(0x34F0, 0x00A0, iwl9462_2ac_cfg_qu_b0_jf_b0)}, ··· 713 710 {IWL_PCI_DEVICE(0x34F0, 0x02A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, 714 711 {IWL_PCI_DEVICE(0x34F0, 0x1551, killer1550s_2ac_cfg_qu_b0_jf_b0)}, 715 712 {IWL_PCI_DEVICE(0x34F0, 0x1552, killer1550i_2ac_cfg_qu_b0_jf_b0)}, 716 - {IWL_PCI_DEVICE(0x34F0, 0x2030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, 717 - {IWL_PCI_DEVICE(0x34F0, 0x2034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, 718 - {IWL_PCI_DEVICE(0x34F0, 0x4030, iwl9560_2ac_cfg_qu_b0_jf_b0)}, 719 - {IWL_PCI_DEVICE(0x34F0, 0x4034, iwl9560_2ac_cfg_qu_b0_jf_b0)}, 713 + {IWL_PCI_DEVICE(0x34F0, 0x2030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, 714 + {IWL_PCI_DEVICE(0x34F0, 0x2034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, 715 + {IWL_PCI_DEVICE(0x34F0, 0x4030, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, 716 + {IWL_PCI_DEVICE(0x34F0, 0x4034, iwl9560_2ac_160_cfg_qu_b0_jf_b0)}, 720 717 {IWL_PCI_DEVICE(0x34F0, 0x40A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, 721 718 {IWL_PCI_DEVICE(0x34F0, 0x4234, iwl9560_2ac_cfg_qu_b0_jf_b0)}, 722 719 {IWL_PCI_DEVICE(0x34F0, 0x42A4, iwl9462_2ac_cfg_qu_b0_jf_b0)}, 723 720 724 - {IWL_PCI_DEVICE(0x3DF0, 0x0030, iwl9560_2ac_cfg_soc)}, 721 + {IWL_PCI_DEVICE(0x3DF0, 0x0030, iwl9560_2ac_160_cfg_soc)}, 725 722 {IWL_PCI_DEVICE(0x3DF0, 0x0034, iwl9560_2ac_cfg_soc)}, 726 - {IWL_PCI_DEVICE(0x3DF0, 0x0038, iwl9560_2ac_cfg_soc)}, 727 - {IWL_PCI_DEVICE(0x3DF0, 0x003C, iwl9560_2ac_cfg_soc)}, 723 + {IWL_PCI_DEVICE(0x3DF0, 0x0038, iwl9560_2ac_160_cfg_soc)}, 724 + {IWL_PCI_DEVICE(0x3DF0, 0x003C, iwl9560_2ac_160_cfg_soc)}, 728 725 {IWL_PCI_DEVICE(0x3DF0, 0x0060, iwl9461_2ac_cfg_soc)}, 729 726 {IWL_PCI_DEVICE(0x3DF0, 0x0064, iwl9461_2ac_cfg_soc)}, 730 727 {IWL_PCI_DEVICE(0x3DF0, 0x00A0, iwl9462_2ac_cfg_soc)}, ··· 742 739 {IWL_PCI_DEVICE(0x3DF0, 0x1210, iwl9260_2ac_cfg)}, 743 740 {IWL_PCI_DEVICE(0x3DF0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, 744 741 {IWL_PCI_DEVICE(0x3DF0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, 745 - {IWL_PCI_DEVICE(0x3DF0, 0x2030, iwl9560_2ac_cfg_soc)}, 746 - {IWL_PCI_DEVICE(0x3DF0, 0x2034, iwl9560_2ac_cfg_soc)}, 747 - {IWL_PCI_DEVICE(0x3DF0, 0x4030, iwl9560_2ac_cfg_soc)}, 748 - {IWL_PCI_DEVICE(0x3DF0, 0x4034, iwl9560_2ac_cfg_soc)}, 742 + {IWL_PCI_DEVICE(0x3DF0, 0x2030, iwl9560_2ac_160_cfg_soc)}, 743 + {IWL_PCI_DEVICE(0x3DF0, 0x2034, iwl9560_2ac_160_cfg_soc)}, 744 + {IWL_PCI_DEVICE(0x3DF0, 0x4030, iwl9560_2ac_160_cfg_soc)}, 745 + {IWL_PCI_DEVICE(0x3DF0, 0x4034, iwl9560_2ac_160_cfg_soc)}, 749 746 {IWL_PCI_DEVICE(0x3DF0, 0x40A4, iwl9462_2ac_cfg_soc)}, 750 747 {IWL_PCI_DEVICE(0x3DF0, 0x4234, iwl9560_2ac_cfg_soc)}, 751 748 {IWL_PCI_DEVICE(0x3DF0, 0x42A4, iwl9462_2ac_cfg_soc)}, 752 - {IWL_PCI_DEVICE(0x43F0, 0x0030, iwl9560_2ac_cfg_soc)}, 749 + {IWL_PCI_DEVICE(0x43F0, 0x0030, iwl9560_2ac_160_cfg_soc)}, 753 750 {IWL_PCI_DEVICE(0x43F0, 0x0034, iwl9560_2ac_cfg_soc)}, 754 - {IWL_PCI_DEVICE(0x43F0, 0x0038, iwl9560_2ac_cfg_soc)}, 755 - {IWL_PCI_DEVICE(0x43F0, 0x003C, iwl9560_2ac_cfg_soc)}, 751 + {IWL_PCI_DEVICE(0x43F0, 0x0038, iwl9560_2ac_160_cfg_soc)}, 752 + {IWL_PCI_DEVICE(0x43F0, 0x003C, iwl9560_2ac_160_cfg_soc)}, 756 753 {IWL_PCI_DEVICE(0x43F0, 0x0060, iwl9461_2ac_cfg_soc)}, 757 754 {IWL_PCI_DEVICE(0x43F0, 0x0064, iwl9461_2ac_cfg_soc)}, 758 755 {IWL_PCI_DEVICE(0x43F0, 0x00A0, iwl9462_2ac_cfg_soc)}, ··· 770 767 {IWL_PCI_DEVICE(0x43F0, 0x1210, iwl9260_2ac_cfg)}, 771 768 {IWL_PCI_DEVICE(0x43F0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, 772 769 {IWL_PCI_DEVICE(0x43F0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, 773 - {IWL_PCI_DEVICE(0x43F0, 0x2030, iwl9560_2ac_cfg_soc)}, 774 - {IWL_PCI_DEVICE(0x43F0, 0x2034, iwl9560_2ac_cfg_soc)}, 775 - {IWL_PCI_DEVICE(0x43F0, 0x4030, iwl9560_2ac_cfg_soc)}, 776 - {IWL_PCI_DEVICE(0x43F0, 0x4034, iwl9560_2ac_cfg_soc)}, 770 + {IWL_PCI_DEVICE(0x43F0, 0x2030, iwl9560_2ac_160_cfg_soc)}, 771 + {IWL_PCI_DEVICE(0x43F0, 0x2034, iwl9560_2ac_160_cfg_soc)}, 772 + {IWL_PCI_DEVICE(0x43F0, 0x4030, iwl9560_2ac_160_cfg_soc)}, 773 + {IWL_PCI_DEVICE(0x43F0, 0x4034, iwl9560_2ac_160_cfg_soc)}, 777 774 {IWL_PCI_DEVICE(0x43F0, 0x40A4, iwl9462_2ac_cfg_soc)}, 778 775 {IWL_PCI_DEVICE(0x43F0, 0x4234, iwl9560_2ac_cfg_soc)}, 779 776 {IWL_PCI_DEVICE(0x43F0, 0x42A4, iwl9462_2ac_cfg_soc)}, 780 777 {IWL_PCI_DEVICE(0x9DF0, 0x0000, iwl9460_2ac_cfg_soc)}, 781 778 {IWL_PCI_DEVICE(0x9DF0, 0x0010, iwl9460_2ac_cfg_soc)}, 782 - {IWL_PCI_DEVICE(0x9DF0, 0x0030, iwl9560_2ac_cfg_soc)}, 779 + {IWL_PCI_DEVICE(0x9DF0, 0x0030, iwl9560_2ac_160_cfg_soc)}, 783 780 {IWL_PCI_DEVICE(0x9DF0, 0x0034, iwl9560_2ac_cfg_soc)}, 784 - {IWL_PCI_DEVICE(0x9DF0, 0x0038, iwl9560_2ac_cfg_soc)}, 785 - {IWL_PCI_DEVICE(0x9DF0, 0x003C, iwl9560_2ac_cfg_soc)}, 781 + {IWL_PCI_DEVICE(0x9DF0, 0x0038, iwl9560_2ac_160_cfg_soc)}, 782 + {IWL_PCI_DEVICE(0x9DF0, 0x003C, iwl9560_2ac_160_cfg_soc)}, 786 783 {IWL_PCI_DEVICE(0x9DF0, 0x0060, iwl9460_2ac_cfg_soc)}, 787 784 {IWL_PCI_DEVICE(0x9DF0, 0x0064, iwl9461_2ac_cfg_soc)}, 788 785 {IWL_PCI_DEVICE(0x9DF0, 0x00A0, iwl9462_2ac_cfg_soc)}, ··· 808 805 {IWL_PCI_DEVICE(0x9DF0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, 809 806 {IWL_PCI_DEVICE(0x9DF0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, 810 807 {IWL_PCI_DEVICE(0x9DF0, 0x2010, iwl9460_2ac_cfg_soc)}, 811 - {IWL_PCI_DEVICE(0x9DF0, 0x2030, iwl9560_2ac_cfg_soc)}, 812 - {IWL_PCI_DEVICE(0x9DF0, 0x2034, iwl9560_2ac_cfg_soc)}, 808 + {IWL_PCI_DEVICE(0x9DF0, 0x2030, iwl9560_2ac_160_cfg_soc)}, 809 + {IWL_PCI_DEVICE(0x9DF0, 0x2034, iwl9560_2ac_160_cfg_soc)}, 813 810 {IWL_PCI_DEVICE(0x9DF0, 0x2A10, iwl9460_2ac_cfg_soc)}, 814 - {IWL_PCI_DEVICE(0x9DF0, 0x4030, iwl9560_2ac_cfg_soc)}, 815 - {IWL_PCI_DEVICE(0x9DF0, 0x4034, iwl9560_2ac_cfg_soc)}, 811 + {IWL_PCI_DEVICE(0x9DF0, 0x4030, iwl9560_2ac_160_cfg_soc)}, 812 + {IWL_PCI_DEVICE(0x9DF0, 0x4034, iwl9560_2ac_160_cfg_soc)}, 816 813 {IWL_PCI_DEVICE(0x9DF0, 0x40A4, iwl9462_2ac_cfg_soc)}, 817 814 {IWL_PCI_DEVICE(0x9DF0, 0x4234, iwl9560_2ac_cfg_soc)}, 818 815 {IWL_PCI_DEVICE(0x9DF0, 0x42A4, iwl9462_2ac_cfg_soc)}, 819 - {IWL_PCI_DEVICE(0xA0F0, 0x0030, iwl9560_2ac_cfg_soc)}, 816 + {IWL_PCI_DEVICE(0xA0F0, 0x0030, iwl9560_2ac_160_cfg_soc)}, 820 817 {IWL_PCI_DEVICE(0xA0F0, 0x0034, iwl9560_2ac_cfg_soc)}, 821 - {IWL_PCI_DEVICE(0xA0F0, 0x0038, iwl9560_2ac_cfg_soc)}, 822 - {IWL_PCI_DEVICE(0xA0F0, 0x003C, iwl9560_2ac_cfg_soc)}, 818 + {IWL_PCI_DEVICE(0xA0F0, 0x0038, iwl9560_2ac_160_cfg_soc)}, 819 + {IWL_PCI_DEVICE(0xA0F0, 0x003C, iwl9560_2ac_160_cfg_soc)}, 823 820 {IWL_PCI_DEVICE(0xA0F0, 0x0060, iwl9461_2ac_cfg_soc)}, 824 821 {IWL_PCI_DEVICE(0xA0F0, 0x0064, iwl9461_2ac_cfg_soc)}, 825 822 {IWL_PCI_DEVICE(0xA0F0, 0x00A0, iwl9462_2ac_cfg_soc)}, ··· 837 834 {IWL_PCI_DEVICE(0xA0F0, 0x1210, iwl9260_2ac_cfg)}, 838 835 {IWL_PCI_DEVICE(0xA0F0, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, 839 836 {IWL_PCI_DEVICE(0xA0F0, 0x1552, iwl9560_killer_2ac_cfg_soc)}, 840 - {IWL_PCI_DEVICE(0xA0F0, 0x2030, iwl9560_2ac_cfg_soc)}, 841 - {IWL_PCI_DEVICE(0xA0F0, 0x2034, iwl9560_2ac_cfg_soc)}, 842 - {IWL_PCI_DEVICE(0xA0F0, 0x4030, iwl9560_2ac_cfg_soc)}, 843 - {IWL_PCI_DEVICE(0xA0F0, 0x4034, iwl9560_2ac_cfg_soc)}, 837 + {IWL_PCI_DEVICE(0xA0F0, 0x2030, iwl9560_2ac_160_cfg_soc)}, 838 + {IWL_PCI_DEVICE(0xA0F0, 0x2034, iwl9560_2ac_160_cfg_soc)}, 839 + {IWL_PCI_DEVICE(0xA0F0, 0x4030, iwl9560_2ac_160_cfg_soc)}, 840 + {IWL_PCI_DEVICE(0xA0F0, 0x4034, iwl9560_2ac_160_cfg_soc)}, 844 841 {IWL_PCI_DEVICE(0xA0F0, 0x40A4, iwl9462_2ac_cfg_soc)}, 845 842 {IWL_PCI_DEVICE(0xA0F0, 0x4234, iwl9560_2ac_cfg_soc)}, 846 843 {IWL_PCI_DEVICE(0xA0F0, 0x42A4, iwl9462_2ac_cfg_soc)}, 847 - {IWL_PCI_DEVICE(0xA370, 0x0030, iwl9560_2ac_cfg_soc)}, 844 + {IWL_PCI_DEVICE(0xA370, 0x0030, iwl9560_2ac_160_cfg_soc)}, 848 845 {IWL_PCI_DEVICE(0xA370, 0x0034, iwl9560_2ac_cfg_soc)}, 849 - {IWL_PCI_DEVICE(0xA370, 0x0038, iwl9560_2ac_cfg_soc)}, 850 - {IWL_PCI_DEVICE(0xA370, 0x003C, iwl9560_2ac_cfg_soc)}, 846 + {IWL_PCI_DEVICE(0xA370, 0x0038, iwl9560_2ac_160_cfg_soc)}, 847 + {IWL_PCI_DEVICE(0xA370, 0x003C, iwl9560_2ac_160_cfg_soc)}, 851 848 {IWL_PCI_DEVICE(0xA370, 0x0060, iwl9460_2ac_cfg_soc)}, 852 849 {IWL_PCI_DEVICE(0xA370, 0x0064, iwl9461_2ac_cfg_soc)}, 853 850 {IWL_PCI_DEVICE(0xA370, 0x00A0, iwl9462_2ac_cfg_soc)}, ··· 865 862 {IWL_PCI_DEVICE(0xA370, 0x1210, iwl9260_2ac_cfg)}, 866 863 {IWL_PCI_DEVICE(0xA370, 0x1551, iwl9560_killer_s_2ac_cfg_soc)}, 867 864 {IWL_PCI_DEVICE(0xA370, 0x1552, iwl9560_killer_2ac_cfg_soc)}, 868 - {IWL_PCI_DEVICE(0xA370, 0x2030, iwl9560_2ac_cfg_soc)}, 869 - {IWL_PCI_DEVICE(0xA370, 0x2034, iwl9560_2ac_cfg_soc)}, 870 - {IWL_PCI_DEVICE(0xA370, 0x4030, iwl9560_2ac_cfg_soc)}, 871 - {IWL_PCI_DEVICE(0xA370, 0x4034, iwl9560_2ac_cfg_soc)}, 865 + {IWL_PCI_DEVICE(0xA370, 0x2030, iwl9560_2ac_160_cfg_soc)}, 866 + {IWL_PCI_DEVICE(0xA370, 0x2034, iwl9560_2ac_160_cfg_soc)}, 867 + {IWL_PCI_DEVICE(0xA370, 0x4030, iwl9560_2ac_160_cfg_soc)}, 868 + {IWL_PCI_DEVICE(0xA370, 0x4034, iwl9560_2ac_160_cfg_soc)}, 872 869 {IWL_PCI_DEVICE(0xA370, 0x40A4, iwl9462_2ac_cfg_soc)}, 873 870 {IWL_PCI_DEVICE(0xA370, 0x4234, iwl9560_2ac_cfg_soc)}, 874 871 {IWL_PCI_DEVICE(0xA370, 0x42A4, iwl9462_2ac_cfg_soc)}, 875 872 876 873 /* 22000 Series */ 877 - {IWL_PCI_DEVICE(0x2720, 0x0000, iwl22000_2ax_cfg_hr)}, 878 - {IWL_PCI_DEVICE(0x2720, 0x0040, iwl22000_2ax_cfg_hr)}, 879 - {IWL_PCI_DEVICE(0x2720, 0x0078, iwl22000_2ax_cfg_hr)}, 874 + {IWL_PCI_DEVICE(0x02F0, 0x0070, iwl22560_2ax_cfg_hr)}, 875 + {IWL_PCI_DEVICE(0x02F0, 0x0074, iwl22560_2ax_cfg_hr)}, 876 + {IWL_PCI_DEVICE(0x02F0, 0x0078, iwl22560_2ax_cfg_hr)}, 877 + {IWL_PCI_DEVICE(0x02F0, 0x007C, iwl22560_2ax_cfg_hr)}, 878 + {IWL_PCI_DEVICE(0x02F0, 0x0310, iwl22560_2ax_cfg_hr)}, 879 + {IWL_PCI_DEVICE(0x02F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)}, 880 + {IWL_PCI_DEVICE(0x02F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)}, 881 + {IWL_PCI_DEVICE(0x02F0, 0x4070, iwl22560_2ax_cfg_hr)}, 882 + {IWL_PCI_DEVICE(0x06F0, 0x0070, iwl22560_2ax_cfg_hr)}, 883 + {IWL_PCI_DEVICE(0x06F0, 0x0074, iwl22560_2ax_cfg_hr)}, 884 + {IWL_PCI_DEVICE(0x06F0, 0x0078, iwl22560_2ax_cfg_hr)}, 885 + {IWL_PCI_DEVICE(0x06F0, 0x007C, iwl22560_2ax_cfg_hr)}, 886 + {IWL_PCI_DEVICE(0x06F0, 0x0310, iwl22560_2ax_cfg_hr)}, 887 + {IWL_PCI_DEVICE(0x06F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)}, 888 + {IWL_PCI_DEVICE(0x06F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)}, 889 + {IWL_PCI_DEVICE(0x06F0, 0x4070, iwl22560_2ax_cfg_hr)}, 890 + {IWL_PCI_DEVICE(0x2720, 0x0000, iwl22560_2ax_cfg_hr)}, 891 + {IWL_PCI_DEVICE(0x2720, 0x0030, iwl9560_2ac_160_cfg_soc)}, 892 + {IWL_PCI_DEVICE(0x2720, 0x0040, iwl22560_2ax_cfg_hr)}, 880 893 {IWL_PCI_DEVICE(0x2720, 0x0070, iwl22000_2ac_cfg_hr_cdb)}, 881 - {IWL_PCI_DEVICE(0x2720, 0x0030, iwl22000_2ac_cfg_hr_cdb)}, 882 - {IWL_PCI_DEVICE(0x2720, 0x1080, iwl22000_2ax_cfg_hr)}, 894 + {IWL_PCI_DEVICE(0x2720, 0x0074, iwl22560_2ax_cfg_hr)}, 895 + {IWL_PCI_DEVICE(0x2720, 0x0078, iwl22560_2ax_cfg_hr)}, 896 + {IWL_PCI_DEVICE(0x2720, 0x007C, iwl22560_2ax_cfg_hr)}, 883 897 {IWL_PCI_DEVICE(0x2720, 0x0090, iwl22000_2ac_cfg_hr_cdb)}, 884 898 {IWL_PCI_DEVICE(0x2720, 0x0310, iwl22000_2ac_cfg_hr_cdb)}, 885 - {IWL_PCI_DEVICE(0x34F0, 0x0040, iwl22000_2ax_cfg_hr)}, 886 - {IWL_PCI_DEVICE(0x34F0, 0x0070, iwl22000_2ax_cfg_hr)}, 887 - {IWL_PCI_DEVICE(0x34F0, 0x0078, iwl22000_2ax_cfg_hr)}, 888 - {IWL_PCI_DEVICE(0x34F0, 0x0310, iwl22000_2ax_cfg_hr)}, 899 + {IWL_PCI_DEVICE(0x2720, 0x0A10, iwl22000_2ac_cfg_hr_cdb)}, 900 + {IWL_PCI_DEVICE(0x2720, 0x1080, iwl22560_2ax_cfg_hr)}, 901 + {IWL_PCI_DEVICE(0x2720, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)}, 902 + {IWL_PCI_DEVICE(0x2720, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)}, 903 + {IWL_PCI_DEVICE(0x2720, 0x4070, iwl22560_2ax_cfg_hr)}, 904 + {IWL_PCI_DEVICE(0x34F0, 0x0040, iwl22560_2ax_cfg_hr)}, 905 + {IWL_PCI_DEVICE(0x34F0, 0x0070, iwl22560_2ax_cfg_hr)}, 906 + {IWL_PCI_DEVICE(0x34F0, 0x0074, iwl22560_2ax_cfg_hr)}, 907 + {IWL_PCI_DEVICE(0x34F0, 0x0078, iwl22560_2ax_cfg_hr)}, 908 + {IWL_PCI_DEVICE(0x34F0, 0x007C, iwl22560_2ax_cfg_hr)}, 909 + {IWL_PCI_DEVICE(0x34F0, 0x0310, iwl22560_2ax_cfg_hr)}, 910 + {IWL_PCI_DEVICE(0x34F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)}, 911 + {IWL_PCI_DEVICE(0x34F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)}, 912 + {IWL_PCI_DEVICE(0x34F0, 0x4070, iwl22560_2ax_cfg_hr)}, 889 913 {IWL_PCI_DEVICE(0x40C0, 0x0000, iwl22560_2ax_cfg_su_cdb)}, 890 914 {IWL_PCI_DEVICE(0x40C0, 0x0010, iwl22560_2ax_cfg_su_cdb)}, 891 915 {IWL_PCI_DEVICE(0x40c0, 0x0090, iwl22560_2ax_cfg_su_cdb)}, 892 916 {IWL_PCI_DEVICE(0x40C0, 0x0310, iwl22560_2ax_cfg_su_cdb)}, 893 917 {IWL_PCI_DEVICE(0x40C0, 0x0A10, iwl22560_2ax_cfg_su_cdb)}, 894 - {IWL_PCI_DEVICE(0x43F0, 0x0040, iwl22000_2ax_cfg_hr)}, 895 - {IWL_PCI_DEVICE(0x43F0, 0x0070, iwl22000_2ax_cfg_hr)}, 896 - {IWL_PCI_DEVICE(0x43F0, 0x0078, iwl22000_2ax_cfg_hr)}, 897 - {IWL_PCI_DEVICE(0xA0F0, 0x0000, iwl22000_2ax_cfg_hr)}, 898 - {IWL_PCI_DEVICE(0xA0F0, 0x0040, iwl22000_2ax_cfg_hr)}, 899 - {IWL_PCI_DEVICE(0xA0F0, 0x0070, iwl22000_2ax_cfg_hr)}, 900 - {IWL_PCI_DEVICE(0xA0F0, 0x0078, iwl22000_2ax_cfg_hr)}, 901 - {IWL_PCI_DEVICE(0xA0F0, 0x00B0, iwl22000_2ax_cfg_hr)}, 902 - {IWL_PCI_DEVICE(0xA0F0, 0x0A10, iwl22000_2ax_cfg_hr)}, 918 + {IWL_PCI_DEVICE(0x43F0, 0x0040, iwl22560_2ax_cfg_hr)}, 919 + {IWL_PCI_DEVICE(0x43F0, 0x0070, iwl22560_2ax_cfg_hr)}, 920 + {IWL_PCI_DEVICE(0x43F0, 0x0074, iwl22560_2ax_cfg_hr)}, 921 + {IWL_PCI_DEVICE(0x43F0, 0x0078, iwl22560_2ax_cfg_hr)}, 922 + {IWL_PCI_DEVICE(0x43F0, 0x007C, iwl22560_2ax_cfg_hr)}, 923 + {IWL_PCI_DEVICE(0x43F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)}, 924 + {IWL_PCI_DEVICE(0x43F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)}, 925 + {IWL_PCI_DEVICE(0x43F0, 0x4070, iwl22560_2ax_cfg_hr)}, 926 + {IWL_PCI_DEVICE(0xA0F0, 0x0000, iwl22560_2ax_cfg_hr)}, 927 + {IWL_PCI_DEVICE(0xA0F0, 0x0040, iwl22560_2ax_cfg_hr)}, 928 + {IWL_PCI_DEVICE(0xA0F0, 0x0070, iwl22560_2ax_cfg_hr)}, 929 + {IWL_PCI_DEVICE(0xA0F0, 0x0074, iwl22560_2ax_cfg_hr)}, 930 + {IWL_PCI_DEVICE(0xA0F0, 0x0078, iwl22560_2ax_cfg_hr)}, 931 + {IWL_PCI_DEVICE(0xA0F0, 0x007C, iwl22560_2ax_cfg_hr)}, 932 + {IWL_PCI_DEVICE(0xA0F0, 0x00B0, iwl22560_2ax_cfg_hr)}, 933 + {IWL_PCI_DEVICE(0xA0F0, 0x0A10, iwl22560_2ax_cfg_hr)}, 934 + {IWL_PCI_DEVICE(0xA0F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0)}, 935 + {IWL_PCI_DEVICE(0xA0F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0)}, 936 + {IWL_PCI_DEVICE(0xA0F0, 0x4070, iwl22560_2ax_cfg_hr)}, 937 + 938 + {IWL_PCI_DEVICE(0x2723, 0x0080, iwl22260_2ax_cfg)}, 939 + {IWL_PCI_DEVICE(0x2723, 0x0084, iwl22260_2ax_cfg)}, 940 + {IWL_PCI_DEVICE(0x2723, 0x0088, iwl22260_2ax_cfg)}, 941 + {IWL_PCI_DEVICE(0x2723, 0x008C, iwl22260_2ax_cfg)}, 942 + {IWL_PCI_DEVICE(0x2723, 0x4080, iwl22260_2ax_cfg)}, 943 + {IWL_PCI_DEVICE(0x2723, 0x4088, iwl22260_2ax_cfg)}, 944 + 945 + {IWL_PCI_DEVICE(0x1a56, 0x1653, killer1650w_2ax_cfg)}, 946 + {IWL_PCI_DEVICE(0x1a56, 0x1654, killer1650x_2ax_cfg)}, 903 947 904 948 #endif /* CONFIG_IWLMVM */ 905 949
+40 -6
drivers/net/wireless/intel/iwlwifi/pcie/internal.h
··· 1 1 /****************************************************************************** 2 2 * 3 + * This file is provided under a dual BSD/GPLv2 license. When using or 4 + * redistributing this file, you may do so under either license. 5 + * 6 + * GPL LICENSE SUMMARY 7 + * 3 8 * Copyright(c) 2003 - 2015 Intel Corporation. All rights reserved. 4 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 5 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 6 11 * Copyright(c) 2018 Intel Corporation 7 - * 8 - * Portions of this file are derived from the ipw3945 project, as well 9 - * as portions of the ieee80211 subsystem header files. 10 12 * 11 13 * This program is free software; you can redistribute it and/or modify it 12 14 * under the terms of version 2 of the GNU General Public License as ··· 20 18 * more details. 21 19 * 22 20 * The full GNU General Public License is included in this distribution in the 23 - * file called LICENSE. 21 + * file called COPYING. 24 22 * 25 23 * Contact Information: 26 24 * Intel Linux Wireless <linuxwifi@intel.com> 27 25 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 26 + * 27 + * BSD LICENSE 28 + * 29 + * Copyright(c) 2003 - 2015 Intel Corporation. All rights reserved. 30 + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 31 + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 32 + * Copyright(c) 2018 Intel Corporation 33 + * All rights reserved. 34 + * 35 + * Redistribution and use in source and binary forms, with or without 36 + * modification, are permitted provided that the following conditions 37 + * are met: 38 + * 39 + * * Redistributions of source code must retain the above copyright 40 + * notice, this list of conditions and the following disclaimer. 41 + * * Redistributions in binary form must reproduce the above copyright 42 + * notice, this list of conditions and the following disclaimer in 43 + * the documentation and/or other materials provided with the 44 + * distribution. 45 + * * Neither the name Intel Corporation nor the names of its 46 + * contributors may be used to endorse or promote products derived 47 + * from this software without specific prior written permission. 48 + * 49 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 50 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 51 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 52 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 53 + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 54 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 55 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 56 + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 57 + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 58 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 59 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 60 * 29 61 *****************************************************************************/ 30 62 #ifndef __iwl_trans_int_pcie_h__ ··· 1064 1028 1065 1029 int iwl_pci_fw_exit_d0i3(struct iwl_trans *trans); 1066 1030 int iwl_pci_fw_enter_d0i3(struct iwl_trans *trans); 1067 - 1068 - void iwl_pcie_enable_rx_wake(struct iwl_trans *trans, bool enable); 1069 1031 1070 1032 void iwl_pcie_rx_allocator_work(struct work_struct *data); 1071 1033
+47 -31
drivers/net/wireless/intel/iwlwifi/pcie/rx.c
··· 1 1 /****************************************************************************** 2 2 * 3 + * This file is provided under a dual BSD/GPLv2 license. When using or 4 + * redistributing this file, you may do so under either license. 5 + * 6 + * GPL LICENSE SUMMARY 7 + * 3 8 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 4 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 5 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 6 11 * Copyright(c) 2018 Intel Corporation 7 - * 8 - * Portions of this file are derived from the ipw3945 project, as well 9 - * as portions of the ieee80211 subsystem header files. 10 12 * 11 13 * This program is free software; you can redistribute it and/or modify it 12 14 * under the terms of version 2 of the GNU General Public License as ··· 20 18 * more details. 21 19 * 22 20 * The full GNU General Public License is included in this distribution in the 23 - * file called LICENSE. 21 + * file called COPYING. 24 22 * 25 23 * Contact Information: 26 24 * Intel Linux Wireless <linuxwifi@intel.com> 27 25 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 26 + * 27 + * BSD LICENSE 28 + * 29 + * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 30 + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 31 + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 32 + * Copyright(c) 2018 Intel Corporation 33 + * All rights reserved. 34 + * 35 + * Redistribution and use in source and binary forms, with or without 36 + * modification, are permitted provided that the following conditions 37 + * are met: 38 + * 39 + * * Redistributions of source code must retain the above copyright 40 + * notice, this list of conditions and the following disclaimer. 41 + * * Redistributions in binary form must reproduce the above copyright 42 + * notice, this list of conditions and the following disclaimer in 43 + * the documentation and/or other materials provided with the 44 + * distribution. 45 + * * Neither the name Intel Corporation nor the names of its 46 + * contributors may be used to endorse or promote products derived 47 + * from this software without specific prior written permission. 48 + * 49 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 50 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 51 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 52 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 53 + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 54 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 55 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 56 + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 57 + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 58 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 59 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 60 * 29 61 *****************************************************************************/ 30 62 #include <linux/sched.h> ··· 292 256 293 257 bd[rxq->write] = cpu_to_le64(rxb->page_dma | rxb->vid); 294 258 } 259 + 260 + IWL_DEBUG_RX(trans, "Assigned virtual RB ID %u to queue %d index %d\n", 261 + (u32)rxb->vid, rxq->id, rxq->write); 295 262 } 296 263 297 264 /* ··· 899 860 iwl_set_bit(trans, CSR_INT_COALESCING, IWL_HOST_INT_OPER_MODE); 900 861 } 901 862 902 - void iwl_pcie_enable_rx_wake(struct iwl_trans *trans, bool enable) 903 - { 904 - if (trans->cfg->device_family != IWL_DEVICE_FAMILY_9000) 905 - return; 906 - 907 - if (CSR_HW_REV_STEP(trans->hw_rev) != SILICON_A_STEP) 908 - return; 909 - 910 - if (!trans->cfg->integrated) 911 - return; 912 - 913 - /* 914 - * Turn on the chicken-bits that cause MAC wakeup for RX-related 915 - * values. 916 - * This costs some power, but needed for W/A 9000 integrated A-step 917 - * bug where shadow registers are not in the retention list and their 918 - * value is lost when NIC powers down 919 - */ 920 - iwl_set_bit(trans, CSR_MAC_SHADOW_REG_CTRL, 921 - CSR_MAC_SHADOW_REG_CTRL_RX_WAKE); 922 - iwl_set_bit(trans, CSR_MAC_SHADOW_REG_CTL2, 923 - CSR_MAC_SHADOW_REG_CTL2_RX_WAKE); 924 - } 925 - 926 863 static void iwl_pcie_rx_mq_hw_init(struct iwl_trans *trans) 927 864 { 928 865 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); ··· 986 971 987 972 /* Set interrupt coalescing timer to default (2048 usecs) */ 988 973 iwl_write8(trans, CSR_INT_COALESCING, IWL_HOST_INT_TIMEOUT_DEF); 989 - 990 - iwl_pcie_enable_rx_wake(trans, true); 991 974 } 992 975 993 976 void iwl_pcie_rx_init_rxb_lists(struct iwl_rxq *rxq) ··· 1373 1360 if (rxb->invalid) 1374 1361 goto out_err; 1375 1362 1363 + IWL_DEBUG_RX(trans, "Got virtual RB ID %u\n", (u32)rxb->vid); 1364 + 1376 1365 if (trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) 1377 1366 rxb->size = le32_to_cpu(rxq->cd[i].size) & IWL_RX_CD_SIZE; 1378 1367 ··· 1426 1411 emergency = true; 1427 1412 } 1428 1413 1414 + IWL_DEBUG_RX(trans, "Q %d: HW = %d, SW = %d\n", rxq->id, r, i); 1415 + 1429 1416 rxb = iwl_pcie_get_rxb(trans, rxq, i); 1430 1417 if (!rxb) 1431 1418 goto out; 1432 1419 1433 - IWL_DEBUG_RX(trans, "Q %d: HW = %d, SW = %d\n", rxq->id, r, i); 1434 1420 iwl_pcie_rx_handle_rb(trans, rxq, rxb, emergency, i); 1435 1421 1436 1422 i = (i + 1) & (rxq->queue_size - 1);
+11 -34
drivers/net/wireless/intel/iwlwifi/pcie/trans.c
··· 1530 1530 iwl_clear_bit(trans, CSR_GP_CNTRL, 1531 1531 BIT(trans->cfg->csr->flag_init_done)); 1532 1532 1533 - iwl_pcie_enable_rx_wake(trans, false); 1534 - 1535 1533 if (reset) { 1536 1534 /* 1537 1535 * reset TX queues -- some of their registers reset during S3 ··· 1555 1557 *status = IWL_D3_STATUS_ALIVE; 1556 1558 return 0; 1557 1559 } 1558 - 1559 - iwl_pcie_enable_rx_wake(trans, true); 1560 1560 1561 1561 iwl_set_bit(trans, CSR_GP_CNTRL, 1562 1562 BIT(trans->cfg->csr->flag_mac_access_req)); ··· 1964 1968 struct iwl_trans_pcie_removal *removal = 1965 1969 container_of(wk, struct iwl_trans_pcie_removal, work); 1966 1970 struct pci_dev *pdev = removal->pdev; 1967 - char *prop[] = {"EVENT=INACCESSIBLE", NULL}; 1971 + static char *prop[] = {"EVENT=INACCESSIBLE", NULL}; 1968 1972 1969 1973 dev_err(&pdev->dev, "Device gone - attempting removal\n"); 1970 1974 kobject_uevent_env(&pdev->dev.kobj, KOBJ_CHANGE, prop); ··· 3114 3118 return len; 3115 3119 } 3116 3120 3117 - static int iwl_trans_get_fw_monitor_len(struct iwl_trans *trans, int *len) 3121 + static int iwl_trans_get_fw_monitor_len(struct iwl_trans *trans, u32 *len) 3118 3122 { 3119 3123 if (trans->num_blocks) { 3120 3124 *len += sizeof(struct iwl_fw_error_dump_data) + ··· 3169 3173 struct iwl_txq *cmdq = trans_pcie->txq[trans_pcie->cmd_queue]; 3170 3174 struct iwl_fw_error_dump_txcmd *txcmd; 3171 3175 struct iwl_trans_dump_data *dump_data; 3172 - u32 len, num_rbs = 0; 3173 - u32 monitor_len; 3176 + u32 len, num_rbs = 0, monitor_len = 0; 3174 3177 int i, ptr; 3175 3178 bool dump_rbs = test_bit(STATUS_FW_ERROR, &trans->status) && 3176 3179 !trans->cfg->mq_rx_supported && ··· 3186 3191 cmdq->n_window * (sizeof(*txcmd) + TFD_MAX_PAYLOAD_SIZE); 3187 3192 3188 3193 /* FW monitor */ 3189 - monitor_len = iwl_trans_get_fw_monitor_len(trans, &len); 3190 - 3191 - if (dump_mask == BIT(IWL_FW_ERROR_DUMP_FW_MONITOR)) { 3192 - dump_data = vzalloc(len); 3193 - if (!dump_data) 3194 - return NULL; 3195 - 3196 - data = (void *)dump_data->data; 3197 - len = iwl_trans_pcie_dump_monitor(trans, &data, monitor_len); 3198 - dump_data->len = len; 3199 - 3200 - return dump_data; 3201 - } 3194 + if (dump_mask & BIT(IWL_FW_ERROR_DUMP_FW_MONITOR)) 3195 + monitor_len = iwl_trans_get_fw_monitor_len(trans, &len); 3202 3196 3203 3197 /* CSR registers */ 3204 3198 if (dump_mask & BIT(IWL_FW_ERROR_DUMP_CSR)) ··· 3553 3569 } 3554 3570 } 3555 3571 3556 - /* 3557 - * 9000-series integrated A-step has a problem with suspend/resume 3558 - * and sometimes even causes the whole platform to get stuck. This 3559 - * workaround makes the hardware not go into the problematic state. 3560 - */ 3561 - if (trans->cfg->integrated && 3562 - trans->cfg->device_family == IWL_DEVICE_FAMILY_9000 && 3563 - CSR_HW_REV_STEP(trans->hw_rev) == SILICON_A_STEP) 3564 - iwl_set_bit(trans, CSR_HOST_CHICKEN, 3565 - CSR_HOST_CHICKEN_PM_IDLE_SRC_DIS_SB_PME); 3572 + IWL_DEBUG_INFO(trans, "HW REV: 0x%0x\n", trans->hw_rev); 3566 3573 3567 3574 #if IS_ENABLED(CONFIG_IWLMVM) 3568 3575 trans->hw_rf_id = iwl_read32(trans, CSR_HW_RF_ID); 3569 3576 3570 - if (cfg == &iwl22000_2ax_cfg_hr) { 3577 + if (cfg == &iwl22560_2ax_cfg_hr) { 3571 3578 if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) == 3572 3579 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR)) { 3573 - trans->cfg = &iwl22000_2ax_cfg_hr; 3580 + trans->cfg = &iwl22560_2ax_cfg_hr; 3574 3581 } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) == 3575 3582 CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_JF)) { 3576 3583 trans->cfg = &iwl22000_2ax_cfg_jf; ··· 3577 3602 goto out_no_pci; 3578 3603 } 3579 3604 } else if (CSR_HW_RF_ID_TYPE_CHIP_ID(trans->hw_rf_id) == 3580 - CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR)) { 3605 + CSR_HW_RF_ID_TYPE_CHIP_ID(CSR_HW_RF_ID_TYPE_HR) && 3606 + (trans->cfg != &iwl22260_2ax_cfg || 3607 + trans->hw_rev == CSR_HW_REV_TYPE_QNJ_B0)) { 3581 3608 u32 hw_status; 3582 3609 3583 3610 hw_status = iwl_read_prph(trans, UMAG_GEN_HW_STATUS);
+9 -5
drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c
··· 214 214 { 215 215 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); 216 216 int idx = iwl_pcie_gen2_get_num_tbs(trans, tfd); 217 - struct iwl_tfh_tb *tb = &tfd->tbs[idx]; 217 + struct iwl_tfh_tb *tb; 218 + 219 + if (WARN_ON(idx >= IWL_TFH_NUM_TBS)) 220 + return -EINVAL; 221 + tb = &tfd->tbs[idx]; 218 222 219 223 /* Each TFD can point to a maximum max_tbs Tx buffers */ 220 224 if (le16_to_cpu(tfd->num_tbs) >= trans_pcie->max_tbs) { ··· 412 408 goto out_err; 413 409 414 410 /* building the A-MSDU might have changed this data, memcpy it now */ 415 - memcpy(&txq->first_tb_bufs[idx], &dev_cmd->hdr, IWL_FIRST_TB_SIZE); 411 + memcpy(&txq->first_tb_bufs[idx], dev_cmd, IWL_FIRST_TB_SIZE); 416 412 return tfd; 417 413 418 414 out_err: ··· 473 469 tb_phys = iwl_pcie_get_first_tb_dma(txq, idx); 474 470 475 471 /* The first TB points to bi-directional DMA data */ 476 - memcpy(&txq->first_tb_bufs[idx], &dev_cmd->hdr, IWL_FIRST_TB_SIZE); 472 + memcpy(&txq->first_tb_bufs[idx], dev_cmd, IWL_FIRST_TB_SIZE); 477 473 478 474 iwl_pcie_gen2_set_tb(trans, tfd, tb_phys, IWL_FIRST_TB_SIZE); 479 475 ··· 838 834 839 835 /* start the TFD with the minimum copy bytes */ 840 836 tb0_size = min_t(int, copy_size, IWL_FIRST_TB_SIZE); 841 - memcpy(&txq->first_tb_bufs[idx], &out_cmd->hdr, tb0_size); 837 + memcpy(&txq->first_tb_bufs[idx], out_cmd, tb0_size); 842 838 iwl_pcie_gen2_set_tb(trans, tfd, iwl_pcie_get_first_tb_dma(txq, idx), 843 839 tb0_size); 844 840 845 841 /* map first command fragment, if any remains */ 846 842 if (copy_size > tb0_size) { 847 843 phys_addr = dma_map_single(trans->dev, 848 - ((u8 *)&out_cmd->hdr) + tb0_size, 844 + (u8 *)out_cmd + tb0_size, 849 845 copy_size - tb0_size, 850 846 DMA_TO_DEVICE); 851 847 if (dma_mapping_error(trans->dev, phys_addr)) {
+41 -6
drivers/net/wireless/intel/iwlwifi/pcie/tx.c
··· 1 1 /****************************************************************************** 2 2 * 3 + * This file is provided under a dual BSD/GPLv2 license. When using or 4 + * redistributing this file, you may do so under either license. 5 + * 6 + * GPL LICENSE SUMMARY 7 + * 3 8 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 4 9 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 5 10 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 6 11 * Copyright(c) 2018 Intel Corporation 7 - * 8 - * Portions of this file are derived from the ipw3945 project, as well 9 - * as portions of the ieee80211 subsystem header files. 10 12 * 11 13 * This program is free software; you can redistribute it and/or modify it 12 14 * under the terms of version 2 of the GNU General Public License as ··· 20 18 * more details. 21 19 * 22 20 * The full GNU General Public License is included in this distribution in the 23 - * file called LICENSE. 21 + * file called COPYING. 24 22 * 25 23 * Contact Information: 26 24 * Intel Linux Wireless <linuxwifi@intel.com> 27 25 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 26 + * 27 + * BSD LICENSE 28 + * 29 + * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved. 30 + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH 31 + * Copyright(c) 2016 - 2017 Intel Deutschland GmbH 32 + * Copyright(c) 2018 Intel Corporation 33 + * All rights reserved. 34 + * 35 + * Redistribution and use in source and binary forms, with or without 36 + * modification, are permitted provided that the following conditions 37 + * are met: 38 + * 39 + * * Redistributions of source code must retain the above copyright 40 + * notice, this list of conditions and the following disclaimer. 41 + * * Redistributions in binary form must reproduce the above copyright 42 + * notice, this list of conditions and the following disclaimer in 43 + * the documentation and/or other materials provided with the 44 + * distribution. 45 + * * Neither the name Intel Corporation nor the names of its 46 + * contributors may be used to endorse or promote products derived 47 + * from this software without specific prior written permission. 48 + * 49 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 50 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 51 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 52 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 53 + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 54 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 55 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 56 + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 57 + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 58 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 59 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 60 * 29 61 *****************************************************************************/ 30 62 #include <linux/etherdevice.h> ··· 2474 2438 } 2475 2439 2476 2440 /* building the A-MSDU might have changed this data, so memcpy it now */ 2477 - memcpy(&txq->first_tb_bufs[txq->write_ptr], &dev_cmd->hdr, 2478 - IWL_FIRST_TB_SIZE); 2441 + memcpy(&txq->first_tb_bufs[txq->write_ptr], dev_cmd, IWL_FIRST_TB_SIZE); 2479 2442 2480 2443 tfd = iwl_pcie_get_tfd(trans, txq, txq->write_ptr); 2481 2444 /* Set up entry for this TFD in Tx byte-count array */
-6
drivers/net/wireless/marvell/libertas/debugfs.c
··· 708 708 goto exit; 709 709 710 710 priv->debugfs_dir = debugfs_create_dir(dev->name, lbs_dir); 711 - if (!priv->debugfs_dir) 712 - goto exit; 713 711 714 712 for (i=0; i<ARRAY_SIZE(debugfs_files); i++) { 715 713 files = &debugfs_files[i]; ··· 719 721 } 720 722 721 723 priv->events_dir = debugfs_create_dir("subscribed_events", priv->debugfs_dir); 722 - if (!priv->events_dir) 723 - goto exit; 724 724 725 725 for (i=0; i<ARRAY_SIZE(debugfs_events_files); i++) { 726 726 files = &debugfs_events_files[i]; ··· 730 734 } 731 735 732 736 priv->regs_dir = debugfs_create_dir("registers", priv->debugfs_dir); 733 - if (!priv->regs_dir) 734 - goto exit; 735 737 736 738 for (i=0; i<ARRAY_SIZE(debugfs_regs_files); i++) { 737 739 files = &debugfs_regs_files[i];
+5
drivers/net/wireless/marvell/libertas/mesh.c
··· 797 797 { 798 798 int ret; 799 799 ret = sysfs_create_group(&(dev->dev.kobj), &boot_opts_group); 800 + if (ret) 801 + pr_err("failed to create boot_opts_group.\n"); 802 + 800 803 ret = sysfs_create_group(&(dev->dev.kobj), &mesh_ie_group); 804 + if (ret) 805 + pr_err("failed to create mesh_ie_group.\n"); 801 806 } 802 807 803 808 static void lbs_persist_config_remove(struct net_device *dev)
+1 -1
drivers/net/wireless/marvell/libertas_tf/main.c
··· 676 676 ieee80211_unregister_hw(hw); 677 677 ieee80211_free_hw(hw); 678 678 679 - lbtf_deb_leave(LBTF_DEB_MAIN); 679 + lbtf_deb_leave(LBTF_DEB_MAIN); 680 680 return 0; 681 681 } 682 682 EXPORT_SYMBOL_GPL(lbtf_remove_card);
+1 -1
drivers/net/wireless/marvell/mwifiex/Kconfig
··· 9 9 mwifiex. 10 10 11 11 config MWIFIEX_SDIO 12 - tristate "Marvell WiFi-Ex Driver for SD8786/SD8787/SD8797/SD8887/SD8897/SD8997" 12 + tristate "Marvell WiFi-Ex Driver for SD8786/SD8787/SD8797/SD8887/SD8897/SD8977/SD8997" 13 13 depends on MWIFIEX && MMC 14 14 select FW_LOADER 15 15 select WANT_DEV_COREDUMP
+2 -3
drivers/net/wireless/marvell/mwifiex/debugfs.c
··· 922 922 } 923 923 924 924 #define MWIFIEX_DFS_ADD_FILE(name) do { \ 925 - if (!debugfs_create_file(#name, 0644, priv->dfs_dev_dir, \ 926 - priv, &mwifiex_dfs_##name##_fops)) \ 927 - return; \ 925 + debugfs_create_file(#name, 0644, priv->dfs_dev_dir, priv, \ 926 + &mwifiex_dfs_##name##_fops); \ 928 927 } while (0); 929 928 930 929 #define MWIFIEX_DFS_FILE_OPS(name) \
+5
drivers/net/wireless/marvell/mwifiex/sdio.c
··· 489 489 #define SDIO_DEVICE_ID_MARVELL_8887 (0x9135) 490 490 /* Device ID for SD8801 */ 491 491 #define SDIO_DEVICE_ID_MARVELL_8801 (0x9139) 492 + /* Device ID for SD8977 */ 493 + #define SDIO_DEVICE_ID_MARVELL_8977 (0x9145) 492 494 /* Device ID for SD8997 */ 493 495 #define SDIO_DEVICE_ID_MARVELL_8997 (0x9141) 494 496 ··· 509 507 .driver_data = (unsigned long)&mwifiex_sdio_sd8887}, 510 508 {SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, SDIO_DEVICE_ID_MARVELL_8801), 511 509 .driver_data = (unsigned long)&mwifiex_sdio_sd8801}, 510 + {SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, SDIO_DEVICE_ID_MARVELL_8977), 511 + .driver_data = (unsigned long)&mwifiex_sdio_sd8977}, 512 512 {SDIO_DEVICE(SDIO_VENDOR_ID_MARVELL, SDIO_DEVICE_ID_MARVELL_8997), 513 513 .driver_data = (unsigned long)&mwifiex_sdio_sd8997}, 514 514 {}, ··· 2730 2726 MODULE_FIRMWARE(SD8797_DEFAULT_FW_NAME); 2731 2727 MODULE_FIRMWARE(SD8897_DEFAULT_FW_NAME); 2732 2728 MODULE_FIRMWARE(SD8887_DEFAULT_FW_NAME); 2729 + MODULE_FIRMWARE(SD8977_DEFAULT_FW_NAME); 2733 2730 MODULE_FIRMWARE(SD8997_DEFAULT_FW_NAME);
+70
drivers/net/wireless/marvell/mwifiex/sdio.h
··· 36 36 #define SD8897_DEFAULT_FW_NAME "mrvl/sd8897_uapsta.bin" 37 37 #define SD8887_DEFAULT_FW_NAME "mrvl/sd8887_uapsta.bin" 38 38 #define SD8801_DEFAULT_FW_NAME "mrvl/sd8801_uapsta.bin" 39 + #define SD8977_DEFAULT_FW_NAME "mrvl/sd8977_uapsta.bin" 39 40 #define SD8997_DEFAULT_FW_NAME "mrvl/sd8997_uapsta.bin" 40 41 41 42 #define BLOCK_MODE 1 ··· 372 371 0x59, 0x5c, 0x5d}, 373 372 }; 374 373 374 + static const struct mwifiex_sdio_card_reg mwifiex_reg_sd8977 = { 375 + .start_rd_port = 0, 376 + .start_wr_port = 0, 377 + .base_0_reg = 0xF8, 378 + .base_1_reg = 0xF9, 379 + .poll_reg = 0x5C, 380 + .host_int_enable = UP_LD_HOST_INT_MASK | DN_LD_HOST_INT_MASK | 381 + CMD_PORT_UPLD_INT_MASK | CMD_PORT_DNLD_INT_MASK, 382 + .host_int_rsr_reg = 0x4, 383 + .host_int_status_reg = 0x0C, 384 + .host_int_mask_reg = 0x08, 385 + .status_reg_0 = 0xE8, 386 + .status_reg_1 = 0xE9, 387 + .sdio_int_mask = 0xff, 388 + .data_port_mask = 0xffffffff, 389 + .io_port_0_reg = 0xE4, 390 + .io_port_1_reg = 0xE5, 391 + .io_port_2_reg = 0xE6, 392 + .max_mp_regs = 196, 393 + .rd_bitmap_l = 0x10, 394 + .rd_bitmap_u = 0x11, 395 + .rd_bitmap_1l = 0x12, 396 + .rd_bitmap_1u = 0x13, 397 + .wr_bitmap_l = 0x14, 398 + .wr_bitmap_u = 0x15, 399 + .wr_bitmap_1l = 0x16, 400 + .wr_bitmap_1u = 0x17, 401 + .rd_len_p0_l = 0x18, 402 + .rd_len_p0_u = 0x19, 403 + .card_misc_cfg_reg = 0xd8, 404 + .card_cfg_2_1_reg = 0xd9, 405 + .cmd_rd_len_0 = 0xc0, 406 + .cmd_rd_len_1 = 0xc1, 407 + .cmd_rd_len_2 = 0xc2, 408 + .cmd_rd_len_3 = 0xc3, 409 + .cmd_cfg_0 = 0xc4, 410 + .cmd_cfg_1 = 0xc5, 411 + .cmd_cfg_2 = 0xc6, 412 + .cmd_cfg_3 = 0xc7, 413 + .fw_dump_host_ready = 0xcc, 414 + .fw_dump_ctrl = 0xf0, 415 + .fw_dump_start = 0xf1, 416 + .fw_dump_end = 0xf8, 417 + .func1_dump_reg_start = 0x10, 418 + .func1_dump_reg_end = 0x17, 419 + .func1_scratch_reg = 0xe8, 420 + .func1_spec_reg_num = 13, 421 + .func1_spec_reg_table = {0x08, 0x58, 0x5C, 0x5D, 422 + 0x60, 0x61, 0x62, 0x64, 423 + 0x65, 0x66, 0x68, 0x69, 424 + 0x6a}, 425 + }; 426 + 375 427 static const struct mwifiex_sdio_card_reg mwifiex_reg_sd8997 = { 376 428 .start_rd_port = 0, 377 429 .start_wr_port = 0, ··· 582 528 .supports_sdio_new_mode = true, 583 529 .has_control_mask = false, 584 530 .can_dump_fw = true, 531 + .can_auto_tdls = false, 532 + .can_ext_scan = true, 533 + }; 534 + 535 + static const struct mwifiex_sdio_device mwifiex_sdio_sd8977 = { 536 + .firmware = SD8977_DEFAULT_FW_NAME, 537 + .reg = &mwifiex_reg_sd8977, 538 + .max_ports = 32, 539 + .mp_agg_pkt_limit = 16, 540 + .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_4K, 541 + .mp_tx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_MAX, 542 + .mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_MAX, 543 + .supports_sdio_new_mode = true, 544 + .has_control_mask = false, 545 + .can_dump_fw = true, 546 + .fw_dump_enh = true, 585 547 .can_auto_tdls = false, 586 548 .can_ext_scan = true, 587 549 };
+19 -12
drivers/net/wireless/mediatek/mt76/dma.c
··· 300 300 if (q->queued + (n + 1) / 2 >= q->ndesc - 1) 301 301 goto unmap; 302 302 303 - return dev->queue_ops->add_buf(dev, q, buf, n, tx_info, skb, t); 303 + return mt76_dma_add_buf(dev, q, buf, n, tx_info, skb, t); 304 304 305 305 unmap: 306 306 ret = -ENOMEM; ··· 318 318 EXPORT_SYMBOL_GPL(mt76_dma_tx_queue_skb); 319 319 320 320 static int 321 - mt76_dma_rx_fill(struct mt76_dev *dev, struct mt76_queue *q, bool napi) 321 + mt76_dma_rx_fill(struct mt76_dev *dev, struct mt76_queue *q) 322 322 { 323 323 dma_addr_t addr; 324 324 void *buf; ··· 392 392 393 393 mt76_dma_rx_cleanup(dev, q); 394 394 mt76_dma_sync_idx(dev, q); 395 - mt76_dma_rx_fill(dev, q, false); 395 + mt76_dma_rx_fill(dev, q); 396 396 } 397 397 398 398 static void ··· 417 417 static int 418 418 mt76_dma_rx_process(struct mt76_dev *dev, struct mt76_queue *q, int budget) 419 419 { 420 + int len, data_len, done = 0; 420 421 struct sk_buff *skb; 421 422 unsigned char *data; 422 - int len; 423 - int done = 0; 424 423 bool more; 425 424 426 425 while (done < budget) { ··· 428 429 data = mt76_dma_dequeue(dev, q, false, &len, &info, &more); 429 430 if (!data) 430 431 break; 432 + 433 + if (q->rx_head) 434 + data_len = q->buf_size; 435 + else 436 + data_len = SKB_WITH_OVERHEAD(q->buf_size); 437 + 438 + if (data_len < len + q->buf_offset) { 439 + dev_kfree_skb(q->rx_head); 440 + q->rx_head = NULL; 441 + 442 + skb_free_frag(data); 443 + continue; 444 + } 431 445 432 446 if (q->rx_head) { 433 447 mt76_add_fragment(dev, q, data, len, more); ··· 452 440 skb_free_frag(data); 453 441 continue; 454 442 } 455 - 456 443 skb_reserve(skb, q->buf_offset); 457 - if (skb->tail + len > skb->end) { 458 - dev_kfree_skb(skb); 459 - continue; 460 - } 461 444 462 445 if (q == &dev->q_rx[MT_RXQ_MCU]) { 463 446 u32 *rxfce = (u32 *) skb->cb; ··· 470 463 dev->drv->rx_skb(dev, q - dev->q_rx, skb); 471 464 } 472 465 473 - mt76_dma_rx_fill(dev, q, true); 466 + mt76_dma_rx_fill(dev, q); 474 467 return done; 475 468 } 476 469 ··· 511 504 for (i = 0; i < ARRAY_SIZE(dev->q_rx); i++) { 512 505 netif_napi_add(&dev->napi_dev, &dev->napi[i], mt76_dma_rx_poll, 513 506 64); 514 - mt76_dma_rx_fill(dev, &dev->q_rx[i], false); 507 + mt76_dma_rx_fill(dev, &dev->q_rx[i]); 515 508 skb_queue_head_init(&dev->rx_skb[i]); 516 509 napi_enable(&dev->napi[i]); 517 510 }
+66 -2
drivers/net/wireless/mediatek/mt76/mac80211.c
··· 328 328 ieee80211_hw_set(hw, MFP_CAPABLE); 329 329 ieee80211_hw_set(hw, AP_LINK_PS); 330 330 ieee80211_hw_set(hw, REPORTS_TX_ACK_STATUS); 331 + ieee80211_hw_set(hw, NEEDS_UNIQUE_STA_ADDR); 331 332 332 333 wiphy->flags |= WIPHY_FLAG_IBSS_RSN; 333 334 ··· 548 547 } 549 548 550 549 static void 551 - mt76_check_ps(struct mt76_dev *dev, struct sk_buff *skb) 550 + mt76_check_sta(struct mt76_dev *dev, struct sk_buff *skb) 552 551 { 553 552 struct mt76_rx_status *status = (struct mt76_rx_status *) skb->cb; 554 553 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; ··· 566 565 return; 567 566 568 567 sta = container_of((void *) wcid, struct ieee80211_sta, drv_priv); 568 + 569 + if (status->signal <= 0) 570 + ewma_signal_add(&wcid->rssi, -status->signal); 571 + 572 + wcid->inactive_count = 0; 569 573 570 574 if (!test_bit(MT_WCID_FLAG_CHECK_PS, &wcid->flags)) 571 575 return; ··· 631 625 __skb_queue_head_init(&frames); 632 626 633 627 while ((skb = __skb_dequeue(&dev->rx_skb[q])) != NULL) { 634 - mt76_check_ps(dev, skb); 628 + mt76_check_sta(dev, skb); 635 629 mt76_rx_aggr_reorder(skb, &frames); 636 630 } 637 631 ··· 665 659 mt76_txq_init(dev, sta->txq[i]); 666 660 } 667 661 662 + ewma_signal_init(&wcid->rssi); 668 663 rcu_assign_pointer(dev->wcid[wcid->idx], wcid); 669 664 670 665 out: ··· 716 709 return 0; 717 710 } 718 711 EXPORT_SYMBOL_GPL(mt76_sta_state); 712 + 713 + int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 714 + int *dbm) 715 + { 716 + struct mt76_dev *dev = hw->priv; 717 + int n_chains = __sw_hweight8(dev->antenna_mask); 718 + 719 + *dbm = dev->txpower_cur / 2; 720 + 721 + /* convert from per-chain power to combined 722 + * output on 2x2 devices 723 + */ 724 + if (n_chains > 1) 725 + *dbm += 3; 726 + 727 + return 0; 728 + } 729 + EXPORT_SYMBOL_GPL(mt76_get_txpower); 730 + 731 + static void 732 + __mt76_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif) 733 + { 734 + if (vif->csa_active && ieee80211_csa_is_complete(vif)) 735 + ieee80211_csa_finish(vif); 736 + } 737 + 738 + void mt76_csa_finish(struct mt76_dev *dev) 739 + { 740 + if (!dev->csa_complete) 741 + return; 742 + 743 + ieee80211_iterate_active_interfaces_atomic(dev->hw, 744 + IEEE80211_IFACE_ITER_RESUME_ALL, 745 + __mt76_csa_finish, dev); 746 + 747 + dev->csa_complete = 0; 748 + } 749 + EXPORT_SYMBOL_GPL(mt76_csa_finish); 750 + 751 + static void 752 + __mt76_csa_check(void *priv, u8 *mac, struct ieee80211_vif *vif) 753 + { 754 + struct mt76_dev *dev = priv; 755 + 756 + if (!vif->csa_active) 757 + return; 758 + 759 + dev->csa_complete |= ieee80211_csa_is_complete(vif); 760 + } 761 + 762 + void mt76_csa_check(struct mt76_dev *dev) 763 + { 764 + ieee80211_iterate_active_interfaces_atomic(dev->hw, 765 + IEEE80211_IFACE_ITER_RESUME_ALL, 766 + __mt76_csa_check, dev); 767 + } 768 + EXPORT_SYMBOL_GPL(mt76_csa_check);
+21 -2
drivers/net/wireless/mediatek/mt76/mt76.h
··· 23 23 #include <linux/skbuff.h> 24 24 #include <linux/leds.h> 25 25 #include <linux/usb.h> 26 + #include <linux/average.h> 26 27 #include <net/mac80211.h> 27 28 #include "util.h" 28 29 ··· 175 174 176 175 #define MT76_N_WCIDS 128 177 176 177 + DECLARE_EWMA(signal, 10, 8); 178 + 178 179 struct mt76_wcid { 179 180 struct mt76_rx_tid __rcu *aggr[IEEE80211_NUM_TIDS]; 180 181 181 182 struct work_struct aggr_work; 182 183 183 184 unsigned long flags; 185 + 186 + struct ewma_signal rssi; 187 + int inactive_count; 184 188 185 189 u8 idx; 186 190 u8 hw_key_idx; ··· 245 239 #define MT_TX_CB_TXS_FAILED BIT(2) 246 240 247 241 #define MT_PACKET_ID_MASK GENMASK(7, 0) 248 - #define MT_PACKET_ID_NO_ACK MT_PACKET_ID_MASK 242 + #define MT_PACKET_ID_NO_ACK 0 243 + #define MT_PACKET_ID_NO_SKB 1 244 + #define MT_PACKET_ID_FIRST 2 249 245 250 246 #define MT_TX_STATUS_SKB_TIMEOUT HZ 251 247 ··· 429 421 struct mt76_queue q_tx[__MT_TXQ_MAX]; 430 422 struct mt76_queue q_rx[__MT_RXQ_MAX]; 431 423 const struct mt76_queue_ops *queue_ops; 424 + int tx_dma_idx[4]; 432 425 433 426 wait_queue_head_t tx_wait; 434 427 struct sk_buff_head status_list; ··· 462 453 char led_name[32]; 463 454 bool led_al; 464 455 u8 led_pin; 456 + 457 + u8 csa_complete; 465 458 466 459 u32 rxfilter; 467 460 ··· 499 488 u8 rate_idx; 500 489 u8 nss; 501 490 u8 band; 502 - u8 signal; 491 + s8 signal; 503 492 u8 chains; 504 493 s8 chain_signal[IEEE80211_MAX_CHAINS]; 505 494 }; ··· 687 676 enum ieee80211_sta_state new_state); 688 677 689 678 struct ieee80211_sta *mt76_rx_convert(struct sk_buff *skb); 679 + 680 + int mt76_get_min_avg_rssi(struct mt76_dev *dev); 681 + 682 + int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 683 + int *dbm); 684 + 685 + void mt76_csa_check(struct mt76_dev *dev); 686 + void mt76_csa_finish(struct mt76_dev *dev); 690 687 691 688 /* internal */ 692 689 void mt76_tx_free(struct mt76_dev *dev);
+1
drivers/net/wireless/mediatek/mt76/mt76x0/initvals.h
··· 88 88 { MT_TX_PROT_CFG6, 0xe3f42004 }, 89 89 { MT_TX_PROT_CFG7, 0xe3f42084 }, 90 90 { MT_TX_PROT_CFG8, 0xe3f42104 }, 91 + { MT_VHT_HT_FBK_CFG1, 0xedcba980 }, 91 92 }; 92 93 93 94 static const struct mt76_reg_pair mt76x0_bbp_init_tab[] = {
+10 -1
drivers/net/wireless/mediatek/mt76/mt76x0/pci.c
··· 99 99 .sta_rate_tbl_update = mt76x02_sta_rate_tbl_update, 100 100 .wake_tx_queue = mt76_wake_tx_queue, 101 101 .get_survey = mt76_get_survey, 102 - .get_txpower = mt76x02_get_txpower, 102 + .get_txpower = mt76_get_txpower, 103 103 .flush = mt76x0e_flush, 104 104 .set_tim = mt76x0e_set_tim, 105 105 .release_buffered_frames = mt76_release_buffered_frames, ··· 140 140 141 141 mt76_clear(dev, 0x110, BIT(9)); 142 142 mt76_set(dev, MT_MAX_LEN_CFG, BIT(13)); 143 + 144 + mt76_wr(dev, MT_CH_TIME_CFG, 145 + MT_CH_TIME_CFG_TIMER_EN | 146 + MT_CH_TIME_CFG_TX_AS_BUSY | 147 + MT_CH_TIME_CFG_RX_AS_BUSY | 148 + MT_CH_TIME_CFG_NAV_AS_BUSY | 149 + MT_CH_TIME_CFG_EIFS_AS_BUSY | 150 + MT_CH_CCA_RC_EN | 151 + FIELD_PREP(MT_CH_TIME_CFG_CH_TIMER_CLR, 1)); 143 152 144 153 err = mt76x0_register_device(dev); 145 154 if (err < 0)
+5 -1
drivers/net/wireless/mediatek/mt76/mt76x0/phy.c
··· 1013 1013 mt76x0_phy_calibrate(dev, false); 1014 1014 mt76x0_phy_set_txpower(dev); 1015 1015 1016 + mt76x02_edcca_init(dev); 1017 + 1016 1018 ieee80211_queue_delayed_work(dev->mt76.hw, &dev->cal_work, 1017 1019 MT_CALIBRATE_INTERVAL); 1018 1020 ··· 1077 1075 u8 gain_delta; 1078 1076 int low_gain; 1079 1077 1080 - dev->cal.avg_rssi_all = mt76x02_phy_get_min_avg_rssi(dev); 1078 + dev->cal.avg_rssi_all = mt76_get_min_avg_rssi(&dev->mt76); 1079 + if (!dev->cal.avg_rssi_all) 1080 + dev->cal.avg_rssi_all = -75; 1081 1081 1082 1082 low_gain = (dev->cal.avg_rssi_all > mt76x02_get_rssi_gain_thresh(dev)) + 1083 1083 (dev->cal.avg_rssi_all > mt76x02_get_low_rssi_gain_thresh(dev));
+1 -1
drivers/net/wireless/mediatek/mt76/mt76x0/usb.c
··· 155 155 .sta_rate_tbl_update = mt76x02_sta_rate_tbl_update, 156 156 .set_rts_threshold = mt76x02_set_rts_threshold, 157 157 .wake_tx_queue = mt76_wake_tx_queue, 158 - .get_txpower = mt76x02_get_txpower, 158 + .get_txpower = mt76_get_txpower, 159 159 }; 160 160 161 161 static int mt76x0u_register_device(struct mt76x02_dev *dev)
+1
drivers/net/wireless/mediatek/mt76/mt76x0/usb_mcu.c
··· 15 15 */ 16 16 #include <linux/kernel.h> 17 17 #include <linux/firmware.h> 18 + #include <linux/module.h> 18 19 19 20 #include "mt76x0.h" 20 21 #include "mcu.h"
+17 -5
drivers/net/wireless/mediatek/mt76/mt76x02.h
··· 15 15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 16 */ 17 17 18 - #ifndef __MT76X02_UTIL_H 19 - #define __MT76X02_UTIL_H 18 + #ifndef __MT76x02_H 19 + #define __MT76x02_H 20 20 21 21 #include <linux/kfifo.h> 22 22 ··· 27 27 #include "mt76x02_dma.h" 28 28 29 29 #define MT_CALIBRATE_INTERVAL HZ 30 + 31 + #define MT_WATCHDOG_TIME (HZ / 10) 32 + #define MT_TX_HANG_TH 10 30 33 31 34 #define MT_MAX_CHAINS 2 32 35 struct mt76x02_rx_freq_cal { ··· 82 79 struct tasklet_struct pre_tbtt_tasklet; 83 80 struct delayed_work cal_work; 84 81 struct delayed_work mac_work; 82 + struct delayed_work wdt_work; 85 83 86 84 u32 aggr_stats[32]; 87 85 ··· 92 88 93 89 u8 tbtt_count; 94 90 u16 beacon_int; 91 + 92 + u32 tx_hang_reset; 93 + u8 tx_hang_check; 95 94 96 95 struct mt76x02_calibration cal; 97 96 ··· 108 101 u8 slottime; 109 102 110 103 struct mt76x02_dfs_pattern_detector dfs_pd; 104 + 105 + /* edcca monitor */ 106 + bool ed_tx_blocked; 107 + bool ed_monitor; 108 + u8 ed_trigger; 109 + u8 ed_silent; 111 110 }; 112 111 113 112 extern struct ieee80211_rate mt76x02_rates[12]; ··· 149 136 const struct ieee80211_tx_rate *rate); 150 137 s8 mt76x02_tx_get_txpwr_adj(struct mt76x02_dev *dev, s8 txpwr, 151 138 s8 max_txpwr_adj); 139 + void mt76x02_wdt_work(struct work_struct *work); 152 140 void mt76x02_tx_set_txpwr_auto(struct mt76x02_dev *dev, s8 txpwr); 153 141 void mt76x02_set_tx_ackto(struct mt76x02_dev *dev); 154 142 void mt76x02_set_coverage_class(struct ieee80211_hw *hw, ··· 172 158 const u8 *mac); 173 159 void mt76x02_sw_scan_complete(struct ieee80211_hw *hw, 174 160 struct ieee80211_vif *vif); 175 - int mt76x02_get_txpower(struct ieee80211_hw *hw, 176 - struct ieee80211_vif *vif, int *dbm); 177 161 void mt76x02_sta_ps(struct mt76_dev *dev, struct ieee80211_sta *sta, bool ps); 178 162 void mt76x02_bss_info_changed(struct ieee80211_hw *hw, 179 163 struct ieee80211_vif *vif, ··· 236 224 return &sta->vif->group_wcid; 237 225 } 238 226 239 - #endif 227 + #endif /* __MT76x02_H */
+2
drivers/net/wireless/mediatek/mt76/mt76x02_debugfs.c
··· 133 133 read_txpower); 134 134 135 135 debugfs_create_devm_seqfile(dev->mt76.dev, "agc", dir, read_agc); 136 + 137 + debugfs_create_u32("tx_hang_reset", 0400, dir, &dev->tx_hang_reset); 136 138 } 137 139 EXPORT_SYMBOL_GPL(mt76x02_init_debugfs);
+6
drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c
··· 881 881 { 882 882 struct mt76x02_dfs_pattern_detector *dfs_pd = &dev->dfs_pd; 883 883 884 + mutex_lock(&dev->mt76.mutex); 884 885 if (dfs_pd->region != region) { 885 886 tasklet_disable(&dfs_pd->dfs_tasklet); 887 + 888 + dev->ed_monitor = region == NL80211_DFS_ETSI; 889 + mt76x02_edcca_init(dev); 890 + 886 891 dfs_pd->region = region; 887 892 mt76x02_dfs_init_params(dev); 888 893 tasklet_enable(&dfs_pd->dfs_tasklet); 889 894 } 895 + mutex_unlock(&dev->mt76.mutex); 890 896 } 891 897 892 898 void mt76x02_regd_notifier(struct wiphy *wiphy,
+189 -33
drivers/net/wireless/mediatek/mt76/mt76x02_mac.c
··· 130 130 mt76x02_mac_tx_rate_val(struct mt76x02_dev *dev, 131 131 const struct ieee80211_tx_rate *rate, u8 *nss_val) 132 132 { 133 + u8 phy, rate_idx, nss, bw = 0; 133 134 u16 rateval; 134 - u8 phy, rate_idx; 135 - u8 nss = 1; 136 - u8 bw = 0; 137 135 138 136 if (rate->flags & IEEE80211_TX_RC_VHT_MCS) { 139 137 rate_idx = rate->idx; ··· 162 164 163 165 phy = val >> 8; 164 166 rate_idx = val & 0xff; 165 - bw = 0; 167 + nss = 1; 166 168 } 167 169 168 170 rateval = FIELD_PREP(MT_RXWI_RATE_INDEX, rate_idx); ··· 433 435 } 434 436 435 437 if (wcid) { 436 - if (stat->pktid) 438 + if (stat->pktid >= MT_PACKET_ID_FIRST) 437 439 status.skb = mt76_tx_status_skb_get(mdev, wcid, 438 440 stat->pktid, &list); 439 441 if (status.skb) ··· 476 478 } 477 479 478 480 static int 479 - mt76x02_mac_process_rate(struct mt76_rx_status *status, u16 rate) 481 + mt76x02_mac_process_rate(struct mt76x02_dev *dev, 482 + struct mt76_rx_status *status, 483 + u16 rate) 480 484 { 481 485 u8 idx = FIELD_GET(MT_RXWI_RATE_INDEX, rate); 482 486 ··· 510 510 status->encoding = RX_ENC_HT; 511 511 status->rate_idx = idx; 512 512 break; 513 - case MT_PHY_TYPE_VHT: 513 + case MT_PHY_TYPE_VHT: { 514 + u8 n_rxstream = dev->mt76.chainmask & 0xf; 515 + 514 516 status->encoding = RX_ENC_VHT; 515 517 status->rate_idx = FIELD_GET(MT_RATE_INDEX_VHT_IDX, idx); 516 - status->nss = FIELD_GET(MT_RATE_INDEX_VHT_NSS, idx) + 1; 518 + status->nss = min_t(u8, n_rxstream, 519 + FIELD_GET(MT_RATE_INDEX_VHT_NSS, idx) + 1); 517 520 break; 521 + } 518 522 default: 519 523 return -EINVAL; 520 524 } ··· 648 644 649 645 status->chains = BIT(0); 650 646 signal = mt76x02_mac_get_rssi(dev, rxwi->rssi[0], 0); 651 - for (i = 1; i < nstreams; i++) { 647 + for (i = 0; i < nstreams; i++) { 652 648 status->chains |= BIT(i); 653 649 status->chain_signal[i] = mt76x02_mac_get_rssi(dev, 654 650 rxwi->rssi[i], ··· 662 658 status->tid = FIELD_GET(MT_RXWI_TID, tid_sn); 663 659 status->seqno = FIELD_GET(MT_RXWI_SN, tid_sn); 664 660 665 - if (sta) { 666 - ewma_signal_add(&sta->rssi, status->signal); 667 - sta->inactive_count = 0; 668 - } 669 - 670 - return mt76x02_mac_process_rate(status, rate); 661 + return mt76x02_mac_process_rate(dev, status, rate); 671 662 } 672 663 673 664 void mt76x02_mac_poll_tx_status(struct mt76x02_dev *dev, bool irq) ··· 714 715 } 715 716 EXPORT_SYMBOL_GPL(mt76x02_tx_complete_skb); 716 717 717 - void mt76x02_mac_set_tx_protection(struct mt76x02_dev *dev, u32 val) 718 + void mt76x02_mac_set_rts_thresh(struct mt76x02_dev *dev, u32 val) 718 719 { 719 720 u32 data = 0; 720 721 ··· 728 729 MT_PROT_CFG_CTRL | MT_PROT_CFG_RTS_THRESH, data); 729 730 mt76_rmw(dev, MT_OFDM_PROT_CFG, 730 731 MT_PROT_CFG_CTRL | MT_PROT_CFG_RTS_THRESH, data); 731 - mt76_rmw(dev, MT_MM20_PROT_CFG, 732 - MT_PROT_CFG_CTRL | MT_PROT_CFG_RTS_THRESH, data); 733 - mt76_rmw(dev, MT_MM40_PROT_CFG, 734 - MT_PROT_CFG_CTRL | MT_PROT_CFG_RTS_THRESH, data); 735 - mt76_rmw(dev, MT_GF20_PROT_CFG, 736 - MT_PROT_CFG_CTRL | MT_PROT_CFG_RTS_THRESH, data); 737 - mt76_rmw(dev, MT_GF40_PROT_CFG, 738 - MT_PROT_CFG_CTRL | MT_PROT_CFG_RTS_THRESH, data); 739 - mt76_rmw(dev, MT_TX_PROT_CFG6, 740 - MT_PROT_CFG_CTRL | MT_PROT_CFG_RTS_THRESH, data); 741 - mt76_rmw(dev, MT_TX_PROT_CFG7, 742 - MT_PROT_CFG_CTRL | MT_PROT_CFG_RTS_THRESH, data); 743 - mt76_rmw(dev, MT_TX_PROT_CFG8, 744 - MT_PROT_CFG_CTRL | MT_PROT_CFG_RTS_THRESH, data); 732 + } 733 + 734 + void mt76x02_mac_set_tx_protection(struct mt76x02_dev *dev, bool legacy_prot, 735 + int ht_mode) 736 + { 737 + int mode = ht_mode & IEEE80211_HT_OP_MODE_PROTECTION; 738 + bool non_gf = !!(ht_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT); 739 + u32 prot[6]; 740 + u32 vht_prot[3]; 741 + int i; 742 + u16 rts_thr; 743 + 744 + for (i = 0; i < ARRAY_SIZE(prot); i++) { 745 + prot[i] = mt76_rr(dev, MT_CCK_PROT_CFG + i * 4); 746 + prot[i] &= ~MT_PROT_CFG_CTRL; 747 + if (i >= 2) 748 + prot[i] &= ~MT_PROT_CFG_RATE; 749 + } 750 + 751 + for (i = 0; i < ARRAY_SIZE(vht_prot); i++) { 752 + vht_prot[i] = mt76_rr(dev, MT_TX_PROT_CFG6 + i * 4); 753 + vht_prot[i] &= ~(MT_PROT_CFG_CTRL | MT_PROT_CFG_RATE); 754 + } 755 + 756 + rts_thr = mt76_get_field(dev, MT_TX_RTS_CFG, MT_TX_RTS_CFG_THRESH); 757 + 758 + if (rts_thr != 0xffff) 759 + prot[0] |= MT_PROT_CTRL_RTS_CTS; 760 + 761 + if (legacy_prot) { 762 + prot[1] |= MT_PROT_CTRL_CTS2SELF; 763 + 764 + prot[2] |= MT_PROT_RATE_CCK_11; 765 + prot[3] |= MT_PROT_RATE_CCK_11; 766 + prot[4] |= MT_PROT_RATE_CCK_11; 767 + prot[5] |= MT_PROT_RATE_CCK_11; 768 + 769 + vht_prot[0] |= MT_PROT_RATE_CCK_11; 770 + vht_prot[1] |= MT_PROT_RATE_CCK_11; 771 + vht_prot[2] |= MT_PROT_RATE_CCK_11; 772 + } else { 773 + if (rts_thr != 0xffff) 774 + prot[1] |= MT_PROT_CTRL_RTS_CTS; 775 + 776 + prot[2] |= MT_PROT_RATE_OFDM_24; 777 + prot[3] |= MT_PROT_RATE_DUP_OFDM_24; 778 + prot[4] |= MT_PROT_RATE_OFDM_24; 779 + prot[5] |= MT_PROT_RATE_DUP_OFDM_24; 780 + 781 + vht_prot[0] |= MT_PROT_RATE_OFDM_24; 782 + vht_prot[1] |= MT_PROT_RATE_DUP_OFDM_24; 783 + vht_prot[2] |= MT_PROT_RATE_SGI_OFDM_24; 784 + } 785 + 786 + switch (mode) { 787 + case IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER: 788 + case IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED: 789 + prot[2] |= MT_PROT_CTRL_RTS_CTS; 790 + prot[3] |= MT_PROT_CTRL_RTS_CTS; 791 + prot[4] |= MT_PROT_CTRL_RTS_CTS; 792 + prot[5] |= MT_PROT_CTRL_RTS_CTS; 793 + vht_prot[0] |= MT_PROT_CTRL_RTS_CTS; 794 + vht_prot[1] |= MT_PROT_CTRL_RTS_CTS; 795 + vht_prot[2] |= MT_PROT_CTRL_RTS_CTS; 796 + break; 797 + case IEEE80211_HT_OP_MODE_PROTECTION_20MHZ: 798 + prot[3] |= MT_PROT_CTRL_RTS_CTS; 799 + prot[5] |= MT_PROT_CTRL_RTS_CTS; 800 + vht_prot[1] |= MT_PROT_CTRL_RTS_CTS; 801 + vht_prot[2] |= MT_PROT_CTRL_RTS_CTS; 802 + break; 803 + } 804 + 805 + if (non_gf) { 806 + prot[4] |= MT_PROT_CTRL_RTS_CTS; 807 + prot[5] |= MT_PROT_CTRL_RTS_CTS; 808 + } 809 + 810 + for (i = 0; i < ARRAY_SIZE(prot); i++) 811 + mt76_wr(dev, MT_CCK_PROT_CFG + i * 4, prot[i]); 812 + 813 + for (i = 0; i < ARRAY_SIZE(vht_prot); i++) 814 + mt76_wr(dev, MT_TX_PROT_CFG6 + i * 4, vht_prot[i]); 745 815 } 746 816 747 817 void mt76x02_update_channel(struct mt76_dev *mdev) ··· 842 774 843 775 mt76_set(dev, MT_MAC_SYS_CTRL, MT_MAC_SYS_CTRL_RESET_CSR); 844 776 udelay(10); 845 - mt76_clear(dev, MT_MAC_SYS_CTRL, 846 - MT_MAC_SYS_CTRL_ENABLE_TX | MT_MAC_SYS_CTRL_ENABLE_RX); 777 + mt76_wr(dev, MT_MAC_SYS_CTRL, 778 + MT_MAC_SYS_CTRL_ENABLE_TX | MT_MAC_SYS_CTRL_ENABLE_RX); 779 + } 780 + 781 + static void 782 + mt76x02_edcca_tx_enable(struct mt76x02_dev *dev, bool enable) 783 + { 784 + if (enable) { 785 + u32 data; 786 + 787 + mt76_set(dev, MT_MAC_SYS_CTRL, MT_MAC_SYS_CTRL_ENABLE_TX); 788 + mt76_set(dev, MT_AUTO_RSP_CFG, MT_AUTO_RSP_EN); 789 + /* enable pa-lna */ 790 + data = mt76_rr(dev, MT_TX_PIN_CFG); 791 + data |= MT_TX_PIN_CFG_TXANT | 792 + MT_TX_PIN_CFG_RXANT | 793 + MT_TX_PIN_RFTR_EN | 794 + MT_TX_PIN_TRSW_EN; 795 + mt76_wr(dev, MT_TX_PIN_CFG, data); 796 + } else { 797 + mt76_clear(dev, MT_MAC_SYS_CTRL, MT_MAC_SYS_CTRL_ENABLE_TX); 798 + mt76_clear(dev, MT_AUTO_RSP_CFG, MT_AUTO_RSP_EN); 799 + /* disable pa-lna */ 800 + mt76_clear(dev, MT_TX_PIN_CFG, MT_TX_PIN_CFG_TXANT); 801 + mt76_clear(dev, MT_TX_PIN_CFG, MT_TX_PIN_CFG_RXANT); 802 + } 803 + dev->ed_tx_blocked = !enable; 804 + } 805 + 806 + void mt76x02_edcca_init(struct mt76x02_dev *dev) 807 + { 808 + dev->ed_trigger = 0; 809 + dev->ed_silent = 0; 810 + 811 + if (dev->ed_monitor) { 812 + struct ieee80211_channel *chan = dev->mt76.chandef.chan; 813 + u8 ed_th = chan->band == NL80211_BAND_5GHZ ? 0x0e : 0x20; 814 + 815 + mt76_clear(dev, MT_TX_LINK_CFG, MT_TX_CFACK_EN); 816 + mt76_set(dev, MT_TXOP_CTRL_CFG, MT_TXOP_ED_CCA_EN); 817 + mt76_rmw(dev, MT_BBP(AGC, 2), GENMASK(15, 0), 818 + ed_th << 8 | ed_th); 819 + if (!is_mt76x2(dev)) 820 + mt76_set(dev, MT_TXOP_HLDR_ET, 821 + MT_TXOP_HLDR_TX40M_BLK_EN); 822 + } else { 823 + mt76_set(dev, MT_TX_LINK_CFG, MT_TX_CFACK_EN); 824 + mt76_clear(dev, MT_TXOP_CTRL_CFG, MT_TXOP_ED_CCA_EN); 825 + if (is_mt76x2(dev)) { 826 + mt76_wr(dev, MT_BBP(AGC, 2), 0x00007070); 827 + } else { 828 + mt76_wr(dev, MT_BBP(AGC, 2), 0x003a6464); 829 + mt76_clear(dev, MT_TXOP_HLDR_ET, 830 + MT_TXOP_HLDR_TX40M_BLK_EN); 831 + } 832 + } 833 + mt76x02_edcca_tx_enable(dev, true); 834 + } 835 + EXPORT_SYMBOL_GPL(mt76x02_edcca_init); 836 + 837 + #define MT_EDCCA_TH 90 838 + #define MT_EDCCA_BLOCK_TH 2 839 + static void mt76x02_edcca_check(struct mt76x02_dev *dev) 840 + { 841 + u32 val, busy; 842 + 843 + val = mt76_rr(dev, MT_ED_CCA_TIMER); 844 + busy = (val * 100) / jiffies_to_usecs(MT_CALIBRATE_INTERVAL); 845 + busy = min_t(u32, busy, 100); 846 + 847 + if (busy > MT_EDCCA_TH) { 848 + dev->ed_trigger++; 849 + dev->ed_silent = 0; 850 + } else { 851 + dev->ed_silent++; 852 + dev->ed_trigger = 0; 853 + } 854 + 855 + if (dev->ed_trigger > MT_EDCCA_BLOCK_TH && 856 + !dev->ed_tx_blocked) 857 + mt76x02_edcca_tx_enable(dev, false); 858 + else if (dev->ed_silent > MT_EDCCA_BLOCK_TH && 859 + dev->ed_tx_blocked) 860 + mt76x02_edcca_tx_enable(dev, true); 847 861 } 848 862 849 863 void mt76x02_mac_work(struct work_struct *work) ··· 933 783 struct mt76x02_dev *dev = container_of(work, struct mt76x02_dev, 934 784 mac_work.work); 935 785 int i, idx; 786 + 787 + mutex_lock(&dev->mt76.mutex); 936 788 937 789 mt76x02_update_channel(&dev->mt76); 938 790 for (i = 0, idx = 0; i < 16; i++) { ··· 944 792 dev->aggr_stats[idx++] += val >> 16; 945 793 } 946 794 947 - /* XXX: check beacon stuck for ap mode */ 948 795 if (!dev->beacon_mask) 949 796 mt76x02_check_mac_err(dev); 797 + 798 + if (dev->ed_monitor) 799 + mt76x02_edcca_check(dev); 800 + 801 + mutex_unlock(&dev->mt76.mutex); 950 802 951 803 mt76_tx_status_check(&dev->mt76, NULL, false); 952 804
+5 -7
drivers/net/wireless/mediatek/mt76/mt76x02_mac.h
··· 18 18 #ifndef __MT76X02_MAC_H 19 19 #define __MT76X02_MAC_H 20 20 21 - #include <linux/average.h> 22 - 23 21 struct mt76x02_dev; 24 22 25 23 struct mt76x02_tx_status { ··· 39 41 u8 idx; 40 42 }; 41 43 42 - DECLARE_EWMA(signal, 10, 8); 43 - 44 44 struct mt76x02_sta { 45 45 struct mt76_wcid wcid; /* must be first */ 46 46 ··· 46 50 struct mt76x02_tx_status status; 47 51 int n_frames; 48 52 49 - struct ewma_signal rssi; 50 - int inactive_count; 51 53 }; 52 54 53 55 #define MT_RXINFO_BA BIT(0) ··· 188 194 struct mt76x02_tx_status *stat, u8 *update); 189 195 int mt76x02_mac_process_rx(struct mt76x02_dev *dev, struct sk_buff *skb, 190 196 void *rxi); 191 - void mt76x02_mac_set_tx_protection(struct mt76x02_dev *dev, u32 val); 197 + void mt76x02_mac_set_tx_protection(struct mt76x02_dev *dev, bool legacy_prot, 198 + int ht_mode); 199 + void mt76x02_mac_set_rts_thresh(struct mt76x02_dev *dev, u32 val); 192 200 void mt76x02_mac_setaddr(struct mt76x02_dev *dev, u8 *addr); 193 201 void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi, 194 202 struct sk_buff *skb, struct mt76_wcid *wcid, ··· 206 210 struct sk_buff *skb); 207 211 void mt76x02_mac_set_beacon_enable(struct mt76x02_dev *dev, u8 vif_idx, 208 212 bool val); 213 + 214 + void mt76x02_edcca_init(struct mt76x02_dev *dev); 209 215 #endif
+138 -4
drivers/net/wireless/mediatek/mt76/mt76x02_mmio.c
··· 116 116 IEEE80211_IFACE_ITER_RESUME_ALL, 117 117 mt76x02_update_beacon_iter, dev); 118 118 119 + mt76_csa_check(&dev->mt76); 120 + 121 + if (dev->mt76.csa_complete) 122 + return; 123 + 119 124 do { 120 125 nframes = skb_queue_len(&data.q); 121 126 ieee80211_iterate_active_interfaces_atomic(mt76_hw(dev), 122 127 IEEE80211_IFACE_ITER_RESUME_ALL, 123 128 mt76x02_add_buffered_bc, &data); 124 - } while (nframes != skb_queue_len(&data.q)); 129 + } while (nframes != skb_queue_len(&data.q) && 130 + skb_queue_len(&data.q) < 8); 125 131 126 - if (!nframes) 132 + if (!skb_queue_len(&data.q)) 127 133 return; 128 134 129 135 for (i = 0; i < ARRAY_SIZE(data.tail); i++) { ··· 314 308 tasklet_schedule(&dev->pre_tbtt_tasklet); 315 309 316 310 /* send buffered multicast frames now */ 317 - if (intr & MT_INT_TBTT) 318 - mt76_queue_kick(dev, &dev->mt76.q_tx[MT_TXQ_PSD]); 311 + if (intr & MT_INT_TBTT) { 312 + if (dev->mt76.csa_complete) 313 + mt76_csa_finish(&dev->mt76); 314 + else 315 + mt76_queue_kick(dev, &dev->mt76.q_tx[MT_TXQ_PSD]); 316 + } 319 317 320 318 if (intr & MT_INT_TX_STAT) { 321 319 mt76x02_mac_poll_tx_status(dev, true); ··· 394 384 MT_INT_TX_STAT); 395 385 } 396 386 EXPORT_SYMBOL_GPL(mt76x02_mac_start); 387 + 388 + static bool mt76x02_tx_hang(struct mt76x02_dev *dev) 389 + { 390 + u32 dma_idx, prev_dma_idx; 391 + struct mt76_queue *q; 392 + int i; 393 + 394 + for (i = 0; i < 4; i++) { 395 + q = &dev->mt76.q_tx[i]; 396 + 397 + if (!q->queued) 398 + continue; 399 + 400 + prev_dma_idx = dev->mt76.tx_dma_idx[i]; 401 + dma_idx = ioread32(&q->regs->dma_idx); 402 + dev->mt76.tx_dma_idx[i] = dma_idx; 403 + 404 + if (prev_dma_idx == dma_idx) 405 + break; 406 + } 407 + 408 + return i < 4; 409 + } 410 + 411 + static void mt76x02_watchdog_reset(struct mt76x02_dev *dev) 412 + { 413 + u32 mask = dev->mt76.mmio.irqmask; 414 + int i; 415 + 416 + ieee80211_stop_queues(dev->mt76.hw); 417 + set_bit(MT76_RESET, &dev->mt76.state); 418 + 419 + tasklet_disable(&dev->pre_tbtt_tasklet); 420 + tasklet_disable(&dev->tx_tasklet); 421 + 422 + for (i = 0; i < ARRAY_SIZE(dev->mt76.napi); i++) 423 + napi_disable(&dev->mt76.napi[i]); 424 + 425 + mutex_lock(&dev->mt76.mutex); 426 + 427 + if (dev->beacon_mask) 428 + mt76_clear(dev, MT_BEACON_TIME_CFG, 429 + MT_BEACON_TIME_CFG_BEACON_TX | 430 + MT_BEACON_TIME_CFG_TBTT_EN); 431 + 432 + mt76x02_irq_disable(dev, mask); 433 + 434 + /* perform device reset */ 435 + mt76_clear(dev, MT_TXOP_CTRL_CFG, MT_TXOP_ED_CCA_EN); 436 + mt76_wr(dev, MT_MAC_SYS_CTRL, 0); 437 + mt76_clear(dev, MT_WPDMA_GLO_CFG, 438 + MT_WPDMA_GLO_CFG_TX_DMA_EN | MT_WPDMA_GLO_CFG_RX_DMA_EN); 439 + usleep_range(5000, 10000); 440 + mt76_wr(dev, MT_INT_SOURCE_CSR, 0xffffffff); 441 + 442 + /* let fw reset DMA */ 443 + mt76_set(dev, 0x734, 0x3); 444 + 445 + for (i = 0; i < ARRAY_SIZE(dev->mt76.q_tx); i++) 446 + mt76_queue_tx_cleanup(dev, i, true); 447 + 448 + for (i = 0; i < ARRAY_SIZE(dev->mt76.q_rx); i++) 449 + mt76_queue_rx_reset(dev, i); 450 + 451 + mt76_wr(dev, MT_MAC_SYS_CTRL, 452 + MT_MAC_SYS_CTRL_ENABLE_TX | MT_MAC_SYS_CTRL_ENABLE_RX); 453 + mt76_set(dev, MT_WPDMA_GLO_CFG, 454 + MT_WPDMA_GLO_CFG_TX_DMA_EN | MT_WPDMA_GLO_CFG_RX_DMA_EN); 455 + if (dev->ed_monitor) 456 + mt76_set(dev, MT_TXOP_CTRL_CFG, MT_TXOP_ED_CCA_EN); 457 + 458 + if (dev->beacon_mask) 459 + mt76_set(dev, MT_BEACON_TIME_CFG, 460 + MT_BEACON_TIME_CFG_BEACON_TX | 461 + MT_BEACON_TIME_CFG_TBTT_EN); 462 + 463 + mt76x02_irq_enable(dev, mask); 464 + 465 + mutex_unlock(&dev->mt76.mutex); 466 + 467 + clear_bit(MT76_RESET, &dev->mt76.state); 468 + 469 + tasklet_enable(&dev->tx_tasklet); 470 + tasklet_schedule(&dev->tx_tasklet); 471 + 472 + tasklet_enable(&dev->pre_tbtt_tasklet); 473 + 474 + for (i = 0; i < ARRAY_SIZE(dev->mt76.napi); i++) { 475 + napi_enable(&dev->mt76.napi[i]); 476 + napi_schedule(&dev->mt76.napi[i]); 477 + } 478 + 479 + ieee80211_wake_queues(dev->mt76.hw); 480 + 481 + mt76_txq_schedule_all(&dev->mt76); 482 + } 483 + 484 + static void mt76x02_check_tx_hang(struct mt76x02_dev *dev) 485 + { 486 + if (mt76x02_tx_hang(dev)) { 487 + if (++dev->tx_hang_check < MT_TX_HANG_TH) 488 + return; 489 + 490 + mt76x02_watchdog_reset(dev); 491 + 492 + dev->tx_hang_reset++; 493 + dev->tx_hang_check = 0; 494 + memset(dev->mt76.tx_dma_idx, 0xff, 495 + sizeof(dev->mt76.tx_dma_idx)); 496 + } else { 497 + dev->tx_hang_check = 0; 498 + } 499 + } 500 + 501 + void mt76x02_wdt_work(struct work_struct *work) 502 + { 503 + struct mt76x02_dev *dev = container_of(work, struct mt76x02_dev, 504 + wdt_work.work); 505 + 506 + mt76x02_check_tx_hang(dev); 507 + 508 + ieee80211_queue_delayed_work(mt76_hw(dev), &dev->wdt_work, 509 + MT_WATCHDOG_TIME); 510 + }
-47
drivers/net/wireless/mediatek/mt76/mt76x02_phy.c
··· 132 132 } 133 133 EXPORT_SYMBOL_GPL(mt76x02_phy_set_txpower); 134 134 135 - int mt76x02_phy_get_min_avg_rssi(struct mt76x02_dev *dev) 136 - { 137 - struct mt76x02_sta *sta; 138 - struct mt76_wcid *wcid; 139 - int i, j, min_rssi = 0; 140 - s8 cur_rssi; 141 - 142 - local_bh_disable(); 143 - rcu_read_lock(); 144 - 145 - for (i = 0; i < ARRAY_SIZE(dev->mt76.wcid_mask); i++) { 146 - unsigned long mask = dev->mt76.wcid_mask[i]; 147 - 148 - if (!mask) 149 - continue; 150 - 151 - for (j = i * BITS_PER_LONG; mask; j++, mask >>= 1) { 152 - if (!(mask & 1)) 153 - continue; 154 - 155 - wcid = rcu_dereference(dev->mt76.wcid[j]); 156 - if (!wcid) 157 - continue; 158 - 159 - sta = container_of(wcid, struct mt76x02_sta, wcid); 160 - spin_lock(&dev->mt76.rx_lock); 161 - if (sta->inactive_count++ < 5) 162 - cur_rssi = ewma_signal_read(&sta->rssi); 163 - else 164 - cur_rssi = 0; 165 - spin_unlock(&dev->mt76.rx_lock); 166 - 167 - if (cur_rssi < min_rssi) 168 - min_rssi = cur_rssi; 169 - } 170 - } 171 - 172 - rcu_read_unlock(); 173 - local_bh_enable(); 174 - 175 - if (!min_rssi) 176 - return -75; 177 - 178 - return min_rssi; 179 - } 180 - EXPORT_SYMBOL_GPL(mt76x02_phy_get_min_avg_rssi); 181 - 182 135 void mt76x02_phy_set_bw(struct mt76x02_dev *dev, int width, u8 ctrl) 183 136 { 184 137 int core_val, agc_val;
-1
drivers/net/wireless/mediatek/mt76/mt76x02_phy.h
··· 51 51 int mt76x02_get_max_rate_power(struct mt76_rate_power *r); 52 52 void mt76x02_phy_set_rxpath(struct mt76x02_dev *dev); 53 53 void mt76x02_phy_set_txdac(struct mt76x02_dev *dev); 54 - int mt76x02_phy_get_min_avg_rssi(struct mt76x02_dev *dev); 55 54 void mt76x02_phy_set_bw(struct mt76x02_dev *dev, int width, u8 ctrl); 56 55 void mt76x02_phy_set_band(struct mt76x02_dev *dev, int band, 57 56 bool primary_upper);
+35 -3
drivers/net/wireless/mediatek/mt76/mt76x02_regs.h
··· 230 230 #define MT_COM_REG2 0x0738 231 231 #define MT_COM_REG3 0x073C 232 232 233 + #define MT_LED_CTRL 0x0770 234 + #define MT_LED_CTRL_REPLAY(_n) BIT(0 + (8 * (_n))) 235 + #define MT_LED_CTRL_POLARITY(_n) BIT(1 + (8 * (_n))) 236 + #define MT_LED_CTRL_TX_BLINK_MODE(_n) BIT(2 + (8 * (_n))) 237 + #define MT_LED_CTRL_KICK(_n) BIT(7 + (8 * (_n))) 238 + 239 + #define MT_LED_TX_BLINK_0 0x0774 240 + #define MT_LED_TX_BLINK_1 0x0778 241 + 242 + #define MT_LED_S0_BASE 0x077C 243 + #define MT_LED_S0(_n) (MT_LED_S0_BASE + 8 * (_n)) 244 + #define MT_LED_S1_BASE 0x0780 245 + #define MT_LED_S1(_n) (MT_LED_S1_BASE + 8 * (_n)) 246 + #define MT_LED_STATUS_OFF_MASK GENMASK(31, 24) 247 + #define MT_LED_STATUS_OFF(_v) (((_v) << __ffs(MT_LED_STATUS_OFF_MASK)) & \ 248 + MT_LED_STATUS_OFF_MASK) 249 + #define MT_LED_STATUS_ON_MASK GENMASK(23, 16) 250 + #define MT_LED_STATUS_ON(_v) (((_v) << __ffs(MT_LED_STATUS_ON_MASK)) & \ 251 + MT_LED_STATUS_ON_MASK) 252 + #define MT_LED_STATUS_DURATION_MASK GENMASK(15, 8) 253 + #define MT_LED_STATUS_DURATION(_v) (((_v) << __ffs(MT_LED_STATUS_DURATION_MASK)) & \ 254 + MT_LED_STATUS_DURATION_MASK) 255 + 233 256 #define MT_FCE_PSE_CTRL 0x0800 234 257 #define MT_FCE_PARAMETERS 0x0804 235 258 #define MT_FCE_CSO 0x0808 ··· 341 318 #define MT_CH_TIME_CFG_NAV_AS_BUSY BIT(3) 342 319 #define MT_CH_TIME_CFG_EIFS_AS_BUSY BIT(4) 343 320 #define MT_CH_TIME_CFG_MDRDY_CNT_EN BIT(5) 321 + #define MT_CH_CCA_RC_EN BIT(6) 344 322 #define MT_CH_TIME_CFG_CH_TIMER_CLR GENMASK(9, 8) 345 323 #define MT_CH_TIME_CFG_MDRDY_CLR GENMASK(11, 10) 346 324 ··· 402 378 #define MT_TX_PWR_CFG_4 0x1324 403 379 #define MT_TX_PIN_CFG 0x1328 404 380 #define MT_TX_PIN_CFG_TXANT GENMASK(3, 0) 381 + #define MT_TX_PIN_CFG_RXANT GENMASK(11, 8) 382 + #define MT_TX_PIN_RFTR_EN BIT(16) 383 + #define MT_TX_PIN_TRSW_EN BIT(18) 405 384 406 385 #define MT_TX_BAND_CFG 0x132c 407 386 #define MT_TX_BAND_CFG_UPPER_40M BIT(0) ··· 425 398 #define MT_TXOP_CTRL_CFG 0x1340 426 399 #define MT_TXOP_TRUN_EN GENMASK(5, 0) 427 400 #define MT_TXOP_EXT_CCA_DLY GENMASK(15, 8) 401 + #define MT_TXOP_ED_CCA_EN BIT(20) 428 402 429 403 #define MT_TX_RTS_CFG 0x1344 430 404 #define MT_TX_RTS_CFG_RETRY_LIMIT GENMASK(7, 0) ··· 437 409 438 410 #define MT_TX_RETRY_CFG 0x134c 439 411 #define MT_TX_LINK_CFG 0x1350 412 + #define MT_TX_CFACK_EN BIT(12) 440 413 #define MT_VHT_HT_FBK_CFG0 0x1354 441 414 #define MT_VHT_HT_FBK_CFG1 0x1358 442 415 #define MT_LG_FBK_CFG0 0x135c ··· 469 440 #define MT_PROT_TXOP_ALLOW_GF40 BIT(25) 470 441 #define MT_PROT_RTS_THR_EN BIT(26) 471 442 #define MT_PROT_RATE_CCK_11 0x0003 472 - #define MT_PROT_RATE_OFDM_6 0x4000 473 - #define MT_PROT_RATE_OFDM_24 0x4004 474 - #define MT_PROT_RATE_DUP_OFDM_24 0x4084 443 + #define MT_PROT_RATE_OFDM_6 0x2000 444 + #define MT_PROT_RATE_OFDM_24 0x2004 445 + #define MT_PROT_RATE_DUP_OFDM_24 0x2084 446 + #define MT_PROT_RATE_SGI_OFDM_24 0x2104 475 447 #define MT_PROT_TXOP_ALLOW_ALL GENMASK(25, 20) 476 448 #define MT_PROT_TXOP_ALLOW_BW20 (MT_PROT_TXOP_ALLOW_ALL & \ 477 449 ~MT_PROT_TXOP_ALLOW_MM40 & \ ··· 541 511 #define MT_RX_FILTR_CFG_CTRL_RSV BIT(16) 542 512 543 513 #define MT_AUTO_RSP_CFG 0x1404 514 + #define MT_AUTO_RSP_EN BIT(0) 544 515 #define MT_AUTO_RSP_PREAMB_SHORT BIT(4) 545 516 #define MT_LEGACY_BASIC_RATE 0x1408 546 517 #define MT_HT_BASIC_RATE 0x140c ··· 563 532 #define MT_PN_PAD_MODE 0x150c 564 533 565 534 #define MT_TXOP_HLDR_ET 0x1608 535 + #define MT_TXOP_HLDR_TX40M_BLK_EN BIT(1) 566 536 567 537 #define MT_PROT_AUTO_TX_CFG 0x1648 568 538 #define MT_PROT_AUTO_TX_CFG_PROT_PADJ GENMASK(11, 8)
+1 -1
drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c
··· 177 177 if (ret < 0) 178 178 return ret; 179 179 180 - if (pid && pid != MT_PACKET_ID_NO_ACK) 180 + if (pid >= MT_PACKET_ID_FIRST) 181 181 qsel = MT_QSEL_MGMT; 182 182 183 183 *tx_info = FIELD_PREP(MT_TXD_INFO_QSEL, qsel) |
+1 -2
drivers/net/wireless/mediatek/mt76/mt76x02_usb_core.c
··· 87 87 pid = mt76_tx_status_skb_add(mdev, wcid, skb); 88 88 txwi->pktid = pid; 89 89 90 - if ((pid && pid != MT_PACKET_ID_NO_ACK) || 91 - q2ep(q->hw_idx) == MT_EP_OUT_HCCA) 90 + if (pid >= MT_PACKET_ID_FIRST || q2ep(q->hw_idx) == MT_EP_OUT_HCCA) 92 91 qsel = MT_QSEL_MGMT; 93 92 else 94 93 qsel = MT_QSEL_EDCA;
+68 -21
drivers/net/wireless/mediatek/mt76/mt76x02_util.c
··· 75 75 } 76 76 }; 77 77 78 + static void 79 + mt76x02_led_set_config(struct mt76_dev *mdev, u8 delay_on, 80 + u8 delay_off) 81 + { 82 + struct mt76x02_dev *dev = container_of(mdev, struct mt76x02_dev, 83 + mt76); 84 + u32 val; 85 + 86 + val = MT_LED_STATUS_DURATION(0xff) | 87 + MT_LED_STATUS_OFF(delay_off) | 88 + MT_LED_STATUS_ON(delay_on); 89 + 90 + mt76_wr(dev, MT_LED_S0(mdev->led_pin), val); 91 + mt76_wr(dev, MT_LED_S1(mdev->led_pin), val); 92 + 93 + val = MT_LED_CTRL_REPLAY(mdev->led_pin) | 94 + MT_LED_CTRL_KICK(mdev->led_pin); 95 + if (mdev->led_al) 96 + val |= MT_LED_CTRL_POLARITY(mdev->led_pin); 97 + mt76_wr(dev, MT_LED_CTRL, val); 98 + } 99 + 100 + static int 101 + mt76x02_led_set_blink(struct led_classdev *led_cdev, 102 + unsigned long *delay_on, 103 + unsigned long *delay_off) 104 + { 105 + struct mt76_dev *mdev = container_of(led_cdev, struct mt76_dev, 106 + led_cdev); 107 + u8 delta_on, delta_off; 108 + 109 + delta_off = max_t(u8, *delay_off / 10, 1); 110 + delta_on = max_t(u8, *delay_on / 10, 1); 111 + 112 + mt76x02_led_set_config(mdev, delta_on, delta_off); 113 + 114 + return 0; 115 + } 116 + 117 + static void 118 + mt76x02_led_set_brightness(struct led_classdev *led_cdev, 119 + enum led_brightness brightness) 120 + { 121 + struct mt76_dev *mdev = container_of(led_cdev, struct mt76_dev, 122 + led_cdev); 123 + 124 + if (!brightness) 125 + mt76x02_led_set_config(mdev, 0, 0xff); 126 + else 127 + mt76x02_led_set_config(mdev, 0xff, 0); 128 + } 129 + 78 130 void mt76x02_init_device(struct mt76x02_dev *dev) 79 131 { 80 132 struct ieee80211_hw *hw = mt76_hw(dev); ··· 145 93 MT_DMA_HDR_LEN; 146 94 wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION); 147 95 } else { 96 + INIT_DELAYED_WORK(&dev->wdt_work, mt76x02_wdt_work); 97 + 148 98 mt76x02_dfs_init_detector(dev); 149 99 150 100 wiphy->reg_notifier = mt76x02_regd_notifier; ··· 160 106 #endif 161 107 BIT(NL80211_IFTYPE_ADHOC); 162 108 109 + wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH; 110 + 163 111 wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_VHT_IBSS); 112 + 113 + /* init led callbacks */ 114 + if (IS_ENABLED(CONFIG_MT76_LEDS)) { 115 + dev->mt76.led_cdev.brightness_set = 116 + mt76x02_led_set_brightness; 117 + dev->mt76.led_cdev.blink_set = mt76x02_led_set_blink; 118 + } 164 119 } 165 120 166 121 hw->sta_data_size = sizeof(struct mt76x02_sta); ··· 251 188 252 189 if (vif->type == NL80211_IFTYPE_AP) 253 190 set_bit(MT_WCID_FLAG_CHECK_PS, &msta->wcid.flags); 254 - 255 - ewma_signal_init(&msta->rssi); 256 191 257 192 return 0; 258 193 } ··· 524 463 return -EINVAL; 525 464 526 465 mutex_lock(&dev->mt76.mutex); 527 - mt76x02_mac_set_tx_protection(dev, val); 466 + mt76x02_mac_set_rts_thresh(dev, val); 528 467 mutex_unlock(&dev->mt76.mutex); 529 468 530 469 return 0; ··· 606 545 } 607 546 } 608 547 EXPORT_SYMBOL_GPL(mt76x02_sw_scan_complete); 609 - 610 - int mt76x02_get_txpower(struct ieee80211_hw *hw, 611 - struct ieee80211_vif *vif, int *dbm) 612 - { 613 - struct mt76x02_dev *dev = hw->priv; 614 - u8 nstreams = dev->mt76.chainmask & 0xf; 615 - 616 - *dbm = dev->mt76.txpower_cur / 2; 617 - 618 - /* convert from per-chain power to combined 619 - * output on 2x2 devices 620 - */ 621 - if (nstreams > 1) 622 - *dbm += 3; 623 - 624 - return 0; 625 - } 626 - EXPORT_SYMBOL_GPL(mt76x02_get_txpower); 627 548 628 549 void mt76x02_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta, 629 550 bool ps) ··· 703 660 info->enable_beacon); 704 661 tasklet_enable(&dev->pre_tbtt_tasklet); 705 662 } 663 + 664 + if (changed & BSS_CHANGED_HT || changed & BSS_CHANGED_ERP_CTS_PROT) 665 + mt76x02_mac_set_tx_protection(dev, info->use_cts_prot, 666 + info->ht_operation_mode); 706 667 707 668 if (changed & BSS_CHANGED_BEACON_INT) { 708 669 mt76_rmw_field(dev, MT_BEACON_TIME_CFG,
+1
drivers/net/wireless/mediatek/mt76/mt76x2/init.c
··· 143 143 { MT_VHT_HT_FBK_CFG1, 0xedcba980 }, 144 144 { MT_PROT_AUTO_TX_CFG, 0x00830083 }, 145 145 { MT_HT_CTRL_CFG, 0x000001ff }, 146 + { MT_TX_LINK_CFG, 0x00001020 }, 146 147 }; 147 148 struct mt76_reg_pair prot_vals[] = { 148 149 { MT_CCK_PROT_CFG, DEFAULT_PROT_CFG_CCK },
-23
drivers/net/wireless/mediatek/mt76/mt76x2/mcu.h
··· 26 26 #define MT_MCU_PCIE_REMAP_BASE2 0x0744 27 27 #define MT_MCU_PCIE_REMAP_BASE3 0x0748 28 28 29 - #define MT_LED_CTRL 0x0770 30 - #define MT_LED_CTRL_REPLAY(_n) BIT(0 + (8 * (_n))) 31 - #define MT_LED_CTRL_POLARITY(_n) BIT(1 + (8 * (_n))) 32 - #define MT_LED_CTRL_TX_BLINK_MODE(_n) BIT(2 + (8 * (_n))) 33 - #define MT_LED_CTRL_KICK(_n) BIT(7 + (8 * (_n))) 34 - 35 - #define MT_LED_TX_BLINK_0 0x0774 36 - #define MT_LED_TX_BLINK_1 0x0778 37 - 38 - #define MT_LED_S0_BASE 0x077C 39 - #define MT_LED_S0(_n) (MT_LED_S0_BASE + 8 * (_n)) 40 - #define MT_LED_S1_BASE 0x0780 41 - #define MT_LED_S1(_n) (MT_LED_S1_BASE + 8 * (_n)) 42 - #define MT_LED_STATUS_OFF_MASK GENMASK(31, 24) 43 - #define MT_LED_STATUS_OFF(_v) (((_v) << __ffs(MT_LED_STATUS_OFF_MASK)) & \ 44 - MT_LED_STATUS_OFF_MASK) 45 - #define MT_LED_STATUS_ON_MASK GENMASK(23, 16) 46 - #define MT_LED_STATUS_ON(_v) (((_v) << __ffs(MT_LED_STATUS_ON_MASK)) & \ 47 - MT_LED_STATUS_ON_MASK) 48 - #define MT_LED_STATUS_DURATION_MASK GENMASK(15, 8) 49 - #define MT_LED_STATUS_DURATION(_v) (((_v) << __ffs(MT_LED_STATUS_DURATION_MASK)) & \ 50 - MT_LED_STATUS_DURATION_MASK) 51 - 52 29 #define MT_MCU_ROM_PATCH_OFFSET 0x80000 53 30 #define MT_MCU_ROM_PATCH_ADDR 0x90000 54 31
-1
drivers/net/wireless/mediatek/mt76/mt76x2/mt76x2.h
··· 53 53 int mt76x2_register_device(struct mt76x02_dev *dev); 54 54 55 55 void mt76x2_phy_power_on(struct mt76x02_dev *dev); 56 - int mt76x2_init_hardware(struct mt76x02_dev *dev); 57 56 void mt76x2_stop_hardware(struct mt76x02_dev *dev); 58 57 int mt76x2_eeprom_init(struct mt76x02_dev *dev); 59 58 int mt76x2_apply_calibration_data(struct mt76x02_dev *dev, int channel);
+3 -55
drivers/net/wireless/mediatek/mt76/mt76x2/pci_init.c
··· 151 151 MT_CH_TIME_CFG_RX_AS_BUSY | 152 152 MT_CH_TIME_CFG_NAV_AS_BUSY | 153 153 MT_CH_TIME_CFG_EIFS_AS_BUSY | 154 + MT_CH_CCA_RC_EN | 154 155 FIELD_PREP(MT_CH_TIME_CFG_CH_TIMER_CLR, 1)); 155 156 156 157 mt76x02_set_tx_ackto(dev); ··· 261 260 mt76x2_power_on_rf(dev, 1); 262 261 } 263 262 264 - int mt76x2_init_hardware(struct mt76x02_dev *dev) 263 + static int mt76x2_init_hardware(struct mt76x02_dev *dev) 265 264 { 266 265 int ret; 267 266 ··· 301 300 { 302 301 cancel_delayed_work_sync(&dev->cal_work); 303 302 cancel_delayed_work_sync(&dev->mac_work); 303 + cancel_delayed_work_sync(&dev->wdt_work); 304 304 mt76x02_mcu_set_radio_state(dev, false); 305 305 mt76x2_mac_stop(dev, false); 306 306 } ··· 342 340 return dev; 343 341 } 344 342 345 - static void mt76x2_led_set_config(struct mt76_dev *mt76, u8 delay_on, 346 - u8 delay_off) 347 - { 348 - struct mt76x02_dev *dev = container_of(mt76, struct mt76x02_dev, 349 - mt76); 350 - u32 val; 351 - 352 - val = MT_LED_STATUS_DURATION(0xff) | 353 - MT_LED_STATUS_OFF(delay_off) | 354 - MT_LED_STATUS_ON(delay_on); 355 - 356 - mt76_wr(dev, MT_LED_S0(mt76->led_pin), val); 357 - mt76_wr(dev, MT_LED_S1(mt76->led_pin), val); 358 - 359 - val = MT_LED_CTRL_REPLAY(mt76->led_pin) | 360 - MT_LED_CTRL_KICK(mt76->led_pin); 361 - if (mt76->led_al) 362 - val |= MT_LED_CTRL_POLARITY(mt76->led_pin); 363 - mt76_wr(dev, MT_LED_CTRL, val); 364 - } 365 - 366 - static int mt76x2_led_set_blink(struct led_classdev *led_cdev, 367 - unsigned long *delay_on, 368 - unsigned long *delay_off) 369 - { 370 - struct mt76_dev *mt76 = container_of(led_cdev, struct mt76_dev, 371 - led_cdev); 372 - u8 delta_on, delta_off; 373 - 374 - delta_off = max_t(u8, *delay_off / 10, 1); 375 - delta_on = max_t(u8, *delay_on / 10, 1); 376 - 377 - mt76x2_led_set_config(mt76, delta_on, delta_off); 378 - return 0; 379 - } 380 - 381 - static void mt76x2_led_set_brightness(struct led_classdev *led_cdev, 382 - enum led_brightness brightness) 383 - { 384 - struct mt76_dev *mt76 = container_of(led_cdev, struct mt76_dev, 385 - led_cdev); 386 - 387 - if (!brightness) 388 - mt76x2_led_set_config(mt76, 0, 0xff); 389 - else 390 - mt76x2_led_set_config(mt76, 0xff, 0); 391 - } 392 - 393 343 int mt76x2_register_device(struct mt76x02_dev *dev) 394 344 { 395 345 int ret; ··· 355 401 return ret; 356 402 357 403 mt76x02_config_mac_addr_list(dev); 358 - 359 - /* init led callbacks */ 360 - if (IS_ENABLED(CONFIG_MT76_LEDS)) { 361 - dev->mt76.led_cdev.brightness_set = mt76x2_led_set_brightness; 362 - dev->mt76.led_cdev.blink_set = mt76x2_led_set_blink; 363 - } 364 404 365 405 ret = mt76_register_device(&dev->mt76, true, mt76x02_rates, 366 406 ARRAY_SIZE(mt76x02_rates));
+3 -1
drivers/net/wireless/mediatek/mt76/mt76x2/pci_main.c
··· 34 34 35 35 ieee80211_queue_delayed_work(mt76_hw(dev), &dev->mac_work, 36 36 MT_CALIBRATE_INTERVAL); 37 + ieee80211_queue_delayed_work(mt76_hw(dev), &dev->wdt_work, 38 + MT_WATCHDOG_TIME); 37 39 38 40 set_bit(MT76_STATE_RUNNING, &dev->mt76.state); 39 41 ··· 191 189 .sw_scan_complete = mt76x02_sw_scan_complete, 192 190 .flush = mt76x2_flush, 193 191 .ampdu_action = mt76x02_ampdu_action, 194 - .get_txpower = mt76x02_get_txpower, 192 + .get_txpower = mt76_get_txpower, 195 193 .wake_tx_queue = mt76_wake_tx_queue, 196 194 .sta_rate_tbl_update = mt76x02_sta_rate_tbl_update, 197 195 .release_buffered_frames = mt76_release_buffered_frames,
+2
drivers/net/wireless/mediatek/mt76/mt76x2/pci_phy.c
··· 254 254 0x38); 255 255 } 256 256 257 + mt76x02_edcca_init(dev); 258 + 257 259 ieee80211_queue_delayed_work(mt76_hw(dev), &dev->cal_work, 258 260 MT_CALIBRATE_INTERVAL); 259 261
+3 -1
drivers/net/wireless/mediatek/mt76/mt76x2/phy.c
··· 284 284 int low_gain; 285 285 u32 val; 286 286 287 - dev->cal.avg_rssi_all = mt76x02_phy_get_min_avg_rssi(dev); 287 + dev->cal.avg_rssi_all = mt76_get_min_avg_rssi(&dev->mt76); 288 + if (!dev->cal.avg_rssi_all) 289 + dev->cal.avg_rssi_all = -75; 288 290 289 291 low_gain = (dev->cal.avg_rssi_all > mt76x02_get_rssi_gain_thresh(dev)) + 290 292 (dev->cal.avg_rssi_all > mt76x02_get_low_rssi_gain_thresh(dev));
+1 -1
drivers/net/wireless/mediatek/mt76/mt76x2/usb_main.c
··· 138 138 .sw_scan_start = mt76x02_sw_scan, 139 139 .sw_scan_complete = mt76x02_sw_scan_complete, 140 140 .sta_rate_tbl_update = mt76x02_sta_rate_tbl_update, 141 - .get_txpower = mt76x02_get_txpower, 141 + .get_txpower = mt76_get_txpower, 142 142 };
+1 -1
drivers/net/wireless/mediatek/mt76/mt76x2/usb_mcu.c
··· 39 39 static void mt76x2u_mcu_enable_patch(struct mt76x02_dev *dev) 40 40 { 41 41 struct mt76_usb *usb = &dev->mt76.usb; 42 - const u8 data[] = { 42 + static const u8 data[] = { 43 43 0x6f, 0xfc, 0x08, 0x01, 44 44 0x20, 0x04, 0x00, 0x00, 45 45 0x00, 0x09, 0x00,
+12 -5
drivers/net/wireless/mediatek/mt76/tx.c
··· 170 170 int pid; 171 171 172 172 if (!wcid) 173 - return 0; 173 + return MT_PACKET_ID_NO_ACK; 174 174 175 175 if (info->flags & IEEE80211_TX_CTL_NO_ACK) 176 176 return MT_PACKET_ID_NO_ACK; 177 177 178 178 if (!(info->flags & (IEEE80211_TX_CTL_REQ_TX_STATUS | 179 179 IEEE80211_TX_CTL_RATE_CTRL_PROBE))) 180 - return 0; 180 + return MT_PACKET_ID_NO_SKB; 181 181 182 182 spin_lock_bh(&dev->status_list.lock); 183 183 184 184 memset(cb, 0, sizeof(*cb)); 185 185 wcid->packet_id = (wcid->packet_id + 1) & MT_PACKET_ID_MASK; 186 - if (!wcid->packet_id || wcid->packet_id == MT_PACKET_ID_NO_ACK) 187 - wcid->packet_id = 1; 186 + if (wcid->packet_id == MT_PACKET_ID_NO_ACK || 187 + wcid->packet_id == MT_PACKET_ID_NO_SKB) 188 + wcid->packet_id = MT_PACKET_ID_FIRST; 188 189 189 190 pid = wcid->packet_id; 190 191 cb->wcid = wcid->idx; ··· 331 330 332 331 info->control.flags |= IEEE80211_TX_CTRL_PS_RESPONSE; 333 332 if (last) 334 - info->flags |= IEEE80211_TX_STATUS_EOSP; 333 + info->flags |= IEEE80211_TX_STATUS_EOSP | 334 + IEEE80211_TX_CTL_REQ_TX_STATUS; 335 335 336 336 mt76_skb_set_moredata(skb, !last); 337 337 dev->queue_ops->tx_queue_skb(dev, hwq, skb, wcid, sta); ··· 395 393 bool ampdu; 396 394 bool probe; 397 395 int idx; 396 + 397 + if (test_bit(MT_WCID_FLAG_PS, &wcid->flags)) { 398 + *empty = true; 399 + return 0; 400 + } 398 401 399 402 skb = mt76_txq_dequeue(dev, mtxq, false); 400 403 if (!skb) {
+10 -10
drivers/net/wireless/mediatek/mt76/usb.c
··· 407 407 if (len < 0) 408 408 return 0; 409 409 410 + data_len = min_t(int, len, urb->sg[0].length - MT_DMA_HDR_LEN); 411 + if (MT_DMA_HDR_LEN + data_len > SKB_WITH_OVERHEAD(q->buf_size)) 412 + return 0; 413 + 410 414 skb = build_skb(data, q->buf_size); 411 415 if (!skb) 412 416 return 0; 413 417 414 - data_len = min_t(int, len, urb->sg[0].length - MT_DMA_HDR_LEN); 415 418 skb_reserve(skb, MT_DMA_HDR_LEN); 416 - if (skb->tail + data_len > skb->end) { 417 - dev_kfree_skb(skb); 418 - return 1; 419 - } 420 - 421 419 __skb_put(skb, data_len); 422 420 len -= data_len; 423 421 ··· 583 585 static void mt76u_tx_tasklet(unsigned long data) 584 586 { 585 587 struct mt76_dev *dev = (struct mt76_dev *)data; 588 + struct mt76_queue_entry entry; 586 589 struct mt76u_buf *buf; 587 590 struct mt76_queue *q; 588 591 bool wake; ··· 598 599 if (!buf->done || !q->queued) 599 600 break; 600 601 601 - dev->drv->tx_complete_skb(dev, q, 602 - &q->entry[q->head], 603 - false); 604 - 605 602 if (q->entry[q->head].schedule) { 606 603 q->entry[q->head].schedule = false; 607 604 q->swq_queued--; 608 605 } 609 606 607 + entry = q->entry[q->head]; 610 608 q->head = (q->head + 1) % q->ndesc; 611 609 q->queued--; 610 + 611 + spin_unlock_bh(&q->lock); 612 + dev->drv->tx_complete_skb(dev, q, &entry, false); 613 + spin_lock_bh(&q->lock); 612 614 } 613 615 mt76_txq_schedule(dev, q); 614 616 wake = i < IEEE80211_NUM_ACS && q->queued < q->ndesc - 8;
+42
drivers/net/wireless/mediatek/mt76/util.c
··· 75 75 } 76 76 EXPORT_SYMBOL_GPL(mt76_wcid_alloc); 77 77 78 + int mt76_get_min_avg_rssi(struct mt76_dev *dev) 79 + { 80 + struct mt76_wcid *wcid; 81 + int i, j, min_rssi = 0; 82 + s8 cur_rssi; 83 + 84 + local_bh_disable(); 85 + rcu_read_lock(); 86 + 87 + for (i = 0; i < ARRAY_SIZE(dev->wcid_mask); i++) { 88 + unsigned long mask = dev->wcid_mask[i]; 89 + 90 + if (!mask) 91 + continue; 92 + 93 + for (j = i * BITS_PER_LONG; mask; j++, mask >>= 1) { 94 + if (!(mask & 1)) 95 + continue; 96 + 97 + wcid = rcu_dereference(dev->wcid[j]); 98 + if (!wcid) 99 + continue; 100 + 101 + spin_lock(&dev->rx_lock); 102 + if (wcid->inactive_count++ < 5) 103 + cur_rssi = -ewma_signal_read(&wcid->rssi); 104 + else 105 + cur_rssi = 0; 106 + spin_unlock(&dev->rx_lock); 107 + 108 + if (cur_rssi < min_rssi) 109 + min_rssi = cur_rssi; 110 + } 111 + } 112 + 113 + rcu_read_unlock(); 114 + local_bh_enable(); 115 + 116 + return min_rssi; 117 + } 118 + EXPORT_SYMBOL_GPL(mt76_get_min_avg_rssi); 119 + 78 120 MODULE_LICENSE("Dual BSD/GPL");
+3 -3
drivers/net/wireless/mediatek/mt7601u/dma.c
··· 124 124 u16 dma_len = get_unaligned_le16(data); 125 125 126 126 if (data_len < min_seg_len || 127 - WARN_ON(!dma_len) || 128 - WARN_ON(dma_len + MT_DMA_HDRS > data_len) || 129 - WARN_ON(dma_len & 0x3)) 127 + WARN_ON_ONCE(!dma_len) || 128 + WARN_ON_ONCE(dma_len + MT_DMA_HDRS > data_len) || 129 + WARN_ON_ONCE(dma_len & 0x3)) 130 130 return 0; 131 131 132 132 return MT_DMA_HDRS + dma_len;
+1 -1
drivers/net/wireless/mediatek/mt7601u/eeprom.h
··· 17 17 18 18 struct mt7601u_dev; 19 19 20 - #define MT7601U_EE_MAX_VER 0x0c 20 + #define MT7601U_EE_MAX_VER 0x0d 21 21 #define MT7601U_EEPROM_SIZE 256 22 22 23 23 #define MT7601U_DEFAULT_TX_POWER 6
+1
drivers/net/wireless/quantenna/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0 1 2 # 2 3 # Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 4 # All rights reserved.
+2 -17
drivers/net/wireless/quantenna/qtnfmac/bus.h
··· 1 - /* 2 - * Copyright (c) 2015 Quantenna Communications 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 - */ 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 2 + /* Copyright (c) 2015 Quantenna Communications. All rights reserved. */ 16 3 17 4 #ifndef QTNFMAC_BUS_H 18 5 #define QTNFMAC_BUS_H ··· 122 135 123 136 int qtnf_core_attach(struct qtnf_bus *bus); 124 137 void qtnf_core_detach(struct qtnf_bus *bus); 125 - void qtnf_txflowblock(struct device *dev, bool state); 126 - void qtnf_txcomplete(struct device *dev, struct sk_buff *txp, bool success); 127 138 128 139 #endif /* QTNFMAC_BUS_H */
+15 -28
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
··· 1 - /* 2 - * Copyright (c) 2012-2012 Quantenna Communications, Inc. 3 - * All rights reserved. 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 16 3 17 4 #include <linux/kernel.h> 18 5 #include <linux/etherdevice.h> ··· 109 122 struct vif_params *params) 110 123 { 111 124 struct qtnf_vif *vif = qtnf_netdev_get_priv(dev); 112 - u8 *mac_addr; 125 + u8 *mac_addr = NULL; 126 + int use4addr = 0; 113 127 int ret; 114 128 115 129 ret = qtnf_validate_iface_combinations(wiphy, vif, type); ··· 120 132 return ret; 121 133 } 122 134 123 - if (params) 135 + if (params) { 124 136 mac_addr = params->macaddr; 125 - else 126 - mac_addr = NULL; 137 + use4addr = params->use_4addr; 138 + } 127 139 128 140 qtnf_scan_done(vif->mac, true); 129 141 130 - ret = qtnf_cmd_send_change_intf_type(vif, type, mac_addr); 142 + ret = qtnf_cmd_send_change_intf_type(vif, type, use4addr, mac_addr); 131 143 if (ret) { 132 144 pr_err("VIF%u.%u: failed to change type to %d\n", 133 145 vif->mac->macid, vif->vifid, type); ··· 178 190 struct qtnf_wmac *mac; 179 191 struct qtnf_vif *vif; 180 192 u8 *mac_addr = NULL; 193 + int use4addr = 0; 181 194 int ret; 182 195 183 196 mac = wiphy_priv(wiphy); ··· 214 225 return ERR_PTR(-ENOTSUPP); 215 226 } 216 227 217 - if (params) 228 + if (params) { 218 229 mac_addr = params->macaddr; 230 + use4addr = params->use_4addr; 231 + } 219 232 220 - ret = qtnf_cmd_send_add_intf(vif, type, mac_addr); 233 + ret = qtnf_cmd_send_add_intf(vif, type, use4addr, mac_addr); 221 234 if (ret) { 222 235 pr_err("VIF%u.%u: failed to add VIF %pM\n", 223 236 mac->macid, vif->vifid, mac_addr); ··· 348 357 if (!vif) { 349 358 pr_err("MAC%u: primary VIF is not configured\n", mac->macid); 350 359 return -EFAULT; 351 - } 352 - 353 - if (changed & (WIPHY_PARAM_RETRY_LONG | WIPHY_PARAM_RETRY_SHORT)) { 354 - pr_err("MAC%u: can't modify retry params\n", mac->macid); 355 - return -EOPNOTSUPP; 356 360 } 357 361 358 362 ret = qtnf_cmd_send_update_phy_params(mac, changed); ··· 1093 1107 wiphy->flags |= WIPHY_FLAG_HAVE_AP_SME | 1094 1108 WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD | 1095 1109 WIPHY_FLAG_AP_UAPSD | 1096 - WIPHY_FLAG_HAS_CHANNEL_SWITCH; 1110 + WIPHY_FLAG_HAS_CHANNEL_SWITCH | 1111 + WIPHY_FLAG_4ADDR_STATION; 1097 1112 wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT; 1098 1113 1099 1114 if (hw_info->hw_capab & QLINK_HW_CAPAB_DFS_OFFLOAD)
+2 -15
drivers/net/wireless/quantenna/qtnfmac/cfg80211.h
··· 1 - /* 2 - * Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 - * All rights reserved. 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 16 3 17 4 #ifndef _QTN_FMAC_CFG80211_H_ 18 5 #define _QTN_FMAC_CFG80211_H_
+31 -32
drivers/net/wireless/quantenna/qtnfmac/commands.c
··· 1 - /* 2 - * Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 - * 4 - * This program is free software; you can redistribute it and/or 5 - * modify it under the terms of the GNU General Public License 6 - * as published by the Free Software Foundation; either version 2 7 - * of the License, or (at your option) any later version. 8 - * 9 - * This program is distributed in the hope that it will be useful, 10 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 - * GNU General Public License for more details. 13 - * 14 - */ 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 15 3 16 4 #include <linux/types.h> 17 5 #include <linux/skbuff.h> ··· 60 72 return -EADDRINUSE; 61 73 case QLINK_CMD_RESULT_EADDRNOTAVAIL: 62 74 return -EADDRNOTAVAIL; 75 + case QLINK_CMD_RESULT_EBUSY: 76 + return -EBUSY; 63 77 default: 64 78 return -EFAULT; 65 79 } ··· 87 97 vif_id = cmd->vifid; 88 98 cmd->mhdr.len = cpu_to_le16(cmd_skb->len); 89 99 90 - pr_debug("VIF%u.%u cmd=0x%.4X\n", mac_id, vif_id, 91 - le16_to_cpu(cmd->cmd_id)); 100 + pr_debug("VIF%u.%u cmd=0x%.4X\n", mac_id, vif_id, cmd_id); 92 101 93 102 if (bus->fw_state != QTNF_FW_STATE_ACTIVE && 94 - le16_to_cpu(cmd->cmd_id) != QLINK_CMD_FW_INIT) { 103 + cmd_id != QLINK_CMD_FW_INIT) { 95 104 pr_warn("VIF%u.%u: drop cmd 0x%.4X in fw state %d\n", 96 - mac_id, vif_id, le16_to_cpu(cmd->cmd_id), 97 - bus->fw_state); 105 + mac_id, vif_id, cmd_id, bus->fw_state); 98 106 dev_kfree_skb(cmd_skb); 99 107 return -ENODEV; 100 108 } ··· 126 138 return qtnf_cmd_resp_result_decode(le16_to_cpu(resp->result)); 127 139 128 140 pr_warn("VIF%u.%u: cmd 0x%.4X failed: %d\n", 129 - mac_id, vif_id, le16_to_cpu(cmd->cmd_id), ret); 141 + mac_id, vif_id, cmd_id, ret); 130 142 131 143 return ret; 132 144 } ··· 720 732 721 733 static int qtnf_cmd_send_add_change_intf(struct qtnf_vif *vif, 722 734 enum nl80211_iftype iftype, 735 + int use4addr, 723 736 u8 *mac_addr, 724 737 enum qlink_cmd_type cmd_type) 725 738 { ··· 738 749 qtnf_bus_lock(vif->mac->bus); 739 750 740 751 cmd = (struct qlink_cmd_manage_intf *)cmd_skb->data; 752 + cmd->intf_info.use4addr = use4addr; 741 753 742 754 switch (iftype) { 743 755 case NL80211_IFTYPE_AP: ··· 774 784 return ret; 775 785 } 776 786 777 - int qtnf_cmd_send_add_intf(struct qtnf_vif *vif, 778 - enum nl80211_iftype iftype, u8 *mac_addr) 787 + int qtnf_cmd_send_add_intf(struct qtnf_vif *vif, enum nl80211_iftype iftype, 788 + int use4addr, u8 *mac_addr) 779 789 { 780 - return qtnf_cmd_send_add_change_intf(vif, iftype, mac_addr, 790 + return qtnf_cmd_send_add_change_intf(vif, iftype, use4addr, mac_addr, 781 791 QLINK_CMD_ADD_INTF); 782 792 } 783 793 784 794 int qtnf_cmd_send_change_intf_type(struct qtnf_vif *vif, 785 - enum nl80211_iftype iftype, u8 *mac_addr) 795 + enum nl80211_iftype iftype, 796 + int use4addr, 797 + u8 *mac_addr) 786 798 { 787 - return qtnf_cmd_send_add_change_intf(vif, iftype, mac_addr, 799 + return qtnf_cmd_send_add_change_intf(vif, iftype, use4addr, mac_addr, 788 800 QLINK_CMD_CHANGE_INTF); 789 801 } 790 802 ··· 906 914 if (WARN_ON(resp->n_reg_rules > NL80211_MAX_SUPP_REG_RULES)) 907 915 return -E2BIG; 908 916 909 - hwinfo->rd = kzalloc(sizeof(*hwinfo->rd) 910 - + sizeof(struct ieee80211_reg_rule) 911 - * resp->n_reg_rules, GFP_KERNEL); 917 + hwinfo->rd = kzalloc(struct_size(hwinfo->rd, reg_rules, 918 + resp->n_reg_rules), GFP_KERNEL); 912 919 913 920 if (!hwinfo->rd) 914 921 return -ENOMEM; ··· 1549 1558 switch (tlv_type) { 1550 1559 case QTN_TLV_ID_FRAG_THRESH: 1551 1560 phy_thr = (void *)tlv; 1552 - mac_info->frag_thr = (u32)le16_to_cpu(phy_thr->thr); 1561 + mac_info->frag_thr = le32_to_cpu(phy_thr->thr); 1553 1562 break; 1554 1563 case QTN_TLV_ID_RTS_THRESH: 1555 1564 phy_thr = (void *)tlv; 1556 - mac_info->rts_thr = (u32)le16_to_cpu(phy_thr->thr); 1565 + mac_info->rts_thr = le32_to_cpu(phy_thr->thr); 1557 1566 break; 1558 1567 case QTN_TLV_ID_SRETRY_LIMIT: 1559 1568 limit = (void *)tlv; ··· 1801 1810 qtnf_bus_lock(mac->bus); 1802 1811 1803 1812 if (changed & WIPHY_PARAM_FRAG_THRESHOLD) 1804 - qtnf_cmd_skb_put_tlv_u16(cmd_skb, QTN_TLV_ID_FRAG_THRESH, 1813 + qtnf_cmd_skb_put_tlv_u32(cmd_skb, QTN_TLV_ID_FRAG_THRESH, 1805 1814 wiphy->frag_threshold); 1806 1815 if (changed & WIPHY_PARAM_RTS_THRESHOLD) 1807 - qtnf_cmd_skb_put_tlv_u16(cmd_skb, QTN_TLV_ID_RTS_THRESH, 1816 + qtnf_cmd_skb_put_tlv_u32(cmd_skb, QTN_TLV_ID_RTS_THRESH, 1808 1817 wiphy->rts_threshold); 1809 1818 if (changed & WIPHY_PARAM_COVERAGE_CLASS) 1810 1819 qtnf_cmd_skb_put_tlv_u8(cmd_skb, QTN_TLV_ID_COVERAGE_CLASS, 1811 1820 wiphy->coverage_class); 1821 + 1822 + if (changed & WIPHY_PARAM_RETRY_LONG) 1823 + qtnf_cmd_skb_put_tlv_u8(cmd_skb, QTN_TLV_ID_LRETRY_LIMIT, 1824 + wiphy->retry_long); 1825 + 1826 + if (changed & WIPHY_PARAM_RETRY_SHORT) 1827 + qtnf_cmd_skb_put_tlv_u8(cmd_skb, QTN_TLV_ID_SRETRY_LIMIT, 1828 + wiphy->retry_short); 1812 1829 1813 1830 ret = qtnf_cmd_send(mac->bus, cmd_skb); 1814 1831 if (ret)
+6 -16
drivers/net/wireless/quantenna/qtnfmac/commands.h
··· 1 - /* 2 - * Copyright (c) 2016 Quantenna Communications, Inc. 3 - * 4 - * This program is free software; you can redistribute it and/or 5 - * modify it under the terms of the GNU General Public License 6 - * as published by the Free Software Foundation; either version 2 7 - * of the License, or (at your option) any later version. 8 - * 9 - * This program is distributed in the hope that it will be useful, 10 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 - * GNU General Public License for more details. 13 - * 14 - */ 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 2 + /* Copyright (c) 2016 Quantenna Communications. All rights reserved. */ 15 3 16 4 #ifndef QLINK_COMMANDS_H_ 17 5 #define QLINK_COMMANDS_H_ ··· 14 26 int qtnf_cmd_get_hw_info(struct qtnf_bus *bus); 15 27 int qtnf_cmd_get_mac_info(struct qtnf_wmac *mac); 16 28 int qtnf_cmd_send_add_intf(struct qtnf_vif *vif, enum nl80211_iftype iftype, 17 - u8 *mac_addr); 29 + int use4addr, u8 *mac_addr); 18 30 int qtnf_cmd_send_change_intf_type(struct qtnf_vif *vif, 19 - enum nl80211_iftype iftype, u8 *mac_addr); 31 + enum nl80211_iftype iftype, 32 + int use4addr, 33 + u8 *mac_addr); 20 34 int qtnf_cmd_send_del_intf(struct qtnf_vif *vif); 21 35 int qtnf_cmd_band_info_get(struct qtnf_wmac *mac, 22 36 struct ieee80211_supported_band *band);
+5 -16
drivers/net/wireless/quantenna/qtnfmac/core.c
··· 1 - /* 2 - * Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 - * All rights reserved. 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 16 3 17 4 #include <linux/kernel.h> 18 5 #include <linux/module.h> ··· 182 195 qtnf_scan_done(vif->mac, true); 183 196 184 197 ret = qtnf_cmd_send_change_intf_type(vif, vif->wdev.iftype, 198 + vif->wdev.use_4addr, 185 199 sa->sa_data); 186 200 187 201 if (ret) ··· 533 545 goto error; 534 546 } 535 547 536 - ret = qtnf_cmd_send_add_intf(vif, vif->wdev.iftype, vif->mac_addr); 548 + ret = qtnf_cmd_send_add_intf(vif, vif->wdev.iftype, 549 + vif->wdev.use_4addr, vif->mac_addr); 537 550 if (ret) { 538 551 pr_err("MAC%u: failed to add VIF\n", macid); 539 552 goto error;
+2 -15
drivers/net/wireless/quantenna/qtnfmac/core.h
··· 1 - /* 2 - * Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 - * All rights reserved. 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 16 3 17 4 #ifndef _QTN_FMAC_CORE_H_ 18 5 #define _QTN_FMAC_CORE_H_
+3 -28
drivers/net/wireless/quantenna/qtnfmac/debug.c
··· 1 - /* 2 - * Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 - * All rights reserved. 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 16 3 17 4 #include "debug.h" 18 - 19 - #undef pr_fmt 20 - #define pr_fmt(fmt) "qtnfmac dbg: %s: " fmt, __func__ 21 5 22 6 void qtnf_debugfs_init(struct qtnf_bus *bus, const char *name) 23 7 { 24 8 bus->dbg_dir = debugfs_create_dir(name, NULL); 25 - 26 - if (IS_ERR_OR_NULL(bus->dbg_dir)) { 27 - pr_warn("failed to create debugfs root dir\n"); 28 - bus->dbg_dir = NULL; 29 - } 30 9 } 31 10 32 11 void qtnf_debugfs_remove(struct qtnf_bus *bus) ··· 17 38 void qtnf_debugfs_add_entry(struct qtnf_bus *bus, const char *name, 18 39 int (*fn)(struct seq_file *seq, void *data)) 19 40 { 20 - struct dentry *entry; 21 - 22 - entry = debugfs_create_devm_seqfile(bus->dev, name, bus->dbg_dir, fn); 23 - if (IS_ERR_OR_NULL(entry)) 24 - pr_warn("failed to add entry (%s)\n", name); 41 + debugfs_create_devm_seqfile(bus->dev, name, bus->dbg_dir, fn); 25 42 }
+2 -15
drivers/net/wireless/quantenna/qtnfmac/debug.h
··· 1 - /* 2 - * Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 - * All rights reserved. 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 16 3 17 4 #ifndef _QTN_FMAC_DEBUG_H_ 18 5 #define _QTN_FMAC_DEBUG_H_
+77 -19
drivers/net/wireless/quantenna/qtnfmac/event.c
··· 1 - /* 2 - * Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 - * All rights reserved. 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 16 3 17 4 #include <linux/kernel.h> 18 5 #include <linux/module.h> ··· 145 158 const struct qlink_event_bss_join *join_info, 146 159 u16 len) 147 160 { 161 + struct wiphy *wiphy = priv_to_wiphy(vif->mac); 162 + enum ieee80211_statuscode status = le16_to_cpu(join_info->status); 163 + struct cfg80211_chan_def chandef; 164 + struct cfg80211_bss *bss = NULL; 165 + u8 *ie = NULL; 166 + 148 167 if (unlikely(len < sizeof(*join_info))) { 149 168 pr_err("VIF%u.%u: payload is too short (%u < %zu)\n", 150 169 vif->mac->macid, vif->vifid, len, ··· 164 171 return -EPROTO; 165 172 } 166 173 167 - pr_debug("VIF%u.%u: BSSID:%pM\n", vif->mac->macid, vif->vifid, 168 - join_info->bssid); 174 + pr_debug("VIF%u.%u: BSSID:%pM status:%u\n", 175 + vif->mac->macid, vif->vifid, join_info->bssid, status); 169 176 177 + if (status == WLAN_STATUS_SUCCESS) { 178 + qlink_chandef_q2cfg(wiphy, &join_info->chan, &chandef); 179 + if (!cfg80211_chandef_valid(&chandef)) { 180 + pr_warn("MAC%u.%u: bad channel freq=%u cf1=%u cf2=%u bw=%u\n", 181 + vif->mac->macid, vif->vifid, 182 + chandef.chan->center_freq, 183 + chandef.center_freq1, 184 + chandef.center_freq2, 185 + chandef.width); 186 + status = WLAN_STATUS_UNSPECIFIED_FAILURE; 187 + goto done; 188 + } 189 + 190 + bss = cfg80211_get_bss(wiphy, chandef.chan, join_info->bssid, 191 + NULL, 0, IEEE80211_BSS_TYPE_ESS, 192 + IEEE80211_PRIVACY_ANY); 193 + if (!bss) { 194 + pr_warn("VIF%u.%u: add missing BSS:%pM chan:%u\n", 195 + vif->mac->macid, vif->vifid, 196 + join_info->bssid, chandef.chan->hw_value); 197 + 198 + if (!vif->wdev.ssid_len) { 199 + pr_warn("VIF%u.%u: SSID unknown for BSS:%pM\n", 200 + vif->mac->macid, vif->vifid, 201 + join_info->bssid); 202 + status = WLAN_STATUS_UNSPECIFIED_FAILURE; 203 + goto done; 204 + } 205 + 206 + ie = kzalloc(2 + vif->wdev.ssid_len, GFP_KERNEL); 207 + if (!ie) { 208 + pr_warn("VIF%u.%u: IE alloc failed for BSS:%pM\n", 209 + vif->mac->macid, vif->vifid, 210 + join_info->bssid); 211 + status = WLAN_STATUS_UNSPECIFIED_FAILURE; 212 + goto done; 213 + } 214 + 215 + ie[0] = WLAN_EID_SSID; 216 + ie[1] = vif->wdev.ssid_len; 217 + memcpy(ie + 2, vif->wdev.ssid, vif->wdev.ssid_len); 218 + 219 + bss = cfg80211_inform_bss(wiphy, chandef.chan, 220 + CFG80211_BSS_FTYPE_UNKNOWN, 221 + join_info->bssid, 0, 222 + WLAN_CAPABILITY_ESS, 100, 223 + ie, 2 + vif->wdev.ssid_len, 224 + 0, GFP_KERNEL); 225 + if (!bss) { 226 + pr_warn("VIF%u.%u: can't connect to unknown BSS: %pM\n", 227 + vif->mac->macid, vif->vifid, 228 + join_info->bssid); 229 + status = WLAN_STATUS_UNSPECIFIED_FAILURE; 230 + goto done; 231 + } 232 + } 233 + } 234 + 235 + done: 170 236 cfg80211_connect_result(vif->netdev, join_info->bssid, NULL, 0, NULL, 171 - 0, le16_to_cpu(join_info->status), GFP_KERNEL); 237 + 0, status, GFP_KERNEL); 238 + if (bss) { 239 + if (!ether_addr_equal(vif->bssid, join_info->bssid)) 240 + ether_addr_copy(vif->bssid, join_info->bssid); 241 + cfg80211_put_bss(wiphy, bss); 242 + } 172 243 173 - if (le16_to_cpu(join_info->status) == WLAN_STATUS_SUCCESS) 244 + if (status == WLAN_STATUS_SUCCESS) 174 245 netif_carrier_on(vif->netdev); 175 246 247 + kfree(ie); 176 248 return 0; 177 249 } 178 250
+2 -15
drivers/net/wireless/quantenna/qtnfmac/event.h
··· 1 - /* 2 - * Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 - * All rights reserved. 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 16 3 17 4 #ifndef _QTN_FMAC_EVENT_H_ 18 5 #define _QTN_FMAC_EVENT_H_
+3 -3
drivers/net/wireless/quantenna/qtnfmac/pcie/topaz_pcie.c
··· 559 559 if (!priv->msi_enabled && !qtnf_topaz_intx_asserted(ts)) 560 560 return IRQ_NONE; 561 561 562 + if (!priv->msi_enabled) 563 + qtnf_deassert_intx(ts); 564 + 562 565 priv->pcie_irq_count++; 563 566 564 567 qtnf_shm_ipc_irq_handler(&priv->shm_ipc_ep_in); ··· 573 570 } 574 571 575 572 tasklet_hi_schedule(&priv->reclaim_tq); 576 - 577 - if (!priv->msi_enabled) 578 - qtnf_deassert_intx(ts); 579 573 580 574 return IRQ_HANDLED; 581 575 }
+9 -18
drivers/net/wireless/quantenna/qtnfmac/qlink.h
··· 1 - /* 2 - * Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 - * All rights reserved. 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 16 3 17 4 #ifndef _QTN_QLINK_H_ 18 5 #define _QTN_QLINK_H_ 19 6 20 7 #include <linux/ieee80211.h> 21 8 22 - #define QLINK_PROTO_VER 11 9 + #define QLINK_PROTO_VER 13 23 10 24 11 #define QLINK_MACID_RSVD 0xFF 25 12 #define QLINK_VIFID_RSVD 0xFF ··· 92 105 __le16 if_type; 93 106 __le16 vlanid; 94 107 u8 mac_addr[ETH_ALEN]; 95 - u8 rsvd[2]; 108 + u8 use4addr; 109 + u8 rsvd[1]; 96 110 } __packed; 97 111 98 112 enum qlink_sta_flags { ··· 721 733 QLINK_CMD_RESULT_EALREADY, 722 734 QLINK_CMD_RESULT_EADDRINUSE, 723 735 QLINK_CMD_RESULT_EADDRNOTAVAIL, 736 + QLINK_CMD_RESULT_EBUSY, 724 737 }; 725 738 726 739 /** ··· 975 986 /** 976 987 * struct qlink_event_bss_join - data for QLINK_EVENT_BSS_JOIN event 977 988 * 989 + * @chan: new operating channel definition 978 990 * @bssid: BSSID of a BSS which interface tried to joined. 979 991 * @status: status of joining attempt, see &enum ieee80211_statuscode. 980 992 */ 981 993 struct qlink_event_bss_join { 982 994 struct qlink_event ehdr; 995 + struct qlink_chandef chan; 983 996 u8 bssid[ETH_ALEN]; 984 997 __le16 status; 985 998 } __packed; ··· 1173 1182 1174 1183 struct qlink_tlv_frag_rts_thr { 1175 1184 struct qlink_tlv_hdr hdr; 1176 - __le16 thr; 1185 + __le32 thr; 1177 1186 } __packed; 1178 1187 1179 1188 struct qlink_tlv_rlimit {
+2 -15
drivers/net/wireless/quantenna/qtnfmac/qtn_hw_ids.h
··· 1 - /* 2 - * Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 - * All rights reserved. 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 16 3 17 4 #ifndef _QTN_HW_IDS_H_ 18 5 #define _QTN_HW_IDS_H_
+2 -15
drivers/net/wireless/quantenna/qtnfmac/shm_ipc.c
··· 1 - /* 2 - * Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 - * All rights reserved. 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 16 3 17 4 #include <linux/types.h> 18 5 #include <linux/io.h>
+2 -15
drivers/net/wireless/quantenna/qtnfmac/shm_ipc.h
··· 1 - /* 2 - * Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 - * All rights reserved. 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 16 3 17 4 #ifndef _QTN_FMAC_SHM_IPC_H_ 18 5 #define _QTN_FMAC_SHM_IPC_H_
+2 -15
drivers/net/wireless/quantenna/qtnfmac/shm_ipc_defs.h
··· 1 - /* 2 - * Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 - * All rights reserved. 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 16 3 17 4 #ifndef _QTN_FMAC_SHM_IPC_DEFS_H_ 18 5 #define _QTN_FMAC_SHM_IPC_DEFS_H_
+2 -15
drivers/net/wireless/quantenna/qtnfmac/trans.c
··· 1 - /* 2 - * Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 - * All rights reserved. 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 16 3 17 4 #include <linux/types.h> 18 5 #include <linux/export.h>
+2 -15
drivers/net/wireless/quantenna/qtnfmac/trans.h
··· 1 - /* 2 - * Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 - * All rights reserved. 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 16 3 17 4 #ifndef _QTN_FMAC_TRANS_H_ 18 5 #define _QTN_FMAC_TRANS_H_
+2 -15
drivers/net/wireless/quantenna/qtnfmac/util.c
··· 1 - /* 2 - * Copyright (c) 2015-2016 Quantenna Communications, Inc. 3 - * All rights reserved. 4 - * 5 - * This program is free software; you can redistribute it and/or 6 - * modify it under the terms of the GNU General Public License 7 - * as published by the Free Software Foundation; either version 2 8 - * of the License, or (at your option) any later version. 9 - * 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - */ 1 + // SPDX-License-Identifier: GPL-2.0+ 2 + /* Copyright (c) 2015-2016 Quantenna Communications. All rights reserved. */ 16 3 17 4 #include "util.h" 18 5 #include "qtn_hw_ids.h"
+2 -15
drivers/net/wireless/quantenna/qtnfmac/util.h
··· 1 - /* 2 - * Copyright (c) 2015 Quantenna Communications 3 - * 4 - * Permission to use, copy, modify, and/or distribute this software for any 5 - * purpose with or without fee is hereby granted, provided that the above 6 - * copyright notice and this permission notice appear in all copies. 7 - * 8 - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 11 - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 13 - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 14 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 - */ 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 2 + /* Copyright (c) 2015 Quantenna Communications. All rights reserved. */ 16 3 17 4 #ifndef QTNFMAC_UTIL_H 18 5 #define QTNFMAC_UTIL_H
+1 -1
drivers/net/wireless/ralink/rt2x00/rt2800lib.c
··· 5477 5477 rt2800_register_write(rt2x00dev, TX_SW_CFG2, 0x00000000); 5478 5478 rt2800_register_write(rt2x00dev, MIMO_PS_CFG, 0x00000002); 5479 5479 rt2800_register_write(rt2x00dev, TX_PIN_CFG, 0x00150F0F); 5480 - rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x06060606); 5480 + rt2800_register_write(rt2x00dev, TX_ALC_VGA3, 0x00000000); 5481 5481 rt2800_register_write(rt2x00dev, TX0_BB_GAIN_ATTEN, 0x0); 5482 5482 rt2800_register_write(rt2x00dev, TX1_BB_GAIN_ATTEN, 0x0); 5483 5483 rt2800_register_write(rt2x00dev, TX0_RF_GAIN_ATTEN, 0x6C6C666C);
-27
drivers/net/wireless/ralink/rt2x00/rt2x00debug.c
··· 656 656 intf->driver_folder = 657 657 debugfs_create_dir(intf->rt2x00dev->ops->name, 658 658 rt2x00dev->hw->wiphy->debugfsdir); 659 - if (IS_ERR(intf->driver_folder) || !intf->driver_folder) 660 - goto exit; 661 659 662 660 intf->driver_entry = 663 661 rt2x00debug_create_file_driver("driver", intf, &intf->driver_blob); 664 - if (IS_ERR(intf->driver_entry) || !intf->driver_entry) 665 - goto exit; 666 662 667 663 intf->chipset_entry = 668 664 rt2x00debug_create_file_chipset("chipset", 669 665 intf, &intf->chipset_blob); 670 - if (IS_ERR(intf->chipset_entry) || !intf->chipset_entry) 671 - goto exit; 672 666 673 667 intf->dev_flags = debugfs_create_file("dev_flags", 0400, 674 668 intf->driver_folder, intf, 675 669 &rt2x00debug_fop_dev_flags); 676 - if (IS_ERR(intf->dev_flags) || !intf->dev_flags) 677 - goto exit; 678 670 679 671 intf->cap_flags = debugfs_create_file("cap_flags", 0400, 680 672 intf->driver_folder, intf, 681 673 &rt2x00debug_fop_cap_flags); 682 - if (IS_ERR(intf->cap_flags) || !intf->cap_flags) 683 - goto exit; 684 674 685 675 intf->register_folder = 686 676 debugfs_create_dir("register", intf->driver_folder); 687 - if (IS_ERR(intf->register_folder) || !intf->register_folder) 688 - goto exit; 689 677 690 678 #define RT2X00DEBUGFS_CREATE_REGISTER_ENTRY(__intf, __name) \ 691 679 ({ \ ··· 683 695 0600, \ 684 696 (__intf)->register_folder, \ 685 697 &(__intf)->offset_##__name); \ 686 - if (IS_ERR((__intf)->__name##_off_entry) || \ 687 - !(__intf)->__name##_off_entry) \ 688 - goto exit; \ 689 698 \ 690 699 (__intf)->__name##_val_entry = \ 691 700 debugfs_create_file(__stringify(__name) "_value", \ ··· 690 705 (__intf)->register_folder, \ 691 706 (__intf), \ 692 707 &rt2x00debug_fop_##__name); \ 693 - if (IS_ERR((__intf)->__name##_val_entry) || \ 694 - !(__intf)->__name##_val_entry) \ 695 - goto exit; \ 696 708 } \ 697 709 }) 698 710 ··· 703 721 704 722 intf->queue_folder = 705 723 debugfs_create_dir("queue", intf->driver_folder); 706 - if (IS_ERR(intf->queue_folder) || !intf->queue_folder) 707 - goto exit; 708 724 709 725 intf->queue_frame_dump_entry = 710 726 debugfs_create_file("dump", 0400, intf->queue_folder, 711 727 intf, &rt2x00debug_fop_queue_dump); 712 - if (IS_ERR(intf->queue_frame_dump_entry) 713 - || !intf->queue_frame_dump_entry) 714 - goto exit; 715 728 716 729 skb_queue_head_init(&intf->frame_dump_skbqueue); 717 730 init_waitqueue_head(&intf->frame_dump_waitqueue); ··· 724 747 #endif 725 748 726 749 return; 727 - 728 - exit: 729 - rt2x00debug_deregister(rt2x00dev); 730 - rt2x00_err(rt2x00dev, "Failed to register debug handler\n"); 731 750 } 732 751 733 752 void rt2x00debug_deregister(struct rt2x00_dev *rt2x00dev)
+4 -89
drivers/net/wireless/ralink/rt2x00/rt61pci.c
··· 321 321 struct rt2x00lib_crypto *crypto, 322 322 struct ieee80211_key_conf *key) 323 323 { 324 - struct hw_key_entry key_entry; 325 - struct rt2x00_field32 field; 326 - u32 mask; 327 - u32 reg; 328 - 329 - if (crypto->cmd == SET_KEY) { 330 - /* 331 - * rt2x00lib can't determine the correct free 332 - * key_idx for shared keys. We have 1 register 333 - * with key valid bits. The goal is simple, read 334 - * the register, if that is full we have no slots 335 - * left. 336 - * Note that each BSS is allowed to have up to 4 337 - * shared keys, so put a mask over the allowed 338 - * entries. 339 - */ 340 - mask = (0xf << crypto->bssidx); 341 - 342 - reg = rt2x00mmio_register_read(rt2x00dev, SEC_CSR0); 343 - reg &= mask; 344 - 345 - if (reg && reg == mask) 346 - return -ENOSPC; 347 - 348 - key->hw_key_idx += reg ? ffz(reg) : 0; 349 - 350 - /* 351 - * Upload key to hardware 352 - */ 353 - memcpy(key_entry.key, crypto->key, 354 - sizeof(key_entry.key)); 355 - memcpy(key_entry.tx_mic, crypto->tx_mic, 356 - sizeof(key_entry.tx_mic)); 357 - memcpy(key_entry.rx_mic, crypto->rx_mic, 358 - sizeof(key_entry.rx_mic)); 359 - 360 - reg = SHARED_KEY_ENTRY(key->hw_key_idx); 361 - rt2x00mmio_register_multiwrite(rt2x00dev, reg, 362 - &key_entry, sizeof(key_entry)); 363 - 364 - /* 365 - * The cipher types are stored over 2 registers. 366 - * bssidx 0 and 1 keys are stored in SEC_CSR1 and 367 - * bssidx 1 and 2 keys are stored in SEC_CSR5. 368 - * Using the correct defines correctly will cause overhead, 369 - * so just calculate the correct offset. 370 - */ 371 - if (key->hw_key_idx < 8) { 372 - field.bit_offset = (3 * key->hw_key_idx); 373 - field.bit_mask = 0x7 << field.bit_offset; 374 - 375 - reg = rt2x00mmio_register_read(rt2x00dev, SEC_CSR1); 376 - rt2x00_set_field32(&reg, field, crypto->cipher); 377 - rt2x00mmio_register_write(rt2x00dev, SEC_CSR1, reg); 378 - } else { 379 - field.bit_offset = (3 * (key->hw_key_idx - 8)); 380 - field.bit_mask = 0x7 << field.bit_offset; 381 - 382 - reg = rt2x00mmio_register_read(rt2x00dev, SEC_CSR5); 383 - rt2x00_set_field32(&reg, field, crypto->cipher); 384 - rt2x00mmio_register_write(rt2x00dev, SEC_CSR5, reg); 385 - } 386 - 387 - /* 388 - * The driver does not support the IV/EIV generation 389 - * in hardware. However it doesn't support the IV/EIV 390 - * inside the ieee80211 frame either, but requires it 391 - * to be provided separately for the descriptor. 392 - * rt2x00lib will cut the IV/EIV data out of all frames 393 - * given to us by mac80211, but we must tell mac80211 394 - * to generate the IV/EIV data. 395 - */ 396 - key->flags |= IEEE80211_KEY_FLAG_GENERATE_IV; 397 - } 398 - 399 324 /* 400 - * SEC_CSR0 contains only single-bit fields to indicate 401 - * a particular key is valid. Because using the FIELD32() 402 - * defines directly will cause a lot of overhead, we use 403 - * a calculation to determine the correct bit directly. 325 + * Let the software handle the shared keys, 326 + * since the hardware decryption does not work reliably, 327 + * because the firmware does not know the key's keyidx. 404 328 */ 405 - mask = 1 << key->hw_key_idx; 406 - 407 - reg = rt2x00mmio_register_read(rt2x00dev, SEC_CSR0); 408 - if (crypto->cmd == SET_KEY) 409 - reg |= mask; 410 - else if (crypto->cmd == DISABLE_KEY) 411 - reg &= ~mask; 412 - rt2x00mmio_register_write(rt2x00dev, SEC_CSR0, reg); 413 - 414 - return 0; 329 + return -EOPNOTSUPP; 415 330 } 416 331 417 332 static int rt61pci_config_pairwise_key(struct rt2x00_dev *rt2x00dev,
+2 -2
drivers/net/wireless/ray_cs.c
··· 959 959 if (proto == htons(ETH_P_AARP) || proto == htons(ETH_P_IPX)) { 960 960 /* This is the selective translation table, only 2 entries */ 961 961 writeb(0xf8, 962 - &((struct snaphdr_t __iomem *)ptx->var)->org[3]); 962 + &((struct snaphdr_t __iomem *)ptx->var)->org[2]); 963 963 } 964 964 /* Copy body of ethernet packet without ethernet header */ 965 965 memcpy_toio((void __iomem *)&ptx->var + ··· 2211 2211 untranslate(local, skb, total_len); 2212 2212 } 2213 2213 } else { /* sniffer mode, so just pass whole packet */ 2214 - }; 2214 + } 2215 2215 2216 2216 /************************/ 2217 2217 /* Now pick up the rest of the fragments if any */
+1 -1
drivers/net/wireless/realtek/rtl818x/rtl8180/Makefile
··· 2 2 3 3 obj-$(CONFIG_RTL8180) += rtl818x_pci.o 4 4 5 - ccflags-y += -Idrivers/net/wireless/realtek/rtl818x 5 + ccflags-y += -I $(srctree)/$(src)/..
+1 -1
drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c
··· 803 803 rtl818x_iowrite16(priv, FEMR_SE, 0xffff); 804 804 } else { 805 805 reg16 = rtl818x_ioread16(priv, &priv->map->FEMR); 806 - reg16 |= (1 << 15) | (1 << 14) | (1 << 4); 806 + reg16 |= (1 << 15) | (1 << 14) | (1 << 4); 807 807 rtl818x_iowrite16(priv, &priv->map->FEMR, reg16); 808 808 } 809 809
+1 -1
drivers/net/wireless/realtek/rtl818x/rtl8187/Makefile
··· 2 2 3 3 obj-$(CONFIG_RTL8187) += rtl8187.o 4 4 5 - ccflags-y += -Idrivers/net/wireless/realtek/rtl818x 5 + ccflags-y += -I $(srctree)/$(src)/..
+2 -2
drivers/net/wireless/realtek/rtlwifi/base.c
··· 2172 2172 ; 2173 2173 } 2174 2174 2175 - rtlpriv->link_info.num_rx_inperiod = 0; 2176 - rtlpriv->link_info.num_tx_inperiod = 0; 2177 2175 for (tid = 0; tid <= 7; tid++) 2178 2176 rtlpriv->link_info.tidtx_inperiod[tid] = 0; 2179 2177 ··· 2234 2236 rtlpriv->btcoexist.btc_info.in_4way = false; 2235 2237 } 2236 2238 2239 + rtlpriv->link_info.num_rx_inperiod = 0; 2240 + rtlpriv->link_info.num_tx_inperiod = 0; 2237 2241 rtlpriv->link_info.bcn_rx_inperiod = 0; 2238 2242 2239 2243 /* <6> scan list */
+2
drivers/net/wireless/realtek/rtlwifi/core.c
··· 1957 1957 dm_digtable->bt30_cur_igi = 0x32; 1958 1958 dm_digtable->pre_cck_pd_state = CCK_PD_STAGE_MAX; 1959 1959 dm_digtable->cur_cck_pd_state = CCK_PD_STAGE_LOWRSSI; 1960 + dm_digtable->pre_cck_fa_state = 0; 1961 + dm_digtable->cur_cck_fa_state = 0; 1960 1962 } 1961 1963 EXPORT_SYMBOL(rtl_dm_diginit);
+3 -11
drivers/net/wireless/realtek/rtlwifi/debug.c
··· 463 463 #define RTL_DEBUGFS_ADD_CORE(name, mode, fopname) \ 464 464 do { \ 465 465 rtl_debug_priv_ ##name.rtlpriv = rtlpriv; \ 466 - if (!debugfs_create_file(#name, mode, \ 467 - parent, &rtl_debug_priv_ ##name, \ 468 - &file_ops_ ##fopname)) \ 469 - pr_err("Unable to initialize debugfs:%s/%s\n", \ 470 - rtlpriv->dbg.debugfs_name, \ 471 - #name); \ 466 + debugfs_create_file(#name, mode, parent, \ 467 + &rtl_debug_priv_ ##name, \ 468 + &file_ops_ ##fopname); \ 472 469 } while (0) 473 470 474 471 #define RTL_DEBUGFS_ADD(name) \ ··· 483 486 484 487 rtlpriv->dbg.debugfs_dir = 485 488 debugfs_create_dir(rtlpriv->dbg.debugfs_name, debugfs_topdir); 486 - if (!rtlpriv->dbg.debugfs_dir) { 487 - pr_err("Unable to init debugfs:/%s/%s\n", rtlpriv->cfg->name, 488 - rtlpriv->dbg.debugfs_name); 489 - return; 490 - } 491 489 492 490 parent = rtlpriv->dbg.debugfs_dir; 493 491
+93 -2
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/dm.c
··· 151 151 { 152 152 struct rtl_priv *rtlpriv = rtl_priv(hw); 153 153 struct dig_t *dm_digtable = &rtlpriv->dm_digtable; 154 + struct rtl_mac *mac = rtl_mac(rtlpriv); 154 155 long rssi_val_min = 0; 156 + 157 + if (mac->link_state == MAC80211_LINKED && 158 + mac->opmode == NL80211_IFTYPE_STATION && 159 + rtlpriv->link_info.bcn_rx_inperiod == 0) 160 + return 0; 155 161 156 162 if ((dm_digtable->curmultista_cstate == DIG_MULTISTA_CONNECT) && 157 163 (dm_digtable->cursta_cstate == DIG_STA_CONNECT)) { ··· 423 417 } else { 424 418 rtl_set_bbreg(hw, RCCK0_CCA, MASKBYTE2, 0xcd); 425 419 rtl_set_bbreg(hw, RCCK0_SYSTEM, MASKBYTE1, 0x47); 420 + dm_digtable->pre_cck_fa_state = 0; 421 + dm_digtable->cur_cck_fa_state = 0; 426 422 427 423 } 428 424 dm_digtable->pre_cck_pd_state = dm_digtable->cur_cck_pd_state; ··· 673 665 void rtl8723e_dm_init_rate_adaptive_mask(struct ieee80211_hw *hw) 674 666 { 675 667 struct rtl_priv *rtlpriv = rtl_priv(hw); 676 - struct rate_adaptive *p_ra = &(rtlpriv->ra); 668 + struct rate_adaptive *p_ra = &rtlpriv->ra; 677 669 678 670 p_ra->ratr_state = DM_RATR_STA_INIT; 679 671 p_ra->pre_ratr_state = DM_RATR_STA_INIT; ··· 683 675 else 684 676 rtlpriv->dm.useramask = false; 685 677 678 + } 679 + 680 + void rtl8723e_dm_refresh_rate_adaptive_mask(struct ieee80211_hw *hw) 681 + { 682 + struct rtl_priv *rtlpriv = rtl_priv(hw); 683 + struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 684 + struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); 685 + struct rate_adaptive *p_ra = &rtlpriv->ra; 686 + u32 low_rssithresh_for_ra, high_rssithresh_for_ra; 687 + struct ieee80211_sta *sta = NULL; 688 + 689 + if (is_hal_stop(rtlhal)) { 690 + RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, 691 + " driver is going to unload\n"); 692 + return; 693 + } 694 + 695 + if (!rtlpriv->dm.useramask) { 696 + RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, 697 + " driver does not control rate adaptive mask\n"); 698 + return; 699 + } 700 + 701 + if (mac->link_state == MAC80211_LINKED && 702 + mac->opmode == NL80211_IFTYPE_STATION) { 703 + switch (p_ra->pre_ratr_state) { 704 + case DM_RATR_STA_HIGH: 705 + high_rssithresh_for_ra = 50; 706 + low_rssithresh_for_ra = 20; 707 + break; 708 + case DM_RATR_STA_MIDDLE: 709 + high_rssithresh_for_ra = 55; 710 + low_rssithresh_for_ra = 20; 711 + break; 712 + case DM_RATR_STA_LOW: 713 + high_rssithresh_for_ra = 60; 714 + low_rssithresh_for_ra = 25; 715 + break; 716 + default: 717 + high_rssithresh_for_ra = 50; 718 + low_rssithresh_for_ra = 20; 719 + break; 720 + } 721 + 722 + if (rtlpriv->link_info.bcn_rx_inperiod == 0) 723 + switch (p_ra->pre_ratr_state) { 724 + case DM_RATR_STA_HIGH: 725 + default: 726 + p_ra->ratr_state = DM_RATR_STA_MIDDLE; 727 + break; 728 + case DM_RATR_STA_MIDDLE: 729 + case DM_RATR_STA_LOW: 730 + p_ra->ratr_state = DM_RATR_STA_LOW; 731 + break; 732 + } 733 + else if (rtlpriv->dm.undec_sm_pwdb > high_rssithresh_for_ra) 734 + p_ra->ratr_state = DM_RATR_STA_HIGH; 735 + else if (rtlpriv->dm.undec_sm_pwdb > low_rssithresh_for_ra) 736 + p_ra->ratr_state = DM_RATR_STA_MIDDLE; 737 + else 738 + p_ra->ratr_state = DM_RATR_STA_LOW; 739 + 740 + if (p_ra->pre_ratr_state != p_ra->ratr_state) { 741 + RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, 742 + "RSSI = %ld\n", 743 + rtlpriv->dm.undec_sm_pwdb); 744 + RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, 745 + "RSSI_LEVEL = %d\n", p_ra->ratr_state); 746 + RT_TRACE(rtlpriv, COMP_RATE, DBG_LOUD, 747 + "PreState = %d, CurState = %d\n", 748 + p_ra->pre_ratr_state, p_ra->ratr_state); 749 + 750 + rcu_read_lock(); 751 + sta = rtl_find_sta(hw, mac->bssid); 752 + if (sta) 753 + rtlpriv->cfg->ops->update_rate_tbl(hw, sta, 754 + p_ra->ratr_state, 755 + true); 756 + rcu_read_unlock(); 757 + 758 + p_ra->pre_ratr_state = p_ra->ratr_state; 759 + } 760 + } 686 761 } 687 762 688 763 void rtl8723e_dm_rf_saving(struct ieee80211_hw *hw, u8 bforce_in_normal) ··· 917 826 rtl8723e_dm_dynamic_bb_powersaving(hw); 918 827 rtl8723e_dm_dynamic_txpower(hw); 919 828 rtl8723e_dm_check_txpower_tracking(hw); 920 - /* rtl92c_dm_refresh_rate_adaptive_mask(hw); */ 829 + rtl8723e_dm_refresh_rate_adaptive_mask(hw); 921 830 rtl8723e_dm_bt_coexist(hw); 922 831 rtl8723e_dm_check_edca_turbo(hw); 923 832 }
+4 -4
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/sw.c
··· 266 266 static struct rtl_mod_params rtl8723e_mod_params = { 267 267 .sw_crypto = false, 268 268 .inactiveps = true, 269 - .swctrl_lps = false, 270 - .fwctrl_lps = true, 269 + .swctrl_lps = true, 270 + .fwctrl_lps = false, 271 271 .aspm_support = 1, 272 272 .debug_level = 0, 273 273 .debug_mask = 0, ··· 395 395 bool, 0444); 396 396 MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n"); 397 397 MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n"); 398 - MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n"); 399 - MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); 398 + MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 1)\n"); 399 + MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 0)\n"); 400 400 MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 0)\n"); 401 401 MODULE_PARM_DESC(aspm, "Set to 1 to enable ASPM (default 1)\n"); 402 402 MODULE_PARM_DESC(debug_level, "Set debug level (0-5) (default 0)");
+3 -3
drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
··· 332 332 "Invalid RateSection %d in Band 2.4G, Rf Path %d, %dTx in PHY_SetTxPowerByRateBase()\n", 333 333 rate_section, path, txnum); 334 334 break; 335 - }; 335 + } 336 336 } else { 337 337 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 338 338 "Invalid Band %d in PHY_SetTxPowerByRateBase()\n", ··· 374 374 "Invalid RateSection %d in Band 2.4G, Rf Path %d, %dTx in PHY_GetTxPowerByRateBase()\n", 375 375 rate_section, path, txnum); 376 376 break; 377 - }; 377 + } 378 378 } else { 379 379 RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, 380 380 "Invalid Band %d in PHY_GetTxPowerByRateBase()\n", ··· 694 694 else if (regaddr >= 0xE20 && regaddr <= 0xE4C) 695 695 index = (u8)((regaddr - 0xE20) / 4); 696 696 break; 697 - }; 697 + } 698 698 return index; 699 699 } 700 700
-5
drivers/net/wireless/rsi/rsi_91x_debugfs.c
··· 297 297 298 298 dev_dbgfs->subdir = debugfs_create_dir(devdir, NULL); 299 299 300 - if (!dev_dbgfs->subdir) { 301 - kfree(dev_dbgfs); 302 - return -ENOMEM; 303 - } 304 - 305 300 for (ii = 0; ii < adapter->num_debugfs_entries; ii++) { 306 301 files = &dev_debugfs_files[ii]; 307 302 dev_dbgfs->rsi_files[ii] =
+3
drivers/net/wireless/rsi/rsi_91x_hal.c
··· 100 100 mgmt_desc->frame_type = TX_DOT11_MGMT; 101 101 mgmt_desc->header_len = MIN_802_11_HDR_LEN; 102 102 mgmt_desc->xtend_desc_size = header_size - FRAME_DESC_SZ; 103 + 104 + if (ieee80211_is_probe_req(wh->frame_control)) 105 + mgmt_desc->frame_info = cpu_to_le16(RSI_INSERT_SEQ_IN_FW); 103 106 mgmt_desc->frame_info |= cpu_to_le16(RATE_INFO_ENABLE); 104 107 if (is_broadcast_ether_addr(wh->addr1)) 105 108 mgmt_desc->frame_info |= cpu_to_le16(RSI_BROADCAST_PKT);
+67
drivers/net/wireless/rsi/rsi_91x_mac80211.c
··· 229 229 /* sbands->ht_cap.mcs.rx_highest = 0x82; */ 230 230 } 231 231 232 + static int rsi_mac80211_hw_scan_start(struct ieee80211_hw *hw, 233 + struct ieee80211_vif *vif, 234 + struct ieee80211_scan_request *hw_req) 235 + { 236 + struct cfg80211_scan_request *scan_req = &hw_req->req; 237 + struct rsi_hw *adapter = hw->priv; 238 + struct rsi_common *common = adapter->priv; 239 + struct ieee80211_bss_conf *bss = &vif->bss_conf; 240 + 241 + rsi_dbg(INFO_ZONE, "***** Hardware scan start *****\n"); 242 + 243 + if (common->fsm_state != FSM_MAC_INIT_DONE) 244 + return -ENODEV; 245 + 246 + if ((common->wow_flags & RSI_WOW_ENABLED) || 247 + scan_req->n_channels == 0) 248 + return -EINVAL; 249 + 250 + /* Scan already in progress. So return */ 251 + if (common->bgscan_en) 252 + return -EBUSY; 253 + 254 + /* If STA is not connected, return with special value 1, in order 255 + * to start sw_scan in mac80211 256 + */ 257 + if (!bss->assoc) 258 + return 1; 259 + 260 + mutex_lock(&common->mutex); 261 + common->hwscan = scan_req; 262 + if (!rsi_send_bgscan_params(common, RSI_START_BGSCAN)) { 263 + if (!rsi_send_bgscan_probe_req(common, vif)) { 264 + rsi_dbg(INFO_ZONE, "Background scan started...\n"); 265 + common->bgscan_en = true; 266 + } 267 + } 268 + mutex_unlock(&common->mutex); 269 + 270 + return 0; 271 + } 272 + 273 + static void rsi_mac80211_cancel_hw_scan(struct ieee80211_hw *hw, 274 + struct ieee80211_vif *vif) 275 + { 276 + struct rsi_hw *adapter = hw->priv; 277 + struct rsi_common *common = adapter->priv; 278 + struct cfg80211_scan_info info; 279 + 280 + rsi_dbg(INFO_ZONE, "***** Hardware scan stop *****\n"); 281 + mutex_lock(&common->mutex); 282 + 283 + if (common->bgscan_en) { 284 + if (!rsi_send_bgscan_params(common, RSI_STOP_BGSCAN)) 285 + common->bgscan_en = false; 286 + info.aborted = false; 287 + ieee80211_scan_completed(adapter->hw, &info); 288 + rsi_dbg(INFO_ZONE, "Back ground scan cancelled\b\n"); 289 + } 290 + common->hwscan = NULL; 291 + mutex_unlock(&common->mutex); 292 + } 293 + 232 294 /** 233 295 * rsi_mac80211_detach() - This function is used to de-initialize the 234 296 * Mac80211 stack. ··· 1979 1917 .suspend = rsi_mac80211_suspend, 1980 1918 .resume = rsi_mac80211_resume, 1981 1919 #endif 1920 + .hw_scan = rsi_mac80211_hw_scan_start, 1921 + .cancel_hw_scan = rsi_mac80211_cancel_hw_scan, 1982 1922 }; 1983 1923 1984 1924 /** ··· 2063 1999 common->max_stations = wiphy->max_ap_assoc_sta; 2064 2000 rsi_dbg(ERR_ZONE, "Max Stations Allowed = %d\n", common->max_stations); 2065 2001 hw->sta_data_size = sizeof(struct rsi_sta); 2002 + 2003 + wiphy->max_scan_ssids = RSI_MAX_SCAN_SSIDS; 2004 + wiphy->max_scan_ie_len = RSI_MAX_SCAN_IE_LEN; 2066 2005 wiphy->flags = WIPHY_FLAG_REPORTS_OBSS; 2067 2006 wiphy->flags |= WIPHY_FLAG_AP_UAPSD; 2068 2007 wiphy->features |= NL80211_FEATURE_INACTIVITY_TIMER;
+1
drivers/net/wireless/rsi/rsi_91x_main.c
··· 328 328 } 329 329 330 330 rsi_default_ps_params(adapter); 331 + init_bgscan_params(common); 331 332 spin_lock_init(&adapter->ps_lock); 332 333 timer_setup(&common->roc_timer, rsi_roc_timeout, 0); 333 334 init_completion(&common->wlan_init_completion);
+133
drivers/net/wireless/rsi/rsi_91x_mgmt.c
··· 15 15 */ 16 16 17 17 #include <linux/etherdevice.h> 18 + #include <linux/timer.h> 18 19 #include "rsi_mgmt.h" 19 20 #include "rsi_common.h" 20 21 #include "rsi_ps.h" ··· 235 234 common->obm_ant_sel_val = 2; 236 235 common->beacon_interval = RSI_BEACON_INTERVAL; 237 236 common->dtim_cnt = RSI_DTIM_COUNT; 237 + } 238 + 239 + void init_bgscan_params(struct rsi_common *common) 240 + { 241 + memset((u8 *)&common->bgscan, 0, sizeof(struct rsi_bgscan_params)); 242 + common->bgscan.bgscan_threshold = RSI_DEF_BGSCAN_THRLD; 243 + common->bgscan.roam_threshold = RSI_DEF_ROAM_THRLD; 244 + common->bgscan.bgscan_periodicity = RSI_BGSCAN_PERIODICITY; 245 + common->bgscan.num_bgscan_channels = 0; 246 + common->bgscan.two_probe = 1; 247 + common->bgscan.active_scan_duration = RSI_ACTIVE_SCAN_TIME; 248 + common->bgscan.passive_scan_duration = RSI_PASSIVE_SCAN_TIME; 238 249 } 239 250 240 251 /** ··· 1641 1628 } 1642 1629 #endif 1643 1630 1631 + int rsi_send_bgscan_params(struct rsi_common *common, int enable) 1632 + { 1633 + struct rsi_bgscan_params *params = &common->bgscan; 1634 + struct cfg80211_scan_request *scan_req = common->hwscan; 1635 + struct rsi_bgscan_config *bgscan; 1636 + struct sk_buff *skb; 1637 + u16 frame_len = sizeof(*bgscan); 1638 + u8 i; 1639 + 1640 + rsi_dbg(MGMT_TX_ZONE, "%s: Sending bgscan params frame\n", __func__); 1641 + 1642 + skb = dev_alloc_skb(frame_len); 1643 + if (!skb) 1644 + return -ENOMEM; 1645 + memset(skb->data, 0, frame_len); 1646 + 1647 + bgscan = (struct rsi_bgscan_config *)skb->data; 1648 + rsi_set_len_qno(&bgscan->desc_dword0.len_qno, 1649 + (frame_len - FRAME_DESC_SZ), RSI_WIFI_MGMT_Q); 1650 + bgscan->desc_dword0.frame_type = BG_SCAN_PARAMS; 1651 + bgscan->bgscan_threshold = cpu_to_le16(params->bgscan_threshold); 1652 + bgscan->roam_threshold = cpu_to_le16(params->roam_threshold); 1653 + if (enable) 1654 + bgscan->bgscan_periodicity = 1655 + cpu_to_le16(params->bgscan_periodicity); 1656 + bgscan->active_scan_duration = 1657 + cpu_to_le16(params->active_scan_duration); 1658 + bgscan->passive_scan_duration = 1659 + cpu_to_le16(params->passive_scan_duration); 1660 + bgscan->two_probe = params->two_probe; 1661 + 1662 + bgscan->num_bgscan_channels = scan_req->n_channels; 1663 + for (i = 0; i < bgscan->num_bgscan_channels; i++) 1664 + bgscan->channels2scan[i] = 1665 + cpu_to_le16(scan_req->channels[i]->hw_value); 1666 + 1667 + skb_put(skb, frame_len); 1668 + 1669 + return rsi_send_internal_mgmt_frame(common, skb); 1670 + } 1671 + 1672 + /* This function sends the probe request to be used by firmware in 1673 + * background scan 1674 + */ 1675 + int rsi_send_bgscan_probe_req(struct rsi_common *common, 1676 + struct ieee80211_vif *vif) 1677 + { 1678 + struct cfg80211_scan_request *scan_req = common->hwscan; 1679 + struct rsi_bgscan_probe *bgscan; 1680 + struct sk_buff *skb; 1681 + struct sk_buff *probereq_skb; 1682 + u16 frame_len = sizeof(*bgscan); 1683 + size_t ssid_len = 0; 1684 + u8 *ssid = NULL; 1685 + 1686 + rsi_dbg(MGMT_TX_ZONE, 1687 + "%s: Sending bgscan probe req frame\n", __func__); 1688 + 1689 + if (common->priv->sc_nvifs <= 0) 1690 + return -ENODEV; 1691 + 1692 + if (scan_req->n_ssids) { 1693 + ssid = scan_req->ssids[0].ssid; 1694 + ssid_len = scan_req->ssids[0].ssid_len; 1695 + } 1696 + 1697 + skb = dev_alloc_skb(frame_len + MAX_BGSCAN_PROBE_REQ_LEN); 1698 + if (!skb) 1699 + return -ENOMEM; 1700 + memset(skb->data, 0, frame_len + MAX_BGSCAN_PROBE_REQ_LEN); 1701 + 1702 + bgscan = (struct rsi_bgscan_probe *)skb->data; 1703 + bgscan->desc_dword0.frame_type = BG_SCAN_PROBE_REQ; 1704 + bgscan->flags = cpu_to_le16(HOST_BG_SCAN_TRIG); 1705 + if (common->band == NL80211_BAND_5GHZ) { 1706 + bgscan->mgmt_rate = cpu_to_le16(RSI_RATE_6); 1707 + bgscan->def_chan = cpu_to_le16(40); 1708 + } else { 1709 + bgscan->mgmt_rate = cpu_to_le16(RSI_RATE_1); 1710 + bgscan->def_chan = cpu_to_le16(11); 1711 + } 1712 + bgscan->channel_scan_time = cpu_to_le16(RSI_CHANNEL_SCAN_TIME); 1713 + 1714 + probereq_skb = ieee80211_probereq_get(common->priv->hw, vif->addr, ssid, 1715 + ssid_len, scan_req->ie_len); 1716 + 1717 + memcpy(&skb->data[frame_len], probereq_skb->data, probereq_skb->len); 1718 + 1719 + bgscan->probe_req_length = cpu_to_le16(probereq_skb->len); 1720 + 1721 + rsi_set_len_qno(&bgscan->desc_dword0.len_qno, 1722 + (frame_len - FRAME_DESC_SZ + probereq_skb->len), 1723 + RSI_WIFI_MGMT_Q); 1724 + 1725 + skb_put(skb, frame_len + probereq_skb->len); 1726 + 1727 + dev_kfree_skb(probereq_skb); 1728 + 1729 + return rsi_send_internal_mgmt_frame(common, skb); 1730 + } 1731 + 1644 1732 /** 1645 1733 * rsi_handle_ta_confirm_type() - This function handles the confirm frames. 1646 1734 * @common: Pointer to the driver private structure. ··· 1885 1771 return 0; 1886 1772 } 1887 1773 break; 1774 + 1775 + case SCAN_REQUEST: 1776 + rsi_dbg(INFO_ZONE, "Set channel confirm\n"); 1777 + break; 1778 + 1888 1779 case WAKEUP_SLEEP_REQUEST: 1889 1780 rsi_dbg(INFO_ZONE, "Wakeup/Sleep confirmation.\n"); 1890 1781 return rsi_handle_ps_confirm(adapter, msg); 1782 + 1783 + case BG_SCAN_PROBE_REQ: 1784 + rsi_dbg(INFO_ZONE, "BG scan complete event\n"); 1785 + if (common->bgscan_en) { 1786 + struct cfg80211_scan_info info; 1787 + 1788 + if (!rsi_send_bgscan_params(common, RSI_STOP_BGSCAN)) 1789 + common->bgscan_en = 0; 1790 + info.aborted = false; 1791 + ieee80211_scan_completed(adapter->hw, &info); 1792 + } 1793 + rsi_dbg(INFO_ZONE, "Background scan completed\n"); 1794 + break; 1795 + 1891 1796 default: 1892 1797 rsi_dbg(INFO_ZONE, "%s: Invalid TA confirm pkt received\n", 1893 1798 __func__);
+9 -6
drivers/net/wireless/rsi/rsi_91x_sdio.c
··· 230 230 rsi_dbg(ERR_ZONE, "%s: CMD0 failed : %d\n", __func__, err); 231 231 232 232 /* Issue CMD5, arg = 0 */ 233 - err = rsi_issue_sdiocommand(pfunction, SD_IO_SEND_OP_COND, 0, 234 - (MMC_RSP_R4 | MMC_CMD_BCR), &resp); 235 - if (err) 236 - rsi_dbg(ERR_ZONE, "%s: CMD5 failed : %d\n", __func__, err); 237 - card->ocr = resp; 233 + if (!host->ocr_avail) { 234 + err = rsi_issue_sdiocommand(pfunction, SD_IO_SEND_OP_COND, 0, 235 + (MMC_RSP_R4 | MMC_CMD_BCR), &resp); 236 + if (err) 237 + rsi_dbg(ERR_ZONE, "%s: CMD5 failed : %d\n", 238 + __func__, err); 238 239 240 + host->ocr_avail = resp; 241 + } 239 242 /* Issue CMD5, arg = ocr. Wait till card is ready */ 240 243 for (i = 0; i < 100; i++) { 241 244 err = rsi_issue_sdiocommand(pfunction, SD_IO_SEND_OP_COND, 242 - card->ocr, 245 + host->ocr_avail, 243 246 (MMC_RSP_R4 | MMC_CMD_BCR), &resp); 244 247 if (err) { 245 248 rsi_dbg(ERR_ZONE, "%s: CMD5 failed : %d\n",
+22
drivers/net/wireless/rsi/rsi_main.h
··· 164 164 u32 total_tx_pkt_freed[NUM_EDCA_QUEUES + 2]; 165 165 }; 166 166 167 + #define MAX_BGSCAN_CHANNELS_DUAL_BAND 38 168 + #define MAX_BGSCAN_PROBE_REQ_LEN 0x64 169 + #define RSI_DEF_BGSCAN_THRLD 0x0 170 + #define RSI_DEF_ROAM_THRLD 0xa 171 + #define RSI_BGSCAN_PERIODICITY 0x1e 172 + #define RSI_ACTIVE_SCAN_TIME 0x14 173 + #define RSI_PASSIVE_SCAN_TIME 0x46 174 + #define RSI_CHANNEL_SCAN_TIME 20 175 + struct rsi_bgscan_params { 176 + u16 bgscan_threshold; 177 + u16 roam_threshold; 178 + u16 bgscan_periodicity; 179 + u8 num_bgscan_channels; 180 + u8 two_probe; 181 + u16 active_scan_duration; 182 + u16 passive_scan_duration; 183 + }; 184 + 167 185 struct vif_priv { 168 186 bool is_ht; 169 187 bool sgi; ··· 307 289 308 290 bool eapol4_confirm; 309 291 void *bt_adapter; 292 + 293 + struct cfg80211_scan_request *hwscan; 294 + struct rsi_bgscan_params bgscan; 295 + u8 bgscan_en; 310 296 }; 311 297 312 298 struct eepromrw_info {
+35
drivers/net/wireless/rsi/rsi_mgmt.h
··· 228 228 #define RSI_MAX_TX_AGGR_FRMS 8 229 229 #define RSI_MAX_RX_AGGR_FRMS 8 230 230 231 + #define RSI_MAX_SCAN_SSIDS 16 232 + #define RSI_MAX_SCAN_IE_LEN 256 233 + 231 234 enum opmode { 232 235 RSI_OPMODE_UNSUPPORTED = -1, 233 236 RSI_OPMODE_AP = 0, ··· 626 623 u16 host_sleep_status; 627 624 } __packed; 628 625 626 + #define RSI_START_BGSCAN 1 627 + #define RSI_STOP_BGSCAN 0 628 + #define HOST_BG_SCAN_TRIG BIT(4) 629 + struct rsi_bgscan_config { 630 + struct rsi_cmd_desc_dword0 desc_dword0; 631 + __le64 reserved; 632 + __le32 reserved1; 633 + __le16 bgscan_threshold; 634 + __le16 roam_threshold; 635 + __le16 bgscan_periodicity; 636 + u8 num_bgscan_channels; 637 + u8 two_probe; 638 + __le16 active_scan_duration; 639 + __le16 passive_scan_duration; 640 + __le16 channels2scan[MAX_BGSCAN_CHANNELS_DUAL_BAND]; 641 + } __packed; 642 + 643 + struct rsi_bgscan_probe { 644 + struct rsi_cmd_desc_dword0 desc_dword0; 645 + __le64 reserved; 646 + __le32 reserved1; 647 + __le16 mgmt_rate; 648 + __le16 flags; 649 + __le16 def_chan; 650 + __le16 channel_scan_time; 651 + __le16 probe_req_length; 652 + } __packed; 653 + 629 654 static inline u32 rsi_get_queueno(u8 *addr, u16 offset) 630 655 { 631 656 return (le16_to_cpu(*(__le16 *)&addr[offset]) & 0x7000) >> 12; ··· 725 694 #endif 726 695 int rsi_send_ps_request(struct rsi_hw *adapter, bool enable, 727 696 struct ieee80211_vif *vif); 697 + void init_bgscan_params(struct rsi_common *common); 698 + int rsi_send_bgscan_params(struct rsi_common *common, int enable); 699 + int rsi_send_bgscan_probe_req(struct rsi_common *common, 700 + struct ieee80211_vif *vif); 728 701 #endif
+6 -20
drivers/net/wireless/st/cw1200/debug.c
··· 371 371 372 372 d->debugfs_phy = debugfs_create_dir("cw1200", 373 373 priv->hw->wiphy->debugfsdir); 374 - if (!d->debugfs_phy) 375 - goto err; 376 - 377 - if (!debugfs_create_file("status", 0400, d->debugfs_phy, 378 - priv, &cw1200_status_fops)) 379 - goto err; 380 - 381 - if (!debugfs_create_file("counters", 0400, d->debugfs_phy, 382 - priv, &cw1200_counters_fops)) 383 - goto err; 384 - 385 - if (!debugfs_create_file("wsm_dumps", 0200, d->debugfs_phy, 386 - priv, &fops_wsm_dumps)) 387 - goto err; 374 + debugfs_create_file("status", 0400, d->debugfs_phy, priv, 375 + &cw1200_status_fops); 376 + debugfs_create_file("counters", 0400, d->debugfs_phy, priv, 377 + &cw1200_counters_fops); 378 + debugfs_create_file("wsm_dumps", 0200, d->debugfs_phy, priv, 379 + &fops_wsm_dumps); 388 380 389 381 return 0; 390 - 391 - err: 392 - priv->debug = NULL; 393 - debugfs_remove_recursive(d->debugfs_phy); 394 - kfree(d); 395 - return ret; 396 382 } 397 383 398 384 void cw1200_debug_release(struct cw1200_common *priv)
+2 -2
drivers/net/wireless/st/cw1200/fwio.c
··· 465 465 466 466 if (!(val32 & ST90TDS_CONFIG_ACCESS_MODE_BIT)) { 467 467 pr_err("Device is already in QUEUE mode!\n"); 468 - ret = -EINVAL; 469 - goto out; 468 + ret = -EINVAL; 469 + goto out; 470 470 } 471 471 472 472 switch (priv->hw_type) {
-1
drivers/net/wireless/st/cw1200/queue.c
··· 283 283 struct cw1200_txpriv *txpriv) 284 284 { 285 285 int ret = 0; 286 - LIST_HEAD(gc_list); 287 286 struct cw1200_queue_stats *stats = queue->stats; 288 287 289 288 if (txpriv->link_id >= queue->stats->map_capacity)
+4 -1
drivers/net/wireless/st/cw1200/scan.c
··· 84 84 85 85 frame.skb = ieee80211_probereq_get(hw, priv->vif->addr, NULL, 0, 86 86 req->ie_len); 87 - if (!frame.skb) 87 + if (!frame.skb) { 88 + mutex_unlock(&priv->conf_mutex); 89 + up(&priv->scan.lock); 88 90 return -ENOMEM; 91 + } 89 92 90 93 if (req->ie_len) 91 94 skb_put_data(frame.skb, req->ie, req->ie_len);
+5 -54
drivers/net/wireless/ti/wl1251/debugfs.c
··· 54 54 #define DEBUGFS_ADD(name, parent) \ 55 55 wl->debugfs.name = debugfs_create_file(#name, 0400, parent, \ 56 56 wl, &name## _ops); \ 57 - if (IS_ERR(wl->debugfs.name)) { \ 58 - ret = PTR_ERR(wl->debugfs.name); \ 59 - wl->debugfs.name = NULL; \ 60 - goto out; \ 61 - } 62 57 63 58 #define DEBUGFS_DEL(name) \ 64 59 do { \ ··· 349 354 DEBUGFS_DEL(excessive_retries); 350 355 } 351 356 352 - static int wl1251_debugfs_add_files(struct wl1251 *wl) 357 + static void wl1251_debugfs_add_files(struct wl1251 *wl) 353 358 { 354 - int ret = 0; 355 - 356 359 DEBUGFS_FWSTATS_ADD(tx, internal_desc_overflow); 357 360 358 361 DEBUGFS_FWSTATS_ADD(rx, out_of_mem); ··· 446 453 DEBUGFS_ADD(tx_queue_status, wl->debugfs.rootdir); 447 454 DEBUGFS_ADD(retry_count, wl->debugfs.rootdir); 448 455 DEBUGFS_ADD(excessive_retries, wl->debugfs.rootdir); 449 - 450 - out: 451 - if (ret < 0) 452 - wl1251_debugfs_delete_files(wl); 453 - 454 - return ret; 455 456 } 456 457 457 458 void wl1251_debugfs_reset(struct wl1251 *wl) ··· 458 471 459 472 int wl1251_debugfs_init(struct wl1251 *wl) 460 473 { 461 - int ret; 474 + wl->stats.fw_stats = kzalloc(sizeof(*wl->stats.fw_stats), GFP_KERNEL); 475 + if (!wl->stats.fw_stats) 476 + return -ENOMEM; 462 477 463 478 wl->debugfs.rootdir = debugfs_create_dir(KBUILD_MODNAME, NULL); 464 - 465 - if (IS_ERR(wl->debugfs.rootdir)) { 466 - ret = PTR_ERR(wl->debugfs.rootdir); 467 - wl->debugfs.rootdir = NULL; 468 - goto err; 469 - } 470 479 471 480 wl->debugfs.fw_statistics = debugfs_create_dir("fw-statistics", 472 481 wl->debugfs.rootdir); 473 482 474 - if (IS_ERR(wl->debugfs.fw_statistics)) { 475 - ret = PTR_ERR(wl->debugfs.fw_statistics); 476 - wl->debugfs.fw_statistics = NULL; 477 - goto err_root; 478 - } 479 - 480 - wl->stats.fw_stats = kzalloc(sizeof(*wl->stats.fw_stats), 481 - GFP_KERNEL); 482 - 483 - if (!wl->stats.fw_stats) { 484 - ret = -ENOMEM; 485 - goto err_fw; 486 - } 487 - 488 483 wl->stats.fw_stats_update = jiffies; 489 484 490 - ret = wl1251_debugfs_add_files(wl); 491 - 492 - if (ret < 0) 493 - goto err_file; 485 + wl1251_debugfs_add_files(wl); 494 486 495 487 return 0; 496 - 497 - err_file: 498 - kfree(wl->stats.fw_stats); 499 - wl->stats.fw_stats = NULL; 500 - 501 - err_fw: 502 - debugfs_remove(wl->debugfs.fw_statistics); 503 - wl->debugfs.fw_statistics = NULL; 504 - 505 - err_root: 506 - debugfs_remove(wl->debugfs.rootdir); 507 - wl->debugfs.rootdir = NULL; 508 - 509 - err: 510 - return ret; 511 488 } 512 489 513 490 void wl1251_debugfs_exit(struct wl1251 *wl)
+1 -19
drivers/net/wireless/ti/wl12xx/debugfs.c
··· 125 125 int wl12xx_debugfs_add_files(struct wl1271 *wl, 126 126 struct dentry *rootdir) 127 127 { 128 - int ret = 0; 129 - struct dentry *entry, *stats, *moddir; 128 + struct dentry *stats, *moddir; 130 129 131 130 moddir = debugfs_create_dir(KBUILD_MODNAME, rootdir); 132 - if (!moddir || IS_ERR(moddir)) { 133 - entry = moddir; 134 - goto err; 135 - } 136 - 137 131 stats = debugfs_create_dir("fw_stats", moddir); 138 - if (!stats || IS_ERR(stats)) { 139 - entry = stats; 140 - goto err; 141 - } 142 132 143 133 DEBUGFS_FWSTATS_ADD(tx, internal_desc_overflow); 144 134 ··· 222 232 DEBUGFS_FWSTATS_ADD(rxpipe, tx_xfr_host_int_trig_rx_data); 223 233 224 234 return 0; 225 - 226 - err: 227 - if (IS_ERR(entry)) 228 - ret = PTR_ERR(entry); 229 - else 230 - ret = -ENOMEM; 231 - 232 - return ret; 233 235 }
+1 -19
drivers/net/wireless/ti/wl18xx/debugfs.c
··· 422 422 int wl18xx_debugfs_add_files(struct wl1271 *wl, 423 423 struct dentry *rootdir) 424 424 { 425 - int ret = 0; 426 - struct dentry *entry, *stats, *moddir; 425 + struct dentry *stats, *moddir; 427 426 428 427 moddir = debugfs_create_dir(KBUILD_MODNAME, rootdir); 429 - if (!moddir || IS_ERR(moddir)) { 430 - entry = moddir; 431 - goto err; 432 - } 433 - 434 428 stats = debugfs_create_dir("fw_stats", moddir); 435 - if (!stats || IS_ERR(stats)) { 436 - entry = stats; 437 - goto err; 438 - } 439 429 440 430 DEBUGFS_ADD(clear_fw_stats, stats); 441 431 ··· 580 590 DEBUGFS_ADD(dynamic_fw_traces, moddir); 581 591 582 592 return 0; 583 - 584 - err: 585 - if (IS_ERR(entry)) 586 - ret = PTR_ERR(entry); 587 - else 588 - ret = -ENOMEM; 589 - 590 - return ret; 591 593 }
+1 -1
drivers/net/wireless/ti/wlcore/cmd.c
··· 1427 1427 ret = wl1271_cmd_send(wl, CMD_SET_KEYS, cmd, sizeof(*cmd), 0); 1428 1428 if (ret < 0) { 1429 1429 wl1271_warning("could not set keys"); 1430 - goto out; 1430 + goto out; 1431 1431 } 1432 1432 1433 1433 out:
+4 -24
drivers/net/wireless/ti/wlcore/debugfs.c
··· 1301 1301 .llseek = default_llseek, 1302 1302 }; 1303 1303 1304 - static int wl1271_debugfs_add_files(struct wl1271 *wl, 1305 - struct dentry *rootdir) 1304 + static void wl1271_debugfs_add_files(struct wl1271 *wl, 1305 + struct dentry *rootdir) 1306 1306 { 1307 - int ret = 0; 1308 - struct dentry *entry, *streaming; 1307 + struct dentry *streaming; 1309 1308 1310 1309 DEBUGFS_ADD(tx_queue_len, rootdir); 1311 1310 DEBUGFS_ADD(retry_count, rootdir); ··· 1329 1330 DEBUGFS_ADD(fw_logger, rootdir); 1330 1331 1331 1332 streaming = debugfs_create_dir("rx_streaming", rootdir); 1332 - if (!streaming || IS_ERR(streaming)) 1333 - goto err; 1334 1333 1335 1334 DEBUGFS_ADD_PREFIX(rx_streaming, interval, streaming); 1336 1335 DEBUGFS_ADD_PREFIX(rx_streaming, always, streaming); 1337 1336 1338 1337 DEBUGFS_ADD_PREFIX(dev, mem, rootdir); 1339 - 1340 - return 0; 1341 - 1342 - err: 1343 - if (IS_ERR(entry)) 1344 - ret = PTR_ERR(entry); 1345 - else 1346 - ret = -ENOMEM; 1347 - 1348 - return ret; 1349 1338 } 1350 1339 1351 1340 void wl1271_debugfs_reset(struct wl1271 *wl) ··· 1354 1367 rootdir = debugfs_create_dir(KBUILD_MODNAME, 1355 1368 wl->hw->wiphy->debugfsdir); 1356 1369 1357 - if (IS_ERR(rootdir)) { 1358 - ret = PTR_ERR(rootdir); 1359 - goto out; 1360 - } 1361 - 1362 1370 wl->stats.fw_stats = kzalloc(wl->stats.fw_stats_len, GFP_KERNEL); 1363 1371 if (!wl->stats.fw_stats) { 1364 1372 ret = -ENOMEM; ··· 1362 1380 1363 1381 wl->stats.fw_stats_update = jiffies; 1364 1382 1365 - ret = wl1271_debugfs_add_files(wl, rootdir); 1366 - if (ret < 0) 1367 - goto out_exit; 1383 + wl1271_debugfs_add_files(wl, rootdir); 1368 1384 1369 1385 ret = wlcore_debugfs_init(wl, rootdir); 1370 1386 if (ret < 0)
+3 -7
drivers/net/wireless/ti/wlcore/debugfs.h
··· 53 53 54 54 #define DEBUGFS_ADD(name, parent) \ 55 55 do { \ 56 - entry = debugfs_create_file(#name, 0400, parent, \ 57 - wl, &name## _ops); \ 58 - if (!entry || IS_ERR(entry)) \ 59 - goto err; \ 56 + debugfs_create_file(#name, 0400, parent, \ 57 + wl, &name## _ops); \ 60 58 } while (0) 61 59 62 60 63 61 #define DEBUGFS_ADD_PREFIX(prefix, name, parent) \ 64 62 do { \ 65 - entry = debugfs_create_file(#name, 0400, parent, \ 63 + debugfs_create_file(#name, 0400, parent, \ 66 64 wl, &prefix## _## name## _ops); \ 67 - if (!entry || IS_ERR(entry)) \ 68 - goto err; \ 69 65 } while (0) 70 66 71 67 #define DEBUGFS_FWSTATS_FILE(sub, name, fmt, struct_type) \
+5 -2
drivers/net/wireless/ti/wlcore/main.c
··· 1085 1085 goto out; 1086 1086 1087 1087 ret = wl12xx_fetch_firmware(wl, plt); 1088 - if (ret < 0) 1089 - goto out; 1088 + if (ret < 0) { 1089 + kfree(wl->fw_status); 1090 + kfree(wl->raw_fw_status); 1091 + kfree(wl->tx_res_if); 1092 + } 1090 1093 1091 1094 out: 1092 1095 return ret;
+3 -8
include/linux/bcma/bcma.h
··· 332 332 struct ssb_sprom *out)); 333 333 334 334 struct bcma_bus { 335 + struct device *dev; 336 + 335 337 /* The MMIO area. */ 336 338 void __iomem *mmio; 337 339 ··· 341 339 342 340 enum bcma_hosttype hosttype; 343 341 bool host_is_pcie2; /* Used for BCMA_HOSTTYPE_PCI only */ 344 - union { 345 - /* Pointer to the PCI bus (only for BCMA_HOSTTYPE_PCI) */ 346 - struct pci_dev *host_pci; 347 - /* Pointer to the SDIO device (only for BCMA_HOSTTYPE_SDIO) */ 348 - struct sdio_func *host_sdio; 349 - /* Pointer to platform device (only for BCMA_HOSTTYPE_SOC) */ 350 - struct platform_device *host_pdev; 351 - }; 342 + struct pci_dev *host_pci; /* PCI bus pointer (BCMA_HOSTTYPE_PCI only) */ 352 343 353 344 struct bcma_chipinfo chipinfo; 354 345