• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ rtw_list_delete函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中rtw_list_delete函数的典型用法代码示例。如果您正苦于以下问题:C++ rtw_list_delete函数的具体用法?C++ rtw_list_delete怎么用?C++ rtw_list_delete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了rtw_list_delete函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: rtw_free_xmitbuf

s32 rtw_free_xmitbuf(PADAPTER padapter, struct xmit_buf *pxmitbuf)
{	
	_irqL irqL;
	_queue *queue = NULL;
	struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
_func_enter_;	
	queue = &pxmitpriv->free_xmit_queue;
	if (pxmitbuf == NULL) {
		DBG_871X("======rtw_free_xmitbuf():pxmitbuf==NULL!!!!!!!!!!\n");
		goto exit;
	}

	_enter_critical(&queue->lock, &irqL);

	rtw_list_delete(&pxmitbuf->list);	
	rtw_list_insert_tail(&pxmitbuf->list, get_list_head(queue));
	pxmitpriv->free_xmitbuf_cnt++;
	#ifdef DBG_XMIT_BUF
	DBG_871X("DBG_XMIT_BUF FREE no=%d, free_xmitbuf_cnt=%d\n",pxmitbuf->no ,pxmitpriv->free_xmitbuf_cnt);
	#endif
	_exit_critical(&queue->lock, &irqL);

exit:

_func_exit_;

	return _SUCCESS;
}
开发者ID:yangkunming99,项目名称:linux_inic,代码行数:28,代码来源:rtw_xmit.c


示例2: rtl8723as_free_recv_priv

/*
 * Free recv private variable of hardware dependent
 * 1. recv buf
 * 2. recv tasklet
 *
 */
void rtl8723as_free_recv_priv(PADAPTER padapter)
{
	u32			i, n;
	struct recv_priv	*precvpriv;
	struct recv_buf		*precvbuf;


	precvpriv = &padapter->recvpriv;

	//3 1. kill tasklet
#ifdef PLATFORM_LINUX
	tasklet_kill(&precvpriv->recv_tasklet);
#endif

	//3 2. free all recv buffers
	precvbuf = (struct recv_buf*)precvpriv->precv_buf;
	if (precvbuf) {
		n = NR_RECVBUFF;
		precvpriv->free_recv_buf_queue_cnt = 0;
		for (i = 0; i < n ; i++)
		{
			rtw_list_delete(&precvbuf->list);
			rtw_os_recvbuf_resource_free(padapter, precvbuf);
			freerecvbuf(precvbuf);
			precvbuf++;
		}
		precvpriv->precv_buf = NULL;
	}

	if (precvpriv->pallocated_recv_buf) {
		n = NR_RECVBUFF * sizeof(struct recv_buf) + 4;
		rtw_mfree(precvpriv->pallocated_recv_buf, n);
		precvpriv->pallocated_recv_buf = NULL;
	}
}
开发者ID:ItsAnilSingh,项目名称:android_kernel_samsung_logan2g,代码行数:41,代码来源:rtl8723as_recv.c


示例3: rtl8192ce_dequeue_xmitbuf

struct xmit_buf * rtl8192ce_dequeue_xmitbuf(struct rtw_tx_ring	*ring)
{
	_irqL irqL;
	_list *plist, *phead;
	struct xmit_buf *pxmitbuf =  NULL;
	_queue *ppending_queue = &ring->queue;

_func_enter_;

	//_enter_critical(&ppending_queue->lock, &irqL);

	if(_rtw_queue_empty(ppending_queue) == _TRUE) {
		pxmitbuf = NULL;
	} else {

		phead = get_list_head(ppending_queue);

		plist = get_next(phead);

		pxmitbuf = LIST_CONTAINOR(plist, struct xmit_buf, list);

		rtw_list_delete(&(pxmitbuf->list));
	}

	ring->qlen--;
		
	//_exit_critical(&ppending_queue->lock, &irqL);	

_func_exit_;	 

	return pxmitbuf;	
} 
开发者ID:develersrl,项目名称:winmate-kernel,代码行数:32,代码来源:rtl8192ce_xmit.c


示例4: rtl8192ce_enqueue_xmitbuf

s32 rtl8192ce_enqueue_xmitbuf(struct rtw_tx_ring	*ring, struct xmit_buf *pxmitbuf)
{
	_irqL irqL;
	_queue *ppending_queue = &ring->queue;
	
_func_enter_;	

	//DBG_8192C("+enqueue_xmitbuf\n");

	if(pxmitbuf==NULL)
	{		
		return _FAIL;
	}
	
	//_enter_critical(&ppending_queue->lock, &irqL);
	
	rtw_list_delete(&pxmitbuf->list);	
	
	rtw_list_insert_tail(&(pxmitbuf->list), get_list_head(ppending_queue));

	ring->qlen++;

	//DBG_8192C("FREE, free_xmitbuf_cnt=%d\n", pxmitpriv->free_xmitbuf_cnt);
		
	//_exit_critical(&ppending_queue->lock, &irqL);	

_func_exit_;	 

	return _SUCCESS;	
} 
开发者ID:develersrl,项目名称:winmate-kernel,代码行数:30,代码来源:rtl8192ce_xmit.c


示例5: rtw_free_all_stainfo

