Lines Matching defs:sc

35 arn_rx_buf_link(struct arn_softc *sc, struct ath_buf *bf)
51 (void) ath9k_hw_setuprxdesc(sc->sc_ah, ds,
55 if (sc->sc_rxlink == NULL)
56 ath9k_hw_putrxbuf(sc->sc_ah, bf->bf_daddr);
58 *sc->sc_rxlink = bf->bf_daddr;
60 sc->sc_rxlink = &ds->ds_link;
61 ath9k_hw_rxena(sc->sc_ah);
65 arn_setdefantenna(struct arn_softc *sc, uint32_t antenna)
68 ath9k_hw_setantenna(sc->sc_ah, antenna);
69 sc->sc_defant = (uint8_t)antenna; /* LINT */
70 sc->sc_rxotherant = 0;
79 arn_extend_tsf(struct arn_softc *sc, uint32_t rstamp)
83 tsf = ath9k_hw_gettsf64(sc->sc_ah);
90 arn_rx_prepare(struct ath_desc *ds, struct arn_softc *sc)
101 if (sc->sc_ah->ah_opmode != ATH9K_M_MONITOR)
105 sc->sc_stats.ast_rx_crcerr++;
110 sc->sc_stats.ast_rx_fifoerr++;
114 sc->sc_stats.ast_rx_phyerr++;
116 sc->sc_stats.ast_rx_phy[phyerr]++;
121 sc->sc_stats.ast_rx_badcrypt++;
129 if (sc->sc_ah->ah_opmode == ATH9K_M_MONITOR) {
150 arn_opmode_init(struct arn_softc *sc)
152 struct ath_hal *ah = sc->sc_ah;
155 ieee80211com_t *ic = (ieee80211com_t *)sc;
158 rfilt = arn_calcrxfilter(sc);
163 (void) ath9k_hw_setbssidmask(ah, sc->sc_bssidmask);
169 (void) ath9k_hw_setmac(ah, sc->sc_myaddr);
202 arn_calcrxfilter(struct arn_softc *sc)
209 rfilt = (ath9k_hw_getrxfilter(sc->sc_ah) & RX_FILTER_PRESERVE) |
214 if (sc->sc_ah->ah_opmode != ATH9K_M_STA)
218 if (((sc->sc_ah->ah_opmode != ATH9K_M_HOSTAP) &&
219 (sc->sc_promisc)) ||
220 (sc->sc_ah->ah_opmode == ATH9K_M_MONITOR)) {
226 if (sc->sc_ah->ah_opmode == ATH9K_M_STA ||
227 sc->sc_ah->ah_opmode == ATH9K_M_IBSS)
234 if (sc->sc_ah->ah_opmode == ATH9K_M_HOSTAP)
257 struct arn_softc *sc;
265 sc = (struct arn_softc *)ic;
267 if (!(sc->sc_flags & SC_OP_RXAGGR))
270 sc->sc_recv_action(in, frm, efrm);
274 arn_startrecv(struct arn_softc *sc)
276 struct ath_hal *ah = sc->sc_ah;
280 mutex_enter(&sc->sc_rxbuflock);
281 if (list_empty(&sc->sc_rxbuf_list))
285 sc->sc_rxlink = NULL;
287 bf = list_head(&sc->sc_rxbuf_list);
289 arn_rx_buf_link(sc, bf);
290 bf = list_next(&sc->sc_rxbuf_list, bf);
295 if (list_empty(&sc->sc_rxbuf_list))
298 bf = list_head(&sc->sc_rxbuf_list);
304 mutex_exit(&sc->sc_rxbuflock);
305 arn_opmode_init(sc);
312 arn_stoprecv(struct arn_softc *sc)
314 struct ath_hal *ah = sc->sc_ah;
324 sc->sc_rxlink = NULL;
338 struct arn_softc *sc = (struct arn_softc *)ic;
344 sc->sc_recv_mgmt(ic, mp, in, subtype, rssi, rstamp);
346 ARN_LOCK(sc);
350 if (sc->sc_bsync && in == ic->ic_bss &&
356 arn_beacon_config(sc);
363 uint64_t tsf = arn_extend_tsf(sc, rstamp);
379 ARN_UNLOCK(sc);
397 ARN_UNLOCK(sc);
416 arn_rx_handler(struct arn_softc *sc)
422 ieee80211com_t *ic = (ieee80211com_t *)sc;
424 struct ath_hal *ah = sc->sc_ah;
441 mutex_enter(&sc->sc_rxbuflock);
442 bf = list_head(&sc->sc_rxbuf_list);
446 sc->sc_rxlink = NULL;
447 mutex_exit(&sc->sc_rxbuflock);
466 PA2DESC(sc, ds->ds_link), 0);
471 if (list_is_last(&bf->bf_node, &sc->sc_rxbuf_list)) {
474 sc->sc_rxlink = NULL;
478 tbf = list_object(&sc->sc_rxbuf_list,
494 PA2DESC(sc, tds->ds_link), 0);
496 mutex_exit(&sc->sc_rxbuflock);
500 list_remove(&sc->sc_rxbuf_list, bf);
501 mutex_exit(&sc->sc_rxbuflock);
508 sc->sc_stats.ast_rx_tooshort++;
513 if (sc->rx_dmabuf_size < rs->rs_datalen) {
518 if (!arn_rx_prepare(ds, sc))
521 if ((rx_mp = allocb(sc->rx_dmabuf_size, BPRI_MED)) == NULL) {
614 sc->sc_halstats.ns_avgbrssi =
660 if (sc->sc_defant != ds->ds_rxstat.rs_antenna) {
661 if (++sc->sc_rxotherant >= 3) {
662 ath9k_hw_setantenna(sc->sc_ah,
664 sc->sc_defant = ds->ds_rxstat.rs_antenna;
665 sc->sc_rxotherant = 0;
668 sc->sc_rxotherant = 0;
672 mutex_enter(&sc->sc_rxbuflock);
673 list_insert_tail(&sc->sc_rxbuf_list, bf);
674 mutex_exit(&sc->sc_rxbuflock);
675 arn_rx_buf_link(sc, bf);
679 sc->sc_lastrx = ath9k_hw_gettsf64(ah);
687 struct arn_softc *sc = (struct arn_softc *)data;
689 ARN_LOCK(sc);
691 if (sc->sc_rx_pend) {
693 sc->sc_rx_pend = 0;
694 ARN_UNLOCK(sc);
695 arn_rx_handler(sc);
699 ARN_UNLOCK(sc);