History log of /drivers/net/wireless/libertas/cmdresp.c
Revision Date Author Comments
77d84ff87e9d38072abcca665ca22cb1da41cb86 08-Dec-2013 Masanari Iida <standby24x7@gmail.com> treewide: Fix typos in printk

Correct spelling typo in various part of kernel

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
df90d84382b03faf81637db31b6be14f477482c7 09-Jul-2011 Daniel Drake <dsd@laptop.org> libertas: fix handling of command timeout, completion and interruption

When commands time out, corruption ensues. As lbs_complete_command()
is called without locking, the command node is mistakenly freed twice.
Also fixed up locking here in a few other places.

The nature of command timeout may be that the card didn't even
acknowledge receipt of the request. Detect this case and reset dnld_sent
so that other commands don't hang forever.

When cmdnodes are moved between the free list and the pending list,
their list heads should be reinitialized. Fixed this.

Sometimes commands are completed without actually submitting them or
removing them from cmdpendingq. We must remember to remove them from
cmdpendingq in these cases, so handle this in lbs_complete_command().

Harmless signals generated during suspend/resume were interrupting
lbs_cmd. Convert to an uninterruptible sleep to avoid this.

lbs_thread must be woken up every time there is some new work to do.
I found that when 2 commands are queued, ther completion of the first
command would not wake up lbs_thread to submit the second. Poke lbs_thread
at the end of lbs_complete_command() to fix this.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a6b7a407865aab9f849dd99a71072b7cd1175116 06-Jun-2011 Alexey Dobriyan <adobriyan@gmail.com> net: remove interrupt.h inclusion from netdevice.h

* remove interrupt.g inclusion from netdevice.h -- not needed
* fixup fallout, add interrupt.h and hardirq.h back where needed.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
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>
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>
77ccdcf2e933d61176f67c4976f7ad4cbb9cb82a 27-Jul-2010 Dan Williams <dcbw@redhat.com> libertas: kill unused lbs_prepare_and_send_command()

Remove last bits of indirect command code.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0bb6408777227fcf5136e28aec29438606d5ac82 27-Jul-2010 Dan Williams <dcbw@redhat.com> libertas: convert PS_MODE to a direct command

Powersave looks like it got broken at some point but we'll fix that up
when the command submission stuff is more understandable, which this
series helps to do. That said, this patch should not further break
powersave.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8196112859a6742b9e25ca5fde972a7f41f06cc3 27-Jul-2010 Dan Williams <dcbw@redhat.com> libertas: remove unused indirect command response handler

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a6bb1bcebced1eeed6a96f37cda7cbb7cbd6dae6 27-Jul-2010 Dan Williams <dcbw@redhat.com> libertas: convert CMD_FWT_ACCESS to a direct command

Slightly different approach here since there are so many arguments to
the firmware command. Just let the caller fill them in before pushing
the command to the firmware.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
52148655608b31b7e18325ae7711de3a86466136 27-Jul-2010 Dan Williams <dcbw@redhat.com> libertas: convert Mesh Blinding Table access to a direct command

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4c7c6e00f17365633638848197c44552dd353d49 27-Jul-2010 Dan Williams <dcbw@redhat.com> libertas: convert register access to direct commands

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d6541c74484a5679a79a1f1df9884fc4da8d8cf6 27-Jul-2010 Dan Williams <dcbw@redhat.com> libertas: remove Beacon Control

For now; it's a pretty easy command to hook up and whenever OLPC
figures out how they want the userspace interface to look (ie,
not iwpriv commands) we can easily add it back in. Since the
cfg80211 conversion it wasn't working anyway.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
db08006fc4e825e632083f2a2de827ca2121c28d 27-Jul-2010 Dan Williams <dcbw@redhat.com> libertas: remove unused Automatic Frequency Control command

It hasn't been hooked up to anything in a long time and it's not
even listed in any of the firmware documentation I have (and I
have v5.1, v8, v9, and v10).

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
49a08af5b9aa91207e3654ca3c88ca4d2596601c 27-Jul-2010 Dan Williams <dcbw@redhat.com> libertas: remove unused indirect TPC_CFG command leftovers

These were no longer used but were left around; Transmit Power
Control is done through the lbs_set_tpc_cfg() function.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
cc4b9d3928d682c4a15690c2bd9ed11c2eac5921 27-Jul-2010 Dan Williams <dcbw@redhat.com> libertas: convert 11D_DOMAIN_INFO to a direct command

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9fb7663d2b832183ec7558a19426666819636a64 27-Jul-2010 Dan Williams <dcbw@redhat.com> libertas: clean up RSSI command

Convert to a full direct command; previous code rolled a direct
command by hand but left the original indirect command code intact
but disabled.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
25ac8b0d06c4b3e26c7c4c18dc5c3fcc40be58a2 23-Jun-2010 John W. Linville <linville@tuxdriver.com> libertas: mark lbs_ret_802_11d_domain_info static

Probably little risk of namespace polution, but good practice... :-)

Signed-off-by: John W. Linville <linville@tuxdriver.com>
1047d5edd4838f27dc86f24676178f2249c446ea 05-Jun-2010 Kiran Divekar <dkiran@marvell.com> Libertas: Added 11d support using cfg80211

