All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/8] add beacon and htt msg support for 10.4 firmware
@ 2015-06-22 14:52 ` Raja Mani
  0 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

This is the continuation of earlier patch set posted for adding 10.4 wmi support.
This patch series covers following items w.r.t 10.4 firmware,

        - Enhance existing swba event handler to handle variable size tim bitmap
          and add support to handle 10.4 swba event.
        - Enable pdev, vdev, peer related wmi operations like create, delete, etc.
        - Includes scan support.
        - Add 10.4 specific htt msg.
        - Advertise 10.4 iface combination to mac80211.
        - Adjust max ss and initialize continuous frag descriptor memory

v2 changes:
       - rebased on top of "introduce wmi support for qca99x0" patch series.
       - updated htt msg definitions as per stable 10.4 firmware.
       - synced scan related info as per stable 10.4 firmware.

Raja Mani (8):
  ath10k: enhance swba event handler to adapt different size tim bitmap
  ath10k: handle 10.4 firmware wmi swba event
  ath10k: enable vdev and peer related operations for 10.4 fw
  ath10k: add scan support for 10.4 fw
  ath10k: add 10.4 fw specific htt msg definitions
  ath10k: advertise 10.4 fw ap and sta iface combination to mac80211
  ath10k: set max spatial stream to 4 for 10.4 fw
  ath10k: configure frag desc memory to target for qca99X0

 drivers/net/wireless/ath/ath10k/core.c    |   8 ++
 drivers/net/wireless/ath/ath10k/core.h    |  11 +-
 drivers/net/wireless/ath/ath10k/htt.c     |  45 ++++++
 drivers/net/wireless/ath/ath10k/htt.h     |  47 +++++++
 drivers/net/wireless/ath/ath10k/htt_rx.c  |   4 +
 drivers/net/wireless/ath/ath10k/htt_tx.c  |  76 ++++++++++-
 drivers/net/wireless/ath/ath10k/hw.h      |   2 +
 drivers/net/wireless/ath/ath10k/mac.c     |  30 ++++
 drivers/net/wireless/ath/ath10k/wmi-tlv.c |  18 ++-
 drivers/net/wireless/ath/ath10k/wmi.c     | 220 +++++++++++++++++++++++++++---
 drivers/net/wireless/ath/ath10k/wmi.h     |  90 ++++++++++--
 11 files changed, 519 insertions(+), 32 deletions(-)

-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH v2 0/8] add beacon and htt msg support for 10.4 firmware
@ 2015-06-22 14:52 ` Raja Mani
  0 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

This is the continuation of earlier patch set posted for adding 10.4 wmi support.
This patch series covers following items w.r.t 10.4 firmware,

        - Enhance existing swba event handler to handle variable size tim bitmap
          and add support to handle 10.4 swba event.
        - Enable pdev, vdev, peer related wmi operations like create, delete, etc.
        - Includes scan support.
        - Add 10.4 specific htt msg.
        - Advertise 10.4 iface combination to mac80211.
        - Adjust max ss and initialize continuous frag descriptor memory

v2 changes:
       - rebased on top of "introduce wmi support for qca99x0" patch series.
       - updated htt msg definitions as per stable 10.4 firmware.
       - synced scan related info as per stable 10.4 firmware.

Raja Mani (8):
  ath10k: enhance swba event handler to adapt different size tim bitmap
  ath10k: handle 10.4 firmware wmi swba event
  ath10k: enable vdev and peer related operations for 10.4 fw
  ath10k: add scan support for 10.4 fw
  ath10k: add 10.4 fw specific htt msg definitions
  ath10k: advertise 10.4 fw ap and sta iface combination to mac80211
  ath10k: set max spatial stream to 4 for 10.4 fw
  ath10k: configure frag desc memory to target for qca99X0

 drivers/net/wireless/ath/ath10k/core.c    |   8 ++
 drivers/net/wireless/ath/ath10k/core.h    |  11 +-
 drivers/net/wireless/ath/ath10k/htt.c     |  45 ++++++
 drivers/net/wireless/ath/ath10k/htt.h     |  47 +++++++
 drivers/net/wireless/ath/ath10k/htt_rx.c  |   4 +
 drivers/net/wireless/ath/ath10k/htt_tx.c  |  76 ++++++++++-
 drivers/net/wireless/ath/ath10k/hw.h      |   2 +
 drivers/net/wireless/ath/ath10k/mac.c     |  30 ++++
 drivers/net/wireless/ath/ath10k/wmi-tlv.c |  18 ++-
 drivers/net/wireless/ath/ath10k/wmi.c     | 220 +++++++++++++++++++++++++++---
 drivers/net/wireless/ath/ath10k/wmi.h     |  90 ++++++++++--
 11 files changed, 519 insertions(+), 32 deletions(-)

-- 
1.8.1.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH v2 1/8] ath10k: enhance swba event handler to adapt different size tim bitmap
  2015-06-22 14:52 ` Raja Mani
@ 2015-06-22 14:52   ` Raja Mani
  -1 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

Due to 512 client support in 10.4 firmware, size of tim ie is going
to be slightly higher than non 10.4 firmware. So, size of tim_bitmap
what is carried in swba event from 10.4 firmware is bit higher.

The only bottle neck to reuse existing swba handler
ath10k_wmi_event_host_swba() for 10.4 is that code designed to deal
with fixed size tim bitmap(ie, tim_info[].tim_bitmap in wmi_swba_ev_arg).
This patch removes such size limitation and makes it more suitable
to handle swba event which has different size tim bitmap.

All existing swba event parsing functions are changed to adapt this
change. Actual support to handle 10.4 swba event is added in next patch.
Only preparation is made in this patch.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 18 +++++++++++-
 drivers/net/wireless/ath/ath10k/wmi.c     | 49 +++++++++++++++++++++++--------
 drivers/net/wireless/ath/ath10k/wmi.h     | 10 ++++++-
 3 files changed, 62 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index 620b37b..ced35a1 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -709,6 +709,8 @@ static int ath10k_wmi_tlv_swba_tim_parse(struct ath10k *ar, u16 tag, u16 len,
 					 const void *ptr, void *data)
 {
 	struct wmi_tlv_swba_parse *swba = data;
+	struct wmi_tim_info_arg *tim_info_arg;
+	const struct wmi_tim_info *tim_info_ev = ptr;
 
 	if (tag != WMI_TLV_TAG_STRUCT_TIM_INFO)
 		return -EPROTO;
@@ -716,7 +718,21 @@ static int ath10k_wmi_tlv_swba_tim_parse(struct ath10k *ar, u16 tag, u16 len,
 	if (swba->n_tim >= ARRAY_SIZE(swba->arg->tim_info))
 		return -ENOBUFS;
 
-	swba->arg->tim_info[swba->n_tim++] = ptr;
+	if (__le32_to_cpu(tim_info_ev->tim_len) >
+	     sizeof(tim_info_ev->tim_bitmap)) {
+		ath10k_warn(ar, "refusing to parse invalid swba structure\n");
+		return -EPROTO;
+	}
+
+	tim_info_arg = &swba->arg->tim_info[swba->n_tim];
+	tim_info_arg->tim_len = tim_info_ev->tim_len;
+	tim_info_arg->tim_mcast = tim_info_ev->tim_mcast;
+	tim_info_arg->tim_bitmap = tim_info_ev->tim_bitmap;
+	tim_info_arg->tim_changed = tim_info_ev->tim_changed;
+	tim_info_arg->tim_num_ps_pending = tim_info_ev->tim_num_ps_pending;
+
+	swba->n_tim++;
+
 	return 0;
 }
 
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 271ad2f..d6a3ff2 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -2874,33 +2874,38 @@ exit:
 static void ath10k_wmi_update_tim(struct ath10k *ar,
 				  struct ath10k_vif *arvif,
 				  struct sk_buff *bcn,
-				  const struct wmi_tim_info *tim_info)
+				  const struct wmi_tim_info_arg *tim_info)
 {
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)bcn->data;
 	struct ieee80211_tim_ie *tim;
 	u8 *ies, *ie;
 	u8 ie_len, pvm_len;
 	__le32 t;
-	u32 v;
+	u32 v, tim_len;
+
+	/* When FW reports 0 in tim_len, ensure atleast first byte
+	 * in tim_bitmap is considered for pvm calculation.
+	 */
+	tim_len = tim_info->tim_len ? __le32_to_cpu(tim_info->tim_len) : 1;
 
 	/* if next SWBA has no tim_changed the tim_bitmap is garbage.
 	 * we must copy the bitmap upon change and reuse it later */
 	if (__le32_to_cpu(tim_info->tim_changed)) {
 		int i;
 
-		BUILD_BUG_ON(sizeof(arvif->u.ap.tim_bitmap) !=
-			     sizeof(tim_info->tim_bitmap));
+		WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
 
-		for (i = 0; i < sizeof(arvif->u.ap.tim_bitmap); i++) {
+		for (i = 0; i < tim_len; i++) {
 			t = tim_info->tim_bitmap[i / 4];
 			v = __le32_to_cpu(t);
 			arvif->u.ap.tim_bitmap[i] = (v >> ((i % 4) * 8)) & 0xFF;
 		}
 
-		/* FW reports either length 0 or 16
-		 * so we calculate this on our own */
+		/* FW reports either length 0 or length based on max supported
+		 * station. so we calculate this on our own
+		 */
 		arvif->u.ap.tim_len = 0;
-		for (i = 0; i < sizeof(arvif->u.ap.tim_bitmap); i++)
+		for (i = 0; i < tim_len; i++)
 			if (arvif->u.ap.tim_bitmap[i])
 				arvif->u.ap.tim_len = i;
 
@@ -2924,7 +2929,7 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,
 	pvm_len = ie_len - 3; /* exclude dtim count, dtim period, bmap ctl */
 
 	if (pvm_len < arvif->u.ap.tim_len) {
-		int expand_size = sizeof(arvif->u.ap.tim_bitmap) - pvm_len;
+		int expand_size = tim_len - pvm_len;
 		int move_size = skb_tail_pointer(bcn) - (ie + 2 + ie_len);
 		void *next_ie = ie + 2 + ie_len;
 
@@ -2939,7 +2944,7 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,
 		}
 	}
 
-	if (pvm_len > sizeof(arvif->u.ap.tim_bitmap)) {
+	if (pvm_len > tim_len) {
 		ath10k_warn(ar, "tim pvm length is too great (%d)\n", pvm_len);
 		return;
 	}
@@ -3003,7 +3008,21 @@ static int ath10k_wmi_op_pull_swba_ev(struct ath10k *ar, struct sk_buff *skb,
 		if (WARN_ON_ONCE(i == ARRAY_SIZE(arg->tim_info)))
 			break;
 
-		arg->tim_info[i] = &ev->bcn_info[i].tim_info;
+		if (__le32_to_cpu(ev->bcn_info[i].tim_info.tim_len) >
+		     sizeof(ev->bcn_info[i].tim_info.tim_bitmap)) {
+			ath10k_warn(ar, "refusing to parse invalid swba structure\n");
+			return -EPROTO;
+		}
+
+		arg->tim_info[i].tim_len = ev->bcn_info[i].tim_info.tim_len;
+		arg->tim_info[i].tim_mcast = ev->bcn_info[i].tim_info.tim_mcast;
+		arg->tim_info[i].tim_bitmap =
+				ev->bcn_info[i].tim_info.tim_bitmap;
+		arg->tim_info[i].tim_changed =
+				ev->bcn_info[i].tim_info.tim_changed;
+		arg->tim_info[i].tim_num_ps_pending =
+				ev->bcn_info[i].tim_info.tim_num_ps_pending;
+
 		arg->noa_info[i] = &ev->bcn_info[i].p2p_noa_info;
 		i++;
 	}
@@ -3016,7 +3035,7 @@ void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb)
 	struct wmi_swba_ev_arg arg = {};
 	u32 map;
 	int i = -1;
-	const struct wmi_tim_info *tim_info;
+	const struct wmi_tim_info_arg *tim_info;
 	const struct wmi_p2p_noa_info *noa_info;
 	struct ath10k_vif *arvif;
 	struct sk_buff *bcn;
@@ -3045,7 +3064,7 @@ void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb)
 			break;
 		}
 
-		tim_info = arg.tim_info[i];
+		tim_info = &arg.tim_info[i];
 		noa_info = arg.noa_info[i];
 
 		ath10k_dbg(ar, ATH10K_DBG_MGMT,
@@ -3060,6 +3079,10 @@ void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb)
 			   __le32_to_cpu(tim_info->tim_bitmap[1]),
 			   __le32_to_cpu(tim_info->tim_bitmap[0]));
 
