Re: [PATCH 0/2] ath10k: add wmi-tlv debug event handling

2015-01-27 Thread Kalle Valo
Michal Kazior michal.kaz...@tieto.com writes:

 New wmi-tlv firmware will deliver debug messages
 via new events.

 Note: This may yield some (trivial) conflicts
 against my beacon/presp template patchset.


 Michal Kazior (2):
   ath10k: implement diag data container event
   ath10k: implement diag event

Thanks, applied to ath.git.

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


Re: [PATCH 1/2] ath10k: introduce struct ath10k_skb_rxcb

2015-01-27 Thread Kalle Valo
Michal Kazior michal.kaz...@tieto.com writes:

 It doesn't make much sense to share the
 ath10k_skb_cb with Rx path. The Rx path doesn't
 need to keep any mac80211's data.

 Signed-off-by: Michal Kazior michal.kaz...@tieto.com

Thanks, both patches applied to ath.git.

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


Re: [PATCH 0/2] ath10k: fix 10.2 fw stats

2015-01-27 Thread Kalle Valo
Michal Kazior michal.kaz...@tieto.com writes:

 I've tested this briefly with main 636, 10.1.467,
 10.2-00082-4 and 10.2.4.20. However I may have
 missed something so I'd be glad if someone can
 double-check me :-)

 Michal Kazior (2):
   ath10k: split fw pdev stats parsing
   ath10k: fix 10.2 fw stats parsing

Thanks, both patches applied.

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


Re: [PATCH 1/3] ath10k: reset chip before reading chip_id in probe

2015-01-27 Thread Kalle Valo
Michal Kazior michal.kaz...@tieto.com writes:

 There are some very rare cases with some hardware
 configuration that the device doesn't init quickly
 enough in which case reading chip_id yielded 0.
 This caused driver to subsequently fail to setup
 the device.

 Signed-off-by: Michal Kazior michal.kaz...@tieto.com

Thanks, all three patches applied to ath.git.

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


Re: [v2,1/3] mwifiex: add support for SD8801

2015-01-27 Thread Kalle Valo

 From: Yogesh Ashok Powar yoge...@marvell.com
 
 SD8801 is Marvell's 1x1 802.11bgn offering.
 This patch adds Device IDs for SD8801 and also defines card
 structure which has definition for register offsets, buffer sizes etc.
 
 Signed-off-by: Yogesh Ashok Powar yoge...@marvell.com
 Signed-off-by: Avinash Patil pat...@marvell.com
 Signed-off-by: Nishant Sarmukadam nisha...@marvell.com
 Signed-off-by: Cathy Luo c...@marvell.com
 Signed-off-by: Frank Huang fra...@marvell.com
 Reviewed-by: James Cameron qu...@laptop.org

Thanks, 3 patches applied to wireless-drivers-next.git:

52bd3d2023d4 mwifiex: add support for SD8801
eaa3d9fa08c5 mwifiex: add support for USB8801
1fe192d8d63f mwifiex: selectively choose ext_scan support

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


Re: [PATCH 4/7] net: wireless: wcn36xx: introduce WCN36XX_HAL_AVOID_FREQ_RANGE_IND

2015-01-27 Thread Eugene Krasnikov
Do you know when is this message used? sounds important.

2015-01-18 5:11 GMT+00:00 Andy Green andy.gr...@linaro.org:
 WCN3620 firmware introduces a new async indication, we need to
 add it as a known message type so we can accept it

 Signed-off-by: Andy Green andy.gr...@linaro.org
 ---
  drivers/net/wireless/ath/wcn36xx/hal.h |2 ++
  1 file changed, 2 insertions(+)

 diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h 
 b/drivers/net/wireless/ath/wcn36xx/hal.h
 index a1f1127..b947de0 100644
 --- a/drivers/net/wireless/ath/wcn36xx/hal.h
 +++ b/drivers/net/wireless/ath/wcn36xx/hal.h
 @@ -345,6 +345,8 @@ enum wcn36xx_hal_host_msg_type {
 WCN36XX_HAL_DHCP_START_IND = 189,
 WCN36XX_HAL_DHCP_STOP_IND = 190,

 +   WCN36XX_HAL_AVOID_FREQ_RANGE_IND = 233,
 +
 WCN36XX_HAL_MSG_MAX = WCN36XX_HAL_MSG_TYPE_MAX_ENUM_SIZE
  };





-- 
Best regards,
Eugene
--
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: rtlwifi: rtl8192cu: Set fw_ready flag

2015-01-27 Thread Kalle Valo

 After rtl8192cu download firmware routine, set fw_ready flag.
 
 Signed-off-by: Taehee Yoo ap420...@gmail.com
 Acked-by: Larry Finger larry.fin...@lwfinger.net

Thanks, applied to wireless-drivers-next.git.

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


Re: [PATCH] cfg80211: PBSS basic support

2015-01-27 Thread Johannes Berg
On Tue, 2015-01-27 at 09:55 +0200, Dedy Lansky wrote:

 --- a/include/linux/ieee80211.h
 +++ b/include/linux/ieee80211.h
 @@ -1602,6 +1602,15 @@ enum {
   IEEE80211_BANDID_60G   = 5, /* 60 GHz */
  };
  
 +/* BSS Type, 802.11ad #6.3.3.2 */
 +enum ieee80211_bsstype {
 + IEEE80211_BSS_TYPE_ESS,
 + IEEE80211_BSS_TYPE_PBSS,
 + IEEE80211_BSS_TYPE_IBSS,
 + IEEE80211_BSS_TYPE_MBSS,
 + IEEE80211_BSS_TYPE_ANY
 +};

Technically the standard defines this, but not as over the air bits as
everything else in this file. I think this should therefore be moved
into cfg80211.h as a local enum, we don't use the exact definitions from
clause 6 anywhere anyway.

 @@ -4007,6 +4009,7 @@ struct cfg80211_bss *cfg80211_get_bss(struct wiphy 
 *wiphy,
 struct ieee80211_channel *channel,
 const u8 *bssid,
 const u8 *ssid, size_t ssid_len,
 +   enum ieee80211_bsstype bss_type,
 u16 capa_mask, u16 capa_val);

As far as I can tell, the only remaining use for capa_mask/val is the
privacy -- for some reason some drivers like ath6kl don't specify it and
don't care (which is odd) but it'd be nicer to remove capa_mask/val now
and add a privacy enum allowing UNSPEC, ON and OFF or so. That'll make
the callers clearer.

 +static bool cfg80211_bss_type_to_capa(enum ieee80211_bsstype bss_type,
 +   enum ieee80211_band band,
 +   u16 *capa_mask, u16 *capa_val)
 +{
 + bool ret = true;
 +
 + if (bss_type == IEEE80211_BSS_TYPE_ANY)
 + return ret;
 +
 + if (band == IEEE80211_BAND_60GHZ) {
 + *capa_val = ~WLAN_CAPABILITY_DMG_TYPE_MASK;
 + *capa_mask |= WLAN_CAPABILITY_DMG_TYPE_MASK;
 + switch (bss_type) {
 + case IEEE80211_BSS_TYPE_ESS:
 + *capa_val |= WLAN_CAPABILITY_DMG_TYPE_AP;
 + break;
 + case IEEE80211_BSS_TYPE_PBSS:
 + *capa_val |= WLAN_CAPABILITY_DMG_TYPE_PBSS;
 + break;
 + case IEEE80211_BSS_TYPE_IBSS:
 + *capa_val |= WLAN_CAPABILITY_DMG_TYPE_IBSS;
 + break;
 + default:
 + ret = false;
 + break;
 + }
 + } else {
 + *capa_val = ~(WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_IBSS);
 + *capa_mask |= WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_IBSS;
 + switch (bss_type) {
 + case IEEE80211_BSS_TYPE_ESS:
 + *capa_val |= WLAN_CAPABILITY_ESS;
 + break;
 + case IEEE80211_BSS_TYPE_IBSS:
 + *capa_val |= WLAN_CAPABILITY_IBSS;
 + break;
 + case IEEE80211_BSS_TYPE_MBSS:
 + break;
 + default:
 + ret = false;
 + break;
 + }
 + }
 +
 + return ret;
 +}
 +
  /* Returned bss is reference counted and must be cleaned up appropriately. */
  struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
 struct ieee80211_channel *channel,
 const u8 *bssid,
 const u8 *ssid, size_t ssid_len,
 +   enum ieee80211_bsstype bss_type,
 u16 capa_mask, u16 capa_val)
  {
   struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
   struct cfg80211_internal_bss *bss, *res = NULL;
   unsigned long now = jiffies;
  
 - trace_cfg80211_get_bss(wiphy, channel, bssid, ssid, ssid_len, capa_mask,
 -capa_val);
 + trace_cfg80211_get_bss(wiphy, channel, bssid, ssid, ssid_len, bss_type,
 +capa_mask, capa_val);
  
   spin_lock_bh(rdev-bss_lock);
  
   list_for_each_entry(bss, rdev-bss_list, list) {
 + if (!cfg80211_bss_type_to_capa(bss_type,
 +bss-pub.channel-band,
 +capa_val, capa_mask))
 + continue;

This doesn't make any sense - you're also storing the bss_type in the
bss struct, so why translate here to match?

 @@ -896,6 +949,7 @@ cfg80211_inform_bss_width(struct wiphy *wiphy,
   struct cfg80211_bss_ies *ies;
   struct ieee80211_channel *channel;
   struct cfg80211_internal_bss tmp = {}, *res;
 + int bss_type;

enum.

Except that you actually forgot to store the BSS type ...

Actually - you didn't add it to the bss struct, but to wdev? Why is it
needed there?? I don't see you using it?

johannes

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

Re: [PATCH 2/2] ath10k: use IEEE80211_HW_SW_CRYPTO_CONTROL

2015-01-27 Thread Johannes Berg
On Tue, 2015-01-27 at 11:15 +0200, Kalle Valo wrote:
 Johannes Berg johan...@sipsolutions.net writes:
 
  From: Johannes Berg johannes.b...@intel.com
 
  The ath10k driver only supports HW crypto (except for management
  frames or so - CMAC needs to be done in software). Make it use
  the new IEEE80211_HW_SW_CRYPTO_CONTROL flag to ensure mac80211
  doesn't erroneously attempt to use software crypto.
 
  Signed-off-by: Johannes Berg johannes.b...@intel.com
 
 Acked-by: Kalle Valo kv...@qca.qualcomm.com
 
 Feel free to take this via your tree.

Thanks Kalle. I've put it into my tree to unblock Jouni's crypto
patches.

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 1/6] cfg80211: Fix BIP (AES-CMAC) cipher validation

2015-01-27 Thread Johannes Berg
Thanks, all six applied, with the following changes:

Patch 1: use switch() statement
Patch 2: rebase and add to the switch() statement
Patch 4: fold in the ccmp256 - mic_len change
Patch 5: rebase on top of the changed patch 4 (git am didn't work, patch
-p1 did)

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


[RFCv4 1/3] cfg80211: add VHT support for IBSS

2015-01-27 Thread Janusz Dziedzic
Add NL80211_EXT_FEATURE_VHT_IBSS flag and VHT
support for IBSS.

Signed-off-by: Janusz Dziedzic janusz.dzied...@tieto.com
---
 include/uapi/linux/nl80211.h |  2 ++
 net/wireless/nl80211.c   | 14 --
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 735ab43..ed491b2 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -4204,11 +4204,13 @@ enum nl80211_feature_flags {
 
 /**
  * enum nl80211_ext_feature_index - bit index of extended features.
+ * @NL80211_EXT_FEATURE_VHT_IBSS: This driver supports IBSS with VHT datarates.
  *
  * @NUM_NL80211_EXT_FEATURES: number of extended features.
  * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
  */
 enum nl80211_ext_feature_index {
+   NL80211_EXT_FEATURE_VHT_IBSS,
 
/* add new features before the definition below */
NUM_NL80211_EXT_FEATURES,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 39753de..a662cd1 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -7092,8 +7092,18 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct 
genl_info *info)
break;
case NL80211_CHAN_WIDTH_20:
case NL80211_CHAN_WIDTH_40:
-   if (rdev-wiphy.features  NL80211_FEATURE_HT_IBSS)
-   break;
+   if (!(rdev-wiphy.features  NL80211_FEATURE_HT_IBSS))
+   return -EINVAL;
+   break;
+   case NL80211_CHAN_WIDTH_80:
+   case NL80211_CHAN_WIDTH_80P80:
+   case NL80211_CHAN_WIDTH_160:
+   if (!(rdev-wiphy.features  NL80211_FEATURE_HT_IBSS))
+   return -EINVAL;
+   if (!wiphy_ext_feature_isset(rdev-wiphy,
+NL80211_EXT_FEATURE_VHT_IBSS))
+   return -EINVAL;
+   break;
default:
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


[RFCv4 2/3] mac80211: IBSS fix scan request

2015-01-27 Thread Janusz Dziedzic
In case of wide bandwidth scan all channels we have
in chandef, not only control one.

Signed-off-by: Janusz Dziedzic janusz.dzied...@tieto.com
---
 net/mac80211/ibss.c| 80 --
 net/mac80211/ieee80211_i.h |  3 +-
 net/mac80211/scan.c| 25 +--
 3 files changed, 96 insertions(+), 12 deletions(-)

diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index b606b53..14acc21 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -1273,7 +1273,7 @@ static void ieee80211_sta_merge_ibss(struct 
ieee80211_sub_if_data *sdata)
 
scan_width = cfg80211_chandef_to_scan_width(ifibss-chandef);
ieee80211_request_ibss_scan(sdata, ifibss-ssid, ifibss-ssid_len,
-   NULL, scan_width);
+   NULL, 0, scan_width);
 }
 
 static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
@@ -1312,6 +1312,75 @@ static void ieee80211_sta_create_ibss(struct 
ieee80211_sub_if_data *sdata)
  capability, 0, true);
 }
 
+static unsigned ibss_setup_channels(struct wiphy *wiphy,
+   struct ieee80211_channel **channels,
+   unsigned int channels_max,
+   u32 center_freq, u32 width)
+{
+   struct ieee80211_channel *chan = NULL;
+   unsigned int n_chan = 0;
+   u32 start_freq, end_freq, freq;
+
+   if (width = 20) {
+   start_freq = center_freq;
+   end_freq = center_freq;
+   } else {
+   start_freq = center_freq - width/2 + 10;
+   end_freq = center_freq + width/2 - 10;
+   }
+
+   for (freq = start_freq; freq = end_freq; freq += 20) {
+   chan = ieee80211_get_channel(wiphy, freq);
+   if (!chan)
+   continue;
+   if (n_chan = channels_max)
+   return n_chan;
+
+   channels[n_chan] = chan;
+   n_chan++;
+   }
+
+   return n_chan;
+}
+
+static unsigned int
+ieee80211_ibss_setup_scan_channels(struct wiphy *wiphy,
+  const struct cfg80211_chan_def *chandef,
+  struct ieee80211_channel **channels,
+  unsigned int channels_max)
+{
+   unsigned int n_chan = 0;
+   u32 width, cf1, cf2 = 0;
+
+   switch (chandef-width) {
+   case NL80211_CHAN_WIDTH_40:
+   width = 40;
+   break;
+   case NL80211_CHAN_WIDTH_80P80:
+   cf2 = chandef-center_freq2;
+   case NL80211_CHAN_WIDTH_80:
+   width = 80;
+   break;
+   case NL80211_CHAN_WIDTH_160:
+   width = 160;
+   break;
+   default:
+   width = 20;
+   break;
+   }
+
+   cf1 = chandef-center_freq1;
+
+   n_chan = ibss_setup_channels(wiphy, channels, channels_max, cf1, width);
+
+   if (cf2)
+   n_chan += ibss_setup_channels(wiphy, channels[n_chan],
+ channels_max - n_chan, cf2,
+ width);
+
+   return n_chan;
+}
+
 /*
  * This function is called with state == IEEE80211_IBSS_MLME_SEARCH
  */
