qcacmn: Support mgmt packet peer filter based on mac address

RA mac address is used to support tx capture mgmt peer filter.

Change-Id: I895034723d4b75557ad33f55adc017d1caa3a40d
This commit is contained in:
nobelj
2020-01-24 08:03:49 -08:00
committed by nshrivas
parent b8e9bcdf4c
commit 7cc67e504f
8 changed files with 56 additions and 18 deletions

View File

@@ -1188,6 +1188,7 @@ enum cdp_tx_enh_capture_mode {
CDP_TX_ENH_CAPTURE_DISABLED = 0, CDP_TX_ENH_CAPTURE_DISABLED = 0,
CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS, CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS,
CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER, CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER,
CDP_TX_ENH_CAPTURE_MAX,
}; };
/* /*

View File

@@ -906,7 +906,7 @@ static inline QDF_STATUS
cdp_update_peer_pkt_capture_params(ol_txrx_soc_handle soc, cdp_update_peer_pkt_capture_params(ol_txrx_soc_handle soc,
uint8_t pdev_id, uint8_t pdev_id,
bool is_rx_pkt_cap_enable, bool is_rx_pkt_cap_enable,
bool is_tx_pkt_cap_enable, uint8_t is_tx_pkt_cap_enable,
uint8_t *peer_mac) uint8_t *peer_mac)
{ {
if (!soc || !soc->ops) { if (!soc || !soc->ops) {
@@ -921,8 +921,7 @@ cdp_update_peer_pkt_capture_params(ol_txrx_soc_handle soc,
return soc->ops->ctrl_ops->txrx_update_peer_pkt_capture_params return soc->ops->ctrl_ops->txrx_update_peer_pkt_capture_params
(soc, pdev_id, is_rx_pkt_cap_enable, (soc, pdev_id, is_rx_pkt_cap_enable,
is_tx_pkt_cap_enable, is_tx_pkt_cap_enable, peer_mac);
peer_mac);
} }
#endif /* WLAN_TX_PKT_CAPTURE_ENH || WLAN_RX_PKT_CAPTURE_ENH */ #endif /* WLAN_TX_PKT_CAPTURE_ENH || WLAN_RX_PKT_CAPTURE_ENH */

View File