+		/* TODO: Only first 4 word from tim_bitmap is dumped.
+		 * Extend debug code to dump full tim_bitmap.
+		 */
+
 		arvif = ath10k_get_arvif(ar, vdev_id);
 		if (arvif == NULL) {
 			ath10k_warn(ar, "no vif for vdev_id %d found\n",
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index b1e4932..7c4a15f 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -5160,6 +5160,14 @@ struct wmi_tim_info {
 	__le32 tim_num_ps_pending;
 } __packed;
 
+struct wmi_tim_info_arg {
+	__le32 tim_len;
+	__le32 tim_mcast;
+	const __le32 *tim_bitmap;
+	__le32 tim_changed;
+	__le32 tim_num_ps_pending;
+} __packed;
+
 /* Maximum number of NOA Descriptors supported */
 #define WMI_P2P_MAX_NOA_DESCRIPTORS 4
 #define WMI_P2P_OPPPS_ENABLE_BIT	BIT(0)
@@ -5710,7 +5718,7 @@ struct wmi_peer_kick_ev_arg {
 
 struct wmi_swba_ev_arg {
 	__le32 vdev_map;
-	const struct wmi_tim_info *tim_info[WMI_MAX_AP_VDEV];
+	struct wmi_tim_info_arg tim_info[WMI_MAX_AP_VDEV];
 	const struct wmi_p2p_noa_info *noa_info[WMI_MAX_AP_VDEV];
 };
 
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 1/8] ath10k: enhance swba event handler to adapt different size tim bitmap
@ 2015-06-22 14:52   ` Raja Mani
  0 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

Due to 512 client support in 10.4 firmware, size of tim ie is going
to be slightly higher than non 10.4 firmware. So, size of tim_bitmap
what is carried in swba event from 10.4 firmware is bit higher.

The only bottle neck to reuse existing swba handler
ath10k_wmi_event_host_swba() for 10.4 is that code designed to deal
with fixed size tim bitmap(ie, tim_info[].tim_bitmap in wmi_swba_ev_arg).
This patch removes such size limitation and makes it more suitable
to handle swba event which has different size tim bitmap.

All existing swba event parsing functions are changed to adapt this
change. Actual support to handle 10.4 swba event is added in next patch.
Only preparation is made in this patch.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 18 +++++++++++-
 drivers/net/wireless/ath/ath10k/wmi.c     | 49 +++++++++++++++++++++++--------
 drivers/net/wireless/ath/ath10k/wmi.h     | 10 ++++++-
 3 files changed, 62 insertions(+), 15 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index 620b37b..ced35a1 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -709,6 +709,8 @@ static int ath10k_wmi_tlv_swba_tim_parse(struct ath10k *ar, u16 tag, u16 len,
 					 const void *ptr, void *data)
 {
 	struct wmi_tlv_swba_parse *swba = data;
+	struct wmi_tim_info_arg *tim_info_arg;
+	const struct wmi_tim_info *tim_info_ev = ptr;
 
 	if (tag != WMI_TLV_TAG_STRUCT_TIM_INFO)
 		return -EPROTO;
@@ -716,7 +718,21 @@ static int ath10k_wmi_tlv_swba_tim_parse(struct ath10k *ar, u16 tag, u16 len,
 	if (swba->n_tim >= ARRAY_SIZE(swba->arg->tim_info))
 		return -ENOBUFS;
 
-	swba->arg->tim_info[swba->n_tim++] = ptr;
+	if (__le32_to_cpu(tim_info_ev->tim_len) >
+	     sizeof(tim_info_ev->tim_bitmap)) {
+		ath10k_warn(ar, "refusing to parse invalid swba structure\n");
+		return -EPROTO;
+	}
+
+	tim_info_arg = &swba->arg->tim_info[swba->n_tim];
+	tim_info_arg->tim_len = tim_info_ev->tim_len;
+	tim_info_arg->tim_mcast = tim_info_ev->tim_mcast;
+	tim_info_arg->tim_bitmap = tim_info_ev->tim_bitmap;
+	tim_info_arg->tim_changed = tim_info_ev->tim_changed;
+	tim_info_arg->tim_num_ps_pending = tim_info_ev->tim_num_ps_pending;
+
+	swba->n_tim++;
+
 	return 0;
 }
 
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 271ad2f..d6a3ff2 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -2874,33 +2874,38 @@ exit:
 static void ath10k_wmi_update_tim(struct ath10k *ar,
 				  struct ath10k_vif *arvif,
 				  struct sk_buff *bcn,
-				  const struct wmi_tim_info *tim_info)
+				  const struct wmi_tim_info_arg *tim_info)
 {
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)bcn->data;
 	struct ieee80211_tim_ie *tim;
 	u8 *ies, *ie;
 	u8 ie_len, pvm_len;
 	__le32 t;
-	u32 v;
+	u32 v, tim_len;
+
+	/* When FW reports 0 in tim_len, ensure atleast first byte
+	 * in tim_bitmap is considered for pvm calculation.
+	 */
+	tim_len = tim_info->tim_len ? __le32_to_cpu(tim_info->tim_len) : 1;
 
 	/* if next SWBA has no tim_changed the tim_bitmap is garbage.
 	 * we must copy the bitmap upon change and reuse it later */
 	if (__le32_to_cpu(tim_info->tim_changed)) {
 		int i;
 
-		BUILD_BUG_ON(sizeof(arvif->u.ap.tim_bitmap) !=
-			     sizeof(tim_info->tim_bitmap));
+		WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
 
-		for (i = 0; i < sizeof(arvif->u.ap.tim_bitmap); i++) {
+		for (i = 0; i < tim_len; i++) {
 			t = tim_info->tim_bitmap[i / 4];
 			v = __le32_to_cpu(t);
 			arvif->u.ap.tim_bitmap[i] = (v >> ((i % 4) * 8)) & 0xFF;
 		}
 
-		/* FW reports either length 0 or 16
-		 * so we calculate this on our own */
+		/* FW reports either length 0 or length based on max supported
+		 * station. so we calculate this on our own
+		 */
 		arvif->u.ap.tim_len = 0;
-		for (i = 0; i < sizeof(arvif->u.ap.tim_bitmap); i++)
+		for (i = 0; i < tim_len; i++)
 			if (arvif->u.ap.tim_bitmap[i])
 				arvif->u.ap.tim_len = i;
 
@@ -2924,7 +2929,7 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,
 	pvm_len = ie_len - 3; /* exclude dtim count, dtim period, bmap ctl */
 
 	if (pvm_len < arvif->u.ap.tim_len) {
-		int expand_size = sizeof(arvif->u.ap.tim_bitmap) - pvm_len;
+		int expand_size = tim_len - pvm_len;
 		int move_size = skb_tail_pointer(bcn) - (ie + 2 + ie_len);
 		void *next_ie = ie + 2 + ie_len;
 
@@ -2939,7 +2944,7 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,
 		}
 	}
 
-	if (pvm_len > sizeof(arvif->u.ap.tim_bitmap)) {
+	if (pvm_len > tim_len) {
 		ath10k_warn(ar, "tim pvm length is too great (%d)\n", pvm_len);
 		return;
 	}
@@ -3003,7 +3008,21 @@ static int ath10k_wmi_op_pull_swba_ev(struct ath10k *ar, struct sk_buff *skb,
 		if (WARN_ON_ONCE(i == ARRAY_SIZE(arg->tim_info)))
 			break;
 
-		arg->tim_info[i] = &ev->bcn_info[i].tim_info;
+		if (__le32_to_cpu(ev->bcn_info[i].tim_info.tim_len) >
+		     sizeof(ev->bcn_info[i].tim_info.tim_bitmap)) {
+			ath10k_warn(ar, "refusing to parse invalid swba structure\n");
+			return -EPROTO;
+		}
+
+		arg->tim_info[i].tim_len = ev->bcn_info[i].tim_info.tim_len;
+		arg->tim_info[i].tim_mcast = ev->bcn_info[i].tim_info.tim_mcast;
+		arg->tim_info[i].tim_bitmap =
+				ev->bcn_info[i].tim_info.tim_bitmap;
+		arg->tim_info[i].tim_changed =
+				ev->bcn_info[i].tim_info.tim_changed;
+		arg->tim_info[i].tim_num_ps_pending =
+				ev->bcn_info[i].tim_info.tim_num_ps_pending;
+
 		arg->noa_info[i] = &ev->bcn_info[i].p2p_noa_info;
 		i++;
 	}
@@ -3016,7 +3035,7 @@ void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb)
 	struct wmi_swba_ev_arg arg = {};
 	u32 map;
 	int i = -1;
-	const struct wmi_tim_info *tim_info;
+	const struct wmi_tim_info_arg *tim_info;
 	const struct wmi_p2p_noa_info *noa_info;
 	struct ath10k_vif *arvif;
 	struct sk_buff *bcn;
@@ -3045,7 +3064,7 @@ void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb)
 			break;
 		}
 
-		tim_info = arg.tim_info[i];
+		tim_info = &arg.tim_info[i];
 		noa_info = arg.noa_info[i];
 
 		ath10k_dbg(ar, ATH10K_DBG_MGMT,
@@ -3060,6 +3079,10 @@ void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb)
 			   __le32_to_cpu(tim_info->tim_bitmap[1]),
 			   __le32_to_cpu(tim_info->tim_bitmap[0]));
 
+		/* TODO: Only first 4 word from tim_bitmap is dumped.
+		 * Extend debug code to dump full tim_bitmap.
+		 */
+
 		arvif = ath10k_get_arvif(ar, vdev_id);
 		if (arvif == NULL) {
 			ath10k_warn(ar, "no vif for vdev_id %d found\n",
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index b1e4932..7c4a15f 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -5160,6 +5160,14 @@ struct wmi_tim_info {
 	__le32 tim_num_ps_pending;
 } __packed;
 
+struct wmi_tim_info_arg {
+	__le32 tim_len;
+	__le32 tim_mcast;
+	const __le32 *tim_bitmap;
+	__le32 tim_changed;
+	__le32 tim_num_ps_pending;
+} __packed;
+
 /* Maximum number of NOA Descriptors supported */
 #define WMI_P2P_MAX_NOA_DESCRIPTORS 4
 #define WMI_P2P_OPPPS_ENABLE_BIT	BIT(0)
@@ -5710,7 +5718,7 @@ struct wmi_peer_kick_ev_arg {
 
 struct wmi_swba_ev_arg {
 	__le32 vdev_map;
-	const struct wmi_tim_info *tim_info[WMI_MAX_AP_VDEV];
+	struct wmi_tim_info_arg tim_info[WMI_MAX_AP_VDEV];
 	const struct wmi_p2p_noa_info *noa_info[WMI_MAX_AP_VDEV];
 };
 
-- 
1.8.1.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 2/8] ath10k: handle 10.4 firmware wmi swba event
  2015-06-22 14:52 ` Raja Mani
@ 2015-06-22 14:52   ` Raja Mani
  -1 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

10.4 firmware swba event payload has space to accommodate upto
512 client traffic indication info & one p2p noa descriptor.
It's is not matching with exiting swba event format defined for
non 10.4 firmware. Non 10.4 firmware swba event format is designed
to support only upto only 128 client and four p2p notice of absence
descriptor.

following changes are done in this patch to enable ath10k to handle
10.4 firmware swba event,

 - link generic ath10k_wmi_event_host_swba() to handle 10.4 swba
   event in 10.4 wmi rx handler.

 - add 10.4 specific swba event structure wmi_10_4_host_swba_event.

 - new function ath10k_wmi_10_4_op_pull_swba_ev() to parse
   10.4 swba event.

 - increase tim_bitmap[] size in ath10k_vif to 64 to hold 512 station
   power save state.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/core.h |  4 +--
 drivers/net/wireless/ath/ath10k/wmi.c  | 61 ++++++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath10k/wmi.h  | 41 +++++++++++++++++++++++
 3 files changed, 104 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 58b02ae..86c4015 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -328,8 +328,8 @@ struct ath10k_vif {
 			u32 uapsd;
 		} sta;
 		struct {
-			/* 127 stations; wmi limit */
-			u8 tim_bitmap[16];
+			/* 512 stations */
+			u8 tim_bitmap[64];
 			u8 tim_len;
 			u32 ssid_len;
 			u8 ssid[IEEE80211_MAX_SSID_LEN];
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index d6a3ff2..48ea442 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -3030,6 +3030,63 @@ static int ath10k_wmi_op_pull_swba_ev(struct ath10k *ar, struct sk_buff *skb,
 	return 0;
 }
 
+static int ath10k_wmi_10_4_op_pull_swba_ev(struct ath10k *ar,
+					   struct sk_buff *skb,
+					   struct wmi_swba_ev_arg *arg)
+{
+	struct wmi_10_4_host_swba_event *ev = (void *)skb->data;
+	u32 map, tim_len;
+	size_t i;
+
+	if (skb->len < sizeof(*ev))
+		return -EPROTO;
+
+	skb_pull(skb, sizeof(*ev));
+	arg->vdev_map = ev->vdev_map;
+
+	for (i = 0, map = __le32_to_cpu(ev->vdev_map); map; map >>= 1) {
+		if (!(map & BIT(0)))
+			continue;
+
+		/* If this happens there were some changes in firmware and
+		 * ath10k should update the max size of tim_info array.
+		 */
+		if (WARN_ON_ONCE(i == ARRAY_SIZE(arg->tim_info)))
+			break;
+
+		if (__le32_to_cpu(ev->bcn_info[i].tim_info.tim_len) >
+		      sizeof(ev->bcn_info[i].tim_info.tim_bitmap)) {
+			ath10k_warn(ar, "refusing to parse invalid swba structure\n");
+			return -EPROTO;
+		}
+
+		tim_len = __le32_to_cpu(ev->bcn_info[i].tim_info.tim_len);
+		if (tim_len) {
+			/* Exclude 4 byte guard length */
+			tim_len -= 4;
+			arg->tim_info[i].tim_len = __cpu_to_le32(tim_len);
+		} else {
+			arg->tim_info[i].tim_len = 0;
+		}
+
+		arg->tim_info[i].tim_mcast = ev->bcn_info[i].tim_info.tim_mcast;
+		arg->tim_info[i].tim_bitmap =
+				ev->bcn_info[i].tim_info.tim_bitmap;
+		arg->tim_info[i].tim_changed =
+				ev->bcn_info[i].tim_info.tim_changed;
+		arg->tim_info[i].tim_num_ps_pending =
+				ev->bcn_info[i].tim_info.tim_num_ps_pending;
+
+		/* 10.4 firmware doesn't have p2p support. notice of absence
+		 * info can be ignored for now.
+		 */
+
+		i++;
+	}
+
+	return 0;
+}
+
 void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb)
 {
 	struct wmi_swba_ev_arg arg = {};
@@ -4364,6 +4421,9 @@ static void ath10k_wmi_10_4_op_rx(struct ath10k *ar, struct sk_buff *skb)
 	case WMI_10_4_READY_EVENTID:
 		ath10k_wmi_event_ready(ar, skb);
 		break;
+	case WMI_10_4_HOST_SWBA_EVENTID:
+		ath10k_wmi_event_host_swba(ar, skb);
+		break;
 	default:
 		ath10k_warn(ar, "Unknown eventid: %d\n", id);
 		break;
@@ -6295,6 +6355,7 @@ static const struct wmi_ops wmi_10_4_ops = {
 	.rx = ath10k_wmi_10_4_op_rx,
 	.map_svc = wmi_10_4_svc_map,
 	.pull_mgmt_rx = ath10k_wmi_10_4_op_pull_mgmt_rx_ev,
+	.pull_swba = ath10k_wmi_10_4_op_pull_swba_ev,
 	.pull_svc_rdy = ath10k_wmi_main_op_pull_svc_rdy_ev,
 	.pull_rdy = ath10k_wmi_op_pull_rdy_ev,
 	.gen_init = ath10k_wmi_10_4_op_gen_init,
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 7c4a15f..395742d 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -5199,6 +5199,47 @@ struct wmi_host_swba_event {
 	struct wmi_bcn_info bcn_info[0];
 } __packed;
 
+/* 16 words = 512 client + 1 word = for guard */
+#define WMI_10_4_TIM_BITMAP_ARRAY_SIZE 17
+
+struct wmi_10_4_tim_info {
+	__le32 tim_len;
+	__le32 tim_mcast;
+	__le32 tim_bitmap[WMI_10_4_TIM_BITMAP_ARRAY_SIZE];
+	__le32 tim_changed;
+	__le32 tim_num_ps_pending;
+} __packed;
+
+#define WMI_10_4_P2P_MAX_NOA_DESCRIPTORS 1
+
+struct wmi_10_4_p2p_noa_info {
+	/* Bit 0 - Flag to indicate an update in NOA schedule
+	 * Bits 7-1 - Reserved
+	 */
+	u8 changed;
+	/* NOA index */
+	u8 index;
+	/* Bit 0 - Opp PS state of the AP
+	 * Bits 1-7 - Ctwindow in TUs
+	 */
+	u8 ctwindow_oppps;
+	/* Number of NOA descriptors */
+	u8 num_descriptors;
+
+	struct wmi_p2p_noa_descriptor
+		noa_descriptors[WMI_10_4_P2P_MAX_NOA_DESCRIPTORS];
+} __packed;
+
+struct wmi_10_4_bcn_info {
+	struct wmi_10_4_tim_info tim_info;
+	struct wmi_10_4_p2p_noa_info p2p_noa_info;
+} __packed;
+
+struct wmi_10_4_host_swba_event {
+	__le32 vdev_map;
+	struct wmi_10_4_bcn_info bcn_info[0];
+} __packed;
+
 #define WMI_MAX_AP_VDEV 16
 
 struct wmi_tbtt_offset_event {
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 2/8] ath10k: handle 10.4 firmware wmi swba event
@ 2015-06-22 14:52   ` Raja Mani
  0 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

10.4 firmware swba event payload has space to accommodate upto
512 client traffic indication info & one p2p noa descriptor.
It's is not matching with exiting swba event format defined for
non 10.4 firmware. Non 10.4 firmware swba event format is designed
to support only upto only 128 client and four p2p notice of absence
descriptor.

following changes are done in this patch to enable ath10k to handle
10.4 firmware swba event,

 - link generic ath10k_wmi_event_host_swba() to handle 10.4 swba
   event in 10.4 wmi rx handler.

 - add 10.4 specific swba event structure wmi_10_4_host_swba_event.

 - new function ath10k_wmi_10_4_op_pull_swba_ev() to parse
   10.4 swba event.

 - increase tim_bitmap[] size in ath10k_vif to 64 to hold 512 station
   power save state.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/core.h |  4 +--
 drivers/net/wireless/ath/ath10k/wmi.c  | 61 ++++++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath10k/wmi.h  | 41 +++++++++++++++++++++++
 3 files changed, 104 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 58b02ae..86c4015 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -328,8 +328,8 @@ struct ath10k_vif {
 			u32 uapsd;
 		} sta;
 		struct {
-			/* 127 stations; wmi limit */
-			u8 tim_bitmap[16];
+			/* 512 stations */
+			u8 tim_bitmap[64];
 			u8 tim_len;
 			u32 ssid_len;
 			u8 ssid[IEEE80211_MAX_SSID_LEN];
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index d6a3ff2..48ea442 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -3030,6 +3030,63 @@ static int ath10k_wmi_op_pull_swba_ev(struct ath10k *ar, struct sk_buff *skb,
 	return 0;
 }
 
+static int ath10k_wmi_10_4_op_pull_swba_ev(struct ath10k *ar,
+					   struct sk_buff *skb,
+					   struct wmi_swba_ev_arg *arg)
+{
+	struct wmi_10_4_host_swba_event *ev = (void *)skb->data;
+	u32 map, tim_len;
+	size_t i;
+
+	if (skb->len < sizeof(*ev))
+		return -EPROTO;
+
+	skb_pull(skb, sizeof(*ev));
+	arg->vdev_map = ev->vdev_map;
+
+	for (i = 0, map = __le32_to_cpu(ev->vdev_map); map; map >>= 1) {
+		if (!(map & BIT(0)))
+			continue;
+
+		/* If this happens there were some changes in firmware and
+		 * ath10k should update the max size of tim_info array.
+		 */
+		if (WARN_ON_ONCE(i == ARRAY_SIZE(arg->tim_info)))
+			break;
+
+		if (__le32_to_cpu(ev->bcn_info[i].tim_info.tim_len) >
+		      sizeof(ev->bcn_info[i].tim_info.tim_bitmap)) {
+			ath10k_warn(ar, "refusing to parse invalid swba structure\n");
+			return -EPROTO;
+		}
+
+		tim_len = __le32_to_cpu(ev->bcn_info[i].tim_info.tim_len);
+		if (tim_len) {
+			/* Exclude 4 byte guard length */
+			tim_len -= 4;
+			arg->tim_info[i].tim_len = __cpu_to_le32(tim_len);
+		} else {
+			arg->tim_info[i].tim_len = 0;
+		}
+
+		arg->tim_info[i].tim_mcast = ev->bcn_info[i].tim_info.tim_mcast;
+		arg->tim_info[i].tim_bitmap =
+				ev->bcn_info[i].tim_info.tim_bitmap;
+		arg->tim_info[i].tim_changed =
+				ev->bcn_info[i].tim_info.tim_changed;
+		arg->tim_info[i].tim_num_ps_pending =
+				ev->bcn_info[i].tim_info.tim_num_ps_pending;
+
+		/* 10.4 firmware doesn't have p2p support. notice of absence
+		 * info can be ignored for now.
+		 */
+
+		i++;
+	}
+
+	return 0;
+}
+
 void ath10k_wmi_event_host_swba(struct ath10k *ar, struct sk_buff *skb)
 {
 	struct wmi_swba_ev_arg arg = {};
@@ -4364,6 +4421,9 @@ static void ath10k_wmi_10_4_op_rx(struct ath10k *ar, struct sk_buff *skb)
 	case WMI_10_4_READY_EVENTID:
 		ath10k_wmi_event_ready(ar, skb);
 		break;
+	case WMI_10_4_HOST_SWBA_EVENTID:
+		ath10k_wmi_event_host_swba(ar, skb);
+		break;
 	default:
 		ath10k_warn(ar, "Unknown eventid: %d\n", id);
 		break;
@@ -6295,6 +6355,7 @@ static const struct wmi_ops wmi_10_4_ops = {
 	.rx = ath10k_wmi_10_4_op_rx,
 	.map_svc = wmi_10_4_svc_map,
 	.pull_mgmt_rx = ath10k_wmi_10_4_op_pull_mgmt_rx_ev,
+	.pull_swba = ath10k_wmi_10_4_op_pull_swba_ev,
 	.pull_svc_rdy = ath10k_wmi_main_op_pull_svc_rdy_ev,
 	.pull_rdy = ath10k_wmi_op_pull_rdy_ev,
 	.gen_init = ath10k_wmi_10_4_op_gen_init,
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 7c4a15f..395742d 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -5199,6 +5199,47 @@ struct wmi_host_swba_event {
 	struct wmi_bcn_info bcn_info[0];
 } __packed;
 
+/* 16 words = 512 client + 1 word = for guard */
+#define WMI_10_4_TIM_BITMAP_ARRAY_SIZE 17
+
+struct wmi_10_4_tim_info {
+	__le32 tim_len;
+	__le32 tim_mcast;
+	__le32 tim_bitmap[WMI_10_4_TIM_BITMAP_ARRAY_SIZE];
+	__le32 tim_changed;
+	__le32 tim_num_ps_pending;
+} __packed;
+
+#define WMI_10_4_P2P_MAX_NOA_DESCRIPTORS 1
+
+struct wmi_10_4_p2p_noa_info {
+	/* Bit 0 - Flag to indicate an update in NOA schedule
+	 * Bits 7-1 - Reserved
+	 */
+	u8 changed;
+	/* NOA index */
+	u8 index;
+	/* Bit 0 - Opp PS state of the AP
+	 * Bits 1-7 - Ctwindow in TUs
+	 */
+	u8 ctwindow_oppps;
+	/* Number of NOA descriptors */
+	u8 num_descriptors;
+
+	struct wmi_p2p_noa_descriptor
+		noa_descriptors[WMI_10_4_P2P_MAX_NOA_DESCRIPTORS];
+} __packed;
+
+struct wmi_10_4_bcn_info {
+	struct wmi_10_4_tim_info tim_info;
+	struct wmi_10_4_p2p_noa_info p2p_noa_info;
+} __packed;
+
+struct wmi_10_4_host_swba_event {
+	__le32 vdev_map;
+	struct wmi_10_4_bcn_info bcn_info[0];
+} __packed;
+
 #define WMI_MAX_AP_VDEV 16
 
 struct wmi_tbtt_offset_event {
-- 
1.8.1.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 3/8] ath10k: enable vdev and peer related operations for 10.4 fw
  2015-06-22 14:52 ` Raja Mani
@ 2015-06-22 14:52   ` Raja Mani
  -1 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

Most of existing vdev and peer related functions (vdev create,
vdev delete, vdev start, peer create, peer delete, peer flush, etc)
are reusable for 10.4 firmware. Link those general vdev and peer
functions to 10.4 wmi function table.

Existing general pktlog enable/disable, dbglog configuration functions
are reusable for 10.4 and add them also in wmi function table.

Also handle few wmi events (sevice rdy, echo, dbg msg, tbtt offset
update, dbg print) in ath10k_wmi_10_4_op_rx(). wow event is not
applicable in 10.4 firmware, have it under not implemented print.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/wmi.c | 62 +++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 48ea442..c4d777d 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -4418,12 +4418,40 @@ static void ath10k_wmi_10_4_op_rx(struct ath10k *ar, struct sk_buff *skb)
 		ath10k_wmi_event_mgmt_rx(ar, skb);
 		/* mgmt_rx() owns the skb now! */
 		return;
+	case WMI_10_4_ECHO_EVENTID:
+		ath10k_wmi_event_echo(ar, skb);
+		break;
+	case WMI_10_4_DEBUG_MESG_EVENTID:
+		ath10k_wmi_event_debug_mesg(ar, skb);
+		break;
+	case WMI_10_4_SERVICE_READY_EVENTID:
+		ath10k_wmi_event_service_ready(ar, skb);
+		break;
 	case WMI_10_4_READY_EVENTID:
 		ath10k_wmi_event_ready(ar, skb);
 		break;
+	case WMI_10_4_PEER_STA_KICKOUT_EVENTID:
+		ath10k_wmi_event_peer_sta_kickout(ar, skb);
+		break;
 	case WMI_10_4_HOST_SWBA_EVENTID:
 		ath10k_wmi_event_host_swba(ar, skb);
 		break;
+	case WMI_10_4_TBTTOFFSET_UPDATE_EVENTID:
+		ath10k_wmi_event_tbttoffset_update(ar, skb);
+		break;
+	case WMI_10_4_DEBUG_PRINT_EVENTID:
+		ath10k_wmi_event_debug_print(ar, skb);
+		break;
+	case WMI_10_4_VDEV_START_RESP_EVENTID:
+		ath10k_wmi_event_vdev_start_resp(ar, skb);
+		break;
+	case WMI_10_4_VDEV_STOPPED_EVENTID:
+		ath10k_wmi_event_vdev_stopped(ar, skb);
+		break;
+	case WMI_10_4_WOW_WAKEUP_HOST_EVENTID:
+		ath10k_dbg(ar, ATH10K_DBG_WMI,
+			   "received event id %d not implemented\n", id);
+		break;
 	default:
 		ath10k_warn(ar, "Unknown eventid: %d\n", id);
 		break;
@@ -6355,10 +6383,44 @@ static const struct wmi_ops wmi_10_4_ops = {
 	.rx = ath10k_wmi_10_4_op_rx,
 	.map_svc = wmi_10_4_svc_map,
 	.pull_mgmt_rx = ath10k_wmi_10_4_op_pull_mgmt_rx_ev,
+	.pull_vdev_start = ath10k_wmi_op_pull_vdev_start_ev,
+	.pull_peer_kick = ath10k_wmi_op_pull_peer_kick_ev,
 	.pull_swba = ath10k_wmi_10_4_op_pull_swba_ev,
 	.pull_svc_rdy = ath10k_wmi_main_op_pull_svc_rdy_ev,
 	.pull_rdy = ath10k_wmi_op_pull_rdy_ev,
+
+	.gen_pdev_suspend = ath10k_wmi_op_gen_pdev_suspend,
+	.gen_pdev_resume = ath10k_wmi_op_gen_pdev_resume,
+	.gen_pdev_set_rd = ath10k_wmi_10x_op_gen_pdev_set_rd,
+	.gen_pdev_set_param = ath10k_wmi_op_gen_pdev_set_param,
 	.gen_init = ath10k_wmi_10_4_op_gen_init,
+	.gen_vdev_create = ath10k_wmi_op_gen_vdev_create,
+	.gen_vdev_delete = ath10k_wmi_op_gen_vdev_delete,
+	.gen_vdev_start = ath10k_wmi_op_gen_vdev_start,
+	.gen_vdev_stop = ath10k_wmi_op_gen_vdev_stop,
+	.gen_vdev_up = ath10k_wmi_op_gen_vdev_up,
+	.gen_vdev_down = ath10k_wmi_op_gen_vdev_down,
+	.gen_vdev_set_param = ath10k_wmi_op_gen_vdev_set_param,
+	.gen_vdev_install_key = ath10k_wmi_op_gen_vdev_install_key,
+	.gen_peer_create = ath10k_wmi_op_gen_peer_create,
+	.gen_peer_delete = ath10k_wmi_op_gen_peer_delete,
+	.gen_peer_flush = ath10k_wmi_op_gen_peer_flush,
+	.gen_peer_set_param = ath10k_wmi_op_gen_peer_set_param,
+	.gen_set_psmode = ath10k_wmi_op_gen_set_psmode,
+	.gen_set_sta_ps = ath10k_wmi_op_gen_set_sta_ps,
+	.gen_set_ap_ps = ath10k_wmi_op_gen_set_ap_ps,
+	.gen_scan_chan_list = ath10k_wmi_op_gen_scan_chan_list,
+	.gen_beacon_dma = ath10k_wmi_op_gen_beacon_dma,
+	.gen_pdev_set_wmm = ath10k_wmi_op_gen_pdev_set_wmm,
+	.gen_force_fw_hang = ath10k_wmi_op_gen_force_fw_hang,
+	.gen_mgmt_tx = ath10k_wmi_op_gen_mgmt_tx,
+	.gen_dbglog_cfg = ath10k_wmi_op_gen_dbglog_cfg,
+	.gen_pktlog_enable = ath10k_wmi_op_gen_pktlog_enable,
+	.gen_pktlog_disable = ath10k_wmi_op_gen_pktlog_disable,
+	.gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
+
+	/* shared with 10.2 */
+	.gen_peer_assoc = ath10k_wmi_10_2_op_gen_peer_assoc,
 };
 
 int ath10k_wmi_attach(struct ath10k *ar)
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 3/8] ath10k: enable vdev and peer related operations for 10.4 fw
@ 2015-06-22 14:52   ` Raja Mani
  0 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

Most of existing vdev and peer related functions (vdev create,
vdev delete, vdev start, peer create, peer delete, peer flush, etc)
are reusable for 10.4 firmware. Link those general vdev and peer
functions to 10.4 wmi function table.

Existing general pktlog enable/disable, dbglog configuration functions
are reusable for 10.4 and add them also in wmi function table.

Also handle few wmi events (sevice rdy, echo, dbg msg, tbtt offset
update, dbg print) in ath10k_wmi_10_4_op_rx(). wow event is not
applicable in 10.4 firmware, have it under not implemented print.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/wmi.c | 62 +++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index 48ea442..c4d777d 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -4418,12 +4418,40 @@ static void ath10k_wmi_10_4_op_rx(struct ath10k *ar, struct sk_buff *skb)
 		ath10k_wmi_event_mgmt_rx(ar, skb);
 		/* mgmt_rx() owns the skb now! */
 		return;
+	case WMI_10_4_ECHO_EVENTID:
+		ath10k_wmi_event_echo(ar, skb);
+		break;
+	case WMI_10_4_DEBUG_MESG_EVENTID:
+		ath10k_wmi_event_debug_mesg(ar, skb);
+		break;
+	case WMI_10_4_SERVICE_READY_EVENTID:
+		ath10k_wmi_event_service_ready(ar, skb);
+		break;
 	case WMI_10_4_READY_EVENTID:
 		ath10k_wmi_event_ready(ar, skb);
 		break;
+	case WMI_10_4_PEER_STA_KICKOUT_EVENTID:
+		ath10k_wmi_event_peer_sta_kickout(ar, skb);
+		break;
 	case WMI_10_4_HOST_SWBA_EVENTID:
 		ath10k_wmi_event_host_swba(ar, skb);
 		break;
+	case WMI_10_4_TBTTOFFSET_UPDATE_EVENTID:
+		ath10k_wmi_event_tbttoffset_update(ar, skb);
+		break;
+	case WMI_10_4_DEBUG_PRINT_EVENTID:
+		ath10k_wmi_event_debug_print(ar, skb);
+		break;
+	case WMI_10_4_VDEV_START_RESP_EVENTID:
+		ath10k_wmi_event_vdev_start_resp(ar, skb);
+		break;
+	case WMI_10_4_VDEV_STOPPED_EVENTID:
+		ath10k_wmi_event_vdev_stopped(ar, skb);
+		break;
+	case WMI_10_4_WOW_WAKEUP_HOST_EVENTID:
+		ath10k_dbg(ar, ATH10K_DBG_WMI,
+			   "received event id %d not implemented\n", id);
+		break;
 	default:
 		ath10k_warn(ar, "Unknown eventid: %d\n", id);
 		break;
@@ -6355,10 +6383,44 @@ static const struct wmi_ops wmi_10_4_ops = {
 	.rx = ath10k_wmi_10_4_op_rx,
 	.map_svc = wmi_10_4_svc_map,
 	.pull_mgmt_rx = ath10k_wmi_10_4_op_pull_mgmt_rx_ev,
+	.pull_vdev_start = ath10k_wmi_op_pull_vdev_start_ev,
+	.pull_peer_kick = ath10k_wmi_op_pull_peer_kick_ev,
 	.pull_swba = ath10k_wmi_10_4_op_pull_swba_ev,
 	.pull_svc_rdy = ath10k_wmi_main_op_pull_svc_rdy_ev,
 	.pull_rdy = ath10k_wmi_op_pull_rdy_ev,
+
+	.gen_pdev_suspend = ath10k_wmi_op_gen_pdev_suspend,
+	.gen_pdev_resume = ath10k_wmi_op_gen_pdev_resume,
+	.gen_pdev_set_rd = ath10k_wmi_10x_op_gen_pdev_set_rd,
+	.gen_pdev_set_param = ath10k_wmi_op_gen_pdev_set_param,
 	.gen_init = ath10k_wmi_10_4_op_gen_init,
+	.gen_vdev_create = ath10k_wmi_op_gen_vdev_create,
+	.gen_vdev_delete = ath10k_wmi_op_gen_vdev_delete,
+	.gen_vdev_start = ath10k_wmi_op_gen_vdev_start,
+	.gen_vdev_stop = ath10k_wmi_op_gen_vdev_stop,
+	.gen_vdev_up = ath10k_wmi_op_gen_vdev_up,
+	.gen_vdev_down = ath10k_wmi_op_gen_vdev_down,
+	.gen_vdev_set_param = ath10k_wmi_op_gen_vdev_set_param,
+	.gen_vdev_install_key = ath10k_wmi_op_gen_vdev_install_key,
+	.gen_peer_create = ath10k_wmi_op_gen_peer_create,
+	.gen_peer_delete = ath10k_wmi_op_gen_peer_delete,
+	.gen_peer_flush = ath10k_wmi_op_gen_peer_flush,
+	.gen_peer_set_param = ath10k_wmi_op_gen_peer_set_param,
+	.gen_set_psmode = ath10k_wmi_op_gen_set_psmode,
+	.gen_set_sta_ps = ath10k_wmi_op_gen_set_sta_ps,
+	.gen_set_ap_ps = ath10k_wmi_op_gen_set_ap_ps,
+	.gen_scan_chan_list = ath10k_wmi_op_gen_scan_chan_list,
+	.gen_beacon_dma = ath10k_wmi_op_gen_beacon_dma,
+	.gen_pdev_set_wmm = ath10k_wmi_op_gen_pdev_set_wmm,
+	.gen_force_fw_hang = ath10k_wmi_op_gen_force_fw_hang,
+	.gen_mgmt_tx = ath10k_wmi_op_gen_mgmt_tx,
+	.gen_dbglog_cfg = ath10k_wmi_op_gen_dbglog_cfg,
+	.gen_pktlog_enable = ath10k_wmi_op_gen_pktlog_enable,
+	.gen_pktlog_disable = ath10k_wmi_op_gen_pktlog_disable,
+	.gen_pdev_set_quiet_mode = ath10k_wmi_op_gen_pdev_set_quiet_mode,
+
+	/* shared with 10.2 */
+	.gen_peer_assoc = ath10k_wmi_10_2_op_gen_peer_assoc,
 };
 
 int ath10k_wmi_attach(struct ath10k *ar)
-- 
1.8.1.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 4/8] ath10k: add scan support for 10.4 fw
  2015-06-22 14:52 ` Raja Mani
@ 2015-06-22 14:52   ` Raja Mani
  -1 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

Existing non 10.4 firmware scan related events and commands are
matching with 10.4 firmware (except chan info event). Link general
start scan,stop scan, scan channel list configuration functions
to 10.4 wmi function table and add a new handler to parse 10.4
specific chan info event.

10.4 firmware has extra scan completion reason
WMI_SCAN_REASON_INTERNAL_FAILURE and new scan event
WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT compared to previous firmware
versions. These things are added in respective enum.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
v2 changes:
 - WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT is added newly.
 - BIT() macro is used to define the values of "enum wmi_scan_event_type"
 - New member rx_frame_count is added in struct wmi_10_4_chan_info_event

 drivers/net/wireless/ath/ath10k/wmi.c | 42 +++++++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath10k/wmi.h | 36 ++++++++++++++++++++++--------
 2 files changed, 69 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index c4d777d..fffdae1 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1923,6 +1923,8 @@ ath10k_wmi_event_scan_type_str(enum wmi_scan_event_type type,
 			return "completed [preempted]";
 		case WMI_SCAN_REASON_TIMEDOUT:
 			return "completed [timedout]";
+		case WMI_SCAN_REASON_INTERNAL_FAILURE:
+			return "completed [internal err]";
 		case WMI_SCAN_REASON_MAX:
 			break;
 		}
@@ -1937,6 +1939,10 @@ ath10k_wmi_event_scan_type_str(enum wmi_scan_event_type type,
 		return "preempted";
 	case WMI_SCAN_EVENT_START_FAILED:
 		return "start failed";
+	case WMI_SCAN_EVENT_RESTARTED:
+		return "restarted";
+	case WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT:
+		return "foreign channel exit";
 	default:
 		return "unknown";
 	}
@@ -2012,6 +2018,8 @@ int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb)
 		break;
 	case WMI_SCAN_EVENT_DEQUEUED:
 	case WMI_SCAN_EVENT_PREEMPTED:
+	case WMI_SCAN_EVENT_RESTARTED:
+	case WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT:
 	default:
 		break;
 	}
@@ -2318,6 +2326,29 @@ static int ath10k_wmi_op_pull_ch_info_ev(struct ath10k *ar, struct sk_buff *skb,
 	return 0;
 }
 
+static int ath10k_wmi_10_4_op_pull_ch_info_ev(struct ath10k *ar,
+					      struct sk_buff *skb,
+					      struct wmi_ch_info_ev_arg *arg)
+{
+	struct wmi_10_4_chan_info_event *ev = (void *)skb->data;
+
+	if (skb->len < sizeof(*ev))
+		return -EPROTO;
+
+	skb_pull(skb, sizeof(*ev));
+	arg->err_code = ev->err_code;
+	arg->freq = ev->freq;
+	arg->cmd_flags = ev->cmd_flags;
+	arg->noise_floor = ev->noise_floor;
+	arg->rx_clear_count = ev->rx_clear_count;
+	arg->cycle_count = ev->cycle_count;
+	arg->chan_tx_pwr_range = ev->chan_tx_pwr_range;
+	arg->chan_tx_pwr_tp = ev->chan_tx_pwr_tp;
+	arg->rx_frame_count = ev->rx_frame_count;
+
+	return 0;
+}
+
 void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb)
 {
 	struct wmi_ch_info_ev_arg arg = {};
@@ -4427,6 +4458,12 @@ static void ath10k_wmi_10_4_op_rx(struct ath10k *ar, struct sk_buff *skb)
 	case WMI_10_4_SERVICE_READY_EVENTID:
 		ath10k_wmi_event_service_ready(ar, skb);
 		break;
+	case WMI_10_4_SCAN_EVENTID:
+		ath10k_wmi_event_scan(ar, skb);
+		break;
+	case WMI_10_4_CHAN_INFO_EVENTID:
+		ath10k_wmi_event_chan_info(ar, skb);
+		break;
 	case WMI_10_4_READY_EVENTID:
 		ath10k_wmi_event_ready(ar, skb);
 		break;
@@ -6382,7 +6419,10 @@ static const struct wmi_ops wmi_10_2_4_ops = {
 static const struct wmi_ops wmi_10_4_ops = {
 	.rx = ath10k_wmi_10_4_op_rx,
 	.map_svc = wmi_10_4_svc_map,
+
+	.pull_scan = ath10k_wmi_op_pull_scan_ev,
 	.pull_mgmt_rx = ath10k_wmi_10_4_op_pull_mgmt_rx_ev,
+	.pull_ch_info = ath10k_wmi_10_4_op_pull_ch_info_ev,
 	.pull_vdev_start = ath10k_wmi_op_pull_vdev_start_ev,
 	.pull_peer_kick = ath10k_wmi_op_pull_peer_kick_ev,
 	.pull_swba = ath10k_wmi_10_4_op_pull_swba_ev,
@@ -6394,6 +6434,8 @@ static const struct wmi_ops wmi_10_4_ops = {
 	.gen_pdev_set_rd = ath10k_wmi_10x_op_gen_pdev_set_rd,
 	.gen_pdev_set_param = ath10k_wmi_op_gen_pdev_set_param,
 	.gen_init = ath10k_wmi_10_4_op_gen_init,
+	.gen_start_scan = ath10k_wmi_op_gen_start_scan,
+	.gen_stop_scan = ath10k_wmi_op_gen_stop_scan,
 	.gen_vdev_create = ath10k_wmi_op_gen_vdev_create,
 	.gen_vdev_delete = ath10k_wmi_op_gen_vdev_delete,
 	.gen_vdev_start = ath10k_wmi_op_gen_vdev_start,
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 395742d..6e806cb 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -2879,15 +2879,17 @@ enum wmi_bss_filter {
 };
 
 enum wmi_scan_event_type {
-	WMI_SCAN_EVENT_STARTED         = 0x1,
-	WMI_SCAN_EVENT_COMPLETED       = 0x2,
-	WMI_SCAN_EVENT_BSS_CHANNEL     = 0x4,
-	WMI_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
-	WMI_SCAN_EVENT_DEQUEUED        = 0x10,
-	WMI_SCAN_EVENT_PREEMPTED       = 0x20, /* possibly by high-prio scan */
-	WMI_SCAN_EVENT_START_FAILED    = 0x40,
-	WMI_SCAN_EVENT_RESTARTED       = 0x80,
-	WMI_SCAN_EVENT_MAX             = 0x8000
+	WMI_SCAN_EVENT_STARTED              = BIT(0),
+	WMI_SCAN_EVENT_COMPLETED            = BIT(1),
+	WMI_SCAN_EVENT_BSS_CHANNEL          = BIT(2),
+	WMI_SCAN_EVENT_FOREIGN_CHANNEL      = BIT(3),
+	WMI_SCAN_EVENT_DEQUEUED             = BIT(4),
+	/* possibly by high-prio scan */
+	WMI_SCAN_EVENT_PREEMPTED            = BIT(5),
+	WMI_SCAN_EVENT_START_FAILED         = BIT(6),
+	WMI_SCAN_EVENT_RESTARTED            = BIT(7),
+	WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT = BIT(8),
+	WMI_SCAN_EVENT_MAX                  = BIT(15),
 };
 
 enum wmi_scan_completion_reason {
@@ -2895,6 +2897,7 @@ enum wmi_scan_completion_reason {
 	WMI_SCAN_REASON_CANCELLED,
 	WMI_SCAN_REASON_PREEMPTED,
 	WMI_SCAN_REASON_TIMEDOUT,
+	WMI_SCAN_REASON_INTERNAL_FAILURE,
 	WMI_SCAN_REASON_MAX,
 };
 
@@ -5564,6 +5567,18 @@ struct wmi_chan_info_event {
 	__le32 cycle_count;
 } __packed;
 
+struct wmi_10_4_chan_info_event {
+	__le32 err_code;
+	__le32 freq;
+	__le32 cmd_flags;
+	__le32 noise_floor;
+	__le32 rx_clear_count;
+	__le32 cycle_count;
+	__le32 chan_tx_pwr_range;
+	__le32 chan_tx_pwr_tp;
+	__le32 rx_frame_count;
+} __packed;
+
 struct wmi_peer_sta_kickout_event {
 	struct wmi_mac_addr peer_macaddr;
 } __packed;
@@ -5744,6 +5759,9 @@ struct wmi_ch_info_ev_arg {
 	__le32 noise_floor;
 	__le32 rx_clear_count;
 	__le32 cycle_count;
+	__le32 chan_tx_pwr_range;
+	__le32 chan_tx_pwr_tp;
+	__le32 rx_frame_count;
 };
 
 struct wmi_vdev_start_ev_arg {
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 4/8] ath10k: add scan support for 10.4 fw
@ 2015-06-22 14:52   ` Raja Mani
  0 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

Existing non 10.4 firmware scan related events and commands are
matching with 10.4 firmware (except chan info event). Link general
start scan,stop scan, scan channel list configuration functions
to 10.4 wmi function table and add a new handler to parse 10.4
specific chan info event.

10.4 firmware has extra scan completion reason
WMI_SCAN_REASON_INTERNAL_FAILURE and new scan event
WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT compared to previous firmware
versions. These things are added in respective enum.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
v2 changes:
 - WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT is added newly.
 - BIT() macro is used to define the values of "enum wmi_scan_event_type"
 - New member rx_frame_count is added in struct wmi_10_4_chan_info_event

 drivers/net/wireless/ath/ath10k/wmi.c | 42 +++++++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath10k/wmi.h | 36 ++++++++++++++++++++++--------
 2 files changed, 69 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index c4d777d..fffdae1 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -1923,6 +1923,8 @@ ath10k_wmi_event_scan_type_str(enum wmi_scan_event_type type,
 			return "completed [preempted]";
 		case WMI_SCAN_REASON_TIMEDOUT:
 			return "completed [timedout]";
+		case WMI_SCAN_REASON_INTERNAL_FAILURE:
+			return "completed [internal err]";
 		case WMI_SCAN_REASON_MAX:
 			break;
 		}
@@ -1937,6 +1939,10 @@ ath10k_wmi_event_scan_type_str(enum wmi_scan_event_type type,
 		return "preempted";
 	case WMI_SCAN_EVENT_START_FAILED:
 		return "start failed";
+	case WMI_SCAN_EVENT_RESTARTED:
+		return "restarted";
+	case WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT:
+		return "foreign channel exit";
 	default:
 		return "unknown";
 	}
@@ -2012,6 +2018,8 @@ int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb)
 		break;
 	case WMI_SCAN_EVENT_DEQUEUED:
 	case WMI_SCAN_EVENT_PREEMPTED:
+	case WMI_SCAN_EVENT_RESTARTED:
+	case WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT:
 	default:
 		break;
 	}
@@ -2318,6 +2326,29 @@ static int ath10k_wmi_op_pull_ch_info_ev(struct ath10k *ar, struct sk_buff *skb,
 	return 0;
 }
 
+static int ath10k_wmi_10_4_op_pull_ch_info_ev(struct ath10k *ar,
+					      struct sk_buff *skb,
+					      struct wmi_ch_info_ev_arg *arg)
+{
+	struct wmi_10_4_chan_info_event *ev = (void *)skb->data;
+
+	if (skb->len < sizeof(*ev))
+		return -EPROTO;
+
+	skb_pull(skb, sizeof(*ev));
+	arg->err_code = ev->err_code;
+	arg->freq = ev->freq;
+	arg->cmd_flags = ev->cmd_flags;
+	arg->noise_floor = ev->noise_floor;
+	arg->rx_clear_count = ev->rx_clear_count;
+	arg->cycle_count = ev->cycle_count;
+	arg->chan_tx_pwr_range = ev->chan_tx_pwr_range;
+	arg->chan_tx_pwr_tp = ev->chan_tx_pwr_tp;
+	arg->rx_frame_count = ev->rx_frame_count;
+
+	return 0;
+}
+
 void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb)
 {
 	struct wmi_ch_info_ev_arg arg = {};
@@ -4427,6 +4458,12 @@ static void ath10k_wmi_10_4_op_rx(struct ath10k *ar, struct sk_buff *skb)
 	case WMI_10_4_SERVICE_READY_EVENTID:
 		ath10k_wmi_event_service_ready(ar, skb);
 		break;
+	case WMI_10_4_SCAN_EVENTID:
+		ath10k_wmi_event_scan(ar, skb);
+		break;
+	case WMI_10_4_CHAN_INFO_EVENTID:
+		ath10k_wmi_event_chan_info(ar, skb);
+		break;
 	case WMI_10_4_READY_EVENTID:
 		ath10k_wmi_event_ready(ar, skb);
 		break;
@@ -6382,7 +6419,10 @@ static const struct wmi_ops wmi_10_2_4_ops = {
 static const struct wmi_ops wmi_10_4_ops = {
 	.rx = ath10k_wmi_10_4_op_rx,
 	.map_svc = wmi_10_4_svc_map,
+
+	.pull_scan = ath10k_wmi_op_pull_scan_ev,
 	.pull_mgmt_rx = ath10k_wmi_10_4_op_pull_mgmt_rx_ev,
+	.pull_ch_info = ath10k_wmi_10_4_op_pull_ch_info_ev,
 	.pull_vdev_start = ath10k_wmi_op_pull_vdev_start_ev,
 	.pull_peer_kick = ath10k_wmi_op_pull_peer_kick_ev,
 	.pull_swba = ath10k_wmi_10_4_op_pull_swba_ev,
@@ -6394,6 +6434,8 @@ static const struct wmi_ops wmi_10_4_ops = {
 	.gen_pdev_set_rd = ath10k_wmi_10x_op_gen_pdev_set_rd,
 	.gen_pdev_set_param = ath10k_wmi_op_gen_pdev_set_param,
 	.gen_init = ath10k_wmi_10_4_op_gen_init,
+	.gen_start_scan = ath10k_wmi_op_gen_start_scan,
+	.gen_stop_scan = ath10k_wmi_op_gen_stop_scan,
 	.gen_vdev_create = ath10k_wmi_op_gen_vdev_create,
 	.gen_vdev_delete = ath10k_wmi_op_gen_vdev_delete,
 	.gen_vdev_start = ath10k_wmi_op_gen_vdev_start,
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 395742d..6e806cb 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -2879,15 +2879,17 @@ enum wmi_bss_filter {
 };
 
 enum wmi_scan_event_type {
-	WMI_SCAN_EVENT_STARTED         = 0x1,
-	WMI_SCAN_EVENT_COMPLETED       = 0x2,
-	WMI_SCAN_EVENT_BSS_CHANNEL     = 0x4,
-	WMI_SCAN_EVENT_FOREIGN_CHANNEL = 0x8,
-	WMI_SCAN_EVENT_DEQUEUED        = 0x10,
-	WMI_SCAN_EVENT_PREEMPTED       = 0x20, /* possibly by high-prio scan */
-	WMI_SCAN_EVENT_START_FAILED    = 0x40,
-	WMI_SCAN_EVENT_RESTARTED       = 0x80,
-	WMI_SCAN_EVENT_MAX             = 0x8000
+	WMI_SCAN_EVENT_STARTED              = BIT(0),
+	WMI_SCAN_EVENT_COMPLETED            = BIT(1),
+	WMI_SCAN_EVENT_BSS_CHANNEL          = BIT(2),
+	WMI_SCAN_EVENT_FOREIGN_CHANNEL      = BIT(3),
+	WMI_SCAN_EVENT_DEQUEUED             = BIT(4),
+	/* possibly by high-prio scan */
+	WMI_SCAN_EVENT_PREEMPTED            = BIT(5),
+	WMI_SCAN_EVENT_START_FAILED         = BIT(6),
+	WMI_SCAN_EVENT_RESTARTED            = BIT(7),
+	WMI_SCAN_EVENT_FOREIGN_CHANNEL_EXIT = BIT(8),
+	WMI_SCAN_EVENT_MAX                  = BIT(15),
 };
 
 enum wmi_scan_completion_reason {
@@ -2895,6 +2897,7 @@ enum wmi_scan_completion_reason {
 	WMI_SCAN_REASON_CANCELLED,
 	WMI_SCAN_REASON_PREEMPTED,
 	WMI_SCAN_REASON_TIMEDOUT,
+	WMI_SCAN_REASON_INTERNAL_FAILURE,
 	WMI_SCAN_REASON_MAX,
 };
 
@@ -5564,6 +5567,18 @@ struct wmi_chan_info_event {
 	__le32 cycle_count;
 } __packed;
 
+struct wmi_10_4_chan_info_event {
+	__le32 err_code;
+	__le32 freq;
+	__le32 cmd_flags;
+	__le32 noise_floor;
+	__le32 rx_clear_count;
+	__le32 cycle_count;
+	__le32 chan_tx_pwr_range;
+	__le32 chan_tx_pwr_tp;
+	__le32 rx_frame_count;
+} __packed;
+
 struct wmi_peer_sta_kickout_event {
 	struct wmi_mac_addr peer_macaddr;
 } __packed;
@@ -5744,6 +5759,9 @@ struct wmi_ch_info_ev_arg {
 	__le32 noise_floor;
 	__le32 rx_clear_count;
 	__le32 cycle_count;
+	__le32 chan_tx_pwr_range;
+	__le32 chan_tx_pwr_tp;
+	__le32 rx_frame_count;
 };
 
 struct wmi_vdev_start_ev_arg {
-- 
1.8.1.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 5/8] ath10k: add 10.4 fw specific htt msg definitions
  2015-06-22 14:52 ` Raja Mani
@ 2015-06-22 14:52   ` Raja Mani
  -1 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

New htt event table is added for 10.4 firmware. Following new htt
events are available only 10.4. adding this to generic htt event
table,
	HTT_T2H_MSG_TYPE_EN_STATS,
	HTT_T2H_MSG_TYPE_TX_FETCH_IND,
	HTT_T2H_MSG_TYPE_TX_FETCH_CONF,
	HTT_T2H_MSG_TYPE_TX_LOW_LATENCY_IND

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
v2 changes:
 - updated htt msg ids based on stable 10.4 firmware.

 drivers/net/wireless/ath/ath10k/core.c   |  3 +++
 drivers/net/wireless/ath/ath10k/htt.c    | 41 ++++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath10k/htt.h    | 36 ++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath10k/htt_rx.c |  4 ++++
 drivers/net/wireless/ath/ath10k/hw.h     |  2 ++
 5 files changed, 86 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 020ac9f..b43565d 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1121,6 +1121,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
 		ar->num_active_peers = TARGET_10_4_ACTIVE_PEERS;
 		ar->max_num_vdevs = TARGET_10_4_NUM_VDEVS;
 		ar->num_tids = TARGET_10_4_TGT_NUM_TIDS;
+		ar->htt.max_num_pending_tx = TARGET_10_4_NUM_MSDU_DESC;
 		ar->fw_stats_req_mask = WMI_STAT_PEER;
 		break;
 	case ATH10K_FW_WMI_OP_VERSION_UNSET:
@@ -1146,6 +1147,8 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
 			ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_TLV;
 			break;
 		case ATH10K_FW_WMI_OP_VERSION_10_4:
+			ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_10_4;
+			break;
 		case ATH10K_FW_WMI_OP_VERSION_UNSET:
 		case ATH10K_FW_WMI_OP_VERSION_MAX:
 			WARN_ON(1);
diff --git a/drivers/net/wireless/ath/ath10k/htt.c b/drivers/net/wireless/ath/ath10k/htt.c
index 6da6ef2..6f71f94 100644
--- a/drivers/net/wireless/ath/ath10k/htt.c
+++ b/drivers/net/wireless/ath/ath10k/htt.c
@@ -102,6 +102,43 @@ static const enum htt_t2h_msg_type htt_tlv_t2h_msg_types[] = {
 	[HTT_TLV_T2H_MSG_TYPE_TEST] = HTT_T2H_MSG_TYPE_TEST,
 };
 
+static const enum htt_t2h_msg_type htt_10_4_t2h_msg_types[] = {
+	[HTT_10_4_T2H_MSG_TYPE_VERSION_CONF] = HTT_T2H_MSG_TYPE_VERSION_CONF,
+	[HTT_10_4_T2H_MSG_TYPE_RX_IND] = HTT_T2H_MSG_TYPE_RX_IND,
+	[HTT_10_4_T2H_MSG_TYPE_RX_FLUSH] = HTT_T2H_MSG_TYPE_RX_FLUSH,
+	[HTT_10_4_T2H_MSG_TYPE_PEER_MAP] = HTT_T2H_MSG_TYPE_PEER_MAP,
+	[HTT_10_4_T2H_MSG_TYPE_PEER_UNMAP] = HTT_T2H_MSG_TYPE_PEER_UNMAP,
+	[HTT_10_4_T2H_MSG_TYPE_RX_ADDBA] = HTT_T2H_MSG_TYPE_RX_ADDBA,
+	[HTT_10_4_T2H_MSG_TYPE_RX_DELBA] = HTT_T2H_MSG_TYPE_RX_DELBA,
+	[HTT_10_4_T2H_MSG_TYPE_TX_COMPL_IND] = HTT_T2H_MSG_TYPE_TX_COMPL_IND,
+	[HTT_10_4_T2H_MSG_TYPE_PKTLOG] = HTT_T2H_MSG_TYPE_PKTLOG,
+	[HTT_10_4_T2H_MSG_TYPE_STATS_CONF] = HTT_T2H_MSG_TYPE_STATS_CONF,
+	[HTT_10_4_T2H_MSG_TYPE_RX_FRAG_IND] = HTT_T2H_MSG_TYPE_RX_FRAG_IND,
+	[HTT_10_4_T2H_MSG_TYPE_SEC_IND] = HTT_T2H_MSG_TYPE_SEC_IND,
+	[HTT_10_4_T2H_MSG_TYPE_RC_UPDATE_IND] = HTT_T2H_MSG_TYPE_RC_UPDATE_IND,
+	[HTT_10_4_T2H_MSG_TYPE_TX_INSPECT_IND] =
+				HTT_T2H_MSG_TYPE_TX_INSPECT_IND,
+	[HTT_10_4_T2H_MSG_TYPE_MGMT_TX_COMPL_IND] =
+				HTT_T2H_MSG_TYPE_MGMT_TX_COMPLETION,
+	[HTT_10_4_T2H_MSG_TYPE_CHAN_CHANGE] = HTT_T2H_MSG_TYPE_CHAN_CHANGE,
+	[HTT_10_4_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND] =
+				HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND,
+	[HTT_10_4_T2H_MSG_TYPE_RX_PN_IND] = HTT_T2H_MSG_TYPE_RX_PN_IND,
+	[HTT_10_4_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND] =
+				HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND,
+	[HTT_10_4_T2H_MSG_TYPE_TEST] = HTT_T2H_MSG_TYPE_TEST,
+	[HTT_10_4_T2H_MSG_TYPE_EN_STATS] = HTT_T2H_MSG_TYPE_EN_STATS,
+	[HTT_10_4_T2H_MSG_TYPE_AGGR_CONF] = HTT_T2H_MSG_TYPE_AGGR_CONF,
+	[HTT_10_4_T2H_MSG_TYPE_TX_FETCH_IND] =
+				HTT_T2H_MSG_TYPE_TX_FETCH_IND,
+	[HTT_10_4_T2H_MSG_TYPE_TX_FETCH_CONF] =
+				HTT_T2H_MSG_TYPE_TX_FETCH_CONF,
+	[HTT_10_4_T2H_MSG_TYPE_STATS_NOUPLOAD] =
+				HTT_T2H_MSG_TYPE_STATS_NOUPLOAD,
+	[HTT_10_4_T2H_MSG_TYPE_TX_LOW_LATENCY_IND] =
+				HTT_T2H_MSG_TYPE_TX_LOW_LATENCY_IND,
+};
+
 int ath10k_htt_connect(struct ath10k_htt *htt)
 {
 	struct ath10k_htc_svc_conn_req conn_req;
@@ -147,6 +184,10 @@ int ath10k_htt_init(struct ath10k *ar)
 		2; /* ip4 dscp or ip6 priority */
 
 	switch (ar->htt.op_version) {
+	case ATH10K_FW_HTT_OP_VERSION_10_4:
+		ar->htt.t2h_msg_types = htt_10_4_t2h_msg_types;
+		ar->htt.t2h_msg_types_max = HTT_10_4_T2H_NUM_MSGS;
+		break;
 	case ATH10K_FW_HTT_OP_VERSION_10_1:
 		ar->htt.t2h_msg_types = htt_10x_t2h_msg_types;
 		ar->htt.t2h_msg_types_max = HTT_10X_T2H_NUM_MSGS;
diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h
index 7e8a0d8..8e64ace 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -349,6 +349,38 @@ enum htt_tlv_t2h_msg_type {
 	HTT_TLV_T2H_NUM_MSGS
 };
 
+enum htt_10_4_t2h_msg_type {
+	HTT_10_4_T2H_MSG_TYPE_VERSION_CONF           = 0x0,
+	HTT_10_4_T2H_MSG_TYPE_RX_IND                 = 0x1,
+	HTT_10_4_T2H_MSG_TYPE_RX_FLUSH               = 0x2,
+	HTT_10_4_T2H_MSG_TYPE_PEER_MAP               = 0x3,
+	HTT_10_4_T2H_MSG_TYPE_PEER_UNMAP             = 0x4,
+	HTT_10_4_T2H_MSG_TYPE_RX_ADDBA               = 0x5,
+	HTT_10_4_T2H_MSG_TYPE_RX_DELBA               = 0x6,
+	HTT_10_4_T2H_MSG_TYPE_TX_COMPL_IND           = 0x7,
+	HTT_10_4_T2H_MSG_TYPE_PKTLOG                 = 0x8,
+	HTT_10_4_T2H_MSG_TYPE_STATS_CONF             = 0x9,
+	HTT_10_4_T2H_MSG_TYPE_RX_FRAG_IND            = 0xa,
+	HTT_10_4_T2H_MSG_TYPE_SEC_IND                = 0xb,
+	HTT_10_4_T2H_MSG_TYPE_RC_UPDATE_IND          = 0xc,
+	HTT_10_4_T2H_MSG_TYPE_TX_INSPECT_IND         = 0xd,
+	HTT_10_4_T2H_MSG_TYPE_MGMT_TX_COMPL_IND      = 0xe,
+	HTT_10_4_T2H_MSG_TYPE_CHAN_CHANGE            = 0xf,
+	HTT_10_4_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND   = 0x10,
+	HTT_10_4_T2H_MSG_TYPE_RX_PN_IND              = 0x11,
+	HTT_10_4_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x12,
+	HTT_10_4_T2H_MSG_TYPE_TEST                   = 0x13,
+	HTT_10_4_T2H_MSG_TYPE_EN_STATS               = 0x14,
+	HTT_10_4_T2H_MSG_TYPE_AGGR_CONF              = 0x15,
+	HTT_10_4_T2H_MSG_TYPE_TX_FETCH_IND           = 0x16,
+	HTT_10_4_T2H_MSG_TYPE_TX_FETCH_CONF          = 0x17,
+	HTT_10_4_T2H_MSG_TYPE_STATS_NOUPLOAD         = 0x18,
+	/* 0x19 to 0x2f are reserved */
+	HTT_10_4_T2H_MSG_TYPE_TX_LOW_LATENCY_IND     = 0x30,
+	/* keep this last */
+	HTT_10_4_T2H_NUM_MSGS
+};
+
 enum htt_t2h_msg_type {
 	HTT_T2H_MSG_TYPE_VERSION_CONF,
 	HTT_T2H_MSG_TYPE_RX_IND,
@@ -375,6 +407,10 @@ enum htt_t2h_msg_type {
 	HTT_T2H_MSG_TYPE_AGGR_CONF,
 	HTT_T2H_MSG_TYPE_STATS_NOUPLOAD,
 	HTT_T2H_MSG_TYPE_TEST,
+	HTT_T2H_MSG_TYPE_EN_STATS,
+	HTT_T2H_MSG_TYPE_TX_FETCH_IND,
+	HTT_T2H_MSG_TYPE_TX_FETCH_CONF,
+	HTT_T2H_MSG_TYPE_TX_LOW_LATENCY_IND,
 	/* keep this last */
 	HTT_T2H_NUM_MSGS
 };
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 7399e45..d7d1183 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -2072,6 +2072,10 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 		break;
 	case HTT_T2H_MSG_TYPE_CHAN_CHANGE:
 		break;
+	case HTT_T2H_MSG_TYPE_EN_STATS:
+	case HTT_T2H_MSG_TYPE_TX_FETCH_IND:
+	case HTT_T2H_MSG_TYPE_TX_FETCH_CONF:
+	case HTT_T2H_MSG_TYPE_TX_LOW_LATENCY_IND:
 	default:
 		ath10k_warn(ar, "htt event (%d) not handled\n",
 			    resp->hdr.msg_type);
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index 568c5ea5..9172285 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -153,6 +153,8 @@ enum ath10k_fw_htt_op_version {
 
 	ATH10K_FW_HTT_OP_VERSION_TLV = 3,
 
+	ATH10K_FW_HTT_OP_VERSION_10_4 = 4,
+
 	/* keep last */
 	ATH10K_FW_HTT_OP_VERSION_MAX,
 };
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 5/8] ath10k: add 10.4 fw specific htt msg definitions
@ 2015-06-22 14:52   ` Raja Mani
  0 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

New htt event table is added for 10.4 firmware. Following new htt
events are available only 10.4. adding this to generic htt event
table,
	HTT_T2H_MSG_TYPE_EN_STATS,
	HTT_T2H_MSG_TYPE_TX_FETCH_IND,
	HTT_T2H_MSG_TYPE_TX_FETCH_CONF,
	HTT_T2H_MSG_TYPE_TX_LOW_LATENCY_IND

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
v2 changes:
 - updated htt msg ids based on stable 10.4 firmware.

 drivers/net/wireless/ath/ath10k/core.c   |  3 +++
 drivers/net/wireless/ath/ath10k/htt.c    | 41 ++++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath10k/htt.h    | 36 ++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath10k/htt_rx.c |  4 ++++
 drivers/net/wireless/ath/ath10k/hw.h     |  2 ++
 5 files changed, 86 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 020ac9f..b43565d 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1121,6 +1121,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
 		ar->num_active_peers = TARGET_10_4_ACTIVE_PEERS;
 		ar->max_num_vdevs = TARGET_10_4_NUM_VDEVS;
 		ar->num_tids = TARGET_10_4_TGT_NUM_TIDS;
+		ar->htt.max_num_pending_tx = TARGET_10_4_NUM_MSDU_DESC;
 		ar->fw_stats_req_mask = WMI_STAT_PEER;
 		break;
 	case ATH10K_FW_WMI_OP_VERSION_UNSET:
@@ -1146,6 +1147,8 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
 			ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_TLV;
 			break;
 		case ATH10K_FW_WMI_OP_VERSION_10_4:
+			ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_10_4;
+			break;
 		case ATH10K_FW_WMI_OP_VERSION_UNSET:
 		case ATH10K_FW_WMI_OP_VERSION_MAX:
 			WARN_ON(1);
diff --git a/drivers/net/wireless/ath/ath10k/htt.c b/drivers/net/wireless/ath/ath10k/htt.c
index 6da6ef2..6f71f94 100644
--- a/drivers/net/wireless/ath/ath10k/htt.c
+++ b/drivers/net/wireless/ath/ath10k/htt.c
@@ -102,6 +102,43 @@ static const enum htt_t2h_msg_type htt_tlv_t2h_msg_types[] = {
 	[HTT_TLV_T2H_MSG_TYPE_TEST] = HTT_T2H_MSG_TYPE_TEST,
 };
 
+static const enum htt_t2h_msg_type htt_10_4_t2h_msg_types[] = {
+	[HTT_10_4_T2H_MSG_TYPE_VERSION_CONF] = HTT_T2H_MSG_TYPE_VERSION_CONF,
+	[HTT_10_4_T2H_MSG_TYPE_RX_IND] = HTT_T2H_MSG_TYPE_RX_IND,
+	[HTT_10_4_T2H_MSG_TYPE_RX_FLUSH] = HTT_T2H_MSG_TYPE_RX_FLUSH,
+	[HTT_10_4_T2H_MSG_TYPE_PEER_MAP] = HTT_T2H_MSG_TYPE_PEER_MAP,
+	[HTT_10_4_T2H_MSG_TYPE_PEER_UNMAP] = HTT_T2H_MSG_TYPE_PEER_UNMAP,
+	[HTT_10_4_T2H_MSG_TYPE_RX_ADDBA] = HTT_T2H_MSG_TYPE_RX_ADDBA,
+	[HTT_10_4_T2H_MSG_TYPE_RX_DELBA] = HTT_T2H_MSG_TYPE_RX_DELBA,
+	[HTT_10_4_T2H_MSG_TYPE_TX_COMPL_IND] = HTT_T2H_MSG_TYPE_TX_COMPL_IND,
+	[HTT_10_4_T2H_MSG_TYPE_PKTLOG] = HTT_T2H_MSG_TYPE_PKTLOG,
+	[HTT_10_4_T2H_MSG_TYPE_STATS_CONF] = HTT_T2H_MSG_TYPE_STATS_CONF,
+	[HTT_10_4_T2H_MSG_TYPE_RX_FRAG_IND] = HTT_T2H_MSG_TYPE_RX_FRAG_IND,
+	[HTT_10_4_T2H_MSG_TYPE_SEC_IND] = HTT_T2H_MSG_TYPE_SEC_IND,
+	[HTT_10_4_T2H_MSG_TYPE_RC_UPDATE_IND] = HTT_T2H_MSG_TYPE_RC_UPDATE_IND,
+	[HTT_10_4_T2H_MSG_TYPE_TX_INSPECT_IND] =
+				HTT_T2H_MSG_TYPE_TX_INSPECT_IND,
+	[HTT_10_4_T2H_MSG_TYPE_MGMT_TX_COMPL_IND] =
+				HTT_T2H_MSG_TYPE_MGMT_TX_COMPLETION,
+	[HTT_10_4_T2H_MSG_TYPE_CHAN_CHANGE] = HTT_T2H_MSG_TYPE_CHAN_CHANGE,
+	[HTT_10_4_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND] =
+				HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND,
+	[HTT_10_4_T2H_MSG_TYPE_RX_PN_IND] = HTT_T2H_MSG_TYPE_RX_PN_IND,
+	[HTT_10_4_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND] =
+				HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND,
+	[HTT_10_4_T2H_MSG_TYPE_TEST] = HTT_T2H_MSG_TYPE_TEST,
+	[HTT_10_4_T2H_MSG_TYPE_EN_STATS] = HTT_T2H_MSG_TYPE_EN_STATS,
+	[HTT_10_4_T2H_MSG_TYPE_AGGR_CONF] = HTT_T2H_MSG_TYPE_AGGR_CONF,
+	[HTT_10_4_T2H_MSG_TYPE_TX_FETCH_IND] =
+				HTT_T2H_MSG_TYPE_TX_FETCH_IND,
+	[HTT_10_4_T2H_MSG_TYPE_TX_FETCH_CONF] =
+				HTT_T2H_MSG_TYPE_TX_FETCH_CONF,
+	[HTT_10_4_T2H_MSG_TYPE_STATS_NOUPLOAD] =
+				HTT_T2H_MSG_TYPE_STATS_NOUPLOAD,
+	[HTT_10_4_T2H_MSG_TYPE_TX_LOW_LATENCY_IND] =
+				HTT_T2H_MSG_TYPE_TX_LOW_LATENCY_IND,
+};
+
 int ath10k_htt_connect(struct ath10k_htt *htt)
 {
 	struct ath10k_htc_svc_conn_req conn_req;
@@ -147,6 +184,10 @@ int ath10k_htt_init(struct ath10k *ar)
 		2; /* ip4 dscp or ip6 priority */
 
 	switch (ar->htt.op_version) {
+	case ATH10K_FW_HTT_OP_VERSION_10_4:
+		ar->htt.t2h_msg_types = htt_10_4_t2h_msg_types;
+		ar->htt.t2h_msg_types_max = HTT_10_4_T2H_NUM_MSGS;
+		break;
 	case ATH10K_FW_HTT_OP_VERSION_10_1:
 		ar->htt.t2h_msg_types = htt_10x_t2h_msg_types;
 		ar->htt.t2h_msg_types_max = HTT_10X_T2H_NUM_MSGS;
diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h
index 7e8a0d8..8e64ace 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -349,6 +349,38 @@ enum htt_tlv_t2h_msg_type {
 	HTT_TLV_T2H_NUM_MSGS
 };
 
+enum htt_10_4_t2h_msg_type {
+	HTT_10_4_T2H_MSG_TYPE_VERSION_CONF           = 0x0,
+	HTT_10_4_T2H_MSG_TYPE_RX_IND                 = 0x1,
+	HTT_10_4_T2H_MSG_TYPE_RX_FLUSH               = 0x2,
+	HTT_10_4_T2H_MSG_TYPE_PEER_MAP               = 0x3,
+	HTT_10_4_T2H_MSG_TYPE_PEER_UNMAP             = 0x4,
+	HTT_10_4_T2H_MSG_TYPE_RX_ADDBA               = 0x5,
+	HTT_10_4_T2H_MSG_TYPE_RX_DELBA               = 0x6,
+	HTT_10_4_T2H_MSG_TYPE_TX_COMPL_IND           = 0x7,
+	HTT_10_4_T2H_MSG_TYPE_PKTLOG                 = 0x8,
+	HTT_10_4_T2H_MSG_TYPE_STATS_CONF             = 0x9,
+	HTT_10_4_T2H_MSG_TYPE_RX_FRAG_IND            = 0xa,
+	HTT_10_4_T2H_MSG_TYPE_SEC_IND                = 0xb,
+	HTT_10_4_T2H_MSG_TYPE_RC_UPDATE_IND          = 0xc,
+	HTT_10_4_T2H_MSG_TYPE_TX_INSPECT_IND         = 0xd,
+	HTT_10_4_T2H_MSG_TYPE_MGMT_TX_COMPL_IND      = 0xe,
+	HTT_10_4_T2H_MSG_TYPE_CHAN_CHANGE            = 0xf,
+	HTT_10_4_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND   = 0x10,
+	HTT_10_4_T2H_MSG_TYPE_RX_PN_IND              = 0x11,
+	HTT_10_4_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x12,
+	HTT_10_4_T2H_MSG_TYPE_TEST                   = 0x13,
+	HTT_10_4_T2H_MSG_TYPE_EN_STATS               = 0x14,
+	HTT_10_4_T2H_MSG_TYPE_AGGR_CONF              = 0x15,
+	HTT_10_4_T2H_MSG_TYPE_TX_FETCH_IND           = 0x16,
+	HTT_10_4_T2H_MSG_TYPE_TX_FETCH_CONF          = 0x17,
+	HTT_10_4_T2H_MSG_TYPE_STATS_NOUPLOAD         = 0x18,
+	/* 0x19 to 0x2f are reserved */
+	HTT_10_4_T2H_MSG_TYPE_TX_LOW_LATENCY_IND     = 0x30,
+	/* keep this last */
+	HTT_10_4_T2H_NUM_MSGS
+};
+
 enum htt_t2h_msg_type {
 	HTT_T2H_MSG_TYPE_VERSION_CONF,
 	HTT_T2H_MSG_TYPE_RX_IND,
@@ -375,6 +407,10 @@ enum htt_t2h_msg_type {
 	HTT_T2H_MSG_TYPE_AGGR_CONF,
 	HTT_T2H_MSG_TYPE_STATS_NOUPLOAD,
 	HTT_T2H_MSG_TYPE_TEST,
+	HTT_T2H_MSG_TYPE_EN_STATS,
+	HTT_T2H_MSG_TYPE_TX_FETCH_IND,
+	HTT_T2H_MSG_TYPE_TX_FETCH_CONF,
+	HTT_T2H_MSG_TYPE_TX_LOW_LATENCY_IND,
 	/* keep this last */
 	HTT_T2H_NUM_MSGS
 };
diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c
index 7399e45..d7d1183 100644
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
@@ -2072,6 +2072,10 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb)
 		break;
 	case HTT_T2H_MSG_TYPE_CHAN_CHANGE:
 		break;
+	case HTT_T2H_MSG_TYPE_EN_STATS:
+	case HTT_T2H_MSG_TYPE_TX_FETCH_IND:
+	case HTT_T2H_MSG_TYPE_TX_FETCH_CONF:
+	case HTT_T2H_MSG_TYPE_TX_LOW_LATENCY_IND:
 	default:
 		ath10k_warn(ar, "htt event (%d) not handled\n",
 			    resp->hdr.msg_type);
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index 568c5ea5..9172285 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -153,6 +153,8 @@ enum ath10k_fw_htt_op_version {
 
 	ATH10K_FW_HTT_OP_VERSION_TLV = 3,
 
+	ATH10K_FW_HTT_OP_VERSION_10_4 = 4,
+
 	/* keep last */
 	ATH10K_FW_HTT_OP_VERSION_MAX,
 };
-- 
1.8.1.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 6/8] ath10k: advertise 10.4 fw ap and sta iface combination to mac80211
  2015-06-22 14:52 ` Raja Mani
@ 2015-06-22 14:52   ` Raja Mani
  -1 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

10.4 fw supports upto 16 interface in ap mode and 1 interface
in station mode, overall total interfaces supported are 16
interfaces. Populate this limit in wiphy->iface_combinations.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index f9989d1..bbdf7a9 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -6620,6 +6620,33 @@ static struct ieee80211_iface_combination ath10k_tlv_qcs_if_comb[] = {
 	},
 };
 
+static const struct ieee80211_iface_limit ath10k_10_4_if_limits[] = {
+	{
+		.max = 1,
+		.types = BIT(NL80211_IFTYPE_STATION),
+	},
+	{
+		.max	= 16,
+		.types	= BIT(NL80211_IFTYPE_AP)
+	},
+};
+
+static const struct ieee80211_iface_combination ath10k_10_4_if_comb[] = {
+	{
+		.limits = ath10k_10_4_if_limits,
+		.n_limits = ARRAY_SIZE(ath10k_10_4_if_limits),
+		.max_interfaces = 16,
+		.num_different_channels = 1,
+		.beacon_int_infra_match = true,
+#ifdef CONFIG_ATH10K_DFS_CERTIFIED
+		.radar_detect_widths =	BIT(NL80211_CHAN_WIDTH_20_NOHT) |
+					BIT(NL80211_CHAN_WIDTH_20) |
+					BIT(NL80211_CHAN_WIDTH_40) |
+					BIT(NL80211_CHAN_WIDTH_80),
+#endif
+	},
+};
+
 static struct ieee80211_sta_vht_cap ath10k_create_vht_cap(struct ath10k *ar)
 {
 	struct ieee80211_sta_vht_cap vht_cap = {0};
@@ -6944,6 +6971,9 @@ int ath10k_mac_register(struct ath10k *ar)
 			ARRAY_SIZE(ath10k_10x_if_comb);
 		break;
 	case ATH10K_FW_WMI_OP_VERSION_10_4:
+		ar->hw->wiphy->iface_combinations = ath10k_10_4_if_comb;
+		ar->hw->wiphy->n_iface_combinations =
+			ARRAY_SIZE(ath10k_10_4_if_comb);
 		break;
 	case ATH10K_FW_WMI_OP_VERSION_UNSET:
 	case ATH10K_FW_WMI_OP_VERSION_MAX:
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 6/8] ath10k: advertise 10.4 fw ap and sta iface combination to mac80211
@ 2015-06-22 14:52   ` Raja Mani
  0 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

10.4 fw supports upto 16 interface in ap mode and 1 interface
in station mode, overall total interfaces supported are 16
interfaces. Populate this limit in wiphy->iface_combinations.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index f9989d1..bbdf7a9 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -6620,6 +6620,33 @@ static struct ieee80211_iface_combination ath10k_tlv_qcs_if_comb[] = {
 	},
 };
 
+static const struct ieee80211_iface_limit ath10k_10_4_if_limits[] = {
+	{
+		.max = 1,
+		.types = BIT(NL80211_IFTYPE_STATION),
+	},
+	{
+		.max	= 16,
+		.types	= BIT(NL80211_IFTYPE_AP)
+	},
+};
+
+static const struct ieee80211_iface_combination ath10k_10_4_if_comb[] = {
+	{
+		.limits = ath10k_10_4_if_limits,
+		.n_limits = ARRAY_SIZE(ath10k_10_4_if_limits),
+		.max_interfaces = 16,
+		.num_different_channels = 1,
+		.beacon_int_infra_match = true,
+#ifdef CONFIG_ATH10K_DFS_CERTIFIED
+		.radar_detect_widths =	BIT(NL80211_CHAN_WIDTH_20_NOHT) |
+					BIT(NL80211_CHAN_WIDTH_20) |
+					BIT(NL80211_CHAN_WIDTH_40) |
+					BIT(NL80211_CHAN_WIDTH_80),
+#endif
+	},
+};
+
 static struct ieee80211_sta_vht_cap ath10k_create_vht_cap(struct ath10k *ar)
 {
 	struct ieee80211_sta_vht_cap vht_cap = {0};
@@ -6944,6 +6971,9 @@ int ath10k_mac_register(struct ath10k *ar)
 			ARRAY_SIZE(ath10k_10x_if_comb);
 		break;
 	case ATH10K_FW_WMI_OP_VERSION_10_4:
+		ar->hw->wiphy->iface_combinations = ath10k_10_4_if_comb;
+		ar->hw->wiphy->n_iface_combinations =
+			ARRAY_SIZE(ath10k_10_4_if_comb);
 		break;
 	case ATH10K_FW_WMI_OP_VERSION_UNSET:
 	case ATH10K_FW_WMI_OP_VERSION_MAX:
-- 
1.8.1.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 7/8] ath10k: set max spatial stream to 4 for 10.4 fw
  2015-06-22 14:52 ` Raja Mani
@ 2015-06-22 14:52   ` Raja Mani
  -1 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

10.4 fw supports upto 4 spatial stream. Limit max spatial
stream to 4 for 10.4 firmware and to 3 for non 10.4 firmware.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/core.c | 4 ++++
 drivers/net/wireless/ath/ath10k/core.h | 1 +
 drivers/net/wireless/ath/ath10k/wmi.c  | 6 +++---
 drivers/net/wireless/ath/ath10k/wmi.h  | 3 ++-
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index b43565d..3c8d5c5 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1095,6 +1095,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
 		ar->htt.max_num_pending_tx = TARGET_NUM_MSDU_DESC;
 		ar->fw_stats_req_mask = WMI_STAT_PDEV | WMI_STAT_VDEV |
 			WMI_STAT_PEER;
+		ar->max_spatial_stream = WMI_MAX_SPATIAL_STREAM;
 		break;
 	case ATH10K_FW_WMI_OP_VERSION_10_1:
 	case ATH10K_FW_WMI_OP_VERSION_10_2:
@@ -1104,6 +1105,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
 		ar->max_num_vdevs = TARGET_10X_NUM_VDEVS;
 		ar->htt.max_num_pending_tx = TARGET_10X_NUM_MSDU_DESC;
 		ar->fw_stats_req_mask = WMI_STAT_PEER;
+		ar->max_spatial_stream = WMI_MAX_SPATIAL_STREAM;
 		break;
 	case ATH10K_FW_WMI_OP_VERSION_TLV:
 		ar->max_num_peers = TARGET_TLV_NUM_PEERS;
@@ -1114,6 +1116,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
 		ar->wow.max_num_patterns = TARGET_TLV_NUM_WOW_PATTERNS;
 		ar->fw_stats_req_mask = WMI_STAT_PDEV | WMI_STAT_VDEV |
 			WMI_STAT_PEER;
+		ar->max_spatial_stream = WMI_MAX_SPATIAL_STREAM;
 		break;
 	case ATH10K_FW_WMI_OP_VERSION_10_4:
 		ar->max_num_peers = TARGET_10_4_NUM_PEERS;
@@ -1123,6 +1126,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
 		ar->num_tids = TARGET_10_4_TGT_NUM_TIDS;
 		ar->htt.max_num_pending_tx = TARGET_10_4_NUM_MSDU_DESC;
 		ar->fw_stats_req_mask = WMI_STAT_PEER;
+		ar->max_spatial_stream = WMI_10_4_MAX_SPATIAL_STREAM;
 		break;
 	case ATH10K_FW_WMI_OP_VERSION_UNSET:
 	case ATH10K_FW_WMI_OP_VERSION_MAX:
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 86c4015..f0811d0 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -546,6 +546,7 @@ struct ath10k {
 	u32 ht_cap_info;
 	u32 vht_cap_info;
 	u32 num_rf_chains;
+	u32 max_spatial_stream;
 	/* protected by conf_mutex */
 	bool ani_enabled;
 
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index fffdae1..a00e3ca 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -3911,10 +3911,10 @@ void ath10k_wmi_event_service_ready(struct ath10k *ar, struct sk_buff *skb)
 	if (ar->fw_api == 1 && ar->fw_version_build > 636)
 		set_bit(ATH10K_FW_FEATURE_EXT_WMI_MGMT_RX, ar->fw_features);
 
-	if (ar->num_rf_chains > WMI_MAX_SPATIAL_STREAM) {
+	if (ar->num_rf_chains > ar->max_spatial_stream) {
 		ath10k_warn(ar, "hardware advertises support for more spatial streams than it should (%d > %d)\n",
-			    ar->num_rf_chains, WMI_MAX_SPATIAL_STREAM);
-		ar->num_rf_chains = WMI_MAX_SPATIAL_STREAM;
+			    ar->num_rf_chains, ar->max_spatial_stream);
+		ar->num_rf_chains = ar->max_spatial_stream;
 	}
 
 	ar->supp_tx_chainmask = (1 << ar->num_rf_chains) - 1;
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 6e806cb..0d4efc9 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -1747,7 +1747,8 @@ enum wmi_channel_change_cause {
 /* Indicate reason for channel switch */
 #define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 << 13)
 
-#define WMI_MAX_SPATIAL_STREAM   3
+#define WMI_MAX_SPATIAL_STREAM        3 /* default max ss */
+#define WMI_10_4_MAX_SPATIAL_STREAM   4
 
 /* HT Capabilities*/
 #define WMI_HT_CAP_ENABLED                0x0001   /* HT Enabled/ disabled */
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 7/8] ath10k: set max spatial stream to 4 for 10.4 fw
@ 2015-06-22 14:52   ` Raja Mani
  0 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

10.4 fw supports upto 4 spatial stream. Limit max spatial
stream to 4 for 10.4 firmware and to 3 for non 10.4 firmware.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/core.c | 4 ++++
 drivers/net/wireless/ath/ath10k/core.h | 1 +
 drivers/net/wireless/ath/ath10k/wmi.c  | 6 +++---
 drivers/net/wireless/ath/ath10k/wmi.h  | 3 ++-
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index b43565d..3c8d5c5 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1095,6 +1095,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
 		ar->htt.max_num_pending_tx = TARGET_NUM_MSDU_DESC;
 		ar->fw_stats_req_mask = WMI_STAT_PDEV | WMI_STAT_VDEV |
 			WMI_STAT_PEER;
+		ar->max_spatial_stream = WMI_MAX_SPATIAL_STREAM;
 		break;
 	case ATH10K_FW_WMI_OP_VERSION_10_1:
 	case ATH10K_FW_WMI_OP_VERSION_10_2:
@@ -1104,6 +1105,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
 		ar->max_num_vdevs = TARGET_10X_NUM_VDEVS;
 		ar->htt.max_num_pending_tx = TARGET_10X_NUM_MSDU_DESC;
 		ar->fw_stats_req_mask = WMI_STAT_PEER;
+		ar->max_spatial_stream = WMI_MAX_SPATIAL_STREAM;
 		break;
 	case ATH10K_FW_WMI_OP_VERSION_TLV:
 		ar->max_num_peers = TARGET_TLV_NUM_PEERS;
@@ -1114,6 +1116,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
 		ar->wow.max_num_patterns = TARGET_TLV_NUM_WOW_PATTERNS;
 		ar->fw_stats_req_mask = WMI_STAT_PDEV | WMI_STAT_VDEV |
 			WMI_STAT_PEER;
+		ar->max_spatial_stream = WMI_MAX_SPATIAL_STREAM;
 		break;
 	case ATH10K_FW_WMI_OP_VERSION_10_4:
 		ar->max_num_peers = TARGET_10_4_NUM_PEERS;
@@ -1123,6 +1126,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
 		ar->num_tids = TARGET_10_4_TGT_NUM_TIDS;
 		ar->htt.max_num_pending_tx = TARGET_10_4_NUM_MSDU_DESC;
 		ar->fw_stats_req_mask = WMI_STAT_PEER;
+		ar->max_spatial_stream = WMI_10_4_MAX_SPATIAL_STREAM;
 		break;
 	case ATH10K_FW_WMI_OP_VERSION_UNSET:
 	case ATH10K_FW_WMI_OP_VERSION_MAX:
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 86c4015..f0811d0 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -546,6 +546,7 @@ struct ath10k {
 	u32 ht_cap_info;
 	u32 vht_cap_info;
 	u32 num_rf_chains;
+	u32 max_spatial_stream;
 	/* protected by conf_mutex */
 	bool ani_enabled;
 
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index fffdae1..a00e3ca 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -3911,10 +3911,10 @@ void ath10k_wmi_event_service_ready(struct ath10k *ar, struct sk_buff *skb)
 	if (ar->fw_api == 1 && ar->fw_version_build > 636)
 		set_bit(ATH10K_FW_FEATURE_EXT_WMI_MGMT_RX, ar->fw_features);
 
-	if (ar->num_rf_chains > WMI_MAX_SPATIAL_STREAM) {
+	if (ar->num_rf_chains > ar->max_spatial_stream) {
 		ath10k_warn(ar, "hardware advertises support for more spatial streams than it should (%d > %d)\n",
-			    ar->num_rf_chains, WMI_MAX_SPATIAL_STREAM);
-		ar->num_rf_chains = WMI_MAX_SPATIAL_STREAM;
+			    ar->num_rf_chains, ar->max_spatial_stream);
+		ar->num_rf_chains = ar->max_spatial_stream;
 	}
 
 	ar->supp_tx_chainmask = (1 << ar->num_rf_chains) - 1;
diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index 6e806cb..0d4efc9 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -1747,7 +1747,8 @@ enum wmi_channel_change_cause {
 /* Indicate reason for channel switch */
 #define WMI_CHANNEL_CHANGE_CAUSE_CSA (1 << 13)
 
-#define WMI_MAX_SPATIAL_STREAM   3
+#define WMI_MAX_SPATIAL_STREAM        3 /* default max ss */
+#define WMI_10_4_MAX_SPATIAL_STREAM   4
 
 /* HT Capabilities*/
 #define WMI_HT_CAP_ENABLED                0x0001   /* HT Enabled/ disabled */
-- 
1.8.1.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 8/8] ath10k: configure frag desc memory to target for qca99X0
  2015-06-22 14:52 ` Raja Mani
@ 2015-06-22 14:52   ` Raja Mani
  -1 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

Pre qca99X0 chipsets follows the model where dynamically allocate
memory for frag desc on getting new skb for TX. But, this is not
going to be the case in qca99X0. It expects frag desc memory to be
allocated at boot time and let the driver to reuse allocated memory
after every TX completion. So there won't be any dynamic frag memory
memory allocation in qca99X0 during data transmission.

qca99X0 hardware doesn't need fragment desc address to be programmed
in msdu descriptor for every data transaction. It needs to know only
starting address of fragment descriptor at the time of the boot.
During data transmission, qca99X0 hardware can retrieve corresponding
frag addr by adding programmed frag desc base addr + msdu id.

Allocate continuous fragment descriptor memory (same size as number of
descriptor) at the time of target initialization and configure allocated
dma address to the target via HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG.

How this is allocated continuous memory is going to be used is not
covered in this patch. It just allocates memory and hand over to firmware.
If we don't do it at init time, qca99X0 will stall when firmware tries
to do TX.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/core.c   |  1 +
 drivers/net/wireless/ath/ath10k/core.h   |  6 +++
 drivers/net/wireless/ath/ath10k/htt.c    |  4 ++
 drivers/net/wireless/ath/ath10k/htt.h    | 11 +++++
 drivers/net/wireless/ath/ath10k/htt_tx.c | 76 +++++++++++++++++++++++++++++++-
 5 files changed, 96 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 3c8d5c5..be5f01c 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -111,6 +111,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
 		.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
 		.uart_pin = 7,
 		.otp_exe_param = 0x00000700,
+		.continuous_frag_desc = true,
 		.fw = {
 			.dir = QCA99X0_HW_2_0_FW_DIR,
 			.fw = QCA99X0_HW_2_0_FW_FILE,
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index f0811d0..2e5c935 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -582,6 +582,12 @@ struct ath10k {
 		 */
 		bool has_shifted_cc_wraparound;
 
+		/* Some of chip expects fragment descriptor to be continuous
+		 * memory for any TX operation. Set continuous_frag_desc flag
+		 * for the hardware which have such requirement.
+		 */
+		bool continuous_frag_desc;
+
 		struct ath10k_hw_params_fw {
 			const char *dir;
 			const char *fw;
diff --git a/drivers/net/wireless/ath/ath10k/htt.c b/drivers/net/wireless/ath/ath10k/htt.c
index 6f71f94..4474c3e 100644
--- a/drivers/net/wireless/ath/ath10k/htt.c
+++ b/drivers/net/wireless/ath/ath10k/htt.c
@@ -249,5 +249,9 @@ int ath10k_htt_setup(struct ath10k_htt *htt)
 	if (status)
 		return status;
 
+	status = ath10k_htt_send_frag_desc_bank_cfg(htt);
+	if (status)
+		return status;
+
 	return ath10k_htt_send_rx_ring_cfg_ll(htt);
 }
diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h
index 8e64ace..8bdf1e7 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -87,6 +87,11 @@ struct htt_data_tx_desc_frag {
 	__le32 len;
 } __packed;
 
+struct htt_msdu_ext_desc {
+	__le32 tso_flag[4];
+	struct htt_data_tx_desc_frag frags[6];
+};
+
 enum htt_data_tx_desc_flags0 {
 	HTT_DATA_TX_DESC_FLAGS0_MAC_HDR_PRESENT = 1 << 0,
 	HTT_DATA_TX_DESC_FLAGS0_NO_AGGR         = 1 << 1,
@@ -1466,6 +1471,11 @@ struct ath10k_htt {
 
 	/* rx_status template */
 	struct ieee80211_rx_status rx_status;
+
+	struct {
+		dma_addr_t paddr;
+		struct htt_msdu_ext_desc *vaddr;
+	} frag_desc;
 };
 
 #define RX_HTT_HDR_STATUS_LEN 64
@@ -1533,6 +1543,7 @@ void ath10k_htt_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb);
 void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb);
 int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt);
 int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie);
+int ath10k_htt_send_frag_desc_bank_cfg(struct ath10k_htt *htt);
 int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt);
 int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt,
 				u8 max_subfrms_ampdu,
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index a60ef7d..148d5b6 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -84,6 +84,7 @@ void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id)
 int ath10k_htt_tx_alloc(struct ath10k_htt *htt)
 {
 	struct ath10k *ar = htt->ar;
+	int ret, size;
 
 	ath10k_dbg(ar, ATH10K_DBG_BOOT, "htt tx max num pending tx %d\n",
 		   htt->max_num_pending_tx);
@@ -94,11 +95,31 @@ int ath10k_htt_tx_alloc(struct ath10k_htt *htt)
 	htt->tx_pool = dma_pool_create("ath10k htt tx pool", htt->ar->dev,
 				       sizeof(struct ath10k_htt_txbuf), 4, 0);
 	if (!htt->tx_pool) {
-		idr_destroy(&htt->pending_tx);
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto free_idr_pending_tx;
+	}
+
+	if (!ar->hw_params.continuous_frag_desc)
+		goto skip_frag_desc_alloc;
+
+	size = htt->max_num_pending_tx * sizeof(struct htt_msdu_ext_desc);
+	htt->frag_desc.vaddr = dma_alloc_coherent(ar->dev, size,
+						  &htt->frag_desc.paddr,
+						  GFP_DMA);
+	if (!htt->frag_desc.vaddr) {
+		ath10k_warn(ar, "failed to alloc fragment desc memory\n");
+		ret = -ENOMEM;
+		goto free_tx_pool;
 	}
 
+skip_frag_desc_alloc:
 	return 0;
+
+free_tx_pool:
+	dma_pool_destroy(htt->tx_pool);
+free_idr_pending_tx:
+	idr_destroy(&htt->pending_tx);
+	return ret;
 }
 
 static int ath10k_htt_tx_clean_up_pending(int msdu_id, void *skb, void *ctx)
@@ -121,9 +142,18 @@ static int ath10k_htt_tx_clean_up_pending(int msdu_id, void *skb, void *ctx)
 
 void ath10k_htt_tx_free(struct ath10k_htt *htt)
 {
+	int size;
+
 	idr_for_each(&htt->pending_tx, ath10k_htt_tx_clean_up_pending, htt->ar);
 	idr_destroy(&htt->pending_tx);
 	dma_pool_destroy(htt->tx_pool);
+
+	if (htt->frag_desc.vaddr) {
+		size = htt->max_num_pending_tx *
+				  sizeof(struct htt_msdu_ext_desc);
+		dma_free_coherent(htt->ar->dev, size, htt->frag_desc.vaddr,
+				  htt->frag_desc.paddr);
+	}
 }
 
 void ath10k_htt_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb)
@@ -201,6 +231,48 @@ int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie)
 	return 0;
 }
 
+int ath10k_htt_send_frag_desc_bank_cfg(struct ath10k_htt *htt)
+{
+	struct ath10k *ar = htt->ar;
+	struct sk_buff *skb;
+	struct htt_cmd *cmd;
+	int ret, size;
+
+	if (!ar->hw_params.continuous_frag_desc)
+		return 0;
+
+	if (!htt->frag_desc.paddr) {
+		ath10k_warn(ar, "invalid frag desc memory\n");
+		return -EINVAL;
+	}
+
+	size = sizeof(cmd->hdr) + sizeof(cmd->frag_desc_bank_cfg);
+	skb = ath10k_htc_alloc_skb(ar, size);
+	if (!skb)
+		return -ENOMEM;
+
+	skb_put(skb, size);
+	cmd = (struct htt_cmd *)skb->data;
+	cmd->hdr.msg_type = HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG;
+	cmd->frag_desc_bank_cfg.info = 0;
+	cmd->frag_desc_bank_cfg.num_banks = 1;
+	cmd->frag_desc_bank_cfg.desc_size = sizeof(struct htt_msdu_ext_desc);
+	cmd->frag_desc_bank_cfg.bank_base_addrs[0] =
+				__cpu_to_le32(htt->frag_desc.paddr);
+	cmd->frag_desc_bank_cfg.bank_id[0].bank_max_id =
+				__cpu_to_le16(htt->max_num_pending_tx - 1);
+
+	ret = ath10k_htc_send(&htt->ar->htc, htt->eid, skb);
+	if (ret) {
+		ath10k_warn(ar, "failed to send frag desc bank cfg request: %d\n",
+			    ret);
+		dev_kfree_skb_any(skb);
+		return ret;
+	}
+
+	return 0;
+}
+
 int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt)
 {
 	struct ath10k *ar = htt->ar;
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH v2 8/8] ath10k: configure frag desc memory to target for qca99X0
@ 2015-06-22 14:52   ` Raja Mani
  0 siblings, 0 replies; 36+ messages in thread
From: Raja Mani @ 2015-06-22 14:52 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Raja Mani

Pre qca99X0 chipsets follows the model where dynamically allocate
memory for frag desc on getting new skb for TX. But, this is not
going to be the case in qca99X0. It expects frag desc memory to be
allocated at boot time and let the driver to reuse allocated memory
after every TX completion. So there won't be any dynamic frag memory
memory allocation in qca99X0 during data transmission.

qca99X0 hardware doesn't need fragment desc address to be programmed
in msdu descriptor for every data transaction. It needs to know only
starting address of fragment descriptor at the time of the boot.
During data transmission, qca99X0 hardware can retrieve corresponding
frag addr by adding programmed frag desc base addr + msdu id.

Allocate continuous fragment descriptor memory (same size as number of
descriptor) at the time of target initialization and configure allocated
dma address to the target via HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG.

How this is allocated continuous memory is going to be used is not
covered in this patch. It just allocates memory and hand over to firmware.
If we don't do it at init time, qca99X0 will stall when firmware tries
to do TX.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/core.c   |  1 +
 drivers/net/wireless/ath/ath10k/core.h   |  6 +++
 drivers/net/wireless/ath/ath10k/htt.c    |  4 ++
 drivers/net/wireless/ath/ath10k/htt.h    | 11 +++++
 drivers/net/wireless/ath/ath10k/htt_tx.c | 76 +++++++++++++++++++++++++++++++-
 5 files changed, 96 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 3c8d5c5..be5f01c 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -111,6 +111,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
 		.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
 		.uart_pin = 7,
 		.otp_exe_param = 0x00000700,
+		.continuous_frag_desc = true,
 		.fw = {
 			.dir = QCA99X0_HW_2_0_FW_DIR,
 			.fw = QCA99X0_HW_2_0_FW_FILE,
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index f0811d0..2e5c935 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -582,6 +582,12 @@ struct ath10k {
 		 */
 		bool has_shifted_cc_wraparound;
 
+		/* Some of chip expects fragment descriptor to be continuous
+		 * memory for any TX operation. Set continuous_frag_desc flag
+		 * for the hardware which have such requirement.
+		 */
+		bool continuous_frag_desc;
+
 		struct ath10k_hw_params_fw {
 			const char *dir;
 			const char *fw;
diff --git a/drivers/net/wireless/ath/ath10k/htt.c b/drivers/net/wireless/ath/ath10k/htt.c
index 6f71f94..4474c3e 100644
--- a/drivers/net/wireless/ath/ath10k/htt.c
+++ b/drivers/net/wireless/ath/ath10k/htt.c
@@ -249,5 +249,9 @@ int ath10k_htt_setup(struct ath10k_htt *htt)
 	if (status)
 		return status;
 
+	status = ath10k_htt_send_frag_desc_bank_cfg(htt);
+	if (status)
+		return status;
+
 	return ath10k_htt_send_rx_ring_cfg_ll(htt);
 }
diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h
index 8e64ace..8bdf1e7 100644
--- a/drivers/net/wireless/ath/ath10k/htt.h
+++ b/drivers/net/wireless/ath/ath10k/htt.h
@@ -87,6 +87,11 @@ struct htt_data_tx_desc_frag {
 	__le32 len;
 } __packed;
 
+struct htt_msdu_ext_desc {
+	__le32 tso_flag[4];
+	struct htt_data_tx_desc_frag frags[6];
+};
+
 enum htt_data_tx_desc_flags0 {
 	HTT_DATA_TX_DESC_FLAGS0_MAC_HDR_PRESENT = 1 << 0,
 	HTT_DATA_TX_DESC_FLAGS0_NO_AGGR         = 1 << 1,
@@ -1466,6 +1471,11 @@ struct ath10k_htt {
 
 	/* rx_status template */
 	struct ieee80211_rx_status rx_status;
+
+	struct {
+		dma_addr_t paddr;
+		struct htt_msdu_ext_desc *vaddr;
+	} frag_desc;
 };
 
 #define RX_HTT_HDR_STATUS_LEN 64
@@ -1533,6 +1543,7 @@ void ath10k_htt_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb);
 void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb);
 int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt);
 int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie);
+int ath10k_htt_send_frag_desc_bank_cfg(struct ath10k_htt *htt);
 int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt);
 int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt,
 				u8 max_subfrms_ampdu,
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index a60ef7d..148d5b6 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -84,6 +84,7 @@ void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id)
 int ath10k_htt_tx_alloc(struct ath10k_htt *htt)
 {
 	struct ath10k *ar = htt->ar;
+	int ret, size;
 
 	ath10k_dbg(ar, ATH10K_DBG_BOOT, "htt tx max num pending tx %d\n",
 		   htt->max_num_pending_tx);
@@ -94,11 +95,31 @@ int ath10k_htt_tx_alloc(struct ath10k_htt *htt)
 	htt->tx_pool = dma_pool_create("ath10k htt tx pool", htt->ar->dev,
 				       sizeof(struct ath10k_htt_txbuf), 4, 0);
 	if (!htt->tx_pool) {
-		idr_destroy(&htt->pending_tx);
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto free_idr_pending_tx;
+	}
+
+	if (!ar->hw_params.continuous_frag_desc)
+		goto skip_frag_desc_alloc;
+
+	size = htt->max_num_pending_tx * sizeof(struct htt_msdu_ext_desc);
+	htt->frag_desc.vaddr = dma_alloc_coherent(ar->dev, size,
+						  &htt->frag_desc.paddr,
+						  GFP_DMA);
+	if (!htt->frag_desc.vaddr) {
+		ath10k_warn(ar, "failed to alloc fragment desc memory\n");
+		ret = -ENOMEM;
+		goto free_tx_pool;
 	}
 
+skip_frag_desc_alloc:
 	return 0;
+
+free_tx_pool:
+	dma_pool_destroy(htt->tx_pool);
+free_idr_pending_tx:
+	idr_destroy(&htt->pending_tx);
+	return ret;
 }
 
 static int ath10k_htt_tx_clean_up_pending(int msdu_id, void *skb, void *ctx)
@@ -121,9 +142,18 @@ static int ath10k_htt_tx_clean_up_pending(int msdu_id, void *skb, void *ctx)
 
 void ath10k_htt_tx_free(struct ath10k_htt *htt)
 {
+	int size;
+
 	idr_for_each(&htt->pending_tx, ath10k_htt_tx_clean_up_pending, htt->ar);
 	idr_destroy(&htt->pending_tx);
 	dma_pool_destroy(htt->tx_pool);
+
+	if (htt->frag_desc.vaddr) {
+		size = htt->max_num_pending_tx *
+				  sizeof(struct htt_msdu_ext_desc);
+		dma_free_coherent(htt->ar->dev, size, htt->frag_desc.vaddr,
+				  htt->frag_desc.paddr);
+	}
 }
 
 void ath10k_htt_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb)
@@ -201,6 +231,48 @@ int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64 cookie)
 	return 0;
 }
 
+int ath10k_htt_send_frag_desc_bank_cfg(struct ath10k_htt *htt)
+{
+	struct ath10k *ar = htt->ar;
+	struct sk_buff *skb;
+	struct htt_cmd *cmd;
+	int ret, size;
+
+	if (!ar->hw_params.continuous_frag_desc)
+		return 0;
+
+	if (!htt->frag_desc.paddr) {
+		ath10k_warn(ar, "invalid frag desc memory\n");
+		return -EINVAL;
+	}
+
+	size = sizeof(cmd->hdr) + sizeof(cmd->frag_desc_bank_cfg);
+	skb = ath10k_htc_alloc_skb(ar, size);
+	if (!skb)
+		return -ENOMEM;
+
+	skb_put(skb, size);
+	cmd = (struct htt_cmd *)skb->data;
+	cmd->hdr.msg_type = HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG;
+	cmd->frag_desc_bank_cfg.info = 0;
+	cmd->frag_desc_bank_cfg.num_banks = 1;
+	cmd->frag_desc_bank_cfg.desc_size = sizeof(struct htt_msdu_ext_desc);
+	cmd->frag_desc_bank_cfg.bank_base_addrs[0] =
+				__cpu_to_le32(htt->frag_desc.paddr);
+	cmd->frag_desc_bank_cfg.bank_id[0].bank_max_id =
+				__cpu_to_le16(htt->max_num_pending_tx - 1);
+
+	ret = ath10k_htc_send(&htt->ar->htc, htt->eid, skb);
+	if (ret) {
+		ath10k_warn(ar, "failed to send frag desc bank cfg request: %d\n",
+			    ret);
+		dev_kfree_skb_any(skb);
+		return ret;
+	}
+
+	return 0;
+}
+
 int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt)
 {
 	struct ath10k *ar = htt->ar;
-- 
1.8.1.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply related	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 8/8] ath10k: configure frag desc memory to target for qca99X0
  2015-06-22 14:52   ` Raja Mani
@ 2015-06-22 23:41     ` Peter Oh
  -1 siblings, 0 replies; 36+ messages in thread
From: Peter Oh @ 2015-06-22 23:41 UTC (permalink / raw)
  To: Raja Mani, ath10k; +Cc: linux-wireless

Hi Raja,

On 06/22/2015 07:52 AM, Raja Mani wrote:
> Pre qca99X0 chipsets follows the model where dynamically allocate
> memory for frag desc on getting new skb for TX. But, this is not
> going to be the case in qca99X0. It expects frag desc memory to be
> allocated at boot time and let the driver to reuse allocated memory
> after every TX completion. So there won't be any dynamic frag memory
> memory allocation in qca99X0 during data transmission.
>
> qca99X0 hardware doesn't need fragment desc address to be programmed
> in msdu descriptor for every data transaction. It needs to know only
> starting address of fragment descriptor at the time of the boot.
> During data transmission, qca99X0 hardware can retrieve corresponding
> frag addr by adding programmed frag desc base addr + msdu id.
>
> Allocate continuous fragment descriptor memory (same size as number of
> descriptor) at the time of target initialization and configure allocated
> dma address to the target via HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG.
>
> How this is allocated continuous memory is going to be used is not
> covered in this patch. It just allocates memory and hand over to firmware.
> If we don't do it at init time, qca99X0 will stall when firmware tries
> to do TX.
>
> Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
> ---
>   drivers/net/wireless/ath/ath10k/core.c   |  1 +
>   drivers/net/wireless/ath/ath10k/core.h   |  6 +++
>   drivers/net/wireless/ath/ath10k/htt.c    |  4 ++
>   drivers/net/wireless/ath/ath10k/htt.h    | 11 +++++
>   drivers/net/wireless/ath/ath10k/htt_tx.c | 76
> +++++++++++++++++++++++++++++++-
>   5 files changed, 96 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/core.c
> b/drivers/net/wireless/ath/ath10k/core.c
> index 3c8d5c5..be5f01c 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -111,6 +111,7 @@ static const struct ath10k_hw_params
> ath10k_hw_params_list[] = {
>   		.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
>   		.uart_pin = 7,
>   		.otp_exe_param = 0x00000700,
> +		.continuous_frag_desc = true,
>   		.fw = {
>   			.dir = QCA99X0_HW_2_0_FW_DIR,
>   			.fw = QCA99X0_HW_2_0_FW_FILE,
> diff --git a/drivers/net/wireless/ath/ath10k/core.h
> b/drivers/net/wireless/ath/ath10k/core.h
> index f0811d0..2e5c935 100644
> --- a/drivers/net/wireless/ath/ath10k/core.h
> +++ b/drivers/net/wireless/ath/ath10k/core.h
> @@ -582,6 +582,12 @@ struct ath10k {
>   		 */
>   		bool has_shifted_cc_wraparound;
>   
> +		/* Some of chip expects fragment descriptor to be
> continuous
> +		 * memory for any TX operation. Set continuous_frag_desc
> flag
> +		 * for the hardware which have such requirement.
> +		 */
> +		bool continuous_frag_desc;
> +
>   		struct ath10k_hw_params_fw {
>   			const char *dir;
>   			const char *fw;
> diff --git a/drivers/net/wireless/ath/ath10k/htt.c
> b/drivers/net/wireless/ath/ath10k/htt.c
> index 6f71f94..4474c3e 100644
> --- a/drivers/net/wireless/ath/ath10k/htt.c
> +++ b/drivers/net/wireless/ath/ath10k/htt.c
> @@ -249,5 +249,9 @@ int ath10k_htt_setup(struct ath10k_htt *htt)
>   	if (status)
>   		return status;
>   
> +	status = ath10k_htt_send_frag_desc_bank_cfg(htt);
> +	if (status)
> +		return status;
> +
>   	return ath10k_htt_send_rx_ring_cfg_ll(htt);
>   }
> diff --git a/drivers/net/wireless/ath/ath10k/htt.h
> b/drivers/net/wireless/ath/ath10k/htt.h
> index 8e64ace..8bdf1e7 100644
> --- a/drivers/net/wireless/ath/ath10k/htt.h
> +++ b/drivers/net/wireless/ath/ath10k/htt.h
> @@ -87,6 +87,11 @@ struct htt_data_tx_desc_frag {
>   	__le32 len;
>   } __packed;
>   
> +struct htt_msdu_ext_desc {
> +	__le32 tso_flag[4];
> +	struct htt_data_tx_desc_frag frags[6];
> +};
> +
>   enum htt_data_tx_desc_flags0 {
>   	HTT_DATA_TX_DESC_FLAGS0_MAC_HDR_PRESENT = 1 << 0,
>   	HTT_DATA_TX_DESC_FLAGS0_NO_AGGR         = 1 << 1,
> @@ -1466,6 +1471,11 @@ struct ath10k_htt {
>   
>   	/* rx_status template */
>   	struct ieee80211_rx_status rx_status;
> +
> +	struct {
> +		dma_addr_t paddr;
> +		struct htt_msdu_ext_desc *vaddr;
Defining structure htt_msdu_ext_desc for vaddr instead of void * which 
will be used as base address to get offset address of msdu data could 
lead unexpected address assignment when we manipulate msdu address 
pointer based on vaddr variable.
For example vaddr variable will be used at ath10k_htt_tx like below to 
have msdu external link descriptor.
struct htt_msdu_ext_desc *frags_ext;
frags_ext = htt->frag_desc.vaddr + (sizeof(struct htt_msdu_ext_desc) * 
msdu_id);
If we assume vaddr is 0xde810000 and msdu_id is 1, we expect frags_ext 
has 0xde810040, but linux memory management system could assign 
0xde811000 to frags_ext to use continuous memory block for structure 
htt_msdu_ext_desc and it will cause data traffic failure.
To avoid this scenario, we have to use void * for vaddr.
> +	} frag_desc;
>   };
>   
>   #define RX_HTT_HDR_STATUS_LEN 64
> @@ -1533,6 +1543,7 @@ void ath10k_htt_htc_tx_complete(struct ath10k *ar,
> struct sk_buff *skb);
>   void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb);
>   int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt);
>   int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64
> cookie);
> +int ath10k_htt_send_frag_desc_bank_cfg(struct ath10k_htt *htt);
>   int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt);
>   int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt,
>   				u8 max_subfrms_ampdu,
> diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c
> b/drivers/net/wireless/ath/ath10k/htt_tx.c
> index a60ef7d..148d5b6 100644
> --- a/drivers/net/wireless/ath/ath10k/htt_tx.c
> +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
> @@ -84,6 +84,7 @@ void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt,
> u16 msdu_id)
>   int ath10k_htt_tx_alloc(struct ath10k_htt *htt)
>   {
>   	struct ath10k *ar = htt->ar;
> +	int ret, size;
>   
>   	ath10k_dbg(ar, ATH10K_DBG_BOOT, "htt tx max num pending tx %d\n",
>   		   htt->max_num_pending_tx);
> @@ -94,11 +95,31 @@ int ath10k_htt_tx_alloc(struct ath10k_htt *htt)
>   	htt->tx_pool = dma_pool_create("ath10k htt tx pool", htt->ar->dev,
>   				       sizeof(struct ath10k_htt_txbuf), 4,
> 0);
>   	if (!htt->tx_pool) {
> -		idr_destroy(&htt->pending_tx);
> -		return -ENOMEM;
> +		ret = -ENOMEM;
> +		goto free_idr_pending_tx;
> +	}
> +
> +	if (!ar->hw_params.continuous_frag_desc)
> +		goto skip_frag_desc_alloc;
> +
> +	size = htt->max_num_pending_tx * sizeof(struct htt_msdu_ext_desc);
> +	htt->frag_desc.vaddr = dma_alloc_coherent(ar->dev, size,
> +						  &htt->frag_desc.paddr,
> +						  GFP_DMA);
> +	if (!htt->frag_desc.vaddr) {
> +		ath10k_warn(ar, "failed to alloc fragment desc memory\n");
> +		ret = -ENOMEM;
> +		goto free_tx_pool;
>   	}
>   
> +skip_frag_desc_alloc:
>   	return 0;
> +
> +free_tx_pool:
> +	dma_pool_destroy(htt->tx_pool);
> +free_idr_pending_tx:
> +	idr_destroy(&htt->pending_tx);
> +	return ret;
>   }
>   
>   static int ath10k_htt_tx_clean_up_pending(int msdu_id, void *skb, void
> *ctx)
> @@ -121,9 +142,18 @@ static int ath10k_htt_tx_clean_up_pending(int
> msdu_id, void *skb, void *ctx)
>   
>   void ath10k_htt_tx_free(struct ath10k_htt *htt)
>   {
> +	int size;
> +
>   	idr_for_each(&htt->pending_tx, ath10k_htt_tx_clean_up_pending,
> htt->ar);
>   	idr_destroy(&htt->pending_tx);
>   	dma_pool_destroy(htt->tx_pool);
> +
> +	if (htt->frag_desc.vaddr) {
> +		size = htt->max_num_pending_tx *
> +				  sizeof(struct htt_msdu_ext_desc);
> +		dma_free_coherent(htt->ar->dev, size,
> htt->frag_desc.vaddr,
> +				  htt->frag_desc.paddr);
> +	}
>   }
>   
>   void ath10k_htt_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb)
> @@ -201,6 +231,48 @@ int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt,
> u8 mask, u64 cookie)
>   	return 0;
>   }
>   
> +int ath10k_htt_send_frag_desc_bank_cfg(struct ath10k_htt *htt)
> +{
> +	struct ath10k *ar = htt->ar;
> +	struct sk_buff *skb;
> +	struct htt_cmd *cmd;
> +	int ret, size;
> +
> +	if (!ar->hw_params.continuous_frag_desc)
> +		return 0;
> +
> +	if (!htt->frag_desc.paddr) {
> +		ath10k_warn(ar, "invalid frag desc memory\n");
> +		return -EINVAL;
> +	}
> +
> +	size = sizeof(cmd->hdr) + sizeof(cmd->frag_desc_bank_cfg);
> +	skb = ath10k_htc_alloc_skb(ar, size);
> +	if (!skb)
> +		return -ENOMEM;
> +
> +	skb_put(skb, size);
> +	cmd = (struct htt_cmd *)skb->data;
> +	cmd->hdr.msg_type = HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG;
> +	cmd->frag_desc_bank_cfg.info = 0;
> +	cmd->frag_desc_bank_cfg.num_banks = 1;
> +	cmd->frag_desc_bank_cfg.desc_size = sizeof(struct
> htt_msdu_ext_desc);
> +	cmd->frag_desc_bank_cfg.bank_base_addrs[0] =
> +				__cpu_to_le32(htt->frag_desc.paddr);
> +	cmd->frag_desc_bank_cfg.bank_id[0].bank_max_id =
> +				__cpu_to_le16(htt->max_num_pending_tx -
> 1);
> +
> +	ret = ath10k_htc_send(&htt->ar->htc, htt->eid, skb);
> +	if (ret) {
> +		ath10k_warn(ar, "failed to send frag desc bank cfg
> request: %d\n",
> +			    ret);
> +		dev_kfree_skb_any(skb);
> +		return ret;
> +	}
> +
> +	return 0;
> +}
> +
>   int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt)
>   {
>   	struct ath10k *ar = htt->ar;
Regards,
Peter
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 8/8] ath10k: configure frag desc memory to target for qca99X0
@ 2015-06-22 23:41     ` Peter Oh
  0 siblings, 0 replies; 36+ messages in thread
From: Peter Oh @ 2015-06-22 23:41 UTC (permalink / raw)
  To: Raja Mani, ath10k; +Cc: linux-wireless

Hi Raja,

On 06/22/2015 07:52 AM, Raja Mani wrote:
> Pre qca99X0 chipsets follows the model where dynamically allocate
> memory for frag desc on getting new skb for TX. But, this is not
> going to be the case in qca99X0. It expects frag desc memory to be
> allocated at boot time and let the driver to reuse allocated memory
> after every TX completion. So there won't be any dynamic frag memory
> memory allocation in qca99X0 during data transmission.
>
> qca99X0 hardware doesn't need fragment desc address to be programmed
> in msdu descriptor for every data transaction. It needs to know only
> starting address of fragment descriptor at the time of the boot.
> During data transmission, qca99X0 hardware can retrieve corresponding
> frag addr by adding programmed frag desc base addr + msdu id.
>
> Allocate continuous fragment descriptor memory (same size as number of
> descriptor) at the time of target initialization and configure allocated
> dma address to the target via HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG.
>
> How this is allocated continuous memory is going to be used is not
> covered in this patch. It just allocates memory and hand over to firmware.
> If we don't do it at init time, qca99X0 will stall when firmware tries
> to do TX.
>
> Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
> ---
>   drivers/net/wireless/ath/ath10k/core.c   |  1 +
>   drivers/net/wireless/ath/ath10k/core.h   |  6 +++
>   drivers/net/wireless/ath/ath10k/htt.c    |  4 ++
>   drivers/net/wireless/ath/ath10k/htt.h    | 11 +++++
>   drivers/net/wireless/ath/ath10k/htt_tx.c | 76
> +++++++++++++++++++++++++++++++-
>   5 files changed, 96 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/core.c
> b/drivers/net/wireless/ath/ath10k/core.c
> index 3c8d5c5..be5f01c 100644
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -111,6 +111,7 @@ static const struct ath10k_hw_params
> ath10k_hw_params_list[] = {
>   		.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
>   		.uart_pin = 7,
>   		.otp_exe_param = 0x00000700,
> +		.continuous_frag_desc = true,
>   		.fw = {
>   			.dir = QCA99X0_HW_2_0_FW_DIR,
>   			.fw = QCA99X0_HW_2_0_FW_FILE,
> diff --git a/drivers/net/wireless/ath/ath10k/core.h
> b/drivers/net/wireless/ath/ath10k/core.h
> index f0811d0..2e5c935 100644
> --- a/drivers/net/wireless/ath/ath10k/core.h
> +++ b/drivers/net/wireless/ath/ath10k/core.h
> @@ -582,6 +582,12 @@ struct ath10k {
>   		 */
>   		bool has_shifted_cc_wraparound;
>   
> +		/* Some of chip expects fragment descriptor to be
> continuous
> +		 * memory for any TX operation. Set continuous_frag_desc
> flag
> +		 * for the hardware which have such requirement.
> +		 */
> +		bool continuous_frag_desc;
> +
>   		struct ath10k_hw_params_fw {
>   			const char *dir;
>   			const char *fw;
> diff --git a/drivers/net/wireless/ath/ath10k/htt.c
> b/drivers/net/wireless/ath/ath10k/htt.c
> index 6f71f94..4474c3e 100644
> --- a/drivers/net/wireless/ath/ath10k/htt.c
> +++ b/drivers/net/wireless/ath/ath10k/htt.c
> @@ -249,5 +249,9 @@ int ath10k_htt_setup(struct ath10k_htt *htt)
>   	if (status)
>   		return status;
>   
> +	status = ath10k_htt_send_frag_desc_bank_cfg(htt);
> +	if (status)
> +		return status;
> +
>   	return ath10k_htt_send_rx_ring_cfg_ll(htt);
>   }
> diff --git a/drivers/net/wireless/ath/ath10k/htt.h
> b/drivers/net/wireless/ath/ath10k/htt.h
> index 8e64ace..8bdf1e7 100644
> --- a/drivers/net/wireless/ath/ath10k/htt.h
> +++ b/drivers/net/wireless/ath/ath10k/htt.h
> @@ -87,6 +87,11 @@ struct htt_data_tx_desc_frag {
>   	__le32 len;
>   } __packed;
>   
> +struct htt_msdu_ext_desc {
> +	__le32 tso_flag[4];
> +	struct htt_data_tx_desc_frag frags[6];
> +};
> +
>   enum htt_data_tx_desc_flags0 {
>   	HTT_DATA_TX_DESC_FLAGS0_MAC_HDR_PRESENT = 1 << 0,
>   	HTT_DATA_TX_DESC_FLAGS0_NO_AGGR         = 1 << 1,
> @@ -1466,6 +1471,11 @@ struct ath10k_htt {
>   
>   	/* rx_status template */
>   	struct ieee80211_rx_status rx_status;
> +
> +	struct {
> +		dma_addr_t paddr;
> +		struct htt_msdu_ext_desc *vaddr;
Defining structure htt_msdu_ext_desc for vaddr instead of void * which 
will be used as base address to get offset address of msdu data could 
lead unexpected address assignment when we manipulate msdu address 
pointer based on vaddr variable.
For example vaddr variable will be used at ath10k_htt_tx like below to 
have msdu external link descriptor.
struct htt_msdu_ext_desc *frags_ext;
frags_ext = htt->frag_desc.vaddr + (sizeof(struct htt_msdu_ext_desc) * 
msdu_id);
If we assume vaddr is 0xde810000 and msdu_id is 1, we expect frags_ext 
has 0xde810040, but linux memory management system could assign 
0xde811000 to frags_ext to use continuous memory block for structure 
htt_msdu_ext_desc and it will cause data traffic failure.
To avoid this scenario, we have to use void * for vaddr.
> +	} frag_desc;
>   };
>   
>   #define RX_HTT_HDR_STATUS_LEN 64
> @@ -1533,6 +1543,7 @@ void ath10k_htt_htc_tx_complete(struct ath10k *ar,
> struct sk_buff *skb);
>   void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb);
>   int ath10k_htt_h2t_ver_req_msg(struct ath10k_htt *htt);
>   int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt, u8 mask, u64
> cookie);
> +int ath10k_htt_send_frag_desc_bank_cfg(struct ath10k_htt *htt);
>   int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt);
>   int ath10k_htt_h2t_aggr_cfg_msg(struct ath10k_htt *htt,
>   				u8 max_subfrms_ampdu,
> diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c
> b/drivers/net/wireless/ath/ath10k/htt_tx.c
> index a60ef7d..148d5b6 100644
> --- a/drivers/net/wireless/ath/ath10k/htt_tx.c
> +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
> @@ -84,6 +84,7 @@ void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt,
> u16 msdu_id)
>   int ath10k_htt_tx_alloc(struct ath10k_htt *htt)
>   {
>   	struct ath10k *ar = htt->ar;
> +	int ret, size;
>   
>   	ath10k_dbg(ar, ATH10K_DBG_BOOT, "htt tx max num pending tx %d\n",
>   		   htt->max_num_pending_tx);
> @@ -94,11 +95,31 @@ int ath10k_htt_tx_alloc(struct ath10k_htt *htt)
>   	htt->tx_pool = dma_pool_create("ath10k htt tx pool", htt->ar->dev,
>   				       sizeof(struct ath10k_htt_txbuf), 4,
> 0);
>   	if (!htt->tx_pool) {
> -		idr_destroy(&htt->pending_tx);
> -		return -ENOMEM;
> +		ret = -ENOMEM;
> +		goto free_idr_pending_tx;
> +	}
> +
> +	if (!ar->hw_params.continuous_frag_desc)
> +		goto skip_frag_desc_alloc;
> +
> +	size = htt->max_num_pending_tx * sizeof(struct htt_msdu_ext_desc);
> +	htt->frag_desc.vaddr = dma_alloc_coherent(ar->dev, size,
> +						  &htt->frag_desc.paddr,
> +						  GFP_DMA);
> +	if (!htt->frag_desc.vaddr) {
> +		ath10k_warn(ar, "failed to alloc fragment desc memory\n");
> +		ret = -ENOMEM;
> +		goto free_tx_pool;
>   	}
>   
> +skip_frag_desc_alloc:
>   	return 0;
> +
> +free_tx_pool:
> +	dma_pool_destroy(htt->tx_pool);
> +free_idr_pending_tx:
> +	idr_destroy(&htt->pending_tx);
> +	return ret;
>   }
>   
>   static int ath10k_htt_tx_clean_up_pending(int msdu_id, void *skb, void
> *ctx)
> @@ -121,9 +142,18 @@ static int ath10k_htt_tx_clean_up_pending(int
> msdu_id, void *skb, void *ctx)
>   
>   void ath10k_htt_tx_free(struct ath10k_htt *htt)
>   {
> +	int size;
> +
>   	idr_for_each(&htt->pending_tx, ath10k_htt_tx_clean_up_pending,
> htt->ar);
>   	idr_destroy(&htt->pending_tx);
>   	dma_pool_destroy(htt->tx_pool);
> +
> +	if (htt->frag_desc.vaddr) {
> +		size = htt->max_num_pending_tx *
> +				  sizeof(struct htt_msdu_ext_desc);
> +		dma_free_coherent(htt->ar->dev, size,
> htt->frag_desc.vaddr,
> +				  htt->frag_desc.paddr);
> +	}
>   }
>   
>   void ath10k_htt_htc_tx_complete(struct ath10k *ar, struct sk_buff *skb)
> @@ -201,6 +231,48 @@ int ath10k_htt_h2t_stats_req(struct ath10k_htt *htt,
> u8 mask, u64 cookie)
>   	return 0;
>   }
>   
> +int ath10k_htt_send_frag_desc_bank_cfg(struct ath10k_htt *htt)
> +{
> +	struct ath10k *ar = htt->ar;
> +	struct sk_buff *skb;
> +	struct htt_cmd *cmd;
> +	int ret, size;
> +
> +	if (!ar->hw_params.continuous_frag_desc)
> +		return 0;
> +
> +	if (!htt->frag_desc.paddr) {
> +		ath10k_warn(ar, "invalid frag desc memory\n");
> +		return -EINVAL;
> +	}
> +
> +	size = sizeof(cmd->hdr) + sizeof(cmd->frag_desc_bank_cfg);
> +	skb = ath10k_htc_alloc_skb(ar, size);
> +	if (!skb)
> +		return -ENOMEM;
> +
> +	skb_put(skb, size);
> +	cmd = (struct htt_cmd *)skb->data;
> +	cmd->hdr.msg_type = HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG;
> +	cmd->frag_desc_bank_cfg.info = 0;
> +	cmd->frag_desc_bank_cfg.num_banks = 1;
> +	cmd->frag_desc_bank_cfg.desc_size = sizeof(struct
> htt_msdu_ext_desc);
> +	cmd->frag_desc_bank_cfg.bank_base_addrs[0] =
> +				__cpu_to_le32(htt->frag_desc.paddr);
> +	cmd->frag_desc_bank_cfg.bank_id[0].bank_max_id =
> +				__cpu_to_le16(htt->max_num_pending_tx -
> 1);
> +
> +	ret = ath10k_htc_send(&htt->ar->htc, htt->eid, skb);
> +	if (ret) {
> +		ath10k_warn(ar, "failed to send frag desc bank cfg
> request: %d\n",
> +			    ret);
> +		dev_kfree_skb_any(skb);
> +		return ret;
> +	}
> +
> +	return 0;
> +}
> +
>   int ath10k_htt_send_rx_ring_cfg_ll(struct ath10k_htt *htt)
>   {
>   	struct ath10k *ar = htt->ar;
Regards,
Peter

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 8/8] ath10k: configure frag desc memory to target for qca99X0
  2015-06-22 23:41     ` Peter Oh
