Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 194153
b: refs/heads/master
c: 0995d11
h: refs/heads/master
i:
  194151: cb561b4
v: v3
  • Loading branch information
Sujith authored and John W. Linville committed Mar 31, 2010
1 parent 9234e3d commit f8a8390
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 89 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0af26b278bc1d747370b451595b7586cb7b3455c
refs/heads/master: 0995d110118b35c0dc5195e3ddddcc0dec263830
82 changes: 0 additions & 82 deletions trunk/drivers/net/wireless/ath/ath9k/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,88 +303,6 @@ int ath9k_cmn_get_hw_crypto_keytype(struct sk_buff *skb)
}
EXPORT_SYMBOL(ath9k_cmn_get_hw_crypto_keytype);

/*
* Calculate the RX filter to be set in the HW.
*/
u32 ath9k_cmn_calcrxfilter(struct ieee80211_hw *hw, struct ath_hw *ah,
unsigned int rxfilter)
{
#define RX_FILTER_PRESERVE (ATH9K_RX_FILTER_PHYERR | ATH9K_RX_FILTER_PHYRADAR)

u32 rfilt;

rfilt = (ath9k_hw_getrxfilter(ah) & RX_FILTER_PRESERVE)
| ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST
| ATH9K_RX_FILTER_MCAST;

/* If not a STA, enable processing of Probe Requests */
if (ah->opmode != NL80211_IFTYPE_STATION)
rfilt |= ATH9K_RX_FILTER_PROBEREQ;

/*
* Set promiscuous mode when FIF_PROMISC_IN_BSS is enabled for station
* mode interface or when in monitor mode. AP mode does not need this
* since it receives all in-BSS frames anyway.
*/
if (((ah->opmode != NL80211_IFTYPE_AP) &&
(rxfilter & FIF_PROMISC_IN_BSS)) ||
(ah->opmode == NL80211_IFTYPE_MONITOR))
rfilt |= ATH9K_RX_FILTER_PROM;

if (rxfilter & FIF_CONTROL)
rfilt |= ATH9K_RX_FILTER_CONTROL;

if ((ah->opmode == NL80211_IFTYPE_STATION) &&
!(rxfilter & FIF_BCN_PRBRESP_PROMISC))
rfilt |= ATH9K_RX_FILTER_MYBEACON;
else
rfilt |= ATH9K_RX_FILTER_BEACON;

if ((AR_SREV_9280_10_OR_LATER(ah) ||
AR_SREV_9285_10_OR_LATER(ah)) &&
(ah->opmode == NL80211_IFTYPE_AP) &&
(rxfilter & FIF_PSPOLL))
rfilt |= ATH9K_RX_FILTER_PSPOLL;

if (conf_is_ht(&hw->conf))
rfilt |= ATH9K_RX_FILTER_COMP_BAR;

return rfilt;

#undef RX_FILTER_PRESERVE
}
EXPORT_SYMBOL(ath9k_cmn_calcrxfilter);

/*
* Recv initialization for opmode change.
*/
void ath9k_cmn_opmode_init(struct ieee80211_hw *hw, struct ath_hw *ah,
unsigned int rxfilter)
{
struct ath_common *common = ath9k_hw_common(ah);

u32 rfilt, mfilt[2];

/* configure rx filter */
rfilt = ath9k_cmn_calcrxfilter(hw, ah, rxfilter);
ath9k_hw_setrxfilter(ah, rfilt);

/* configure bssid mask */
if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK)
ath_hw_setbssidmask(common);

/* configure operational mode */
ath9k_hw_setopmode(ah);

/* Handle any link-level address change. */
ath9k_hw_setmac(ah, common->macaddr);

/* calculate and install multicast filter */
mfilt[0] = mfilt[1] = ~0;
ath9k_hw_setmcastfilter(ah, mfilt[0], mfilt[1]);
}
EXPORT_SYMBOL(ath9k_cmn_opmode_init);