// free all stainfo which in sta_hash[all]
void rtw_free_all_stainfo(_adapter *padapter)
{
	_irqL	 irqL;
	_list	*plist, *phead;
	s32	index;
	struct sta_info *psta = NULL;
	struct	sta_priv *pstapriv = &padapter->stapriv;
	struct sta_info* pbcmc_stainfo =rtw_get_bcmc_stainfo( padapter);
	u8 free_sta_num = 0;
	char free_sta_list[NUM_STA];
	int stainfo_offset;
	
_func_enter_;	

	if(pstapriv->asoc_sta_count==1)
		goto exit;

	_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);

	for(index=0; index< NUM_STA; index++)
	{
		phead = &(pstapriv->sta_hash[index]);
		plist = get_next(phead);
		
		while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
		{
			psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list);

			plist = get_next(plist);

			if(pbcmc_stainfo!=psta)
			{
				rtw_list_delete(&psta->hash_list);
				//rtw_free_stainfo(padapter , psta);
				stainfo_offset = rtw_stainfo_offset(pstapriv, psta);
				if (stainfo_offset_valid(stainfo_offset)) {
					free_sta_list[free_sta_num++] = stainfo_offset;
				}
			}	
			
		}
	}
	
	_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);


	for (index = 0; index < free_sta_num; index++) 
	{
		psta = rtw_get_stainfo_by_offset(pstapriv, free_sta_list[index]);
		rtw_free_stainfo(padapter , psta);
	}
	
exit:	
	
_func_exit_;	

}
开发者ID:AOSC-Dev,项目名称:aosc-os-armel-sunxi-boot,代码行数:58,代码来源:rtw_sta_mgt.c


示例6: rtl8723bs_free_xmit_priv

void rtl8723bs_free_xmit_priv(PADAPTER padapter)
{
    PHAL_DATA_TYPE phal;
    struct xmit_priv *pxmitpriv;
    struct xmit_buf *pxmitbuf;
    _queue *pqueue;
    _list *plist, *phead;
    _list tmplist;
    _irqL irql;


    phal = GET_HAL_DATA(padapter);
    pxmitpriv = &padapter->xmitpriv;
    pqueue = &pxmitpriv->pending_xmitbuf_queue;
    phead = get_list_head(pqueue);
    _rtw_init_listhead(&tmplist);

    _enter_critical_bh(&pqueue->lock, &irql);
    if (_rtw_queue_empty(pqueue) == _FALSE)
    {
        // Insert tmplist to end of queue, and delete phead
        // then tmplist become head of queue.
        rtw_list_insert_tail(&tmplist, phead);
        rtw_list_delete(phead);
    }
    _exit_critical_bh(&pqueue->lock, &irql);

    phead = &tmplist;
    while (rtw_is_list_empty(phead) == _FALSE)
    {
        plist = get_next(phead);
        rtw_list_delete(plist);

        pxmitbuf = LIST_CONTAINOR(plist, struct xmit_buf, list);
        rtw_free_xmitframe(pxmitpriv, (struct xmit_frame*)pxmitbuf->priv_data);
        pxmitbuf->priv_data = NULL;
        rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
    }

    _rtw_spinlock_free(&phal->SdioTxFIFOFreePageLock);
}
开发者ID:avila-devlogic,项目名称:D33_KK_Kernel,代码行数:41,代码来源:rtl8723bs_xmit.c


示例7: _enter_critical

struct xmit_buf *rtw_alloc_xmitbuf(PADAPTER padapter)//(_queue *pfree_xmit_queue)
{
	/*
		Please remember to use all the osdep_service api,
		and lock/unlock or _enter/_exit critical to protect 
		pfree_xmit_queue
	*/

	_irqL irqL;
	struct xmit_buf *pxmitbuf = NULL;
	struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
	_list *plist, *phead;
	_queue *pfree_xmit_queue = &pxmitpriv->free_xmit_queue;

_func_enter_;

	_enter_critical(&pfree_xmit_queue->lock, &irqL);

	if (_rtw_queue_empty(pfree_xmit_queue) == _TRUE) {
		DBG_871X("rtw_alloc_xmitbuf failed!\n");
		pxmitbuf=  NULL;
	} else {
		phead = get_list_head(pfree_xmit_queue);

		plist = get_next(phead);

		pxmitbuf = LIST_CONTAINOR(plist, struct xmit_buf, list);

		rtw_list_delete(&(pxmitbuf->list));
	}
	if(pxmitbuf){
		pxmitpriv->free_xmitbuf_cnt--;
		#ifdef DBG_XMIT_BUF
		DBG_871X("DBG_XMIT_BUF ALLOC no=%d,  free_xmitbuf_cnt=%d\n",pxmitbuf->no, pxmitpriv->free_xmitbuf_cnt);
		#endif
#if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI)
		pxmitbuf->pkt_len = 0;
		pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead;
#endif

	}

	_exit_critical(&pfree_xmit_queue->lock, &irqL);

_func_exit_;

	return pxmitbuf;
}
开发者ID:yangkunming99,项目名称:linux_inic,代码行数:48,代码来源:rtw_xmit.c


示例8: rtw_dequeue_xmitbuf

struct xmit_buf* rtw_dequeue_xmitbuf(PADAPTER padapter)
{
	_irqL irqL;
	_list *plist, *phead;
	struct xmit_buf *pxmitbuf = NULL;
	_queue *pframe_queue = NULL;
	struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
	pframe_queue = &pxmitpriv->xmitbuf_pending_queue;
_func_enter_;
_enter_critical_bh(&pframe_queue->lock, &irqL);
	phead = get_list_head(pframe_queue);
	plist = get_next(phead);
	if(plist != phead)
	{
		pxmitbuf = LIST_CONTAINOR(plist, struct xmit_buf, list);
		rtw_list_delete(&pxmitbuf->list);
	}
开发者ID:yangkunming99,项目名称:linux_inic,代码行数:17,代码来源:rtw_xmit.c


示例9: rtw_st_ctl_clear_tracker_q

inline void rtw_st_ctl_clear_tracker_q(struct st_ctl_t *st_ctl)
{
	_irqL irqL;
	_list *plist, *phead;
	struct session_tracker *st;

	_enter_critical_bh(&st_ctl->tracker_q.lock, &irqL);
	phead = &st_ctl->tracker_q.queue;
	plist = get_next(phead);
	while (rtw_end_of_queue_search(phead, plist) == _FALSE) {
		st = LIST_CONTAINOR(plist, struct session_tracker, list);
		plist = get_next(plist);
		rtw_list_delete(&st->list);
		rtw_mfree((u8 *)st, sizeof(struct session_tracker));
	}
	_exit_critical_bh(&st_ctl->tracker_q.lock, &irqL);
}
开发者ID:AOSC-Dev,项目名称:aosc-os-armel-sunxi-boot,代码行数:17,代码来源:rtw_sta_mgt.c


示例10: rtw_free_stainfo

// using pstapriv->sta_hash_lock to protect
u32	rtw_free_stainfo(_adapter *padapter , struct sta_info *psta)
{
	int i;
	_irqL irqL0;
	_queue *pfree_sta_queue;
	struct recv_reorder_ctrl *preorder_ctrl;
	struct	sta_xmit_priv	*pstaxmitpriv;
	struct	xmit_priv	*pxmitpriv= &padapter->xmitpriv;
	struct	sta_priv *pstapriv = &padapter->stapriv;
	struct hw_xmit *phwxmit;


_func_enter_;

	if (psta == NULL)
		goto exit;


	_enter_critical_bh(&psta->lock, &irqL0);
	psta->state &= ~_FW_LINKED;
	_exit_critical_bh(&psta->lock, &irqL0);

	pfree_sta_queue = &pstapriv->free_sta_queue;


	pstaxmitpriv = &psta->sta_xmitpriv;

	//rtw_list_delete(&psta->sleep_list);

	//rtw_list_delete(&psta->wakeup_list);

	_enter_critical_bh(&pxmitpriv->lock, &irqL0);

	rtw_free_xmitframe_queue(pxmitpriv, &psta->sleep_q);
	psta->sleepq_len = 0;

	//vo
	//_enter_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0);
	rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vo_q.sta_pending);
	rtw_list_delete(&(pstaxmitpriv->vo_q.tx_pending));
	phwxmit = pxmitpriv->hwxmits;
	phwxmit->accnt -= pstaxmitpriv->vo_q.qcnt;
	pstaxmitpriv->vo_q.qcnt = 0;
	//_exit_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0);

	//vi
	//_enter_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0);
	rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vi_q.sta_pending);
	rtw_list_delete(&(pstaxmitpriv->vi_q.tx_pending));
	phwxmit = pxmitpriv->hwxmits+1;
	phwxmit->accnt -= pstaxmitpriv->vi_q.qcnt;
	pstaxmitpriv->vi_q.qcnt = 0;
	//_exit_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0);

	//be
	//_enter_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0);
	rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->be_q.sta_pending);
	rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending));
	phwxmit = pxmitpriv->hwxmits+2;
	phwxmit->accnt -= pstaxmitpriv->be_q.qcnt;
	pstaxmitpriv->be_q.qcnt = 0;
	//_exit_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0);

	//bk
	//_enter_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0);
	rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->bk_q.sta_pending);
	rtw_list_delete(&(pstaxmitpriv->bk_q.tx_pending));
	phwxmit = pxmitpriv->hwxmits+3;
	phwxmit->accnt -= pstaxmitpriv->bk_q.qcnt;
	pstaxmitpriv->bk_q.qcnt = 0;
	//_exit_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0);

	_exit_critical_bh(&pxmitpriv->lock, &irqL0);

	rtw_list_delete(&psta->hash_list);
	RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("\n free number_%d stainfo  with hwaddr = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x  \n",pstapriv->asoc_sta_count , psta->hwaddr[0], psta->hwaddr[1], psta->hwaddr[2],psta->hwaddr[3],psta->hwaddr[4],psta->hwaddr[5]));
	pstapriv->asoc_sta_count --;


	// re-init sta_info; 20061114 // will be init in alloc_stainfo
	//_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
	//_rtw_init_sta_recv_priv(&psta->sta_recvpriv);

	_cancel_timer_ex(&psta->addba_retry_timer);

#ifdef CONFIG_TDLS
	_cancel_timer_ex(&psta->TPK_timer);
	_cancel_timer_ex(&psta->option_timer);
	_cancel_timer_ex(&psta->base_ch_timer);
	_cancel_timer_ex(&psta->off_ch_timer);
	_cancel_timer_ex(&psta->alive_timer1);
	_cancel_timer_ex(&psta->alive_timer2);
