Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 202848
b: refs/heads/master
c: 61389f3
h: refs/heads/master
v: v3
  • Loading branch information
Sujith authored and John W. Linville committed Jun 4, 2010
1 parent 7ad27d0 commit 86fb160
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 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: b176286276f85e10e8ab3342730c5e39e1ce460b
refs/heads/master: 61389f3ed49968746327aef0454b2f27e88e0f8d
13 changes: 13 additions & 0 deletions trunk/drivers/net/wireless/ath/ath9k/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,19 @@ void ath9k_cmn_key_delete(struct ath_common *common,
}
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)
{
return 0;
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/wireless/ath/ath9k/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ int ath9k_cmn_key_config(struct ath_common *common,
struct ieee80211_key_conf *key);
void ath9k_cmn_key_delete(struct ath_common *common,
struct ieee80211_key_conf *key);
int ath9k_cmn_count_streams(unsigned int chainmask, int max);
16 changes: 2 additions & 14 deletions trunk/drivers/net/wireless/ath/ath9k/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,6 @@ static const struct ath_ops ath9k_common_ops = {
.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 */
/**************************/
Expand Down Expand Up @@ -227,8 +215,8 @@ static void setup_ht_cap(struct ath_softc *sc,

/* set up supported mcs set */
memset(&ht_info->mcs, 0, sizeof(ht_info->mcs));
tx_streams = count_streams(common->tx_chainmask, max_streams);
rx_streams = count_streams(common->rx_chainmask, max_streams);
tx_streams = ath9k_cmn_count_streams(common->tx_chainmask, max_streams);
rx_streams = ath9k_cmn_count_streams(common->rx_chainmask, max_streams);

ath_print(common, ATH_DBG_CONFIG,
"TX streams %d, RX streams: %d\n",
Expand Down

0 comments on commit 86fb160

Please sign in to comment.