aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/skge.c
AgeCommit message (Collapse)Author
2009-01-22MERGE-via-pending-tracking-hist-MERGE-via-stable-tracking-MERGE-via-mokopatc ↵merge
hes-tracking-fix-stray-endmenu-patch-1232632040-1232632141 pending-tracking-hist top was MERGE-via-stable-tracking-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040-1232632141 / fdf777a63bcb59e0dfd78bfe2c6242e01f6d4eb9 ... parent commitmessage: From: merge <null@invalid> MERGE-via-stable-tracking-hist-MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 stable-tracking-hist top was MERGE-via-mokopatches-tracking-fix-stray-endmenu-patch-1232632040 / 90463bfd2d5a3c8b52f6e6d71024a00e052b0ced ... parent commitmessage: From: merge <null@invalid> MERGE-via-mokopatches-tracking-hist-fix-stray-endmenu-patch mokopatches-tracking-hist top was fix-stray-endmenu-patch / 3630e0be570de8057e7f8d2fe501ed353cdf34e6 ... parent commitmessage: From: Andy Green <andy@openmoko.com> fix-stray-endmenu.patch Signed-off-by: Andy Green <andy@openmoko.com>
2008-10-08skge: Fix skge_set_ring_param() losing error returnWang Chen
The error return is useful to caller, driver shouldn't miss it. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-10-08[10/21] driver/net/skge.c: restart the interface when it's options orXiaoming.Zhang
pauseparam is set On Wednesday 24 September 2008 07:47, Stephen Hemminger wrote: > On Mon, 22 Sep 2008 14:52:17 -0700 > > akpm@linux-foundation.org wrote: > > From: "Xiaoming.Zhang" <Xiaoming.Zhang@resilience.com> > > > > We have an issue of the skge driver: The card won't work when it's > > options are changed. Here's the hardware info: > > > > # lspci -v > > 05:04.0 Ethernet controller: Marvell Technology Group Ltd. 88E8001 > > Gigabit Ethernet Controller (rev 13) Subsystem: Marvell Technology Group > > Ltd. Marvell RDK-8001 Flags: bus master, 66MHz, medium devsel, latency > > 32, IRQ 16 Memory at d042c000 (32-bit, non-prefetchable) [size=16K] I/O > > ports at d000 [size=256] > > [virtual] Expansion ROM at 20400000 [disabled] [size=128K] > > Capabilities: [48] Power Management version 2 > > Capabilities: [50] Vital Product Data > > > > The happens in both Linux-2.6.26(skge version 1.23) and RHEL5.2(skge > > version 1.6). > > > > For example, at first it is set to "speed 1000 duplex full auto-neg on" > > and it works, then run > > > > ethtool -s <ethx> autoneg off > > or ethtool -s <ethx> speed 100 duplex full autoneg off > > > > Then it will stop working. After that if we restart the interface: > > > > ifconifg <ethx> down > > ifconfig <ethx> up > > > > It will work again. And `ethtool -A' has the same issue. > > > > So we think after setting the options, the interface should be restarted. > > > > Signed-off-by: Zhang Xiaoming <xiaoming.zhang@resilience.com> > > Cc: Stephen Hemminger <shemminger@vyatta.com> > > Cc: Jeff Garzik <jeff@garzik.org> > > Signed-off-by: Andrew Morton <akpm@linux-foundation.org> > > --- > > > > drivers/net/skge.c | 12 ++++++++---- > > 1 file changed, 8 insertions(+), 4 deletions(-) > > > > diff -puN > > drivers/net/skge.c~driver-net-skgec-restart-the-interface-when-its-option > >s-or-pauseparam-is-set drivers/net/skge.c --- > > a/drivers/net/skge.c~driver-net-skgec-restart-the-interface-when-its-opti > >ons-or-pauseparam-is-set +++ a/drivers/net/skge.c > > @@ -353,8 +353,10 @@ static int skge_set_settings(struct net_ > > skge->autoneg = ecmd->autoneg; > > skge->advertising = ecmd->advertising; > > > > - if (netif_running(dev)) > > - skge_phy_reset(skge); > > + if (netif_running(dev)) { > > + skge_down(dev); > > + skge_up(dev); > > + } > > > > return (0); > > } > > @@ -595,8 +597,10 @@ static int skge_set_pauseparam(struct ne > > skge->flow_control = FLOW_MODE_NONE; > > } > > > > - if (netif_running(dev)) > > - skge_phy_reset(skge); > > + if (netif_running(dev)) { > > + skge_down(dev); > > + skge_up(dev); > > + } > > > > return 0; > > } > > Since skge_up can fail because of out of memory, this code needs to > check the return value. And then if it fails the "limbo state" needs > to be handled in skge_down. How about like this? It is tested. Thank you. Signed-off-by: Zhang Xiaoming <xiaoming.zhang@resilience.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-03-25netxen, phy/marvell, skge: minor checkpatch fixesJeff Garzik
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-03-25skge napi->poll() locking bugMarin Mitov
According to: Documentation/networking/netdevices.txt: <cite> napi->poll: .......... Context: softirq will be called with interrupts disabled by netconsole. </cite> napi->poll() could be called either with interrupts enabled (in softirq context) or disabled (by netconsole), so the irq flag should be preserved. Inspired by Ingo's resent forcedeth patch :-) Signed-off-by: Marin Mitov <mitov@issp.bas.bg> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-12-01skge: MTU changing fixStephen Hemminger
The code to change MTU doesn't correctly handle all the chip variations and requirements for restarting. On Genesis chips changing MTU would just cause receiver to hang. Use a simpler approach of just taking link down/up if needed. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-12-01skge: serial mode register valuesStephen Hemminger
For compatiablity with sk98lin, make sure and set same values in serial mode register. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-12-01skge version 1.13Stephen Hemminger
Version for 2.6.24 Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-12-01skge: increase TX threshold for JumboStephen Hemminger
Need to increase TX threshold when doing Jumbo frames on dual port board to avoid underruns. (Code from sk98lin). Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-12-01skge: fiber link up/down fixStephen Hemminger
The driver would not work over fibre if other end when down then came back up (would require reloading driver). The correct way to manage the link the same way for both TP and fibre. Resloves problem described in: http://lkml.org/lkml/2007/11/6/395 Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-12-01skge: retry on MAC shutdownStephen Hemminger
Make sure and retry when shutting down the MAC. This code is copied from sk98lin driver. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-12-01skge: receive flush logicStephen Hemminger
Receive FIFO overrun is not catastrophic condition, so don't flush when it happens. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-12-01skge: FIFO Ram calculation errorStephen Hemminger
The calculation of usable FIFO RAM is wrong in the skge driver. First, is doesn't take into account the reserved area on the original SysKonnect Genesis boards. Second it has an off-by-one error because hw->ports is either 1 or 2. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-11-15Revert "skge: fix ram buffer size calculation"Linus Torvalds
This reverts commit 7fb7ac241162dc51ec0f7644d4a97b2855213c32. Heikki Orsila reports that it causes a regression: "Doing nc host port < /dev/zero on a sending machine (not skge) to an skge machine that is receiving: nc -l -p port >/dev/null with ~60 MiB/s speed, causes the interface go malfunct. A slow transfer doesn't cause a problem." See http://bugzilla.kernel.org/show_bug.cgi?id=9321 for some more information. There is a workaround (also reported by Heikki): "After some fiddling, I noticed that not changing the register write order on patch: + skge_write32(hw, RB_ADDR(q, RB_END), end); skge_write32(hw, RB_ADDR(q, RB_WP), start); skge_write32(hw, RB_ADDR(q, RB_RP), start); - skge_write32(hw, RB_ADDR(q, RB_END), end); fixes the visible effect.. Possibly not the root cause of the problem, but changing the order back fixes networking here." but that has yet to be ack'ed or tested more widely, so the whole problem-causing commit gets reverted until this is resolved properly. Bisected-and-requested-by: Heikki Orsila <shdl@zakalwe.fi> Cc: Stephen Hemminger <shemminger@linux-foundation.org> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-16skge 1.12Stephen Hemminger
version update Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-16skge: add a debug interfaceStephen Hemminger
Add a debugfs interface to look at internal ring state. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-16skge: eeprom supportStephen Hemminger
Add ability to read/write EEPROM Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-16skge: internal statsStephen Hemminger
Use internal stats structure Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-16skge: XM PHY handling fixesStephen Hemminger
Change how PHY is managed on SysKonnect fibre based boards. Poll for PHY coming up 1 per second, but use interrupt to detect loss. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-16skge: changing MTU while running causes problemsStephen Hemminger
Rather than bring network down/up when changing MTU, only need to impact receiver. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-16skge: fix ram buffer size calculationStephen Hemminger
This fixes problems with transmit hangs on older fiber based SysKonnect boards. Adjust ram buffer sizing calculation to make it correct on all boards and make it like the code in sky2 driver. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-10[netdrvr] Stop using legacy hooks ->self_test_count, ->get_stats_countJeff Garzik
These have been superceded by the new ->get_sset_count() hook. Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10[NET]: Introduce and use print_mac() and DECLARE_MAC_BUF()Joe Perches
This is nicer than the MAC_FMT stuff. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10[ETHTOOL] Provide default behaviors for a few ethtool sub-ioctlsJeff Garzik
For the operations get-tx-csum get-sg get-tso get-ufo the default ethtool_op_xxx behavior is fine for all drivers, so we permit op==NULL to imply the default behavior. This provides a more uniform behavior across all drivers, eliminating ethtool(8) "ioctl not supported" errors on older drivers that had not been updated for the latest sub-ioctls. The ethtool_op_xxx() functions are left exported, in case anyone wishes to call them directly from a driver-private implementation -- a not-uncommon case. Should an ethtool_op_xxx() helper remain unused for a while, except by net/core/ethtool.c, we can un-export it at a later date. [ Resolved conflicts with set/get value ethtool patch... -DaveM ] Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10[NET]: Nuke SET_MODULE_OWNER macro.Ralf Baechle
It's been a useless no-op for long enough in 2.6 so I figured it's time to remove it. The number of people that could object because they're maintaining unified 2.4 and 2.6 drivers is probably rather small. [ Handled drivers added by netdev tree and some missed IRDA cases... -DaveM ] Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10[NET]: Make NAPI polling independent of struct net_device objects.Stephen Hemminger
Several devices have multiple independant RX queues per net device, and some have a single interrupt doorbell for several queues. In either case, it's easier to support layouts like that if the structure representing the poll is independant from the net device itself. The signature of the ->poll() call back goes from: int foo_poll(struct net_device *dev, int *budget) to int foo_poll(struct napi_struct *napi, int budget) The caller is returned the number of RX packets processed (or the number of "NAPI credits" consumed if you want to get abstract). The callee no longer messes around bumping dev->quota, *budget, etc. because that is all handled in the caller upon return. The napi_struct is to be embedded in the device driver private data structures. Furthermore, it is the driver's responsibility to disable all NAPI instances in it's ->stop() device close handler. Since the napi_struct is privatized into the driver's private data structures, only the driver knows how to get at all of the napi_struct instances it may have per-device. With lots of help and suggestions from Rusty Russell, Roland Dreier, Michael Chan, Jeff Garzik, and Jamal Hadi Salim. Bug fixes from Thomas Graf, Roland Dreier, Peter Zijlstra, Joseph Fannin, Scott Wood, Hans J. Koch, and Michael Chan. [ Ported to current tree and all drivers converted. Integrated Stephen's follow-on kerneldoc additions, and restored poll_list handling to the old style to fix mutual exclusion issues. -DaveM ] Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-07-31[NET]: ethtool_perm_addr only has one implementationMatthew Wilcox
All drivers implement ethtool get_perm_addr the same way -- by calling the generic function. So we can inline the generic function into the caller and avoid going through the drivers. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-05-11skge: crash on shutdown/suspendStephen Hemminger
If device is not fails during module startup (like unsupported chip version) then driver would crash dereferencing a null pointer, on shutdown or suspend/resume. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-09skge: default WOL should be magic only (rev2)Stephen Hemminger
By default, the skge driver now enables wake on magic and wake on PHY. This is a bad default (bug), wake on PHY means machine will never shutdown if connected to a switch. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>a Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-08skge: allow WOL except for known broken chipsStephen Hemminger
Wake On Lan works correctly on Yukon-FE and other variants. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>a Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28skge: version 1.11Stephen Hemminger
New version to track changes. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28skge: transmit locking improvementsStephen Hemminger
Don't need to lock when processing transmit complete unless queue fills. Modeled after tg3. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-25[SK_BUFF]: Introduce skb_copy_from_linear_data{_offset}Arnaldo Carvalho de Melo
To clearly state the intent of copying from linear sk_buffs, _offset being a overly long variant but interesting for the sake of saving some bytes. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2007-04-25[SK_BUFF]: Introduce ipip_hdr(), remove skb->h.ipiphArnaldo Carvalho de Melo
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25[SK_BUFF]: Introduce skb_transport_offset()Arnaldo Carvalho de Melo
For the quite common 'skb->h.raw - skb->data' sequence. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-11skge: fix wake on lanStephen Hemminger
Need to rework wake on lan code to setup properly and get activated on shutdown (and suspend), not when ethtool is run. This does not need to go to stable queue because wake on lan was not even included in 2.6.20 (or earlier versions). Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-11skge: turn carrier off when downStephen Hemminger
Driver needs to turn off carrier when down, otherwise it can confuse bonding and bridging and looks like carrier is on immediately when it is brought back up. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-23skge: use per-port phy lockingStephen Hemminger
Rather than a workqueue and a per-board mutex to control PHY, use a tasklet and spinlock. Tasklet is lower overhead and works just as well for this. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-23skge: mask irqs when device downStephen Hemminger
Wheen a port on the skge driver is not used, it should mask off interrupts from theat port. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-23skge: deadlock on tx timeoutStephen Hemminger
The skge driver will deadlock if gets a transmit timeout because the netif_tx_lock() is already held. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-15skge: set mac address bonding fixStephen Hemminger
When bonding does fail over it calls set_mac_address. When this happens as the result of another port going down, the phy_mutex that is common to both ports is held, so it deadlocks. Setting the address doesn't need to do anything that needs the phy_mutex, it already has the RTNL to protect against other admin actions. This change just disables the receiver to avoid any hardware confusion while address is changing. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-27skge: comma consistencyStephen Hemminger
Use comma's consistently. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-27skge: fix transmitter flow controlStephen Hemminger
It looks like the skge driver inherited another bug from the sk98lin code. If I send from 1000mbit port to a machine on 100mbit port, the switch should be doing hardware flow control, but no pause frames show up in the statistics. This is the analog of the recent sky2 fixes. The device needs to listen for multicast pause frames and then not discard them. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-20skge: race with workq and RTNLStephen Hemminger
If a workqueue function that needs RTNL is running when skge_down is called then a deadlock is possible. Fix by only clearing the timer, and handling the flush_scheduled_work on removal. This work queue is only ever used for the old fiber based boards. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-06skge: version 1.10Stephen Hemminger
Mark this as 1.10 because WOL now works Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-06skge: WOL supportStephen Hemminger
Add WOL support for Yukon chipsets in skge device. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-06skge: use dev_printkStephen Hemminger
Use dev_printk related macros for PCI related errors and warnings Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-06skge: handle zero address at openStephen Hemminger
Some motherboards are broken and have no address set. Failing at probe time prevents the device from ever being used (like to download a fixed BIOS). Instead warn on probe and check again when device is brought up. That way the address can be set. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-01-23[PATCH] email change for shemminger@osdl.orgStephen Hemminger
Change my email address to reflect OSDL merger. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> [ The irony. Somebody still has his sign-off message hardcoded in a script or his brainstem ;^] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2006-12-26netpoll: drivers must not enable IRQ unconditionally in their NAPI handlerFrancois Romieu
net/core/netpoll.c::netpoll_send_skb() calls the poll handler when it is available. As netconsole can be used from almost any context, IRQ must not be enabled blindly in the NAPI handler of a driver which supports netpoll. b57bd06655a028aba7b92e1c19c2093e7fcfb341 fixed the issue for the 8139too.c driver. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>