diff --git a/components/son/dispatcher/inc/son_api.h b/components/son/dispatcher/inc/son_api.h index 14ab4eb104..a7f67296e0 100644 --- a/components/son/dispatcher/inc/son_api.h +++ b/components/son/dispatcher/inc/son_api.h @@ -182,6 +182,20 @@ int wlan_son_deliver_rrm_rpt(struct wlan_objmgr_vdev *vdev, uint8_t *addr, uint8_t *frm, uint32_t flen); +/** + * wlan_son_anqp_frame() - notify son module of mgmt frames + * @vdev: vdev + * @subtype: frame subtype + * @frame: the 802.11 frame + * @frame_len: frame length + * @action_hdr: Action header of the frame + * @macaddr: source mac address + * + * Return: 0 if event is sent successfully + */ +int wlan_son_anqp_frame(struct wlan_objmgr_vdev *vdev, int subtype, + uint8_t *frame, uint16_t frame_len, void *action_hdr, + uint8_t *macaddr); #else @@ -245,5 +259,14 @@ int wlan_son_deliver_rrm_rpt(struct wlan_objmgr_vdev *vdev, { return -EINVAL; } + +static inline +int wlan_son_anqp_frame(struct wlan_objmgr_vdev *vdev, int subtype, + uint8_t *frame, uint16_t frame_len, void *action_hdr, + uint8_t *macaddr) +{ + return -EINVAL; +} + #endif /*WLAN_FEATURE_SON*/ #endif diff --git a/components/son/dispatcher/src/son_api.c b/components/son/dispatcher/src/son_api.c index e8e0633e8b..616fa2a6dd 100644 --- a/components/son/dispatcher/src/son_api.c +++ b/components/son/dispatcher/src/son_api.c @@ -584,3 +584,33 @@ int wlan_son_deliver_rrm_rpt(struct wlan_objmgr_vdev *vdev, return 0; } + +int wlan_son_anqp_frame(struct wlan_objmgr_vdev *vdev, int subtype, + uint8_t *frame, uint16_t frame_len, void *action_hdr, + uint8_t *macaddr) +{ + struct son_act_frm_info info; + struct wlan_objmgr_psoc *psoc; + struct wlan_lmac_if_rx_ops *rx_ops; + int ret; + + if (!vdev) + return -EINVAL; + psoc = wlan_vdev_get_psoc(vdev); + if (!psoc) + return -EINVAL; + + qdf_mem_zero(&info, sizeof(info)); + info.ia = (struct ieee80211_action *)action_hdr; + info.ald_info = 1; + qdf_mem_copy(info.data.macaddr, macaddr, sizeof(tSirMacAddr)); + + rx_ops = wlan_psoc_get_lmac_if_rxops(psoc); + if (rx_ops && rx_ops->son_rx_ops.process_mgmt_frame) + ret = rx_ops->son_rx_ops.process_mgmt_frame(vdev, NULL, + subtype, frame, + frame_len, &info); + else + return -EINVAL; + return ret; +} diff --git a/core/mac/src/pe/lim/lim_process_action_frame.c b/core/mac/src/pe/lim/lim_process_action_frame.c index 97840c5d08..d8841163ab 100644 --- a/core/mac/src/pe/lim/lim_process_action_frame.c +++ b/core/mac/src/pe/lim/lim_process_action_frame.c @@ -1959,6 +1959,17 @@ void lim_process_action_frame(struct mac_context *mac_ctx, case SIR_MAC_PROT_ACTION_VENDOR_SPECIFIC_CATEGORY: case SIR_MAC_ACTION_2040_BSS_COEXISTENCE: case SIR_MAC_ACTION_GAS_INITIAL_REQUEST: + if (action_hdr->actionID == + SIR_MAC_ACTION_GAS_INITIAL_REQUEST) { + wlan_son_anqp_frame(session->vdev, + mac_hdr->fc.subType, + (uint8_t *)mac_hdr, + (uint16_t)(frame_len + + sizeof(tSirMacMgmtHdr)), + (void *)action_hdr, + &mac_hdr->sa[0]); + } + /* fallthrough */ case SIR_MAC_ACTION_GAS_INITIAL_RESPONSE: case SIR_MAC_ACTION_GAS_COMEBACK_REQUEST: case SIR_MAC_ACTION_GAS_COMEBACK_RESPONSE: