summaryrefslogtreecommitdiffstats
path: root/sys/net80211
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2005-07-22 16:50:18 +0000
committersam <sam@FreeBSD.org>2005-07-22 16:50:18 +0000
commit3876d0ac68eed6f2676486ce047b20f7cb8f3520 (patch)
treefca8cfc4073f63287b1f51121bcf1c74ccdcdeb7 /sys/net80211
parent0ad70d5aa7fbb8f1837a75c1bf95f85475e1b1ba (diff)
downloadFreeBSD-src-3876d0ac68eed6f2676486ce047b20f7cb8f3520.zip
FreeBSD-src-3876d0ac68eed6f2676486ce047b20f7cb8f3520.tar.gz
diff reduction against p4: define IEEE80211_FIXED_RATE_NONE and use
it instead of -1
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211.c2
-rw-r--r--sys/net80211/ieee80211_ioctl.c4
-rw-r--r--sys/net80211/ieee80211_proto.c5
-rw-r--r--sys/net80211/ieee80211_var.h2
4 files changed, 8 insertions, 5 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
index b25f047..ea75fa0 100644
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -665,7 +665,7 @@ ieee80211_media_status(struct ifnet *ifp, struct ifmediareq *imr)
/*
* Calculate a current rate if possible.
*/
- if (ic->ic_fixed_rate != -1) {
+ if (ic->ic_fixed_rate != IEEE80211_FIXED_RATE_NONE) {
/*
* A fixed rate is set, report that.
*/
diff --git a/sys/net80211/ieee80211_ioctl.c b/sys/net80211/ieee80211_ioctl.c
index 83ac126..017c927 100644
--- a/sys/net80211/ieee80211_ioctl.c
+++ b/sys/net80211/ieee80211_ioctl.c
@@ -273,7 +273,7 @@ ieee80211_cfgget(struct ieee80211com *ic, u_long cmd, caddr_t data)
wreq.wi_len = IEEE80211_ADDR_LEN / 2;
break;
case WI_RID_TX_RATE:
- if (ic->ic_fixed_rate == -1)
+ if (ic->ic_fixed_rate == IEEE80211_FIXED_RATE_NONE)
wreq.wi_val[0] = 0; /* auto */
else
wreq.wi_val[0] = htole16(
@@ -592,7 +592,7 @@ ieee80211_cfgset(struct ieee80211com *ic, u_long cmd, caddr_t data)
return EINVAL;
if (wreq.wi_val[0] == 0) {
/* auto */
- ic->ic_fixed_rate = -1;
+ ic->ic_fixed_rate = IEEE80211_FIXED_RATE_NONE;
break;
}
rate = 2 * le16toh(wreq.wi_val[0]);
diff --git a/sys/net80211/ieee80211_proto.c b/sys/net80211/ieee80211_proto.c
index 168f410..0fe4574 100644
--- a/sys/net80211/ieee80211_proto.c
+++ b/sys/net80211/ieee80211_proto.c
@@ -100,7 +100,7 @@ ieee80211_proto_attach(struct ieee80211com *ic)
ic->ic_rtsthreshold = IEEE80211_RTS_MAX;
#endif
ic->ic_fragthreshold = 2346; /* XXX not used yet */
- ic->ic_fixed_rate = -1; /* no fixed rate */
+ ic->ic_fixed_rate = IEEE80211_FIXED_RATE_NONE;
ic->ic_protmode = IEEE80211_PROT_CTSONLY;
ic->ic_roaming = IEEE80211_ROAMING_AUTO;
@@ -335,7 +335,8 @@ ieee80211_fix_rate(struct ieee80211com *ic, struct ieee80211_node *ni, int flags
* If the fixed rate check was requested but no
* fixed has been defined then just remove it.
*/
- if ((flags & IEEE80211_F_DOFRATE) && ic->ic_fixed_rate < 0)
+ if ((flags & IEEE80211_F_DOFRATE) &&
+ ic->ic_fixed_rate == IEEE80211_FIXED_RATE_NONE)
flags &= ~IEEE80211_F_DOFRATE;
error = 0;
okrate = badrate = fixedrate = 0;
diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h
index 1c34e78..d4959af 100644
--- a/sys/net80211/ieee80211_var.h
+++ b/sys/net80211/ieee80211_var.h
@@ -72,6 +72,8 @@
#define IEEE80211_PS_SLEEP 0x1 /* STA is in power saving mode */
#define IEEE80211_PS_MAX_QUEUE 50 /* maximum saved packets */
+#define IEEE80211_FIXED_RATE_NONE -1
+
#define IEEE80211_MS_TO_TU(x) (((x) * 1000) / 1024)
#define IEEE80211_TU_TO_MS(x) (((x) * 1024) / 1000)
OpenPOWER on IntegriCloud