summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/hso.c
Commit message (Collapse)AuthorAgeFilesLines
* net: fix network drivers ndo_start_xmit() return values (part 8)Patrick McHardy2009-06-131-1/+1
| | | | | | | | | | | | | | Fix up USB drivers that return an errno value (result of usb_submit_urb()) to qdisc_restart(), causing qdisc_restart() to print a warning and requeue/ retransmit the skb. - hso: skb is freed: use after free - at76_usb: skb is freed: use after free Compile tested only. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* hso: convert dev_alloc_skb() to netdev_alloc_skb()Paulius Zaleckas2009-06-081-3/+2
| | | | | Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt> Signed-off-by: David S. Miller <davem@davemloft.net>
* rfkill: rewriteJohannes Berg2009-06-031-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch completely rewrites the rfkill core to address the following deficiencies: * all rfkill drivers need to implement polling where necessary rather than having one central implementation * updating the rfkill state cannot be done from arbitrary contexts, forcing drivers to use schedule_work and requiring lots of code * rfkill drivers need to keep track of soft/hard blocked internally -- the core should do this * the rfkill API has many unexpected quirks, for example being asymmetric wrt. alloc/free and register/unregister * rfkill can call back into a driver from within a function the driver called -- this is prone to deadlocks and generally should be avoided * rfkill-input pointlessly is a separate module * drivers need to #ifdef rfkill functions (unless they want to depend on or select RFKILL) -- rfkill should provide inlines that do nothing if it isn't compiled in * the rfkill structure is not opaque -- drivers need to initialise it correctly (lots of sanity checking code required) -- instead force drivers to pass the right variables to rfkill_alloc() * the documentation is hard to read because it always assumes the reader is completely clueless and contains way TOO MANY CAPS * the rfkill code needlessly uses a lot of locks and atomic operations in locked sections * fix LED trigger to actually change the LED when the radio state changes -- this wasn't done before Tested-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> [thinkpad] Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* net: remove driver_data direct access of struct deviceGreg Kroah-Hartman2009-05-011-2/+2
| | | | | | | | | | | | In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: netdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* rfkill: remove deprecated state constantsJohannes Berg2009-04-221-2/+2
| | | | | | | | | | | I only did superficial review, but these constants are stupid to have and without proper warnings nobody will review the code anyway, no amount of shouting will help. Also fix wimax to use correct states. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* hso: fix for the 'invalid frame length' messagesJan Dumon2009-04-021-4/+6
| | | | | | | | | | Some devices cannot send very short usb transfers. To get around this the firmware adds a known pattern and flags the driver that it should check for this pattern on short transfers. This flag was not taken into account by the driver. Signed-off-by: Jan Dumon <j.dumon@option.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hso: fix for crash when unplugging the deviceJan Dumon2009-04-021-8/+11
| | | | | | | | Changed the order in which things are freed. This fixes an oops when unplugging the device while network traffic is ongoing. Signed-off-by: Jan Dumon <j.dumon@option.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hso: add Vendor/Product ID's for new devicesJan Dumon2009-04-021-2/+9
| | | | | | | | | Add Vendor/Product ID's for new devices. Removed duplicate product ID 0x7361. Signed-off-by: Jan Dumon <j.dumon@option.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* usbnet: convert hso driver to net_device_opsStephen Hemminger2009-03-211-4/+8
| | | | | Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hso: remove hso_free_device()Paulius Zaleckas2009-02-261-10/+4
| | | | | | | | There is really no need for function just doing simple kfree() Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt> Cc: Denis Joseph Barrow <D.Barow@option.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hso: remove claiming and releasing of USB interfacePaulius Zaleckas2009-02-261-4/+0
| | | | | | | | | | | | No need to reclaim the same USB interface beeing probed. Releasing interface does nothing also. This is already in for a long time in off-kernel hso driver and no regresions were noticed for this change. Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt> Cc: Denis Joseph Barrow <D.Barow@option.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net/usb: fix sparse warnings: Should it be static?Hannes Eder2009-02-171-5/+5
| | | | | | | | | | | | | Impact: Make symbols static. Fix this sparse warnings: drivers/net/usb/hso.c:1249:6: warning: symbol 'hso_unthrottle_tasklet' was not declared. Should it be static? drivers/net/usb/hso.c:1268:6: warning: symbol 'hso_unthrottle_workfunc' was not declared. Should it be static? drivers/net/usb/hso.c:1466:5: warning: symbol 'tiocmget_submit_urb' was not declared. Should it be static? drivers/net/usb/smsc95xx.c:62:5: warning: symbol 'turbo_mode' was not declared. Should it be static? Signed-off-by: Hannes Eder <hannes@hanneseder.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of /home/davem/src/GIT/linux-2.6/David S. Miller2009-02-041-1/+3
|\
| * hso: add new device id'sFilip Aben2009-02-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | This patch adds a few device ID's. It also removes an ID that was used in an internal engineering version of a device and will never see commercial light. Even if this ID will be 'recycled' in the future, which is very unlikely, we don't know what kind of device will be behind it. Therefore it's safer to remove it. Signed-off-by: Filip Aben <f.aben@option.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: replace uses of __constant_{endian}Harvey Harrison2009-02-011-2/+1
|/ | | | | | | Base versions handle constant folding now. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6Linus Torvalds2009-01-151-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (95 commits) b44: GFP_DMA skb should not escape from driver korina: do not use IRQF_SHARED with IRQF_DISABLED korina: do not stop queue here korina: fix handling tx_chain_tail korina: do tx at the right position korina: do schedule napi after testing for it korina: rework korina_rx() for use with napi korina: disable napi on close and restart korina: reset resource buffer size to 1536 korina: fix usage of driver_data bnx2x: First slow path interrupt race bnx2x: MTU Filter bnx2x: Indirection table initialization index bnx2x: Missing brackets bnx2x: Fixing the doorbell size bnx2x: Endianness issues bnx2x: VLAN tagged packets without VLAN offload bnx2x: Protecting the link change indication bnx2x: Flow control updated before reporting the link bnx2x: Missing mask when calculating flow control ...
| * hso: driver fix for big endian machines.Denis Joseph Barrow2009-01-121-2/+2
| | | | | | | | | | | | | | Filip Aben says this fix is neccessary for big endian machines. Signed-off-by: Denis Joseph Barrow <D.Barow@option.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | hso serial throttled tty kref fix.Denis Joseph Barrow2009-01-151-1/+3
| | | | | | | | | | | | | | | | | | This patch is for Alan Cox as it related to the tty layer. Hopefully the hso driver is again relatively stable with this fix. Signed-off-by: Denis Joseph Barrow <D.Barow@option.com> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | tty: Fix double grabbing of a spinlockDenis Joseph Barrow2009-01-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | The HSO changes for kref introduced a recursive spinlock take. All functions which call put_rxbuf_data already have serial->serial_lock grabbed. [Comment to code added-AC] Signed-off-by: Denis Joseph Barrow <D.Barrow@option.com> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* | tty: Fix a kref leak in the HSO driver on re-openAlan Cox2009-01-151-0/+1
|/ | | | Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* hso maintainers update patchDenis Joseph Barrow2009-01-021-0/+2
| | | | | | | | Added D.J. Barrow as maintainer of hso driver. Signed-off-by: Denis Joseph Barrow <D.Barow@option.com> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* hso modem detect fix patch against Alan Cox'es tty treeDenis Joseph Barrow2009-01-021-1/+1
| | | | | | | | | | Fixed incorrect check for the modem port, this prevents crashes caused by issueing a tiocmget_submit_urb on endpoints which don't exist for non modem devices. Signed-off-by: Denis Joseph Barrow <D.Barow@option.com> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* tty: Modem functions for the HSO driverDenis Joseph Barrow2009-01-021-13/+318
| | | | | | | | | | Makes TIOCM ioctls for Data Carrier Detect & related functions work like /drivers/serial/serial-core.c potentially needed for pppd & similar user programs. Signed-off-by: Denis Joseph Barrow <D.Barow@option.com> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* tty: Fix the HSO termios handling a bitAlan Cox2009-01-021-24/+31
| | | | | | | | | | | Init the tty structure once Don't set ->low_latency twice in a row Don't force bits we should be leaving to the user Don't allocate termios arrays as these are in fact allocated by the tty layer for you and just overwrite the ones allocated in the driver Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* hso: net driver using tty without lockingAlan Cox2009-01-021-12/+42
| | | | | | | | | Checking tty == NULL doesn't help us unless we have a clear semantic for the locking of the tty object in the driver. Use the tty kref objects so that we can take references to the tty in the USB event handling paths. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drivers/net/usb: use USB API functions rather than constantsJulia Lawall2008-12-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This set of patches introduces calls to the following set of functions: usb_endpoint_dir_in(epd) usb_endpoint_dir_out(epd) usb_endpoint_is_bulk_in(epd) usb_endpoint_is_bulk_out(epd) usb_endpoint_is_int_in(epd) usb_endpoint_is_int_out(epd) usb_endpoint_num(epd) usb_endpoint_type(epd) usb_endpoint_xfer_bulk(epd) usb_endpoint_xfer_control(epd) usb_endpoint_xfer_int(epd) usb_endpoint_xfer_isoc(epd) In some cases, introducing one of these functions is not possible, and it just replaces an explicit integer value by one of the following constants: USB_ENDPOINT_XFER_BULK USB_ENDPOINT_XFER_CONTROL USB_ENDPOINT_XFER_INT USB_ENDPOINT_XFER_ISOC In drivers/net/wireless/zd1211rw/zd_usb.c the code: (endpoint->bEndpointAddress & USB_TYPE_MASK) == USB_DIR_OUT is suspicious. If it is intended to use USB_ENDPOINT_DIR_MASK rather than USB_TYPE_MASK, then the whole conditional test could be converted to a call to usb_endpoint_is_bulk_in. An extract of the semantic patch that makes these changes is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r1@ struct usb_endpoint_descriptor *epd; @@ - ((epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) == - \(USB_ENDPOINT_XFER_CONTROL\|0\)) + usb_endpoint_xfer_control(epd) @r5@ struct usb_endpoint_descriptor *epd; @@ - ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) == - \(USB_DIR_IN\|0x80\)) + usb_endpoint_dir_in(epd) @inc@ @@ #include <linux/usb.h> @depends on !inc && (r1||r5)@ @@ + #include <linux/usb.h> #include <linux/usb/...> // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: startup race in hso driverOliver Neukum2008-12-221-2/+1
| | | | | | | | The flag marking a device running must be set before the URBs for recption are submitted or they may complete too early and fail to resubmit. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* Revert "hso: Fix crashes on close."David S. Miller2008-11-251-9/+2
| | | | | | | | This reverts commit 4a3e818181e1baf970e9232ca8b747e233176b87. On request from Alan Cox. Signed-off-by: David S. Miller <davem@davemloft.net>
* Revert "hso: Fix free of mutexes still in use."David S. Miller2008-11-251-87/+23
| | | | | | | | This reverts commit 52429eb216385fdc6969c0112ba8b46cffefaaef. On request from Alan Cox. Signed-off-by: David S. Miller <davem@davemloft.net>
* Revert "hso: Add TIOCM ioctl handling."David S. Miller2008-11-251-317/+12
| | | | | | | | This reverts commit 7ea3a9ad9bf360f746a7ad6fa72511a5c359490d. On request from Alan Cox. Signed-off-by: David S. Miller <davem@davemloft.net>
* hso: Hook up ->reset_resumeDenis Joseph Barrow2008-11-251-0/+1
| | | | | | | | | | Made usb_drivers reset_resume function point to hso_resume this fixes problems a usb reset is done when the network interface is left idle for a few minutes. Possibly reset_resume should initialise hardware more but this works in the common case. Signed-off-by: Denis Joseph Barrow <D.Barow@option.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hso: Add TIOCM ioctl handling.Denis Joseph Barrow2008-11-251-12/+317
| | | | | | | | | Makes TIOCM ioctls for Data Carrier Detect & related functions work like /drivers/serial/serial-core.c potentially needed for pppd & similar user programs. Signed-off-by: Denis Joseph Barrow <D.Barow@option.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hso: Fix free of mutexes still in use.Denis Joseph Barrow2008-11-251-23/+87
| | | | | | | | | | | | | A new structure hso_mutex_table had to be declared statically & used as as hso_device mutex_lock(&serial->parent->mutex) etc is freed in hso_serial_open & hso_serial_close by kref_put while the mutex is still in use. This is a substantial change but should make the driver much stabler. Signed-off-by: Denis Joseph Barrow <D.Barow@option.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hso: Fix URB submission -EINVAL.Denis Joseph Barrow2008-11-251-11/+14
| | | | | | | | | Added check for IFF_UP in hso_resume, this should eliminate -EINVAL (-22) errors caused from urb's being submitted twice, once by hso_resume & once in hso_net_open, if suspend/resume USB power saving mode is enabled Signed-off-by: Denis Joseph Barrow <D.Barow@option.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hso: Fix crashes on close.Denis Joseph Barrow2008-11-251-2/+9
| | | | | | | | | | | | | | Moved serial_open_count in hso_serial_open to prevent crashes owing to the serial structure being made NULL when hso_serial_close is called even though hso_serial_open returned -ENODEV, Alan Cox pointed out this happens, also put in sanity check in hso_serial_close to check for a valid serial structure which should prevent the most reproducable crash in the driver when the hso device is disconnected while in use. Signed-off-by: Denis Joseph Barrow <D.Barow@option.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* hso: Add new usb device id's.Denis Joseph Barrow2008-11-251-0/+5
| | | | | Signed-off-by: Denis Joseph Barrow <D.Barow@option.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [netdrvr] usb/hso: Cleanup rfkill error handlingJonathan McDowell2008-11-071-4/+6
| | | | | | | | | | | | | | | | Yup, this appears to be the problem, thanks. I think &hso_net->net->dev is more intuitive for the error message, so I've used that. I've also added missing line endings on the error messages and set our local rfkill structure element to NULL on failure so we don't try to call rfkill_unregister on driver removal if we failed to register at all. The patch below Works For Me (TM); the device is detected fine, can be removed without problems and connects ok. I'll have a prod at why the rfkill stuff isn't working next, but I believe this cleanup of the error handling is appropriate no matter what the issue with registration is. Signed-Off-By: Jonathan McDowell <noodles@earth.li> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* hso: rfkill type should be WWANPaulius Zaleckas2008-11-071-1/+1
| | | | | | Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt> Cc: Denis Joseph Barrow <D.Barow@option.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* [netdrvr] usb/hso: throttle to prevent loss of serial dataDenis Joseph Barrow2008-09-241-92/+234
| | | | | | | | | | | | Patch to stop loss of characters on the hso modems, this patch throttles & unthrottles the modem by not putting out urbs until the tty/line discipline layer has enough space for newly received packets. serial ports. This is required for firmware diagnostics being done at Option. Signed-off-by: Denis Joseph Barrow <D.Barow@option.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* [netdrvr/usb] hso_create_bulk_serial_device(): fix a double freeAdrian Bunk2008-09-241-4/+5
| | | | | | | | | hso_serial_common_free() mustn't be called if hso_serial_common_create() fails. Reported-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* [netdrvr] hso: dev_kfree_skb crash fixDenis Joseph Barrow2008-08-271-0/+1
| | | | | | | | | | Fixes dev_kfree_skb happening too many times when hso_start_net_device is called from hso_resume. Signed-off-by: Denis Joseph Barrow <D.Barow@option.com> Cc: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* [netdrvr] hso: icon 322 detection fixDenis Joseph Barrow2008-08-271-1/+1
| | | | | | | | | Fixes Icon-322 detection. Signed-off-by: Denis Joseph Barrow <D.Barow@option.com> Cc: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* USB: HSO: minor fixes due to code reviewGreg Kroah-Hartman2008-08-141-19/+24
| | | | | | | | Fix up problems in hso.c driver as pointed out by Andrew. Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* USB: HSO: make tty_operations constGreg Kroah-Hartman2008-08-141-1/+1
| | | | | | | | | As recommended by Arjan. Cc: Arjan van de Ven <arjan@infradead.org> Cc: Andrew Bird <ajb@spheresystems.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* hso: fix refcounting on the ttyHSx devicesOlivier Blin2008-08-141-1/+1
| | | | | | | | | | | | The references on ttyHSx devices were not decremented correctly when the tty was closed. The helper freeing the serial devices was never called because of that, and the module left some dangling sysfs devices after being unloaded. Signed-off-by: Olivier Blin <blino@mandriva.com> Cc: Jari Tenhunen <jari.tenhunen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* hso: fix oops in read/write callbacksOlivier Blin2008-08-141-2/+4
| | | | | | | | | | | The tty may be closed already when the read/write callbacks are called. This patch checks that the ttys still exist before waking them up. Signed-off-by: Olivier Blin <blino@mandriva.com> Acked-by: Alan Cox <alan@redhat.com> Cc: Jari Tenhunen <jari.tenhunen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* HSO: add option hso driverGreg Kroah-Hartman2008-06-111-0/+2836
This driver is for a number of different Option devices. Originally written by Option and Andrew Bird, but cleaned up massivly for acceptance into mainline by me and others. Many thanks to the following for their help in cleaning up the driver by providing feedback and patches to it: - Paulius Zaleckas <paulius.zaleckas@teltonika.lt> - Oliver Neukum <oliver@neukum.org> - Alan Cox <alan@lxorguk.ukuu.org.uk> - Javier Marcet <javier@krausbeck.org> Cc: Andrew Bird <ajb@spheresystems.co.uk> Cc: Javier Marcet <javier@krausbeck.org> Cc: Filip Aben <f.aben@option.com> Cc: Paulius Zaleckas <paulius.zaleckas@teltonika.lt> Cc: Oliver Neukum <oliver@neukum.org> Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
OpenPOWER on IntegriCloud