Skip to content

Commit 117054a

Browse files
committed
nrf_wifi: Support for DMS
Directed multicast service(DMS) support. Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
1 parent 9b1bb42 commit 117054a

File tree

6 files changed

+166
-2
lines changed

6 files changed

+166
-2
lines changed

nrf_wifi/fw_if/umac_if/inc/default/fmac_api.h

+16
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,22 @@ enum nrf_wifi_status nrf_wifi_fmac_rpu_recovery_callback(void *mac_dev_ctx,
10611061
enum nrf_wifi_status nrf_wifi_fmac_set_quiet_period(void *fmac_dev_ctx,
10621062
unsigned char if_idx,
10631063
unsigned int quiet_period);
1064+
1065+
/**
1066+
* @brief DMS request command
1067+
* @param fmac_dev_ctx Pointer to the UMAC IF context for a RPU WLAN device.
1068+
* @param if_idx Index of the interface on which the DMS parameters be set.
1069+
* @param dms_info DMS parameters.
1070+
*
1071+
* This function is used to send a command to the RPU firmware to:
1072+
* - Configure DMS request specific parameters.
1073+
*
1074+
*@retval NRF_WIFI_STATUS_SUCCESS On success
1075+
*@retval NRF_WIFI_STATUS_FAIL On failure to execute command
1076+
*/
1077+
enum nrf_wifi_status nrf_wifi_fmac_req_dms(void *fmac_dev_ctx,
1078+
unsigned char if_idx,
1079+
struct nrf_wifi_umac_config_dms_info *dms_info);
10641080
/**
10651081
* @}
10661082
*/

nrf_wifi/fw_if/umac_if/inc/default/fmac_structs.h

+5
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ struct nrf_wifi_fmac_callbk_fns {
278278
void (*reg_change_callbk_fn)(void *os_vif_ctx,
279279
struct nrf_wifi_event_regulatory_change *reg_change,
280280
unsigned int event_len);
281+
282+
/** Callback function to be called when a DMS event is received. */
283+
void (*dms_callbk_fn)(void *if_priv,
284+
struct nrf_wifi_umac_cmd_config_dms *dms_event_info,
285+
unsigned int event_len);
281286
};
282287

283288
#if defined(CONFIG_NRF700X_STA_MODE) || defined(__DOXYGEN__)

nrf_wifi/fw_if/umac_if/inc/fw/host_rpu_umac_if.h

+87-1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ enum nrf_wifi_umac_commands {
146146
NRF_WIFI_UMAC_CMD_CONFIG_EXTENDED_PS,
147147
/** Configure quiet period @ref nrf_wifi_umac_cmd_config_quiet_period */
148148
NRF_WIFI_UMAC_CMD_CONFIG_QUIET_PERIOD,
149+
/** Add DMS @ref nrf_wifi_umac_cmd_req_config_dms */
150+
NRF_WIFI_UMAC_CMD_REQ_CONFIG_DMS,
149151
};
150152

151153
/**
@@ -242,7 +244,9 @@ enum nrf_wifi_umac_events {
242244
/** send connection information @ref nrf_wifi_umac_event_conn_info. */
243245
NRF_WIFI_UMAC_EVENT_GET_CONNECTION_INFO,
244246
/** @ref nrf_wifi_umac_event_power_save_info */
245-
NRF_WIFI_UMAC_EVENT_GET_POWER_SAVE_INFO
247+
NRF_WIFI_UMAC_EVENT_GET_POWER_SAVE_INFO,
248+
/** Send DMS response information @ref nrf_wifi_umac_cmd_config_dms */
249+
NRF_WIFI_UMAC_EVENT_DMS,
246250
};
247251

248252
/**
@@ -3527,4 +3531,86 @@ struct nrf_wifi_umac_cmd_config_quiet_period {
35273531
unsigned int quiet_period_in_sec;
35283532
} __NRF_WIFI_PKD;
35293533

3534+
/**
3535+
* @brief DMS add commands and events.
3536+
*
3537+
*/
3538+
3539+
#define NRF_WIFI_DMS_RESP_RECEIVED 0
3540+
#define NRF_WIFI_DMS_RESP_NOT_RECEIVED 1
3541+
#define NRF_WIFI_INVALID_DMS_PARAM 3
3542+
3543+
/**
3544+
* @brief The RPU can send the following DMS events to host.
3545+
*
3546+
*/
3547+
enum nrf_wifi_dms_event_type {
3548+
NRF_WIFI_DMS_EVENT_ACCEPT,
3549+
NRF_WIFI_DMS_EVENT_REJECT,
3550+
NRF_WIFI_DMS_EVENT_TERMINATE,
3551+
NRF_WIFI_DMS_EVENT_INVALID
3552+
};
3553+
3554+
/**
3555+
* @brief The Host can send the following DMS request type events to rpu.
3556+
*
3557+
*/
3558+
enum nrf_wifi_dms_req_type {
3559+
NRF_WIFI_DMS_REQ_ADD,
3560+
NRF_WIFI_DMS_REQ_REMOVE,
3561+
NRF_WIFI_DMS_REQ_CHANGE,
3562+
NRF_WIFI_DMS_REQ_INVALID
3563+
};
3564+
3565+
/**
3566+
* @brief This structure describes the DMS information.
3567+
*
3568+
*/
3569+
3570+
struct nrf_wifi_umac_config_dms_info {
3571+
/** Dialog token, used to map requests to responses */
3572+
unsigned char dialog_token;
3573+
/** DMSID, used to identifying the DMS for the group addressed frame */
3574+
unsigned char dmsid;
3575+
/** request type (0- ADD, 1-Remove, 2- Change) */
3576+
unsigned char req_type;
3577+
/** User priority */
3578+
unsigned char up;
3579+
/** Tclas type */
3580+
unsigned char tclas_type;
3581+
/** Tclas mask */
3582+
unsigned char tclas_mask;
3583+
/** Tclas category 4 elements */
3584+
/** Version */
3585+
unsigned char version;
3586+
/** Source ip address */
3587+
unsigned int src_ip_addr;
3588+
/** Destination ip address */
3589+
unsigned int dest_ip_addr;
3590+
/** Source port */
3591+
unsigned short src_port;
3592+
/** Destination port */
3593+
unsigned short dest_port;
3594+
/** DSCP */
3595+
unsigned char dscp;
3596+
/** Protocol */
3597+
unsigned char protocol;
3598+
} __NRF_WIFI_PKD;
3599+
3600+
/**
3601+
* @brief This structure defines the parameters required for DMS operation.
3602+
*
3603+
*/
3604+
3605+
struct nrf_wifi_umac_cmd_config_dms {
3606+
/** Header @ref nrf_wifi_umac_hdr */
3607+
struct nrf_wifi_umac_hdr umac_hdr;
3608+
/** DMS add info @ref nrf_wifi_umac_config_dms_info */
3609+
struct nrf_wifi_umac_config_dms_info info;
3610+
/** Event type received */
3611+
enum nrf_wifi_dms_event_type event_type;
3612+
/** 0->not received 1->received */
3613+
unsigned char dms_resp_status;
3614+
} __NRF_WIFI_PKD;
3615+
35303616
#endif /* __HOST_RPU_UMAC_IF_H */

