Lines Matching defs:asc
80 extern void ath_setup_desc(ath_t *asc, struct ath_buf *bf);
112 ath_calcrxfilter(ath_t *asc)
114 ieee80211com_t *ic = (ieee80211com_t *)asc;
115 struct ath_hal *ah = asc->asc_ah;
122 if (ic->ic_opmode != IEEE80211_M_HOSTAP && asc->asc_promisc)
132 ath_set_data_queue(ath_t *asc, int ac, int haltype)
136 struct ath_hal *ah = asc->asc_ah;
139 if (ac >= ATH_N(asc->asc_ac2q)) {
142 ac, ATH_N(asc->asc_ac2q)));
167 if (qnum >= ATH_N(asc->asc_txq)) {
170 qnum, ATH_N(asc->asc_txq)));
173 if (!ATH_TXQ_SETUP(asc, qnum)) {
174 txq = &asc->asc_txq[qnum];
182 asc->asc_txqsetup |= 1<<qnum;
184 asc->asc_ac2q[ac] = &asc->asc_txq[qnum];
189 ath_txq_setup(ath_t *asc)
191 if (ath_set_data_queue(asc, WME_AC_BE, HAL_WME_AC_BK) ||
192 ath_set_data_queue(asc, WME_AC_BK, HAL_WME_AC_BE) ||
193 ath_set_data_queue(asc, WME_AC_VI, HAL_WME_AC_VI) ||
194 ath_set_data_queue(asc, WME_AC_VO, HAL_WME_AC_VO)) {
202 ath_txq_cleanup(ath_t *asc)
206 mutex_destroy(&asc->asc_txbuflock);
208 if (ATH_TXQ_SETUP(asc, i)) {
209 struct ath_txq *txq = &asc->asc_txq[i];
211 ATH_HAL_RELEASETXQUEUE(asc->asc_ah, txq->axq_qnum);
213 asc->asc_txqsetup &= ~(1 << txq->axq_qnum);
219 ath_setcurmode(ath_t *asc, enum ieee80211_phymode mode)
224 for (i = 0; i < sizeof (asc->asc_rixmap); i++)
225 asc->asc_rixmap[i] = 0xff;
227 rt = asc->asc_rates[mode];
231 asc->asc_rixmap[rt->info[i].dot11Rate & IEEE80211_RATE_VAL] =
234 asc->asc_currates = rt;
235 asc->asc_curmode = mode;
242 asc->asc_protrix = (mode == IEEE80211_MODE_11G ? 1 : 0);
247 ath_mode_init(ath_t *asc)
249 ieee80211com_t *ic = (ieee80211com_t *)asc;
250 struct ath_hal *ah = asc->asc_ah;
254 rfilt = ath_calcrxfilter(asc);
257 ATH_HAL_SETMCASTFILTER(ah, asc->asc_mcast_hash[0],
258 asc->asc_mcast_hash[1]);
262 asc->asc_mcast_hash[0], asc->asc_mcast_hash[1]));
269 ath_stoprecv(ath_t *asc)
271 ATH_HAL_STOPPCURECV(asc->asc_ah); /* disable PCU */
272 ATH_HAL_SETRXFILTER(asc->asc_ah, 0); /* clear recv filter */
273 ATH_HAL_STOPDMARECV(asc->asc_ah); /* disable DMA engine */
277 ATH_HAL_GETRXBUF(asc->asc_ah), asc->asc_rxlink));
278 asc->asc_rxlink = NULL;
298 ath_getchannels(ath_t *asc, uint32_t cc, HAL_BOOL outdoor, HAL_BOOL xchanmode)
300 ieee80211com_t *ic = (ieee80211com_t *)asc;
301 struct ath_hal *ah = asc->asc_ah;
360 asc->asc_have11g = 1;
367 ath_drainq(ath_t *asc, struct ath_txq *txq)
385 mutex_enter(&asc->asc_txbuflock);
386 list_insert_tail(&asc->asc_txbuf_list, bf);
387 mutex_exit(&asc->asc_txbuflock);
396 ath_draintxq(ath_t *asc)
398 struct ath_hal *ah = asc->asc_ah;
402 if (!asc->asc_invalid) {
404 if (ATH_TXQ_SETUP(asc, i)) {
405 txq = &asc->asc_txq[i];
411 if (ATH_TXQ_SETUP(asc, i)) {
412 ath_drainq(asc, &asc->asc_txq[i]);
420 ath_startrecv(ath_t *asc)
424 asc->asc_rxlink = NULL;
426 bf = list_head(&asc->asc_rxbuf_list);
428 ath_setup_desc(asc, bf);
429 bf = list_next(&asc->asc_rxbuf_list, bf);
432 bf = list_head(&asc->asc_rxbuf_list);
433 ATH_HAL_PUTRXBUF(asc->asc_ah, bf->bf_daddr);
434 ATH_HAL_RXENA(asc->asc_ah); /* enable recv descriptors */
435 ath_mode_init(asc); /* set filters, etc. */
436 ATH_HAL_STARTPCURECV(asc->asc_ah); /* re-enable PCU/DMA engine */
444 ath_chan_change(ath_t *asc, struct ieee80211_channel *chan)
446 struct ieee80211com *ic = &asc->asc_isc;
454 if (mode != asc->asc_curmode)
455 ath_setcurmode(asc, mode);
464 ath_chan_set(ath_t *asc, struct ieee80211_channel *chan)
466 struct ath_hal *ah = asc->asc_ah;
467 ieee80211com_t *ic = &asc->asc_isc;
480 ath_draintxq(asc); /* clear pending tx frames */
481 ath_stoprecv(asc); /* turn off frame recv */
499 asc->asc_curchan = hchan;
504 if (ath_startrecv(asc) != 0) {
515 ath_chan_change(asc, chan);
519 ATH_HAL_INTRSET(ah, asc->asc_imask);
541 ath_beacon_config(ath_t *asc)
543 struct ath_hal *ah = asc->asc_ah;
544 ieee80211com_t *ic = (ieee80211com_t *)asc;
603 asc->asc_imask |= HAL_INT_BMISS;
604 ATH_HAL_INTRSET(ah, asc->asc_imask);
608 asc->asc_imask |= HAL_INT_SWBA; /* beacon prepare */
609 ATH_HAL_INTRSET(ah, asc->asc_imask);
617 key_alloc_pair(ath_t *asc, ieee80211_keyix *txkeyix,
622 ASSERT(!asc->asc_splitmic);
623 for (i = 0; i < ATH_N(asc->asc_keymap)/4; i++) {
624 uint8_t b = asc->asc_keymap[i];
629 if ((b & 1) || isset(asc->asc_keymap, keyix+64)) {
633 setbit(asc->asc_keymap, keyix);
634 setbit(asc->asc_keymap, keyix+64);
652 key_alloc_2pair(ath_t *asc, ieee80211_keyix *txkeyix, ieee80211_keyix *rxkeyix)
656 ASSERT(asc->asc_splitmic);
657 for (i = 0; i < ATH_N(asc->asc_keymap)/4; i++) {
658 uint8_t b = asc->asc_keymap[i];
670 if (isset(asc->asc_keymap, keyix+32) ||
671 isset(asc->asc_keymap, keyix+64) ||
672 isset(asc->asc_keymap, keyix+32+64)) {
680 setbit(asc->asc_keymap, keyix);
681 setbit(asc->asc_keymap, keyix+64);
682 setbit(asc->asc_keymap, keyix+32);
683 setbit(asc->asc_keymap, keyix+32+64);
700 key_alloc_single(ath_t *asc, ieee80211_keyix *txkeyix, ieee80211_keyix *rxkeyix)
705 for (i = 0; i < ATH_N(asc->asc_keymap); i++) {
706 uint8_t b = asc->asc_keymap[i];
715 setbit(asc->asc_keymap, keyix);
739 ath_t *asc = (ath_t *)ic;
750 return (key_alloc_single(asc, keyix, rxkeyix));
753 if (asc->asc_splitmic)
754 return (key_alloc_2pair(asc, keyix, rxkeyix));
756 return (key_alloc_pair(asc, keyix, rxkeyix));
758 return (key_alloc_single(asc, keyix, rxkeyix));
768 ath_t *asc = (ath_t *)ic;
769 struct ath_hal *ah = asc->asc_ah;
781 (k->wk_flags & IEEE80211_KEY_SWMIC) == 0 && asc->asc_splitmic)
789 clrbit(asc->asc_keymap, keyix);
796 clrbit(asc->asc_keymap, keyix+64);
797 if (asc->asc_splitmic) {
799 clrbit(asc->asc_keymap, keyix+32);
801 clrbit(asc->asc_keymap, keyix+32+64);
809 ath_keyprint(ath_t *asc, const char *tag, uint_t ix,
834 asc->asc_splitmic ? "mic" : "rxmic");
841 if (!asc->asc_splitmic) {
860 ath_keyset_tkip(ath_t *asc, const struct ieee80211_key *k,
865 struct ath_hal *ah = asc->asc_ah;
869 if (asc->asc_splitmic) {
876 ath_keyprint(asc, "ath_keyset_tkip:", k->wk_keyix, hk,
883 ath_keyprint(asc, "ath_keyset_tkip:", k->wk_keyix+32,
896 ath_keyprint(asc, "ath_keyset_tkip", k->wk_keyix, hk,
907 ath_keyprint(asc, "ath_keyset_tkip:", k->wk_keyix, hk,
931 ath_t *asc = (ath_t *)ic;
932 struct ath_hal *ah = asc->asc_ah;
953 return (ath_keyset_tkip(asc, k, &hk, mac));
955 ath_keyprint(asc, "ath_keyset:", k->wk_keyix, &hk, mac);
977 ath_t *asc = (ath_t *)ic;
978 struct ath_hal *ah = asc->asc_ah;
987 asc->asc_curchan.channel = ch->ich_freq;
988 asc->asc_curchan.channelFlags = ath_chan2flags(ic, ch);
991 ath_draintxq(asc); /* stop xmit side */
992 if (ATH_IS_RUNNING(asc)) {
993 ath_stoprecv(asc); /* stop recv side */
996 &asc->asc_curchan, AH_TRUE, &status)) {
1001 ath_chan_change(asc, ch);
1003 if (ATH_IS_RUNNING(asc)) {
1004 if (ath_startrecv(asc) != 0) /* restart recv */
1008 ath_beacon_config(asc); /* restart beacons */
1010 ATH_HAL_INTRSET(ah, asc->asc_imask);