Lines Matching refs:lhw
294 struct lkpi_hw *lhw; in lkpi_80211_dump_lvif_stas() local
306 lhw = vap->iv_ic->ic_softc; in lkpi_80211_dump_lvif_stas()
307 hw = LHW_TO_HW(lhw); in lkpi_80211_dump_lvif_stas()
1297 lkpi_find_lkpi80211_chan(struct lkpi_hw *lhw, in lkpi_find_lkpi80211_chan() argument
1305 hw = LHW_TO_HW(lhw); in lkpi_find_lkpi80211_chan()
1329 struct lkpi_hw *lhw;
1342 lhw = ic->ic_softc;
1343 chan = lkpi_find_lkpi80211_chan(lhw, c);
1451 struct lkpi_hw *lhw; in lkpi_iv_key_delete() local
1462 lhw = ic->ic_softc; in lkpi_iv_key_delete()
1463 hw = LHW_TO_HW(lhw); in lkpi_iv_key_delete()
1566 struct lkpi_hw *lhw; in lkpi_iv_key_set() local
1580 lhw = ic->ic_softc; in lkpi_iv_key_set()
1581 hw = LHW_TO_HW(lhw); in lkpi_iv_key_set()
1760 struct lkpi_hw *lhw; in lkpi_iv_key_update_begin() local
1767 lhw = ic->ic_softc; in lkpi_iv_key_update_begin()
1768 hw = LHW_TO_HW(lhw); in lkpi_iv_key_update_begin()
1827 struct lkpi_hw *lhw; in lkpi_iv_key_update_end() local
1833 lhw = ic->ic_softc; in lkpi_iv_key_update_end()
1834 hw = LHW_TO_HW(lhw); in lkpi_iv_key_update_end()
1884 lkpi_cleanup_mcast_list_locked(struct lkpi_hw *lhw) in lkpi_cleanup_mcast_list_locked() argument
1889 if (lhw->mc_list.count != 0) { in lkpi_cleanup_mcast_list_locked()
1890 list_for_each_safe(le, next, &lhw->mc_list.addr_list) { in lkpi_cleanup_mcast_list_locked()
1893 lhw->mc_list.count--; in lkpi_cleanup_mcast_list_locked()
1897 KASSERT(lhw->mc_list.count == 0, ("%s: mc_list %p count %d != 0\n", in lkpi_cleanup_mcast_list_locked()
1898 __func__, &lhw->mc_list, lhw->mc_list.count)); in lkpi_cleanup_mcast_list_locked()
1939 struct lkpi_hw *lhw; in lkpi_update_mcast_filter() local
1945 lhw = ic->ic_softc; in lkpi_update_mcast_filter()
1947 LKPI_80211_LHW_SCAN_LOCK(lhw); in lkpi_update_mcast_filter()
1948 scanning = (lhw->scan_flags & LKPI_LHW_SCAN_RUNNING) != 0; in lkpi_update_mcast_filter()
1949 LKPI_80211_LHW_SCAN_UNLOCK(lhw); in lkpi_update_mcast_filter()
1951 LKPI_80211_LHW_MC_LOCK(lhw); in lkpi_update_mcast_filter()
1957 if (lhw->mc_all_multi || lhw->ops->prepare_multicast == NULL) in lkpi_update_mcast_filter()
1960 hw = LHW_TO_HW(lhw); in lkpi_update_mcast_filter()
1961 mc = lkpi_80211_mo_prepare_multicast(hw, &lhw->mc_list); in lkpi_update_mcast_filter()
1963 changed_flags = (lhw->mc_flags ^ flags) & FIF_FLAGS_MASK; in lkpi_update_mcast_filter()
1965 lhw->mc_flags = flags; in lkpi_update_mcast_filter()
1970 __func__, changed_flags, lhw->mc_list.count, lhw->mc_flags); in lkpi_update_mcast_filter()
1973 LKPI_80211_LHW_MC_UNLOCK(lhw); in lkpi_update_mcast_filter()
2062 lkpi_stop_hw_scan(struct lkpi_hw *lhw, struct ieee80211_vif *vif) in lkpi_stop_hw_scan() argument
2068 TRACE_SCAN(lhw->ic, "scan_flags %b", lhw->scan_flags, LKPI_LHW_SCAN_BITS); in lkpi_stop_hw_scan()
2070 LKPI_80211_LHW_SCAN_LOCK(lhw); in lkpi_stop_hw_scan()
2071 cancel = (lhw->scan_flags & LKPI_LHW_SCAN_RUNNING) != 0; in lkpi_stop_hw_scan()
2072 LKPI_80211_LHW_SCAN_UNLOCK(lhw); in lkpi_stop_hw_scan()
2076 hw = LHW_TO_HW(lhw); in lkpi_stop_hw_scan()
2078 IEEE80211_UNLOCK(lhw->ic); in lkpi_stop_hw_scan()
2085 LKPI_80211_LHW_SCAN_LOCK(lhw); in lkpi_stop_hw_scan()
2086 if ((lhw->scan_flags & LKPI_LHW_SCAN_RUNNING) != 0) in lkpi_stop_hw_scan()
2087 error = msleep(lhw, &lhw->scan_mtx, 0, "lhwscanstop", hz/2); in lkpi_stop_hw_scan()
2088 cancel = (lhw->scan_flags & LKPI_LHW_SCAN_RUNNING) != 0; in lkpi_stop_hw_scan()
2089 LKPI_80211_LHW_SCAN_UNLOCK(lhw); in lkpi_stop_hw_scan()
2091 IEEE80211_LOCK(lhw->ic); in lkpi_stop_hw_scan()
2094 ic_printf(lhw->ic, "%s: failed to cancel scan: %d (%p, %p)\n", in lkpi_stop_hw_scan()
2095 __func__, error, lhw, vif); in lkpi_stop_hw_scan()
2101 struct lkpi_hw *lhw; in lkpi_hw_conf_idle() local
2112 lhw = HW_TO_LHW(hw); in lkpi_hw_conf_idle()
2113 ic_printf(lhw->ic, "ERROR: %s: config %#0x returned %d\n", in lkpi_hw_conf_idle()
2120 struct lkpi_hw *lhw) in lkpi_disassoc() argument
2134 lkpi_update_mcast_filter(lhw->ic); in lkpi_disassoc()
2200 lkpi_80211_flush_tx(struct lkpi_hw *lhw, struct lkpi_sta *lsta) in lkpi_80211_flush_tx() argument
2208 hw = LHW_TO_HW(lhw); in lkpi_80211_flush_tx()
2328 struct lkpi_hw *lhw; in lkpi_find_lchanctx_reserved() local
2332 lhw = HW_TO_LHW(hw); in lkpi_find_lchanctx_reserved()
2336 list_for_each_entry_rcu(lchanctx, &lhw->lchanctx_list_reserved, entry) { in lkpi_find_lchanctx_reserved()
2346 list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list_reserved); in lkpi_find_lchanctx_reserved()
2380 struct lkpi_hw *lhw; in lkpi_set_chanctx_conf() local
2397 lhw = HW_TO_LHW(hw); in lkpi_set_chanctx_conf()
2405 ic_printf(lhw->ic, "%s:%d: mo_add_chanctx " in lkpi_set_chanctx_conf()
2418 list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list); in lkpi_set_chanctx_conf()
2428 ic_printf(lhw->ic, "%s:%d: mo_assign_vif_chanctx " in lkpi_set_chanctx_conf()
2436 list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list_reserved); in lkpi_set_chanctx_conf()
2445 struct lkpi_hw *lhw; in lkpi_remove_chanctx() local
2469 lhw = HW_TO_LHW(hw); in lkpi_remove_chanctx()
2472 list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list_reserved); in lkpi_remove_chanctx()
2545 struct lkpi_hw *lhw; in lkpi_sta_scan_to_auth() local
2581 lhw = vap->iv_ic->ic_softc; in lkpi_sta_scan_to_auth()
2582 chan = lkpi_find_lkpi80211_chan(lhw, ni->ni_chan); in lkpi_sta_scan_to_auth()
2590 hw = LHW_TO_HW(lhw); in lkpi_sta_scan_to_auth()
2797 struct lkpi_hw *lhw; in lkpi_sta_auth_to_assoc() local
2805 lhw = vap->iv_ic->ic_softc; in lkpi_sta_auth_to_assoc()
2806 hw = LHW_TO_HW(lhw); in lkpi_sta_auth_to_assoc()
2905 struct lkpi_hw *lhw; in lkpi_sta_assoc_to_run() local
2916 lhw = vap->iv_ic->ic_softc; in lkpi_sta_assoc_to_run()
2917 hw = LHW_TO_HW(lhw); in lkpi_sta_assoc_to_run()
2971 bss_changed |= lkpi_wme_update(lhw, vap, true); in lkpi_sta_assoc_to_run()
3081 struct lkpi_hw *lhw; in lkpi_sta_run_to_assoc() local
3095 lhw = vap->iv_ic->ic_softc; in lkpi_sta_run_to_assoc()
3096 hw = LHW_TO_HW(lhw); in lkpi_sta_run_to_assoc()
3179 lkpi_80211_flush_tx(lhw, lsta); in lkpi_sta_run_to_assoc()
3255 lkpi_disassoc(sta, vif, lhw); in lkpi_sta_run_to_assoc()
3276 struct lkpi_hw *lhw; in lkpi_sta_assoc_to_auth() local
3285 lhw = vap->iv_ic->ic_softc; in lkpi_sta_assoc_to_auth()
3286 hw = LHW_TO_HW(lhw); in lkpi_sta_assoc_to_auth()
3356 struct lkpi_hw *lhw; in lkpi_sta_auth_to_scan() local
3367 lhw = vap->iv_ic->ic_softc; in lkpi_sta_auth_to_scan()
3368 hw = LHW_TO_HW(lhw); in lkpi_sta_auth_to_scan()
3482 bss_changed |= lkpi_disassoc(sta, vif, lhw); in lkpi_sta_auth_to_scan()
3568 struct lkpi_hw *lhw; in lkpi_sta_a_to_a() local
3576 lhw = vap->iv_ic->ic_softc; in lkpi_sta_a_to_a()
3577 hw = LHW_TO_HW(lhw); in lkpi_sta_a_to_a()
3752 struct lkpi_hw *lhw; in lkpi_iv_newstate() local
3771 lhw = ic->ic_softc; in lkpi_iv_newstate()
3777 lkpi_stop_hw_scan(lhw, vif); in lkpi_iv_newstate()
3868 lkpi_wme_update(struct lkpi_hw *lhw, struct ieee80211vap *vap, bool planned) in lkpi_wme_update() argument
3881 hw = LHW_TO_HW(lhw); in lkpi_wme_update()
3894 if (lhw->ops->conf_tx == NULL) in lkpi_wme_update()
3898 lhw->update_wme = true; in lkpi_wme_update()
3901 lhw->update_wme = false; in lkpi_wme_update()
3903 ic = lhw->ic; in lkpi_wme_update()
3941 struct lkpi_hw *lhw; in lkpi_ic_wme_update() local
3949 lhw = ic->ic_softc; in lkpi_ic_wme_update()
3950 hw = LHW_TO_HW(lhw); in lkpi_ic_wme_update()
3953 lkpi_wme_update(lhw, vap, false); in lkpi_ic_wme_update()
3963 struct lkpi_hw *lhw; in lkpi_iv_sta_recv_mgmt() local
3990 lhw = ni->ni_ic->ic_softc; in lkpi_iv_sta_recv_mgmt()
3991 hw = LHW_TO_HW(lhw); in lkpi_iv_sta_recv_mgmt()
4038 struct lkpi_hw *lhw; in lkpi_ic_vap_create() local
4053 lhw = ic->ic_softc; in lkpi_ic_vap_create()
4054 hw = LHW_TO_HW(lhw); in lkpi_ic_vap_create()
4090 vif->bss_conf.chanreq.oper.chan = lhw->dflt_chandef.chan; in lkpi_ic_vap_create()
4162 LKPI_80211_LHW_LVIF_LOCK(lhw); in lkpi_ic_vap_create()
4163 TAILQ_INSERT_TAIL(&lhw->lvif_head, lvif, lvif_entry); in lkpi_ic_vap_create()
4164 LKPI_80211_LHW_LVIF_UNLOCK(lhw); in lkpi_ic_vap_create()
4208 if (lkpi_hwcrypto && lhw->ops->set_key != NULL) { in lkpi_ic_vap_create()
4290 struct lkpi_hw *lhw; in lkpi_ic_vap_delete() local
4298 lhw = ic->ic_softc; in lkpi_ic_vap_delete()
4299 hw = LHW_TO_HW(lhw); in lkpi_ic_vap_delete()
4308 LKPI_80211_LHW_LVIF_LOCK(lhw); in lkpi_ic_vap_delete()
4309 TAILQ_REMOVE(&lhw->lvif_head, lvif, lvif_entry); in lkpi_ic_vap_delete()
4310 LKPI_80211_LHW_LVIF_UNLOCK(lhw); in lkpi_ic_vap_delete()
4330 struct lkpi_hw *lhw; in lkpi_ic_update_mcast() local
4332 lhw = ic->ic_softc; in lkpi_ic_update_mcast()
4334 LKPI_80211_LHW_MC_LOCK(lhw); in lkpi_ic_update_mcast()
4336 lkpi_cleanup_mcast_list_locked(lhw); in lkpi_ic_update_mcast()
4342 lkpi_ic_update_mcast_copy, &lhw->mc_list); in lkpi_ic_update_mcast()
4343 lhw->mc_all_multi = false; in lkpi_ic_update_mcast()
4345 lhw->mc_all_multi = true; in lkpi_ic_update_mcast()
4347 LKPI_80211_LHW_MC_UNLOCK(lhw); in lkpi_ic_update_mcast()
4371 struct lkpi_hw *lhw; in lkpi_ic_parent() local
4380 lhw = ic->ic_softc; in lkpi_ic_parent()
4381 hw = LHW_TO_HW(lhw); in lkpi_ic_parent()
4546 lkpi_enable_hw_scan(struct lkpi_hw *lhw) in lkpi_enable_hw_scan() argument
4549 if (lhw->ops->hw_scan) { in lkpi_enable_hw_scan()
4557 lhw->ic->ic_flags_ext |= IEEE80211_FEXT_SCAN_OFFLOAD; in lkpi_enable_hw_scan()
4558 lhw->scan_flags |= LKPI_LHW_SCAN_HW; in lkpi_enable_hw_scan()
4655 struct lkpi_hw *lhw; in lkpi_ic_scan_start() local
4664 lhw = ic->ic_softc; in lkpi_ic_scan_start()
4667 TRACE_SCAN(ic, "scan_flags %b", lhw->scan_flags, LKPI_LHW_SCAN_BITS); in lkpi_ic_scan_start()
4669 LKPI_80211_LHW_SCAN_LOCK(lhw); in lkpi_ic_scan_start()
4670 if ((lhw->scan_flags & LKPI_LHW_SCAN_RUNNING) != 0) { in lkpi_ic_scan_start()
4672 LKPI_80211_LHW_SCAN_UNLOCK(lhw); in lkpi_ic_scan_start()
4675 lhw->scan_flags, LKPI_LHW_SCAN_BITS); in lkpi_ic_scan_start()
4679 is_hw_scan = (lhw->scan_flags & LKPI_LHW_SCAN_HW) != 0; in lkpi_ic_scan_start()
4680 LKPI_80211_LHW_SCAN_UNLOCK(lhw); in lkpi_ic_scan_start()
4686 lhw->scan_flags, LKPI_LHW_SCAN_BITS, vap->iv_state); in lkpi_ic_scan_start()
4692 hw = LHW_TO_HW(lhw); in lkpi_ic_scan_start()
4703 LKPI_80211_LHW_SCAN_LOCK(lhw); in lkpi_ic_scan_start()
4704 lhw->scan_flags |= LKPI_LHW_SCAN_RUNNING; in lkpi_ic_scan_start()
4705 LKPI_80211_LHW_SCAN_UNLOCK(lhw); in lkpi_ic_scan_start()
4710 lhw->scan_flags, LKPI_LHW_SCAN_BITS); in lkpi_ic_scan_start()
4800 s6ghzlen + chan_len + lhw->supbands * lhw->scan_ie_len + in lkpi_ic_scan_start()
4933 LKPI_80211_LHW_SCAN_LOCK(lhw); in lkpi_ic_scan_start()
4935 running = (lhw->scan_flags & LKPI_LHW_SCAN_RUNNING) != 0; in lkpi_ic_scan_start()
4937 KASSERT(lhw->hw_req == NULL, ("%s: ic %p lhw %p hw_req %p " in lkpi_ic_scan_start()
4938 "!= NULL\n", __func__, ic, lhw, lhw->hw_req)); in lkpi_ic_scan_start()
4940 lhw->scan_flags |= LKPI_LHW_SCAN_RUNNING; in lkpi_ic_scan_start()
4941 lhw->hw_req = hw_req; in lkpi_ic_scan_start()
4943 LKPI_80211_LHW_SCAN_UNLOCK(lhw); in lkpi_ic_scan_start()
4949 lhw->scan_flags, LKPI_LHW_SCAN_BITS); in lkpi_ic_scan_start()
4957 lhw->scan_flags, LKPI_LHW_SCAN_BITS, hw_req->req.ie_len, in lkpi_ic_scan_start()
4969 lhw->scan_flags, LKPI_LHW_SCAN_BITS, error); in lkpi_ic_scan_start()
4988 LKPI_80211_LHW_SCAN_LOCK(lhw); in lkpi_ic_scan_start()
4989 if ((lhw->scan_flags & LKPI_LHW_SCAN_RUNNING) != 0) { in lkpi_ic_scan_start()
4991 free(lhw->hw_req, M_LKPI80211); in lkpi_ic_scan_start()
4992 lhw->hw_req = NULL; in lkpi_ic_scan_start()
5000 e = msleep(lhw, &lhw->scan_mtx, 0, "lhwscanstop", hz); in lkpi_ic_scan_start()
5001 scan_done = (lhw->scan_flags & LKPI_LHW_SCAN_RUNNING) != 0; in lkpi_ic_scan_start()
5006 lhw->scan_flags &= ~LKPI_LHW_SCAN_RUNNING; in lkpi_ic_scan_start()
5008 LKPI_80211_LHW_SCAN_UNLOCK(lhw); in lkpi_ic_scan_start()
5042 struct lkpi_hw *lhw; in lkpi_sw_scan_task() local
5049 lhw = vap->iv_ic->ic_softc; in lkpi_sw_scan_task()
5052 LKPI_80211_LHW_SCAN_LOCK(lhw); in lkpi_sw_scan_task()
5057 lhw->scan_flags &= ~LKPI_LHW_SCAN_HW; in lkpi_sw_scan_task()
5058 LKPI_80211_LHW_SCAN_UNLOCK(lhw); in lkpi_sw_scan_task()
5061 pending, lhw->scan_flags, LKPI_LHW_SCAN_BITS); in lkpi_sw_scan_task()
5078 struct lkpi_hw *lhw; in lkpi_ic_scan_end() local
5081 lhw = ic->ic_softc; in lkpi_ic_scan_end()
5082 TRACE_SCAN(ic, "scan_flags %b", lhw->scan_flags, LKPI_LHW_SCAN_BITS); in lkpi_ic_scan_end()
5084 LKPI_80211_LHW_SCAN_LOCK(lhw); in lkpi_ic_scan_end()
5085 if ((lhw->scan_flags & LKPI_LHW_SCAN_RUNNING) == 0) { in lkpi_ic_scan_end()
5086 LKPI_80211_LHW_SCAN_UNLOCK(lhw); in lkpi_ic_scan_end()
5089 is_hw_scan = (lhw->scan_flags & LKPI_LHW_SCAN_HW) != 0; in lkpi_ic_scan_end()
5090 LKPI_80211_LHW_SCAN_UNLOCK(lhw); in lkpi_ic_scan_end()
5101 hw = LHW_TO_HW(lhw); in lkpi_ic_scan_end()
5117 lkpi_enable_hw_scan(lhw); in lkpi_ic_scan_end()
5120 memset(&lhw->scan_chandef, 0, sizeof(lhw->scan_chandef)); in lkpi_ic_scan_end()
5122 LKPI_80211_LHW_SCAN_LOCK(lhw); in lkpi_ic_scan_end()
5123 wakeup(lhw); in lkpi_ic_scan_end()
5124 LKPI_80211_LHW_SCAN_UNLOCK(lhw); in lkpi_ic_scan_end()
5131 struct lkpi_hw *lhw; in lkpi_ic_scan_curchan() local
5134 lhw = ss->ss_ic->ic_softc; in lkpi_ic_scan_curchan()
5136 lhw->scan_flags, LKPI_LHW_SCAN_BITS, in lkpi_ic_scan_curchan()
5139 LKPI_80211_LHW_SCAN_LOCK(lhw); in lkpi_ic_scan_curchan()
5140 is_hw_scan = (lhw->scan_flags & LKPI_LHW_SCAN_HW) != 0; in lkpi_ic_scan_curchan()
5141 LKPI_80211_LHW_SCAN_UNLOCK(lhw); in lkpi_ic_scan_curchan()
5143 lhw->ic_scan_curchan(ss, maxdwell); in lkpi_ic_scan_curchan()
5149 struct lkpi_hw *lhw; in lkpi_ic_scan_mindwell() local
5152 lhw = ss->ss_ic->ic_softc; in lkpi_ic_scan_mindwell()
5154 lhw->scan_flags, LKPI_LHW_SCAN_BITS, in lkpi_ic_scan_mindwell()
5157 LKPI_80211_LHW_SCAN_LOCK(lhw); in lkpi_ic_scan_mindwell()
5158 is_hw_scan = (lhw->scan_flags & LKPI_LHW_SCAN_HW) != 0; in lkpi_ic_scan_mindwell()
5159 LKPI_80211_LHW_SCAN_UNLOCK(lhw); in lkpi_ic_scan_mindwell()
5161 lhw->ic_scan_mindwell(ss); in lkpi_ic_scan_mindwell()
5186 struct lkpi_hw *lhw; in lkpi_ic_set_channel() local
5197 lhw = ic->ic_softc; in lkpi_ic_set_channel()
5206 chan = lkpi_find_lkpi80211_chan(lhw, c); in lkpi_ic_set_channel()
5219 LKPI_80211_LHW_SCAN_LOCK(lhw); in lkpi_ic_set_channel()
5220 scan_running = (lhw->scan_flags & LKPI_LHW_SCAN_RUNNING) != 0; in lkpi_ic_set_channel()
5221 hw_scan = (lhw->scan_flags & LKPI_LHW_SCAN_HW) != 0; in lkpi_ic_set_channel()
5222 LKPI_80211_LHW_SCAN_UNLOCK(lhw); in lkpi_ic_set_channel()
5225 lhw->scan_flags, LKPI_LHW_SCAN_BITS, in lkpi_ic_set_channel()
5231 hw = LHW_TO_HW(lhw); in lkpi_ic_set_channel()
5248 cfg80211_chandef_create(&lhw->scan_chandef, chan, in lkpi_ic_set_channel()
5261 changed = lkpi_init_chanctx_conf(hw, &lhw->scan_chandef, chanctx_conf); in lkpi_ic_set_channel()
5265 lhw->scan_flags, LKPI_LHW_SCAN_BITS, in lkpi_ic_set_channel()
5270 } else if (lhw->emulate_chanctx) { in lkpi_ic_set_channel()
5351 struct lkpi_hw *lhw; in lkpi_ic_node_alloc() local
5357 lhw = ic->ic_softc; in lkpi_ic_node_alloc()
5360 if (lhw->ic_node_alloc == NULL) in lkpi_ic_node_alloc()
5363 ni = lhw->ic_node_alloc(vap, mac); in lkpi_ic_node_alloc()
5367 hw = LHW_TO_HW(lhw); in lkpi_ic_node_alloc()
5370 if (lhw->ic_node_free != NULL) in lkpi_ic_node_alloc()
5371 lhw->ic_node_free(ni); in lkpi_ic_node_alloc()
5382 struct lkpi_hw *lhw; in lkpi_ic_node_init() local
5386 lhw = ic->ic_softc; in lkpi_ic_node_init()
5388 if (lhw->ic_node_init != NULL) { in lkpi_ic_node_init()
5389 error = lhw->ic_node_init(ni); in lkpi_ic_node_init()
5404 struct lkpi_hw *lhw; in lkpi_ic_node_cleanup() local
5407 lhw = ic->ic_softc; in lkpi_ic_node_cleanup()
5412 if (lhw->ic_node_cleanup != NULL) in lkpi_ic_node_cleanup()
5413 lhw->ic_node_cleanup(ni); in lkpi_ic_node_cleanup()
5420 struct lkpi_hw *lhw; in lkpi_ic_node_free() local
5424 lhw = ic->ic_softc; in lkpi_ic_node_free()
5435 if (lhw->ic_node_free != NULL) in lkpi_ic_node_free()
5436 lhw->ic_node_free(ni); in lkpi_ic_node_free()
5691 struct lkpi_hw *lhw; local
5740 lhw = ic->ic_softc;
5741 hw = LHW_TO_HW(lhw);
5747 rtap = &lhw->rtap_tx;
6002 struct lkpi_hw *lhw; local
6005 lhw = ic->ic_softc;
6009 return (lhw->ic_recv_action(ni, wh, frm, efrm));
6016 struct lkpi_hw *lhw; local
6019 lhw = ic->ic_softc;
6023 return (lhw->ic_send_action(ni, category, action, sa));
6031 struct lkpi_hw *lhw; local
6034 lhw = ic->ic_softc;
6038 return (lhw->ic_ampdu_enable(ni, tap));
6052 struct lkpi_hw *lhw; local
6063 lhw = ic->ic_softc;
6064 hw = LHW_TO_HW(lhw);
6097 return (lhw->ic_addba_request(ni, tap, dialogtoken, baparamset, batimeout));
6112 struct lkpi_hw *lhw; local
6123 lhw = ic->ic_softc;
6124 hw = LHW_TO_HW(lhw);
6177 return (lhw->ic_addba_response(ni, tap, status, baparamset, batimeout));
6188 struct lkpi_hw *lhw; local
6199 lhw = ic->ic_softc;
6200 hw = LHW_TO_HW(lhw);
6237 lhw->ic_addba_stop(ni, tap);
6244 struct lkpi_hw *lhw; local
6247 lhw = ic->ic_softc;
6251 lhw->ic_addba_response_timeout(ni, tap);
6259 struct lkpi_hw *lhw; local
6262 lhw = ic->ic_softc;
6266 lhw->ic_bar_response(ni, tap, status);
6274 struct lkpi_hw *lhw; local
6285 lhw = ic->ic_softc;
6286 hw = LHW_TO_HW(lhw);
6343 error = lhw->ic_ampdu_rx_start(ni, rap, baparamset, batimeout, baseqctl);
6351 struct lkpi_hw *lhw; local
6364 lhw = ic->ic_softc;
6378 hw = LHW_TO_HW(lhw);
6434 lhw->ic_ampdu_rx_stop(ni, rap);
6494 struct lkpi_hw *lhw; local
6501 lhw = ic->ic_softc;
6502 hw = LHW_TO_HW(lhw);
6653 struct lkpi_hw *lhw; local
6705 wiphy = wiphy_new(&linuxkpi_mac80211cfgops, sizeof(*lhw) + priv_len);
6709 lhw = wiphy_priv(wiphy);
6710 lhw->ops = ops;
6712 LKPI_80211_LHW_SCAN_LOCK_INIT(lhw);
6713 LKPI_80211_LHW_TXQ_LOCK_INIT(lhw);
6714 spin_lock_init(&lhw->txq_lock);
6715 sx_init_flags(&lhw->lvif_sx, "lhw-lvif", SX_RECURSE | SX_DUPOK);
6716 LKPI_80211_LHW_MC_LOCK_INIT(lhw);
6717 TAILQ_INIT(&lhw->lvif_head);
6718 __hw_addr_init(&lhw->mc_list);
6720 spin_lock_init(&lhw->txq_scheduled_lock[ac]);
6721 lhw->txq_generation[ac] = 1;
6722 TAILQ_INIT(&lhw->txq_scheduled[ac]);
6726 INIT_LIST_HEAD(&lhw->lchanctx_list);
6727 INIT_LIST_HEAD(&lhw->lchanctx_list_reserved);
6728 lhw->emulate_chanctx = emuchanctx;
6731 LKPI_80211_LHW_RXQ_LOCK_INIT(lhw);
6732 TASK_INIT(&lhw->rxq_task, 0, lkpi_80211_lhw_rxq_task, lhw);
6733 mbufq_init(&lhw->rxq, 32 * NAPI_POLL_WEIGHT);
6734 lhw->rxq_stopped = false;
6740 hw = LHW_TO_HW(lhw);
6743 hw->priv = (void *)(lhw + 1);
6746 lhw->ic = lkpi_ieee80211_ifalloc();
6748 if (lhw->emulate_chanctx)
6749 ic_printf(lhw->ic, "Using chanctx emulation.\n");
6758 struct lkpi_hw *lhw; local
6762 lhw = HW_TO_LHW(hw);
6763 free(lhw->ic, M_LKPI80211);
6764 lhw->ic = NULL;
6769 LKPI_80211_LHW_RXQ_LOCK(lhw);
6770 lhw->rxq_stopped = true;
6771 LKPI_80211_LHW_RXQ_UNLOCK(lhw);
6774 while (taskqueue_cancel(taskqueue_thread, &lhw->rxq_task, NULL) != 0)
6775 taskqueue_drain(taskqueue_thread, &lhw->rxq_task);
6778 m = mbufq_dequeue(&lhw->rxq);
6799 m = mbufq_dequeue(&lhw->rxq);
6801 KASSERT(mbufq_empty(&lhw->rxq), ("%s: lhw %p has rxq len %d != 0\n",
6802 __func__, lhw, mbufq_len(&lhw->rxq)));
6803 LKPI_80211_LHW_RXQ_LOCK_DESTROY(lhw);
6807 if (!list_empty_careful(&lhw->lchanctx_list)) {
6811 list_for_each_entry_safe(lchanctx, next, &lhw->lchanctx_list, entry) {
6819 list_add_rcu(&lchanctx->entry, &lhw->lchanctx_list_reserved);
6822 if (!list_empty_careful(&lhw->lchanctx_list_reserved)) {
6825 list_for_each_entry_safe(lchanctx, next, &lhw->lchanctx_list_reserved, entry) {
6835 LKPI_80211_LHW_MC_LOCK(lhw);
6836 lkpi_cleanup_mcast_list_locked(lhw);
6837 LKPI_80211_LHW_MC_UNLOCK(lhw);
6840 spin_lock_destroy(&lhw->txq_scheduled_lock[ac]);
6843 spin_lock_destroy(&lhw->txq_lock);
6844 LKPI_80211_LHW_TXQ_LOCK_DESTROY(lhw);
6845 LKPI_80211_LHW_SCAN_LOCK_DESTROY(lhw);
6846 sx_destroy(&lhw->lvif_sx);
6847 LKPI_80211_LHW_MC_LOCK_DESTROY(lhw)
6854 struct lkpi_hw *lhw; local
6858 lhw = HW_TO_LHW(hw);
6859 ic = lhw->ic;
6862 ic->ic_softc = lhw;
6892 struct lkpi_hw *lhw; local
6894 lhw = wiphy_priv(wiphy);
6895 return (LHW_TO_HW(lhw));
6899 lkpi_radiotap_attach(struct lkpi_hw *lhw) argument
6903 ic = lhw->ic;
6905 &lhw->rtap_tx.wt_ihdr, sizeof(lhw->rtap_tx),
6907 &lhw->rtap_rx.wr_ihdr, sizeof(lhw->rtap_rx),
6915 struct lkpi_hw *lhw; local
6918 lhw = HW_TO_LHW(hw);
6919 ic = lhw->ic;
6922 lhw->workq = alloc_ordered_workqueue(wiphy_name(hw->wiphy), 0);
6923 if (lhw->workq == NULL)
6963 if (lhw->ops->hw_scan)
6967 lkpi_enable_hw_scan(lhw);
7061 lhw->ic_scan_curchan = ic->ic_scan_curchan;
7063 lhw->ic_scan_mindwell = ic->ic_scan_mindwell;
7066 lhw->ic_node_alloc = ic->ic_node_alloc;
7068 lhw->ic_node_init = ic->ic_node_init;
7070 lhw->ic_node_cleanup = ic->ic_node_cleanup;
7072 lhw->ic_node_free = ic->ic_node_free;
7080 if (lhw->ops->ampdu_action != NULL) {
7081 lhw->ic_recv_action = ic->ic_recv_action;
7083 lhw->ic_send_action = ic->ic_send_action;
7086 lhw->ic_ampdu_enable = ic->ic_ampdu_enable;
7089 lhw->ic_addba_request = ic->ic_addba_request;
7091 lhw->ic_addba_response = ic->ic_addba_response;
7093 lhw->ic_addba_stop = ic->ic_addba_stop;
7095 lhw->ic_addba_response_timeout = ic->ic_addba_response_timeout;
7098 lhw->ic_bar_response = ic->ic_bar_response;
7101 lhw->ic_ampdu_rx_start = ic->ic_ampdu_rx_start;
7103 lhw->ic_ampdu_rx_stop = ic->ic_ampdu_rx_stop;
7108 lkpi_radiotap_attach(lhw);
7116 lhw->supbands = lhw->max_rates = 0;
7125 lhw->supbands++;
7126 lhw->max_rates = max(lhw->max_rates, supband->n_bitrates);
7143 lhw->dflt_chandef = hw->conf.chandef;
7148 __func__, __LINE__, &lhw->dflt_chandef);
7157 if (lhw->max_rates > IEEE80211_RATE_MAXSIZE) {
7159 lhw->max_rates, IEEE80211_RATE_MAXSIZE);
7160 lhw->max_rates = IEEE80211_RATE_MAXSIZE;
7170 lhw->scan_ie_len = 2 + IEEE80211_RATE_SIZE;
7171 if (lhw->max_rates > IEEE80211_RATE_SIZE)
7172 lhw->scan_ie_len += 2 + (lhw->max_rates - IEEE80211_RATE_SIZE);
7180 lhw->scan_ie_len += 2 + 1;
7185 lhw->scan_ie_len += sizeof(struct ieee80211_ie_htcap);
7189 lhw->scan_ie_len += 2 + sizeof(struct ieee80211_vht_cap);
7194 if (lhw->scan_ie_len > hw->wiphy->max_scan_ie_len)
7196 hw->wiphy->max_scan_ie_len -= lhw->scan_ie_len;
7215 struct lkpi_hw *lhw; local
7218 lhw = HW_TO_LHW(hw);
7219 ic = lhw->ic;
7229 struct lkpi_hw *lhw; local
7234 lhw = HW_TO_LHW(hw);
7241 ic_printf(lhw->ic, "XXX TODO %s flags(%#x) not yet supported.\n",
7254 LKPI_80211_LHW_LVIF_LOCK(lhw);
7256 TAILQ_FOREACH(lvif, &lhw->lvif_head, lvif_entry) {
7288 LKPI_80211_LHW_LVIF_UNLOCK(lhw);
7364 struct lkpi_hw *lhw; local
7370 lhw = HW_TO_LHW(hw);
7373 list_for_each_entry_rcu(lchanctx, &lhw->lchanctx_list, entry) {
7385 struct lkpi_hw *lhw; local
7393 lhw = HW_TO_LHW(hw);
7395 LKPI_80211_LHW_LVIF_LOCK(lhw);
7396 TAILQ_FOREACH(lvif, &lhw->lvif_head, lvif_entry) {
7407 LKPI_80211_LHW_LVIF_UNLOCK(lhw);
7424 struct lkpi_hw *lhw; local
7428 lhw = wiphy_priv(wiphy);
7429 ic = lhw->ic;
7447 struct lkpi_hw *lhw; local
7451 lhw = wiphy_priv(hw->wiphy);
7452 ic = lhw->ic;
7456 lhw->scan_flags, LKPI_LHW_SCAN_BITS,
7462 LKPI_80211_LHW_SCAN_LOCK(lhw);
7463 free(lhw->hw_req, M_LKPI80211);
7464 lhw->hw_req = NULL;
7465 lhw->scan_flags &= ~LKPI_LHW_SCAN_RUNNING;
7468 LKPI_80211_LHW_SCAN_UNLOCK(lhw);
7474 lkpi_80211_lhw_rxq_rx_one(struct lkpi_hw *lhw, struct mbuf *m) argument
7504 ok = ieee80211_input_mimo_all(lhw->ic, m);
7517 struct lkpi_hw *lhw; local
7521 lhw = ctx;
7526 __func__, lhw, pending, mbufq_len(&lhw->rxq));
7531 LKPI_80211_LHW_RXQ_LOCK(lhw);
7532 mbufq_concat(&mq, &lhw->rxq);
7533 LKPI_80211_LHW_RXQ_UNLOCK(lhw);
7537 lkpi_80211_lhw_rxq_rx_one(lhw, m);
7739 lkpi_rx_log_beacon(struct mbuf *m, struct lkpi_hw *lhw, argument
7781 TRACE_SCAN_BEACON(lhw->ic, "Beacon: scan_flags %b, band %s freq %u chan %-4d "
7783 lhw->scan_flags, LKPI_LHW_SCAN_BITS,
7800 struct lkpi_hw *lhw; local
7814 lhw = HW_TO_LHW(hw);
7815 ic = lhw->ic;
7855 lkpi_rx_log_beacon(m, lhw, rx_status);
7971 rtap = &lhw->rtap_rx;
8029 LKPI_80211_LHW_RXQ_LOCK(lhw);
8030 if (lhw->rxq_stopped) {
8031 LKPI_80211_LHW_RXQ_UNLOCK(lhw);
8037 error = mbufq_enqueue(&lhw->rxq, m);
8039 LKPI_80211_LHW_RXQ_UNLOCK(lhw);
8049 taskqueue_enqueue(taskqueue_thread, &lhw->rxq_task);
8050 LKPI_80211_LHW_RXQ_UNLOCK(lhw);
8431 struct lkpi_hw *lhw; local
8437 lhw = wiphy_priv(hw->wiphy);
8440 LKPI_80211_LHW_LVIF_LOCK(lhw);
8441 TAILQ_FOREACH(lvif, &lhw->lvif_head, lvif_entry) {
8453 LKPI_80211_LHW_LVIF_UNLOCK(lhw);
8703 struct lkpi_hw *lhw; local
8708 lhw = HW_TO_LHW(hw);
8709 queue_delayed_work(lhw->workq, w, delay);
8716 struct lkpi_hw *lhw; local
8721 lhw = HW_TO_LHW(hw);
8722 queue_work(lhw->workq, w);
8875 struct lkpi_hw *lhw; local
8883 lhw = wiphy_priv(hw->wiphy);
8891 LKPI_80211_LHW_LVIF_LOCK(lhw);
8892 TAILQ_FOREACH(lvif, &lhw->lvif_head, lvif_entry) {
8905 ic_printf(lhw->ic, "%s:%d: lhw %p hw %p "
8908 lhw, hw, lvif, vif, ac, qnum);
8914 LKPI_80211_LHW_LVIF_UNLOCK(lhw);
8931 struct lkpi_hw *lhw; local
8942 lhw = wiphy_priv(hw->wiphy);
8945 LKPI_80211_LHW_LVIF_LOCK(lhw);
8946 TAILQ_FOREACH(lvif, &lhw->lvif_head, lvif_entry) {
8963 ic_printf(lhw->ic, "%s:%d: lhw %p hw %p "
8966 lhw, hw, lvif, vif, ac);
8998 LKPI_80211_LHW_LVIF_UNLOCK(lhw);
9014 struct lkpi_hw *lhw; local
9017 lhw = HW_TO_LHW(hw);
9019 spin_lock_irqsave(&lhw->txq_lock, flags);
9021 spin_unlock_irqrestore(&lhw->txq_lock, flags);
9027 struct lkpi_hw *lhw; local
9033 lhw = HW_TO_LHW(hw);
9035 spin_lock_irqsave(&lhw->txq_lock, flags);
9037 spin_unlock_irqrestore(&lhw->txq_lock, flags);
9044 struct lkpi_hw *lhw; local
9046 lhw = HW_TO_LHW(hw);
9048 LKPI_80211_LHW_TXQ_LOCK(lhw);
9074 LKPI_80211_LHW_TXQ_UNLOCK(lhw);
9086 struct lkpi_hw *lhw; local
9088 lhw = HW_TO_LHW(hw);
9091 ic_printf(lhw->ic, "%s: ac %u out of bounds.\n", __func__, ac);
9095 spin_lock_bh(&lhw->txq_scheduled_lock[ac]);
9097 if (++lhw->txq_generation[ac] == 0)
9098 lhw->txq_generation[ac]++;
9099 spin_unlock_bh(&lhw->txq_scheduled_lock[ac]);
9105 struct lkpi_hw *lhw; local
9109 lhw = HW_TO_LHW(hw);
9113 ic_printf(lhw->ic, "%s: ac %u out of bounds.\n", __func__, ac);
9117 spin_lock_bh(&lhw->txq_scheduled_lock[ac]);
9120 if (lhw->txq_generation[ac] == 0)
9123 ltxq = TAILQ_FIRST(&lhw->txq_scheduled[ac]);
9126 if (ltxq->txq_generation == lhw->txq_generation[ac])
9131 TAILQ_REMOVE(&lhw->txq_scheduled[ac], ltxq, txq_entry);
9132 ltxq->txq_generation = lhw->txq_generation[ac];
9137 spin_unlock_bh(&lhw->txq_scheduled_lock[ac]);
9145 struct lkpi_hw *lhw; local
9158 lhw = HW_TO_LHW(hw);
9159 spin_lock_bh(&lhw->txq_scheduled_lock[txq->ac]);
9168 TAILQ_INSERT_TAIL(&lhw->txq_scheduled[txq->ac], ltxq, txq_entry);
9170 spin_unlock_bh(&lhw->txq_scheduled_lock[txq->ac]);
9270 struct lkpi_hw *lhw; local
9273 lhw = wiphy_priv(wiphy);
9278 ic_printf(lhw->ic, "%s: alloc failed.\n", __func__);
9293 vap = TAILQ_FIRST(&lhw->ic->ic_vaps);
9321 struct lkpi_hw *lhw; local
9325 lhw = wiphy_priv(wiphy);
9326 ic = lhw->ic;
9333 (lhw->sc_flags & LKPI_MAC80211_DRV_STARTED) == 0)
9386 struct lkpi_hw *lhw; local
9394 lhw = HW_TO_LHW(hw);
9395 if (!lhw->emulate_chanctx)
9406 if (lhw->scan_chandef.chan != NULL) {
9409 ic_printf(lhw->ic, "%s:%d: using scan_chandef %p\n",
9410 __func__, __LINE__, &lhw->scan_chandef);
9412 cd = &lhw->scan_chandef;
9416 ic_printf(lhw->ic, "%s:%d: using dflt_chandef %p\n",
9417 __func__, __LINE__, &lhw->dflt_chandef);
9419 cd = &lhw->dflt_chandef;
9424 ic_printf(lhw->ic, "%s:%d: using chanctx %p chandef %p\n",
9441 ic_printf(lhw->ic, "%s:%d: chanctx %p { %u } cd %p { %u } "
9473 struct lkpi_hw *lhw; local
9475 lhw = HW_TO_LHW(hw);
9476 ic_printf(lhw->ic, "%s:%d: chanctx_conf %p\n",
9495 struct lkpi_hw *lhw; local
9497 lhw = HW_TO_LHW(hw);
9498 ic_printf(lhw->ic, "%s:%d: chanctx_conf %p\n",
9516 struct lkpi_hw *lhw; local
9518 lhw = HW_TO_LHW(hw);
9519 ic_printf(lhw->ic, "%s:%d: chanctx_conf %p\n",
9559 struct lkpi_hw *lhw; local
9563 lhw = ic->ic_softc;
9564 hw = LHW_TO_HW(lhw);
9594 TAILQ_FOREACH(lvif, &lhw->lvif_head, lvif_entry) {
9598 if ((lhw->sc_flags & LKPI_MAC80211_DRV_STARTED) != 0)
9615 struct lkpi_hw *lhw; local
9620 lhw = ic->ic_softc;
9621 hw = LHW_TO_HW(lhw);
9628 LKPI_80211_LHW_SCAN_LOCK(lhw);
9629 hw_scan_running = (lhw->scan_flags & (LKPI_LHW_SCAN_RUNNING|LKPI_LHW_SCAN_HW)) != 0;
9630 LKPI_80211_LHW_SCAN_UNLOCK(lhw);
9646 TAILQ_FOREACH(lvif, &lhw->lvif_head, lvif_entry) {