aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/libertas/if_usb.c
AgeCommit message (Collapse)Author
2009-01-22MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-MERGE-via-mokopatc ↵merge
hes-tracking-fix-stray-endmenu-patch-1232632040-1232632141 pending-tracking-hist top was MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141 / fdf777a63bcb59e0dfd78bfe2c6242e01f6d4eb9 ... parent commitmessage: From: merge <null@invalid> MERGE-via-stable-tracking-hist-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 stable-tracking-hist top was MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 / 90463bfd2d5a3c8b52f6e6d71024a00e052b0ced ... parent commitmessage: From: merge <null@invalid> MERGE-via-mokopatches-tracking-hist-fix-stray-endmenu-patch mokopatches-tracking-hist top was fix-stray-endmenu-patch / 3630e0be570de8057e7f8d2fe501ed353cdf34e6 ... parent commitmessage: From: Andy Green <andy@openmoko.com> fix-stray-endmenu.patch Signed-off-by: Andy Green <andy@openmoko.com>
2008-09-15libertas: remove unused generic RESET commandDan Williams
The generic reset command is unused. Each interface type needs to handle the reset command differently since after reset, the firmware is dead and interface-specific mechanisms must be used to reinitialize the card. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-08-22libertas: add sysfs hooks to update boot2 and persistent firmwareBrian Cavagnolo
To use these features, copy the boot2 and firmware images to /lib/firmware and: echo <boot2_image_name> > /sys/class/net/ethX/lbs_flash_boot2 echo <firmware_image_name> > /sys/class/net/ethX/lbs_flash_fw Signed-off-by: Brian Cavagnolo <brian@cozybit.com> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-08-22libertas: support boot commands to write persistent firmware and bootloaderBrian Cavagnolo
Add locking and non-locking versions of if_usb_prog_firmware to support programming firmware after and before driver bring-up respectively. Add more suitable error codes for firmware programming process. Add capability checks for persistent features before attempting to use them. Based on patches from Brajesh Dave and Priyank Singh. Signed-off-by: Brian Cavagnolo <brian@cozybit.com> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-07-18Merge branch 'master' of ↵David S. Miller
master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 Conflicts: Documentation/powerpc/booting-without-of.txt drivers/atm/Makefile drivers/net/fs_enet/fs_enet-main.c drivers/pci/pci-acpi.c net/8021q/vlan.c net/iucv/iucv.c
2008-07-10libertas: treat firmware data as constDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
2008-07-05Merge branch 'master' of ↵David S. Miller
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: Documentation/feature-removal-schedule.txt drivers/net/wan/hdlc_fr.c drivers/net/wireless/iwlwifi/iwl-4965.c drivers/net/wireless/iwlwifi/iwl3945-base.c
2008-07-02libertas: support USB persistence on suspend/resume (resend)andrey@cozybit.com
Handle .reset_resume() so that libertas can survive suspend/resume without reloading the firmware. Signed-off-by: Andrey Yurovsky <andrey@cozybit.com> Acked-by: Deepak Saxena <dsaxena@laptop.org> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-06-03libertas: provide reset_card() callback on OLPCDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-04-16libertas: convert libertas driver to use an event/cmdresp queueHolger Schurig
This patch (co-developed by Dan Williams and Holger Schurig) uses a kfifo object for events and a swapping buffer scheme for the command response to preserve the zero-copy semantics of the CF driver and keep memory usage low. The main thread should only ever touch the buffer indexed by priv->resp_idx, while the interface code is free to write to the second buffer, then swap priv->resp_idx under the driver spinlock. The firmware specs only permit one in-flight command, so there will only ever be one command response to process at a time. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: move cardspecific data to driverHolger Schurig
boot2_version is purely USB specific, so move it to struct if_usb_card. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: use priv->upld_buf for command responsesDavid Woodhouse
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-28libertas: Check for PS mode support on USB devicesDavid Woodhouse
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-28libertas: ensure response buffer size is always set for lbs_cmd_with_responseDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: don't use __lbs_cmd() with empty callback in if_usb.cDavid Woodhouse
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-28libertas: kill whitespace at end of linesDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: clean up if_usb driverDavid Woodhouse
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-28libertas: stop attempting to reset devices on unloadDavid Woodhouse
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-28libertas: add ethtool support for wake-on-lan configurationDavid Woodhouse
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-28libertas: implement suspend/resume for USB devicesDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: switch lbs_cmd() to take a _pointer_ to the command structureDavid Woodhouse
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-28libertas: add missing newlines in debugging statementsDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: be more careful about command responses matching cur_cmdDavid Woodhouse
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-28libertas: kill rx_urb_recall and eth_dev members of struct usb_card_recDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: kill references to mesh autostartDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: add lbs_mesh sysfs attribute for enabling meshDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: make some more functions staticDavid Woodhouse
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-28libertas: convert CMD_MESH_ACCESS to a direct commandDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: rename and re-type bufvirtualaddr to cmdbufDan Williams
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-28libertas: wait for 'firmware ready' event from firmware after loadingDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: switch USB cardp->priv to 'struct lbs_private *' and resulting fixDavid Woodhouse
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-28libertas: switch to a waitqueue and timer for handling USB firmware loadDavid Woodhouse
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-28libertas: improve reliability of firmware reloading on USBDavid Woodhouse
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-28libertas: make lbs_cmd() usage nicerDan Williams
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-28libertas: clean up lbs_interrupt()David Woodhouse
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-28libertas: add opaque extra argument to cmd callback functionDavid Woodhouse
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-28libertas: cope with device which already has firmware loadedDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: kill struct lbs_adapterDavid Woodhouse
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-28libertas: switch lbs_cmd() to take a callback function pointerDavid Woodhouse
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-28libertas: endianness fixesHolger Schurig
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-28libertas: when usb_submit_usb fails, include the error code in the printkDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: Fix endianness in boot2_version handling.David Woodhouse
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-28libertas: Use lbs_cmd() for setting Boot2 versionDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: Move SET_BOOT2_VER command to if_usb where it belongsDavid Woodhouse
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-28libertas: Consolidate lbs_host_to_card_done() function.David Woodhouse
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-28libertas: Fix memory leak of RX skbsDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: remove arbitrary typedefsHolger Schurig
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-28libertas: separate mesh connectivity from that of the main interfaceBrajesh Dave
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-28libertas: nuke useless variable usbdriver_name and useless commentsAndres Salomon
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-28libertas: reset devices upon disconnect rather than module unloadingAndres Salomon
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>