nl80211: Remove practically unused process_drv_event()
authorJouni Malinen <j@w1.fi>
Mon, 22 Dec 2014 14:12:11 +0000 (16:12 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 22 Dec 2014 14:12:11 +0000 (16:12 +0200)
This was used in the past, but all the event processing is now either
through process_global_event() or process_bss_event().

Signed-off-by: Jouni Malinen <j@w1.fi>
src/drivers/driver_nl80211.c
src/drivers/driver_nl80211.h
src/drivers/driver_nl80211_event.c

index cff7b0d..3861ec0 100644 (file)
@@ -1425,23 +1425,6 @@ err:
 }
 
 
-static int wpa_driver_nl80211_init_nl(struct wpa_driver_nl80211_data *drv)
-{
-       drv->nl_cb = nl_cb_alloc(NL_CB_DEFAULT);
-       if (!drv->nl_cb) {
-               wpa_printf(MSG_ERROR, "nl80211: Failed to alloc cb struct");
-               return -1;
-       }
-
-       nl_cb_set(drv->nl_cb, NL_CB_SEQ_CHECK, NL_CB_CUSTOM,
-                 no_seq_check, NULL);
-       nl_cb_set(drv->nl_cb, NL_CB_VALID, NL_CB_CUSTOM,
-                 process_drv_event, drv);
-
-       return 0;
-}
-
-
 static void wpa_driver_nl80211_rfkill_blocked(void *ctx)
 {
        wpa_printf(MSG_DEBUG, "nl80211: RFKILL blocked");
@@ -1582,11 +1565,6 @@ static void * wpa_driver_nl80211_drv_init(void *ctx, const char *ifname,
        drv->eapol_tx_sock = -1;
        drv->ap_scan_as_station = NL80211_IFTYPE_UNSPECIFIED;
 
-       if (wpa_driver_nl80211_init_nl(drv)) {
-               os_free(drv);
-               return NULL;
-       }
-
        if (nl80211_init_bss(bss))
                goto failed;
 
@@ -1695,15 +1673,13 @@ static int nl80211_register_frame(struct i802_bss *bss,
 
 static int nl80211_alloc_mgmt_handle(struct i802_bss *bss)
 {
-       struct wpa_driver_nl80211_data *drv = bss->drv;
-
        if (bss->nl_mgmt) {
                wpa_printf(MSG_DEBUG, "nl80211: Mgmt reporting "
                           "already on! (nl_mgmt=%p)", bss->nl_mgmt);
                return -1;
        }
 
-       bss->nl_mgmt = nl_create_handle(drv->nl_cb, "mgmt");
+       bss->nl_mgmt = nl_create_handle(bss->nl_cb, "mgmt");
        if (bss->nl_mgmt == NULL)
                return -1;
 
@@ -2217,7 +2193,6 @@ static void wpa_driver_nl80211_deinit(struct i802_bss *bss)
                nl80211_mgmt_unsubscribe(bss, "deinit");
                nl80211_del_p2pdev(bss);
        }
-       nl_cb_put(drv->nl_cb);
 
        nl80211_destroy_bss(drv->first_bss);
 
index 4a364f7..6892b31 100644 (file)
@@ -105,8 +105,6 @@ struct wpa_driver_nl80211_data {
                SCHED_SCAN_RESULTS
        } scan_state;
 
-       struct nl_cb *nl_cb;
-
        u8 auth_bssid[ETH_ALEN];
        u8 auth_attempt_bssid[ETH_ALEN];
        u8 bssid[ETH_ALEN];
@@ -227,7 +225,6 @@ struct hostapd_hw_modes *
 nl80211_get_hw_feature_data(void *priv, u16 *num_modes, u16 *flags);
 
 int process_global_event(struct nl_msg *msg, void *arg);
-int process_drv_event(struct nl_msg *msg, void *arg);
 int process_bss_event(struct nl_msg *msg, void *arg);
 
 #ifdef ANDROID
index 5c8b294..85769d8 100644 (file)
@@ -1868,46 +1868,6 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd,
 }
 
 
-int process_drv_event(struct nl_msg *msg, void *arg)
-{
-       struct wpa_driver_nl80211_data *drv = arg;
-       struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
-       struct nlattr *tb[NL80211_ATTR_MAX + 1];
-       struct i802_bss *bss;
-       int ifidx = -1;
-
-       nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
-                 genlmsg_attrlen(gnlh, 0), NULL);
-
-       if (tb[NL80211_ATTR_IFINDEX]) {
-               ifidx = nla_get_u32(tb[NL80211_ATTR_IFINDEX]);
-
-               for (bss = drv->first_bss; bss; bss = bss->next)
-                       if (ifidx == -1 || ifidx == bss->ifindex) {
-                               do_process_drv_event(bss, gnlh->cmd, tb);
-                               return NL_SKIP;
-                       }
-               wpa_printf(MSG_DEBUG,
-                          "nl80211: Ignored event (cmd=%d) for foreign interface (ifindex %d)",
-                          gnlh->cmd, ifidx);
-       } else if (tb[NL80211_ATTR_WDEV]) {
-               u64 wdev_id = nla_get_u64(tb[NL80211_ATTR_WDEV]);
-               wpa_printf(MSG_DEBUG, "nl80211: Process event on P2P device");
-               for (bss = drv->first_bss; bss; bss = bss->next) {
-                       if (bss->wdev_id_set && wdev_id == bss->wdev_id) {
-                               do_process_drv_event(bss, gnlh->cmd, tb);
-                               return NL_SKIP;
-                       }
-               }
-               wpa_printf(MSG_DEBUG,
-                          "nl80211: Ignored event (cmd=%d) for foreign interface (wdev 0x%llx)",
-                          gnlh->cmd, (long long unsigned int) wdev_id);
-       }
-
-       return NL_SKIP;
-}
-
-
 int process_global_event(struct nl_msg *msg, void *arg)
 {
        struct nl80211_global *global = arg;
@@ -1940,6 +1900,9 @@ int process_global_event(struct nl_msg *msg, void *arg)
                                return NL_SKIP;
                        }
                }
+               wpa_printf(MSG_DEBUG,
+                          "nl80211: Ignored event (cmd=%d) for foreign interface (ifindex %d wdev 0x%llx)",
+                          gnlh->cmd, ifidx, (long long unsigned int) wdev_id);
        }
 
        return NL_SKIP;