Re: BCM4330 linux support

2015-02-06 Thread Benjamin Adler

On 06.02.2015 16:00, Arend van Spriel wrote:
> version 5.97.39.4 FWID 01-c7b9d775
>
> The FWID should tell me what specific build this was and what feature
> set it contains. Unfortunately I can not access our database.
>
>> Does AP also work for you?
>
> Yes, but not sure if your firmware supports it.

Who can I ask for this information?


The errors are direct result of wpa_supplicant request, but it is not
root cause. I suspend the sdhci-acpi controller driver to use
runtime-pm. Could you try disabling that through sysfs? If I am not
mistaken the bcm4330 is in mmc1.

mmc1: SDHCI controller on ACPI [INT33BB:00] using ADMA

So following should do the trick (as root):

# echo on > /sys/bus/acpi/INT33BB:00/power/control


# cat /sys/bus/acpi/devices/INT33BB\:00/power_state
D3cold

# cat /sys/bus/acpi/devices/INT33BB\:00/status
15

# echo on > /sys/bus/acpi/devices/INT33BB\:00/power/control

# cat /sys/bus/acpi/devices/INT33BB\:00/power_state
D3cold

# cat /sys/bus/acpi/devices/INT33BB\:00/status
15

That doesn't seem to work?! I tried booting with "acpi=off", but it 
didn't boot successfully. I know there are ACPI woes with this box, see 
http://www.spinics.net/lists/linux-acpi/msg55693.html


You were right about not having the debug option compiled into the 
module. So I built 3.18 (not 3.19 anymore) and my new dmesg is attached.


Cheers,
Ben


dmesg.tar.gz
Description: application/gzip


Re: [PATCH v4 2/2] cfg80211: Schedule timeout for all CRDA calls

2015-02-06 Thread Luis R. Rodriguez
On Mon, Feb 02, 2015 at 09:59:26AM -0500, Ilan Peer wrote:
> Timeout was scheduled only in case CRDA was called due to user hints,
> but was not scheduled for other cases. This can result in regulatory
> hint processing getting stuck in case that there is no CRDA configured.
> 
> Change this by scheduling a timeout every time CRDA is called. In
> addition, in restore_regulatory_settings() all pending requests are
> restored (and not only the user ones).
> 
> Signed-off-by: Ilan Peer 

Reviewed-by: Luis R. Rodriguez 

  Luis
--
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 v4 1/2] cfg80211: Add API to change the indoor regulatory setting

2015-02-06 Thread Luis R. Rodriguez
On Mon, Feb 02, 2015 at 09:59:25AM -0500, Ilan Peer wrote:
> As the operating environment of a device can change, add
> API for user space to indicate a change of indoor settings.
> In addition modify the handling of the indoor processing as
> follows:
> 
> 1. Directly update the indoor setting without wrapping it as a
>regulatory request.

Why? We have this present as part of the request as it was part
of the country IE, that's all. I can see for instance then that
it is wise to require the supplicant for instance to be still
connected to the AP and the socket tracking as solution to the
problem. Does that summarize the logic ?

> 2. Track the socket on which the indoor hint is issued, and reset
>indoor setting if the socket was released. The motivation here is to
>force a user space process that sets the indoor setting to constantly
>monitor this setting, and be responsible to correctly toggling it,
>so indoor operation will not be enabled uncontrolled.

That seems to imply a new requirement for something that used to work,
what having an option to set this requirement?

> 3. Do not reset the indoor setting when restoring the regulatory
>settings as it has nothing to do with CRDA or interface
>disconnection.

I disagree, if we disconnect we want the more restrictive setting
and if we put the indoor setting out of general regulatory requests
then we do want to reset this no?

