NTSTATUS RTUSBReadEEPROM16(RTMP_ADAPTER *pAd, USHORT offset, USHORT *pData) { NTSTATUS status; USHORT localData; status = RTUSBReadEEPROM(pAd, offset, (PUCHAR)(&localData), 2); if (status == STATUS_SUCCESS) *pData = le2cpu16(localData); return status; }
BOOLEAN RTUSBReadEEPROM16(RTMP_ADAPTER *pAd, USHORT offset, USHORT *pData) { NTSTATUS status; UINT16 localData; BOOLEAN IsEmpty = 0; status = RTUSBReadEEPROM(pAd, offset, (PUCHAR)(&localData), 2); if (status == STATUS_SUCCESS) *pData = le2cpu16(localData); if ((*pData == 0xffff) || (*pData == 0x0000)) IsEmpty = 1; return IsEmpty; }
static int rt73_get_eeprom(struct net_device *net_dev, struct ethtool_eeprom *eeprom, u8 *data) { PRTMP_ADAPTER pAd = RTMP_OS_NETDEV_GET_PRIV(net_dev); unsigned int counter; for (counter = eeprom->offset; counter < eeprom->len; counter += sizeof(USHORT)) { USHORT value = 0; RTUSBReadEEPROM(pAd, CSR_REG_BASE + counter, (PUCHAR)&value, sizeof(USHORT)); memcpy(data, &value, sizeof(USHORT)); data += sizeof(USHORT); } return 0; }