diff options
Diffstat (limited to 'drivers/net/wireless/p54/fwio.c')
-rw-r--r-- | drivers/net/wireless/p54/fwio.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/wireless/p54/fwio.c b/drivers/net/wireless/p54/fwio.c index 92b9b1f05fd5..0d3d108f6fe2 100644 --- a/drivers/net/wireless/p54/fwio.c +++ b/drivers/net/wireless/p54/fwio.c | |||
@@ -397,9 +397,9 @@ int p54_scan(struct p54_common *priv, u16 mode, u16 dwell) | |||
397 | union p54_scan_body_union *body; | 397 | union p54_scan_body_union *body; |
398 | struct p54_scan_tail_rate *rate; | 398 | struct p54_scan_tail_rate *rate; |
399 | struct pda_rssi_cal_entry *rssi; | 399 | struct pda_rssi_cal_entry *rssi; |
400 | struct p54_rssi_db_entry *rssi_data; | ||
400 | unsigned int i; | 401 | unsigned int i; |
401 | void *entry; | 402 | void *entry; |
402 | int band = priv->hw->conf.channel->band; | ||
403 | __le16 freq = cpu_to_le16(priv->hw->conf.channel->center_freq); | 403 | __le16 freq = cpu_to_le16(priv->hw->conf.channel->center_freq); |
404 | 404 | ||
405 | skb = p54_alloc_skb(priv, P54_HDR_FLAG_CONTROL_OPSET, sizeof(*head) + | 405 | skb = p54_alloc_skb(priv, P54_HDR_FLAG_CONTROL_OPSET, sizeof(*head) + |
@@ -503,13 +503,14 @@ int p54_scan(struct p54_common *priv, u16 mode, u16 dwell) | |||
503 | } | 503 | } |
504 | 504 | ||
505 | rssi = (struct pda_rssi_cal_entry *) skb_put(skb, sizeof(*rssi)); | 505 | rssi = (struct pda_rssi_cal_entry *) skb_put(skb, sizeof(*rssi)); |
506 | rssi->mul = cpu_to_le16(priv->rssical_db[band].mul); | 506 | rssi_data = p54_rssi_find(priv, le16_to_cpu(freq)); |
507 | rssi->add = cpu_to_le16(priv->rssical_db[band].add); | 507 | rssi->mul = cpu_to_le16(rssi_data->mul); |
508 | rssi->add = cpu_to_le16(rssi_data->add); | ||
508 | if (priv->rxhw == PDR_SYNTH_FRONTEND_LONGBOW) { | 509 | if (priv->rxhw == PDR_SYNTH_FRONTEND_LONGBOW) { |
509 | /* Longbow frontend needs ever more */ | 510 | /* Longbow frontend needs ever more */ |
510 | rssi = (void *) skb_put(skb, sizeof(*rssi)); | 511 | rssi = (void *) skb_put(skb, sizeof(*rssi)); |
511 | rssi->mul = cpu_to_le16(priv->rssical_db[band].longbow_unkn); | 512 | rssi->mul = cpu_to_le16(rssi_data->longbow_unkn); |
512 | rssi->add = cpu_to_le16(priv->rssical_db[band].longbow_unk2); | 513 | rssi->add = cpu_to_le16(rssi_data->longbow_unk2); |
513 | } | 514 | } |
514 | 515 | ||
515 | if (priv->fw_var >= 0x509) { | 516 | if (priv->fw_var >= 0x509) { |
@@ -523,6 +524,7 @@ int p54_scan(struct p54_common *priv, u16 mode, u16 dwell) | |||
523 | hdr->len = cpu_to_le16(skb->len - sizeof(*hdr)); | 524 | hdr->len = cpu_to_le16(skb->len - sizeof(*hdr)); |
524 | 525 | ||
525 | p54_tx(priv, skb); | 526 | p54_tx(priv, skb); |
527 | priv->cur_rssi = rssi_data; | ||
526 | return 0; | 528 | return 0; |
527 | 529 | ||
528 | err: | 530 | err: |