Lines Matching refs:bss

168 static void wpa_driver_nl80211_deinit(struct i802_bss *bss);
169 static int wpa_driver_nl80211_set_mode_ibss(struct i802_bss *bss,
176 static int nl80211_send_frame_cmd(struct i802_bss *bss,
181 static int wpa_driver_nl80211_probe_req_report(struct i802_bss *bss,
193 static int nl80211_set_channel(struct i802_bss *bss,
201 static int i802_set_iface_flags(struct i802_bss *bss, int up);
250 struct i802_bss *bss; in get_bss_ifindex() local
252 for (bss = drv->first_bss; bss; bss = bss->next) { in get_bss_ifindex()
253 if (bss->ifindex == ifindex) in get_bss_ifindex()
254 return bss; in get_bss_ifindex()
453 static int nl80211_set_iface_id(struct nl_msg *msg, struct i802_bss *bss) in nl80211_set_iface_id() argument
455 if (bss->wdev_id_set) in nl80211_set_iface_id()
456 return nla_put_u64(msg, NL80211_ATTR_WDEV, bss->wdev_id); in nl80211_set_iface_id()
457 return nla_put_u32(msg, NL80211_ATTR_IFINDEX, bss->ifindex); in nl80211_set_iface_id()
461 struct nl_msg * nl80211_cmd_msg(struct i802_bss *bss, int flags, uint8_t cmd) in nl80211_cmd_msg() argument
469 if (!nl80211_cmd(bss->drv, msg, flags, cmd) || in nl80211_cmd_msg()
470 nl80211_set_iface_id(msg, bss) < 0) { in nl80211_cmd_msg()
506 struct nl_msg * nl80211_bss_msg(struct i802_bss *bss, int flags, uint8_t cmd) in nl80211_bss_msg() argument
508 return nl80211_ifindex_msg(bss->drv, bss->ifindex, flags, cmd); in nl80211_bss_msg()
542 int nl80211_get_wiphy_index(struct i802_bss *bss) in nl80211_get_wiphy_index() argument
550 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_GET_INTERFACE))) in nl80211_get_wiphy_index()
553 if (send_and_recv_msgs(bss->drv, msg, netdev_info_handler, &data) == 0) in nl80211_get_wiphy_index()
559 static enum nl80211_iftype nl80211_get_ifmode(struct i802_bss *bss) in nl80211_get_ifmode() argument
567 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_GET_INTERFACE))) in nl80211_get_ifmode()
570 if (send_and_recv_msgs(bss->drv, msg, netdev_info_handler, &data) == 0) in nl80211_get_ifmode()
576 static int nl80211_get_macaddr(struct i802_bss *bss) in nl80211_get_macaddr() argument
580 .macaddr = bss->addr, in nl80211_get_macaddr()
583 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_GET_INTERFACE))) in nl80211_get_macaddr()
586 return send_and_recv_msgs(bss->drv, msg, netdev_info_handler, &data); in nl80211_get_macaddr()
664 nl80211_get_wiphy_data_ap(struct i802_bss *bss) in nl80211_get_wiphy_data_ap() argument
671 if (bss->wiphy_data != NULL) in nl80211_get_wiphy_data_ap()
672 return bss->wiphy_data; in nl80211_get_wiphy_data_ap()
674 wiphy_idx = nl80211_get_wiphy_index(bss); in nl80211_get_wiphy_data_ap()
698 w->nl_beacons = nl_create_handle(bss->drv->global->nl_cb, in nl80211_get_wiphy_data_ap()
705 if (nl80211_register_beacons(bss->drv, w)) { in nl80211_get_wiphy_data_ap()
718 if (tmp_bss->drv == bss->drv) { in nl80211_get_wiphy_data_ap()
725 dl_list_add(&w->drvs, &bss->drv->wiphy_list); in nl80211_get_wiphy_data_ap()
727 dl_list_add(&w->bsss, &bss->wiphy_list); in nl80211_get_wiphy_data_ap()
728 bss->wiphy_data = w; in nl80211_get_wiphy_data_ap()
733 static void nl80211_put_wiphy_data_ap(struct i802_bss *bss) in nl80211_put_wiphy_data_ap() argument
735 struct nl80211_wiphy_data *w = bss->wiphy_data; in nl80211_put_wiphy_data_ap()
741 bss->wiphy_data = NULL; in nl80211_put_wiphy_data_ap()
742 dl_list_del(&bss->wiphy_list); in nl80211_put_wiphy_data_ap()
746 if (tmp_bss->drv == bss->drv) { in nl80211_put_wiphy_data_ap()
753 dl_list_del(&bss->drv->wiphy_list); in nl80211_put_wiphy_data_ap()
768 struct i802_bss *bss = priv; in nl80211_get_ifindex() local
769 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_get_ifindex()
777 struct i802_bss *bss = priv; in wpa_driver_nl80211_get_bssid() local
778 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_get_bssid()
788 struct i802_bss *bss = priv; in wpa_driver_nl80211_get_ssid() local
789 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_get_ssid()
1030 struct i802_bss *bss; in wpa_driver_nl80211_event_rtm_newlink() local
1034 bss = get_bss_ifindex(drv, ifi->ifi_index); in wpa_driver_nl80211_event_rtm_newlink()
1035 if (bss && in wpa_driver_nl80211_event_rtm_newlink()
1037 bss->ifname, addr) < 0) { in wpa_driver_nl80211_event_rtm_newlink()
1040 bss->ifname); in wpa_driver_nl80211_event_rtm_newlink()
1041 } else if (bss && in wpa_driver_nl80211_event_rtm_newlink()
1042 os_memcmp(addr, bss->addr, ETH_ALEN) != 0) { in wpa_driver_nl80211_event_rtm_newlink()
1046 ifi->ifi_index, bss->ifname, in wpa_driver_nl80211_event_rtm_newlink()
1047 MAC2STR(bss->addr), in wpa_driver_nl80211_event_rtm_newlink()
1049 os_memcpy(bss->addr, addr, ETH_ALEN); in wpa_driver_nl80211_event_rtm_newlink()
1079 struct i802_bss *bss; in wpa_driver_nl80211_event_rtm_newlink() local
1092 for (bss = drv->first_bss; bss; bss = bss->next) { in wpa_driver_nl80211_event_rtm_newlink()
1093 if (os_strcmp(ifname, bss->ifname) == 0) { in wpa_driver_nl80211_event_rtm_newlink()
1094 os_strlcpy(bss->brname, namebuf, IFNAMSIZ); in wpa_driver_nl80211_event_rtm_newlink()
1367 struct i802_bss *bss = priv; in wpa_driver_nl80211_set_country() local
1368 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_set_country()
1410 struct i802_bss *bss = priv; in wpa_driver_nl80211_get_country() local
1411 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_get_country()
1638 static int nl80211_init_bss(struct i802_bss *bss) in nl80211_init_bss() argument
1640 bss->nl_cb = nl_cb_alloc(NL_CB_DEFAULT); in nl80211_init_bss()
1641 if (!bss->nl_cb) in nl80211_init_bss()
1644 nl_cb_set(bss->nl_cb, NL_CB_SEQ_CHECK, NL_CB_CUSTOM, in nl80211_init_bss()
1646 nl_cb_set(bss->nl_cb, NL_CB_VALID, NL_CB_CUSTOM, in nl80211_init_bss()
1647 process_bss_event, bss); in nl80211_init_bss()
1653 static void nl80211_destroy_bss(struct i802_bss *bss) in nl80211_destroy_bss() argument
1655 nl_cb_put(bss->nl_cb); in nl80211_destroy_bss()
1656 bss->nl_cb = NULL; in nl80211_destroy_bss()
1719 struct i802_bss *bss; in wpa_driver_nl80211_drv_init() local
1747 bss = drv->first_bss; in wpa_driver_nl80211_drv_init()
1748 bss->drv = drv; in wpa_driver_nl80211_drv_init()
1749 bss->ctx = ctx; in wpa_driver_nl80211_drv_init()
1751 os_strlcpy(bss->ifname, ifname, sizeof(bss->ifname)); in wpa_driver_nl80211_drv_init()
1757 if (nl80211_init_bss(bss)) in wpa_driver_nl80211_drv_init()
1791 return bss; in wpa_driver_nl80211_drv_init()
1794 wpa_driver_nl80211_deinit(bss); in wpa_driver_nl80211_drv_init()
1815 static int nl80211_register_frame(struct i802_bss *bss, in nl80211_register_frame() argument
1819 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_register_frame()
1829 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_REGISTER_ACTION)) || in nl80211_register_frame()
1848 static int nl80211_alloc_mgmt_handle(struct i802_bss *bss) in nl80211_alloc_mgmt_handle() argument
1850 if (bss->nl_mgmt) { in nl80211_alloc_mgmt_handle()
1852 "already on! (nl_mgmt=%p)", bss->nl_mgmt); in nl80211_alloc_mgmt_handle()
1856 bss->nl_mgmt = nl_create_handle(bss->nl_cb, "mgmt"); in nl80211_alloc_mgmt_handle()
1857 if (bss->nl_mgmt == NULL) in nl80211_alloc_mgmt_handle()
1864 static void nl80211_mgmt_handle_register_eloop(struct i802_bss *bss) in nl80211_mgmt_handle_register_eloop() argument
1866 nl80211_register_eloop_read(&bss->nl_mgmt, in nl80211_mgmt_handle_register_eloop()
1868 bss->nl_cb); in nl80211_mgmt_handle_register_eloop()
1872 static int nl80211_register_action_frame(struct i802_bss *bss, in nl80211_register_action_frame() argument
1876 return nl80211_register_frame(bss, bss->nl_mgmt, in nl80211_register_action_frame()
1881 static int nl80211_mgmt_subscribe_non_ap(struct i802_bss *bss) in nl80211_mgmt_subscribe_non_ap() argument
1883 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_mgmt_subscribe_non_ap()
1886 if (nl80211_alloc_mgmt_handle(bss)) in nl80211_mgmt_subscribe_non_ap()
1889 "handle %p", bss->nl_mgmt); in nl80211_mgmt_subscribe_non_ap()
1895 nl80211_register_frame(bss, bss->nl_mgmt, type, NULL, 0); in nl80211_mgmt_subscribe_non_ap()
1900 if (nl80211_register_action_frame(bss, (u8 *) "\x01\x04", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
1905 if (nl80211_register_action_frame(bss, (u8 *) "\x04\x0a", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
1908 if (nl80211_register_action_frame(bss, (u8 *) "\x04\x0b", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
1911 if (nl80211_register_action_frame(bss, (u8 *) "\x04\x0c", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
1914 if (nl80211_register_action_frame(bss, (u8 *) "\x04\x0d", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
1917 if (nl80211_register_action_frame(bss, (u8 *) "\x09\x0a", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
1920 if (nl80211_register_action_frame(bss, (u8 *) "\x09\x0b", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
1923 if (nl80211_register_action_frame(bss, (u8 *) "\x09\x0c", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
1926 if (nl80211_register_action_frame(bss, (u8 *) "\x09\x0d", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
1931 if (nl80211_register_action_frame(bss, in nl80211_mgmt_subscribe_non_ap()
1936 if (nl80211_register_action_frame(bss, in nl80211_mgmt_subscribe_non_ap()
1943 if (nl80211_register_action_frame(bss, (u8 *) "\x08\x01", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
1949 if (nl80211_register_action_frame(bss, (u8 *) "\x04\x0e", 2) < in nl80211_mgmt_subscribe_non_ap()
1956 if (nl80211_register_action_frame(bss, (u8 *) "\x12", 1) < 0) in nl80211_mgmt_subscribe_non_ap()
1961 if (nl80211_register_action_frame(bss, (u8 *) "\x06", 1) < 0) in nl80211_mgmt_subscribe_non_ap()
1968 if (nl80211_register_action_frame(bss, (u8 *) "\x0a\x07", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
1971 if (nl80211_register_action_frame(bss, (u8 *) "\x0a\x11", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
1976 if (nl80211_register_action_frame(bss, (u8 *) "\x0a\x1a", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
1981 if (nl80211_register_action_frame(bss, (u8 *) "\x11\x01", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
1985 if (nl80211_register_action_frame(bss, (u8 *) "\x11\x02", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
1989 if (nl80211_register_action_frame(bss, (u8 *) "\x05\x05", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
1994 (nl80211_register_action_frame(bss, (u8 *) "\x05\x02", 2) < 0)) in nl80211_mgmt_subscribe_non_ap()
1997 nl80211_mgmt_handle_register_eloop(bss); in nl80211_mgmt_subscribe_non_ap()
2003 static int nl80211_mgmt_subscribe_mesh(struct i802_bss *bss) in nl80211_mgmt_subscribe_mesh() argument
2007 if (nl80211_alloc_mgmt_handle(bss)) in nl80211_mgmt_subscribe_mesh()
2012 bss->nl_mgmt); in nl80211_mgmt_subscribe_mesh()
2015 if (nl80211_register_frame(bss, bss->nl_mgmt, in nl80211_mgmt_subscribe_mesh()
2022 if (nl80211_register_action_frame(bss, (u8 *) "\x0f\x01", 2) < 0) in nl80211_mgmt_subscribe_mesh()
2025 if (nl80211_register_action_frame(bss, (u8 *) "\x0f\x02", 2) < 0) in nl80211_mgmt_subscribe_mesh()
2028 if (nl80211_register_action_frame(bss, (u8 *) "\x0f\x03", 2) < 0) in nl80211_mgmt_subscribe_mesh()
2031 nl80211_mgmt_handle_register_eloop(bss); in nl80211_mgmt_subscribe_mesh()
2037 static int nl80211_register_spurious_class3(struct i802_bss *bss) in nl80211_register_spurious_class3() argument
2042 msg = nl80211_bss_msg(bss, 0, NL80211_CMD_UNEXPECTED_FRAME); in nl80211_register_spurious_class3()
2043 ret = send_and_recv(bss->drv->global, bss->nl_mgmt, msg, NULL, NULL); in nl80211_register_spurious_class3()
2053 static int nl80211_mgmt_subscribe_ap(struct i802_bss *bss) in nl80211_mgmt_subscribe_ap() argument
2072 if (nl80211_alloc_mgmt_handle(bss)) in nl80211_mgmt_subscribe_ap()
2075 "handle %p", bss->nl_mgmt); in nl80211_mgmt_subscribe_ap()
2078 if (nl80211_register_frame(bss, bss->nl_mgmt, in nl80211_mgmt_subscribe_ap()
2086 if (nl80211_register_spurious_class3(bss)) in nl80211_mgmt_subscribe_ap()
2089 if (nl80211_get_wiphy_data_ap(bss) == NULL) in nl80211_mgmt_subscribe_ap()
2092 nl80211_mgmt_handle_register_eloop(bss); in nl80211_mgmt_subscribe_ap()
2096 nl_destroy_handles(&bss->nl_mgmt); in nl80211_mgmt_subscribe_ap()
2101 static int nl80211_mgmt_subscribe_ap_dev_sme(struct i802_bss *bss) in nl80211_mgmt_subscribe_ap_dev_sme() argument
2103 if (nl80211_alloc_mgmt_handle(bss)) in nl80211_mgmt_subscribe_ap_dev_sme()
2106 "handle %p (device SME)", bss->nl_mgmt); in nl80211_mgmt_subscribe_ap_dev_sme()
2108 if (nl80211_register_frame(bss, bss->nl_mgmt, in nl80211_mgmt_subscribe_ap_dev_sme()
2114 nl80211_mgmt_handle_register_eloop(bss); in nl80211_mgmt_subscribe_ap_dev_sme()
2118 nl_destroy_handles(&bss->nl_mgmt); in nl80211_mgmt_subscribe_ap_dev_sme()
2123 static void nl80211_mgmt_unsubscribe(struct i802_bss *bss, const char *reason) in nl80211_mgmt_unsubscribe() argument
2125 if (bss->nl_mgmt == NULL) in nl80211_mgmt_unsubscribe()
2128 "(%s)", bss->nl_mgmt, reason); in nl80211_mgmt_unsubscribe()
2129 nl80211_destroy_eloop_handle(&bss->nl_mgmt); in nl80211_mgmt_unsubscribe()
2131 nl80211_put_wiphy_data_ap(bss); in nl80211_mgmt_unsubscribe()
2141 static void nl80211_del_p2pdev(struct i802_bss *bss) in nl80211_del_p2pdev() argument
2146 msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_DEL_INTERFACE); in nl80211_del_p2pdev()
2147 ret = send_and_recv_msgs(bss->drv, msg, NULL, NULL); in nl80211_del_p2pdev()
2150 bss->ifname, (long long unsigned int) bss->wdev_id, in nl80211_del_p2pdev()
2155 static int nl80211_set_p2pdev(struct i802_bss *bss, int start) in nl80211_set_p2pdev() argument
2160 msg = nl80211_cmd_msg(bss, 0, start ? NL80211_CMD_START_P2P_DEVICE : in nl80211_set_p2pdev()
2162 ret = send_and_recv_msgs(bss->drv, msg, NULL, NULL); in nl80211_set_p2pdev()
2166 bss->ifname, (long long unsigned int) bss->wdev_id, in nl80211_set_p2pdev()
2172 static int i802_set_iface_flags(struct i802_bss *bss, int up) in i802_set_iface_flags() argument
2176 nlmode = nl80211_get_ifmode(bss); in i802_set_iface_flags()
2178 return linux_set_iface_flags(bss->drv->global->ioctl_sock, in i802_set_iface_flags()
2179 bss->ifname, up); in i802_set_iface_flags()
2183 return nl80211_set_p2pdev(bss, up); in i802_set_iface_flags()
2246 struct i802_bss *bss = drv->first_bss; in wpa_driver_nl80211_finish_drv_init() local
2250 drv->ifindex = if_nametoindex(bss->ifname); in wpa_driver_nl80211_finish_drv_init()
2251 bss->ifindex = drv->ifindex; in wpa_driver_nl80211_finish_drv_init()
2252 bss->wdev_id = drv->global->if_add_wdevid; in wpa_driver_nl80211_finish_drv_init()
2253 bss->wdev_id_set = drv->global->if_add_wdevid_set; in wpa_driver_nl80211_finish_drv_init()
2255 bss->if_dynamic = drv->ifindex == drv->global->if_add_ifindex; in wpa_driver_nl80211_finish_drv_init()
2256 bss->if_dynamic = bss->if_dynamic || drv->global->if_add_wdevid_set; in wpa_driver_nl80211_finish_drv_init()
2259 if (!bss->if_dynamic && nl80211_get_ifmode(bss) == NL80211_IFTYPE_AP) in wpa_driver_nl80211_finish_drv_init()
2260 bss->static_ap = 1; in wpa_driver_nl80211_finish_drv_init()
2263 nl80211_get_ifmode(bss) != NL80211_IFTYPE_P2P_DEVICE && in wpa_driver_nl80211_finish_drv_init()
2264 linux_iface_up(drv->global->ioctl_sock, bss->ifname) > 0) in wpa_driver_nl80211_finish_drv_init()
2270 if (driver_params && nl80211_set_param(bss, driver_params) < 0) in wpa_driver_nl80211_finish_drv_init()
2274 bss->ifname, drv->phyname); in wpa_driver_nl80211_finish_drv_init()
2277 (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 0) || in wpa_driver_nl80211_finish_drv_init()
2278 linux_set_ifhwaddr(drv->global->ioctl_sock, bss->ifname, in wpa_driver_nl80211_finish_drv_init()
2282 if (first && nl80211_get_ifmode(bss) == NL80211_IFTYPE_AP) in wpa_driver_nl80211_finish_drv_init()
2285 if (drv->hostapd || bss->static_ap) in wpa_driver_nl80211_finish_drv_init()
2287 else if (bss->if_dynamic) in wpa_driver_nl80211_finish_drv_init()
2288 nlmode = nl80211_get_ifmode(bss); in wpa_driver_nl80211_finish_drv_init()
2292 if (wpa_driver_nl80211_set_mode(bss, nlmode) < 0) { in wpa_driver_nl80211_finish_drv_init()
2298 nl80211_get_macaddr(bss); in wpa_driver_nl80211_finish_drv_init()
2303 int ret = i802_set_iface_flags(bss, 1); in wpa_driver_nl80211_finish_drv_init()
2306 "interface '%s' UP", bss->ifname); in wpa_driver_nl80211_finish_drv_init()
2311 nl80211_disable_11b_rates(bss->drv, in wpa_driver_nl80211_finish_drv_init()
2312 bss->drv->ifindex, 1); in wpa_driver_nl80211_finish_drv_init()
2318 "interface '%s' due to rfkill", bss->ifname); in wpa_driver_nl80211_finish_drv_init()
2330 if (linux_get_ifhwaddr(drv->global->ioctl_sock, bss->ifname, in wpa_driver_nl80211_finish_drv_init()
2331 bss->addr)) in wpa_driver_nl80211_finish_drv_init()
2333 os_memcpy(drv->perm_addr, bss->addr, ETH_ALEN); in wpa_driver_nl80211_finish_drv_init()
2366 static void wpa_driver_nl80211_deinit(struct i802_bss *bss) in wpa_driver_nl80211_deinit() argument
2368 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_deinit()
2371 bss->ifname, drv->disabled_11b_rates); in wpa_driver_nl80211_deinit()
2373 bss->in_deinit = 1; in wpa_driver_nl80211_deinit()
2379 if (bss->nl_preq) in wpa_driver_nl80211_deinit()
2380 wpa_driver_nl80211_probe_req_report(bss, 0); in wpa_driver_nl80211_deinit()
2381 if (bss->added_if_into_bridge) { in wpa_driver_nl80211_deinit()
2382 if (linux_br_del_if(drv->global->ioctl_sock, bss->brname, in wpa_driver_nl80211_deinit()
2383 bss->ifname) < 0) in wpa_driver_nl80211_deinit()
2386 bss->ifname, bss->brname, strerror(errno)); in wpa_driver_nl80211_deinit()
2390 if (bss->added_bridge) { in wpa_driver_nl80211_deinit()
2391 if (linux_set_iface_flags(drv->global->ioctl_sock, bss->brname, in wpa_driver_nl80211_deinit()
2395 bss->brname); in wpa_driver_nl80211_deinit()
2396 if (linux_br_del(drv->global->ioctl_sock, bss->brname) < 0) in wpa_driver_nl80211_deinit()
2399 bss->brname, strerror(errno)); in wpa_driver_nl80211_deinit()
2429 (void) i802_set_iface_flags(bss, 0); in wpa_driver_nl80211_deinit()
2432 if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, in wpa_driver_nl80211_deinit()
2437 if (linux_set_ifhwaddr(drv->global->ioctl_sock, bss->ifname, in wpa_driver_nl80211_deinit()
2446 wpa_driver_nl80211_set_mode(bss, in wpa_driver_nl80211_deinit()
2448 nl80211_mgmt_unsubscribe(bss, "deinit"); in wpa_driver_nl80211_deinit()
2450 nl80211_mgmt_unsubscribe(bss, "deinit"); in wpa_driver_nl80211_deinit()
2451 nl80211_del_p2pdev(bss); in wpa_driver_nl80211_deinit()
2592 static int wpa_driver_nl80211_set_key(const char *ifname, struct i802_bss *bss, in wpa_driver_nl80211_set_key() argument
2598 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_set_key()
2874 static int wpa_driver_nl80211_deauthenticate(struct i802_bss *bss, in wpa_driver_nl80211_deauthenticate() argument
2877 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_deauthenticate()
2946 static void nl80211_unmask_11b_rates(struct i802_bss *bss) in nl80211_unmask_11b_rates() argument
2948 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_unmask_11b_rates()
2960 bss->ifname); in nl80211_unmask_11b_rates()
2966 struct i802_bss *bss, struct wpa_driver_auth_params *params) in wpa_driver_nl80211_authenticate() argument
2968 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_authenticate()
2976 nl80211_unmask_11b_rates(bss); in wpa_driver_nl80211_authenticate()
2992 wpa_driver_nl80211_set_mode(bss, nlmode) < 0) in wpa_driver_nl80211_authenticate()
3006 wpa_driver_nl80211_set_key(bss->ifname, bss, WPA_ALG_WEP, in wpa_driver_nl80211_authenticate()
3086 bss, params->bssid, in wpa_driver_nl80211_authenticate()
3114 ret = wpa_driver_nl80211_scan(bss, &scan); in wpa_driver_nl80211_authenticate()
3147 struct i802_bss *bss = drv->first_bss; in wpa_driver_nl80211_authenticate_retry() local
3178 return wpa_driver_nl80211_authenticate(bss, &params); in wpa_driver_nl80211_authenticate_retry()
3182 static int wpa_driver_nl80211_send_frame(struct i802_bss *bss, in wpa_driver_nl80211_send_frame() argument
3190 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_send_frame()
3202 bss->freq); in wpa_driver_nl80211_send_frame()
3203 freq = bss->freq; in wpa_driver_nl80211_send_frame()
3208 freq, bss->freq); in wpa_driver_nl80211_send_frame()
3213 res = nl80211_send_frame_cmd(bss, freq, wait_time, data, len, in wpa_driver_nl80211_send_frame()
3237 static int wpa_driver_nl80211_send_mlme(struct i802_bss *bss, const u8 *data, in wpa_driver_nl80211_send_mlme() argument
3245 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_send_mlme()
3271 return nl80211_send_frame_cmd(bss, freq, 0, in wpa_driver_nl80211_send_mlme()
3279 bss->freq); in wpa_driver_nl80211_send_mlme()
3280 freq = bss->freq; in wpa_driver_nl80211_send_mlme()
3282 return nl80211_send_frame_cmd(bss, freq, in wpa_driver_nl80211_send_mlme()
3283 (int) freq == bss->freq ? 0 : in wpa_driver_nl80211_send_mlme()
3306 return wpa_driver_nl80211_send_frame(bss, data, data_len, encrypt, in wpa_driver_nl80211_send_mlme()
3329 static int nl80211_set_bss(struct i802_bss *bss, int cts, int preamble, in nl80211_set_bss() argument
3333 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_bss()
3336 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_BSS)) || in nl80211_set_bss()
3359 struct i802_bss *bss = priv; in wpa_driver_nl80211_set_acl() local
3360 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_set_acl()
3421 struct i802_bss *bss = priv; in wpa_driver_nl80211_set_ap() local
3422 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_set_ap()
3432 beacon_set = params->reenable ? 0 : bss->beacon_set; in wpa_driver_nl80211_set_ap()
3443 wpa_printf(MSG_DEBUG, "nl80211: ifindex=%d", bss->ifindex); in wpa_driver_nl80211_set_ap()
3448 if (!(msg = nl80211_bss_msg(bss, 0, cmd)) || in wpa_driver_nl80211_set_ap()
3625 bss->beacon_set = 1; in wpa_driver_nl80211_set_ap()
3626 nl80211_set_bss(bss, params->cts_protect, params->preamble, in wpa_driver_nl80211_set_ap()
3630 params->freq->bandwidth != bss->bandwidth) { in wpa_driver_nl80211_set_ap()
3633 bss->ifname, bss->bandwidth, in wpa_driver_nl80211_set_ap()
3635 ret = nl80211_set_channel(bss, params->freq, 1); in wpa_driver_nl80211_set_ap()
3643 bss->bandwidth = params->freq->bandwidth; in wpa_driver_nl80211_set_ap()
3651 bss->bandwidth = params->freq->bandwidth; in wpa_driver_nl80211_set_ap()
3732 static int nl80211_set_channel(struct i802_bss *bss, in nl80211_set_channel() argument
3735 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_channel()
3753 bss->freq = freq->freq; in nl80211_set_channel()
3815 struct i802_bss *bss = priv; in wpa_driver_nl80211_sta_add() local
3816 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_sta_add()
3827 msg = nl80211_bss_msg(bss, 0, params->set ? NL80211_CMD_SET_STATION : in wpa_driver_nl80211_sta_add()
4017 static void rtnl_neigh_delete_fdb_entry(struct i802_bss *bss, const u8 *addr) in rtnl_neigh_delete_fdb_entry() argument
4020 struct wpa_driver_nl80211_data *drv = bss->drv; in rtnl_neigh_delete_fdb_entry()
4030 rtnl_neigh_set_ifindex(rn, bss->ifindex); in rtnl_neigh_delete_fdb_entry()
4042 bss->ifindex, nl_geterror(err)); in rtnl_neigh_delete_fdb_entry()
4054 static int wpa_driver_nl80211_sta_remove(struct i802_bss *bss, const u8 *addr, in wpa_driver_nl80211_sta_remove() argument
4057 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_sta_remove()
4061 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_STATION)) || in wpa_driver_nl80211_sta_remove()
4078 bss->ifname, MAC2STR(addr), ret, strerror(-ret)); in wpa_driver_nl80211_sta_remove()
4081 rtnl_neigh_delete_fdb_entry(bss, addr); in wpa_driver_nl80211_sta_remove()
4273 static int nl80211_setup_ap(struct i802_bss *bss) in nl80211_setup_ap() argument
4275 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_setup_ap()
4278 bss->ifname, drv->device_ap_sme, drv->use_monitor); in nl80211_setup_ap()
4286 wpa_driver_nl80211_probe_req_report(bss, 0); in nl80211_setup_ap()
4289 if (nl80211_mgmt_subscribe_ap(bss)) in nl80211_setup_ap()
4293 if (nl80211_mgmt_subscribe_ap_dev_sme(bss)) in nl80211_setup_ap()
4302 wpa_driver_nl80211_probe_req_report(bss, 1) < 0) { in nl80211_setup_ap()
4312 static void nl80211_teardown_ap(struct i802_bss *bss) in nl80211_teardown_ap() argument
4314 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_teardown_ap()
4317 bss->ifname, drv->device_ap_sme, drv->use_monitor); in nl80211_teardown_ap()
4319 wpa_driver_nl80211_probe_req_report(bss, 0); in nl80211_teardown_ap()
4321 nl80211_mgmt_unsubscribe(bss, "AP teardown (dev SME)"); in nl80211_teardown_ap()
4325 nl80211_mgmt_unsubscribe(bss, "AP teardown"); in nl80211_teardown_ap()
4327 bss->beacon_set = 0; in nl80211_teardown_ap()
4331 static int nl80211_send_eapol_data(struct i802_bss *bss, in nl80211_send_eapol_data() argument
4338 if (bss->drv->eapol_tx_sock < 0) { in nl80211_send_eapol_data()
4345 ll.sll_ifindex = bss->ifindex; in nl80211_send_eapol_data()
4349 ret = sendto(bss->drv->eapol_tx_sock, data, data_len, 0, in nl80211_send_eapol_data()
4365 struct i802_bss *bss = priv; in wpa_driver_nl80211_hapd_send_eapol() local
4366 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_hapd_send_eapol()
4374 return nl80211_send_eapol_data(bss, addr, data, data_len); in wpa_driver_nl80211_hapd_send_eapol()
4413 res = wpa_driver_nl80211_send_frame(bss, (u8 *) hdr, len, encrypt, 0, in wpa_driver_nl80211_hapd_send_eapol()
4431 struct i802_bss *bss = priv; in wpa_driver_nl80211_sta_set_flags() local
4438 bss->ifname, MAC2STR(addr), total_flags, flags_or, flags_and, in wpa_driver_nl80211_sta_set_flags()
4441 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_STATION)) || in wpa_driver_nl80211_sta_set_flags()
4471 return send_and_recv_msgs(bss->drv, msg, NULL, NULL); in wpa_driver_nl80211_sta_set_flags()
4972 struct i802_bss *bss = priv; in wpa_driver_nl80211_associate() local
4973 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_associate()
4977 nl80211_unmask_11b_rates(bss); in wpa_driver_nl80211_associate()
5050 struct i802_bss *bss, in wpa_driver_nl80211_set_mode_impl() argument
5054 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_set_mode_impl()
5062 if (mode_switch_res && nlmode == nl80211_get_ifmode(bss)) in wpa_driver_nl80211_set_mode_impl()
5088 res = i802_set_iface_flags(bss, 0); in wpa_driver_nl80211_set_mode_impl()
5103 res = nl80211_set_channel(bss, desired_freq_params, 0); in wpa_driver_nl80211_set_mode_impl()
5130 res = linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1); in wpa_driver_nl80211_set_mode_impl()
5147 bss->ifname); in wpa_driver_nl80211_set_mode_impl()
5152 bss->ifname); in wpa_driver_nl80211_set_mode_impl()
5157 nl80211_mgmt_unsubscribe(bss, "start AP"); in wpa_driver_nl80211_set_mode_impl()
5159 if (nl80211_setup_ap(bss)) in wpa_driver_nl80211_set_mode_impl()
5163 nl80211_teardown_ap(bss); in wpa_driver_nl80211_set_mode_impl()
5165 nl80211_mgmt_unsubscribe(bss, "mode change"); in wpa_driver_nl80211_set_mode_impl()
5169 nl80211_mgmt_subscribe_mesh(bss)) in wpa_driver_nl80211_set_mode_impl()
5172 if (!bss->in_deinit && !is_ap_interface(nlmode) && in wpa_driver_nl80211_set_mode_impl()
5174 nl80211_mgmt_subscribe_non_ap(bss) < 0) in wpa_driver_nl80211_set_mode_impl()
5182 int wpa_driver_nl80211_set_mode(struct i802_bss *bss, in wpa_driver_nl80211_set_mode() argument
5185 return wpa_driver_nl80211_set_mode_impl(bss, nlmode, NULL); in wpa_driver_nl80211_set_mode()
5189 static int wpa_driver_nl80211_set_mode_ibss(struct i802_bss *bss, in wpa_driver_nl80211_set_mode_ibss() argument
5192 return wpa_driver_nl80211_set_mode_impl(bss, NL80211_IFTYPE_ADHOC, in wpa_driver_nl80211_set_mode_ibss()
5200 struct i802_bss *bss = priv; in wpa_driver_nl80211_get_capa() local
5201 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_get_capa()
5218 struct i802_bss *bss = priv; in wpa_driver_nl80211_set_operstate() local
5219 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_set_operstate()
5222 bss->ifname, drv->operstate, state, in wpa_driver_nl80211_set_operstate()
5232 struct i802_bss *bss = priv; in wpa_driver_nl80211_set_supp_port() local
5233 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_set_supp_port()
5251 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_STATION)) || in wpa_driver_nl80211_set_supp_port()
5270 struct i802_bss *bss = priv; in i802_set_freq() local
5271 return nl80211_set_channel(bss, freq, 0); in i802_set_freq()
5307 struct i802_bss *bss = priv; in i802_get_seqnum() local
5308 struct wpa_driver_nl80211_data *drv = bss->drv; in i802_get_seqnum()
5328 struct i802_bss *bss = priv; in i802_set_rts() local
5329 struct wpa_driver_nl80211_data *drv = bss->drv; in i802_set_rts()
5356 struct i802_bss *bss = priv; in i802_set_frag() local
5357 struct wpa_driver_nl80211_data *drv = bss->drv; in i802_set_frag()
5384 struct i802_bss *bss = priv; in i802_flush() local
5389 bss->ifname); in i802_flush()
5394 msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_STATION); in i802_flush()
5395 res = send_and_recv_msgs(bss->drv, msg, NULL, NULL); in i802_flush()
5474 static int i802_read_sta_data(struct i802_bss *bss, in i802_read_sta_data() argument
5482 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_GET_STATION)) || in i802_read_sta_data()
5488 return send_and_recv_msgs(bss->drv, msg, get_sta_handler, data); in i802_read_sta_data()
5495 struct i802_bss *bss = priv; in i802_set_tx_queue_params() local
5496 struct wpa_driver_nl80211_data *drv = bss->drv; in i802_set_tx_queue_params()
5500 msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_WIPHY); in i802_set_tx_queue_params()
5553 static int i802_set_sta_vlan(struct i802_bss *bss, const u8 *addr, in i802_set_sta_vlan() argument
5556 struct wpa_driver_nl80211_data *drv = bss->drv; in i802_set_sta_vlan()
5562 bss->ifname, if_nametoindex(bss->ifname), in i802_set_sta_vlan()
5564 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_STATION)) || in i802_set_sta_vlan()
5609 struct i802_bss *bss = priv; in i802_sta_deauth() local
5610 struct wpa_driver_nl80211_data *drv = bss->drv; in i802_sta_deauth()
5617 return wpa_driver_nl80211_sta_remove(bss, addr, 1, reason); in i802_sta_deauth()
5626 return wpa_driver_nl80211_send_mlme(bss, (u8 *) &mgmt, in i802_sta_deauth()
5636 struct i802_bss *bss = priv; in i802_sta_disassoc() local
5637 struct wpa_driver_nl80211_data *drv = bss->drv; in i802_sta_disassoc()
5644 return wpa_driver_nl80211_sta_remove(bss, addr, 0, reason); in i802_sta_disassoc()
5653 return wpa_driver_nl80211_send_mlme(bss, (u8 *) &mgmt, in i802_sta_disassoc()
5790 struct i802_bss *bss = priv; in i802_set_wds_sta() local
5791 struct wpa_driver_nl80211_data *drv = bss->drv; in i802_set_wds_sta()
5794 os_snprintf(name, sizeof(name), "%s.sta%d", bss->ifname, aid); in i802_set_wds_sta()
5804 bss->addr, 1, NULL, NULL, 0) < in i802_set_wds_sta()
5822 i802_set_sta_vlan(priv, addr, bss->ifname, 0); in i802_set_wds_sta()
5851 struct i802_bss *bss, in i802_check_bridge() argument
5857 os_strlcpy(bss->brname, brname, IFNAMSIZ); in i802_check_bridge()
5870 bss->added_bridge = 1; in i802_check_bridge()
5874 bss->br_ifindex = br_ifindex; in i802_check_bridge()
5900 bss->added_if_into_bridge = 1; in i802_check_bridge()
5910 struct i802_bss *bss; in i802_init() local
5916 bss = wpa_driver_nl80211_drv_init(hapd, params->ifname, in i802_init()
5919 if (bss == NULL) in i802_init()
5922 drv = bss->drv; in i802_init()
5928 os_strlcpy(bss->brname, master_ifname, IFNAMSIZ); in i802_init()
5941 os_strlcpy(bss->brname, master_ifname, IFNAMSIZ); in i802_init()
5947 bss->br_ifindex = br_ifindex; in i802_init()
5963 if (i802_check_bridge(drv, bss, params->bridge[0], in i802_init()
5975 if (bss->added_if_into_bridge) { in i802_init()
6003 if (linux_get_ifhwaddr(drv->global->ioctl_sock, bss->ifname, in i802_init()
6008 memcpy(bss->addr, params->own_addr, ETH_ALEN); in i802_init()
6010 return bss; in i802_init()
6013 wpa_driver_nl80211_deinit(bss); in i802_init()
6020 struct i802_bss *bss = priv; in i802_deinit() local
6021 wpa_driver_nl80211_deinit(bss); in i802_deinit()
6121 struct i802_bss *bss = priv; in wpa_driver_nl80211_if_add() local
6122 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_if_add()
6162 os_memcpy(if_addr, bss->addr, ETH_ALEN); in wpa_driver_nl80211_if_add()
6264 static int wpa_driver_nl80211_if_remove(struct i802_bss *bss, in wpa_driver_nl80211_if_remove() argument
6268 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_if_remove()
6272 __func__, type, ifname, ifindex, bss->added_if); in wpa_driver_nl80211_if_remove()
6273 if (ifindex > 0 && (bss->added_if || bss->ifindex != ifindex)) in wpa_driver_nl80211_if_remove()
6275 else if (ifindex > 0 && !bss->added_if) { in wpa_driver_nl80211_if_remove()
6287 if (bss->added_if_into_bridge) { in wpa_driver_nl80211_if_remove()
6288 if (linux_br_del_if(drv->global->ioctl_sock, bss->brname, in wpa_driver_nl80211_if_remove()
6289 bss->ifname) < 0) in wpa_driver_nl80211_if_remove()
6292 bss->ifname, bss->brname, strerror(errno)); in wpa_driver_nl80211_if_remove()
6294 if (bss->added_bridge) { in wpa_driver_nl80211_if_remove()
6295 if (linux_br_del(drv->global->ioctl_sock, bss->brname) < 0) in wpa_driver_nl80211_if_remove()
6298 bss->brname, strerror(errno)); in wpa_driver_nl80211_if_remove()
6301 if (bss != drv->first_bss) { in wpa_driver_nl80211_if_remove()
6306 if (tbss->next == bss) { in wpa_driver_nl80211_if_remove()
6307 tbss->next = bss->next; in wpa_driver_nl80211_if_remove()
6309 nl80211_teardown_ap(bss); in wpa_driver_nl80211_if_remove()
6310 nl80211_destroy_bss(bss); in wpa_driver_nl80211_if_remove()
6311 if (!bss->added_if) in wpa_driver_nl80211_if_remove()
6312 i802_set_iface_flags(bss, 0); in wpa_driver_nl80211_if_remove()
6313 os_free(bss); in wpa_driver_nl80211_if_remove()
6314 bss = NULL; in wpa_driver_nl80211_if_remove()
6318 if (bss) in wpa_driver_nl80211_if_remove()
6320 "BSS %p in the list", __func__, bss); in wpa_driver_nl80211_if_remove()
6323 nl80211_teardown_ap(bss); in wpa_driver_nl80211_if_remove()
6324 if (!bss->added_if && !drv->first_bss->next) in wpa_driver_nl80211_if_remove()
6326 nl80211_destroy_bss(bss); in wpa_driver_nl80211_if_remove()
6327 if (!bss->added_if) in wpa_driver_nl80211_if_remove()
6328 i802_set_iface_flags(bss, 0); in wpa_driver_nl80211_if_remove()
6332 os_free(bss); in wpa_driver_nl80211_if_remove()
6355 static int nl80211_send_frame_cmd(struct i802_bss *bss, in nl80211_send_frame_cmd() argument
6362 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_send_frame_cmd()
6372 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_FRAME)) || in nl80211_send_frame_cmd()
6421 static int wpa_driver_nl80211_send_action(struct i802_bss *bss, in wpa_driver_nl80211_send_action() argument
6429 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_send_action()
6451 (int) freq == bss->freq || drv->device_ap_sme || in wpa_driver_nl80211_send_action()
6453 ret = wpa_driver_nl80211_send_mlme(bss, buf, 24 + data_len, in wpa_driver_nl80211_send_action()
6457 ret = nl80211_send_frame_cmd(bss, freq, wait_time, buf, in wpa_driver_nl80211_send_action()
6467 static void nl80211_frame_wait_cancel(struct i802_bss *bss, u64 cookie) in nl80211_frame_wait_cancel() argument
6469 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_frame_wait_cancel()
6475 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_FRAME_WAIT_CANCEL)) || in nl80211_frame_wait_cancel()
6490 struct i802_bss *bss = priv; in wpa_driver_nl80211_send_action_cancel_wait() local
6491 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_send_action_cancel_wait()
6496 nl80211_frame_wait_cancel(bss, drv->send_action_cookie); in wpa_driver_nl80211_send_action_cancel_wait()
6506 nl80211_frame_wait_cancel(bss, cookie); in wpa_driver_nl80211_send_action_cancel_wait()
6515 struct i802_bss *bss = priv; in wpa_driver_nl80211_remain_on_channel() local
6516 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_remain_on_channel()
6521 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_REMAIN_ON_CHANNEL)) || in wpa_driver_nl80211_remain_on_channel()
6547 struct i802_bss *bss = priv; in wpa_driver_nl80211_cancel_remain_on_channel() local
6548 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_cancel_remain_on_channel()
6562 msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL); in wpa_driver_nl80211_cancel_remain_on_channel()
6578 static int wpa_driver_nl80211_probe_req_report(struct i802_bss *bss, int report) in wpa_driver_nl80211_probe_req_report() argument
6580 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_probe_req_report()
6583 if (bss->nl_preq && drv->device_ap_sme && in wpa_driver_nl80211_probe_req_report()
6584 is_ap_interface(drv->nlmode) && !bss->in_deinit && in wpa_driver_nl80211_probe_req_report()
6585 !bss->static_ap) { in wpa_driver_nl80211_probe_req_report()
6592 "in AP mode", bss->nl_preq); in wpa_driver_nl80211_probe_req_report()
6593 } else if (bss->nl_preq) { in wpa_driver_nl80211_probe_req_report()
6595 "reporting nl_preq=%p", bss->nl_preq); in wpa_driver_nl80211_probe_req_report()
6596 nl80211_destroy_eloop_handle(&bss->nl_preq); in wpa_driver_nl80211_probe_req_report()
6601 if (bss->nl_preq) { in wpa_driver_nl80211_probe_req_report()
6603 "already on! nl_preq=%p", bss->nl_preq); in wpa_driver_nl80211_probe_req_report()
6607 bss->nl_preq = nl_create_handle(drv->global->nl_cb, "preq"); in wpa_driver_nl80211_probe_req_report()
6608 if (bss->nl_preq == NULL) in wpa_driver_nl80211_probe_req_report()
6611 "reporting nl_preq=%p", bss->nl_preq); in wpa_driver_nl80211_probe_req_report()
6613 if (nl80211_register_frame(bss, bss->nl_preq, in wpa_driver_nl80211_probe_req_report()
6619 nl80211_register_eloop_read(&bss->nl_preq, in wpa_driver_nl80211_probe_req_report()
6621 bss->nl_cb); in wpa_driver_nl80211_probe_req_report()
6626 nl_destroy_handles(&bss->nl_preq); in wpa_driver_nl80211_probe_req_report()
6683 struct i802_bss *bss = priv; in wpa_driver_nl80211_deinit_ap() local
6684 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_deinit_ap()
6688 bss->beacon_set = 0; in wpa_driver_nl80211_deinit_ap()
6694 if (drv->nlmode == NL80211_IFTYPE_P2P_GO && bss->if_dynamic) in wpa_driver_nl80211_deinit_ap()
6703 struct i802_bss *bss = priv; in wpa_driver_nl80211_stop_ap() local
6704 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_stop_ap()
6708 bss->beacon_set = 0; in wpa_driver_nl80211_stop_ap()
6715 struct i802_bss *bss = priv; in wpa_driver_nl80211_deinit_p2p_cli() local
6716 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_deinit_p2p_cli()
6724 if (bss->if_dynamic) in wpa_driver_nl80211_deinit_p2p_cli()
6733 struct i802_bss *bss = priv; in wpa_driver_nl80211_resume() local
6734 enum nl80211_iftype nlmode = nl80211_get_ifmode(bss); in wpa_driver_nl80211_resume()
6736 if (i802_set_iface_flags(bss, 1)) in wpa_driver_nl80211_resume()
6740 nl80211_disable_11b_rates(bss->drv, bss->drv->ifindex, 1); in wpa_driver_nl80211_resume()
6746 struct i802_bss *bss = priv; in nl80211_signal_monitor() local
6747 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_signal_monitor()
6754 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_CQM)) || in nl80211_signal_monitor()
6807 struct i802_bss *bss = priv; in nl80211_signal_poll() local
6808 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_signal_poll()
6831 struct i802_bss *bss = priv; in nl80211_send_frame() local
6832 return wpa_driver_nl80211_send_frame(bss, data, data_len, encrypt, 0, in nl80211_send_frame()
6845 struct i802_bss *bss = priv; in nl80211_set_param() local
6846 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_param()
6856 struct i802_bss *bss = priv; in nl80211_set_param() local
6857 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_param()
6862 struct i802_bss *bss = priv; in nl80211_set_param() local
6863 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_param()
6869 struct i802_bss *bss = priv; in nl80211_set_param() local
6870 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_param()
6953 struct i802_bss *bss = priv; in nl80211_get_radio_name() local
6954 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_get_radio_name()
6959 static int nl80211_pmkid(struct i802_bss *bss, int cmd, const u8 *bssid, in nl80211_pmkid() argument
6964 if (!(msg = nl80211_bss_msg(bss, 0, cmd)) || in nl80211_pmkid()
6971 return send_and_recv_msgs(bss->drv, msg, NULL, NULL); in nl80211_pmkid()
6977 struct i802_bss *bss = priv; in nl80211_add_pmkid() local
6979 return nl80211_pmkid(bss, NL80211_CMD_SET_PMKSA, bssid, pmkid); in nl80211_add_pmkid()
6985 struct i802_bss *bss = priv; in nl80211_remove_pmkid() local
6988 return nl80211_pmkid(bss, NL80211_CMD_DEL_PMKSA, bssid, pmkid); in nl80211_remove_pmkid()
6994 struct i802_bss *bss = priv; in nl80211_flush_pmkid() local
6996 return nl80211_pmkid(bss, NL80211_CMD_FLUSH_PMKSA, NULL, NULL); in nl80211_flush_pmkid()
7139 struct i802_bss *bss = priv; in wpa_driver_nl80211_get_survey() local
7140 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_get_survey()
7178 struct i802_bss *bss = priv; in nl80211_set_rekey_info() local
7179 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_rekey_info()
7188 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_REKEY_OFFLOAD)) || in nl80211_set_rekey_info()
7210 static void nl80211_send_null_frame(struct i802_bss *bss, const u8 *own_addr, in nl80211_send_null_frame() argument
7242 if (wpa_driver_nl80211_send_mlme(bss, (u8 *) &nulldata, size, 0, 0, 0, in nl80211_send_null_frame()
7251 struct i802_bss *bss = priv; in nl80211_poll_client() local
7252 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_poll_client()
7257 nl80211_send_null_frame(bss, own_addr, addr, qos); in nl80211_poll_client()
7261 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_PROBE_CLIENT)) || in nl80211_poll_client()
7276 static int nl80211_set_power_save(struct i802_bss *bss, int enabled) in nl80211_set_power_save() argument
7280 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_POWER_SAVE)) || in nl80211_set_power_save()
7286 return send_and_recv_msgs(bss->drv, msg, NULL, NULL); in nl80211_set_power_save()
7293 struct i802_bss *bss = priv; in nl80211_set_p2p_powersave() local
7311 return nl80211_set_power_save(bss, legacy_ps); in nl80211_set_p2p_powersave()
7318 struct i802_bss *bss = priv; in nl80211_start_radar_detection() local
7319 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_start_radar_detection()
7354 struct i802_bss *bss = priv; in nl80211_send_tdls_mgmt() local
7355 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_send_tdls_mgmt()
7396 struct i802_bss *bss = priv; in nl80211_tdls_oper() local
7397 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_tdls_oper()
7443 struct i802_bss *bss = priv; in nl80211_tdls_enable_channel_switch() local
7444 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_tdls_enable_channel_switch()
7455 msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_TDLS_CHANNEL_SWITCH); in nl80211_tdls_enable_channel_switch()
7472 struct i802_bss *bss = priv; in nl80211_tdls_disable_channel_switch() local
7473 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_tdls_disable_channel_switch()
7482 msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH); in nl80211_tdls_disable_channel_switch()
7503 struct i802_bss *bss = priv; in driver_nl80211_set_key() local
7504 return wpa_driver_nl80211_set_key(ifname, bss, alg, addr, key_idx, in driver_nl80211_set_key()
7512 struct i802_bss *bss = priv; in driver_nl80211_scan2() local
7514 struct wpa_driver_nl80211_data *drv = bss->drv; in driver_nl80211_scan2()
7524 return wpa_driver_nl80211_vendor_scan(bss, params); in driver_nl80211_scan2()
7526 return wpa_driver_nl80211_scan(bss, params); in driver_nl80211_scan2()
7533 struct i802_bss *bss = priv; in driver_nl80211_deauthenticate() local
7534 return wpa_driver_nl80211_deauthenticate(bss, addr, reason_code); in driver_nl80211_deauthenticate()
7541 struct i802_bss *bss = priv; in driver_nl80211_authenticate() local
7542 return wpa_driver_nl80211_authenticate(bss, params); in driver_nl80211_authenticate()
7548 struct i802_bss *bss = priv; in driver_nl80211_deinit() local
7549 wpa_driver_nl80211_deinit(bss); in driver_nl80211_deinit()
7556 struct i802_bss *bss = priv; in driver_nl80211_if_remove() local
7557 return wpa_driver_nl80211_if_remove(bss, type, ifname); in driver_nl80211_if_remove()
7566 struct i802_bss *bss = priv; in driver_nl80211_send_mlme() local
7567 return wpa_driver_nl80211_send_mlme(bss, data, data_len, noack, in driver_nl80211_send_mlme()
7575 struct i802_bss *bss = priv; in driver_nl80211_sta_remove() local
7576 return wpa_driver_nl80211_sta_remove(bss, addr, -1, 0); in driver_nl80211_sta_remove()
7583 struct i802_bss *bss = priv; in driver_nl80211_set_sta_vlan() local
7584 return i802_set_sta_vlan(bss, addr, ifname, vlan_id); in driver_nl80211_set_sta_vlan()
7592 struct i802_bss *bss = priv; in driver_nl80211_read_sta_data() local
7593 return i802_read_sta_data(bss, data, addr); in driver_nl80211_read_sta_data()
7604 struct i802_bss *bss = priv; in driver_nl80211_send_action() local
7605 return wpa_driver_nl80211_send_action(bss, freq, wait_time, dst, src, in driver_nl80211_send_action()
7612 struct i802_bss *bss = priv; in driver_nl80211_probe_req_report() local
7613 return wpa_driver_nl80211_probe_req_report(bss, report); in driver_nl80211_probe_req_report()
7622 struct i802_bss *bss = priv; in wpa_driver_nl80211_update_ft_ies() local
7623 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_update_ft_ies()
7646 struct i802_bss *bss = priv; in wpa_driver_nl80211_get_macaddr() local
7647 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_get_macaddr()
7652 return bss->addr; in wpa_driver_nl80211_get_macaddr()
7683 struct i802_bss *bss = priv; in wpa_driver_nl80211_status() local
7684 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_status()
7698 bss->ifindex, in wpa_driver_nl80211_status()
7699 bss->ifname, in wpa_driver_nl80211_status()
7700 bss->brname, in wpa_driver_nl80211_status()
7701 MAC2STR(bss->addr), in wpa_driver_nl80211_status()
7702 bss->freq, in wpa_driver_nl80211_status()
7703 bss->beacon_set ? "beacon_set=1\n" : "", in wpa_driver_nl80211_status()
7704 bss->added_if_into_bridge ? in wpa_driver_nl80211_status()
7706 bss->added_bridge ? "added_bridge=1\n" : "", in wpa_driver_nl80211_status()
7707 bss->in_deinit ? "in_deinit=1\n" : "", in wpa_driver_nl80211_status()
7708 bss->if_dynamic ? "if_dynamic=1\n" : ""); in wpa_driver_nl80211_status()
7713 if (bss->wdev_id_set) { in wpa_driver_nl80211_status()
7715 (unsigned long long) bss->wdev_id); in wpa_driver_nl80211_status()
7863 struct i802_bss *bss = priv; in nl80211_switch_channel() local
7864 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_switch_channel()
7936 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_CHANNEL_SWITCH)) || in nl80211_switch_channel()
7987 struct i802_bss *bss = priv; in nl80211_add_ts() local
7988 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_add_ts()
7999 msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_ADD_TX_TS); in nl80211_add_ts()
8019 struct i802_bss *bss = priv; in nl80211_del_ts() local
8020 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_del_ts()
8029 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_DEL_TX_TS)) || in nl80211_del_ts()
8101 struct i802_bss *bss = priv; in nl80211_vendor_cmd() local
8102 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_vendor_cmd()
8124 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_VENDOR)) || in nl80211_vendor_cmd()
8146 struct i802_bss *bss = priv; in nl80211_set_qos_map() local
8147 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_qos_map()
8171 struct i802_bss *bss = priv; in nl80211_set_wowlan() local
8172 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_wowlan()
8179 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_SET_WOWLAN)) || in nl80211_set_wowlan()
8213 struct i802_bss *bss = priv; in nl80211_roaming() local
8214 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_roaming()
8248 struct i802_bss *bss = priv; in nl80211_set_mac_addr() local
8249 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_mac_addr()
8255 if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 0) < 0) in nl80211_set_mac_addr()
8258 if (linux_set_ifhwaddr(drv->global->ioctl_sock, bss->ifname, addr) < 0) in nl80211_set_mac_addr()
8262 bss->ifname, MAC2STR(addr)); in nl80211_set_mac_addr()
8263 if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, in nl80211_set_mac_addr()
8272 bss->ifname, MAC2STR(addr)); in nl80211_set_mac_addr()
8274 os_memcpy(bss->addr, addr, ETH_ALEN); in nl80211_set_mac_addr()
8276 if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1) < 0) in nl80211_set_mac_addr()
8312 static int nl80211_join_mesh(struct i802_bss *bss, in nl80211_join_mesh() argument
8315 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_join_mesh()
8387 bss->freq = params->freq.freq; in nl80211_join_mesh()
8400 struct i802_bss *bss = priv; in wpa_driver_nl80211_join_mesh() local
8409 ret = nl80211_join_mesh(bss, params); in wpa_driver_nl80211_join_mesh()
8429 struct i802_bss *bss = priv; in wpa_driver_nl80211_leave_mesh() local
8430 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_leave_mesh()
8461 struct i802_bss *bss = priv; in wpa_driver_br_add_ip_neigh() local
8462 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_br_add_ip_neigh()
8472 if (bss->br_ifindex == 0) { in wpa_driver_br_add_ip_neigh()
8522 rtnl_neigh_set_ifindex(rn, bss->br_ifindex); in wpa_driver_br_add_ip_neigh()
8549 struct i802_bss *bss = priv; in wpa_driver_br_delete_ip_neigh() local
8550 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_br_delete_ip_neigh()
8569 if (bss->br_ifindex == 0) { in wpa_driver_br_delete_ip_neigh()
8599 rtnl_neigh_set_ifindex(rn, bss->br_ifindex); in wpa_driver_br_delete_ip_neigh()
8661 struct i802_bss *bss = priv; in wpa_driver_br_port_set_attr() local
8670 bss->ifname, attr_txt); in wpa_driver_br_port_set_attr()
8693 struct i802_bss *bss = priv; in wpa_driver_br_set_net_param() local
8701 bss->brname); in wpa_driver_br_set_net_param()
8718 ip_version, bss->brname, param_txt); in wpa_driver_br_set_net_param()
8771 struct i802_bss *bss = priv; in wpa_driver_do_acs() local
8772 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_do_acs()
8822 struct i802_bss *bss = priv; in nl80211_set_band() local
8823 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_band()
8934 struct i802_bss *bss = priv; in nl80211_get_pref_freq_list() local
8935 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_get_pref_freq_list()
9010 struct i802_bss *bss = priv; in nl80211_set_prob_oper_freq() local
9011 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_prob_oper_freq()
9021 freq, bss->ifindex); in nl80211_set_prob_oper_freq()