Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90571
b: refs/heads/master
c: 7b58416
h: refs/heads/master
i:
  90569: f75bf38
  90567: d897500
v: v3
  • Loading branch information
Michael Buesch authored and John W. Linville committed Apr 8, 2008
1 parent 52bc4cb commit aedcec7
Show file tree
Hide file tree
Showing 5 changed files with 42 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: 9cfb0009dab6d6b4c5a15c5d74ab60d7a7a7371b
refs/heads/master: 7b584163979a9fe2ebfdd57a9d64cbe27166ab70
14 changes: 13 additions & 1 deletion trunk/drivers/net/wireless/b43/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include "main.h"
#include "debugfs.h"
#include "phy.h"
#include "nphy.h"
#include "dma.h"
#include "pio.h"
#include "sysfs.h"
Expand Down Expand Up @@ -1019,7 +1020,18 @@ void b43_power_saving_ctl_bits(struct b43_wldev *dev, unsigned int ps_flags)
/* Turn the Analog ON/OFF */
static void b43_switch_analog(struct b43_wldev *dev, int on)
{
b43_write16(dev, B43_MMIO_PHY0, on ? 0 : 0xF4);
switch (dev->phy.type) {
case B43_PHYTYPE_A:
case B43_PHYTYPE_G:
b43_write16(dev, B43_MMIO_PHY0, on ? 0 : 0xF4);
break;
case B43_PHYTYPE_N:
b43_phy_write(dev, B43_NPHY_AFECTL_OVER,
on ? 0 : 0x7FFF);
break;
default:
B43_WARN_ON(1);
}
}

void b43_wireless_core_reset(struct b43_wldev *dev, u32 flags)
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/wireless/b43/nphy.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ static void b43_nphy_workarounds(struct b43_wldev *dev)

b43_phy_set(dev, B43_NPHY_IQFLIP,
B43_NPHY_IQFLIP_ADC1 | B43_NPHY_IQFLIP_ADC2);
//FIXME the following condition is different in the specs.
if (1 /* FIXME band is 2.4GHz */) {
b43_phy_set(dev, B43_NPHY_CLASSCTL,
B43_NPHY_CLASSCTL_CCKEN);
Expand Down
23 changes: 15 additions & 8 deletions trunk/drivers/net/wireless/b43/xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,15 +513,13 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
u32 macstat;
u16 chanid;
u16 phytype;
u8 jssi;
int padding;

memset(&status, 0, sizeof(status));

/* Get metadata about the frame from the header. */
phystat0 = le16_to_cpu(rxhdr->phy_status0);
phystat3 = le16_to_cpu(rxhdr->phy_status3);
jssi = rxhdr->jssi;
macstat = le32_to_cpu(rxhdr->mac_status);
mactime = le16_to_cpu(rxhdr->mac_time);
chanstat = le16_to_cpu(rxhdr->channel);
Expand Down Expand Up @@ -575,13 +573,22 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
}
}

status.ssi = b43_rssi_postprocess(dev, jssi,
(phystat0 & B43_RX_PHYST0_OFDM),
(phystat0 & B43_RX_PHYST0_GAINCTL),
(phystat3 & B43_RX_PHYST3_TRSTATE));
/* Link quality statistics */
status.noise = dev->stats.link_noise;
/* the next line looks wrong, but is what mac80211 wants */
status.signal = (jssi * 100) / B43_RX_MAX_SSI;
if ((chanstat & B43_RX_CHAN_PHYTYPE) == B43_PHYTYPE_N) {
// s8 rssi = max(rxhdr->power0, rxhdr->power1);
//TODO: Find out what the rssi value is (dBm or percentage?)
// and also find out what the maximum possible value is.
// Fill status.ssi and status.signal fields.
} else {
status.ssi = b43_rssi_postprocess(dev, rxhdr->jssi,
(phystat0 & B43_RX_PHYST0_OFDM),
(phystat0 & B43_RX_PHYST0_GAINCTL),
(phystat3 & B43_RX_PHYST3_TRSTATE));
/* the next line looks wrong, but is what mac80211 wants */
status.signal = (rxhdr->jssi * 100) / B43_RX_MAX_SSI;
}

if (phystat0 & B43_RX_PHYST0_OFDM)
status.rate_idx = b43_plcp_get_bitrate_idx_ofdm(plcp,
phytype == B43_PHYTYPE_A);
Expand Down
15 changes: 13 additions & 2 deletions trunk/drivers/net/wireless/b43/xmit.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,19 @@ struct b43_rxhdr_fw4 {
__le16 frame_len; /* Frame length */
PAD_BYTES(2);
__le16 phy_status0; /* PHY RX Status 0 */
__u8 jssi; /* PHY RX Status 1: JSSI */
__u8 sig_qual; /* PHY RX Status 1: Signal Quality */
union {
/* RSSI for A/B/G-PHYs */
struct {
__u8 jssi; /* PHY RX Status 1: JSSI */
__u8 sig_qual; /* PHY RX Status 1: Signal Quality */
} __attribute__ ((__packed__));

/* RSSI for N-PHYs */
struct {
__s8 power0; /* PHY RX Status 1: Power 0 */
__s8 power1; /* PHY RX Status 1: Power 1 */
} __attribute__ ((__packed__));
} __attribute__ ((__packed__));
__le16 phy_status2; /* PHY RX Status 2 */
__le16 phy_status3; /* PHY RX Status 3 */
__le32 mac_status; /* MAC RX status */
Expand Down

0 comments on commit aedcec7

Please sign in to comment.