[PATCH 01/13] staging: wilc1000: wilc_msgqueue.c: remove braces for single statement
This patch removes braces for single statement blocks. WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index f047d62..fcf3a29 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -84,9 +84,9 @@ WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle, } else { Message *pstrTailMsg = pHandle->pstrMessageList; - while (pstrTailMsg->pstrNext != NULL) { + while (pstrTailMsg->pstrNext != NULL) pstrTailMsg = pstrTailMsg->pstrNext; - } + pstrTailMsg->pstrNext = pstrMessage; } @@ -98,9 +98,9 @@ WILC_ErrNo WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle, { /* error occured, free any allocations */ if (pstrMessage != NULL) { - if (pstrMessage->pvBuffer != NULL) { + if (pstrMessage->pvBuffer != NULL) kfree(pstrMessage->pvBuffer); - } + kfree(pstrMessage); } } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 02/13] staging: wilc1000: wilc_msgqueue.c: remove blank line after open brace
This patch removes a blank line for open brace "{" CHECK: Blank lines aren't necessary after an open brace '{' Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/wilc_msgqueue.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c index fcf3a29..7718c481 100644 --- a/drivers/staging/wilc1000/wilc_msgqueue.c +++ b/drivers/staging/wilc1000/wilc_msgqueue.c @@ -26,7 +26,6 @@ WILC_ErrNo WILC_MsgQueueCreate(WILC_MsgQueueHandle *pHandle) */ WILC_ErrNo WILC_MsgQueueDestroy(WILC_MsgQueueHandle *pHandle) { - pHandle->bExiting = true; /* Release any waiting receiver thread. */ @@ -120,7 +119,6 @@ WILC_ErrNo WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle, void *pvRecvBuffer, u32 u32RecvBufferSize, u32 *pu32ReceivedLength) { - Message *pstrMessage; WILC_ErrNo s32RetStatus = WILC_SUCCESS; unsigned long flags; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCHv4 0/2] staging: wilc1000: code improvements
Hi, As requested, here are the two remaining ready patches of this patchset. I pulled and rebased against staging-testing just now. They should thus be usable without problem! Thanks, Raphaël Raphaël Beamonte (2): staging: wilc1000: remove FREE_WILC_BUFFER() staging: wilc1000: replace MALLOC_WILC_BUFFER() macro to avoid possible memory leak drivers/staging/wilc1000/wilc_exported_buf.c | 40 +--- 1 file changed, 24 insertions(+), 16 deletions(-) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCHv4 2/2] staging: wilc1000: replace MALLOC_WILC_BUFFER() macro to avoid possible memory leak
The MALLOC_WILC_BUFFER() macro was using a return statement, and didn't take care of possible memory leaks and subsequent bugs when it was failing after succeeding some allocations. This patch corrects this behavior. Signed-off-by: Raphaël Beamonte --- drivers/staging/wilc1000/wilc_exported_buf.c | 31 +++- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_exported_buf.c b/drivers/staging/wilc1000/wilc_exported_buf.c index 44db496..e617b77 100644 --- a/drivers/staging/wilc1000/wilc_exported_buf.c +++ b/drivers/staging/wilc1000/wilc_exported_buf.c @@ -8,13 +8,6 @@ #define LINUX_TX_SIZE (64 * 1024) #define WILC1000_FW_SIZE (4 * 1024) -#define MALLOC_WILC_BUFFER(name, size) \ - exported_ ## name = kmalloc(size, GFP_KERNEL);\ - if (!exported_ ## name) { \ - printk("fail to alloc: %s memory\n", exported_ ## name); \ - return -ENOBUFS;\ - } - /* * Add necessary buffer pointers */ @@ -46,11 +39,29 @@ static int __init wilc_module_init(void) /* * alloc necessary memory */ - MALLOC_WILC_BUFFER(g_tx_buf, LINUX_TX_SIZE) - MALLOC_WILC_BUFFER(g_rx_buf, LINUX_RX_SIZE) - MALLOC_WILC_BUFFER(g_fw_buf, WILC1000_FW_SIZE) + exported_g_tx_buf = kmalloc(LINUX_TX_SIZE, GFP_KERNEL); + if (!exported_g_tx_buf) + return -ENOMEM; + + exported_g_rx_buf = kmalloc(LINUX_RX_SIZE, GFP_KERNEL); + if (!exported_g_rx_buf) + goto free_g_tx_buf; + + exported_g_fw_buf = kmalloc(WILC1000_FW_SIZE, GFP_KERNEL); + if (!exported_g_fw_buf) + goto free_g_rx_buf; return 0; + +free_g_rx_buf: + kfree(exported_g_rx_buf); + exported_g_rx_buf = NULL; + +free_g_tx_buf: + kfree(exported_g_tx_buf); + exported_g_tx_buf = NULL; + + return -ENOMEM; } static void __exit wilc_module_deinit(void) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCHv4 1/2] staging: wilc1000: remove FREE_WILC_BUFFER()
It was just a wrapper around kfree(), so call that instead. Signed-off-by: Raphaël Beamonte --- drivers/staging/wilc1000/wilc_exported_buf.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_exported_buf.c b/drivers/staging/wilc1000/wilc_exported_buf.c index c3f6a0a..44db496 100644 --- a/drivers/staging/wilc1000/wilc_exported_buf.c +++ b/drivers/staging/wilc1000/wilc_exported_buf.c @@ -15,9 +15,6 @@ return -ENOBUFS;\ } -#define FREE_WILC_BUFFER(name) \ - kfree(exported_ ## name); - /* * Add necessary buffer pointers */ @@ -59,9 +56,9 @@ static int __init wilc_module_init(void) static void __exit wilc_module_deinit(void) { printk("wilc_module_deinit\n"); - FREE_WILC_BUFFER(g_tx_buf) - FREE_WILC_BUFFER(g_rx_buf) - FREE_WILC_BUFFER(g_fw_buf) + kfree(exported_g_tx_buf); + kfree(exported_g_rx_buf); + kfree(exported_g_fw_buf); } MODULE_LICENSE("Dual BSD/GPL"); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] staging: wilc1000: Set all options in region debugfs file
On Tue, Aug 18, 2015 at 10:32:17PM +0530, Chandra S Gorentla wrote: > This patch allows setting all options in the module's debug region > options file 'wilc_debug_region'. This functionality allows the user > to enable logging from all regions (initialization, locks, firmware > etc.) of the driver. Logging from the following regions is enabled > during the driver initialization: > > INIT_DBG, GENERIC_DBG, CFG80211_DBG, FIRM_DBG and HOSTAPD_DBG > > Before this change, the numerical value set is equal first byte of > input minus 0x30 (ASCII value of '0'). Because of this, after a write > to this debugfs file, it is difficult to predict the regions on which > logging is enabled. > > The DBG_REGION_ALL now includes 3 additional regions TCP_ENH, SPIN_DEBUG > and FIRM_DBG. Why did you add these extra ones? All of this should eventually just be deleted, as network drivers need to use the networking driver debug interfaces, not their own crazy ones. thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv3] staging: wilc1000: replace MALLOC_WILC_BUFFER() macro to avoid possible memory leak
On Tue, Aug 18, 2015 at 01:06:39PM -0400, Raphaël Beamonte wrote: > 2015-08-18 5:15 GMT-04:00 Dan Carpenter : > > To be honest, I have lost track of this patchset. If you are planning > > to redo the other patches can you send it in a new thread? > > Actually, Greg already included the "return statement" and > "DECLARE_WILC_BUFFER" ones. > The replacement of printk by netdev_* needs more work on my side to > get the net_device to be able to use the netdev_* functions. > And apparently Greg already received another patch with the > "FREE_WILC_BUFFER" replacement, though I don't see it in the > staging-testing tree yet. Maybe it was something else, but it would not apply. Please use git rebase to figure it out and resend all of your outstanding patches, I too am confused at this point. thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv3] staging: wilc1000: use netdev_* instead of printk
On Mon, Aug 17, 2015 at 07:06:40PM -0400, Raphaël Beamonte wrote: > Signed-off-by: Raphaël Beamonte You can't submit a patch with no changelog information, sorry. Always build your patches, otherwise you make maintainers really grumpy as it breaks their build. greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
brcmsmac AP not working with [14e4:4353]
Hello group! Wifi AP's SSID not visible by clients, no hidden network either. When using b43 it works (slowly but that is different issue). Any idea how to fix it? Thanks! Linux fenix 4.1.6-1-ARCH #1 SMP PREEMPT Mon Aug 17 08:52:28 CEST 2015 x86_64 GNU/Linux 03:00.0 Network controller [0280]: Broadcom Corporation BCM43224 802.11a/b/g/n [14e4:4353] (rev 01) Module Size Used by xt_tcpudp 16384 0 ctr16384 2 ccm20480 2 ipt_MASQUERADE 16384 1 nf_nat_masquerade_ipv416384 1 ipt_MASQUERADE iptable_nat16384 1 nf_nat_ipv416384 1 iptable_nat nf_nat 24576 2 nf_nat_ipv4,nf_nat_masquerade_ipv4 nf_log_ipv416384 1 nf_log_common 16384 1 nf_log_ipv4 xt_LOG 16384 1 xt_limit 16384 1 ipt_REJECT 16384 1 nf_reject_ipv4 16384 1 ipt_REJECT nf_conntrack_ipv4 20480 3 nf_defrag_ipv4 16384 1 nf_conntrack_ipv4 xt_conntrack 16384 2 nf_conntrack 90112 5 nf_nat,nf_nat_ipv4,xt_conntrack,nf_nat_masquerade_ipv4,nf_conntrack_ipv4 iptable_filter 16384 1 arc4 16384 2 nls_iso8859_1 16384 0 intel_rapl 20480 0 iosf_mbi 16384 1 intel_rapl brcmsmac 536576 0 nls_cp437 20480 0 vfat 24576 0 fat65536 1 vfat cordic 16384 1 brcmsmac x86_pkg_temp_thermal16384 0 intel_powerclamp 16384 0 brcmutil 16384 1 brcmsmac coretemp 16384 0 snd_hda_codec_hdmi 53248 1 kvm_intel 155648 0 snd_hda_codec_realtek77824 1 led_class 16384 1 brcmsmac snd_hda_codec_generic69632 1 snd_hda_codec_realtek mac80211 667648 1 brcmsmac cfg80211 483328 2 brcmsmac,mac80211 snd_hda_intel 28672 0 snd_hda_controller 28672 1 snd_hda_intel snd_hda_codec 98304 5 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller i915 1044480 1 kvm 442368 1 kvm_intel snd_hda_core 28672 5 snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_codec,snd_hda_controller snd_hwdep 16384 1 snd_hda_codec snd_pcm90112 4 snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_controller rfkill 24576 2 cfg80211 crct10dif_pclmul 16384 0 bcma 49152 1 brcmsmac snd_timer 28672 1 snd_pcm snd69632 8 snd_hda_codec_realtek,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel e1000e221184 0 crc32_pclmul 16384 0 crc32c_intel 24576 0 drm_kms_helper106496 1 i915 evdev 24576 3 mac_hid16384 0 ghash_clmulni_intel16384 0 pcspkr 16384 0 ptp20480 1 e1000e iTCO_wdt 16384 0 iTCO_vendor_support16384 1 iTCO_wdt cryptd 20480 1 ghash_clmulni_intel drm 286720 3 i915,drm_kms_helper pps_core 20480 1 ptp soundcore 16384 1 snd intel_gtt 20480 1 i915 thermal20480 0 battery20480 0 i2c_algo_bit 16384 1 i915 video 24576 1 i915 i2c_i801 20480 0 mei_me 24576 0 i2c_core 49152 5 drm,i915,i2c_i801,drm_kms_helper,i2c_algo_bit button 16384 1 i915 mei77824 1 mei_me shpchp 36864 0 lpc_ich24576 0 processor 28672 0 fan16384 0 sch_fq_codel 20480 7 ip_tables 28672 2 iptable_filter,iptable_nat x_tables 28672 8 ip_tables,xt_tcpudp,ipt_MASQUERADE,xt_limit,xt_conntrack,xt_LOG,iptable_filter,ipt_REJECT ext4 516096 1 crc16 16384 1 ext4 mbcache20480 1 ext4 jbd2 90112 1 ext4 sd_mod 36864 2 ahci 36864 1 libahci28672 1 ahci libata204800 2 ahci,libahci scsi_mod 151552 2 libata,sd_mod ehci_pci 16384 0 xhci_pci 16384 0 ehci_hcd 73728 1 ehci_pci xhci_hcd 155648 1 xhci_pci usbcore 200704 4 ehci_hcd,ehci_pci,xhci_hcd,xhci_pci usb_common 16384 1 usbcore hostapd v2.4 User space daemon for IEEE 802.11 AP management, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator Copyright (c) 2002-2015, Jouni Malinen and contributors $ cat /etc/hostapd/hostapd.conf interface=wlp3s0b1 driver=nl80211 hw_mode=g ieee80211n=1 # N doesn't work with b43 wmm_enabled=1 # QoS channel=7 country_code=CZ
re: mac80211: add rate mask logic for vht rates
Hello Lorenzo Bianconi, The patch b119ad6e726c: "mac80211: add rate mask logic for vht rates" from Aug 6, 2015, leads to the following static checker warning: net/mac80211/cfg.c:2520 ieee80211_set_bitrate_mask() error: buffer overflow 'sdata->rc_rateidx_vht_mcs_mask[i]' 8 <= 9 net/mac80211/cfg.c 2516 for (j = 0; j < IEEE80211_HT_MCS_MASK_LEN; j++) { ^ This is 10. 2517 if (~sdata->rc_rateidx_mcs_mask[i][j]) 2518 sdata->rc_has_mcs_mask[i] = true; 2519 2520 if (~sdata->rc_rateidx_vht_mcs_mask[i][j]) ^^ This only has 8 elements. 2521 sdata->rc_has_vht_mcs_mask[i] = true; 2522 2523 if (sdata->rc_has_mcs_mask[i] && 2524 sdata->rc_has_vht_mcs_mask[i]) 2525 break; Maybe we always break out before we get to the last two iterations? 2526 } regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv3] staging: wilc1000: replace MALLOC_WILC_BUFFER() macro to avoid possible memory leak
2015-08-18 5:15 GMT-04:00 Dan Carpenter : > To be honest, I have lost track of this patchset. If you are planning > to redo the other patches can you send it in a new thread? Actually, Greg already included the "return statement" and "DECLARE_WILC_BUFFER" ones. The replacement of printk by netdev_* needs more work on my side to get the net_device to be able to use the netdev_* functions. And apparently Greg already received another patch with the "FREE_WILC_BUFFER" replacement, though I don't see it in the staging-testing tree yet. So, I think this patch is the last one of this patchset that has to be treated! That's why I rebased it on top of the current staging-testing tree on my last send. Thanks, Raphaël -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] staging: wilc1000: Set all options in region debugfs file
This patch allows setting all options in the module's debug region options file 'wilc_debug_region'. This functionality allows the user to enable logging from all regions (initialization, locks, firmware etc.) of the driver. Logging from the following regions is enabled during the driver initialization: INIT_DBG, GENERIC_DBG, CFG80211_DBG, FIRM_DBG and HOSTAPD_DBG Before this change, the numerical value set is equal first byte of input minus 0x30 (ASCII value of '0'). Because of this, after a write to this debugfs file, it is difficult to predict the regions on which logging is enabled. The DBG_REGION_ALL now includes 3 additional regions TCP_ENH, SPIN_DEBUG and FIRM_DBG. Before this change, the region flag FIRM_DBG is enabled during initialization but cleared after a write to the debugfs file. Signed-off-by: Chandra S Gorentla --- It is verified by code walk that while generating logs for the flags TCP_ENH and SPIN_DEBUG code does not try to print strings that are not terminated by NULL and variables do not try to access invalid memory locations. drivers/staging/wilc1000/wilc_debugfs.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_debugfs.c b/drivers/staging/wilc1000/wilc_debugfs.c index ae11186..70d98ee 100644 --- a/drivers/staging/wilc1000/wilc_debugfs.c +++ b/drivers/staging/wilc1000/wilc_debugfs.c @@ -24,7 +24,10 @@ static struct dentry *wilc_dir; * */ -#define DBG_REGION_ALL (GENERIC_DBG | HOSTAPD_DBG | HOSTINF_DBG | CORECONFIG_DBG | CFG80211_DBG | INT_DBG | TX_DBG | RX_DBG | LOCK_DBG | INIT_DBG | BUS_DBG | MEM_DBG) +#define DBG_REGION_ALL (GENERIC_DBG | HOSTAPD_DBG | HOSTINF_DBG | \ + CORECONFIG_DBG | CFG80211_DBG | INT_DBG | \ + TX_DBG | RX_DBG | LOCK_DBG | INIT_DBG | \ + BUS_DBG | MEM_DBG | TCP_ENH | SPIN_DEBUG | FIRM_DBG) #define DBG_LEVEL_ALL (DEBUG | INFO | WRN | ERR) atomic_t REGION = ATOMIC_INIT(INIT_DBG | GENERIC_DBG | CFG80211_DBG | FIRM_DBG | HOSTAPD_DBG); atomic_t DEBUG_LEVEL = ATOMIC_INIT(ERR); @@ -87,23 +90,20 @@ static ssize_t wilc_debug_region_read(struct file *file, char __user *userbuf, s return simple_read_from_buffer(userbuf, count, ppos, buf, res); } -static ssize_t wilc_debug_region_write(struct file *filp, const char *buf, size_t count, loff_t *ppos) +static ssize_t wilc_debug_region_write(struct file *filp, + const char __user *buf, + size_t count, loff_t *ppos) { - char buffer[128] = {}; int flag; + int ret; - if (count > sizeof(buffer)) - return -EINVAL; - - if (copy_from_user(buffer, buf, count)) { - return -EFAULT; - } - - flag = buffer[0] - '0'; + ret = kstrtouint_from_user(buf, count, 16, &flag); + if (ret) + return ret; if (flag > DBG_REGION_ALL) { printk("%s, value (0x%08x) is out of range, stay previous flag (0x%08x)\n", __func__, flag, atomic_read(®ION)); - return -EFAULT; + return -EINVAL; } atomic_set(®ION, (int)flag); -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: CT ath10k firmware now supports IBSS + RSN
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 08/18/2015 02:38 AM, Sven Eckelmann wrote: > On Monday 17 August 2015 08:33:06 Ben Greear wrote: [...] >>> * IBSS/RSN isn't working between ath10k<->ath10k, ath9k<->ath10k (works >>> well between ath9k<->ath9k) - the ath10k device doesn't seem to send its >>> broadcast frames after the handshake finished (ath9k already tries to >>> transmit bcast frames) - also doesn't work with >>> firmware-2-ct-non-commercial-full-14.bin and nohwcrypt=1 >> >> I believe I had ath10k to ath9k + RSN work, but I did see problems with >> ath10k-ath10k + RSN. > > Yes, this was what I was reading in a different mail and also the reason why > I've tried to get it working for ath9k<->ath10k. But unfortunately, I had no > success. > > I have also tried to use your config without the overrides and with overrides > without any success. I'm not sure if it matters, but I was using sw-crypt for both ath9k and ath10k (and my patched kernel). >> I think sometimes it worked a bit, and then stopped. Truth is, my customers >> interested in IBSS are not doing encryption on the IBSS interface, so I have >> no plans to work on this soon. And, even if offered the opportunity, I'm >> not sure what I could do to improve the problem. Possibly someone at QCA >> would >> have ideas and might share them with me... >> >> >>> * IBSS stops working everytime an AP interface is added to the same PHY (it >>> isn't importing whether it is using WPA/WPA2 or configured as open AP) - >>> tested again with ath9k on the same OpenWrt version and it working quite >>> well with 1x IBSS + 2x AP >> >> One of my customers is using AP + IBSS interface with no obvious problems >> related to concurrency. But, maybe they are doing things in a different >> order. >> Does it work for you if you bring up AP first and then add IBSS? >> >> This is likely fixable. > > I had to hack a little bit of OpenWrt away but it seems that it works for a > simple setup to first create the adhoc interface and then sometimes later add > the AP interface. Ok, I'll make a note to test adding IBSS after AP. Thanks, Ben - -- Ben Greear Candela Technologies Inc http://www.candelatech.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJV01k7AAoJELbHqkYeJT4Ol4kH/A1Vx0S76imRAVwVx9tXMmT5 zwAEa8vh9v5yF/URxaOiOhKgM0B4YB7Lt0hYgwp5zI9b+JEDpdA1Rj1EiaIAMnmb Oj7r2f/LAKF1QHD3tZuPNa4v/L1+DwZ3K+zJ462pY6Yw9nOMvyiCRu/cONFJAY2U dRyw+7tiHJfc11MfxXGNmUR60VyleNqGufZod+Ukh6QnJZHJUw9+xuYMDuugha48 oQ8WrbZIo4nHsg760zfwS6O5QMk3RxDztJnKjpt66uMNPP96zUz2PD38JmBF/H50 re3OHXaW1yGmblYA4AbPtrSyiS5+kaWnI6w6mSHMbhV/e13uL5MZ37Nhzxy81ao= =XKv/ -END PGP SIGNATURE- -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: pull request: iwlwifi-next 2015-08-18
"Grumbach, Emmanuel" writes: > This is another pull request for 4.3. As usual, details in the tag. As > announced, this needs patches > from mac80211-next, so I merged Johanne's tag and you did so as well > upon my request (thank > you for that). > > Please pull and let me know if you have issues. > > The following changes since commit 8f9c98df949333f08b74e5df1caacf7e2c5e8552: > > mac80211: fix BIT position for TDLS WIDE extended cap (2015-08-14 > 17:49:53 +0200) > > are available in the git repository at: > > > https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git > tags/iwlwifi-next-for-kalle-2015-08-18 Thanks, pulled. -- Kalle Valo -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] staging: wilc1000: add a blank line after declaration
This patch adds a blank line after declaration found by checkpatch.pl WARNING: Missing a blank line after declarations. Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/coreconfigurator.c | 8 drivers/staging/wilc1000/linux_wlan.c | 18 ++ drivers/staging/wilc1000/linux_wlan_sdio.c| 1 + drivers/staging/wilc1000/linux_wlan_spi.c | 6 ++ drivers/staging/wilc1000/wilc_msgqueue.c | 3 +++ drivers/staging/wilc1000/wilc_spi.c | 4 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 20 drivers/staging/wilc1000/wilc_wlan.c | 13 + drivers/staging/wilc1000/wilc_wlan_cfg.c | 3 +++ 9 files changed, 76 insertions(+) diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c index 16a0abc..1889195 100644 --- a/drivers/staging/wilc1000/coreconfigurator.c +++ b/drivers/staging/wilc1000/coreconfigurator.c @@ -668,6 +668,7 @@ INLINE u16 get_asoc_id(u8 *data) s32 CoreConfiguratorInit(void) { s32 s32Error = WILC_SUCCESS; + PRINT_D(CORECONFIG_DBG, "CoreConfiguratorInit()\n"); sema_init(&SemHandleSendPkt, 1); @@ -1097,6 +1098,7 @@ void ProcessCharWid(char *pcPacket, s32 *ps32PktLen, u8 *pu8val = (u8 *)ps8WidVal; u8 u8val = 0; s32 s32PktLen = *ps32PktLen; + if (pstrWID == NULL) { PRINT_WRN(CORECONFIG_DBG, "Can't set CHAR val 0x%x ,NULL structure\n", u8val); return; @@ -1151,6 +1153,7 @@ void ProcessShortWid(char *pcPacket, s32 *ps32PktLen, u16 *pu16val = (u16 *)ps8WidVal; u16 u16val = 0; s32 s32PktLen = *ps32PktLen; + if (pstrWID == NULL) { PRINT_WRN(CORECONFIG_DBG, "Can't set SHORT val 0x%x ,NULL structure\n", u16val); return; @@ -1206,6 +1209,7 @@ void ProcessIntWid(char *pcPacket, s32 *ps32PktLen, u32 *pu32val = (u32 *)ps8WidVal; u32 u32val = 0; s32 s32PktLen = *ps32PktLen; + if (pstrWID == NULL) { PRINT_WRN(CORECONFIG_DBG, "Can't set INT val 0x%x , NULL structure\n", u32val); return; @@ -1322,6 +1326,7 @@ void ProcessStrWid(char *pcPacket, s32 *ps32PktLen, u16 u16MsgLen = 0; u16 idx= 0; s32 s32PktLen = *ps32PktLen; + if (pstrWID == NULL) { PRINT_WRN(CORECONFIG_DBG, "Can't set STR val, NULL structure\n"); return; @@ -1540,6 +1545,7 @@ s32 further_process_response(u8 *resp, case WID_SHORT: { u16 *pu16val = (u16 *)(pstrWIDresult->ps8WidVal); + cfg_sht = MAKE_WORD16(resp[idx], resp[idx + 1]); /*Set local copy of WID*/ /* pstrWIDresult->ps8WidVal = (s8*)(s32)cfg_sht; */ @@ -1550,6 +1556,7 @@ s32 further_process_response(u8 *resp, case WID_INT: { u32 *pu32val = (u32 *)(pstrWIDresult->ps8WidVal); + cfg_int = MAKE_WORD32( MAKE_WORD16(resp[idx], resp[idx + 1]), MAKE_WORD16(resp[idx + 2], resp[idx + 3]) @@ -1980,6 +1987,7 @@ s32 SendConfigPkt(u8 u8Mode, tstrWID *pstrWIDs, u32 u32WIDsCount, bool bRespRequired, u32 drvHandler) { s32 counter = 0, ret = 0; + if (gpstrWlanOps == NULL) { PRINT_D(CORECONFIG_DBG, "Net Dev is still not initialized\n"); return 1; diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index b3cc9f5..888652d 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -194,6 +194,7 @@ static char *ps8current = DebugBuffer; void printk_later(const char *format, ...) { va_list args; + va_start(args, format); ps8current += vsprintf(ps8current, format, args); va_end(args); @@ -402,11 +403,13 @@ static irqreturn_t isr_uh_routine(int irq, void *user_data) irqreturn_t isr_bh_routine(int irq, void *userdata) { linux_wlan_t *nic; + nic = (linux_wlan_t *)userdata; #else static void isr_bh_routine(struct work_struct *work) { perInterface_wlan_t *nic; + nic = (perInterface_wlan_t *)container_of(work, linux_wlan_t, rx_work_queue); #endif @@ -531,6 +534,7 @@ static void linux_wlan_msleep(uint32_t msc) { if (msc <= 400) { u32 u32Temp = msc * 1000; + usleep_range(u32Temp, u32Temp); } else { msleep(msc); @@ -549,6 +553,7 @@ static void linux_wlan_dbg(uint8_t *buff) static void *linux_wlan_malloc_atomic(uint32_t sz) { char *pntr = NULL; + pntr = kmalloc(sz, GFP_ATOMIC); PRINT_D(MEM_DBG, "Allocating %d bytes at address %p\n", sz, pntr); return (void *)pntr; @@ -557,6 +562,7 @@ static void *linux_wlan_malloc_atomic(uint32_t sz)
última advertencia
Su buzón ha superado el límite de almacenamiento, es posible que no pueda enviar o recibir correo nuevo hasta que vuelva a validar su buzón. Haga clic en el enlace de abajo para revalidar su cuenta hoy Haga clic aquí: https://qtrial2015az1.az1.qualtrics.com/SE/?SID=SV_9WWgE0hygwRPLAF https://qtrial2015az1.az1.qualtrics.com/SE/?SID=SV_9WWgE0hygwRPLAF ©2015. Webmail Inc. Reservados todos los derechos -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] mac80211: protect non-HT BSS when HT TDLS traffic exists
From: Avri Altman HT TDLS traffic should be protected in a non-HT BSS to avoid collisions. Therefore, when TDLS peers join/leave, check if protection is (now) needed and set the ht_operation_mode of the virtual interface according to the HT capabilities of the TDLS peer(s). This works because a non-HT BSS connection never sets (or otherwise uses) the ht_operation_mode; it just means that drivers must be aware that this field applies to all HT traffic for this virtual interface, not just the traffic within the BSS. Document that. Signed-off-by: Avri Altman Signed-off-by: Johannes Berg --- include/net/mac80211.h | 4 ++- net/mac80211/tdls.c| 70 +++--- 2 files changed, 70 insertions(+), 4 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index d37d6cd..a8f805b 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -478,7 +478,9 @@ struct ieee80211_event { * @chandef: Channel definition for this BSS -- the hardware might be * configured a higher bandwidth than this BSS uses, for example. * @ht_operation_mode: HT operation mode like in &struct ieee80211_ht_operation. - * This field is only valid when the channel type is one of the HT types. + * This field is only valid when the channel is a wide HT/VHT channel. + * Note that with TDLS this can be the case (channel is HT, protection must + * be used from this field) even when the BSS association isn't using HT. * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value * implies disabled * @cqm_rssi_hyst: Connection quality monitor RSSI hysteresis diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index 8d656d3..c9eeb3f 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c @@ -1258,6 +1258,58 @@ static void iee80211_tdls_recalc_chanctx(struct ieee80211_sub_if_data *sdata) mutex_unlock(&local->chanctx_mtx); } +static int iee80211_tdls_have_ht_peers(struct ieee80211_sub_if_data *sdata) +{ + struct sta_info *sta; + bool result = false; + + rcu_read_lock(); + list_for_each_entry_rcu(sta, &sdata->local->sta_list, list) { + if (!sta->sta.tdls || sta->sdata != sdata || !sta->uploaded || + !test_sta_flag(sta, WLAN_STA_AUTHORIZED) || + !test_sta_flag(sta, WLAN_STA_TDLS_PEER_AUTH) || + !sta->sta.ht_cap.ht_supported) + continue; + result = true; + break; + } + rcu_read_unlock(); + + return result; +} + +static void +iee80211_tdls_recalc_ht_protection(struct ieee80211_sub_if_data *sdata, + struct sta_info *sta) +{ + struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; + bool tdls_ht; + u16 protection = IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED | +IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT | +IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT; + u16 opmode; + + /* Nothing to do if the BSS connection uses HT */ + if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HT)) + return; + + tdls_ht = (sta && sta->sta.ht_cap.ht_supported) || + iee80211_tdls_have_ht_peers(sdata); + + opmode = sdata->vif.bss_conf.ht_operation_mode; + + if (tdls_ht) + opmode |= protection; + else + opmode &= ~protection; + + if (opmode == sdata->vif.bss_conf.ht_operation_mode) + return; + + sdata->vif.bss_conf.ht_operation_mode = opmode; + ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_HT); +} + int ieee80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev, const u8 *peer, enum nl80211_tdls_operation oper) { @@ -1283,6 +1335,10 @@ int ieee80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev, return -ENOTSUPP; } + /* protect possible bss_conf changes and avoid concurrency in +* ieee80211_bss_info_change_notify() +*/ + sdata_lock(sdata); mutex_lock(&local->mtx); tdls_dbg(sdata, "TDLS oper %d peer %pM\n", oper, peer); @@ -1296,16 +1352,18 @@ int ieee80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev, iee80211_tdls_recalc_chanctx(sdata); - rcu_read_lock(); + mutex_lock(&local->sta_mtx); sta = sta_info_get(sdata, peer); if (!sta) { - rcu_read_unlock(); + mutex_unlock(&local->sta_mtx); ret = -ENOLINK; break; } + iee80211_tdls_recalc_ht_protection(sdata, sta); + set_sta_flag(sta, WLAN_STA_TDLS_PEER_AUTH); - rcu_read_unlock(); + mutex_unlock(&local->sta_mtx); WARN_ON_ONCE(is_zero_ether_addr(sdata->u.mgd
Re: [PATCH/RFT 1/2] ath10k: add qca6164 support
Michal Kazior writes: > This adds additional 0x0041 PCI Device ID > definition to ath10k for QCA6164 which is a 1 > spatial stream sibling of the QCA6174 (which is 2 > spatial stream chip). > > The QCA6164 needs a dedicated board.bin file which > is different than the one used for QCA6174. If the > board.bin is wrong the device will crash early > while trying to boot firmware. The register dump > will look like this: > > ath10k_pci :02:00.0: firmware register dump: > ath10k_pci :02:00.0: [00]: 0x0501 0x15B3 0x000A012D 0x00955B31 > ... > > Note the value 0x000A012D. > > Special credit goes to Alan Liu > for providing support > help which enabled me to come up with this patch. > > Signed-off-by: Michal Kazior As neither Michal nor me have QCA6174 and I'm reluctant to take untested patches, it would be great if someone could test this and tell us how it went. That way I feel safer to apply this. -- Kalle Valo -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: CT ath10k firmware now supports IBSS + RSN
On Monday 17 August 2015 08:33:06 Ben Greear wrote: [...] > > * IBSS/RSN isn't working between ath10k<->ath10k, ath9k<->ath10k > >(works well between ath9k<->ath9k) > >- the ath10k device doesn't seem to send its broadcast frames > > after the handshake finished (ath9k already tries to transmit > > bcast frames) > >- also doesn't work with firmware-2-ct-non-commercial-full-14.bin > > and nohwcrypt=1 > > I believe I had ath10k to ath9k + RSN work, but I did see problems with > ath10k-ath10k + RSN. Yes, this was what I was reading in a different mail and also the reason why I've tried to get it working for ath9k<->ath10k. But unfortunately, I had no success. I have also tried to use your config without the overrides and with overrides without any success. > I think sometimes it worked a bit, and then stopped. Truth is, my customers > interested in IBSS are not doing encryption on the IBSS interface, so I have > no plans to work on this > soon. And, even if offered the opportunity, I'm not sure what I could do to > improve the problem. Possibly someone at QCA would have ideas and might share > them with me... > > > > * IBSS stops working everytime an AP interface is added to the same > >PHY (it isn't importing whether it is using WPA/WPA2 or configured > >as open AP) > >- tested again with ath9k on the same OpenWrt version and it > > working quite well with 1x IBSS + 2x AP > > One of my customers is using AP + IBSS interface with no obvious problems > related to concurrency. But, maybe they are doing things in a different > order. Does it work for you if you bring up AP first and then add IBSS? > > This is likely fixable. I had to hack a little bit of OpenWrt away but it seems that it works for a simple setup to first create the adhoc interface and then sometimes later add the AP interface. [...] Thanks for your feedback. Kind regards, Sven signature.asc Description: This is a digitally signed message part.
Re: [PATCHv3] staging: wilc1000: replace MALLOC_WILC_BUFFER() macro to avoid possible memory leak
To be honest, I have lost track of this patchset. If you are planning to redo the other patches can you send it in a new thread? regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 5/5] staging: wilc1000: use id value as argument
On Tue, Aug 18, 2015 at 12:10:53PM +0900, Johnny Kim wrote: > Hello Dan. > > On 2015년 08월 13일 23:49, Dan Carpenter wrote: > >On Thu, Aug 13, 2015 at 01:41:23PM +0900, Tony Cho wrote: > >>+static u32 get_id_from_handler(tstrWILC_WFIDrv *handler) > >>+{ > >>+ u32 id; > >>+ > >>+ if (!handler) > >>+ return 0; > >>+ > >>+ for (id = 0; id < NUM_CONCURRENT_IFC; id++) { > >>+ if (wfidrv_list[id] == handler) { > >>+ id += 1; > >>+ break; > >>+ } > >>+ } > >>+ > >>+ if (id > NUM_CONCURRENT_IFC) > >>+ return 0; > >>+ else > >>+ return id; > >>+} > >>+ > >This still has an off by one bug. Just use zero offset arrays > >throughout. > > > >static int get_id_from_handler(tstrWILC_WFIDrv *handler) > >{ > > int id; > > > > if (!handler) > > return -ENOBUFS; > > > > for (id = 0; id < NUM_CONCURRENT_IFC; id++) { > > if (wfidrv_list[id] == handler) > > return id; > > } > > > > return -ENOBUFS; > >} > Thanks for your review. The return value of this function has from 0 till 2. > 1 and 2 value is real ID value. only 0 value is reserved to remove a > registered id. > But I also think that error handling should be added about the > overflowed value > as your opinion. I thought we had created "id" here in this patch so we don't have to pass function pointers through a u32 value (which can't fit a 64 bit pointer). What do you mean it is a "real ID value"? Is it there in the hardware spec? Anyway, this code is buggy and messy. Please find a different way to write it. regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 20/26] iwlwifi: mvm: support TDLS wider-bandwidth
From: Arik Nemtsov When TDLS support is declared by the FW, set the bit indicating wider-BW support as well. Signed-off-by: Arik Nemtsov Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index 08dd674..537a157 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c @@ -641,6 +641,7 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) IWL_UCODE_TLV_CAPA_TDLS_SUPPORT)) { IWL_DEBUG_TDLS(mvm, "TDLS supported\n"); hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS; + ieee80211_hw_set(hw, TDLS_WIDER_BW); } if (fw_has_capa(&mvm->fw->ucode_capa, -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 10/26] iwlwifi: mvm: Add FW paging mechanism for the UMAC on SDIO
From: Matti Gottlieb Family 8000 products has 2 embedded processors, the first known as LMAC (lower MAC) and implements the functionality from previous products, the second one is known as UMAC (upper MAC) and is used mainly for driver offloads as well as new features. The UMAC is typically “less” real-time than the LMAC and is used for higher level controls. The UMAC's code/data size is estimated to be in the mega-byte arena, taking into account the code it needs to replace in the driver and the set of new features. In order to allow the UMAC to execute code that is bigger than its code memory, we allow the UMAC embedded processor to page out code pages on DRAM. When the device is slave on the bus(SDIO) the driver saves the UMAC's image pages in blocks of 32K in the DRAM and sends the layout of the pages to the FW. When the FW wants load / unload pages, it creates an interrupt, and the driver uploads / downloads the page to an address in the a specific address on the device's memory. The driver can support up to 1 MB of pages. Add paging mechanism for the UMAC on SDIO in order to allow the program to use a larger virtual space while using less physical memory on the device itself. Signed-off-by: Matti Gottlieb Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/iwl-csr.h| 2 + drivers/net/wireless/iwlwifi/iwl-fw.h | 3 ++ drivers/net/wireless/iwlwifi/iwl-prph.h | 6 +++ drivers/net/wireless/iwlwifi/iwl-trans.h | 14 ++ drivers/net/wireless/iwlwifi/mvm/fw-api.h | 26 +++ drivers/net/wireless/iwlwifi/mvm/fw.c | 76 +++ drivers/net/wireless/iwlwifi/mvm/ops.c| 1 + 7 files changed, 128 insertions(+) diff --git a/drivers/net/wireless/iwlwifi/iwl-csr.h b/drivers/net/wireless/iwlwifi/iwl-csr.h index fa71661..543abea 100644 --- a/drivers/net/wireless/iwlwifi/iwl-csr.h +++ b/drivers/net/wireless/iwlwifi/iwl-csr.h @@ -200,6 +200,7 @@ #define CSR_INT_BIT_FH_TX(1 << 27) /* Tx DMA FH_INT[1:0] */ #define CSR_INT_BIT_SCD (1 << 26) /* TXQ pointer advanced */ #define CSR_INT_BIT_SW_ERR (1 << 25) /* uCode error */ +#define CSR_INT_BIT_PAGING (1 << 24) /* SDIO PAGING */ #define CSR_INT_BIT_RF_KILL (1 << 7) /* HW RFKILL switch GP_CNTRL[27] toggled */ #define CSR_INT_BIT_CT_KILL (1 << 6) /* Critical temp (chip too hot) rfkill */ #define CSR_INT_BIT_SW_RX(1 << 3) /* Rx, command responses */ @@ -210,6 +211,7 @@ CSR_INT_BIT_HW_ERR | \ CSR_INT_BIT_FH_TX | \ CSR_INT_BIT_SW_ERR | \ +CSR_INT_BIT_PAGING | \ CSR_INT_BIT_RF_KILL | \ CSR_INT_BIT_SW_RX | \ CSR_INT_BIT_WAKEUP | \ diff --git a/drivers/net/wireless/iwlwifi/iwl-fw.h b/drivers/net/wireless/iwlwifi/iwl-fw.h index 0d9d6f5..45e7321 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fw.h +++ b/drivers/net/wireless/iwlwifi/iwl-fw.h @@ -163,6 +163,9 @@ struct iwl_sf_region { /* maximum image size 1024KB */ #define MAX_PAGING_IMAGE_SIZE (NUM_OF_BLOCK_PER_IMAGE * PAGING_BLOCK_SIZE) +/* Virtual address signature */ +#define PAGING_ADDR_SIG 0xAA00 + #define PAGING_CMD_IS_SECURED BIT(9) #define PAGING_CMD_IS_ENABLED BIT(8) #define PAGING_CMD_NUM_OF_PAGES_IN_LAST_GRP_POS0 diff --git a/drivers/net/wireless/iwlwifi/iwl-prph.h b/drivers/net/wireless/iwlwifi/iwl-prph.h index c4e7a71..3ab777f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-prph.h +++ b/drivers/net/wireless/iwlwifi/iwl-prph.h @@ -392,4 +392,10 @@ enum { LMPM_CHICK_EXTENDED_ADDR_SPACE = BIT(0), }; +/* FW chicken bits */ +#define LMPM_PAGE_PASS_NOTIF 0xA03824 +enum { + LMPM_PAGE_PASS_NOTIF_POS = BIT(20), +}; + #endif /* __iwl_prph_h__ */ diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 151e3de..9d8b5cb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h @@ -668,6 +668,12 @@ enum iwl_d0i3_mode { * @dbg_conf_tlv: array of pointers to configuration TLVs for debug * @dbg_trigger_tlv: array of pointers to triggers TLVs for debug * @dbg_dest_reg_num: num of reg_ops in %dbg_dest_tlv + * @paging_req_addr: The location were the FW will upload / download the pages + * from. The address is set by the opmode + * @paging_db: Pointer to the opmode paging data base, the pointer is set by + * the opmode. + * @paging_download_buf: Buffer used for copying all of the pages before + * downloading them to the FW. The buffer is allocated in the opmode */ struct iwl_trans { const struct iwl_trans_ops *ops; @@ -705,6 +711,14 @@ struct iwl_trans { struct iwl_fw_dbg_trigger_tlv * const *dbg_trigger_tlv; u8 dbg_dest_reg_num; + /* +* Pagin
[PATCH 22/26] iwlwifi: rs: disable MIMO only if allowed in configuration
From: Alexander Bondar Fix bug where MIMO is disabled for low latency TX on P2P VIF regardless of configuration. Make it dependent on IWL_MVM_RS_DISABLE_P2P_MIMO compilation option. Change configuration so that MIMO will be disabled only in SDIO platforms. Signed-off-by: Alexander Bondar Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/mvm/rs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/iwlwifi/mvm/rs.c b/drivers/net/wireless/iwlwifi/mvm/rs.c index 19a7926..5ae9c8a 100644 --- a/drivers/net/wireless/iwlwifi/mvm/rs.c +++ b/drivers/net/wireless/iwlwifi/mvm/rs.c @@ -177,7 +177,8 @@ static bool rs_mimo_allow(struct iwl_mvm *mvm, struct ieee80211_sta *sta, mvmsta = iwl_mvm_sta_from_mac80211(sta); mvmvif = iwl_mvm_vif_from_mac80211(mvmsta->vif); - if (iwl_mvm_vif_low_latency(mvmvif) && mvmsta->vif->p2p) + if (IWL_MVM_RS_DISABLE_P2P_MIMO && + iwl_mvm_vif_low_latency(mvmvif) && mvmsta->vif->p2p) return false; if (mvm->nvm_data->sku_cap_mimo_disabled) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 11/26] iwlwifi: mvm: ToF - Set correct range request cmd id
From: Assaf Krauss Command ID of ToF range request command adapted to new FW commands grouping scheme. Signed-off-by: Assaf Krauss Reviewed-by: Gregory Greenman Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/mvm/tof.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/iwlwifi/mvm/tof.c b/drivers/net/wireless/iwlwifi/mvm/tof.c index d060e12..380972f 100644 --- a/drivers/net/wireless/iwlwifi/mvm/tof.c +++ b/drivers/net/wireless/iwlwifi/mvm/tof.c @@ -194,7 +194,7 @@ int iwl_mvm_tof_range_request_cmd(struct iwl_mvm *mvm, struct ieee80211_vif *vif) { struct iwl_host_cmd cmd = { - .id = TOF_CMD, + .id = iwl_cmd_id(TOF_CMD, IWL_ALWAYS_LONG_GROUP, 0), .len = { sizeof(mvm->tof_data.range_req), }, /* no copy because of the command size */ .dataflags = { IWL_HCMD_DFL_NOCOPY, }, -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 09/26] iwlwifi: pcie: New RBD allocation model
From: Sara Sharon As a preperation for multiple RX queues change the RBD allocation model. The new model includes a background allocator. The allocator is called by the interrupt handler when there are two released buffers by the queue, and the allocator starts allocating eight pages per request. When the queue has released 8 pages it tries claiming the request. If the pages are not ready - it keeps claiming. This new model should make sure that RBDs are always available across the multiple queues. The RBDs are transferred between the allocator and the queue. The queue moves the free RBDs upon freeing them to the allocator. The allocator moves them back to the queue's possession when the request is claimed. The allocator has an initial pool to make sure there are always RBDs available for the request completion. Release of the buffers at exit is done per pools - the allocator frees its own initial pool and the queue frees its own pool. Existing code refactor - -Queue's initial pool is the size of the queue only as the allocation of the new buffers no longer uses this pool. -Removal of replenish background work, and replenish calls in the interrupt handler and restock(). -The replenish() and the rxq used_list are used only during initialization. -Moved page allocation to a new function for code reuse. New code - Allocator code - new structure and functions. Interrupt handler uses the allocator functions for replenishing buffers. Reuse of the restock() method. Signed-off-by: Sara Sharon Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/iwl-fh.h| 6 - drivers/net/wireless/iwlwifi/pcie/internal.h | 51 ++- drivers/net/wireless/iwlwifi/pcie/rx.c | 473 ++- 3 files changed, 435 insertions(+), 95 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-fh.h b/drivers/net/wireless/iwlwifi/iwl-fh.h index d45dc02..d560648 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fh.h +++ b/drivers/net/wireless/iwlwifi/iwl-fh.h @@ -438,12 +438,6 @@ static inline unsigned int FH_MEM_CBBC_QUEUE(unsigned int chnl) #define RX_QUEUE_MASK 255 #define RX_QUEUE_SIZE_LOG 8 -/* - * RX related structures and functions - */ -#define RX_FREE_BUFFERS 64 -#define RX_LOW_WATERMARK 8 - /** * struct iwl_rb_status - reserve buffer status * host memory mapped FH registers diff --git a/drivers/net/wireless/iwlwifi/pcie/internal.h b/drivers/net/wireless/iwlwifi/pcie/internal.h index 2de3d9a..feb2f7e 100644 --- a/drivers/net/wireless/iwlwifi/pcie/internal.h +++ b/drivers/net/wireless/iwlwifi/pcie/internal.h @@ -50,6 +50,15 @@ */ #define IWL_PCIE_MAX_FRAGS (IWL_NUM_OF_TBS - 3) +/* + * RX related structures and functions + */ +#define RX_NUM_QUEUES 1 +#define RX_POST_REQ_ALLOC 2 +#define RX_CLAIM_REQ_ALLOC 8 +#define RX_POOL_SIZE ((RX_CLAIM_REQ_ALLOC - RX_POST_REQ_ALLOC) * RX_NUM_QUEUES) +#define RX_LOW_WATERMARK 8 + struct iwl_host_cmd; /*This file includes the declaration that are internal to the @@ -83,29 +92,29 @@ struct isr_statistics { * struct iwl_rxq - Rx queue * @bd: driver's pointer to buffer of receive buffer descriptors (rbd) * @bd_dma: bus address of buffer of receive buffer descriptors (rbd) - * @pool: - * @queue: * @read: Shared index to newest available Rx buffer * @write: Shared index to oldest written Rx packet * @free_count: Number of pre-allocated buffers in rx_free + * @used_count: Number of RBDs handled to allocator to use for allocation * @write_actual: - * @rx_free: list of free SKBs for use - * @rx_used: List of Rx buffers with no SKB + * @rx_free: list of RBDs with allocated RB ready for use + * @rx_used: list of RBDs with no RB attached * @need_update: flag to indicate we need to update read/write index * @rb_stts: driver's pointer to receive buffer status * @rb_stts_dma: bus address of receive buffer status * @lock: + * @pool: initial pool of iwl_rx_mem_buffer for the queue + * @queue: actual rx queue * * NOTE: rx_free and rx_used are used as a FIFO for iwl_rx_mem_buffers */ struct iwl_rxq { __le32 *bd; dma_addr_t bd_dma; - struct iwl_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS]; - struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE]; u32 read; u32 write; u32 free_count; + u32 used_count; u32 write_actual; struct list_head rx_free; struct list_head rx_used; @@ -113,6 +122,32 @@ struct iwl_rxq { struct iwl_rb_status *rb_stts; dma_addr_t rb_stts_dma; spinlock_t lock; + struct iwl_rx_mem_buffer pool[RX_QUEUE_SIZE]; + struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE]; +}; + +/** + * struct iwl_rb_allocator - Rx allocator + * @pool: initial pool of allocator + * @req_pending: number of requests the allcator had not processed yet + * @req_ready: number of requests honored and ready for claiming + * @rbd_allocated: RBDs with pages allocated and ready to
[PATCH 07/26] iwlwifi: pcie: support frag SKBs
From: Johannes Berg Allow frag SKBs in PCIe and advertise the maximum number of frags to the opmode. As a fallback. linearize the SKB if it exceeds the maximum number of fragments. This allows using the hardware better (filling more TBs) and should improve performance when used by the opmode. Also adjust tracing to be able to deal with this. Signed-off-by: Johannes Berg Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/iwl-devtrace-data.h | 7 ++- drivers/net/wireless/iwlwifi/iwl-trans.h | 7 +++ drivers/net/wireless/iwlwifi/pcie/internal.h | 6 ++ drivers/net/wireless/iwlwifi/pcie/trans.c| 2 + drivers/net/wireless/iwlwifi/pcie/tx.c | 70 5 files changed, 77 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace-data.h b/drivers/net/wireless/iwlwifi/iwl-devtrace-data.h index 04e6649..71a78ce 100644 --- a/drivers/net/wireless/iwlwifi/iwl-devtrace-data.h +++ b/drivers/net/wireless/iwlwifi/iwl-devtrace-data.h @@ -35,8 +35,8 @@ TRACE_EVENT(iwlwifi_dev_tx_data, TP_PROTO(const struct device *dev, struct sk_buff *skb, -void *data, size_t data_len), - TP_ARGS(dev, skb, data, data_len), +u8 hdr_len, size_t data_len), + TP_ARGS(dev, skb, hdr_len, data_len), TP_STRUCT__entry( DEV_ENTRY @@ -45,7 +45,8 @@ TRACE_EVENT(iwlwifi_dev_tx_data, TP_fast_assign( DEV_ASSIGN; if (iwl_trace_data(skb)) - memcpy(__get_dynamic_array(data), data, data_len); + skb_copy_bits(skb, hdr_len, + __get_dynamic_array(data), data_len); ), TP_printk("[%s] TX frame data", __get_str(dev)) ); diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 2f79e54..e68497a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h @@ -248,6 +248,8 @@ static inline u32 iwl_rx_packet_payload_len(const struct iwl_rx_packet *pkt) * @CMD_MAKE_TRANS_IDLE: The command response should mark the trans as idle. * @CMD_WAKE_UP_TRANS: The command response should wake up the trans * (i.e. mark it as non-idle). + * @CMD_TB_BITMAP_POS: Position of the first bit for the TB bitmap. We need to + * check that we leave enough room for the TBs bitmap which needs 20 bits. */ enum CMD_MODE { CMD_ASYNC = BIT(0), @@ -257,6 +259,8 @@ enum CMD_MODE { CMD_SEND_IN_IDLE= BIT(4), CMD_MAKE_TRANS_IDLE = BIT(5), CMD_WAKE_UP_TRANS = BIT(6), + + CMD_TB_BITMAP_POS = 11, }; #define DEF_CMD_PAYLOAD_SIZE 320 @@ -641,6 +645,8 @@ enum iwl_d0i3_mode { * @cfg - pointer to the configuration * @status: a bit-mask of transport status flags * @dev - pointer to struct device * that represents the device + * @max_skb_frags: maximum number of fragments an SKB can have when transmitted. + * 0 indicates that frag SKBs (NETIF_F_SG) aren't supported. * @hw_id: a u32 with the ID of the device / sub-device. * Set during transport allocation. * @hw_id_str: a string with info about HW ID. Set during transport allocation. @@ -669,6 +675,7 @@ struct iwl_trans { unsigned long status; struct device *dev; + u32 max_skb_frags; u32 hw_rev; u32 hw_id; char hw_id_str[52]; diff --git a/drivers/net/wireless/iwlwifi/pcie/internal.h b/drivers/net/wireless/iwlwifi/pcie/internal.h index 17f65dc..feb2f7e 100644 --- a/drivers/net/wireless/iwlwifi/pcie/internal.h +++ b/drivers/net/wireless/iwlwifi/pcie/internal.h @@ -44,6 +44,12 @@ #include "iwl-io.h" #include "iwl-op-mode.h" +/* We need 2 entries for the TX command and header, and another one might + * be needed for potential data in the SKB's head. The remaining ones can + * be used for frags. + */ +#define IWL_PCIE_MAX_FRAGS (IWL_NUM_OF_TBS - 3) + /* * RX related structures and functions */ diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index 9ebdd80..fb55810 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c @@ -2627,6 +2627,8 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, if (!trans) return ERR_PTR(-ENOMEM); + trans->max_skb_frags = IWL_PCIE_MAX_FRAGS; + trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); trans_pcie->trans = trans; diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c index 601eee1..b7d1268 100644 --- a/drivers/net/wireless/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/iwlwifi/pcie/tx.c @@ -388,11 +388,18 @@ static void iwl_pcie_tfd_unmap(struct iwl_trans *trans, /* first TB is never freed - it's the scratchbuf data */ - for (i = 1; i < n
[PATCH 14/26] iwlwifi: mvm: simplify calculating scan dwells and other timing values
From: David Spinadel Remove timing values from iwl_mvm_scan_params and use defines and arrays of values instead. While at that fix few values and corner cases and align all OSs to ChromeOS values. Signed-off-by: David Spinadel Reviewed-by: Luciano Coelho Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/mvm/scan.c | 169 +--- 1 file changed, 88 insertions(+), 81 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c index e0c0dd7..308a60e 100644 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c @@ -72,10 +72,60 @@ #define IWL_DENSE_EBS_SCAN_RATIO 5 #define IWL_SPARSE_EBS_SCAN_RATIO 1 -struct iwl_mvm_scan_params { - u32 max_out_time; +enum iwl_mvm_scan_type { + IWL_SCAN_TYPE_UNASSOC, + IWL_SCAN_TYPE_WILD, + IWL_SCAN_TYPE_MILD, + IWL_SCAN_TYPE_FRAGMENTED, +}; + +enum iwl_mvm_traffic_load { + IWL_MVM_TRAFFIC_LOW, + IWL_MVM_TRAFFIC_MEDIUM, + IWL_MVM_TRAFFIC_HIGH, +}; + +struct iwl_mvm_scan_timing_params { + u32 dwell_active; + u32 dwell_passive; + u32 dwell_fragmented; u32 suspend_time; - bool passive_fragmented; + u32 max_out_time; +}; + +static struct iwl_mvm_scan_timing_params scan_timing[] = { + [IWL_SCAN_TYPE_UNASSOC] = { + .dwell_active = 10, + .dwell_passive = 110, + .dwell_fragmented = 44, + .suspend_time = 0, + .max_out_time = 0, + }, + [IWL_SCAN_TYPE_WILD] = { + .dwell_active = 10, + .dwell_passive = 110, + .dwell_fragmented = 44, + .suspend_time = 30, + .max_out_time = 120, + }, + [IWL_SCAN_TYPE_MILD] = { + .dwell_active = 10, + .dwell_passive = 110, + .dwell_fragmented = 44, + .suspend_time = 120, + .max_out_time = 120, + }, + [IWL_SCAN_TYPE_FRAGMENTED] = { + .dwell_active = 10, + .dwell_passive = 110, + .dwell_fragmented = 44, + .suspend_time = 95, + .max_out_time = 44, + }, +}; + +struct iwl_mvm_scan_params { + enum iwl_mvm_scan_type type; u32 n_channels; u16 delay; int n_ssids; @@ -90,9 +140,6 @@ struct iwl_mvm_scan_params { int n_match_sets; struct iwl_scan_probe_req preq; struct cfg80211_match_set *match_sets; - u16 passive_dwell; - u16 active_dwell; - u16 fragmented_dwell; struct { u8 iterations; u8 full_scan_mul; /* not used for UMAC */ @@ -156,76 +203,39 @@ static void iwl_mvm_scan_condition_iterator(void *data, u8 *mac, *global_cnt += 1; } -static void iwl_mvm_scan_calc_dwell(struct iwl_mvm *mvm, - struct ieee80211_vif *vif, - struct iwl_mvm_scan_params *params) +static enum iwl_mvm_traffic_load iwl_mvm_get_traffic_load(struct iwl_mvm *mvm) +{ + return IWL_MVM_TRAFFIC_LOW; +} + +static enum +iwl_mvm_scan_type iwl_mvm_get_scan_type(struct iwl_mvm *mvm, + struct ieee80211_vif *vif, + struct iwl_mvm_scan_params *params) { int global_cnt = 0; - u8 frag_passive_dwell = 0; + enum iwl_mvm_traffic_load load; + bool low_latency; ieee80211_iterate_active_interfaces_atomic(mvm->hw, IEEE80211_IFACE_ITER_NORMAL, iwl_mvm_scan_condition_iterator, &global_cnt); if (!global_cnt) - goto not_bound; - - params->suspend_time = 30; - params->max_out_time = 120; - - if (iwl_mvm_low_latency(mvm)) { - if (fw_has_api(&mvm->fw->ucode_capa, - IWL_UCODE_TLV_API_FRAGMENTED_SCAN)) { - - params->suspend_time = 105; - /* -* If there is more than one active interface make -* passive scan more fragmented. -*/ - frag_passive_dwell = 40; - params->max_out_time = frag_passive_dwell; - } else { - params->suspend_time = 120; - params->max_out_time = 120; - } - } - - if (frag_passive_dwell && - fw_has_api(&mvm->fw->ucode_capa, - IWL_UCODE_TLV_API_FRAGMENTED_SCAN)) { - /* -* P2P device scan should not be fragmented to avoid negative -* impact on P2P device discovery. Configure max_out_time to be -* equal to dwell time on
[PATCH 01/26] iwlwifi: mvm: Add FW paging mechanism for the UMAC on PCI
From: Matti Gottlieb Family 8000 products has 2 embedded processors, the first known as LMAC (lower MAC) and implements the functionality from previous products, the second one is known as UMAC (upper MAC) and is used mainly for driver offloads as well as new features. The UMAC is typically “less” real-time than the LMAC and is used for higher level controls. The UMAC's code/data size is estimated to be in the mega-byte arena, taking into account the code it needs to replace in the driver and the set of new features. In order to allow the UMAC to execute code that is bigger than its code memory, we allow the UMAC embedded processor to page out code pages on DRAM. When the device is master on the bus(PCI) the driver saves the UMAC's image pages in blocks of 32K in the DRAM and sends the layout of the pages to the FW. The FW can load / unload the pages on its own. The driver can support up to 1 MB of pages. Add paging mechanism for the UMAC on PCI in order to allow the program to use a larger virtual space while using less physical memory on the device. Signed-off-by: Eran Harary Signed-off-by: Matti Gottlieb Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/iwl-drv.c | 32 +++- drivers/net/wireless/iwlwifi/iwl-fw-file.h | 4 +- drivers/net/wireless/iwlwifi/iwl-fw.h | 40 + drivers/net/wireless/iwlwifi/mvm/fw-api.h | 24 +++ drivers/net/wireless/iwlwifi/mvm/fw.c | 258 + drivers/net/wireless/iwlwifi/mvm/mvm.h | 5 + drivers/net/wireless/iwlwifi/mvm/ops.c | 1 + drivers/net/wireless/iwlwifi/pcie/trans.c | 18 +- 8 files changed, 378 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c index 6685259..721d3cb 100644 --- a/drivers/net/wireless/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/iwlwifi/iwl-drv.c @@ -573,10 +573,11 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv, size_t len = ucode_raw->size; const u8 *data; u32 tlv_len; + u32 usniffer_img; enum iwl_ucode_tlv_type tlv_type; const u8 *tlv_data; char buildstr[25]; - u32 build; + u32 build, paging_mem_size; int num_of_cpus; bool usniffer_images = false; bool usniffer_req = false; @@ -955,6 +956,35 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv, IWL_UCODE_REGULAR_USNIFFER, tlv_len); break; + case IWL_UCODE_TLV_PAGING: + if (tlv_len != sizeof(u32)) + goto invalid_tlv_len; + paging_mem_size = le32_to_cpup((__le32 *)tlv_data); + + IWL_DEBUG_FW(drv, +"Paging: paging enabled (size = %u bytes)\n", +paging_mem_size); + + if (paging_mem_size > MAX_PAGING_IMAGE_SIZE) { + IWL_ERR(drv, + "Paging: driver supports up to %lu bytes for paging image\n", + MAX_PAGING_IMAGE_SIZE); + return -EINVAL; + } + + if (paging_mem_size & (FW_PAGING_SIZE - 1)) { + IWL_ERR(drv, + "Paging: image isn't multiple %lu\n", + FW_PAGING_SIZE); + return -EINVAL; + } + + drv->fw.img[IWL_UCODE_REGULAR].paging_mem_size = + paging_mem_size; + usniffer_img = IWL_UCODE_REGULAR_USNIFFER; + drv->fw.img[usniffer_img].paging_mem_size = + paging_mem_size; + break; case IWL_UCODE_TLV_SDIO_ADMA_ADDR: if (tlv_len != sizeof(u32)) goto invalid_tlv_len; diff --git a/drivers/net/wireless/iwlwifi/iwl-fw-file.h b/drivers/net/wireless/iwlwifi/iwl-fw-file.h index 926e456..5d7f2d9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fw-file.h +++ b/drivers/net/wireless/iwlwifi/iwl-fw-file.h @@ -132,6 +132,7 @@ enum iwl_ucode_tlv_type { IWL_UCODE_TLV_API_CHANGES_SET = 29, IWL_UCODE_TLV_ENABLED_CAPABILITIES = 30, IWL_UCODE_TLV_N_SCAN_CHANNELS = 31, + IWL_UCODE_TLV_PAGING= 32, IWL_UCODE_TLV_SEC_RT_USNIFFER = 34, IWL_UCODE_TLV_SDIO_ADMA_ADDR= 35, IWL_UCODE_TLV_FW_VERSION= 36, @@ -343,8 +344,9 @@ enum iwl_ucode_tlv_capa { * For 16.0 uCode and above, there is no differentiation between sections, * just an offset to the HW address. */ -#define IWL_UCODE_SECTION_MAX 12 +#define IWL_UCODE_SECTION_MAX 16
[PATCH 24/26] iwlwifi: out-of-bounds access in iwl_init_sband_channels
From: Adrien Schildknecht KASan error report: == BUG: KASan: out of bounds access in iwl_init_sband_channels+0x207/0x260 [iwlwifi] at addr 8800c2d0aac8 Read of size 4 by task modprobe/329 == Both loops of this function compare data from the 'chan' array and then check if the index is valid. The 2 conditions should be inverted to avoid an out-of-bounds access. Signed-off-by: Adrien Schildknecht Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c b/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c index 21302b6..acc3d18 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c @@ -713,12 +713,12 @@ int iwl_init_sband_channels(struct iwl_nvm_data *data, struct ieee80211_channel *chan = &data->channels[0]; int n = 0, idx = 0; - while (chan->band != band && idx < n_channels) + while (idx < n_channels && chan->band != band) chan = &data->channels[++idx]; sband->channels = &data->channels[idx]; - while (chan->band == band && idx < n_channels) { + while (idx < n_channels && chan->band == band) { chan = &data->channels[++idx]; n++; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 25/26] iwlwifi: mvm: don't disconnect on beacon loss in D0I3
From: David Spinadel Currently if we wake up during D0I3 due to beacon loss we disconnect immediately. This behaviour causes redundant disconnection, which could be prevented by polling as it is usually done in mac80211. Instead, we prefer reporting beacon loss and let mac80211 try polling before disconnection. Signed-off-by: David Spinadel Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/mvm/ops.c | 37 -- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/mvm/ops.c b/drivers/net/wireless/iwlwifi/mvm/ops.c index c15c994..02ce184 100644 --- a/drivers/net/wireless/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/iwlwifi/mvm/ops.c @@ -1170,15 +1170,25 @@ static void iwl_mvm_exit_d0i3_iterator(void *_data, u8 *mac, iwl_mvm_update_d0i3_power_mode(mvm, vif, false, flags); } -static void iwl_mvm_d0i3_disconnect_iter(void *data, u8 *mac, -struct ieee80211_vif *vif) +struct iwl_mvm_wakeup_reason_iter_data { + struct iwl_mvm *mvm; + u32 wakeup_reasons; +}; + +static void iwl_mvm_d0i3_wakeup_reason_iter(void *_data, u8 *mac, + struct ieee80211_vif *vif) { - struct iwl_mvm *mvm = data; + struct iwl_mvm_wakeup_reason_iter_data *data = _data; struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); if (vif->type == NL80211_IFTYPE_STATION && vif->bss_conf.assoc && - mvm->d0i3_ap_sta_id == mvmvif->ap_sta_id) - iwl_mvm_connection_loss(mvm, vif, "D0i3"); + data->mvm->d0i3_ap_sta_id == mvmvif->ap_sta_id) { + if (data->wakeup_reasons & + IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH) + iwl_mvm_connection_loss(data->mvm, vif, "D0i3"); + else + ieee80211_beacon_loss(vif); + } } void iwl_mvm_d0i3_enable_tx(struct iwl_mvm *mvm, __le16 *qos_seq) @@ -1246,7 +1256,7 @@ static void iwl_mvm_d0i3_exit_work(struct work_struct *wk) }; struct iwl_wowlan_status *status; int ret; - u32 disconnection_reasons, wakeup_reasons; + u32 handled_reasons, wakeup_reasons; __le16 *qos_seq = NULL; mutex_lock(&mvm->mutex); @@ -1263,13 +1273,18 @@ static void iwl_mvm_d0i3_exit_work(struct work_struct *wk) IWL_DEBUG_RPM(mvm, "wakeup reasons: 0x%x\n", wakeup_reasons); - disconnection_reasons = - IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON | - IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH; - if (wakeup_reasons & disconnection_reasons) + handled_reasons = IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON | + IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH; + if (wakeup_reasons & handled_reasons) { + struct iwl_mvm_wakeup_reason_iter_data data = { + .mvm = mvm, + .wakeup_reasons = wakeup_reasons, + }; + ieee80211_iterate_active_interfaces( mvm->hw, IEEE80211_IFACE_ITER_NORMAL, - iwl_mvm_d0i3_disconnect_iter, mvm); + iwl_mvm_d0i3_wakeup_reason_iter, &data); + } out: iwl_mvm_d0i3_enable_tx(mvm, qos_seq); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 23/26] iwlwifi: bump mvm firmware API to 16
The driver is now able to handle -16.ucode. Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/iwl-7000.c | 2 +- drivers/net/wireless/iwlwifi/iwl-8000.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-7000.c b/drivers/net/wireless/iwlwifi/iwl-7000.c index fa35da4..413b63e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-7000.c +++ b/drivers/net/wireless/iwlwifi/iwl-7000.c @@ -69,7 +69,7 @@ #include "iwl-agn-hw.h" /* Highest firmware API version supported */ -#define IWL7260_UCODE_API_MAX 15 +#define IWL7260_UCODE_API_MAX 16 /* Oldest version we won't warn about */ #define IWL7260_UCODE_API_OK 12 diff --git a/drivers/net/wireless/iwlwifi/iwl-8000.c b/drivers/net/wireless/iwlwifi/iwl-8000.c index 92709ad..8324bc8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-8000.c +++ b/drivers/net/wireless/iwlwifi/iwl-8000.c @@ -69,7 +69,7 @@ #include "iwl-agn-hw.h" /* Highest firmware API version supported */ -#define IWL8000_UCODE_API_MAX 15 +#define IWL8000_UCODE_API_MAX 16 /* Oldest version we won't warn about */ #define IWL8000_UCODE_API_OK 12 -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 15/26] iwlwifi: mvm: remove partial and full scan lists from lmac sched scan
From: David Spinadel Lmac sched scan supports partial scans, so we can set some channels to be scanned on every scan iteration and others to be scanned only on some iterations. Currently we set all channels to be scanned every iteration, but still have some configuration of which iterations should be partial and which should be full. Remove all partial/full scan configuration to reduce confusions. Signed-off-by: David Spinadel Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/mvm/scan.c | 28 +++- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c index 308a60e..f456aad 100644 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c @@ -140,10 +140,7 @@ struct iwl_mvm_scan_params { int n_match_sets; struct iwl_scan_probe_req preq; struct cfg80211_match_set *match_sets; - struct { - u8 iterations; - u8 full_scan_mul; /* not used for UMAC */ - } schedule[2]; + u8 iterations[2]; }; static u8 iwl_mvm_scan_rx_ant(struct iwl_mvm *mvm) @@ -750,7 +747,7 @@ static inline bool iwl_mvm_scan_use_ebs(struct iwl_mvm *mvm, static int iwl_mvm_scan_total_iterations(struct iwl_mvm_scan_params *params) { - return params->schedule[0].iterations + params->schedule[1].iterations; + return params->iterations[0] + params->iterations[1]; } static int iwl_mvm_scan_lmac_flags(struct iwl_mvm *mvm, @@ -817,11 +814,11 @@ static int iwl_mvm_scan_lmac(struct iwl_mvm *mvm, struct ieee80211_vif *vif, ssid_bitmap <<= 1; cmd->schedule[0].delay = cpu_to_le16(params->interval); - cmd->schedule[0].iterations = params->schedule[0].iterations; - cmd->schedule[0].full_scan_mul = params->schedule[0].full_scan_mul; + cmd->schedule[0].iterations = params->iterations[0]; + cmd->schedule[0].full_scan_mul = 1; cmd->schedule[1].delay = cpu_to_le16(params->interval); - cmd->schedule[1].iterations = params->schedule[1].iterations; - cmd->schedule[1].full_scan_mul = params->schedule[1].iterations; + cmd->schedule[1].iterations = params->iterations[1]; + cmd->schedule[1].full_scan_mul = 1; if (iwl_mvm_scan_use_ebs(mvm, vif, n_iterations)) { cmd->channel_opt[0].flags = @@ -1180,10 +1177,8 @@ int iwl_mvm_reg_scan_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif, params.n_match_sets = 0; params.match_sets = NULL; - params.schedule[0].iterations = 1; - params.schedule[0].full_scan_mul = 0; - params.schedule[1].iterations = 0; - params.schedule[1].full_scan_mul = 0; + params.iterations[0] = 1; + params.iterations[1] = 0; params.type = iwl_mvm_get_scan_type(mvm, vif, ¶ms); @@ -1263,10 +1258,9 @@ int iwl_mvm_sched_scan_start(struct iwl_mvm *mvm, params.n_match_sets = req->n_match_sets; params.match_sets = req->match_sets; - params.schedule[0].iterations = IWL_FAST_SCHED_SCAN_ITERATIONS; - params.schedule[0].full_scan_mul = 1; - params.schedule[1].iterations = 0xff; - params.schedule[1].full_scan_mul = IWL_FULL_SCAN_MULTIPLIER; + params.iterations[0] = 0; + params.iterations[1] = 0xff; + params.type = iwl_mvm_get_scan_type(mvm, vif, ¶ms); if (req->interval > U16_MAX) { -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 08/26] iwlwifi: mvm: add the ability to trigger only monitor dumps
From: Oren Givon Change the FW debug trigger tlv to include a monitor only option. Setting this option to true will cause fw dump triggers to only collect monitor data and skip other dumps such as SMEM, SRAM, CSR, PRPH, etc. This option is used when accessing the different parts of the firmware memory is not wanted and can cause unwanted behavior like when debugging TX latency. Signed-off-by: Oren Givon Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/iwl-fw-file.h | 3 + drivers/net/wireless/iwlwifi/iwl-trans.h| 9 +- drivers/net/wireless/iwlwifi/mvm/debugfs.c | 2 +- drivers/net/wireless/iwlwifi/mvm/fw.c | 19 ++- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 36 +++-- drivers/net/wireless/iwlwifi/mvm/mvm.h | 6 +- drivers/net/wireless/iwlwifi/mvm/ops.c | 3 +- drivers/net/wireless/iwlwifi/pcie/trans.c | 217 8 files changed, 177 insertions(+), 118 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-fw-file.h b/drivers/net/wireless/iwlwifi/iwl-fw-file.h index d1c5b90..75809ab 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fw-file.h +++ b/drivers/net/wireless/iwlwifi/iwl-fw-file.h @@ -498,10 +498,13 @@ struct iwl_fw_dbg_conf_hcmd { * * @IWL_FW_DBG_TRIGGER_START: when trigger occurs re-conf the dbg mechanism * @IWL_FW_DBG_TRIGGER_STOP: when trigger occurs pull the dbg data + * @IWL_FW_DBG_TRIGGER_MONITOR_ONLY: when trigger occurs trigger is set to + * collect only monitor data */ enum iwl_fw_dbg_trigger_mode { IWL_FW_DBG_TRIGGER_START = BIT(0), IWL_FW_DBG_TRIGGER_STOP = BIT(1), + IWL_FW_DBG_TRIGGER_MONITOR_ONLY = BIT(2), }; /** diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index e68497a..151e3de 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h @@ -608,7 +608,9 @@ struct iwl_trans_ops { int (*suspend)(struct iwl_trans *trans); void (*resume)(struct iwl_trans *trans); - struct iwl_trans_dump_data *(*dump_data)(struct iwl_trans *trans); + struct iwl_trans_dump_data *(*dump_data)(struct iwl_trans *trans, +struct iwl_fw_dbg_trigger_tlv +*trigger); }; /** @@ -832,11 +834,12 @@ static inline void iwl_trans_resume(struct iwl_trans *trans) } static inline struct iwl_trans_dump_data * -iwl_trans_dump_data(struct iwl_trans *trans) +iwl_trans_dump_data(struct iwl_trans *trans, + struct iwl_fw_dbg_trigger_tlv *trigger) { if (!trans->ops->dump_data) return NULL; - return trans->ops->dump_data(trans); + return trans->ops->dump_data(trans, trigger); } static inline int iwl_trans_send_cmd(struct iwl_trans *trans, diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c index ffb4b5c..17d7a05 100644 --- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c @@ -974,7 +974,7 @@ static ssize_t iwl_dbgfs_fw_dbg_collect_write(struct iwl_mvm *mvm, if (ret) return ret; - iwl_mvm_fw_dbg_collect(mvm, FW_DBG_TRIGGER_USER, NULL, 0, 0); + iwl_mvm_fw_dbg_collect(mvm, FW_DBG_TRIGGER_USER, NULL, 0, NULL); iwl_mvm_unref(mvm, IWL_MVM_REF_PRPH_WRITE); diff --git a/drivers/net/wireless/iwlwifi/mvm/fw.c b/drivers/net/wireless/iwlwifi/mvm/fw.c index e65a653..aff5bbf 100644 --- a/drivers/net/wireless/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/iwlwifi/mvm/fw.c @@ -735,8 +735,13 @@ static void iwl_mvm_get_shared_mem_conf(struct iwl_mvm *mvm) int iwl_mvm_fw_dbg_collect_desc(struct iwl_mvm *mvm, struct iwl_mvm_dump_desc *desc, - unsigned int delay) + struct iwl_fw_dbg_trigger_tlv *trigger) { + unsigned int delay = 0; + + if (trigger) + delay = msecs_to_jiffies(le32_to_cpu(trigger->stop_delay)); + if (test_and_set_bit(IWL_MVM_STATUS_DUMPING_FW_LOG, &mvm->status)) return -EBUSY; @@ -747,6 +752,7 @@ int iwl_mvm_fw_dbg_collect_desc(struct iwl_mvm *mvm, le32_to_cpu(desc->trig_desc.type)); mvm->fw_dump_desc = desc; + mvm->fw_dump_trig = trigger; queue_delayed_work(system_wq, &mvm->fw_dump_wk, delay); @@ -754,7 +760,8 @@ int iwl_mvm_fw_dbg_collect_desc(struct iwl_mvm *mvm, } int iwl_mvm_fw_dbg_collect(struct iwl_mvm *mvm, enum iwl_fw_dbg_trigger trig, - const char *str, size_t len, unsigned int delay) + const char *str, size_t len, + struct iwl_fw_dbg_trigger_tlv *trigger) { struct iwl_mvm_dump_desc *desc; @@ -766,14 +773,13 @@ int iwl_mvm_fw_dbg_collect(struct iwl_mvm *mvm, enum iwl_fw_dbg_trigger trig, des
[PATCH 18/26] iwlwifi: convert hex_dump_to_buffer() to %*ph
From: Andy Shevchenko There is no need to use hex_dump_to_buffer() in the cases like this: hexdump_to_buffer(buf, len, 16, 1, outbuf, outlen, false); /* len <= 16 */ sprintf("%s\n", outbuf); since it maybe easily converted to simple: sprintf("%*ph\n", len, buf); Note: it seems in one case the output is groupped by 2 bytes and looks like a typo. Thus, patch changes that to plain byte stream. Signed-off-by: Andy Shevchenko Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/dvm/debugfs.c | 8 ++-- drivers/net/wireless/iwlwifi/mvm/debugfs.c | 7 +-- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/dvm/debugfs.c b/drivers/net/wireless/iwlwifi/dvm/debugfs.c index 0ffb6ff..b15e44f 100644 --- a/drivers/net/wireless/iwlwifi/dvm/debugfs.c +++ b/drivers/net/wireless/iwlwifi/dvm/debugfs.c @@ -310,12 +310,8 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file, pos += scnprintf(buf + pos, buf_size - pos, "NVM version: 0x%x\n", nvm_ver); for (ofs = 0 ; ofs < eeprom_len ; ofs += 16) { - pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x ", ofs); - hex_dump_to_buffer(ptr + ofs, 16 , 16, 2, buf + pos, - buf_size - pos, 0); - pos += strlen(buf + pos); - if (buf_size - pos > 0) - buf[pos++] = '\n'; + pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x %16ph\n", +ofs, ptr + ofs); } ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c index 17d7a05..ca4a1f8 100644 --- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c @@ -1200,12 +1200,7 @@ static ssize_t iwl_dbgfs_d3_sram_read(struct file *file, char __user *user_buf, if (ptr) { for (ofs = 0; ofs < len; ofs += 16) { pos += scnprintf(buf + pos, bufsz - pos, -"0x%.4x ", ofs); - hex_dump_to_buffer(ptr + ofs, 16, 16, 1, buf + pos, - bufsz - pos, false); - pos += strlen(buf + pos); - if (bufsz - pos > 0) - buf[pos++] = '\n'; +"0x%.4x %16ph\n", ofs, ptr + ofs); } } else { pos += scnprintf(buf + pos, bufsz - pos, -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 16/26] iwlwifi: mvm: add debug info to schedule scan complete message.
From: Ayala Beker Add more information to schedule scan complete message. Signed-off-by: Ayala Beker Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/mvm/scan.c | 23 --- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c index f456aad..1505546 100644 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c @@ -349,9 +349,13 @@ void iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm, if (mvm->scan_status & IWL_MVM_SCAN_STOPPING_SCHED) { WARN_ON_ONCE(mvm->scan_status & IWL_MVM_SCAN_STOPPING_REGULAR); - IWL_DEBUG_SCAN(mvm, "Scheduled scan %s, EBS status %s\n", + IWL_DEBUG_SCAN(mvm, + "Scheduled scan %s, EBS status %s, Last line %d, Last iteration %d, Time after last iteration %d\n", aborted ? "aborted" : "completed", - iwl_mvm_ebs_status_str(scan_notif->ebs_status)); + iwl_mvm_ebs_status_str(scan_notif->ebs_status), + scan_notif->last_schedule_line, + scan_notif->last_schedule_iteration, + __le32_to_cpu(scan_notif->time_after_last_iter)); mvm->scan_status &= ~IWL_MVM_SCAN_STOPPING_SCHED; } else if (mvm->scan_status & IWL_MVM_SCAN_STOPPING_REGULAR) { @@ -363,9 +367,13 @@ void iwl_mvm_rx_lmac_scan_complete_notif(struct iwl_mvm *mvm, } else if (mvm->scan_status & IWL_MVM_SCAN_SCHED) { WARN_ON_ONCE(mvm->scan_status & IWL_MVM_SCAN_REGULAR); - IWL_DEBUG_SCAN(mvm, "Scheduled scan %s, EBS status %s (FW)\n", + IWL_DEBUG_SCAN(mvm, + "Scheduled scan %s, EBS status %s, Last line %d, Last iteration %d, Time after last iteration %d (FW)\n", aborted ? "aborted" : "completed", - iwl_mvm_ebs_status_str(scan_notif->ebs_status)); + iwl_mvm_ebs_status_str(scan_notif->ebs_status), + scan_notif->last_schedule_line, + scan_notif->last_schedule_iteration, + __le32_to_cpu(scan_notif->time_after_last_iter)); mvm->scan_status &= ~IWL_MVM_SCAN_SCHED; ieee80211_sched_scan_stopped(mvm->hw); @@ -1337,13 +1345,14 @@ void iwl_mvm_rx_umac_scan_complete_notif(struct iwl_mvm *mvm, } mvm->scan_status &= ~mvm->scan_uid_status[uid]; - IWL_DEBUG_SCAN(mvm, - "Scan completed, uid %u type %u, status %s, EBS status %s\n", + "Scan completed, uid %u type %u, status %s, EBS status %s, Last line %d, Last iteration %d, Time from last iteration %d\n", uid, mvm->scan_uid_status[uid], notif->status == IWL_SCAN_OFFLOAD_COMPLETED ? "completed" : "aborted", - iwl_mvm_ebs_status_str(notif->ebs_status)); + iwl_mvm_ebs_status_str(notif->ebs_status), + notif->last_schedule, notif->last_iter, + __le32_to_cpu(notif->time_from_last_iter)); if (notif->ebs_status != IWL_SCAN_EBS_SUCCESS && notif->ebs_status != IWL_SCAN_EBS_INACTIVE) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 17/26] iwlwifi: pass NAPI struct from transport layer
From: Johannes Berg The mac80211 patch to pass the NAPI struct only changed iwlwifi to store the NAPI struct, but we can do better: pass it directly from the lower transport layer to the opmode during RX, and then on to mac80211 from there. When we add multiple RX queues, we can then pass the appropriate NAPI struct properly. Signed-off-by: Johannes Berg Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/dvm/agn.h | 2 +- drivers/net/wireless/iwlwifi/dvm/main.c| 13 - drivers/net/wireless/iwlwifi/dvm/rx.c | 3 ++- drivers/net/wireless/iwlwifi/iwl-op-mode.h | 26 -- drivers/net/wireless/iwlwifi/mvm/mvm.h | 4 ++-- drivers/net/wireless/iwlwifi/mvm/ops.c | 16 ++-- drivers/net/wireless/iwlwifi/mvm/rx.c | 8 +--- drivers/net/wireless/iwlwifi/pcie/rx.c | 2 +- drivers/net/wireless/iwlwifi/pcie/trans.c | 7 +++ 9 files changed, 20 insertions(+), 61 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/dvm/agn.h b/drivers/net/wireless/iwlwifi/dvm/agn.h index 101ef31..edc3dd4 100644 --- a/drivers/net/wireless/iwlwifi/dvm/agn.h +++ b/drivers/net/wireless/iwlwifi/dvm/agn.h @@ -122,7 +122,7 @@ static inline void iwl_set_calib_hdr(struct iwl_calib_hdr *hdr, u8 cmd) void iwl_down(struct iwl_priv *priv); void iwl_cancel_deferred_work(struct iwl_priv *priv); void iwlagn_prepare_restart(struct iwl_priv *priv); -void iwl_rx_dispatch(struct iwl_op_mode *op_mode, +void iwl_rx_dispatch(struct iwl_op_mode *op_mode, struct napi_struct *napi, struct iwl_rx_cmd_buffer *rxb); bool iwl_check_for_ct_kill(struct iwl_priv *priv); diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c index 6448195..e7616f0 100644 --- a/drivers/net/wireless/iwlwifi/dvm/main.c +++ b/drivers/net/wireless/iwlwifi/dvm/main.c @@ -2029,18 +2029,6 @@ static bool iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state) return false; } -static void iwl_napi_add(struct iwl_op_mode *op_mode, -struct napi_struct *napi, -struct net_device *napi_dev, -int (*poll)(struct napi_struct *, int), -int weight) -{ - struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode); - - netif_napi_add(napi_dev, napi, poll, weight); - priv->napi = napi; -} - static const struct iwl_op_mode_ops iwl_dvm_ops = { .start = iwl_op_mode_dvm_start, .stop = iwl_op_mode_dvm_stop, @@ -2053,7 +2041,6 @@ static const struct iwl_op_mode_ops iwl_dvm_ops = { .cmd_queue_full = iwl_cmd_queue_full, .nic_config = iwl_nic_config, .wimax_active = iwl_wimax_active, - .napi_add = iwl_napi_add, }; /* diff --git a/drivers/net/wireless/iwlwifi/dvm/rx.c b/drivers/net/wireless/iwlwifi/dvm/rx.c index 1517698..4785203 100644 --- a/drivers/net/wireless/iwlwifi/dvm/rx.c +++ b/drivers/net/wireless/iwlwifi/dvm/rx.c @@ -1073,7 +1073,8 @@ void iwl_setup_rx_handlers(struct iwl_priv *priv) iwlagn_bt_rx_handler_setup(priv); } -void iwl_rx_dispatch(struct iwl_op_mode *op_mode, struct iwl_rx_cmd_buffer *rxb) +void iwl_rx_dispatch(struct iwl_op_mode *op_mode, struct napi_struct *napi, +struct iwl_rx_cmd_buffer *rxb) { struct iwl_rx_packet *pkt = rxb_addr(rxb); struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode); diff --git a/drivers/net/wireless/iwlwifi/iwl-op-mode.h b/drivers/net/wireless/iwlwifi/iwl-op-mode.h index 71b450a..b47fe9d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-op-mode.h +++ b/drivers/net/wireless/iwlwifi/iwl-op-mode.h @@ -116,10 +116,6 @@ struct iwl_cfg; * May sleep * @rx: Rx notification to the op_mode. rxb is the Rx buffer itself. Cmd is the * HCMD this Rx responds to. Can't sleep. - * @napi_add: NAPI initialization. The transport is fully responsible for NAPI, - * but the higher layers need to know about it (in particular mac80211 to - * to able to call the right NAPI RX functions); this function is needed - * to eventually call netif_napi_add() with higher layer involvement. * @queue_full: notifies that a HW queue is full. * Must be atomic and called with BH disabled. * @queue_not_full: notifies that a HW queue is not full any more. @@ -148,12 +144,8 @@ struct iwl_op_mode_ops { const struct iwl_fw *fw, struct dentry *dbgfs_dir); void (*stop)(struct iwl_op_mode *op_mode); - void (*rx)(struct iwl_op_mode *op_mode, struct iwl_rx_cmd_buffer *rxb); - void (*napi_add)(struct iwl_op_mode *op_mode, -struct napi_struct *napi, -struct net_device *napi_dev, -int (*poll)(struct napi_struct *, int), -
[PATCH 26/26] iwlwifi: mvm: fix a race in D0i3 vs. Tx path
When we enter D0i3, we must stop TXing otherwise the sequence number we use might conflict with the firmware's internal TX. In order to do so, we have IWL_MVM_STATUS_IN_D0I3 which should prevent any Tx while we enter D0i3. There is a bug in this code since we may Tx even if IWL_MVM_STATUS_IN_D0I3 is set. This can happen as long as mvm->d0i3_ap_sta_id is not set. To make sure that we don't have any packet in the Tx path while we set mvm->d0i3_ap_sta_id, call synchronize_net only after we already set mvm->d0i3_ap_sta_id. Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/mvm/ops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/mvm/ops.c b/drivers/net/wireless/iwlwifi/mvm/ops.c index 02ce184..07e6892 100644 --- a/drivers/net/wireless/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/iwlwifi/mvm/ops.c @@ -1114,9 +1114,7 @@ int iwl_mvm_enter_d0i3(struct iwl_op_mode *op_mode) IWL_DEBUG_RPM(mvm, "MVM entering D0i3\n"); - /* make sure we have no running tx while configuring the qos */ set_bit(IWL_MVM_STATUS_IN_D0I3, &mvm->status); - synchronize_net(); /* * iwl_mvm_ref_sync takes a reference before checking the flag. @@ -1144,6 +1142,9 @@ int iwl_mvm_enter_d0i3(struct iwl_op_mode *op_mode) mvm->d0i3_offloading = false; } + /* make sure we have no running tx while configuring the seqno */ + synchronize_net(); + iwl_mvm_set_wowlan_data(mvm, &wowlan_config_cmd, &d0i3_iter_data); ret = iwl_mvm_send_cmd_pdu(mvm, WOWLAN_CONFIGURATION, flags, sizeof(wowlan_config_cmd), -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 13/26] iwlwifi: make sure d3_suspend/resume ops exist
From: Eliad Peller We added calls to d3_suspend/resume trans ops during the suspend/resume flow. However, the wrapper code didn't verify the trans ops were actually defined, resulting in panic when they were not (such as in the case of sdio trans) Fixes: 6dfb36c89dc2 ("iwlwifi: call d3_suspend/resume in d0i3 case as well") Signed-off-by: Eliad Peller Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/iwl-trans.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 9d8b5cb..c829c50 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h @@ -810,7 +810,8 @@ static inline void iwl_trans_stop_device(struct iwl_trans *trans) static inline void iwl_trans_d3_suspend(struct iwl_trans *trans, bool test) { might_sleep(); - trans->ops->d3_suspend(trans, test); + if (trans->ops->d3_suspend) + trans->ops->d3_suspend(trans, test); } static inline int iwl_trans_d3_resume(struct iwl_trans *trans, @@ -818,6 +819,9 @@ static inline int iwl_trans_d3_resume(struct iwl_trans *trans, bool test) { might_sleep(); + if (!trans->ops->d3_resume) + return 0; + return trans->ops->d3_resume(trans, status, test); } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 21/26] iwlwifi: mvm: Enable power management on low-latency bss
From: Avri Altman Currently the driver disable power management on all low-latency interfaces, while it should disable it on WiDi interfaces only. Non-P2P interfaces that runs voice and video traffic should enable power management. Signed-off-by: Avri Altman Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/mvm/power.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/mvm/power.c b/drivers/net/wireless/iwlwifi/mvm/power.c index c4e0890..4645877 100644 --- a/drivers/net/wireless/iwlwifi/mvm/power.c +++ b/drivers/net/wireless/iwlwifi/mvm/power.c @@ -337,8 +337,8 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_SAVE_ENA_MSK); - if (!vif->bss_conf.ps || iwl_mvm_vif_low_latency(mvmvif) || - !mvmvif->pm_enabled) + if (!vif->bss_conf.ps || !mvmvif->pm_enabled || + (iwl_mvm_vif_low_latency(mvmvif) && vif->p2p)) return; cmd->flags |= cpu_to_le16(POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 12/26] iwlwifi: mvm: set different pm_timeout for action frames
From: Avri Altman When building a Tx Command for management frames, we are lacking a check for action frames, for which we should set a different pm_timeout. This cause the fw to stay awake for 100TU after each such frame is transmitted, resulting an excessive power consumption. Signed-off-by: Avri Altman Reviewed-by: Johannes Berg Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/mvm/fw-api-tx.h | 12 drivers/net/wireless/iwlwifi/mvm/tx.c| 10 ++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-tx.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-tx.h index 81c4ea3..853698a 100644 --- a/drivers/net/wireless/iwlwifi/mvm/fw-api-tx.h +++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-tx.h @@ -124,6 +124,18 @@ enum iwl_tx_flags { TX_CMD_FLG_HCCA_CHUNK = BIT(31) }; /* TX_FLAGS_BITS_API_S_VER_1 */ +/** + * enum iwl_tx_pm_timeouts - pm timeout values in TX command + * @PM_FRAME_NONE: no need to suspend sleep mode + * @PM_FRAME_MGMT: fw suspend sleep mode for 100TU + * @PM_FRAME_ASSOC: fw suspend sleep mode for 10sec + */ +enum iwl_tx_pm_timeouts { + PM_FRAME_NONE = 0, + PM_FRAME_MGMT = 2, + PM_FRAME_ASSOC = 3, +}; + /* * TX command security control */ diff --git a/drivers/net/wireless/iwlwifi/mvm/tx.c b/drivers/net/wireless/iwlwifi/mvm/tx.c index 15bf36a..6df5aad 100644 --- a/drivers/net/wireless/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/iwlwifi/mvm/tx.c @@ -153,18 +153,20 @@ void iwl_mvm_set_tx_cmd(struct iwl_mvm *mvm, struct sk_buff *skb, if (ieee80211_is_mgmt(fc)) { if (ieee80211_is_assoc_req(fc) || ieee80211_is_reassoc_req(fc)) - tx_cmd->pm_frame_timeout = cpu_to_le16(3); + tx_cmd->pm_frame_timeout = cpu_to_le16(PM_FRAME_ASSOC); + else if (ieee80211_is_action(fc)) + tx_cmd->pm_frame_timeout = cpu_to_le16(PM_FRAME_NONE); else - tx_cmd->pm_frame_timeout = cpu_to_le16(2); + tx_cmd->pm_frame_timeout = cpu_to_le16(PM_FRAME_MGMT); /* The spec allows Action frames in A-MPDU, we don't support * it */ WARN_ON_ONCE(info->flags & IEEE80211_TX_CTL_AMPDU); } else if (info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO) { - tx_cmd->pm_frame_timeout = cpu_to_le16(2); + tx_cmd->pm_frame_timeout = cpu_to_le16(PM_FRAME_MGMT); } else { - tx_cmd->pm_frame_timeout = 0; + tx_cmd->pm_frame_timeout = cpu_to_le16(PM_FRAME_NONE); } if (ieee80211_is_data(fc) && len > mvm->rts_threshold && -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 19/26] iwlwifi: mvm: fix a range check in debugfs code
From: Dan Carpenter The &mvm->tof_data.range_req.ap[] array has IWL_MVM_TOF_MAX_APS elements so the check should be >= instead of >. Also the test can underflow so I have changed "i" to unsigned. Fixes: ce7929186a39 ('wlwifi: mvm: add basic Time of Flight (802.11mc FTM) support') Signed-off-by: Dan Carpenter Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c index ddb1c84..383a316 100644 --- a/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c +++ b/drivers/net/wireless/iwlwifi/mvm/debugfs-vif.c @@ -911,9 +911,9 @@ static ssize_t iwl_dbgfs_tof_range_request_write(struct ieee80211_vif *vif, int size = sizeof(struct iwl_tof_range_req_ap_entry); u16 burst_period; u8 *mac = ap.bssid; - int i; + unsigned int i; - if (sscanf(data, "%d %hhd %hhx %hhx" + if (sscanf(data, "%u %hhd %hhx %hhx" "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx" "%hhx %hhx %hx" "%hhx %hhx %x" @@ -929,7 +929,7 @@ static ssize_t iwl_dbgfs_tof_range_request_write(struct ieee80211_vif *vif, ret = -EINVAL; goto out; } - if (i > IWL_MVM_TOF_MAX_APS) { + if (i >= IWL_MVM_TOF_MAX_APS) { IWL_ERR(mvm, "Invalid AP index %d\n", i); ret = -EINVAL; goto out; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 04/26] iwlwifi: mvm: revert to our old skip over dtim policy
From: Avri Altman Our firmware scheduler used to suffer from false wake-up on 500 time units. We had to came up with a formula to address this buggy behavior. Now that our firmware is fixed, we can go back to our old policy. Signed-off-by: Avri Altman Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/mvm/power.c | 28 ++-- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/mvm/power.c b/drivers/net/wireless/iwlwifi/mvm/power.c index 506294f..c4e0890 100644 --- a/drivers/net/wireless/iwlwifi/mvm/power.c +++ b/drivers/net/wireless/iwlwifi/mvm/power.c @@ -288,27 +288,6 @@ static bool iwl_mvm_power_allow_uapsd(struct iwl_mvm *mvm, return true; } -static int iwl_mvm_power_get_skip_over_dtim(int dtimper, int bi) -{ - int numerator; - int dtim_interval = dtimper * bi; - - if (WARN_ON(!dtim_interval)) - return 0; - - if (dtimper == 1) { - if (bi > 100) - numerator = 408; - else - numerator = 510; - } else if (dtimper < 10) { - numerator = 612; - } else { - return 0; - } - return max(1, (numerator / dtim_interval)); -} - static bool iwl_mvm_power_is_radar(struct ieee80211_vif *vif) { struct ieee80211_chanctx_conf *chanctx_conf; @@ -378,11 +357,8 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, if (!radar_detect && (dtimper < 10) && (iwlmvm_mod_params.power_scheme == IWL_POWER_SCHEME_LP || mvm->cur_ucode == IWL_UCODE_WOWLAN)) { - cmd->skip_dtim_periods = - iwl_mvm_power_get_skip_over_dtim(dtimper, bi); - if (cmd->skip_dtim_periods) - cmd->flags |= - cpu_to_le16(POWER_FLAGS_SKIP_OVER_DTIM_MSK); + cmd->flags |= cpu_to_le16(POWER_FLAGS_SKIP_OVER_DTIM_MSK); + cmd->skip_dtim_periods = 3; } if (mvm->cur_ucode != IWL_UCODE_WOWLAN) { -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 02/26] iwlwifi: mvm: print secboot status registers on alive timeout
From: Dor Shaish Print the CPU1 and CPU2 secured boot status registers from the NIC to indicate a SYSASSERT during secured engine unlocking process on init/protocol image. Signed-off-by: Dor Shaish Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/iwl-prph.h | 2 ++ drivers/net/wireless/iwlwifi/mvm/fw.c | 5 + 2 files changed, 7 insertions(+) diff --git a/drivers/net/wireless/iwlwifi/iwl-prph.h b/drivers/net/wireless/iwlwifi/iwl-prph.h index cd98b9f..c4e7a71 100644 --- a/drivers/net/wireless/iwlwifi/iwl-prph.h +++ b/drivers/net/wireless/iwlwifi/iwl-prph.h @@ -383,6 +383,8 @@ enum aux_misc_master1_en { #define AUX_MISC_MASTER1_SMPHR_STATUS 0xA20800 #define RSA_ENABLE 0xA24B08 #define PREG_AUX_BUS_WPROT_0 0xA04CC0 +#define SB_CPU_1_STATUS0xA01E30 +#define SB_CPU_2_STATUS0xA01E34 /* FW chicken bits */ #define LMPM_CHICK 0xA01FF8 diff --git a/drivers/net/wireless/iwlwifi/mvm/fw.c b/drivers/net/wireless/iwlwifi/mvm/fw.c index acb402b..e65a653 100644 --- a/drivers/net/wireless/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/iwlwifi/mvm/fw.c @@ -482,6 +482,11 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm, ret = iwl_wait_notification(&mvm->notif_wait, &alive_wait, MVM_UCODE_ALIVE_TIMEOUT); if (ret) { + if (mvm->trans->cfg->device_family == IWL_DEVICE_FAMILY_8000) + IWL_ERR(mvm, + "SecBoot CPU1 Status: 0x%x, CPU2 Status: 0x%x\n", + iwl_read_prph(mvm->trans, SB_CPU_1_STATUS), + iwl_read_prph(mvm->trans, SB_CPU_2_STATUS)); mvm->cur_ucode = old_type; return ret; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 03/26] iwlwifi: pcie: dump RBs when FW error occurs
Add support for dumping all the RBs in the RX queue when FW error occurs. This will assist debugging. Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h | 17 +++ drivers/net/wireless/iwlwifi/pcie/trans.c| 59 +++- 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h b/drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h index e57dbd0..af5b320 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h +++ b/drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h @@ -84,6 +84,8 @@ * @IWL_FW_ERROR_DUMP_MEM: chunk of memory * @IWL_FW_ERROR_DUMP_ERROR_INFO: description of what triggered this dump. * Structured as &struct iwl_fw_error_dump_trigger_desc. + * @IWL_FW_ERROR_DUMP_RB: the content of an RB structured as + * &struct iwl_fw_error_dump_rb */ enum iwl_fw_error_dump_type { /* 0 is deprecated */ @@ -97,6 +99,7 @@ enum iwl_fw_error_dump_type { IWL_FW_ERROR_DUMP_FH_REGS = 8, IWL_FW_ERROR_DUMP_MEM = 9, IWL_FW_ERROR_DUMP_ERROR_INFO = 10, + IWL_FW_ERROR_DUMP_RB = 11, IWL_FW_ERROR_DUMP_MAX, }; @@ -223,6 +226,20 @@ struct iwl_fw_error_dump_mem { }; /** + * struct iwl_fw_error_dump_rb - content of an Receive Buffer + * @index: the index of the Receive Buffer in the Rx queue + * @rxq: the RB's Rx queue + * @reserved: + * @data: the content of the Receive Buffer + */ +struct iwl_fw_error_dump_rb { + __le32 index; + __le32 rxq; + __le32 reserved; + u8 data[]; +}; + +/** * iwl_fw_error_next_data - advance fw error dump data pointer * @data: previous data block * Returns: next data block diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index 8cc8f2b..9ebdd80 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c @@ -2275,6 +2275,47 @@ static u32 iwl_trans_pcie_dump_prph(struct iwl_trans *trans, return prph_len; } +static u32 iwl_trans_pcie_dump_rbs(struct iwl_trans *trans, + struct iwl_fw_error_dump_data **data, + int allocated_rb_nums) +{ + struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); + int max_len = PAGE_SIZE << trans_pcie->rx_page_order; + struct iwl_rxq *rxq = &trans_pcie->rxq; + u32 i, r, j, rb_len = 0; + + spin_lock(&rxq->lock); + + r = le16_to_cpu(ACCESS_ONCE(rxq->rb_stts->closed_rb_num)) & 0x0FFF; + + for (i = rxq->read, j = 0; +i != r && j < allocated_rb_nums; +i = (i + 1) & RX_QUEUE_MASK, j++) { + struct iwl_rx_mem_buffer *rxb = rxq->queue[i]; + struct iwl_fw_error_dump_rb *rb; + + dma_unmap_page(trans->dev, rxb->page_dma, max_len, + DMA_FROM_DEVICE); + + rb_len += sizeof(**data) + sizeof(*rb) + max_len; + + (*data)->type = cpu_to_le32(IWL_FW_ERROR_DUMP_RB); + (*data)->len = cpu_to_le32(sizeof(*rb) + max_len); + rb = (void *)(*data)->data; + rb->index = cpu_to_le32(i); + memcpy(rb->data, page_address(rxb->page), max_len); + /* remap the page for the free benefit */ + rxb->page_dma = dma_map_page(trans->dev, rxb->page, 0, +max_len, +DMA_FROM_DEVICE); + + *data = iwl_fw_error_next_data(*data); + } + + spin_unlock(&rxq->lock); + + return rb_len; +} #define IWL_CSR_TO_DUMP (0x250) static u32 iwl_trans_pcie_dump_csr(struct iwl_trans *trans, @@ -2352,9 +2393,10 @@ struct iwl_trans_dump_data *iwl_trans_pcie_dump_data(struct iwl_trans *trans) struct iwl_txq *cmdq = &trans_pcie->txq[trans_pcie->cmd_queue]; struct iwl_fw_error_dump_txcmd *txcmd; struct iwl_trans_dump_data *dump_data; - u32 len; + u32 len, num_rbs; u32 monitor_len; int i, ptr; + bool dump_rbs = test_bit(STATUS_FW_ERROR, &trans->status); /* transport dump header */ len = sizeof(*dump_data); @@ -2379,6 +2421,17 @@ struct iwl_trans_dump_data *iwl_trans_pcie_dump_data(struct iwl_trans *trans) /* FH registers */ len += sizeof(*data) + (FH_MEM_UPPER_BOUND - FH_MEM_LOWER_BOUND); + if (dump_rbs) { + /* RBs */ + num_rbs = le16_to_cpu(ACCESS_ONCE( + trans_pcie->rxq.rb_stts->closed_rb_num)) + & 0x0FFF; + num_rbs = (num_rbs - trans_pcie->rxq.read) & RX_QUEUE_MASK; + len += num_rbs * (sizeof(*data) + + sizeof(struct iwl_fw_error_dump_rb) + + (PAGE_SIZE << trans_pcie->rx_page_order
[PATCH 05/26] iwlwifi: Add max TX aggregation size for 8260 SDIO devices series
From: Alexander Bondar Set max TX aggregation size for 8260 SDIO devices series to 40 frames. Fine tune max RX aggregation size - change it to 21. Signed-off-by: Alexander Bondar Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/iwl-8000.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/iwl-8000.c b/drivers/net/wireless/iwlwifi/iwl-8000.c index 7caea69..92709ad 100644 --- a/drivers/net/wireless/iwlwifi/iwl-8000.c +++ b/drivers/net/wireless/iwlwifi/iwl-8000.c @@ -97,8 +97,9 @@ #define DEFAULT_NVM_FILE_FAMILY_8000B "nvmData-8000B" #define DEFAULT_NVM_FILE_FAMILY_8000C "nvmData-8000C" -/* Max SDIO RX aggregation size of the ADDBA request/response */ -#define MAX_RX_AGG_SIZE_8260_SDIO 28 +/* Max SDIO RX/TX aggregation sizes of the ADDBA request/response */ +#define MAX_RX_AGG_SIZE_8260_SDIO 21 +#define MAX_TX_AGG_SIZE_8260_SDIO 40 /* Max A-MPDU exponent for HT and VHT */ #define MAX_HT_AMPDU_EXPONENT_8260_SDIOIEEE80211_HT_MAX_AMPDU_32K @@ -204,6 +205,7 @@ const struct iwl_cfg iwl8260_2ac_sdio_cfg = { .nvm_ver = IWL8000_NVM_VERSION, .nvm_calib_ver = IWL8000_TX_POWER_VERSION, .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO, + .max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO, .disable_dummy_notification = true, .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO, .max_vht_ampdu_exponent = MAX_VHT_AMPDU_EXPONENT_8260_SDIO, @@ -217,6 +219,7 @@ const struct iwl_cfg iwl4165_2ac_sdio_cfg = { .nvm_ver = IWL8000_NVM_VERSION, .nvm_calib_ver = IWL8000_TX_POWER_VERSION, .max_rx_agg_size = MAX_RX_AGG_SIZE_8260_SDIO, + .max_tx_agg_size = MAX_TX_AGG_SIZE_8260_SDIO, .bt_shared_single_ant = true, .disable_dummy_notification = true, .max_ht_ampdu_exponent = MAX_HT_AMPDU_EXPONENT_8260_SDIO, -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 06/26] iwlwifi: add new TLV capability flag for gscan support
From: Avraham Stern Gscan is a scan feature which is supported on certain devices only, hence the need for a TLV flag for it. For devices that support gscan store the gscan capabilities advertised by the FW so the driver can report it to upper layers. Signed-off-by: Avraham Stern Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/iwl-drv.c | 40 ++ drivers/net/wireless/iwlwifi/iwl-fw-file.h | 27 drivers/net/wireless/iwlwifi/iwl-fw.h | 25 +++ 3 files changed, 92 insertions(+) diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c index 721d3cb..a86aa5b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-drv.c +++ b/drivers/net/wireless/iwlwifi/iwl-drv.c @@ -372,6 +372,30 @@ static int iwl_store_cscheme(struct iwl_fw *fw, const u8 *data, const u32 len) return 0; } +static int iwl_store_gscan_capa(struct iwl_fw *fw, const u8 *data, + const u32 len) +{ + struct iwl_fw_gscan_capabilities *fw_capa = (void *)data; + struct iwl_gscan_capabilities *capa = &fw->gscan_capa; + + if (len < sizeof(*fw_capa)) + return -EINVAL; + + capa->max_scan_cache_size = le32_to_cpu(fw_capa->max_scan_cache_size); + capa->max_scan_buckets = le32_to_cpu(fw_capa->max_scan_buckets); + capa->max_ap_cache_per_scan = + le32_to_cpu(fw_capa->max_ap_cache_per_scan); + capa->max_rssi_sample_size = le32_to_cpu(fw_capa->max_rssi_sample_size); + capa->max_scan_reporting_threshold = + le32_to_cpu(fw_capa->max_scan_reporting_threshold); + capa->max_hotlist_aps = le32_to_cpu(fw_capa->max_hotlist_aps); + capa->max_significant_change_aps = + le32_to_cpu(fw_capa->max_significant_change_aps); + capa->max_bssid_history_entries = + le32_to_cpu(fw_capa->max_bssid_history_entries); + return 0; +} + /* * Gets uCode section from tlv. */ @@ -581,6 +605,7 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv, int num_of_cpus; bool usniffer_images = false; bool usniffer_req = false; + bool gscan_capa = false; if (len < sizeof(*ucode)) { IWL_ERR(drv, "uCode has invalid length: %zd\n", len); @@ -991,6 +1016,11 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv, drv->fw.sdio_adma_addr = le32_to_cpup((__le32 *)tlv_data); break; + case IWL_UCODE_TLV_FW_GSCAN_CAPA: + if (iwl_store_gscan_capa(&drv->fw, tlv_data, tlv_len)) + goto invalid_tlv_len; + gscan_capa = true; + break; default: IWL_DEBUG_INFO(drv, "unknown TLV: %d\n", tlv_type); break; @@ -1009,6 +1039,16 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv, return -EINVAL; } + /* +* If ucode advertises that it supports GSCAN but GSCAN +* capabilities TLV is not present, warn and continue without GSCAN. +*/ + if (fw_has_capa(capa, IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT) && + WARN(!gscan_capa, +"GSCAN is supported but capabilities TLV is unavailable\n")) + __clear_bit((__force long)IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT, + capa->_capa); + return 0; invalid_tlv_len: diff --git a/drivers/net/wireless/iwlwifi/iwl-fw-file.h b/drivers/net/wireless/iwlwifi/iwl-fw-file.h index 5d7f2d9..d1c5b90 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fw-file.h +++ b/drivers/net/wireless/iwlwifi/iwl-fw-file.h @@ -139,6 +139,7 @@ enum iwl_ucode_tlv_type { IWL_UCODE_TLV_FW_DBG_DEST = 38, IWL_UCODE_TLV_FW_DBG_CONF = 39, IWL_UCODE_TLV_FW_DBG_TRIGGER= 40, + IWL_UCODE_TLV_FW_GSCAN_CAPA = 50, }; struct iwl_ucode_tlv { @@ -306,6 +307,7 @@ typedef unsigned int __bitwise__ iwl_ucode_tlv_capa_t; * IWL_UCODE_TLV_API_WIFI_MCC_UPDATE. When either is set, multi-source LAR * is supported. * @IWL_UCODE_TLV_CAPA_BT_COEX_RRC: supports BT Coex RRC + * @IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT: supports gscan */ enum iwl_ucode_tlv_capa { IWL_UCODE_TLV_CAPA_D0I3_SUPPORT = (__force iwl_ucode_tlv_capa_t)0, @@ -327,6 +329,7 @@ enum iwl_ucode_tlv_capa { IWL_UCODE_TLV_CAPA_BT_COEX_PLCR = (__force iwl_ucode_tlv_capa_t)28, IWL_UCODE_TLV_CAPA_LAR_MULTI_MCC= (__force iwl_ucode_tlv_capa_t)29, IWL_UCODE_TLV_CAPA_BT_COEX_RRC = (__force iwl_ucode_tlv_capa_t)30, + IWL_UCODE_TLV_CAPA_GSCAN_SUPPORT= (__force iwl_ucode_tlv_capa_t)31, }; /* The default calibrate table size if not specified by firmware file */ @@ -728,4 +731,28 @@
pull request: iwlwifi-next 2015-08-18
Hi Kalle, This is another pull request for 4.3. As usual, details in the tag. As announced, this needs patches from mac80211-next, so I merged Johanne's tag and you did so as well upon my request (thank you for that). Please pull and let me know if you have issues. The following changes since commit 8f9c98df949333f08b74e5df1caacf7e2c5e8552: mac80211: fix BIT position for TDLS WIDE extended cap (2015-08-14 17:49:53 +0200) are available in the git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next.git tags/iwlwifi-next-for-kalle-2015-08-18 for you to fetch changes up to ecc7c518b3017821a6b26fb5fdaa548afa8ee236: iwlwifi: mvm: fix a race in D0i3 vs. Tx path (2015-08-18 10:25:26 +0300) * polish the Miracast operation * fix a few power consumption issues * scan cleanup * fixes for D0i3 system state * add paging for devices that support it * add again the new RBD allocation model * add more options to the firmware debug system * add support for frag SKBs in Tx Adrien Schildknecht (1): iwlwifi: out-of-bounds access in iwl_init_sband_channels Alexander Bondar (2): iwlwifi: Add max TX aggregation size for 8260 SDIO devices series iwlwifi: rs: disable MIMO only if allowed in configuration Andy Shevchenko (1): iwlwifi: convert hex_dump_to_buffer() to %*ph Arik Nemtsov (1): iwlwifi: mvm: support TDLS wider-bandwidth Assaf Krauss (1): iwlwifi: mvm: ToF - Set correct range request cmd id Avraham Stern (2): iwlwifi: mvm: Fix regular scan priority iwlwifi: add new TLV capability flag for gscan support Avri Altman (3): iwlwifi: mvm: revert to our old skip over dtim policy iwlwifi: mvm: set different pm_timeout for action frames iwlwifi: mvm: Enable power management on low-latency bss Ayala Beker (1): iwlwifi: mvm: add debug info to schedule scan complete message. Dan Carpenter (1): iwlwifi: mvm: fix a range check in debugfs code David Spinadel (3): iwlwifi: mvm: simplify calculating scan dwells and other timing values iwlwifi: mvm: remove partial and full scan lists from lmac sched scan iwlwifi: mvm: don't disconnect on beacon loss in D0I3 Dor Shaish (1): iwlwifi: mvm: print secboot status registers on alive timeout Eliad Peller (1): iwlwifi: make sure d3_suspend/resume ops exist Emmanuel Grumbach (7): iwlwifi: pcie: fix prepare card flow iwlwifi: pcie: fix stuck queue detection for sleeping clients iwlwifi: pcie: dump RBs when FW error occurs Merge remote-tracking branch 'iwlwifi-fixes/master' into next Merge tag 'mac80211-next-for-davem-2015-08-14' into next iwlwifi: bump mvm firmware API to 16 iwlwifi: mvm: fix a race in D0i3 vs. Tx path Johannes Berg (2): iwlwifi: pcie: support frag SKBs iwlwifi: pass NAPI struct from transport layer Matti Gottlieb (2): iwlwifi: mvm: Add FW paging mechanism for the UMAC on PCI iwlwifi: mvm: Add FW paging mechanism for the UMAC on SDIO Oren Givon (1): iwlwifi: mvm: add the ability to trigger only monitor dumps Sara Sharon (1): iwlwifi: pcie: New RBD allocation model drivers/net/wireless/iwlwifi/dvm/agn.h | 19 ++-- drivers/net/wireless/iwlwifi/dvm/debugfs.c | 8 +- drivers/net/wireless/iwlwifi/dvm/dev.h | 5 +- drivers/net/wireless/iwlwifi/dvm/lib.c | 8 +- drivers/net/wireless/iwlwifi/dvm/mac80211.c | 14 ++- drivers/net/wireless/iwlwifi/dvm/main.c | 13 --- drivers/net/wireless/iwlwifi/dvm/rs.c | 51 +- drivers/net/wireless/iwlwifi/dvm/rx.c | 105 - drivers/net/wireless/iwlwifi/dvm/rxon.c | 3 +- drivers/net/wireless/iwlwifi/dvm/scan.c | 25 ++--- drivers/net/wireless/iwlwifi/dvm/sta.c | 111 -- drivers/net/wireless/iwlwifi/dvm/tx.c | 18 ++-- drivers/net/wireless/iwlwifi/dvm/ucode.c| 5 +- drivers/net/wireless/iwlwifi/iwl-7000.c | 4 +- drivers/net/wireless/iwlwifi/iwl-8000.c | 12 ++- drivers/net/wireless/iwlwifi/iwl-config.h | 2 + drivers/net/wireless/iwlwifi/iwl-csr.h | 3 + drivers/net/wireless/iwlwifi/iwl-devtrace-data.h| 7 +- drivers/net/wireless/iwlwifi/iwl-devtrace-iwlwifi.h | 14 ++- drivers/net/wireless/iwlwifi/iwl-drv.c | 72 +- drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c | 4 +- drivers/net/wireless/iwlwifi/iwl-fw-error-dump.h| 17 drivers/net/wireless/iwlwifi/iwl-fw-file.h | 50 +- drivers/net/wireless/iwlwifi/iwl-fw.h | 68 ++ drivers/net/wireless/iwlwifi/iwl-notif-wait.c | 8 +- drivers/net/wireless/iwlwifi/iwl-notif