Commit Graph

257 Commits (4d3a8534bdbcf4843fc8ad05c9a81a964fc65237)

Author SHA1 Message Date
Herbert Xu 80667ac13a smsc95xx: Use netdev stats structure
Now that netdev has its own stats structure we should use that
instead.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-30 19:46:46 -07:00
Herbert Xu 58e2e7d591 rndis_host: Use netdev stats structure
Now that netdev has its own stats structure we should use that
instead.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-30 19:46:45 -07:00
Herbert Xu a22d2b36a2 net1080: Use netdev stats structure
Now that netdev has its own stats structure we should use that
instead.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-30 19:46:43 -07:00
Herbert Xu 9612101cb3 dm9601: Use netdev stats structure
Now that netdev has its own stats structure we should use that
instead.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-30 19:46:43 -07:00
Herbert Xu eaea43abf3 cdc_eem: Use netdev stats structure
Now that netdev has its own stats structure we should use that
instead.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-30 19:46:41 -07:00
David Brownell 6be832529a usbnet cdc_subset: fix issues talking to PXA gadgets
The host-side CDC subset driver is binding more specifically
than it should ... only to PXA 210/25x/26x Linux-USB gadgets.

Loosen that restriction to match the gadget driver driver.
This will various PXA 27x and PXA 3xx devices happier when
talking to Linux hosts, potentially others.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Tested-by: Aric D. Blumer <aric@sdgsystems.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-20 01:21:53 -07:00
Jonas Sjöquist 68924920cb cdc_ether: additional PID's to the whitelist
This patch adds five PID's to the whitelist set of devices.

Devices added to the whitelist:

Dell Wireless 5530 HSPA
Ericsson Mobile Broadband Module variants (F3507g, F3607gw and F3307)
Toshiba F3507g

Signed-off-by: Jonas Sjöquist <jonas.sjoquist@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-19 00:19:51 -07:00
Michael Buesch e3453f6342 pegasus usb-net: Fix endianness bugs
This fixes various endianness bugs. Some harmless and some real ones.
This is tested on a PowerPC-64 machine.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: Stable <stable@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-19 00:18:38 -07:00
David S. Miller 9cbc1cb8cd Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
	Documentation/feature-removal-schedule.txt
	drivers/scsi/fcoe/fcoe.c
	net/core/drop_monitor.c
	net/core/net-traces.c
2009-06-15 03:02:23 -07:00
Patrick McHardy 5b2c4b972c net: fix network drivers ndo_start_xmit() return values (part 8)
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>
2009-06-13 01:18:45 -07:00
Jean Delvare 3ac49a1c99 trivial: fix ETIMEOUT -> ETIMEDOUT typos
fix ETIMEOUT -> ETIMEDOUT typos

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-06-12 18:01:50 +02:00
Paulius Zaleckas d65a68a8da hso: convert dev_alloc_skb() to netdev_alloc_skb()
Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-08 00:20:20 -07:00
Johannes Berg 19d337dff9 rfkill: rewrite
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>
2009-06-03 14:06:13 -04:00
André Goddard Rosa 342a437ef6 usbnet: ratelimit warning messages invoked from callback handler
Warning messages coming from rtl8150 driver can flood the console
and make a DTV/set-top-box unable to decode video/audio frames.

'Pegasus' driver handles this situation similarly, preventing this
from happening there.

It happens with a low cost BCM MIPS embedded platform, whenever
timeout errors were coming from usbnet device, making platform
unusable for viewer watching.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-29 22:13:58 -07:00
Peter Korsgaard df18acca8e smsc95xx: strip ethernet fcs (crc) on receive path
The smsc95xx driver was forwarding the trailing fcs on received frames
up the stack leading to confusion in tcpdump.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Tested-by: Steve Glendinning <steve.glendinning@smsc.com>
Acked-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-17 21:03:41 -07:00
Peter Korsgaard 61189c78bd dm9601: trivial comment fixes
The comments describing the rx/tx headers used a combination of zero-
and 1-based indexing, leading to confusion.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-17 21:03:41 -07:00
David S. Miller 22f6dacdfc Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	include/net/tcp.h
2009-05-08 02:48:30 -07:00
Omar Laazimani 9f722c0978 usbnet: CDC EEM support (v5)
This introduces a CDC Ethernet Emulation Model (EEM) host side
driver to support USB EEM devices.