#endif //CONFIG_TDLS

	//for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer
	for(i=0; i < 16 ; i++)
	{
		_irqL irqL;
		_list	*phead, *plist;
//.........这里部分代码省略.........
开发者ID:zefie,项目名称:nxt_andx86_kernel,代码行数:101,代码来源:rtw_sta_mgt.c


示例11: rtl8723as_init_recv_priv

/*
 * Initialize recv private variable for hardware dependent
 * 1. recv buf
 * 2. recv tasklet
 *
 */
s32 rtl8723as_init_recv_priv(PADAPTER padapter)
{
	s32			res;
	u32			i, n;
	struct recv_priv	*precvpriv;
	struct recv_buf		*precvbuf;


	res = _SUCCESS;
	precvpriv = &padapter->recvpriv;

	//3 1. init recv buffer
	_rtw_init_queue(&precvpriv->free_recv_buf_queue);
	_rtw_init_queue(&precvpriv->recv_buf_pending_queue);

	n = NR_RECVBUFF * sizeof(struct recv_buf) + 4;
	precvpriv->pallocated_recv_buf = rtw_zmalloc(n);
	if (precvpriv->pallocated_recv_buf == NULL) {
		res = _FAIL;
		RT_TRACE(_module_rtl871x_recv_c_, _drv_err_, ("alloc recv_buf fail!\n"));
		goto exit;
	}

	precvpriv->precv_buf = (u8*)N_BYTE_ALIGMENT((SIZE_PTR)(precvpriv->pallocated_recv_buf), 4);

	// init each recv buffer
	precvbuf = (struct recv_buf*)precvpriv->precv_buf;
	for (i = 0; i < NR_RECVBUFF; i++)
	{
		res = initrecvbuf(precvbuf, padapter);
		if (res == _FAIL)
			break;

		res = rtw_os_recvbuf_resource_alloc(padapter, precvbuf);
		if (res == _FAIL) {
			freerecvbuf(precvbuf);
			break;
		}

#ifdef CONFIG_SDIO_RX_COPY
		if (precvbuf->pskb == NULL) {
			SIZE_PTR tmpaddr=0;
			SIZE_PTR alignment=0;

#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)) // http://www.mail-archive.com/[email protected]/msg17214.html
			precvbuf->pskb = dev_alloc_skb(MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
#else
			precvbuf->pskb = netdev_alloc_skb(padapter->pnetdev, MAX_RECVBUF_SZ + RECVBUFF_ALIGN_SZ);
#endif

			if(precvbuf->pskb)
			{
				precvbuf->pskb->dev = padapter->pnetdev;

				tmpaddr = (SIZE_PTR)precvbuf->pskb->data;
				alignment = tmpaddr & (RECVBUFF_ALIGN_SZ-1);
				skb_reserve(precvbuf->pskb, (RECVBUFF_ALIGN_SZ - alignment));
			}

			if (precvbuf->pskb == NULL) {
				DBG_871X("%s: alloc_skb fail!\n", __FUNCTION__);
			}
		}
#endif

		rtw_list_insert_tail(&precvbuf->list, &precvpriv->free_recv_buf_queue.queue);

		precvbuf++;
	}
	precvpriv->free_recv_buf_queue_cnt = i;

	if (res == _FAIL)
		goto initbuferror;

	//3 2. init tasklet
#ifdef PLATFORM_LINUX
	tasklet_init(&precvpriv->recv_tasklet,
	     (void(*)(unsigned long))rtl8723as_recv_tasklet,
	     (unsigned long)padapter);
#endif

	goto exit;

initbuferror:
	precvbuf = (struct recv_buf*)precvpriv->precv_buf;
	if (precvbuf) {
		n = precvpriv->free_recv_buf_queue_cnt;
		precvpriv->free_recv_buf_queue_cnt = 0;
		for (i = 0; i < n ; i++)
		{
			rtw_list_delete(&precvbuf->list);
			rtw_os_recvbuf_resource_free(padapter, precvbuf);
			freerecvbuf(precvbuf);
			precvbuf++;
//.........这里部分代码省略.........
开发者ID:ItsAnilSingh,项目名称:android_kernel_samsung_logan2g,代码行数:101,代码来源:rtl8723as_recv.c


示例12: rtl8192du_xmitframe_complete

s32 rtl8192du_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
{
	HAL_DATA_TYPE	*pHalData = GET_HAL_DATA(padapter);
	struct xmit_frame *pxmitframe = NULL;
	struct xmit_frame *pfirstframe = NULL;

	// aggregate variable
	struct hw_xmit	*phwxmit = pxmitpriv->hwxmits;
	struct tx_servq	*ptxservq = NULL;

	_irqL irqL;
	_list *xmitframe_plist = NULL, *xmitframe_phead = NULL;

	u32	pbuf=0; // next pkt address
	u32	pbuf_tail; // last pkt tail
	u32	len=0; //packet length, except TXDESC_SIZE and PKT_OFFSET
	u32	aggMaxLength = MAX_XMITBUF_SZ;
	u32	bulkSize = pHalData->UsbBulkOutSize;
	u32	bulkPtr=0;
	u8	descCount=0;
	u8	ac_index;
	u8	bfirst = _TRUE;//first aggregation xmitframe
	u8	bulkstart = _FALSE;

	// dump frame variable
	u32 ff_hwaddr;

#ifndef IDEA_CONDITION
	int res = _SUCCESS;
#endif

	RT_TRACE(_module_rtl8192c_xmit_c_, _drv_info_, ("+xmitframe_complete\n"));

	// check xmitbuffer is ok
	if (pxmitbuf == NULL) {
		pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
		if (pxmitbuf == NULL) return _FALSE;
	}

	if(pHalData->MacPhyMode92D==SINGLEMAC_SINGLEPHY)
		aggMaxLength = MAX_XMITBUF_SZ;
	else
		aggMaxLength = 0x3D00;

	do {
		//3 1. pick up first frame
		if(bfirst)
		{
			pxmitframe = rtw_dequeue_xframe(pxmitpriv, pxmitpriv->hwxmits, pxmitpriv->hwxmit_entry);
			if (pxmitframe == NULL) {
				// no more xmit frame, release xmit buffer
				rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
				return _FALSE;
			}

			pxmitframe->pxmitbuf = pxmitbuf;
			pxmitframe->buf_addr = pxmitbuf->pbuf;
			pxmitbuf->priv_data = pxmitframe;

			//pxmitframe->agg_num = 1; // alloc xmitframe should assign to 1.
			pxmitframe->pkt_offset = USB_92D_DUMMY_OFFSET; // first frame of aggregation, reserve 2 offset for 512 alignment and early mode

			pfirstframe = pxmitframe;
			_enter_critical_bh(&pxmitpriv->lock, &irqL);
			ptxservq = rtw_get_sta_pending(padapter, pfirstframe->attrib.psta, pfirstframe->attrib.priority, (u8 *)(&ac_index));
			_exit_critical_bh(&pxmitpriv->lock, &irqL);
		}
		//3 2. aggregate same priority and same DA(AP or STA) frames
		else
		{
			// dequeue same priority packet from station tx queue
			_enter_critical_bh(&pxmitpriv->lock, &irqL);

			if (_rtw_queue_empty(&ptxservq->sta_pending) == _FALSE)
			{
				xmitframe_phead = get_list_head(&ptxservq->sta_pending);
				xmitframe_plist = get_next(xmitframe_phead);

				pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);


				len = xmitframe_need_length(pxmitframe) + TXDESC_SIZE + ((USB_92D_DUMMY_OFFSET - 1) * PACKET_OFFSET_SZ);
				if (pbuf + _RND8(len) > aggMaxLength)
				{
					bulkstart = _TRUE;
				}
				else
				{
					rtw_list_delete(&pxmitframe->list);
					ptxservq->qcnt--;
					phwxmit[ac_index].accnt--;

					//Remove sta node when there is no pending packets.
					if (_rtw_queue_empty(&ptxservq->sta_pending) == _TRUE)
						rtw_list_delete(&ptxservq->tx_pending);
				}
			}
			else
			{
				bulkstart = _TRUE;
//.........这里部分代码省略.........
开发者ID:davidftv,项目名称:s82_kernel,代码行数:101,代码来源:rtl8192du_xmit.c


示例13: rtl8192cu_xmitframe_complete


//.........这里部分代码省略.........

		case 4:
		case 5:
			ptxservq = &(psta->sta_xmitpriv.vi_q);
			phwxmit = pxmitpriv->hwxmits + 1;
			break;

		case 6:
		case 7:
			ptxservq = &(psta->sta_xmitpriv.vo_q);
			phwxmit = pxmitpriv->hwxmits;
			break;

		case 0:
		case 3:
		default:
			ptxservq = &(psta->sta_xmitpriv.be_q);
			phwxmit = pxmitpriv->hwxmits + 2;
			break;
	}

	_enter_critical_bh(&pxmitpriv->lock, &irqL);

	xmitframe_phead = get_list_head(&ptxservq->sta_pending);
	xmitframe_plist = get_next(xmitframe_phead);
	while (rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist) == _FALSE)
	{
		pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
		xmitframe_plist = get_next(xmitframe_plist);

		len = xmitframe_need_length(pxmitframe) + TXDESC_SIZE; // no offset
		if (pbuf + len > MAX_XMITBUF_SZ) break;

		rtw_list_delete(&pxmitframe->list);
		ptxservq->qcnt--;
		phwxmit->accnt--;

#ifndef IDEA_CONDITION
		// suppose only data frames would be in queue
		if (pxmitframe->frame_tag != DATA_FRAMETAG) {
			RT_TRACE(_module_rtl8192c_xmit_c_, _drv_err_,
				 ("xmitframe_complete: frame tag(%d) is not DATA_FRAMETAG(%d)!\n",
				  pxmitframe->frame_tag, DATA_FRAMETAG));
			rtw_free_xmitframe(pxmitpriv, pxmitframe);
			continue;
		}

		// TID 0~15
		if ((pxmitframe->attrib.priority < 0) ||
		    (pxmitframe->attrib.priority > 15)) {
			RT_TRACE(_module_rtl8192c_xmit_c_, _drv_err_,
				 ("xmitframe_complete: TID(%d) should be 0~15!\n",
				  pxmitframe->attrib.priority));
			rtw_free_xmitframe(pxmitpriv, pxmitframe);
			continue;
		}
#endif

//		pxmitframe->pxmitbuf = pxmitbuf;
		pxmitframe->buf_addr = pxmitbuf->pbuf + pbuf;

		pxmitframe->agg_num = 0; // not first frame of aggregation
		pxmitframe->pkt_offset = 0; // not first frame of aggregation, no need to reserve offset

#ifdef IDEA_CONDITION
		rtw_xmitframe_coalesce(padapter, pxmitframe->pkt, pxmitframe);
开发者ID:32743069,项目名称:amlogic_common_3050,代码行数:67,代码来源:rtl8192cu_xmit.c


示例14: xmit_xmitframes


//.........这里部分代码省略.........
                            rtl8723b_update_txdesc(pframe, pframe->buf_addr);
                            rtw_free_xmitframe(pxmitpriv, pframe);
                            pxmitbuf->priv_data = NULL;
                            enqueue_pending_xmitbuf(pxmitpriv, pxmitbuf);
                            //can not yield under lock
                            //rtw_yield_os();
                        } else {
                            rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
                        }
                    }

                    pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
                    if (pxmitbuf == NULL) {
#ifdef DBG_XMIT_BUF
                        DBG_871X_LEVEL(_drv_err_, "%s: xmit_buf is not enough!\n", __FUNCTION__);
#endif
                        err = -2;
                        break;
                    }
                    k = 0;
                }

                // ok to send, remove frame from queue
#ifdef CONFIG_AP_MODE
                if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == _TRUE) {
                    if ((pxmitframe->attrib.psta->state & WIFI_SLEEP_STATE) &&
                            (pxmitframe->attrib.triggered == 0)) {
                        DBG_871X("%s: one not triggered pkt in queue when this STA sleep,"
                                 " break and goto next sta\n", __func__);
                        break;
                    }
                }
#endif
                rtw_list_delete(&pxmitframe->list);
                ptxservq->qcnt--;
                phwxmit->accnt--;

                if (k == 0) {
                    pxmitbuf->ff_hwaddr = rtw_get_ff_hwaddr(pxmitframe);
                    pxmitbuf->priv_data = (u8*)pxmitframe;
                }

                // coalesce the xmitframe to xmitbuf
                pxmitframe->pxmitbuf = pxmitbuf;
                pxmitframe->buf_addr = pxmitbuf->ptail;

                ret = rtw_xmitframe_coalesce(padapter, pxmitframe->pkt, pxmitframe);
                if (ret == _FAIL) {
                    DBG_871X_LEVEL(_drv_err_, "%s: coalesce FAIL!", __FUNCTION__);
                    // Todo: error handler
                } else {
                    k++;
                    if (k != 1)
                        rtl8723b_update_txdesc(pxmitframe, pxmitframe->buf_addr);
                    rtw_count_tx_stats(padapter, pxmitframe, pxmitframe->attrib.last_txcmdsz);

                    txlen = txdesc_size + pxmitframe->attrib.last_txcmdsz;
                    pxmitframe->pg_num = (txlen + 127)/128;
                    pxmitbuf->pg_num += (txlen + 127)/128;
                    //if (k != 1)
                    //	((struct xmit_frame*)pxmitbuf->priv_data)->pg_num += pxmitframe->pg_num;
                    pxmitbuf->ptail += _RND(txlen, 8); // round to 8 bytes alignment
                    pxmitbuf->len = _RND(pxmitbuf->len, 8) + txlen;
                }

                if (k != 1)
开发者ID:avila-devlogic,项目名称:D33_KK_Kernel,代码行数:67,代码来源:rtl8723bs_xmit.c


示例15: rtw_free_stainfo

// using pstapriv->sta_hash_lock to protect
u32	rtw_free_stainfo(_adapter *padapter , struct sta_info *psta)
{
    int i;
    _irqL irqL0;
    _queue *pfree_sta_queue;
    struct recv_reorder_ctrl *preorder_ctrl;
    struct	sta_xmit_priv	*pstaxmitpriv;
    struct	xmit_priv	*pxmitpriv= &padapter->xmitpriv;
    struct	sta_priv *pstapriv = &padapter->stapriv;


    _func_enter_;

    if (psta == NULL)
        goto exit;

    pfree_sta_queue = &pstapriv->free_sta_queue;


    pstaxmitpriv = &psta->sta_xmitpriv;

    //rtw_list_delete(&psta->sleep_list);

    //rtw_list_delete(&psta->wakeup_list);

    rtw_free_xmitframe_queue(pxmitpriv, &psta->sleep_q);
    psta->sleepq_len = 0;

    _enter_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0);

    rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vo_q.sta_pending);

    rtw_list_delete(&(pstaxmitpriv->vo_q.tx_pending));

    _exit_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0);


    _enter_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0);

    rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vi_q.sta_pending);

    rtw_list_delete(&(pstaxmitpriv->vi_q.tx_pending));

    _exit_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0);


    _enter_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0);

    rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->bk_q.sta_pending);

    rtw_list_delete(&(pstaxmitpriv->bk_q.tx_pending));

    _exit_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0);

    _enter_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0);

    rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->be_q.sta_pending);

    rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending));

    _exit_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0);


    rtw_list_delete(&psta->hash_list);
    RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("\n free number_%d stainfo  with hwaddr = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x  \n",pstapriv->asoc_sta_count , psta->hwaddr[0], psta->hwaddr[1], psta->hwaddr[2],psta->hwaddr[3],psta->hwaddr[4],psta->hwaddr[5]));
    pstapriv->asoc_sta_count --;


    // re-init sta_info; 20061114
    _rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
    _rtw_init_sta_recv_priv(&psta->sta_recvpriv);

    _cancel_timer_ex(&psta->addba_retry_timer);

