iwlagn: remove bootstrap code
authorJohannes Berg <johannes.berg@intel.com>
Tue, 5 Apr 2011 16:41:57 +0000 (09:41 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 7 Apr 2011 19:51:36 +0000 (15:51 -0400)
Only 4965 had a bootstrap microcode image, so
the agn driver can completely ignore that and
we can remove some code from it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-1000.c
drivers/net/wireless/iwlwifi/iwl-2000.c
drivers/net/wireless/iwlwifi/iwl-5000.c
drivers/net/wireless/iwlwifi/iwl-6000.c
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-dev.h

index ad500631a407658ea3363720315650fe3e1e8a69..53a6702f4063e27b53e189d3c3bc509b4fb39866 100644 (file)
@@ -141,7 +141,6 @@ static int iwl1000_hw_set_hw_params(struct iwl_priv *priv)
        priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE;
        priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE;
 
-       priv->hw_params.max_bsm_size = 0;
        priv->hw_params.ht40_channel =  BIT(IEEE80211_BAND_2GHZ) |
                                        BIT(IEEE80211_BAND_5GHZ);
        priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
index 5e375d8089c44be2ed9234c325606defa7e4d432..9f973895ce8609ff42929a477621ced8c5bd8e49 100644 (file)
@@ -147,7 +147,6 @@ static int iwl2000_hw_set_hw_params(struct iwl_priv *priv)
        priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
        priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
 
-       priv->hw_params.max_bsm_size = 0;
        priv->hw_params.ht40_channel =  BIT(IEEE80211_BAND_2GHZ) |
                                        BIT(IEEE80211_BAND_5GHZ);
        priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
index 0e1f0b50f8e86e7d358259fa4b9815fa73494878..653bb8ef295077757a5ef85f0ab322a5b8bcb963 100644 (file)
@@ -185,7 +185,6 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
        priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE;
        priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE;
 
-       priv->hw_params.max_bsm_size = 0;
        priv->hw_params.ht40_channel =  BIT(IEEE80211_BAND_2GHZ) |
                                        BIT(IEEE80211_BAND_5GHZ);
        priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
@@ -231,7 +230,6 @@ static int iwl5150_hw_set_hw_params(struct iwl_priv *priv)
        priv->hw_params.max_data_size = IWLAGN_RTC_DATA_SIZE;
        priv->hw_params.max_inst_size = IWLAGN_RTC_INST_SIZE;
 
-       priv->hw_params.max_bsm_size = 0;
        priv->hw_params.ht40_channel =  BIT(IEEE80211_BAND_2GHZ) |
                                        BIT(IEEE80211_BAND_5GHZ);
        priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
index 4d545e62e5c76ecf82d043925ddd27baee4b5956..1e55f811431ce6db0dc8b1673f9d9f3430955cd4 100644 (file)
@@ -176,7 +176,6 @@ static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
        priv->hw_params.max_data_size = IWL60_RTC_DATA_SIZE;
        priv->hw_params.max_inst_size = IWL60_RTC_INST_SIZE;
 
-       priv->hw_params.max_bsm_size = 0;
        priv->hw_params.ht40_channel =  BIT(IEEE80211_BAND_2GHZ) |
                                        BIT(IEEE80211_BAND_5GHZ);
        priv->hw_params.rx_wrt_ptr_reg = FH_RSCSR_CHNL0_WPTR;
index c66fcea4737ba3b1793022f03e4e90ede7c527de..5e74eb0fd6ee42f335e24714748efe505f7b1386 100644 (file)
@@ -1181,7 +1181,6 @@ static void iwl_dealloc_ucode_pci(struct iwl_priv *priv)
        iwl_free_fw_desc(priv->pci_dev, &priv->ucode_data_backup);
        iwl_free_fw_desc(priv->pci_dev, &priv->ucode_init);
        iwl_free_fw_desc(priv->pci_dev, &priv->ucode_init_data);
-       iwl_free_fw_desc(priv->pci_dev, &priv->ucode_boot);
 }
 
 static void iwl_nic_start(struct iwl_priv *priv)
