Commit 90e759d1 authored by Tomas Winkler's avatar Tomas Winkler Committed by David S. Miller

iwlwifi: Support for uCode without init and bsm section

This patch enables loading fw w/o init and bsm section. It also provides
general cleanup of the rutine.
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Signed-off-by: default avatarZhu Yi <yi.zhu@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5a6012e1
...@@ -5767,6 +5767,12 @@ static void iwl3945_nic_start(struct iwl3945_priv *priv) ...@@ -5767,6 +5767,12 @@ static void iwl3945_nic_start(struct iwl3945_priv *priv)
iwl3945_write32(priv, CSR_RESET, 0); iwl3945_write32(priv, CSR_RESET, 0);
} }
static int iwl3945_alloc_fw_desc(struct pci_dev *pci_dev, struct fw_desc *desc)
{
desc->v_addr = pci_alloc_consistent(pci_dev, desc->len, &desc->p_addr);
return (desc->v_addr != NULL) ? 0 : -ENOMEM;
}
/** /**
* iwl3945_read_ucode - Read uCode images from disk file. * iwl3945_read_ucode - Read uCode images from disk file.
* *
...@@ -5775,7 +5781,7 @@ static void iwl3945_nic_start(struct iwl3945_priv *priv) ...@@ -5775,7 +5781,7 @@ static void iwl3945_nic_start(struct iwl3945_priv *priv)
static int iwl3945_read_ucode(struct iwl3945_priv *priv) static int iwl3945_read_ucode(struct iwl3945_priv *priv)
{ {
struct iwl3945_ucode *ucode; struct iwl3945_ucode *ucode;
int rc = 0; int ret = 0;
const struct firmware *ucode_raw; const struct firmware *ucode_raw;
/* firmware file name contains uCode/driver compatibility version */ /* firmware file name contains uCode/driver compatibility version */
const char *name = "iwlwifi-3945" IWL3945_UCODE_API ".ucode"; const char *name = "iwlwifi-3945" IWL3945_UCODE_API ".ucode";
...@@ -5785,9 +5791,10 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv) ...@@ -5785,9 +5791,10 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv)
/* Ask kernel firmware_class module to get the boot firmware off disk. /* Ask kernel firmware_class module to get the boot firmware off disk.
* request_firmware() is synchronous, file is in memory on return. */ * request_firmware() is synchronous, file is in memory on return. */
rc = request_firmware(&ucode_raw, name, &priv->pci_dev->dev); ret = request_firmware(&ucode_raw, name, &priv->pci_dev->dev);
if (rc < 0) { if (ret < 0) {
IWL_ERROR("%s firmware file req failed: Reason %d\n", name, rc); IWL_ERROR("%s firmware file req failed: Reason %d\n",
name, ret);
goto error; goto error;
} }
...@@ -5797,7 +5804,7 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv) ...@@ -5797,7 +5804,7 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv)
/* Make sure that we got at least our header! */ /* Make sure that we got at least our header! */
if (ucode_raw->size < sizeof(*ucode)) { if (ucode_raw->size < sizeof(*ucode)) {
IWL_ERROR("File size way too small!\n"); IWL_ERROR("File size way too small!\n");
rc = -EINVAL; ret = -EINVAL;
goto err_release; goto err_release;
} }
...@@ -5825,43 +5832,40 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv) ...@@ -5825,43 +5832,40 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv)
IWL_DEBUG_INFO("uCode file size %d too small\n", IWL_DEBUG_INFO("uCode file size %d too small\n",
(int)ucode_raw->size); (int)ucode_raw->size);
rc = -EINVAL; ret = -EINVAL;
goto err_release; goto err_release;
} }
/* Verify that uCode images will fit in card's SRAM */ /* Verify that uCode images will fit in card's SRAM */
if (inst_size > IWL_MAX_INST_SIZE) { if (inst_size > IWL_MAX_INST_SIZE) {
IWL_DEBUG_INFO("uCode instr len %d too large to fit in card\n", IWL_DEBUG_INFO("uCode instr len %d too large to fit in\n",
(int)inst_size); inst_size);
rc = -EINVAL; ret = -EINVAL;
goto err_release; goto err_release;
} }
if (data_size > IWL_MAX_DATA_SIZE) { if (data_size > IWL_MAX_DATA_SIZE) {
IWL_DEBUG_INFO("uCode data len %d too large to fit in card\n", IWL_DEBUG_INFO("uCode data len %d too large to fit in\n",
(int)data_size); data_size);
rc = -EINVAL; ret = -EINVAL;
goto err_release; goto err_release;
} }
if (init_size > IWL_MAX_INST_SIZE) { if (init_size > IWL_MAX_INST_SIZE) {
IWL_DEBUG_INFO IWL_DEBUG_INFO("uCode init instr len %d too large to fit in\n",
("uCode init instr len %d too large to fit in card\n", init_size);
(int)init_size); ret = -EINVAL;
rc = -EINVAL;
goto err_release; goto err_release;
} }
if (init_data_size > IWL_MAX_DATA_SIZE) { if (init_data_size > IWL_MAX_DATA_SIZE) {
IWL_DEBUG_INFO IWL_DEBUG_INFO("uCode init data len %d too large to fit in\n",
("uCode init data len %d too large to fit in card\n", init_data_size);
(int)init_data_size); ret = -EINVAL;
rc = -EINVAL;
goto err_release; goto err_release;
} }
if (boot_size > IWL_MAX_BSM_SIZE) { if (boot_size > IWL_MAX_BSM_SIZE) {
IWL_DEBUG_INFO IWL_DEBUG_INFO("uCode boot instr len %d too large to fit in\n",
("uCode boot instr len %d too large to fit in bsm\n", boot_size);
(int)boot_size); ret = -EINVAL;
rc = -EINVAL;
goto err_release; goto err_release;
} }
...@@ -5871,56 +5875,45 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv) ...@@ -5871,56 +5875,45 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv)
* 1) unmodified from disk * 1) unmodified from disk
* 2) backup cache for save/restore during power-downs */ * 2) backup cache for save/restore during power-downs */
priv->ucode_code.len = inst_size; priv->ucode_code.len = inst_size;
priv->ucode_code.v_addr = iwl3945_alloc_fw_desc(priv->pci_dev, &priv->ucode_code);
pci_alloc_consistent(priv->pci_dev,
priv->ucode_code.len,
&(priv->ucode_code.p_addr));
priv->ucode_data.len = data_size; priv->ucode_data.len = data_size;
priv->ucode_data.v_addr = iwl3945_alloc_fw_desc(priv->pci_dev, &priv->ucode_data);
pci_alloc_consistent(priv->pci_dev,
priv->ucode_data.len,
&(priv->ucode_data.p_addr));
priv->ucode_data_backup.len = data_size; priv->ucode_data_backup.len = data_size;
priv->ucode_data_backup.v_addr = iwl3945_alloc_fw_desc(priv->pci_dev, &priv->ucode_data_backup);
pci_alloc_consistent(priv->pci_dev,
priv->ucode_data_backup.len,
&(priv->ucode_data_backup.p_addr));
if (!priv->ucode_code.v_addr || !priv->ucode_data.v_addr ||
!priv->ucode_data_backup.v_addr)
goto err_pci_alloc;
/* Initialization instructions and data */ /* Initialization instructions and data */
if (init_size && init_data_size) {
priv->ucode_init.len = init_size; priv->ucode_init.len = init_size;
priv->ucode_init.v_addr = iwl3945_alloc_fw_desc(priv->pci_dev, &priv->ucode_init);
pci_alloc_consistent(priv->pci_dev,
priv->ucode_init.len,
&(priv->ucode_init.p_addr));
priv->ucode_init_data.len = init_data_size; priv->ucode_init_data.len = init_data_size;
priv->ucode_init_data.v_addr = iwl3945_alloc_fw_desc(priv->pci_dev, &priv->ucode_init_data);
pci_alloc_consistent(priv->pci_dev,
priv->ucode_init_data.len, if (!priv->ucode_init.v_addr || !priv->ucode_init_data.v_addr)
&(priv->ucode_init_data.p_addr)); goto err_pci_alloc;
}
/* Bootstrap (instructions only, no data) */ /* Bootstrap (instructions only, no data) */
if (boot_size) {
priv->ucode_boot.len = boot_size; priv->ucode_boot.len = boot_size;
priv->ucode_boot.v_addr = iwl3945_alloc_fw_desc(priv->pci_dev, &priv->ucode_boot);
pci_alloc_consistent(priv->pci_dev,
priv->ucode_boot.len,
&(priv->ucode_boot.p_addr));
if (!priv->ucode_code.v_addr || !priv->ucode_data.v_addr || if (!priv->ucode_boot.v_addr)
!priv->ucode_init.v_addr || !priv->ucode_init_data.v_addr ||
!priv->ucode_boot.v_addr || !priv->ucode_data_backup.v_addr)
goto err_pci_alloc; goto err_pci_alloc;
}
/* Copy images into buffers for card's bus-master reads ... */ /* Copy images into buffers for card's bus-master reads ... */
/* Runtime instructions (first block of data in file) */ /* Runtime instructions (first block of data in file) */
src = &ucode->data[0]; src = &ucode->data[0];
len = priv->ucode_code.len; len = priv->ucode_code.len;
IWL_DEBUG_INFO("Copying (but not loading) uCode instr len %d\n", IWL_DEBUG_INFO("Copying (but not loading) uCode instr len %Zd\n", len);
(int)len);
memcpy(priv->ucode_code.v_addr, src, len); memcpy(priv->ucode_code.v_addr, src, len);
IWL_DEBUG_INFO("uCode instr buf vaddr = 0x%p, paddr = 0x%08x\n", IWL_DEBUG_INFO("uCode instr buf vaddr = 0x%p, paddr = 0x%08x\n",
priv->ucode_code.v_addr, (u32)priv->ucode_code.p_addr); priv->ucode_code.v_addr, (u32)priv->ucode_code.p_addr);
...@@ -5929,8 +5922,7 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv) ...@@ -5929,8 +5922,7 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv)
* NOTE: Copy into backup buffer will be done in iwl3945_up() */ * NOTE: Copy into backup buffer will be done in iwl3945_up() */
src = &ucode->data[inst_size]; src = &ucode->data[inst_size];
len = priv->ucode_data.len; len = priv->ucode_data.len;
IWL_DEBUG_INFO("Copying (but not loading) uCode data len %d\n", IWL_DEBUG_INFO("Copying (but not loading) uCode data len %Zd\n", len);
(int)len);
memcpy(priv->ucode_data.v_addr, src, len); memcpy(priv->ucode_data.v_addr, src, len);
memcpy(priv->ucode_data_backup.v_addr, src, len); memcpy(priv->ucode_data_backup.v_addr, src, len);
...@@ -5938,8 +5930,8 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv) ...@@ -5938,8 +5930,8 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv)
if (init_size) { if (init_size) {
src = &ucode->data[inst_size + data_size]; src = &ucode->data[inst_size + data_size];
len = priv->ucode_init.len; len = priv->ucode_init.len;
IWL_DEBUG_INFO("Copying (but not loading) init instr len %d\n", IWL_DEBUG_INFO("Copying (but not loading) init instr len %Zd\n",
(int)len); len);
memcpy(priv->ucode_init.v_addr, src, len); memcpy(priv->ucode_init.v_addr, src, len);
} }
...@@ -5965,14 +5957,14 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv) ...@@ -5965,14 +5957,14 @@ static int iwl3945_read_ucode(struct iwl3945_priv *priv)
err_pci_alloc: err_pci_alloc:
IWL_ERROR("failed to allocate pci memory\n"); IWL_ERROR("failed to allocate pci memory\n");
rc = -ENOMEM; ret = -ENOMEM;
iwl3945_dealloc_ucode_pci(priv); iwl3945_dealloc_ucode_pci(priv);
err_release: err_release:
release_firmware(ucode_raw); release_firmware(ucode_raw);
error: error:
return rc; return ret;
} }
......
...@@ -6146,6 +6146,12 @@ static void iwl4965_nic_start(struct iwl4965_priv *priv) ...@@ -6146,6 +6146,12 @@ static void iwl4965_nic_start(struct iwl4965_priv *priv)
iwl4965_write32(priv, CSR_RESET, 0); iwl4965_write32(priv, CSR_RESET, 0);
} }
static int iwl4965_alloc_fw_desc(struct pci_dev *pci_dev, struct fw_desc *desc)
{
desc->v_addr = pci_alloc_consistent(pci_dev, desc->len, &desc->p_addr);
return (desc->v_addr != NULL) ? 0 : -ENOMEM;
}
/** /**
* iwl4965_read_ucode - Read uCode images from disk file. * iwl4965_read_ucode - Read uCode images from disk file.
* *
...@@ -6154,7 +6160,7 @@ static void iwl4965_nic_start(struct iwl4965_priv *priv) ...@@ -6154,7 +6160,7 @@ static void iwl4965_nic_start(struct iwl4965_priv *priv)
static int iwl4965_read_ucode(struct iwl4965_priv *priv) static int iwl4965_read_ucode(struct iwl4965_priv *priv)
{ {
struct iwl4965_ucode *ucode; struct iwl4965_ucode *ucode;
int rc = 0; int ret;
const struct firmware *ucode_raw; const struct firmware *ucode_raw;
const char *name = "iwlwifi-4965" IWL4965_UCODE_API ".ucode"; const char *name = "iwlwifi-4965" IWL4965_UCODE_API ".ucode";
u8 *src; u8 *src;
...@@ -6163,9 +6169,10 @@ static int iwl4965_read_ucode(struct iwl4965_priv *priv) ...@@ -6163,9 +6169,10 @@ static int iwl4965_read_ucode(struct iwl4965_priv *priv)
/* Ask kernel firmware_class module to get the boot firmware off disk. /* Ask kernel firmware_class module to get the boot firmware off disk.
* request_firmware() is synchronous, file is in memory on return. */ * request_firmware() is synchronous, file is in memory on return. */
rc = request_firmware(&ucode_raw, name, &priv->pci_dev->dev); ret = request_firmware(&ucode_raw, name, &priv->pci_dev->dev);
if (rc < 0) { if (ret < 0) {
IWL_ERROR("%s firmware file req failed: Reason %d\n", name, rc); IWL_ERROR("%s firmware file req failed: Reason %d\n",
name, ret);
goto error; goto error;
} }
...@@ -6175,7 +6182,7 @@ static int iwl4965_read_ucode(struct iwl4965_priv *priv) ...@@ -6175,7 +6182,7 @@ static int iwl4965_read_ucode(struct iwl4965_priv *priv)
/* Make sure that we got at least our header! */ /* Make sure that we got at least our header! */
if (ucode_raw->size < sizeof(*ucode)) { if (ucode_raw->size < sizeof(*ucode)) {
IWL_ERROR("File size way too small!\n"); IWL_ERROR("File size way too small!\n");
rc = -EINVAL; ret = -EINVAL;
goto err_release; goto err_release;
} }
...@@ -6208,43 +6215,43 @@ static int iwl4965_read_ucode(struct iwl4965_priv *priv) ...@@ -6208,43 +6215,43 @@ static int iwl4965_read_ucode(struct iwl4965_priv *priv)
IWL_DEBUG_INFO("uCode file size %d too small\n", IWL_DEBUG_INFO("uCode file size %d too small\n",
(int)ucode_raw->size); (int)ucode_raw->size);
rc = -EINVAL; ret = -EINVAL;
goto err_release; goto err_release;
} }
/* Verify that uCode images will fit in card's SRAM */ /* Verify that uCode images will fit in card's SRAM */
if (inst_size > IWL_MAX_INST_SIZE) { if (inst_size > IWL_MAX_INST_SIZE) {
IWL_DEBUG_INFO("uCode instr len %d too large to fit in card\n", IWL_DEBUG_INFO("uCode instr len %d too large to fit in\n",
(int)inst_size); inst_size);
rc = -EINVAL; ret = -EINVAL;
goto err_release; goto err_release;
} }
if (data_size > IWL_MAX_DATA_SIZE) { if (data_size > IWL_MAX_DATA_SIZE) {
IWL_DEBUG_INFO("uCode data len %d too large to fit in card\n", IWL_DEBUG_INFO("uCode data len %d too large to fit in\n",
(int)data_size); data_size);
rc = -EINVAL; ret = -EINVAL;
goto err_release; goto err_release;
} }
if (init_size > IWL_MAX_INST_SIZE) { if (init_size > IWL_MAX_INST_SIZE) {
IWL_DEBUG_INFO IWL_DEBUG_INFO
("uCode init instr len %d too large to fit in card\n", ("uCode init instr len %d too large to fit in\n",
(int)init_size); init_size);
rc = -EINVAL; ret = -EINVAL;
goto err_release; goto err_release;
} }
if (init_data_size > IWL_MAX_DATA_SIZE) { if (init_data_size > IWL_MAX_DATA_SIZE) {
IWL_DEBUG_INFO IWL_DEBUG_INFO
("uCode init data len %d too large to fit in card\n", ("uCode init data len %d too large to fit in\n",
(int)init_data_size); init_data_size);
rc = -EINVAL; ret = -EINVAL;
goto err_release; goto err_release;
} }
if (boot_size > IWL_MAX_BSM_SIZE) { if (boot_size > IWL_MAX_BSM_SIZE) {
IWL_DEBUG_INFO IWL_DEBUG_INFO
("uCode boot instr len %d too large to fit in bsm\n", ("uCode boot instr len %d too large to fit in\n",
(int)boot_size); boot_size);
rc = -EINVAL; ret = -EINVAL;
goto err_release; goto err_release;
} }
...@@ -6254,56 +6261,41 @@ static int iwl4965_read_ucode(struct iwl4965_priv *priv) ...@@ -6254,56 +6261,41 @@ static int iwl4965_read_ucode(struct iwl4965_priv *priv)
* 1) unmodified from disk * 1) unmodified from disk
* 2) backup cache for save/restore during power-downs */ * 2) backup cache for save/restore during power-downs */
priv->ucode_code.len = inst_size; priv->ucode_code.len = inst_size;
priv->ucode_code.v_addr = iwl4965_alloc_fw_desc(priv->pci_dev, &priv->ucode_code);
pci_alloc_consistent(priv->pci_dev,
priv->ucode_code.len,
&(priv->ucode_code.p_addr));
priv->ucode_data.len = data_size; priv->ucode_data.len = data_size;
priv->ucode_data.v_addr = iwl4965_alloc_fw_desc(priv->pci_dev, &priv->ucode_data);
pci_alloc_consistent(priv->pci_dev,
priv->ucode_data.len,
&(priv->ucode_data.p_addr));
priv->ucode_data_backup.len = data_size; priv->ucode_data_backup.len = data_size;
priv->ucode_data_backup.v_addr = iwl4965_alloc_fw_desc(priv->pci_dev, &priv->ucode_data_backup);
pci_alloc_consistent(priv->pci_dev,
priv->ucode_data_backup.len,
&(priv->ucode_data_backup.p_addr));
/* Initialization instructions and data */ /* Initialization instructions and data */
if (init_size && init_data_size) {
priv->ucode_init.len = init_size; priv->ucode_init.len = init_size;
priv->ucode_init.v_addr = iwl4965_alloc_fw_desc(priv->pci_dev, &priv->ucode_init);
pci_alloc_consistent(priv->pci_dev,
priv->ucode_init.len,
&(priv->ucode_init.p_addr));
priv->ucode_init_data.len = init_data_size; priv->ucode_init_data.len = init_data_size;
priv->ucode_init_data.v_addr = iwl4965_alloc_fw_desc(priv->pci_dev, &priv->ucode_init_data);
pci_alloc_consistent(priv->pci_dev,
priv->ucode_init_data.len, if (!priv->ucode_init.v_addr || !priv->ucode_init_data.v_addr)
&(priv->ucode_init_data.p_addr)); goto err_pci_alloc;
}
/* Bootstrap (instructions only, no data) */ /* Bootstrap (instructions only, no data) */
if (boot_size) {
priv->ucode_boot.len = boot_size; priv->ucode_boot.len = boot_size;
priv->ucode_boot.v_addr = iwl4965_alloc_fw_desc(priv->pci_dev, &priv->ucode_boot);
pci_alloc_consistent(priv->pci_dev,
priv->ucode_boot.len,
&(priv->ucode_boot.p_addr));
if (!priv->ucode_code.v_addr || !priv->ucode_data.v_addr || if (!priv->ucode_boot.v_addr)
!priv->ucode_init.v_addr || !priv->ucode_init_data.v_addr ||
!priv->ucode_boot.v_addr || !priv->ucode_data_backup.v_addr)
goto err_pci_alloc; goto err_pci_alloc;
}
/* Copy images into buffers for card's bus-master reads ... */ /* Copy images into buffers for card's bus-master reads ... */
/* Runtime instructions (first block of data in file) */ /* Runtime instructions (first block of data in file) */
src = &ucode->data[0]; src = &ucode->data[0];
len = priv->ucode_code.len; len = priv->ucode_code.len;
IWL_DEBUG_INFO("Copying (but not loading) uCode instr len %d\n", IWL_DEBUG_INFO("Copying (but not loading) uCode instr len %Zd\n", len);
(int)len);
memcpy(priv->ucode_code.v_addr, src, len); memcpy(priv->ucode_code.v_addr, src, len);
IWL_DEBUG_INFO("uCode instr buf vaddr = 0x%p, paddr = 0x%08x\n", IWL_DEBUG_INFO("uCode instr buf vaddr = 0x%p, paddr = 0x%08x\n",
priv->ucode_code.v_addr, (u32)priv->ucode_code.p_addr); priv->ucode_code.v_addr, (u32)priv->ucode_code.p_addr);
...@@ -6312,8 +6304,7 @@ static int iwl4965_read_ucode(struct iwl4965_priv *priv) ...@@ -6312,8 +6304,7 @@ static int iwl4965_read_ucode(struct iwl4965_priv *priv)
* NOTE: Copy into backup buffer will be done in iwl4965_up() */ * NOTE: Copy into backup buffer will be done in iwl4965_up() */
src = &ucode->data[inst_size]; src = &ucode->data[inst_size];
len = priv->ucode_data.len; len = priv->ucode_data.len;
IWL_DEBUG_INFO("Copying (but not loading) uCode data len %d\n", IWL_DEBUG_INFO("Copying (but not loading) uCode data len %Zd\n", len);
(int)len);
memcpy(priv->ucode_data.v_addr, src, len); memcpy(priv->ucode_data.v_addr, src, len);
memcpy(priv->ucode_data_backup.v_addr, src, len); memcpy(priv->ucode_data_backup.v_addr, src, len);
...@@ -6321,8 +6312,8 @@ static int iwl4965_read_ucode(struct iwl4965_priv *priv) ...@@ -6321,8 +6312,8 @@ static int iwl4965_read_ucode(struct iwl4965_priv *priv)
if (init_size) { if (init_size) {
src = &ucode->data[inst_size + data_size]; src = &ucode->data[inst_size + data_size];
len = priv->ucode_init.len; len = priv->ucode_init.len;
IWL_DEBUG_INFO("Copying (but not loading) init instr len %d\n", IWL_DEBUG_INFO("Copying (but not loading) init instr len %Zd\n",
(int)len); len);
memcpy(priv->ucode_init.v_addr, src, len); memcpy(priv->ucode_init.v_addr, src, len);
} }
...@@ -6330,16 +6321,15 @@ static int iwl4965_read_ucode(struct iwl4965_priv *priv) ...@@ -6330,16 +6321,15 @@ static int iwl4965_read_ucode(struct iwl4965_priv *priv)
if (init_data_size) { if (init_data_size) {
src = &ucode->data[inst_size + data_size + init_size]; src = &ucode->data[inst_size + data_size + init_size];
len = priv->ucode_init_data.len; len = priv->ucode_init_data.len;
IWL_DEBUG_INFO("Copying (but not loading) init data len %d\n", IWL_DEBUG_INFO("Copying (but not loading) init data len %Zd\n",
(int)len); len);
memcpy(priv->ucode_init_data.v_addr, src, len); memcpy(priv->ucode_init_data.v_addr, src, len);
} }
/* Bootstrap instructions (5th block) */ /* Bootstrap instructions (5th block) */
src = &ucode->data[inst_size + data_size + init_size + init_data_size]; src = &ucode->data[inst_size + data_size + init_size + init_data_size];
len = priv->ucode_boot.len; len = priv->ucode_boot.len;
IWL_DEBUG_INFO("Copying (but not loading) boot instr len %d\n", IWL_DEBUG_INFO("Copying (but not loading) boot instr len %Zd\n", len);
(int)len);
memcpy(priv->ucode_boot.v_addr, src, len); memcpy(priv->ucode_boot.v_addr, src, len);
/* We have our copies now, allow OS release its copies */ /* We have our copies now, allow OS release its copies */
...@@ -6348,14 +6338,14 @@ static int iwl4965_read_ucode(struct iwl4965_priv *priv) ...@@ -6348,14 +6338,14 @@ static int iwl4965_read_ucode(struct iwl4965_priv *priv)
err_pci_alloc: err_pci_alloc:
IWL_ERROR("failed to allocate pci memory\n"); IWL_ERROR("failed to allocate pci memory\n");
rc = -ENOMEM; ret = -ENOMEM;
iwl4965_dealloc_ucode_pci(priv); iwl4965_dealloc_ucode_pci(priv);
err_release: err_release:
release_firmware(ucode_raw); release_firmware(ucode_raw);
error: error:
return rc; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment