[PATCH] ath9k: fix the assignment of hw queues for mesh interface

2014-11-12 Thread Chun-Yeow Yeoh
We need to assign the hw queues for mesh interface. Otherwise,
we are not able to bring up the mesh interface due to the
IEEE80211_INVAL_HW_QUEUE error.

Signed-off-by: Chun-Yeow Yeoh yeohchuny...@gmail.com
---
 drivers/net/wireless/ath/ath9k/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c 
b/drivers/net/wireless/ath/ath9k/main.c
index 644552c..88a5cf2 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1188,7 +1188,8 @@ static void ath9k_assign_hw_queues(struct ieee80211_hw 
*hw,
for (i = 0; i  IEEE80211_NUM_ACS; i++)
vif-hw_queue[i] = i;
 
-   if (vif-type == NL80211_IFTYPE_AP)
+   if (vif-type == NL80211_IFTYPE_AP ||
+   vif-type == NL80211_IFTYPE_MESH_POINT)
vif-cab_queue = hw-queues - 2;
else
vif-cab_queue = IEEE80211_INVAL_HW_QUEUE;
-- 
2.1.1

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


Re: brcmfmac not working on ECS LIVA

2014-11-12 Thread Arend van Spriel
On 11-11-14 23:32, Felipe Contreras wrote:
 On Sun, Nov 9, 2014 at 4:46 AM, Arend van Spriel ar...@broadcom.com wrote:
 
 Could you share the nvram obtained from EFI? Also please create a kernel log
 with debug=0xd416.
 
 There you go:
 http://people.freedesktop.org/~felipec/dmesg-brcm.txt
 

It is using the sdhci-acpi driver for the sdio host controller. If I am
not mistaken that one does runtime-pm. This has caused issues with our
device. This is what happens:

1. driver sends control message and waits for firmware response.
 2. runtime pm kicks in and suspends host controller.
  3. host controller suspend disable sdio clock.
   4. host controller does not detect firmware interrupt for response.
5. control message times out.

You can disable it through sysfs, but the patch below may do it.

Regards,
Arend

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
b/drivers/net/wire
index f754ffc..d231e65 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c
@@ -27,6 +27,7 @@
 #include linux/mmc/sdio_func.h
 #include linux/mmc/card.h
 #include linux/mmc/host.h
+#include linux/pm_runtime.h
 #include linux/platform_device.h
 #include linux/platform_data/brcmfmac-sdio.h
 #include linux/suspend.h
@@ -976,6 +977,12 @@ static int brcmf_sdiod_probe(struct brcmf_sdio_dev
*sdiodev
   SG_MAX_SINGLE_ALLOC);
sdiodev-max_segment_size = host-max_seg_size;

+   /*
+* Several issues with the driver seem to occur when the SDIO host
+* is using runtime-pm. Prevent host from doing runtime-pm here.
+*/
+   __pm_runtime_use_autosuspend(host-class_dev, false);
+
/* allocate scatter-gather table. sg support
 * will be disabled upon allocation failure.
 */

--
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] ath9k: disable overriding AR9340 SLP32 registers

2014-11-12 Thread Felix Fietkau
On 2014-11-11 08:07, Sujith Manoharan wrote:
 From: Miaoqing Pan miaoq...@qca.qualcomm.com
 
 For AR9340, the correct values for SLP32 registers are present
 in the initvals, so overriding them is not needed.
 
 Signed-off-by: Miaoqing Pan miaoq...@qca.qualcomm.com
 Signed-off-by: Sujith Manoharan c_man...@qca.qualcomm.com
What's the point in doing this? The writes don't hurt, and this change
is making the code uglier.

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


[PATCH v2 1/2] nl80211: Replace interface socket owner attribute with more generic one