@@ -1239,8 +1238,8 @@ static int __must_check iwl_request_firmware(struct iwl_priv *priv, bool first)
 }
 
 struct iwlagn_firmware_pieces {
-       const void *inst, *data, *init, *init_data, *boot;
-       size_t inst_size, data_size, init_size, init_data_size, boot_size;
+       const void *inst, *data, *init, *init_data;
+       size_t inst_size, data_size, init_size, init_data_size;
 
        u32 build;
 
@@ -1271,7 +1270,6 @@ static int iwlagn_load_legacy_firmware(struct iwl_priv *priv,
                pieces->data_size = le32_to_cpu(ucode->u.v2.data_size);
                pieces->init_size = le32_to_cpu(ucode->u.v2.init_size);
                pieces->init_data_size = le32_to_cpu(ucode->u.v2.init_data_size);
-               pieces->boot_size = le32_to_cpu(ucode->u.v2.boot_size);
                src = ucode->u.v2.data;
                break;
        case 0:
@@ -1287,7 +1285,6 @@ static int iwlagn_load_legacy_firmware(struct iwl_priv *priv,
                pieces->data_size = le32_to_cpu(ucode->u.v1.data_size);
                pieces->init_size = le32_to_cpu(ucode->u.v1.init_size);
                pieces->init_data_size = le32_to_cpu(ucode->u.v1.init_data_size);
-               pieces->boot_size = le32_to_cpu(ucode->u.v1.boot_size);
                src = ucode->u.v1.data;
                break;
        }
@@ -1295,7 +1292,7 @@ static int iwlagn_load_legacy_firmware(struct iwl_priv *priv,
        /* Verify size of file vs. image size info in file's header */
        if (ucode_raw->size != hdr_size + pieces->inst_size +
                                pieces->data_size + pieces->init_size +
-                               pieces->init_data_size + pieces->boot_size) {
+                               pieces->init_data_size) {
 
                IWL_ERR(priv,
                        "uCode file size %d does not match expected size\n",
@@ -1311,8 +1308,6 @@ static int iwlagn_load_legacy_firmware(struct iwl_priv *priv,
        src += pieces->init_size;
        pieces->init_data = src;
        src += pieces->init_data_size;
-       pieces->boot = src;
-       src += pieces->boot_size;
 
        return 0;
 }
@@ -1413,8 +1408,7 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
                        pieces->init_data_size = tlv_len;
                        break;
                case IWL_UCODE_TLV_BOOT:
-                       pieces->boot = tlv_data;
-                       pieces->boot_size = tlv_len;
+                       IWL_ERR(priv, "Found unexpected BOOT ucode\n");
                        break;
                case IWL_UCODE_TLV_PROBE_MAX_LEN:
                        if (tlv_len != sizeof(u32))
@@ -1614,8 +1608,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
                       pieces.init_size);
        IWL_DEBUG_INFO(priv, "f/w package hdr init data size = %Zd\n",
                       pieces.init_data_size);
-       IWL_DEBUG_INFO(priv, "f/w package hdr boot inst size = %Zd\n",
-                      pieces.boot_size);
 
        /* Verify that uCode images will fit in card's SRAM */
        if (pieces.inst_size > priv->hw_params.max_inst_size) {
@@ -1642,12 +1634,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
                goto try_again;
        }
 
-       if (pieces.boot_size > priv->hw_params.max_bsm_size) {
-               IWL_ERR(priv, "uCode boot instr len %Zd too large to fit in\n",
-                       pieces.boot_size);
-               goto try_again;
-       }
-
        /* Allocate ucode buffers for card's bus-master loading ... */
 
        /* Runtime instructions and 2 copies of data:
@@ -1678,15 +1664,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
                        goto err_pci_alloc;
        }
 
-       /* Bootstrap (instructions only, no data) */
-       if (pieces.boot_size) {
-               priv->ucode_boot.len = pieces.boot_size;
-               iwl_alloc_fw_desc(priv->pci_dev, &priv->ucode_boot);
-
-               if (!priv->ucode_boot.v_addr)
-                       goto err_pci_alloc;
-       }
-
        /* Now that we can no longer fail, copy information */
 
        /*
@@ -1749,11 +1726,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
                       pieces.init_data_size);
        }
 
-       /* Bootstrap instructions */
-       IWL_DEBUG_INFO(priv, "Copying (but not loading) boot instr len %Zd\n",
-                       pieces.boot_size);
-       memcpy(priv->ucode_boot.v_addr, pieces.boot, pieces.boot_size);
-
        /*
         * figure out the offset of chain noise reset and gain commands
         * base on the size of standard phy calibration commands table size
index 8dc209a341aa58562eca60fd32a5cc31c3b0964c..b3af2e8afc0a75a55179ea58dc321f2ce9e06cc8 100644 (file)
@@ -641,7 +641,6 @@ struct iwl_hw_params {
        u8  max_beacon_itrvl;   /* in 1024 ms */
        u32 max_inst_size;
        u32 max_data_size;
-       u32 max_bsm_size;
        u32 ct_kill_threshold; /* value in hw-dependent units */
        u32 ct_kill_exit_threshold; /* value in hw-dependent units */
                                    /* for 1000, 6000 series and up */
@@ -1263,7 +1262,6 @@ struct iwl_priv {
        struct fw_desc ucode_data_backup;       /* runtime data save/restore */
        struct fw_desc ucode_init;      /* initialization inst */
        struct fw_desc ucode_init_data; /* initialization data */
-       struct fw_desc ucode_boot;      /* bootstrap inst */
        enum ucode_type ucode_type;
        u8 ucode_write_complete;        /* the image write is complete */
        char firmware_name[25];