@@ -1381,11 +1450,18 @@ static void ieee80211_sta_find_ibss(struct 
ieee80211_sub_if_data *sdata)
/* Selected IBSS not found in current scan results - try to scan */
if (time_after(jiffies, ifibss-last_scan_completed +
IEEE80211_SCAN_INTERVAL)) {
+   struct ieee80211_channel *channels[8];
+   unsigned int num = 0;
+
sdata_info(sdata, Trigger new scan to find an IBSS to join\n);
 
+   num = ieee80211_ibss_setup_scan_channels(local-hw.wiphy,
+ifibss-chandef,
+channels,
+ARRAY_SIZE(channels));
scan_width = cfg80211_chandef_to_scan_width(ifibss-chandef);
ieee80211_request_ibss_scan(sdata, ifibss-ssid,
-   ifibss-ssid_len, chan,
+   ifibss-ssid_len, channels, num,
scan_width);
} else {
int interval = IEEE80211_SCAN_INTERVAL;
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index cc6e964..9254546 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1558,7 +1558,8 @@ int ieee80211_mesh_finish_csa(struct 
ieee80211_sub_if_data *sdata);
 void ieee80211_scan_work(struct work_struct *work);
 int ieee80211_request_ibss_scan(struct ieee80211_sub_if_data *sdata,
const u8 *ssid, u8 ssid_len,
- 

Re: [PATCH 2/2] ath10k: use IEEE80211_HW_SW_CRYPTO_CONTROL

2015-01-27 Thread Kalle Valo
Johannes Berg johan...@sipsolutions.net writes:

 From: Johannes Berg johannes.b...@intel.com

 The ath10k driver only supports HW crypto (except for management
 frames or so - CMAC needs to be done in software). Make it use
 the new IEEE80211_HW_SW_CRYPTO_CONTROL flag to ensure mac80211
 doesn't erroneously attempt to use software crypto.

 Signed-off-by: Johannes Berg johannes.b...@intel.com

Acked-by: Kalle Valo kv...@qca.qualcomm.com

Feel free to take this via your tree.

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


Re: [PATCH 4/6] mac80111: Add CCMP-256 cipher

2015-01-27 Thread Johannes Berg
On Sat, 2015-01-24 at 19:52 +0200, Jouni Malinen wrote:

  ieee80211_tx_result
 -ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx);
 +ieee80211_crypto_ccmp_encrypt(struct ieee80211_tx_data *tx, bool ccmp256);
  ieee80211_rx_result
 -ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx);
 +ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx, bool ccmp256);

Perhaps it would make sense to pass the mic_len, which would allow
removing the conditional inside these functions?

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] mac80211: handle potential race between suspend and scan completion

2015-01-27 Thread Johannes Berg
On Sat, 2015-01-24 at 10:30 +0200, Luca Coelho wrote:
 From: Luciano Coelho luciano.coe...@intel.com
 
 If suspend starts while ieee80211_scan_completed() is running, between
 the point where SCAN_COMPLETED is set and the work is queued,
 ieee80211_scan_cancel() will not catch the work and we may finish
 suspending before the work is actually executed, leaving the scan
 running while suspended.
 
 To fix this race, queue the scan work during resume if the
 SCAN_COMPLETED flag is set and flush it immediately.

Applied. I've put it into mac80211-next, we can look later if we should
send it to various stable trees.

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] ath10k: Replace ioread with wmb for data sync

2015-01-27 Thread Bob Copeland
On Mon, Jan 26, 2015 at 02:25:18PM -0800, Peter Oh wrote:
 Using ioread() to perform data sync is excessive.
 Use compact API, wmb(), that intended to be used for the case.
 It reduces total 14 CPU clocks per interrupt.

Hi,

   ath10k_pci_write32(ar, SOC_CORE_BASE_ADDRESS + PCIE_INTR_CLR_ADDRESS,
  PCIE_INTR_FIRMWARE_MASK | PCIE_INTR_CE_MASK_ALL);
  
 - /* IMPORTANT: this extra read transaction is required to
 -  * flush the posted write buffer. */
 - (void)ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS +
 - PCIE_INTR_ENABLE_ADDRESS);
 + /* invoke data sync barrier */
 + wmb();
  }

I am no expert in arcane PCI matters, but that looks suspicious to me.  I seem
to recall wmb() only enforced ordering, and maybe not even memory-IO ordering
on all platforms.  If you want to disable an irq, it really seems like you
would want to flush posted writes so you know the hardware has seen it.

-- 
Bob Copeland %% http://bobcopeland.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: [PATCH 2/2] net wireless wcn36xx adapt wcnss platform to select module by DT

2015-01-27 Thread Eugene Krasnikov
What i mean is that it's not clear who knows what chip is this,
whether wcn36xx or wcn36xx_msm. Previously the assumption was that SMD
command will tell what interface to use. Now we are moving towards
wcn36xx_msm telling what chip is installed. Both approaches will work.
If it less work to do then fine.

Sorry for any confusion.

2015-01-19 9:34 GMT+00:00 Andy Green andy.gr...@linaro.org:
 On 19 January 2015 at 17:02, Eugene Krasnikov k.eugen...@gmail.com wrote:
 The idea is definitely better than just checking for AC support. But
 the question is whether platform/hardware/firmware support that?

 Sorry I don't understand what might be unsupported.

  - We don't ask the firmware, we tell the driver what chip it is from
 the outside.  There's nothing for the firmware to support.

  - Platform supports a set of ops via platform_data already.  This
 just adds one op to get the chip type from the platform code.

  - What can't the hardware support?  The hardware physically is a
 3620, 3660 or 3680.  We just tell the driver what it is when we
 instantiate the device.  We don't ask anything of the hardware.

 I expected to have a debate about whether to move the dt support to
 wcn36xx directly which is also reasonable... there's no question
 adding an op will work or not, it will work for all cases like this.
 But it also implies there must be the device faking business in -msm
 code, one day that will also go upstream and then it might be
 considered a bit strange.

 I did it like this now because it's the minimum change from the
 current situation.

 -Andy

 2015-01-19 9:00 GMT+00:00 Andy Green andy.gr...@linaro.org:
 On 19 January 2015 at 16:49, Eugene Krasnikov k.eugen...@gmail.com wrote:
 Have you tested this code on any device other than wcn3620?

 No... the only hardware I have is 3620.  But the only code we're
 adding to mainline is the patch with the ops to get the chip type.

 The two-patch series just shows one way to set that (which will
 certainly work for all three defined compatible types, if it works for
 one).  And this code cannot go upstream.

 So the only decision to make is around whether adding the platform op
 is a good way (or, eg, directly add DT support to wcn36xx and
 eliminate the 'device regeneration' part of the OOT -msm code).

 At the moment the detect code does not work for 3620, so something
 needs to be done.

 -Andy

 2015-01-19 8:44 GMT+00:00 Andy Green andy.gr...@linaro.org:
 On 19 January 2015 at 16:34, Eugene Krasnikov k.eugen...@gmail.com 
 wrote:

 So how do we insmod wcn36xx_msm with a parameter specifying what type
 of hardware do we use?

 The type of chip is defined in the DT compatible which also delivers
 the resource information.

 qcom,wcn36xx@0a00 {
 compatible = qcom,wcn3620;
 reg = 0x0a00 0x28;
 reg-names = wcnss_mmio;

 interrupts = 0 145 0 0 146 0;
 interrupt-names = wcnss_wlantx_irq, wcnss_wlanrx_irq;
 ...

 This bit based on your code can't go in mainline until there's some
 kind of PIL support.

 So the only things we can discuss about it for mainline purpose is
 whether using a platform ops is a good way to interface to the
 mainline driver.

 If you're OK with that and you want a module parameter then this can
 grow a module parameter and prefer to deliver the chip type from that
 if given, without modifying the platform op interface.

 But with or without a module parameter this can't be upstreamed right
 now due to PIL.

 -Andy

 2015-01-18 5:16 GMT+00:00 Andy Green andy.gr...@linaro.org:
 Simplify the resource handling and use DT to indicate which chip type
 we are dealing with

 Signed-off-by: Andy Green andy.gr...@linaro.org
 ---
  drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c |  101 
 
  1 file changed, 52 insertions(+), 49 deletions(-)

 diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c 
 b/drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c
 index f6f6c83..c9250e0 100644
 --- a/drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c
 +++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx-msm.c
 @@ -42,7 +42,10 @@ struct wcn36xx_msm {
 struct completion   smd_compl;
 smd_channel_t   *smd_ch;
 struct pinctrl *pinctrl;
 -} wmsm;
 +   enum wcn36xx_chip_type chip_type;
 +};
 +
 +static struct wcn36xx_msm wmsm;

  static int wcn36xx_msm_smsm_change_state(u32 clear_mask, u32 set_mask)
  {
 @@ -217,14 +220,47 @@ int wcn36xx_msm_powerup(const struct subsys_desc 
 *desc)
 return 0;
  }

 +static const struct of_device_id wcn36xx_msm_match_table[] = {
 +   { .compatible = qcom,wcn3660, .data = (void 
 *)WCN36XX_CHIP_3660 },
 +   { .compatible = qcom,wcn3680, .data = (void 
 *)WCN36XX_CHIP_3680 },
 +   { .compatible = qcom,wcn3620, .data = (void 
 *)WCN36XX_CHIP_3620 },
 +   { }
 +};
 +
 +static int wcn36xx_msm_get_chip_type(void)
 +{
 +   return wmsm.chip_type;
 +}
 +
 +static 

Re: [PATCH 4/7] net: wireless: wcn36xx: introduce WCN36XX_HAL_AVOID_FREQ_RANGE_IND

2015-01-27 Thread Andy Green
On 28 January 2015 at 04:01, Eugene Krasnikov k.eugen...@gmail.com wrote:
 Do you know when is this message used? sounds important.

It's related to BT coexistance or radar... prima expects this payload with it

#define WLAN_HAL_MAX_AVOID_FREQ_RANGE   4

typedef PACKED_PRE struct PACKED_POST
{
   tANI_U32 startFreq;
   tANI_U32 endFreq;
}  tHalFreqRange, *tpHalFreqRange;

