aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/gianfar.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2009-08-12Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-2/+10
Conflicts: arch/microblaze/include/asm/socket.h
2009-08-09gianfar: keep vlan related state when restartYong Zhang1-2/+10
If vlan has been enabled. ifdown followed by ifup will lost hardware related state. Also remove duplicated operation in gfar_vlan_rx_register(). Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Acked-by: Dai Haruki <dai.haruki@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-23Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-16/+8
Conflicts: drivers/net/wireless/iwmc3200wifi/netdev.c net/wireless/scan.c
2009-07-22gianfar: Revive fixed link supportAnton Vorontsov1-16/+8
Since commit fe192a49118f5b1272317d60c7930ece4e13ae49 ("Rework gianfar driver to use of_mdio infrastructure") the fixed-link support is broken, the driver oopses at init_phy(): Unable to handle kernel paging request for data at address 0x000000e4 Faulting instruction address: 0xc01cf298 Oops: Kernel access of bad area, sig: 11 [#1] [...] NIP [c01cf298] init_phy+0x80/0xdc LR [c01cf250] init_phy+0x38/0xdc Call Trace: [cf81fe80] [c01d1cf8] gfar_enet_open+0x6c/0x19c [cf81fea0] [c024494c] dev_open+0xfc/0x134 [cf81fec0] [c0242edc] dev_change_flags+0x84/0x1ac [cf81fee0] [c0399ee0] ic_open_devs+0x168/0x2d8 [cf81ff20] [c039b2e8] ip_auto_config+0x90/0x2a4 [cf81ff60] [c0003884] do_one_initcall+0x34/0x1a8 This patch fixes the oops, and removes phy_node checks, and adds a call to of_phy_connect_fixed_link() if a phy isn't attached.. Also, remove an old fixed-link code that we don't use any longer. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-16Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-0/+2
Conflicts: drivers/net/wireless/orinoco/main.c
2009-07-15gianfar: remove unused DECLARE_MAC_BUFJohannes Berg1-1/+0
The use of it was converted to %pM, but the variable stuck -- remove it now to not cause spurious warnings. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-12netdev: restore MAC address set and validate operationsBen Hutchings1-0/+2
alloc_etherdev() used to install default implementations of these operations, but they must now be explicitly installed in struct net_device_ops. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-25Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-1/+10
Conflicts: drivers/net/wireless/ath/ath5k/phy.c drivers/net/wireless/iwlwifi/iwl-agn.c drivers/net/wireless/iwlwifi/iwl3945-base.c
2009-05-25gianfar: fix BUG under load after introduction of skb recyclingLennert Buytenhek1-1/+10
Since commit 0fd56bb5be6455d0d42241e65aed057244665e5e ("gianfar: Add support for skb recycling"), gianfar puts skbuffs that are in the rx ring back onto the recycle list as-is in case there was a receive error, but this breaks the following invariant: that all skbuffs on the recycle list have skb->data = skb->head + NET_SKB_PAD. The RXBUF_ALIGNMENT realignment done in gfar_new_skb() will be done twice on skbuffs recycled in this way, causing there not to be enough room in the skb anymore to receive a full packet, eventually leading to an skb_over_panic from gfar_clean_rx_ring() -> skb_put(). Resetting the skb->data pointer to skb->head + NET_SKB_PAD before putting the skb back onto the recycle list restores the mentioned invariant, and should fix this issue. Reported-by: Michael Guntsche <mike@it-loops.com> Tested-by: Michael Guntsche <mike@it-loops.com> Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-28gianfar: Use memset instead of cacheable_memzeroKumar Gala1-1/+2
cacheable_memzero() is completely overkill for the clearing out the FCB block which is only 8-bytes. The compiler should easily optimize this with memset. Additionally, cacheable_memzero() only exists on ppc32 and thus breaks builds of gianfar on ppc64. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-27net: Rework gianfar driver to use of_mdio infrastructure.Grant Likely1-72/+37
This patch simplifies the driver by making use of more common code. Tested on Freescale MPC8349emitxgp eval board Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-04-15gianfar: stop send queue before resetting gianfarMarkus Brunner1-0/+2
After a transmit timed out, the reset task will be called, which will free the allocated resources(stop_gfar). If gfar_poll will be called before the resources get allocated again gfar_clean_tx_ring will call dev_kfree_skb_any(NULL). Example crash: ops: Kernel access of bad area, sig: 11 [#1] PREEMPT RSBBA100 Modules linked in: NIP: c01a10c4 LR: c013b254 CTR: c013c038 REGS: c02e7d20 TRAP: 0300 Not tainted (2.6.27.20) MSR: 00001032 <ME,IR,DR> CR: 24000082 XER: 20000000 DAR: 000000a0, DSISR: 20000000 TASK = c02ce578[0] 'swapper' THREAD: c02e6000 GPR00: 000000a0 c02e7dd0 c02ce578 00000000 00000040 00000001 c02ec1c0 00001032 GPR08: c080d1e0 df9ea800 00000000 00000000 24000082 ffffffff 0404f000 00000000 GPR16: ffffffbf ffffffff ffffffff ffdff7ff ffffffff c02d0fd4 00100100 00200200 GPR24: c031220c 00000001 00000001 00000000 00000000 df849800 ff109000 df849b80 NIP [c01a10c4] dev_kfree_skb_irq+0x18/0x70 LR [c013b254] gfar_clean_tx_ring+0x70/0x11c Call Trace: [c02e7dd0] [c003e978] update_wall_time+0x730/0x744 (unreliable) [c02e7df0] [c013b254] gfar_clean_tx_ring+0x70/0x11c [c02e7e10] [c013c07c] gfar_poll+0x44/0x150 [c02e7e30] [c01a064c] net_rx_action+0xa8/0x19c [c02e7e70] [c00251d4] __do_softirq+0x64/0xc0 [c02e7e90] [c0006384] do_softirq+0x40/0x58 [c02e7ea0] [c00250a8] irq_exit+0x40/0x9c [c02e7eb0] [c000642c] do_IRQ+0x90/0xac [c02e7ec0] [c0010ab4] ret_from_except+0x0/0x14 --- Exception: 501 at cpu_idle+0x9c/0xf8 LR = cpu_idle+0x9c/0xf8 [c02e7f80] [c0009820] cpu_idle+0x58/0xf8 (unreliable) [c02e7fa0] [c01fb8c8] __got2_end+0x7c/0x90 [c02e7fc0] [c026c794] start_kernel+0x2c0/0x2d4 [c02e7ff0] [00003438] 0x3438 Instruction dump: 7fa00124 80010024 bba10014 38210020 7c0803a6 4e800020 9421ffe0 7c0802a6 7c6b1b78 90010024 380300a0 bfa10014 <7d200028> 3129ffff 7d20012d 40a2fff4 Kernel panic - not syncing: Fatal exception in interrupt This Patch calls netif_stop_queue before calling stop_gfar. Signed-off-by: Markus Brunner <super.firetwister@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-29gianfar: Fix use-after-of_node_put() in gfar_of_init().David S. Miller1-1/+1
We can't put 'mdio' until after we've used it in the fsl_pq_mdio_bus_name() call. Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-27gianfar: only check headroom when FCB is neededLi Yang1-2/+4
Signed-off-by: Li Yang <leoli@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-27gianfar: Fix kfree(skb)David S. Miller1-1/+1
Noticed by Li Yang. Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-27gianfar: fix headroom expansion codeStephen Hemminger1-22/+24
The code that was added to increase headroom was wrong. It doesn't handle the case where gfar_add_fcb() changes the skb. Better to do check at start of transmit (outside of lock), where error handling is better anyway. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-25gianfar: reallocate skb when headroom is not enough for fcbLi Yang1-10/+21
Gianfar uses a hardware header FCB for offloading. However when used with bridging or IP forwarding, TX skb might not have enough headroom for the FCB. Reallocate skb for such cases. Signed-off-by: Li Yang <leoli@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-21gianfar: Fix build with CONFIG_PM enabledAnton Vorontsov1-2/+2
commit 4826857f1bf07f9c0f1495e9b05d125552c88a85 ("gianfar: pass the proper dev to DMA ops") introduced this build breakage: CC drivers/net/gianfar.o drivers/net/gianfar.c: In function 'gfar_suspend': drivers/net/gianfar.c:552: error: 'struct gfar_private' has no member named 'dev' drivers/net/gianfar.c: In function 'gfar_resume': drivers/net/gianfar.c:601: error: 'struct gfar_private' has no member named 'dev' make[2]: *** [drivers/net/gianfar.o] Error 1 Fix this by converting suspend and resume routines to use gfar_private->ndev. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Acked-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-18gianfar: pass the proper dev to DMA opsKumar Gala1-16/+18
We need to be passing the of_platform device struct into the DMA ops as its the one that has the archdata setup to know which low-level DMA ops we should be using (not the net_device one). This isn't an issue until we expect the archdata to be setup correctly. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-13gianfar: Convert to use netdev_opsAndy Fleming1-14/+17
Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-03-01Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-1/+1
Conflicts: drivers/net/wireless/iwlwifi/iwl-tx.c net/8021q/vlan_core.c net/core/dev.c
2009-02-27gianfar: Do right check on num_txbdfreeRini van Zetten1-1/+1
This patch fixes a wrong check on num_txbdfree. It could lead to num_txbdfree become nagative. Result was that the gianfar stops sending data. Changes from first version : - removed a space between parens (David Millers comment) - full email address in signed off line Signed-off-by: Rini van Zetten <rini@arvoo.nl> Acked-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-09Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-0/+6
Conflicts: drivers/net/gianfar.c
2009-02-09gianfar: Fix boot hangs while bringing up gianfar ethernetJarek Poplawski1-0/+6
Ira Snyder found that commit 8c7396aebb68994c0519e438eecdf4d5fa9c7844 "gianfar: Merge Tx and Rx interrupt for scheduling clean up ring" can cause hangs. It's because there was removed clearing of interrupts in gfar_schedule_cleanup() (which is called by an interrupt handler) in case when netif scheduling has been disabled. This patch brings back this action and a comment. Reported-by: Ira Snyder <iws@ovro.caltech.edu> Reported-by: Peter Korsgaard <jacmet@sunsite.dk> Bisected-by: Ira Snyder <iws@ovro.caltech.edu> Tested-by: Peter Korsgaard <jacmet@sunsite.dk> Tested-by: Ira Snyder <iws@ovro.caltech.edu> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-04Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-0/+3
2009-02-04gianfar: Fix stashing supportAndy Fleming1-0/+23
Stashing is only supported on the 85xx (e500-based) SoCs. The 83xx and 86xx chips don't have a proper cache for this. U-Boot has been updated to add stashing properties to the device tree nodes of gianfar devices on 85xx. So now we modify Linux to keep stashing off unless those properties are there. Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-04gianfar: Add support for skb recyclingAndy Fleming1-4/+19
Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-04netdev: Merge UCC and gianfar MDIO bus driversAndy Fleming1-16/+7
The MDIO bus drivers for the UCC and gianfar ethernet controllers are essentially the same. There's no reason to duplicate that much code. Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-04gianfar: Fix potential soft reset raceAndy Fleming1-0/+3
SOFT_RESET must be asserted for at least 3 TX clocks in order for it to work properly. The syncs in the gfar_write() commands have been hiding this, but we need to guarantee it. Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-01gianfar: Fix sparse warningsAnton Vorontsov1-2/+0
This patch fixes following sparse warnings: CHECK gianfar_ethtool.c gianfar_ethtool.c:610:26: warning: symbol 'gfar_ethtool_ops' was not declared. Should it be static? CHECK gianfar_mii.c gianfar_mii.c:108:35: warning: cast adds address space to expression (<asn:2>) gianfar_mii.c:119:35: warning: cast adds address space to expression (<asn:2>) gianfar_mii.c:128:35: warning: cast adds address space to expression (<asn:2>) gianfar_mii.c:272:5: warning: cast removes address space of expression gianfar_mii.c:271:15: warning: cast adds address space to expression (<asn:2>) gianfar_mii.c:340:11: warning: cast adds address space to expression (<asn:2>) CHECK gianfar_sysfs.c gianfar_sysfs.c:84:1: warning: symbol 'dev_attr_bd_stash' was not declared. Should it be static? gianfar_sysfs.c:133:1: warning: symbol 'dev_attr_rx_stash_size' was not declared. Should it be static? gianfar_sysfs.c:175:1: warning: symbol 'dev_attr_rx_stash_index' was not declared. Should it be static? gianfar_sysfs.c:213:1: warning: symbol 'dev_attr_fifo_threshold' was not declared. Should it be static? gianfar_sysfs.c:250:1: warning: symbol 'dev_attr_fifo_starve' was not declared. Should it be static? gianfar_sysfs.c:287:1: warning: symbol 'dev_attr_fifo_starve_off' was not declared. Should it be static? Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-02-01gianfar: Implement proper, per netdevice wakeup managementAnton Vorontsov1-0/+5
This patch implements wakeup management for the gianfar driver. The driver should set wakeup enable if WOL is enabled, so that phylib won't power off an attached PHY. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-26Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6David S. Miller1-5/+1
2009-01-26gianfar: Revive VLAN supportAnton Vorontsov1-5/+1
commit 77ecaf2d5a8bfd548eed3f05c1c2e6573d5de4ba ("gianfar: Fix VLAN HW feature related frame/buffer size calculation") wrongly removed priv->vlgrp assignment, and now priv->vlgrp is always NULL. This patch fixes the issue, plus fixes following sparse warning introduced by the same commit: gianfar.c:1406:13: warning: context imbalance in 'gfar_vlan_rx_register' - wrong count at exit gfar_vlan_rx_register() checks for "if (old_grp == grp)" and tries to return w/o dropping the lock. According to net/8021q/vlan.c VLAN core issues rx_register() callback: 1. In register_vlan_dev() only on a newly created group; 2. In unregister_vlan_dev() only if the group becomes empty. Thus the check in the gianfar driver isn't needed. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Acked-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-21net: Remove redundant NAPI functionsBen Hutchings1-3/+3
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>
2009-01-12gianfar: Fix soft lockup with multi-interrupt TSECsAnton Vorontsov1-0/+8
This patch fixes following bug: BUG: soft lockup - CPU#0 stuck for 61s! [S03mountvirtfs-:922] Modules linked in: NIP: c006505c LR: c00675f0 CTR: c0020438 REGS: c7a1db90 TRAP: 0901 Not tainted (2.6.28-rc8-01311-g8c7396a) MSR: 00009032 <EE,ME,IR,DR> CR: 28248442 XER: 20000000 TASK = c7a288a0[922] 'S03mountvirtfs-' THREAD: c7a1c000 GPR00: 00009032 c7a1dc40 c7a288a0 00000024 c79a1840 00000000 00000300 00000020 GPR08: c035f97c 00000000 00004008 c04d5210 00000000 NIP [c006505c] handle_IRQ_event+0x34/0xb0 LR [c00675f0] handle_level_irq+0xa8/0x144 Call Trace: [c7a1dc40] [c00204d8] ipic_mask_irq+0xa0/0xb4 (unreliable) [c7a1dc60] [c00675f0] handle_level_irq+0xa8/0x144 [c7a1dc80] [c00067f8] do_IRQ+0x78/0x108 [c7a1dc90] [c0014d7c] ret_from_except+0x0/0x14 --- Exception: 501 at gfar_schedule_cleanup+0x54/0x7c LR = gfar_transmit+0x14/0x28 [c7a1dd50] [c0352a3c] _spin_unlock_irqrestore+0x18/0x30 (unreliable) [c7a1dd60] [c01f49a8] gfar_transmit+0x14/0x28 [c7a1dd70] [c0065084] handle_IRQ_event+0x5c/0xb0 [c7a1dd90] [c00675f0] handle_level_irq+0xa8/0x144 [c7a1ddb0] [c00067f8] do_IRQ+0x78/0x108 [c7a1ddc0] [c0014d7c] ret_from_except+0x0/0x14 --- Exception: 501 at up_read+0x10/0x48 LR = do_page_fault+0x2b0/0x3e0 [c7a1de80] [c7a177e8] 0xc7a177e8 (unreliable) [c7a1de90] [c0017964] do_page_fault+0x2b0/0x3e0 [c7a1df40] [c0014b14] handle_page_fault+0xc/0x80 --- Exception: 301 at 0xfe98b7c LR = 0xfe989c0 Instruction dump: 7c0802a6 bf810010 7c9f2378 7c7c1b78 90010024 80040004 70090020 40820010 7c0000a6 60008000 7c000124 3bc00000 <3ba00000> 48000010 83ff0014 2f9f0000 The bug introduced by commit 8c7396aebb68994c0519e438eecdf4d5fa9c7844 ("gianfar: Merge Tx and Rx interrupt for scheduling clean up ring"). The commit merged TX and RX interrupt code into a single routine that schedules NAPI, but no locks were introduced. This causes irq races, so when irqs are enabled and netif_rx_schedule_prep() returns 0, nobody disable the interrupts again. This leads to interrupt storm and finally to the lockup. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-11netdev: gianfar: add MII ioctl handlerClifford Wolf1-0/+15
This is the same kind of wrapper that can also be found in many other network device drivers. Tested with a freescale MPC8349E host CPU: Toggled the interface LEDs on a DP83865 PHY. Signed-off-by: Clifford Wolf <clifford@clifford.at> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-08gianfar: Fixup use of BUS_ID_SIZEKumar Gala1-3/+3
Commit b31a1d8b41513b96e9c7ec2f68c5734cef0b26a4 ("gianfar: Convert gianfar to an of_platform_driver") went back to using BUS_ID_SIZE instead of sizeof() as per the larger patch series that will remove "char bus_id[20]" from struct device. Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-06gianfar: ensure ECNTRL[R100] is cleared on link state changeLi Yang1-0/+2
When changing the link between 100Mbps and 1Gbps in SGMII mode it was found out that the link would stop working. The issue is that ECNTRL[R100] needs to be cleared when in 1Gbps mode. Older reference manuals didn't require the explicitly clearing but has since been found it that it is needed. Signed-off-by: Li Yang <leoli@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-22net: Remove unused netdev arg from some NAPI interfaces.Neil Horman1-3/+3
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>
2008-12-17gianfar: Continue polling until both tx and rx are emptyAndy Fleming1-5/+9
gfar_poll would declare polling done once the rx queue was empty, but the tx queue could still have packets left. Stolen mostly from the e1000 driver. Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-17gianfar: Merge Tx and Rx interrupt for scheduling clean up ringDai Haruki1-41/+18
No clean up function is executed in the interrupt context by this patch. Signed-off-by: Dai Haruki <dai.haruki@freescale.com> Acked-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-17gianfar: Use interface name in interrupt name to distinguish the source.Dai Haruki1-6/+24
Interface name (ex. eth0) is used as the prefix for the interrupt name, with _rx, _tx, and _er appended to distinguish multiple interrupts on the same interface. Signed-off-by: Dai Haruki <dai.haruki@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-17gianfar: Add Scatter Gather supportDai Haruki1-71/+146
Scatter Gather support in gianfar driver to handle fragmented frames on the transmit side. Signed-off-by: Poonam Aggrwal <poonam.aggrwal@freescale.com> Signed-off-by: Dai Haruki <dai.haruki@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-17gianfar: Fix packet drop when out of memoryAndy Fleming1-2/+1
The patch which fixed gianfar so it drops packets when it runs out of memory left in the code which frees the skb when it drops packets. Change the code so that we only free the skb if the new skb was successfully created. Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-16gianfar: Make all BD status writes 32-bitDai Haruki1-21/+15
Whenever we want to update the status field in a BD, we usually want to update the length field, too. By combining them into one 32-bit field, we reduce the number of stores to memory shared with the controller, and we eliminate the need for order-enforcement, as the length and "READY" bit are now updated atomically at the same time. Signed-off-by: Dai Haruki <Dai.Haruki@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-16gianfar: Add macros for stepping through BDsAndy Fleming1-18/+9
This code is based strongly on code from Dai Haruki <Dai.Haruki@freescale.com>. The gianfar Buffer Descriptors are arranged in a circular array, the end of which is denoted by setting the "WRAP" bit in the descriptor. However, the software knows the end of the ring because it knows how many descriptors are there. Rather than check each descriptor for whether the WRAP bit is set, use pointer math to determine where the next BD is. This is also useful for when we want to look at BDs other than the very next one (for Scatter-Gather). Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-16gianfar: Remove unused gfar_add_fcb() function parameterDai Haruki1-4/+4
- Also, use cacheable_memzero instead of memset for performance reasons. Signed-off-by: Dai Haruki <dai.haruki@freescale.com> Acked-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-16gianfar: Enable padding and Optimize the frame prepended bytes handlingDai Haruki1-46/+41
The eTSEC can prepend up to 32 bytes to a received frame, usually for the purpose of aligning the IP address to a word boundary, so this turns it on. While we're in there, make the handling of the pre-frame bytes (padding and Frame Control Block) cleaner. Signed-off-by: Dai Haruki <dai.haruki@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-16gianfar: Fix VLAN HW feature related frame/buffer size calculation.Dai Haruki1-15/+21
Optimize the VLAN checking logic as well. Signed-off-by: Dai Haruki <dai.haruki@freescale.com> Acked-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2008-12-16gianfar: Fix eTSEC configuration procedureDai Haruki1-2/+3
Fix some bugs in the ethtool configuration functions: * gfar_clean_rx_ring should not be called with interrupts disabled. * Update last transmission time to avoid tx timeout. * Delete redundant NETIF_F_IP_CSUM check in gfar_start_xmit * Use netif_tx_lock_bh when reconfiguring the tx csum Signed-off-by: Dai Haruki <dai.haruki@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>