Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| phy_link_update [2018/08/28 11:51] – [How many drivers use adjust_link()?] rpjday | phy_link_update [2018/08/28 11:57] (current) – [freescale/ucc_geth.c] rpjday | ||
|---|---|---|---|
| Line 234: | Line 234: | ||
| return 0; | return 0; | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== freescale/ | ||
| + | |||
| + | < | ||
| + | static void adjust_link(struct net_device *dev) | ||
| + | { | ||
| + | struct gfar_private *priv = netdev_priv(dev); | ||
| + | struct phy_device *phydev = dev-> | ||
| + | |||
| + | if (unlikely(phydev-> | ||
| + | | ||
| + | | ||
| + | gfar_update_link_state(priv); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== freescale/ | ||
| + | |||
| + | < | ||
| + | static void dpaa_adjust_link(struct net_device *net_dev) | ||
| + | { | ||
| + | struct mac_device *mac_dev; | ||
| + | struct dpaa_priv *priv; | ||
| + | |||
| + | priv = netdev_priv(net_dev); | ||
| + | mac_dev = priv-> | ||
| + | mac_dev-> | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== freescale/ | ||
| + | |||
| + | < | ||
| + | /* Called every time the controller might need to be made | ||
| + | * aware of new link state. | ||
| + | * information through variables in the ugeth structure, and this | ||
| + | * function converts those variables into the appropriate | ||
| + | * register values, and can bring down the device if needed. | ||
| + | */ | ||
| + | |||
| + | static void adjust_link(struct net_device *dev) | ||
| + | { | ||
| + | struct ucc_geth_private *ugeth = netdev_priv(dev); | ||
| + | struct ucc_geth __iomem *ug_regs; | ||
| + | struct ucc_fast __iomem *uf_regs; | ||
| + | struct phy_device *phydev = ugeth-> | ||
| + | int new_state = 0; | ||
| + | |||
| + | ug_regs = ugeth-> | ||
| + | uf_regs = ugeth-> | ||
| + | |||
| + | if (phydev-> | ||
| + | </ | ||
| + | |||
| + | ==== hisilicon/ | ||
| + | |||
| + | < | ||
| + | /** | ||
| + | | ||
| + | | ||
| + | */ | ||
| + | static void hns_nic_adjust_link(struct net_device *ndev) | ||
| + | { | ||
| + | struct hns_nic_priv *priv = netdev_priv(ndev); | ||
| + | struct hnae_handle *h = priv-> | ||
| + | int state = 1; | ||
| + | |||
| + | if (ndev-> | ||
| + | h-> | ||
| + | | ||
| + | state = ndev-> | ||
| + | } | ||
| + | state = state && h-> | ||
| + | |||
| + | if (state != priv-> | ||
| + | if (state) { | ||
| + | netif_carrier_on(ndev); | ||
| + | netif_tx_wake_all_queues(ndev); | ||
| + | netdev_info(ndev, | ||
| + | } else { | ||
| + | netif_carrier_off(ndev); | ||
| + | netdev_info(ndev, | ||
| + | } | ||
| + | priv-> | ||
| + | } | ||
| } | } | ||
| </ | </ | ||