Commit 3044e457 authored by Maxim Mikityanskiy's avatar Maxim Mikityanskiy Committed by Greg Kroah-Hartman

staging: rtl8187se: Removed unneeded reads from EEPROM

Removed unneeded reads from EEPROM and some unnecessary conditions
Signed-off-by: default avatarMaxim Mikityanskiy <maxtram95@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent dfd6aefb
...@@ -365,8 +365,6 @@ typedef struct r8180_priv ...@@ -365,8 +365,6 @@ typedef struct r8180_priv
short digphy; short digphy;
short antb; short antb;
short diversity; short diversity;
u8 cs_treshold;
short rcr_csense;
u32 key0[4]; u32 key0[4];
short (*rf_set_sens)(struct net_device *dev,short sens); short (*rf_set_sens)(struct net_device *dev,short sens);
void (*rf_set_chan)(struct net_device *dev,short ch); void (*rf_set_chan)(struct net_device *dev,short ch);
...@@ -623,8 +621,6 @@ typedef struct r8180_priv ...@@ -623,8 +621,6 @@ typedef struct r8180_priv
u8 PowerProfile; u8 PowerProfile;
u32 CSMethod; u32 CSMethod;
u8 cck_txpwr_base;
u8 ofdm_txpwr_base;
u8 dma_poll_stop_mask; u8 dma_poll_stop_mask;
//u8 RegThreeWireMode; //u8 RegThreeWireMode;
......
...@@ -2376,8 +2376,7 @@ short rtl8180_init(struct net_device *dev) ...@@ -2376,8 +2376,7 @@ short rtl8180_init(struct net_device *dev)
{ {
struct r8180_priv *priv = ieee80211_priv(dev); struct r8180_priv *priv = ieee80211_priv(dev);
u16 word; u16 word;
u16 version; u16 usValue;
u32 usValue;
u16 tmpu16; u16 tmpu16;
int i, j; int i, j;
struct eeprom_93cx6 eeprom; struct eeprom_93cx6 eeprom;
...@@ -2614,36 +2613,31 @@ short rtl8180_init(struct net_device *dev) ...@@ -2614,36 +2613,31 @@ short rtl8180_init(struct net_device *dev)
/* just for sync 85 */ /* just for sync 85 */
priv->enable_gpio0 = 0; priv->enable_gpio0 = 0;
eeprom_93cx6_read(&eeprom, EEPROM_SW_REVD_OFFSET, &eeprom_val); eeprom_93cx6_read(&eeprom, EEPROM_SW_REVD_OFFSET, &usValue);
usValue = eeprom_val; DMESG("usValue is %#hx\n", usValue);
DMESG("usValue is 0x%x\n", usValue);
/* 3Read AntennaDiversity */ /* 3Read AntennaDiversity */
/* SW Antenna Diversity. */ /* SW Antenna Diversity. */
if ((usValue & EEPROM_SW_AD_MASK) != EEPROM_SW_AD_ENABLE) priv->EEPROMSwAntennaDiversity = (usValue & EEPROM_SW_AD_MASK) ==
priv->EEPROMSwAntennaDiversity = false; EEPROM_SW_AD_ENABLE;
else
priv->EEPROMSwAntennaDiversity = true;
/* Default Antenna to use. */ /* Default Antenna to use. */
if ((usValue & EEPROM_DEF_ANT_MASK) != EEPROM_DEF_ANT_1) priv->EEPROMDefaultAntenna1 = (usValue & EEPROM_DEF_ANT_MASK) ==
priv->EEPROMDefaultAntenna1 = false; EEPROM_DEF_ANT_1;
else
priv->EEPROMDefaultAntenna1 = true;
if (priv->RegSwAntennaDiversityMechanism == 0) /* Auto */ if (priv->RegSwAntennaDiversityMechanism == 0) /* Auto */
/* 0: default from EEPROM. */ /* 0: default from EEPROM. */
priv->bSwAntennaDiverity = priv->EEPROMSwAntennaDiversity; priv->bSwAntennaDiverity = priv->EEPROMSwAntennaDiversity;
else else
/* 1:disable antenna diversity, 2: enable antenna diversity. */ /* 1:disable antenna diversity, 2: enable antenna diversity. */
priv->bSwAntennaDiverity = ((priv->RegSwAntennaDiversityMechanism == 1) ? false : true); priv->bSwAntennaDiverity = priv->RegSwAntennaDiversityMechanism == 2;
if (priv->RegDefaultAntenna == 0) if (priv->RegDefaultAntenna == 0)
/* 0: default from EEPROM. */ /* 0: default from EEPROM. */
priv->bDefaultAntenna1 = priv->EEPROMDefaultAntenna1; priv->bDefaultAntenna1 = priv->EEPROMDefaultAntenna1;
else else
/* 1: main, 2: aux. */ /* 1: main, 2: aux. */
priv->bDefaultAntenna1 = ((priv->RegDefaultAntenna == 2) ? true : false); priv->bDefaultAntenna1 = priv->RegDefaultAntenna == 2;
/* rtl8185 can calc plcp len in HW. */ /* rtl8185 can calc plcp len in HW. */
priv->hw_plcp_len = 1; priv->hw_plcp_len = 1;
...@@ -2683,18 +2677,6 @@ short rtl8180_init(struct net_device *dev) ...@@ -2683,18 +2677,6 @@ short rtl8180_init(struct net_device *dev)
if ((tmpu16 & EEPROM_THERMAL_METER_ENABLE) >> 13) if ((tmpu16 & EEPROM_THERMAL_METER_ENABLE) >> 13)
priv->bTxPowerTrack = true; priv->bTxPowerTrack = true;
eeprom_93cx6_read(&eeprom, EPROM_TXPW_BASE, &word);
priv->cck_txpwr_base = word & 0xf;
priv->ofdm_txpwr_base = (word>>4) & 0xf;
eeprom_93cx6_read(&eeprom, EPROM_VERSION, &version);
DMESG("EEPROM version %x", version);
priv->rcr_csense = 3;
eeprom_93cx6_read(&eeprom, ENERGY_TRESHOLD, &eeprom_val);
priv->cs_treshold = (eeprom_val & 0xff00) >> 8;
eeprom_93cx6_read(&eeprom, RFCHIPID, &eeprom_val);
priv->rf_sleep = rtl8225z4_rf_sleep; priv->rf_sleep = rtl8225z4_rf_sleep;
priv->rf_wakeup = rtl8225z4_rf_wakeup; priv->rf_wakeup = rtl8225z4_rf_wakeup;
DMESGW("**PLEASE** REPORT SUCCESSFUL/UNSUCCESSFUL TO Realtek!"); DMESGW("**PLEASE** REPORT SUCCESSFUL/UNSUCCESSFUL TO Realtek!");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment