Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 203934
b: refs/heads/master
c: 1943414
h: refs/heads/master
v: v3
  • Loading branch information
John W. Linville committed Jul 29, 2010
1 parent 772070b commit e61f981
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a55427e8284541d43630f10a6c637b28802c21b0
refs/heads/master: 19434148d16dc231026f37af7c40e81ad9342e75
3 changes: 3 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/wl1251.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ struct wl1251 {

u32 chip_id;
char fw_ver[21];

/* Most recently reported noise in dBm */
s8 noise;
};

int wl1251_plt_start(struct wl1251 *wl);
Expand Down
17 changes: 17 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/wl1251_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,22 @@ static int wl1251_op_conf_tx(struct ieee80211_hw *hw, u16 queue,
return ret;
}

static int wl1251_op_get_survey(struct ieee80211_hw *hw, int idx,
struct survey_info *survey)
{
struct wl1251 *wl = hw->priv;
struct ieee80211_conf *conf = &hw->conf;

if (idx != 0)
return -ENOENT;

survey->channel = conf->channel;
survey->filled = SURVEY_INFO_NOISE_DBM;
survey->noise = wl->noise;

return 0;
}

/* can't be const, mac80211 writes to this */
static struct ieee80211_supported_band wl1251_band_2ghz = {
.channels = wl1251_channels,
Expand All @@ -1193,6 +1209,7 @@ static const struct ieee80211_ops wl1251_ops = {
.bss_info_changed = wl1251_op_bss_info_changed,
.set_rts_threshold = wl1251_op_set_rts_threshold,
.conf_tx = wl1251_op_conf_tx,
.get_survey = wl1251_op_get_survey,
};

static int wl1251_read_eeprom_byte(struct wl1251 *wl, off_t offset, u8 *data)
Expand Down
6 changes: 6 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/wl1251_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ static void wl1251_rx_status(struct wl1251 *wl,

status->signal = desc->rssi;

/*
* FIXME: guessing that snr needs to be divided by two, otherwise
* the values don't make any sense
*/
wl->noise = desc->rssi - desc->snr / 2;

status->freq = ieee80211_channel_to_frequency(desc->channel);

status->flag |= RX_FLAG_TSFT;
Expand Down

0 comments on commit e61f981

Please sign in to comment.