[PATCH] mac80211_hwsim: check ATTR_FREQ for wmediumd (netlink) packets

2015-11-02 Thread arwelle
From: Adam Welle 

If a packet is received from netlink with the frequency value set it is
checked against the current radio's frequency and discarded if different.

Signed-off-by: Adam Welle 
---
 drivers/net/wireless/mac80211_hwsim.c | 14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c 
b/drivers/net/wireless/mac80211_hwsim.c
index ee46f46..191b576 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -2827,10 +2827,16 @@ static int hwsim_cloned_frame_received_nl(struct 
sk_buff *skb_2,
 
/* A frame is received from user space */
memset(_status, 0, sizeof(rx_status));
-   /* TODO: Check ATTR_FREQ if it exists, and maybe throw away off-channel
-* packets?
-*/
-   rx_status.freq = data2->channel->center_freq;
+
+   /* Check ATTR_FREQ if it exists, and throw away off-channel packets */
+   if (info->attrs[HWSIM_ATTR_FREQ]) {
+   rx_status.freq = nla_get_u32(info->attrs[HWSIM_ATTR_FREQ]);
+   if (rx_status.freq != data2->channel->center_freq)
+   goto out;
+   } else {
+   rx_status.freq = data2->channel->center_freq;
+   }
+
rx_status.band = data2->channel->band;
rx_status.rate_idx = nla_get_u32(info->attrs[HWSIM_ATTR_RX_RATE]);
rx_status.signal = nla_get_u32(info->attrs[HWSIM_ATTR_SIGNAL]);
-- 
2.1.4

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


mac80211 chanctx usage

2015-11-02 Thread Wim Torfs

Hi,

What is the idea behind channel contexts? Is it just to create an 
abstraction between the different vifs regarding the channel (each vif 
is allowed to operate on its own channel)? In case I want just a single 
vif, can I ignore the chanctx (specify that the driver does not support 
chanctx) or is this not recommended due perhaps some updates that were 
done on the chanctx code and not on the alternative branch?






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


[PATCH 4/8] ath10k: remove is_offchan

2015-11-02 Thread Michal Kazior
It was wasteful to keep it in the struct.

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/core.h | 1 -
 drivers/net/wireless/ath/ath10k/mac.c  | 4 +---
 drivers/net/wireless/ath/ath10k/mac.h  | 1 +
 drivers/net/wireless/ath/ath10k/txrx.c | 7 ++-
 4 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.h 
b/drivers/net/wireless/ath/ath10k/core.h
index efc34b1412b4..f24a5feb2220 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -89,7 +89,6 @@ struct ath10k_skb_cb {
struct {
u8 tid;
u16 freq;
-   bool is_offchan;
bool nohwcrypt;
struct ath10k_htt_txbuf *txbuf;
u32 txbuf_paddr;
diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index dd24bc970b00..9c76934b3bf0 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3290,7 +3290,7 @@ static void ath10k_tx_h_add_p2p_noa_ie(struct ath10k *ar,
}
 }
 
-static bool ath10k_mac_need_offchan_tx_work(struct ath10k *ar)
+bool ath10k_mac_need_offchan_tx_work(struct ath10k *ar)
 {
/* FIXME: Not really sure since when the behaviour changed. At some
 * point new firmware stopped requiring creation of peer entries for
@@ -3672,7 +3672,6 @@ static void ath10k_tx(struct ieee80211_hw *hw,
 
txmode = ath10k_mac_tx_h_get_txmode(ar, vif, sta, skb);
 
-   ATH10K_SKB_CB(skb)->htt.is_offchan = false;
ATH10K_SKB_CB(skb)->htt.freq = 0;
ATH10K_SKB_CB(skb)->htt.tid = ath10k_tx_h_get_tid(hdr);
ATH10K_SKB_CB(skb)->htt.nohwcrypt = !ath10k_tx_h_use_hwcrypto(vif, skb);
@@ -3704,7 +3703,6 @@ static void ath10k_tx(struct ieee80211_hw *hw,
 
if (ath10k_mac_need_offchan_tx_work(ar)) {
ATH10K_SKB_CB(skb)->htt.freq = 0;
-   ATH10K_SKB_CB(skb)->htt.is_offchan = true;
 
ath10k_dbg(ar, ATH10K_DBG_MAC, "queued offchannel skb 
%p\n",
   skb);
diff --git a/drivers/net/wireless/ath/ath10k/mac.h 
b/drivers/net/wireless/ath/ath10k/mac.h
index e3cefe4c7cfd..ff09d6986fae 100644
--- a/drivers/net/wireless/ath/ath10k/mac.h
+++ b/drivers/net/wireless/ath/ath10k/mac.h
@@ -58,6 +58,7 @@ bool ath10k_mac_is_peer_wep_key_set(struct ath10k *ar, const 
u8 *addr,
u8 keyidx);
 int ath10k_mac_vif_chan(struct ieee80211_vif *vif,
struct cfg80211_chan_def *def);
+bool ath10k_mac_need_offchan_tx_work(struct ath10k *ar);
 
 void ath10k_mac_handle_beacon(struct ath10k *ar, struct sk_buff *skb);
 void ath10k_mac_handle_beacon_miss(struct ath10k *ar, u32 vdev_id);
diff --git a/drivers/net/wireless/ath/ath10k/txrx.c 
b/drivers/net/wireless/ath/ath10k/txrx.c
index 6d1105ab4592..655947bef6cc 100644
--- a/drivers/net/wireless/ath/ath10k/txrx.c
+++ b/drivers/net/wireless/ath/ath10k/txrx.c
@@ -23,7 +23,12 @@
 
 static void ath10k_report_offchan_tx(struct ath10k *ar, struct sk_buff *skb)
 {
-   if (!ATH10K_SKB_CB(skb)->htt.is_offchan)
+   struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+
+   if (likely(!(info->flags & IEEE80211_TX_CTL_TX_OFFCHAN)))
+   return;
+
+   if (!ath10k_mac_need_offchan_tx_work(ar))
return;
 
/* If the original wait_for_completion() timed out before
-- 
2.1.4

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


[PATCH 0/8] ath10k: clean up ath10k_skb_cb

2015-11-02 Thread Michal Kazior
The ath10k_skb_cb structure wasn't really space
efficient. Some stuff is removed or replaced with
more compact representation.

This cleanup is necessary for future features.

The size of ath10k_skb_cb:

  before   after
 x86-32   26   12
 x86-64   34   20


Michal Kazior (8):
  ath10k: merge is_protected with nohwcrypt
  ath10k: rename function to adhere to naming convention
  ath10k: remove txmode from skb_cb
  ath10k: remove is_offchan
  ath10k: remove freq from skb_cb
  ath10k: pack up flags in skb_cb
  ath10k: replace vdev_id and tid in skb cb
  ath10k: store msdu_id instead of txbuf pointers

 drivers/net/wireless/ath/ath10k/core.h   |  27 +++
 drivers/net/wireless/ath/ath10k/htt.h|   3 +-
 drivers/net/wireless/ath/ath10k/htt_tx.c | 111 ++---
 drivers/net/wireless/ath/ath10k/mac.c| 116 +++
 drivers/net/wireless/ath/ath10k/mac.h|   1 +
 drivers/net/wireless/ath/ath10k/txrx.c   |   7 +-
 drivers/net/wireless/ath/ath10k/wmi.c|  22 --
 7 files changed, 165 insertions(+), 122 deletions(-)

-- 
2.1.4

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


[PATCH 6/8] ath10k: pack up flags in skb_cb

2015-11-02 Thread Michal Kazior
It was wasteful to have all the flags as separate
bools.

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/core.h   | 13 +++--
 drivers/net/wireless/ath/ath10k/htt_tx.c |  4 ++--
 drivers/net/wireless/ath/ath10k/mac.c| 10 +++---
 drivers/net/wireless/ath/ath10k/wmi.c| 12 
 4 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.h 
b/drivers/net/wireless/ath/ath10k/core.h
index 64a248f780b9..59ec9a8098d0 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -81,22 +81,23 @@ static inline const char *ath10k_bus_str(enum ath10k_bus 
bus)
return "unknown";
 }
 
+enum ath10k_skb_flags {
+   ATH10K_SKB_F_NO_HWCRYPT = BIT(0),
+   ATH10K_SKB_F_DTIM_ZERO = BIT(1),
+   ATH10K_SKB_F_DELIVER_CAB = BIT(2),
+};
+
 struct ath10k_skb_cb {
dma_addr_t paddr;
+   u8 flags;
u8 eid;
u8 vdev_id;
 
struct {
u8 tid;
-   bool nohwcrypt;
struct ath10k_htt_txbuf *txbuf;
u32 txbuf_paddr;
} __packed htt;
-
-   struct {
-   bool dtim_zero;
-   bool deliver_cab;
-   } bcn;
 } __packed;
 
 struct ath10k_skb_rxcb {
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c 
b/drivers/net/wireless/ath/ath10k/htt_tx.c
index 05ce99ad6ca2..a572576bf6c4 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -579,7 +579,7 @@ int ath10k_htt_tx(struct ath10k_htt *htt, enum 
ath10k_hw_txrx_mode txmode,
 ieee80211_is_disassoc(hdr->frame_control)) &&
 ieee80211_has_protected(hdr->frame_control)) {
skb_put(msdu, IEEE80211_CCMP_MIC_LEN);
-   } else if (!skb_cb->htt.nohwcrypt &&
+   } else if (!(skb_cb->flags & ATH10K_SKB_F_NO_HWCRYPT) &&
   txmode == ATH10K_HW_TXRX_RAW &&
   ieee80211_has_protected(hdr->frame_control)) {
skb_put(msdu, IEEE80211_CCMP_MIC_LEN);
@@ -659,7 +659,7 @@ int ath10k_htt_tx(struct ath10k_htt *htt, enum 
ath10k_hw_txrx_mode txmode,
prefetch_len);
skb_cb->htt.txbuf->htc_hdr.flags = 0;
 
-   if (skb_cb->htt.nohwcrypt)
+   if (skb_cb->flags & ATH10K_SKB_F_NO_HWCRYPT)
flags0 |= HTT_DATA_TX_DESC_FLAGS0_NO_ENCRYPT;
 
flags1 |= SM((u16)vdev_id, HTT_DATA_TX_DESC_FLAGS1_VDEV_ID);
diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index ddf2ad2f3955..105a2e61c2ae 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3661,6 +3661,7 @@ static void ath10k_tx(struct ieee80211_hw *hw,
  struct sk_buff *skb)
 {
struct ath10k *ar = hw->priv;
+   struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb);
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct ieee80211_vif *vif = info->control.vif;
struct ieee80211_sta *sta = control->sta;
@@ -3673,9 +3674,12 @@ static void ath10k_tx(struct ieee80211_hw *hw,
 
txmode = ath10k_mac_tx_h_get_txmode(ar, vif, sta, skb);
 
-   ATH10K_SKB_CB(skb)->htt.tid = ath10k_tx_h_get_tid(hdr);
-   ATH10K_SKB_CB(skb)->htt.nohwcrypt = !ath10k_tx_h_use_hwcrypto(vif, skb);
-   ATH10K_SKB_CB(skb)->vdev_id = ath10k_tx_h_get_vdev_id(ar, vif);
+   skb_cb->flags = 0;
+   if (!ath10k_tx_h_use_hwcrypto(vif, skb))
+   skb_cb->flags |= ATH10K_SKB_F_NO_HWCRYPT;
+
+   skb_cb->htt.tid = ath10k_tx_h_get_tid(hdr);
+   skb_cb->vdev_id = ath10k_tx_h_get_vdev_id(ar, vif);
 
switch (txmode) {
case ATH10K_HW_TXRX_MGMT:
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c 
b/drivers/net/wireless/ath/ath10k/wmi.c
index 7569db0f69b5..022d42d29486 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1660,6 +1660,8 @@ static void ath10k_wmi_tx_beacon_nowait(struct ath10k_vif 
*arvif)
struct ath10k *ar = arvif->ar;
struct ath10k_skb_cb *cb;
struct sk_buff *bcn;
+   bool dtim_zero;
+   bool deliver_cab;
int ret;
 
spin_lock_bh(>data_lock);
@@ -1679,12 +1681,14 @@ static void ath10k_wmi_tx_beacon_nowait(struct 
ath10k_vif *arvif)
arvif->beacon_state = ATH10K_BEACON_SENDING;
spin_unlock_bh(>data_lock);
 
+   dtim_zero = !!(cb->flags & ATH10K_SKB_F_DTIM_ZERO);
+   deliver_cab = !!(cb->flags & ATH10K_SKB_F_DELIVER_CAB);
ret = ath10k_wmi_beacon_send_ref_nowait(arvif->ar,
arvif->vdev_id,
bcn->data, bcn->len,
cb->paddr,
-   cb->bcn.dtim_zero,
- 

[PATCH 1/8] ath10k: merge is_protected with nohwcrypt

2015-11-02 Thread Michal Kazior
It was wasteful to have two flags describing
the same thing.

While at it fix code style of
ath10k_tx_h_use_hwcrypto().

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/core.h   |  1 -
 drivers/net/wireless/ath/ath10k/htt_tx.c |  3 ---
 drivers/net/wireless/ath/ath10k/mac.c| 14 ++
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.h 
b/drivers/net/wireless/ath/ath10k/core.h
index 4a2301589902..64d9a63e6b48 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -86,7 +86,6 @@ struct ath10k_skb_cb {
u8 eid;
u8 vdev_id;
enum ath10k_hw_txrx_mode txmode;
-   bool is_protected;
 
struct {
u8 tid;
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c 
b/drivers/net/wireless/ath/ath10k/htt_tx.c
index 16823970dbfd..eaa9263f6151 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -656,9 +656,6 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff 
*msdu)
if (skb_cb->htt.nohwcrypt)
flags0 |= HTT_DATA_TX_DESC_FLAGS0_NO_ENCRYPT;
 
-   if (!skb_cb->is_protected)
-   flags0 |= HTT_DATA_TX_DESC_FLAGS0_NO_ENCRYPT;
-
flags1 |= SM((u16)vdev_id, HTT_DATA_TX_DESC_FLAGS1_VDEV_ID);
flags1 |= SM((u16)tid, HTT_DATA_TX_DESC_FLAGS1_EXT_TID);
if (msdu->ip_summed == CHECKSUM_PARTIAL &&
diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index a7411fe90cc4..58230cd04174 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3190,14 +3190,22 @@ ath10k_tx_h_get_txmode(struct ath10k *ar, struct 
ieee80211_vif *vif,
 }
 
 static bool ath10k_tx_h_use_hwcrypto(struct ieee80211_vif *vif,
-struct sk_buff *skb) {
-   struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+struct sk_buff *skb)
+{
+   const struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+   const struct ieee80211_hdr *hdr = (void *)skb->data;
const u32 mask = IEEE80211_TX_INTFL_DONT_ENCRYPT |
 IEEE80211_TX_CTL_INJECTED;
+
+   if (!ieee80211_has_protected(hdr->frame_control))
+   return false;
+
if ((info->flags & mask) == mask)
return false;
+
if (vif)
return !ath10k_vif_to_arvif(vif)->nohwcrypt;
+
return true;
 }
 
@@ -3635,7 +3643,6 @@ static void ath10k_tx(struct ieee80211_hw *hw,
struct ieee80211_vif *vif = info->control.vif;
struct ieee80211_sta *sta = control->sta;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
-   __le16 fc = hdr->frame_control;
 
/* We should disable CCK RATE due to P2P */
if (info->flags & IEEE80211_TX_CTL_NO_CCK_RATE)
@@ -3647,7 +3654,6 @@ static void ath10k_tx(struct ieee80211_hw *hw,
ATH10K_SKB_CB(skb)->htt.nohwcrypt = !ath10k_tx_h_use_hwcrypto(vif, skb);
ATH10K_SKB_CB(skb)->vdev_id = ath10k_tx_h_get_vdev_id(ar, vif);
ATH10K_SKB_CB(skb)->txmode = ath10k_tx_h_get_txmode(ar, vif, sta, skb);
-   ATH10K_SKB_CB(skb)->is_protected = ieee80211_has_protected(fc);
 
switch (ATH10K_SKB_CB(skb)->txmode) {
case ATH10K_HW_TXRX_MGMT:
-- 
2.1.4

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


[PATCH 3/8] ath10k: remove txmode from skb_cb

2015-11-02 Thread Michal Kazior
It was wasteful to keep it in the struct because
it can be passed as function argument down the tx
path.

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/core.h   |  1 -
 drivers/net/wireless/ath/ath10k/htt.h|  3 ++-
 drivers/net/wireless/ath/ath10k/htt_tx.c |  9 +++
 drivers/net/wireless/ath/ath10k/mac.c| 40 
 4 files changed, 37 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.h 
b/drivers/net/wireless/ath/ath10k/core.h
index 64d9a63e6b48..efc34b1412b4 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -85,7 +85,6 @@ struct ath10k_skb_cb {
dma_addr_t paddr;
u8 eid;
u8 vdev_id;
-   enum ath10k_hw_txrx_mode txmode;
 
struct {
u8 tid;
diff --git a/drivers/net/wireless/ath/ath10k/htt.h 
b/drivers/net/wireless/ath/ath10k/htt.h
index 2bad50e520b5..9d15924b1f90 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -1597,6 +1597,7 @@ void __ath10k_htt_tx_dec_pending(struct ath10k_htt *htt, 
bool limit_mgmt_desc);
 int ath10k_htt_tx_alloc_msdu_id(struct ath10k_htt *htt, struct sk_buff *skb);
 void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id);
 int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *);
-int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *);
+int ath10k_htt_tx(struct ath10k_htt *htt, enum ath10k_hw_txrx_mode txmode,
+ struct sk_buff *msdu);
 
 #endif
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c 
b/drivers/net/wireless/ath/ath10k/htt_tx.c
index eaa9263f6151..bada9695a4fb 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -525,7 +525,8 @@ err:
return res;
 }
 
-int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
+int ath10k_htt_tx(struct ath10k_htt *htt, enum ath10k_hw_txrx_mode txmode,
+ struct sk_buff *msdu)
 {
struct ath10k *ar = htt->ar;
struct device *dev = ar->dev;
@@ -577,7 +578,7 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff 
*msdu)
 ieee80211_has_protected(hdr->frame_control)) {
skb_put(msdu, IEEE80211_CCMP_MIC_LEN);
} else if (!skb_cb->htt.nohwcrypt &&
-  skb_cb->txmode == ATH10K_HW_TXRX_RAW &&
+  txmode == ATH10K_HW_TXRX_RAW &&
   ieee80211_has_protected(hdr->frame_control)) {
skb_put(msdu, IEEE80211_CCMP_MIC_LEN);
}
@@ -590,7 +591,7 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff 
*msdu)
goto err_free_msdu_id;
}
 
-   switch (skb_cb->txmode) {
+   switch (txmode) {
case ATH10K_HW_TXRX_RAW:
case ATH10K_HW_TXRX_NATIVE_WIFI:
flags0 |= HTT_DATA_TX_DESC_FLAGS0_MAC_HDR_PRESENT;
@@ -619,7 +620,7 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff 
*msdu)
 
frags_paddr = skb_cb->htt.txbuf_paddr;
}
-   flags0 |= SM(skb_cb->txmode, HTT_DATA_TX_DESC_FLAGS0_PKT_TYPE);
+   flags0 |= SM(txmode, HTT_DATA_TX_DESC_FLAGS0_PKT_TYPE);
break;
case ATH10K_HW_TXRX_MGMT:
flags0 |= SM(ATH10K_HW_TXRX_MGMT,
diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 14a705ca87b2..dd24bc970b00 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3324,24 +3324,24 @@ unlock:
return ret;
 }
 
