hostapd: merge operstate cleanup from r23738
authorFelix Fietkau <nbd@openwrt.org>
Sun, 31 Oct 2010 13:53:47 +0000 (13:53 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 31 Oct 2010 13:53:47 +0000 (13:53 +0000)
SVN-Revision: 23740

package/hostapd/patches/330-madwifi_merge.patch
package/hostapd/patches/460-oper_state_fix.patch

index f35eab3860fdead51dec1e0079652de6829bec63..cddffe4b919ac1ef7ff479ad8266091cc33170e7 100644 (file)
 -      return 0;
 -}
 -
- static int
+-static int
 -set80211param(struct wpa_driver_madwifi_data *drv, int op, int arg,
 -            int show_err)
 -{
 -      return 0;
 -}
 -
--static int
+ static int
 -wpa_driver_madwifi_set_wpa_ie(struct wpa_driver_madwifi_data *drv,
 +wpa_driver_madwifi_set_wpa_ie(struct madwifi_driver_data *drv,
                              const u8 *wpa_ie, size_t wpa_ie_len)
        return wpa_driver_wext_get_ssid(drv->wext, ssid);
  }
  
-@@ -1705,14 +1481,14 @@ static int wpa_driver_madwifi_get_ssid(v
+@@ -1705,14 +1481,16 @@ static int wpa_driver_madwifi_get_ssid(v
  static struct wpa_scan_results *
  wpa_driver_madwifi_get_scan_results(void *priv)
  {
  {
 -      struct wpa_driver_madwifi_data *drv = priv;
 +      struct madwifi_driver_data *drv = priv;
++      if (!drv->wext)
++              return 0;
        return wpa_driver_wext_set_operstate(drv->wext, state);
  }
  
-@@ -1733,7 +1509,7 @@ static int wpa_driver_madwifi_set_probe_
+@@ -1733,7 +1511,7 @@ static int wpa_driver_madwifi_set_probe_
  
        ret = set80211priv(priv, IEEE80211_IOCTL_SET_APPIEBUF, probe_req_ie,
                           sizeof(struct ieee80211req_getset_appiebuf) +
  
        os_free(probe_req_ie);
  
-@@ -1743,7 +1519,7 @@ static int wpa_driver_madwifi_set_probe_
+@@ -1743,7 +1521,7 @@ static int wpa_driver_madwifi_set_probe_
  
  static void * wpa_driver_madwifi_init(void *ctx, const char *ifname)
  {
  
        drv = os_zalloc(sizeof(*drv));
        if (drv == NULL)
-@@ -1754,17 +1530,17 @@ static void * wpa_driver_madwifi_init(vo
+@@ -1754,17 +1532,17 @@ static void * wpa_driver_madwifi_init(vo
  
        drv->ctx = ctx;
        os_strlcpy(drv->ifname, ifname, sizeof(drv->ifname));
                wpa_printf(MSG_DEBUG, "%s: failed to enable WPA support",
                           __FUNCTION__);
                goto fail3;
-@@ -1773,7 +1549,7 @@ static void * wpa_driver_madwifi_init(vo
+@@ -1773,7 +1551,7 @@ static void * wpa_driver_madwifi_init(vo
        return drv;
  
  fail3:
  fail2:
        wpa_driver_wext_deinit(drv->wext);
  fail:
-@@ -1784,38 +1560,37 @@ fail:
+@@ -1784,38 +1562,37 @@ fail:
  
  static void wpa_driver_madwifi_deinit(void *priv)
  {
  #ifdef HOSTAPD
        .hapd_init              = madwifi_init,
        .hapd_deinit            = madwifi_deinit,
-@@ -1835,7 +1610,8 @@ const struct wpa_driver_ops wpa_driver_m
+@@ -1835,7 +1612,8 @@ const struct wpa_driver_ops wpa_driver_m
        .sta_clear_stats        = madwifi_sta_clear_stats,
        .commit                 = madwifi_commit,
        .set_ap_wps_ie          = madwifi_set_ap_wps_ie,
        .get_bssid              = wpa_driver_madwifi_get_bssid,
        .get_ssid               = wpa_driver_madwifi_get_ssid,
        .init                   = wpa_driver_madwifi_init,
-@@ -1847,5 +1623,5 @@ const struct wpa_driver_ops wpa_driver_m
+@@ -1847,5 +1625,5 @@ const struct wpa_driver_ops wpa_driver_m
        .disassociate           = wpa_driver_madwifi_disassociate,
        .associate              = wpa_driver_madwifi_associate,
        .set_operstate          = wpa_driver_madwifi_set_operstate,
index 8ea0e123601a71866b858c8ac61ef80ef66cf28c..5a685a23ef0c5b6292d999f04dedec25ac3e7468 100644 (file)
@@ -23,25 +23,3 @@ DORMANT state does not prevent normal operations after that.
        return 0;
  }
  
---- a/src/drivers/driver_wext.c
-+++ b/src/drivers/driver_wext.c
-@@ -2245,11 +2245,14 @@ int wpa_driver_wext_set_operstate(void *
- {
-       struct wpa_driver_wext_data *drv = priv;
--      wpa_printf(MSG_DEBUG, "%s: operstate %d->%d (%s)",
--                 __func__, drv->operstate, state, state ? "UP" : "DORMANT");
--      drv->operstate = state;
--      return netlink_send_oper_ifla(drv->netlink, drv->ifindex, -1,
--                                    state ? IF_OPER_UP : IF_OPER_DORMANT);
-+      if (drv != NULL)
-+      {
-+              wpa_printf(MSG_DEBUG, "%s: operstate %d->%d (%s)",
-+                         __func__, drv->operstate, state, state ? "UP" : "DORMANT");
-+              drv->operstate = state;
-+              return netlink_send_oper_ifla(drv->netlink, drv->ifindex, -1,
-+                                            state ? IF_OPER_UP : IF_OPER_DORMANT);
-+      }
- }