Re: [PATCH RFT] brcmfmac: respect reason when deleting (deauthenticating) STA

2015-02-08 Thread Arend van Spriel

On 02/07/15 23:23, Rafał Miłecki wrote:



Could say in commit message that reason is provided by cfg80211.

Acked-by: Arend van Spriel ar...@broadcom.com

Signed-off-by: Rafał Miłeckizaj...@gmail.com
---
  drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c 
b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
index b59b8c6..a23bfaa 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
@@ -4272,7 +4272,7 @@ brcmf_cfg80211_del_station(struct wiphy *wiphy, struct 
net_device *ndev,
return -EIO;

memcpy(scbval.ea, params-mac, ETH_ALEN);
-   scbval.val = cpu_to_le32(WLAN_REASON_DEAUTH_LEAVING);
+   scbval.val = cpu_to_le32(params-reason_code);
err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON,
scbval, sizeof(scbval));
if (err)


--
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-08 Thread Peer, Ilan
Hi Luis,

 -Original Message-
 From: Luis R. Rodriguez [mailto:mcg...@suse.com]
 Sent: Saturday, February 07, 2015 01:58
 To: Peer, Ilan
 Cc: linux-wireless@vger.kernel.org; ArikX Nemtsov
 Subject: Re: [PATCH v4 1/2] cfg80211: Add API to change the indoor
 regulatory setting
 
 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 ?
   

This differs from the country setting that would potentially require user space 
interaction and might invoke more complex flows. The flow in this case is 
immediate, and does not require the somewhat complex handling of country 
settings (it even complicates the flow unnecessarily, with the 
REG_REQ_USER_HINT_HANDLED etc.).

  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?

(Sadly) I would not consider the previous implementation as working as it would 
leave the regulatory core in a state that it considers to be indoor although it 
is no longer true.

 
  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?
 

I do not think so. This setting is in the responsibility of the user space 
daemon, so it should be the one controlling it. A disconnection of the station 
interface does not imply that we are no longer operating in an indoor 
environment. This also related to #2 above that tightens the responsibility of 
the user space daemon controlling this setting.

  Signed-off-by: Ilan Peer ilan.p...@intel.com
  Signed-off-by: ArikX Nemtsov a...@wizery.com
  ---
   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();
  +   

[PATCH] mac80211: clear sdata-radar_required

2015-02-08 Thread Eliad Peller
If ieee80211_vif_use_channel() fails, we have to clear
sdata-radar_required (which we might have just set).

Failing to do it results in stale radar_required field
which prevents starting new scan requests.

Reported-by: Jouni Malinen j...@w1.fi
Signed-off-by: Eliad Peller el...@wizery.com
---
 net/mac80211/chan.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c
index 35b11e1..f3a8708 100644
--- a/net/mac80211/chan.c
+++ b/net/mac80211/chan.c
@@ -1508,6 +1508,8 @@ static void __ieee80211_vif_release_channel(struct 
ieee80211_sub_if_data *sdata)
if (ieee80211_chanctx_refcount(local, ctx) == 0)
ieee80211_free_chanctx(local, ctx);
 
+   sdata-radar_required = 0;
+
/* Unreserving may ready an in-place reservation. */
if (use_reserved_switch)
ieee80211_vif_use_reserved_switch(local);
@@ -1566,6 +1568,9 @@ int ieee80211_vif_use_channel(struct 
ieee80211_sub_if_data *sdata,
ieee80211_recalc_smps_chanctx(local, ctx);
ieee80211_recalc_radar_chanctx(local, ctx);
  out:
+   if (ret)
+   sdata-radar_required = 0;
+
mutex_unlock(local-chanctx_mtx);
return ret;
 }
-- 
1.8.5.2.229.g4448466.dirty

--
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 3/3] mac80211: don't defer scans in case of radar detection

2015-02-08 Thread Eliad Peller
On Sun, Feb 8, 2015 at 3:17 PM, Janusz Dziedzic
janusz.dzied...@tieto.com wrote:
 On 8 February 2015 at 11:57, Eliad Peller el...@wizery.com wrote:
 On Sat, Feb 7, 2015 at 9:17 PM, Janusz Dziedzic
 janusz.dzied...@tieto.com wrote:
 BTW, what in case we will start AP on first interface (DFS channel),
 on second one we will try to connect to other AP. As I understand this
 correctly, second iface (STA iface) will not allow to scan (connect)
 ...?

 right.
 The rationale behind it that you must listen constantly to detect
 radar events, which prevents scanning off-channel.
 (i guess an exception for on-channel scanning can be added if needed, though)

 Still I can image hw with hw_scan() support that could have dedicated
 hw part for scanning.
 So, driver should made this decision (allow or not) base on hw features.

this will probably require additional radio...

anyway, i don't have any objection here :)
just explained the original logic (and my patch only changed the
behavior from blocking indefinitely to returning error immediately)

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


[PATCH v2 2/2] cfg80211: add support for connecting to PBSS network type

2015-02-08 Thread Dedy Lansky
sme.c assumes BSS is of ESS type. With 802.11ad and the new PBSS network
type, this is not always true.
On DMG (60GHz) band, P2P connection uses PBSS network. Detect P2P
connection for DMG band and adjust BSS type to PBSS.

When connect starts (cfg80211_connect), store the bss type in new field in wdev
(conn_bss_type). This field is used later (e.g. in __cfg80211_connect_result)
when calling cfg80211_get_bss() for finding the BSS we are connecting to.

Signed-off-by: Dedy Lansky dlan...@codeaurora.org
---
 include/net/cfg80211.h |  2 ++
 net/wireless/sme.c | 12 +---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index acf8f09..da346b1 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -3426,6 +3426,7 @@ struct cfg80211_cached_keys;
  * registered for unexpected class 3 frames (AP mode)
  * @conn: (private) cfg80211 software SME connection state machine data
  * @connect_keys: (private) keys to set after connection is established
+ * @conn_bss_type: connecting/connected BSS type
  * @ibss_fixed: (private) IBSS is using fixed BSSID
  * @ibss_dfs_possible: (private) IBSS may change to a DFS channel
  * @event_list: (private) list for internal event processing
@@ -3456,6 +3457,7 @@ struct wireless_dev {
u8 ssid_len, mesh_id_len, mesh_id_up_len;
struct cfg80211_conn *conn;
struct cfg80211_cached_keys *connect_keys;
+   enum ieee80211_bss_type conn_bss_type;
 
struct list_head event_list;
spinlock_t event_lock;
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index ea1da66..bf79bf2 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -264,7 +264,7 @@ static struct cfg80211_bss *cfg80211_get_conn_bss(struct 
wireless_dev *wdev)
   wdev-conn-params.bssid,
   wdev-conn-params.ssid,
   wdev-conn-params.ssid_len,
-  IEEE80211_BSS_TYPE_ESS,
+  wdev-conn_bss_type,
   IEEE80211_PRIVACY(wdev-conn-params.privacy));
