Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121660
b: refs/heads/master
c: 4fb3078
h: refs/heads/master
v: v3
  • Loading branch information
Andrey Borzenkov authored and John W. Linville committed Oct 31, 2008
1 parent 43c4714 commit 8d135a2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0df6cbb7d8a0a8fea69138e9e463671a8ad99f16
refs/heads/master: 4fb30784c720b863203957f76e3fde0d53932746
28 changes: 21 additions & 7 deletions trunk/drivers/net/wireless/orinoco.c
Original file line number Diff line number Diff line change
Expand Up @@ -487,12 +487,17 @@ orinoco_dl_firmware(struct orinoco_private *priv,
if (err)
goto free;

err = request_firmware(&fw_entry, firmware, priv->dev);
if (err) {
printk(KERN_ERR "%s: Cannot find firmware %s\n",
dev->name, firmware);
err = -ENOENT;
goto free;
if (priv->cached_fw)
fw_entry = priv->cached_fw;
else {
err = request_firmware(&fw_entry, firmware, priv->dev);
if (err) {
printk(KERN_ERR "%s: Cannot find firmware %s\n",
dev->name, firmware);
err = -ENOENT;
goto free;
}
priv->cached_fw = fw_entry;
}

hdr = (const struct orinoco_fw_header *) fw_entry->data;
Expand Down Expand Up @@ -535,7 +540,11 @@ orinoco_dl_firmware(struct orinoco_private *priv,
dev->name, hermes_present(hw));

abort:
release_firmware(fw_entry);
/* In case of error, assume firmware was bogus and release it */
if (err) {
priv->cached_fw = NULL;
release_firmware(fw_entry);
}

free:
kfree(pda);
Expand Down Expand Up @@ -3532,6 +3541,8 @@ struct net_device
netif_carrier_off(dev);
priv->last_linkstatus = 0xffff;

priv->cached_fw = NULL;

return dev;
}

Expand All @@ -3543,6 +3554,9 @@ void free_orinocodev(struct net_device *dev)
* when we call tasklet_kill it will run one final time,
* emptying the list */
tasklet_kill(&priv->rx_tasklet);
if (priv->cached_fw)
release_firmware(priv->cached_fw);
priv->cached_fw = NULL;
priv->wpa_ie_len = 0;
kfree(priv->wpa_ie);
orinoco_mic_free(priv);
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/net/wireless/orinoco.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ struct orinoco_rx_data {
struct list_head list;
};

struct firmware;

struct orinoco_private {
void *card; /* Pointer to card dependent structure */
struct device *dev;
Expand Down Expand Up @@ -164,6 +166,9 @@ struct orinoco_private {
unsigned int wpa_enabled:1;
unsigned int tkip_cm_active:1;
unsigned int key_mgmt:3;

/* Cached in memory firmware to use in ->resume */
const struct firmware *cached_fw;
};

#ifdef ORINOCO_DEBUG
Expand Down

0 comments on commit 8d135a2

Please sign in to comment.