This patch cleans up the VAP creation API.
authormtaylor <mtaylor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Wed, 9 Apr 2008 03:24:05 +0000 (03:24 +0000)
committermtaylor <mtaylor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Wed, 9 Apr 2008 03:24:05 +0000 (03:24 +0000)
The need to use software instead of hardware for beacon timers in AP+STA mode (aka nosbeacon) is now just determined in software, as we always knew whether or not to enable this.

The confusing bssid and -bssid parameters are now deprecated.

The "uniquebssid" flag is equivalent to "bssid" and can be used to force IEEE80211_CLONE_BSSID flag.  If this is not specified, then the BSSID used will be the next unused BSSID in the sequence, which could very well be the parent device's MAC address.

"uniquebssid" equates directly to IEEE80211_CLONE_BSSID" flag therefore.

git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@3476 0192ed92-7a03-0410-a25b-9323aeb14dbd

ath/if_ath.c
net80211/ieee80211.c
net80211/ieee80211_ioctl.h
tools/man/wlanconfig.8
tools/wlanconfig.c

index c600efca3e90c1381829c6cfd8b0065a31aed84a..75720275ce37380fe815534ffce46e6c078752a1 100644 (file)
@@ -1227,13 +1227,17 @@ ath_vap_create(struct ieee80211com *ic, const char *name,
        case IEEE80211_M_STA:   /* ap+sta for repeater application */
                if (sc->sc_nstavaps != 0)  /* only one sta regardless */
                        return NULL;
-               if ((sc->sc_nvaps != 0) && (!(flags & IEEE80211_NO_STABEACONS)))
-                       return NULL;   /* If using station beacons, must first up */
-               if (flags & IEEE80211_NO_STABEACONS) {
+               /* If we already have an AP VAP, we can still add a station VAP
+                * but we must not attempt to re-use the hardware beacon timers
+                * since the AP is already using them, and we must stay in AP 
+                * opmode. */
+               if (sc->sc_nvaps != 0) {
+                       flags |= IEEE80211_USE_SW_BEACON_TIMERS;
                        sc->sc_nostabeacons = 1;
                        ic_opmode = IEEE80211_M_HOSTAP; /* Run with chip in AP mode */
-               } else
+               } else {
                        ic_opmode = opmode;
+               }
                break;
        case IEEE80211_M_IBSS:
                if ((sc->sc_nvaps != 0) && (ic->ic_opmode == IEEE80211_M_STA))
index 4492a3b343c0a480271e1412b0e056da55eb5242..0f3815ae8fec25c326478671795a77455d30fa4c 100644 (file)
@@ -454,7 +454,7 @@ ieee80211_vap_setup(struct ieee80211com *ic, struct net_device *dev,
        switch (opmode) {
        case IEEE80211_M_STA:
                /* WDS/Repeater */
-               if (flags & IEEE80211_NO_STABEACONS)
+               if (flags & IEEE80211_USE_SW_BEACON_TIMERS)
                        vap->iv_flags_ext |= IEEE80211_FEXT_SWBMISS;
                break;
        case IEEE80211_M_IBSS:
index 992f27c2d0a09d417da9397f601b9ffd725eaa9e..484b7039c26db64877a5992e0324ade1c41857ad 100644 (file)
@@ -658,8 +658,8 @@ struct ieee80211_clone_params {
        char icp_name[IFNAMSIZ];                /* device name */
        u_int16_t icp_opmode;                   /* operating mode */
        u_int16_t icp_flags;                    /* see below */
-#define        IEEE80211_CLONE_BSSID   0x0001          /* allocate unique mac/bssid */
-#define        IEEE80211_NO_STABEACONS 0x0002          /* Do not setup the station beacon timers */
+#define        IEEE80211_CLONE_BSSID           0x0001  /* allocate unique mac/bssid */
+#define        IEEE80211_USE_SW_BEACON_TIMERS  0x0002  /* Do not setup the station beacon timers */
 };
 
 /* APPIEBUF related definitions */
index 128fdaba50f5390dfc747edf7d8092ef8c9ac5b8..ac721997f15b36ac66ffca76c3485bebc83d60b6 100644 (file)
@@ -18,7 +18,7 @@ underlying base device which is created when the driver is loaded.
 .PP
 .SH "ARGUMENTS"
 .TP
-.B <vap> create [nounit] wlandev <base device> wlanmode <mode> [bssid|-bssid] [nosbeacon]
+.B <vap> create [nounit] wlandev <base device> wlanmode <mode> [uniquebssid]
 Create the interface <vap> using the specified <base device> and <mode>. <vap> can either be a full interface name (e.g. 'ath0'), or just the suffix (e.g. 'ath'), in which case, the kernel will automatically append the next vacant integer. [nounit] will turn off the automatic integer increments.
 .TP
 .B <vap> destroy
@@ -49,14 +49,17 @@ Create the station in WDS mode.
 .PP
 .SH "OPTIONS"
 .TP
+.B uniquebssid
+Create the VAP using a new unique MAC address, different from the underlying device.
+.TP
 .B bssid
-Create the VAP using a different MAC address from the underlying device.
+Synonym for uniquebssid, for backward compatibility.
 .TP
 .B \-bssid
-Create the VAP using the MAC address of the underlying device.
-.TP 
+Ignored for backward compatibility.
+.TP
 .B nosbeacon
-When both station VAPS and AP VAPs coexist, the station should be created with the nosbeacon flag set in order to disable the use of hardware beacon times for the station.
+Ignored for backward compatibility.
 .PP
 .SH "LIST ITEMS"
 .TP
index cb6d6f1a0d48bd47084b6f0c8b9081d16628b3f0..179855afe94a8a1bebf22e493040ea0bec65c369 100644 (file)
@@ -284,7 +284,7 @@ static void
 usage(void)
 {
        fprintf(stderr, "usage: wlanconfig athX create [nounit] wlandev wifiY\n");
-       fprintf(stderr, "            wlanmode [sta|adhoc|ap|monitor|wds|ahdemo] [bssid | -bssid] [nosbeacon]\n");
+       fprintf(stderr, "            wlanmode [sta|adhoc|ap|monitor|wds|ahdemo] [uniquebssid]\n");
        fprintf(stderr, "usage: wlanconfig athX destroy\n");
        fprintf(stderr, "usage: wlanconfig athX list [active|ap|caps|chan|freq|keys|scan|sta|wme]\n");
        exit(-1);
@@ -318,10 +318,16 @@ getflag(const char  *s)
        int flag = 0;
 
        cp = (s[0] == '-' ? s + 1 : s);
-       if (strcmp(cp, "bssid") == 0)
+       if (strcmp(cp, "bssid") == 0) {
+               printf("WARNING: the -bssid and bssid flags are deprecated.\n");
                flag = IEEE80211_CLONE_BSSID;
-       if (strcmp(cp, "nosbeacon") == 0)
-               flag |= IEEE80211_NO_STABEACONS;
+       }
+       if (strcmp(cp, "uniquebssid") == 0)
+               flag = IEEE80211_CLONE_BSSID;
+       if (strcmp(cp, "nosbeacon") == 0) {
+               printf("WARNING: the nosbeacon flag has been deprecated.\n");
+               return 0; /* deprecated but skip */
+       }
        if (flag == 0)
                errx(1, "unknown create option %s", s);
        return (s[0] == '-' ? -flag : flag);