rtl8188eu: Replace LIST_CONTAINOR with container_of

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2014-12-13 10:40:44 -06:00
parent 7fd86158bf
commit 567257655f
13 changed files with 61 additions and 64 deletions

View file

@ -288,7 +288,7 @@ void expire_timeout_chk(struct adapter *padapter)
/* check auth_queue */ /* check auth_queue */
while ((rtw_end_of_queue_search(phead, plist)) == false) { while ((rtw_end_of_queue_search(phead, plist)) == false) {
psta = LIST_CONTAINOR(plist, struct sta_info, auth_list); psta = container_of(plist, struct sta_info, auth_list);
plist = get_next(plist); plist = get_next(plist);
if (psta->expire_to > 0) { if (psta->expire_to > 0) {
@ -322,7 +322,7 @@ void expire_timeout_chk(struct adapter *padapter)
/* check asoc_queue */ /* check asoc_queue */
while ((rtw_end_of_queue_search(phead, plist)) == false) { while ((rtw_end_of_queue_search(phead, plist)) == false) {
psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); psta = container_of(plist, struct sta_info, asoc_list);
plist = get_next(plist); plist = get_next(plist);
if (chk_sta_is_alive(psta) || !psta->expire_to) { if (chk_sta_is_alive(psta) || !psta->expire_to) {
@ -1147,7 +1147,7 @@ int rtw_acl_add_sta(struct adapter *padapter, u8 *addr)
plist = get_next(phead); plist = get_next(phead);
while (!rtw_end_of_queue_search(phead, plist)) { while (!rtw_end_of_queue_search(phead, plist)) {
paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list); paclnode = container_of(plist, struct rtw_wlan_acl_node, list);
plist = get_next(plist); plist = get_next(plist);
if (!memcmp(paclnode->addr, addr, ETH_ALEN)) { if (!memcmp(paclnode->addr, addr, ETH_ALEN)) {
@ -1208,7 +1208,7 @@ int rtw_acl_remove_sta(struct adapter *padapter, u8 *addr)
plist = get_next(phead); plist = get_next(phead);
while (!rtw_end_of_queue_search(phead, plist)) { while (!rtw_end_of_queue_search(phead, plist)) {
paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list); paclnode = container_of(plist, struct rtw_wlan_acl_node, list);
plist = get_next(plist); plist = get_next(plist);
if (!memcmp(paclnode->addr, addr, ETH_ALEN)) { if (!memcmp(paclnode->addr, addr, ETH_ALEN)) {
@ -1508,7 +1508,7 @@ void associated_clients_update(struct adapter *padapter, u8 updated)
/* check asoc_queue */ /* check asoc_queue */
while ((rtw_end_of_queue_search(phead, plist)) == false) { while ((rtw_end_of_queue_search(phead, plist)) == false) {
psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); psta = container_of(plist, struct sta_info, asoc_list);
plist = get_next(plist); plist = get_next(plist);
@ -1781,7 +1781,7 @@ int rtw_ap_inform_ch_switch(struct adapter *padapter, u8 new_ch, u8 ch_offset)
/* for each sta in asoc_queue */ /* for each sta in asoc_queue */
while (!rtw_end_of_queue_search(phead, plist)) { while (!rtw_end_of_queue_search(phead, plist)) {
psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); psta = container_of(plist, struct sta_info, asoc_list);
plist = get_next(plist); plist = get_next(plist);
issue_action_spct_ch_switch(padapter, psta->hwaddr, new_ch, ch_offset); issue_action_spct_ch_switch(padapter, psta->hwaddr, new_ch, ch_offset);
@ -1815,7 +1815,7 @@ int rtw_sta_flush(struct adapter *padapter)
/* free sta asoc_queue */ /* free sta asoc_queue */
while ((rtw_end_of_queue_search(phead, plist)) == false) { while ((rtw_end_of_queue_search(phead, plist)) == false) {
psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); psta = container_of(plist, struct sta_info, asoc_list);
plist = get_next(plist); plist = get_next(plist);
@ -1943,7 +1943,7 @@ void stop_ap_mode(struct adapter *padapter)
phead = get_list_head(pacl_node_q); phead = get_list_head(pacl_node_q);
plist = get_next(phead); plist = get_next(phead);
while ((rtw_end_of_queue_search(phead, plist)) == false) { while ((rtw_end_of_queue_search(phead, plist)) == false) {
paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list); paclnode = container_of(plist, struct rtw_wlan_acl_node, list);
plist = get_next(plist); plist = get_next(plist);
if (paclnode->valid) { if (paclnode->valid) {

View file

@ -162,7 +162,7 @@ struct cmd_obj *_rtw_dequeue_cmd(struct __queue *queue)
if (rtw_is_list_empty(&(queue->queue))) { if (rtw_is_list_empty(&(queue->queue))) {
obj = NULL; obj = NULL;
} else { } else {
obj = LIST_CONTAINOR(get_next(&(queue->queue)), struct cmd_obj, list); obj = container_of(get_next(&(queue->queue)), struct cmd_obj, list);
rtw_list_delete(&obj->list); rtw_list_delete(&obj->list);
} }

View file

@ -850,7 +850,7 @@ int proc_get_all_sta_info(char *page, char **start,
plist = get_next(phead); plist = get_next(phead);
while ((rtw_end_of_queue_search(phead, plist)) == false) { while ((rtw_end_of_queue_search(phead, plist)) == false) {
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); psta = container_of(plist, struct sta_info, hash_list);
plist = get_next(plist); plist = get_next(plist);

View file

@ -178,7 +178,7 @@ struct wlan_network *_rtw_dequeue_network(struct __queue *queue)
if (_rtw_queue_empty(queue)) { if (_rtw_queue_empty(queue)) {
pnetwork = NULL; pnetwork = NULL;
} else { } else {
pnetwork = LIST_CONTAINOR(get_next(&queue->queue), struct wlan_network, list); pnetwork = container_of(get_next(&queue->queue), struct wlan_network, list);
rtw_list_delete(&(pnetwork->list)); rtw_list_delete(&(pnetwork->list));
} }
@ -202,7 +202,7 @@ struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)/* _queue *f
} }
plist = get_next(&(free_queue->queue)); plist = get_next(&(free_queue->queue));
pnetwork = LIST_CONTAINOR(plist , struct wlan_network, list); pnetwork = container_of(plist , struct wlan_network, list);
rtw_list_delete(&pnetwork->list); rtw_list_delete(&pnetwork->list);
@ -280,7 +280,7 @@ struct wlan_network *_rtw_find_network(struct __queue *scanned_queue, u8 *addr)
plist = get_next(phead); plist = get_next(phead);
while (plist != phead) { while (plist != phead) {
pnetwork = LIST_CONTAINOR(plist, struct wlan_network , list); pnetwork = container_of(plist, struct wlan_network , list);
if (!memcmp(addr, pnetwork->network.MacAddress, ETH_ALEN)) if (!memcmp(addr, pnetwork->network.MacAddress, ETH_ALEN))
break; break;
plist = get_next(plist); plist = get_next(plist);
@ -305,7 +305,7 @@ void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall)
plist = get_next(phead); plist = get_next(phead);
while (rtw_end_of_queue_search(phead, plist) == false) { while (rtw_end_of_queue_search(phead, plist) == false) {
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = container_of(plist, struct wlan_network, list);
plist = get_next(plist); plist = get_next(plist);
@ -479,7 +479,7 @@ struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue)
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) == true)
break; break;
pwlan = LIST_CONTAINOR(plist, struct wlan_network, list); pwlan = container_of(plist, struct wlan_network, list);
if (!pwlan->fixed) { if (!pwlan->fixed) {
if (oldest == NULL || time_after(oldest->last_scanned, pwlan->last_scanned)) if (oldest == NULL || time_after(oldest->last_scanned, pwlan->last_scanned))
@ -572,7 +572,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) == true)
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = container_of(plist, struct wlan_network, list);
if (is_same_network(&(pnetwork->network), target)) { if (is_same_network(&(pnetwork->network), target)) {
target_find = 1; target_find = 1;
@ -1718,7 +1718,7 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
adapter = (struct adapter *)pmlmepriv->nic_hdl; adapter = (struct adapter *)pmlmepriv->nic_hdl;
pmlmepriv->pscanned = get_next(phead); pmlmepriv->pscanned = get_next(phead);
while (!rtw_end_of_queue_search(phead, pmlmepriv->pscanned)) { while (!rtw_end_of_queue_search(phead, pmlmepriv->pscanned)) {
pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned, struct wlan_network, list); pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
if (pnetwork == NULL) { if (pnetwork == NULL) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s return _FAIL:(pnetwork==NULL)\n", __func__)); RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s return _FAIL:(pnetwork==NULL)\n", __func__));
ret = _FAIL; ret = _FAIL;

View file

@ -6198,7 +6198,7 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter)
if (rtw_end_of_queue_search(phead, plist)) if (rtw_end_of_queue_search(phead, plist))
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = container_of(plist, struct wlan_network, list);
plist = get_next(plist); plist = get_next(plist);
@ -8312,7 +8312,7 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf)
xmitframe_plist = get_next(xmitframe_phead); xmitframe_plist = get_next(xmitframe_phead);
while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) { while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
xmitframe_plist = get_next(xmitframe_plist); xmitframe_plist = get_next(xmitframe_plist);

View file

@ -61,7 +61,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf)
/* look up sta asoc_queue */ /* look up sta asoc_queue */
while ((rtw_end_of_queue_search(phead, plist)) == false) { while ((rtw_end_of_queue_search(phead, plist)) == false) {
psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); psta = container_of(plist, struct sta_info, asoc_list);
plist = get_next(plist); plist = get_next(plist);
@ -965,7 +965,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le
/* look up sta asoc_queue */ /* look up sta asoc_queue */
while ((rtw_end_of_queue_search(phead, plist)) == false) { while ((rtw_end_of_queue_search(phead, plist)) == false) {
psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); psta = container_of(plist, struct sta_info, asoc_list);
plist = get_next(plist); plist = get_next(plist);

View file

@ -154,7 +154,7 @@ struct recv_frame *_rtw_alloc_recvframe (struct __queue *pfree_recv_queue)
plist = get_next(phead); plist = get_next(phead);
precvframe = LIST_CONTAINOR(plist, struct recv_frame, list); precvframe = container_of(plist, struct recv_frame, list);
rtw_list_delete(&precvframe->list); rtw_list_delete(&precvframe->list);
padapter = precvframe->adapter; padapter = precvframe->adapter;
@ -267,7 +267,7 @@ void rtw_free_recvframe_queue(struct __queue *pframequeue, struct __queue *pfre
plist = get_next(phead); plist = get_next(phead);
while (rtw_end_of_queue_search(phead, plist) == false) { while (rtw_end_of_queue_search(phead, plist) == false) {
precvframe = LIST_CONTAINOR(plist, struct recv_frame, list); precvframe = container_of(plist, struct recv_frame, list);
plist = get_next(plist); plist = get_next(plist);
@ -331,7 +331,7 @@ struct recv_buf *rtw_dequeue_recvbuf (struct __queue *queue)
plist = get_next(phead); plist = get_next(phead);
precvbuf = LIST_CONTAINOR(plist, struct recv_buf, list); precvbuf = container_of(plist, struct recv_buf, list);
rtw_list_delete(&precvbuf->list); rtw_list_delete(&precvbuf->list);
} }
@ -1074,7 +1074,7 @@ static int validate_recv_ctrl_frame(struct adapter *padapter,
xmitframe_plist = get_next(xmitframe_phead); xmitframe_plist = get_next(xmitframe_phead);
if ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == false) { if ((rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) == false) {
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
xmitframe_plist = get_next(xmitframe_plist); xmitframe_plist = get_next(xmitframe_plist);
@ -1473,7 +1473,7 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter, struct __que
phead = get_list_head(defrag_q); phead = get_list_head(defrag_q);
plist = phead->next; plist = phead->next;
prframe = LIST_CONTAINOR(plist, struct recv_frame, list); prframe = container_of(plist, struct recv_frame, list);
prframe = (struct recv_frame *)pfhdr; prframe = (struct recv_frame *)pfhdr;
rtw_list_delete(&(prframe->list)); rtw_list_delete(&(prframe->list));
@ -1799,7 +1799,7 @@ int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, struct re
plist = get_next(phead); plist = get_next(phead);
while (rtw_end_of_queue_search(phead, plist) == false) { while (rtw_end_of_queue_search(phead, plist) == false) {
pnextrframe = LIST_CONTAINOR(plist, struct recv_frame, list); pnextrframe = container_of(plist, struct recv_frame, list);
pnextattrib = &pnextrframe->attrib; pnextattrib = &pnextrframe->attrib;
if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num)) if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
@ -1833,7 +1833,7 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
if (rtw_is_list_empty(phead)) if (rtw_is_list_empty(phead))
return true; return true;
prframe = LIST_CONTAINOR(plist, struct recv_frame, list); prframe = container_of(plist, struct recv_frame, list);
pattrib = &prframe->attrib; pattrib = &prframe->attrib;
preorder_ctrl->indicate_seq = pattrib->seq_num; preorder_ctrl->indicate_seq = pattrib->seq_num;
} }
@ -1841,7 +1841,7 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
/* Prepare indication list and indication. */ /* Prepare indication list and indication. */
/* Check if there is any packet need indicate. */ /* Check if there is any packet need indicate. */
while (!rtw_is_list_empty(phead)) { while (!rtw_is_list_empty(phead)) {
prframe = LIST_CONTAINOR(plist, struct recv_frame, list); prframe = container_of(plist, struct recv_frame, list);
pattrib = &prframe->attrib; pattrib = &prframe->attrib;
if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) { if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) {

View file

@ -190,7 +190,7 @@ void rtw_mfree_all_stainfo(struct sta_priv *pstapriv)
plist = get_next(phead); plist = get_next(phead);
while ((rtw_end_of_queue_search(phead, plist)) == false) { while ((rtw_end_of_queue_search(phead, plist)) == false) {
psta = LIST_CONTAINOR(plist, struct sta_info , list); psta = container_of(plist, struct sta_info , list);
plist = get_next(plist); plist = get_next(plist);
rtw_mfree_stainfo(psta); rtw_mfree_stainfo(psta);
@ -237,7 +237,7 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
while ((rtw_end_of_queue_search(phead, plist)) == false) { while ((rtw_end_of_queue_search(phead, plist)) == false) {
int i; int i;
psta = LIST_CONTAINOR(plist, struct sta_info , hash_list); psta = container_of(plist, struct sta_info , hash_list);
plist = get_next(plist); plist = get_next(plist);
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
@ -276,7 +276,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
spin_unlock_bh(&pfree_sta_queue->lock); spin_unlock_bh(&pfree_sta_queue->lock);
psta = NULL; psta = NULL;
} else { } else {
psta = LIST_CONTAINOR(get_next(&pfree_sta_queue->queue), struct sta_info, list); psta = container_of(get_next(&pfree_sta_queue->queue), struct sta_info, list);
rtw_list_delete(&(psta->list)); rtw_list_delete(&(psta->list));
spin_unlock_bh(&pfree_sta_queue->lock); spin_unlock_bh(&pfree_sta_queue->lock);
_rtw_init_stainfo(psta); _rtw_init_stainfo(psta);
@ -411,7 +411,7 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta)
plist = get_next(phead); plist = get_next(phead);
while (!rtw_is_list_empty(phead)) { while (!rtw_is_list_empty(phead)) {
prframe = LIST_CONTAINOR(plist, struct recv_frame, list); prframe = container_of(plist, struct recv_frame, list);
plist = get_next(plist); plist = get_next(plist);
@ -487,7 +487,7 @@ void rtw_free_all_stainfo(struct adapter *padapter)
plist = get_next(phead); plist = get_next(phead);
while ((!rtw_end_of_queue_search(phead, plist))) { while ((!rtw_end_of_queue_search(phead, plist))) {
psta = LIST_CONTAINOR(plist, struct sta_info , hash_list); psta = container_of(plist, struct sta_info , hash_list);
plist = get_next(plist); plist = get_next(plist);
@ -523,7 +523,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
plist = get_next(phead); plist = get_next(phead);
while ((!rtw_end_of_queue_search(phead, plist))) { while ((!rtw_end_of_queue_search(phead, plist))) {
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); psta = container_of(plist, struct sta_info, hash_list);
if ((!memcmp(psta->hwaddr, addr, ETH_ALEN))) { if ((!memcmp(psta->hwaddr, addr, ETH_ALEN))) {
/* if found the matched address */ /* if found the matched address */
@ -587,7 +587,7 @@ u8 rtw_access_ctrl(struct adapter *padapter, u8 *mac_addr)
phead = get_list_head(pacl_node_q); phead = get_list_head(pacl_node_q);
plist = get_next(phead); plist = get_next(phead);
while ((!rtw_end_of_queue_search(phead, plist))) { while ((!rtw_end_of_queue_search(phead, plist))) {
paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list); paclnode = container_of(plist, struct rtw_wlan_acl_node, list);
plist = get_next(plist); plist = get_next(plist);
if (!memcmp(paclnode->addr, mac_addr, ETH_ALEN)) { if (!memcmp(paclnode->addr, mac_addr, ETH_ALEN)) {

View file

@ -1245,7 +1245,7 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv)
plist = get_next(phead); plist = get_next(phead);
pxmitbuf = LIST_CONTAINOR(plist, struct xmit_buf, list); pxmitbuf = container_of(plist, struct xmit_buf, list);
rtw_list_delete(&(pxmitbuf->list)); rtw_list_delete(&(pxmitbuf->list));
} }
@ -1305,7 +1305,7 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv)
plist = get_next(phead); plist = get_next(phead);
pxmitbuf = LIST_CONTAINOR(plist, struct xmit_buf, list); pxmitbuf = container_of(plist, struct xmit_buf, list);
rtw_list_delete(&(pxmitbuf->list)); rtw_list_delete(&(pxmitbuf->list));
} }
@ -1386,7 +1386,7 @@ struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)/* _queue *pf
plist = get_next(phead); plist = get_next(phead);
pxframe = LIST_CONTAINOR(plist, struct xmit_frame, list); pxframe = container_of(plist, struct xmit_frame, list);
rtw_list_delete(&(pxframe->list)); rtw_list_delete(&(pxframe->list));
} }
@ -1462,7 +1462,7 @@ void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pfram
plist = get_next(phead); plist = get_next(phead);
while (!rtw_end_of_queue_search(phead, plist)) { while (!rtw_end_of_queue_search(phead, plist)) {
pxmitframe = LIST_CONTAINOR(plist, struct xmit_frame, list); pxmitframe = container_of(plist, struct xmit_frame, list);
plist = get_next(plist); plist = get_next(plist);
@ -1493,7 +1493,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str
xmitframe_plist = get_next(xmitframe_phead); xmitframe_plist = get_next(xmitframe_phead);
if (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) { if (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
xmitframe_plist = get_next(xmitframe_plist); xmitframe_plist = get_next(xmitframe_plist);
@ -1533,7 +1533,7 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi
sta_plist = get_next(sta_phead); sta_plist = get_next(sta_phead);
while (!rtw_end_of_queue_search(sta_phead, sta_plist)) { while (!rtw_end_of_queue_search(sta_phead, sta_plist)) {
ptxservq = LIST_CONTAINOR(sta_plist, struct tx_servq, tx_pending); ptxservq = container_of(sta_plist, struct tx_servq, tx_pending);
pframe_queue = &ptxservq->sta_pending; pframe_queue = &ptxservq->sta_pending;
@ -2032,7 +2032,7 @@ static void dequeue_xmitframes_to_sleeping_queue(struct adapter *padapter, struc
plist = get_next(phead); plist = get_next(phead);
while (!rtw_end_of_queue_search(phead, plist)) { while (!rtw_end_of_queue_search(phead, plist)) {
pxmitframe = LIST_CONTAINOR(plist, struct xmit_frame, list); pxmitframe = container_of(plist, struct xmit_frame, list);
plist = get_next(plist); plist = get_next(plist);
@ -2099,7 +2099,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
xmitframe_plist = get_next(xmitframe_phead); xmitframe_plist = get_next(xmitframe_phead);
while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) { while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
xmitframe_plist = get_next(xmitframe_plist); xmitframe_plist = get_next(xmitframe_plist);
@ -2180,7 +2180,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
xmitframe_plist = get_next(xmitframe_phead); xmitframe_plist = get_next(xmitframe_phead);
while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) { while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
xmitframe_plist = get_next(xmitframe_plist); xmitframe_plist = get_next(xmitframe_plist);
@ -2227,7 +2227,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst
xmitframe_plist = get_next(xmitframe_phead); xmitframe_plist = get_next(xmitframe_phead);
while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) { while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
xmitframe_plist = get_next(xmitframe_plist); xmitframe_plist = get_next(xmitframe_plist);

View file

@ -539,7 +539,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp
xmitframe_plist = get_next(xmitframe_phead); xmitframe_plist = get_next(xmitframe_phead);
while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) { while (!rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist)) {
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list); pxmitframe = container_of(xmitframe_plist, struct xmit_frame, list);
xmitframe_plist = get_next(xmitframe_plist); xmitframe_plist = get_next(xmitframe_plist);
pxmitframe->agg_num = 0; /* not first frame of aggregation */ pxmitframe->agg_num = 0; /* not first frame of aggregation */

View file

@ -75,9 +75,6 @@ static inline struct list_head *get_list_head(struct __queue *queue)
return (&(queue->queue)); return (&(queue->queue));
} }
#define LIST_CONTAINOR(ptr, type, member) \
((type *)((char *)(ptr)-(size_t)(&((type *)0)->member)))
static inline int _enter_critical_mutex(struct mutex *pmutex, unsigned long *pirqL) static inline int _enter_critical_mutex(struct mutex *pmutex, unsigned long *pirqL)
{ {
int ret; int ret;

View file

@ -1143,7 +1143,7 @@ static int rtw_wx_set_wap(struct net_device *dev,
if ((rtw_end_of_queue_search(phead, pmlmepriv->pscanned)) == true) if ((rtw_end_of_queue_search(phead, pmlmepriv->pscanned)) == true)
break; break;
pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned, struct wlan_network, list); pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
pmlmepriv->pscanned = get_next(pmlmepriv->pscanned); pmlmepriv->pscanned = get_next(pmlmepriv->pscanned);
@ -1448,7 +1448,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a,
break; break;
} }
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = container_of(plist, struct wlan_network, list);
/* report network only if the current channel set contains the channel to which this network belongs */ /* report network only if the current channel set contains the channel to which this network belongs */
if (rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, pnetwork->network.Configuration.DSConfig) >= 0) if (rtw_ch_set_search_ch(padapter->mlmeextpriv.channel_set, pnetwork->network.Configuration.DSConfig) >= 0)
@ -1537,7 +1537,7 @@ static int rtw_wx_set_essid(struct net_device *dev,
break; break;
} }
pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned, struct wlan_network, list); pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
pmlmepriv->pscanned = get_next(pmlmepriv->pscanned); pmlmepriv->pscanned = get_next(pmlmepriv->pscanned);
@ -2606,7 +2606,7 @@ static int rtw_get_ap_info(struct net_device *dev,
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) == true)
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = container_of(plist, struct wlan_network, list);
if (hwaddr_aton_i(data, bssid)) { if (hwaddr_aton_i(data, bssid)) {
DBG_88E("Invalid BSSID '%s'.\n", (u8 *)data); DBG_88E("Invalid BSSID '%s'.\n", (u8 *)data);
@ -3109,7 +3109,7 @@ static int rtw_p2p_get_wps_configmethod(struct net_device *dev,
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) == true)
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = container_of(plist, struct wlan_network, list);
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
u8 *wpsie; u8 *wpsie;
uint wpsie_len = 0; uint wpsie_len = 0;
@ -3181,7 +3181,7 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev,
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) == true)
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = container_of(plist, struct wlan_network, list);
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
/* Commented by Albert 2011/05/18 */ /* Commented by Albert 2011/05/18 */
/* Match the device address located in the P2P IE */ /* Match the device address located in the P2P IE */
@ -3265,7 +3265,7 @@ static int rtw_p2p_get_device_type(struct net_device *dev,
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) == true)
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = container_of(plist, struct wlan_network, list);
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
u8 *wpsie; u8 *wpsie;
uint wpsie_len = 0; uint wpsie_len = 0;
@ -3344,7 +3344,7 @@ static int rtw_p2p_get_device_name(struct net_device *dev,
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) == true)
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = container_of(plist, struct wlan_network, list);
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
u8 *wpsie; u8 *wpsie;
uint wpsie_len = 0; uint wpsie_len = 0;
@ -3415,7 +3415,7 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev,
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) == true)
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = container_of(plist, struct wlan_network, list);
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
/* Commented by Albert 20121226 */ /* Commented by Albert 20121226 */
/* Match the device address located in the P2P IE */ /* Match the device address located in the P2P IE */
@ -3497,7 +3497,7 @@ static int rtw_p2p_connect(struct net_device *dev,
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) == true)
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = container_of(plist, struct wlan_network, list);
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) { if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
uintPeerChannel = pnetwork->network.Configuration.DSConfig; uintPeerChannel = pnetwork->network.Configuration.DSConfig;
break; break;
@ -3592,7 +3592,7 @@ static int rtw_p2p_invite_req(struct net_device *dev,
if (rtw_end_of_queue_search(phead, plist) == true) if (rtw_end_of_queue_search(phead, plist) == true)
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = container_of(plist, struct wlan_network, list);
/* Commented by Albert 2011/05/18 */ /* Commented by Albert 2011/05/18 */
/* Match the device address located in the P2P IE */ /* Match the device address located in the P2P IE */
@ -3745,7 +3745,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
if (uintPeerChannel != 0) if (uintPeerChannel != 0)
break; break;
pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); pnetwork = container_of(plist, struct wlan_network, list);
/* Commented by Albert 2011/05/18 */ /* Commented by Albert 2011/05/18 */
/* Match the device address located in the P2P IE */ /* Match the device address located in the P2P IE */
@ -4434,7 +4434,7 @@ static int rtw_dbg_port(struct net_device *dev,
plist = get_next(phead); plist = get_next(phead);
while ((rtw_end_of_queue_search(phead, plist)) == false) { while ((rtw_end_of_queue_search(phead, plist)) == false) {
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list); psta = container_of(plist, struct sta_info, hash_list);
plist = get_next(plist); plist = get_next(plist);

View file

@ -195,7 +195,7 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb)
/* free sta asoc_queue */ /* free sta asoc_queue */
while (!rtw_end_of_queue_search(phead, plist)) { while (!rtw_end_of_queue_search(phead, plist)) {
psta = LIST_CONTAINOR(plist, struct sta_info, asoc_list); psta = container_of(plist, struct sta_info, asoc_list);
plist = get_next(plist); plist = get_next(plist);