dect
/
linux-2.6
Archived
13
0
Fork 0
Commit Graph

35167 Commits

Author SHA1 Message Date
Al Viro 184a3b2c51 hostap: don't mess with mixed-endian even for internal skb queues
Just leave hfa384x_info_frame as-is, don't convert in place.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:06 -08:00
Al Viro 8a9faf3cd0 hostap annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:05 -08:00
Al Viro 3eb9b41f24 airo: last of endianness annotations
sanitize handling of ConfigRid

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:05 -08:00
Al Viro 329e2c0067 airo: sanitize handling of StatusRid
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:04 -08:00
Al Viro a749716ecc airo: sanitize APListRid handling
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:03 -08:00
Al Viro 56d81bd3c7 airo: sanitize handling of CapabilityRid
Don't byteswap any fields, annotate.  That has caught a bug,
BTW - will be handled in the next patch.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:02 -08:00
Al Viro a23ace5f22 airo: sanitize handling of StatsRid
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:02 -08:00
Al Viro 4293ea33c8 airo: sanitize handling of WepKeyRid
don't byteswap, update users to match that, annotate.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:01 -08:00
Al Viro 17e7049140 airo: sanitize BSSListRid handling
Stop byteswap-in-place in readBSSListRid(), annotate the sucker.
BTW, that had immediately found a bug - another codepath fetching
the same struct from card did _not_ byteswap, but used ->dBm the
same as everything else - host-endian.  Fix in the next patch...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:09:00 -08:00
Al Viro b8c06bc1f3 bap_read()/bap_write() work with fixed-endian buffers
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:59 -08:00
Al Viro 0dd2212fb6 airo: sanitize handling of SSID_rid
* store SSID_rid without conversions
* sanitize proc_SSID_on_close() (and avoid access past the end of
  buffer, while we are at it)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:58 -08:00
Al Viro 593c2b9cf2 airo: trivial endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:58 -08:00
Al Viro 4958730e2b ipw2200: ipw_tx_skb() endianness bug
We'd just set tfd->u.data.chunk_len[i] to cpu_to_le16(remaining_bytes);
passing it to pci_map_single() is a bad idea - it expects host-endian.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:57 -08:00
Al Viro 472caf8c8a ipw2200 fix: ->rt_chbitmask is le16
A couple of places forgot cpu_to_le16() in assignments to
that field, even though right next to those in other branches
of if-else we do it correctly.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:56 -08:00
Al Viro 743b84d2fc ipw2200 fix: struct ieee80211_radiotap_header is little-endian
some places in driver forget conversions

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:56 -08:00
Al Viro 7698d6977a ray_cs fixes
bugs galore:
	* 0xf380 instead of htons(ETH_P_AARP), etc.  Works only on l-e.
	* back in 2.3.20 driver got readb() and friends instead of
direct dereferencing of iomem.  Somebody got too enthusiatic and replaced
	ntohs(p->mrx_overflow)
with
	ntohs(read(&p->mrx_overflow)
without noticing that (a) the sucker is 16bit and (b) that expression can't possibly
be portable anyway (hell, on l-e it's always less than 256, on b-e it's always a
multiple of 256).  Proper fix is
	swab16(readw(&p->mrx_overflow)
taking into account the conversion done by readw() itself.  That crap happened
in several places; the same fix applies.
	* untranslate() assumes little-endian almost everywhere, except for
the code checking for IPX/AARP packets; there we forgot ntohs(), so that part
only works on big-endian.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:55 -08:00
Al Viro 1edd3a5553 ipw2100 annotations and fixes
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:54 -08:00
Al Viro dc73c623dd p54common annotations and fixes
* ->exp_id in bootrec_exp_if is __le16; missing conversion in its use
* !(x & y) misspelled as !x & y

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:53 -08:00
Al Viro e0c0056c67 hostap: fix endianness with txdesc->sw_support
it's le32, not le16...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:53 -08:00
Al Viro 2ab1f519cb airo: fix writerids() endianness
in writerids() we do _not_ byteswap, so we want to access
->opmode as little-endian.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:52 -08:00
Al Viro 15617858b3 airo endianness bug: cap_rid.extSoftCap
never had been byteswapped, used as host-endian...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:51 -08:00
Al Viro 0300b3321d airo: bug in airo_interrupt() handling on incoming 802.11
On big-endian we end up with swapped first two bytes in packet,
due to earlier conversion to host-endian and forgotten conversion
back.

The code we calculated that host-endian for had been duplicated
several time - it finds the 802.11 MAC header length by the first
two bytes of packet; taken into a new helper (header_len(__le16 ctl)).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:50 -08:00
Al Viro 851b3e5e3d airo: fix endianness bug in ->dBm handling
airo_translate_scan() reads BSSListRid directly, does _not_ byteswap
and uses ->dBm (__le16) as host-endian.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:50 -08:00
Al Viro 977b143c13 airo: fix transmit_802_11_packet()
a) gaplen would better be stored little-endian
b) for control packets (shorter than 24-byte header) we ended up with
        bap_write(ai, hdrlen == 30 ?
                (const u16*)&gap.gaplen : (const u16*)&gap, 38 - hdrlen, BAP1);