Added 11d support for libertas driver using cfg80211. This is based on Holger
Shurig's initial work to add cfg80211 support libertas.
(https://patchwork.kernel.org/patch/64286/)

Please let us know, if there are any improvements comments.

Code is added to send 11d enable command to firmware while
initialisation and pass 11d specific information to firmware
when notifier handler is called by cfg80211.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e4fe4eafa41cf951fb8fe2b9725ae84c599668d8 05-Jun-2010 Kiran Divekar <dkiran@marvell.com> Libertas: fix WARN_ON issues in cfg80211 support

In following scenarios WARN_ON() in cfg80211 code was triggered.
a) Driver unload or card removal.
b) Disconnect from infra network
c) Adhoc start/join
d) Adhoc stop
Added following fixes to avoid WARN_ON() in cfg80211 code.
a) Ensured that cfg80211_disconnected() function defined in cfg80211
code will be called only in infra mode.
b) Solved timing issue by moving cfg80211_disconnected() call inside
lbs_cfg_disconnect().
c) Updated "wdev->ssid" in driver code after Adhoc join/start
d) Removed unnecessory cfg80211_disconnected() call in lbs_remove_card.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e86dc1ca4676445d9f0dfe35104efe0eb8a2f566 14-Jun-2010 Kiran Divekar <dkiran@marvell.com> Libertas: cfg80211 support

Holger Schurig's patch (https://patchwork.kernel.org/patch/64286/)
is rebased to latest wireless-testing tree.

