aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2009-11-30 12:32:38 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-28 16:31:26 -0500
commit22be40d9c53faa10d03a679160e0854ad115b610 (patch)
treed009aded49caf192c81f2ac0fa2ebf770fea7f35 /drivers
parent647ca6b01a5289948e970ea7c1f656f9d90b0a27 (diff)
mwl8k: get rid of the struct mwl8k_firmware abstraction
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/mwl8k.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index c54f8305df18..19fe7124d93a 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -126,15 +126,6 @@ struct mwl8k_tx_queue {
126 struct sk_buff **skb; 126 struct sk_buff **skb;
127}; 127};
128 128
129/* Pointers to the firmware data and meta information about it. */
130struct mwl8k_firmware {
131 /* Boot helper code */
132 struct firmware *helper;
133
134 /* Microcode */
135 struct firmware *ucode;
136};
137
138struct mwl8k_priv { 129struct mwl8k_priv {
139 void __iomem *sram; 130 void __iomem *sram;
140 void __iomem *regs; 131 void __iomem *regs;
@@ -147,7 +138,8 @@ struct mwl8k_priv {
147 struct rxd_ops *rxd_ops; 138 struct rxd_ops *rxd_ops;
148 139
149 /* firmware files and meta data */ 140 /* firmware files and meta data */
150 struct mwl8k_firmware fw; 141 struct firmware *fw_helper;
142 struct firmware *fw_ucode;
151 143
152 /* firmware access */ 144 /* firmware access */
153 struct mutex fw_mutex; 145 struct mutex fw_mutex;
@@ -358,8 +350,8 @@ static void mwl8k_release_fw(struct firmware **fw)
358 350
359static void mwl8k_release_firmware(struct mwl8k_priv *priv) 351static void mwl8k_release_firmware(struct mwl8k_priv *priv)
360{ 352{
361 mwl8k_release_fw(&priv->fw.ucode); 353 mwl8k_release_fw(&priv->fw_ucode);
362 mwl8k_release_fw(&priv->fw.helper); 354 mwl8k_release_fw(&priv->fw_helper);
363} 355}
364 356
365/* Request fw image */ 357/* Request fw image */
@@ -380,7 +372,7 @@ static int mwl8k_request_firmware(struct mwl8k_priv *priv)
380 int rc; 372 int rc;
381 373
382 if (di->helper_image != NULL) { 374 if (di->helper_image != NULL) {
383 rc = mwl8k_request_fw(priv, di->helper_image, &priv->fw.helper); 375 rc = mwl8k_request_fw(priv, di->helper_image, &priv->fw_helper);
384 if (rc) { 376 if (rc) {
385 printk(KERN_ERR "%s: Error requesting helper " 377 printk(KERN_ERR "%s: Error requesting helper "
386 "firmware file %s\n", pci_name(priv->pdev), 378 "firmware file %s\n", pci_name(priv->pdev),
@@ -389,11 +381,11 @@ static int mwl8k_request_firmware(struct mwl8k_priv *priv)
389 } 381 }
390 } 382 }
391 383
392 rc = mwl8k_request_fw(priv, di->fw_image, &priv->fw.ucode); 384 rc = mwl8k_request_fw(priv, di->fw_image, &priv->fw_ucode);
393 if (rc) { 385 if (rc) {
394 printk(KERN_ERR "%s: Error requesting firmware file %s\n", 386 printk(KERN_ERR "%s: Error requesting firmware file %s\n",
395 pci_name(priv->pdev), di->fw_image); 387 pci_name(priv->pdev), di->fw_image);
396 mwl8k_release_fw(&priv->fw.helper); 388 mwl8k_release_fw(&priv->fw_helper);
397 return rc; 389 return rc;
398 } 390 }
399 391
@@ -554,13 +546,13 @@ static int mwl8k_feed_fw_image(struct mwl8k_priv *priv,
554static int mwl8k_load_firmware(struct ieee80211_hw *hw) 546static int mwl8k_load_firmware(struct ieee80211_hw *hw)
555{ 547{
556 struct mwl8k_priv *priv = hw->priv; 548 struct mwl8k_priv *priv = hw->priv;
557 struct firmware *fw = priv->fw.ucode; 549 struct firmware *fw = priv->fw_ucode;
558 struct mwl8k_device_info *di = priv->device_info; 550 struct mwl8k_device_info *di = priv->device_info;
559 int rc; 551 int rc;
560 int loops; 552 int loops;
561 553
562 if (!memcmp(fw->data, "\x01\x00\x00\x00", 4)) { 554 if (!memcmp(fw->data, "\x01\x00\x00\x00", 4)) {
563 struct firmware *helper = priv->fw.helper; 555 struct firmware *helper = priv->fw_helper;
564 556
565 if (helper == NULL) { 557 if (helper == NULL) {
566 printk(KERN_ERR "%s: helper image needed but none " 558 printk(KERN_ERR "%s: helper image needed but none "