• Home
  • Raw
  • Download

Lines Matching refs:mac

42 	struct qtnf_wmac *mac = NULL;  in qtnf_core_get_mac()  local
50 mac = bus->mac[macid]; in qtnf_core_get_mac()
52 if (unlikely(!mac)) { in qtnf_core_get_mac()
57 return mac; in qtnf_core_get_mac()
84 queue_work(vif->mac->bus->hprio_workqueue, &vif->high_pri_tx_work); in qtnf_packet_send_hi_pri()
93 struct qtnf_wmac *mac; in qtnf_netdev_hard_start_xmit() local
109 mac = vif->mac; in qtnf_netdev_hard_start_xmit()
110 if (unlikely(!mac)) { in qtnf_netdev_hard_start_xmit()
133 return qtnf_bus_data_tx(mac->bus, skb, mac->macid, vif->vifid); in qtnf_netdev_hard_start_xmit()
141 struct qtnf_wmac *mac; in qtnf_netdev_tx_timeout() local
144 if (unlikely(!vif || !vif->mac || !vif->mac->bus)) in qtnf_netdev_tx_timeout()
147 mac = vif->mac; in qtnf_netdev_tx_timeout()
148 bus = mac->bus; in qtnf_netdev_tx_timeout()
150 pr_warn("VIF%u.%u: Tx timeout- %lu\n", mac->macid, vif->vifid, jiffies); in qtnf_netdev_tx_timeout()
175 qtnf_scan_done(vif->mac, true); in qtnf_netdev_set_mac_address()
191 const struct qtnf_bus *bus = vif->mac->bus; in qtnf_netdev_port_parent_id()
225 struct qtnf_wmac *mac, in qtnf_mac_init_single_band() argument
236 ret = qtnf_cmd_band_info_get(mac, wiphy->bands[band]); in qtnf_mac_init_single_band()
239 mac->macid, band, ret); in qtnf_mac_init_single_band()
248 static int qtnf_mac_init_bands(struct qtnf_wmac *mac) in qtnf_mac_init_bands() argument
250 struct wiphy *wiphy = priv_to_wiphy(mac); in qtnf_mac_init_bands()
253 if (mac->macinfo.bands_cap & QLINK_BAND_2GHZ) { in qtnf_mac_init_bands()
254 ret = qtnf_mac_init_single_band(wiphy, mac, NL80211_BAND_2GHZ); in qtnf_mac_init_bands()
259 if (mac->macinfo.bands_cap & QLINK_BAND_5GHZ) { in qtnf_mac_init_bands()
260 ret = qtnf_mac_init_single_band(wiphy, mac, NL80211_BAND_5GHZ); in qtnf_mac_init_bands()
265 if (mac->macinfo.bands_cap & QLINK_BAND_60GHZ) in qtnf_mac_init_bands()
266 ret = qtnf_mac_init_single_band(wiphy, mac, NL80211_BAND_60GHZ); in qtnf_mac_init_bands()
272 struct qtnf_vif *qtnf_mac_get_free_vif(struct qtnf_wmac *mac) in qtnf_mac_get_free_vif() argument
278 vif = &mac->iflist[i]; in qtnf_mac_get_free_vif()
286 struct qtnf_vif *qtnf_mac_get_base_vif(struct qtnf_wmac *mac) in qtnf_mac_get_base_vif() argument
290 vif = &mac->iflist[QTNF_PRIMARY_VIF_IDX]; in qtnf_mac_get_base_vif()
298 void qtnf_mac_iface_comb_free(struct qtnf_wmac *mac) in qtnf_mac_iface_comb_free() argument
303 if (mac->macinfo.if_comb) { in qtnf_mac_iface_comb_free()
304 for (i = 0; i < mac->macinfo.n_if_comb; i++) { in qtnf_mac_iface_comb_free()
305 comb = &mac->macinfo.if_comb[i]; in qtnf_mac_iface_comb_free()
310 kfree(mac->macinfo.if_comb); in qtnf_mac_iface_comb_free()
311 mac->macinfo.if_comb = NULL; in qtnf_mac_iface_comb_free()
315 void qtnf_mac_ext_caps_free(struct qtnf_wmac *mac) in qtnf_mac_ext_caps_free() argument
317 if (mac->macinfo.extended_capabilities_len) { in qtnf_mac_ext_caps_free()
318 kfree(mac->macinfo.extended_capabilities); in qtnf_mac_ext_caps_free()
319 mac->macinfo.extended_capabilities = NULL; in qtnf_mac_ext_caps_free()
321 kfree(mac->macinfo.extended_capabilities_mask); in qtnf_mac_ext_caps_free()
322 mac->macinfo.extended_capabilities_mask = NULL; in qtnf_mac_ext_caps_free()
324 mac->macinfo.extended_capabilities_len = 0; in qtnf_mac_ext_caps_free()
349 static void qtnf_mac_init_primary_intf(struct qtnf_wmac *mac) in qtnf_mac_init_primary_intf() argument
351 struct qtnf_vif *vif = &mac->iflist[QTNF_PRIMARY_VIF_IDX]; in qtnf_mac_init_primary_intf()
355 vif->wdev.wiphy = priv_to_wiphy(mac); in qtnf_mac_init_primary_intf()
360 static void qtnf_mac_scan_finish(struct qtnf_wmac *mac, bool aborted) in qtnf_mac_scan_finish() argument
366 mutex_lock(&mac->mac_lock); in qtnf_mac_scan_finish()
368 if (mac->scan_req) { in qtnf_mac_scan_finish()
369 cfg80211_scan_done(mac->scan_req, &info); in qtnf_mac_scan_finish()
370 mac->scan_req = NULL; in qtnf_mac_scan_finish()
373 mutex_unlock(&mac->mac_lock); in qtnf_mac_scan_finish()
376 void qtnf_scan_done(struct qtnf_wmac *mac, bool aborted) in qtnf_scan_done() argument
378 cancel_delayed_work_sync(&mac->scan_timeout); in qtnf_scan_done()
379 qtnf_mac_scan_finish(mac, aborted); in qtnf_scan_done()
384 struct qtnf_wmac *mac = in qtnf_mac_scan_timeout() local
387 pr_warn("MAC%d: scan timed out\n", mac->macid); in qtnf_mac_scan_timeout()
388 qtnf_mac_scan_finish(mac, true); in qtnf_mac_scan_timeout()
412 struct qtnf_wmac *mac; in qtnf_core_mac_alloc() local
432 mac = wiphy_priv(wiphy); in qtnf_core_mac_alloc()
434 mac->macid = macid; in qtnf_core_mac_alloc()
435 mac->pdev = pdev; in qtnf_core_mac_alloc()
436 mac->bus = bus; in qtnf_core_mac_alloc()
437 mutex_init(&mac->mac_lock); in qtnf_core_mac_alloc()
438 INIT_DELAYED_WORK(&mac->scan_timeout, qtnf_mac_scan_timeout); in qtnf_core_mac_alloc()
441 vif = &mac->iflist[i]; in qtnf_core_mac_alloc()
445 vif->mac = mac; in qtnf_core_mac_alloc()
452 qtnf_mac_init_primary_intf(mac); in qtnf_core_mac_alloc()
453 bus->mac[macid] = mac; in qtnf_core_mac_alloc()
455 return mac; in qtnf_core_mac_alloc()
462 int qtnf_core_net_attach(struct qtnf_wmac *mac, struct qtnf_vif *vif, in qtnf_core_net_attach() argument
465 struct wiphy *wiphy = priv_to_wiphy(mac); in qtnf_core_net_attach()
487 if (qtnf_hwcap_is_set(&mac->bus->hw_info, QLINK_HW_CAPAB_HW_BRIDGE)) in qtnf_core_net_attach()
506 struct qtnf_wmac *mac; in qtnf_core_mac_detach() local
512 mac = bus->mac[macid]; in qtnf_core_mac_detach()
514 if (!mac) in qtnf_core_mac_detach()
517 wiphy = priv_to_wiphy(mac); in qtnf_core_mac_detach()
520 vif = &mac->iflist[i]; in qtnf_core_mac_detach()
531 if (mac->wiphy_registered) in qtnf_core_mac_detach()
548 platform_device_unregister(mac->pdev); in qtnf_core_mac_detach()
549 qtnf_mac_iface_comb_free(mac); in qtnf_core_mac_detach()
550 qtnf_mac_ext_caps_free(mac); in qtnf_core_mac_detach()
551 kfree(mac->macinfo.wowlan); in qtnf_core_mac_detach()
552 kfree(mac->rd); in qtnf_core_mac_detach()
553 mac->rd = NULL; in qtnf_core_mac_detach()
555 bus->mac[macid] = NULL; in qtnf_core_mac_detach()
560 struct qtnf_wmac *mac; in qtnf_core_mac_attach() local
569 mac = qtnf_core_mac_alloc(bus, macid); in qtnf_core_mac_attach()
570 if (IS_ERR(mac)) { in qtnf_core_mac_attach()
572 return PTR_ERR(mac); in qtnf_core_mac_attach()
575 vif = qtnf_mac_get_base_vif(mac); in qtnf_core_mac_attach()
589 ret = qtnf_cmd_get_mac_info(mac); in qtnf_core_mac_attach()
596 if (is_zero_ether_addr(mac->bus->hw_id)) in qtnf_core_mac_attach()
597 ether_addr_copy(mac->bus->hw_id, mac->macaddr); in qtnf_core_mac_attach()
599 ret = qtnf_mac_init_bands(mac); in qtnf_core_mac_attach()
605 ret = qtnf_wiphy_register(&bus->hw_info, mac); in qtnf_core_mac_attach()
611 mac->wiphy_registered = 1; in qtnf_core_mac_attach()
614 wiphy_lock(priv_to_wiphy(mac)); in qtnf_core_mac_attach()
615 ret = qtnf_core_net_attach(mac, vif, "wlan%d", NET_NAME_ENUM); in qtnf_core_mac_attach()
616 wiphy_unlock(priv_to_wiphy(mac)); in qtnf_core_mac_attach()
679 bus = vif->mac->bus; in qtnf_core_netdevice_event()
690 vif->mac->macid, vif->vifid, netdev_name(brdev), in qtnf_core_netdevice_event()
837 struct qtnf_wmac *mac; in qtnf_classify_skb() local
862 mac = bus->mac[meta->macid]; in qtnf_classify_skb()
864 if (unlikely(!mac)) { in qtnf_classify_skb()
869 vif = &mac->iflist[meta->ifidx]; in qtnf_classify_skb()
896 struct qtnf_wmac *mac; in qtnf_wake_all_queues() local
901 if (unlikely(!vif || !vif->mac || !vif->mac->bus)) in qtnf_wake_all_queues()
904 bus = vif->mac->bus; in qtnf_wake_all_queues()
910 mac = bus->mac[macid]; in qtnf_wake_all_queues()
912 vif = &mac->iflist[i]; in qtnf_wake_all_queues()