diff options
author | sam <sam@FreeBSD.org> | 2005-07-26 06:00:33 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2005-07-26 06:00:33 +0000 |
commit | a170f832790ec010bcb2af3b98ee13b4a04b301c (patch) | |
tree | 16f256d14cb44a80aa3722f15f07c538c9a9b275 /sbin/ifconfig | |
parent | 381391f129e838b6d7cfb4fe833283bddad26522 (diff) | |
download | FreeBSD-src-a170f832790ec010bcb2af3b98ee13b4a04b301c.zip FreeBSD-src-a170f832790ec010bcb2af3b98ee13b4a04b301c.tar.gz |
o add fragthreshold support now that the ioctl exists
o accept rtsthreshold - (or any) as a shorthand for rtsthreshold 2346
MFC after: 3 days
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r-- | sbin/ifconfig/ifieee80211.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 7e51bf4..a32a2ab 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -344,7 +344,8 @@ set80211nwkey(const char *val, int d, int s, const struct afswtch *rafp) static void set80211rtsthreshold(const char *val, int d, int s, const struct afswtch *rafp) { - set80211(s, IEEE80211_IOC_RTSTHRESHOLD, atoi(val), 0, NULL); + set80211(s, IEEE80211_IOC_RTSTHRESHOLD, + isundefarg(val) ? IEEE80211_RTS_MAX : atoi(val), 0, NULL); } static void @@ -624,6 +625,13 @@ set80211pureg(const char *val, int d, int s, const struct afswtch *rafp) set80211(s, IEEE80211_IOC_PUREG, d, 0, NULL); } +static +DECL_CMD_FUNC(set80211fragthreshold, val, d) +{ + set80211(s, IEEE80211_IOC_FRAGTHRESHOLD, + isundefarg(val) ? IEEE80211_FRAG_MAX : atoi(val), 0, NULL); +} + static int getmaxrate(uint8_t rates[15], uint8_t nrates) { @@ -1509,6 +1517,12 @@ ieee80211_status(int s) LINE_CHECK("%crtsthreshold %d", spacer, ireq.i_val); } + ireq.i_type = IEEE80211_IOC_FRAGTHRESHOLD; + if (ioctl(s, SIOCG80211, &ireq) != -1) { + if (ireq.i_val != IEEE80211_FRAG_MAX || verbose) + LINE_CHECK("%cfragthreshold %d", spacer, ireq.i_val); + } + if (IEEE80211_IS_CHAN_G(c) || IEEE80211_IS_CHAN_PUREG(c) || verbose) { ireq.i_type = IEEE80211_IOC_PUREG; if (ioctl(s, SIOCG80211, &ireq) != -1) { @@ -1805,6 +1819,7 @@ static struct cmd ieee80211_cmds[] = { #endif DEF_CMD("pureg", 1, set80211pureg), DEF_CMD("-pureg", 0, set80211pureg), + DEF_CMD_ARG("fragthreshold", set80211fragthreshold), }; static struct afswtch af_ieee80211 = { .af_name = "af_ieee80211", |