aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/bcm_sf2.h
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2015-10-23 15:11:08 -0400
committerDavid S. Miller <davem@davemloft.net>2015-10-26 21:23:59 -0400
commit8b7c94e3478dbb0296293b43a974c3561d01e9fb (patch)
tree7d3c6de2409ac496165853b236a9ba6b757a6b68 /drivers/net/dsa/bcm_sf2.h
parent680060d3e02d175516832e9af058ffe96ecc4cdc (diff)
net: dsa: bcm_sf2: Unhardcode port numbers
While the current driver mostly supports BCM7445 which has a hardcoded location for its MoCA port on port 7 and port 0 for its internal PHY, this is not necessarily true for all other chips out there such as BCM3390 for instance. Walk the list of ports from Device Tree, get their port number ("reg" property), and then parse the "phy-mode" property and initialize two internal variables: moca_port and a bitmask of internal PHYs. Since we use interrupts for the MoCA port, we introduce two helper functions to enable/disable interrupts and do this at the appropriate bank (INTRL2_0 or INTRL2_1). Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/bcm_sf2.h')
-rw-r--r--drivers/net/dsa/bcm_sf2.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/dsa/bcm_sf2.h b/drivers/net/dsa/bcm_sf2.h
index cc98abc0aaf3..6bba1c98d764 100644
--- a/drivers/net/dsa/bcm_sf2.h
+++ b/drivers/net/dsa/bcm_sf2.h
@@ -134,6 +134,12 @@ struct bcm_sf2_priv {
134 134
135 /* Mask of ports enabled for Wake-on-LAN */ 135 /* Mask of ports enabled for Wake-on-LAN */
136 u32 wol_ports_mask; 136 u32 wol_ports_mask;
137
138 /* MoCA port location */
139 int moca_port;
140
141 /* Bitmask of ports having an integrated PHY */
142 unsigned int int_phy_mask;
137}; 143};
138 144
139struct bcm_sf2_hw_stats { 145struct bcm_sf2_hw_stats {