Skip to content

Commit

Permalink
nrf_wifi: Wait for command status from firmware
Browse files Browse the repository at this point in the history
After sending the command, wait for command status event from firmware.
There are two scenarios. Either firmware sends a specific event for the
command or a generic event (NRF_WIFI_UMAC_EVENT_CMD_STATUS) where it
states about the command failure/success.

This commit is related to wait for NRF_WIFI_UMAC_EVENT_CMD_STATUS and
it's handling.

For commands expecting specific events will be added later.

Signed-off-by: Ajay Parida <ajay.parida@nordicsemi.no>
  • Loading branch information
ajayparida committed Aug 5, 2024
1 parent fd38b6b commit 6ee198d
Show file tree
Hide file tree
Showing 3 changed files with 433 additions and 131 deletions.
22 changes: 10 additions & 12 deletions nrf_wifi/fw_if/umac_if/inc/default/fmac_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -488,17 +488,15 @@ struct nrf_wifi_fmac_dev_ctx_def {
#endif /* CONFIG_NRF700X_RAW_DATA_TX */
};

#define CMD_BUCKET_BOUND 32
/**
* @brief Structure to store information for the
* commands sent to UMAC.
*/
#define MAX_CMD_PENDING_STATUS 4

struct nrf_wifi_fmac_cmd_status_info {
/* This element is bit mapped.
* Each bit representing state of a command
* (whether a command has been sent & event pending or not.)
*/
unsigned int state[NRF_WIFI_UMAC_CMD_MAX / CMD_BUCKET_BOUND];
/** Command pending or not */
char state;
/** Command status as returned in event by firmware*/
char status;
/** Command Id */
char cmd_id;
};

/**
Expand Down Expand Up @@ -538,8 +536,8 @@ struct nrf_wifi_fmac_vif_ctx {
/** Promiscuous mode setting */
bool promisc_mode;
#endif /* CONFIG_NRF700X_PROMISC_DATA_RX */
/** Command status information related to this VIF*/
struct nrf_wifi_fmac_cmd_status_info cmd_status_info;
/** Command status information related to this VIF */
struct nrf_wifi_fmac_cmd_status_info cmd_status_info[MAX_CMD_PENDING_STATUS];
};

/**
Expand Down
Loading

0 comments on commit 6ee198d

Please sign in to comment.