passing to card the data past the end of gap (i.e. random stuff from stack)
and did _not_ feed the gaplen at the right offset.
c) sending the contents of uninitialized fields of struct is Not Nice(tm) either

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:49 -08:00
Al Viro 8fffc15dc7 eliminate byteswapping in struct ieee80211_qos_parameters
Make it match the on-the-wire endianness, eliminate byteswapping.
The only driver that used this sucker (ipw2200) updated.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:45 -08:00
John W. Linville c0ddd04d55 wireless: cleanup some merge errors
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:08:45 -08:00
Patrick McHardy f12ca5f97b [MACVLAN]: Fix thinko in macvlan_transfer_operstate()
When the lower device's carrier is off, the macvlan devices's
carrier state should be checked to decide whether it needs to
be turned off. Currently the lower device's state is checked
a second time.

This still works, but unnecessarily tries to turn off the
carrier when its already off.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:08:36 -08:00
Patrick McHardy 9dfebcc647 [VLAN]: Turn VLAN_DEV_INFO into inline function
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:08:32 -08:00
Adrian Bunk 16b4d60b56 [IrDA]: Irport removal - part 2
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:08:10 -08:00
Adrian Bunk e9888f5498 [IrDA]: Irport removal - part 1
This patch removes IrPORT and the old dongle drivers (all off them
have replacement drivers).

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:08:10 -08:00
Denis V. Lunev b7c6ba6eb1 [NETNS]: Consolidate kernel netlink socket destruction.
Create a specific helper for netlink kernel socket disposal. This just
let the code look better and provides a ground for proper disposal
inside a namespace.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Tested-by: Alexey Dobriyan <adobriyan@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:08:07 -08:00
Stefan Roese ee63d22b89 net: NEWEMAC: Fix problem with mtu > 4080 on non TAH equipped 4xx PPC's
Currently, all non TAH equipped 4xx PPC's call emac_start_xmit() upon
xmit. This routine doesn't check if the frame length exceeds the max.
MAL buffer size.

