Commit Graph

420 Commits (3acea5b616c6d85008700a9d51cb02a81b2d0c67)

Author SHA1 Message Date
David Woodhouse 6ce4fd2a3a libertas: add lbs_host_sleep_cfg() command function
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:01 -08:00
David Woodhouse a27b9f96f2 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>
2008-01-28 15:07:00 -08:00
David Woodhouse 23d36eec26 libertas: add missing newlines in debugging statements
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:00 -08:00
David Woodhouse e1258177e4 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>
2008-01-28 15:06:59 -08:00
David Woodhouse 06113c1c70 libertas: add debugging output to lbs_mesh_config()
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:58 -08:00
David Woodhouse 8642f1f062 libertas: disable mesh temporarily while setting eth channel/assoc
Otherwise the device won't let us change channels.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:58 -08:00
David Woodhouse 88ae2915cc libertas: add missing newline on debug message
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:57 -08:00
David Woodhouse 823eaa2cc2 libertas: allow setting channel on mshX device
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:56 -08:00
David Woodhouse f5956bf1e4 libertas: allow get/set SSID on mshX device
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:56 -08:00
David Woodhouse 387a1f046f libertas: whitespace cleanup in host.h
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:55 -08:00
David Woodhouse 202f3f3ac9 libertas: kill rx_urb_recall and eth_dev members of struct usb_card_rec
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:54 -08:00
David Woodhouse 1f8a08342c libertas: kill references to mesh autostart
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:53 -08:00
David Woodhouse 23a397ac82 libertas: add lbs_mesh sysfs attribute for enabling mesh
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:53 -08:00
David Woodhouse e7240acae3 libertas: fix sparse endianness warnings in scan.c
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:52 -08:00
David Woodhouse 2fd6cfe307 libertas: make some more functions static
sparse was getting on my tits.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:51 -08:00
Dan Williams cb182a6028 libertas: endianness fixes for get_channel/set_channel
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>
2008-01-28 15:06:50 -08:00
Dan Williams 2dd4b26264 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>
2008-01-28 15:06:50 -08:00
Dan Williams 8e3c91bb70 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>
2008-01-28 15:06:49 -08:00
Dan Williams 79a9a37c1e libertas: fix case of FWT_ACCESS_LIST_ROUTE and FWT_ACCESS_LIST_NEIGHBOR commands
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>
2008-01-28 15:06:48 -08:00
David Woodhouse 0f1c8232e8 libertas: remove casts from lbs_cmd() and lbs_cmd_with_response() macros
If stupid people like me give it arguments with the wrong type (like a
pointer to the structure, for example, instead of the structure itself),
then we should probably notice that at compile time. Otherwise, much
confusion ensues.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:47 -08:00
David Woodhouse 301eacbf30 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>
2008-01-28 15:06:46 -08:00
David Woodhouse ad9d7a7f3c libertas: fix debug output in lbs_cmd_copyback() function.
Bad dcbw. Always test on big-endian, or at least use sparse.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:46 -08:00
Dan Williams ddac452680 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>
2008-01-28 15:06:45 -08:00
David Woodhouse c9cd6f9d63 libertas: wait for 'firmware ready' event from firmware after loading
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:44 -08:00
David Woodhouse 10bca0d5f4 libertas: move removal of lbs_rtap file to lbs_stop_card()
This prevents us from trying to remove it when it didn't exist, in the
error case.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:44 -08:00
David Woodhouse 6bc822b516 libertas: switch USB cardp->priv to 'struct lbs_private *' and resulting fix
Amazing what interesting things the compiler will tell you if you let it
know what types you expect to be passing around.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:43 -08:00
Dan Williams 6e66f03ff7 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>
2008-01-28 15:06:42 -08:00
Dan Williams a8bdcd71fd libertas: add simple copyback command callback
A simple callback which copies the response back into the
command buffer that was used to send the command to the
card.  Will allow for direct command processing outside
the mega-switches in cmd.c and cmdresp.c.

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>
2008-01-28 15:06:41 -08:00
Dan Williams 7ad994dec7 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>
2008-01-28 15:06:41 -08:00
David Woodhouse b15152a403 libertas: don't run thread while firmware not yet ready
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:40 -08:00
David Woodhouse 4f82f5c853 libertas: switch to a waitqueue and timer for handling USB firmware load
No need to busy-wait, even if we did have a 100ms delay in the loop.
This makes it easier to support the new 'firmware ready' event which is
in the new firmware, too.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:39 -08:00
David Woodhouse c8ba39d060 libertas: improve reliability of firmware reloading on USB
Increase the delay between issuing the RESET command and the usb reset,
and be prepared to discard more than one 'normal' packet from it before
it resets.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:39 -08:00
David Woodhouse 8552855f98 libertas: make rtap and normal modes mutually exclusive, clean up open/stop
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:38 -08:00
Dan Williams 852e1f2a26 libertas: clean up is_command_allowed_in_ps()
Total overkill to have an array when there's only one command in it.

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>
2008-01-28 15:06:37 -08:00
David Woodhouse b31d8b90dc libertas: remove pre_open_check()
The firmware is always initialised before we register the netdevices.
It's not possible for pre_open_check() to fail.

