History log of /drivers/net/wireless/libertas/if_cs.c
Revision Date Author Comments
7777bd458e9e7cf9ac604f22e5b1691628b45c66 30-Oct-2013 Wei Yongjun <yongjun_wei@trendmicro.com.cn> libertas: fix error return code in if_cs_probe()

Fix to return -ENODEV in the unknown model error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1dfba3060fe7ee03ccec25a91d35085142dfc295 15-Oct-2013 Dan Williams <dcbw@redhat.com> libertas: move firmware lifetime handling to firmware.c

Previously, each bus type was responsible for freeing the firmware
structure, but some did that badly. Move responsibility for freeing
firmware into firmware.c so that it's done once and correctly, instead
of happening in multiple places in bus-specific code.

This fixes a use-after-free bug found by Dr. H. Nikolaus Schaller where
the SDIO code forgot to NULL priv->helper_fw after freeing it.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fdd3f29eddd1b7c26b3b42e3633afcb22a28fcb3 06-Mar-2013 H Hartley Sweeten <hsweeten@visionengravers.com> drivers/net: use module_pcmcia_driver() in pcmcia drivers

Use the new module_pcmcia_driver() macro to remove the boilerplate
module init/exit code in the pcmcia drivers.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
488c3ee77ea0e63c9ae4736b1610aaf39c6527ee 18-Apr-2012 Daniel Drake <dsd@laptop.org> libertas CS: convert to asynchronous firmware loading

Signed-off-by: Daniel Drake <dsd@laptop.org>
Tested-by: Dan Williams <dcbw@redhat.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
370803c25dd77332ee4ca97884c3a5e1e1eafbca 17-Apr-2012 Daniel Drake <dsd@laptop.org> libertas: Firmware loading simplifications

Remove the ability to pass module parameters with firmware filenames
for USB and SDIO interfaces.

Remove the ability to pass custom "user" filenames to lbs_get_firmware().

