Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iot ncs main #1391

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified nrf_wifi/fw_bins/default/nrf70.bin
Binary file not shown.
Binary file modified nrf_wifi/fw_bins/radio_test/nrf70.bin
Binary file not shown.
Binary file modified nrf_wifi/fw_bins/scan_only/nrf70.bin
Binary file not shown.
Binary file modified nrf_wifi/fw_bins/system_with_raw/nrf70.bin
Binary file not shown.
32 changes: 32 additions & 0 deletions nrf_wifi/fw_if/umac_if/inc/default/fmac_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,38 @@ enum nrf_wifi_status nrf_wifi_fmac_rpu_recovery_callback(void *mac_dev_ctx,
unsigned int len);
/** @endcond */
#endif /* CONFIG_NRF_RPU_RECOVERY */

/**
* @brief Configure WLAN quiet period.
* @param fmac_dev_ctx Pointer to the UMAC IF context for a RPU WLAN device.
* @param if_idx Index of the interface on which power management is to be set.
* @param quite period Quiet period in seconds to be set.
*
* This function is used to send a command (%NRF_WIFI_UMAC_CMD_CONFIG_QUIET_PERIOD to:
* - The RPU firmware to set quiet period.
*
*@retval NRF_WIFI_STATUS_SUCCESS On success
*@retval NRF_WIFI_STATUS_FAIL On failure to execute command
*/
enum nrf_wifi_status nrf_wifi_fmac_set_quiet_period(void *fmac_dev_ctx,
unsigned char if_idx,
unsigned int quiet_period);

/**
* @brief DMS request command
* @param fmac_dev_ctx Pointer to the UMAC IF context for a RPU WLAN device.
* @param if_idx Index of the interface on which the DMS parameters be set.
* @param dms_info DMS parameters.
*
* This function is used to send a command to the RPU firmware to:
* - Configure DMS request specific parameters.
*
*@retval NRF_WIFI_STATUS_SUCCESS On success
*@retval NRF_WIFI_STATUS_FAIL On failure to execute command
*/
enum nrf_wifi_status nrf_wifi_fmac_req_dms(void *fmac_dev_ctx,
unsigned char if_idx,
struct nrf_wifi_umac_config_dms_info *dms_info);
/**
* @}
*/
Expand Down
5 changes: 5 additions & 0 deletions nrf_wifi/fw_if/umac_if/inc/default/fmac_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ struct nrf_wifi_fmac_callbk_fns {
void (*reg_change_callbk_fn)(void *os_vif_ctx,
struct nrf_wifi_event_regulatory_change *reg_change,
unsigned int event_len);

/** Callback function to be called when a DMS event is received. */
void (*dms_callbk_fn)(void *if_priv,
struct nrf_wifi_umac_cmd_config_dms *dms_event_info,
unsigned int event_len);
};

#if defined(CONFIG_NRF700X_STA_MODE) || defined(__DOXYGEN__)
Expand Down
2 changes: 2 additions & 0 deletions nrf_wifi/fw_if/umac_if/inc/fw/host_rpu_sys_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,8 @@ struct rpu_conf_params {
unsigned char country_code[NRF_WIFI_COUNTRY_CODE_LEN];
/** Contention window value to be configured */
unsigned int tx_pkt_cw;
/** Quiet period in seconds*/
unsigned int quiet_period;
} __NRF_WIFI_PKD;

/**
Expand Down
118 changes: 116 additions & 2 deletions nrf_wifi/fw_if/umac_if/inc/fw/host_rpu_umac_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ enum nrf_wifi_umac_commands {
/** Set listen interval @ref nrf_wifi_umac_cmd_set_listen_interval */
NRF_WIFI_UMAC_CMD_SET_LISTEN_INTERVAL,
/** Configure extended power save @ref nrf_wifi_umac_cmd_config_extended_ps */
NRF_WIFI_UMAC_CMD_CONFIG_EXTENDED_PS
NRF_WIFI_UMAC_CMD_CONFIG_EXTENDED_PS,
/** Configure quiet period @ref nrf_wifi_umac_cmd_config_quiet_period */
NRF_WIFI_UMAC_CMD_CONFIG_QUIET_PERIOD,
/** Add DMS @ref nrf_wifi_umac_cmd_req_config_dms */
NRF_WIFI_UMAC_CMD_REQ_CONFIG_DMS,
};

/**
Expand Down Expand Up @@ -240,7 +244,9 @@ enum nrf_wifi_umac_events {
/** send connection information @ref nrf_wifi_umac_event_conn_info. */
NRF_WIFI_UMAC_EVENT_GET_CONNECTION_INFO,
/** @ref nrf_wifi_umac_event_power_save_info */
NRF_WIFI_UMAC_EVENT_GET_POWER_SAVE_INFO
NRF_WIFI_UMAC_EVENT_GET_POWER_SAVE_INFO,
/** Send DMS response information @ref nrf_wifi_umac_cmd_config_dms */
NRF_WIFI_UMAC_EVENT_DMS,
};

