aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/p54
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@web.de>2008-12-30 07:48:19 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:59:43 -0500
commit78eb7484fadddd2860d4503b3c8c1710c1bfa1b3 (patch)
tree68b4d542b4db265ed86431cc40e8306bc50e514d /drivers/net/wireless/p54
parent295834fe3605fd50265399c266fe0a5ccc76edc8 (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')
-rw-r--r--drivers/net/wireless/p54/p54.h2
-rw-r--r--drivers/net/wireless/p54/p54common.c10
-rw-r--r--drivers/net/wireless/p54/p54common.h2
3 files changed, 10 insertions, 4 deletions
diff --git a/drivers/net/wireless/p54/p54.h b/drivers/net/wireless/p54/p54.h
index ab79e32f0b27..6bd147c47ae0 100644
--- a/drivers/net/wireless/p54/p54.h
+++ b/drivers/net/wireless/p54/p54.h
@@ -99,6 +99,8 @@ struct p54_common {
99 struct mutex conf_mutex; 99 struct mutex conf_mutex;
100 u8 mac_addr[ETH_ALEN]; 100 u8 mac_addr[ETH_ALEN];
101 u8 bssid[ETH_ALEN]; 101 u8 bssid[ETH_ALEN];
102 u8 rx_diversity_mask;
103 u8 tx_diversity_mask;
102 struct pda_iq_autocal_entry *iq_autocal; 104 struct pda_iq_autocal_entry *iq_autocal;
103 unsigned int iq_autocal_len; 105 unsigned int iq_autocal_len;
104 struct pda_channel_output_limit *output_limit; 106 struct pda_channel_output_limit *output_limit;
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);
diff --git a/drivers/net/wireless/p54/p54common.h b/drivers/net/wireless/p54/p54common.h
index 163e3adba422..035e77312484 100644
--- a/drivers/net/wireless/p54/p54common.h
+++ b/drivers/net/wireless/p54/p54common.h
@@ -31,7 +31,7 @@ struct bootrec {
31#define PDR_SYNTH_IQ_CAL_DISABLED 0x0008 31#define PDR_SYNTH_IQ_CAL_DISABLED 0x0008
32#define PDR_SYNTH_IQ_CAL_ZIF 0x0010 32#define PDR_SYNTH_IQ_CAL_ZIF 0x0010
33#define PDR_SYNTH_FAA_SWITCH_MASK 0x0020 33#define PDR_SYNTH_FAA_SWITCH_MASK 0x0020
34#define PDR_SYNTH_FAA_SWITCH_ENABLED 0x0001 34#define PDR_SYNTH_FAA_SWITCH_ENABLED 0x0020
35#define PDR_SYNTH_24_GHZ_MASK 0x0040 35#define PDR_SYNTH_24_GHZ_MASK 0x0040
36#define PDR_SYNTH_24_GHZ_DISABLED 0x0040 36#define PDR_SYNTH_24_GHZ_DISABLED 0x0040
37#define PDR_SYNTH_5_GHZ_MASK 0x0080 37#define PDR_SYNTH_5_GHZ_MASK 0x0080