1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 ******************************************************************************/
20 #define _RTW_STA_MGT_C_
23 #include <osdep_service.h>
24 #include <drv_types.h>
25 #include <recv_osdep.h>
26 #include <xmit_osdep.h>
27 #include <mlme_osdep.h>
30 #if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
32 #error "Shall be Linux or Windows, but not both!\n"
38 void _rtw_init_stainfo(struct sta_info *psta);
39 void _rtw_init_stainfo(struct sta_info *psta)
44 _rtw_memset((u8 *)psta, 0, sizeof (struct sta_info));
46 _rtw_spinlock_init(&psta->lock);
47 _rtw_init_listhead(&psta->list);
48 _rtw_init_listhead(&psta->hash_list);
49 //_rtw_init_listhead(&psta->asoc_list);
50 //_rtw_init_listhead(&psta->sleep_list);
51 //_rtw_init_listhead(&psta->wakeup_list);
53 _rtw_init_queue(&psta->sleep_q);
56 _rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
57 _rtw_init_sta_recv_priv(&psta->sta_recvpriv);
61 _rtw_init_listhead(&psta->asoc_list);
63 _rtw_init_listhead(&psta->auth_list);
71 psta->bpairwise_key_installed = _FALSE;
74 #ifdef CONFIG_NATIVEAP_MLME
76 psta->no_short_slot_time_set = 0;
77 psta->no_short_preamble_set = 0;
78 psta->no_ht_gf_set = 0;
80 psta->ht_20mhz_set = 0;
83 #ifdef CONFIG_TX_MCAST2UNI
84 psta->under_exist_checking = 0;
85 #endif // CONFIG_TX_MCAST2UNI
87 psta->keep_alive_trycnt = 0;
89 #endif // CONFIG_AP_MODE
95 u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
97 struct sta_info *psta;
102 pstapriv->pallocated_stainfo_buf = rtw_zvmalloc (sizeof(struct sta_info) * NUM_STA+ 4);
104 if(!pstapriv->pallocated_stainfo_buf)
107 pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 -
108 ((SIZE_PTR)(pstapriv->pallocated_stainfo_buf ) & 3);
110 _rtw_init_queue(&pstapriv->free_sta_queue);
112 _rtw_spinlock_init(&pstapriv->sta_hash_lock);
114 //_rtw_init_queue(&pstapriv->asoc_q);
115 pstapriv->asoc_sta_count = 0;
116 _rtw_init_queue(&pstapriv->sleep_q);
117 _rtw_init_queue(&pstapriv->wakeup_q);
119 psta = (struct sta_info *)(pstapriv->pstainfo_buf);
122 for(i = 0; i < NUM_STA; i++)
124 _rtw_init_stainfo(psta);
126 _rtw_init_listhead(&(pstapriv->sta_hash[i]));
128 rtw_list_insert_tail(&psta->list, get_list_head(&pstapriv->free_sta_queue));
135 #ifdef CONFIG_AP_MODE
137 pstapriv->sta_dz_bitmap = 0;
138 pstapriv->tim_bitmap = 0;
140 _rtw_init_listhead(&pstapriv->asoc_list);
141 _rtw_init_listhead(&pstapriv->auth_list);
142 _rtw_spinlock_init(&pstapriv->asoc_list_lock);
143 _rtw_spinlock_init(&pstapriv->auth_list_lock);
144 pstapriv->asoc_list_cnt = 0;
145 pstapriv->auth_list_cnt = 0;
147 pstapriv->auth_to = 3; // 3*2 = 6 sec
148 pstapriv->assoc_to = 3;
149 //pstapriv->expire_to = 900;// 900*2 = 1800 sec = 30 min, expire after no any traffic.
150 //pstapriv->expire_to = 30;// 30*2 = 60 sec = 1 min, expire after no any traffic.
151 #ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
152 pstapriv->expire_to = 3; // 3*2 = 6 sec
154 pstapriv->expire_to = 60;// 60*2 = 120 sec = 2 min, expire after no any traffic.
156 pstapriv->max_num_sta = NUM_STA;
166 inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta)
168 int offset = (((u8 *)sta) - stapriv->pstainfo_buf)/sizeof(struct sta_info);
170 if (!stainfo_offset_valid(offset))
171 DBG_871X("%s invalid offset(%d), out of range!!!", __func__, offset);
176 inline struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int offset)
178 if (!stainfo_offset_valid(offset))
179 DBG_871X("%s invalid offset(%d), out of range!!!", __func__, offset);
181 return (struct sta_info *)(stapriv->pstainfo_buf + offset * sizeof(struct sta_info));
184 void _rtw_free_sta_xmit_priv_lock(struct sta_xmit_priv *psta_xmitpriv);
185 void _rtw_free_sta_xmit_priv_lock(struct sta_xmit_priv *psta_xmitpriv)
189 _rtw_spinlock_free(&psta_xmitpriv->lock);
191 _rtw_spinlock_free(&(psta_xmitpriv->be_q.sta_pending.lock));
192 _rtw_spinlock_free(&(psta_xmitpriv->bk_q.sta_pending.lock));
193 _rtw_spinlock_free(&(psta_xmitpriv->vi_q.sta_pending.lock));
194 _rtw_spinlock_free(&(psta_xmitpriv->vo_q.sta_pending.lock));
198 static void _rtw_free_sta_recv_priv_lock(struct sta_recv_priv *psta_recvpriv)
202 _rtw_spinlock_free(&psta_recvpriv->lock);
204 _rtw_spinlock_free(&(psta_recvpriv->defrag_q.lock));
210 void rtw_mfree_stainfo(struct sta_info *psta);
211 void rtw_mfree_stainfo(struct sta_info *psta)
215 if(&psta->lock != NULL)
216 _rtw_spinlock_free(&psta->lock);
218 _rtw_free_sta_xmit_priv_lock(&psta->sta_xmitpriv);
219 _rtw_free_sta_recv_priv_lock(&psta->sta_recvpriv);
225 // this function is used to free the memory of lock || sema for all stainfos
226 void rtw_mfree_all_stainfo(struct sta_priv *pstapriv );
227 void rtw_mfree_all_stainfo(struct sta_priv *pstapriv )
230 _list *plist, *phead;
231 struct sta_info *psta = NULL;
235 _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
237 phead = get_list_head(&pstapriv->free_sta_queue);
238 plist = get_next(phead);
240 while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
242 psta = LIST_CONTAINOR(plist, struct sta_info ,list);
243 plist = get_next(plist);
245 rtw_mfree_stainfo(psta);
248 _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
254 void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv);
255 void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv)
257 #ifdef CONFIG_AP_MODE
258 struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
261 rtw_mfree_all_stainfo(pstapriv); //be done before free sta_hash_lock
263 _rtw_spinlock_free(&pstapriv->free_sta_queue.lock);
265 _rtw_spinlock_free(&pstapriv->sta_hash_lock);
266 _rtw_spinlock_free(&pstapriv->wakeup_q.lock);
267 _rtw_spinlock_free(&pstapriv->sleep_q.lock);
269 #ifdef CONFIG_AP_MODE
270 _rtw_spinlock_free(&pstapriv->asoc_list_lock);
271 _rtw_spinlock_free(&pstapriv->auth_list_lock);
272 _rtw_spinlock_free(&pacl_list->acl_node_q.lock);
277 u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
280 _list *phead, *plist;
281 struct sta_info *psta = NULL;
282 struct recv_reorder_ctrl *preorder_ctrl;
288 /* delete all reordering_ctrl_timer */
289 _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
290 for(index = 0; index < NUM_STA; index++)
292 phead = &(pstapriv->sta_hash[index]);
293 plist = get_next(phead);
295 while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
298 psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list);
299 plist = get_next(plist);
301 for(i=0; i < 16 ; i++)
303 preorder_ctrl = &psta->recvreorder_ctrl[i];
304 _cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
308 _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
309 /*===============================*/
311 rtw_mfree_sta_priv_lock(pstapriv);
313 if(pstapriv->pallocated_stainfo_buf) {
314 rtw_vmfree(pstapriv->pallocated_stainfo_buf, sizeof(struct sta_info)*NUM_STA+4);
323 //struct sta_info *rtw_alloc_stainfo(_queue *pfree_sta_queue, unsigned char *hwaddr)
324 struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
330 struct sta_info *psta;
331 _queue *pfree_sta_queue;
332 struct recv_reorder_ctrl *preorder_ctrl;
334 u16 wRxSeqInitialValue = 0xffff;
338 pfree_sta_queue = &pstapriv->free_sta_queue;
340 //_enter_critical_bh(&(pfree_sta_queue->lock), &irqL);
341 _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
343 if (_rtw_queue_empty(pfree_sta_queue) == _TRUE)
345 //_exit_critical_bh(&(pfree_sta_queue->lock), &irqL);
346 _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
351 psta = LIST_CONTAINOR(get_next(&pfree_sta_queue->queue), struct sta_info, list);
353 rtw_list_delete(&(psta->list));
355 //_exit_critical_bh(&(pfree_sta_queue->lock), &irqL);
359 _rtw_init_stainfo(psta);
361 _rtw_memcpy(psta->hwaddr, hwaddr, ETH_ALEN);
363 index = wifi_mac_hash(hwaddr);
365 RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("rtw_alloc_stainfo: index = %x", index));
367 if(index >= NUM_STA){
368 RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("ERROR=> rtw_alloc_stainfo: index >= NUM_STA"));
372 phash_list = &(pstapriv->sta_hash[index]);
374 //_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
376 rtw_list_insert_tail(&psta->hash_list, phash_list);
378 pstapriv->asoc_sta_count ++ ;
380 //_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
382 // Commented by Albert 2009/08/13
383 // For the SMC router, the sequence number of first packet of WPS handshake will be 0.
384 // 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.
385 // So, we initialize the tid_rxseq variable as the 0xffff.
387 for( i = 0; i < 16; i++ )
389 _rtw_memcpy( &psta->sta_recvpriv.rxcache.tid_rxseq[ i ], &wRxSeqInitialValue, 2 );
392 RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("alloc number_%d stainfo with hwaddr = %x %x %x %x %x %x \n",
393 pstapriv->asoc_sta_count , hwaddr[0], hwaddr[1], hwaddr[2],hwaddr[3],hwaddr[4],hwaddr[5]));
395 init_addba_retry_timer(pstapriv->padapter, psta);
398 psta->padapter = pstapriv->padapter;
399 init_TPK_timer(pstapriv->padapter, psta);
400 init_ch_switch_timer(pstapriv->padapter, psta);
401 init_base_ch_timer(pstapriv->padapter, psta);
402 init_off_ch_timer(pstapriv->padapter, psta);
403 init_handshake_timer(pstapriv->padapter, psta);
404 init_tdls_alive_timer(pstapriv->padapter, psta);
407 //for A-MPDU Rx reordering buffer control
408 for(i=0; i < 16 ; i++)
410 preorder_ctrl = &psta->recvreorder_ctrl[i];
412 preorder_ctrl->padapter = pstapriv->padapter;
414 preorder_ctrl->enable = _FALSE;
416 preorder_ctrl->indicate_seq = 0xffff;
418 DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d\n", __FUNCTION__, __LINE__,
419 preorder_ctrl->indicate_seq);
421 preorder_ctrl->wend_b= 0xffff;
422 //preorder_ctrl->wsize_b = (NR_RECVBUFF-2);
423 preorder_ctrl->wsize_b = 64;//64;
425 _rtw_init_queue(&preorder_ctrl->pending_recvframe_queue);
427 rtw_init_recv_timer(preorder_ctrl);
432 psta->rssi_stat.UndecoratedSmoothedPWDB = 0;
433 psta->rssi_stat.UndecoratedSmoothedCCK = (-1);
435 /* init for the sequence number of received management frame */
436 psta->RxMgmtFrameSeqNum = 0xffff;
441 _exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
451 // using pstapriv->sta_hash_lock to protect
452 u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta)
456 _queue *pfree_sta_queue;
457 struct recv_reorder_ctrl *preorder_ctrl;
458 struct sta_xmit_priv *pstaxmitpriv;
459 struct xmit_priv *pxmitpriv= &padapter->xmitpriv;
460 struct sta_priv *pstapriv = &padapter->stapriv;
461 struct hw_xmit *phwxmit;
470 _enter_critical_bh(&psta->lock, &irqL0);
471 psta->state &= ~_FW_LINKED;
472 _exit_critical_bh(&psta->lock, &irqL0);
474 pfree_sta_queue = &pstapriv->free_sta_queue;
477 pstaxmitpriv = &psta->sta_xmitpriv;
479 //rtw_list_delete(&psta->sleep_list);
481 //rtw_list_delete(&psta->wakeup_list);
483 _enter_critical_bh(&pxmitpriv->lock, &irqL0);
485 rtw_free_xmitframe_queue(pxmitpriv, &psta->sleep_q);
486 psta->sleepq_len = 0;
489 //_enter_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0);
490 rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vo_q.sta_pending);
491 rtw_list_delete(&(pstaxmitpriv->vo_q.tx_pending));
492 phwxmit = pxmitpriv->hwxmits;
493 phwxmit->accnt -= pstaxmitpriv->vo_q.qcnt;
494 pstaxmitpriv->vo_q.qcnt = 0;
495 //_exit_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0);
498 //_enter_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0);
499 rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vi_q.sta_pending);
500 rtw_list_delete(&(pstaxmitpriv->vi_q.tx_pending));
501 phwxmit = pxmitpriv->hwxmits+1;
502 phwxmit->accnt -= pstaxmitpriv->vi_q.qcnt;
503 pstaxmitpriv->vi_q.qcnt = 0;
504 //_exit_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0);
507 //_enter_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0);
508 rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->be_q.sta_pending);
509 rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending));
510 phwxmit = pxmitpriv->hwxmits+2;
511 phwxmit->accnt -= pstaxmitpriv->be_q.qcnt;
512 pstaxmitpriv->be_q.qcnt = 0;
513 //_exit_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0);
516 //_enter_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0);
517 rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->bk_q.sta_pending);
518 rtw_list_delete(&(pstaxmitpriv->bk_q.tx_pending));
519 phwxmit = pxmitpriv->hwxmits+3;
520 phwxmit->accnt -= pstaxmitpriv->bk_q.qcnt;
521 pstaxmitpriv->bk_q.qcnt = 0;
522 //_exit_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0);
524 _exit_critical_bh(&pxmitpriv->lock, &irqL0);
526 rtw_list_delete(&psta->hash_list);
527 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]));
528 pstapriv->asoc_sta_count --;
531 // re-init sta_info; 20061114 // will be init in alloc_stainfo
532 //_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
533 //_rtw_init_sta_recv_priv(&psta->sta_recvpriv);
535 _cancel_timer_ex(&psta->addba_retry_timer);
538 _cancel_timer_ex(&psta->TPK_timer);
539 _cancel_timer_ex(&psta->option_timer);
540 _cancel_timer_ex(&psta->base_ch_timer);
541 _cancel_timer_ex(&psta->off_ch_timer);
542 _cancel_timer_ex(&psta->alive_timer1);
543 _cancel_timer_ex(&psta->alive_timer2);
546 //for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer
547 for(i=0; i < 16 ; i++)
550 _list *phead, *plist;
551 union recv_frame *prframe;
552 _queue *ppending_recvframe_queue;
553 _queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
555 preorder_ctrl = &psta->recvreorder_ctrl[i];
557 _cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
560 ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
562 _enter_critical_bh(&ppending_recvframe_queue->lock, &irqL);
564 phead = get_list_head(ppending_recvframe_queue);
565 plist = get_next(phead);
567 while(!rtw_is_list_empty(phead))
569 prframe = LIST_CONTAINOR(plist, union recv_frame, u);
571 plist = get_next(plist);
573 rtw_list_delete(&(prframe->u.hdr.list));
575 rtw_free_recvframe(prframe, pfree_recv_queue);
578 _exit_critical_bh(&ppending_recvframe_queue->lock, &irqL);
583 #ifdef CONFIG_AP_MODE
586 _enter_critical_bh(&pstapriv->asoc_list_lock, &irqL0);
587 rtw_list_delete(&psta->asoc_list);
588 _exit_critical_bh(&pstapriv->asoc_list_lock, &irqL0);
590 _enter_critical_bh(&pstapriv->auth_list_lock, &irqL0);
591 if (!rtw_is_list_empty(&psta->auth_list)) {
592 rtw_list_delete(&psta->auth_list);
593 pstapriv->auth_list_cnt--;
595 _exit_critical_bh(&pstapriv->auth_list_lock, &irqL0);
599 psta->sleepq_ac_len = 0;
602 psta->max_sp_len = 0;
608 psta->has_legacy_ac = 0;
610 #ifdef CONFIG_NATIVEAP_MLME
612 pstapriv->sta_dz_bitmap &=~BIT(psta->aid);
613 pstapriv->tim_bitmap &=~BIT(psta->aid);
615 //rtw_indicate_sta_disassoc_event(padapter, psta);
617 if ((psta->aid >0)&&(pstapriv->sta_aid[psta->aid - 1] == psta))
619 pstapriv->sta_aid[psta->aid - 1] = NULL;
623 #endif // CONFIG_NATIVEAP_MLME
625 #ifdef CONFIG_TX_MCAST2UNI
626 psta->under_exist_checking = 0;
627 #endif // CONFIG_TX_MCAST2UNI
629 #endif // CONFIG_AP_MODE
631 _rtw_spinlock_free(&psta->lock);
633 //_enter_critical_bh(&(pfree_sta_queue->lock), &irqL0);
634 rtw_list_insert_tail(&psta->list, get_list_head(pfree_sta_queue));
635 //_exit_critical_bh(&(pfree_sta_queue->lock), &irqL0);
645 // free all stainfo which in sta_hash[all]
646 void rtw_free_all_stainfo(_adapter *padapter)
649 _list *plist, *phead;
651 struct sta_info *psta = NULL;
652 struct sta_priv *pstapriv = &padapter->stapriv;
653 struct sta_info* pbcmc_stainfo =rtw_get_bcmc_stainfo( padapter);
657 if(pstapriv->asoc_sta_count==1)
660 _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
662 for(index=0; index< NUM_STA; index++)
664 phead = &(pstapriv->sta_hash[index]);
665 plist = get_next(phead);
667 while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
669 psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list);
671 plist = get_next(plist);
673 if(pbcmc_stainfo!=psta)
674 rtw_free_stainfo(padapter , psta);
679 _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
687 /* any station allocated can be searched by hash list */
688 struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
693 _list *plist, *phead;
695 struct sta_info *psta = NULL;
701 u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
717 index = wifi_mac_hash(addr);
719 _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
721 phead = &(pstapriv->sta_hash[index]);
722 plist = get_next(phead);
725 while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
728 psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
730 if ((_rtw_memcmp(psta->hwaddr, addr, ETH_ALEN))== _TRUE)
731 { // if found the matched address
735 plist = get_next(plist);
738 _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
744 u32 rtw_init_bcmc_stainfo(_adapter* padapter)
747 struct sta_info *psta;
748 struct tx_servq *ptxservq;
750 NDIS_802_11_MAC_ADDRESS bcast_addr= {0xff,0xff,0xff,0xff,0xff,0xff};
752 struct sta_priv *pstapriv = &padapter->stapriv;
753 //_queue *pstapending = &padapter->xmitpriv.bm_pending;
757 psta = rtw_alloc_stainfo(pstapriv, bcast_addr);
761 RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("rtw_alloc_stainfo fail"));
765 // default broadcast & multicast use macid 1
768 ptxservq= &(psta->sta_xmitpriv.be_q);
771 _enter_critical(&pstapending->lock, &irqL0);
773 if (rtw_is_list_empty(&ptxservq->tx_pending))
774 rtw_list_insert_tail(&ptxservq->tx_pending, get_list_head(pstapending));
776 _exit_critical(&pstapending->lock, &irqL0);
786 struct sta_info* rtw_get_bcmc_stainfo(_adapter* padapter)
788 struct sta_info *psta;
789 struct sta_priv *pstapriv = &padapter->stapriv;
790 u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
792 psta = rtw_get_stainfo(pstapriv, bc_addr);
798 u8 rtw_access_ctrl(_adapter *padapter, u8 *mac_addr)
801 #ifdef CONFIG_AP_MODE
803 _list *plist, *phead;
804 struct rtw_wlan_acl_node *paclnode;
806 struct sta_priv *pstapriv = &padapter->stapriv;
807 struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
808 _queue *pacl_node_q =&pacl_list->acl_node_q;
810 _enter_critical_bh(&(pacl_node_q->lock), &irqL);
811 phead = get_list_head(pacl_node_q);
812 plist = get_next(phead);
813 while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
815 paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
816 plist = get_next(plist);
818 if(_rtw_memcmp(paclnode->addr, mac_addr, ETH_ALEN))
820 if(paclnode->valid == _TRUE)
827 _exit_critical_bh(&(pacl_node_q->lock), &irqL);
830 if(pacl_list->mode == 1)//accept unless in deny list
832 res = (match == _TRUE) ? _FALSE:_TRUE;
834 else if(pacl_list->mode == 2)//deny unless in accept list
836 res = (match == _TRUE) ? _TRUE:_FALSE;