summaryrefslogtreecommitdiffstats
path: root/drivers/net/sky2.c
Commit message (Collapse)AuthorAgeFilesLines
...
* | sky2: Refactor sky2_get_regs into two functionsMike McCormack2010-01-061-46/+48
|/ | | | | | | | | Separate code deciding which registers can be accessed out of sky2_get_regs in preparation for adding more conditions into it. Signed-off-by: Mike McCormack <mikem@ring3k.org> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: leave PCI config space writeablestephen hemminger2009-12-141-13/+0
| | | | | | | | | Since power management is done by PCI subsystem as well as driver, don't toggle the bit that disables PCI register writes. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: print Optima chip namestephen hemminger2009-12-141-1/+1
| | | | | | | Off by one in name lookup makes Optima display as (chip 0xbc) Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of /home/davem/src/GIT/linux-2.6/David S. Miller2009-12-111-1/+1
|\ | | | | | | | | Conflicts: include/net/tcp.h
| * Merge branch 'for-linus' of ↵Linus Torvalds2009-12-091-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (42 commits) tree-wide: fix misspelling of "definition" in comments reiserfs: fix misspelling of "journaled" doc: Fix a typo in slub.txt. inotify: remove superfluous return code check hdlc: spelling fix in find_pvc() comment doc: fix regulator docs cut-and-pasteism mtd: Fix comment in Kconfig doc: Fix IRQ chip docs tree-wide: fix assorted typos all over the place drivers/ata/libata-sff.c: comment spelling fixes fix typos/grammos in Documentation/edac.txt sysctl: add missing comments fs/debugfs/inode.c: fix comment typos sgivwfb: Make use of ARRAY_SIZE. sky2: fix sky2_link_down copy/paste comment error tree-wide: fix typos "couter" -> "counter" tree-wide: fix typos "offest" -> "offset" fix kerneldoc for set_irq_msi() spidev: fix double "of of" in comment comment typo fix: sybsystem -> subsystem ...
| | * sky2: fix sky2_link_down copy/paste comment errorBrandon Philips2009-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | Fix copy/paste comment error from sky2_link_up to sky2_link_down. Signed-off-by: Brandon Philips <bphilips@suse.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | net: Add missing TST_CFG_WRITE bits around sky2_pci_writeTakashi Iwai2009-12-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add missing TST_CFG_WRITE bits around sky2_pci_write*() in Optima setup routines. Without the cfg-write bits, the driver may spew endless link-up messages through qlink irq. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | | net: Fix Yukon-2 Optima TCP offload setupTakashi Iwai2009-12-111-0/+5
|/ / | | | | | | | | | | | | | | Fix the TCP offload setup for Yukon-2 Optima. It requires SKY2_HW_NE_LE flag unlike Ultra 2. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | drivers/net: Move && and || to end of previous lineJoe Perches2009-12-031-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'master' of ↵David S. Miller2009-11-061-0/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/usb/cdc_ether.c All CDC ethernet devices of type USB_CLASS_COMM need to use '&mbm_info'. Signed-off-by: David S. Miller <davem@davemloft.net>
| * sky2: set carrier off in probeBrandon Philips2009-10-301-0/+2
| | | | | | | | | | | | | | | | | | Before bringing up a sky2 interface up ethtool reports "Link detected: yes". Do as ixgbe does and netif_carrier_off() on probe(). Signed-off-by: Brandon Philips <bphilips@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sky2: version 1.26Stephen Hemminger2009-10-291-1/+1
| | | | | | | | | | Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sky2: 88E8059 supportStephen Hemminger2009-10-291-1/+78
| | | | | | | | | | | | | | | | | | Tentative support for newer Marvell hardware including the Yukon-2 Optima chip. Do not have hatdware to test this yet, code is based on vendor driver. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sky2: workarounds for Yukon-2 supremeStephen Hemminger2009-10-291-2/+32
| | | | | | | | | | | | | | | | | | Changes related to support of Yukon supreme chip. Don't have this chip version to test on, these are reverse engineered from the vendor (GPL) driver. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sky2: fix receive pause thresholdsStephen Hemminger2009-10-291-2/+8
| | | | | | | | | | | | | | | | Program the receive pause thresholds differently depending on chip version. This cloned from from the vendor (GPL) driver. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sky2: add SK-9E21M device idStephen Hemminger2009-10-291-0/+1
| | | | | | | | | | | | | | This is a new ID that just showed up in latest vendor driver. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | net: Use netdev_alloc_skb_ip_align()Eric Dumazet2009-10-131-2/+1
|/ | | | | Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: irqname based on pci addressStephen Hemminger2009-10-011-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is based on Michal Schmidt fix for skge. Most network drivers request their IRQ when the interface is activated. sky2 does it in ->probe() instead, because it can work with two-port cards where the two net_devices use the same IRQ. This works fine most of the time, except in some situations when the interface gets renamed. Consider this example: 1. modprobe sky2 The card is detected as eth0 and requests IRQ 17. Directory /proc/irq/17/eth0 is created. 2. There is an udev rule which says this interface should be called eth1, so udev renames eth0 -> eth1. 3. modprobe 8139too The Realtek card is detected as eth0. It will be using IRQ 17 too. 4. ip link set eth0 up Now 8139too requests IRQ 17. The result is: WARNING: at fs/proc/generic.c:590 proc_register ... proc_dir_entry '17/eth0' already registered The fix is for sky2 to name the irq based on the pci device, as is done by some other devices DRM, infiniband, ... ie. sky2@pci:0000:00:00 Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Reviewed-by: Michal Schmidt <mschmidt@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of /home/davem/src/GIT/linux-2.6/David S. Miller2009-09-241-1/+1
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/staging/Kconfig drivers/staging/Makefile drivers/staging/cpc-usb/TODO drivers/staging/cpc-usb/cpc-usb_drv.c drivers/staging/cpc-usb/cpc.h drivers/staging/cpc-usb/cpc_int.h drivers/staging/cpc-usb/cpcusb.h
| * trivial: remove unnecessary semicolonsJoe Perches2009-09-211-1/+1
| | | | | | | | | | Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | sky2: Set SKY2_HW_RAM_BUFFER in sky2_initMike McCormack2009-09-221-1/+3
|/ | | | | | | | | | | | The SKY2_HW_RAM_BUFFER bit in hw->flags was checked in sky2_mac_init(), before being set later in sky2_up(). Setting SKY2_HW_RAM_BUFFER in sky2_init() where other hw->flags are set should avoid this problem recurring. Signed-off-by: Mike McCormack <mikem@ring3k.org> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: Make sure both ports initialize correctlyStephen Hemminger2009-09-151-6/+8
| | | | | | | | | Sorry Mike, I sent you off the wrong way. The following is simpler and the second port is diffrent enough in setup (because of NAPI), that the following is simpler. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: transmit ring accountingStephen Hemminger2009-09-151-4/+6
| | | | | | | Be more accurate about number of transmit list elements required. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: Remove redundant checks for CAP_NET_ADMIN in MDIO implementationsBen Hutchings2009-09-031-3/+0
| | | | | | | | dev_ioctl() already checks capable(CAP_NET_ADMIN) before calling the driver's implementation of MDIO ioctls. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: only enable Vaux if capable of wakeupStephen Hemminger2009-09-031-2/+3
| | | | | | | | | While perusing vendor driver, I saw that it did not enable the Vaux power unless device was able to wake from lan for D3cold. This might help for Rene's power issue. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: Use 32bit read to read Y2_VAUX_AVAILMike McCormack2009-09-011-1/+1
| | | | | | | | | | B0_CTST is a 24bit register according to the vendor driver (sk98lin). A 16bit read on B0_CTST will always return 0 for Y2_VAUX_AVAIL (1<<16), so use a 32bit read when testing Y2_VAUX_AVAIL Signed-off-by: Mike McCormack <mikem@ring3k.org> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: Create buffer alloc and free helpersMike McCormack2009-09-011-53/+60
| | | | | | | | | Refactor similar two sections of code that free buffers into one. Only call tx_init if all buffer allocations succeed. Signed-off-by: Mike McCormack <mikem@ring3k.org> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: fix management of driver LEDStephen Hemminger2009-09-011-6/+6
| | | | | | | | | | | | Observed by Mike McCormack. The LED bit here is just a software controlled value used to turn on one of the LED's on some boards. The register value was wrong, which could have been causing some power control issues. Get rid of problematic define use the correct mask. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: convert bulk of drivers to netdev_tx_tStephen Hemminger2009-09-011-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>
* sky2: version 1.25Stephen Hemminger2009-08-181-1/+1
| | | | | Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: no recyclingStephen Hemminger2009-08-181-13/+3
| | | | | | | | | | | Recycling turns out to be a bad idea! For most use cases, the packet can not be reused: TCP packets are cloned. Even for the ideal case of forwarding, it hurts performance because of CPU ping/pong. On a multi-core system forwarding of 64 byte packets is worse much worse: recycling = 24% forwarded vs no recycling = 42% forwarded Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: optimize transmit completionStephen Hemminger2009-08-181-49/+31
| | | | | | | | | Don't reference the list element in hardware transmit ring on transmit completion. The list element is updated by hardware, therefore it causes a cache miss. Do book keeping in software structure. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: dynamic size transmit ringStephen Hemminger2009-08-181-23/+27
| | | | | | | | Allocate and size transmit ring based on parameters. Saves excess space and allows configuring larger rings for testing. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: simplify list element errorStephen Hemminger2009-08-181-14/+10
| | | | | | | | | The code for list element error (which should only happen on hardware errors) should be cleaner and safer. Gets rid of unused ring_size argument, which makes next patch easier. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: transmit ring 64 bit conservationStephen Hemminger2009-08-181-6/+11
| | | | | | | | | This patch saves elements on transmit ring by only updating the upper 64 bit address when it changes. With many workloads skb's are located in same region, so it saves space. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: use upper/lower 32 bitsStephen Hemminger2009-08-181-6/+6
| | | | | | | | Use the existing macros to show where DMA address is being broken apart. This is cosmetic only. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: remove restarting workaround flagStephen Hemminger2009-08-141-13/+1
| | | | | | | | | | The whole restarting flag was introduced by Mike McCormack and was a temporary duct tape patch around issues with transmits inflight during restart. The problems it was covering are now fixed and the code should have been reverted. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: version 1.24Stephen Hemminger2009-08-141-1/+1
| | | | | Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: fix pause negotiationStephen Hemminger2009-08-141-26/+47
| | | | | | | | | | The sky2 driver combines auto speed negotiation with automatic negotiation of pause parameters; but the ethtool interface expects them to be split. This patch allows autonegotiation to be used for speed, but manually disable flow control. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: lock less transmit completionStephen Hemminger2009-08-141-16/+9
| | | | | | | | | | | | | Transmit completion can safely run lockless against transmit start. In the normal case, completion is done from NAPI and only looks at elements that are at the tail of the ring. When doing shutdown or reset, the transmiter should be completely block by NAPI disable and blocking of transmit queue. Based on earlier work by Mike McCormack. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: cleanup restart operationsStephen Hemminger2009-08-141-47/+48
| | | | | | | | | | | | This unifies the places that bounce the device (suspend/resume and restart). And makes the operations have the same semantics as normal dev_open/dev_stop. This also avoids setting the multicast addresses twice when device is brought up. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: hold RTNL when doing suspend/shutdown operationsStephen Hemminger2009-08-141-0/+4
| | | | | | | | The suspend and shutdown code plays with shared state. Use consistent locking, for extra protection. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: hold spinlock around phy_power_downStephen Hemminger2009-08-141-0/+2
| | | | | | | | | | | Avoid any possible problems with accessing PHY registers on shutdown. This is a purely theoretical issue and is not related to any of the outstanding bug reports. Since receiver and transmitter are already shutdown and phy interrupts for this device are already disabled, there should already be enough protection. Suggested by Mike McCormack. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: Reset tx train after interrupts disabled.Mike McCormack2009-08-141-6/+3
| | | | | | | | | | | Reseting the tx chain too soon results in invalid tx queue positions being delivered in the status queue. This also makes sure there's no overlap between the cleanup done by sky2_tx_clean() and sky2_tx_done(). Signed-off-by: Mike McCormack <mikem@ring3k.org> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: Move tx reset functionality to sky2_tx_reset()Mike McCormack2009-08-141-18/+26
| | | | | | | | This is pure refactoring. Signed-off-by: Mike McCormack <mikem@ring3k.org> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: Avoid rewinding sky2->tx_prodMike McCormack2009-08-141-16/+18
| | | | | | | | | Keep sky2->tx_prod consistent since int might be examined by an softirq poll or restart. Signed-off-by: Mike McCormack <mikem@ring3k.org> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵David S. Miller2009-08-121-1/+13
|\ | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: arch/microblaze/include/asm/socket.h
| * sky2: Avoid transmits during sky2_down()Mike McCormack2009-08-031-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch supersedes my previous patch "sky2: Avoid transmitting during sky2_restart". I have reworked the patch to avoid crashes during both sky2_restart() and sky2_set_ringparam(). Without this patch, the sky2 driver can be crashed by doing: # pktgen eth1 & (transmit many packets on eth1) # ethtool -G eth1 tx 510 I am aware you object to storing extra state, but I can't see a way around this. Without remembering that we're restarting, netif_wake_queue() is called in the ISR from sky2_tx_complete(), and netif_tx_lock() is used in sky2_tx_done(). If anybody can see a way around this, please let me know. Signed-off-by: Mike McCormack <mikem@ring3k.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sky2: remove unnecessary assignmentMike McCormack2009-07-261-1/+1
|/ | | | | | Signed-off-by: Mike McCormack <mikem@ring3k.org> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: Avoid races in sky2_downMike McCormack2009-07-211-8/+8
| | | | | | | | | Reset rx chain before trying to drain it. Shut interrupts off last, incase there's something to report. Signed-off-by: Mike McCormack <mikem@ring3k.org> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
OpenPOWER on IntegriCloud