This patch cleans up the VAP creation API.

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
This commit is contained in:
mtaylor 2008-04-09 03:24:05 +00:00
parent 4be10b5ba8
commit 80c58504d7
5 changed files with 29 additions and 16 deletions

View 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))

View 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:

View 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 */

View 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

View 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);