Skip to content

Commit

Permalink
mwl8k: spell out the names of firmware images in the pci driver data
Browse files Browse the repository at this point in the history
To allow use of a more flexible firmware file naming scheme.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Lennert Buytenhek authored and John W. Linville committed Nov 6, 2009
1 parent 45a390d commit a74b295
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions drivers/net/wireless/mwl8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@
#define MWL8K_TX_QUEUES 4

struct mwl8k_device_info {
int part_num;
char *part_name;
char *helper_image;
char *fw_image;
};

struct mwl8k_rx_queue {
Expand Down Expand Up @@ -113,11 +115,11 @@ struct mwl8k_tx_queue {

/* Pointers to the firmware data and meta information about it. */
struct mwl8k_firmware {
/* Microcode */
struct firmware *ucode;

/* Boot helper code */
struct firmware *helper;

/* Microcode */
struct firmware *ucode;
};

struct mwl8k_priv {
Expand Down Expand Up @@ -356,26 +358,23 @@ static int mwl8k_request_fw(struct mwl8k_priv *priv,

static int mwl8k_request_firmware(struct mwl8k_priv *priv)
{
u8 filename[64];
struct mwl8k_device_info *di = priv->device_info;
int rc;

snprintf(filename, sizeof(filename),
"mwl8k/helper_%u.fw", priv->device_info->part_num);

rc = mwl8k_request_fw(priv, filename, &priv->fw.helper);
if (rc) {
printk(KERN_ERR "%s: Error requesting helper firmware "
"file %s\n", pci_name(priv->pdev), filename);
return rc;
if (di->helper_image != NULL) {
rc = mwl8k_request_fw(priv, di->helper_image, &priv->fw.helper);
if (rc) {
printk(KERN_ERR "%s: Error requesting helper "
"firmware file %s\n", pci_name(priv->pdev),
di->helper_image);
return rc;
}
}

snprintf(filename, sizeof(filename),
"mwl8k/fmimage_%u.fw", priv->device_info->part_num);

rc = mwl8k_request_fw(priv, filename, &priv->fw.ucode);
rc = mwl8k_request_fw(priv, di->fw_image, &priv->fw.ucode);
if (rc) {
printk(KERN_ERR "%s: Error requesting firmware file %s\n",
pci_name(priv->pdev), filename);
pci_name(priv->pdev), di->fw_image);
mwl8k_release_fw(&priv->fw.helper);
return rc;
}
Expand Down Expand Up @@ -2938,7 +2937,9 @@ static void mwl8k_finalize_join_worker(struct work_struct *work)
}

static struct mwl8k_device_info di_8687 = {
.part_num = 8687,
.part_name = "88w8687",
.helper_image = "mwl8k/helper_8687.fw",
.fw_image = "mwl8k/fmimage_8687.fw",
};

static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {
Expand Down Expand Up @@ -3164,8 +3165,8 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev,
goto err_stop_firmware;
}

printk(KERN_INFO "%s: 88w%u v%d, %pM, firmware version %u.%u.%u.%u\n",
wiphy_name(hw->wiphy), priv->device_info->part_num,
printk(KERN_INFO "%s: %s v%d, %pM, firmware version %u.%u.%u.%u\n",
wiphy_name(hw->wiphy), priv->device_info->part_name,
priv->hw_rev, hw->wiphy->perm_addr,
(priv->fw_rev >> 24) & 0xff, (priv->fw_rev >> 16) & 0xff,
(priv->fw_rev >> 8) & 0xff, priv->fw_rev & 0xff);
Expand Down

0 comments on commit a74b295

Please sign in to comment.