One day we might try loading firmware in ->open(), but still it won't be
just a _check_, like this.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:36 -08:00
Dan Williams 14e865ba5d libertas: make lbs_cmd() usage nicer
Define a macro that relieves the caller from having to use sizeof on
the command structure when calling lbs_cmd(), and move the prototype
of __lbs_cmd() to a new cmd.h file.

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>
2008-01-28 15:06:36 -08:00
David Woodhouse 4f67949656 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>
2008-01-28 15:06:35 -08:00
David Woodhouse 1309b55b4d 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>
2008-01-28 15:06:34 -08:00
Holger Schurig b6b8abe4dd libertas: fix use-after-free error
Previously, the display of subscribed events could be wrong.

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>
2008-01-28 15:06:34 -08:00
David Woodhouse c3f949618d libertas: kill (IS,SET,UNSET)_MESH_FRAME.
No need for these any more. We've collapsed all the unneeded nests of
functions which needed to keep track of which device the skb belonged to.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:33 -08:00
David Woodhouse 6f93a8e7e4 libertas: kill lbs_upload_tx_packet()
It replaces two lines of code. And even for those it has to make
inferences about things (i.e. which device) which the caller would have
just known.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:32 -08:00
David Woodhouse 7bf02c2985 libertas: fix error cases in lbs_process_rxed_802_11_packet()
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:32 -08:00
David Woodhouse 180be755ae libertas: remove unreachable code from process_rxed_802_11_packet()
The function is only ever called if we're in rtap mode. So the bit in it
which is conditional on rtap mode seems a little superfluous.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:31 -08:00
David Woodhouse 2eb188a1c5 libertas: Move actual transmission to main thread
The locking issues with TX, especially TX from multiple netdevs, get
_so_ much easier if you do it like this.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:30 -08:00
David Woodhouse b8d40bc9c9 libertas: refactor the 'should I sleep?' decision in lbs_thread()
This was making my brain hurt.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:30 -08:00
David Woodhouse 45c24903b7 libertas: free successfully transmitted skbs again
I was so busy cleaning up the failure modes that I accidentally forgot
to make sure we still free them in the success case. Oops.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:29 -08:00
David Woodhouse a97bcfed96 libertas: TX packet is radiotap iff it comes from rtap_dev
Fix one of the barriers to simultaneous radiotap and normal operation --
stop misinterpreting the TX packets on the normal devices. We're also
going to have to clone the incoming skbs and feed them into both
devices, and there seem to be firmware problems with staying associated
too. But this is a reasonable start...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:28 -08:00
David Woodhouse 121947c62a libertas: set dev_addr on rtap device
This lets us bring it up, because eth_validate_addr() succeeds instead
of returning -EINVAL. And finally monitor mode seems to (mostly) work.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:27 -08:00
David Woodhouse d9268fb9a1 libertas: stop using ieee80211 for radiotap device
There seems to be no point in doing it as an ieee80211 device instead of
a normal netdev, and when we override its ->priv and then call
free_ieee80211() it has a distressing tendency to crash horribly.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:27 -08:00
David Woodhouse 198cefb932 libertas: kill lbs_pre_start_xmit(), lib_mesh_pre_start_xmit()
These wrappers only do two things.

