From 6f0d0248f0444b3bb8f0429f874d2126a855e624 Mon Sep 17 00:00:00 2001 From: Shashikala Prabhu Date: Tue, 19 Apr 2022 10:54:58 +0530 Subject: [PATCH] qcacmn: Define T2LM structure in wlan_mlo_peer_context structure T2LM negotiation happens per MLD level. Hence, define the T2LM related structure in wlan_mlo_peer_context. Add API to get the protected EHT action frame subtype. Change-Id: Ia3870fbb38b8d673f96954af18078c96d20365f3 CRs-Fixed: 3167178 --- .../cmn_defs/inc/wlan_cmn_ieee80211.h | 38 ++++ .../dispatcher/inc/wlan_mgmt_txrx_utils_api.h | 20 +++ .../dispatcher/src/wlan_mgmt_txrx_tgt_api.c | 43 +++++ .../mlo_mgr/inc/wlan_mlo_mgr_public_structs.h | 164 ++++++++++++++++++ 4 files changed, 265 insertions(+) diff --git a/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h b/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h index 22674d7340..b48301ab34 100644 --- a/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h +++ b/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h @@ -596,6 +596,7 @@ enum element_ie { * @WLAN_EXTN_ELEMID_EHTOP: EHT Operation IE * @WLAN_EXTN_ELEMID_MULTI_LINK: Multi-Link IE * @WLAN_EXTN_ELEMID_EHTCAP: EHT Capabilities IE + * @WLAN_EXTN_ELEMID_T2LM: TID-to-link mapping IE */ enum extn_element_ie { WLAN_EXTN_ELEMID_HECAP = 35, @@ -615,6 +616,7 @@ enum extn_element_ie { #ifdef WLAN_FEATURE_11BE WLAN_EXTN_ELEMID_EHTCAP = 108, #endif + WLAN_EXTN_ELEMID_T2LM = 109, }; /** @@ -2201,6 +2203,42 @@ struct wlan_ml_bv_linfo_perstaprof_stainfo_dtiminfo { #endif /* WLAN_FEATURE_11BE_MLO */ #endif /* WLAN_FEATURE_11BE */ +#ifdef WLAN_FEATURE_T2LM +/** + * struct wlan_ie_tid_to_link_mapping - TID-to-link mapping IE + * @elem_id: T2LM IE + * @elem_len: T2LM IE len + * @elem_id_extn: T2LM extension id + * @data: Variable length data described below + */ +struct wlan_ie_tid_to_link_mapping { + uint8_t elem_id; + uint8_t elem_len; + uint8_t elem_id_extn; + uint8_t data[]; +} qdf_packed; + +/* The variable length data in wlan_ie_tid_to_link_mapping structure has the + * following fields. + * - TID-to-link mapping control ( 1 octet) + * - Link mapping presence indicator (0 or 1 octet) + * - Link mapping of TID 0(optional) to TID 7(optional). Each field has 0 or 2 + * octets. + */ + +/* Definitions related TID-to-link mapping control*/ +/* Direction */ +#define WLAN_T2LM_CONTROL_DIRECTION_IDX 0 +#define WLAN_T2LM_CONTROL_DIRECTION_BITS 2 +/* Default link mapping */ +#define WLAN_T2LM_CONTROL_DEFAULT_LINK_MAPPING_IDX 2 +#define WLAN_T2LM_CONTROL_DEFAULT_LINK_MAPPING_BITS 1 +/* Bit3 to Bit7 are reserved*/ +/* Link mapping presence indicator */ +#define WLAN_T2LM_CONTROL_LINK_MAPPING_PRESENCE_INDICATOR_IDX 8 +#define WLAN_T2LM_CONTROL_LINK_MAPPING_PRESENCE_INDICATOR_BITS 8 +#endif /* WLAN_FEATURE_T2LM */ + /** * struct he_oper_6g_param: 6 Ghz params for HE * @primary_channel: HE 6GHz Primary channel number diff --git a/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h b/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h index 94968d4388..e01e2ca18e 100644 --- a/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h +++ b/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h @@ -125,6 +125,7 @@ enum mgmt_subtype { * @ACTION_CATEGORY_CDMG: CDMG Action frame * @ACTION_CATEGORY_CMMG: CMMG Action frame * @ACTION_CATEGORY_GLK: GLK Action frame + * @ACTION_CATEGORY_PROTECTED_EHT: Protected EHT Action frame * @ACTION_CATEGORY_VENDOR_SPECIFIC_PROTECTED: vendor specific protected * action category * @ACTION_CATEGORY_VENDOR_SPECIFIC: vendor specific action category @@ -160,6 +161,7 @@ enum mgmt_action_category { ACTION_CATEGORY_CDMG = 27, ACTION_CATEGORY_CMMG = 28, ACTION_CATEGORY_GLK = 29, + ACTION_CATEGORY_PROTECTED_EHT = 37, ACTION_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, ACTION_CATEGORY_VENDOR_SPECIFIC = 127, }; @@ -500,6 +502,18 @@ enum twt_actioncode { TWT_INFORMATION = 11, }; +/** + * enum eht_actioncode - Protected EHT action frames + * @EHT_T2LM_REQUEST: T2LM request action frame + * @EHT_T2LM_RESPONSE: T2LM response action frame + * @EHT_T2LM_TEARDOWN: T2LM teardown action frame + */ +enum eht_actioncode { + EHT_T2LM_REQUEST = 0, + EHT_T2LM_RESPONSE = 1, + EHT_T2LM_TEARDOWN = 2, +}; + /** * struct action_frm_hdr - action frame header * @action_category: action category @@ -635,6 +649,9 @@ struct action_frm_hdr { * @MGMT_ACTION_TWT_SETUP: TWT setup frame * @MGMT_ACTION_TWT_TEARDOWN: TWT teardown frame * @MGMT_ACTION_TWT_INFORMATION: TWT information frame + * @MGMT_ACTION_EHT_T2LM_REQUEST: T2LM request frame + * @MGMT_ACTION_EHT_T2LM_RESPONSE: T2LM response frame + * @MGMT_ACTION_EHT_T2LM_TEARDOWN: T2LM teardown frame * @MGMT_MAX_FRAME_TYPE: max. mgmt frame types */ enum mgmt_frame_type { @@ -764,6 +781,9 @@ enum mgmt_frame_type { MGMT_ACTION_TWT_SETUP, MGMT_ACTION_TWT_TEARDOWN, MGMT_ACTION_TWT_INFORMATION, + MGMT_ACTION_EHT_T2LM_REQUEST, + MGMT_ACTION_EHT_T2LM_RESPONSE, + MGMT_ACTION_EHT_T2LM_TEARDOWN, MGMT_MAX_FRAME_TYPE, }; diff --git a/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_tgt_api.c b/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_tgt_api.c index 019c59a95d..c7a1e90fef 100644 --- a/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_tgt_api.c +++ b/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_tgt_api.c @@ -791,6 +791,45 @@ mgmt_get_twt_action_subtype(uint8_t action_code) return frm_type; } +#ifdef WLAN_FEATURE_11BE +/** + * mgmt_get_protected_eht_action_subtype() - gets protected EHT action subtype + * @action_code: action code + * + * This function returns the subtype for protected EHT action category. + * + * Return: mgmt frame type + */ +static enum mgmt_frame_type +mgmt_get_protected_eht_action_subtype(uint8_t action_code) +{ + enum mgmt_frame_type frm_type; + + switch (action_code) { + case EHT_T2LM_REQUEST: + frm_type = MGMT_ACTION_EHT_T2LM_REQUEST; + break; + case EHT_T2LM_RESPONSE: + frm_type = MGMT_ACTION_EHT_T2LM_RESPONSE; + break; + case EHT_T2LM_TEARDOWN: + frm_type = MGMT_ACTION_EHT_T2LM_TEARDOWN; + break; + default: + frm_type = MGMT_FRM_UNSPECIFIED; + break; + } + + return frm_type; +} +#else +static enum mgmt_frame_type +mgmt_get_protected_eht_action_subtype(uint8_t action_code) +{ + return MGMT_FRM_UNSPECIFIED; +} +#endif /* WLAN_FEATURE_11BE */ + /** * mgmt_txrx_get_action_frm_subtype() - gets action frm subtype * @mpdu_data_ptr: pointer to mpdu data @@ -881,6 +920,10 @@ mgmt_txrx_get_action_frm_subtype(uint8_t *mpdu_data_ptr) frm_type = mgmt_get_twt_action_subtype(action_hdr->action_code); break; + case ACTION_CATEGORY_PROTECTED_EHT: + frm_type = mgmt_get_protected_eht_action_subtype( + action_hdr->action_code); + break; default: frm_type = MGMT_FRM_UNSPECIFIED; break; diff --git a/umac/mlo_mgr/inc/wlan_mlo_mgr_public_structs.h b/umac/mlo_mgr/inc/wlan_mlo_mgr_public_structs.h index bead0210cd..305693ff15 100644 --- a/umac/mlo_mgr/inc/wlan_mlo_mgr_public_structs.h +++ b/umac/mlo_mgr/inc/wlan_mlo_mgr_public_structs.h @@ -383,6 +383,166 @@ struct mlpeer_auth_params { void *rs; }; +#ifdef WLAN_FEATURE_T2LM + +/** + * enum wlan_t2lm_direction - Indicates the direction for which TID-to-link + * mapping is available. + * @WLAN_T2LM_DL_DIRECTION: Downlink + * @WLAN_T2LM_UL_DIRECTION: Uplink + * @WLAN_T2LM_BIDI_DIRECTION: Both downlink and uplink + * @WLAN_T2LM_MAX_DIRECTION: Max direction, this is used only internally + * @WLAN_T2LM_INVALID_DIRECTION: Invalid, this is used only internally to check + * if the mapping present in wlan_t2lm_of_tids structure is valid or not. + */ +enum wlan_t2lm_direction { + WLAN_T2LM_DL_DIRECTION, + WLAN_T2LM_UL_DIRECTION, + WLAN_T2LM_BIDI_DIRECTION, + WLAN_T2LM_MAX_DIRECTION, + WLAN_T2LM_INVALID_DIRECTION, +}; + +/* Total 8 TIDs are supported, TID 0 to TID 7 */ +#define T2LM_MAX_NUM_TIDS 8 + +/** + * enum wlan_t2lm_category - T2LM category + * + * @WLAN_T2LM_CATEGORY_NONE: none + * @WLAN_T2LM_CATEGORY_REQUEST: T2LM request + * @WLAN_T2LM_CATEGORY_RESPONSE: T2LM response + * @WLAN_T2LM_CATEGORY_TEARDOWN: T2LM teardown + * @WLAN_T2LM_CATEGORY_INVALID: Invalid + */ +enum wlan_t2lm_category { + WLAN_T2LM_CATEGORY_NONE = 0, + WLAN_T2LM_CATEGORY_REQUEST = 1, + WLAN_T2LM_CATEGORY_RESPONSE = 2, + WLAN_T2LM_CATEGORY_TEARDOWN = 3, + WLAN_T2LM_CATEGORY_INVALID, +}; + +/** + * enum wlan_t2lm_tx_status - Status code applicable for the T2LM frames + * transmitted by the current peer. + * + * @WLAN_T2LM_TX_STATUS_NONE: Status code is not applicable + * @WLAN_T2LM_TX_STATUS_SUCCESS: AP/STA successfully transmitted the T2LM frame + * @WLAN_T2LM_TX_STATUS_FAILURE: Tx failure received from the FW. + * @WLAN_T2LM_TX_STATUS_RX_TIMEOUT: T2LM response frame not received from the + * peer for the transmitted T2LM request frame. + * @WLAN_T2LM_TX_STATUS_INVALID: Invalid status code + */ +enum wlan_t2lm_tx_status { + WLAN_T2LM_TX_STATUS_NONE = 0, + WLAN_T2LM_TX_STATUS_SUCCESS = 1, + WLAN_T2LM_TX_STATUS_FAILURE = 2, + WLAN_T2LM_TX_STATUS_RX_TIMEOUT = 3, + WLAN_T2LM_TX_STATUS_INVALID, +}; + +/** + * enum wlan_t2lm_resp_frm_type - T2LM status corresponds to T2LM response frame + * + * @WLAN_T2LM_RESP_TYPE_SUCCESS: T2LM mapping provided in the T2LM request is + * accepted either by the AP or STA + * @WLAN_T2LM_RESP_TYPE_DENIED_TID_TO_LINK_MAPPING: T2LM Request denied because + * the requested TID-to-link mapping is unacceptable. + * @WLAN_T2LM_RESP_TYPE_PREFERRED_TID_TO_LINK_MAPPING: T2LM Request rejected and + * preferred TID-to-link mapping is suggested. + * @WLAN_T2LM_RESP_TYPE_INVALID: Status code is not applicable. + */ +enum wlan_t2lm_resp_frm_type { + WLAN_T2LM_RESP_TYPE_SUCCESS = 0, + WLAN_T2LM_RESP_TYPE_DENIED_TID_TO_LINK_MAPPING = 133, + WLAN_T2LM_RESP_TYPE_PREFERRED_TID_TO_LINK_MAPPING = 134, + WLAN_T2LM_RESP_TYPE_INVALID, +}; + +/** + * enum wlan_t2lm_enable - TID-to-link negotiation supported by the mlo peer + * + * @WLAN_T2LM_NOT_SUPPORTED: T2LM is not supported by the MLD + * @WLAN_MAP_EACH_TID_TO_SAME_OR_DIFFERENET_LINK_SET: MLD supports the mapping + * of each TID to the same or different link set (Disjoint mapping). + * @WLAN_MAP_ALL_TIDS_TO_SAME_LINK_SET: MLD only supports the mapping of all + * TIDs to the same link set. + * @WLAN_T2LM_ENABLE_INVALID: invalid + */ +enum wlan_t2lm_enable { + WLAN_T2LM_NOT_SUPPORTED = 0, + WLAN_MAP_EACH_TID_TO_SAME_OR_DIFFERENET_LINK_SET = 1, + WLAN_MAP_ALL_TIDS_TO_SAME_LINK_SET = 2, + WLAN_T2LM_ENABLE_INVALID, +}; + +/** + * struct wlan_t2lm_of_tids - TID-to-Link mapping information for the frames + * transmitted on the uplink, downlink and bidirectional. + * + * @is_homogeneous_mapping: The t2lm_provisioned_links is homogeneous mapping + * @direction: 0 - Downlink, 1 - uplink 2 - Both uplink and downlink + * @default_link_mapping: value 1 indicates the default T2LM, where all the TIDs + * are mapped to all the links. + * value 0 indicates the preferred T2LM mapping + * @t2lm_provisioned_links: Indicates TID to link mapping of all the TIDS. + */ +struct wlan_t2lm_of_tids { + bool is_homogeneous_mapping; + enum wlan_t2lm_direction direction; + bool default_link_mapping; + uint16_t t2lm_provisioned_links[T2LM_MAX_NUM_TIDS]; +}; + +/** + * struct wlan_prev_t2lm_negotiated_info - Previous successful T2LM negotiation + * is saved here. + * + * @dialog_token: Save the dialog token used in T2LM request and response frame. + * @t2lm_info: Provides the TID to LINK mapping information + */ +struct wlan_prev_t2lm_negotiated_info { + uint16_t dialog_token; + struct wlan_t2lm_of_tids t2lm_info[WLAN_T2LM_MAX_DIRECTION]; +}; + +/** + * struct wlan_t2lm_onging_negotiation_info - Current ongoing T2LM negotiation + * (information about transmitted T2LM request/response frame) + * + * @category: T2LM category as T2LM request frame + * @dialog_token: Save the dialog token used in T2LM request and response frame. + * @t2lm_info: Provides the TID-to-link mapping info for UL/DL/BiDi + * @t2lm_tx_status: Status code corresponds to the transmitted T2LM frames + * @t2lm_resp_type: T2LM status corresponds to T2LM response frame. + */ +struct wlan_t2lm_onging_negotiation_info { + enum wlan_t2lm_category category; + uint8_t dialog_token; + struct wlan_t2lm_of_tids t2lm_info[WLAN_T2LM_MAX_DIRECTION]; + enum wlan_t2lm_tx_status t2lm_tx_status; + enum wlan_t2lm_resp_frm_type t2lm_resp_type; +}; + +/** + * struct wlan_mlo_peer_t2lm_policy - TID-to-link mapping information + * + * @self_gen_dialog_token: self generated dialog token used to send T2LM request + * frame; + * @t2lm_enable_val: TID-to-link enable value supported by this peer. + * @t2lm_negotiated_info: Previous successful T2LM negotiation is saved here. + * @ongoing_tid_to_link_mapping: This has the ongoing TID-to-link mapping info + * transmitted by this peer to the connected peer. + */ +struct wlan_mlo_peer_t2lm_policy { + uint8_t self_gen_dialog_token; + enum wlan_t2lm_enable t2lm_enable_val; + struct wlan_prev_t2lm_negotiated_info t2lm_negotiated_info; + struct wlan_t2lm_onging_negotiation_info ongoing_tid_to_link_mapping; +}; +#endif /* WLAN_FEATURE_T2LM */ + /* * struct wlan_mlo_peer_context - MLO peer context * @@ -402,6 +562,7 @@ struct mlpeer_auth_params { * @is_nawds_ml_peer: flag to indicate if ml_peer is NAWDS configured * @nawds_config: eack link peer's NAWDS configuration * @pending_auth: Holds pending auth request + * @t2lm_policy: TID-to-link mapping information */ struct wlan_mlo_peer_context { qdf_list_node_t peer_node; @@ -429,6 +590,9 @@ struct wlan_mlo_peer_context { #ifdef UMAC_MLO_AUTH_DEFER struct mlpeer_auth_params *pending_auth[MAX_MLO_LINK_PEERS]; #endif +#ifdef WLAN_FEATURE_T2LM + struct wlan_mlo_peer_t2lm_policy t2lm_policy; +#endif }; /*