if (!bss)
return NULL;
@@ -633,7 +633,7 @@ void __cfg80211_connect_result(struct net_device *dev, 
const u8 *bssid,
WARN_ON_ONCE(!wiphy_to_rdev(wdev-wiphy)-ops-connect);
bss = cfg80211_get_bss(wdev-wiphy, NULL, bssid,
   wdev-ssid, wdev-ssid_len,
-  IEEE80211_BSS_TYPE_ESS,
+  wdev-conn_bss_type,
   IEEE80211_PRIVACY_ANY);
if (bss)
cfg80211_hold_bss(bss_from_pub(bss));
@@ -792,7 +792,7 @@ void cfg80211_roamed(struct net_device *dev,
 
bss = cfg80211_get_bss(wdev-wiphy, channel, bssid, wdev-ssid,
   wdev-ssid_len,
-  IEEE80211_BSS_TYPE_ESS, IEEE80211_PRIVACY_ANY);
+  wdev-conn_bss_type, IEEE80211_PRIVACY_ANY);
if (WARN_ON(!bss))
return;
 
@@ -961,6 +961,12 @@ int cfg80211_connect(struct cfg80211_registered_device 
*rdev,
memcpy(wdev-ssid, connect-ssid, connect-ssid_len);
wdev-ssid_len = connect-ssid_len;
 
+   wdev-conn_bss_type = IEEE80211_BSS_TYPE_ESS;
+   if (connect-channel 
+   connect-channel-band == IEEE80211_BAND_60GHZ 
+   wdev-iftype == NL80211_IFTYPE_P2P_CLIENT)
+   wdev-conn_bss_type = IEEE80211_BSS_TYPE_PBSS;
+
if (!rdev-ops-connect)
err = cfg80211_sme_connect(wdev, connect, prev_bssid);
else
-- 
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 v2 1/2] cfg80211: add bss_type and privacy arguments in cfg80211_get_bss()

2015-02-08 Thread Dedy Lansky
Background: 802.11ad adds new network type (PBSS) and changes capability
field interpretation for the DMG (60G) band.
Same 2 bits that was interpreted as ESS and IBSS, are re-used as
2-bit field with 3 valid values (and 1 reserved). Valid values are:
IBSS, PBSS (new) and AP.

New enum added into cfg80211.h - ieee80211_bss_type with valid network types.
When searching for particular network type in cfg80211_get_bss,
capa_mask and capa_val would not work due to difference described above.
Thus, need to decouple network type (bss_type) and handle it separately.

Remaining bits in capa_mask and capa_val are used only for PRIVACY matching
so replace those two with privacy enum.

Signed-off-by: Dedy Lansky dlan...@codeaurora.org
---
 drivers/net/wireless/ath/ath10k/mac.c   |  3 +-
 drivers/net/wireless/ath/ath6kl/cfg80211.c  |  9 +--
 drivers/net/wireless/ath/wil6210/cfg80211.c |  2 +-
 drivers/net/wireless/cw1200/sta.c   |  4 +-
 drivers/net/wireless/libertas/cfg.c |  6 +-
 drivers/net/wireless/mwifiex/cfg80211.c |  8 +--
 include/net/cfg80211.h  | 40 +-
 net/mac80211/ibss.c | 43 ---
 net/wireless/ibss.c |  2 +-
 net/wireless/mlme.c |  6 +-
 net/wireless/scan.c | 86 ++---
 net/wireless/sme.c  | 16 ++
 net/wireless/trace.h| 24 
 13 files changed, 169 insertions(+), 80 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 60a524b..96f6306 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1206,7 +1206,8 @@ static void ath10k_peer_assoc_h_crypto(struct ath10k *ar,
lockdep_assert_held(ar-conf_mutex);
 
bss = cfg80211_get_bss(ar-hw-wiphy, ar-hw-conf.chandef.chan,
-  info-bssid, NULL, 0, 0, 0);
+  info-bssid, NULL, 0, IEEE80211_BSS_TYPE_ANY,
+  IEEE80211_PRIVACY_ANY);
if (bss) {
const struct cfg80211_bss_ies *ies;
 
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c 
b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 85da63a..ff7ba5c 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -686,20 +686,21 @@ ath6kl_add_bss_if_needed(struct ath6kl_vif *vif,
 {
struct ath6kl *ar = vif-ar;
struct cfg80211_bss *bss;
-   u16 cap_mask, cap_val;
+   u16 cap_val;
+   enum ieee80211_bss_type bss_type;
u8 *ie;
 
if (nw_type  ADHOC_NETWORK) {
-   cap_mask = WLAN_CAPABILITY_IBSS;
cap_val = WLAN_CAPABILITY_IBSS;
+   bss_type = IEEE80211_BSS_TYPE_IBSS;
} else {
-   cap_mask = WLAN_CAPABILITY_ESS;
cap_val = WLAN_CAPABILITY_ESS;
+   bss_type = IEEE80211_BSS_TYPE_ESS;
}
 
bss = cfg80211_get_bss(ar-wiphy, chan, bssid,
   vif-ssid, vif-ssid_len,
-  cap_mask, cap_val);
+  bss_type, IEEE80211_PRIVACY_ANY);
if (bss == NULL) {
/*
 * Since cfg80211 may not yet know about the BSS,
diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c 
b/drivers/net/wireless/ath/wil6210/cfg80211.c
index e758f43..c3d29a7 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -370,7 +370,7 @@ static int wil_cfg80211_connect(struct wiphy *wiphy,
 
bss = cfg80211_get_bss(wiphy, sme-channel, sme-bssid,
   sme-ssid, sme-ssid_len,
-  WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
+  IEEE80211_BSS_TYPE_ESS, IEEE80211_PRIVACY_ANY);
if (!bss) {
wil_err(wil, Unable to find BSS\n);
return -ENOENT;
diff --git a/drivers/net/wireless/cw1200/sta.c 
b/drivers/net/wireless/cw1200/sta.c
index 4a47c7f..1b58b2e 100644
--- a/drivers/net/wireless/cw1200/sta.c
+++ b/drivers/net/wireless/cw1200/sta.c
@@ -1240,8 +1240,8 @@ static void cw1200_do_join(struct cw1200_common *priv)
 
bssid = priv-vif-bss_conf.bssid;
 
-   bss = cfg80211_get_bss(priv-hw-wiphy, priv-channel,
-   bssid, NULL, 0, 0, 0);
+   bss = cfg80211_get_bss(priv-hw-wiphy, priv-channel, bssid, NULL, 0,
+  IEEE80211_BSS_TYPE_ANY, IEEE80211_PRIVACY_ANY);
 
if (!bss  !conf-ibss_joined) {
wsm_unlock_tx(priv);
diff --git a/drivers/net/wireless/libertas/cfg.c 
b/drivers/net/wireless/libertas/cfg.c
index a92985a..1a4d558 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -1356,8 +1356,8 @@ static int lbs_cfg_connect(struct 

Re: [PATCH v2 3/3] mac80211: don't defer scans in case of radar detection

2015-02-08 Thread Eliad Peller
Hi Jouni,

On Sat, Feb 7, 2015 at 1:57 PM, Jouni Malinen j...@w1.fi wrote:
 On Wed, Jan 07, 2015 at 05:50:11PM +0200, Eliad Peller wrote:
 Radar detection can last indefinite time. There is no
 point in deferring a scan request in this case - simply
 return -EBUSY.

 diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c
 @@ -505,7 +505,7 @@ static int __ieee80211_start_scan(struct 
 ieee80211_sub_if_data *sdata,
 - if (local-scan_req)
 + if (local-scan_req || ieee80211_is_radar_required(local))
   return -EBUSY;

 This seems to be breaking a hwsim test case sequence of ap_vht80plus80
 followed by ap_vht80. In such a case, all the HT40 scans for ap_vht80
 fail due to this added condition resulting in -EBUSY being returned
 every time. It looks like this happens even if I change ap_vht80 to use
 the same country code (US) as ap_vht80plus80, so the change in the
 country code does not explain this either.

 I'm not sure what is causing the issue here, but it looks like something
 in ap_vht80plus80 (i.e., an attempt to enable a channel combination that
 would require DFS on one of the 80 MHz segments) leaves behind state
 that makes ieee80211_is_radar_required(local) return true even when it
 shouldn't. DFS for 80+80 is not yet supported, so I'd assume this is
 somehow related to that. Anyway, I don't think mac80211 should behave in
 this way.

Thanks for the detailed report.
There was indeed stale state. I've just sent a patch to fix it.

I don't see why returning EBUSY is wrong, though.
Actually, it just make the test fail immediately, instead of waiting
indefinitely until a timeout occurs (i guess, didn't actually test it
with the reverted patch).
This was exactly the intended behavior, and i think it makes much more sense.

Eliad.
--
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 3/3] mac80211: don't defer scans in case of radar detection

2015-02-08 Thread Janusz Dziedzic
On 8 February 2015 at 11:57, Eliad Peller el...@wizery.com wrote:
 On Sat, Feb 7, 2015 at 9:17 PM, Janusz Dziedzic
 janusz.dzied...@tieto.com wrote:
 BTW, what in case we will start AP on first interface (DFS channel),
 on second one we will try to connect to other AP. As I understand this
 correctly, second iface (STA iface) will not allow to scan (connect)
 ...?

 right.
 The rationale behind it that you must listen constantly to detect
 radar events, which prevents scanning off-channel.
 (i guess an exception for on-channel scanning can be added if needed, though)

Still I can image hw with hw_scan() support that could have dedicated
hw part for scanning.
So, driver should made this decision (allow or not) base on hw features.

BR
Janusz

 Other case, what if we start DFS AP and allow to scan in AP mode (eg
 for ACS purpose, allow to choose better channel and do CSA ...)?
 ditto. you just have to make sure you keep listening on the operating channel.

 Eliad.
--
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] brcmfmac: respect reason when deleting (deauthenticating) STA

2015-02-08 Thread Rafał Miłecki
Starting with kernel 3.19 reason is provided by cfg80211.

Signed-off-by: Rafał Miłecki zaj...@gmail.com
Acked-by: Arend van Spriel ar...@broadcom.com
---
 drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c 
b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
index b59b8c6..a23bfaa 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c
@@ -4272,7 +4272,7 @@ brcmf_cfg80211_del_station(struct wiphy *wiphy, struct 
net_device *ndev,
return -EIO;
 
memcpy(scbval.ea, params-mac, ETH_ALEN);
-   scbval.val = cpu_to_le32(WLAN_REASON_DEAUTH_LEAVING);
+   scbval.val = cpu_to_le32(params-reason_code);
err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON,
 scbval, sizeof(scbval));
if (err)
-- 
1.8.4.5

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


Re: [PATCH v2 3/3] mac80211: don't defer scans in case of radar detection

2015-02-08 Thread Eliad Peller
On Sat, Feb 7, 2015 at 9:17 PM, Janusz Dziedzic
janusz.dzied...@tieto.com wrote:
 BTW, what in case we will start AP on first interface (DFS channel),
 on second one we will try to connect to other AP. As I understand this
 correctly, second iface (STA iface) will not allow to scan (connect)
 ...?

right.
The rationale behind it that you must listen constantly to detect
radar events, which prevents scanning off-channel.
(i guess an exception for on-channel scanning can be added if needed, though)

 Other case, what if we start DFS AP and allow to scan in AP mode (eg
 for ACS purpose, allow to choose better channel and do CSA ...)?
ditto. you just have to make sure you keep listening on the operating channel.

Eliad.
--
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 3/4] bcma: support bringing up bus hosted on PCIe Gen 2

2015-02-08 Thread Rafał Miłecki
Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
V2: Use pcie_set_readrq helper instead of pcie_capability_clear_and_set_word
V3: Fix pcie_set_readrq argument
Print error if pcie_set_readrq fails
---
 drivers/bcma/bcma_private.h|  3 +++
 drivers/bcma/driver_pcie2.c| 28 ++--
 drivers/bcma/host_pci.c|  2 +-
 include/linux/bcma/bcma_driver_pcie2.h |  2 ++
 4 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index 351f4af..3692912 100644
--- a/drivers/bcma/bcma_private.h
+++ b/drivers/bcma/bcma_private.h
@@ -104,6 +104,9 @@ u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
 void bcma_core_pci_up(struct bcma_drv_pci *pc);
 void bcma_core_pci_down(struct bcma_drv_pci *pc);
 
+/* driver_pcie2.c */
+void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2);
+
 extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);
 
 #ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
diff --git a/drivers/bcma/driver_pcie2.c b/drivers/bcma/driver_pcie2.c
index e4be537..4568bc7 100644
--- a/drivers/bcma/driver_pcie2.c
+++ b/drivers/bcma/driver_pcie2.c
@@ -156,14 +156,23 @@ static void pciedev_reg_pm_clk_period(struct 
bcma_drv_pcie2 *pcie2)
 
 void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2)
 {
-   struct bcma_chipinfo *ci = pcie2-core-bus-chipinfo;
+   struct bcma_bus *bus = pcie2-core-bus;
+   struct bcma_chipinfo *ci = bus-chipinfo;
u32 tmp;
 
tmp = pcie2_read32(pcie2, BCMA_CORE_PCIE2_SPROM(54));
if ((tmp  0xe)  1 == 2)
bcma_core_pcie2_cfg_write(pcie2, 0x4e0, 0x17);
 
-   /* TODO: Do we need pcie_reqsize? */
+   switch (bus-chipinfo.id) {
+   case BCMA_CHIP_ID_BCM4360:
+   case BCMA_CHIP_ID_BCM4352:
+   pcie2-reqsize = 1024;
+   break;
+   default:
+   pcie2-reqsize = 128;
+   break;
+   }
 
if (ci-id == BCMA_CHIP_ID_BCM4360  ci-rev  3)
bcma_core_pcie2_war_delay_perst_enab(pcie2, true);
@@ -173,3 +182,18 @@ void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2)
pciedev_crwlpciegen2_180(pcie2);
pciedev_crwlpciegen2_182(pcie2);
 }