This patch now changes the driver to call emac_start_xmit_sg() on all
GigE platforms and not only the TAH equipped ones (440GX). This enables
an MTU of 9000 instead 4080.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:08:04 -08:00
Claudio Lanconelli 3ec9c11da0 add driver for enc28j60 ethernet chip
Signed-off-by: Claudio Lanconelli <lanconelli.claudio@eptar.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:08:03 -08:00
Thomas Bogendoerfer a24a789cc6 SGISEEQ: fix oops when doing ifconfig down; ifconfig up
When doing init_ring checking whether a new skb needs to be allocated
was wrong.

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:08:02 -08:00
Stephen Hemminger bcc5289498 sky2: version 1.21
Update driver version reflects new hardware support.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:08:02 -08:00
Stephen Hemminger ed4d41616b sky2: support for Yukon Supreme
Add support from sk98lin vendor driver 10.50.1.3 for 88E8055 and
88E8075 chips.  I don't have this hardware to test, so this changes
are untested.

Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:08:01 -08:00
Al Viro 804d8541d2 qla3xxx annotations
stop the byteswap-in-place, annotate

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:08:00 -08:00
Al Viro 7cd61888d2 slhc annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:59 -08:00
Al Viro 3dd5f1d422 eepro100 annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:59 -08:00
Al Viro 904584018e annotate the rest of drivers/net/wan
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:58 -08:00
Al Viro a3edb08311 annotate tun
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:57 -08:00
David Miller 7eefb04eb0 NET: ns83820.c remove fastcall macro
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:56 -08:00
Thomas Bogendoerfer 49b11bc3d4 SGISEEQ: use cached memory access to make driver work on IP28
- Use inline functions for dma_sync_* instead of macros
- added Kconfig change to make selection for similair SGI boxes easier

Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:56 -08:00
Zhu Yi a0646470e8 iwlwifi: skip mac80211 conf during a hardware scan and replay it afterwards
This patch skips mac80211 configuration setting during a hardware scan
and replays it afterwards for the iwlwifi drivers.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:54 -08:00
Zhu Yi 12342c475f iwlwifi: proper monitor support
This patch changes the iwlwifi driver to properly support
monitor interfaces after the filter flags change.

The patch is originally created by Johannes Berg for iwl4965. I fixed some
of the comments and created a similar patch for iwl3945.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:53 -08:00
David Woodhouse 7e94041ca1 libertas: remove check for driver_lock in lbs_interrupt()
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:52 -08:00
David Woodhouse 5844d12ea3 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>
2008-01-28 15:07:51 -08:00
David Woodhouse f15ebb63b3 libertas: change inference about buffer size in lbs_cmd()
sizeof(*cmd) is going to give the total size of the data structure that
we allocated, more often than not. But the size of the command to be
_sent_ could be a lot smaller, as it is in the KEY_MATERIAL and
SUBSCRIBE_EVENT commands for example. So swap them round; let the caller
set the _command_ size explicitly in the header, and infer the
maximum response size from the data structure.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:51 -08:00
David Woodhouse 4f59abf190 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>
2008-01-28 15:07:50 -08:00
David Woodhouse f70dd4515a 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>
2008-01-28 15:07:49 -08:00
David Woodhouse 3fbe104cec 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>
2008-01-28 15:07:49 -08:00
David Woodhouse 6e5cc4fb35 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>
2008-01-28 15:07:48 -08:00
David Woodhouse a7c4589065 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>
2008-01-28 15:07:47 -08:00
David Woodhouse 354eca9820 libertas: submit RSSI command on tx timeout, to check whether module is dead
We don't necessarily want to reset the device on a TX timeout. But more
often than not, the real cause is that the firmware has crapped itself,
not just that the network is busy. So submit any harmless command, and
if _that_ times out, then the error handling code will reset the module,
as appropriate.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:46 -08:00
David Woodhouse 18c52e7c3e libertas: make lbs_submit_command always 'succeed' and set command timer
Even if it fails, we want to wait a while and try again, with an
ultimate timeout if it the condition persists. So again, just use the
standard command timeout behaviour.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:46 -08:00
David Woodhouse 8538823f7c 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>
2008-01-28 15:07:45 -08:00
David Woodhouse 7003b078c8 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>
2008-01-28 15:07:44 -08:00
David Woodhouse ac4cced6e8 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>
2008-01-28 15:07:44 -08:00
David Woodhouse 4694961cc2 libertas: Check for PS mode support on USB devices
Move the various firmware setup bits into a separate function, which
used to do just boot2 version.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:43 -08:00
David Woodhouse b2c57eee66 libertas: allow for PS mode to be disabled when firmware doesn't support it
Otherwise, we go into an endless busy loop trying to enable PS mode when
the command queue is empty, dealing with the error response, and then
trying to enable PS mode again because the command queue is empty.... it
doesn't really save much power.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:42 -08:00
David Woodhouse b47ef2438d 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>
2008-01-28 15:07:42 -08:00
David Woodhouse 24dba5f391 libertas: don't clear priv->dnld_sent after sending sleep confirm
DNLD_RES_RECEIVED is a bit of a misnomer -- we never wait for the result
to be received; it's purely representing the state of the TX path, and
in this case the TX path is definitely busy.

