From a188222b6ed29404ac2d4232d35d1fe0e77af370 Mon Sep 17 00:00:00 2001 From: Tom Herbert Date: Mon, 14 Dec 2015 11:19:43 -0800 Subject: net: Rename NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK The name NETIF_F_ALL_CSUM is a misnomer. This does not correspond to the set of features for offloading all checksums. This is a mask of the checksum offload related features bits. It is incorrect to set both NETIF_F_HW_CSUM and NETIF_F_IP_CSUM or NETIF_F_IPV6 at the same time for features of a device. This patch: - Changes instances of NETIF_F_ALL_CSUM to NETIF_F_CSUM_MASK (where NETIF_F_ALL_CSUM is being used as a mask). - Changes bonding, sfc/efx, ipvlan, macvlan, vlan, and team drivers to use NEITF_F_HW_CSUM in features list instead of NETIF_F_ALL_CSUM. Signed-off-by: Tom Herbert Signed-off-by: David S. Miller --- drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging') diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c index 679785b0209c..9de4f23910d8 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c @@ -69,7 +69,7 @@ ksocknal_lib_zc_capable(ksock_conn_t *conn) /* ZC if the socket supports scatter/gather and doesn't need software * checksums */ - return ((caps & NETIF_F_SG) != 0 && (caps & NETIF_F_ALL_CSUM) != 0); + return ((caps & NETIF_F_SG) != 0 && (caps & NETIF_F_CSUM_MASK) != 0); } int -- cgit v1.2.3 From 84eff6d194df442bee62c129f2f47efb0dbd0468 Mon Sep 17 00:00:00 2001 From: Andrew Lunn Date: Wed, 6 Jan 2016 20:11:10 +0100 Subject: phy: add phydev_name() wrapper Add a phydev_name() function, to help with moving some structure members from phy_device. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller --- drivers/staging/netlogic/xlr_net.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/staging') diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c index 8ae01753b011..b939c4b5f229 100644 --- a/drivers/staging/netlogic/xlr_net.c +++ b/drivers/staging/netlogic/xlr_net.c @@ -838,8 +838,8 @@ static int xlr_mii_probe(struct xlr_net_priv *priv) } /* Attach MAC to PHY */ - phydev = phy_connect(priv->ndev, dev_name(&phydev->dev), - &xlr_gmac_link_adjust, priv->nd->phy_interface); + phydev = phy_connect(priv->ndev, phydev_name(phydev), + &xlr_gmac_link_adjust, priv->nd->phy_interface); if (IS_ERR(phydev)) { pr_err("could not attach PHY\n"); @@ -855,7 +855,7 @@ static int xlr_mii_probe(struct xlr_net_priv *priv) phydev->advertising = phydev->supported; pr_info("attached PHY driver [%s] (mii_bus:phy_addr=%s\n", - phydev->drv->name, dev_name(&phydev->dev)); + phydev->drv->name, phydev_name(phydev)); return 0; } -- cgit v1.2.3 From 2220943a21e26d97d7fd8f83c004b947326b469d Mon Sep 17 00:00:00 2001 From: Andrew Lunn Date: Wed, 6 Jan 2016 20:11:13 +0100 Subject: phy: Centralise print about attached phy Many Ethernet drivers contain the same netdev_info() print statement about the attached phy. Move it into the phy device code. Additionally add a varargs function which can be used to append additional information. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller --- drivers/staging/netlogic/xlr_net.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/staging') diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c index b939c4b5f229..cbc25b7e70a2 100644 --- a/drivers/staging/netlogic/xlr_net.c +++ b/drivers/staging/netlogic/xlr_net.c @@ -854,8 +854,7 @@ static int xlr_mii_probe(struct xlr_net_priv *priv) | ADVERTISED_MII); phydev->advertising = phydev->supported; - pr_info("attached PHY driver [%s] (mii_bus:phy_addr=%s\n", - phydev->drv->name, phydev_name(phydev)); + phy_attached_info(phydev); return 0; } -- cgit v1.2.3 From 0c129bf756f869dc386005c59c2f815305dccc86 Mon Sep 17 00:00:00 2001 From: Andrew Lunn Date: Thu, 7 Jan 2016 21:55:52 +0100 Subject: net: ethernet-rgmii.c: Fix breakage from moving phdev bus The mdio device patches moved the bus member in phy_device into a substructure. This driver got missed. Fix it. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller --- drivers/staging/octeon/ethernet-rgmii.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/staging') diff --git a/drivers/staging/octeon/ethernet-rgmii.c b/drivers/staging/octeon/ethernet-rgmii.c index 613344b886e1..1055ee14b66a 100644 --- a/drivers/staging/octeon/ethernet-rgmii.c +++ b/drivers/staging/octeon/ethernet-rgmii.c @@ -78,7 +78,7 @@ static void cvm_oct_rgmii_poll(struct net_device *dev) */ spin_lock_irqsave(&global_register_lock, flags); } else { - mutex_lock(&priv->phydev->bus->mdio_lock); + mutex_lock(&priv->phydev->mdio.bus->mdio_lock); } link_info = cvmx_helper_link_get(priv->port); @@ -113,7 +113,7 @@ static void cvm_oct_rgmii_poll(struct net_device *dev) if (use_global_register_lock) spin_unlock_irqrestore(&global_register_lock, flags); else - mutex_unlock(&priv->phydev->bus->mdio_lock); + mutex_unlock(&priv->phydev->mdio.bus->mdio_lock); return; } @@ -132,7 +132,7 @@ static void cvm_oct_rgmii_poll(struct net_device *dev) if (use_global_register_lock) spin_unlock_irqrestore(&global_register_lock, flags); else - mutex_unlock(&priv->phydev->bus->mdio_lock); + mutex_unlock(&priv->phydev->mdio.bus->mdio_lock); if (priv->phydev == NULL) { /* Tell core. */ -- cgit v1.2.3 From 3fe01e2406ead2bdc4ae436254c66b5341c1e5c7 Mon Sep 17 00:00:00 2001 From: Andrew Lunn Date: Mon, 11 Jan 2016 00:57:43 +0100 Subject: staging: netlogic: Fix build error due to missed API change Fix a number of build errors due to moving the phy_map and centralizing interrupt allocation. Signed-off-by: Andrew Lunn Signed-off-by: David S. Miller --- drivers/staging/netlogic/xlr_net.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'drivers/staging') diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c index cbc25b7e70a2..0b4e819f5164 100644 --- a/drivers/staging/netlogic/xlr_net.c +++ b/drivers/staging/netlogic/xlr_net.c @@ -165,13 +165,18 @@ static void xlr_net_fmn_handler(int bkt, int src_stnid, int size, } } +static struct phy_device *xlr_get_phydev(struct xlr_net_priv *priv) +{ + return mdiobus_get_phy(priv->mii_bus, priv->phy_addr); +} + /* * Ethtool operation */ static int xlr_get_settings(struct net_device *ndev, struct ethtool_cmd *ecmd) { struct xlr_net_priv *priv = netdev_priv(ndev); - struct phy_device *phydev = priv->mii_bus->phy_map[priv->phy_addr]; + struct phy_device *phydev = xlr_get_phydev(priv); if (!phydev) return -ENODEV; @@ -181,7 +186,7 @@ static int xlr_get_settings(struct net_device *ndev, struct ethtool_cmd *ecmd) static int xlr_set_settings(struct net_device *ndev, struct ethtool_cmd *ecmd) { struct xlr_net_priv *priv = netdev_priv(ndev); - struct phy_device *phydev = priv->mii_bus->phy_map[priv->phy_addr]; + struct phy_device *phydev = xlr_get_phydev(priv); if (!phydev) return -ENODEV; @@ -218,7 +223,7 @@ static int xlr_net_open(struct net_device *ndev) { u32 err; struct xlr_net_priv *priv = netdev_priv(ndev); - struct phy_device *phydev = priv->mii_bus->phy_map[priv->phy_addr]; + struct phy_device *phydev = xlr_get_phydev(priv); /* schedule a link state check */ phy_start(phydev); @@ -239,7 +244,7 @@ static int xlr_net_open(struct net_device *ndev) static int xlr_net_stop(struct net_device *ndev) { struct xlr_net_priv *priv = netdev_priv(ndev); - struct phy_device *phydev = priv->mii_bus->phy_map[priv->phy_addr]; + struct phy_device *phydev = xlr_get_phydev(priv); phy_stop(phydev); netif_tx_stop_all_queues(ndev); @@ -268,7 +273,7 @@ static void __maybe_unused xlr_wakeup_queue(unsigned long dev) { struct net_device *ndev = (struct net_device *) dev; struct xlr_net_priv *priv = netdev_priv(ndev); - struct phy_device *phydev = priv->mii_bus->phy_map[priv->phy_addr]; + struct phy_device *phydev = xlr_get_phydev(priv); if (phydev->link) netif_tx_wake_queue(netdev_get_tx_queue(ndev, priv->wakeup_q)); @@ -771,7 +776,7 @@ static void xlr_sgmii_init(struct xlr_net_priv *priv) void xlr_set_gmac_speed(struct xlr_net_priv *priv) { - struct phy_device *phydev = priv->mii_bus->phy_map[priv->phy_addr]; + struct phy_device *phydev = xlr_get_phydev(priv); int speed; if (phydev->interface == PHY_INTERFACE_MODE_SGMII) @@ -813,7 +818,7 @@ void xlr_set_gmac_speed(struct xlr_net_priv *priv) static void xlr_gmac_link_adjust(struct net_device *ndev) { struct xlr_net_priv *priv = netdev_priv(ndev); - struct phy_device *phydev = priv->mii_bus->phy_map[priv->phy_addr]; + struct phy_device *phydev = xlr_get_phydev(priv); u32 intreg; intreg = xlr_nae_rdreg(priv->base_addr, R_INTREG); @@ -830,7 +835,7 @@ static void xlr_gmac_link_adjust(struct net_device *ndev) static int xlr_mii_probe(struct xlr_net_priv *priv) { - struct phy_device *phydev = priv->mii_bus->phy_map[priv->phy_addr]; + struct phy_device *phydev = xlr_get_phydev(priv); if (!phydev) { pr_err("no PHY found on phy_addr %d\n", priv->phy_addr); @@ -876,14 +881,6 @@ static int xlr_setup_mdio(struct xlr_net_priv *priv, priv->mii_bus->read = xlr_mii_read; priv->mii_bus->write = xlr_mii_write; priv->mii_bus->parent = &pdev->dev; - priv->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); - if (priv->mii_bus->irq == NULL) { - pr_err("irq alloc failed\n"); - mdiobus_free(priv->mii_bus); - return -ENOMEM; - } - - priv->mii_bus->irq[priv->phy_addr] = priv->ndev->irq; /* Scan only the enabled address */ priv->mii_bus->phy_mask = ~(1 << priv->phy_addr); -- cgit v1.2.3