Remove the ability to reprogram internal device memory with a different
firmware from the USB driver (we don't know of any users), and simplify
the OLPC firmware loading quirk to simply placing the OLPC firmware
at the top of the list (we don't know of any users other than OLPC).

Move lbs_get_firmware() into its own file.

These simplifications should have no real-life effect but make the
upcoming transition to asynchronous firmware loading considerably less
painful.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a7b957a277215da1830596c0791307a999fe5153 09-Apr-2012 Jesper Juhl <jj@chaosbits.net> wireless, libertas: remove redundant NULL tests before calling release_firmware()

release_firmware() tests for, and deals gracefully with, NULL
pointers. Remove redundant explicit tests before calling the function.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e404decb0fb017be80552adee894b35307b6c7b4 29-Jan-2012 Joe Perches <joe@perches.com> drivers/net: Remove unnecessary k.alloc/v.alloc OOM messages

alloc failures use dump_stack so emitting an additional
out-of-memory message is an unnecessary duplication.

Remove the allocation failure messages.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
3db1cd5c05f35fb43eb134df6f321de4e63141f2 19-Dec-2011 Rusty Russell <rusty@rustcorp.com.au> net: fix assignment of 0/1 to bool variables.

DaveM said:
Please, this kind of stuff rots forever and not using bool properly
drives me crazy.

Joe Perches <joe@perches.com> gave me the spatch script:

@@
bool b;
@@
-b = 0
+b = false
@@
bool b;
@@
-b = 1
+b = true

I merely installed coccinelle, read the documentation and took credit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
f3a57fd148a4afd3c38f558c5b44972cb29ea8ba 03-May-2011 Joe Perches <joe@perches.com> libertas: Use netdev_<level> or dev_<level> where possible

Using the more descriptive logging styles gives a bit
more information about the device being operated on.

Makes the object trivially smaller too.

$ size drivers/net/wireless/libertas/built-in.o.*
187730 2973 38488 229191 37f47 drivers/net/wireless/libertas/built-in.o.new
188195 2973 38488 229656 38118 drivers/net/wireless/libertas/built-in.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0e4e06ae5e895864b4a4bca7eec2e3015fddca98 03-May-2011 Joe Perches <joe@perches.com> libertas: Convert lbs_pr_<level> to pr_<level>

Use the standard pr_<level> functions eases grep a bit.

Added a few missing terminating newlines to messages.
Coalesced long formats.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
25f8f54f6e178acfd503a95441b0ea05c525f751 04-May-2011 Joe Perches <joe@perches.com> pcmcia: Convert pcmcia_device_id declarations to const

Saves about 50KB of data.

Old/new size of all objects:
text data bss dec hex filename
563015 80096 130684 773795 bcea3 (TOTALS)
610916 32256 130632 773804 bceac (TOTALS)

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Kurt Van Dijck <kurt.van.dijck@eia.be> (for drivers/net/can/softing/softing_cs.c)
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
8973a6e770fc891f92daacbc1c92c7cd396fcf7e 27-Apr-2011 Randy Dunlap <randy.dunlap@oracle.com> libertas: use kernel-doc notation, fix comment style

Convert all libertas/ files to use kernel-doc notation instead
of whatever it was (doxygen?).

Add or fix function parameters in several places.

Use expected style for multi-line comments in lots of places.

Remove erroneous /** in multiple places.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
25985edcedea6396277003854657b5f3cb31a628 31-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi> Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2262054e74b4b26ed56a8535c1259f6c6c2862a4 15-Aug-2010 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: remove obsolete and wrong comments

What's worse than no comment? A wrong comment.

Several PCMCIA device drivers contained the same comments, which
were based on how the PCMCIA subsystem worked in the old days of 2.4.,
and which were originally part of a "dummy_cs" driver. These comments
no longer matched at all what is happening now, and therefore should
be removed.

Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2e9b981a7c63ee8278df6823f8389d69dad1a499 08-Aug-2010 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: move driver name to struct pcmcia_driver

Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
00990e7ce0b0e596fe41d9c64d6933ea70084003 30-Jul-2010 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: use autoconfiguration feature for ioports and iomem

When CONF_AUTO_SET_IO or CONF_AUTO_SET_IOMEM are set, the corresponding
fields in struct pcmcia_device *p_dev->resource[0,1,2] are set
accordinly. Drivers wishing to override certain settings may do so in
the callback function, but they no longer need to parse the CIS entries
stored in cistpl_cftable_entry_t themselves.

CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-ide@vger.kernel.org
CC: linux-usb@vger.kernel.org
CC: laforge@gnumonks.org
CC: linux-mtd@lists.infradead.org
CC: linux-bluetooth@vger.kernel.org
CC: alsa-devel@alsa-project.org
CC: linux-serial@vger.kernel.org
CC: Jiri Kosina <jkosina@suse.cz>
CC: linux-scsi@vger.kernel.org
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
440eed43e2a95bb842488755683716814da10f2b 30-Jul-2010 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: introduce autoconfiguration feature

Introduce an autoconfiguration feature to set certain values in
pcmcia_loop_config(), instead of copying the same code over and over
in each PCMCIA driver. At first, introduce the following options:

CONF_AUTO_CHECK_VCC check or matching Vcc entry
CONF_AUTO_SET_VPP set Vpp
CONF_AUTO_AUDIO enable the speaker line

CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-ide@vger.kernel.org
CC: linux-usb@vger.kernel.org
CC: laforge@gnumonks.org
CC: linux-mtd@lists.infradead.org
CC: alsa-devel@alsa-project.org
CC: linux-serial@vger.kernel.org
CC: Jiri Kosina <jkosina@suse.cz>
CC: linux-scsi@vger.kernel.org
Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> (for drivers/bluetooth)
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
1ac71e5a35eebee60cdcf15b3980bd94498f037b 29-Jul-2010 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: convert pcmcia_request_configuration to pcmcia_enable_device

pcmcia_enable_device() now replaces pcmcia_request_configuration().
Instead of config_req_t, all necessary flags are either passed as
a parameter to pcmcia_enable_device(), or (in rare circumstances)
set in struct pcmcia_device -> flags.

With the last remaining user of include/pcmcia/cs.h gone, remove
all references.

CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-ide@vger.kernel.org
CC: linux-usb@vger.kernel.org
CC: laforge@gnumonks.org
CC: linux-mtd@lists.infradead.org
CC: alsa-devel@alsa-project.org
CC: linux-serial@vger.kernel.org
CC: Jiri Kosina <jkosina@suse.cz>
CC: linux-scsi@vger.kernel.org
Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> (for drivers/bluetooth)
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
37979e1546a790c44adbc7f27a85569944480ebc 29-Jul-2010 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: simplify IntType

IntType was only set to INT_MEMORY (driver pcmciamtd) or INT_MEMORY_AND_IO
(all other drivers). As this flags seems to relate to ioport access, make
it conditional to the driver having requested IO port access. There are two
drivers which do not request IO ports, but did set INT_MEMORY_AND_IO:
ray_cs and b43. For those, we consistently only set INT_MEMORY in future.

CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-ide@vger.kernel.org
CC: linux-usb@vger.kernel.org
CC: laforge@gnumonks.org
CC: linux-mtd@lists.infradead.org
CC: alsa-devel@alsa-project.org
CC: linux-serial@vger.kernel.org
CC: Jiri Kosina <jkosina@suse.cz>
CC: linux-scsi@vger.kernel.org
Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> (for drivers/bluetooth)
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
82222e9ba75298e5bcd89803b6a11e2d7dfae70e 08-Aug-2010 Dan Williams <dcbw@redhat.com> libertas: [cs] use common firmware request helper and new firmware locations

linux-firmware puts libertas firmware in /libertas. Fix the driver to
look there first, but fall back to the old firmware names if the new
ones don't exist.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
90abdc3b973229bae98dd96649d9f7106cc177a4 24-Jul-2010 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: do not use io_req_t when calling pcmcia_request_io()

Instead of io_req_t, drivers are now requested to fill out
struct pcmcia_device *p_dev->resource[0,1] for up to two ioport
ranges. After a call to pcmcia_request_io(), the ports found there
are reserved, after calling pcmcia_request_configuration(), they may
be used.

CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-ide@vger.kernel.org
CC: linux-usb@vger.kernel.org
CC: laforge@gnumonks.org
CC: linux-mtd@lists.infradead.org
CC: alsa-devel@alsa-project.org
CC: linux-serial@vger.kernel.org
CC: Michael Buesch <mb@bu3sch.de>
Acked-by: Marcel Holtmann <marcel@holtmann.org> (for drivers/bluetooth/)
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
9a017a910346afd88ec2e065989903bf211a7d37 24-Jul-2010 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: do not use io_req_t after call to pcmcia_request_io()

After pcmcia_request_io(), do not make use of the values stored in
io_req_t, but instead use those found in struct pcmcia_device->resource[].

CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-ide@vger.kernel.org
CC: linux-usb@vger.kernel.org
CC: laforge@gnumonks.org
CC: linux-mtd@lists.infradead.org
CC: alsa-devel@alsa-project.org
CC: linux-serial@vger.kernel.org
Acked-by: Marcel Holtmann <marcel@holtmann.org> (for drivers/bluetooth/)
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
ac8b422838046ffc26be4874a3cbae0d313f4209 21-Jul-2010 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: remove cs_types.h

Remove cs_types.h which is no longer needed: Most definitions aren't
used at all, a few can be made away with, and two remaining definitions
(typedefs, unfortunatley) may be moved to more specific places.

CC: linux-ide@vger.kernel.org
CC: linux-usb@vger.kernel.org
CC: laforge@gnumonks.org
CC: linux-mtd@lists.infradead.org
CC: alsa-devel@alsa-project.org
CC: linux-serial@vger.kernel.org
Acked-by: Marcel Holtmann <marcel@holtmann.org> (for drivers/bluetooth/)
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
eb14120f743d29744d9475bffec56ff4ad43a749 07-Mar-2010 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: re-work pcmcia_request_irq()

Instead of the old pcmcia_request_irq() interface, drivers may now
choose between:

- calling request_irq/free_irq directly. Use the IRQ from *p_dev->irq.

- use pcmcia_request_irq(p_dev, handler_t); the PCMCIA core will
clean up automatically on calls to pcmcia_disable_device() or
device ejection.

- drivers still not capable of IRQF_SHARED (or not telling us so) may
use the deprecated pcmcia_request_exclusive_irq() for the time
being; they might receive a shared IRQ nonetheless.

CC: linux-bluetooth@vger.kernel.org
CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-serial@vger.kernel.org
CC: alsa-devel@alsa-project.org
CC: linux-usb@vger.kernel.org
CC: linux-ide@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
5fa9167a1bf5f5a4b7282f5e7ac56a4a5a1fa044 08-Nov-2009 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: rework the irq_req_t typedef

Most of the irq_req_t typedef'd struct can be re-worked quite
easily:

(1) IRQInfo2 was unused in any case, so drop it.

(2) IRQInfo1 was used write-only, so drop it.

(3) Instance (private data to be passed to the IRQ handler):
Most PCMCIA drivers using pcmcia_request_irq() to actually
register an IRQ handler set the "dev_id" to the same pointer
as the "priv" pointer in struct pcmcia_device. Modify the two
exceptions (ipwireless, ibmtr_cs) to also work this waym and
set the IRQ handler's "dev_id" to p_dev->priv unconditionally.

(4) Handler is to be of type irq_handler_t.

(5) Handler != NULL already tells whether an IRQ handler is present.
Therefore, we do not need the IRQ_HANDLER_PRESENT flag in
irq_req_t.Attributes.

CC: netdev@vger.kernel.org
CC: linux-bluetooth@vger.kernel.org
CC: linux-ide@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-scsi@vger.kernel.org
CC: alsa-devel@alsa-project.org
CC: Jaroslav Kysela <perex@perex.cz>
CC: Jiri Kosina <jkosina@suse.cz>
CC: Karsten Keil <isdn@linux-pingi.de>
for the Bluetooth parts: Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
dd2e5a156525f11754d9b1e0583f6bb49c253d62 03-Nov-2009 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: remove deprecated handle_to_dev() macro

Update remaining users and remove deprecated handle_to_dev() macro

CC: Harald Welte <laforge@gnumonks.org>
CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-serial@vger.kernel.org
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
a974a4bbcb1ceddc9c89defd7dab4da4b2b53d77 07-Nov-2009 Ben Hutchings <ben@decadent.org.uk> libertas: declare MODULE_FIRMWARE

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
aaa8cfdada648a6bae32f62df76cc60137a2b323 18-Oct-2009 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: use pcmcia_loop_config in misc pcmcia drivers

Use pcmcia_loop_config() in a few drivers missed during the first
round. On fmvj18x_cs.c it -- strangely -- only requries us to set
conf.ConfigIndex, which is done by the core, so include an empty
loop function which returns 0 unconditionally.

CC: David S. Miller <davem@davemloft.net>
CC: David Sterba <dsterba@suse.cz>
CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
For the ipwireless part: Acked-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
4912545472d71e3dd546b18b397aec4c89fd7403 01-Oct-2009 Amitkumar Karwar <akarwar@marvell.com> libertas: Add auto deep sleep support for SD8385/SD8686/SD8688

Add timer based auto deep sleep feature in libertas driver which can be
configured using iwconfig command. This is tested on SD8688, SD8686 cards
with firmware versions 10.38.1.p25, 9.70.4.p0 respectively on 32-bit and 64-bit
platforms. Tests have been done for USB/CS cards to make sure that the patch
won't break USB/CS code. We didn't test the if_spi driver.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9d45368a3825349d8ba686bc36df589d16577dd4 21-Aug-2009 Marek Vasut <marek.vasut@gmail.com> libertas: Add support for Marvell Libertas CF8305

The CF8305 is a very old silicon running firmware version 3.0 . This card also
needs some special treatment as it's so old it can't do unaligned register
access. But since that happens only at one place, there were no changes made to
the register access functions, but instead that particular place was fixed.
Also, this card uses only one-stage firmware which is loaded the same way as
helper firmware. The second-stage firmware isn't loaded on this card and doesn't
therefore have to be supplied.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e0d6133cba88759bc760b254c27975330fff6519 16-Jun-2009 Andrey Yurovsky <andrey@cozybit.com> libertas: remove ps_supported flag, use fwcapinfo

Power save support depends on the firmware capabilities rather than the
card's hardware interface. Use the FW_CAPINFO_PS bit in the firmware
capabilities mask throughout the driver in place of the redundant
ps_supported flag and don't make decisions about PS support in the
interface drivers (with the exception of a special case in the USB
driver).

V2: put the USB special case in the right place.

Signed-off-by: Andrey Yurovsky <andrey@cozybit.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
dc7d243d75b906cc964c12caa3b2eebe953a69be 24-Mar-2009 Marek Vasut <marek.vasut@gmail.com> Add support for CF8381 WiFi card.

A detection function was added for identifying CF8381.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
bbfc6b788f63f079fb8eeeb8d397bb1c0a8065a1 20-Mar-2009 Stephen Hemminger <shemminger@vyatta.com> libertas: convert to internal net_device_stats

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
1fac36ee7d5a0611e1216b02b485b154c8aa6dad 23-Jan-2009 Dan Williams <dcbw@redhat.com> libertas: fix CF firmware loading for some cards

if_cs_poll_while_fw_download() returned the number of iterations
remaining on success, which in turn got returned as the value from
if_cs_prog_real() and if_cs_prog_helper(). But since if_cs_probe()
interprets non-zero return values from firmware load functions as an
error, this sometimes caused spurious firmware load failures.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Tested-by: Ryan Mallon <ryan@bluewatersys.com>
Acked-by: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9a52028e534b0567913a4144060e774891c00a37 28-Aug-2008 Adrian Bunk <bunk@kernel.org> wireless/libertas/if_cs.c: fix memory leaks

The leak in if_cs_prog_helper() is obvious.

It looks a bit as if not freeing "fw" in if_cs_prog_real() was done
intentionally, but I'm not seeing why it shouldn't be freed.

Reported-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Acked-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2f3061eb1086f98990d6495b8c63a1b83f2f59aa 31-Aug-2008 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: remove unused argument to pcmcia_parse_tuple()

Since we're just parsing the tuple being passed to this function, we don't
need any device-specific information.

Also, remove the call to pcmcia_validate_cis() from pcmciamtd.c, since it
is already called by the PCMCIA core.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
c94c93da90a9e46a73a5733ff8454fb4b14733fb 29-Jul-2008 Harvey Harrison <harvey.harrison@gmail.com> wireless: replace __FUNCTION__ with __func__

__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6dfff895fa33b8576f82a38cee8abe5f73561e24 23-May-2008 David Woodhouse <dwmw2@infradead.org> libertas: treat firmware data as const

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
a78a83255651acff8234975b5c7b6cd19d717f3f 05-Jun-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: rename some registers to clarify their meaning

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4c55523e600ee762c2b00b1ade4c5a82b57d07aa 05-Jun-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: check for old, unsupported hardware

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5314325692239a977a58fc796b4f4fb783643012 05-Jun-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: document register meanings

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3073556171f1cf2044ff38c1fc3b9f6c805f0873 05-Jun-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: fix interrupt issue

This helps against lost interrupts and aids in debugging this.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
78cf07472f0ede8394bacc4bc02354505080cfe1 02-Jun-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: unify various CF-related defines

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
43d01c563d271260c1e4fe0a9383c47fae96887f 26-May-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: fix compact flash interrupt handling

The old code misbehaved because it polled card status and always called the
"tx over" code-path.

This also fixes a hard lockup by not allowing and card interrupts while
transferring a TX frame or a command into the card.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
93416c871f8588446e80780f7d62fabc131c276b 23-May-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: speeds up downloading of CF firmware

Keep the timeout the same (1000*500 == 100000 * 5), but take shorter
naps. Makes downloading the firmware slightly faster.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7919b89c8276d657976d4d4d6b7cb58ea1aa08c3 01-Apr-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: convert libertas driver to use an event/cmdresp queue

This patch (co-developed by Dan Williams and Holger Schurig) uses a kfifo
object for events and a swapping buffer scheme for the command response to
preserve the zero-copy semantics of the CF driver and keep memory usage low.
The main thread should only ever touch the buffer indexed by priv->resp_idx,
while the interface code is free to write to the second buffer, then swap
priv->resp_idx under the driver spinlock. The firmware specs only permit
one in-flight command, so there will only ever be one command response to
process at a time.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
dd1f635fe0f14d8c03181f9f1f743b127694fc14 19-Mar-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: fix spinlock recursion bug

This fixes a bug detected by CONFIG_DEBUG_SPINLOCK:

if_cs_get_int_status() is only called from lbs_thread(), via
priv->hw_get_int_status. However, lbs_thread() has already taken the
priv->driver_lock. So it's a fault to take the same lock again here.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d4ff0ef635b222d5f66dad65e9364d702e5f94e0 19-Mar-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: misc power saving adjusts

* firmware for the CF card supports power saving
* the driver currenly only accept "iwconfig ethX power on|off", so
I fixed what the range wext ioctl reports.
* initialize value/flags in lbs_get_power()
* get rid of unused parameter psmode in lbs_ps_confirm_sleep()
* some minor debug output tweaks

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fdfb92eab5a60f3060d4513182212d5ca9913cd1 25-Jan-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: fix interrupt while removing driver

Previously I've got an interrupt while removing the driver.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7003b078c82d141216deecef4de154711a107aab 17-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: use priv->upld_buf for command responses

If we don't scribble over the command we sent, then we can retry it when
the firmware responds with 0x0004 (which means -EAGAIN).

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ddac452680a5164bb47d61ea54f596ddaf3aea7d 11-Dec-2007 Dan Williams <dcbw@redhat.com> libertas: rename and re-type bufvirtualaddr to cmdbuf

Make it a struct cmd_header, since that's what it is, and clean up
the places that it's used.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4f679496567809ce1e95730c25274e1832537f4b 10-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: clean up lbs_interrupt()

Make it take struct lbs_private as argument; that's all it wants anyway,
and all callers were starting off from that. Don't wake the netif
queues, because those should be handled elsewhere. And sort out the
locking, with a big nasty warning for those who don't have the
driver_lock locked when they call it.

Oh, and fix if_cs.c to lock the driver_lock before calling it.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
aa21c004f80bdf943736c62dccf0c0398d7824f3 08-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: kill struct lbs_adapter

There seems to be no reason for a separate structure; move it all
into struct lbs_private.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
09d4fad6e8972061fbb0e2e5ae9e686d84f57af6 06-Dec-2007 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: fix data packet size errors

I wondered about junk bytes at the end when using "lbsdebug +hex +host"
until I noticed that firmware for the CF card sends my extranous bytes.
It says "I have 20 bytes", I take 20 bytes, but the last 8 bytes of this
are just data junk.

Also, in the new lbs_cmd() where was a size miscalulation
that made itself clear after fixing this bug.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e775ed7c677b163c80643036c32e23d3e59b9429 06-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: Consolidate lbs_host_to_card_done() function.

As we move towards having this done by a state machine, start by having
a single 'stuff sent' function, which is called by if_usb/if_sdio/if_cs
after sending both data and commands.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
69f9032d9dfeb763b467fdbe8cf5938f5457083a 23-Nov-2007 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: remove arbitrary typedefs

New typedefs are usually frowned upon. This patch changes
libertas_adapter -> struct libertas_adapter
libertas_priv -> struct libertas_priv

While passing, make everything checkpatch.pl-clean that gets touches.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1007832103d016d1563fab71d4cf2b057a0bcceb 16-Nov-2007 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: move to uniform lbs_/LBS_ namespace

This patch unifies the namespace of variables, functions defines
and structures. It does:

- rename libertas_XXX to lbs_XXX
- rename LIBERTAS_XXX to lbs_XXX
- rename wlan_XXX to lbs_XXX
- rename WLAN_XXX to LBS_XXX (but only those that were
defined in libertas-local *.h files, e.g. not defines
from net/ieee80211.h)

While passing, I fixed some checkpatch.pl errors too.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
28fc1f5a0c375cb6375fa48e9a8b393f2a189be6 29-Oct-2007 Jeff Garzik <jeff@garzik.org> [netdrvr] irq handler minor cleanups in several drivers

* use irq_handler_t where appropriate

* no need to use 'irq' function arg, its already stored in a data struct

* rename irq handler 'irq' argument to 'dummy', where the function
has been analyzed and proven not to use its first argument.

* remove always-false "dev_id == NULL" test from irq handlers

* remove pointless casts from void*

* declance: irq argument is not const

* add KERN_xxx printk prefix

* fix minor whitespace weirdness

Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
6591e36a1c52445f95f26738394909ee9bf94390 26-Nov-2007 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: let more than one MAC event through

lbs_mac_event_disconnected() was called once and then never again
upon a hardware MAC event.

The reason was that the driver didn't clean the correct bit in the interrupt
cause register of the chip.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4ef31702c1a83a380d5e144f5af55e21f59c9bb6 09-Oct-2007 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: fixes for slow hardware

Fixes for slow hardware.

Signed-off-by: Vitaly V. Bursov <vitalyvb@ukr.net>
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f31ce76b781d15ab6b529663b95223f58171ec80 07-Sep-2007 Vladimir Davydov <vladimir.davydov@promwad.com> [LIBERTAS]: fix oops on the blackfin architecture

Reserve two bytes to align pointer to the IP header.

Signed-off-by: Vladimir Davydov <vladimir.davydov@promwad.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
28de0b36be2a4e7fb0ba7c9a77d61aeb229b27c0 07-Sep-2007 Ryan Mallon <ryan@bluewatersys.com> [LIBERTAS]: fix interrupts in CF driver

The following patch fixes the tx transmit timeout problem, which is
caused by the interrupts being incorrectly check and masked. The patch
moves the interrupt masking code so that interrupts are enabled only
when the driver is registered and only disabled when the driver is
unregistered.

Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
6f05cbe5882e8b0fc5a984313cbb14ce7741411b 07-Sep-2007 Ryan Mallon <ryan@bluewatersys.com> [LIBERTAS]: set dnld_sent correctly for CF parts

Corrects a minor bug with priv->dnld_sent being set incorrectly in
if_cs_host_to_card.

Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4ecd41bd0ff5dfcb4f2c59d980f9196c160882be 21-Aug-2007 Andrew Morton <akpm@linux-foundation.org> [PATCH] libertas: printk warning fixes

drivers/net/wireless/libertas/if_cs.c: In function 'if_cs_prog_helper':
drivers/net/wireless/libertas/if_cs.c:462: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'
drivers/net/wireless/libertas/if_cs.c: In function 'if_cs_prog_real':
drivers/net/wireless/libertas/if_cs.c:538: warning: format '%d' expects type 'int', but argument 3 has type 'size_t'

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
954ee164f4f4598afc172c0ec3865d0352e55a0b 20-Aug-2007 Dan Williams <dcbw@redhat.com> [PATCH] libertas: reorganize and simplify init sequence

This patch moves all firmware load responsibility into the interface-specific
code and gets rid of the firmware pointer in the generic card structure. It
also removes 3 fairly unecessary callbacks: hw_register_dev, hw_unregister_dev,
and hw_prog_firmware. It also makes the init sequence from interface
probe functions more logical, as there are paired add/remove and start/stop
calls into generic libertas code.

Because the USB driver code uses the same TX URB callback for both firmware
upload (where the generic libertas structure isn't initialized yet) and for
normal operation (where it is), some bits of USB code have to deal with
'priv' being NULL. All USB firmware upload bits have been changed to not
require 'priv' at all, but simply the USB card structure.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
27590d06e136167101c8c6347e7c2885c7f014b9 04-Oct-2007 Holger Schurig <hs4233@mail.mn-solutions.de> [PATCH] add support for Marvell 8385 CF cards

This patch adds support for Marvell based 8385 compact flash cards.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>