Firstly, they set the frame type, which isn't necessary since
lbs_hard_start_xmit() gets to see which device it belongs to anyway.

Secondly, they return -EOPNOTSUPP if the device is in monitor mode.
Which is a strange thing to do and will provide nasty warnings from
qdisc_restart(). And lbs_hard_start_xmit() seems to have code to cope
with monitor mode anyway.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:26 -08:00
David Woodhouse a2b62dc1f1 libertas: clean up lbs_hard_start_xmit()
Having merged the nest of functions into one, now we can clean it up and
fix the error handling, and the duplication -- and at least make a start
on the locking.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:25 -08:00
David Woodhouse 8af23b2f96 libertas: kill lbs_process_tx() by merging it into lbs_hard_start_xmit()
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:25 -08:00
David Woodhouse a9bdce6564 libertas: move lbs_hard_start_xmit() into tx.c
... where it can shortly be merged with lbs_process_tx()...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:24 -08:00
David Woodhouse 6b4a7e0fbd libertas: kill SendSinglePacket() function.
Make a start on reducing the number of pointless nested functions,
starting with the StudlyCaps. No semantic changes (yet) -- we can sort
out the now-obvious discrepancy in the failure paths in a separate
commit.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:23 -08:00
David Woodhouse 2abdc0b775 libertas: kill internal tx queue for PS mode
It was buggy as hell anyway, since it was just spewing packets at the
device when it wasn't necessarily ready for them (in the USB case, while
the URB was still busy).

We could probably do with a better way of flushing packets to the device
_immediately_, before we stick it back into sleep mode. But we can no
longer just dequeue packets directly, it seems.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:22 -08:00
David Woodhouse 020bb19e2f libertas: stop debugfs code looking at cmdpendingq
It doesn't need to wait until no commands are pending anyway -- it only
needs to wait until the scan is finished.

We can hopefully find it something else to wait on too -- it's the only
user of the cmd_pending waitqueue.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:22 -08:00
David Woodhouse 6d35fdfced libertas: cope with device which already has firmware loaded
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:21 -08:00
David Woodhouse a63b22bb5b libertas: use lbs_host_to_card_done() in lbs_tx_timeout()
Also attempt some locking in lbs_host_to_card_done()

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:20 -08:00
David Woodhouse aa21c004f8 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>
2008-01-28 15:06:19 -08:00
David Woodhouse f86a93e1b2 libertas: kill TxLockFlag
We don't need this. We can use adapter->currenttxskb instead.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:18 -08:00
David Woodhouse e7deced05f libertas: fix lbs_rtap attribute in sysfs
At least it doesn't oops when you attempt to read or write it now.
Only when you enable it and then later turn it off. And when it's
enabled I don't see how it actually works.

But one fewer oops is good, for now...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:18 -08:00
David Woodhouse 59f3e4bf1e libertas: clean up lbs_thread() to make it slightly more readable
No semantic changes.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:17 -08:00
David Woodhouse 448a51ae06 libertas: switch lbs_cmd() to take a callback function pointer
All existing code which sends commands is set up to have some function
called with the results, not to get data back. It's more versatile this
way, and providing it with a callback function which involves memcpy()
is hardly difficult.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:16 -08:00
David Woodhouse ac47246e24 libertas: kill adapter->nr_cmd_pending
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:15 -08:00
David Woodhouse 99c893f34a libertas: Fix up error handling in lbs_setuserscan()
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:14 -08:00
David Woodhouse c12bdc45d9 libertas: Don't set IW_ENCODE_NOKEY when returning WEP keys.
Also clean up the double setting/clearing of IW_ENCODE_DISABLED.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:14 -08:00
Holger Schurig c2df2efe96 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>
2008-01-28 15:06:13 -08:00
David Woodhouse 1723047d67 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>
2008-01-28 15:06:12 -08:00
David Woodhouse 0856e6816b libertas: when usb_submit_usb fails, include the error code in the printk
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:11 -08:00
Holger Schurig ffd074fc78 libertas: implement new scanning logic
This changes the code that is used for scanning and makes it hopefully
easier to understand:

