Home | History | Annotate | Download | only in drivers

Lines Matching refs:drv

46 static void from_unknown_sta(struct wpa_driver_nl80211_data *drv,
63 wpa_supplicant_event(drv->ctx, EVENT_RX_FROM_UNKNOWN, &event);
67 static void handle_frame(struct wpa_driver_nl80211_data *drv,
84 wpa_supplicant_event(drv->ctx, EVENT_RX_MGMT, &event);
89 from_unknown_sta(drv, buf, len);
92 from_unknown_sta(drv, buf, len);
100 struct wpa_driver_nl80211_data *drv = eloop_ctx;
160 handle_frame(drv, buf + iter._max_length,
163 handle_tx_callback(drv->ctx, buf + iter._max_length,
320 void nl80211_remove_monitor_interface(struct wpa_driver_nl80211_data *drv)
322 if (drv->monitor_refcount > 0)
323 drv->monitor_refcount--;
325 drv->monitor_refcount);
326 if (drv->monitor_refcount > 0)
329 if (drv->monitor_ifidx >= 0) {
330 nl80211_remove_iface(drv, drv->monitor_ifidx);
331 drv->monitor_ifidx = -1;
333 if (drv->monitor_sock >= 0) {
334 eloop_unregister_read_sock(drv->monitor_sock);
335 close(drv->monitor_sock);
336 drv->monitor_sock = -1;
341 int nl80211_create_monitor_interface(struct wpa_driver_nl80211_data *drv)
348 if (drv->monitor_ifidx >= 0) {
349 drv->monitor_refcount++;
351 drv->monitor_refcount);
355 if (os_strncmp(drv->first_bss->ifname, "p2p-", 4) == 0) {
362 snprintf(buf, IFNAMSIZ, "mon-%s", drv->first_bss->ifname + 4);
365 snprintf(buf, IFNAMSIZ, "mon.%s", drv->first_bss->ifname);
370 drv->monitor_ifidx =
371 nl80211_create_iface(drv, buf, NL80211_IFTYPE_MONITOR, NULL,
374 if (drv->monitor_ifidx == -EOPNOTSUPP) {
383 drv->device_ap_sme = 1;
386 if (drv->monitor_ifidx < 0)
389 if (linux_set_iface_flags(drv->global->ioctl_sock, buf, 1))
394 ll.sll_ifindex = drv->monitor_ifidx;
395 drv->monitor_sock = socket(PF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
396 if (drv->monitor_sock < 0) {
402 if (add_monitor_filter(drv->monitor_sock)) {
408 if (bind(drv->monitor_sock, (struct sockaddr *) &ll, sizeof(ll)) < 0) {
417 (drv->monitor_sock, SOL_SOCKET, SO_PRIORITY, &optval, optlen)) {
423 if (eloop_register_read_sock(drv->monitor_sock, handle_monitor_read,
424 drv, NULL)) {
429 drv->monitor_refcount++;
432 nl80211_remove_monitor_interface(drv);
437 int nl80211_send_monitor(struct wpa_driver_nl80211_data *drv,
475 if (drv->monitor_sock < 0) {
485 res = sendmsg(drv->monitor_sock, &msg, 0);