aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-11-08 08:39:25 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-11-11 17:09:14 -0500
commitf2b38cbfd98eb36799f45178c73b2ed81402abd8 (patch)
tree4dfe24411611c9a7d0fca001c50008d6d5effe6e /drivers/net/wireless/rt2x00
parent726984b61e744c1fef72d20e56eadd0864ecb240 (diff)
rt2800: prepare for rt2800*_probe_hw_mode() unification
Enclose interface specific code in rt2800[pci,usb]_probe_hw_mode() with rt2x00_intf_is_[pci,usb]() checks. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800pci.c24
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c19
2 files changed, 26 insertions, 17 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c
index f9ab3726d7f8..c60779069508 100644
--- a/drivers/net/wireless/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
@@ -1189,6 +1189,7 @@ static const struct rf_channel rf_vals[] = {
1189 1189
1190static int rt2800pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev) 1190static int rt2800pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
1191{ 1191{
1192 struct rt2x00_chip *chip = &rt2x00dev->chip;
1192 struct hw_mode_spec *spec = &rt2x00dev->spec; 1193 struct hw_mode_spec *spec = &rt2x00dev->spec;
1193 struct channel_info *info; 1194 struct channel_info *info;
1194 char *tx_power1; 1195 char *tx_power1;
@@ -1204,7 +1205,9 @@ static int rt2800pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
1204 IEEE80211_HW_SIGNAL_DBM | 1205 IEEE80211_HW_SIGNAL_DBM |
1205 IEEE80211_HW_SUPPORTS_PS | 1206 IEEE80211_HW_SUPPORTS_PS |
1206 IEEE80211_HW_PS_NULLFUNC_STACK; 1207 IEEE80211_HW_PS_NULLFUNC_STACK;
1207 rt2x00dev->hw->extra_tx_headroom = TXWI_DESC_SIZE; 1208
1209 if (rt2x00_intf_is_pci(rt2x00dev))
1210 rt2x00dev->hw->extra_tx_headroom = TXWI_DESC_SIZE;
1208 1211
1209 SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); 1212 SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
1210 SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, 1213 SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
@@ -1219,17 +1222,18 @@ static int rt2800pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
1219 spec->supported_bands = SUPPORT_BAND_2GHZ; 1222 spec->supported_bands = SUPPORT_BAND_2GHZ;
1220 spec->supported_rates = SUPPORT_RATE_CCK | SUPPORT_RATE_OFDM; 1223 spec->supported_rates = SUPPORT_RATE_CCK | SUPPORT_RATE_OFDM;
1221 1224
1222 if (rt2x00_rf(&rt2x00dev->chip, RF2820) || 1225 if (rt2x00_rf(chip, RF2820) ||
1223 rt2x00_rf(&rt2x00dev->chip, RF2720) || 1226 rt2x00_rf(chip, RF2720) ||
1224 rt2x00_rf(&rt2x00dev->chip, RF3020) || 1227 (rt2x00_intf_is_pci(rt2x00dev) &&
1225 rt2x00_rf(&rt2x00dev->chip, RF3021) || 1228 (rt2x00_rf(chip, RF3020) ||
1226 rt2x00_rf(&rt2x00dev->chip, RF3022) || 1229 rt2x00_rf(chip, RF3021) ||
1227 rt2x00_rf(&rt2x00dev->chip, RF2020) || 1230 rt2x00_rf(chip, RF3022) ||
1228 rt2x00_rf(&rt2x00dev->chip, RF3052)) { 1231 rt2x00_rf(chip, RF2020) ||
1232 rt2x00_rf(chip, RF3052)))) {
1229 spec->num_channels = 14; 1233 spec->num_channels = 14;
1230 spec->channels = rf_vals; 1234 spec->channels = rf_vals;
1231 } else if (rt2x00_rf(&rt2x00dev->chip, RF2850) || 1235 } else if (rt2x00_rf(chip, RF2850) ||
1232 rt2x00_rf(&rt2x00dev->chip, RF2750)) { 1236 rt2x00_rf(chip, RF2750)) {
1233 spec->supported_bands |= SUPPORT_BAND_5GHZ; 1237 spec->supported_bands |= SUPPORT_BAND_5GHZ;
1234 spec->num_channels = ARRAY_SIZE(rf_vals); 1238 spec->num_channels = ARRAY_SIZE(rf_vals);
1235 spec->channels = rf_vals; 1239 spec->channels = rf_vals;
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 36acb384f328..e86858a0e196 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -770,6 +770,7 @@ static const struct rf_channel rf_vals_3070[] = {
770 770
771static int rt2800usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev) 771static int rt2800usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
772{ 772{
773 struct rt2x00_chip *chip = &rt2x00dev->chip;
773 struct hw_mode_spec *spec = &rt2x00dev->spec; 774 struct hw_mode_spec *spec = &rt2x00dev->spec;
774 struct channel_info *info; 775 struct channel_info *info;
775 char *tx_power1; 776 char *tx_power1;
@@ -785,7 +786,10 @@ static int rt2800usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
785 IEEE80211_HW_SIGNAL_DBM | 786 IEEE80211_HW_SIGNAL_DBM |
786 IEEE80211_HW_SUPPORTS_PS | 787 IEEE80211_HW_SUPPORTS_PS |
787 IEEE80211_HW_PS_NULLFUNC_STACK; 788 IEEE80211_HW_PS_NULLFUNC_STACK;
788 rt2x00dev->hw->extra_tx_headroom = TXINFO_DESC_SIZE + TXWI_DESC_SIZE; 789
790 if (rt2x00_intf_is_usb(rt2x00dev))
791 rt2x00dev->hw->extra_tx_headroom =
792 TXINFO_DESC_SIZE + TXWI_DESC_SIZE;
789 793
790 SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev); 794 SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
791 SET_IEEE80211_PERM_ADDR(rt2x00dev->hw, 795 SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
@@ -800,17 +804,18 @@ static int rt2800usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
800 spec->supported_bands = SUPPORT_BAND_2GHZ; 804 spec->supported_bands = SUPPORT_BAND_2GHZ;
801 spec->supported_rates = SUPPORT_RATE_CCK | SUPPORT_RATE_OFDM; 805 spec->supported_rates = SUPPORT_RATE_CCK | SUPPORT_RATE_OFDM;
802 806
803 if (rt2x00_rf(&rt2x00dev->chip, RF2820) || 807 if (rt2x00_rf(chip, RF2820) ||
804 rt2x00_rf(&rt2x00dev->chip, RF2720)) { 808 rt2x00_rf(chip, RF2720)) {
805 spec->num_channels = 14; 809 spec->num_channels = 14;
806 spec->channels = rf_vals; 810 spec->channels = rf_vals;
807 } else if (rt2x00_rf(&rt2x00dev->chip, RF2850) || 811 } else if (rt2x00_rf(chip, RF2850) ||
808 rt2x00_rf(&rt2x00dev->chip, RF2750)) { 812 rt2x00_rf(chip, RF2750)) {
809 spec->supported_bands |= SUPPORT_BAND_5GHZ; 813 spec->supported_bands |= SUPPORT_BAND_5GHZ;
810 spec->num_channels = ARRAY_SIZE(rf_vals); 814 spec->num_channels = ARRAY_SIZE(rf_vals);
811 spec->channels = rf_vals; 815 spec->channels = rf_vals;
812 } else if (rt2x00_rf(&rt2x00dev->chip, RF3020) || 816 } else if (rt2x00_intf_is_usb(rt2x00dev) &&
813 rt2x00_rf(&rt2x00dev->chip, RF2020)) { 817 (rt2x00_rf(chip, RF3020) ||
818 rt2x00_rf(chip, RF2020))) {
814 spec->num_channels = ARRAY_SIZE(rf_vals_3070); 819 spec->num_channels = ARRAY_SIZE(rf_vals_3070);
815 spec->channels = rf_vals_3070; 820 spec->channels = rf_vals_3070;
816 } 821 }