aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/niu.c
Commit message (Collapse)AuthorAge
* niu: Fix unused variable warning.David S. Miller2009-04-08
| | | | | | Don't strain gcc's tiny mind. Signed-off-by: David S. Miller <davem@davemloft.net>
* niu: Fix error handlingDan Carpenter2009-04-08
| | | | | | | | | | platform_device_register_simple() returns ERR_PTR(), not NULL, if an error occurs. Found by smatch (http://repo.or.cz/w/smatch.git). Compile tested. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)Yang Hongyang2009-04-07
| | | | | | | | Replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* niu: Add GRO support.David S. Miller2009-03-29
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* niu: Add TCAM classification configurationSantwona Behera2009-02-20
| | | | | Signed-off-by: Santwona Behera <santwona.behera@sun.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* niu: improve ethtool support for gigabit copper cardsConstantin Baranov2009-02-18
| | | | | | | | | | | | | | | | | | | Introduced support for link speed and duplex setting (ethtool -s), link advertising parameters and autonegotiation (ethtool -r): - struct niu_link_config: split advertising and autoneg fields into active and target values (similar to speed and duplex fields) - mii_init_common(): rewrite function to actually apply requested niu_link_config parameters instead of providing default initialization - link_status_1g(): move parsing of MII registers into new link_status_mii() function (link_status_1g_rgmii() could possibly use this new implementation too) - introduce simple nway_reset method - fix incorrect XMAC_CONFIG_MODE selection for 10Mbps case Signed-off-by: Constantin Baranov <baranov@mercdev.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* niu: fix PHY template choice for 10G copperConstantin Baranov2009-02-18
| | | | | | | | Fixed a typo in niu_determine_phy_disposition() which resulted in phy_template_1g_copper being selected for 10G/copper configuration. Signed-off-by: Constantin Baranov <baranov@mercdev.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net/niu.c: fix sparse warning: symbol shadows an earlier oneHannes Eder2009-02-17
| | | | | | | | | | | Impact: Move variable declaration to a more inner scope. Fix this sparse warning: drivers/net/niu.c:2399:21: warning: symbol 'err' shadows an earlier one drivers/net/niu.c:2287:13: originally declared here Signed-off-by: Hannes Eder <hannes@hanneseder.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: replace uses of __constant_{endian}Harvey Harrison2009-02-01
| | | | | | | Base versions handle constant folding now. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: Add skb_record_rx_queue() calls to multiqueue capable drivers.David S. Miller2009-01-27
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* net: Remove redundant NAPI functionsBen Hutchings2009-01-21
| | | | | | | | | | | Following the removal of the unused struct net_device * parameter from the NAPI functions named *netif_rx_* in commit 908a7a1, they are exactly equivalent to the corresponding *napi_* functions and are therefore redundant. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net: fix sparse warning: returning void-valued expressionHannes Eder2008-12-26
| | | | | | | | | Fix this sparse warning: drivers/net/niu.c:8850:2: warning: returning void-valued expression Signed-off-by: Hannes Eder <hannes@hanneseder.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: Remove unused netdev arg from some NAPI interfaces.Neil Horman2008-12-22
| | | | | | | | | | When the napi api was changed to separate its 1:1 binding to the net_device struct, the netif_rx_[prep|schedule|complete] api failed to remove the now vestigual net_device structure parameter. This patch cleans up that api by properly removing it.. Signed-off-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* NIU: Implement discard counters, optimizeJesper Dangaard Brouer2008-12-19
| | | | | | | | | | Optimize the lightly loaded case, by only synchronizing discards stats when qlen > 10 indicate potential for drops. Notice Robert Olsson might disagree with this patch. Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
* NIU: Implement discard counters, info/debug statements.Jesper Dangaard Brouer2008-12-19
| | | | | | | | Discard packet counter debug statements that can be turned on at runtime by users to assist debugging of the driver code. Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
* NIU: Implement discard countersJesper Dangaard Brouer2008-12-19
| | | | | | | | | | | | | | | | | | | | | | | Implementing discard counters for the NIU driver turned out to be more complicated than first assumed. The discard counters for the NIU neptune chip are only 16-bit (even though this is a 64-bit chip). These 16-bit counters can overflow quickly, especially considering this is a 10Gbit/s ethernet card. The overflow indication bit is, unfortunatly, not usable as the counter value does not wrap, but remains at max value 0xFFFF. Resulting in lost counts until the counter is reset. The read and reset scheme also poses a problem. Both in theory and in practice counters can be lost in between reading nr64() and clearing the counter nw64(). For this reason, the number of counter clearings nw64() is limited/reduced. On the fast-path the counters are only syncronized once it exceeds 0x7FFF. When read by userspace, its syncronized fully. Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
* niu: use net_device_stats nowadays available in net_deviceIlpo Järvinen2008-11-28
| | | | | Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
* niu: fix another warning in drivers/net/niu.cIngo Molnar2008-11-25
| | | | | | | | | | | | | | | | | this warning: drivers/net/niu.c: In function ‘esr_reset’: drivers/net/niu.c:741: warning: ‘reset’ may be used uninitialized in this function triggers because GCC does not recognize the (correct) error flow between: - esr_read_reset() and 'reset' Annotate it. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: David S. Miller <davem@davemloft.net>
* niu: fix warnings in drivers/net/niu.cIngo Molnar2008-11-25
| | | | | | | | | | | | | | | | | these warnings: drivers/net/niu.c: In function ‘serdes_init_niu_1g_serdes’: drivers/net/niu.c:451: warning: ‘sig’ may be used uninitialized in this function drivers/net/niu.c: In function ‘serdes_init_niu_10g_serdes’: drivers/net/niu.c:550: warning: ‘sig’ may be used uninitialized in this function triggers because GCC does not recognize that the max_retry loop always initializes 'sig', due to max_retry != 0. Annotate them. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: David S. Miller <davem@davemloft.net>
* niu: Naming interrupt vectors.Robert Olsson2008-11-25
| | | | | | | | | | | | | | | | | A patch to put names on the niu interrupt vectors according the syntax below. This is needed to assign correct affinity. > So on a multiqueue card with 2 RX queues and 2 TX queues we'd > have names like: > > eth0-rx-0 > eth0-rx-1 > eth0-tx-0 > eth0-tx-1 Signed-off-by: Robert Olsson <robert.olsson@its.uu.se> Tested-by: Jesper Dangaard Brouer <jdb@comx.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: add more functions to netdevice opsStephen Hemminger2008-11-20
| | | | | | | | | | | | This patch moves neigh_setup and hard_start_xmit into the network device ops structure. For bisection, fix all the previously converted drivers as well. Bonding driver took the biggest hit on this. Added a prefetch of the hard_start_xmit in the fast path to try and reduce any impact this would have. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* niu: convert to net_device_opsStephen Hemminger2008-11-20
| | | | | | | Convert this driver to network device ops. Compile tested only (give me hw!) Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵David S. Miller2008-11-19
|\ | | | | | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/isdn/i4l/isdn_net.c fs/cifs/connect.c
| * niu: Bump driver version and release date.David S. Miller2008-11-14
| | | | | | | | | | | | | | | | | | | | This driver is pretty mature, and the worst of the known problems has been fixed (the 32-bit failures due to readq implementation). So let's finally give it a version of 1.0 Signed-off-by: David S. Miller <davem@davemloft.net>
| * NIU: Add Sun CP3260 ATCA blade supportSantwona Behera2008-11-14
| | | | | | | | | | | | | | | | | | This patch adds support for the Sun CP3260 ATCA blade which is a N2 based ATCA blade with 2 NIU ports. The NIU ports do not have on-board PHY. Signed-off-by: Santwona Behera <santwona.behera@sun.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * niu: Fix readq implementation when architecture does not provide one.David S. Miller2008-11-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a TX hang reported by Jesper Dangaard Brouer. When an architecutre cannot provide a fully functional 64-bit atomic readq/writeq, the driver must implement it's own. This is because only the driver can say whether doing something like using two 32-bit reads to implement the full 64-bit read will actually work properly. In particular one of the issues is whether the top 32-bits or the bottom 32-bits of the 64-bit register should be read first. There could be side effects, and in fact that is exactly the problem here. The TX_CS register has counters in the upper 32-bits and state bits in the lower 32-bits. A read clears the state bits. We would read the counter half before the state bit half. That first read would clear the state bits, and then the driver thinks that no interrupts are pending because the interrupt indication state bits are seen clear every time. Fix this by reading the bottom half before the upper half. Tested-by: Jesper Dangaard Brouer <jdb@comx.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge branch 'master' of ↵David S. Miller2008-11-07
|\| | | | | | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/wireless/ath5k/base.c net/8021q/vlan_core.c
| * niu: Use pci_ioremap_bar().David S. Miller2008-11-03
| | | | | | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* | drivers/net: Kill now superfluous ->last_rx stores.David S. Miller2008-11-04
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | net: convert print_mac to %pMJohannes Berg2008-10-27
|/ | | | | | | | | | | | This converts pretty much everything to print_mac. There were a few things that had conflicts which I have just dropped for now, no harm done. I've built an allyesconfig with this and looked at the files that weren't built very carefully, but it's a huge patch. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵David S. Miller2008-09-16
|\ | | | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6 Conflicts: arch/sparc64/kernel/pci_psycho.c
| * niu: panic on resetSantwona Behera2008-09-12
| | | | | | | | | | | | | | | | | | The reset_task function in the niu driver does not reset the tx and rx buffers properly. This leads to panic on reset. This patch is a modified implementation of the previously posted fix. Signed-off-by: Santwona Behera <santwona.behera@sun.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | sparc: Annotate of_device_id arrays with const or __initdata.David S. Miller2008-08-31
|/ | | | | | As suggested by Stephen Rothwell. Signed-off-by: David S. Miller <davem@davemloft.net>
* niu: Fix error checking in niu_ethflow_to_class.Andreas Schwab2008-07-30
| | | | | | | | The callers of niu_ethflow_to_class expect zero as error, but it returns -1 instead. Signed-off-by: Andreas Schwab <schwab@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
* niu: Add TX multiqueue support.David S. Miller2008-07-17
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* niu: Add support for rx flow hash configuration.Santwona Behera2008-07-02
| | | | | | | | Implemented ethtool callback functions for configuring receive flow hashing in the niu driver. Signed-off-by: Santwona Behera <santwona.behera@sun.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* niu: Determine the # of ports from the card's VPD dataMatheos Worku2008-05-12
| | | | | | | | | | | | Determine the number of physical ports from the card's VPD data. Previous fix failed on Maramba platform which doesn't have the "board-model" property. This fix uses the "model" property which exists on all cards and Neptune based motherboards. cstyle cleanup included. Signed-off-by: Matheos Worku <matheos.worku@sun.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* niu: Fix probing regression for maramba on-board chips.David S. Miller2008-05-04
| | | | | | | | | | | | | | | | Changeset 7f7c4072ea552f97a0898331322f71986a97299c ("niu: Determine the # of ports from the card's VPD data") caused maramba on-board NIU ports to stop probing properly. The old code had a fallback that would use a num_ports value of 4 if all the probing methods failed, but that was removed. This restores the fallback of 4 ports, to get things working again. Bump driver version and release date. Signed-off-by: David S. Miller <davem@davemloft.net>
* niu: Add support for Neptune FEM/NEM cards for C10 server bladesMatheos Worku2008-04-25
| | | | | | | | [ Minor coding style and whitespace corrections, also bump driver version and release date. -DaveM ] Signed-off-by: Matheos Worku <matheos.worku@sun.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* niu: Determine the # of ports from the card's VPD dataMatheos Worku2008-04-25
| | | | | | | [ Fix minor whitespace and coding style stuff... -DaveM ] Signed-off-by: Matheos Worku <matheos.worku@sun.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NIU]: Add Support for Sun ATCA Blade Server.Matheos Worku2008-02-29
| | | | | | | | | | Ports 0 and 1 of the NIU device are connected to extended fabric through SERDES. Ports 2 and 3 are connected using RGMII Fiber mode. [ Coding style cleanups... -DaveM ] Signed-off-by: Matheos Worku <matheos.worku@sun.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NIU]: More BMAC alt MAC address fixes.Matheos Worku2008-02-20
| | | | | | | | | | | From: Matheos Worku <Matheos.Worku@Sun.COM> 1) niu_enable_alt_mac() needs to be adjusted so that the mask is computed properly for the BMAC case. 2) BMAC has 6 alt MAC addresses available, not 7. Signed-off-by: David S. Miller <davem@davemloft.net>
* [NIU]: Bump driver version and release date.David S. Miller2008-02-19
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [NIU]: Fix BMAC alternate MAC address indexing.Matheos Worku2008-02-19
| | | | | | | | BMAC port alternate MAC address index needs to start at 1. Index 0 is used for the main MAC address. Signed-off-by: Matheos Worku <matheos.worku@sun.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NIU]: Use print_macJoe Perches2008-01-28
| | | | | Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* [NIU]: Fix 1G PHY link state handling.David S. Miller2008-01-17
| | | | | | | | | | | | The code in link_status_1g() computes the active speed and duplex but does not update the link config state with those values. As a result the link speed is not reported correctly and the XIF is not reprogrammed properly on link up events. Signed-off-by: David S. Miller <davem@davemloft.net>
* [NIU]: Support for Marvell PHYMirko Lindner2008-01-10
| | | | | | | | | | | | | From: Mirko Lindner <mlindner@marvell.com> This patch makes necessary changes in the Neptune driver to support the new Marvell PHY. It also adds support for the LED blinking on Neptune cards with Marvell PHY. All registers are using defines in the niu.h header file as is already done for the BCM8704 registers. [ Coding style, etc. cleanups -DaveM ] Signed-off-by: David S. Miller <davem@davemloft.net>
* [NIU]: Update driver version and release date.David S. Miller2008-01-09
| | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* [NIU]: Fix potentially stuck TCP socket send queues.David S. Miller2008-01-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | It is possible for the TX ring to have packets sit in it for unbounded amounts of time. The only way to defer TX interrupts in the chip is to periodically set "mark" bits, when processing of a TX descriptor with the mark bit set is complete it triggers the interrupt for the TX queue's LDG. A consequence of this kind of scheme is that if packet flow suddenly stops, the remaining TX packets will just sit there. If this happens, since those packets could be charged to TCP socket send queues, such sockets could get stuck. The simplest solution is to divorce the socket ownership of the packet once the device takes the SKB, by using skb_orphan() in niu_start_xmit(). In hindsight, it would have been much nicer if the chip provided two interrupt sources for TX (like basically every other ethernet chip does). Namely, keep the "mark" bit, but also signal the LDG when the TX queue becomes completely empty. That way there is no need to have a deadlock breaker like this. Signed-off-by: David S. Miller <davem@davemloft.net>
* [NIU]: Missing ->last_rx update.David S. Miller2008-01-09
| | | | | | Noticed by Paul Lodridge. Signed-off-by: David S. Miller <davem@davemloft.net>