#ifdef CONFIG_TDLS
    _cancel_timer_ex(&psta->TPK_timer);
    _cancel_timer_ex(&psta->option_timer);
    _cancel_timer_ex(&psta->base_ch_timer);
    _cancel_timer_ex(&psta->off_ch_timer);
#endif

    //for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer
    for(i=0; i < 16 ; i++)
    {
        preorder_ctrl = &psta->recvreorder_ctrl[i];

        _cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
    }


#ifdef CONFIG_AP_MODE

    rtw_list_delete(&psta->asoc_list);
    rtw_list_delete(&psta->auth_list);
    psta->expire_to = 0;

    psta->sleepq_ac_len = 0;
    psta->qos_info = 0;

//.........这里部分代码省略.........
开发者ID:riteshSTPL,项目名称:buildroot-linux-kernel-m3,代码行数:101,代码来源:rtw_sta_mgt.c


示例16: _enter_critical_bh

//struct	sta_info *rtw_alloc_stainfo(_queue *pfree_sta_queue, unsigned char *hwaddr)
struct	sta_info *rtw_alloc_stainfo(struct	sta_priv *pstapriv, u8 *hwaddr) 
{	
	_irqL irqL, irqL2;
	uint tmp_aid;
	s32	index;
	_list	*phash_list;
	struct sta_info	*psta;
	_queue *pfree_sta_queue;
	struct recv_reorder_ctrl *preorder_ctrl;
	int i = 0;
	u16  wRxSeqInitialValue = 0xffff;
	
_func_enter_;	

