Commit 0c2d3ff8 authored by David S. Miller's avatar David S. Miller

Merge branch 'dsa-validate-remove'

Russell King says:

====================
net: dsa: remove validate method

These three patches remove DSA's phylink .validate method which becomes
unnecessary once the last two drivers provide phylink capabilities,
which this patch set adds. Both of these are best guesses.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 9bae5b05 63b9f7a1
...@@ -277,6 +277,14 @@ static int dsa_loop_port_max_mtu(struct dsa_switch *ds, int port) ...@@ -277,6 +277,14 @@ static int dsa_loop_port_max_mtu(struct dsa_switch *ds, int port)
return ETH_MAX_MTU; return ETH_MAX_MTU;
} }
static void dsa_loop_phylink_get_caps(struct dsa_switch *dsa, int port,
struct phylink_config *config)
{
bitmap_fill(config->supported_interfaces, PHY_INTERFACE_MODE_MAX);
__clear_bit(PHY_INTERFACE_MODE_NA, config->supported_interfaces);
config->mac_capabilities = ~0;
}
static const struct dsa_switch_ops dsa_loop_driver = { static const struct dsa_switch_ops dsa_loop_driver = {
.get_tag_protocol = dsa_loop_get_protocol, .get_tag_protocol = dsa_loop_get_protocol,
.setup = dsa_loop_setup, .setup = dsa_loop_setup,
...@@ -295,6 +303,7 @@ static const struct dsa_switch_ops dsa_loop_driver = { ...@@ -295,6 +303,7 @@ static const struct dsa_switch_ops dsa_loop_driver = {
.port_vlan_del = dsa_loop_port_vlan_del, .port_vlan_del = dsa_loop_port_vlan_del,
.port_change_mtu = dsa_loop_port_change_mtu, .port_change_mtu = dsa_loop_port_change_mtu,
.port_max_mtu = dsa_loop_port_max_mtu, .port_max_mtu = dsa_loop_port_max_mtu,
.phylink_get_caps = dsa_loop_phylink_get_caps,
}; };
static int dsa_loop_drv_probe(struct mdio_device *mdiodev) static int dsa_loop_drv_probe(struct mdio_device *mdiodev)
......
...@@ -1037,6 +1037,31 @@ static int vsc73xx_get_max_mtu(struct dsa_switch *ds, int port) ...@@ -1037,6 +1037,31 @@ static int vsc73xx_get_max_mtu(struct dsa_switch *ds, int port)
return 9600 - ETH_HLEN - ETH_FCS_LEN; return 9600 - ETH_HLEN - ETH_FCS_LEN;
} }
static void vsc73xx_phylink_get_caps(struct dsa_switch *dsa, int port,
struct phylink_config *config)
{
unsigned long *interfaces = config->supported_interfaces;
if (port == 5)
return;
if (port == CPU_PORT) {
__set_bit(PHY_INTERFACE_MODE_MII, interfaces);
__set_bit(PHY_INTERFACE_MODE_REVMII, interfaces);
__set_bit(PHY_INTERFACE_MODE_GMII, interfaces);
__set_bit(PHY_INTERFACE_MODE_RGMII, interfaces);
}
if (port <= 4) {
/* Internal PHYs */
__set_bit(PHY_INTERFACE_MODE_INTERNAL, interfaces);
/* phylib default */
__set_bit(PHY_INTERFACE_MODE_GMII, interfaces);
}
config->mac_capabilities = MAC_SYM_PAUSE | MAC_10 | MAC_100 | MAC_1000;
}
static const struct dsa_switch_ops vsc73xx_ds_ops = { static const struct dsa_switch_ops vsc73xx_ds_ops = {
.get_tag_protocol = vsc73xx_get_tag_protocol, .get_tag_protocol = vsc73xx_get_tag_protocol,
.setup = vsc73xx_setup, .setup = vsc73xx_setup,
...@@ -1050,6 +1075,7 @@ static const struct dsa_switch_ops vsc73xx_ds_ops = { ...@@ -1050,6 +1075,7 @@ static const struct dsa_switch_ops vsc73xx_ds_ops = {
.port_disable = vsc73xx_port_disable, .port_disable = vsc73xx_port_disable,
.port_change_mtu = vsc73xx_change_mtu, .port_change_mtu = vsc73xx_change_mtu,
.port_max_mtu = vsc73xx_get_max_mtu, .port_max_mtu = vsc73xx_get_max_mtu,
.phylink_get_caps = vsc73xx_phylink_get_caps,
}; };
static int vsc73xx_gpio_get(struct gpio_chip *chip, unsigned int offset) static int vsc73xx_gpio_get(struct gpio_chip *chip, unsigned int offset)
......
...@@ -1554,20 +1554,6 @@ static struct phy_device *dsa_port_get_phy_device(struct dsa_port *dp) ...@@ -1554,20 +1554,6 @@ static struct phy_device *dsa_port_get_phy_device(struct dsa_port *dp)
return phydev; return phydev;
} }
static void dsa_port_phylink_validate(struct phylink_config *config,
unsigned long *supported,
struct phylink_link_state *state)
{
/* Skip call for drivers which don't yet set mac_capabilities,
* since validating in that case would mean their PHY will advertise
* nothing. In turn, skipping validation makes them advertise
* everything that the PHY supports, so those drivers should be
* converted ASAP.
*/
if (config->mac_capabilities)
phylink_generic_validate(config, supported, state);
}
static struct phylink_pcs * static struct phylink_pcs *
dsa_port_phylink_mac_select_pcs(struct phylink_config *config, dsa_port_phylink_mac_select_pcs(struct phylink_config *config,
phy_interface_t interface) phy_interface_t interface)
...@@ -1666,7 +1652,6 @@ static void dsa_port_phylink_mac_link_up(struct phylink_config *config, ...@@ -1666,7 +1652,6 @@ static void dsa_port_phylink_mac_link_up(struct phylink_config *config,
} }
static const struct phylink_mac_ops dsa_port_phylink_mac_ops = { static const struct phylink_mac_ops dsa_port_phylink_mac_ops = {
.validate = dsa_port_phylink_validate,
.mac_select_pcs = dsa_port_phylink_mac_select_pcs, .mac_select_pcs = dsa_port_phylink_mac_select_pcs,
.mac_prepare = dsa_port_phylink_mac_prepare, .mac_prepare = dsa_port_phylink_mac_prepare,
.mac_config = dsa_port_phylink_mac_config, .mac_config = dsa_port_phylink_mac_config,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment