diff options
author | Christian Lamparter <chunkeey@web.de> | 2008-12-30 07:48:19 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:59:43 -0500 |
commit | 78eb7484fadddd2860d4503b3c8c1710c1bfa1b3 (patch) | |
tree | 68b4d542b4db265ed86431cc40e8306bc50e514d /drivers/net/wireless/p54/p54common.c | |
parent | 295834fe3605fd50265399c266fe0a5ccc76edc8 (diff) |
p54: enable rx/tx antenna diversity by eeprom bits
Respect all documented bits in the eeprom about the device diversity features.
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/p54/p54common.c')
-rw-r--r-- | drivers/net/wireless/p54/p54common.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 0907e6f246e6..6e9f73745b68 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -563,6 +563,10 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) | |||
563 | dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &band_2GHz; | 563 | dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &band_2GHz; |
564 | if (!(synth & PDR_SYNTH_5_GHZ_DISABLED)) | 564 | if (!(synth & PDR_SYNTH_5_GHZ_DISABLED)) |
565 | dev->wiphy->bands[IEEE80211_BAND_5GHZ] = &band_5GHz; | 565 | dev->wiphy->bands[IEEE80211_BAND_5GHZ] = &band_5GHz; |
566 | if ((synth & PDR_SYNTH_RX_DIV_MASK) == PDR_SYNTH_RX_DIV_SUPPORTED) | ||
567 | priv->rx_diversity_mask = 3; | ||
568 | if ((synth & PDR_SYNTH_TX_DIV_MASK) == PDR_SYNTH_TX_DIV_SUPPORTED) | ||
569 | priv->tx_diversity_mask = 3; | ||
566 | 570 | ||
567 | if (!is_valid_ether_addr(dev->wiphy->perm_addr)) { | 571 | if (!is_valid_ether_addr(dev->wiphy->perm_addr)) { |
568 | u8 perm_addr[ETH_ALEN]; | 572 | u8 perm_addr[ETH_ALEN]; |
@@ -1512,8 +1516,8 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
1512 | txhdr->hw_queue = queue; | 1516 | txhdr->hw_queue = queue; |
1513 | txhdr->backlog = current_queue->len; | 1517 | txhdr->backlog = current_queue->len; |
1514 | memset(txhdr->durations, 0, sizeof(txhdr->durations)); | 1518 | memset(txhdr->durations, 0, sizeof(txhdr->durations)); |
1515 | txhdr->tx_antenna = (info->antenna_sel_tx == 0) ? | 1519 | txhdr->tx_antenna = ((info->antenna_sel_tx == 0) ? |
1516 | 2 : info->antenna_sel_tx - 1; | 1520 | 2 : info->antenna_sel_tx - 1) & priv->tx_diversity_mask; |
1517 | txhdr->output_power = priv->output_power; | 1521 | txhdr->output_power = priv->output_power; |
1518 | txhdr->cts_rate = cts_rate; | 1522 | txhdr->cts_rate = cts_rate; |
1519 | if (padding) | 1523 | if (padding) |
@@ -1584,7 +1588,7 @@ static int p54_setup_mac(struct ieee80211_hw *dev) | |||
1584 | setup->mac_mode = cpu_to_le16(mode); | 1588 | setup->mac_mode = cpu_to_le16(mode); |
1585 | memcpy(setup->mac_addr, priv->mac_addr, ETH_ALEN); | 1589 | memcpy(setup->mac_addr, priv->mac_addr, ETH_ALEN); |
1586 | memcpy(setup->bssid, priv->bssid, ETH_ALEN); | 1590 | memcpy(setup->bssid, priv->bssid, ETH_ALEN); |
1587 | setup->rx_antenna = 2; /* automatic */ | 1591 | setup->rx_antenna = 2 & priv->rx_diversity_mask; /* automatic */ |
1588 | setup->rx_align = 0; | 1592 | setup->rx_align = 0; |
1589 | if (priv->fw_var < 0x500) { | 1593 | if (priv->fw_var < 0x500) { |
1590 | setup->v1.basic_rate_mask = cpu_to_le32(priv->basic_rate_mask); | 1594 | setup->v1.basic_rate_mask = cpu_to_le32(priv->basic_rate_mask); |