aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwl8k.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2009-10-22 14:20:50 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-11-06 16:54:36 -0500
commita74b295edb3e2b39d6c03255b24dca862a843c59 (patch)
treeff1974977cbc99ffaeacf9d9f6a930ea0fdb22ae /drivers/net/wireless/mwl8k.c
parent45a390ddd70d8bec0b17dd37bc8f77372c9c3d33 (diff)
mwl8k: spell out the names of firmware images in the pci driver data
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>
Diffstat (limited to 'drivers/net/wireless/mwl8k.c')
-rw-r--r--drivers/net/wireless/mwl8k.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index a582794495e5..b0080ae98a83 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -81,7 +81,9 @@
81#define MWL8K_TX_QUEUES 4 81#define MWL8K_TX_QUEUES 4
82 82
83struct mwl8k_device_info { 83struct mwl8k_device_info {
84 int part_num; 84 char *part_name;
85 char *helper_image;
86 char *fw_image;
85}; 87};
86 88
87struct mwl8k_rx_queue { 89struct mwl8k_rx_queue {
@@ -113,11 +115,11 @@ struct mwl8k_tx_queue {
113 115
114/* Pointers to the firmware data and meta information about it. */ 116/* Pointers to the firmware data and meta information about it. */
115struct mwl8k_firmware { 117struct mwl8k_firmware {
116 /* Microcode */
117 struct firmware *ucode;
118
119 /* Boot helper code */ 118 /* Boot helper code */
120 struct firmware *helper; 119 struct firmware *helper;
120
121 /* Microcode */
122 struct firmware *ucode;
121}; 123};
122 124
123struct mwl8k_priv { 125struct mwl8k_priv {
@@ -356,26 +358,23 @@ static int mwl8k_request_fw(struct mwl8k_priv *priv,
356 358
357static int mwl8k_request_firmware(struct mwl8k_priv *priv) 359static int mwl8k_request_firmware(struct mwl8k_priv *priv)
358{ 360{
359 u8 filename[64]; 361 struct mwl8k_device_info *di = priv->device_info;
360 int rc; 362 int rc;
361 363
362 snprintf(filename, sizeof(filename), 364 if (di->helper_image != NULL) {
363 "mwl8k/helper_%u.fw", priv->device_info->part_num); 365 rc = mwl8k_request_fw(priv, di->helper_image, &priv->fw.helper);
364 366 if (rc) {
365 rc = mwl8k_request_fw(priv, filename, &priv->fw.helper); 367 printk(KERN_ERR "%s: Error requesting helper "
366 if (rc) { 368 "firmware file %s\n", pci_name(priv->pdev),
367 printk(KERN_ERR "%s: Error requesting helper firmware " 369 di->helper_image);
368 "file %s\n", pci_name(priv->pdev), filename); 370 return rc;
369 return rc; 371 }
370 } 372 }
371 373
372 snprintf(filename, sizeof(filename), 374 rc = mwl8k_request_fw(priv, di->fw_image, &priv->fw.ucode);
373 "mwl8k/fmimage_%u.fw", priv->device_info->part_num);
374
375 rc = mwl8k_request_fw(priv, filename, &priv->fw.ucode);
376 if (rc) { 375 if (rc) {
377 printk(KERN_ERR "%s: Error requesting firmware file %s\n", 376 printk(KERN_ERR "%s: Error requesting firmware file %s\n",
378 pci_name(priv->pdev), filename); 377 pci_name(priv->pdev), di->fw_image);
379 mwl8k_release_fw(&priv->fw.helper); 378 mwl8k_release_fw(&priv->fw.helper);
380 return rc; 379 return rc;
381 } 380 }
@@ -2938,7 +2937,9 @@ static void mwl8k_finalize_join_worker(struct work_struct *work)
2938} 2937}
2939 2938
2940static struct mwl8k_device_info di_8687 = { 2939static struct mwl8k_device_info di_8687 = {
2941 .part_num = 8687, 2940 .part_name = "88w8687",
2941 .helper_image = "mwl8k/helper_8687.fw",
2942 .fw_image = "mwl8k/fmimage_8687.fw",
2942}; 2943};
2943 2944
2944static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = { 2945static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {
@@ -3164,8 +3165,8 @@ static int __devinit mwl8k_probe(struct pci_dev *pdev,
3164 goto err_stop_firmware; 3165 goto err_stop_firmware;
3165 } 3166 }
3166 3167
3167 printk(KERN_INFO "%s: 88w%u v%d, %pM, firmware version %u.%u.%u.%u\n", 3168 printk(KERN_INFO "%s: %s v%d, %pM, firmware version %u.%u.%u.%u\n",
3168 wiphy_name(hw->wiphy), priv->device_info->part_num, 3169 wiphy_name(hw->wiphy), priv->device_info->part_name,
3169 priv->hw_rev, hw->wiphy->perm_addr, 3170 priv->hw_rev, hw->wiphy->perm_addr,
3170 (priv->fw_rev >> 24) & 0xff, (priv->fw_rev >> 16) & 0xff, 3171 (priv->fw_rev >> 24) & 0xff, (priv->fw_rev >> 16) & 0xff,
3171 (priv->fw_rev >> 8) & 0xff, priv->fw_rev & 0xff); 3172 (priv->fw_rev >> 8) & 0xff, priv->fw_rev & 0xff);