* move function into logical blocks
* create a bunch of lbs_scan_add_XXXX_tlv() functions, that
  help to create the TLV parameter of CMD_802_11_SCAN
* all of them are now called from the much simpler lbs_do_scan()
* no **puserscancfg double-pointers :-)

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:11 -08:00
David Woodhouse 83eacf233e libertas: Fix endianness in boot2_version handling.
We read it from the card. We byte-swap it. We write it back to the card.
D'oh.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:10 -08:00
David Woodhouse f9f6890e41 libertas: Remove SET_BOOT2_VER support from the Big Switch Statement.
And the death of libertas_prepare_and_send_command() starts...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:09 -08:00
David Woodhouse 04c80f1ab1 libertas: Use lbs_cmd() for setting Boot2 version
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:09 -08:00
Holger Schurig 09d4fad6e8 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>
2008-01-28 15:06:08 -08:00
Li Zefan abe3ed14d3 libertas: don't cast a pointer to pointer of
Don't cast struct foo * to struct list_head *, it's safe only when
the list member is the first member of struct foo.

Also don't cast struct list_head * to struct foo *.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
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>
2008-01-28 15:06:07 -08:00
David Woodhouse 6228c0aea5 libertas: Byteswap cmdptr->size in lbs_cmd()
Bad Holger. Always test on big-endian machines, if it's little-endian
you need to be swapping to/from.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:06 -08:00
David Woodhouse ad9de29130 libertas: Zero 'pdata_size' field in cmd_ctrl_node reliably.
Otherwise, lbs_process_rx_command() will take the new path for
lbs_cmd() responses, when it shouldn't.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:06 -08:00
David Woodhouse 2c94404c30 libertas: Move SET_BOOT2_VER command to if_usb where it belongs
This is meaningless for non-USB devices and unimplemented in their
firmware. It's somewhat dubious for USB devices too, but that's a
different story.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:05 -08:00
David Woodhouse 9088566176 libertas: Don't claim to have checksummed incoming packets.
This explains why we never noticed the corruption of checksums on
outgoing packets... we weren't actually checking them either.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:04 -08:00
Holger Schurig 675787e29f 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>
2008-01-28 15:06:04 -08:00
Holger Schurig 0d61d04210 libertas: make more functions static
These functions were used in the old debugfs code for events, but
as this code is now gone, there's no need to export those functions.

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>
2008-01-28 15:06:03 -08:00
Holger Schurig c68b3bbdb5 libertas: remove cmd_ctrl_node->status
There was no code that ever did set this variable.

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>
2008-01-28 15:06:02 -08:00
Holger Schurig 891f32a1c4 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>
2008-01-28 15:06:01 -08:00
David Woodhouse e775ed7c67 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>
2008-01-28 15:06:01 -08:00
David Woodhouse f5ece8fc8d libertas: Remove cmd_oid from struct cmd_ctrl_node
This is only needed for SNMP and key operations; it doesn't need to be
preserved outside that context.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:06:00 -08:00
David Woodhouse 77d8cf2c09 libertas: Fix memory leak of RX skbs
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:05:59 -08:00
Holger Schurig 0b3c07ff64 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>
2008-01-28 15:04:58 -08:00
Holger Schurig a7d0adae40 libertas: remove user-specified channel list
Remove the ability to specify channels to scan via debugfs

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>
2008-01-28 15:04:58 -08:00
Holger Schurig dd1d12dabf libertas: remove numprobes
Remove the ability to specify number of probes via debugfs

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>
2008-01-28 15:04:57 -08:00
Holger Schurig 01affb6530 libertas: tweak tx path debugging
Make two functions in the TX packet path emit
their debug messages with LBS_DEB_TX, not LBS_DEB_MAIN.

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>
2008-01-28 15:04:56 -08:00
Holger Schurig 91843463bc 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>
2008-01-28 15:04:55 -08:00
Holger Schurig 3a18864917 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>
2008-01-28 15:04:55 -08:00
Holger Schurig 69f9032d9d 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>
2008-01-28 15:04:54 -08:00
Brajesh Dave 96287ac4f7 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>
2008-01-28 15:04:53 -08:00
Brajesh Dave 01d77d8d47 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>
2008-01-28 15:04:52 -08:00
Andres Salomon 798fbfec9c libertas: nuke useless variable usbdriver_name and useless comments
I think it was pretty obvious what fields in if_usb_driver are...

Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:04:51 -08:00
Andres Salomon be13f1897f libertas: reset devices upon disconnect rather than module unloading
1) Do not reset libertas devices upon module unload.  We're unloading
the module, we're not killing off devices.
2) Instead, reset libertas devices inside if_usb_disconnect, as we're
killing off interfaces and so on.
3) Resetting via disconnect callback means we no longer need to keep
track of probed libertas devices; kill off that list (and its wonderful
lack of locking..), as well.

