aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2008-06-11 21:47:00 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-14 12:18:06 -0400
commit963f55178b25cb673ab438edaae4127b1d014bc1 (patch)
tree0152c2829b8e79621e880bc9b289f016c78fc848 /drivers
parent838f8a748562265f8a5ad5c0c0ef8f454fcc28cf (diff)
iwlwifi: remove redundant flags regarding to FAT channel
This patch removes redundant flags regarding to FAT channel. Use mac80211's flag instead. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c42
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h14
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-eeprom.c19
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c6
4 files changed, 30 insertions, 51 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 6c7617c1bb9..fad26f71d7c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -478,24 +478,7 @@ static int iwlcore_init_geos(struct iwl_priv *priv)
478 if (ch->flags & EEPROM_CHANNEL_RADAR) 478 if (ch->flags & EEPROM_CHANNEL_RADAR)
479 geo_ch->flags |= IEEE80211_CHAN_RADAR; 479 geo_ch->flags |= IEEE80211_CHAN_RADAR;
480 480
481 switch (ch->fat_extension_channel) { 481 geo_ch->flags |= ch->fat_extension_channel;
482 case HT_IE_EXT_CHANNEL_ABOVE:
483 /* only above is allowed, disable below */
484 geo_ch->flags |= IEEE80211_CHAN_NO_FAT_BELOW;
485 break;
486 case HT_IE_EXT_CHANNEL_BELOW:
487 /* only below is allowed, disable above */
488 geo_ch->flags |= IEEE80211_CHAN_NO_FAT_ABOVE;
489 break;
490 case HT_IE_EXT_CHANNEL_NONE:
491 /* fat not allowed: disable both*/
492 geo_ch->flags |= (IEEE80211_CHAN_NO_FAT_ABOVE |
493 IEEE80211_CHAN_NO_FAT_BELOW);
494 break;
495 case HT_IE_EXT_CHANNEL_MAX:
496 /* both above and below are permitted */
497 break;
498 }
499 482
500 if (ch->max_power_avg > priv->max_channel_txpower_limit) 483 if (ch->max_power_avg > priv->max_channel_txpower_limit)
501 priv->max_channel_txpower_limit = 484 priv->max_channel_txpower_limit =
@@ -507,7 +490,7 @@ static int iwlcore_init_geos(struct iwl_priv *priv)
507 /* Save flags for reg domain usage */ 490 /* Save flags for reg domain usage */
508 geo_ch->orig_flags = geo_ch->flags; 491 geo_ch->orig_flags = geo_ch->flags;
509 492
510 IWL_DEBUG_INFO("Channel %d Freq=%d[%sGHz] %s flag=0%X\n", 493 IWL_DEBUG_INFO("Channel %d Freq=%d[%sGHz] %s flag=0x%X\n",
511 ch->channel, geo_ch->center_freq, 494 ch->channel, geo_ch->center_freq,
512 is_channel_a_band(ch) ? "5.2" : "2.4", 495 is_channel_a_band(ch) ? "5.2" : "2.4",
513 geo_ch->flags & IEEE80211_CHAN_DISABLED ? 496 geo_ch->flags & IEEE80211_CHAN_DISABLED ?
@@ -552,6 +535,7 @@ static u8 is_single_rx_stream(struct iwl_priv *priv)
552 (priv->current_ht_config.supp_mcs_set[2] == 0)) || 535 (priv->current_ht_config.supp_mcs_set[2] == 0)) ||
553 priv->ps_mode == IWL_MIMO_PS_STATIC; 536 priv->ps_mode == IWL_MIMO_PS_STATIC;
554} 537}
538
555static u8 iwl_is_channel_extension(struct iwl_priv *priv, 539static u8 iwl_is_channel_extension(struct iwl_priv *priv,
556 enum ieee80211_band band, 540 enum ieee80211_band band,
557 u16 channel, u8 extension_chan_offset) 541 u16 channel, u8 extension_chan_offset)
@@ -562,12 +546,12 @@ static u8 iwl_is_channel_extension(struct iwl_priv *priv,
562 if (!is_channel_valid(ch_info)) 546 if (!is_channel_valid(ch_info))
563 return 0; 547 return 0;
564 548
565 if (extension_chan_offset == IWL_EXT_CHANNEL_OFFSET_NONE) 549 if (extension_chan_offset == IEEE80211_HT_IE_CHA_SEC_ABOVE)
566 return 0; 550 return !(ch_info->fat_extension_channel &
567 551 IEEE80211_CHAN_NO_FAT_ABOVE);
568 if ((ch_info->fat_extension_channel == extension_chan_offset) || 552 else if (extension_chan_offset == IEEE80211_HT_IE_CHA_SEC_BELOW)
569 (ch_info->fat_extension_channel == HT_IE_EXT_CHANNEL_MAX)) 553 return !(ch_info->fat_extension_channel &
570 return 1; 554 IEEE80211_CHAN_NO_FAT_BELOW);
571 555
572 return 0; 556 return 0;
573} 557}
@@ -579,7 +563,7 @@ u8 iwl_is_fat_tx_allowed(struct iwl_priv *priv,
579 563
580 if ((!iwl_ht_conf->is_ht) || 564 if ((!iwl_ht_conf->is_ht) ||
581 (iwl_ht_conf->supported_chan_width != IWL_CHANNEL_WIDTH_40MHZ) || 565 (iwl_ht_conf->supported_chan_width != IWL_CHANNEL_WIDTH_40MHZ) ||
582 (iwl_ht_conf->extension_chan_offset == IWL_EXT_CHANNEL_OFFSET_NONE)) 566 (iwl_ht_conf->extension_chan_offset == IEEE80211_HT_IE_CHA_SEC_NONE))
583 return 0; 567 return 0;
584 568
585 if (sta_ht_inf) { 569 if (sta_ht_inf) {
@@ -619,13 +603,13 @@ void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_info *ht_info)
619 603
620 /* Note: control channel is opposite of extension channel */ 604 /* Note: control channel is opposite of extension channel */
621 switch (ht_info->extension_chan_offset) { 605 switch (ht_info->extension_chan_offset) {
622 case IWL_EXT_CHANNEL_OFFSET_ABOVE: 606 case IEEE80211_HT_IE_CHA_SEC_ABOVE:
623 rxon->flags &= ~(RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK); 607 rxon->flags &= ~(RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK);
624 break; 608 break;
625 case IWL_EXT_CHANNEL_OFFSET_BELOW: 609 case IEEE80211_HT_IE_CHA_SEC_BELOW:
626 rxon->flags |= RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK; 610 rxon->flags |= RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK;
627 break; 611 break;
628 case IWL_EXT_CHANNEL_OFFSET_NONE: 612 case IEEE80211_HT_IE_CHA_SEC_NONE:
629 default: 613 default:
630 rxon->flags &= ~RXON_FLG_CHANNEL_MODE_MIXED_MSK; 614 rxon->flags &= ~RXON_FLG_CHANNEL_MODE_MIXED_MSK;
631 break; 615 break;
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index fa35193e5a7..daa14d9e5a8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -179,15 +179,6 @@ struct iwl4965_scan_power_info {
179 s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */ 179 s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */
180}; 180};
181 181
182/* For fat_extension_channel */
183enum {
184 HT_IE_EXT_CHANNEL_NONE = 0,
185 HT_IE_EXT_CHANNEL_ABOVE,
186 HT_IE_EXT_CHANNEL_INVALID,
187 HT_IE_EXT_CHANNEL_BELOW,
188 HT_IE_EXT_CHANNEL_MAX
189};
190
191/* 182/*
192 * One for each channel, holds all channel setup data 183 * One for each channel, holds all channel setup data
193 * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant 184 * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant
@@ -782,11 +773,6 @@ struct iwl_kw {
782#define IWL_OPERATION_MODE_MIXED 2 773#define IWL_OPERATION_MODE_MIXED 2
783#define IWL_OPERATION_MODE_20MHZ 3 774#define IWL_OPERATION_MODE_20MHZ 3
784 775
785#define IWL_EXT_CHANNEL_OFFSET_NONE 0
786#define IWL_EXT_CHANNEL_OFFSET_ABOVE 1
787#define IWL_EXT_CHANNEL_OFFSET_RESERVE1 2
788#define IWL_EXT_CHANNEL_OFFSET_BELOW 3
789
790#define IWL_TX_CRC_SIZE 4 776#define IWL_TX_CRC_SIZE 4
791#define IWL_TX_DELIMITER_SIZE 4 777#define IWL_TX_DELIMITER_SIZE 4
792 778
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
index 11f9d9557a0..cbb812f9f62 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
@@ -470,6 +470,11 @@ int iwl_init_channel_map(struct iwl_priv *priv)
470 /* Copy the run-time flags so they are there even on 470 /* Copy the run-time flags so they are there even on
471 * invalid channels */ 471 * invalid channels */
472 ch_info->flags = eeprom_ch_info[ch].flags; 472 ch_info->flags = eeprom_ch_info[ch].flags;
473 /* First write that fat is not enabled, and then enable
474 * one by one */
475 ch_info->fat_extension_channel =
476 (IEEE80211_CHAN_NO_FAT_ABOVE |
477 IEEE80211_CHAN_NO_FAT_BELOW);
473 478
474 if (!(is_channel_valid(ch_info))) { 479 if (!(is_channel_valid(ch_info))) {
475 IWL_DEBUG_INFO("Ch. %d Flags %x [%sGHz] - " 480 IWL_DEBUG_INFO("Ch. %d Flags %x [%sGHz] - "
@@ -534,12 +539,14 @@ int iwl_init_channel_map(struct iwl_priv *priv)
534 for (ch = 0; ch < eeprom_ch_count; ch++) { 539 for (ch = 0; ch < eeprom_ch_count; ch++) {
535 540
536 if ((band == 6) && 541 if ((band == 6) &&
537 ((eeprom_ch_index[ch] == 5) || 542 ((eeprom_ch_index[ch] == 5) ||
538 (eeprom_ch_index[ch] == 6) || 543 (eeprom_ch_index[ch] == 6) ||
539 (eeprom_ch_index[ch] == 7))) 544 (eeprom_ch_index[ch] == 7)))
540 fat_extension_chan = HT_IE_EXT_CHANNEL_MAX; 545 /* both are allowed: above and below */
546 fat_extension_chan = 0;
541 else 547 else
542 fat_extension_chan = HT_IE_EXT_CHANNEL_ABOVE; 548 fat_extension_chan =
549 IEEE80211_CHAN_NO_FAT_BELOW;
543 550
544 /* Set up driver's info for lower half */ 551 /* Set up driver's info for lower half */
545 iwl_set_fat_chan_info(priv, ieeeband, 552 iwl_set_fat_chan_info(priv, ieeeband,
@@ -551,7 +558,7 @@ int iwl_init_channel_map(struct iwl_priv *priv)
551 iwl_set_fat_chan_info(priv, ieeeband, 558 iwl_set_fat_chan_info(priv, ieeeband,
552 (eeprom_ch_index[ch] + 4), 559 (eeprom_ch_index[ch] + 4),
553 &(eeprom_ch_info[ch]), 560 &(eeprom_ch_info[ch]),
554 HT_IE_EXT_CHANNEL_BELOW); 561 IEEE80211_CHAN_NO_FAT_ABOVE);
555 } 562 }
556 } 563 }
557 564
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 0acd42bd43c..de40e893f09 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -664,9 +664,11 @@ static void iwl4965_ht_conf(struct iwl_priv *priv,
664 iwl_conf->extension_chan_offset = 664 iwl_conf->extension_chan_offset =
665 ht_bss_conf->bss_cap & IEEE80211_HT_IE_CHA_SEC_OFFSET; 665 ht_bss_conf->bss_cap & IEEE80211_HT_IE_CHA_SEC_OFFSET;
666 /* If no above or below channel supplied disable FAT channel */ 666 /* If no above or below channel supplied disable FAT channel */
667 if (iwl_conf->extension_chan_offset != IWL_EXT_CHANNEL_OFFSET_ABOVE && 667 if (iwl_conf->extension_chan_offset != IEEE80211_HT_IE_CHA_SEC_ABOVE &&
668 iwl_conf->extension_chan_offset != IWL_EXT_CHANNEL_OFFSET_BELOW) 668 iwl_conf->extension_chan_offset != IEEE80211_HT_IE_CHA_SEC_BELOW) {
669 iwl_conf->extension_chan_offset = IEEE80211_HT_IE_CHA_SEC_NONE;
669 iwl_conf->supported_chan_width = 0; 670 iwl_conf->supported_chan_width = 0;
671 }
670 672
671 iwl_conf->tx_mimo_ps_mode = 673 iwl_conf->tx_mimo_ps_mode =
672 (u8)((ht_conf->cap & IEEE80211_HT_CAP_MIMO_PS) >> 2); 674 (u8)((ht_conf->cap & IEEE80211_HT_CAP_MIMO_PS) >> 2);