Commit 849fb0a8 authored by James A Shackleford's avatar James A Shackleford Committed by Greg Kroah-Hartman

staging: rtl8712: remove wrapper function get_next

get_next is just an inline wrapper around return list->next.  This
patch removes the wrapper and directly uses list->next where
applicable.
Signed-off-by: default avatarJames A Shackleford <shack@linux.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 29197b7c
...@@ -58,11 +58,6 @@ struct __queue { ...@@ -58,11 +58,6 @@ struct __queue {
spin_lock_init(&((pqueue)->lock)); \ spin_lock_init(&((pqueue)->lock)); \
} while (0) } while (0)
static inline struct list_head *get_next(struct list_head *list)
{
return list->next;
}
static inline struct list_head *get_list_head(struct __queue *queue) static inline struct list_head *get_list_head(struct __queue *queue)
{ {
return &(queue->queue); return &(queue->queue);
......
...@@ -209,7 +209,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter, ...@@ -209,7 +209,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter,
pfree_recv_queue = &adapter->recvpriv.free_recv_queue; pfree_recv_queue = &adapter->recvpriv.free_recv_queue;
phead = get_list_head(defrag_q); phead = get_list_head(defrag_q);
plist = get_next(phead); plist = phead->next;
prframe = LIST_CONTAINOR(plist, union recv_frame, u); prframe = LIST_CONTAINOR(plist, union recv_frame, u);
list_del_init(&prframe->u.list); list_del_init(&prframe->u.list);
pfhdr = &prframe->u.hdr; pfhdr = &prframe->u.hdr;
...@@ -223,7 +223,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter, ...@@ -223,7 +223,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter,
} }
curfragnum++; curfragnum++;
plist = get_list_head(defrag_q); plist = get_list_head(defrag_q);
plist = get_next(plist); plist = plist->next;
data = get_recvframe_data(prframe); data = get_recvframe_data(prframe);
while (end_of_queue_search(phead, plist) == false) { while (end_of_queue_search(phead, plist) == false) {
pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u); pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
...@@ -247,7 +247,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter, ...@@ -247,7 +247,7 @@ static union recv_frame *recvframe_defrag(struct _adapter *adapter,
memcpy(pfhdr->rx_tail, pnfhdr->rx_data, pnfhdr->len); memcpy(pfhdr->rx_tail, pnfhdr->rx_data, pnfhdr->len);
recvframe_put(prframe, pnfhdr->len); recvframe_put(prframe, pnfhdr->len);
pfhdr->attrib.icv_len = pnfhdr->attrib.icv_len; pfhdr->attrib.icv_len = pnfhdr->attrib.icv_len;
plist = get_next(plist); plist = plist->next;
} }
/* free the defrag_q queue and return the prframe */ /* free the defrag_q queue and return the prframe */
r8712_free_recvframe_queue(defrag_q, pfree_recv_queue); r8712_free_recvframe_queue(defrag_q, pfree_recv_queue);
...@@ -500,12 +500,12 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, ...@@ -500,12 +500,12 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl,
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib; struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
phead = get_list_head(ppending_recvframe_queue); phead = get_list_head(ppending_recvframe_queue);
plist = get_next(phead); plist = phead->next;
while (end_of_queue_search(phead, plist) == false) { while (end_of_queue_search(phead, plist) == false) {
pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u); pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
pnextattrib = &pnextrframe->u.hdr.attrib; pnextattrib = &pnextrframe->u.hdr.attrib;
if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num)) if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
plist = get_next(plist); plist = plist->next;
else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num)) else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
return false; return false;
else else
...@@ -529,7 +529,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter, ...@@ -529,7 +529,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter,
&preorder_ctrl->pending_recvframe_queue; &preorder_ctrl->pending_recvframe_queue;
phead = get_list_head(ppending_recvframe_queue); phead = get_list_head(ppending_recvframe_queue);
plist = get_next(phead); plist = phead->next;
/* Handling some condition for forced indicate case.*/ /* Handling some condition for forced indicate case.*/
if (bforced == true) { if (bforced == true) {
if (list_empty(phead)) if (list_empty(phead))
...@@ -546,7 +546,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter, ...@@ -546,7 +546,7 @@ int r8712_recv_indicatepkts_in_order(struct _adapter *padapter,
prframe = LIST_CONTAINOR(plist, union recv_frame, u); prframe = LIST_CONTAINOR(plist, union recv_frame, u);
pattrib = &prframe->u.hdr.attrib; pattrib = &prframe->u.hdr.attrib;
if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) { if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) {
plist = get_next(plist); plist = plist->next;
list_del_init(&(prframe->u.hdr.list)); list_del_init(&(prframe->u.hdr.list));
if (SN_EQUAL(preorder_ctrl->indicate_seq, if (SN_EQUAL(preorder_ctrl->indicate_seq,
pattrib->seq_num)) pattrib->seq_num))
......
...@@ -167,7 +167,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, ...@@ -167,7 +167,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv,
struct xmit_frame *pxmitframe = NULL; struct xmit_frame *pxmitframe = NULL;
xmitframe_phead = get_list_head(pframe_queue); xmitframe_phead = get_list_head(pframe_queue);
xmitframe_plist = get_next(xmitframe_phead); xmitframe_plist = xmitframe_phead->next;
if ((end_of_queue_search(xmitframe_phead, xmitframe_plist)) == false) { if ((end_of_queue_search(xmitframe_phead, xmitframe_plist)) == false) {
pxmitframe = LIST_CONTAINOR(xmitframe_plist, pxmitframe = LIST_CONTAINOR(xmitframe_plist,
struct xmit_frame, list); struct xmit_frame, list);
...@@ -211,7 +211,7 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv, ...@@ -211,7 +211,7 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv,
for (i = 0; i < entry; i++) { for (i = 0; i < entry; i++) {
phwxmit = phwxmit_i + inx[i]; phwxmit = phwxmit_i + inx[i];
sta_phead = get_list_head(phwxmit->sta_queue); sta_phead = get_list_head(phwxmit->sta_queue);
sta_plist = get_next(sta_phead); sta_plist = sta_phead->next;
while ((end_of_queue_search(sta_phead, sta_plist)) == false) { while ((end_of_queue_search(sta_phead, sta_plist)) == false) {
ptxservq = LIST_CONTAINOR(sta_plist, struct tx_servq, ptxservq = LIST_CONTAINOR(sta_plist, struct tx_servq,
tx_pending); tx_pending);
...@@ -222,10 +222,12 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv, ...@@ -222,10 +222,12 @@ static struct xmit_frame *dequeue_xframe_ex(struct xmit_priv *pxmitpriv,
phwxmit->accnt--; phwxmit->accnt--;
goto exit_dequeue_xframe_ex; goto exit_dequeue_xframe_ex;
} }
sta_plist = get_next(sta_plist); sta_plist = sta_plist->next;
/*Remove sta node when there are no pending packets.*/ /*Remove sta node when there are no pending packets.*/
if (_queue_empty(pframe_queue)) { if (_queue_empty(pframe_queue)) {
/*must be done after get_next and before break*/ /* must be done after sta_plist->next
* and before break
*/
list_del_init(&ptxservq->tx_pending); list_del_init(&ptxservq->tx_pending);
} }
} }
......
...@@ -140,7 +140,7 @@ static struct cmd_obj *_dequeue_cmd(struct __queue *queue) ...@@ -140,7 +140,7 @@ static struct cmd_obj *_dequeue_cmd(struct __queue *queue)
if (list_empty(&(queue->queue))) if (list_empty(&(queue->queue)))
obj = NULL; obj = NULL;
else { else {
obj = LIST_CONTAINOR(get_next(&(queue->queue)), obj = LIST_CONTAINOR(queue->queue.next,
struct cmd_obj, list); struct cmd_obj, list);
list_del_init(&obj->list); list_del_init(&obj->list);
} }
......
...@@ -1079,13 +1079,13 @@ static int r8711_wx_set_wap(struct net_device *dev, ...@@ -1079,13 +1079,13 @@ static int r8711_wx_set_wap(struct net_device *dev,
authmode = padapter->securitypriv.ndisauthtype; authmode = padapter->securitypriv.ndisauthtype;
spin_lock_irqsave(&queue->lock, irqL); spin_lock_irqsave(&queue->lock, irqL);
phead = get_list_head(queue); phead = get_list_head(queue);
pmlmepriv->pscanned = get_next(phead); pmlmepriv->pscanned = phead->next;
while (1) { while (1) {
if (end_of_queue_search(phead, pmlmepriv->pscanned) == true) if (end_of_queue_search(phead, pmlmepriv->pscanned) == true)
break; break;
pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned, pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned,
struct wlan_network, list); struct wlan_network, list);
pmlmepriv->pscanned = get_next(pmlmepriv->pscanned); pmlmepriv->pscanned = pmlmepriv->pscanned->next;
dst_bssid = pnetwork->network.MacAddress; dst_bssid = pnetwork->network.MacAddress;
if (!memcmp(dst_bssid, temp->sa_data, ETH_ALEN)) { if (!memcmp(dst_bssid, temp->sa_data, ETH_ALEN)) {
r8712_set_802_11_infrastructure_mode(padapter, r8712_set_802_11_infrastructure_mode(padapter,
...@@ -1228,7 +1228,7 @@ static int r8711_wx_get_scan(struct net_device *dev, ...@@ -1228,7 +1228,7 @@ static int r8711_wx_get_scan(struct net_device *dev,
} }
spin_lock_irqsave(&queue->lock, irqL); spin_lock_irqsave(&queue->lock, irqL);
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = phead->next;
while (1) { while (1) {
if (end_of_queue_search(phead, plist) == true) if (end_of_queue_search(phead, plist) == true)
break; break;
...@@ -1238,7 +1238,7 @@ static int r8711_wx_get_scan(struct net_device *dev, ...@@ -1238,7 +1238,7 @@ static int r8711_wx_get_scan(struct net_device *dev,
} }
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
ev = translate_scan(padapter, a, pnetwork, ev, stop); ev = translate_scan(padapter, a, pnetwork, ev, stop);
plist = get_next(plist); plist = plist->next;
} }
spin_unlock_irqrestore(&queue->lock, irqL); spin_unlock_irqrestore(&queue->lock, irqL);
wrqu->data.length = ev - extra; wrqu->data.length = ev - extra;
...@@ -1287,13 +1287,13 @@ static int r8711_wx_set_essid(struct net_device *dev, ...@@ -1287,13 +1287,13 @@ static int r8711_wx_set_essid(struct net_device *dev,
memcpy(ndis_ssid.Ssid, extra, len); memcpy(ndis_ssid.Ssid, extra, len);
src_ssid = ndis_ssid.Ssid; src_ssid = ndis_ssid.Ssid;
phead = get_list_head(queue); phead = get_list_head(queue);
pmlmepriv->pscanned = get_next(phead); pmlmepriv->pscanned = phead->next;
while (1) { while (1) {
if (end_of_queue_search(phead, pmlmepriv->pscanned)) if (end_of_queue_search(phead, pmlmepriv->pscanned))
break; break;
pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned, pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned,
struct wlan_network, list); struct wlan_network, list);
pmlmepriv->pscanned = get_next(pmlmepriv->pscanned); pmlmepriv->pscanned = pmlmepriv->pscanned->next;
dst_ssid = pnetwork->network.Ssid.Ssid; dst_ssid = pnetwork->network.Ssid.Ssid;
if ((!memcmp(dst_ssid, src_ssid, ndis_ssid.SsidLength)) if ((!memcmp(dst_ssid, src_ssid, ndis_ssid.SsidLength))
&& (pnetwork->network.Ssid.SsidLength == && (pnetwork->network.Ssid.SsidLength ==
...@@ -2003,7 +2003,7 @@ static int r871x_get_ap_info(struct net_device *dev, ...@@ -2003,7 +2003,7 @@ static int r871x_get_ap_info(struct net_device *dev,
return -EINVAL; return -EINVAL;
spin_lock_irqsave(&(pmlmepriv->scanned_queue.lock), irqL); spin_lock_irqsave(&(pmlmepriv->scanned_queue.lock), irqL);
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = phead->next;
while (1) { while (1) {
if (end_of_queue_search(phead, plist) == true) if (end_of_queue_search(phead, plist) == true)
break; break;
...@@ -2031,7 +2031,7 @@ static int r871x_get_ap_info(struct net_device *dev, ...@@ -2031,7 +2031,7 @@ static int r871x_get_ap_info(struct net_device *dev,
break; break;
} }
} }
plist = get_next(plist); plist = plist->next;
} }
spin_unlock_irqrestore(&(pmlmepriv->scanned_queue.lock), irqL); spin_unlock_irqrestore(&(pmlmepriv->scanned_queue.lock), irqL);
if (pdata->length >= 34) { if (pdata->length >= 34) {
......
...@@ -63,7 +63,7 @@ static u8 do_join(struct _adapter *padapter) ...@@ -63,7 +63,7 @@ static u8 do_join(struct _adapter *padapter)
struct __queue *queue = &(pmlmepriv->scanned_queue); struct __queue *queue = &(pmlmepriv->scanned_queue);
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = phead->next;
pmlmepriv->cur_network.join_res = -2; pmlmepriv->cur_network.join_res = -2;
pmlmepriv->fw_state |= _FW_UNDER_LINKING; pmlmepriv->fw_state |= _FW_UNDER_LINKING;
pmlmepriv->pscanned = plist; pmlmepriv->pscanned = plist;
......
...@@ -92,7 +92,7 @@ struct wlan_network *_r8712_alloc_network(struct mlme_priv *pmlmepriv) ...@@ -92,7 +92,7 @@ struct wlan_network *_r8712_alloc_network(struct mlme_priv *pmlmepriv)
if (_queue_empty(free_queue) == true) if (_queue_empty(free_queue) == true)
return NULL; return NULL;
spin_lock_irqsave(&free_queue->lock, irqL); spin_lock_irqsave(&free_queue->lock, irqL);
plist = get_next(&(free_queue->queue)); plist = free_queue->queue.next;
pnetwork = LIST_CONTAINOR(plist , struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist , struct wlan_network, list);
list_del_init(&pnetwork->list); list_del_init(&pnetwork->list);
pnetwork->last_scanned = jiffies; pnetwork->last_scanned = jiffies;
...@@ -154,10 +154,10 @@ static struct wlan_network *_r8712_find_network(struct __queue *scanned_queue, ...@@ -154,10 +154,10 @@ static struct wlan_network *_r8712_find_network(struct __queue *scanned_queue,
return NULL; return NULL;
spin_lock_irqsave(&scanned_queue->lock, irqL); spin_lock_irqsave(&scanned_queue->lock, irqL);
phead = get_list_head(scanned_queue); phead = get_list_head(scanned_queue);
plist = get_next(phead); plist = phead->next;
while (plist != phead) { while (plist != phead) {
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
plist = get_next(plist); plist = plist->next;
if (!memcmp(addr, pnetwork->network.MacAddress, ETH_ALEN)) if (!memcmp(addr, pnetwork->network.MacAddress, ETH_ALEN))
break; break;
} }
...@@ -175,10 +175,10 @@ static void _free_network_queue(struct _adapter *padapter) ...@@ -175,10 +175,10 @@ static void _free_network_queue(struct _adapter *padapter)
spin_lock_irqsave(&scanned_queue->lock, irqL); spin_lock_irqsave(&scanned_queue->lock, irqL);
phead = get_list_head(scanned_queue); phead = get_list_head(scanned_queue);
plist = get_next(phead); plist = phead->next;
while (end_of_queue_search(phead, plist) == false) { while (end_of_queue_search(phead, plist) == false) {
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list);
plist = get_next(plist); plist = plist->next;
_free_network(pmlmepriv, pnetwork); _free_network(pmlmepriv, pnetwork);
} }
spin_unlock_irqrestore(&scanned_queue->lock, irqL); spin_unlock_irqrestore(&scanned_queue->lock, irqL);
...@@ -316,7 +316,7 @@ struct wlan_network *r8712_get_oldest_wlan_network( ...@@ -316,7 +316,7 @@ struct wlan_network *r8712_get_oldest_wlan_network(
struct wlan_network *oldest = NULL; struct wlan_network *oldest = NULL;
phead = get_list_head(scanned_queue); phead = get_list_head(scanned_queue);
plist = get_next(phead); plist = phead->next;
while (1) { while (1) {
if (end_of_queue_search(phead, plist) == true) if (end_of_queue_search(phead, plist) == true)
break; break;
...@@ -327,7 +327,7 @@ struct wlan_network *r8712_get_oldest_wlan_network( ...@@ -327,7 +327,7 @@ struct wlan_network *r8712_get_oldest_wlan_network(
(unsigned long)pwlan->last_scanned)) (unsigned long)pwlan->last_scanned))
oldest = pwlan; oldest = pwlan;
} }
plist = get_next(plist); plist = plist->next;
} }
return oldest; return oldest;
} }
...@@ -399,7 +399,7 @@ static void update_scanned_network(struct _adapter *adapter, ...@@ -399,7 +399,7 @@ static void update_scanned_network(struct _adapter *adapter,
struct wlan_network *oldest = NULL; struct wlan_network *oldest = NULL;
phead = get_list_head(queue); phead = get_list_head(queue);
plist = get_next(phead); plist = phead->next;
while (1) { while (1) {
if (end_of_queue_search(phead, plist) == true) if (end_of_queue_search(phead, plist) == true)
...@@ -413,7 +413,7 @@ static void update_scanned_network(struct _adapter *adapter, ...@@ -413,7 +413,7 @@ static void update_scanned_network(struct _adapter *adapter,
(unsigned long)pnetwork->last_scanned)) (unsigned long)pnetwork->last_scanned))
oldest = pnetwork; oldest = pnetwork;
plist = get_next(plist); plist = plist->next;
} }
...@@ -1139,7 +1139,7 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv) ...@@ -1139,7 +1139,7 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv)
adapter = (struct _adapter *)pmlmepriv->nic_hdl; adapter = (struct _adapter *)pmlmepriv->nic_hdl;
queue = &pmlmepriv->scanned_queue; queue = &pmlmepriv->scanned_queue;
phead = get_list_head(queue); phead = get_list_head(queue);
pmlmepriv->pscanned = get_next(phead); pmlmepriv->pscanned = phead->next;
while (1) { while (1) {
if (end_of_queue_search(phead, pmlmepriv->pscanned) == true) { if (end_of_queue_search(phead, pmlmepriv->pscanned) == true) {
if ((pmlmepriv->assoc_by_rssi == true) && if ((pmlmepriv->assoc_by_rssi == true) &&
...@@ -1153,7 +1153,7 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv) ...@@ -1153,7 +1153,7 @@ int r8712_select_and_join_from_scan(struct mlme_priv *pmlmepriv)
struct wlan_network, list); struct wlan_network, list);
if (pnetwork == NULL) if (pnetwork == NULL)
return _FAIL; return _FAIL;
pmlmepriv->pscanned = get_next(pmlmepriv->pscanned); pmlmepriv->pscanned = pmlmepriv->pscanned->next;
if (pmlmepriv->assoc_by_bssid == true) { if (pmlmepriv->assoc_by_bssid == true) {
dst_ssid = pnetwork->network.MacAddress; dst_ssid = pnetwork->network.MacAddress;
src_ssid = pmlmepriv->assoc_bssid; src_ssid = pmlmepriv->assoc_bssid;
......
...@@ -116,7 +116,7 @@ union recv_frame *r8712_alloc_recvframe(struct __queue *pfree_recv_queue) ...@@ -116,7 +116,7 @@ union recv_frame *r8712_alloc_recvframe(struct __queue *pfree_recv_queue)
precvframe = NULL; precvframe = NULL;
else { else {
phead = get_list_head(pfree_recv_queue); phead = get_list_head(pfree_recv_queue);
plist = get_next(phead); plist = phead->next;
precvframe = LIST_CONTAINOR(plist, union recv_frame, u); precvframe = LIST_CONTAINOR(plist, union recv_frame, u);
list_del_init(&precvframe->u.hdr.list); list_del_init(&precvframe->u.hdr.list);
padapter = precvframe->u.hdr.adapter; padapter = precvframe->u.hdr.adapter;
...@@ -146,10 +146,10 @@ void r8712_free_recvframe_queue(struct __queue *pframequeue, ...@@ -146,10 +146,10 @@ void r8712_free_recvframe_queue(struct __queue *pframequeue,
spin_lock(&pframequeue->lock); spin_lock(&pframequeue->lock);
phead = get_list_head(pframequeue); phead = get_list_head(pframequeue);
plist = get_next(phead); plist = phead->next;
while (end_of_queue_search(phead, plist) == false) { while (end_of_queue_search(phead, plist) == false) {
precvframe = LIST_CONTAINOR(plist, union recv_frame, u); precvframe = LIST_CONTAINOR(plist, union recv_frame, u);
plist = get_next(plist); plist = plist->next;
r8712_free_recvframe(precvframe, pfree_recv_queue); r8712_free_recvframe(precvframe, pfree_recv_queue);
} }
spin_unlock(&pframequeue->lock); spin_unlock(&pframequeue->lock);
......
...@@ -84,10 +84,10 @@ static void mfree_all_stainfo(struct sta_priv *pstapriv) ...@@ -84,10 +84,10 @@ static void mfree_all_stainfo(struct sta_priv *pstapriv)
spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL); spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL);
phead = get_list_head(&pstapriv->free_sta_queue); phead = get_list_head(&pstapriv->free_sta_queue);
plist = get_next(phead); plist = phead->next;
while ((end_of_queue_search(phead, plist)) == false) { while ((end_of_queue_search(phead, plist)) == false) {
psta = LIST_CONTAINOR(plist, struct sta_info, list); psta = LIST_CONTAINOR(plist, struct sta_info, list);
plist = get_next(plist); plist = plist->next;
} }
spin_unlock_irqrestore(&pstapriv->sta_hash_lock, irqL); spin_unlock_irqrestore(&pstapriv->sta_hash_lock, irqL);
...@@ -125,7 +125,7 @@ struct sta_info *r8712_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) ...@@ -125,7 +125,7 @@ struct sta_info *r8712_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
if (_queue_empty(pfree_sta_queue) == true) if (_queue_empty(pfree_sta_queue) == true)
psta = NULL; psta = NULL;
else { else {
psta = LIST_CONTAINOR(get_next(&pfree_sta_queue->queue), psta = LIST_CONTAINOR(pfree_sta_queue->queue.next,
struct sta_info, list); struct sta_info, list);
list_del_init(&(psta->list)); list_del_init(&(psta->list));
tmp_aid = psta->aid; tmp_aid = psta->aid;
...@@ -227,11 +227,11 @@ void r8712_free_all_stainfo(struct _adapter *padapter) ...@@ -227,11 +227,11 @@ void r8712_free_all_stainfo(struct _adapter *padapter)
spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL); spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL);
for (index = 0; index < NUM_STA; index++) { for (index = 0; index < NUM_STA; index++) {
phead = &(pstapriv->sta_hash[index]); phead = &(pstapriv->sta_hash[index]);
plist = get_next(phead); plist = phead->next;
while ((end_of_queue_search(phead, plist)) == false) { while ((end_of_queue_search(phead, plist)) == false) {
psta = LIST_CONTAINOR(plist, psta = LIST_CONTAINOR(plist,
struct sta_info, hash_list); struct sta_info, hash_list);
plist = get_next(plist); plist = plist->next;
if (pbcmc_stainfo != psta) if (pbcmc_stainfo != psta)
r8712_free_stainfo(padapter , psta); r8712_free_stainfo(padapter , psta);
} }
...@@ -252,7 +252,7 @@ struct sta_info *r8712_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) ...@@ -252,7 +252,7 @@ struct sta_info *r8712_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
index = wifi_mac_hash(hwaddr); index = wifi_mac_hash(hwaddr);
spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL); spin_lock_irqsave(&pstapriv->sta_hash_lock, irqL);
phead = &(pstapriv->sta_hash[index]); phead = &(pstapriv->sta_hash[index]);
plist = get_next(phead); plist = phead->next;
while ((end_of_queue_search(phead, plist)) == false) { while ((end_of_queue_search(phead, plist)) == false) {
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
if ((!memcmp(psta->hwaddr, hwaddr, ETH_ALEN))) { if ((!memcmp(psta->hwaddr, hwaddr, ETH_ALEN))) {
...@@ -260,7 +260,7 @@ struct sta_info *r8712_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) ...@@ -260,7 +260,7 @@ struct sta_info *r8712_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
break; break;
} }
psta = NULL; psta = NULL;
plist = get_next(plist); plist = plist->next;
} }
spin_unlock_irqrestore(&pstapriv->sta_hash_lock, irqL); spin_unlock_irqrestore(&pstapriv->sta_hash_lock, irqL);
return psta; return psta;
......
...@@ -748,7 +748,7 @@ struct xmit_buf *r8712_alloc_xmitbuf(struct xmit_priv *pxmitpriv) ...@@ -748,7 +748,7 @@ struct xmit_buf *r8712_alloc_xmitbuf(struct xmit_priv *pxmitpriv)
pxmitbuf = NULL; pxmitbuf = NULL;
else { else {
phead = get_list_head(pfree_xmitbuf_queue); phead = get_list_head(pfree_xmitbuf_queue);
plist = get_next(phead); plist = phead->next;
pxmitbuf = LIST_CONTAINOR(plist, struct xmit_buf, list); pxmitbuf = LIST_CONTAINOR(plist, struct xmit_buf, list);
list_del_init(&(pxmitbuf->list)); list_del_init(&(pxmitbuf->list));
} }
...@@ -802,7 +802,7 @@ struct xmit_frame *r8712_alloc_xmitframe(struct xmit_priv *pxmitpriv) ...@@ -802,7 +802,7 @@ struct xmit_frame *r8712_alloc_xmitframe(struct xmit_priv *pxmitpriv)
pxframe = NULL; pxframe = NULL;
else { else {
phead = get_list_head(pfree_xmit_queue); phead = get_list_head(pfree_xmit_queue);
plist = get_next(phead); plist = phead->next;
pxframe = LIST_CONTAINOR(plist, struct xmit_frame, list); pxframe = LIST_CONTAINOR(plist, struct xmit_frame, list);
list_del_init(&(pxframe->list)); list_del_init(&(pxframe->list));
} }
...@@ -858,10 +858,10 @@ void r8712_free_xmitframe_queue(struct xmit_priv *pxmitpriv, ...@@ -858,10 +858,10 @@ void r8712_free_xmitframe_queue(struct xmit_priv *pxmitpriv,
spin_lock_irqsave(&(pframequeue->lock), irqL); spin_lock_irqsave(&(pframequeue->lock), irqL);
phead = get_list_head(pframequeue); phead = get_list_head(pframequeue);
plist = get_next(phead); plist = phead->next;
while (end_of_queue_search(phead, plist) == false) { while (end_of_queue_search(phead, plist) == false) {
pxmitframe = LIST_CONTAINOR(plist, struct xmit_frame, list); pxmitframe = LIST_CONTAINOR(plist, struct xmit_frame, list);
plist = get_next(plist); plist = plist->next;
r8712_free_xmitframe(pxmitpriv, pxmitframe); r8712_free_xmitframe(pxmitpriv, pxmitframe);
} }
spin_unlock_irqrestore(&(pframequeue->lock), irqL); spin_unlock_irqrestore(&(pframequeue->lock), irqL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment