diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-5000.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 165 |
1 files changed, 91 insertions, 74 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index 89d92a8ca157..e3cba61d1543 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include "iwl-sta.h" | 43 | #include "iwl-sta.h" |
44 | #include "iwl-helpers.h" | 44 | #include "iwl-helpers.h" |
45 | #include "iwl-5000-hw.h" | 45 | #include "iwl-5000-hw.h" |
46 | #include "iwl-6000-hw.h" | ||
46 | 47 | ||
47 | /* Highest firmware API version supported */ | 48 | /* Highest firmware API version supported */ |
48 | #define IWL5000_UCODE_API_MAX 1 | 49 | #define IWL5000_UCODE_API_MAX 1 |
@@ -84,7 +85,7 @@ static int iwl5000_apm_stop_master(struct iwl_priv *priv) | |||
84 | CSR_RESET_REG_FLAG_MASTER_DISABLED, 100); | 85 | CSR_RESET_REG_FLAG_MASTER_DISABLED, 100); |
85 | 86 | ||
86 | spin_unlock_irqrestore(&priv->lock, flags); | 87 | spin_unlock_irqrestore(&priv->lock, flags); |
87 | IWL_DEBUG_INFO("stop master\n"); | 88 | IWL_DEBUG_INFO(priv, "stop master\n"); |
88 | 89 | ||
89 | return 0; | 90 | return 0; |
90 | } | 91 | } |
@@ -108,7 +109,8 @@ static int iwl5000_apm_init(struct iwl_priv *priv) | |||
108 | iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, | 109 | iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, |
109 | CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A); | 110 | CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A); |
110 | 111 | ||
111 | iwl_set_bit(priv, CSR_ANA_PLL_CFG, CSR50_ANA_PLL_CFG_VAL); | 112 | if (priv->cfg->need_pll_cfg) |
113 | iwl_set_bit(priv, CSR_ANA_PLL_CFG, CSR50_ANA_PLL_CFG_VAL); | ||
112 | 114 | ||
113 | /* set "initialization complete" bit to move adapter | 115 | /* set "initialization complete" bit to move adapter |
114 | * D0U* --> D0A* state */ | 116 | * D0U* --> D0A* state */ |
@@ -118,7 +120,7 @@ static int iwl5000_apm_init(struct iwl_priv *priv) | |||
118 | ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL, | 120 | ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL, |
119 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); | 121 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); |
120 | if (ret < 0) { | 122 | if (ret < 0) { |
121 | IWL_DEBUG_INFO("Failed to init the card\n"); | 123 | IWL_DEBUG_INFO(priv, "Failed to init the card\n"); |
122 | return ret; | 124 | return ret; |
123 | } | 125 | } |
124 | 126 | ||
@@ -176,7 +178,8 @@ static int iwl5000_apm_reset(struct iwl_priv *priv) | |||
176 | 178 | ||
177 | /* FIXME: put here L1A -L0S w/a */ | 179 | /* FIXME: put here L1A -L0S w/a */ |
178 | 180 | ||
179 | iwl_set_bit(priv, CSR_ANA_PLL_CFG, CSR50_ANA_PLL_CFG_VAL); | 181 | if (priv->cfg->need_pll_cfg) |
182 | iwl_set_bit(priv, CSR_ANA_PLL_CFG, CSR50_ANA_PLL_CFG_VAL); | ||
180 | 183 | ||
181 | /* set "initialization complete" bit to move adapter | 184 | /* set "initialization complete" bit to move adapter |
182 | * D0U* --> D0A* state */ | 185 | * D0U* --> D0A* state */ |
@@ -186,7 +189,7 @@ static int iwl5000_apm_reset(struct iwl_priv *priv) | |||
186 | ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL, | 189 | ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL, |
187 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); | 190 | CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); |
188 | if (ret < 0) { | 191 | if (ret < 0) { |
189 | IWL_DEBUG_INFO("Failed to init the card\n"); | 192 | IWL_DEBUG_INFO(priv, "Failed to init the card\n"); |
190 | goto out; | 193 | goto out; |
191 | } | 194 | } |
192 | 195 | ||
@@ -338,7 +341,7 @@ static void iwl5000_gain_computation(struct iwl_priv *priv, | |||
338 | data->delta_gain_code[i] |= (1 << 2); | 341 | data->delta_gain_code[i] |= (1 << 2); |
339 | } | 342 | } |
340 | 343 | ||
341 | IWL_DEBUG_CALIB("Delta gains: ANT_B = %d ANT_C = %d\n", | 344 | IWL_DEBUG_CALIB(priv, "Delta gains: ANT_B = %d ANT_C = %d\n", |
342 | data->delta_gain_code[1], data->delta_gain_code[2]); | 345 | data->delta_gain_code[1], data->delta_gain_code[2]); |
343 | 346 | ||
344 | if (!data->radio_write) { | 347 | if (!data->radio_write) { |
@@ -387,11 +390,11 @@ static void iwl5000_chain_noise_reset(struct iwl_priv *priv) | |||
387 | IWL_ERR(priv, | 390 | IWL_ERR(priv, |
388 | "Could not send REPLY_PHY_CALIBRATION_CMD\n"); | 391 | "Could not send REPLY_PHY_CALIBRATION_CMD\n"); |
389 | data->state = IWL_CHAIN_NOISE_ACCUMULATE; | 392 | data->state = IWL_CHAIN_NOISE_ACCUMULATE; |
390 | IWL_DEBUG_CALIB("Run chain_noise_calibrate\n"); | 393 | IWL_DEBUG_CALIB(priv, "Run chain_noise_calibrate\n"); |
391 | } | 394 | } |
392 | } | 395 | } |
393 | 396 | ||
394 | static void iwl5000_rts_tx_cmd_flag(struct ieee80211_tx_info *info, | 397 | void iwl5000_rts_tx_cmd_flag(struct ieee80211_tx_info *info, |
395 | __le32 *tx_flags) | 398 | __le32 *tx_flags) |
396 | { | 399 | { |
397 | if ((info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) || | 400 | if ((info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) || |
@@ -518,7 +521,7 @@ static void iwl5000_rx_calib_result(struct iwl_priv *priv, | |||
518 | static void iwl5000_rx_calib_complete(struct iwl_priv *priv, | 521 | static void iwl5000_rx_calib_complete(struct iwl_priv *priv, |
519 | struct iwl_rx_mem_buffer *rxb) | 522 | struct iwl_rx_mem_buffer *rxb) |
520 | { | 523 | { |
521 | IWL_DEBUG_INFO("Init. calibration is completed, restarting fw.\n"); | 524 | IWL_DEBUG_INFO(priv, "Init. calibration is completed, restarting fw.\n"); |
522 | queue_work(priv->workqueue, &priv->restart); | 525 | queue_work(priv->workqueue, &priv->restart); |
523 | } | 526 | } |
524 | 527 | ||
@@ -586,7 +589,7 @@ static int iwl5000_load_given_ucode(struct iwl_priv *priv, | |||
586 | if (ret) | 589 | if (ret) |
587 | return ret; | 590 | return ret; |
588 | 591 | ||
589 | IWL_DEBUG_INFO("INST uCode section being loaded...\n"); | 592 | IWL_DEBUG_INFO(priv, "INST uCode section being loaded...\n"); |
590 | ret = wait_event_interruptible_timeout(priv->wait_command_queue, | 593 | ret = wait_event_interruptible_timeout(priv->wait_command_queue, |
591 | priv->ucode_write_complete, 5 * HZ); | 594 | priv->ucode_write_complete, 5 * HZ); |
592 | if (ret == -ERESTARTSYS) { | 595 | if (ret == -ERESTARTSYS) { |
@@ -606,7 +609,7 @@ static int iwl5000_load_given_ucode(struct iwl_priv *priv, | |||
606 | if (ret) | 609 | if (ret) |
607 | return ret; | 610 | return ret; |
608 | 611 | ||
609 | IWL_DEBUG_INFO("DATA uCode section being loaded...\n"); | 612 | IWL_DEBUG_INFO(priv, "DATA uCode section being loaded...\n"); |
610 | 613 | ||
611 | ret = wait_event_interruptible_timeout(priv->wait_command_queue, | 614 | ret = wait_event_interruptible_timeout(priv->wait_command_queue, |
612 | priv->ucode_write_complete, 5 * HZ); | 615 | priv->ucode_write_complete, 5 * HZ); |
@@ -631,20 +634,20 @@ static int iwl5000_load_ucode(struct iwl_priv *priv) | |||
631 | 634 | ||
632 | /* check whether init ucode should be loaded, or rather runtime ucode */ | 635 | /* check whether init ucode should be loaded, or rather runtime ucode */ |
633 | if (priv->ucode_init.len && (priv->ucode_type == UCODE_NONE)) { | 636 | if (priv->ucode_init.len && (priv->ucode_type == UCODE_NONE)) { |
634 | IWL_DEBUG_INFO("Init ucode found. Loading init ucode...\n"); | 637 | IWL_DEBUG_INFO(priv, "Init ucode found. Loading init ucode...\n"); |
635 | ret = iwl5000_load_given_ucode(priv, | 638 | ret = iwl5000_load_given_ucode(priv, |
636 | &priv->ucode_init, &priv->ucode_init_data); | 639 | &priv->ucode_init, &priv->ucode_init_data); |
637 | if (!ret) { | 640 | if (!ret) { |
638 | IWL_DEBUG_INFO("Init ucode load complete.\n"); | 641 | IWL_DEBUG_INFO(priv, "Init ucode load complete.\n"); |
639 | priv->ucode_type = UCODE_INIT; | 642 | priv->ucode_type = UCODE_INIT; |
640 | } | 643 | } |
641 | } else { | 644 | } else { |
642 | IWL_DEBUG_INFO("Init ucode not found, or already loaded. " | 645 | IWL_DEBUG_INFO(priv, "Init ucode not found, or already loaded. " |
643 | "Loading runtime ucode...\n"); | 646 | "Loading runtime ucode...\n"); |
644 | ret = iwl5000_load_given_ucode(priv, | 647 | ret = iwl5000_load_given_ucode(priv, |
645 | &priv->ucode_code, &priv->ucode_data); | 648 | &priv->ucode_code, &priv->ucode_data); |
646 | if (!ret) { | 649 | if (!ret) { |
647 | IWL_DEBUG_INFO("Runtime ucode load complete.\n"); | 650 | IWL_DEBUG_INFO(priv, "Runtime ucode load complete.\n"); |
648 | priv->ucode_type = UCODE_RT; | 651 | priv->ucode_type = UCODE_RT; |
649 | } | 652 | } |
650 | } | 653 | } |
@@ -660,7 +663,7 @@ static void iwl5000_init_alive_start(struct iwl_priv *priv) | |||
660 | if (priv->card_alive_init.is_valid != UCODE_VALID_OK) { | 663 | if (priv->card_alive_init.is_valid != UCODE_VALID_OK) { |
661 | /* We had an error bringing up the hardware, so take it | 664 | /* We had an error bringing up the hardware, so take it |
662 | * all the way back down so we can try again */ | 665 | * all the way back down so we can try again */ |
663 | IWL_DEBUG_INFO("Initialize Alive failed.\n"); | 666 | IWL_DEBUG_INFO(priv, "Initialize Alive failed.\n"); |
664 | goto restart; | 667 | goto restart; |
665 | } | 668 | } |
666 | 669 | ||
@@ -670,7 +673,7 @@ static void iwl5000_init_alive_start(struct iwl_priv *priv) | |||
670 | if (iwl_verify_ucode(priv)) { | 673 | if (iwl_verify_ucode(priv)) { |
671 | /* Runtime instruction load was bad; | 674 | /* Runtime instruction load was bad; |
672 | * take it all the way back down so we can try again */ | 675 | * take it all the way back down so we can try again */ |
673 | IWL_DEBUG_INFO("Bad \"initialize\" uCode load.\n"); | 676 | IWL_DEBUG_INFO(priv, "Bad \"initialize\" uCode load.\n"); |
674 | goto restart; | 677 | goto restart; |
675 | } | 678 | } |
676 | 679 | ||
@@ -713,7 +716,7 @@ static void iwl5000_tx_queue_set_status(struct iwl_priv *priv, | |||
713 | 716 | ||
714 | txq->sched_retry = scd_retry; | 717 | txq->sched_retry = scd_retry; |
715 | 718 | ||
716 | IWL_DEBUG_INFO("%s %s Queue %d on AC %d\n", | 719 | IWL_DEBUG_INFO(priv, "%s %s Queue %d on AC %d\n", |
717 | active ? "Activate" : "Deactivate", | 720 | active ? "Activate" : "Deactivate", |
718 | scd_retry ? "BA" : "AC", txq_id, tx_fifo_id); | 721 | scd_retry ? "BA" : "AC", txq_id, tx_fifo_id); |
719 | } | 722 | } |
@@ -840,8 +843,18 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv) | |||
840 | priv->hw_params.tfd_size = sizeof(struct iwl_tfd); | 843 | priv->hw_params.tfd_size = sizeof(struct iwl_tfd); |
841 | priv->hw_params.max_stations = IWL5000_STATION_COUNT; | 844 | priv->hw_params.max_stations = IWL5000_STATION_COUNT; |
842 | priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID; | 845 | priv->hw_params.bcast_sta_id = IWL5000_BROADCAST_ID; |
843 | priv->hw_params.max_data_size = IWL50_RTC_DATA_SIZE; | 846 | |
844 | priv->hw_params.max_inst_size = IWL50_RTC_INST_SIZE; | 847 | switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { |
848 | case CSR_HW_REV_TYPE_6x00: | ||
849 | case CSR_HW_REV_TYPE_6x50: | ||
850 | priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE; | ||
851 | priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE; | ||
852 | break; | ||
853 | default: | ||
854 | priv->hw_params.max_data_size = IWL50_RTC_DATA_SIZE; | ||
855 | priv->hw_params.max_inst_size = IWL50_RTC_INST_SIZE; | ||
856 | } | ||
857 | |||
845 | priv->hw_params.max_bsm_size = 0; | 858 | priv->hw_params.max_bsm_size = 0; |
846 | priv->hw_params.fat_channel = BIT(IEEE80211_BAND_2GHZ) | | 859 | priv->hw_params.fat_channel = BIT(IEEE80211_BAND_2GHZ) | |
847 | BIT(IEEE80211_BAND_5GHZ); | 860 | BIT(IEEE80211_BAND_5GHZ); |
@@ -849,61 +862,40 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv) | |||
849 | 862 | ||
850 | priv->hw_params.sens = &iwl5000_sensitivity; | 863 | priv->hw_params.sens = &iwl5000_sensitivity; |
851 | 864 | ||
852 | switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { | 865 | priv->hw_params.tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant); |
853 | case CSR_HW_REV_TYPE_5100: | 866 | priv->hw_params.rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant); |
854 | priv->hw_params.tx_chains_num = 1; | 867 | priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant; |
855 | priv->hw_params.rx_chains_num = 2; | 868 | priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant; |
856 | priv->hw_params.valid_tx_ant = ANT_B; | ||
857 | priv->hw_params.valid_rx_ant = ANT_AB; | ||
858 | break; | ||
859 | case CSR_HW_REV_TYPE_5150: | ||
860 | priv->hw_params.tx_chains_num = 1; | ||
861 | priv->hw_params.rx_chains_num = 2; | ||
862 | priv->hw_params.valid_tx_ant = ANT_A; | ||
863 | priv->hw_params.valid_rx_ant = ANT_AB; | ||
864 | break; | ||
865 | case CSR_HW_REV_TYPE_5300: | ||
866 | case CSR_HW_REV_TYPE_5350: | ||
867 | priv->hw_params.tx_chains_num = 3; | ||
868 | priv->hw_params.rx_chains_num = 3; | ||
869 | priv->hw_params.valid_tx_ant = ANT_ABC; | ||
870 | priv->hw_params.valid_rx_ant = ANT_ABC; | ||
871 | break; | ||
872 | } | ||
873 | 869 | ||
874 | switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { | 870 | switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { |
875 | case CSR_HW_REV_TYPE_5100: | ||
876 | case CSR_HW_REV_TYPE_5300: | ||
877 | case CSR_HW_REV_TYPE_5350: | ||
878 | /* 5X00 and 5350 wants in Celsius */ | ||
879 | priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD; | ||
880 | break; | ||
881 | case CSR_HW_REV_TYPE_5150: | 871 | case CSR_HW_REV_TYPE_5150: |
882 | /* 5150 wants in Kelvin */ | 872 | /* 5150 wants in Kelvin */ |
883 | priv->hw_params.ct_kill_threshold = | 873 | priv->hw_params.ct_kill_threshold = |
884 | iwl5150_get_ct_threshold(priv); | 874 | iwl5150_get_ct_threshold(priv); |
885 | break; | 875 | break; |
876 | default: | ||
877 | /* all others want Celsius */ | ||
878 | priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD; | ||
879 | break; | ||
886 | } | 880 | } |
887 | 881 | ||
888 | /* Set initial calibration set */ | 882 | /* Set initial calibration set */ |
889 | switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { | 883 | switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { |
890 | case CSR_HW_REV_TYPE_5100: | 884 | case CSR_HW_REV_TYPE_5150: |
891 | case CSR_HW_REV_TYPE_5300: | ||
892 | case CSR_HW_REV_TYPE_5350: | ||
893 | priv->hw_params.calib_init_cfg = | 885 | priv->hw_params.calib_init_cfg = |
894 | BIT(IWL_CALIB_XTAL) | | 886 | BIT(IWL_CALIB_DC) | |
895 | BIT(IWL_CALIB_LO) | | 887 | BIT(IWL_CALIB_LO) | |
896 | BIT(IWL_CALIB_TX_IQ) | | 888 | BIT(IWL_CALIB_TX_IQ) | |
897 | BIT(IWL_CALIB_TX_IQ_PERD) | | ||
898 | BIT(IWL_CALIB_BASE_BAND); | 889 | BIT(IWL_CALIB_BASE_BAND); |
890 | |||
899 | break; | 891 | break; |
900 | case CSR_HW_REV_TYPE_5150: | 892 | default: |
901 | priv->hw_params.calib_init_cfg = | 893 | priv->hw_params.calib_init_cfg = |
902 | BIT(IWL_CALIB_DC) | | 894 | BIT(IWL_CALIB_XTAL) | |
903 | BIT(IWL_CALIB_LO) | | 895 | BIT(IWL_CALIB_LO) | |
904 | BIT(IWL_CALIB_TX_IQ) | | 896 | BIT(IWL_CALIB_TX_IQ) | |
897 | BIT(IWL_CALIB_TX_IQ_PERD) | | ||
905 | BIT(IWL_CALIB_BASE_BAND); | 898 | BIT(IWL_CALIB_BASE_BAND); |
906 | |||
907 | break; | 899 | break; |
908 | } | 900 | } |
909 | 901 | ||
@@ -1113,7 +1105,7 @@ static int iwl5000_txq_agg_disable(struct iwl_priv *priv, u16 txq_id, | |||
1113 | return 0; | 1105 | return 0; |
1114 | } | 1106 | } |
1115 | 1107 | ||
1116 | static u16 iwl5000_build_addsta_hcmd(const struct iwl_addsta_cmd *cmd, u8 *data) | 1108 | u16 iwl5000_build_addsta_hcmd(const struct iwl_addsta_cmd *cmd, u8 *data) |
1117 | { | 1109 | { |
1118 | u16 size = (u16)sizeof(struct iwl_addsta_cmd); | 1110 | u16 size = (u16)sizeof(struct iwl_addsta_cmd); |
1119 | memcpy(data, cmd, size); | 1111 | memcpy(data, cmd, size); |
@@ -1151,7 +1143,7 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv, | |||
1151 | u16 seq; | 1143 | u16 seq; |
1152 | 1144 | ||
1153 | if (agg->wait_for_ba) | 1145 | if (agg->wait_for_ba) |
1154 | IWL_DEBUG_TX_REPLY("got tx response w/o block-ack\n"); | 1146 | IWL_DEBUG_TX_REPLY(priv, "got tx response w/o block-ack\n"); |
1155 | 1147 | ||
1156 | agg->frame_count = tx_resp->frame_count; | 1148 | agg->frame_count = tx_resp->frame_count; |
1157 | agg->start_idx = start_idx; | 1149 | agg->start_idx = start_idx; |
@@ -1165,7 +1157,7 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv, | |||
1165 | idx = start_idx; | 1157 | idx = start_idx; |
1166 | 1158 | ||
1167 | /* FIXME: code repetition */ | 1159 | /* FIXME: code repetition */ |
1168 | IWL_DEBUG_TX_REPLY("FrameCnt = %d, StartIdx=%d idx=%d\n", | 1160 | IWL_DEBUG_TX_REPLY(priv, "FrameCnt = %d, StartIdx=%d idx=%d\n", |
1169 | agg->frame_count, agg->start_idx, idx); | 1161 | agg->frame_count, agg->start_idx, idx); |
1170 | 1162 | ||
1171 | info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]); | 1163 | info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]); |
@@ -1177,9 +1169,9 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv, | |||
1177 | 1169 | ||
1178 | /* FIXME: code repetition end */ | 1170 | /* FIXME: code repetition end */ |
1179 | 1171 | ||
1180 | IWL_DEBUG_TX_REPLY("1 Frame 0x%x failure :%d\n", | 1172 | IWL_DEBUG_TX_REPLY(priv, "1 Frame 0x%x failure :%d\n", |
1181 | status & 0xff, tx_resp->failure_frame); | 1173 | status & 0xff, tx_resp->failure_frame); |
1182 | IWL_DEBUG_TX_REPLY("Rate Info rate_n_flags=%x\n", rate_n_flags); | 1174 | IWL_DEBUG_TX_REPLY(priv, "Rate Info rate_n_flags=%x\n", rate_n_flags); |
1183 | 1175 | ||
1184 | agg->wait_for_ba = 0; | 1176 | agg->wait_for_ba = 0; |
1185 | } else { | 1177 | } else { |
@@ -1199,7 +1191,7 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv, | |||
1199 | AGG_TX_STATE_ABORT_MSK)) | 1191 | AGG_TX_STATE_ABORT_MSK)) |
1200 | continue; | 1192 | continue; |
1201 | 1193 | ||
1202 | IWL_DEBUG_TX_REPLY("FrameCnt = %d, txq_id=%d idx=%d\n", | 1194 | IWL_DEBUG_TX_REPLY(priv, "FrameCnt = %d, txq_id=%d idx=%d\n", |
1203 | agg->frame_count, txq_id, idx); | 1195 | agg->frame_count, txq_id, idx); |
1204 | 1196 | ||
1205 | hdr = iwl_tx_queue_get_hdr(priv, txq_id, idx); | 1197 | hdr = iwl_tx_queue_get_hdr(priv, txq_id, idx); |
@@ -1214,7 +1206,7 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv, | |||
1214 | return -1; | 1206 | return -1; |
1215 | } | 1207 | } |
1216 | 1208 | ||
1217 | IWL_DEBUG_TX_REPLY("AGG Frame i=%d idx %d seq=%d\n", | 1209 | IWL_DEBUG_TX_REPLY(priv, "AGG Frame i=%d idx %d seq=%d\n", |
1218 | i, idx, SEQ_TO_SN(sc)); | 1210 | i, idx, SEQ_TO_SN(sc)); |
1219 | 1211 | ||
1220 | sh = idx - start; | 1212 | sh = idx - start; |
@@ -1232,13 +1224,13 @@ static int iwl5000_tx_status_reply_tx(struct iwl_priv *priv, | |||
1232 | sh = 0; | 1224 | sh = 0; |
1233 | } | 1225 | } |
1234 | bitmap |= 1ULL << sh; | 1226 | bitmap |= 1ULL << sh; |
1235 | IWL_DEBUG_TX_REPLY("start=%d bitmap=0x%llx\n", | 1227 | IWL_DEBUG_TX_REPLY(priv, "start=%d bitmap=0x%llx\n", |
1236 | start, (unsigned long long)bitmap); | 1228 | start, (unsigned long long)bitmap); |
1237 | } | 1229 | } |
1238 | 1230 | ||
1239 | agg->bitmap = bitmap; | 1231 | agg->bitmap = bitmap; |
1240 | agg->start_idx = start; | 1232 | agg->start_idx = start; |
1241 | IWL_DEBUG_TX_REPLY("Frames %d start_idx=%d bitmap=0x%llx\n", | 1233 | IWL_DEBUG_TX_REPLY(priv, "Frames %d start_idx=%d bitmap=0x%llx\n", |
1242 | agg->frame_count, agg->start_idx, | 1234 | agg->frame_count, agg->start_idx, |
1243 | (unsigned long long)agg->bitmap); | 1235 | (unsigned long long)agg->bitmap); |
1244 | 1236 | ||
@@ -1291,7 +1283,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv, | |||
1291 | 1283 | ||
1292 | if (txq->q.read_ptr != (scd_ssn & 0xff)) { | 1284 | if (txq->q.read_ptr != (scd_ssn & 0xff)) { |
1293 | index = iwl_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd); | 1285 | index = iwl_queue_dec_wrap(scd_ssn & 0xff, txq->q.n_bd); |
1294 | IWL_DEBUG_TX_REPLY("Retry scheduler reclaim " | 1286 | IWL_DEBUG_TX_REPLY(priv, "Retry scheduler reclaim " |
1295 | "scd_ssn=%d idx=%d txq=%d swq=%d\n", | 1287 | "scd_ssn=%d idx=%d txq=%d swq=%d\n", |
1296 | scd_ssn , index, txq_id, txq->swq_id); | 1288 | scd_ssn , index, txq_id, txq->swq_id); |
1297 | 1289 | ||
@@ -1318,7 +1310,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv, | |||
1318 | le32_to_cpu(tx_resp->rate_n_flags), | 1310 | le32_to_cpu(tx_resp->rate_n_flags), |
1319 | info); | 1311 | info); |
1320 | 1312 | ||
1321 | IWL_DEBUG_TX_REPLY("TXQ %d status %s (0x%08x) rate_n_flags " | 1313 | IWL_DEBUG_TX_REPLY(priv, "TXQ %d status %s (0x%08x) rate_n_flags " |
1322 | "0x%x retries %d\n", | 1314 | "0x%x retries %d\n", |
1323 | txq_id, | 1315 | txq_id, |
1324 | iwl_get_tx_fail_reason(status), status, | 1316 | iwl_get_tx_fail_reason(status), status, |
@@ -1342,7 +1334,7 @@ static void iwl5000_rx_reply_tx(struct iwl_priv *priv, | |||
1342 | } | 1334 | } |
1343 | 1335 | ||
1344 | /* Currently 5000 is the superset of everything */ | 1336 | /* Currently 5000 is the superset of everything */ |
1345 | static u16 iwl5000_get_hcmd_size(u8 cmd_id, u16 len) | 1337 | u16 iwl5000_get_hcmd_size(u8 cmd_id, u16 len) |
1346 | { | 1338 | { |
1347 | return len; | 1339 | return len; |
1348 | } | 1340 | } |
@@ -1389,7 +1381,7 @@ static int iwl5000_send_rxon_assoc(struct iwl_priv *priv) | |||
1389 | (rxon1->acquisition_data == rxon2->acquisition_data) && | 1381 | (rxon1->acquisition_data == rxon2->acquisition_data) && |
1390 | (rxon1->rx_chain == rxon2->rx_chain) && | 1382 | (rxon1->rx_chain == rxon2->rx_chain) && |
1391 | (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) { | 1383 | (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) { |
1392 | IWL_DEBUG_INFO("Using current RXON_ASSOC. Not resending.\n"); | 1384 | IWL_DEBUG_INFO(priv, "Using current RXON_ASSOC. Not resending.\n"); |
1393 | return 0; | 1385 | return 0; |
1394 | } | 1386 | } |
1395 | 1387 | ||
@@ -1419,12 +1411,19 @@ static int iwl5000_send_rxon_assoc(struct iwl_priv *priv) | |||
1419 | static int iwl5000_send_tx_power(struct iwl_priv *priv) | 1411 | static int iwl5000_send_tx_power(struct iwl_priv *priv) |
1420 | { | 1412 | { |
1421 | struct iwl5000_tx_power_dbm_cmd tx_power_cmd; | 1413 | struct iwl5000_tx_power_dbm_cmd tx_power_cmd; |
1414 | u8 tx_ant_cfg_cmd; | ||
1422 | 1415 | ||
1423 | /* half dBm need to multiply */ | 1416 | /* half dBm need to multiply */ |
1424 | tx_power_cmd.global_lmt = (s8)(2 * priv->tx_power_user_lmt); | 1417 | tx_power_cmd.global_lmt = (s8)(2 * priv->tx_power_user_lmt); |
1425 | tx_power_cmd.flags = IWL50_TX_POWER_NO_CLOSED; | 1418 | tx_power_cmd.flags = IWL50_TX_POWER_NO_CLOSED; |
1426 | tx_power_cmd.srv_chan_lmt = IWL50_TX_POWER_AUTO; | 1419 | tx_power_cmd.srv_chan_lmt = IWL50_TX_POWER_AUTO; |
1427 | return iwl_send_cmd_pdu_async(priv, REPLY_TX_POWER_DBM_CMD, | 1420 | |
1421 | if (IWL_UCODE_API(priv->ucode_ver) == 1) | ||
1422 | tx_ant_cfg_cmd = REPLY_TX_POWER_DBM_CMD_V1; | ||
1423 | else | ||
1424 | tx_ant_cfg_cmd = REPLY_TX_POWER_DBM_CMD; | ||
1425 | |||
1426 | return iwl_send_cmd_pdu_async(priv, tx_ant_cfg_cmd, | ||
1428 | sizeof(tx_power_cmd), &tx_power_cmd, | 1427 | sizeof(tx_power_cmd), &tx_power_cmd, |
1429 | NULL); | 1428 | NULL); |
1430 | } | 1429 | } |
@@ -1436,7 +1435,7 @@ static void iwl5000_temperature(struct iwl_priv *priv) | |||
1436 | } | 1435 | } |
1437 | 1436 | ||
1438 | /* Calc max signal level (dBm) among 3 possible receivers */ | 1437 | /* Calc max signal level (dBm) among 3 possible receivers */ |
1439 | static int iwl5000_calc_rssi(struct iwl_priv *priv, | 1438 | int iwl5000_calc_rssi(struct iwl_priv *priv, |
1440 | struct iwl_rx_phy_res *rx_resp) | 1439 | struct iwl_rx_phy_res *rx_resp) |
1441 | { | 1440 | { |
1442 | /* data from PHY/DSP regarding signal strength, etc., | 1441 | /* data from PHY/DSP regarding signal strength, etc., |
@@ -1465,7 +1464,7 @@ static int iwl5000_calc_rssi(struct iwl_priv *priv, | |||
1465 | max_rssi = max_t(u32, rssi_a, rssi_b); | 1464 | max_rssi = max_t(u32, rssi_a, rssi_b); |
1466 | max_rssi = max_t(u32, max_rssi, rssi_c); | 1465 | max_rssi = max_t(u32, max_rssi, rssi_c); |
1467 | 1466 | ||
1468 | IWL_DEBUG_STATS("Rssi In A %d B %d C %d Max %d AGC dB %d\n", | 1467 | IWL_DEBUG_STATS(priv, "Rssi In A %d B %d C %d Max %d AGC dB %d\n", |
1469 | rssi_a, rssi_b, rssi_c, max_rssi, agc); | 1468 | rssi_a, rssi_b, rssi_c, max_rssi, agc); |
1470 | 1469 | ||
1471 | /* dBm = max_rssi dB - agc dB - constant. | 1470 | /* dBm = max_rssi dB - agc dB - constant. |
@@ -1473,11 +1472,11 @@ static int iwl5000_calc_rssi(struct iwl_priv *priv, | |||
1473 | return max_rssi - agc - IWL49_RSSI_OFFSET; | 1472 | return max_rssi - agc - IWL49_RSSI_OFFSET; |
1474 | } | 1473 | } |
1475 | 1474 | ||
1476 | static struct iwl_hcmd_ops iwl5000_hcmd = { | 1475 | struct iwl_hcmd_ops iwl5000_hcmd = { |
1477 | .rxon_assoc = iwl5000_send_rxon_assoc, | 1476 | .rxon_assoc = iwl5000_send_rxon_assoc, |
1478 | }; | 1477 | }; |
1479 | 1478 | ||
1480 | static struct iwl_hcmd_utils_ops iwl5000_hcmd_utils = { | 1479 | struct iwl_hcmd_utils_ops iwl5000_hcmd_utils = { |
1481 | .get_hcmd_size = iwl5000_get_hcmd_size, | 1480 | .get_hcmd_size = iwl5000_get_hcmd_size, |
1482 | .build_addsta_hcmd = iwl5000_build_addsta_hcmd, | 1481 | .build_addsta_hcmd = iwl5000_build_addsta_hcmd, |
1483 | .gain_computation = iwl5000_gain_computation, | 1482 | .gain_computation = iwl5000_gain_computation, |
@@ -1486,7 +1485,7 @@ static struct iwl_hcmd_utils_ops iwl5000_hcmd_utils = { | |||
1486 | .calc_rssi = iwl5000_calc_rssi, | 1485 | .calc_rssi = iwl5000_calc_rssi, |
1487 | }; | 1486 | }; |
1488 | 1487 | ||
1489 | static struct iwl_lib_ops iwl5000_lib = { | 1488 | struct iwl_lib_ops iwl5000_lib = { |
1490 | .set_hw_params = iwl5000_hw_set_hw_params, | 1489 | .set_hw_params = iwl5000_hw_set_hw_params, |
1491 | .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl, | 1490 | .txq_update_byte_cnt_tbl = iwl5000_txq_update_byte_cnt_tbl, |
1492 | .txq_inval_byte_cnt_tbl = iwl5000_txq_inval_byte_cnt_tbl, | 1491 | .txq_inval_byte_cnt_tbl = iwl5000_txq_inval_byte_cnt_tbl, |
@@ -1556,6 +1555,9 @@ struct iwl_cfg iwl5300_agn_cfg = { | |||
1556 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, | 1555 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
1557 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, | 1556 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
1558 | .mod_params = &iwl50_mod_params, | 1557 | .mod_params = &iwl50_mod_params, |
1558 | .valid_tx_ant = ANT_ABC, | ||
1559 | .valid_rx_ant = ANT_ABC, | ||
1560 | .need_pll_cfg = true, | ||
1559 | }; | 1561 | }; |
1560 | 1562 | ||
1561 | struct iwl_cfg iwl5100_bg_cfg = { | 1563 | struct iwl_cfg iwl5100_bg_cfg = { |
@@ -1569,6 +1571,9 @@ struct iwl_cfg iwl5100_bg_cfg = { | |||
1569 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, | 1571 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
1570 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, | 1572 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
1571 | .mod_params = &iwl50_mod_params, | 1573 | .mod_params = &iwl50_mod_params, |
1574 | .valid_tx_ant = ANT_B, | ||
1575 | .valid_rx_ant = ANT_AB, | ||
1576 | .need_pll_cfg = true, | ||
1572 | }; | 1577 | }; |
1573 | 1578 | ||
1574 | struct iwl_cfg iwl5100_abg_cfg = { | 1579 | struct iwl_cfg iwl5100_abg_cfg = { |
@@ -1582,6 +1587,9 @@ struct iwl_cfg iwl5100_abg_cfg = { | |||
1582 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, | 1587 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
1583 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, | 1588 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
1584 | .mod_params = &iwl50_mod_params, | 1589 | .mod_params = &iwl50_mod_params, |
1590 | .valid_tx_ant = ANT_B, | ||
1591 | .valid_rx_ant = ANT_AB, | ||
1592 | .need_pll_cfg = true, | ||
1585 | }; | 1593 | }; |
1586 | 1594 | ||
1587 | struct iwl_cfg iwl5100_agn_cfg = { | 1595 | struct iwl_cfg iwl5100_agn_cfg = { |
@@ -1595,6 +1603,9 @@ struct iwl_cfg iwl5100_agn_cfg = { | |||
1595 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, | 1603 | .eeprom_ver = EEPROM_5000_EEPROM_VERSION, |
1596 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, | 1604 | .eeprom_calib_ver = EEPROM_5000_TX_POWER_VERSION, |
1597 | .mod_params = &iwl50_mod_params, | 1605 | .mod_params = &iwl50_mod_params, |
1606 | .valid_tx_ant = ANT_B, | ||
1607 | .valid_rx_ant = ANT_AB, | ||
1608 | .need_pll_cfg = true, | ||
1598 | }; | 1609 | }; |
1599 | 1610 | ||
1600 | struct iwl_cfg iwl5350_agn_cfg = { | 1611 | struct iwl_cfg iwl5350_agn_cfg = { |
@@ -1608,6 +1619,9 @@ struct iwl_cfg iwl5350_agn_cfg = { | |||
1608 | .eeprom_ver = EEPROM_5050_EEPROM_VERSION, | 1619 | .eeprom_ver = EEPROM_5050_EEPROM_VERSION, |
1609 | .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, | 1620 | .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, |
1610 | .mod_params = &iwl50_mod_params, | 1621 | .mod_params = &iwl50_mod_params, |
1622 | .valid_tx_ant = ANT_ABC, | ||
1623 | .valid_rx_ant = ANT_ABC, | ||
1624 | .need_pll_cfg = true, | ||
1611 | }; | 1625 | }; |
1612 | 1626 | ||
1613 | struct iwl_cfg iwl5150_agn_cfg = { | 1627 | struct iwl_cfg iwl5150_agn_cfg = { |
@@ -1621,6 +1635,9 @@ struct iwl_cfg iwl5150_agn_cfg = { | |||
1621 | .eeprom_ver = EEPROM_5050_EEPROM_VERSION, | 1635 | .eeprom_ver = EEPROM_5050_EEPROM_VERSION, |
1622 | .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, | 1636 | .eeprom_calib_ver = EEPROM_5050_TX_POWER_VERSION, |
1623 | .mod_params = &iwl50_mod_params, | 1637 | .mod_params = &iwl50_mod_params, |
1638 | .valid_tx_ant = ANT_A, | ||
1639 | .valid_rx_ant = ANT_AB, | ||
1640 | .need_pll_cfg = true, | ||
1624 | }; | 1641 | }; |
1625 | 1642 | ||
1626 | MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); | 1643 | MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); |