> Signed-off-by: Ilan Peer 
> Signed-off-by: ArikX Nemtsov 
> ---
>  include/uapi/linux/nl80211.h |  5 +++
>  net/wireless/nl80211.c   | 10 +-
>  net/wireless/reg.c   | 80 
> +---
>  net/wireless/reg.h   | 15 -
>  4 files changed, 73 insertions(+), 37 deletions(-)
> 
> diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
> index 68b294e..d80edcc 100644
> --- a/include/uapi/linux/nl80211.h
> +++ b/include/uapi/linux/nl80211.h
> @@ -1739,6 +1739,9 @@ enum nl80211_commands {
>   *
>   * @NL80211_ATTR_SCHED_SCAN_DELAY: delay before a scheduled scan (or a
>   *   WoWLAN net-detect scan) is started, u32 in seconds.
> +
> + * @NL80211_ATTR_REG_INDOOR: flag attribute, if set indicates that the device
> + *  is operating in an indoor environment.
>   *
>   * @NUM_NL80211_ATTR: total number of nl80211_attrs available
>   * @NL80211_ATTR_MAX: highest attribute number currently defined
> @@ -2107,6 +2110,8 @@ enum nl80211_attrs {
>  
>   NL80211_ATTR_SCHED_SCAN_DELAY,
>  
> + NL80211_ATTR_REG_INDOOR,
> +
>   /* add attributes here, update the policy in nl80211.c */
>  
>   __NL80211_ATTR_AFTER_LAST,
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index 454d7a0..e78b096 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -399,6 +399,7 @@ static const struct nla_policy 
> nl80211_policy[NUM_NL80211_ATTR] = {
>   [NL80211_ATTR_WIPHY_SELF_MANAGED_REG] = { .type = NLA_FLAG },
>   [NL80211_ATTR_NETNS_FD] = { .type = NLA_U32 },
>   [NL80211_ATTR_SCHED_SCAN_DELAY] = { .type = NLA_U32 },
> + [NL80211_ATTR_REG_INDOOR] = { .type = NLA_FLAG },
>  };
>  
>  /* policy for the key attributes */
> @@ -4955,6 +4956,7 @@ static int parse_reg_rule(struct nlattr *tb[],
>  static int nl80211_req_set_reg(struct sk_buff *skb, struct genl_info *info)
>  {
>   char *data = NULL;
> + bool is_indoor;
>   enum nl80211_user_reg_hint_type user_reg_hint_type;
>  
>   /*
> @@ -4981,7 +4983,8 @@ static int nl80211_req_set_reg(struct sk_buff *skb, 
> struct genl_info *info)
>   data = nla_data(info->attrs[NL80211_ATTR_REG_ALPHA2]);
>   return regulatory_hint_user(data, user_reg_hint_type);
>   case NL80211_USER_REG_HINT_INDOOR:
> - return regulatory_hint_indoor_user();
> + is_indoor = !!info->attrs[NL80211_ATTR_REG_INDOOR];
> + return regulatory_hint_indoor(is_indoor, info->snd_portid);

So we break old functionality ? No bueno.

  Luis
--
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] ath9k_htc: add adaptive usb receive flow control to repair soft lockup with monitor mode

2015-02-06 Thread Oleksij Rempel
formatting of this patch is still badly broken.
./scripts/checkpatch.pl ~/Downloads/patch.eml

ERROR: DOS line endings
#442: FILE: drivers/net/wireless/ath/ath9k/htc_drv_txrx.c:1170:
+^I^IAURFC_STAT_SET(aurfc_submit_delay, delay);^M$

total: 195 errors, 6 warnings, 1 checks, 310 lines checked


Am 06.02.2015 um 11:46 schrieb yuweizh...@139.com:
> From: Yuwei Zheng 
> 
> In the environment with heavy wifi traffic, set the ar9271 into monitor mode, 
> will
> trigger a deadloop panic.
>  
> The ath9k_hif_usb_rx_cb function excute on  the interrupt context, and 
> ath9k_rx_tasklet excute
> on the soft irq context. In other words, the ath9k_hif_usb_rx_cb have more 
> chance to excute than
> ath9k_rx_tasklet.  So in the worst condition,  the rx.rxbuf receive list is 
> always full,
> and the do {}while(true) loop will not be break. The kernel get a soft lockup 
> panic. 
>  
> [59011.007210] BUG: soft lockup - CPU#0 stuck for 23s!
> [kworker/0:0:30609]
> [59011.030560] BUG: scheduling while atomic: kworker/0:0/30609/0x40010100
> [59013.804486] BUG: scheduling while atomic: kworker/0:0/30609/0x40010100
> [59013.858522] Kernel panic - not syncing: softlockup: hung tasks
>  
> [59014.038891] Exception stack(0xdf4bbc38 to 0xdf4bbc80)
> [59014.046834] bc20:   
> de57b950 6113
> [59014.059579] bc40:  bb32bb32 6113 de57b948 de57b500 dc7bb440 
> df4bbcd0 
> [59014.072337] bc60: de57b950 6113 df4bbcd0 df4bbc80 c04c259d c04c25a0 
> 6133 
> [59014.085233] [] (__irq_svc+0x3b/0x5c) from [] 
> (_raw_spin_unlock_irqrestore+0xc/0x10)
> [59014.100437] [] (_raw_spin_unlock_irqrestore+0xc/0x10) from 
> [] (ath9k_rx_tasklet+0x290/0x490 [ath9k_htc])
> [59014.118267] [] (ath9k_rx_tasklet+0x290/0x490 [ath9k_htc]) from 
> [] (tasklet_action+0x3b/0x98)
> [59014.134132] [] (tasklet_action+0x3b/0x98) from [] 
> (__do_softirq+0x99/0x16c)
> [59014.147784] [] (__do_softirq+0x99/0x16c) from [] 
> (irq_exit+0x5b/0x5c)
> [59014.160653] [] (irq_exit+0x5b/0x5c) from [] 
> (handle_IRQ+0x37/0x78)
> [59014.173124] [] (handle_IRQ+0x37/0x78) from [] 
> (omap3_intc_handle_irq+0x5f/0x68)
> [59014.187225] [] (omap3_intc_handle_irq+0x5f/0x68) from 
> [](__irq_svc+0x3b/0x5c)
>  
> This bug can be see with low performance board, such as uniprocessor beagle 
> bone board. 
>  
> Signed-off-by: Yuwei Zheng 
> 
> ---
>  drivers/net/wireless/ath/ath9k/hif_usb.c   | 74 
> +++---
>  drivers/net/wireless/ath/ath9k/hif_usb.h   |  9 
>  drivers/net/wireless/ath/ath9k/htc.h   | 19 +++
>  drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 53 ++
>  drivers/net/wireless/ath/ath9k/htc_drv_txrx.c  | 44 +++
>  5 files changed, 192 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c 
> b/drivers/net/wireless/ath/ath9k/hif_usb.c
> index 8e7153b..90ee568 100644
> --- a/drivers/net/wireless/ath/ath9k/hif_usb.c
> +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
> @@ -640,6 +640,7 @@ static void ath9k_hif_usb_rx_cb(struct urb *urb)
>   struct hif_device_usb *hif_dev =
>   usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0));
>   int ret;
> + int delay;
>  
>   if (!skb)
>   return;
> @@ -658,7 +659,6 @@ static void ath9k_hif_usb_rx_cb(struct urb *urb)
>   default:
>   goto resubmit;
>   }
> -
>   if (likely(urb->actual_length != 0)) {
>   skb_put(skb, urb->actual_length);
>   ath9k_hif_usb_rx_stream(hif_dev, skb);
> @@ -667,12 +667,22 @@ static void ath9k_hif_usb_rx_cb(struct urb *urb)
>  resubmit:
>   skb_reset_tail_pointer(skb);
>   skb_trim(skb, 0);
> -
> - usb_anchor_urb(urb, &hif_dev->rx_submitted);
> - ret = usb_submit_urb(urb, GFP_ATOMIC);
> - if (ret) {
> - usb_unanchor_urb(urb);
> - goto free;
> + spin_lock(&hif_dev->aurfc_lock);
> + if (atomic_read(&hif_dev->aurfc_submit_delay) > 0 &&
> + hif_dev->aurfc_active == 1) {
> + usb_anchor_urb(urb, &hif_dev->rx_delayed_submitted);
> + delay = atomic_read(&hif_dev->aurfc_submit_delay);
> + schedule_delayed_work(&hif_dev->aurfc_delayed_work,
> +   msecs_to_jiffies(delay));
> + spin_unlock(&hif_dev->aurfc_lock);
> + } else {
> + spin_unlock(&hif_dev->aurfc_lock);
> + usb_anchor_urb(urb, &hif_dev->rx_submitted);
> + ret = usb_submit_urb(urb, GFP_ATOMIC);
> + if (ret) {
> + usb_unanchor_urb(urb);
> + goto free;
> + }
>   }
>  
>   return;
> @@ -818,9 +828,50 @@ err:
>   return -ENOMEM;
>  }
>  
> +static void aurfc_submit_handler(struct work_struct *work)
> +{
> + struct hif_device_usb *hif_dev =
> + container_of(work,
> +  struct hif_device_usb,
> + 

[PATCH 1/1] rtlwifi: Clear ACM_CTRL AC3_VO bit correctly

2015-02-06 Thread Jes . Sorensen
From: Jes Sorensen 

All hw driver components in the rtlwifi driver, except for the
rtl8192de component has this bug. They would clear BE bit in the
ACM_CTRL register instead of the VO bit when processing the VO queue.

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/rtlwifi/rtl8188ee/hw.c | 2 +-
 drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 2 +-
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 2 +-
 drivers/net/wireless/rtlwifi/rtl8192ee/hw.c | 2 +-
 drivers/net/wireless/rtlwifi/rtl8192se/hw.c | 2 +-
 drivers/net/wireless/rtlwifi/rtl8723ae/hw.c | 2 +-
 drivers/net/wireless/rtlwifi/rtl8723be/hw.c | 2 +-
 drivers/net/wireless/rtlwifi/rtl8821ae/hw.c | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c 
b/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c
index f2b9713..edc2cbb 100644
--- a/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8188ee/hw.c
@@ -566,7 +566,7 @@ void rtl88ee_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
acm_ctrl &= (~ACMHW_VIQEN);
break;
case AC3_VO:
-   acm_ctrl &= (~ACMHW_BEQEN);
+   acm_ctrl &= (~ACMHW_VOQEN);
break;
default:
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c 
b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
index 5c646d5..545b2c1 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/hw.c
@@ -363,7 +363,7 @@ void rtl92ce_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
acm_ctrl &= (~AcmHw_ViqEn);
break;
case AC3_VO:
-   acm_ctrl &= (~AcmHw_BeqEn);
+   acm_ctrl &= (~AcmHw_VoqEn);
break;
default:
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c 
b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
index 5513217..ab38e68 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
@@ -1867,7 +1867,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
acm_ctrl &= (~AcmHw_ViqEn);
break;
case AC3_VO:
-   acm_ctrl &= (~AcmHw_BeqEn);
+   acm_ctrl &= (~AcmHw_VoqEn);
break;
default:
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ee/hw.c 
b/drivers/net/wireless/rtlwifi/rtl8192ee/hw.c
index 1a87edc..bac42e4 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ee/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ee/hw.c
@@ -588,7 +588,7 @@ void rtl92ee_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
acm_ctrl &= (~ACMHW_VIQEN);
break;
case AC3_VO:
-   acm_ctrl &= (~ACMHW_BEQEN);
+   acm_ctrl &= (~ACMHW_VOQEN);
break;
default:
RT_TRACE(rtlpriv, COMP_ERR, DBG_DMESG,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c 
b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
index 5761d5b..dee88a8 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/hw.c
@@ -293,7 +293,7 @@ void rtl92se_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
acm_ctrl &= (~AcmHw_ViqEn);
break;
case AC3_VO:
-   acm_ctrl &= (~AcmHw_BeqEn);
+   acm_ctrl &= (~AcmHw_VoqEn);
break;
default:
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
diff --git a/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c 
b/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c
index aa08546..b3b0947 100644
--- a/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c
+++ b/drivers/net/wireless/rtlwifi/rtl8723ae/hw.c
@@ -362,7 +362,7 @@ void rtl8723e_set_hw_reg(struct ieee80211_hw *hw, u8 
variable, u8 *val)
acm_ctrl &= (~ACMHW_VIQEN);
break;
  

[PATCH 0/1] Clear correct ACM bit

2015-02-06 Thread Jes . Sorensen
From: Jes Sorensen 

Hi,

Reading over the RTL driver code, I noticed that most of the
components in the rtlwifi driver would clear the wrong bit if it was
processing the VO queue and ACM was not set.

I am unable to test this, as I don't have the hardware, so please
double check before applying.

Jes

Jes Sorensen (1):
  rtlwifi: Clear ACM_CTRL AC3_VO bit correctly

 drivers/net/wireless/rtlwifi/rtl8188ee/hw.c | 2 +-
 drivers/net/wireless/rtlwifi/rtl8192ce/hw.c | 2 +-
 drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 2 +-
 drivers/net/wireless/rtlwifi/rtl8192ee/hw.c | 2 +-
 drivers/net/wireless/rtlwifi/rtl8192se/hw.c | 2 +-
 drivers/net/wireless/rtlwifi/rtl8723ae/hw.c | 2 +-
 drivers/net/wireless/rtlwifi/rtl8723be/hw.c | 2 +-
 drivers/net/wireless/rtlwifi/rtl8821ae/hw.c | 2 +-
 8 files changed, 8 insertions(+), 8 deletions(-)

-- 
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


Re: [PATCH] cfg80211: PBSS basic support

2015-02-06 Thread Johannes Berg
Hi,

Sorry about the delay.

> > > wdev->bss_type refers to the BSS that we are connecting/connected to 
> > > (Maybe rename to "conn_bss_type"?).
> > > This member is used in sme.c. It was introduced because once the connect 
> > > is complete and driver calls cfg80211_connect_result(), cfg needs to find 
> > > the BSS being connected to.
> > 
> > Ok I was thinking you were adding it to struct cfg80211_bss. Wouldn't that 
> > make a bit more sense? Of course it can also be derived from 
> > cfg80211_bss::channel and cfg80211_bss::capability, your call.
> > 
> > However, it doesn't seem that you need it in wdev if you have it there 
> > inside wdev->current_bss?
> 
> current_bss is set later.
> 
> inside __cfg80211_connect_result(), we look for the BSS being connected to:
>   bss = cfg80211_get_bss(..., bssid, wdev->bss_type, ...)
> only after that, current_bss is set to this BSS:
>   wdev->current_bss = bss_from_pub(bss);

Ok.

johannes

--
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] cfg80211: add debugfs VHT80 allow map

2015-02-06 Thread Johannes Berg
On Fri, 2015-02-06 at 12:05 +0530, Ashok Raj Nagarajan wrote:
> Here is a output of this debugfs entry
> 
> root@OpenWrt:/# cat /sys/kernel/debug/ieee80211/phy0/vht80allow_map
> 2412 VHT80 N

I'm not sure I see much point in this, in fact we could remove the HT40
one?

We expose this data to userspace, so you could change 'iw' to print it
when dumping the list of channels in 'iw list' or similar.

johannes

--
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: Throughput regression with `tcp: refine TSO autosizing`

2015-02-06 Thread Rick Jones

If you increase ability to flood on one flow, then you need to make sure
receiver has big rcvbuf as well.

echo 200 >/proc/sys/net/core/rmem_default

Otherwise it might drop bursts.

This is the kind of things that TCP does automatically, not UDP.


An alternative, if the application involved can make explicit 
setsockopt() calls to set SO_SNDBUF and/or SO_RCVBUF, is to tweak 
rmem_max and wmem_max and then let the application make the setsockopt() 
calls.


Which path one would take would depend on circumstances I suspect.

rick jones
--
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 6/6] brcmfmac: Fix escan timer causing oops.

2015-02-06 Thread Arend van Spriel
From: Hante Meuleman 

In some rare circumstances the escan protection timer can expire
before the setup completed (due to long timeouts on IOCTL). This
patch avoids this situation by setting the timer after the setup
completed correctly.

Reviewed-by: Arend Van Spriel 
Reviewed-by: Franky (Zhenhui) Lin 
Reviewed-by: Pieter-Paul Giesberts 
Reviewed-by: Daniel (Deognyoun) Kim 
Signed-off-by: Hante Meuleman 
Signed-off-by: Arend van Spriel 
---
 drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c 
b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
index bc86009..33245bb 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
@@ -1050,10 +1050,6 @@ brcmf_cfg80211_escan(struct wiphy *wiphy, struct 
brcmf_cfg80211_vif *vif,
if (vif == cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif)
vif = cfg->p2p.bss_idx[P2PAPI_BSSCFG_PRIMARY].vif;
 
-   /* Arm scan timeout timer */
-   mod_timer(&cfg->escan_timeout, jiffies +
-   WL_ESCAN_TIMER_INTERVAL_MS * HZ / 1000);
-
escan_req = false;
if (request) {
/* scan bss */
@@ -1112,12 +1108,14 @@ brcmf_cfg80211_escan(struct wiphy *wiphy, struct 
brcmf_cfg80211_vif *vif,
}
}
 
+   /* Arm scan timeout timer */
+   mod_timer(&cfg->escan_timeout, jiffies +
+   WL_ESCAN_TIMER_INTERVAL_MS * HZ / 1000);
+
return 0;
 
 scan_out:
clear_bit(BRCMF_SCAN_STATUS_BUSY, &cfg->scan_status);
-   if (timer_pending(&cfg->escan_timeout))
-   del_timer_sync(&cfg->escan_timeout);
cfg->scan_request = NULL;
return err;
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/6] brcmfmac: Remove error print for invalid key index.

2015-02-06 Thread Arend van Spriel
From: Hante Meuleman 

When a key is set or cleared with an unsupported key index then
brcmfmac will print an error. With most wpa_supplicants this is
happening a lot. The error print is confusing and not needed.

Reviewed-by: Arend Van Spriel 
Reviewed-by: Pieter-Paul Giesberts 
Signed-off-by: Hante Meuleman 
Signed-off-by: Arend van Spriel 
---
 drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c 
b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
index b59b8c6..bc86009 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
@@ -2252,7 +2252,6 @@ brcmf_cfg80211_del_key(struct wiphy *wiphy, struct 
net_device *ndev,
 
if (key_idx >= BRCMF_MAX_DEFAULT_KEYS) {
/* we ignore this key index in this case */
-   brcmf_err("invalid key index (%d)\n", key_idx);
return -EINVAL;
}
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/6] brcmfmac: Dont sleep when ctrl frames to transmit.

2015-02-06 Thread Arend van Spriel
From: Hante Meuleman 

The SDIO watchdog will put the device in sleep mode when there is
no activity for some time and nothing to do anymore. This check
is incomplete and should also check if there is a control frame
to transmit.

Reviewed-by: Arend Van Spriel 
Reviewed-by: Franky (Zhenhui) Lin 
Reviewed-by: Pieter-Paul Giesberts 
Reviewed-by: Daniel (Deognyoun) Kim 
Signed-off-by: Hante Meuleman 
Signed-off-by: Arend van Spriel 
---
 drivers/net/wireless/brcm80211/brcmfmac/sdio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c 
b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
index ea403d1..f365cde 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
@@ -1027,6 +1027,7 @@ brcmf_sdio_bus_sleep(struct brcmf_sdio *bus, bool sleep, 
bool pendok)
/* Don't sleep if something is pending */
if (atomic_read(&bus->intstatus) ||
atomic_read(&bus->ipend) > 0 ||
+   bus->ctrl_frame_stat ||
(!atomic_read(&bus->fcstate) &&
brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol) &&
data_ok(bus))) {
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/6] brcmfmac: make sdio suspend wait for threads to freeze

2015-02-06 Thread Arend van Spriel
Borrowed the idea of the PM freezer to make sdio suspend wait for
watchdog and DPC thread to freeze at a safe point in their thread
routine. The suspend takes 20-25 msec.

Reviewed-by: Hante Meuleman 
Reviewed-by: Daniel (Deognyoun) Kim 
Reviewed-by: Franky (Zhenhui) Lin 
Reviewed-by: Pieter-Paul Giesberts 
Signed-off-by: Arend van Spriel 
---
 drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 125 ---
 drivers/net/wireless/brcm80211/brcmfmac/sdio.c   |  90 
 drivers/net/wireless/brcm80211/brcmfmac/sdio.h   |  32 --
 3 files changed, 184 insertions(+), 63 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c 
b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
index 1f7e2f2..c438ccd 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
@@ -58,6 +58,14 @@
 #define BRCMF_DEFAULT_TXGLOM_SIZE  32  /* max tx frames in glom chain */
 #define BRCMF_DEFAULT_RXGLOM_SIZE  32  /* max rx frames in glom chain */
 
+struct brcmf_sdiod_freezer {
+   atomic_t freezing;
+   atomic_t thread_count;
+   u32 frozen_count;
+   wait_queue_head_t thread_freeze;
+   struct completion resumed;
+};
+
 static int brcmf_sdiod_txglomsz = BRCMF_DEFAULT_TXGLOM_SIZE;
 module_param_named(txglomsz, brcmf_sdiod_txglomsz, int, 0);
 MODULE_PARM_DESC(txglomsz, "maximum tx packet chain size [SDIO]");
@@ -895,6 +903,87 @@ static void brcmf_sdiod_sgtable_alloc(struct 
brcmf_sdio_dev *sdiodev)
sdiodev->txglomsz = brcmf_sdiod_txglomsz;
 }
 
+#ifdef CONFIG_PM_SLEEP
+static int brcmf_sdiod_freezer_attach(struct brcmf_sdio_dev *sdiodev)
+{
+   sdiodev->freezer = kzalloc(sizeof(*sdiodev->freezer), GFP_KERNEL);
+   if (!sdiodev->freezer)
+   return -ENOMEM;
+   atomic_set(&sdiodev->freezer->thread_count, 0);
+   atomic_set(&sdiodev->freezer->freezing, 0);
+   init_waitqueue_head(&sdiodev->freezer->thread_freeze);
+   init_completion(&sdiodev->freezer->resumed);
+   return 0;
+}
+
+static void brcmf_sdiod_freezer_detach(struct brcmf_sdio_dev *sdiodev)
+{
+   if (sdiodev->freezer) {
+   WARN_ON(atomic_read(&sdiodev->freezer->freezing));
+   kfree(sdiodev->freezer);
+   }
+}
+
+static int brcmf_sdiod_freezer_on(struct brcmf_sdio_dev *sdiodev)
+{
+   atomic_t *expect = &sdiodev->freezer->thread_count;
+   int res = 0;
+
+   sdiodev->freezer->frozen_count = 0;
+   reinit_completion(&sdiodev->freezer->resumed);
+   atomic_set(&sdiodev->freezer->freezing, 1);
+   brcmf_sdio_trigger_dpc(sdiodev->bus);
+   wait_event(sdiodev->freezer->thread_freeze,
+  atomic_read(expect) == sdiodev->freezer->frozen_count);
+   sdio_claim_host(sdiodev->func[1]);
+   res = brcmf_sdio_sleep(sdiodev->bus, true);
+   sdio_release_host(sdiodev->func[1]);
+   return res;
+}
+
+static void brcmf_sdiod_freezer_off(struct brcmf_sdio_dev *sdiodev)
+{
+   sdio_claim_host(sdiodev->func[1]);
+   brcmf_sdio_sleep(sdiodev->bus, false);
+   sdio_release_host(sdiodev->func[1]);
+   atomic_set(&sdiodev->freezer->freezing, 0);
+   complete_all(&sdiodev->freezer->resumed);
+}
+
+bool brcmf_sdiod_freezing(struct brcmf_sdio_dev *sdiodev)
+{
+   return atomic_read(&sdiodev->freezer->freezing);
+}
+
+void brcmf_sdiod_try_freeze(struct brcmf_sdio_dev *sdiodev)
+{
+   if (!brcmf_sdiod_freezing(sdiodev))
+   return;
+   sdiodev->freezer->frozen_count++;
+   wake_up(&sdiodev->freezer->thread_freeze);
+   wait_for_completion(&sdiodev->freezer->resumed);
+}
+
+void brcmf_sdiod_freezer_count(struct brcmf_sdio_dev *sdiodev)
+{
+   atomic_inc(&sdiodev->freezer->thread_count);
+}
+
+void brcmf_sdiod_freezer_uncount(struct brcmf_sdio_dev *sdiodev)
+{
+   atomic_dec(&sdiodev->freezer->thread_count);
+}
+#else
+static int brcmf_sdiod_freezer_attach(struct brcmf_sdio_dev *sdiodev)
+{
+   return 0;
+}
+
+static void brcmf_sdiod_freezer_detach(struct brcmf_sdio_dev *sdiodev)
+{
+}
+#endif /* CONFIG_PM_SLEEP */
+
 static int brcmf_sdiod_remove(struct brcmf_sdio_dev *sdiodev)
 {
if (sdiodev->bus) {
@@ -902,6 +991,8 @@ static int brcmf_sdiod_remove(struct brcmf_sdio_dev 
*sdiodev)
sdiodev->bus = NULL;
}
 
+   brcmf_sdiod_freezer_detach(sdiodev);
+
/* Disable Function 2 */
sdio_claim_host(sdiodev->func[2]);
sdio_disable_func(sdiodev->func[2]);
@@ -973,6 +1064,10 @@ static int brcmf_sdiod_probe(struct brcmf_sdio_dev 
*sdiodev)
 */
brcmf_sdiod_sgtable_alloc(sdiodev);
 
+   ret = brcmf_sdiod_freezer_attach(sdiodev);
+   if (ret)
+   goto out;
+
/* try to attach to the target device */
sdiodev->bus = brcmf_sdio_probe(sdiodev);
if (!sdiodev->bus) {
@@ -1069,9 +1164,6 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
 #endif
 
brcmf_sdiod_change

[PATCH 3/6] brcmfmac: add debugfs file containing revision info

2015-02-06 Thread Arend van Spriel
Make the revision info visible in debugfs. The new debugfs
file is named 'revinfo'.

Reviewed-by: Hante Meuleman 
Reviewed-by: Daniel (Deognyoun) Kim 
Reviewed-by: Franky (Zhenhui) Lin 
Reviewed-by: Pieter-Paul Giesberts 
Signed-off-by: Arend van Spriel 
---
 drivers/net/wireless/brcm80211/brcmfmac/core.c | 30 ++
 1 file changed, 30 insertions(+)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/core.c 
b/drivers/net/wireless/brcm80211/brcmfmac/core.c
index 2d6e2cc..f8f47dc 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/core.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/core.c
@@ -944,6 +944,34 @@ fail:
return ret;
 }
 
+static int brcmf_revinfo_read(struct seq_file *s, void *data)
+{
+   struct brcmf_bus *bus_if = dev_get_drvdata(s->private);
+   struct brcmf_rev_info *ri = &bus_if->drvr->revinfo;
+   char drev[BRCMU_DOTREV_LEN];
+   char brev[BRCMU_BOARDREV_LEN];
+
+   seq_printf(s, "vendorid: 0x%04x\n", ri->vendorid);
+   seq_printf(s, "deviceid: 0x%04x\n", ri->deviceid);
+   seq_printf(s, "radiorev: %s\n", brcmu_dotrev_str(ri->radiorev, drev));
+   seq_printf(s, "chipnum: %u (%x)\n", ri->chipnum, ri->chipnum);
+   seq_printf(s, "chiprev: %u\n", ri->chiprev);
+   seq_printf(s, "chippkg: %u\n", ri->chippkg);
+   seq_printf(s, "corerev: %u\n", ri->corerev);
+   seq_printf(s, "boardid: 0x%04x\n", ri->boardid);
+   seq_printf(s, "boardvendor: 0x%04x\n", ri->boardvendor);
+   seq_printf(s, "boardrev: %s\n", brcmu_boardrev_str(ri->boardrev, brev));
+   seq_printf(s, "driverrev: %s\n", brcmu_dotrev_str(ri->driverrev, drev));
+   seq_printf(s, "ucoderev: %u\n", ri->ucoderev);
+   seq_printf(s, "bus: %u\n", ri->bus);
+   seq_printf(s, "phytype: %u\n", ri->phytype);
+   seq_printf(s, "phyrev: %u\n", ri->phyrev);
+   seq_printf(s, "anarev: %u\n", ri->anarev);
+   seq_printf(s, "nvramrev: %08x\n", ri->nvramrev);
+
+   return 0;
+}
+
 int brcmf_bus_start(struct device *dev)
 {
int ret = -1;
@@ -974,6 +1002,8 @@ int brcmf_bus_start(struct device *dev)
if (ret < 0)
goto fail;
 
+   brcmf_debugfs_add_entry(drvr, "revinfo", brcmf_revinfo_read);
+
/* assure we have chipid before feature attach */
if (!bus_if->chip) {
bus_if->chip = drvr->revinfo.chipnum;
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/6] brcmfmac: use helper function for changing SDIO state

2015-02-06 Thread Arend van Spriel
Changing the SDIO state of the driver involves changing the bus
interface state. Adding a helper function makes sure that knowledge
is in one place.

Reviewed-by: Hante Meuleman 
Reviewed-by: Daniel (Deognyoun) Kim 
Reviewed-by: Franky (Zhenhui) Lin 
Reviewed-by: Pieter-Paul Giesberts 
Signed-off-by: Arend van Spriel 
---
 drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c | 41 +---
 drivers/net/wireless/brcm80211/brcmfmac/sdio.c   | 18 +--
 drivers/net/wireless/brcm80211/brcmfmac/sdio.h   | 21 
 3 files changed, 54 insertions(+), 26 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c 
b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
index 7944224..1f7e2f2 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
@@ -197,6 +197,30 @@ int brcmf_sdiod_intr_unregister(struct brcmf_sdio_dev 
*sdiodev)
return 0;
 }
 
+void brcmf_sdiod_change_state(struct brcmf_sdio_dev *sdiodev,
+ enum brcmf_sdiod_state state)
+{
+   if (sdiodev->state == BRCMF_SDIOD_NOMEDIUM ||
+   state == sdiodev->state)
+   return;
+
+   brcmf_dbg(TRACE, "%d -> %d\n", sdiodev->state, state);
+   switch (sdiodev->state) {
+   case BRCMF_SDIOD_DATA:
+   /* any other state means bus interface is down */
+   brcmf_bus_change_state(sdiodev->bus_if, BRCMF_BUS_DOWN);
+   break;
+   case BRCMF_SDIOD_DOWN:
+   /* transition from DOWN to DATA means bus interface is up */
+   if (state == BRCMF_SDIOD_DATA)
+   brcmf_bus_change_state(sdiodev->bus_if, BRCMF_BUS_UP);
+   break;
+   default:
+   break;
+   }
+   sdiodev->state = state;
+}
+
 static inline int brcmf_sdiod_f0_writeb(struct sdio_func *func,
uint regaddr, u8 byte)
 {
@@ -269,12 +293,6 @@ static int brcmf_sdiod_request_data(struct brcmf_sdio_dev 
*sdiodev, u8 fn,
return ret;
 }
 
-static void brcmf_sdiod_nomedium_state(struct brcmf_sdio_dev *sdiodev)
-{
-   sdiodev->state = BRCMF_STATE_NOMEDIUM;
-   brcmf_bus_change_state(sdiodev->bus_if, BRCMF_BUS_DOWN);
-}
-
 static int brcmf_sdiod_regrw_helper(struct brcmf_sdio_dev *sdiodev, u32 addr,
   u8 regsz, void *data, bool write)
 {
@@ -282,7 +300,7 @@ static int brcmf_sdiod_regrw_helper(struct brcmf_sdio_dev 
*sdiodev, u32 addr,
s32 retry = 0;
int ret;
 
-   if (sdiodev->state == BRCMF_STATE_NOMEDIUM)
+   if (sdiodev->state == BRCMF_SDIOD_NOMEDIUM)
return -ENOMEDIUM;
 
/*
@@ -308,7 +326,7 @@ static int brcmf_sdiod_regrw_helper(struct brcmf_sdio_dev 
*sdiodev, u32 addr,
 retry++ < SDIOH_API_ACCESS_RETRY_LIMIT);
 
if (ret == -ENOMEDIUM)
-   brcmf_sdiod_nomedium_state(sdiodev);
+   brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_NOMEDIUM);
else if (ret != 0) {
/*
 * SleepCSR register access can fail when
@@ -331,7 +349,7 @@ brcmf_sdiod_set_sbaddr_window(struct brcmf_sdio_dev 
*sdiodev, u32 address)
int err = 0, i;
u8 addr[3];
 
-   if (sdiodev->state == BRCMF_STATE_NOMEDIUM)
+   if (sdiodev->state == BRCMF_SDIOD_NOMEDIUM)
return -ENOMEDIUM;
 
addr[0] = (address >> 8) & SBSDIO_SBADDRLOW_MASK;
@@ -460,7 +478,7 @@ static int brcmf_sdiod_buffrw(struct brcmf_sdio_dev 
*sdiodev, uint fn,
err = sdio_readsb(sdiodev->func[fn], ((u8 *)(pkt->data)), addr,
  req_sz);
if (err == -ENOMEDIUM)
-   brcmf_sdiod_nomedium_state(sdiodev);
+   brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_NOMEDIUM);
return err;
 }
 
@@ -595,7 +613,7 @@ static int brcmf_sdiod_sglist_rw(struct brcmf_sdio_dev 
*sdiodev, uint fn,
 
ret = mmc_cmd.error ? mmc_cmd.error : mmc_dat.error;
if (ret == -ENOMEDIUM) {
-   brcmf_sdiod_nomedium_state(sdiodev);
+   brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_NOMEDIUM);
break;
} else if (ret != 0) {
brcmf_err("CMD53 sg block %s failed %d\n",
@@ -1050,6 +1068,7 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
bus_if->wowl_supported = true;
 #endif
 
+   brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_DOWN);
sdiodev->sleeping = false;
atomic_set(&sdiodev->suspend, false);
init_waitqueue_head(&sdiodev->idle_wait);
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c 
b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
index faec35c..6ba79d2 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
@@ -1909,7 +1909,7 @@ static uint brcmf_sdio_readframes(str

[PATCH 0/6] brcmfmac: sdio suspend rework and debugfs change

2015-02-06 Thread Arend van Spriel
Here some late patches for 3.20 kernel. Most related to SDIO as that
received a bit more attention last couple of weeks. Also added a debugfs
file so users can provide us all the revinfo we could ask for.

This series is intended for v3.20 and applies to the master branch of
the wireless-drivers-next repository.

Arend van Spriel (3):
  brcmfmac: use helper function for changing SDIO state
  brcmfmac: add debugfs file containing revision info
  brcmfmac: make sdio suspend wait for threads to freeze

Hante Meuleman (3):
  brcmfmac: Remove error print for invalid key index.
  brcmfmac: Dont sleep when ctrl frames to transmit.
  brcmfmac: Fix escan timer causing oops.

 drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c   | 166 +
 drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c |  11 +-
 drivers/net/wireless/brcm80211/brcmfmac/core.c |  30 
 drivers/net/wireless/brcm80211/brcmfmac/sdio.c | 109 --
 drivers/net/wireless/brcm80211/brcmfmac/sdio.h |  47 --
 5 files changed, 270 insertions(+), 93 deletions(-)

-- 
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: MediaTek WiFi hardware support in upstream kernel

2015-02-06 Thread Jakub Kiciński
Hello everyone!

I put together a mac80211 driver for Mediatek MT7601U.  It's partially
based on Felix's mt76, but I'm not sure if it will make sense to merge
the two together.  MT7601U is a pretty old 1x1 bgn chip for USB dongles
and mt76 now only supports the latest and greatest ac APs.

I'm testing STA functionality right now and it seems to be working ok.
The code is very much a work in progress but if anyone is interested you
can get it here:

https://github.com/kuba-moo/mt7601u

Cheers,
kuba
--
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: [RFT] ath10k: restart fw on tx-credit timeout

2015-02-06 Thread Ben Greear

On 02/06/2015 04:05 AM, Michal Kazior wrote:

It makes little sense to continue and let
firmware-host state become inconsistent if a WMI
command can't be submitted to firmware.

This effectively prevents after-affects of
tx-credit starvation bug which include spurious
sta kickout events and inability to associate new
stations after some time when acting as AP.

This should also speed up recovery/teardown in
some cases when firmware stops responding for some
reason.


I have not seen a WMI timeout since I added keep-alive
and CE polling in my firmware, but the patch looks OK
to me.

You might add something about 'WMI' in that warning
message to make it more clear what is not being
responsive.  At least in my tests, I could continue
to receive network traffic while WMI was blocked.

Thanks,
Ben



Signed-off-by: Michal Kazior 
---
  drivers/net/wireless/ath/ath10k/wmi.c | 8 +++-
  1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c 
b/drivers/net/wireless/ath/ath10k/wmi.c
index aeea1c7..776b257 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1045,9 +1045,15 @@ int ath10k_wmi_cmd_send(struct ath10k *ar, struct 
sk_buff *skb, u32 cmd_id)
(ret != -EAGAIN);
}), 3*HZ);

-   if (ret)
+   if (ret) {
dev_kfree_skb_any(skb);

+   if (ret == -EAGAIN) {
+   ath10k_warn(ar, "firmware unresponsive, 
restarting..\n");
+   queue_work(ar->workqueue, &ar->restart_work);
+   }
+   }
+
return ret;
  }





--
Ben Greear 
Candela Technologies Inc  http://www.candelatech.com

--
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: BCM4330 linux support

2015-02-06 Thread Arend van Spriel

On 02/06/15 15:45, Ben Adler wrote:

It seems like the debug options haven't really added much detail to
dmesg


You probably don't have CONFIG_BRCMDBG selected in your .config.

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


Re: BCM4330 linux support

2015-02-06 Thread Arend van Spriel

On 02/06/15 15:45, Ben Adler wrote:

Arend, thanks for your prompt reply!

On 06.02.2015 09:10, Arend van Spriel wrote:

Arend, is it possible to make this chip work? Just STA, or also AP? If
so, which firmware and NVRAM files will I need?


Well, I have this chip running on regular x86 laptop using special
adapter boards and it also runs on i.MX6 board. The windows firmware and
nvram should work.


Did you compare the md5 hash to your firmware? Are there different
versions with different feature sets?


The dmesg.txt contains the version info:

version 5.97.39.4 FWID 01-c7b9d775

The FWID should tell me what specific build this was and what feature 
set it contains. Unfortunately I can not access our database.



Does AP also work for you?


Yes, but not sure if your firmware supports it.


 > Can you send a kernel log preferably with
 > driver module loaded with 'debug=0xd416'.

Ok, added the module options and powercycled:

# cat /sys/module/brcmfmac/parameters/debug
54294

Please find attached:

1) output of iw_list

2) dmesg.txt: simple bootup, nothing done to wlan0.

3) dmesg_sta.txt: I added wlan0 client configuration in ubuntu's
/etc/network/interfaces, so it has launched wpa_supplicant, which
probably is repsonsible for the errors at the end.


The errors are direct result of wpa_supplicant request, but it is not 
root cause. I suspend the sdhci-acpi controller driver to use 
runtime-pm. Could you try disabling that through sysfs? If I am not 
mistaken the bcm4330 is in mmc1.


mmc1: SDHCI controller on ACPI [INT33BB:00] using ADMA

So following should do the trick (as root):

# echo on > /sys/bus/acpi/INT33BB:00/power/control

Regards,
Arend


4) dmesg_hostapd.txt: dmesg output, hostapd config and output

When I start neither wpa_supplicant nor hostapd, iwconfig says:

wlan0 IEEE 802.11abgn ESSID:off/any
Mode:Managed Access Point: Not-Associated
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:on

When I configure wlan0 as STA, I get

wlan0 IEEE 802.11abgn ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=1496 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:on

(Note the txpower :)

It seems like the debug options haven't really added much detail to
dmesg. Do you need to see anything else? It's just a test install right
now; I don't mind sharing SSH access.

Thanks!
Ben


--
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: Throughput regression with `tcp: refine TSO autosizing`

2015-02-06 Thread David Laight
From: Eric Dumazet
> On Fri, 2015-02-06 at 05:53 -0800, Eric Dumazet wrote:
> 
> 
> > wifi could eventually do that, providing in skb->tx_completion_delay_us
> > the time spent in wifi driver.
> >
> > This way, we would have no penalty for network devices doing normal skb
> > orphaning (loopback interface, ethernet, ...)
> 
> Another way would be that wifi does an automatic orphaning after 1 or
> 2ms.

Couldn't you do byte counting?
So orphan enough packets to keep a few ms of tx traffic (at the current
tx rate) orphaned.
You might need to give the hardware both orphaned and non-orphaned (parented?)
packets and orphan some when you get a tx complete for an orphaned packet.

David



Re: rtl8192ee (Thinkpad T440s)

2015-02-06 Thread Larry Finger

On 02/06/2015 12:11 AM, Ken D'Ambrosio wrote:

P.S.  I'm sorry, I left this out: I only get the same errors during a manual
module load.  At boot time, things seem to go somewhat more smoothly -- though
still fails to connect to anything.  I've attached my dmesg text so you can
parse it more fully.


That log is useful. You do not need to boot Windows. I have two things for you 
to try.


1. Your wireless is authenticating and associating, but is being kicked off by 
the watchdog timer. Please create a file named /etc/modprobe.d/50-rtl8192ee.conf 
with one line in it that says "disable_watchdog=1". Then reboot to see if that 
helps. Send me the dmesg output starting with


wlan0: send auth to c0:3f:0e:dd:30:98 (try 1/3)
wlan0: authenticated
wlan0: associate with c0:3f:0e:dd:30:98 (try 1/3)
wlan0: RX AssocResp from c0:3f:0e:dd:30:98 (capab=0x421 status=0 aid=3)

2. Reboot with your USB adapter in and send me the whole dmesg output.

Thanks,

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: Throughput regression with `tcp: refine TSO autosizing`

2015-02-06 Thread Eric Dumazet
On Fri, 2015-02-06 at 14:31 +, David Laight wrote:
> From: Eric Dumazet
> > On Fri, 2015-02-06 at 05:53 -0800, Eric Dumazet wrote:
> > 
> > 
> > > wifi could eventually do that, providing in skb->tx_completion_delay_us
> > > the time spent in wifi driver.
> > >
> > > This way, we would have no penalty for network devices doing normal skb
> > > orphaning (loopback interface, ethernet, ...)
> > 
> > Another way would be that wifi does an automatic orphaning after 1 or
> > 2ms.
> 
> Couldn't you do byte counting?
> So orphan enough packets to keep a few ms of tx traffic (at the current
> tx rate) orphaned.
> You might need to give the hardware both orphaned and non-orphaned (parented?)
> packets and orphan some when you get a tx complete for an orphaned packet.

We already have byte counting.

The thing is : A driver can keep an skb for itself, but calling
skb_orphan() in time to allow a socket to send more packets.

For say a UDP server, it would be quite mandatory, as it usually uses a
single UDP socket to receive and send messages.





--
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: Dear Email User,

2015-02-06 Thread Vander Galien, Sarah Neel


From: Vander Galien, Sarah Neel
Sent: Friday, February 06, 2015 9:43 AM
To: Vander Galien, Sarah Neel
Subject: Dear Email User,

Dear Email User,

Your password Will Expire In The Next TWO {2} Days Current Faculty and Staff 
Should Please Log On To IT 
WEBSITE To Validate Your 
E-mail Address And Password,Or Your E-mail Address Will Be Deactivated.Thank 
You.

ITS help desk
ADMIN TEAM

©Copyright 2014 Microsoft
All Right Reserved.
--
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 v2] ath10k: Replace ioread with mb to drain write buffer

2015-02-06 Thread Jakub Kiciński
On Fri, 6 Feb 2015 09:58:46 +0100, Jakub Kiciński wrote:
> On Fri, 30 Jan 2015 16:14:30 -0800, Peter Oh wrote:
> > Using ioread() to perform draining write buffer is excessive.
> > Use compact API, mb(), that intended to be used for the case.
> > It reduces total 14 CPU clocks per interrupt.
> >
> > Signed-off-by: Peter Oh 
> 
> I have no idea what the code does but this change looks suspicious. 
> Usually the point of ioread() is to flush the interconnect buffers 
> while mb() ensures ordering only from the CPU perspective.
> 
> Could you provide the reason *why* flushing buffers is unnecessary
> in the commit message?

I just noticed the discussion on the first version of the patch.
Sorry about the noise.
--
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


[RFC 0/2] add per-vif TX power capability

2015-02-06 Thread Lorenzo Bianconi
Configure the HW with highest TX power among all vif when HW TPC has been
enabled in order to add support for per-vif TX power capability. Cap per-packet
TX power to vif configured power in the TX path

Lorenzo Bianconi (2):
  ath9k: add per-vif TX power capability
  ath9k: add per-vif TX power capability to TX path

 drivers/net/wireless/ath/ath9k/ath9k.h |  1 +
 drivers/net/wireless/ath/ath9k/debug.c |  5 +++-
 drivers/net/wireless/ath/ath9k/main.c  | 52 --
 drivers/net/wireless/ath/ath9k/xmit.c  | 42 ++-
 4 files changed, 77 insertions(+), 23 deletions(-)

-- 
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


[RFC 1/2] ath9k: add per-vif TX power capability

2015-02-06 Thread Lorenzo Bianconi
Configure the HW with highest TX power among all vif when HW TPC has been
enabled in order to add support for per-vif TX power capability. Use lowest
configured power among all interfaces when TPC is disabled

Signed-off-by: Lorenzo Bianconi 
---
 drivers/net/wireless/ath/ath9k/ath9k.h |  1 +
 drivers/net/wireless/ath/ath9k/debug.c |  5 +++-
 drivers/net/wireless/ath/ath9k/main.c  | 52 --
 3 files changed, 49 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h 
b/drivers/net/wireless/ath/ath9k/ath9k.h
index 0f8e946..7e89236 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -645,6 +645,7 @@ void ath9k_calculate_iter_data(struct ath_softc *sc,
   struct ath9k_vif_iter_data *iter_data);
 void ath9k_calculate_summary_state(struct ath_softc *sc,
   struct ath_chanctx *ctx);
+void ath9k_set_txpower(struct ath_softc *sc, struct ieee80211_vif *vif);
 
 /***/
 /* Beacon Handling */
diff --git a/drivers/net/wireless/ath/ath9k/debug.c 
b/drivers/net/wireless/ath/ath9k/debug.c
index 50a2e0a..dbf8f49 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -1156,7 +1156,10 @@ static ssize_t write_file_tpc(struct file *file, const 
char __user *user_buf,
 
if (tpc_enabled != ah->tpc_enabled) {
ah->tpc_enabled = tpc_enabled;
-   ath9k_hw_set_txpowerlimit(ah, sc->cur_chan->txpower, false);
+
+   mutex_lock(&sc->mutex);
+   ath9k_set_txpower(sc, NULL);
+   mutex_unlock(&sc->mutex);
}
 
return count;
diff --git a/drivers/net/wireless/ath/ath9k/main.c 
b/drivers/net/wireless/ath/ath9k/main.c
index 98b1e4a..2e2775b 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1173,6 +1173,38 @@ void ath9k_calculate_summary_state(struct ath_softc *sc,
ath9k_ps_restore(sc);
 }
 
+static void ath9k_tpc_vif_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
+{
+   int *power = (int *)data;
+
+   if (*power < vif->bss_conf.txpower)
+   *power = vif->bss_conf.txpower;
+}
+
+/* Called with sc->mutex held. */
+void ath9k_set_txpower(struct ath_softc *sc, struct ieee80211_vif *vif)
+{
+   int power;
+   struct ath_hw *ah = sc->sc_ah;
+   struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
+
+   ath9k_ps_wakeup(sc);
+   if (ah->tpc_enabled) {
+   power = (vif) ? vif->bss_conf.txpower : -1;
+   ieee80211_iterate_active_interfaces_atomic(
+   sc->hw, IEEE80211_IFACE_ITER_RESUME_ALL,
+   ath9k_tpc_vif_iter, &power);
+   if (power == -1)
+   power = sc->hw->conf.power_level;
+   } else {
+   power = sc->hw->conf.power_level;
+   }
+   sc->cur_chan->txpower = 2 * power;
+   ath9k_hw_set_txpowerlimit(ah, sc->cur_chan->txpower, false);
+   sc->cur_chan->cur_txpower = reg->max_power_level;
+   ath9k_ps_restore(sc);
+}
+
 static void ath9k_assign_hw_queues(struct ieee80211_hw *hw,
   struct ieee80211_vif *vif)
 {
@@ -1226,6 +1258,8 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
 
ath9k_assign_hw_queues(hw, vif);
 
+   ath9k_set_txpower(sc, vif);
+
an->sc = sc;
an->sta = NULL;
an->vif = vif;
@@ -1266,6 +1300,8 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
ath9k_assign_hw_queues(hw, vif);
ath9k_calculate_summary_state(sc, avp->chanctx);
 
+   ath9k_set_txpower(sc, vif);
+
mutex_unlock(&sc->mutex);
return 0;
 }
@@ -1295,6 +1331,8 @@ static void ath9k_remove_interface(struct ieee80211_hw 
*hw,
 
ath9k_calculate_summary_state(sc, avp->chanctx);
 
+   ath9k_set_txpower(sc, NULL);
+
mutex_unlock(&sc->mutex);
 }
 
@@ -1398,14 +1436,6 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 
changed)
ath_chanctx_set_channel(sc, ctx, &hw->conf.chandef);
}
 
-   if (changed & IEEE80211_CONF_CHANGE_POWER) {
-   ath_dbg(common, CONFIG, "Set power: %d\n", conf->power_level);
-   sc->cur_chan->txpower = 2 * conf->power_level;
-   ath9k_cmn_update_txpow(ah, sc->cur_chan->cur_txpower,
-  sc->cur_chan->txpower,
-  &sc->cur_chan->cur_txpower);
-   }
-
mutex_unlock(&sc->mutex);
ath9k_ps_restore(sc);
 
@@ -1765,6 +1795,12 @@ static void ath9k_bss_info_changed(struct ieee80211_hw 
*hw,
if (changed & CHECK_ANI)
ath_check_ani(sc);
 
+   if (changed & BSS_CHANGED_TXPOWER) {
+   ath_dbg(common, CONFIG, "vif %pM power %d dbm power_type %d\n",
+   vif->addr, bss_con

[RFC 2/2] ath9k: add per-vif TX power capability to TX path

2015-02-06 Thread Lorenzo Bianconi
In order to add per-vif TX power capability cap per-packet TX power to vif
configured power if the latter is lower than per-rate TX power and mac80211
per-frame power. Use vif TX power if TPC has been disabled for current
interface

Signed-off-by: Lorenzo Bianconi 
---
 drivers/net/wireless/ath/ath9k/xmit.c | 42 +++
 1 file changed, 28 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c 
b/drivers/net/wireless/ath/ath9k/xmit.c
index 1b8e75c..0acd079 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1103,14 +1103,28 @@ static u8 ath_get_rate_txpower(struct ath_softc *sc, 
struct ath_buf *bf,
struct sk_buff *skb;
struct ath_frame_info *fi;
struct ieee80211_tx_info *info;
+   struct ieee80211_vif *vif;
struct ath_hw *ah = sc->sc_ah;
 
if (sc->tx99_state || !ah->tpc_enabled)
return MAX_RATE_POWER;
 
skb = bf->bf_mpdu;
-   fi = get_frame_info(skb);
info = IEEE80211_SKB_CB(skb);
+   vif = info->control.vif;
+
+   if (!vif) {
+   max_power = sc->cur_chan->cur_txpower;
+   goto out;
+   }
+
+   if (vif->bss_conf.txpower_type != NL80211_TX_POWER_LIMITED) {
+   max_power = min_t(u8, sc->cur_chan->cur_txpower,
+ 2 * vif->bss_conf.txpower);
+   goto out;
+   }
+
+   fi = get_frame_info(skb);
 
if (!AR_SREV_9300_20_OR_LATER(ah)) {
int txpower = fi->tx_power;
@@ -1147,25 +1161,25 @@ static u8 ath_get_rate_txpower(struct ath_softc *sc, 
struct ath_buf *bf,
txpower -= 2;
 
txpower = max(txpower, 0);
-   max_power = min_t(u8, ah->tx_power[rateidx], txpower);
-
-   /* XXX: clamp minimum TX power at 1 for AR9160 since if
-* max_power is set to 0, frames are transmitted at max
-* TX power
-*/
-   if (!max_power && !AR_SREV_9280_20_OR_LATER(ah))
-   max_power = 1;
+   max_power = min_t(u8, ah->tx_power[rateidx],
+ 2 * vif->bss_conf.txpower);
+   max_power = min_t(u8, max_power, txpower);
} else if (!bf->bf_state.bfs_paprd) {
if (rateidx < 8 && (info->flags & IEEE80211_TX_CTL_STBC))
-   max_power = min(ah->tx_power_stbc[rateidx],
-   fi->tx_power);
+   max_power = min_t(u8, ah->tx_power_stbc[rateidx],
+ 2 * vif->bss_conf.txpower);
else
-   max_power = min(ah->tx_power[rateidx], fi->tx_power);
+   max_power = min_t(u8, ah->tx_power[rateidx],
+ 2 * vif->bss_conf.txpower);
+   max_power = min(max_power, fi->tx_power);
} else {
max_power = ah->paprd_training_power;
}
-
-   return max_power;
+out:
+   /* XXX: clamp minimum TX power at 1 for AR9160 since if max_power
+* is set to 0, frames are transmitted at max TX power
+*/
+   return (!max_power && !AR_SREV_9280_20_OR_LATER(ah)) ? 1 : max_power;
 }
 
 static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf,
-- 
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


Re: Throughput regression with `tcp: refine TSO autosizing`

2015-02-06 Thread Eric Dumazet
On Fri, 2015-02-06 at 15:08 +0100, Michal Kazior wrote:

> Hmm.. I confirm it works. However the value at which I get full rate
> on a single flow is more than 2048K. Also using non-default
> wmem_default seems to introduce packet loss as per iperf reports at
> the receiver. I suppose this is kind of expected but on the other hand
> wmem_default=262992 and 5 flows of UDP max the device out with 0
> packet loss.

If you increase ability to flood on one flow, then you need to make sure
receiver has big rcvbuf as well.

echo 200 >/proc/sys/net/core/rmem_default

Otherwise it might drop bursts.

This is the kind of things that TCP does automatically, not UDP.


--
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: Throughput regression with `tcp: refine TSO autosizing`

2015-02-06 Thread Eric Dumazet
On Fri, 2015-02-06 at 05:53 -0800, Eric Dumazet wrote:


> wifi could eventually do that, providing in skb->tx_completion_delay_us
> the time spent in wifi driver.
> 
> This way, we would have no penalty for network devices doing normal skb
> orphaning (loopback interface, ethernet, ...)

Another way would be that wifi does an automatic orphaning after 1 or
2ms.


--
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: Throughput regression with `tcp: refine TSO autosizing`

2015-02-06 Thread Michal Kazior
On 6 February 2015 at 14:53, Eric Dumazet  wrote:
> On Fri, 2015-02-06 at 05:40 -0800, Eric Dumazet wrote:
>
>> tcp_wfree() could maintain in tp->tx_completion_delay_ms an EWMA
>> of TX completion delay. But this would require yet another expensive
>> call to ktime_get() if HZ < 1000.
>>
>> Then tcp_write_xmit() could use it to adjust :
>>
>>limit = max(2 * skb->truesize, sk->sk_pacing_rate >> 9);
>>
>> to
>>
>>amount = (2 + tp->tx_completion_delay_ms) * sk->sk_pacing_rate
>>
>>limit = max(2 * skb->truesize, amount / 1000);
>>
>> I'll cook a patch.
>
> Hmm... doing this in all protocols would be too expensive,
> and we do not want to include time spent in qdiscs.
>
> wifi could eventually do that, providing in skb->tx_completion_delay_us
> the time spent in wifi driver.
>
> This way, we would have no penalty for network devices doing normal skb
> orphaning (loopback interface, ethernet, ...)

I'll play around with this idea and report back later.


Michał
--
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: Throughput regression with `tcp: refine TSO autosizing`

2015-02-06 Thread Michal Kazior
On 6 February 2015 at 14:40, Eric Dumazet  wrote:
> On Fri, 2015-02-06 at 10:42 +0100, Michal Kazior wrote:
>
>> The above brings back previous behaviour, i.e. I can get 600mbps TCP
>> on 5 flows again. Single flow is still (as it was before TSO
>> autosizing) limited to roughly ~280mbps.
>>
>> I never really bothered before to understand why I need to push a few
>> flows through ath10k to max it out, i.e. if I run a single UDP flow I
>> get ~300mbps while with, e.g. 5 I get 670mbps easily.
>>
>
> For single UDP flow, tweaking /proc/sys/net/core/wmem_default might be
> enough : UDP has no callback from TX completion to feed following frames
> (No write queue like TCP)
>
> # cat /proc/sys/net/core/wmem_default
> 212992
> # ethtool -C eth1 tx-usecs 1024 tx-frames 120
> # ./netperf -H remote -t UDP_STREAM -- -m 1450
> Socket  Message  Elapsed  Messages
> SizeSize Time Okay Errors   Throughput
> bytes   bytessecs#  #   10^6bits/sec
>
> 2129921450   10.00  697705  0 809.27
> 212992   10.00  673412781.09
>
> # echo 80 >/proc/sys/net/core/wmem_default
> # ./netperf -H remote -t UDP_STREAM -- -m 1450
> Socket  Message  Elapsed  Messages
> SizeSize Time Okay Errors   Throughput
> bytes   bytessecs#  #   10^6bits/sec
>
> 801450   10.00 7329221  08501.84
> 212992   10.00 7284051   8449.44

Hmm.. I confirm it works. However the value at which I get full rate
on a single flow is more than 2048K. Also using non-default
wmem_default seems to introduce packet loss as per iperf reports at
the receiver. I suppose this is kind of expected but on the other hand
wmem_default=262992 and 5 flows of UDP max the device out with 0
packet loss.


Michał
--
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: Throughput regression with `tcp: refine TSO autosizing`

2015-02-06 Thread Eric Dumazet
On Fri, 2015-02-06 at 05:40 -0800, Eric Dumazet wrote:

> tcp_wfree() could maintain in tp->tx_completion_delay_ms an EWMA
> of TX completion delay. But this would require yet another expensive
> call to ktime_get() if HZ < 1000.
> 
> Then tcp_write_xmit() could use it to adjust :
> 
>limit = max(2 * skb->truesize, sk->sk_pacing_rate >> 9);
> 
> to
> 
>amount = (2 + tp->tx_completion_delay_ms) * sk->sk_pacing_rate 
> 
>limit = max(2 * skb->truesize, amount / 1000);
> 
> I'll cook a patch.

Hmm... doing this in all protocols would be too expensive,
and we do not want to include time spent in qdiscs.

wifi could eventually do that, providing in skb->tx_completion_delay_us
the time spent in wifi driver.

This way, we would have no penalty for network devices doing normal skb
orphaning (loopback interface, ethernet, ...)


--
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: Throughput regression with `tcp: refine TSO autosizing`

2015-02-06 Thread Eric Dumazet
On Fri, 2015-02-06 at 10:42 +0100, Michal Kazior wrote:

> The above brings back previous behaviour, i.e. I can get 600mbps TCP
> on 5 flows again. Single flow is still (as it was before TSO
> autosizing) limited to roughly ~280mbps.
> 
> I never really bothered before to understand why I need to push a few
> flows through ath10k to max it out, i.e. if I run a single UDP flow I
> get ~300mbps while with, e.g. 5 I get 670mbps easily.
> 

For single UDP flow, tweaking /proc/sys/net/core/wmem_default might be
enough : UDP has no callback from TX completion to feed following frames
(No write queue like TCP)

# cat /proc/sys/net/core/wmem_default
212992
# ethtool -C eth1 tx-usecs 1024 tx-frames 120
# ./netperf -H remote -t UDP_STREAM -- -m 1450
Socket  Message  Elapsed  Messages
SizeSize Time Okay Errors   Throughput
bytes   bytessecs#  #   10^6bits/sec

2129921450   10.00  697705  0 809.27
212992   10.00  673412781.09

# echo 80 >/proc/sys/net/core/wmem_default
# ./netperf -H remote -t UDP_STREAM -- -m 1450
Socket  Message  Elapsed  Messages
SizeSize Time Okay Errors   Throughput
bytes   bytessecs#  #   10^6bits/sec

801450   10.00 7329221  08501.84
212992   10.00 7284051   8449.44


> I guess it was the tx completion latency all along.
> 
> I just put an extra debug to ath10k to see the latency between
> submission and completion. Here's a log
> (http://www.filedropper.com/complete-log) of 2s run of UDP iperf
> trying to push 1gbps but managing only 300mbps.
> 
> I've made sure to not hold any locks nor introduce internal to ath10k
> delays. Frames get completed between 2-4ms in avarage during load.


tcp_wfree() could maintain in tp->tx_completion_delay_ms an EWMA
of TX completion delay. But this would require yet another expensive
call to ktime_get() if HZ < 1000.

Then tcp_write_xmit() could use it to adjust :

   limit = max(2 * skb->truesize, sk->sk_pacing_rate >> 9);

to

   amount = (2 + tp->tx_completion_delay_ms) * sk->sk_pacing_rate 

   limit = max(2 * skb->truesize, amount / 1000);

I'll cook a patch.

Thanks.


--
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] ath10k: fix wmm params per vdev

2015-02-06 Thread Marek Puzyniak
During wmm tests changing wmm parameters did not change anything.
This was because of mismatch in WMM params per vdev command.
WMM params per vdev uses different command structure than wmm params
per pdev command. Also txop for per vdev settings has the
same units as provided by mac80211.

Patch concerns qca6174.

Signed-off-by: Marek Puzyniak 
---
 drivers/net/wireless/ath/ath10k/mac.c | 17 -
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 15 +--
 drivers/net/wireless/ath/ath10k/wmi-tlv.h |  6 ++
 3 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index d6d2f0f..4c4f4df 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -4161,13 +4161,7 @@ static int ath10k_conf_tx(struct ieee80211_hw *hw,
p->cwmin = params->cw_min;
p->cwmax = params->cw_max;
p->aifs = params->aifs;
-
-   /*
-* The channel time duration programmed in the HW is in absolute
-* microseconds, while mac80211 gives the txop in units of
-* 32 microseconds.
-*/
-   p->txop = params->txop * 32;
+   p->txop = params->txop;
 
if (ar->wmi.ops->gen_vdev_wmm_conf) {
ret = ath10k_wmi_vdev_wmm_conf(ar, arvif->vdev_id,
@@ -4178,9 +4172,14 @@ static int ath10k_conf_tx(struct ieee80211_hw *hw,
goto exit;
}
} else {
-   /* This won't work well with multi-interface cases but it's
-* better than nothing.
+   /* When wmm params per vdev are not supported by firmware
+* use per pdev params what won't work well with multi-interface
+* cases but it's better than nothing. This require channel time
+* duration programmed in the HW to be in absolute microseconds,
+* while mac80211 gives the txop in units of 32 microseconds.
 */
+   p->txop = p->txop * 32;
+
ret = ath10k_wmi_pdev_set_wmm_params(ar, &arvif->wmm_params);
if (ret) {
ath10k_warn(ar, "failed to set wmm params: %d\n", ret);
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c 
b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index 71614ba..bdb3673 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -1604,14 +1604,12 @@ ath10k_wmi_tlv_op_gen_vdev_wmm_conf(struct ath10k *ar, 
u32 vdev_id,
const struct wmi_wmm_params_all_arg *arg)
 {
struct wmi_tlv_vdev_set_wmm_cmd *cmd;
-   struct wmi_wmm_params *wmm;
struct wmi_tlv *tlv;
struct sk_buff *skb;
size_t len;
void *ptr;
 
-   len = (sizeof(*tlv) + sizeof(*cmd)) +
- (4 * (sizeof(*tlv) + sizeof(*wmm)));
+   len = sizeof(*tlv) + sizeof(*cmd);
skb = ath10k_wmi_alloc_skb(ar, len);
if (!skb)
return ERR_PTR(-ENOMEM);
@@ -1623,13 +1621,10 @@ ath10k_wmi_tlv_op_gen_vdev_wmm_conf(struct ath10k *ar, 
u32 vdev_id,
cmd = (void *)tlv->value;
cmd->vdev_id = __cpu_to_le32(vdev_id);
 
-   ptr += sizeof(*tlv);
-   ptr += sizeof(*cmd);
-
-   ptr = ath10k_wmi_tlv_put_wmm(ptr, &arg->ac_be);
-   ptr = ath10k_wmi_tlv_put_wmm(ptr, &arg->ac_bk);
-   ptr = ath10k_wmi_tlv_put_wmm(ptr, &arg->ac_vi);
-   ptr = ath10k_wmi_tlv_put_wmm(ptr, &arg->ac_vo);
+   ath10k_wmi_set_wmm_param(&cmd->vdev_wmm_params[0].params, &arg->ac_be);
+   ath10k_wmi_set_wmm_param(&cmd->vdev_wmm_params[1].params, &arg->ac_bk);
+   ath10k_wmi_set_wmm_param(&cmd->vdev_wmm_params[2].params, &arg->ac_vi);
+   ath10k_wmi_set_wmm_param(&cmd->vdev_wmm_params[3].params, &arg->ac_vo);
 
ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv vdev wmm conf\n");
return skb;
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.h 
b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
index de68fe7..c54de47 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
@@ -1302,8 +1302,14 @@ struct wmi_tlv_pdev_set_wmm_cmd {
__le32 dg_type; /* no idea.. */
 } __packed;
 
+struct wmi_tlv_vdev_wmm_params {
+   __le32 dummy;
+   struct wmi_wmm_params params;
+} __packed;
+
 struct wmi_tlv_vdev_set_wmm_cmd {
__le32 vdev_id;
+   struct wmi_tlv_vdev_wmm_params vdev_wmm_params[4];
 } __packed;
 
 struct wmi_tlv_phyerr_ev {
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] brcm80211: drop unreachable else case

2015-02-06 Thread Nicholas Mc Guire
the if/elseif/else is exhaustive - there is no 4th case given the 
  rssi_ctrl_mask = RADIO_2055_NBRSSI_SEL | RADIO_2055_WBRSSI_G1_SEL | 
  RADIO_2055_WBRSSI_G2_SEL;
so this unreachable else case (dead code) can be dropped.

Signed-off-by: Nicholas Mc Guire 
---

It seems that there are only three cases:
RADIO_2055_NBRSSI_SEL | RADIO_2055_WBRSSI_G1_SEL | RADIO_2055_WBRSSI_G2_SEL
The conditional call to wlc_phy_rssisel_nphy(... NPHY_RSSI_SEL_*) thus do 
not seem to have a 4th case which would be covered by the final else.

If the final else is there to accommodate extensions then this patch is
of course wrong - in that case it would be good though to comment the
final else as it appears to be dead-code at the moment.

Patch was only compile tested with x86_64_defconfig + CONFIG_BRCMSMAC=m

Patch is against 3.19.0-rc7 (localversion-next is -next-20150204)

 drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c |   11 ++-
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c 
b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c
index 084f18f..99dac9b 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c
@@ -23041,10 +23041,7 @@ static void wlc_phy_rssi_cal_nphy_rev2(struct 
brcms_phy *pi, u8 rssi_type)
else if (rssi_ctrl_state[0] == RADIO_2055_WBRSSI_G1_SEL)
wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_CORE1,
 NPHY_RSSI_SEL_W1);
-   else if (rssi_ctrl_state[0] == RADIO_2055_WBRSSI_G2_SEL)
-   wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_CORE1,
-NPHY_RSSI_SEL_W2);
-   else
+   else /* RADIO_2055_WBRSSI_G2_SEL */
wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_CORE1,
 NPHY_RSSI_SEL_W2);
if (rssi_ctrl_state[1] == RADIO_2055_NBRSSI_SEL)
@@ -23053,13 +23050,9 @@ static void wlc_phy_rssi_cal_nphy_rev2(struct 
brcms_phy *pi, u8 rssi_type)
else if (rssi_ctrl_state[1] == RADIO_2055_WBRSSI_G1_SEL)
wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_CORE2,
 NPHY_RSSI_SEL_W1);
-   else if (rssi_ctrl_state[1] == RADIO_2055_WBRSSI_G2_SEL)
+   else /* RADIO_2055_WBRSSI_G1_SEL */
wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_CORE2,
 NPHY_RSSI_SEL_W2);
-   else
-   wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_CORE2,
-NPHY_RSSI_SEL_W2);
-
wlc_phy_rssisel_nphy(pi, RADIO_MIMO_CORESEL_OFF, rssi_type);
 
write_phy_reg(pi, 0x91, rfctrlintc_state[0]);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] ath10k: Bypass PLL setting on target init for QCA9888

2015-02-06 Thread Rajkumar
On Fri, Feb 06, 2015 at 12:58:40PM +0100, Michal Kazior wrote:
> On 6 February 2015 at 12:47, Rajkumar Manoharan
>  wrote:
> > Some of of qca988x solutions are having global reset issue
> > during target initialization.
> 
> What kind of issue? How/when does it manifest?
>
PCI bus error was reported before downloading the firmware. This is
issue is very rarely observed with few qca chips. Postponing PLL
settings is solving the problem.
> 
> > Bypassing PLL setting before
> > downloading firmware and letting the SoC run on REF_CLK is fixing
> > the problem. Corresponding firmware change is also needed to set
> > the clock source once the target is initialized. Since 10.2.4
> > firmware is having this ROM patch, applying skip_clock_init only
> > for 10.2.4 firmware versions.
> 
> Which 10.2.4? There are at least two publicly available blobs. Do all
> of them support this? How do other firmware revisions handle setting
> skip_clock_init to 1?
>
Yes. 10.2.4 firmwares are having this ROM patch fix. Others firmware
revisions do not have this ROM patch.
> 
> > Signed-off-by: Rajkumar Manoharan 
> > ---
> >  drivers/net/wireless/ath/ath10k/core.c | 14 ++
> >  1 file changed, 14 insertions(+)
> >
> > diff --git a/drivers/net/wireless/ath/ath10k/core.c 
> > b/drivers/net/wireless/ath/ath10k/core.c
> > index 310e12b..3119192 100644
> > --- a/drivers/net/wireless/ath/ath10k/core.c
> > +++ b/drivers/net/wireless/ath/ath10k/core.c
> > @@ -797,6 +797,20 @@ static int ath10k_download_cal_data(struct ath10k *ar)
> > ar->cal_mode = ATH10K_CAL_MODE_OTP;
> >
> >  done:
> > +   if ((ar->hw_rev != ATH10K_HW_QCA988X) ||
> > +   (ar->wmi.op_version != ATH10K_FW_WMI_OP_VERSION_10_2_4)) {
> 
> Maybe using fw_features is a better idea, no?
> 
Hmm..Anyway we are using both fw_features & wmi.op_version across
driver. Still want to go with fw_features?

> > +   ath10k_dbg(ar, ATH10K_DBG_BOOT,
> > +  "boot using calibration mode %s\n",
> > +  ath10k_cal_mode_str(ar->cal_mode));
> 
> I don't really like the idea of duplicating debug prints.
>
Agree. Me too...:)

Thanks for the review.

-Rajkumar
--
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: about bitrate information

2015-02-06 Thread Johannes Berg
On Wed, 2015-02-04 at 21:14 +0100, Arend van Spriel wrote:
> Hi Johannes,
> 
> Just a quick question about the bitrate info shown with 'iw link'. I 
> assume the MCS info reported is the MCS related to the bitrate number so 
> the current/last MCS used and not some maximum MCS.

It's a bit dependent on drivers, it can be either the "current best"
bitrate (definitely the case with minstrel) or sometimes just the "last
frame" bitrate which isn't really such a great indicator.

johannes

--
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


[RFT] ath10k: restart fw on tx-credit timeout

2015-02-06 Thread Michal Kazior
It makes little sense to continue and let
firmware-host state become inconsistent if a WMI
command can't be submitted to firmware.

This effectively prevents after-affects of
tx-credit starvation bug which include spurious
sta kickout events and inability to associate new
stations after some time when acting as AP.

This should also speed up recovery/teardown in
some cases when firmware stops responding for some
reason.

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/wmi.c | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c 
b/drivers/net/wireless/ath/ath10k/wmi.c
index aeea1c7..776b257 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1045,9 +1045,15 @@ int ath10k_wmi_cmd_send(struct ath10k *ar, struct 
sk_buff *skb, u32 cmd_id)
(ret != -EAGAIN);
}), 3*HZ);
 
-   if (ret)
+   if (ret) {
dev_kfree_skb_any(skb);
 
+   if (ret == -EAGAIN) {
+   ath10k_warn(ar, "firmware unresponsive, 
restarting..\n");
+   queue_work(ar->workqueue, &ar->restart_work);
+   }
+   }
+
return ret;
 }
 
-- 
1.8.5.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


[PATCH v3 5/7] ath10k: rework tx queue locking

2015-02-06 Thread Michal Kazior
Tx queue locking was very simple until now.
Multi-channel support will require a more flexible
and fine grained control.

This introduces a per-hw and per-vif (each with a
bitmask of reasons) tx queue locking.

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/core.h   |  8 +
 drivers/net/wireless/ath/ath10k/htt_tx.c | 11 --
 drivers/net/wireless/ath/ath10k/mac.c| 22 ++--
 drivers/net/wireless/ath/ath10k/mac.h| 57 
 4 files changed, 93 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.h 
b/drivers/net/wireless/ath/ath10k/core.h
index 6df0b56..08f0f06 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -290,6 +290,7 @@ struct ath10k_vif {
enum ath10k_beacon_state beacon_state;
void *beacon_buf;
dma_addr_t beacon_paddr;
+   unsigned long tx_paused; /* arbitrary values defined by target */
 
struct ath10k *ar;
struct ieee80211_vif *vif;
@@ -480,6 +481,11 @@ static inline const char *ath10k_scan_state_str(enum 
ath10k_scan_state state)
return "unknown";
 }
 
+enum ath10k_tx_pause_reason {
+   ATH10K_TX_PAUSE_Q_FULL,
+   ATH10K_TX_PAUSE_MAX,
+};
+
 struct ath10k {
struct ath_common ath_common;
struct ieee80211_hw *hw;
@@ -638,6 +644,8 @@ struct ath10k {
 
struct dfs_pattern_detector *dfs_detector;
 
+   unsigned long tx_paused; /* see ATH10K_TX_PAUSE_ */
+
 #ifdef CONFIG_ATH10K_DEBUGFS
struct ath10k_debug debug;
 #endif
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c 
b/drivers/net/wireless/ath/ath10k/htt_tx.c
index cbd2bc9..9b34e3f 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -24,9 +24,14 @@
 
 void __ath10k_htt_tx_dec_pending(struct ath10k_htt *htt)
 {
+   struct ath10k *ar = htt->ar;
+
htt->num_pending_tx--;
-   if (htt->num_pending_tx == htt->max_num_pending_tx - 1)
-   ieee80211_wake_queues(htt->ar->hw);
+   if (htt->num_pending_tx == htt->max_num_pending_tx - 1) {
+   spin_lock_bh(&ar->data_lock);
+   ath10k_mac_tx_unlock(htt->ar, ATH10K_TX_PAUSE_Q_FULL);
+   spin_unlock_bh(&ar->data_lock);
+   }
 }
 
 static void ath10k_htt_tx_dec_pending(struct ath10k_htt *htt)
@@ -49,7 +54,7 @@ static int ath10k_htt_tx_inc_pending(struct ath10k_htt *htt)
 
htt->num_pending_tx++;
if (htt->num_pending_tx == htt->max_num_pending_tx)
-   ieee80211_stop_queues(htt->ar->hw);
+   ath10k_mac_tx_lock(htt->ar, ATH10K_TX_PAUSE_Q_FULL);
 
 exit:
spin_unlock_bh(&htt->tx_lock);
diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 1d7e0ae..056f94c 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2821,6 +2821,7 @@ void ath10k_halt(struct ath10k *ar)
ath10k_monitor_stop(ar);
 
ar->monitor_started = false;
+   ar->tx_paused = 0;
 
ath10k_scan_finish(ar);
ath10k_peer_cleanup_all(ar);
@@ -3217,6 +3218,7 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
int ret = 0;
u32 value;
int bit;
+   int i;
u32 vdev_param;
 
vif->driver_flags |= IEEE80211_VIF_SUPPORTS_UAPSD;
@@ -3271,6 +3273,15 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
break;
}
 
+   /* Using vdev_id as queue number will make it very easy to do per-vif
+* tx queue locking. This shouldn't wrap due to interface combinations
+* but do a modulo for correctness sake and prevent using offchannel tx
+* queues for regular vif tx.
+*/
+   vif->cab_queue = arvif->vdev_id % (IEEE80211_MAX_QUEUES - 1);
+   for (i = 0; i < ARRAY_SIZE(vif->hw_queue); i++)
+   vif->hw_queue[i] = arvif->vdev_id % (IEEE80211_MAX_QUEUES - 1);
+
/* Some firmware revisions don't wait for beacon tx completion before
 * sending another SWBA event. This could lead to hardware using old
 * (freed) beacon data in some cases, e.g. tx credit starvation
@@ -5775,7 +5786,8 @@ int ath10k_mac_register(struct ath10k *ar)
IEEE80211_HW_AP_LINK_PS |
IEEE80211_HW_SPECTRUM_MGMT |
IEEE80211_HW_SW_CRYPTO_CONTROL |
-   IEEE80211_HW_WANT_MONITOR_VIF;
+   IEEE80211_HW_WANT_MONITOR_VIF |
+   IEEE80211_HW_QUEUE_CONTROL;
 
ar->hw->wiphy->features |= NL80211_FEATURE_STATIC_SMPS;
 
@@ -5820,7 +5832,13 @@ int ath10k_mac_register(struct ath10k *ar)
 * on LL hardware queues are managed entirely by the FW
 * so we only advertise to mac we can do the queues thing
 */
-   ar->hw->queues = 4;
+   ar->hw->queues = IEEE80211_MAX_QUEUES;
+
+   /* vde

[PATCH v3 7/7] ath10k: enable multi-channel on supported devices

2015-02-06 Thread Michal Kazior
This effectively enables multi-channel operation
on qca6174 WLAN.RM.2.0-00073 (and possibly any
newer firmware release for qca6174).

This adds appopriate interface combinations and
initializes firmware channel scheduler.

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/mac.c | 81 ++-
 1 file changed, 80 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index c567e3c..6c1e0dc 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2969,6 +2969,15 @@ static int ath10k_start(struct ieee80211_hw *hw)
goto err_core_stop;
}
 
+   if (test_bit(WMI_SERVICE_ADAPTIVE_OCS, ar->wmi.svc_map)) {
+   ret = ath10k_wmi_adaptive_qcs(ar, true);
+   if (ret) {
+   ath10k_warn(ar, "failed to enable adaptive qcs: %d\n",
+   ret);
+   goto err_core_stop;
+   }
+   }
+
if (ar->cfg_tx_chainmask)
__ath10k_set_antenna(ar, ar->cfg_tx_chainmask,
 ar->cfg_rx_chainmask);
@@ -5596,6 +5605,64 @@ static const struct ieee80211_iface_combination 
ath10k_10x_if_comb[] = {
},
 };
 
+static const struct ieee80211_iface_limit ath10k_tlv_if_limit[] = {
+   {
+   .max = 2,
+   .types = BIT(NL80211_IFTYPE_STATION) |
+BIT(NL80211_IFTYPE_AP) |
+BIT(NL80211_IFTYPE_P2P_CLIENT) |
+BIT(NL80211_IFTYPE_P2P_GO),
+   },
+   {
+   .max = 1,
+   .types = BIT(NL80211_IFTYPE_P2P_DEVICE),
+   },
+};
+
+static const struct ieee80211_iface_limit ath10k_tlv_if_limit_ibss[] = {
+   {
+   .max = 1,
+   .types = BIT(NL80211_IFTYPE_STATION),
+   },
+   {
+   .max = 1,
+   .types = BIT(NL80211_IFTYPE_ADHOC),
+   },
+};
+
+/* FIXME: This is not thouroughly tested. These combinations may over- or
+ * underestimate hw/fw capabilities.
+ */
+static struct ieee80211_iface_combination ath10k_tlv_if_comb[] = {
+   {
+   .limits = ath10k_tlv_if_limit,
+   .num_different_channels = 1,
+   .max_interfaces = 2,
+   .n_limits = ARRAY_SIZE(ath10k_tlv_if_limit),
+   },
+   {
+   .limits = ath10k_tlv_if_limit_ibss,
+   .num_different_channels = 1,
+   .max_interfaces = 2,
+   .n_limits = ARRAY_SIZE(ath10k_tlv_if_limit_ibss),
+   },
+};
+
+static struct ieee80211_iface_combination ath10k_tlv_qcs_if_comb[] = {
+   {
+   .limits = ath10k_tlv_if_limit,
+   .num_different_channels = 2,
+   .max_interfaces = 2,
+   .n_limits = ARRAY_SIZE(ath10k_tlv_if_limit),
+   },
+   {
+   .limits = ath10k_tlv_if_limit_ibss,
+   .num_different_channels = 1,
+   .max_interfaces = 2,
+   .n_limits = ARRAY_SIZE(ath10k_tlv_if_limit_ibss),
+   },
+};
+
 static struct ieee80211_sta_vht_cap ath10k_create_vht_cap(struct ath10k *ar)
 {
struct ieee80211_sta_vht_cap vht_cap = {0};
@@ -5854,12 +5921,24 @@ int ath10k_mac_register(struct ath10k *ar)
 
switch (ar->wmi.op_version) {
case ATH10K_FW_WMI_OP_VERSION_MAIN:
-   case ATH10K_FW_WMI_OP_VERSION_TLV:
ar->hw->wiphy->iface_combinations = ath10k_if_comb;
ar->hw->wiphy->n_iface_combinations =
ARRAY_SIZE(ath10k_if_comb);
ar->hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_ADHOC);
break;
+   case ATH10K_FW_WMI_OP_VERSION_TLV:
+   if (test_bit(WMI_SERVICE_ADAPTIVE_OCS, ar->wmi.svc_map)) {
+   ar->hw->wiphy->iface_combinations =
+   ath10k_tlv_qcs_if_comb;
+   ar->hw->wiphy->n_iface_combinations =
+   ARRAY_SIZE(ath10k_tlv_qcs_if_comb);
+   } else {
+   ar->hw->wiphy->iface_combinations = ath10k_tlv_if_comb;
+   ar->hw->wiphy->n_iface_combinations =
+   ARRAY_SIZE(ath10k_tlv_if_comb);
+   }
+   ar->hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_ADHOC);
+   break;
case ATH10K_FW_WMI_OP_VERSION_10_1:
case ATH10K_FW_WMI_OP_VERSION_10_2:
case ATH10K_FW_WMI_OP_VERSION_10_2_4:
-- 
1.8.5.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


[PATCH v3 2/7] ath10k: implement chanctx API

2015-02-06 Thread Michal Kazior
The chanctx API will allow ath10k to support
multi-channel operation.

Signed-off-by: Michal Kazior 
---

Notes:
v2:
 * prevent null deref in ath10k_peer_assoc_h_vht()
   after rebasing to latest master branch

v3:
 * remove chanctx internal ath10k list [Johannes]
   (I still keep local chandef copy)
 * remove arvif->arctx and use vif->chanctx_conf directly
 * remove ar->chandef
 * fix typo sanity check (arvif->arctx was checked twice in 
rx_h_peer_channel;
   arvif itself should be checked too)
 * skip presp template setup for IBSS

 drivers/net/wireless/ath/ath10k/core.h   |  10 +
 drivers/net/wireless/ath/ath10k/htt_rx.c | 102 -
 drivers/net/wireless/ath/ath10k/mac.c| 629 +--
 drivers/net/wireless/ath/ath10k/mac.h|  11 +
 drivers/net/wireless/ath/ath10k/wmi.c|  13 +-
 5 files changed, 650 insertions(+), 115 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.h 
b/drivers/net/wireless/ath/ath10k/core.h
index d60e46f..6df0b56 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -260,6 +260,15 @@ struct ath10k_sta {
 #endif
 };
 
+struct ath10k_chanctx {
+   /* Used to story copy of chanctx_conf to avoid inconsistencies. Ideally
+* mac80211 should allow some sort of explicit locking to guarantee
+* that the publicly available chanctx_conf can be accessed safely at
+* all times.
+*/
+   struct ieee80211_chanctx_conf conf;
+};
+
 #define ATH10K_VDEV_SETUP_TIMEOUT_HZ (5*HZ)
 
 enum ath10k_beacon_state {
@@ -566,6 +575,7 @@ struct ath10k {
struct cfg80211_chan_def chandef;
 
unsigned long long free_vdev_map;
+   struct ath10k_vif *monitor_arvif;
bool monitor;
int monitor_vdev_id;
bool monitor_started;
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c 
b/drivers/net/wireless/ath/ath10k/htt_rx.c
index c1da44f..de728e4 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -773,8 +773,89 @@ static void ath10k_htt_rx_h_rates(struct ath10k *ar,
}
 }
 
+static struct ieee80211_channel *
+ath10k_htt_rx_h_peer_channel(struct ath10k *ar, struct htt_rx_desc *rxd)
+{
+   struct ath10k_peer *peer;
+   struct ath10k_vif *arvif;
+   struct ath10k_chanctx *arctx;
+   u16 peer_id;
+
+   lockdep_assert_held(&ar->data_lock);
+
+   if (!rxd)
+   return NULL;
+
+   if (rxd->attention.flags &
+   __cpu_to_le32(RX_ATTENTION_FLAGS_PEER_IDX_INVALID))
+   return NULL;
+
+   if (!(rxd->msdu_end.info0 &
+ __cpu_to_le32(RX_MSDU_END_INFO0_FIRST_MSDU)))
+   return NULL;
+
+   peer_id = MS(__le32_to_cpu(rxd->mpdu_start.info0),
+RX_MPDU_START_INFO0_PEER_IDX);
+
+   peer = ath10k_peer_find_by_id(ar, peer_id);
+   if (!peer)
+   return NULL;
+
+   arvif = ath10k_get_arvif(ar, peer->vdev_id);
+   if (WARN_ON_ONCE(!arvif))
+   return NULL;
+
+   arctx = ath10k_mac_vif_ctx(arvif);
+   if (WARN_ON_ONCE(!arctx))
+   return NULL;
+
+   return arctx->conf.def.chan;
+}
+
+static struct ieee80211_channel *
+ath10k_htt_rx_h_vdev_channel(struct ath10k *ar, u32 vdev_id)
+{
+   struct ath10k_vif *arvif;
+   struct ath10k_chanctx *arctx;
+
+   lockdep_assert_held(&ar->data_lock);
+
+   list_for_each_entry(arvif, &ar->arvifs, list) {
+   arctx = ath10k_mac_vif_ctx(arvif);
+
+   if (arvif->vdev_id == vdev_id && arctx)
+   return arctx->conf.def.chan;
+   }
+
+   return NULL;
+}
+
+static void
+ath10k_htt_rx_h_any_chan_iter(struct ieee80211_hw *hw,
+ struct ieee80211_chanctx_conf *conf,
+ void *data)
+{
+   struct cfg80211_chan_def *def = data;
+
+   *def = conf->def;
+}
+
+static struct ieee80211_channel *
+ath10k_htt_rx_h_any_channel(struct ath10k *ar)
+{
+   struct cfg80211_chan_def def = {};
+
+   ieee80211_iter_chan_contexts_atomic(ar->hw,
+   ath10k_htt_rx_h_any_chan_iter,
+   &def);
+
+   return def.chan;
+}
+
 static bool ath10k_htt_rx_h_channel(struct ath10k *ar,
-   struct ieee80211_rx_status *status)
+   struct ieee80211_rx_status *status,
+   struct htt_rx_desc *rxd,
+   u32 vdev_id)
 {
struct ieee80211_channel *ch;
 
@@ -782,6 +863,12 @@ static bool ath10k_htt_rx_h_channel(struct ath10k *ar,
ch = ar->scan_channel;
if (!ch)
ch = ar->rx_channel;
+   if (!ch)
+   ch = ath10k_htt_rx_h_peer_channel(ar, rxd);
+   if (!ch)
+   ch = ath10k_htt_rx_h_vdev_channel(ar, vdev_id);
+

[PATCH v3 3/7] ath10k: implement adaptive qcs command

2015-02-06 Thread Michal Kazior
This command will be used to configure
multi-channel scheduler in firmware.

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/wmi-ops.h | 16 
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 30 ++
 drivers/net/wireless/ath/ath10k/wmi-tlv.h |  4 
 drivers/net/wireless/ath/ath10k/wmi.c |  3 +++
 drivers/net/wireless/ath/ath10k/wmi.h |  1 +
 5 files changed, 54 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h 
b/drivers/net/wireless/ath/ath10k/wmi-ops.h
index 04dc4b9..ecb5c31 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
@@ -149,6 +149,7 @@ struct wmi_ops {
  u32 num_ac);
struct sk_buff *(*gen_sta_keepalive)(struct ath10k *ar,
 const struct wmi_sta_keepalive_arg 
*arg);
+   struct sk_buff *(*gen_adaptive_qcs)(struct ath10k *ar, bool enable);
 };
 
 int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
@@ -1061,4 +1062,19 @@ ath10k_wmi_sta_keepalive(struct ath10k *ar,
return ath10k_wmi_cmd_send(ar, skb, cmd_id);
 }
 
+static inline int
+ath10k_wmi_adaptive_qcs(struct ath10k *ar, bool enable)
+{
+   struct sk_buff *skb;
+
+   if (!ar->wmi.ops->gen_adaptive_qcs)
+   return -EOPNOTSUPP;
+
+   skb = ar->wmi.ops->gen_adaptive_qcs(ar, enable);
+   if (IS_ERR(skb))
+   return PTR_ERR(skb);
+
+   return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->adaptive_qcs_cmdid);
+}
+
 #endif
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c 
b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index c13a505..aedb820 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -2383,6 +2383,34 @@ ath10k_wmi_tlv_op_gen_p2p_go_bcn_ie(struct ath10k *ar, 
u32 vdev_id,
return skb;
 }
 
+static struct sk_buff *
+ath10k_wmi_tlv_op_gen_adaptive_qcs(struct ath10k *ar, bool enable)
+{
+   struct wmi_tlv_adaptive_qcs *cmd;
+   struct wmi_tlv *tlv;
+   struct sk_buff *skb;
+   void *ptr;
+   size_t len;
+
+   len = sizeof(*tlv) + sizeof(*cmd);
+   skb = ath10k_wmi_alloc_skb(ar, len);
+   if (!skb)
+   return ERR_PTR(-ENOMEM);
+
+   ptr = (void *)skb->data;
+   tlv = ptr;
+   tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_RESMGR_ADAPTIVE_OCS_CMD);
+   tlv->len = __cpu_to_le16(sizeof(*cmd));
+   cmd = (void *)tlv->value;
+   cmd->enable = __cpu_to_le32(enable ? 1 : 0);
+
+   ptr += sizeof(*tlv);
+   ptr += sizeof(*cmd);
+
+   ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv adaptive qcs %d\n", enable);
+   return skb;
+}
+
 //
 /* TLV mappings */
 //
@@ -2507,6 +2535,7 @@ static struct wmi_cmd_map wmi_tlv_cmd_map = {
.gpio_output_cmdid = WMI_TLV_GPIO_OUTPUT_CMDID,
.pdev_get_temperature_cmdid = WMI_TLV_CMD_UNSUPPORTED,
.vdev_set_wmm_params_cmdid = WMI_TLV_VDEV_SET_WMM_PARAMS_CMDID,
+   .adaptive_qcs_cmdid = WMI_TLV_RESMGR_ADAPTIVE_OCS_CMDID,
 };
 
 static struct wmi_pdev_param_map wmi_tlv_pdev_param_map = {
@@ -2679,6 +2708,7 @@ static const struct wmi_ops wmi_tlv_ops = {
.gen_p2p_go_bcn_ie = ath10k_wmi_tlv_op_gen_p2p_go_bcn_ie,
.gen_vdev_sta_uapsd = ath10k_wmi_tlv_op_gen_vdev_sta_uapsd,
.gen_sta_keepalive = ath10k_wmi_tlv_op_gen_sta_keepalive,
+   .gen_adaptive_qcs = ath10k_wmi_tlv_op_gen_adaptive_qcs,
 };
 
 //
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.h 
b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
index de68fe7..a05952a 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.h
@@ -1439,6 +1439,10 @@ struct wmi_tlv_sta_keepalive_cmd {
__le32 interval; /* in seconds */
 } __packed;
 
+struct wmi_tlv_adaptive_qcs {
+   __le32 enable;
+} __packed;
+
 void ath10k_wmi_tlv_attach(struct ath10k *ar);
 
 #endif
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c 
b/drivers/net/wireless/ath/ath10k/wmi.c
index 4943449..0f42ca8 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -5256,6 +5256,7 @@ static const struct wmi_ops wmi_ops = {
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
+   /* .gen_adaptive_qcs not implemented */
 };
 
 static const struct wmi_ops wmi_10_1_ops = {
@@ -5318,6 +5319,7 @@ static const struct wmi_ops wmi_10_1_ops = {
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
+   /* .gen_adaptive_qcs not implemented */
 };
 
 static const struct wmi_ops wmi_10_2_ops = {
@@ -5440,6 +5442,7 @@ static const struct wmi_ops wmi_10_2_4_ops = {
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not imple

[PATCH v3 1/7] ath10k: allow empty ssid vdev config

2015-02-06 Thread Michal Kazior
It doesn't make much sense to reject a valid
firmware configuration combination.

Since SSID isn't known early on it might make
sense to allow driver to start vdev without SSID
and restart it later.

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 --
 drivers/net/wireless/ath/ath10k/wmi.c | 2 --
 2 files changed, 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c 
b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index 71614ba..c13a505 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -1302,8 +1302,6 @@ ath10k_wmi_tlv_op_gen_vdev_start(struct ath10k *ar,
void *ptr;
u32 flags = 0;
 
-   if (WARN_ON(arg->ssid && arg->ssid_len == 0))
-   return ERR_PTR(-EINVAL);
if (WARN_ON(arg->hidden_ssid && !arg->ssid))
return ERR_PTR(-EINVAL);
if (WARN_ON(arg->ssid_len > sizeof(cmd->ssid.ssid)))
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c 
b/drivers/net/wireless/ath/ath10k/wmi.c
index aeea1c7..0da1cdc 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -4295,8 +4295,6 @@ ath10k_wmi_op_gen_vdev_start(struct ath10k *ar,
const char *cmdname;
u32 flags = 0;
 
-   if (WARN_ON(arg->ssid && arg->ssid_len == 0))
-   return ERR_PTR(-EINVAL);
if (WARN_ON(arg->hidden_ssid && !arg->ssid))
return ERR_PTR(-EINVAL);
if (WARN_ON(arg->ssid_len > sizeof(cmd->ssid.ssid)))
-- 
1.8.5.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


[PATCH v3 0/7] ath10k: add multi-channel support

2015-02-06 Thread Michal Kazior
New qca6174 with wmi-tlv firmware supports
multi-channel operation. To make use of it
ath10k needs a few changes: implement mac80211's
chanctx API and rework tx queue control a bit.

There are still rough edges (involving seldom
beacon reports from firmware causing beacon loss
in some cases, etc). Hopefully this will be fixed
either in driver or firmware eventually.


Changes since RFC:
 * I've sent `ath10k: defer AP self-peer removal
   wait` separately now because it's not really
   required for multi-channel per se

v2:
 * fix null deref after rebasing
 * fix commit log typo

v3:
 * remove some duplication wrt mac80211 [Johannes]
 * small fixes


Michal Kazior (7):
  ath10k: allow empty ssid vdev config
  ath10k: implement chanctx API
  ath10k: implement adaptive qcs command
  ath10k: protect ar->arvifs linking with data_lock
  ath10k: rework tx queue locking
  ath10k: implement tx pause wmi event
  ath10k: enable multi-channel on supported devices

 drivers/net/wireless/ath/ath10k/core.h|  18 +
 drivers/net/wireless/ath/ath10k/htt_rx.c  | 102 +++-
 drivers/net/wireless/ath/ath10k/htt_tx.c  |  11 +-
 drivers/net/wireless/ath/ath10k/mac.c | 750 +-
 drivers/net/wireless/ath/ath10k/mac.h |  68 +++
 drivers/net/wireless/ath/ath10k/wmi-ops.h |  16 +
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 118 -
 drivers/net/wireless/ath/ath10k/wmi-tlv.h |  46 ++
 drivers/net/wireless/ath/ath10k/wmi.c |  18 +-
 drivers/net/wireless/ath/ath10k/wmi.h |   1 +
 10 files changed, 1024 insertions(+), 124 deletions(-)

-- 
1.8.5.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


[PATCH v3 6/7] ath10k: implement tx pause wmi event

2015-02-06 Thread Michal Kazior
qca6174 wmi-tlv firmware defines a new wmi event
for host tx pausing (i.e. stop/wake tx queues).

Map these events to ath10k/mac80211 tx queue
control.

This is important for multi-channel throughput
performance.

Signed-off-by: Michal Kazior 
---

Notes:
v2:
 * s/thourghput/throughput/ in commit log

 drivers/net/wireless/ath/ath10k/mac.c | 12 +
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 86 +++
 drivers/net/wireless/ath/ath10k/wmi-tlv.h | 42 +++
 3 files changed, 140 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 056f94c..c567e3c 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3464,6 +3464,14 @@ err:
return ret;
 }
 
+static void ath10k_mac_vif_tx_unlock_all(struct ath10k_vif *arvif)
+{
+   int i;
+
+   for (i = 0; i < BITS_PER_LONG; i++)
+   ath10k_mac_vif_tx_unlock(arvif, i);
+}
+
 static void ath10k_remove_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif)
 {
@@ -3514,6 +3522,10 @@ static void ath10k_remove_interface(struct ieee80211_hw 
*hw,
ath10k_warn(ar, "failed to recalc monitor: %d\n", ret);
}
 
+   spin_lock_bh(&ar->htt.tx_lock);
+   ath10k_mac_vif_tx_unlock_all(arvif);
+   spin_unlock_bh(&ar->htt.tx_lock);
+
mutex_unlock(&ar->conf_mutex);
 }
 
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c 
b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index aedb820..8b79552 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -16,6 +16,7 @@
  */
 #include "core.h"
 #include "debug.h"
+#include "mac.h"
 #include "hw.h"
 #include "wmi.h"
 #include "wmi-ops.h"
@@ -62,6 +63,8 @@ static const struct wmi_tlv_policy wmi_tlv_policies[] = {
= { .min_len = sizeof(struct wmi_tlv_bcn_tx_status_ev) },
[WMI_TLV_TAG_STRUCT_DIAG_DATA_CONTAINER_EVENT]
= { .min_len = sizeof(struct wmi_tlv_diag_data_ev) },
+   [WMI_TLV_TAG_STRUCT_TX_PAUSE_EVENT]
+   = { .min_len = sizeof(struct wmi_tlv_tx_pause_ev) },
 };
 
 static int
@@ -296,6 +299,86 @@ static int ath10k_wmi_tlv_event_diag(struct ath10k *ar,
return 0;
 }
 
+static int ath10k_wmi_tlv_event_tx_pause(struct ath10k *ar,
+struct sk_buff *skb)
+{
+   const void **tb;
+   const struct wmi_tlv_tx_pause_ev *ev;
+   int ret, vdev_id;
+   u32 pause_id, action, vdev_map, peer_id, tid_map;
+   struct ath10k_vif *arvif;
+
+   tb = ath10k_wmi_tlv_parse_alloc(ar, skb->data, skb->len, GFP_ATOMIC);
+   if (IS_ERR(tb)) {
+   ret = PTR_ERR(tb);
+   ath10k_warn(ar, "failed to parse tlv: %d\n", ret);
+   return ret;
+   }
+
+   ev = tb[WMI_TLV_TAG_STRUCT_TX_PAUSE_EVENT];
+   if (!ev) {
+   kfree(tb);
+   return -EPROTO;
+   }
+
+   pause_id = __le32_to_cpu(ev->pause_id);
+   action = __le32_to_cpu(ev->action);
+   vdev_map = __le32_to_cpu(ev->vdev_map);
+   peer_id = __le32_to_cpu(ev->peer_id);
+   tid_map = __le32_to_cpu(ev->tid_map);
+
+   ath10k_dbg(ar, ATH10K_DBG_WMI,
+  "wmi tlv tx pause pause_id %u action %u vdev_map 0x%08x 
peer_id %u tid_map 0x%08x\n",
+  pause_id, action, vdev_map, peer_id, tid_map);
+
+   for (vdev_id = 0; vdev_map; vdev_id++) {
+   if (!(vdev_map & BIT(vdev_id)))
+   continue;
+
+   vdev_map &= ~BIT(vdev_id);
+
+   spin_lock_bh(&ar->htt.tx_lock);
+   spin_lock_bh(&ar->data_lock);
+
+   arvif = ath10k_get_arvif(ar, vdev_id);
+   if (!arvif) {
+   ath10k_warn(ar, "failed to find arvif for vdev %i for 
tx pause event\n",
+   vdev_id);
+   spin_unlock_bh(&ar->data_lock);
+   spin_unlock_bh(&ar->htt.tx_lock);
+   continue;
+   }
+
+   /* FIXME: Some pause_id aren't vdev orinted. Instead they are
+* peer_id oriented (mostly for AP mode scenarios).
+*/
+   if (pause_id == WMI_TLV_TX_PAUSE_ID_MCC ||
+   pause_id == WMI_TLV_TX_PAUSE_ID_P2P_CLI_NOA ||
+   pause_id == WMI_TLV_TX_PAUSE_ID_P2P_GO_PS ||
+   pause_id == WMI_TLV_TX_PAUSE_ID_AP_PS ||
+   pause_id == WMI_TLV_TX_PAUSE_ID_IBSS_PS) {
+   switch (action) {
+   case WMI_TLV_TX_PAUSE_ACTION_STOP:
+   ath10k_mac_vif_tx_lock(arvif, pause_id);
+   break;
+   case WMI_TLV_TX_PAUSE_ACTION_WAKE:
+   ath10k_mac_vif_tx_unlock(arvif, pause_id);
+  

[PATCH v3 4/7] ath10k: protect ar->arvifs linking with data_lock

2015-02-06 Thread Michal Kazior
This will make it possible to iterate over
interface list while in an atomic context,
i.e. tasklet.

Caller should still be careful with accessing
arvif structures though.

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/mac.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 2348f8b..1d7e0ae 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3314,7 +3314,10 @@ static int ath10k_add_interface(struct ieee80211_hw *hw,
}
 
ar->free_vdev_map &= ~(1LL << arvif->vdev_id);
+
+   spin_lock_bh(&ar->data_lock);
list_add(&arvif->list, &ar->arvifs);
+   spin_unlock_bh(&ar->data_lock);
 
/* It makes no sense to have firmware do keepalives. mac80211 already
 * takes care of this with idle connection polling.
@@ -3434,7 +3437,9 @@ err_peer_delete:
 err_vdev_delete:
ath10k_wmi_vdev_delete(ar, arvif->vdev_id);
ar->free_vdev_map |= 1LL << arvif->vdev_id;
+   spin_lock_bh(&ar->data_lock);
list_del(&arvif->list);
+   spin_unlock_bh(&ar->data_lock);
 
 err:
if (arvif->beacon_buf) {
@@ -3467,7 +3472,10 @@ static void ath10k_remove_interface(struct ieee80211_hw 
*hw,
arvif->vdev_id, ret);
 
ar->free_vdev_map |= 1LL << arvif->vdev_id;
+
+   spin_lock_bh(&ar->data_lock);
list_del(&arvif->list);
+   spin_unlock_bh(&ar->data_lock);
 
if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
ret = ath10k_peer_delete(arvif->ar, arvif->vdev_id, vif->addr);
-- 
1.8.5.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: [PATCH 1/2] ath10k: Bypass PLL setting on target init for QCA9888

2015-02-06 Thread Michal Kazior
On 6 February 2015 at 12:47, Rajkumar Manoharan
 wrote:
> Some of of qca988x solutions are having global reset issue
> during target initialization.

What kind of issue? How/when does it manifest?


> Bypassing PLL setting before
> downloading firmware and letting the SoC run on REF_CLK is fixing
> the problem. Corresponding firmware change is also needed to set
> the clock source once the target is initialized. Since 10.2.4
> firmware is having this ROM patch, applying skip_clock_init only
> for 10.2.4 firmware versions.

Which 10.2.4? There are at least two publicly available blobs. Do all
of them support this? How do other firmware revisions handle setting
skip_clock_init to 1?


> Signed-off-by: Rajkumar Manoharan 
> ---
>  drivers/net/wireless/ath/ath10k/core.c | 14 ++
>  1 file changed, 14 insertions(+)
>
> diff --git a/drivers/net/wireless/ath/ath10k/core.c 
> b/drivers/net/wireless/ath/ath10k/core.c
> index 310e12b..3119192 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -797,6 +797,20 @@ static int ath10k_download_cal_data(struct ath10k *ar)
> ar->cal_mode = ATH10K_CAL_MODE_OTP;
>
>  done:
> +   if ((ar->hw_rev != ATH10K_HW_QCA988X) ||
> +   (ar->wmi.op_version != ATH10K_FW_WMI_OP_VERSION_10_2_4)) {

Maybe using fw_features is a better idea, no?


> +   ath10k_dbg(ar, ATH10K_DBG_BOOT,
> +  "boot using calibration mode %s\n",
> +  ath10k_cal_mode_str(ar->cal_mode));

I don't really like the idea of duplicating debug prints.


> +   return 0;
> +   }
> +
> +   ret = ath10k_bmi_write32(ar, hi_skip_clock_init, 1);
> +   if (ret) {
> +   ath10k_err(ar, "could not write skip_clock_init (%d)\n", ret);
> +   return ret;
> +   }
> +
> ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot using calibration mode %s\n",
>ath10k_cal_mode_str(ar->cal_mode));
> return 0;


Michał
--
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] ath10k: Increase copy engine entries for rx wmi

2015-02-06 Thread Rajkumar Manoharan
Having lower number of copy engine entries for target to host
WMI ring is causing drops in receiving management frames. This
issue is observed during max clients (128 clients) stress testing.
While bursting deauthentication frames from simulated clients,
approx. 70% of frames are getting dropped due to lower ring entries.

Signed-off-by: Rajkumar Manoharan 
---
 drivers/net/wireless/ath/ath10k/pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index e6972b0..f3174a6 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -113,7 +113,7 @@ static const struct ce_attr host_ce_config_wlan[] = {
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
-   .dest_nentries = 32,
+   .dest_nentries = 128,
},
 
/* CE3: host->target WMI */
@@ -183,7 +183,7 @@ static const struct ce_pipe_config target_ce_config_wlan[] 
= {
{
.pipenum = __cpu_to_le32(2),
.pipedir = __cpu_to_le32(PIPEDIR_IN),
-   .nentries = __cpu_to_le32(32),
+   .nentries = __cpu_to_le32(64),
.nbytes_max = __cpu_to_le32(2048),
.flags = __cpu_to_le32(CE_ATTR_FLAGS),
.reserved = __cpu_to_le32(0),
-- 
2.2.2

--
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 1/2] ath10k: Bypass PLL setting on target init for QCA9888

2015-02-06 Thread Rajkumar Manoharan
Some of of qca988x solutions are having global reset issue
during target initialization. Bypassing PLL setting before
downloading firmware and letting the SoC run on REF_CLK is fixing
the problem. Corresponding firmware change is also needed to set
the clock source once the target is initialized. Since 10.2.4
firmware is having this ROM patch, applying skip_clock_init only
for 10.2.4 firmware versions.

Signed-off-by: Rajkumar Manoharan 
---
 drivers/net/wireless/ath/ath10k/core.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.c 
b/drivers/net/wireless/ath/ath10k/core.c
index 310e12b..3119192 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -797,6 +797,20 @@ static int ath10k_download_cal_data(struct ath10k *ar)
ar->cal_mode = ATH10K_CAL_MODE_OTP;
 
 done:
+   if ((ar->hw_rev != ATH10K_HW_QCA988X) ||
+   (ar->wmi.op_version != ATH10K_FW_WMI_OP_VERSION_10_2_4)) {
+   ath10k_dbg(ar, ATH10K_DBG_BOOT,
+  "boot using calibration mode %s\n",
+  ath10k_cal_mode_str(ar->cal_mode));
+   return 0;
+   }
+
+   ret = ath10k_bmi_write32(ar, hi_skip_clock_init, 1);
+   if (ret) {
+   ath10k_err(ar, "could not write skip_clock_init (%d)\n", ret);
+   return ret;
+   }
+
ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot using calibration mode %s\n",
   ath10k_cal_mode_str(ar->cal_mode));
return 0;
-- 
2.2.2

--
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 4/5] mwifiex: change datatype to bool for device capability flags

2015-02-06 Thread Avinash Patil
This patch changes datatypes for device capability flags to bool.
Patch also aggregates these variables at single place.

Signed-off-by: Avinash Patil 
---
 drivers/net/wireless/mwifiex/pcie.c |  4 +--
 drivers/net/wireless/mwifiex/pcie.h |  6 ++--
 drivers/net/wireless/mwifiex/sdio.c |  8 ++---
 drivers/net/wireless/mwifiex/sdio.h | 60 ++---
 4 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/pcie.c 
b/drivers/net/wireless/mwifiex/pcie.c
index 29c4e8e..4b463c3 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -203,7 +203,7 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev,
card->pcie.reg = data->reg;
card->pcie.blksz_fw_dl = data->blksz_fw_dl;
card->pcie.tx_buf_size = data->tx_buf_size;
-   card->pcie.supports_fw_dump = data->supports_fw_dump;
+   card->pcie.can_dump_fw = data->can_dump_fw;
card->pcie.can_ext_scan = data->can_ext_scan;
}
 
@@ -2273,7 +2273,7 @@ static void mwifiex_pcie_fw_dump_work(struct 
mwifiex_adapter *adapter)
int ret;
static char *env[] = { "DRIVER=mwifiex_pcie", "EVENT=fw_dump", NULL };
 
-   if (!card->pcie.supports_fw_dump)
+   if (!card->pcie.can_dump_fw)
return;
 
for (idx = 0; idx < ARRAY_SIZE(mem_type_mapping_tbl); idx++) {
diff --git a/drivers/net/wireless/mwifiex/pcie.h 
b/drivers/net/wireless/mwifiex/pcie.h
index 666d40e..0e7ee8b 100644
--- a/drivers/net/wireless/mwifiex/pcie.h
+++ b/drivers/net/wireless/mwifiex/pcie.h
@@ -205,7 +205,7 @@ struct mwifiex_pcie_device {
const struct mwifiex_pcie_card_reg *reg;
u16 blksz_fw_dl;
u16 tx_buf_size;
-   bool supports_fw_dump;
+   bool can_dump_fw;
bool can_ext_scan;
 };
 
@@ -214,7 +214,7 @@ static const struct mwifiex_pcie_device mwifiex_pcie8766 = {
.reg= &mwifiex_reg_8766,
.blksz_fw_dl = MWIFIEX_PCIE_BLOCK_SIZE_FW_DNLD,
.tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K,
-   .supports_fw_dump = false,
+   .can_dump_fw = false,
.can_ext_scan = true,
 };
 
@@ -223,7 +223,7 @@ static const struct mwifiex_pcie_device mwifiex_pcie8897 = {
.reg= &mwifiex_reg_8897,
.blksz_fw_dl = MWIFIEX_PCIE_BLOCK_SIZE_FW_DNLD,
.tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_4K,
-   .supports_fw_dump = true,
+   .can_dump_fw = true,
.can_ext_scan = true,
 };
 
diff --git a/drivers/net/wireless/mwifiex/sdio.c 
b/drivers/net/wireless/mwifiex/sdio.c
index 998f3cb..57d85ab 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -105,8 +105,8 @@ mwifiex_sdio_probe(struct sdio_func *func, const struct 
sdio_device_id *id)
card->tx_buf_size = data->tx_buf_size;
card->mp_tx_agg_buf_size = data->mp_tx_agg_buf_size;
card->mp_rx_agg_buf_size = data->mp_rx_agg_buf_size;
-   card->supports_fw_dump = data->supports_fw_dump;
-   card->auto_tdls = data->auto_tdls;
+   card->can_dump_fw = data->can_dump_fw;
+   card->can_auto_tdls = data->can_auto_tdls;
card->can_ext_scan = data->can_ext_scan;
}
 
@@ -1888,7 +1888,7 @@ static int mwifiex_init_sdio(struct mwifiex_adapter 
*adapter)
return -1;
}
 
-   adapter->auto_tdls = card->auto_tdls;
+   adapter->auto_tdls = card->can_auto_tdls;
adapter->ext_scan = card->can_ext_scan;
return ret;
 }
@@ -2033,7 +2033,7 @@ static void mwifiex_sdio_fw_dump_work(struct work_struct 
*work)
 
mwifiex_dump_drv_info(adapter);
 
-   if (!card->supports_fw_dump)
+   if (!card->can_dump_fw)
return;
 
for (idx = 0; idx < ARRAY_SIZE(mem_type_mapping_tbl); idx++) {
diff --git a/drivers/net/wireless/mwifiex/sdio.h 
b/drivers/net/wireless/mwifiex/sdio.h
index 957cca2..3fe9fb4 100644
--- a/drivers/net/wireless/mwifiex/sdio.h
+++ b/drivers/net/wireless/mwifiex/sdio.h
@@ -238,9 +238,6 @@ struct sdio_mmc_card {
const struct mwifiex_sdio_card_reg *reg;
u8 max_ports;
u8 mp_agg_pkt_limit;
-   bool supports_sdio_new_mode;
-   bool has_control_mask;
-   bool supports_fw_dump;
u16 tx_buf_size;
u32 mp_tx_agg_buf_size;
u32 mp_rx_agg_buf_size;
@@ -255,7 +252,10 @@ struct sdio_mmc_card {
u8 curr_wr_port;
 
u8 *mp_regs;
-   u8 auto_tdls;
+   bool supports_sdio_new_mode;
+   bool has_control_mask;
+   bool can_dump_fw;
+   bool can_auto_tdls;
bool can_ext_scan;
 
struct mwifiex_sdio_mpa_tx mpa_tx;
@@ -267,13 +267,13 @@ struct mwifiex_sdio_device {
const struct mwifiex_sdio_card_reg *reg;
u8 max_ports;
u8 mp_agg_pkt_limit;
-   bool supports_sdio_new_mode;
-   bool has_control_mask;
-   bool

[PATCH 5/5] mwifiex: modify TX buff size for SD8887

2015-02-06 Thread Avinash Patil
FW crash has been observed while running iperf TX with SD8887
devices. This is because of invalid TX buffer setting. SD8887
supports 2K buffer sizes. This patch fixes this issue.

Signed-off-by: Avinash Patil 
---
 drivers/net/wireless/mwifiex/sdio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mwifiex/sdio.h 
b/drivers/net/wireless/mwifiex/sdio.h
index 3fe9fb4..c636944 100644
--- a/drivers/net/wireless/mwifiex/sdio.h
+++ b/drivers/net/wireless/mwifiex/sdio.h
@@ -472,7 +472,7 @@ static const struct mwifiex_sdio_device mwifiex_sdio_sd8887 
= {
.reg = &mwifiex_reg_sd8887,
.max_ports = 32,
.mp_agg_pkt_limit = 16,
-   .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_4K,
+   .tx_buf_size = MWIFIEX_TX_DATA_BUF_SIZE_2K,
.mp_tx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_32K,
.mp_rx_agg_buf_size = MWIFIEX_MP_AGGR_BUF_SIZE_32K,
.supports_sdio_new_mode = 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


[PATCH 2/5] mwifiex: do not process mgmt rx on uninitialized interface

2015-02-06 Thread Avinash Patil
This patch fixes a crash which was happening because of RX of
management frames on uninitialzed interface. Now we drop management
frames for interfaces where cfg80211 has not registered any management
subtype reception or interface has no NL80211 iftype set.

Signed-off-by: Avinash Patil 
---
 drivers/net/wireless/mwifiex/util.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/wireless/mwifiex/util.c 
b/drivers/net/wireless/mwifiex/util.c
index 3085506..47e215b 100644
--- a/drivers/net/wireless/mwifiex/util.c
+++ b/drivers/net/wireless/mwifiex/util.c
@@ -367,6 +367,13 @@ mwifiex_process_mgmt_packet(struct mwifiex_private *priv,
if (!skb)
return -1;
 
+   if (!priv->mgmt_frame_mask ||
+   priv->wdev.iftype == NL80211_IFTYPE_UNSPECIFIED) {
+   dev_dbg(priv->adapter->dev,
+   "do not receive mgmt frames on uninitialized intf");
+   return -1;
+   }
+
rx_pd = (struct rxpd *)skb->data;
 
skb_pull(skb, le16_to_cpu(rx_pd->rx_pkt_offset));
-- 
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 3/5] mwifiex: DMA alignment for RX packets

2015-02-06 Thread Avinash Patil
This patch adds support for DMA alignment of sk_buffs
allocated for RX.
Patch also adds support to modify skb allocation flags.

Signed-off-by: Avinash Patil 
Signed-off-by: Marc Yang 
Signed-off-by: Cathy Luo 
---
 drivers/net/wireless/mwifiex/main.h |  4 
 drivers/net/wireless/mwifiex/pcie.c |  6 --
 drivers/net/wireless/mwifiex/sdio.c |  5 +++--
 drivers/net/wireless/mwifiex/util.c | 21 +
 4 files changed, 32 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/main.h 
b/drivers/net/wireless/mwifiex/main.h
index 2089a30..16be45e 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -140,6 +140,9 @@ enum {
 
 #define MWIFIEX_DRV_INFO_SIZE_MAX 0x4
 
+/* Address alignment */
+#define MWIFIEX_ALIGN_ADDR(p, a) (((long)(p) + (a) - 1) & ~((a) - 1))
+
 struct mwifiex_dbg {
u32 num_cmd_host_to_card_failure;
u32 num_cmd_sleep_cfm_host_to_card_failure;
@@ -1418,6 +1421,7 @@ u8 mwifiex_adjust_data_rate(struct mwifiex_private *priv,
u8 rx_rate, u8 ht_info);
 
 void mwifiex_dump_drv_info(struct mwifiex_adapter *adapter);
+void *mwifiex_alloc_rx_buf(int rx_len, gfp_t flags);
 
 #ifdef CONFIG_DEBUG_FS
 void mwifiex_debugfs_init(void);
diff --git a/drivers/net/wireless/mwifiex/pcie.c 
b/drivers/net/wireless/mwifiex/pcie.c
index a5828da..29c4e8e 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -498,7 +498,8 @@ static int mwifiex_init_rxq_ring(struct mwifiex_adapter 
*adapter)
 
for (i = 0; i < MWIFIEX_MAX_TXRX_BD; i++) {
/* Allocate skb here so that firmware can DMA data from it */
-   skb = dev_alloc_skb(MWIFIEX_RX_DATA_BUF_SIZE);
+   skb = mwifiex_alloc_rx_buf(MWIFIEX_RX_DATA_BUF_SIZE,
+  GFP_KERNEL | GFP_DMA);
if (!skb) {
dev_err(adapter->dev,
"Unable to allocate skb for RX ring.\n");
@@ -1297,7 +1298,8 @@ static int mwifiex_pcie_process_recv_data(struct 
mwifiex_adapter *adapter)
}
}
 
-   skb_tmp = dev_alloc_skb(MWIFIEX_RX_DATA_BUF_SIZE);
+   skb_tmp = mwifiex_alloc_rx_buf(MWIFIEX_RX_DATA_BUF_SIZE,
+  GFP_KERNEL | GFP_DMA);
if (!skb_tmp) {
dev_err(adapter->dev,
"Unable to allocate skb.\n");
diff --git a/drivers/net/wireless/mwifiex/sdio.c 
b/drivers/net/wireless/mwifiex/sdio.c
index 91e36cd..998f3cb 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -1357,7 +1357,7 @@ static int mwifiex_process_int_status(struct 
mwifiex_adapter *adapter)
return -1;
rx_len = (u16) (rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE);
 
-   skb = dev_alloc_skb(rx_len);
+   skb = mwifiex_alloc_rx_buf(rx_len, GFP_KERNEL | GFP_DMA);
if (!skb)
return -1;
 
@@ -1454,7 +1454,8 @@ static int mwifiex_process_int_status(struct 
mwifiex_adapter *adapter)
}
rx_len = (u16) (rx_blocks * MWIFIEX_SDIO_BLOCK_SIZE);
 
-   skb = dev_alloc_skb(rx_len);
+   skb = mwifiex_alloc_rx_buf(rx_len,
+  GFP_KERNEL | GFP_DMA);
 
if (!skb) {
dev_err(adapter->dev, "%s: failed to alloc skb",
diff --git a/drivers/net/wireless/mwifiex/util.c 
b/drivers/net/wireless/mwifiex/util.c
index 47e215b..ed69154 100644
--- a/drivers/net/wireless/mwifiex/util.c
+++ b/drivers/net/wireless/mwifiex/util.c
@@ -631,3 +631,24 @@ void mwifiex_hist_data_reset(struct mwifiex_private *priv)
for (ix = 0; ix < MWIFIEX_MAX_SIG_STRENGTH; ix++)
atomic_set(&phist_data->sig_str[ix], 0);
 }
+
+void *mwifiex_alloc_rx_buf(int rx_len, gfp_t flags)
+{
+   struct sk_buff *skb;
+   int buf_len, pad;
+
+   buf_len = rx_len + MWIFIEX_DMA_ALIGN_SZ;
+
+   skb = __dev_alloc_skb(buf_len, flags);
+
+   if (!skb)
+   return NULL;
+
+   pad = MWIFIEX_ALIGN_ADDR(skb->data, MWIFIEX_DMA_ALIGN_SZ) -
+ (long)skb->data;
+
+   skb_reserve(skb, pad);
+
+   return skb;
+}
+EXPORT_SYMBOL_GPL(mwifiex_alloc_rx_buf);
-- 
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 1/5] mwifiex: more_task flag for main_process

2015-02-06 Thread Avinash Patil
This patch handles a corner case where TX packet would remain in
driver queue till next packet comes in.
Here is sequence:
1. TX packet is queued via hard_start_xmit and main_work is queued
2. SDIO interrupt comes in which directly call mwifiex_main_process.
This starts executing main superloop.
3. Now work from step1 is scheduled but at first check itself it sees
mwifiex_processing is set and exits.
4. Now if superloop from step2 has passed TX processing part of superloop
this packet would remain in queue until next packet/command/SDIO interrupt
arrives and queues main_work.

This patch fixes this corner case by defining more_task flag which is set when
mwifiex_processing is found to be true. At end of superloop we again check if
more_task flag is set and if set, execute superloop again.

Signed-off-by: Shengzhen Li 
Signed-off-by: Avinash Patil 
Signed-off-by: Amitkumar Karwar 
Signed-off-by: Cathy Luo 
---
 drivers/net/wireless/mwifiex/main.c | 16 +---
 drivers/net/wireless/mwifiex/main.h |  1 +
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/main.c 
b/drivers/net/wireless/mwifiex/main.c
index 7e74b4f..74488ab 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -190,14 +190,16 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter)
 
/* Check if already processing */
if (adapter->mwifiex_processing) {
+   adapter->more_task_flag = true;
spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
goto exit_main_proc;
} else {
adapter->mwifiex_processing = true;
-   spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
}
 process_start:
do {
+   adapter->more_task_flag = false;
+   spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
if ((adapter->hw_status == MWIFIEX_HW_STATUS_CLOSING) ||
(adapter->hw_status == MWIFIEX_HW_STATUS_NOT_READY))
break;
@@ -238,6 +240,7 @@ process_start:
adapter->pm_wakeup_fw_try = true;
mod_timer(&adapter->wakeup_timer, jiffies + (HZ*3));
adapter->if_ops.wakeup(adapter);
+   spin_lock_irqsave(&adapter->main_proc_lock, flags);
continue;
}
 
@@ -295,8 +298,10 @@ process_start:
if ((adapter->ps_state == PS_STATE_SLEEP) ||
(adapter->ps_state == PS_STATE_PRE_SLEEP) ||
(adapter->ps_state == PS_STATE_SLEEP_CFM) ||
-   adapter->tx_lock_flag)
+   adapter->tx_lock_flag){
+   spin_lock_irqsave(&adapter->main_proc_lock, flags);
continue;
+   }
 
if (!adapter->cmd_sent && !adapter->curr_cmd) {
if (mwifiex_exec_next_cmd(adapter) == -1) {
@@ -330,15 +335,12 @@ process_start:
}
break;
}
+   spin_lock_irqsave(&adapter->main_proc_lock, flags);
} while (true);
 
spin_lock_irqsave(&adapter->main_proc_lock, flags);
-   if (!adapter->delay_main_work &&
-   (adapter->int_status || IS_CARD_RX_RCVD(adapter))) {
-   spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
+   if (adapter->more_task_flag)
goto process_start;
-   }
-
adapter->mwifiex_processing = false;
spin_unlock_irqrestore(&adapter->main_proc_lock, flags);
 
diff --git a/drivers/net/wireless/mwifiex/main.h 
b/drivers/net/wireless/mwifiex/main.h
index f0a6af1..2089a30 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -774,6 +774,7 @@ struct mwifiex_adapter {
/* spin lock for main process */
spinlock_t main_proc_lock;
u32 mwifiex_processing;
+   u8 more_task_flag;
u16 tx_buf_size;
u16 curr_tx_buf_size;
u32 ioport;
-- 
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] ath9k_htc: add adaptive usb receive flow control to repair soft lockup with monitor mode

2015-02-06 Thread yuweizheng
From: Yuwei Zheng 

In the environment with heavy wifi traffic, set the ar9271 into monitor mode, 
will
trigger a deadloop panic.
 
The ath9k_hif_usb_rx_cb function excute on  the interrupt context, and 
ath9k_rx_tasklet excute
on the soft irq context. In other words, the ath9k_hif_usb_rx_cb have more 
chance to excute than
ath9k_rx_tasklet.  So in the worst condition,  the rx.rxbuf receive list is 
always full,
and the do {}while(true) loop will not be break. The kernel get a soft lockup 
panic. 
 
[59011.007210] BUG: soft lockup - CPU#0 stuck for 23s!
[kworker/0:0:30609]
[59011.030560] BUG: scheduling while atomic: kworker/0:0/30609/0x40010100
[59013.804486] BUG: scheduling while atomic: kworker/0:0/30609/0x40010100
[59013.858522] Kernel panic - not syncing: softlockup: hung tasks
 
[59014.038891] Exception stack(0xdf4bbc38 to 0xdf4bbc80)
[59014.046834] bc20:   
de57b950 6113
[59014.059579] bc40:  bb32bb32 6113 de57b948 de57b500 dc7bb440 
df4bbcd0 
[59014.072337] bc60: de57b950 6113 df4bbcd0 df4bbc80 c04c259d c04c25a0 
6133 
[59014.085233] [] (__irq_svc+0x3b/0x5c) from [] 
(_raw_spin_unlock_irqrestore+0xc/0x10)
[59014.100437] [] (_raw_spin_unlock_irqrestore+0xc/0x10) from 
[] (ath9k_rx_tasklet+0x290/0x490 [ath9k_htc])
[59014.118267] [] (ath9k_rx_tasklet+0x290/0x490 [ath9k_htc]) from 
[] (tasklet_action+0x3b/0x98)
[59014.134132] [] (tasklet_action+0x3b/0x98) from [] 
(__do_softirq+0x99/0x16c)
[59014.147784] [] (__do_softirq+0x99/0x16c) from [] 
(irq_exit+0x5b/0x5c)
[59014.160653] [] (irq_exit+0x5b/0x5c) from [] 
(handle_IRQ+0x37/0x78)
[59014.173124] [] (handle_IRQ+0x37/0x78) from [] 
(omap3_intc_handle_irq+0x5f/0x68)
[59014.187225] [] (omap3_intc_handle_irq+0x5f/0x68) from 
[](__irq_svc+0x3b/0x5c)
 
This bug can be see with low performance board, such as uniprocessor beagle 
bone board. 
 
Signed-off-by: Yuwei Zheng 

---
 drivers/net/wireless/ath/ath9k/hif_usb.c   | 74 +++---
 drivers/net/wireless/ath/ath9k/hif_usb.h   |  9 
 drivers/net/wireless/ath/ath9k/htc.h   | 19 +++
 drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 53 ++
 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c  | 44 +++
 5 files changed, 192 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c 
b/drivers/net/wireless/ath/ath9k/hif_usb.c
index 8e7153b..90ee568 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -640,6 +640,7 @@ static void ath9k_hif_usb_rx_cb(struct urb *urb)
struct hif_device_usb *hif_dev =
usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0));
int ret;
+   int delay;
 
if (!skb)
return;
@@ -658,7 +659,6 @@ static void ath9k_hif_usb_rx_cb(struct urb *urb)
default:
goto resubmit;
}
-
if (likely(urb->actual_length != 0)) {
skb_put(skb, urb->actual_length);
ath9k_hif_usb_rx_stream(hif_dev, skb);
@@ -667,12 +667,22 @@ static void ath9k_hif_usb_rx_cb(struct urb *urb)
 resubmit:
skb_reset_tail_pointer(skb);
skb_trim(skb, 0);
-
-   usb_anchor_urb(urb, &hif_dev->rx_submitted);
-   ret = usb_submit_urb(urb, GFP_ATOMIC);
-   if (ret) {
-   usb_unanchor_urb(urb);
-   goto free;
+   spin_lock(&hif_dev->aurfc_lock);
+   if (atomic_read(&hif_dev->aurfc_submit_delay) > 0 &&
+   hif_dev->aurfc_active == 1) {
+   usb_anchor_urb(urb, &hif_dev->rx_delayed_submitted);
+   delay = atomic_read(&hif_dev->aurfc_submit_delay);
+   schedule_delayed_work(&hif_dev->aurfc_delayed_work,
+ msecs_to_jiffies(delay));
+   spin_unlock(&hif_dev->aurfc_lock);
+   } else {
+   spin_unlock(&hif_dev->aurfc_lock);
+   usb_anchor_urb(urb, &hif_dev->rx_submitted);
+   ret = usb_submit_urb(urb, GFP_ATOMIC);
+   if (ret) {
+   usb_unanchor_urb(urb);
+   goto free;
+   }
}
 
return;
@@ -818,9 +828,50 @@ err:
return -ENOMEM;
 }
 
+static void aurfc_submit_handler(struct work_struct *work)
+{
+   struct hif_device_usb *hif_dev =
+   container_of(work,
+struct hif_device_usb,
+aurfc_delayed_work.work);
+
+   struct urb *urb = NULL;
+   struct sk_buff *skb = NULL;
+   int ret;
+   int loop_times = 0;
+
+   while (true) {
+   loop_times++;
+   if (loop_times > MAX_RX_URB_NUM)
+   atomic_add(AURFC_STEP,
+  &hif_dev->aurfc_submit_delay);
+
+   urb = usb_get_from_anchor(
+   &hif_dev->rx_delayed_submitted);
+   if (urb) 

[PATCH] brcmfmac: use msecs_to_jiffies for time conversion

2015-02-06 Thread Nicholas Mc Guire
This is only an API consolidation and should make things more readable
it replaces var * HZ / 1000 by msecs_to_jiffies(var).

Signed-off-by: Nicholas Mc Guire 
---

Patch was only compile tested with x86_64_defconfig + CONFIG_BRCMFMAC=m,
CONFIG_MMC=m, CONFIG_BRCMFMAC_SDIO=y

Patch is against 3.19.0-rc7 (localversion-next is -next-20150204)

 drivers/net/wireless/brcm80211/brcmfmac/sdio.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c 
b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
index 5e9d208..4f9469b 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/sdio.c
@@ -3972,7 +3972,7 @@ brcmf_sdio_watchdog(unsigned long data)
/* Reschedule the watchdog */
if (bus->wd_timer_valid)
mod_timer(&bus->timer,
- jiffies + BRCMF_WD_POLL_MS * HZ / 1000);
+ jiffies + msecs_to_jiffies(BRCMF_WD_POLL_MS));
}
 }
 
@@ -4291,13 +4291,13 @@ void brcmf_sdio_wd_timer(struct brcmf_sdio *bus, uint 
wdtick)
   dynamically changed or in the first instance
 */
bus->timer.expires =
-   jiffies + BRCMF_WD_POLL_MS * HZ / 1000;
+   jiffies + msecs_to_jiffies(BRCMF_WD_POLL_MS);
add_timer(&bus->timer);
 
} else {
/* Re arm the timer, at last watchdog period */
mod_timer(&bus->timer,
-   jiffies + BRCMF_WD_POLL_MS * HZ / 1000);
+   jiffies + msecs_to_jiffies(BRCMF_WD_POLL_MS));
}
 
bus->wd_timer_valid = true;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: pull request: new firmware for Intel wireless Intel 3160 / 7260 / 7265 / 7265D devices

2015-02-06 Thread Grumbach, Emmanuel
On Fri, 2015-02-06 at 11:31 +0200, Emmanuel Grumbach wrote:
> On Fri, 2015-02-06 at 04:15 -0500, Kyle McMartin wrote:
> > On Tue, Feb 03, 2015 at 09:39:28PM +, Grumbach, Emmanuel wrote:
> > > Hi,
> > > 
> > > This is a pull request for new firmwares for the Intel wireless devices
> > > mentioned in the subject.
> > > 
> > > I replace -10.ucode with new ones (that includes bug fixes).
> > > I add the brand new -12.ucode.
> > > 
> > > Please pull.
> > > 
> > > The following changes since commit
> > > 38e5405c96d10bb42b629b45210c46166461fc21:
> > > 
> > 
> > oh, heh, only 1 commit, not 3. ;-)
> > 
> 
> Well - actually 2 commits. You missed the one that updates the -10.ucode
> from 23.11.10.0 23.12.10.0.
> 

I rebased my tree on top of yours to make it easier for you to track.
But I guess I need to specify the version in the commit title. That'd
avoid confusion.

> > applied, thanks Emmanuel.
> > 
> > regards, Kyle
> > 
> > >   cxgb4: Update firmware to revision 1.12.25.0 (2014-12-01 15:48:02
> > > -0500)
> > > 
> > > are available in the git repository at:
> > > 
> > > 
> > > git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware.git
> > > master
> > > 
> > > for you to fetch changes up to da4e58d47557776c5721bafb3f2b6c4a1a4ff0f3:
> > > 
> > >   iwlwifi: add new -12 firmware for 3160 / 7260 / 7265 / 7265D
> > > (2015-02-03 23:14:51 +0200)
> > > 
> > > 
> > > Emmanuel Grumbach (3):
> > >   iwlwifi: update -10.ucode for 3160 / 7260 / 7265 / 7265D
> > >   iwlwifi: update -10.ucode for 3160 / 7260 / 7265 / 7265D
> > >   iwlwifi: add new -12 firmware for 3160 / 7260 / 7265 / 7265D
> > > 
> > >  WHENCE |  20 
> > >  iwlwifi-3160-10.ucode  | Bin 610168 -> 610064 bytes
> > >  iwlwifi-3160-12.ucode  | Bin 0 -> 683996 bytes
> > >  iwlwifi-7260-10.ucode  | Bin 672480 -> 672372 bytes
> > >  iwlwifi-7260-12.ucode  | Bin 0 -> 782300 bytes
> > >  iwlwifi-7265-10.ucode  | Bin 736968 -> 736864 bytes
> > >  iwlwifi-7265-12.ucode  | Bin 0 -> 880604 bytes
> > >  iwlwifi-7265D-10.ucode | Bin 740636 -> 740456 bytes
> > >  iwlwifi-7265D-12.ucode | Bin 0 -> 1002800 bytes
> > >  9 files changed, 16 insertions(+), 4 deletions(-)
> > >  create mode 100644 iwlwifi-3160-12.ucode
> > >  create mode 100644 iwlwifi-7260-12.ucode
> > >  create mode 100644 iwlwifi-7265-12.ucode
> > >  create mode 100644 iwlwifi-7265D-12.ucode
> > > 
> > > diff --git a/WHENCE b/WHENCE
> > > index 44c41c7..1917288 100644
> > > --- a/WHENCE
> > > +++ b/WHENCE
> > > @@ -816,7 +816,10 @@ File: iwlwifi-7260-9.ucode
> > >  Version: 25.228.9.0
> > >  
> > >  File: iwlwifi-7260-10.ucode
> > > -Version: 23.10.10.0
> > > +Version: 23.12.10.0
> > > +
> > > +File: iwlwifi-7260-12.ucode
> > > +Version: 25.15.12.0
> > >  
> > >  File: iwlwifi-3160-7.ucode
> > >  Version: 22.1.7.0
> > > @@ -828,7 +831,10 @@ File: iwlwifi-3160-9.ucode
> > >  Version: 25.228.9.0
> > >  
> > >  File: iwlwifi-3160-10.ucode
> > > -Version: 23.10.10.0
> > > +Version: 23.12.10.0
> > > +
> > > +File: iwlwifi-3160-12.ucode
> > > +Version: 25.15.12.0
> > >  
> > >  File: iwlwifi-7265-8.ucode
> > >  Version: 22.24.8.0
> > > @@ -837,10 +843,16 @@ File: iwlwifi-7265-9.ucode
> > >  Version: 25.228.9.0
> > >  
> > >  File: iwlwifi-7265-10.ucode
> > > -Version: 23.10.10.0
> > > +Version: 23.12.10.0
> > > +
> > > +File: iwlwifi-7265-12.ucode
> > > +Version: 25.15.12.0
> > >  
> > >  File: iwlwifi-7265D-10.ucode
> > > -Version: 23.10.10.0
> > > +Version: 23.12.10.0
> > > +
> > > +File: iwlwifi-7265D-12.ucode
> > > +Version: 25.15.12.0
> > >  
> > >  Licence: Redistributable. See LICENCE.iwlwifi_firmware for details
> > >  
> > > diff --git a/iwlwifi-3160-10.ucode b/iwlwifi-3160-10.ucode
> > > index 8cec7bf..5f4173c 100644
> > > Binary files a/iwlwifi-3160-10.ucode and b/iwlwifi-3160-10.ucode differ
> > > diff --git a/iwlwifi-3160-12.ucode b/iwlwifi-3160-12.ucode
> > > new file mode 100644
> > > index 000..45bce48
> > > Binary files /dev/null and b/iwlwifi-3160-12.ucode differ
> > > diff --git a/iwlwifi-7260-10.ucode b/iwlwifi-7260-10.ucode
> > > index 9e5b930..dca79e2 100644
> > > Binary files a/iwlwifi-7260-10.ucode and b/iwlwifi-7260-10.ucode differ
> > > diff --git a/iwlwifi-7260-12.ucode b/iwlwifi-7260-12.ucode
> > > new file mode 100644
> > > index 000..7ec91f0
> > > Binary files /dev/null and b/iwlwifi-7260-12.ucode differ
> > > diff --git a/iwlwifi-7265-10.ucode b/iwlwifi-7265-10.ucode
> > > index 488ddd0..0571fcf 100644
> > > Binary files a/iwlwifi-7265-10.ucode and b/iwlwifi-7265-10.ucode differ
> > > diff --git a/iwlwifi-7265-12.ucode b/iwlwifi-7265-12.ucode
> > > new file mode 100644
> > > index 000..84ae2ce
> > > Binary files /dev/null and b/iwlwifi-7265-12.ucode differ
> > > diff --git a/iwlwifi-7265D-10.ucode b/iwlwifi-7265D-10.ucode
> > > index 01194db..d9b9aaf 100644
> > > Binary files a/iwlwifi-7265D-10.ucode and b/iwlwifi-7265D-10.ucode
> > > differ
> 

Re: Throughput regression with `tcp: refine TSO autosizing`

2015-02-06 Thread Michal Kazior
On 5 February 2015 at 20:50, Dave Taht  wrote:
[...]
> And I really, really, really wish, that just once during this thread,
> someone had bothered to try running a test
> at a real world MCS rate - say MCS1, or MCS4, and measured the latency
> under load of that...

Time between frame submission to firmware and tx-completion on one of
my ath10k machines:

Legacy 54mbps: ~18ms
Legacy 6mbps: ~37ms
11n MCS 3 (nss=0): ~13ms
11n MCS 8 (nss=1): ~6-8ms
11ac NSS=1 MCS=2: ~4-6ms
11ac NSS=2 MCS=0: ~5-8ms

Keep in mind this is a clean room environment so retransmissions are
kept at minimum. Obviously with a noisy environment you'll get retries
at different rates and higher latency.


Michał
--
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: Throughput regression with `tcp: refine TSO autosizing`

2015-02-06 Thread Michal Kazior
On 5 February 2015 at 18:10, Eric Dumazet  wrote:
> On Thu, 2015-02-05 at 06:41 -0800, Eric Dumazet wrote:
>
>> Not at all. This basically removes backpressure.
>>
>> A single UDP socket can now blast packets regardless of SO_SNDBUF
>> limits.
>>
>> This basically remove years of work trying to fix bufferbloat.
>>
>> I still do not understand why increasing tcp_limit_output_bytes is not
>> working for you.
>
> Oh well, tcp_limit_output_bytes might be ok.
>
> In fact, the problem comes from GSO assumption. Maybe Herbert was right,
> when he suggested TCP would be simpler if we enforced GSO...
>
> When GSO is used, the thing works because 2*skb->truesize is roughly 2
> ms worth of traffic.
>
> Because you do not use GSO, and tx completions are slow, we need this :
>
> diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
> index 65caf8b95e17..ac01b4cd0035 100644
> --- a/net/ipv4/tcp_output.c
> +++ b/net/ipv4/tcp_output.c
> @@ -2044,7 +2044,8 @@ static bool tcp_write_xmit(struct sock *sk, unsigned 
> int mss_now, int nonagle,
> break;
>
> /* TCP Small Queues :
> -* Control number of packets in qdisc/devices to two packets 
> / or ~1 ms.
> +* Control number of packets in qdisc/devices to two packets /
> +* or ~2 ms (sk->sk_pacing_rate >> 9) in case GSO is off.
>  * This allows for :
>  *  - better RTT estimation and ACK scheduling
>  *  - faster recovery
> @@ -2053,7 +2054,7 @@ static bool tcp_write_xmit(struct sock *sk, unsigned 
> int mss_now, int nonagle,
>  * of queued bytes to ensure line rate.
>  * One example is wifi aggregation (802.11 AMPDU)
>  */
> -   limit = max(2 * skb->truesize, sk->sk_pacing_rate >> 10);
> +   limit = max(2 * skb->truesize, sk->sk_pacing_rate >> 9);
> limit = min_t(u32, limit, sysctl_tcp_limit_output_bytes);
>
> if (atomic_read(&sk->sk_wmem_alloc) > limit) {
>

The above brings back previous behaviour, i.e. I can get 600mbps TCP
on 5 flows again. Single flow is still (as it was before TSO
autosizing) limited to roughly ~280mbps.

I never really bothered before to understand why I need to push a few
flows through ath10k to max it out, i.e. if I run a single UDP flow I
get ~300mbps while with, e.g. 5 I get 670mbps easily.

I guess it was the tx completion latency all along.

I just put an extra debug to ath10k to see the latency between
submission and completion. Here's a log
(http://www.filedropper.com/complete-log) of 2s run of UDP iperf
trying to push 1gbps but managing only 300mbps.

I've made sure to not hold any locks nor introduce internal to ath10k
delays. Frames get completed between 2-4ms in avarage during load.

When I tried using different ath10k hw&fw I got between 1-2ms of
latency for tx completionsyielding ~430mbps while max should be around
670mbps.


Michał
--
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: Throughput regression with `tcp: refine TSO autosizing`

2015-02-06 Thread Nicolas Cavallari
On 05/02/2015 15:48, Eric Dumazet wrote:
> On Thu, 2015-02-05 at 14:44 +0100, Michal Kazior wrote:
> 
>> I do get your point. But 1.5ms is really tough on Wi-Fi.
>>
>> Just look at this:
>>
>> ; ping 192.168.1.2 -c 3
>> PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data.
>> 64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=1.83 ms
>> 64 bytes from 192.168.1.2: icmp_seq=2 ttl=64 time=2.02 ms
>> 64 bytes from 192.168.1.2: icmp_seq=3 ttl=64 time=1.98 ms
> 
> Thats a different point.
> 
> I dont care about rtt but TX completions. (usually much much lower than
> rtt)

On wired network perhaps, but definitely not on Wi-Fi.

With aggregation, you may send up to 4ms of data before the receiver
can acknowledge anything. But you have to gain access to the channel
first, so you may wait while others finish off their 4ms
transmissions. And this does not account for retransmissions.

And aggregation is not the only problem as far as bufferbloat is
concerned. I don't even want to think about powersave.
--
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: new firmware for Intel wireless Intel 3160 / 7260 / 7265 / 7265D devices

2015-02-06 Thread Grumbach, Emmanuel
On Fri, 2015-02-06 at 04:15 -0500, Kyle McMartin wrote:
> On Tue, Feb 03, 2015 at 09:39:28PM +, Grumbach, Emmanuel wrote:
> > Hi,
> > 
> > This is a pull request for new firmwares for the Intel wireless devices
> > mentioned in the subject.
> > 
> > I replace -10.ucode with new ones (that includes bug fixes).
> > I add the brand new -12.ucode.
> > 
> > Please pull.
> > 
> > The following changes since commit
> > 38e5405c96d10bb42b629b45210c46166461fc21:
> > 
> 
> oh, heh, only 1 commit, not 3. ;-)
> 

Well - actually 2 commits. You missed the one that updates the -10.ucode
from 23.11.10.0 23.12.10.0.

> applied, thanks Emmanuel.
> 
> regards, Kyle
> 
> >   cxgb4: Update firmware to revision 1.12.25.0 (2014-12-01 15:48:02
> > -0500)
> > 
> > are available in the git repository at:
> > 
> > 
> > git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware.git
> > master
> > 
> > for you to fetch changes up to da4e58d47557776c5721bafb3f2b6c4a1a4ff0f3:
> > 
> >   iwlwifi: add new -12 firmware for 3160 / 7260 / 7265 / 7265D
> > (2015-02-03 23:14:51 +0200)
> > 
> > 
> > Emmanuel Grumbach (3):
> >   iwlwifi: update -10.ucode for 3160 / 7260 / 7265 / 7265D
> >   iwlwifi: update -10.ucode for 3160 / 7260 / 7265 / 7265D
> >   iwlwifi: add new -12 firmware for 3160 / 7260 / 7265 / 7265D
> > 
> >  WHENCE |  20 
> >  iwlwifi-3160-10.ucode  | Bin 610168 -> 610064 bytes
> >  iwlwifi-3160-12.ucode  | Bin 0 -> 683996 bytes
> >  iwlwifi-7260-10.ucode  | Bin 672480 -> 672372 bytes
> >  iwlwifi-7260-12.ucode  | Bin 0 -> 782300 bytes
> >  iwlwifi-7265-10.ucode  | Bin 736968 -> 736864 bytes
> >  iwlwifi-7265-12.ucode  | Bin 0 -> 880604 bytes
> >  iwlwifi-7265D-10.ucode | Bin 740636 -> 740456 bytes
> >  iwlwifi-7265D-12.ucode | Bin 0 -> 1002800 bytes
> >  9 files changed, 16 insertions(+), 4 deletions(-)
> >  create mode 100644 iwlwifi-3160-12.ucode
> >  create mode 100644 iwlwifi-7260-12.ucode
> >  create mode 100644 iwlwifi-7265-12.ucode
> >  create mode 100644 iwlwifi-7265D-12.ucode
> > 
> > diff --git a/WHENCE b/WHENCE
> > index 44c41c7..1917288 100644
> > --- a/WHENCE
> > +++ b/WHENCE
> > @@ -816,7 +816,10 @@ File: iwlwifi-7260-9.ucode
> >  Version: 25.228.9.0
> >  
> >  File: iwlwifi-7260-10.ucode
> > -Version: 23.10.10.0
> > +Version: 23.12.10.0
> > +
> > +File: iwlwifi-7260-12.ucode
> > +Version: 25.15.12.0
> >  
> >  File: iwlwifi-3160-7.ucode
> >  Version: 22.1.7.0
> > @@ -828,7 +831,10 @@ File: iwlwifi-3160-9.ucode
> >  Version: 25.228.9.0
> >  
> >  File: iwlwifi-3160-10.ucode
> > -Version: 23.10.10.0
> > +Version: 23.12.10.0
> > +
> > +File: iwlwifi-3160-12.ucode
> > +Version: 25.15.12.0
> >  
> >  File: iwlwifi-7265-8.ucode
> >  Version: 22.24.8.0
> > @@ -837,10 +843,16 @@ File: iwlwifi-7265-9.ucode
> >  Version: 25.228.9.0
> >  
> >  File: iwlwifi-7265-10.ucode
> > -Version: 23.10.10.0
> > +Version: 23.12.10.0
> > +
> > +File: iwlwifi-7265-12.ucode
> > +Version: 25.15.12.0
> >  
> >  File: iwlwifi-7265D-10.ucode
> > -Version: 23.10.10.0
> > +Version: 23.12.10.0
> > +
> > +File: iwlwifi-7265D-12.ucode
> > +Version: 25.15.12.0
> >  
> >  Licence: Redistributable. See LICENCE.iwlwifi_firmware for details
> >  
> > diff --git a/iwlwifi-3160-10.ucode b/iwlwifi-3160-10.ucode
> > index 8cec7bf..5f4173c 100644
> > Binary files a/iwlwifi-3160-10.ucode and b/iwlwifi-3160-10.ucode differ
> > diff --git a/iwlwifi-3160-12.ucode b/iwlwifi-3160-12.ucode
> > new file mode 100644
> > index 000..45bce48
> > Binary files /dev/null and b/iwlwifi-3160-12.ucode differ
> > diff --git a/iwlwifi-7260-10.ucode b/iwlwifi-7260-10.ucode
> > index 9e5b930..dca79e2 100644
> > Binary files a/iwlwifi-7260-10.ucode and b/iwlwifi-7260-10.ucode differ
> > diff --git a/iwlwifi-7260-12.ucode b/iwlwifi-7260-12.ucode
> > new file mode 100644
> > index 000..7ec91f0
> > Binary files /dev/null and b/iwlwifi-7260-12.ucode differ
> > diff --git a/iwlwifi-7265-10.ucode b/iwlwifi-7265-10.ucode
> > index 488ddd0..0571fcf 100644
> > Binary files a/iwlwifi-7265-10.ucode and b/iwlwifi-7265-10.ucode differ
> > diff --git a/iwlwifi-7265-12.ucode b/iwlwifi-7265-12.ucode
> > new file mode 100644
> > index 000..84ae2ce
> > Binary files /dev/null and b/iwlwifi-7265-12.ucode differ
> > diff --git a/iwlwifi-7265D-10.ucode b/iwlwifi-7265D-10.ucode
> > index 01194db..d9b9aaf 100644
> > Binary files a/iwlwifi-7265D-10.ucode and b/iwlwifi-7265D-10.ucode
> > differ
> > diff --git a/iwlwifi-7265D-12.ucode b/iwlwifi-7265D-12.ucode
> > new file mode 100644
> > index 000..3f36b55
> > Binary files /dev/null and b/iwlwifi-7265D-12.ucode differ
> > 
> 
> 

N�r��yb�X��ǧv�^�)޺{.n�+{��*ޕ�,�{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�mzZ+�ݢj"��!�i

Re: pull request: new firmware for Intel wireless Intel 3160 / 7260 / 7265 / 7265D devices

2015-02-06 Thread Kyle McMartin
On Tue, Feb 03, 2015 at 09:39:28PM +, Grumbach, Emmanuel wrote:
> Hi,
> 
> This is a pull request for new firmwares for the Intel wireless devices
> mentioned in the subject.
> 
> I replace -10.ucode with new ones (that includes bug fixes).
> I add the brand new -12.ucode.
> 
> Please pull.
> 
> The following changes since commit
> 38e5405c96d10bb42b629b45210c46166461fc21:
> 

oh, heh, only 1 commit, not 3. ;-)

applied, thanks Emmanuel.

regards, Kyle

>   cxgb4: Update firmware to revision 1.12.25.0 (2014-12-01 15:48:02
> -0500)
> 
> are available in the git repository at:
> 
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware.git
> master
> 
> for you to fetch changes up to da4e58d47557776c5721bafb3f2b6c4a1a4ff0f3:
> 
>   iwlwifi: add new -12 firmware for 3160 / 7260 / 7265 / 7265D
> (2015-02-03 23:14:51 +0200)
> 
> 
> Emmanuel Grumbach (3):
>   iwlwifi: update -10.ucode for 3160 / 7260 / 7265 / 7265D
>   iwlwifi: update -10.ucode for 3160 / 7260 / 7265 / 7265D
>   iwlwifi: add new -12 firmware for 3160 / 7260 / 7265 / 7265D
> 
>  WHENCE |  20 
>  iwlwifi-3160-10.ucode  | Bin 610168 -> 610064 bytes
>  iwlwifi-3160-12.ucode  | Bin 0 -> 683996 bytes
>  iwlwifi-7260-10.ucode  | Bin 672480 -> 672372 bytes
>  iwlwifi-7260-12.ucode  | Bin 0 -> 782300 bytes
>  iwlwifi-7265-10.ucode  | Bin 736968 -> 736864 bytes
>  iwlwifi-7265-12.ucode  | Bin 0 -> 880604 bytes
>  iwlwifi-7265D-10.ucode | Bin 740636 -> 740456 bytes
>  iwlwifi-7265D-12.ucode | Bin 0 -> 1002800 bytes
>  9 files changed, 16 insertions(+), 4 deletions(-)
>  create mode 100644 iwlwifi-3160-12.ucode
>  create mode 100644 iwlwifi-7260-12.ucode
>  create mode 100644 iwlwifi-7265-12.ucode
>  create mode 100644 iwlwifi-7265D-12.ucode
> 
> diff --git a/WHENCE b/WHENCE
> index 44c41c7..1917288 100644
> --- a/WHENCE
> +++ b/WHENCE
> @@ -816,7 +816,10 @@ File: iwlwifi-7260-9.ucode
>  Version: 25.228.9.0
>  
>  File: iwlwifi-7260-10.ucode
> -Version: 23.10.10.0
> +Version: 23.12.10.0
> +
> +File: iwlwifi-7260-12.ucode
> +Version: 25.15.12.0
>  
>  File: iwlwifi-3160-7.ucode
>  Version: 22.1.7.0
> @@ -828,7 +831,10 @@ File: iwlwifi-3160-9.ucode
>  Version: 25.228.9.0
>  
>  File: iwlwifi-3160-10.ucode
> -Version: 23.10.10.0
> +Version: 23.12.10.0
> +
> +File: iwlwifi-3160-12.ucode
> +Version: 25.15.12.0
>  
>  File: iwlwifi-7265-8.ucode
>  Version: 22.24.8.0
> @@ -837,10 +843,16 @@ File: iwlwifi-7265-9.ucode
>  Version: 25.228.9.0
>  
>  File: iwlwifi-7265-10.ucode
> -Version: 23.10.10.0
> +Version: 23.12.10.0
> +
> +File: iwlwifi-7265-12.ucode
> +Version: 25.15.12.0
>  
>  File: iwlwifi-7265D-10.ucode
> -Version: 23.10.10.0
> +Version: 23.12.10.0
> +
> +File: iwlwifi-7265D-12.ucode
> +Version: 25.15.12.0
>  
>  Licence: Redistributable. See LICENCE.iwlwifi_firmware for details
>  
> diff --git a/iwlwifi-3160-10.ucode b/iwlwifi-3160-10.ucode
> index 8cec7bf..5f4173c 100644
> Binary files a/iwlwifi-3160-10.ucode and b/iwlwifi-3160-10.ucode differ
> diff --git a/iwlwifi-3160-12.ucode b/iwlwifi-3160-12.ucode
> new file mode 100644
> index 000..45bce48
> Binary files /dev/null and b/iwlwifi-3160-12.ucode differ
> diff --git a/iwlwifi-7260-10.ucode b/iwlwifi-7260-10.ucode
> index 9e5b930..dca79e2 100644
> Binary files a/iwlwifi-7260-10.ucode and b/iwlwifi-7260-10.ucode differ
> diff --git a/iwlwifi-7260-12.ucode b/iwlwifi-7260-12.ucode
> new file mode 100644
> index 000..7ec91f0
> Binary files /dev/null and b/iwlwifi-7260-12.ucode differ
> diff --git a/iwlwifi-7265-10.ucode b/iwlwifi-7265-10.ucode
> index 488ddd0..0571fcf 100644
> Binary files a/iwlwifi-7265-10.ucode and b/iwlwifi-7265-10.ucode differ
> diff --git a/iwlwifi-7265-12.ucode b/iwlwifi-7265-12.ucode
> new file mode 100644
> index 000..84ae2ce
> Binary files /dev/null and b/iwlwifi-7265-12.ucode differ
> diff --git a/iwlwifi-7265D-10.ucode b/iwlwifi-7265D-10.ucode
> index 01194db..d9b9aaf 100644
> Binary files a/iwlwifi-7265D-10.ucode and b/iwlwifi-7265D-10.ucode
> differ
> diff --git a/iwlwifi-7265D-12.ucode b/iwlwifi-7265D-12.ucode
> new file mode 100644
> index 000..3f36b55
> Binary files /dev/null and b/iwlwifi-7265D-12.ucode differ
> 


--
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: BCM4330 linux support

2015-02-06 Thread Arend van Spriel

+ lists

On 02/06/15 00:40, Ben Adler wrote:

Hi Arend,

I found your email on
https://wireless.wiki.kernel.org/en/users/Drivers/brcm80211 and would
like to ask your help regarding linux support for the Broadcom BCM4330
chipset. The page lists it as supported.

More precisely, I am trying to get WiFi to work on a Zotac ZBOX pico 320
which contains an Ampak AP6383 chip. This in turn contains a BCM4330...
which leads me to you.


Makes sense ;-)


So far, I was able to rip

4330b2rtecdc.bin (md5 ca91920df0041bd9e31e3aef53ac3375)
T77H360.04_WB_nvram_20120731.txt (attached)

out of the windows driver and am able to scan for networks using linux
3.19rc6, brcmfmac module and "iwlist wlan0 scanning". However, doing so,
I receive many error messages and cannot connect to an AP, let alone
start an AP with hostapd.

The firmware files in linux-firmware, don't seem to help either.

Arend, is it possible to make this chip work? Just STA, or also AP? If
so, which firmware and NVRAM files will I need?


Well, I have this chip running on regular x86 laptop using special 
adapter boards and it also runs on i.MX6 board. The windows firmware and 
nvram should work. Can you send a kernel log preferably with driver 
module loaded with 'debug=0xd416'.



The windows driver also contains 11
BCM4330B1_002.001.003.0967..hcd files. Are those only for
bluetooth? Does bluetooth work in linux?


Those .hcd file are indeed for bluetooth. I know next to nothing about 
bluetooth. Sorry.



Thanks for your time!
Ben


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


Re: [PATCH v2] ath10k: Replace ioread with mb to drain write buffer

2015-02-06 Thread Jakub Kiciński
On Fri, 30 Jan 2015 16:14:30 -0800, Peter Oh wrote:
> Using ioread() to perform draining write buffer is excessive.
> Use compact API, mb(), that intended to be used for the case.
> It reduces total 14 CPU clocks per interrupt.
>
> Signed-off-by: Peter Oh 

I have no idea what the code does but this change looks suspicious. 
Usually the point of ioread() is to flush the interconnect buffers 
while mb() ensures ordering only from the CPU perspective.

Could you provide the reason *why* flushing buffers is unnecessary
in the commit message?
--
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] mwifiex: use alloc_workqueue's format strings capabilities for WQ names

2015-02-06 Thread Avinash Patil
alloc_workqueue() has string format formation ability e.g. wqname%ifname
will be treated as wqnameifname. Use this and remove string operations
while defining strings for workqueue names.

Reported-by: Kees Cook 
Signed-off-by: Avinash Patil 
---
 drivers/net/wireless/mwifiex/cfg80211.c | 14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/cfg80211.c 
b/drivers/net/wireless/mwifiex/cfg80211.c
index 41c8e25..5f3c1d3 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -2397,7 +2397,6 @@ mwifiex_setup_ht_caps(struct ieee80211_sta_ht_cap 
*ht_info,
ht_info->mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED;
 }
 
-#define MWIFIEX_MAX_WQ_LEN  30
 /*
  *  create a new virtual interface with the given name
  */
@@ -2411,7 +2410,6 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct 
wiphy *wiphy,
struct mwifiex_private *priv;
struct net_device *dev;
void *mdev_priv;
-   char dfs_cac_str[MWIFIEX_MAX_WQ_LEN], dfs_chsw_str[MWIFIEX_MAX_WQ_LEN];
 
if (!adapter)
return ERR_PTR(-EFAULT);
@@ -2576,12 +2574,10 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct 
wiphy *wiphy,
return ERR_PTR(-EFAULT);
}
 
-   strcpy(dfs_cac_str, "MWIFIEX_DFS_CAC");
-   strcat(dfs_cac_str, name);
-   priv->dfs_cac_workqueue = alloc_workqueue(dfs_cac_str,
+   priv->dfs_cac_workqueue = alloc_workqueue("MWIFIEX_DFS_CAC%s",
  WQ_HIGHPRI |
  WQ_MEM_RECLAIM |
- WQ_UNBOUND, 1);
+ WQ_UNBOUND, 1, name);
if (!priv->dfs_cac_workqueue) {
wiphy_err(wiphy, "cannot register virtual network device\n");
free_netdev(dev);
@@ -2594,11 +2590,9 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct 
wiphy *wiphy,
 
INIT_DELAYED_WORK(&priv->dfs_cac_work, mwifiex_dfs_cac_work_queue);
 
-   strcpy(dfs_chsw_str, "MWIFIEX_DFS_CHSW");
-   strcat(dfs_chsw_str, name);
-   priv->dfs_chan_sw_workqueue = alloc_workqueue(dfs_chsw_str,
+   priv->dfs_chan_sw_workqueue = alloc_workqueue("MWIFIEX_DFS_CHSW%s",
  WQ_HIGHPRI | WQ_UNBOUND |
- WQ_MEM_RECLAIM, 1);
+ WQ_MEM_RECLAIM, 1, name);
if (!priv->dfs_chan_sw_workqueue) {
wiphy_err(wiphy, "cannot register virtual network device\n");
free_netdev(dev);
-- 
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