qcacmn: Cleanup duplicate STA inactivity detection
Move the station inactivity detection code from datapath to SON layer. Change-Id: Ia071a19ce2fd36b46a8b0bf4362077609e8b98f9 CRs-Fixed: 2326638
This commit is contained in:

committed by
nshrivas

parent
3871ce8c90
commit
9e0e1667d4
@@ -346,128 +346,6 @@ cdp_peer_authorize(ol_txrx_soc_handle soc,
|
|||||||
(peer, authorize);
|
(peer, authorize);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool
|
|
||||||
cdp_set_inact_params(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
|
|
||||||
u_int16_t inact_check_interval,
|
|
||||||
u_int16_t inact_normal,
|
|
||||||
u_int16_t inact_overload)
|
|
||||||
{
|
|
||||||
if (!soc || !pdev || !soc->ops) {
|
|
||||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
|
||||||
"%s: Invalid Instance:", __func__);
|
|
||||||
QDF_BUG(0);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!soc->ops->ctrl_ops ||
|
|
||||||
!soc->ops->ctrl_ops->txrx_set_inact_params)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return soc->ops->ctrl_ops->txrx_set_inact_params
|
|
||||||
(pdev, inact_check_interval, inact_normal,
|
|
||||||
inact_overload);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline bool
|
|
||||||
cdp_start_inact_timer(ol_txrx_soc_handle soc,
|
|
||||||
struct cdp_pdev *pdev,
|
|
||||||
bool enable)
|
|
||||||
{
|
|
||||||
if (!soc || !pdev || !soc->ops) {
|
|
||||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
|
||||||
"%s: Invalid Instance:", __func__);
|
|
||||||
QDF_BUG(0);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!soc->ops->ctrl_ops ||
|
|
||||||
!soc->ops->ctrl_ops->txrx_start_inact_timer)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return soc->ops->ctrl_ops->txrx_start_inact_timer
|
|
||||||
(pdev, enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Set the overload status of the radio
|
|
||||||
* @details
|
|
||||||
* Set the overload status of the radio, updating the inactivity
|
|
||||||
* threshold and inactivity count for each node.
|
|
||||||
*
|
|
||||||
* @param pdev - the data physical device object
|
|
||||||
* @param overload - whether the radio is overloaded or not
|
|
||||||
*/
|
|
||||||
static inline void
|
|
||||||
cdp_set_overload(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
|
|
||||||
bool overload)
|
|
||||||
{
|
|
||||||
if (!soc || !pdev || !soc->ops) {
|
|
||||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
|
||||||
"%s: Invalid Instance:", __func__);
|
|
||||||
QDF_BUG(0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!soc->ops->ctrl_ops ||
|
|
||||||
!soc->ops->ctrl_ops->txrx_set_overload)
|
|
||||||
return;
|
|
||||||
|
|
||||||
soc->ops->ctrl_ops->txrx_set_overload(pdev, overload);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Check the inactivity status of the peer/node
|
|
||||||
*
|
|
||||||
* @param peer - pointer to the node's object
|
|
||||||
* @return true if the node is inactive; otherwise return false
|
|
||||||
*/
|
|
||||||
static inline bool
|
|
||||||
cdp_peer_is_inact(ol_txrx_soc_handle soc, void *peer)
|
|
||||||
{
|
|
||||||
if (!soc || !peer || !soc->ops) {
|
|
||||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
|
||||||
"%s: Invalid Instance:", __func__);
|
|
||||||
QDF_BUG(0);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!soc->ops->ctrl_ops ||
|
|
||||||
!soc->ops->ctrl_ops->txrx_peer_is_inact)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return soc->ops->ctrl_ops->txrx_peer_is_inact(peer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Mark inactivity status of the peer/node
|
|
||||||
* @details
|
|
||||||
* If it becomes active, reset inactivity count to reload value;
|
|
||||||
* if the inactivity status changed, notify umac band steering.
|
|
||||||
*
|
|
||||||
* @param peer - pointer to the node's object
|
|
||||||
* @param inactive - whether the node is inactive or not
|
|
||||||
*/
|
|
||||||
static inline void
|
|
||||||
cdp_mark_peer_inact(ol_txrx_soc_handle soc,
|
|
||||||
void *peer,
|
|
||||||
bool inactive)
|
|
||||||
{
|
|
||||||
if (!soc || !soc->ops) {
|
|
||||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
|
||||||
"%s: Invalid Instance:", __func__);
|
|
||||||
QDF_BUG(0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!soc->ops->ctrl_ops ||
|
|
||||||
!soc->ops->ctrl_ops->txrx_mark_peer_inact)
|
|
||||||
return;
|
|
||||||
|
|
||||||
soc->ops->ctrl_ops->txrx_mark_peer_inact
|
|
||||||
(peer, inactive);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Should be ol_txrx_ctrl_api.h */
|
/* Should be ol_txrx_ctrl_api.h */
|
||||||
static inline void cdp_set_mesh_mode
|
static inline void cdp_set_mesh_mode
|
||||||
(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, u_int32_t val)
|
(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, u_int32_t val)
|
||||||
|
@@ -482,52 +482,6 @@ struct cdp_ctrl_ops {
|
|||||||
(*txrx_peer_authorize)(struct cdp_peer *peer,
|
(*txrx_peer_authorize)(struct cdp_peer *peer,
|
||||||
u_int32_t authorize);
|
u_int32_t authorize);
|
||||||
|
|
||||||
bool
|
|
||||||
(*txrx_set_inact_params)(struct cdp_pdev *pdev,
|
|
||||||
u_int16_t inact_check_interval,
|
|
||||||
u_int16_t inact_normal,
|
|
||||||
u_int16_t inact_overload);
|
|
||||||
bool
|
|
||||||
(*txrx_start_inact_timer)(
|
|
||||||
struct cdp_pdev *pdev,
|
|
||||||
bool enable);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Set the overload status of the radio
|
|
||||||
* @details
|
|
||||||
* Set the overload status of the radio, updating the inactivity
|
|
||||||
* threshold and inactivity count for each node.
|
|
||||||
*
|
|
||||||
* @param pdev - the data physical device object
|
|
||||||
* @param overload - whether the radio is overloaded or not
|
|
||||||
*/
|
|
||||||
void (*txrx_set_overload)(
|
|
||||||
struct cdp_pdev *pdev,
|
|
||||||
bool overload);
|
|
||||||
/**
|
|
||||||
* @brief Check the inactivity status of the peer/node
|
|
||||||
*
|
|
||||||
* @param peer - pointer to the node's object
|
|
||||||
* @return true if the node is inactive; otherwise return false
|
|
||||||
*/
|
|
||||||
bool
|
|
||||||
(*txrx_peer_is_inact)(void *peer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Mark inactivity status of the peer/node
|
|
||||||
* @details
|
|
||||||
* If it becomes active, reset inactivity count to reload value;
|
|
||||||
* if the inactivity status changed, notify umac band steering.
|
|
||||||
*
|
|
||||||
* @param peer - pointer to the node's object
|
|
||||||
* @param inactive - whether the node is inactive or not
|
|
||||||
*/
|
|
||||||
void (*txrx_mark_peer_inact)(
|
|
||||||
void *peer,
|
|
||||||
bool inactive);
|
|
||||||
|
|
||||||
|
|
||||||
/* Should be ol_txrx_ctrl_api.h */
|
/* Should be ol_txrx_ctrl_api.h */
|
||||||
void (*txrx_set_mesh_mode)(struct cdp_vdev *vdev, u_int32_t val);
|
void (*txrx_set_mesh_mode)(struct cdp_vdev *vdev, u_int32_t val);
|
||||||
|
|
||||||
|
@@ -701,15 +701,6 @@ void dp_set_pn_check_wifi3(struct cdp_vdev *vdev_handle,
|
|||||||
uint32_t *rx_pn);
|
uint32_t *rx_pn);
|
||||||
|
|
||||||
void *dp_get_pdev_for_mac_id(struct dp_soc *soc, uint32_t mac_id);
|
void *dp_get_pdev_for_mac_id(struct dp_soc *soc, uint32_t mac_id);
|
||||||
void dp_mark_peer_inact(void *peer_handle, bool inactive);
|
|
||||||
bool dp_set_inact_params(struct cdp_pdev *pdev_handle,
|
|
||||||
u_int16_t inact_check_interval,
|
|
||||||
u_int16_t inact_normal, u_int16_t inact_overload);
|
|
||||||
bool dp_start_inact_timer(struct cdp_pdev *pdev_handle, bool enable);
|
|
||||||
void dp_set_overload(struct cdp_pdev *pdev_handle, bool overload);
|
|
||||||
bool dp_peer_is_inact(void *peer_handle);
|
|
||||||
void dp_init_inact_timer(struct dp_soc *soc);
|
|
||||||
void dp_free_inact_timer(struct dp_soc *soc);
|
|
||||||
void dp_set_michael_key(struct cdp_peer *peer_handle,
|
void dp_set_michael_key(struct cdp_peer *peer_handle,
|
||||||
bool is_unicast, uint32_t *key);
|
bool is_unicast, uint32_t *key);
|
||||||
|
|
||||||
|
@@ -2678,127 +2678,6 @@ dp_dscp_tid_map_setup(struct dp_pdev *pdev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QCA_SUPPORT_SON
|
|
||||||
/**
|
|
||||||
* dp_mark_peer_inact(): Update peer inactivity status
|
|
||||||
* @peer_handle - datapath peer handle
|
|
||||||
*
|
|
||||||
* Return: void
|
|
||||||
*/
|
|
||||||
void dp_mark_peer_inact(void *peer_handle, bool inactive)
|
|
||||||
{
|
|
||||||
struct dp_peer *peer = (struct dp_peer *)peer_handle;
|
|
||||||
struct dp_pdev *pdev;
|
|
||||||
struct dp_soc *soc;
|
|
||||||
bool inactive_old;
|
|
||||||
|
|
||||||
if (!peer)
|
|
||||||
return;
|
|
||||||
|
|
||||||
pdev = peer->vdev->pdev;
|
|
||||||
soc = pdev->soc;
|
|
||||||
|
|
||||||
inactive_old = peer->peer_bs_inact_flag == 1;
|
|
||||||
if (!inactive)
|
|
||||||
peer->peer_bs_inact = soc->pdev_bs_inact_reload;
|
|
||||||
peer->peer_bs_inact_flag = inactive ? 1 : 0;
|
|
||||||
|
|
||||||
if (inactive_old != inactive) {
|
|
||||||
/**
|
|
||||||
* Note: a node lookup can happen in RX datapath context
|
|
||||||
* when a node changes from inactive to active (at most once
|
|
||||||
* per inactivity timeout threshold)
|
|
||||||
*/
|
|
||||||
if (soc->cdp_soc.ol_ops->record_act_change) {
|
|
||||||
soc->cdp_soc.ol_ops->record_act_change(
|
|
||||||
(void *)pdev->ctrl_pdev,
|
|
||||||
peer->mac_addr.raw, !inactive);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dp_txrx_peer_find_inact_timeout_handler(): Inactivity timeout function
|
|
||||||
*
|
|
||||||
* Periodically checks the inactivity status
|
|
||||||
*/
|
|
||||||
static os_timer_func(dp_txrx_peer_find_inact_timeout_handler)
|
|
||||||
{
|
|
||||||
struct dp_pdev *pdev;
|
|
||||||
struct dp_vdev *vdev;
|
|
||||||
struct dp_peer *peer;
|
|
||||||
struct dp_soc *soc;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
OS_GET_TIMER_ARG(soc, struct dp_soc *);
|
|
||||||
|
|
||||||
qdf_spin_lock(&soc->peer_ref_mutex);
|
|
||||||
|
|
||||||
for (i = 0; i < soc->pdev_count; i++) {
|
|
||||||
pdev = soc->pdev_list[i];
|
|
||||||
if (!pdev)
|
|
||||||
continue;
|
|
||||||
qdf_spin_lock_bh(&pdev->vdev_list_lock);
|
|
||||||
TAILQ_FOREACH(vdev, &pdev->vdev_list, vdev_list_elem) {
|
|
||||||
if (vdev->opmode != wlan_op_mode_ap)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
TAILQ_FOREACH(peer, &vdev->peer_list, peer_list_elem) {
|
|
||||||
if (!peer->authorize) {
|
|
||||||
/**
|
|
||||||
* Inactivity check only interested in
|
|
||||||
* connected node
|
|
||||||
*/
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (peer->peer_bs_inact > soc->pdev_bs_inact_reload) {
|
|
||||||
/**
|
|
||||||
* This check ensures we do not wait extra long
|
|
||||||
* due to the potential race condition
|
|
||||||
*/
|
|
||||||
peer->peer_bs_inact = soc->pdev_bs_inact_reload;
|
|
||||||
}
|
|
||||||
if (peer->peer_bs_inact > 0) {
|
|
||||||
/* Do not let it wrap around */
|
|
||||||
peer->peer_bs_inact--;
|
|
||||||
}
|
|
||||||
if (peer->peer_bs_inact == 0)
|
|
||||||
dp_mark_peer_inact(peer, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
qdf_spin_unlock_bh(&pdev->vdev_list_lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
qdf_spin_unlock(&soc->peer_ref_mutex);
|
|
||||||
qdf_timer_mod(&soc->pdev_bs_inact_timer,
|
|
||||||
soc->pdev_bs_inact_interval * 1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dp_free_inact_timer(): free inact timer
|
|
||||||
* @timer - inact timer handle
|
|
||||||
*
|
|
||||||
* Return: bool
|
|
||||||
*/
|
|
||||||
void dp_free_inact_timer(struct dp_soc *soc)
|
|
||||||
{
|
|
||||||
qdf_timer_free(&soc->pdev_bs_inact_timer);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
|
|
||||||
void dp_mark_peer_inact(void *peer, bool inactive)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void dp_free_inact_timer(struct dp_soc *soc)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef IPA_OFFLOAD
|
#ifdef IPA_OFFLOAD
|
||||||
/**
|
/**
|
||||||
* dp_setup_ipa_rx_refill_buf_ring - Setup second Rx refill buffer ring
|
* dp_setup_ipa_rx_refill_buf_ring - Setup second Rx refill buffer ring
|
||||||
@@ -3363,8 +3242,6 @@ static void dp_soc_detach_wifi3(void *txrx_soc)
|
|||||||
/* Free pending htt stats messages */
|
/* Free pending htt stats messages */
|
||||||
qdf_nbuf_queue_free(&soc->htt_stats.msg);
|
qdf_nbuf_queue_free(&soc->htt_stats.msg);
|
||||||
|
|
||||||
dp_free_inact_timer(soc);
|
|
||||||
|
|
||||||
for (i = 0; i < MAX_PDEV_CNT; i++) {
|
for (i = 0; i < MAX_PDEV_CNT; i++) {
|
||||||
if (soc->pdev_list[i])
|
if (soc->pdev_list[i])
|
||||||
dp_pdev_detach_wifi3(
|
dp_pdev_detach_wifi3(
|
||||||
@@ -4295,21 +4172,6 @@ dp_get_pdev_reo_dest(struct cdp_pdev *pdev_handle)
|
|||||||
return cdp_host_reo_dest_ring_unknown;
|
return cdp_host_reo_dest_ring_unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QCA_SUPPORT_SON
|
|
||||||
static void dp_son_peer_authorize(struct dp_peer *peer)
|
|
||||||
{
|
|
||||||
struct dp_soc *soc;
|
|
||||||
soc = peer->vdev->pdev->soc;
|
|
||||||
peer->peer_bs_inact_flag = 0;
|
|
||||||
peer->peer_bs_inact = soc->pdev_bs_inact_reload;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
static void dp_son_peer_authorize(struct dp_peer *peer)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
/*
|
/*
|
||||||
* dp_set_filter_neighbour_peers() - set filter neighbour peers for smart mesh
|
* dp_set_filter_neighbour_peers() - set filter neighbour peers for smart mesh
|
||||||
* @pdev_handle: device object
|
* @pdev_handle: device object
|
||||||
@@ -4437,234 +4299,11 @@ static void dp_peer_authorize(struct cdp_peer *peer_handle, uint32_t authorize)
|
|||||||
if (peer != NULL) {
|
if (peer != NULL) {
|
||||||
soc = peer->vdev->pdev->soc;
|
soc = peer->vdev->pdev->soc;
|
||||||
qdf_spin_lock_bh(&soc->peer_ref_mutex);
|
qdf_spin_lock_bh(&soc->peer_ref_mutex);
|
||||||
dp_son_peer_authorize(peer);
|
|
||||||
peer->authorize = authorize ? 1 : 0;
|
peer->authorize = authorize ? 1 : 0;
|
||||||
qdf_spin_unlock_bh(&soc->peer_ref_mutex);
|
qdf_spin_unlock_bh(&soc->peer_ref_mutex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef QCA_SUPPORT_SON
|
|
||||||
/*
|
|
||||||
* dp_txrx_update_inact_threshold() - Update inact timer threshold
|
|
||||||
* @pdev_handle: Device handle
|
|
||||||
* @new_threshold : updated threshold value
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
dp_txrx_update_inact_threshold(struct cdp_pdev *pdev_handle,
|
|
||||||
u_int16_t new_threshold)
|
|
||||||
{
|
|
||||||
struct dp_vdev *vdev;
|
|
||||||
struct dp_peer *peer;
|
|
||||||
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
|
|
||||||
struct dp_soc *soc = pdev->soc;
|
|
||||||
u_int16_t old_threshold = soc->pdev_bs_inact_reload;
|
|
||||||
|
|
||||||
if (old_threshold == new_threshold)
|
|
||||||
return;
|
|
||||||
|
|
||||||
soc->pdev_bs_inact_reload = new_threshold;
|
|
||||||
|
|
||||||
qdf_spin_lock_bh(&soc->peer_ref_mutex);
|
|
||||||
qdf_spin_lock_bh(&pdev->vdev_list_lock);
|
|
||||||
TAILQ_FOREACH(vdev, &pdev->vdev_list, vdev_list_elem) {
|
|
||||||
if (vdev->opmode != wlan_op_mode_ap)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
TAILQ_FOREACH(peer, &vdev->peer_list, peer_list_elem) {
|
|
||||||
if (!peer->authorize)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (old_threshold - peer->peer_bs_inact >=
|
|
||||||
new_threshold) {
|
|
||||||
dp_mark_peer_inact((void *)peer, true);
|
|
||||||
peer->peer_bs_inact = 0;
|
|
||||||
} else {
|
|
||||||
peer->peer_bs_inact = new_threshold -
|
|
||||||
(old_threshold - peer->peer_bs_inact);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
qdf_spin_unlock_bh(&pdev->vdev_list_lock);
|
|
||||||
qdf_spin_unlock_bh(&soc->peer_ref_mutex);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dp_txrx_reset_inact_count(): Reset inact count
|
|
||||||
* @pdev_handle - device handle
|
|
||||||
*
|
|
||||||
* Return: void
|
|
||||||
*/
|
|
||||||
static void
|
|
||||||
dp_txrx_reset_inact_count(struct cdp_pdev *pdev_handle)
|
|
||||||
{
|
|
||||||
struct dp_vdev *vdev = NULL;
|
|
||||||
struct dp_peer *peer = NULL;
|
|
||||||
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
|
|
||||||
struct dp_soc *soc = pdev->soc;
|
|
||||||
|
|
||||||
qdf_spin_lock_bh(&soc->peer_ref_mutex);
|
|
||||||
qdf_spin_lock_bh(&pdev->vdev_list_lock);
|
|
||||||
TAILQ_FOREACH(vdev, &pdev->vdev_list, vdev_list_elem) {
|
|
||||||
if (vdev->opmode != wlan_op_mode_ap)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
TAILQ_FOREACH(peer, &vdev->peer_list, peer_list_elem) {
|
|
||||||
if (!peer->authorize)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
peer->peer_bs_inact = soc->pdev_bs_inact_reload;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
qdf_spin_unlock_bh(&pdev->vdev_list_lock);
|
|
||||||
qdf_spin_unlock_bh(&soc->peer_ref_mutex);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dp_set_inact_params(): set inactivity params
|
|
||||||
* @pdev_handle - device handle
|
|
||||||
* @inact_check_interval - inactivity interval
|
|
||||||
* @inact_normal - Inactivity normal
|
|
||||||
* @inact_overload - Inactivity overload
|
|
||||||
*
|
|
||||||
* Return: bool
|
|
||||||
*/
|
|
||||||
bool dp_set_inact_params(struct cdp_pdev *pdev_handle,
|
|
||||||
u_int16_t inact_check_interval,
|
|
||||||
u_int16_t inact_normal, u_int16_t inact_overload)
|
|
||||||
{
|
|
||||||
struct dp_soc *soc;
|
|
||||||
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
|
|
||||||
|
|
||||||
if (!pdev)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
soc = pdev->soc;
|
|
||||||
if (!soc)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
soc->pdev_bs_inact_interval = inact_check_interval;
|
|
||||||
soc->pdev_bs_inact_normal = inact_normal;
|
|
||||||
soc->pdev_bs_inact_overload = inact_overload;
|
|
||||||
|
|
||||||
dp_txrx_update_inact_threshold((struct cdp_pdev *)pdev,
|
|
||||||
soc->pdev_bs_inact_normal);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dp_start_inact_timer(): Inactivity timer start
|
|
||||||
* @pdev_handle - device handle
|
|
||||||
* @enable - Inactivity timer start/stop
|
|
||||||
*
|
|
||||||
* Return: bool
|
|
||||||
*/
|
|
||||||
bool dp_start_inact_timer(struct cdp_pdev *pdev_handle, bool enable)
|
|
||||||
{
|
|
||||||
struct dp_soc *soc;
|
|
||||||
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
|
|
||||||
|
|
||||||
if (!pdev)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
soc = pdev->soc;
|
|
||||||
if (!soc)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (enable) {
|
|
||||||
dp_txrx_reset_inact_count((struct cdp_pdev *)pdev);
|
|
||||||
qdf_timer_mod(&soc->pdev_bs_inact_timer,
|
|
||||||
soc->pdev_bs_inact_interval * 1000);
|
|
||||||
} else {
|
|
||||||
qdf_timer_stop(&soc->pdev_bs_inact_timer);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dp_set_overload(): Set inactivity overload
|
|
||||||
* @pdev_handle - device handle
|
|
||||||
* @overload - overload status
|
|
||||||
*
|
|
||||||
* Return: void
|
|
||||||
*/
|
|
||||||
void dp_set_overload(struct cdp_pdev *pdev_handle, bool overload)
|
|
||||||
{
|
|
||||||
struct dp_soc *soc;
|
|
||||||
struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
|
|
||||||
|
|
||||||
if (!pdev)
|
|
||||||
return;
|
|
||||||
|
|
||||||
soc = pdev->soc;
|
|
||||||
if (!soc)
|
|
||||||
return;
|
|
||||||
|
|
||||||
dp_txrx_update_inact_threshold((struct cdp_pdev *)pdev,
|
|
||||||
overload ? soc->pdev_bs_inact_overload :
|
|
||||||
soc->pdev_bs_inact_normal);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dp_peer_is_inact(): check whether peer is inactive
|
|
||||||
* @peer_handle - datapath peer handle
|
|
||||||
*
|
|
||||||
* Return: bool
|
|
||||||
*/
|
|
||||||
bool dp_peer_is_inact(void *peer_handle)
|
|
||||||
{
|
|
||||||
struct dp_peer *peer = (struct dp_peer *)peer_handle;
|
|
||||||
|
|
||||||
if (!peer)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return peer->peer_bs_inact_flag == 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dp_init_inact_timer: initialize the inact timer
|
|
||||||
* @soc - SOC handle
|
|
||||||
*
|
|
||||||
* Return: void
|
|
||||||
*/
|
|
||||||
void dp_init_inact_timer(struct dp_soc *soc)
|
|
||||||
{
|
|
||||||
qdf_timer_init(soc->osdev, &soc->pdev_bs_inact_timer,
|
|
||||||
dp_txrx_peer_find_inact_timeout_handler,
|
|
||||||
(void *)soc, QDF_TIMER_TYPE_WAKE_APPS);
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
bool dp_set_inact_params(struct cdp_pdev *pdev, u_int16_t inact_check_interval,
|
|
||||||
u_int16_t inact_normal, u_int16_t inact_overload)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool dp_start_inact_timer(struct cdp_pdev *pdev, bool enable)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void dp_set_overload(struct cdp_pdev *pdev, bool overload)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void dp_init_inact_timer(struct dp_soc *soc)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool dp_peer_is_inact(void *peer)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void dp_reset_and_release_peer_mem(struct dp_soc *soc,
|
static void dp_reset_and_release_peer_mem(struct dp_soc *soc,
|
||||||
struct dp_pdev *pdev,
|
struct dp_pdev *pdev,
|
||||||
struct dp_peer *peer,
|
struct dp_peer *peer,
|
||||||
@@ -8049,13 +7688,6 @@ static struct cdp_cmn_ops dp_ops_cmn = {
|
|||||||
|
|
||||||
static struct cdp_ctrl_ops dp_ops_ctrl = {
|
static struct cdp_ctrl_ops dp_ops_ctrl = {
|
||||||
.txrx_peer_authorize = dp_peer_authorize,
|
.txrx_peer_authorize = dp_peer_authorize,
|
||||||
#ifdef QCA_SUPPORT_SON
|
|
||||||
.txrx_set_inact_params = dp_set_inact_params,
|
|
||||||
.txrx_start_inact_timer = dp_start_inact_timer,
|
|
||||||
.txrx_set_overload = dp_set_overload,
|
|
||||||
.txrx_peer_is_inact = dp_peer_is_inact,
|
|
||||||
.txrx_mark_peer_inact = dp_mark_peer_inact,
|
|
||||||
#endif
|
|
||||||
.txrx_set_vdev_rx_decap_type = dp_set_vdev_rx_decap_type,
|
.txrx_set_vdev_rx_decap_type = dp_set_vdev_rx_decap_type,
|
||||||
.txrx_set_tx_encap_type = dp_set_vdev_tx_encap_type,
|
.txrx_set_tx_encap_type = dp_set_vdev_tx_encap_type,
|
||||||
#ifdef MESH_MODE_SUPPORT
|
#ifdef MESH_MODE_SUPPORT
|
||||||
@@ -8490,9 +8122,6 @@ void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle,
|
|||||||
/* initialize work queue for stats processing */
|
/* initialize work queue for stats processing */
|
||||||
qdf_create_work(0, &soc->htt_stats.work, htt_t2h_stats_handler, soc);
|
qdf_create_work(0, &soc->htt_stats.work, htt_t2h_stats_handler, soc);
|
||||||
|
|
||||||
/*Initialize inactivity timer for wifison */
|
|
||||||
dp_init_inact_timer(soc);
|
|
||||||
|
|
||||||
return (void *)soc;
|
return (void *)soc;
|
||||||
|
|
||||||
fail2:
|
fail2:
|
||||||
|
@@ -180,8 +180,6 @@ static void dp_rx_stats_update(struct dp_soc *soc, struct dp_peer *peer,
|
|||||||
|
|
||||||
pdev = peer->vdev->pdev;
|
pdev = peer->vdev->pdev;
|
||||||
|
|
||||||
dp_mark_peer_inact(peer, false);
|
|
||||||
|
|
||||||
if (soc->process_rx_status)
|
if (soc->process_rx_status)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@@ -907,24 +907,6 @@ struct dp_soc {
|
|||||||
qdf_list_t reo_desc_freelist;
|
qdf_list_t reo_desc_freelist;
|
||||||
qdf_spinlock_t reo_desc_freelist_lock;
|
qdf_spinlock_t reo_desc_freelist_lock;
|
||||||
|
|
||||||
#ifdef QCA_SUPPORT_SON
|
|
||||||
/* The timer to check station's inactivity status */
|
|
||||||
os_timer_t pdev_bs_inact_timer;
|
|
||||||
/* The current inactivity count reload value
|
|
||||||
based on overload condition */
|
|
||||||
u_int16_t pdev_bs_inact_reload;
|
|
||||||
|
|
||||||
/* The inactivity timer value when not overloaded */
|
|
||||||
u_int16_t pdev_bs_inact_normal;
|
|
||||||
|
|
||||||
/* The inactivity timer value when overloaded */
|
|
||||||
u_int16_t pdev_bs_inact_overload;
|
|
||||||
|
|
||||||
/* The inactivity timer check interval */
|
|
||||||
u_int16_t pdev_bs_inact_interval;
|
|
||||||
/* Inactivity timer */
|
|
||||||
#endif /* QCA_SUPPORT_SON */
|
|
||||||
|
|
||||||
/* htt stats */
|
/* htt stats */
|
||||||
struct htt_t2h_stats htt_stats;
|
struct htt_t2h_stats htt_stats;
|
||||||
|
|
||||||
|
@@ -25,23 +25,6 @@
|
|||||||
|
|
||||||
#if QCA_SUPPORT_SON
|
#if QCA_SUPPORT_SON
|
||||||
|
|
||||||
bool son_ol_is_peer_inact(struct wlan_objmgr_peer *peer)
|
|
||||||
{
|
|
||||||
struct wlan_objmgr_vdev *vdev;
|
|
||||||
struct wlan_objmgr_psoc *psoc;
|
|
||||||
|
|
||||||
vdev = wlan_peer_get_vdev(peer);
|
|
||||||
if (!vdev)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
psoc = wlan_vdev_get_psoc(vdev);
|
|
||||||
if (!psoc)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return cdp_peer_is_inact(wlan_psoc_get_dp_handle(psoc),
|
|
||||||
(void *)(wlan_peer_get_dp_handle(peer)));
|
|
||||||
}
|
|
||||||
|
|
||||||
u_int32_t son_ol_get_peer_rate(struct wlan_objmgr_peer *peer, u_int8_t type)
|
u_int32_t son_ol_get_peer_rate(struct wlan_objmgr_peer *peer, u_int8_t type)
|
||||||
{
|
{
|
||||||
return ol_if_peer_get_rate(peer, type);
|
return ol_if_peer_get_rate(peer, type);
|
||||||
@@ -50,42 +33,7 @@ u_int32_t son_ol_get_peer_rate(struct wlan_objmgr_peer *peer, u_int8_t type)
|
|||||||
|
|
||||||
bool son_ol_enable(struct wlan_objmgr_pdev *pdev, bool enable)
|
bool son_ol_enable(struct wlan_objmgr_pdev *pdev, bool enable)
|
||||||
{
|
{
|
||||||
struct wlan_objmgr_psoc *psoc;
|
return true;
|
||||||
|
|
||||||
psoc = wlan_pdev_get_psoc(pdev);
|
|
||||||
if (!psoc)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return cdp_start_inact_timer(wlan_psoc_get_dp_handle(psoc),
|
|
||||||
(void *)(wlan_pdev_get_dp_handle(pdev)),
|
|
||||||
enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Function pointer to set overload status */
|
|
||||||
void son_ol_set_overload(struct wlan_objmgr_pdev *pdev, bool overload)
|
|
||||||
{
|
|
||||||
struct wlan_objmgr_psoc *psoc;
|
|
||||||
|
|
||||||
psoc = wlan_pdev_get_psoc(pdev);
|
|
||||||
|
|
||||||
return cdp_set_overload(wlan_psoc_get_dp_handle(psoc),
|
|
||||||
(void *)(wlan_pdev_get_dp_handle(pdev)),
|
|
||||||
overload);
|
|
||||||
}
|
|
||||||
/* Function pointer to set band steering parameters */
|
|
||||||
bool son_ol_set_params(struct wlan_objmgr_pdev *pdev,
|
|
||||||
u_int32_t inactivity_check_period,
|
|
||||||
u_int32_t inactivity_threshold_normal,
|
|
||||||
u_int32_t inactivity_threshold_overload)
|
|
||||||
{
|
|
||||||
struct wlan_objmgr_psoc *psoc;
|
|
||||||
|
|
||||||
psoc = wlan_pdev_get_psoc(pdev);
|
|
||||||
return cdp_set_inact_params(wlan_psoc_get_dp_handle(psoc),
|
|
||||||
(void *)wlan_pdev_get_dp_handle(pdev),
|
|
||||||
inactivity_check_period,
|
|
||||||
inactivity_threshold_normal,
|
|
||||||
inactivity_threshold_overload);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int8_t son_ol_sanitize_util_invtl(struct wlan_objmgr_pdev *pdev,
|
int8_t son_ol_sanitize_util_invtl(struct wlan_objmgr_pdev *pdev,
|
||||||
@@ -142,8 +90,6 @@ void target_if_son_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
|
|||||||
{
|
{
|
||||||
/* wlan son related function handler */
|
/* wlan son related function handler */
|
||||||
tx_ops->son_tx_ops.son_enable = son_ol_enable;
|
tx_ops->son_tx_ops.son_enable = son_ol_enable;
|
||||||
tx_ops->son_tx_ops.set_overload = son_ol_set_overload;
|
|
||||||
tx_ops->son_tx_ops.set_params = son_ol_set_params;
|
|
||||||
tx_ops->son_tx_ops.lmac_create = son_ol_lmac_create;
|
tx_ops->son_tx_ops.lmac_create = son_ol_lmac_create;
|
||||||
tx_ops->son_tx_ops.lmac_destroy = son_ol_lmac_destroy;
|
tx_ops->son_tx_ops.lmac_destroy = son_ol_lmac_destroy;
|
||||||
tx_ops->son_tx_ops.son_send_null = son_ol_send_null;
|
tx_ops->son_tx_ops.son_send_null = son_ol_send_null;
|
||||||
@@ -151,7 +97,6 @@ void target_if_son_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
|
|||||||
tx_ops->son_tx_ops.son_rate_update = son_ol_rx_rate_update;
|
tx_ops->son_tx_ops.son_rate_update = son_ol_rx_rate_update;
|
||||||
tx_ops->son_tx_ops.son_sanity_util_intvl = son_ol_sanitize_util_invtl;
|
tx_ops->son_tx_ops.son_sanity_util_intvl = son_ol_sanitize_util_invtl;
|
||||||
tx_ops->son_tx_ops.get_peer_rate = son_ol_get_peer_rate;
|
tx_ops->son_tx_ops.get_peer_rate = son_ol_get_peer_rate;
|
||||||
tx_ops->son_tx_ops.son_node_isinact = son_ol_is_peer_inact;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@@ -179,27 +124,6 @@ bool son_ol_enable(struct wlan_objmgr_pdev *pdev, bool enable)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Function pointer to set overload status */
|
|
||||||
|
|
||||||
void son_ol_set_overload(struct wlan_objmgr_pdev *pdev, bool overload)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Function pointer to set band steering parameters */
|
|
||||||
|
|
||||||
bool son_ol_set_params(struct wlan_objmgr_pdev *dev,
|
|
||||||
u_int32_t inactivity_check_period,
|
|
||||||
u_int32_t inactivity_threshold_normal,
|
|
||||||
u_int32_t inactivity_threshold_overload)
|
|
||||||
{
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QDF_STATUS son_ol_send_null(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS son_ol_send_null(struct wlan_objmgr_pdev *pdev,
|
||||||
u_int8_t *macaddr,
|
u_int8_t *macaddr,
|
||||||
struct wlan_objmgr_vdev *vdev)
|
struct wlan_objmgr_vdev *vdev)
|
||||||
@@ -239,8 +163,4 @@ void son_ol_rx_rate_update(struct wlan_objmgr_pdev *pdev, u_int8_t *macaddres,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool son_ol_is_peer_inact(struct wlan_objmgr_peer *peer)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user