lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