From 439b4702f3deb575aa1d707ca42b89ba438f459d Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Mon, 12 Dec 2005 19:23:55 +0000 Subject: [PATCH] add mcastrate support MFC after: 1 week --- sbin/ifconfig/ifconfig.8 | 8 +++++++- sbin/ifconfig/ifieee80211.c | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/sbin/ifconfig/ifconfig.8 b/sbin/ifconfig/ifconfig.8 index 70413dec7ed3..5f0853b4625f 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 1, 2005 +.Dd December 12, 2005 .Dt IFCONFIG 8 .Os .Sh NAME @@ -674,6 +674,12 @@ for examining parameters when WME mode is disabled. See the description of the .Cm wme directive for information on the various parameters. +.It Cm mcastrate Ar rate +Set the rate for transmitting multicast/broadcast frames. +Rates are specified as megabits/second in decimal; e.g. 5.5 for 5.5 Mb/s. +This rate should be valid for the current operating conditions; +if an invalid rate is specified drivers are free to chose an +appropriate rate. .It Cm powersave Enable powersave operation. When operating as a client, the station will conserve power by diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index b7c6a826cb37..eece245c22b0 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -662,6 +662,12 @@ set80211pureg(const char *val, int d, int s, const struct afswtch *rafp) set80211(s, IEEE80211_IOC_PUREG, d, 0, NULL); } +static +DECL_CMD_FUNC(set80211mcastrate, val, d) +{ + set80211(s, IEEE80211_IOC_MCAST_RATE, (int) 2*atof(val), 0, NULL); +} + static DECL_CMD_FUNC(set80211fragthreshold, val, d) { @@ -1613,6 +1619,17 @@ ieee80211_status(int s) LINE_CHECK("%crtsthreshold %d", spacer, ireq.i_val); } + ireq.i_type = IEEE80211_IOC_MCAST_RATE; + if (ioctl(s, SIOCG80211, &ireq) != -1) { + if (ireq.i_val != 2*1 || verbose) { + if (ireq.i_val == 11) + LINE_CHECK("%cmcastrate 5.5", spacer); + else + LINE_CHECK("%cmcastrate %d", spacer, + ireq.i_val/2); + } + } + ireq.i_type = IEEE80211_IOC_FRAGTHRESHOLD; if (ioctl(s, SIOCG80211, &ireq) != -1) { if (ireq.i_val != IEEE80211_FRAG_MAX || verbose) @@ -1913,6 +1930,7 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD_ARG("mac:kick", set80211kickmac), DEF_CMD("pureg", 1, set80211pureg), DEF_CMD("-pureg", 0, set80211pureg), + DEF_CMD_ARG("mcastrate", set80211mcastrate), DEF_CMD_ARG("fragthreshold", set80211fragthreshold), }; static struct afswtch af_ieee80211 = {