EEM is different from the Ethernet Control Model (ECM) currently
supported by the "CDC Ethernet" driver.  One key difference is
that it doesn't require of USB interface alternate settings to
manage interface state; some maldesigned hardware can't handle
that part of USB.  It also avoids a separate USB interface for
control and status updates.

[ dbrownell@users.sourceforge.net: fix skb leaks, add rx packet
checks, improve fault handling, EEM conformance updates, cleanup ]

Signed-off-by: Omar Laazimani <omar.oberthur@gmail.com>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-04 12:01:43 -07:00
David S. Miller d252a5e7b7 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 2009-05-03 14:07:43 -07:00
Steve Glendinning 726474b8cd smsc95xx: add support for LAN9512 and LAN9514
LAN9512 and LAN9514 are USB hubs with an integrated 10/100 ethernet
controller.  Logically this looks like an ethernet controller (similar
to LAN9500) permanently attached to one of the hub's downstream ports.

This patch adds the usb device id of the new ethernet controller to the
smsc95xx driver.  This id is the same in both new devices.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-01 15:27:03 -07:00
Steve Glendinning f293501c61 smsc95xx: configure LED outputs
SMSC LAN9500 has dual purpose GPIO/LED pins, and by default at power-on
these are configured as GPIOs.  This means that if LEDs are fitted they
won't ever light.

This patch sets them to be LED outputs for speed, duplex and
link/activity.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-01 15:27:02 -07:00
Greg Kroah-Hartman 1aec5bdfed net: remove driver_data direct access of struct device
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>
2009-05-01 15:21:55 -07:00
Johannes Berg c1c6b14b22 rfkill: remove deprecated state constants
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>
2009-04-22 16:54:27 -04:00
Peter Holik 4510d7cb8b usb driver for intellon int51x1 based PLC like devolo dlan duo
usb driver for intellon int51x1 based PLC like devolo dlan duo
with improvements suggested by the guys of the mailinglist:
- name and prefix with int51x1 (Florian Fainelli)
- use conversion functions cpu_to_le16 / le16_to_cpu (Oliver Neukum)
- use pskb_may_pull instead of skb->len (Ilpo Järvinen)
- better code in tx_fixup (Ilpo Järvinen)
- use gotos for error handling (Ilpo Järvinen)
- better description (Jon Smirl)

Signed-off-by: Peter Holik <peter@holik.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-21 01:55:59 -07:00
Peter Holik 03ad032bb7 export usbnet_get_ethernet_addr from usbnet and fixed cdc_ether.c
because of using the same function get_ethernet_addr as cdc_ether.c
i export usbnet_get_ethernet_addr from usbnet and fixed cdc_ether
(suggested by Oliver Neukum).

Signed-off-by: Peter Holik <peter@holik.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-21 01:55:59 -07:00
David S. Miller e5e9743bb7 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	net/core/dev.c
2009-04-21 01:32:26 -07:00
Oliver Neukum 9dd014eb98 pegasus: Handle disconnect error code correctly.
EPERM means that disconnect() is runnung. It should be treated like
ENODEV

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-17 01:40:19 -07:00
Alexander Beregalov 84381eed93 usbnet: remove old compat_net_dev_ops code
Since all usb network drivers are already converted to net_device_ops
this code is useless.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-16 02:20:05 -07:00
Larry Finger 710b523ac5 kaweth: Clean up code
The driver kaweth yields a -EBUSY error when starting, and a -ETIME
error when shutting down. These errors are avoided, and the RX status
is further checked for other potential errors.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-13 15:44:35 -07:00
Yang Hongyang 6a35528a83 dma-mapping: replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64)
Replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64)

Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-07 08:31:10 -07:00
Jan Dumon 0de8ca597d hso: fix for the 'invalid frame length' messages
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>
2009-04-02 16:31:44 -07:00
Jan Dumon 3b7d2b319d hso: fix for crash when unplugging the device
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>
2009-04-02 16:31:43 -07:00
Jan Dumon 9961d84270 hso: add Vendor/Product ID's for new devices
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>
2009-04-02 01:16:44 -07:00
Larry Finger 4ff61c8f7b kaweth: Fix locking to be SMP-safe
On an SMP system, the following message is printed. The patch below gets
fixes the problem.

