diff --git a/target/inc/wmi_tlv_defs.h b/target/inc/wmi_tlv_defs.h index 3796323d74d7..ffec0271b7eb 100644 --- a/target/inc/wmi_tlv_defs.h +++ b/target/inc/wmi_tlv_defs.h @@ -750,6 +750,8 @@ typedef enum { WMITLV_TAG_STRUC_wmi_request_wlan_stats_cmd_fixed_param, WMITLV_TAG_STRUC_wmi_rx_aggr_failure_event_fixed_param, WMITLV_TAG_STRUC_wmi_rx_aggr_failure_info, + WMITLV_TAG_STRUC_wmi_vdev_encrypt_decrypt_data_req_cmd_fixed_param, + WMITLV_TAG_STRUC_wmi_vdev_encrypt_decrypt_data_resp_event_fixed_param, } WMITLV_TAG_ID; /* @@ -1053,6 +1055,7 @@ typedef enum { OP(WMI_COEX_GET_ANTENNA_ISOLATION_CMDID) \ OP(WMI_PDEV_SET_STATS_THRESHOLD_CMDID) \ OP(WMI_REQUEST_WLAN_STATS_CMDID) \ + OP(WMI_VDEV_ENCRYPT_DECRYPT_DATA_REQ_CMDID) \ /* add new CMD_LIST elements above this line */ /* @@ -1213,6 +1216,7 @@ typedef enum { OP(WMI_COEX_REPORT_ANTENNA_ISOLATION_EVENTID) \ OP(WMI_REPORT_STATS_EVENTID) \ OP(WMI_REPORT_RX_AGGR_FAILURE_EVENTID) \ + OP(WMI_VDEV_ENCRYPT_DECRYPT_DATA_RESP_EVENTID) \ /* add new EVT_LIST elements above this line */ /* TLV definitions of WMI commands */ @@ -2583,6 +2587,12 @@ WMITLV_CREATE_PARAM_STRUC(WMI_PDEV_GET_TEMPERATURE_CMDID); WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_pdev_get_antdiv_status_cmd_fixed_param, wmi_pdev_get_antdiv_status_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_PDEV_GET_ANTDIV_STATUS_CMDID); +/* DISA feature : vdev encrypt decrypt request */ +#define WMITLV_TABLE_WMI_VDEV_ENCRYPT_DECRYPT_DATA_REQ_CMDID(id, op, buf, len) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_vdev_encrypt_decrypt_data_req_cmd_fixed_param, wmi_vdev_encrypt_decrypt_data_req_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, data, WMITLV_SIZE_VAR) +WMITLV_CREATE_PARAM_STRUC(WMI_VDEV_ENCRYPT_DECRYPT_DATA_REQ_CMDID); + /* Set antenna diversity Cmd */ #define WMITLV_TABLE_WMI_SET_ANTENNA_DIVERSITY_CMDID(id,op,buf,len) \ WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_pdev_set_antenna_diversity_cmd_fixed_param, wmi_pdev_set_antenna_diversity_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) @@ -4016,6 +4026,11 @@ WMITLV_CREATE_PARAM_STRUC(WMI_RADIO_TX_POWER_LEVEL_STATS_EVENTID); WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_UINT32, A_UINT32, rx_mcs, WMITLV_SIZE_VAR) WMITLV_CREATE_PARAM_STRUC(WMI_REPORT_STATS_EVENTID); +#define WMITLV_TABLE_WMI_VDEV_ENCRYPT_DECRYPT_DATA_RESP_EVENTID(id, op, buf, len) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_STRUC_wmi_vdev_encrypt_decrypt_data_resp_event_fixed_param, wmi_vdev_encrypt_decrypt_data_resp_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id, op, buf, len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, enc80211_frame, WMITLV_SIZE_VAR) +WMITLV_CREATE_PARAM_STRUC(WMI_VDEV_ENCRYPT_DECRYPT_DATA_RESP_EVENTID); + #ifdef __cplusplus } #endif diff --git a/target/inc/wmi_unified.h b/target/inc/wmi_unified.h index 26f00506f252..dc367aec8445 100644 --- a/target/inc/wmi_unified.h +++ b/target/inc/wmi_unified.h @@ -410,6 +410,9 @@ typedef enum { /** To set custom aggregation size for per vdev */ WMI_VDEV_SET_CUSTOM_AGGR_SIZE_CMDID, + /* DISA feature: Encrypt-decrypt data request */ + WMI_VDEV_ENCRYPT_DECRYPT_DATA_REQ_CMDID, + /* peer specific commands */ /** create a peer */ @@ -1111,7 +1114,13 @@ typedef enum { /* FW response to Host for vdev delete cmdid */ WMI_VDEV_DELETE_RESP_EVENTID, - /* peer specific events */ + /** + * DISA feature: FW response to Host with encrypted/decrypted + * 802.11 DISA frame + */ + WMI_VDEV_ENCRYPT_DECRYPT_DATA_RESP_EVENTID, + + /* peer specific events */ /** FW reauet to kick out the station for reasons like inactivity,lack of response ..etc */ WMI_PEER_STA_KICKOUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_PEER), @@ -15134,6 +15143,77 @@ typedef struct { */ } wmi_vdev_set_ie_cmd_fixed_param; +/* DISA feature related data structures */ +#define MAX_MAC_HEADER_LEN 32 +typedef enum { + INVALID, + ENCRYPT = 1, + DECRYPT = 2, +} ENCRYPT_DECRYPT_FLAG; + +typedef struct { + /** + * TLV tag and len; tag equals + * WMITLV_TAG_STRUC_wmi_vdev_encrypt_decrypt_data_req_cmd_fixed_param + */ + A_UINT32 tlv_header; + /** unique id identifying the VDEV, generated by the caller */ + A_UINT32 vdev_id; + ENCRYPT_DECRYPT_FLAG key_flag; + A_UINT32 key_idx; + A_UINT32 key_cipher; + A_UINT32 key_len; /* units = bytes */ + A_UINT32 key_txmic_len; /* units = bytes */ + A_UINT32 key_rxmic_len; /* units = bytes */ + /** Key: This array needs to be provided in little-endian order */ + A_UINT8 key_data[WMI_MAX_KEY_LEN]; + /** + * Packet number: This array needs to be provided in little-endian + * order. + * If the PN is less than 8 bytes, the PN data shall be placed into this + * pn[] array starting at byte 0, leaving the MSBs empty. + */ + A_UINT8 pn[8]; + /** + * 802.11 MAC header to be typecast to struct ieee80211_qosframe_addr4 + * This array needs to be provided in little-endian order. + */ + A_UINT8 mac_hdr[MAX_MAC_HEADER_LEN]; + A_UINT32 data_len; /** Payload length, units = bytes */ + /** + * Following this struct are this TLV: + * A_UINT8 data[]; <-- actual data to be encrypted, + * needs to be provided in little-endian order + */ +} wmi_vdev_encrypt_decrypt_data_req_cmd_fixed_param; + +/** + * This event is generated in response to + * WMI_VDEV_ENCRYPT_DECRYPT_DATA_REQ_CMDID from HOST. + * On receiving WMI command WMI_VDEV_ENCRYPT_DECRYPT_DATA_REQ_CMDID from + * HOST with DISA test vectors, DISA frame will prepared and submitted to HW, + * then on receiving the tx completion for the DISA frame this WMI event + * will be delivered to HOST with the encrypted frame. + */ +typedef struct { + /** + * TLV tag and len; tag equals + * WMITLV_TAG_STRUC_wmi_vdev_encrypt_decrypt_data_resp_event_fixed_param + */ + A_UINT32 tlv_header; + /* VDEV identifier */ + A_UINT32 vdev_id; + A_INT32 status; /* 0: success, -1: Failure, */ + /* 802.11 header length + encrypted payload length (units = bytes) */ + A_UINT32 data_length; + /** + * Following this struct is this TLV: + * A_UINT8 enc80211_frame[]; <-- Encrypted 802.11 frame; + * 802.11 header + encrypted payload, + * provided in little-endian order + */ +} wmi_vdev_encrypt_decrypt_data_resp_event_fixed_param; + /* DEPRECATED - use wmi_pdev_set_pcl_cmd_fixed_param instead */ typedef struct { /* diff --git a/target/inc/wmi_version.h b/target/inc/wmi_version.h index 2e372918b1ea..693f54b7916a 100644 --- a/target/inc/wmi_version.h +++ b/target/inc/wmi_version.h @@ -36,7 +36,7 @@ #define __WMI_VER_MINOR_ 0 /** WMI revision number has to be incremented when there is a * change that may or may not break compatibility */ -#define __WMI_REVISION_ 295 +#define __WMI_REVISION_ 296 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work