Browse Source

qcacmn: 11ax Draft1.0 wmi changes

11ax WMI changes to populate HE rates

Change-Id: Id303dab1c7ec47ebc31fc685ad0b50ddfdf4bc12
CRs-Fixed: 2023667
Kris Muthusamy 8 years ago
parent
commit
bfc37942a5
2 changed files with 44 additions and 12 deletions
  1. 9 5
      wmi/inc/wmi_unified_param.h
  2. 35 7
      wmi/src/wmi_unified_tlv.c

+ 9 - 5
wmi/inc/wmi_unified_param.h

@@ -975,8 +975,9 @@ typedef struct {
 } target_rate_set;
 
 
-#define WMI_HOST_MAX_NUM_SS                    8
-#define WMI_HOST_MAX_HECAP_PHY_SIZE            3
+#define WMI_HOST_MAX_NUM_SS		8
+#define WMI_HOST_MAX_HECAP_PHY_SIZE	3
+#define WMI_HOST_MAX_HE_RATE_SET	1
 /**
  * struct wmi_host_ppe_threshold -PPE threshold
  * @numss_m1: NSS - 1
@@ -989,7 +990,6 @@ struct wmi_host_ppe_threshold {
 	uint32_t ppet16_ppet8_ru3_ru0[WMI_HOST_MAX_NUM_SS];
 };
 
-
 /**
  * struct wmi_host_mac_addr - host mac addr 2 word representation of MAC addr
  * @mac_addr31to0: upper 4 bytes of  MAC address
@@ -1050,7 +1050,9 @@ typedef struct {
  * @peer_he_cap_macinfo: Peer HE Cap MAC info
  * @peer_he_ops: Peer HE operation info
  * @peer_he_cap_phyinfo: Peer HE Cap PHY info
- * @peer_he_mcs: Peer HE MCS MAP
+ * @peer_he_mcs_count: Peer HE MCS TX/RX MAP count
+ * @peer_he_rx_mcs_set: Peer HE RX MCS MAP
+ * @peer_he_tx_mcs_set: Peer HE TX MCS MAP
  * @peer_ppet: Peer HE PPET info
  */
 struct peer_assoc_params {
@@ -1106,7 +1108,9 @@ struct peer_assoc_params {
 	uint32_t peer_he_cap_macinfo;
 	uint32_t peer_he_ops;
 	uint32_t peer_he_cap_phyinfo[WMI_HOST_MAX_HECAP_PHY_SIZE];
-	uint32_t peer_he_mcs;
+	uint32_t peer_he_mcs_count;
+	uint32_t peer_he_rx_mcs_set[WMI_HOST_MAX_HE_RATE_SET];
+	uint32_t peer_he_tx_mcs_set[WMI_HOST_MAX_HE_RATE_SET];
 	struct wmi_host_ppe_threshold peer_ppet;
 };
 

+ 35 - 7
wmi/src/wmi_unified_tlv.c

@@ -1834,22 +1834,26 @@ static QDF_STATUS send_peer_assoc_cmd_tlv(wmi_unified_t wmi_handle,
 {
 	wmi_peer_assoc_complete_cmd_fixed_param *cmd;
 	wmi_vht_rate_set *mcs;
+	wmi_he_rate_set *he_mcs;
 	wmi_buf_t buf;
 	int32_t len;
 	uint8_t *buf_ptr;
 	QDF_STATUS ret;
 	uint32_t peer_legacy_rates_align;
 	uint32_t peer_ht_rates_align;
+	int32_t i;
 
 
 	peer_legacy_rates_align = wmi_align(param->peer_legacy_rates.num_rates);
 	peer_ht_rates_align = wmi_align(param->peer_ht_rates.num_rates);
 
 	len = sizeof(*cmd) + WMI_TLV_HDR_SIZE +
-	      (peer_legacy_rates_align * sizeof(uint8_t)) +
-	      WMI_TLV_HDR_SIZE +
-	      (peer_ht_rates_align * sizeof(uint8_t)) +
-	      sizeof(wmi_vht_rate_set);
+		(peer_legacy_rates_align * sizeof(uint8_t)) +
+		WMI_TLV_HDR_SIZE +
+		(peer_ht_rates_align * sizeof(uint8_t)) +
+		sizeof(wmi_vht_rate_set) +
+		(sizeof(wmi_he_rate_set) * param->peer_he_mcs_count
+		+ WMI_TLV_HDR_SIZE);
 
 	buf = wmi_buf_alloc(wmi_handle, len);
 	if (!buf) {
@@ -1884,7 +1888,6 @@ static QDF_STATUS send_peer_assoc_cmd_tlv(wmi_unified_t wmi_handle,
 	/* Update 11ax capabilities */
 	cmd->peer_he_cap_info = param->peer_he_cap_macinfo;
 	cmd->peer_he_ops = param->peer_he_ops;
-	cmd->peer_he_mcs = param->peer_he_mcs;
 	qdf_mem_copy(&cmd->peer_he_cap_phy, &param->peer_he_cap_phyinfo,
 				sizeof(param->peer_he_cap_phyinfo));
 	qdf_mem_copy(&cmd->peer_ppet, &param->peer_ppet,
@@ -1922,16 +1925,41 @@ static QDF_STATUS send_peer_assoc_cmd_tlv(wmi_unified_t wmi_handle,
 		mcs->tx_mcs_set = param->tx_mcs_set;
 	}
 
+	/* HE Rates */
+	cmd->peer_he_mcs = param->peer_he_mcs_count;
+	buf_ptr += sizeof(wmi_vht_rate_set);
+	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
+		(param->peer_he_mcs_count * sizeof(wmi_he_rate_set)));
+	buf_ptr += WMI_TLV_HDR_SIZE;
+
+	/* Loop through the HE rate set */
+	for (i = 0; i < param->peer_he_mcs_count; i++) {
+		he_mcs = (wmi_he_rate_set *) buf_ptr;
+		WMITLV_SET_HDR(he_mcs, WMITLV_TAG_STRUC_wmi_he_rate_set,
+			WMITLV_GET_STRUCT_TLVLEN(wmi_he_rate_set));
+
+		he_mcs->rx_mcs_set = param->peer_he_rx_mcs_set[i];
+		he_mcs->tx_mcs_set = param->peer_he_tx_mcs_set[i];
+		WMI_LOGD("%s:HE idx %d RxMCSmap %x TxMCSmap %x ", __func__,
+			i, he_mcs->rx_mcs_set, he_mcs->tx_mcs_set);
+		buf_ptr += sizeof(wmi_he_rate_set);
+	}
+
+
 	WMI_LOGD("%s: vdev_id %d associd %d peer_flags %x rate_caps %x "
 		 "peer_caps %x listen_intval %d ht_caps %x max_mpdu %d "
 		 "nss %d phymode %d peer_mpdu_density %d "
-		 "cmd->peer_vht_caps %x", __func__,
+		 "cmd->peer_vht_caps %x "
+		 "HE cap_info %x ops %x "
+		 "HE phy %x  %x  %x  ", __func__,
 		 cmd->vdev_id, cmd->peer_associd, cmd->peer_flags,
 		 cmd->peer_rate_caps, cmd->peer_caps,
 		 cmd->peer_listen_intval, cmd->peer_ht_caps,
 		 cmd->peer_max_mpdu, cmd->peer_nss, cmd->peer_phymode,
 		 cmd->peer_mpdu_density,
-		 cmd->peer_vht_caps);
+		 cmd->peer_vht_caps, cmd->peer_he_cap_info,
+		 cmd->peer_he_ops, cmd->peer_he_cap_phy[0],
+		 cmd->peer_he_cap_phy[1], cmd->peer_he_cap_phy[2]);
 
 	ret = wmi_unified_cmd_send(wmi_handle, buf, len,
 				   WMI_PEER_ASSOC_CMDID);