	pfree_sta_queue = &pstapriv->free_sta_queue;

	//_enter_critical_bh(&(pfree_sta_queue->lock), &irqL);
	_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
	if (_rtw_queue_empty(pfree_sta_queue) == _TRUE)
	{
		//_exit_critical_bh(&(pfree_sta_queue->lock), &irqL);
		_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
		psta = NULL;
	}
	else
	{
		psta = LIST_CONTAINOR(get_next(&pfree_sta_queue->queue), struct sta_info, list);
		
		rtw_list_delete(&(psta->list));

		//_exit_critical_bh(&(pfree_sta_queue->lock), &irqL);
		
		tmp_aid = psta->aid;	
	
		_rtw_init_stainfo(psta);

		psta->padapter = pstapriv->padapter;

		_rtw_memcpy(psta->hwaddr, hwaddr, ETH_ALEN);

		index = wifi_mac_hash(hwaddr);

		RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("rtw_alloc_stainfo: index  = %x", index));

		if(index >= NUM_STA){
			RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("ERROR=> rtw_alloc_stainfo: index >= NUM_STA"));
			psta= NULL;	
			goto exit;
		}
		phash_list = &(pstapriv->sta_hash[index]);

		//_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);

		rtw_list_insert_tail(&psta->hash_list, phash_list);

		pstapriv->asoc_sta_count ++ ;

		//_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);