+
+/**
+ * Runtime ops.
+ **/
+
+void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2)
+{
+   struct bcma_bus *bus = pcie2-core-bus;
+   struct pci_dev *dev = bus-host_pci;
+   int err;
+
+   err = pcie_set_readrq(dev, pcie2-reqsize);
+   if (err)
+   bcma_err(bus, Error setting PCI_EXP_DEVCTL_READRQ: %d\n, err);
+}
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index 8dd37dc..5fb87a8 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -322,7 +322,7 @@ void bcma_host_pci_up(struct bcma_bus *bus)
return;
 
if (bus-host_is_pcie2)
-   pr_warn(Bringing up bus with PCIe Gen 2 host is unsupported 
yet\n);
+   bcma_core_pcie2_up(bus-drv_pcie2);
else
bcma_core_pci_up(bus-drv_pci[0]);
 }
diff --git a/include/linux/bcma/bcma_driver_pcie2.h 
b/include/linux/bcma/bcma_driver_pcie2.h
index 5988b05..d8c4329 100644
--- a/include/linux/bcma/bcma_driver_pcie2.h
+++ b/include/linux/bcma/bcma_driver_pcie2.h
@@ -143,6 +143,8 @@
 
 struct bcma_drv_pcie2 {
struct bcma_device *core;
+
+   u16 reqsize;
 };
 
 #define pcie2_read16(pcie2, offset)bcma_read16((pcie2)-core, 
offset)
-- 
1.8.4.5

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


[PATCH V3 1/4] bcma: add helpers bringing PCIe hosted bus up / down

2015-02-08 Thread Rafał Miłecki
Bringing PCIe hosted bus up requires operating on host-related core.
Since we plan to support PCIe Gen 2 devices we should provide a helper
picking the correct one (PCIE or PCIE2).

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
 drivers/bcma/bcma_private.h|  2 ++
 drivers/bcma/driver_pci.c  | 20 ++
 drivers/bcma/host_pci.c| 28 ++
 drivers/net/wireless/b43/main.c|  4 ++--
 drivers/net/wireless/brcm80211/brcmsmac/main.c |  8 
 include/linux/bcma/bcma.h  |  3 +++
 include/linux/bcma/bcma_driver_pci.h   |  2 --
 7 files changed, 41 insertions(+), 26 deletions(-)

diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index ac6c5fc..351f4af 100644
--- a/drivers/bcma/bcma_private.h
+++ b/drivers/bcma/bcma_private.h
@@ -101,6 +101,8 @@ static inline void __exit 
bcma_host_soc_unregister_driver(void)
 
 /* driver_pci.c */
 u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
+void bcma_core_pci_up(struct bcma_drv_pci *pc);
+void bcma_core_pci_down(struct bcma_drv_pci *pc);
 
 extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);
 
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
index 784..cf92bfa 100644
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
@@ -328,28 +328,12 @@ static void bcma_core_pci_extend_L1timer(struct 
bcma_drv_pci *pc, bool extend)
bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG);
 }
 
-void bcma_core_pci_up(struct bcma_bus *bus)
+void bcma_core_pci_up(struct bcma_drv_pci *pc)
 {
-   struct bcma_drv_pci *pc;
-
-   if (bus-hosttype != BCMA_HOSTTYPE_PCI)
-   return;
-
-   pc = bus-drv_pci[0];
-
bcma_core_pci_extend_L1timer(pc, true);
 }
-EXPORT_SYMBOL_GPL(bcma_core_pci_up);
 
-void bcma_core_pci_down(struct bcma_bus *bus)
+void bcma_core_pci_down(struct bcma_drv_pci *pc)
 {
-   struct bcma_drv_pci *pc;
-
-   if (bus-hosttype != BCMA_HOSTTYPE_PCI)
-   return;
-
-   pc = bus-drv_pci[0];
-
bcma_core_pci_extend_L1timer(pc, false);
 }
-EXPORT_SYMBOL_GPL(bcma_core_pci_down);
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index 53c6a8a..8dd37dc 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -310,3 +310,31 @@ void __exit bcma_host_pci_exit(void)
 {
pci_unregister_driver(bcma_pci_bridge_driver);
 }
+
+/**
+ * Runtime ops for drivers.
+ **/
+
+/* See also pcicore_up */
+void bcma_host_pci_up(struct bcma_bus *bus)
+{
+   if (bus-hosttype != BCMA_HOSTTYPE_PCI)
+   return;
+
+   if (bus-host_is_pcie2)
+   pr_warn(Bringing up bus with PCIe Gen 2 host is unsupported 
yet\n);
+   else
+   bcma_core_pci_up(bus-drv_pci[0]);
+}
+EXPORT_SYMBOL_GPL(bcma_host_pci_up);
+
+/* See also pcicore_down */
+void bcma_host_pci_down(struct bcma_bus *bus)
+{
+   if (bus-hosttype != BCMA_HOSTTYPE_PCI)
+   return;
+
+   if (!bus-host_is_pcie2)
+   bcma_core_pci_down(bus-drv_pci[0]);
+}
+EXPORT_SYMBOL_GPL(bcma_host_pci_down);
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 2c90886..e129b4c 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4819,7 +4819,7 @@ static void b43_wireless_core_exit(struct b43_wldev *dev)
switch (dev-dev-bus_type) {
 #ifdef CONFIG_B43_BCMA
case B43_BUS_BCMA:
-   bcma_core_pci_down(dev-dev-bdev-bus);
+   bcma_host_pci_down(dev-dev-bdev-bus);
break;
 #endif
 #ifdef CONFIG_B43_SSB
@@ -4868,7 +4868,7 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
case B43_BUS_BCMA:
bcma_core_pci_irq_ctl(dev-dev-bdev-bus-drv_pci[0],
  dev-dev-bdev, true);
-   bcma_core_pci_up(dev-dev-bdev-bus);
+   bcma_host_pci_up(dev-dev-bdev-bus);
break;
 #endif
 #ifdef CONFIG_B43_SSB
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c 
b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index eb8584a..bcbfc6e 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -4668,7 +4668,7 @@ static int brcms_b_attach(struct brcms_c_info *wlc, 
struct bcma_device *core,
brcms_c_coredisable(wlc_hw);
 
/* Match driver down state */
-   bcma_core_pci_down(wlc_hw-d11core-bus);
+   bcma_host_pci_down(wlc_hw-d11core-bus);
 
/* turn off pll and xtal to match driver down state */
brcms_b_xtal(wlc_hw, OFF);
@@ -4969,12 +4969,12 @@ static int brcms_b_up_prep(struct brcms_hardware 
*wlc_hw)
 */
if (brcms_b_radio_read_hwdisabled(wlc_hw)) {
/* put SB PCI in down state 

[PATCH V3 2/4] bcma: change IRQ control function to accept bus as an argument

2015-02-08 Thread Rafał Miłecki
It doesn't operate on PCI core, but PCI host device, so there is no
point of passing core related struct.

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
 drivers/bcma/driver_pci.c  | 6 +++---
 drivers/net/wireless/b43/main.c| 2 +-
 drivers/net/wireless/brcm80211/brcmsmac/main.c | 2 +-
 include/linux/bcma/bcma_driver_pci.h   | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
index cf92bfa..cfd35bc 100644
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
@@ -282,21 +282,21 @@ void bcma_core_pci_power_save(struct bcma_bus *bus, bool 
up)
 }
 EXPORT_SYMBOL_GPL(bcma_core_pci_power_save);
 
-int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
+int bcma_core_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core,
  bool enable)
 {
struct pci_dev *pdev;
u32 coremask, tmp;
int err = 0;
 
-   if (!pc || core-bus-hosttype != BCMA_HOSTTYPE_PCI) {
+   if (bus-hosttype != BCMA_HOSTTYPE_PCI) {
/* This bcma device is not on a PCI host-bus. So the IRQs are
 * not routed through the PCI core.
 * So we must not enable routing through the PCI core. */
goto out;
}
 
-   pdev = pc-core-bus-host_pci;
+   pdev = bus-host_pci;
 
err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, tmp);
if (err)
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index e129b4c..44794d2 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4866,7 +4866,7 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
switch (dev-dev-bus_type) {
 #ifdef CONFIG_B43_BCMA
case B43_BUS_BCMA:
-   bcma_core_pci_irq_ctl(dev-dev-bdev-bus-drv_pci[0],
+   bcma_core_pci_irq_ctl(dev-dev-bdev-bus,
  dev-dev-bdev, true);
bcma_host_pci_up(dev-dev-bdev-bus);
break;
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c 
b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index bcbfc6e..c84af1d 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -4959,7 +4959,7 @@ static int brcms_b_up_prep(struct brcms_hardware *wlc_hw)
 * Configure pci/pcmcia here instead of in brcms_c_attach()
 * to allow mfg hotswap:  down, hotswap (chip power cycle), up.
 */
-   bcma_core_pci_irq_ctl(wlc_hw-d11core-bus-drv_pci[0], 
wlc_hw-d11core,
+   bcma_core_pci_irq_ctl(wlc_hw-d11core-bus, wlc_hw-d11core,
  true);
 
/*
diff --git a/include/linux/bcma/bcma_driver_pci.h 
b/include/linux/bcma/bcma_driver_pci.h
index 23af893..6b8bca6 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -240,7 +240,7 @@ struct bcma_drv_pci {
 
 extern void bcma_core_pci_early_init(struct bcma_drv_pci *pc);
 extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
-extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
+extern int bcma_core_pci_irq_ctl(struct bcma_bus *bus,
 struct bcma_device *core, bool enable);
 extern void bcma_core_pci_power_save(struct bcma_bus *bus, bool up);
 
-- 
1.8.4.5

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


[PATCH V3 4/4] bcma: enable support for PCIe Gen 2 host devices

2015-02-08 Thread Rafał Miłecki
Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
 drivers/bcma/bcma_private.h |  1 +
 drivers/bcma/host_pci.c | 15 ++-
 drivers/bcma/main.c |  2 +-
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index 3692912..29565e3 100644
--- a/drivers/bcma/bcma_private.h
+++ b/drivers/bcma/bcma_private.h
@@ -26,6 +26,7 @@ bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 
mask, u32 value,
 int timeout);
 void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core);
 void bcma_init_bus(struct bcma_bus *bus);
+void bcma_unregister_cores(struct bcma_bus *bus);
 int bcma_bus_register(struct bcma_bus *bus);
 void bcma_bus_unregister(struct bcma_bus *bus);
 int __init bcma_bus_early_register(struct bcma_bus *bus);
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index 5fb87a8..a62a2f9 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -213,16 +213,26 @@ static int bcma_host_pci_probe(struct pci_dev *dev,
/* Initialize struct, detect chip */
bcma_init_bus(bus);
 
+   /* Scan bus to find out generation of PCIe core */
+   err = bcma_bus_scan(bus);
+   if (err)
+   goto err_pci_unmap_mmio;
+
+   if (bcma_find_core(bus, BCMA_CORE_PCIE2))
+   bus-host_is_pcie2 = true;
+
/* Register */
err = bcma_bus_register(bus);
if (err)
-   goto err_pci_unmap_mmio;
+   goto err_unregister_cores;
 
pci_set_drvdata(dev, bus);
 
 out:
return err;
 
+err_unregister_cores:
+   bcma_unregister_cores(bus);
 err_pci_unmap_mmio:
pci_iounmap(dev, bus-mmio);
 err_pci_release_regions:
@@ -283,9 +293,12 @@ static const struct pci_device_id bcma_pci_bridge_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4357) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4358) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4359) },
+   { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4360) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4365) },
+   { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a0) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) },
+   { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43b1) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43227) },  /* 0xa8db, BCM43217 
(sic!) */
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43228) },  /* 0xa8dc */
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 38bde6e..9635f10 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -363,7 +363,7 @@ static int bcma_register_devices(struct bcma_bus *bus)
return 0;
 }
 
