commit 316fc03fe784c48140839968fd2c6fc7bb8b714a Author: Jiri Slaby Date: Thu Jul 19 08:25:15 2007 +0200 promisc diff --git a/ath.c b/ath.c index 92090f1..fedc3c3 100644 --- a/ath.c +++ b/ath.c @@ -456,18 +456,18 @@ next: static u32 ath_calcrxfilter(struct ath_softc *sc) { struct ath_hw *ah = sc->ah; + unsigned int opmode = IEEE80211_IF_TYPE_STA; u32 rfilt; rfilt = (ath5k_hw_get_rx_filter(ah) & AR5K_RX_FILTER_PHYERR) | AR5K_RX_FILTER_UCAST | AR5K_RX_FILTER_BCAST | AR5K_RX_FILTER_MCAST | AR5K_RX_FILTER_RADARERR; -#ifdef BLE - if (opmode != IEEE80211_M_STA && opmode != IEEE80211_M_AHDEMO) + + if (opmode != IEEE80211_IF_TYPE_STA) rfilt |= AR5K_RX_FILTER_PROBEREQ; - if (opmode != IEEE80211_M_HOSTAP && (dev->flags & IFF_PROMISC)) + if (opmode != IEEE80211_IF_TYPE_AP && sc->promisc) rfilt |= AR5K_RX_FILTER_PROM; - if (opmode == IEEE80211_M_STA || opmode == IEEE80211_M_IBSS || state == IEEE80211_S_SCAN) -#endif + if (opmode == IEEE80211_IF_TYPE_STA || opmode == IEEE80211_IF_TYPE_IBSS) rfilt |= AR5K_RX_FILTER_BEACON; return rfilt; @@ -1068,6 +1068,20 @@ static int ath_config(struct ieee80211_hw *hw, struct ieee80211_conf *conf) return ath_chan_set(sc, conf->chan); } +static void ath_set_multicast_list(struct ieee80211_hw *hw, + unsigned short flags, int mc_count) +{ + struct ath_softc *sc = hw->priv; + unsigned int prom = !!(flags & IFF_PROMISC); + u32 rfilt; + + if (sc->promisc != prom) { + sc->promisc = prom; + rfilt = ath_calcrxfilter(sc); + ath5k_hw_set_rx_filter(sc->ah, rfilt); + } +} + static int ath_set_key(struct ieee80211_hw *hw, set_key_cmd cmd, u8 *addr, struct ieee80211_key_conf *key, int aid) { @@ -1159,6 +1173,7 @@ static struct ieee80211_ops ath_hw_ops = { .remove_interface = NULL, .config = ath_config, .config_interface = NULL, + .set_multicast_list = ath_set_multicast_list, .set_key = ath_set_key, .get_stats = ath_get_stats, .conf_tx = NULL, diff --git a/ath.h b/ath.h index b496893..45b3a9f 100644 --- a/ath.h +++ b/ath.h @@ -148,6 +148,7 @@ struct ath_softc { #endif unsigned int invalid : 1, /* disable hardware accesses */ mrretry : 1, /* multi-rate retry support */ + promisc : 1, xxx:1; #ifdef BLE sc_splitmic: 1, /* split TKIP MIC keys */ diff --git a/ath5k_hw.c b/ath5k_hw.c index 4cfafc8..096f267 100644 --- a/ath5k_hw.c +++ b/ath5k_hw.c @@ -2723,8 +2723,7 @@ ath5k_hw_get_rx_filter(struct ath_hw *ah) /* * Set rx filter */ -void -ath5k_hw_set_rx_filter(struct ath_hw *ah, u32 filter) +void ath5k_hw_set_rx_filter(struct ath_hw *ah, u32 filter) { u32 data = 0;