return *data;
}
-static void rtl8192_read_eeprom_info(struct net_device *dev)
+static int rtl8192_read_eeprom_info(struct net_device *dev)
{
u16 wEPROM_ID = 0;
u8 bMac_Tmp_Addr[6] = {0x00, 0xe0, 0x4c, 0x00, 0x00, 0x02};
RT_TRACE(COMP_EPROM, "===========>%s()\n", __func__);
ret = eprom_read(dev, 0); /* first read EEPROM ID out; */
if (ret < 0)
- return;
+ return ret;
wEPROM_ID = (u16)ret;
RT_TRACE(COMP_EPROM, "EEPROM ID is 0x%x\n", wEPROM_ID);
tmpValue = eprom_read(dev, EEPROM_VID >> 1);
ret = eprom_read(dev, EEPROM_VID >> 1);
if (ret < 0)
- return;
+ return ret;
tmpValue = (u16)ret;
priv->eeprom_vid = endian_swap(&tmpValue);
ret = eprom_read(dev, EEPROM_PID >> 1);
if (ret < 0)
- return;
+ return ret;
priv->eeprom_pid = (u16)ret;
ret = eprom_read(dev, EEPROM_ChannelPlan >> 1);
if (ret < 0)
- return;
+ return ret;
tmpValue = (u16)ret;
priv->eeprom_ChannelPlan = (tmpValue & 0xff00) >> 8;
priv->btxpowerdata_readfromEEPORM = true;
ret = eprom_read(dev, (EEPROM_Customer_ID >> 1)) >> 8;
if (ret < 0)
- return;
+ return ret;
priv->eeprom_CustomerID = (u16)ret;
} else {
priv->eeprom_vid = 0;
for (i = 0; i < 6; i += 2) {
ret = eprom_read(dev, (u16)((EEPROM_NODE_ADDRESS_BYTE_0 + i) >> 1));
if (ret < 0)
- return;
+ return ret;
*(u16 *)(&dev->dev_addr[i]) = (u16)ret;
}
} else {
if (bLoad_From_EEPOM) {
ret = eprom_read(dev, (EEPROM_TxPowerDiff >> 1));
if (ret < 0)
- return;
+ return ret;
priv->EEPROMTxPowerDiff = ((u16)ret & 0xff00) >> 8;
} else
priv->EEPROMTxPowerDiff = EEPROM_Default_TxPower;
if (bLoad_From_EEPOM) {
ret = eprom_read(dev, (EEPROM_ThermalMeter >> 1));
if (ret < 0)
- return;
+ return ret;
priv->EEPROMThermalMeter = (u8)((u16)ret & 0x00ff);
} else
priv->EEPROMThermalMeter = EEPROM_Default_ThermalMeter;
if (bLoad_From_EEPOM) {
ret = eprom_read(dev, (EEPROM_PwDiff >> 1));
if (ret < 0)
- return;
+ return ret;
priv->EEPROMPwDiff = ((u16)ret & 0x0f00) >> 8;
} else
priv->EEPROMPwDiff = EEPROM_Default_PwDiff;
if (bLoad_From_EEPOM) {
ret = eprom_read(dev, (EEPROM_CrystalCap >> 1));
if (ret < 0)
- return;
+ return ret;
priv->EEPROMCrystalCap = (u16)ret & 0x0f;
} else
priv->EEPROMCrystalCap = EEPROM_Default_CrystalCap;
if (bLoad_From_EEPOM) {
ret = eprom_read(dev, (EEPROM_TxPwIndex_Ver >> 1));
if (ret < 0)
- return;
+ return ret;
priv->EEPROM_Def_Ver = ((u16)ret & 0xff00) >> 8;
} else
priv->EEPROM_Def_Ver = 1;
if (bLoad_From_EEPOM) {
ret = eprom_read(dev, (EEPROM_TxPwIndex_CCK >> 1));
if (ret < 0)
- return;
+ return ret;
priv->EEPROMTxPowerLevelCCK = ((u16)ret & 0xff) >> 8;
} else
priv->EEPROMTxPowerLevelCCK = 0x10;
if (bLoad_From_EEPOM) {
ret = eprom_read(dev, (EEPROM_TxPwIndex_OFDM_24G + i) >> 1);
if ( ret < 0)
- return;
+ return ret;
if (((EEPROM_TxPwIndex_OFDM_24G + i) % 2) == 0)
tmpValue = (u16)ret & 0x00ff;
else
if (bLoad_From_EEPOM) {
ret = eprom_read(dev, EEPROM_TxPwIndex_CCK_V1 >> 1);
if (ret < 0)
- return;
+ return ret;
tmpValue = ((u16)ret & 0xff00) >> 8;
} else {
tmpValue = 0x10;
if (bLoad_From_EEPOM) {
ret = eprom_read(dev, (EEPROM_TxPwIndex_CCK_V1 + 2) >> 1);
if (ret < 0)
- return;
+ return ret;
tmpValue = (u16)ret;
} else
tmpValue = 0x1010;
init_rate_adaptive(dev);
RT_TRACE(COMP_EPROM, "<===========%s()\n", __func__);
+
+ return 0;
}
static short rtl8192_get_channel_map(struct net_device *dev)