Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 224343
b: refs/heads/master
c: b1d771e
h: refs/heads/master
i:
  224341: 648f18f
  224339: 3ee2531
  224335: 7d434b0
v: v3
  • Loading branch information
Christian Lamparter authored and John W. Linville committed Nov 15, 2010
1 parent f99cc25 commit 7520247
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 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: 7919a57bc608140aa8614c19eac40c6916fb61d2
refs/heads/master: b1d771ee33c6e4006676002b9d74abf45b71d3d6
17 changes: 4 additions & 13 deletions trunk/drivers/net/wireless/ath/carl9170/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1554,15 +1554,6 @@ static int carl9170_set_power_cal(struct ar9170 *ar, u32 freq,
return carl9170_regwrite_result();
}

/* TODO: replace this with sign_extend32(noise, 8) */
static int carl9170_calc_noise_dbm(u32 raw_noise)
{
if (raw_noise & 0x100)
return ~0x1ff | raw_noise;
else
return raw_noise;
}

int carl9170_get_noisefloor(struct ar9170 *ar)
{
static const u32 phy_regs[] = {
Expand All @@ -1578,11 +1569,11 @@ int carl9170_get_noisefloor(struct ar9170 *ar)
return err;

for (i = 0; i < 2; i++) {
ar->noise[i] = carl9170_calc_noise_dbm(
(phy_res[i] >> 19) & 0x1ff);
ar->noise[i] = sign_extend32(GET_VAL(
AR9170_PHY_CCA_MIN_PWR, phy_res[i]), 8);

ar->noise[i + 2] = carl9170_calc_noise_dbm(
(phy_res[i + 2] >> 23) & 0x1ff);
ar->noise[i + 2] = sign_extend32(GET_VAL(
AR9170_PHY_EXT_CCA_MIN_PWR, phy_res[i + 2]), 8);
}

return 0;
Expand Down

0 comments on commit 7520247

Please sign in to comment.