Skip to contentSkip to conversation

mac80211: Successfully set master mode and get/set ESSID in master mode

PATCH Johannes Berg 1 participant 1 message Jun 16, 2009 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20090617004435.3801930f@symphony

Johannes Berg

author NAK
#1 lore raw
Quoted 9 lines · James Le Cuirot

This allows wext-based drivers to successfully put the adapter into master mode and get/set the ESSID while in master mode. I'm not sure why this code was not already present but the "Invalid argument" error I was getting has now gone and getting/setting the ESSID afterwards now works. Hopefully this helps and I haven't misunderstood something. This patch is against the wireless-testing branch. Admittedly, I haven't actually tested it against this branch but I've made identical changes to 2.6.30 and that's working fine. For the record, I'm using a p54usb adapter.

NACK.
http://wireless.kernel.org/RTFM-AP

johannes

Quoted 43 lines

---

net/mac80211/wext.c +4 -2
index 1da81f4..e8d5cee 100644
@@ -131,7 +131,8 @@ static int ieee80211_ioctl_siwessid(struct net_device *dev,
        size_t len = data->length;
        int ret;
 
-       if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
+       if (sdata->vif.type == NL80211_IFTYPE_ADHOC ||
+           sdata->vif.type == NL80211_IFTYPE_AP)
                return cfg80211_ibss_wext_siwessid(dev, info, data, ssid);
 
        /* iwconfig uses nul termination in SSID.. */
@@ -167,7 +168,8 @@ static int ieee80211_ioctl_giwessid(struct net_device *dev,
 
        sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
-       if (sdata->vif.type == NL80211_IFTYPE_ADHOC)
+       if (sdata->vif.type == NL80211_IFTYPE_ADHOC ||
+           sdata->vif.type == NL80211_IFTYPE_AP)
                return cfg80211_ibss_wext_giwessid(dev, info, data, ssid);
 
        if (sdata->vif.type == NL80211_IFTYPE_STATION) {
net/wireless/wext-compat.c +3 -0
index d030c53..5c1f215 100644
@@ -82,6 +82,9 @@ int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
                return -EOPNOTSUPP;
 
        switch (*mode) {
+       case IW_MODE_MASTER:
+               type = NL80211_IFTYPE_AP;
+               break;
        case IW_MODE_INFRA:
                type = NL80211_IFTYPE_STATION;
                break;