Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Mar 2008 19:25:30 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 138850 for review
Message-ID:  <200803281925.m2SJPUEi012211@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=138850

Change 138850 by sam@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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803281925.m2SJPUEi012211>