Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/dev/pci



In article <20050305150509.GA12509%s102-n054.tele2.cz@localhost>
jdolecek%NetBSD.org@localhost wrote:

> Assuming eaddr is stored in network byte order and the returned
> value being in network byte order too, the code might actually
> be just fine as-is.

No no, the EEPROM is not network device and it just stores data
in uint16_t word. It doesn't have byte-stream data, so we don't
have to do any byteswap ops even on big endian machines.
The problem in the original code is to copy uint16_t data stream
from EEPROM into a uint8_t eaddr array.

Some devices store the first byte in higher 8bit in uint16_t
EEPROM word (ex etc.), others do in lower 8 bit (rtk, vge etc.),
but anyway we can just take eaddr bytes without byteswap ops.

> If you had a chance to try this on big-endian
> machine, let me know :)

Sorry, I don't have the card. Just I've been tired to fix
many FreeBSD derived drivers which are not-well-considered
about endianness ;-p
---
Izumi Tsutsui
tsutsui%ceres.dti.ne.jp@localhost



Home | Main Index | Thread Index | Old Index