=================================
[ INFO: inconsistent lock state ]
2.6.29-Linus-05093-gc31f403 #57
---------------------------------
inconsistent {hardirq-on-W} -> {in-hardirq-W} usage.
bash/4105 [HC1[1]:SC0[0]:HE0:SE1] takes:
 (&kaweth->device_lock){+...}, at: [<ffffffffa01aa286>]
                 kaweth_usb_receive+0x77/0x1af [kaw eth]
{hardirq-on-W} state was registered at:
  [<ffffffff80260503>] __lock_acquire+0x753/0x1685
  [<ffffffff8026148a>] lock_acquire+0x55/0x71
  [<ffffffff80461ba6>] _spin_lock+0x31/0x3d
  [<ffffffffa01aaa0c>] kaweth_start_xmit+0x2b/0x1e1 [kaweth]
  [<ffffffff803eccd3>] dev_hard_start_xmit+0x22e/0x2ad
  [<ffffffff803fe120>] __qdisc_run+0xf2/0x203
  [<ffffffff803ed0cd>] dev_queue_xmit+0x263/0x39b
  [<ffffffffa03a47cb>] packet_sendmsg_spkt+0x1c4/0x20a [af_packet]
  [<ffffffff803de0c2>] sock_sendmsg+0xe4/0xfd
  [<ffffffff803dec8f>] sys_sendto+0xe4/0x10c
  [<ffffffff8020bccb>] system_call_fastpath+0x16/0x1b
  [<ffffffffffffffff>] 0xffffffffffffffff
irq event stamp: 1280
hardirqs last  enabled at (1279): [<ffffffff80461a71>]
                  _spin_unlock_irqrestore+0x44/0x4c
hardirqs last disabled at (1280): [<ffffffff8020bad7>]
                  save_args+0x67/0x70
softirqs last  enabled at (660): [<ffffffff8024192c>]
                  __do_softirq+0x14d/0x15d
softirqs last disabled at (651): [<ffffffff8020ce9c>]
                  call_softirq+0x1c/0x28

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-02 01:09:43 -07:00
Stephen Hemminger 0f2166dff6 usbnet: convert rndis driver to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-21 19:55:35 -07:00
Stephen Hemminger 63e77b391f usbnet: convert smsc95xx driver to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-21 19:55:34 -07:00
Stephen Hemminger e12c4f8321 usbnet: convert msc7830 driver to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-21 19:55:33 -07:00
Stephen Hemminger fe85ff8299 usbnet: convert dms9601 driver to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-21 19:55:33 -07:00
Stephen Hemminger 1703338c79 usbnet: convert asix driver to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-21 19:41:02 -07:00
Stephen Hemminger 777baa4711 usbnet: support net_device_ops
Use net_device_ops for usbnet device, and export for use
by other derived drivers.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-21 19:41:01 -07:00
Stephen Hemminger 805aaa29fa usbnet: convert to internal net_device_stats
Default handler for net_device_stats already does same thing.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-21 19:41:01 -07:00
Stephen Hemminger c266cb4ef2 usbnet: convert hso driver to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-21 19:41:00 -07:00
Stephen Hemminger d79f7ef48b usbnet: convert rtl driver to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-21 19:41:00 -07:00
Stephen Hemminger b7e41e2305 usbnet: convert to internal net_device stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-21 19:40:59 -07:00
Stephen Hemminger 19b8f8f1a1 usbnet: convert catc device to net_device_ops
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-21 19:40:58 -07:00
Stephen Hemminger edc4ae0864 usbnet: convert catc to internal net_device_stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-21 19:40:58 -07:00
David S. Miller 508827ff0a Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/tokenring/tmspci.c
	drivers/net/ucc_geth_mii.c
