Эх сурвалжийг харах

qcacmn: Update twt del, pause and resume cmd to include peer mac

TWT delete, pause and resume command is upadted by FW to include peer
mac address. Update host implementation to include peer mac in these
commands. Also, resume command is updated to include next_twt_size.
Update resume command for the same.

Change-Id: Iec184d0449b06aaeb9bac558e8cb5322f867e12f
CRs-Fixed: 2279309
Kiran Venkatappa 6 жил өмнө
parent
commit
4ac64a95c6

+ 18 - 1
wmi/inc/wmi_unified_twt_param.h

@@ -163,7 +163,7 @@ enum WMI_HOST_TWT_COMMAND {
  */
 struct wmi_twt_add_dialog_param {
 	uint32_t vdev_id;
-	uint8_t  peer_macaddr[6];
+	uint8_t  peer_macaddr[IEEE80211_ADDR_LEN];
 	uint32_t dialog_id;
 	uint32_t wake_intvl_us;
 	uint32_t wake_intvl_mantis;
@@ -206,21 +206,25 @@ enum WMI_HOST_ADD_TWT_STATUS {
 
 /** struct wmi_twt_add_dialog_complete_param -
  * @vdev_id: VDEV identifier
+ * @peer_macaddr: Peer mac address
  * @dialog_id: TWT dialog ID
  * @status: refer to WMI_HOST_ADD_TWT_STATUS enum
  */
 struct wmi_twt_add_dialog_complete_event_param {
 	uint32_t vdev_id;
+	uint8_t  peer_macaddr[IEEE80211_ADDR_LEN];
 	uint32_t dialog_id;
 	uint32_t status;
 };
 
 /** struct wmi_twt_del_dialog_param -
  * @vdev_id: VDEV identifier
+ * @peer_macaddr: Peer mac address
  * @dialog_id: TWT dialog ID
  */
 struct wmi_twt_del_dialog_param {
 	uint32_t vdev_id;
+	uint8_t  peer_macaddr[IEEE80211_ADDR_LEN];
 	uint32_t dialog_id;
 };
 
@@ -248,21 +252,25 @@ enum WMI_HOST_DEL_TWT_STATUS {
 
 /** struct wmi_twt_del_dialog_complete_event_param -
  * @vdev_id: VDEV identifier
+ * @peer_macaddr: Peer mac address
  * @dialog_id: TWT dialog ID
  * @status: refer to WMI_HOST_DEL_TWT_STATUS enum
  */
 struct wmi_twt_del_dialog_complete_event_param {
 	uint32_t vdev_id;
+	uint8_t  peer_macaddr[IEEE80211_ADDR_LEN];
 	uint32_t dialog_id;
 	uint32_t status;
 };
 
 /** struct wmi_twt_pause_dialog_cmd_param -
  * @vdev_id: VDEV identifier
+ * @peer_macaddr: Peer mac address
  * @dialog_id: TWT dialog ID
  */
 struct wmi_twt_pause_dialog_cmd_param {
 	uint32_t vdev_id;
+	uint8_t  peer_macaddr[IEEE80211_ADDR_LEN];
 	uint32_t dialog_id;
 };
 
@@ -290,24 +298,31 @@ enum WMI_HOST_PAUSE_TWT_STATUS {
 
 /** struct wmi_twt_pause_dialog_complete_event_param -
  * @vdev_id: VDEV identifier
+ * @peer_macaddr: Peer mac address
  * @dialog_id: TWT dialog ID
  * @status: refer to WMI_HOST_PAUSE_TWT_STATUS
  */
 struct wmi_twt_pause_dialog_complete_event_param {
 	uint32_t vdev_id;
+	uint8_t  peer_macaddr[IEEE80211_ADDR_LEN];
 	uint32_t dialog_id;
 	uint32_t status;
 };
 
 /** struct wmi_twt_resume_dialog_cmd_param -
  * @vdev_id: VDEV identifier
+ * @peer_macaddr: Peer mac address
  * @dialog_id: TWT dialog ID
  * @sp_offset_us: this long time after TWT resumed the 1st SP will start
+ * @next_twt_size: Next TWT subfield Size.
+ *                 Refer IEEE 802.11ax section "9.4.1.60 TWT Information field"
  */
 struct wmi_twt_resume_dialog_cmd_param {
 	uint32_t vdev_id;
+	uint8_t  peer_macaddr[IEEE80211_ADDR_LEN];
 	uint32_t dialog_id;
 	uint32_t sp_offset_us;
+	uint32_t next_twt_size;
 };
 
 /* enum WMI_HOST_RESUME_TWT_STATUS - status code of resuming TWT dialog
@@ -336,11 +351,13 @@ enum WMI_HOST_RESUME_TWT_STATUS {
 
 /** struct wmi_twt_resume_dialog_complete_event_param -
  * @vdev_id: VDEV identifier
+ * @peer_macaddr: Peer mac address
  * @dialog_id: TWT dialog ID
  * @status: refer to WMI_HOST_RESUME_TWT_STATUS
  */
 struct wmi_twt_resume_dialog_complete_event_param {
 	uint32_t vdev_id;
+	uint8_t  peer_macaddr[IEEE80211_ADDR_LEN];
 	uint32_t dialog_id;
 	uint32_t status;
 };

+ 7 - 0
wmi/src/wmi_unified_twt_tlv.c

@@ -169,6 +169,7 @@ static QDF_STATUS send_twt_del_dialog_cmd_tlv(wmi_unified_t wmi_handle,
 			(wmi_twt_del_dialog_cmd_fixed_param));
 
 	cmd->vdev_id = params->vdev_id;
+	WMI_CHAR_ARRAY_TO_MAC_ADDR(params->peer_macaddr, &cmd->peer_macaddr);
 	cmd->dialog_id = params->dialog_id;
 
 	status = wmi_unified_cmd_send(wmi_handle, buf, sizeof(*cmd),
@@ -201,6 +202,7 @@ static QDF_STATUS send_twt_pause_dialog_cmd_tlv(wmi_unified_t wmi_handle,
 			(wmi_twt_pause_dialog_cmd_fixed_param));
 
 	cmd->vdev_id = params->vdev_id;
+	WMI_CHAR_ARRAY_TO_MAC_ADDR(params->peer_macaddr, &cmd->peer_macaddr);
 	cmd->dialog_id = params->dialog_id;
 
 	status = wmi_unified_cmd_send(wmi_handle, buf, sizeof(*cmd),
@@ -233,6 +235,7 @@ static QDF_STATUS send_twt_resume_dialog_cmd_tlv(wmi_unified_t wmi_handle,
 			(wmi_twt_resume_dialog_cmd_fixed_param));
 
 	cmd->vdev_id = params->vdev_id;
+	WMI_CHAR_ARRAY_TO_MAC_ADDR(params->peer_macaddr, &cmd->peer_macaddr);
 	cmd->dialog_id = params->dialog_id;
 	cmd->sp_offset_us = params->sp_offset_us;
 
@@ -309,6 +312,7 @@ static QDF_STATUS extract_twt_add_dialog_comp_event_tlv(
 	ev = param_buf->fixed_param;
 
 	params->vdev_id = ev->vdev_id;
+	WMI_MAC_ADDR_TO_CHAR_ARRAY(&ev->peer_macaddr, params->peer_macaddr);
 	params->status = ev->status;
 	params->dialog_id = ev->dialog_id;
 
@@ -332,6 +336,7 @@ static QDF_STATUS extract_twt_del_dialog_comp_event_tlv(
 	ev = param_buf->fixed_param;
 
 	params->vdev_id = ev->vdev_id;
+	WMI_MAC_ADDR_TO_CHAR_ARRAY(&ev->peer_macaddr, params->peer_macaddr);
 	params->dialog_id = ev->dialog_id;
 
 	return QDF_STATUS_SUCCESS;
@@ -354,6 +359,7 @@ static QDF_STATUS extract_twt_pause_dialog_comp_event_tlv(
 	ev = param_buf->fixed_param;
 
 	params->vdev_id = ev->vdev_id;
+	WMI_MAC_ADDR_TO_CHAR_ARRAY(&ev->peer_macaddr, params->peer_macaddr);
 	params->status = ev->status;
 	params->dialog_id = ev->dialog_id;
 
@@ -378,6 +384,7 @@ static QDF_STATUS extract_twt_resume_dialog_comp_event_tlv(
 	ev = param_buf->fixed_param;
 
 	params->vdev_id = ev->vdev_id;
+	WMI_MAC_ADDR_TO_CHAR_ARRAY(&ev->peer_macaddr, params->peer_macaddr);
 	params->status = ev->status;
 	params->dialog_id = ev->dialog_id;