Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: phy drivers should not set SUPPORTED_[Asym_]Pause

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>

authored by

Timur Tabi and committed by
David S. Miller
529ed127 fba40c63

+67 -90
+1 -2
drivers/net/phy/bcm-cygnus.c
··· 134 134 .phy_id = PHY_ID_BCM_CYGNUS, 135 135 .phy_id_mask = 0xfffffff0, 136 136 .name = "Broadcom Cygnus PHY", 137 - .features = PHY_GBIT_FEATURES | 138 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, 137 + .features = PHY_GBIT_FEATURES, 139 138 .config_init = bcm_cygnus_config_init, 140 139 .config_aneg = genphy_config_aneg, 141 140 .read_status = genphy_read_status,
+2 -4
drivers/net/phy/bcm7xxx.c
··· 386 386 .phy_id = (_oui), \ 387 387 .phy_id_mask = 0xfffffff0, \ 388 388 .name = _name, \ 389 - .features = PHY_GBIT_FEATURES | \ 390 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, \ 389 + .features = PHY_GBIT_FEATURES, \ 391 390 .flags = PHY_IS_INTERNAL, \ 392 391 .config_init = bcm7xxx_28nm_config_init, \ 393 392 .config_aneg = genphy_config_aneg, \ ··· 405 406 .phy_id = (_oui), \ 406 407 .phy_id_mask = 0xfffffff0, \ 407 408 .name = _name, \ 408 - .features = PHY_BASIC_FEATURES | \ 409 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, \ 409 + .features = PHY_BASIC_FEATURES, \ 410 410 .flags = PHY_IS_INTERNAL, \ 411 411 .config_init = bcm7xxx_config_init, \ 412 412 .config_aneg = genphy_config_aneg, \
+14 -28
drivers/net/phy/broadcom.c
··· 525 525 .phy_id = PHY_ID_BCM5411, 526 526 .phy_id_mask = 0xfffffff0, 527 527 .name = "Broadcom BCM5411", 528 - .features = PHY_GBIT_FEATURES | 529 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, 528 + .features = PHY_GBIT_FEATURES, 530 529 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 531 530 .config_init = bcm54xx_config_init, 532 531 .config_aneg = genphy_config_aneg, ··· 536 537 .phy_id = PHY_ID_BCM5421, 537 538 .phy_id_mask = 0xfffffff0, 538 539 .name = "Broadcom BCM5421", 539 - .features = PHY_GBIT_FEATURES | 540 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, 540 + .features = PHY_GBIT_FEATURES, 541 541 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 542 542 .config_init = bcm54xx_config_init, 543 543 .config_aneg = genphy_config_aneg, ··· 547 549 .phy_id = PHY_ID_BCM5461, 548 550 .phy_id_mask = 0xfffffff0, 549 551 .name = "Broadcom BCM5461", 550 - .features = PHY_GBIT_FEATURES | 551 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, 552 + .features = PHY_GBIT_FEATURES, 552 553 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 553 554 .config_init = bcm54xx_config_init, 554 555 .config_aneg = genphy_config_aneg, ··· 558 561 .phy_id = PHY_ID_BCM54612E, 559 562 .phy_id_mask = 0xfffffff0, 560 563 .name = "Broadcom BCM54612E", 561 - .features = PHY_GBIT_FEATURES | 562 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, 564 + .features = PHY_GBIT_FEATURES, 563 565 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 564 566 .config_init = bcm54xx_config_init, 565 567 .config_aneg = bcm54612e_config_aneg, ··· 569 573 .phy_id = PHY_ID_BCM54616S, 570 574 .phy_id_mask = 0xfffffff0, 571 575 .name = "Broadcom BCM54616S", 572 - .features = PHY_GBIT_FEATURES | 573 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, 576 + .features = PHY_GBIT_FEATURES, 574 577 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 575 578 .config_init = bcm54xx_config_init, 576 579 .config_aneg = genphy_config_aneg, ··· 580 585 .phy_id = PHY_ID_BCM5464, 581 586 .phy_id_mask = 0xfffffff0, 582 587 .name = "Broadcom BCM5464", 583 - .features = PHY_GBIT_FEATURES | 584 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, 588 + .features = PHY_GBIT_FEATURES, 585 589 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 586 590 .config_init = bcm54xx_config_init, 587 591 .config_aneg = genphy_config_aneg, ··· 591 597 .phy_id = PHY_ID_BCM5481, 592 598 .phy_id_mask = 0xfffffff0, 593 599 .name = "Broadcom BCM5481", 594 - .features = PHY_GBIT_FEATURES | 595 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, 600 + .features = PHY_GBIT_FEATURES, 596 601 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 597 602 .config_init = bcm54xx_config_init, 598 603 .config_aneg = bcm5481_config_aneg, ··· 602 609 .phy_id = PHY_ID_BCM54810, 603 610 .phy_id_mask = 0xfffffff0, 604 611 .name = "Broadcom BCM54810", 605 - .features = PHY_GBIT_FEATURES | 606 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, 612 + .features = PHY_GBIT_FEATURES, 607 613 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 608 614 .config_init = bcm54xx_config_init, 609 615 .config_aneg = bcm5481_config_aneg, ··· 613 621 .phy_id = PHY_ID_BCM5482, 614 622 .phy_id_mask = 0xfffffff0, 615 623 .name = "Broadcom BCM5482", 616 - .features = PHY_GBIT_FEATURES | 617 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, 624 + .features = PHY_GBIT_FEATURES, 618 625 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 619 626 .config_init = bcm5482_config_init, 620 627 .config_aneg = genphy_config_aneg, ··· 624 633 .phy_id = PHY_ID_BCM50610, 625 634 .phy_id_mask = 0xfffffff0, 626 635 .name = "Broadcom BCM50610", 627 - .features = PHY_GBIT_FEATURES | 628 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, 636 + .features = PHY_GBIT_FEATURES, 629 637 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 630 638 .config_init = bcm54xx_config_init, 631 639 .config_aneg = genphy_config_aneg, ··· 635 645 .phy_id = PHY_ID_BCM50610M, 636 646 .phy_id_mask = 0xfffffff0, 637 647 .name = "Broadcom BCM50610M", 638 - .features = PHY_GBIT_FEATURES | 639 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, 648 + .features = PHY_GBIT_FEATURES, 640 649 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 641 650 .config_init = bcm54xx_config_init, 642 651 .config_aneg = genphy_config_aneg, ··· 646 657 .phy_id = PHY_ID_BCM57780, 647 658 .phy_id_mask = 0xfffffff0, 648 659 .name = "Broadcom BCM57780", 649 - .features = PHY_GBIT_FEATURES | 650 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, 660 + .features = PHY_GBIT_FEATURES, 651 661 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 652 662 .config_init = bcm54xx_config_init, 653 663 .config_aneg = genphy_config_aneg, ··· 657 669 .phy_id = PHY_ID_BCMAC131, 658 670 .phy_id_mask = 0xfffffff0, 659 671 .name = "Broadcom BCMAC131", 660 - .features = PHY_BASIC_FEATURES | 661 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, 672 + .features = PHY_BASIC_FEATURES, 662 673 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 663 674 .config_init = brcm_fet_config_init, 664 675 .config_aneg = genphy_config_aneg, ··· 668 681 .phy_id = PHY_ID_BCM5241, 669 682 .phy_id_mask = 0xfffffff0, 670 683 .name = "Broadcom BCM5241", 671 - .features = PHY_BASIC_FEATURES | 672 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, 684 + .features = PHY_BASIC_FEATURES, 673 685 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 674 686 .config_init = brcm_fet_config_init, 675 687 .config_aneg = genphy_config_aneg,
+1 -3
drivers/net/phy/dp83848.c
··· 88 88 .phy_id = _id, \ 89 89 .phy_id_mask = 0xfffffff0, \ 90 90 .name = _name, \ 91 - .features = (PHY_BASIC_FEATURES | \ 92 - SUPPORTED_Pause | \ 93 - SUPPORTED_Asym_Pause), \ 91 + .features = PHY_BASIC_FEATURES, \ 94 92 .flags = PHY_HAS_INTERRUPT, \ 95 93 \ 96 94 .soft_reset = genphy_soft_reset, \
+2 -4
drivers/net/phy/icplus.c
··· 225 225 .phy_id = 0x02430d90, 226 226 .name = "ICPlus IP1001", 227 227 .phy_id_mask = 0x0ffffff0, 228 - .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | 229 - SUPPORTED_Asym_Pause, 228 + .features = PHY_GBIT_FEATURES, 230 229 .config_init = &ip1001_config_init, 231 230 .config_aneg = &genphy_config_aneg, 232 231 .read_status = &genphy_read_status, ··· 235 236 .phy_id = 0x02430c54, 236 237 .name = "ICPlus IP101A/G", 237 238 .phy_id_mask = 0x0ffffff0, 238 - .features = PHY_BASIC_FEATURES | SUPPORTED_Pause | 239 - SUPPORTED_Asym_Pause, 239 + .features = PHY_BASIC_FEATURES, 240 240 .flags = PHY_HAS_INTERRUPT, 241 241 .ack_interrupt = ip101a_g_ack_interrupt, 242 242 .config_init = &ip101a_g_config_init,
+8 -16
drivers/net/phy/intel-xway.c
··· 239 239 .phy_id = PHY_ID_PHY11G_1_3, 240 240 .phy_id_mask = 0xffffffff, 241 241 .name = "Intel XWAY PHY11G (PEF 7071/PEF 7072) v1.3", 242 - .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause | 243 - SUPPORTED_Asym_Pause), 242 + .features = PHY_GBIT_FEATURES, 244 243 .flags = PHY_HAS_INTERRUPT, 245 244 .config_init = xway_gphy_config_init, 246 245 .config_aneg = xway_gphy14_config_aneg, ··· 253 254 .phy_id = PHY_ID_PHY22F_1_3, 254 255 .phy_id_mask = 0xffffffff, 255 256 .name = "Intel XWAY PHY22F (PEF 7061) v1.3", 256 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause | 257 - SUPPORTED_Asym_Pause), 257 + .features = PHY_BASIC_FEATURES, 258 258 .flags = PHY_HAS_INTERRUPT, 259 259 .config_init = xway_gphy_config_init, 260 260 .config_aneg = xway_gphy14_config_aneg, ··· 267 269 .phy_id = PHY_ID_PHY11G_1_4, 268 270 .phy_id_mask = 0xffffffff, 269 271 .name = "Intel XWAY PHY11G (PEF 7071/PEF 7072) v1.4", 270 - .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause | 271 - SUPPORTED_Asym_Pause), 272 + .features = PHY_GBIT_FEATURES, 272 273 .flags = PHY_HAS_INTERRUPT, 273 274 .config_init = xway_gphy_config_init, 274 275 .config_aneg = xway_gphy14_config_aneg, ··· 281 284 .phy_id = PHY_ID_PHY22F_1_4, 282 285 .phy_id_mask = 0xffffffff, 283 286 .name = "Intel XWAY PHY22F (PEF 7061) v1.4", 284 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause | 285 - SUPPORTED_Asym_Pause), 287 + .features = PHY_BASIC_FEATURES, 286 288 .flags = PHY_HAS_INTERRUPT, 287 289 .config_init = xway_gphy_config_init, 288 290 .config_aneg = xway_gphy14_config_aneg, ··· 295 299 .phy_id = PHY_ID_PHY11G_1_5, 296 300 .phy_id_mask = 0xffffffff, 297 301 .name = "Intel XWAY PHY11G (PEF 7071/PEF 7072) v1.5 / v1.6", 298 - .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause | 299 - SUPPORTED_Asym_Pause), 302 + .features = PHY_GBIT_FEATURES, 300 303 .flags = PHY_HAS_INTERRUPT, 301 304 .config_init = xway_gphy_config_init, 302 305 .config_aneg = genphy_config_aneg, ··· 309 314 .phy_id = PHY_ID_PHY22F_1_5, 310 315 .phy_id_mask = 0xffffffff, 311 316 .name = "Intel XWAY PHY22F (PEF 7061) v1.5 / v1.6", 312 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause | 313 - SUPPORTED_Asym_Pause), 317 + .features = PHY_BASIC_FEATURES, 314 318 .flags = PHY_HAS_INTERRUPT, 315 319 .config_init = xway_gphy_config_init, 316 320 .config_aneg = genphy_config_aneg, ··· 323 329 .phy_id = PHY_ID_PHY11G_VR9, 324 330 .phy_id_mask = 0xffffffff, 325 331 .name = "Intel XWAY PHY11G (xRX integrated)", 326 - .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause | 327 - SUPPORTED_Asym_Pause), 332 + .features = PHY_GBIT_FEATURES, 328 333 .flags = PHY_HAS_INTERRUPT, 329 334 .config_init = xway_gphy_config_init, 330 335 .config_aneg = genphy_config_aneg, ··· 337 344 .phy_id = PHY_ID_PHY22F_VR9, 338 345 .phy_id_mask = 0xffffffff, 339 346 .name = "Intel XWAY PHY22F (xRX integrated)", 340 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause | 341 - SUPPORTED_Asym_Pause), 347 + .features = PHY_BASIC_FEATURES, 342 348 .flags = PHY_HAS_INTERRUPT, 343 349 .config_init = xway_gphy_config_init, 344 350 .config_aneg = genphy_config_aneg,
+12 -18
drivers/net/phy/micrel.c
··· 790 790 .phy_id = PHY_ID_KS8737, 791 791 .phy_id_mask = MICREL_PHY_ID_MASK, 792 792 .name = "Micrel KS8737", 793 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause), 793 + .features = PHY_BASIC_FEATURES, 794 794 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 795 795 .driver_data = &ks8737_type, 796 796 .config_init = kszphy_config_init, ··· 807 807 .phy_id = PHY_ID_KSZ8021, 808 808 .phy_id_mask = 0x00ffffff, 809 809 .name = "Micrel KSZ8021 or KSZ8031", 810 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause | 811 - SUPPORTED_Asym_Pause), 810 + .features = PHY_BASIC_FEATURES, 812 811 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 813 812 .driver_data = &ksz8021_type, 814 813 .probe = kszphy_probe, ··· 825 826 .phy_id = PHY_ID_KSZ8031, 826 827 .phy_id_mask = 0x00ffffff, 827 828 .name = "Micrel KSZ8031", 828 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause | 829 - SUPPORTED_Asym_Pause), 829 + .features = PHY_BASIC_FEATURES, 830 830 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 831 831 .driver_data = &ksz8021_type, 832 832 .probe = kszphy_probe, ··· 843 845 .phy_id = PHY_ID_KSZ8041, 844 846 .phy_id_mask = MICREL_PHY_ID_MASK, 845 847 .name = "Micrel KSZ8041", 846 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause 847 - | SUPPORTED_Asym_Pause), 848 + .features = PHY_BASIC_FEATURES, 848 849 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 849 850 .driver_data = &ksz8041_type, 850 851 .probe = kszphy_probe, ··· 861 864 .phy_id = PHY_ID_KSZ8041RNLI, 862 865 .phy_id_mask = MICREL_PHY_ID_MASK, 863 866 .name = "Micrel KSZ8041RNLI", 864 - .features = PHY_BASIC_FEATURES | 865 - SUPPORTED_Pause | SUPPORTED_Asym_Pause, 867 + .features = PHY_BASIC_FEATURES, 866 868 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 867 869 .driver_data = &ksz8041_type, 868 870 .probe = kszphy_probe, ··· 879 883 .phy_id = PHY_ID_KSZ8051, 880 884 .phy_id_mask = MICREL_PHY_ID_MASK, 881 885 .name = "Micrel KSZ8051", 882 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause 883 - | SUPPORTED_Asym_Pause), 886 + .features = PHY_BASIC_FEATURES, 884 887 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 885 888 .driver_data = &ksz8051_type, 886 889 .probe = kszphy_probe, ··· 897 902 .phy_id = PHY_ID_KSZ8001, 898 903 .name = "Micrel KSZ8001 or KS8721", 899 904 .phy_id_mask = 0x00fffffc, 900 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause), 905 + .features = PHY_BASIC_FEATURES, 901 906 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 902 907 .driver_data = &ksz8041_type, 903 908 .probe = kszphy_probe, ··· 915 920 .phy_id = PHY_ID_KSZ8081, 916 921 .name = "Micrel KSZ8081 or KSZ8091", 917 922 .phy_id_mask = MICREL_PHY_ID_MASK, 918 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause), 923 + .features = PHY_BASIC_FEATURES, 919 924 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 920 925 .driver_data = &ksz8081_type, 921 926 .probe = kszphy_probe, ··· 933 938 .phy_id = PHY_ID_KSZ8061, 934 939 .name = "Micrel KSZ8061", 935 940 .phy_id_mask = MICREL_PHY_ID_MASK, 936 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause), 941 + .features = PHY_BASIC_FEATURES, 937 942 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 938 943 .config_init = kszphy_config_init, 939 944 .config_aneg = genphy_config_aneg, ··· 949 954 .phy_id = PHY_ID_KSZ9021, 950 955 .phy_id_mask = 0x000ffffe, 951 956 .name = "Micrel KSZ9021 Gigabit PHY", 952 - .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause), 957 + .features = PHY_GBIT_FEATURES, 953 958 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 954 959 .driver_data = &ksz9021_type, 955 960 .config_init = ksz9021_config_init, ··· 968 973 .phy_id = PHY_ID_KSZ9031, 969 974 .phy_id_mask = MICREL_PHY_ID_MASK, 970 975 .name = "Micrel KSZ9031 Gigabit PHY", 971 - .features = (PHY_GBIT_FEATURES | SUPPORTED_Pause), 976 + .features = PHY_GBIT_FEATURES, 972 977 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 973 978 .driver_data = &ksz9021_type, 974 979 .config_init = ksz9031_config_init, ··· 985 990 .phy_id = PHY_ID_KSZ8873MLL, 986 991 .phy_id_mask = MICREL_PHY_ID_MASK, 987 992 .name = "Micrel KSZ8873MLL Switch", 988 - .features = (SUPPORTED_Pause | SUPPORTED_Asym_Pause), 989 993 .flags = PHY_HAS_MAGICANEG, 990 994 .config_init = kszphy_config_init, 991 995 .config_aneg = ksz8873mll_config_aneg, ··· 998 1004 .phy_id = PHY_ID_KSZ886X, 999 1005 .phy_id_mask = MICREL_PHY_ID_MASK, 1000 1006 .name = "Micrel KSZ886X Switch", 1001 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause), 1007 + .features = PHY_BASIC_FEATURES, 1002 1008 .flags = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT, 1003 1009 .config_init = kszphy_config_init, 1004 1010 .config_aneg = genphy_config_aneg,
+1 -2
drivers/net/phy/microchip.c
··· 146 146 .phy_id_mask = 0xfffffff0, 147 147 .name = "Microchip LAN88xx", 148 148 149 - .features = (PHY_GBIT_FEATURES | 150 - SUPPORTED_Pause | SUPPORTED_Asym_Pause), 149 + .features = PHY_GBIT_FEATURES, 151 150 .flags = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG, 152 151 153 152 .probe = lan88xx_probe,
+1 -1
drivers/net/phy/national.c
··· 133 133 .phy_id = DP83865_PHY_ID, 134 134 .phy_id_mask = 0xfffffff0, 135 135 .name = "NatSemi DP83865", 136 - .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | SUPPORTED_Asym_Pause, 136 + .features = PHY_GBIT_FEATURES, 137 137 .flags = PHY_HAS_INTERRUPT, 138 138 .config_init = ns_config_init, 139 139 .config_aneg = genphy_config_aneg,
+19
drivers/net/phy/phy_device.c
··· 1719 1719 */ 1720 1720 of_set_phy_eee_broken(phydev); 1721 1721 1722 + /* The Pause Frame bits indicate that the PHY can support passing 1723 + * pause frames. During autonegotiation, the PHYs will determine if 1724 + * they should allow pause frames to pass. The MAC driver should then 1725 + * use that result to determine whether to enable flow control via 1726 + * pause frames. 1727 + * 1728 + * Normally, PHY drivers should not set the Pause bits, and instead 1729 + * allow phylib to do that. However, there may be some situations 1730 + * (e.g. hardware erratum) where the driver wants to set only one 1731 + * of these bits. 1732 + */ 1733 + if (phydrv->features & (SUPPORTED_Pause | SUPPORTED_Asym_Pause)) { 1734 + phydev->supported &= ~(SUPPORTED_Pause | SUPPORTED_Asym_Pause); 1735 + phydev->supported |= phydrv->features & 1736 + (SUPPORTED_Pause | SUPPORTED_Asym_Pause); 1737 + } else { 1738 + phydev->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause; 1739 + } 1740 + 1722 1741 /* Set the state to READY by default */ 1723 1742 phydev->state = PHY_READY; 1724 1743
+6 -12
drivers/net/phy/smsc.c
··· 168 168 .phy_id_mask = 0xfffffff0, 169 169 .name = "SMSC LAN83C185", 170 170 171 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause 172 - | SUPPORTED_Asym_Pause), 171 + .features = PHY_BASIC_FEATURES, 173 172 .flags = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG, 174 173 175 174 .probe = smsc_phy_probe, ··· 190 191 .phy_id_mask = 0xfffffff0, 191 192 .name = "SMSC LAN8187", 192 193 193 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause 194 - | SUPPORTED_Asym_Pause), 194 + .features = PHY_BASIC_FEATURES, 195 195 .flags = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG, 196 196 197 197 .probe = smsc_phy_probe, ··· 212 214 .phy_id_mask = 0xfffffff0, 213 215 .name = "SMSC LAN8700", 214 216 215 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause 216 - | SUPPORTED_Asym_Pause), 217 + .features = PHY_BASIC_FEATURES, 217 218 .flags = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG, 218 219 219 220 .probe = smsc_phy_probe, ··· 234 237 .phy_id_mask = 0xfffffff0, 235 238 .name = "SMSC LAN911x Internal PHY", 236 239 237 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause 238 - | SUPPORTED_Asym_Pause), 240 + .features = PHY_BASIC_FEATURES, 239 241 .flags = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG, 240 242 241 243 .probe = smsc_phy_probe, ··· 255 259 .phy_id_mask = 0xfffffff0, 256 260 .name = "SMSC LAN8710/LAN8720", 257 261 258 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause 259 - | SUPPORTED_Asym_Pause), 262 + .features = PHY_BASIC_FEATURES, 260 263 .flags = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG, 261 264 262 265 .probe = smsc_phy_probe, ··· 277 282 .phy_id_mask = 0xfffffff0, 278 283 .name = "SMSC LAN8740", 279 284 280 - .features = (PHY_BASIC_FEATURES | SUPPORTED_Pause 281 - | SUPPORTED_Asym_Pause), 285 + .features = PHY_BASIC_FEATURES, 282 286 .flags = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG, 283 287 284 288 .probe = smsc_phy_probe,