-static void bcma_unregister_cores(struct bcma_bus *bus)
+void bcma_unregister_cores(struct bcma_bus *bus)
 {
struct bcma_device *core, *tmp;
 
-- 
1.8.4.5

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


Re: [PATCH 3/4] bcma: support bringing up bus hosted on PCIe Gen 2

2015-02-08 Thread Hauke Mehrtens
On 02/06/2015 07:56 AM, Kalle Valo wrote:
 Rafał Miłecki zaj...@gmail.com writes:
 
 +void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2)
 +{
 + struct bcma_bus *bus = pcie2-core-bus;
 + struct pci_dev *dev = bus-host_pci;
 +
 + pcie_capability_clear_and_set_word(dev, PCI_EXP_DEVCTL,
 +PCI_EXP_DEVCTL_READRQ,
 +pcie2-reqsize);

 Use pcie_set_readrq() if it is needed.

 What do you mean by if needed? Is there anything wrong?
 
 So what's the conclusion? Can I apply these?
 
Ah sorry,

The if needed referenced the comment above about if setting this is
needed at all, or if this should be done by the driver for the (broken?)
PCIe controller.

pcie_set_readrq() does the setting of this register in the Linux kernel
and does some additional checks, I would suggest using this function
instead of setting this register by yourself.

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


[PATCH V2 2/4] bcma: change IRQ control function to accept bus as an argument

2015-02-08 Thread Rafał Miłecki
It doesn't operate on PCI core, but PCI host device, so there is no
point of passing core related struct.

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
 drivers/bcma/driver_pci.c  | 6 +++---
 drivers/net/wireless/b43/main.c| 2 +-
 drivers/net/wireless/brcm80211/brcmsmac/main.c | 2 +-
 include/linux/bcma/bcma_driver_pci.h   | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
index cf92bfa..cfd35bc 100644
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
@@ -282,21 +282,21 @@ void bcma_core_pci_power_save(struct bcma_bus *bus, bool 
up)
 }
 EXPORT_SYMBOL_GPL(bcma_core_pci_power_save);
 
-int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, struct bcma_device *core,
+int bcma_core_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core,
  bool enable)
 {
struct pci_dev *pdev;
u32 coremask, tmp;
int err = 0;
 
-   if (!pc || core-bus-hosttype != BCMA_HOSTTYPE_PCI) {
+   if (bus-hosttype != BCMA_HOSTTYPE_PCI) {
/* This bcma device is not on a PCI host-bus. So the IRQs are
 * not routed through the PCI core.
 * So we must not enable routing through the PCI core. */
goto out;
}
 
-   pdev = pc-core-bus-host_pci;
+   pdev = bus-host_pci;
 
err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, tmp);
if (err)
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index e129b4c..44794d2 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4866,7 +4866,7 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
switch (dev-dev-bus_type) {
 #ifdef CONFIG_B43_BCMA
case B43_BUS_BCMA:
-   bcma_core_pci_irq_ctl(dev-dev-bdev-bus-drv_pci[0],
+   bcma_core_pci_irq_ctl(dev-dev-bdev-bus,
  dev-dev-bdev, true);
bcma_host_pci_up(dev-dev-bdev-bus);
break;
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c 
b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index bcbfc6e..c84af1d 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -4959,7 +4959,7 @@ static int brcms_b_up_prep(struct brcms_hardware *wlc_hw)
 * Configure pci/pcmcia here instead of in brcms_c_attach()
 * to allow mfg hotswap:  down, hotswap (chip power cycle), up.
 */
-   bcma_core_pci_irq_ctl(wlc_hw-d11core-bus-drv_pci[0], 
wlc_hw-d11core,
+   bcma_core_pci_irq_ctl(wlc_hw-d11core-bus, wlc_hw-d11core,
  true);
 
/*
diff --git a/include/linux/bcma/bcma_driver_pci.h 
b/include/linux/bcma/bcma_driver_pci.h
index 23af893..6b8bca6 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -240,7 +240,7 @@ struct bcma_drv_pci {
 
 extern void bcma_core_pci_early_init(struct bcma_drv_pci *pc);
 extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
-extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
+extern int bcma_core_pci_irq_ctl(struct bcma_bus *bus,
 struct bcma_device *core, bool enable);
 extern void bcma_core_pci_power_save(struct bcma_bus *bus, bool up);
 
-- 
1.8.4.5

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


[PATCH V2 4/4] bcma: enable support for PCIe Gen 2 host devices

2015-02-08 Thread Rafał Miłecki
Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
 drivers/bcma/bcma_private.h |  1 +
 drivers/bcma/host_pci.c | 15 ++-
 drivers/bcma/main.c |  2 +-
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index 3692912..29565e3 100644
--- a/drivers/bcma/bcma_private.h
+++ b/drivers/bcma/bcma_private.h
@@ -26,6 +26,7 @@ bool bcma_wait_value(struct bcma_device *core, u16 reg, u32 
mask, u32 value,
 int timeout);
 void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core);
 void bcma_init_bus(struct bcma_bus *bus);
+void bcma_unregister_cores(struct bcma_bus *bus);
 int bcma_bus_register(struct bcma_bus *bus);
 void bcma_bus_unregister(struct bcma_bus *bus);
 int __init bcma_bus_early_register(struct bcma_bus *bus);
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index 5fb87a8..a62a2f9 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -213,16 +213,26 @@ static int bcma_host_pci_probe(struct pci_dev *dev,
/* Initialize struct, detect chip */
bcma_init_bus(bus);
 
+   /* Scan bus to find out generation of PCIe core */
+   err = bcma_bus_scan(bus);
+   if (err)
+   goto err_pci_unmap_mmio;
+
+   if (bcma_find_core(bus, BCMA_CORE_PCIE2))
+   bus-host_is_pcie2 = true;
+
/* Register */
err = bcma_bus_register(bus);
if (err)
-   goto err_pci_unmap_mmio;
+   goto err_unregister_cores;
 
pci_set_drvdata(dev, bus);
 
 out:
return err;
 
+err_unregister_cores:
+   bcma_unregister_cores(bus);
 err_pci_unmap_mmio:
pci_iounmap(dev, bus-mmio);
 err_pci_release_regions:
@@ -283,9 +293,12 @@ static const struct pci_device_id bcma_pci_bridge_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4357) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4358) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4359) },
+   { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4360) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4365) },
+   { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a0) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43a9) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43aa) },
+   { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x43b1) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4727) },
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43227) },  /* 0xa8db, BCM43217 
(sic!) */
{ PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 43228) },  /* 0xa8dc */
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 38bde6e..9635f10 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -363,7 +363,7 @@ static int bcma_register_devices(struct bcma_bus *bus)
return 0;
 }
 
