diff options
author | David S. Miller <davem@davemloft.net> | 2016-04-13 17:58:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-13 17:58:51 -0400 |
commit | 71bbe25d01fa4f35551ff7bffc3e03ddd3e960cd (patch) | |
tree | d32c77e506192ef0ba62a10e92aac410eccaa575 /drivers/net/wireless/intel/iwlegacy/common.c | |
parent | 7d45a04cbc2683f9552572850f1c711d9b96dd26 (diff) | |
parent | 57fbcce37be7c1d2622b56587c10ade00e96afa3 (diff) |
Merge tag 'mac80211-next-for-davem-2016-04-13' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Johannes Berg says:
====================
To synchronize with Kalle, here's just a big change that affects
all drivers - removing the duplicated enum ieee80211_band and
replacing it by enum nl80211_band. On top of that, just a small
documentation update.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/intel/iwlegacy/common.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlegacy/common.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/drivers/net/wireless/intel/iwlegacy/common.c b/drivers/net/wireless/intel/iwlegacy/common.c index 2cc3d42bbab7..eb24b9241bb2 100644 --- a/drivers/net/wireless/intel/iwlegacy/common.c +++ b/drivers/net/wireless/intel/iwlegacy/common.c | |||
@@ -860,7 +860,7 @@ il_init_band_reference(const struct il_priv *il, int eep_band, | |||
860 | * Does not set up a command, or touch hardware. | 860 | * Does not set up a command, or touch hardware. |
861 | */ | 861 | */ |
862 | static int | 862 | static int |
863 | il_mod_ht40_chan_info(struct il_priv *il, enum ieee80211_band band, u16 channel, | 863 | il_mod_ht40_chan_info(struct il_priv *il, enum nl80211_band band, u16 channel, |
864 | const struct il_eeprom_channel *eeprom_ch, | 864 | const struct il_eeprom_channel *eeprom_ch, |
865 | u8 clear_ht40_extension_channel) | 865 | u8 clear_ht40_extension_channel) |
866 | { | 866 | { |
@@ -945,7 +945,7 @@ il_init_channel_map(struct il_priv *il) | |||
945 | ch_info->channel = eeprom_ch_idx[ch]; | 945 | ch_info->channel = eeprom_ch_idx[ch]; |
946 | ch_info->band = | 946 | ch_info->band = |
947 | (band == | 947 | (band == |
948 | 1) ? IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ; | 948 | 1) ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ; |
949 | 949 | ||
950 | /* permanently store EEPROM's channel regulatory flags | 950 | /* permanently store EEPROM's channel regulatory flags |
951 | * and max power in channel info database. */ | 951 | * and max power in channel info database. */ |
@@ -1003,14 +1003,14 @@ il_init_channel_map(struct il_priv *il) | |||
1003 | 1003 | ||
1004 | /* Two additional EEPROM bands for 2.4 and 5 GHz HT40 channels */ | 1004 | /* Two additional EEPROM bands for 2.4 and 5 GHz HT40 channels */ |
1005 | for (band = 6; band <= 7; band++) { | 1005 | for (band = 6; band <= 7; band++) { |
1006 | enum ieee80211_band ieeeband; | 1006 | enum nl80211_band ieeeband; |
1007 | 1007 | ||
1008 | il_init_band_reference(il, band, &eeprom_ch_count, | 1008 | il_init_band_reference(il, band, &eeprom_ch_count, |
1009 | &eeprom_ch_info, &eeprom_ch_idx); | 1009 | &eeprom_ch_info, &eeprom_ch_idx); |
1010 | 1010 | ||
1011 | /* EEPROM band 6 is 2.4, band 7 is 5 GHz */ | 1011 | /* EEPROM band 6 is 2.4, band 7 is 5 GHz */ |
1012 | ieeeband = | 1012 | ieeeband = |
1013 | (band == 6) ? IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ; | 1013 | (band == 6) ? NL80211_BAND_2GHZ : NL80211_BAND_5GHZ; |
1014 | 1014 | ||
1015 | /* Loop through each band adding each of the channels */ | 1015 | /* Loop through each band adding each of the channels */ |
1016 | for (ch = 0; ch < eeprom_ch_count; ch++) { | 1016 | for (ch = 0; ch < eeprom_ch_count; ch++) { |
@@ -1048,19 +1048,19 @@ EXPORT_SYMBOL(il_free_channel_map); | |||
1048 | * Based on band and channel number. | 1048 | * Based on band and channel number. |
1049 | */ | 1049 | */ |
1050 | const struct il_channel_info * | 1050 | const struct il_channel_info * |
1051 | il_get_channel_info(const struct il_priv *il, enum ieee80211_band band, | 1051 | il_get_channel_info(const struct il_priv *il, enum nl80211_band band, |
1052 | u16 channel) | 1052 | u16 channel) |
1053 | { | 1053 | { |
1054 | int i; | 1054 | int i; |
1055 | 1055 | ||
1056 | switch (band) { | 1056 | switch (band) { |
1057 | case IEEE80211_BAND_5GHZ: | 1057 | case NL80211_BAND_5GHZ: |
1058 | for (i = 14; i < il->channel_count; i++) { | 1058 | for (i = 14; i < il->channel_count; i++) { |
1059 | if (il->channel_info[i].channel == channel) | 1059 | if (il->channel_info[i].channel == channel) |
1060 | return &il->channel_info[i]; | 1060 | return &il->channel_info[i]; |
1061 | } | 1061 | } |
1062 | break; | 1062 | break; |
1063 | case IEEE80211_BAND_2GHZ: | 1063 | case NL80211_BAND_2GHZ: |
1064 | if (channel >= 1 && channel <= 14) | 1064 | if (channel >= 1 && channel <= 14) |
1065 | return &il->channel_info[channel - 1]; | 1065 | return &il->channel_info[channel - 1]; |
1066 | break; | 1066 | break; |
@@ -1457,7 +1457,7 @@ il_hdl_scan_complete(struct il_priv *il, struct il_rx_buf *rxb) | |||
1457 | clear_bit(S_SCAN_HW, &il->status); | 1457 | clear_bit(S_SCAN_HW, &il->status); |
1458 | 1458 | ||
1459 | D_SCAN("Scan on %sGHz took %dms\n", | 1459 | D_SCAN("Scan on %sGHz took %dms\n", |
1460 | (il->scan_band == IEEE80211_BAND_2GHZ) ? "2.4" : "5.2", | 1460 | (il->scan_band == NL80211_BAND_2GHZ) ? "2.4" : "5.2", |
1461 | jiffies_to_msecs(jiffies - il->scan_start)); | 1461 | jiffies_to_msecs(jiffies - il->scan_start)); |
1462 | 1462 | ||
1463 | queue_work(il->workqueue, &il->scan_completed); | 1463 | queue_work(il->workqueue, &il->scan_completed); |
@@ -1475,10 +1475,10 @@ il_setup_rx_scan_handlers(struct il_priv *il) | |||
1475 | EXPORT_SYMBOL(il_setup_rx_scan_handlers); | 1475 | EXPORT_SYMBOL(il_setup_rx_scan_handlers); |
1476 | 1476 | ||
1477 | u16 | 1477 | u16 |
1478 | il_get_active_dwell_time(struct il_priv *il, enum ieee80211_band band, | 1478 | il_get_active_dwell_time(struct il_priv *il, enum nl80211_band band, |
1479 | u8 n_probes) | 1479 | u8 n_probes) |
1480 | { | 1480 | { |
1481 | if (band == IEEE80211_BAND_5GHZ) | 1481 | if (band == NL80211_BAND_5GHZ) |
1482 | return IL_ACTIVE_DWELL_TIME_52 + | 1482 | return IL_ACTIVE_DWELL_TIME_52 + |
1483 | IL_ACTIVE_DWELL_FACTOR_52GHZ * (n_probes + 1); | 1483 | IL_ACTIVE_DWELL_FACTOR_52GHZ * (n_probes + 1); |
1484 | else | 1484 | else |
@@ -1488,14 +1488,14 @@ il_get_active_dwell_time(struct il_priv *il, enum ieee80211_band band, | |||
1488 | EXPORT_SYMBOL(il_get_active_dwell_time); | 1488 | EXPORT_SYMBOL(il_get_active_dwell_time); |
1489 | 1489 | ||
1490 | u16 | 1490 | u16 |
1491 | il_get_passive_dwell_time(struct il_priv *il, enum ieee80211_band band, | 1491 | il_get_passive_dwell_time(struct il_priv *il, enum nl80211_band band, |
1492 | struct ieee80211_vif *vif) | 1492 | struct ieee80211_vif *vif) |
1493 | { | 1493 | { |
1494 | u16 value; | 1494 | u16 value; |
1495 | 1495 | ||
1496 | u16 passive = | 1496 | u16 passive = |
1497 | (band == | 1497 | (band == |
1498 | IEEE80211_BAND_2GHZ) ? IL_PASSIVE_DWELL_BASE + | 1498 | NL80211_BAND_2GHZ) ? IL_PASSIVE_DWELL_BASE + |
1499 | IL_PASSIVE_DWELL_TIME_24 : IL_PASSIVE_DWELL_BASE + | 1499 | IL_PASSIVE_DWELL_TIME_24 : IL_PASSIVE_DWELL_BASE + |
1500 | IL_PASSIVE_DWELL_TIME_52; | 1500 | IL_PASSIVE_DWELL_TIME_52; |
1501 | 1501 | ||
@@ -1520,10 +1520,10 @@ void | |||
1520 | il_init_scan_params(struct il_priv *il) | 1520 | il_init_scan_params(struct il_priv *il) |
1521 | { | 1521 | { |
1522 | u8 ant_idx = fls(il->hw_params.valid_tx_ant) - 1; | 1522 | u8 ant_idx = fls(il->hw_params.valid_tx_ant) - 1; |
1523 | if (!il->scan_tx_ant[IEEE80211_BAND_5GHZ]) | 1523 | if (!il->scan_tx_ant[NL80211_BAND_5GHZ]) |
1524 | il->scan_tx_ant[IEEE80211_BAND_5GHZ] = ant_idx; | 1524 | il->scan_tx_ant[NL80211_BAND_5GHZ] = ant_idx; |
1525 | if (!il->scan_tx_ant[IEEE80211_BAND_2GHZ]) | 1525 | if (!il->scan_tx_ant[NL80211_BAND_2GHZ]) |
1526 | il->scan_tx_ant[IEEE80211_BAND_2GHZ] = ant_idx; | 1526 | il->scan_tx_ant[NL80211_BAND_2GHZ] = ant_idx; |
1527 | } | 1527 | } |
1528 | EXPORT_SYMBOL(il_init_scan_params); | 1528 | EXPORT_SYMBOL(il_init_scan_params); |
1529 | 1529 | ||
@@ -2003,7 +2003,7 @@ il_prep_station(struct il_priv *il, const u8 *addr, bool is_ap, | |||
2003 | il_set_ht_add_station(il, sta_id, sta); | 2003 | il_set_ht_add_station(il, sta_id, sta); |
2004 | 2004 | ||
2005 | /* 3945 only */ | 2005 | /* 3945 only */ |
2006 | rate = (il->band == IEEE80211_BAND_5GHZ) ? RATE_6M_PLCP : RATE_1M_PLCP; | 2006 | rate = (il->band == NL80211_BAND_5GHZ) ? RATE_6M_PLCP : RATE_1M_PLCP; |
2007 | /* Turn on both antennas for the station... */ | 2007 | /* Turn on both antennas for the station... */ |
2008 | station->sta.rate_n_flags = cpu_to_le16(rate | RATE_MCS_ANT_AB_MSK); | 2008 | station->sta.rate_n_flags = cpu_to_le16(rate | RATE_MCS_ANT_AB_MSK); |
2009 | 2009 | ||
@@ -3382,7 +3382,7 @@ EXPORT_SYMBOL(il_bcast_addr); | |||
3382 | static void | 3382 | static void |
3383 | il_init_ht_hw_capab(const struct il_priv *il, | 3383 | il_init_ht_hw_capab(const struct il_priv *il, |
3384 | struct ieee80211_sta_ht_cap *ht_info, | 3384 | struct ieee80211_sta_ht_cap *ht_info, |
3385 | enum ieee80211_band band) | 3385 | enum nl80211_band band) |
3386 | { | 3386 | { |
3387 | u16 max_bit_rate = 0; | 3387 | u16 max_bit_rate = 0; |
3388 | u8 rx_chains_num = il->hw_params.rx_chains_num; | 3388 | u8 rx_chains_num = il->hw_params.rx_chains_num; |
@@ -3443,8 +3443,8 @@ il_init_geos(struct il_priv *il) | |||
3443 | int i = 0; | 3443 | int i = 0; |
3444 | s8 max_tx_power = 0; | 3444 | s8 max_tx_power = 0; |
3445 | 3445 | ||
3446 | if (il->bands[IEEE80211_BAND_2GHZ].n_bitrates || | 3446 | if (il->bands[NL80211_BAND_2GHZ].n_bitrates || |
3447 | il->bands[IEEE80211_BAND_5GHZ].n_bitrates) { | 3447 | il->bands[NL80211_BAND_5GHZ].n_bitrates) { |
3448 | D_INFO("Geography modes already initialized.\n"); | 3448 | D_INFO("Geography modes already initialized.\n"); |
3449 | set_bit(S_GEO_CONFIGURED, &il->status); | 3449 | set_bit(S_GEO_CONFIGURED, &il->status); |
3450 | return 0; | 3450 | return 0; |
@@ -3465,23 +3465,23 @@ il_init_geos(struct il_priv *il) | |||
3465 | } | 3465 | } |
3466 | 3466 | ||
3467 | /* 5.2GHz channels start after the 2.4GHz channels */ | 3467 | /* 5.2GHz channels start after the 2.4GHz channels */ |
3468 | sband = &il->bands[IEEE80211_BAND_5GHZ]; | 3468 | sband = &il->bands[NL80211_BAND_5GHZ]; |
3469 | sband->channels = &channels[ARRAY_SIZE(il_eeprom_band_1)]; | 3469 | sband->channels = &channels[ARRAY_SIZE(il_eeprom_band_1)]; |
3470 | /* just OFDM */ | 3470 | /* just OFDM */ |
3471 | sband->bitrates = &rates[IL_FIRST_OFDM_RATE]; | 3471 | sband->bitrates = &rates[IL_FIRST_OFDM_RATE]; |
3472 | sband->n_bitrates = RATE_COUNT_LEGACY - IL_FIRST_OFDM_RATE; | 3472 | sband->n_bitrates = RATE_COUNT_LEGACY - IL_FIRST_OFDM_RATE; |
3473 | 3473 | ||
3474 | if (il->cfg->sku & IL_SKU_N) | 3474 | if (il->cfg->sku & IL_SKU_N) |
3475 | il_init_ht_hw_capab(il, &sband->ht_cap, IEEE80211_BAND_5GHZ); | 3475 | il_init_ht_hw_capab(il, &sband->ht_cap, NL80211_BAND_5GHZ); |
3476 | 3476 | ||
3477 | sband = &il->bands[IEEE80211_BAND_2GHZ]; | 3477 | sband = &il->bands[NL80211_BAND_2GHZ]; |
3478 | sband->channels = channels; | 3478 | sband->channels = channels; |
3479 | /* OFDM & CCK */ | 3479 | /* OFDM & CCK */ |
3480 | sband->bitrates = rates; | 3480 | sband->bitrates = rates; |
3481 | sband->n_bitrates = RATE_COUNT_LEGACY; | 3481 | sband->n_bitrates = RATE_COUNT_LEGACY; |
3482 | 3482 | ||
3483 | if (il->cfg->sku & IL_SKU_N) | 3483 | if (il->cfg->sku & IL_SKU_N) |
3484 | il_init_ht_hw_capab(il, &sband->ht_cap, IEEE80211_BAND_2GHZ); | 3484 | il_init_ht_hw_capab(il, &sband->ht_cap, NL80211_BAND_2GHZ); |
3485 | 3485 | ||
3486 | il->ieee_channels = channels; | 3486 | il->ieee_channels = channels; |
3487 | il->ieee_rates = rates; | 3487 | il->ieee_rates = rates; |
@@ -3532,7 +3532,7 @@ il_init_geos(struct il_priv *il) | |||
3532 | il->tx_power_user_lmt = max_tx_power; | 3532 | il->tx_power_user_lmt = max_tx_power; |
3533 | il->tx_power_next = max_tx_power; | 3533 | il->tx_power_next = max_tx_power; |
3534 | 3534 | ||
3535 | if (il->bands[IEEE80211_BAND_5GHZ].n_channels == 0 && | 3535 | if (il->bands[NL80211_BAND_5GHZ].n_channels == 0 && |
3536 | (il->cfg->sku & IL_SKU_A)) { | 3536 | (il->cfg->sku & IL_SKU_A)) { |
3537 | IL_INFO("Incorrectly detected BG card as ABG. " | 3537 | IL_INFO("Incorrectly detected BG card as ABG. " |
3538 | "Please send your PCI ID 0x%04X:0x%04X to maintainer.\n", | 3538 | "Please send your PCI ID 0x%04X:0x%04X to maintainer.\n", |
@@ -3541,8 +3541,8 @@ il_init_geos(struct il_priv *il) | |||
3541 | } | 3541 | } |
3542 | 3542 | ||
3543 | IL_INFO("Tunable channels: %d 802.11bg, %d 802.11a channels\n", | 3543 | IL_INFO("Tunable channels: %d 802.11bg, %d 802.11a channels\n", |
3544 | il->bands[IEEE80211_BAND_2GHZ].n_channels, | 3544 | il->bands[NL80211_BAND_2GHZ].n_channels, |
3545 | il->bands[IEEE80211_BAND_5GHZ].n_channels); | 3545 | il->bands[NL80211_BAND_5GHZ].n_channels); |
3546 | 3546 | ||
3547 | set_bit(S_GEO_CONFIGURED, &il->status); | 3547 | set_bit(S_GEO_CONFIGURED, &il->status); |
3548 | 3548 | ||
@@ -3563,7 +3563,7 @@ il_free_geos(struct il_priv *il) | |||
3563 | EXPORT_SYMBOL(il_free_geos); | 3563 | EXPORT_SYMBOL(il_free_geos); |
3564 | 3564 | ||
3565 | static bool | 3565 | static bool |
3566 | il_is_channel_extension(struct il_priv *il, enum ieee80211_band band, | 3566 | il_is_channel_extension(struct il_priv *il, enum nl80211_band band, |
3567 | u16 channel, u8 extension_chan_offset) | 3567 | u16 channel, u8 extension_chan_offset) |
3568 | { | 3568 | { |
3569 | const struct il_channel_info *ch_info; | 3569 | const struct il_channel_info *ch_info; |
@@ -3926,14 +3926,14 @@ EXPORT_SYMBOL(il_set_rxon_ht); | |||
3926 | 3926 | ||
3927 | /* Return valid, unused, channel for a passive scan to reset the RF */ | 3927 | /* Return valid, unused, channel for a passive scan to reset the RF */ |
3928 | u8 | 3928 | u8 |
3929 | il_get_single_channel_number(struct il_priv *il, enum ieee80211_band band) | 3929 | il_get_single_channel_number(struct il_priv *il, enum nl80211_band band) |
3930 | { | 3930 | { |
3931 | const struct il_channel_info *ch_info; | 3931 | const struct il_channel_info *ch_info; |
3932 | int i; | 3932 | int i; |
3933 | u8 channel = 0; | 3933 | u8 channel = 0; |
3934 | u8 min, max; | 3934 | u8 min, max; |
3935 | 3935 | ||
3936 | if (band == IEEE80211_BAND_5GHZ) { | 3936 | if (band == NL80211_BAND_5GHZ) { |
3937 | min = 14; | 3937 | min = 14; |
3938 | max = il->channel_count; | 3938 | max = il->channel_count; |
3939 | } else { | 3939 | } else { |
@@ -3965,14 +3965,14 @@ EXPORT_SYMBOL(il_get_single_channel_number); | |||
3965 | int | 3965 | int |
3966 | il_set_rxon_channel(struct il_priv *il, struct ieee80211_channel *ch) | 3966 | il_set_rxon_channel(struct il_priv *il, struct ieee80211_channel *ch) |
3967 | { | 3967 | { |
3968 | enum ieee80211_band band = ch->band; | 3968 | enum nl80211_band band = ch->band; |
3969 | u16 channel = ch->hw_value; | 3969 | u16 channel = ch->hw_value; |
3970 | 3970 | ||
3971 | if (le16_to_cpu(il->staging.channel) == channel && il->band == band) | 3971 | if (le16_to_cpu(il->staging.channel) == channel && il->band == band) |
3972 | return 0; | 3972 | return 0; |
3973 | 3973 | ||
3974 | il->staging.channel = cpu_to_le16(channel); | 3974 | il->staging.channel = cpu_to_le16(channel); |
3975 | if (band == IEEE80211_BAND_5GHZ) | 3975 | if (band == NL80211_BAND_5GHZ) |
3976 | il->staging.flags &= ~RXON_FLG_BAND_24G_MSK; | 3976 | il->staging.flags &= ~RXON_FLG_BAND_24G_MSK; |
3977 | else | 3977 | else |
3978 | il->staging.flags |= RXON_FLG_BAND_24G_MSK; | 3978 | il->staging.flags |= RXON_FLG_BAND_24G_MSK; |
@@ -3986,10 +3986,10 @@ il_set_rxon_channel(struct il_priv *il, struct ieee80211_channel *ch) | |||
3986 | EXPORT_SYMBOL(il_set_rxon_channel); | 3986 | EXPORT_SYMBOL(il_set_rxon_channel); |
3987 | 3987 | ||
3988 | void | 3988 | void |
3989 | il_set_flags_for_band(struct il_priv *il, enum ieee80211_band band, | 3989 | il_set_flags_for_band(struct il_priv *il, enum nl80211_band band, |
3990 | struct ieee80211_vif *vif) | 3990 | struct ieee80211_vif *vif) |
3991 | { | 3991 | { |
3992 | if (band == IEEE80211_BAND_5GHZ) { | 3992 | if (band == NL80211_BAND_5GHZ) { |
3993 | il->staging.flags &= | 3993 | il->staging.flags &= |
3994 | ~(RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK | | 3994 | ~(RXON_FLG_BAND_24G_MSK | RXON_FLG_AUTO_DETECT_MSK | |
3995 | RXON_FLG_CCK_MSK); | 3995 | RXON_FLG_CCK_MSK); |
@@ -5415,7 +5415,7 @@ il_mac_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
5415 | 5415 | ||
5416 | if (changes & BSS_CHANGED_ERP_CTS_PROT) { | 5416 | if (changes & BSS_CHANGED_ERP_CTS_PROT) { |
5417 | D_MAC80211("ERP_CTS %d\n", bss_conf->use_cts_prot); | 5417 | D_MAC80211("ERP_CTS %d\n", bss_conf->use_cts_prot); |
5418 | if (bss_conf->use_cts_prot && il->band != IEEE80211_BAND_5GHZ) | 5418 | if (bss_conf->use_cts_prot && il->band != NL80211_BAND_5GHZ) |
5419 | il->staging.flags |= RXON_FLG_TGG_PROTECT_MSK; | 5419 | il->staging.flags |= RXON_FLG_TGG_PROTECT_MSK; |
5420 | else | 5420 | else |
5421 | il->staging.flags &= ~RXON_FLG_TGG_PROTECT_MSK; | 5421 | il->staging.flags &= ~RXON_FLG_TGG_PROTECT_MSK; |