2009-03-05 02:06:47 -08:00
Peter Korsgaard a1a69c8db7 dm9601: new vendor/product IDs
Add vendor/product IDs for new no name dm9601 compatible usb ethernet
adaptors.

Reported-by: Eric Lauriault <eric@linux.ca>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-03 23:48:16 -08:00
David S. Miller aa4abc9bcc Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/wireless/iwlwifi/iwl-tx.c
	net/8021q/vlan_core.c
	net/core/dev.c
2009-03-01 21:35:16 -08:00
Dmitriy Taychenachev 52c0326bea zaurus: add usb id for motomagx phones
The Motorola MOTOMAGX phones (Z6, E8, Zn5 so far) are providing
combined ACM/BLAN USB configuration. Since it has Vendor Specific
class, the corresponding drivers (cdc-acm, zaurus) can't find it just
by interface info. This patch adds usb id so the zaurus driver can
properly handle this combined device.

Signed-off-by: Dmitriy Taychenachev <dimichxp@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-01 20:48:08 -08:00
Bjørn Mork 05ffb3e287 usbnet: make usbnet_get_link() fall back to ethtool_op_get_link()
Make usbnet_get_link() fall back to ethtool_op_get_link() instead of
defaulting to 1.  
     
This makes usbnet_get_link return valid results without the need for a
driver specific check_connect or mii ops as long as the driver calls
netif_carrier_{on,off}() as appropriate.  cdc_ether is an example of
such a driver.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-01 20:45:40 -08:00
Bjørn Mork cac477e8f1 cdc_ether: add usb id for Ericsson F3507g
The Ericsson F3507g wireless broadband module provides a CDC Ethernet
compliant interface, but identifies it as a "Mobile Direct Line" CDC
subclass, thereby preventing the CDC Ethernet class driver from picking
it up.  This patch adds the device id to cdc_ether.c as a workaround.

Ericsson has provided a "class" driver for this device:
http://kerneltrap.org/mailarchive/linux-net/2008/10/28/3832094
But closer inspection of that driver reveals that it adds little more
than duplication of code from cdc_ether.c.  See also
http://marc.info/?l=linux-usb&m=123334979706403&w=2

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-01 20:44:21 -08:00
Paulius Zaleckas e44578ea7c hso: remove hso_free_device()
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>
2009-02-26 23:02:57 -08:00
Paulius Zaleckas a6f26e4b0e hso: remove claiming and releasing of USB interface
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>
2009-02-26 23:02:56 -08:00
David S. Miller f11c179eea Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
	drivers/net/wireless/orinoco/orinoco.c
2009-02-25 00:02:05 -08:00
Greg Kroah-Hartman fef7cc0893 asix: new device ids
This patch adds two new device ids to the asix driver.

One comes directly from the asix driver on their web site, the other was
reported by Armani Liao as needed for the MSI X320 to get the driver to
work properly for it.

