Skip to contentSkip to conversation

ath10k: Handle P2P_GO NOA notification FW 599+

PATCH New Janusz Dziedzic 2 participants 2 messages Apr 23, 2013 – Apr 25, 2013 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10k: Handle P2P_GO NOA notification FW 599+

In FW 599+ NOA structure was changed. So we have
to change this in case of using newest firmware.

---
 drivers/net/wireless/ath/ath10k/wmi.c |   14 +++++++-------
 drivers/net/wireless/ath/ath10k/wmi.h |   22 +++++++++++-----------
 2 files changed, 18 insertions(+), 18 deletions(-)
drivers/net/wireless/ath/ath10k/wmi.c +7 -7
index 3de4bb2..540c6d2 100644
@@ -539,12 +539,12 @@ static void ath10k_p2p_fill_noa_ie(u8 *data, u32 len,
 				   struct wmi_p2p_noa_info *noa)
 {
 	struct ath10k_p2p_noa_attr *noa_attr;
-	u8  ctwindow_oppps = (u8) __le32_to_cpu(noa->opp_ps_info);
+	u8  ctwindow_oppps = noa->ctwindow_oppps;
 	u8 ctwindow = ctwindow_oppps >> WMI_P2P_OPPPS_CTWINDOW_OFFSET;
 	bool oppps = !!(ctwindow_oppps & WMI_P2P_OPPPS_ENABLE_BIT);
 	__le16 *noa_attr_len;
 	u16 attr_len;
-	u32 noa_descriptors = __le32_to_cpu(noa->num_descriptors);
+	u8 noa_descriptors = noa->num_descriptors;
 	int i;
 
 	/* P2P IE */
@@ -560,7 +560,7 @@ static void ath10k_p2p_fill_noa_ie(u8 *data, u32 len,
 	noa_attr_len = (__le16 *) &data[7]; /* 2 bytes */
 	noa_attr = (struct ath10k_p2p_noa_attr *) &data[9];
 
-	noa_attr->index = __le32_to_cpu(noa->index);
+	noa_attr->index = noa->index;
 	noa_attr->oppps_ctwindow = ctwindow;
 	if (oppps)
 		noa_attr->oppps_ctwindow |= ATH10K_P2P_OPPPS_ENABLE_BIT;
@@ -582,8 +582,8 @@ static void ath10k_p2p_fill_noa_ie(u8 *data, u32 len,
 static u32 ath10k_p2p_calc_noa_ie_len(struct wmi_p2p_noa_info *noa)
 {
 	u32 len = 0;
-	u32 noa_descriptors = __le32_to_cpu(noa->num_descriptors);
-	u8 opp_ps_info = (u8) __le32_to_cpu(noa->opp_ps_info);
+	u8 noa_descriptors = noa->num_descriptors;
+	u8 opp_ps_info = noa->ctwindow_oppps;
 	bool opps_enabled = !!(opp_ps_info & WMI_P2P_OPPPS_ENABLE_BIT);
 
 
@@ -609,8 +609,8 @@ static void ath10k_wmi_update_noa(struct ath10k *ar, struct ath10k_vif *arvif,
 	if (arvif->vdev_subtype != WMI_VDEV_SUBTYPE_P2P_GO)
 		return;
 
-	ath10k_dbg(ATH10K_DBG_BEACON, "noa changed: %d\n", noa->p2p_noa_changed);
-	if (noa->p2p_noa_changed) {
+	ath10k_dbg(ATH10K_DBG_BEACON, "noa changed: %d\n", noa->changed);
+	if (noa->changed & WMI_P2P_NOA_CHANGED_BIT) {
 		new_len = ath10k_p2p_calc_noa_ie_len(noa);
 		if (!new_len)
 			goto cleanup;
drivers/net/wireless/ath/ath10k/wmi.h +11 -11
index 2bb8f0a..eb9c8d4 100644
@@ -2406,20 +2406,20 @@ struct wmi_quiet_info {
 #define WMI_P2P_MAX_NOA_DESCRIPTORS 4
 #define WMI_P2P_OPPPS_ENABLE_BIT	BIT(0)
 #define WMI_P2P_OPPPS_CTWINDOW_OFFSET	1
+#define WMI_P2P_NOA_CHANGED_BIT	BIT(0)
 
 struct wmi_p2p_noa_info {
-	/* Flag to indicate an update in NOA schedule */
-	__le32 p2p_noa_changed;
-	/* Identifies the instance of NOA sub element */
-	__le32 index;
-	/*
-	 * Bit 0:	Opp PS state of the AP
-	 * Bits 1-7:	Ctwindow in TUs
-	 * Bits 8-31:	Reserved
-	 */
-	__le32 opp_ps_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 */
-	__le32 num_descriptors;
+	u8 num_descriptors;
+
 	struct wmi_p2p_noa_descriptor noa_descriptors[WMI_P2P_MAX_NOA_DESCRIPTORS];
 } __packed;
 
Signature · 1 line
1.7.9.5
Applied
#1 lore raw

PATCH 1/1 ath10k: Handle P2P_GO NOA notification FW 599+

Quoted 4 lines · Janusz Dziedzic

In FW 599+ NOA structure was changed. So we have
to change this in case of using newest firmware.

Thanks, applied.

Signature · 1 line
Kalle Valo