typedef PACKED_PRE struct PACKED_POST
{
   tANI_U32 avoidCnt;
   tHalFreqRangeavoidRange[WLAN_HAL_MAX_AVOID_FREQ_RANGE];

Basically wcn firmware can propose up to 4 frequency ranges to not use
for whatever reason... prima looks like it tries to disable channels
accordingly.

-Andy

 2015-01-18 5:11 GMT+00:00 Andy Green andy.gr...@linaro.org:
 WCN3620 firmware introduces a new async indication, we need to
 add it as a known message type so we can accept it

 Signed-off-by: Andy Green andy.gr...@linaro.org
 ---
  drivers/net/wireless/ath/wcn36xx/hal.h |2 ++
  1 file changed, 2 insertions(+)

 diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h 
 b/drivers/net/wireless/ath/wcn36xx/hal.h
 index a1f1127..b947de0 100644
 --- a/drivers/net/wireless/ath/wcn36xx/hal.h
 +++ b/drivers/net/wireless/ath/wcn36xx/hal.h
 @@ -345,6 +345,8 @@ enum wcn36xx_hal_host_msg_type {
 WCN36XX_HAL_DHCP_START_IND = 189,
 WCN36XX_HAL_DHCP_STOP_IND = 190,

 +   WCN36XX_HAL_AVOID_FREQ_RANGE_IND = 233,
 +
 WCN36XX_HAL_MSG_MAX = WCN36XX_HAL_MSG_TYPE_MAX_ENUM_SIZE
  };





 --
 Best regards,
 Eugene
--
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:Prevent setting wrong key idx for station

2015-01-27 Thread Senthil Balasubramanian
Ath10k driver sets wrong default key idx that results in
sending unicast frames with multicast key.

The reason for this behavior is that cached broadcast key
is installed for station MAC address on association. After
dot1x completes, unicast key is installed for station
MAC address. Default key idx is set to broadcast key id when
driver tries to send broadcast frame. This causes firmware
to use broadcast key id to transmit unicast frames to stations.

Used TX_USAGE flag to set default key for stations.

Added callback for setting unicast default idx which will be
invoked on every default key idx configuration.

Signed-off-by: SenthilKumar Jegadeesan sjega...@qti.qualcomm.com
---
 drivers/net/wireless/ath/ath10k/core.h |   4 +-
 drivers/net/wireless/ath/ath10k/mac.c  | 161 +++--
 2 files changed, 72 insertions(+), 93 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.h 
b/drivers/net/wireless/ath/ath10k/core.h
index c568612..f6b8d35 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -271,10 +271,8 @@ struct ath10k_vif {
u32 aid;
u8 bssid[ETH_ALEN];

-   struct work_struct wep_key_work;
struct ieee80211_key_conf *wep_keys[WMI_MAX_KEY_INDEX + 1];
-   u8 def_wep_key_idx;
-   u8 def_wep_key_newidx;
+   s8 def_wep_key_idx;

u16 tx_seq_no;

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 9524bc5..b115b69 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -37,7 +37,7 @@
 static int ath10k_send_key(struct ath10k_vif *arvif,
   struct ieee80211_key_conf *key,
   enum set_key_cmd cmd,
-  const u8 *macaddr)
+  const u8 *macaddr, bool def_idx)
 {
struct ath10k *ar = arvif-ar;
struct wmi_vdev_install_key_arg arg = {
@@ -75,6 +75,9 @@ static int ath10k_send_key(struct ath10k_vif *arvif,
 * Otherwise pairwise key must be set */
if (memcmp(macaddr, arvif-vif-addr, ETH_ALEN))
arg.key_flags = WMI_KEY_PAIRWISE;
+
+   if (def_idx)
+   arg.key_flags |= WMI_KEY_TX_USAGE;
break;
default:
ath10k_warn(ar, cipher %d is not supported\n, key-cipher);
@@ -92,7 +95,7 @@ static int ath10k_send_key(struct ath10k_vif *arvif,
 static int ath10k_install_key(struct ath10k_vif *arvif,
  struct ieee80211_key_conf *key,
  enum set_key_cmd cmd,
- const u8 *macaddr)
+ const u8 *macaddr, bool def_idx)
 {
struct ath10k *ar = arvif-ar;
int ret;
@@ -101,7 +104,7 @@ static int ath10k_install_key(struct ath10k_vif *arvif,

reinit_completion(ar-install_key_done);

-   ret = ath10k_send_key(arvif, key, cmd, macaddr);
+   ret = ath10k_send_key(arvif, key, cmd, macaddr, def_idx);
if (ret)
return ret;

@@ -119,6 +122,7 @@ static int ath10k_install_peer_wep_keys(struct ath10k_vif 
*arvif,
struct ath10k_peer *peer;
int ret;
int i;
+   bool def_idx;

lockdep_assert_held(ar-conf_mutex);

@@ -132,9 +136,14 @@ static int ath10k_install_peer_wep_keys(struct ath10k_vif 
*arvif,
for (i = 0; i  ARRAY_SIZE(arvif-wep_keys); i++) {
if (arvif-wep_keys[i] == NULL)
continue;
+   /* set TX_USAGE flag for default key id */
+   if (arvif-def_wep_key_idx == i)
+   def_idx = true;
+   else
+   def_idx = false;

ret = ath10k_install_key(arvif, arvif-wep_keys[i], SET_KEY,
-addr);
+addr, def_idx);
if (ret)
return ret;

@@ -168,8 +177,9 @@ static int ath10k_clear_peer_keys(struct ath10k_vif *arvif,
if (peer-keys[i] == NULL)
continue;

+   /* key flags are not required to delete the key */
ret = ath10k_install_key(arvif, peer-keys[i],
-DISABLE_KEY, addr);
+DISABLE_KEY, addr, false);
if (ret  first_errno == 0)
first_errno = ret;

@@ -243,8 +253,8 @@ static int ath10k_clear_vdev_key(struct ath10k_vif *arvif,

if (i == ARRAY_SIZE(peer-keys))
break;
-
-   ret = ath10k_install_key(arvif, key, DISABLE_KEY, addr);
+   /* key flags are not required to delete the key */
+   ret = ath10k_install_key(arvif, key, DISABLE_KEY, addr, false);
if (ret  first_errno == 0)

Re: [PATCH 1/2] ath10k: implement uapsd autotrigger command

2015-01-27 Thread Kalle Valo
Michal Kazior michal.kaz...@tieto.com writes:

 From: Janusz Dziedzic janusz.dzied...@tieto.com

 New wmi-tlv firmware for qca6174 has u-UAPSD
 autotrigger service. If it is enabled firmware
 generates trigger frames automatically as
 configured.

 Signed-off-by: Janusz Dziedzic janusz.dzied...@tieto.com
 Signed-off-by: Michal Kazior michal.kaz...@tieto.com

Thanks, applied to ath.git.

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


Re: [PATCH 1/2] ath10k: remove sw encryption for pmf

2015-01-27 Thread Kalle Valo
Michal Kazior michal.kaz...@tieto.com writes:

 From: Marek Kwaczynski marek.kwaczyn...@tieto.com

 Software encryption was never necessary.
 Tested with fw 636 and fw 10.x.

 Signed-off-by: Marek Kwaczynski marek.kwaczyn...@tieto.com
 Signed-off-by: Michal Kazior michal.kaz...@tieto.com

Thanks, both patches applied to ath.git.

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


Re: [PATCH] ath10k: disable irqs after fw crash

2015-01-27 Thread Kalle Valo
Michal Kazior michal.kaz...@tieto.com writes:

 It makes little sense to keep handling irqs if fw
 is dead.

 This prevents multiple fw register dumps upon
 crash on some devices (seen on QCA6174).

 Signed-off-by: Michal Kazior michal.kaz...@tieto.com

Thanks, applied to ath.git.

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


RE: RTL8192ee

2015-01-27 Thread Jason Plum
Larry,

I know that to some degree I am jumping this chain. That being said, please 
allow me to offer encouragement in the development of the rtl8192ee, rtl872ae, 
and the other members of the rtlwifi_new github.

I have been using these myself, and keeping them in my sights as my commercial 
product that has to support these drivers is being developed. There are some 
hiccups as is to be expected, but your work is greatly appreciated. I strive to 
keep our product as free of vendor proprietary code as much as possible and you 
work with rtlwifi_new and the available integration with multiple revisions of 
the kernel has been a recent key to that effort.

Jason Plum
Sr. Software Engineer
Devon IT

From: linux-wireless-ow...@vger.kernel.org 
[linux-wireless-ow...@vger.kernel.org] On Behalf Of Larry Finger 
[larry.fin...@lwfinger.net]
Sent: Monday, January 26, 2015 9:22 PM
To: burton.b.willi...@gmail.com  Burton Williams
Cc: linux-wireless
Subject: RTL8192ee

Burton,

I inadvertently deleted your E-mail, thus I cannot reply to it.

I am sorry that you have not had access to a driver for your wireless card. The
initial driver was accepted into Linux in May 2014 in staging. It was probably
not available to you because your distro is one of those that does not enable
staging drivers. Perhaps you should consider a different distro.

In addition to that driver, another version of the one in kernel 3.18 was made
available in a GitHub repo that was created in August 2014. That one contains
all the newest versions, and was the source of the changes introduced in kernel
3.18.

I have worked very hard on getting these drivers into the kernel. Comments like
yours make me wonder if it has been worth my effort.

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--
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] ath10k: use idr api for msdu_ids

2015-01-27 Thread Kalle Valo
Michal Kazior michal.kaz...@tieto.com writes:

 HTT Tx protocol uses arbitrary host assigned ids
 too associate with MSDUs when delivering
 completions.

 Instead of rolling out own id generation scheme
 use the tools provided in kernel.

 This should have little to no effect on
 performance.

 Signed-off-by: Michal Kazior michal.kaz...@tieto.com

Thanks, applied to ath.git.

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


Re: [PATCH] ath10k: fix dtim period with beacon templates

2015-01-27 Thread Kalle Valo
Michal Kazior michal.kaz...@tieto.com writes:

 Firmware supporting beacon templates (i.e. wmi-tlv
 for qca6174) doesn't implicitly take dtim period
 from the template. Instead it requires vdev param
 to be set accordingly.

 This fixes dtim period being stuck at 3.

 Signed-off-by: Michal Kazior michal.kaz...@tieto.com

Thanks, applied to ath.git.

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


Re: [PATCH v2 0/2] Add ACPI support for NXP PN544

2015-01-27 Thread Samuel Ortiz
Hi Robert,

On Mon, Jan 26, 2015 at 01:13:35PM +0200, Robert Dolca wrote:
 This patch set introduces ACPI support for PN544.
 
 gpio_set_value was replaced with gpio_set_value_cansleep in order
 to allow GPIO access that may sleep. This is particularelly useful
 when GPIO is accessed using busses like I2C, SPI, USB
 
 Changes since v1:
   - Added cover letter
   - Removed debug define and Kconfig include
   - Minor fixes to patch subjects
 
 Links to v1:
   - http://lkml.iu.edu/hypermail/linux/kernel/1501.1/00943.html
   - http://lkml.iu.edu/hypermail/linux/kernel/1501.1/00944.html
 
 Robert Dolca (2):
   NFC: PN544: GPIO access that may sleep
   NFC: Add ACPI support for NXP PN544
Both patches applied, many thanks.

Cheers,
Samuel.
--
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] ath10k: Replace ioread with wmb for data sync

2015-01-27 Thread Peter Oh


On 01/27/2015 01:33 PM, Bob Copeland wrote:

On Mon, Jan 26, 2015 at 02:25:18PM -0800, Peter Oh wrote:

Using ioread() to perform data sync is excessive.
Use compact API, wmb(), that intended to be used for the case.
It reduces total 14 CPU clocks per interrupt.

Hi,


ath10k_pci_write32(ar, SOC_CORE_BASE_ADDRESS + PCIE_INTR_CLR_ADDRESS,
   PCIE_INTR_FIRMWARE_MASK | PCIE_INTR_CE_MASK_ALL);
  
-	/* IMPORTANT: this extra read transaction is required to

-* flush the posted write buffer. */
-   (void)ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS +
-   PCIE_INTR_ENABLE_ADDRESS);
+   /* invoke data sync barrier */
+   wmb();
  }

I am no expert in arcane PCI matters, but that looks suspicious to me.  I seem
to recall wmb() only enforced ordering, and maybe not even memory-IO ordering
on all platforms.  If you want to disable an irq, it really seems like you
would want to flush posted writes so you know the hardware has seen it.
enforced ordering is happened by flush write buffer and wmb is commonly 
used to flush write buffer.
so that wmb guarantees ordering by flush write buffer. That's why it's 
called a memory barrier.
when wmb is used, it guarantees all memory accesses complete before wmb 
command completes.
for instance dsb is the corresponding command for wmb in arm and arm 
instruction guide says
The DSB instruction completes when all explicit memory accesses before 
it complete.
Which means DSB instruction will hold the bus (usually AXI bus) and 
never returns until any memory or memory mapped I/O access complete
(dsb is for ARM and other platforms have the equivalent instruction such 
as sfence, sync, mf, and dcs).

Thanks,
Peter
--
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 2/2] NFC: Add ACPI support for NXP PN544

2015-01-27 Thread Samuel Ortiz
Hi Robert,

On Mon, Jan 26, 2015 at 01:13:37PM +0200, Robert Dolca wrote:
 @@ -1022,9 +1127,12 @@ static int pn544_hci_i2c_probe(struct i2c_client 
 *client,
   PN544_I2C_FRAME_HEADROOM, PN544_I2C_FRAME_TAILROOM,
   PN544_HCI_I2C_LLC_MAX_PAYLOAD,
   pn544_hci_i2c_fw_download, phy-hdev);
 - if (r  0)
 + if (r  0) {
 + nfc_err(client-dev, HCI Probing error\n);
   goto err_hci;
 + }
  
 + nfc_info(client-dev, NFC I2C driver loaded\n);
   return 0;
This is unrelated to this patch, so I removed that part.

Cheers,
Samuel.
--
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-01-27 Thread Dedy Lansky
From: Johannes Berg [mailto:johan...@sipsolutions.net] 
Sent: Tuesday, January 27, 2015 10:24 AM

 On Tue, 2015-01-27 at 09:55 +0200, Dedy Lansky wrote:
 
  --- a/include/linux/ieee80211.h
  +++ b/include/linux/ieee80211.h
  @@ -1602,6 +1602,15 @@ enum {
  IEEE80211_BANDID_60G   = 5, /* 60 GHz */
   };
   
  +/* BSS Type, 802.11ad #6.3.3.2 */
  +enum ieee80211_bsstype {
  +   IEEE80211_BSS_TYPE_ESS,
  +   IEEE80211_BSS_TYPE_PBSS,
  +   IEEE80211_BSS_TYPE_IBSS,
  +   IEEE80211_BSS_TYPE_MBSS,
  +   IEEE80211_BSS_TYPE_ANY
  +};
 
 Technically the standard defines this, but not as over the air bits as 
 everything else in this file. I think this should therefore be moved into 
 cfg80211.h as a local enum, we don't use the exact definitions from clause 6 
 anywhere anyway.

OK. Will take care of that.

 
  @@ -4007,6 +4009,7 @@ struct cfg80211_bss *cfg80211_get_bss(struct wiphy 
  *wiphy,
struct ieee80211_channel *channel,
const u8 *bssid,
const u8 *ssid, size_t ssid_len,
  + enum ieee80211_bsstype bss_type,
u16 capa_mask, u16 capa_val);
 
 As far as I can tell, the only remaining use for capa_mask/val is the privacy 
 -- for some reason some drivers like ath6kl don't specify it and don't care 
 (which is odd) but it'd be nicer to remove capa_mask/val now and add a 
 privacy enum allowing UNSPEC, ON and OFF or so. That'll make the callers 
 clearer.

Sure. I guess this enum should go into cfg80211.h as well.

 
   
  list_for_each_entry(bss, rdev-bss_list, list) {
  +   if (!cfg80211_bss_type_to_capa(bss_type,
  +  bss-pub.channel-band,
  +  capa_val, capa_mask))
  +   continue;
 
 This doesn't make any sense - you're also storing the bss_type in the bss 
 struct, so why translate here to match?

See below.

 
  @@ -896,6 +949,7 @@ cfg80211_inform_bss_width(struct wiphy *wiphy,
  struct cfg80211_bss_ies *ies;
  struct ieee80211_channel *channel;
  struct cfg80211_internal_bss tmp = {}, *res;
  +   int bss_type;
 
 enum.
 
 Except that you actually forgot to store the BSS type ...
 
 Actually - you didn't add it to the bss struct, but to wdev? Why is it needed 
 there?? I don't see you using it?

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.

 
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: PBSS basic support

2015-01-27 Thread Johannes Berg
On Tue, 2015-01-27 at 12:50 +0200, Dedy Lansky wrote:

   @@ -896,6 +949,7 @@ cfg80211_inform_bss_width(struct wiphy *wiphy,
 struct cfg80211_bss_ies *ies;
 struct ieee80211_channel *channel;
 struct cfg80211_internal_bss tmp = {}, *res;
   + int bss_type;
  
  enum.
  
  Except that you actually forgot to store the BSS type ...
  
  Actually - you didn't add it to the bss struct, but to wdev? Why is it 
  needed there?? I don't see you using it?
 
 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?

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: [RFCv4 3/3] mac80211: add VHT support for IBSS

2015-01-27 Thread Johannes Berg
On Tue, 2015-01-27 at 09:44 +0100, Janusz Dziedzic wrote:

 +u8 *ieee80211_ie_build_vht_oper(u8 *pos, struct ieee80211_sta_vht_cap 
 *vht_cap,
 + const struct cfg80211_chan_def *chandef)

 + /* 1 stream, MCS0-7 as a min Basic VHT MCS rates */
 + vht_oper-basic_mcs_set = cpu_to_le16(0xfffc);

Unless I'm mistaken in my reading of the spec, this will make any
well-behaved client (i.e. not mac80211) not join this network since it
supports VHT MCSes.

We seem to do the same for HT:

/* It seems that Basic MCS set and Supported MCS set
   are identical for the first 10 bytes */
memset(ht_oper-basic_set, 0, 16);
memcpy(ht_oper-basic_set, ht_cap-mcs, 10);

but I'm not convinced it's right. It probably only works because nobody
ever tested against a well-behaved non-HT client? Or perhaps there isn't
even one?

I for one am not really comfortable with this restriction - there's very
little point in making such a restriction in IBSS since if you have it
then the other node will just form its own network on the same channel
and you've won nothing - only lost interoperability.

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: [RFCv4 3/3] mac80211: add VHT support for IBSS

2015-01-27 Thread Janusz Dziedzic
On 27 January 2015 at 11:24, Johannes Berg johan...@sipsolutions.net wrote:
 On Tue, 2015-01-27 at 09:44 +0100, Janusz Dziedzic wrote:

 +u8 *ieee80211_ie_build_vht_oper(u8 *pos, struct ieee80211_sta_vht_cap 
 *vht_cap,
 + const struct cfg80211_chan_def *chandef)

 + /* 1 stream, MCS0-7 as a min Basic VHT MCS rates */
 + vht_oper-basic_mcs_set = cpu_to_le16(0xfffc);

 Unless I'm mistaken in my reading of the spec, this will make any
 well-behaved client (i.e. not mac80211) not join this network since it
 supports VHT MCSes.

 We seem to do the same for HT:

 /* It seems that Basic MCS set and Supported MCS set
are identical for the first 10 bytes */
 memset(ht_oper-basic_set, 0, 16);
 memcpy(ht_oper-basic_set, ht_cap-mcs, 10);

 but I'm not convinced it's right. It probably only works because nobody
 ever tested against a well-behaved non-HT client? Or perhaps there isn't
 even one?

for HT (spec, 20.3.5) - MCS0 .. MSC7 are mandatory - but this is for
all stations (not sure about ibss)
for VHT (22.5, table 22-30) - MCS0...MCS7 are mandatory for nss=1 (20,40,80)
Seems such set is secure?

If I understand correctly case you describe with non-HT client:
non-HT client should not understand HT ies, and HT-only client should
not understand VHT ies?

 I for one am not really comfortable with this restriction - there's very
 little point in making such a restriction in IBSS since if you have it
 then the other node will just form its own network on the same channel
 and you've won nothing - only lost interoperability.

 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 v2 1/8] mwifiex: remove redundant nick_name variable

2015-01-27 Thread Avinash Patil
This is not used anywhere execpt initialization.

Signed-off-by: Avinash Patil pat...@marvell.com
Signed-off-by: Amitkumar Karwar akar...@marvell.com
Signed-off-by: Cathy Luo c...@marvell.com
---
 drivers/net/wireless/mwifiex/main.c | 1 -
 drivers/net/wireless/mwifiex/main.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/main.c 
b/drivers/net/wireless/mwifiex/main.c
index 9836df0..99cd360 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -968,7 +968,6 @@ void mwifiex_init_priv_params(struct mwifiex_private *priv,
/* Initialize private structure */
priv-current_key_index = 0;
priv-media_connected = false;
-   memset(priv-nick_name, 0, sizeof(priv-nick_name));
memset(priv-mgmt_ie, 0,
   sizeof(struct mwifiex_ie) * MAX_MGMT_IE_INDEX);
priv-beacon_idx = MWIFIEX_AUTO_IDX_MASK;
diff --git a/drivers/net/wireless/mwifiex/main.h 
b/drivers/net/wireless/mwifiex/main.h
index 55273ee..99792b8 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -553,7 +553,6 @@ struct mwifiex_private {
 #ifdef CONFIG_DEBUG_FS
struct dentry *dfs_dev_dir;
 #endif
-   u8 nick_name[16];
u16 current_key_index;
struct semaphore async_sem;
struct cfg80211_scan_request *scan_request;
-- 
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 v2 0/8] mwifiex change virtual interface enhancements

2015-01-27 Thread Avinash Patil
This patch series is enhancement for change virtual interface
handling in mwifiex. With this series in, now we remove coupling
between netdev and FW supported interface combination. Now conversion
from any type of supported interface types to any other type is possible.

Avinash Patil (8):
  mwifiex: remove redundant nick_name variable
  mwifiex: set wiphy params only once
  mwifiex: do not declare wdev as pointer
  mwifiex: store permanant mac address in adapter structure
  mwifiex: add init parameter to init command routine
  mwifiex: manage virtual interface limits efficiently
  mwifiex: handle PS events on AP interface as well
  mwifiex: support conversion to any virtual interface type

 drivers/net/wireless/mwifiex/11h.c   |   2 +-
 drivers/net/wireless/mwifiex/11n.c   |   4 +-
 drivers/net/wireless/mwifiex/11n_rxreorder.c |   2 +-
 drivers/net/wireless/mwifiex/cfg80211.c  | 584 ---
 drivers/net/wireless/mwifiex/cfp.c   |   4 +-
 drivers/net/wireless/mwifiex/cmdevt.c|  40 +-
 drivers/net/wireless/mwifiex/decl.h  |  10 +
 drivers/net/wireless/mwifiex/init.c  |   7 +-
 drivers/net/wireless/mwifiex/main.c  |   9 +-
 drivers/net/wireless/mwifiex/main.h  |  29 +-
 drivers/net/wireless/mwifiex/scan.c  |  10 +-
 drivers/net/wireless/mwifiex/sta_cmd.c   |  13 +-
 drivers/net/wireless/mwifiex/sta_event.c |   2 +-
 drivers/net/wireless/mwifiex/sta_ioctl.c |  32 +-
 drivers/net/wireless/mwifiex/txrx.c  |   2 +-
 drivers/net/wireless/mwifiex/uap_event.c |  39 ++
 drivers/net/wireless/mwifiex/util.c  |   2 +-
 17 files changed, 559 insertions(+), 232 deletions(-)

-- 
1.8.1.4

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


[PATCH v2 2/8] mwifiex: set wiphy params only once

2015-01-27 Thread Avinash Patil
RTS threshold, fragmentation threshold are per device properties.
Setting them on any interface would be reflected for all other
interfaces as well. This patch removes unnesessary command download
per interface.

Signed-off-by: Avinash Patil pat...@marvell.com
Signed-off-by: Amitkumar Karwar akar...@marvell.com
Signed-off-by: Cathy Luo c...@marvell.com
---
 drivers/net/wireless/mwifiex/cfg80211.c | 111 ++--
 1 file changed, 48 insertions(+), 63 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/cfg80211.c 
b/drivers/net/wireless/mwifiex/cfg80211.c
index 7be1e9b..dd0e410 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -590,77 +590,62 @@ mwifiex_cfg80211_set_wiphy_params(struct wiphy *wiphy, 
u32 changed)
struct mwifiex_adapter *adapter = mwifiex_cfg80211_get_adapter(wiphy);
struct mwifiex_private *priv;
struct mwifiex_uap_bss_param *bss_cfg;
-   int ret, bss_started, i;
-
-   for (i = 0; i  adapter-priv_num; i++) {
-   priv = adapter-priv[i];
-
-   switch (priv-bss_role) {
-   case MWIFIEX_BSS_ROLE_UAP:
-   bss_cfg = kzalloc(sizeof(struct mwifiex_uap_bss_param),
- GFP_KERNEL);
-   if (!bss_cfg)
-   return -ENOMEM;
-
-   mwifiex_set_sys_config_invalid_data(bss_cfg);
-
-   if (changed  WIPHY_PARAM_RTS_THRESHOLD)
-   bss_cfg-rts_threshold = wiphy-rts_threshold;
-   if (changed  WIPHY_PARAM_FRAG_THRESHOLD)
-   bss_cfg-frag_threshold = wiphy-frag_threshold;
-   if (changed  WIPHY_PARAM_RETRY_LONG)
-   bss_cfg-retry_limit = wiphy-retry_long;
-
-   bss_started = priv-bss_started;
-
-   ret = mwifiex_send_cmd(priv, HostCmd_CMD_UAP_BSS_STOP,
-  HostCmd_ACT_GEN_SET, 0,
-  NULL, true);
-   if (ret) {
-   wiphy_err(wiphy, Failed to stop the BSS\n);
-   kfree(bss_cfg);
-   return ret;
-   }
+   int ret;
 
-   ret = mwifiex_send_cmd(priv, HostCmd_CMD_UAP_SYS_CONFIG,
-  HostCmd_ACT_GEN_SET,
-  UAP_BSS_PARAMS_I, bss_cfg,
-  false);
+   priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
 
-   kfree(bss_cfg);
+   switch (priv-bss_role) {
+   case MWIFIEX_BSS_ROLE_UAP:
+   if (priv-bss_started) {
+   dev_err(adapter-dev,
+   cannot change wiphy params when bss started);
+   return -EINVAL;
+   }
 
-   if (ret) {
-   wiphy_err(wiphy, Failed to set bss config\n);
-   return ret;
-   }
+   bss_cfg = kzalloc(sizeof(*bss_cfg), GFP_KERNEL);
+   if (!bss_cfg)
+   return -ENOMEM;
 
-   if (!bss_started)
-   break;
+   mwifiex_set_sys_config_invalid_data(bss_cfg);
 
-   ret = mwifiex_send_cmd(priv, HostCmd_CMD_UAP_BSS_START,
-  HostCmd_ACT_GEN_SET, 0,
-  NULL, false);
-   if (ret) {
-   wiphy_err(wiphy, Failed to start BSS\n);
-   return ret;
-   }
+   if (changed  WIPHY_PARAM_RTS_THRESHOLD)
+   bss_cfg-rts_threshold = wiphy-rts_threshold;
+   if (changed  WIPHY_PARAM_FRAG_THRESHOLD)
+   bss_cfg-frag_threshold = wiphy-frag_threshold;
+   if (changed  WIPHY_PARAM_RETRY_LONG)
+   bss_cfg-retry_limit = wiphy-retry_long;
+
+   ret = mwifiex_send_cmd(priv, HostCmd_CMD_UAP_SYS_CONFIG,
+  HostCmd_ACT_GEN_SET,
+  UAP_BSS_PARAMS_I, bss_cfg,
+  false);
+
+   kfree(bss_cfg);
+   if (ret) {
+   wiphy_err(wiphy, Failed to set wiphy phy params\n);
+   return ret;
+   }
+   break;
 
-   break;
case MWIFIEX_BSS_ROLE_STA:
-   if (changed  WIPHY_PARAM_RTS_THRESHOLD) {
-   ret = mwifiex_set_rts(priv,
-  

[PATCH v2 8/8] mwifiex: support conversion to any virtual interface type

2015-01-27 Thread Avinash Patil
Currently, we support virtual interface type change from
station=adhoc or station = p2p client/GO.
This patch adds support to change virtual interface type to
any of the type advertised in interface combinations.

Signed-off-by: Avinash Patil pat...@marvell.com
Signed-off-by: Amitkumar Karwar akar...@marvell.com
Signed-off-by: Cathy Luo c...@marvell.com
---
 drivers/net/wireless/mwifiex/cfg80211.c  | 331 ---
 drivers/net/wireless/mwifiex/main.c  |   2 +-
 drivers/net/wireless/mwifiex/main.h  |   2 -
 drivers/net/wireless/mwifiex/sta_ioctl.c |  30 ---
 4 files changed, 301 insertions(+), 64 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/cfg80211.c 
b/drivers/net/wireless/mwifiex/cfg80211.c
index a0221b5..30ea94a 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -656,9 +656,6 @@ mwifiex_cfg80211_deinit_p2p(struct mwifiex_private *priv)
 {
u16 mode = P2P_MODE_DISABLE;
 
-   if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_STA)
-   mwifiex_set_bss_role(priv, MWIFIEX_BSS_ROLE_STA);
-
if (mwifiex_send_cmd(priv, HostCmd_CMD_P2P_MODE_CFG,
 HostCmd_ACT_GEN_SET, 0, mode, true))
return -1;
@@ -715,12 +712,249 @@ mwifiex_cfg80211_init_p2p_go(struct mwifiex_private 
*priv)
 HostCmd_ACT_GEN_SET, 0, mode, true))
return -1;
 
-   if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_UAP)
-   mwifiex_set_bss_role(priv, MWIFIEX_BSS_ROLE_UAP);
+   return 0;
+}
+
+static int mwifiex_deinit_priv_params(struct mwifiex_private *priv)
+{
+   priv-mgmt_frame_mask = 0;
+   if (mwifiex_send_cmd(priv, HostCmd_CMD_MGMT_FRAME_REG,
+HostCmd_ACT_GEN_SET, 0,
+priv-mgmt_frame_mask, false)) {
+   dev_warn(priv-adapter-dev,
+could not unregister mgmt frame rx\n);
+   return -1;
+   }
+
+   mwifiex_deauthenticate(priv, NULL);
+   mwifiex_free_priv(priv);
+   priv-wdev.iftype = NL80211_IFTYPE_UNSPECIFIED;
+   priv-bss_mode = NL80211_IFTYPE_UNSPECIFIED;
+   priv-sec_info.authentication_mode = NL80211_AUTHTYPE_OPEN_SYSTEM;
+
+   return 0;
+}
+
+static int
+mwifiex_init_new_priv_params(struct mwifiex_private *priv,
+struct net_device *dev,
+enum nl80211_iftype type)
+{
+   mwifiex_init_priv(priv);
+
+   priv-bss_mode = type;
+   priv-wdev.iftype = type;
+
+   mwifiex_init_priv_params(priv, priv-netdev);
+   priv-bss_started = 0;
+
+   switch (type) {
+   case NL80211_IFTYPE_STATION:
+   case NL80211_IFTYPE_ADHOC:
+   priv-bss_role =  MWIFIEX_BSS_ROLE_STA;
+   priv-bss_type = MWIFIEX_BSS_TYPE_STA;
+   break;
+   case NL80211_IFTYPE_P2P_CLIENT:
+   case NL80211_IFTYPE_P2P_GO:
+   priv-bss_role =  MWIFIEX_BSS_ROLE_STA;
+   priv-bss_type = MWIFIEX_BSS_TYPE_P2P;
+   break;
+   case NL80211_IFTYPE_AP:
+   priv-bss_type = MWIFIEX_BSS_TYPE_UAP;
+   priv-bss_role = MWIFIEX_BSS_ROLE_UAP;
+   break;
+   default:
+   dev_err(priv-adapter-dev,
+   %s: changing to %d not supported\n,
+   dev-name, type);
+   return -EOPNOTSUPP;
+   }
+
+   return 0;
+}
+
+static int
+mwifiex_change_vif_to_p2p(struct net_device *dev,
+ enum nl80211_iftype curr_iftype,
+ enum nl80211_iftype type, u32 *flags,
+ struct vif_params *params)
+{
+   struct mwifiex_private *priv;
+   struct mwifiex_adapter *adapter;
+
+   priv = mwifiex_netdev_get_priv(dev);
+
+   if (!priv)
+   return -1;
+
+   adapter = priv-adapter;
+
+   if (adapter-curr_iface_comb.p2p_intf ==
+   adapter-iface_limit.p2p_intf) {
+   dev_err(adapter-dev,
+   cannot create multiple P2P ifaces\n);
+   return -1;
+   }
+
+   dev_dbg(priv-adapter-dev, %s: changing role to p2p\n, dev-name);
+
+   if (mwifiex_deinit_priv_params(priv))
+   return -1;
+   if (mwifiex_init_new_priv_params(priv, dev, type))
+   return -1;
+
+   switch (type) {
+   case NL80211_IFTYPE_P2P_CLIENT:
+   if (mwifiex_cfg80211_init_p2p_client(priv))
+   return -EFAULT;
+   break;
+   case NL80211_IFTYPE_P2P_GO:
+   if (mwifiex_cfg80211_init_p2p_go(priv))
+   return -EFAULT;
+   break;
+   default:
+   dev_err(priv-adapter-dev,
+   %s: changing to %d not supported\n,
+   dev-name, type);
+   return -EOPNOTSUPP;
+   }
+
+   if (mwifiex_send_cmd(priv, 

[PATCH v2 7/8] mwifiex: handle PS events on AP interface as well

2015-01-27 Thread Avinash Patil
This patch adds support to handle PS events on AP interface as well.

Signed-off-by: Avinash Patil pat...@marvell.com
Signed-off-by: Amitkumar Karwar akar...@marvell.com
Signed-off-by: Cathy Luo c...@marvell.com
---
 drivers/net/wireless/mwifiex/cmdevt.c| 36 -
 drivers/net/wireless/mwifiex/uap_event.c | 39 
 2 files changed, 53 insertions(+), 22 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/cmdevt.c 
b/drivers/net/wireless/mwifiex/cmdevt.c
index 00586b2..c5a14ff 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -315,22 +315,19 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct 
mwifiex_adapter *adapter)
adapter-dbg.num_cmd_sleep_cfm_host_to_card_failure++;
return -1;
}
-   if (GET_BSS_ROLE(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY))
-   == MWIFIEX_BSS_ROLE_STA) {
-   if (!le16_to_cpu(sleep_cfm_buf-resp_ctrl))
-   /* Response is not needed for sleep
-  confirm command */
-   adapter-ps_state = PS_STATE_SLEEP;
-   else
-   adapter-ps_state = PS_STATE_SLEEP_CFM;
-
-   if (!le16_to_cpu(sleep_cfm_buf-resp_ctrl) 
-   (adapter-is_hs_configured 
-!adapter-sleep_period.period)) {
-   adapter-pm_wakeup_card_req = true;
-   mwifiex_hs_activated_event(mwifiex_get_priv
-   (adapter, MWIFIEX_BSS_ROLE_STA), true);
-   }
+
+   if (!le16_to_cpu(sleep_cfm_buf-resp_ctrl))
+   /* Response is not needed for sleep confirm command */
+   adapter-ps_state = PS_STATE_SLEEP;
+   else
+   adapter-ps_state = PS_STATE_SLEEP_CFM;
+
+   if (!le16_to_cpu(sleep_cfm_buf-resp_ctrl) 
+   (adapter-is_hs_configured 
+!adapter-sleep_period.period)) {
+   adapter-pm_wakeup_card_req = true;
+   mwifiex_hs_activated_event(mwifiex_get_priv
+   (adapter, MWIFIEX_BSS_ROLE_ANY), true);
}
 
return ret;
@@ -450,6 +447,7 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter)
  EVENT_GET_BSS_TYPE(eventcause));
if (!priv)
priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
+
/* Clear BSS_NO_BITS from event */
eventcause = EVENT_ID_MASK;
adapter-event_cause = eventcause;
@@ -462,12 +460,6 @@ int mwifiex_process_event(struct mwifiex_adapter *adapter)
}
 
dev_dbg(adapter-dev, EVENT: cause: %#x\n, eventcause);
-   if (eventcause == EVENT_PS_SLEEP || eventcause == EVENT_PS_AWAKE) {
-   /* Handle PS_SLEEP/AWAKE events on STA */
-   priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA);
-   if (!priv)
-   priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_ANY);
-   }
 
if (priv-bss_role == MWIFIEX_BSS_ROLE_UAP)
ret = mwifiex_process_uap_event(priv);
diff --git a/drivers/net/wireless/mwifiex/uap_event.c 
b/drivers/net/wireless/mwifiex/uap_event.c
index 96ff397..9b4ca6f 100644
--- a/drivers/net/wireless/mwifiex/uap_event.c
+++ b/drivers/net/wireless/mwifiex/uap_event.c
@@ -178,6 +178,45 @@ int mwifiex_process_uap_event(struct mwifiex_private *priv)
dev_dbg(adapter-dev, event: TX_STATUS Report\n);
mwifiex_parse_tx_status_event(priv, adapter-event_body);
break;
+   case EVENT_PS_SLEEP:
+   dev_dbg(adapter-dev, info: EVENT: SLEEP\n);
+
+   adapter-ps_state = PS_STATE_PRE_SLEEP;
+
+   mwifiex_check_ps_cond(adapter);
+   break;
+
+   case EVENT_PS_AWAKE:
+   dev_dbg(adapter-dev, info: EVENT: AWAKE\n);
+   if (!adapter-pps_uapsd_mode 
+   priv-media_connected  adapter-sleep_period.period) {
+   adapter-pps_uapsd_mode = true;
+   dev_dbg(adapter-dev,
+   event: PPS/UAPSD mode activated\n);
+   }
+   adapter-tx_lock_flag = false;
+   if (adapter-pps_uapsd_mode  adapter-gen_null_pkt) {
+   if (mwifiex_check_last_packet_indication(priv)) {
+   if (adapter-data_sent) {
+   adapter-ps_state = PS_STATE_AWAKE;
+   adapter-pm_wakeup_card_req = false;
+   adapter-pm_wakeup_fw_try = false;
+   break;
+   }
+   if (!mwifiex_send_null_packet
+   (priv,
+

[PATCH v2 5/8] mwifiex: add init parameter to init command routine

2015-01-27 Thread Avinash Patil
FW initialization routine can also be called while changing
virtual interface types.
This patch adds bool parameter init to init command routine
so as to differentiate between initialization during driver load
and change virtual interface handler.

Signed-off-by: Avinash Patil pat...@marvell.com
Signed-off-by: Amitkumar Karwar akar...@marvell.com
Signed-off-by: Cathy Luo c...@marvell.com
---
 drivers/net/wireless/mwifiex/init.c  |  3 ++-
 drivers/net/wireless/mwifiex/main.h  |  2 +-
 drivers/net/wireless/mwifiex/sta_cmd.c   | 13 -
 drivers/net/wireless/mwifiex/sta_ioctl.c |  2 +-
 4 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/init.c 
b/drivers/net/wireless/mwifiex/init.c
index 44babc3..2975b51 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -552,7 +552,8 @@ int mwifiex_init_fw(struct mwifiex_adapter *adapter)
 
for (i = 0; i  adapter-priv_num; i++) {
if (adapter-priv[i]) {
-   ret = mwifiex_sta_init_cmd(adapter-priv[i], first_sta);
+   ret = mwifiex_sta_init_cmd(adapter-priv[i], first_sta,
+  true);
if (ret == -1)
return -1;
 
diff --git a/drivers/net/wireless/mwifiex/main.h 
b/drivers/net/wireless/mwifiex/main.h
index 45b40af..9686bd8 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -989,7 +989,7 @@ void mwifiex_wmm_del_peer_ra_list(struct mwifiex_private 
*priv,
  const u8 *ra_addr);
 void *mwifiex_process_sta_txpd(struct mwifiex_private *, struct sk_buff *skb);
 void *mwifiex_process_uap_txpd(struct mwifiex_private *, struct sk_buff *skb);
-int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta);
+int mwifiex_sta_init_cmd(struct mwifiex_private *, u8 first_sta, bool init);
 int mwifiex_cmd_802_11_scan(struct host_cmd_ds_command *cmd,
struct mwifiex_scan_cmd_config *scan_cfg);
 void mwifiex_queue_scan_cmd(struct mwifiex_private *priv,
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c 
b/drivers/net/wireless/mwifiex/sta_cmd.c
index f7b920d..92a66e8 100644
--- a/drivers/net/wireless/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/mwifiex/sta_cmd.c
@@ -1911,6 +1911,8 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, 
uint16_t cmd_no,
  *
  * This is called after firmware download to bring the card to
  * working state.
+ * Function is also called during reinitialization of virtual
+ * interfaces.
  *
  * The following commands are issued sequentially -
  *  - Set PCI-Express host buffer configuration (PCIE only)
@@ -1925,7 +1927,7 @@ int mwifiex_sta_prepare_cmd(struct mwifiex_private *priv, 
uint16_t cmd_no,
  *  - Set 11d control
  *  - Set MAC control (this must be the last command to initialize 
firmware)
  */
-int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta)
+int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 first_sta, bool init)
 {
struct mwifiex_adapter *adapter = priv-adapter;
int ret;
@@ -2059,9 +2061,6 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, u8 
first_sta)
11D: failed to enable 11D\n);
}
 
-   /* set last_init_cmd before sending the command */
-   priv-adapter-last_init_cmd = HostCmd_CMD_11N_CFG;
-
/* Send cmd to FW to configure 11n specific configuration
 * (Short GI, Channel BW, Green field support etc.) for transmit
 */
@@ -2069,7 +2068,11 @@ int mwifiex_sta_init_cmd(struct mwifiex_private *priv, 
u8 first_sta)
ret = mwifiex_send_cmd(priv, HostCmd_CMD_11N_CFG,
   HostCmd_ACT_GEN_SET, 0, tx_cfg, true);
 
-   ret = -EINPROGRESS;
+   if (init) {
+   /* set last_init_cmd before sending the command */
+   priv-adapter-last_init_cmd = HostCmd_CMD_11N_CFG;
+   ret = -EINPROGRESS;
+   }
 
return ret;
 }
diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c 
b/drivers/net/wireless/mwifiex/sta_ioctl.c
index 329cd51..2faa517 100644
--- a/drivers/net/wireless/mwifiex/sta_ioctl.c
+++ b/drivers/net/wireless/mwifiex/sta_ioctl.c
@@ -1162,7 +1162,7 @@ mwifiex_set_bss_role(struct mwifiex_private *priv, u8 
bss_role)
mwifiex_send_cmd(priv, HostCmd_CMD_SET_BSS_MODE,
 HostCmd_ACT_GEN_SET, 0, NULL, true);
 
-   return mwifiex_sta_init_cmd(priv, false);
+   return mwifiex_sta_init_cmd(priv, false, false);
 }
 
 /*
-- 
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 v2 6/8] mwifiex: manage virtual interface limits efficiently

2015-01-27 Thread Avinash Patil
Currently interface limits are checked by seeing if bss_mode for
particular priv is set. If bss_mode is not set, interface creation
is allowed. This patch adds framework to initializes maximum virtual
interfaces supported during load time and check current number of
interfaces created agains allowed interface limit during new virtual
interface creation.

Signed-off-by: Avinash Patil pat...@marvell.com
Signed-off-by: Amitkumar Karwar akar...@marvell.com
Signed-off-by: Cathy Luo c...@marvell.com
---
 drivers/net/wireless/mwifiex/cfg80211.c | 80 -
 drivers/net/wireless/mwifiex/decl.h | 10 +
 drivers/net/wireless/mwifiex/init.c |  3 ++
 drivers/net/wireless/mwifiex/main.h | 21 +
 4 files changed, 102 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/cfg80211.c 
b/drivers/net/wireless/mwifiex/cfg80211.c
index 85f5019..a0221b5 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -2185,13 +2185,20 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct 
wiphy *wiphy,
case NL80211_IFTYPE_UNSPECIFIED:
case NL80211_IFTYPE_STATION:
case NL80211_IFTYPE_ADHOC:
-   priv = adapter-priv[MWIFIEX_BSS_TYPE_STA];
-   if (priv-bss_mode) {
+   if (adapter-curr_iface_comb.sta_intf ==
+   adapter-iface_limit.sta_intf) {
wiphy_err(wiphy,
  cannot create multiple sta/adhoc ifaces\n);
return ERR_PTR(-EINVAL);
}
 
+   priv = mwifiex_get_unused_priv(adapter);
+   if (!priv) {
+   wiphy_err(wiphy,
+ could not get free private struct\n);
+   return ERR_PTR(-EFAULT);
+   }
+
priv-wdev.wiphy = wiphy;
priv-wdev.iftype = NL80211_IFTYPE_STATION;
 
@@ -2208,13 +2215,20 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct 
wiphy *wiphy,
 
break;
case NL80211_IFTYPE_AP:
-   priv = adapter-priv[MWIFIEX_BSS_TYPE_UAP];
-
-   if (priv-bss_mode) {
-   wiphy_err(wiphy, Can't create multiple AP interfaces);
+   if (adapter-curr_iface_comb.uap_intf ==
+   adapter-iface_limit.uap_intf) {
+   wiphy_err(wiphy,
+ cannot create multiple AP ifaces\n);
return ERR_PTR(-EINVAL);
}
 
+   priv = mwifiex_get_unused_priv(adapter);
+   if (!priv) {
+   wiphy_err(wiphy,
+ could not get free private struct\n);
+   return ERR_PTR(-EFAULT);
+   }
+
priv-wdev.wiphy = wiphy;
priv-wdev.iftype = NL80211_IFTYPE_AP;
 
@@ -2228,15 +2242,21 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct 
wiphy *wiphy,
 
break;
case NL80211_IFTYPE_P2P_CLIENT:
-   priv = adapter-priv[MWIFIEX_BSS_TYPE_P2P];
-
-   if (priv-bss_mode) {
-   wiphy_err(wiphy, Can't create multiple P2P ifaces);
+   if (adapter-curr_iface_comb.p2p_intf ==
+   adapter-iface_limit.p2p_intf) {
+   wiphy_err(wiphy,
+ cannot create multiple P2P ifaces\n);
return ERR_PTR(-EINVAL);
}
 
-   priv-wdev.wiphy = wiphy;
+   priv = mwifiex_get_unused_priv(adapter);
+   if (!priv) {
+   wiphy_err(wiphy,
+ could not get free private struct\n);
+   return ERR_PTR(-EFAULT);
+   }
 
+   priv-wdev.wiphy = wiphy;
/* At start-up, wpa_supplicant tries to change the interface
 * to NL80211_IFTYPE_STATION if it is not managed mode.
 */
@@ -2329,6 +2349,23 @@ struct wireless_dev *mwifiex_add_virtual_intf(struct 
wiphy *wiphy,
mwifiex_dev_debugfs_init(priv);
 #endif
 
+   switch (type) {
+   case NL80211_IFTYPE_UNSPECIFIED:
+   case NL80211_IFTYPE_STATION:
+   case NL80211_IFTYPE_ADHOC:
+   adapter-curr_iface_comb.sta_intf++;
+   break;
+   case NL80211_IFTYPE_AP:
+   adapter-curr_iface_comb.uap_intf++;
+   break;
+   case NL80211_IFTYPE_P2P_CLIENT:
+   adapter-curr_iface_comb.p2p_intf++;
+   break;
+   default:
+   wiphy_err(wiphy, type not supported\n);
+   return ERR_PTR(-EINVAL);
+   }
+
return priv-wdev;
 }
 EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf);
@@ -2339,12 +2376,13 @@ EXPORT_SYMBOL_GPL(mwifiex_add_virtual_intf);
 int mwifiex_del_virtual_intf(struct wiphy *wiphy, 

[PATCH v2 3/8] mwifiex: do not declare wdev as pointer

2015-01-27 Thread Avinash Patil
wdev is used even after del_virtual_interface handler in cfg80211
in nl80211_post_doit. Since we have freed wdev in handling of
del_virtual_intf, this can result into crash while deleting
interface.
Avoid this be not declaring wdev which part of
mwifiex_private structure but struct wireless_dev type.

Signed-off-by: Avinash Patil pat...@marvell.com
Signed-off-by: Amitkumar Karwar akar...@marvell.com
Signed-off-by: Cathy Luo c...@marvell.com
---
 drivers/net/wireless/mwifiex/11h.c   |  2 +-
 drivers/net/wireless/mwifiex/11n.c   |  4 +-
 drivers/net/wireless/mwifiex/11n_rxreorder.c |  2 +-
 drivers/net/wireless/mwifiex/cfg80211.c  | 70 ++--
 drivers/net/wireless/mwifiex/cfp.c   |  4 +-
 drivers/net/wireless/mwifiex/main.c  |  5 +-
 drivers/net/wireless/mwifiex/main.h  |  2 +-
 drivers/net/wireless/mwifiex/scan.c  | 10 ++--
 drivers/net/wireless/mwifiex/sta_event.c |  2 +-
 drivers/net/wireless/mwifiex/sta_ioctl.c |  2 +-
 drivers/net/wireless/mwifiex/txrx.c  |  2 +-
 drivers/net/wireless/mwifiex/util.c  |  2 +-
 12 files changed, 44 insertions(+), 63 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/11h.c 
b/drivers/net/wireless/mwifiex/11h.c
index 2668e83..f23b647a 100644
--- a/drivers/net/wireless/mwifiex/11h.c
+++ b/drivers/net/wireless/mwifiex/11h.c
@@ -39,7 +39,7 @@ mwifiex_11h_process_infra_join(struct mwifiex_private *priv, 
u8 **buffer,
return;
 
radio_type = mwifiex_band_to_radio_type((u8) bss_desc-bss_band);
-   sband = priv-wdev-wiphy-bands[radio_type];
+   sband = priv-wdev.wiphy-bands[radio_type];
 
cap = (struct mwifiex_ie_types_pwr_capability *)*buffer;
cap-header.type = cpu_to_le16(WLAN_EID_PWR_CAPABILITY);
diff --git a/drivers/net/wireless/mwifiex/11n.c 
b/drivers/net/wireless/mwifiex/11n.c
index c5c83cf..543148d 100644
--- a/drivers/net/wireless/mwifiex/11n.c
+++ b/drivers/net/wireless/mwifiex/11n.c
@@ -39,7 +39,7 @@ int mwifiex_fill_cap_info(struct mwifiex_private *priv, u8 
radio_type,
 {
uint16_t ht_ext_cap = le16_to_cpu(ht_cap-extended_ht_cap_info);
struct ieee80211_supported_band *sband =
-   priv-wdev-wiphy-bands[radio_type];
+   priv-wdev.wiphy-bands[radio_type];
 
if (WARN_ON_ONCE(!sband)) {
dev_err(priv-adapter-dev, Invalid radio type!\n);
@@ -314,7 +314,7 @@ mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
return ret_len;
 
radio_type = mwifiex_band_to_radio_type((u8) bss_desc-bss_band);
-   sband = priv-wdev-wiphy-bands[radio_type];
+   sband = priv-wdev.wiphy-bands[radio_type];
 
if (bss_desc-bcn_ht_cap) {
ht_cap = (struct mwifiex_ie_types_htcap *) *buffer;
diff --git a/drivers/net/wireless/mwifiex/11n_rxreorder.c 
b/drivers/net/wireless/mwifiex/11n_rxreorder.c
index c7ca5b7..a2e8817 100644
--- a/drivers/net/wireless/mwifiex/11n_rxreorder.c
+++ b/drivers/net/wireless/mwifiex/11n_rxreorder.c
@@ -45,7 +45,7 @@ static int mwifiex_11n_dispatch_amsdu_pkt(struct 
mwifiex_private *priv,
skb_trim(skb, le16_to_cpu(local_rx_pd-rx_pkt_length));
 
ieee80211_amsdu_to_8023s(skb, list, priv-curr_addr,
-priv-wdev-iftype, 0, false);
+priv-wdev.iftype, 0, false);
 
while (!skb_queue_empty(list)) {
rx_skb = __skb_dequeue(list);
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c 
b/drivers/net/wireless/mwifiex/cfg80211.c
index dd0e410..9710b23 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1590,15 +1590,15 @@ static int mwifiex_cfg80211_inform_ibss_bss(struct 
mwifiex_private *priv)
ie_len = ie_buf[1] + sizeof(struct ieee_types_header);
 
band = mwifiex_band_to_radio_type(priv-curr_bss_params.band);
-   chan = __ieee80211_get_channel(priv-wdev-wiphy,
+   chan = __ieee80211_get_channel(priv-wdev.wiphy,
ieee80211_channel_to_frequency(bss_info.bss_chan,
   band));
 
-   bss = cfg80211_inform_bss(priv-wdev-wiphy, chan,
+   bss = cfg80211_inform_bss(priv-wdev.wiphy, chan,
  CFG80211_BSS_FTYPE_UNKNOWN,
  bss_info.bssid, 0, WLAN_CAPABILITY_IBSS,
  0, ie_buf, ie_len, 0, GFP_KERNEL);
-   cfg80211_put_bss(priv-wdev-wiphy, bss);
+   cfg80211_put_bss(priv-wdev.wiphy, bss);
memcpy(priv-cfg_bssid, bss_info.bssid, ETH_ALEN);
 
return 0;
@@ -1719,12 +1719,12 @@ done:
 
/* Find the BSS we want using available scan results */
if (mode == NL80211_IFTYPE_ADHOC)
-   bss = cfg80211_get_bss(priv-wdev-wiphy, channel,

[PATCH v2 06/10] mwifiex: add cfg80211 start_radar_detection handler

2015-01-27 Thread Avinash Patil
This patch adds support for cfg80211 start_radar_detection handler.
Upon reception of start_radar_detection, driver prepares radar detect
command to FW.

Delayed work is queued for CAC time which sends radar detection finished
event to cfg80211.

Signed-off-by: Avinash Patil pat...@marvell.com
Signed-off-by: Qingshui Gao ga...@marvell.com
Signed-off-by: Cathy Luo c...@marvell.com
---
 drivers/net/wireless/mwifiex/11h.c | 66 ++
 drivers/net/wireless/mwifiex/cfg80211.c| 59 ++
 drivers/net/wireless/mwifiex/decl.h|  6 +++
 drivers/net/wireless/mwifiex/fw.h  | 13 ++
 drivers/net/wireless/mwifiex/init.c|  1 +
 drivers/net/wireless/mwifiex/main.h| 10 +
 drivers/net/wireless/mwifiex/sta_cmd.c |  4 ++
 drivers/net/wireless/mwifiex/sta_cmdresp.c |  2 +
 drivers/net/wireless/mwifiex/uap_cmd.c |  5 +++
 9 files changed, 166 insertions(+)

diff --git a/drivers/net/wireless/mwifiex/11h.c 
b/drivers/net/wireless/mwifiex/11h.c
index f23b647a..8832c83 100644
--- a/drivers/net/wireless/mwifiex/11h.c
+++ b/drivers/net/wireless/mwifiex/11h.c
@@ -99,3 +99,69 @@ void mwifiex_11h_process_join(struct mwifiex_private *priv, 
u8 **buffer,
bss_desc-cap_info_bitmap = ~WLAN_CAPABILITY_SPECTRUM_MGMT;
}
 }
+
+/* This is DFS CAC work queue function.
+ * This delayed work emits CAC finished event for cfg80211 if
+ * CAC was started earlier.
+ */
+void mwifiex_dfs_cac_work_queue(struct work_struct *work)
+{
+   struct cfg80211_chan_def chandef;
+   struct delayed_work *delayed_work =
+   container_of(work, struct delayed_work, work);
+   struct mwifiex_private *priv =
+   container_of(delayed_work, struct mwifiex_private,
+dfs_cac_work);
+
+   if (WARN_ON(!priv))
+   return;
+
+   chandef = priv-dfs_chandef;
+   if (priv-wdev.cac_started) {
+   dev_dbg(priv-adapter-dev,
+   CAC timer finished; No radar detected\n);
+   cfg80211_cac_event(priv-netdev, chandef,
+  NL80211_RADAR_CAC_FINISHED,
+  GFP_KERNEL);
+   }
+}
+
+/* This function prepares channel report request command to FW for
+ * starting radar detection.
+ */
+int mwifiex_cmd_issue_chan_report_request(struct mwifiex_private *priv,
+ struct host_cmd_ds_command *cmd,
+ void *data_buf)
+{
+   struct host_cmd_ds_chan_rpt_req *cr_req = cmd-params.chan_rpt_req;
+   struct mwifiex_radar_params *radar_params = (void *)data_buf;
+
+   cmd-command = cpu_to_le16(HostCmd_CMD_CHAN_REPORT_REQUEST);
+   cmd-size = cpu_to_le16(S_DS_GEN);
+   le16_add_cpu(cmd-size, sizeof(struct host_cmd_ds_chan_rpt_req));
+
+   cr_req-chan_desc.start_freq = cpu_to_le16(MWIFIEX_A_BAND_START_FREQ);
+   cr_req-chan_desc.chan_num = radar_params-chandef-chan-hw_value;
+   cr_req-chan_desc.chan_width = radar_params-chandef-width;
+   cr_req-msec_dwell_time = cpu_to_le32(radar_params-cac_time_ms);
+
+   dev_dbg(priv-adapter-dev,
+   11h: issuing DFS Radar check for channel=%d\n,
+   radar_params-chandef-chan-hw_value);
+
+   return 0;
+}
+
+/* This function is to abort ongoing CAC upon stopping AP operations
+ * or during unload.
+ */
+void mwifiex_abort_cac(struct mwifiex_private *priv)
+{
+   if (priv-wdev.cac_started) {
+   dev_dbg(priv-adapter-dev,
+   Aborting delayed work for CAC.\n);
+   cancel_delayed_work_sync(priv-dfs_cac_work);
+   cfg80211_cac_event(priv-netdev, priv-dfs_chandef,
+  NL80211_RADAR_CAC_ABORTED, GFP_KERNEL);
+   }
+}
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c 
b/drivers/net/wireless/mwifiex/cfg80211.c
index 2e0834c..7a969fd 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1651,6 +1651,8 @@ static int mwifiex_cfg80211_stop_ap(struct wiphy *wiphy, 
struct net_device *dev)
 {
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
 
+   mwifiex_abort_cac(priv);
+
if (mwifiex_del_mgmt_ies(priv))
wiphy_err(wiphy, Failed to delete mgmt IEs!\n);
 
@@ -2383,6 +2385,7 @@ 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
  */
@@ -2396,6 +2399,7 @@ 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];
 
if (!adapter)
return ERR_PTR(-EFAULT);
@@ -2560,6 +2564,24 @@ 

[PATCH v2 02/10] mwifiex: store AP configuration in private structure

2015-01-27 Thread Avinash Patil
Store AP configuration in private structure so that we know
current AP configuration.

Signed-off-by: Avinash Patil pat...@marvell.com
Signed-off-by: Qingshui Gao ga...@marvell.com
Signed-off-by: Cathy Luo c...@marvell.com
---
 drivers/net/wireless/mwifiex/cfg80211.c | 2 ++
 drivers/net/wireless/mwifiex/main.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/net/wireless/mwifiex/cfg80211.c 
b/drivers/net/wireless/mwifiex/cfg80211.c
index 1a5..8e07564 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1655,6 +1655,7 @@ static int mwifiex_cfg80211_stop_ap(struct wiphy *wiphy, 
struct net_device *dev)
wiphy_err(wiphy, Failed to delete mgmt IEs!\n);
 
priv-ap_11n_enabled = 0;
+   memset(priv-bss_cfg, 0, sizeof(priv-bss_cfg));
 
if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_BSS_STOP,
 HostCmd_ACT_GEN_SET, 0, NULL, true)) {
@@ -1782,6 +1783,7 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy,
return -1;
}
 
+   memcpy(priv-bss_cfg, bss_cfg, sizeof(priv-bss_cfg));
kfree(bss_cfg);
 
if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_BSS_START,
diff --git a/drivers/net/wireless/mwifiex/main.h 
b/drivers/net/wireless/mwifiex/main.h
index 9e839cd..673252a 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -577,6 +577,7 @@ struct mwifiex_private {
unsigned long csa_expire_time;
u8 del_list_idx;
bool hs2_enabled;
+   struct mwifiex_uap_bss_param bss_cfg;
struct station_parameters *sta_params;
struct sk_buff_head tdls_txq;
u8 check_tdls_tx;
-- 
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 v2 01/10] mwifiex: do not send regulatory update while starting AP

2015-01-27 Thread Avinash Patil
When regulatory domain changes, cfg80211 already issues request
to change regulatory domain to driver via reg_notifier.
There is no need to set regulatory again during start_ap.

Signed-off-by: Avinash Patil pat...@marvell.com
Signed-off-by: Qingshui Gao ga...@marvell.com
Signed-off-by: Cathy Luo c...@marvell.com
---
 drivers/net/wireless/mwifiex/cfg80211.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/mwifiex/cfg80211.c 
b/drivers/net/wireless/mwifiex/cfg80211.c
index 30ea94a..1a5 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1739,7 +1739,6 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy,
priv-adapter-config_bands = config_bands;
 
mwifiex_set_uap_rates(bss_cfg, params);
-   mwifiex_send_domain_info_cmd_fw(wiphy);
 
if (mwifiex_set_secure_params(priv, bss_cfg, params)) {
kfree(bss_cfg);
-- 
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 v2 04/10] mwifiex: refactor start_ap handler

2015-01-27 Thread Avinash Patil
Refactor mwifiex_cfg80211_start_ap by creating separate function
to set AP channel and another for configuring other AP parameters
and starting AP.

Signed-off-by: Avinash Patil pat...@marvell.com
Signed-off-by: Qingshui Gao ga...@marvell.com
Signed-off-by: Cathy Luo c...@marvell.com
---
 drivers/net/wireless/mwifiex/cfg80211.c | 68 -
 drivers/net/wireless/mwifiex/main.h |  4 ++
 drivers/net/wireless/mwifiex/uap_cmd.c  | 65 +++
 3 files changed, 77 insertions(+), 60 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/cfg80211.c 
b/drivers/net/wireless/mwifiex/cfg80211.c
index ceeaeac..2e0834c 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1677,7 +1677,6 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy,
 {
struct mwifiex_uap_bss_param *bss_cfg;
struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
-   u8 config_bands = 0;
 
if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_UAP)
return -1;
@@ -1697,6 +1696,11 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy,
memcpy(bss_cfg-ssid.ssid, params-ssid, params-ssid_len);
bss_cfg-ssid.ssid_len = params-ssid_len;
}
+   if (params-inactivity_timeout  0) {
+   /* sta_ao_timer/ps_sta_ao_timer is in unit of 100ms */
+   bss_cfg-sta_ao_timer = 10 * params-inactivity_timeout;
+   bss_cfg-ps_sta_ao_timer = 10 * params-inactivity_timeout;
+   }
 
switch (params-hidden_ssid) {
case NL80211_HIDDEN_SSID_NOT_IN_USE:
@@ -1712,31 +1716,7 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy,
return -EINVAL;
}
 
-   bss_cfg-channel = ieee80211_frequency_to_channel(
-   params-chandef.chan-center_freq);
-
-   /* Set appropriate bands */
-   if (params-chandef.chan-band == IEEE80211_BAND_2GHZ) {
-   bss_cfg-band_cfg = BAND_CONFIG_BG;
-   config_bands = BAND_B | BAND_G;
-
-   if (params-chandef.width  NL80211_CHAN_WIDTH_20_NOHT)
-   config_bands |= BAND_GN;
-   } else {
-   bss_cfg-band_cfg = BAND_CONFIG_A;
-   config_bands = BAND_A;
-
-   if (params-chandef.width  NL80211_CHAN_WIDTH_20_NOHT)
-   config_bands |= BAND_AN;
-
-   if (params-chandef.width  NL80211_CHAN_WIDTH_40)
-   config_bands |= BAND_AAC;
-   }
-
-   if (!((config_bands | priv-adapter-fw_bands) 
- ~priv-adapter-fw_bands))
-   priv-adapter-config_bands = config_bands;
-
+   mwifiex_uap_set_channel(bss_cfg, params-chandef);
mwifiex_set_uap_rates(bss_cfg, params);
 
if (mwifiex_set_secure_params(priv, bss_cfg, params)) {
@@ -1760,23 +1740,8 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy,
 
mwifiex_set_wmm_params(priv, bss_cfg, params);
 
-   if (params-inactivity_timeout  0) {
-   /* sta_ao_timer/ps_sta_ao_timer is in unit of 100ms */
-   bss_cfg-sta_ao_timer = 10 * params-inactivity_timeout;
-   bss_cfg-ps_sta_ao_timer = 10 * params-inactivity_timeout;
-   }
-
-   if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_BSS_STOP,
-HostCmd_ACT_GEN_SET, 0, NULL, true)) {
-   wiphy_err(wiphy, Failed to stop the BSS\n);
-   kfree(bss_cfg);
-   return -1;
-   }
-
-   if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_SYS_CONFIG,
-HostCmd_ACT_GEN_SET,
-UAP_BSS_PARAMS_I, bss_cfg, false)) {
-   wiphy_err(wiphy, Failed to set the SSID\n);
+   if (mwifiex_config_start_uap(priv, bss_cfg)) {
+   wiphy_err(wiphy, Failed to start AP\n);
kfree(bss_cfg);
return -1;
}
@@ -1786,23 +1751,6 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy,
 
memcpy(priv-bss_cfg, bss_cfg, sizeof(priv-bss_cfg));
kfree(bss_cfg);
-
-   if (mwifiex_send_cmd(priv, HostCmd_CMD_UAP_BSS_START,
-HostCmd_ACT_GEN_SET, 0, NULL, false)) {
-   wiphy_err(wiphy, Failed to start the BSS\n);
-   return -1;
-   }
-
-   if (priv-sec_info.wep_enabled)
-   priv-curr_pkt_filter |= HostCmd_ACT_MAC_WEP_ENABLE;
-   else
-   priv-curr_pkt_filter = ~HostCmd_ACT_MAC_WEP_ENABLE;
-
-   if (mwifiex_send_cmd(priv, HostCmd_CMD_MAC_CONTROL,
-HostCmd_ACT_GEN_SET, 0,
-priv-curr_pkt_filter, true))
-   return -1;
-
return 0;
 }
 
diff --git a/drivers/net/wireless/mwifiex/main.h 
b/drivers/net/wireless/mwifiex/main.h
index 673252a..0c75eff 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ 

[PATCH v2 08/10] mwifiex: handle radar detect event from FW

2015-01-27 Thread Avinash Patil
This patch adds support for radar_detected event from FW.
Driver in turn would stop netdev queues to stop TX traffic and
issue RADAR_DETECT event to cfg80211.

Signed-off-by: Avinash Patil pat...@marvell.com
Signed-off-by: Qingshui Gao ga...@marvell.com
Signed-off-by: Cathy Luo c...@marvell.com
---
 drivers/net/wireless/mwifiex/11h.c   | 24 
 drivers/net/wireless/mwifiex/fw.h| 20 
 drivers/net/wireless/mwifiex/main.h  |  2 ++
 drivers/net/wireless/mwifiex/sta_event.c |  5 +
 drivers/net/wireless/mwifiex/uap_event.c |  4 
 5 files changed, 55 insertions(+)

diff --git a/drivers/net/wireless/mwifiex/11h.c 
b/drivers/net/wireless/mwifiex/11h.c
index e44cac7..08c12ae 100644
--- a/drivers/net/wireless/mwifiex/11h.c
+++ b/drivers/net/wireless/mwifiex/11h.c
@@ -216,3 +216,27 @@ int mwifiex_11h_handle_chanrpt_ready(struct 
mwifiex_private *priv,
 
return 0;
 }
+
+/* Handler for radar detected event from FW.*/
+int mwifiex_11h_handle_radar_detected(struct mwifiex_private *priv,
+ struct sk_buff *skb)
+{
+   struct mwifiex_radar_det_event *rdr_event;
+
+   rdr_event = (void *)(skb-data + sizeof(u32));
+
+   if (le32_to_cpu(rdr_event-passed)) {
+   dev_notice(priv-adapter-dev,
+  radar detected; indicating kernel\n);
+   cfg80211_radar_event(priv-adapter-wiphy, priv-dfs_chandef,
+GFP_KERNEL);
+   dev_dbg(priv-adapter-dev, regdomain: %d\n,
+   rdr_event-reg_domain);
+   dev_dbg(priv-adapter-dev, radar detection type: %d\n,
+   rdr_event-det_type);
+   } else {
+   dev_dbg(priv-adapter-dev, false radar detection event!\n);
+   }
+
+   return 0;
+}
diff --git a/drivers/net/wireless/mwifiex/fw.h 
b/drivers/net/wireless/mwifiex/fw.h
index 324ef29..6d433227 100644
--- a/drivers/net/wireless/mwifiex/fw.h
+++ b/drivers/net/wireless/mwifiex/fw.h
@@ -495,6 +495,7 @@ enum P2P_MODES {
 #define EVENT_HOSTWAKE_STAIE   0x004d
 #define EVENT_CHANNEL_SWITCH_ANN0x0050
 #define EVENT_TDLS_GENERIC_EVENT0x0052
+#define EVENT_RADAR_DETECTED   0x0053
 #define EVENT_CHANNEL_REPORT_RDY0x0054
 #define EVENT_EXT_SCAN_REPORT   0x0058
 #define EVENT_REMAIN_ON_CHAN_EXPIRED0x005f
@@ -1813,6 +1814,25 @@ struct mwifiex_ie_types_rssi_threshold {
u8 evt_freq;
 } __packed;
 
+#define MWIFIEX_DFS_REC_HDR_LEN8
+#define MWIFIEX_DFS_REC_HDR_NUM10
+#define MWIFIEX_BIN_COUNTER_LEN7
+
+struct mwifiex_radar_det_event {
+   __le32 detect_count;
+   u8 reg_domain;  /*1=fcc, 2=etsi, 3=mic*/
+   u8 det_type;  /*0=none, 1=pw(chirp), 2=pri(radar)*/
+   __le16 pw_chirp_type;
+   u8 pw_chirp_idx;
+   u8 pw_value;
+   u8 pri_radar_type;
+   u8 pri_bincnt;
+   u8 bin_counter[MWIFIEX_BIN_COUNTER_LEN];
+   u8 num_dfs_records;
+   u8 dfs_record_hdr[MWIFIEX_DFS_REC_HDR_NUM][MWIFIEX_DFS_REC_HDR_LEN];
+   __le32 passed;
+} __packed;
+
 struct meas_rpt_map {
u8 rssi:3;
u8 unmeasured:1;
diff --git a/drivers/net/wireless/mwifiex/main.h 
b/drivers/net/wireless/mwifiex/main.h
index 281a30a..ad9d679 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -1395,6 +1395,8 @@ mwifiex_clone_skb_for_tx_status(struct mwifiex_private 
*priv,
struct sk_buff *skb, u8 flag, u64 *cookie);
 void mwifiex_dfs_cac_work_queue(struct work_struct *work);
 void mwifiex_abort_cac(struct mwifiex_private *priv);
+int mwifiex_11h_handle_radar_detected(struct mwifiex_private *priv,
+ struct sk_buff *skb);
 
 void mwifiex_hist_data_set(struct mwifiex_private *priv, u8 rx_rate, s8 snr,
   s8 nflr);
diff --git a/drivers/net/wireless/mwifiex/sta_event.c 
b/drivers/net/wireless/mwifiex/sta_event.c
index ad5c5e0..c03b82c 100644
--- a/drivers/net/wireless/mwifiex/sta_event.c
+++ b/drivers/net/wireless/mwifiex/sta_event.c
@@ -521,6 +521,11 @@ int mwifiex_process_sta_event(struct mwifiex_private *priv)
ret = mwifiex_11h_handle_chanrpt_ready(priv,
   adapter-event_skb);
break;
+   case EVENT_RADAR_DETECTED:
+   dev_dbg(adapter-dev, event: Radar detected\n);
+   ret = mwifiex_11h_handle_radar_detected(priv,
+   adapter-event_skb);
+   break;
default:
dev_dbg(adapter-dev, event: unknown event id: %#x\n,
eventcause);
diff --git a/drivers/net/wireless/mwifiex/uap_event.c 
b/drivers/net/wireless/mwifiex/uap_event.c
index e0bdf6a..f4794cd 100644
--- 

[PATCH v2 00/10] mwifiex: DFS support for mwifiex AP

2015-01-27 Thread Avinash Patil
This patch series adds DFS support for mwifiex AP. Series include
patches to handle cfg80211 start_radar_detection and channel_switch
handlers. First 5 patches are actually refactoring effort. Patch6-10
add these handlers and other DFS handling.

Avinash Patil (10):
  mwifiex: do not send regulatory update while starting AP
  mwifiex: store AP configuration in private structure
  mwifiex: update IEs after AP has started
  mwifiex: refactor start_ap handler
  mwifiex: separate function for parsing head and tail IEs
  mwifiex: add cfg80211 start_radar_detection handler
  mwifiex: support for channel report for radar detection
  mwifiex: handle radar detect event from FW
  mwifiex: channel switch support for mwifiex
  mwifiex: 11h handling for AP interface

 drivers/net/wireless/mwifiex/11h.c | 196 +++-
 drivers/net/wireless/mwifiex/cfg80211.c| 232 +
 drivers/net/wireless/mwifiex/decl.h|  11 ++
 drivers/net/wireless/mwifiex/fw.h  |  58 
 drivers/net/wireless/mwifiex/ie.c  |  89 ++-
 drivers/net/wireless/mwifiex/init.c|   3 +
 drivers/net/wireless/mwifiex/main.c|   2 +-
 drivers/net/wireless/mwifiex/main.h|  31 +++-
 drivers/net/wireless/mwifiex/sta_cmd.c |   4 +
 drivers/net/wireless/mwifiex/sta_cmdresp.c |   2 +
 drivers/net/wireless/mwifiex/sta_event.c   |  10 ++
 drivers/net/wireless/mwifiex/uap_cmd.c |  70 +
 drivers/net/wireless/mwifiex/uap_event.c   |   8 +
 13 files changed, 619 insertions(+), 97 deletions(-)

-- 
1.8.1.4

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


[PATCH v2 05/10] mwifiex: separate function for parsing head and tail IEs

2015-01-27 Thread Avinash Patil
Head  Tail IEs are supposed to be added to beacon and probe response.
This patch adds separate function for parsing head and tail IEs from
cfg80211_beacon_data and sets them to FW.

Signed-off-by: Avinash Patil pat...@marvell.com
Signed-off-by: Qingshui Gao ga...@marvell.com
Signed-off-by: Cathy Luo c...@marvell.com
---
 drivers/net/wireless/mwifiex/ie.c   | 81 +
 drivers/net/wireless/mwifiex/main.c |  2 +-
 drivers/net/wireless/mwifiex/main.h |  2 +-
 3 files changed, 48 insertions(+), 37 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/ie.c 
b/drivers/net/wireless/mwifiex/ie.c
index b933794..a6af7b8 100644
--- a/drivers/net/wireless/mwifiex/ie.c
+++ b/drivers/net/wireless/mwifiex/ie.c
@@ -317,27 +317,26 @@ done:
return ret;
 }
 
-/* This function parses different IEs-tail IEs, beacon IEs, probe response IEs,
- * association response IEs from cfg80211_ap_settings function and sets these 
IE
- * to FW.
+/* This function parses  head and tail IEs, from cfg80211_beacon_data and sets
+ * these IE to FW.
  */
-int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
-struct cfg80211_beacon_data *info)
+static int mwifiex_uap_set_head_tail_ies(struct mwifiex_private *priv,
+struct cfg80211_beacon_data *info)
 {
struct mwifiex_ie *gen_ie;
-   struct ieee_types_header *rsn_ie, *wpa_ie = NULL;
-   u16 rsn_idx = MWIFIEX_AUTO_IDX_MASK, ie_len = 0;
+   struct ieee_types_header *rsn_ie = NULL, *wpa_ie = NULL;
+   u16 gen_idx = MWIFIEX_AUTO_IDX_MASK, ie_len = 0;
const u8 *vendor_ie;
 
-   if (info-tail  info-tail_len) {
-   gen_ie = kzalloc(sizeof(struct mwifiex_ie), GFP_KERNEL);
-   if (!gen_ie)
-   return -ENOMEM;
-   gen_ie-ie_index = cpu_to_le16(rsn_idx);
-   gen_ie-mgmt_subtype_mask = cpu_to_le16(MGMT_MASK_BEACON |
-   MGMT_MASK_PROBE_RESP |
-   MGMT_MASK_ASSOC_RESP);
+   gen_ie = kzalloc(sizeof(*gen_ie), GFP_KERNEL);
+   if (!gen_ie)
+   return -ENOMEM;
+   gen_ie-ie_index = cpu_to_le16(gen_idx);
+   gen_ie-mgmt_subtype_mask = cpu_to_le16(MGMT_MASK_BEACON |
+   MGMT_MASK_PROBE_RESP |
+   MGMT_MASK_ASSOC_RESP);
 
+   if (info-tail  info-tail_len) {
rsn_ie = (void *)cfg80211_find_ie(WLAN_EID_RSN,
  info-tail, info-tail_len);
if (rsn_ie) {
@@ -357,20 +356,33 @@ int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
ie_len += wpa_ie-len + 2;
gen_ie-ie_length = cpu_to_le16(ie_len);
}
+   }
 
-   if (rsn_ie || wpa_ie) {
-   if (mwifiex_update_uap_custom_ie(priv, gen_ie, rsn_idx,
-NULL, NULL,
-NULL, NULL)) {
-   kfree(gen_ie);
-   return -1;
-   }
-   priv-rsn_idx = rsn_idx;
+   if (rsn_ie || wpa_ie) {
+   if (mwifiex_update_uap_custom_ie(priv, gen_ie, gen_idx, NULL,
+NULL, NULL, NULL)) {
+   kfree(gen_ie);
+   return -1;
}
-
-   kfree(gen_ie);
+   priv-gen_idx = gen_idx;
}
 
+   kfree(gen_ie);
+   return 0;
+}
+
+/* This function parses different IEs-head  tail IEs, beacon IEs,
+ * probe response IEs, association response IEs from cfg80211_ap_settings
+ * function and sets these IE to FW.
+ */
+int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
+struct cfg80211_beacon_data *info)
+{
+   int ret;
+
+   ret = mwifiex_uap_set_head_tail_ies(priv, info);
+   return ret;
+
return mwifiex_set_mgmt_beacon_data_ies(priv, info);
 }
 
@@ -378,25 +390,25 @@ int mwifiex_set_mgmt_ies(struct mwifiex_private *priv,
 int mwifiex_del_mgmt_ies(struct mwifiex_private *priv)
 {
struct mwifiex_ie *beacon_ie = NULL, *pr_ie = NULL;
-   struct mwifiex_ie *ar_ie = NULL, *rsn_ie = NULL;
+   struct mwifiex_ie *ar_ie = NULL, *gen_ie = NULL;
int ret = 0;
 
-   if (priv-rsn_idx != MWIFIEX_AUTO_IDX_MASK) {
-   rsn_ie = kmalloc(sizeof(struct mwifiex_ie), GFP_KERNEL);
-   if (!rsn_ie)
+   if (priv-gen_idx != MWIFIEX_AUTO_IDX_MASK) {
+   gen_ie = kmalloc(sizeof(*gen_ie), GFP_KERNEL);
+   if (!gen_ie)
return -ENOMEM;
 
-   rsn_ie-ie_index = cpu_to_le16(priv-rsn_idx);
-   rsn_ie-mgmt_subtype_mask = 

[PATCH v2 03/10] mwifiex: update IEs after AP has started

2015-01-27 Thread Avinash Patil
This patch moves IE management routine to end of start_ap handler.
IEs now would be updated after AP has started.

Signed-off-by: Avinash Patil pat...@marvell.com
Signed-off-by: Qingshui Gao ga...@marvell.com
Signed-off-by: Cathy Luo c...@marvell.com
---
 drivers/net/wireless/mwifiex/cfg80211.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/cfg80211.c 
b/drivers/net/wireless/mwifiex/cfg80211.c
index 8e07564..ceeaeac 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -1681,8 +1681,6 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy,
 
if (GET_BSS_ROLE(priv) != MWIFIEX_BSS_ROLE_UAP)
return -1;
-   if (mwifiex_set_mgmt_ies(priv, params-beacon))
-   return -1;
 
bss_cfg = kzalloc(sizeof(struct mwifiex_uap_bss_param), GFP_KERNEL);
if (!bss_cfg)
@@ -1783,6 +1781,9 @@ static int mwifiex_cfg80211_start_ap(struct wiphy *wiphy,
return -1;
}
 
+   if (mwifiex_set_mgmt_ies(priv, params-beacon))
+   return -1;
+
memcpy(priv-bss_cfg, bss_cfg, sizeof(priv-bss_cfg));
kfree(bss_cfg);
 
-- 
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 v2 09/10] mwifiex: channel switch support for mwifiex

2015-01-27 Thread Avinash Patil
This patch adds cfg80211 channel_switch support for mwifiex.
Upon receiving channel switch request, driver would parse channel
switch announcement IE from beacon_data.
If TX is blocked, netdev queues are stopped. IEs from csa_beacon
are then parsed and set to FW.

Signed-off-by: Avinash Patil pat...@marvell.com
Signed-off-by: Qingshui Gao ga...@marvell.com
Signed-off-by: Cathy Luo c...@marvell.com
---
 drivers/net/wireless/mwifiex/11h.c  | 37 ++
 drivers/net/wireless/mwifiex/cfg80211.c | 85 -
 drivers/net/wireless/mwifiex/ie.c   | 12 -
 drivers/net/wireless/mwifiex/main.h |  5 ++
 4 files changed, 136 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/11h.c 
b/drivers/net/wireless/mwifiex/11h.c
index 08c12ae..d794686 100644
--- a/drivers/net/wireless/mwifiex/11h.c
+++ b/drivers/net/wireless/mwifiex/11h.c
@@ -240,3 +240,40 @@ int mwifiex_11h_handle_radar_detected(struct 
mwifiex_private *priv,
 
return 0;
 }
+
+/* This is work queue function for channel switch handling.
+ * This function takes care of updating new channel definitin to
+ * bss config structure, restart AP and indicate channel switch success
+ * to cfg80211.
+ */
+void mwifiex_dfs_chan_sw_work_queue(struct work_struct *work)
+{
+   struct mwifiex_uap_bss_param *bss_cfg;
+   struct delayed_work *delayed_work =
+   container_of(work, struct delayed_work, work);
+   struct mwifiex_private *priv =
+   container_of(delayed_work, struct mwifiex_private,
+dfs_chan_sw_work);
+
+   if (WARN_ON(!priv))
+   return;
+
+   bss_cfg = priv-bss_cfg;
+   if (!bss_cfg-beacon_period) {
+   dev_err(priv-adapter-dev,
+   channel switch: AP already stopped\n);
+   return;
+   }
+
+   mwifiex_uap_set_channel(bss_cfg, priv-dfs_chandef);
+
+   if (mwifiex_config_start_uap(priv, bss_cfg)) {
+   dev_dbg(priv-adapter-dev,
+   Failed to start AP after channel switch\n);
+   return;
+   }
+
+   dev_notice(priv-adapter-dev,
+  indicating channel switch completion to kernel\n);
+   cfg80211_ch_switch_notify(priv-netdev, priv-dfs_chandef);
+}
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c 
b/drivers/net/wireless/mwifiex/cfg80211.c
index 7a969fd..2d1ea93 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -2399,7 +2399,7 @@ 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];
+   char dfs_cac_str[MWIFIEX_MAX_WQ_LEN], dfs_chsw_str[MWIFIEX_MAX_WQ_LEN];
 
if (!adapter)
return ERR_PTR(-EFAULT);
@@ -2582,6 +2582,24 @@ 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,
+ WQ_HIGHPRI | WQ_UNBOUND |
+ WQ_MEM_RECLAIM, 1);
+   if (!priv-dfs_chan_sw_workqueue) {
+   wiphy_err(wiphy, cannot register virtual network device\n);
+   free_netdev(dev);
+   priv-bss_mode = NL80211_IFTYPE_UNSPECIFIED;
+   priv-netdev = NULL;
+   memset(priv-wdev, 0, sizeof(priv-wdev));
+   priv-wdev.iftype = NL80211_IFTYPE_UNSPECIFIED;
+   return ERR_PTR(-ENOMEM);
+   }
+
+   INIT_DELAYED_WORK(priv-dfs_chan_sw_work,
+ mwifiex_dfs_chan_sw_work_queue);
+
sema_init(priv-async_sem, 1);
 
dev_dbg(adapter-dev, info: %s: Marvell 802.11 Adapter\n, dev-name);
@@ -2637,6 +2655,11 @@ int mwifiex_del_virtual_intf(struct wiphy *wiphy, struct 
wireless_dev *wdev)
priv-dfs_cac_workqueue = NULL;
}
 
+   if (priv-dfs_chan_sw_workqueue) {
+   flush_workqueue(priv-dfs_chan_sw_workqueue);
+   destroy_workqueue(priv-dfs_chan_sw_workqueue);
+   priv-dfs_chan_sw_workqueue = NULL;
+   }
/* Clear the priv in adapter */
priv-netdev-ieee80211_ptr = NULL;
priv-netdev = NULL;
@@ -3116,6 +3139,62 @@ mwifiex_cfg80211_add_station(struct wiphy *wiphy, struct 
net_device *dev,
 }
 
 static int
+mwifiex_cfg80211_channel_switch(struct wiphy *wiphy, struct net_device *dev,
+   struct cfg80211_csa_settings *params)
+{
+   struct ieee_types_header *chsw_ie;
+   struct ieee80211_channel_sw_ie *channel_sw;
+   int chsw_msec;
+   struct mwifiex_private *priv = 

Re: [PATCH v2] mwifiex: set netif carrier off in ndo_open

2015-01-27 Thread Avinash Patil
On Tue, 2015-01-27 at 09:42 -0800, Kalle Valo wrote:
 Avinash Patil pat...@marvell.com writes:
 
  On Mon, 2015-01-19 at 02:24 -0800, Avinash Patil wrote:
  From: Johannes Berg johan...@sipsolutions.net
  
  This patch adds fix to set carrier state off during ndo_open.
  Carrier should be set to ON when device is ready to send data.
  In case of station/adhoc interface device is able to transfer
  data after successful association/join operation.
  For AP this would be after bss_active event.
  
  Signed-off-by: Johannes Berg johan...@sipsolutions.net
  Signed-off-by: Avinash Patil pat...@marvell.com
 
 [...]
 
  I do not see this patch in master branch as well as in patchworks
  pending patchlist. Is this one also dropped? Do you want me to resend
  this as well while I am sending rebased DFS patches?
 
 I had accidentally marked this patch as Not Applicable in patchwork,
 sorry about that. Good thing that you noticed. I have applied the patch
 now.
 
Thanks, Kalle.

-Avinash

--
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 RESEND] ssb: Fix Sparse error in main

2015-01-27 Thread Pramod Gurav
This change fixes below sparse error:
drivers/ssb/main.c:94:16: warning: symbol 'ssb_sdio_func_to_bus'
was not declared. Should it be static?

Acked-by: Michael Buesch m...@bues.ch
Signed-off-by: Pramod Gurav pramod.gu...@smartplayin.com
---
 drivers/ssb/main.c |   19 ---
 1 file changed, 19 deletions(-)

diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
index 2fead38..1e180c4 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
@@ -90,25 +90,6 @@ found:
 }
 #endif /* CONFIG_SSB_PCMCIAHOST */
 
-#ifdef CONFIG_SSB_SDIOHOST
-struct ssb_bus *ssb_sdio_func_to_bus(struct sdio_func *func)
-{
-   struct ssb_bus *bus;
-
-   ssb_buses_lock();
-   list_for_each_entry(bus, buses, list) {
-   if (bus-bustype == SSB_BUSTYPE_SDIO 
-   bus-host_sdio == func)
-   goto found;
-   }
-   bus = NULL;
-found:
-   ssb_buses_unlock();
-
-   return bus;
-}
-#endif /* CONFIG_SSB_SDIOHOST */
-
 int ssb_for_each_bus_call(unsigned long data,
  int (*func)(struct ssb_bus *bus, unsigned long data))
 {
-- 
1.7.9.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: RTL8192ee

2015-01-27 Thread Larry Finger

On 01/27/2015 08:19 AM, Jason Plum wrote:

Larry,

I know that to some degree I am jumping this chain. That being said, please 
allow me to offer encouragement in the development of the rtl8192ee, rtl872ae, 
and the other members of the rtlwifi_new github.

I have been using these myself, and keeping them in my sights as my commercial 
product that has to support these drivers is being developed. There are some 
hiccups as is to be expected, but your work is greatly appreciated. I strive to 
keep our product as free of vendor proprietary code as much as possible and you 
work with rtlwifi_new and the available integration with multiple revisions of 
the kernel has been a recent key to that effort.


Note that everything in rtlwifi_new will soon be in the kernel. The bulk of the 
code was moved into V3.18 with some fixes applied to V3.19. A major hunk for BT 
coexistence for the RTL8812AE, which I have never seen, is in review, but should 
be available in V3.20. If Realtek has any new drivers in development, they have 
not told me.


For the next few months, my plan is to fix bugs, prune out any extraneous code, 
and identify routines used by 2 or more of the drivers and move them into the core.


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: pull-request mwifiex-firmware 2015-01-27

2015-01-27 Thread Kyle McMartin
On Tue, Jan 27, 2015 at 04:41:24PM +0530, Avinash Patil wrote:
 The following changes since commit dec41bce44e0dff6a2c3358a958fadf22bf58858:
 
   Merge branch 'master' of 
 git://git.kernel.org/pub/scm/linux/kernel/git/egrumbach/linux-firmware 
 (2014-03-16 18:12:54 +)
 
 are available in the git repository at:
 
 
   git://git.marvell.com/mwifiex-firmware.git master
 
 for you to fetch changes up to 7f02df82736a85606cd9f33cb709545d9fc5326e:
 
   linux-firmware: update Marvell 8897-B0 firmware images to p112 (2015-01-27 
 16:02:53 +0530)
 

Thanks, I've pulled and pushed this out.

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


[PATCH] cfg80211: fix world_regdom's n_reg_rules

2015-01-27 Thread Vladimir Kondratiev
In the commit:
131a19b - regulatory: enable channels 52-64 and 100-144 for world roaming

2 entries added to the world_regdom.reg_rules, while
world_regdom.n_reg_rules was not updated to reflect array size.
Fix it.

Signed-off-by: Vladimir Kondratiev qca_vkond...@qca.qualcomm.com
---
 net/wireless/reg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index b586d0d..48dfc7b 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -228,7 +228,7 @@ static DECLARE_DELAYED_WORK(reg_timeout, reg_timeout_work);
 
 /* We keep a static world regulatory domain in case of the absence of CRDA */
 static const struct ieee80211_regdomain world_regdom = {
-   .n_reg_rules = 6,
+   .n_reg_rules = 8,
.alpha2 =  00,
.reg_rules = {
/* IEEE 802.11b/g, channels 1..11 */
-- 
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: [v2] mwifiex: set netif carrier off in ndo_open

2015-01-27 Thread Kalle Valo

 From: Johannes Berg johan...@sipsolutions.net
 
 This patch adds fix to set carrier state off during ndo_open.
 Carrier should be set to ON when device is ready to send data.
 In case of station/adhoc interface device is able to transfer
 data after successful association/join operation.
 For AP this would be after bss_active event.
 
 Signed-off-by: Johannes Berg johan...@sipsolutions.net
 Signed-off-by: Avinash Patil pat...@marvell.com

Thanks, applied to wireless-drivers-next.git.

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


Re: [PATCH] cfg80211: fix world_regdom's n_reg_rules

2015-01-27 Thread Johannes Berg
On Tue, 2015-01-27 at 18:10 +0200, Vladimir Kondratiev wrote:
 In the commit:
 131a19b - regulatory: enable channels 52-64 and 100-144 for world roaming

please use 12 hex digits to refer to commits.

 2 entries added to the world_regdom.reg_rules, while
 world_regdom.n_reg_rules was not updated to reflect array size.
 Fix it.
 
 Signed-off-by: Vladimir Kondratiev qca_vkond...@qca.qualcomm.com

Should it be Cc stable? And you should probably add a Fixes: tag.

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 v2] mwifiex: set netif carrier off in ndo_open

2015-01-27 Thread Kalle Valo
Avinash Patil pat...@marvell.com writes:

 On Mon, 2015-01-19 at 02:24 -0800, Avinash Patil wrote:
 From: Johannes Berg johan...@sipsolutions.net
 
 This patch adds fix to set carrier state off during ndo_open.
 Carrier should be set to ON when device is ready to send data.
 In case of station/adhoc interface device is able to transfer
 data after successful association/join operation.
 For AP this would be after bss_active event.
 
 Signed-off-by: Johannes Berg johan...@sipsolutions.net
 Signed-off-by: Avinash Patil pat...@marvell.com

[...]

 I do not see this patch in master branch as well as in patchworks
 pending patchlist. Is this one also dropped? Do you want me to resend
 this as well while I am sending rebased DFS patches?

I had accidentally marked this patch as Not Applicable in patchwork,
sorry about that. Good thing that you noticed. I have applied the patch
now.

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


Re: rtl8192cu: fix the mesh beaconing

2015-01-27 Thread Kalle Valo

 Patch rtlwifi: add support to send beacon frame allows
 the beaconing of rtl8192cu. But mesh beaconing is not
 working. Fix this.
 
 Signed-off-by: Chun-Yeow Yeoh yeohchuny...@gmail.com
 Acked-by: Larry Finger larry.fin...@lwfinger.net

Thanks, applied to wireless-drivers-next.git.

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


Re: [PATCH] ath10k: Replace ioread with wmb for data sync

2015-01-27 Thread Bob Copeland
On Tue, Jan 27, 2015 at 03:53:00PM -0800, Peter Oh wrote:
 -   /* IMPORTANT: this extra read transaction is required to
 -* flush the posted write buffer. */
 -   (void)ath10k_pci_read32(ar, SOC_CORE_BASE_ADDRESS +
 -   PCIE_INTR_ENABLE_ADDRESS);
 +   /* invoke data sync barrier */
 +   wmb();
   }
 I am no expert in arcane PCI matters, but that looks suspicious to me.  I 
 seem
 to recall wmb() only enforced ordering, and maybe not even memory-IO ordering
 on all platforms.  If you want to disable an irq, it really seems like you
 would want to flush posted writes so you know the hardware has seen it.
 enforced ordering is happened by flush write buffer and wmb is
 commonly used to flush write buffer.
 so that wmb guarantees ordering by flush write buffer. That's why
 it's called a memory barrier.

Ok, sure, but I/O ordering two different writes, and ensuring device
has seen a posted write, are related but different things, no?  So if
you are disabling an interrupt and want to be really sure interrupts
are off when function returns, I think you still want the read.

Anyway, it's your driver, just pointing out that the IMPORTANT
read might still be important to someone.

-- 
Bob Copeland %% http://bobcopeland.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


NetDev 0.1 Hotel special rates extended

2015-01-27 Thread Richard Guy Briggs
Fellow netheads:


Hotel discount rates deadline extended
==
We've been able to negotiate an extention to the block of rooms at the
hotel earlybird special rates beyond this past Friday, but when they are
gone, they are gone.
The Westin Hotel is still holding a block of rooms for Netdev01 at a
guaranteed rate of $159.00 or $179.00 (depending on the type of room
required) and there are still a few rooms available.
Make your reservations at:
https://www.starwoodmeeting.com/StarGroupsWeb/res?id=1412035802key=1AC9C1F8
There are lots of big and small hotels in Ottawa, but they will fill up
fast as Winterlude approaches, so book something soon.  There may be
some possibilities to billet locally, but don't leave it last minute.


Registration:
==
https://onlineregistrations.ca/netdev01/
$100/day, or $350 for 4 days (Cdn dollars). (online reg closes Feb 12th)
Please register as early as practical.  Registering helps us plan properly for
numbers of attendees, ensuring venue sizes and supplies are appropriate without
wasting resources.


Sponsors:
=
NetDev 0.1 would like to gratefully acknowledge all our sponsors: 
https://netdev01.org/sponsors
CENGN   http://www.cengn.ca/
Google  https://www.google.ca
Qualcommhttps://www.qualcomm.com/
Verizon http://www.verizon.com/
Cumulus Networkshttp://cumulusnetworks.com/
Mojatatu Networks   http://mojatatu.com/

---
THE Technical Conference on Linux Networking, February 14-17, 2015, Ottawa, 
Canada
https://netdev01.org/

Contact:i...@netdev01.info
Main site:  https://www.netdev01.org/
Travel/hotel/weather/clothing:  https://www.netdev01.org/travel
RSS feed:   https://netdev01.org/atom
Follow us on Twitter: @netdev01 https://twitter.com/netdev01
--
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