Reported-by: Armani Liao <aliao@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-24 23:52:24 -08:00
Hannes Eder 0227abc9d0 drivers/net/usb: fix sparse warnings: Should it be static?
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>
2009-02-17 19:34:47 -08:00
Harvey Harrison 35c26c2cf6 rndis: remove private wrapper of __constant_cpu_to_le32
Use cpu_to_le32 directly as it handles constant folding now, replace direct
uses of __constant_cpu_to_{endian} as well.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-14 22:56:56 -08:00
David S. Miller 005c79b3d4 Merge branch 'master' of /home/davem/src/GIT/linux-2.6/ 2009-02-04 16:51:58 -08:00
Filip Aben 67dd82462d hso: add new device id's
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>
2009-02-03 15:13:26 -08:00
Harvey Harrison 09640e6365 net: replace uses of __constant_{endian}
Base versions handle constant folding now.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-01 00:45:17 -08:00
Steve Glendinning 150a7fcc5c smsc95xx: fix function prototype of async callback
smsc95xx_async_cmd_callback doesn't currently match usb_complete_t, so
there's a cast to force the square peg into the round hole.  This patch
fixes this properly.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-25 17:54:46 -08:00
Steve Glendinning 01a1ac472f smsc95xx: remove unused completion struct
Oliver Neukum spotted the useless complete() in our async callback.  On
closer inspection, the entire completion struct is unused.  This patch
removes it.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-25 17:53:58 -08:00
Christian Eggers 6d31748294 usb/mcs7830: Don't use buffers from stack for USB transfers
mcs7830_set_reg() and mcs7830_get_reg() are called with buffers
from stack which must not be used directly for USB transfers.
This causes corruption of the stack particulary on non x86
architectures because DMA may be used for these transfers.

Signed-off-by: Christian Eggers <christian.eggers@kathrein.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21 12:56:24 -08:00
Linus Torvalds 3feeba1e53 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* 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
  ...
2009-01-15 16:53:15 -08:00
Denis Joseph Barrow 5839b414f9 hso serial throttled tty kref fix.
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>
2009-01-15 12:48:36 -08:00
Denis Joseph Barrow d45eb81c3e tty: Fix double grabbing of a spinlock
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>
2009-01-15 12:48:36 -08:00
Alan Cox fe41cbb164 tty: Fix a kref leak in the HSO driver on re-open
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-01-15 12:48:36 -08:00
Denis Joseph Barrow b74f62c1e7 hso: driver fix for big endian machines.
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>
2009-01-12 21:56:49 -08:00
Oliver Neukum 8cb89571bd net: convert pegasus driver to net_device_ops
This converts the pegasus driver to use of the new net_device_ops structure

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-08 11:22:25 -08:00
Oliver Neukum 321ea8b2d3 net: switch kaweth driver to netdevops
This converts the kaweth ethernet USB driver to netdevops.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-08 11:20:22 -08:00
David S. Miller 7f46b1343f Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 2009-01-08 11:05:59 -08:00
Wu Fengguang f52deb0e84 dm9601: warn on invalid mac address
Add warnings on invalid mac address to help disclose/debug problems.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-08 10:47:01 -08:00
Wu Fengguang 4b9f8ec6e5 dm9601: tell HW about random generated mac address
Otherwise unicast RX will only work in promisc mode.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-08 10:46:02 -08:00
Harvey Harrison da2bbdcc38 USB: avoid needless address-taking of function parameters
There's no need to take the address of the function params or local variables
when the direct value byteswapping routines are available.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07 09:59:50 -08:00
Wu Fengguang 98658bc9dc dm9601: bring datasheet URL up to date
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-06 10:56:07 -08:00
Wu Fengguang 20f10aa07d dm9601: handle corrupt mac address
Some cheap devices ship with dangling EEPROM pins!
They always return invalid address ff:ff:ff:ff:ff:ff.

Inherit the auto-generated address in this case,
so that these products can work with zero configuration.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-06 10:55:32 -08:00
Denis Joseph Barrow 11cd29b028 hso maintainers update patch
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>
2009-01-02 10:19:43 -08:00
Denis Joseph Barrow 58eb17f155 hso modem detect fix patch against Alan Cox'es tty tree
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>
2009-01-02 10:19:43 -08:00
Denis Joseph Barrow 542f548236 tty: Modem functions for the HSO driver
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>
2009-01-02 10:19:41 -08:00
Alan Cox ac9720c37e tty: Fix the HSO termios handling a bit
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>
2009-01-02 10:19:41 -08:00
Alan Cox e136e3036b hso: net driver using tty without locking
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>
2009-01-02 10:19:41 -08:00
Julia Lawall f201a8a451 drivers/net/usb: use USB API functions rather than constants
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>
2008-12-29 19:40:47 -08:00
Oliver Neukum 889bd9b6db net: startup race in hso driver
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>
2008-12-22 19:54:00 -08:00
Oliver Neukum c94cb31450 net: prepare usb net drivers for addition of status as a parameter
USB is going to switch the signature of the callbacks to
void callback(struct urb *urb, int status)
This patch will ease the transition.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-18 23:00:59 -08:00
Steve Glendinning bc02ff95fe net: Refactor full duplex flow control resolution
These 4 drivers have identical full duplex flow control resolution
functions.  This patch changes them all to use one common function.

