[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180705172844.GL23469@lunn.ch>
Date: Thu, 5 Jul 2018 19:28:44 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Bryan Whitehead <Bryan.Whitehead@...rochip.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org,
UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH v1 net-next 5/9] lan743x: Add support for ethtool eeprom
access
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
Powered by blists - more mailing lists