caller must guarantee the atomic context.
Otherwise, there will be racing condition.
*/
-static inline void list_insert_tail(struct list_head *plist,
- struct list_head *phead)
-{
- list_add_tail(plist, phead);
-}
-
static inline u32 _down_sema(struct semaphore *sema)
{
if (down_interruptible(sema))
break;
precvbuf->ref_cnt = 0;
precvbuf->adapter = padapter;
- list_insert_tail(&precvbuf->list,
+ list_add_tail(&precvbuf->list,
&(precvpriv->free_recv_buf_queue.queue));
precvbuf++;
}
}
spin_lock_irqsave(&pfree_recv_queue->lock, irqL);
list_delete(&(precvframe->u.hdr.list));
- list_insert_tail(&(precvframe->u.hdr.list),
+ list_add_tail(&(precvframe->u.hdr.list),
get_list_head(pfree_recv_queue));
if (padapter != NULL) {
if (pfree_recv_queue == &precvpriv->free_recv_queue)
}
/* Then enqueue the 0~(n-1) fragment to the defrag_q */
phead = get_list_head(pdefrag_q);
- list_insert_tail(&pfhdr->list, phead);
+ list_add_tail(&pfhdr->list, phead);
prtnframe = NULL;
} else {
/* can't find this ta's defrag_queue, so free this
* enqueue the last fragment */
if (pdefrag_q != NULL) {
phead = get_list_head(pdefrag_q);
- list_insert_tail(&pfhdr->list, phead);
+ list_add_tail(&pfhdr->list, phead);
/*call recvframe_defrag to defrag*/
precv_frame = recvframe_defrag(padapter, pdefrag_q);
prtnframe = precv_frame;
break;
}
list_delete(&(prframe->u.hdr.list));
- list_insert_tail(&(prframe->u.hdr.list), plist);
+ list_add_tail(&(prframe->u.hdr.list), plist);
return true;
}
if (obj == NULL)
return _SUCCESS;
spin_lock_irqsave(&queue->lock, irqL);
- list_insert_tail(&obj->list, &queue->queue);
+ list_add_tail(&obj->list, &queue->queue);
spin_unlock_irqrestore(&queue->lock, irqL);
return _SUCCESS;
}
return _FAIL;
queue = &pcmdpriv->cmd_queue;
spin_lock_irqsave(&queue->lock, irqL);
- list_insert_tail(&obj->list, &queue->queue);
+ list_add_tail(&obj->list, &queue->queue);
spin_unlock_irqrestore(&queue->lock, irqL);
up(&pcmdpriv->cmd_queue_sema);
return _SUCCESS;
goto createbss_cmd_fail;
pwlan->last_scanned = jiffies;
} else
- list_insert_tail(&(pwlan->list),
+ list_add_tail(&(pwlan->list),
&pmlmepriv->scanned_queue.queue);
pnetwork->Length = r8712_get_ndis_wlan_bssid_ex_sz(pnetwork);
memcpy(&(pwlan->network), pnetwork, pnetwork->Length);
pio_req = (struct io_req *)(pio_queue->free_ioreqs_buf);
for (i = 0; i < NUM_IOREQ; i++) {
INIT_LIST_HEAD(&pio_req->list);
- list_insert_tail(&pio_req->list, &pio_queue->free_ioreqs);
+ list_add_tail(&pio_req->list, &pio_queue->free_ioreqs);
pio_req++;
}
if ((register_intf_hdl((u8 *)adapter, &(pio_queue->intf))) == _FAIL)
pnetwork = (struct wlan_network *)pbuf;
for (i = 0; i < MAX_BSS_CNT; i++) {
INIT_LIST_HEAD(&(pnetwork->list));
- list_insert_tail(&(pnetwork->list),
+ list_add_tail(&(pnetwork->list),
&(pmlmepriv->free_bss_pool.queue));
pnetwork++;
}
return;
spin_lock_irqsave(&free_queue->lock, irqL);
list_delete(&pnetwork->list);
- list_insert_tail(&pnetwork->list, &free_queue->queue);
+ list_add_tail(&pnetwork->list, &free_queue->queue);
pmlmepriv->num_of_scanned--;
spin_unlock_irqrestore(&free_queue->lock, irqL);
}
if (pnetwork->fixed == true)
return;
list_delete(&pnetwork->list);
- list_insert_tail(&pnetwork->list, get_list_head(free_queue));
+ list_add_tail(&pnetwork->list, get_list_head(free_queue));
pmlmepriv->num_of_scanned--;
}
bssid_ex_sz = r8712_get_ndis_wlan_bssid_ex_sz(target);
target->Length = bssid_ex_sz;
memcpy(&pnetwork->network, target, bssid_ex_sz);
- list_insert_tail(&pnetwork->list, &queue->queue);
+ list_add_tail(&pnetwork->list, &queue->queue);
}
} else {
/* we have an entry and we are going to update it. But
pmp_xmitframe = (struct mp_xmit_frame *)pmp_priv->pmp_xmtframe_buf;
for (i = 0; i < NR_MP_XMITFRAME; i++) {
INIT_LIST_HEAD(&(pmp_xmitframe->list));
- list_insert_tail(&(pmp_xmitframe->list),
+ list_add_tail(&(pmp_xmitframe->list),
&(pmp_priv->free_mp_xmitqueue.queue));
pmp_xmitframe->pkt = NULL;
pmp_xmitframe->frame_tag = MP_FRAMETAG;
precvframe = (union recv_frame *)precvpriv->precv_frame_buf;
for (i = 0; i < NR_RECVFRAME; i++) {
INIT_LIST_HEAD(&(precvframe->u.list));
- list_insert_tail(&(precvframe->u.list),
+ list_add_tail(&(precvframe->u.list),
&(precvpriv->free_recv_queue.queue));
r8712_os_recv_resource_alloc(padapter, precvframe);
precvframe->u.hdr.adapter = padapter;
for (i = 0; i < NUM_STA; i++) {
_init_stainfo(psta);
INIT_LIST_HEAD(&(pstapriv->sta_hash[i]));
- list_insert_tail(&psta->list,
+ list_add_tail(&psta->list,
get_list_head(&pstapriv->free_sta_queue));
psta++;
}
goto exit;
}
phash_list = &(pstapriv->sta_hash[index]);
- list_insert_tail(&psta->hash_list, phash_list);
+ list_add_tail(&psta->hash_list, phash_list);
pstapriv->asoc_sta_count++;
/* For the SMC router, the sequence number of first packet of WPS handshake
}
spin_lock(&(pfree_sta_queue->lock));
/* insert into free_sta_queue; 20061114 */
- list_insert_tail(&psta->list, get_list_head(pfree_sta_queue));
+ list_add_tail(&psta->list, get_list_head(pfree_sta_queue));
spin_unlock(&(pfree_sta_queue->lock));
}
pxframe->pkt = NULL;
pxframe->buf_addr = NULL;
pxframe->pxmitbuf = NULL;
- list_insert_tail(&(pxframe->list),
+ list_add_tail(&(pxframe->list),
&(pxmitpriv->free_xmit_queue.queue));
pxframe++;
}
((addr_t) (pxmitbuf->pallocated_buf) &
(XMITBUF_ALIGN_SZ - 1));
r8712_xmit_resource_alloc(padapter, pxmitbuf);
- list_insert_tail(&pxmitbuf->list,
+ list_add_tail(&pxmitbuf->list,
&(pxmitpriv->free_xmitbuf_queue.queue));
pxmitbuf++;
}
return _FAIL;
spin_lock_irqsave(&pfree_xmitbuf_queue->lock, irqL);
list_delete(&pxmitbuf->list);
- list_insert_tail(&(pxmitbuf->list), get_list_head(pfree_xmitbuf_queue));
+ list_add_tail(&(pxmitbuf->list), get_list_head(pfree_xmitbuf_queue));
pxmitpriv->free_xmitbuf_cnt++;
spin_unlock_irqrestore(&pfree_xmitbuf_queue->lock, irqL);
return _SUCCESS;
pndis_pkt = pxmitframe->pkt;
pxmitframe->pkt = NULL;
}
- list_insert_tail(&pxmitframe->list, get_list_head(pfree_xmit_queue));
+ list_add_tail(&pxmitframe->list, get_list_head(pfree_xmit_queue));
pxmitpriv->free_xmitframe_cnt++;
spin_unlock_irqrestore(&pfree_xmit_queue->lock, irqL);
if (netif_queue_stopped(padapter->pnetdev))
psta, pattrib->priority);
spin_lock_irqsave(&pstapending->lock, irqL0);
if (list_empty(&ptxservq->tx_pending))
- list_insert_tail(&ptxservq->tx_pending,
+ list_add_tail(&ptxservq->tx_pending,
get_list_head(pstapending));
- list_insert_tail(&pxmitframe->list,
+ list_add_tail(&pxmitframe->list,
get_list_head(&ptxservq->sta_pending));
ptxservq->qcnt++;
spin_unlock_irqrestore(&pstapending->lock, irqL0);