aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb/asix.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-06-11Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-1/+1
2010-06-07asix: check packet size against mtu+ETH_HLEN instead of ETH_FRAME_LENJussi Kivilinna1-1/+1
Driver checks received packet is too large in asix_rx_fixup() and fails if it is. Problem is that MTU might be set larger than 1500 and asix fails to work correctly with VLAN tagged packets. The check should be 'dev->net->mtu + ETH_HLEN' instead. Tested with AX88772. Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-06-03drivers/net: use __packed annotationEric Dumazet1-1/+1
cleanup patch. Use new __packed annotation in drivers/net/ Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-05-25drivers/net/usb/asix.c: Fix pointer cast.David S. Miller1-2/+2
Stephen Rothwell reports the following new warning: drivers/net/usb/asix.c: In function 'asix_rx_fixup': drivers/net/usb/asix.c:325: warning: cast from pointer to integer of different size drivers/net/usb/asix.c:354: warning: cast from pointer to integer of different size The code just cares about the low alignment bits, so use an "unsigned long" cast instead of one to "u32". Signed-off-by: David S. Miller <davem@davemloft.net>
2010-05-17drivers/net/usb: Use kmemdupJulia Lawall1-2/+1
Use kmemdup when some other buffer is immediately copied into the allocated region. A simplified version of the semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression from,to,size,flag; statement S; @@ - to = \(kmalloc\|kzalloc\)(size,flag); + to = kmemdup(from,size,flag); if (to==NULL || ...) S - memcpy(to, from, size); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-05-17drivers/net/usb/asix.c: Fix unaligned accessesNeil Jones1-1/+33
Using this driver can cause unaligned accesses in the IP layer This has been fixed by aligning the skb data correctly using the spare room left over by the 4 byte header inserted between packets by the device. Signed-off-by: Neil Jones <NeilJay@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-11Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-0/+1
Conflicts: drivers/net/stmmac/stmmac_main.c drivers/net/wireless/wl12xx/wl1271_cmd.c drivers/net/wireless/wl12xx/wl1271_main.c drivers/net/wireless/wl12xx/wl1271_spi.c net/core/ethtool.c net/mac80211/scan.c
2010-04-03net: convert multicast list to list_headJiri Pirko1-10/+6
Converts the list and the core manipulating with it to be the same as uc_list. +uses two functions for adding/removing mc address (normal and "global" variant) instead of a function parameter. +removes dev_mcast.c completely. +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for manipulation with lists on a sandbox (used in bonding and 80211 drivers) Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.hTejun Heo1-0/+1
percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-10asix: fix setting mac address for AX88772Jussi Kivilinna1-2/+28
Setting new MAC address only worked when device was set to promiscuous mode. Fix MAC address by writing new address to device using undocumented command AX_CMD_READ_NODE_ID+1. Patch is tested with AX88772 device. Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Acked-by: David Hollis <dhollis@davehollis.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-18net/usb: convert to use netdev_for_each_mc_addrJiri Pirko1-8/+4
also removed needless checks in smsc95xx Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-17usbnet: Convert dev(dbg|err|warn|info) macros to netdev_<level>Joe Perches1-44/+53
These macros are too similar to the dev_<level> equivalents but take a usbnet * argument. Convert them to the recently introduced netdev_<level> macros and remove the old macros. The old macros had "\n" appended to the format string. Add the "\n" to the converted uses. Some existing uses of the dev<foo> macros in cdc_eem.c probably mistakenly had trailing "\n". No "\n" added there. Fix net1080 this/other log message inversion. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-12net: use netdev_mc_count and netdev_mc_empty when appropriateJiri Pirko1-6/+6
This patch replaces dev->mc_count in all drivers (hopefully I didn't miss anything). Used spatch and did small tweaks and conding style changes when it was suitable. Jirka Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-03drivers/net: Move && and || to end of previous lineJoe Perches1-6/+6
Only files where David Miller is the primary git-signer. wireless, wimax, ixgbe, etc are not modified. Compile tested x86 allyesconfig only Not all files compiled (not x86 compatible) Added a few > 80 column lines, which I ignored. Existing checkpatch complaints ignored. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-10usbnet: Set link down initially for drivers that update link stateBen Hutchings1-6/+6
Some usbnet drivers update link state while others do not due to hardware limitations. Add a flag to distinguish those that do, and set the link down initially for their devices. This is intended to fix this bug: http://bugs.debian.org/444043 Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-09-02netdev: drivers should make ethtool_ops constStephen Hemminger1-2/+2
No need to put ethtool_ops in data, they should be const. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-21usbnet: convert asix driver to net_device_opsStephen Hemminger1-7/+40
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-24asix: new device idsGreg Kroah-Hartman1-0/+8
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>
2008-12-18net: prepare usb net drivers for addition of status as a parameterOliver Neukum1-2/+3
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-11-20asix: Fix asix-based cards connecting to 10/100Mbs LAN.Pantelis Koukousoulas1-1/+3
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-13USB: net: asix: add support for Cables-to-Go USB Ethernet adapterJason Cooper1-0/+4
Add support to drivers/net/usb/asix.c for the Cables-to-Go "USB 2.0 to 10/100 Ethernet Adapter". USB id 0b95:772a. Signed-off-by: Jason Cooper <jason@lakedaemon.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-05-22net/usb: add support for Apple USB Ethernet AdapterAurelien Nephtali1-0/+4
Add support for Apple USB Ethernet Adapter. http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/wa/RSLID?nplm=MB442Z/A Signed-off-by: Aurelien Nephtali <aurelien@sitadelle.com> Acked-by: Greg KH <greg@kroah.com> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-05-08usb/asix: add Buffalo LUA-U2-GT 10/100/1000Mattia Dongili1-0/+4
The USB net adapter Buffalo LUA-U2-GT (0411:006e) carries a AX88178 chip. Tested on the above HW. Signed-off-by: Mattia Dongili <malattia@linux.it> Acked-off-by: David Hollis <dhollis@davehollis.com> Cc: Greg KH <greg@kroah.com> Acked-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-01-31Move usbnet.h and rndis_host.h to include/linux/usbJussi Kivilinna1-2/+1
Move headers usbnet.h and rndis_host.h to include/linux/usb and fix includes for drivers/net/usb modules. Headers are moved because rndis_wlan will be outside drivers/net/usb in drivers/net/wireless and yet need these headers. Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-12[usb netdev] asix: fix regressionRuss Dill1-3/+3
51bf2976b55d07f9daae9697a0a3ac9f58abcedc caused a regression in the asix usbnet driver. usb_control_msg returns the number of bytes read on success, not 0. Tested with NETGEAR FA120. Signed-off-by: Russ Dill <Russ.Dill@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-12-22asix fixesAl Viro1-130/+105
* usb_control_message() to/from stack (breaks on e.g. arm); some places did kmalloc() for buffer, some just worked from stack. Added kmalloc()/memcpy()/kfree() in asix_read_cmd()/asix_write_cmd(), removed that crap from callers. * Fixed a leak in ax88172_bind() - on success it forgot to kfree() the buffer. * Endianness bug in ax88178_bind() - we read a word from eeprom and work with it without converting to host-endian Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-10support for USB autosuspend in the asix driverOliver Neukum1-0/+1
this implements support for USB autosuspend in the asix USB ethernet driver. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-24asix.c - Add Belkin F5D5055 idsDavid Hollis1-0/+4
(Originally sent to linux-usb-devel) The attached patch adds the device IDs for the Belkin F5D5055 device. Reported by Andy Juniper <ajuniper@freeuk.com> Signed-off-by: David Hollis <dhollis@davehollis.com> -- David Hollis <dhollis@davehollis.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-09Move USB network drivers to drivers/net/usb.Jeff Garzik1-0/+1490
It is preferable to group drivers by usage (net, scsi, ATA, ...) than by bus. When reviewing drivers, the [PCI|USB|PCMCIA|...] maintainer is probably less qualified on networking issues than a networking maintainer. Also, from a practical standpoint, chips often appear on multiple buses, which is why we do not put drivers into drivers/pci/net. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>