-static void bcma_unregister_cores(struct bcma_bus *bus)
+void bcma_unregister_cores(struct bcma_bus *bus)
 {
struct bcma_device *core, *tmp;
 
-- 
1.8.4.5

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


[PATCH V2 3/4] bcma: support bringing up bus hosted on PCIe Gen 2

2015-02-08 Thread Rafał Miłecki
Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
V2: Use pcie_set_readrq helper instead of pcie_capability_clear_and_set_word
---
 drivers/bcma/bcma_private.h|  3 +++
 drivers/bcma/driver_pcie2.c| 22 --
 drivers/bcma/host_pci.c|  2 +-
 include/linux/bcma/bcma_driver_pcie2.h |  2 ++
 4 files changed, 26 insertions(+), 3 deletions(-)

diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index 351f4af..3692912 100644
--- a/drivers/bcma/bcma_private.h
+++ b/drivers/bcma/bcma_private.h
@@ -104,6 +104,9 @@ u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
 void bcma_core_pci_up(struct bcma_drv_pci *pc);
 void bcma_core_pci_down(struct bcma_drv_pci *pc);
 
+/* driver_pcie2.c */
+void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2);
+
 extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);
 
 #ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
diff --git a/drivers/bcma/driver_pcie2.c b/drivers/bcma/driver_pcie2.c
index e4be537..72cf529 100644
--- a/drivers/bcma/driver_pcie2.c
+++ b/drivers/bcma/driver_pcie2.c
@@ -156,14 +156,20 @@ static void pciedev_reg_pm_clk_period(struct 
bcma_drv_pcie2 *pcie2)
 
 void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2)
 {
-   struct bcma_chipinfo *ci = pcie2-core-bus-chipinfo;
+   struct bcma_bus *bus = pcie2-core-bus;
+   struct bcma_chipinfo *ci = bus-chipinfo;
u32 tmp;
 
tmp = pcie2_read32(pcie2, BCMA_CORE_PCIE2_SPROM(54));
if ((tmp  0xe)  1 == 2)
bcma_core_pcie2_cfg_write(pcie2, 0x4e0, 0x17);
 
-   /* TODO: Do we need pcie_reqsize? */
+   switch (bus-chipinfo.id) {
+   case BCMA_CHIP_ID_BCM4360:
+   case BCMA_CHIP_ID_BCM4352:
+   pcie2-reqsize = 0x3000; /* TODO: PCI_EXP_DEVCTL_READRQ_1024B */
+   break;
+   }
 
if (ci-id == BCMA_CHIP_ID_BCM4360  ci-rev  3)
bcma_core_pcie2_war_delay_perst_enab(pcie2, true);
@@ -173,3 +179,15 @@ void bcma_core_pcie2_init(struct bcma_drv_pcie2 *pcie2)
pciedev_crwlpciegen2_180(pcie2);
pciedev_crwlpciegen2_182(pcie2);
 }
+
+/**
+ * Runtime ops.
+ **/
+
+void bcma_core_pcie2_up(struct bcma_drv_pcie2 *pcie2)
+{
+   struct bcma_bus *bus = pcie2-core-bus;
+   struct pci_dev *dev = bus-host_pci;
+
+   pcie_set_readrq(dev, pcie2-reqsize);
+}
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index 8dd37dc..5fb87a8 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -322,7 +322,7 @@ void bcma_host_pci_up(struct bcma_bus *bus)
return;
 
if (bus-host_is_pcie2)
-   pr_warn(Bringing up bus with PCIe Gen 2 host is unsupported 
yet\n);
+   bcma_core_pcie2_up(bus-drv_pcie2);
else
bcma_core_pci_up(bus-drv_pci[0]);
 }
diff --git a/include/linux/bcma/bcma_driver_pcie2.h 
b/include/linux/bcma/bcma_driver_pcie2.h
index 5988b05..d8c4329 100644
--- a/include/linux/bcma/bcma_driver_pcie2.h
+++ b/include/linux/bcma/bcma_driver_pcie2.h
@@ -143,6 +143,8 @@
 
 struct bcma_drv_pcie2 {
struct bcma_device *core;
+
+   u16 reqsize;
 };
 
 #define pcie2_read16(pcie2, offset)bcma_read16((pcie2)-core, 
offset)
-- 
1.8.4.5

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


[PATCH V2 1/4] bcma: add helpers bringing PCIe hosted bus up / down

2015-02-08 Thread Rafał Miłecki
Bringing PCIe hosted bus up requires operating on host-related core.
Since we plan to support PCIe Gen 2 devices we should provide a helper
picking the correct one (PCIE or PCIE2).

Signed-off-by: Rafał Miłecki zaj...@gmail.com
---
 drivers/bcma/bcma_private.h|  2 ++
 drivers/bcma/driver_pci.c  | 20 ++
 drivers/bcma/host_pci.c| 28 ++
 drivers/net/wireless/b43/main.c|  4 ++--
 drivers/net/wireless/brcm80211/brcmsmac/main.c |  8 
 include/linux/bcma/bcma.h  |  3 +++
 include/linux/bcma/bcma_driver_pci.h   |  2 --
 7 files changed, 41 insertions(+), 26 deletions(-)

diff --git a/drivers/bcma/bcma_private.h b/drivers/bcma/bcma_private.h
index ac6c5fc..351f4af 100644
--- a/drivers/bcma/bcma_private.h
+++ b/drivers/bcma/bcma_private.h
@@ -101,6 +101,8 @@ static inline void __exit 
bcma_host_soc_unregister_driver(void)
 
 /* driver_pci.c */
 u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
+void bcma_core_pci_up(struct bcma_drv_pci *pc);
+void bcma_core_pci_down(struct bcma_drv_pci *pc);
 
 extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);
 
diff --git a/drivers/bcma/driver_pci.c b/drivers/bcma/driver_pci.c
index 784..cf92bfa 100644
--- a/drivers/bcma/driver_pci.c
+++ b/drivers/bcma/driver_pci.c
@@ -328,28 +328,12 @@ static void bcma_core_pci_extend_L1timer(struct 
bcma_drv_pci *pc, bool extend)
bcma_pcie_read(pc, BCMA_CORE_PCI_DLLP_PMTHRESHREG);
 }
 
-void bcma_core_pci_up(struct bcma_bus *bus)
+void bcma_core_pci_up(struct bcma_drv_pci *pc)
 {
-   struct bcma_drv_pci *pc;
-
-   if (bus-hosttype != BCMA_HOSTTYPE_PCI)
-   return;
-
-   pc = bus-drv_pci[0];
-
bcma_core_pci_extend_L1timer(pc, true);
 }
-EXPORT_SYMBOL_GPL(bcma_core_pci_up);
 
-void bcma_core_pci_down(struct bcma_bus *bus)
+void bcma_core_pci_down(struct bcma_drv_pci *pc)
 {
-   struct bcma_drv_pci *pc;
-
-   if (bus-hosttype != BCMA_HOSTTYPE_PCI)
-   return;
-
-   pc = bus-drv_pci[0];
-
bcma_core_pci_extend_L1timer(pc, false);
 }
