Re: [PATCH] ath9k_common: fix random decryption failure
Am 12.09.2014 um 22:36 schrieb Johannes Stezenbach: > In v3.15 the driver stopped to accept network packets after successful > authentification, which could be worked around by passing the > nohwcrypt=1 module parameter. This was not reproducible by > everyone, and showed random behaviour in some tests. > It was caused by an uninitialized variable introduced > in 4ed1a8d4a257 ("ath9k_htc: use ath9k_cmn_rx_accept") and > used in 341b29b9cd2f ("ath9k_htc: use ath9k_cmn_rx_skb_postprocess"). > > Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78581 > Fixes: 341b29b9cd2f ("ath9k_htc: use ath9k_cmn_rx_skb_postprocess") > Signed-off-by: Johannes Stezenbach > > diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c > b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c > index bb86eb2..f0484b1 100644 > --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c > +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c > @@ -978,7 +978,7 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv, > struct ath_hw *ah = common->ah; > struct ath_htc_rx_status *rxstatus; > struct ath_rx_status rx_stats; > - bool decrypt_error; > + bool decrypt_error = false; > > if (skb->len < HTC_RX_FRAME_HEADER_SIZE) { > ath_err(common, "Corrupted RX frame, dropping (len: %d)\n", > ACK. -- Regards, Oleksij signature.asc Description: OpenPGP digital signature
Re: [PATCH 1/4] Update firmware for rtl8192ce
On Tue, Sep 02, 2014 at 11:00:45AM -0500, Larry Finger wrote: > The latest driver, labelled rtlwifi_linux_mac80211_0019.0320.2014V628, > has updated firmware for the RTL8192CE. > > Signed-off-by: Larry Finger > --- > WHENCE| 1 + > rtlwifi/rtl8192cfw.bin| Bin 13540 -> 16192 bytes > rtlwifi/rtl8192cfwU_B.bin | Bin 14800 -> 16332 bytes > 3 files changed, 1 insertion(+) > i've applied all 4. thanks larry. --kyle -- 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: wireless 2014-09-11
From: "John W. Linville" Date: Thu, 11 Sep 2014 14:43:22 -0400 > Please pull this batch of fixes intended for the 3.17 stream: Pulled, thanks John. -- 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 net-next 0/2] Address reference counting issues with sock_queue_err_skb
From: Alexander Duyck Date: Wed, 10 Sep 2014 18:04:42 -0400 > After looking over the code for skb_clone_sk after some comments made by > Eric Dumazet I have come to the conclusion that skb_clone_sk is taking the > correct approach in how to handle the sk_refcnt when creating a buffer that > is eventually meant to be returned to the socket via the sock_queue_err_skb > function. > > However upon review of other callers I found what I believe to be a > possible reference count issue in the path for handling "wifi ack" packets. > To address this I have applied the same logic that is currently in place so > that the sk_refcnt will be forced to stay at least 1, or we will not > provide an skb to return in the sk_error_queue. Series applied, thanks Alex. -- 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 NEXT] rtlwifi: btcoexist: Change local debugging macros CL_*** into the standard varieties
Macros CL_SNPRINTF and CL_PRINTF are always used in that order. The first formats info into a buffer, and the second dumps it with printk. As the debug system in rtlwifi has a macro that does this with a single call, it seems reasonable to use it instead. An additional benefit is that the debug level can be set when loading the driver used by the wifi device. Signed-off-by: Larry Finger --- .../wireless/rtlwifi/btcoexist/halbtc8192e2ant.c | 119 +++- .../wireless/rtlwifi/btcoexist/halbtc8723b1ant.c | 125 +++-- .../wireless/rtlwifi/btcoexist/halbtc8723b2ant.c | 105 ++--- .../wireless/rtlwifi/btcoexist/halbtc8821a1ant.c | 122 +++- .../wireless/rtlwifi/btcoexist/halbtc8821a2ant.c | 107 ++ .../net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c | 3 - .../net/wireless/rtlwifi/btcoexist/halbtcoutsrc.h | 4 - 7 files changed, 194 insertions(+), 391 deletions(-) diff --git a/drivers/net/wireless/rtlwifi/btcoexist/halbtc8192e2ant.c b/drivers/net/wireless/rtlwifi/btcoexist/halbtc8192e2ant.c index af3f604..53261d6 100644 --- a/drivers/net/wireless/rtlwifi/btcoexist/halbtc8192e2ant.c +++ b/drivers/net/wireless/rtlwifi/btcoexist/halbtc8192e2ant.c @@ -3305,7 +3305,7 @@ void ex_halbtc8192e2ant_display_coex_info(struct btc_coexist *btcoexist) { struct btc_board_info *board_info = &btcoexist->board_info; struct btc_stack_info *stack_info = &btcoexist->stack_info; - u8 *cli_buf = btcoexist->cli_buf; + struct rtl_priv *rtlpriv = btcoexist->adapter; u8 u8tmp[4], i, bt_info_ext, ps_tdma_case = 0; u16 u16tmp[4]; u32 u32tmp[4]; @@ -3316,87 +3316,75 @@ void ex_halbtc8192e2ant_display_coex_info(struct btc_coexist *btcoexist) u8 wifi_dot11_chnl, wifi_hs_chnl; u32 fw_ver = 0, bt_patch_ver = 0; - CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, + RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n [BT Coexist info]"); - CL_PRINTF(cli_buf); if (btcoexist->manual_control) { - CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, + RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n ===[Under Manual Control]==="); - CL_PRINTF(cli_buf); - CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, + RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n =="); - CL_PRINTF(cli_buf); } if (!board_info->bt_exist) { - CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "\r\n BT not exists !!!"); - CL_PRINTF(cli_buf); + RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n BT not exists !!!"); return; } - CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, + RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d/ %d ", "Ant PG number/ Ant mechanism:", board_info->pg_ant_num, board_info->btdm_ant_num); - CL_PRINTF(cli_buf); - CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %d", + RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %s / %d", "BT stack/ hci ext ver", ((stack_info->profile_notified) ? "Yes" : "No"), stack_info->hci_version); - CL_PRINTF(cli_buf); btcoexist->btc_get(btcoexist, BTC_GET_U4_BT_PATCH_VER, &bt_patch_ver); btcoexist->btc_get(btcoexist, BTC_GET_U4_WIFI_FW_VER, &fw_ver); - CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, + RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d_%d/ 0x%x/ 0x%x(%d)", "CoexVer/ FwVer/ PatchVer", glcoex_ver_date_8192e_2ant, glcoex_ver_8192e_2ant, fw_ver, bt_patch_ver, bt_patch_ver); - CL_PRINTF(cli_buf); btcoexist->btc_get(btcoexist, BTC_GET_BL_HS_OPERATION, &bt_hson); btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_DOT11_CHNL, &wifi_dot11_chnl); btcoexist->btc_get(btcoexist, BTC_GET_U1_WIFI_HS_CHNL, &wifi_hs_chnl); - CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d(%d)", + RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %d / %d(%d)", "Dot11 channel / HsMode(HsChnl)", wifi_dot11_chnl, bt_hson, wifi_hs_chnl); - CL_PRINTF(cli_buf); - CL_SPRINTF(cli_buf, BT_TMP_BUF_SIZE, "\r\n %-35s = %02x %02x %02x ", + RT_TRACE(rtlpriv, COMP_INIT, DBG_DMESG, "\r\n %-35s = %02x %02x %02x ", "H2C Wifi inform bt chnl Info", coex_dm->wifi_chnl_info[0], coex_dm->wifi_chnl_info[1], coex_dm->wifi_chnl_info[2]); - CL_PRINTF(cli_buf); btcoexist->btc_get(btcoexist, BTC_GET_S4_WIFI_RSSI, &wifirssi); btcoexist->btc_get(btcoexist, BTC_GET_S4_HS_RSSI, &bt_hs_rssi); - CL_SPRINTF(cl
[PATCH] ath9k_htc: fix random decryption failure
In v3.15 the driver stopped to accept network packets after successful authentification, which could be worked around by passing the nohwcrypt=1 module parameter. This was not reproducible by everyone, and showed random behaviour in some tests. It was caused by an uninitialized variable introduced in 4ed1a8d4a257 ("ath9k_htc: use ath9k_cmn_rx_accept") and used in 341b29b9cd2f ("ath9k_htc: use ath9k_cmn_rx_skb_postprocess"). Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78581 Fixes: 341b29b9cd2f ("ath9k_htc: use ath9k_cmn_rx_skb_postprocess") Signed-off-by: Johannes Stezenbach diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c index bb86eb2..f0484b1 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c @@ -978,7 +978,7 @@ static bool ath9k_rx_prepare(struct ath9k_htc_priv *priv, struct ath_hw *ah = common->ah; struct ath_htc_rx_status *rxstatus; struct ath_rx_status rx_stats; - bool decrypt_error; + bool decrypt_error = false; if (skb->len < HTC_RX_FRAME_HEADER_SIZE) { ath_err(common, "Corrupted RX frame, dropping (len: %d)\n", -- 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 v2] net: rfkill: gpio: Enable module auto-loading for ACPI based switches
For the ACPI based switches the MODULE_DEVICE_TABLE is missing to export the entries for module auto-loading. Signed-off-by: Marcel Holtmann --- net/rfkill/rfkill-gpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c index 02a86a27fd84..5fa54dd78e25 100644 --- a/net/rfkill/rfkill-gpio.c +++ b/net/rfkill/rfkill-gpio.c @@ -163,6 +163,7 @@ static const struct acpi_device_id rfkill_acpi_match[] = { { "LNV4752", RFKILL_TYPE_GPS }, { }, }; +MODULE_DEVICE_TABLE(acpi, rfkill_acpi_match); #endif static struct platform_driver rfkill_gpio_driver = { -- 1.9.3 -- 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: Rtl8187se regression [was: rtl8187se - serious regressions since merge out of staging into 818x]
On 09/12/2014 11:29 AM, Andrea Merello wrote: Because of the problems I'am going now to a special site, where I have a local networks (LAN/WLAN), good internet connection and root access to Linux machines. This should be a good thing to do real testing. Excellent! Thank you Bernhard! 1.) Andrea, can you resend me the latest patches (perhaps against 3.16) please? (only to confirm that we are in "synchronous" mode.) Sure, I attach a cumulative patch, including all the changes I think may matter (signal strength fix not included) 2.) Andrea, Larry, John are you interested to have root access to my laptop using the rtl8187se? (Perhaps it can stay there over the weekend too.) Thank you for offering this :) In case it turns out that you actually face performance regressions, then it might help me to make some experiments using your machine. I will do a register dump and I will try to tune some parameters in the driver. This should NOT crash the machine, but if it is vital for you that the machine remains alive, then maybe I will avoid at least certain experiments.. Possibly tomorrow afternoon (Italian time) I will have some spare time to work on this. 3.) My test for maximal troughput is to run a connection /dev/zero -> nc ->|-> nc -> /dev/null. Any other ideas? Usually I use two Linux hosts (the DUT and my production system) and I use "iperf" program on both On the production system (the iperf server) I run iperf -s -u -b30M On the DUT I run iperf -c 192.168.1.2 -r -u -b30M This will cause an UDP data exchange and will perform both downstream and upstream throughput measurements. I usually do this (at least) two times, and I discard results from the first run, because rate selection algorithm might eventually need a bit settle to a "good" rate. 4.) I think to have this setup ready about 11:30 UTC. I was at my workplace, I really couldn't do quicker than this.. Sorry.. I hope we are still in time... I'am open to any suggestion from your side. Tests that may also help are: - test performance regression when you are both close to the AP and enough far from it that performances significantly drops. - check if the rtl818x_pci driver and the old driver settles at (about) the same rates.. Hi, I currently have a deadline to get some changes in rtlwifi into kernel 3.16, thus I have no time for testing the RTL8187SE. I do know that the whole issue of signal strength reporting for these chips is a problem. Larry -- 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: [RFC v2] device coredump: add new device coredump class
On Mon, Sep 08, 2014 at 10:38:07AM +0200, Johannes Berg wrote: > On Fri, 2014-09-05 at 15:13 -0700, Greg Kroah-Hartman wrote: > > > > + /* > > > + * this seems racy, but I don't see a notifier or such on > > > + * a struct device to know when it goes away? > > > + */ > > > + if (devcd->failing_dev->kobj.sd) > > > + sysfs_delete_link(&devcd->failing_dev->kobj, &dev->kobj, > > > + "dev_coredump"); > > > > What is this link? It should "just go away" if this: > > > > > + put_device(devcd->failing_dev); > > > > was the last put_device() call on the failing_dev, right? So you > > shouldn't need to make this call to sysfs_delete_link(). > > I looked at this again, and it's the other way around. This is the link > that Daniel requested, from the original device to the one that's being > freed. For whatever reason though, symlinks don't automatically go away > when freed: > > (with a test patch that makes "mac80211-hwsim" crash whenever we have > radar) > > # echo 1 > /sys/kernel/debug/ieee80211/phy0/hwsim/dfs_simulate_radar > # ls /sys/class/devcoredump/ > devcd1 > # ls /sys/class/devcoredump/devcd1/ > datafailing_device/ power/ subsystem/ uevent > # ls -l /sys/class/mac80211_hwsim/hwsim0/dev_coredump > lrwxrwxrwx 1 root root 0 Sep 8 08:34 > /sys/class/mac80211_hwsim/hwsim0/dev_coredump -> ../../devcoredump/devcd1 > # echo > /sys/class/devcoredump/devcd1/data > # ls /sys/class/devcoredump/ > # ls -l /sys/class/mac80211_hwsim/hwsim0/dev_coredump > lrwxrwxrwx 1 root root 0 Sep 8 08:34 > /sys/class/mac80211_hwsim/hwsim0/dev_coredump -> ../../devcoredump/devcd1 > > (but the link is now dead) > > Maybe I'm creating the links in the wrong way so they don't > automatically get removed when the struct device is released? No, you are correct, sorry for the noise, I thought the symlink was the other way around for some reason. 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
[PATCH] b43: Implement PHY PLL reset
We should reset PLL after changing MAC frequency. Signed-off-by: Rafał Miłecki --- drivers/net/wireless/b43/main.c | 30 ++ drivers/net/wireless/b43/main.h | 2 ++ drivers/net/wireless/b43/phy_ht.c | 2 +- drivers/net/wireless/b43/phy_n.c | 2 +- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 165dbc3..3adc13f 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c @@ -1204,6 +1204,36 @@ void b43_power_saving_ctl_bits(struct b43_wldev *dev, unsigned int ps_flags) } } +/* http://bcm-v4.sipsolutions.net/802.11/PHY/BmacCorePllReset */ +void b43_wireless_core_phy_pll_reset(struct b43_wldev *dev) +{ + struct bcma_drv_cc *bcma_cc __maybe_unused; + struct ssb_chipcommon *ssb_cc __maybe_unused; + + switch (dev->dev->bus_type) { +#ifdef CONFIG_B43_BCMA + case B43_BUS_BCMA: + bcma_cc = &dev->dev->bdev->bus->drv_cc; + + bcma_cc_write32(bcma_cc, BCMA_CC_CHIPCTL_ADDR, 0); + bcma_cc_mask32(bcma_cc, BCMA_CC_CHIPCTL_DATA, ~0x4); + bcma_cc_set32(bcma_cc, BCMA_CC_CHIPCTL_DATA, 0x4); + bcma_cc_mask32(bcma_cc, BCMA_CC_CHIPCTL_DATA, ~0x4); + break; +#endif +#ifdef CONFIG_B43_SSB + case B43_BUS_SSB: + ssb_cc = &dev->dev->sdev->bus->chipco; + + chipco_write32(ssb_cc, SSB_CHIPCO_CHIPCTL_ADDR, 0); + chipco_mask32(ssb_cc, SSB_CHIPCO_CHIPCTL_DATA, ~0x4); + chipco_set32(ssb_cc, SSB_CHIPCO_CHIPCTL_DATA, 0x4); + chipco_mask32(ssb_cc, SSB_CHIPCO_CHIPCTL_DATA, ~0x4); + break; +#endif + } +} + #ifdef CONFIG_B43_BCMA static void b43_bcma_phy_reset(struct b43_wldev *dev) { diff --git a/drivers/net/wireless/b43/main.h b/drivers/net/wireless/b43/main.h index 9f22e4b..c46430c 100644 --- a/drivers/net/wireless/b43/main.h +++ b/drivers/net/wireless/b43/main.h @@ -96,6 +96,8 @@ void b43_controller_restart(struct b43_wldev *dev, const char *reason); #define B43_PS_ASLEEP (1 << 3)/* Force device asleep */ void b43_power_saving_ctl_bits(struct b43_wldev *dev, unsigned int ps_flags); +void b43_wireless_core_phy_pll_reset(struct b43_wldev *dev); + void b43_mac_suspend(struct b43_wldev *dev); void b43_mac_enable(struct b43_wldev *dev); void b43_mac_phy_clock_set(struct b43_wldev *dev, bool on); diff --git a/drivers/net/wireless/b43/phy_ht.c b/drivers/net/wireless/b43/phy_ht.c index 6a0140a..bd68945 100644 --- a/drivers/net/wireless/b43/phy_ht.c +++ b/drivers/net/wireless/b43/phy_ht.c @@ -762,7 +762,7 @@ static void b43_phy_ht_spur_avoid(struct b43_wldev *dev, b43_mac_switch_freq(dev, spuravoid); - /* TODO: reset PLL */ + b43_wireless_core_phy_pll_reset(dev); if (spuravoid) b43_phy_set(dev, B43_PHY_HT_BBCFG, B43_PHY_HT_BBCFG_RSTRX); diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c index cf625d8..9f0bcf3 100644 --- a/drivers/net/wireless/b43/phy_n.c +++ b/drivers/net/wireless/b43/phy_n.c @@ -6369,7 +6369,7 @@ static void b43_nphy_channel_setup(struct b43_wldev *dev, b43_mac_switch_freq(dev, spuravoid); if (dev->phy.rev == 3 || dev->phy.rev == 4) - ; /* TODO: reset PLL */ + b43_wireless_core_phy_pll_reset(dev); if (spuravoid) b43_phy_set(dev, B43_NPHY_BBCFG, B43_NPHY_BBCFG_RSTRX); -- 1.8.4.5 -- 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: Rtl8187se regression [was: rtl8187se - serious regressions since merge out of staging into 818x]
> Because of the problems I'am going now to a special site, where I have a local > networks (LAN/WLAN), good internet connection and root access to Linux > machines. > This should be a good thing to do real testing. Excellent! Thank you Bernhard! > 1.) Andrea, can you resend me the latest patches (perhaps against 3.16) > please? > (only to confirm that we are in "synchronous" mode.) Sure, I attach a cumulative patch, including all the changes I think may matter (signal strength fix not included) > 2.) Andrea, Larry, John are you interested to have root access to my laptop > using the rtl8187se? > (Perhaps it can stay there over the weekend too.) Thank you for offering this :) In case it turns out that you actually face performance regressions, then it might help me to make some experiments using your machine. I will do a register dump and I will try to tune some parameters in the driver. This should NOT crash the machine, but if it is vital for you that the machine remains alive, then maybe I will avoid at least certain experiments.. Possibly tomorrow afternoon (Italian time) I will have some spare time to work on this. > 3.) My test for maximal troughput is to run a connection /dev/zero -> nc ->|-> > nc -> /dev/null. > Any other ideas? Usually I use two Linux hosts (the DUT and my production system) and I use "iperf" program on both On the production system (the iperf server) I run iperf -s -u -b30M On the DUT I run iperf -c 192.168.1.2 -r -u -b30M This will cause an UDP data exchange and will perform both downstream and upstream throughput measurements. I usually do this (at least) two times, and I discard results from the first run, because rate selection algorithm might eventually need a bit settle to a "good" rate. > 4.) I think to have this setup ready about 11:30 UTC. I was at my workplace, I really couldn't do quicker than this.. Sorry.. I hope we are still in time... > I'am open to any suggestion from your side. Tests that may also help are: - test performance regression when you are both close to the AP and enough far from it that performances significantly drops. - check if the rtl818x_pci driver and the old driver settles at (about) the same rates.. > > Bernhard Thank you really much Bernhard for you help. I hope this can lead to solve issues, and anyway I appreciate it very much :) Andrea > Am Freitag, 12. September 2014, 02:18:03 schrieb Andrea Merello: >> My aplogies for this quick and a bit messy reply: I m from mobile. >> >> @Xose >> Thank you for forwarding me that. I wasn t aware of it. >> >> (BTW a couple of other people reported a similar issue) >> >> @Ralf >> The driver still have some not implemented features, including signal >> strenght measure, furthermore some fixes that might improve performances >> should be on the way for 3.17. >> >> @Larry, Bernhard >> I think those fixes was basically the same of some RFT patch I sent you >> some time ago.. >> Have you had any occasion to test those patches? >> >> @Ralf, all.. >> I must say that I never been able to reproduce any severe performance >> regression here, for this reason I'm asking people who reports this to make >> some testing for me if possible.. >> >> Here you can find a similar report and my answer where I asked for the >> tests: >> https://bugzilla.kernel.org/show_bug.cgi?id=83631 >> >> If you could do some of those test for me, that would be great. >> > From 345b4fc7f22c4a83e2a481b65a8489ea2a475e5a Mon Sep 17 00:00:00 2001 From: Andrea Merello Date: Fri, 12 Sep 2014 17:34:04 +0200 Subject: [PATCH] rtl818x_pci: backport rtl8187se fixes to 3.16 - Fix for packet retries wrong count and broken rate scaling - Added memory barriers to ensure packet correctness - Fixed BSSID register write fails on certain ASICs (not sure if any rtl8187se may be affected) Signed-off-by: Andrea Merello --- drivers/net/wireless/rtl818x/rtl8180/dev.c | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c index 2c1c02b..1efefcb 100644 --- a/drivers/net/wireless/rtl818x/rtl8180/dev.c +++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c @@ -222,12 +222,20 @@ static void rtl8180_handle_rx(struct ieee80211_hw *dev) struct rtl8187se_rx_desc *desc = entry; flags = le32_to_cpu(desc->flags); + /* if ownership flag is set, then we can trust the + * HW has written other fields. We must not trust + * other descriptor data read before we checked (read) + * the ownership flag + */ + rmb(); flags2 = le32_to_cpu(desc->flags2); tsft = le64_to_cpu(desc->tsft); } else { struct rtl8180_rx_desc *desc = entry; flags = le32_to_cpu(desc->flags); + /* same as above */ + rmb(); flags2 = le32_to_cpu(desc->flags2); tsft = le64_to_cpu(desc->tsft); } @@ -336,7 +344,6 @@ static void rtl8180_handle_tx(struct ieee80211_hw *dev, unsigned int prio) info->flags |= IEEE80211_
Re: ath9k and AMD IOMMU alias breakage on 3.16?
Hi Jason, On Fri, Sep 05, 2014 at 10:28:01PM -0700, Jason Newton wrote: > [0.021820] AMD-Vi: device: 00:00.2 cap: 0040 seg: 0 flags: b8 info > [0.021827] AMD-Vi:mmio-addr: feb8 > [0.021844] AMD-Vi: DEV_SELECT_RANGE_STARTdevid: 00:01.0 flags: > 00 > [0.021848] AMD-Vi: DEV_RANGE_END devid: ff:1f.6 > [0.022730] AMD-Vi: DEV_ALIAS_RANGE devid: 02:00.0 flags: > 00 devid_to: 00:14.4 > [0.022735] AMD-Vi: DEV_RANGE_END devid: 02:1f.7 > [0.022745] AMD-Vi: DEV_SPECIAL(HPET[0]) devid: 00:14.0 > [0.022749] AMD-Vi: DEV_SPECIAL(IOAPIC[5]) devid: 00:14.0 > [0.022753] AMD-Vi: DEV_SPECIAL(IOAPIC[6]) devid: 00:00.0 It is just a test, as I don't know how the hardware is actually wired in your system, but can you try to boot with 'ivrs_ioapic[6]=00:00.1' on the kernel command line and report if it makes any difference? Thanks, Joerg -- 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 for-3.17] brcmfmac: handle IF event for P2P_DEVICE interface
The firmware notifies about interface changes through the IF event which has a NO_IF flag that means host can ignore the event. This behaviour was introduced in the driver by: commit 2ee8382fc6c763c76396a6aaff77a27089eed3aa Author: Arend van Spriel Date: Sat Aug 10 12:27:24 2013 +0200 brcmfmac: ignore IF event if firmware indicates it It turns out that the IF event for the P2P_DEVICE also has this flag set, but the event should not be ignored in this scenario. The mentioned commit caused a regression in 3.12 kernel in creation of the P2P_DEVICE interface. Cc: # 3.14, 3.16 Reviewed-by: Hante Meuleman Reviewed-by: Franky (Zhenhui) Lin Reviewed-by: Daniel (Deognyoun) Kim Reviewed-by: Pieter-Paul Giesberts Signed-off-by: Arend van Spriel --- Hi John, Here is another straggling patch. This patch is intended for the 3.17 and some stable kernels. It applies to the master branch of the wireless repository. Regards, Arend --- drivers/net/wireless/brcm80211/brcmfmac/fweh.c | 12 +--- drivers/net/wireless/brcm80211/brcmfmac/fweh.h | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c index 4f1daab..44fc85f 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c @@ -185,7 +185,13 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr, ifevent->action, ifevent->ifidx, ifevent->bssidx, ifevent->flags, ifevent->role); - if (ifevent->flags & BRCMF_E_IF_FLAG_NOIF) { + /* The P2P Device interface event must not be ignored +* contrary to what firmware tells us. The only way to +* distinguish the P2P Device is by looking at the ifidx +* and bssidx received. +*/ + if (!(ifevent->ifidx == 0 && ifevent->bssidx == 1) && + (ifevent->flags & BRCMF_E_IF_FLAG_NOIF)) { brcmf_dbg(EVENT, "event can be ignored\n"); return; } @@ -210,12 +216,12 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr, return; } - if (ifevent->action == BRCMF_E_IF_CHANGE) + if (ifp && ifevent->action == BRCMF_E_IF_CHANGE) brcmf_fws_reset_interface(ifp); err = brcmf_fweh_call_event_handler(ifp, emsg->event_code, emsg, data); - if (ifevent->action == BRCMF_E_IF_DEL) { + if (ifp && ifevent->action == BRCMF_E_IF_DEL) { brcmf_fws_del_interface(ifp); brcmf_del_if(drvr, ifevent->bssidx); } diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h index dd20b18..cbf033f 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.h @@ -172,6 +172,8 @@ enum brcmf_fweh_event_code { #define BRCMF_E_IF_ROLE_STA0 #define BRCMF_E_IF_ROLE_AP 1 #define BRCMF_E_IF_ROLE_WDS2 +#define BRCMF_E_IF_ROLE_P2P_GO 3 +#define BRCMF_E_IF_ROLE_P2P_CLIENT 4 /** * definitions for event packet validation. -- 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
Re: full mac driver supporting monitor mode
On 09/12/14 01:47, Qiang He wrote: Hi Arend, I get information from http://wireless.kernel.org/en/users/Drivers/brcm80211 that monitor mode for full mac driver will added in the future. /"To be done for fullmac driver Add support for debugfs (for accessing counters and other diagnostic info) monitor mode Add support for more chips."/ Does this have a schedule or is there any information about monitor mode before released? Main part of the work is in firmware. I did some investigation on this a while ago and started on firmware changes for it. However, that work went in the drawer, but there seems to be other picking up the task. I do not have enough info to give a timeline here. Regards, Arend -- 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
[PATCHv2 15/16] mwifiex: add rx workqueue support
This patch adds RX work queue support to mwifiex. Packets received are queued to internal queue which are then processed by scheduling a work item for RX process. RX work is enabled only on SMP systems. Reviewed-by: James Cameron Signed-off-by: Avinash Patil Signed-off-by: Marc Yang Signed-off-by: Cathy Luo --- drivers/net/wireless/mwifiex/11n_rxreorder.c | 14 + drivers/net/wireless/mwifiex/init.c | 19 ++ drivers/net/wireless/mwifiex/main.c | 91 drivers/net/wireless/mwifiex/main.h | 14 + drivers/net/wireless/mwifiex/pcie.c | 12 +++- drivers/net/wireless/mwifiex/sdio.c | 11 +++- 6 files changed, 159 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.c b/drivers/net/wireless/mwifiex/11n_rxreorder.c index 06a2c21..4005707 100644 --- a/drivers/net/wireless/mwifiex/11n_rxreorder.c +++ b/drivers/net/wireless/mwifiex/11n_rxreorder.c @@ -183,6 +183,15 @@ mwifiex_del_rx_reorder_entry(struct mwifiex_private *priv, if (!tbl) return; + spin_lock_irqsave(&priv->adapter->rx_proc_lock, flags); + priv->adapter->rx_locked = true; + if (priv->adapter->rx_processing) { + spin_unlock_irqrestore(&priv->adapter->rx_proc_lock, flags); + flush_workqueue(priv->adapter->rx_workqueue); + } else { + spin_unlock_irqrestore(&priv->adapter->rx_proc_lock, flags); + } + start_win = (tbl->start_win + tbl->win_size) & (MAX_TID_VALUE - 1); mwifiex_11n_dispatch_pkt_until_start_win(priv, tbl, start_win); @@ -194,6 +203,11 @@ mwifiex_del_rx_reorder_entry(struct mwifiex_private *priv, kfree(tbl->rx_reorder_ptr); kfree(tbl); + + spin_lock_irqsave(&priv->adapter->rx_proc_lock, flags); + priv->adapter->rx_locked = false; + spin_unlock_irqrestore(&priv->adapter->rx_proc_lock, flags); + } /* diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c index cd9baad..f7c97cf 100644 --- a/drivers/net/wireless/mwifiex/init.c +++ b/drivers/net/wireless/mwifiex/init.c @@ -447,8 +447,11 @@ int mwifiex_init_lock_list(struct mwifiex_adapter *adapter) spin_lock_init(&adapter->cmd_free_q_lock); spin_lock_init(&adapter->cmd_pending_q_lock); spin_lock_init(&adapter->scan_pending_q_lock); + spin_lock_init(&adapter->rx_q_lock); + spin_lock_init(&adapter->rx_proc_lock); skb_queue_head_init(&adapter->usb_rx_data_q); + skb_queue_head_init(&adapter->rx_data_q); for (i = 0; i < adapter->priv_num; ++i) { INIT_LIST_HEAD(&adapter->bss_prio_tbl[i].bss_prio_head); @@ -614,6 +617,7 @@ mwifiex_shutdown_drv(struct mwifiex_adapter *adapter) int ret = -EINPROGRESS; struct mwifiex_private *priv; s32 i; + unsigned long flags; struct sk_buff *skb; /* mwifiex already shutdown */ @@ -648,6 +652,21 @@ mwifiex_shutdown_drv(struct mwifiex_adapter *adapter) } } + spin_lock_irqsave(&adapter->rx_proc_lock, flags); + + while ((skb = skb_dequeue(&adapter->rx_data_q))) { + struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); + + atomic_dec(&adapter->rx_pending); + priv = adapter->priv[rx_info->bss_num]; + if (priv) + priv->stats.rx_dropped++; + + dev_kfree_skb_any(skb); + } + + spin_unlock_irqrestore(&adapter->rx_proc_lock, flags); + spin_lock(&adapter->mwifiex_lock); if (adapter->if_ops.data_complete) { diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index f139386..b522f7c 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c @@ -126,6 +126,42 @@ static int mwifiex_unregister(struct mwifiex_adapter *adapter) return 0; } +static int mwifiex_process_rx(struct mwifiex_adapter *adapter) +{ + unsigned long flags; + struct sk_buff *skb; + bool delay_main_work = adapter->delay_main_work; + + spin_lock_irqsave(&adapter->rx_proc_lock, flags); + if (adapter->rx_processing || adapter->rx_locked) { + spin_unlock_irqrestore(&adapter->rx_proc_lock, flags); + goto exit_rx_proc; + } else { + adapter->rx_processing = true; + spin_unlock_irqrestore(&adapter->rx_proc_lock, flags); + } + + /* Check for Rx data */ + while ((skb = skb_dequeue(&adapter->rx_data_q))) { + atomic_dec(&adapter->rx_pending); + if (adapter->delay_main_work && + (atomic_dec_return(&adapter->rx_pending) < +LOW_RX_PENDING)) { + adapter->delay_main_work = false; + queue_work(adapter->rx_workqueue, &adapter->rx_work); + } +
[PATCHv2 11/16] mwifiex: remove restriction of single channel scan when connected
With scan channel gap in place, FW comes back to connected channel after each scan; so we dont need to restrict FW to scan single channel while connected. Signed-off-by: Avinash Patil Signed-off-by: Amitkumar Karwar Signed-off-by: Marc Yang Signed-off-by: Cathy Luo --- drivers/net/wireless/mwifiex/scan.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index 6fd69af..7c85f61 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c @@ -1067,12 +1067,6 @@ mwifiex_config_scan(struct mwifiex_private *priv, *filtered_scan); } - /* -* In associated state we will reduce the number of channels scanned per -* scan command to 1 to avoid any traffic delay/loss. -*/ - if (priv->media_connected) - *max_chan_per_scan = 1; } /* -- 1.8.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
[PATCHv2 05/16] mwifiex: support for event done interrupt
This patch adds support for writing CPU event interrupt done back to device. Patch also increases interrupt buffer ring size from 4 to 8. Signed-off-by: Avinash Patil Signed-off-by: Cathy Luo --- drivers/net/wireless/mwifiex/pcie.c | 7 +++ drivers/net/wireless/mwifiex/pcie.h | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c index 27c2bf8..2ada1b7 100644 --- a/drivers/net/wireless/mwifiex/pcie.c +++ b/drivers/net/wireless/mwifiex/pcie.c @@ -1726,6 +1726,13 @@ static int mwifiex_pcie_process_event_ready(struct mwifiex_adapter *adapter) buffer is released. This is just to make things simpler, we need to find a better method of managing these buffers. */ + } else { + if (mwifiex_write_reg(adapter, PCIE_CPU_INT_EVENT, + CPU_INTR_EVENT_DONE)) { + dev_warn(adapter->dev, +"Write register failed\n"); + return -1; + } } return 0; diff --git a/drivers/net/wireless/mwifiex/pcie.h b/drivers/net/wireless/mwifiex/pcie.h index a1a8fd3..200e8b0 100644 --- a/drivers/net/wireless/mwifiex/pcie.h +++ b/drivers/net/wireless/mwifiex/pcie.h @@ -40,8 +40,8 @@ #define MWIFIEX_TXBD_MASK 0x3F #define MWIFIEX_RXBD_MASK 0x3F -#define MWIFIEX_MAX_EVT_BD 0x04 -#define MWIFIEX_EVTBD_MASK 0x07 +#define MWIFIEX_MAX_EVT_BD 0x08 +#define MWIFIEX_EVTBD_MASK 0x0f /* PCIE INTERNAL REGISTERS */ #define PCIE_SCRATCH_0_REG 0xC10 @@ -69,6 +69,7 @@ #define CPU_INTR_DOOR_BELL BIT(1) #define CPU_INTR_SLEEP_CFM_DONEBIT(2) #define CPU_INTR_RESET BIT(3) +#define CPU_INTR_EVENT_DONEBIT(5) #define HOST_INTR_DNLD_DONEBIT(0) #define HOST_INTR_UPLD_RDY BIT(1) -- 1.8.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
[PATCHv2 13/16] mwifiex: remove redundant variable report_scan_result
From: Amitkumar Karwar This variable is never used, get rid of it. Signed-off-by: Amitkumar Karwar Signed-off-by: Avinash Patil --- drivers/net/wireless/mwifiex/main.h| 1 - drivers/net/wireless/mwifiex/scan.c| 3 --- drivers/net/wireless/mwifiex/sta_cmdresp.c | 2 -- 3 files changed, 6 deletions(-) diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index c3d097c..651fd8c 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h @@ -548,7 +548,6 @@ struct mwifiex_private { u8 nick_name[16]; u16 current_key_index; struct semaphore async_sem; - u8 report_scan_result; struct cfg80211_scan_request *scan_request; u8 cfg_bssid[6]; struct wps wps; diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index 7c85f61..7b07da2 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c @@ -1778,9 +1778,6 @@ static void mwifiex_check_next_scan_command(struct mwifiex_private *priv) if (!adapter->ext_scan) mwifiex_complete_scan(priv); - if (priv->report_scan_result) - priv->report_scan_result = false; - if (priv->scan_request) { dev_dbg(adapter->dev, "info: notifying scan done\n"); cfg80211_scan_done(priv->scan_request, 0); diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c index 62866b0..4aad446 100644 --- a/drivers/net/wireless/mwifiex/sta_cmdresp.c +++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c @@ -85,8 +85,6 @@ mwifiex_process_cmdresp_error(struct mwifiex_private *priv, spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); adapter->scan_processing = false; spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); - if (priv->report_scan_result) - priv->report_scan_result = false; break; case HostCmd_CMD_MAC_CONTROL: -- 1.8.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
[PATCHv2 16/16] mwifiex: modify TX/RX window sizes for AP interface
This patch sets uAP BA window sizes to 64. Signed-off-by: Avinash Patil --- drivers/net/wireless/mwifiex/decl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mwifiex/decl.h b/drivers/net/wireless/mwifiex/decl.h index 0e03fe3..e0d00a7 100644 --- a/drivers/net/wireless/mwifiex/decl.h +++ b/drivers/net/wireless/mwifiex/decl.h @@ -48,8 +48,8 @@ #define MWIFIEX_UAP_AMPDU_DEF_RXWINSIZE16 #define MWIFIEX_11AC_STA_AMPDU_DEF_TXWINSIZE 64 #define MWIFIEX_11AC_STA_AMPDU_DEF_RXWINSIZE 64 -#define MWIFIEX_11AC_UAP_AMPDU_DEF_TXWINSIZE 48 -#define MWIFIEX_11AC_UAP_AMPDU_DEF_RXWINSIZE 32 +#define MWIFIEX_11AC_UAP_AMPDU_DEF_TXWINSIZE 64 +#define MWIFIEX_11AC_UAP_AMPDU_DEF_RXWINSIZE 64 #define MWIFIEX_DEFAULT_BLOCK_ACK_TIMEOUT 0x -- 1.8.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
[PATCHv2 12/16] mwifiex: process TX even when scan is ongoing
With channel scan gap, FW comes back to connected channel after each single channel scan. So we can safely transfer data to FW during scan. FW would send this data once on connected channel. Signed-off-by: Avinash Patil Signed-off-by: Amitkumar Karwar Signed-off-by: Cathy Luo --- drivers/net/wireless/mwifiex/main.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index dfa37ea..d6d2342 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c @@ -284,8 +284,9 @@ process_start: adapter->tx_lock_flag) break; - if ((adapter->scan_processing && -!adapter->scan_delay_cnt) || adapter->data_sent || + if ((!adapter->scan_chan_gap_enabled && +!adapter->scan_delay_cnt && +adapter->scan_processing) || adapter->data_sent || mwifiex_wmm_lists_empty(adapter)) { if (adapter->cmd_sent || adapter->curr_cmd || (!is_command_pending(adapter))) @@ -339,7 +340,8 @@ process_start: } } - if ((!adapter->scan_processing || adapter->scan_delay_cnt) && + if ((adapter->scan_chan_gap_enabled || +(!adapter->scan_processing || adapter->scan_delay_cnt)) && !adapter->data_sent && !mwifiex_wmm_lists_empty(adapter)) { mwifiex_wmm_process_tx(adapter); if (adapter->hs_activated) { -- 1.8.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
[PATCHv2 10/16] mwifiex: bring in scan channel gap feature
With scan channel gap when any station/AP is active, FW comes back to connected channel for any pending data transfter after scanning each channel. We set scan channel gap TLV to FW in scan command when any of the interface is active. This enables scan channel gap in FW. Also when scan channel gap is enabled, we would scan maximum channels allowed by FW. Scan channel gap is supported only on FW with V15 FW API. Signed-off-by: Avinash Patil Signed-off-by: Amitkumar Karwar Signed-off-by: Marc Yang Signed-off-by: Cathy Luo --- drivers/net/wireless/mwifiex/cfg80211.c | 5 + drivers/net/wireless/mwifiex/cmdevt.c | 3 +++ drivers/net/wireless/mwifiex/fw.h | 10 +- drivers/net/wireless/mwifiex/init.c | 1 + drivers/net/wireless/mwifiex/main.h | 23 +++ drivers/net/wireless/mwifiex/scan.c | 17 + 6 files changed, 58 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 320512f..50cc0db 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c @@ -1990,6 +1990,11 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, user_scan_cfg->chan_list[i].scan_time = 0; } + if (priv->adapter->scan_chan_gap_enabled && + mwifiex_is_any_intf_active(priv)) + user_scan_cfg->scan_chan_gap = + priv->adapter->scan_chan_gap_time; + ret = mwifiex_scan_networks(priv, user_scan_cfg); kfree(user_scan_cfg); if (ret) { diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index fcc70ae..8559720 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c @@ -1613,5 +1613,8 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv, adapter->if_ops.update_mp_end_port(adapter, le16_to_cpu(hw_spec->mp_end_port)); + if (adapter->fw_api_ver == MWIFIEX_FW_V15) + adapter->scan_chan_gap_enabled = true; + return 0; } diff --git a/drivers/net/wireless/mwifiex/fw.h b/drivers/net/wireless/mwifiex/fw.h index 6a703ea..1eb6173 100644 --- a/drivers/net/wireless/mwifiex/fw.h +++ b/drivers/net/wireless/mwifiex/fw.h @@ -170,7 +170,8 @@ enum MWIFIEX_802_11_PRIVACY_FILTER { #define TLV_TYPE_COALESCE_RULE (PROPRIETARY_TLV_BASE_ID + 154) #define TLV_TYPE_KEY_PARAM_V2 (PROPRIETARY_TLV_BASE_ID + 156) #define TLV_TYPE_TDLS_IDLE_TIMEOUT (PROPRIETARY_TLV_BASE_ID + 194) -#define TLV_TYPE_API_REV (PROPRIETARY_TLV_BASE_ID + 199) +#define TLV_TYPE_SCAN_CHANNEL_GAP (PROPRIETARY_TLV_BASE_ID + 197) +#define TLV_TYPE_API_REV(PROPRIETARY_TLV_BASE_ID + 199) #define MWIFIEX_TX_DATA_BUF_SIZE_2K2048 @@ -653,6 +654,12 @@ struct mwifiex_ie_types_num_probes { __le16 num_probes; } __packed; +struct mwifiex_ie_types_scan_chan_gap { + struct mwifiex_ie_types_header header; + /* time gap in TUs to be used between two consecutive channels scan */ + __le16 chan_gap; +} __packed; + struct mwifiex_ie_types_wildcard_ssid_params { struct mwifiex_ie_types_header header; u8 max_ssid_length; @@ -1249,6 +1256,7 @@ struct mwifiex_user_scan_cfg { u8 num_ssids; /* Variable number (fixed maximum) of channels to scan up */ struct mwifiex_user_scan_chan chan_list[MWIFIEX_USER_SCAN_CHAN_MAX]; + u16 scan_chan_gap; } __packed; struct ie_body { diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c index 80bda80..d99c6f6 100644 --- a/drivers/net/wireless/mwifiex/init.c +++ b/drivers/net/wireless/mwifiex/init.c @@ -212,6 +212,7 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter) adapter->specific_scan_time = MWIFIEX_SPECIFIC_SCAN_CHAN_TIME; adapter->active_scan_time = MWIFIEX_ACTIVE_SCAN_CHAN_TIME; adapter->passive_scan_time = MWIFIEX_PASSIVE_SCAN_CHAN_TIME; + adapter->scan_chan_gap_time = MWIFIEX_DEF_SCAN_CHAN_GAP_TIME; adapter->scan_probes = 1; diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h index 5439963..c3d097c 100644 --- a/drivers/net/wireless/mwifiex/main.h +++ b/drivers/net/wireless/mwifiex/main.h @@ -84,6 +84,7 @@ enum { #define MWIFIEX_PASSIVE_SCAN_CHAN_TIME 110 #define MWIFIEX_ACTIVE_SCAN_CHAN_TIME 30 #define MWIFIEX_SPECIFIC_SCAN_CHAN_TIME30 +#define MWIFIEX_DEF_SCAN_CHAN_GAP_TIME 50 #define SCAN_RSSI(RSSI)(0x100 - ((u8)(RSSI))) @@ -770,6 +771,7 @@ struct mwifiex_adapter { u16 specific_scan_time; u16 active_scan_time; u16 passive_scan_time; + u16 scan_chan_gap_time; u8 fw_bands; u8 adhoc_start_band; u8 config_bands; @@ -839,6 +841,7 @@ struct mwifiex_adapter {
[PATCHv2 09/16] mwifiex: set passive scan type for scan requests with no ssid
It was observed that station would sent probe request even when scan type has been set as passive during iw scan. This was happening because driver sets passive scan type only when channel has IEEE80211_CHAN_NO_IR flag set. Along with this, add condition to check if no ssids are specified in scan request so as to mark such scan request passive. Signed-off-by: Avinash Patil --- drivers/net/wireless/mwifiex/cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index e2e6bf1..320512f 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c @@ -1980,7 +1980,7 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, user_scan_cfg->chan_list[i].chan_number = chan->hw_value; user_scan_cfg->chan_list[i].radio_type = chan->band; - if (chan->flags & IEEE80211_CHAN_NO_IR) + if ((chan->flags & IEEE80211_CHAN_NO_IR) || !request->n_ssids) user_scan_cfg->chan_list[i].scan_type = MWIFIEX_SCAN_TYPE_PASSIVE; else -- 1.8.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
[PATCHv2 14/16] mwifiex: remove low priority scan handling
From: Amitkumar Karwar We have a logic in driver to delay or abort low priority scan to serve Tx traffic effectively. With scan channel gap support added, firmware now allows driver to send Tx data while scan operation is in progress. Hence low priority scan handling in driver is not required now. This patch removes related code. Signed-off-by: Amitkumar Karwar Signed-off-by: Avinash Patil Signed-off-by: Cathy Luo --- drivers/net/wireless/mwifiex/cfg80211.c | 8 --- drivers/net/wireless/mwifiex/init.c | 1 - drivers/net/wireless/mwifiex/main.c | 96 + drivers/net/wireless/mwifiex/main.h | 10 drivers/net/wireless/mwifiex/scan.c | 59 ++-- 5 files changed, 30 insertions(+), 144 deletions(-) diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c index 50cc0db..1fd35be 100644 --- a/drivers/net/wireless/mwifiex/cfg80211.c +++ b/drivers/net/wireless/mwifiex/cfg80211.c @@ -1935,13 +1935,6 @@ mwifiex_cfg80211_scan(struct wiphy *wiphy, wiphy_dbg(wiphy, "info: received scan request on %s\n", dev->name); - if ((request->flags & NL80211_SCAN_FLAG_LOW_PRIORITY) && - atomic_read(&priv->wmm.tx_pkts_queued) >= - MWIFIEX_MIN_TX_PENDING_TO_CANCEL_SCAN) { - dev_dbg(priv->adapter->dev, "scan rejected due to traffic\n"); - return -EBUSY; - } - /* Block scan request if scan operation or scan cleanup when interface * is disabled is in process */ @@ -2919,7 +2912,6 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter) wiphy->features |= NL80211_FEATURE_HT_IBSS | NL80211_FEATURE_INACTIVITY_TIMER | - NL80211_FEATURE_LOW_PRIORITY_SCAN | NL80211_FEATURE_NEED_OBSS_SCAN; /* Reserve space for mwifiex specific private data for BSS */ diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c index d99c6f6..cd9baad 100644 --- a/drivers/net/wireless/mwifiex/init.c +++ b/drivers/net/wireless/mwifiex/init.c @@ -281,7 +281,6 @@ static void mwifiex_init_adapter(struct mwifiex_adapter *adapter) memset(&adapter->arp_filter, 0, sizeof(adapter->arp_filter)); adapter->arp_filter_size = 0; adapter->max_mgmt_ie_index = MAX_MGMT_IE_INDEX; - adapter->empty_tx_q_cnt = 0; adapter->ext_scan = true; adapter->key_api_major_ver = 0; adapter->key_api_minor_ver = 0; diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index d6d2342..f139386 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c @@ -28,91 +28,6 @@ const char driver_version[] = "mwifiex " VERSION " (%s) "; static char *cal_data_cfg; module_param(cal_data_cfg, charp, 0); -static void scan_delay_timer_fn(unsigned long data) -{ - struct mwifiex_private *priv = (struct mwifiex_private *)data; - struct mwifiex_adapter *adapter = priv->adapter; - struct cmd_ctrl_node *cmd_node, *tmp_node; - spinlock_t *scan_q_lock = &adapter->scan_pending_q_lock; - unsigned long flags; - - if (adapter->surprise_removed) - return; - - if (adapter->scan_delay_cnt == MWIFIEX_MAX_SCAN_DELAY_CNT || - !adapter->scan_processing) { - /* -* Abort scan operation by cancelling all pending scan -* commands -*/ - spin_lock_irqsave(scan_q_lock, flags); - list_for_each_entry_safe(cmd_node, tmp_node, -&adapter->scan_pending_q, list) { - list_del(&cmd_node->list); - mwifiex_insert_cmd_to_free_q(adapter, cmd_node); - } - spin_unlock_irqrestore(scan_q_lock, flags); - - spin_lock_irqsave(&adapter->mwifiex_cmd_lock, flags); - adapter->scan_processing = false; - adapter->scan_delay_cnt = 0; - adapter->empty_tx_q_cnt = 0; - spin_unlock_irqrestore(&adapter->mwifiex_cmd_lock, flags); - - if (priv->scan_request) { - dev_dbg(adapter->dev, "info: aborting scan\n"); - cfg80211_scan_done(priv->scan_request, 1); - priv->scan_request = NULL; - } else { - priv->scan_aborting = false; - dev_dbg(adapter->dev, "info: scan already aborted\n"); - } - goto done; - } - - if (!atomic_read(&priv->adapter->is_tx_received)) { - adapter->empty_tx_q_cnt++; - if (adapter->empty_tx_q_cnt == MWIFIEX_MAX_EMPTY_TX_Q_CNT) { - /* -* No Tx traffic for 200msec. Get scan command from -* sca
[PATCHv2 07/16] mwifiex: fix a bug in Tx multiport aggregation
From: Amitkumar Karwar When aggregation port limit is reached, we stop aggregation and the data is sent to firmware. It is observed that one less packet than the port limit is aggregated in this case. ex. 15 instead of 16. The reason is we have redundant port limit checks before current packet is added to aggregation buffer. The issue is fixed by removing these checks. We already have necessary check in precopy current buffer handling. Signed-off-by: Amitkumar Karwar Signed-off-by: Avinash Patil Signed-off-by: Bing Zhao --- drivers/net/wireless/mwifiex/sdio.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c index 1770fa3..993841e 100644 --- a/drivers/net/wireless/mwifiex/sdio.c +++ b/drivers/net/wireless/mwifiex/sdio.c @@ -1527,8 +1527,7 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter, __func__); if (MP_TX_AGGR_IN_PROGRESS(card)) { - if (!mp_tx_aggr_port_limit_reached(card) && - MP_TX_AGGR_BUF_HAS_ROOM(card, pkt_len)) { + if (MP_TX_AGGR_BUF_HAS_ROOM(card, pkt_len)) { f_precopy_cur_buf = 1; if (!(card->mp_wr_bitmap & @@ -1540,8 +1539,7 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter, /* No room in Aggr buf, send it */ f_send_aggr_buf = 1; - if (mp_tx_aggr_port_limit_reached(card) || - !(card->mp_wr_bitmap & + if (!(card->mp_wr_bitmap & (1 << card->curr_wr_port))) f_send_cur_buf = 1; else -- 1.8.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
[PATCHv2 06/16] mwifiex: fix 5G association failure after leaving 2.4G IBSS
From: Xinming Hu When assocaiting to an AP , mwifiex set supported data rates based on target AP's capability. For 5G AP(11a mode), a/n/ac mode would possibly be set. However, for some chips which dont support 11AC mode current config_bands will be used instead. For example, if we join an IBSS in 11b mode ,adapter->config_bands will be set to 1(11b mode). Then we leave IBSS ,and try to connect 5G a/n mode AP. At this time , only 11b mode data rates will be supported in assoc request , which result in assoc failure with reason code 18: Association denied due to requesting station not supporting all rates. This patch fix such a cornel case, by adding additional check for current chip's 11ac capability. Reported-by: Andreas Fenkart Signed-off-by: Xinming Hu Signed-off-by: Avinash Patil Signed-off-by: Amitkumar Karwar Signed-off-by: Marc Yang Signed-off-by: Cathy Luo --- drivers/net/wireless/mwifiex/sta_ioctl.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index b95a29b..92f3eb8 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c @@ -287,10 +287,13 @@ int mwifiex_bss_start(struct mwifiex_private *priv, struct cfg80211_bss *bss, return -1; if (mwifiex_band_to_radio_type(bss_desc->bss_band) == - HostCmd_SCAN_RADIO_TYPE_BG) + HostCmd_SCAN_RADIO_TYPE_BG) { config_bands = BAND_B | BAND_G | BAND_GN; - else - config_bands = BAND_A | BAND_AN | BAND_AAC; + } else { + config_bands = BAND_A | BAND_AN; + if (adapter->fw_bands & BAND_AAC) + config_bands |= BAND_AAC; + } if (!((config_bands | adapter->fw_bands) & ~adapter->fw_bands)) adapter->config_bands = config_bands; -- 1.8.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
[PATCHv2 08/16] mwifiex: minor cleanup in multiport aggregation
From: Amitkumar Karwar 'mp_data_port_mask' and 'mp_end_port' gives correct information even for the chipsets supporting SDIO new mode (32 ports). We will get rid of this chip specific handling. Signed-off-by: Amitkumar Karwar Signed-off-by: Avinash Patil Signed-off-by: Bing Zhao --- drivers/net/wireless/mwifiex/sdio.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c index 993841e..bdab122 100644 --- a/drivers/net/wireless/mwifiex/sdio.c +++ b/drivers/net/wireless/mwifiex/sdio.c @@ -622,22 +622,15 @@ static int mwifiex_get_wr_port_data(struct mwifiex_adapter *adapter, u32 *port) dev_dbg(adapter->dev, "data: mp_wr_bitmap=0x%08x\n", wr_bitmap); - if (card->supports_sdio_new_mode && - !(wr_bitmap & reg->data_port_mask)) { + if (!(wr_bitmap & card->mp_data_port_mask)) { adapter->data_sent = true; return -EBUSY; - } else if (!card->supports_sdio_new_mode && - !(wr_bitmap & card->mp_data_port_mask)) { - return -1; } if (card->mp_wr_bitmap & (1 << card->curr_wr_port)) { card->mp_wr_bitmap &= (u32) (~(1 << card->curr_wr_port)); *port = card->curr_wr_port; - if (((card->supports_sdio_new_mode) && -(++card->curr_wr_port == card->max_ports)) || - ((!card->supports_sdio_new_mode) && -(++card->curr_wr_port == card->mp_end_port))) + if (++card->curr_wr_port == card->mp_end_port) card->curr_wr_port = reg->start_wr_port; } else { adapter->data_sent = true; -- 1.8.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
[PATCHv2 01/16] mwifiex: set fw api info for backword compatibility
If we dont set FW API info here, for older FW releases where FW API is not available in GET_HW_SPEC, API version would remain 0. This may cause issues with 11ac if older FW is used with newer driver. Signed-off-by: Avinash Patil --- drivers/net/wireless/mwifiex/cmdevt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c index 985f6c2..fcc70ae 100644 --- a/drivers/net/wireless/mwifiex/cmdevt.c +++ b/drivers/net/wireless/mwifiex/cmdevt.c @@ -1508,6 +1508,7 @@ int mwifiex_ret_get_hw_spec(struct mwifiex_private *priv, } adapter->fw_release_number = le32_to_cpu(hw_spec->fw_release_number); + adapter->fw_api_ver = (adapter->fw_release_number >> 16) & 0xff; adapter->number_of_antenna = le16_to_cpu(hw_spec->number_of_antenna); if (le32_to_cpu(hw_spec->dot_11ac_dev_cap)) { -- 1.8.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
[PATCHv2 02/16] mwifiex: fix probable memory corruption while processing TDLS frame
Size of RSN IE buffer in driver is 254 while maximum size of received buffer to be copied to RSN IE buffer can be 255. Add boundary check to copy maximum of 254 bytes into RSN IE buffer. Reported-by: Dan Carpenter Signed-off-by: Avinash Patil --- drivers/net/wireless/mwifiex/tdls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mwifiex/tdls.c b/drivers/net/wireless/mwifiex/tdls.c index 4c5fd95..e294907 100644 --- a/drivers/net/wireless/mwifiex/tdls.c +++ b/drivers/net/wireless/mwifiex/tdls.c @@ -871,7 +871,9 @@ void mwifiex_process_tdls_action_frame(struct mwifiex_private *priv, break; case WLAN_EID_RSN: memcpy((u8 *)&sta_ptr->tdls_cap.rsn_ie, pos, - sizeof(struct ieee_types_header) + pos[1]); + sizeof(struct ieee_types_header) + + min_t(u8, pos[1], IEEE_MAX_IE_SIZE - +sizeof(struct ieee_types_header))); break; case WLAN_EID_QOS_CAPA: sta_ptr->tdls_cap.qos_info = pos[2]; -- 1.8.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
[PATCHv2 04/16] mwifiex: rework internal scan for association
There was an issue with internal scan during association wherein we would complete internal scan on first scan command response. This would cause association failure if AP is not found in first scan response e.g. APs from A band. This patch fixes this issue by completing internal scan only when all scan commands from scan pending queue and command pending queue are sent to FW and response to last scan command is received. Tested-by: Xinmin Hu Signed-off-by: Avinash Patil Signed-off-by: Amitkumar Karwar Signed-off-by: Marc Yang Signed-off-by: Cathy Luo --- drivers/net/wireless/mwifiex/scan.c | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index dee717a..bec48cc 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c @@ -1970,9 +1970,34 @@ int mwifiex_cmd_802_11_scan_ext(struct mwifiex_private *priv, /* This function handles the command response of extended scan */ int mwifiex_ret_802_11_scan_ext(struct mwifiex_private *priv) { + struct mwifiex_adapter *adapter = priv->adapter; + struct host_cmd_ds_command *cmd_ptr; + struct cmd_ctrl_node *cmd_node; + unsigned long cmd_flags, scan_flags; + bool complete_scan = false; + dev_dbg(priv->adapter->dev, "info: EXT scan returns successfully\n"); - mwifiex_complete_scan(priv); + spin_lock_irqsave(&adapter->cmd_pending_q_lock, cmd_flags); + spin_lock_irqsave(&adapter->scan_pending_q_lock, scan_flags); + if (list_empty(&adapter->scan_pending_q)) { + complete_scan = true; + list_for_each_entry(cmd_node, &adapter->cmd_pending_q, list) { + cmd_ptr = (void *)cmd_node->cmd_skb->data; + if (le16_to_cpu(cmd_ptr->command) == + HostCmd_CMD_802_11_SCAN_EXT) { + dev_dbg(priv->adapter->dev, + "Scan pending in command pending list"); + complete_scan = false; + break; + } + } + } + spin_unlock_irqrestore(&adapter->scan_pending_q_lock, scan_flags); + spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, cmd_flags); + + if (complete_scan) + mwifiex_complete_scan(priv); return 0; } -- 1.8.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
[PATCHv2 03/16] mwifiex: avoid processing RX packets with invalid length
If rx_len received in interface header from FW is more than RX buffer size, skb_put for such length results into skb_panic. Avoid this by not processing such packets. We just print a warning for such packets and free skb. Reviewed-by: Paul Stewart Signed-off-by: Avinash Patil Signed-off-by: Amitkumar Karwar Signed-off-by: Bing Zhao Signed-off-by: Marc Yang --- drivers/net/wireless/mwifiex/pcie.c | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c index ff05458..27c2bf8 100644 --- a/drivers/net/wireless/mwifiex/pcie.c +++ b/drivers/net/wireless/mwifiex/pcie.c @@ -1271,12 +1271,20 @@ static int mwifiex_pcie_process_recv_data(struct mwifiex_adapter *adapter) */ pkt_len = *((__le16 *)skb_data->data); rx_len = le16_to_cpu(pkt_len); - skb_put(skb_data, rx_len); - dev_dbg(adapter->dev, - "info: RECV DATA: Rd=%#x, Wr=%#x, Len=%d\n", - card->rxbd_rdptr, wrptr, rx_len); - skb_pull(skb_data, INTF_HEADER_LEN); - mwifiex_handle_rx_packet(adapter, skb_data); + if (WARN_ON(rx_len <= INTF_HEADER_LEN || + rx_len > MWIFIEX_RX_DATA_BUF_SIZE)) { + dev_err(adapter->dev, + "Invalid RX len %d, Rd=%#x, Wr=%#x\n", + rx_len, card->rxbd_rdptr, wrptr); + dev_kfree_skb_any(skb_data); + } else { + skb_put(skb_data, rx_len); + dev_dbg(adapter->dev, + "info: RECV DATA: Rd=%#x, Wr=%#x, Len=%d\n", + card->rxbd_rdptr, wrptr, rx_len); + skb_pull(skb_data, INTF_HEADER_LEN); + mwifiex_handle_rx_packet(adapter, skb_data); + } skb_tmp = dev_alloc_skb(MWIFIEX_RX_DATA_BUF_SIZE); if (!skb_tmp) { -- 1.8.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
[PATCHv2 00/16] mwifiex updates for 3.18
This patchset brings in channel scan gap & RX work queue support to mwifiex. With channel scan gap in, we remove low priority scan handling feature. Patset also includes trivial fixes for SDIO multiport aggregation, one fix for A band association. Amitkumar Karwar (4): mwifiex: fix a bug in Tx multiport aggregation mwifiex: minor cleanup in multiport aggregation mwifiex: remove redundant variable report_scan_result mwifiex: remove low priority scan handling Avinash Patil (11): mwifiex: set fw api info for backword compatibility mwifiex: fix probable memory corruption while processing TDLS frame mwifiex: avoid processing RX packets with invalid length mwifiex: rework internal scan for association mwifiex: support for event done interrupt mwifiex: set passive scan type for scan requests with no ssid mwifiex: bring in scan channel gap feature mwifiex: remove restriction of single channel scan when connected mwifiex: process TX even when scan is ongoing mwifiex: add rx workqueue support mwifiex: modify TX/RX window sizes for AP interface Xinming Hu (1): mwifiex: fix 5G association failure after leaving 2.4G IBSS drivers/net/wireless/mwifiex/11n_rxreorder.c | 14 ++ drivers/net/wireless/mwifiex/cfg80211.c | 14 +- drivers/net/wireless/mwifiex/cmdevt.c| 4 + drivers/net/wireless/mwifiex/decl.h | 4 +- drivers/net/wireless/mwifiex/fw.h| 10 +- drivers/net/wireless/mwifiex/init.c | 21 ++- drivers/net/wireless/mwifiex/main.c | 191 +-- drivers/net/wireless/mwifiex/main.h | 48 +-- drivers/net/wireless/mwifiex/pcie.c | 37 +- drivers/net/wireless/mwifiex/pcie.h | 5 +- drivers/net/wireless/mwifiex/scan.c | 108 ++- drivers/net/wireless/mwifiex/sdio.c | 28 ++-- drivers/net/wireless/mwifiex/sta_cmdresp.c | 2 - drivers/net/wireless/mwifiex/sta_ioctl.c | 9 +- drivers/net/wireless/mwifiex/tdls.c | 4 +- 15 files changed, 317 insertions(+), 182 deletions(-) -- 1.8.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 2/2] b43: HT-PHY: Update values for frequency calibration
Previous values were extracted from MMIO dump of some old 5.x driver, new ones should improve calibration. This also adds values for 5 GHz. Signed-off-by: Rafał Miłecki --- drivers/net/wireless/b43/radio_2059.c | 314 +++--- 1 file changed, 248 insertions(+), 66 deletions(-) diff --git a/drivers/net/wireless/b43/radio_2059.c b/drivers/net/wireless/b43/radio_2059.c index b2a53b2..a3cf9ef 100644 --- a/drivers/net/wireless/b43/radio_2059.c +++ b/drivers/net/wireless/b43/radio_2059.c @@ -65,73 +65,87 @@ static u16 r2059_phy_rev1_init[][2] = { .phy_regs.bw5 = r4, \ .phy_regs.bw6 = r5 +/* Extracted from MMIO dump of 6.30.223.141 + * TODO: Values for channels 12 & 13 are outdated (from some old 5.x driver)! + */ static const struct b43_phy_ht_channeltab_e_radio2059 b43_phy_ht_channeltab_radio2059[] = { - {.freq = 2412, - RADIOREGS(0x48, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x6c, - 0x09, 0x0f, 0x0a, 0x00, 0x0a, 0x00, 0x61, 0x03, - 0x00, 0x00, 0x00, 0xf0, 0x00), - PHYREGS(0x03c9, 0x03c5, 0x03c1, 0x043a, 0x043f, 0x0443), - }, - {.freq = 2417, - RADIOREGS(0x4b, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x71, - 0x09, 0x0f, 0x0a, 0x00, 0x0a, 0x00, 0x61, 0x03, - 0x00, 0x00, 0x00, 0xf0, 0x00), - PHYREGS(0x03cb, 0x03c7, 0x03c3, 0x0438, 0x043d, 0x0441), - }, - {.freq = 2422, - RADIOREGS(0x4e, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x76, - 0x09, 0x0f, 0x09, 0x00, 0x09, 0x00, 0x61, 0x03, - 0x00, 0x00, 0x00, 0xf0, 0x00), - PHYREGS(0x03cd, 0x03c9, 0x03c5, 0x0436, 0x043a, 0x043f), - }, - {.freq = 2427, - RADIOREGS(0x52, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x7b, - 0x09, 0x0f, 0x09, 0x00, 0x09, 0x00, 0x61, 0x03, - 0x00, 0x00, 0x00, 0xf0, 0x00), - PHYREGS(0x03cf, 0x03cb, 0x03c7, 0x0434, 0x0438, 0x043d), - }, - {.freq = 2432, - RADIOREGS(0x55, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x80, - 0x09, 0x0f, 0x08, 0x00, 0x08, 0x00, 0x61, 0x03, - 0x00, 0x00, 0x00, 0xf0, 0x00), - PHYREGS(0x03d1, 0x03cd, 0x03c9, 0x0431, 0x0436, 0x043a), - }, - {.freq = 2437, - RADIOREGS(0x58, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x85, - 0x09, 0x0f, 0x08, 0x00, 0x08, 0x00, 0x61, 0x03, - 0x00, 0x00, 0x00, 0xf0, 0x00), - PHYREGS(0x03d3, 0x03cf, 0x03cb, 0x042f, 0x0434, 0x0438), - }, - {.freq = 2442, - RADIOREGS(0x5c, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x8a, - 0x09, 0x0f, 0x07, 0x00, 0x07, 0x00, 0x61, 0x03, - 0x00, 0x00, 0x00, 0xf0, 0x00), - PHYREGS(0x03d5, 0x03d1, 0x03cd, 0x042d, 0x0431, 0x0436), - }, - {.freq = 2447, - RADIOREGS(0x5f, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x8f, - 0x09, 0x0f, 0x07, 0x00, 0x07, 0x00, 0x61, 0x03, - 0x00, 0x00, 0x00, 0xf0, 0x00), - PHYREGS(0x03d7, 0x03d3, 0x03cf, 0x042b, 0x042f, 0x0434), - }, - {.freq = 2452, - RADIOREGS(0x62, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x94, - 0x09, 0x0f, 0x07, 0x00, 0x07, 0x00, 0x61, 0x03, - 0x00, 0x00, 0x00, 0xf0, 0x00), - PHYREGS(0x03d9, 0x03d5, 0x03d1, 0x0429, 0x042d, 0x0431), - }, - {.freq = 2457, - RADIOREGS(0x66, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x99, - 0x09, 0x0f, 0x06, 0x00, 0x06, 0x00, 0x61, 0x03, - 0x00, 0x00, 0x00, 0xf0, 0x00), - PHYREGS(0x03db, 0x03d7, 0x03d3, 0x0427, 0x042b, 0x042f), - }, - {.freq = 2462, - RADIOREGS(0x69, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x9e, - 0x09, 0x0f, 0x06, 0x00, 0x06, 0x00, 0x61, 0x03, - 0x00, 0x00, 0x00, 0xf0, 0x00), - PHYREGS(0x03dd, 0x03d9, 0x03d5, 0x0424, 0x0429, 0x042d), - }, + { + .freq = 2412, + RADIOREGS(0x48, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x6c, + 0x09, 0x0f, 0x0a, 0x00, 0x0a, 0x00, 0x61, 0x73, + 0x00, 0x00, 0x00, 0xd0, 0x00), + PHYREGS(0x03c9, 0x03c5, 0x03c1, 0x043a, 0x043f, 0x0443), + }, + { + .freq = 2417, + RADIOREGS(0x4b, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x71, + 0x09, 0x0f, 0x0a, 0x00, 0x0a, 0x00, 0x61, 0x73, + 0x00, 0x00, 0x00, 0xd0, 0x00), + PHYREGS(0x03cb, 0x03c7, 0x03c3, 0x0438, 0x043d, 0x0441), + }, + { + .freq = 2422, + RADIOREGS(0x4e, 0x16, 0x30, 0x1b, 0x0a, 0x0a, 0x30, 0x76, + 0x09, 0x0f, 0x09, 0x00, 0x09, 0x00, 0x61, 0x73, +
[PATCH 1/2] b43: HT-PHY: Implement band switching
It works pretty much the same way as in N-PHY. Signed-off-by: Rafał Miłecki --- drivers/net/wireless/b43/b43.h| 5 + drivers/net/wireless/b43/phy_ht.c | 38 -- drivers/net/wireless/b43/phy_ht.h | 3 +++ 3 files changed, 40 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h index 95a9433..a980595 100644 --- a/drivers/net/wireless/b43/b43.h +++ b/drivers/net/wireless/b43/b43.h @@ -476,6 +476,11 @@ enum { #define B43_MACCMD_CCA 0x0008 /* Clear channel assessment */ #define B43_MACCMD_BGNOISE 0x0010 /* Background noise */ +/* B43_MMIO_PSM_PHY_HDR bits */ +#define B43_PSM_HDR_MAC_PHY_RESET 0x0001 +#define B43_PSM_HDR_MAC_PHY_CLOCK_EN 0x0002 +#define B43_PSM_HDR_MAC_PHY_FORCE_CLK 0x0004 + /* See BCMA_CLKCTLST_EXTRESREQ and BCMA_CLKCTLST_EXTRESST */ #define B43_BCMA_CLKCTLST_80211_PLL_REQ0x0100 #define B43_BCMA_CLKCTLST_PHY_PLL_REQ 0x0200 diff --git a/drivers/net/wireless/b43/phy_ht.c b/drivers/net/wireless/b43/phy_ht.c index a379602..6a0140a 100644 --- a/drivers/net/wireless/b43/phy_ht.c +++ b/drivers/net/wireless/b43/phy_ht.c @@ -321,6 +321,26 @@ static void b43_phy_ht_bphy_init(struct b43_wldev *dev) b43_phy_write(dev, B43_PHY_N_BMODE(0x38), 0x668); } +static void b43_phy_ht_bphy_reset(struct b43_wldev *dev, bool reset) +{ + u16 tmp; + + tmp = b43_read16(dev, B43_MMIO_PSM_PHY_HDR); + b43_write16(dev, B43_MMIO_PSM_PHY_HDR, + tmp | B43_PSM_HDR_MAC_PHY_FORCE_CLK); + + /* Put BPHY in or take it out of the reset */ + if (reset) + b43_phy_set(dev, B43_PHY_B_BBCFG, + B43_PHY_B_BBCFG_RSTCCA | B43_PHY_B_BBCFG_RSTRX); + else + b43_phy_mask(dev, B43_PHY_B_BBCFG, +(u16)~(B43_PHY_B_BBCFG_RSTCCA | + B43_PHY_B_BBCFG_RSTRX)); + + b43_write16(dev, B43_MMIO_PSM_PHY_HDR, tmp); +} + /** * Samples **/ @@ -757,13 +777,19 @@ static void b43_phy_ht_channel_setup(struct b43_wldev *dev, const struct b43_phy_ht_channeltab_e_phy *e, struct ieee80211_channel *new_channel) { - bool old_band_5ghz; + if (new_channel->band == IEEE80211_BAND_5GHZ) { + /* Switch to 2 GHz for a moment to access B-PHY regs */ + b43_phy_mask(dev, B43_PHY_HT_BANDCTL, ~B43_PHY_HT_BANDCTL_5GHZ); + + b43_phy_ht_bphy_reset(dev, true); + + /* Switch to 5 GHz */ + b43_phy_set(dev, B43_PHY_HT_BANDCTL, B43_PHY_HT_BANDCTL_5GHZ); + } else { + /* Switch to 2 GHz */ + b43_phy_mask(dev, B43_PHY_HT_BANDCTL, ~B43_PHY_HT_BANDCTL_5GHZ); - old_band_5ghz = b43_phy_read(dev, B43_PHY_HT_BANDCTL) & 0; /* FIXME */ - if (new_channel->band == IEEE80211_BAND_5GHZ && !old_band_5ghz) { - /* TODO */ - } else if (new_channel->band == IEEE80211_BAND_2GHZ && old_band_5ghz) { - /* TODO */ + b43_phy_ht_bphy_reset(dev, false); } b43_phy_write(dev, B43_PHY_HT_BW1, e->bw1); diff --git a/drivers/net/wireless/b43/phy_ht.h b/drivers/net/wireless/b43/phy_ht.h index 67b208e..c086f56 100644 --- a/drivers/net/wireless/b43/phy_ht.h +++ b/drivers/net/wireless/b43/phy_ht.h @@ -106,6 +106,9 @@ #define B43_PHY_HT_TXPCTL_TARG_PWR2_C3_SHIFT 0 #define B43_PHY_HT_TX_PCTL_STATUS_C3 B43_PHY_EXTG(0x169) +#define B43_PHY_B_BBCFGB43_PHY_N_BMODE(0x001) +#define B43_PHY_B_BBCFG_RSTCCA0x4000 /* Reset CCA */ +#define B43_PHY_B_BBCFG_RSTRX 0x8000 /* Reset RX */ #define B43_PHY_HT_TESTB43_PHY_N_BMODE(0x00A) -- 1.8.4.5 -- 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: Rtl8187se regression [was: rtl8187se - serious regressions since merge out of staging into 818x]
Hi Anrea, Larry, I used the new driver (still without the latest patches) only in hotels slow DSL/Wireless environment and there I noted no regression. Because of the problems I'am going now to a special site, where I have a local networks (LAN/WLAN), good internet connection and root access to Linux machines. This should be a good thing to do real testing. 1.) Andrea, can you resend me the latest patches (perhaps against 3.16) please? (only to confirm that we are in "synchronous" mode.) 2.) Andrea, Larry, John are you interested to have root access to my laptop using the rtl8187se? (Perhaps it can stay there over the weekend too.) 3.) My test for maximal troughput is to run a connection /dev/zero -> nc ->|-> nc -> /dev/null. Any other ideas? 4.) I think to have this setup ready about 11:30 UTC. I'am open to any suggestion from your side. Bernhard Am Freitag, 12. September 2014, 02:18:03 schrieb Andrea Merello: > My aplogies for this quick and a bit messy reply: I m from mobile. > > @Xose > Thank you for forwarding me that. I wasn t aware of it. > > (BTW a couple of other people reported a similar issue) > > @Ralf > The driver still have some not implemented features, including signal > strenght measure, furthermore some fixes that might improve performances > should be on the way for 3.17. > > @Larry, Bernhard > I think those fixes was basically the same of some RFT patch I sent you > some time ago.. > Have you had any occasion to test those patches? > > @Ralf, all.. > I must say that I never been able to reproduce any severe performance > regression here, for this reason I'm asking people who reports this to make > some testing for me if possible.. > > Here you can find a similar report and my answer where I asked for the > tests: > https://bugzilla.kernel.org/show_bug.cgi?id=83631 > > If you could do some of those test for me, that would be great. > -- 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: Not reaching optimum speeds with IEEE 802.11n
On Fri, Sep 12, 2014 at 4:11 AM, Sourav wrote: > On 11/09/14 00:14, Helmut Schaa wrote: >> >> On Wed, Sep 10, 2014 at 10:42 AM, Arend van Spriel >> wrote: >>> >>> On 09/10/14 03:26, Sourav wrote: We are using Ralink chip Rt3072L (using rt2800usb drivers rt2800usb.c), >> >> The Ralink USB hardware is quite bad in reporting TX status and as >> such minstrel_ht cannot do proper rate selection. >> If you watch the rc stats at >> >> /sys/kernel/debug/ieee80211/phy0/netdev\:wlan0-0/stations/xx:xx:xx:xx:xx:xx/rc_stats >> you might see a lot of rate selection "hopping". >> >> Regards. >> Helmut > > please take a look at the attachments the first one shows the rc_stats > and iperf stats side by side on the router(iperf is running in client mode > in the router).the second attachment is from a laptop which is running > iperf in server mode. > > I don't see a lot of rate "hopping" in the rc_stats file, (T,t and P) rates > are pretty much stable yet there is a big difference between those rates > and the throughput using iperf.. Indeed, rc_stats looks acceptable. > when you say "Ralink USB hardware is quite bad in reporting TX status", do > you mean that the HW reports less tx rate to minstrel_ht and so its rate > calculation is screwed up? The HW sometimes does not report the status of transmitted frames correctly. The TX status register is a FIFO of 16 (or similar) elements and if the driver is not reading it "fast enough" the FIFO will overflow :( at least that was the point when I was looking at the ralink hardware last time. Not sure if something changed recently. > Can you please let me know the section of code inside Rc_80211_minstrel_ht.c > (or somewhere else) which deals with getting the tx rate from ralink HW? There is no special code in minstrel(_ht) in regard to rt2x00. Are you able able to get some statistics on the receiver side (your windows machine) regarding TX rates and AMPDU lengths? Helmut -- 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] hostap: proc: substitute loops by %*phN
On Thu, 2014-09-11 at 15:27 -0400, John W. Linville wrote: > Applying: hostap: proc: substitute loops by %*phN > error: patch failed: drivers/net/wireless/hostap/hostap_proc.c:184 > error: drivers/net/wireless/hostap/hostap_proc.c: patch does not apply Hmm... Originally it was applied on top of linux-next (few days ago). Just checking with current origin/master. Applied correctly. Moreover, took recent wireless-next. No issues. Which tree you are trying? > > On Fri, Sep 05, 2014 at 05:30:16PM +0300, Andy Shevchenko wrote: > > For dumping small buffers we may use %*phN specifier instead of custom > > approach.. > > > > Signed-off-by: Andy Shevchenko > > --- > > drivers/net/wireless/hostap/hostap_proc.c | 6 ++ > > 1 file changed, 2 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/net/wireless/hostap/hostap_proc.c > > b/drivers/net/wireless/hostap/hostap_proc.c > > index 16a06b6..4e2a7dd9 100644 > > --- a/drivers/net/wireless/hostap/hostap_proc.c > > +++ b/drivers/net/wireless/hostap/hostap_proc.c > > @@ -184,11 +184,9 @@ static int prism2_bss_list_proc_show(struct seq_file > > *m, void *v) > > seq_printf(m, "%*pE", bss->ssid_len, bss->ssid); > > > > seq_putc(m, '\t'); > > - for (i = 0; i < bss->ssid_len; i++) > > - seq_printf(m, "%02x", bss->ssid[i]); > > + seq_printf(m, "%*phN", (int)bss->ssid_len, bss->ssid); > > seq_putc(m, '\t'); > > - for (i = 0; i < bss->wpa_ie_len; i++) > > - seq_printf(m, "%02x", bss->wpa_ie[i]); > > + seq_printf(m, "%*phN", (int)bss->wpa_ie_len, bss->wpa_ie); > > seq_putc(m, '\n'); > > return 0; > > } > > -- > > 2.1.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 > > > -- Andy Shevchenko Intel Finland Oy -- 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
pull-request: mac80211-next 2014-09-12
John, Here's some more content for mac80211-next. Because we @Intel flushed our patch queue it's actually bigger than the previous round, which is a bit odd, but I think we're still well in the time where that's acceptable :) Let me know if there's any problem - though for a while you'll all just have to deal with it when I'm out ... Thanks, johannes The following changes since commit d0616613d9cf17919fbd46fa0274db4b0084ad62: net: rfkill: gpio: Add more Broadcom bluetooth ACPI IDs (2014-08-29 13:10:44 +0200) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git tags/mac80211-next-for-john-2014-09-12 for you to fetch changes up to 0d8614b4b926d0f657d15d7eb5125bcb24b9fd41: mac80211: replace SMPS hw flags with wiphy feature bits (2014-09-11 13:37:02 +0200) This time, I have some rate minstrel improvements, support for a very small feature from CCX that Steinar reverse-engineered, dynamic ACK timeout support, a number of changes for TDLS, early support for radio resource measurement and many fixes. Also, I'm changing a number of places to clear key memory when it's freed and Intel claims copyright for code they developed. Arik Nemtsov (1): mac80211: set network header in TDLS frames Assaf Krauss (3): nl80211: Allow declaring RRM-related features nl80211: Add flag attribute for RRM connections mac80211: Add RRM support to assoc request Eliad Peller (7): cfg80211: avoid duplicate entries on regdomain intersection mac80211: adjust roc duration when combining ROCs mac80211: combine roc with the "next roc" if possible cfg80211/mac80211: add wmm info to assoc event cfg80211: allow requesting SMPS mode on ap start mac80211: set smps_mode according to ap params mac80211: replace SMPS hw flags with wiphy feature bits Eyal Shapira (1): mac80211: fix broken use of VHT/20Mhz with some APs Johannes Berg (10): mac80211: clean up ieee80211_i.h mac80211: add Intel Mobile Communications copyright cfg80211: add Intel Mobile Communications copyright mac80211: annotate MMIC head/tailroom warning cfg80211: clear connect keys when freeing them mac80211: clear key material when freeing keys cfg80211: clear wext keys when freeing and removing them cfg80211: don't put kek/kck/replay counter on the stack cfg80211: clear nl80211 messages carrying keys after processing cfg80211: add WMM traffic stream API Liad Kaufman (2): mac80211: fix description comment of ieee80211_subif_start_xmit mac80211: add TDLS connection timeout Lorenzo Bianconi (2): cfg80211: enable dynack through nl80211 mac80211: extend set_coverage_class signature Michal Kazior (1): mac80211: fix offloaded BA session traffic after hw restart Steinar H. Gunderson (2): mac80211: split 802.11h parsing from transmit power policy mac80211: support DTPC IE (from Cisco Client eXtensions) Thomas Huehn (2): mac80211: Unify rate statistic variables between Minstrel & Minstrel_HT mac80211: improve minstrel_ht rate sorting by throughput & probability drivers/net/wireless/ath/ath10k/mac.c | 5 +- drivers/net/wireless/ath/ath5k/mac80211-ops.c | 2 +- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 2 +- drivers/net/wireless/ath/ath9k/main.c | 3 +- drivers/net/wireless/iwlegacy/4965-mac.c | 5 +- drivers/net/wireless/iwlwifi/dvm/mac80211.c | 4 +- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 8 +- drivers/net/wireless/mac80211_hwsim.c | 8 +- drivers/net/wireless/p54/main.c | 3 +- include/linux/ieee80211.h | 8 +- include/net/cfg80211.h| 44 +++- include/net/mac80211.h| 20 +- include/uapi/linux/nl80211.h | 100 + net/mac80211/agg-rx.c | 5 +- net/mac80211/cfg.c| 101 ++--- net/mac80211/debugfs.c| 6 +- net/mac80211/debugfs_netdev.c | 4 +- net/mac80211/debugfs_sta.c| 1 + net/mac80211/driver-ops.h | 2 +- net/mac80211/ibss.c | 1 + net/mac80211/ieee80211_i.h| 8 +- net/mac80211/iface.c | 15 +- net/mac80211/key.c| 3 +- net/mac80211/main.c | 1 + net/mac80211/mlme.c | 131 --- net/mac80211/rc80211_minstrel.c | 98 + net/mac80211/rc80211_minstrel.h | 43 ++-- net/mac80211/rc80211_minstrel_debugfs.c | 19 +- net/mac80211/rc80211_minstrel_ht.c| 303 +--
[PATCH] device coredump: add new device coredump class
From: Johannes Berg Many devices run firmware and/or complex hardware, and most of that can have bugs. When it misbehaves, however, it is often much harder to debug than software running on the host. Introduce a "device coredump" mechanism to allow dumping internal device/firmware state through a generalized mechanism. As devices are different and information needed can vary accordingly, this doesn't prescribe a file format - it just provides mechanism to get data to be able to capture it in a generalized way (e.g. in distributions.) The dumped data will be readable in sysfs in the virtual device's data file under /sys/class/devcoredump/devcd*/. Writing to it will free the data and remove the device, as does a 5-minute timeout. Note that generalized capturing of such data may result in privacy issues, so users generally need to be involved. In order to allow certain users/system integrators/... to disable the feature at all, introduce a Kconfig option to override the drivers that would like to have the feature. For now, this provides two ways of dumping data: 1) with a vmalloc'ed area, that is then given to the subsystem and freed after retrieval or timeout 2) with a generalized reader/free function method We could/should add more options, e.g. a list of pages, since the vmalloc area is very limited on some architectures. Signed-off-by: Johannes Berg --- MAINTAINERS | 7 ++ drivers/base/Kconfig| 21 drivers/base/Makefile | 1 + drivers/base/devcoredump.c | 265 include/linux/devcoredump.h | 35 ++ 5 files changed, 329 insertions(+) create mode 100644 drivers/base/devcoredump.c create mode 100644 include/linux/devcoredump.h diff --git a/MAINTAINERS b/MAINTAINERS index 2f85f55c8fb8..8e31d053fb14 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2847,6 +2847,13 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git S: Maintained F: drivers/usb/dwc3/ +DEVICE COREDUMP (DEV_COREDUMP) +M: Johannes Berg +L: linux-ker...@vger.kernel.org +S: Maintained +F: drivers/base/devcoredump.c +F: include/linux/devcoredump.h + DEVICE FREQUENCY (DEVFREQ) M: MyungJoo Ham M: Kyungmin Park diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig index 4e7f0ff83ae7..134f763d90fd 100644 --- a/drivers/base/Kconfig +++ b/drivers/base/Kconfig @@ -165,6 +165,27 @@ config FW_LOADER_USER_HELPER_FALLBACK If you are unsure about this, say N here. +config WANT_DEV_COREDUMP + bool + help + Drivers should "select" this option if they desire to use the + device coredump mechanism. + +config DISABLE_DEV_COREDUMP + bool "Disable device coredump" if EXPERT + help + Disable the device coredump mechanism despite drivers wanting to + use it; this allows for more sensitive systems or systems that + don't want to ever access the information to not have the code, + nor keep any data. + + If unsure, say N. + +config DEV_COREDUMP + bool + default y if WANT_DEV_COREDUMP + depends on !DISABLE_DEV_COREDUMP + config DEBUG_DRIVER bool "Driver Core verbose debug messages" depends on DEBUG_KERNEL diff --git a/drivers/base/Makefile b/drivers/base/Makefile index 4aab26ec0292..6922cd6850a2 100644 --- a/drivers/base/Makefile +++ b/drivers/base/Makefile @@ -21,6 +21,7 @@ obj-$(CONFIG_SYS_HYPERVISOR) += hypervisor.o obj-$(CONFIG_REGMAP) += regmap/ obj-$(CONFIG_SOC_BUS) += soc.o obj-$(CONFIG_PINCTRL) += pinctrl.o +obj-$(CONFIG_DEV_COREDUMP) += devcoredump.o ccflags-$(CONFIG_DEBUG_DRIVER) := -DDEBUG diff --git a/drivers/base/devcoredump.c b/drivers/base/devcoredump.c new file mode 100644 index ..96614b04544c --- /dev/null +++ b/drivers/base/devcoredump.c @@ -0,0 +1,265 @@ +/* + * This file is provided under the GPLv2 license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2014 Intel Mobile Communications GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * Author: Johannes Berg + */ +#include +#include +#include +#include +#include +#include +#include + +/* if data isn't read by userspace after 5 minutes then delete it */ +#define DEVCD_TIMEOUT (HZ * 60 * 5) + +struct devcd_entry { + struct d
[PATCH v4 2/2] mac80211: implement cfg80211_ops to query mesh proxy path table
Implement get_mpp and dump_mpp cfg80211_ops to export the content of the 802.11s mesh proxy path table to userspace. Signed-off-by: Henning Rogge --- net/mac80211/cfg.c | 53 + net/mac80211/mesh.h | 3 +++ net/mac80211/mesh_pathtbl.c | 31 ++ 3 files changed, 87 insertions(+) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 4d8989b..2538a2f 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1504,6 +1504,57 @@ static int ieee80211_dump_mpath(struct wiphy *wiphy, struct net_device *dev, return 0; } +static void mpp_set_pinfo(struct mesh_path *mpath, u8 *mpp, + struct mpath_info *pinfo) +{ + memset(pinfo, 0, sizeof(*pinfo)); + memcpy(mpp, mpath->mpp, ETH_ALEN); + + pinfo->generation = mpp_paths_generation; +} + +static int ieee80211_get_mpp(struct wiphy *wiphy, struct net_device *dev, +u8 *dst, u8 *mpp, struct mpath_info *pinfo) + +{ + struct ieee80211_sub_if_data *sdata; + struct mesh_path *mpath; + + sdata = IEEE80211_DEV_TO_SUB_IF(dev); + + rcu_read_lock(); + mpath = mpp_path_lookup(sdata, dst); + if (!mpath) { + rcu_read_unlock(); + return -ENOENT; + } + memcpy(dst, mpath->dst, ETH_ALEN); + mpp_set_pinfo(mpath, mpp, pinfo); + rcu_read_unlock(); + return 0; +} + +static int ieee80211_dump_mpp(struct wiphy *wiphy, struct net_device *dev, + int idx, u8 *dst, u8 *mpp, + struct mpath_info *pinfo) +{ + struct ieee80211_sub_if_data *sdata; + struct mesh_path *mpath; + + sdata = IEEE80211_DEV_TO_SUB_IF(dev); + + rcu_read_lock(); + mpath = mpp_path_lookup_by_idx(sdata, idx); + if (!mpath) { + rcu_read_unlock(); + return -ENOENT; + } + memcpy(dst, mpath->dst, ETH_ALEN); + mpp_set_pinfo(mpath, mpp, pinfo); + rcu_read_unlock(); + return 0; +} + static int ieee80211_get_mesh_config(struct wiphy *wiphy, struct net_device *dev, struct mesh_config *conf) @@ -3500,6 +3551,8 @@ const struct cfg80211_ops mac80211_config_ops = { .change_mpath = ieee80211_change_mpath, .get_mpath = ieee80211_get_mpath, .dump_mpath = ieee80211_dump_mpath, + .get_mpp = ieee80211_get_mpp, + .dump_mpp = ieee80211_dump_mpp, .update_mesh_config = ieee80211_update_mesh_config, .get_mesh_config = ieee80211_get_mesh_config, .join_mesh = ieee80211_join_mesh, diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h index f39a19f..50c8473 100644 --- a/net/mac80211/mesh.h +++ b/net/mac80211/mesh.h @@ -270,6 +270,8 @@ int mpp_path_add(struct ieee80211_sub_if_data *sdata, const u8 *dst, const u8 *mpp); struct mesh_path * mesh_path_lookup_by_idx(struct ieee80211_sub_if_data *sdata, int idx); +struct mesh_path * +mpp_path_lookup_by_idx(struct ieee80211_sub_if_data *sdata, int idx); void mesh_path_fix_nexthop(struct mesh_path *mpath, struct sta_info *next_hop); void mesh_path_expire(struct ieee80211_sub_if_data *sdata); void mesh_rx_path_sel_frame(struct ieee80211_sub_if_data *sdata, @@ -317,6 +319,7 @@ void mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata); bool mesh_action_is_path_sel(struct ieee80211_mgmt *mgmt); extern int mesh_paths_generation; +extern int mpp_paths_generation; #ifdef CONFIG_MAC80211_MESH static inline diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index a6699dc..b890e22 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -44,6 +44,7 @@ static struct mesh_table __rcu *mesh_paths; static struct mesh_table __rcu *mpp_paths; /* Store paths for MPP&MAP */ int mesh_paths_generation; +int mpp_paths_generation; /* This lock will have the grow table function as writer and add / delete nodes * as readers. RCU provides sufficient protection only when reading the table @@ -410,6 +411,33 @@ mesh_path_lookup_by_idx(struct ieee80211_sub_if_data *sdata, int idx) } /** + * mpp_path_lookup_by_idx - look up a path in the proxy path table by its index + * @idx: index + * @sdata: local subif, or NULL for all entries + * + * Returns: pointer to the proxy path structure, or NULL if not found. + * + * Locking: must be called within a read rcu section. + */ +struct mesh_path * +mpp_path_lookup_by_idx(struct ieee80211_sub_if_data *sdata, int idx) +{ + struct mesh_table *tbl = rcu_dereference(mpp_paths); + struct mpath_node *node; + int i; + int j = 0; + + for_each_mesh_entry(tbl, node, i) { + if (sdata && node->mpath->sdata != sdata) + continue; + if (j++ == idx) + return node->mpath; + } + + return
[PATCH v2] Add mpp get/dump commands
Add the "mpp get" and "mpp dump" command to query to mac80211s mesh proxy path table through nl80211. Signed-off-by: Henning Rogge --- Makefile | 2 +- mpp.c | 84 +++ nl80211.h | 11 + 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 mpp.c diff --git a/Makefile b/Makefile index f042e30..c05b2c4 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing OBJS = iw.o genl.o event.o info.o phy.o \ interface.o ibss.o station.o survey.o util.o \ - mesh.o mpath.o scan.o reg.o version.o \ + mesh.o mpath.o mpp.o scan.o reg.o version.o \ reason.o status.o connect.o link.o offch.o ps.o cqm.o \ bitrate.o wowlan.o coalesce.o roc.o p2p.o OBJS += sections.o diff --git a/mpp.c b/mpp.c new file mode 100644 index 000..2d20d6b --- /dev/null +++ b/mpp.c @@ -0,0 +1,84 @@ +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "nl80211.h" +#include "iw.h" + +SECTION(mpp); + +static int print_mpp_handler(struct nl_msg *msg, void *arg) +{ + struct nlattr *tb[NL80211_ATTR_MAX + 1]; + struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg)); + char dst[20], next_hop[20], dev[20]; + + nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0), + genlmsg_attrlen(gnlh, 0), NULL); + + /* +* TODO: validate the interface and mac address! +* Otherwise, there's a race condition as soon as +* the kernel starts sending mpath notifications. +*/ + + mac_addr_n2a(dst, nla_data(tb[NL80211_ATTR_MAC])); + mac_addr_n2a(next_hop, nla_data(tb[NL80211_ATTR_MPATH_NEXT_HOP])); + if_indextoname(nla_get_u32(tb[NL80211_ATTR_IFINDEX]), dev); + printf("%s %s %s\n", dst, next_hop, dev); + + return NL_SKIP; +} + +static int handle_mpp_get(struct nl80211_state *state, + struct nl_cb *cb, + struct nl_msg *msg, + int argc, char **argv, + enum id_input id) +{ + unsigned char dst[ETH_ALEN]; + + if (argc < 1) + return 1; + + if (mac_addr_a2n(dst, argv[0])) { + fprintf(stderr, "invalid mac address\n"); + return 2; + } + argc--; + argv++; + + if (argc) + return 1; + + NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, dst); + + nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_mpp_handler, NULL); + + return 0; + nla_put_failure: + return -ENOBUFS; +} +COMMAND(mpp, get, "", + NL80211_CMD_GET_MPP, 0, CIB_NETDEV, handle_mpp_get, + "Get information on mesh proxy path to the given node."); + +static int handle_mpp_dump(struct nl80211_state *state, +struct nl_cb *cb, +struct nl_msg *msg, +int argc, char **argv, +enum id_input id) +{ + printf("DEST ADDR PROXY NODEIFACE\n"); + nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_mpp_handler, NULL); + return 0; +} +COMMAND(mpp, dump, NULL, + NL80211_CMD_GET_MPP, NLM_F_DUMP, CIB_NETDEV, handle_mpp_dump, + "List known mesh proxy paths."); diff --git a/nl80211.h b/nl80211.h index be9519b..80cff48 100644 --- a/nl80211.h +++ b/nl80211.h @@ -722,6 +722,10 @@ * QoS mapping is relevant for IP packets, it is only valid during an * association. This is cleared on disassociation and AP restart. * + * @NL80211_CMD_GET_MPP: Get mesh path attributes for mesh proxy path to + * destination %NL80211_ATTR_MAC on the interface identified by + * %NL80211_ATTR_IFINDEX. + * * @NL80211_CMD_MAX: highest used command number * @__NL80211_CMD_AFTER_LAST: internal use */ @@ -893,6 +897,8 @@ enum nl80211_commands { NL80211_CMD_SET_QOS_MAP, + NL80211_CMD_GET_MPP, + /* add new commands above here */ /* used to define NL80211_CMD_MAX below */ @@ -1591,6 +1597,9 @@ enum nl80211_commands { * creation then the new interface will be owned by the netlink socket * that created it and will be destroyed when the socket is closed * + * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is + * the TDLS link initiator. + * * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use */ @@ -1931,6 +1940,8 @@ enum nl80211_attrs { NL80211_ATTR_CSA_C_OFFSETS_TX, NL80211_ATTR_MAX_CSA_COUNTERS, + NL80211_ATTR_TDLS_INITIATOR, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, -- 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 maj