summaryrefslogtreecommitdiff
path: root/drivers/net/davinci_emac.c
AgeCommit message (Collapse)Author
2011-05-26net: davinci_emac: fix dev_err use at probeJohan Hovold
Use platform device rather than net device in dev_err calls before net device has been registered to avoid messages such as (null): DaVinci EMAC: Failed to get EMAC clock Also replace remaining printks in probe with dev_{err,warn}. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-03-31Fix common misspellingsLucas De Marchi
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-22net: davinci_emac:Fix translation logic for buffer descriptorSriram
With recent changes to the driver(switch to new cpdma layer), the support for buffer descriptor address translation logic is broken. This affects platforms where the physical address of the descriptors as seen by the DMA engine is different from the physical address. Original Patch adding translation logic support: Commit: ad021ae8862209864dc8ebd3b7d3a55ce84b9ea2 Signed-off-by: Sriramakrishnan A G <srk@ti.com> Tested-By: Sekhar Nori <nsekhar@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-03-14Davinci: Do not reset EMAC TX overruns counter on readThomas Lange
Don't reset tx_fifo_errors when reading out current EMAC stats. (tx_fifo_errors shows up as TX overruns in netdev stats.) Without this correction, the old counter value is lost every time stats are read out. Signed-off-by: Thomas Lange <thomas@corelatus.se> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-02-28davinci_emac: Add Carrier Link OK check in Davinci RX HandlerHegde, Vinay
This patch adds an additional check in the Davinci EMAC RX Handler, which tests the __LINK_STATE_NOCARRIER flag along with the __LINK_STATE_START flag as part EMAC shutting down procedure. This avoids WARNING: at drivers/net/davinci_emac.c:1040 emac_rx_handler+0xf8/0x120() during rtcwake used to suspend the target for a specified duration. Signed-off-by: Hegde, Vinay <vinay.hegde@ti.com> Acked-by: Cyril Chemparathy <cyril@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-24net: davinci_emac: cleanup unused cpdma codeCyril Chemparathy
Having switched over to the newly introduced cpdma layer, this patch now removes a whole bunch of code that is now unused. This patch has been maintained separate strictly for reasons of readability. Signed-off-by: Cyril Chemparathy <cyril@ti.com> Acked-by: David S. Miller <davem@davemloft.net> Tested-by: Michael Williamson <michael.williamson@criticallink.com> Tested-by: Caglar Akyuz <caglarakyuz@gmail.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2010-09-24net: davinci_emac: switch to new cpdma layerCyril Chemparathy
This patch hooks up the emac driver with the newly separated cpdma driver. Key differences introduced here: - The old buffer list scheme is no longer required - The original code maintained mac address per rx channel, even if only one rx channel was being used. With this change, mac address is maintained device wide. If support for multiple rx channels is added in future, this will need to be reworked a bit. - The new CPDMA code handles short packets better than before. The earlier code was adjusting the length up, without ensuring that the tail end of the padding was cleared - a possible security issue. This has been fixed to use skb_padto(). Signed-off-by: Cyril Chemparathy <cyril@ti.com> Tested-by: Michael Williamson <michael.williamson@criticallink.com> Tested-by: Caglar Akyuz <caglarakyuz@gmail.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2010-09-24net: davinci_emac: cleanup unused mdio emac codeCyril Chemparathy
This patch removes code that has been rendered useless by the previous patches in this series. Signed-off-by: Cyril Chemparathy <cyril@ti.com> Acked-by: David S. Miller <davem@davemloft.net> Tested-by: Michael Williamson <michael.williamson@criticallink.com> Tested-by: Caglar Akyuz <caglarakyuz@gmail.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2010-09-24net: davinci_emac: switch to new mdioCyril Chemparathy
This patch switches the emac implementation over to the newly separated MDIO driver. With this, the mdio bus frequency defaults to a safe 2.2MHz. Boards may optionally specify a bus frequency via platform data. The phy identification scheme has been modified to use a phy bus id instead of a mask. This largely serves to eliminate the "phy search" code in emac init. Signed-off-by: Cyril Chemparathy <cyril@ti.com> Acked-by: David S. Miller <davem@davemloft.net> Tested-by: Michael Williamson <michael.williamson@criticallink.com> Tested-by: Caglar Akyuz <caglarakyuz@gmail.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2010-08-04davinci_emac: Fix use after free in davinci_emac_removeStefan Weil
free_netdev finally calls kfree which makes the contents of ndev and priv (private data contained in ndev) invalid. So iounmap should be called before free_netdev. Cc: David S. Miller <davem@davemloft.net> Cc: Chaithrika U S <chaithrika@ti.com> Cc: Sriramakrishnan <srk@ti.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-08-02net: Fix a typo from "dev" to "ndev"Henrique Camargo
The typo was causing compilation errors since "dev" was not defined. Signed-off-by: Henrique Camargo <henrique.camargo@ensitec.com.br> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-30TI DaVinci EMAC: Fix incorrect reference to EMAC_CTRL registers.Sriram
The EMAC modules control registers vary as per the version of the EMAC module. EMAC_CTRL_EWCTL,EMAC_CTRL_EWINTTCNT are available only on EMAC_VERSION_1. The emac_dump_regs() function accesses these indiscriminately. This patch fixes the issue. Signed-off-by: Sriramakrishnan <srk@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-30TI DaVinci EMAC: Fix asymmetric handling of packets in NAPI Poll function.Sriram
The current implementation of NAPI poll function in the driver does not service Rx packets, error condition even if a single Tx packet gets serviced in the napi poll call. This behavior severely affects performance for specific use cases. This patch modifies the poll function implementation to service tx/rx packets in an identical manner. Signed-off-by: Sriramakrishnan <srk@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-30TI DaVinci EMAC : Implement interrupt pacing functionality.Sriram
DaVinci EMAC module includes an interrupt pacing block that can be programmed to throttle the rate at which interrupts are generated. This patch implements interrupt pacing logic that can be controlled through the ethtool interface(only rx_coalesce_usecs param is honored) Signed-off-by: Sriramakrishnan <srk@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-07-05davinci_emac: Use the instance of net_device_stats from net_device.Kulikov Vasiliy
Since net_device has an instance of net_device_stats, we can remove the instance of this from the adapter structure. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-05-10net: trans_start cleanupsEric Dumazet
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>
2010-04-03net: convert multicast list to list_headJiri Pirko
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>
2010-03-15Merge branch 'master' of /home/davem/src/GIT/linux-2.6/David S. Miller
2010-03-15TI DaVinci EMAC: Convert to dev_pm_opschaithrika@ti.com
Migrate from the legacy PM hooks to use dev_pm_ops structure. Signed-off-by: Chaithrika U S <chaithrika@ti.com> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-15net: davinci emac: use dma_{map, unmap}_single API for cache coherencySekhar Nori
The davinci emac driver uses some ARM specific DMA APIs for cache coherency which have been removed from kernel with the 2.6.34 merge. Modify the driver to use the dma_{map, unmap}_single() APIs defined in dma-mapping.h Without this fix, the driver fails to compile on Linus's tree. Tested on DM365 and OMAP-L138 EVMs. Signed-off-by: Sekhar Nori <nsekhar@ti.com> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-13Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (108 commits) bridge: ensure to unlock in error path in br_multicast_query(). drivers/net/tulip/eeprom.c: fix bogus "(null)" in tulip init messages sky2: Avoid rtnl_unlock without rtnl_lock ipv6: Send netlink notification when DAD fails drivers/net/tg3.c: change the field used with the TG3_FLAG_10_100_ONLY constant ipconfig: Handle devices which take some time to come up. mac80211: Fix memory leak in ieee80211_if_write() mac80211: Fix (dynamic) power save entry ipw2200: use kmalloc for large local variables ath5k: read eeprom IQ calibration values correctly for G mode ath5k: fix I/Q calibration (for real) ath5k: fix TSF reset ath5k: use fixed antenna for tx descriptors libipw: split ieee->networks into small pieces mac80211: Fix sta_mtx unlocking on insert STA failure path rt2x00: remove KSEG1ADDR define from rt2x00soc.h net: add ColdFire support to the smc91x driver asix: fix setting mac address for AX88772 ipv6 ip6_tunnel: eliminate unused recursion field from ip6_tnl{}. net: Fix dev_mc_add() ...
2010-03-08Merge branch 'for-next' into for-linusJiri Kosina
Conflicts: Documentation/filesystems/proc.txt arch/arm/mach-u300/include/mach/debug-macro.S drivers/net/qlge/qlge_ethtool.c drivers/net/qlge/qlge_main.c drivers/net/typhoon.c
2010-03-03davinci_emac: off by oneDan Carpenter
This off by one error was found by smatch. drivers/net/davinci_emac.c +2390 emac_dev_open(13) error: buffer overflow 'priv->mac_addr' 6 <= 6 Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-02Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6Linus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1341 commits) virtio_net: remove forgotten assignment be2net: fix tx completion polling sis190: fix cable detect via link status poll net: fix protocol sk_buff field bridge: Fix build error when IGMP_SNOOPING is not enabled bnx2x: Tx barriers and locks scm: Only support SCM_RIGHTS on unix domain sockets. vhost-net: restart tx poll on sk_sndbuf full vhost: fix get_user_pages_fast error handling vhost: initialize log eventfd context pointer vhost: logging thinko fix wireless: convert to use netdev_for_each_mc_addr ethtool: do not set some flags, if others failed ipoib: returned back addrlen check for mc addresses netlink: Adding inode field to /proc/net/netlink axnet_cs: add new id bridge: Make IGMP snooping depend upon BRIDGE. bridge: Add multicast count/interval sysfs entries bridge: Add hash elasticity/max sysfs entries bridge: Add multicast_snooping sysfs toggle ... Trivial conflicts in Documentation/feature-removal-schedule.txt
2010-02-22net: convert multiple drivers to use netdev_for_each_mc_addr, part4Jiri Pirko
Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-12net: use netdev_mc_count and netdev_mc_empty when appropriateJiri Pirko
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>
2010-02-05Fix spelling of 'platform' in log messagesStefan Weil
Replace platfrom -> platform. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-02-04TI Davinci EMAC : Abstract Buffer address translation logic.Sriramakrishnan
When programming the DMA engine, the next pointers must be programmed with physical address as seen from the DMA master address space. This address may be different from physical address of the buffer RAM area. This patch abstracts the buffer address translation logic. Signed-off-by: Sriramakrishnan <srk@ti.com> Acked-by: Chaithrika U S <chaithrika@ti.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2010-02-04TI Davinci EMAC : add platform specific interrupt enable/disable logic.Sriramakrishnan
On certain SOCs, the EMAC controller is interfaced with a wrapper logic for handling interrupts. This patch implements a platform specific hook to cater to platforms that require custom interrupt handling logic Signed-off-by: Sriramakrishnan <srk@ti.com> Acked-by: Chaithrika U S <chaithrika@ti.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2010-02-04TI Davinci EMAC : Re-use driver for other platforms.Sriramakrishnan
The davinci EMAC peripheral is also available on other TI platforms -notably TI AM3517 SoC. This patch modifies the config option and the platform structure header files so that the driver can be reused on non-davinci platforms as well. Signed-off-by: Sriramakrishnan <srk@ti.com> Acked-by: Chaithrika U S <chaithrika@ti.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
2010-02-03drivers/net/davinci_emac.c: Fix continuation line formatsJoe Perches
String constants that are continued on subsequent lines with \ are not good. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-01-07TI DaVinci EMAC: Handle emac module clock correctly.Sriram
In the driver probe function the emac module clock needs to be enabled before calling register_netdev(). As soon as the device is registered the driver get_stats function can be invoked by the core - the module clock must be switched on to be able to read from stats registers. Also explicitly call matching clk_disable for failure conditions in probe function. Signed-off-by: Sriramakrishnan <srk@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-12-18TI DaVinci EMAC: Fix MDIO bus frequency configurationNageswari Srinivasan
There was a typo in "if condition" checking for validity of MDIO bus frequency passed as part of platform data. Bitwise AND was being used instead of a Logical AND. Tested on: DM6467 EVM Signed-off-by: Nageswari Srinivasan <nageswari@ti.com> Acked-by: Anant Gole <anantgole@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-17Merge branch 'master' of ↵David S. Miller
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/can/Kconfig
2009-11-15TI Davinci EMAC : Fix Console Hang when bringing the interface downSriram
In the NAPI poll function(emac_poll), check for netif_running() is unnecassary. In addition to associated runtime overhead, it also results in a continuous softirq loop when the interface is brought down under heavy traffic(tested wit Traffic Generator). Once the interface is disabled, the poll function always returns zero(with the check for netif_running) and napi_complete() would never get called resulting in softirq loop. Signed-off-by: Sriramakrishnan <srk@ti.com> Acked-by: Chaithrika U S <chaithrika@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-06Merge branch 'master' of ↵David S. Miller
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>
2009-11-04TI DaVinci EMAC: Add suspend/resume capabilityRanjith Lohithakshan
Add suspend/resume capability to TI DaVinci EMAC driver. Signed-off-by: Ranjith Lohithakshan <ranjithl@ti.com> Signed-off-by: Chaithrika U S <chaithrika@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-11-04DaVinci EMAC: correct param for ISRTonyliu
emac_irq is declared as: static irqreturn_t emac_irq(int irq, void *dev_id) { struct net_device *ndev = (struct net_device *)dev_id; struct emac_priv *priv = netdev_priv(ndev); ... Clearly emac_irq() needs "struct net_device *" as "void *dev_id", so correct this. Signed-off-by: Tonyliu <Bo.Liu@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-13Merge branch 'master' of ↵David S. Miller
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
2009-10-13TI DaVinci EMAC: Clear statistics register properly.Sriram
The mechanism to clear the statistics register is dependent on the status of GMIIEN bit in MAC control register. If the GMIIEN bit is set, the stats registers are write to decrement. If the GMIIEN bit is cleared, the stats registers are plain read/write registers. The stats register clearing operation must take into account the current state of GMIIEN as it can be cleared when the interface is brought down. With existing implementation logic, querying for interface stats when the interface is down, can corrupt the statistics counters. This patch examines the GMIIEN bit status in MAC_CONTROL register before choosing an appropriate mask for clearing stats registers. Signed-off-by: Sriramakrishnan <srk@ti.com> Acked-by: Chaithrika U S <chaithrika@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-05TI DaVinci EMAC: Minor macro related updateschaithrika@ti.com
Use BIT for macro definitions wherever possible, remove unused and redundant macros. Signed-off-by: Chaithrika U S <chaithrika@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-09-25TI Davinci EMAC: Fix in vector definition for EMAC_VERSION_2Sriram
In the emac_poll function when looking for interrupt status masks correct definition must be chosen based on EMAC_VERSION(the bit mask has changed from version 1 to version 2). Signed-off-by: Sriram <srk@ti.com> Acked-by: Chaithrika U S <chaithrika@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-09-02drivers: Kill now superfluous ->last_rx storesEric Dumazet
The generic packet receive code takes care of setting netdev->last_rx when necessary, for the sake of the bonding ARP monitor. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Neil Horman <nhorman@txudriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-08-29TI DaVinci EMAC: delay DaVinci EMAC initializationRajashekhara, Sudhakar
On TI's DA850/OMAP-L138 EVM, MAC address is stored in SPI flash which is accessed using MTD interface. This patch delays the initialization of DaVinci EMAC driver by changing module_init to late_initcall. This helps SPI and MTD drivers to get initialized before EMAC thereby enabling EMAC driver to read the MAC address while booting and use it. Tested with NFS on DM644x, DM6467, DA830/OMAP-L137 and DA850/OMAP-L138 EVMs. Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com> Reviewed-by: Chaithrika U S <chaithrika@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-07-08davinci_emac: fix kernel oops when changing MAC address while interface is downPablo Bitton
Check that network interface is running before changing its MAC address. Otherwise, rxch is accessed when it's NULL - causing a kernel oops. Moreover, check that the new MAC address is valid. Signed-off-by: Pablo Bitton <pablo.bitton@gmail.com> Signed-off-by: Chaithrika U S <chaithrika@ti.com> Tested-by: Chaithrika U S <chaithrika@ti.com> [tested on DM6467 EVM] Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-18TI DaVinci EMAC : Fix rmmod errorchaithrika@ti.com
clk_disable was called twice in the remove function. Correct this so that the driver module unloads without error. Signed-off-by: Chaithrika U S <chaithrika@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-06-03TI DaVinci EMAC: Remove print_mac, DECLARE_MAC_BUFChaithrika U S
Use printk format specifier for MAC address. Remove DECALRE_MAC_BUF and print_mac() usage in the driver. Signed-off-by: Chaithrika U S <chaithrika@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2009-05-18net: Add TI DaVinci EMAC driverAnant Gole
Add support for TI DaVinci EMAC driver. TI DaVinci Ethernet Media Access Controller module is based upon TI CPPI 3.0 DMA engine and supports 10/100 Mbps on all and Gigabit modes on some TI devices. It supports MII/RMII and has up to 8Kbytes of internal descriptor memory. This driver has been working on several TI devices including DM644x, DM646x and DA830 platforms. The specs of this device are available at: http://www.ti.com/litv/pdf/sprue24a Signed-off-by: Anant Gole <anantgole@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Chaithrika U S <chaithrika@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>