提交 61389f3e 编写于 作者: S Sujith 提交者: John W. Linville

ath9k_common: Move count_streams to common module

This can be used by ath9k_htc.
Signed-off-by: NSujith <Sujith.Manoharan@atheros.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 b1762862
...@@ -397,6 +397,19 @@ void ath9k_cmn_key_delete(struct ath_common *common, ...@@ -397,6 +397,19 @@ void ath9k_cmn_key_delete(struct ath_common *common,
} }
EXPORT_SYMBOL(ath9k_cmn_key_delete); EXPORT_SYMBOL(ath9k_cmn_key_delete);
int ath9k_cmn_count_streams(unsigned int chainmask, int max)
{
int streams = 0;
do {
if (++streams == max)
break;
} while ((chainmask = chainmask & (chainmask - 1)));
return streams;
}
EXPORT_SYMBOL(ath9k_cmn_count_streams);
static int __init ath9k_cmn_init(void) static int __init ath9k_cmn_init(void)
{ {
return 0; return 0;
......
...@@ -64,3 +64,4 @@ int ath9k_cmn_key_config(struct ath_common *common, ...@@ -64,3 +64,4 @@ int ath9k_cmn_key_config(struct ath_common *common,
struct ieee80211_key_conf *key); struct ieee80211_key_conf *key);
void ath9k_cmn_key_delete(struct ath_common *common, void ath9k_cmn_key_delete(struct ath_common *common,
struct ieee80211_key_conf *key); struct ieee80211_key_conf *key);
int ath9k_cmn_count_streams(unsigned int chainmask, int max);
...@@ -175,18 +175,6 @@ static const struct ath_ops ath9k_common_ops = { ...@@ -175,18 +175,6 @@ static const struct ath_ops ath9k_common_ops = {
.write = ath9k_iowrite32, .write = ath9k_iowrite32,
}; };
static int count_streams(unsigned int chainmask, int max)
{
int streams = 0;
do {
if (++streams == max)
break;
} while ((chainmask = chainmask & (chainmask - 1)));
return streams;
}
/**************************/ /**************************/
/* Initialization */ /* Initialization */
/**************************/ /**************************/
...@@ -227,8 +215,8 @@ static void setup_ht_cap(struct ath_softc *sc, ...@@ -227,8 +215,8 @@ static void setup_ht_cap(struct ath_softc *sc,
/* set up supported mcs set */ /* set up supported mcs set */
memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); memset(&ht_info->mcs, 0, sizeof(ht_info->mcs));
tx_streams = count_streams(common->tx_chainmask, max_streams); tx_streams = ath9k_cmn_count_streams(common->tx_chainmask, max_streams);
rx_streams = count_streams(common->rx_chainmask, max_streams); rx_streams = ath9k_cmn_count_streams(common->rx_chainmask, max_streams);
ath_print(common, ATH_DBG_CONFIG, ath_print(common, ATH_DBG_CONFIG,
"TX streams %d, RX streams: %d\n", "TX streams %d, RX streams: %d\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册