qcacmn: Move WDS feature out of common code
Move WDS feature specific APIs out of common code as these features are WIN specific. Keep the usage inside common code under feature specific flags. Change-Id: Id907a5e22c27fc47e8314449e154525684a27e85
This commit is contained in:

committato da
Nitesh Shrivastav

parent
f38970bcdc
commit
cb99026ade
@@ -562,254 +562,6 @@ void dp_rx_add_to_free_desc_list(union dp_rx_desc_list_elem_t **head,
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* dp_rx_wds_add_or_update_ast() - Add or update the ast entry.
|
||||
*
|
||||
* @soc: core txrx main context
|
||||
* @ta_peer: WDS repeater peer
|
||||
* @mac_addr: mac address of the peer
|
||||
* @is_ad4_valid: 4-address valid flag
|
||||
* @is_sa_valid: source address valid flag
|
||||
* @is_chfrag_start: frag start flag
|
||||
* @sa_idx: source-address index for peer
|
||||
* @sa_sw_peer_id: software source-address peer-id
|
||||
*
|
||||
* Return: void:
|
||||
*/
|
||||
#ifdef FEATURE_WDS
|
||||
static inline void
|
||||
dp_rx_wds_add_or_update_ast(struct dp_soc *soc, struct dp_peer *ta_peer,
|
||||
qdf_nbuf_t nbuf, uint8_t is_ad4_valid,
|
||||
uint8_t is_sa_valid, uint8_t is_chfrag_start,
|
||||
uint16_t sa_idx, uint16_t sa_sw_peer_id)
|
||||
{
|
||||
struct dp_peer *sa_peer;
|
||||
struct dp_ast_entry *ast;
|
||||
uint32_t flags = IEEE80211_NODE_F_WDS_HM;
|
||||
uint32_t ret = 0;
|
||||
struct dp_neighbour_peer *neighbour_peer = NULL;
|
||||
struct dp_pdev *pdev = ta_peer->vdev->pdev;
|
||||
uint8_t wds_src_mac[QDF_MAC_ADDR_SIZE];
|
||||
|
||||
/* For AP mode : Do wds source port learning only if it is a
|
||||
* 4-address mpdu
|
||||
*
|
||||
* For STA mode : Frames from RootAP backend will be in 3-address mode,
|
||||
* till RootAP does the WDS source port learning; Hence in repeater/STA
|
||||
* mode, we enable learning even in 3-address mode , to avoid RootAP
|
||||
* backbone getting wrongly learnt as MEC on repeater
|
||||
*/
|
||||
if (ta_peer->vdev->opmode != wlan_op_mode_sta) {
|
||||
if (!(is_chfrag_start && is_ad4_valid))
|
||||
return;
|
||||
} else {
|
||||
/* For HKv2 Source port learing is not needed in STA mode
|
||||
* as we have support in HW
|
||||
*/
|
||||
if (soc->ast_override_support)
|
||||
return;
|
||||
}
|
||||
|
||||
if (qdf_unlikely(!is_sa_valid)) {
|
||||
qdf_mem_copy(wds_src_mac,
|
||||
(qdf_nbuf_data(nbuf) + QDF_MAC_ADDR_SIZE),
|
||||
QDF_MAC_ADDR_SIZE);
|
||||
|
||||
ret = dp_peer_add_ast(soc,
|
||||
ta_peer,
|
||||
wds_src_mac,
|
||||
CDP_TXRX_AST_TYPE_WDS,
|
||||
flags);
|
||||
return;
|
||||
}
|
||||
|
||||
qdf_spin_lock_bh(&soc->ast_lock);
|
||||
ast = soc->ast_table[sa_idx];
|
||||
qdf_spin_unlock_bh(&soc->ast_lock);
|
||||
|
||||
if (!ast) {
|
||||
/*
|
||||
* In HKv1, it is possible that HW retains the AST entry in
|
||||
* GSE cache on 1 radio , even after the AST entry is deleted
|
||||
* (on another radio).
|
||||
*
|
||||
* Due to this, host might still get sa_is_valid indications
|
||||
* for frames with SA not really present in AST table.
|
||||
*
|
||||
* So we go ahead and send an add_ast command to FW in such
|
||||
* cases where sa is reported still as valid, so that FW will
|
||||
* invalidate this GSE cache entry and new AST entry gets
|
||||
* cached.
|
||||
*/
|
||||
if (!soc->ast_override_support) {
|
||||
qdf_mem_copy(wds_src_mac,
|
||||
(qdf_nbuf_data(nbuf) + QDF_MAC_ADDR_SIZE),
|
||||
QDF_MAC_ADDR_SIZE);
|
||||
|
||||
ret = dp_peer_add_ast(soc,
|
||||
ta_peer,
|
||||
wds_src_mac,
|
||||
CDP_TXRX_AST_TYPE_WDS,
|
||||
flags);
|
||||
return;
|
||||
} else {
|
||||
/* In HKv2 smart monitor case, when NAC client is
|
||||
* added first and this client roams within BSS to
|
||||
* connect to RE, since we have an AST entry for
|
||||
* NAC we get sa_is_valid bit set. So we check if
|
||||
* smart monitor is enabled and send add_ast command
|
||||
* to FW.
|
||||
*/
|
||||
if (pdev->neighbour_peers_added) {
|
||||
qdf_mem_copy(wds_src_mac,
|
||||
(qdf_nbuf_data(nbuf) +
|
||||
QDF_MAC_ADDR_SIZE),
|
||||
QDF_MAC_ADDR_SIZE);
|
||||
|
||||
qdf_spin_lock_bh(&pdev->neighbour_peer_mutex);
|
||||
TAILQ_FOREACH(neighbour_peer,
|
||||
&pdev->neighbour_peers_list,
|
||||
neighbour_peer_list_elem) {
|
||||
if (!qdf_mem_cmp(&neighbour_peer->neighbour_peers_macaddr,
|
||||
wds_src_mac,
|
||||
QDF_MAC_ADDR_SIZE)) {
|
||||
ret = dp_peer_add_ast(soc,
|
||||
ta_peer,
|
||||
wds_src_mac,
|
||||
CDP_TXRX_AST_TYPE_WDS,
|
||||
flags);
|
||||
QDF_TRACE(QDF_MODULE_ID_DP,
|
||||
QDF_TRACE_LEVEL_INFO,
|
||||
"sa valid and nac roamed to wds");
|
||||
break;
|
||||
}
|
||||
}
|
||||
qdf_spin_unlock_bh(&pdev->neighbour_peer_mutex);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((ast->type == CDP_TXRX_AST_TYPE_WDS_HM) ||
|
||||
(ast->type == CDP_TXRX_AST_TYPE_WDS_HM_SEC))
|
||||
return;
|
||||
|
||||
/*
|
||||
* Ensure we are updating the right AST entry by
|
||||
* validating ast_idx.
|
||||
* There is a possibility we might arrive here without
|
||||
* AST MAP event , so this check is mandatory
|
||||
*/
|
||||
if (ast->is_mapped && (ast->ast_idx == sa_idx))
|
||||
ast->is_active = TRUE;
|
||||
|
||||
if (sa_sw_peer_id != ta_peer->peer_ids[0]) {
|
||||
sa_peer = ast->peer;
|
||||
|
||||
if ((ast->type != CDP_TXRX_AST_TYPE_STATIC) &&
|
||||
(ast->type != CDP_TXRX_AST_TYPE_SELF) &&
|
||||
(ast->type != CDP_TXRX_AST_TYPE_STA_BSS)) {
|
||||
if (ast->pdev_id != ta_peer->vdev->pdev->pdev_id) {
|
||||
/* This case is when a STA roams from one
|
||||
* repeater to another repeater, but these
|
||||
* repeaters are connected to root AP on
|
||||
* different radios.
|
||||
* Ex: rptr1 connected to ROOT AP over 5G
|
||||
* and rptr2 connected to ROOT AP over 2G
|
||||
* radio
|
||||
*/
|
||||
qdf_spin_lock_bh(&soc->ast_lock);
|
||||
dp_peer_del_ast(soc, ast);
|
||||
qdf_spin_unlock_bh(&soc->ast_lock);
|
||||
} else {
|
||||
/* this case is when a STA roams from one
|
||||
* reapter to another repeater, but inside
|
||||
* same radio.
|
||||
*/
|
||||
qdf_spin_lock_bh(&soc->ast_lock);
|
||||
dp_peer_update_ast(soc, ta_peer, ast, flags);
|
||||
qdf_spin_unlock_bh(&soc->ast_lock);
|
||||
return;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Do not kickout STA if it belongs to a different radio.
|
||||
* For DBDC repeater, it is possible to arrive here
|
||||
* for multicast loopback frames originated from connected
|
||||
* clients and looped back (intrabss) by Root AP
|
||||
*/
|
||||
if (ast->pdev_id != ta_peer->vdev->pdev->pdev_id) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Kickout, when direct associated peer(SA) roams
|
||||
* to another AP and reachable via TA peer
|
||||
*/
|
||||
if ((sa_peer->vdev->opmode == wlan_op_mode_ap) &&
|
||||
!sa_peer->delete_in_progress) {
|
||||
sa_peer->delete_in_progress = true;
|
||||
if (soc->cdp_soc.ol_ops->peer_sta_kickout) {
|
||||
soc->cdp_soc.ol_ops->peer_sta_kickout(
|
||||
sa_peer->vdev->pdev->ctrl_pdev,
|
||||
wds_src_mac);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* dp_rx_wds_srcport_learn() - Add or update the STA PEER which
|
||||
* is behind the WDS repeater.
|
||||
*
|
||||
* @soc: core txrx main context
|
||||
* @rx_tlv_hdr: base address of RX TLV header
|
||||
* @ta_peer: WDS repeater peer
|
||||
* @nbuf: rx pkt
|
||||
*
|
||||
* Return: void:
|
||||
*/
|
||||
static inline void
|
||||
dp_rx_wds_srcport_learn(struct dp_soc *soc,
|
||||
uint8_t *rx_tlv_hdr,
|
||||
struct dp_peer *ta_peer,
|
||||
qdf_nbuf_t nbuf)
|
||||
{
|
||||
uint16_t sa_sw_peer_id = hal_rx_msdu_end_sa_sw_peer_id_get(rx_tlv_hdr);
|
||||
uint8_t sa_is_valid = hal_rx_msdu_end_sa_is_valid_get(rx_tlv_hdr);
|
||||
uint16_t sa_idx;
|
||||
uint8_t is_chfrag_start = 0;
|
||||
uint8_t is_ad4_valid = 0;
|
||||
|
||||
if (qdf_unlikely(!ta_peer))
|
||||
return;
|
||||
|
||||
is_chfrag_start = qdf_nbuf_is_rx_chfrag_start(nbuf);
|
||||
if (is_chfrag_start)
|
||||
is_ad4_valid = hal_rx_get_mpdu_mac_ad4_valid(rx_tlv_hdr);
|
||||
|
||||
/*
|
||||
* Get the AST entry from HW SA index and mark it as active
|
||||
*/
|
||||
sa_idx = hal_rx_msdu_end_sa_idx_get(rx_tlv_hdr);
|
||||
|
||||
dp_rx_wds_add_or_update_ast(soc, ta_peer, nbuf, is_ad4_valid,
|
||||
sa_is_valid, is_chfrag_start,
|
||||
sa_idx, sa_sw_peer_id);
|
||||
|
||||
return;
|
||||
}
|
||||
#else
|
||||
static inline void
|
||||
dp_rx_wds_srcport_learn(struct dp_soc *soc,
|
||||
uint8_t *rx_tlv_hdr,
|
||||
struct dp_peer *ta_peer,
|
||||
qdf_nbuf_t nbuf)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
uint8_t dp_rx_process_invalid_peer(struct dp_soc *soc, qdf_nbuf_t nbuf);
|
||||
void dp_rx_process_invalid_peer_wrapper(struct dp_soc *soc,
|
||||
qdf_nbuf_t mpdu, bool mpdu_done);
|
||||
@@ -994,41 +746,19 @@ static inline QDF_STATUS dp_rx_defrag_concat(qdf_nbuf_t dst, qdf_nbuf_t src)
|
||||
return QDF_STATUS_E_DEFRAG_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* dp_rx_ast_set_active() - set the active flag of the astentry
|
||||
* corresponding to a hw index.
|
||||
* @soc: core txrx main context
|
||||
* @sa_idx: hw idx
|
||||
* @is_active: active flag
|
||||
*
|
||||
*/
|
||||
#ifdef FEATURE_WDS
|
||||
static inline QDF_STATUS dp_rx_ast_set_active(struct dp_soc *soc, uint16_t sa_idx, bool is_active)
|
||||
{
|
||||
struct dp_ast_entry *ast;
|
||||
qdf_spin_lock_bh(&soc->ast_lock);
|
||||
ast = soc->ast_table[sa_idx];
|
||||
|
||||
/*
|
||||
* Ensure we are updating the right AST entry by
|
||||
* validating ast_idx.
|
||||
* There is a possibility we might arrive here without
|
||||
* AST MAP event , so this check is mandatory
|
||||
*/
|
||||
if (ast && ast->is_mapped && (ast->ast_idx == sa_idx)) {
|
||||
ast->is_active = is_active;
|
||||
qdf_spin_unlock_bh(&soc->ast_lock);
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
qdf_spin_unlock_bh(&soc->ast_lock);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
#else
|
||||
#ifndef FEATURE_WDS
|
||||
static inline QDF_STATUS dp_rx_ast_set_active(struct dp_soc *soc, uint16_t sa_idx, bool is_active)
|
||||
{
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static inline void
|
||||
dp_rx_wds_srcport_learn(struct dp_soc *soc,
|
||||
uint8_t *rx_tlv_hdr,
|
||||
struct dp_peer *ta_peer,
|
||||
qdf_nbuf_t nbuf)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
Fai riferimento in un nuovo problema
Block a user