/**
Expand Down Expand Up @@ -779,6 +785,7 @@ struct nrf_wifi_signal {

#define NRF_WIFI_CMD_CONNECT_COMMON_INFO_USE_RRM (1 << 14)
#define NRF_WIFI_CONNECT_COMMON_INFO_PREV_BSSID (1 << 15)
#define NRF_WIFI_CONNECT_COMMON_INFO_SECURITY (1 << 16)

/**
* @brief This structure contains parameters related to the connection.
Expand Down Expand Up @@ -1302,6 +1309,18 @@ struct nrf_wifi_umac_cmd_auth {

#define NRF_WIFI_CMD_ASSOCIATE_MAC_ADDR_VALID (1 << 0)

/**
* @brief Types of connection protected/un-protected.
*
*/

enum nrf_wifi_conn_type {
/* Connection to be non-protected */
NRF_WIFI_CONN_TYPE_OPEN,
/* Connection to be protected */
NRF_WIFI_CONN_TYPE_SECURE,
};

/**
* @brief This structure specifies the parameters to be used when sending an association request.
*
Expand Down Expand Up @@ -1331,6 +1350,8 @@ struct nrf_wifi_umac_assoc_info {
* BSS MAX IDLE IE in assoc request frame.
*/
unsigned short bss_max_idle_time;
/** Connection type */
unsigned char conn_type;
} __NRF_WIFI_PKD;

/**
Expand Down Expand Up @@ -3499,4 +3520,97 @@ struct nrf_wifi_umac_event_cmd_status {
unsigned int cmd_status;
} __NRF_WIFI_PKD;

/**
* @brief This structure represents the command used to configure quiet period.
*
*/
struct nrf_wifi_umac_cmd_config_quiet_period {
/** Header @ref nrf_wifi_umac_hdr */
struct nrf_wifi_umac_hdr umac_hdr;
/** quiet period value in seconds */
unsigned int quiet_period_in_sec;
} __NRF_WIFI_PKD;

/**
* @brief DMS add commands and events.
*
*/

#define NRF_WIFI_DMS_RESP_RECEIVED 0
#define NRF_WIFI_DMS_RESP_NOT_RECEIVED 1
#define NRF_WIFI_INVALID_DMS_PARAM 3

/**
* @brief The RPU can send the following DMS events to host.
*
*/
enum nrf_wifi_dms_event_type {
NRF_WIFI_DMS_EVENT_ACCEPT,
NRF_WIFI_DMS_EVENT_REJECT,
NRF_WIFI_DMS_EVENT_TERMINATE,
NRF_WIFI_DMS_EVENT_INVALID
};

/**
* @brief The Host can send the following DMS request type events to rpu.
*
*/
enum nrf_wifi_dms_req_type {
NRF_WIFI_DMS_REQ_ADD,
NRF_WIFI_DMS_REQ_REMOVE,
NRF_WIFI_DMS_REQ_CHANGE,
NRF_WIFI_DMS_REQ_INVALID
};

/**
* @brief This structure describes the DMS information.
*
*/

struct nrf_wifi_umac_config_dms_info {
/** Dialog token, used to map requests to responses */
unsigned char dialog_token;
/** DMSID, used to identifying the DMS for the group addressed frame */
unsigned char dmsid;
/** request type (0- ADD, 1-Remove, 2- Change) */
unsigned char req_type;
/** User priority */
unsigned char up;
/** Tclas type */
unsigned char tclas_type;
/** Tclas mask */
unsigned char tclas_mask;
/** Tclas category 4 elements */
/** Version */
unsigned char version;
/** Source ip address */
unsigned int src_ip_addr;
/** Destination ip address */
unsigned int dest_ip_addr;
/** Source port */
unsigned short src_port;
/** Destination port */
unsigned short dest_port;
/** DSCP */
unsigned char dscp;
/** Protocol */
unsigned char protocol;
} __NRF_WIFI_PKD;

/**
* @brief This structure defines the parameters required for DMS operation.
*
*/

struct nrf_wifi_umac_cmd_config_dms {
/** Header @ref nrf_wifi_umac_hdr */
struct nrf_wifi_umac_hdr umac_hdr;
/** DMS add info @ref nrf_wifi_umac_config_dms_info */
struct nrf_wifi_umac_config_dms_info info;
/** Event type received */
enum nrf_wifi_dms_event_type event_type;
/** 0->not received 1->received */
unsigned char dms_resp_status;
} __NRF_WIFI_PKD;

#endif /* __HOST_RPU_UMAC_IF_H */
93 changes: 93 additions & 0 deletions nrf_wifi/fw_if/umac_if/src/default/fmac_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,11 @@ enum nrf_wifi_status nrf_wifi_fmac_assoc(void *dev_ctx,
connect_common_info->maxidle_insec = assoc_info->bss_max_idle_time;
}