Drop a useless comment as well.

Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:04:51 -08:00
Andres Salomon 4fb910fd3a libertas: mark module_init/exit functions as __init/__exit
Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:04:50 -08:00
Andres Salomon 82209adcb1 libertas: drop useless default_fw_name variable
Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:04:49 -08:00
Holger Schurig 0765af4493 libertas: clean up association debug messages
This makes the debug output of all association stuff clearer by:

* adding some lbs_deb_enter()/lbs_deb_leave() calls
* printing the return level in one place
* lower-casing some string

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:04:46 -08:00
Holger Schurig 1007832103 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>
2008-01-28 15:04:46 -08:00
Jeff Garzik 93a3b607e6 wireless: checkpatch cleanups
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-01-28 15:04:04 -08:00
Jeff Garzik 28fc1f5a0c [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>
2008-01-28 15:03:40 -08:00
Alejandro Martinez Ruiz c00acf46de netdev: ARRAY_SIZE() cleanups
Convert array size calculations to use ARRAY_SIZE().

Signed-off-by: Alejandro Martinez Ruiz <alex@flawedcode.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:03:37 -08:00
Roel Kluin f59d978275 wireless: fix '!x & y' typo's
Fix priority mistakes similar to '!x & y'

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:03:35 -08:00
Holger Schurig 9f9dac281b libertas: move wlan_*_association_work from header to c file
Move wlan_postpone_association_work() and wlan_cancel_association_work()
from a assoc.h file to the sole user, into wext.c.

Renamed those two functions to to libertas_XXX as well.

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>
2008-01-28 15:03:34 -08:00
David S. Miller 15ca36fb99 [LIBERTAS]: Remove last stray user of MAC_FMT.
Reported by Denis V. Lunev

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:00:08 -08:00
Marc Pignat 436c8854a0 wireless/libertas support for 88w8385 sdio older revision
Identifiaction of another revision of 88w8385 in sdio mode.

Signed-off-by: Marc Pignat <marc.pignat@hevs.ch>
Acked-by: Pierre Ossman <drzeus@drzeus.cx>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-16 12:53:32 -05:00
Holger Schurig 6591e36a1c 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>
2007-11-29 21:34:52 -05:00
David Woodhouse d0a6895751 libertas: Don't set NETIF_F_IPV6_CSUM in dev->features
I'm not sure why it was doing this, and I'm not sure I _want_ to know
why. But calling it NETIF_F_DYNALLOC doesn't change the fact that the
kernel believes it to be NETIF_F_IPV6_CSUM, and that IPv6 communication
is hence buggered.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-29 21:34:52 -05:00
Joe Perches 8376e7a3c2 drivers/net/wireless: Add missing "space"
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-29 21:34:51 -05:00
Marcelo Tosatti 29f5f2a19b libertas: properly account for queue commands
Properly account for queue commands, this fixes a problem reported
by Holger Schurig when using the debugfs interface.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-10 04:25:11 -05:00
Pierre Ossman 51e6b712b5 libertas: make if_sdio align packets
Incoming packets have to be aligned or the IP stack becomes upset.
Make sure to shift them two bytes to achieve this.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-10 04:25:10 -05:00
Holger Schurig 4ef31702c1 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>
2007-11-10 04:25:10 -05:00
Pierre Ossman 727c26ed78 net: libertas sdio driver
Add driver for Marvell's Libertas 8385 and 8686 wifi chips.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Acked-by: Dan Williams <dcbw@redhat.com>
2007-10-17 22:51:13 +02:00
Holger Schurig 04799fae8e [PATCH] libertas: let get nick return what set nick has set
Make the get-nickname wireless extension actually work. Before
this patch, I could do "iwconfig eth1 nick BLAH" but "iwconfig
eth1" would have still showed "MRVL-USB8388" to me. Hey, and that
was wrong anyway, I'm on a CF card, not on USB :-)

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>
2007-10-10 16:55:22 -07:00
Holger Schurig cc32613792 [PATCH] libertas: remove one superfluous include
This makes scripts/checkincludes.pl happy.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:22 -07:00
Holger Schurig e56188ac41 [PATCH] libertas: clean up scan debug messages
* make scan debug output cleaner
* change some LBS_DEB_ASSOC messages to LBS_DEB_SCAN, which is more correct
* move helper functions together
* print function return value in the tracing code at one central location

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>
2007-10-10 16:55:21 -07:00
Holger Schurig 314a886f08 [PATCH] libertas: fix "warning: Using plain integer as NULL pointer" sparse warnings
This fixes three "warning: Using plain integer as NULL pointer"
sparse warnings.

Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:20 -07:00
Holger Schurig 8b17d7234c [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>
2007-10-10 16:55:20 -07:00
Geert Uytterhoeven d8b0fb51ef [PATCH] libertas link error due to gcc `smartness'
Some versions of gcc replace strstr() calls with a single-character `needle'
parameter by strchr() behind our back. This causes a link error if strchr() is
defined as an inline function in <asm/string.h> (e.g. on m68k):

| drivers/built-in.o: In function `libertas_parse_chan':
| linux/drivers/net/wireless/libertas/debugfs.c:209: undefined reference to `strchr'
| drivers/built-in.o: In function `libertas_parse_ssid':
| linux/drivers/net/wireless/libertas/debugfs.c:260: undefined reference to `strchr'

Avoid this by explicitly calling strchr() instead.

Also include <linux/string.h>, because this file calls lots of str*() routines.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-By: Holger Schurig <hs4233@mail.mn-solutions.de>
Acked-By: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:19 -07:00
Holger Schurig 6470a89de9 [PATCH] libertas: fix u8 constant
Don't write constants that are (per documentation and struct) u8
as 0x0001, use 0x01 instead. Also remove an useless cast.

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>
2007-10-10 16:55:19 -07:00
Dan Williams 2bcde51d09 [PATCH] libertas: problems setting wpa keys
The 88w8385 chip, using SDIO interface and firmware release 5.0.11p0,
has problems when both unicast and multicast WPA keys are set in one
command. This patch ensures the keys are set independently.

The original author of this patch is Marc Pignat <marc.pignat@hevs.ch>

Signed-off-by: Marc Pignat <marc.pignat@hevs.ch>
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:55:18 -07:00
Vladimir Davydov ac630c2b19 [LIBERTAS]: fix oops on the blackfin architecture
Fixing memory alignment problems on the blackfin architecture (maybe on the
ARM also)

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>
2007-10-10 16:52:28 -07:00
Vladimir Davydov f31ce76b78 [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>
2007-10-10 16:52:27 -07:00
Ryan Mallon 28de0b36be [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>
2007-10-10 16:52:27 -07:00
Ryan Mallon 6f05cbe588 [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>
2007-10-10 16:52:26 -07:00
Jeff Garzik b9f2c0440d [netdrvr] Stop using legacy hooks ->self_test_count, ->get_stats_count
These have been superceded by the new ->get_sset_count() hook.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10 16:51:45 -07:00
Joe Perches 0795af5729 [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>
2007-10-10 16:51:42 -07:00
Denis Cheng ff8ac60948 drivers/net/: all drivers/net/ cleanup with ARRAY_SIZE
Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-10 16:51:15 -07:00
Ralf Baechle 10d024c1b2 [NET]: Nuke SET_MODULE_OWNER macro.
It's been a useless no-op for long enough in 2.6 so I figured it's time to
remove it.  The number of people that could object because they're
maintaining unified 2.4 and 2.6 drivers is probably rather small.

[ Handled drivers added by netdev tree and some missed IRDA cases... -DaveM ]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10 16:51:13 -07:00
John W. Linville cbdb9e43d1 [PATCH] libertas: remove unused adhoc_rates_b definition
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:50:39 -07:00
Andrew Morton 4ecd41bd0f [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>
2007-10-10 16:50:38 -07:00
Jesper Juhl 655b4d16ac [PATCH] net: Kill some unneeded allocation return value casts in libertas
kmalloc() and friends return void*, no need to cast it.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:50:37 -07:00
Brajesh Dave 4b04f19625 [PATCH] libertas: advertise 11g ad-hoc rates
Advertise support for 802.11g bitrates when starting adhoc
networks, not just 802.11b bitrates.

Signed-off-by: Brajesh Dave <brajeshd@marvell.com>
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:50:37 -07:00
Marek Vašut 70500f5443 [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>
2007-10-10 16:50:36 -07:00
Pierre Ossman 794760f750 [PATCH] libertas: properly end commands on hardware failure
Make sure that errors reported by the hardware layer is properly
handled. Otherwise commands tend to get stuck in limbo.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:50:36 -07:00
Dan Williams b6e99dd6e2 [PATCH] libertas: send reset command directly instead of calling libertas_reset_device
Ensures that any platform specific code that might live in libertas_reset_device
(for example, OLPC tells the EC to do a GPIO-toggled reset of the wireless
from libertas_reset_device) isn't called.  Could be handled better by
interface-specific callbacks and a flag for "other hardware reset".

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Marcelo Tosatti <marcelo@kvack.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:50:35 -07:00
Dan Williams 64f104e89b [PATCH] libertas: don't stomp on interface-specific private data
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:50:34 -07:00
Dan Williams 954ee164f4 [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>
2007-10-10 16:50:34 -07:00
Dan Williams b1b1907dce [PATCH] libertas: fix inadvertant removal of bits from commit 8314418629
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:50:33 -07:00
Dan Williams 7856a541ad [PATCH] libertas: bump driver version
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:50:18 -07:00
Dan Williams 8362cd413e [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>
2007-10-10 16:50:17 -07:00
Dan Williams c7fdf26995 [PATCH] libertas: better descriptions for association errors
Describe the association response status code the firmware
returns, based on mail to libertas-dev from Ronak.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:50:17 -07:00
Dan Williams 5612c0140a [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>
2007-10-10 16:50:16 -07:00
Dan Williams 81173e34d4 [PATCH] libertas: fix misspelling in debug message
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:50:15 -07:00
Luis Carlos Cobo 63f0023bc3 [PATCH] libertas: pass boot2 version to firmware
Boot2 version used to be hardcoded in the uploaded firmware,
this patch preserves the boot2 version before uploading firmware
and sends it to the firmware again on resume.

Signed-off-by: Luis Carlos Cobo <luisca@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:50:15 -07:00
Dan Williams 2afc0c5d71 [PATCH] libertas: push WEXT scan requests to a work queue
Push WEXT scan requests to a workqueue and have each partial scan queue
the next part, then only report results when the complete scan has finished.
Full scans don't go through the work queue.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:50:14 -07:00
Eugene Teo b031ac1026 [PATCH] drivers/net/wireless/libertas/cmd.c: fix adapter->driver_lock dereference
adapter is NULL if cmdnode is not.

Signed-off-by: Eugene Teo <eugeneteo@kernel.sg>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:50:14 -07:00
Dan Williams 5707708111 [PATCH] libertas: fix assignment of WEP key type
keytype is a u8

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-10-10 16:50:13 -07:00