kernel: update stmmac ethernet driver from latest linux-sh4-2.6.32.y - _stm24_0217

This commit is contained in:
Jaroslav Kysela
2016-02-11 21:19:20 +01:00
parent ccc89f44ae
commit dcaf0bf211
34 changed files with 2989 additions and 591 deletions

View File

@@ -497,6 +497,8 @@ struct ethtool_ops {
u32 (*get_priv_flags)(struct net_device *);
int (*set_priv_flags)(struct net_device *, u32);
int (*get_sset_count)(struct net_device *, int);
int (*get_eee) (struct net_device *, struct ethtool_value *);
int (*set_eee) (struct net_device *, struct ethtool_value *);
/* the following hooks are obsolete */
int (*self_test_count)(struct net_device *);/* use get_sset_count */
@@ -561,6 +563,8 @@ struct ethtool_ops {
#define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */
#define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */
#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
#define ETHTOOL_GEEE 0x00000041 /* Get EEE */
#define ETHTOOL_SEEE 0x00000042 /* Set EEE */
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET
@@ -663,6 +667,7 @@ struct ethtool_ops {
#define WAKE_ARP (1 << 4)
#define WAKE_MAGIC (1 << 5)
#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
#define WAKE_DOWN_SPEED (1 << 7)
/* L3-L4 network traffic flow types */
#define TCP_V4_FLOW 0x01

View File

@@ -42,7 +42,11 @@
#define MDIO_PKGID2 15
#define MDIO_AN_ADVERTISE 16 /* AN advertising (base page) */
#define MDIO_AN_LPA 19 /* AN LP abilities (base page) */
#define MDIO_EEE_CAP 20 /* EEE Capability register */
#define MDIO_EEE_WK_ERR 22 /* EEE wake error counter */
#define MDIO_PHYXS_LNSTAT 24 /* PHY XGXS lane state */
#define MDIO_EEE_ADV 60 /* EEE advertisement */
#define MDIO_EEE_PART_LINK 61 /* EEE link partner ability */
/* Media-dependent registers. */
#define MDIO_PMA_10GBT_SWAPPOL 130 /* 10GBASE-T pair swap & polarity */
@@ -80,6 +84,7 @@
#define MDIO_AN_CTRL1_RESTART BMCR_ANRESTART
#define MDIO_AN_CTRL1_ENABLE BMCR_ANENABLE
#define MDIO_AN_CTRL1_XNP 0x2000 /* Enable extended next page */
#define MDIO_PCS_CLK_STOP_ENABLE 0x400 /* Stop the clock during LPI */
/* 10 Gb/s */
#define MDIO_CTRL1_SPEED10G (MDIO_CTRL1_SPEEDSELEXT | 0x00)

View File

@@ -21,6 +21,8 @@
#define MII_EXPANSION 0x06 /* Expansion register */
#define MII_CTRL1000 0x09 /* 1000BASE-T control */
#define MII_STAT1000 0x0a /* 1000BASE-T status */
#define MII_MMD_CRTL 0x0d /* MMD Access Control Register */
#define MII_MMD_DATA 0x0e /* MMD Access Data Register */
#define MII_ESTATUS 0x0f /* Extended Status */
#define MII_DCOUNTER 0x12 /* Disconnect counter */
#define MII_FCSCOUNTER 0x13 /* False carrier counter */
@@ -139,6 +141,15 @@
#define FLOW_CTRL_TX 0x01
#define FLOW_CTRL_RX 0x02
/* MMD Access Control register fields */
#define MII_MMD_CRTL_DEVAD_MASK 0x1f /* Mask MMD DEVAD*/
#define MII_MMD_CRTL_FUNC_ADDR 0x0000 /* Address */
#define MII_MMD_CTRL_FUNC_DATA_NOINCR 0x4000 /* no post increment */
#define MII_MMD_CTRL_FUNC_DATA_INCR_ON_RDWT 0x8000 /* post increment on
* reads & writes */
#define MII_MMD_CTRL_FUNC_DATA_INCR_ON_WT 0xC000 /* post increment on
* writes only */
/* This structure is used in all SIOCxMIIxxx ioctl calls */
struct mii_ioctl_data {
__u16 phy_id;

View File

@@ -248,6 +248,7 @@ enum phy_state {
* changes in the link state.
* adjust_state: Callback for the enet driver to respond to
* changes in the state machine.
* wol: which WoL mode will be used to wake-up the system via ethtool.
*
* speed, duplex, pause, supported, advertising, and
* autoneg are used like in mii_if_info
@@ -321,6 +322,7 @@ struct phy_device {
struct mutex lock;
struct net_device *attached_dev;
int wol;
void (*adjust_link)(struct net_device *dev);
@@ -339,6 +341,8 @@ struct phy_device {
* by this PHY
* flags: A bitfield defining certain other features this PHY
* supports (like interrupts)
* wol: to define which Wake-up modes are supported (e.g. WoL
* via magic packet).
*
* The drivers must implement config_aneg and read_status. All
* other functions are optional. Note that none of these
@@ -354,6 +358,7 @@ struct phy_driver {
unsigned int phy_id_mask;
u32 features;
u32 flags;
u32 wol_supported;
/*
* Called to initialize the PHY,
@@ -442,6 +447,9 @@ static inline int phy_write(struct phy_device *phydev, u16 regnum, u16 val)
return mdiobus_write(phydev->bus, phydev->addr, regnum, val);
}
int phy_read_page(struct phy_device *phydev, u16 regnum, int page);
int phy_write_page(struct phy_device *phydev, u16 regnum, int page, int data);
int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id);
struct phy_device* get_phy_device(struct mii_bus *bus, int addr);
int phy_device_register(struct phy_device *phy);
@@ -489,6 +497,9 @@ void phy_start_machine(struct phy_device *phydev,
void phy_stop_machine(struct phy_device *phydev);
int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
int phy_ethtool_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol);
int phy_ethtool_get_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol);
int phy_mii_ioctl(struct phy_device *phydev,
struct mii_ioctl_data *mii_data, int cmd);
int phy_start_interrupts(struct phy_device *phydev);
@@ -504,6 +515,9 @@ int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
int (*run)(struct phy_device *));
int phy_scan_fixups(struct phy_device *phydev);
int phy_check_eee(struct phy_device *phydev);
int phy_get_eee_err(struct phy_device *phydev);
int __init mdio_bus_init(void);
void mdio_bus_exit(void);

View File

@@ -26,6 +26,8 @@
#ifndef __STMMAC_PLATFORM_DATA
#define __STMMAC_PLATFORM_DATA
#include <linux/platform_device.h>
/* Platfrom data for platform device structure's platform_data field */
struct stmmac_mdio_bus_data {
@@ -48,6 +50,7 @@ struct plat_stmmacenet_data {
int tx_coe;
int bugged_jumbo;
int pmt;
int force_sf_dma_mode;
void (*fix_mac_speed)(void *priv, unsigned int speed);
void (*bus_setup)(void __iomem *ioaddr);
int (*init)(struct platform_device *pdev);