mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 00:34:20 +08:00
net: phylink: rename 'ops' to 'mac_ops'
Rename the bland 'ops' member of struct phylink to be a more descriptive 'mac_ops' - this is necessary as we're about to introduce another set of operations. Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0bd274060a
commit
e7765d634a
@ -40,7 +40,7 @@ enum {
|
|||||||
struct phylink {
|
struct phylink {
|
||||||
/* private: */
|
/* private: */
|
||||||
struct net_device *netdev;
|
struct net_device *netdev;
|
||||||
const struct phylink_mac_ops *ops;
|
const struct phylink_mac_ops *mac_ops;
|
||||||
struct phylink_config *config;
|
struct phylink_config *config;
|
||||||
struct device *dev;
|
struct device *dev;
|
||||||
unsigned int old_link_state:1;
|
unsigned int old_link_state:1;
|
||||||
@ -154,7 +154,7 @@ static const char *phylink_an_mode_str(unsigned int mode)
|
|||||||
static int phylink_validate(struct phylink *pl, unsigned long *supported,
|
static int phylink_validate(struct phylink *pl, unsigned long *supported,
|
||||||
struct phylink_link_state *state)
|
struct phylink_link_state *state)
|
||||||
{
|
{
|
||||||
pl->ops->validate(pl->config, supported, state);
|
pl->mac_ops->validate(pl->config, supported, state);
|
||||||
|
|
||||||
return phylink_is_empty_linkmode(supported) ? -EINVAL : 0;
|
return phylink_is_empty_linkmode(supported) ? -EINVAL : 0;
|
||||||
}
|
}
|
||||||
@ -415,7 +415,7 @@ static void phylink_mac_config(struct phylink *pl,
|
|||||||
__ETHTOOL_LINK_MODE_MASK_NBITS, state->advertising,
|
__ETHTOOL_LINK_MODE_MASK_NBITS, state->advertising,
|
||||||
state->pause, state->link, state->an_enabled);
|
state->pause, state->link, state->an_enabled);
|
||||||
|
|
||||||
pl->ops->mac_config(pl->config, pl->cur_link_an_mode, state);
|
pl->mac_ops->mac_config(pl->config, pl->cur_link_an_mode, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void phylink_mac_config_up(struct phylink *pl,
|
static void phylink_mac_config_up(struct phylink *pl,
|
||||||
@ -429,7 +429,7 @@ static void phylink_mac_an_restart(struct phylink *pl)
|
|||||||
{
|
{
|
||||||
if (pl->link_config.an_enabled &&
|
if (pl->link_config.an_enabled &&
|
||||||
phy_interface_mode_is_8023z(pl->link_config.interface))
|
phy_interface_mode_is_8023z(pl->link_config.interface))
|
||||||
pl->ops->mac_an_restart(pl->config);
|
pl->mac_ops->mac_an_restart(pl->config);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void phylink_mac_pcs_get_state(struct phylink *pl,
|
static void phylink_mac_pcs_get_state(struct phylink *pl,
|
||||||
@ -445,7 +445,7 @@ static void phylink_mac_pcs_get_state(struct phylink *pl,
|
|||||||
state->an_complete = 0;
|
state->an_complete = 0;
|
||||||
state->link = 1;
|
state->link = 1;
|
||||||
|
|
||||||
pl->ops->mac_pcs_get_state(pl->config, state);
|
pl->mac_ops->mac_pcs_get_state(pl->config, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The fixed state is... fixed except for the link state,
|
/* The fixed state is... fixed except for the link state,
|
||||||
@ -512,11 +512,11 @@ static void phylink_mac_link_up(struct phylink *pl,
|
|||||||
struct net_device *ndev = pl->netdev;
|
struct net_device *ndev = pl->netdev;
|
||||||
|
|
||||||
pl->cur_interface = link_state.interface;
|
pl->cur_interface = link_state.interface;
|
||||||
pl->ops->mac_link_up(pl->config, pl->phydev,
|
pl->mac_ops->mac_link_up(pl->config, pl->phydev,
|
||||||
pl->cur_link_an_mode, pl->cur_interface,
|
pl->cur_link_an_mode, pl->cur_interface,
|
||||||
link_state.speed, link_state.duplex,
|
link_state.speed, link_state.duplex,
|
||||||
!!(link_state.pause & MLO_PAUSE_TX),
|
!!(link_state.pause & MLO_PAUSE_TX),
|
||||||
!!(link_state.pause & MLO_PAUSE_RX));
|
!!(link_state.pause & MLO_PAUSE_RX));
|
||||||
|
|
||||||
if (ndev)
|
if (ndev)
|
||||||
netif_carrier_on(ndev);
|
netif_carrier_on(ndev);
|
||||||
@ -534,8 +534,8 @@ static void phylink_mac_link_down(struct phylink *pl)
|
|||||||
|
|
||||||
if (ndev)
|
if (ndev)
|
||||||
netif_carrier_off(ndev);
|
netif_carrier_off(ndev);
|
||||||
pl->ops->mac_link_down(pl->config, pl->cur_link_an_mode,
|
pl->mac_ops->mac_link_down(pl->config, pl->cur_link_an_mode,
|
||||||
pl->cur_interface);
|
pl->cur_interface);
|
||||||
phylink_info(pl, "Link is Down\n");
|
phylink_info(pl, "Link is Down\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -666,7 +666,7 @@ static int phylink_register_sfp(struct phylink *pl,
|
|||||||
* @fwnode: a pointer to a &struct fwnode_handle describing the network
|
* @fwnode: a pointer to a &struct fwnode_handle describing the network
|
||||||
* interface
|
* interface
|
||||||
* @iface: the desired link mode defined by &typedef phy_interface_t
|
* @iface: the desired link mode defined by &typedef phy_interface_t
|
||||||
* @ops: a pointer to a &struct phylink_mac_ops for the MAC.
|
* @mac_ops: a pointer to a &struct phylink_mac_ops for the MAC.
|
||||||
*
|
*
|
||||||
* Create a new phylink instance, and parse the link parameters found in @np.
|
* Create a new phylink instance, and parse the link parameters found in @np.
|
||||||
* This will parse in-band modes, fixed-link or SFP configuration.
|
* This will parse in-band modes, fixed-link or SFP configuration.
|
||||||
@ -679,7 +679,7 @@ static int phylink_register_sfp(struct phylink *pl,
|
|||||||
struct phylink *phylink_create(struct phylink_config *config,
|
struct phylink *phylink_create(struct phylink_config *config,
|
||||||
struct fwnode_handle *fwnode,
|
struct fwnode_handle *fwnode,
|
||||||
phy_interface_t iface,
|
phy_interface_t iface,
|
||||||
const struct phylink_mac_ops *ops)
|
const struct phylink_mac_ops *mac_ops)
|
||||||
{
|
{
|
||||||
struct phylink *pl;
|
struct phylink *pl;
|
||||||
int ret;
|
int ret;
|
||||||
@ -712,7 +712,7 @@ struct phylink *phylink_create(struct phylink_config *config,
|
|||||||
pl->link_config.speed = SPEED_UNKNOWN;
|
pl->link_config.speed = SPEED_UNKNOWN;
|
||||||
pl->link_config.duplex = DUPLEX_UNKNOWN;
|
pl->link_config.duplex = DUPLEX_UNKNOWN;
|
||||||
pl->link_config.an_enabled = true;
|
pl->link_config.an_enabled = true;
|
||||||
pl->ops = ops;
|
pl->mac_ops = mac_ops;
|
||||||
__set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
|
__set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
|
||||||
timer_setup(&pl->link_poll, phylink_fixed_poll, 0);
|
timer_setup(&pl->link_poll, phylink_fixed_poll, 0);
|
||||||
|
|
||||||
|
@ -272,7 +272,7 @@ void mac_link_up(struct phylink_config *config, struct phy_device *phy,
|
|||||||
|
|
||||||
struct phylink *phylink_create(struct phylink_config *, struct fwnode_handle *,
|
struct phylink *phylink_create(struct phylink_config *, struct fwnode_handle *,
|
||||||
phy_interface_t iface,
|
phy_interface_t iface,
|
||||||
const struct phylink_mac_ops *ops);
|
const struct phylink_mac_ops *mac_ops);
|
||||||
void phylink_destroy(struct phylink *);
|
void phylink_destroy(struct phylink *);
|
||||||
|
|
||||||
int phylink_connect_phy(struct phylink *, struct phy_device *);
|
int phylink_connect_phy(struct phylink *, struct phy_device *);
|
||||||
|
Loading…
Reference in New Issue
Block a user