[PATCHv2,1/3] ath10k: extend wmi service map to accommodate new services
diff mbox

Message ID 1500379094-2373-2-git-send-email-mpubbise@qti.qualcomm.com
State New
Headers show

Commit Message

Manikanta Pubbisetty July 18, 2017, 11:58 a.m. UTC
From: Manikanta Pubbisetty <mpubbise@qti.qualcomm.com>

Though there is room to accommodate 512 services in wmi service
ready event, target uses only first 4-bits of each 32-bit word for
advertising wmi services thereby limiting max wmi services to 64.

TDLS implementation for 10.4 firmwares introduces new wmi services by
making use of remaining unused bits of each 32-bit word, therefore the
wmi service mapping in host needs to be extended.

This patch adds the logic to extend the wmi SVCMAP to accommodate new
wmi services.

Signed-off-by: Manikanta Pubbisetty <mpubbise@qti.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/wmi.h |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

Comments

Kalle Valo Aug. 3, 2017, 11:37 a.m. UTC | #1
mpubbise@qti.qualcomm.com wrote:

> Though there is room to accommodate 512 services in wmi service
> ready event, target uses only first 4-bits of each 32-bit word for
> advertising wmi services thereby limiting max wmi services to 64.
> 
> TDLS implementation for 10.4 firmwares introduces new wmi services by
> making use of remaining unused bits of each 32-bit word, therefore the
> wmi service mapping in host needs to be extended.
> 
> This patch adds the logic to extend the wmi SVCMAP to accommodate new
> wmi services.
> 
> Signed-off-by: Manikanta Pubbisetty <mpubbise@qti.qualcomm.com>
> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>

3 patches applied to ath-next branch of ath.git, thanks.

810fe818d6a1 ath10k: extend wmi service map to accommodate new services
add6cd8d5ab7 ath10k: add tdls support for 10.4 firmwares
be5b4f4002a6 ath10k: push peer type to target for TDLS peers

Patch
diff mbox

diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
index baa38c8..3a4cbbc 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
@@ -420,9 +420,20 @@  static inline char *wmi_service_name(int service_id)
 	 __le32_to_cpu((wmi_svc_bmap)[(svc_id) / (sizeof(u32))]) & \
 	 BIT((svc_id) % (sizeof(u32))))
 
+/* This extension is required to accommodate new services, current limit
+ * for wmi_services is 64 as target is using only 4-bits of each 32-bit
+ * wmi_service word. Extending this to make use of remaining unused bits
+ * for new services.
+ */
+#define WMI_EXT_SERVICE_IS_ENABLED(wmi_svc_bmap, svc_id, len) \
+	((svc_id) >= (len) && \
+	__le32_to_cpu((wmi_svc_bmap)[((svc_id) - (len)) / 28]) & \
+	BIT(((((svc_id) - (len)) % 28) & 0x1f) + 4))
+
 #define SVCMAP(x, y, len) \
 	do { \
-		if (WMI_SERVICE_IS_ENABLED((in), (x), (len))) \
+		if ((WMI_SERVICE_IS_ENABLED((in), (x), (len))) || \
+		    (WMI_EXT_SERVICE_IS_ENABLED((in), (x), (len)))) \
 			__set_bit(y, out); \
 	} while (0)