nrf_wifi/fw_if/umac_if/inc/fw/patch_info.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ struct nrf70_fw_image_info {
5858
#define RPU_FAMILY (1)
5959
#define RPU_MAJOR_VERSION (2)
6060
#define RPU_MINOR_VERSION (11)
61-
#define RPU_PATCH_VERSION (0)
61+
#define RPU_PATCH_VERSION (5)
6262

6363
#endif /* _PATCH_INFO_H */

nrf_wifi/fw_if/umac_if/src/default/fmac_api.c

+46
Original file line numberDiff line numberDiff line change
@@ -3231,4 +3231,50 @@ enum nrf_wifi_status nrf_wifi_fmac_set_quiet_period(void *dev_ctx,
32313231

32323232
return status;
32333233
}
3234+
3235+
3236+
enum nrf_wifi_status nrf_wifi_fmac_req_dms(void *dev_ctx,
3237+
unsigned char if_idx,
3238+
struct nrf_wifi_umac_config_dms_info *dms_info)
3239+
{
3240+
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
3241+
struct nrf_wifi_umac_cmd_config_dms *req_dms = NULL;
3242+
struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL;
3243+
3244+
if (!dev_ctx || !dms_info) {
3245+
goto out;
3246+
}
3247+
3248+
fmac_dev_ctx = dev_ctx;
3249+
3250+
req_dms = nrf_wifi_osal_mem_zalloc(fmac_dev_ctx->fpriv->opriv,
3251+
sizeof(*req_dms));
3252+
3253+
if (!req_dms) {
3254+
nrf_wifi_osal_log_err(fmac_dev_ctx->fpriv->opriv,
3255+
"%s: Unable to allocate memory",
3256+
__func__);
3257+
goto out;
3258+
}
3259+
3260+
nrf_wifi_osal_mem_cpy(fmac_dev_ctx->fpriv->opriv,
3261+
&req_dms->info,
3262+
dms_info,
3263+
sizeof(req_dms->info));
3264+
3265+
req_dms->umac_hdr.cmd_evnt = NRF_WIFI_UMAC_CMD_REQ_CONFIG_DMS;
3266+
req_dms->umac_hdr.ids.wdev_id = if_idx;
3267+
req_dms->umac_hdr.ids.valid_fields |= NRF_WIFI_INDEX_IDS_WDEV_ID_VALID;
3268+
3269+
status = umac_cmd_cfg(fmac_dev_ctx,
3270+
req_dms,
3271+
sizeof(*req_dms));
3272+
out:
3273+
if (req_dms) {
3274+
nrf_wifi_osal_mem_free(fmac_dev_ctx->fpriv->opriv,
3275+
req_dms);
3276+
}
3277+
3278+
return status;
3279+
}
32343280
#endif /* CONFIG_NRF700X_STA_MODE */

nrf_wifi/fw_if/umac_if/src/event.c

+11
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,17 @@ static enum nrf_wifi_status umac_event_ctrl_process(struct nrf_wifi_fmac_dev_ctx
588588
__func__,
589589
umac_hdr->cmd_evnt);
590590
break;
591+
case NRF_WIFI_UMAC_EVENT_DMS:
592+
if (callbk_fns->dms_callbk_fn)
593+
callbk_fns->dms_callbk_fn(vif_ctx->os_vif_ctx,
594+
event_data,
595+
event_len);
596+
else
597+
nrf_wifi_osal_log_err(fmac_dev_ctx->fpriv->opriv,
598+
"%s: No callback registered for event %d",
599+
__func__,
600+
umac_hdr->cmd_evnt);
601+
break;
591602
#endif /* CONFIG_NRF700X_STA_MODE */
592603
#endif /* !CONFIG_NRF700X_RADIO_TEST */
593604
default:

0 commit comments

Comments
 (0)