aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-10-11 07:18:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2013-10-14 13:39:57 -0400
commitf3218beef6e21769df6ead91717be9f3986668a4 (patch)
tree9b2a93e01281fde1ebc3eb2317d31a57934f2078 /drivers
parentc429dfef7041417515ffef5b7f619f5b24b16188 (diff)
rt2x00: rt61pci: use rt2x00_has_cap_* helpers
Use the appropriate helper functions instead of directly accessing the rt2x00dev->cap_flags field to check device capability flags. This improves readability of the code a bit. Compile tested only. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 54d3ddfc9888..a5b69cb49012 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -685,7 +685,7 @@ static void rt61pci_config_antenna_2x(struct rt2x00_dev *rt2x00dev,
685 685
686 rt2x00_set_field8(&r3, BBP_R3_SMART_MODE, rt2x00_rf(rt2x00dev, RF2529)); 686 rt2x00_set_field8(&r3, BBP_R3_SMART_MODE, rt2x00_rf(rt2x00dev, RF2529));
687 rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END, 687 rt2x00_set_field8(&r4, BBP_R4_RX_FRAME_END,
688 !test_bit(CAPABILITY_FRAME_TYPE, &rt2x00dev->cap_flags)); 688 !rt2x00_has_cap_frame_type(rt2x00dev));
689 689
690 /* 690 /*
691 * Configure the RX antenna. 691 * Configure the RX antenna.
@@ -813,10 +813,10 @@ static void rt61pci_config_ant(struct rt2x00_dev *rt2x00dev,
813 813
814 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) { 814 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) {
815 sel = antenna_sel_a; 815 sel = antenna_sel_a;
816 lna = test_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags); 816 lna = rt2x00_has_cap_external_lna_a(rt2x00dev);
817 } else { 817 } else {
818 sel = antenna_sel_bg; 818 sel = antenna_sel_bg;
819 lna = test_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags); 819 lna = rt2x00_has_cap_external_lna_bg(rt2x00dev);
820 } 820 }
821 821
822 for (i = 0; i < ARRAY_SIZE(antenna_sel_a); i++) 822 for (i = 0; i < ARRAY_SIZE(antenna_sel_a); i++)
@@ -836,7 +836,7 @@ static void rt61pci_config_ant(struct rt2x00_dev *rt2x00dev,
836 else if (rt2x00_rf(rt2x00dev, RF2527)) 836 else if (rt2x00_rf(rt2x00dev, RF2527))
837 rt61pci_config_antenna_2x(rt2x00dev, ant); 837 rt61pci_config_antenna_2x(rt2x00dev, ant);
838 else if (rt2x00_rf(rt2x00dev, RF2529)) { 838 else if (rt2x00_rf(rt2x00dev, RF2529)) {
839 if (test_bit(CAPABILITY_DOUBLE_ANTENNA, &rt2x00dev->cap_flags)) 839 if (rt2x00_has_cap_double_antenna(rt2x00dev))
840 rt61pci_config_antenna_2x(rt2x00dev, ant); 840 rt61pci_config_antenna_2x(rt2x00dev, ant);
841 else 841 else
842 rt61pci_config_antenna_2529(rt2x00dev, ant); 842 rt61pci_config_antenna_2529(rt2x00dev, ant);
@@ -850,13 +850,13 @@ static void rt61pci_config_lna_gain(struct rt2x00_dev *rt2x00dev,
850 short lna_gain = 0; 850 short lna_gain = 0;
851 851
852 if (libconf->conf->chandef.chan->band == IEEE80211_BAND_2GHZ) { 852 if (libconf->conf->chandef.chan->band == IEEE80211_BAND_2GHZ) {
853 if (test_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags)) 853 if (rt2x00_has_cap_external_lna_bg(rt2x00dev))
854 lna_gain += 14; 854 lna_gain += 14;
855 855
856 rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_BG, &eeprom); 856 rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_BG, &eeprom);
857 lna_gain -= rt2x00_get_field16(eeprom, EEPROM_RSSI_OFFSET_BG_1); 857 lna_gain -= rt2x00_get_field16(eeprom, EEPROM_RSSI_OFFSET_BG_1);
858 } else { 858 } else {
859 if (test_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags)) 859 if (rt2x00_has_cap_external_lna_a(rt2x00dev))
860 lna_gain += 14; 860 lna_gain += 14;
861 861
862 rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_A, &eeprom); 862 rt2x00_eeprom_read(rt2x00dev, EEPROM_RSSI_OFFSET_A, &eeprom);
@@ -1054,14 +1054,14 @@ static void rt61pci_link_tuner(struct rt2x00_dev *rt2x00dev,
1054 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) { 1054 if (rt2x00dev->curr_band == IEEE80211_BAND_5GHZ) {
1055 low_bound = 0x28; 1055 low_bound = 0x28;
1056 up_bound = 0x48; 1056 up_bound = 0x48;
1057 if (test_bit(CAPABILITY_EXTERNAL_LNA_A, &rt2x00dev->cap_flags)) { 1057 if (rt2x00_has_cap_external_lna_a(rt2x00dev)) {
1058 low_bound += 0x10; 1058 low_bound += 0x10;
1059 up_bound += 0x10; 1059 up_bound += 0x10;
1060 } 1060 }
1061 } else { 1061 } else {
1062 low_bound = 0x20; 1062 low_bound = 0x20;
1063 up_bound = 0x40; 1063 up_bound = 0x40;
1064 if (test_bit(CAPABILITY_EXTERNAL_LNA_BG, &rt2x00dev->cap_flags)) { 1064 if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
1065 low_bound += 0x10; 1065 low_bound += 0x10;
1066 up_bound += 0x10; 1066 up_bound += 0x10;
1067 } 1067 }
@@ -2578,7 +2578,7 @@ static int rt61pci_init_eeprom(struct rt2x00_dev *rt2x00dev)
2578 * eeprom word. 2578 * eeprom word.
2579 */ 2579 */
2580 if (rt2x00_rf(rt2x00dev, RF2529) && 2580 if (rt2x00_rf(rt2x00dev, RF2529) &&
2581 !test_bit(CAPABILITY_DOUBLE_ANTENNA, &rt2x00dev->cap_flags)) { 2581 !rt2x00_has_cap_double_antenna(rt2x00dev)) {
2582 rt2x00dev->default_ant.rx = 2582 rt2x00dev->default_ant.rx =
2583 ANTENNA_A + rt2x00_get_field16(eeprom, EEPROM_NIC_RX_FIXED); 2583 ANTENNA_A + rt2x00_get_field16(eeprom, EEPROM_NIC_RX_FIXED);
2584 rt2x00dev->default_ant.tx = 2584 rt2x00dev->default_ant.tx =
@@ -2793,7 +2793,7 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
2793 spec->supported_bands = SUPPORT_BAND_2GHZ; 2793 spec->supported_bands = SUPPORT_BAND_2GHZ;
2794 spec->supported_rates = SUPPORT_RATE_CCK | SUPPORT_RATE_OFDM; 2794 spec->supported_rates = SUPPORT_RATE_CCK | SUPPORT_RATE_OFDM;
2795 2795
2796 if (!test_bit(CAPABILITY_RF_SEQUENCE, &rt2x00dev->cap_flags)) { 2796 if (!rt2x00_has_cap_rf_sequence(rt2x00dev)) {
2797 spec->num_channels = 14; 2797 spec->num_channels = 14;
2798 spec->channels = rf_vals_noseq; 2798 spec->channels = rf_vals_noseq;
2799 } else { 2799 } else {