Of course, that means that we don't actually care about DATA_SENT vs.
CMD_SENT either, but that's a can of worms for another day...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:41 -08:00
David Woodhouse 38bfab1a01 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>
2008-01-28 15:07:40 -08:00
David Woodhouse c6ad3738c6 libertas: add SLEEP_PERIOD and FW_WAKE_METHOD command definitions
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:39 -08:00
David Woodhouse d1a469fd1b libertas: fix return from lbs_update_channel()
If we return the channel number in a 'ret' variable where anything
non-zero is later interpreted as an error, that isn't nice. It breaks
WPA, for a start. OLPC trac #5485

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:39 -08:00
David Woodhouse 681ffbb7d4 libertas: kill 'addtail' argument to lbs_queue_cmd() and make it static
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:38 -08:00
David Woodhouse 2a345099a4 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>
2008-01-28 15:07:37 -08:00
David Woodhouse 9fae899c2b libertas: ensure response buffer size is always set for lbs_cmd_with_response
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:37 -08:00
David Woodhouse 3399ea5f23 libertas: add __lbs_cmd_async() for asynchronous command submission
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:36 -08:00
David Woodhouse ae125bf827 libertas: store command result in cmdnode instead of priv->cur_cmd_retcode
... at least for users of __lbs_cmd().

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:35 -08:00
David Woodhouse 75567670c6 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>
2008-01-28 15:07:34 -08:00
David Woodhouse ad12d0f418 libertas: let __lbs_cmd() free its own cmdnode
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:34 -08:00
David Woodhouse 5ba2f8a021 libertas: kill cleanup_cmdnode()
Move the wakeup into lbs_complete_command(), and leave the other bits
in __lbs_cleanup_and_insert_cmd() which was the only caller now anyway.

There are two remaining direct callers of lbs_cleanup_and_insert_cmd(),
and they are both fine without the wakeup.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:33 -08:00
David Woodhouse ecfe9b487c libertas: don't re-initialise cmdnode when taking it off the free queue
We initialise it when we add it to the queue. No need to do it again.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:32 -08:00
David Woodhouse 183aeac1c4 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>
2008-01-28 15:07:31 -08:00
David Woodhouse c4ab41272b libertas: remove some pointless checks for cmdnode buffer being present
We allocate them all at the same time, at startup. If they go missing,
we have more serious things to worry about, and the resulting oops will
be a perfectly acceptable result.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:31 -08:00
David Woodhouse b23b2061e5 libertas: don't use __lbs_cmd() with empty callback in if_usb.c
We're about to change semantics, leaving callers of
lbs_prepare_and_send_command() with the old broken priv->cur_cmd_retcode
crap. The existence of the callback command will be the trigger for the
new semantics when handling the response.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:30 -08:00
David Woodhouse d9896ee147 libertas: rename and clean up DownloadcommandToStation
Call it lbs_submit_command(), remove a bunch of things which can be (or,
in the case of zeroing ->cmdwaitqwoken, already are) done elsewhere.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:29 -08:00
David Woodhouse 8e5b6b2d32 libertas: kill unused wait_option field in struct cmd_ctrl_node
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:28 -08:00
David Woodhouse 7e226272fc libertas: kill whitespace at end of lines
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:28 -08:00
David Woodhouse eae86bf378 libertas: clean up if_usb driver
It was just getting on my tits, really.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:27 -08:00
David Woodhouse b926d6b31e libertas: stop attempting to reset devices on unload
It wasn't working anyway -- by the time we get into if_usb_disconnect()
the USB core has already stopped us talking to the thing; even if it's
just on unload and the device still exists.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:26 -08:00
David Woodhouse d9f88705a7 libertas: don't exit worker thread until kthread_stop() is called
The kthread code can't cope with a thread exiting of its own accord and
then someone calling kthread_stop() for it. When the thread detects that
it needs to die, make it wait for kthread_stop() to be called.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:26 -08:00
Larry Finger 4ad36d780c b43legacy: Fix rfkill radio LED
This fixes Bug #9414 for b43legacy. This patch is the equivalent of one
submitted earlier for b43.

Since addition of the rfkill callback, the LED associated with the off
switch on the radio has not worked for several reasons:

(1) Essential data in the rfkill structure were missing.
(2) The rfkill structure was initialized after the LED initialization.
(3) There was a minor memory leak if the radio LED structure was inited.

Once the above problems were fixed, additional difficulties were noted:

(4) The radio LED was in the wrong state at startup.
(5) The radio switch had to be manipulated twice for each state change.
(6) A circular mutex locking situation existed.
(7) If rfkill-input is built as a module, it is not automatically loaded.

This patch fixes all of the above and removes a couple of sparse warnings.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Stefano Brivio <stefano.brivio@polimi.it>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:25 -08:00
Ramkrishna Vepa b7c5678f0b S2io: Fixes to enable multiple transmit fifos
Multiple transmit fifo initialization -
  - Assigned equal scheduling priority for all configured FIFO's.
  - Modularized transmit traffic interrupt initialization since it is executed in
    s2io_card_up and s2io_link. Enable continuous tx interrupt when link is UP
    and vice verse.
  - Enable transmit interrupts for all configured transmit fifos.
  - Fixed typo errors.

Signed-off-by: Surjit Reang <surjit.reang@neterion.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:24 -08:00
Surjit Reang 2fda096d18 S2io: Fixes to enable multiple transmit fifo support
Fixes to enable multiple transmit fifos (upto a maximum of eight).
  - Moved single tx_lock from struct s2io_nic to struct fifo_info.
  - Moved single ufo_in_band_v structure from struct s2io_nic to struct
    fifo_info.
  - Assign the respective interrupt number for the transmitting fifo in the
    transmit descriptor (TXD).
- Added boundary checks for number of FIFOs enabled and FIFO length.

Signed-off-by: Surjit Reang <surjit.reang@neterion.com>
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:07:23 -08:00
Divy Le Ray bc4b6b5269 cxgb3 - Fix EEH, missing softirq blocking
set_pci_drvdata() stores a pointer to the adapter,
not the net device.
Add missing softirq blocking in t3_mgmt_tx.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:22 -08:00
Divy Le Ray b881955b7d cxgb3 - parity initialization for T3C adapters.
Add parity initialization for T3C adapters.

Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:22 -08:00
Matthias Kaehlcke 01f31ac828 PLIP driver: convert the semaphore killed_timer_sem to completion
Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:20 -08:00
Lee Schermerhorn 07b270eab5 bnx2x depends on ZLIB_INFLATE
The bnx2x module depends on the zlib_inflate functions.  The build will
fail if ZLIB_INFLATE has not been selected manually or by building another
module that automatically selects it.

Modify BNX2X config option to 'select ZLIB_INFLATE' like BNX2
and others.  This seems to fix it.

Signed-off-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Acked-by: Eliezer Tamir <eliezert@broadcom.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:20 -08:00
Robert P. J. Day 9329f4e4d2 pcmcia net: use roundup_pow_of_two() macro instead of grotesque loop
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:19 -08:00
Auke Kok 67b3c27c8a e1000: Dump the eeprom when a user encounters a bad checksum
To help supporting users with a bad eeprom checksum, dump the
eeprom info when such a situation is encountered by a user.

Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:18 -08:00
Matheos Worku 8b32e63d48 ixgb: enable sun hardware support for broadcom phy
Implement support for a SUN-specific PHY.

SUN provides a modified 82597-based board with their own
PHY that works with very little modification to the code. This
patch implements this new PHY which is identified by the
subvendor device ID. The device ID of the adapter remains
the same.

