Hi Bryan

> +static int lan743x_ethtool_set_eeprom(struct net_device *netdev,
> +                                   struct ethtool_eeprom *ee, u8 *data)
> +{
> +     struct lan743x_adapter *adapter = netdev_priv(netdev);
> +     int ret = -EINVAL;
> +
> +     if (ee->magic == LAN743X_EEPROM_MAGIC)
> +             ret = lan743x_eeprom_write(adapter, ee->offset, ee->len,
> +                                        data);
> +     /* Beware!  OTP is One Time Programming ONLY!
> +      * So do some strict condition check before messing up
> +      */
> +     else if ((ee->magic == LAN743X_OTP_MAGIC) &&
> +              (ee->offset == 0) &&
> +              (ee->len == 512) &&

MAX_EEPROM_SIZE ?

> +              (data[0] == OTP_INDICATOR_1))
> +             ret = lan743x_otp_write(adapter, ee->offset, ee->len, data);
> +
> +     return ret;
> +}

  Andrew

Reply via email to