diff --git a/fw/wmi_tlv_defs.h b/fw/wmi_tlv_defs.h index f027d8ebccae..d9ad9c4d8b16 100644 --- a/fw/wmi_tlv_defs.h +++ b/fw/wmi_tlv_defs.h @@ -1643,6 +1643,11 @@ typedef enum { WMITLV_TAG_STRUC_wmi_mapc_cortwt_params, WMITLV_TAG_STRUC_wmi_lpi_scan_result_ind_fixed_param, WMITLV_TAG_STRUC_wmi_lpi_ap_info_t, + WMITLV_TAG_STRUC_wmi_nan_disc_service_rsp_event_fixed_param, + WMITLV_TAG_STRUC_wmi_nan_disc_match_event_fixed_param, + WMITLV_TAG_STRUC_wmi_nan_disc_service_req_cmd_fixed_param, + WMITLV_TAG_STRUC_wmi_nan_disc_cancel_service_req_cmd_fixed_param, + WMITLV_TAG_STRUC_wmi_nan_disc_service_req_terminated_event_fixed_param, } WMITLV_TAG_ID; /* * IMPORTANT: Please add _ALL_ WMI Commands Here. @@ -2254,6 +2259,8 @@ typedef enum { OP(WMI_RTT_PEER_MEAS_CANCEL_CMDID) \ OP(WMI_VDEV_GET_CHAN_HOP_STATUS_REPORT_CMDID) \ OP(WMI_PEER_SET_MAPC_PARAMS_CMDID) \ + OP(WMI_NAN_DISC_SERVICE_REQ_CMDID) \ + OP(WMI_NAN_DISC_CANCEL_SERVICE_REQ_CMDID) \ /* add new CMD_LIST elements above this line */ @@ -2625,6 +2632,9 @@ typedef enum { OP(WMI_RTT_PEER_MEAS_REPORT_EVENTID) \ OP(WMI_VDEV_CHAN_HOP_STATUS_REPORT_EVENTID) \ OP(WMI_LPI_SCAN_RESULT_EVENTID_V2) \ + OP(WMI_NAN_DISC_SERVICE_RSP_EVENTID) \ + OP(WMI_NAN_DISC_MATCH_EVENTID) \ + OP(WMI_NAN_DISC_SERVICE_REQ_TERMINATED_EVENTID) \ /* add new EVT_LIST elements above this line */ @@ -4517,6 +4527,92 @@ WMITLV_CREATE_PARAM_STRUC(WMI_NAN_PEER_SCHEDULE_CMDID); WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, peer_caps_ie_data, WMITLV_SIZE_VAR) WMITLV_CREATE_PARAM_STRUC(WMI_NAN_PEER_PARAMS_CMDID); +/** + * NAN Discovery Service Request Command + * (NL80211_CMD_ADD_NAN_FUNCTION equivalent) + * + * Carries all parameters needed to register a NAN Publish, Subscribe, or + * Follow-up function with the firmware in offload mode. + * + * TLV layout (in order): + * + * [0] wmi_nan_disc_service_req_cmd_fixed_param fixed_param + * All fixed scalar fields: vdev_id, service_req_type, instance_id, ttl, + * publish_type, followup_instance_id, followup_requestor_id, + * followup_dest, sdea_ctrl, pairing_bootstrap_methods, srf_bf_idx, + * srf_include, service_req_flags, and all _len / _num count fields. + * + * [1] A_UINT8 service_id[] + * 6-byte NAN Service ID (SHA-256 of service name, first 6 bytes), + * zero-padded to 8 bytes for 4-byte WMI alignment. + * Maps to: NL80211_ATTR_NAN_FUNC_SERVICE_ID / cfg80211_nan_func.service_id + * + * [2] A_UINT8 serv_spec_info[] + * Service Specific Info — opaque application payload, max 255 bytes. + * Valid byte count given by fixed_param.serv_spec_info_len. + * Maps to: NL80211_ATTR_NAN_FUNC_SERVICE_INFO / + * cfg80211_nan_func.serv_spec_info + * + * [3] A_UINT8 srf_bf[] + * SRF (Service Range Filter) Bloom filter data. + * Valid byte count given by fixed_param.srf_bf_len. + * Maps to: NL80211_ATTR_NAN_FUNC_SRF_BF / cfg80211_nan_func.srf_bf + * + * [4] wmi_mac_addr srf_macs[] + * SRF MAC address filter list (WMITLV_TAG_ARRAY_FIXED_STRUC). + * Entry count given by fixed_param.num_srf_macs. + * Maps to: NL80211_ATTR_NAN_FUNC_SRF_MAC_ADDRS / + * cfg80211_nan_func.srf_macs + * + * [5] A_UINT8 rx_match_filter[] + * RX match filter byte stream (ieee80211 protocol order). + * Valid byte count given by fixed_param.rx_match_filter_len. + * Maps to: NL80211_ATTR_NAN_FUNC_RX_MATCH_FILTER / + * cfg80211_nan_func.rx_filters + * + * [6] A_UINT8 tx_match_filter[] + * TX match filter byte stream (ieee80211 protocol order). + * Valid byte count given by fixed_param.tx_match_filter_len. + * Maps to: NL80211_ATTR_NAN_FUNC_TX_MATCH_FILTER / + * cfg80211_nan_func.tx_filters + * + * [7] A_UINT32 cipher_suites[] + * Array of supported NAN cipher suite IDs (CSIDs). + * Entry count given by fixed_param.num_cipher_suites. + * Maps to: NL80211_ATTR_NAN_FUNC_CIPHER_SUITES / + * cfg80211_nan_func.cipher_suites + * + * [8] A_UINT8 nd_pmk[] + * NAN Data Path PMK, exactly 32 bytes when present. + * Present and valid only when + * WMI_NAN_DISC_SERVICE_REQ_FLAGS_GET_ND_PMK_VALID( + * fixed_param.service_req_flags) == 1; + * zero-length TLV otherwise. + * Maps to: NL80211_ATTR_NAN_FUNC_ND_PMK / cfg80211_nan_func.nd_pmk + */ +#define WMITLV_TABLE_WMI_NAN_DISC_SERVICE_REQ_CMDID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_nan_disc_service_req_cmd_fixed_param, wmi_nan_disc_service_req_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, service_id, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, serv_spec_info, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, srf_bf, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_FIXED_STRUC, wmi_mac_addr, srf_macs, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, rx_match_filter, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, tx_match_filter, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_UINT32, A_UINT32, cipher_suites, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, nd_pmk, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, extra_nan_attrs, WMITLV_SIZE_VAR) +WMITLV_CREATE_PARAM_STRUC(WMI_NAN_DISC_SERVICE_REQ_CMDID); + +/** NAN Discovery Delete Function Cmd + * + * TLV (tag length value) parameters follow the + * wmi_nan_disc_cancel_service_req_cmd_fixed_param structure. The TLV's are: + * wmi_nan_disc_cancel_service_req_cmd_fixed_param fixed_param; + */ +#define WMITLV_TABLE_WMI_NAN_DISC_CANCEL_SERVICE_REQ_CMDID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_nan_disc_cancel_service_req_cmd_fixed_param, wmi_nan_disc_cancel_service_req_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) +WMITLV_CREATE_PARAM_STRUC(WMI_NAN_DISC_CANCEL_SERVICE_REQ_CMDID); + /* NAN Data Get Capabilities Cmd */ #define WMITLV_TABLE_WMI_NDI_GET_CAP_REQ_CMDID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_ndi_get_cap_req_fixed_param, wmi_ndi_get_cap_req_fixed_param_PROTOTYPE, fixed_param, WMITLV_SIZE_FIX) @@ -7462,6 +7558,52 @@ WMITLV_CREATE_PARAM_STRUC(WMI_NAN_JOINED_CLUSTER_EVENTID); WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_nan_enable_rsp_event_fixed_param, wmi_nan_enable_rsp_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_NAN_ENABLE_RSP_EVENTID); +/** NAN Discovery Service Response Event + * + * TLV (tag length value) parameters follow the + * wmi_nan_disc_service_rsp_event_fixed_param structure. The TLV's are: + * wmi_nan_disc_service_rsp_event_fixed_param fixed_param; + */ +#define WMITLV_TABLE_WMI_NAN_DISC_SERVICE_RSP_EVENTID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_nan_disc_service_rsp_event_fixed_param, wmi_nan_disc_service_rsp_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) +WMITLV_CREATE_PARAM_STRUC(WMI_NAN_DISC_SERVICE_RSP_EVENTID); + +/** NAN Discovery Match Event (NL80211_CMD_NAN_MATCH equivalent) + * + * Unified event covering subscriber match, publisher replied, and follow-up + * received scenarios, discriminated by the type field in fixed_param. + * + * TLV (tag length value) parameters follow the + * wmi_nan_disc_match_event_fixed_param structure. The TLV's are: + * wmi_mac_addr peer_addr[]; + * A_UINT8 service_id[]; + * A_UINT8 serv_spec_info[]; + * A_UINT32 cipher_suites[]; + * A_UINT8 scid[]; + * A_UINT8 extra_info[]; + * A_UINT8 ies[]; + */ +#define WMITLV_TABLE_WMI_NAN_DISC_MATCH_EVENTID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_nan_disc_match_event_fixed_param, wmi_nan_disc_match_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_FIXED_STRUC, wmi_mac_addr, peer_addr, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, service_id, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, serv_spec_info, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_UINT32, A_UINT32, cipher_suites, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, scid, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, extra_info, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, ies, WMITLV_SIZE_VAR) +WMITLV_CREATE_PARAM_STRUC(WMI_NAN_DISC_MATCH_EVENTID); + +/** NAN Discovery Service Request Terminated Event + * + * TLV (tag length value) parameters follow the + * wmi_nan_disc_service_req_terminated_event_fixed_param structure. The TLV's are: + * wmi_nan_disc_service_req_terminated_event_fixed_param fixed_param; + */ +#define WMITLV_TABLE_WMI_NAN_DISC_SERVICE_REQ_TERMINATED_EVENTID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_nan_disc_service_req_terminated_event_fixed_param, wmi_nan_disc_service_req_terminated_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) +WMITLV_CREATE_PARAM_STRUC(WMI_NAN_DISC_SERVICE_REQ_TERMINATED_EVENTID); + /* NAN Next DW Info Event */ #define WMITLV_TABLE_WMI_NAN_NEXT_DW_INFO_EVENTID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_nan_next_dw_info_fixed_param, wmi_nan_next_dw_info_fixed_param, fixed_param, WMITLV_SIZE_FIX) diff --git a/fw/wmi_unified.h b/fw/wmi_unified.h index 925d5b6761b8..e53617e96af6 100644 --- a/fw/wmi_unified.h +++ b/fw/wmi_unified.h @@ -1579,7 +1579,26 @@ typedef enum { * negotiation etc.). */ WMI_NAN_PEER_PARAMS_CMDID, - + /** + * Command to request for NAN service discovery operations i.e. + * Publish, Subscribe, Followup to be handled by FW. + * This command carries the full NAN function parameters equivalent + * to NL80211_CMD_ADD_NAN_FUNCTION / cfg80211_nan_func, including + * service ID, SRF filters, match filters, SDEA control, security + * (cipher suites, ND-PMK), and NAN3 pairing configuration. + */ + WMI_NAN_DISC_SERVICE_REQ_CMDID, + /** + * Command to cancel an active NAN discovery service request + * (Publish or Subscribe). + * Equivalent of NL80211_CMD_DEL_NAN_FUNCTION in the cfg80211 + * offload interface. + * Host identifies the service request by instance_id (offload path) + * or cookie (standard path); FW frees the service request and sends + * WMI_NAN_DISC_SERVICE_REQ_TERMINATED_EVENTID if the service request + * was active. + */ + WMI_NAN_DISC_CANCEL_SERVICE_REQ_CMDID, /** Modem power state command */ WMI_MODEM_POWER_STATE_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_COEX), @@ -2699,6 +2718,29 @@ typedef enum { WMI_NDP_CHANNEL_INFO_EVENTID, /* Event to indicate availability of STA AP connection on DFS channel */ WMI_NAN_DFS_CHANNEL_AVAILABILITY_IND_EVENTID, + /** + * Event response to NAN discovery service request command + * (WMI_NAN_DISC_SERVICE_REQ_CMDID); + * carries the instance_id assigned by FW and a status code indicating + * whether the Publish / Subscribe service request was accepted + */ + WMI_NAN_DISC_SERVICE_RSP_EVENTID, + /** + * NAN discovery match event; covers two match scenarios: + * subscriber found publisher (type=PUBLISH), publisher received subscribe + * (type=SUBSCRIBE). + * Equivalent of NL80211_CMD_NAN_MATCH in the cfg80211 + * offload interface. + */ + WMI_NAN_DISC_MATCH_EVENTID, + /** + * NAN discovery service request terminated event; sent when a Publish or + * Subscribe service request is cancelled by the host, expires (TTL), or is + * terminated by FW due to an error. + * Equivalent of NL80211_CMD_DEL_NAN_FUNCTION (EVENT: terminated) + * in the cfg80211 offload interface. + */ + WMI_NAN_DISC_SERVICE_REQ_TERMINATED_EVENTID, /* Coex Event */ WMI_COEX_REPORT_ANTENNA_ISOLATION_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_COEX), @@ -5624,7 +5666,9 @@ typedef struct { struct { A_UINT32 dw_notif_lead_time: 8, - reserved2: 24; + /* enable supplicant based NAN offload mode */ + enable_nan_ofld_mode: 1, + reserved2: 23; }; }; } wmi_resource_config; @@ -5635,9 +5679,34 @@ typedef struct { WMI_SET_BITS(word32, 0, 1, value) #define WMI_RSRC_CFG_NAN_CONFIG_DW_NOTIF_LEAD_TIME_GET(word32) \ - WMI_GET_BITS(word32, 0, 8) + WMI_GET_BITS(word32, 0, 8) #define WMI_RSRC_CFG_NAN_CONFIG_DW_NOTIF_LEAD_TIME_SET(word32, value) \ - WMI_SET_BITS(word32, 0, 8, value) + WMI_SET_BITS(word32, 0, 8, value) + +#define WMI_RSRC_CFG_NAN_CONFIG_ENABLE_NAN_OFLD_MODE_GET(word32) \ + WMI_GET_BITS(word32, 8, 1) +#define WMI_RSRC_CFG_NAN_CONFIG_ENABLE_NAN_OFLD_MODE_SET(word32, value) \ + WMI_SET_BITS(word32, 8, 1, value) + +/* + * WMI_NAN_DISC_COOKIE_GET / WMI_NAN_DISC_COOKIE_SET + * + * Accessor macros for the 64-bit cookie value split across + * cookie_low32 and cookie_high32 fields in WMI NAN disc structs. + * + * Usage (read): + * A_UINT64 c = WMI_NAN_DISC_COOKIE_GET(p->cookie_low32, p->cookie_high32); + * + * Usage (write): + * WMI_NAN_DISC_COOKIE_SET(p->cookie_low32, p->cookie_high32, my_cookie); + */ +#define WMI_NAN_DISC_COOKIE_GET(low32, high32) \ + (((A_UINT64)(high32) << 32) | (A_UINT64)(low32)) +#define WMI_NAN_DISC_COOKIE_SET(low32, high32, cookie64) \ + do { \ + (low32) = (A_UINT32)((cookie64) & 0xFFFFFFFFUL); \ + (high32) = (A_UINT32)(((cookie64) >> 32) & 0xFFFFFFFFUL); \ + } while (0) #define WMI_MSDU_FLOW_AST_ENABLE_GET(msdu_flow_config0, ast_x) \ (((ast_x) == 0) ? 1 : ((msdu_flow_config0) & (1 << ((ast_x) - 1)))) @@ -32542,6 +32611,244 @@ typedef struct { */ } wmi_nan_peer_params_cmd_fixed_param; +/* + * NAN service request type values for + * wmi_nan_disc_service_req_cmd_fixed_param.service_req_type. + * Maps to NL80211_NAN_FUNC_PUBLISH / SUBSCRIBE / FOLLOW_UP. + */ +typedef enum { + WMI_NAN_DISC_SERVICE_REQ_PUBLISH = 1, + WMI_NAN_DISC_SERVICE_REQ_SUBSCRIBE = 2, + WMI_NAN_DISC_SERVICE_REQ_FOLLOW_UP = 3, +} WMI_NAN_DISC_SERVICE_REQ_TYPE; + +/* + * Publish type values for + * wmi_nan_disc_service_req_cmd_fixed_param.publish_type. + * Valid only when service_req_type == WMI_NAN_DISC_SERVICE_REQ_PUBLISH. + * Maps to NL80211_NAN_FUNC_PUBLISH_TYPE. + */ +typedef enum { + WMI_NAN_DISC_PUBLISH_UNSOLICITED = 0, + WMI_NAN_DISC_PUBLISH_SOLICITED = 1, + WMI_NAN_DISC_PUBLISH_UNSOLICITED_SOLICITED = 2, +} WMI_NAN_DISC_PUBLISH_TYPE; + +/* + * NAN discovery service request termination reason values for + * wmi_nan_disc_service_req_terminated_event_fixed_param.reason. + * Maps to nl80211_nan_func_term_reason. + */ +typedef enum { + /** + * Service request was cancelled by an explicit host request + * (WMI_NAN_DISC_CANCEL_SERVICE_REQ_CMDID). + * Maps to NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST = 0 + */ + WMI_NAN_DISC_SERVICE_REQ_TERM_REASON_USER_REQUEST = 0, + /** + * Service request lifetime (TTL) elapsed; + * FW auto-expired the service request. + * Maps to NL80211_NAN_FUNC_TERM_REASON_TTL_EXPIRED = 1 + */ + WMI_NAN_DISC_SERVICE_REQ_TERM_REASON_TTL_EXPIRED = 1, + /** + * FW encountered an internal error and could not maintain + * the service request. + * Also covers NAN_TERMINATED_REASON_COUNT_REACHED from the HAL path. + * Maps to NL80211_NAN_FUNC_TERM_REASON_ERROR = 2 + */ + WMI_NAN_DISC_SERVICE_REQ_TERM_REASON_ERROR = 2, +} WMI_NAN_DISC_SERVICE_REQ_TERM_REASON; + +/* + * SDEA (Service Descriptor Extension Attribute) control field bit accessors. + * Maps to NL80211_ATTR_NAN_FUNC_SDEA_CTRL / cfg80211_nan_func.sdea_ctrl. + * Bit 2 : Data Path Required + * Bit 6 : Security Required + */ +#define WMI_NAN_DISC_SDEA_CTRL_GET_DATA_PATH_REQ(sdea) \ + WMI_GET_BITS(sdea, 2, 1) +#define WMI_NAN_DISC_SDEA_CTRL_SET_DATA_PATH_REQ(sdea, v) \ + WMI_SET_BITS(sdea, 2, 1, v) +#define WMI_NAN_DISC_SDEA_CTRL_GET_SECURITY_REQ(sdea) \ + WMI_GET_BITS(sdea, 6, 1) +#define WMI_NAN_DISC_SDEA_CTRL_SET_SECURITY_REQ(sdea, v) \ + WMI_SET_BITS(sdea, 6, 1, v) + +/* + * service_req_flags field bit accessors for + * wmi_nan_disc_service_req_cmd_fixed_param.service_req_flags. + * Packs all boolean cfg80211_nan_func fields into one A_UINT32. + * + * Bit 0 : close_range — match only with close-range peers + * (NL80211_ATTR_NAN_FUNC_CLOSE_RANGE) + * Bit 1 : publish_bcast — send in broadcast discovery beacons; + * valid only for Publish + * (NL80211_ATTR_NAN_FUNC_PUBLISH_BCAST) + * Bit 2 : subscribe_active — send active subscribe queries; + * valid only for Subscribe + * (NL80211_ATTR_NAN_FUNC_SUBSCRIBE_ACTIVE) + * Bit 3 : gtk_required — group temporal key required for + * multicast data + * (NL80211_ATTR_NAN_FUNC_GTK_REQUIRED) + * Bit 4 : pairing_setup — enable initial NAN3 pairing setup + * (NL80211_ATTR_NAN_FUNC_PAIRING_SETUP) + * Bit 5 : pairing_cache — enable persistent NAN3 pairing cache + * (NL80211_ATTR_NAN_FUNC_PAIRING_CACHE) + * Bit 6 : pairing_verify — enable NAN3 pairing re-verification + * (NL80211_ATTR_NAN_FUNC_PAIRING_VERIFY) + * Bit 7 : nd_pmk_valid — nd_pmk TLV is populated and valid + * (NL80211_ATTR_NAN_FUNC_ND_PMK) + * Bits 8-31 : reserved, must be set to 0 + */ +#define WMI_NAN_DISC_SERVICE_REQ_FLAGS_GET_CLOSE_RANGE(f) \ + WMI_GET_BITS(f, 0, 1) +#define WMI_NAN_DISC_SERVICE_REQ_FLAGS_SET_CLOSE_RANGE(f, v) \ + WMI_SET_BITS(f, 0, 1, v) +#define WMI_NAN_DISC_SERVICE_REQ_FLAGS_GET_PUBLISH_BCAST(f) \ + WMI_GET_BITS(f, 1, 1) +#define WMI_NAN_DISC_SERVICE_REQ_FLAGS_SET_PUBLISH_BCAST(f, v) \ + WMI_SET_BITS(f, 1, 1, v) +#define WMI_NAN_DISC_SERVICE_REQ_FLAGS_GET_SUBSCRIBE_ACTIVE(f) \ + WMI_GET_BITS(f, 2, 1) +#define WMI_NAN_DISC_SERVICE_REQ_FLAGS_SET_SUBSCRIBE_ACTIVE(f, v) \ + WMI_SET_BITS(f, 2, 1, v) +#define WMI_NAN_DISC_SERVICE_REQ_FLAGS_GET_GTK_REQUIRED(f) \ + WMI_GET_BITS(f, 3, 1) +#define WMI_NAN_DISC_SERVICE_REQ_FLAGS_SET_GTK_REQUIRED(f, v) \ + WMI_SET_BITS(f, 3, 1, v) +#define WMI_NAN_DISC_SERVICE_REQ_FLAGS_GET_PAIRING_SETUP(f) \ + WMI_GET_BITS(f, 4, 1) +#define WMI_NAN_DISC_SERVICE_REQ_FLAGS_SET_PAIRING_SETUP(f, v) \ + WMI_SET_BITS(f, 4, 1, v) +#define WMI_NAN_DISC_SERVICE_REQ_FLAGS_GET_PAIRING_CACHE(f) \ + WMI_GET_BITS(f, 5, 1) +#define WMI_NAN_DISC_SERVICE_REQ_FLAGS_SET_PAIRING_CACHE(f, v) \ + WMI_SET_BITS(f, 5, 1, v) +#define WMI_NAN_DISC_SERVICE_REQ_FLAGS_GET_PAIRING_VERIFY(f) \ + WMI_GET_BITS(f, 6, 1) +#define WMI_NAN_DISC_SERVICE_REQ_FLAGS_SET_PAIRING_VERIFY(f, v) \ + WMI_SET_BITS(f, 6, 1, v) +#define WMI_NAN_DISC_SERVICE_REQ_FLAGS_GET_ND_PMK_VALID(f) \ + WMI_GET_BITS(f, 7, 1) +#define WMI_NAN_DISC_SERVICE_REQ_FLAGS_SET_ND_PMK_VALID(f, v) \ + WMI_SET_BITS(f, 7, 1, v) + +/** + * WMI command to add a NAN discovery function + * (Publish / Subscribe / Follow-up). + * WMI equivalent of NL80211_CMD_ADD_NAN_FUNCTION / cfg80211_nan_func. + */ +typedef struct { + /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_nan_disc_service_req_cmd_fixed_param */ + A_UINT32 tlv_header; + /** Unique id identifying the NMI VDEV */ + A_UINT32 vdev_id; + /** + * NAN service request type: + * 1=Publish, 2=Subscribe, 3=Follow-up; + * refer to WMI_NAN_DISC_SERVICE_REQ_TYPE + */ + A_UINT32 service_req_type; + /** + * Unique cookie assigned by cfg80211 for this function. + * Split into two A_UINT32 words for endian portability. + * Use WMI_NAN_DISC_COOKIE_GET/SET macros to access as A_UINT64. + */ + A_UINT32 cookie_low32; /* lower 32 bits of 64-bit cookie value */ + A_UINT32 cookie_high32; /* upper 32 bits of 64-bit cookie value */ + /** + * Function lifetime in Discovery Windows; + * 0 = active until explicitly deleted + */ + A_UINT32 ttl; + /** + * Publish transmission mode; + * valid only when service_req_type == WMI_NAN_DISC_SERVICE_REQ_PUBLISH; + * refer to WMI_NAN_DISC_PUBLISH_TYPE + */ + A_UINT32 publish_type; + /** + * Local function instance ID to which this follow-up is associated; + * valid only when service_req_type == WMI_NAN_DISC_SERVICE_REQ_FOLLOW_UP + */ + A_UINT32 followup_instance_id; + /** + * Requestor instance ID from the prior match event; + * valid only when service_req_type == WMI_NAN_DISC_SERVICE_REQ_FOLLOW_UP + */ + A_UINT32 followup_requestor_id; + /** + * NMI MAC address of the peer to send the follow-up to; + * valid only when service_req_type == WMI_NAN_DISC_SERVICE_REQ_FOLLOW_UP + */ + wmi_mac_addr followup_dest; + /** + * SDEA control field bitmap; use WMI_NAN_DISC_SDEA_CTRL_GET/SET macros; + * bit2=Data Path Required, bit6=Security Required + */ + A_UINT32 sdea_ctrl; + /** + * Bitmap of supported NAN3 pairing bootstrap methods; + * bit0=Opportunistic, bit1=PIN + */ + A_UINT32 pairing_bootstrap_methods; + /** + * Bloom filter index for the SRF; + * valid only when TLV srf_bf[] is non-empty + */ + A_UINT32 srf_bf_idx; + /** + * SRF filter mode: + * 0=exclude listed entries, 1=include only listed entries + */ + A_UINT32 srf_include; + /** + * Packed boolean flags; use WMI_NAN_DISC_SERVICE_REQ_FLAGS_GET/SET macros; + * bit0=close_range, bit1=publish_bcast, bit2=subscribe_active, + * bit3=gtk_required, bit4=pairing_setup, bit5=pairing_cache, + * bit6=pairing_verify, bit7=nd_pmk_valid, bits8-31=reserved + */ + A_UINT32 service_req_flags; + /** Actual number of bytes in TLV serv_spec_info[]; max 255 */ + A_UINT32 serv_spec_info_len; + /** Actual number of bytes in TLV srf_bf[] */ + A_UINT32 srf_bf_len; + /** Actual number of bytes in TLV rx_match_filter[] */ + A_UINT32 rx_match_filter_len; + /** Actual number of bytes in TLV tx_match_filter[] */ + A_UINT32 tx_match_filter_len; + /** extra_nan_attrs_len: + * number of valid bytes (i.e. excluding final alignment-padding) + * in the TLV extra_nan_attrs[] + */ + A_UINT32 extra_nan_attrs_len; + /** + * TLV (tag length value) parameters follow this structure: + * A_UINT8 service_id[]; 6-byte NAN Service ID, + * zero-padded to 8 bytes + * A_UINT8 serv_spec_info[]; Service Specific Info, max 255 bytes + * A_UINT8 srf_bf[]; SRF Bloom filter data + * wmi_mac_addr srf_macs[]; SRF MAC address filter list + * A_UINT8 rx_match_filter[]; RX match filter byte stream + * A_UINT8 tx_match_filter[]; TX match filter byte stream + * A_UINT32 cipher_suites[]; NAN cipher suite ID array + * A_UINT8 nd_pmk[]; NAN Data Path PMK, 32 bytes; + * present only when bit7 of + * service_req_flags is set + * A_UINT8 extra_nan_attrs[]; extra NAN attrs like Device Cap, + * Shared Key Desc, CSIA cap etc. + * are sent in stream of bytes + * (ieee80211 protocol order). + * The host must manually byteswap + * these bytes within each 4-byte word + * if the host's endianness doesn’t + * match the target’s, to ensure the + * expected byte order is maintained. + */ +} wmi_nan_disc_service_req_cmd_fixed_param; + typedef enum { WMI_NAN_STATUS_NO_NAN_AVAIL_DFS_CHANNEL_DETECTED = 0x1, WMI_NAN_STATUS_NO_DFS_BEACONS_RECEIVED = 0x2, @@ -32676,6 +32983,213 @@ typedef struct { A_UINT32 mac_id; /* MAC ID associated with NAN primary discovery channel */ } wmi_nan_enable_rsp_event_fixed_param; +/** + * WMI event response to WMI_NAN_DISC_SERVICE_REQ_CMDID. + * Sent by FW for each Publish / Subscribe / Follow-up function registration. + */ +typedef struct { + /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_nan_disc_service_rsp_event_fixed_param */ + A_UINT32 tlv_header; + /** Unique id identifying the NMI VDEV */ + A_UINT32 vdev_id; + /** + * Opaque cookie assigned by the driver; monotonically increasing per rdev. + * Host must store this and include it in every subsequent match event + * correlation. Equivalent of NL80211_ATTR_COOKIE in the CFG response. + * Split into two A_UINT32 words for endian portability. + * Use WMI_NAN_DISC_COOKIE_GET/SET macros to access as A_UINT64. + */ + A_UINT32 cookie_low32; /* lower 32 bits of 64-bit cookie value */ + A_UINT32 cookie_high32; /* upper 32 bits of 64-bit cookie value */ + /** + * FW/device-assigned service instance ID (1-255). + * Used in SDF frames and match events. + * Equivalent of NL80211_NAN_FUNC_INSTANCE_ID in the CFG response. + */ + A_UINT32 instance_id; + /** + * NAN service request type of the registered service request; + * refer to WMI_NAN_DISC_SERVICE_REQ_TYPE: + * 1 = WMI_NAN_DISC_SERVICE_REQ_PUBLISH + * 2 = WMI_NAN_DISC_SERVICE_REQ_SUBSCRIBE + * 3 = WMI_NAN_DISC_SERVICE_REQ_FOLLOW_UP + */ + A_UINT32 service_req_type; + /** Status code returned by FW: 0 = success, non-zero = failure */ + A_UINT32 status; +} wmi_nan_disc_service_rsp_event_fixed_param; + +/** + * WMI command to cancel an active NAN discovery service request. + * WMI equivalent of NL80211_CMD_DEL_NAN_FUNCTION / cfg80211 offload interface. + */ +typedef struct { + /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_nan_disc_cancel_service_req_cmd_fixed_param */ + A_UINT32 tlv_header; + /** Unique id identifying the NMI VDEV */ + A_UINT32 vdev_id; + /** + * NAN service request type being cancelled; + * refer to WMI_NAN_DISC_SERVICE_REQ_TYPE: + * 1 = WMI_NAN_DISC_SERVICE_REQ_PUBLISH + * 2 = WMI_NAN_DISC_SERVICE_REQ_SUBSCRIBE + */ + A_UINT32 service_req_type; + /** + * Instance ID of the service request to cancel (offload path); range 1-255. + * FW resolves instance_id to the internal service request object. + * Equivalent of NL80211_NAN_FUNC_INSTANCE_ID in + * NL80211_CMD_DEL_NAN_FUNCTION + */ + A_UINT32 instance_id; + /** + * Opaque cookie of the service request to cancel (standard path). + * Used when instance_id is not available; + * FW resolves cookie to service request. + * Equivalent of NL80211_ATTR_COOKIE in NL80211_CMD_DEL_NAN_FUNCTION. + * Set to 0 when instance_id is used instead. + * Split into two A_UINT32 words for endian portability. + * Use WMI_NAN_DISC_COOKIE_GET/SET macros to access as A_UINT64. + */ + A_UINT32 cookie_low32; /* lower 32 bits of 64-bit cookie value */ + A_UINT32 cookie_high32; /* upper 32 bits of 64-bit cookie value */ +} wmi_nan_disc_cancel_service_req_cmd_fixed_param; + +/** + * WMI event indicating a NAN discovery service request has been terminated. + * WMI equivalent of NL80211_CMD_DEL_NAN_FUNCTION (EVENT: terminated). + * Sent by FW when a Publish or Subscribe service request is cancelled by the + * host, expires due to TTL, or is terminated by FW due to an error. + */ +typedef struct { + /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_nan_disc_service_req_terminated_event_fixed_param */ + A_UINT32 tlv_header; + /** Unique id identifying the NMI VDEV */ + A_UINT32 vdev_id; + /** + * Opaque cookie of the terminated service request; assigned by FW in + * WMI_NAN_DISC_SERVICE_RSP_EVENTID. + * Equivalent of NL80211_ATTR_COOKIE in the terminated event. + * Split into two A_UINT32 words for endian portability. + * Use WMI_NAN_DISC_COOKIE_GET/SET macros to access as A_UINT64. + */ + A_UINT32 cookie_low32; /* lower 32 bits of 64-bit cookie value */ + A_UINT32 cookie_high32; /* upper 32 bits of 64-bit cookie value */ + /** + * Instance ID of the terminated service request (1-255). + * Equivalent of NL80211_NAN_FUNC_INSTANCE_ID in the terminated event + */ + A_UINT32 instance_id; + /** + * NAN service request type that was terminated; + * refer to WMI_NAN_DISC_SERVICE_REQ_TYPE: + * 1 = WMI_NAN_DISC_SERVICE_REQ_PUBLISH + * 2 = WMI_NAN_DISC_SERVICE_REQ_SUBSCRIBE + */ + A_UINT32 service_req_type; + /** + * Termination reason; refer to WMI_NAN_DISC_SERVICE_REQ_TERM_REASON enum: + * WMI_NAN_DISC_SERVICE_REQ_TERM_REASON_USER_REQUEST (0) — + * cancelled by host + * WMI_NAN_DISC_SERVICE_REQ_TERM_REASON_TTL_EXPIRED (1) — + * TTL elapsed + * WMI_NAN_DISC_SERVICE_REQ_TERM_REASON_ERROR (2) — + * FW internal error + */ + A_UINT32 reason; +} wmi_nan_disc_service_req_terminated_event_fixed_param; + +/** +* WMI NAN discovery match event (NL80211_CMD_NAN_MATCH equivalent). + * Covers two match scenarios, discriminated by the type field: + * type = WMI_NAN_DISC_SERVICE_REQ_PUBLISH — + * subscriber found a matching publisher + * type = WMI_NAN_DISC_SERVICE_REQ_SUBSCRIBE — + * publisher received a subscribe frame + */ +typedef struct { + /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_nan_disc_match_event_fixed_param */ + A_UINT32 tlv_header; + /** Unique id identifying the NMI VDEV */ + A_UINT32 vdev_id; + /** + * Cookie assigned by the driver in the + * WMI_NAN_DISC_SERVICE_RSP_EVENTID response; + * host uses this to correlate the match to the originating function. + * Split into two A_UINT32 words for endian portability. + * Use WMI_NAN_DISC_COOKIE_GET/SET macros to access as A_UINT64. + */ + A_UINT32 cookie_low32; /* lower 32 bits of 64-bit cookie value */ + A_UINT32 cookie_high32; /* upper 32 bits of 64-bit cookie value */ + /** Local function instance ID that triggered the match */ + A_UINT32 inst_id; + /** Peer's function instance ID */ + A_UINT32 peer_inst_id; + /** + * NAN service request type discriminating the match scenario; + * refer to WMI_NAN_DISC_SERVICE_REQ_TYPE: + * 1 = WMI_NAN_DISC_SERVICE_REQ_PUBLISH (subscriber matched a publisher) + * 2 = WMI_NAN_DISC_SERVICE_REQ_SUBSCRIBE (publisher received a subscribe) + */ + A_UINT32 type; + /** + * SDEA control field from peer; use WMI_NAN_DISC_SDEA_CTRL_GET macros; + * bit2=Data Path Required, bit6=Security Required + */ + A_UINT32 sdea_ctrl; + /** Peer's pairing bootstrap methods bitmap */ + A_UINT32 bootstrap_methods; + /** 1 = peer requires NDP (derived from SDEA bit 2); 0 = no NDP required */ + A_UINT32 data_path; + /** + * 1 = GTK protection required (derived from SDEA bit 10); + * 0 = not required + */ + A_UINT32 gtk_required; + /** 1 = peer supports pairing setup; 0 = not supported */ + A_UINT32 pairing_setup; + /** 1 = peer supports pairing cache; 0 = not supported */ + A_UINT32 pairing_cache; + /** 1 = peer supports pairing verify; 0 = not supported */ + A_UINT32 pairing_verify; + /** + * Received signal strength indicator (RSSI) in dBm; + * valid only when rssi_valid == 1 + */ + A_INT32 rssi; + /** 1 = rssi field is valid; 0 = rssi not populated */ + A_UINT32 rssi_valid; + /** Actual number of bytes in TLV peer_addr[] (always 6) */ + A_UINT32 peer_addr_len; + /** Actual number of bytes in TLV service_id[] (always 6) */ + A_UINT32 service_id_len; + /** Actual number of bytes in TLV serv_spec_info[] */ + A_UINT32 serv_spec_info_len; + /** Actual number of bytes in TLV scid[] */ + A_UINT32 scid_len; + /** + * Actual number of bytes in TLV extra_info[]; + * relevant when peer includes Extended SSI attribute + */ + A_UINT32 extra_info_len; + /** + * Actual number of bytes in TLV ies[]; + * raw IE blob parsed by supplicant: NPBA→bootstrap handler, + * Shared Key Descriptor→NIK exchange + */ + A_UINT32 ies_len; + /** + * TLV (tag length value) parameters follow this structure: + * wmi_mac_addr peer_addr[]; peer NMI address, 6 bytes (padded to 8) + * A_UINT8 service_id[]; local service ID, 6 bytes + * A_UINT8 serv_spec_info[]; service specific info from peer + * A_UINT32 cipher_suites[]; peer's NAN cipher suite ID array + * A_UINT8 scid[]; secure context ID; present when security_required == 1 + * A_UINT8 extra_info[]; extended SSI; present when extra_info_len > 0 + * A_UINT8 ies[]; raw IEs blob; present when ies_len > 0 + */ +} wmi_nan_disc_match_event_fixed_param; + typedef struct { /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_nan_next_dw_info_fixed_param */ A_UINT32 tlv_header; @@ -43401,6 +43915,8 @@ static INLINE A_UINT8 *wmi_id_to_name(A_UINT32 wmi_command) WMI_RETURN_STRING(WMI_REQUEST_TDLS_STATS_CMDID); WMI_RETURN_STRING(WMI_GET_CHIPSET_LOGGING_STATS_CMDID); WMI_RETURN_STRING(WMI_VDEV_GET_CHAN_HOP_STATUS_REPORT_CMDID); + WMI_RETURN_STRING(WMI_NAN_DISC_SERVICE_REQ_CMDID); + WMI_RETURN_STRING(WMI_NAN_DISC_CANCEL_SERVICE_REQ_CMDID); } return (A_UINT8 *) "Invalid WMI cmd"; diff --git a/fw/wmi_version.h b/fw/wmi_version.h index d1cf1d6225f9..f1277d305b45 100644 --- a/fw/wmi_version.h +++ b/fw/wmi_version.h @@ -37,7 +37,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_ 1772 +#define __WMI_REVISION_ 1773 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work