net: phy: phy drivers should not set SUPPORTED_[Asym_]Pause
authorTimur Tabi <timur@codeaurora.org>
Wed, 7 Dec 2016 19:20:51 +0000 (13:20 -0600)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Dec 2016 04:31:19 +0000 (23:31 -0500)
Instead of having individual PHY drivers set the SUPPORTED_Pause and
SUPPORTED_Asym_Pause flags, phylib itself should set those flags,
unless there is a hardware erratum or other special case.  During
autonegotiation, the PHYs will determine whether to enable pause
frame support.

Pause frames are a feature that is supported by the MAC.  It is the MAC
that generates the frames and that processes them.  The PHY can only be
configured to allow them to pass through.

This commit also effectively reverts the recently applied c7a61319
("net: phy: dp83848: Support ethernet pause frames").

So the new process is:

1) Unless the PHY driver overrides it, phylib sets the SUPPORTED_Pause
and SUPPORTED_AsymPause bits in phydev->supported.  This indicates that
the PHY supports pause frames.

2) The MAC driver checks phydev->supported before it calls phy_start().
If (SUPPORTED_Pause | SUPPORTED_AsymPause) is set, then the MAC driver
sets those bits in phydev->advertising, if it wants to enable pause
frame support.

3) When the link state changes, the MAC driver checks phydev->pause and
phydev->asym_pause,  If the bits are set, then it enables the corresponding
features in the MAC.  The algorithm is:

if (phydev->pause)
The MAC should be programmed to receive and honor
                pause frames it receives, i.e. enable receive flow control.

if (phydev->pause != phydev->asym_pause)
The MAC should be programmed to transmit pause
frames when needed, i.e. enable transmit flow control.

Signed-off-by: Timur Tabi <timur@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/bcm-cygnus.c
drivers/net/phy/bcm7xxx.c
drivers/net/phy/broadcom.c
drivers/net/phy/dp83848.c
drivers/net/phy/icplus.c
drivers/net/phy/intel-xway.c
drivers/net/phy/micrel.c
drivers/net/phy/microchip.c
drivers/net/phy/national.c
drivers/net/phy/phy_device.c
drivers/net/phy/smsc.c