-static void ath10k_mac_tx(struct ath10k *ar, struct sk_buff *skb)
+static void ath10k_mac_tx(struct ath10k *ar, enum ath10k_hw_txrx_mode txmode,
+ struct sk_buff *skb)
 {
-   struct ath10k_skb_cb *cb = ATH10K_SKB_CB(skb);
struct ath10k_htt *htt = >htt;
int ret = 0;
 
-   switch (cb->txmode) {
+   switch (txmode) {
case ATH10K_HW_TXRX_RAW:
case ATH10K_HW_TXRX_NATIVE_WIFI:
case ATH10K_HW_TXRX_ETHERNET:
-   ret = ath10k_htt_tx(htt, skb);
+   ret = ath10k_htt_tx(htt, txmode, skb);
break;
case ATH10K_HW_TXRX_MGMT:
if (test_bit(ATH10K_FW_FEATURE_HAS_WMI_MGMT_TX,
 ar->fw_features))
ret = ath10k_mac_tx_wmi_mgmt(ar, skb);
else if (ar->htt.target_version_major >= 3)
-   ret = ath10k_htt_tx(htt, skb);
+   ret = ath10k_htt_tx(htt, txmode, skb);
else
ret = ath10k_htt_mgmt_tx(htt, skb);
break;
@@ -3371,9 +3371,13 @@ void ath10k_offchan_tx_work(struct work_struct *work)
 {
struct ath10k *ar = container_of(work, struct ath10k, offchan_tx_work);
struct ath10k_peer *peer;
+   struct ath10k_vif *arvif;

[PATCH 8/8] ath10k: store msdu_id instead of txbuf pointers

2015-11-02 Thread Michal Kazior
Txbuf is no longer a DMA pool and can be easily
tracked with a mere msdu_id. This saves 10 bytes
on 64bit systems and 6 bytes on 32bit systems of
precious sk_buff control buffer.

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/core.h   |  6 +---
 drivers/net/wireless/ath/ath10k/htt_tx.c | 53 
 2 files changed, 27 insertions(+), 32 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.h 
b/drivers/net/wireless/ath/ath10k/core.h
index 728a5cbe9dfd..f8092a83be2d 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -92,12 +92,8 @@ struct ath10k_skb_cb {
dma_addr_t paddr;
u8 flags;
u8 eid;
+   u16 msdu_id;
struct ieee80211_vif *vif;
-
-   struct {
-   struct ath10k_htt_txbuf *txbuf;
-   u32 txbuf_paddr;
-   } __packed htt;
 } __packed;
 
 struct ath10k_skb_rxcb {
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c 
b/drivers/net/wireless/ath/ath10k/htt_tx.c
index a6fd96a18023..ce81babcc8bd 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -532,8 +532,6 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct 
sk_buff *msdu)
memcpy(cmd->mgmt_tx.hdr, msdu->data,
   min_t(int, msdu->len, HTT_MGMT_FRM_HDR_DOWNLOAD_LEN));
 
-   skb_cb->htt.txbuf = NULL;
-
res = ath10k_htc_send(>ar->htc, htt->eid, txdesc);
if (res)
goto err_unmap_msdu;
@@ -563,6 +561,7 @@ int ath10k_htt_tx(struct ath10k_htt *htt, enum 
ath10k_hw_txrx_mode txmode,
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(msdu);
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(msdu);
struct ath10k_hif_sg_item sg_items[2];
+   struct ath10k_htt_txbuf *txbuf;
struct htt_data_tx_desc_frag *frags;
u8 vdev_id = ath10k_htt_tx_get_vdev_id(ar, msdu);
u8 tid = ath10k_htt_tx_get_tid(msdu);
@@ -572,6 +571,7 @@ int ath10k_htt_tx(struct ath10k_htt *htt, enum 
ath10k_hw_txrx_mode txmode,
u16 msdu_id, flags1 = 0;
u16 freq = 0;
u32 frags_paddr = 0;
+   u32 txbuf_paddr;
struct htt_msdu_ext_desc *ext_desc = NULL;
bool limit_mgmt_desc = false;
bool is_probe_resp = false;
@@ -599,9 +599,9 @@ int ath10k_htt_tx(struct ath10k_htt *htt, enum 
ath10k_hw_txrx_mode txmode,
prefetch_len = min(htt->prefetch_len, msdu->len);
prefetch_len = roundup(prefetch_len, 4);
 
-   skb_cb->htt.txbuf = >txbuf.vaddr[msdu_id];
-   skb_cb->htt.txbuf_paddr = htt->txbuf.paddr +
-   (sizeof(struct ath10k_htt_txbuf) * msdu_id);
+   txbuf = >txbuf.vaddr[msdu_id];
+   txbuf_paddr = htt->txbuf.paddr +
+ (sizeof(struct ath10k_htt_txbuf) * msdu_id);
 
if ((ieee80211_is_action(hdr->frame_control) ||
 ieee80211_is_deauth(hdr->frame_control) ||
@@ -645,14 +645,14 @@ int ath10k_htt_tx(struct ath10k_htt *htt, enum 
ath10k_hw_txrx_mode txmode,
frags_paddr =  htt->frag_desc.paddr +
(sizeof(struct htt_msdu_ext_desc) * msdu_id);
} else {
-   frags = skb_cb->htt.txbuf->frags;
+   frags = txbuf->frags;
frags[0].dword_addr.paddr =
__cpu_to_le32(skb_cb->paddr);
frags[0].dword_addr.len = __cpu_to_le32(msdu->len);
frags[1].dword_addr.paddr = 0;
frags[1].dword_addr.len = 0;
 
-   frags_paddr = skb_cb->htt.txbuf_paddr;
+   frags_paddr = txbuf_paddr;
}
flags0 |= SM(txmode, HTT_DATA_TX_DESC_FLAGS0_PKT_TYPE);
break;
@@ -681,12 +681,11 @@ int ath10k_htt_tx(struct ath10k_htt *htt, enum 
ath10k_hw_txrx_mode txmode,
 * avoid extra memory allocations, compress data structures and thus
 * improve performance. */
 
-   skb_cb->htt.txbuf->htc_hdr.eid = htt->eid;
-   skb_cb->htt.txbuf->htc_hdr.len = __cpu_to_le16(
-   sizeof(skb_cb->htt.txbuf->cmd_hdr) +
-   sizeof(skb_cb->htt.txbuf->cmd_tx) +
-   prefetch_len);
-   skb_cb->htt.txbuf->htc_hdr.flags = 0;
+   txbuf->htc_hdr.eid = htt->eid;
+   txbuf->htc_hdr.len = __cpu_to_le16(sizeof(txbuf->cmd_hdr) +
+  sizeof(txbuf->cmd_tx) +
+  prefetch_len);
+   txbuf->htc_hdr.flags = 0;
 
if (skb_cb->flags & ATH10K_SKB_F_NO_HWCRYPT)
flags0 |= HTT_DATA_TX_DESC_FLAGS0_NO_ENCRYPT;
@@ -707,14 +706,14 @@ int ath10k_htt_tx(struct ath10k_htt *htt, enum 
ath10k_hw_txrx_mode txmode,
 */
flags1 |= HTT_DATA_TX_DESC_FLAGS1_POSTPONED;
 
-   skb_cb->htt.txbuf->cmd_hdr.msg_type = 

[PATCH 2/8] ath10k: rename function to adhere to naming convention

2015-11-02 Thread Michal Kazior
All functions should have ath10k_{filename}_
prefixes.

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

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 58230cd04174..14a705ca87b2 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3139,8 +3139,10 @@ static u8 ath10k_tx_h_get_vdev_id(struct ath10k *ar, 
struct ieee80211_vif *vif)
 }
 
 static enum ath10k_hw_txrx_mode
-ath10k_tx_h_get_txmode(struct ath10k *ar, struct ieee80211_vif *vif,
-  struct ieee80211_sta *sta, struct sk_buff *skb)
+ath10k_mac_tx_h_get_txmode(struct ath10k *ar,
+  struct ieee80211_vif *vif,
+  struct ieee80211_sta *sta,
+  struct sk_buff *skb)
 {
const struct ieee80211_hdr *hdr = (void *)skb->data;
__le16 fc = hdr->frame_control;
@@ -3653,7 +3655,8 @@ static void ath10k_tx(struct ieee80211_hw *hw,
ATH10K_SKB_CB(skb)->htt.tid = ath10k_tx_h_get_tid(hdr);
ATH10K_SKB_CB(skb)->htt.nohwcrypt = !ath10k_tx_h_use_hwcrypto(vif, skb);
ATH10K_SKB_CB(skb)->vdev_id = ath10k_tx_h_get_vdev_id(ar, vif);
-   ATH10K_SKB_CB(skb)->txmode = ath10k_tx_h_get_txmode(ar, vif, sta, skb);
+   ATH10K_SKB_CB(skb)->txmode = ath10k_mac_tx_h_get_txmode(ar, vif, sta,
+   skb);
 
switch (ATH10K_SKB_CB(skb)->txmode) {
case ATH10K_HW_TXRX_MGMT:
-- 
2.1.4

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


[PATCH 5/8] ath10k: remove freq from skb_cb

2015-11-02 Thread Michal Kazior
It was wasteful to keep it in the struct.

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/core.h   | 1 -
 drivers/net/wireless/ath/ath10k/htt_tx.c | 9 +++--
 drivers/net/wireless/ath/ath10k/mac.c| 5 +
 3 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.h 
b/drivers/net/wireless/ath/ath10k/core.h
index f24a5feb2220..64a248f780b9 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -88,7 +88,6 @@ struct ath10k_skb_cb {
 
struct {
u8 tid;
-   u16 freq;
bool nohwcrypt;
struct ath10k_htt_txbuf *txbuf;
u32 txbuf_paddr;
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c 
b/drivers/net/wireless/ath/ath10k/htt_tx.c
index bada9695a4fb..05ce99ad6ca2 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -531,6 +531,7 @@ int ath10k_htt_tx(struct ath10k_htt *htt, enum 
ath10k_hw_txrx_mode txmode,
struct ath10k *ar = htt->ar;
struct device *dev = ar->dev;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)msdu->data;
+   struct ieee80211_tx_info *info = IEEE80211_SKB_CB(msdu);
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(msdu);
struct ath10k_hif_sg_item sg_items[2];
struct htt_data_tx_desc_frag *frags;
@@ -540,6 +541,7 @@ int ath10k_htt_tx(struct ath10k_htt *htt, enum 
ath10k_hw_txrx_mode txmode,
int res;
u8 flags0 = 0;
u16 msdu_id, flags1 = 0;
+   u16 freq = 0;
u32 frags_paddr = 0;
struct htt_msdu_ext_desc *ext_desc = NULL;
bool limit_mgmt_desc = false;
@@ -591,6 +593,9 @@ int ath10k_htt_tx(struct ath10k_htt *htt, enum 
ath10k_hw_txrx_mode txmode,
goto err_free_msdu_id;
}
 
+   if (unlikely(info->flags & IEEE80211_TX_CTL_TX_OFFCHAN))
+   freq = ar->scan.roc_freq;
+
switch (txmode) {
case ATH10K_HW_TXRX_RAW:
case ATH10K_HW_TXRX_NATIVE_WIFI:
@@ -680,13 +685,13 @@ int ath10k_htt_tx(struct ath10k_htt *htt, enum 
ath10k_hw_txrx_mode txmode,
skb_cb->htt.txbuf->cmd_tx.id = __cpu_to_le16(msdu_id);
skb_cb->htt.txbuf->cmd_tx.frags_paddr = __cpu_to_le32(frags_paddr);
skb_cb->htt.txbuf->cmd_tx.peerid = __cpu_to_le16(HTT_INVALID_PEERID);
-   skb_cb->htt.txbuf->cmd_tx.freq = __cpu_to_le16(skb_cb->htt.freq);
+   skb_cb->htt.txbuf->cmd_tx.freq = __cpu_to_le16(freq);
 
trace_ath10k_htt_tx(ar, msdu_id, msdu->len, vdev_id, tid);
ath10k_dbg(ar, ATH10K_DBG_HTT,
   "htt tx flags0 %hhu flags1 %hu len %d id %hu frags_paddr 
%08x, msdu_paddr %08x vdev %hhu tid %hhu freq %hu\n",
   flags0, flags1, msdu->len, msdu_id, frags_paddr,
-  (u32)skb_cb->paddr, vdev_id, tid, skb_cb->htt.freq);
+  (u32)skb_cb->paddr, vdev_id, tid, freq);
ath10k_dbg_dump(ar, ATH10K_DBG_HTT_DUMP, NULL, "htt tx msdu: ",
msdu->data, msdu->len);
trace_ath10k_tx_hdr(ar, msdu->data, msdu->len);
diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 9c76934b3bf0..ddf2ad2f3955 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3517,6 +3517,7 @@ void __ath10k_scan_finish(struct ath10k *ar)
case ATH10K_SCAN_STARTING:
ar->scan.state = ATH10K_SCAN_IDLE;
ar->scan_channel = NULL;
+   ar->scan.roc_freq = 0;
ath10k_offchan_tx_purge(ar);
cancel_delayed_work(>scan.timeout);
complete_all(>scan.completed);
@@ -3672,7 +3673,6 @@ static void ath10k_tx(struct ieee80211_hw *hw,
 
txmode = ath10k_mac_tx_h_get_txmode(ar, vif, sta, skb);
 
-   ATH10K_SKB_CB(skb)->htt.freq = 0;
ATH10K_SKB_CB(skb)->htt.tid = ath10k_tx_h_get_tid(hdr);
ATH10K_SKB_CB(skb)->htt.nohwcrypt = !ath10k_tx_h_use_hwcrypto(vif, skb);
ATH10K_SKB_CB(skb)->vdev_id = ath10k_tx_h_get_vdev_id(ar, vif);
@@ -3697,13 +3697,10 @@ static void ath10k_tx(struct ieee80211_hw *hw,
 
if (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) {
spin_lock_bh(>data_lock);
-   ATH10K_SKB_CB(skb)->htt.freq = ar->scan.roc_freq;
ATH10K_SKB_CB(skb)->vdev_id = ar->scan.vdev_id;
spin_unlock_bh(>data_lock);
 
if (ath10k_mac_need_offchan_tx_work(ar)) {
-   ATH10K_SKB_CB(skb)->htt.freq = 0;
-
ath10k_dbg(ar, ATH10K_DBG_MAC, "queued offchannel skb 
%p\n",
   skb);
 
-- 
2.1.4

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


[PATCH 7/8] ath10k: replace vdev_id and tid in skb cb

2015-11-02 Thread Michal Kazior
This prepares the driver for future ieee80211_txq
and wake_tx_queue() support.

Signed-off-by: Michal Kazior 
---
 drivers/net/wireless/ath/ath10k/core.h   |  4 ++--
 drivers/net/wireless/ath/ath10k/htt_tx.c | 35 +---
 drivers/net/wireless/ath/ath10k/mac.c| 40 +---
 drivers/net/wireless/ath/ath10k/wmi.c| 10 +++-
 4 files changed, 49 insertions(+), 40 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.h 
b/drivers/net/wireless/ath/ath10k/core.h
index 59ec9a8098d0..728a5cbe9dfd 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -85,16 +85,16 @@ enum ath10k_skb_flags {
ATH10K_SKB_F_NO_HWCRYPT = BIT(0),
ATH10K_SKB_F_DTIM_ZERO = BIT(1),
ATH10K_SKB_F_DELIVER_CAB = BIT(2),
+   ATH10K_SKB_F_QOS = BIT(3),
 };
 
 struct ath10k_skb_cb {
dma_addr_t paddr;
u8 flags;
u8 eid;
-   u8 vdev_id;
+   struct ieee80211_vif *vif;
 
struct {
-   u8 tid;
struct ath10k_htt_txbuf *txbuf;
u32 txbuf_paddr;
} __packed htt;
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c 
b/drivers/net/wireless/ath/ath10k/htt_tx.c
index a572576bf6c4..a6fd96a18023 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -439,6 +439,35 @@ int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt,
return 0;
 }
 
+static u8 ath10k_htt_tx_get_vdev_id(struct ath10k *ar, struct sk_buff *skb)
+{
+   struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+   struct ath10k_skb_cb *cb = ATH10K_SKB_CB(skb);
+   struct ath10k_vif *arvif = (void *)cb->vif->drv_priv;
+
+   if (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN)
+   return ar->scan.vdev_id;
+   else if (cb->vif)
+   return arvif->vdev_id;
+   else if (ar->monitor_started)
+   return ar->monitor_vdev_id;
+   else
+   return 0;
+}
+
+static u8 ath10k_htt_tx_get_tid(struct sk_buff *skb)
+{
+   struct ieee80211_hdr *hdr = (void *)skb->data;
+   struct ath10k_skb_cb *cb = ATH10K_SKB_CB(skb);
+
+   if (ieee80211_is_mgmt(hdr->frame_control))
+   return HTT_DATA_TX_EXT_TID_MGMT;
+   else if (cb->flags & ATH10K_SKB_F_QOS)
+   return skb->priority % IEEE80211_QOS_CTL_TID_MASK;
+   else
+   return HTT_DATA_TX_EXT_TID_NON_QOS_MCAST_BCAST;
+}
+
 int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
 {
struct ath10k *ar = htt->ar;
@@ -446,7 +475,7 @@ int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct 
sk_buff *msdu)
struct sk_buff *txdesc = NULL;
struct htt_cmd *cmd;
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(msdu);
-   u8 vdev_id = skb_cb->vdev_id;
+   u8 vdev_id = ath10k_htt_tx_get_vdev_id(ar, msdu);
int len = 0;
int msdu_id = -1;
int res;
@@ -535,8 +564,8 @@ int ath10k_htt_tx(struct ath10k_htt *htt, enum 
ath10k_hw_txrx_mode txmode,
struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(msdu);
struct ath10k_hif_sg_item sg_items[2];
struct htt_data_tx_desc_frag *frags;
-   u8 vdev_id = skb_cb->vdev_id;
-   u8 tid = skb_cb->htt.tid;
+   u8 vdev_id = ath10k_htt_tx_get_vdev_id(ar, msdu);
+   u8 tid = ath10k_htt_tx_get_tid(msdu);
int prefetch_len;
int res;
u8 flags0 = 0;
diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 105a2e61c2ae..20b6639b978c 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -3112,32 +3112,6 @@ void ath10k_mac_handle_tx_pause_vdev(struct ath10k *ar, 
u32 vdev_id,
spin_unlock_bh(>htt.tx_lock);
 }
 
-static u8 ath10k_tx_h_get_tid(struct ieee80211_hdr *hdr)
-{
-   if (ieee80211_is_mgmt(hdr->frame_control))
-   return HTT_DATA_TX_EXT_TID_MGMT;
-
-   if (!ieee80211_is_data_qos(hdr->frame_control))
-   return HTT_DATA_TX_EXT_TID_NON_QOS_MCAST_BCAST;
-
-   if (!is_unicast_ether_addr(ieee80211_get_DA(hdr)))
-   return HTT_DATA_TX_EXT_TID_NON_QOS_MCAST_BCAST;
-
-   return ieee80211_get_qos_ctl(hdr)[0] & IEEE80211_QOS_CTL_TID_MASK;
-}
-
-static u8 ath10k_tx_h_get_vdev_id(struct ath10k *ar, struct ieee80211_vif *vif)
-{
-   if (vif)
-   return ath10k_vif_to_arvif(vif)->vdev_id;
-
-   if (ar->monitor_started)
-   return ar->monitor_vdev_id;
-
-   ath10k_warn(ar, "failed to resolve vdev id\n");
-   return 0;
-}
-
 static enum ath10k_hw_txrx_mode
 ath10k_mac_tx_h_get_txmode(struct ath10k *ar,
   struct ieee80211_vif *vif,
@@ -3234,7 +3208,7 @@ static void ath10k_tx_h_nwifi(struct ieee80211_hw *hw, 
struct sk_buff *skb)
 */
hdr = (void *)skb->data;
if 

[PATCH] offchannel: Cancel the pending_action TX wait, before starting new one.

2015-11-02 Thread Chaitanya T K
From: tkc 

From: Chaitanya T K 

Before the tx_status is received for the action frame, if we
get another request, we respond to that by freeing the memory
for pending_action_tx, but we don't cancel the TX wait, so
in the kernel the ROC will not be cancelled.

Due to above issue, wpa_supplicant assumes that all pending
RoC's are cancelled and proceeds with interface creation and
connection, where as state in mac80211/driver will be roc_in_progress.

This is leading to issues at driver level.

Signed-off-by: Chaitanya T K 
---
 wpa_supplicant/offchannel.c |8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/wpa_supplicant/offchannel.c b/wpa_supplicant/offchannel.c
index 6b3f83c..bd2f905 100644
--- a/wpa_supplicant/offchannel.c
+++ b/wpa_supplicant/offchannel.c
@@ -254,13 +254,7 @@ int offchannel_send_action(struct wpa_supplicant *wpa_s, 
unsigned int freq,
wpa_s->pending_action_tx_status_cb = tx_cb;
 
if (wpa_s->pending_action_tx) {
-   wpa_printf(MSG_DEBUG, "Off-channel: Dropped pending Action "
-  "frame TX to " MACSTR " (pending_action_tx=%p)",
-  MAC2STR(wpa_s->pending_action_dst),
-  wpa_s->pending_action_tx);
-   wpa_hexdump_buf(MSG_MSGDUMP, "Pending TX frame",
-   wpa_s->pending_action_tx);
-   wpabuf_free(wpa_s->pending_action_tx);
+   offchannel_send_action_done(wpa_s);
}
wpa_s->pending_action_tx_done = 0;
wpa_s->pending_action_tx = wpabuf_alloc(len);
-- 
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: [PATCH v2] ath9k: Add support for ITS-G5 band (5.9 GHz)

2015-11-02 Thread Jouni Malinen
On Mon, Nov 02, 2015 at 06:33:45PM +0100, Michal Sojka wrote:
> Can this be solved by having proper/new regulatory flags on these
> channels that would prohibit running AP or scanning on these channels?

I'm not sure that alone is sufficient, but yes, I think this should be
done as part of the solution. On the 5.9 GHz band, cfg80211 should allow
only the operations modes that are appropriate for that band.

> I expect that there will be quite a lot applications/devices that will
> need to communicate in this band. From technical point of view, it might
> be beneficial if there is one solid implementation available in the
> upstream Linux. I'm not sure about the legal point of view.

I agree that it would be convenient and maybe even beneficial in the end
as long as it is done in a way that meets the requirements for enforcing
rules on the licensed band.

> Can you image this "proper regulatory rule enforcement" as a part of
> upstream Linux? Do you have an idea how it would look like?

I'm not sure what would be sufficient. In general, I'm hesitant on
enabling any licensed bands for Wi-Fi operations by default regardless
of what the kernel configuration is.

> Would kernel config option + custom regdb be sufficient?

That would certainly be much closer to what I'd like to see from the
regulatory enforcement view point; not sure how convenient this is to
use with ath9k. I think the custom regdb route (i.e., require someone to
knowingly generate the explicit rules to enable the licensed bands and
only distribute the regdb with these changes to properly licensed users)
was one of the approaches discussed in the past for this type of use
cases.

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


Re: [PATCH v2] ath9k: Add support for ITS-G5 band (5.9 GHz)

2015-11-02 Thread Michal Sojka
On Mon, Nov 02 2015, Jouni Malinen wrote:
> On Mon, Nov 02, 2015 at 06:33:45PM +0100, Michal Sojka wrote:
>> Can this be solved by having proper/new regulatory flags on these
>> channels that would prohibit running AP or scanning on these channels?
>
> I'm not sure that alone is sufficient, but yes, I think this should be
> done as part of the solution. On the 5.9 GHz band, cfg80211 should allow
> only the operations modes that are appropriate for that band.

We discussed that about a year ago [1]. The thing is that regulatory
documents do not talk about modes (at least in Europe). They only talk
about channel widths, EIRP etc. and say that the band is designated for
Intelligent Transportation System (ITS) applications. Only the ITS
standards (e.g. ETSI EN 302 663) talk about OCB mode. From the last
year's discussion I took away that we should not restrict these bands to
OCB only, because regulatory documents do not require it. But I might
get it wrong.

[1] http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg656581.html
>
>> I expect that there will be quite a lot applications/devices that will
>> need to communicate in this band. From technical point of view, it might
>> be beneficial if there is one solid implementation available in the
>> upstream Linux. I'm not sure about the legal point of view.
>
> I agree that it would be convenient and maybe even beneficial in the end
> as long as it is done in a way that meets the requirements for enforcing
> rules on the licensed band.
>
>> Can you image this "proper regulatory rule enforcement" as a part of
>> upstream Linux? Do you have an idea how it would look like?
>
> I'm not sure what would be sufficient. In general, I'm hesitant on
> enabling any licensed bands for Wi-Fi operations by default regardless
> of what the kernel configuration is.
>
>> Would kernel config option + custom regdb be sufficient?
>
> That would certainly be much closer to what I'd like to see from the
> regulatory enforcement view point; not sure how convenient this is to
> use with ath9k.

Hmm, ath9k is the hardware that we can currently play with. Can you
suggest another hardware that supports 5.9 GHz and a driver that would
be more convenient to develop with?

> I think the custom regdb route (i.e., require someone to knowingly
> generate the explicit rules to enable the licensed bands and only
> distribute the regdb with these changes to properly licensed users)
> was one of the approaches discussed in the past for this type of use
> cases.

Thanks for all the input. We will try to come up with another solution.

Regards.
-Michal
--
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] ath9k: Add support for ITS-G5 band (5.9 GHz)

2015-11-02 Thread Jouni Malinen
On Mon, Nov 02, 2015 at 07:38:57PM +0100, Michal Sojka wrote:
> We discussed that about a year ago [1]. The thing is that regulatory
> documents do not talk about modes (at least in Europe). They only talk
> about channel widths, EIRP etc. and say that the band is designated for
> Intelligent Transportation System (ITS) applications. Only the ITS
> standards (e.g. ETSI EN 302 663) talk about OCB mode. From the last
> year's discussion I took away that we should not restrict these bands to
> OCB only, because regulatory documents do not require it. But I might
> get it wrong.
> 
> [1] http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg656581.html

In some sense, I agree with that, but taken into account that I'm much
more concerned about accidentally using this band, I think there is
justification for adding that extra constraint of allowing only the OCB
mode to be used even if the regulatory requirements may not explicitly
say so. Especially the behavior of including these channels with active
scanning allowed in all full scans is something that really must not be
enabled.

> Hmm, ath9k is the hardware that we can currently play with. Can you
> suggest another hardware that supports 5.9 GHz and a driver that would
> be more convenient to develop with?

I don't think there is any hardware alternative that would be more
convenient for this type of efforts than chips supported by ath9k. It is
just that the needs of this project are somewhat in conflict with the
needs of regulatory rule enforcement for most other use cases.. :)

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


[PATCH v2] ath10k: Add support for pktlog in QCA99X0

2015-11-02 Thread Vivek Natarajan
This patch adds pktlog support for 10.4 fw versions.

Signed-off-by: Vivek Natarajan 
---
v2: Move pktlog_completion_handler to htt_rx.c

 drivers/net/wireless/ath/ath10k/htt.h|  2 ++
 drivers/net/wireless/ath/ath10k/htt_rx.c | 12 
 drivers/net/wireless/ath/ath10k/hw.h | 10 ++
 drivers/net/wireless/ath/ath10k/pci.c| 11 +++
 4 files changed, 35 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/htt.h 
b/drivers/net/wireless/ath/ath10k/htt.h
index 2bad50e..74ccfb29 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -1598,5 +1598,7 @@ int ath10k_htt_tx_alloc_msdu_id(struct ath10k_htt *htt, 
struct sk_buff *skb);
 void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id);
 int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *);
 int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *);
+void ath10k_htt_rx_pktlog_completion_handler(struct ath10k *ar,
+struct sk_buff *skb);
 
 #endif
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c 
b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 6060dda..d1dc1ba 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -2127,6 +2127,18 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, 
struct sk_buff *skb)
 }
 EXPORT_SYMBOL(ath10k_htt_t2h_msg_handler);
 
+void ath10k_htt_rx_pktlog_completion_handler(struct ath10k *ar,
+struct sk_buff *skb)
+{
+   struct ath10k_pktlog_10_4_hdr *hdr =
+   (struct ath10k_pktlog_10_4_hdr *)skb->data;
+
+   trace_ath10k_htt_pktlog(ar, hdr->payload,
+   sizeof(*hdr) + __le16_to_cpu(hdr->size));
+   dev_kfree_skb_any(skb);
+}
+EXPORT_SYMBOL(ath10k_htt_rx_pktlog_completion_handler);
+
 static void ath10k_htt_txrx_compl_task(unsigned long ptr)
 {
struct ath10k_htt *htt = (struct ath10k_htt *)ptr;
diff --git a/drivers/net/wireless/ath/ath10k/hw.h 
b/drivers/net/wireless/ath/ath10k/hw.h
index 2d87737..2fd5dc1 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -261,6 +261,16 @@ struct ath10k_pktlog_hdr {
u8 payload[0];
 } __packed;
 
+struct ath10k_pktlog_10_4_hdr {
+   __le16 flags;
+   __le16 missed_cnt;
+   __le16 log_type;
+   __le16 size;
+   __le32 timestamp;
+   __le32 type_specific_data;
+   u8 payload[0];
+} __packed;
+
 enum ath10k_hw_rate_ofdm {
ATH10K_HW_RATE_OFDM_48M = 0,
ATH10K_HW_RATE_OFDM_24M,
diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 5c05b0c..5fed194 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -108,6 +108,7 @@ static void ath10k_pci_htc_tx_cb(struct ath10k_ce_pipe 
*ce_state);
 static void ath10k_pci_htc_rx_cb(struct ath10k_ce_pipe *ce_state);
 static void ath10k_pci_htt_tx_cb(struct ath10k_ce_pipe *ce_state);
 static void ath10k_pci_htt_rx_cb(struct ath10k_ce_pipe *ce_state);
+static void ath10k_pci_pktlog_rx_cb(struct ath10k_ce_pipe *ce_state);
 
 static const struct ce_attr host_ce_config_wlan[] = {
/* CE0: host->target HTC control and raw streams */
@@ -186,6 +187,7 @@ static const struct ce_attr host_ce_config_wlan[] = {
.src_nentries = 0,
.src_sz_max = 2048,
.dest_nentries = 128,
+   .recv_cb = ath10k_pci_pktlog_rx_cb,
},
 
/* CE9 target autonomous qcache memcpy */
@@ -1230,6 +1232,15 @@ static void ath10k_pci_htc_rx_cb(struct ath10k_ce_pipe 
*ce_state)
ath10k_pci_process_rx_cb(ce_state, ath10k_htc_rx_completion_handler);
 }
 
+/* Called by lower (CE) layer when data is received from the Target.
+ * Only 10.4 firmware uses separate CE to transfer pktlog data.
+ */
+static void ath10k_pci_pktlog_rx_cb(struct ath10k_ce_pipe *ce_state)
+{
+   ath10k_pci_process_rx_cb(ce_state,
+ath10k_htt_rx_pktlog_completion_handler);
+}
+
 /* Called by lower (CE) layer when a send to HTT Target completes. */
 static void ath10k_pci_htt_tx_cb(struct ath10k_ce_pipe *ce_state)
 {
-- 
1.9.1

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


[PATCH v2] ath10k: Add support for pktlog in QCA99X0

2015-11-02 Thread Vivek Natarajan
This patch adds pktlog support for 10.4 fw versions.

Signed-off-by: Vivek Natarajan 
---
v2: Move pktlog_completion_handler to htt_rx.c

 drivers/net/wireless/ath/ath10k/htt.h|  2 ++
 drivers/net/wireless/ath/ath10k/htt_rx.c | 12 
 drivers/net/wireless/ath/ath10k/hw.h | 10 ++
 drivers/net/wireless/ath/ath10k/pci.c| 11 +++
 4 files changed, 35 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/htt.h 
b/drivers/net/wireless/ath/ath10k/htt.h
index 2bad50e..74ccfb29 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -1598,5 +1598,7 @@ int ath10k_htt_tx_alloc_msdu_id(struct ath10k_htt *htt, 
struct sk_buff *skb);
 void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id);
 int ath10k_htt_mgmt_tx(struct ath10k_htt *htt, struct sk_buff *);
 int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *);
+void ath10k_htt_rx_pktlog_completion_handler(struct ath10k *ar,
+struct sk_buff *skb);
 
 #endif
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c 
b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 6060dda..d1dc1ba 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -2127,6 +2127,18 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, 
struct sk_buff *skb)
 }
 EXPORT_SYMBOL(ath10k_htt_t2h_msg_handler);
 
+void ath10k_htt_rx_pktlog_completion_handler(struct ath10k *ar,
+struct sk_buff *skb)
+{
+   struct ath10k_pktlog_10_4_hdr *hdr =
+   (struct ath10k_pktlog_10_4_hdr *)skb->data;
+
+   trace_ath10k_htt_pktlog(ar, hdr->payload,
+   sizeof(*hdr) + __le16_to_cpu(hdr->size));
+   dev_kfree_skb_any(skb);
+}
+EXPORT_SYMBOL(ath10k_htt_rx_pktlog_completion_handler);
+
 static void ath10k_htt_txrx_compl_task(unsigned long ptr)
 {
struct ath10k_htt *htt = (struct ath10k_htt *)ptr;
diff --git a/drivers/net/wireless/ath/ath10k/hw.h 
b/drivers/net/wireless/ath/ath10k/hw.h
index 2d87737..2fd5dc1 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -261,6 +261,16 @@ struct ath10k_pktlog_hdr {
u8 payload[0];
 } __packed;
 
+struct ath10k_pktlog_10_4_hdr {
+   __le16 flags;
+   __le16 missed_cnt;
+   __le16 log_type;
+   __le16 size;
+   __le32 timestamp;
+   __le32 type_specific_data;
+   u8 payload[0];
+} __packed;
+
 enum ath10k_hw_rate_ofdm {
ATH10K_HW_RATE_OFDM_48M = 0,
ATH10K_HW_RATE_OFDM_24M,
diff --git a/drivers/net/wireless/ath/ath10k/pci.c 
b/drivers/net/wireless/ath/ath10k/pci.c
index 5c05b0c..5fed194 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -108,6 +108,7 @@ static void ath10k_pci_htc_tx_cb(struct ath10k_ce_pipe 
*ce_state);
 static void ath10k_pci_htc_rx_cb(struct ath10k_ce_pipe *ce_state);
 static void ath10k_pci_htt_tx_cb(struct ath10k_ce_pipe *ce_state);
 static void ath10k_pci_htt_rx_cb(struct ath10k_ce_pipe *ce_state);
+static void ath10k_pci_pktlog_rx_cb(struct ath10k_ce_pipe *ce_state);
 
 static const struct ce_attr host_ce_config_wlan[] = {
/* CE0: host->target HTC control and raw streams */
@@ -186,6 +187,7 @@ static const struct ce_attr host_ce_config_wlan[] = {
.src_nentries = 0,
.src_sz_max = 2048,
.dest_nentries = 128,
+   .recv_cb = ath10k_pci_pktlog_rx_cb,
},
 
/* CE9 target autonomous qcache memcpy */
@@ -1230,6 +1232,15 @@ static void ath10k_pci_htc_rx_cb(struct ath10k_ce_pipe 
*ce_state)
ath10k_pci_process_rx_cb(ce_state, ath10k_htc_rx_completion_handler);
 }
 
+/* Called by lower (CE) layer when data is received from the Target.
+ * Only 10.4 firmware uses separate CE to transfer pktlog data.
+ */
+static void ath10k_pci_pktlog_rx_cb(struct ath10k_ce_pipe *ce_state)
+{
+   ath10k_pci_process_rx_cb(ce_state,
+ath10k_htt_rx_pktlog_completion_handler);
+}
+
 /* Called by lower (CE) layer when a send to HTT Target completes. */
 static void ath10k_pci_htt_tx_cb(struct ath10k_ce_pipe *ce_state)
 {
-- 
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] ath10k: fix invalid NSS for 4x4 devices

2015-11-02 Thread Rajkumar Manoharan
The number of spatial streams that are derived from chain mask
for 4x4 devices is using wrong bitmask and conditional check.
This is affecting downlink throughput for QCA99x0 devices. Earlier
cfg_tx_chainmask is not filled by default until user configured it
and so get_nss_from_chainmask never be called. This issue is exposed
by recent commit 166de3f1895d ("ath10k: remove supported chain mask").
By default maximum supported chain mask is filled in cfg_tx_chainmask.

Cc: sta...@vger.kernel.org
Fixes: 5572a95b4b ("ath10k: apply chainmask settings to vdev on
creation")
Signed-off-by: Rajkumar Manoharan 
---
 drivers/net/wireless/ath/ath10k/mac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index a7411fe..95a55405 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -4225,7 +4225,7 @@ static int ath10k_config(struct ieee80211_hw *hw, u32 
changed)
 
 static u32 get_nss_from_chainmask(u16 chain_mask)
 {
-   if ((chain_mask & 0x15) == 0x15)
+   if ((chain_mask & 0xf) == 0xf)
return 4;
else if ((chain_mask & 0x7) == 0x7)
return 3;
-- 
2.6.2

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


Re: [PATCH v2] ath10k: Add support for pktlog in QCA99X0

2015-11-02 Thread Vivek Natarajan
On Tue, Nov 3, 2015 at 11:49 AM, Vivek Natarajan
 wrote:
> This patch adds pktlog support for 10.4 fw versions.

Some issues with the mail client. Please ignore.

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


[PATCH 1/5] staging: wilc1000: change enum variable name with lower case

2015-11-02 Thread Glen Lee
This patch changes WID_TYPE with wid_type which is preferred style.

Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/coreconfigurator.h | 2 +-
 drivers/staging/wilc1000/wilc_wlan_if.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.h 
b/drivers/staging/wilc1000/coreconfigurator.h
index 1ea5f47..7545856 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -72,7 +72,7 @@ typedef enum {
 
 struct wid {
u16 id;
-   enum WID_TYPE type;
+   enum wid_type type;
s32 size;
s8 *val;
 };
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h 
b/drivers/staging/wilc1000/wilc_wlan_if.h
index 1170169..be90558 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -312,7 +312,7 @@ typedef enum {
SW_TRIGGER_ABORT,
 } TX_ABORT_OPTION_T;
 
-enum WID_TYPE {
+enum wid_type {
WID_CHAR= 0,
WID_SHORT   = 1,
WID_INT = 2,
-- 
1.9.1

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


[PATCH 2/5] staging: wilc1000: send_config_pkt: use netdev print

2015-11-02 Thread Glen Lee
This patch use netdev_xxx print format instead of custom print api and printk.

Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/coreconfigurator.c | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index 74fb556..637e8ca 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -593,15 +593,16 @@ s32 send_config_pkt(struct net_device *dev, u8 mode, 
struct wid *wids,
 
if (mode == GET_CFG) {
for (counter = 0; counter < count; counter++) {
-   PRINT_INFO(CORECONFIG_DBG, "Sending CFG packet 
[%d][%d]\n", !counter,
-  (counter == count - 1));
+   netdev_info(dev, "Sending CFG packet [%d][%d]\n",
+   !counter, (counter == count - 1));
if (!wilc_wlan_cfg_get(dev,
   !counter,
   wids[counter].id,
   (counter == count - 1),
   drv)) {
ret = -1;
-   printk("[Sendconfigpkt]Get Timed out\n");
+   netdev_err(dev,
+  "[Sendconfigpkt]Get Timed out\n");
break;
}
}
@@ -615,7 +616,8 @@ s32 send_config_pkt(struct net_device *dev, u8 mode, struct 
wid *wids,
}
} else if (mode == SET_CFG) {
for (counter = 0; counter < count; counter++) {
-   PRINT_D(CORECONFIG_DBG, "Sending config SET PACKET 
WID:%x\n", wids[counter].id);
+   netdev_info(dev, "Sending config SET PACKET WID:%x\n",
+   wids[counter].id);
if (!wilc_wlan_cfg_set(dev,
   !counter,
   wids[counter].id,
@@ -624,7 +626,8 @@ s32 send_config_pkt(struct net_device *dev, u8 mode, struct 
wid *wids,
   (counter == count - 1),
   drv)) {
ret = -1;
-   printk("[Sendconfigpkt]Set Timed out\n");
+   netdev_err(dev,
+  "[Sendconfigpkt]Set Timed out\n");
break;
}
}
-- 
1.9.1

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


[PATCH 5/5] staging: wilc1000: move send_config_pkt to wilc_wlan.c

2015-11-02 Thread Glen Lee
send_config_pkt function and it's related structure wid_type is moved to
wilc_wlan.c because wilc_wlan.c handle message transport. the coreconfigurator
is all about frames, so it will be frame.[ch] later.

Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/coreconfigurator.c | 64 -
 drivers/staging/wilc1000/coreconfigurator.h |  9 
 drivers/staging/wilc1000/wilc_wlan.c| 49 ++
 drivers/staging/wilc1000/wilc_wlan.h|  9 
 4 files changed, 58 insertions(+), 73 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index 3ddbe23..1caa66e 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -570,67 +570,3 @@ s32 DeallocateAssocRespInfo(tstrConnectRespInfo 
*pstrConnectRespInfo)
 
return s32Error;
 }
-
-/**
- *  @brief  sends certain Configuration Packet based on the input 
WIDs pstrWIDs
- *  using driver config layer
- *
- *  @details
- *  @param[in]  pstrWIDs WIDs to be sent in the configuration packet
- *  @param[in]  u32WIDsCount number of WIDs to be sent in the configuration 
packet
- *  @param[out] pu8RxResp The received Packet Response
- *  @param[out] ps32RxRespLen Length of the received Packet Response
- *  @return Error code indicating success/failure
- *  @note
- *  @authormabubakr
- *  @date  1 Mar 2012
- *  @version   1.0
- */
-s32 send_config_pkt(struct net_device *dev, u8 mode, struct wid *wids,
-   u32 count, u32 drv)
-{
-   s32 counter = 0, ret = 0;
-
-   if (mode == GET_CFG) {
-   for (counter = 0; counter < count; counter++) {
-   netdev_info(dev, "Sending CFG packet [%d][%d]\n",
-   !counter, (counter == count - 1));
-   if (!wilc_wlan_cfg_get(dev,
-  !counter,
-  wids[counter].id,
-  (counter == count - 1),
-  drv)) {
-   ret = -EBUSY;
-   netdev_err(dev,
-  "[Sendconfigpkt]Get Timed out\n");
-   break;
-   }
-   }
-   counter = 0;
-   for (counter = 0; counter < count; counter++) {
-   wids[counter].size = wilc_wlan_cfg_get_val(
-   wids[counter].id,
-   wids[counter].val,
-   wids[counter].size);
-   }
-   } else if (mode == SET_CFG) {
-   for (counter = 0; counter < count; counter++) {
-   netdev_info(dev, "Sending config SET PACKET WID:%x\n",
-   wids[counter].id);
-   if (!wilc_wlan_cfg_set(dev,
-  !counter,
-  wids[counter].id,
-  wids[counter].val,
-  wids[counter].size,
-  (counter == count - 1),
-  drv)) {
-   ret = -EBUSY;
-   netdev_err(dev,
-  "[Sendconfigpkt]Set Timed out\n");
-   break;
-   }
-   }
-   }
-
-   return ret;
-}
diff --git a/drivers/staging/wilc1000/coreconfigurator.h 
b/drivers/staging/wilc1000/coreconfigurator.h
index 7545856..7702a0f 100644
--- a/drivers/staging/wilc1000/coreconfigurator.h
+++ b/drivers/staging/wilc1000/coreconfigurator.h
@@ -70,13 +70,6 @@ typedef enum {
CONNECT_STS_FORCE_16_BIT = 0x
 } tenuConnectSts;
 
-struct wid {
-   u16 id;
-   enum wid_type type;
-   s32 size;
-   s8 *val;
-};
-
 typedef struct {
u8 u8Full;
u8 u8Index;
@@ -127,8 +120,6 @@ typedef struct {
size_t ie_len;
 } tstrDisconnectNotifInfo;
 
-s32 send_config_pkt(struct net_device *dev, u8 mode, struct wid *wids,
-   u32 count, u32 drv);
 s32 parse_network_info(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo);
 s32 DeallocateNetworkInfo(tstrNetworkInfo *pstrNetworkInfo);
 
diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 152dba5..44787b0 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -2104,3 +2104,52 @@ u16 set_machw_change_vir_if(struct net_device *dev, bool 
bValue)
 
return ret;
 }
+
+s32 send_config_pkt(struct net_device *dev, u8 mode, 

[PATCH 3/5] staging: wilc1000: send_config_pkt: return linux error number

2015-11-02 Thread Glen Lee
Use proper linux error number instead of -1.

Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/coreconfigurator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c 
b/drivers/staging/wilc1000/coreconfigurator.c
index 637e8ca..1842f8f 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -600,7 +600,7 @@ s32 send_config_pkt(struct net_device *dev, u8 mode, struct 
wid *wids,
   wids[counter].id,
   (counter == count - 1),
   drv)) {
-   ret = -1;
+   ret = -EBUSY;
netdev_err(dev,
   "[Sendconfigpkt]Get Timed out\n");
break;
@@ -625,7 +625,7 @@ s32 send_config_pkt(struct net_device *dev, u8 mode, struct 
wid *wids,
   wids[counter].size,
   (counter == count - 1),
   drv)) {
-   ret = -1;
+   ret = -EBUSY;
netdev_err(dev,
   "[Sendconfigpkt]Set Timed out\n");
break;
-- 
1.9.1

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


Re: Intel 7260 - limited in 5GHz spectrum

2015-11-02 Thread Pushpal Sidhu
On Sat, Oct 31, 2015 at 12:12 PM, Grumbach, Emmanuel
 wrote:
> Hi,
>
> On 10/30/2015 06:37 PM, Pushpal Sidhu wrote:
>> Hi,
>>
>> I've been working with the Intel 7260 card which advertises itself as
>> dual band wireless AC card. However, I cannot get it working in AP
>> mode in the 5GHz range. An $(iw list) shows that the entire 5GHz band
>> has 'no IR' next to it so as not to allow device radiation (please see
>> pastebin here: http://pastebin.com/T4BWnBmn).
>>
>> After searching around the internet a bit, it seems that the card
>> doesn't allow for this mode (And is thus not really dual band?). I'd
>> like to know if this is a firmware limitation and if there's a fix in
>> place, or if not, why is this card limited to the spectrum it can
>> radiate at?
>>
>
>
> 7260 does not (and will not) support AP mode in 5GHz band. This is of
> course not a hardware limitation since it can function as a station in
> this band. The limitation is due to regulatory concerns. Later devices
> (8260) have the ability to be an AP in 5GHz under certain circumstances.

Ah, thank you for the clarification.

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


[PATCH 2/2] ath10k: Fix peerid configuration in htt tx desc for htt version < 3.4

2015-11-02 Thread Vasanthakumar Thiagarajan
Of a word in struct htt_data_tx_desc htt version >= 3.4 firmware uses LSB 16-bit
for frequency configuration which is used for offchannel tx and MSB 16-bit
is for peerid. But other firmwares using version 2.X (10.1, 10.2.2, 10.2.4
and 10.4) are using 32-bit for peerid in htt tx desc. So far no issue is found
with the existing code setting peerid and freq for HTT version 2.X, this could
be mainly because of 0 as frequecy (home channel) is being always passed with
those firmwares. There may be issues when non-zero freq is passed with firmware
using < 3.4 htt version. To be safe use target_version_major and 
target_version_minor
along with htt-op-version before configuring peer id and freq in htt tx desc.

Fixes: 8d6d36243610 ("ath10k: fix offchan reliability")
Signed-off-by: Vasanthakumar Thiagarajan 
---
 drivers/net/wireless/ath/ath10k/htt.h|  9 +++--
 drivers/net/wireless/ath/ath10k/htt_tx.c | 13 +++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/htt.h 
b/drivers/net/wireless/ath/ath10k/htt.h
index 2bad50e..44fb4f2 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -166,8 +166,13 @@ struct htt_data_tx_desc {
__le16 len;
__le16 id;
__le32 frags_paddr;
-   __le16 peerid;
-   __le16 freq;
+   union {
+   __le32 peerid;
+   struct {
+   __le16 peerid;
+   __le16 freq;
+   } __packed offchan_tx;
+   } __packed;
u8 prefetch[0]; /* start of frame, for FW classification engine */
 } __packed;
 
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c 
b/drivers/net/wireless/ath/ath10k/htt_tx.c
index 1682397..bf19247 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -681,8 +681,17 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff 
*msdu)
skb_cb->htt.txbuf->cmd_tx.len = __cpu_to_le16(msdu->len);
skb_cb->htt.txbuf->cmd_tx.id = __cpu_to_le16(msdu_id);
skb_cb->htt.txbuf->cmd_tx.frags_paddr = __cpu_to_le32(frags_paddr);
-   skb_cb->htt.txbuf->cmd_tx.peerid = __cpu_to_le16(HTT_INVALID_PEERID);
-   skb_cb->htt.txbuf->cmd_tx.freq = __cpu_to_le16(skb_cb->htt.freq);
+   if (ar->htt.target_version_major >= 3 &&
+   ar->htt.target_version_minor >= 4 &&
+   ar->htt.op_version == ATH10K_FW_HTT_OP_VERSION_TLV) {
+   skb_cb->htt.txbuf->cmd_tx.offchan_tx.peerid =
+   __cpu_to_le16(HTT_INVALID_PEERID);
+   skb_cb->htt.txbuf->cmd_tx.offchan_tx.freq =
+   __cpu_to_le16(skb_cb->htt.freq);
+   } else {
+   skb_cb->htt.txbuf->cmd_tx.peerid =
+   __cpu_to_le32(HTT_INVALID_PEERID);
+   }
 
trace_ath10k_htt_tx(ar, msdu_id, msdu->len, vdev_id, tid);
ath10k_dbg(ar, ATH10K_DBG_HTT,
-- 
1.9.1

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


[PATCH 1/2] ath10k: Fix peer assoc complete WMI command for 10.4

2015-11-02 Thread Vasanthakumar Thiagarajan
There is an extra 4-byte member when compared to WMI 10.2 added to assoc
complete command in WMI 10.4. This new member is used for 160Mhz related
configuration. This WMI command mismatch between host and firmware does
not cause any real issues because this new member is not used in 10.4
firmwares so far (10.4.1.00030-1). This difference in WMI command interface
brings in a new wmi_ops for 10.4 gen_peer_assoc(). No noticeable functionality
differences with this change can be seen with the current 10.4 firmwares, but
the WMI interface has to be fixed to work with future 10.4 firmwares which may
be using this new member.

Signed-off-by: Vasanthakumar Thiagarajan 
---
 drivers/net/wireless/ath/ath10k/wmi.c | 37 ++-
 drivers/net/wireless/ath/ath10k/wmi.h |  5 +
 2 files changed, 41 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c 
b/drivers/net/wireless/ath/ath10k/wmi.c
index 7569db0..e8614ab 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -6328,6 +6328,16 @@ ath10k_wmi_peer_assoc_fill_10_2(struct ath10k *ar, void 
*buf,
cmd->info0 = __cpu_to_le32(info0);
 }
 
+static void
+ath10k_wmi_peer_assoc_fill_10_4(struct ath10k *ar, void *buf,
+   const struct wmi_peer_assoc_complete_arg *arg)
+{
+   struct wmi_10_4_peer_assoc_complete_cmd *cmd = buf;
+
+   ath10k_wmi_peer_assoc_fill_10_2(ar, buf, arg);
+   cmd->peer_bw_rxnss_override = 0;
+}
+
 static int
 ath10k_wmi_peer_assoc_check_arg(const struct wmi_peer_assoc_complete_arg *arg)
 {
@@ -6417,6 +6427,31 @@ ath10k_wmi_10_2_op_gen_peer_assoc(struct ath10k *ar,
 }
 
 static struct sk_buff *
+ath10k_wmi_10_4_op_gen_peer_assoc(struct ath10k *ar,
+ const struct wmi_peer_assoc_complete_arg *arg)
+{
+   size_t len = sizeof(struct wmi_10_4_peer_assoc_complete_cmd);
+   struct sk_buff *skb;
+   int ret;
+
+   ret = ath10k_wmi_peer_assoc_check_arg(arg);
+   if (ret)
+   return ERR_PTR(ret);
+
+   skb = ath10k_wmi_alloc_skb(ar, len);
+   if (!skb)
+   return ERR_PTR(-ENOMEM);
+
+   ath10k_wmi_peer_assoc_fill_10_4(ar, skb->data, arg);
+
+   ath10k_dbg(ar, ATH10K_DBG_WMI,
+  "wmi peer assoc vdev %d addr %pM (%s)\n",
+  arg->vdev_id, arg->addr,
+  arg->peer_reassoc ? "reassociate" : "new");
+   return skb;
+}
+
+static struct sk_buff *
 ath10k_wmi_10_2_op_gen_pdev_get_temperature(struct ath10k *ar)
 {
struct sk_buff *skb;
@@ -7536,6 +7571,7 @@ static const struct wmi_ops wmi_10_4_ops = {
.gen_peer_delete = ath10k_wmi_op_gen_peer_delete,
.gen_peer_flush = ath10k_wmi_op_gen_peer_flush,
.gen_peer_set_param = ath10k_wmi_op_gen_peer_set_param,
+   .gen_peer_assoc = ath10k_wmi_10_4_op_gen_peer_assoc,
.gen_set_psmode = ath10k_wmi_op_gen_set_psmode,
.gen_set_sta_ps = ath10k_wmi_op_gen_set_sta_ps,
.gen_set_ap_ps = ath10k_wmi_op_gen_set_ap_ps,
@@ -7555,7 +7591,6 @@ static const struct wmi_ops wmi_10_4_ops = {
.fw_stats_fill = ath10k_wmi_10_4_op_fw_stats_fill,
 
/* shared with 10.2 */
-   .gen_peer_assoc = ath10k_wmi_10_2_op_gen_peer_assoc,
.gen_request_stats = ath10k_wmi_op_gen_request_stats,
 };
 
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h 
b/drivers/net/wireless/ath/ath10k/wmi.h
index a8ea93e..ab6d218 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -5741,6 +5741,11 @@ struct wmi_10_2_peer_assoc_complete_cmd {
__le32 info0; /* WMI_PEER_ASSOC_INFO0_ */
 } __packed;
 
+struct wmi_10_4_peer_assoc_complete_cmd {
+   struct wmi_10_2_peer_assoc_complete_cmd cmd;
+   __le32 peer_bw_rxnss_override;
+} __packed;
+
 struct wmi_peer_assoc_complete_arg {
u8 addr[ETH_ALEN];
u32 vdev_id;
-- 
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] rtl8xxxu: rtl8192eu: Map out EFUSE TX power area

2015-11-02 Thread Jakub Sitnicki
TX power values are laid out differently in EFUSE found in RTL8192EU &
RTL8188EU devices.  TX power indices and differences for each RF path
are not interleaved (A, B, A, B), as in other chips, but follow one
another (A, B, C, D).

Signed-off-by: Jakub Sitnicki 
---

Jes,

I reckon this is as "pretty" as it gets.  I even took the time to draw
it out:

  https://github.com/jsitnicki/realtek-notes/blob/master/efuse-tx-power.pdf

The whole TX power area is aligned to a multiple of 8, but subareas
for each RF path are not aligned (they are 18 bytes long each).

Patch is for rtl8xxxu-nextgen, of course.  Anything you would rename?

Cheers,
Jakub

 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c |  4 ++--
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 22 +-
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 8c7d2da..6a89710 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2300,7 +2300,7 @@ static int rtl8192eu_parse_efuse(struct rtl8xxxu_priv 
*priv)
return -EINVAL;
 
ether_addr_copy(priv->mac_addr, efuse->mac_addr);
-
+#if 0
memcpy(priv->cck_tx_power_index_A, efuse->cck_tx_power_index_A,
   sizeof(priv->cck_tx_power_index_A));
memcpy(priv->cck_tx_power_index_B, efuse->cck_tx_power_index_B,
@@ -2310,7 +2310,7 @@ static int rtl8192eu_parse_efuse(struct rtl8xxxu_priv 
*priv)
   sizeof(priv->ht40_1s_tx_power_index_A));
memcpy(priv->ht40_1s_tx_power_index_B, efuse->ht40_1s_tx_power_index_B,
   sizeof(priv->ht40_1s_tx_power_index_B));
-#if 0
+
memcpy(priv->ht40_2s_tx_power_index_diff,
   efuse->ht40_2s_tx_power_index_diff,
   sizeof(priv->ht40_2s_tx_power_index_diff));
diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
index 4b8431d..b223831 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
@@ -543,14 +543,26 @@ struct rtl8723bu_efuse {
u8 res12[0x4];
 };
 
+struct rtl8192eu_efuse_tx_power {
+   u8 cck_base[6];
+   u8 ht40_base[5];
+   struct rtl8723au_idx ht20_ofdm_1s_diff;
+   struct rtl8723au_idx ht40_ht20_2s_diff;
+   struct rtl8723au_idx ofdm_cck_2s_diff; /* not used */
+   struct rtl8723au_idx ht40_ht20_3s_diff;
+   struct rtl8723au_idx ofdm_cck_3s_diff; /* not used */
+   struct rtl8723au_idx ht40_ht20_4s_diff;
+   struct rtl8723au_idx ofdm_cck_4s_diff; /* not used */
+};
+
 struct rtl8192eu_efuse {
__le16 rtl_id;
u8 res0[0x0e];
-   u8 cck_tx_power_index_A[3]; /* 0x10 */
-   u8 cck_tx_power_index_B[3];
-   u8 ht40_1s_tx_power_index_A[3]; /* 0x16 */
-   u8 ht40_1s_tx_power_index_B[3];
-   u8 res1[0x9c];
+   struct rtl8192eu_efuse_tx_power tx_power_index_A;   /* 0x10 */
+   struct rtl8192eu_efuse_tx_power tx_power_index_B;   /* 0x22 */
+   struct rtl8192eu_efuse_tx_power tx_power_index_C;   /* 0x34 */
+   struct rtl8192eu_efuse_tx_power tx_power_index_D;   /* 0x46 */
+   u8 res1[0x60];
u8 channel_plan;/* 0xb8 */
u8 xtal_k;
u8 thermal_meter;
-- 
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: [WEXT/nl80211] few API questions

2015-11-02 Thread Johannes Berg

> The iw code has been helpful, and I have used bits of it so far. When it comes
> to kernel components, though, I don't understand that code well enough; so I'd
> appreciate help with the following:
> 
>  1. Signal Level Units
> This refers to station signal level in status ASSOCIATED, AUTHENTICATED,
> or IBSS_JOINED.
> 
>Q: Are the values reported via NL80211_STA_INFO_SIGNAL{,_AVG} 
>   in xxx always in dBm, or if not, what information should be used
>   (NL80211_BSS_SIGNAL_MBM, NL80211_BSS_SIGNAL_UNSPEC).
> 
>   The wext API sets the unit via iw_quality.updated flags 
> (IW_QUAL_DBM),
>   is the same needed in nl80211?

In nl80211 you just check which kind of attributes you get.
STA_INFO_SIGNAL(_AVG) is documented to be in dBm, so it'll be missing
if the hardware doesn't report dBm. BSS_SIGNAL_* will be present
depending on what the hardware reported.

>   2. Noise Level
>  It seems that the WEXT API does no longer support reporting noise floor
>  levels (IW_QUAL_NOISE_INVALID is always set).

Very few drivers ever were really able to report it.

>Q: Is it correct to use NL80211_SURVEY_INFO_NOISE for the active 
> channel
>   (NL80211_SURVEY_INFO_IN_USE) as replacement (header says it is dBm)?

Perhaps, I'm not really sure.

>  3. Link Quality
> WEXT has the concept of a link quality metric (iw_quality.qual).
> 
>Q: Given access to signal levels in dBm or mBm, looking at
>   cfg80211_wireless_stats(); would be correct to replace the call to
>   SIOCGIWSTATS by using the nl80211 values in (1) and simply
>   interpret -110dBm and -40dBm as ends of a quality scale from 0..70?

Well, that's one interpretation we made, a few drivers were doing it
that way, so we put that into the wext backward compatibility code.
There are possibly other things you could take into account (bitrate,
noise floor, ...) but we didn't want a complex algorithm for wext.

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] ath9k: Add support for ITS-G5 band (5.9 GHz)

2015-11-02 Thread Jouni Malinen
On Mon, Nov 02, 2015 at 11:22:57AM +0100, Michal Sojka wrote:
> The patch adds support for Intelligent Transportation System (ITS-G5)
> band to the ath9k driver.

NAK. This would enable use of licensed 5.9 GHz band on large number of
deployed "world roaming" cards. This would allow one to set up an AP on
such a channel and would also make station mode scan those channels with
active scan (i.e., sending Probe Request frames) on them by default for
every single full scan. That's not appropriate regardless of whether
CFG80211_CERTIFICATION_ONUS is set.

This would be bad from both regulatory enforcement view point (5.9 GHz
band is not allowed for this type of use) and normal use case
performance (adding more channels for scanning makes scans take longer
without there being any point in scanning a band that is not supposed to
have APs for normal station mode connection).

> in this second version of the patch we removed dependency on
> CFG80211_CERTIFICATION_ONUS as suggested by Johannes. We are, however,
> not sure whether this is the right thing to do.
> 
> The problem is that ath9k uses (REGULATORY_STRICT_REG |
> REGULATORY_CUSTOM_REG), which means that in order to use the 5.9 GHz
> band, ath9k's private regdomain has to be extended. This in turn means
> that the 5.9 GHz band is enabled by default in many configurations. It
> can be disabled if one sends a regulatory hint and has valid regdb in
> user space, but this cannot be relied upon.

This sounds like a special use case and I don't see why upstream Linux
kernel should enable those channels regardless of kernel build
configuration. Proper regulatory rule enforcement is needed to prevent
the channels from being used in unlicensed use cases.

> Especially the US regulatory suggests that using
> CFG80211_CERTIFICATION_ONUS might have sense (see the previous version
> http://www.mail-archive.com/linux-wireless@vger.kernel.org/msg15228.html).
> What do you think?

I don't think it is sufficient to enable these channels based on any
kernel build configuration parameter. We must prevent accidental use of
these channels regardless of what config options a user might pick.

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


Re: [PATCH v2] ath9k: Add support for ITS-G5 band (5.9 GHz)

2015-11-02 Thread Michal Sojka
Hi Jouni,

thanks for quick reply.

On Mon, Nov 02 2015, Jouni Malinen wrote:
> On Mon, Nov 02, 2015 at 11:22:57AM +0100, Michal Sojka wrote:
>> The patch adds support for Intelligent Transportation System (ITS-G5)
>> band to the ath9k driver.
>
> NAK. This would enable use of licensed 5.9 GHz band on large number of
> deployed "world roaming" cards.

I agree that this is not good.

> This would allow one to set up an AP on such a channel and would also
> make station mode scan those channels with active scan (i.e., sending
> Probe Request frames) on them by default for every single full scan.
> That's not appropriate regardless of whether
> CFG80211_CERTIFICATION_ONUS is set.

Can this be solved by having proper/new regulatory flags on these
channels that would prohibit running AP or scanning on these channels?

> This would be bad from both regulatory enforcement view point (5.9 GHz
> band is not allowed for this type of use) and normal use case
> performance (adding more channels for scanning makes scans take longer
> without there being any point in scanning a band that is not supposed to
> have APs for normal station mode connection).
>
>> in this second version of the patch we removed dependency on
>> CFG80211_CERTIFICATION_ONUS as suggested by Johannes. We are, however,
>> not sure whether this is the right thing to do.
>> 
>> The problem is that ath9k uses (REGULATORY_STRICT_REG |
>> REGULATORY_CUSTOM_REG), which means that in order to use the 5.9 GHz
>> band, ath9k's private regdomain has to be extended. This in turn means
>> that the 5.9 GHz band is enabled by default in many configurations. It
>> can be disabled if one sends a regulatory hint and has valid regdb in
>> user space, but this cannot be relied upon.
>
> This sounds like a special use case and I don't see why upstream Linux
> kernel should enable those channels regardless of kernel build
> configuration. 

I expect that there will be quite a lot applications/devices that will
need to communicate in this band. From technical point of view, it might
be beneficial if there is one solid implementation available in the
upstream Linux. I'm not sure about the legal point of view.

> Proper regulatory rule enforcement is needed to prevent the channels
> from being used in unlicensed use cases.

Can you image this "proper regulatory rule enforcement" as a part of
upstream Linux? Do you have an idea how it would look like?

>> Especially the US regulatory suggests that using
>> CFG80211_CERTIFICATION_ONUS might have sense (see the previous version
>> http://www.mail-archive.com/linux-wireless@vger.kernel.org/msg15228.html).
>> What do you think?
>
> I don't think it is sufficient to enable these channels based on any
> kernel build configuration parameter. We must prevent accidental use of
> these channels regardless of what config options a user might pick.

Would kernel config option + custom regdb be sufficient?

Cheers.
-Michal
--
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 00/19] staging/wilc1000 cleanups

2015-11-02 Thread Arnd Bergmann
On Friday 23 October 2015 16:51:13 Tony Cho wrote:
> Hi Arnd,
> First of all, I would like to say "thank you" for your efforts and 
> contributions.
> We are updating the driver because new revision came up and making new 
> patches
> to make it stable and elegant as Linux driver. In these days, we are 
> sending big changes
> while testing such patches and also doing updates at once.
> 
> As you did, we are scheduled to provide the patches making device tree 
> and delete all of platform
> dependencies as you removed WILC_SDIO_IRQ_GPIO as well as other things. 
> So, I would like to
> discuss with you for your series of patch.
> 
> In this time, I think it's important to make the driver to be compiled 
> even if the link problem
> happens as you reported. So, how about deleting all of SPI related files 
> from source tree and
> even from Kconfig for the time being because new bus driver will come or 
> revert
> the Kconfig and then can we expect the best patch in the near feature?
> 
> I respect your efforts and patches, so your opinion is very important to me.

Hi Tony,

I've seen you have merged the patches that you mentioned into Greg's
tree. I have now rebased my patches on top, including the separate SPI
driver. Once we merge those, it should work fine, and having multiple
front-end drivers gives a nice template for adding future hardware
specific variations like another bus, or a newer model on the same
bus. I'll post my patches after some more testing.

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


Ralink RT5592 5Ghz capability not working

2015-11-02 Thread Alberto Mattea
Hello,
this is about the mini-pcie version used in some embedded products (for example 
the Buffalo WHR-600D and the Asus RP-N53).
It has an RT5592 chip and the hardware supports both 2.4 and 5Ghz (5Ghz works 
with the proprietary driver supplied with the devices), but rt2800pci seems to 
see only the 2.4 Ghz capability.

dmesg:

[   14.07] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5592, rev 0222 
detected
[   14.08] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 0001 detected
[   14.10] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[  134.42] ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading 
firmware file 'rt2860.bin'
[  134.46] ieee80211 phy0: rt2x00lib_request_firmware: Info - Firmware 
detected - version: 0.34

The weird thing is that in lspci it is reported as an RT3091, due to the 0x3091 
pci device id:

01:00.0 Network controller [0280]: Ralink corp. RT3091 Wireless 802.11n 1T/2R 
PCIe [1814:3091]
Subsystem: Ralink corp. RT3091 Wireless 802.11n 1T/2R PCIe [1814:3091]
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- SERR-  (32-bit, non-prefetchable) [size=2]
Region 2: Memory at  (32-bit, non-prefetchable) [size=2]
Region 3: Memory at  (32-bit, non-prefetchable) [size=2]
Region 4: Memory at  (32-bit, non-prefetchable) [size=2]
Region 5: Memory at  (32-bit, non-prefetchable) [size=2]
Expansion ROM at  [disabled] [size=2]
Capabilities: [40] Power Management version 3
Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA 
PME(D0+,D1-,D2-,D3hot+,D3cold-)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME+
Capabilities: [50] MSI: Enable- Count=1/32 Maskable- 64bit+
Address:   Data: 
Capabilities: [70] Express (v2) Endpoint, MSI 00
DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s 
unlimited, L1 unlimited
ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: Report errors: Correctable- Non-Fatal- Fatal- 
Unsupported-
RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
MaxPayload 128 bytes, MaxReadReq 512 bytes
DevSta: CorrErr- UncorrErr- FatalErr- UnsuppReq- AuxPwr- 
TransPend-
LnkCap: Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit 
Latency L0s <512ns, L1 <64us
ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk-
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ 
DLActive- BWMgmt- ABWMgmt-
DevCap2: Completion Timeout: Not Supported, TimeoutDis+, LTR-, 
OBFF Not Supported
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, 
OBFF Disabled
LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
 Transmit Margin: Normal Operating Range, 
EnterModifiedCompliance- ComplianceSOS-
 Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -6dB, 
EqualizationComplete-, EqualizationPhase1-
 EqualizationPhase2-, EqualizationPhase3-, 
LinkEqualizationRequest-
Capabilities: [100 v1] Advanced Error Reporting
UESta:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- 
RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UEMsk:  DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- 
RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
UESvrt: DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- 
RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
CESta:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr-
CEMsk:  RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
AERCap: First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-
Capabilities: [140 v1] Device Serial Number 08-68-35-ff-fe-60-a8-86
Kernel driver in use: rt2800pci

So maybe due to this (i'm not sure), rt2800pci only enables the 2.4 Ghz band 
support:

# iw phy0 info
Wiphy phy0
max # scan SSIDs: 4
max scan IEs length: 2257 bytes
Retry short limit: 7
Retry long limit: 4
Coverage class: 0 (up to 0m)
Available Antennas: TX 0 RX 0
Supported interface modes:
 * IBSS
 * managed
 * AP
 * AP/VLAN
 * WDS
 * monitor
 * mesh point
Band 1:
Capabilities: 0x272
HT20/HT40
Static SM Power Save
RX Greenfield
RX HT20 SGI
 

[PATCH 20/38] staging: wilc1000: remove warnings line over 80 characters

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch removes the warnings reported by checkpatch.pl
for line over 80 characters.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 40 +++
 1 file changed, 27 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index ab4ab1f..f8cfdaf 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -123,7 +123,8 @@ static int dev_state_ev_handler(struct notifier_block 
*this, unsigned long event
return NOTIFY_DONE;
}
 
-   if ((memcmp(dev_iface->ifa_label, "wlan0", 5)) && 
(memcmp(dev_iface->ifa_label, "p2p0", 4))) {
+   if (memcmp(dev_iface->ifa_label, "wlan0", 5) &&
+   memcmp(dev_iface->ifa_label, "p2p0", 4)) {
PRINT_D(GENERIC_DBG, "Interface is neither WLAN0 nor P2P0\n");
return NOTIFY_DONE;
}
@@ -306,7 +307,8 @@ int linux_wlan_lock_timeout(void *vp, u32 timeout)
 
PRINT_D(LOCK_DBG, "Locking %p\n", vp);
if (vp)
-   error = down_timeout((struct semaphore *)vp, 
msecs_to_jiffies(timeout));
+   error = down_timeout((struct semaphore *)vp,
+msecs_to_jiffies(timeout));
else
PRINT_ER("Failed, mutex is NULL\n");
return error;
@@ -317,7 +319,8 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag)
int status;
 
if (flag == WILC_MAC_INDICATE_STATUS) {
-   wilc_wlan_cfg_get_val(WID_STATUS, (unsigned char *), 4);
+   wilc_wlan_cfg_get_val(WID_STATUS,
+ (unsigned char *), 4);
if (wilc->mac_status == WILC_MAC_STATUS_INIT) {
wilc->mac_status = status;
up(>sync_event);
@@ -594,7 +597,9 @@ static int linux_wlan_init_test_config(struct net_device 
*dev, struct wilc *p_ni
hif_drv = (struct host_if_drv *)priv->hWILCWFIDrv;
PRINT_D(INIT_DBG, "Host = %p\n", hif_drv);
 
-   PRINT_D(INIT_DBG, "MAC address is : %02x-%02x-%02x-%02x-%02x-%02x\n", 
mac_add[0], mac_add[1], mac_add[2], mac_add[3], mac_add[4], mac_add[5]);
+   PRINT_D(INIT_DBG, "MAC address is : %02x-%02x-%02x-%02x-%02x-%02x\n",
+   mac_add[0], mac_add[1], mac_add[2],
+   mac_add[3], mac_add[4], mac_add[5]);
wilc_get_chipid(0);
 
*(int *)c_val = 1;
@@ -1138,10 +1143,14 @@ int mac_open(struct net_device *ndev)
goto _err_;
}
 
-   wilc_mgmt_frame_register(nic->wilc_netdev->ieee80211_ptr->wiphy, 
nic->wilc_netdev->ieee80211_ptr,
-nic->g_struct_frame_reg[0].frame_type, 
nic->g_struct_frame_reg[0].reg);
-   wilc_mgmt_frame_register(nic->wilc_netdev->ieee80211_ptr->wiphy, 
nic->wilc_netdev->ieee80211_ptr,
-nic->g_struct_frame_reg[1].frame_type, 
nic->g_struct_frame_reg[1].reg);
+   wilc_mgmt_frame_register(nic->wilc_netdev->ieee80211_ptr->wiphy,
+nic->wilc_netdev->ieee80211_ptr,
+nic->g_struct_frame_reg[0].frame_type,
+nic->g_struct_frame_reg[0].reg);
+   wilc_mgmt_frame_register(nic->wilc_netdev->ieee80211_ptr->wiphy,
+nic->wilc_netdev->ieee80211_ptr,
+nic->g_struct_frame_reg[1].frame_type,
+nic->g_struct_frame_reg[1].reg);
netif_wake_queue(ndev);
wl->open_ifcs++;
nic->mac_opened = 1;
@@ -1173,14 +1182,16 @@ static void wilc_set_multicast_list(struct net_device 
*dev)
if (!dev)
return;
 
-   PRINT_D(INIT_DBG, "Setting Multicast List with count = %d.\n", 
dev->mc.count);
+   PRINT_D(INIT_DBG, "Setting Multicast List with count = %d.\n",
+   dev->mc.count);
 
if (dev->flags & IFF_PROMISC) {
PRINT_D(INIT_DBG, "Set promiscuous mode ON, retrive all 
packets\n");
return;
}
 
-   if ((dev->flags & IFF_ALLMULTI) || (dev->mc.count) > 
WILC_MULTICAST_TABLE_SIZE) {
+   if ((dev->flags & IFF_ALLMULTI) ||
+   (dev->mc.count) > WILC_MULTICAST_TABLE_SIZE) {
PRINT_D(INIT_DBG, "Disable multicast filter, retrive all 
multicast packets\n");
host_int_setup_multicast_filter(hif_drv, false, 0);
return;
@@ -1261,7 +1272,8 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
ih = (struct iphdr *)(skb->data + sizeof(struct ethhdr));
 
pu8UdpBuffer = (char *)ih + sizeof(struct iphdr);
-   if ((pu8UdpBuffer[1] == 68 && pu8UdpBuffer[3] == 67) || 
(pu8UdpBuffer[1] == 67 && pu8UdpBuffer[3] == 68))
+   if ((pu8UdpBuffer[1] == 68 && pu8UdpBuffer[3] == 67) 

[PATCH 25/38] staging: wilc1000: rename Bssid of function get_if_handler

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch renames Bssid of function get_if_handler to bssid
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 166f240..2cc7cd9 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -334,25 +334,25 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag)
 
 struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header)
 {
-   u8 *Bssid, *Bssid1;
+   u8 *bssid, *Bssid1;
int i = 0;
 
-   Bssid = mac_header + 10;
+   bssid = mac_header + 10;
Bssid1 = mac_header + 4;
 
for (i = 0; i < wilc->vif_num; i++)
if (!memcmp(Bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
-   !memcmp(Bssid, wilc->vif[i].bssid, ETH_ALEN))
+   !memcmp(bssid, wilc->vif[i].bssid, ETH_ALEN))
return wilc->vif[i].ndev;
 
PRINT_INFO(INIT_DBG, "Invalide handle\n");
for (i = 0; i < 25; i++)
PRINT_D(INIT_DBG, "%02x ", mac_header[i]);
-   Bssid = mac_header + 18;
+   bssid = mac_header + 18;
Bssid1 = mac_header + 12;
for (i = 0; i < wilc->vif_num; i++)
if (!memcmp(Bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
-   !memcmp(Bssid, wilc->vif[i].bssid, ETH_ALEN))
+   !memcmp(bssid, wilc->vif[i].bssid, ETH_ALEN))
return wilc->vif[i].ndev;
 
PRINT_INFO(INIT_DBG, "\n");
-- 
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 22/38] staging: wilc1000: remove do-nothing if condition case.

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch removes do-nothing if condition case.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 72345b3..753405e 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -327,9 +327,6 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag)
} else {
wilc->mac_status = status;
}
-
-   if (wilc->mac_status == WILC_MAC_STATUS_CONNECT) {
-   }
} else if (flag == WILC_MAC_INDICATE_SCAN) {
PRINT_D(GENERIC_DBG, "Scanning ...\n");
}
-- 
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 34/38] staging: wilc1000: rename Set_machw_change_vir_if function

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch rename Set_machw_change_vir_if function to set_machw_change_vir_if
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 2 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
 drivers/staging/wilc1000/wilc_wfi_netdevice.h | 2 +-
 drivers/staging/wilc1000/wilc_wlan.c  | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 1a4ef89..a4038e1 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1112,7 +1112,7 @@ int mac_open(struct net_device *ndev)
return ret;
}
 
-   Set_machw_change_vir_if(ndev, false);
+   set_machw_change_vir_if(ndev, false);
 
host_int_get_MacAddress(priv->hWILCWFIDrv, mac_add);
PRINT_D(INIT_DBG, "Mac address: %pM\n", mac_add);
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 46d6052..49f061a 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1408,7 +1408,7 @@ static int del_key(struct wiphy *wiphy, struct net_device 
*netdev,
g_key_gtk_params.seq = NULL;
 
/*Reset WILC_CHANGING_VIR_IF register to allow adding futrue 
keys to CE H/W*/
-   Set_machw_change_vir_if(netdev, false);
+   set_machw_change_vir_if(netdev, false);
}
 
if (key_index >= 0 && key_index <= 3) {
@@ -2548,7 +2548,7 @@ static int change_virtual_intf(struct wiphy *wiphy, 
struct net_device *dev,
PRINT_D(GENERIC_DBG, "Changing virtual interface, enable scan\n");
/*Set WILC_CHANGING_VIR_IF register to disallow adding futrue keys to 
CE H/W*/
if (g_ptk_keys_saved && g_gtk_keys_saved) {
-   Set_machw_change_vir_if(dev, true);
+   set_machw_change_vir_if(dev, true);
}
 
switch (type) {
@@ -2710,7 +2710,7 @@ static int change_virtual_intf(struct wiphy *wiphy, 
struct net_device *dev,
 
/*Refresh scan, to refresh the scan results to the 
wpa_supplicant. Set MachHw to false to enable further key installments*/
refresh_scan(priv, 1, true);
-   Set_machw_change_vir_if(dev, false);
+   set_machw_change_vir_if(dev, false);
 
if (wl->initialized){
for (i = 0; i < num_reg_frame; i++) {
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h 
b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 19e8643..9406c96 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -216,7 +216,7 @@ void wl_wlan_cleanup(struct wilc *wilc);
 int wilc_netdev_init(struct wilc **wilc);
 void wilc1000_wlan_deinit(struct net_device *dev);
 void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size);
-u16 Set_machw_change_vir_if(struct net_device *dev, bool bValue);
+u16 set_machw_change_vir_if(struct net_device *dev, bool bValue);
 int linux_wlan_get_firmware(struct net_device *dev);
 int linux_wlan_get_num_conn_ifcs(struct net_device *dev);
 int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid);
diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index 898f60e..152dba5 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -2074,7 +2074,7 @@ _fail_:
 
 }
 
-u16 Set_machw_change_vir_if(struct net_device *dev, bool bValue)
+u16 set_machw_change_vir_if(struct net_device *dev, bool bValue)
 {
u16 ret;
u32 reg;
-- 
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 35/38] staging: wilc1000: rename host_int_get_MacAddress function

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch rename host_int_get_MacAddress function to hif_get_mac_address
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 drivers/staging/wilc1000/host_interface.h | 2 +-
 drivers/staging/wilc1000/linux_wlan.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index de84c5d..5c38390 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3494,7 +3494,7 @@ s32 host_int_set_RSNAConfigPSKPassPhrase(struct 
host_if_drv *hif_drv,
return 0;
 }
 
-s32 host_int_get_MacAddress(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
+s32 hif_get_mac_address(struct host_if_drv *hif_drv, u8 *pu8MacAddress)
 {
s32 result = 0;
struct host_if_msg msg;
diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index 510b4a5..dd33bc3 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -334,7 +334,7 @@ s32 host_int_set_RSNAConfigPSKPassPhrase(struct host_if_drv 
*hWFIDrv,
 u8 u8Psklength);
 s32 host_int_get_RSNAConfigPSKPassPhrase(struct host_if_drv *hWFIDrv,
 u8 *pu8PassPhrase, u8 u8Psklength);
-s32 host_int_get_MacAddress(struct host_if_drv *hWFIDrv, u8 *pu8MacAddress);
+s32 hif_get_mac_address(struct host_if_drv *hWFIDrv, u8 *pu8MacAddress);
 s32 host_int_set_MacAddress(struct host_if_drv *hWFIDrv, u8 *pu8MacAddress);
 int host_int_wait_msg_queue_idle(void);
 s32 host_int_set_start_scan_req(struct host_if_drv *hWFIDrv, u8 scanSource);
diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index a4038e1..8370a90 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1114,7 +1114,7 @@ int mac_open(struct net_device *ndev)
 
set_machw_change_vir_if(ndev, false);
 
-   host_int_get_MacAddress(priv->hWILCWFIDrv, mac_add);
+   hif_get_mac_address(priv->hWILCWFIDrv, mac_add);
PRINT_D(INIT_DBG, "Mac address: %pM\n", mac_add);
 
for (i = 0; i < wl->vif_num; i++) {
-- 
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 36/38] staging: wilc1000: rename s32Error of mac_ioctl function

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch rename s32Error variable of mac_ioctl function to ret
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 8370a90..0eba943 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1349,7 +1349,7 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, 
int cmd)
u32 size = 0, length = 0;
perInterface_wlan_t *nic;
struct wilc_priv *priv;
-   s32 s32Error = 0;
+   s32 ret = 0;
struct wilc *wilc;
 
nic = netdev_priv(ndev);
@@ -1373,8 +1373,9 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, 
int cmd)
 
if (strncasecmp(buff, "RSSI", length) == 0) {
priv = 
wiphy_priv(nic->wilc_netdev->ieee80211_ptr->wiphy);
-   s32Error = host_int_get_rssi(priv->hWILCWFIDrv, 
&(rssi));
-   if (s32Error)
+   ret = host_int_get_rssi(priv->hWILCWFIDrv,
+   );
+   if (ret)
PRINT_ER("Failed to send get rssi 
param's message queue ");
PRINT_INFO(GENERIC_DBG, "RSSI :%d\n", rssi);
 
@@ -1384,7 +1385,7 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, 
int cmd)
 
if (copy_to_user(wrq->u.data.pointer, buff, 
size)) {
PRINT_ER("%s: failed to copy data to 
user buffer\n", __func__);
-   s32Error = -EFAULT;
+   ret = -EFAULT;
goto done;
}
}
@@ -1395,7 +1396,7 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, 
int cmd)
default:
{
PRINT_INFO(GENERIC_DBG, "Command - %d - has been received\n", 
cmd);
-   s32Error = -EOPNOTSUPP;
+   ret = -EOPNOTSUPP;
goto done;
}
}
@@ -1404,7 +1405,7 @@ done:
 
kfree(buff);
 
-   return s32Error;
+   return ret;
 }
 
 void frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset)
-- 
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 31/38] staging: wilc1000: fixes missing a blank line after declarations

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch fixes the warnings reported by checkpatch.pl
for Missing a blank line after declarations.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index aaa938f..98c3cd0 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -547,6 +547,7 @@ static int linux_wlan_start_firmware(struct net_device *dev)
 
return ret;
 }
+
 static int linux_wlan_firmware_download(struct net_device *dev)
 {
perInterface_wlan_t *nic;
@@ -885,6 +886,7 @@ static int wlan_deinit_locks(struct net_device *dev)
 
return 0;
 }
+
 void linux_to_wlan(wilc_wlan_inp_t *nwi, struct wilc *nic)
 {
PRINT_D(INIT_DBG, "Linux to Wlan services ...\n");
-- 
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 37/38] staging: wilc1000: rename QueueCount of mac_xmit function

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch rename QueueCount variable of mac_xmit function to queue_count
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 0eba943..5d1a547 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1223,7 +1223,7 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
 {
perInterface_wlan_t *nic;
struct tx_complete_data *tx_data = NULL;
-   int QueueCount;
+   int queue_count;
char *pu8UdpBuffer;
struct iphdr *ih;
struct ethhdr *eth_h;
@@ -1267,11 +1267,11 @@ int mac_xmit(struct sk_buff *skb, struct net_device 
*ndev)
nic->netstats.tx_packets++;
nic->netstats.tx_bytes += tx_data->size;
tx_data->pBssid = wilc->vif[nic->u8IfIdx].bssid;
-   QueueCount = wilc_wlan_txq_add_net_pkt(ndev, (void *)tx_data,
-  tx_data->buff, tx_data->size,
-  linux_wlan_tx_complete);
+   queue_count = wilc_wlan_txq_add_net_pkt(ndev, (void *)tx_data,
+   tx_data->buff, tx_data->size,
+   linux_wlan_tx_complete);
 
-   if (QueueCount > FLOW_CONTROL_UPPER_THRESHOLD) {
+   if (queue_count > FLOW_CONTROL_UPPER_THRESHOLD) {
netif_stop_queue(wilc->vif[0].ndev);
netif_stop_queue(wilc->vif[1].ndev);
}
-- 
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 30/38] staging: wilc1000: remove goto from linux_wlan_firmware_download

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch remove goto feature from linux_wlan_firmware_download function.
Goto feature is return result.
So, remove goto functions and it was replaced with the return value directly.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index f091a3c..aaa938f 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -558,14 +558,13 @@ static int linux_wlan_firmware_download(struct net_device 
*dev)
 
if (!wilc->firmware) {
PRINT_ER("Firmware buffer is NULL\n");
-   ret = -ENOBUFS;
-   goto _FAIL_;
+   return -ENOBUFS;
}
PRINT_D(INIT_DBG, "Downloading Firmware ...\n");
ret = wilc_wlan_firmware_download(dev, wilc->firmware->data,
  wilc->firmware->size);
if (ret < 0)
-   goto _FAIL_;
+   return ret;
 
PRINT_D(INIT_DBG, "Freeing FW buffer ...\n");
PRINT_D(INIT_DBG, "Releasing firmware\n");
@@ -573,7 +572,6 @@ static int linux_wlan_firmware_download(struct net_device 
*dev)
 
PRINT_D(INIT_DBG, "Download Succeeded\n");
 
-_FAIL_:
return ret;
 }
 
-- 
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 32/38] staging: wilc1000: remove goto from wlan_initialize_threads

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch remove goto feature from wlan_initialize_threads function.
Goto feature is 'wilc->close=0' & return result.
So, remove goto feature and it was replaced with the return value directly,
as well as removed unused ret variable.
Also, execute 'wilc->close=0' before return.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 98c3cd0..0750412e 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -916,7 +916,6 @@ int wlan_initialize_threads(struct net_device *dev)
 {
perInterface_wlan_t *nic;
struct wilc *wilc;
-   int ret = 0;
 
nic = netdev_priv(dev);
wilc = nic->wilc;
@@ -927,16 +926,12 @@ int wlan_initialize_threads(struct net_device *dev)
 "K_TXQ_TASK");
if (!wilc->txq_thread) {
PRINT_ER("couldn't create TXQ thread\n");
-   ret = -ENOBUFS;
-   goto _fail_2;
+   wilc->close = 0;
+   return -ENOBUFS;
}
down(>txq_thread_started);
 
return 0;
-
-_fail_2:
-   wilc->close = 0;
-   return ret;
 }
 
 static void wlan_deinitialize_threads(struct net_device *dev)
-- 
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 28/38] staging: wilc1000: fixes braces {} should be used on all arms of this statement

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch fixes the checks reported by checkpatch.pl
for braces {} should be used on all arms of this statement.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index c397952..1e9d67f 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -482,12 +482,11 @@ int linux_wlan_get_firmware(struct net_device *dev)
nic = netdev_priv(dev);
wilc = nic->wilc;
 
-   if (nic->iftype == AP_MODE)
+   if (nic->iftype == AP_MODE) {
firmware = AP_FIRMWARE;
-   else if (nic->iftype == STATION_MODE)
+   } else if (nic->iftype == STATION_MODE) {
firmware = STA_FIRMWARE;
-
-   else {
+   } else {
PRINT_D(INIT_DBG, "Get P2P_CONCURRENCY_FIRMWARE\n");
firmware = P2P_CONCURRENCY_FIRMWARE;
}
-- 
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 23/38] staging: wilc1000: rename function GetIfHandler

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch renames GetIfHandler function name to get_if_handler
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 753405e..8321b76 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -332,7 +332,7 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag)
}
 }
 
-struct net_device *GetIfHandler(struct wilc *wilc, u8 *pMacHeader)
+struct net_device *get_if_handler(struct wilc *wilc, u8 *pMacHeader)
 {
u8 *Bssid, *Bssid1;
int i = 0;
@@ -1427,7 +1427,7 @@ void frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, 
u32 pkt_offset)
struct net_device *wilc_netdev;
perInterface_wlan_t *nic;
 
-   wilc_netdev = GetIfHandler(wilc, buff);
+   wilc_netdev = get_if_handler(wilc, buff);
if (!wilc_netdev)
return;
 
-- 
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 27/38] staging: wilc1000: rename pBSSID of function linux_wlan_set_bssid

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch renames pBSSID of function linux_wlan_set_bssid to bssid
to avoid CamelCase naming convention.
Also, prototype linux_wlan_set_bssid in wilc_wfi_cfgoperations.c is moved to
wilc_wfi_netdevice.h.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 4 ++--
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 --
 drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 +
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index a3bb7e0..c397952 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -359,7 +359,7 @@ struct net_device *get_if_handler(struct wilc *wilc, u8 
*mac_header)
return NULL;
 }
 
-int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *pBSSID)
+int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid)
 {
int i = 0;
int ret = -1;
@@ -371,7 +371,7 @@ int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 
*pBSSID)
 
for (i = 0; i < wilc->vif_num; i++)
if (wilc->vif[i].ndev == wilc_netdev) {
-   memcpy(wilc->vif[i].bssid, pBSSID, 6);
+   memcpy(wilc->vif[i].bssid, bssid, 6);
ret = 0;
break;
}
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c 
b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 8554f6f..46d6052 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -505,8 +505,6 @@ int WILC_WFI_Set_PMKSA(u8 *bssid, struct wilc_priv *priv)
 
 
 }
-int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *pBSSID);
-
 
 /**
  *  @brief  CfgConnectResult
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h 
b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 54d798c..19e8643 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -219,4 +219,5 @@ void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 
size);
 u16 Set_machw_change_vir_if(struct net_device *dev, bool bValue);
 int linux_wlan_get_firmware(struct net_device *dev);
 int linux_wlan_get_num_conn_ifcs(struct net_device *dev);
+int linux_wlan_set_bssid(struct net_device *wilc_netdev, u8 *bssid);
 #endif
-- 
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 19/38] staging: wilc1000: remove extern function in c file and move it to header file.

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch removes extern resolve_disconnect_aberration in c file and move
it to proper header file. Rename argument also to match with declaration.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/host_interface.h | 2 +-
 drivers/staging/wilc1000/linux_wlan.c | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.h 
b/drivers/staging/wilc1000/host_interface.h
index f9efb5a..510b4a5 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -421,5 +421,5 @@ void host_int_freeJoinParams(void *pJoinParams);
 
 s32 host_int_get_statistics(struct host_if_drv *hWFIDrv,
struct rf_info *pstrStatistics);
-
+void resolve_disconnect_aberration(struct host_if_drv *hif_drv);
 #endif
diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 82495ce..ab4ab1f 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -39,7 +39,6 @@
  #define _linux_wlan_device_removal()  {}
 
 extern bool g_obtainingIP;
-extern void resolve_disconnect_aberration(void *drvHandler);
 extern u8 multicast_mac_addr_list[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN];
 extern struct timer_list hDuringIpTimer;
 
-- 
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 29/38] staging: wilc1000: remove goto from linux_wlan_start_firmware

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch remove goto feature from linux_wlan_start_firmware function.
Goto feature is return result.
So, remove goto functions and it was replaced with the return value directly.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 1e9d67f..f091a3c 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -534,18 +534,17 @@ static int linux_wlan_start_firmware(struct net_device 
*dev)
ret = wilc_wlan_start(dev);
if (ret < 0) {
PRINT_ER("Failed to start Firmware\n");
-   goto _fail_;
+   return ret;
}
 
PRINT_D(INIT_DBG, "Waiting for Firmware to get ready ...\n");
ret = linux_wlan_lock_timeout(>sync_event, 5000);
if (ret) {
PRINT_D(INIT_DBG, "Firmware start timed out");
-   goto _fail_;
+   return ret;
}
PRINT_D(INIT_DBG, "Firmware successfully started\n");
 
-_fail_:
return ret;
 }
 static int linux_wlan_firmware_download(struct net_device *dev)
-- 
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 17/38] staging: wilc1000: linux_wlan.c: clean up comments

2015-11-02 Thread Glen Lee
From: Leo Kim 

There are over-commenting in the linux_wlan.c file and most of them
are not helpful to explain what the code does and generate 80 ending
line over warnings. So, all of comments and commented codes are removed in
this patch. Comment will be added if necessary with the preferred Linux style.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 218 --
 1 file changed, 26 insertions(+), 192 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index b7c40ac..e7e5229 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -79,12 +79,6 @@ static struct notifier_block g_dev_notifier = {
 
 #define IRQ_WAIT   1
 #define IRQ_NO_WAIT0
-/*
- *  to sync between mac_close and module exit.
- *  don't initialize or de-initialize from init/deinitlocks
- *  to be initialized from module wilc_netdev_init and
- *  deinitialized from mdoule_exit
- */
 static struct semaphore close_exit_sync;
 
 static int wlan_deinit_locks(struct net_device *dev);
@@ -101,10 +95,6 @@ static struct net_device_stats *mac_stats(struct net_device 
*dev);
 static int  mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd);
 static void wilc_set_multicast_list(struct net_device *dev);
 
-/*
- * for now - in frmw_to_linux there should be private data to be passed to it
- * and this data should be pointer to net device
- */
 bool bEnablePS = true;
 
 static const struct net_device_ops wilc_netdev_ops = {
@@ -156,15 +146,14 @@ static int dev_state_ev_handler(struct notifier_block 
*this, unsigned long event
return NOTIFY_DONE;
}
 
-   PRINT_INFO(GENERIC_DBG, "dev_state_ev_handler +++\n"); /* tony */
+   PRINT_INFO(GENERIC_DBG, "dev_state_ev_handler +++\n");
 
switch (event) {
case NETDEV_UP:
-   PRINT_D(GENERIC_DBG, "dev_state_ev_handler event=NETDEV_UP 
%p\n", dev);   /* tony */
+   PRINT_D(GENERIC_DBG, "dev_state_ev_handler event=NETDEV_UP 
%p\n", dev);
 
PRINT_INFO(GENERIC_DBG, "\n == IP Address Obtained 
===\n\n");
 
-   /*If we are in station mode or client mode*/
if (nic->iftype == STATION_MODE || nic->iftype == CLIENT_MODE) {
hif_drv->IFC_UP = 1;
g_obtainingIP = false;
@@ -186,7 +175,7 @@ static int dev_state_ev_handler(struct notifier_block 
*this, unsigned long event
break;
 
case NETDEV_DOWN:
-   PRINT_D(GENERIC_DBG, "dev_state_ev_handler event=NETDEV_DOWN 
%p\n", dev);   /* tony */
+   PRINT_D(GENERIC_DBG, "dev_state_ev_handler event=NETDEV_DOWN 
%p\n", dev);
 
PRINT_INFO(GENERIC_DBG, "\n == IP Address Released 
===\n\n");
if (nic->iftype == STATION_MODE || nic->iftype == CLIENT_MODE) {
@@ -211,7 +200,7 @@ static int dev_state_ev_handler(struct notifier_block 
*this, unsigned long event
break;
 
default:
-   PRINT_INFO(GENERIC_DBG, "dev_state_ev_handler 
event=default\n");/* tony */
+   PRINT_INFO(GENERIC_DBG, "dev_state_ev_handler event=default\n");
PRINT_INFO(GENERIC_DBG, "[%s] unknown dev event: %lu\n", 
dev_iface->ifa_label, event);
 
break;
@@ -231,7 +220,6 @@ static irqreturn_t isr_uh_routine(int irq, void *user_data)
wilc = nic->wilc;
PRINT_D(INT_DBG, "Interrupt received UH\n");
 
-   /*While mac is closing cacncel the handling of any interrupts received*/
if (wilc->close) {
PRINT_ER("Driver is CLOSING: Can't handle UH interrupt\n");
return IRQ_HANDLED;
@@ -248,7 +236,6 @@ irqreturn_t isr_bh_routine(int irq, void *userdata)
nic = netdev_priv(userdata);
wilc = nic->wilc;
 
-   /*While mac is closing cacncel the handling of any interrupts received*/
if (wilc->close) {
PRINT_ER("Driver is CLOSING: Can't handle BH interrupt\n");
return IRQ_HANDLED;
@@ -270,8 +257,6 @@ static int init_irq(struct net_device *dev)
nic = netdev_priv(dev);
wl = nic->wilc;
 
-   /*initialize GPIO and register IRQ num*/
-   /*GPIO request*/
if ((gpio_request(GPIO_NUM, "WILC_INTR") == 0) &&
(gpio_direction_input(GPIO_NUM) == 0)) {
wl->dev_irq_num = gpio_to_irq(GPIO_NUM);
@@ -281,7 +266,7 @@ static int init_irq(struct net_device *dev)
}
 
if ((ret != -1) && (request_threaded_irq(wl->dev_irq_num, 
isr_uh_routine, isr_bh_routine,
- IRQF_TRIGGER_LOW | 
IRQF_ONESHOT,   /*Without IRQF_ONESHOT the uh will remain kicked in 
and dont gave a chance to bh*/
+  

[PATCH 16/38] staging: wilc1000: fixes blank lines aren't necessary brace

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch fixes the checks reported by checkpatch.pl
for Blank lines aren't necessary after an open brace '{' and
Blank lines aren't necessary before a close brace '}'.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 21 -
 1 file changed, 21 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 335aa2b..b7c40ac 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -218,7 +218,6 @@ static int dev_state_ev_handler(struct notifier_block 
*this, unsigned long event
}
 
return NOTIFY_DONE;
-
 }
 
 #if (defined WILC_SPI) || (defined WILC_SDIO_IRQ_GPIO)
@@ -284,11 +283,9 @@ static int init_irq(struct net_device *dev)
if ((ret != -1) && (request_threaded_irq(wl->dev_irq_num, 
isr_uh_routine, isr_bh_routine,
  IRQF_TRIGGER_LOW | 
IRQF_ONESHOT,   /*Without IRQF_ONESHOT the uh will remain kicked in 
and dont gave a chance to bh*/
  "WILC_IRQ", dev)) < 0) {
-
PRINT_ER("Failed to request IRQ for GPIO: %d\n", GPIO_NUM);
ret = -1;
} else {
-
PRINT_D(INIT_DBG, "IRQ request succeeded IRQ-NUM= %d on GPIO: 
%d\n",
wl->dev_irq_num, GPIO_NUM);
}
@@ -353,12 +350,9 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag)
 
if (wilc->mac_status == WILC_MAC_STATUS_CONNECT) {/* 
Connect */
}
-
} else if (flag == WILC_MAC_INDICATE_SCAN) {
PRINT_D(GENERIC_DBG, "Scanning ...\n");
-
}
-
 }
 
 struct net_device *GetIfHandler(struct wilc *wilc, u8 *pMacHeader)
@@ -449,7 +443,6 @@ static int linux_wlan_txq_task(void *vp)
/* inform wilc1000_wlan_init that TXQ task is started. */
up(>txq_thread_started);
while (1) {
-
PRINT_D(TX_DBG, "txq_task Taking a nap :)\n");
down(>txq_event);
/* wait_for_completion(>txq_event); */
@@ -562,7 +555,6 @@ int linux_wlan_get_firmware(struct net_device *dev)
 _fail_:
 
return ret;
-
 }
 
 static int linux_wlan_start_firmware(struct net_device *dev)
@@ -635,7 +627,6 @@ _FAIL_:
 /* startup configuration - could be changed later using iconfig*/
 static int linux_wlan_init_test_config(struct net_device *dev, struct wilc 
*p_nic)
 {
-
unsigned char c_val[64];
unsigned char mac_add[] = {0x00, 0x80, 0xC2, 0x5E, 0xa2, 0xff};
 
@@ -1001,7 +992,6 @@ static int wlan_deinit_locks(struct net_device *dev)
 }
 void linux_to_wlan(wilc_wlan_inp_t *nwi, struct wilc *nic)
 {
-
PRINT_D(INIT_DBG, "Linux to Wlan services ...\n");
 
nwi->wilc = (void *)nic;
@@ -1197,7 +1187,6 @@ _fail_locks_:
 
 int mac_init_fn(struct net_device *ndev)
 {
-
/*Why we do this !!!*/
netif_start_queue(ndev); /* ma */
netif_stop_queue(ndev); /* ma */
@@ -1295,7 +1284,6 @@ struct net_device_stats *mac_stats(struct net_device *dev)
 /* Setup the multicast filter */
 static void wilc_set_multicast_list(struct net_device *dev)
 {
-
struct netdev_hw_addr *ha;
struct wilc_priv *priv;
struct host_if_drv *hif_drv;
@@ -1350,12 +1338,10 @@ static void wilc_set_multicast_list(struct net_device 
*dev)
host_int_setup_multicast_filter(hif_drv, true, (dev->mc.count));
 
return;
-
 }
 
 static void linux_wlan_tx_complete(void *priv, int status)
 {
-
struct tx_complete_data *pv_data = (struct tx_complete_data *)priv;
 
if (status == 1)
@@ -1500,7 +1486,6 @@ int mac_close(struct net_device *ndev)
 
 int mac_ioctl(struct net_device *ndev, struct ifreq *req, int cmd)
 {
-
u8 *buff = NULL;
s8 rssi;
u32 size = 0, length = 0;
@@ -1517,7 +1502,6 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, 
int cmd)
return 0;
 
switch (cmd) {
-
/* ]] 2013-06-24 */
case SIOCSIWPRIV:
{
@@ -1526,7 +1510,6 @@ int mac_ioctl(struct net_device *ndev, struct ifreq *req, 
int cmd)
size = wrq->u.data.length;
 
if (size && wrq->u.data.pointer) {
-
buff = memdup_user(wrq->u.data.pointer, 
wrq->u.data.length);
if (IS_ERR(buff))
return PTR_ERR(buff);
@@ -1570,7 +1553,6 @@ done:
 
 void frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset)
 {
-
unsigned int frame_len = 0;
int stats;
unsigned char *buff_to_send = NULL;
@@ -1586,7 +1568,6 @@ void frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, 
u32 pkt_offset)
nic = netdev_priv(wilc_netdev);
 
if (size > 0) {
-
frame_len = size;
buff_to_send = buff;
 
@@ 

[PATCH 14/38] staging: wilc1000: rename pstrWFIDrv of function mac_close

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch renames pstrWFIDrv of function mac_close to hif_drv
to avoid CamelCase naming convention.
And, some debug print modification that has been included name 'pstrWFIDrv'.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 4dffae5..9811949 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1434,7 +1434,7 @@ int mac_close(struct net_device *ndev)
 {
struct wilc_priv *priv;
perInterface_wlan_t *nic;
-   struct host_if_drv *pstrWFIDrv;
+   struct host_if_drv *hif_drv;
struct wilc *wl;
 
nic = netdev_priv(ndev);
@@ -1453,7 +1453,7 @@ int mac_close(struct net_device *ndev)
return 0;
}
 
-   pstrWFIDrv = (struct host_if_drv *)priv->hWILCWFIDrv;
+   hif_drv = (struct host_if_drv *)priv->hWILCWFIDrv;
 
PRINT_D(GENERIC_DBG, "Mac close\n");
 
@@ -1462,8 +1462,8 @@ int mac_close(struct net_device *ndev)
return 0;
}
 
-   if (!pstrWFIDrv) {
-   PRINT_ER("pstrWFIDrv = NULL\n");
+   if (!hif_drv) {
+   PRINT_ER("hif_drv = NULL\n");
return 0;
}
 
-- 
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 02/38] staging: wilc1000: rename firmwareIPAddress of fuction Handle_set_IPAddress

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch renames firmwareIPAddress of fuction Handle_set_IPAddress to
firmware_ip_addr to avoid CamelCase naming convention.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 4cb491f..d2628fd 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -408,7 +408,7 @@ s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 
*ip_addr, u8 idx)
 {
s32 result = 0;
struct wid wid;
-   char firmwareIPAddress[4] = {0};
+   char firmware_ip_addr[4] = {0};
struct net_device *dev;
 
dev = hif_drv->priv->dev;
@@ -429,7 +429,7 @@ s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 
*ip_addr, u8 idx)
result = send_config_pkt(dev, SET_CFG, , 1,
 get_id_from_handler(hif_drv));
 
-   host_int_get_ipaddress(hif_drv, firmwareIPAddress, idx);
+   host_int_get_ipaddress(hif_drv, firmware_ip_addr, idx);
 
if (result) {
PRINT_ER("Failed to set IP address\n");
-- 
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 06/38] staging: wilc1000: rename strHostIFCfgParamAttr of fuction Handle_CfgParam

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch renames strHostIFCfgParamAttr of fuction Handle_CfgParam
to cfg_param_attr to avoid CamelCase naming convention.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/host_interface.c | 154 --
 1 file changed, 83 insertions(+), 71 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 69ec7eb..6abba23 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -538,7 +538,7 @@ static s32 Handle_GetMacAddress(struct host_if_drv *hif_drv,
 }
 
 static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
-  struct cfg_param_attr *strHostIFCfgParamAttr)
+  struct cfg_param_attr *cfg_param_attr)
 {
s32 result = 0;
struct wid strWIDList[32];
@@ -551,13 +551,13 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
 
PRINT_D(HOSTINF_DBG, "Setting CFG params\n");
 
-   if (strHostIFCfgParamAttr->cfg_attr_info.flag & BSS_TYPE) {
-   if (strHostIFCfgParamAttr->cfg_attr_info.bss_type < 6) {
+   if (cfg_param_attr->cfg_attr_info.flag & BSS_TYPE) {
+   if (cfg_param_attr->cfg_attr_info.bss_type < 6) {
strWIDList[u8WidCnt].id = WID_BSS_TYPE;
-   strWIDList[u8WidCnt].val = (s8 
*)>cfg_attr_info.bss_type;
+   strWIDList[u8WidCnt].val = (s8 
*)_param_attr->cfg_attr_info.bss_type;
strWIDList[u8WidCnt].type = WID_CHAR;
strWIDList[u8WidCnt].size = sizeof(char);
-   hif_drv->cfg_values.bss_type = 
(u8)strHostIFCfgParamAttr->cfg_attr_info.bss_type;
+   hif_drv->cfg_values.bss_type = 
(u8)cfg_param_attr->cfg_attr_info.bss_type;
} else {
PRINT_ER("check value 6 over\n");
result = -EINVAL;
@@ -565,13 +565,15 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
-   if (strHostIFCfgParamAttr->cfg_attr_info.flag & AUTH_TYPE) {
-   if ((strHostIFCfgParamAttr->cfg_attr_info.auth_type) == 1 || 
(strHostIFCfgParamAttr->cfg_attr_info.auth_type) == 2 || 
(strHostIFCfgParamAttr->cfg_attr_info.auth_type) == 5) {
+   if (cfg_param_attr->cfg_attr_info.flag & AUTH_TYPE) {
+   if (cfg_param_attr->cfg_attr_info.auth_type == 1 ||
+   cfg_param_attr->cfg_attr_info.auth_type == 2 ||
+   cfg_param_attr->cfg_attr_info.auth_type == 5) {
strWIDList[u8WidCnt].id = WID_AUTH_TYPE;
-   strWIDList[u8WidCnt].val = (s8 
*)>cfg_attr_info.auth_type;
+   strWIDList[u8WidCnt].val = (s8 
*)_param_attr->cfg_attr_info.auth_type;
strWIDList[u8WidCnt].type = WID_CHAR;
strWIDList[u8WidCnt].size = sizeof(char);
-   hif_drv->cfg_values.auth_type = 
(u8)strHostIFCfgParamAttr->cfg_attr_info.auth_type;
+   hif_drv->cfg_values.auth_type = 
(u8)cfg_param_attr->cfg_attr_info.auth_type;
} else {
PRINT_ER("Impossible value \n");
result = -EINVAL;
@@ -579,13 +581,14 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
-   if (strHostIFCfgParamAttr->cfg_attr_info.flag & AUTHEN_TIMEOUT) {
-   if (strHostIFCfgParamAttr->cfg_attr_info.auth_timeout > 0 && 
strHostIFCfgParamAttr->cfg_attr_info.auth_timeout < 65536) {
+   if (cfg_param_attr->cfg_attr_info.flag & AUTHEN_TIMEOUT) {
+   if (cfg_param_attr->cfg_attr_info.auth_timeout > 0 &&
+   cfg_param_attr->cfg_attr_info.auth_timeout < 65536) {
strWIDList[u8WidCnt].id = WID_AUTH_TIMEOUT;
-   strWIDList[u8WidCnt].val = (s8 
*)>cfg_attr_info.auth_timeout;
+   strWIDList[u8WidCnt].val = (s8 
*)_param_attr->cfg_attr_info.auth_timeout;
strWIDList[u8WidCnt].type = WID_SHORT;
strWIDList[u8WidCnt].size = sizeof(u16);
-   hif_drv->cfg_values.auth_timeout = 
strHostIFCfgParamAttr->cfg_attr_info.auth_timeout;
+   hif_drv->cfg_values.auth_timeout = 
cfg_param_attr->cfg_attr_info.auth_timeout;
} else {
PRINT_ER("Range(1 ~ 65535) over\n");
result = -EINVAL;
@@ -593,13 +596,13 @@ static s32 Handle_CfgParam(struct host_if_drv *hif_drv,
}
u8WidCnt++;
}
-   if (strHostIFCfgParamAttr->cfg_attr_info.flag & POWER_MANAGEMENT) {
-   if (strHostIFCfgParamAttr->cfg_attr_info.power_mgmt_mode < 

[PATCH 09/38] staging: wilc1000: replace explicit NULL comparisons with !

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch replace explicit NULL comparison with ! or unmark
operator to simplify code.
Reported by checkpatch.pl for comparison to NULL could be written "!XXX" or 
"XXX".

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 45 ++-
 1 file changed, 23 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 315906b..a483f79 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -136,7 +136,7 @@ static int dev_state_ev_handler(struct notifier_block 
*this, unsigned long event
u8 null_ip[4] = {0};
char wlan_dev_name[5] = "wlan0";
 
-   if (dev_iface == NULL || dev_iface->ifa_dev == NULL || 
dev_iface->ifa_dev->dev == NULL) {
+   if (!dev_iface || !dev_iface->ifa_dev || !dev_iface->ifa_dev->dev) {
PRINT_D(GENERIC_DBG, "dev_iface = NULL\n");
return NOTIFY_DONE;
}
@@ -147,18 +147,18 @@ static int dev_state_ev_handler(struct notifier_block 
*this, unsigned long event
}
 
dev  = (struct net_device *)dev_iface->ifa_dev->dev;
-   if (dev->ieee80211_ptr == NULL || dev->ieee80211_ptr->wiphy == NULL) {
+   if (!dev->ieee80211_ptr || !dev->ieee80211_ptr->wiphy) {
PRINT_D(GENERIC_DBG, "No Wireless registerd\n");
return NOTIFY_DONE;
}
priv = wiphy_priv(dev->ieee80211_ptr->wiphy);
-   if (priv == NULL) {
+   if (!priv) {
PRINT_D(GENERIC_DBG, "No Wireless Priv\n");
return NOTIFY_DONE;
}
pstrWFIDrv = (struct host_if_drv *)priv->hWILCWFIDrv;
nic = netdev_priv(dev);
-   if (nic == NULL || pstrWFIDrv == NULL) {
+   if (!nic || !pstrWFIDrv) {
PRINT_D(GENERIC_DBG, "No Wireless Priv\n");
return NOTIFY_DONE;
}
@@ -339,7 +339,7 @@ int linux_wlan_lock_timeout(void *vp, u32 timeout)
int error = -1;
 
PRINT_D(LOCK_DBG, "Locking %p\n", vp);
-   if (vp != NULL)
+   if (vp)
error = down_timeout((struct semaphore *)vp, 
msecs_to_jiffies(timeout));
else
PRINT_ER("Failed, mutex is NULL\n");
@@ -542,12 +542,12 @@ int linux_wlan_get_firmware(struct net_device *dev)
firmware = P2P_CONCURRENCY_FIRMWARE;
}
 
-   if (nic == NULL) {
+   if (!nic) {
PRINT_ER("NIC is NULL\n");
goto _fail_;
}
 
-   if (>wilc_netdev->dev == NULL) {
+   if (!(>wilc_netdev->dev)) {
PRINT_ER(">wilc_netdev->dev  is NULL\n");
goto _fail_;
}
@@ -929,7 +929,7 @@ void wilc1000_wlan_deinit(struct net_device *dev)
disable_sdio_interrupt();
mutex_unlock(>hif_cs);
 #endif
-   if (>txq_event != NULL)
+   if (>txq_event)
up(>txq_event);
 
PRINT_D(INIT_DBG, "Deinitializing Threads\n");
@@ -1002,10 +1002,10 @@ static int wlan_deinit_locks(struct net_device *dev)
 
PRINT_D(INIT_DBG, "De-Initializing Locks\n");
 
-   if (>hif_cs != NULL)
+   if (>hif_cs)
mutex_destroy(>hif_cs);
 
-   if (>rxq_cs != NULL)
+   if (>rxq_cs)
mutex_destroy(>rxq_cs);
 
return 0;
@@ -1078,10 +1078,10 @@ static void wlan_deinitialize_threads(struct net_device 
*dev)
wl->close = 1;
PRINT_D(INIT_DBG, "Deinitializing Threads\n");
 
-   if (>txq_event != NULL)
+   if (>txq_event)
up(>txq_event);
 
-   if (wl->txq_thread != NULL) {
+   if (wl->txq_thread) {
kthread_stop(wl->txq_thread);
wl->txq_thread = NULL;
}
@@ -1400,7 +1400,7 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
}
 
tx_data = kmalloc(sizeof(struct tx_complete_data), GFP_ATOMIC);
-   if (tx_data == NULL) {
+   if (!tx_data) {
PRINT_ER("Failed to allocate memory for tx_data structure\n");
dev_kfree_skb(skb);
netif_wake_queue(ndev);
@@ -1454,7 +1454,8 @@ int mac_close(struct net_device *ndev)
 
nic = netdev_priv(ndev);
 
-   if ((nic == NULL) || (nic->wilc_netdev == NULL) || 
(nic->wilc_netdev->ieee80211_ptr == NULL) || 
(nic->wilc_netdev->ieee80211_ptr->wiphy == NULL)) {
+   if (!nic || !nic->wilc_netdev || !nic->wilc_netdev->ieee80211_ptr ||
+   !nic->wilc_netdev->ieee80211_ptr->wiphy) {
PRINT_ER("nic = NULL\n");
return 0;
}
@@ -1462,7 +1463,7 @@ int mac_close(struct net_device *ndev)
priv = wiphy_priv(nic->wilc_netdev->ieee80211_ptr->wiphy);
wl = nic->wilc;
 
-   if (priv == NULL) {
+   if (!priv) {
PRINT_ER("priv = NULL\n");

[PATCH 11/38] staging: wilc1000: rename pstrWFIDrv of function dev_state_ev_handler

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch renames pstrWFIDrv of function dev_state_ev_handler to hif_drv
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 05f33ec..b4e84e3 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -122,7 +122,7 @@ static int dev_state_ev_handler(struct notifier_block 
*this, unsigned long event
 {
struct in_ifaddr *dev_iface = (struct in_ifaddr *)ptr;
struct wilc_priv *priv;
-   struct host_if_drv *pstrWFIDrv;
+   struct host_if_drv *hif_drv;
struct net_device *dev;
u8 *pIP_Add_buff;
perInterface_wlan_t *nic;
@@ -149,9 +149,9 @@ static int dev_state_ev_handler(struct notifier_block 
*this, unsigned long event
PRINT_D(GENERIC_DBG, "No Wireless Priv\n");
return NOTIFY_DONE;
}
-   pstrWFIDrv = (struct host_if_drv *)priv->hWILCWFIDrv;
+   hif_drv = (struct host_if_drv *)priv->hWILCWFIDrv;
nic = netdev_priv(dev);
-   if (!nic || !pstrWFIDrv) {
+   if (!nic || !hif_drv) {
PRINT_D(GENERIC_DBG, "No Wireless Priv\n");
return NOTIFY_DONE;
}
@@ -166,20 +166,20 @@ static int dev_state_ev_handler(struct notifier_block 
*this, unsigned long event
 
/*If we are in station mode or client mode*/
if (nic->iftype == STATION_MODE || nic->iftype == CLIENT_MODE) {
-   pstrWFIDrv->IFC_UP = 1;
+   hif_drv->IFC_UP = 1;
g_obtainingIP = false;
del_timer();
PRINT_D(GENERIC_DBG, "IP obtained , enable scan\n");
}
 
if (bEnablePS)
-   host_int_set_power_mgmt(pstrWFIDrv, 1, 0);
+   host_int_set_power_mgmt(hif_drv, 1, 0);
 
PRINT_D(GENERIC_DBG, "[%s] Up IP\n", dev_iface->ifa_label);
 
pIP_Add_buff = (char *) (&(dev_iface->ifa_address));
PRINT_D(GENERIC_DBG, "IP add=%d:%d:%d:%d\n", pIP_Add_buff[0], 
pIP_Add_buff[1], pIP_Add_buff[2], pIP_Add_buff[3]);
-   host_int_setup_ipaddress(pstrWFIDrv, pIP_Add_buff, 
nic->u8IfIdx);
+   host_int_setup_ipaddress(hif_drv, pIP_Add_buff, nic->u8IfIdx);
 
break;
 
@@ -188,21 +188,21 @@ static int dev_state_ev_handler(struct notifier_block 
*this, unsigned long event
 
PRINT_INFO(GENERIC_DBG, "\n == IP Address Released 
===\n\n");
if (nic->iftype == STATION_MODE || nic->iftype == CLIENT_MODE) {
-   pstrWFIDrv->IFC_UP = 0;
+   hif_drv->IFC_UP = 0;
g_obtainingIP = false;
}
 
if (memcmp(dev_iface->ifa_label, wlan_dev_name, 5) == 0)
-   host_int_set_power_mgmt(pstrWFIDrv, 0, 0);
+   host_int_set_power_mgmt(hif_drv, 0, 0);
 
-   resolve_disconnect_aberration(pstrWFIDrv);
+   resolve_disconnect_aberration(hif_drv);
 
PRINT_D(GENERIC_DBG, "[%s] Down IP\n", dev_iface->ifa_label);
 
pIP_Add_buff = null_ip;
PRINT_D(GENERIC_DBG, "IP add=%d:%d:%d:%d\n", pIP_Add_buff[0], 
pIP_Add_buff[1], pIP_Add_buff[2], pIP_Add_buff[3]);
 
-   host_int_setup_ipaddress(pstrWFIDrv, pIP_Add_buff, 
nic->u8IfIdx);
+   host_int_setup_ipaddress(hif_drv, pIP_Add_buff, nic->u8IfIdx);
 
break;
 
-- 
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 07/38] staging: wilc1000: remove return type of Handle_wait_msg_q_empty

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch changes return type of Handle_wait_msg_q_empty from s32 with void
because return value is not used.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/host_interface.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 6abba23..584f718 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -835,11 +835,10 @@ ERRORHANDLER:
return result;
 }
 
-static s32 Handle_wait_msg_q_empty(void)
+static void Handle_wait_msg_q_empty(void)
 {
g_wilc_initialized = 0;
up(_sema_wait_response);
-   return 0;
 }
 
 static s32 Handle_Scan(struct host_if_drv *hif_drv,
-- 
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 10/38] staging: wilc1000: linux_wlan: remove unused define CUSTOMER_PLATFORM

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch remove unused define CUSTOMER_PLATFORM from linux_wlan.c.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 15 ---
 1 file changed, 15 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index a483f79..05f33ec 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -32,18 +32,11 @@
 #include "linux_wlan_spi.h"
 #endif
 
-#if defined(CUSTOMER_PLATFORM)
-/*
- TODO : Write power control functions as customer platform.
- */
-#else
-
  #define _linux_wlan_device_power_on() {}
  #define _linux_wlan_device_power_off(){}
 
  #define _linux_wlan_device_detection(){}
  #define _linux_wlan_device_removal()  {}
-#endif
 
 extern bool g_obtainingIP;
 extern void resolve_disconnect_aberration(void *drvHandler);
@@ -278,15 +271,7 @@ static int init_irq(struct net_device *dev)
/*GPIO request*/
if ((gpio_request(GPIO_NUM, "WILC_INTR") == 0) &&
(gpio_direction_input(GPIO_NUM) == 0)) {
-#if defined(CUSTOMER_PLATFORM)
-/*
- TODO : save the registerd irq number to the private wilc context in kernel.
- *
- * ex) nic->dev_irq_num = gpio_to_irq(GPIO_NUM);
- */
-#else
wl->dev_irq_num = gpio_to_irq(GPIO_NUM);
-#endif
} else {
ret = -1;
PRINT_ER("could not obtain gpio for WILC_INTR\n");
-- 
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 04/38] staging: wilc1000: rename pstrHostIfSetMacAddress of fuction Handle_SetMacAddress

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch renames pstrHostIfSetMacAddress of fuction Handle_SetMacAddress
to set_mac_addr to avoid CamelCase naming convention.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 23c15c3..7a58ce7 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -479,7 +479,7 @@ s32 Handle_get_IPAddress(struct host_if_drv *hif_drv, u8 
idx)
 }
 
 static s32 Handle_SetMacAddress(struct host_if_drv *hif_drv,
-   struct set_mac_addr *pstrHostIfSetMacAddress)
+   struct set_mac_addr *set_mac_addr)
 {
s32 result = 0;
struct wid wid;
@@ -492,7 +492,7 @@ static s32 Handle_SetMacAddress(struct host_if_drv *hif_drv,
PRINT_ER("No buffer to send mac address\n");
return -EFAULT;
}
-   memcpy(mac_buf, pstrHostIfSetMacAddress->mac_addr, ETH_ALEN);
+   memcpy(mac_buf, set_mac_addr->mac_addr, ETH_ALEN);
 
wid.id = (u16)WID_MAC_ADDR;
wid.type = WID_STR;
-- 
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 21/38] staging: wilc1000: fixes add spaces required around that '&&'

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch fixes add to spaces around that '&&' or '||'.
Reported by checkpatch.pl for spaces required around that '&&' or '||' 
(ctx:VxE).

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index f8cfdaf..72345b3 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1098,7 +1098,7 @@ int mac_open(struct net_device *ndev)
wl = nic->wilc;
 
 #ifdef WILC_SPI
-   if (!wl|| !wl->wilc_spidev) {
+   if (!wl || !wl->wilc_spidev) {
netdev_err(ndev, "wilc1000: SPI device not ready\n");
return -ENODEV;
}
@@ -1500,8 +1500,7 @@ void wl_wlan_cleanup(struct wilc *wilc)
if (wilc && wilc->firmware)
release_firmware(wilc->firmware);
 
-   if (wilc&&
-  (wilc->vif[0].ndev || wilc->vif[1].ndev)) {
+   if (wilc && (wilc->vif[0].ndev || wilc->vif[1].ndev)) {
linux_wlan_lock_timeout(_exit_sync, 12 * 1000);
 
for (i = 0; i < NUM_CONCURRENT_IFC; i++)
-- 
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 24/38] staging: wilc1000: rename pMacHeader of function get_if_handler

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch renames pMacHeader of function get_if_handler to mac_header
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 8321b76..166f240 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -332,13 +332,13 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag)
}
 }
 
-struct net_device *get_if_handler(struct wilc *wilc, u8 *pMacHeader)
+struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header)
 {
u8 *Bssid, *Bssid1;
int i = 0;
 
-   Bssid  = pMacHeader + 10;
-   Bssid1 = pMacHeader + 4;
+   Bssid = mac_header + 10;
+   Bssid1 = mac_header + 4;
 
for (i = 0; i < wilc->vif_num; i++)
if (!memcmp(Bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
@@ -347,9 +347,9 @@ struct net_device *get_if_handler(struct wilc *wilc, u8 
*pMacHeader)
 
PRINT_INFO(INIT_DBG, "Invalide handle\n");
for (i = 0; i < 25; i++)
-   PRINT_D(INIT_DBG, "%02x ", pMacHeader[i]);
-   Bssid  = pMacHeader + 18;
-   Bssid1 = pMacHeader + 12;
+   PRINT_D(INIT_DBG, "%02x ", mac_header[i]);
+   Bssid = mac_header + 18;
+   Bssid1 = mac_header + 12;
for (i = 0; i < wilc->vif_num; i++)
if (!memcmp(Bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
!memcmp(Bssid, wilc->vif[i].bssid, ETH_ALEN))
-- 
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 26/38] staging: wilc1000: rename Bssid1 of function get_if_handler

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch renames Bssid1 of function get_if_handler to bssid1
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 2cc7cd9..a3bb7e0 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -334,14 +334,14 @@ void linux_wlan_mac_indicate(struct wilc *wilc, int flag)
 
 struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header)
 {
-   u8 *bssid, *Bssid1;
+   u8 *bssid, *bssid1;
int i = 0;
 
bssid = mac_header + 10;
-   Bssid1 = mac_header + 4;
+   bssid1 = mac_header + 4;
 
for (i = 0; i < wilc->vif_num; i++)
-   if (!memcmp(Bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
+   if (!memcmp(bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
!memcmp(bssid, wilc->vif[i].bssid, ETH_ALEN))
return wilc->vif[i].ndev;
 
@@ -349,9 +349,9 @@ struct net_device *get_if_handler(struct wilc *wilc, u8 
*mac_header)
for (i = 0; i < 25; i++)
PRINT_D(INIT_DBG, "%02x ", mac_header[i]);
bssid = mac_header + 18;
-   Bssid1 = mac_header + 12;
+   bssid1 = mac_header + 12;
for (i = 0; i < wilc->vif_num; i++)
-   if (!memcmp(Bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
+   if (!memcmp(bssid1, wilc->vif[i].bssid, ETH_ALEN) ||
!memcmp(bssid, wilc->vif[i].bssid, ETH_ALEN))
return wilc->vif[i].ndev;
 
-- 
1.9.1

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


[PATCH v2] ath9k: Add support for ITS-G5 band (5.9 GHz)

2015-11-02 Thread Michal Sojka
From: Jan Kaisrlik 

The patch adds support for Intelligent Transportation System (ITS-G5)
band to the ath9k driver.

Signed-off-by: Jan Kaisrlik 
Cc: Michal Sojka 
---

Hi all,

in this second version of the patch we removed dependency on
CFG80211_CERTIFICATION_ONUS as suggested by Johannes. We are, however,
not sure whether this is the right thing to do.

The problem is that ath9k uses (REGULATORY_STRICT_REG |
REGULATORY_CUSTOM_REG), which means that in order to use the 5.9 GHz
band, ath9k's private regdomain has to be extended. This in turn means
that the 5.9 GHz band is enabled by default in many configurations. It
can be disabled if one sends a regulatory hint and has valid regdb in
user space, but this cannot be relied upon.

As I already wrote, I don't think that regulatory documents allow such
behavior:

  In EU, regulatory (ECC Decision (08)01) reads:

... decides ... that CEPT administrations shall designate the
frequency sub-band 5875-5905 MHz on a non-exclusive basis for ITS
traffic safety applications;

  I understand this that the band can be used only by "traffic safety
  applications" and not by random laptops running Linux.

  In US, regulatory (FCC 03-324) says among others:

§ 95.603 (h) Each Dedicated Short-Range Communications Service
On-Board Unit (DSRCS-OBU) that operates or is intended to operate
in the DSRCS (5.850-5.925 GHz) must be certified in accordance
with subpart L of this part and subpart J of part 2 of this
chapter.

Especially the US regulatory suggests that using
CFG80211_CERTIFICATION_ONUS might have sense (see the previous version
http://www.mail-archive.com/linux-wireless@vger.kernel.org/msg15228.html).
What do you think?

Thanks.
-Michal & Jan


 drivers/net/wireless/ath/ath9k/common-init.c | 19 +++
 drivers/net/wireless/ath/ath9k/hw.h  |  2 +-
 drivers/net/wireless/ath/regd.c  | 17 -
 3 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/common-init.c 
b/drivers/net/wireless/ath/ath9k/common-init.c
index a006c14..0b61c63 100644
--- a/drivers/net/wireless/ath/ath9k/common-init.c
+++ b/drivers/net/wireless/ath/ath9k/common-init.c
@@ -86,6 +86,25 @@ static const struct ieee80211_channel ath9k_5ghz_chantable[] 
= {
CHAN5G(5785, 35), /* Channel 157 */
CHAN5G(5805, 36), /* Channel 161 */
CHAN5G(5825, 37), /* Channel 165 */
+
+   /* ITS-G5B */
+   CHAN5G(5855, 38), /* Channel 171 */
+   CHAN5G(5860, 39), /* Channel 172 */
+   CHAN5G(5865, 40), /* Channel 173 */
+   CHAN5G(5870, 41), /* Channel 174 */
+   /* ITS-G5A */
+   CHAN5G(5875, 42), /* Channel 175 */
+   CHAN5G(5880, 43), /* Channel 176 */
+   CHAN5G(5885, 44), /* Channel 177 */
+   CHAN5G(5890, 45), /* Channel 178 */
+   CHAN5G(5895, 46), /* Channel 179 */
+   CHAN5G(5900, 47), /* Channel 180 */
+   CHAN5G(5905, 48), /* Channel 181 */
+   /* ITS-G5D */
+   CHAN5G(5910, 49), /* Channel 182 */
+   CHAN5G(5915, 50), /* Channel 183 */
+   CHAN5G(5920, 51), /* Channel 184 */
+   CHAN5G(5925, 52), /* Channel 185 */
 };
 
 /* Atheros hardware rate code addition for short premble */
diff --git a/drivers/net/wireless/ath/ath9k/hw.h 
b/drivers/net/wireless/ath/ath9k/hw.h
index e8454db..debf609 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -73,7 +73,7 @@
 
 #define ATH9K_RSSI_BAD -128
 
-#define ATH9K_NUM_CHANNELS 38
+#define ATH9K_NUM_CHANNELS 53
 
 /* Register read/write primitives */
 #define REG_WRITE(_ah, _reg, _val) \
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index 444bd28..1f8b209 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -50,6 +50,8 @@ static int __ath_regd_init(struct ath_regulatory *reg);
 #define ATH9K_5GHZ_5725_5850   REG_RULE(5725-10, 5850+10, 80, 0, 30,\
 NL80211_RRF_NO_IR)
 
+#define ATH9K_5GHZ_ITSG5   REG_RULE(5855-5, 5925+5, 10, 0, 33, 0)
+
 #define ATH9K_2GHZ_ALL ATH9K_2GHZ_CH01_11, \
ATH9K_2GHZ_CH12_13, \
ATH9K_2GHZ_CH14
@@ -64,53 +66,58 @@ static int __ath_regd_init(struct ath_regulatory *reg);
 /* Can be used for:
  * 0x60, 0x61, 0x62 */
 static const struct ieee80211_regdomain ath_world_regdom_60_61_62 = {
-   .n_reg_rules = 5,
+   .n_reg_rules = 6,
.alpha2 =  "99",
.reg_rules = {
ATH9K_2GHZ_ALL,
ATH9K_5GHZ_ALL,
+   ATH9K_5GHZ_ITSG5,
}
 };
 
 /* Can be used by 0x63 and 0x65 */
 static const struct ieee80211_regdomain ath_world_regdom_63_65 = {
-   .n_reg_rules = 4,
+   .n_reg_rules = 5,
.alpha2 =  "99",
.reg_rules = {
ATH9K_2GHZ_CH01_11,

[PATCH 33/38] staging: wilc1000: remove goto from mac_open

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch removes goto from mac_open function. If address is invalid, goto
handles deinit process and return result.
So, just call deinit process and return the error value directly instead of
goto statement.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 0750412e..1a4ef89 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1129,8 +1129,9 @@ int mac_open(struct net_device *ndev)
 
if (!is_valid_ether_addr(ndev->dev_addr)) {
PRINT_ER("Error: Wrong MAC address\n");
-   ret = -EINVAL;
-   goto _err_;
+   wilc_deinit_host_int(ndev);
+   wilc1000_wlan_deinit(ndev);
+   return -EINVAL;
}
 
wilc_mgmt_frame_register(nic->wilc_netdev->ieee80211_ptr->wiphy,
@@ -1145,11 +1146,6 @@ int mac_open(struct net_device *ndev)
wl->open_ifcs++;
nic->mac_opened = 1;
return 0;
-
-_err_:
-   wilc_deinit_host_int(ndev);
-   wilc1000_wlan_deinit(ndev);
-   return ret;
 }
 
 struct net_device_stats *mac_stats(struct net_device *dev)
-- 
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 38/38] staging: wilc1000: rename pu8UdpBuffer of mac_xmit function

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch rename pu8UdpBuffer variable of mac_xmit function to udp_buf
to avoid CamelCase naming convention.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/linux_wlan.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c 
b/drivers/staging/wilc1000/linux_wlan.c
index 5d1a547..f2be940 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -1224,7 +1224,7 @@ int mac_xmit(struct sk_buff *skb, struct net_device *ndev)
perInterface_wlan_t *nic;
struct tx_complete_data *tx_data = NULL;
int queue_count;
-   char *pu8UdpBuffer;
+   char *udp_buf;
struct iphdr *ih;
struct ethhdr *eth_h;
struct wilc *wilc;
@@ -1257,10 +1257,11 @@ int mac_xmit(struct sk_buff *skb, struct net_device 
*ndev)
 
ih = (struct iphdr *)(skb->data + sizeof(struct ethhdr));
 
-   pu8UdpBuffer = (char *)ih + sizeof(struct iphdr);
-   if ((pu8UdpBuffer[1] == 68 && pu8UdpBuffer[3] == 67) ||
-   (pu8UdpBuffer[1] == 67 && pu8UdpBuffer[3] == 68))
-   PRINT_D(GENERIC_DBG, "DHCP Message transmitted, type:%x %x 
%x\n", pu8UdpBuffer[248], pu8UdpBuffer[249], pu8UdpBuffer[250]);
+   udp_buf = (char *)ih + sizeof(struct iphdr);
+   if ((udp_buf[1] == 68 && udp_buf[3] == 67) ||
+   (udp_buf[1] == 67 && udp_buf[3] == 68))
+   PRINT_D(GENERIC_DBG, "DHCP Message transmitted, type:%x %x 
%x\n",
+   udp_buf[248], udp_buf[249], udp_buf[250]);
 
PRINT_D(TX_DBG, "Sending packet - Size = %d - Address = %p - SKB = 
%p\n", tx_data->size, tx_data->buff, tx_data->skb);
PRINT_D(TX_DBG, "Adding tx packet to TX Queue\n");
-- 
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 03/38] staging: wilc1000: remove unused parameter of fuction Handle_get_IPAddress

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch removes parameter pu8IPAddr of fuction Handle_get_IPAddress because
it is not used in the function. Remove argument in the function call also.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index d2628fd..23c15c3 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -441,7 +441,7 @@ s32 Handle_set_IPAddress(struct host_if_drv *hif_drv, u8 
*ip_addr, u8 idx)
return result;
 }
 
-s32 Handle_get_IPAddress(struct host_if_drv *hif_drv, u8 *pu8IPAddr, u8 idx)
+s32 Handle_get_IPAddress(struct host_if_drv *hif_drv, u8 idx)
 {
s32 result = 0;
struct wid wid;
@@ -3072,7 +3072,7 @@ static int hostIFthread(void *pvArg)
 
case HOST_IF_MSG_GET_IPADDRESS:
PRINT_D(HOSTINF_DBG, "HOST_IF_MSG_SET_IPADDRESS\n");
-   Handle_get_IPAddress(msg.drv, msg.body.ip_info.ip_addr, 
msg.body.ip_info.idx);
+   Handle_get_IPAddress(msg.drv, msg.body.ip_info.idx);
break;
 
case HOST_IF_MSG_SET_MAC_ADDRESS:
-- 
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 05/38] staging: wilc1000: rename pstrHostIfGetMacAddress of fuction Handle_GetMacAddress

2015-11-02 Thread Glen Lee
From: Leo Kim 

This patch renames pstrHostIfGetMacAddress of fuction Handle_GetMacAddress
to get_mac_addr to avoid CamelCase naming convention.

Signed-off-by: Leo Kim 
Signed-off-by: Glen Lee 
---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 7a58ce7..69ec7eb 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -512,7 +512,7 @@ static s32 Handle_SetMacAddress(struct host_if_drv *hif_drv,
 }
 
 static s32 Handle_GetMacAddress(struct host_if_drv *hif_drv,
-   struct get_mac_addr *pstrHostIfGetMacAddress)
+   struct get_mac_addr *get_mac_addr)
 {
s32 result = 0;
struct wid wid;
@@ -522,7 +522,7 @@ static s32 Handle_GetMacAddress(struct host_if_drv *hif_drv,
 
wid.id = (u16)WID_MAC_ADDR;
wid.type = WID_STR;
-   wid.val = pstrHostIfGetMacAddress->mac_addr;
+   wid.val = get_mac_addr->mac_addr;
wid.size = ETH_ALEN;
 
result = send_config_pkt(dev, GET_CFG, , 1,
-- 
1.9.1

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


Re: [PATCH 2/2] ath10k: Fix peerid configuration in htt tx desc for htt version < 3.4

2015-11-02 Thread Michal Kazior
On 2 November 2015 at 09:33, Vasanthakumar Thiagarajan
 wrote:
> Of a word in struct htt_data_tx_desc htt version >= 3.4 firmware uses LSB 
> 16-bit
> for frequency configuration which is used for offchannel tx and MSB 16-bit
> is for peerid. But other firmwares using version 2.X (10.1, 10.2.2, 10.2.4
> and 10.4) are using 32-bit for peerid in htt tx desc. So far no issue is found
> with the existing code setting peerid and freq for HTT version 2.X, this could
> be mainly because of 0 as frequecy (home channel) is being always passed with
> those firmwares. There may be issues when non-zero freq is passed with 
> firmware
> using < 3.4 htt version. To be safe use target_version_major and 
> target_version_minor
> along with htt-op-version before configuring peer id and freq in htt tx desc.
>
> Fixes: 8d6d36243610 ("ath10k: fix offchan reliability")
> Signed-off-by: Vasanthakumar Thiagarajan 
> ---
>  drivers/net/wireless/ath/ath10k/htt.h|  9 +++--
>  drivers/net/wireless/ath/ath10k/htt_tx.c | 13 +++--
>  2 files changed, 18 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/htt.h 
> b/drivers/net/wireless/ath/ath10k/htt.h
> index 2bad50e..44fb4f2 100644
> --- a/drivers/net/wireless/ath/ath10k/htt.h
> +++ b/drivers/net/wireless/ath/ath10k/htt.h
> @@ -166,8 +166,13 @@ struct htt_data_tx_desc {
> __le16 len;
> __le16 id;
> __le32 frags_paddr;
> -   __le16 peerid;
> -   __le16 freq;
> +   union {
> +   __le32 peerid;
> +   struct {
> +   __le16 peerid;
> +   __le16 freq;
> +   } __packed offchan_tx;
> +   } __packed;
> u8 prefetch[0]; /* start of frame, for FW classification engine */
>  } __packed;
>
> diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c 
> b/drivers/net/wireless/ath/ath10k/htt_tx.c
> index 1682397..bf19247 100644
> --- a/drivers/net/wireless/ath/ath10k/htt_tx.c
> +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
> @@ -681,8 +681,17 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff 
> *msdu)
> skb_cb->htt.txbuf->cmd_tx.len = __cpu_to_le16(msdu->len);
> skb_cb->htt.txbuf->cmd_tx.id = __cpu_to_le16(msdu_id);
> skb_cb->htt.txbuf->cmd_tx.frags_paddr = __cpu_to_le32(frags_paddr);
> -   skb_cb->htt.txbuf->cmd_tx.peerid = __cpu_to_le16(HTT_INVALID_PEERID);
> -   skb_cb->htt.txbuf->cmd_tx.freq = __cpu_to_le16(skb_cb->htt.freq);
> +   if (ar->htt.target_version_major >= 3 &&
> +   ar->htt.target_version_minor >= 4 &&
> +   ar->htt.op_version == ATH10K_FW_HTT_OP_VERSION_TLV) {

Hmm.. I think it'd be better to rename
ath10k_mac_need_offchan_tx_work() to, e.g.
ath10k_htt_tx_frm_has_freq() and add the htt.op_version check to it.


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 2/2] ath10k: Fix peerid configuration in htt tx desc for htt version < 3.4

2015-11-02 Thread Vasanthakumar Thiagarajan

On Monday 02 November 2015 03:57 PM, Michal Kazior wrote:

On 2 November 2015 at 09:33, Vasanthakumar Thiagarajan
 wrote:

Of a word in struct htt_data_tx_desc htt version >= 3.4 firmware uses LSB 16-bit
for frequency configuration which is used for offchannel tx and MSB 16-bit
is for peerid. But other firmwares using version 2.X (10.1, 10.2.2, 10.2.4
and 10.4) are using 32-bit for peerid in htt tx desc. So far no issue is found
with the existing code setting peerid and freq for HTT version 2.X, this could
be mainly because of 0 as frequecy (home channel) is being always passed with
those firmwares. There may be issues when non-zero freq is passed with firmware
using < 3.4 htt version. To be safe use target_version_major and 
target_version_minor
along with htt-op-version before configuring peer id and freq in htt tx desc.

Fixes: 8d6d36243610 ("ath10k: fix offchan reliability")
Signed-off-by: Vasanthakumar Thiagarajan 
---
  drivers/net/wireless/ath/ath10k/htt.h|  9 +++--
  drivers/net/wireless/ath/ath10k/htt_tx.c | 13 +++--
  2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/htt.h 
b/drivers/net/wireless/ath/ath10k/htt.h
index 2bad50e..44fb4f2 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -166,8 +166,13 @@ struct htt_data_tx_desc {
 __le16 len;
 __le16 id;
 __le32 frags_paddr;
-   __le16 peerid;
-   __le16 freq;
+   union {
+   __le32 peerid;
+   struct {
+   __le16 peerid;
+   __le16 freq;
+   } __packed offchan_tx;
+   } __packed;
 u8 prefetch[0]; /* start of frame, for FW classification engine */
  } __packed;

diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c 
b/drivers/net/wireless/ath/ath10k/htt_tx.c
index 1682397..bf19247 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -681,8 +681,17 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff 
*msdu)
 skb_cb->htt.txbuf->cmd_tx.len = __cpu_to_le16(msdu->len);
 skb_cb->htt.txbuf->cmd_tx.id = __cpu_to_le16(msdu_id);
 skb_cb->htt.txbuf->cmd_tx.frags_paddr = __cpu_to_le32(frags_paddr);
-   skb_cb->htt.txbuf->cmd_tx.peerid = __cpu_to_le16(HTT_INVALID_PEERID);
-   skb_cb->htt.txbuf->cmd_tx.freq = __cpu_to_le16(skb_cb->htt.freq);
+   if (ar->htt.target_version_major >= 3 &&
+   ar->htt.target_version_minor >= 4 &&
+   ar->htt.op_version == ATH10K_FW_HTT_OP_VERSION_TLV) {


Hmm.. I think it'd be better to rename
ath10k_mac_need_offchan_tx_work() to, e.g.
ath10k_htt_tx_frm_has_freq() and add the htt.op_version check to it.



Sure, thanks.

Vasanth

--
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 29/38] staging: wilc1000: remove goto from linux_wlan_start_firmware

2015-11-02 Thread Dan Carpenter
On Mon, Nov 02, 2015 at 05:51:12PM +0900, Glen Lee wrote:
>   PRINT_D(INIT_DBG, "Waiting for Firmware to get ready ...\n");
>   ret = linux_wlan_lock_timeout(>sync_event, 5000);
>   if (ret) {
>   PRINT_D(INIT_DBG, "Firmware start timed out");
> - goto _fail_;
> + return ret;
>   }
>   PRINT_D(INIT_DBG, "Firmware successfully started\n");
>  
> -_fail_:
>   return ret;

In a later patch, could you change this from "return ret;" to
"return 0;"

regards,
dan carpenter

--
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: [WEXT/nl80211] few API questions

2015-11-02 Thread Gerrit Renker
Thanks a lot indeed, it is helping a good step forward.

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


Re: [RFC] mac80211_hwsim: Adds parameter use_hwsim_mon which can be used to disable hwism0

2015-11-02 Thread Johannes Berg
On Fri, 2015-10-30 at 17:05 -0400, arwe...@cert.org wrote:
> From: Adam Welle 
> 
> A new parameter, use_hwsim_mon has been created to implement new 
> functionalilty. use_hwsim_mon defaults to true so that normal 
> operation remains the same. When set to false, the hwsim0 device is 
> not created. This value is also checked before calling functions 
> which would transmit data to the hwsim0 device.

I understand the use case (since you explained it to me off-list), but
I don't think I want to apply this since in almost all cases having
hwsim0 around but unused isn't actually harmful.

FWIW,

> - mac80211_hwsim_monitor_rx(hw, skb, channel);
> + if (use_hwsim_mon)
> + mac80211_hwsim_monitor_rx(hw, skb, channel);

Had I wanted to apply this, I'd probably have insisted to move the
check into the function instead of outside of it, since that leaves no
chances of getting it wrong when changing the code in the future.

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: [RFC] mac80211_hwsim: Implements a check for ATTR_FREQ inside hwsim_cloned_frame_received_nl

2015-11-02 Thread Johannes Berg
On Fri, 2015-10-30 at 17:00 -0400, arwe...@cert.org wrote:
> From: Adam Welle 
> 
> If a frame is received from netlink with this value set it is checked 
> against the current radio's frequency and discarded if different.

Please line-break the commit log to <=72 characters/line.

> + /* Check ATTR_FREQ if it exists, and throw away off-channel 
> packets */
> + if (info->attrs[HWSIM_ATTR_FREQ])
> + rx_status.freq = nla_get_u32(info
> ->attrs[HWSIM_ATTR_FREQ]);
> + else
> + rx_status.freq = data2->channel->center_freq;
> +
> + /* Drop packet if not on the same frequency as this radio */
> + if (rx_status.freq != data2->channel->center_freq)
> + goto out;
> 
I think it'd make sense to have that check only in the case that the
attribute existed. I'm not too concerned about performance here, but
more generally it looks odd if you're checking when you know it can't
be different.

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