aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/libertas/main.c
AgeCommit message (Collapse)Author
2008-02-28libertas: Remove unused exportsRoland Dreier
The libertas driver exports a number of symbols with no in-tree users; remove these unused exports. lbs_reset_device() is completely unused, with no callers at all, so remove the function completely. A couple of these unused exported symbols are static, which causes the following build error on ia64 with gcc 4.2.3: drivers/net/wireless/libertas/main.c:1375: error: __ksymtab_lbs_remove_mesh causes a section type conflict drivers/net/wireless/libertas/main.c:1354: error: __ksymtab_lbs_add_mesh causes a section type conflict Signed-off-by: Roland Dreier <rolandd@cisco.com> Acked-by: Holger Schurig <hs4233@mail.mn-solutions.de> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: pepper main with debug statementHolger Schurig
libertas: re-pepper debug statementThe recent fluff of updates didn't put proper lbs_deb_enter/leave calls into the source code. Add them where appropriate. Also contains some whitespace changes. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: don't blindly try meshHolger Schurig
The CF card only has a very old firmware (5.0.16p0). This firmware doesn't know anything about mesh config. However, current code blindly calls mesh_config when the card is inserted. So check the firmware version before issuing this command. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: remove check for driver_lock in lbs_interrupt()David Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: submit RSSI command on tx timeout, to check whether module is deadDavid Woodhouse
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-28libertas: handle command timeout in main thread instead of directly in timerDavid Woodhouse
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-28libertas: store command result in cmdnode instead of priv->cur_cmd_retcodeDavid Woodhouse
... 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-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: don't exit worker thread until kthread_stop() is calledDavid Woodhouse
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-28libertas: use spin_is_locked() instead of spin_trylock() in lbs_interrupt()David Woodhouse
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-28libertas: pass channel argument directly to lbs_mesh_config()David Woodhouse
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-28libertas: cope with both old and new mesh TLV valuesDavid Woodhouse
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 and resume core methodsDavid Woodhouse
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-28libertas: make worker thread not freezableDavid Woodhouse
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-28libertas: slight cleanup of netif queue stop/wakeDavid Woodhouse
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-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 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 DATA_RATE to a direct commandDan Williams
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: 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: move removal of lbs_rtap file to lbs_stop_card()David Woodhouse
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-28libertas: convert GET_HW_SPEC to a direct commandDan Williams
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: don't run thread while firmware not yet readyDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: make rtap and normal modes mutually exclusive, clean up open/stopDavid Woodhouse
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: remove pre_open_check()David Woodhouse
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-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: Move actual transmission to main threadDavid Woodhouse
The locking issues with TX, especially TX from multiple netdevs, get _so_ much easier if you do it like this. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: refactor the 'should I sleep?' decision in lbs_thread()David Woodhouse
This was making my brain hurt. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: set dev_addr on rtap deviceDavid Woodhouse
This lets us bring it up, because eth_validate_addr() succeeds instead of returning -EINVAL. And finally monitor mode seems to (mostly) work. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: stop using ieee80211 for radiotap deviceDavid Woodhouse
There seems to be no point in doing it as an ieee80211 device instead of a normal netdev, and when we override its ->priv and then call free_ieee80211() it has a distressing tendency to crash horribly. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: kill lbs_pre_start_xmit(), lib_mesh_pre_start_xmit()David Woodhouse
These wrappers only do two things. Firstly, they set the frame type, which isn't necessary since lbs_hard_start_xmit() gets to see which device it belongs to anyway. Secondly, they return -EOPNOTSUPP if the device is in monitor mode. Which is a strange thing to do and will provide nasty warnings from qdisc_restart(). And lbs_hard_start_xmit() seems to have code to cope with monitor mode anyway. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: move lbs_hard_start_xmit() into tx.cDavid Woodhouse
... where it can shortly be merged with lbs_process_tx()... Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: kill internal tx queue for PS modeDavid Woodhouse
It was buggy as hell anyway, since it was just spewing packets at the device when it wasn't necessarily ready for them (in the USB case, while the URB was still busy). We could probably do with a better way of flushing packets to the device _immediately_, before we stick it back into sleep mode. But we can no longer just dequeue packets directly, it seems. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: use lbs_host_to_card_done() in lbs_tx_timeout()David Woodhouse
Also attempt some locking in lbs_host_to_card_done() Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-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: kill TxLockFlagDavid Woodhouse
We don't need this. We can use adapter->currenttxskb instead. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: fix lbs_rtap attribute in sysfsDavid Woodhouse
At least it doesn't oops when you attempt to read or write it now. Only when you enable it and then later turn it off. And when it's enabled I don't see how it actually works. But one fewer oops is good, for now... Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: clean up lbs_thread() to make it slightly more readableDavid Woodhouse
No semantic changes. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-28libertas: kill adapter->nr_cmd_pendingDavid 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: tweak tx path debuggingHolger Schurig
Make two functions in the TX packet path emit their debug messages with LBS_DEB_TX, not LBS_DEB_MAIN. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2008-01-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: mark module_init/exit functions as __init/__exitAndres Salomon
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: move to uniform lbs_/LBS_ namespaceHolger Schurig
This patch unifies the namespace of variables, functions defines and structures. It does: - rename libertas_XXX to lbs_XXX - rename LIBERTAS_XXX to lbs_XXX - rename wlan_XXX to lbs_XXX - rename WLAN_XXX to LBS_XXX (but only those that were defined in libertas-local *.h files, e.g. not defines from net/ieee80211.h) While passing, I fixed some checkpatch.pl errors too. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2007-11-29libertas: Don't set NETIF_F_IPV6_CSUM in dev->featuresDavid Woodhouse
I'm not sure why it was doing this, and I'm not sure I _want_ to know why. But calling it NETIF_F_DYNALLOC doesn't change the fact that the kernel believes it to be NETIF_F_IPV6_CSUM, and that IPv6 communication is hence buggered. Signed-off-by: David Woodhouse <dwmw2@infradead.org> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>