mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-06-23 08:34:20 +00:00
rtlwifi: Remove list-handling macros
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
6d3d853360
commit
209e50ad60
14 changed files with 225 additions and 293 deletions
|
@ -187,17 +187,14 @@ void rtw_mfree_all_stainfo(struct sta_priv *pstapriv)
|
|||
spin_lock_bh(&pstapriv->sta_hash_lock);
|
||||
|
||||
phead = get_list_head(&pstapriv->free_sta_queue);
|
||||
plist = get_next(phead);
|
||||
plist = phead->next;
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == false) {
|
||||
while (phead != plist) {
|
||||
psta = container_of(plist, struct sta_info , list);
|
||||
plist = get_next(plist);
|
||||
|
||||
rtw_mfree_stainfo(psta);
|
||||
plist = plist->next;
|
||||
}
|
||||
|
||||
spin_unlock_bh(&pstapriv->sta_hash_lock);
|
||||
|
||||
}
|
||||
|
||||
static void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv)
|
||||
|
@ -233,12 +230,12 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
|
|||
spin_lock_bh(&pstapriv->sta_hash_lock);
|
||||
for (index = 0; index < NUM_STA; index++) {
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
plist = phead->next;
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == false) {
|
||||
while (phead != plist) {
|
||||
int i;
|
||||
psta = container_of(plist, struct sta_info , hash_list);
|
||||
plist = get_next(plist);
|
||||
plist = plist->next;
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
|
@ -272,12 +269,12 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
|||
|
||||
spin_lock_bh(&pfree_sta_queue->lock);
|
||||
|
||||
if (_rtw_queue_empty(pfree_sta_queue) == true) {
|
||||
if (list_empty(&pfree_sta_queue->queue)) {
|
||||
spin_unlock_bh(&pfree_sta_queue->lock);
|
||||
psta = NULL;
|
||||
} else {
|
||||
psta = container_of(get_next(&pfree_sta_queue->queue), struct sta_info, list);
|
||||
rtw_list_delete(&(psta->list));
|
||||
psta = container_of((&pfree_sta_queue->queue)->next, struct sta_info, list);
|
||||
list_del_init(&(psta->list));
|
||||
spin_unlock_bh(&pfree_sta_queue->lock);
|
||||
_rtw_init_stainfo(psta);
|
||||
memcpy(psta->hwaddr, hwaddr, ETH_ALEN);
|
||||
|
@ -366,23 +363,23 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta)
|
|||
|
||||
rtw_free_xmitframe_queue(pxmitpriv, &pstaxmitpriv->vo_q.sta_pending);
|
||||
|
||||
rtw_list_delete(&(pstaxmitpriv->vo_q.tx_pending));
|
||||
list_del_init(&(pstaxmitpriv->vo_q.tx_pending));
|
||||
|
||||
rtw_free_xmitframe_queue(pxmitpriv, &pstaxmitpriv->vi_q.sta_pending);
|
||||
|
||||
rtw_list_delete(&(pstaxmitpriv->vi_q.tx_pending));
|
||||
list_del_init(&(pstaxmitpriv->vi_q.tx_pending));
|
||||
|
||||
rtw_free_xmitframe_queue(pxmitpriv, &pstaxmitpriv->bk_q.sta_pending);
|
||||
|
||||
rtw_list_delete(&(pstaxmitpriv->bk_q.tx_pending));
|
||||
list_del_init(&(pstaxmitpriv->bk_q.tx_pending));
|
||||
|
||||
rtw_free_xmitframe_queue(pxmitpriv, &pstaxmitpriv->be_q.sta_pending);
|
||||
|
||||
rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending));
|
||||
list_del_init(&(pstaxmitpriv->be_q.tx_pending));
|
||||
|
||||
spin_unlock_bh(&pxmitpriv->lock);
|
||||
|
||||
rtw_list_delete(&psta->hash_list);
|
||||
list_del_init(&psta->hash_list);
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_, _drv_err_, ("\n free number_%d stainfo with hwaddr=0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x\n", pstapriv->asoc_sta_count , psta->hwaddr[0], psta->hwaddr[1], psta->hwaddr[2], psta->hwaddr[3], psta->hwaddr[4], psta->hwaddr[5]));
|
||||
pstapriv->asoc_sta_count--;
|
||||
|
||||
|
@ -408,14 +405,14 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta)
|
|||
spin_lock_bh(&ppending_recvframe_queue->lock);
|
||||
|
||||
phead = get_list_head(ppending_recvframe_queue);
|
||||
plist = get_next(phead);
|
||||
plist = phead->next;
|
||||
|
||||
while (!rtw_is_list_empty(phead)) {
|
||||
while (!list_empty(phead)) {
|
||||
prframe = container_of(plist, struct recv_frame, list);
|
||||
|
||||
plist = get_next(plist);
|
||||
plist = plist->next;
|
||||
|
||||
rtw_list_delete(&(prframe->list));
|
||||
list_del_init(&(prframe->list));
|
||||
|
||||
rtw_free_recvframe(prframe, pfree_recv_queue);
|
||||
}
|
||||
|
@ -429,8 +426,8 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta)
|
|||
#ifdef CONFIG_88EU_AP_MODE
|
||||
|
||||
spin_lock_bh(&pstapriv->auth_list_lock);
|
||||
if (!rtw_is_list_empty(&psta->auth_list)) {
|
||||
rtw_list_delete(&psta->auth_list);
|
||||
if (!list_empty(&psta->auth_list)) {
|
||||
list_del_init(&psta->auth_list);
|
||||
pstapriv->auth_list_cnt--;
|
||||
}
|
||||
spin_unlock_bh(&pstapriv->auth_list_lock);
|
||||
|
@ -484,12 +481,12 @@ void rtw_free_all_stainfo(struct adapter *padapter)
|
|||
|
||||
for (index = 0; index < NUM_STA; index++) {
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
plist = phead->next;
|
||||
|
||||
while ((!rtw_end_of_queue_search(phead, plist))) {
|
||||
while (phead != plist) {
|
||||
psta = container_of(plist, struct sta_info , hash_list);
|
||||
|
||||
plist = get_next(plist);
|
||||
plist = plist->next;
|
||||
|
||||
if (pbcmc_stainfo != psta)
|
||||
rtw_free_stainfo(padapter , psta);
|
||||
|
@ -520,9 +517,9 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
|||
spin_lock_bh(&pstapriv->sta_hash_lock);
|
||||
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
plist = phead->next;
|
||||
|
||||
while ((!rtw_end_of_queue_search(phead, plist))) {
|
||||
while (phead != plist) {
|
||||
psta = container_of(plist, struct sta_info, hash_list);
|
||||
|
||||
if ((!memcmp(psta->hwaddr, addr, ETH_ALEN))) {
|
||||
|
@ -530,7 +527,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
|||
break;
|
||||
}
|
||||
psta = NULL;
|
||||
plist = get_next(plist);
|
||||
plist = plist->next;
|
||||
}
|
||||
|
||||
spin_unlock_bh(&pstapriv->sta_hash_lock);
|
||||
|
@ -585,10 +582,10 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
|
|||
|
||||
spin_lock_bh(&pacl_node_q->lock);
|
||||
phead = get_list_head(pacl_node_q);
|
||||
plist = get_next(phead);
|
||||
while ((!rtw_end_of_queue_search(phead, plist))) {
|
||||
plist = phead->next;
|
||||
while (phead != plist) {
|
||||
paclnode = container_of(plist, struct rtw_wlan_acl_node, list);
|
||||
plist = get_next(plist);
|
||||
plist = plist->next;
|
||||
|
||||
if (!memcmp(paclnode->addr, mac_addr, ETH_ALEN)) {
|
||||
if (paclnode->valid) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue