David Woodhouse [Mon, 17 Dec 2007 17:35:28 +0000 (12:35 -0500)]
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>
David Woodhouse [Mon, 17 Dec 2007 04:26:54 +0000 (23:26 -0500)]
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>
David Woodhouse [Sun, 16 Dec 2007 22:21:00 +0000 (17:21 -0500)]
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>
David Woodhouse [Sat, 15 Dec 2007 05:41:51 +0000 (00:41 -0500)]
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>
David Woodhouse [Sat, 15 Dec 2007 06:22:09 +0000 (01:22 -0500)]
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>
David Woodhouse [Fri, 14 Dec 2007 02:53:16 +0000 (21:53 -0500)]
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>
David Woodhouse [Fri, 14 Dec 2007 02:48:00 +0000 (21:48 -0500)]
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>
Larry Finger [Sun, 16 Dec 2007 18:21:06 +0000 (19:21 +0100)]
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>
Ramkrishna Vepa [Mon, 17 Dec 2007 19:40:15 +0000 (11:40 -0800)]
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.
Surjit Reang [Thu, 24 Jan 2008 10:08:59 +0000 (02:08 -0800)]
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>
Lee Schermerhorn [Fri, 14 Dec 2007 00:02:59 +0000 (16:02 -0800)]
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>
Robert P. J. Day [Fri, 14 Dec 2007 00:02:55 +0000 (16:02 -0800)]
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>
Matheos Worku [Fri, 14 Dec 2007 19:48:36 +0000 (11:48 -0800)]
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.
Al Viro [Sun, 9 Dec 2007 16:06:41 +0000 (16:06 +0000)]
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>
Al Viro [Sun, 16 Dec 2007 20:53:36 +0000 (20:53 +0000)]
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>
David Woodhouse [Wed, 12 Dec 2007 22:38:56 +0000 (17:38 -0500)]
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>
David Woodhouse [Wed, 12 Dec 2007 04:42:49 +0000 (23:42 -0500)]
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>
Dan Williams [Tue, 11 Dec 2007 22:35:51 +0000 (17:35 -0500)]
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>
Dan Williams [Tue, 11 Dec 2007 21:54:15 +0000 (16:54 -0500)]
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>
Dan Williams [Tue, 11 Dec 2007 20:50:59 +0000 (15:50 -0500)]
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>
Dan Williams [Tue, 11 Dec 2007 20:29:10 +0000 (15:29 -0500)]
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>
David Woodhouse [Tue, 11 Dec 2007 20:28:18 +0000 (15:28 -0500)]
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>
Dan Williams [Tue, 11 Dec 2007 18:49:39 +0000 (13:49 -0500)]
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>
Dan Williams [Tue, 11 Dec 2007 17:42:16 +0000 (12:42 -0500)]
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>
Dan Williams [Tue, 11 Dec 2007 17:40:35 +0000 (12:40 -0500)]
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>
Dan Williams [Tue, 11 Dec 2007 17:33:30 +0000 (12:33 -0500)]
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>
David Woodhouse [Tue, 11 Dec 2007 05:07:58 +0000 (00:07 -0500)]
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>
David Woodhouse [Mon, 10 Dec 2007 23:53:34 +0000 (18:53 -0500)]
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>
Dan Williams [Mon, 10 Dec 2007 20:24:47 +0000 (15:24 -0500)]
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>
Dan Williams [Mon, 10 Dec 2007 20:11:23 +0000 (15:11 -0500)]
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>
David Woodhouse [Mon, 10 Dec 2007 19:58:37 +0000 (14:58 -0500)]
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>
Holger Schurig [Mon, 10 Dec 2007 11:19:55 +0000 (12:19 +0100)]
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>