aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Leffler <sam@FreeBSD.org>2005-06-09 04:05:43 +0000
committerSam Leffler <sam@FreeBSD.org>2005-06-09 04:05:43 +0000
commita634d6a78846e4ed939933396d3c656041bb47a8 (patch)
tree7bbeea8754dcdb767e9352855cb33596b423cd03
parent386ea9321d898386a19fbdeb0f6bd546a9ec6c1c (diff)
Notes
-rw-r--r--sys/net80211/ieee80211_input.c19
-rw-r--r--sys/net80211/ieee80211_node.h2
-rw-r--r--sys/net80211/ieee80211_var.h3
3 files changed, 21 insertions, 3 deletions
diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c
index e1aaa4b03ed2e..9f648f6fa9978 100644
--- a/sys/net80211/ieee80211_input.c
+++ b/sys/net80211/ieee80211_input.c
@@ -1681,7 +1681,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
switch (subtype) {
case IEEE80211_FC0_SUBTYPE_PROBE_RESP:
case IEEE80211_FC0_SUBTYPE_BEACON: {
- u_int8_t *tstamp, *country;
+ u_int8_t *tstamp, *country, *tim;
u_int8_t chan, bchan, fhindex, erp;
u_int16_t capinfo, bintval, timoff;
u_int16_t fhdwell;
@@ -1718,7 +1718,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
tstamp = frm; frm += 8;
bintval = le16toh(*(u_int16_t *)frm); frm += 2;
capinfo = le16toh(*(u_int16_t *)frm); frm += 2;
- ssid = rates = xrates = country = wpa = wme = NULL;
+ ssid = rates = xrates = country = wpa = wme = tim = NULL;
bchan = ieee80211_chan2ieee(ic, ic->ic_bss->ni_chan);
chan = bchan;
fhdwell = 0;
@@ -1753,6 +1753,7 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
break;
case IEEE80211_ELEMID_TIM:
/* XXX ATIM? */
+ tim = frm;
timoff = frm - mtod(m0, u_int8_t *);
break;
case IEEE80211_ELEMID_IBSSPARMS:
@@ -1871,6 +1872,13 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
if (wme != NULL &&
ieee80211_parse_wmeparams(ic, wme, wh) > 0)
ieee80211_wme_updateparams(ic);
+ if (tim != NULL) {
+ struct ieee80211_tim_ie *ie =
+ (struct ieee80211_tim_ie *) tim;
+
+ ni->ni_dtim_count = ie->tim_count;
+ ni->ni_dtim_period = ie->tim_period;
+ }
/* NB: don't need the rest of this */
if ((ic->ic_flags & IEEE80211_F_SCAN) == 0)
return;
@@ -1931,6 +1939,13 @@ ieee80211_recv_mgmt(struct ieee80211com *ic, struct mbuf *m0,
ni->ni_fhdwell = fhdwell;
ni->ni_fhindex = fhindex;
ni->ni_erp = erp;
+ if (tim != NULL) {
+ struct ieee80211_tim_ie *ie =
+ (struct ieee80211_tim_ie *) tim;
+
+ ni->ni_dtim_count = ie->tim_count;
+ ni->ni_dtim_period = ie->tim_period;
+ }
/*
* Record the byte offset from the mac header to
* the start of the TIM information element for
diff --git a/sys/net80211/ieee80211_node.h b/sys/net80211/ieee80211_node.h
index 5e3b8c27cee59..9c8079996b911 100644
--- a/sys/net80211/ieee80211_node.h
+++ b/sys/net80211/ieee80211_node.h
@@ -136,6 +136,8 @@ struct ieee80211_node {
u_int8_t ni_fhindex; /* FH only */
u_int8_t ni_erp; /* ERP from beacon/probe resp */
u_int16_t ni_timoff; /* byte offset to TIM ie */
+ u_int8_t ni_dtim_period; /* DTIM period */
+ u_int8_t ni_dtim_count; /* DTIM count for last bcn */
/* others */
int ni_fails; /* failure count to associate */
diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h
index 3f19d86ee2073..f4cfb3e9593e7 100644
--- a/sys/net80211/ieee80211_var.h
+++ b/sys/net80211/ieee80211_var.h
@@ -125,7 +125,8 @@ struct ieee80211com {
u_int16_t ic_ps_pending; /* ps sta's w/ pending frames */
u_int8_t *ic_tim_bitmap; /* power-save stations w/ data*/
u_int16_t ic_tim_len; /* ic_tim_bitmap size (bytes) */
- u_int16_t ic_dtim_period; /* DTIM period */
+ u_int8_t ic_dtim_period; /* DTIM period */
+ u_int8_t ic_dtim_count; /* DTIM count for last bcn */
struct ifmedia ic_media; /* interface media config */
struct bpf_if *ic_rawbpf; /* packet filter structure */
struct ieee80211_node *ic_bss; /* information for this node */