@ 2015-06-23  5:48       ` rmani
  -1 siblings, 0 replies; 36+ messages in thread
From: rmani @ 2015-06-23  5:48 UTC (permalink / raw)
  To: Peter Oh; +Cc: ath10k, linux-wireless

On 06/23/2015 05:11 AM, Peter Oh wrote:
> Hi Raja,
>
> On 06/22/2015 07:52 AM, Raja Mani wrote:
>> Pre qca99X0 chipsets follows the model where dynamically allocate
>> memory for frag desc on getting new skb for TX. But, this is not
>> going to be the case in qca99X0. It expects frag desc memory to be
>> allocated at boot time and let the driver to reuse allocated memory
>> after every TX completion. So there won't be any dynamic frag memory
>> memory allocation in qca99X0 during data transmission.
>>
>> qca99X0 hardware doesn't need fragment desc address to be programmed
>> in msdu descriptor for every data transaction. It needs to know only
>> starting address of fragment descriptor at the time of the boot.
>> During data transmission, qca99X0 hardware can retrieve corresponding
>> frag addr by adding programmed frag desc base addr + msdu id.
>>
>> Allocate continuous fragment descriptor memory (same size as number of
>> descriptor) at the time of target initialization and configure allocated
>> dma address to the target via HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG.
>>
>> How this is allocated continuous memory is going to be used is not
>> covered in this patch. It just allocates memory and hand over to
>> firmware.
>> If we don't do it at init time, qca99X0 will stall when firmware tries
>> to do TX.
>>
>> Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
>> ---
>>   drivers/net/wireless/ath/ath10k/core.c   |  1 +
>>   drivers/net/wireless/ath/ath10k/core.h   |  6 +++
>>   drivers/net/wireless/ath/ath10k/htt.c    |  4 ++
>>   drivers/net/wireless/ath/ath10k/htt.h    | 11 +++++
>>   drivers/net/wireless/ath/ath10k/htt_tx.c | 76
>> +++++++++++++++++++++++++++++++-
>>   5 files changed, 96 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath10k/core.c
>> b/drivers/net/wireless/ath/ath10k/core.c
>> index 3c8d5c5..be5f01c 100644
>> --- a/drivers/net/wireless/ath/ath10k/core.c
>> +++ b/drivers/net/wireless/ath/ath10k/core.c
>> @@ -111,6 +111,7 @@ static const struct ath10k_hw_params
>> ath10k_hw_params_list[] = {
>>           .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
>>           .uart_pin = 7,
>>           .otp_exe_param = 0x00000700,
>> +        .continuous_frag_desc = true,
>>           .fw = {
>>               .dir = QCA99X0_HW_2_0_FW_DIR,
>>               .fw = QCA99X0_HW_2_0_FW_FILE,
>> diff --git a/drivers/net/wireless/ath/ath10k/core.h
>> b/drivers/net/wireless/ath/ath10k/core.h
>> index f0811d0..2e5c935 100644
>> --- a/drivers/net/wireless/ath/ath10k/core.h
>> +++ b/drivers/net/wireless/ath/ath10k/core.h
>> @@ -582,6 +582,12 @@ struct ath10k {
>>            */
>>           bool has_shifted_cc_wraparound;
>> +        /* Some of chip expects fragment descriptor to be
>> continuous
>> +         * memory for any TX operation. Set continuous_frag_desc
>> flag
>> +         * for the hardware which have such requirement.
>> +         */
>> +        bool continuous_frag_desc;
>> +
>>           struct ath10k_hw_params_fw {
>>               const char *dir;
>>               const char *fw;
>> diff --git a/drivers/net/wireless/ath/ath10k/htt.c
>> b/drivers/net/wireless/ath/ath10k/htt.c
>> index 6f71f94..4474c3e 100644
>> --- a/drivers/net/wireless/ath/ath10k/htt.c
>> +++ b/drivers/net/wireless/ath/ath10k/htt.c
>> @@ -249,5 +249,9 @@ int ath10k_htt_setup(struct ath10k_htt *htt)
>>       if (status)
>>           return status;
>> +    status = ath10k_htt_send_frag_desc_bank_cfg(htt);
>> +    if (status)
>> +        return status;
>> +
>>       return ath10k_htt_send_rx_ring_cfg_ll(htt);
>>   }
>> diff --git a/drivers/net/wireless/ath/ath10k/htt.h
>> b/drivers/net/wireless/ath/ath10k/htt.h
>> index 8e64ace..8bdf1e7 100644
>> --- a/drivers/net/wireless/ath/ath10k/htt.h
>> +++ b/drivers/net/wireless/ath/ath10k/htt.h
>> @@ -87,6 +87,11 @@ struct htt_data_tx_desc_frag {
>>       __le32 len;
>>   } __packed;
>> +struct htt_msdu_ext_desc {
>> +    __le32 tso_flag[4];
>> +    struct htt_data_tx_desc_frag frags[6];
>> +};
>> +
>>   enum htt_data_tx_desc_flags0 {
>>       HTT_DATA_TX_DESC_FLAGS0_MAC_HDR_PRESENT = 1 << 0,
>>       HTT_DATA_TX_DESC_FLAGS0_NO_AGGR         = 1 << 1,
>> @@ -1466,6 +1471,11 @@ struct ath10k_htt {
>>       /* rx_status template */
>>       struct ieee80211_rx_status rx_status;
>> +
>> +    struct {
>> +        dma_addr_t paddr;
>> +        struct htt_msdu_ext_desc *vaddr;
> Defining structure htt_msdu_ext_desc for vaddr instead of void * which
> will be used as base address to get offset address of msdu data could
> lead unexpected address assignment when we manipulate msdu address
> pointer based on vaddr variable.
> For example vaddr variable will be used at ath10k_htt_tx like below to
> have msdu external link descriptor.
> struct htt_msdu_ext_desc *frags_ext;
> frags_ext = htt->frag_desc.vaddr + (sizeof(struct htt_msdu_ext_desc) *
> msdu_id);
> If we assume vaddr is 0xde810000 and msdu_id is 1, we expect frags_ext
> has 0xde810040, but linux memory management system could assign
> 0xde811000 to frags_ext to use continuous memory block for structure
> htt_msdu_ext_desc and it will cause data traffic failure.
> To avoid this scenario, we have to use void * for vaddr.


Here we know the type of memory what for we are allocating, thats why
i kept it as struct htt_msdu_ext_desc *. We can type cast base addr
to u8 * in future and use it in the place where frag_ext is calculated
More over, this patch doesn't cover on how each frag desc memory is
manipulated. For now, let it be type struct htt_msdu_ext_desc *.

--
Raja
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 8/8] ath10k: configure frag desc memory to target for qca99X0
@ 2015-06-23  5:48       ` rmani
  0 siblings, 0 replies; 36+ messages in thread
