diff options
author | sam <sam@FreeBSD.org> | 2004-04-02 23:25:39 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2004-04-02 23:25:39 +0000 |
commit | b024266b895c0a68076a0ede4910ffe39b7e258a (patch) | |
tree | 993e3d1529ff6a97bf28e206984714e0e08a3c61 /sys/net80211/ieee80211_output.c | |
parent | 5c586165c7b79b179b3583cb3d33b957f21edfdf (diff) | |
download | FreeBSD-src-b024266b895c0a68076a0ede4910ffe39b7e258a.zip FreeBSD-src-b024266b895c0a68076a0ede4910ffe39b7e258a.tar.gz |
fix adhoc/ibss operation for drivers that require host support (e.g. ath):
o remove IEEE80211_C_RCVMGT capability
o on transmit craft new nodes as needed using new ieee80211_find_txnode routine
o add ieee80211_find_txnode routine to lookup a node by mac address and
if not present create one when operating in ibss/ahdemo mode; new nodes
are dup'd from bss and the driver is told to treat the node as if a new
association has been created so driver-private state (e.g. rate control
handling) is setup
Obtained from: netbsd (basic idea)
Diffstat (limited to 'sys/net80211/ieee80211_output.c')
-rw-r--r-- | sys/net80211/ieee80211_output.c | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c index 6ea342d..3e144458 100644 --- a/sys/net80211/ieee80211_output.c +++ b/sys/net80211/ieee80211_output.c @@ -161,35 +161,13 @@ ieee80211_encap(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node **pni) } memcpy(&eh, mtod(m, caddr_t), sizeof(struct ether_header)); - if (ic->ic_opmode != IEEE80211_M_STA) { - ni = ieee80211_find_node(ic, eh.ether_dhost); - if (ni == NULL) { - /* - * When not in station mode the destination - * address should always be in the node table - * if the device sends management frames to us; - * unless this is a multicast/broadcast frame. - * For devices that don't send management frames - * to the host we have to cheat; use the bss - * node instead; the card will/should clobber - * the bssid address as necessary. - * - * XXX this handles AHDEMO because all devices - * that support it don't send mgmt frames; - * but it might be better to test explicitly - */ - if (!IEEE80211_IS_MULTICAST(eh.ether_dhost) && - (ic->ic_caps & IEEE80211_C_RCVMGT)) { - IEEE80211_DPRINTF(("%s: no node for dst %s, " - "discard frame\n", __func__, - ether_sprintf(eh.ether_dhost))); - ic->ic_stats.is_tx_nonode++; - goto bad; - } - ni = ic->ic_bss; - } - } else - ni = ic->ic_bss; + ni = ieee80211_find_txnode(ic, eh.ether_dhost); + if (ni == NULL) { + IEEE80211_DPRINTF(("%s: no node for dst %s, discard frame\n", + __func__, ether_sprintf(eh.ether_dhost))); + ic->ic_stats.is_tx_nonode++; + goto bad; + } ni->ni_inact = 0; m_adj(m, sizeof(struct ether_header) - sizeof(struct llc)); |