summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/cmd.h
Commit message (Collapse)AuthorAgeFilesLines
* libertas: fix handling of command timeout, completion and interruptionDaniel Drake2011-07-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When commands time out, corruption ensues. As lbs_complete_command() is called without locking, the command node is mistakenly freed twice. Also fixed up locking here in a few other places. The nature of command timeout may be that the card didn't even acknowledge receipt of the request. Detect this case and reset dnld_sent so that other commands don't hang forever. When cmdnodes are moved between the free list and the pending list, their list heads should be reinitialized. Fixed this. Sometimes commands are completed without actually submitting them or removing them from cmdpendingq. We must remember to remove them from cmdpendingq in these cases, so handle this in lbs_complete_command(). Harmless signals generated during suspend/resume were interrupting lbs_cmd. Convert to an uninterruptible sleep to avoid this. lbs_thread must be woken up every time there is some new work to do. I found that when 2 commands are queued, ther completion of the first command would not wake up lbs_thread to submit the second. Poke lbs_thread at the end of lbs_complete_command() to fix this. Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: kill unused lbs_prepare_and_send_command()Dan Williams2010-07-271-5/+0
| | | | | | | Remove last bits of indirect command code. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: convert PS_MODE to a direct commandDan Williams2010-07-271-4/+2
| | | | | | | | | | Powersave looks like it got broken at some point but we'll fix that up when the command submission stuff is more understandable, which this series helps to do. That said, this patch should not further break powersave. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: convert register access to direct commandsDan Williams2010-07-271-0/+4
| | | | | Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: convert 11D_DOMAIN_INFO to a direct commandDan Williams2010-07-271-0/+6
| | | | | Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: clean up RSSI commandDan Williams2010-07-271-0/+2
| | | | | | | | | Convert to a full direct command; previous code rolled a direct command by hand but left the original indirect command code intact but disabled. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: clean up MONITOR_MODE commandDan Williams2010-07-271-0/+2
| | | | | | | | | Convert to a full direct command; previous code rolled a direct command by handle but left the original indirect command code lying around. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: Added support for host sleep featureAmitkumar Karwar2010-07-121-0/+2
| | | | | | | | | | | | | Existing "ethtool -s ethX wol X" command configures hostsleep parameters, but those are activated only during suspend/resume, there is no way to configure host sleep without actual suspend. This patch adds debugfs command to enable/disable host sleep based on already configured host sleep parameters using wol command. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kiran Divekar <dkiran@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: move mesh-related definitions into mesh.hHolger Schurig2009-12-221-12/+0
| | | | | Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: move association related commands into assoc.cHolger Schurig2009-10-271-9/+0
| | | | | | | | | | That's because the new cfg80211 implementation will provide cleaner implementations. No functional changes. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: remove unused lbs_cmd_802_11_inactivity_timeout()Holger Schurig2009-10-271-3/+0
| | | | | | 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>
* libertas: make lbs_get_channel() staticHolger Schurig2009-10-271-2/+0
| | | | | | 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>
* libertas: harmonize cmd.hHolger Schurig2009-10-271-28/+92
| | | | | | | | | | * move declarations for functions of cmd.c/cmdresp.c into cmd.h * move declarations from cmd.h that are in main.c to decl.h * group command functions Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: cleanup host.h and hostcmd.hHolger Schurig2009-10-271-1/+1
| | | | | | | | Also remove some unused definitions and make tab usage consistent. 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>
* libertas: make __lbs_cmd_async() non-staticHolger Schurig2009-10-271-0/+5
| | | | | | | This function will be needed for the cfg80211-enabled libertas driver. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: Fine grained configuration of wake-on-lan.Anna Neal2008-11-211-1/+2
| | | | | | | | | | | | | | | Based on a patch from Shailendra Govardhan <shailen@marvell.com>. This patch allows implementation of more specific wake-on-lan rules than those of ethtool. Please note that only firmware 5.110.22.p20 and above supports this feature. This patch only implements the driver/firmware interface, not the userspace/driver interface. Signed-off-by: Anna Neal <anna@cozybit.com> Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: Improvements on automatic tx power control via SIOCSIWTXPOW (fixups)Anna Neal2008-09-301-0/+6
| | | | | | | | | | | This patch addresses comments from Dan Williams about the patch committed as "libertas: Improvements on automatic tx power control via SIOCSIWTXPOW." Signed-off-by: Anna Neal <anna@cozybit.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>
* libertas: convert SNMP_MIB to a direct commandDan Williams2008-09-151-0/+4
| | | | | | | And support setting both long and short retries independently. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: Improvements on automatic tx power control via SIOCSIWTXPOW.Anna Neal2008-09-111-0/+6
| | | | | | | | | | | | iwconfig txpower can now be used to set tx power to fixed or auto. If set to auto the default firmware settings are used. The command CMD_802_11_PA_CFG is only sent to older firmware, as Dan Williams noted the command was no longer supported in firmware V9+. Signed-off-by: Anna Neal <anna@cozybit.com> Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: convert CMD_802_11_RADIO_CONTROL to a direct commandDan Williams2008-08-291-0/+2
| | | | | | | | and return errors for operations like join & scan that aren't possible when the radio is turned off. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: convert CMD_802_11_RF_TX_POWER to a direct commandDan Williams2008-08-291-0/+4
| | | | | | | | And while we're at it, grab min/max TX power from the firmware and use that to validate incoming TX power requests from WEXT. Signed-off-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: rate adaptation configuration via iwconfig.Javier Cardona2008-06-031-0/+2
| | | | | | | | | | | | | Implemented rate adaptation support via 'iwconfig rate' API. It is now possible to specify a bit-rate value and append 'auto'. That will configure rate adaptation to use all bit-rates equal or lower than than selected value. Made lbs_cmd_802_11_rate_adapt_rateset a direct command. Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: Extend MESH_CONFIG command to access non-volatile configurationJavier Cardona2008-05-211-0/+3
| | | | | | | | | | | | | | | This patch is based on a patch from Shailendra Govardhan and Brian Cavagnolo. It extends the MESH_CONFIG command to configure non-volatile parameters on libertas devices that support them (e.g. OLPC Active Antenna). This patch only implements the driver/firmware interface. See http://dev.laptop.org/ticket/6823 for minimal testing results and known issues. Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: remove lbs_get_data_rate()Holger Schurig2008-05-141-1/+0
| | | | | | | lbs_get_data_rate() gets called, but no-one uses it's result. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: make some functions voidHolger Schurig2008-05-071-1/+1
| | | | | | | | They don't return anything meaningfull and no-one cares about their results. 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>
* libertas: make a handy lbs_cmd_async() commandHolger Schurig2008-03-251-6/+3
| | | | | | | | | | | | | | This uses a static lbs_cmd_async_callback function, which is a noop. Just setting the callback argument to __lbs_cmd_async() to NULL won't work, because then the cmdnode wouldn't be released. This also makes __lbs_cmd_async() a static method, which is now only used by lbs_cmd() and lbs_cmd_async(). 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>
* libertas: convert KEY_MATERIAL to a direct commandDavid Woodhouse2008-03-061-0/+2
| | | | | | | | The struct enc_key probably wants to die too, but that can come later. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: change inference about buffer size in lbs_cmd()David Woodhouse2008-01-281-6/+8
| | | | | | | | | | | | 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>
* libertas: convert ENABLE_RSN to a direct commandDavid Woodhouse2008-01-281-0/+2
| | | | | Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: convert SET_WEP to a direct commandDavid Woodhouse2008-01-281-0/+2
| | | | | Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: convert SLEEP_PARAMS to a direct commandDavid Woodhouse2008-01-281-0/+2
| | | | | Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: convert INACTIVITY_TIMEOUT to a direct commandDavid Woodhouse2008-01-281-0/+3
| | | | | Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: ensure response buffer size is always set for lbs_cmd_with_responseDavid Woodhouse2008-01-281-0/+4
| | | | | Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: add __lbs_cmd_async() for asynchronous command submissionDavid Woodhouse2008-01-281-0/+6
| | | | | Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: kill whitespace at end of linesDavid Woodhouse2008-01-281-2/+2
| | | | | Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: pass channel argument directly to lbs_mesh_config()David Woodhouse2008-01-281-1/+1
| | | | | | | | 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>
* libertas: add ethtool support for wake-on-lan configurationDavid Woodhouse2008-01-281-2/+1
| | | | | | | 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>
* libertas: implement suspend and resume core methodsDavid Woodhouse2008-01-281-0/+2
| | | | | | | | | | | 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>
* libertas: switch lbs_cmd() to take a _pointer_ to the command structureDavid Woodhouse2008-01-281-6/+4
| | | | | | | 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>
* libertas: add lbs_host_sleep_cfg() command functionDavid Woodhouse2008-01-281-0/+3
| | | | | Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: add lbs_mesh sysfs attribute for enabling meshDavid Woodhouse2008-01-281-0/+2
| | | | | Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: convert RF_CHANNEL to a direct commandDan Williams2008-01-281-0/+3
| | | | | | 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>
* libertas: convert DATA_RATE to a direct commandDan Williams2008-01-281-0/+3
| | | | | | 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>
* libertas: remove casts from lbs_cmd() and lbs_cmd_with_response() macrosDavid Woodhouse2008-01-281-2/+2
| | | | | | | | | | 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>
* libertas: convert CMD_MESH_ACCESS to a direct commandDavid Woodhouse2008-01-281-0/+3
| | | | | Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* libertas: convert GET_HW_SPEC to a direct commandDan Williams2008-01-281-0/+2
| | | | | | 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>
* libertas: add simple copyback command callbackDan Williams2008-01-281-0/+7
| | | | | | | | | | | 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>
* libertas: clean up direct command handlingDan Williams2008-01-281-3/+5
| | | | | | | | | | | 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>
* libertas: make lbs_cmd() usage nicerDan Williams2008-01-281-0/+16
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>
OpenPOWER on IntegriCloud