Skip to content

Commit dcdecdc

Browse files
hkallweitdavem330
authored andcommitted
net: phy: switch drivers to use dynamic feature detection
Recently genphy_read_abilities() has been added that dynamically detects clause 22 PHY abilities. I *think* this detection should work with all supported PHY's, at least for the ones with basic features sets, i.e. PHY_BASIC_FEATURES and PHY_GBIT_FEATURES. So let's remove setting these features explicitly and rely on phylib feature detection. I don't have access to most of these PHY's, therefore I'd appreciate regression testing. v2: - make the feature constant a comment so that readers know which features are supported by the respective PHY Signed-off-by: Heiner Kallweit <[email protected]> Tested-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b6ed55c commit dcdecdc

30 files changed

+120
-120
lines changed

drivers/net/phy/amd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static struct phy_driver am79c_driver[] = { {
6060
.phy_id = PHY_ID_AM79C874,
6161
.name = "AM79C874",
6262
.phy_id_mask = 0xfffffff0,
63-
.features = PHY_BASIC_FEATURES,
63+
/* PHY_BASIC_FEATURES */
6464
.config_init = am79c_config_init,
6565
.ack_interrupt = am79c_ack_interrupt,
6666
.config_intr = am79c_config_intr,

drivers/net/phy/asix.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static struct phy_driver asix_driver[] = { {
4343
.phy_id = PHY_ID_ASIX_AX88796B,
4444
.name = "Asix Electronics AX88796B",
4545
.phy_id_mask = 0xfffffff0,
46-
.features = PHY_BASIC_FEATURES,
46+
/* PHY_BASIC_FEATURES */
4747
.soft_reset = asix_soft_reset,
4848
} };
4949

drivers/net/phy/at803x.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ static struct phy_driver at803x_driver[] = {
389389
.get_wol = at803x_get_wol,
390390
.suspend = at803x_suspend,
391391
.resume = at803x_resume,
392-
.features = PHY_GBIT_FEATURES,
392+
/* PHY_GBIT_FEATURES */
393393
.ack_interrupt = at803x_ack_interrupt,
394394
.config_intr = at803x_config_intr,
395395
}, {
@@ -404,7 +404,7 @@ static struct phy_driver at803x_driver[] = {
404404
.get_wol = at803x_get_wol,
405405
.suspend = at803x_suspend,
406406
.resume = at803x_resume,
407-
.features = PHY_BASIC_FEATURES,
407+
/* PHY_BASIC_FEATURES */
408408
.ack_interrupt = at803x_ack_interrupt,
409409
.config_intr = at803x_config_intr,
410410
}, {
@@ -418,7 +418,7 @@ static struct phy_driver at803x_driver[] = {
418418
.get_wol = at803x_get_wol,
419419
.suspend = at803x_suspend,
420420
.resume = at803x_resume,
421-
.features = PHY_GBIT_FEATURES,
421+
/* PHY_GBIT_FEATURES */
422422
.aneg_done = at803x_aneg_done,
423423
.ack_interrupt = &at803x_ack_interrupt,
424424
.config_intr = &at803x_config_intr,

drivers/net/phy/bcm-cygnus.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static struct phy_driver bcm_cygnus_phy_driver[] = {
254254
.phy_id = PHY_ID_BCM_CYGNUS,
255255
.phy_id_mask = 0xfffffff0,
256256
.name = "Broadcom Cygnus PHY",
257-
.features = PHY_GBIT_FEATURES,
257+
/* PHY_GBIT_FEATURES */
258258
.config_init = bcm_cygnus_config_init,
259259
.ack_interrupt = bcm_phy_ack_intr,
260260
.config_intr = bcm_phy_config_intr,
@@ -264,7 +264,7 @@ static struct phy_driver bcm_cygnus_phy_driver[] = {
264264
.phy_id = PHY_ID_BCM_OMEGA,
265265
.phy_id_mask = 0xfffffff0,
266266
.name = "Broadcom Omega Combo GPHY",
267-
.features = PHY_GBIT_FEATURES,
267+
/* PHY_GBIT_FEATURES */
268268
.flags = PHY_IS_INTERNAL,
269269
.config_init = bcm_omega_config_init,
270270
.suspend = genphy_suspend,

drivers/net/phy/bcm63xx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ static struct phy_driver bcm63xx_driver[] = {
6464
.phy_id = 0x00406000,
6565
.phy_id_mask = 0xfffffc00,
6666
.name = "Broadcom BCM63XX (1)",
67-
.features = PHY_BASIC_FEATURES,
67+
/* PHY_BASIC_FEATURES */
6868
.flags = PHY_IS_INTERNAL,
6969
.config_init = bcm63xx_config_init,
7070
.ack_interrupt = bcm_phy_ack_intr,
@@ -73,7 +73,7 @@ static struct phy_driver bcm63xx_driver[] = {
7373
/* same phy as above, with just a different OUI */
7474
.phy_id = 0x002bdc00,
7575
.phy_id_mask = 0xfffffc00,
76-
.features = PHY_BASIC_FEATURES,
76+
/* PHY_BASIC_FEATURES */
7777
.flags = PHY_IS_INTERNAL,
7878
.config_init = bcm63xx_config_init,
7979
.ack_interrupt = bcm_phy_ack_intr,

drivers/net/phy/bcm7xxx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ static int bcm7xxx_28nm_probe(struct phy_device *phydev)
538538
.phy_id = (_oui), \
539539
.phy_id_mask = 0xfffffff0, \
540540
.name = _name, \
541-
.features = PHY_GBIT_FEATURES, \
541+
/* PHY_GBIT_FEATURES */ \
542542
.flags = PHY_IS_INTERNAL, \
543543
.config_init = bcm7xxx_28nm_config_init, \
544544
.resume = bcm7xxx_28nm_resume, \
@@ -555,7 +555,7 @@ static int bcm7xxx_28nm_probe(struct phy_device *phydev)
555555
.phy_id = (_oui), \
556556
.phy_id_mask = 0xfffffff0, \
557557
.name = _name, \
558-
.features = PHY_BASIC_FEATURES, \
558+
/* PHY_BASIC_FEATURES */ \
559559
.flags = PHY_IS_INTERNAL, \
560560
.config_init = bcm7xxx_28nm_ephy_config_init, \
561561
.resume = bcm7xxx_28nm_ephy_resume, \
@@ -570,7 +570,7 @@ static int bcm7xxx_28nm_probe(struct phy_device *phydev)
570570
.phy_id = (_oui), \
571571
.phy_id_mask = 0xfffffff0, \
572572
.name = _name, \
573-
.features = PHY_BASIC_FEATURES, \
573+
/* PHY_BASIC_FEATURES */ \
574574
.flags = PHY_IS_INTERNAL, \
575575
.config_init = bcm7xxx_config_init, \
576576
.suspend = bcm7xxx_suspend, \

drivers/net/phy/broadcom.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -610,47 +610,47 @@ static struct phy_driver broadcom_drivers[] = {
610610
.phy_id = PHY_ID_BCM5411,
611611
.phy_id_mask = 0xfffffff0,
612612
.name = "Broadcom BCM5411",
613-
.features = PHY_GBIT_FEATURES,
613+
/* PHY_GBIT_FEATURES */
614614
.config_init = bcm54xx_config_init,
615615
.ack_interrupt = bcm_phy_ack_intr,
616616
.config_intr = bcm_phy_config_intr,
617617
}, {
618618
.phy_id = PHY_ID_BCM5421,
619619
.phy_id_mask = 0xfffffff0,
620620
.name = "Broadcom BCM5421",
621-
.features = PHY_GBIT_FEATURES,
621+
/* PHY_GBIT_FEATURES */
622622
.config_init = bcm54xx_config_init,
623623
.ack_interrupt = bcm_phy_ack_intr,
624624
.config_intr = bcm_phy_config_intr,
625625
}, {
626626
.phy_id = PHY_ID_BCM54210E,
627627
.phy_id_mask = 0xfffffff0,
628628
.name = "Broadcom BCM54210E",
629-
.features = PHY_GBIT_FEATURES,
629+
/* PHY_GBIT_FEATURES */
630630
.config_init = bcm54xx_config_init,
631631
.ack_interrupt = bcm_phy_ack_intr,
632632
.config_intr = bcm_phy_config_intr,
633633
}, {
634634
.phy_id = PHY_ID_BCM5461,
635635
.phy_id_mask = 0xfffffff0,
636636
.name = "Broadcom BCM5461",
637-
.features = PHY_GBIT_FEATURES,
637+
/* PHY_GBIT_FEATURES */
638638
.config_init = bcm54xx_config_init,
639639
.ack_interrupt = bcm_phy_ack_intr,
640640
.config_intr = bcm_phy_config_intr,
641641
}, {
642642
.phy_id = PHY_ID_BCM54612E,
643643
.phy_id_mask = 0xfffffff0,
644644
.name = "Broadcom BCM54612E",
645-
.features = PHY_GBIT_FEATURES,
645+
/* PHY_GBIT_FEATURES */
646646
.config_init = bcm54xx_config_init,
647647
.ack_interrupt = bcm_phy_ack_intr,
648648
.config_intr = bcm_phy_config_intr,
649649
}, {
650650
.phy_id = PHY_ID_BCM54616S,
651651
.phy_id_mask = 0xfffffff0,
652652
.name = "Broadcom BCM54616S",
653-
.features = PHY_GBIT_FEATURES,
653+
/* PHY_GBIT_FEATURES */
654654
.config_init = bcm54xx_config_init,
655655
.config_aneg = bcm54616s_config_aneg,
656656
.ack_interrupt = bcm_phy_ack_intr,
@@ -659,15 +659,15 @@ static struct phy_driver broadcom_drivers[] = {
659659
.phy_id = PHY_ID_BCM5464,
660660
.phy_id_mask = 0xfffffff0,
661661
.name = "Broadcom BCM5464",
662-
.features = PHY_GBIT_FEATURES,
662+
/* PHY_GBIT_FEATURES */
663663
.config_init = bcm54xx_config_init,
664664
.ack_interrupt = bcm_phy_ack_intr,
665665
.config_intr = bcm_phy_config_intr,
666666
}, {
667667
.phy_id = PHY_ID_BCM5481,
668668
.phy_id_mask = 0xfffffff0,
669669
.name = "Broadcom BCM5481",
670-
.features = PHY_GBIT_FEATURES,
670+
/* PHY_GBIT_FEATURES */
671671
.config_init = bcm54xx_config_init,
672672
.config_aneg = bcm5481_config_aneg,
673673
.ack_interrupt = bcm_phy_ack_intr,
@@ -676,7 +676,7 @@ static struct phy_driver broadcom_drivers[] = {
676676
.phy_id = PHY_ID_BCM54810,
677677
.phy_id_mask = 0xfffffff0,
678678
.name = "Broadcom BCM54810",
679-
.features = PHY_GBIT_FEATURES,
679+
/* PHY_GBIT_FEATURES */
680680
.config_init = bcm54xx_config_init,
681681
.config_aneg = bcm5481_config_aneg,
682682
.ack_interrupt = bcm_phy_ack_intr,
@@ -685,7 +685,7 @@ static struct phy_driver broadcom_drivers[] = {
685685
.phy_id = PHY_ID_BCM5482,
686686
.phy_id_mask = 0xfffffff0,
687687
.name = "Broadcom BCM5482",
688-
.features = PHY_GBIT_FEATURES,
688+
/* PHY_GBIT_FEATURES */
689689
.config_init = bcm5482_config_init,
690690
.read_status = bcm5482_read_status,
691691
.ack_interrupt = bcm_phy_ack_intr,
@@ -694,39 +694,39 @@ static struct phy_driver broadcom_drivers[] = {
694694
.phy_id = PHY_ID_BCM50610,
695695
.phy_id_mask = 0xfffffff0,
696696
.name = "Broadcom BCM50610",
697-
.features = PHY_GBIT_FEATURES,
697+
/* PHY_GBIT_FEATURES */
698698
.config_init = bcm54xx_config_init,
699699
.ack_interrupt = bcm_phy_ack_intr,
700700
.config_intr = bcm_phy_config_intr,
701701
}, {
702702
.phy_id = PHY_ID_BCM50610M,
703703
.phy_id_mask = 0xfffffff0,
704704
.name = "Broadcom BCM50610M",
705-
.features = PHY_GBIT_FEATURES,
705+
/* PHY_GBIT_FEATURES */
706706
.config_init = bcm54xx_config_init,
707707
.ack_interrupt = bcm_phy_ack_intr,
708708
.config_intr = bcm_phy_config_intr,
709709
}, {
710710
.phy_id = PHY_ID_BCM57780,
711711
.phy_id_mask = 0xfffffff0,
712712
.name = "Broadcom BCM57780",
713-
.features = PHY_GBIT_FEATURES,
713+
/* PHY_GBIT_FEATURES */
714714
.config_init = bcm54xx_config_init,
715715
.ack_interrupt = bcm_phy_ack_intr,
716716
.config_intr = bcm_phy_config_intr,
717717
}, {
718718
.phy_id = PHY_ID_BCMAC131,
719719
.phy_id_mask = 0xfffffff0,
720720
.name = "Broadcom BCMAC131",
721-
.features = PHY_BASIC_FEATURES,
721+
/* PHY_BASIC_FEATURES */
722722
.config_init = brcm_fet_config_init,
723723
.ack_interrupt = brcm_fet_ack_interrupt,
724724
.config_intr = brcm_fet_config_intr,
725725
}, {
726726
.phy_id = PHY_ID_BCM5241,
727727
.phy_id_mask = 0xfffffff0,
728728
.name = "Broadcom BCM5241",
729-
.features = PHY_BASIC_FEATURES,
729+
/* PHY_BASIC_FEATURES */
730730
.config_init = brcm_fet_config_init,
731731
.ack_interrupt = brcm_fet_ack_interrupt,
732732
.config_intr = brcm_fet_config_intr,
@@ -735,7 +735,7 @@ static struct phy_driver broadcom_drivers[] = {
735735
.phy_id_mask = 0xfffffff0,
736736
.name = "Broadcom BCM5395",
737737
.flags = PHY_IS_INTERNAL,
738-
.features = PHY_GBIT_FEATURES,
738+
/* PHY_GBIT_FEATURES */
739739
.get_sset_count = bcm_phy_get_sset_count,
740740
.get_strings = bcm_phy_get_strings,
741741
.get_stats = bcm53xx_phy_get_stats,
@@ -744,7 +744,7 @@ static struct phy_driver broadcom_drivers[] = {
744744
.phy_id = PHY_ID_BCM89610,
745745
.phy_id_mask = 0xfffffff0,
746746
.name = "Broadcom BCM89610",
747-
.features = PHY_GBIT_FEATURES,
747+
/* PHY_GBIT_FEATURES */
748748
.config_init = bcm54xx_config_init,
749749
.ack_interrupt = bcm_phy_ack_intr,
750750
.config_intr = bcm_phy_config_intr,

drivers/net/phy/cicada.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,15 @@ static struct phy_driver cis820x_driver[] = {
102102
.phy_id = 0x000fc410,
103103
.name = "Cicada Cis8201",
104104
.phy_id_mask = 0x000ffff0,
105-
.features = PHY_GBIT_FEATURES,
105+
/* PHY_GBIT_FEATURES */
106106
.config_init = &cis820x_config_init,
107107
.ack_interrupt = &cis820x_ack_interrupt,
108108
.config_intr = &cis820x_config_intr,
109109
}, {
110110
.phy_id = 0x000fc440,
111111
.name = "Cicada Cis8204",
112112
.phy_id_mask = 0x000fffc0,
113-
.features = PHY_GBIT_FEATURES,
113+
/* PHY_GBIT_FEATURES */
114114
.config_init = &cis820x_config_init,
115115
.ack_interrupt = &cis820x_ack_interrupt,
116116
.config_intr = &cis820x_config_intr,

drivers/net/phy/davicom.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static struct phy_driver dm91xx_driver[] = {
144144
.phy_id = 0x0181b880,
145145
.name = "Davicom DM9161E",
146146
.phy_id_mask = 0x0ffffff0,
147-
.features = PHY_BASIC_FEATURES,
147+
/* PHY_BASIC_FEATURES */
148148
.config_init = dm9161_config_init,
149149
.config_aneg = dm9161_config_aneg,
150150
.ack_interrupt = dm9161_ack_interrupt,
@@ -153,7 +153,7 @@ static struct phy_driver dm91xx_driver[] = {
153153
.phy_id = 0x0181b8b0,
154154
.name = "Davicom DM9161B/C",
155155
.phy_id_mask = 0x0ffffff0,
156-
.features = PHY_BASIC_FEATURES,
156+
/* PHY_BASIC_FEATURES */
157157
.config_init = dm9161_config_init,
158158
.config_aneg = dm9161_config_aneg,
159159
.ack_interrupt = dm9161_ack_interrupt,
@@ -162,7 +162,7 @@ static struct phy_driver dm91xx_driver[] = {
162162
.phy_id = 0x0181b8a0,
163163
.name = "Davicom DM9161A",
164164
.phy_id_mask = 0x0ffffff0,
165-
.features = PHY_BASIC_FEATURES,
165+
/* PHY_BASIC_FEATURES */
166166
.config_init = dm9161_config_init,
167167
.config_aneg = dm9161_config_aneg,
168168
.ack_interrupt = dm9161_ack_interrupt,
@@ -171,7 +171,7 @@ static struct phy_driver dm91xx_driver[] = {
171171
.phy_id = 0x00181b80,
172172
.name = "Davicom DM9131",
173173
.phy_id_mask = 0x0ffffff0,
174-
.features = PHY_BASIC_FEATURES,
174+
/* PHY_BASIC_FEATURES */
175175
.ack_interrupt = dm9161_ack_interrupt,
176176
.config_intr = dm9161_config_intr,
177177
} };

drivers/net/phy/dp83640.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,7 @@ static struct phy_driver dp83640_driver = {
15141514
.phy_id = DP83640_PHY_ID,
15151515
.phy_id_mask = 0xfffffff0,
15161516
.name = "NatSemi DP83640",
1517-
.features = PHY_BASIC_FEATURES,
1517+
/* PHY_BASIC_FEATURES */
15181518
.probe = dp83640_probe,
15191519
.remove = dp83640_remove,
15201520
.soft_reset = dp83640_soft_reset,

drivers/net/phy/dp83822.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ static int dp83822_resume(struct phy_device *phydev)
310310
{ \
311311
PHY_ID_MATCH_MODEL(_id), \
312312
.name = (_name), \
313-
.features = PHY_BASIC_FEATURES, \
313+
/* PHY_BASIC_FEATURES */ \
314314
.soft_reset = dp83822_phy_reset, \
315315
.config_init = dp83822_config_init, \
316316
.get_wol = dp83822_get_wol, \

drivers/net/phy/dp83848.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ MODULE_DEVICE_TABLE(mdio, dp83848_tbl);
9999
.phy_id = _id, \
100100
.phy_id_mask = 0xfffffff0, \
101101
.name = _name, \
102-
.features = PHY_BASIC_FEATURES, \
102+
/* PHY_BASIC_FEATURES */ \
103103
\
104104
.soft_reset = genphy_soft_reset, \
105105
.config_init = _config_init, \

drivers/net/phy/dp83867.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ static struct phy_driver dp83867_driver[] = {
315315
.phy_id = DP83867_PHY_ID,
316316
.phy_id_mask = 0xfffffff0,
317317
.name = "TI DP83867",
318-
.features = PHY_GBIT_FEATURES,
318+
/* PHY_GBIT_FEATURES */
319319

320320
.config_init = dp83867_config_init,
321321
.soft_reset = dp83867_phy_reset,

drivers/net/phy/dp83tc811.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ static struct phy_driver dp83811_driver[] = {
338338
.phy_id = DP83TC811_PHY_ID,
339339
.phy_id_mask = 0xfffffff0,
340340
.name = "TI DP83TC811",
341-
.features = PHY_BASIC_FEATURES,
341+
/* PHY_BASIC_FEATURES */
342342
.config_init = dp83811_config_init,
343343
.config_aneg = dp83811_config_aneg,
344344
.soft_reset = dp83811_phy_reset,

drivers/net/phy/et1011c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static struct phy_driver et1011c_driver[] = { {
8686
.phy_id = 0x0282f014,
8787
.name = "ET1011C",
8888
.phy_id_mask = 0xfffffff0,
89-
.features = PHY_GBIT_FEATURES,
89+
/* PHY_GBIT_FEATURES */
9090
.config_aneg = et1011c_config_aneg,
9191
.read_status = et1011c_read_status,
9292
} };

drivers/net/phy/icplus.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static struct phy_driver icplus_driver[] = {
311311
.phy_id = 0x02430d80,
312312
.name = "ICPlus IP175C",
313313
.phy_id_mask = 0x0ffffff0,
314-
.features = PHY_BASIC_FEATURES,
314+
/* PHY_BASIC_FEATURES */
315315
.config_init = &ip175c_config_init,
316316
.config_aneg = &ip175c_config_aneg,
317317
.read_status = &ip175c_read_status,
@@ -321,15 +321,15 @@ static struct phy_driver icplus_driver[] = {
321321
.phy_id = 0x02430d90,
322322
.name = "ICPlus IP1001",
323323
.phy_id_mask = 0x0ffffff0,
324-
.features = PHY_GBIT_FEATURES,
324+
/* PHY_GBIT_FEATURES */
325325
.config_init = &ip1001_config_init,
326326
.suspend = genphy_suspend,
327327
.resume = genphy_resume,
328328
}, {
329329
.phy_id = 0x02430c54,
330330
.name = "ICPlus IP101A/G",
331331
.phy_id_mask = 0x0ffffff0,
332-
.features = PHY_BASIC_FEATURES,
332+
/* PHY_BASIC_FEATURES */
333333
.probe = ip101a_g_probe,
334334
.config_intr = ip101a_g_config_intr,
335335
.did_interrupt = ip101a_g_did_interrupt,

0 commit comments

Comments
 (0)