Staging: slicoss: Remove explicit arch dependencies
Remove explicit arch dependencies Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
11f05c7715
commit
1033f1f7ef
|
@ -515,14 +515,16 @@ struct adapter {
|
||||||
(largestat) += ((newstat) - (oldstat)); \
|
(largestat) += ((newstat) - (oldstat)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_X86_64) || defined(CONFIG_IA64)
|
#if BITS_PER_LONG == 64
|
||||||
#define SLIC_GET_ADDR_LOW(_addr) (u32)((u64)(_addr) & \
|
#define SLIC_GET_ADDR_LOW(_addr) (u32)((u64)(_addr) & \
|
||||||
0x00000000FFFFFFFF)
|
0x00000000FFFFFFFF)
|
||||||
#define SLIC_GET_ADDR_HIGH(_addr) (u32)(((u64)(_addr) >> 32) & \
|
#define SLIC_GET_ADDR_HIGH(_addr) (u32)(((u64)(_addr) >> 32) & \
|
||||||
0x00000000FFFFFFFF)
|
0x00000000FFFFFFFF)
|
||||||
#else
|
#elif BITS_PER_LONG == 32
|
||||||
#define SLIC_GET_ADDR_LOW(_addr) (u32)_addr
|
#define SLIC_GET_ADDR_LOW(_addr) (u32)(_addr)
|
||||||
#define SLIC_GET_ADDR_HIGH(_addr) (u32)0
|
#define SLIC_GET_ADDR_HIGH(_addr) (u32)0
|
||||||
|
#else
|
||||||
|
#error BITS_PER_LONG must be 32 or 64
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define FLUSH true
|
#define FLUSH true
|
||||||
|
|
|
@ -1099,19 +1099,17 @@ static void slic_link_upr_complete(struct adapter *adapter, u32 isr)
|
||||||
struct slic_shmem *pshmem;
|
struct slic_shmem *pshmem;
|
||||||
|
|
||||||
pshmem = (struct slic_shmem *)adapter->phys_shmem;
|
pshmem = (struct slic_shmem *)adapter->phys_shmem;
|
||||||
#if defined(CONFIG_X86_64)
|
#if BITS_PER_LONG == 64
|
||||||
slic_upr_queue_request(adapter,
|
slic_upr_queue_request(adapter,
|
||||||
SLIC_UPR_RLSR,
|
SLIC_UPR_RLSR,
|
||||||
SLIC_GET_ADDR_LOW(&pshmem->linkstatus),
|
SLIC_GET_ADDR_LOW(&pshmem->linkstatus),
|
||||||
SLIC_GET_ADDR_HIGH(&pshmem->linkstatus),
|
SLIC_GET_ADDR_HIGH(&pshmem->linkstatus),
|
||||||
0, 0);
|
0, 0);
|
||||||
#elif defined(CONFIG_X86)
|
#else
|
||||||
slic_upr_queue_request(adapter,
|
slic_upr_queue_request(adapter,
|
||||||
SLIC_UPR_RLSR,
|
SLIC_UPR_RLSR,
|
||||||
(u32) &pshmem->linkstatus,
|
(u32) &pshmem->linkstatus,
|
||||||
SLIC_GET_ADDR_HIGH(pshmem), 0, 0);
|
SLIC_GET_ADDR_HIGH(pshmem), 0, 0);
|
||||||
#else
|
|
||||||
Stop Compilation;
|
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1327,7 +1325,7 @@ static ushort slic_eeprom_cksum(char *m, int len)
|
||||||
s_util.s = 0;
|
s_util.s = 0;
|
||||||
|
|
||||||
w = (u16 *)m;
|
w = (u16 *)m;
|
||||||
#ifdef CONFIG_X86_64
|
#if BITS_PER_LONG == 64
|
||||||
w_int = (u32) ((ulong) w & 0x00000000FFFFFFFF);
|
w_int = (u32) ((ulong) w & 0x00000000FFFFFFFF);
|
||||||
#else
|
#else
|
||||||
w_int = (u32) (w);
|
w_int = (u32) (w);
|
||||||
|
@ -1439,11 +1437,15 @@ static int slic_rspqueue_init(struct adapter *adapter)
|
||||||
slic_rspqueue_free(adapter);
|
slic_rspqueue_free(adapter);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
/* FIXME:
|
||||||
|
* do we really need this assertions (4K PAGE_SIZE aligned addr)? */
|
||||||
|
#if 0
|
||||||
#ifndef CONFIG_X86_64
|
#ifndef CONFIG_X86_64
|
||||||
ASSERT(((u32) rspq->vaddr[i] & 0xFFFFF000) ==
|
ASSERT(((u32) rspq->vaddr[i] & 0xFFFFF000) ==
|
||||||
(u32) rspq->vaddr[i]);
|
(u32) rspq->vaddr[i]);
|
||||||
ASSERT(((u32) rspq->paddr[i] & 0xFFFFF000) ==
|
ASSERT(((u32) rspq->paddr[i] & 0xFFFFF000) ==
|
||||||
(u32) rspq->paddr[i]);
|
(u32) rspq->paddr[i]);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
memset(rspq->vaddr[i], 0, PAGE_SIZE);
|
memset(rspq->vaddr[i], 0, PAGE_SIZE);
|
||||||
|
|
||||||
|
@ -1473,13 +1475,13 @@ static struct slic_rspbuf *slic_rspqueue_getnext(struct adapter *adapter)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
buf = rspq->rspbuf;
|
buf = rspq->rspbuf;
|
||||||
#ifndef CONFIG_X86_64
|
#if BITS_PER_LONG == 32
|
||||||
ASSERT((buf->status & 0xFFFFFFE0) == 0);
|
ASSERT((buf->status & 0xFFFFFFE0) == 0);
|
||||||
#endif
|
#endif
|
||||||
ASSERT(buf->hosthandle);
|
ASSERT(buf->hosthandle);
|
||||||
if (++rspq->offset < SLIC_RSPQ_BUFSINPAGE) {
|
if (++rspq->offset < SLIC_RSPQ_BUFSINPAGE) {
|
||||||
rspq->rspbuf++;
|
rspq->rspbuf++;
|
||||||
#ifndef CONFIG_X86_64
|
#if BITS_PER_LONG == 32
|
||||||
ASSERT(((u32) rspq->rspbuf & 0xFFFFFFE0) ==
|
ASSERT(((u32) rspq->rspbuf & 0xFFFFFFE0) ==
|
||||||
(u32) rspq->rspbuf);
|
(u32) rspq->rspbuf);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1492,12 +1494,12 @@ static struct slic_rspbuf *slic_rspqueue_getnext(struct adapter *adapter)
|
||||||
rspq->offset = 0;
|
rspq->offset = 0;
|
||||||
rspq->rspbuf = (struct slic_rspbuf *)
|
rspq->rspbuf = (struct slic_rspbuf *)
|
||||||
rspq->vaddr[rspq->pageindex];
|
rspq->vaddr[rspq->pageindex];
|
||||||
#ifndef CONFIG_X86_64
|
#if BITS_PER_LONG == 32
|
||||||
ASSERT(((u32) rspq->rspbuf & 0xFFFFF000) ==
|
ASSERT(((u32) rspq->rspbuf & 0xFFFFF000) ==
|
||||||
(u32) rspq->rspbuf);
|
(u32) rspq->rspbuf);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#ifndef CONFIG_X86_64
|
#if BITS_PER_LONG == 32
|
||||||
ASSERT(((u32) buf & 0xFFFFFFE0) == (u32) buf);
|
ASSERT(((u32) buf & 0xFFFFFFE0) == (u32) buf);
|
||||||
#endif
|
#endif
|
||||||
return buf;
|
return buf;
|
||||||
|
@ -1538,7 +1540,7 @@ static u32 *slic_cmdqmem_addpage(struct adapter *adapter)
|
||||||
&cmdqmem->dma_pages[cmdqmem->pagecnt]);
|
&cmdqmem->dma_pages[cmdqmem->pagecnt]);
|
||||||
if (!pageaddr)
|
if (!pageaddr)
|
||||||
return NULL;
|
return NULL;
|
||||||
#ifndef CONFIG_X86_64
|
#if BITS_PER_LONG == 32
|
||||||
ASSERT(((u32) pageaddr & 0xFFFFF000) == (u32) pageaddr);
|
ASSERT(((u32) pageaddr & 0xFFFFF000) == (u32) pageaddr);
|
||||||
#endif
|
#endif
|
||||||
cmdqmem->pages[cmdqmem->pagecnt] = pageaddr;
|
cmdqmem->pages[cmdqmem->pagecnt] = pageaddr;
|
||||||
|
@ -1650,7 +1652,7 @@ static int slic_cmdq_init(struct adapter *adapter)
|
||||||
adapter->slic_handle_ix = 1;
|
adapter->slic_handle_ix = 1;
|
||||||
for (i = 0; i < SLIC_CMDQ_INITPAGES; i++) {
|
for (i = 0; i < SLIC_CMDQ_INITPAGES; i++) {
|
||||||
pageaddr = slic_cmdqmem_addpage(adapter);
|
pageaddr = slic_cmdqmem_addpage(adapter);
|
||||||
#ifndef CONFIG_X86_64
|
#if BITS_PER_LONG == 32
|
||||||
ASSERT(((u32) pageaddr & 0xFFFFF000) == (u32) pageaddr);
|
ASSERT(((u32) pageaddr & 0xFFFFF000) == (u32) pageaddr);
|
||||||
#endif
|
#endif
|
||||||
if (!pageaddr) {
|
if (!pageaddr) {
|
||||||
|
@ -2447,18 +2449,16 @@ static void slic_link_event_handler(struct adapter *adapter)
|
||||||
|
|
||||||
pshmem = (struct slic_shmem *)adapter->phys_shmem;
|
pshmem = (struct slic_shmem *)adapter->phys_shmem;
|
||||||
|
|
||||||
#if defined(CONFIG_X86_64)
|
#if BITS_PER_LONG == 64
|
||||||
status = slic_upr_request(adapter,
|
status = slic_upr_request(adapter,
|
||||||
SLIC_UPR_RLSR,
|
SLIC_UPR_RLSR,
|
||||||
SLIC_GET_ADDR_LOW(&pshmem->linkstatus),
|
SLIC_GET_ADDR_LOW(&pshmem->linkstatus),
|
||||||
SLIC_GET_ADDR_HIGH(&pshmem->linkstatus),
|
SLIC_GET_ADDR_HIGH(&pshmem->linkstatus),
|
||||||
0, 0);
|
0, 0);
|
||||||
#elif defined(CONFIG_X86)
|
#else
|
||||||
status = slic_upr_request(adapter, SLIC_UPR_RLSR,
|
status = slic_upr_request(adapter, SLIC_UPR_RLSR,
|
||||||
(u32) &pshmem->linkstatus, /* no 4GB wrap guaranteed */
|
(u32) &pshmem->linkstatus, /* no 4GB wrap guaranteed */
|
||||||
0, 0, 0);
|
0, 0, 0);
|
||||||
#else
|
|
||||||
Stop compilation;
|
|
||||||
#endif
|
#endif
|
||||||
ASSERT(status == 0);
|
ASSERT(status == 0);
|
||||||
}
|
}
|
||||||
|
@ -2575,14 +2575,12 @@ static void slic_xmit_build_request(struct adapter *adapter,
|
||||||
ihcmd->u.slic_buffers.bufs[0].paddrl = SLIC_GET_ADDR_LOW(phys_addr);
|
ihcmd->u.slic_buffers.bufs[0].paddrl = SLIC_GET_ADDR_LOW(phys_addr);
|
||||||
ihcmd->u.slic_buffers.bufs[0].paddrh = SLIC_GET_ADDR_HIGH(phys_addr);
|
ihcmd->u.slic_buffers.bufs[0].paddrh = SLIC_GET_ADDR_HIGH(phys_addr);
|
||||||
ihcmd->u.slic_buffers.bufs[0].length = skb->len;
|
ihcmd->u.slic_buffers.bufs[0].length = skb->len;
|
||||||
#if defined(CONFIG_X86_64)
|
#if BITS_PER_LONG == 64
|
||||||
hcmd->cmdsize = (u32) ((((u64)&ihcmd->u.slic_buffers.bufs[1] -
|
hcmd->cmdsize = (u32) ((((u64)&ihcmd->u.slic_buffers.bufs[1] -
|
||||||
(u64) hcmd) + 31) >> 5);
|
(u64) hcmd) + 31) >> 5);
|
||||||
#elif defined(CONFIG_X86)
|
#else
|
||||||
hcmd->cmdsize = ((((u32) &ihcmd->u.slic_buffers.bufs[1] -
|
hcmd->cmdsize = ((((u32) &ihcmd->u.slic_buffers.bufs[1] -
|
||||||
(u32) hcmd) + 31) >> 5);
|
(u32) hcmd) + 31) >> 5);
|
||||||
#else
|
|
||||||
Stop Compilation;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3078,16 +3076,14 @@ static int slic_if_init(struct adapter *adapter)
|
||||||
spin_lock_irqsave(&adapter->bit64reglock.lock,
|
spin_lock_irqsave(&adapter->bit64reglock.lock,
|
||||||
adapter->bit64reglock.flags);
|
adapter->bit64reglock.flags);
|
||||||
|
|
||||||
#if defined(CONFIG_X86_64)
|
#if BITS_PER_LONG == 64
|
||||||
slic_reg32_write(&slic_regs->slic_addr_upper,
|
slic_reg32_write(&slic_regs->slic_addr_upper,
|
||||||
SLIC_GET_ADDR_HIGH(&pshmem->isr), DONT_FLUSH);
|
SLIC_GET_ADDR_HIGH(&pshmem->isr), DONT_FLUSH);
|
||||||
slic_reg32_write(&slic_regs->slic_isp,
|
slic_reg32_write(&slic_regs->slic_isp,
|
||||||
SLIC_GET_ADDR_LOW(&pshmem->isr), FLUSH);
|
SLIC_GET_ADDR_LOW(&pshmem->isr), FLUSH);
|
||||||
#elif defined(CONFIG_X86)
|
#else
|
||||||
slic_reg32_write(&slic_regs->slic_addr_upper, 0, DONT_FLUSH);
|
slic_reg32_write(&slic_regs->slic_addr_upper, 0, DONT_FLUSH);
|
||||||
slic_reg32_write(&slic_regs->slic_isp, (u32)&pshmem->isr, FLUSH);
|
slic_reg32_write(&slic_regs->slic_isp, (u32)&pshmem->isr, FLUSH);
|
||||||
#else
|
|
||||||
Stop Compilations
|
|
||||||
#endif
|
#endif
|
||||||
spin_unlock_irqrestore(&adapter->bit64reglock.lock,
|
spin_unlock_irqrestore(&adapter->bit64reglock.lock,
|
||||||
adapter->bit64reglock.flags);
|
adapter->bit64reglock.flags);
|
||||||
|
|
Loading…
Reference in New Issue