if (assoc_info->conn_type == NRF_WIFI_CONN_TYPE_SECURE) {
connect_common_info->nrf_wifi_flags |=
NRF_WIFI_CONNECT_COMMON_INFO_SECURITY;
}

status = umac_cmd_cfg(fmac_dev_ctx,
assoc_cmd,
sizeof(*assoc_cmd));
Expand Down Expand Up @@ -3184,4 +3189,92 @@ enum nrf_wifi_status nrf_wifi_fmac_set_ps_wakeup_mode(void *dev_ctx,

return status;
}

enum nrf_wifi_status nrf_wifi_fmac_set_quiet_period(void *dev_ctx,
unsigned char if_idx,
unsigned int quiet_period)
{
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
struct nrf_wifi_umac_cmd_config_quiet_period *set_quiet_period_cmd = NULL;
struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL;

fmac_dev_ctx = dev_ctx;

if (!dev_ctx) {
goto out;
}

set_quiet_period_cmd = nrf_wifi_osal_mem_zalloc(fmac_dev_ctx->fpriv->opriv,
sizeof(*set_quiet_period_cmd));

if (!set_quiet_period_cmd) {
nrf_wifi_osal_log_err(fmac_dev_ctx->fpriv->opriv,
"%s: Unable to allocate memory",
__func__);
goto out;
}

set_quiet_period_cmd->umac_hdr.cmd_evnt = NRF_WIFI_UMAC_CMD_CONFIG_QUIET_PERIOD;
set_quiet_period_cmd->umac_hdr.ids.wdev_id = if_idx;
set_quiet_period_cmd->umac_hdr.ids.valid_fields |=
NRF_WIFI_INDEX_IDS_WDEV_ID_VALID;
set_quiet_period_cmd->quiet_period_in_sec = quiet_period;

status = umac_cmd_cfg(fmac_dev_ctx,
set_quiet_period_cmd,
sizeof(*set_quiet_period_cmd));
out:
if (set_quiet_period_cmd) {
nrf_wifi_osal_mem_free(fmac_dev_ctx->fpriv->opriv,
set_quiet_period_cmd);
}

return status;
}


enum nrf_wifi_status nrf_wifi_fmac_req_dms(void *dev_ctx,
unsigned char if_idx,
struct nrf_wifi_umac_config_dms_info *dms_info)
{
enum nrf_wifi_status status = NRF_WIFI_STATUS_FAIL;
struct nrf_wifi_umac_cmd_config_dms *req_dms = NULL;
struct nrf_wifi_fmac_dev_ctx *fmac_dev_ctx = NULL;

if (!dev_ctx || !dms_info) {
goto out;
}

fmac_dev_ctx = dev_ctx;

req_dms = nrf_wifi_osal_mem_zalloc(fmac_dev_ctx->fpriv->opriv,
sizeof(*req_dms));

if (!req_dms) {
nrf_wifi_osal_log_err(fmac_dev_ctx->fpriv->opriv,
"%s: Unable to allocate memory",
__func__);
goto out;
}

nrf_wifi_osal_mem_cpy(fmac_dev_ctx->fpriv->opriv,
&req_dms->info,
dms_info,
sizeof(req_dms->info));

req_dms->umac_hdr.cmd_evnt = NRF_WIFI_UMAC_CMD_REQ_CONFIG_DMS;
req_dms->umac_hdr.ids.wdev_id = if_idx;
req_dms->umac_hdr.ids.valid_fields |= NRF_WIFI_INDEX_IDS_WDEV_ID_VALID;

status = umac_cmd_cfg(fmac_dev_ctx,
req_dms,
sizeof(*req_dms));
out:
if (req_dms) {
nrf_wifi_osal_mem_free(fmac_dev_ctx->fpriv->opriv,
req_dms);
}

return status;
}
#endif /* CONFIG_NRF700X_STA_MODE */
11 changes: 11 additions & 0 deletions nrf_wifi/fw_if/umac_if/src/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,17 @@ static enum nrf_wifi_status umac_event_ctrl_process(struct nrf_wifi_fmac_dev_ctx
__func__,
umac_hdr->cmd_evnt);
break;
case NRF_WIFI_UMAC_EVENT_DMS:
if (callbk_fns->dms_callbk_fn)
callbk_fns->dms_callbk_fn(vif_ctx->os_vif_ctx,
event_data,
event_len);
else
nrf_wifi_osal_log_err(fmac_dev_ctx->fpriv->opriv,
"%s: No callback registered for event %d",
__func__,
umac_hdr->cmd_evnt);
break;
#endif /* CONFIG_NRF700X_STA_MODE */
#endif /* !CONFIG_NRF700X_RADIO_TEST */
default:
Expand Down
Loading