[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9235D6609DB808459E95D78E17F2E43D40B1E6CE@CHN-SV-EXMX02.mchp-main.com>
Date: Mon, 11 Sep 2017 20:13:54 +0000
From: <Woojung.Huh@...rochip.com>
To: <Nisar.Sayed@...rochip.com>, <davem@...emloft.net>
CC: <UNGLinuxDriver@...rochip.com>, <netdev@...r.kernel.org>
Subject: RE: [PATCH v2 net 2/3] lan78xx: Allow EEPROM write for less than
MAX_EEPROM_SIZE
Nisar,
>@@ -1290,8 +1290,8 @@ static int lan78xx_ethtool_set_eeprom(struct net_device *netdev,
>
> /* Allow entire eeprom update only */
> if ((ee->magic == LAN78XX_EEPROM_MAGIC) &&
>- (ee->offset == 0) &&
>- (ee->len == 512) &&
>+ (ee->offset >= 0 && ee->offset < MAX_EEPROM_SIZE) &&
>+ (ee->len > 0 && (ee->offset + ee->len) <= MAX_EEPROM_SIZE) &&
> (data[0] == EEPROM_INDICATOR))
This patch is for writing any len at any offset.
However, "(data[0] == EEPROM_INDICATOR)" prevents it.
> ret = lan78xx_write_raw_eeprom(dev, ee->offset, ee->len, data);
> else if ((ee->magic == LAN78XX_OTP_MAGIC) &&
- Woojung
Powered by blists - more mailing lists