@@ -995,6 +995,7 @@ struct ravb_ops {
void (*emac_init)(struct net_device *ndev);
void (*dmac_init)(struct net_device *ndev);
bool (*receive)(struct net_device *ndev, int *quota, int q);
+ void (*set_rate)(struct net_device *ndev);
};
struct ravb_drv_data {
@@ -1049,6 +1049,7 @@ static int ravb_poll(struct napi_struct *napi, int budget)
static void ravb_adjust_link(struct net_device *ndev)
{
struct ravb_private *priv = netdev_priv(ndev);
+ const struct ravb_drv_data *info = priv->info;
struct phy_device *phydev = ndev->phydev;
bool new_state = false;
unsigned long flags;
@@ -1063,7 +1064,7 @@ static void ravb_adjust_link(struct net_device *ndev)
if (phydev->speed != priv->speed) {
new_state = true;
priv->speed = phydev->speed;
- ravb_set_rate(ndev);
+ info->ravb_ops->set_rate(ndev);
}
if (!priv->link) {
ravb_modify(ndev, ECMR, ECMR_TXF, 0);
@@ -2045,6 +2046,7 @@ static const struct ravb_ops ravb_gen3_ops = {
.emac_init = ravb_emac_init_ex,
.dmac_init = ravb_dmac_init_ex,
.receive = ravb_ex_rx,
+ .set_rate = ravb_set_rate,
};
static const struct ravb_drv_data ravb_gen3_data = {