Lines Matching refs:bss
157 static void wpa_driver_nl80211_deinit(struct i802_bss *bss);
158 static int wpa_driver_nl80211_set_mode_ibss(struct i802_bss *bss,
165 static int nl80211_send_frame_cmd(struct i802_bss *bss,
171 static int wpa_driver_nl80211_probe_req_report(struct i802_bss *bss,
183 static int nl80211_set_channel(struct i802_bss *bss,
191 static int i802_set_iface_flags(struct i802_bss *bss, int up);
246 struct i802_bss *bss; in get_bss_ifindex() local
248 for (bss = drv->first_bss; bss; bss = bss->next) { in get_bss_ifindex()
249 if (bss->ifindex == ifindex) in get_bss_ifindex()
250 return bss; in get_bss_ifindex()
476 struct nl_sock * get_connect_handle(struct i802_bss *bss) in get_connect_handle() argument
478 if ((bss->drv->capa.flags2 & WPA_DRIVER_FLAGS2_CONTROL_PORT_RX) || in get_connect_handle()
479 bss->use_nl_connect) in get_connect_handle()
480 return bss->nl_connect; in get_connect_handle()
557 static int nl80211_set_iface_id(struct nl_msg *msg, struct i802_bss *bss) in nl80211_set_iface_id() argument
559 if (bss->wdev_id_set) in nl80211_set_iface_id()
560 return nla_put_u64(msg, NL80211_ATTR_WDEV, bss->wdev_id); in nl80211_set_iface_id()
561 return nla_put_u32(msg, NL80211_ATTR_IFINDEX, bss->ifindex); in nl80211_set_iface_id()
565 struct nl_msg * nl80211_cmd_msg(struct i802_bss *bss, int flags, uint8_t cmd) in nl80211_cmd_msg() argument
573 if (!nl80211_cmd(bss->drv, msg, flags, cmd) || in nl80211_cmd_msg()
574 nl80211_set_iface_id(msg, bss) < 0) { in nl80211_cmd_msg()
610 struct nl_msg * nl80211_bss_msg(struct i802_bss *bss, int flags, uint8_t cmd) in nl80211_bss_msg() argument
612 return nl80211_ifindex_msg(bss->drv, bss->ifindex, flags, cmd); in nl80211_bss_msg()
646 int nl80211_get_wiphy_index(struct i802_bss *bss) in nl80211_get_wiphy_index() argument
654 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_GET_INTERFACE))) in nl80211_get_wiphy_index()
657 if (send_and_recv_msgs(bss->drv, msg, netdev_info_handler, &data) == 0) in nl80211_get_wiphy_index()
663 static enum nl80211_iftype nl80211_get_ifmode(struct i802_bss *bss) in nl80211_get_ifmode() argument
671 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_GET_INTERFACE))) in nl80211_get_ifmode()
674 if (send_and_recv_msgs(bss->drv, msg, netdev_info_handler, &data) == 0) in nl80211_get_ifmode()
680 static int nl80211_get_macaddr(struct i802_bss *bss) in nl80211_get_macaddr() argument
684 .macaddr = bss->addr, in nl80211_get_macaddr()
687 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_GET_INTERFACE))) in nl80211_get_macaddr()
690 return send_and_recv_msgs(bss->drv, msg, netdev_info_handler, &data); in nl80211_get_macaddr()
768 nl80211_get_wiphy_data_ap(struct i802_bss *bss) in nl80211_get_wiphy_data_ap() argument
776 if (bss->wiphy_data != NULL) in nl80211_get_wiphy_data_ap()
777 return bss->wiphy_data; in nl80211_get_wiphy_data_ap()
779 wiphy_idx = nl80211_get_wiphy_index(bss); in nl80211_get_wiphy_data_ap()
795 if (ieee80211_freq_to_chan(bss->freq, &channel) != in nl80211_get_wiphy_data_ap()
807 w->nl_beacons = nl_create_handle(bss->drv->global->nl_cb, in nl80211_get_wiphy_data_ap()
814 if (nl80211_register_beacons(bss->drv, w)) { in nl80211_get_wiphy_data_ap()
829 if (tmp_bss->drv == bss->drv) { in nl80211_get_wiphy_data_ap()
836 dl_list_add(&w->drvs, &bss->drv->wiphy_list); in nl80211_get_wiphy_data_ap()
838 dl_list_add(&w->bsss, &bss->wiphy_list); in nl80211_get_wiphy_data_ap()
839 bss->wiphy_data = w; in nl80211_get_wiphy_data_ap()
844 static void nl80211_put_wiphy_data_ap(struct i802_bss *bss) in nl80211_put_wiphy_data_ap() argument
846 struct nl80211_wiphy_data *w = bss->wiphy_data; in nl80211_put_wiphy_data_ap()
852 bss->wiphy_data = NULL; in nl80211_put_wiphy_data_ap()
853 dl_list_del(&bss->wiphy_list); in nl80211_put_wiphy_data_ap()
857 if (tmp_bss->drv == bss->drv) { in nl80211_put_wiphy_data_ap()
864 dl_list_del(&bss->drv->wiphy_list); in nl80211_put_wiphy_data_ap()
880 struct i802_bss *bss = priv; in nl80211_get_ifindex() local
881 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_get_ifindex()
889 struct i802_bss *bss = priv; in wpa_driver_nl80211_get_bssid() local
890 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_get_bssid()
900 struct i802_bss *bss = priv; in wpa_driver_nl80211_get_ssid() local
901 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_get_ssid()
1047 struct i802_bss *bss; in nl80211_refresh_mac() local
1050 bss = get_bss_ifindex(drv, ifindex); in nl80211_refresh_mac()
1051 if (bss && in nl80211_refresh_mac()
1053 bss->ifname, addr) < 0) { in nl80211_refresh_mac()
1056 bss->ifname); in nl80211_refresh_mac()
1057 } else if (bss && os_memcmp(addr, bss->addr, ETH_ALEN) != 0) { in nl80211_refresh_mac()
1061 ifindex, bss->ifname, in nl80211_refresh_mac()
1062 MAC2STR(bss->addr), MAC2STR(addr)); in nl80211_refresh_mac()
1063 os_memcpy(bss->addr, addr, ETH_ALEN); in nl80211_refresh_mac()
1225 struct i802_bss *bss; in wpa_driver_nl80211_event_rtm_newlink() local
1238 for (bss = drv->first_bss; bss; bss = bss->next) { in wpa_driver_nl80211_event_rtm_newlink()
1239 if (os_strcmp(ifname, bss->ifname) == 0) { in wpa_driver_nl80211_event_rtm_newlink()
1240 os_strlcpy(bss->brname, namebuf, IFNAMSIZ); in wpa_driver_nl80211_event_rtm_newlink()
1337 struct nlattr *bss[NL80211_BSS_MAX + 1]; in nl80211_get_assoc_freq_handler() local
1350 nla_parse_nested(bss, NL80211_BSS_MAX, tb[NL80211_ATTR_BSS], in nl80211_get_assoc_freq_handler()
1352 !bss[NL80211_BSS_STATUS]) in nl80211_get_assoc_freq_handler()
1355 status = nla_get_u32(bss[NL80211_BSS_STATUS]); in nl80211_get_assoc_freq_handler()
1357 bss[NL80211_BSS_FREQUENCY]) { in nl80211_get_assoc_freq_handler()
1358 ctx->assoc_freq = nla_get_u32(bss[NL80211_BSS_FREQUENCY]); in nl80211_get_assoc_freq_handler()
1363 bss[NL80211_BSS_FREQUENCY]) { in nl80211_get_assoc_freq_handler()
1364 ctx->ibss_freq = nla_get_u32(bss[NL80211_BSS_FREQUENCY]); in nl80211_get_assoc_freq_handler()
1369 bss[NL80211_BSS_BSSID]) { in nl80211_get_assoc_freq_handler()
1371 nla_data(bss[NL80211_BSS_BSSID]), ETH_ALEN); in nl80211_get_assoc_freq_handler()
1377 bss[NL80211_BSS_INFORMATION_ELEMENTS]) { in nl80211_get_assoc_freq_handler()
1381 ie = nla_data(bss[NL80211_BSS_INFORMATION_ELEMENTS]); in nl80211_get_assoc_freq_handler()
1382 ie_len = nla_len(bss[NL80211_BSS_INFORMATION_ELEMENTS]); in nl80211_get_assoc_freq_handler()
1659 struct i802_bss *bss = priv; in nl80211_channel_info() local
1660 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_channel_info()
1695 struct i802_bss *bss = priv; in wpa_driver_nl80211_set_country() local
1696 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_set_country()
1738 struct i802_bss *bss = priv; in wpa_driver_nl80211_get_country() local
1739 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_get_country()
1966 static int nl80211_init_connect_handle(struct i802_bss *bss) in nl80211_init_connect_handle() argument
1968 if (bss->nl_connect) { in nl80211_init_connect_handle()
1971 bss->nl_connect); in nl80211_init_connect_handle()
1975 bss->nl_connect = nl_create_handle(bss->nl_cb, "connect"); in nl80211_init_connect_handle()
1976 if (!bss->nl_connect) in nl80211_init_connect_handle()
1978 nl80211_register_eloop_read(&bss->nl_connect, in nl80211_init_connect_handle()
1980 bss->nl_cb, 1); in nl80211_init_connect_handle()
1985 static int nl80211_init_bss(struct i802_bss *bss) in nl80211_init_bss() argument
1987 bss->nl_cb = nl_cb_alloc(NL_CB_DEFAULT); in nl80211_init_bss()
1988 if (!bss->nl_cb) in nl80211_init_bss()
1991 nl_cb_set(bss->nl_cb, NL_CB_SEQ_CHECK, NL_CB_CUSTOM, in nl80211_init_bss()
1993 nl_cb_set(bss->nl_cb, NL_CB_VALID, NL_CB_CUSTOM, in nl80211_init_bss()
1994 process_bss_event, bss); in nl80211_init_bss()
1996 nl80211_init_connect_handle(bss); in nl80211_init_bss()
2002 static void nl80211_destroy_bss(struct i802_bss *bss) in nl80211_destroy_bss() argument
2004 nl_cb_put(bss->nl_cb); in nl80211_destroy_bss()
2005 bss->nl_cb = NULL; in nl80211_destroy_bss()
2007 if (bss->nl_connect) in nl80211_destroy_bss()
2008 nl80211_destroy_eloop_handle(&bss->nl_connect, 1); in nl80211_destroy_bss()
2071 struct i802_bss *bss; in wpa_driver_nl80211_drv_init() local
2098 bss = drv->first_bss; in wpa_driver_nl80211_drv_init()
2099 bss->drv = drv; in wpa_driver_nl80211_drv_init()
2100 bss->ctx = ctx; in wpa_driver_nl80211_drv_init()
2102 os_strlcpy(bss->ifname, ifname, sizeof(bss->ifname)); in wpa_driver_nl80211_drv_init()
2108 if (nl80211_init_bss(bss)) in wpa_driver_nl80211_drv_init()
2142 return bss; in wpa_driver_nl80211_drv_init()
2145 wpa_driver_nl80211_deinit(bss); in wpa_driver_nl80211_drv_init()
2166 static int nl80211_register_frame(struct i802_bss *bss, in nl80211_register_frame() argument
2171 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_register_frame()
2182 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_REGISTER_FRAME)) || in nl80211_register_frame()
2202 static int nl80211_alloc_mgmt_handle(struct i802_bss *bss) in nl80211_alloc_mgmt_handle() argument
2204 if (bss->nl_mgmt) { in nl80211_alloc_mgmt_handle()
2206 "already on! (nl_mgmt=%p)", bss->nl_mgmt); in nl80211_alloc_mgmt_handle()
2210 bss->nl_mgmt = nl_create_handle(bss->nl_cb, "mgmt"); in nl80211_alloc_mgmt_handle()
2211 if (bss->nl_mgmt == NULL) in nl80211_alloc_mgmt_handle()
2218 static void nl80211_mgmt_handle_register_eloop(struct i802_bss *bss) in nl80211_mgmt_handle_register_eloop() argument
2220 nl80211_register_eloop_read(&bss->nl_mgmt, in nl80211_mgmt_handle_register_eloop()
2222 bss->nl_cb, 0); in nl80211_mgmt_handle_register_eloop()
2226 static int nl80211_register_action_frame(struct i802_bss *bss, in nl80211_register_action_frame() argument
2230 return nl80211_register_frame(bss, bss->nl_mgmt, in nl80211_register_action_frame()
2235 static int nl80211_mgmt_subscribe_non_ap(struct i802_bss *bss) in nl80211_mgmt_subscribe_non_ap() argument
2237 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_mgmt_subscribe_non_ap()
2241 if (nl80211_alloc_mgmt_handle(bss)) in nl80211_mgmt_subscribe_non_ap()
2244 "handle %p", bss->nl_mgmt); in nl80211_mgmt_subscribe_non_ap()
2248 nl80211_register_frame(bss, bss->nl_mgmt, type, NULL, 0, false); in nl80211_mgmt_subscribe_non_ap()
2252 nl80211_register_frame(bss, bss->nl_mgmt, type, in nl80211_mgmt_subscribe_non_ap()
2258 if (nl80211_register_action_frame(bss, (u8 *) "\x01\x04", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2263 if (nl80211_register_action_frame(bss, (u8 *) "\x04\x0a", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2266 if (nl80211_register_action_frame(bss, (u8 *) "\x04\x0b", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2269 if (nl80211_register_action_frame(bss, (u8 *) "\x04\x0c", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2272 if (nl80211_register_action_frame(bss, (u8 *) "\x04\x0d", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2275 if (nl80211_register_action_frame(bss, (u8 *) "\x09\x0a", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2278 if (nl80211_register_action_frame(bss, (u8 *) "\x09\x0b", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2281 if (nl80211_register_action_frame(bss, (u8 *) "\x09\x0c", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2284 if (nl80211_register_action_frame(bss, (u8 *) "\x09\x0d", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2289 if (nl80211_register_action_frame(bss, in nl80211_mgmt_subscribe_non_ap()
2294 if (nl80211_register_action_frame(bss, in nl80211_mgmt_subscribe_non_ap()
2301 if (nl80211_register_action_frame(bss, in nl80211_mgmt_subscribe_non_ap()
2308 if (nl80211_register_action_frame(bss, (u8 *) "\x08\x00", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2312 if (nl80211_register_action_frame(bss, (u8 *) "\x08\x01", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2317 if (nl80211_register_action_frame(bss, (u8 *) "\x04\x0e", 2) < in nl80211_mgmt_subscribe_non_ap()
2324 if (nl80211_register_action_frame(bss, (u8 *) "\x12", 1) < 0) in nl80211_mgmt_subscribe_non_ap()
2329 if (nl80211_register_action_frame(bss, (u8 *) "\x06", 1) < 0) in nl80211_mgmt_subscribe_non_ap()
2345 if (nl80211_register_action_frame(bss, (u8 *) "\x0a\x07", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2348 if (nl80211_register_action_frame(bss, (u8 *) "\x0a\x11", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2352 if (nl80211_register_action_frame(bss, (u8 *) "\x0a\x0b", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2358 if (nl80211_register_action_frame(bss, (u8 *) "\x0a\x1a", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2363 if (nl80211_register_action_frame(bss, (u8 *) "\x11\x01", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2367 if (nl80211_register_action_frame(bss, (u8 *) "\x11\x02", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2371 if (nl80211_register_action_frame(bss, (u8 *) "\x05\x05", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2375 if (nl80211_register_action_frame(bss, (u8 *) "\x05\x00", 2) < 0) in nl80211_mgmt_subscribe_non_ap()
2380 (nl80211_register_action_frame(bss, (u8 *) "\x05\x02", 2) < 0)) in nl80211_mgmt_subscribe_non_ap()
2383 nl80211_mgmt_handle_register_eloop(bss); in nl80211_mgmt_subscribe_non_ap()
2389 static int nl80211_mgmt_subscribe_mesh(struct i802_bss *bss) in nl80211_mgmt_subscribe_mesh() argument
2393 if (nl80211_alloc_mgmt_handle(bss)) in nl80211_mgmt_subscribe_mesh()
2398 bss->nl_mgmt); in nl80211_mgmt_subscribe_mesh()
2401 if (nl80211_register_frame(bss, bss->nl_mgmt, in nl80211_mgmt_subscribe_mesh()
2408 if (nl80211_register_action_frame(bss, (u8 *) "\x0f\x01", 2) < 0) in nl80211_mgmt_subscribe_mesh()
2411 if (nl80211_register_action_frame(bss, (u8 *) "\x0f\x02", 2) < 0) in nl80211_mgmt_subscribe_mesh()
2414 if (nl80211_register_action_frame(bss, (u8 *) "\x0f\x03", 2) < 0) in nl80211_mgmt_subscribe_mesh()
2417 nl80211_mgmt_handle_register_eloop(bss); in nl80211_mgmt_subscribe_mesh()
2423 static int nl80211_register_spurious_class3(struct i802_bss *bss) in nl80211_register_spurious_class3() argument
2428 msg = nl80211_bss_msg(bss, 0, NL80211_CMD_UNEXPECTED_FRAME); in nl80211_register_spurious_class3()
2429 ret = send_and_recv(bss->drv->global, bss->nl_mgmt, msg, NULL, NULL); in nl80211_register_spurious_class3()
2439 static int nl80211_action_subscribe_ap(struct i802_bss *bss) in nl80211_action_subscribe_ap() argument
2444 if (nl80211_register_action_frame(bss, (u8 *) "\x04", 1) < 0) in nl80211_action_subscribe_ap()
2447 if (nl80211_register_action_frame(bss, (u8 *) "\x05\x01", 2) < 0) in nl80211_action_subscribe_ap()
2450 if (nl80211_register_action_frame(bss, (u8 *) "\x05\x03", 2) < 0) in nl80211_action_subscribe_ap()
2453 if (nl80211_register_action_frame(bss, (u8 *) "\x05\x04", 2) < 0) in nl80211_action_subscribe_ap()
2456 if (nl80211_register_action_frame(bss, (u8 *) "\x06", 1) < 0) in nl80211_action_subscribe_ap()
2459 if (nl80211_register_action_frame(bss, (u8 *) "\x08", 1) < 0) in nl80211_action_subscribe_ap()
2462 if (nl80211_register_action_frame(bss, (u8 *) "\x09", 1) < 0) in nl80211_action_subscribe_ap()
2465 if (nl80211_register_action_frame(bss, (u8 *) "\x0a", 1) < 0) in nl80211_action_subscribe_ap()
2468 if (nl80211_register_action_frame(bss, (u8 *) "\x11", 1) < 0) in nl80211_action_subscribe_ap()
2472 if (nl80211_register_action_frame(bss, (u8 *) "\x12", 1) < 0) in nl80211_action_subscribe_ap()
2476 if (nl80211_register_action_frame(bss, (u8 *) "\x7f", 1) < 0) in nl80211_action_subscribe_ap()
2483 static int nl80211_mgmt_subscribe_ap(struct i802_bss *bss) in nl80211_mgmt_subscribe_ap() argument
2501 if (nl80211_alloc_mgmt_handle(bss)) in nl80211_mgmt_subscribe_ap()
2504 "handle %p", bss->nl_mgmt); in nl80211_mgmt_subscribe_ap()
2507 if (nl80211_register_frame(bss, bss->nl_mgmt, in nl80211_mgmt_subscribe_ap()
2515 if (nl80211_action_subscribe_ap(bss)) in nl80211_mgmt_subscribe_ap()
2518 if (nl80211_register_spurious_class3(bss)) in nl80211_mgmt_subscribe_ap()
2521 nl80211_mgmt_handle_register_eloop(bss); in nl80211_mgmt_subscribe_ap()
2525 nl_destroy_handles(&bss->nl_mgmt); in nl80211_mgmt_subscribe_ap()
2530 static int nl80211_mgmt_subscribe_ap_dev_sme(struct i802_bss *bss) in nl80211_mgmt_subscribe_ap_dev_sme() argument
2532 if (nl80211_alloc_mgmt_handle(bss)) in nl80211_mgmt_subscribe_ap_dev_sme()
2535 "handle %p (device SME)", bss->nl_mgmt); in nl80211_mgmt_subscribe_ap_dev_sme()
2537 if (nl80211_action_subscribe_ap(bss)) in nl80211_mgmt_subscribe_ap_dev_sme()
2540 if (bss->drv->device_ap_sme) { in nl80211_mgmt_subscribe_ap_dev_sme()
2544 if (nl80211_register_frame(bss, bss->nl_mgmt, type, NULL, 0, in nl80211_mgmt_subscribe_ap_dev_sme()
2550 nl80211_mgmt_handle_register_eloop(bss); in nl80211_mgmt_subscribe_ap_dev_sme()
2554 nl_destroy_handles(&bss->nl_mgmt); in nl80211_mgmt_subscribe_ap_dev_sme()
2559 static void nl80211_mgmt_unsubscribe(struct i802_bss *bss, const char *reason) in nl80211_mgmt_unsubscribe() argument
2561 if (bss->nl_mgmt == NULL) in nl80211_mgmt_unsubscribe()
2564 "(%s)", bss->nl_mgmt, reason); in nl80211_mgmt_unsubscribe()
2565 nl80211_destroy_eloop_handle(&bss->nl_mgmt, 0); in nl80211_mgmt_unsubscribe()
2567 nl80211_put_wiphy_data_ap(bss); in nl80211_mgmt_unsubscribe()
2577 static void nl80211_del_p2pdev(struct i802_bss *bss) in nl80211_del_p2pdev() argument
2582 msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_DEL_INTERFACE); in nl80211_del_p2pdev()
2583 ret = send_and_recv_msgs(bss->drv, msg, NULL, NULL); in nl80211_del_p2pdev()
2586 bss->ifname, (long long unsigned int) bss->wdev_id, in nl80211_del_p2pdev()
2591 static int nl80211_set_p2pdev(struct i802_bss *bss, int start) in nl80211_set_p2pdev() argument
2596 msg = nl80211_cmd_msg(bss, 0, start ? NL80211_CMD_START_P2P_DEVICE : in nl80211_set_p2pdev()
2598 ret = send_and_recv_msgs(bss->drv, msg, NULL, NULL); in nl80211_set_p2pdev()
2602 bss->ifname, (long long unsigned int) bss->wdev_id, in nl80211_set_p2pdev()
2608 static int i802_set_iface_flags(struct i802_bss *bss, int up) in i802_set_iface_flags() argument
2612 nlmode = nl80211_get_ifmode(bss); in i802_set_iface_flags()
2614 return linux_set_iface_flags(bss->drv->global->ioctl_sock, in i802_set_iface_flags()
2615 bss->ifname, up); in i802_set_iface_flags()
2619 return nl80211_set_p2pdev(bss, up); in i802_set_iface_flags()
2682 struct i802_bss *bss = drv->first_bss; in wpa_driver_nl80211_finish_drv_init() local
2686 drv->ifindex = if_nametoindex(bss->ifname); in wpa_driver_nl80211_finish_drv_init()
2687 bss->ifindex = drv->ifindex; in wpa_driver_nl80211_finish_drv_init()
2688 bss->wdev_id = drv->global->if_add_wdevid; in wpa_driver_nl80211_finish_drv_init()
2689 bss->wdev_id_set = drv->global->if_add_wdevid_set; in wpa_driver_nl80211_finish_drv_init()
2691 bss->if_dynamic = drv->ifindex == drv->global->if_add_ifindex; in wpa_driver_nl80211_finish_drv_init()
2692 bss->if_dynamic = bss->if_dynamic || drv->global->if_add_wdevid_set; in wpa_driver_nl80211_finish_drv_init()
2695 if (!bss->if_dynamic && nl80211_get_ifmode(bss) == NL80211_IFTYPE_AP) in wpa_driver_nl80211_finish_drv_init()
2696 bss->static_ap = 1; in wpa_driver_nl80211_finish_drv_init()
2699 nl80211_get_ifmode(bss) != NL80211_IFTYPE_P2P_DEVICE && in wpa_driver_nl80211_finish_drv_init()
2700 linux_iface_up(drv->global->ioctl_sock, bss->ifname) > 0) in wpa_driver_nl80211_finish_drv_init()
2706 if (driver_params && nl80211_set_param(bss, driver_params) < 0) in wpa_driver_nl80211_finish_drv_init()
2710 bss->ifname, drv->phyname); in wpa_driver_nl80211_finish_drv_init()
2713 (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 0) || in wpa_driver_nl80211_finish_drv_init()
2714 linux_set_ifhwaddr(drv->global->ioctl_sock, bss->ifname, in wpa_driver_nl80211_finish_drv_init()
2718 if (first && nl80211_get_ifmode(bss) == NL80211_IFTYPE_AP) in wpa_driver_nl80211_finish_drv_init()
2721 if (drv->hostapd || bss->static_ap) in wpa_driver_nl80211_finish_drv_init()
2723 else if (bss->if_dynamic || in wpa_driver_nl80211_finish_drv_init()
2724 nl80211_get_ifmode(bss) == NL80211_IFTYPE_MESH_POINT) in wpa_driver_nl80211_finish_drv_init()
2725 nlmode = nl80211_get_ifmode(bss); in wpa_driver_nl80211_finish_drv_init()
2729 if (wpa_driver_nl80211_set_mode(bss, nlmode) < 0) { in wpa_driver_nl80211_finish_drv_init()
2735 nl80211_get_macaddr(bss); in wpa_driver_nl80211_finish_drv_init()
2740 int ret = i802_set_iface_flags(bss, 1); in wpa_driver_nl80211_finish_drv_init()
2743 "interface '%s' UP", bss->ifname); in wpa_driver_nl80211_finish_drv_init()
2748 nl80211_disable_11b_rates(bss->drv, in wpa_driver_nl80211_finish_drv_init()
2749 bss->drv->ifindex, 1); in wpa_driver_nl80211_finish_drv_init()
2755 "interface '%s' due to rfkill", bss->ifname); in wpa_driver_nl80211_finish_drv_init()
2767 if (linux_get_ifhwaddr(drv->global->ioctl_sock, bss->ifname, in wpa_driver_nl80211_finish_drv_init()
2768 bss->addr)) in wpa_driver_nl80211_finish_drv_init()
2770 os_memcpy(drv->perm_addr, bss->addr, ETH_ALEN); in wpa_driver_nl80211_finish_drv_init()
2785 static int wpa_driver_nl80211_del_beacon(struct i802_bss *bss) in wpa_driver_nl80211_del_beacon() argument
2788 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_del_beacon()
2792 nl80211_put_wiphy_data_ap(bss); in wpa_driver_nl80211_del_beacon()
2805 static void wpa_driver_nl80211_deinit(struct i802_bss *bss) in wpa_driver_nl80211_deinit() argument
2807 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_deinit()
2811 bss->ifname, drv->disabled_11b_rates); in wpa_driver_nl80211_deinit()
2813 bss->in_deinit = 1; in wpa_driver_nl80211_deinit()
2819 if (bss->nl_preq) in wpa_driver_nl80211_deinit()
2820 wpa_driver_nl80211_probe_req_report(bss, 0); in wpa_driver_nl80211_deinit()
2821 if (bss->added_if_into_bridge) { in wpa_driver_nl80211_deinit()
2822 if (linux_br_del_if(drv->global->ioctl_sock, bss->brname, in wpa_driver_nl80211_deinit()
2823 bss->ifname) < 0) in wpa_driver_nl80211_deinit()
2826 bss->ifname, bss->brname, strerror(errno)); in wpa_driver_nl80211_deinit()
2832 if (bss->added_bridge) { in wpa_driver_nl80211_deinit()
2833 if (linux_set_iface_flags(drv->global->ioctl_sock, bss->brname, in wpa_driver_nl80211_deinit()
2837 bss->brname); in wpa_driver_nl80211_deinit()
2838 if (linux_br_del(drv->global->ioctl_sock, bss->brname) < 0) in wpa_driver_nl80211_deinit()
2841 bss->brname, strerror(errno)); in wpa_driver_nl80211_deinit()
2847 wpa_driver_nl80211_del_beacon(bss); in wpa_driver_nl80211_deinit()
2868 (void) i802_set_iface_flags(bss, 0); in wpa_driver_nl80211_deinit()
2871 if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, in wpa_driver_nl80211_deinit()
2876 if (linux_set_ifhwaddr(drv->global->ioctl_sock, bss->ifname, in wpa_driver_nl80211_deinit()
2885 wpa_driver_nl80211_set_mode(bss, in wpa_driver_nl80211_deinit()
2887 nl80211_mgmt_unsubscribe(bss, "deinit"); in wpa_driver_nl80211_deinit()
2889 nl80211_mgmt_unsubscribe(bss, "deinit"); in wpa_driver_nl80211_deinit()
2890 nl80211_del_p2pdev(bss); in wpa_driver_nl80211_deinit()
3106 static int wpa_driver_nl80211_set_key(struct i802_bss *bss, in wpa_driver_nl80211_set_key() argument
3109 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_set_key()
3482 static int wpa_driver_nl80211_deauthenticate(struct i802_bss *bss, in wpa_driver_nl80211_deauthenticate() argument
3485 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_deauthenticate()
3495 get_connect_handle(bss)); in wpa_driver_nl80211_deauthenticate()
3501 reason_code, 0, get_connect_handle(bss)); in wpa_driver_nl80211_deauthenticate()
3558 static void nl80211_unmask_11b_rates(struct i802_bss *bss) in nl80211_unmask_11b_rates() argument
3560 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_unmask_11b_rates()
3572 bss->ifname); in nl80211_unmask_11b_rates()
3599 struct i802_bss *bss, struct wpa_driver_auth_params *params) in wpa_driver_nl80211_authenticate() argument
3601 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_authenticate()
3610 nl80211_unmask_11b_rates(bss); in wpa_driver_nl80211_authenticate()
3626 wpa_driver_nl80211_set_mode(bss, nlmode) < 0) in wpa_driver_nl80211_authenticate()
3638 p.ifname = bss->ifname; in wpa_driver_nl80211_authenticate()
3650 wpa_driver_nl80211_set_key(bss, &p); in wpa_driver_nl80211_authenticate()
3716 bss, params->bssid, in wpa_driver_nl80211_authenticate()
3744 ret = wpa_driver_nl80211_scan(bss, &scan); in wpa_driver_nl80211_authenticate()
3777 struct i802_bss *bss = drv->first_bss; in wpa_driver_nl80211_authenticate_retry() local
3808 return wpa_driver_nl80211_authenticate(bss, ¶ms); in wpa_driver_nl80211_authenticate_retry()
3812 static int wpa_driver_nl80211_send_mlme(struct i802_bss *bss, const u8 *data, in wpa_driver_nl80211_send_mlme() argument
3820 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_send_mlme()
3858 bss->freq); in wpa_driver_nl80211_send_mlme()
3859 freq = bss->freq; in wpa_driver_nl80211_send_mlme()
3861 if ((int) freq == bss->freq) in wpa_driver_nl80211_send_mlme()
3899 bss->freq); in wpa_driver_nl80211_send_mlme()
3900 freq = bss->freq; in wpa_driver_nl80211_send_mlme()
3906 freq, bss->freq); in wpa_driver_nl80211_send_mlme()
3929 res = nl80211_send_frame_cmd(bss, freq, wait_time, data, data_len, in wpa_driver_nl80211_send_mlme()
3953 static int nl80211_set_bss(struct i802_bss *bss, int cts, int preamble, in nl80211_set_bss() argument
3957 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_bss()
3960 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_BSS)) || in nl80211_set_bss()
3983 struct i802_bss *bss = priv; in wpa_driver_nl80211_set_acl() local
3984 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_set_acl()
4057 struct i802_bss *bss = priv; in nl80211_set_mesh_config() local
4058 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_mesh_config()
4179 static int nl80211_set_multicast_to_unicast(struct i802_bss *bss, in nl80211_set_multicast_to_unicast() argument
4182 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_multicast_to_unicast()
4186 msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_MULTICAST_TO_UNICAST); in nl80211_set_multicast_to_unicast()
4192 bss->ifname); in nl80211_set_multicast_to_unicast()
4204 bss->ifname); in nl80211_set_multicast_to_unicast()
4211 bss->ifname); in nl80211_set_multicast_to_unicast()
4217 ret, strerror(-ret), bss->ifname); in nl80211_set_multicast_to_unicast()
4228 struct i802_bss *bss = priv; in wpa_driver_nl80211_set_ap() local
4229 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_set_ap()
4241 beacon_set = params->reenable ? 0 : bss->beacon_set; in wpa_driver_nl80211_set_ap()
4248 !nl80211_get_wiphy_data_ap(bss)) in wpa_driver_nl80211_set_ap()
4255 wpa_printf(MSG_DEBUG, "nl80211: ifindex=%d", bss->ifindex); in wpa_driver_nl80211_set_ap()
4262 if (!(msg = nl80211_bss_msg(bss, 0, cmd)) || in wpa_driver_nl80211_set_ap()
4485 ret = send_and_recv_msgs_owner(drv, msg, get_connect_handle(bss), 1, in wpa_driver_nl80211_set_ap()
4491 bss->beacon_set = 1; in wpa_driver_nl80211_set_ap()
4492 nl80211_set_bss(bss, params->cts_protect, params->preamble, in wpa_driver_nl80211_set_ap()
4495 nl80211_set_multicast_to_unicast(bss, in wpa_driver_nl80211_set_ap()
4498 params->freq->bandwidth != bss->bandwidth) { in wpa_driver_nl80211_set_ap()
4501 bss->ifname, bss->bandwidth, in wpa_driver_nl80211_set_ap()
4503 ret = nl80211_set_channel(bss, params->freq, 1); in wpa_driver_nl80211_set_ap()
4511 bss->bandwidth = params->freq->bandwidth; in wpa_driver_nl80211_set_ap()
4519 bss->bandwidth = params->freq->bandwidth; in wpa_driver_nl80211_set_ap()
4636 static int nl80211_set_channel(struct i802_bss *bss, in nl80211_set_channel() argument
4639 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_channel()
4657 bss->freq = freq->freq; in nl80211_set_channel()
4719 struct i802_bss *bss = priv; in wpa_driver_nl80211_sta_add() local
4720 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_sta_add()
4731 msg = nl80211_bss_msg(bss, 0, params->set ? NL80211_CMD_SET_STATION : in wpa_driver_nl80211_sta_add()
4947 static void rtnl_neigh_delete_fdb_entry(struct i802_bss *bss, const u8 *addr) in rtnl_neigh_delete_fdb_entry() argument
4950 struct wpa_driver_nl80211_data *drv = bss->drv; in rtnl_neigh_delete_fdb_entry()
4960 rtnl_neigh_set_ifindex(rn, bss->ifindex); in rtnl_neigh_delete_fdb_entry()
4972 bss->ifindex, nl_geterror(err)); in rtnl_neigh_delete_fdb_entry()
4984 static int wpa_driver_nl80211_sta_remove(struct i802_bss *bss, const u8 *addr, in wpa_driver_nl80211_sta_remove() argument
4987 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_sta_remove()
4991 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_STATION)) || in wpa_driver_nl80211_sta_remove()
5008 bss->ifname, MAC2STR(addr), ret, strerror(-ret)); in wpa_driver_nl80211_sta_remove()
5011 rtnl_neigh_delete_fdb_entry(bss, addr); in wpa_driver_nl80211_sta_remove()
5207 static int nl80211_setup_ap(struct i802_bss *bss) in nl80211_setup_ap() argument
5209 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_setup_ap()
5212 bss->ifname, drv->device_ap_sme, drv->use_monitor); in nl80211_setup_ap()
5220 wpa_driver_nl80211_probe_req_report(bss, 0); in nl80211_setup_ap()
5223 if (nl80211_mgmt_subscribe_ap(bss)) in nl80211_setup_ap()
5227 if (nl80211_mgmt_subscribe_ap_dev_sme(bss)) in nl80211_setup_ap()
5237 wpa_driver_nl80211_probe_req_report(bss, 1) < 0) { in nl80211_setup_ap()
5247 static void nl80211_teardown_ap(struct i802_bss *bss) in nl80211_teardown_ap() argument
5249 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_teardown_ap()
5252 bss->ifname, drv->device_ap_sme, drv->use_monitor); in nl80211_teardown_ap()
5254 wpa_driver_nl80211_probe_req_report(bss, 0); in nl80211_teardown_ap()
5256 nl80211_mgmt_unsubscribe(bss, "AP teardown (dev SME)"); in nl80211_teardown_ap()
5260 nl80211_mgmt_unsubscribe(bss, "AP teardown"); in nl80211_teardown_ap()
5262 nl80211_put_wiphy_data_ap(bss); in nl80211_teardown_ap()
5263 bss->beacon_set = 0; in nl80211_teardown_ap()
5271 struct i802_bss *bss = priv; in nl80211_tx_control_port() local
5280 msg = nl80211_bss_msg(bss, 0, NL80211_CMD_CONTROL_PORT_FRAME); in nl80211_tx_control_port()
5291 ret = send_and_recv_msgs(bss->drv, msg, NULL, NULL); in nl80211_tx_control_port()
5301 static int nl80211_send_eapol_data(struct i802_bss *bss, in nl80211_send_eapol_data() argument
5308 if (bss->drv->eapol_tx_sock < 0) { in nl80211_send_eapol_data()
5315 ll.sll_ifindex = bss->ifindex; in nl80211_send_eapol_data()
5319 ret = sendto(bss->drv->eapol_tx_sock, data, data_len, 0, in nl80211_send_eapol_data()
5335 struct i802_bss *bss = priv; in wpa_driver_nl80211_hapd_send_eapol() local
5336 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_hapd_send_eapol()
5347 return nl80211_tx_control_port(bss, addr, ETH_P_EAPOL, in wpa_driver_nl80211_hapd_send_eapol()
5351 return nl80211_send_eapol_data(bss, addr, data, data_len); in wpa_driver_nl80211_hapd_send_eapol()
5407 struct i802_bss *bss = priv; in wpa_driver_nl80211_sta_set_flags() local
5414 bss->ifname, MAC2STR(addr), total_flags, flags_or, flags_and, in wpa_driver_nl80211_sta_set_flags()
5417 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_STATION)) || in wpa_driver_nl80211_sta_set_flags()
5447 return send_and_recv_msgs(bss->drv, msg, NULL, NULL); in wpa_driver_nl80211_sta_set_flags()
5457 struct i802_bss *bss = priv; in driver_nl80211_sta_set_airtime_weight() local
5462 " weight=%u", bss->ifname, MAC2STR(addr), weight); in driver_nl80211_sta_set_airtime_weight()
5464 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_STATION)) || in driver_nl80211_sta_set_airtime_weight()
5469 return send_and_recv_msgs(bss->drv, msg, NULL, NULL); in driver_nl80211_sta_set_airtime_weight()
6104 struct i802_bss *bss = priv; in wpa_driver_nl80211_associate() local
6105 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_associate()
6109 nl80211_unmask_11b_rates(bss); in wpa_driver_nl80211_associate()
6125 bss->use_nl_connect = 1; in wpa_driver_nl80211_associate()
6127 bss->use_nl_connect = 0; in wpa_driver_nl80211_associate()
6130 get_connect_handle(bss)); in wpa_driver_nl80211_associate()
6211 struct i802_bss *bss, in wpa_driver_nl80211_set_mode_impl() argument
6215 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_set_mode_impl()
6226 if (mode_switch_res && nlmode == nl80211_get_ifmode(bss)) in wpa_driver_nl80211_set_mode_impl()
6252 res = i802_set_iface_flags(bss, 0); in wpa_driver_nl80211_set_mode_impl()
6267 res = nl80211_set_channel(bss, desired_freq_params, 0); in wpa_driver_nl80211_set_mode_impl()
6275 bss->brname[0] && in wpa_driver_nl80211_set_mode_impl()
6276 (bss->added_if_into_bridge || bss->already_in_bridge)) { in wpa_driver_nl80211_set_mode_impl()
6279 bss->ifname, bss->brname); in wpa_driver_nl80211_set_mode_impl()
6281 bss->brname, bss->ifname) < 0) in wpa_driver_nl80211_set_mode_impl()
6284 bss->ifname, bss->brname, in wpa_driver_nl80211_set_mode_impl()
6308 res = linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1); in wpa_driver_nl80211_set_mode_impl()
6325 bss->ifname); in wpa_driver_nl80211_set_mode_impl()
6330 bss->ifname); in wpa_driver_nl80211_set_mode_impl()
6335 nl80211_mgmt_unsubscribe(bss, "start AP"); in wpa_driver_nl80211_set_mode_impl()
6337 if (nl80211_setup_ap(bss)) in wpa_driver_nl80211_set_mode_impl()
6341 nl80211_teardown_ap(bss); in wpa_driver_nl80211_set_mode_impl()
6343 nl80211_mgmt_unsubscribe(bss, "mode change"); in wpa_driver_nl80211_set_mode_impl()
6347 nl80211_mgmt_subscribe_mesh(bss)) in wpa_driver_nl80211_set_mode_impl()
6350 if (!bss->in_deinit && !is_ap_interface(nlmode) && in wpa_driver_nl80211_set_mode_impl()
6352 nl80211_mgmt_subscribe_non_ap(bss) < 0) in wpa_driver_nl80211_set_mode_impl()
6360 void nl80211_restore_ap_mode(struct i802_bss *bss) in nl80211_restore_ap_mode() argument
6362 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_restore_ap_mode()
6365 wpa_driver_nl80211_set_mode(bss, drv->ap_scan_as_station); in nl80211_restore_ap_mode()
6367 bss->brname[0] && in nl80211_restore_ap_mode()
6368 (bss->added_if_into_bridge || bss->already_in_bridge)) { in nl80211_restore_ap_mode()
6371 bss->ifname, bss->brname); in nl80211_restore_ap_mode()
6372 if (linux_br_add_if(drv->global->ioctl_sock, bss->brname, in nl80211_restore_ap_mode()
6373 bss->ifname) < 0) { in nl80211_restore_ap_mode()
6376 bss->ifname, bss->brname, strerror(errno)); in nl80211_restore_ap_mode()
6383 int wpa_driver_nl80211_set_mode(struct i802_bss *bss, in wpa_driver_nl80211_set_mode() argument
6386 return wpa_driver_nl80211_set_mode_impl(bss, nlmode, NULL); in wpa_driver_nl80211_set_mode()
6390 static int wpa_driver_nl80211_set_mode_ibss(struct i802_bss *bss, in wpa_driver_nl80211_set_mode_ibss() argument
6393 return wpa_driver_nl80211_set_mode_impl(bss, NL80211_IFTYPE_ADHOC, in wpa_driver_nl80211_set_mode_ibss()
6401 struct i802_bss *bss = priv; in wpa_driver_nl80211_get_capa() local
6402 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_get_capa()
6419 struct i802_bss *bss = priv; in wpa_driver_nl80211_set_operstate() local
6420 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_set_operstate()
6423 bss->ifname, drv->operstate, state, in wpa_driver_nl80211_set_operstate()
6433 struct i802_bss *bss = priv; in wpa_driver_nl80211_set_supp_port() local
6434 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_set_supp_port()
6452 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_STATION)) || in wpa_driver_nl80211_set_supp_port()
6471 struct i802_bss *bss = priv; in i802_set_freq() local
6472 return nl80211_set_channel(bss, freq, 0); in i802_set_freq()
6509 struct i802_bss *bss = priv; in i802_get_seqnum() local
6510 struct wpa_driver_nl80211_data *drv = bss->drv; in i802_get_seqnum()
6530 struct i802_bss *bss = priv; in i802_set_rts() local
6531 struct wpa_driver_nl80211_data *drv = bss->drv; in i802_set_rts()
6558 struct i802_bss *bss = priv; in i802_set_frag() local
6559 struct wpa_driver_nl80211_data *drv = bss->drv; in i802_set_frag()
6586 struct i802_bss *bss = priv; in i802_flush() local
6591 bss->ifname); in i802_flush()
6596 msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_STATION); in i802_flush()
6597 res = send_and_recv_msgs(bss->drv, msg, NULL, NULL); in i802_flush()
6794 static int i802_read_sta_data(struct i802_bss *bss, in i802_read_sta_data() argument
6800 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_GET_STATION)) || in i802_read_sta_data()
6806 return send_and_recv_msgs(bss->drv, msg, get_sta_handler, data); in i802_read_sta_data()
6813 struct i802_bss *bss = priv; in i802_set_tx_queue_params() local
6814 struct wpa_driver_nl80211_data *drv = bss->drv; in i802_set_tx_queue_params()
6819 msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_WIPHY); in i802_set_tx_queue_params()
6876 static int i802_set_sta_vlan(struct i802_bss *bss, const u8 *addr, in i802_set_sta_vlan() argument
6879 struct wpa_driver_nl80211_data *drv = bss->drv; in i802_set_sta_vlan()
6885 bss->ifname, if_nametoindex(bss->ifname), in i802_set_sta_vlan()
6887 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_STATION)) || in i802_set_sta_vlan()
6935 struct i802_bss *bss = priv; in i802_sta_deauth() local
6936 struct wpa_driver_nl80211_data *drv = bss->drv; in i802_sta_deauth()
6940 if (ieee80211_freq_to_chan(bss->freq, &channel) == in i802_sta_deauth()
6951 return wpa_driver_nl80211_sta_remove(bss, addr, 1, reason); in i802_sta_deauth()
6960 return wpa_driver_nl80211_send_mlme(bss, (u8 *) &mgmt, in i802_sta_deauth()
6970 struct i802_bss *bss = priv; in i802_sta_disassoc() local
6971 struct wpa_driver_nl80211_data *drv = bss->drv; in i802_sta_disassoc()
6978 return wpa_driver_nl80211_sta_remove(bss, addr, 0, reason); in i802_sta_disassoc()
6987 return wpa_driver_nl80211_send_mlme(bss, (u8 *) &mgmt, in i802_sta_disassoc()
7106 struct i802_bss *bss = priv; in i802_set_wds_sta() local
7107 struct wpa_driver_nl80211_data *drv = bss->drv; in i802_set_wds_sta()
7112 ret = os_snprintf(name, sizeof(name), "%s.sta%d", bss->ifname, aid); in i802_set_wds_sta()
7128 bss->addr, 1, NULL, NULL, 0) < in i802_set_wds_sta()
7140 wpa_supplicant_event(bss->ctx, in i802_set_wds_sta()
7157 i802_set_sta_vlan(priv, addr, bss->ifname, 0); in i802_set_wds_sta()
7163 wpa_supplicant_event(bss->ctx, EVENT_WDS_STA_INTERFACE_STATUS, in i802_set_wds_sta()
7192 struct i802_bss *bss, in i802_check_bridge() argument
7198 os_strlcpy(bss->brname, brname, IFNAMSIZ); in i802_check_bridge()
7211 bss->added_bridge = 1; in i802_check_bridge()
7215 bss->br_ifindex = br_ifindex; in i802_check_bridge()
7219 bss->already_in_bridge = 1; in i802_check_bridge()
7247 bss->added_if_into_bridge = 1; in i802_check_bridge()
7257 struct i802_bss *bss; in i802_init() local
7263 bss = wpa_driver_nl80211_drv_init(hapd, params->ifname, in i802_init()
7266 if (bss == NULL) in i802_init()
7269 drv = bss->drv; in i802_init()
7275 os_strlcpy(bss->brname, master_ifname, IFNAMSIZ); in i802_init()
7288 os_strlcpy(bss->brname, master_ifname, IFNAMSIZ); in i802_init()
7294 bss->br_ifindex = br_ifindex; in i802_init()
7310 if (i802_check_bridge(drv, bss, params->bridge[0], in i802_init()
7322 if (bss->added_if_into_bridge || bss->already_in_bridge) { in i802_init()
7360 if (linux_get_ifhwaddr(drv->global->ioctl_sock, bss->ifname, in i802_init()
7365 memcpy(bss->addr, params->own_addr, ETH_ALEN); in i802_init()
7367 return bss; in i802_init()
7370 wpa_driver_nl80211_deinit(bss); in i802_init()
7377 struct i802_bss *bss = priv; in i802_deinit() local
7378 wpa_driver_nl80211_deinit(bss); in i802_deinit()
7478 struct i802_bss *bss = priv; in wpa_driver_nl80211_if_add() local
7479 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_if_add()
7519 os_memcpy(if_addr, bss->addr, ETH_ALEN); in wpa_driver_nl80211_if_add()
7621 static int wpa_driver_nl80211_if_remove(struct i802_bss *bss, in wpa_driver_nl80211_if_remove() argument
7625 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_if_remove()
7629 __func__, type, ifname, ifindex, bss->added_if); in wpa_driver_nl80211_if_remove()
7630 if (ifindex > 0 && (bss->added_if || bss->ifindex != ifindex)) in wpa_driver_nl80211_if_remove()
7632 else if (ifindex > 0 && !bss->added_if) { in wpa_driver_nl80211_if_remove()
7644 if (bss->added_if_into_bridge) { in wpa_driver_nl80211_if_remove()
7645 if (linux_br_del_if(drv->global->ioctl_sock, bss->brname, in wpa_driver_nl80211_if_remove()
7646 bss->ifname) < 0) in wpa_driver_nl80211_if_remove()
7649 bss->ifname, bss->brname, strerror(errno)); in wpa_driver_nl80211_if_remove()
7651 if (bss->added_bridge) { in wpa_driver_nl80211_if_remove()
7652 if (linux_br_del(drv->global->ioctl_sock, bss->brname) < 0) in wpa_driver_nl80211_if_remove()
7655 bss->brname, strerror(errno)); in wpa_driver_nl80211_if_remove()
7658 if (bss != drv->first_bss) { in wpa_driver_nl80211_if_remove()
7663 if (tbss->next == bss) { in wpa_driver_nl80211_if_remove()
7664 tbss->next = bss->next; in wpa_driver_nl80211_if_remove()
7666 nl80211_teardown_ap(bss); in wpa_driver_nl80211_if_remove()
7667 nl80211_destroy_bss(bss); in wpa_driver_nl80211_if_remove()
7668 if (!bss->added_if) in wpa_driver_nl80211_if_remove()
7669 i802_set_iface_flags(bss, 0); in wpa_driver_nl80211_if_remove()
7670 os_free(bss); in wpa_driver_nl80211_if_remove()
7671 bss = NULL; in wpa_driver_nl80211_if_remove()
7675 if (bss) in wpa_driver_nl80211_if_remove()
7677 "BSS %p in the list", __func__, bss); in wpa_driver_nl80211_if_remove()
7680 nl80211_teardown_ap(bss); in wpa_driver_nl80211_if_remove()
7681 if (!bss->added_if && !drv->first_bss->next) in wpa_driver_nl80211_if_remove()
7682 wpa_driver_nl80211_del_beacon(bss); in wpa_driver_nl80211_if_remove()
7683 nl80211_destroy_bss(bss); in wpa_driver_nl80211_if_remove()
7684 if (!bss->added_if) in wpa_driver_nl80211_if_remove()
7685 i802_set_iface_flags(bss, 0); in wpa_driver_nl80211_if_remove()
7689 os_free(bss); in wpa_driver_nl80211_if_remove()
7712 static int nl80211_send_frame_cmd(struct i802_bss *bss, in nl80211_send_frame_cmd() argument
7719 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_send_frame_cmd()
7729 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_FRAME)) || in nl80211_send_frame_cmd()
7778 static int wpa_driver_nl80211_send_action(struct i802_bss *bss, in wpa_driver_nl80211_send_action() argument
7786 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_send_action()
7792 if (is_ap_interface(drv->nlmode) && (int) freq == bss->freq && in wpa_driver_nl80211_send_action()
7793 bss->beacon_set) in wpa_driver_nl80211_send_action()
7811 if (os_memcmp(bss->addr, src, ETH_ALEN) != 0) { in wpa_driver_nl80211_send_action()
7814 os_memcpy(bss->rand_addr, src, ETH_ALEN); in wpa_driver_nl80211_send_action()
7816 os_memset(bss->rand_addr, 0, ETH_ALEN); in wpa_driver_nl80211_send_action()
7821 (int) freq == bss->freq || drv->device_ap_sme || in wpa_driver_nl80211_send_action()
7823 ret = wpa_driver_nl80211_send_mlme(bss, buf, 24 + data_len, in wpa_driver_nl80211_send_action()
7827 ret = nl80211_send_frame_cmd(bss, freq, wait_time, buf, in wpa_driver_nl80211_send_action()
7836 static void nl80211_frame_wait_cancel(struct i802_bss *bss, u64 cookie) in nl80211_frame_wait_cancel() argument
7838 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_frame_wait_cancel()
7844 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_FRAME_WAIT_CANCEL)) || in nl80211_frame_wait_cancel()
7859 struct i802_bss *bss = priv; in wpa_driver_nl80211_send_action_cancel_wait() local
7860 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_send_action_cancel_wait()
7865 nl80211_frame_wait_cancel(bss, drv->send_frame_cookie); in wpa_driver_nl80211_send_action_cancel_wait()
7875 nl80211_frame_wait_cancel(bss, cookie); in wpa_driver_nl80211_send_action_cancel_wait()
7884 struct i802_bss *bss = priv; in wpa_driver_nl80211_remain_on_channel() local
7885 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_remain_on_channel()
7890 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_REMAIN_ON_CHANNEL)) || in wpa_driver_nl80211_remain_on_channel()
7916 struct i802_bss *bss = priv; in wpa_driver_nl80211_cancel_remain_on_channel() local
7917 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_cancel_remain_on_channel()
7931 msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL); in wpa_driver_nl80211_cancel_remain_on_channel()
7947 static int wpa_driver_nl80211_probe_req_report(struct i802_bss *bss, int report) in wpa_driver_nl80211_probe_req_report() argument
7949 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_probe_req_report()
7952 if (bss->nl_preq && drv->device_ap_sme && in wpa_driver_nl80211_probe_req_report()
7953 is_ap_interface(drv->nlmode) && !bss->in_deinit && in wpa_driver_nl80211_probe_req_report()
7954 !bss->static_ap) { in wpa_driver_nl80211_probe_req_report()
7961 "in AP mode", bss->nl_preq); in wpa_driver_nl80211_probe_req_report()
7962 } else if (bss->nl_preq) { in wpa_driver_nl80211_probe_req_report()
7964 "reporting nl_preq=%p", bss->nl_preq); in wpa_driver_nl80211_probe_req_report()
7965 nl80211_destroy_eloop_handle(&bss->nl_preq, 0); in wpa_driver_nl80211_probe_req_report()
7970 if (bss->nl_preq) { in wpa_driver_nl80211_probe_req_report()
7972 "already on! nl_preq=%p", bss->nl_preq); in wpa_driver_nl80211_probe_req_report()
7976 bss->nl_preq = nl_create_handle(drv->global->nl_cb, "preq"); in wpa_driver_nl80211_probe_req_report()
7977 if (bss->nl_preq == NULL) in wpa_driver_nl80211_probe_req_report()
7980 "reporting nl_preq=%p", bss->nl_preq); in wpa_driver_nl80211_probe_req_report()
7982 if (nl80211_register_frame(bss, bss->nl_preq, in wpa_driver_nl80211_probe_req_report()
7988 nl80211_register_eloop_read(&bss->nl_preq, in wpa_driver_nl80211_probe_req_report()
7990 bss->nl_cb, 0); in wpa_driver_nl80211_probe_req_report()
7995 nl_destroy_handles(&bss->nl_preq); in wpa_driver_nl80211_probe_req_report()
8052 struct i802_bss *bss = priv; in wpa_driver_nl80211_deinit_ap() local
8053 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_deinit_ap()
8056 wpa_driver_nl80211_del_beacon(bss); in wpa_driver_nl80211_deinit_ap()
8057 bss->beacon_set = 0; in wpa_driver_nl80211_deinit_ap()
8063 if (drv->nlmode == NL80211_IFTYPE_P2P_GO && bss->if_dynamic) in wpa_driver_nl80211_deinit_ap()
8072 struct i802_bss *bss = priv; in wpa_driver_nl80211_stop_ap() local
8073 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_stop_ap()
8076 wpa_driver_nl80211_del_beacon(bss); in wpa_driver_nl80211_stop_ap()
8077 bss->beacon_set = 0; in wpa_driver_nl80211_stop_ap()
8084 struct i802_bss *bss = priv; in wpa_driver_nl80211_deinit_p2p_cli() local
8085 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_deinit_p2p_cli()
8093 if (bss->if_dynamic) in wpa_driver_nl80211_deinit_p2p_cli()
8102 struct i802_bss *bss = priv; in wpa_driver_nl80211_resume() local
8103 enum nl80211_iftype nlmode = nl80211_get_ifmode(bss); in wpa_driver_nl80211_resume()
8105 if (i802_set_iface_flags(bss, 1)) in wpa_driver_nl80211_resume()
8109 nl80211_disable_11b_rates(bss->drv, bss->drv->ifindex, 1); in wpa_driver_nl80211_resume()
8115 struct i802_bss *bss = priv; in nl80211_signal_monitor() local
8116 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_signal_monitor()
8123 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_CQM)) || in nl80211_signal_monitor()
8176 struct i802_bss *bss = priv; in nl80211_signal_poll() local
8177 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_signal_poll()
8199 struct i802_bss *bss = priv; in nl80211_set_param() local
8200 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_param()
8320 struct i802_bss *bss = priv; in nl80211_get_radio_name() local
8321 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_get_radio_name()
8326 static int nl80211_pmkid(struct i802_bss *bss, int cmd, in nl80211_pmkid() argument
8332 if (!(msg = nl80211_bss_msg(bss, 0, cmd)) || in nl80211_pmkid()
8356 return send_and_recv_msgs(bss->drv, msg, NULL, (void *) -1); in nl80211_pmkid()
8362 struct i802_bss *bss = priv; in nl80211_add_pmkid() local
8375 ret = nl80211_pmkid(bss, NL80211_CMD_SET_PMKSA, params); in nl80211_add_pmkid()
8388 struct i802_bss *bss = priv; in nl80211_remove_pmkid() local
8401 ret = nl80211_pmkid(bss, NL80211_CMD_DEL_PMKSA, params); in nl80211_remove_pmkid()
8414 struct i802_bss *bss = priv; in nl80211_flush_pmkid() local
8418 msg = nl80211_bss_msg(bss, 0, NL80211_CMD_FLUSH_PMKSA); in nl80211_flush_pmkid()
8421 return send_and_recv_msgs(bss->drv, msg, NULL, NULL); in nl80211_flush_pmkid()
8564 struct i802_bss *bss = priv; in wpa_driver_nl80211_get_survey() local
8565 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_get_survey()
8603 struct i802_bss *bss = priv; in nl80211_set_rekey_info() local
8604 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_rekey_info()
8613 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_REKEY_OFFLOAD)) || in nl80211_set_rekey_info()
8635 static void nl80211_send_null_frame(struct i802_bss *bss, const u8 *own_addr, in nl80211_send_null_frame() argument
8667 if (wpa_driver_nl80211_send_mlme(bss, (u8 *) &nulldata, size, 0, 0, 0, in nl80211_send_null_frame()
8676 struct i802_bss *bss = priv; in nl80211_poll_client() local
8677 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_poll_client()
8683 nl80211_send_null_frame(bss, own_addr, addr, qos); in nl80211_poll_client()
8687 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_PROBE_CLIENT)) || in nl80211_poll_client()
8707 static int nl80211_set_power_save(struct i802_bss *bss, int enabled) in nl80211_set_power_save() argument
8712 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_POWER_SAVE)) || in nl80211_set_power_save()
8719 ret = send_and_recv_msgs(bss->drv, msg, NULL, NULL); in nl80211_set_power_save()
8733 struct i802_bss *bss = priv; in nl80211_set_p2p_powersave() local
8751 return nl80211_set_power_save(bss, legacy_ps); in nl80211_set_p2p_powersave()
8758 struct i802_bss *bss = priv; in nl80211_start_radar_detection() local
8759 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_start_radar_detection()
8794 struct i802_bss *bss = priv; in nl80211_send_tdls_mgmt() local
8795 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_send_tdls_mgmt()
8836 struct i802_bss *bss = priv; in nl80211_tdls_oper() local
8837 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_tdls_oper()
8888 struct i802_bss *bss = priv; in nl80211_tdls_enable_channel_switch() local
8889 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_tdls_enable_channel_switch()
8900 msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_TDLS_CHANNEL_SWITCH); in nl80211_tdls_enable_channel_switch()
8917 struct i802_bss *bss = priv; in nl80211_tdls_disable_channel_switch() local
8918 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_tdls_disable_channel_switch()
8927 msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH); in nl80211_tdls_disable_channel_switch()
8945 struct i802_bss *bss = priv; in driver_nl80211_set_key() local
8947 return wpa_driver_nl80211_set_key(bss, params); in driver_nl80211_set_key()
8954 struct i802_bss *bss = priv; in driver_nl80211_scan2() local
8956 struct wpa_driver_nl80211_data *drv = bss->drv; in driver_nl80211_scan2()
8966 return wpa_driver_nl80211_vendor_scan(bss, params); in driver_nl80211_scan2()
8968 return wpa_driver_nl80211_scan(bss, params); in driver_nl80211_scan2()
8975 struct i802_bss *bss = priv; in driver_nl80211_deauthenticate() local
8976 return wpa_driver_nl80211_deauthenticate(bss, addr, reason_code); in driver_nl80211_deauthenticate()
8983 struct i802_bss *bss = priv; in driver_nl80211_authenticate() local
8984 return wpa_driver_nl80211_authenticate(bss, params); in driver_nl80211_authenticate()
8990 struct i802_bss *bss = priv; in driver_nl80211_deinit() local
8991 wpa_driver_nl80211_deinit(bss); in driver_nl80211_deinit()
8998 struct i802_bss *bss = priv; in driver_nl80211_if_remove() local
8999 return wpa_driver_nl80211_if_remove(bss, type, ifname); in driver_nl80211_if_remove()
9009 struct i802_bss *bss = priv; in driver_nl80211_send_mlme() local
9010 return wpa_driver_nl80211_send_mlme(bss, data, data_len, noack, in driver_nl80211_send_mlme()
9018 struct i802_bss *bss = priv; in driver_nl80211_sta_remove() local
9019 return wpa_driver_nl80211_sta_remove(bss, addr, -1, 0); in driver_nl80211_sta_remove()
9026 struct i802_bss *bss = priv; in driver_nl80211_set_sta_vlan() local
9027 return i802_set_sta_vlan(bss, addr, ifname, vlan_id); in driver_nl80211_set_sta_vlan()
9035 struct i802_bss *bss = priv; in driver_nl80211_read_sta_data() local
9038 return i802_read_sta_data(bss, data, addr); in driver_nl80211_read_sta_data()
9049 struct i802_bss *bss = priv; in driver_nl80211_send_action() local
9050 return wpa_driver_nl80211_send_action(bss, freq, wait_time, dst, src, in driver_nl80211_send_action()
9057 struct i802_bss *bss = priv; in driver_nl80211_probe_req_report() local
9058 return wpa_driver_nl80211_probe_req_report(bss, report); in driver_nl80211_probe_req_report()
9067 struct i802_bss *bss = priv; in wpa_driver_nl80211_update_ft_ies() local
9068 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_update_ft_ies()
9094 struct i802_bss *bss = priv; in nl80211_update_dh_ie() local
9095 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_update_dh_ie()
9099 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_UPDATE_OWE_INFO)) || in nl80211_update_dh_ie()
9120 struct i802_bss *bss = priv; in wpa_driver_nl80211_get_macaddr() local
9121 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_get_macaddr()
9126 return bss->addr; in wpa_driver_nl80211_get_macaddr()
9157 struct i802_bss *bss = priv; in wpa_driver_nl80211_status() local
9158 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_status()
9174 bss->ifindex, in wpa_driver_nl80211_status()
9175 bss->ifname, in wpa_driver_nl80211_status()
9176 bss->brname, in wpa_driver_nl80211_status()
9177 MAC2STR(bss->addr), in wpa_driver_nl80211_status()
9178 bss->freq, in wpa_driver_nl80211_status()
9179 bss->beacon_set ? "beacon_set=1\n" : "", in wpa_driver_nl80211_status()
9180 bss->added_if_into_bridge ? in wpa_driver_nl80211_status()
9182 bss->already_in_bridge ? "already_in_bridge=1\n" : "", in wpa_driver_nl80211_status()
9183 bss->added_bridge ? "added_bridge=1\n" : "", in wpa_driver_nl80211_status()
9184 bss->in_deinit ? "in_deinit=1\n" : "", in wpa_driver_nl80211_status()
9185 bss->if_dynamic ? "if_dynamic=1\n" : ""); in wpa_driver_nl80211_status()
9190 if (bss->wdev_id_set) { in wpa_driver_nl80211_status()
9192 (unsigned long long) bss->wdev_id); in wpa_driver_nl80211_status()
9357 struct i802_bss *bss = priv; in nl80211_switch_channel() local
9358 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_switch_channel()
9431 if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_CHANNEL_SWITCH)) || in nl80211_switch_channel()
9482 struct i802_bss *bss = priv; in nl80211_add_ts() local
9483 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_add_ts()
9494 msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_ADD_TX_TS); in nl80211_add_ts()
9514 struct i802_bss *bss = priv; in nl80211_del_ts() local
9515 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_del_ts()
9524 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_DEL_TX_TS)) || in nl80211_del_ts()
9596 struct i802_bss *bss = priv; in nl80211_vendor_cmd() local
9597 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_vendor_cmd()
9615 get_connect_handle(bss), 0, in nl80211_vendor_cmd()
9624 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_VENDOR)) || in nl80211_vendor_cmd()
9646 struct i802_bss *bss = priv; in nl80211_set_qos_map() local
9647 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_qos_map()
9685 struct i802_bss *bss = priv; in nl80211_get_wowlan() local
9686 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_get_wowlan()
9711 struct i802_bss *bss = priv; in nl80211_set_wowlan() local
9712 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_wowlan()
9719 if (!(msg = nl80211_cmd_msg(bss, 0, NL80211_CMD_SET_WOWLAN)) || in nl80211_set_wowlan()
9753 struct i802_bss *bss = priv; in nl80211_roaming() local
9754 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_roaming()
9787 struct i802_bss *bss = priv; in nl80211_disable_fils() local
9788 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_disable_fils()
9819 struct i802_bss *bss = priv; in nl80211_set_bssid_blacklist() local
9820 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_bssid_blacklist()
9875 struct i802_bss *bss = priv; in nl80211_add_sta_node() local
9876 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_add_sta_node()
9911 struct i802_bss *bss = priv; in nl80211_set_mac_addr() local
9912 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_mac_addr()
9921 if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 0) < 0) in nl80211_set_mac_addr()
9924 if (linux_set_ifhwaddr(drv->global->ioctl_sock, bss->ifname, addr) < 0) in nl80211_set_mac_addr()
9928 bss->ifname, MAC2STR(addr)); in nl80211_set_mac_addr()
9929 if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, in nl80211_set_mac_addr()
9938 bss->ifname, MAC2STR(addr)); in nl80211_set_mac_addr()
9940 os_memcpy(bss->addr, addr, ETH_ALEN); in nl80211_set_mac_addr()
9942 if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1) < 0) in nl80211_set_mac_addr()
10021 static int nl80211_join_mesh(struct i802_bss *bss, in nl80211_join_mesh() argument
10024 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_join_mesh()
10071 ret = send_and_recv_msgs_owner(drv, msg, get_connect_handle(bss), 1, in nl80211_join_mesh()
10080 drv->assoc_freq = bss->freq = params->freq.freq; in nl80211_join_mesh()
10093 struct i802_bss *bss = priv; in wpa_driver_nl80211_join_mesh() local
10102 ret = nl80211_join_mesh(bss, params); in wpa_driver_nl80211_join_mesh()
10122 struct i802_bss *bss = priv; in wpa_driver_nl80211_leave_mesh() local
10123 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_nl80211_leave_mesh()
10129 ret = send_and_recv_msgs_owner(drv, msg, get_connect_handle(bss), 0, in wpa_driver_nl80211_leave_mesh()
10151 struct i802_bss *bss = priv; in nl80211_probe_mesh_link() local
10152 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_probe_mesh_link()
10185 struct i802_bss *bss = priv; in wpa_driver_br_add_ip_neigh() local
10186 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_br_add_ip_neigh()
10196 if (bss->br_ifindex == 0) { in wpa_driver_br_add_ip_neigh()
10246 rtnl_neigh_set_ifindex(rn, bss->br_ifindex); in wpa_driver_br_add_ip_neigh()
10273 struct i802_bss *bss = priv; in wpa_driver_br_delete_ip_neigh() local
10274 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_br_delete_ip_neigh()
10293 if (bss->br_ifindex == 0) { in wpa_driver_br_delete_ip_neigh()
10323 rtnl_neigh_set_ifindex(rn, bss->br_ifindex); in wpa_driver_br_delete_ip_neigh()
10385 struct i802_bss *bss = priv; in wpa_driver_br_port_set_attr() local
10394 bss->ifname, attr_txt); in wpa_driver_br_port_set_attr()
10417 struct i802_bss *bss = priv; in wpa_driver_br_set_net_param() local
10425 bss->brname); in wpa_driver_br_set_net_param()
10442 ip_version, bss->brname, param_txt); in wpa_driver_br_set_net_param()
10537 struct i802_bss *bss = priv; in wpa_driver_do_acs() local
10538 struct wpa_driver_nl80211_data *drv = bss->drv; in wpa_driver_do_acs()
10588 struct i802_bss *bss = priv; in nl80211_set_band() local
10589 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_band()
10700 struct i802_bss *bss = priv; in nl80211_get_pref_freq_list() local
10701 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_get_pref_freq_list()
10776 struct i802_bss *bss = priv; in nl80211_set_prob_oper_freq() local
10777 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_prob_oper_freq()
10787 freq, bss->ifindex); in nl80211_set_prob_oper_freq()
10826 struct i802_bss *bss = priv; in nl80211_p2p_lo_start() local
10827 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_p2p_lo_start()
10882 struct i802_bss *bss = priv; in nl80211_p2p_lo_stop() local
10883 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_p2p_lo_stop()
10905 struct i802_bss *bss = priv; in nl80211_set_tdls_mode() local
10906 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_tdls_mode()
11061 struct i802_bss *bss = priv; in nl80211_get_bss_transition_status() local
11062 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_get_bss_transition_status()
11157 struct i802_bss *bss = priv; in nl80211_ignore_assoc_disallow() local
11158 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_ignore_assoc_disallow()
11243 struct i802_bss *bss = priv; in nl80211_configure_data_frame_filters() local
11253 bss->ifname); in nl80211_configure_data_frame_filters()
11268 bss->ifname); in nl80211_configure_data_frame_filters()
11282 bss->ifname); in nl80211_configure_data_frame_filters()
11295 bss->ifname); in nl80211_configure_data_frame_filters()
11313 struct i802_bss *bss = priv; in nl80211_get_ext_capab() local
11314 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_get_ext_capab()
11346 struct i802_bss *bss = priv; in nl80211_update_connection_params() local
11347 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_update_connection_params()
11403 struct i802_bss *bss = priv; in nl80211_send_external_auth_status() local
11404 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_send_external_auth_status()
11413 if ((is_ap_interface(drv->nlmode) && !bss->drv->device_ap_sme) || in nl80211_send_external_auth_status()
11447 struct i802_bss *bss = priv; in nl80211_set_4addr_mode() local
11448 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_set_4addr_mode()
11459 if (bridge_ifname[0] && bss->added_if_into_bridge && !val) { in nl80211_set_4addr_mode()
11461 bridge_ifname, bss->ifname)) { in nl80211_set_4addr_mode()
11464 bss->ifname, bridge_ifname); in nl80211_set_4addr_mode()
11467 bss->added_if_into_bridge = 0; in nl80211_set_4addr_mode()
11474 i802_check_bridge(drv, bss, bridge_ifname, bss->ifname) < 0) in nl80211_set_4addr_mode()
11490 struct i802_bss *bss = priv; in nl80211_dpp_listen() local
11491 struct wpa_driver_nl80211_data *drv = bss->drv; in nl80211_dpp_listen()
11495 if (!drv->multicast_registrations || !bss->nl_mgmt) in nl80211_dpp_listen()
11501 handle = (void *) (((intptr_t) bss->nl_mgmt) ^ ELOOP_SOCKET_INVALID); in nl80211_dpp_listen()
11502 return nl80211_register_frame(bss, handle, type, in nl80211_dpp_listen()