Signed-off-by: Matheos Worku <matheos.worku@sun.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:17 -08:00
Adrian Bunk 67cefcbafc e1000: remove no longer used code for pci read/write cfg
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:17 -08:00
Al Viro a7df90a519 ixgb endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:16 -08:00
Al Viro 8327d000e0 ixgbe endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:15 -08:00
Al Viro aaf918ba8c e100 endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:15 -08:00
Al Viro 5bb7ea2614 forcedeth endianness bugs
* misannotation: struct register_test members are actually host-endian
* bug: cpu_to_le64(n) >> 32 instead of cpu_to_le32(n >> 32) in setting
->bufhigh and similar for ->buflow (take low bits, _then_ convert to
little-endian, not the other way round).
* bug: setup_hw_rings() should not convert to little-endian at all (we
feed the result to writel(), not store in shared data structure), let
alone try to play with shifting and masking little-endian values.  Introduced
when setup_hw_rings() went in, screwed both 64bit case and the old code for
32bit rings it had replaced.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:13 -08:00
Al Viro 79ea13ce07 NULL noise in drivers/net
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 15:07:12 -08:00
Al Viro 3e18826c73 e1000 endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:11 -08:00
Al Viro a39fe742e7 e1000e endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:11 -08:00
Al Viro 439104b3a3 sungem endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:10 -08:00
Al Viro f3ec33e587 sunhme endianness annotations
This one is interesting - SBUS and PCI variants have
opposite endianness in descriptors (SBUS is sparc-only, so there
host-endian == big-endian).

	Solution: declare a bitwise type (hme32) and in accessor
helpers do typechecking and force-casts (once we know that the
type is right).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:09 -08:00
Al Viro b710b43c30 endianness annotations and fixes for olympic
* missing braces in !readl(...) & ...
	* trivial endianness annotations
	* in olympic_arb_cmd() the loop collecting fragments of
packet is b0rken on big-endian - we have
	(next_ptr && (buf_ptr=olympic_priv->olympic_lap + ntohs(next_ptr)))
as condition and it should have swab16(), not ntohs() - it's host-endian
byteswapped, not big-endian.  So if we get more than one fragment on big-endian
host, we get screwed.
	This ntohs() got missed back when the rest of those had been switched
to swab16() in 2.4.0-test2-pre1 - at a guess, nobody had hit fragmented
packets during the testing of PPC fixes.

PS: Ken Aaker cc'd on assumption that he is the same guy who'd done the
original set of PPC fixes in olympic

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-01-28 15:07:08 -08:00
David Woodhouse f5a3ea6f96 libertas: use spin_is_locked() instead of spin_trylock() in lbs_interrupt()
We get scary warnings on UP if we use spin_trylock() and find, as we
hoped, that the lock in question is already locked.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:08 -08:00
David Woodhouse 860621347e libertas: pass channel argument directly to lbs_mesh_config()
There is weirdness here; the firmware seems to refuse to change channels
at will.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:07 -08:00
David Woodhouse 020f3d0001 libertas: cope with both old and new mesh TLV values
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:06 -08:00
David Woodhouse 9f4625776f libertas: make lbs_update_channel() function non-static
We'll want to use this for meshfrobbing

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:06 -08:00
David Woodhouse 506e9025e0 libertas: add ethtool support for wake-on-lan configuration
Also, check that suspend is refused if HOST_SLEEP_CFG hasn't been done.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:05 -08:00
David Woodhouse d1f7a5b8cf libertas: implement suspend/resume for USB devices
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:04 -08:00
David Woodhouse ab25ecaea5 libertas: implement suspend and resume core methods
We (ab)use priv->fw_ready to stop the worker thread from sending more
commands or data after the response to the HOST_SLEEP_ACTIVATE command
comes in. And we set it from the callback function _directly_ to ensure
that the worker thread sees it immediately; if we did it in
lbs_suspend() after waking up, that might be too late.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:03 -08:00
David Woodhouse f3db2bb411 libertas: make worker thread not freezable
We want it to send the HOST_SLEEP_ACTIVATE command on the way down...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:03 -08:00
David Woodhouse 689442dca1 libertas: switch lbs_cmd() to take a _pointer_ to the command structure
This way, it looks more like a normal function.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28 15:07:02 -08:00
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