// Commented by Albert 2009/08/13
// For the SMC router, the sequence number of first packet of WPS handshake will be 0.
// In this case, this packet will be dropped by recv_decache function if we use the 0x00 as the default value for tid_rxseq variable.
// So, we initialize the tid_rxseq variable as the 0xffff.

		for( i = 0; i < 16; i++ )
		{
                     _rtw_memcpy( &psta->sta_recvpriv.rxcache.tid_rxseq[ i ], &wRxSeqInitialValue, 2 );
		}

		RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("alloc number_%d stainfo  with hwaddr = %x %x %x %x %x %x  \n", 
		pstapriv->asoc_sta_count , hwaddr[0], hwaddr[1], hwaddr[2],hwaddr[3],hwaddr[4],hwaddr[5]));

		init_addba_retry_timer(pstapriv->padapter, psta);
#ifdef CONFIG_IEEE80211W
		init_dot11w_expire_timer(pstapriv->padapter, psta);
#endif /* CONFIG_IEEE80211W */
#ifdef CONFIG_TDLS
		rtw_init_tdls_timer(pstapriv->padapter, psta);
#endif //CONFIG_TDLS

		//for A-MPDU Rx reordering buffer control
		for(i=0; i < 16 ; i++)
		{
			preorder_ctrl = &psta->recvreorder_ctrl[i];

			preorder_ctrl->padapter = pstapriv->padapter;
		
			preorder_ctrl->enable = _FALSE;
		
			preorder_ctrl->indicate_seq = 0xffff;
			#ifdef DBG_RX_SEQ
			DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d\n", __FUNCTION__, __LINE__,
				preorder_ctrl->indicate_seq);
			#endif
			preorder_ctrl->wend_b= 0xffff;       
			//preorder_ctrl->wsize_b = (NR_RECVBUFF-2);
			preorder_ctrl->wsize_b = 64;//64;
			preorder_ctrl->ampdu_size = RX_AMPDU_SIZE_INVALID;

//.........这里部分代码省略.........
开发者ID:AOSC-Dev,项目名称:aosc-os-armel-sunxi-boot,代码行数:101,代码来源:rtw_sta_mgt.c


示例17: rtw_free_stainfo

/*  using pstapriv->sta_hash_lock to protect */
u32	rtw_free_stainfo(_adapter *padapter , struct sta_info *psta)
{
	int i;
	unsigned long irqL0;
	struct __queue *pfree_sta_queue;
	struct recv_reorder_ctrl *preorder_ctrl;
	struct	sta_xmit_priv	*pstaxmitpriv;
	struct	xmit_priv	*pxmitpriv= &padapter->xmitpriv;
	struct	sta_priv *pstapriv = &padapter->stapriv;


_func_enter_;

	if (psta == NULL)
		goto exit;

	pfree_sta_queue = &pstapriv->free_sta_queue;


	pstaxmitpriv = &psta->sta_xmitpriv;

	_enter_critical_bh(&pxmitpriv->lock, &irqL0);

	rtw_free_xmitframe_queue(pxmitpriv, &psta->sleep_q);
	psta->sleepq_len = 0;

	rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vo_q.sta_pending);

	rtw_list_delete(&(pstaxmitpriv->vo_q.tx_pending));

	rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vi_q.sta_pending);

	rtw_list_delete(&(pstaxmitpriv->vi_q.tx_pending));

	rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->bk_q.sta_pending);

	rtw_list_delete(&(pstaxmitpriv->bk_q.tx_pending));

	rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->be_q.sta_pending);

	rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending));

	_exit_critical_bh(&pxmitpriv->lock, &irqL0);

	rtw_list_delete(&psta->hash_list);
	RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("\n free number_%d stainfo  with hwaddr = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x\n",pstapriv->asoc_sta_count , psta->hwaddr[0], psta->hwaddr[1], psta->hwaddr[2],psta->hwaddr[3],psta->hwaddr[4],psta->hwaddr[5]));
	pstapriv->asoc_sta_count --;

	/*  re-init sta_info; 20061114 */
	_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
	_rtw_init_sta_recv_priv(&psta->sta_recvpriv);

	_cancel_timer_ex(&psta->addba_retry_timer);

	/* for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer */
	for (i=0; i < 16 ; i++)
	{
		unsigned long irqL;
		struct list_head *phead, *plist;
		union recv_frame *prframe;
		struct __queue *ppending_recvframe_queue;
		struct __queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;

		preorder_ctrl = &psta->recvreorder_ctrl[i];

		_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);


		ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;

		_enter_critical_bh(&ppending_recvframe_queue->lock, &irqL);

		phead =		get_list_head(ppending_recvframe_queue);
		plist = get_next(phead);

		while (!rtw_is_list_empty(phead))
		{
			prframe = LIST_CONTAINOR(plist, union recv_frame, u);

			plist = get_next(plist);

			rtw_list_delete(&(prframe->u.hdr.list));

			rtw_free_recvframe(prframe, pfree_recv_queue);
		}

		_exit_critical_bh(&ppending_recvframe_queue->lock, &irqL);

	}

	if (!(psta->state & WIFI_AP_STATE))
		rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, false);

