/* 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) {
/* 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) {
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)) {
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)) {
/* 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);
/* 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);
/* 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);
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) {
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);
}
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);
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));
}
}
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);
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) == true)
break;
plist = get_next(plist);
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);
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))
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))
break;
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;
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);
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);
/* 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);
/* 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);
union recv_frame *_rtw_alloc_recvframe (struct __queue *pfree_recv_queue)
{
- union recv_frame *precvframe;
+ struct recv_frame_hdr *hdr;
struct list_head *plist, *phead;
struct adapter *padapter;
struct recv_priv *precvpriv;
_func_enter_;
if (_rtw_queue_empty(pfree_recv_queue)) {
- precvframe = NULL;
+ hdr = NULL;
} else {
phead = get_list_head(pfree_recv_queue);
plist = get_next(phead);
- precvframe = LIST_CONTAINOR(plist, union recv_frame, u);
+ hdr = container_of(plist, struct recv_frame_hdr, list);
- rtw_list_delete(&precvframe->u.hdr.list);
- padapter = precvframe->u.hdr.adapter;
+ rtw_list_delete(&hdr->list);
+ padapter = hdr->adapter;
if (padapter != NULL) {
precvpriv = &padapter->recvpriv;
if (pfree_recv_queue == &precvpriv->free_recv_queue)
_func_exit_;
- return precvframe;
+ return (union recv_frame *)hdr;
}
union recv_frame *rtw_alloc_recvframe (struct __queue *pfree_recv_queue)
void rtw_free_recvframe_queue(struct __queue *pframequeue, struct __queue *pfree_recv_queue)
{
- union recv_frame *precvframe;
+ struct recv_frame_hdr *hdr;
struct list_head *plist, *phead;
_func_enter_;
plist = get_next(phead);
while (rtw_end_of_queue_search(phead, plist) == false) {
- precvframe = LIST_CONTAINOR(plist, union recv_frame, u);
+ hdr = container_of(plist, struct recv_frame_hdr, list);
plist = get_next(plist);
- rtw_free_recvframe(precvframe, pfree_recv_queue);
+ rtw_free_recvframe((union recv_frame *)hdr, pfree_recv_queue);
}
spin_unlock(&pframequeue->lock);
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);
}
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);
phead = get_list_head(defrag_q);
plist = get_next(phead);
- prframe = LIST_CONTAINOR(plist, union recv_frame, u);
- pfhdr = &prframe->u.hdr;
+ pfhdr = container_of(plist, struct recv_frame_hdr, list);
+ prframe = (union recv_frame *)pfhdr;
rtw_list_delete(&(prframe->u.list));
if (curfragnum != pfhdr->attrib.frag_num) {
plist = get_next(plist);
while (rtw_end_of_queue_search(phead, plist) == false) {
- pnextrframe = LIST_CONTAINOR(plist, union recv_frame , u);
- pnfhdr = &pnextrframe->u.hdr;
+ pnfhdr = container_of(plist, struct recv_frame_hdr , list);
+ pnextrframe = (union recv_frame *)pnfhdr;
/* check the fragment sequence (2nd ~n fragment frame) */
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
struct __queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
struct list_head *phead, *plist;
- union recv_frame *pnextrframe;
+ struct recv_frame_hdr *hdr;
struct rx_pkt_attrib *pnextattrib;
phead = get_list_head(ppending_recvframe_queue);
plist = get_next(phead);
while (rtw_end_of_queue_search(phead, plist) == false) {
- pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
- pnextattrib = &pnextrframe->u.hdr.attrib;
+ hdr = container_of(plist, struct recv_frame_hdr, list);
+ pnextattrib = &hdr->attrib;
if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
plist = get_next(plist);
{
struct list_head *phead, *plist;
union recv_frame *prframe;
+ struct recv_frame_hdr *prhdr;
struct rx_pkt_attrib *pattrib;
int bPktInBuf = false;
struct recv_priv *precvpriv = &padapter->recvpriv;
if (rtw_is_list_empty(phead))
return true;
- prframe = LIST_CONTAINOR(plist, union recv_frame, u);
- pattrib = &prframe->u.hdr.attrib;
+ prhdr = container_of(plist, struct recv_frame_hdr, list);
+ pattrib = &prhdr->attrib;
preorder_ctrl->indicate_seq = pattrib->seq_num;
}
/* Prepare indication list and indication. */
/* Check if there is any packet need indicate. */
while (!rtw_is_list_empty(phead)) {
- prframe = LIST_CONTAINOR(plist, union recv_frame, u);
+ prhdr = container_of(plist, struct recv_frame_hdr, list);
+ prframe = (union recv_frame *)prhdr;
pattrib = &prframe->u.hdr.attrib;
if (!SN_LESS(preorder_ctrl->indicate_seq, pattrib->seq_num)) {
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);
}
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++) {
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);
/* for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer */
for (i = 0; i < 16; i++) {
struct list_head *phead, *plist;
+ struct recv_frame_hdr *prhdr;
union recv_frame *prframe;
struct __queue *ppending_recvframe_queue;
struct __queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
plist = get_next(phead);
while (!rtw_is_list_empty(phead)) {
- prframe = LIST_CONTAINOR(plist, union recv_frame, u);
+ prhdr = container_of(plist, struct recv_frame_hdr, list);
+ prframe = (union recv_frame *)prhdr;
plist = get_next(plist);
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);
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)) == true) {
/* if found the matched address */
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)) {
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));
}
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));
}
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));
}
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);
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);
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;
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);
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);
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);
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);
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 */
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)
{
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);
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)
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);
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);
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;
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 */
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;
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;
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 */
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;
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 */
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 */
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);
/* 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);