aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bfin_mac.c
Commit message (Collapse)AuthorAgeFilesLines
* netdev: bfin_mac: fix memory leak when freeing dma descriptorsSonic Zhang2011-06-171-10/+10
| | | | | | | | | | The size of the desc array is not the size of the desc structure, so when we try to free up things, we leak some parts. Reported-by: Regis Dargent <rdargent@edevice.com> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@conan.davemloft.net>
* netdev: bfin_mac: document TE setting in RMII modesMike Frysinger2011-03-281-2/+11
| | | | | | | | The current code sometimes generates build warnings due to how it checks the silicon revision, so clean it up and properly document things. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: bfin_mac: Remove is_multicast_ether_addr use in netdev_for_each_mc_addrJoe Perches2011-01-131-8/+1
| | | | | | | Remove code that has no effect. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: bfin_mac: Use is_multicast_ether_addr helperTobias Klauser2011-01-121-1/+1
| | | | | | Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: bfin_mac: let boards set vlan masksMike Frysinger2011-01-101-0/+7
| | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: bfin_mac: mark setup_system_regs as staticMike Frysinger2011-01-101-1/+1
| | | | | | | No need for this to be exported since it is only used in this driver. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: bfin_mac: clean up printk messagesMike Frysinger2011-01-101-36/+29
| | | | | | | Use netdev_* and pr_* helper funcs for output rather than printk. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: bfin_mac: push settings to platform resourcesSonic Zhang2010-10-251-51/+94
| | | | | | | | | | Move all the pin settings out of the Kconfig and into the platform resources (MII vs RMII). This clean up also lets us push out the phy settings so that board porters may control the layout. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6Linus Torvalds2010-10-231-6/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1699 commits) bnx2/bnx2x: Unsupported Ethtool operations should return -EINVAL. vlan: Calling vlan_hwaccel_do_receive() is always valid. tproxy: use the interface primary IP address as a default value for --on-ip tproxy: added IPv6 support to the socket match cxgb3: function namespace cleanup tproxy: added IPv6 support to the TPROXY target tproxy: added IPv6 socket lookup function to nf_tproxy_core be2net: Changes to use only priority codes allowed by f/w tproxy: allow non-local binds of IPv6 sockets if IP_TRANSPARENT is enabled tproxy: added tproxy sockopt interface in the IPV6 layer tproxy: added udp6_lib_lookup function tproxy: added const specifiers to udp lookup functions tproxy: split off ipv6 defragmentation to a separate module l2tp: small cleanup nf_nat: restrict ICMP translation for embedded header can: mcp251x: fix generation of error frames can: mcp251x: fix endless loop in interrupt handler if CANINTF_MERRF is set can-raw: add msg_flags to distinguish local traffic 9p: client code cleanup rds: make local functions/variables static ... Fix up conflicts in net/core/dev.c, drivers/net/pcmcia/smc91c92_cs.c and drivers/net/wireless/ath/ath9k/debug.c as per David
| * net: simplify flags for tx timestampingOliver Hartkopp2010-08-191-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the abstraction introduced by the union skb_shared_tx in the shared skb data. The access of the different union elements at several places led to some confusion about accessing the shared tx_flags e.g. in skb_orphan_try(). http://marc.info/?l=linux-netdev&m=128084897415886&w=2 Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Blackfin: Split PLL code from mach-specific cdef headersDavid Howells2010-10-071-0/+1
|/ | | | | | | Split the PLL control code from the Blackfin machine-specific cdef headers so that the irqflags functions can be renamed without incurring a header loop. Signed-off-by: David Howells <dhowells@redhat.com>
* netdev:bfin_mac: reclaim and free tx skb as soon as possible after transferSonic Zhang2010-06-151-43/+80
| | | | | | | | | | | | | | | | | | | | | SKBs hold onto resources that can't be held indefinitely, such as TCP socket references and netfilter conntrack state. So if a packet is left in TX ring for a long time, there might be a TCP socket that cannot be closed and freed up. Current blackfin EMAC driver always reclaim and free used tx skbs in future transfers. The problem is that future transfer may not come as soon as possible. This patch start a timer after transfer to reclaim and free skb. There is nearly no performance drop with this patch. TX interrupt is not enabled because of a strange behavior of the Blackfin EMAC. If EMAC TX transfer control is turned on, endless TX interrupts are triggered no matter if TX DMA is enabled or not. Since DMA walks down the ring automatically, TX transfer control can't be turned off in the middle. The only way is to disable TX interrupt completely. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bfin_mac: fix memleak in mii_bus{probe|remove}Denis Kirjanov2010-05-231-0/+2
| | | | | | | Fix memory leak with miibus->irq Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: bfin_mac: check for mii_bus platform dataSonic Zhang2010-05-171-0/+6
| | | | | | | | | If the platform data for the mii_bus is missing, gracefully error out rather than deference NULL pointers. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: bfin_mac: handle timeouts with the MDIO registers gracefullyMike Frysinger2010-05-171-19/+34
| | | | | | | | | Have the low level MDIO functions pass back up timeout information so we don't waste time polling them multiple times when there is a problem, and so we don't let higher layers think the device is available when it isn't. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: bfin_mac: use promiscuous flag for promiscuous modeSonic Zhang2010-05-171-1/+1
| | | | | | | | | | Rather than using the Receive All Frames (RAF) bit to enable promiscuous mode, use the Promiscuous (PR) bit. This lowers overhead at runtime as we let the hardware process the packets that should actually be checked. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: bfin_mac: add support for wake-on-lan magic packetsMichael Hennerich2010-05-171-4/+72
| | | | | | | | Note that WOL works only in PM Suspend Standby Mode (Sleep Mode). Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: bfin_mac: clear RXCKS if hardware generated checksum is not enabledSonic Zhang2010-05-171-2/+3
| | | | | | | | | Otherwise we might be get a setting mismatch from a previous module or bootloader and what the driver currently expects. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: bfin_mac: deduce Ethernet FCS from hardware IP payload checksumSonic Zhang2010-05-171-2/+33
| | | | | | | | | | | | | | | IP checksum is based on 16-bit one's complement algorithm, so to deduce a value from checksum is equal to add its complement. Unfortunately, the Blackfin on-chip MAC checksum logic only works when the IP packet has a header length of 20 bytes. This is true for most IPv4 packets, but not for IPv6 packets or IPv4 packets which use header options. So only use the hardware checksum when appropriate. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Jon Kowal <jon.kowal@dspecialists.de> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: bfin_mac: invalid data cache only once for each new rx skb bufferSonic Zhang2010-05-171-5/+8
| | | | | | | | | | | | | The skb buffer isn't actually used until we finish transferring and pass it up to higher layers, so only invalidate the range once before we start receiving actual data. This also avoids the problem with data invalidating on Blackfin systems -- there is no invalidate-only, just invalidate+flush. So when running in writeback mode, there is the small (but not uncommon) possibility of the flush overwriting valid DMA-ed data from the cache. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: bfin_mac: handler RX status errorsPeter Meerwald2010-05-171-3/+14
| | | | | | | Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: bfin_mac: add support for IEEE 1588 PTPBarry Song2010-05-171-1/+340
| | | | | | | | | Newer on-chip MAC peripherals support IEEE 1588 PTP in the hardware, so extend the driver to support this functionality. Signed-off-by: Barry Song <barry.song@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net: Remove unnecessary returns from void function()sJoe Perches2010-05-141-2/+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>
* net: trans_start cleanupsEric Dumazet2010-05-101-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>
* net: convert multicast list to list_headJiri Pirko2010-04-031-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>
* net: convert multiple drivers to use netdev_for_each_mc_addr, part3Jiri Pirko2010-02-221-4/+2
| | | | | Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: use netdev_mc_count and netdev_mc_empty when appropriateJiri Pirko2010-02-121-2/+2
| | | | | | | | | | | This patch replaces dev->mc_count in all drivers (hopefully I didn't miss anything). Used spatch and did small tweaks and conding style changes when it was suitable. Jirka Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bfin_mac: use the newer CLKBUFOE bit name via asm/dpmc.hMike Frysinger2010-01-191-2/+3
| | | | | | | | This driver tweaks VR_CTL, so pull in the header for the bit defines. Also switch to the new define name as the old one has gone away. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* drivers/net: Move && and || to end of previous lineJoe Perches2009-12-031-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>
* netdev: drivers should make ethtool_ops constStephen Hemminger2009-09-021-1/+1
| | | | | | | No need to put ethtool_ops in data, they should be const. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: use NETDEV_TX_OK instead of 0 in ndo_start_xmit() functionsPatrick McHardy2009-07-051-1/+1
| | | | | | | | | | | This patch is the result of an automatic spatch transformation to convert all ndo_start_xmit() return values of 0 to NETDEV_TX_OK. Some occurences are missed by the automatic conversion, those will be handled in a seperate patch. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'master' of ↵David S. Miller2009-06-031-15/+14
|\ | | | | | | | | | | | | master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/forcedeth.c
| * bfin_mac: fix build error due to net_device_ops convertMike Frysinger2009-05-261-15/+14
| | | | | | | | | | | | | | | | | | | | | | The previous commit "convert to net_device_ops" broke the Blackfin MAC driver as it declared the new structure before the function it used: CC drivers/net/bfin_mac.o drivers/net/bfin_mac.c:984: error: ‘bfin_mac_close’ undeclared here (not in a function) make[1]: *** [drivers/net/bfin_mac.o] Error 1 Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netdev: bfin_mac: add Blackfin MII bus to platform bus to allow DSA accessGraf Yang2009-05-291-33/+84
| | | | | | | | | | | | | | | | | | When we register the MII bus to the platfrom bus, the Distributed Switch Architecture can hook in transparently. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netdev: bfin_mac: fix performance issue found by netperfMichael Hennerich2009-05-291-84/+26
| | | | | | | | | | | | | | | | | | | | | | - Remove dead long delay - Use proper defines - Remove broken implementation of the TX DMA Data Alignment TXDWA feature Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netdev: bfin_mac: fix malformed UDP packet transmission when polling with KGDBSonic Zhang2009-05-291-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Writes to the DMA descriptors may sit in the internal Blackfin data buffers and not actually be available when the DMA engine goes to fetch them. This does not typically happen, but when dealing with short/fast packets such as UDP and polling KGDB, this occurs much more frequently. Same goes for heavy loads as seen by netperf tests or large scp transfers. So force the buffers to drain with SSYNC otherwise we get random malformed packets. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* | netdev: bfin_mac: drop useless IRQF_SHARED from Blackfin EMAC interruptMichael Hennerich2009-05-291-1/+1
|/ | | | | | | | | | | The IRQ used by the Blackfin EMAC is internal to the peripheral and cannot be used to generate any other interrupt, so there is no point in marking it as IRQF_SHARED. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* bfin_mac: convert to net_device_opsAlexander Beregalov2009-04-141-9/+15
| | | | | Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: struct device - replace bus_id with dev_name(), dev_set_name()Kay Sievers2009-03-241-6/+6
| | | | | | | Cc: davem@davemloft.net Cc: netdev@vger.kernel.org Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
* drivers/net: Kill now superfluous ->last_rx stores.David S. Miller2008-11-031-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>
* net/bfin_mac.c MDIO namespace fixesAdrian Bunk2008-10-121-13/+13
| | | | | | | | | | | | | | | | | | | | | | | Commit 2e888103295f47b8fcbf7e9bb8c5da97dd2ecd76 (phylib: add mdiobus_{read,write}) causes the following compile error: <-- snip --> ... CC drivers/net/bfin_mac.o drivers/net/bfin_mac.c:272: error: conflicting types for 'mdiobus_read' include/linux/phy.h:130: error: previous declaration of 'mdiobus_read' was here drivers/net/bfin_mac.c:287: error: conflicting types for 'mdiobus_write' include/linux/phy.h:131: error: previous declaration of 'mdiobus_write' was here make[3]: *** [drivers/net/bfin_mac.o] Error 1 <-- snip --> This patch prefixes the driver functions with bfin_ Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* phylib: move to dynamic allocation of struct mii_busLennert Buytenhek2008-10-081-12/+19
| | | | | | | | | | This patch introduces mdiobus_alloc() and mdiobus_free(), and makes all mdio bus drivers use these functions to allocate their struct mii_bus'es dynamically. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Andy Fleming <afleming@freescale.com>
* drivers/net: replace __FUNCTION__ with __func__Harvey Harrison2008-09-241-4/+4
| | | | | | | | __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* blackfin_mac: unneeded assignmentStephen Hemminger2008-07-291-1/+0
| | | | | | | skb->dev is set by eth_type_trans already. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* Blackfin EMAC Driver: Functional power management supportMichael Hennerich2008-07-291-0/+1
| | | | | | | | | Reprogram MAC address after resume from Suspend Mem (Blackfin Hibernate looses all CORE and SYSTEM register content) Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* Blackfin EMAC Driver: enable TXDWA new feature for new silicon (rev > 0.2)Bryan Wu2008-07-291-26/+77
| | | | | Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* Blackfin EMAC Driver: add proper __devinit/__devexit markingsMike Frysinger2008-07-291-3/+3
| | | | | | Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* netdev: bunch of drivers: avoid WARN at net/core/dev.c:1328Anton Vorontsov2008-07-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The drivers were touching net queue before it has been started, so without this patch, the drivers will potentially WARN at net/core/dev.c:1328. I don't have the hardware for the drivers below, so this patch is untested, and thus should be carefully peer reviewed. tc35815.c au1000_eth.c bfin_mac.c macb.c ^ The four drivers are using phylib, they're calling netif_start_queue() in open() callback. So trivially remove netif_tx_schedule_all(). Phylib will handle netif_carrier_*(). cpmac.c fec_mpc52xx.c fs_enet/fs_enet-main.c sh_eth.c ^ The same as above, but these were also needlessly calling netif_carrier_*() functions. So removed queue calls and also remove carrier calls, since phylib will handle it. fs_enet-main.c also didn't call netif_start_queue() at open(), this is fixed now. Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* netdev: Convert all drivers away from netif_schedule().David S. Miller2008-07-171-1/+1
| | | | | | | They logically all want to trigger a schedule for all device TX queues. Signed-off-by: David S. Miller <davem@davemloft.net>
* Blackfin EMAC Driver: Removed duplicated include <linux/ethtool.h>Huang Weiyi2008-05-221-1/+0
| | | | | | Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>