Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 214732
b: refs/heads/master
c: 9adc9e0
h: refs/heads/master
v: v3
  • Loading branch information
Christian Lamparter authored and John W. Linville committed Sep 21, 2010
1 parent db9b923 commit bb56027
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 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: e278c5a90368408bd191743e7c6f978f068f4b8d
refs/heads/master: 9adc9e0ff397fb2d4f383cc2d399b18adc32e6eb
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/ath/carl9170/carl9170.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ struct ar9170 {

/* PHY */
struct ieee80211_channel *channel;
int noise[6];
int noise[4];
unsigned int chan_fail;
unsigned int total_chan_fail;
u8 heavy_clip;
Expand Down
8 changes: 3 additions & 5 deletions trunk/drivers/net/wireless/ath/carl9170/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,12 +436,10 @@ static char *carl9170_debugfs_phy_noise_read(struct ar9170 *ar, char *buf,
return buf;
}

ADD(buf, *len, bufsize, "Chain 1: %10d dBm, ext. chan.:%10d dBm\n",
ar->noise[1], ar->noise[4]);
ADD(buf, *len, bufsize, "Chain 0: %10d dBm, ext. chan.:%10d dBm\n",
ar->noise[0], ar->noise[2]);
ADD(buf, *len, bufsize, "Chain 2: %10d dBm, ext. chan.:%10d dBm\n",
ar->noise[2], ar->noise[5]);
ADD(buf, *len, bufsize, "Combined %10d dBm, ext. chan.:%10d dBm\n",
ar->noise[0], ar->noise[3]);
ar->noise[1], ar->noise[3]);

return buf;
}
Expand Down
11 changes: 5 additions & 6 deletions trunk/drivers/net/wireless/ath/carl9170/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1566,9 +1566,8 @@ static int carl9170_calc_noise_dbm(u32 raw_noise)
int carl9170_get_noisefloor(struct ar9170 *ar)
{
static const u32 phy_regs[] = {
AR9170_PHY_REG_CCA, AR9170_PHY_REG_CH1_CCA,
AR9170_PHY_REG_CH2_CCA, AR9170_PHY_REG_EXT_CCA,
AR9170_PHY_REG_CH1_EXT_CCA, AR9170_PHY_REG_CH2_EXT_CCA };
AR9170_PHY_REG_CCA, AR9170_PHY_REG_CH2_CCA,
AR9170_PHY_REG_EXT_CCA, AR9170_PHY_REG_CH2_EXT_CCA };
u32 phy_res[ARRAY_SIZE(phy_regs)];
int err, i;

Expand All @@ -1578,12 +1577,12 @@ int carl9170_get_noisefloor(struct ar9170 *ar)
if (err)
return err;

for (i = 0; i < 3; i++) {
for (i = 0; i < 2; i++) {
ar->noise[i] = carl9170_calc_noise_dbm(
(phy_res[i] >> 19) & 0x1ff);

ar->noise[i + 3] = carl9170_calc_noise_dbm(
(phy_res[i + 3] >> 23) & 0x1ff);
ar->noise[i + 2] = carl9170_calc_noise_dbm(
(phy_res[i + 2] >> 23) & 0x1ff);
}

return 0;
Expand Down

0 comments on commit bb56027

Please sign in to comment.