The function in question decides whether a device should enable TX and
RX flow control in a standard way (IEEE 802.3-2005 table 28B-3), so this
should also be useful for other drivers.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-16 02:00:48 -08:00
Steve Glendinning e18ce34654 net: Move flow control definitions to mii.h
flags used within drivers for indicating tx and rx flow control are
defined in 4 drivers (and probably more), move these constants to mii.h.

The 3 SMSC drivers use the same constants (FLOW_CTRL_TX), but TG3 uses
TG3_FLOW_CTRL_TX, so this patch also renames the constants within TG3.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-16 02:00:00 -08:00
David S. Miller 2f9889a20c Revert "hso: Fix crashes on close."
This reverts commit 4a3e818181.

On request from Alan Cox.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-11-25 03:53:09 -08:00
David S. Miller ab153d84d9 Revert "hso: Fix free of mutexes still in use."
This reverts commit 52429eb216.

On request from Alan Cox.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-11-25 03:52:46 -08:00
David S. Miller cd90ee1799 Revert "hso: Add TIOCM ioctl handling."
This reverts commit 7ea3a9ad9b.

On request from Alan Cox.

Signed-off-by: David S. Miller <davem@davemloft.net>
2008-11-25 03:52:17 -08:00
Denis Joseph Barrow 9c8f92aed1 hso: Hook up ->reset_resume
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>
2008-11-25 00:36:10 -08:00
Denis Joseph Barrow 7ea3a9ad9b hso: Add TIOCM ioctl handling.
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>
2008-11-25 00:35:26 -08:00
Denis Joseph Barrow 52429eb216 hso: Fix free of mutexes still in use.
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>
2008-11-25 00:33:13 -08:00
Denis Joseph Barrow 89930b7b5e hso: Fix URB submission -EINVAL.
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>
2008-11-25 00:30:48 -08:00
Denis Joseph Barrow 4a3e818181 hso: Fix crashes on close.
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>
2008-11-25 00:27:50 -08:00
Denis Joseph Barrow bab04c3adb hso: Add new usb device id's.
Signed-off-by: Denis Joseph Barrow <D.Barow@option.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-11-25 00:26:12 -08:00
David S. Miller 6ab33d5171 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:

	drivers/net/ixgbe/ixgbe_main.c
	include/net/mac80211.h
	net/phonet/af_phonet.c
2008-11-20 16:44:00 -08:00
Steve Glendinning f7b29271c3 smsc95xx: add tx checksum offload support
LAN9500 supports tx checksum offload, which slightly decreases cpu
utilisation.  The benefit isn't very large because we still require
the skb to be linearized, but it does save a few cycles.

This patch adds support for it, and enables it by default.

Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-11-20 04:19:21 -08:00
Pantelis Koukousoulas a7f75c0c9c asix: Fix asix-based cards connecting to 10/100Mbs LAN.
Add AX_MEDIUM_ENCK also when speed = 10/100Mbps. This allows my belkin
f5d5055 to work with my 100Mbps switch and with an old 10Mbps ISA card.
Without this patch, the card is recognized and the interface is brought
up fine, but no packets actually flow through the interface.

Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com>
Acked-by: David Hollis <dhollis@davehollis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-11-20 01:48:46 -08:00
David S. Miller 198d6ba4d7 Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:

	drivers/isdn/i4l/isdn_net.c
	fs/cifs/connect.c
2008-11-18 23:38:23 -08:00