Commit 404079e7 authored by Philipp Hortmann's avatar Philipp Hortmann Committed by Greg Kroah-Hartman

staging: vt6655: Replace VNSvOutPortB with iowrite8

Replace macro VNSvOutPortB with iowrite8 because it replaces
just one line.
The name of macro and the arguments use CamelCase which
is not accepted by checkpatch.pl
Signed-off-by: default avatarPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/38611512677a18f63d9266cde1d20758c0feeb6e.1651957741.git.philipp.g.hortmann@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b3e5e492
...@@ -1909,7 +1909,7 @@ bool bb_read_embedded(struct vnt_private *priv, unsigned char by_bb_addr, ...@@ -1909,7 +1909,7 @@ bool bb_read_embedded(struct vnt_private *priv, unsigned char by_bb_addr,
unsigned char by_value; unsigned char by_value;
/* BB reg offset */ /* BB reg offset */
VNSvOutPortB(iobase + MAC_REG_BBREGADR, by_bb_addr); iowrite8(by_bb_addr, iobase + MAC_REG_BBREGADR);
/* turn on REGR */ /* turn on REGR */
MACvRegBitsOn(iobase, MAC_REG_BBREGCTL, BBREGCTL_REGR); MACvRegBitsOn(iobase, MAC_REG_BBREGCTL, BBREGCTL_REGR);
...@@ -1952,9 +1952,9 @@ bool bb_write_embedded(struct vnt_private *priv, unsigned char by_bb_addr, ...@@ -1952,9 +1952,9 @@ bool bb_write_embedded(struct vnt_private *priv, unsigned char by_bb_addr,
unsigned char by_value; unsigned char by_value;
/* BB reg offset */ /* BB reg offset */
VNSvOutPortB(iobase + MAC_REG_BBREGADR, by_bb_addr); iowrite8(by_bb_addr, iobase + MAC_REG_BBREGADR);
/* set BB data */ /* set BB data */
VNSvOutPortB(iobase + MAC_REG_BBREGDATA, by_data); iowrite8(by_data, iobase + MAC_REG_BBREGDATA);
/* turn on BBREGCTL_REGW */ /* turn on BBREGCTL_REGW */
MACvRegBitsOn(iobase, MAC_REG_BBREGCTL, BBREGCTL_REGW); MACvRegBitsOn(iobase, MAC_REG_BBREGCTL, BBREGCTL_REGW);
...@@ -2053,7 +2053,7 @@ bool bb_vt3253_init(struct vnt_private *priv) ...@@ -2053,7 +2053,7 @@ bool bb_vt3253_init(struct vnt_private *priv)
byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][0],
byVT3253B0_AGC[ii][1]); byVT3253B0_AGC[ii][1]);
VNSvOutPortB(iobase + MAC_REG_ITRTMSET, 0x23); iowrite8(0x23, iobase + MAC_REG_ITRTMSET);
MACvRegBitsOn(iobase, MAC_REG_PAPEDELAY, BIT(0)); MACvRegBitsOn(iobase, MAC_REG_PAPEDELAY, BIT(0));
priv->abyBBVGA[0] = 0x14; priv->abyBBVGA[0] = 0x14;
......
...@@ -238,26 +238,25 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type) ...@@ -238,26 +238,25 @@ bool CARDbSetPhyParameter(struct vnt_private *priv, u8 bb_type)
if (priv->bySIFS != bySIFS) { if (priv->bySIFS != bySIFS) {
priv->bySIFS = bySIFS; priv->bySIFS = bySIFS;
VNSvOutPortB(priv->port_offset + MAC_REG_SIFS, priv->bySIFS); iowrite8(priv->bySIFS, priv->port_offset + MAC_REG_SIFS);
} }
if (priv->byDIFS != byDIFS) { if (priv->byDIFS != byDIFS) {
priv->byDIFS = byDIFS; priv->byDIFS = byDIFS;
VNSvOutPortB(priv->port_offset + MAC_REG_DIFS, priv->byDIFS); iowrite8(priv->byDIFS, priv->port_offset + MAC_REG_DIFS);
} }
if (priv->byEIFS != C_EIFS) { if (priv->byEIFS != C_EIFS) {
priv->byEIFS = C_EIFS; priv->byEIFS = C_EIFS;
VNSvOutPortB(priv->port_offset + MAC_REG_EIFS, priv->byEIFS); iowrite8(priv->byEIFS, priv->port_offset + MAC_REG_EIFS);
} }
if (priv->bySlot != bySlot) { if (priv->bySlot != bySlot) {
priv->bySlot = bySlot; priv->bySlot = bySlot;
VNSvOutPortB(priv->port_offset + MAC_REG_SLOT, priv->bySlot); iowrite8(priv->bySlot, priv->port_offset + MAC_REG_SLOT);
bb_set_short_slot_time(priv); bb_set_short_slot_time(priv);
} }
if (priv->byCWMaxMin != byCWMaxMin) { if (priv->byCWMaxMin != byCWMaxMin) {
priv->byCWMaxMin = byCWMaxMin; priv->byCWMaxMin = byCWMaxMin;
VNSvOutPortB(priv->port_offset + MAC_REG_CWMAXMIN0, iowrite8(priv->byCWMaxMin, priv->port_offset + MAC_REG_CWMAXMIN0);
priv->byCWMaxMin);
} }
priv->byPacketType = CARDbyGetPktType(priv); priv->byPacketType = CARDbyGetPktType(priv);
......
...@@ -118,11 +118,9 @@ bool set_channel(struct vnt_private *priv, struct ieee80211_channel *ch) ...@@ -118,11 +118,9 @@ bool set_channel(struct vnt_private *priv, struct ieee80211_channel *ch)
/* set HW default power register */ /* set HW default power register */
MACvSelectPage1(priv->port_offset); MACvSelectPage1(priv->port_offset);
RFbSetPower(priv, RATE_1M, priv->byCurrentCh); RFbSetPower(priv, RATE_1M, priv->byCurrentCh);
VNSvOutPortB(priv->port_offset + MAC_REG_PWRCCK, iowrite8(priv->byCurPwr, priv->port_offset + MAC_REG_PWRCCK);
priv->byCurPwr);
RFbSetPower(priv, RATE_6M, priv->byCurrentCh); RFbSetPower(priv, RATE_6M, priv->byCurrentCh);
VNSvOutPortB(priv->port_offset + MAC_REG_PWROFDM, iowrite8(priv->byCurPwr, priv->port_offset + MAC_REG_PWROFDM);
priv->byCurPwr);
MACvSelectPage0(priv->port_offset); MACvSelectPage0(priv->port_offset);
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
......
...@@ -334,8 +334,7 @@ static void device_init_registers(struct vnt_private *priv) ...@@ -334,8 +334,7 @@ static void device_init_registers(struct vnt_private *priv)
if (priv->local_id > REV_ID_VT3253_B1) { if (priv->local_id > REV_ID_VT3253_B1) {
MACvSelectPage1(priv->port_offset); MACvSelectPage1(priv->port_offset);
VNSvOutPortB(priv->port_offset + MAC_REG_MSRCTL + 1, iowrite8(MSRCTL1_TXPWR | MSRCTL1_CSAPAREN, priv->port_offset + MAC_REG_MSRCTL + 1);
(MSRCTL1_TXPWR | MSRCTL1_CSAPAREN));
MACvSelectPage0(priv->port_offset); MACvSelectPage0(priv->port_offset);
} }
...@@ -349,9 +348,9 @@ static void device_init_registers(struct vnt_private *priv) ...@@ -349,9 +348,9 @@ static void device_init_registers(struct vnt_private *priv)
MACvSetLongRetryLimit(priv, priv->byLongRetryLimit); MACvSetLongRetryLimit(priv, priv->byLongRetryLimit);
/* reset TSF counter */ /* reset TSF counter */
VNSvOutPortB(priv->port_offset + MAC_REG_TFTCTL, TFTCTL_TSFCNTRST); iowrite8(TFTCTL_TSFCNTRST, priv->port_offset + MAC_REG_TFTCTL);
/* enable TSF counter */ /* enable TSF counter */
VNSvOutPortB(priv->port_offset + MAC_REG_TFTCTL, TFTCTL_TSFCNTREN); iowrite8(TFTCTL_TSFCNTREN, priv->port_offset + MAC_REG_TFTCTL);
/* initialize BBP registers */ /* initialize BBP registers */
bb_vt3253_init(priv); bb_vt3253_init(priv);
...@@ -406,8 +405,7 @@ static void device_init_registers(struct vnt_private *priv) ...@@ -406,8 +405,7 @@ static void device_init_registers(struct vnt_private *priv)
MACvReceive1(priv->port_offset); MACvReceive1(priv->port_offset);
/* start the adapter */ /* start the adapter */
VNSvOutPortB(priv->port_offset + MAC_REG_HOSTCR, iowrite8(HOSTCR_MACEN | HOSTCR_RXON | HOSTCR_TXON, priv->port_offset + MAC_REG_HOSTCR);
(HOSTCR_MACEN | HOSTCR_RXON | HOSTCR_TXON));
} }
static void device_print_info(struct vnt_private *priv) static void device_print_info(struct vnt_private *priv)
...@@ -1061,7 +1059,7 @@ static void vnt_interrupt_process(struct vnt_private *priv) ...@@ -1061,7 +1059,7 @@ static void vnt_interrupt_process(struct vnt_private *priv)
if (isr & ISR_FETALERR) { if (isr & ISR_FETALERR) {
pr_debug(" ISR_FETALERR\n"); pr_debug(" ISR_FETALERR\n");
VNSvOutPortB(priv->port_offset + MAC_REG_SOFTPWRCTL, 0); iowrite8(0, priv->port_offset + MAC_REG_SOFTPWRCTL);
VNSvOutPortW(priv->port_offset + VNSvOutPortW(priv->port_offset +
MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPECTI); MAC_REG_SOFTPWRCTL, SOFTPWRCTL_SWPECTI);
device_error(priv, isr); device_error(priv, isr);
...@@ -1408,7 +1406,7 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw, ...@@ -1408,7 +1406,7 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw,
spin_lock_irqsave(&priv->lock, flags); spin_lock_irqsave(&priv->lock, flags);
MACvWriteBSSIDAddress(priv->port_offset, (u8 *)conf->bssid); MACvWriteBSSIDAddress(priv->port_offset, conf->bssid);
spin_unlock_irqrestore(&priv->lock, flags); spin_unlock_irqrestore(&priv->lock, flags);
} }
...@@ -1478,10 +1476,8 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw, ...@@ -1478,10 +1476,8 @@ static void vnt_bss_info_changed(struct ieee80211_hw *hw,
CARDvSetFirstNextTBTT(priv, conf->beacon_int); CARDvSetFirstNextTBTT(priv, conf->beacon_int);
} else { } else {
VNSvOutPortB(priv->port_offset + MAC_REG_TFTCTL, iowrite8(TFTCTL_TSFCNTRST, priv->port_offset + MAC_REG_TFTCTL);
TFTCTL_TSFCNTRST); iowrite8(TFTCTL_TSFCNTREN, priv->port_offset + MAC_REG_TFTCTL);
VNSvOutPortB(priv->port_offset + MAC_REG_TFTCTL,
TFTCTL_TSFCNTREN);
} }
} }
} }
...@@ -1562,7 +1558,7 @@ static void vnt_configure(struct ieee80211_hw *hw, ...@@ -1562,7 +1558,7 @@ static void vnt_configure(struct ieee80211_hw *hw,
rx_mode |= RCR_BSSID; rx_mode |= RCR_BSSID;
} }
VNSvOutPortB(priv->port_offset + MAC_REG_RCR, rx_mode); iowrite8(rx_mode, priv->port_offset + MAC_REG_RCR);
dev_dbg(&priv->pcid->dev, "rx mode out= %x\n", rx_mode); dev_dbg(&priv->pcid->dev, "rx mode out= %x\n", rx_mode);
} }
...@@ -1622,7 +1618,7 @@ static void vnt_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif) ...@@ -1622,7 +1618,7 @@ static void vnt_reset_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
struct vnt_private *priv = hw->priv; struct vnt_private *priv = hw->priv;
/* reset TSF counter */ /* reset TSF counter */
VNSvOutPortB(priv->port_offset + MAC_REG_TFTCTL, TFTCTL_TSFCNTRST); iowrite8(TFTCTL_TSFCNTRST, priv->port_offset + MAC_REG_TFTCTL);
} }
static const struct ieee80211_ops vnt_mac_ops = { static const struct ieee80211_ops vnt_mac_ops = {
......
...@@ -541,7 +541,7 @@ ...@@ -541,7 +541,7 @@
do { \ do { \
unsigned char byData; \ unsigned char byData; \
byData = ioread8(iobase + byRegOfs); \ byData = ioread8(iobase + byRegOfs); \
VNSvOutPortB(iobase + byRegOfs, byData | (byBits)); \ iowrite8(byData | (byBits), iobase + byRegOfs); \
} while (0) } while (0)
#define MACvWordRegBitsOn(iobase, byRegOfs, wBits) \ #define MACvWordRegBitsOn(iobase, byRegOfs, wBits) \
...@@ -555,7 +555,7 @@ do { \ ...@@ -555,7 +555,7 @@ do { \
do { \ do { \
unsigned char byData; \ unsigned char byData; \
byData = ioread8(iobase + byRegOfs); \ byData = ioread8(iobase + byRegOfs); \
VNSvOutPortB(iobase + byRegOfs, byData & ~(byBits)); \ iowrite8(byData & ~(byBits), iobase + byRegOfs); \
} while (0) } while (0)
#define MACvWordRegBitsOff(iobase, byRegOfs, wBits) \ #define MACvWordRegBitsOff(iobase, byRegOfs, wBits) \
...@@ -577,32 +577,26 @@ do { \ ...@@ -577,32 +577,26 @@ do { \
#define MACvWriteBSSIDAddress(iobase, pbyEtherAddr) \ #define MACvWriteBSSIDAddress(iobase, pbyEtherAddr) \
do { \ do { \
VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 1); \ iowrite8(1, iobase + MAC_REG_PAGE1SEL); \
VNSvOutPortB(iobase + MAC_REG_BSSID0, \ iowrite8(pbyEtherAddr[0], iobase + MAC_REG_BSSID0); \
*(pbyEtherAddr)); \ iowrite8(pbyEtherAddr[1], iobase + MAC_REG_BSSID0 + 1); \
VNSvOutPortB(iobase + MAC_REG_BSSID0 + 1, \ iowrite8(pbyEtherAddr[2], iobase + MAC_REG_BSSID0 + 2); \
*(pbyEtherAddr + 1)); \ iowrite8(pbyEtherAddr[3], iobase + MAC_REG_BSSID0 + 3); \
VNSvOutPortB(iobase + MAC_REG_BSSID0 + 2, \ iowrite8(pbyEtherAddr[4], iobase + MAC_REG_BSSID0 + 4); \
*(pbyEtherAddr + 2)); \ iowrite8(pbyEtherAddr[5], iobase + MAC_REG_BSSID0 + 5); \
VNSvOutPortB(iobase + MAC_REG_BSSID0 + 3, \ iowrite8(0, iobase + MAC_REG_PAGE1SEL); \
*(pbyEtherAddr + 3)); \
VNSvOutPortB(iobase + MAC_REG_BSSID0 + 4, \
*(pbyEtherAddr + 4)); \
VNSvOutPortB(iobase + MAC_REG_BSSID0 + 5, \
*(pbyEtherAddr + 5)); \
VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 0); \
} while (0) } while (0)
#define MACvReadEtherAddress(iobase, pbyEtherAddr) \ #define MACvReadEtherAddress(iobase, pbyEtherAddr) \
do { \ do { \
VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 1); \ iowrite8(1, iobase + MAC_REG_PAGE1SEL); \
pbyEtherAddr[0] = ioread8(iobase + MAC_REG_PAR0); \ pbyEtherAddr[0] = ioread8(iobase + MAC_REG_PAR0); \
pbyEtherAddr[1] = ioread8(iobase + MAC_REG_PAR0 + 1); \ pbyEtherAddr[1] = ioread8(iobase + MAC_REG_PAR0 + 1); \
pbyEtherAddr[2] = ioread8(iobase + MAC_REG_PAR0 + 2); \ pbyEtherAddr[2] = ioread8(iobase + MAC_REG_PAR0 + 2); \
pbyEtherAddr[3] = ioread8(iobase + MAC_REG_PAR0 + 3); \ pbyEtherAddr[3] = ioread8(iobase + MAC_REG_PAR0 + 3); \
pbyEtherAddr[4] = ioread8(iobase + MAC_REG_PAR0 + 4); \ pbyEtherAddr[4] = ioread8(iobase + MAC_REG_PAR0 + 4); \
pbyEtherAddr[5] = ioread8(iobase + MAC_REG_PAR0 + 5); \ pbyEtherAddr[5] = ioread8(iobase + MAC_REG_PAR0 + 5); \
VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 0); \ iowrite8(0, iobase + MAC_REG_PAGE1SEL); \
} while (0) } while (0)
#define MACvRx0PerPktMode(iobase) \ #define MACvRx0PerPktMode(iobase) \
...@@ -656,7 +650,7 @@ do { \ ...@@ -656,7 +650,7 @@ do { \
unsigned char byOrgValue; \ unsigned char byOrgValue; \
byOrgValue = ioread8(iobase + MAC_REG_STICKHW); \ byOrgValue = ioread8(iobase + MAC_REG_STICKHW); \
byOrgValue = byOrgValue & 0xFC; \ byOrgValue = byOrgValue & 0xFC; \
VNSvOutPortB(iobase + MAC_REG_STICKHW, byOrgValue); \ iowrite8(byOrgValue, iobase + MAC_REG_STICKHW); \
} while (0) } while (0)
#define MACvWriteISR(iobase, dwValue) \ #define MACvWriteISR(iobase, dwValue) \
...@@ -669,10 +663,10 @@ do { \ ...@@ -669,10 +663,10 @@ do { \
VNSvOutPortD(iobase + MAC_REG_IMR, 0) VNSvOutPortD(iobase + MAC_REG_IMR, 0)
#define MACvSelectPage0(iobase) \ #define MACvSelectPage0(iobase) \
VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 0) iowrite8(0, iobase + MAC_REG_PAGE1SEL)
#define MACvSelectPage1(iobase) \ #define MACvSelectPage1(iobase) \
VNSvOutPortB(iobase + MAC_REG_PAGE1SEL, 1) iowrite8(1, iobase + MAC_REG_PAGE1SEL)
#define MACvEnableProtectMD(iobase) \ #define MACvEnableProtectMD(iobase) \
do { \ do { \
......
...@@ -207,7 +207,7 @@ static bool RFbAL2230Init(struct vnt_private *priv) ...@@ -207,7 +207,7 @@ static bool RFbAL2230Init(struct vnt_private *priv)
ret = true; ret = true;
/* 3-wire control for normal mode */ /* 3-wire control for normal mode */
VNSvOutPortB(iobase + MAC_REG_SOFTPWRCTL, 0); iowrite8(0, iobase + MAC_REG_SOFTPWRCTL);
MACvWordRegBitsOn(iobase, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPECTI | MACvWordRegBitsOn(iobase, MAC_REG_SOFTPWRCTL, (SOFTPWRCTL_SWPECTI |
SOFTPWRCTL_TXPEINV)); SOFTPWRCTL_TXPEINV));
...@@ -238,7 +238,7 @@ static bool RFbAL2230Init(struct vnt_private *priv) ...@@ -238,7 +238,7 @@ static bool RFbAL2230Init(struct vnt_private *priv)
SOFTPWRCTL_TXPEINV)); SOFTPWRCTL_TXPEINV));
/* 3-wire control for power saving mode */ /* 3-wire control for power saving mode */
VNSvOutPortB(iobase + MAC_REG_PSPWRSIG, (PSSIG_WPE3 | PSSIG_WPE2)); /* 1100 0000 */ iowrite8(PSSIG_WPE3 | PSSIG_WPE2, iobase + MAC_REG_PSPWRSIG);
return ret; return ret;
} }
...@@ -254,10 +254,10 @@ static bool RFbAL2230SelectChannel(struct vnt_private *priv, unsigned char byCha ...@@ -254,10 +254,10 @@ static bool RFbAL2230SelectChannel(struct vnt_private *priv, unsigned char byCha
ret &= IFRFbWriteEmbedded(priv, al2230_channel_table1[byChannel - 1]); ret &= IFRFbWriteEmbedded(priv, al2230_channel_table1[byChannel - 1]);
/* Set Channel[7] = 0 to tell H/W channel is changing now. */ /* Set Channel[7] = 0 to tell H/W channel is changing now. */
VNSvOutPortB(iobase + MAC_REG_CHANNEL, (byChannel & 0x7F)); iowrite8(byChannel & 0x7F, iobase + MAC_REG_CHANNEL);
MACvTimer0MicroSDelay(priv, SWITCH_CHANNEL_DELAY_AL2230); MACvTimer0MicroSDelay(priv, SWITCH_CHANNEL_DELAY_AL2230);
/* Set Channel[7] = 1 to tell H/W channel change is done. */ /* Set Channel[7] = 1 to tell H/W channel change is done. */
VNSvOutPortB(iobase + MAC_REG_CHANNEL, (byChannel | 0x80)); iowrite8(byChannel | 0x80, iobase + MAC_REG_CHANNEL);
return ret; return ret;
} }
......
...@@ -1426,7 +1426,7 @@ static int vnt_beacon_xmit(struct vnt_private *priv, ...@@ -1426,7 +1426,7 @@ static int vnt_beacon_xmit(struct vnt_private *priv,
/* Set auto Transmit on */ /* Set auto Transmit on */
MACvRegBitsOn(priv->port_offset, MAC_REG_TCR, TCR_AUTOBCNTX); MACvRegBitsOn(priv->port_offset, MAC_REG_TCR, TCR_AUTOBCNTX);
/* Poll Transmit the adapter */ /* Poll Transmit the adapter */
VNSvOutPortB(priv->port_offset + MAC_REG_BCNDMACTL, BEACON_READY); iowrite8(BEACON_READY, priv->port_offset + MAC_REG_BCNDMACTL);
return 0; return 0;
} }
...@@ -1450,9 +1450,9 @@ int vnt_beacon_make(struct vnt_private *priv, struct ieee80211_vif *vif) ...@@ -1450,9 +1450,9 @@ int vnt_beacon_make(struct vnt_private *priv, struct ieee80211_vif *vif)
int vnt_beacon_enable(struct vnt_private *priv, struct ieee80211_vif *vif, int vnt_beacon_enable(struct vnt_private *priv, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *conf) struct ieee80211_bss_conf *conf)
{ {
VNSvOutPortB(priv->port_offset + MAC_REG_TFTCTL, TFTCTL_TSFCNTRST); iowrite8(TFTCTL_TSFCNTRST, priv->port_offset + MAC_REG_TFTCTL);
VNSvOutPortB(priv->port_offset + MAC_REG_TFTCTL, TFTCTL_TSFCNTREN); iowrite8(TFTCTL_TSFCNTREN, priv->port_offset + MAC_REG_TFTCTL);
CARDvSetFirstNextTBTT(priv, conf->beacon_int); CARDvSetFirstNextTBTT(priv, conf->beacon_int);
......
...@@ -67,13 +67,13 @@ unsigned char SROMbyReadEmbedded(void __iomem *iobase, ...@@ -67,13 +67,13 @@ unsigned char SROMbyReadEmbedded(void __iomem *iobase,
byData = 0xFF; byData = 0xFF;
byOrg = ioread8(iobase + MAC_REG_I2MCFG); byOrg = ioread8(iobase + MAC_REG_I2MCFG);
/* turn off hardware retry for getting NACK */ /* turn off hardware retry for getting NACK */
VNSvOutPortB(iobase + MAC_REG_I2MCFG, (byOrg & (~I2MCFG_NORETRY))); iowrite8(byOrg & (~I2MCFG_NORETRY), iobase + MAC_REG_I2MCFG);
for (wNoACK = 0; wNoACK < W_MAX_I2CRETRY; wNoACK++) { for (wNoACK = 0; wNoACK < W_MAX_I2CRETRY; wNoACK++) {
VNSvOutPortB(iobase + MAC_REG_I2MTGID, EEP_I2C_DEV_ID); iowrite8(EEP_I2C_DEV_ID, iobase + MAC_REG_I2MTGID);
VNSvOutPortB(iobase + MAC_REG_I2MTGAD, byContntOffset); iowrite8(byContntOffset, iobase + MAC_REG_I2MTGAD);
/* issue read command */ /* issue read command */
VNSvOutPortB(iobase + MAC_REG_I2MCSR, I2MCSR_EEMR); iowrite8(I2MCSR_EEMR, iobase + MAC_REG_I2MCSR);
/* wait DONE be set */ /* wait DONE be set */
for (wDelay = 0; wDelay < W_MAX_TIMEOUT; wDelay++) { for (wDelay = 0; wDelay < W_MAX_TIMEOUT; wDelay++) {
byWait = ioread8(iobase + MAC_REG_I2MCSR); byWait = ioread8(iobase + MAC_REG_I2MCSR);
...@@ -87,7 +87,7 @@ unsigned char SROMbyReadEmbedded(void __iomem *iobase, ...@@ -87,7 +87,7 @@ unsigned char SROMbyReadEmbedded(void __iomem *iobase,
} }
} }
byData = ioread8(iobase + MAC_REG_I2MDIPT); byData = ioread8(iobase + MAC_REG_I2MDIPT);
VNSvOutPortB(iobase + MAC_REG_I2MCFG, byOrg); iowrite8(byOrg, iobase + MAC_REG_I2MCFG);
return byData; return byData;
} }
......
...@@ -20,9 +20,6 @@ ...@@ -20,9 +20,6 @@
/* For memory mapped IO */ /* For memory mapped IO */
#define VNSvOutPortB(dwIOAddress, byData) \
iowrite8((u8)(byData), dwIOAddress)
#define VNSvOutPortW(dwIOAddress, wData) \ #define VNSvOutPortW(dwIOAddress, wData) \
iowrite16((u16)(wData), dwIOAddress) iowrite16((u16)(wData), dwIOAddress)
......
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