Commit Graph

12 Commits (7cbc353540c31ffaf65ad44d89b955be0f1d04dc)

Author SHA1 Message Date
Eliad Peller 3fcdab7066 wl12xx: Use a dedicated fw for PLT
A special PLT firmware is used for calibration.

Add multiple fw support by introducing a new fw_type member,
representing the currently saved fw (the actual fw state
can be determined by wl->state).

Signed-off-by: Gery Kahn <geryk@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:35 +02:00
Luciano Coelho 75f25548be wl12xx: add testmode operation to read the BD_ADDR from Fuse ROM
Add a testmode command to retrieve the BD_ADDR that is stored in the
Fuse ROM in newer PGs.  In old PGs this operation is not supported.
The caller can then derive the MAC addresses from it.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15 08:38:29 +02:00
Pontus Fuchs 3f1764945e wl12xx: Restore testmode ABI
Commit 80900d0140 accidently broke
the ABI for testmode commands. Restore the ABI again.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-15 09:58:41 +02:00
Eliad Peller 3dbb5846db wl12xx: send testmode reply in wl1271_tm_cmd_interrogate
wl1271_tm_cmd_interrogate creates a reply skb, but doesn't
send it (and thus just leaks it).
Add the missing cfg80211_testmode_reply() call.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-08 12:32:36 +02:00
Eliad Peller abc47470ef wl12xx: fix testmode test/interrogate commands
fix several issues in testmode test/interrogate commands:
1. check the driver state is not OFF.
2. wakeup the chip from elp (if needed)
3. fix memory leak in wl1271_tm_cmd_interrogate()

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-12-08 12:32:36 +02:00
Luciano Coelho 0f4e31222a wl12xx: move debugging definitions to a separate file
Separate the debugging macros and other definitions to a new debug.h
file.  This is be needed because the sdio and spi modules don't need
to depend on the wl12xx module anymore, but still need to include
wl12xx.h.  Currently they do depend on it, because of the debugging
global that wl12xx exports.  A future patch will remove this
dependency.

Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-10-11 16:19:05 +03:00
Ido Yariv 80900d0140 wl12xx: Remove obsolete testmode NVS push command
The testmode NVS push command is no longer in use. In addition, it has
several implementation issues that prevent it from working correctly:

1. wl1271_tm_cmd_configure relies on wl->chip.id being set. However,
   since the device was not necessarily booted by the time the function
   is called, wl->chip.id will be initialized to 0.
2. The NVS file is fetched by calling request_firmware() before it is
   possible to push an NVS file.
3. The maximum allowed size of nl binary payloads is not sufficient for
   pushing NVS files.
4. Pushing 128x NVS files will always fail due to a bug in the
   validation code.
5. In case the pushed NVS file is found invalid, the mutex will be kept
   locked and the nvs member will become a dangling pointer.

Since this feature is not being used, remove it completely instead of
fixing it.

Signed-off-by: Ido Yariv <ido@wizery.com>
Acked-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-23 15:54:19 -04:00
Julia Lawall f8afdf481f drivers/net/wireless/wl12xx: add missing kfree
In each case, the freed data should be freed in the error handling code
as
well.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@exists@
local idexpression x;
statement S,S1;
expression E;
identifier fl;
expression *ptr != NULL;
@@

x = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
     when != if (...) { <+...kfree(x)...+> }
     when any
     when != true x == NULL
x->fl
...>
(
if (x == NULL) S1
|
if (...) { ... when != x
               when forall
(
 return \(0\|<+...x...+>\|ptr\);
|
* return ...;
)
}
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-12 13:33:31 -04:00
Ido Yariv baacb9aed0 wl12xx: Avoid recovery while one is already in progress
During recovery work commands sent to the FW could fail and schedule
additional recovery work. Since the chip is going to be powered off,
avoid recursive recoveries.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27 15:05:15 +03:00
Shahar Levi bc765bf3b9 wl12xx: 1281/1283 support - Loading FW & NVS
Take care of FW & NVS with the auto-detection between wl127x and
wl128x.

[Moved some common code outside if statements and added notes about
NVS structure assumptions; Fixed a bug when checking the nvs size: if
the size was incorrect, the local nvs variable was set to NULL, it
should be wl->nvs instead. -- Luca]

[Merged with potential buffer overflow fix -- Luca]

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-04-19 16:48:10 +03:00
Luciano Coelho 09b661b332 wl12xx: fix potential buffer overflow in testmode nvs push
We were allocating the size of the NVS file struct and not checking
whether the length of the buffer passed was correct before copying it
into the allocated memory.  This is a security hole because buffer
overflows can occur if the userspace passes a bigger file than what is
expected.

With this patch, we check if the size of the data passed from
userspace matches the size required.

This bug was introduced in 2.6.36.

Cc: stable@kernel.org
Reported-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-04 15:22:12 -04:00
Shahar Levi 00d201001b wl1271: Change wl12xx Files Names
All files name prefix removed due to the fact that wl12xx driver supports
wl1271 and wl1273.
Also the definition in Kconfig and header files changed respectively.

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
2010-11-22 16:45:09 +02:00