Skip to content

Commit

Permalink
nrf_wifi: Add promiscuous mode CONFIG for setting filter
Browse files Browse the repository at this point in the history
filter settings have to be enabled for PROMISCUOUS mode. This
change adds the config settings for filter and also corrects
certain build issues for promiscuous mode

Signed-off-by: Vivekananda Uppunda <[email protected]>
  • Loading branch information
VivekUppunda authored and rlubos committed Feb 23, 2024
1 parent 1cc0c0f commit 7e55e18
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions nrf_wifi/fw_if/umac_if/inc/default/fmac_structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ enum nrf_wifi_fmac_if_carr_state {
NRF_WIFI_FMAC_IF_CARR_STATE_INVALID
};

#ifdef CONFIG_NRF700X_RAW_DATA_RX
#if defined(CONFIG_NRF700X_RAW_DATA_RX) || defined(CONFIG_NRF700X_PROMISC_DATA_RX)
/**
* @brief Structure to hold raw rx packet information.
*
Expand All @@ -90,7 +90,7 @@ struct raw_rx_pkt_header {
/** Data rate of the packet (MCS or Legacy). */
unsigned char rate;
};
#endif /* CONFIG_NRF700X_RAW_DATA_RX */
#endif /* CONFIG_NRF700X_RAW_DATA_RX || CONFIG_NRF700X_PROMISC_DATA_RX */

/**
* @brief Callback functions to be invoked by UMAC IF layer when a particular event occurs.
Expand Down Expand Up @@ -512,10 +512,10 @@ struct nrf_wifi_fmac_vif_ctx {
/** TX injection mode setting */
bool txinjection_mode;
#endif /* CONFIG_NRF700X_RAW_DATA_TX || CONFIG_NRF700X_RAW_DATA_RX */
#ifdef CONFIG_NRF700X_RAW_DATA_RX
#if defined(CONFIG_NRF700X_RAW_DATA_RX) || defined(CONFIG_NRF700X_PROMISC_DATA_RX)
/** Filter setting for Monitor and Promiscuous modes */
unsigned char packet_filter;
#endif /* CONFIG_NRF700X_RAW_DATA_RX */
#endif /* CONFIG_NRF700X_RAW_DATA_RX || CONFIG_NRF700X_PROMISC_DATA_RX */
#ifdef CONFIG_NRF700X_PROMISC_DATA_RX
/** Promiscuous mode setting */
bool promisc_mode;
Expand Down
4 changes: 2 additions & 2 deletions nrf_wifi/fw_if/umac_if/inc/fmac_api_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ enum nrf_wifi_status nrf_wifi_fmac_set_channel(void *dev_ctx,

#endif /* CONFIG_NRF700X_RAW_DATA_TX || CONFIG_NRF700X_RAW_DATA_RX */

#ifdef CONFIG_NRF700X_RAW_DATA_RX
#if defined(CONFIG_NRF700X_RAW_DATA_RX) || (CONFIG_NRF700X_PROMISC_DATA_RX)
/**
* @brief Set packet filter settings
* @param dev_ctx Pointer to the UMAC IF context for a RPU WLAN device.
Expand All @@ -360,7 +360,7 @@ enum nrf_wifi_status nrf_wifi_fmac_set_channel(void *dev_ctx,
enum nrf_wifi_status nrf_wifi_fmac_set_packet_filter(void *dev_ctx, unsigned char filter,
unsigned char if_idx,
unsigned short buffer_size);
#endif
#endif /* CONFIG_NRF700X_RAW_DATA_RX || CONFIG_NRF700X_PROMISC_DATA_RX */

/**
* @}
Expand Down
4 changes: 2 additions & 2 deletions nrf_wifi/fw_if/umac_if/src/fmac_api_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ enum nrf_wifi_status nrf_wifi_fmac_set_channel(void *dev_ctx,
}
#endif /* CONFIG_NRF700X_RAW_DATA_TX || CONFIG_NRF700X_RAW_DATA_RX */

#ifdef CONFIG_NRF700X_RAW_DATA_RX
#if defined(CONFIG_NRF700X_RAW_DATA_RX) || defined(CONFIG_NRF700X_PROMISC_DATA_RX)
enum nrf_wifi_status nrf_wifi_fmac_set_packet_filter(void *dev_ctx, unsigned char filter,
unsigned char if_idx,
unsigned short buffer_size)
Expand Down Expand Up @@ -1253,4 +1253,4 @@ enum nrf_wifi_status nrf_wifi_fmac_set_packet_filter(void *dev_ctx, unsigned cha
out:
return status;
}
#endif /* CONFIG_NRF700X_RAW_DATA_RX */
#endif /* CONFIG_NRF700X_RAW_DATA_RX || CONFIG_NRF700X_PROMISC_DATA_RX */
4 changes: 2 additions & 2 deletions nrf_wifi/fw_if/umac_if/src/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ enum nrf_wifi_status nrf_wifi_fmac_rx_event_process(struct nrf_wifi_fmac_dev_ctx
struct nrf_wifi_fmac_vif_ctx *vif_ctx = NULL;
struct nrf_wifi_fmac_buf_map_info *rx_buf_info = NULL;
struct nrf_wifi_fmac_rx_pool_map_info pool_info;
#ifdef CONFIG_NRF700X_RAW_DATA_RX
#if defined(CONFIG_NRF700X_RAW_DATA_RX) || defined(CONFIG_NRF700X_PROMISC_DATA_RX)
struct raw_rx_pkt_header raw_rx_hdr;
#endif /* CONFIG_NRF700X_RAW_DATA_RX */
#endif /* CONFIG_NRF700X_RAW_DATA_RX || CONFIG_NRF700X_PROMISC_DATA_RX */
void *nwb = NULL;
void *nwb_data = NULL;
unsigned int num_pkts = 0;
Expand Down

0 comments on commit 7e55e18

Please sign in to comment.