summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/broadcom/bcmsysport.h
AgeCommit message (Collapse)Author
2018-03-31net: systemport: Rewrite __bcm_sysport_tx_reclaim()Florian Fainelli
[ Upstream commit 484d802d0f2f29c335563fcac2a8facf174a1bbc ] There is no need for complex checking between the last consumed index and current consumed index, a simple subtraction will do. This also eliminates the possibility of a permanent transmit queue stall under the following conditions: - one CPU bursts ring->size worth of traffic (up to 256 buffers), to the point where we run out of free descriptors, so we stop the transmit queue at the end of bcm_sysport_xmit() - because of our locking, we have the transmit process disable interrupts which means we can be blocking the TX reclamation process - when TX reclamation finally runs, we will be computing the difference between ring->c_index (last consumed index by SW) and what the HW reports through its register - this register is masked with (ring->size - 1) = 0xff, which will lead to stripping the upper bits of the index (register is 16-bits wide) - we will be computing last_tx_cn as 0, which means there is no work to be done, and we never wake-up the transmit queue, leaving it permanently disabled A practical example is e.g: ring->c_index aka last_c_index = 12, we pushed 256 entries, HW consumer index = 268, we mask it with 0xff = 12, so last_tx_cn == 0, nothing happens. Fixes: 80105befdb4b ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-19net: ethernet: bcmsysport: use phydev from struct net_devicePhilippe Reynes
The private structure contain a pointer to phydev, but the structure net_device already contain such pointer. So we can remove the pointer phydev in the private structure, and update the driver to use the one contained in struct net_device. Signed-off-by: Philippe Reynes <tremyfr@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-05-30net: systemport: Pre-calculate and utilize cb->bd_addrFlorian Fainelli
There is a 1:1 mapping between the software maintained control block in priv->rx_cbs and the buffer address in priv->rx_bds, such that there is no need to keep computing the buffer address when refiling a control block. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-05-12net: systemport: Implement RX coalescing control knobsFlorian Fainelli
Similarly to the TX path, allow the RX path to be configured with both 'rx-frames' and 'rx-usecs' coalescing parameters. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2015-04-29trivial: net: systemport: bcmsysport.h: fix 0x0x prefixAntonio Ospite
Fix the 0x0x prefix in an integer constant. In this case, while at it, also fix a typo (s/unitcast/unicast/). Signed-off-by: Antonio Ospite <ao2@ao2.it> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
2015-03-01net: systemport: fix software maintained statisticsFlorian Fainelli
Commit 60b4ea1781fd ("net: systemport: log RX buffer allocation and RX/TX DMA failures") added a few software maintained statistics using BCM_SYSPORT_STAT_MIB_RX and BCM_SYSPORT_STAT_MIB_TX. These statistics are read from the hardware MIB counters, such that bcm_sysport_update_mib_counters() was trying to read from a non-existing MIB offset for these counters. Fix this by introducing a special type: BCM_SYSPORT_STAT_SOFT, similar to BCM_SYSPORT_STAT_NETDEV, such that bcm_sysport_get_ethtool_stats will read from the software mib. Fixes: 60b4ea1781fd ("net: systemport: log RX buffer allocation and RX/TX DMA failures") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-11-21net: systemport: log RX buffer allocation and RX/TX DMA failuresFlorian Fainelli
To help troubleshoot heavy memory pressure conditions, add a bunch of statistics counter to log RX buffer allocation and RX/TX DMA mapping failures. These are reported like any other counters through the ethtool stats interface. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07net: systemport: add Wake-on-LAN supportFlorian Fainelli
Support for Wake-on-LAN using Magic Packet with or without SecureOn password is implemented doing the following: - setting the password to the relevant UniMAC registers - flagging the device as a wakeup source for the system, as well as its Wake-on-LAN interrupt - prepare the hardware for entering WoL mode - enabling the MPD interrupt to wake us The Device Tree binding documentation is also reflected to specify the third optional Wake-on-LAN interrupt line. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-07-07net: systemport: rename rx_csum_en to rx_chk_enFlorian Fainelli
This boolean tells us whether we are using the RXCHK hardware block, so use a variable name that reflects that. RXCHK might be used in the future to implement Wake-on-LAN using ARP or unicast packets. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-06-02drivers/net: fix broadcom/bcmsysport.c compile fail on SPARCPaul Gortmaker
To fix: CC drivers/net/ethernet/broadcom/bcmsysport.o In file included from drivers/net/ethernet/broadcom/bcmsysport.c:28:0: drivers/net/ethernet/broadcom/bcmsysport.h:41:8: error: redefinition of 'struct tsb' arch/sparc/include/asm/mmu_64.h:65:8: note: originally defined here make[1]: *** [drivers/net/ethernet/broadcom/bcmsysport.o] Error 1 we change struct tsb to struct bcm_tsb in the broadcom driver in order to avoid the namespace collision. For consistency, we also change struct rsb to struct bcm_rsb, so the Rx/Tx symmetry is maintained. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-05-22net: systemport: use the new fixed PHY helpersFlorian Fainelli
of_phy_connect_fixed_link() is becoming obsolete, and also required platform code to register the fixed PHYs at the specified addresses for those to be usable. Get rid of it and use the new of_phy_is_fixed_link() plus of_phy_register_fixed_link() helpers to transition over the new scheme. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-05-15net: systemport: pad packets to a minimum of 68 bytesFlorian Fainelli
Packets need to be at least 64 bytes to enter the switch port logic, including the FCS, otherwise they will be discarded as RUNT packets. With packets having Broadcom tags, the 4-bytes tag is first stripped off the packet, and the packet length is then checked, so we need to make sure that the packet length with FCS is at least 64 bytes. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2014-04-26net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driverFlorian Fainelli
SYSTEMPORT is the latest Ethernet MAC hardware block used on newer BCM7xxx Set Top Box SoCs in conjunction with an internal Ethernet switch. This patch adds support for this hardware block along with the following hardware features: - support for hardware checksum offload (transmit and receive) - support for the 32 transmit queues - MIB counters reading Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>