@@ -704,7 +704,7 @@ struct cdp_ctrl_ops {
#if defined(WLAN_TX_PKT_CAPTURE_ENH) || defined(WLAN_RX_PKT_CAPTURE_ENH) #if defined(WLAN_TX_PKT_CAPTURE_ENH) || defined(WLAN_RX_PKT_CAPTURE_ENH)
QDF_STATUS (*txrx_update_peer_pkt_capture_params)( QDF_STATUS (*txrx_update_peer_pkt_capture_params)(
ol_txrx_soc_handle soc, uint8_t pdev_id, ol_txrx_soc_handle soc, uint8_t pdev_id,
bool is_rx_pkt_cap_enable, bool is_tx_pkt_cap_enable, bool is_rx_pkt_cap_enable, uint8_t is_tx_pkt_cap_enable,
uint8_t *peer_mac); uint8_t *peer_mac);
#endif /* WLAN_TX_PKT_CAPTURE_ENH || WLAN_RX_PKT_CAPTURE_ENH */ #endif /* WLAN_TX_PKT_CAPTURE_ENH || WLAN_RX_PKT_CAPTURE_ENH */
QDF_STATUS QDF_STATUS

View File

@@ -1802,6 +1802,19 @@ void dp_print_pdev_tx_capture_stats(struct dp_pdev *pdev)
{ {
} }
/*
* dp_peer_tx_capture_filter_check: check filter is enable for the filter
* and update tx_cap_enabled flag
* @pdev: DP PDEV handle
* @peer: DP PEER handle
*
* return: void
*/
static inline
void dp_peer_tx_capture_filter_check(struct dp_pdev *pdev,
struct dp_peer *peer)
{
}
#endif #endif
#ifdef FEATURE_PERPKT_INFO #ifdef FEATURE_PERPKT_INFO

View File

@@ -5581,6 +5581,12 @@ dp_peer_create_wifi3(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
DP_STATS_INIT(peer); DP_STATS_INIT(peer);
DP_STATS_UPD(peer, rx.avg_rssi, INVALID_RSSI); DP_STATS_UPD(peer, rx.avg_rssi, INVALID_RSSI);
/*
* In tx_monitor mode, filter may be set for unassociated peer
* when unassociated peer get associated peer need to
* update tx_cap_enabled flag to support peer filter.
*/
dp_peer_tx_capture_filter_check(pdev, peer);
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} else { } else {
/* /*
@@ -5704,6 +5710,14 @@ dp_peer_create_wifi3(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
peer_cookie.ctx; peer_cookie.ctx;
} }
} }
/*
* In tx_monitor mode, filter may be set for unassociated peer
* when unassociated peer get associated peer need to
* update tx_cap_enabled flag to support peer filter.
*/
dp_peer_tx_capture_filter_check(pdev, peer);
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
@@ -8399,7 +8413,8 @@ static QDF_STATUS dp_get_psoc_param(struct cdp_soc_t *cdp_soc,
* @soc: DP_SOC handle * @soc: DP_SOC handle
* @pdev_id: id of DP_PDEV handle * @pdev_id: id of DP_PDEV handle
* @is_rx_pkt_cap_enable: enable/disable Rx packet capture in monitor mode * @is_rx_pkt_cap_enable: enable/disable Rx packet capture in monitor mode
* @is_tx_pkt_cap_enable: enable/disable Tx packet capture in monitor mode * @is_tx_pkt_cap_enable: enable/disable/delete/print
* Tx packet capture in monitor mode
* @peer_mac: MAC address for which the above need to be enabled/disabled * @peer_mac: MAC address for which the above need to be enabled/disabled
* *
* Return: Success if Rx & Tx capture is enabled for peer, false otherwise * Return: Success if Rx & Tx capture is enabled for peer, false otherwise
@@ -8408,28 +8423,30 @@ QDF_STATUS
dp_peer_update_pkt_capture_params(ol_txrx_soc_handle soc, dp_peer_update_pkt_capture_params(ol_txrx_soc_handle soc,
uint8_t pdev_id, uint8_t pdev_id,
bool is_rx_pkt_cap_enable, bool is_rx_pkt_cap_enable,
bool is_tx_pkt_cap_enable, uint8_t is_tx_pkt_cap_enable,
uint8_t *peer_mac) uint8_t *peer_mac)
{ {
QDF_STATUS status;
struct dp_peer *peer; struct dp_peer *peer;
struct dp_pdev *pdev = struct dp_pdev *pdev =
dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc, dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc,
pdev_id); pdev_id);
if (!pdev) if (!pdev)
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
peer = (struct dp_peer *)dp_find_peer_by_addr((struct cdp_pdev *)pdev, peer = (struct dp_peer *)dp_find_peer_by_addr((struct cdp_pdev *)pdev,
peer_mac); peer_mac);
if (!peer) {
dp_err("Invalid Peer");
return QDF_STATUS_E_FAILURE;
}
dp_peer_set_rx_capture_enabled(peer, is_rx_pkt_cap_enable); /* we need to set tx pkt capture for non associated peer */
dp_peer_set_tx_capture_enabled(peer, is_tx_pkt_cap_enable); status = dp_peer_set_tx_capture_enabled(pdev, peer,
is_tx_pkt_cap_enable,
peer_mac);
return QDF_STATUS_SUCCESS; status = dp_peer_set_rx_capture_enabled(pdev, peer,
is_rx_pkt_cap_enable,
peer_mac);
return status;
} }
/* /*

View File

@@ -286,7 +286,9 @@ void dp_peer_ast_index_flow_queue_map_create(void *soc_hdl,
* @soc: DP SOC handle * @soc: DP SOC handle
* @pdev_id: id of DP pdev handle * @pdev_id: id of DP pdev handle
* @is_rx_pkt_cap_enable: enable/disable Rx packet capture in monitor mode * @is_rx_pkt_cap_enable: enable/disable Rx packet capture in monitor mode
* @is_tx_pkt_cap_enable: enable/disable Tx packet capture in monitor mode * @is_tx_pkt_cap_enable: enable/disable/delete/print
* Tx packet capture in monitor mode
* Tx packet capture in monitor mode
* @peer_mac: MAC address for which the above need to be enabled/disabled * @peer_mac: MAC address for which the above need to be enabled/disabled
* *
* Return: Success if Rx & Tx capture is enabled for peer, false otherwise * Return: Success if Rx & Tx capture is enabled for peer, false otherwise
@@ -295,7 +297,7 @@ QDF_STATUS
dp_peer_update_pkt_capture_params(ol_txrx_soc_handle soc, dp_peer_update_pkt_capture_params(ol_txrx_soc_handle soc,
uint8_t pdev_id, uint8_t pdev_id,
bool is_rx_pkt_cap_enable, bool is_rx_pkt_cap_enable,
bool is_tx_pkt_cap_enable, uint8_t is_tx_pkt_cap_enable,
uint8_t *peer_mac); uint8_t *peer_mac);
/* /*

View File

@@ -1103,8 +1103,11 @@ bool dp_rx_multipass_process(struct dp_peer *peer, qdf_nbuf_t nbuf,
#ifndef WLAN_RX_PKT_CAPTURE_ENH #ifndef WLAN_RX_PKT_CAPTURE_ENH
static inline static inline
void dp_peer_set_rx_capture_enabled(struct dp_peer *peer_handle, bool value) QDF_STATUS dp_peer_set_rx_capture_enabled(struct dp_pdev *pdev,
struct dp_peer *peer_handle,
bool value, uint8_t *mac_addr)
{ {
return QDF_STATUS_SUCCESS;
} }
#endif #endif

View File

@@ -357,8 +357,11 @@ static inline void dp_tx_comp_process_exception(struct dp_tx_desc_s *tx_desc)
#ifndef WLAN_TX_PKT_CAPTURE_ENH #ifndef WLAN_TX_PKT_CAPTURE_ENH
static inline static inline
void dp_peer_set_tx_capture_enabled(struct dp_peer *peer_handle, bool value) QDF_STATUS dp_peer_set_tx_capture_enabled(struct dp_pdev *pdev,
struct dp_peer *peer_handle,
uint8_t value, uint8_t *peer_mac)
{ {
return QDF_STATUS_SUCCESS;
} }
#endif #endif
#endif #endif