(Includes patches from me originally posted as "libertas: fix build
error due to undefined symbol" and "libertas: unmangle capability
value". -- JWL)

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kiran Divekar <dkiran@marvell.com>
Tested-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
66fceb69b72ff7e9cd8da2ca70033982d5376e0e 19-May-2010 Amitkumar Karwar <akarwar@marvell.com> libertas: Added callback functions to support SDIO suspend/resume.

In suspend() host sleep is activated using already configured
host sleep parameters through wol command, and in resume() host
sleep is cancelled. Earlier priv->fw_ready flag used to reset and
set in suspend and resume handler respectively. Since after suspend
only host goes into sleep state and firmware is always ready, those
changes in flag state are removed.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
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>
40e6fa829a2544c9f8fd5a94844fe502334d6afc 04-Feb-2010 Holger Schurig <holgerschurig@gmail.com> libertas: don't retry commands

Retrying commands seldomly works, most often the firmware is in a
weird state anyway and needs the device to reset. So it's better
to report the broken state back to user-space.

Also rename command_timer_fn() into lbs_cmd_timeout_handler(),
which better reflect it's usage.

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d6ede678c138061f5202b519f8f8d6372e2cb5bb 02-Dec-2009 Holger Schurig <holgerschurig@googlemail.com> libertas: remove mesh_autostart_enabled and sync_channel

mesh_autostart_enabled was nowhere set. Rumor is that this is used in the
OLPC tree, but they never did submit their code upstream.

After removing this code, it turned out that the sync_channel stuff is now
also unused, so get rid of that as well.

Signed-off-by: Holger Schurig <holgerschurig@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
560c63383f060b5ea68834e4720ab7bfb4303ff7 22-Oct-2009 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: move mic failure event to wext.c

... because for cfg80211 we'll need a completely different
implementation.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fea2b8ec8192c62dbf5347c873cb1c8a87717a6a 22-Oct-2009 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: move SIOCGIWAP calls to wext.c

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b856f73b39ca6b619e6e8d088141aec3ff62852c 22-Oct-2009 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: remove handling for CMD_GET_TSF

... which just resided as an old-style command in cmd/cmdresp, but
was nowhere useed. If we ever need it, we can re-add it as a newstyle
command.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f57bd284e435d1ddf69b4266f63d856865152271 22-Oct-2009 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: remove handling for CMD_802_11_LED_GPIO_CTRL

... which just resided as an old-style command in cmd/cmdresp, but
was nowhere useed. If we ever need it, we can re-add it as a newstyle
command.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d0de37417e51219d7d56a452d18fa7b829342fcc 22-Oct-2009 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: move association related commands into assoc.c

That's because the new cfg80211 implementation will provide cleaner
implementations.

No functional changes.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
243e84e91ed810f7dca5ba1c2d1a611811948566 22-Oct-2009 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: change IW_ESSID_MAX_SIZE -> IEEE80211_MAX_SSID_LEN

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>
d37b4fdd43f7e5686c40181f33a50a7ee03ddbd8 22-Oct-2009 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: remove unused 11d code

Most of the 11d code was protected with an "if (priv->enable11d)" clause.
But there was no code that anywhere that was able to set this
variable to true. So all 11d code was dead for almost a year and no one
complained. That's enought incentive to remove this code.

Besides removing old cruft, we gain back the 11d capability in a common way
when we merge the cfg80211 functionality.

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>
bca61f8a4df69949cc7426b39daa867f5274a9b8 16-Oct-2009 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: harmonize cmd.h

* move declarations for functions of cmd.c/cmdresp.c into cmd.h
* move declarations from cmd.h that are in main.c to decl.h
* group command functions

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>
767e366fc9e667c1ef71af588d33b7ec27c5ed1d 12-Oct-2009 Alan Cox <alan@linux.intel.com> libertas: fix build

drivers/net/wireless/libertas/cmdresp.c: In function ‘lbs_process_event’:
drivers/net/wireless/libertas/cmdresp.c:519: error: ‘TASK_INTERRUPTIBLE’
undeclared (first use in this function)
drivers/net/wireless/libertas/cmdresp.c:519: error: (Each undeclared
identifier is reported only once
drivers/net/wireless/libertas/cmdresp.c:519: error: for each function it
appears in.)

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
c49de94a56f02768fa881cd7cbf58907910ceb8e 12-Oct-2009 Alan Cox <alan@linux.intel.com> libertas: fix build

drivers/net/wireless/libertas/cmdresp.c: In function ‘lbs_process_event’:
drivers/net/wireless/libertas/cmdresp.c:519: error: ‘TASK_INTERRUPTIBLE’
undeclared (first use in this function)
drivers/net/wireless/libertas/cmdresp.c:519: error: (Each undeclared
identifier is reported only once
drivers/net/wireless/libertas/cmdresp.c:519: error: for each function it
appears in.)

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
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>
2c5b9e511fee1a856ffe6332e15c72a20d2c72f6 27-May-2009 Cliff Cai <cliff.cai@analog.com> wireless: libertas: fix unaligned accesses

Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
822ac03a07cc9e714727a6d49ea050b92483f82a 23-May-2009 Dan Williams <dcbw@redhat.com> libertas: convert CMD_802_11_ASSOCIATE to a direct command

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
be0d76e48f6cc1f8b01eeb5efbeea41f2efdab49 23-May-2009 Dan Williams <dcbw@redhat.com> libertas: convert CMD_802_11_AUTHENTICATE to a direct command

And fix up setting authentication suite for v9+ firmware too.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
39fcf7a315e098430e878a5c0c4d39561c93ebf6 10-Sep-2008 Dan Williams <dcbw@redhat.com> libertas: convert SNMP_MIB to a direct command

And support setting both long and short retries independently.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f8e77caefea8940ee1fb09c9ebb0107ca2eadb72 10-Sep-2008 Dan Williams <dcbw@redhat.com> libertas: remove unused generic RESET command

The generic reset command is unused. Each interface type needs to
handle the reset command differently since after reset, the firmware is
dead and interface-specific mechanisms must be used to reinitialize the
card.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f5fe1fdaae86a74d6977fafd8fdd8697e398dafd 22-Aug-2008 Dan Williams <dcbw@redhat.com> libertas: convert adhoc operations to direct commands

with fixes for v9 and later firmware too.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
191bb40e725304c5fcfabd92c57eef58799f0e25 21-Aug-2008 Dan Williams <dcbw@redhat.com> libertas: convert CMD_802_11_DEAUTHENTICATE to a direct command

and remove DISASSOCIATE because it's not in any of the specs and has
never been used.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
87c8c72d532f96257162f978d5945dcf7f0df19e 19-Aug-2008 Dan Williams <dcbw@redhat.com> libertas: convert CMD_802_11_RF_TX_POWER to a direct command

And while we're at it, grab min/max TX power from the firmware and use
that to validate incoming TX power requests from WEXT.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
85319f933a703a92652a8f23339f1ec1694cd594 24-May-2008 Javier Cardona <javier@cozybit.com> libertas: rate adaptation configuration via iwconfig.

Implemented rate adaptation support via 'iwconfig rate' API. It is now
possible to specify a bit-rate value and append 'auto'. That will configure
rate adaptation to use all bit-rates equal or lower than than selected value.

Made lbs_cmd_802_11_rate_adapt_rateset a direct command.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
75bf45a7b4ab81cfa5c5eab68b57bbfee8b8ede2 20-May-2008 David Woodhouse <dwmw2@infradead.org> libertas: fix multicast filtering on eth and msh interfaces

We weren't properly handling multicast on the mesh interface. Fix that,
which involves setting up the hardware to use the union of dev->mc_list
for both eth%d and msh%d devices.

This means we can't do it directly from ->set_multicast_list() because
we'd need to lock the other device to read its list, and we can't do
that because it might deadlock. So punt the actual work to keventd.

Also, invoke the same when taking an interface down; for some reason the
core calls ->set_multicast_list while IFF_UP is still set in dev->flags
when we're taking it down, so its addresses don't get removed then.

We also convert MAC_MULTICAST_ADR to a direct command while we're at it,
removing one more entry from the big switch statement in the deprecated
lbs_prepare_and_send_command() function.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e37fc6e11c79899451e394319cff18cc53d6448d 20-May-2008 David Woodhouse <dwmw2@infradead.org> libertas: Increase priority of 'unknown command' warnings

Using the deprecated lbs_prepare_and_send_command() function for a
command which it doesn't understand is an error; complain loudly about
it even when we're not debugging.

The mesh stats bug, where we converted MESH_ACCESS to a direct command
but accidentally missed one user which was still trying to do it through
lbs_prepare_and_send_command(), would have been caught a lot quicker if
we'd done this sooner. Such bugs aren't entirely unlikely in future too,
as we convert more code to stop using this function.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
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>
697900ac14528e985b66f471ecb81082fc00baa9 02-Apr-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: move association code from join.c into scan.c

Besides code moving, I did the following changes:

* made some functions static
* removed some unneeded #include's
* made patch checkpatch.pl clean

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>
f539f2efe9fdf9e7db2022a757190858576d34fd 26-Mar-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: convert sleep/wake config direct commands

Confirm sleep event: they come very regularly, eventually several times per
second. Therefore we want to send the config command as fast as possible.
The old code pre-set the command in priv->lbs_ps_confirm_sleep. However, the
byte sequence to be sent to the hardware is the same for all interfaces. So
this patch make this an extern structure, initialized at module load time.

Config wake event: normal conversion to a direct command. However, I don't know
how to trigger a "HOST AWAKE" event from the firmware, so this part is
untested.

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>
7460f5a69055357bf97f1890db547aba0c4bf2fa 26-Mar-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: convert CMD_802_11_EEPROM_ACCESS to a direct command

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>
2af9f039a17c0acd9e5b21d10058688687bad86d 26-Mar-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: convert CMD_802_11_MAC_ADDRESS to a direct command

* directly call lbs_cmd_with_response()
* only overwrite priv->current_addr once the firmware call succeeded

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>
e5225b397308f9eea86327293b73dc88068e0179 26-Mar-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: reduce debug output

This patch tries to make dmesg logs between different runs easier
to compare by

* removing the jiffies (use CONFIG_PRINTK_TIME if you need
timing)
* remove the line numbers, they change with each applied patch

It also changes the deprecated __FUNCTION__ to __func__ to make
checkpatch.pl happy.

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>
62436138c83f221943c1f5d9cff41305d3d26ac4 26-Mar-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: remove CMD_802_11_PWR_CFG

This has nowhere been used. Note: in the firmware manual this was
documented as CMD_802_11_PA_CFG. If we ever need it, we can/should
re-implement it as a direct command.

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>
e98a88dd33b7188ce84533e128101dd9630ae592 19-Mar-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: remove lots of unused stuff

This removes many unused function parameters as well as some not-implemented
functions, e.g. CMD_802_11_GET_STATS. The silly lbs_set_cmd_ctrl_node()
function is now also gone.

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>
c49c3b77c8c611f562ca4e201d88d3e69465f928 17-Mar-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: convert GET_LOG to a direct command

Now uses __lbs_cmd() to get the "log" (it's actually more a snapshot of
various counters, not a sequential log). Besides the "mechanical" convertion
the patch add the following logical changes:

* Removes the priv->logmsg variable, it was only used in one place anyway,
also don't blindly get the counters when associating. Getting the
counters then the user asks via WEXT for them is good enought.
* don't set wstats.discard.fragment with log.rxfrag, because the latter is
a counter for successfully received packets, not for fragmented packets.

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>
835d3ac5e8cbe1fec2c02c7fc662586b30b1f5a8 12-Mar-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: convert CMD_MAC_CONTROL to a direct command

convert CMD_MAC_CONTROL to a direct command

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>
5f0547c2813d4677908fa6de02f9911d25996515 06-Mar-2008 Sebastian Siewior <bigeasy@tglx.de> libertas: fix the 'compare command with itself' properly

|libertas: Invalid CMD_RESP 8012 to command 50!

The special case got mixed up in 8a96df80b3.

Signed-off-by: Sebastian Siewior <bigeasy@linutronix.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fa62f99cf80af9c65bfc0f731d780e03e3ce6ede 03-Mar-2008 David Woodhouse <dwmw2@infradead.org> libertas: convert 802_11_SCAN to a direct command

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9e1228d00a8e959dd3f4d0bd7949fda1ce11b314 03-Mar-2008 David Woodhouse <dwmw2@infradead.org> libertas: convert KEY_MATERIAL to a direct command

The struct enc_key probably wants to die too, but that can come later.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8a96df80b3ddb2410045a26ea19eeccb5f2d2d11 04-Mar-2008 Sebastian Siewior <bigeasy@tglx.de> libertas: compare the current command with response

instead of with itself.

Signed-off-by: Sebastian Siewior <bigeasy@linutronix.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6305f498604df6c66bdb4cc533ce6332fa5ab61f 03-Mar-2008 David Woodhouse <dwmw2@infradead.org> libertas: fix sanity check on sequence number in command response

Slightly more useful if we compare it against the sequence number of the
command we have outstanding, rather than comparing the reply with itself.

Doh. Pointed out by Sebastian Siewior

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
52507c20870dbd58921b42b801f0a92fc057221b 28-Jan-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: make association debug output nicer

This also fixes a bug where should_deauth_infrastructure() always
returned 0.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1afc09ab7c62d0e59596ce76e8e256b0cf695654 29-Jan-2008 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: trim overly long debug statement

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5844d12ea30bacae9224db6561a16e86ad31c6e5 18-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: convert SUBSCRIBE_EVENT to a direct command

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4f59abf190b15350167bec5382dda205030ac9d0 18-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: convert ENABLE_RSN to a direct command

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f70dd4515a8ad9c9d59ebb8c1d1fa2c610fb4020 18-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: convert SET_WEP to a direct command

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3fbe104cecdb8c812976fdb0cc41be65491b85ee 18-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: convert SLEEP_PARAMS to a direct command

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6e5cc4fb35c45a8f8478d25c4e89e8d9c543056e 18-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: convert INACTIVITY_TIMEOUT to a direct command

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a7c458906542aacdda7289bb21f527a2dc4097ca 18-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: convert RADIO_CONTROL to a direct command

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8538823f7c692c98e8b7e19cb580faa56e25e89f 17-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: discard DEFER responses to commands; let the timeout trigger

When the firmware returns 0x0004, it wants us to try again later. We can
achieve that simply by throwing out the response and letting the command
timeout code kick in.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
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>
ac4cced6e850496b66c0825b7f74d51ef02c6371 17-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: reduce explicit references to priv->cur_cmd->cmdbuf

We have a local variable 'resp' which we use for this. So use it,
instead of typing the whole thing.

In preparation for actually using priv->upld_buf for the responses
instead...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b47ef2438dea2ddad4561152aa8007a2d95e8157 17-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: handle HOST_AWAKE event by sending WAKEUP_CONFIRM command

lbs_send_confirmwake() is a bit ugly but matches the way we confirm
sleep. We'll deal with that whole thing later.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
38bfab1a01c66cb1a5001dc702b0856b2f942fd5 17-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: fix buffer handling of PS_MODE commands and responses

Commit 5b8845345e7385d2eb37fac22ba9ab6905988be5 (or, in case the git
workflow is broken and patches get recommitted, the commit entitled
'libertas: rename and re-type bufvirtualaddr to cmdbuf' by dcbw),
introduced a number of bugs where we once had a pointer to a command
_payload_, but now we use the pointer to the command header instead.

The fix isn't wonderfully pretty for now, but it'll get better when we
finish converting all commands so the structures include the header.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2a345099a4fbe551a1982630b3d89c85fa5a341d 16-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: handle command timeout in main thread instead of directly in timer

And handle the case where it times out more than once, too, instead of
locking up for ever.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
75567670c66329a111c2b4f12d6c1fc02b3b14d2 15-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: kill pdata_buf member of struct cmd_ctrl_node

We can use the callback_arg for it; that's the way we're heading anyway...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
183aeac1c49869ba9a14c7ead86ce268da397a0e 15-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: introduce and use lbs_complete_command() for command completion

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a27b9f96f21a2f15c423cca745f65de3db61e364 12-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: slight cleanup of netif queue stop/wake

In particular, we shouldn't be waking the queues in lbs_host_to_card_done()
any more.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e1258177e437cb8b892622f2b7beedd4701540ac 12-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: be more careful about command responses matching cur_cmd

Especially in the light of OLPC trac #5461, in which the firmware starts
sending us seemingly random command responses which bear little relation
to the command we sent it.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2dd4b26264d48f10e802cc9f2d75542be5a3c7fa 11-Dec-2007 Dan Williams <dcbw@redhat.com> libertas: convert RF_CHANNEL to a direct command

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>
8e3c91bb70372da692a5fefae9f698c94bb1e641 11-Dec-2007 Dan Williams <dcbw@redhat.com> libertas: convert DATA_RATE to a direct command

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>
301eacbf30e33f461701df91cb250d3fc24c5fe5 11-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: convert CMD_MESH_ACCESS to a direct command

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>
6e66f03ff78b23d845920739373b1561c546b13f 11-Dec-2007 Dan Williams <dcbw@redhat.com> libertas: convert GET_HW_SPEC to a direct command

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>
7ad994dec7d36c319cb35cbf3a920d3bda96e6b0 11-Dec-2007 Dan Williams <dcbw@redhat.com> libertas: clean up direct command handling

Move direct command handling through __lbs_cmd() over to using the
header as the first member of the command structure, and only define
the __lbs_cmd() callback in one place rather than 3. Convert boot2
version command to new usage.

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>
1309b55b4de18bbfe19c73225a5481d6cdc8a463 10-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: add opaque extra argument to cmd callback function

This will be useful for letting callbacks do stuff like copying the
response into a buffer provided by the caller of lbs_cmd()

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>
ac47246e246c183ed68b3fdb307a83d00313a325 08-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: kill adapter->nr_cmd_pending

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c2df2efe96742b78454acdffe6d278ae334fc838 07-Dec-2007 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: endianness fixes

Recently I found that that sparse by default doesn't endianness
checks. So I changed my compilation habit to be

make modules C=1 SUBDIRS=drivers/net/wireless/libertas
CHECKFLAGS="-D__CHECK_ENDIAN__"

so that I get the little-endian checks from sparse as well. That
showed up a good bunch of problems.

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>
1723047d6742cc172d5c0f1a5245deaee67ff331 07-Dec-2007 David Woodhouse <dwmw2@infradead.org> libertas: Switch to using a callback function pointer for commands

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>
675787e29fd97d08bf7e6253c89ab6de23bf7089 05-Dec-2007 Holger Schurig <h.schurig@mn-solutions.de> libertas: handy function to call firmware commands

Using an arbitrary firmware command was actually very painful. One
had to change big switch() statements in cmd.c, cmdresp.c, add
structs to the big union in "struct cmd_ds_command" and add the
define for the CMD_802_11_xxx to the proper place.

With this function, this is now much easier. For now, it implements
a blocking (a.k.a. CMD_OPTION_WAITFORRSP) way where one deals directly
with command requests and response buffers. You can do everything in
one place:

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>
891f32a1c4fe5c57f15873fa1d9fff425b30ab4d 05-Dec-2007 Holger Schurig <h.schurig@mn-solutions.de> libertas: remove cmd_ctrl_node->cmdflags

There was no code that ever did set this flag.

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>
0b3c07ff6467e6055ca3dd2239494ada96303274 28-Nov-2007 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: less eventcause shifts

* only shift eventcause once

* convert mac events to decimal, as this is what the firmware
manual uses in section 6.1, 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>
91843463bc4ca5eb2be4b8b5c5efd474e0c56283 28-Nov-2007 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: tweak association debug output

Change debug output codes from LBS_DEB_JOIN to LBS_DEB_ASSOC

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>
3a1886491710c196656a005fcc693172f5bb4c8a 26-Nov-2007 Holger Schurig <hs4233@mail.mn-solutions.de> libertas: rework event subscription

This patch moves re-works the implementation of event subscription
via debugfs. For this:

* it tells cmd.c and cmdresp.c about CMD_802_11_SUBSCRIBE_EVENT
* removes lots of low-level cmd stuff from debugfs.c
* create unified functions to read/write snr, rssi, bcnmiss and
failcount
* introduces #define's for subscription event bitmask values
* add a function to search for a specific element in an IE
(a.k.a. TLV)
* add a function to find out the size of the TLV. This is needed
because lbs_prepare_and_send_command() has an argument for a
data buffer, but not for it's lengths and TLVs can be, by
definition, vary in size.
* fix a bug where it was not possible to disable an event

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>
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>
96287ac4f7b387acbe17e24b5e1bcbf3bc0e75cd 20-Nov-2007 Brajesh Dave <brajeshd@marvell.com> libertas: configurable beacon interval

Requires firmware version 5.110.19.p0 or newer, available here:
http://dev.laptop.org/pub/firmware/libertas/

Signed-off-by: Ashish Shukla <ashishs@marvell.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
01d77d8d4747d73cfb6daf35cdc906a2db8ded9d 20-Nov-2007 Brajesh Dave <brajeshd@marvell.com> libertas: separate mesh connectivity from that of the main interface

The transmit and receive traffic as soon as the mesh interface is
brought up.

Test case 1: Bring up only the mesh interface and ping. No need for
any iwconfig commands on the main interface.

$ ifconfig msh0 192.168.5.3
$ iwconfig msh0 channel X
$ ping 192.168.5.2
If ping succeeds, PASS

Test case 2: Associate with the main interface, and turn off AP. Mesh
interface should not lose connectivity.

$ iwconfig eth0 mode managed essid "my_ssid"
$ ifconfig msh0 192.168.5.3
$ ping 192.168.5.2
<turn off access point>
If ping continues uninterrupted, PASS

This feature requires firmware version 5.110.19.p0 or newer, available
here: http://dev.laptop.org/pub/firmware/libertas/

Signed-off-by: Ashish Shukla <ashishs@marvell.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-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>
8b17d7234c7039b668739e1868f3d5544d79a4c0 08-Oct-2007 Holger Schurig <hs4233@mail.mn-solutions.de> [PATCH] libertas: fix a debug statement

Fix a debug statement

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0795af5729b18218767fab27c44b1384f72dc9ad 04-Oct-2007 Joe Perches <joe@perches.com> [NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()

This is nicer than the MAC_FMT stuff.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
70500f5443be1b27ea2c9ab71ce9dc2250af7b19 20-Aug-2007 Marek Vašut <marek.vasut@gmail.com> [PATCH] libertas: region code values specified as 8bit

This patch strips away possible mess in regioncode (eg. on my card - 88W8305
chipset - I get 0x3031 instead of expected 0x0031 and as a result the driver
defaults to USA region which is obviously incorrect). Following patch fixes
the issue.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8362cd413e8116306fafbaf414f0419db0595142 03-Aug-2007 Dan Williams <dcbw@redhat.com> [PATCH] libertas: fix sparse-reported problems

A few fields being converted to the wrong sized type, and a few missed
endian conversions.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5612c0140ac58b51209a24c8fd6a92ceb472aabe 02-Aug-2007 Dan Williams <dcbw@redhat.com> [PATCH] libertas: ignore spurious mesh autostart events

Don't trust the firmware to always send them at the right time,
ignore them when the driver thinks mesh autostart is disabled.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9556d2120ceecc158b324fa01e30704ff9f42ae3 02-Aug-2007 Holger Schurig <hs4233@mail.mn-solutions.de> [PATCH] libertas: fix two debug statements in cmdresp.c

Purely cosmetic: this moves an lbs_deb_enter() to the proper place
and changes an erraneous lbs_deb_enter_args() into lbs_deb_leave_args()

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
956deb867a97ac137c164a5d2d12b0c82fb6776d 02-Aug-2007 Holger Schurig <hs4233@mail.mn-solutions.de> [PATCH] libertas: remove adapter->regiontableindex

The value was computed, but then never used.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
caef47a0dc2b17ea6fb0119d3678b4b21ae70daa 02-Aug-2007 Holger Schurig <hs4233@mail.mn-solutions.de> [PATCH] libertas: remove adapter->rxpd_rate

No code uses the contents of this variable, so it can go.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
cad9d9b17a4ab80da1593de004a1163b359de268 02-Aug-2007 Holger Schurig <hs4233@mail.mn-solutions.de> [PATCH] libertas: remove adapter->txrate

The value of txrate was only set by a CMD_802_11_TX_RATE_QUERY command,
but there was no code in the driver that ever issued this command.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fdde7084e033263f48d26d5b24ecf626aed29b5b 02-Aug-2007 Holger Schurig <hs4233@mail.mn-solutions.de> [PATCH] libertas: remove adapter->{rx,tx}antenna

There was nowhere any code that used the values of those
variables.

This patch also removes two static functions that are now unused.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4d4ce1ad02f02e593086fabdad69953ecbd99d9c 02-Aug-2007 Holger Schurig <hs4233@mail.mn-solutions.de> [PATCH] libertas: remove unused adapter->prev_XXXX variables

There were just used in some debug output, but nowhere else.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9cdc6d295b97dc4a36569ddd0b0540aeba351149 02-Aug-2007 Luis Carlos Cobo <luisca@cozybit.com> [PATCH] libertas: Avoid MESH_AUTOSTARTED spam on console

Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a6c8700f36cd8f217420bbe26721094824fab8de 02-Aug-2007 Holger Schurig <hs4233@mail.mn-solutions.de> [PATCH] libertas: use LBS_DEB_HOST for host-to-card communications

... and LBS_DEB_CMD for command execution. Also tidies misc
comments to give a consistent output.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6b63cd0f420c3c3002024da6c9eff252a3772021 02-Aug-2007 Holger Schurig <hs4233@mail.mn-solutions.de> [PATCH] libertas: remove a hundred CMD_RET_xxx definitions

types.h contains the same amount of CMD_RET_xxx and CMD_xxx definitions.
They contains the same info: the firmware command opcode and, when the
firmware sends back a result, the command opcode ORed with 0x8000.

Having the same data twice in the source code is redundant and can lead to
errors (e.g. if you update or delete only one instance). This patch removed
all CMD_RET_xxx definitions and introduces a simple CMD_RET() macro.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ece561919326236c7fb791a5e883f0eb76af029e 02-Aug-2007 Holger Schurig <hs4233@mail.mn-solutions.de> [PATCH] libertas: make the hex dumper nicer

Currently, when you define LBS_DEB_HEX, you get every hex dump in the
whole driver, e.g. for LBS_DEB_CMD, LBS_DEB_RX, LBS_DEB_TX etc. This
patch makes sure that you only get the hexdump that you're interested in.

Renamed lbs_dbg_hex() into lbs_deb_hex(), like the other lbs_deb_XXX()
macros.

Made lbs_deb_hex() issue a line feed (and a new prompt) after 16 bytes.

As lbs_deb_hex() now prints the ":" after the prompt by itself, removed
the misc colons in the various *.c files.

lbs_deb_XXX() now print the debug category as well.

As lbs_deb_XXX() --- and especially lbs_deb_11d() --- now print the
category, I removed various "11D:" prefixes in 11d.c as well.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0a6d0555e90850b7ce90e8937858f11b6b98b6d4 02-Aug-2007 Holger Schurig <hs4233@mail.mn-solutions.de> [PATCH] libertas: tune hardware info output

This changes the output of hardware related info from:

libertas: GET_HW_SPEC: FWReleaseVersion- 5.0.11.p0
libertas: GET_HW_SPEC: Permanent addr- 0:16:41:72:f6:a8
libertas: GET_HW_SPEC: hwifversion=0x2 version=0x213

to:

libertas: GET_HW_SPEC: FWReleaseVersion: 5.0.11.p0
libertas: GET_HW_SPEC: Permanent addr: 00:16:41:72:f6:a8
libertas: GET_HW_SPEC: hwifversion: 0x2, version: 0x213

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8c5127657549d055ac9d709cdea73902a6ef392c 02-Aug-2007 Dan Williams <dcbw@redhat.com> [PATCH] libertas: simplify and clean up data rate handling

Remove unused/duplicated fields and consolidate static data rate arrays,
for example the libertas_supported_rates[] and datarates[] arrays in
the bss_descriptor structure, and the libertas_supported_rates field
in the wlan_adapter structure.

Introduce libertas_fw_index_to_data_rate and libertas_data_rate_to_fw_index
functions and use them everywhere firmware requires a rate index rather
than a rate array.

The firmware requires the 4 basic rates to have the MSB set, but most
other stuff doesn't, like WEXT and mesh ioctls. Therefore, only set the MSB
on basic rates when pushing rate arrays to firmware instead of doing a ton
of (rate & 0x7f) everywhere.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ffcae953ac021f5051a201c18e133cb0ce38c2b9 02-Aug-2007 Dan Williams <dcbw@redhat.com> [PATCH] libertas: fix more mixed-case abuse

Mistakently introduced by a previous patch to upper-case all command
constants.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0aef64d75851c9f3545d0793f26486ed862306d8 02-Aug-2007 Dan Williams <dcbw@redhat.com> [PATCH] libertas: re-uppercase command defines and other constants

For readability.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1443b6530d8db779082dc9fabbd894e2b551b101 02-Aug-2007 Dan Williams <dcbw@redhat.com> [PATCH] libertas: rename WLAN_802_11_KEY to enc_key and clean up usage

It doesn't touch hardware and therefore doesn't need endian notations
either.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
18c96c3497aa871608d57ca5e08de3558159a6c9 18-Jun-2007 Dan Williams <dcbw@redhat.com> [PATCH] libertas: fix WPA associations by handling ENABLE_RSN correctly

Don't clobber the firmware's internal state machine by setting
ENABLE_RSN more than once during the 4-way handshake. Check what
the ENABLE_RSN status is and only set if it should be changed.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b8bedefd8fe589ff87a681e20583c8317030491d 30-May-2007 Luis Carlos Cobo Rus <luisca@cozybit.com> [PATCH] libertas: pull current channel from firmware on mesh autostart

Signed-off-by: Luis Carlos Cobo Rus <luisca@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d8efea254887128d710cc1475505514da004932c 29-May-2007 Dan Williams <dcbw@redhat.com> [PATCH] libertas: remove structure WLAN_802_11_SSID and libertas_escape_essid

Replace WLAN_802_11_SSID with direct 'ssid' and 'ssid_len' members
like ieee80211. In the process, remove private libertas_escape_essid
and depend on the ieee80211 implementation of escape_essid instead.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e5b3d472ad4eaa9013fd9f67f7a1b132f3ec910c 26-May-2007 David Woodhouse <dwmw2@infradead.org> [PATCH] libertas: don't byte-swap firmware version number. It's a byte array.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
981f187b7c4b237011d4175cae0120d5d203c0fd 26-May-2007 David Woodhouse <dwmw2@infradead.org> [PATCH] libertas: first pass at fixing up endianness issues

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7d8d28b31d16875f868889264efbba1f6c516860 26-May-2007 Luis Carlos Cobo Rus <luisca@cozybit.com> [PATCH] libertas: support for mesh autostart on firmware 5.220.11

Signed-off-by: Luis Carlos Cobo Rus <luisca@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6cfb00823872d0181c5c72c2d457de93518d96e7 25-May-2007 Dan Williams <dcbw@redhat.com> [PATCH] libertas: correctly balance locking in libertas_process_rx_command

adapter->lock should released after unlocking adapter->driver_lock to
balance the order in which they were locked at the top of the function.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e76850d620a0a26fa807b4fa189c64a94789461e 25-May-2007 Dan Williams <dcbw@redhat.com> [PATCH] libertas: make association paths consistent

The BSS to associate with (in either Infrastructure or IBSS join
operations) is now stored in _one_ place in the association request (the
bss member), not two places as before (pattemptedbss and
curbssparams->bssdescriptor).

Association requests are passed to the necessary association functions
to (a) give them access to the bss member and (b) ensure that
association/join/start setup uses settings from the request, not the
current adapter settings (which may not be valid for the requested
settings).

Because the 'bss' member of the association request is used now, the
command return functions from associate and adhoc join/start need access
to the in-progress association request to update curbssparams when
everything is done. The association worker moves the request from
pending to in-progress for the duration of the association attempt.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
634b8f49c11f49272b09d13a34b22a17b8c3d419 25-May-2007 Holger Schurig <hs4233@mail.mn-solutions.de> [PATCH] libertas: remove unused variables in wlan_dev_t

Actually, this patch removev wlan_dev_t totally and puts the used variables
of it directly into wlan_private. That reduces one level of indirection and
looks a little bit simpler. It's now "priv->card" and not
"priv->wlan_dev.card" and "priv->dev" instead of "priv->wlan_dev.netdev"

Changed two occurences of "((wlan_private *) dev->priv)->wlan_dev.netdev"
into "dev", because I didn't see the point in doing pointer-ping-pong.

The variables "ioport", "upld_rcv" and "upld_type" where unused. They have
been removed.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
208fdd2f447899164bd139452c291b155e53cee9 25-May-2007 Holger Schurig <hs4233@mail.mn-solutions.de> [PATCH] libertas: indirect all hardware access via hw_XXXX functions

This functions makes all libertas_sbi_XXX functions static to the
if_usb.c file and renames them to if_usb_XXXX(). The get called from
other places of the source code via priv->hw_XXXX().

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
78523daa86cf0b02c4d2f73b962c04ad565e9140 25-May-2007 Holger Schurig <hs4233@mail.mn-solutions.de> [PATCH] libertas: single out mesh code

This patches adds the two functions wlan_add_mesh() and wlan_remove_mesh(),
which are responsible for the mshX interface. In a CF driver with a non-
mesh-aware firmware you can omit the calls to this functions.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9012b28a407511fb355f6d2176a12d4653489672 25-May-2007 Holger Schurig <hs4233@mail.mn-solutions.de> [PATCH] libertas: make debug configurable

The debug output of libertas was either not present or it was overwhelming.
This patch adds the possibility to specify a bitmask for the area of
interest. One should then only get the desired output.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0dc5a29044d56912bf0d4e5cd19127f82b90c29c 11-May-2007 Dan Williams <dcbw@redhat.com> [PATCH] libertas: remove WLAN_802_11_NETWORK_INFRASTRUCTURE enum

Use standard IW_MODE_* constants instead.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9408c297f6cee8e91ab2c51ec8d56e8c23c19a53 11-May-2007 Dan Williams <dcbw@redhat.com> [PATCH] libertas: remove custom encryption mode stuff

Remove setencryptionmode private ioctl and Encryptionmode variable.

Mostly unused, and its functionality is provided by other internal members
like WEPstatus, WPAenabled, WPA2enabled, and SIOCSIWGENIE.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
876c9d3aeb989cf1961f2c228d309ba5dcfb1172 10-Feb-2007 Marcelo Tosatti <marcelo@kvack.org> [PATCH] Marvell Libertas 8388 802.11b/g USB driver

Add the Marvell Libertas 8388 802.11 USB driver.

Signed-off-by: Marcelo Tosatti <marcelo@kvack.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>