Skip to content
Snippets Groups Projects
  1. Apr 17, 2011
  2. Apr 15, 2011
  3. Apr 13, 2011
  4. Apr 10, 2011
  5. Apr 01, 2011
    • Michał Mirosław's avatar
      net: convert SMSC USB net drivers to hw_features · 78e47fe4
      Michał Mirosław authored
      
      There's a race (not fixed here) in smsc75xx in setting RFE_CTL that's not
      properly handled via rfe_ctl_lock. Spinlock is not a good tool here, as
      this has to wait for URB completion (or maybe just submission) after issuing
      register write request. Otherwise, the rfe_ctl might be changed just after
      spin_unlock() and device left programmed with other value.
      
      smsc95xx has increased hard_header_len for the case of TX checksumming.
      
      smsc75xx is fixed to advertise IP+IPV6_CSUM instead of HW_CSUM as it does
      not use csum_start/csum_offset.
      
      Signed-off-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      78e47fe4
    • Arnd Bergmann's avatar
      usbnet: use eth%d name for known ethernet devices · c261344d
      Arnd Bergmann authored
      
      The documentation for the USB ethernet devices suggests that
      only some devices are supposed to use usb0 as the network interface
      name instead of eth0. The logic used there, and documented in
      Kconfig for CDC is that eth0 will be used when the mac address
      is a globally assigned one, but usb0 is used for the locally
      managed range that is typically used on point-to-point links.
      
      Unfortunately, this has caused a lot of pain on the smsc95xx
      device that is used on the popular pandaboard without an
      EEPROM to store the MAC address, which causes the driver to
      call random_ether_address().
      
      Obviously, there should be a proper MAC addressed assigned to
      the device, and discussions are ongoing about how to solve
      this, but this patch at least makes sure that the default
      interface naming gets a little saner and matches what the
      user can expect based on the documentation, including for
      new devices.
      
      The approach taken here is to flag whether a device might be a
      point-to-point link with the new FLAG_POINTTOPOINT setting in
      the usbnet driver_info. A driver can set both FLAG_POINTTOPOINT
      and FLAG_ETHER if it is not sure (e.g. cdc_ether), or just one
      of the two.  The usbnet framework only looks at the MAC address
      for device naming if both flags are set, otherwise it trusts the
      flag.
      
      Signed-off-by: default avatarArnd Bergmann <arnd.bergmann@linaro.org>
      Tested-by: default avatarAndy Green <andy.green@linaro.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c261344d
  6. Mar 31, 2011
  7. Mar 30, 2011
    • Andrzej Zaborowski's avatar
      net/usb: Ethernet quirks for the LG-VL600 4G modem · 7a635ea9
      Andrzej Zaborowski authored
      
      This adds a driver for the CDC Ethernet part of this modem.  The
      device's ID is blacklisted in cdc_ether.c and is white-listed in
      this new driver because of the quirks needed to make it useful.
      The modem's firmware exposes a CDC ACM port for modem control and a
      CDC Ethernet port for network data.  The descriptors look fine but
      both ports actually are some sort of multiplexers requiring non-
      standard headers added/removed from every packet or they get
      ignored.  All information is based on a usb traffic log from a
      Windows machine.
      
      On the Verizon 4G network I've seen speeds up to 1.1MB/s so far with
      this driver, a speed-o-meter site reports 16.2Mbps/10.5Mbps.
      Userspace scripts are required to talk to the CDC ACM port.
      
      Signed-off-by: default avatarAndrzej Zaborowski <balrogg@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      7a635ea9
  8. Mar 22, 2011
    • Marc Zyngier's avatar
      NET: smsc95xx: don't use stack for async writes to the device · 3c0f3c60
      Marc Zyngier authored
      
      The set_multicast operation performs asynchronous writes to the
      device, with some addresses pointing to the stack. Bad things may
      happen, and this is trapped CONFIG_DMA_API_DEBUG:
      
      [    5.237762] WARNING: at /build/buildd/linux-linaro-omap-2.6.38/lib/dma-debug.c:867 check_for_stack+0xd4/0x100()
      [    5.237792] ehci-omap ehci-omap.0: DMA-API: device driver maps memory fromstack [addr=d9c77dec]
      [    5.237792] Modules linked in: smsc95xx(+) usbnet twl6030_usb twl4030_pwrbutton leds_gpio omap_wdt omap2_mcspi
      [    5.237854] [<c006d618>] (unwind_backtrace+0x0/0xf8) from [<c00a6a14>] (warn_slowpath_common+0x54/0x64)
      [    5.237884] [<c00a6a14>] (warn_slowpath_common+0x54/0x64) from [<c00a6ab8>] (warn_slowpath_fmt+0x30/0x40)
      [    5.237915] [<c00a6ab8>] (warn_slowpath_fmt+0x30/0x40) from [<c034e9d8>] (check_for_stack+0xd4/0x100)
      [    5.237915] [<c034e9d8>] (check_for_stack+0xd4/0x100) from [<c034fea8>] (debug_dma_map_page+0xb4/0xdc)
      [    5.237976] [<c034fea8>] (debug_dma_map_page+0xb4/0xdc) from [<c04242f0>] (map_urb_for_dma+0x26c/0x304)
      [    5.237976] [<c04242f0>] (map_urb_for_dma+0x26c/0x304) from [<c0424594>] (usb_hcd_submit_urb+0x78/0x19c)
      [    5.238037] [<c0424594>] (usb_hcd_submit_urb+0x78/0x19c) from [<bf049c5c>] (smsc95xx_write_reg_async+0xb4/0x130 [smsc95xx])
      [    5.238067] [<bf049c5c>] (smsc95xx_write_reg_async+0xb4/0x130 [smsc95xx]) from [<bf049dd4>] (smsc95xx_set_multicast+0xfc/0x148 [smsc95xx])
      [    5.238098] [<bf049dd4>] (smsc95xx_set_multicast+0xfc/0x148 [smsc95xx]) from [<bf04a118>] (smsc95xx_reset+0x2f8/0x68c [smsc95xx])
      [    5.238128] [<bf04a118>] (smsc95xx_reset+0x2f8/0x68c [smsc95xx]) from [<bf04a8cc>] (smsc95xx_bind+0xcc/0x188 [smsc95xx])
      [    5.238159] [<bf04a8cc>] (smsc95xx_bind+0xcc/0x188 [smsc95xx]) from [<bf03ef1c>] (usbnet_probe+0x204/0x4c4 [usbnet])
      [    5.238220] [<bf03ef1c>] (usbnet_probe+0x204/0x4c4 [usbnet]) from [<c0429078>] (usb_probe_interface+0xe4/0x1c4)
      [    5.238250] [<c0429078>] (usb_probe_interface+0xe4/0x1c4) from [<c03a8770>] (really_probe+0x64/0x160)
      [    5.238250] [<c03a8770>] (really_probe+0x64/0x160) from [<c03a8a30>] (driver_probe_device+0x48/0x60)
      [    5.238281] [<c03a8a30>] (driver_probe_device+0x48/0x60) from [<c03a8ad4>] (__driver_attach+0x8c/0x90)
      [    5.238311] [<c03a8ad4>] (__driver_attach+0x8c/0x90) from [<c03a7b24>] (bus_for_each_dev+0x50/0x7c)
      [    5.238311] [<c03a7b24>] (bus_for_each_dev+0x50/0x7c) from [<c03a82ec>] (bus_add_driver+0x190/0x250)
      [    5.238311] [<c03a82ec>] (bus_add_driver+0x190/0x250) from [<c03a8cf8>] (driver_register+0x78/0x13c)
      [    5.238433] [<c03a8cf8>] (driver_register+0x78/0x13c) from [<c0428040>] (usb_register_driver+0x78/0x13c)
      [    5.238464] [<c0428040>] (usb_register_driver+0x78/0x13c) from [<c005b680>] (do_one_initcall+0x34/0x188)
      [    5.238494] [<c005b680>] (do_one_initcall+0x34/0x188) from [<c00e11f0>] (sys_init_module+0xb0/0x1c0)
      [    5.238525] [<c00e11f0>] (sys_init_module+0xb0/0x1c0) from [<c0065c40>] (ret_fast_syscall+0x0/0x30)
      
      Move the two offenders to the private structure which is kmalloc-ed,
      and thus safe.
      
      Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Cc: Steve Glendinning <steve.glendinning@smsc.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3c0f3c60
  9. Mar 14, 2011
    • Jiri Slaby's avatar
      NET: cdc-phonet, handle empty phonet header · 468c3f92
      Jiri Slaby authored
      
      Currently, for N 5800 XM I get:
      cdc_phonet: probe of 1-6:1.10 failed with error -22
      
      It's because phonet_header is empty. Extra altsetting looks like
      there:
      E 05 24 00 01 10 03 24 ab 05 24 06 0a 0b 04 24 fd  .$....$..$....$.
      E 00                                               .
      
      I don't see the header used anywhere so just check if the phonet
      descriptor is there, not the structure itself.
      
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
      Cc: David S. Miller <davem@davemloft.net>
      Acked-by: default avatarRémi Denis-Courmont <remi.denis-courmont@nokia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      468c3f92
    • Jiri Slaby's avatar
      NET: cdc-phonet, fix stop-queue handling · ac90fa63
      Jiri Slaby authored
      
      Currently there is a warning emitted by the cdc-phonet driver:
      WARNING: at include/linux/netdevice.h:1557 usbpn_probe+0x3bb/0x3f0 [cdc_phonet]()
      Modules linked in: ...
      Pid: 5877, comm: insmod Not tainted 2.6.37.3-16-desktop #1
      Call Trace:
       [<ffffffff810059b9>] dump_trace+0x79/0x340
       [<ffffffff81520fdc>] dump_stack+0x69/0x6f
       [<ffffffff810580eb>] warn_slowpath_common+0x7b/0xc0
       [<ffffffffa00254fb>] usbpn_probe+0x3bb/0x3f0 [cdc_phonet]
      ...
      ---[ end trace f5d3e02908603ab4 ]---
      netif_stop_queue() cannot be called before register_netdev()
      
      So remove netif_stop_queue from the probe funtction to avoid that.
      
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Cc: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
      Cc: David S. Miller <davem@davemloft.net>
      Acked-by: default avatarRémi Denis-Courmont <remi.denis-courmont@nokia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ac90fa63
  10. Feb 23, 2011
  11. Feb 17, 2011
  12. Feb 13, 2011
    • Jesper Juhl's avatar
      Net, USB, Option, hso: Do not dereference NULL pointer · 5b89db0e
      Jesper Juhl authored
      
      In drivers/net/usb/hso.c::hso_create_bulk_serial_device() we have this
      code:
      ...
      	serial = kzalloc(sizeof(*serial), GFP_KERNEL);
      	if (!serial)
      		goto exit;
      ...
      exit:
      	hso_free_tiomget(serial);
      ...
      hso_free_tiomget() directly dereferences its argument, which in the
      example above is a NULL pointer, ouch.
      I could just add a 'if (serial)' test at the 'exit' label, but since most
      freeing functions in the kernel accept NULL pointers (and it seems like
      this was also assumed here) I opted to instead change 'hso_free_tiomget()'
      so that it is safe to call it with a NULL argument. I also modified the
      function to get rid of a pointles conditional before the call to
      'usb_free_urb()' since that function already tests for NULL itself -
      besides fixing the NULL deref this change also buys us a few bytes in
      size.
      Before:
      $ size drivers/net/usb/hso.o
         text    data     bss     dec     hex filename
        32200     592    9960   42752    a700 drivers/net/usb/hso.o
      After:
      $ size drivers/net/usb/hso.o
         text    data     bss     dec     hex filename
        32196     592    9960   42748    a6fc drivers/net/usb/hso.o
      
      Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5b89db0e
    • Jesper Juhl's avatar
      USB Network driver infrastructure: Fix leak when usb_autopm_get_interface()... · ab60707f
      Jesper Juhl authored
      USB Network driver infrastructure: Fix leak when usb_autopm_get_interface() returns less than zero in kevent().
      
      We'll leak the memory allocated to 'urb' in
      drivers/net/usb/usbnet.c:kevent() when we 'goto fail_lowmem' and the 'urb'
      variable goes out of scope while still completely unused.
      
      Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ab60707f
  13. Feb 08, 2011
  14. Jan 25, 2011
  15. Jan 18, 2011
  16. Jan 13, 2011
    • Jesper Juhl's avatar
      USB CDC NCM: Don't deref NULL in cdc_ncm_rx_fixup() and don't use uninitialized variable. · 9e56790a
      Jesper Juhl authored
      
      skb_clone() dynamically allocates memory and may fail. If it does it
      returns NULL. This means we'll dereference a NULL pointer in
      drivers/net/usb/cdc_ncm.c::cdc_ncm_rx_fixup().
      As far as I can tell, the proper way to deal with this is simply to goto
      the error label.
      
      Furthermore gcc complains that 'skb' may be used uninitialized:
        drivers/net/usb/cdc_ncm.c: In function ‘cdc_ncm_rx_fixup’:
        drivers/net/usb/cdc_ncm.c:922:18: warning: ‘skb’ may be used uninitialized in this function
      and I believe it is right. On the line where we
        pr_debug("invalid frame detected (ignored)" ...
      we are using the local variable 'skb' but nothing has ever been assigned
      to that variable yet. I believe the correct fix for that is to use
      'skb_in' instead.
      
      Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9e56790a
  17. Dec 31, 2010
  18. Dec 23, 2010
  19. Dec 21, 2010
  20. Dec 20, 2010
  21. Dec 17, 2010
  22. Dec 16, 2010
  23. Dec 12, 2010
    • Tejun Heo's avatar
      drivers/net: don't use flush_scheduled_work() · 23f333a2
      Tejun Heo authored
      
      flush_scheduled_work() is on its way out.  This patch contains simple
      conversions to replace flush_scheduled_work() usage with direct
      cancels and flushes.
      
      Directly cancel the used works on driver detach and flush them in
      other cases.
      
      The conversions are mostly straight forward and the only dangers are,
      
      * Forgetting to cancel/flush one or more used works.
      
      * Cancelling when a work should be flushed (ie. the work must be
        executed once scheduled whether the driver is detaching or not).
      
      I've gone over the changes multiple times but it would be much
      appreciated if you can review with the above points in mind.
      
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jay Cliburn <jcliburn@gmail.com>
      Cc: Michael Chan <mchan@broadcom.com>
      Cc: Divy Le Ray <divy@chelsio.com>
      Cc: e1000-devel@lists.sourceforge.net
      Cc: Vasanthy Kolluri <vkolluri@cisco.com>
      Cc: Samuel Ortiz <samuel@sortiz.org>
      Cc: Lennert Buytenhek <buytenh@wantstofly.org>
      Cc: Andrew Gallatin <gallatin@myri.com>
      Cc: Francois Romieu <romieu@fr.zoreil.com>
      Cc: Ramkrishna Vepa <ramkrishna.vepa@exar.com>
      Cc: Matt Carlson <mcarlson@broadcom.com>
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Shreyas Bhatewara <sbhatewara@vmware.com>
      Cc: netdev@vger.kernel.org
      23f333a2
  24. Dec 09, 2010
  25. Dec 06, 2010
    • Alexey Orishko's avatar
      USB CDC NCM host driver · 900d495a
      Alexey Orishko authored
      
      The patch provides USB CDC NCM host driver support in the Linux Kernel.
      
      Changes:
      drivers/net/usb/cdc_ncm.c:
      - initial submission of the CDC NCM host driver;
      - verified on Intel 32/64 bit, Intel Atom, ST-Ericsson U8500 (ARM)
      - throughput measured over 100 Mbits duplex;
      - driver supports 16-bit NTB format only, but it is more than enough for
        transfers up to 64K;
      - driver can handle up to 32 datagrams in received NTB;
      - timer is used to collect several packets in Tx direction
      
      drivers/net/usb/Kconfig:
      - a new entry to compile CDC NCM host driver
      drivers/net/usb/Makefile:
      - a new entry to compile CDC NCM host driver
      
      Signed-off-by: default avatarAlexey Orishko <alexey.orishko@stericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      900d495a
    • Alexey Orishko's avatar
      usbnet: changes for upcoming cdc_ncm driver · 073285fd
      Alexey Orishko authored
      
      Changes:
      include/linux/usb/usbnet.h:
      - a new flag to indicate driver's capability to accumulate IP packets in Tx
       direction and extract several packets from single skb in Rx direction.
      drivers/net/usb/usbnet.c:
      - the procedure of counting packets in usbnet was updated due to the
       accumulating of IP packets in the driver
      - no short packets are sent if indicated by the flag in driver_info
       structure
      
      Signed-off-by: default avatarAlexey Orishko <alexey.orishko@stericsson.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      073285fd
  26. Nov 28, 2010
  27. Nov 17, 2010
  28. Nov 15, 2010
  29. Nov 09, 2010
  30. Nov 01, 2010
    • Ming Lei's avatar
      usbnet: fix usb_autopm_get_interface failure(v1) · b0786b43
      Ming Lei authored
      
      Since usbnet already took usb runtime pm, we have to
      enable runtime pm for usb interface of usbnet, otherwise
      usb_autopm_get_interface may return failure and cause
      'ifconfig usb0 up' failed if USB_SUSPEND(RUNTIME_PM) is
      enabled.
      
      Cc: David Brownell <dbrownell@users.sourceforge.net>
      Cc: Greg Kroah-Hartman <gregkh@suse.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Cc: Joe Perches <joe@perches.com>
      Cc: Oliver Neukum <oliver@neukum.org>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Cc: stable@kernel.org
      Signed-off-by: default avatarMing Lei <tom.leiming@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b0786b43
  31. Oct 22, 2010
Loading