PERFORCE change 138850 for review
Sam Leffler
sam at FreeBSD.org
Fri Mar 28 12:25:32 PDT 2008
http://perforce.freebsd.org/chv.cgi?CH=138850
Change 138850 by sam at sam_ebb on 2008/03/28 19:25:21
o add promisc mode driver callback
o when calculating the rx filter honor IFF_PROMISC directly
as net80211 now filters out settings for ap mode vaps
o automatically enable promiscuous mode when operating in
monitor mode (otherwise we won't see many frames as the
device will drop most frames for mismatched bssid)
Affected files ...
.. //depot/projects/vap/sys/dev/ath/if_ath.c#52 edit
Differences ...
==== //depot/projects/vap/sys/dev/ath/if_ath.c#52 (text+ko) ====
@@ -143,6 +143,7 @@
static void ath_key_update_begin(struct ieee80211vap *);
static void ath_key_update_end(struct ieee80211vap *);
static void ath_update_mcast(struct ifnet *);
+static void ath_update_promisc(struct ifnet *);
static void ath_mode_init(struct ath_softc *);
static void ath_setslottime(struct ath_softc *);
static void ath_updateslot(struct ifnet *);
@@ -627,6 +628,7 @@
ic->ic_vap_delete = ath_vap_delete;
ic->ic_raw_xmit = ath_raw_xmit;
ic->ic_update_mcast = ath_update_mcast;
+ ic->ic_update_promisc = ath_update_promisc;
ic->ic_node_alloc = ath_node_alloc;
sc->sc_node_free = ic->ic_node_free;
ic->ic_node_free = ath_node_free;
@@ -2455,7 +2457,9 @@
* of sight and we need to blindly preserve them
* o probe request frames are accepted only when operating in
* hostap, adhoc, or monitor modes
- * o enable promiscuous mode according to the interface state
+ * o enable promiscuous mode
+ * - when in monitor mode
+ * - if interface marked PROMISC (assumes bridge setting is filtered)
* o accept beacons:
* - when operating in station mode for collecting rssi data when
* the station is otherwise quiet, or
@@ -2463,7 +2467,7 @@
* node table entries for peers,
* - when scanning
* - when doing s/w beacon miss (e.g. for ap+sta)
- * - when operatin in ap mode in 11g to detect overlapping bss that
+ * - when operating in ap mode in 11g to detect overlapping bss that
* require protection
* o accept control frames:
* - when in monitor mode
@@ -2489,11 +2493,8 @@
#endif
if (ic->ic_opmode != IEEE80211_M_STA)
rfilt |= HAL_RX_FILTER_PROBEREQ;
- if (ic->ic_opmode != IEEE80211_M_HOSTAP &&
- (ifp->if_flags & IFF_PROMISC))
+ if (ic->ic_opmode == IEEE80211_M_MONITOR || (ifp->if_flags & IFF_PROMISC))
rfilt |= HAL_RX_FILTER_PROM;
- if (ifp->if_flags & IFF_PPROMISC)
- rfilt |= HAL_RX_FILTER_PROM;
if (ic->ic_opmode == IEEE80211_M_STA ||
sc->sc_opmode == HAL_M_IBSS ||
sc->sc_swbmiss || sc->sc_scanning)
@@ -2508,10 +2509,25 @@
rfilt |= HAL_RX_FILTER_BEACON;
if (ic->ic_opmode == IEEE80211_M_MONITOR)
rfilt |= HAL_RX_FILTER_CONTROL;
+ DPRINTF(sc, ATH_DEBUG_MODE, "%s: RX filter 0x%x, %s if_flags 0x%x\n",
+ __func__, rfilt, ieee80211_opmode_name[ic->ic_opmode], ifp->if_flags);
return rfilt;
}
static void
+ath_update_promisc(struct ifnet *ifp)
+{
+ struct ath_softc *sc = ifp->if_softc;
+ u_int32_t rfilt;
+
+ /* configure rx filter */
+ rfilt = ath_calcrxfilter(sc);
+ ath_hal_setrxfilter(sc->sc_ah, rfilt);
+
+ DPRINTF(sc, ATH_DEBUG_MODE, "%s: RX filter 0x%x\n", __func__, rfilt);
+}
+
+static void
ath_update_mcast(struct ifnet *ifp)
{
struct ath_softc *sc = ifp->if_softc;
@@ -2558,7 +2574,6 @@
/* configure rx filter */
rfilt = ath_calcrxfilter(sc);
ath_hal_setrxfilter(ah, rfilt);
- DPRINTF(sc, ATH_DEBUG_MODE, "%s: RX filter 0x%x\n", __func__, rfilt);
/* configure operational mode */
ath_hal_setopmode(ah);
More information about the p4-projects
mailing list