2014-11-12 Thread Jukka Rissanen
Replace NL80211_ATTR_IFACE_SOCKET_OWNER attribute with more generic
NL80211_ATTR_SOCKET_OWNER that can be used with other commands
that interface creation.
---
 include/uapi/linux/nl80211.h | 8 +---
 net/wireless/nl80211.c   | 4 ++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 442369f..c410284 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1637,9 +1637,9 @@ enum nl80211_commands {
  * @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32.
  * As specified in the enum nl80211_tdls_peer_capability.
  *
- * @NL80211_ATTR_IFACE_SOCKET_OWNER: flag attribute, if set during interface
+ * @NL80211_ATTR_SOCKET_OWNER: Flag attribute, if set during interface
  * creation then the new interface will be owned by the netlink socket
- * that created it and will be destroyed when the socket is closed
+ * that created it and will be destroyed when the socket is closed.
  *
  * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is
  * the TDLS link initiator.
@@ -2004,7 +2004,7 @@ enum nl80211_attrs {
 
NL80211_ATTR_TDLS_PEER_CAPABILITY,
 
-   NL80211_ATTR_IFACE_SOCKET_OWNER,
+   NL80211_ATTR_SOCKET_OWNER,
 
NL80211_ATTR_CSA_C_OFFSETS_TX,
NL80211_ATTR_MAX_CSA_COUNTERS,
@@ -2056,6 +2056,8 @@ enum nl80211_attrs {
 #define NL80211_ATTR_KEY NL80211_ATTR_KEY
 #define NL80211_ATTR_KEYS NL80211_ATTR_KEYS
 #define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
+#define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER
+#define NL80211_ATTR_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER
 
 #define NL80211_MAX_SUPP_RATES 32
 #define NL80211_MAX_SUPP_HT_RATES  77
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index d0a8361..df447c0 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -388,7 +388,7 @@ static const struct nla_policy 
nl80211_policy[NL80211_ATTR_MAX+1] = {
[NL80211_ATTR_MAC_HINT] = { .len = ETH_ALEN },
[NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 },
[NL80211_ATTR_TDLS_PEER_CAPABILITY] = { .type = NLA_U32 },
-   [NL80211_ATTR_IFACE_SOCKET_OWNER] = { .type = NLA_FLAG },
+   [NL80211_ATTR_SOCKET_OWNER] = { .type = NLA_FLAG },
[NL80211_ATTR_CSA_C_OFFSETS_TX] = { .type = NLA_BINARY },
[NL80211_ATTR_USE_RRM] = { .type = NLA_FLAG },
[NL80211_ATTR_TSID] = { .type = NLA_U8 },
@@ -2646,7 +2646,7 @@ static int nl80211_new_interface(struct sk_buff *skb, 
struct genl_info *info)
return PTR_ERR(wdev);
}
 
-   if (info-attrs[NL80211_ATTR_IFACE_SOCKET_OWNER])
+   if (info-attrs[NL80211_ATTR_SOCKET_OWNER])
wdev-owner_nlportid = info-snd_portid;
 
switch (type) {
-- 
1.8.3.1

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


[PATCH v2 0/2] Stop scheduled scan if netlink client disappears

2014-11-12 Thread Jukka Rissanen
Hi,

v2:

- split the patch
- In patch 1, use a generic NL80211_ATTR_SOCKET_OWNER attribute and
  convert the old code that uses NL80211_ATTR_IFACE_SOCKET_OWNER to
  use the new value. A define is provided for backward compatibility.
- Any pending schedule scan stop worker is cancelled when interface is
  taken down in patch 2

Cheers,
Jukka


Jukka Rissanen (2):
  nl80211: Replace interface socket owner attribute with more generic
one
  nl80211: Stop scheduled scan if netlink client disappears

 include/net/cfg80211.h   |  2 ++
 include/uapi/linux/nl80211.h | 11 ---
 net/wireless/core.c  | 10 +-
 net/wireless/nl80211.c   | 38 --
 4 files changed, 55 insertions(+), 6 deletions(-)

-- 
1.8.3.1

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


[PATCH v2 2/2] nl80211: Stop scheduled scan if netlink client disappears

2014-11-12 Thread Jukka Rissanen
An attribute NL80211_ATTR_SOCKET_OWNER can be set by the scan initiator.
If present, the attribute will cause the scan to be stopped if the client
dies.
---
 include/net/cfg80211.h   |  2 ++
 include/uapi/linux/nl80211.h |  3 +++
 net/wireless/core.c  | 10 +-
 net/wireless/nl80211.c   | 34 ++
 4 files changed, 48 insertions(+), 1 deletion(-)

diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 220d5f5..84378bf 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1512,6 +1512,8 @@ struct cfg80211_sched_scan_request {
struct wiphy *wiphy;
struct net_device *dev;
unsigned long scan_start;
+   u32 owner_nlportid;
+   struct work_struct sched_scan_stop_wk;
 
/* keep last */
struct ieee80211_channel *channels[0];
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index c410284..310dc9b 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1640,6 +1640,9 @@ enum nl80211_commands {
  * @NL80211_ATTR_SOCKET_OWNER: Flag attribute, if set during interface
  * creation then the new interface will be owned by the netlink socket
  * that created it and will be destroyed when the socket is closed.
+ * If set during scheduled scan start then the new scan req will be
+ * owned by the netlink socket that created it and the scheduled scan will
+ * be stopped when the socket is closed.
  *
  * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is
  * the TDLS link initiator.
diff --git a/net/wireless/core.c b/net/wireless/core.c
index a4d2792..88898d9 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -840,6 +840,8 @@ void __cfg80211_leave(struct cfg80211_registered_device 
*rdev,
  struct wireless_dev *wdev)
 {
struct net_device *dev = wdev-netdev;
+   struct cfg80211_sched_scan_request *sched_scan_req =
+   rdev-sched_scan_req;
 
ASSERT_RTNL();
ASSERT_WDEV_LOCK(wdev);
@@ -850,8 +852,10 @@ void __cfg80211_leave(struct cfg80211_registered_device 
*rdev,
break;
case NL80211_IFTYPE_P2P_CLIENT:
case NL80211_IFTYPE_STATION:
-   if (rdev-sched_scan_req  dev == rdev-sched_scan_req-dev)
+   if (sched_scan_req  dev == sched_scan_req-dev) {
+   cancel_work_sync(sched_scan_req-sched_scan_stop_wk);
__cfg80211_stop_sched_scan(rdev, false);
+   }
 
 #ifdef CONFIG_CFG80211_WEXT
kfree(wdev-wext.ie);
@@ -991,6 +995,10 @@ static int cfg80211_netdev_notifier_call(struct 
notifier_block *nb,
 
if (WARN_ON(rdev-sched_scan_req 
rdev-sched_scan_req-dev == wdev-netdev)) {
+   struct cfg80211_sched_scan_request *sched_scan_req =
+   rdev-sched_scan_req;
+
+   cancel_work_sync(sched_scan_req-sched_scan_stop_wk);
__cfg80211_stop_sched_scan(rdev, false);
}
 
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index df447c0..8fc500d 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5681,6 +5681,21 @@ static int nl80211_trigger_scan(struct sk_buff *skb, 
struct genl_info *info)
return err;
 }
 
+static void nl80211_sched_scan_stop_wk(struct work_struct *work)
+{
+   struct cfg80211_sched_scan_request *req;
+   struct cfg80211_registered_device *rdev;
+
+   req = container_of(work, struct cfg80211_sched_scan_request,
+  sched_scan_stop_wk);
+
+   rdev = wiphy_to_rdev(req-wiphy);
+
+   rtnl_lock();
+   __cfg80211_stop_sched_scan(rdev, false);
+   rtnl_unlock();
+}
+
 static int nl80211_start_sched_scan(struct sk_buff *skb,
struct genl_info *info)
 {
@@ -5955,6 +5970,13 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
 
err = rdev_sched_scan_start(rdev, dev, request);
if (!err) {
+   if (info-attrs[NL80211_ATTR_SOCKET_OWNER]) {
+   INIT_WORK(request-sched_scan_stop_wk,
+ nl80211_sched_scan_stop_wk);
+
+   request-owner_nlportid = info-snd_portid;
+   }
+
rdev-sched_scan_req = request;
nl80211_send_sched_scan(rdev, dev,
NL80211_CMD_START_SCHED_SCAN);
@@ -12127,6 +12149,12 @@ static int nl80211_netlink_notify(struct 
notifier_block * nb,
 
list_for_each_entry_rcu(rdev, cfg80211_rdev_list, list) {
bool schedule_destroy_work = false;
+   bool schedule_scan_stop = false;
+   struct cfg80211_sched_scan_request *req = rdev-sched_scan_req;
+
+   if (req  req-owner_nlportid == notify-portid 
+   

Re: [PATCH v2 1/2] nl80211: Replace interface socket owner attribute with more generic one

2014-11-12 Thread Luca Coelho
On Wed, 2014-11-12 at 13:36 +0200, Jukka Rissanen wrote:
 @@ -2056,6 +2056,8 @@ enum nl80211_attrs {
  #define NL80211_ATTR_KEY NL80211_ATTR_KEY
  #define NL80211_ATTR_KEYS NL80211_ATTR_KEYS
  #define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
 +#define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER
 +#define NL80211_ATTR_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER

The second define seems to be a mistake?

--
Luca.

--
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 1/2] nl80211: Replace interface socket owner attribute with more generic one

2014-11-12 Thread Johannes Berg
On Wed, 2014-11-12 at 13:47 +0200, Luca Coelho wrote:
 On Wed, 2014-11-12 at 13:36 +0200, Jukka Rissanen wrote:
  @@ -2056,6 +2056,8 @@ enum nl80211_attrs {
   #define NL80211_ATTR_KEY NL80211_ATTR_KEY
   #define NL80211_ATTR_KEYS NL80211_ATTR_KEYS
   #define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
  +#define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER
  +#define NL80211_ATTR_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER
 
 The second define seems to be a mistake?

Yes, both are wrong here. We played with defining some attributes to
themselves to allow #ifdef feature detection, but that didn't really
work out well and now we just copy nl80211.h to the userspace tools
needing a recent version. I think that's no longer needed now.

There should already be a second block of #ifdefs though that has
renamed ones, so you should add this one there.

Your patch is also missing signed-off-by.

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 v3 1/2] nl80211: Replace interface socket owner attribute with more generic one

2014-11-12 Thread Jukka Rissanen
Replace NL80211_ATTR_IFACE_SOCKET_OWNER attribute with more generic
NL80211_ATTR_SOCKET_OWNER that can be used with other commands
that interface creation.

Signed-off-by: Jukka Rissanen jukka.rissa...@linux.intel.com
---
 include/uapi/linux/nl80211.h | 7 ---
 net/wireless/nl80211.c   | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 442369f..185f9c7 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1637,9 +1637,9 @@ enum nl80211_commands {
  * @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32.
  * As specified in the enum nl80211_tdls_peer_capability.
  *
- * @NL80211_ATTR_IFACE_SOCKET_OWNER: flag attribute, if set during interface
+ * @NL80211_ATTR_SOCKET_OWNER: Flag attribute, if set during interface
  * creation then the new interface will be owned by the netlink socket
- * that created it and will be destroyed when the socket is closed
+ * that created it and will be destroyed when the socket is closed.
  *
  * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is
  * the TDLS link initiator.
@@ -2004,7 +2004,7 @@ enum nl80211_attrs {
 
NL80211_ATTR_TDLS_PEER_CAPABILITY,
 
-   NL80211_ATTR_IFACE_SOCKET_OWNER,
+   NL80211_ATTR_SOCKET_OWNER,
 
NL80211_ATTR_CSA_C_OFFSETS_TX,
NL80211_ATTR_MAX_CSA_COUNTERS,
@@ -2030,6 +2030,7 @@ enum nl80211_attrs {
 /* source-level API compatibility */
 #define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION
 #defineNL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG
+#define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER
 
 /*
  * Allow user space programs to use #ifdef on new attributes by defining them
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index d0a8361..df447c0 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -388,7 +388,7 @@ static const struct nla_policy 
nl80211_policy[NL80211_ATTR_MAX+1] = {
[NL80211_ATTR_MAC_HINT] = { .len = ETH_ALEN },
[NL80211_ATTR_WIPHY_FREQ_HINT] = { .type = NLA_U32 },
[NL80211_ATTR_TDLS_PEER_CAPABILITY] = { .type = NLA_U32 },
-   [NL80211_ATTR_IFACE_SOCKET_OWNER] = { .type = NLA_FLAG },
+   [NL80211_ATTR_SOCKET_OWNER] = { .type = NLA_FLAG },
[NL80211_ATTR_CSA_C_OFFSETS_TX] = { .type = NLA_BINARY },
[NL80211_ATTR_USE_RRM] = { .type = NLA_FLAG },
[NL80211_ATTR_TSID] = { .type = NLA_U8 },
@@ -2646,7 +2646,7 @@ static int nl80211_new_interface(struct sk_buff *skb, 
struct genl_info *info)
return PTR_ERR(wdev);
}
 
-   if (info-attrs[NL80211_ATTR_IFACE_SOCKET_OWNER])
+   if (info-attrs[NL80211_ATTR_SOCKET_OWNER])
wdev-owner_nlportid = info-snd_portid;
 
switch (type) {
-- 
1.8.3.1

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


Re: [PATCH 1/2] mac80211-hwsim: Factor out netlink attribute appending

2014-11-12 Thread Patrik Flykt
On Mon, 2014-11-10 at 10:32 +0100, Johannes Berg wrote:
 You seem to have lost the nlmsg_free() in error cases.

Indeed. Will fix.

Patrik

--
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] iwlwifi: dvm: Implement sta_rc_update() mac80211 callback

2014-11-12 Thread Grumbach, Emmanuel
 
 Perform rate scaling properly when operating in an IBSS. Prior to this, the
 5300 and 6205 devices (at least) would only transmit at
 1 Mbps to other stations in an IBSS. This now allows transmission at HT rates.
 
 Signed-off-by: David Ward david.w...@ll.mit.edu
 ---
  drivers/net/wireless/iwlwifi/dvm/mac80211.c | 17 +
  1 file changed, 17 insertions(+)
 
 diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c
 b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
 index 47e64e8..742218d 100644
 --- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c
 +++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
 @@ -940,6 +940,22 @@ static int iwlagn_mac_sta_state(struct
 ieee80211_hw *hw,
   return ret;
  }
 
 +static void iwlagn_mac_sta_rc_update(struct ieee80211_hw *hw,
 +  struct ieee80211_vif *vif,
 +  struct ieee80211_sta *sta, u32 changed) {
 + struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
 +
 + if (!(changed  IEEE80211_RC_SUPP_RATES_CHANGED))
 + return;
 +
 + /* Update rate scaling */
 + IWL_DEBUG_INFO(priv,
 +Updating rate scaling for station %pM\n,
 +sta-addr);
 + iwl_rs_rate_init(priv, sta, iwl_sta_id(sta)); }
 +
  static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
 struct ieee80211_vif *vif,
 struct ieee80211_channel_switch
 *ch_switch) @@ -1610,6 +1626,7 @@ const struct ieee80211_ops
 iwlagn_hw_ops = {
   .hw_scan = iwlagn_mac_hw_scan,
   .sta_notify = iwlagn_mac_sta_notify,
   .sta_state = iwlagn_mac_sta_state,
 + .sta_rc_update = iwlagn_mac_sta_rc_update,

Well - this would be called in other flows as well. For example, when we 
receive a beacon that changes the bandwidth or alike. I am not sure we want to 
re-init the rate scale data in this case, and more importantly, I am not sure 
it will not race with the tx / tx_status path that updates / uses the rate 
scale data.

   .channel_switch = iwlagn_mac_channel_switch,
   .flush = iwlagn_mac_flush,
   .tx_last_beacon = iwlagn_mac_tx_last_beacon,
 --
 1.9.1

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


[PATCH v3] nl80211: Broadcast CMD_NEW_INTERFACE and CMD_DEL_INTERFACE

2014-11-12 Thread Tomasz Bursztyka
Let the other listeners being notified when a new or del interface
command has been issued, thus reducing later necessary request to be in
sync with current context.

Signed-off-by: Tomasz Bursztyka tomasz.burszt...@linux.intel.com
---
 net/wireless/nl80211.c | 48 +---
 1 file changed, 41 insertions(+), 7 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 1a31736..653c337 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2341,12 +2341,16 @@ static int nl80211_send_chandef(struct sk_buff *msg,
 
 static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int 
flags,
  struct cfg80211_registered_device *rdev,
- struct wireless_dev *wdev)
+ struct wireless_dev *wdev, bool removal)
 {
struct net_device *dev = wdev-netdev;
+   u8 cmd = NL80211_CMD_NEW_INTERFACE;
void *hdr;
 
-   hdr = nl80211hdr_put(msg, portid, seq, flags, 
NL80211_CMD_NEW_INTERFACE);
+   if (removal)
+   cmd = NL80211_CMD_DEL_INTERFACE;
+
+   hdr = nl80211hdr_put(msg, portid, seq, flags, cmd);
if (!hdr)
return -1;
 
@@ -2413,7 +2417,7 @@ static int nl80211_dump_interface(struct sk_buff *skb, 
struct netlink_callback *
}
if (nl80211_send_iface(skb, NETLINK_CB(cb-skb).portid,
   cb-nlh-nlmsg_seq, NLM_F_MULTI,
-  rdev, wdev)  0) {
+  rdev, wdev, false)  0) {
goto out;
}
if_idx++;
@@ -2441,7 +2445,7 @@ static int nl80211_get_interface(struct sk_buff *skb, 
struct genl_info *info)
return -ENOMEM;
 
if (nl80211_send_iface(msg, info-snd_portid, info-snd_seq, 0,
-  rdev, wdev)  0) {
+  rdev, wdev, false)  0) {
nlmsg_free(msg);
return -ENOBUFS;
}
@@ -2587,7 +2591,7 @@ static int nl80211_new_interface(struct sk_buff *skb, 
struct genl_info *info)
struct cfg80211_registered_device *rdev = info-user_ptr[0];
struct vif_params params;
struct wireless_dev *wdev;
-   struct sk_buff *msg;
+   struct sk_buff *msg, *event;
int err;
enum nl80211_iftype type = NL80211_IFTYPE_UNSPECIFIED;
u32 flags;
@@ -2682,11 +2686,25 @@ static int nl80211_new_interface(struct sk_buff *skb, 
struct genl_info *info)
}
 
if (nl80211_send_iface(msg, info-snd_portid, info-snd_seq, 0,
-  rdev, wdev)  0) {
+  rdev, wdev, false)  0) {
nlmsg_free(msg);
return -ENOBUFS;
}
 
+   event = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+   if (event) {
+   if (nl80211_send_iface(event, 0, 0, 0,
+  rdev, wdev, false)  0) {
+   nlmsg_free(event);
+   goto out;
+   }
+
+   genlmsg_multicast_netns(nl80211_fam, wiphy_net(rdev-wiphy),
+   event, 0, NL80211_MCGRP_CONFIG,
+   GFP_KERNEL);
+   }
+
+out:
return genlmsg_reply(msg, info);
 }
 
@@ -2694,10 +2712,18 @@ static int nl80211_del_interface(struct sk_buff *skb, 
struct genl_info *info)
 {
struct cfg80211_registered_device *rdev = info-user_ptr[0];
struct wireless_dev *wdev = info-user_ptr[1];
+   struct sk_buff *msg;
+   int status;
 
if (!rdev-ops-del_virtual_intf)
return -EOPNOTSUPP;
 
+   msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+   if (msg  nl80211_send_iface(msg, 0, 0, 0, rdev, wdev, true)  0) {
+   nlmsg_free(msg);
+   msg = NULL;
+   }
+
/*
 * If we remove a wireless device without a netdev then clear
 * user_ptr[1] so that nl80211_post_doit won't dereference it
@@ -2708,7 +2734,15 @@ static int nl80211_del_interface(struct sk_buff *skb, 
struct genl_info *info)
if (!wdev-netdev)
info-user_ptr[1] = NULL;
 
-   return rdev_del_virtual_intf(rdev, wdev);
+   status = rdev_del_virtual_intf(rdev, wdev);
+   if (status = 0  msg)
+   genlmsg_multicast_netns(nl80211_fam, wiphy_net(rdev-wiphy),
+   msg, 0, NL80211_MCGRP_CONFIG,
+   GFP_KERNEL);
+   else
+   nlmsg_free(msg);
+
+   return status;
 }
 
 static int nl80211_set_noack_map(struct sk_buff *skb, struct genl_info *info)
-- 
2.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to 

Re: [PATCH] iwlwifi: dvm: Implement sta_rc_update() mac80211 callback

2014-11-12 Thread Michal Kazior
On 12 November 2014 07:26, David Ward david.w...@ll.mit.edu wrote:
[...]
 +static void iwlagn_mac_sta_rc_update(struct ieee80211_hw *hw,
 +struct ieee80211_vif *vif,
 +struct ieee80211_sta *sta, u32 changed)
 +{
 +   struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
 +
 +   if (!(changed  IEEE80211_RC_SUPP_RATES_CHANGED))
 +   return;
 +
 +   /* Update rate scaling */
 +   IWL_DEBUG_INFO(priv,
 +  Updating rate scaling for station %pM\n,
 +  sta-addr);
 +   iwl_rs_rate_init(priv, sta, iwl_sta_id(sta));

sta_rc_update() must be atomic. I'm not really familiar with iwl that
much but it seems to me iwl_rs_rate_init() - iwl_send_lq_cmd(..., 0,
true) can sleep, no?


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


RE: [PATCH] iwlwifi: dvm: Implement sta_rc_update() mac80211 callback

2014-11-12 Thread Grumbach, Emmanuel
 On 12 November 2014 07:26, David Ward david.w...@ll.mit.edu wrote:
 [...]
  +static void iwlagn_mac_sta_rc_update(struct ieee80211_hw *hw,
  +struct ieee80211_vif *vif,
  +struct ieee80211_sta *sta, u32
  +changed) {
  +   struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
  +
  +   if (!(changed  IEEE80211_RC_SUPP_RATES_CHANGED))
  +   return;
  +
  +   /* Update rate scaling */
  +   IWL_DEBUG_INFO(priv,
  +  Updating rate scaling for station %pM\n,
  +  sta-addr);
  +   iwl_rs_rate_init(priv, sta, iwl_sta_id(sta));
 
 sta_rc_update() must be atomic. I'm not really familiar with iwl that much but
 it seems to me iwl_rs_rate_init() - iwl_send_lq_cmd(..., 0,
 true) can sleep, no?
 
 
Yes - good point.
N�r��yb�X��ǧv�^�)޺{.n�+{��*ޕ�,�{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�mzZ+�ݢj��!�i

MAC acl equivalent to iwpriv for nl80211 drivers

2014-11-12 Thread Patrick Bosch
Hello everybody

I hope I do post this in the correct mailing list.

My problem is the following:

I want to add/delete new MAC addresses to the acl without restarting
anything. Without restarting I mean that there shouldn't be a time frame
where no beacon frames are sent. This happened to me on an OpenWRT
router and I want to avoid this effect.

It seems to me that iwpriv offers exactly this functionality. You can add
a list of MAC addresses and define how they should be handled. Iw
doesn't seem to offer this option. Is there any other way to get this
functionality? 

Another question would be, if there is a way to forge management
frames, similar to what hostapd_cli can do for deauthentication and
disassociation frames? 

Any help is appreciated!

Kind regards
Patrick


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


[PATCH v2 1/2] mac80211-hwsim: Factor out netlink attribute appending

2014-11-12 Thread Patrik Flykt
Factor out netlink message attribute appending in order to reuse it
with later code. As a result move netlink skb allocation to the
calling function.

Signed-off-by: Patrik Flykt patrik.fl...@linux.intel.com
---

v2: Free skb in error path

 drivers/net/wireless/mac80211_hwsim.c | 60 +--
 1 file changed, 30 insertions(+), 30 deletions(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c 
b/drivers/net/wireless/mac80211_hwsim.c
index 58f11bb..804c92f 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2107,36 +2107,26 @@ static void hwsim_mcast_config_msg(struct sk_buff 
*mcast_skb,
  HWSIM_MCGRP_CONFIG, GFP_KERNEL);
 }
 
-static struct sk_buff *build_radio_msg(int cmd, int id,
-  struct hwsim_new_radio_params *param)
+static int append_radio_msg(struct sk_buff *skb, int id,
+   struct hwsim_new_radio_params *param)
 {
-   struct sk_buff *skb;
-   void *data;
int ret;
 
-   skb = genlmsg_new(GENLMSG_DEFAULT_SIZE, GFP_KERNEL);
-   if (!skb)
-   return NULL;
-
-   data = genlmsg_put(skb, 0, 0, hwsim_genl_family, 0, cmd);
-   if (!data)
-   goto error;
-
ret = nla_put_u32(skb, HWSIM_ATTR_RADIO_ID, id);
if (ret  0)
-   goto error;
+   return ret;
 
if (param-channels) {
ret = nla_put_u32(skb, HWSIM_ATTR_CHANNELS, param-channels);
if (ret  0)
-   goto error;
+   return ret;
}
 
if (param-reg_alpha2) {
ret = nla_put(skb, HWSIM_ATTR_REG_HINT_ALPHA2, 2,
  param-reg_alpha2);
if (ret  0)
-   goto error;
+   return ret;
}
 
if (param-regd) {
@@ -2149,54 +2139,64 @@ static struct sk_buff *build_radio_msg(int cmd, int id,
if (i  ARRAY_SIZE(hwsim_world_regdom_custom)) {
ret = nla_put_u32(skb, HWSIM_ATTR_REG_CUSTOM_REG, i);
if (ret  0)
-   goto error;
+   return ret;
}
}
 
if (param-reg_strict) {
ret = nla_put_flag(skb, HWSIM_ATTR_REG_STRICT_REG);
if (ret  0)
-   goto error;
+   return ret;
}
 
if (param-p2p_device) {
ret = nla_put_flag(skb, HWSIM_ATTR_SUPPORT_P2P_DEVICE);
if (ret  0)
-   goto error;
+   return ret;
}
 
if (param-use_chanctx) {
ret = nla_put_flag(skb, HWSIM_ATTR_USE_CHANCTX);
if (ret  0)
-   goto error;
+   return ret;
}
 
if (param-hwname) {
ret = nla_put(skb, HWSIM_ATTR_RADIO_NAME,
  strlen(param-hwname), param-hwname);
if (ret  0)
-   goto error;
+   return ret;
}
 
-   genlmsg_end(skb, data);
-
-   return skb;
-
-error:
-   nlmsg_free(skb);
-   return NULL;
+   return 0;
 }
 
-static void hswim_mcast_new_radio(int id, struct genl_info *info,
+static void hwsim_mcast_new_radio(int id, struct genl_info *info,
  struct hwsim_new_radio_params *param)
 {
struct sk_buff *mcast_skb;
+   void *data;
 
-   mcast_skb = build_radio_msg(HWSIM_CMD_NEW_RADIO, id, param);
+   mcast_skb = genlmsg_new(GENLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (!mcast_skb)
return;
 
+   data = genlmsg_put(mcast_skb, 0, 0, hwsim_genl_family, 0,
+  HWSIM_CMD_NEW_RADIO);
+   if (!data)
+   goto out_err;
+
+   if (append_radio_msg(mcast_skb, id, param)  0)
+   goto out_err;
+
+   genlmsg_end(mcast_skb, data);
+
hwsim_mcast_config_msg(mcast_skb, info);
+   return;
+
+out_err:
+   genlmsg_cancel(mcast_skb, data);
+   nlmsg_free(mcast_skb);
 }
 
 static int mac80211_hwsim_new_radio(struct genl_info *info,
@@ -2442,7 +2442,7 @@ static int mac80211_hwsim_new_radio(struct genl_info 
*info,
spin_unlock_bh(hwsim_radio_lock);
 
if (idx  0)
-   hswim_mcast_new_radio(idx, info, param);
+   hwsim_mcast_new_radio(idx, info, param);
 
return idx;
 
-- 
2.1.1

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


[PATCH v2 0/2] Add HWSIM_CMD_GET_RADIO command

2014-11-12 Thread Patrik Flykt

Hi,

v2:
- Free skb in the error path in patch 01
- Fix dumping of hwsim radios in patch 02. Remember the last radio id used
  when adding radios to the previous netlink message and continue from this
  radio id onwards.


Cheers,

Patrik


This patch set adds a new HWSIM_CMD_GET_RADIO command to mac80211_hwsim
which allows a user space application to dump a list of all hwsim radios
in the system. HWSIM_CMD_GET_RADIO can also return information about a
specific hwsim radio whose radio id is given with HWSIM_ATTR_RADIO_ID.

The first patch factors out netlink attribute appending from netlink
message creation so that the same information can be appended to
HWSIM_CMD_GET_RADIO replies as is already sent by multicast when issuing
a HWSIM_CMD_CREATE_RADIO command.

Patch 2/2 adds the new command providing means to dump all or one of the
existing radios. Regulatory data is saved to the hwsim struct as it
seems difficult to access it otherwise when needed.


Patrik Flykt (2):
  mac80211-hwsim: Factor out netlink attribute appending
  mac80211-hwsim: Add HWSIM_CMD_GET_RADIO command

 drivers/net/wireless/mac80211_hwsim.c | 183 --
 drivers/net/wireless/mac80211_hwsim.h |   3 +
 2 files changed, 155 insertions(+), 31 deletions(-)

-- 
2.1.1

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


[PATCH v2 2/2] mac80211-hwsim: Add HWSIM_CMD_GET_RADIO command

2014-11-12 Thread Patrik Flykt
HWSIM_CMD_GET_RADIO returns information about a specific radio id or
all of them in response to a dump. Create the netlink skb or use the
one provided by the dump functionality. Use the existing attribute
appending function to fill in the same attributes when creating a
new hwsim radio.

Save alpha2 and struct ieee80211_regdomain in the hwsim data or else
they will be lost in the depths of regulatory infrastructure.

Signed-off-by: Patrik Flykt patrik.fl...@linux.intel.com
---

v2: Fix dumping of hwsim radios by remembering the radio id from which
to start the next netlink message

 drivers/net/wireless/mac80211_hwsim.c | 123 +-
 drivers/net/wireless/mac80211_hwsim.h |   3 +
 2 files changed, 125 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c 
b/drivers/net/wireless/mac80211_hwsim.c
index 804c92f..3d6059b 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -415,6 +415,8 @@ struct mac80211_hwsim_data {
bool destroy_on_close;
struct work_struct destroy_work;
u32 portid;
+   char alpha2[2];
+   const struct ieee80211_regdomain *regd;
 
struct ieee80211_channel *tmp_chan;
struct delayed_work roc_done;
@@ -2403,6 +2405,7 @@ static int mac80211_hwsim_new_radio(struct genl_info 
*info,
if (param-reg_strict)
hw-wiphy-regulatory_flags |= REGULATORY_STRICT_REG;
if (param-regd) {
+   data-regd = param-regd;
hw-wiphy-regulatory_flags |= REGULATORY_CUSTOM_REG;
wiphy_apply_custom_regulatory(hw-wiphy, param-regd);
/* give the regulatory workqueue a chance to run */
@@ -2421,8 +2424,11 @@ static int mac80211_hwsim_new_radio(struct genl_info 
*info,
 
wiphy_debug(hw-wiphy, hwaddr %pM registered\n, hw-wiphy-perm_addr);
 
-   if (param-reg_alpha2)
+   if (param-reg_alpha2) {
+   data-alpha2[0] = param-reg_alpha2[0];
+   data-alpha2[1] = param-reg_alpha2[1];
regulatory_hint(hw-wiphy, param-reg_alpha2);
+   }
 
data-debugfs = debugfs_create_dir(hwsim, hw-wiphy-debugfsdir);
debugfs_create_file(ps, 0666, data-debugfs, data, hwsim_fops_ps);
@@ -2503,6 +2509,44 @@ static void mac80211_hwsim_del_radio(struct 
mac80211_hwsim_data *data,
ieee80211_free_hw(data-hw);
 }
 
+static int mac80211_hwsim_get_radio(struct sk_buff *skb,
+   struct mac80211_hwsim_data *data,
+   u32 portid, u32 seq,
+   struct netlink_callback *cb, int flags)
+{
+   void *hdr;
+   struct hwsim_new_radio_params param = { };
+   int res = -EMSGSIZE;
+
+   hdr = genlmsg_put(skb, portid, seq, hwsim_genl_family, flags,
+ HWSIM_CMD_GET_RADIO);
+   if (!hdr)
+   return -EMSGSIZE;
+
+   if (cb)
+   genl_dump_check_consistent(cb, hdr, hwsim_genl_family);
+
+   param.reg_alpha2 = data-alpha2;
+   param.reg_strict = !!(data-hw-wiphy-regulatory_flags 
+   REGULATORY_STRICT_REG);
+   param.p2p_device = !!(data-hw-wiphy-interface_modes 
+   BIT(NL80211_IFTYPE_P2P_DEVICE));
+   param.use_chanctx = data-use_chanctx;
+   param.regd = data-regd;
+   param.channels = data-channels;
+   param.hwname = wiphy_name(data-hw-wiphy);
+
+   res = append_radio_msg(skb, data-idx, param);
+   if (res  0)
+   goto out_err;
+
+   return genlmsg_end(skb, hdr);
+
+out_err:
+   genlmsg_cancel(skb, hdr);
+   return res;
+}
+
 static void mac80211_hwsim_free(void)
 {
struct mac80211_hwsim_data *data;
@@ -2807,6 +2851,77 @@ static int hwsim_del_radio_nl(struct sk_buff *msg, 
struct genl_info *info)
return -ENODEV;
 }
 
+static int hwsim_get_radio_nl(struct sk_buff *msg, struct genl_info *info)
+{
+   struct mac80211_hwsim_data *data;
+   struct sk_buff *skb;
+   int idx, res = -ENODEV;
+
+   if (!info-attrs[HWSIM_ATTR_RADIO_ID])
+   return -EINVAL;
+   idx = nla_get_u32(info-attrs[HWSIM_ATTR_RADIO_ID]);
+
+   spin_lock_bh(hwsim_radio_lock);
+   list_for_each_entry(data, hwsim_radios, list) {
+   if (data-idx != idx)
+   continue;
+
+   skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+   if (!skb) {
+   res = -ENOMEM;
+   goto out_err;
+   }
+
+   res = mac80211_hwsim_get_radio(skb, data, info-snd_portid,
+  info-snd_seq, NULL, 0);
+   if (res  0) {
+   nlmsg_free(skb);
+   goto out_err;
+   }
+
+   genlmsg_reply(skb, info);
+   break;
+   }
+
+out_err:
+   

Re: Looking for someone with BCM43227 and (maybe) compilation skill ; )

2014-11-12 Thread Ruben De Smet
On 08/28/2014 02:39 PM, Rafał Miłecki wrote:
 It has appeared that BCM43227 and BCM43228 are pretty much identical
 from programming POV. You can try 3.17-rc1 (or newer) to see if it
 supports your wireless card :)

Hi!

Today Fedora 20 updated to 3.17 and so I was pretty eager to try b43
instead of wl. It didn't work like I hoped it would; networkmanager was
able to scan but not to connect with my BCM43228.
I've ordered an Intel WiFi card some days ago. So if the b43 team wants
to, I can send a developer my BCM card for free for developing, reverse
engineering and debugging purposes.

(I googled an excerpt of the dmesg error message (because it had a MAC
address in it I didn't want to give to Google), but I forgot to write
down the original message:

deauthenticating by local choice (Reason: 3=DEAUTH_LEAVING)

Ruben



signature.asc
Description: OpenPGP digital signature


Re: Vendor Namespace Question

2014-11-12 Thread C. McPherson
I've been off for a while, but I will download it and use it. Thanks 
Johannes!!



On 11/06/2014 05:31 PM, Johannes Berg wrote:

On Tue, 2014-11-04 at 15:18 -0500, C. McPherson wrote:

Thanks so much for the info Johannes. I did notice that rx_status was
getting full.  I'll go ahead and put it in skb-data, that's a good idea.

I just sent a patch to restore vendor radiotap stuff in mac80211.

Works for me, and I might actually have a use case for it, but please
tell me if you have issues with 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 majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: MAC acl equivalent to iwpriv for nl80211 drivers

2014-11-12 Thread Dan Williams
On Wed, 2014-11-12 at 14:31 +, Patrick Bosch wrote:
 Hello everybody
 
 I hope I do post this in the correct mailing list.
 
 My problem is the following:
 
 I want to add/delete new MAC addresses to the acl without restarting
 anything. Without restarting I mean that there shouldn't be a time frame
 where no beacon frames are sent. This happened to me on an OpenWRT
 router and I want to avoid this effect.

This would be something that should be done with hostapd or whatever is
actually managing the AP mode.  It looks like the procedure here is to
update your deny MAC and accept MAC files, then issue the
hostapd_cli command SET deny_mac_file /path/to/deny and SET
accept_mac_file /path/to/accept commands, which will immediately
disconnect any clients that aren't in the ACL, without restarting
anything.

 It seems to me that iwpriv offers exactly this functionality. You can add
 a list of MAC addresses and define how they should be handled. Iw
 doesn't seem to offer this option. Is there any other way to get this
 functionality? 

iwpriv is simply a driver passthrough, it doesn't offer any
functionality other than push this random data to the driver in a
slightly formatted way.  The options are defined by the driver itself.
The upstream kernel wifi community is trying very hard to *not* allow
this sort of functionality, at least as it has been used in the past
with iwpriv, since almost the stuff iwpriv used to do, can be done in a
more standard way with 'iw', or should be done elsewhere
(wpa_supplicant, hostapd).

Dan

 Another question would be, if there is a way to forge management
 frames, similar to what hostapd_cli can do for deauthentication and
 disassociation frames? 
 
 Any help is appreciated!

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


Re: MediaTek WiFi hardware support in upstream kernel

2014-11-12 Thread Felix Fietkau
On 2014-11-11 12:55, Oleksij Rempel wrote:
 Am 29.10.2014 um 11:17 schrieb Felix Fietkau:
 Hi Hackers,
 
 Just a quick heads up:
 I'm working on a new driver for MT7662E/MT7612E, written from scratch.
 It is already able to bring up the firmware, init the MAC and do basic
 TX/RX DMA communication with the firmware.
 I've decided to not integrate it with rt2x00, because I want to avoid
 dealing with the the unnecessarily convoluted abstractions and legacy
 code in there. I believe the result will be simpler and easier to
 maintain as a new driver.
 As soon as the basic structure is in place, I will put it on a public
 git tree and post a link here.
 
 - Felix
 
 Which chip would you suggest for starting?
The chips I'm working with are both MT7662 and MT7612. My driver already
works as a simple AP or station in 802.11n mode with some limited
aggregation support. I'm getting around 45-50 Mbit/s TCP throughput on
HT20 with iperf. I will post code soon, stay tuned!

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


[PATCH 2/8] staging: vt6655: card.c move __iomem into functions.

2014-11-12 Thread Malcolm Priestley
Removing dereferencing from callers

Signed-off-by: Malcolm Priestley tvbox...@gmail.com
---
 drivers/staging/vt6655/card.c| 18 --
 drivers/staging/vt6655/card.h|  8 
 drivers/staging/vt6655/device_main.c |  7 +++
 drivers/staging/vt6655/rxtx.c|  2 +-
 4 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index a93ca16..a079640 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -394,7 +394,7 @@ bool CARDbSetBeaconPeriod(struct vnt_private *pDevice,
 {
u64 qwNextTBTT = 0;
 
-   CARDbGetCurrentTSF(pDevice-PortOffset, qwNextTBTT); /* Get Local TSF 
counter */
+   CARDbGetCurrentTSF(pDevice, qwNextTBTT); /* Get Local TSF counter */
 
qwNextTBTT = CARDqGetNextTBTT(qwNextTBTT, wBeaconInterval);
 
@@ -828,8 +828,10 @@ unsigned char CARDbyGetPktType(struct vnt_private *pDevice)
  *
  * Return Value: none
  */
-void CARDvSetLoopbackMode(void __iomem *dwIoBase, unsigned short wLoopbackMode)
+void CARDvSetLoopbackMode(struct vnt_private *priv, unsigned short 
wLoopbackMode)
 {
+   void __iomem *dwIoBase = priv-PortOffset;
+
switch (wLoopbackMode) {
case CARD_LB_NONE:
case CARD_LB_MAC:
@@ -905,8 +907,9 @@ u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, 
u64 qwTSF2)
  *
  * Return Value: true if success; otherwise false
  */
-bool CARDbGetCurrentTSF(void __iomem *dwIoBase, u64 *pqwCurrTSF)
+bool CARDbGetCurrentTSF(struct vnt_private *priv, u64 *pqwCurrTSF)
 {
+   void __iomem *dwIoBase = priv-PortOffset;
unsigned short ww;
unsigned char byData;
 
@@ -964,11 +967,12 @@ u64 CARDqGetNextTBTT(u64 qwTSF, unsigned short 
wBeaconInterval)
  *
  * Return Value: none
  */
-void CARDvSetFirstNextTBTT(void __iomem *dwIoBase, unsigned short 
wBeaconInterval)
+void CARDvSetFirstNextTBTT(struct vnt_private *priv, unsigned short 
wBeaconInterval)
 {
+   void __iomem *dwIoBase = priv-PortOffset;
u64 qwNextTBTT = 0;
 
-   CARDbGetCurrentTSF(dwIoBase, qwNextTBTT); /* Get Local TSF counter */
+   CARDbGetCurrentTSF(priv, qwNextTBTT); /* Get Local TSF counter */
 
qwNextTBTT = CARDqGetNextTBTT(qwNextTBTT, wBeaconInterval);
/* Set NextTBTT */
@@ -991,8 +995,10 @@ void CARDvSetFirstNextTBTT(void __iomem *dwIoBase, 
unsigned short wBeaconInterva
  *
  * Return Value: none
  */
-void CARDvUpdateNextTBTT(void __iomem *dwIoBase, u64 qwTSF, unsigned short 
wBeaconInterval)
+void CARDvUpdateNextTBTT(struct vnt_private *priv, u64 qwTSF, unsigned short 
wBeaconInterval)
 {
+   void __iomem *dwIoBase = priv-PortOffset;
+
qwTSF = CARDqGetNextTBTT(qwTSF, wBeaconInterval);
/* Set NextTBTT */
VNSvOutPortD(dwIoBase + MAC_REG_NEXTTBTT, (u32)qwTSF);
diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h
index 2e56710..2dfc419 100644
--- a/drivers/staging/vt6655/card.h
+++ b/drivers/staging/vt6655/card.h
@@ -69,11 +69,11 @@ struct vnt_private;
 void CARDvSetRSPINF(struct vnt_private *, u8);
 void CARDvUpdateBasicTopRate(struct vnt_private *);
 bool CARDbIsOFDMinBasicRate(struct vnt_private *);
-void CARDvSetLoopbackMode(void __iomem *dwIoBase, unsigned short 
wLoopbackMode);
+void CARDvSetLoopbackMode(struct vnt_private *, unsigned short wLoopbackMode);
 bool CARDbSoftwareReset(struct vnt_private *);
-void CARDvSetFirstNextTBTT(void __iomem *dwIoBase, unsigned short 
wBeaconInterval);
-void CARDvUpdateNextTBTT(void __iomem *dwIoBase, u64 qwTSF, unsigned short 
wBeaconInterval);
-bool CARDbGetCurrentTSF(void __iomem *dwIoBase, u64 *pqwCurrTSF);
+void CARDvSetFirstNextTBTT(struct vnt_private *, unsigned short 
wBeaconInterval);
+void CARDvUpdateNextTBTT(struct vnt_private *, u64 qwTSF, unsigned short 
wBeaconInterval);
+bool CARDbGetCurrentTSF(struct vnt_private *, u64 *pqwCurrTSF);
 u64 CARDqGetNextTBTT(u64 qwTSF, unsigned short wBeaconInterval);
 u64 CARDqGetTSFOffset(unsigned char byRxRate, u64 qwTSF1, u64 qwTSF2);
 unsigned char CARDbyGetPktType(struct vnt_private *);
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 1392332..83e4162 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1513,8 +1513,7 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw,
 
CARDbSetBeaconPeriod(priv, conf-beacon_int);
 
-   CARDvSetFirstNextTBTT(priv-PortOffset,
- conf-beacon_int);
+   CARDvSetFirstNextTBTT(priv, conf-beacon_int);
} else {
VNSvOutPortB(priv-PortOffset + MAC_REG_TFTCTL,
 TFTCTL_TSFCNTRST);
@@ -1633,7 +1632,7 @@ static u64 vnt_get_tsf(struct ieee80211_hw *hw, struct 
ieee80211_vif *vif)
struct vnt_private *priv = hw-priv;
u64 tsf;
 
-   

[PATCH 1/8] staging: vt6655: card Remove function vUpdateIFS

2014-11-12 Thread Malcolm Priestley
vUpdateIFS does the same operations of CARDbSetPhyParameter there
is not need to call this function.

Signed-off-by: Malcolm Priestley tvbox...@gmail.com
---
 drivers/staging/vt6655/card.c| 65 
 drivers/staging/vt6655/card.h|  1 -
 drivers/staging/vt6655/device_main.c |  1 -
 3 files changed, 67 deletions(-)

diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 532c3c8..a93ca16 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -21,7 +21,6 @@
  * Functions:
  *  s_vSafeResetTx - Rest Tx
  *  CARDvSetRSPINF - Set RSPINF
- *  vUpdateIFS - Update slotTime,SIFS,DIFS, and EIFS
  *  CARDvUpdateBasicTopRate - Update BasicTopRate
  *  CARDbAddBasicRate - Add to BasicRateSet
  *  CARDbIsOFDMinBasicRate - Check if any OFDM rate is in BasicRateSet
@@ -770,70 +769,6 @@ void CARDvSetRSPINF(struct vnt_private *pDevice, u8 
bb_type)
MACvSelectPage0(pDevice-PortOffset);
 }
 
-/*
- * Description: Update IFS
- *
- * Parameters:
- *  In:
- *  pDevice - The adapter to be set
- *  Out:
- *  none
- *
- * Return Value: None.
- */
-void vUpdateIFS(struct vnt_private *pDevice)
-{
-   /* Set SIFS, DIFS, EIFS, SlotTime, CwMin */
-
-   unsigned char byMaxMin = 0;
-
-   if (pDevice-byPacketType == PK_TYPE_11A) { /*   ,11a*/
-   pDevice-uSlot = C_SLOT_SHORT;
-   pDevice-uSIFS = C_SIFS_A;
-   pDevice-uDIFS = C_SIFS_A + 2*C_SLOT_SHORT;
-   pDevice-uCwMin = C_CWMIN_A;
-   byMaxMin = 4;
-   } else if (pDevice-byPacketType == PK_TYPE_11B) {
-   /*  0001  ,11b */
-   pDevice-uSlot = C_SLOT_LONG;
-   pDevice-uSIFS = C_SIFS_BG;
-   pDevice-uDIFS = C_SIFS_BG + 2*C_SLOT_LONG;
-   pDevice-uCwMin = C_CWMIN_B;
-   byMaxMin = 5;
-   } else { /* PK_TYPE_11GA  PK_TYPE_11GB */
-   pDevice-uSIFS = C_SIFS_BG;
-   if (pDevice-bShortSlotTime)
-   pDevice-uSlot = C_SLOT_SHORT;
-   else
-   pDevice-uSlot = C_SLOT_LONG;
-
-   pDevice-uDIFS = C_SIFS_BG + 2*pDevice-uSlot;
-   if (pDevice-wBasicRate  0x0150) {
-   /*  0001 0101 ,24M,12M,6M */
-   pDevice-uCwMin = C_CWMIN_A;
-   byMaxMin = 4;
-   } else {
-   pDevice-uCwMin = C_CWMIN_B;
-   byMaxMin = 5;
-   }
-   }
-
-   pDevice-uCwMax = C_CWMAX;
-   pDevice-uEIFS = C_EIFS;
-   if (pDevice-byRFType == RF_RFMD2959) {
-   /* bcs TX_PE will reserve 3 us */
-   VNSvOutPortB(pDevice-PortOffset + MAC_REG_SIFS, (unsigned 
char)(pDevice-uSIFS - 3));
-   VNSvOutPortB(pDevice-PortOffset + MAC_REG_DIFS, (unsigned 
char)(pDevice-uDIFS - 3));
-   } else {
-   VNSvOutPortB(pDevice-PortOffset + MAC_REG_SIFS, (unsigned 
char)pDevice-uSIFS);
-   VNSvOutPortB(pDevice-PortOffset + MAC_REG_DIFS, (unsigned 
char)pDevice-uDIFS);
-   }
-   VNSvOutPortB(pDevice-PortOffset + MAC_REG_EIFS, (unsigned 
char)pDevice-uEIFS);
-   VNSvOutPortB(pDevice-PortOffset + MAC_REG_SLOT, (unsigned 
char)pDevice-uSlot);
-   byMaxMin |= 0xA0; /* 1010 ,C_CWMAX = 1023 */
-   VNSvOutPortB(pDevice-PortOffset + MAC_REG_CWMAXMIN0, (unsigned 
char)byMaxMin);
-}
-
 void CARDvUpdateBasicTopRate(struct vnt_private *pDevice)
 {
unsigned char byTopOFDM = RATE_24M, byTopCCK = RATE_1M;
diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h
index 605d8a8..2e56710 100644
--- a/drivers/staging/vt6655/card.h
+++ b/drivers/staging/vt6655/card.h
@@ -67,7 +67,6 @@ typedef enum _CARD_STATUS_TYPE {
 struct vnt_private;
 
 void CARDvSetRSPINF(struct vnt_private *, u8);
-void vUpdateIFS(struct vnt_private *);
 void CARDvUpdateBasicTopRate(struct vnt_private *);
 bool CARDbIsOFDMinBasicRate(struct vnt_private *);
 void CARDvSetLoopbackMode(void __iomem *dwIoBase, unsigned short 
wLoopbackMode);
diff --git a/drivers/staging/vt6655/device_main.c 
b/drivers/staging/vt6655/device_main.c
index 2e31784..1392332 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1485,7 +1485,6 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw,
else
priv-bShortSlotTime = false;
 
-   vUpdateIFS(priv);
CARDbSetPhyParameter(priv, priv-byBBType);
BBvSetVGAGainOffset(priv, priv-abyBBVGA[0]);
}
-- 
2.1.0

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


[PATCH 3/8] staging: vt6655: rf remove __iomem *dwIoBase from functions

2014-11-12 Thread Malcolm Priestley
replacing with vnt_private and removing dereferencing from callers

Signed-off-by: Malcolm Priestley tvbox...@gmail.com
---
 drivers/staging/vt6655/channel.c |  8 +---
 drivers/staging/vt6655/rf.c  | 25 -
 drivers/staging/vt6655/rf.h  |  6 +++---
 3 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/vt6655/channel.c b/drivers/staging/vt6655/channel.c
index cc1bc94..c8f739d 100644
--- a/drivers/staging/vt6655/channel.c
+++ b/drivers/staging/vt6655/channel.c
@@ -188,14 +188,16 @@ bool set_channel(void *pDeviceHandler, unsigned int 
uConnectionChannel)
/* TX_PE will reserve 3 us for MAX2829 A mode only, it is for better TX 
throughput */
 
if (pDevice-byRFType == RF_AIROHA7230)
-   RFbAL7230SelectChannelPostProcess(pDevice-PortOffset, 
pDevice-byCurrentCh, (unsigned char)uConnectionChannel);
+   RFbAL7230SelectChannelPostProcess(pDevice, pDevice-byCurrentCh,
+ (unsigned 
char)uConnectionChannel);
 
pDevice-byCurrentCh = (unsigned char)uConnectionChannel;
-   bResult = RFbSelectChannel(pDevice-PortOffset, pDevice-byRFType, 
(unsigned char)uConnectionChannel);
+   bResult = RFbSelectChannel(pDevice, pDevice-byRFType,
+   (unsigned char)uConnectionChannel);
 
/* Init Synthesizer Table */
if (pDevice-bEnablePSMode)
-   RFvWriteWakeProgSyn(pDevice-PortOffset, pDevice-byRFType, 
uConnectionChannel);
+   RFvWriteWakeProgSyn(pDevice, pDevice-byRFType, 
uConnectionChannel);
 
BBvSoftwareReset(pDevice);
 
diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index 2b1e7a0..da2c5e6 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -468,8 +468,9 @@ static bool s_bAL7230Init(struct vnt_private *priv)
 }
 
 // Need to Pull PLLON low when writing channel registers through 3-wire 
interface
-static bool s_bAL7230SelectChannel(void __iomem *dwIoBase, unsigned char 
byChannel)
+static bool s_bAL7230SelectChannel(struct vnt_private *priv, unsigned char 
byChannel)
 {
+   void __iomem *dwIoBase = priv-PortOffset;
bool bResult;
 
bResult = true;
@@ -627,8 +628,9 @@ bool IFRFbWriteEmbedded(void __iomem *dwIoBase, unsigned 
long dwData)
  * Return Value: true if succeeded; false if failed.
  *
  */
-static bool RFbAL2230Init(void __iomem *dwIoBase)
+static bool RFbAL2230Init(struct vnt_private *priv)
 {
+   void __iomem *dwIoBase = priv-PortOffset;
int ii;
bool bResult;
 
@@ -674,8 +676,9 @@ static bool RFbAL2230Init(void __iomem *dwIoBase)
return bResult;
 }
 
-static bool RFbAL2230SelectChannel(void __iomem *dwIoBase, unsigned char 
byChannel)
+static bool RFbAL2230SelectChannel(struct vnt_private *priv, unsigned char 
byChannel)
 {
+   void __iomem *dwIoBase = priv-PortOffset;
bool bResult;
 
bResult = true;
@@ -756,7 +759,7 @@ bool RFbInit(
case RF_AIROHA:
case RF_AL2230S:
pDevice-byMaxPwrLevel = AL2230_PWR_IDX_LEN;
-   bResult = RFbAL2230Init(pDevice-PortOffset);
+   bResult = RFbAL2230Init(pDevice);
break;
case RF_AIROHA7230:
pDevice-byMaxPwrLevel = AL7230_PWR_IDX_LEN;
@@ -785,18 +788,18 @@ bool RFbInit(
  * Return Value: true if succeeded; false if failed.
  *
  */
-bool RFbSelectChannel(void __iomem *dwIoBase, unsigned char byRFType, unsigned 
char byChannel)
+bool RFbSelectChannel(struct vnt_private *priv, unsigned char byRFType, 
unsigned char byChannel)
 {
bool bResult = true;
 
switch (byRFType) {
case RF_AIROHA:
case RF_AL2230S:
-   bResult = RFbAL2230SelectChannel(dwIoBase, byChannel);
+   bResult = RFbAL2230SelectChannel(priv, byChannel);
break;
//{{ RobertYu: 20050104
case RF_AIROHA7230:
-   bResult = s_bAL7230SelectChannel(dwIoBase, byChannel);
+   bResult = s_bAL7230SelectChannel(priv, byChannel);
break;
//}} RobertYu
case RF_NOTHING:
@@ -821,8 +824,9 @@ bool RFbSelectChannel(void __iomem *dwIoBase, unsigned char 
byRFType, unsigned c
  * Return Value: None.
  *
  */
-bool RFvWriteWakeProgSyn(void __iomem *dwIoBase, unsigned char byRFType, 
unsigned int uChannel)
+bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned char byRFType, 
unsigned int uChannel)
 {
+   void __iomem *dwIoBase = priv-PortOffset;
int   ii;
unsigned char byInitCount = 0;
unsigned char bySleepCount = 0;
@@ -1071,8 +1075,11 @@ RFvRSSITodBm(
 
 // Post processing for the 11b/g and 11a.
 // for save time on changing Reg2,3,5,7,10,12,15
-bool RFbAL7230SelectChannelPostProcess(void __iomem *dwIoBase, unsigned char 
byOldChannel, unsigned char byNewChannel)
+bool RFbAL7230SelectChannelPostProcess(struct 

[PATCH 5/8] staging: vt6655: rf.c camel calse vnt_private rename pDevice to priv

2014-11-12 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley tvbox...@gmail.com
---
 drivers/staging/vt6655/rf.c | 72 ++---
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index 3b7ad49..798dfb7 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -754,20 +754,20 @@ static bool RFbAL2230SelectChannel(struct vnt_private 
*priv, unsigned char byCha
  *
  */
 bool RFbInit(
-   struct vnt_private *pDevice
+   struct vnt_private *priv
 )
 {
bool bResult = true;
 
-   switch (pDevice-byRFType) {
+   switch (priv-byRFType) {
case RF_AIROHA:
case RF_AL2230S:
-   pDevice-byMaxPwrLevel = AL2230_PWR_IDX_LEN;
-   bResult = RFbAL2230Init(pDevice);
+   priv-byMaxPwrLevel = AL2230_PWR_IDX_LEN;
+   bResult = RFbAL2230Init(priv);
break;
case RF_AIROHA7230:
-   pDevice-byMaxPwrLevel = AL7230_PWR_IDX_LEN;
-   bResult = s_bAL7230Init(pDevice);
+   priv-byMaxPwrLevel = AL7230_PWR_IDX_LEN;
+   bResult = s_bAL7230Init(priv);
break;
case RF_NOTHING:
bResult = true;
@@ -906,7 +906,7 @@ bool RFvWriteWakeProgSyn(struct vnt_private *priv, unsigned 
char byRFType, unsig
  *
  */
 bool RFbSetPower(
-   struct vnt_private *pDevice,
+   struct vnt_private *priv,
unsigned int uRATE,
unsigned int uCH
 )
@@ -916,7 +916,7 @@ bool RFbSetPower(
unsigned char byDec = 0;
unsigned char byPwrdBm = 0;
 
-   if (pDevice-dwDiagRefCount != 0)
+   if (priv-dwDiagRefCount != 0)
return true;
 
if ((uCH  1) || (uCH  CB_MAX_CHANNEL))
@@ -927,22 +927,22 @@ bool RFbSetPower(
case RATE_2M:
case RATE_5M:
case RATE_11M:
-   byPwr = pDevice-abyCCKPwrTbl[uCH];
-   byPwrdBm = pDevice-abyCCKDefaultPwr[uCH];
+   byPwr = priv-abyCCKPwrTbl[uCH];
+   byPwrdBm = priv-abyCCKDefaultPwr[uCH];
break;
case RATE_6M:
case RATE_9M:
case RATE_18M:
-   byPwr = pDevice-abyOFDMPwrTbl[uCH];
-   if (pDevice-byRFType == RF_UW2452)
+   byPwr = priv-abyOFDMPwrTbl[uCH];
+   if (priv-byRFType == RF_UW2452)
byDec = byPwr + 14;
else
byDec = byPwr + 10;
 
-   if (byDec = pDevice-byMaxPwrLevel)
-   byDec = pDevice-byMaxPwrLevel-1;
+   if (byDec = priv-byMaxPwrLevel)
+   byDec = priv-byMaxPwrLevel-1;
 
-   if (pDevice-byRFType == RF_UW2452) {
+   if (priv-byRFType == RF_UW2452) {
byPwrdBm = byDec - byPwr;
byPwrdBm /= 3;
} else {
@@ -950,24 +950,24 @@ bool RFbSetPower(
byPwrdBm = 1;
}
 
-   byPwrdBm += pDevice-abyOFDMDefaultPwr[uCH];
+   byPwrdBm += priv-abyOFDMDefaultPwr[uCH];
byPwr = byDec;
break;
case RATE_24M:
case RATE_36M:
case RATE_48M:
case RATE_54M:
-   byPwr = pDevice-abyOFDMPwrTbl[uCH];
-   byPwrdBm = pDevice-abyOFDMDefaultPwr[uCH];
+   byPwr = priv-abyOFDMPwrTbl[uCH];
+   byPwrdBm = priv-abyOFDMDefaultPwr[uCH];
break;
}
 
-   if (pDevice-byCurPwr == byPwr)
+   if (priv-byCurPwr == byPwr)
return true;
 
-   bResult = RFbRawSetPower(pDevice, byPwr, uRATE);
+   bResult = RFbRawSetPower(priv, byPwr, uRATE);
if (bResult)
-   pDevice-byCurPwr = byPwr;
+   priv-byCurPwr = byPwr;
 
return bResult;
 }
@@ -987,7 +987,7 @@ bool RFbSetPower(
  */
 
 bool RFbRawSetPower(
-   struct vnt_private *pDevice,
+   struct vnt_private *priv,
unsigned char byPwr,
unsigned int uRATE
 )
@@ -995,27 +995,27 @@ bool RFbRawSetPower(
bool bResult = true;
unsigned long dwMax7230Pwr = 0;
 
-   if (byPwr =  pDevice-byMaxPwrLevel)
+   if (byPwr =  priv-byMaxPwrLevel)
return false;
 
-   switch (pDevice-byRFType) {
+   switch (priv-byRFType) {
case RF_AIROHA:
-   bResult = IFRFbWriteEmbedded(pDevice, 
dwAL2230PowerTable[byPwr]);
+   bResult = IFRFbWriteEmbedded(priv, dwAL2230PowerTable[byPwr]);
if (uRATE = RATE_11M)
-   bResult = IFRFbWriteEmbedded(pDevice, 
0x0001B400+(BY_AL2230_REG_LEN3)+IFREGCTL_REGW);
+   bResult = IFRFbWriteEmbedded(priv, 
0x0001B400+(BY_AL2230_REG_LEN3)+IFREGCTL_REGW);
else
-   bResult = IFRFbWriteEmbedded(pDevice, 
0x0005A400+(BY_AL2230_REG_LEN3)+IFREGCTL_REGW);
+   

[PATCH 8/8] staging: vt6655: rf.c clean up function comments

2014-11-12 Thread Malcolm Priestley
Signed-off-by: Malcolm Priestley tvbox...@gmail.com
---
 drivers/staging/vt6655/rf.c | 59 -
 1 file changed, 31 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index 0b16ebf..32ef993 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -424,7 +424,7 @@ static bool s_bAL7230Init(struct vnt_private *priv)
 
bResult = true;
 
-   //3-wire control for normal mode
+   /* 3-wire control for normal mode */
VNSvOutPortB(dwIoBase + MAC_REG_SOFTPWRCTL, 0);
 
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPECTI  |
@@ -434,10 +434,10 @@ static bool s_bAL7230Init(struct vnt_private *priv)
for (ii = 0; ii  CB_AL7230_INIT_SEQ; ii++)
bResult = IFRFbWriteEmbedded(priv, dwAL7230InitTable[ii]);
 
-   // PLL On
+   /* PLL On */
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
 
-   //Calibration
+   /* Calibration */
MACvTimer0MicroSDelay(dwIoBase, 150);//150us
/* TXDCOC:active, RCK:disable */
bResult = IFRFbWriteEmbedded(priv, 
(0x9ABA8F00+(BY_AL7230_REG_LEN3)+IFREGCTL_REGW));
@@ -455,14 +455,15 @@ static bool s_bAL7230Init(struct vnt_private *priv)
 
BBvPowerSaveModeON(priv); /* RobertYu:20050106 */
 
-   // PE1: TX_ON, PE2: RX_ON, PE3: PLLON
-   //3-wire control for power saving mode
+   /* PE1: TX_ON, PE2: RX_ON, PE3: PLLON */
+   /* 3-wire control for power saving mode */
VNSvOutPortB(dwIoBase + MAC_REG_PSPWRSIG, (PSSIG_WPE3 | PSSIG_WPE2)); 
//1100 
 
return bResult;
 }
 
-// Need to Pull PLLON low when writing channel registers through 3-wire 
interface
+/* Need to Pull PLLON low when writing channel registers through
+ * 3-wire interface */
 static bool s_bAL7230SelectChannel(struct vnt_private *priv, unsigned char 
byChannel)
 {
void __iomem *dwIoBase = priv-PortOffset;
@@ -470,20 +471,20 @@ static bool s_bAL7230SelectChannel(struct vnt_private 
*priv, unsigned char byCha
 
bResult = true;
 
-   // PLLON Off
+   /* PLLON Off */
MACvWordRegBitsOff(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
 
bResult = IFRFbWriteEmbedded(priv, dwAL7230ChannelTable0[byChannel - 
1]);
bResult = IFRFbWriteEmbedded(priv, dwAL7230ChannelTable1[byChannel - 
1]);
bResult = IFRFbWriteEmbedded(priv, dwAL7230ChannelTable2[byChannel - 
1]);
 
-   // PLLOn On
+   /* PLLOn On */
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
 
-   // Set Channel[7] = 0 to tell H/W channel is changing now.
+   /* Set Channel[7] = 0 to tell H/W channel is changing now. */
VNSvOutPortB(dwIoBase + MAC_REG_CHANNEL, (byChannel  0x7F));
MACvTimer0MicroSDelay(dwIoBase, SWITCH_CHANNEL_DELAY_AL7230);
-   // Set Channel[7] = 1 to tell H/W channel change is done.
+   /* Set Channel[7] = 1 to tell H/W channel change is done. */
VNSvOutPortB(dwIoBase + MAC_REG_CHANNEL, (byChannel | 0x80));
 
return bResult;
@@ -510,7 +511,7 @@ bool IFRFbWriteEmbedded(struct vnt_private *priv, unsigned 
long dwData)
 
VNSvOutPortD(dwIoBase + MAC_REG_IFREGCTL, dwData);
 
-   // W_MAX_TIMEOUT is the timeout period
+   /* W_MAX_TIMEOUT is the timeout period */
for (ww = 0; ww  W_MAX_TIMEOUT; ww++) {
VNSvInPortD(dwIoBase + MAC_REG_IFREGCTL, dwValue);
if (dwValue  IFREGCTL_DONE)
@@ -543,23 +544,22 @@ static bool RFbAL2230Init(struct vnt_private *priv)
 
bResult = true;
 
-   //3-wire control for normal mode
+   /* 3-wire control for normal mode */
VNSvOutPortB(dwIoBase + MAC_REG_SOFTPWRCTL, 0);
 
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPECTI  |
 SOFTPWRCTL_TXPEINV));
-   // PLL  Off
-
+   /* PLL  Off */
MACvWordRegBitsOff(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
 
-   //patch abnormal AL2230 frequency output
+   /* patch abnormal AL2230 frequency output */
IFRFbWriteEmbedded(priv, 
(0x07168700+(BY_AL2230_REG_LEN3)+IFREGCTL_REGW));
 
for (ii = 0; ii  CB_AL2230_INIT_SEQ; ii++)
bResult = IFRFbWriteEmbedded(priv, dwAL2230InitTable[ii]);
MACvTimer0MicroSDelay(dwIoBase, 30); //delay 30 us
 
-   // PLL On
+   /* PLL On */
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
 
MACvTimer0MicroSDelay(dwIoBase, 150);//150us
@@ -574,7 +574,7 @@ static bool RFbAL2230Init(struct vnt_private *priv)
 SOFTPWRCTL_SWPECTI  |
 SOFTPWRCTL_TXPEINV));
 
-   //3-wire control for power saving mode
+   /* 3-wire control for power saving mode */
VNSvOutPortB(dwIoBase + MAC_REG_PSPWRSIG, 

[PATCH 4/8] staging: vt6655: IFRFbWriteEmbedded replace __iomem with vnt_private

2014-11-12 Thread Malcolm Priestley
Fixing callers to vnt_private

Signed-off-by: Malcolm Priestley tvbox...@gmail.com
---
 drivers/staging/vt6655/rf.c | 85 +++--
 drivers/staging/vt6655/rf.h |  2 +-
 2 files changed, 45 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c
index da2c5e6..3b7ad49 100644
--- a/drivers/staging/vt6655/rf.c
+++ b/drivers/staging/vt6655/rf.c
@@ -440,18 +440,21 @@ static bool s_bAL7230Init(struct vnt_private *priv)
BBvPowerSaveModeOFF(priv); /* RobertYu:20050106, have DC value for 
Calibration */
 
for (ii = 0; ii  CB_AL7230_INIT_SEQ; ii++)
-   bResult = IFRFbWriteEmbedded(dwIoBase, dwAL7230InitTable[ii]);
+   bResult = IFRFbWriteEmbedded(priv, dwAL7230InitTable[ii]);
 
// PLL On
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
 
//Calibration
MACvTimer0MicroSDelay(dwIoBase, 150);//150us
-   bResult = IFRFbWriteEmbedded(dwIoBase, 
(0x9ABA8F00+(BY_AL7230_REG_LEN3)+IFREGCTL_REGW)); //TXDCOC:active, RCK:disable
+   /* TXDCOC:active, RCK:disable */
+   bResult = IFRFbWriteEmbedded(priv, 
(0x9ABA8F00+(BY_AL7230_REG_LEN3)+IFREGCTL_REGW));
MACvTimer0MicroSDelay(dwIoBase, 30);//30us
-   bResult = IFRFbWriteEmbedded(dwIoBase, 
(0x3ABA8F00+(BY_AL7230_REG_LEN3)+IFREGCTL_REGW)); //TXDCOC:disable, RCK:active
+   /* TXDCOC:disable, RCK:active */
+   bResult = IFRFbWriteEmbedded(priv, 
(0x3ABA8F00+(BY_AL7230_REG_LEN3)+IFREGCTL_REGW));
MACvTimer0MicroSDelay(dwIoBase, 30);//30us
-   bResult = IFRFbWriteEmbedded(dwIoBase, 
dwAL7230InitTable[CB_AL7230_INIT_SEQ-1]); //TXDCOC:disable, RCK:disable
+   /* TXDCOC:disable, RCK:disable */
+   bResult = IFRFbWriteEmbedded(priv, 
dwAL7230InitTable[CB_AL7230_INIT_SEQ-1]);
 
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPE3|
 SOFTPWRCTL_SWPE2|
@@ -478,9 +481,9 @@ static bool s_bAL7230SelectChannel(struct vnt_private 
*priv, unsigned char byCha
// PLLON Off
MACvWordRegBitsOff(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
 
-   bResult = IFRFbWriteEmbedded(dwIoBase, dwAL7230ChannelTable0[byChannel 
- 1]); //Reg0
-   bResult = IFRFbWriteEmbedded(dwIoBase, dwAL7230ChannelTable1[byChannel 
- 1]); //Reg1
-   bResult = IFRFbWriteEmbedded(dwIoBase, dwAL7230ChannelTable2[byChannel 
- 1]); //Reg4
+   bResult = IFRFbWriteEmbedded(priv, dwAL7230ChannelTable0[byChannel - 
1]);
+   bResult = IFRFbWriteEmbedded(priv, dwAL7230ChannelTable1[byChannel - 
1]);
+   bResult = IFRFbWriteEmbedded(priv, dwAL7230ChannelTable2[byChannel - 
1]);
 
// PLLOn On
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
@@ -569,8 +572,9 @@ static bool s_bAL7230SelectChannel(struct vnt_private 
*priv, unsigned char byCha
  * Return Value: true if succeeded; false if failed.
  *
  */
-bool IFRFbWriteEmbedded(void __iomem *dwIoBase, unsigned long dwData)
+bool IFRFbWriteEmbedded(struct vnt_private *priv, unsigned long dwData)
 {
+   void __iomem *dwIoBase = priv-PortOffset;
unsigned short ww;
unsigned long dwValue;
 
@@ -648,10 +652,10 @@ static bool RFbAL2230Init(struct vnt_private *priv)
 
//patch abnormal AL2230 frequency output
 //2008-8-21 chester add
-   IFRFbWriteEmbedded(dwIoBase, 
(0x07168700+(BY_AL2230_REG_LEN3)+IFREGCTL_REGW));
+   IFRFbWriteEmbedded(priv, 
(0x07168700+(BY_AL2230_REG_LEN3)+IFREGCTL_REGW));
 
for (ii = 0; ii  CB_AL2230_INIT_SEQ; ii++)
-   bResult = IFRFbWriteEmbedded(dwIoBase, dwAL2230InitTable[ii]);
+   bResult = IFRFbWriteEmbedded(priv, dwAL2230InitTable[ii]);
 //2008-8-21 chester add
MACvTimer0MicroSDelay(dwIoBase, 30); //delay 30 us
 
@@ -659,11 +663,11 @@ static bool RFbAL2230Init(struct vnt_private *priv)
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPE3);
 
MACvTimer0MicroSDelay(dwIoBase, 150);//150us
-   bResult = IFRFbWriteEmbedded(dwIoBase, 
(0x00d80f00+(BY_AL2230_REG_LEN3)+IFREGCTL_REGW));
+   bResult = IFRFbWriteEmbedded(priv, 
(0x00d80f00+(BY_AL2230_REG_LEN3)+IFREGCTL_REGW));
MACvTimer0MicroSDelay(dwIoBase, 30);//30us
-   bResult = IFRFbWriteEmbedded(dwIoBase, 
(0x00780f00+(BY_AL2230_REG_LEN3)+IFREGCTL_REGW));
+   bResult = IFRFbWriteEmbedded(priv, 
(0x00780f00+(BY_AL2230_REG_LEN3)+IFREGCTL_REGW));
MACvTimer0MicroSDelay(dwIoBase, 30);//30us
-   bResult = IFRFbWriteEmbedded(dwIoBase, 
dwAL2230InitTable[CB_AL2230_INIT_SEQ-1]);
+   bResult = IFRFbWriteEmbedded(priv, 
dwAL2230InitTable[CB_AL2230_INIT_SEQ-1]);
 
MACvWordRegBitsOn(dwIoBase, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPE3|
 SOFTPWRCTL_SWPE2|
@@ -683,8 +687,8 @@ static bool RFbAL2230SelectChannel(struct vnt_private 
*priv, unsigned char byCha
 

Re: MediaTek WiFi hardware support in upstream kernel

2014-11-12 Thread Larry Finger

On 11/12/2014 03:04 PM, Felix Fietkau wrote:

The chips I'm working with are both MT7662 and MT7612. My driver already
works as a simple AP or station in 802.11n mode with some limited
aggregation support. I'm getting around 45-50 Mbit/s TCP throughput on
HT20 with iperf. I will post code soon, stay tuned!


Felix,

If your driver will work with the MT7630, I will be happy to test it when 
posted.

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: [PATCH 5/5] cfg80211: Allow usermode to query wiphy specific regd info

2014-11-12 Thread Luis R. Rodriguez
On Wed, Nov 5, 2014 at 1:12 AM, Arik Nemtsov a...@wizery.com wrote:
 On Wed, Nov 5, 2014 at 5:23 AM, Luis R. Rodriguez
 mcg...@do-not-panic.com wrote:
 On Wed, Oct 22, 2014 at 11:37 PM, Arik Nemtsov a...@wizery.com wrote:
 + * @NL80211_ATTR_WIPHY_SELF_MANAGED_REG: flag attribute indicating the
 + * regulatory information came from the driver and not from the global
 + * cfg80211 regulatory domain information.

 Awesome, can you also add another entry for those drivers that use
 regulatory_hint() API given that the wiphy-regd will be set and then
 that is a custom regdomain which I do think would be great to query as
 well.

 Just to be sure we're on the same page.
 1. You're asking for an attribute to be automatically sent to
 userspace whenever someone registers with REGULATORY_CUSTOM_REG.

Right now if REGULATORY_CUSTOM_REG is set you are expected to use
wiphy_apply_custom_regulatory() and the regd is not cached, instead we
rely on the orgi parameters to ensure that data is used as that
maximum set. These data structures are already part of the kernel so I
don't think its necessary to send them to userspace right now but
specially since it'd mean adding a new data structure and caching it
completely. That's possible but I was more looking for users of
regulatory_hint(), when that is used the wiphy-regd is set and so its
available and cached already.

 2. And then if userspace sends a wiphy idx to the NL80211_CMD_GET_REG,
 we'll return wiphy-regd for that case as well?

That's right, for now we'd be able to send the regd when either
NL80211_ATTR_WIPHY_SELF_MANAGED_REG is set or when
NL80211_ATTR_WIPHY_SELF_MANAGED_REG is not set but regulatory_hint()
was used. Note that some users may have REGULATORY_CUSTOM_REG. and
then later use regulatory_hint(), this is done to for example set a
more restrictive custom world regdomain and then later use the CRDA
data for a specific alpha2.

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


Re: [PATCH 2/5] cfg80211: leave invalid channels on regdomain change

2014-11-12 Thread Luis R. Rodriguez
On Wed, Nov 5, 2014 at 1:18 AM, Arik Nemtsov a...@wizery.com wrote:
 On Wed, Nov 5, 2014 at 5:16 AM, Luis R. Rodriguez
 mcg...@do-not-panic.com wrote:
 On Wed, Oct 22, 2014 at 11:37 PM, Arik Nemtsov a...@wizery.com wrote:
 +static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev 
 *wdev)
 +{
 +   struct ieee80211_channel *ch;
 +   struct cfg80211_chan_def chandef;
 +   struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
 +   bool ret = true;
 +
 +   wdev_lock(wdev);
 +
 +   if (!wdev-netdev || !netif_running(wdev-netdev))
 +   goto out;
 +
 +   switch (wdev-iftype) {
 +   case NL80211_IFTYPE_AP:
 +   case NL80211_IFTYPE_P2P_GO:
 +   if (!wdev-beacon_interval)
 +   goto out;
 +
 +   ret = cfg80211_reg_can_beacon(wiphy,
 + wdev-chandef, wdev-iftype);
 +   break;
 +   case NL80211_IFTYPE_STATION:
 +   case NL80211_IFTYPE_P2P_CLIENT:
 +   if (!wdev-current_bss ||
 +   !wdev-current_bss-pub.channel)
 +   goto out;
 +
 +   ch = wdev-current_bss-pub.channel;
 +   if (rdev-ops-get_channel 
 +   !rdev_get_channel(rdev, wdev, chandef))
 +   ret = cfg80211_chandef_usable(wiphy, chandef,
 + 
 IEEE80211_CHAN_DISABLED);
 +   else
 +   ret = !(ch-flags  IEEE80211_CHAN_DISABLED);
 +   break;
 +   default:
 +   /* others not implemented for now */

 Looks good to me except this of course, since its a flag that will
 enable this per wiphy might as well WARN() if you really do not want
 to think about this. That means that once someone does enable this on
 a wiphy with the other type of interfaces they'll have to think about
 this, likewise one could warn if a wiphy interface is registered with
 the flag to follow this but supports a mode not handled here yet.

 But I do want to support a wiphy that has other modes
 (NL80211_IFTYPE_ADHOC), but I don't want people to get warnings every
 time they use IBSS.
 Maybe I'll rename the flag to REGULATORY_ENFORCE_AP_STA_CHANNELS?

Then it depends on how important this feature is for your regulatory
requirements. If its important then I'd wait until its properly
implemented, if its not required for the other modes then a simple
information message would suffice.

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


Re: [PATCH] rtlwifi: Add more checks for get_btc_status callback

2014-11-12 Thread Murilo Opsfelder Araújo
 like to let you know that next-20141112 brought my rtl8192se
device back to life.  I didn't need to build rtlwifi_new to be able to
connect to my wifi network.  It worked just fine.

Thank you all.

-- 
Murilo
--
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/5] wiphy-specific regulatory management

2014-11-12 Thread Luis R. Rodriguez
On Wed, Nov 5, 2014 at 12:41 AM, Arik Nemtsov a...@wizery.com wrote:
 On Wed, Nov 5, 2014 at 5:21 AM, Luis R. Rodriguez
 mcg...@do-not-panic.com wrote:
 On Wed, Oct 22, 2014 at 11:37 PM, Arik Nemtsov a...@wizery.com wrote:
   cfg80211: allow wiphy specific regdomain management

 This guy never made it to my inbox.

 Here it is:
 http://permalink.gmane.org/gmane.linux.kernel.wireless.general/129448

Look OK but I can't comment on code so please also Cc this address on
future patches: mcg...@suse.com. Look forward to next iteration.

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


Re: [PATCH 1/6] ath9k: disable overriding AR9340 SLP32 registers

2014-11-12 Thread Sujith Manoharan
Felix Fietkau wrote:
 What's the point in doing this? The writes don't hurt, and this change
 is making the code uglier.

Well, the code is redundant and I don't see the point in
doing the writes when we don't have to ? We could maybe
restructure it a bit...

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


[PATCH] brcmfmac: kill URB when request timed out

2014-11-12 Thread Mathy Vanhoef
Kill the submitted URB in brcmf_usb_dl_cmd if the request timed out. This
assures the URB is never submitted twice. It also prevents a possible
use-after-free of the URB transfer buffer if a timeout occurs.

Signed-off-by: Mathy Vanhoef vanho...@gmail.com
---
For a discussion about this patch and the underlying problem, see the mails
with as subject [PATCH] brcmfmac: unlink URB when request timed out.

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

diff --git a/drivers/net/wireless/brcm80211/brcmfmac/usb.c 
b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
index 5265aa7..4572def 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/usb.c
@@ -738,10 +738,12 @@ static int brcmf_usb_dl_cmd(struct brcmf_usbdev_info 
*devinfo, u8 cmd,
goto finalize;
}
 
-   if (!brcmf_usb_ioctl_resp_wait(devinfo))
+   if (!brcmf_usb_ioctl_resp_wait(devinfo)) {
+   usb_kill_urb(devinfo-ctl_urb);
ret = -ETIMEDOUT;
-   else
+   } else {
memcpy(buffer, tmpbuf, buflen);
+   }
 
 finalize:
kfree(tmpbuf);
-- 
1.7.10.4
--
To unsubscribe from this list: send the line unsubscribe linux-wireless in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html