summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/p54/p54pci.c
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@web.de>2008-12-26 19:09:34 +0100
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:59:39 -0500
commite365f16046b72977ec22364215b57af840f0907e (patch)
treebbd5f2b2525e3077f9d466715e0e49ade539e6ff /drivers/net/wireless/p54/p54pci.c
parent6982869d993009c02cefcca98a67b212d0e61c5f (diff)
downloadop-kernel-dev-e365f16046b72977ec22364215b57af840f0907e.zip
op-kernel-dev-e365f16046b72977ec22364215b57af840f0907e.tar.gz
p54: prevent upload of wrong firmwares
This patch will prevent anyone to upload a firmware which was not designed for his device. There's still a catch: There is no easy way to detect if a firmware is for PCI or for USB (1st Gen), because they all share the same LM86 identifier. Signed-off-by: Christian Lamparter <chunkeey@web.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/p54/p54pci.c')
-rw-r--r--drivers/net/wireless/p54/p54pci.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c
index aa367a0..3f9a6b0 100644
--- a/drivers/net/wireless/p54/p54pci.c
+++ b/drivers/net/wireless/p54/p54pci.c
@@ -79,6 +79,12 @@ static int p54p_upload_firmware(struct ieee80211_hw *dev)
if (err)
return err;
+ if (priv->common.fw_interface != FW_LM86) {
+ dev_err(&priv->pdev->dev, "wrong firmware, "
+ "please get a LM86(PCI) firmware a try again.\n");
+ return -EINVAL;
+ }
+
data = (__le32 *) priv->firmware->data;
remains = priv->firmware->size;
device_addr = ISL38XX_DEV_FIRMWARE_ADDR;
OpenPOWER on IntegriCloud