aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/lib8390.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2011-06-24lib8390: Remove unnecessary externJoe Perches1-1/+0
Already declared in 8390.h Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-24lib8390: Convert include <asm to include <linuxJoe Perches1-2/+2
Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-24lib8390: Normalize source code spacingJoe Perches1-37/+44
Make more conformant to normal kernel style. Long line lengths > 80 columns ignored. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-24lib8390: Indent braces appropriatelyJoe Perches1-81/+38
Move the braces around to conform to kernel standard style. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-24lib8390: Use pr_<level> and netdev_<level>Joe Perches1-43/+43
Use the current logging styles. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-20lib8390: enable transmit and receive time stamping.Richard Cochran1-2/+3
This patch enables software (and phy device) time stamping. This file is included by drivers/net/ax88796.c, which is based on phylib. So, this patch makes hardware time stamping in the PHY possible. Compile tested only. Signed-off-by: Richard Cochran <richard.cochran@omicron.at> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-03-31Fix common misspellingsLucas De Marchi1-2/+2
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2010-11-17drivers/net: Remove unnecessary casts of netdev_privJoe Perches1-12/+12
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-10-288390: Don't oops on starting dev queuePavel Emelyanov1-1/+0
The __NS8390_init tries to start the device queue before the device is registered. This results in an oops (snipped): [ 2.865493] BUG: unable to handle kernel NULL pointer dereference at 0000000000000010 [ 2.866106] IP: [<ffffffffa000602a>] netif_start_queue+0xb/0x12 [8390] [ 2.881267] Call Trace: [ 2.881437] [<ffffffffa000624d>] __NS8390_init+0x102/0x15a [8390] [ 2.881999] [<ffffffffa00062ae>] NS8390_init+0x9/0xb [8390] [ 2.882237] [<ffffffffa000d820>] ne2k_pci_init_one+0x297/0x354 [ne2k_pci] [ 2.882955] [<ffffffff811c7a0e>] local_pci_probe+0x12/0x16 [ 2.883308] [<ffffffff811c85ad>] pci_device_probe+0xc3/0xef [ 2.884049] [<ffffffff8129218d>] driver_probe_device+0xbe/0x14b [ 2.884937] [<ffffffff81292260>] __driver_attach+0x46/0x62 [ 2.885170] [<ffffffff81291788>] bus_for_each_dev+0x49/0x78 [ 2.885781] [<ffffffff81291fbb>] driver_attach+0x1c/0x1e [ 2.886089] [<ffffffff812912ab>] bus_add_driver+0xba/0x227 [ 2.886330] [<ffffffff8129259a>] driver_register+0x9e/0x115 [ 2.886933] [<ffffffff811c8815>] __pci_register_driver+0x50/0xac [ 2.887785] [<ffffffffa001102c>] ne2k_pci_init+0x2c/0x2e [ne2k_pci] [ 2.888093] [<ffffffff81000212>] do_one_initcall+0x7c/0x130 [ 2.888693] [<ffffffff8106d74f>] sys_init_module+0x99/0x1da [ 2.888946] [<ffffffff81002a2b>] system_call_fastpath+0x16/0x1b This happens because the netif_start_queue sets respective bit on the dev->_tx array which is not yet allocated. As far as I understand the code removing the netif_start_queue from __NS8390_init is OK, since queue will be started later on device open. Plz, correct me if I'm wrong. Found in the Dave's current tree, so he's in Cc. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-05-14drivers/net: Remove unnecessary returns from void function()sJoe Perches1-1/+0
This patch removes from drivers/net/ all the unnecessary return; statements that precede the last closing brace of void functions. It does not remove the returns that are immediately preceded by a label as gcc doesn't like that. It also does not remove null void functions with return. Done via: $ grep -rP --include=*.[ch] -l "return;\n}" net/ | \ xargs perl -i -e 'local $/ ; while (<>) { s/\n[ \t\n]+return;\n}/\n}/g; print; }' with some cleanups by hand. Compile tested x86 allmodconfig only. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-05-10net: trans_start cleanupsEric Dumazet1-2/+1
Now that core network takes care of trans_start updates, dont do it in drivers themselves, if possible. Drivers can avoid one cache miss (on dev->trans_start) in their start_xmit() handler. Exceptions are NETIF_F_LLTX drivers Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-21net: small cleanup of lib8390Nikanth Karthikesan1-6/+6
Remove the always true #if 1. Also the unecessary re-test of ei_local->irqlock and the unreachable printk format string. Signed-off-by: Nikanth Karthikesan <knikanth@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-04-03net: convert multicast list to list_headJiri Pirko1-3/+3
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-02-26net: convert multiple drivers to use netdev_for_each_mc_addr, part5 V2Jiri Pirko1-11/+4
removed some needless checks and also corrected bug in lp486e (dmi was passed instead of dmi->dmi_addr) 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-09-01netdev: convert bulk of drivers to netdev_tx_tStephen Hemminger1-1/+2
In a couple of cases collapse some extra code like: int retval = NETDEV_TX_OK; ... return retval; into return NETDEV_TX_OK; Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-05net: convert remaining non-symbolic return values in ndo_start_xmit() functionsPatrick McHardy1-1/+1
This patch converts the remaining occurences of raw return values to their symbolic counterparts in ndo_start_xmit() functions that were missed by the previous automatic conversion. Additionally code that assumed the symbolic value of NETDEV_TX_OK to be zero is changed to explicitly use NETDEV_TX_OK. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-13net: use symbolic values for ndo_start_xmit() return codesPatrick McHardy1-1/+1
Convert magic values 1 and -1 to NETDEV_TX_BUSY and NETDEV_TX_LOCKED respectively. 0 (NETDEV_TX_OK) is not changed to keep the noise down, except in very few cases where its in direct proximity to one of the other values. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-158390/8390p: Fix compat netdev ops handling.David S. Miller1-6/+0
Based upon a report from Randy Dunlap. The compat netdev ops assignments need to happen in 8390.c and 8390p.c, not lib8390.c, as only the type specific code can assign the correct function pointers. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-11-258390: add common net_device opsStephen Hemminger1-14/+5
Fix the defactoring of ei_XXX functions in 8390 and 8390p. Remove the tx_timeout hack since no driver including the 3c503 overrides tx_timeout at this time, looks like a legacy thing. Also, since several drivers all have same hooks, provide common netdev_ops. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-11-21ne2k: convert to net_device_opsStephen Hemminger1-10/+16
Convert driver to new net_device_ops. Compile tested only. This required some additional work to export common code ei_XXX. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-11-03drivers/net: Kill now superfluous ->last_rx stores.David S. Miller1-1/+0
The generic packet receive code takes care of setting netdev->last_rx when necessary, for the sake of the bonding ARP monitor. Drivers need not do it any more. Some cases had to be skipped over because the drivers were making use of the ->last_rx value themselves. Signed-off-by: David S. Miller <davem@davemloft.net>
2008-10-08lib8390: Fix locking in ei_poll (poll controller)Jarek Poplawski1-2/+2
This lockdep warning: ================================= [ INFO: inconsistent lock state ] 2.6.27-rc7 #3 --------------------------------- inconsistent {in-softirq-W} -> {softirq-on-W} usage. syslogd/2474 [HC0[0]:SC0[0]:HE1:SE1] takes: (_xmit_ETHER#2){-+..}, at: [<c0265562>] netpoll_send_skb+0x132/0x190 ... is caused by unconditional local_irq_disable()/local_irq_enable() in disable_irq_lockdep()/enable_irq_lockdep() used by __ei_poll(). Since netconsole/netpoll always calls dev->poll_controller() with local irqs disabled, disable_irq()/enable_irq() instead is safe and enough (like e.g. in 3c509 or 8139xx drivers). Reported-and-tested-by: Bernard Pidoux F6BVP <f6bvp@free.fr> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-06-11[netdrvr] Fix 8390 build breakageStephen Rothwell1-0/+4
From: tony@bakeyournoodle.com (Tony Breeds) The commit 3f8cb098859bbea29d7b3765a3102e4a6bf81b85 (drivers/net/lib8390: fix warning, trim trailing whitespace) removed ei_local from ei_tx_err() and ei_rx_overrun() resulting in the following build errors on m68k and sh: Using /scratch1/tony/next as source for kernel GEN /scratch1/tony/next_out/Makefile CHK include/linux/version.h CHK include/linux/utsrelease.h CALL /scratch1/tony/next/scripts/checksyscalls.sh CHK include/linux/compile.h CC [M] drivers/net/zorro8390.o In file included from /scratch1/tony/next/drivers/net/zorro8390.c:47: drivers/net/lib8390.c: In function 'ei_tx_err': drivers/net/lib8390.c:556: error: 'ei_local' undeclared (first use in this function) drivers/net/lib8390.c:556: error: (Each undeclared identifier is reported only once drivers/net/lib8390.c:556: error: for each function it appears in.) drivers/net/lib8390.c: In function 'ei_rx_overrun': drivers/net/lib8390.c:823: error: 'ei_local' undeclared (first use in this function) make[3]: *** [drivers/net/zorro8390.o] Error 1 make[2]: *** [drivers/net] Error 2 make[1]: *** [drivers] Error 2 make: *** [sub-make] Error 2 The problem is that ei_inb_p() is using various #defines (from drivers/net/8390.h) that use EI_SHIFT, which in some drivers on some architectures use ei_local. Tag ei_local as "__maybe_unused" to keep it around and keep the warnings the original commit is trying to silence ... silenced. Signed-off-by: Tony Breeds <tony@bakeyournoodle.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-05-13drivers/net/lib8390: fix warning, trim trailing whitespaceJeff Garzik1-14/+12
fix drivers/net/lib8390.c: In function ‘ei_tx_err’: drivers/net/lib8390.c:556: warning: unused variable ‘ei_local’ drivers/net/lib8390.c: In function ‘ei_rx_overrun’: drivers/net/lib8390.c:819: warning: unused variable ‘ei_local’ and also trim whitespace. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-05-13lib8390: use netstats in net_device structurePaulius Zaleckas1-35/+35
Use net_device_stats from net_device structure instead of local. Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-02-03Fix a small number of "memeber" typoes.Robert P. J. Day1-1/+1
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Adrian Bunk <bunk@kernel.org>
2007-07-30lib8390: comment on locking by Alan CoxJarek Poplawski1-0/+46
Additional explanation of problems with locking by Alan Cox. Signed-off-by: Jarek Poplawski <jarkao2@o2.pl> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Paul Gortmaker <p_gortmaker@yahoo.com> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-26m32r: Fix ei_tx_timeout() in drivers/net/lib8390.cHirokazu Takata1-9/+0
Change INT0 trigger mode from edge-sense mode to level-sense mode, in order to fix the following timeout error: 'NETDEV WATCHDOG: eth0: transmit timed out'. This patch is required only for the Mappi platform. Signed-off-by: Hirokazu Takata <takata@linux-m32r.org> Cc: Hitoshi Yamamoto <hitoshiy@linux-m32r.org> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-04-25[ETH]: Make eth_type_trans set skb->dev like the other *_type_transArnaldo Carvalho de Melo1-1/+0
One less thing for drivers writers to worry about. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2006-12-02[PATCH] beginning of 8390 fixes - generic and arm/etherhAl Viro1-0/+1097
etherh and a handful of other odd drivers use different macros when building 8390.c. Since we generate a single 8390.o and then link with it, in any config with both oddball and normal 8390-based driver we will end up with breakage in at least one of them. Solution: take most of 8390.c into lib8390.c and have 8390.c, etherh.c and the rest of oddballs #include it. Helper macros are taken from 8390.h to whoever includes lib8390.c. That way odd drivers get separate instances of compiled 8390 stuff and stop stepping on each other's toes. 8390.h gets cleaned up - we don't have the cascade of ifdefs in there and are left with the stuff that can be used by any 8390-based driver. Current problems are exactly because of that cascade - we attempt to choose the set of helpers by looking at config and that, of course, doesn't work well when we have several sets needed by various drivers in our config. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>