aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-04-05 12:41:57 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-07 15:51:36 -0400
commit1fc352765fb461e4afafff4d650624df8ab6b6d6 (patch)
treeee9e31cb30376ad39fbe199afe2c7a7e0e2ac04f /drivers/net/wireless/iwlwifi/iwl-agn.c
parent35b1d92dfb361d24664381a0e4ae8ed47c771a66 (diff)
iwlagn: remove bootstrap code
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>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index c66fcea4737..5e74eb0fd6e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1181,7 +1181,6 @@ static void iwl_dealloc_ucode_pci(struct iwl_priv *priv)
1181 iwl_free_fw_desc(priv->pci_dev, &priv->ucode_data_backup); 1181 iwl_free_fw_desc(priv->pci_dev, &priv->ucode_data_backup);
1182 iwl_free_fw_desc(priv->pci_dev, &priv->ucode_init); 1182 iwl_free_fw_desc(priv->pci_dev, &priv->ucode_init);
1183 iwl_free_fw_desc(priv->pci_dev, &priv->ucode_init_data); 1183 iwl_free_fw_desc(priv->pci_dev, &priv->ucode_init_data);
1184 iwl_free_fw_desc(priv->pci_dev, &priv->ucode_boot);
1185} 1184}
1186 1185
1187static void iwl_nic_start(struct iwl_priv *priv) 1186static 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)
1239} 1238}
1240 1239
1241struct iwlagn_firmware_pieces { 1240struct iwlagn_firmware_pieces {
1242 const void *inst, *data, *init, *init_data, *boot; 1241 const void *inst, *data, *init, *init_data;
1243 size_t inst_size, data_size, init_size, init_data_size, boot_size; 1242 size_t inst_size, data_size, init_size, init_data_size;
1244 1243
1245 u32 build; 1244 u32 build;
1246 1245
@@ -1271,7 +1270,6 @@ static int iwlagn_load_legacy_firmware(struct iwl_priv *priv,
1271 pieces->data_size = le32_to_cpu(ucode->u.v2.data_size); 1270 pieces->data_size = le32_to_cpu(ucode->u.v2.data_size);
1272 pieces->init_size = le32_to_cpu(ucode->u.v2.init_size); 1271 pieces->init_size = le32_to_cpu(ucode->u.v2.init_size);
1273 pieces->init_data_size = le32_to_cpu(ucode->u.v2.init_data_size); 1272 pieces->init_data_size = le32_to_cpu(ucode->u.v2.init_data_size);
1274 pieces->boot_size = le32_to_cpu(ucode->u.v2.boot_size);
1275 src = ucode->u.v2.data; 1273 src = ucode->u.v2.data;
1276 break; 1274 break;
1277 case 0: 1275 case 0:
@@ -1287,7 +1285,6 @@ static int iwlagn_load_legacy_firmware(struct iwl_priv *priv,
1287 pieces->data_size = le32_to_cpu(ucode->u.v1.data_size); 1285 pieces->data_size = le32_to_cpu(ucode->u.v1.data_size);
1288 pieces->init_size = le32_to_cpu(ucode->u.v1.init_size); 1286 pieces->init_size = le32_to_cpu(ucode->u.v1.init_size);
1289 pieces->init_data_size = le32_to_cpu(ucode->u.v1.init_data_size); 1287 pieces->init_data_size = le32_to_cpu(ucode->u.v1.init_data_size);
1290 pieces->boot_size = le32_to_cpu(ucode->u.v1.boot_size);
1291 src = ucode->u.v1.data; 1288 src = ucode->u.v1.data;
1292 break; 1289 break;
1293 } 1290 }
@@ -1295,7 +1292,7 @@ static int iwlagn_load_legacy_firmware(struct iwl_priv *priv,
1295 /* Verify size of file vs. image size info in file's header */ 1292 /* Verify size of file vs. image size info in file's header */
1296 if (ucode_raw->size != hdr_size + pieces->inst_size + 1293 if (ucode_raw->size != hdr_size + pieces->inst_size +
1297 pieces->data_size + pieces->init_size + 1294 pieces->data_size + pieces->init_size +
1298 pieces->init_data_size + pieces->boot_size) { 1295 pieces->init_data_size) {
1299 1296
1300 IWL_ERR(priv, 1297 IWL_ERR(priv,
1301 "uCode file size %d does not match expected size\n", 1298 "uCode file size %d does not match expected size\n",
@@ -1311,8 +1308,6 @@ static int iwlagn_load_legacy_firmware(struct iwl_priv *priv,
1311 src += pieces->init_size; 1308 src += pieces->init_size;
1312 pieces->init_data = src; 1309 pieces->init_data = src;
1313 src += pieces->init_data_size; 1310 src += pieces->init_data_size;
1314 pieces->boot = src;
1315 src += pieces->boot_size;
1316 1311
1317 return 0; 1312 return 0;
1318} 1313}
@@ -1413,8 +1408,7 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
1413 pieces->init_data_size = tlv_len; 1408 pieces->init_data_size = tlv_len;
1414 break; 1409 break;
1415 case IWL_UCODE_TLV_BOOT: 1410 case IWL_UCODE_TLV_BOOT:
1416 pieces->boot = tlv_data; 1411 IWL_ERR(priv, "Found unexpected BOOT ucode\n");
1417 pieces->boot_size = tlv_len;
1418 break; 1412 break;
1419 case IWL_UCODE_TLV_PROBE_MAX_LEN: 1413 case IWL_UCODE_TLV_PROBE_MAX_LEN:
1420 if (tlv_len != sizeof(u32)) 1414 if (tlv_len != sizeof(u32))
@@ -1614,8 +1608,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
1614 pieces.init_size); 1608 pieces.init_size);
1615 IWL_DEBUG_INFO(priv, "f/w package hdr init data size = %Zd\n", 1609 IWL_DEBUG_INFO(priv, "f/w package hdr init data size = %Zd\n",
1616 pieces.init_data_size); 1610 pieces.init_data_size);
1617 IWL_DEBUG_INFO(priv, "f/w package hdr boot inst size = %Zd\n",
1618 pieces.boot_size);
1619 1611
1620 /* Verify that uCode images will fit in card's SRAM */ 1612 /* Verify that uCode images will fit in card's SRAM */
1621 if (pieces.inst_size > priv->hw_params.max_inst_size) { 1613 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)
1642 goto try_again; 1634 goto try_again;
1643 } 1635 }
1644 1636
1645 if (pieces.boot_size > priv->hw_params.max_bsm_size) {
1646 IWL_ERR(priv, "uCode boot instr len %Zd too large to fit in\n",
1647 pieces.boot_size);
1648 goto try_again;
1649 }
1650
1651 /* Allocate ucode buffers for card's bus-master loading ... */ 1637 /* Allocate ucode buffers for card's bus-master loading ... */
1652 1638
1653 /* Runtime instructions and 2 copies of data: 1639 /* Runtime instructions and 2 copies of data:
@@ -1678,15 +1664,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
1678 goto err_pci_alloc; 1664 goto err_pci_alloc;
1679 } 1665 }
1680 1666
1681 /* Bootstrap (instructions only, no data) */
1682 if (pieces.boot_size) {
1683 priv->ucode_boot.len = pieces.boot_size;
1684 iwl_alloc_fw_desc(priv->pci_dev, &priv->ucode_boot);
1685
1686 if (!priv->ucode_boot.v_addr)
1687 goto err_pci_alloc;
1688 }
1689
1690 /* Now that we can no longer fail, copy information */ 1667 /* Now that we can no longer fail, copy information */
1691 1668
1692 /* 1669 /*
@@ -1749,11 +1726,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
1749 pieces.init_data_size); 1726 pieces.init_data_size);
1750 } 1727 }
1751 1728
1752 /* Bootstrap instructions */
1753 IWL_DEBUG_INFO(priv, "Copying (but not loading) boot instr len %Zd\n",
1754 pieces.boot_size);
1755 memcpy(priv->ucode_boot.v_addr, pieces.boot, pieces.boot_size);
1756
1757 /* 1729 /*
1758 * figure out the offset of chain noise reset and gain commands 1730 * figure out the offset of chain noise reset and gain commands
1759 * base on the size of standard phy calibration commands table size 1731 * base on the size of standard phy calibration commands table size