From 567257655f530a1a2e650daf752f57e8f1b1f07c Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Sat, 13 Dec 2014 10:40:44 -0600 Subject: [PATCH] rtl8188eu: Replace LIST_CONTAINOR with container_of Signed-off-by: Larry Finger --- core/rtw_ap.c | 16 ++++++++-------- core/rtw_cmd.c | 2 +- core/rtw_debug.c | 2 +- core/rtw_mlme.c | 14 +++++++------- core/rtw_mlme_ext.c | 4 ++-- core/rtw_p2p.c | 4 ++-- core/rtw_recv.c | 16 ++++++++-------- core/rtw_sta_mgt.c | 14 +++++++------- core/rtw_xmit.c | 20 ++++++++++---------- hal/rtl8188eu_xmit.c | 2 +- include/osdep_service.h | 3 --- os_dep/ioctl_linux.c | 26 +++++++++++++------------- os_dep/xmit_linux.c | 2 +- 13 files changed, 61 insertions(+), 64 deletions(-) diff --git a/core/rtw_ap.c b/core/rtw_ap.c index aaf0134..06f7968 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -288,7 +288,7 @@ void expire_timeout_chk(struct adapter *padapter) /* check auth_queue */ 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); if (psta->expire_to > 0) { @@ -322,7 +322,7 @@ void expire_timeout_chk(struct adapter *padapter) /* check asoc_queue */ 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); 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); 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); 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); 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); if (!memcmp(paclnode->addr, addr, ETH_ALEN)) { @@ -1508,7 +1508,7 @@ void associated_clients_update(struct adapter *padapter, u8 updated) /* check asoc_queue */ 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); @@ -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 */ 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); 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 */ 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); @@ -1943,7 +1943,7 @@ void stop_ap_mode(struct adapter *padapter) phead = get_list_head(pacl_node_q); plist = get_next(phead); 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); if (paclnode->valid) { diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index aaf76df..fd5f9d3 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -162,7 +162,7 @@ struct cmd_obj *_rtw_dequeue_cmd(struct __queue *queue) if (rtw_is_list_empty(&(queue->queue))) { obj = NULL; } 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); } diff --git a/core/rtw_debug.c b/core/rtw_debug.c index 6bb971b..217b057 100644 --- a/core/rtw_debug.c +++ b/core/rtw_debug.c @@ -850,7 +850,7 @@ int proc_get_all_sta_info(char *page, char **start, plist = get_next(phead); 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); diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index fc02fe8..50bdbf4 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -178,7 +178,7 @@ struct wlan_network *_rtw_dequeue_network(struct __queue *queue) if (_rtw_queue_empty(queue)) { pnetwork = NULL; } 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)); } @@ -202,7 +202,7 @@ struct wlan_network *_rtw_alloc_network(struct mlme_priv *pmlmepriv)/* _queue *f } 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); @@ -280,7 +280,7 @@ struct wlan_network *_rtw_find_network(struct __queue *scanned_queue, u8 *addr) plist = get_next(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)) break; plist = get_next(plist); @@ -305,7 +305,7 @@ void _rtw_free_network_queue(struct adapter *padapter, u8 isfreeall) plist = get_next(phead); 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); @@ -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) break; - pwlan = LIST_CONTAINOR(plist, struct wlan_network, list); + pwlan = container_of(plist, struct wlan_network, list); if (!pwlan->fixed) { 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) break; - pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); + pnetwork = container_of(plist, struct wlan_network, list); if (is_same_network(&(pnetwork->network), target)) { 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; pmlmepriv->pscanned = get_next(phead); 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) { RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("%s return _FAIL:(pnetwork==NULL)\n", __func__)); ret = _FAIL; diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index b8445e6..da67580 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -6198,7 +6198,7 @@ static void issue_action_BSSCoexistPacket(struct adapter *padapter) if (rtw_end_of_queue_search(phead, plist)) break; - pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); + pnetwork = container_of(plist, struct wlan_network, list); plist = get_next(plist); @@ -8312,7 +8312,7 @@ u8 tx_beacon_hdl(struct adapter *padapter, unsigned char *pbuf) xmitframe_plist = get_next(xmitframe_phead); 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); diff --git a/core/rtw_p2p.c b/core/rtw_p2p.c index c3a6830..ce8d3a0 100644 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -61,7 +61,7 @@ static u32 go_add_group_info_attr(struct wifidirect_info *pwdinfo, u8 *pbuf) /* look up sta asoc_queue */ 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); @@ -965,7 +965,7 @@ u32 process_p2p_devdisc_req(struct wifidirect_info *pwdinfo, u8 *pframe, uint le /* look up sta asoc_queue */ 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); diff --git a/core/rtw_recv.c b/core/rtw_recv.c index f02cab1..ba89235 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -154,7 +154,7 @@ struct recv_frame *_rtw_alloc_recvframe (struct __queue *pfree_recv_queue) 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); padapter = precvframe->adapter; @@ -267,7 +267,7 @@ void rtw_free_recvframe_queue(struct __queue *pframequeue, struct __queue *pfre plist = get_next(phead); 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); @@ -331,7 +331,7 @@ struct recv_buf *rtw_dequeue_recvbuf (struct __queue *queue) 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); } @@ -1074,7 +1074,7 @@ static int validate_recv_ctrl_frame(struct adapter *padapter, xmitframe_plist = get_next(xmitframe_phead); 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); @@ -1473,7 +1473,7 @@ static struct recv_frame *recvframe_defrag(struct adapter *adapter, struct __que phead = get_list_head(defrag_q); plist = phead->next; - prframe = LIST_CONTAINOR(plist, struct recv_frame, list); + prframe = container_of(plist, struct recv_frame, list); prframe = (struct recv_frame *)pfhdr; 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); 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; 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)) return true; - prframe = LIST_CONTAINOR(plist, struct recv_frame, list); + prframe = container_of(plist, struct recv_frame, list); pattrib = &prframe->attrib; 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. */ /* Check if there is any packet need indicate. */ 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; if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) { diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index 1c43200..c2d04ca 100644 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -190,7 +190,7 @@ void rtw_mfree_all_stainfo(struct sta_priv *pstapriv) plist = get_next(phead); 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); 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) { int i; - psta = LIST_CONTAINOR(plist, struct sta_info , hash_list); + psta = container_of(plist, struct sta_info , hash_list); plist = get_next(plist); 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); psta = NULL; } 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)); spin_unlock_bh(&pfree_sta_queue->lock); _rtw_init_stainfo(psta); @@ -411,7 +411,7 @@ u32 rtw_free_stainfo(struct adapter *padapter , struct sta_info *psta) plist = get_next(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); @@ -487,7 +487,7 @@ void rtw_free_all_stainfo(struct adapter *padapter) plist = get_next(phead); 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); @@ -523,7 +523,7 @@ struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr) plist = get_next(phead); 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 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); plist = get_next(phead); 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); if (!memcmp(paclnode->addr, mac_addr, ETH_ALEN)) { diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index 801b30d..08a3705 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -1245,7 +1245,7 @@ struct xmit_buf *rtw_alloc_xmitbuf_ext(struct xmit_priv *pxmitpriv) 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)); } @@ -1305,7 +1305,7 @@ struct xmit_buf *rtw_alloc_xmitbuf(struct xmit_priv *pxmitpriv) 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)); } @@ -1386,7 +1386,7 @@ struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv)/* _queue *pf 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)); } @@ -1462,7 +1462,7 @@ void rtw_free_xmitframe_queue(struct xmit_priv *pxmitpriv, struct __queue *pfram plist = get_next(phead); 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); @@ -1493,7 +1493,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str xmitframe_plist = get_next(xmitframe_phead); 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); @@ -1533,7 +1533,7 @@ struct xmit_frame *rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmi sta_plist = get_next(sta_phead); 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; @@ -2032,7 +2032,7 @@ static void dequeue_xmitframes_to_sleeping_queue(struct adapter *padapter, struc plist = get_next(phead); 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); @@ -2099,7 +2099,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) xmitframe_plist = get_next(xmitframe_phead); 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); @@ -2180,7 +2180,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta) xmitframe_plist = get_next(xmitframe_phead); 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); @@ -2227,7 +2227,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst xmitframe_plist = get_next(xmitframe_phead); 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); diff --git a/hal/rtl8188eu_xmit.c b/hal/rtl8188eu_xmit.c index 7c5798d..3e6f2a2 100644 --- a/hal/rtl8188eu_xmit.c +++ b/hal/rtl8188eu_xmit.c @@ -539,7 +539,7 @@ s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitp xmitframe_plist = get_next(xmitframe_phead); 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); pxmitframe->agg_num = 0; /* not first frame of aggregation */ diff --git a/include/osdep_service.h b/include/osdep_service.h index aab97d1..4355e90 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -75,9 +75,6 @@ static inline struct list_head *get_list_head(struct __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) { int ret; diff --git a/os_dep/ioctl_linux.c b/os_dep/ioctl_linux.c index 7b87a98..e937dbb 100644 --- a/os_dep/ioctl_linux.c +++ b/os_dep/ioctl_linux.c @@ -1143,7 +1143,7 @@ static int rtw_wx_set_wap(struct net_device *dev, if ((rtw_end_of_queue_search(phead, pmlmepriv->pscanned)) == true) 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); @@ -1448,7 +1448,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, 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 */ 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; } - pnetwork = LIST_CONTAINOR(pmlmepriv->pscanned, struct wlan_network, list); + pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list); 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) break; - pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); + pnetwork = container_of(plist, struct wlan_network, list); if (hwaddr_aton_i(data, bssid)) { 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) 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)) { u8 *wpsie; 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) 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)) { /* Commented by Albert 2011/05/18 */ /* 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) 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)) { u8 *wpsie; 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) 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)) { u8 *wpsie; 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) 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)) { /* Commented by Albert 20121226 */ /* 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) 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)) { uintPeerChannel = pnetwork->network.Configuration.DSConfig; break; @@ -3592,7 +3592,7 @@ static int rtw_p2p_invite_req(struct net_device *dev, if (rtw_end_of_queue_search(phead, plist) == true) break; - pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); + pnetwork = container_of(plist, struct wlan_network, list); /* Commented by Albert 2011/05/18 */ /* 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) break; - pnetwork = LIST_CONTAINOR(plist, struct wlan_network, list); + pnetwork = container_of(plist, struct wlan_network, list); /* Commented by Albert 2011/05/18 */ /* 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); 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); diff --git a/os_dep/xmit_linux.c b/os_dep/xmit_linux.c index 909fa21..d2602a8 100644 --- a/os_dep/xmit_linux.c +++ b/os_dep/xmit_linux.c @@ -195,7 +195,7 @@ static int rtw_mlcst2unicst(struct adapter *padapter, struct sk_buff *skb) /* free sta asoc_queue */ 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);