-EXPORT_SYMBOL_GPL(bcma_core_pci_down);
diff --git a/drivers/bcma/host_pci.c b/drivers/bcma/host_pci.c
index 53c6a8a..8dd37dc 100644
--- a/drivers/bcma/host_pci.c
+++ b/drivers/bcma/host_pci.c
@@ -310,3 +310,31 @@ void __exit bcma_host_pci_exit(void)
 {
pci_unregister_driver(bcma_pci_bridge_driver);
 }
+
+/**
+ * Runtime ops for drivers.
+ **/
+
+/* See also pcicore_up */
+void bcma_host_pci_up(struct bcma_bus *bus)
+{
+   if (bus-hosttype != BCMA_HOSTTYPE_PCI)
+   return;
+
+   if (bus-host_is_pcie2)
+   pr_warn(Bringing up bus with PCIe Gen 2 host is unsupported 
yet\n);
+   else
+   bcma_core_pci_up(bus-drv_pci[0]);
+}
+EXPORT_SYMBOL_GPL(bcma_host_pci_up);
+
+/* See also pcicore_down */
+void bcma_host_pci_down(struct bcma_bus *bus)
+{
+   if (bus-hosttype != BCMA_HOSTTYPE_PCI)
+   return;
+
+   if (!bus-host_is_pcie2)
+   bcma_core_pci_down(bus-drv_pci[0]);
+}
+EXPORT_SYMBOL_GPL(bcma_host_pci_down);
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 2c90886..e129b4c 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4819,7 +4819,7 @@ static void b43_wireless_core_exit(struct b43_wldev *dev)
switch (dev-dev-bus_type) {
 #ifdef CONFIG_B43_BCMA
case B43_BUS_BCMA:
-   bcma_core_pci_down(dev-dev-bdev-bus);
+   bcma_host_pci_down(dev-dev-bdev-bus);
break;
 #endif
 #ifdef CONFIG_B43_SSB
@@ -4868,7 +4868,7 @@ static int b43_wireless_core_init(struct b43_wldev *dev)
case B43_BUS_BCMA:
bcma_core_pci_irq_ctl(dev-dev-bdev-bus-drv_pci[0],
  dev-dev-bdev, true);
-   bcma_core_pci_up(dev-dev-bdev-bus);
+   bcma_host_pci_up(dev-dev-bdev-bus);
break;
 #endif
 #ifdef CONFIG_B43_SSB
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c 
b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index eb8584a..bcbfc6e 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -4668,7 +4668,7 @@ static int brcms_b_attach(struct brcms_c_info *wlc, 
struct bcma_device *core,
brcms_c_coredisable(wlc_hw);
 
/* Match driver down state */
-   bcma_core_pci_down(wlc_hw-d11core-bus);
+   bcma_host_pci_down(wlc_hw-d11core-bus);
 
/* turn off pll and xtal to match driver down state */
brcms_b_xtal(wlc_hw, OFF);
@@ -4969,12 +4969,12 @@ static int brcms_b_up_prep(struct brcms_hardware 
*wlc_hw)
 */
if (brcms_b_radio_read_hwdisabled(wlc_hw)) {
/* put SB PCI in down state 

Re: [PATCH v2 3/3] mac80211: don't defer scans in case of radar detection

2015-02-08 Thread Jouni Malinen
On Sun, Feb 08, 2015 at 12:41:14PM +0200, Eliad Peller wrote:
 There was indeed stale state. I've just sent a patch to fix it.

Thanks, that fixed the issue.

 I don't see why returning EBUSY is wrong, though.
 Actually, it just make the test fail immediately, instead of waiting
 indefinitely until a timeout occurs (i guess, didn't actually test it
 with the reverted patch).
 This was exactly the intended behavior, and i think it makes much more sense.

I have no issues with EBUSY being returned for a case where an
offchannel operation would be required while on a channel that require
constant monitoring for radars. I guess it would be fine to run a
single-channel scan on that same channel in such a state, but I'm not
sure whether this code prevents that or not. (Or whether there is really
that much of a real use case for such an operation.)

-- 
Jouni MalinenPGP id EFC895FA
--
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-08 Thread Nagarajan, Ashok Raj
Hi Johannes,

I see your point here. I will upload one patch for printing this info from iw.

I will also write another patch for removing HT40 one?

Thanks,
Ashok

From: Johannes Berg johan...@sipsolutions.net
Sent: Saturday, February 7, 2015 12:41 AM
To: Nagarajan, Ashok Raj
Cc: linux-wireless@vger.kernel.org; Manoharan, Rajkumar; Thiagarajan, 
Vasanthakumar
Subject: Re: [PATCH] cfg80211: add debugfs VHT80 allow map

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


[PATCH] iw: display allowable channel bandwidth information

2015-02-08 Thread Ashok Raj Nagarajan
We already have allowable channel bandwidth information at userspace.
Display this information with 'iw list'. Excerpt of iw list command

Frequencies:
* 5180 MHz [36] (17.0 dBm) (HT40+, VHT80, VHT160)
* 5200 MHz [40] (17.0 * dBm) (HT40-, HT40+, VHT80, VHT160)

Signed-off-by: Ashok Raj Nagarajan arnag...@qti.qualcomm.com
---
 info.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/info.c b/info.c
index 6e21e45..84db716 100644
--- a/info.c
+++ b/info.c
@@ -173,6 +173,18 @@ static int print_phy_handler(struct nl_msg *msg, void *arg)
goto next;
}
 
+   if 
(!tb_freq[NL80211_FREQUENCY_ATTR_NO_HT40_MINUS])
+   print_flag(HT40-, open);
+
+   if 
(!tb_freq[NL80211_FREQUENCY_ATTR_NO_HT40_PLUS])
+   print_flag(HT40+, open);
+
+   if 
(!tb_freq[NL80211_FREQUENCY_ATTR_NO_80MHZ])
+   print_flag(VHT80, open);
+
+   if 
(!tb_freq[NL80211_FREQUENCY_ATTR_NO_160MHZ])
+   print_flag(VHT160, open);
+
/* If both flags are set assume an new 
kernel */
if 
(tb_freq[NL80211_FREQUENCY_ATTR_NO_IR]  
tb_freq[__NL80211_FREQUENCY_ATTR_NO_IBSS]) {
print_flag(no IR, open);
-- 
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 v2 2/2] ath10k: Increase copy engine entries for rx wmi

2015-02-08 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 rmano...@qti.qualcomm.com
---
 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


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

2015-02-08 Thread Michal Kazior
On 6 February 2015 at 17:15, Ben Greear gree...@candelatech.com wrote:
 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.

This is mainly aimed at the tx-credit starvation due to mgmt-tx being
stuck on client powersave buffering.


 You might add something about 'WMI' in that warning
 message to make it more clear what is not being
 responsive.

Good point.


 At least in my tests, I could continue
 to receive network traffic while WMI was blocked.

Yeah. Traffic works with the tx-credit starvation as well but what
good is this if you have inconsistent driver-firmware state after
failing to send a few commands?


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: Ralink RT5390/RT5370 no longer works on more recent kernels

2015-02-08 Thread Larry Finger

On 02/07/2015 10:54 AM, Simon Raffeiner (SCC) wrote:

Hello everyone,

one of my USB wireless adapters, based on the Ralink RT5390/RT5370
chipset and RF, no longer works on more recent kernels. It doesn't
report any networks on iw dev wlan0 scan and doesn't associate if told
to do so.

Tested kernels are:

3.16.0-30-generic (Ubuntu 14.10): Works
3.18.0-12-generic (Ubuntu 15.04): Does not work
3.19.0-rc7 (built manually): Does not work


Firmware md5sums (rt2870.bin is loaded):

99bce75086ea635a2f8288d9b835f787  /lib/firmware/rt2561.bin
2878d5eaa4ff907d4df36a834915aa53  /lib/firmware/rt2561s.bin
9998485bc152cf0f39dd61a33b92ad9b  /lib/firmware/rt2661.bin
75a1da3caa0b1c95e81dfba207f834c6  /lib/firmware/rt2860.bin
36c944c3138125605d28c0a3a1338be9  /lib/firmware/rt2870.bin
36c944c3138125605d28c0a3a1338be9  /lib/firmware/rt3070.bin
75a1da3caa0b1c95e81dfba207f834c6  /lib/firmware/rt3090.bin
f8d8051e24cd4c8c298bc84c7309fe1a  /lib/firmware/rt3290.bin
bd733372ae21a010bf8a5511d7711c2d  /lib/firmware/rt73.bin


A dmesg output for the non-working kernel 3.18.0-12-generic is attached.


I do not maintain these drivers, but as no one else has answered, I will offer 
some suggestions.


First of all, it would be helpful if you posted the USB ID as shown by lsusb. As 
the kernel loaded the module, it must be one in the tables, but that info is 
usually needed.


The second thing to verify is that your configuration contains the line 
CONFIG_RT2800USB_RT53XX=y. This parameter is marked as depending on 
EXPERIMENTAL, and I'm not sure that Ubuntu enables those parameters in their 
kernels. Again as the module was loaded, I think your kernel is OK, but that 
parameter is something to check.


Finally, if your kernel configuration is OK, you will probably need to bisect 
the problem between v3.18 and v3.16. I have a device that uses rt2800usb, but it 
is not a 53XX. FWIW, it works.



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


[PATCH v2] brcmfmac: avoid duplicated suspend/resume operation

2015-02-08 Thread Fu, Zhonghui
From ff39ed4af9f1c50358fe92ec4c8eaac9db183e00 Mon Sep 17 00:00:00 2001
From: Zhonghui Fu zhonghui...@linux.intel.com
Date: Mon, 26 Jan 2015 10:13:21 +0800
Subject: [PATCH v2] brcmfmac: avoid duplicated suspend/resume operation

WiFi chip has 2 SDIO functions, and PM core will trigger
twice suspend/resume operations for one WiFi chip to do
the same things. This patch avoid this case.

Acked-by: Arend van Sprielar...@broadcom.com
Signed-off-by: Zhonghui Fu zhonghui...@linux.intel.com
---
Changes in v2:
 - Remove two Acked-by lines

 drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c |   17 +++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c 
b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
index 9880dae..618b545 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
@@ -1139,11 +1139,17 @@ void brcmf_sdio_wowl_config(struct device *dev, bool 
enabled)
 static int brcmf_ops_sdio_suspend(struct device *dev)
 {
struct brcmf_bus *bus_if = dev_get_drvdata(dev);
-   struct brcmf_sdio_dev *sdiodev = bus_if-bus_priv.sdio;
+   struct brcmf_sdio_dev *sdiodev;
mmc_pm_flag_t sdio_flags;
+   struct sdio_func *func = dev_to_sdio_func(dev);
 
brcmf_dbg(SDIO, Enter\n);
 
+   if (func-num == 2)
+   return 0;
+
+   sdiodev = bus_if-bus_priv.sdio;
+
atomic_set(sdiodev-suspend, true);
 
if (sdiodev-wowl_enabled) {
@@ -1164,9 +1170,16 @@ static int brcmf_ops_sdio_suspend(struct device *dev)
 static int brcmf_ops_sdio_resume(struct device *dev)
 {
struct brcmf_bus *bus_if = dev_get_drvdata(dev);
-   struct brcmf_sdio_dev *sdiodev = bus_if-bus_priv.sdio;
+   struct brcmf_sdio_dev *sdiodev;
+   struct sdio_func *func = dev_to_sdio_func(dev);
 
brcmf_dbg(SDIO, Enter\n);
+
+   if (func-num == 2)
+   return 0;
+
+   sdiodev = bus_if-bus_priv.sdio;
+
if (sdiodev-pdata  sdiodev-pdata-oob_irq_supported)
disable_irq_wake(sdiodev-pdata-oob_irq_nr);
brcmf_sdio_wd_timer(sdiodev-bus, BRCMF_WD_POLL_MS);
-- 1.7.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: [PATCH] brcmfmac: avoid duplicated suspend/resume operation

2015-02-08 Thread Fu, Zhonghui

I have re-sent the patch with the subject [PATCH v2] brcmfmac: avoid 
duplicated suspend/resume operation in another mail.
If this patch can be accepted, please tell me.

Thanks,
Zhonghui

On 2015/2/5 19:46, Arend van Spriel wrote:
 On 02/05/15 12:34, Fu, Zhonghui wrote:
 What comments about the new patch?  Can this new patch be accepted?

 Hi Zhonghui

 Last reply from Kalle was that it did not apply to his tree and recommended 
 to use version numbering so [PATCH V2] subject.

 Thanks,
 Zhonghui

 On 2015/1/26 10:46, Fu, Zhonghui wrote:
  From ff39ed4af9f1c50358fe92ec4c8eaac9db183e00 Mon Sep 17 00:00:00 2001
 From: Zhonghui Fuzhonghui...@linux.intel.com
 Date: Mon, 26 Jan 2015 10:13:21 +0800
 Subject: [PATCH] brcmfmac: avoid duplicated suspend/resume operation

 WiFi chip has 2 SDIO functions, and PM core will trigger
 twice suspend/resume operations for one WiFi chip to do
 the same things. This patch avoid this case.

 Acked-by: Arend van Sprielar...@broadcom.com
 Signed-off-by: Zhonghui Fuzhonghui...@linux.intel.com
 ---
 And when using version info a change log here is even better. Although 
 admittedly I lost track which version this would be ;-)

 Regards,
 Arend
 ---
   drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c |   17 +++--
   1 files changed, 15 insertions(+), 2 deletions(-)

 diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c 
 b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
 index 9880dae..618b545 100644
 --- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
 +++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
 @@ -1139,11 +1139,17 @@ void brcmf_sdio_wowl_config(struct device *dev, 
 bool enabled)
   static int brcmf_ops_sdio_suspend(struct device *dev)
   {
   struct brcmf_bus *bus_if = dev_get_drvdata(dev);
 -struct brcmf_sdio_dev *sdiodev = bus_if-bus_priv.sdio;
 +struct brcmf_sdio_dev *sdiodev;
   mmc_pm_flag_t sdio_flags;
 +struct sdio_func *func = dev_to_sdio_func(dev);

   brcmf_dbg(SDIO, Enter\n);

 +if (func-num == 2)
 +return 0;
 +
 +sdiodev = bus_if-bus_priv.sdio;
 +
   atomic_set(sdiodev-suspend, true);

   if (sdiodev-wowl_enabled) {
 @@ -1164,9 +1170,16 @@ static int brcmf_ops_sdio_suspend(struct device *dev)
   static int brcmf_ops_sdio_resume(struct device *dev)
   {
   struct brcmf_bus *bus_if = dev_get_drvdata(dev);
 -struct brcmf_sdio_dev *sdiodev = bus_if-bus_priv.sdio;
 +struct brcmf_sdio_dev *sdiodev;
 +struct sdio_func *func = dev_to_sdio_func(dev);

   brcmf_dbg(SDIO, Enter\n);
 +
 +if (func-num == 2)
 +return 0;
 +
 +sdiodev = bus_if-bus_priv.sdio;
 +
   if (sdiodev-pdata  sdiodev-pdata-oob_irq_supported)
   disable_irq_wake(sdiodev-pdata-oob_irq_nr);
   brcmf_sdio_wd_timer(sdiodev-bus, BRCMF_WD_POLL_MS);
 -- 1.7.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