index 196400cddf687f6722867bc93cd214a258be8119..3fe8cc5c177eea380255fc1c745754f2b5a221dd 100644 (file)
@@ -134,8 +134,7 @@ static struct phy_driver bcm_cygnus_phy_driver[] = {
        .phy_id        = PHY_ID_BCM_CYGNUS,
        .phy_id_mask   = 0xfffffff0,
        .name          = "Broadcom Cygnus PHY",
-       .features      = PHY_GBIT_FEATURES |
-                       SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features      = PHY_GBIT_FEATURES,
        .config_init   = bcm_cygnus_config_init,
        .config_aneg   = genphy_config_aneg,
        .read_status   = genphy_read_status,
index aae00bde59802ac956e228f4e71c5604b018e620..264b085d796b4f048551fa033b7c28d302675e24 100644 (file)
@@ -386,8 +386,7 @@ static int bcm7xxx_28nm_probe(struct phy_device *phydev)
        .phy_id         = (_oui),                                       \
        .phy_id_mask    = 0xfffffff0,                                   \
        .name           = _name,                                        \
-       .features       = PHY_GBIT_FEATURES |                           \
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,       \
+       .features       = PHY_GBIT_FEATURES,                            \
        .flags          = PHY_IS_INTERNAL,                              \
        .config_init    = bcm7xxx_28nm_config_init,                     \
        .config_aneg    = genphy_config_aneg,                           \
@@ -406,8 +405,7 @@ static int bcm7xxx_28nm_probe(struct phy_device *phydev)
        .phy_id         = (_oui),                                       \
        .phy_id_mask    = 0xfffffff0,                                   \
        .name           = _name,                                        \
-       .features       = PHY_BASIC_FEATURES |                          \
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,       \
+       .features       = PHY_BASIC_FEATURES,                           \
        .flags          = PHY_IS_INTERNAL,                              \
        .config_init    = bcm7xxx_config_init,                          \
        .config_aneg    = genphy_config_aneg,                           \
index 409b365f12b1e3421a9889c3dd113bd75283cd88..4223e35490b0c897ef7a8767189898ef917094bb 100644 (file)
@@ -525,8 +525,7 @@ static struct phy_driver broadcom_drivers[] = {
        .phy_id         = PHY_ID_BCM5411,
        .phy_id_mask    = 0xfffffff0,
        .name           = "Broadcom BCM5411",
-       .features       = PHY_GBIT_FEATURES |
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features       = PHY_GBIT_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = bcm54xx_config_init,
        .config_aneg    = genphy_config_aneg,
@@ -537,8 +536,7 @@ static struct phy_driver broadcom_drivers[] = {
        .phy_id         = PHY_ID_BCM5421,
        .phy_id_mask    = 0xfffffff0,
        .name           = "Broadcom BCM5421",
-       .features       = PHY_GBIT_FEATURES |
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features       = PHY_GBIT_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = bcm54xx_config_init,
        .config_aneg    = genphy_config_aneg,
@@ -549,8 +547,7 @@ static struct phy_driver broadcom_drivers[] = {
        .phy_id         = PHY_ID_BCM5461,
        .phy_id_mask    = 0xfffffff0,
        .name           = "Broadcom BCM5461",
-       .features       = PHY_GBIT_FEATURES |
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features       = PHY_GBIT_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = bcm54xx_config_init,
        .config_aneg    = genphy_config_aneg,
@@ -561,8 +558,7 @@ static struct phy_driver broadcom_drivers[] = {
        .phy_id         = PHY_ID_BCM54612E,
        .phy_id_mask    = 0xfffffff0,
        .name           = "Broadcom BCM54612E",
-       .features       = PHY_GBIT_FEATURES |
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features       = PHY_GBIT_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = bcm54xx_config_init,
        .config_aneg    = bcm54612e_config_aneg,
@@ -573,8 +569,7 @@ static struct phy_driver broadcom_drivers[] = {
        .phy_id         = PHY_ID_BCM54616S,
        .phy_id_mask    = 0xfffffff0,
        .name           = "Broadcom BCM54616S",
-       .features       = PHY_GBIT_FEATURES |
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features       = PHY_GBIT_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = bcm54xx_config_init,
        .config_aneg    = genphy_config_aneg,
@@ -585,8 +580,7 @@ static struct phy_driver broadcom_drivers[] = {
        .phy_id         = PHY_ID_BCM5464,
        .phy_id_mask    = 0xfffffff0,
        .name           = "Broadcom BCM5464",
-       .features       = PHY_GBIT_FEATURES |
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features       = PHY_GBIT_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = bcm54xx_config_init,
        .config_aneg    = genphy_config_aneg,
@@ -597,8 +591,7 @@ static struct phy_driver broadcom_drivers[] = {
        .phy_id         = PHY_ID_BCM5481,
        .phy_id_mask    = 0xfffffff0,
        .name           = "Broadcom BCM5481",
-       .features       = PHY_GBIT_FEATURES |
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features       = PHY_GBIT_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = bcm54xx_config_init,
        .config_aneg    = bcm5481_config_aneg,
@@ -609,8 +602,7 @@ static struct phy_driver broadcom_drivers[] = {
        .phy_id         = PHY_ID_BCM54810,
        .phy_id_mask    = 0xfffffff0,
        .name           = "Broadcom BCM54810",
-       .features       = PHY_GBIT_FEATURES |
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features       = PHY_GBIT_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = bcm54xx_config_init,
        .config_aneg    = bcm5481_config_aneg,
@@ -621,8 +613,7 @@ static struct phy_driver broadcom_drivers[] = {
        .phy_id         = PHY_ID_BCM5482,
        .phy_id_mask    = 0xfffffff0,
        .name           = "Broadcom BCM5482",
-       .features       = PHY_GBIT_FEATURES |
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features       = PHY_GBIT_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = bcm5482_config_init,
        .config_aneg    = genphy_config_aneg,
@@ -633,8 +624,7 @@ static struct phy_driver broadcom_drivers[] = {
        .phy_id         = PHY_ID_BCM50610,
        .phy_id_mask    = 0xfffffff0,
        .name           = "Broadcom BCM50610",
-       .features       = PHY_GBIT_FEATURES |
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features       = PHY_GBIT_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = bcm54xx_config_init,
        .config_aneg    = genphy_config_aneg,
@@ -645,8 +635,7 @@ static struct phy_driver broadcom_drivers[] = {
        .phy_id         = PHY_ID_BCM50610M,
        .phy_id_mask    = 0xfffffff0,
        .name           = "Broadcom BCM50610M",
-       .features       = PHY_GBIT_FEATURES |
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features       = PHY_GBIT_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = bcm54xx_config_init,
        .config_aneg    = genphy_config_aneg,
@@ -657,8 +646,7 @@ static struct phy_driver broadcom_drivers[] = {
        .phy_id         = PHY_ID_BCM57780,
        .phy_id_mask    = 0xfffffff0,
        .name           = "Broadcom BCM57780",
-       .features       = PHY_GBIT_FEATURES |
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features       = PHY_GBIT_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = bcm54xx_config_init,
        .config_aneg    = genphy_config_aneg,
@@ -669,8 +657,7 @@ static struct phy_driver broadcom_drivers[] = {
        .phy_id         = PHY_ID_BCMAC131,
        .phy_id_mask    = 0xfffffff0,
        .name           = "Broadcom BCMAC131",
-       .features       = PHY_BASIC_FEATURES |
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = brcm_fet_config_init,
        .config_aneg    = genphy_config_aneg,
@@ -681,8 +668,7 @@ static struct phy_driver broadcom_drivers[] = {
        .phy_id         = PHY_ID_BCM5241,
        .phy_id_mask    = 0xfffffff0,
        .name           = "Broadcom BCM5241",
-       .features       = PHY_BASIC_FEATURES |
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = brcm_fet_config_init,
        .config_aneg    = genphy_config_aneg,
index 320d0dc33b3db6206cd011f69c4376240bc3373c..800b39f0627943343c4276de637b30be4692352f 100644 (file)
@@ -88,9 +88,7 @@ MODULE_DEVICE_TABLE(mdio, dp83848_tbl);
                .phy_id         = _id,                          \
                .phy_id_mask    = 0xfffffff0,                   \
                .name           = _name,                        \
-               .features       = (PHY_BASIC_FEATURES |         \
-                                  SUPPORTED_Pause |            \
-                                  SUPPORTED_Asym_Pause),       \
+               .features       = PHY_BASIC_FEATURES,           \
                .flags          = PHY_HAS_INTERRUPT,            \
                                                                \
                .soft_reset     = genphy_soft_reset,            \
index e5f251b915788e87e369027ab0251bb6a9397964..22b51f01a94a7f3a67fd1a0fde91183c25c0e66f 100644 (file)
@@ -225,8 +225,7 @@ static struct phy_driver icplus_driver[] = {
        .phy_id         = 0x02430d90,
        .name           = "ICPlus IP1001",
        .phy_id_mask    = 0x0ffffff0,
-       .features       = PHY_GBIT_FEATURES | SUPPORTED_Pause |
-                         SUPPORTED_Asym_Pause,
+       .features       = PHY_GBIT_FEATURES,
        .config_init    = &ip1001_config_init,
        .config_aneg    = &genphy_config_aneg,
        .read_status    = &genphy_read_status,
@@ -236,8 +235,7 @@ static struct phy_driver icplus_driver[] = {
        .phy_id         = 0x02430c54,
        .name           = "ICPlus IP101A/G",
        .phy_id_mask    = 0x0ffffff0,
-       .features       = PHY_BASIC_FEATURES | SUPPORTED_Pause |
-                         SUPPORTED_Asym_Pause,
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_INTERRUPT,
        .ack_interrupt  = ip101a_g_ack_interrupt,
        .config_init    = &ip101a_g_config_init,
index c300ab5587b8e8114668c7c1742a17de1acb6cac..b1fd7bb0e4dbebe2da6f7f1b13857b1b64fa76f9 100644 (file)
@@ -239,8 +239,7 @@ static struct phy_driver xway_gphy[] = {
                .phy_id         = PHY_ID_PHY11G_1_3,
                .phy_id_mask    = 0xffffffff,
                .name           = "Intel XWAY PHY11G (PEF 7071/PEF 7072) v1.3",
-               .features       = (PHY_GBIT_FEATURES | SUPPORTED_Pause |
-                                  SUPPORTED_Asym_Pause),
+               .features       = PHY_GBIT_FEATURES,
                .flags          = PHY_HAS_INTERRUPT,
                .config_init    = xway_gphy_config_init,
                .config_aneg    = xway_gphy14_config_aneg,
@@ -254,8 +253,7 @@ static struct phy_driver xway_gphy[] = {
                .phy_id         = PHY_ID_PHY22F_1_3,
                .phy_id_mask    = 0xffffffff,
                .name           = "Intel XWAY PHY22F (PEF 7061) v1.3",
-               .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause |
-                                  SUPPORTED_Asym_Pause),
+               .features       = PHY_BASIC_FEATURES,
                .flags          = PHY_HAS_INTERRUPT,
                .config_init    = xway_gphy_config_init,
                .config_aneg    = xway_gphy14_config_aneg,
@@ -269,8 +267,7 @@ static struct phy_driver xway_gphy[] = {
                .phy_id         = PHY_ID_PHY11G_1_4,
                .phy_id_mask    = 0xffffffff,
                .name           = "Intel XWAY PHY11G (PEF 7071/PEF 7072) v1.4",
-               .features       = (PHY_GBIT_FEATURES | SUPPORTED_Pause |
-                                  SUPPORTED_Asym_Pause),
+               .features       = PHY_GBIT_FEATURES,
                .flags          = PHY_HAS_INTERRUPT,
                .config_init    = xway_gphy_config_init,
                .config_aneg    = xway_gphy14_config_aneg,
@@ -284,8 +281,7 @@ static struct phy_driver xway_gphy[] = {
                .phy_id         = PHY_ID_PHY22F_1_4,
                .phy_id_mask    = 0xffffffff,
                .name           = "Intel XWAY PHY22F (PEF 7061) v1.4",
-               .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause |
-                                  SUPPORTED_Asym_Pause),
+               .features       = PHY_BASIC_FEATURES,
                .flags          = PHY_HAS_INTERRUPT,
                .config_init    = xway_gphy_config_init,
                .config_aneg    = xway_gphy14_config_aneg,
@@ -299,8 +295,7 @@ static struct phy_driver xway_gphy[] = {
                .phy_id         = PHY_ID_PHY11G_1_5,
                .phy_id_mask    = 0xffffffff,
                .name           = "Intel XWAY PHY11G (PEF 7071/PEF 7072) v1.5 / v1.6",
-               .features       = (PHY_GBIT_FEATURES | SUPPORTED_Pause |
-                                  SUPPORTED_Asym_Pause),
+               .features       = PHY_GBIT_FEATURES,
                .flags          = PHY_HAS_INTERRUPT,
                .config_init    = xway_gphy_config_init,
                .config_aneg    = genphy_config_aneg,
@@ -314,8 +309,7 @@ static struct phy_driver xway_gphy[] = {
                .phy_id         = PHY_ID_PHY22F_1_5,
                .phy_id_mask    = 0xffffffff,
                .name           = "Intel XWAY PHY22F (PEF 7061) v1.5 / v1.6",
-               .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause |
-                                  SUPPORTED_Asym_Pause),
+               .features       = PHY_BASIC_FEATURES,
                .flags          = PHY_HAS_INTERRUPT,
                .config_init    = xway_gphy_config_init,
                .config_aneg    = genphy_config_aneg,
@@ -329,8 +323,7 @@ static struct phy_driver xway_gphy[] = {
                .phy_id         = PHY_ID_PHY11G_VR9,
                .phy_id_mask    = 0xffffffff,
                .name           = "Intel XWAY PHY11G (xRX integrated)",
-               .features       = (PHY_GBIT_FEATURES | SUPPORTED_Pause |
-                                  SUPPORTED_Asym_Pause),
+               .features       = PHY_GBIT_FEATURES,
                .flags          = PHY_HAS_INTERRUPT,
                .config_init    = xway_gphy_config_init,
                .config_aneg    = genphy_config_aneg,
@@ -344,8 +337,7 @@ static struct phy_driver xway_gphy[] = {
                .phy_id         = PHY_ID_PHY22F_VR9,
                .phy_id_mask    = 0xffffffff,
                .name           = "Intel XWAY PHY22F (xRX integrated)",
-               .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause |
-                                  SUPPORTED_Asym_Pause),
+               .features       = PHY_BASIC_FEATURES,
                .flags          = PHY_HAS_INTERRUPT,
                .config_init    = xway_gphy_config_init,
                .config_aneg    = genphy_config_aneg,
index ea92d524d5a814ff22727eefa1818c0b0fd47a32..9a77289109b721ed5190f214bb4d6f22d2098424 100644 (file)
@@ -790,7 +790,7 @@ static struct phy_driver ksphy_driver[] = {
        .phy_id         = PHY_ID_KS8737,
        .phy_id_mask    = MICREL_PHY_ID_MASK,
        .name           = "Micrel KS8737",
-       .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause),
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .driver_data    = &ks8737_type,
        .config_init    = kszphy_config_init,
@@ -807,8 +807,7 @@ static struct phy_driver ksphy_driver[] = {
        .phy_id         = PHY_ID_KSZ8021,
        .phy_id_mask    = 0x00ffffff,
        .name           = "Micrel KSZ8021 or KSZ8031",
-       .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause |
-                          SUPPORTED_Asym_Pause),
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .driver_data    = &ksz8021_type,
        .probe          = kszphy_probe,
@@ -826,8 +825,7 @@ static struct phy_driver ksphy_driver[] = {
        .phy_id         = PHY_ID_KSZ8031,
        .phy_id_mask    = 0x00ffffff,
        .name           = "Micrel KSZ8031",
-       .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause |
-                          SUPPORTED_Asym_Pause),
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .driver_data    = &ksz8021_type,
        .probe          = kszphy_probe,
@@ -845,8 +843,7 @@ static struct phy_driver ksphy_driver[] = {
        .phy_id         = PHY_ID_KSZ8041,
        .phy_id_mask    = MICREL_PHY_ID_MASK,
        .name           = "Micrel KSZ8041",
-       .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause
-                               | SUPPORTED_Asym_Pause),
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .driver_data    = &ksz8041_type,
        .probe          = kszphy_probe,
@@ -864,8 +861,7 @@ static struct phy_driver ksphy_driver[] = {
        .phy_id         = PHY_ID_KSZ8041RNLI,
        .phy_id_mask    = MICREL_PHY_ID_MASK,
        .name           = "Micrel KSZ8041RNLI",
-       .features       = PHY_BASIC_FEATURES |
-                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .driver_data    = &ksz8041_type,
        .probe          = kszphy_probe,
@@ -883,8 +879,7 @@ static struct phy_driver ksphy_driver[] = {
        .phy_id         = PHY_ID_KSZ8051,
        .phy_id_mask    = MICREL_PHY_ID_MASK,
        .name           = "Micrel KSZ8051",
-       .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause
-                               | SUPPORTED_Asym_Pause),
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .driver_data    = &ksz8051_type,
        .probe          = kszphy_probe,
@@ -902,7 +897,7 @@ static struct phy_driver ksphy_driver[] = {
        .phy_id         = PHY_ID_KSZ8001,
        .name           = "Micrel KSZ8001 or KS8721",
        .phy_id_mask    = 0x00fffffc,
-       .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause),
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .driver_data    = &ksz8041_type,
        .probe          = kszphy_probe,
@@ -920,7 +915,7 @@ static struct phy_driver ksphy_driver[] = {
        .phy_id         = PHY_ID_KSZ8081,
        .name           = "Micrel KSZ8081 or KSZ8091",
        .phy_id_mask    = MICREL_PHY_ID_MASK,
-       .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause),
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .driver_data    = &ksz8081_type,
        .probe          = kszphy_probe,
@@ -938,7 +933,7 @@ static struct phy_driver ksphy_driver[] = {
        .phy_id         = PHY_ID_KSZ8061,
        .name           = "Micrel KSZ8061",
        .phy_id_mask    = MICREL_PHY_ID_MASK,
-       .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause),
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = kszphy_config_init,
        .config_aneg    = genphy_config_aneg,
@@ -954,7 +949,7 @@ static struct phy_driver ksphy_driver[] = {
        .phy_id         = PHY_ID_KSZ9021,
        .phy_id_mask    = 0x000ffffe,
        .name           = "Micrel KSZ9021 Gigabit PHY",
-       .features       = (PHY_GBIT_FEATURES | SUPPORTED_Pause),
+       .features       = PHY_GBIT_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .driver_data    = &ksz9021_type,
        .config_init    = ksz9021_config_init,
@@ -973,7 +968,7 @@ static struct phy_driver ksphy_driver[] = {
        .phy_id         = PHY_ID_KSZ9031,
        .phy_id_mask    = MICREL_PHY_ID_MASK,
        .name           = "Micrel KSZ9031 Gigabit PHY",
-       .features       = (PHY_GBIT_FEATURES | SUPPORTED_Pause),
+       .features       = PHY_GBIT_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .driver_data    = &ksz9021_type,
        .config_init    = ksz9031_config_init,
@@ -990,7 +985,6 @@ static struct phy_driver ksphy_driver[] = {
        .phy_id         = PHY_ID_KSZ8873MLL,
        .phy_id_mask    = MICREL_PHY_ID_MASK,
        .name           = "Micrel KSZ8873MLL Switch",
-       .features       = (SUPPORTED_Pause | SUPPORTED_Asym_Pause),
        .flags          = PHY_HAS_MAGICANEG,
        .config_init    = kszphy_config_init,
        .config_aneg    = ksz8873mll_config_aneg,
@@ -1004,7 +998,7 @@ static struct phy_driver ksphy_driver[] = {
        .phy_id         = PHY_ID_KSZ886X,
        .phy_id_mask    = MICREL_PHY_ID_MASK,
        .name           = "Micrel KSZ886X Switch",
-       .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause),
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
        .config_init    = kszphy_config_init,
        .config_aneg    = genphy_config_aneg,
index 12825a5feb3ffff14969756cbe241de06dba9e70..324fbf6ad8ff8fcc51e92cd2f4d26399b00dfc41 100644 (file)
@@ -146,8 +146,7 @@ static struct phy_driver microchip_phy_driver[] = {
        .phy_id_mask    = 0xfffffff0,
        .name           = "Microchip LAN88xx",
 
-       .features       = (PHY_GBIT_FEATURES |
-                          SUPPORTED_Pause | SUPPORTED_Asym_Pause),
+       .features       = PHY_GBIT_FEATURES,
        .flags          = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG,
 
        .probe          = lan88xx_probe,
index 2a1b490bc58718ee20e647ec341aa54707bf174a..2addf1d3f619ef700d656e0bf07ee7703309cd12 100644 (file)
@@ -133,7 +133,7 @@ static struct phy_driver dp83865_driver[] = { {
        .phy_id = DP83865_PHY_ID,
        .phy_id_mask = 0xfffffff0,
        .name = "NatSemi DP83865",
-       .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .features = PHY_GBIT_FEATURES,
        .flags = PHY_HAS_INTERRUPT,
        .config_init = ns_config_init,
        .config_aneg = genphy_config_aneg,
index 0aadef9fc7dd700ad0dd72205c65865bfaa27912..9c06f8028f0c349629365cbdc82f63f63b55c098 100644 (file)
@@ -1719,6 +1719,25 @@ static int phy_probe(struct device *dev)
         */
        of_set_phy_eee_broken(phydev);
 
+       /* The Pause Frame bits indicate that the PHY can support passing
+        * pause frames. During autonegotiation, the PHYs will determine if
+        * they should allow pause frames to pass.  The MAC driver should then
+        * use that result to determine whether to enable flow control via
+        * pause frames.
+        *
+        * Normally, PHY drivers should not set the Pause bits, and instead
+        * allow phylib to do that.  However, there may be some situations
+        * (e.g. hardware erratum) where the driver wants to set only one
+        * of these bits.
+        */
+       if (phydrv->features & (SUPPORTED_Pause | SUPPORTED_Asym_Pause)) {
+               phydev->supported &= ~(SUPPORTED_Pause | SUPPORTED_Asym_Pause);
+               phydev->supported |= phydrv->features &
+                                    (SUPPORTED_Pause | SUPPORTED_Asym_Pause);
+       } else {
+               phydev->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
+       }
+
        /* Set the state to READY by default */
        phydev->state = PHY_READY;
 
index b62c4aaee40bd8986a80965a615d327e9c270293..fb32eaf2255d84a7de2842f60f91b52cf17c1717 100644 (file)
@@ -168,8 +168,7 @@ static struct phy_driver smsc_phy_driver[] = {
        .phy_id_mask    = 0xfffffff0,
        .name           = "SMSC LAN83C185",
 
-       .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause
-                               | SUPPORTED_Asym_Pause),
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG,
 
        .probe          = smsc_phy_probe,
@@ -191,8 +190,7 @@ static struct phy_driver smsc_phy_driver[] = {
        .phy_id_mask    = 0xfffffff0,
        .name           = "SMSC LAN8187",
 
-       .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause
-                               | SUPPORTED_Asym_Pause),
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG,
 
        .probe          = smsc_phy_probe,
@@ -214,8 +212,7 @@ static struct phy_driver smsc_phy_driver[] = {
        .phy_id_mask    = 0xfffffff0,
        .name           = "SMSC LAN8700",
 
-       .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause
-                               | SUPPORTED_Asym_Pause),
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG,
 
        .probe          = smsc_phy_probe,
@@ -237,8 +234,7 @@ static struct phy_driver smsc_phy_driver[] = {
        .phy_id_mask    = 0xfffffff0,
        .name           = "SMSC LAN911x Internal PHY",
 
-       .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause
-                               | SUPPORTED_Asym_Pause),
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG,
 
        .probe          = smsc_phy_probe,
@@ -259,8 +255,7 @@ static struct phy_driver smsc_phy_driver[] = {
        .phy_id_mask    = 0xfffffff0,
        .name           = "SMSC LAN8710/LAN8720",
 
-       .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause
-                               | SUPPORTED_Asym_Pause),
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG,
 
        .probe          = smsc_phy_probe,
@@ -282,8 +277,7 @@ static struct phy_driver smsc_phy_driver[] = {
        .phy_id_mask    = 0xfffffff0,
        .name           = "SMSC LAN8740",
 
-       .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause
-                               | SUPPORTED_Asym_Pause),
+       .features       = PHY_BASIC_FEATURES,
        .flags          = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG,
 
        .probe          = smsc_phy_probe,