Use ieee80211_find_rxnode to attribute Rx packets to the write

ieee80211_node. This reduces code duplication.  It will help us
support passive scanning and rate adaptation.
This commit is contained in:
dyoung 2003-11-02 01:55:40 +00:00
parent 8647bce8c6
commit 76db6bfa8c
4 changed files with 12 additions and 34 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ath.c,v 1.13 2003/10/21 01:00:57 yamt Exp $ */
/* $NetBSD: ath.c,v 1.14 2003/11/02 01:55:40 dyoung Exp $ */
/*-
* Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
@ -41,7 +41,7 @@
__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.14 2003/09/05 22:22:49 sam Exp $");
#endif
#ifdef __NetBSD__
__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.13 2003/10/21 01:00:57 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.14 2003/11/02 01:55:40 dyoung Exp $");
#endif
/*
@ -2114,12 +2114,7 @@ ath_rx_proc(void *arg, int npending)
* something so we fall back to ic_bss when this frame
* is from an unknown sender.
*/
if (ic->ic_opmode != IEEE80211_M_STA) {
ni = ieee80211_find_node(ic, wh->i_addr2);
if (ni == NULL)
ni = ieee80211_ref_node(ic->ic_bss);
} else
ni = ieee80211_ref_node(ic->ic_bss);
ni = ieee80211_find_rxnode(ic, wh);
ATH_NODE(ni)->an_rx_antenna = ds->ds_rxstat.rs_antenna;
/*
* Send frame up for processing.

View File

@ -1,4 +1,4 @@
/* $NetBSD: atw.c,v 1.7 2003/10/25 21:32:44 christos Exp $ */
/* $NetBSD: atw.c,v 1.8 2003/11/02 01:55:40 dyoung Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.7 2003/10/25 21:32:44 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: atw.c,v 1.8 2003/11/02 01:55:40 dyoung Exp $");
#include "bpfilter.h"
@ -3065,12 +3065,7 @@ atw_rxintr(sc)
#endif /* NPBFILTER > 0 */
wh = mtod(m, struct ieee80211_frame *);
if (ic->ic_opmode != IEEE80211_M_STA) {
ni = ieee80211_find_node(ic, wh->i_addr2);
if (ni == NULL)
ni = ieee80211_ref_node(ic->ic_bss);
} else
ni = ieee80211_ref_node(ic->ic_bss);
ni = ieee80211_find_rxnode(ic, wh);
ieee80211_input(ifp, m, ni, rssi, 0);
/*
* The frame may have caused the node to be marked for

View File

@ -1,4 +1,4 @@
/* $NetBSD: awi.c,v 1.56 2003/10/30 01:58:17 simonb Exp $ */
/* $NetBSD: awi.c,v 1.57 2003/11/02 01:55:40 dyoung Exp $ */
/*-
* Copyright (c) 1999,2000,2001 The NetBSD Foundation, Inc.
@ -85,7 +85,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: awi.c,v 1.56 2003/10/30 01:58:17 simonb Exp $");
__KERNEL_RCSID(0, "$NetBSD: awi.c,v 1.57 2003/11/02 01:55:40 dyoung Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -1085,14 +1085,7 @@ awi_rx_int(struct awi_softc *sc)
goto rx_next;
}
wh = mtod(m, struct ieee80211_frame *);
if (ic->ic_opmode != IEEE80211_M_STA) {
ni = ieee80211_find_node(ic,
wh->i_addr2);
if (ni == NULL)
ni = ieee80211_ref_node(
ic->ic_bss);
} else
ni = ieee80211_ref_node(ic->ic_bss);
ni = ieee80211_find_rxnode(ic, wh);
ieee80211_input(ifp, m, ni, rssi, rstamp);
/*
* The frame may have caused the

View File

@ -1,4 +1,4 @@
/* $NetBSD: wi.c,v 1.142 2003/11/02 01:39:22 dyoung Exp $ */
/* $NetBSD: wi.c,v 1.143 2003/11/02 01:55:40 dyoung Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.142 2003/11/02 01:39:22 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: wi.c,v 1.143 2003/11/02 01:55:40 dyoung Exp $");
#define WI_HERMES_AUTOINC_WAR /* Work around data write autoinc bug. */
#define WI_HERMES_STATS_WAR /* Work around stats counter bug. */
@ -1307,12 +1307,7 @@ wi_rx_intr(struct wi_softc *sc)
if (ic->ic_opmode == IEEE80211_M_IBSS && dir == IEEE80211_FC1_DIR_NODS)
wi_sync_bssid(sc, wh->i_addr3);
if (ic->ic_opmode != IEEE80211_M_STA) {
ni = ieee80211_find_node(ic, wh->i_addr2);
if (ni == NULL)
ni = ieee80211_ref_node(ic->ic_bss);
} else
ni = ieee80211_ref_node(ic->ic_bss);
ni = ieee80211_find_rxnode(ic, wh);
ieee80211_input(ifp, m, ni, rssi, rstamp);