# Re: \[net-next 11/11\] ixgbe: allow eeprom writes via ethtool

- From: Ben Hutchings \<hidden\>
- Date: 2011-09-30 13:52:43 
- List: netdev
- Page: https://ratatoskr.run/netdev/2011/09/10879699
- Thread: https://ratatoskr.run/netdev/2011/09/10879660/t.md

```text
On Thu, 2011-09-29 at 22:24 -0700, Jeff Kirsher wrote:
[...]
> +static int ixgbe_set_eeprom(struct net_device *netdev,
> +			    struct ethtool_eeprom *eeprom, u8 *bytes)
> +{
> +	struct ixgbe_adapter *adapter = netdev_priv(netdev);
> +	struct ixgbe_hw *hw = &adapter->hw;
> +	u16 *eeprom_buff;
> +	void *ptr;
> +	int max_len, first_word, last_word, ret_val = 0;
> +	u16 i;
> +
> +	if (eeprom->len == 0)
> +		return -EOPNOTSUPP;
> +
> +	if (eeprom->magic != (hw->vendor_id | (hw->device_id << 16)))
> +		return -EFAULT;
[...]

Both these error codes should be EINVAL.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
```
