aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/bcm7xxx.c
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2014-08-26 16:15:24 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-28 02:16:12 -0400
commit153df3c7d7af6772a99fe5589d26a6677ffd66db (patch)
treeaf5d031fb4292c02ed7bac4021f8fecd2bc64fe3 /drivers/net/phy/bcm7xxx.c
parent0ce4866f1e4697d45011bd1a01f33036660abffc (diff)
net: phy: bcm7xxx: introduce helper macro
All 28nm Gigabit PHYs supported by the driver have the same callbacks, the only differences being the 32-bits OUI and the name. Use a macro to factor this, making it easier in the future to add new entries. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/bcm7xxx.c')
-rw-r--r--drivers/net/phy/bcm7xxx.c54
1 files changed, 18 insertions, 36 deletions
diff --git a/drivers/net/phy/bcm7xxx.c b/drivers/net/phy/bcm7xxx.c
index e98c510b75c5..948c7086679a 100644
--- a/drivers/net/phy/bcm7xxx.c
+++ b/drivers/net/phy/bcm7xxx.c
@@ -319,44 +319,26 @@ static int bcm7xxx_dummy_config_init(struct phy_device *phydev)
319 return 0; 319 return 0;
320} 320}
321 321
322#define BCM7XXX_28NM_GPHY(_oui, _name) \
323{ \
324 .phy_id = (_oui), \
325 .phy_id_mask = 0xfffffff0, \
326 .name = _name, \
327 .features = PHY_GBIT_FEATURES | \
328 SUPPORTED_Pause | SUPPORTED_Asym_Pause, \
329 .flags = PHY_IS_INTERNAL, \
330 .config_init = bcm7xxx_28nm_afe_config_init, \
331 .config_aneg = genphy_config_aneg, \
332 .read_status = genphy_read_status, \
333 .resume = bcm7xxx_28nm_resume, \
334 .driver = { .owner = THIS_MODULE }, \
335}
336
322static struct phy_driver bcm7xxx_driver[] = { 337static struct phy_driver bcm7xxx_driver[] = {
338 BCM7XXX_28NM_GPHY(PHY_ID_BCM7366, "Broadcom BCM7366"),
339 BCM7XXX_28NM_GPHY(PHY_ID_BCM7439, "Broadcom BCM7439"),
340 BCM7XXX_28NM_GPHY(PHY_ID_BCM7445, "Broadcom BCM7445"),
323{ 341{
324 .phy_id = PHY_ID_BCM7366,
325 .phy_id_mask = 0xfffffff0,
326 .name = "Broadcom BCM7366",
327 .features = PHY_GBIT_FEATURES |
328 SUPPORTED_Pause | SUPPORTED_Asym_Pause,
329 .flags = PHY_IS_INTERNAL,
330 .config_init = bcm7xxx_28nm_afe_config_init,
331 .config_aneg = genphy_config_aneg,
332 .read_status = genphy_read_status,
333 .resume = bcm7xxx_28nm_resume,
334 .driver = { .owner = THIS_MODULE },
335}, {
336 .phy_id = PHY_ID_BCM7439,
337 .phy_id_mask = 0xfffffff0,
338 .name = "Broadcom BCM7439",
339 .features = PHY_GBIT_FEATURES |
340 SUPPORTED_Pause | SUPPORTED_Asym_Pause,
341 .flags = PHY_IS_INTERNAL,
342 .config_init = bcm7xxx_28nm_afe_config_init,
343 .config_aneg = genphy_config_aneg,
344 .read_status = genphy_read_status,
345 .resume = bcm7xxx_28nm_resume,
346 .driver = { .owner = THIS_MODULE },
347}, {
348 .phy_id = PHY_ID_BCM7445,
349 .phy_id_mask = 0xfffffff0,
350 .name = "Broadcom BCM7445",
351 .features = PHY_GBIT_FEATURES |
352 SUPPORTED_Pause | SUPPORTED_Asym_Pause,
353 .flags = PHY_IS_INTERNAL,
354 .config_init = bcm7xxx_28nm_config_init,
355 .config_aneg = genphy_config_aneg,
356 .read_status = genphy_read_status,
357 .resume = bcm7xxx_28nm_afe_config_init,
358 .driver = { .owner = THIS_MODULE },
359}, {
360 .phy_id = PHY_BCM_OUI_4, 342 .phy_id = PHY_BCM_OUI_4,
361 .phy_id_mask = 0xffff0000, 343 .phy_id_mask = 0xffff0000,
362 .name = "Broadcom BCM7XXX 40nm", 344 .name = "Broadcom BCM7XXX 40nm",