[PATCH v3 04/18] wcn36xx: Use consistent name for private vif

2016-04-18 Thread Bjorn Andersson
From: Pontus Fuchs 

Some code used priv_vif and some used vif_priv. Convert all to vif_priv
for consistency.

Signed-off-by: Pontus Fuchs 
Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 28 ++--
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c 
b/drivers/net/wireless/ath/wcn36xx/smd.c
index cc1b3b7a4ff9..170440ed5d85 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -191,7 +191,7 @@ static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn,
struct ieee80211_sta *sta,
struct wcn36xx_hal_config_sta_params *sta_params)
 {
-   struct wcn36xx_vif *priv_vif = wcn36xx_vif_to_priv(vif);
+   struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
struct wcn36xx_sta *priv_sta = NULL;
if (vif->type == NL80211_IFTYPE_ADHOC ||
vif->type == NL80211_IFTYPE_AP ||
@@ -215,7 +215,7 @@ static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn,
else
memcpy(_params->bssid, vif->addr, ETH_ALEN);
 
-   sta_params->encrypt_type = priv_vif->encrypt_type;
+   sta_params->encrypt_type = vif_priv->encrypt_type;
sta_params->short_preamble_supported = true;
 
sta_params->rifs_mode = 0;
@@ -224,7 +224,7 @@ static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn,
sta_params->uapsd = 0;
sta_params->mimo_ps = WCN36XX_HAL_HT_MIMO_PS_STATIC;
sta_params->max_ampdu_duration = 0;
-   sta_params->bssid_index = priv_vif->bss_index;
+   sta_params->bssid_index = vif_priv->bss_index;
sta_params->p2p = 0;
 
if (sta) {
@@ -726,7 +726,7 @@ static int wcn36xx_smd_add_sta_self_rsp(struct wcn36xx *wcn,
size_t len)
 {
struct wcn36xx_hal_add_sta_self_rsp_msg *rsp;
-   struct wcn36xx_vif *priv_vif = wcn36xx_vif_to_priv(vif);
+   struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
 
if (len < sizeof(*rsp))
return -EINVAL;
@@ -743,8 +743,8 @@ static int wcn36xx_smd_add_sta_self_rsp(struct wcn36xx *wcn,
"hal add sta self status %d self_sta_index %d dpu_index 
%d\n",
rsp->status, rsp->self_sta_index, rsp->dpu_index);
 
-   priv_vif->self_sta_index = rsp->self_sta_index;
-   priv_vif->self_dpu_desc_index = rsp->dpu_index;
+   vif_priv->self_sta_index = rsp->self_sta_index;
+   vif_priv->self_dpu_desc_index = rsp->dpu_index;
 
return 0;
 }
@@ -1175,7 +1175,7 @@ static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn,
 {
struct wcn36xx_hal_config_bss_rsp_msg *rsp;
struct wcn36xx_hal_config_bss_rsp_params *params;
-   struct wcn36xx_vif *priv_vif = wcn36xx_vif_to_priv(vif);
+   struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
 
if (len < sizeof(*rsp))
return -EINVAL;
@@ -1198,14 +1198,14 @@ static int wcn36xx_smd_config_bss_rsp(struct wcn36xx 
*wcn,
params->bss_bcast_sta_idx, params->mac,
params->tx_mgmt_power, params->ucast_dpu_signature);
 
-   priv_vif->bss_index = params->bss_index;
+   vif_priv->bss_index = params->bss_index;
 
-   if (priv_vif->sta) {
-   priv_vif->sta->bss_sta_index =  params->bss_sta_index;
-   priv_vif->sta->bss_dpu_desc_index = params->dpu_desc_index;
+   if (vif_priv->sta) {
+   vif_priv->sta->bss_sta_index =  params->bss_sta_index;
+   vif_priv->sta->bss_dpu_desc_index = params->dpu_desc_index;
}
 
-   priv_vif->self_ucast_dpu_sign = params->ucast_dpu_signature;
+   vif_priv->self_ucast_dpu_sign = params->ucast_dpu_signature;
 
return 0;
 }
@@ -1343,13 +1343,13 @@ out:
 int wcn36xx_smd_delete_bss(struct wcn36xx *wcn, struct ieee80211_vif *vif)
 {
struct wcn36xx_hal_delete_bss_req_msg msg_body;
-   struct wcn36xx_vif *priv_vif = wcn36xx_vif_to_priv(vif);
+   struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
int ret = 0;
 
mutex_lock(>hal_mutex);
INIT_HAL_MSG(msg_body, WCN36XX_HAL_DELETE_BSS_REQ);
 
-   msg_body.bss_index = priv_vif->bss_index;
+   msg_body.bss_index = vif_priv->bss_index;
 
PREPARE_HAL_BUF(wcn->hal_buf, msg_body);
 
-- 
2.5.0

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


[PATCH v3 06/18] wcn36xx: Add helper macros to cast sta to priv

2016-04-18 Thread Bjorn Andersson
From: Pontus Fuchs 

While poking at this I also change two related things. I rename one
variable to make the names consistent. I also move one assignment of
priv_sta to the declaration to save a few lines.

Signed-off-by: Pontus Fuchs 
Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/main.c| 14 ++
 drivers/net/wireless/ath/wcn36xx/smd.c | 12 ++--
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h |  6 ++
 3 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c 
b/drivers/net/wireless/ath/wcn36xx/main.c
index 4781b5e8deb3..30f015d3a9e6 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -373,7 +373,7 @@ static void wcn36xx_tx(struct ieee80211_hw *hw,
struct wcn36xx_sta *sta_priv = NULL;
 
if (control->sta)
-   sta_priv = (struct wcn36xx_sta *)control->sta->drv_priv;
+   sta_priv = wcn36xx_sta_to_priv(control->sta);
 
if (wcn36xx_start_tx(wcn, sta_priv, skb))
ieee80211_free_txskb(wcn->hw, skb);
@@ -518,7 +518,7 @@ static void wcn36xx_update_allowed_rates(struct 
ieee80211_sta *sta,
 {
int i, size;
u16 *rates_table;
-   struct wcn36xx_sta *sta_priv = (struct wcn36xx_sta *)sta->drv_priv;
+   struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta);
u32 rates = sta->supp_rates[band];
 
memset(_priv->supported_rates, 0,
@@ -661,7 +661,7 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw 
*hw,
rcu_read_unlock();
goto out;
}
-   sta_priv = (struct wcn36xx_sta *)sta->drv_priv;
+   sta_priv = wcn36xx_sta_to_priv(sta);
 
wcn36xx_update_allowed_rates(sta, WCN36XX_BAND(wcn));
 
@@ -791,7 +791,7 @@ static int wcn36xx_sta_add(struct ieee80211_hw *hw, struct 
ieee80211_vif *vif,
 {
struct wcn36xx *wcn = hw->priv;
struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
-   struct wcn36xx_sta *sta_priv = (struct wcn36xx_sta *)sta->drv_priv;
+   struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta);
wcn36xx_dbg(WCN36XX_DBG_MAC, "mac sta add vif %p sta %pM\n",
vif, sta->addr);
 
@@ -816,7 +816,7 @@ static int wcn36xx_sta_remove(struct ieee80211_hw *hw,
 {
struct wcn36xx *wcn = hw->priv;
struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
-   struct wcn36xx_sta *sta_priv = (struct wcn36xx_sta *)sta->drv_priv;
+   struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta);
 
wcn36xx_dbg(WCN36XX_DBG_MAC, "mac sta remove vif %p sta %pM index %d\n",
vif, sta->addr, sta_priv->sta_index);
@@ -858,7 +858,7 @@ static int wcn36xx_ampdu_action(struct ieee80211_hw *hw,
struct ieee80211_ampdu_params *params)
 {
struct wcn36xx *wcn = hw->priv;
-   struct wcn36xx_sta *sta_priv = NULL;
+   struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(params->sta);
struct ieee80211_sta *sta = params->sta;
enum ieee80211_ampdu_mlme_action action = params->action;
u16 tid = params->tid;
@@ -867,8 +867,6 @@ static int wcn36xx_ampdu_action(struct ieee80211_hw *hw,
wcn36xx_dbg(WCN36XX_DBG_MAC, "mac ampdu action action %d tid %d\n",
action, tid);
 
-   sta_priv = (struct wcn36xx_sta *)sta->drv_priv;
-
switch (action) {
case IEEE80211_AMPDU_RX_START:
sta_priv->tid = tid;
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c 
b/drivers/net/wireless/ath/wcn36xx/smd.c
index 6d4aa9250ca8..ff56138528b6 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -192,7 +192,7 @@ static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn,
struct wcn36xx_hal_config_sta_params *sta_params)
 {
struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
-   struct wcn36xx_sta *priv_sta = NULL;
+   struct wcn36xx_sta *sta_priv = NULL;
if (vif->type == NL80211_IFTYPE_ADHOC ||
vif->type == NL80211_IFTYPE_AP ||
vif->type == NL80211_IFTYPE_MESH_POINT) {
@@ -228,17 +228,17 @@ static void wcn36xx_smd_set_sta_params(struct wcn36xx 
*wcn,
sta_params->p2p = 0;
 
if (sta) {
-   priv_sta = (struct wcn36xx_sta *)sta->drv_priv;
+   sta_priv = wcn36xx_sta_to_priv(sta);
if (NL80211_IFTYPE_STATION == vif->type)
memcpy(_params->bssid, sta->addr, ETH_ALEN);
else
memcpy(_params->mac, sta->addr, ETH_ALEN);
sta_params->wmm_enabled = sta->wme;
sta_params->max_sp_len = sta->max_sp;
-   sta_params->aid = priv_sta->aid;
+

[PATCH v3 01/18] wcn36xx: Clean up wcn36xx_smd_send_beacon

2016-04-18 Thread Bjorn Andersson
From: Pontus Fuchs 

Needed for coming improvements. No functional changes.

Signed-off-by: Pontus Fuchs 
[bjorn: restored BEACON_TEMPLATE_SIZE define to 0x180]
Signed-off-by: Bjorn Andersson 
---

Changes since v2:
- Subtract sizeof(beacon_length) instead of modifying BEACON_TEMPLATE_SIZE,
  which is used in other places as well.

 drivers/net/wireless/ath/wcn36xx/hal.h |  5 -
 drivers/net/wireless/ath/wcn36xx/smd.c | 12 +---
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h 
b/drivers/net/wireless/ath/wcn36xx/hal.h
index b947de0fb2e5..d713204f755d 100644
--- a/drivers/net/wireless/ath/wcn36xx/hal.h
+++ b/drivers/net/wireless/ath/wcn36xx/hal.h
@@ -2884,11 +2884,14 @@ struct update_beacon_rsp_msg {
 struct wcn36xx_hal_send_beacon_req_msg {
struct wcn36xx_hal_msg_header header;
 
+   /* length of the template + 6. Only qcom knows why */
+   u32 beacon_length6;
+
/* length of the template. */
u32 beacon_length;
 
/* Beacon data. */
-   u8 beacon[BEACON_TEMPLATE_SIZE];
+   u8 beacon[BEACON_TEMPLATE_SIZE - sizeof(u32)];
 
u8 bssid[ETH_ALEN];
 
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c 
b/drivers/net/wireless/ath/wcn36xx/smd.c
index 74f56a81ad9a..ff3ed2461a69 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1380,19 +1380,17 @@ int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct 
ieee80211_vif *vif,
mutex_lock(>hal_mutex);
INIT_HAL_MSG(msg_body, WCN36XX_HAL_SEND_BEACON_REQ);
 
-   /* TODO need to find out why this is needed? */
-   msg_body.beacon_length = skb_beacon->len + 6;
+   msg_body.beacon_length = skb_beacon->len;
+   /* TODO need to find out why + 6 is needed */
+   msg_body.beacon_length6 = msg_body.beacon_length + 6;
 
-   if (BEACON_TEMPLATE_SIZE > msg_body.beacon_length) {
-   memcpy(_body.beacon, _beacon->len, sizeof(u32));
-   memcpy(&(msg_body.beacon[4]), skb_beacon->data,
-  skb_beacon->len);
-   } else {
+   if (msg_body.beacon_length > BEACON_TEMPLATE_SIZE) {
wcn36xx_err("Beacon is to big: beacon size=%d\n",
  msg_body.beacon_length);
ret = -ENOMEM;
goto out;
}
+   memcpy(msg_body.beacon, skb_beacon->data, skb_beacon->len);
memcpy(msg_body.bssid, vif->addr, ETH_ALEN);
 
/* TODO need to find out why this is needed? */
-- 
2.5.0

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


[PATCH v3 07/18] wcn36xx: Fetch private sta data from sta entry instead of from vif

2016-04-18 Thread Bjorn Andersson
From: Pontus Fuchs 

For consistency with other code.

Signed-off-by: Pontus Fuchs 
Signed-off-by: Bjorn Andersson 
---

Changes since v1:
- Reordered after the now previous patch, to make wcn36xx_sta_to_priv()
  available before we use it

 drivers/net/wireless/ath/wcn36xx/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c 
b/drivers/net/wireless/ath/wcn36xx/main.c
index 30f015d3a9e6..a23738deb5b3 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -386,7 +386,7 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum 
set_key_cmd cmd,
 {
struct wcn36xx *wcn = hw->priv;
struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
-   struct wcn36xx_sta *sta_priv = vif_priv->sta;
+   struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta);
int ret = 0;
u8 key[WLAN_MAX_KEY_LEN];
 
-- 
2.5.0

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


[PATCH v3 08/18] wcn36xx: Remove sta pointer in private vif struct

2016-04-18 Thread Bjorn Andersson
From: Pontus Fuchs 

This does not work with multiple sta's in a vif.

Signed-off-by: Pontus Fuchs 
Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/main.c|  3 ---
 drivers/net/wireless/ath/wcn36xx/smd.c | 28 +++-
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h |  1 -
 3 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c 
b/drivers/net/wireless/ath/wcn36xx/main.c
index a23738deb5b3..7c06ca9fdd2c 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -796,7 +796,6 @@ static int wcn36xx_sta_add(struct ieee80211_hw *hw, struct 
ieee80211_vif *vif,
vif, sta->addr);
 
spin_lock_init(_priv->ampdu_lock);
-   vif_priv->sta = sta_priv;
sta_priv->vif = vif_priv;
/*
 * For STA mode HW will be configured on BSS_CHANGED_ASSOC because
@@ -815,14 +814,12 @@ static int wcn36xx_sta_remove(struct ieee80211_hw *hw,
  struct ieee80211_sta *sta)
 {
struct wcn36xx *wcn = hw->priv;
-   struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta);
 
wcn36xx_dbg(WCN36XX_DBG_MAC, "mac sta remove vif %p sta %pM index %d\n",
vif, sta->addr, sta_priv->sta_index);
 
wcn36xx_smd_delete_sta(wcn, sta_priv->sta_index);
-   vif_priv->sta = NULL;
sta_priv->vif = NULL;
return 0;
 }
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c 
b/drivers/net/wireless/ath/wcn36xx/smd.c
index ff56138528b6..76c6856ed932 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1170,6 +1170,7 @@ static int wcn36xx_smd_config_bss_v1(struct wcn36xx *wcn,
 
 static int wcn36xx_smd_config_bss_rsp(struct wcn36xx *wcn,
  struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta,
  void *buf,
  size_t len)
 {
@@ -1200,9 +1201,10 @@ static int wcn36xx_smd_config_bss_rsp(struct wcn36xx 
*wcn,
 
vif_priv->bss_index = params->bss_index;
 
-   if (vif_priv->sta) {
-   vif_priv->sta->bss_sta_index =  params->bss_sta_index;
-   vif_priv->sta->bss_dpu_desc_index = params->dpu_desc_index;
+   if (sta) {
+   struct wcn36xx_sta *sta_priv = wcn36xx_sta_to_priv(sta);
+   sta_priv->bss_sta_index = params->bss_sta_index;
+   sta_priv->bss_dpu_desc_index = params->dpu_desc_index;
}
 
vif_priv->self_ucast_dpu_sign = params->ucast_dpu_signature;
@@ -1329,6 +1331,7 @@ int wcn36xx_smd_config_bss(struct wcn36xx *wcn, struct 
ieee80211_vif *vif,
}
ret = wcn36xx_smd_config_bss_rsp(wcn,
 vif,
+sta,
 wcn->hal_buf,
 wcn->hal_rsp_len);
if (ret) {
@@ -2058,25 +2061,24 @@ static int wcn36xx_smd_delete_sta_context_ind(struct 
wcn36xx *wcn,
 {
struct wcn36xx_hal_delete_sta_context_ind_msg *rsp = buf;
struct wcn36xx_vif *tmp;
-   struct ieee80211_sta *sta = NULL;
+   struct ieee80211_sta *sta;
 
if (len != sizeof(*rsp)) {
wcn36xx_warn("Corrupted delete sta indication\n");
return -EIO;
}
 
+   wcn36xx_dbg(WCN36XX_DBG_HAL, "delete station indication %pM index %d\n",
+   rsp->addr2, rsp->sta_id);
+
list_for_each_entry(tmp, >vif_list, list) {
-   if (sta && (tmp->sta->sta_index == rsp->sta_id)) {
-   sta = container_of((void *)tmp->sta,
-struct ieee80211_sta,
-drv_priv);
-   wcn36xx_dbg(WCN36XX_DBG_HAL,
-   "delete station indication %pM index %d\n",
-   rsp->addr2,
-   rsp->sta_id);
+   rcu_read_lock();
+   sta = ieee80211_find_sta(wcn36xx_priv_to_vif(tmp), rsp->addr2);
+   if (sta)
ieee80211_report_low_ack(sta, 0);
+   rcu_read_unlock();
+   if (sta)
return 0;
-   }
}
 
wcn36xx_warn("STA with addr %pM and index %d not found\n",
diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h 
b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
index c368a34c8de7..54000db0af1a 100644
--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
+++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
@@ -125,7 +125,6 @@ struct wcn36xx_platform_ctrl_ops {
  */
 struct wcn36xx_vif {

[PATCH v3 03/18] wcn36xx: Add helper macros to cast vif to private vif and vice versa

2016-04-18 Thread Bjorn Andersson
From: Pontus Fuchs 

Makes the code a little easier to read.

Signed-off-by: Pontus Fuchs 
Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/debug.c   | 12 +++-
 drivers/net/wireless/ath/wcn36xx/main.c| 16 +++-
 drivers/net/wireless/ath/wcn36xx/pmc.c |  4 ++--
 drivers/net/wireless/ath/wcn36xx/smd.c | 24 ++--
 drivers/net/wireless/ath/wcn36xx/txrx.c|  8 ++--
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 12 
 6 files changed, 36 insertions(+), 40 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/debug.c 
b/drivers/net/wireless/ath/wcn36xx/debug.c
index ef44a2da644d..2a6bb62e785c 100644
--- a/drivers/net/wireless/ath/wcn36xx/debug.c
+++ b/drivers/net/wireless/ath/wcn36xx/debug.c
@@ -33,9 +33,7 @@ static ssize_t read_file_bool_bmps(struct file *file, char 
__user *user_buf,
char buf[3];
 
list_for_each_entry(vif_priv, >vif_list, list) {
-   vif = container_of((void *)vif_priv,
-  struct ieee80211_vif,
-  drv_priv);
+   vif = wcn36xx_priv_to_vif(vif_priv);
if (NL80211_IFTYPE_STATION == vif->type) {
if (vif_priv->pw_state == WCN36XX_BMPS)
buf[0] = '1';
@@ -70,9 +68,7 @@ static ssize_t write_file_bool_bmps(struct file *file,
case 'Y':
case '1':
list_for_each_entry(vif_priv, >vif_list, list) {
-   vif = container_of((void *)vif_priv,
-  struct ieee80211_vif,
-  drv_priv);
+   vif = wcn36xx_priv_to_vif(vif_priv);
if (NL80211_IFTYPE_STATION == vif->type) {
wcn36xx_enable_keep_alive_null_packet(wcn, vif);
wcn36xx_pmc_enter_bmps_state(wcn, vif);
@@ -83,9 +79,7 @@ static ssize_t write_file_bool_bmps(struct file *file,
case 'N':
case '0':
list_for_each_entry(vif_priv, >vif_list, list) {
-   vif = container_of((void *)vif_priv,
-  struct ieee80211_vif,
-  drv_priv);
+   vif = wcn36xx_priv_to_vif(vif_priv);
if (NL80211_IFTYPE_STATION == vif->type)
wcn36xx_pmc_exit_bmps_state(wcn, vif);
}
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c 
b/drivers/net/wireless/ath/wcn36xx/main.c
index a27279c2c695..62cb9ffd854c 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -346,9 +346,7 @@ static int wcn36xx_config(struct ieee80211_hw *hw, u32 
changed)
wcn36xx_dbg(WCN36XX_DBG_MAC, "wcn36xx_config channel 
switch=%d\n",
ch);
list_for_each_entry(tmp, >vif_list, list) {
-   vif = container_of((void *)tmp,
-  struct ieee80211_vif,
-  drv_priv);
+   vif = wcn36xx_priv_to_vif(tmp);
wcn36xx_smd_switch_channel(wcn, vif, ch);
}
}
@@ -387,7 +385,7 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum 
set_key_cmd cmd,
   struct ieee80211_key_conf *key_conf)
 {
struct wcn36xx *wcn = hw->priv;
-   struct wcn36xx_vif *vif_priv = (struct wcn36xx_vif *)vif->drv_priv;
+   struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
struct wcn36xx_sta *sta_priv = vif_priv->sta;
int ret = 0;
u8 key[WLAN_MAX_KEY_LEN];
@@ -590,7 +588,7 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw 
*hw,
struct sk_buff *skb = NULL;
u16 tim_off, tim_len;
enum wcn36xx_hal_link_state link_state;
-   struct wcn36xx_vif *vif_priv = (struct wcn36xx_vif *)vif->drv_priv;
+   struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
 
wcn36xx_dbg(WCN36XX_DBG_MAC, "mac bss info changed vif %p changed 
0x%08x\n",
vif, changed);
@@ -757,7 +755,7 @@ static void wcn36xx_remove_interface(struct ieee80211_hw 
*hw,
 struct ieee80211_vif *vif)
 {
struct wcn36xx *wcn = hw->priv;
-   struct wcn36xx_vif *vif_priv = (struct wcn36xx_vif *)vif->drv_priv;
+   struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
wcn36xx_dbg(WCN36XX_DBG_MAC, "mac remove interface vif %p\n", vif);
 
list_del(_priv->list);
@@ -768,7 +766,7 @@ static int wcn36xx_add_interface(struct ieee80211_hw *hw,
 struct ieee80211_vif *vif)
 {
struct wcn36xx *wcn = hw->priv;
-   struct 

[PATCH v3 00/18] wcn36xx fixes

2016-04-18 Thread Bjorn Andersson
The bulk of the following patches have been sitting in Eugene's Github tree for
quite some time. They fix various issues existing in the mainline drivers, so
they should be merged there too.

Also included are two new fixes, of my own; the important one being the
reordering of deletion of the bss, as this crashes the firmware on the
Dragonbaord 410c (apq8016 with pronto & wcn3620).

Lastly is a patch that adds a bunch of new capabilities found in the downstream
driver.

Changes since v2:
- Restore BEACON_TEMPLATE_SIZE to not break UPDATE_PROBE_RSP_TEMPLATE_REQ
- Added patch to correct WCN36XX_HAL_RMV_BSSKEY_RSP decoder
- Added patch with missing capabilities from downstream

Changes since v1:
- Reorder patch 6 and 7 to not break the build temporarily
- Inline fix from Jason Mobarak in the TIM PVM padding

Bjorn Andersson (3):
  wcn36xx: Delete BSS before idling link
  wcn36xx: Correct remove bss key response encoding
  wcn36xx: Fill in capability list

Pontus Fuchs (15):
  wcn36xx: Clean up wcn36xx_smd_send_beacon
  wcn36xx: Pad TIM PVM if needed
  wcn36xx: Add helper macros to cast vif to private vif and vice versa
  wcn36xx: Use consistent name for private vif
  wcn36xx: Use define for invalid index and fix typo
  wcn36xx: Add helper macros to cast sta to priv
  wcn36xx: Fetch private sta data from sta entry instead of from vif
  wcn36xx: Remove sta pointer in private vif struct
  wcn36xx: Parse trigger_ba response properly
  wcn36xx: Copy all members in config_sta v1 conversion
  wcn36xx: Use allocated self sta index instead of hard coded
  wcn36xx: Clear encrypt_type when deleting bss key
  wcn36xx: Track association state
  wcn36xx: Implement multicast filtering
  wcn36xx: Use correct command struct for EXIT_BMPS_REQ

 drivers/net/wireless/ath/wcn36xx/debug.c   |  12 +-
 drivers/net/wireless/ath/wcn36xx/hal.h |  55 ++-
 drivers/net/wireless/ath/wcn36xx/main.c| 133 +
 drivers/net/wireless/ath/wcn36xx/pmc.c |   4 +-
 drivers/net/wireless/ath/wcn36xx/smd.c | 224 +++--
 drivers/net/wireless/ath/wcn36xx/smd.h |  12 +-
 drivers/net/wireless/ath/wcn36xx/txrx.c|   8 +-
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h |  20 ++-
 8 files changed, 336 insertions(+), 132 deletions(-)

-- 
2.5.0

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


[PATCH v3 12/18] wcn36xx: Clear encrypt_type when deleting bss key

2016-04-18 Thread Bjorn Andersson
From: Pontus Fuchs 

This fixes a problem connecting to an open network after being
connected to an encrypted network.

Signed-off-by: Pontus Fuchs 
Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c 
b/drivers/net/wireless/ath/wcn36xx/main.c
index 7c06ca9fdd2c..f9c77de94583 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -471,6 +471,7 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum 
set_key_cmd cmd,
break;
case DISABLE_KEY:
if (!(IEEE80211_KEY_FLAG_PAIRWISE & key_conf->flags)) {
+   vif_priv->encrypt_type = WCN36XX_HAL_ED_NONE;
wcn36xx_smd_remove_bsskey(wcn,
vif_priv->encrypt_type,
key_conf->keyidx);
@@ -626,6 +627,7 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw 
*hw,
} else {
vif_priv->is_joining = false;
wcn36xx_smd_delete_bss(wcn, vif);
+   vif_priv->encrypt_type = WCN36XX_HAL_ED_NONE;
}
}
 
-- 
2.5.0

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


[PATCH v3 09/18] wcn36xx: Parse trigger_ba response properly

2016-04-18 Thread Bjorn Andersson
From: Pontus Fuchs 

This message does not follow the canonical format and needs it's own
parser.

Signed-off-by: Pontus Fuchs 
Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c 
b/drivers/net/wireless/ath/wcn36xx/smd.c
index 76c6856ed932..7f315d098f52 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1968,6 +1968,17 @@ out:
return ret;
 }
 
+static int wcn36xx_smd_trigger_ba_rsp(void *buf, int len)
+{
+   struct wcn36xx_hal_trigger_ba_rsp_msg *rsp;
+
+   if (len < sizeof(*rsp))
+   return -EINVAL;
+
+   rsp = (struct wcn36xx_hal_trigger_ba_rsp_msg *) buf;
+   return rsp->status;
+}
+
 int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 sta_index)
 {
struct wcn36xx_hal_trigger_ba_req_msg msg_body;
@@ -1992,8 +2003,7 @@ int wcn36xx_smd_trigger_ba(struct wcn36xx *wcn, u8 
sta_index)
wcn36xx_err("Sending hal_trigger_ba failed\n");
goto out;
}
-   ret = wcn36xx_smd_rsp_status_check_v2(wcn, wcn->hal_buf,
-   wcn->hal_rsp_len);
+   ret = wcn36xx_smd_trigger_ba_rsp(wcn->hal_buf, wcn->hal_rsp_len);
if (ret) {
wcn36xx_err("hal_trigger_ba response failed err=%d\n", ret);
goto out;
-- 
2.5.0

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


[PATCH v3 05/18] wcn36xx: Use define for invalid index and fix typo

2016-04-18 Thread Bjorn Andersson
From: Pontus Fuchs 

Signed-off-by: Pontus Fuchs 
Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/hal.h  | 2 +-
 drivers/net/wireless/ath/wcn36xx/main.c | 4 ++--
 drivers/net/wireless/ath/wcn36xx/smd.c  | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h 
b/drivers/net/wireless/ath/wcn36xx/hal.h
index 3af16cba3d12..433d9801a0ae 100644
--- a/drivers/net/wireless/ath/wcn36xx/hal.h
+++ b/drivers/net/wireless/ath/wcn36xx/hal.h
@@ -48,7 +48,7 @@
 
 #define WCN36XX_HAL_IPV4_ADDR_LEN   4
 
-#define WALN_HAL_STA_INVALID_IDX 0xFF
+#define WCN36XX_HAL_STA_INVALID_IDX 0xFF
 #define WCN36XX_HAL_BSS_INVALID_IDX 0xFF
 
 /* Default Beacon template size */
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c 
b/drivers/net/wireless/ath/wcn36xx/main.c
index 62cb9ffd854c..4781b5e8deb3 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -618,7 +618,7 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw 
*hw,
 
if (!is_zero_ether_addr(bss_conf->bssid)) {
vif_priv->is_joining = true;
-   vif_priv->bss_index = 0xff;
+   vif_priv->bss_index = WCN36XX_HAL_BSS_INVALID_IDX;
wcn36xx_smd_join(wcn, bss_conf->bssid,
 vif->addr, WCN36XX_HW_CHANNEL(wcn));
wcn36xx_smd_config_bss(wcn, vif, NULL,
@@ -711,7 +711,7 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw 
*hw,
 
if (bss_conf->enable_beacon) {
vif_priv->dtim_period = bss_conf->dtim_period;
-   vif_priv->bss_index = 0xff;
+   vif_priv->bss_index = WCN36XX_HAL_BSS_INVALID_IDX;
wcn36xx_smd_config_bss(wcn, vif, NULL,
   vif->addr, false);
skb = ieee80211_beacon_get_tim(hw, vif, _off,
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c 
b/drivers/net/wireless/ath/wcn36xx/smd.c
index 170440ed5d85..6d4aa9250ca8 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -197,7 +197,7 @@ static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn,
vif->type == NL80211_IFTYPE_AP ||
vif->type == NL80211_IFTYPE_MESH_POINT) {
sta_params->type = 1;
-   sta_params->sta_index = 0xFF;
+   sta_params->sta_index = WCN36XX_HAL_STA_INVALID_IDX;
} else {
sta_params->type = 0;
sta_params->sta_index = 1;
-- 
2.5.0

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


[PATCH v3 11/18] wcn36xx: Use allocated self sta index instead of hard coded

2016-04-18 Thread Bjorn Andersson
From: Pontus Fuchs 

Signed-off-by: Pontus Fuchs 
Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c 
b/drivers/net/wireless/ath/wcn36xx/smd.c
index ebb446272d21..e0d5631657c1 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -200,7 +200,7 @@ static void wcn36xx_smd_set_sta_params(struct wcn36xx *wcn,
sta_params->sta_index = WCN36XX_HAL_STA_INVALID_IDX;
} else {
sta_params->type = 0;
-   sta_params->sta_index = 1;
+   sta_params->sta_index = vif_priv->self_sta_index;
}
 
sta_params->listen_interval = WCN36XX_LISTEN_INTERVAL(wcn);
-- 
2.5.0

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


[PATCH v3 10/18] wcn36xx: Copy all members in config_sta v1 conversion

2016-04-18 Thread Bjorn Andersson
From: Pontus Fuchs 

When converting to version 1 of the config_sta struct not all
members where copied. This fixes the problem of multicast frames
not being delivered on an encrypted network.

Signed-off-by: Pontus Fuchs 
Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 19 +--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c 
b/drivers/net/wireless/ath/wcn36xx/smd.c
index 7f315d098f52..ebb446272d21 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -949,17 +949,32 @@ static void wcn36xx_smd_convert_sta_to_v1(struct wcn36xx 
*wcn,
memcpy(>mac, orig->mac, ETH_ALEN);
v1->aid = orig->aid;
v1->type = orig->type;
+   v1->short_preamble_supported = orig->short_preamble_supported;
v1->listen_interval = orig->listen_interval;
+   v1->wmm_enabled = orig->wmm_enabled;
v1->ht_capable = orig->ht_capable;
-
+   v1->tx_channel_width_set = orig->tx_channel_width_set;
+   v1->rifs_mode = orig->rifs_mode;
+   v1->lsig_txop_protection = orig->lsig_txop_protection;
v1->max_ampdu_size = orig->max_ampdu_size;
v1->max_ampdu_density = orig->max_ampdu_density;
v1->sgi_40mhz = orig->sgi_40mhz;
v1->sgi_20Mhz = orig->sgi_20Mhz;
-
+   v1->rmf = orig->rmf;
+   v1->encrypt_type = orig->encrypt_type;
+   v1->action = orig->action;
+   v1->uapsd = orig->uapsd;
+   v1->max_sp_len = orig->max_sp_len;
+   v1->green_field_capable = orig->green_field_capable;
+   v1->mimo_ps = orig->mimo_ps;
+   v1->delayed_ba_support = orig->delayed_ba_support;
+   v1->max_ampdu_duration = orig->max_ampdu_duration;
+   v1->dsss_cck_mode_40mhz = orig->dsss_cck_mode_40mhz;
memcpy(>supported_rates, >supported_rates,
   sizeof(orig->supported_rates));
v1->sta_index = orig->sta_index;
+   v1->bssid_index = orig->bssid_index;
+   v1->p2p = orig->p2p;
 }
 
 static int wcn36xx_smd_config_sta_rsp(struct wcn36xx *wcn,
-- 
2.5.0

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


[PATCH v3 17/18] wcn36xx: Correct remove bss key response encoding

2016-04-18 Thread Bjorn Andersson
The WCN36XX_HAL_RMV_BSSKEY_RSP carries a single u32 with "status", so we
can use the standard status check function for decoding the result.

This is the last user of the v2 status checker, so remove the struct and
helper function.

Signed-off-by: Bjorn Andersson 
---

Changes since v2:
- Added this patch to the series

 drivers/net/wireless/ath/wcn36xx/smd.c | 19 +--
 drivers/net/wireless/ath/wcn36xx/smd.h |  9 -
 2 files changed, 1 insertion(+), 27 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c 
b/drivers/net/wireless/ath/wcn36xx/smd.c
index c15501c06eb2..5f6ca3124bd8 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -312,22 +312,6 @@ static int wcn36xx_smd_rsp_status_check(void *buf, size_t 
len)
return 0;
 }
 
-static int wcn36xx_smd_rsp_status_check_v2(struct wcn36xx *wcn, void *buf,
-size_t len)
-{
-   struct wcn36xx_fw_msg_status_rsp_v2 *rsp;
-
-   if (len < sizeof(struct wcn36xx_hal_msg_header) + sizeof(*rsp))
-   return wcn36xx_smd_rsp_status_check(buf, len);
-
-   rsp = buf + sizeof(struct wcn36xx_hal_msg_header);
-
-   if (WCN36XX_FW_MSG_RESULT_SUCCESS != rsp->status)
-   return rsp->status;
-
-   return 0;
-}
-
 int wcn36xx_smd_load_nv(struct wcn36xx *wcn)
 {
struct nv_data *nv_d;
@@ -1647,8 +1631,7 @@ int wcn36xx_smd_remove_bsskey(struct wcn36xx *wcn,
wcn36xx_err("Sending hal_remove_bsskey failed\n");
goto out;
}
-   ret = wcn36xx_smd_rsp_status_check_v2(wcn, wcn->hal_buf,
- wcn->hal_rsp_len);
+   ret = wcn36xx_smd_rsp_status_check(wcn->hal_buf, wcn->hal_rsp_len);
if (ret) {
wcn36xx_err("hal_remove_bsskey response failed err=%d\n", ret);
goto out;
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.h 
b/drivers/net/wireless/ath/wcn36xx/smd.h
index c1b76d75cf85..d74d781f4c8d 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.h
+++ b/drivers/net/wireless/ath/wcn36xx/smd.h
@@ -44,15 +44,6 @@ struct wcn36xx_fw_msg_status_rsp {
u32 status;
 } __packed;
 
-/* wcn3620 returns this for tigger_ba */
-
-struct wcn36xx_fw_msg_status_rsp_v2 {
-   u8  bss_id[6];
-   u32 status __packed;
-   u16 count_following_candidates __packed;
-   /* candidate list follows */
-};
-
 struct wcn36xx_hal_ind_msg {
struct list_head list;
u8 *msg;
-- 
2.5.0

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


[PATCH v3 14/18] wcn36xx: Implement multicast filtering

2016-04-18 Thread Bjorn Andersson
From: Pontus Fuchs 

Pass the multicast list to FW.

This patch also adds a way to build the smd command in place. This is
needed because the MC list command is too big for the stack.

Signed-off-by: Pontus Fuchs 
[bjorn: dropped FIF_PROMISC_IN_BSS usage]
Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/hal.h  |  6 ++--
 drivers/net/wireless/ath/wcn36xx/main.c | 50 ++--
 drivers/net/wireless/ath/wcn36xx/smd.c  | 51 +
 drivers/net/wireless/ath/wcn36xx/smd.h  |  3 ++
 4 files changed, 104 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h 
b/drivers/net/wireless/ath/wcn36xx/hal.h
index 433d9801a0ae..ec64c47f918b 100644
--- a/drivers/net/wireless/ath/wcn36xx/hal.h
+++ b/drivers/net/wireless/ath/wcn36xx/hal.h
@@ -4267,9 +4267,9 @@ struct wcn36xx_hal_rcv_flt_mc_addr_list_type {
u8 data_offset;
 
u32 mc_addr_count;
-   u8 mc_addr[ETH_ALEN][WCN36XX_HAL_MAX_NUM_MULTICAST_ADDRESS];
+   u8 mc_addr[WCN36XX_HAL_MAX_NUM_MULTICAST_ADDRESS][ETH_ALEN];
u8 bss_index;
-};
+} __packed;
 
 struct wcn36xx_hal_set_pkt_filter_rsp_msg {
struct wcn36xx_hal_msg_header header;
@@ -4323,7 +4323,7 @@ struct wcn36xx_hal_rcv_flt_pkt_clear_rsp_msg {
 struct wcn36xx_hal_rcv_flt_pkt_set_mc_list_req_msg {
struct wcn36xx_hal_msg_header header;
struct wcn36xx_hal_rcv_flt_mc_addr_list_type mc_addr_list;
-};
+} __packed;
 
 struct wcn36xx_hal_rcv_flt_pkt_set_mc_list_rsp_msg {
struct wcn36xx_hal_msg_header header;
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c 
b/drivers/net/wireless/ath/wcn36xx/main.c
index 253cece1b660..c0ba7b0775b3 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -287,6 +287,7 @@ static int wcn36xx_start(struct ieee80211_hw *hw)
}
 
wcn36xx_detect_chip_version(wcn);
+   wcn36xx_smd_update_cfg(wcn, WCN36XX_HAL_CFG_ENABLE_MC_ADDR_LIST, 1);
 
/* DMA channel initialization */
ret = wcn36xx_dxe_init(wcn);
@@ -354,15 +355,57 @@ static int wcn36xx_config(struct ieee80211_hw *hw, u32 
changed)
return 0;
 }
 
-#define WCN36XX_SUPPORTED_FILTERS (0)
-
 static void wcn36xx_configure_filter(struct ieee80211_hw *hw,
 unsigned int changed,
 unsigned int *total, u64 multicast)
 {
+   struct wcn36xx_hal_rcv_flt_mc_addr_list_type *fp;
+   struct wcn36xx *wcn = hw->priv;
+   struct wcn36xx_vif *tmp;
+   struct ieee80211_vif *vif = NULL;
+
wcn36xx_dbg(WCN36XX_DBG_MAC, "mac configure filter\n");
 
-   *total &= WCN36XX_SUPPORTED_FILTERS;
+   *total &= FIF_ALLMULTI;
+
+   fp = (void *)(unsigned long)multicast;
+   list_for_each_entry(tmp, >vif_list, list) {
+   vif = wcn36xx_priv_to_vif(tmp);
+
+   /* FW handles MC filtering only when connected as STA */
+   if (*total & FIF_ALLMULTI)
+   wcn36xx_smd_set_mc_list(wcn, vif, NULL);
+   else if (NL80211_IFTYPE_STATION == vif->type && tmp->sta_assoc)
+   wcn36xx_smd_set_mc_list(wcn, vif, fp);
+   }
+   kfree(fp);
+}
+
+static u64 wcn36xx_prepare_multicast(struct ieee80211_hw *hw,
+struct netdev_hw_addr_list *mc_list)
+{
+   struct wcn36xx_hal_rcv_flt_mc_addr_list_type *fp;
+   struct netdev_hw_addr *ha;
+
+   wcn36xx_dbg(WCN36XX_DBG_MAC, "mac prepare multicast list\n");
+   fp = kzalloc(sizeof(*fp), GFP_ATOMIC);
+   if (!fp) {
+   wcn36xx_err("Out of memory setting filters.\n");
+   return 0;
+   }
+
+   fp->mc_addr_count = 0;
+   /* update multicast filtering parameters */
+   if (netdev_hw_addr_list_count(mc_list) <=
+   WCN36XX_HAL_MAX_NUM_MULTICAST_ADDRESS) {
+   netdev_hw_addr_list_for_each(ha, mc_list) {
+   memcpy(fp->mc_addr[fp->mc_addr_count],
+   ha->addr, ETH_ALEN);
+   fp->mc_addr_count++;
+   }
+   }
+
+   return (u64)(unsigned long)fp;
 }
 
 static void wcn36xx_tx(struct ieee80211_hw *hw,
@@ -920,6 +963,7 @@ static const struct ieee80211_ops wcn36xx_ops = {
.resume = wcn36xx_resume,
 #endif
.config = wcn36xx_config,
+   .prepare_multicast  = wcn36xx_prepare_multicast,
.configure_filter   = wcn36xx_configure_filter,
.tx = wcn36xx_tx,
.set_key= wcn36xx_set_key,
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c 
b/drivers/net/wireless/ath/wcn36xx/smd.c
index e0d5631657c1..b1bdc229e560 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -271,6 +271,16 @@ out:
 

[PATCH v3 18/18] wcn36xx: Fill in capability list

2016-04-18 Thread Bjorn Andersson
Fill in the capability list with more values from the downstream driver.

Signed-off-by: Bjorn Andersson 
---

Changes since v2:
- Added this patch to the series

 drivers/net/wireless/ath/wcn36xx/hal.h  | 39 
 drivers/net/wireless/ath/wcn36xx/main.c | 40 -
 2 files changed, 78 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h 
b/drivers/net/wireless/ath/wcn36xx/hal.h
index ec64c47f918b..658bfb8baabe 100644
--- a/drivers/net/wireless/ath/wcn36xx/hal.h
+++ b/drivers/net/wireless/ath/wcn36xx/hal.h
@@ -4389,6 +4389,45 @@ enum place_holder_in_cap_bitmap {
RTT = 20,
RATECTRL = 21,
WOW = 22,
+   WLAN_ROAM_SCAN_OFFLOAD = 23,
+   SPECULATIVE_PS_POLL = 24,
+   SCAN_SCH = 25,
+   IBSS_HEARTBEAT_OFFLOAD = 26,
+   WLAN_SCAN_OFFLOAD = 27,
+   WLAN_PERIODIC_TX_PTRN = 28,
+   ADVANCE_TDLS = 29,
+   BATCH_SCAN = 30,
+   FW_IN_TX_PATH = 31,
+   EXTENDED_NSOFFLOAD_SLOT = 32,
+   CH_SWITCH_V1 = 33,
+   HT40_OBSS_SCAN = 34,
+   UPDATE_CHANNEL_LIST = 35,
+   WLAN_MCADDR_FLT = 36,
+   WLAN_CH144 = 37,
+   NAN = 38,
+   TDLS_SCAN_COEXISTENCE = 39,
+   LINK_LAYER_STATS_MEAS = 40,
+   MU_MIMO = 41,
+   EXTENDED_SCAN = 42,
+   DYNAMIC_WMM_PS = 43,
+   MAC_SPOOFED_SCAN = 44,
+   BMU_ERROR_GENERIC_RECOVERY = 45,
+   DISA = 46,
+   FW_STATS = 47,
+   WPS_PRBRSP_TMPL = 48,
+   BCN_IE_FLT_DELTA = 49,
+   TDLS_OFF_CHANNEL = 51,
+   RTT3 = 52,
+   MGMT_FRAME_LOGGING = 53,
+   ENHANCED_TXBD_COMPLETION = 54,
+   LOGGING_ENHANCEMENT = 55,
+   EXT_SCAN_ENHANCED = 56,
+   MEMORY_DUMP_SUPPORTED = 57,
+   PER_PKT_STATS_SUPPORTED = 58,
+   EXT_LL_STAT = 60,
+   WIFI_CONFIG = 61,
+   ANTENNA_DIVERSITY_SELECTION = 62,
+
MAX_FEATURE_SUPPORTED = 128,
 };
 
diff --git a/drivers/net/wireless/ath/wcn36xx/main.c 
b/drivers/net/wireless/ath/wcn36xx/main.c
index 680217506b3d..fe81b2a7c8d9 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -201,7 +201,45 @@ static const char * const wcn36xx_caps_names[] = {
"BCN_FILTER",   /* 19 */
"RTT",  /* 20 */
"RATECTRL", /* 21 */
-   "WOW"   /* 22 */
+   "WOW",  /* 22 */
+   "WLAN_ROAM_SCAN_OFFLOAD",   /* 23 */
+   "SPECULATIVE_PS_POLL",  /* 24 */
+   "SCAN_SCH", /* 25 */
+   "IBSS_HEARTBEAT_OFFLOAD",   /* 26 */
+   "WLAN_SCAN_OFFLOAD",/* 27 */
+   "WLAN_PERIODIC_TX_PTRN",/* 28 */
+   "ADVANCE_TDLS", /* 29 */
+   "BATCH_SCAN",   /* 30 */
+   "FW_IN_TX_PATH",/* 31 */
+   "EXTENDED_NSOFFLOAD_SLOT",  /* 32 */
+   "CH_SWITCH_V1", /* 33 */
+   "HT40_OBSS_SCAN",   /* 34 */
+   "UPDATE_CHANNEL_LIST",  /* 35 */
+   "WLAN_MCADDR_FLT",  /* 36 */
+   "WLAN_CH144",   /* 37 */
+   "NAN",  /* 38 */
+   "TDLS_SCAN_COEXISTENCE",/* 39 */
+   "LINK_LAYER_STATS_MEAS",/* 40 */
+   "MU_MIMO",  /* 41 */
+   "EXTENDED_SCAN",/* 42 */
+   "DYNAMIC_WMM_PS",   /* 43 */
+   "MAC_SPOOFED_SCAN", /* 44 */
+   "BMU_ERROR_GENERIC_RECOVERY",   /* 45 */
+   "DISA", /* 46 */
+   "FW_STATS", /* 47 */
+   "WPS_PRBRSP_TMPL",  /* 48 */
+   "BCN_IE_FLT_DELTA", /* 49 */
+   "TDLS_OFF_CHANNEL", /* 51 */
+   "RTT3", /* 52 */
+   "MGMT_FRAME_LOGGING",   /* 53 */
+   "ENHANCED_TXBD_COMPLETION", /* 54 */
+   "LOGGING_ENHANCEMENT",  /* 55 */
+   "EXT_SCAN_ENHANCED",/* 56 */
+   "MEMORY_DUMP_SUPPORTED",/* 57 */
+   "PER_PKT_STATS_SUPPORTED",  /* 58 */
+   "EXT_LL_STAT",  /* 60 */
+   "WIFI_CONFIG",  /* 61 */
+   "ANTENNA_DIVERSITY_SELECTION",  /* 62 */
 };
 
 static const char *wcn36xx_get_cap_name(enum place_holder_in_cap_bitmap x)
-- 
2.5.0

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


[PATCH v3 13/18] wcn36xx: Track association state

2016-04-18 Thread Bjorn Andersson
From: Pontus Fuchs 

Knowing the association state is needed for mc filtering.

Signed-off-by: Pontus Fuchs 
Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/main.c| 2 ++
 drivers/net/wireless/ath/wcn36xx/wcn36xx.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c 
b/drivers/net/wireless/ath/wcn36xx/main.c
index f9c77de94583..253cece1b660 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -655,6 +655,7 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw 
*hw,
 vif->addr,
 bss_conf->aid);
 
+   vif_priv->sta_assoc = true;
rcu_read_lock();
sta = ieee80211_find_sta(vif, bss_conf->bssid);
if (!sta) {
@@ -686,6 +687,7 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw 
*hw,
bss_conf->bssid,
vif->addr,
bss_conf->aid);
+   vif_priv->sta_assoc = false;
wcn36xx_smd_set_link_st(wcn,
bss_conf->bssid,
vif->addr,
diff --git a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h 
b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
index 54000db0af1a..7433d67a5929 100644
--- a/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
+++ b/drivers/net/wireless/ath/wcn36xx/wcn36xx.h
@@ -128,6 +128,7 @@ struct wcn36xx_vif {
u8 dtim_period;
enum ani_ed_type encrypt_type;
bool is_joining;
+   bool sta_assoc;
struct wcn36xx_hal_mac_ssid ssid;
 
/* Power management */
-- 
2.5.0

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


[PATCH v3 16/18] wcn36xx: Delete BSS before idling link

2016-04-18 Thread Bjorn Andersson
When disabling the beacon we must delete the bss before idling the link.

Signed-off-by: Bjorn Andersson 
---

Changes since v2:
- Added this patch to the series

 drivers/net/wireless/ath/wcn36xx/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c 
b/drivers/net/wireless/ath/wcn36xx/main.c
index c0ba7b0775b3..680217506b3d 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -779,9 +779,9 @@ static void wcn36xx_bss_info_changed(struct ieee80211_hw 
*hw,
wcn36xx_smd_set_link_st(wcn, vif->addr, vif->addr,
link_state);
} else {
+   wcn36xx_smd_delete_bss(wcn, vif);
wcn36xx_smd_set_link_st(wcn, vif->addr, vif->addr,
WCN36XX_HAL_LINK_IDLE_STATE);
-   wcn36xx_smd_delete_bss(wcn, vif);
}
}
 out:
-- 
2.5.0

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


[PATCH v3 15/18] wcn36xx: Use correct command struct for EXIT_BMPS_REQ

2016-04-18 Thread Bjorn Andersson
From: Pontus Fuchs 

EXIT_BMPS_REQ was using the command struct for ENTER_BMPS_REQ. I
spotted this when looking at command dumps.

Signed-off-by: Pontus Fuchs 
Signed-off-by: Bjorn Andersson 
---
 drivers/net/wireless/ath/wcn36xx/smd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c 
b/drivers/net/wireless/ath/wcn36xx/smd.c
index b1bdc229e560..c15501c06eb2 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1690,7 +1690,7 @@ out:
 
 int wcn36xx_smd_exit_bmps(struct wcn36xx *wcn, struct ieee80211_vif *vif)
 {
-   struct wcn36xx_hal_enter_bmps_req_msg msg_body;
+   struct wcn36xx_hal_exit_bmps_req_msg msg_body;
struct wcn36xx_vif *vif_priv = wcn36xx_vif_to_priv(vif);
int ret = 0;
 
-- 
2.5.0

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


[PATCH v3 02/18] wcn36xx: Pad TIM PVM if needed

2016-04-18 Thread Bjorn Andersson
From: Pontus Fuchs 

The wcn36xx FW expects a fixed size TIM PVM in the beacon template. If
supplied with a shorter than expected PVM it will overwrite the IE
following the TIM.

Squashed with fix from Jason Mobarak :
Patch "wcn36xx: Pad TIM PVM if needed" has caused a regression in mesh
beaconing.  The field tim_off is always 0 for mesh mode, and thus
pvm_len (referring to the TIM length field) and pad are both incorrectly
calculated.  Thus, msg_body.beacon_length is incorrectly calculated for
mesh mode. Fix this.

Signed-off-by: Pontus Fuchs 
Signed-off-by: Jason Mobarak 
[bjorn: squashed in Jason's fixup]
Signed-off-by: Bjorn Andersson 
---

Changes since v1:
- Merged in Jason's patch for skipping the padding in mesh mode.

 drivers/net/wireless/ath/wcn36xx/hal.h |  3 +++
 drivers/net/wireless/ath/wcn36xx/smd.c | 27 +--
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/wcn36xx/hal.h 
b/drivers/net/wireless/ath/wcn36xx/hal.h
index d713204f755d..3af16cba3d12 100644
--- a/drivers/net/wireless/ath/wcn36xx/hal.h
+++ b/drivers/net/wireless/ath/wcn36xx/hal.h
@@ -54,6 +54,9 @@
 /* Default Beacon template size */
 #define BEACON_TEMPLATE_SIZE 0x180
 
+/* Minimum PVM size that the FW expects. See comment in smd.c for details. */
+#define TIM_MIN_PVM_SIZE 6
+
 /* Param Change Bitmap sent to HAL */
 #define PARAM_BCN_INTERVAL_CHANGED  (1 << 0)
 #define PARAM_SHORT_PREAMBLE_CHANGED (1 << 1)
diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c 
b/drivers/net/wireless/ath/wcn36xx/smd.c
index ff3ed2461a69..089a7e445cd6 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1375,12 +1375,19 @@ int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct 
ieee80211_vif *vif,
u16 p2p_off)
 {
struct wcn36xx_hal_send_beacon_req_msg msg_body;
-   int ret = 0;
+   int ret = 0, pad, pvm_len;
 
mutex_lock(>hal_mutex);
INIT_HAL_MSG(msg_body, WCN36XX_HAL_SEND_BEACON_REQ);
 
-   msg_body.beacon_length = skb_beacon->len;
+   pvm_len = skb_beacon->data[tim_off + 1] - 3;
+   pad = TIM_MIN_PVM_SIZE - pvm_len;
+
+   /* Padding is irrelevant to mesh mode since tim_off is always 0. */
+   if (vif->type == NL80211_IFTYPE_MESH_POINT)
+   pad = 0;
+
+   msg_body.beacon_length = skb_beacon->len + pad;
/* TODO need to find out why + 6 is needed */
msg_body.beacon_length6 = msg_body.beacon_length + 6;
 
@@ -1393,6 +1400,22 @@ int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct 
ieee80211_vif *vif,
memcpy(msg_body.beacon, skb_beacon->data, skb_beacon->len);
memcpy(msg_body.bssid, vif->addr, ETH_ALEN);
 
+   if (pad > 0) {
+   /*
+* The wcn36xx FW has a fixed size for the PVM in the TIM. If
+* given the beacon template from mac80211 with a PVM shorter
+* than the FW expectes it will overwrite the data after the
+* TIM.
+*/
+   wcn36xx_dbg(WCN36XX_DBG_HAL, "Pad TIM PVM. %d bytes at %d\n",
+   pad, pvm_len);
+   memmove(_body.beacon[tim_off + 5 + pvm_len + pad],
+   _body.beacon[tim_off + 5 + pvm_len],
+   skb_beacon->len - (tim_off + 5 + pvm_len));
+   memset(_body.beacon[tim_off + 5 + pvm_len], 0, pad);
+   msg_body.beacon[tim_off + 1] += pad;
+   }
+
/* TODO need to find out why this is needed? */
if (vif->type == NL80211_IFTYPE_MESH_POINT)
/* mesh beacon don't need this, so push further down */
-- 
2.5.0

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


Re: [PATCH] ath6kl: Add ability to set debug uart baud rate

2016-04-18 Thread Julian Calaby
Hi Steve,

On Tue, Apr 19, 2016 at 1:06 PM, Steve deRosier  wrote:
> Hi Julian,
>
> First off, let me say I do appreciate your comments and I do
> understand your perspective. I also generally prefer not to let users
> shoot-themselves in the foot if it's avoidable.
>
> In this case, however, I don't happen to agree with you. For one
> specific reason: I don't want to say what baud rates are "safe"
> because I think that's even more dangerous than not checking - because
> we have no way of actually knowing what is or isn't for a particular
> chip.
>
> Oddly enough I thought this all out before I ever sent the patch up.

I questioned this change because it looked like you hadn't. You didn't
mention this in the patch description and the change itself didn't
imply this to me.

>> I'm of the opinion that one should never underestimate the ability of
>> people to attempt to shoot themselves in the foot. However this is
>> only a debugging interface so you do make a good point.
>>
>> I guess I'm worried that some idiot is going to set it to 2 baud or 2
>> billion baud for some dumb reason then come complaining to us when
>> their wireless card crashes or locks up or something.
>>
>> Maybe we can just sweep this all under the carpet by putting all the
>> debug uart stuff behind some nice #ifdef.
>
> Well, first off the debugging stuff was never under some #ifdef. So,
> we should make it even more complicated and add an #ifdef and yet
> another kconfig option?

Having debug options under an #ifdef is pretty common.

> AFAIK, the firmware would be perfectly happy with 2 baud. I'm not in
> my lab to try it right now, but it might well be (though your
> throughput would be crap). Nor do I know the upper limit of the
> register the firmware uses.

This is kinda what I was looking for when I asked the question in the
first place. You don't know for certain which rates are safe and which
aren't and you don't know the limits of the hardware / firmware.

> My firmware guy wanted 115200, and I could've hard-coded it to that
> value, but I figured a bit of flexibility was warranted and would be
> more upstreamable. I don't know every single valid or invalid value
> for every ar6xxx chip. If we have it check for the value, then we have
> some obligation to know the values we let in are valid for either all
> or at least the chip the user is using. I don't know what was invalid
> for many species of 6002. Or even all of the 6003 and 6004s and I've
> been working with both the firmware and driver for these chips for 3
> years now. What might be valid on the yet to be imagined 6009?

To be honest, I wouldn't have questioned this if you'd hardcoded it to
115200. Practically all serial hardware these days is capable of that
rate, it's standard and it's sensible.

> If we check, we are saying, "these are safe values and we want you to use 
> them".
>
> 99.999% of users don't have access to this pin without a soldering
> iron. I think someone who is going to tack a wire to their 6k chip is
> entitled to set even stupid values if they think they have a reason.

True, but the other side of this is that 99.999% of the people who
will be using this will be using a standard baud rate. I personally
cannot think of any sensible use case for a rate other than 115200
unless Qualcomm themselves produce hardware that interfaces with this
and isn't capable of that rate. (And anyone doing firmware debugging
will also be doing kernel development or be next to someone who is, so
an #ifdef shouldn't be an issue.)

> Again, simply my perspective.
>
> On a compromise: do you have a specific list of baud rates you'd like
> to support and you know are valid across a wide swath of ath6kl chips?
> Every rate I've tried, normal or weird, works fine. Granted, I haven't
> tried anything slower than 9600, nor have I bothered checking the
> clock error on the weird rates. If you have said list, I'd be happy to
> code it up. But I think that specifically checking for rates is the
> same as saying "this rate is supported" and I don't know that, so I
> hope you do know what ones are valid.

I don't know which ones are valid. 9600 to 115200 inclusive sounds
like a sensible range to me. I was hoping that Kalle or someone knew
or could talk to the hardware / firmware people (assuming they're
still available. ath6k is obsolete IIRC.) and ask them.

> Maybe you agree with my line of thinking (now that you know what it
> is) or maybe not. That's OK. ;)

I see your points. I agree with most of them. I don't agree with your
logic that it should be unrestricted however.

I consider this matter closed unless you decide to change the patch or
someone else has comments. I don't decide if this is to be merged or
not, so I'll leave this up to them.

Thanks,

-- 
Julian Calaby

Email: julian.cal...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a 

Re: [PATCH] ath6kl: Add ability to set debug uart baud rate

2016-04-18 Thread Steve deRosier
Hi Julian,

First off, let me say I do appreciate your comments and I do
understand your perspective. I also generally prefer not to let users
shoot-themselves in the foot if it's avoidable.

In this case, however, I don't happen to agree with you. For one
specific reason: I don't want to say what baud rates are "safe"
because I think that's even more dangerous than not checking - because
we have no way of actually knowing what is or isn't for a particular
chip.

Oddly enough I thought this all out before I ever sent the patch up.

>
> I'm of the opinion that one should never underestimate the ability of
> people to attempt to shoot themselves in the foot. However this is
> only a debugging interface so you do make a good point.
>
> I guess I'm worried that some idiot is going to set it to 2 baud or 2
> billion baud for some dumb reason then come complaining to us when
> their wireless card crashes or locks up or something.
>
> Maybe we can just sweep this all under the carpet by putting all the
> debug uart stuff behind some nice #ifdef.

Well, first off the debugging stuff was never under some #ifdef. So,
we should make it even more complicated and add an #ifdef and yet
another kconfig option?

AFAIK, the firmware would be perfectly happy with 2 baud. I'm not in
my lab to try it right now, but it might well be (though your
throughput would be crap). Nor do I know the upper limit of the
register the firmware uses.

My firmware guy wanted 115200, and I could've hard-coded it to that
value, but I figured a bit of flexibility was warranted and would be
more upstreamable. I don't know every single valid or invalid value
for every ar6xxx chip. If we have it check for the value, then we have
some obligation to know the values we let in are valid for either all
or at least the chip the user is using. I don't know what was invalid
for many species of 6002. Or even all of the 6003 and 6004s and I've
been working with both the firmware and driver for these chips for 3
years now. What might be valid on the yet to be imagined 6009?

If we check, we are saying, "these are safe values and we want you to use them".

99.999% of users don't have access to this pin without a soldering
iron. I think someone who is going to tack a wire to their 6k chip is
entitled to set even stupid values if they think they have a reason.

Again, simply my perspective.

On a compromise: do you have a specific list of baud rates you'd like
to support and you know are valid across a wide swath of ath6kl chips?
Every rate I've tried, normal or weird, works fine. Granted, I haven't
tried anything slower than 9600, nor have I bothered checking the
clock error on the weird rates. If you have said list, I'd be happy to
code it up. But I think that specifically checking for rates is the
same as saying "this rate is supported" and I don't know that, so I
hope you do know what ones are valid.

Maybe you agree with my line of thinking (now that you know what it
is) or maybe not. That's OK. ;)

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


Re: [PATCH] mac80211: debugfs var for the default aggregation timeout.

2016-04-18 Thread Avery Pennarun
On Sat, Apr 9, 2016 at 9:59 PM, bruce m beach  wrote:
>> If any people more familiar with ARM are reading this - does the value
>> 0x5b35da40 ring a bell?
>
> It could be anything. It depends on the chip implementation. For instance on 
> an
> exynos that is an undefined region. What device are we talking about?

This is a mindspeed c2k CPU, in case that helps at all.  But I'm
guessing it really is just some pointer garbage.  The only way to
trigger the crash is to do (something) with an attached station at the
same moment as reading the agg_status file.  Some station types
trigger it more than others, but I'm not sure which.
--
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/3] staging: wilc1000: change handle_set_ip_address's return type to void

2016-04-18 Thread Chaehyun Lim
When handle_set_ip_address is called in hostIFthread that is a kernel
thread, it is not checked return type of this function. This patch
changes return type to void and removes braces if statement due to have
a single statement.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index ac620fb..87c8789 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -349,7 +349,7 @@ static void handle_set_operation_mode(struct wilc_vif *vif,
netdev_err(vif->ndev, "Failed to set driver handler\n");
 }
 
-static s32 handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
+static void handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
 {
s32 result = 0;
struct wid wid;
@@ -370,12 +370,8 @@ static s32 handle_set_ip_address(struct wilc_vif *vif, u8 
*ip_addr, u8 idx)
 
host_int_get_ipaddress(vif, firmware_ip_addr, idx);
 
-   if (result) {
+   if (result)
netdev_err(vif->ndev, "Failed to set IP address\n");
-   return -EINVAL;
-   }
-
-   return result;
 }
 
 static s32 handle_get_ip_address(struct wilc_vif *vif, u8 idx)
-- 
2.8.0

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


[PATCH 2/3] staging: wilc1000: change data type of result in handle_set_ip_address

2016-04-18 Thread Chaehyun Lim
This patch changes data type of result variable from s32 to int. result
is used to get return value from wilc_send_config_pkt that has return
type of int.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 87c8789..9ddb238 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -351,7 +351,7 @@ static void handle_set_operation_mode(struct wilc_vif *vif,
 
 static void handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
 {
-   s32 result = 0;
+   int result = 0;
struct wid wid;
char firmware_ip_addr[4] = {0};
 
-- 
2.8.0

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


[PATCH 3/3] staging: wilc1000: rename result in handle_set_ip_address

2016-04-18 Thread Chaehyun Lim
This patch renames result to ret that is used to get return value from
wilc_send_config_pkt. Some handle_*() functions are used as result,
others are used as ret. It will be changed as ret in all handle_*()
functions to match variable name.

Signed-off-by: Chaehyun Lim 
---
 drivers/staging/wilc1000/host_interface.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c 
b/drivers/staging/wilc1000/host_interface.c
index 9ddb238..5d352aa 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -351,7 +351,7 @@ static void handle_set_operation_mode(struct wilc_vif *vif,
 
 static void handle_set_ip_address(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
 {
-   int result = 0;
+   int ret = 0;
struct wid wid;
char firmware_ip_addr[4] = {0};
 
@@ -365,12 +365,12 @@ static void handle_set_ip_address(struct wilc_vif *vif, 
u8 *ip_addr, u8 idx)
wid.val = (u8 *)ip_addr;
wid.size = IP_ALEN;
 
-   result = wilc_send_config_pkt(vif, SET_CFG, , 1,
- wilc_get_vif_idx(vif));
+   ret = wilc_send_config_pkt(vif, SET_CFG, , 1,
+  wilc_get_vif_idx(vif));
 
host_int_get_ipaddress(vif, firmware_ip_addr, idx);
 
-   if (result)
+   if (ret)
netdev_err(vif->ndev, "Failed to set IP address\n");
 }
 
-- 
2.8.0

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


Re: [PATCH] ath6kl: Add ability to set debug uart baud rate

2016-04-18 Thread Julian Calaby
Hi Steve,

On Tue, Apr 19, 2016 at 4:12 AM, Steve deRosier  wrote:
> Hi Julian,
>
> Thanks for looking at the patch.
>
> On Sun, Apr 17, 2016 at 5:07 PM, Julian Calaby  
> wrote:
>> Hi Steve,
>>
>> This looks like it's using standard serial rates. Does it accept
>> non-standard rates? If not, should this be checked before being passed
>> to the hardware?
>>
>
> It should use standard serial rates, and obviously I defaulted it to a
> sensible one. However, there's nothing that prevents you from using
> odd and arbitrary rates in the firmware and it should just suck it in
> and use it. In other words, the firmware will happily try to set 9507
> baud if you tell it to.
>
> This is specifically for debugging and working with the firmware and
> IMHO, if you are using this feature and feel a need to set it to
> something weird, I think the user should be allowed to. If you know
> enough to be able to shoot yourself in the foot with this, then you
> should know enough of what you should or shouldn't do and should be
> allowed to. It's a debugging tool only and I don't see any reason to
> waste lines in the driver to validate this input.

I'm of the opinion that one should never underestimate the ability of
people to attempt to shoot themselves in the foot. However this is
only a debugging interface so you do make a good point.

I guess I'm worried that some idiot is going to set it to 2 baud or 2
billion baud for some dumb reason then come complaining to us when
their wireless card crashes or locks up or something.

Maybe we can just sweep this all under the carpet by putting all the
debug uart stuff behind some nice #ifdef.

> That's my perspective on the issue, but I recognize other opinions may
> differ. Or you may know of a specific chip where it does matter (the
> 6003s and 6004s I'm using don't seem to care). If you or Kalle insist
> on it, I'll be happy to add in some value checking for this parameter.
> It just doesn't seem worth-while to me.

Thanks,

-- 
Julian Calaby

Email: julian.cal...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/4] NFC: trf7970a: Add device tree option of 1.8 Volt IO voltage

2016-04-18 Thread Julian Calaby
Hi Geoff,

On Tue, Apr 19, 2016 at 5:48 AM, Geoff Lansberry  wrote:
> Signed-off-by: Geoff Lansberry 
> ---
>  Documentation/devicetree/bindings/net/nfc/trf7970a.txt |  8 
>  drivers/nfc/trf7970a.c | 11 ++-
>  2 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt 
> b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
> index bf25f39..e605ebd 100644
> --- a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
> +++ b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
> @@ -19,9 +19,13 @@ Optional SoC Specific Properties:
>"IRQ Status Read" erratum.
>  - en2-rf-quirk: Specify that the trf7970a being used has the "EN2 RF"
>erratum.
> +<<< HEAD
>  - t5t-rmb-extra-byte-quirk: Specify that the trf7970a has the erratum
>where an extra byte is returned by Read Multiple Block commands issued
>to Type 5 tags.
> +===
> +- vdd_io_1v8: Set to specify that the trf7970a io voltage should be set to 
> 1.8V
> +>>> e7ea4dd... NFC: trf7970a: Add device tree option of 1.8 Volt IO 
> voltage

Your patch is mangled. Please fix the merge errors before submitting.

Thanks,

Julian Calaby


>  - crystal_27mhz: Set to specify that the input frequency to the trf7970a is 
> 27.12MHz
>
>  Example (for ARM-based BeagleBone with TRF7970A on SPI1):
> @@ -45,7 +49,11 @@ Example (for ARM-based BeagleBone with TRF7970A on SPI1):
> autosuspend-delay = <3>;
> irq-status-read-quirk;
> en2-rf-quirk;
> +<<< HEAD
> t5t-rmb-extra-byte-quirk;
> +===
> +   vdd_io_1v8;
> +>>> e7ea4dd... NFC: trf7970a: Add device tree option of 1.8 Volt IO 
> voltage
> crystal_27mhz;
> status = "okay";
> };
> diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
> index 74210f9..be56897 100644
> --- a/drivers/nfc/trf7970a.c
> +++ b/drivers/nfc/trf7970a.c
> @@ -441,6 +441,7 @@ struct trf7970a {
> u8  iso_ctrl_tech;
> u8  modulator_sys_clk_ctrl;
> u8  special_fcn_reg1;
> +   u8  io_ctrl;
> unsigned intguard_time;
> int technology;
> int framing;
> @@ -1064,6 +1065,11 @@ static int trf7970a_init(struct trf7970a *trf)
> if (ret)
> goto err_out;
>
> +   ret = trf7970a_write(trf, TRF7970A_REG_IO_CTRL,
> +   trf->io_ctrl|TRF7970A_REG_IO_CTRL_VRS(0x1));
> +   if (ret)
> +   goto err_out;
> +
> ret = trf7970a_write(trf, TRF7970A_NFC_TARGET_LEVEL, 0);
> if (ret)
> goto err_out;
> @@ -1768,7 +1774,7 @@ static int _trf7970a_tg_listen(struct nfc_digital_dev 
> *ddev, u16 timeout,
> goto out_err;
>
> ret = trf7970a_write(trf, TRF7970A_REG_IO_CTRL,
> -   TRF7970A_REG_IO_CTRL_VRS(0x1));
> +   trf->io_ctrl|TRF7970A_REG_IO_CTRL_VRS(0x1));
> if (ret)
> goto out_err;
>
> @@ -2075,6 +2081,9 @@ static int trf7970a_probe(struct spi_device *spi)
> return ret;
> }
>
> +   if (of_property_read_bool(np, "vdd_io_1v8"))
> +   trf->io_ctrl = TRF7970A_REG_IO_CTRL_IO_LOW;
> +
> if (of_property_read_bool(np, "crystal_27MHz"))
> trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_27MHZ;
>
> --
> 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



-- 
Julian Calaby

Email: julian.cal...@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/4] NFC: trf7970a: add device tree option for 27MHz clock

2016-04-18 Thread Julian Calaby
Hi Geoff,

On Tue, Apr 19, 2016 at 5:48 AM, Geoff Lansberry  wrote:
> Signed-off-by: Geoff Lansberry 

You should add the description you had in your cover letter to the patches also.

> ---
>  .../devicetree/bindings/net/nfc/trf7970a.txt   |  2 ++
>  drivers/nfc/trf7970a.c | 28 
> +-
>  2 files changed, 19 insertions(+), 11 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt 
> b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
> index 09c5056..bf25f39 100644
> --- a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
> +++ b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
> @@ -22,6 +22,7 @@ Optional SoC Specific Properties:
>  - t5t-rmb-extra-byte-quirk: Specify that the trf7970a has the erratum
>where an extra byte is returned by Read Multiple Block commands issued
>to Type 5 tags.
> +- crystal_27mhz: Set to specify that the input frequency to the trf7970a is 
> 27.12MHz

Does the trf7970a only operate at the default or 27.12MHz, or can it
operate at any frequency? If it's the latter, would it make sense to
specify this using the clock framework and some fixed-factor clock?

Thanks,

Julian Calaby


>  Example (for ARM-based BeagleBone with TRF7970A on SPI1):
>
> @@ -45,6 +46,7 @@ Example (for ARM-based BeagleBone with TRF7970A on SPI1):
> irq-status-read-quirk;
> en2-rf-quirk;
> t5t-rmb-extra-byte-quirk;
> +   crystal_27mhz;
> status = "okay";
> };
>  };
> diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
> index 447b6c9..74210f9 100644
> --- a/drivers/nfc/trf7970a.c
> +++ b/drivers/nfc/trf7970a.c
> @@ -1072,12 +1072,11 @@ static int trf7970a_init(struct trf7970a *trf)
>
> trf->chip_status_ctrl &= ~TRF7970A_CHIP_STATUS_RF_ON;
>
> -   ret = trf7970a_write(trf, TRF7970A_MODULATOR_SYS_CLK_CTRL, 0);
> +   ret = trf7970a_write(trf, TRF7970A_MODULATOR_SYS_CLK_CTRL,
> +   trf->modulator_sys_clk_ctrl);
> if (ret)
> goto err_out;
>
> -   trf->modulator_sys_clk_ctrl = 0;
> -
> ret = trf7970a_write(trf, TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS,
> TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_96 |
> TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_32);
> @@ -1194,30 +1193,32 @@ static int trf7970a_in_config_rf_tech(struct trf7970a 
> *trf, int tech)
>
> dev_dbg(trf->dev, "rf technology: %d\n", tech);
>
> +   trf->modulator_sys_clk_ctrl = (trf->modulator_sys_clk_ctrl&0xF8);
> +
> switch (tech) {
> case NFC_DIGITAL_RF_TECH_106A:
> trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_14443A_106;
> -   trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_OOK;
> +   trf->modulator_sys_clk_ctrl |= TRF7970A_MODULATOR_DEPTH_OOK;
> trf->guard_time = TRF7970A_GUARD_TIME_NFCA;
> break;
> case NFC_DIGITAL_RF_TECH_106B:
> trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_14443B_106;
> -   trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_ASK10;
> +   trf->modulator_sys_clk_ctrl |= TRF7970A_MODULATOR_DEPTH_ASK10;
> trf->guard_time = TRF7970A_GUARD_TIME_NFCB;
> break;
> case NFC_DIGITAL_RF_TECH_212F:
> trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_FELICA_212;
> -   trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_ASK10;
> +   trf->modulator_sys_clk_ctrl |= TRF7970A_MODULATOR_DEPTH_ASK10;
> trf->guard_time = TRF7970A_GUARD_TIME_NFCF;
> break;
> case NFC_DIGITAL_RF_TECH_424F:
> trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_FELICA_424;
> -   trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_ASK10;
> +   trf->modulator_sys_clk_ctrl |= TRF7970A_MODULATOR_DEPTH_ASK10;
> trf->guard_time = TRF7970A_GUARD_TIME_NFCF;
> break;
> case NFC_DIGITAL_RF_TECH_ISO15693:
> trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_15693_SGL_1OF4_2648;
> -   trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_OOK;
> +   trf->modulator_sys_clk_ctrl |= TRF7970A_MODULATOR_DEPTH_OOK;
> trf->guard_time = TRF7970A_GUARD_TIME_15693;
> break;
> default:
> @@ -1582,22 +1583,24 @@ static int trf7970a_tg_config_rf_tech(struct trf7970a 
> *trf, int tech)
>
> dev_dbg(trf->dev, "rf technology: %d\n", tech);
>
> +   trf->modulator_sys_clk_ctrl = (trf->modulator_sys_clk_ctrl&0xF8);
> +
> switch (tech) {
> case NFC_DIGITAL_RF_TECH_106A:
> trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_NFC_NFC_CE_MODE |
> TRF7970A_ISO_CTRL_NFC_CE |
> TRF7970A_ISO_CTRL_NFC_CE_14443A;
> -  

Re: [PATCH 1/4] NFC: trf7970a: Add support for gpio as SS

2016-04-18 Thread Julian Calaby
Hi Geoff,

On Tue, Apr 19, 2016 at 5:48 AM, Geoff Lansberry  wrote:
> Signed-off-by: Geoff Lansberry 

Can't you just use the cs-gpios property? This should require no driver changes.

This is described here:

https://www.kernel.org/doc/Documentation/devicetree/bindings/spi/spi-bus.txt

Thanks,

Julian Calaby


> ---
>  .../devicetree/bindings/net/nfc/trf7970a.txt   |  2 ++
>  drivers/nfc/trf7970a.c | 33 
> --
>  2 files changed, 33 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt 
> b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
> index 32b35a0..09c5056 100644
> --- a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
> +++ b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
> @@ -7,6 +7,7 @@ Required properties:
>  - interrupts: A single interrupt specifier.
>  - ti,enable-gpios: Two GPIO entries used for 'EN' and 'EN2' pins on the
>TRF7970A.
> +- ti,ss-gpio: GPIO entry used for active low SS (spi slave select) on the 
> TRF7970A
>  - vin-supply: Regulator for supply voltage to VIN pin
>
>  Optional SoC Specific Properties:
> @@ -37,6 +38,7 @@ Example (for ARM-based BeagleBone with TRF7970A on SPI1):
> interrupts = <14 0>;
> ti,enable-gpios = < 2 GPIO_ACTIVE_LOW>,
>   < 5 GPIO_ACTIVE_LOW>;
> +   ti,ss-gpio = < 4 GPIO_ACTIVE_HIGH>;
> vin-supply = <_reg>;
> vin-voltage-override = <500>;
> autosuspend-delay = <3>;
> diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
> index 10842b7..2c3530a 100644
> --- a/drivers/nfc/trf7970a.c
> +++ b/drivers/nfc/trf7970a.c
> @@ -450,6 +450,7 @@ struct trf7970a {
> booladjust_resp_len;
> int en2_gpio;
> int en_gpio;
> +   int ss_gpio;
> struct mutexlock;
> unsigned inttimeout;
> boolignore_timeout;
> @@ -462,9 +463,11 @@ static int trf7970a_cmd(struct trf7970a *trf, u8 opcode)
> u8 cmd = TRF7970A_CMD_BIT_CTRL | TRF7970A_CMD_BIT_OPCODE(opcode);
> int ret;
>
> +   gpio_set_value(trf->ss_gpio, 0);
> dev_dbg(trf->dev, "cmd: 0x%x\n", cmd);
>
> ret = spi_write(trf->spi, , 1);
> +   gpio_set_value(trf->ss_gpio, 1);
> if (ret)
> dev_err(trf->dev, "%s - cmd: 0x%x, ret: %d\n", __func__, cmd,
> ret);
> @@ -476,7 +479,9 @@ static int trf7970a_read(struct trf7970a *trf, u8 reg, u8 
> *val)
> u8 addr = TRF7970A_CMD_BIT_RW | reg;
> int ret;
>
> +   gpio_set_value(trf->ss_gpio, 0);
> ret = spi_write_then_read(trf->spi, , 1, val, 1);
> +   gpio_set_value(trf->ss_gpio, 1);
> if (ret)
> dev_err(trf->dev, "%s - addr: 0x%x, ret: %d\n", __func__, 
> addr,
> ret);
> @@ -493,6 +498,7 @@ static int trf7970a_read_cont(struct trf7970a *trf, u8 
> reg, u8 *buf, size_t len)
> struct spi_message m;
> int ret;
>
> +   gpio_set_value(trf->ss_gpio, 0);
> dev_dbg(trf->dev, "read_cont(0x%x, %zd)\n", addr, len);
>
> spi_message_init();
> @@ -508,6 +514,7 @@ static int trf7970a_read_cont(struct trf7970a *trf, u8 
> reg, u8 *buf, size_t len)
> spi_message_add_tail([1], );
>
> ret = spi_sync(trf->spi, );
> +   gpio_set_value(trf->ss_gpio, 1);
> if (ret)
> dev_err(trf->dev, "%s - addr: 0x%x, ret: %d\n", __func__, 
> addr,
> ret);
> @@ -519,9 +526,11 @@ static int trf7970a_write(struct trf7970a *trf, u8 reg, 
> u8 val)
> u8 buf[2] = { reg, val };
> int ret;
>
> +   gpio_set_value(trf->ss_gpio, 0);
> dev_dbg(trf->dev, "write(0x%x): 0x%x\n", reg, val);
>
> ret = spi_write(trf->spi, buf, 2);
> +   gpio_set_value(trf->ss_gpio, 1);
> if (ret)
> dev_err(trf->dev, "%s - write: 0x%x 0x%x, ret: %d\n", 
> __func__,
> buf[0], buf[1], ret);
> @@ -535,6 +544,7 @@ static int trf7970a_read_irqstatus(struct trf7970a *trf, 
> u8 *status)
> u8 buf[2];
> u8 addr;
>
> +   gpio_set_value(trf->ss_gpio, 0);
> addr = TRF7970A_IRQ_STATUS | TRF7970A_CMD_BIT_RW;
>
> if (trf->quirks & TRF7970A_QUIRK_IRQ_STATUS_READ) {
> @@ -544,6 +554,7 @@ static int trf7970a_read_irqstatus(struct trf7970a *trf, 
> u8 *status)
> ret = spi_write_then_read(trf->spi, , 1, buf, 1);
> }
>
> +   gpio_set_value(trf->ss_gpio, 1);
> if (ret)
> dev_err(trf->dev, "%s - irqstatus: Status read failed: %d\n",
> __func__, ret);
> @@ -559,6 

[PATCH] rtl8xxxu: hide unused tables

2016-04-18 Thread Arnd Bergmann
The references to some arrays in the rtl8xxxu driver were moved inside
of an #ifdef, but the symbols remain outside, resulting in build warnings:

rtl8xxxu/rtl8xxxu.c:1506:33: error: 'rtl8188ru_radioa_1t_highpa_table' defined 
but not used
rtl8xxxu/rtl8xxxu.c:1431:33: error: 'rtl8192cu_radioa_1t_init_table' defined 
but not used
rtl8xxxu/rtl8xxxu.c:1407:33: error: 'rtl8192cu_radiob_2t_init_table' defined 
but not used
rtl8xxxu/rtl8xxxu.c:1332:33: error: 'rtl8192cu_radioa_2t_init_table' defined 
but not used
rtl8xxxu/rtl8xxxu.c:239:35: error: 'rtl8192c_power_base' defined but not used
rtl8xxxu/rtl8xxxu.c:217:35: error: 'rtl8188r_power_base' defined but not used

This adds an extra #ifdef around them to shut up the warnings.

Signed-off-by: Arnd Bergmann 
Fixes: 2fc0b8e5a17d ("rtl8xxxu: Add TX power base values for gen1 parts")
Fixes: 4062b8ffec36 ("rtl8xxxu: Move PHY RF init into device specific 
functions")
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 928ca56f751c..0ba84b5fe0d6 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -214,6 +214,7 @@ static struct rtl8xxxu_reg8val rtl8192e_mac_init_table[] = {
{0x, 0xff},
 };
 
+#ifdef CONFIG_RTL8XXXU_UNTESTED
 static struct rtl8xxxu_power_base rtl8188r_power_base = {
.reg_0e00 = 0x06080808,
.reg_0e04 = 0x00040406,
@@ -257,6 +258,7 @@ static struct rtl8xxxu_power_base rtl8192c_power_base = {
.reg_084c = 0x0b0c0d0e,
.reg_0868 = 0x01030509,
 };
+#endif
 
 static struct rtl8xxxu_power_base rtl8723a_power_base = {
.reg_0e00 = 0x0a0c0c0c,
@@ -1329,6 +1331,7 @@ static struct rtl8xxxu_rfregval 
rtl8723bu_radioa_1t_init_table[] = {
{0xff, 0x}
 };
 
+#ifdef CONFIG_RTL8XXXU_UNTESTED
 static struct rtl8xxxu_rfregval rtl8192cu_radioa_2t_init_table[] = {
{0x00, 0x00030159}, {0x01, 0x00031284},
{0x02, 0x00098000}, {0x03, 0x00018c63},
@@ -1577,6 +1580,7 @@ static struct rtl8xxxu_rfregval 
rtl8188ru_radioa_1t_highpa_table[] = {
{0x00, 0x00030159},
{0xff, 0x}
 };
+#endif
 
 static struct rtl8xxxu_rfregval rtl8192eu_radioa_init_table[] = {
{0x7f, 0x0082}, {0x81, 0x0003fc00},
-- 
2.7.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


Greetings!!!

2016-04-18 Thread andreas122
Hi, how are you? My name is J Eric Denials, External Financial Auditor at 
Lloyds Banking Group plc., London. It is a pleasure to contact you at this time 
through this medium. I have a cool and legitimate deal to do with you as you're 
a foreigner, it will be mutually beneficial to both. If you’re interested, 
urgently, get back to me for more explanation about the deal.
Regards
Eric
--
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/4] NFC: trf7970a: Add device tree option of 1.8 Volt IO voltage

2016-04-18 Thread Geoff Lansberry
Signed-off-by: Geoff Lansberry 
---
 Documentation/devicetree/bindings/net/nfc/trf7970a.txt |  8 
 drivers/nfc/trf7970a.c | 11 ++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt 
b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
index bf25f39..e605ebd 100644
--- a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
+++ b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
@@ -19,9 +19,13 @@ Optional SoC Specific Properties:
   "IRQ Status Read" erratum.
 - en2-rf-quirk: Specify that the trf7970a being used has the "EN2 RF"
   erratum.
+<<< HEAD
 - t5t-rmb-extra-byte-quirk: Specify that the trf7970a has the erratum
   where an extra byte is returned by Read Multiple Block commands issued
   to Type 5 tags.
+===
+- vdd_io_1v8: Set to specify that the trf7970a io voltage should be set to 1.8V
+>>> e7ea4dd... NFC: trf7970a: Add device tree option of 1.8 Volt IO voltage
 - crystal_27mhz: Set to specify that the input frequency to the trf7970a is 
27.12MHz
 
 Example (for ARM-based BeagleBone with TRF7970A on SPI1):
@@ -45,7 +49,11 @@ Example (for ARM-based BeagleBone with TRF7970A on SPI1):
autosuspend-delay = <3>;
irq-status-read-quirk;
en2-rf-quirk;
+<<< HEAD
t5t-rmb-extra-byte-quirk;
+===
+   vdd_io_1v8;
+>>> e7ea4dd... NFC: trf7970a: Add device tree option of 1.8 Volt IO voltage
crystal_27mhz;
status = "okay";
};
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 74210f9..be56897 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -441,6 +441,7 @@ struct trf7970a {
u8  iso_ctrl_tech;
u8  modulator_sys_clk_ctrl;
u8  special_fcn_reg1;
+   u8  io_ctrl;
unsigned intguard_time;
int technology;
int framing;
@@ -1064,6 +1065,11 @@ static int trf7970a_init(struct trf7970a *trf)
if (ret)
goto err_out;
 
+   ret = trf7970a_write(trf, TRF7970A_REG_IO_CTRL,
+   trf->io_ctrl|TRF7970A_REG_IO_CTRL_VRS(0x1));
+   if (ret)
+   goto err_out;
+
ret = trf7970a_write(trf, TRF7970A_NFC_TARGET_LEVEL, 0);
if (ret)
goto err_out;
@@ -1768,7 +1774,7 @@ static int _trf7970a_tg_listen(struct nfc_digital_dev 
*ddev, u16 timeout,
goto out_err;
 
ret = trf7970a_write(trf, TRF7970A_REG_IO_CTRL,
-   TRF7970A_REG_IO_CTRL_VRS(0x1));
+   trf->io_ctrl|TRF7970A_REG_IO_CTRL_VRS(0x1));
if (ret)
goto out_err;
 
@@ -2075,6 +2081,9 @@ static int trf7970a_probe(struct spi_device *spi)
return ret;
}
 
+   if (of_property_read_bool(np, "vdd_io_1v8"))
+   trf->io_ctrl = TRF7970A_REG_IO_CTRL_IO_LOW;
+
if (of_property_read_bool(np, "crystal_27MHz"))
trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_27MHZ;
 
-- 
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 3/4] NFC: trf7970a: add device tree option for 27MHz clock

2016-04-18 Thread Geoff Lansberry
Signed-off-by: Geoff Lansberry 
---
 .../devicetree/bindings/net/nfc/trf7970a.txt   |  2 ++
 drivers/nfc/trf7970a.c | 28 +-
 2 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt 
b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
index 09c5056..bf25f39 100644
--- a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
+++ b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
@@ -22,6 +22,7 @@ Optional SoC Specific Properties:
 - t5t-rmb-extra-byte-quirk: Specify that the trf7970a has the erratum
   where an extra byte is returned by Read Multiple Block commands issued
   to Type 5 tags.
+- crystal_27mhz: Set to specify that the input frequency to the trf7970a is 
27.12MHz
 
 Example (for ARM-based BeagleBone with TRF7970A on SPI1):
 
@@ -45,6 +46,7 @@ Example (for ARM-based BeagleBone with TRF7970A on SPI1):
irq-status-read-quirk;
en2-rf-quirk;
t5t-rmb-extra-byte-quirk;
+   crystal_27mhz;
status = "okay";
};
 };
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 447b6c9..74210f9 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -1072,12 +1072,11 @@ static int trf7970a_init(struct trf7970a *trf)
 
trf->chip_status_ctrl &= ~TRF7970A_CHIP_STATUS_RF_ON;
 
-   ret = trf7970a_write(trf, TRF7970A_MODULATOR_SYS_CLK_CTRL, 0);
+   ret = trf7970a_write(trf, TRF7970A_MODULATOR_SYS_CLK_CTRL,
+   trf->modulator_sys_clk_ctrl);
if (ret)
goto err_out;
 
-   trf->modulator_sys_clk_ctrl = 0;
-
ret = trf7970a_write(trf, TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS,
TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_96 |
TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_32);
@@ -1194,30 +1193,32 @@ static int trf7970a_in_config_rf_tech(struct trf7970a 
*trf, int tech)
 
dev_dbg(trf->dev, "rf technology: %d\n", tech);
 
+   trf->modulator_sys_clk_ctrl = (trf->modulator_sys_clk_ctrl&0xF8);
+
switch (tech) {
case NFC_DIGITAL_RF_TECH_106A:
trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_14443A_106;
-   trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_OOK;
+   trf->modulator_sys_clk_ctrl |= TRF7970A_MODULATOR_DEPTH_OOK;
trf->guard_time = TRF7970A_GUARD_TIME_NFCA;
break;
case NFC_DIGITAL_RF_TECH_106B:
trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_14443B_106;
-   trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_ASK10;
+   trf->modulator_sys_clk_ctrl |= TRF7970A_MODULATOR_DEPTH_ASK10;
trf->guard_time = TRF7970A_GUARD_TIME_NFCB;
break;
case NFC_DIGITAL_RF_TECH_212F:
trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_FELICA_212;
-   trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_ASK10;
+   trf->modulator_sys_clk_ctrl |= TRF7970A_MODULATOR_DEPTH_ASK10;
trf->guard_time = TRF7970A_GUARD_TIME_NFCF;
break;
case NFC_DIGITAL_RF_TECH_424F:
trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_FELICA_424;
-   trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_ASK10;
+   trf->modulator_sys_clk_ctrl |= TRF7970A_MODULATOR_DEPTH_ASK10;
trf->guard_time = TRF7970A_GUARD_TIME_NFCF;
break;
case NFC_DIGITAL_RF_TECH_ISO15693:
trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_15693_SGL_1OF4_2648;
-   trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_OOK;
+   trf->modulator_sys_clk_ctrl |= TRF7970A_MODULATOR_DEPTH_OOK;
trf->guard_time = TRF7970A_GUARD_TIME_15693;
break;
default:
@@ -1582,22 +1583,24 @@ static int trf7970a_tg_config_rf_tech(struct trf7970a 
*trf, int tech)
 
dev_dbg(trf->dev, "rf technology: %d\n", tech);
 
+   trf->modulator_sys_clk_ctrl = (trf->modulator_sys_clk_ctrl&0xF8);
+
switch (tech) {
case NFC_DIGITAL_RF_TECH_106A:
trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_NFC_NFC_CE_MODE |
TRF7970A_ISO_CTRL_NFC_CE |
TRF7970A_ISO_CTRL_NFC_CE_14443A;
-   trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_OOK;
+   trf->modulator_sys_clk_ctrl |= TRF7970A_MODULATOR_DEPTH_OOK;
break;
case NFC_DIGITAL_RF_TECH_212F:
trf->iso_ctrl_tech = TRF7970A_ISO_CTRL_NFC_NFC_CE_MODE |
TRF7970A_ISO_CTRL_NFC_NFCF_212;
-   trf->modulator_sys_clk_ctrl = TRF7970A_MODULATOR_DEPTH_ASK10;
+   trf->modulator_sys_clk_ctrl |= TRF7970A_MODULATOR_DEPTH_ASK10;
break;
case NFC_DIGITAL_RF_TECH_424F:

[PATCH 1/4] NFC: trf7970a: Add support for gpio as SS

2016-04-18 Thread Geoff Lansberry
Signed-off-by: Geoff Lansberry 
---
 .../devicetree/bindings/net/nfc/trf7970a.txt   |  2 ++
 drivers/nfc/trf7970a.c | 33 --
 2 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt 
b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
index 32b35a0..09c5056 100644
--- a/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
+++ b/Documentation/devicetree/bindings/net/nfc/trf7970a.txt
@@ -7,6 +7,7 @@ Required properties:
 - interrupts: A single interrupt specifier.
 - ti,enable-gpios: Two GPIO entries used for 'EN' and 'EN2' pins on the
   TRF7970A.
+- ti,ss-gpio: GPIO entry used for active low SS (spi slave select) on the 
TRF7970A
 - vin-supply: Regulator for supply voltage to VIN pin
 
 Optional SoC Specific Properties:
@@ -37,6 +38,7 @@ Example (for ARM-based BeagleBone with TRF7970A on SPI1):
interrupts = <14 0>;
ti,enable-gpios = < 2 GPIO_ACTIVE_LOW>,
  < 5 GPIO_ACTIVE_LOW>;
+   ti,ss-gpio = < 4 GPIO_ACTIVE_HIGH>;
vin-supply = <_reg>;
vin-voltage-override = <500>;
autosuspend-delay = <3>;
diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 10842b7..2c3530a 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -450,6 +450,7 @@ struct trf7970a {
booladjust_resp_len;
int en2_gpio;
int en_gpio;
+   int ss_gpio;
struct mutexlock;
unsigned inttimeout;
boolignore_timeout;
@@ -462,9 +463,11 @@ static int trf7970a_cmd(struct trf7970a *trf, u8 opcode)
u8 cmd = TRF7970A_CMD_BIT_CTRL | TRF7970A_CMD_BIT_OPCODE(opcode);
int ret;
 
+   gpio_set_value(trf->ss_gpio, 0);
dev_dbg(trf->dev, "cmd: 0x%x\n", cmd);
 
ret = spi_write(trf->spi, , 1);
+   gpio_set_value(trf->ss_gpio, 1);
if (ret)
dev_err(trf->dev, "%s - cmd: 0x%x, ret: %d\n", __func__, cmd,
ret);
@@ -476,7 +479,9 @@ static int trf7970a_read(struct trf7970a *trf, u8 reg, u8 
*val)
u8 addr = TRF7970A_CMD_BIT_RW | reg;
int ret;
 
+   gpio_set_value(trf->ss_gpio, 0);
ret = spi_write_then_read(trf->spi, , 1, val, 1);
+   gpio_set_value(trf->ss_gpio, 1);
if (ret)
dev_err(trf->dev, "%s - addr: 0x%x, ret: %d\n", __func__, addr,
ret);
@@ -493,6 +498,7 @@ static int trf7970a_read_cont(struct trf7970a *trf, u8 reg, 
u8 *buf, size_t len)
struct spi_message m;
int ret;
 
+   gpio_set_value(trf->ss_gpio, 0);
dev_dbg(trf->dev, "read_cont(0x%x, %zd)\n", addr, len);
 
spi_message_init();
@@ -508,6 +514,7 @@ static int trf7970a_read_cont(struct trf7970a *trf, u8 reg, 
u8 *buf, size_t len)
spi_message_add_tail([1], );
 
ret = spi_sync(trf->spi, );
+   gpio_set_value(trf->ss_gpio, 1);
if (ret)
dev_err(trf->dev, "%s - addr: 0x%x, ret: %d\n", __func__, addr,
ret);
@@ -519,9 +526,11 @@ static int trf7970a_write(struct trf7970a *trf, u8 reg, u8 
val)
u8 buf[2] = { reg, val };
int ret;
 
+   gpio_set_value(trf->ss_gpio, 0);
dev_dbg(trf->dev, "write(0x%x): 0x%x\n", reg, val);
 
ret = spi_write(trf->spi, buf, 2);
+   gpio_set_value(trf->ss_gpio, 1);
if (ret)
dev_err(trf->dev, "%s - write: 0x%x 0x%x, ret: %d\n", __func__,
buf[0], buf[1], ret);
@@ -535,6 +544,7 @@ static int trf7970a_read_irqstatus(struct trf7970a *trf, u8 
*status)
u8 buf[2];
u8 addr;
 
+   gpio_set_value(trf->ss_gpio, 0);
addr = TRF7970A_IRQ_STATUS | TRF7970A_CMD_BIT_RW;
 
if (trf->quirks & TRF7970A_QUIRK_IRQ_STATUS_READ) {
@@ -544,6 +554,7 @@ static int trf7970a_read_irqstatus(struct trf7970a *trf, u8 
*status)
ret = spi_write_then_read(trf->spi, , 1, buf, 1);
}
 
+   gpio_set_value(trf->ss_gpio, 1);
if (ret)
dev_err(trf->dev, "%s - irqstatus: Status read failed: %d\n",
__func__, ret);
@@ -559,6 +570,7 @@ static int trf7970a_read_target_proto(struct trf7970a *trf, 
u8 *target_proto)
u8 buf[2];
u8 addr;
 
+   gpio_set_value(trf->ss_gpio, 0);
addr = TRF79070A_NFC_TARGET_PROTOCOL | TRF7970A_CMD_BIT_RW |
TRF7970A_CMD_BIT_CONTINUOUS;
 
@@ -569,6 +581,7 @@ static int trf7970a_read_target_proto(struct trf7970a *trf, 
u8 *target_proto)
else
*target_proto = buf[0];
 
+   gpio_set_value(trf->ss_gpio, 1);
return ret;
 }
 
@@ 

[PATCH 2/4] NFC: trf7970a: add TI recommended write of zero to Register 0x18

2016-04-18 Thread Geoff Lansberry
Signed-off-by: Geoff Lansberry 
---
 drivers/nfc/trf7970a.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/nfc/trf7970a.c b/drivers/nfc/trf7970a.c
index 2c3530a..447b6c9 100644
--- a/drivers/nfc/trf7970a.c
+++ b/drivers/nfc/trf7970a.c
@@ -1064,6 +1064,10 @@ static int trf7970a_init(struct trf7970a *trf)
if (ret)
goto err_out;
 
+   ret = trf7970a_write(trf, TRF7970A_NFC_TARGET_LEVEL, 0);
+   if (ret)
+   goto err_out;
+
usleep_range(1000, 2000);
 
trf->chip_status_ctrl &= ~TRF7970A_CHIP_STATUS_RF_ON;
-- 
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] NFC: trf7970a:

2016-04-18 Thread Geoff Lansberry
The current version of the trf7970a driver is missing support for several 
features that we needed to operate a custom board. 
We feel that these features will be useful to others as well, and we want to 
share them.

1: Support for using a gpio as Slave-Select. Our processor has several devices 
on the spi bus, and we ran out of ss lines.  This patch gives TRF7970A the 
ability to
 drive the ss line of the chip from a gpio that is defined in the device tree.

2. When reviewing problems we were having in our implementation with TI support 
staff, they recommended that during initialization, address 0x18 should be 
written to zero.  This patch adds that change

3. This existing version of the driver assumes that the crystal driving the 
trf7970a is 13.56 MHz, because there are several places in the driver code 
where the rel
ated register is re-written, there is clean way to change to 27.12 MHz.  This 
patch adds a device tree option for 27 MHz and properly or's in changes in 
locations w
here the register is changed.

4. the existing version of the driver assumes that 3.3 volt io is used. The 
trf7970a has a special register where you can configure it for 1.8 volt io.  
This patch
adds a device tree option to select that this setting should be made.

 [PATCH 1/4] NFC: trf7970a: Add support for gpio as SS
 [PATCH 2/4] NFC: trf7970a: add TI recommended write of zero to
 [PATCH 3/4] NFC: trf7970a: add device tree option for 27MHz clock
 [PATCH 4/4] NFC: trf7970a: Add device tree option of 1.8 Volt IO
--
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] ath6kl: Add ability to set debug uart baud rate

2016-04-18 Thread Steve deRosier
Hi Julian,

Thanks for looking at the patch.

On Sun, Apr 17, 2016 at 5:07 PM, Julian Calaby  wrote:
> Hi Steve,
>
> This looks like it's using standard serial rates. Does it accept
> non-standard rates? If not, should this be checked before being passed
> to the hardware?
>

It should use standard serial rates, and obviously I defaulted it to a
sensible one. However, there's nothing that prevents you from using
odd and arbitrary rates in the firmware and it should just suck it in
and use it. In other words, the firmware will happily try to set 9507
baud if you tell it to.

This is specifically for debugging and working with the firmware and
IMHO, if you are using this feature and feel a need to set it to
something weird, I think the user should be allowed to. If you know
enough to be able to shoot yourself in the foot with this, then you
should know enough of what you should or shouldn't do and should be
allowed to. It's a debugging tool only and I don't see any reason to
waste lines in the driver to validate this input.

That's my perspective on the issue, but I recognize other opinions may
differ. Or you may know of a specific chip where it does matter (the
6003s and 6004s I'm using don't seem to care). If you or Kalle insist
on it, I'll be happy to add in some value checking for this parameter.
It just doesn't seem worth-while to me.

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


Greetings!!!

2016-04-18 Thread andreas11
Hi, how are you? My name is J Eric Denials, External Financial Auditor at 
Lloyds Banking Group plc., London. It is a pleasure to contact you at this time 
through this medium. I have a cool and legitimate deal to do with you as you're 
a foreigner, it will be mutually beneficial to both. If you’re interested, 
urgently, get back to me for more explanation about the deal.
Regards
Eric
--
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] carl9170: Clarify kconfig text

2016-04-18 Thread Christian Lamparter
On Monday, April 18, 2016 06:47:44 PM Xose Vazquez Perez wrote:
> Christian Lamparter wrote:
> 
> > Sure, but this could be a different patch then. I think Intel devices 
> > (iwlwifi, iwlegacy and ipw2x00) have a similar text about "download
> > firmware from this device from our homepage here" too. So if we want,
> > we can remove them altogether?
> 
> linux-firmware.git does not contain firmware for all drivers. _At least_
> zd1211rw [1], atmel [2] and ipw2x00 [3] are out of the tree.

Yeah, don't forget p54. It needs out-of-tree firmwares as well.

But what about iwlegacy? Isn't that another candidate that would fit both
requirements (no recent firmware update, firmware in linux-firmware.git) ?

> [1] http://sf.net/projects/zd1211/files/
> [2] 
> http://web.archive.org/web/20121016132320/http://at76c503a.berlios.de/fw_dl.html
> [3] http://ipw2100.sf.net/firmware.php http://ipw2200.sf.net/firmware.php
--
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] carl9170: Clarify kconfig text

2016-04-18 Thread Christian Lamparter
On Monday, April 18, 2016 07:42:05 PM Kalle Valo wrote:
> Christian Lamparter  writes:
> 
> > On Monday, April 18, 2016 06:45:09 PM Kalle Valo wrote:
> >> Lauri Kasanen  writes:
> >> 
> >> > --- a/drivers/net/wireless/ath/carl9170/Kconfig
> >> > +++ b/drivers/net/wireless/ath/carl9170/Kconfig
> >> > @@ -5,12 +5,10 @@ config CARL9170
> >> >  select FW_LOADER
> >> >  select CRC32
> >> >  help
> >> > -  This is another driver for the Atheros "otus" 802.11n USB 
> >> > devices.
> >> > +  This is the mainline driver for the Atheros "otus" 802.11n 
> >> > USB devices.
> >> >  
> >> > -  This driver provides more features than the original,
> >> > -  but it needs a special firmware (carl9170-1.fw) to do that.
> >> > -
> >> > -  The firmware can be downloaded from our wiki here:
> >> > +  It needs a special firmware (carl9170-1.fw), which can be 
> >> > downloaded
> >> > +  from our wiki here:
> >> >
> >> 
> >> Why even mention anything about a "special firmware" as the firmware is
> >> already available from linux-firmware.git? 
> >
> > Yes and no. 1.9.6 is in linux-firmware.git. I've tried to add 1.9.9 too
> > but that failed.
> > 
> 
> Rick's comment makes sense to me, better just to provide the latest
> version. No need to unnecessary confuse the users. And if someone really
> wants to use an older version that she can retrieve it from the git
> history.
Part of the fun here is that firmware is GPLv2. The linux-firmware.git has
to point to or add the firmware source to their tree. They have added every
single source file to it instead of "packaging" it in a tar.bz2/gz/xz
like you normally do for release sources.

If you want to read more about it:


--
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] carl9170: Clarify kconfig text

2016-04-18 Thread Xose Vazquez Perez
Christian Lamparter wrote:

> Sure, but this could be a different patch then. I think Intel devices 
> (iwlwifi, iwlegacy and ipw2x00) have a similar text about "download
> firmware from this device from our homepage here" too. So if we want,
> we can remove them altogether?

linux-firmware.git does not contain firmware for all drivers. _At least_
zd1211rw [1], atmel [2] and ipw2x00 [3] are out of the tree.

[1] http://sf.net/projects/zd1211/files/
[2] 
http://web.archive.org/web/20121016132320/http://at76c503a.berlios.de/fw_dl.html
[3] http://ipw2100.sf.net/firmware.php http://ipw2200.sf.net/firmware.php
--
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] carl9170: Clarify kconfig text

2016-04-18 Thread Kalle Valo
Christian Lamparter  writes:

> On Monday, April 18, 2016 06:45:09 PM Kalle Valo wrote:
>> Lauri Kasanen  writes:
>> 
>> > --- a/drivers/net/wireless/ath/carl9170/Kconfig
>> > +++ b/drivers/net/wireless/ath/carl9170/Kconfig
>> > @@ -5,12 +5,10 @@ config CARL9170
>> >select FW_LOADER
>> >select CRC32
>> >help
>> > -This is another driver for the Atheros "otus" 802.11n USB devices.
>> > +This is the mainline driver for the Atheros "otus" 802.11n USB 
>> > devices.
>> >  
>> > -This driver provides more features than the original,
>> > -but it needs a special firmware (carl9170-1.fw) to do that.
>> > -
>> > -The firmware can be downloaded from our wiki here:
>> > +It needs a special firmware (carl9170-1.fw), which can be downloaded
>> > +from our wiki here:
>> >  
>> 
>> Why even mention anything about a "special firmware" as the firmware is
>> already available from linux-firmware.git? 
>
> Yes and no. 1.9.6 is in linux-firmware.git. I've tried to add 1.9.9 too
> but that failed.
> 

Rick's comment makes sense to me, better just to provide the latest
version. No need to unnecessary confuse the users. And if someone really
wants to use an older version that she can retrieve it from the git
history.

>> That's default location for all firmware images and I think most, if not all,
>> distros should have it available. So wouldn't it be better not to mention 
>> anything about firmware at all?
>
> Sure, but this could be a different patch then. I think Intel devices 
> (iwlwifi, iwlegacy and ipw2x00) have a similar text about "download
> firmware from this device from our homepage here" too. So if we want,
> we can remove them altogether?

So iwlwifi now has:

  In order to use this driver, you will need a firmware
  image for it. You can obtain the microcode from:

  .

Maybe that could be changed to mention about the wiki page in general:

  The driver has a wiki page at:

  .

But I know iwlwifi updates the firmware images pretty often so Emmanuel
might see this differently.

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


Re: [PATCH v2] carl9170: Clarify kconfig text

2016-04-18 Thread Christian Lamparter
On Monday, April 18, 2016 06:45:09 PM Kalle Valo wrote:
> Lauri Kasanen  writes:
> 
> > The previous text was confusing, leading readers to think this
> > driver was a duplicate, and so didn't need to be enabled.
> >
> > After the removal of the older staging driver, this is the only
> > driver in mainline for these devices.
> >
> > Signed-off-by: Lauri Kasanen 
> > ---
> > v2: Remove the mention of the previous driver, suggested by Christian.
> >
> >  drivers/net/wireless/ath/carl9170/Kconfig | 8 +++-
> >  1 file changed, 3 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/net/wireless/ath/carl9170/Kconfig 
> > b/drivers/net/wireless/ath/carl9170/Kconfig
> > index 1a796e5..2e34bae 100644
> > --- a/drivers/net/wireless/ath/carl9170/Kconfig
> > +++ b/drivers/net/wireless/ath/carl9170/Kconfig
> > @@ -5,12 +5,10 @@ config CARL9170
> > select FW_LOADER
> > select CRC32
> > help
> > - This is another driver for the Atheros "otus" 802.11n USB devices.
> > + This is the mainline driver for the Atheros "otus" 802.11n USB 
> > devices.
> >  
> > - This driver provides more features than the original,
> > - but it needs a special firmware (carl9170-1.fw) to do that.
> > -
> > - The firmware can be downloaded from our wiki here:
> > + It needs a special firmware (carl9170-1.fw), which can be downloaded
> > + from our wiki here:
> >   
> 
> Why even mention anything about a "special firmware" as the firmware is
> already available from linux-firmware.git? 
Yes and no. 1.9.6 is in linux-firmware.git. I've tried to add 1.9.9 too
but that failed.


> That's default location for all firmware images and I think most, if not all,
> distros should have it available. So wouldn't it be better not to mention 
> anything about firmware at all?
Sure, but this could be a different patch then. I think Intel devices 
(iwlwifi, iwlegacy and ipw2x00) have a similar text about "download
firmware from this device from our homepage here" too. So if we want,
we can remove them altogether?

Regards,
Christian
--
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 v3] carl9170: Clarify kconfig text

2016-04-18 Thread Christian Lamparter
On Monday, April 18, 2016 07:07:39 PM Lauri Kasanen wrote:
> The previous text was confusing, leading readers to think this
> driver was a duplicate, and so didn't need to be enabled.
> 
> After the removal of the older staging driver, this is the only
> driver in mainline for these devices.
> 
> Signed-off-by: Lauri Kasanen 
> ---
> v3: Remove all firmware mentions.
> 
>  drivers/net/wireless/ath/carl9170/Kconfig | 8 +---
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/carl9170/Kconfig 
> b/drivers/net/wireless/ath/carl9170/Kconfig
> index 1a796e5..ca1ae09 100644
> --- a/drivers/net/wireless/ath/carl9170/Kconfig
> +++ b/drivers/net/wireless/ath/carl9170/Kconfig
> @@ -5,13 +5,7 @@ config CARL9170
>   select FW_LOADER
>   select CRC32
>   help
> -   This is another driver for the Atheros "otus" 802.11n USB devices.
> -
> -   This driver provides more features than the original,
> -   but it needs a special firmware (carl9170-1.fw) to do that.
> -
> -   The firmware can be downloaded from our wiki here:
> -   
Please do keep the wiki link.
--
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 V11 2/2] brcmfmac: add support for nl80211 BSS_SELECT feature

2016-04-18 Thread Kalle Valo
Arend van Spriel  writes:

> On 15-04-16 20:33, Kalle Valo wrote:
>> Arend van Spriel  writes:
>> 
>>> Announce support for nl80211 feature BSS_SELECT and process
>>> BSS selection behaviour provided in .connect() callback.
>>>
>>> Reviewed-by: Hante Meuleman 
>>> Reviewed-by: Franky (Zhenhui) Lin 
>>> Reviewed-by: Pieter-Paul Giesberts 
>>> Reviewed-by: Lei Zhang 
>>> Signed-off-by: Arend van Spriel 
>> 
>> Sorry, didn't apply anymore and I don't dare to try to fix the
>> conflicts:
>> 
>> Applying: brcmfmac: add support for nl80211 BSS_SELECT feature
>> Using index info to reconstruct a base tree...
>> Falling back to patching base and 3-way merge...
>> Auto-merging drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
>> CONFLICT (content): Merge conflict in 
>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h
>> Auto-merging drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
>> Auto-merging drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
>> CONFLICT (content): Merge conflict in 
>> drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
>> 
>> So please rebase.
>
> It probably never applied as I created the patch together with nl80211
> patch on mac80211-next/master branch. Not sure how to handle it
> otherwise.

Yeah, I don't see any better way to do this either and I think the way
you did is best.

> Anyway, I will send out a rebased version soon.

Got it, thanks.

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


Re: [PATCH 00/16] rtl8xxxu prepare for splitting into multiple files

2016-04-18 Thread Jes Sorensen
Larry Finger  writes:
> On 04/18/2016 10:49 AM, jes.soren...@redhat.com wrote:
>> From: Jes Sorensen 
>>
>> Hi,
>>
>> This is the last set of patches I have in my queue for the rtl8xxxu
>> driver, as of today :)
>>
>> Since the driver has grown to support quite a number of different
>> chips, I want to split it into multiple files. This will make it
>> easier to maintain and also eaiser to add support for more chips
>> without having to constantly touch the core files.
>>
>> This set renames a bunch of functions to indicate that they are
>> generic rather than chip specific. I will look at doing the actual
>> moving around in a set right after the current merge window closes.
>>
>> Please keep the test reports coming!
>
> I like the renaming of the routines to match the chip generation, but
> there should be some comments stating the gen to which each
> device/version belongs. Such comments are not needed now, but could be
> included when the files are split.

Larry,

I like that idea - I thought I did that when I pushed the enum for chip
versions in ba17d824783805235f317f79f2871b17bd679956 but somehow it
didn't get further than my head.

I have been thinking of putting some of it down in writing - probably in
rtl8xxxu.h or a README

Note the gen1/gen2 categorization is completely made up by me, it may be
that this is really gen6/gen7 within Realtek. Roughly I consider
8191su/8192su to be gen0, 8188cu/8188ru/8192cu/8723au as gen1, and
8192eu/8723bu/8812/8821 as gen2. I haven't looked closely enough at
8188eu and 8192du yet to determine where they really fit in.

Top priority on my list post splitting the driver into multiple files is
adding 8188eu and beacon support. If only there was 30 hours in a day...

Cheers,
Jes
--
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/16] rtl8xxxu prepare for splitting into multiple files

2016-04-18 Thread Jes Sorensen
Joe Perches  writes:
> On Mon, 2016-04-18 at 11:49 -0400, jes.soren...@redhat.com wrote:
>> From: Jes Sorensen 
>> 
>> Hi,
>> 
>> This is the last set of patches I have in my queue for the rtl8xxxu
>> driver, as of today :)
>> 
>> Since the driver has grown to support quite a number of different
>> chips, I want to split it into multiple files. This will make it
>> easier to maintain and also eaiser to add support for more chips
>> without having to constantly touch the core files.
>> 
>> This set renames a bunch of functions to indicate that they are
>> generic rather than chip specific. I will look at doing the actual
>> moving around in a set right after the current merge window closes.
>
> It's a bit of a pity that the identifiers are all
> quite long.  Using these long identifiers makes
> 80 column content a bit right shifted and single
> line statements unlikely.

Well I do agree that some of the names are long and I try to keep them
as short as possible when I can. However I refuse to turn this into a
NetBSD driver :)

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


[PATCH v3] carl9170: Clarify kconfig text

2016-04-18 Thread Lauri Kasanen
The previous text was confusing, leading readers to think this
driver was a duplicate, and so didn't need to be enabled.

After the removal of the older staging driver, this is the only
driver in mainline for these devices.

Signed-off-by: Lauri Kasanen 
---
v3: Remove all firmware mentions.

 drivers/net/wireless/ath/carl9170/Kconfig | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/net/wireless/ath/carl9170/Kconfig 
b/drivers/net/wireless/ath/carl9170/Kconfig
index 1a796e5..ca1ae09 100644
--- a/drivers/net/wireless/ath/carl9170/Kconfig
+++ b/drivers/net/wireless/ath/carl9170/Kconfig
@@ -5,13 +5,7 @@ config CARL9170
select FW_LOADER
select CRC32
help
- This is another driver for the Atheros "otus" 802.11n USB devices.
-
- This driver provides more features than the original,
- but it needs a special firmware (carl9170-1.fw) to do that.
-
- The firmware can be downloaded from our wiki here:
- 
+ This is the mainline driver for the Atheros "otus" 802.11n USB 
devices.
 
  If you choose to build a module, it'll be called carl9170.
 
-- 
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 00/16] rtl8xxxu prepare for splitting into multiple files

2016-04-18 Thread Larry Finger

On 04/18/2016 10:49 AM, jes.soren...@redhat.com wrote:

From: Jes Sorensen 

Hi,

This is the last set of patches I have in my queue for the rtl8xxxu
driver, as of today :)

Since the driver has grown to support quite a number of different
chips, I want to split it into multiple files. This will make it
easier to maintain and also eaiser to add support for more chips
without having to constantly touch the core files.

This set renames a bunch of functions to indicate that they are
generic rather than chip specific. I will look at doing the actual
moving around in a set right after the current merge window closes.

Please keep the test reports coming!


I like the renaming of the routines to match the chip generation, but there 
should be some comments stating the gen to which each device/version belongs. 
Such comments are not needed now, but could be included when the files are split.


Larry

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


[PATCH 00/16] rtl8xxxu prepare for splitting into multiple files

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

Hi,

This is the last set of patches I have in my queue for the rtl8xxxu
driver, as of today :)

Since the driver has grown to support quite a number of different
chips, I want to split it into multiple files. This will make it
easier to maintain and also eaiser to add support for more chips
without having to constantly touch the core files.

This set renames a bunch of functions to indicate that they are
generic rather than chip specific. I will look at doing the actual
moving around in a set right after the current merge window closes.

Please keep the test reports coming!

Cheers,
Jes


Jes Sorensen (16):
  rtl8xxxu: Rename rtl8723bu_update_rate_mask() to
rtl8xxxu_gen2_update_rate_mask()
  rtl8xxxu: Rename rtl8723bu_report_connect() to
rtl8xxxu_gen2_report_connect()
  rtl8xxxu: Rename rtl8723au_report_connect() to
rtl8xxxu_gen1_report_connect()
  rtl8xxxu: Rename rtl8723bu_config_channel() to
rtl8xxxu_gen2_config_channel()
  rtl8xxxu: Rename rtl8723b_disable_rf() to rtl8xxxu_gen2_disable_rf()
  rtl8xxxu: Rename rtl8723a_disable_rf() to rtl8xxxu_gen1_disable_rf()
  rtl8xxxu: Rename rtl8723au_config_channel() to
rtl8xxxu_gen1_config_channel()
  rtl8xxxu: Rename rtl8723au_update_rate_mask() to
rtl8xxxu_update_rate_mask()
  rtl8xxxu: Rename rtl8723au_phy_iq_calibrate() to
rtl8xxxu_gen1_phy_iq_calibrate()
  rtl8xxxu: Rename rtl8723au_init_phy_bb() to
rtl8xxxu_gen1_init_phy_bb()
  rtl8xxxu: Rename rtl8723a_set_tx_power() to
rtl8xxxu_gen1_set_tx_power()
  rtl8xxxu: Rename rtl8723a_enable_rf() to rtl8xxxu_gen1_enable_rf()
  rtl8xxxu: Rename rtl8723a_mac_init_table to
rtl8xxxu_gen1_mac_init_table
  rtl8xxxu: Rename rtl8723b_channel_to_group()
  rtl8xxxu: Rename rtl8723bu_simularity_compare()
  rtl8xxxu: Rename rtl8723au_iqk_phy_iq_bb_reg

 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 122 ---
 1 file changed, 64 insertions(+), 58 deletions(-)

-- 
2.5.5

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


[PATCH 12/16] rtl8xxxu: Rename rtl8723a_enable_rf() to rtl8xxxu_gen1_enable_rf()

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

All gen1 parts use the same enable_rf() function, so rename it to
reflect this.

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 1499aa0..a2f5609 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2076,7 +2076,7 @@ static void rtl8723bu_write_btreg(struct rtl8xxxu_priv 
*priv, u8 reg, u8 data)
rtl8723a_h2c_cmd(priv, , sizeof(h2c.bt_mp_oper));
 }
 
-static void rtl8723a_enable_rf(struct rtl8xxxu_priv *priv)
+static void rtl8xxxu_gen1_enable_rf(struct rtl8xxxu_priv *priv)
 {
u8 val8;
u32 val32;
@@ -9881,7 +9881,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.phy_iq_calibrate = rtl8xxxu_gen1_phy_iq_calibrate,
.config_channel = rtl8xxxu_gen1_config_channel,
.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
-   .enable_rf = rtl8723a_enable_rf,
+   .enable_rf = rtl8xxxu_gen1_enable_rf,
.disable_rf = rtl8xxxu_gen1_disable_rf,
.usb_quirks = rtl8xxxu_gen1_usb_quirks,
.set_tx_power = rtl8xxxu_gen1_set_tx_power,
@@ -9953,7 +9953,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.phy_iq_calibrate = rtl8xxxu_gen1_phy_iq_calibrate,
.config_channel = rtl8xxxu_gen1_config_channel,
.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
-   .enable_rf = rtl8723a_enable_rf,
+   .enable_rf = rtl8xxxu_gen1_enable_rf,
.disable_rf = rtl8xxxu_gen1_disable_rf,
.usb_quirks = rtl8xxxu_gen1_usb_quirks,
.set_tx_power = rtl8xxxu_gen1_set_tx_power,
-- 
2.5.5

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


[PATCH 07/16] rtl8xxxu: Rename rtl8723au_config_channel() to rtl8xxxu_gen1_config_channel()

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

All supported gen1 parts use the same config_channel() function, so
rename it to reflect this.

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 4aab4f5..d0557ad 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2219,7 +2219,7 @@ static int rtl8723b_channel_to_group(int channel)
return group;
 }
 
-static void rtl8723au_config_channel(struct ieee80211_hw *hw)
+static void rtl8xxxu_gen1_config_channel(struct ieee80211_hw *hw)
 {
struct rtl8xxxu_priv *priv = hw->priv;
u32 val32, rsr;
@@ -9879,7 +9879,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.init_phy_bb = rtl8723au_init_phy_bb,
.init_phy_rf = rtl8723au_init_phy_rf,
.phy_iq_calibrate = rtl8723au_phy_iq_calibrate,
-   .config_channel = rtl8723au_config_channel,
+   .config_channel = rtl8xxxu_gen1_config_channel,
.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
.enable_rf = rtl8723a_enable_rf,
.disable_rf = rtl8xxxu_gen1_disable_rf,
@@ -9951,7 +9951,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.init_phy_bb = rtl8723au_init_phy_bb,
.init_phy_rf = rtl8192cu_init_phy_rf,
.phy_iq_calibrate = rtl8723au_phy_iq_calibrate,
-   .config_channel = rtl8723au_config_channel,
+   .config_channel = rtl8xxxu_gen1_config_channel,
.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
.enable_rf = rtl8723a_enable_rf,
.disable_rf = rtl8xxxu_gen1_disable_rf,
-- 
2.5.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 00/16] rtl8xxxu prepare for splitting into multiple files

2016-04-18 Thread Joe Perches
On Mon, 2016-04-18 at 11:49 -0400, jes.soren...@redhat.com wrote:
> From: Jes Sorensen 
> 
> Hi,
> 
> This is the last set of patches I have in my queue for the rtl8xxxu
> driver, as of today :)
> 
> Since the driver has grown to support quite a number of different
> chips, I want to split it into multiple files. This will make it
> easier to maintain and also eaiser to add support for more chips
> without having to constantly touch the core files.
> 
> This set renames a bunch of functions to indicate that they are
> generic rather than chip specific. I will look at doing the actual
> moving around in a set right after the current merge window closes.

It's a bit of a pity that the identifiers are all
quite long.  Using these long identifiers makes
80 column content a bit right shifted and single
line statements unlikely.

--
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 09/16] rtl8xxxu: Rename rtl8723au_phy_iq_calibrate() to rtl8xxxu_gen1_phy_iq_calibrate()

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

All supported gen1 parts use the same phy_iq_calibrate() function
(unlike their gen2 counterparts). Rename the function to reflect this.

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 469bc9a..d5c2117 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -6103,7 +6103,7 @@ static void rtl8xxxu_prepare_calibrate(struct 
rtl8xxxu_priv *priv, u8 start)
rtl8723a_h2c_cmd(priv, , sizeof(h2c.bt_wlan_calibration));
 }
 
-static void rtl8723au_phy_iq_calibrate(struct rtl8xxxu_priv *priv)
+static void rtl8xxxu_gen1_phy_iq_calibrate(struct rtl8xxxu_priv *priv)
 {
struct device *dev = >udev->dev;
int result[4][8];   /* last is final result */
@@ -9878,7 +9878,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.llt_init = rtl8xxxu_init_llt_table,
.init_phy_bb = rtl8723au_init_phy_bb,
.init_phy_rf = rtl8723au_init_phy_rf,
-   .phy_iq_calibrate = rtl8723au_phy_iq_calibrate,
+   .phy_iq_calibrate = rtl8xxxu_gen1_phy_iq_calibrate,
.config_channel = rtl8xxxu_gen1_config_channel,
.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
.enable_rf = rtl8723a_enable_rf,
@@ -9950,7 +9950,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.llt_init = rtl8xxxu_init_llt_table,
.init_phy_bb = rtl8723au_init_phy_bb,
.init_phy_rf = rtl8192cu_init_phy_rf,
-   .phy_iq_calibrate = rtl8723au_phy_iq_calibrate,
+   .phy_iq_calibrate = rtl8xxxu_gen1_phy_iq_calibrate,
.config_channel = rtl8xxxu_gen1_config_channel,
.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
.enable_rf = rtl8723a_enable_rf,
-- 
2.5.5

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


[PATCH 04/16] rtl8xxxu: Rename rtl8723bu_config_channel() to rtl8xxxu_gen2_config_channel()

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

Rename the function to indicate it is applicable to most/all gen2
parts.

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index a7f7031..0928352 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2341,7 +2341,7 @@ static void rtl8723au_config_channel(struct ieee80211_hw 
*hw)
}
 }
 
-static void rtl8723bu_config_channel(struct ieee80211_hw *hw)
+static void rtl8xxxu_gen2_config_channel(struct ieee80211_hw *hw)
 {
struct rtl8xxxu_priv *priv = hw->priv;
u32 val32, rsr;
@@ -9913,7 +9913,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.init_phy_rf = rtl8723bu_init_phy_rf,
.phy_init_antenna_selection = rtl8723bu_phy_init_antenna_selection,
.phy_iq_calibrate = rtl8723bu_phy_iq_calibrate,
-   .config_channel = rtl8723bu_config_channel,
+   .config_channel = rtl8xxxu_gen2_config_channel,
.parse_rx_desc = rtl8xxxu_parse_rxdesc24,
.init_aggregation = rtl8723bu_init_aggregation,
.init_statistics = rtl8723bu_init_statistics,
@@ -9986,7 +9986,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.init_phy_bb = rtl8192eu_init_phy_bb,
.init_phy_rf = rtl8192eu_init_phy_rf,
.phy_iq_calibrate = rtl8192eu_phy_iq_calibrate,
-   .config_channel = rtl8723bu_config_channel,
+   .config_channel = rtl8xxxu_gen2_config_channel,
.parse_rx_desc = rtl8xxxu_parse_rxdesc24,
.enable_rf = rtl8192e_enable_rf,
.disable_rf = rtl8723b_disable_rf,
-- 
2.5.5

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


[PATCH 13/16] rtl8xxxu: Rename rtl8723a_mac_init_table to rtl8xxxu_gen1_mac_init_table

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

All currently supported gen1 parts use the same mac_init_table, so
rename it to reflect this.

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index a2f5609..fb13a77 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -128,7 +128,7 @@ static struct ieee80211_supported_band 
rtl8xxxu_supported_band = {
.n_bitrates = ARRAY_SIZE(rtl8xxxu_rates),
 };
 
-static struct rtl8xxxu_reg8val rtl8723a_mac_init_table[] = {
+static struct rtl8xxxu_reg8val rtl8xxxu_gen1_mac_init_table[] = {
{0x420, 0x80}, {0x423, 0x00}, {0x430, 0x00}, {0x431, 0x00},
{0x432, 0x00}, {0x433, 0x01}, {0x434, 0x04}, {0x435, 0x05},
{0x436, 0x06}, {0x437, 0x07}, {0x438, 0x00}, {0x439, 0x00},
@@ -9899,7 +9899,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.trxff_boundary = 0x27ff,
.pbp_rx = PBP_PAGE_SIZE_128,
.pbp_tx = PBP_PAGE_SIZE_128,
-   .mactable = rtl8723a_mac_init_table,
+   .mactable = rtl8xxxu_gen1_mac_init_table,
 };
 
 static struct rtl8xxxu_fileops rtl8723bu_fops = {
@@ -9971,7 +9971,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.trxff_boundary = 0x27ff,
.pbp_rx = PBP_PAGE_SIZE_128,
.pbp_tx = PBP_PAGE_SIZE_128,
-   .mactable = rtl8723a_mac_init_table,
+   .mactable = rtl8xxxu_gen1_mac_init_table,
 };
 
 #endif
-- 
2.5.5

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


[PATCH 14/16] rtl8xxxu: Rename rtl8723b_channel_to_group()

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

This renames rtl8723b_channel_to_group() to
rtl8xxxu_gen2_channel_to_group() to reflect it is used by all
currently supported gen2 parts.

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index fb13a77..bec2c4d 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2201,7 +2201,7 @@ static int rtl8723a_channel_to_group(int channel)
 /*
  * Valid for rtl8723bu and rtl8192eu
  */
-static int rtl8723b_channel_to_group(int channel)
+static int rtl8xxxu_gen2_channel_to_group(int channel)
 {
int group;
 
@@ -2613,7 +2613,7 @@ rtl8723b_set_tx_power(struct rtl8xxxu_priv *priv, int 
channel, bool ht40)
int group, tx_idx;
 
tx_idx = 0;
-   group = rtl8723b_channel_to_group(channel);
+   group = rtl8xxxu_gen2_channel_to_group(channel);
 
cck = priv->cck_tx_power_index_B[group];
val32 = rtl8xxxu_read32(priv, REG_TX_AGC_A_CCK1_MCS32);
@@ -2652,7 +2652,7 @@ rtl8192e_set_tx_power(struct rtl8xxxu_priv *priv, int 
channel, bool ht40)
int group, tx_idx;
 
tx_idx = 0;
-   group = rtl8723b_channel_to_group(channel);
+   group = rtl8xxxu_gen2_channel_to_group(channel);
 
cck = priv->cck_tx_power_index_A[group];
 
-- 
2.5.5

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


[PATCH 10/16] rtl8xxxu: Rename rtl8723au_init_phy_bb() to rtl8xxxu_gen1_init_phy_bb()

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

All gen1 parts use the same init_phy_bb() function, so rename it to
reflect this.

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index d5c2117..5c86965 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -3810,7 +3810,7 @@ static int rtl8xxxu_init_phy_regs(struct rtl8xxxu_priv 
*priv,
return 0;
 }
 
-static void rtl8723au_init_phy_bb(struct rtl8xxxu_priv *priv)
+static void rtl8xxxu_gen1_init_phy_bb(struct rtl8xxxu_priv *priv)
 {
u8 val8, ldoa15, ldov12d, lpldo, ldohci12;
u16 val16;
@@ -9876,7 +9876,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.power_off = rtl8xxxu_power_off,
.reset_8051 = rtl8xxxu_reset_8051,
.llt_init = rtl8xxxu_init_llt_table,
-   .init_phy_bb = rtl8723au_init_phy_bb,
+   .init_phy_bb = rtl8xxxu_gen1_init_phy_bb,
.init_phy_rf = rtl8723au_init_phy_rf,
.phy_iq_calibrate = rtl8xxxu_gen1_phy_iq_calibrate,
.config_channel = rtl8xxxu_gen1_config_channel,
@@ -9948,7 +9948,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.power_off = rtl8xxxu_power_off,
.reset_8051 = rtl8xxxu_reset_8051,
.llt_init = rtl8xxxu_init_llt_table,
-   .init_phy_bb = rtl8723au_init_phy_bb,
+   .init_phy_bb = rtl8xxxu_gen1_init_phy_bb,
.init_phy_rf = rtl8192cu_init_phy_rf,
.phy_iq_calibrate = rtl8xxxu_gen1_phy_iq_calibrate,
.config_channel = rtl8xxxu_gen1_config_channel,
-- 
2.5.5

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


[PATCH 08/16] rtl8xxxu: Rename rtl8723au_update_rate_mask() to rtl8xxxu_update_rate_mask()

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

All currently supported gen1 parts use the same function for updating
the rate mask, so rename it to reflect this.

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index d0557ad..469bc9a 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -8199,8 +8199,8 @@ static void rtl8xxxu_sw_scan_complete(struct ieee80211_hw 
*hw,
rtl8xxxu_write8(priv, REG_BEACON_CTRL, val8);
 }
 
-static void rtl8723au_update_rate_mask(struct rtl8xxxu_priv *priv,
-  u32 ramask, int sgi)
+static void rtl8xxxu_update_rate_mask(struct rtl8xxxu_priv *priv,
+ u32 ramask, int sgi)
 {
struct h2c_cmd h2c;
 
@@ -9885,7 +9885,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.disable_rf = rtl8xxxu_gen1_disable_rf,
.usb_quirks = rtl8xxxu_gen1_usb_quirks,
.set_tx_power = rtl8723a_set_tx_power,
-   .update_rate_mask = rtl8723au_update_rate_mask,
+   .update_rate_mask = rtl8xxxu_update_rate_mask,
.report_connect = rtl8xxxu_gen1_report_connect,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT_0,
@@ -9957,7 +9957,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.disable_rf = rtl8xxxu_gen1_disable_rf,
.usb_quirks = rtl8xxxu_gen1_usb_quirks,
.set_tx_power = rtl8723a_set_tx_power,
-   .update_rate_mask = rtl8723au_update_rate_mask,
+   .update_rate_mask = rtl8xxxu_update_rate_mask,
.report_connect = rtl8xxxu_gen1_report_connect,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT_0,
-- 
2.5.5

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


[PATCH 01/16] rtl8xxxu: Rename rtl8723bu_update_rate_mask() to rtl8xxxu_gen2_update_rate_mask()

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

Update the name of rtl8723bu_update_rate_mask() to make it reflect
it's applicable for all/most gen2 N parts.

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 928ca56..4ec18a4 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -8219,8 +8219,8 @@ static void rtl8723au_update_rate_mask(struct 
rtl8xxxu_priv *priv,
rtl8723a_h2c_cmd(priv, , sizeof(h2c.ramask));
 }
 
-static void rtl8723bu_update_rate_mask(struct rtl8xxxu_priv *priv,
-  u32 ramask, int sgi)
+static void rtl8xxxu_gen2_update_rate_mask(struct rtl8xxxu_priv *priv,
+  u32 ramask, int sgi)
 {
struct h2c_cmd h2c;
u8 bw = 0;
@@ -9921,7 +9921,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.disable_rf = rtl8723b_disable_rf,
.usb_quirks = rtl8xxxu_gen2_usb_quirks,
.set_tx_power = rtl8723b_set_tx_power,
-   .update_rate_mask = rtl8723bu_update_rate_mask,
+   .update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
.report_connect = rtl8723bu_report_connect,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
@@ -9992,7 +9992,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.disable_rf = rtl8723b_disable_rf,
.usb_quirks = rtl8xxxu_gen2_usb_quirks,
.set_tx_power = rtl8192e_set_tx_power,
-   .update_rate_mask = rtl8723bu_update_rate_mask,
+   .update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
.report_connect = rtl8723bu_report_connect,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
-- 
2.5.5

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


[PATCH 05/16] rtl8xxxu: Rename rtl8723b_disable_rf() to rtl8xxxu_gen2_disable_rf()

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

At least for now, all gen2 parts use the same disable_rf() function

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 0928352..7a28b78 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -7659,7 +7659,7 @@ static void rtl8723b_enable_rf(struct rtl8xxxu_priv *priv)
rtl8723a_h2c_cmd(priv, , sizeof(h2c.ignore_wlan));
 }
 
-static void rtl8723b_disable_rf(struct rtl8xxxu_priv *priv)
+static void rtl8xxxu_gen2_disable_rf(struct rtl8xxxu_priv *priv)
 {
u32 val32;
 
@@ -9918,7 +9918,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.init_aggregation = rtl8723bu_init_aggregation,
.init_statistics = rtl8723bu_init_statistics,
.enable_rf = rtl8723b_enable_rf,
-   .disable_rf = rtl8723b_disable_rf,
+   .disable_rf = rtl8xxxu_gen2_disable_rf,
.usb_quirks = rtl8xxxu_gen2_usb_quirks,
.set_tx_power = rtl8723b_set_tx_power,
.update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
@@ -9989,7 +9989,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.config_channel = rtl8xxxu_gen2_config_channel,
.parse_rx_desc = rtl8xxxu_parse_rxdesc24,
.enable_rf = rtl8192e_enable_rf,
-   .disable_rf = rtl8723b_disable_rf,
+   .disable_rf = rtl8xxxu_gen2_disable_rf,
.usb_quirks = rtl8xxxu_gen2_usb_quirks,
.set_tx_power = rtl8192e_set_tx_power,
.update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
-- 
2.5.5

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


[PATCH 06/16] rtl8xxxu: Rename rtl8723a_disable_rf() to rtl8xxxu_gen1_disable_rf()

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

All currently supported gen1 parts use the same disable_rf() routine,
so rename the function to reflect that.

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 7a28b78..4aab4f5 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2120,7 +2120,7 @@ static void rtl8723a_enable_rf(struct rtl8xxxu_priv *priv)
rtl8xxxu_write8(priv, REG_TXPAUSE, 0x00);
 }
 
-static void rtl8723a_disable_rf(struct rtl8xxxu_priv *priv)
+static void rtl8xxxu_gen1_disable_rf(struct rtl8xxxu_priv *priv)
 {
u8 sps0;
u32 val32;
@@ -9882,7 +9882,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.config_channel = rtl8723au_config_channel,
.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
.enable_rf = rtl8723a_enable_rf,
-   .disable_rf = rtl8723a_disable_rf,
+   .disable_rf = rtl8xxxu_gen1_disable_rf,
.usb_quirks = rtl8xxxu_gen1_usb_quirks,
.set_tx_power = rtl8723a_set_tx_power,
.update_rate_mask = rtl8723au_update_rate_mask,
@@ -9954,7 +9954,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.config_channel = rtl8723au_config_channel,
.parse_rx_desc = rtl8xxxu_parse_rxdesc16,
.enable_rf = rtl8723a_enable_rf,
-   .disable_rf = rtl8723a_disable_rf,
+   .disable_rf = rtl8xxxu_gen1_disable_rf,
.usb_quirks = rtl8xxxu_gen1_usb_quirks,
.set_tx_power = rtl8723a_set_tx_power,
.update_rate_mask = rtl8723au_update_rate_mask,
-- 
2.5.5

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


[PATCH 03/16] rtl8xxxu: Rename rtl8723au_report_connect() to rtl8xxxu_gen1_report_connect()

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

Rename the function to reflect it is for all/most gen1 parts.

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 0f2946d..a7f7031 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -8245,8 +8245,8 @@ static void rtl8xxxu_gen2_update_rate_mask(struct 
rtl8xxxu_priv *priv,
rtl8723a_h2c_cmd(priv, , sizeof(h2c.b_macid_cfg));
 }
 
-static void rtl8723au_report_connect(struct rtl8xxxu_priv *priv,
-u8 macid, bool connect)
+static void rtl8xxxu_gen1_report_connect(struct rtl8xxxu_priv *priv,
+u8 macid, bool connect)
 {
struct h2c_cmd h2c;
 
@@ -9886,7 +9886,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.usb_quirks = rtl8xxxu_gen1_usb_quirks,
.set_tx_power = rtl8723a_set_tx_power,
.update_rate_mask = rtl8723au_update_rate_mask,
-   .report_connect = rtl8723au_report_connect,
+   .report_connect = rtl8xxxu_gen1_report_connect,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
@@ -9958,7 +9958,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.usb_quirks = rtl8xxxu_gen1_usb_quirks,
.set_tx_power = rtl8723a_set_tx_power,
.update_rate_mask = rtl8723au_update_rate_mask,
-   .report_connect = rtl8723au_report_connect,
+   .report_connect = rtl8xxxu_gen1_report_connect,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT_0,
.mbox_ext_width = 2,
-- 
2.5.5

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


[PATCH 15/16] rtl8xxxu: Rename rtl8723bu_simularity_compare()

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

This renames rtl8723bu_simularity_compare() to
rtl8xxxu_gen2_simularity_compare() to reflect it is used for all gen2
parts.

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 22 ++
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index bec2c4d..240b361 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -4591,8 +4591,8 @@ static bool rtl8xxxu_simularity_compare(struct 
rtl8xxxu_priv *priv,
return false;
 }
 
-static bool rtl8723bu_simularity_compare(struct rtl8xxxu_priv *priv,
-int result[][8], int c1, int c2)
+static bool rtl8xxxu_gen2_simularity_compare(struct rtl8xxxu_priv *priv,
+int result[][8], int c1, int c2)
 {
u32 i, j, diff, simubitmap, bound = 0;
int candidate[2] = {-1, -1};/* for path A and path B */
@@ -6233,7 +6233,8 @@ static void rtl8723bu_phy_iq_calibrate(struct 
rtl8xxxu_priv *priv)
rtl8723bu_phy_iqcalibrate(priv, result, i);
 
if (i == 1) {
-   simu = rtl8723bu_simularity_compare(priv, result, 0, 1);
+   simu = rtl8xxxu_gen2_simularity_compare(priv,
+   result, 0, 1);
if (simu) {
candidate = 0;
break;
@@ -6241,13 +6242,15 @@ static void rtl8723bu_phy_iq_calibrate(struct 
rtl8xxxu_priv *priv)
}
 
if (i == 2) {
-   simu = rtl8723bu_simularity_compare(priv, result, 0, 2);
+   simu = rtl8xxxu_gen2_simularity_compare(priv,
+   result, 0, 2);
if (simu) {
candidate = 0;
break;
}
 
-   simu = rtl8723bu_simularity_compare(priv, result, 1, 2);
+   simu = rtl8xxxu_gen2_simularity_compare(priv,
+   result, 1, 2);
if (simu) {
candidate = 1;
} else {
@@ -6348,7 +6351,8 @@ static void rtl8192eu_phy_iq_calibrate(struct 
rtl8xxxu_priv *priv)
rtl8192eu_phy_iqcalibrate(priv, result, i);
 
if (i == 1) {
-   simu = rtl8723bu_simularity_compare(priv, result, 0, 1);
+   simu = rtl8xxxu_gen2_simularity_compare(priv,
+   result, 0, 1);
if (simu) {
candidate = 0;
break;
@@ -6356,13 +6360,15 @@ static void rtl8192eu_phy_iq_calibrate(struct 
rtl8xxxu_priv *priv)
}
 
if (i == 2) {
-   simu = rtl8723bu_simularity_compare(priv, result, 0, 2);
+   simu = rtl8xxxu_gen2_simularity_compare(priv,
+   result, 0, 2);
if (simu) {
candidate = 0;
break;
}
 
-   simu = rtl8723bu_simularity_compare(priv, result, 1, 2);
+   simu = rtl8xxxu_gen2_simularity_compare(priv,
+   result, 1, 2);
if (simu)
candidate = 1;
else
-- 
2.5.5

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


[PATCH 11/16] rtl8xxxu: Rename rtl8723a_set_tx_power() to rtl8xxxu_gen1_set_tx_power()

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

All gen1 parts use the same interface for setting TX power, so rename
the function to reflect this.

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 5c86965..1499aa0 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -2472,7 +2472,7 @@ static void rtl8xxxu_gen2_config_channel(struct 
ieee80211_hw *hw)
 }
 
 static void
-rtl8723a_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
+rtl8xxxu_gen1_set_tx_power(struct rtl8xxxu_priv *priv, int channel, bool ht40)
 {
struct rtl8xxxu_power_base *power_base = priv->power_base;
u8 cck[RTL8723A_MAX_RF_PATHS], ofdm[RTL8723A_MAX_RF_PATHS];
@@ -9884,7 +9884,7 @@ static struct rtl8xxxu_fileops rtl8723au_fops = {
.enable_rf = rtl8723a_enable_rf,
.disable_rf = rtl8xxxu_gen1_disable_rf,
.usb_quirks = rtl8xxxu_gen1_usb_quirks,
-   .set_tx_power = rtl8723a_set_tx_power,
+   .set_tx_power = rtl8xxxu_gen1_set_tx_power,
.update_rate_mask = rtl8xxxu_update_rate_mask,
.report_connect = rtl8xxxu_gen1_report_connect,
.writeN_block_size = 1024,
@@ -9956,7 +9956,7 @@ static struct rtl8xxxu_fileops rtl8192cu_fops = {
.enable_rf = rtl8723a_enable_rf,
.disable_rf = rtl8xxxu_gen1_disable_rf,
.usb_quirks = rtl8xxxu_gen1_usb_quirks,
-   .set_tx_power = rtl8723a_set_tx_power,
+   .set_tx_power = rtl8xxxu_gen1_set_tx_power,
.update_rate_mask = rtl8xxxu_update_rate_mask,
.report_connect = rtl8xxxu_gen1_report_connect,
.writeN_block_size = 128,
-- 
2.5.5

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


[PATCH 02/16] rtl8xxxu: Rename rtl8723bu_report_connect() to rtl8xxxu_gen2_report_connect()

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

Make the name reflect this is for most/all gen2 parts.

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 4ec18a4..0f2946d 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -8262,8 +8262,8 @@ static void rtl8723au_report_connect(struct rtl8xxxu_priv 
*priv,
rtl8723a_h2c_cmd(priv, , sizeof(h2c.joinbss));
 }
 
-static void rtl8723bu_report_connect(struct rtl8xxxu_priv *priv,
-u8 macid, bool connect)
+static void rtl8xxxu_gen2_report_connect(struct rtl8xxxu_priv *priv,
+u8 macid, bool connect)
 {
struct h2c_cmd h2c;
 
@@ -9922,7 +9922,7 @@ static struct rtl8xxxu_fileops rtl8723bu_fops = {
.usb_quirks = rtl8xxxu_gen2_usb_quirks,
.set_tx_power = rtl8723b_set_tx_power,
.update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
-   .report_connect = rtl8723bu_report_connect,
+   .report_connect = rtl8xxxu_gen2_report_connect,
.writeN_block_size = 1024,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
@@ -9993,7 +9993,7 @@ static struct rtl8xxxu_fileops rtl8192eu_fops = {
.usb_quirks = rtl8xxxu_gen2_usb_quirks,
.set_tx_power = rtl8192e_set_tx_power,
.update_rate_mask = rtl8xxxu_gen2_update_rate_mask,
-   .report_connect = rtl8723bu_report_connect,
+   .report_connect = rtl8xxxu_gen2_report_connect,
.writeN_block_size = 128,
.mbox_ext_reg = REG_HMBOX_EXT0_8723B,
.mbox_ext_width = 4,
-- 
2.5.5

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


[PATCH 16/16] rtl8xxxu: Rename rtl8723au_iqk_phy_iq_bb_reg

2016-04-18 Thread Jes . Sorensen
From: Jes Sorensen 

There is nothing 8723au specific about rtl8723au_iqk_phy_iq_bb_reg so
rename the array to rtl8xxxu_iqk_phy_iq_bb_reg.

Signed-off-by: Jes Sorensen 
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c 
b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
index 240b361..c48ca20 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
@@ -1743,7 +1743,7 @@ static struct rtl8xxxu_rfregs rtl8xxxu_rfregs[] = {
},
 };
 
-static const u32 rtl8723au_iqk_phy_iq_bb_reg[RTL8XXXU_BB_REGS] = {
+static const u32 rtl8xxxu_iqk_phy_iq_bb_reg[RTL8XXXU_BB_REGS] = {
REG_OFDM0_XA_RX_IQ_IMBALANCE,
REG_OFDM0_XB_RX_IQ_IMBALANCE,
REG_OFDM0_ENERGY_CCA_THRES,
@@ -6201,7 +6201,7 @@ static void rtl8xxxu_gen1_phy_iq_calibrate(struct 
rtl8xxxu_priv *priv)
rtl8xxxu_fill_iqk_matrix_b(priv, path_b_ok, result,
   candidate, (reg_ec4 == 0));
 
-   rtl8xxxu_save_regs(priv, rtl8723au_iqk_phy_iq_bb_reg,
+   rtl8xxxu_save_regs(priv, rtl8xxxu_iqk_phy_iq_bb_reg,
   priv->bb_recovery_backup, RTL8XXXU_BB_REGS);
 
rtl8xxxu_prepare_calibrate(priv, 0);
@@ -6309,7 +6309,7 @@ static void rtl8723bu_phy_iq_calibrate(struct 
rtl8xxxu_priv *priv)
rtl8xxxu_fill_iqk_matrix_b(priv, path_b_ok, result,
   candidate, (reg_ec4 == 0));
 
-   rtl8xxxu_save_regs(priv, rtl8723au_iqk_phy_iq_bb_reg,
+   rtl8xxxu_save_regs(priv, rtl8xxxu_iqk_phy_iq_bb_reg,
   priv->bb_recovery_backup, RTL8XXXU_BB_REGS);
 
rtl8xxxu_write32(priv, REG_BT_CONTROL_8723BU, bt_control);
@@ -6420,7 +6420,7 @@ static void rtl8192eu_phy_iq_calibrate(struct 
rtl8xxxu_priv *priv)
rtl8xxxu_fill_iqk_matrix_b(priv, path_b_ok, result,
   candidate, (reg_ec4 == 0));
 
-   rtl8xxxu_save_regs(priv, rtl8723au_iqk_phy_iq_bb_reg,
+   rtl8xxxu_save_regs(priv, rtl8xxxu_iqk_phy_iq_bb_reg,
   priv->bb_recovery_backup, RTL8XXXU_BB_REGS);
 }
 
-- 
2.5.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] carl9170: Clarify kconfig text

2016-04-18 Thread Kalle Valo
Lauri Kasanen  writes:

> The previous text was confusing, leading readers to think this
> driver was a duplicate, and so didn't need to be enabled.
>
> After the removal of the older staging driver, this is the only
> driver in mainline for these devices.
>
> Signed-off-by: Lauri Kasanen 
> ---
> v2: Remove the mention of the previous driver, suggested by Christian.
>
>  drivers/net/wireless/ath/carl9170/Kconfig | 8 +++-
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/carl9170/Kconfig 
> b/drivers/net/wireless/ath/carl9170/Kconfig
> index 1a796e5..2e34bae 100644
> --- a/drivers/net/wireless/ath/carl9170/Kconfig
> +++ b/drivers/net/wireless/ath/carl9170/Kconfig
> @@ -5,12 +5,10 @@ config CARL9170
>   select FW_LOADER
>   select CRC32
>   help
> -   This is another driver for the Atheros "otus" 802.11n USB devices.
> +   This is the mainline driver for the Atheros "otus" 802.11n USB 
> devices.
>  
> -   This driver provides more features than the original,
> -   but it needs a special firmware (carl9170-1.fw) to do that.
> -
> -   The firmware can be downloaded from our wiki here:
> +   It needs a special firmware (carl9170-1.fw), which can be downloaded
> +   from our wiki here:
> 

Why even mention anything about a "special firmware" as the firmware is
already available from linux-firmware.git? That's default location for
all firmware images and I think most, if not all, distros should have it
available. So wouldn't it be better not to mention anything about
firmware at all?

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


Re: [PATCH] ath9k: remove repetitions of mask array size

2016-04-18 Thread Kalle Valo
Oleksij Rempel  writes:

> Kalle should be in CC.

Actually no need, CCing me is useless as I use patchwork. Most important
is that the patch is submitted to linux-wireless from where patchwork
picks it up.

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


Re: [PATCHv2] wlcore: spi: add wl18xx support

2016-04-18 Thread Arnd Bergmann
On Monday 18 April 2016 05:55:51 Reizer, Eyal wrote:
> > >
> > > - all wilink family needs special init command for entering wspi mode.
> > >   extra clock cycles should be sent after the spi init command while the
> > >   cs pin is high.
> > > - switch to controling the cs pin from the spi driver for achieveing the
> > >   above.
> > > - the selected cs gpio is read from the spi device-tree node using the
> > >   cs-gpios field and setup as a gpio.
> > > - See the example below for specifying the cs gpio using the cs-gpios 
> > > entry
> > >{
> > > ...
> > > cs-gpios = < 5 0>;
> > > ...
> > > wlcore: wlcore@0 {
> > > compatible = "ti,wl1835";
> > > ...
> > > ...
> > > };
> > > };
> > >
> > > Signed-off-by: Eyal Reizer 
> > 
> > I don't think this can work in general: not all SPI hosts uses GPIOs for
> > controlling CS, so the logic can't work, and it's also a layering violation 
> > for the
> > driver to look at the parent.
> > 
> > I would suggest fixing this using a new API function from the SPI core, if 
> > we
> > don't already have a generic way to do it.
> >
> Originally this is what I have done until I was pointed to the generic 
> cs-gpio mechanism 
> in the SPI core. 
> It is a generic mechanism already in the SPI core driver.
> See: Documentation/devicetree/bindings/spi/spi-bus.txt

The cs-gpios property is documented as optional, it defines how you should
list the gpios if CS is implemented using gpio, but not all hardware does
it like this.

> It is also part of the generic spi.h (include/Linux/spi/spi.h), already part 
> of 
> " struct spi_device" So it seemed redundant adding another mechanism for 
> implementing the same.
> Platform that interact with a wilink need to use it, and platforms that don't 
>  
> have this capability will probably not interact with a wilink device using 
> SPI.

The cs_gpio field in spi_device belongs to the spi host controller, no other
slave driver uses it.

I wasn't asking for a duplication of this mechanism, but an interface to
use it properly. Internally, the spi core uses the spi_set_cs() function to
pick a CS. Find a way to use that rather than reimplementing it incorrectly.

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


[PATCH] mwifiex: stop background scan when net device closed

2016-04-18 Thread Amitkumar Karwar
From: Xinming Hu 

Transmit data path should not touch background scan. We will stop
background scan when net device is closed.

Signed-off-by: Xinming Hu 
Signed-off-by: Amitkumar Karwar 
---
 drivers/net/wireless/marvell/mwifiex/main.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/main.c 
b/drivers/net/wireless/marvell/mwifiex/main.c
index b459c70..8b67a55 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.c
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
@@ -702,6 +702,13 @@ mwifiex_close(struct net_device *dev)
priv->scan_aborting = true;
}
 
+   if (priv->sched_scanning) {
+   mwifiex_dbg(priv->adapter, INFO,
+   "aborting bgscan on ndo_stop\n");
+   mwifiex_stop_bg_scan(priv);
+   cfg80211_sched_scan_stopped(priv->wdev.wiphy);
+   }
+
return 0;
 }
 
@@ -753,13 +760,6 @@ int mwifiex_queue_tx_pkt(struct mwifiex_private *priv, 
struct sk_buff *skb)
 
mwifiex_queue_main_work(priv->adapter);
 
-   if (priv->sched_scanning) {
-   mwifiex_dbg(priv->adapter, INFO,
-   "aborting bgscan on ndo_stop\n");
-   mwifiex_stop_bg_scan(priv);
-   cfg80211_sched_scan_stopped(priv->wdev.wiphy);
-   }
-
return 0;
 }
 
-- 
1.8.1.4

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


Re: [Codel] [PATCHv3 2/5] mac80211: implement fair queueing per txq

2016-04-18 Thread Michal Kazior
On 18 April 2016 at 14:31, Eric Dumazet  wrote:
> On Mon, 2016-04-18 at 07:16 +0200, Michal Kazior wrote:
>
>>
>> I guess .h file can give the compiler an opportunity for more
>> optimizations. With .c you would need LTO which I'm not sure if it's
>> available everywhere.
>>
>
> This makes little sense really. Otherwise everything would be in .h
> files.
>
> include/net/codel.h is an include file because both codel and fq_codel
> use a common template for codel_dequeue() in fast path.
>
> But net/mac80211/fq.h is included once, so should be a .c

FWIW cfg80211 drivers might become another user of the fq/codel stuff
in the future.

Arguably I should make include/net/codel.h not be qdisc specific as it
is now (and hence re-usable by mac80211) and submit fq.h to
include/net/. Would that be better (it'll probably take a lot longer
to propagate over trees, no?)


>
> Certainly all the code in control plan is not fast path and does not
> deserve being duplicated.

Good point. The fq init/reset stuff is probably a good example.

However if I were to put fq.h into include/net/ where should I put the
init/reset stuff then? net/core/?


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: [PATCHv3 4/5] mac80211: implement codel on fair queuing flows

2016-04-18 Thread Michal Kazior
On 18 April 2016 at 07:31, Michal Kazior  wrote:
> On 17 April 2016 at 00:29, Johannes Berg  wrote:
>> On Thu, 2016-04-14 at 14:18 +0200, Michal Kazior wrote:
>>>
>>> + struct ieee80211_vif *vif;
>>> +
>>> + /* When packets are enqueued on txq
>>> it's easy
>>> +  * to re-construct the vif pointer.
>>> There's no
>>> +  * more space in tx_info so it can
>>> be used to
>>> +  * store the necessary enqueue time
>>> for packet
>>> +  * sojourn time computation.
>>> +  */
>>> + u64 enqueue_time;
>>> + };
>>
>> I wonder if we could move something like the hw_key into tx_control
>> instead?
>
> Hmm.. It's probably doable. From a quick look it'll require quite some
> change here and there (e.g. tdls_channel_switch op will need to be
> extended to pass tx_control). I'll play with the idea..

This is actually far more than I thought initially. A lot of drivers
(b43, b43legacy, rtlwifi, wl, cw1200) access hw_key outside of tx
op context (tx workers, tx completions). I'm not even sure this is
safe (keys can be freed in the meantime by mac80211 hence invaliding
the pointer inside skb, no?).


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


Re: [Codel] [PATCHv3 2/5] mac80211: implement fair queueing per txq

2016-04-18 Thread Eric Dumazet
On Mon, 2016-04-18 at 07:16 +0200, Michal Kazior wrote:

> 
> I guess .h file can give the compiler an opportunity for more
> optimizations. With .c you would need LTO which I'm not sure if it's
> available everywhere.
> 

This makes little sense really. Otherwise everything would be in .h
files.

include/net/codel.h is an include file because both codel and fq_codel
use a common template for codel_dequeue() in fast path.

But net/mac80211/fq.h is included once, so should be a .c

Certainly all the code in control plan is not fast path and does not
deserve being duplicated.



--
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 v7 1/2] dt: bindings: add MARVELL's sd8xxx wireless device

2016-04-18 Thread Amitkumar Karwar
From: Xinming Hu 

Add device tree binding documentation for MARVELL's sd8xxx
(sd8897 and sd8997) wlan chip.

Signed-off-by: Xinming Hu 
Signed-off-by: Amitkumar Karwar 
---
Listing changelist for both 1/2 and 2/2 patches
v3: Don't update adapter->dt_node if mwifiex_plt_dev is NULL

v4: a)Corrected the 'name' and 'compatible' property names.(Arnd Bergmann and 
Rob
Herring)
b)Patch description wraped in 72 columns(Rob Herring)
c)Moved DT binding file to bindings/net/wireless/(Rob Herring)
d)Renamed "mwifiex,chip-gpio" to "marvell,wakeup-gpios"(Rob Herring/
Arnd Bergmann)
e)Replaced #ifdef with __maybe_unused(Arnd Bergmann)

v5: a)Removed wildcards from compatible string(Arnd Bergmann)
b)Prepared single patch for all binding changes(Rob Herring)
c)Specified our node as a subnode of SDIO controller. With this approach, we
don't need to register new platform driver. (Rob herring)

v6: a)List out the specific property names for marvell,caldata* and size of the 
data(Rob Herring)
b)Use sdio function number for both the unit address and reg(Rob Herring)

v7: a)Use suggested specific marvell,caldata property name and generic node 
name(Rob Herring)
---
 .../bindings/net/wireless/marvell-sd8xxx.txt   | 63 ++
 1 file changed, 63 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/net/wireless/marvell-sd8xxx.txt

diff --git a/Documentation/devicetree/bindings/net/wireless/marvell-sd8xxx.txt 
b/Documentation/devicetree/bindings/net/wireless/marvell-sd8xxx.txt
new file mode 100644
index 000..c421aba
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/wireless/marvell-sd8xxx.txt
@@ -0,0 +1,63 @@
+Marvell 8897/8997 (sd8897/sd8997) SDIO devices
+--
+
+This node provides properties for controlling the marvell sdio wireless device.
+The node is expected to be specified as a child node to the SDIO controller 
that
+connects the device to the system.
+
+Required properties:
+
+  - compatible : should be one of the following:
+   * "marvell,sd8897"
+   * "marvell,sd8997"
+
+Optional properties:
+
+  - marvell,caldata* : A series of properties with marvell,caldata prefix,
+ represent calibration data downloaded to the device during
+ initialization. This is an array of unsigned 8-bit values.
+ the properties should follow below property name and
+ corresponding array length:
+   "marvell,caldata-txpwrlimit-2g" (length = 566).
+   "marvell,caldata-txpwrlimit-5g-sub0" (length = 502).
+   "marvell,caldata-txpwrlimit-5g-sub1" (length = 688).
+   "marvell,caldata-txpwrlimit-5g-sub2" (length = 750).
+   "marvell,caldata-txpwrlimit-5g-sub3" (length = 502).
+  - marvell,wakeup-pin : a wakeup pin number of wifi chip which will be 
configured
+ to firmware. Firmware will wakeup the host using this pin
+ during suspend/resume.
+  - interrupt-parent: phandle of the parent interrupt controller
+  - interrupts : interrupt pin number to the cpu. driver will request an irq 
based on
+this interrupt number. during system suspend, the irq will be 
enabled
+so that the wifi chip can wakeup host platform under certain 
condition.
+during system resume, the irq will be disabled to make sure
+unnecessary interrupt is not received.
+
+Example:
+
+Tx power limit calibration data is configured in below example.
+The calibration data is an array of unsigned values, the length
+can vary between hw versions.
+IRQ pin 38 is used as system wakeup source interrupt. wakeup pin 3 is 
configured
+so that firmware can wakeup host using this device side pin.
+
+ {
+   status = "okay";
+   vmmc-supply = <_en_reg>;
+   bus-width = <4>;
+   cap-power-off-card;
+   keep-power-in-suspend;
+
+   #address-cells = <1>;
+   #size-cells = <0>;
+   mwifiex: wifi@1 {
+   compatible = "marvell,sd8897";
+   reg = <1>;
+   interrupt-parent = <>;
+   interrupts = <38 IRQ_TYPE_LEVEL_LOW>;
+
+   marvell,caldata_00_txpwrlimit_2g_cfg_set = /bits/ 8 <
+   0x01 0x00 0x06 0x00 0x08 0x02 0x89 0x01>;
+   marvell,wakeup-pin = <3>;
+   };
+};
-- 
1.8.1.4

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


[PATCH v7 2/2] mwifiex: add platform specific wakeup interrupt support

2016-04-18 Thread Amitkumar Karwar
From: Xinming Hu 

On some arm-based platforms, we need to configure platform specific
parameters by device tree node and also define our node as a child
node of parent SDIO host controller.
This patch parses these parameters from device tree. It includes
calibration data dowoload to firmware, wakeup pin configured to firmware,
and soc specific wake up gpio, which will be set as wakeup interrupt pin.

Signed-off-by: Xinming Hu 
Signed-off-by: Amitkumar Karwar 
---
 drivers/net/wireless/marvell/mwifiex/main.h| 11 
 drivers/net/wireless/marvell/mwifiex/sdio.c| 77 ++
 drivers/net/wireless/marvell/mwifiex/sdio.h|  7 +++
 drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 14 -
 4 files changed, 106 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/main.h 
b/drivers/net/wireless/marvell/mwifiex/main.h
index 63069dd..4c742a5 100644
--- a/drivers/net/wireless/marvell/mwifiex/main.h
+++ b/drivers/net/wireless/marvell/mwifiex/main.h
@@ -37,6 +37,17 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
 
 #include "decl.h"
 #include "ioctl.h"
diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c 
b/drivers/net/wireless/marvell/mwifiex/sdio.c
index a0aec3e..cbd9dcd 100644
--- a/drivers/net/wireless/marvell/mwifiex/sdio.c
+++ b/drivers/net/wireless/marvell/mwifiex/sdio.c
@@ -73,6 +73,66 @@ static struct memory_type_mapping mem_type_mapping_tbl[] = {
{"EXTLAST", NULL, 0, 0xFE},
 };
 
+static const struct of_device_id mwifiex_sdio_of_match_table[] = {
+   { .compatible = "marvell,sd8897" },
+   { .compatible = "marvell,sd8997" },
+   { }
+};
+
+static irqreturn_t mwifiex_wake_irq_wifi(int irq, void *priv)
+{
+   struct mwifiex_plt_wake_cfg *cfg = priv;
+
+   if (cfg->irq_wifi >= 0) {
+   pr_info("%s: wake by wifi", __func__);
+   cfg->wake_by_wifi = true;
+   disable_irq_nosync(irq);
+   }
+
+   return IRQ_HANDLED;
+}
+
+/* This function parse device tree node using mmc subnode devicetree API.
+ * The device node is saved in card->plt_of_node.
+ * if the device tree node exist and include interrupts attributes, this
+ * function will also request platform specific wakeup interrupt.
+ */
+static int mwifiex_sdio_probe_of(struct device *dev, struct sdio_mmc_card 
*card)
+{
+   struct mwifiex_plt_wake_cfg *cfg;
+   int ret;
+
+   if (!dev->of_node ||
+   !of_match_node(mwifiex_sdio_of_match_table, dev->of_node)) {
+   pr_err("sdio platform data not available");
+   return -1;
+   }
+
+   card->plt_of_node = dev->of_node;
+   card->plt_wake_cfg = devm_kzalloc(dev, sizeof(*card->plt_wake_cfg),
+ GFP_KERNEL);
+   cfg = card->plt_wake_cfg;
+   if (cfg && card->plt_of_node) {
+   cfg->irq_wifi = irq_of_parse_and_map(card->plt_of_node, 0);
+   if (!cfg->irq_wifi) {
+   dev_err(dev, "fail to parse irq_wifi from device tree");
+   } else {
+   ret = devm_request_irq(dev, cfg->irq_wifi,
+  mwifiex_wake_irq_wifi,
+  IRQF_TRIGGER_LOW,
+  "wifi_wake", cfg);
+   if (ret) {
+   dev_err(dev,
+   "Failed to request irq_wifi %d (%d)\n",
+   cfg->irq_wifi, ret);
+   }
+   disable_irq(cfg->irq_wifi);
+   }
+   }
+
+   return 0;
+}
+
 /*
  * SDIO probe.
  *
@@ -127,6 +187,9 @@ mwifiex_sdio_probe(struct sdio_func *func, const struct 
sdio_device_id *id)
return -EIO;
}
 
+   /* device tree node parsing and platform specific configuration*/
+   mwifiex_sdio_probe_of(>dev, card);
+
if (mwifiex_add_card(card, _remove_card_sem, _ops,
 MWIFIEX_SDIO)) {
pr_err("%s: add card failed\n", __func__);
@@ -183,6 +246,13 @@ static int mwifiex_sdio_resume(struct device *dev)
mwifiex_cancel_hs(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA),
  MWIFIEX_SYNC_CMD);
 
+   /* Disable platform specific wakeup interrupt */
+   if (card->plt_wake_cfg && card->plt_wake_cfg->irq_wifi >= 0) {
+   disable_irq_wake(card->plt_wake_cfg->irq_wifi);
+   if (!card->plt_wake_cfg->wake_by_wifi)
+   disable_irq(card->plt_wake_cfg->irq_wifi);
+   }
+
return 0;
 }
 
@@ -262,6 +332,13 @@ static int mwifiex_sdio_suspend(struct device *dev)
 
adapter = card->adapter;
 
+   /* Enable platform specific wakeup 

Re: [PATCH v2] qcom: ipq4019: add wifi nodes to ipq4019 SoC device tree

2016-04-18 Thread Tamizh chelvam

On 2016-04-13 23:26, Stephen Boyd wrote:

On 04/11/2016 09:18 PM, tamizhchel...@codeaurora.org wrote:

+   qcom,msi_addr = <0x0b006040>;
+   qcom,msi_base = <0x50>;


Are these properties used? I couldn't find any usage in the driver but 
I

may have missed it.


As of now it is not used in the driver. But it will be needed in the 
future to enable msi in ipq4019 platform.


Thanks,
Tamizh.
--
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: add extap functionality

2016-04-18 Thread Michal Kazior
On 17 February 2016 at 17:55, Felix Fietkau  wrote:
> On 2016-02-17 12:55, Grzegorz Bajorski wrote:
>> Client interface briding was only possible when 4addr frames were used with
>> a 4addr/WDS aware AP. It was not possible to do it otherwise due to 3addr
>> frame limitation.
>>
>> The extap logic introduces a smart MAC address masking/translation
>> (including modyfing packets beyond SA/DA, e.g. DHCP broadcast flag is set).
>>
>> There are still some unsolved problems and bugs:
>>  - due to bridge port routing and sk_buff payload sharing skb_copy() is
>>performed; this ideally should be reworked
>>  - ipv6 support is still not finished
>>  - extap is enabled by default currently; it should be configurable via
>>nl80211 the same way 4addr is
>>
>> There's also an idea to move this as a generic link driver (just like
>> macvlan, et al) which would allow unmodified cfg80211 drivers to enjoy the
>> extap functionality. Thoughts?
>>
>> Note: This changes cfg80211 file in this single patch only for reviewing
>> convienence.
>>
>> This is an early draft to solicit comments on the design.
>>
>> Signed-off-by: Grzegorz Bajorski 
> You can get a lot of the same effect (sharing the same subnet between
> hosts behind multiple interfaces and having forwarding between them)
> without any changes to mac80211.
>
> OpenWrt uses a daemon called 'relayd' which I wrote some years ago. It
> does ARP translation, DHCP packet mangling and sets up policy routing to
> forward packets between multiple interfaces.
>
> You can find it here:
> http://git.openwrt.org/?p=project/relayd.git;a=summary
> git://git.openwrt.org/project/relayd.git
>
> Since you can cover the same use cases with user space code, I don't
> think it's a good idea to put bridge emulation hacks in the kernel's
> wireless stack.

You can't really implement complete IPv6 support in relayd though.
Link-local routing is forbidden by the spec explicitly and a patch
I've cooked up was rejected[1].

I guess this leaves either the kernel's wireless stack to take up the
task or a special link device (for which I'm soliciting feedback now
[2]).

Thoughts?


[1]: http://marc.info/?l=linux-netdev=146084698311664=2
[2]: http://marc.info/?l=linux-netdev=146097234002385=2


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


IMPORTANT MAIL TO YOU

2016-04-18 Thread verifelaw
I am Capt. Lawrence Tyman, an officer in US Army,and also a West Point
Graduate, serving in the Military with the 82nd Air Borne Division
Peace keeping force deployed from Afganistan to Syria.  
We were moved to Syria from Iraq as the last batch just left,and i
really need your help in assisting me with the safe keeping of 1 military
trunk box contain funds amount of $10.2M which i secured on a raiding we 
carried out in 
January in one of the chief Syrian IsIs base which i headed the squard as the 
Captain.  With every possible arrangement to lift this box out, is intended to 
arrive 
Belgium from there a diplomat will deliver it to your designated location
I hope you can be trusted? You will be rewarded handsomely if you could help
me secure the funds until I conclude my service here in 3 month to meet you 
while we can 
plan head to head on a good and profitable business or company i can invest my 
funds in your country.
If you can be trusted and willing to support me in securing this safely kindly 
indicate 
by Letting me know this (1) Your name (2) Your address (3) Age (4) Occupation 
and 
i will explain further when i get a response from you
kindly contact me in this my private email address below: lawrencety...@gmx.com

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


Re: [PATCH v4] cfg80211/nl80211: Add support for NL80211_STA_INFO_RX_DURATION

2016-04-18 Thread Mohammed Shafi Shajakhan
On Thu, Apr 14, 2016 at 10:59:36AM +0200, Johannes Berg wrote:
> On Thu, 2016-04-07 at 19:59 +0530, Mohammed Shafi Shajakhan wrote:
> > From: Mohammed Shafi Shajakhan 
> > 
> > Add support for new netlink attribute 'NL80211_STA_INFO_RX_DURATION'.
> > 'NL80211_STA_INFO_RX_DURATION' accounts for aggregate PPDU duration
> > in microseconds for all the frames from a peer. Drivers can fill
> > 'rx_duration' field and set the flag 'NL80211_STA_INFO_RX_DURATION'.
> > 'rx_duration' will give an idea about the total time spent by our
> > peer
> > with each of its connected peers.
> > 
> > Also extend 'PUT_SINFO' for supporting rx_duration field
> > 
> Applied, with some minor changes.
>
[shafi] thank you for accepting this change Johannes.

regards,
shafi
--
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