update erp information element in the beacon frame to reflect

changes in the bss

Reviewed by:	avatar
Obtained from:	atheros
MFC after:	2 weeks
This commit is contained in:
Sam Leffler 2006-01-02 16:57:20 +00:00
parent 7ccd5d1178
commit 0912bac9b3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=153973
4 changed files with 21 additions and 4 deletions

View File

@ -2028,6 +2028,8 @@ ieee80211_node_join_11g(struct ieee80211com *ic, struct ieee80211_node *ni)
ic->ic_flags |= IEEE80211_F_USEBARKER;
ic->ic_flags &= ~IEEE80211_F_SHPREAMBLE;
}
if (ic->ic_nonerpsta == 1)
ic->ic_flags_ext |= IEEE80211_FEXT_ERPUPDATE;
} else
ni->ni_flags |= IEEE80211_NODE_ERP;
}
@ -2143,6 +2145,7 @@ ieee80211_node_leave_11g(struct ieee80211com *ic, struct ieee80211_node *ni)
ic->ic_flags |= IEEE80211_F_SHPREAMBLE;
ic->ic_flags &= ~IEEE80211_F_USEBARKER;
}
ic->ic_flags_ext |= IEEE80211_FEXT_ERPUPDATE;
}
}
}

View File

@ -1490,8 +1490,10 @@ ieee80211_beacon_alloc(struct ieee80211com *ic, struct ieee80211_node *ni,
}
if (ic->ic_flags & IEEE80211_F_WPA)
frm = ieee80211_add_wpa(frm, ic);
if (ic->ic_curmode == IEEE80211_MODE_11G)
if (ic->ic_curmode == IEEE80211_MODE_11G) {
bo->bo_erp = frm;
frm = ieee80211_add_erp(frm, ic);
}
efrm = ieee80211_add_xrates(frm, rs);
bo->bo_trailer_len = efrm - bo->bo_trailer;
m->m_pkthdr.len = m->m_len = efrm - mtod(m, u_int8_t *);
@ -1616,10 +1618,13 @@ ieee80211_beacon_update(struct ieee80211com *ic, struct ieee80211_node *ni,
}
if (timlen != bo->bo_tim_len) {
/* copy up/down trailer */
ovbcopy(bo->bo_trailer, tie->tim_bitmap+timlen,
int adjust = tie->tim_bitmap+timlen
- bo->bo_trailer;
ovbcopy(bo->bo_trailer, bo->bo_trailer+adjust,
bo->bo_trailer_len);
bo->bo_trailer = tie->tim_bitmap+timlen;
bo->bo_wme = bo->bo_trailer;
bo->bo_trailer += adjust;
bo->bo_wme += adjust;
bo->bo_erp += adjust;
bo->bo_tim_len = timlen;
/* update information element */
@ -1646,6 +1651,13 @@ ieee80211_beacon_update(struct ieee80211com *ic, struct ieee80211_node *ni,
tie->tim_bitctl |= 1;
else
tie->tim_bitctl &= ~1;
if (ic->ic_flags_ext & IEEE80211_FEXT_ERPUPDATE) {
/*
* ERP element needs updating.
*/
(void) ieee80211_add_erp(bo->bo_erp, ic);
ic->ic_flags_ext &= ~IEEE80211_FEXT_ERPUPDATE;
}
}
IEEE80211_BEACON_UNLOCK(ic);

View File

@ -237,6 +237,7 @@ struct ieee80211_beacon_offsets {
u_int8_t *bo_trailer; /* start of fixed-size trailer */
u_int16_t bo_tim_len; /* atim/dtim length in bytes */
u_int16_t bo_trailer_len; /* trailer length in bytes */
u_int8_t *bo_erp; /* start of ERP element */
};
struct mbuf *ieee80211_beacon_alloc(struct ieee80211com *,
struct ieee80211_node *, struct ieee80211_beacon_offsets *);

View File

@ -246,6 +246,7 @@ struct ieee80211com {
#define IEEE80211_FEXT_WDS 0x00000001 /* CONF: 4 addr allowed */
/* 0x00000006 reserved */
#define IEEE80211_FEXT_BGSCAN 0x00000008 /* STATUS: enable full bgscan completion */
#define IEEE80211_FEXT_ERPUPDATE 0x00000200 /* STATUS: update ERP element */
/* ic_caps */
#define IEEE80211_C_WEP 0x00000001 /* CAPABILITY: WEP available */