static u32 ath9k_get_extchanmode(struct ieee80211_channel *chan,
enum nl80211_channel_type channel_type)
{
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/net/wireless/ath/ath9k/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ void ath9k_cmn_rx_skb_postprocess(struct ath_common *common,

int ath9k_cmn_padpos(__le16 frame_control);
int ath9k_cmn_get_hw_crypto_keytype(struct sk_buff *skb);
u32 ath9k_cmn_calcrxfilter(struct ieee80211_hw *hw, struct ath_hw *ah,
unsigned int rxfilter);
void ath9k_cmn_opmode_init(struct ieee80211_hw *hw, struct ath_hw *ah,
unsigned int rxfilter);
void ath9k_cmn_update_ichannel(struct ieee80211_hw *hw,
struct ath9k_channel *ichan);
struct ath9k_channel *ath9k_cmn_get_curchannel(struct ieee80211_hw *hw,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ath9k/htc.h
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ int ath9k_rx_init(struct ath9k_htc_priv *priv);
void ath9k_rx_cleanup(struct ath9k_htc_priv *priv);
void ath9k_host_rx_init(struct ath9k_htc_priv *priv);
void ath9k_rx_tasklet(unsigned long data);
u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv);

void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv);
void ath9k_init_leds(struct ath9k_htc_priv *priv);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/ath/ath9k/htc_drv_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1299,7 +1299,7 @@ static void ath9k_htc_configure_filter(struct ieee80211_hw *hw,
*total_flags &= SUPPORTED_FILTERS;

priv->rxfilter = *total_flags;
rfilt = ath9k_cmn_calcrxfilter(hw, priv->ah, priv->rxfilter);
rfilt = ath9k_htc_calcrxfilter(priv);
ath9k_hw_setrxfilter(priv->ah, rfilt);

ath_print(ath9k_hw_common(priv->ah), ATH_DBG_CONFIG,
Expand Down
76 changes: 75 additions & 1 deletion trunk/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,84 @@ bool ath9k_htc_txq_setup(struct ath9k_htc_priv *priv,
/* RX */
/******/

/*
* Calculate the RX filter to be set in the HW.
*/
u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv)
{
#define RX_FILTER_PRESERVE (ATH9K_RX_FILTER_PHYERR | ATH9K_RX_FILTER_PHYRADAR)

struct ath_hw *ah = priv->ah;
u32 rfilt;

rfilt = (ath9k_hw_getrxfilter(ah) & RX_FILTER_PRESERVE)
| ATH9K_RX_FILTER_UCAST | ATH9K_RX_FILTER_BCAST
| ATH9K_RX_FILTER_MCAST;

/* If not a STA, enable processing of Probe Requests */
if (ah->opmode != NL80211_IFTYPE_STATION)
rfilt |= ATH9K_RX_FILTER_PROBEREQ;

/*
* Set promiscuous mode when FIF_PROMISC_IN_BSS is enabled for station
* mode interface or when in monitor mode. AP mode does not need this
* since it receives all in-BSS frames anyway.
*/
if (((ah->opmode != NL80211_IFTYPE_AP) &&
(priv->rxfilter & FIF_PROMISC_IN_BSS)) ||
(ah->opmode == NL80211_IFTYPE_MONITOR))
rfilt |= ATH9K_RX_FILTER_PROM;

if (priv->rxfilter & FIF_CONTROL)
rfilt |= ATH9K_RX_FILTER_CONTROL;

if ((ah->opmode == NL80211_IFTYPE_STATION) &&
!(priv->rxfilter & FIF_BCN_PRBRESP_PROMISC))
rfilt |= ATH9K_RX_FILTER_MYBEACON;
else
rfilt |= ATH9K_RX_FILTER_BEACON;

if (conf_is_ht(&priv->hw->conf))
rfilt |= ATH9K_RX_FILTER_COMP_BAR;

return rfilt;

#undef RX_FILTER_PRESERVE
}

/*
* Recv initialization for opmode change.
*/
static void ath9k_htc_opmode_init(struct ath9k_htc_priv *priv)
{
struct ath_hw *ah = priv->ah;
struct ath_common *common = ath9k_hw_common(ah);

u32 rfilt, mfilt[2];

/* configure rx filter */
rfilt = ath9k_htc_calcrxfilter(priv);
ath9k_hw_setrxfilter(ah, rfilt);

/* configure bssid mask */
if (ah->caps.hw_caps & ATH9K_HW_CAP_BSSIDMASK)
ath_hw_setbssidmask(common);

/* configure operational mode */
ath9k_hw_setopmode(ah);

/* Handle any link-level address change. */
ath9k_hw_setmac(ah, common->macaddr);

/* calculate and install multicast filter */
mfilt[0] = mfilt[1] = ~0;
ath9k_hw_setmcastfilter(ah, mfilt[0], mfilt[1]);
}

void ath9k_host_rx_init(struct ath9k_htc_priv *priv)
{
ath9k_hw_rxena(priv->ah);
ath9k_cmn_opmode_init(priv->hw, priv->ah, priv->rxfilter);
ath9k_htc_opmode_init(priv);
ath9k_hw_startpcureceive(priv->ah);
priv->rx.last_rssi = ATH_RSSI_DUMMY_MARKER;
}
Expand Down

0 comments on commit f8a8390

Please sign in to comment.