#ifdef CONFIG_AP_MODE

	_enter_critical_bh(&pstapriv->auth_list_lock, &irqL0);
	if (!rtw_is_list_empty(&psta->auth_list)) {
		rtw_list_delete(&psta->auth_list);
		pstapriv->auth_list_cnt--;
//.........这里部分代码省略.........
开发者ID:morphis,项目名称:rtl8188eu,代码行数:101,代码来源:rtw_sta_mgt.c


示例18: rtl8188eu_xmitframe_complete


//.........这里部分代码省略.........
		phwxmit = pxmitpriv->hwxmits + 1;
		break;
	case 6:
	case 7:
		ptxservq = &(psta->sta_xmitpriv.vo_q);
		phwxmit = pxmitpriv->hwxmits;
		break;
	case 0:
	case 3:
	default:
		ptxservq = &(psta->sta_xmitpriv.be_q);
		phwxmit = pxmitpriv->hwxmits + 2;
		break;
	}
	_enter_critical_bh(&pxmitpriv->lock, &irql);

	xmitframe_phead = get_list_head(&ptxservq->sta_pending);
	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);
		xmitframe_plist = get_next(xmitframe_plist);

		pxmitframe->agg_num = 0; /*  not first frame of aggregation */
		pxmitframe->pkt_offset = 0; /*  not first frame of aggregation, no need to reserve offset */

		len = xmitframe_need_length(pxmitframe) + TXDESC_SIZE + (pxmitframe->pkt_offset*PACKET_OFFSET_SZ);

		if (_RND8(pbuf + len) > MAX_XMITBUF_SZ) {
			pxmitframe->agg_num = 1;
			pxmitframe->pkt_offset = 1;
			break;
		}
		rtw_list_delete(&pxmitframe->list);
		ptxservq->qcnt--;
		phwxmit->accnt--;

		pxmitframe->buf_addr = pxmitbuf->pbuf + pbuf;

		rtw_xmitframe_coalesce(adapt, pxmitframe->pkt, pxmitframe);
		/*  always return ndis_packet after rtw_xmitframe_coalesce */
		rtw_os_xmit_complete(adapt, pxmitframe);

		/*  (len - TXDESC_SIZE) == pxmitframe->attrib.last_txcmdsz */
		update_txdesc(pxmitframe, pxmitframe->buf_addr, pxmitframe->attrib.last_txcmdsz, true);

		/*  don't need xmitframe any more */
		rtw_free_xmitframe(pxmitpriv, pxmitframe);

		/*  handle pointer and stop condition */
		pbuf_tail = pbuf + len;
		pbuf = _RND8(pbuf_tail);

		pfirstframe->agg_num++;
		if (MAX_TX_AGG_PACKET_NUMBER == pfirstframe->agg_num)
			break;

		if (pbuf < bulkptr) {
			desc_cnt++;
			if (desc_cnt == haldata->UsbTxAggDescNum)
				break;
		} else {
			desc_cnt = 0;
			bulkptr = ((pbuf / bulksize) + 1) * bulksize;
		}
	} /* end while (aggregate same priority and same DA(AP or STA) frames) */
开发者ID:zhouqt,项目名称:rtl8188eu,代码行数:67,代码来源:rtl8188eu_xmit.c


示例19: _enter_critical_bh

struct	sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
{
	unsigned long irqL, irqL2;
	s32	index;
	struct list_head *phash_list;
	struct sta_info	*psta;
	struct __queue *pfree_sta_queue;
	struct recv_reorder_ctrl *preorder_ctrl;
	int i = 0;
	u16  wRxSeqInitialValue = 0xffff;

_func_enter_;

	pfree_sta_queue = &pstapriv->free_sta_queue;

	_enter_critical_bh(&(pfree_sta_queue->lock), &irqL);

	if (_rtw_queue_empty(pfree_sta_queue) == true) {
		_exit_critical_bh(&(pfree_sta_queue->lock), &irqL);
		psta = NULL;
	} else {
		psta = LIST_CONTAINOR(get_next(&pfree_sta_queue->queue), struct sta_info, list);
		rtw_list_delete(&(psta->list));
		_exit_critical_bh(&(pfree_sta_queue->lock), &irqL);
		_rtw_init_stainfo(psta);
		_rtw_memcpy(psta->hwaddr, hwaddr, ETH_ALEN);
		index = wifi_mac_hash(hwaddr);
		RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("rtw_alloc_stainfo: index  = %x", index));
		if (index >= NUM_STA) {
			RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("ERROR=> rtw_alloc_stainfo: index >= NUM_STA"));
			psta= NULL;
			goto exit;
		}
		phash_list = &(pstapriv->sta_hash[index]);

		_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);

		rtw_list_insert_tail(&psta->hash_list, phash_list);

		pstapriv->asoc_sta_count ++ ;

		_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);

/*  Commented by Albert 2009/08/13 */
/*  For the SMC router, the sequence number of first packet of WPS handshake will be 0. */
/*  In this case, this packet will be dropped by recv_decache function if we use the 0x00 as the default value for tid_rxseq variable. */
/*  So, we initialize the tid_rxseq variable as the 0xffff. */

		for ( i = 0; i < 16; i++ )
		{
                     _rtw_memcpy( &psta->sta_recvpriv.rxcache.tid_rxseq[ i ], &wRxSeqInitialValue, 2 );
		}

		RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("alloc number_%d stainfo  with hwaddr = %x %x %x %x %x %x\n",
		pstapriv->asoc_sta_count , hwaddr[0], hwaddr[1], hwaddr[2],hwaddr[3],hwaddr[4],hwaddr[5]));

		init_addba_retry_timer(pstapriv->padapter, psta);

		/* for A-MPDU Rx reordering buffer control */
		for (i=0; i < 16 ; i++)
		{
			preorder_ctrl = &psta->recvreorder_ctrl[i];

			preorder_ctrl->padapter = pstapriv->padapter;

			preorder_ctrl->enable = false;

			preorder_ctrl->indicate_seq = 0xffff;
			preorder_ctrl->wend_b= 0xffff;
			preorder_ctrl->wsize_b = 64;/* 64; */

			_rtw_init_queue(&preorder_ctrl->pending_recvframe_queue);

			rtw_init_recv_timer(preorder_ctrl);
		}


		/* init for DM */
		psta->rssi_stat.UndecoratedSmoothedPWDB = (-1);
		psta->rssi_stat.UndecoratedSmoothedCCK = (-1);

		/* init for the sequence number of received management frame */
		psta->RxMgmtFrameSeqNum = 0xffff;
	}

exit:

_func_exit_;

	return psta;


}
开发者ID:morphis,项目名称:rtl8188eu,代码行数:93,代码来源:rtw_sta_mgt.c


示例20: xmit_xmitframes

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ rtw_malloc函数代码示例发布时间:2022-05-30
下一篇:
C++ rtw_led_control函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap