1*4882a593Smuzhiyun /* Firmware file reading and download helpers
2*4882a593Smuzhiyun *
3*4882a593Smuzhiyun * See copyright notice in main.c
4*4882a593Smuzhiyun */
5*4882a593Smuzhiyun #include <linux/kernel.h>
6*4882a593Smuzhiyun #include <linux/slab.h>
7*4882a593Smuzhiyun #include <linux/firmware.h>
8*4882a593Smuzhiyun #include <linux/device.h>
9*4882a593Smuzhiyun #include <linux/module.h>
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun #include "hermes.h"
12*4882a593Smuzhiyun #include "hermes_dld.h"
13*4882a593Smuzhiyun #include "orinoco.h"
14*4882a593Smuzhiyun
15*4882a593Smuzhiyun #include "fw.h"
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun /* End markers (for Symbol firmware only) */
18*4882a593Smuzhiyun #define TEXT_END 0x1A /* End of text header */
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun struct fw_info {
21*4882a593Smuzhiyun char *pri_fw;
22*4882a593Smuzhiyun char *sta_fw;
23*4882a593Smuzhiyun char *ap_fw;
24*4882a593Smuzhiyun u32 pda_addr;
25*4882a593Smuzhiyun u16 pda_size;
26*4882a593Smuzhiyun };
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun static const struct fw_info orinoco_fw[] = {
29*4882a593Smuzhiyun { NULL, "agere_sta_fw.bin", "agere_ap_fw.bin", 0x00390000, 1000 },
30*4882a593Smuzhiyun { NULL, "prism_sta_fw.bin", "prism_ap_fw.bin", 0, 1024 },
31*4882a593Smuzhiyun { "symbol_sp24t_prim_fw", "symbol_sp24t_sec_fw", NULL, 0x00003100, 512 }
32*4882a593Smuzhiyun };
33*4882a593Smuzhiyun MODULE_FIRMWARE("agere_sta_fw.bin");
34*4882a593Smuzhiyun MODULE_FIRMWARE("agere_ap_fw.bin");
35*4882a593Smuzhiyun MODULE_FIRMWARE("prism_sta_fw.bin");
36*4882a593Smuzhiyun MODULE_FIRMWARE("prism_ap_fw.bin");
37*4882a593Smuzhiyun MODULE_FIRMWARE("symbol_sp24t_prim_fw");
38*4882a593Smuzhiyun MODULE_FIRMWARE("symbol_sp24t_sec_fw");
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun /* Structure used to access fields in FW
41*4882a593Smuzhiyun * Make sure LE decoding macros are used
42*4882a593Smuzhiyun */
43*4882a593Smuzhiyun struct orinoco_fw_header {
44*4882a593Smuzhiyun char hdr_vers[6]; /* ASCII string for header version */
45*4882a593Smuzhiyun __le16 headersize; /* Total length of header */
46*4882a593Smuzhiyun __le32 entry_point; /* NIC entry point */
47*4882a593Smuzhiyun __le32 blocks; /* Number of blocks to program */
48*4882a593Smuzhiyun __le32 block_offset; /* Offset of block data from eof header */
49*4882a593Smuzhiyun __le32 pdr_offset; /* Offset to PDR data from eof header */
50*4882a593Smuzhiyun __le32 pri_offset; /* Offset to primary plug data */
51*4882a593Smuzhiyun __le32 compat_offset; /* Offset to compatibility data*/
52*4882a593Smuzhiyun char signature[]; /* FW signature length headersize-20 */
53*4882a593Smuzhiyun } __packed;
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun /* Check the range of various header entries. Return a pointer to a
56*4882a593Smuzhiyun * description of the problem, or NULL if everything checks out. */
validate_fw(const struct orinoco_fw_header * hdr,size_t len)57*4882a593Smuzhiyun static const char *validate_fw(const struct orinoco_fw_header *hdr, size_t len)
58*4882a593Smuzhiyun {
59*4882a593Smuzhiyun u16 hdrsize;
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun if (len < sizeof(*hdr))
62*4882a593Smuzhiyun return "image too small";
63*4882a593Smuzhiyun if (memcmp(hdr->hdr_vers, "HFW", 3) != 0)
64*4882a593Smuzhiyun return "format not recognised";
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun hdrsize = le16_to_cpu(hdr->headersize);
67*4882a593Smuzhiyun if (hdrsize > len)
68*4882a593Smuzhiyun return "bad headersize";
69*4882a593Smuzhiyun if ((hdrsize + le32_to_cpu(hdr->block_offset)) > len)
70*4882a593Smuzhiyun return "bad block offset";
71*4882a593Smuzhiyun if ((hdrsize + le32_to_cpu(hdr->pdr_offset)) > len)
72*4882a593Smuzhiyun return "bad PDR offset";
73*4882a593Smuzhiyun if ((hdrsize + le32_to_cpu(hdr->pri_offset)) > len)
74*4882a593Smuzhiyun return "bad PRI offset";
75*4882a593Smuzhiyun if ((hdrsize + le32_to_cpu(hdr->compat_offset)) > len)
76*4882a593Smuzhiyun return "bad compat offset";
77*4882a593Smuzhiyun
78*4882a593Smuzhiyun /* TODO: consider adding a checksum or CRC to the firmware format */
79*4882a593Smuzhiyun return NULL;
80*4882a593Smuzhiyun }
81*4882a593Smuzhiyun
82*4882a593Smuzhiyun #if defined(CONFIG_HERMES_CACHE_FW_ON_INIT) || defined(CONFIG_PM_SLEEP)
83*4882a593Smuzhiyun static inline const struct firmware *
orinoco_cached_fw_get(struct orinoco_private * priv,bool primary)84*4882a593Smuzhiyun orinoco_cached_fw_get(struct orinoco_private *priv, bool primary)
85*4882a593Smuzhiyun {
86*4882a593Smuzhiyun if (primary)
87*4882a593Smuzhiyun return priv->cached_pri_fw;
88*4882a593Smuzhiyun else
89*4882a593Smuzhiyun return priv->cached_fw;
90*4882a593Smuzhiyun }
91*4882a593Smuzhiyun #else
92*4882a593Smuzhiyun #define orinoco_cached_fw_get(priv, primary) (NULL)
93*4882a593Smuzhiyun #endif
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun /* Download either STA or AP firmware into the card. */
96*4882a593Smuzhiyun static int
orinoco_dl_firmware(struct orinoco_private * priv,const struct fw_info * fw,int ap)97*4882a593Smuzhiyun orinoco_dl_firmware(struct orinoco_private *priv,
98*4882a593Smuzhiyun const struct fw_info *fw,
99*4882a593Smuzhiyun int ap)
100*4882a593Smuzhiyun {
101*4882a593Smuzhiyun /* Plug Data Area (PDA) */
102*4882a593Smuzhiyun __le16 *pda;
103*4882a593Smuzhiyun
104*4882a593Smuzhiyun struct hermes *hw = &priv->hw;
105*4882a593Smuzhiyun const struct firmware *fw_entry;
106*4882a593Smuzhiyun const struct orinoco_fw_header *hdr;
107*4882a593Smuzhiyun const unsigned char *first_block;
108*4882a593Smuzhiyun const void *end;
109*4882a593Smuzhiyun const char *firmware;
110*4882a593Smuzhiyun const char *fw_err;
111*4882a593Smuzhiyun struct device *dev = priv->dev;
112*4882a593Smuzhiyun int err = 0;
113*4882a593Smuzhiyun
114*4882a593Smuzhiyun pda = kzalloc(fw->pda_size, GFP_KERNEL);
115*4882a593Smuzhiyun if (!pda)
116*4882a593Smuzhiyun return -ENOMEM;
117*4882a593Smuzhiyun
118*4882a593Smuzhiyun if (ap)
119*4882a593Smuzhiyun firmware = fw->ap_fw;
120*4882a593Smuzhiyun else
121*4882a593Smuzhiyun firmware = fw->sta_fw;
122*4882a593Smuzhiyun
123*4882a593Smuzhiyun dev_dbg(dev, "Attempting to download firmware %s\n", firmware);
124*4882a593Smuzhiyun
125*4882a593Smuzhiyun /* Read current plug data */
126*4882a593Smuzhiyun err = hw->ops->read_pda(hw, pda, fw->pda_addr, fw->pda_size);
127*4882a593Smuzhiyun dev_dbg(dev, "Read PDA returned %d\n", err);
128*4882a593Smuzhiyun if (err)
129*4882a593Smuzhiyun goto free;
130*4882a593Smuzhiyun
131*4882a593Smuzhiyun if (!orinoco_cached_fw_get(priv, false)) {
132*4882a593Smuzhiyun err = request_firmware(&fw_entry, firmware, priv->dev);
133*4882a593Smuzhiyun
134*4882a593Smuzhiyun if (err) {
135*4882a593Smuzhiyun dev_err(dev, "Cannot find firmware %s\n", firmware);
136*4882a593Smuzhiyun err = -ENOENT;
137*4882a593Smuzhiyun goto free;
138*4882a593Smuzhiyun }
139*4882a593Smuzhiyun } else
140*4882a593Smuzhiyun fw_entry = orinoco_cached_fw_get(priv, false);
141*4882a593Smuzhiyun
142*4882a593Smuzhiyun hdr = (const struct orinoco_fw_header *) fw_entry->data;
143*4882a593Smuzhiyun
144*4882a593Smuzhiyun fw_err = validate_fw(hdr, fw_entry->size);
145*4882a593Smuzhiyun if (fw_err) {
146*4882a593Smuzhiyun dev_warn(dev, "Invalid firmware image detected (%s). "
147*4882a593Smuzhiyun "Aborting download\n", fw_err);
148*4882a593Smuzhiyun err = -EINVAL;
149*4882a593Smuzhiyun goto abort;
150*4882a593Smuzhiyun }
151*4882a593Smuzhiyun
152*4882a593Smuzhiyun /* Enable aux port to allow programming */
153*4882a593Smuzhiyun err = hw->ops->program_init(hw, le32_to_cpu(hdr->entry_point));
154*4882a593Smuzhiyun dev_dbg(dev, "Program init returned %d\n", err);
155*4882a593Smuzhiyun if (err != 0)
156*4882a593Smuzhiyun goto abort;
157*4882a593Smuzhiyun
158*4882a593Smuzhiyun /* Program data */
159*4882a593Smuzhiyun first_block = (fw_entry->data +
160*4882a593Smuzhiyun le16_to_cpu(hdr->headersize) +
161*4882a593Smuzhiyun le32_to_cpu(hdr->block_offset));
162*4882a593Smuzhiyun end = fw_entry->data + fw_entry->size;
163*4882a593Smuzhiyun
164*4882a593Smuzhiyun err = hermes_program(hw, first_block, end);
165*4882a593Smuzhiyun dev_dbg(dev, "Program returned %d\n", err);
166*4882a593Smuzhiyun if (err != 0)
167*4882a593Smuzhiyun goto abort;
168*4882a593Smuzhiyun
169*4882a593Smuzhiyun /* Update production data */
170*4882a593Smuzhiyun first_block = (fw_entry->data +
171*4882a593Smuzhiyun le16_to_cpu(hdr->headersize) +
172*4882a593Smuzhiyun le32_to_cpu(hdr->pdr_offset));
173*4882a593Smuzhiyun
174*4882a593Smuzhiyun err = hermes_apply_pda_with_defaults(hw, first_block, end, pda,
175*4882a593Smuzhiyun &pda[fw->pda_size / sizeof(*pda)]);
176*4882a593Smuzhiyun dev_dbg(dev, "Apply PDA returned %d\n", err);
177*4882a593Smuzhiyun if (err)
178*4882a593Smuzhiyun goto abort;
179*4882a593Smuzhiyun
180*4882a593Smuzhiyun /* Tell card we've finished */
181*4882a593Smuzhiyun err = hw->ops->program_end(hw);
182*4882a593Smuzhiyun dev_dbg(dev, "Program end returned %d\n", err);
183*4882a593Smuzhiyun if (err != 0)
184*4882a593Smuzhiyun goto abort;
185*4882a593Smuzhiyun
186*4882a593Smuzhiyun /* Check if we're running */
187*4882a593Smuzhiyun dev_dbg(dev, "hermes_present returned %d\n", hermes_present(hw));
188*4882a593Smuzhiyun
189*4882a593Smuzhiyun abort:
190*4882a593Smuzhiyun /* If we requested the firmware, release it. */
191*4882a593Smuzhiyun if (!orinoco_cached_fw_get(priv, false))
192*4882a593Smuzhiyun release_firmware(fw_entry);
193*4882a593Smuzhiyun
194*4882a593Smuzhiyun free:
195*4882a593Smuzhiyun kfree(pda);
196*4882a593Smuzhiyun return err;
197*4882a593Smuzhiyun }
198*4882a593Smuzhiyun
199*4882a593Smuzhiyun /*
200*4882a593Smuzhiyun * Process a firmware image - stop the card, load the firmware, reset
201*4882a593Smuzhiyun * the card and make sure it responds. For the secondary firmware take
202*4882a593Smuzhiyun * care of the PDA - read it and then write it on top of the firmware.
203*4882a593Smuzhiyun */
204*4882a593Smuzhiyun static int
symbol_dl_image(struct orinoco_private * priv,const struct fw_info * fw,const unsigned char * image,const void * end,int secondary)205*4882a593Smuzhiyun symbol_dl_image(struct orinoco_private *priv, const struct fw_info *fw,
206*4882a593Smuzhiyun const unsigned char *image, const void *end,
207*4882a593Smuzhiyun int secondary)
208*4882a593Smuzhiyun {
209*4882a593Smuzhiyun struct hermes *hw = &priv->hw;
210*4882a593Smuzhiyun int ret = 0;
211*4882a593Smuzhiyun const unsigned char *ptr;
212*4882a593Smuzhiyun const unsigned char *first_block;
213*4882a593Smuzhiyun
214*4882a593Smuzhiyun /* Plug Data Area (PDA) */
215*4882a593Smuzhiyun __le16 *pda = NULL;
216*4882a593Smuzhiyun
217*4882a593Smuzhiyun /* Binary block begins after the 0x1A marker */
218*4882a593Smuzhiyun ptr = image;
219*4882a593Smuzhiyun while (*ptr++ != TEXT_END);
220*4882a593Smuzhiyun first_block = ptr;
221*4882a593Smuzhiyun
222*4882a593Smuzhiyun /* Read the PDA from EEPROM */
223*4882a593Smuzhiyun if (secondary) {
224*4882a593Smuzhiyun pda = kzalloc(fw->pda_size, GFP_KERNEL);
225*4882a593Smuzhiyun if (!pda)
226*4882a593Smuzhiyun return -ENOMEM;
227*4882a593Smuzhiyun
228*4882a593Smuzhiyun ret = hw->ops->read_pda(hw, pda, fw->pda_addr, fw->pda_size);
229*4882a593Smuzhiyun if (ret)
230*4882a593Smuzhiyun goto free;
231*4882a593Smuzhiyun }
232*4882a593Smuzhiyun
233*4882a593Smuzhiyun /* Stop the firmware, so that it can be safely rewritten */
234*4882a593Smuzhiyun if (priv->stop_fw) {
235*4882a593Smuzhiyun ret = priv->stop_fw(priv, 1);
236*4882a593Smuzhiyun if (ret)
237*4882a593Smuzhiyun goto free;
238*4882a593Smuzhiyun }
239*4882a593Smuzhiyun
240*4882a593Smuzhiyun /* Program the adapter with new firmware */
241*4882a593Smuzhiyun ret = hermes_program(hw, first_block, end);
242*4882a593Smuzhiyun if (ret)
243*4882a593Smuzhiyun goto free;
244*4882a593Smuzhiyun
245*4882a593Smuzhiyun /* Write the PDA to the adapter */
246*4882a593Smuzhiyun if (secondary) {
247*4882a593Smuzhiyun size_t len = hermes_blocks_length(first_block, end);
248*4882a593Smuzhiyun ptr = first_block + len;
249*4882a593Smuzhiyun ret = hermes_apply_pda(hw, ptr, end, pda,
250*4882a593Smuzhiyun &pda[fw->pda_size / sizeof(*pda)]);
251*4882a593Smuzhiyun kfree(pda);
252*4882a593Smuzhiyun if (ret)
253*4882a593Smuzhiyun return ret;
254*4882a593Smuzhiyun }
255*4882a593Smuzhiyun
256*4882a593Smuzhiyun /* Run the firmware */
257*4882a593Smuzhiyun if (priv->stop_fw) {
258*4882a593Smuzhiyun ret = priv->stop_fw(priv, 0);
259*4882a593Smuzhiyun if (ret)
260*4882a593Smuzhiyun return ret;
261*4882a593Smuzhiyun }
262*4882a593Smuzhiyun
263*4882a593Smuzhiyun /* Reset hermes chip and make sure it responds */
264*4882a593Smuzhiyun ret = hw->ops->init(hw);
265*4882a593Smuzhiyun
266*4882a593Smuzhiyun /* hermes_reset() should return 0 with the secondary firmware */
267*4882a593Smuzhiyun if (secondary && ret != 0)
268*4882a593Smuzhiyun return -ENODEV;
269*4882a593Smuzhiyun
270*4882a593Smuzhiyun /* And this should work with any firmware */
271*4882a593Smuzhiyun if (!hermes_present(hw))
272*4882a593Smuzhiyun return -ENODEV;
273*4882a593Smuzhiyun
274*4882a593Smuzhiyun return 0;
275*4882a593Smuzhiyun
276*4882a593Smuzhiyun free:
277*4882a593Smuzhiyun kfree(pda);
278*4882a593Smuzhiyun return ret;
279*4882a593Smuzhiyun }
280*4882a593Smuzhiyun
281*4882a593Smuzhiyun
282*4882a593Smuzhiyun /*
283*4882a593Smuzhiyun * Download the firmware into the card, this also does a PCMCIA soft
284*4882a593Smuzhiyun * reset on the card, to make sure it's in a sane state.
285*4882a593Smuzhiyun */
286*4882a593Smuzhiyun static int
symbol_dl_firmware(struct orinoco_private * priv,const struct fw_info * fw)287*4882a593Smuzhiyun symbol_dl_firmware(struct orinoco_private *priv,
288*4882a593Smuzhiyun const struct fw_info *fw)
289*4882a593Smuzhiyun {
290*4882a593Smuzhiyun struct device *dev = priv->dev;
291*4882a593Smuzhiyun int ret;
292*4882a593Smuzhiyun const struct firmware *fw_entry;
293*4882a593Smuzhiyun
294*4882a593Smuzhiyun if (!orinoco_cached_fw_get(priv, true)) {
295*4882a593Smuzhiyun if (request_firmware(&fw_entry, fw->pri_fw, priv->dev) != 0) {
296*4882a593Smuzhiyun dev_err(dev, "Cannot find firmware: %s\n", fw->pri_fw);
297*4882a593Smuzhiyun return -ENOENT;
298*4882a593Smuzhiyun }
299*4882a593Smuzhiyun } else
300*4882a593Smuzhiyun fw_entry = orinoco_cached_fw_get(priv, true);
301*4882a593Smuzhiyun
302*4882a593Smuzhiyun /* Load primary firmware */
303*4882a593Smuzhiyun ret = symbol_dl_image(priv, fw, fw_entry->data,
304*4882a593Smuzhiyun fw_entry->data + fw_entry->size, 0);
305*4882a593Smuzhiyun
306*4882a593Smuzhiyun if (!orinoco_cached_fw_get(priv, true))
307*4882a593Smuzhiyun release_firmware(fw_entry);
308*4882a593Smuzhiyun if (ret) {
309*4882a593Smuzhiyun dev_err(dev, "Primary firmware download failed\n");
310*4882a593Smuzhiyun return ret;
311*4882a593Smuzhiyun }
312*4882a593Smuzhiyun
313*4882a593Smuzhiyun if (!orinoco_cached_fw_get(priv, false)) {
314*4882a593Smuzhiyun if (request_firmware(&fw_entry, fw->sta_fw, priv->dev) != 0) {
315*4882a593Smuzhiyun dev_err(dev, "Cannot find firmware: %s\n", fw->sta_fw);
316*4882a593Smuzhiyun return -ENOENT;
317*4882a593Smuzhiyun }
318*4882a593Smuzhiyun } else
319*4882a593Smuzhiyun fw_entry = orinoco_cached_fw_get(priv, false);
320*4882a593Smuzhiyun
321*4882a593Smuzhiyun /* Load secondary firmware */
322*4882a593Smuzhiyun ret = symbol_dl_image(priv, fw, fw_entry->data,
323*4882a593Smuzhiyun fw_entry->data + fw_entry->size, 1);
324*4882a593Smuzhiyun if (!orinoco_cached_fw_get(priv, false))
325*4882a593Smuzhiyun release_firmware(fw_entry);
326*4882a593Smuzhiyun if (ret)
327*4882a593Smuzhiyun dev_err(dev, "Secondary firmware download failed\n");
328*4882a593Smuzhiyun
329*4882a593Smuzhiyun return ret;
330*4882a593Smuzhiyun }
331*4882a593Smuzhiyun
orinoco_download(struct orinoco_private * priv)332*4882a593Smuzhiyun int orinoco_download(struct orinoco_private *priv)
333*4882a593Smuzhiyun {
334*4882a593Smuzhiyun int err = 0;
335*4882a593Smuzhiyun /* Reload firmware */
336*4882a593Smuzhiyun switch (priv->firmware_type) {
337*4882a593Smuzhiyun case FIRMWARE_TYPE_AGERE:
338*4882a593Smuzhiyun /* case FIRMWARE_TYPE_INTERSIL: */
339*4882a593Smuzhiyun err = orinoco_dl_firmware(priv,
340*4882a593Smuzhiyun &orinoco_fw[priv->firmware_type], 0);
341*4882a593Smuzhiyun break;
342*4882a593Smuzhiyun
343*4882a593Smuzhiyun case FIRMWARE_TYPE_SYMBOL:
344*4882a593Smuzhiyun err = symbol_dl_firmware(priv,
345*4882a593Smuzhiyun &orinoco_fw[priv->firmware_type]);
346*4882a593Smuzhiyun break;
347*4882a593Smuzhiyun case FIRMWARE_TYPE_INTERSIL:
348*4882a593Smuzhiyun break;
349*4882a593Smuzhiyun }
350*4882a593Smuzhiyun /* TODO: if we fail we probably need to reinitialise
351*4882a593Smuzhiyun * the driver */
352*4882a593Smuzhiyun
353*4882a593Smuzhiyun return err;
354*4882a593Smuzhiyun }
355*4882a593Smuzhiyun
356*4882a593Smuzhiyun #if defined(CONFIG_HERMES_CACHE_FW_ON_INIT) || defined(CONFIG_PM_SLEEP)
orinoco_cache_fw(struct orinoco_private * priv,int ap)357*4882a593Smuzhiyun void orinoco_cache_fw(struct orinoco_private *priv, int ap)
358*4882a593Smuzhiyun {
359*4882a593Smuzhiyun const struct firmware *fw_entry = NULL;
360*4882a593Smuzhiyun const char *pri_fw;
361*4882a593Smuzhiyun const char *fw;
362*4882a593Smuzhiyun
363*4882a593Smuzhiyun pri_fw = orinoco_fw[priv->firmware_type].pri_fw;
364*4882a593Smuzhiyun if (ap)
365*4882a593Smuzhiyun fw = orinoco_fw[priv->firmware_type].ap_fw;
366*4882a593Smuzhiyun else
367*4882a593Smuzhiyun fw = orinoco_fw[priv->firmware_type].sta_fw;
368*4882a593Smuzhiyun
369*4882a593Smuzhiyun if (pri_fw) {
370*4882a593Smuzhiyun if (request_firmware(&fw_entry, pri_fw, priv->dev) == 0)
371*4882a593Smuzhiyun priv->cached_pri_fw = fw_entry;
372*4882a593Smuzhiyun }
373*4882a593Smuzhiyun
374*4882a593Smuzhiyun if (fw) {
375*4882a593Smuzhiyun if (request_firmware(&fw_entry, fw, priv->dev) == 0)
376*4882a593Smuzhiyun priv->cached_fw = fw_entry;
377*4882a593Smuzhiyun }
378*4882a593Smuzhiyun }
379*4882a593Smuzhiyun
orinoco_uncache_fw(struct orinoco_private * priv)380*4882a593Smuzhiyun void orinoco_uncache_fw(struct orinoco_private *priv)
381*4882a593Smuzhiyun {
382*4882a593Smuzhiyun release_firmware(priv->cached_pri_fw);
383*4882a593Smuzhiyun release_firmware(priv->cached_fw);
384*4882a593Smuzhiyun priv->cached_pri_fw = NULL;
385*4882a593Smuzhiyun priv->cached_fw = NULL;
386*4882a593Smuzhiyun }
387*4882a593Smuzhiyun #endif
388