Lines Matching +full:mac +full:-

1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
118 bwi_tmplt_write_4(struct bwi_mac *mac, uint32_t ofs, uint32_t val) in bwi_tmplt_write_4() argument
120 struct bwi_softc *sc = mac->mac_sc; in bwi_tmplt_write_4()
122 if (mac->mac_flags & BWI_MAC_F_BSWAP) in bwi_tmplt_write_4()
130 bwi_hostflags_write(struct bwi_mac *mac, uint64_t flags) in bwi_hostflags_write() argument
135 MOBJ_WRITE_2(mac, BWI_COMM_MOBJ, BWI_COMM_MOBJ_HFLAGS_LO, val); in bwi_hostflags_write()
138 MOBJ_WRITE_2(mac, BWI_COMM_MOBJ, BWI_COMM_MOBJ_HFLAGS_MI, val); in bwi_hostflags_write()
144 bwi_hostflags_read(struct bwi_mac *mac) in bwi_hostflags_read() argument
151 val = MOBJ_READ_2(mac, BWI_COMM_MOBJ, BWI_COMM_MOBJ_HFLAGS_MI); in bwi_hostflags_read()
154 val = MOBJ_READ_2(mac, BWI_COMM_MOBJ, BWI_COMM_MOBJ_HFLAGS_LO); in bwi_hostflags_read()
161 bwi_memobj_read_2(struct bwi_mac *mac, uint16_t obj_id, uint16_t ofs0) in bwi_memobj_read_2() argument
163 struct bwi_softc *sc = mac->mac_sc; in bwi_memobj_read_2()
178 bwi_memobj_read_4(struct bwi_mac *mac, uint16_t obj_id, uint16_t ofs0) in bwi_memobj_read_4() argument
180 struct bwi_softc *sc = mac->mac_sc; in bwi_memobj_read_4()
203 bwi_memobj_write_2(struct bwi_mac *mac, uint16_t obj_id, uint16_t ofs0, in bwi_memobj_write_2() argument
206 struct bwi_softc *sc = mac->mac_sc; in bwi_memobj_write_2()
221 bwi_memobj_write_4(struct bwi_mac *mac, uint16_t obj_id, uint16_t ofs0, in bwi_memobj_write_4() argument
224 struct bwi_softc *sc = mac->mac_sc; in bwi_memobj_write_4()
242 bwi_mac_lateattach(struct bwi_mac *mac) in bwi_mac_lateattach() argument
246 if (mac->mac_rev >= 5) in bwi_mac_lateattach()
247 CSR_READ_4(mac->mac_sc, BWI_STATE_HI); /* dummy read */ in bwi_mac_lateattach()
249 bwi_mac_reset(mac, 1); in bwi_mac_lateattach()
251 error = bwi_phy_attach(mac); in bwi_mac_lateattach()
255 error = bwi_rf_attach(mac); in bwi_mac_lateattach()
260 if (mac->mac_phy.phy_mode == IEEE80211_MODE_11A) in bwi_mac_lateattach()
261 bwi_mac_reset(mac, 0); in bwi_mac_lateattach()
263 bwi_mac_reset(mac, 1); in bwi_mac_lateattach()
265 error = bwi_mac_test(mac); in bwi_mac_lateattach()
269 error = bwi_mac_get_property(mac); in bwi_mac_lateattach()
273 error = bwi_rf_map_txpower(mac); in bwi_mac_lateattach()
277 bwi_rf_off(mac); in bwi_mac_lateattach()
278 CSR_WRITE_2(mac->mac_sc, BWI_BBP_ATTEN, BWI_BBP_ATTEN_MAGIC); in bwi_mac_lateattach()
279 bwi_regwin_disable(mac->mac_sc, &mac->mac_regwin, 0); in bwi_mac_lateattach()
285 bwi_mac_init(struct bwi_mac *mac) in bwi_mac_init() argument
287 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_init()
290 /* Clear MAC/PHY/RF states */ in bwi_mac_init()
291 bwi_mac_setup_tpctl(mac); in bwi_mac_init()
292 bwi_rf_clear_state(&mac->mac_rf); in bwi_mac_init()
293 bwi_phy_clear_state(&mac->mac_phy); in bwi_mac_init()
295 /* Enable MAC and linked it to PHY */ in bwi_mac_init()
296 if (!bwi_regwin_is_enabled(sc, &mac->mac_regwin)) in bwi_mac_init()
297 bwi_mac_reset(mac, 1); in bwi_mac_init()
300 error = bwi_bus_init(sc, mac); in bwi_mac_init()
305 if (sc->sc_bus_regwin.rw_rev <= 5 && in bwi_mac_init()
306 sc->sc_bus_regwin.rw_type != BWI_REGWIN_T_BUSPCIE) { in bwi_mac_init()
313 error = bwi_phy_calibrate(mac); in bwi_mac_init()
315 device_printf(sc->sc_dev, "PHY calibrate failed\n"); in bwi_mac_init()
327 error = bwi_mac_fw_load(mac); in bwi_mac_init()
331 error = bwi_mac_gpio_init(mac); in bwi_mac_init()
335 error = bwi_mac_fw_init(mac); in bwi_mac_init()
342 bwi_rf_on(mac); in bwi_mac_init()
350 bwi_phy_init(mac); in bwi_mac_init()
357 bwi_rf_set_ant_mode(mac, mac->mac_rf.rf_ant_mode); in bwi_mac_init()
362 bwi_mac_opmode_init(mac); in bwi_mac_init()
365 if (mac->mac_rev < 3) { in bwi_mac_init()
389 /* allow the MAC to control the PHY clock (dynamic on/off) */ in bwi_mac_init()
392 /* Setup MAC power up delay */ in bwi_mac_init()
393 CSR_WRITE_2(sc, BWI_MAC_POWERUP_DELAY, sc->sc_pwron_delay); in bwi_mac_init()
395 /* Set MAC regwin revision */ in bwi_mac_init()
396 MOBJ_WRITE_2(mac, BWI_COMM_MOBJ, BWI_COMM_MOBJ_MACREV, mac->mac_rev); in bwi_mac_init()
401 bwi_mac_hostflags_init(mac); in bwi_mac_init()
406 bwi_mac_bss_param_init(mac); in bwi_mac_init()
412 error = sc->sc_init_tx_ring(sc, i); in bwi_mac_init()
414 device_printf(sc->sc_dev, in bwi_mac_init()
423 error = sc->sc_init_rx_ring(sc); in bwi_mac_init()
425 device_printf(sc->sc_dev, "can't initialize RX ring\n"); in bwi_mac_init()
430 * Initialize TX stats if the current MAC uses that in bwi_mac_init()
432 if (mac->mac_flags & BWI_MAC_F_HAS_TXSTATS) { in bwi_mac_init()
433 error = sc->sc_init_txstats(sc); in bwi_mac_init()
435 device_printf(sc->sc_dev, in bwi_mac_init()
442 CSR_WRITE_2(sc, 0x612, 0x50); /* Force Pre-TBTT to 80? */ in bwi_mac_init()
443 MOBJ_WRITE_2(mac, BWI_COMM_MOBJ, 0x416, 0x50); in bwi_mac_init()
444 MOBJ_WRITE_2(mac, BWI_COMM_MOBJ, 0x414, 0x1f4); in bwi_mac_init()
446 mac->mac_flags |= BWI_MAC_F_INITED; in bwi_mac_init()
451 bwi_mac_reset(struct bwi_mac *mac, int link_phy) in bwi_mac_reset() argument
453 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_reset()
459 bwi_regwin_enable(sc, &mac->mac_regwin, flags); in bwi_mac_reset()
490 mac->mac_phy.phy_flags |= BWI_PHY_F_LINKED; in bwi_mac_reset()
494 mac->mac_phy.phy_flags &= ~BWI_PHY_F_LINKED; in bwi_mac_reset()
499 bwi_mac_set_tpctl_11bg(struct bwi_mac *mac, const struct bwi_tpctl *new_tpctl) in bwi_mac_set_tpctl_11bg() argument
501 struct bwi_rf *rf = &mac->mac_rf; in bwi_mac_set_tpctl_11bg()
502 struct bwi_tpctl *tpctl = &mac->mac_tpctl; in bwi_mac_set_tpctl_11bg()
505 KASSERT(new_tpctl->bbp_atten <= BWI_BBP_ATTEN_MAX, in bwi_mac_set_tpctl_11bg()
506 ("bbp_atten %d", new_tpctl->bbp_atten)); in bwi_mac_set_tpctl_11bg()
507 KASSERT(new_tpctl->rf_atten <= in bwi_mac_set_tpctl_11bg()
508 (rf->rf_rev < 6 ? BWI_RF_ATTEN_MAX0 in bwi_mac_set_tpctl_11bg()
510 ("rf_atten %d", new_tpctl->rf_atten)); in bwi_mac_set_tpctl_11bg()
511 KASSERT(new_tpctl->tp_ctrl1 <= BWI_TPCTL1_MAX, in bwi_mac_set_tpctl_11bg()
512 ("tp_ctrl1 %d", new_tpctl->tp_ctrl1)); in bwi_mac_set_tpctl_11bg()
514 tpctl->bbp_atten = new_tpctl->bbp_atten; in bwi_mac_set_tpctl_11bg()
515 tpctl->rf_atten = new_tpctl->rf_atten; in bwi_mac_set_tpctl_11bg()
516 tpctl->tp_ctrl1 = new_tpctl->tp_ctrl1; in bwi_mac_set_tpctl_11bg()
520 bwi_phy_set_bbp_atten(mac, tpctl->bbp_atten); in bwi_mac_set_tpctl_11bg()
523 RF_WRITE(mac, BWI_RFR_ATTEN, tpctl->rf_atten); in bwi_mac_set_tpctl_11bg()
524 MOBJ_WRITE_2(mac, BWI_COMM_MOBJ, BWI_COMM_MOBJ_RF_ATTEN, in bwi_mac_set_tpctl_11bg()
525 tpctl->rf_atten); in bwi_mac_set_tpctl_11bg()
528 if (rf->rf_type == BWI_RF_T_BCM2050) { in bwi_mac_set_tpctl_11bg()
529 RF_FILT_SETBITS(mac, BWI_RFR_TXPWR, ~BWI_RFR_TXPWR1_MASK, in bwi_mac_set_tpctl_11bg()
530 __SHIFTIN(tpctl->tp_ctrl1, BWI_RFR_TXPWR1_MASK)); in bwi_mac_set_tpctl_11bg()
534 if (mac->mac_phy.phy_mode == IEEE80211_MODE_11G) in bwi_mac_set_tpctl_11bg()
535 bwi_rf_lo_adjust(mac, tpctl); in bwi_mac_set_tpctl_11bg()
539 bwi_mac_test(struct bwi_mac *mac) in bwi_mac_test() argument
541 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_test()
548 orig_val = MOBJ_READ_4(mac, BWI_COMM_MOBJ, 0); in bwi_mac_test()
551 MOBJ_WRITE_4(mac, BWI_COMM_MOBJ, 0, TEST_VAL1); in bwi_mac_test()
552 val = MOBJ_READ_4(mac, BWI_COMM_MOBJ, 0); in bwi_mac_test()
554 device_printf(sc->sc_dev, "TEST1 failed\n"); in bwi_mac_test()
559 MOBJ_WRITE_4(mac, BWI_COMM_MOBJ, 0, TEST_VAL2); in bwi_mac_test()
560 val = MOBJ_READ_4(mac, BWI_COMM_MOBJ, 0); in bwi_mac_test()
562 device_printf(sc->sc_dev, "TEST2 failed\n"); in bwi_mac_test()
567 MOBJ_WRITE_4(mac, BWI_COMM_MOBJ, 0, orig_val); in bwi_mac_test()
571 device_printf(sc->sc_dev, "%s failed, MAC status 0x%08x\n", in bwi_mac_test()
578 device_printf(sc->sc_dev, "%s failed, intr status %08x\n", in bwi_mac_test()
590 bwi_mac_setup_tpctl(struct bwi_mac *mac) in bwi_mac_setup_tpctl() argument
592 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_setup_tpctl()
593 struct bwi_rf *rf = &mac->mac_rf; in bwi_mac_setup_tpctl()
594 struct bwi_phy *phy = &mac->mac_phy; in bwi_mac_setup_tpctl()
595 struct bwi_tpctl *tpctl = &mac->mac_tpctl; in bwi_mac_setup_tpctl()
598 if (rf->rf_type == BWI_RF_T_BCM2050 && rf->rf_rev < 6) in bwi_mac_setup_tpctl()
599 tpctl->bbp_atten = 0; in bwi_mac_setup_tpctl()
601 tpctl->bbp_atten = 2; in bwi_mac_setup_tpctl()
604 tpctl->tp_ctrl1 = 0; in bwi_mac_setup_tpctl()
605 if (rf->rf_type == BWI_RF_T_BCM2050) { in bwi_mac_setup_tpctl()
606 if (rf->rf_rev == 1) in bwi_mac_setup_tpctl()
607 tpctl->tp_ctrl1 = 3; in bwi_mac_setup_tpctl()
608 else if (rf->rf_rev < 6) in bwi_mac_setup_tpctl()
609 tpctl->tp_ctrl1 = 2; in bwi_mac_setup_tpctl()
610 else if (rf->rf_rev == 8) in bwi_mac_setup_tpctl()
611 tpctl->tp_ctrl1 = 1; in bwi_mac_setup_tpctl()
615 tpctl->tp_ctrl2 = 0xffff; in bwi_mac_setup_tpctl()
620 if (phy->phy_mode == IEEE80211_MODE_11A) { in bwi_mac_setup_tpctl()
621 tpctl->rf_atten = 0x60; in bwi_mac_setup_tpctl()
625 if (BWI_IS_BRCM_BCM4309G(sc) && sc->sc_pci_revid < 0x51) { in bwi_mac_setup_tpctl()
626 tpctl->rf_atten = sc->sc_pci_revid < 0x43 ? 2 : 3; in bwi_mac_setup_tpctl()
630 tpctl->rf_atten = 5; in bwi_mac_setup_tpctl()
632 if (rf->rf_type != BWI_RF_T_BCM2050) { in bwi_mac_setup_tpctl()
633 if (rf->rf_type == BWI_RF_T_BCM2053 && rf->rf_rev == 1) in bwi_mac_setup_tpctl()
634 tpctl->rf_atten = 6; in bwi_mac_setup_tpctl()
644 switch (rf->rf_rev) { in bwi_mac_setup_tpctl()
646 if (phy->phy_mode == IEEE80211_MODE_11G) { in bwi_mac_setup_tpctl()
648 tpctl->rf_atten = 3; in bwi_mac_setup_tpctl()
650 tpctl->rf_atten = 1; in bwi_mac_setup_tpctl()
653 tpctl->rf_atten = 7; in bwi_mac_setup_tpctl()
655 tpctl->rf_atten = 6; in bwi_mac_setup_tpctl()
659 if (phy->phy_mode == IEEE80211_MODE_11G) { in bwi_mac_setup_tpctl()
664 tpctl->rf_atten = 3; in bwi_mac_setup_tpctl()
666 tpctl->rf_atten = 5; in bwi_mac_setup_tpctl()
667 else if (sc->sc_bbp_id == BWI_BBPID_BCM4320) in bwi_mac_setup_tpctl()
668 tpctl->rf_atten = 4; in bwi_mac_setup_tpctl()
670 tpctl->rf_atten = 3; in bwi_mac_setup_tpctl()
672 tpctl->rf_atten = 6; in bwi_mac_setup_tpctl()
677 tpctl->rf_atten = 1; in bwi_mac_setup_tpctl()
680 tpctl->rf_atten = 0x1a; in bwi_mac_setup_tpctl()
686 tpctl->bbp_atten, tpctl->rf_atten, in bwi_mac_setup_tpctl()
687 tpctl->tp_ctrl1, tpctl->tp_ctrl2); in bwi_mac_setup_tpctl()
691 bwi_mac_dummy_xmit(struct bwi_mac *mac) in bwi_mac_dummy_xmit() argument
699 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_dummy_xmit()
700 struct bwi_rf *rf = &mac->mac_rf; in bwi_mac_dummy_xmit()
705 if (mac->mac_phy.phy_mode == IEEE80211_MODE_11A) { in bwi_mac_dummy_xmit()
716 TMPLT_WRITE_4(mac, i * 4, packet[i]); in bwi_mac_dummy_xmit()
731 if (rf->rf_type == BWI_RF_T_BCM2050 && rf->rf_rev <= 5) in bwi_mac_dummy_xmit()
732 RF_WRITE(mac, 0x51, 0x17); in bwi_mac_dummy_xmit()
750 if (rf->rf_type == BWI_RF_T_BCM2050 && rf->rf_rev <= 5) in bwi_mac_dummy_xmit()
751 RF_WRITE(mac, 0x51, 0x37); in bwi_mac_dummy_xmit()
756 bwi_mac_init_tpctl_11bg(struct bwi_mac *mac) in bwi_mac_init_tpctl_11bg() argument
758 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_init_tpctl_11bg()
759 struct bwi_phy *phy = &mac->mac_phy; in bwi_mac_init_tpctl_11bg()
760 struct bwi_rf *rf = &mac->mac_rf; in bwi_mac_init_tpctl_11bg()
764 KASSERT(phy->phy_mode != IEEE80211_MODE_11A, in bwi_mac_init_tpctl_11bg()
765 ("phy_mode %d", phy->phy_mode)); in bwi_mac_init_tpctl_11bg()
770 PHY_WRITE(mac, 0x28, 0x8018); in bwi_mac_init_tpctl_11bg()
773 if (phy->phy_mode == IEEE80211_MODE_11G) { in bwi_mac_init_tpctl_11bg()
774 if ((phy->phy_flags & BWI_PHY_F_LINKED) == 0) in bwi_mac_init_tpctl_11bg()
776 PHY_WRITE(mac, 0x47a, 0xc111); in bwi_mac_init_tpctl_11bg()
778 if (mac->mac_flags & BWI_MAC_F_TPCTL_INITED) in bwi_mac_init_tpctl_11bg()
781 if (phy->phy_mode == IEEE80211_MODE_11B && phy->phy_rev >= 2 && in bwi_mac_init_tpctl_11bg()
782 rf->rf_type == BWI_RF_T_BCM2050) { in bwi_mac_init_tpctl_11bg()
783 RF_SETBITS(mac, 0x76, 0x84); in bwi_mac_init_tpctl_11bg()
788 bcopy(&mac->mac_tpctl, &tpctl_orig, sizeof(tpctl_orig)); in bwi_mac_init_tpctl_11bg()
791 bcopy(&mac->mac_tpctl, &tpctl, sizeof(tpctl)); in bwi_mac_init_tpctl_11bg()
795 if (rf->rf_rev >= 6 && rf->rf_rev <= 8) in bwi_mac_init_tpctl_11bg()
801 bwi_mac_set_tpctl_11bg(mac, &tpctl); in bwi_mac_init_tpctl_11bg()
804 bwi_mac_dummy_xmit(mac); in bwi_mac_init_tpctl_11bg()
806 mac->mac_flags |= BWI_MAC_F_TPCTL_INITED; in bwi_mac_init_tpctl_11bg()
807 rf->rf_base_tssi = PHY_READ(mac, 0x29); in bwi_mac_init_tpctl_11bg()
809 "base tssi %d\n", rf->rf_base_tssi); in bwi_mac_init_tpctl_11bg()
811 if (abs(rf->rf_base_tssi - rf->rf_idle_tssi) >= 20) { in bwi_mac_init_tpctl_11bg()
812 device_printf(sc->sc_dev, "base tssi measure failed\n"); in bwi_mac_init_tpctl_11bg()
813 mac->mac_flags |= BWI_MAC_F_TPCTL_ERROR; in bwi_mac_init_tpctl_11bg()
817 bwi_mac_set_tpctl_11bg(mac, &tpctl_orig); in bwi_mac_init_tpctl_11bg()
819 RF_CLRBITS(mac, 0x76, 0x84); in bwi_mac_init_tpctl_11bg()
821 bwi_rf_clear_tssi(mac); in bwi_mac_init_tpctl_11bg()
825 bwi_mac_detach(struct bwi_mac *mac) in bwi_mac_detach() argument
827 bwi_mac_fw_free(mac); in bwi_mac_detach()
836 if (fw->datasize < sizeof(*hdr)) { in bwi_fwimage_is_valid()
837 device_printf(sc->sc_dev, in bwi_fwimage_is_valid()
839 fw->name, fw->datasize); in bwi_fwimage_is_valid()
843 hdr = (const struct bwi_fwhdr *)fw->data; in bwi_fwimage_is_valid()
849 if (be32toh(hdr->fw_size) != fw->datasize - sizeof(*hdr)) { in bwi_fwimage_is_valid()
850 device_printf(sc->sc_dev, in bwi_fwimage_is_valid()
852 "fw %u, real %zu\n", fw->name, in bwi_fwimage_is_valid()
853 be32toh(hdr->fw_size), fw->datasize - sizeof(*hdr)); in bwi_fwimage_is_valid()
858 if (hdr->fw_type != fw_type) { in bwi_fwimage_is_valid()
859 device_printf(sc->sc_dev, in bwi_fwimage_is_valid()
861 "fw \'%c\', target \'%c\'\n", fw->name, in bwi_fwimage_is_valid()
862 hdr->fw_type, fw_type); in bwi_fwimage_is_valid()
866 if (hdr->fw_gen != BWI_FW_GEN_1) { in bwi_fwimage_is_valid()
867 device_printf(sc->sc_dev, in bwi_fwimage_is_valid()
869 "fw %d, target %d\n", fw->name, hdr->fw_gen, BWI_FW_GEN_1); in bwi_fwimage_is_valid()
879 bwi_mac_fw_alloc(struct bwi_mac *mac) in bwi_mac_fw_alloc() argument
881 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_fw_alloc()
889 if (mac->mac_stub == NULL) { in bwi_mac_fw_alloc()
891 sc->sc_fw_version); in bwi_mac_fw_alloc()
892 mac->mac_stub = firmware_get(fwname); in bwi_mac_fw_alloc()
893 if (mac->mac_stub == NULL) in bwi_mac_fw_alloc()
897 if (mac->mac_ucode == NULL) { in bwi_mac_fw_alloc()
899 sc->sc_fw_version, in bwi_mac_fw_alloc()
900 mac->mac_rev >= 5 ? 5 : mac->mac_rev); in bwi_mac_fw_alloc()
902 mac->mac_ucode = firmware_get(fwname); in bwi_mac_fw_alloc()
903 if (mac->mac_ucode == NULL) in bwi_mac_fw_alloc()
905 if (!bwi_fwimage_is_valid(sc, mac->mac_ucode, BWI_FW_T_UCODE)) in bwi_mac_fw_alloc()
909 if (mac->mac_pcm == NULL) { in bwi_mac_fw_alloc()
911 sc->sc_fw_version, in bwi_mac_fw_alloc()
912 mac->mac_rev < 5 ? 4 : 5); in bwi_mac_fw_alloc()
914 mac->mac_pcm = firmware_get(fwname); in bwi_mac_fw_alloc()
915 if (mac->mac_pcm == NULL) in bwi_mac_fw_alloc()
917 if (!bwi_fwimage_is_valid(sc, mac->mac_pcm, BWI_FW_T_PCM)) in bwi_mac_fw_alloc()
921 if (mac->mac_iv == NULL) { in bwi_mac_fw_alloc()
923 if (mac->mac_rev == 2 || mac->mac_rev == 4) { in bwi_mac_fw_alloc()
925 } else if (mac->mac_rev >= 5 && mac->mac_rev <= 10) { in bwi_mac_fw_alloc()
928 device_printf(sc->sc_dev, in bwi_mac_fw_alloc()
929 "no suitible IV for MAC rev %d\n", mac->mac_rev); in bwi_mac_fw_alloc()
934 sc->sc_fw_version, idx); in bwi_mac_fw_alloc()
936 mac->mac_iv = firmware_get(fwname); in bwi_mac_fw_alloc()
937 if (mac->mac_iv == NULL) in bwi_mac_fw_alloc()
939 if (!bwi_fwimage_is_valid(sc, mac->mac_iv, BWI_FW_T_IV)) in bwi_mac_fw_alloc()
943 if (mac->mac_iv_ext == NULL) { in bwi_mac_fw_alloc()
945 if (mac->mac_rev == 2 || mac->mac_rev == 4 || in bwi_mac_fw_alloc()
946 mac->mac_rev >= 11) { in bwi_mac_fw_alloc()
949 } else if (mac->mac_rev >= 5 && mac->mac_rev <= 10) { in bwi_mac_fw_alloc()
952 device_printf(sc->sc_dev, in bwi_mac_fw_alloc()
953 "no suitible ExtIV for MAC rev %d\n", mac->mac_rev); in bwi_mac_fw_alloc()
958 sc->sc_fw_version, idx); in bwi_mac_fw_alloc()
960 mac->mac_iv_ext = firmware_get(fwname); in bwi_mac_fw_alloc()
961 if (mac->mac_iv_ext == NULL) in bwi_mac_fw_alloc()
963 if (!bwi_fwimage_is_valid(sc, mac->mac_iv_ext, BWI_FW_T_IV)) in bwi_mac_fw_alloc()
969 device_printf(sc->sc_dev, "request firmware %s failed\n", fwname); in bwi_mac_fw_alloc()
974 bwi_mac_fw_free(struct bwi_mac *mac) in bwi_mac_fw_free() argument
976 if (mac->mac_ucode != NULL) { in bwi_mac_fw_free()
977 firmware_put(mac->mac_ucode, FIRMWARE_UNLOAD); in bwi_mac_fw_free()
978 mac->mac_ucode = NULL; in bwi_mac_fw_free()
981 if (mac->mac_pcm != NULL) { in bwi_mac_fw_free()
982 firmware_put(mac->mac_pcm, FIRMWARE_UNLOAD); in bwi_mac_fw_free()
983 mac->mac_pcm = NULL; in bwi_mac_fw_free()
986 if (mac->mac_iv != NULL) { in bwi_mac_fw_free()
987 firmware_put(mac->mac_iv, FIRMWARE_UNLOAD); in bwi_mac_fw_free()
988 mac->mac_iv = NULL; in bwi_mac_fw_free()
991 if (mac->mac_iv_ext != NULL) { in bwi_mac_fw_free()
992 firmware_put(mac->mac_iv_ext, FIRMWARE_UNLOAD); in bwi_mac_fw_free()
993 mac->mac_iv_ext = NULL; in bwi_mac_fw_free()
996 if (mac->mac_stub != NULL) { in bwi_mac_fw_free()
997 firmware_put(mac->mac_stub, FIRMWARE_UNLOAD); in bwi_mac_fw_free()
998 mac->mac_stub = NULL; in bwi_mac_fw_free()
1003 bwi_mac_fw_load(struct bwi_mac *mac) in bwi_mac_fw_load() argument
1005 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_fw_load()
1014 ((const uint8_t *)mac->mac_ucode->data + BWI_FWHDR_SZ); in bwi_mac_fw_load()
1015 fw_len = (mac->mac_ucode->datasize - BWI_FWHDR_SZ) / sizeof(uint32_t); in bwi_mac_fw_load()
1029 ((const uint8_t *)mac->mac_pcm->data + BWI_FWHDR_SZ); in bwi_mac_fw_load()
1030 fw_len = (mac->mac_pcm->datasize - BWI_FWHDR_SZ) / sizeof(uint32_t); in bwi_mac_fw_load()
1060 device_printf(sc->sc_dev, in bwi_mac_fw_load()
1069 fw_rev = MOBJ_READ_2(mac, BWI_COMM_MOBJ, BWI_COMM_MOBJ_FWREV); in bwi_mac_fw_load()
1071 device_printf(sc->sc_dev, in bwi_mac_fw_load()
1076 device_printf(sc->sc_dev, in bwi_mac_fw_load()
1078 MOBJ_READ_2(mac, BWI_COMM_MOBJ, BWI_COMM_MOBJ_FWPATCHLV)); in bwi_mac_fw_load()
1083 bwi_mac_gpio_init(struct bwi_mac *mac) in bwi_mac_gpio_init() argument
1085 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_gpio_init()
1097 if (sc->sc_bbp_id == BWI_BBPID_BCM4301) { in bwi_mac_gpio_init()
1101 if (sc->sc_card_flags & BWI_CARD_F_PA_GPIO9) { in bwi_mac_gpio_init()
1118 bwi_mac_gpio_fini(struct bwi_mac *mac) in bwi_mac_gpio_fini() argument
1120 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_gpio_fini()
1135 bwi_mac_fw_load_iv(struct bwi_mac *mac, const struct firmware *fw) in bwi_mac_fw_load_iv() argument
1137 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_fw_load_iv()
1143 hdr = (const struct bwi_fwhdr *)fw->data; in bwi_mac_fw_load_iv()
1144 n = be32toh(hdr->fw_iv_cnt); in bwi_mac_fw_load_iv()
1149 iv_img_size = fw->datasize - sizeof(*hdr); in bwi_mac_fw_load_iv()
1153 ((const uint8_t *)fw->data + sizeof(*hdr)); in bwi_mac_fw_load_iv()
1159 if (iv_img_size < sizeof(iv->iv_ofs)) { in bwi_mac_fw_load_iv()
1160 device_printf(sc->sc_dev, "invalid IV image, ofs\n"); in bwi_mac_fw_load_iv()
1163 iv_img_size -= sizeof(iv->iv_ofs); in bwi_mac_fw_load_iv()
1164 sz += sizeof(iv->iv_ofs); in bwi_mac_fw_load_iv()
1166 iv_ofs = be16toh(iv->iv_ofs); in bwi_mac_fw_load_iv()
1170 device_printf(sc->sc_dev, "invalid ofs (0x%04x) " in bwi_mac_fw_load_iv()
1178 if (iv_img_size < sizeof(iv->iv_val.val32)) { in bwi_mac_fw_load_iv()
1179 device_printf(sc->sc_dev, in bwi_mac_fw_load_iv()
1183 iv_img_size -= sizeof(iv->iv_val.val32); in bwi_mac_fw_load_iv()
1184 sz += sizeof(iv->iv_val.val32); in bwi_mac_fw_load_iv()
1186 val32 = be32toh(iv->iv_val.val32); in bwi_mac_fw_load_iv()
1191 if (iv_img_size < sizeof(iv->iv_val.val16)) { in bwi_mac_fw_load_iv()
1192 device_printf(sc->sc_dev, in bwi_mac_fw_load_iv()
1196 iv_img_size -= sizeof(iv->iv_val.val16); in bwi_mac_fw_load_iv()
1197 sz += sizeof(iv->iv_val.val16); in bwi_mac_fw_load_iv()
1199 val16 = be16toh(iv->iv_val.val16); in bwi_mac_fw_load_iv()
1207 device_printf(sc->sc_dev, "invalid IV image, size left %d\n", in bwi_mac_fw_load_iv()
1215 bwi_mac_fw_init(struct bwi_mac *mac) in bwi_mac_fw_init() argument
1217 device_t dev = mac->mac_sc->sc_dev; in bwi_mac_fw_init()
1220 error = bwi_mac_fw_load_iv(mac, mac->mac_iv); in bwi_mac_fw_init()
1226 if (mac->mac_iv_ext != NULL) { in bwi_mac_fw_init()
1227 error = bwi_mac_fw_load_iv(mac, mac->mac_iv_ext); in bwi_mac_fw_init()
1235 bwi_mac_opmode_init(struct bwi_mac *mac) in bwi_mac_opmode_init() argument
1237 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_opmode_init()
1238 struct ieee80211com *ic = &sc->sc_ic; in bwi_mac_opmode_init()
1246 MOBJ_WRITE_2(mac, BWI_COMM_MOBJ, BWI_COMM_MOBJ_PROBE_RESP_TO, 0); in bwi_mac_opmode_init()
1262 if (mac->mac_rev < 5) in bwi_mac_opmode_init()
1265 switch (ic->ic_opmode) { in bwi_mac_opmode_init()
1287 if (ic->ic_promisc > 0) in bwi_mac_opmode_init()
1292 if (ic->ic_opmode != IEEE80211_M_IBSS && in bwi_mac_opmode_init()
1293 ic->ic_opmode != IEEE80211_M_HOSTAP) { in bwi_mac_opmode_init()
1294 if (sc->sc_bbp_id == BWI_BBPID_BCM4306 && sc->sc_bbp_rev == 3) in bwi_mac_opmode_init()
1305 bwi_mac_hostflags_init(struct bwi_mac *mac) in bwi_mac_hostflags_init() argument
1307 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_hostflags_init()
1308 struct bwi_phy *phy = &mac->mac_phy; in bwi_mac_hostflags_init()
1309 struct bwi_rf *rf = &mac->mac_rf; in bwi_mac_hostflags_init()
1312 if (phy->phy_mode == IEEE80211_MODE_11A) in bwi_mac_hostflags_init()
1315 host_flags = HFLAGS_READ(mac); in bwi_mac_hostflags_init()
1318 if (phy->phy_mode == IEEE80211_MODE_11G) { in bwi_mac_hostflags_init()
1319 if (phy->phy_rev == 1) in bwi_mac_hostflags_init()
1321 if (sc->sc_card_flags & BWI_CARD_F_PA_GPIO9) in bwi_mac_hostflags_init()
1323 } else if (phy->phy_mode == IEEE80211_MODE_11B) { in bwi_mac_hostflags_init()
1324 if (phy->phy_rev >= 2 && rf->rf_type == BWI_RF_T_BCM2050) in bwi_mac_hostflags_init()
1327 panic("unknown PHY mode %u\n", phy->phy_mode); in bwi_mac_hostflags_init()
1330 HFLAGS_WRITE(mac, host_flags); in bwi_mac_hostflags_init()
1334 bwi_mac_bss_param_init(struct bwi_mac *mac) in bwi_mac_bss_param_init() argument
1336 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_bss_param_init()
1337 struct bwi_phy *phy = &mac->mac_phy; in bwi_mac_bss_param_init()
1338 struct ieee80211com *ic = &sc->sc_ic; in bwi_mac_bss_param_init()
1351 bwi_mac_set_retry_lim(mac, &lim); in bwi_mac_bss_param_init()
1357 MOBJ_WRITE_2(mac, BWI_COMM_MOBJ, BWI_COMM_MOBJ_PROBE_RESP_TO, 1); in bwi_mac_bss_param_init()
1360 * XXX MAC level acknowledge and CW min/max should depend in bwi_mac_bss_param_init()
1364 if (phy->phy_mode == IEEE80211_MODE_11B) { in bwi_mac_bss_param_init()
1367 bwi_mac_set_ackrates(mac, rt, in bwi_mac_bss_param_init()
1368 &ic->ic_sup_rates[IEEE80211_MODE_11B]); in bwi_mac_bss_param_init()
1372 bwi_mac_set_ackrates(mac, rt, in bwi_mac_bss_param_init()
1373 &ic->ic_sup_rates[IEEE80211_MODE_11G]); in bwi_mac_bss_param_init()
1379 if (phy->phy_mode == IEEE80211_MODE_11B) in bwi_mac_bss_param_init()
1383 MOBJ_WRITE_2(mac, BWI_80211_MOBJ, BWI_80211_MOBJ_CWMIN, cw_min); in bwi_mac_bss_param_init()
1388 MOBJ_WRITE_2(mac, BWI_80211_MOBJ, BWI_80211_MOBJ_CWMAX, in bwi_mac_bss_param_init()
1393 bwi_mac_set_retry_lim(struct bwi_mac *mac, const struct bwi_retry_lim *lim) in bwi_mac_set_retry_lim() argument
1396 MOBJ_WRITE_2(mac, BWI_80211_MOBJ, BWI_80211_MOBJ_SHRETRY, in bwi_mac_set_retry_lim()
1397 lim->shretry); in bwi_mac_set_retry_lim()
1398 MOBJ_WRITE_2(mac, BWI_80211_MOBJ, BWI_80211_MOBJ_LGRETRY, in bwi_mac_set_retry_lim()
1399 lim->lgretry); in bwi_mac_set_retry_lim()
1402 MOBJ_WRITE_2(mac, BWI_COMM_MOBJ, BWI_COMM_MOBJ_SHRETRY_FB, in bwi_mac_set_retry_lim()
1403 lim->shretry_fb); in bwi_mac_set_retry_lim()
1404 MOBJ_WRITE_2(mac, BWI_COMM_MOBJ, BWI_COMM_MOBJ_LGRETEY_FB, in bwi_mac_set_retry_lim()
1405 lim->lgretry_fb); in bwi_mac_set_retry_lim()
1409 bwi_mac_set_ackrates(struct bwi_mac *mac, const struct ieee80211_rate_table *rt, in bwi_mac_set_ackrates() argument
1415 for (i = 0; i < rs->rs_nrates; ++i) { in bwi_mac_set_ackrates()
1420 rs->rs_rates[i] & IEEE80211_RATE_VAL); in bwi_mac_set_ackrates()
1432 rs->rs_rates[i] & IEEE80211_RATE_VAL, in bwi_mac_set_ackrates()
1435 MOBJ_WRITE_2(mac, BWI_COMM_MOBJ, ofs + 0x20, in bwi_mac_set_ackrates()
1436 MOBJ_READ_2(mac, BWI_COMM_MOBJ, ofs)); in bwi_mac_set_ackrates()
1441 bwi_mac_start(struct bwi_mac *mac) in bwi_mac_start() argument
1443 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_start()
1452 return bwi_mac_config_ps(mac); in bwi_mac_start()
1456 bwi_mac_stop(struct bwi_mac *mac) in bwi_mac_stop() argument
1458 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_stop()
1461 error = bwi_mac_config_ps(mac); in bwi_mac_stop()
1477 device_printf(sc->sc_dev, "can't stop MAC\n"); in bwi_mac_stop()
1486 bwi_mac_config_ps(struct bwi_mac *mac) in bwi_mac_config_ps() argument
1488 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_config_ps()
1500 if (mac->mac_rev >= 5) { in bwi_mac_config_ps()
1505 if (MOBJ_READ_2(mac, BWI_COMM_MOBJ, in bwi_mac_config_ps()
1511 device_printf(sc->sc_dev, "config PS failed\n"); in bwi_mac_config_ps()
1520 bwi_mac_reset_hwkeys(struct bwi_mac *mac) in bwi_mac_reset_hwkeys() argument
1523 MOBJ_READ_2(mac, BWI_COMM_MOBJ, BWI_COMM_MOBJ_KEYTABLE_OFS); in bwi_mac_reset_hwkeys()
1527 bwi_mac_shutdown(struct bwi_mac *mac) in bwi_mac_shutdown() argument
1529 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_shutdown()
1532 if (mac->mac_flags & BWI_MAC_F_HAS_TXSTATS) in bwi_mac_shutdown()
1533 sc->sc_free_txstats(sc); in bwi_mac_shutdown()
1535 sc->sc_free_rx_ring(sc); in bwi_mac_shutdown()
1538 sc->sc_free_tx_ring(sc, i); in bwi_mac_shutdown()
1540 bwi_rf_off(mac); in bwi_mac_shutdown()
1544 bwi_mac_gpio_fini(mac); in bwi_mac_shutdown()
1546 bwi_rf_off(mac); /* XXX again */ in bwi_mac_shutdown()
1548 bwi_regwin_disable(sc, &mac->mac_regwin, 0); in bwi_mac_shutdown()
1550 mac->mac_flags &= ~BWI_MAC_F_INITED; in bwi_mac_shutdown()
1554 bwi_mac_get_property(struct bwi_mac *mac) in bwi_mac_get_property() argument
1556 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_get_property()
1567 mac->mac_flags |= BWI_MAC_F_BSWAP; in bwi_mac_get_property()
1573 old_bus_space = sc->sc_bus_space; in bwi_mac_get_property()
1579 sc->sc_bus_space = BWI_BUS_SPACE_64BIT; in bwi_mac_get_property()
1588 sc->sc_bus_space = BWI_BUS_SPACE_32BIT; in bwi_mac_get_property()
1593 sc->sc_bus_space = BWI_BUS_SPACE_30BIT; in bwi_mac_get_property()
1599 if (old_bus_space != 0 && old_bus_space != sc->sc_bus_space) { in bwi_mac_get_property()
1600 device_printf(sc->sc_dev, "MACs bus space mismatch!\n"); in bwi_mac_get_property()
1607 bwi_mac_updateslot(struct bwi_mac *mac, int shslot) in bwi_mac_updateslot() argument
1611 if (mac->mac_phy.phy_mode == IEEE80211_MODE_11B) in bwi_mac_updateslot()
1619 CSR_WRITE_2(mac->mac_sc, BWI_MAC_SLOTTIME, in bwi_mac_updateslot()
1621 MOBJ_WRITE_2(mac, BWI_COMM_MOBJ, BWI_COMM_MOBJ_SLOTTIME, slot_time); in bwi_mac_updateslot()
1627 struct bwi_mac *mac; in bwi_mac_attach() local
1630 KASSERT(sc->sc_nmac <= BWI_MAC_MAX && sc->sc_nmac >= 0, in bwi_mac_attach()
1631 ("sc_nmac %d", sc->sc_nmac)); in bwi_mac_attach()
1633 if (sc->sc_nmac == BWI_MAC_MAX) { in bwi_mac_attach()
1634 device_printf(sc->sc_dev, "too many MACs\n"); in bwi_mac_attach()
1639 * More than one MAC is only supported by BCM4309 in bwi_mac_attach()
1641 if (sc->sc_nmac != 0 && in bwi_mac_attach()
1642 sc->sc_pci_did != PCI_PRODUCT_BROADCOM_BCM4309) { in bwi_mac_attach()
1644 "ignore second MAC"); in bwi_mac_attach()
1648 mac = &sc->sc_mac[sc->sc_nmac]; in bwi_mac_attach()
1651 if (BWI_REGWIN_EXIST(&mac->mac_regwin)) { in bwi_mac_attach()
1652 device_printf(sc->sc_dev, "%dth MAC already attached\n", in bwi_mac_attach()
1653 sc->sc_nmac); in bwi_mac_attach()
1658 * Test whether the revision of this MAC is supported in bwi_mac_attach()
1665 device_printf(sc->sc_dev, "MAC rev %u is " in bwi_mac_attach()
1670 BWI_CREATE_MAC(mac, sc, id, rev); in bwi_mac_attach()
1671 sc->sc_nmac++; in bwi_mac_attach()
1673 if (mac->mac_rev < 5) { in bwi_mac_attach()
1674 mac->mac_flags |= BWI_MAC_F_HAS_TXSTATS; in bwi_mac_attach()
1678 mac->mac_flags |= BWI_MAC_F_PHYE_RESET; in bwi_mac_attach()
1681 device_printf(sc->sc_dev, "MAC: rev %u\n", rev); in bwi_mac_attach()
1688 int bbp_atten, rf_atten, rf_atten_lim = -1; in bwi_mac_balance_atten()
1711 bbp_atten += (BWI_RF_ATTEN_FACTOR * (rf_atten - rf_atten_lim)); in bwi_mac_balance_atten()
1720 bbp_atten -= BWI_RF_ATTEN_FACTOR; in bwi_mac_balance_atten()
1725 --rf_atten; in bwi_mac_balance_atten()
1745 bwi_mac_adjust_tpctl(struct bwi_mac *mac, int rf_atten_adj, int bbp_atten_adj) in bwi_mac_adjust_tpctl() argument
1747 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_adjust_tpctl()
1748 struct bwi_rf *rf = &mac->mac_rf; in bwi_mac_adjust_tpctl()
1752 bcopy(&mac->mac_tpctl, &tpctl, sizeof(tpctl)); in bwi_mac_adjust_tpctl()
1764 if (rf->rf_type == BWI_RF_T_BCM2050 && rf->rf_rev == 2) { in bwi_mac_adjust_tpctl()
1770 } else if (sc->sc_card_flags & BWI_CARD_F_PA_GPIO9) { in bwi_mac_adjust_tpctl()
1772 (BWI_RF_ATTEN_FACTOR * (rf_atten - 2)); in bwi_mac_adjust_tpctl()
1779 rf_atten -= 3; in bwi_mac_adjust_tpctl()
1781 bbp_atten -= 2; in bwi_mac_adjust_tpctl()
1782 rf_atten -= 2; in bwi_mac_adjust_tpctl()
1792 bwi_mac_lock(mac); in bwi_mac_adjust_tpctl()
1793 bwi_mac_set_tpctl_11bg(mac, &tpctl); in bwi_mac_adjust_tpctl()
1794 bwi_mac_unlock(mac); in bwi_mac_adjust_tpctl()
1798 * http://bcm-specs.sipsolutions.net/RecalculateTransmissionPower
1801 bwi_mac_calibrate_txpower(struct bwi_mac *mac, enum bwi_txpwrcb_type type) in bwi_mac_calibrate_txpower() argument
1803 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_calibrate_txpower()
1804 struct bwi_rf *rf = &mac->mac_rf; in bwi_mac_calibrate_txpower()
1809 if (!sc->sc_txpwr_calib) in bwi_mac_calibrate_txpower()
1812 if (mac->mac_flags & BWI_MAC_F_TPCTL_ERROR) { in bwi_mac_calibrate_txpower()
1828 error = bwi_rf_get_latest_tssi(mac, tssi, BWI_COMM_MOBJ_TSSI_DS); in bwi_mac_calibrate_txpower()
1833 if (mac->mac_phy.phy_mode == IEEE80211_MODE_11B) { in bwi_mac_calibrate_txpower()
1843 error = bwi_rf_get_latest_tssi(mac, tssi, in bwi_mac_calibrate_txpower()
1863 bwi_rf_clear_tssi(mac); in bwi_mac_calibrate_txpower()
1876 if (ofdm_tssi && (HFLAGS_READ(mac) & BWI_HFLAG_PWR_BOOST_DS)) in bwi_mac_calibrate_txpower()
1877 tssi_avg -= 13; in bwi_mac_calibrate_txpower()
1881 error = bwi_rf_tssi2dbm(mac, tssi_avg, &cur_txpwr); in bwi_mac_calibrate_txpower()
1887 txpwr_diff = rf->rf_txpower_max - cur_txpwr; /* XXX ni_txpower */ in bwi_mac_calibrate_txpower()
1889 rf_atten_adj = -howmany(txpwr_diff, 8); in bwi_mac_calibrate_txpower()
1894 bbp_atten_adj = -txpwr_diff; in bwi_mac_calibrate_txpower()
1896 bbp_atten_adj = -(txpwr_diff / 2); in bwi_mac_calibrate_txpower()
1898 bbp_atten_adj -= (BWI_RF_ATTEN_FACTOR * rf_atten_adj); in bwi_mac_calibrate_txpower()
1911 bwi_mac_adjust_tpctl(mac, rf_atten_adj, bbp_atten_adj); in bwi_mac_calibrate_txpower()
1916 bwi_mac_lock(struct bwi_mac *mac) in bwi_mac_lock() argument
1918 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_lock()
1919 struct ieee80211com *ic = &sc->sc_ic; in bwi_mac_lock()
1921 KASSERT((mac->mac_flags & BWI_MAC_F_LOCKED) == 0, in bwi_mac_lock()
1922 ("mac_flags 0x%x", mac->mac_flags)); in bwi_mac_lock()
1924 if (mac->mac_rev < 3) in bwi_mac_lock()
1925 bwi_mac_stop(mac); in bwi_mac_lock()
1926 else if (ic->ic_opmode != IEEE80211_M_HOSTAP) in bwi_mac_lock()
1927 bwi_mac_config_ps(mac); in bwi_mac_lock()
1935 mac->mac_flags |= BWI_MAC_F_LOCKED; in bwi_mac_lock()
1939 bwi_mac_unlock(struct bwi_mac *mac) in bwi_mac_unlock() argument
1941 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_unlock()
1942 struct ieee80211com *ic = &sc->sc_ic; in bwi_mac_unlock()
1944 KASSERT(mac->mac_flags & BWI_MAC_F_LOCKED, in bwi_mac_unlock()
1945 ("mac_flags 0x%x", mac->mac_flags)); in bwi_mac_unlock()
1951 if (mac->mac_rev < 3) in bwi_mac_unlock()
1952 bwi_mac_start(mac); in bwi_mac_unlock()
1953 else if (ic->ic_opmode != IEEE80211_M_HOSTAP) in bwi_mac_unlock()
1954 bwi_mac_config_ps(mac); in bwi_mac_unlock()
1956 mac->mac_flags &= ~BWI_MAC_F_LOCKED; in bwi_mac_unlock()
1960 bwi_mac_set_promisc(struct bwi_mac *mac, int promisc) in bwi_mac_set_promisc() argument
1962 struct bwi_softc *sc = mac->mac_sc; in bwi_mac_set_promisc()
1964 if (mac->mac_rev < 5) /* Promisc is always on */ in bwi_mac_set_promisc()