From: rmani @ 2015-06-23  5:48 UTC (permalink / raw)
  To: Peter Oh; +Cc: linux-wireless, ath10k

On 06/23/2015 05:11 AM, Peter Oh wrote:
> Hi Raja,
>
> On 06/22/2015 07:52 AM, Raja Mani wrote:
>> Pre qca99X0 chipsets follows the model where dynamically allocate
>> memory for frag desc on getting new skb for TX. But, this is not
>> going to be the case in qca99X0. It expects frag desc memory to be
>> allocated at boot time and let the driver to reuse allocated memory
>> after every TX completion. So there won't be any dynamic frag memory
>> memory allocation in qca99X0 during data transmission.
>>
>> qca99X0 hardware doesn't need fragment desc address to be programmed
>> in msdu descriptor for every data transaction. It needs to know only
>> starting address of fragment descriptor at the time of the boot.
>> During data transmission, qca99X0 hardware can retrieve corresponding
>> frag addr by adding programmed frag desc base addr + msdu id.
>>
>> Allocate continuous fragment descriptor memory (same size as number of
>> descriptor) at the time of target initialization and configure allocated
>> dma address to the target via HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG.
>>
>> How this is allocated continuous memory is going to be used is not
>> covered in this patch. It just allocates memory and hand over to
>> firmware.
>> If we don't do it at init time, qca99X0 will stall when firmware tries
>> to do TX.
>>
>> Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
>> ---
>>   drivers/net/wireless/ath/ath10k/core.c   |  1 +
>>   drivers/net/wireless/ath/ath10k/core.h   |  6 +++
>>   drivers/net/wireless/ath/ath10k/htt.c    |  4 ++
>>   drivers/net/wireless/ath/ath10k/htt.h    | 11 +++++
>>   drivers/net/wireless/ath/ath10k/htt_tx.c | 76
>> +++++++++++++++++++++++++++++++-
>>   5 files changed, 96 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/wireless/ath/ath10k/core.c
>> b/drivers/net/wireless/ath/ath10k/core.c
>> index 3c8d5c5..be5f01c 100644
>> --- a/drivers/net/wireless/ath/ath10k/core.c
>> +++ b/drivers/net/wireless/ath/ath10k/core.c
>> @@ -111,6 +111,7 @@ static const struct ath10k_hw_params
>> ath10k_hw_params_list[] = {
>>           .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
>>           .uart_pin = 7,
>>           .otp_exe_param = 0x00000700,
>> +        .continuous_frag_desc = true,
>>           .fw = {
>>               .dir = QCA99X0_HW_2_0_FW_DIR,
>>               .fw = QCA99X0_HW_2_0_FW_FILE,
>> diff --git a/drivers/net/wireless/ath/ath10k/core.h
>> b/drivers/net/wireless/ath/ath10k/core.h
>> index f0811d0..2e5c935 100644
>> --- a/drivers/net/wireless/ath/ath10k/core.h
>> +++ b/drivers/net/wireless/ath/ath10k/core.h
>> @@ -582,6 +582,12 @@ struct ath10k {
>>            */
>>           bool has_shifted_cc_wraparound;
>> +        /* Some of chip expects fragment descriptor to be
>> continuous
>> +         * memory for any TX operation. Set continuous_frag_desc
>> flag
>> +         * for the hardware which have such requirement.
>> +         */
>> +        bool continuous_frag_desc;
>> +
>>           struct ath10k_hw_params_fw {
>>               const char *dir;
>>               const char *fw;
>> diff --git a/drivers/net/wireless/ath/ath10k/htt.c
>> b/drivers/net/wireless/ath/ath10k/htt.c
>> index 6f71f94..4474c3e 100644
>> --- a/drivers/net/wireless/ath/ath10k/htt.c
>> +++ b/drivers/net/wireless/ath/ath10k/htt.c
>> @@ -249,5 +249,9 @@ int ath10k_htt_setup(struct ath10k_htt *htt)
>>       if (status)
>>           return status;
>> +    status = ath10k_htt_send_frag_desc_bank_cfg(htt);
>> +    if (status)
>> +        return status;
>> +
>>       return ath10k_htt_send_rx_ring_cfg_ll(htt);
>>   }
>> diff --git a/drivers/net/wireless/ath/ath10k/htt.h
>> b/drivers/net/wireless/ath/ath10k/htt.h
>> index 8e64ace..8bdf1e7 100644
>> --- a/drivers/net/wireless/ath/ath10k/htt.h
>> +++ b/drivers/net/wireless/ath/ath10k/htt.h
>> @@ -87,6 +87,11 @@ struct htt_data_tx_desc_frag {
>>       __le32 len;
>>   } __packed;
>> +struct htt_msdu_ext_desc {
>> +    __le32 tso_flag[4];
>> +    struct htt_data_tx_desc_frag frags[6];
>> +};
>> +
>>   enum htt_data_tx_desc_flags0 {
>>       HTT_DATA_TX_DESC_FLAGS0_MAC_HDR_PRESENT = 1 << 0,
>>       HTT_DATA_TX_DESC_FLAGS0_NO_AGGR         = 1 << 1,
>> @@ -1466,6 +1471,11 @@ struct ath10k_htt {
>>       /* rx_status template */
>>       struct ieee80211_rx_status rx_status;
>> +
>> +    struct {
>> +        dma_addr_t paddr;
>> +        struct htt_msdu_ext_desc *vaddr;
> Defining structure htt_msdu_ext_desc for vaddr instead of void * which
> will be used as base address to get offset address of msdu data could
> lead unexpected address assignment when we manipulate msdu address
> pointer based on vaddr variable.
> For example vaddr variable will be used at ath10k_htt_tx like below to
> have msdu external link descriptor.
> struct htt_msdu_ext_desc *frags_ext;
> frags_ext = htt->frag_desc.vaddr + (sizeof(struct htt_msdu_ext_desc) *
> msdu_id);
> If we assume vaddr is 0xde810000 and msdu_id is 1, we expect frags_ext
> has 0xde810040, but linux memory management system could assign
> 0xde811000 to frags_ext to use continuous memory block for structure
> htt_msdu_ext_desc and it will cause data traffic failure.
> To avoid this scenario, we have to use void * for vaddr.


Here we know the type of memory what for we are allocating, thats why
i kept it as struct htt_msdu_ext_desc *. We can type cast base addr
to u8 * in future and use it in the place where frag_ext is calculated
More over, this patch doesn't cover on how each frag desc memory is
manipulated. For now, let it be type struct htt_msdu_ext_desc *.

--
Raja

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 1/8] ath10k: enhance swba event handler to adapt different size tim bitmap
  2015-06-22 14:52   ` Raja Mani
@ 2015-07-01 10:16     ` Kalle Valo
  -1 siblings, 0 replies; 36+ messages in thread
From: Kalle Valo @ 2015-07-01 10:16 UTC (permalink / raw)
  To: Raja Mani; +Cc: ath10k, linux-wireless

Raja Mani <rmani@qti.qualcomm.com> writes:

> Due to 512 client support in 10.4 firmware, size of tim ie is going
> to be slightly higher than non 10.4 firmware. So, size of tim_bitmap
> what is carried in swba event from 10.4 firmware is bit higher.
>
> The only bottle neck to reuse existing swba handler
> ath10k_wmi_event_host_swba() for 10.4 is that code designed to deal
> with fixed size tim bitmap(ie, tim_info[].tim_bitmap in wmi_swba_ev_arg).
> This patch removes such size limitation and makes it more suitable
> to handle swba event which has different size tim bitmap.
>
> All existing swba event parsing functions are changed to adapt this
> change. Actual support to handle 10.4 swba event is added in next patch.
> Only preparation is made in this patch.
>
> Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>

[...]

> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -2874,33 +2874,38 @@ exit:
>  static void ath10k_wmi_update_tim(struct ath10k *ar,
>  				  struct ath10k_vif *arvif,
>  				  struct sk_buff *bcn,
> -				  const struct wmi_tim_info *tim_info)
> +				  const struct wmi_tim_info_arg *tim_info)
>  {
>  	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)bcn->data;
>  	struct ieee80211_tim_ie *tim;
>  	u8 *ies, *ie;
>  	u8 ie_len, pvm_len;
>  	__le32 t;
> -	u32 v;
> +	u32 v, tim_len;
> +
> +	/* When FW reports 0 in tim_len, ensure atleast first byte
> +	 * in tim_bitmap is considered for pvm calculation.
> +	 */
> +	tim_len = tim_info->tim_len ? __le32_to_cpu(tim_info->tim_len) : 1;
>  
>  	/* if next SWBA has no tim_changed the tim_bitmap is garbage.
>  	 * we must copy the bitmap upon change and reuse it later */
>  	if (__le32_to_cpu(tim_info->tim_changed)) {
>  		int i;
>  
> -		BUILD_BUG_ON(sizeof(arvif->u.ap.tim_bitmap) !=
> -			     sizeof(tim_info->tim_bitmap));
> +		WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);

I'm worried that this WARN_ON() spams too much so I changed it to:

--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -2893,7 +2893,7 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,
        if (__le32_to_cpu(tim_info->tim_changed)) {
                int i;
 
-               WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
+               WARN_ON_ONCE(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
 
                for (i = 0; i < tim_len; i++) {
                        t = tim_info->tim_bitmap[i / 4];


-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 1/8] ath10k: enhance swba event handler to adapt different size tim bitmap
@ 2015-07-01 10:16     ` Kalle Valo
  0 siblings, 0 replies; 36+ messages in thread
From: Kalle Valo @ 2015-07-01 10:16 UTC (permalink / raw)
  To: Raja Mani; +Cc: linux-wireless, ath10k

Raja Mani <rmani@qti.qualcomm.com> writes:

> Due to 512 client support in 10.4 firmware, size of tim ie is going
> to be slightly higher than non 10.4 firmware. So, size of tim_bitmap
> what is carried in swba event from 10.4 firmware is bit higher.
>
> The only bottle neck to reuse existing swba handler
> ath10k_wmi_event_host_swba() for 10.4 is that code designed to deal
> with fixed size tim bitmap(ie, tim_info[].tim_bitmap in wmi_swba_ev_arg).
> This patch removes such size limitation and makes it more suitable
> to handle swba event which has different size tim bitmap.
>
> All existing swba event parsing functions are changed to adapt this
> change. Actual support to handle 10.4 swba event is added in next patch.
> Only preparation is made in this patch.
>
> Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>

[...]

> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -2874,33 +2874,38 @@ exit:
>  static void ath10k_wmi_update_tim(struct ath10k *ar,
>  				  struct ath10k_vif *arvif,
>  				  struct sk_buff *bcn,
> -				  const struct wmi_tim_info *tim_info)
> +				  const struct wmi_tim_info_arg *tim_info)
>  {
>  	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)bcn->data;
>  	struct ieee80211_tim_ie *tim;
>  	u8 *ies, *ie;
>  	u8 ie_len, pvm_len;
>  	__le32 t;
> -	u32 v;
> +	u32 v, tim_len;
> +
> +	/* When FW reports 0 in tim_len, ensure atleast first byte
> +	 * in tim_bitmap is considered for pvm calculation.
> +	 */
> +	tim_len = tim_info->tim_len ? __le32_to_cpu(tim_info->tim_len) : 1;
>  
>  	/* if next SWBA has no tim_changed the tim_bitmap is garbage.
>  	 * we must copy the bitmap upon change and reuse it later */
>  	if (__le32_to_cpu(tim_info->tim_changed)) {
>  		int i;
>  
> -		BUILD_BUG_ON(sizeof(arvif->u.ap.tim_bitmap) !=
> -			     sizeof(tim_info->tim_bitmap));
> +		WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);

I'm worried that this WARN_ON() spams too much so I changed it to:

--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -2893,7 +2893,7 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,
        if (__le32_to_cpu(tim_info->tim_changed)) {
                int i;
 
-               WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
+               WARN_ON_ONCE(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
 
                for (i = 0; i < tim_len; i++) {
                        t = tim_info->tim_bitmap[i / 4];


-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 1/8] ath10k: enhance swba event handler to adapt different size tim bitmap
  2015-07-01 10:16     ` Kalle Valo
@ 2015-07-01 10:21       ` rmani
  -1 siblings, 0 replies; 36+ messages in thread
From: rmani @ 2015-07-01 10:21 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath10k, linux-wireless

On 07/01/2015 03:46 PM, Kalle Valo wrote:
> Raja Mani <rmani@qti.qualcomm.com> writes:
>
>> Due to 512 client support in 10.4 firmware, size of tim ie is going
>> to be slightly higher than non 10.4 firmware. So, size of tim_bitmap
>> what is carried in swba event from 10.4 firmware is bit higher.
>>
>> The only bottle neck to reuse existing swba handler
>> ath10k_wmi_event_host_swba() for 10.4 is that code designed to deal
>> with fixed size tim bitmap(ie, tim_info[].tim_bitmap in wmi_swba_ev_arg).
>> This patch removes such size limitation and makes it more suitable
>> to handle swba event which has different size tim bitmap.
>>
>> All existing swba event parsing functions are changed to adapt this
>> change. Actual support to handle 10.4 swba event is added in next patch.
>> Only preparation is made in this patch.
>>
>> Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
>
[..]
>> -		BUILD_BUG_ON(sizeof(arvif->u.ap.tim_bitmap) !=
>> -			     sizeof(tim_info->tim_bitmap));
>> +		WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
>
> I'm worried that this WARN_ON() spams too much so I changed it to:
>
> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -2893,7 +2893,7 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,
>          if (__le32_to_cpu(tim_info->tim_changed)) {
>                  int i;
>
> -               WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
> +               WARN_ON_ONCE(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
>
>                  for (i = 0; i < tim_len; i++) {
>                          t = tim_info->tim_bitmap[i / 4];
>
>

The change looks good to me.

--
Raja



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 1/8] ath10k: enhance swba event handler to adapt different size tim bitmap
@ 2015-07-01 10:21       ` rmani
  0 siblings, 0 replies; 36+ messages in thread
From: rmani @ 2015-07-01 10:21 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, ath10k

On 07/01/2015 03:46 PM, Kalle Valo wrote:
> Raja Mani <rmani@qti.qualcomm.com> writes:
>
>> Due to 512 client support in 10.4 firmware, size of tim ie is going
>> to be slightly higher than non 10.4 firmware. So, size of tim_bitmap
>> what is carried in swba event from 10.4 firmware is bit higher.
>>
>> The only bottle neck to reuse existing swba handler
>> ath10k_wmi_event_host_swba() for 10.4 is that code designed to deal
>> with fixed size tim bitmap(ie, tim_info[].tim_bitmap in wmi_swba_ev_arg).
>> This patch removes such size limitation and makes it more suitable
>> to handle swba event which has different size tim bitmap.
>>
>> All existing swba event parsing functions are changed to adapt this
>> change. Actual support to handle 10.4 swba event is added in next patch.
>> Only preparation is made in this patch.
>>
>> Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
>
[..]
>> -		BUILD_BUG_ON(sizeof(arvif->u.ap.tim_bitmap) !=
>> -			     sizeof(tim_info->tim_bitmap));
>> +		WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
>
> I'm worried that this WARN_ON() spams too much so I changed it to:
>
> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -2893,7 +2893,7 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,
>          if (__le32_to_cpu(tim_info->tim_changed)) {
>                  int i;
>
> -               WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
> +               WARN_ON_ONCE(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
>
>                  for (i = 0; i < tim_len; i++) {
>                          t = tim_info->tim_bitmap[i / 4];
>
>

The change looks good to me.

--
Raja



_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 1/8] ath10k: enhance swba event handler to adapt different size tim bitmap
  2015-07-01 10:16     ` Kalle Valo
@ 2015-07-01 10:28       ` Kalle Valo
  -1 siblings, 0 replies; 36+ messages in thread
From: Kalle Valo @ 2015-07-01 10:28 UTC (permalink / raw)
  To: Raja Mani; +Cc: linux-wireless, ath10k

Kalle Valo <kvalo@qca.qualcomm.com> writes:

>>  	/* if next SWBA has no tim_changed the tim_bitmap is garbage.
>>  	 * we must copy the bitmap upon change and reuse it later */
>>  	if (__le32_to_cpu(tim_info->tim_changed)) {
>>  		int i;
>>  
>> -		BUILD_BUG_ON(sizeof(arvif->u.ap.tim_bitmap) !=
>> -			     sizeof(tim_info->tim_bitmap));
>> +		WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
>
> I'm worried that this WARN_ON() spams too much so I changed it to:
>
> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -2893,7 +2893,7 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,
>         if (__le32_to_cpu(tim_info->tim_changed)) {
>                 int i;
>  
> -               WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
> +               WARN_ON_ONCE(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
>  
>                 for (i = 0; i < tim_len; i++) {
>                         t = tim_info->tim_bitmap[i / 4];

Actually I got more worried about this. If tim_len >
sizeof(arvif->u.ap.tim_bitmap) don't we read out of bounds? So we should
actually add return for that case or am I missing something?

Full code:

		WARN_ON_ONCE(sizeof(arvif->u.ap.tim_bitmap) < tim_len);

		for (i = 0; i < tim_len; i++) {
			t = tim_info->tim_bitmap[i / 4];
			v = __le32_to_cpu(t);
			arvif->u.ap.tim_bitmap[i] = (v >> ((i % 4) * 8)) & 0xFF;
		}

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 1/8] ath10k: enhance swba event handler to adapt different size tim bitmap
@ 2015-07-01 10:28       ` Kalle Valo
  0 siblings, 0 replies; 36+ messages in thread
From: Kalle Valo @ 2015-07-01 10:28 UTC (permalink / raw)
  To: Raja Mani; +Cc: linux-wireless, ath10k

Kalle Valo <kvalo@qca.qualcomm.com> writes:

>>  	/* if next SWBA has no tim_changed the tim_bitmap is garbage.
>>  	 * we must copy the bitmap upon change and reuse it later */
>>  	if (__le32_to_cpu(tim_info->tim_changed)) {
>>  		int i;
>>  
>> -		BUILD_BUG_ON(sizeof(arvif->u.ap.tim_bitmap) !=
>> -			     sizeof(tim_info->tim_bitmap));
>> +		WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
>
> I'm worried that this WARN_ON() spams too much so I changed it to:
>
> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -2893,7 +2893,7 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,
>         if (__le32_to_cpu(tim_info->tim_changed)) {
>                 int i;
>  
> -               WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
> +               WARN_ON_ONCE(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
>  
>                 for (i = 0; i < tim_len; i++) {
>                         t = tim_info->tim_bitmap[i / 4];

Actually I got more worried about this. If tim_len >
sizeof(arvif->u.ap.tim_bitmap) don't we read out of bounds? So we should
actually add return for that case or am I missing something?

Full code:

		WARN_ON_ONCE(sizeof(arvif->u.ap.tim_bitmap) < tim_len);

		for (i = 0; i < tim_len; i++) {
			t = tim_info->tim_bitmap[i / 4];
			v = __le32_to_cpu(t);
			arvif->u.ap.tim_bitmap[i] = (v >> ((i % 4) * 8)) & 0xFF;
		}

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 5/8] ath10k: add 10.4 fw specific htt msg definitions
  2015-06-22 14:52   ` Raja Mani
@ 2015-07-01 10:38     ` Kalle Valo
  -1 siblings, 0 replies; 36+ messages in thread
From: Kalle Valo @ 2015-07-01 10:38 UTC (permalink / raw)
  To: Raja Mani; +Cc: ath10k, linux-wireless

Raja Mani <rmani@qti.qualcomm.com> writes:

> New htt event table is added for 10.4 firmware. Following new htt
> events are available only 10.4. adding this to generic htt event
> table,
> 	HTT_T2H_MSG_TYPE_EN_STATS,
> 	HTT_T2H_MSG_TYPE_TX_FETCH_IND,
> 	HTT_T2H_MSG_TYPE_TX_FETCH_CONF,
> 	HTT_T2H_MSG_TYPE_TX_LOW_LATENCY_IND
>
> Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>

[...]

> @@ -1146,6 +1147,8 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
>  			ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_TLV;
>  			break;
>  		case ATH10K_FW_WMI_OP_VERSION_10_4:
> +			ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_10_4;
> +			break;
>  		case ATH10K_FW_WMI_OP_VERSION_UNSET:
>  		case ATH10K_FW_WMI_OP_VERSION_MAX:
>  			WARN_ON(1);

So this switch block is only to support older firmware versions which do
not have ATH10K_FW_IE_HTT_OP_VERSION yet. 10.4 firmware will always have
it set so we don't need to have any backwards compatibility code for
10.4. I changed this part with the diff below. Please review.

--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1147,8 +1147,6 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
                        ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_TLV;
                        break;
                case ATH10K_FW_WMI_OP_VERSION_10_4:
-                       ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_10_4;
-                       break;
                case ATH10K_FW_WMI_OP_VERSION_UNSET:
                case ATH10K_FW_WMI_OP_VERSION_MAX:
                        WARN_ON(1);

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 5/8] ath10k: add 10.4 fw specific htt msg definitions
@ 2015-07-01 10:38     ` Kalle Valo
  0 siblings, 0 replies; 36+ messages in thread
From: Kalle Valo @ 2015-07-01 10:38 UTC (permalink / raw)
  To: Raja Mani; +Cc: linux-wireless, ath10k

Raja Mani <rmani@qti.qualcomm.com> writes:

> New htt event table is added for 10.4 firmware. Following new htt
> events are available only 10.4. adding this to generic htt event
> table,
> 	HTT_T2H_MSG_TYPE_EN_STATS,
> 	HTT_T2H_MSG_TYPE_TX_FETCH_IND,
> 	HTT_T2H_MSG_TYPE_TX_FETCH_CONF,
> 	HTT_T2H_MSG_TYPE_TX_LOW_LATENCY_IND
>
> Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>

[...]

> @@ -1146,6 +1147,8 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
>  			ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_TLV;
>  			break;
>  		case ATH10K_FW_WMI_OP_VERSION_10_4:
> +			ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_10_4;
> +			break;
>  		case ATH10K_FW_WMI_OP_VERSION_UNSET:
>  		case ATH10K_FW_WMI_OP_VERSION_MAX:
>  			WARN_ON(1);

So this switch block is only to support older firmware versions which do
not have ATH10K_FW_IE_HTT_OP_VERSION yet. 10.4 firmware will always have
it set so we don't need to have any backwards compatibility code for
10.4. I changed this part with the diff below. Please review.

--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1147,8 +1147,6 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
                        ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_TLV;
                        break;
                case ATH10K_FW_WMI_OP_VERSION_10_4:
-                       ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_10_4;
-                       break;
                case ATH10K_FW_WMI_OP_VERSION_UNSET:
                case ATH10K_FW_WMI_OP_VERSION_MAX:
                        WARN_ON(1);

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 1/8] ath10k: enhance swba event handler to adapt different size tim bitmap
  2015-07-01 10:28       ` Kalle Valo
@ 2015-07-01 11:18         ` Kalle Valo
  -1 siblings, 0 replies; 36+ messages in thread
From: Kalle Valo @ 2015-07-01 11:18 UTC (permalink / raw)
  To: Raja Mani; +Cc: linux-wireless, ath10k

Kalle Valo <kvalo@qca.qualcomm.com> writes:

> Kalle Valo <kvalo@qca.qualcomm.com> writes:
>
>>>  	/* if next SWBA has no tim_changed the tim_bitmap is garbage.
>>>  	 * we must copy the bitmap upon change and reuse it later */
>>>  	if (__le32_to_cpu(tim_info->tim_changed)) {
>>>  		int i;
>>>  
>>> -		BUILD_BUG_ON(sizeof(arvif->u.ap.tim_bitmap) !=
>>> -			     sizeof(tim_info->tim_bitmap));
>>> +		WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
>>
>> I'm worried that this WARN_ON() spams too much so I changed it to:
>>
>> --- a/drivers/net/wireless/ath/ath10k/wmi.c
>> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
>> @@ -2893,7 +2893,7 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,
>>         if (__le32_to_cpu(tim_info->tim_changed)) {
>>                 int i;
>>  
>> -               WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
>> +               WARN_ON_ONCE(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
>>  
>>                 for (i = 0; i < tim_len; i++) {
>>                         t = tim_info->tim_bitmap[i / 4];
>
> Actually I got more worried about this. If tim_len >
> sizeof(arvif->u.ap.tim_bitmap) don't we read out of bounds? So we should
> actually add return for that case or am I missing something?
>
> Full code:
>
> 		WARN_ON_ONCE(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
>
> 		for (i = 0; i < tim_len; i++) {
> 			t = tim_info->tim_bitmap[i / 4];
> 			v = __le32_to_cpu(t);
> 			arvif->u.ap.tim_bitmap[i] = (v >> ((i % 4) * 8)) & 0xFF;
> 		}

I talked with Raja and I changed this now to:

--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -2893,7 +2893,11 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,
        if (__le32_to_cpu(tim_info->tim_changed)) {
                int i;
 
-               WARN_ON_ONCE(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
+               if (sizeof(arvif->u.ap.tim_bitmap) < tim_len) {
+                       ath10k_warn(ar, "SWBA TIM field is too big (%d), truncated it to %d",
+                                   tim_len, sizeof(arvif->u.ap.tim_bitmap));
+                       tim_len = sizeof(arvif->u.ap.tim_bitmap);
+               }
 
                for (i = 0; i < tim_len; i++) {
                        t = tim_info->tim_bitmap[i / 4];

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 1/8] ath10k: enhance swba event handler to adapt different size tim bitmap
@ 2015-07-01 11:18         ` Kalle Valo
  0 siblings, 0 replies; 36+ messages in thread
From: Kalle Valo @ 2015-07-01 11:18 UTC (permalink / raw)
  To: Raja Mani; +Cc: linux-wireless, ath10k

Kalle Valo <kvalo@qca.qualcomm.com> writes:

> Kalle Valo <kvalo@qca.qualcomm.com> writes:
>
>>>  	/* if next SWBA has no tim_changed the tim_bitmap is garbage.
>>>  	 * we must copy the bitmap upon change and reuse it later */
>>>  	if (__le32_to_cpu(tim_info->tim_changed)) {
>>>  		int i;
>>>  
>>> -		BUILD_BUG_ON(sizeof(arvif->u.ap.tim_bitmap) !=
>>> -			     sizeof(tim_info->tim_bitmap));
>>> +		WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
>>
>> I'm worried that this WARN_ON() spams too much so I changed it to:
>>
>> --- a/drivers/net/wireless/ath/ath10k/wmi.c
>> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
>> @@ -2893,7 +2893,7 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,
>>         if (__le32_to_cpu(tim_info->tim_changed)) {
>>                 int i;
>>  
>> -               WARN_ON(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
>> +               WARN_ON_ONCE(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
>>  
>>                 for (i = 0; i < tim_len; i++) {
>>                         t = tim_info->tim_bitmap[i / 4];
>
> Actually I got more worried about this. If tim_len >
> sizeof(arvif->u.ap.tim_bitmap) don't we read out of bounds? So we should
> actually add return for that case or am I missing something?
>
> Full code:
>
> 		WARN_ON_ONCE(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
>
> 		for (i = 0; i < tim_len; i++) {
> 			t = tim_info->tim_bitmap[i / 4];
> 			v = __le32_to_cpu(t);
> 			arvif->u.ap.tim_bitmap[i] = (v >> ((i % 4) * 8)) & 0xFF;
> 		}

I talked with Raja and I changed this now to:

--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -2893,7 +2893,11 @@ static void ath10k_wmi_update_tim(struct ath10k *ar,
        if (__le32_to_cpu(tim_info->tim_changed)) {
                int i;
 
-               WARN_ON_ONCE(sizeof(arvif->u.ap.tim_bitmap) < tim_len);
+               if (sizeof(arvif->u.ap.tim_bitmap) < tim_len) {
+                       ath10k_warn(ar, "SWBA TIM field is too big (%d), truncated it to %d",
+                                   tim_len, sizeof(arvif->u.ap.tim_bitmap));
+                       tim_len = sizeof(arvif->u.ap.tim_bitmap);
+               }
 
                for (i = 0; i < tim_len; i++) {
                        t = tim_info->tim_bitmap[i / 4];

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 5/8] ath10k: add 10.4 fw specific htt msg definitions
  2015-07-01 10:38     ` Kalle Valo
@ 2015-07-01 11:46       ` rmani
  -1 siblings, 0 replies; 36+ messages in thread
From: rmani @ 2015-07-01 11:46 UTC (permalink / raw)
  To: Kalle Valo; +Cc: ath10k, linux-wireless

On 07/01/2015 04:08 PM, Kalle Valo wrote:
> Raja Mani <rmani@qti.qualcomm.com> writes:
>
>> New htt event table is added for 10.4 firmware. Following new htt
>> events are available only 10.4. adding this to generic htt event
>> table,
>> 	HTT_T2H_MSG_TYPE_EN_STATS,
>> 	HTT_T2H_MSG_TYPE_TX_FETCH_IND,
>> 	HTT_T2H_MSG_TYPE_TX_FETCH_CONF,
>> 	HTT_T2H_MSG_TYPE_TX_LOW_LATENCY_IND
>>
>> Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
>
> [...]
>
>> @@ -1146,6 +1147,8 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
>>   			ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_TLV;
>>   			break;
>>   		case ATH10K_FW_WMI_OP_VERSION_10_4:
>> +			ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_10_4;
>> +			break;
>>   		case ATH10K_FW_WMI_OP_VERSION_UNSET:
>>   		case ATH10K_FW_WMI_OP_VERSION_MAX:
>>   			WARN_ON(1);
>
> So this switch block is only to support older firmware versions which do
> not have ATH10K_FW_IE_HTT_OP_VERSION yet. 10.4 firmware will always have
> it set so we don't need to have any backwards compatibility code for
> 10.4. I changed this part with the diff below. Please review.
>
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -1147,8 +1147,6 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
>                          ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_TLV;
>                          break;
>                  case ATH10K_FW_WMI_OP_VERSION_10_4:
> -                       ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_10_4;
> -                       break;
>                  case ATH10K_FW_WMI_OP_VERSION_UNSET:
>                  case ATH10K_FW_WMI_OP_VERSION_MAX:
>                          WARN_ON(1);
>

As you suggested, we can ignore htt op version assignment here and use
what comes in firmware IE. I am fine with this change.

--
Raja

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 5/8] ath10k: add 10.4 fw specific htt msg definitions
@ 2015-07-01 11:46       ` rmani
  0 siblings, 0 replies; 36+ messages in thread
From: rmani @ 2015-07-01 11:46 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, ath10k

On 07/01/2015 04:08 PM, Kalle Valo wrote:
> Raja Mani <rmani@qti.qualcomm.com> writes:
>
>> New htt event table is added for 10.4 firmware. Following new htt
>> events are available only 10.4. adding this to generic htt event
>> table,
>> 	HTT_T2H_MSG_TYPE_EN_STATS,
>> 	HTT_T2H_MSG_TYPE_TX_FETCH_IND,
>> 	HTT_T2H_MSG_TYPE_TX_FETCH_CONF,
>> 	HTT_T2H_MSG_TYPE_TX_LOW_LATENCY_IND
>>
>> Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
>
> [...]
>
>> @@ -1146,6 +1147,8 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
>>   			ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_TLV;
>>   			break;
>>   		case ATH10K_FW_WMI_OP_VERSION_10_4:
>> +			ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_10_4;
>> +			break;
>>   		case ATH10K_FW_WMI_OP_VERSION_UNSET:
>>   		case ATH10K_FW_WMI_OP_VERSION_MAX:
>>   			WARN_ON(1);
>
> So this switch block is only to support older firmware versions which do
> not have ATH10K_FW_IE_HTT_OP_VERSION yet. 10.4 firmware will always have
> it set so we don't need to have any backwards compatibility code for
> 10.4. I changed this part with the diff below. Please review.
>
> --- a/drivers/net/wireless/ath/ath10k/core.c
> +++ b/drivers/net/wireless/ath/ath10k/core.c
> @@ -1147,8 +1147,6 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
>                          ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_TLV;
>                          break;
>                  case ATH10K_FW_WMI_OP_VERSION_10_4:
> -                       ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_10_4;
> -                       break;
>                  case ATH10K_FW_WMI_OP_VERSION_UNSET:
>                  case ATH10K_FW_WMI_OP_VERSION_MAX:
>                          WARN_ON(1);
>

As you suggested, we can ignore htt op version assignment here and use
what comes in firmware IE. I am fine with this change.

--
Raja

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 0/8] add beacon and htt msg support for 10.4 firmware
  2015-06-22 14:52 ` Raja Mani
@ 2015-07-02  5:50   ` Kalle Valo
  -1 siblings, 0 replies; 36+ messages in thread
From: Kalle Valo @ 2015-07-02  5:50 UTC (permalink / raw)
  To: Raja Mani; +Cc: ath10k, linux-wireless

Raja Mani <rmani@qti.qualcomm.com> writes:

> This is the continuation of earlier patch set posted for adding 10.4 wmi support.
> This patch series covers following items w.r.t 10.4 firmware,
>
>         - Enhance existing swba event handler to handle variable size tim bitmap
>           and add support to handle 10.4 swba event.
>         - Enable pdev, vdev, peer related wmi operations like create, delete, etc.
>         - Includes scan support.
>         - Add 10.4 specific htt msg.
>         - Advertise 10.4 iface combination to mac80211.
>         - Adjust max ss and initialize continuous frag descriptor memory
>
> v2 changes:
>        - rebased on top of "introduce wmi support for qca99x0" patch series.
>        - updated htt msg definitions as per stable 10.4 firmware.
>        - synced scan related info as per stable 10.4 firmware.
>
> Raja Mani (8):
>   ath10k: enhance swba event handler to adapt different size tim bitmap
>   ath10k: handle 10.4 firmware wmi swba event
>   ath10k: enable vdev and peer related operations for 10.4 fw
>   ath10k: add scan support for 10.4 fw
>   ath10k: add 10.4 fw specific htt msg definitions
>   ath10k: advertise 10.4 fw ap and sta iface combination to mac80211
>   ath10k: set max spatial stream to 4 for 10.4 fw
>   ath10k: configure frag desc memory to target for qca99X0

Thanks, applied.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH v2 0/8] add beacon and htt msg support for 10.4 firmware
@ 2015-07-02  5:50   ` Kalle Valo
  0 siblings, 0 replies; 36+ messages in thread
From: Kalle Valo @ 2015-07-02  5:50 UTC (permalink / raw)
  To: Raja Mani; +Cc: linux-wireless, ath10k

Raja Mani <rmani@qti.qualcomm.com> writes:

> This is the continuation of earlier patch set posted for adding 10.4 wmi support.
> This patch series covers following items w.r.t 10.4 firmware,
>
>         - Enhance existing swba event handler to handle variable size tim bitmap
>           and add support to handle 10.4 swba event.
>         - Enable pdev, vdev, peer related wmi operations like create, delete, etc.
>         - Includes scan support.
>         - Add 10.4 specific htt msg.
>         - Advertise 10.4 iface combination to mac80211.
>         - Adjust max ss and initialize continuous frag descriptor memory
>
> v2 changes:
>        - rebased on top of "introduce wmi support for qca99x0" patch series.
>        - updated htt msg definitions as per stable 10.4 firmware.
>        - synced scan related info as per stable 10.4 firmware.
>
> Raja Mani (8):
>   ath10k: enhance swba event handler to adapt different size tim bitmap
>   ath10k: handle 10.4 firmware wmi swba event
>   ath10k: enable vdev and peer related operations for 10.4 fw
>   ath10k: add scan support for 10.4 fw
>   ath10k: add 10.4 fw specific htt msg definitions
>   ath10k: advertise 10.4 fw ap and sta iface combination to mac80211
>   ath10k: set max spatial stream to 4 for 10.4 fw
>   ath10k: configure frag desc memory to target for qca99X0

Thanks, applied.

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2015-07-02  5:51 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-22 14:52 [PATCH v2 0/8] add beacon and htt msg support for 10.4 firmware Raja Mani
2015-06-22 14:52 ` Raja Mani
2015-06-22 14:52 ` [PATCH v2 1/8] ath10k: enhance swba event handler to adapt different size tim bitmap Raja Mani
2015-06-22 14:52   ` Raja Mani
2015-07-01 10:16   ` Kalle Valo
2015-07-01 10:16     ` Kalle Valo
2015-07-01 10:21     ` rmani
2015-07-01 10:21       ` rmani
2015-07-01 10:28     ` Kalle Valo
2015-07-01 10:28       ` Kalle Valo
2015-07-01 11:18       ` Kalle Valo
2015-07-01 11:18         ` Kalle Valo
2015-06-22 14:52 ` [PATCH v2 2/8] ath10k: handle 10.4 firmware wmi swba event Raja Mani
2015-06-22 14:52   ` Raja Mani
2015-06-22 14:52 ` [PATCH v2 3/8] ath10k: enable vdev and peer related operations for 10.4 fw Raja Mani
2015-06-22 14:52   ` Raja Mani
2015-06-22 14:52 ` [PATCH v2 4/8] ath10k: add scan support " Raja Mani
2015-06-22 14:52   ` Raja Mani
2015-06-22 14:52 ` [PATCH v2 5/8] ath10k: add 10.4 fw specific htt msg definitions Raja Mani
2015-06-22 14:52   ` Raja Mani
2015-07-01 10:38   ` Kalle Valo
2015-07-01 10:38     ` Kalle Valo
2015-07-01 11:46     ` rmani
2015-07-01 11:46       ` rmani
2015-06-22 14:52 ` [PATCH v2 6/8] ath10k: advertise 10.4 fw ap and sta iface combination to mac80211 Raja Mani
2015-06-22 14:52   ` Raja Mani
2015-06-22 14:52 ` [PATCH v2 7/8] ath10k: set max spatial stream to 4 for 10.4 fw Raja Mani
2015-06-22 14:52   ` Raja Mani
2015-06-22 14:52 ` [PATCH v2 8/8] ath10k: configure frag desc memory to target for qca99X0 Raja Mani
2015-06-22 14:52   ` Raja Mani
2015-06-22 23:41   ` Peter Oh
2015-06-22 23:41     ` Peter Oh
2015-06-23  5:48     ` rmani
2015-06-23  5:48       ` rmani
2015-07-02  5:50 ` [PATCH v2 0/8] add beacon and htt msg support for 10.4 firmware Kalle Valo
2015-07-02  5:50   ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.