]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
cfg80211: combine IWESSID handlers
authorJohannes Berg <johannes@sipsolutions.net>
Mon, 27 Jul 2009 10:01:52 +0000 (12:01 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 29 Jul 2009 19:46:18 +0000 (15:46 -0400)
Since we now have handlers IWESSID for all modes, we can
combine them into one.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwmc3200wifi/wext.c
include/net/cfg80211.h
net/mac80211/wext.c
net/wireless/ibss.c
net/wireless/wext-compat.c
net/wireless/wext-compat.h
net/wireless/wext-sme.c

index 5319b16474e3be6c7391209009be2f7e688a8e05..9196024a2890a2953af84783dd223413a40c7ab8 100644 (file)
 #include "iwm.h"
 #include "commands.h"
 
-static int iwm_wext_siwessid(struct net_device *dev,
-                            struct iw_request_info *info,
-                            struct iw_point *data, char *ssid)
-{
-       struct iwm_priv *iwm = ndev_to_iwm(dev);
-
-       switch (iwm->conf.mode) {
-       case UMAC_MODE_IBSS:
-               return cfg80211_ibss_wext_siwessid(dev, info, data, ssid);
-       case UMAC_MODE_BSS:
-               return cfg80211_mgd_wext_siwessid(dev, info, data, ssid);
-       default:
-               return -EOPNOTSUPP;
-       }
-}
-
-static int iwm_wext_giwessid(struct net_device *dev,
-                            struct iw_request_info *info,
-                            struct iw_point *data, char *ssid)
-{
-       struct iwm_priv *iwm = ndev_to_iwm(dev);
-
-       switch (iwm->conf.mode) {
-       case UMAC_MODE_IBSS:
-               return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
-       case UMAC_MODE_BSS:
-               return cfg80211_mgd_wext_giwessid(dev, info, data, ssid);
-       default:
-               return -EOPNOTSUPP;
-       }
-}
-
 static const iw_handler iwm_handlers[] =
 {
        (iw_handler) NULL,                              /* SIOCSIWCOMMIT */
@@ -87,8 +55,8 @@ static const iw_handler iwm_handlers[] =
        (iw_handler) NULL,                              /* SIOCGIWAPLIST */
        (iw_handler) cfg80211_wext_siwscan,             /* SIOCSIWSCAN */
        (iw_handler) cfg80211_wext_giwscan,             /* SIOCGIWSCAN */
-       (iw_handler) iwm_wext_siwessid,                 /* SIOCSIWESSID */
-       (iw_handler) iwm_wext_giwessid,                 /* SIOCGIWESSID */
+       (iw_handler) cfg80211_wext_siwessid,            /* SIOCSIWESSID */
+       (iw_handler) cfg80211_wext_giwessid,            /* SIOCGIWESSID */
        (iw_handler) NULL,                              /* SIOCSIWNICKN */
        (iw_handler) NULL,                              /* SIOCGIWNICKN */
        (iw_handler) NULL,                              /* -- hole -- */
index 3348c16e1f357daefdd27c1cf21958b7ee330a33..e1b92358242be7bf5a0c7246e2f0451ce7682d3d 100644 (file)
@@ -1595,19 +1595,6 @@ int cfg80211_wext_siwmlme(struct net_device *dev,
 int cfg80211_wext_giwrange(struct net_device *dev,
                           struct iw_request_info *info,
                           struct iw_point *data, char *extra);
-int cfg80211_ibss_wext_siwessid(struct net_device *dev,
-                               struct iw_request_info *info,
-                               struct iw_point *data, char *ssid);
-int cfg80211_ibss_wext_giwessid(struct net_device *dev,
-                               struct iw_request_info *info,
-                               struct iw_point *data, char *ssid);
-
-int cfg80211_mgd_wext_siwessid(struct net_device *dev,
-                              struct iw_request_info *info,
-                              struct iw_point *data, char *ssid);
-int cfg80211_mgd_wext_giwessid(struct net_device *dev,
-                              struct iw_request_info *info,
-                              struct iw_point *data, char *ssid);
 int cfg80211_wext_siwgenie(struct net_device *dev,
                           struct iw_request_info *info,
                           struct iw_point *data, char *extra);
@@ -1624,7 +1611,12 @@ int cfg80211_wext_siwfreq(struct net_device *dev,
 int cfg80211_wext_giwfreq(struct net_device *dev,
                          struct iw_request_info *info,
                          struct iw_freq *freq, char *extra);
-
+int cfg80211_wext_siwessid(struct net_device *dev,
+                          struct iw_request_info *info,
+                          struct iw_point *data, char *ssid);
+int cfg80211_wext_giwessid(struct net_device *dev,
+                          struct iw_request_info *info,
+                          struct iw_point *data, char *ssid);
 int cfg80211_wext_siwrate(struct net_device *dev,
                          struct iw_request_info *info,
                          struct iw_param *rate, char *extra);
index 72866c8b8c3d0eb08444e6f6986f8493f3adb850..aa250c3e8fda685a452d21936f6b61eb2b894c5d 100644 (file)
 #include "aes_ccm.h"
 
 
-static int ieee80211_ioctl_siwessid(struct net_device *dev,
-                                   struct iw_request_info *info,
-                                   struct iw_point *data, char *ssid)
-{
-       struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
-       if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
-               return cfg80211_ibss_wext_siwessid(dev, info, data, ssid);
-       else if (sdata->vif.type == NL80211_IFTYPE_STATION)
-               return cfg80211_mgd_wext_siwessid(dev, info, data, ssid);
-
-       return -EOPNOTSUPP;
-}
-
-
-static int ieee80211_ioctl_giwessid(struct net_device *dev,
-                                   struct iw_request_info *info,
-                                   struct iw_point *data, char *ssid)
-{
-       struct ieee80211_sub_if_data *sdata;
-
-       sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
-       if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
-               return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
-       else if (sdata->vif.type == NL80211_IFTYPE_STATION)
-               return cfg80211_mgd_wext_giwessid(dev, info, data, ssid);
-
-       return -EOPNOTSUPP;
-}
-
 
 /* Structures to export the Wireless Handlers */
 
@@ -89,8 +58,8 @@ static const iw_handler ieee80211_handler[] =
        (iw_handler) NULL,                              /* SIOCGIWAPLIST */
        (iw_handler) cfg80211_wext_siwscan,             /* SIOCSIWSCAN */
        (iw_handler) cfg80211_wext_giwscan,             /* SIOCGIWSCAN */
-       (iw_handler) ieee80211_ioctl_siwessid,          /* SIOCSIWESSID */
-       (iw_handler) ieee80211_ioctl_giwessid,          /* SIOCGIWESSID */
+       (iw_handler) cfg80211_wext_siwessid,            /* SIOCSIWESSID */
+       (iw_handler) cfg80211_wext_giwessid,            /* SIOCGIWESSID */
        (iw_handler) NULL,                              /* SIOCSIWNICKN */
        (iw_handler) NULL,                              /* SIOCGIWNICKN */
        (iw_handler) NULL,                              /* -- hole -- */
index f955225ed91159628bf395367420a6b7ea21ed9b..4d7a084b35e2e1d2e625e68dba241241fdb33dab 100644 (file)
@@ -381,8 +381,6 @@ int cfg80211_ibss_wext_siwessid(struct net_device *dev,
 
        return err;
 }
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_ibss_wext_siwessid);
 
 int cfg80211_ibss_wext_giwessid(struct net_device *dev,
                                struct iw_request_info *info,
@@ -410,8 +408,6 @@ int cfg80211_ibss_wext_giwessid(struct net_device *dev,
 
        return 0;
 }
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_ibss_wext_giwessid);
 
 int cfg80211_ibss_wext_siwap(struct net_device *dev,
                             struct iw_request_info *info,
index c27774bd010765060c4a78bfd171c94273a5e6c0..083e4c33d95d9ced3327b0679d41bc84a05c545a 100644 (file)
@@ -1363,3 +1363,37 @@ int cfg80211_wext_giwap(struct net_device *dev,
        }
 }
 EXPORT_SYMBOL_GPL(cfg80211_wext_giwap);
+
+int cfg80211_wext_siwessid(struct net_device *dev,
+                          struct iw_request_info *info,
+                          struct iw_point *data, char *ssid)
+{
+       struct wireless_dev *wdev = dev->ieee80211_ptr;
+
+       switch (wdev->iftype) {
+       case NL80211_IFTYPE_ADHOC:
+               return cfg80211_ibss_wext_siwessid(dev, info, data, ssid);
+       case NL80211_IFTYPE_STATION:
+               return cfg80211_mgd_wext_siwessid(dev, info, data, ssid);
+       default:
+               return -EOPNOTSUPP;
+       }
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_siwessid);
+
+int cfg80211_wext_giwessid(struct net_device *dev,
+                          struct iw_request_info *info,
+                          struct iw_point *data, char *ssid)
+{
+       struct wireless_dev *wdev = dev->ieee80211_ptr;
+
+       switch (wdev->iftype) {
+       case NL80211_IFTYPE_ADHOC:
+               return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
+       case NL80211_IFTYPE_STATION:
+               return cfg80211_mgd_wext_giwessid(dev, info, data, ssid);
+       default:
+               return -EOPNOTSUPP;
+       }
+}
+EXPORT_SYMBOL_GPL(cfg80211_wext_giwessid);
index 51028ebf19ae1a8f133b567be42337f172113789..c0310d93c2e5fcf908766d9e29df15dcce626da1 100644 (file)
@@ -13,6 +13,12 @@ int cfg80211_ibss_wext_siwap(struct net_device *dev,
 int cfg80211_ibss_wext_giwap(struct net_device *dev,
                             struct iw_request_info *info,
                             struct sockaddr *ap_addr, char *extra);
+int cfg80211_ibss_wext_siwessid(struct net_device *dev,
+                               struct iw_request_info *info,
+                               struct iw_point *data, char *ssid);
+int cfg80211_ibss_wext_giwessid(struct net_device *dev,
+                               struct iw_request_info *info,
+                               struct iw_point *data, char *ssid);
 
 int cfg80211_mgd_wext_siwfreq(struct net_device *dev,
                              struct iw_request_info *info,
@@ -26,6 +32,12 @@ int cfg80211_mgd_wext_siwap(struct net_device *dev,
 int cfg80211_mgd_wext_giwap(struct net_device *dev,
                            struct iw_request_info *info,
                            struct sockaddr *ap_addr, char *extra);
+int cfg80211_mgd_wext_siwessid(struct net_device *dev,
+                              struct iw_request_info *info,
+                              struct iw_point *data, char *ssid);
+int cfg80211_mgd_wext_giwessid(struct net_device *dev,
+                              struct iw_request_info *info,
+                              struct iw_point *data, char *ssid);
 
 struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy,
                                             struct iw_freq *freq);
index 1aa31cc5511320f5958305ea8f4400f89d038153..7bacbd1c2af6a2fcc3ab0a0cef242f054f399d91 100644 (file)
@@ -192,8 +192,6 @@ int cfg80211_mgd_wext_siwessid(struct net_device *dev,
        cfg80211_unlock_rdev(wiphy_to_dev(wdev->wiphy));
        return err;
 }
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_mgd_wext_siwessid);
 
 int cfg80211_mgd_wext_giwessid(struct net_device *dev,
                               struct iw_request_info *info,
@@ -218,8 +216,6 @@ int cfg80211_mgd_wext_giwessid(struct net_device *dev,
 
        return 0;
 }
-/* temporary symbol - mark GPL - in the future the handler won't be */
-EXPORT_SYMBOL_GPL(cfg80211_mgd_wext_giwessid);
 
 int cfg80211_mgd_wext_siwap(struct net_device *dev,
                            struct iw_request_info *info,