Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Add utility routine ieee80211_get_rate().



details:   https://anonhg.NetBSD.org/src/rev/942078c9b7a8
branches:  trunk
changeset: 547110:942078c9b7a8
user:      dyoung <dyoung%NetBSD.org@localhost>
date:      Tue May 13 09:31:56 2003 +0000

description:
Add utility routine ieee80211_get_rate().

diffstat:

 sys/net/if_ieee80211.h     |   3 ++-
 sys/net/if_ieee80211subr.c |  18 ++++++++++++++++--
 2 files changed, 18 insertions(+), 3 deletions(-)

diffs (56 lines):

diff -r e7ae33cf9a5f -r 942078c9b7a8 sys/net/if_ieee80211.h
--- a/sys/net/if_ieee80211.h    Tue May 13 09:22:31 2003 +0000
+++ b/sys/net/if_ieee80211.h    Tue May 13 09:31:56 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ieee80211.h,v 1.29 2003/05/13 09:22:31 dyoung Exp $ */
+/*     $NetBSD: if_ieee80211.h,v 1.30 2003/05/13 09:31:56 dyoung Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -598,6 +598,7 @@
 void   ieee80211_watchdog(struct ifnet *);
 void   ieee80211_next_scan(struct ifnet *);
 void   ieee80211_end_scan(struct ifnet *);
+int    ieee80211_get_rate(struct ieee80211com *);
 struct ieee80211_node *ieee80211_alloc_node(struct ieee80211com *, u_int8_t *,
     int);
 struct ieee80211_node *ieee80211_find_node(struct ieee80211com *, u_int8_t *);
diff -r e7ae33cf9a5f -r 942078c9b7a8 sys/net/if_ieee80211subr.c
--- a/sys/net/if_ieee80211subr.c        Tue May 13 09:22:31 2003 +0000
+++ b/sys/net/if_ieee80211subr.c        Tue May 13 09:31:56 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ieee80211subr.c,v 1.27 2003/05/13 09:22:31 dyoung Exp $     */
+/*     $NetBSD: if_ieee80211subr.c,v 1.28 2003/05/13 09:31:56 dyoung Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ieee80211subr.c,v 1.27 2003/05/13 09:22:31 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ieee80211subr.c,v 1.28 2003/05/13 09:31:56 dyoung Exp $");
 
 #include "opt_inet.h"
 #include "bpfilter.h"
@@ -1301,6 +1301,20 @@
                ieee80211_new_state(ifp, IEEE80211_S_AUTH, -1);
 }
 
+int
+ieee80211_get_rate(struct ieee80211com *ic)
+{
+       int rate;
+       if (ic->ic_fixed_rate == -1) {
+               if (ic->ic_state == IEEE80211_S_RUN)
+                       rate = ic->ic_bss.ni_rates[ic->ic_bss.ni_txrate];
+               else
+                       rate = 0;
+       } else
+               rate = ic->ic_sup_rates[ic->ic_fixed_rate];
+       return rate & IEEE80211_RATE_VAL;
+}
+
 struct ieee80211_node *
 ieee80211_alloc_node(struct ieee80211com *ic, u_int8_t *macaddr, int copy)
 {



Home | Main Index | Thread Index | Old Index