diff options
author | sam <sam@FreeBSD.org> | 2009-01-08 17:12:47 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2009-01-08 17:12:47 +0000 |
commit | 98ad45c3d3f257c3649d4e198723267231203184 (patch) | |
tree | 6038542738398db4d8d4a8e36ed50ac642a506ac /sbin | |
parent | 6f4df3b74deeeb200dfc7f23a8344f50eb34942c (diff) | |
download | FreeBSD-src-98ad45c3d3f257c3649d4e198723267231203184.zip FreeBSD-src-98ad45c3d3f257c3649d4e198723267231203184.tar.gz |
TDMA support for long distance point-to-point links using ath devices:
o add net80211 support for a tdma vap that is built on top of the
existing adhoc-demo support
o add tdma scheduling of frame transmission to the ath driver; it's
conceivable other devices might be capable of this too in which case
they can make use of the 802.11 protocol additions etc.
o add minor bits to user tools that need to know: ifconfig to setup and
configure, new statistics in athstats, and new debug mask bits
While the architecture can support >2 slots in a TDMA BSS the current
design is intended (and tested) for only 2 slots.
Sponsored by: Intel
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ifconfig/ifconfig.8 | 62 | ||||
-rw-r--r-- | sbin/ifconfig/ifieee80211.c | 71 |
2 files changed, 129 insertions, 4 deletions
diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index debe746..d27bed8 100644 --- a/sbin/ifconfig/ifconfig.8 +++ b/sbin/ifconfig/ifconfig.8 @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd October 19, 2008 +.Dd January 7, 2009 .Dt IFCONFIG 8 .Os .Sh NAME @@ -610,9 +610,15 @@ is one of (or .Cm hostap ), .Cm wds , +.Cm tdma , and .Cm monitor . The operating mode of a cloned interface cannot be changed. +The +.Cm tdma +mode is actually implemented as an +.Cm adhoc-demo +interface with special properties. .It Cm wlanbssid Ar bssid The 802.11 mac address to use for the bssid. This must be specified at create time for a legacy @@ -1530,6 +1536,60 @@ hexadecimal when preceded by .Ql 0x . Additionally, the SSID may be cleared by setting it to .Ql - . +.It Cm tdmaslot Ar slot +When operating with TDMA, use the specified +.Ar slot +configuration. +The +.Ar slot +is a number between 0 and the maximum number of slots in the BSS. +Note that a station configured as slot 0 is a master and +will broadcast beacon frames advertising the BSS; +stations configured to use other slots will always +scan to locate a master before they ever transmit. +By default +.Cm tdmaslot +is set to 1. +.It Cm tdmaslotcnt Ar cnt +When operating with TDMA, setup a BSS with +.Ar cnt +slots. +The slot count may be at most 8. +The current implementation is only tested with two stations +(i.e. point to point applications). +This setting is only meaningful when a station is configured as slot 0; +other stations adopt this setting from the BSS they join. +By default +.Cm tdmaslotcnt +is set to 2. +.It Cm tdmaslotlen Ar len +When operating with TDMA, setup a BSS such that each station has a slot +.Ar len +microseconds long. +The slot length must be at least 150 microseconds (1/8 TU) +and no more than 65 milliseconds. +Note that setting too small a slot length may result in poor channel +bandwidth utilization due to factors such as timer granularity and +guard time. +This setting is only meaningful when a station is configured as slot 0; +other stations adopt this setting from the BSS they join. +By default +.Cm tdmaslotlen +is set to 10 milliseconds. +.It Cm tdmabintval Ar intval +When operating with TDMA, setup a BSS such that beacons are transmitted every +.Ar intval +superframes to synchronize the TDMA slot timing. +A superframe is defined as the number of slots times the slot length; e.g. +a BSS with two slots of 10 milliseconds has a 20 millisecond superframe. +The beacon interval may not be zero. +A lower setting of +.Cm tdmabintval +causes the timers to be resynchronized more often; this can be help if +significant timer drift is observed. +By default +.Cm tdmabintval +is set to 5. .It Cm tsn When operating as an access point with WPA/802.11i allow legacy stations to associate using static key WEP and open authentication. diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index d496644..1ea7bf6 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -1711,6 +1711,30 @@ set80211rifs(const char *val, int d, int s, const struct afswtch *rafp) set80211(s, IEEE80211_IOC_RIFS, d, 0, NULL); } +static +DECL_CMD_FUNC(set80211tdmaslot, val, d) +{ + set80211(s, IEEE80211_IOC_TDMA_SLOT, atoi(val), 0, NULL); +} + +static +DECL_CMD_FUNC(set80211tdmaslotcnt, val, d) +{ + set80211(s, IEEE80211_IOC_TDMA_SLOTCNT, atoi(val), 0, NULL); +} + +static +DECL_CMD_FUNC(set80211tdmaslotlen, val, d) +{ + set80211(s, IEEE80211_IOC_TDMA_SLOTLEN, atoi(val), 0, NULL); +} + +static +DECL_CMD_FUNC(set80211tdmabintval, val, d) +{ + set80211(s, IEEE80211_IOC_TDMA_BINTERVAL, atoi(val), 0, NULL); +} + static int regdomain_sort(const void *a, const void *b) { @@ -2558,6 +2582,22 @@ printwpsie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) #undef N } +static void +printtdmaie(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) +{ + printf("%s", tag); + if (verbose && ielen >= sizeof(struct ieee80211_tdma_param)) { + const struct ieee80211_tdma_param *tdma = + (const struct ieee80211_tdma_param *) ie; + + /* XXX tstamp */ + printf("<v%u slot:%u slotcnt:%u slotlen:%u bintval:%u inuse:0x%x>", + tdma->tdma_version, tdma->tdma_slot, tdma->tdma_slotcnt, + LE_READ_2(&tdma->tdma_slotlen), tdma->tdma_bintval, + tdma->tdma_inuse[0]); + } +} + /* * Copy the ssid string contents into buf, truncating to fit. If the * ssid is entirely printable then just copy intact. Otherwise convert @@ -2681,6 +2721,12 @@ isatherosoui(const u_int8_t *frm) } static __inline int +istdmaoui(const uint8_t *frm) +{ + return frm[1] > 3 && LE_READ_4(frm+2) == ((TDMA_OUI_TYPE<<24)|TDMA_OUI); +} + +static __inline int iswpsoui(const uint8_t *frm) { return frm[1] > 3 && LE_READ_4(frm+2) == ((WPS_OUI_TYPE<<24)|WPA_OUI); @@ -2749,6 +2795,8 @@ printies(const u_int8_t *vp, int ielen, int maxcols) printathie(" ATH", vp, 2+vp[1], maxcols); else if (iswpsoui(vp)) printwpsie(" WPS", vp, 2+vp[1], maxcols); + else if (istdmaoui(vp)) + printtdmaie(" TDMA", vp, 2+vp[1], maxcols); else if (verbose) printie(" VEN", vp, 2+vp[1], maxcols); break; @@ -3192,7 +3240,7 @@ list_keys(int s) "\20\1STA\7FF\10TURBOP\11IBSS\12PMGT" \ "\13HOSTAP\14AHDEMO\15SWRETRY\16TXPMGT\17SHSLOT\20SHPREAMBLE" \ "\21MONITOR\22DFS\30WPA1\31WPA2\32BURST\33WME\34WDS\36BGSCAN" \ - "\37TXFRAG" + "\37TXFRAG\40TDMA" #define IEEE80211_CRYPTO_BITS \ "\20\1WEP\2TKIP\3AES\4AES_CCM\5TKIPMIC\6CKIP\12PMGT" @@ -4263,7 +4311,16 @@ end: } } - if (get80211val(s, IEEE80211_IOC_BEACON_INTERVAL, &val) != -1) { + if (opmode == IEEE80211_M_AHDEMO) { + if (get80211val(s, IEEE80211_IOC_TDMA_SLOT, &val) != -1) + LINE_CHECK("tdmaslot %u", val); + if (get80211val(s, IEEE80211_IOC_TDMA_SLOTCNT, &val) != -1) + LINE_CHECK("tdmaslotcnt %u", val); + if (get80211val(s, IEEE80211_IOC_TDMA_SLOTLEN, &val) != -1) + LINE_CHECK("tdmaslotlen %u", val); + if (get80211val(s, IEEE80211_IOC_TDMA_BINTERVAL, &val) != -1) + LINE_CHECK("tdmabintval %u", val); + } else if (get80211val(s, IEEE80211_IOC_BEACON_INTERVAL, &val) != -1) { /* XXX default define not visible */ if (val != 100 || verbose) LINE_CHECK("bintval %u", val); @@ -4486,7 +4543,10 @@ DECL_CMD_FUNC(set80211clone_wlanmode, arg, d) params.icp_opmode = IEEE80211_M_WDS; else if (iseq(arg, "monitor")) params.icp_opmode = IEEE80211_M_MONITOR; - else + else if (iseq(arg, "tdma")) { + params.icp_opmode = IEEE80211_M_AHDEMO; + params.icp_flags |= IEEE80211_CLONE_TDMA; + } else errx(1, "Don't know to create %s for %s", arg, name); clone_setcallback(wlan_create); #undef iseq @@ -4662,6 +4722,11 @@ static struct cmd ieee80211_cmds[] = { /* XXX for testing */ DEF_CMD_ARG("chanswitch", set80211chanswitch), + DEF_CMD_ARG("tdmaslot", set80211tdmaslot), + DEF_CMD_ARG("tdmaslotcnt", set80211tdmaslotcnt), + DEF_CMD_ARG("tdmaslotlen", set80211tdmaslotlen), + DEF_CMD_ARG("tdmabintval", set80211tdmabintval), + /* vap cloning support */ DEF_CLONE_CMD_ARG("wlanaddr", set80211clone_wlanaddr), DEF_CLONE_CMD_ARG("wlanbssid", set80211clone_wlanbssid), |