Commit 28980a3c authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Staging: slicoss: remove WRITE_REG64 wrapper

It's not needed, so just call the function instead of using a define.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5969ca00
...@@ -44,8 +44,6 @@ ...@@ -44,8 +44,6 @@
#define WRITE_REG(reg, value, flush) \ #define WRITE_REG(reg, value, flush) \
slic_reg32_write((&reg), (value), (flush)) slic_reg32_write((&reg), (value), (flush))
#define WRITE_REG64(a, reg, value, regh, valh, flush) \
slic_reg64_write((a), (&reg), (value), (&regh), (valh), (flush))
#endif /* _SLIC_OS_SPECIFIC_H_ */ #endif /* _SLIC_OS_SPECIFIC_H_ */
...@@ -65,8 +65,6 @@ static void slic_config_pci(struct pci_dev *pcidev); ...@@ -65,8 +65,6 @@ static void slic_config_pci(struct pci_dev *pcidev);
static struct sk_buff *slic_rcvqueue_getnext(struct adapter *adapter); static struct sk_buff *slic_rcvqueue_getnext(struct adapter *adapter);
static inline void slic_reg32_write(void __iomem *reg, u32 value, uint flush); static inline void slic_reg32_write(void __iomem *reg, u32 value, uint flush);
static inline void slic_reg64_write(struct adapter *adapter, void __iomem *reg,
u32 value, void __iomem *regh, u32 paddrh, uint flush);
#if SLIC_GET_STATS_ENABLED #if SLIC_GET_STATS_ENABLED
static struct net_device_stats *slic_get_stats(struct net_device *dev); static struct net_device_stats *slic_get_stats(struct net_device *dev);
......
...@@ -202,10 +202,9 @@ static inline void slic_reg32_write(void __iomem *reg, u32 value, uint flush) ...@@ -202,10 +202,9 @@ static inline void slic_reg32_write(void __iomem *reg, u32 value, uint flush)
mb(); mb();
} }
static inline void slic_reg64_write(struct adapter *adapter, static inline void slic_reg64_write(struct adapter *adapter, void __iomem *reg,
void __iomem *reg, u32 value, void __iomem *regh, u32 paddrh,
u32 value, bool flush)
void __iomem *regh, u32 paddrh, uint flush)
{ {
spin_lock_irqsave(&adapter->bit64reglock.lock, spin_lock_irqsave(&adapter->bit64reglock.lock,
adapter->bit64reglock.flags); adapter->bit64reglock.flags);
...@@ -1004,11 +1003,10 @@ static int slic_xmit_start(struct sk_buff *skb, struct net_device *dev) ...@@ -1004,11 +1003,10 @@ static int slic_xmit_start(struct sk_buff *skb, struct net_device *dev)
WRITE_REG(adapter->slic_regs->slic_cbar, WRITE_REG(adapter->slic_regs->slic_cbar,
(hcmd->paddrl | hcmd->cmdsize), DONT_FLUSH); (hcmd->paddrl | hcmd->cmdsize), DONT_FLUSH);
} else { } else {
WRITE_REG64(adapter, slic_reg64_write(adapter, &adapter->slic_regs->slic_cbar64,
adapter->slic_regs->slic_cbar64, (hcmd->paddrl | hcmd->cmdsize),
(hcmd->paddrl | hcmd->cmdsize), &adapter->slic_regs->slic_addr_upper,
adapter->slic_regs->slic_addr_upper, hcmd->paddrh, DONT_FLUSH);
hcmd->paddrh, DONT_FLUSH);
} }
xmit_done: xmit_done:
return 0; return 0;
...@@ -2481,11 +2479,10 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter) ...@@ -2481,11 +2479,10 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
if (adapter->pshmem->isr & ISR_UPC) { if (adapter->pshmem->isr & ISR_UPC) {
adapter->pshmem->isr = 0; adapter->pshmem->isr = 0;
WRITE_REG64(adapter, slic_reg64_write(adapter,
slic_regs->slic_isp, &slic_regs->slic_isp, 0,
0, &slic_regs->slic_addr_upper,
slic_regs->slic_addr_upper, 0, FLUSH);
0, FLUSH);
WRITE_REG(slic_regs->slic_isr, 0, WRITE_REG(slic_regs->slic_isr, 0,
FLUSH); FLUSH);
...@@ -2506,10 +2503,10 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter) ...@@ -2506,10 +2503,10 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
DBG_MSG("%s shmem[%p] shmem->isr[%x]\n", DBG_MSG("%s shmem[%p] shmem->isr[%x]\n",
__func__, adapter->pshmem, __func__, adapter->pshmem,
adapter->pshmem->isr); adapter->pshmem->isr);
WRITE_REG64(adapter, slic_reg64_write(adapter,
slic_regs->slic_isp, 0, &slic_regs->slic_isp, 0,
slic_regs->slic_addr_upper, &slic_regs->slic_addr_upper,
0, FLUSH); 0, FLUSH);
return -EINVAL; return -EINVAL;
} }
} }
...@@ -2594,9 +2591,9 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter) ...@@ -2594,9 +2591,9 @@ static int slic_card_init(struct sliccard *card, struct adapter *adapter)
if ((!card->config.EepromValid) && if ((!card->config.EepromValid) &&
(adapter->reg_params.fail_on_bad_eeprom)) { (adapter->reg_params.fail_on_bad_eeprom)) {
WRITE_REG64(adapter, slic_reg64_write(adapter, &slic_regs->slic_isp, 0,
slic_regs->slic_isp, &slic_regs->slic_addr_upper,
0, slic_regs->slic_addr_upper, 0, FLUSH); 0, FLUSH);
DBG_ERROR DBG_ERROR
("unsupported CONFIGURATION EEPROM invalid\n"); ("unsupported CONFIGURATION EEPROM invalid\n");
return -EINVAL; return -EINVAL;
...@@ -3418,24 +3415,22 @@ static void slic_upr_start(struct adapter *adapter) ...@@ -3418,24 +3415,22 @@ static void slic_upr_start(struct adapter *adapter)
if (upr->upr_data_h == 0) { if (upr->upr_data_h == 0) {
WRITE_REG(slic_regs->slic_stats, upr->upr_data, FLUSH); WRITE_REG(slic_regs->slic_stats, upr->upr_data, FLUSH);
} else { } else {
WRITE_REG64(adapter, slic_reg64_write(adapter, &slic_regs->slic_stats64,
slic_regs->slic_stats64, upr->upr_data,
upr->upr_data, &slic_regs->slic_addr_upper,
slic_regs->slic_addr_upper, upr->upr_data_h, FLUSH);
upr->upr_data_h, FLUSH);
} }
break; break;
case SLIC_UPR_RLSR: case SLIC_UPR_RLSR:
WRITE_REG64(adapter, slic_reg64_write(adapter, &slic_regs->slic_rlsr, upr->upr_data,
slic_regs->slic_rlsr, &slic_regs->slic_addr_upper, upr->upr_data_h,
upr->upr_data, FLUSH);
slic_regs->slic_addr_upper, upr->upr_data_h, FLUSH);
break; break;
case SLIC_UPR_RCONFIG: case SLIC_UPR_RCONFIG:
DBG_MSG("%s SLIC_UPR_RCONFIG!!!!\n", __func__); DBG_MSG("%s SLIC_UPR_RCONFIG!!!!\n", __func__);
DBG_MSG("WRITE_REG64 adapter[%p]\n" DBG_MSG("slic_reg64_write adapter[%p]\n"
" a->slic_regs[%p] slic_regs[%p]\n" " a->slic_regs[%p] slic_regs[%p]\n"
" &slic_rconfig[%p] &slic_addr_upper[%p]\n" " &slic_rconfig[%p] &slic_addr_upper[%p]\n"
" upr[%p]\n" " upr[%p]\n"
...@@ -3443,43 +3438,21 @@ static void slic_upr_start(struct adapter *adapter) ...@@ -3443,43 +3438,21 @@ static void slic_upr_start(struct adapter *adapter)
adapter, adapter->slic_regs, slic_regs, adapter, adapter->slic_regs, slic_regs,
&slic_regs->slic_rconfig, &slic_regs->slic_addr_upper, &slic_regs->slic_rconfig, &slic_regs->slic_addr_upper,
upr, upr->upr_data, upr->upr_data_h); upr, upr->upr_data, upr->upr_data_h);
WRITE_REG64(adapter, slic_reg64_write(adapter, &slic_regs->slic_rconfig,
slic_regs->slic_rconfig, upr->upr_data, &slic_regs->slic_addr_upper,
upr->upr_data, upr->upr_data_h, FLUSH);
slic_regs->slic_addr_upper, upr->upr_data_h, FLUSH);
break; break;
#if SLIC_DUMP_ENABLED #if SLIC_DUMP_ENABLED
case SLIC_UPR_DUMP: case SLIC_UPR_DUMP:
#if 0
DBG_MSG("%s SLIC_UPR_DUMP!!!!\n", __func__);
DBG_MSG("WRITE_REG64 adapter[%p]\n"
" upr_buffer[%x] upr_bufferh[%x]\n"
" upr_data[%x] upr_datah[%x]\n"
" cmdbuff[%p] cmdbuffP[%p]\n"
" dumpbuff[%p] dumpbuffP[%p]\n",
adapter, upr->upr_buffer, upr->upr_buffer_h,
upr->upr_data, upr->upr_data_h,
adapter->card->cmdbuffer,
(void *)adapter->card->cmdbuffer_phys,
adapter->card->dumpbuffer, (
void *)adapter->card->dumpbuffer_phys);
ptr1 = (char *)slic_regs;
ptr2 = (char *)(&slic_regs->slic_dump_cmd);
cmdoffset = ptr2 - ptr1;
DBG_MSG("slic_dump_cmd register offset [%x]\n", cmdoffset);
#endif
if (upr->upr_buffer || upr->upr_buffer_h) { if (upr->upr_buffer || upr->upr_buffer_h) {
WRITE_REG64(adapter, slic_reg64_write(adapter, &slic_regs->slic_dump_data,
slic_regs->slic_dump_data, upr->upr_buffer,
upr->upr_buffer, &slic_regs->slic_addr_upper,
slic_regs->slic_addr_upper, upr->upr_buffer_h, FLUSH);
upr->upr_buffer_h, FLUSH);
} }
WRITE_REG64(adapter, slic_reg64_write(adapter, &slic_regs->slic_dump_cmd,
slic_regs->slic_dump_cmd, upr->upr_data, slic_regs->slic_addr_upper,
upr->upr_data, upr->upr_data_h, FLUSH);
slic_regs->slic_addr_upper, upr->upr_data_h, FLUSH);
break; break;
#endif #endif
case SLIC_UPR_PING: case SLIC_UPR_PING:
...@@ -3749,11 +3722,10 @@ static int slic_rspqueue_init(struct adapter *adapter) ...@@ -3749,11 +3722,10 @@ static int slic_rspqueue_init(struct adapter *adapter)
(rspq->paddr[i] | SLIC_RSPQ_BUFSINPAGE), (rspq->paddr[i] | SLIC_RSPQ_BUFSINPAGE),
DONT_FLUSH); DONT_FLUSH);
} else { } else {
WRITE_REG64(adapter, slic_reg64_write(adapter, &slic_regs->slic_rbar64,
slic_regs->slic_rbar64, (rspq->paddr[i] | SLIC_RSPQ_BUFSINPAGE),
(rspq->paddr[i] | SLIC_RSPQ_BUFSINPAGE), &slic_regs->slic_addr_upper,
slic_regs->slic_addr_upper, paddrh, DONT_FLUSH);
paddrh, DONT_FLUSH);
} }
} }
rspq->offset = 0; rspq->offset = 0;
...@@ -3829,11 +3801,9 @@ static struct slic_rspbuf *slic_rspqueue_getnext(struct adapter *adapter) ...@@ -3829,11 +3801,9 @@ static struct slic_rspbuf *slic_rspqueue_getnext(struct adapter *adapter)
#endif #endif
} else { } else {
ASSERT(rspq->offset == SLIC_RSPQ_BUFSINPAGE); ASSERT(rspq->offset == SLIC_RSPQ_BUFSINPAGE);
WRITE_REG64(adapter, slic_reg64_write(adapter, &adapter->slic_regs->slic_rbar64,
adapter->slic_regs->slic_rbar64, (rspq->paddr[rspq->pageindex] | SLIC_RSPQ_BUFSINPAGE),
(rspq-> &adapter->slic_regs->slic_addr_upper, 0, DONT_FLUSH);
paddr[rspq->pageindex] | SLIC_RSPQ_BUFSINPAGE),
adapter->slic_regs->slic_addr_upper, 0, DONT_FLUSH);
rspq->pageindex = (++rspq->pageindex) % rspq->num_pages; rspq->pageindex = (++rspq->pageindex) % rspq->num_pages;
rspq->offset = 0; rspq->offset = 0;
rspq->rspbuf = (struct slic_rspbuf *) rspq->rspbuf = (struct slic_rspbuf *)
...@@ -4295,11 +4265,11 @@ retry_rcvqfill: ...@@ -4295,11 +4265,11 @@ retry_rcvqfill:
WRITE_REG(adapter->slic_regs->slic_hbar, WRITE_REG(adapter->slic_regs->slic_hbar,
(u32) paddrl, DONT_FLUSH); (u32) paddrl, DONT_FLUSH);
} else { } else {
WRITE_REG64(adapter, slic_reg64_write(adapter,
adapter->slic_regs->slic_hbar64, &adapter->slic_regs->slic_hbar64,
(u32) paddrl, paddrl,
adapter->slic_regs->slic_addr_upper, &adapter->slic_regs->slic_addr_upper,
(u32) paddrh, DONT_FLUSH); paddrh, DONT_FLUSH);
} }
if (rcvq->head) if (rcvq->head)
rcvq->tail->next = skb; rcvq->tail->next = skb;
...@@ -4353,11 +4323,9 @@ static u32 slic_rcvqueue_reinsert(struct adapter *adapter, struct sk_buff *skb) ...@@ -4353,11 +4323,9 @@ static u32 slic_rcvqueue_reinsert(struct adapter *adapter, struct sk_buff *skb)
WRITE_REG(adapter->slic_regs->slic_hbar, (u32) paddrl, WRITE_REG(adapter->slic_regs->slic_hbar, (u32) paddrl,
DONT_FLUSH); DONT_FLUSH);
} else { } else {
WRITE_REG64(adapter, slic_reg64_write(adapter, &adapter->slic_regs->slic_hbar64,
adapter->slic_regs->slic_hbar64, paddrl, &adapter->slic_regs->slic_addr_upper,
paddrl, paddrh, DONT_FLUSH);
adapter->slic_regs->slic_addr_upper,
paddrh, DONT_FLUSH);
} }
if (rcvq->head) if (rcvq->head)
rcvq->tail->next = skb; rcvq->tail->next = skb;
......
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