Commit 9528a458 authored by James Bottomley's avatar James Bottomley

Merge mulgrave.(none):/home/jejb/BK/linux-2.5

into mulgrave.(none):/home/jejb/BK/scsi-misc-2.7
parents 4576b4fa b6034f30
......@@ -484,7 +484,7 @@ static void i91uBuildSCB(HCS * pHCB, SCB * pSCB, Scsi_Cmnd * SCpnt)
dma_addr = dma_map_single(&pHCB->pci_dev->dev, SCpnt->sense_buffer,
SENSE_SIZE, DMA_FROM_DEVICE);
pSCB->SCB_SensePtr = cpu_to_le32((u32)dma_addr);
pSCB->SCB_SenseLen = SENSE_SIZE;
pSCB->SCB_SenseLen = cpu_to_le32(SENSE_SIZE);
SCpnt->SCp.ptr = (char *)(unsigned long)dma_addr;
pSCB->SCB_CDBLen = SCpnt->cmd_len;
......@@ -502,7 +502,7 @@ static void i91uBuildSCB(HCS * pHCB, SCB * pSCB, Scsi_Cmnd * SCpnt)
dma_addr = dma_map_single(&pHCB->pci_dev->dev, &pSCB->SCB_SGList[0],
sizeof(struct SG_Struc) * TOTAL_SG_ENTRY,
DMA_BIDIRECTIONAL);
pSCB->SCB_BufPtr = dma_addr;
pSCB->SCB_BufPtr = cpu_to_le32((u32)dma_addr);
SCpnt->SCp.dma_handle = dma_addr;
pSrbSG = (struct scatterlist *) SCpnt->request_buffer;
......@@ -512,8 +512,8 @@ static void i91uBuildSCB(HCS * pHCB, SCB * pSCB, Scsi_Cmnd * SCpnt)
pSCB->SCB_Flags |= SCF_SG; /* Turn on SG list flag */
for (i = 0, TotalLen = 0, pSG = &pSCB->SCB_SGList[0]; /* 1.01g */
i < pSCB->SCB_SGLen; i++, pSG++, pSrbSG++) {
pSG->SG_Ptr = (u32)sg_dma_address(pSrbSG);
TotalLen += pSG->SG_Len = (u32)sg_dma_len(pSrbSG);
pSG->SG_Ptr = cpu_to_le32((u32)sg_dma_address(pSrbSG));
TotalLen += pSG->SG_Len = cpu_to_le32((u32)sg_dma_len(pSrbSG));
}
pSCB->SCB_BufLen = (SCpnt->request_bufflen > TotalLen) ?
......@@ -523,8 +523,8 @@ static void i91uBuildSCB(HCS * pHCB, SCB * pSCB, Scsi_Cmnd * SCpnt)
SCpnt->request_bufflen,
SCpnt->sc_data_direction);
SCpnt->SCp.dma_handle = dma_addr;
pSCB->SCB_BufPtr = (u32)dma_addr;
pSCB->SCB_BufLen = (u32)SCpnt->request_bufflen;
pSCB->SCB_BufPtr = cpu_to_le32((u32)dma_addr);
pSCB->SCB_BufLen = cpu_to_le32((u32)SCpnt->request_bufflen);
pSCB->SCB_SGLen = 0;
} else {
pSCB->SCB_BufLen = 0;
......
......@@ -420,7 +420,7 @@ static int __devinit inia100_probe_one(struct pci_dev *pdev,
struct Scsi_Host *shost;
ORC_HCS *pHCB;
unsigned long port, bios;
int ok = -ENODEV;
int error = -ENODEV;
u32 sz;
unsigned long dBiosAdr;
char *pbBiosAdr;
......@@ -433,17 +433,17 @@ static int __devinit inia100_probe_one(struct pci_dev *pdev,
goto out_disable_device;
}
pci_set_master(pdev);
port = pci_resource_start(pdev, 0);
if (!request_region(pHCB->HCS_Base, 256, "inia100")) {
printk(KERN_WARNING "inia100: io port 0x%x, is busy.\n",
pHCB->HCS_Base);
goto out_disable_device; /* XXX: undo init_orchid() ?? */
if (!request_region(port, 256, "inia100")) {
printk(KERN_WARNING "inia100: io port 0x%lx, is busy.\n", port);
goto out_disable_device;
}
/* <02> read from base address + 0x50 offset to get the bios balue. */
bios = ORC_RDWORD(port, 0x50);
pci_set_master(pdev);
shost = scsi_host_alloc(&inia100_template, sizeof(ORC_HCS));
if (!shost)
......@@ -460,7 +460,8 @@ static int __devinit inia100_probe_one(struct pci_dev *pdev,
/* Get total memory needed for SCB */
sz = ORC_MAXQUEUE * sizeof(ORC_SCB);
pHCB->HCS_virScbArray = pci_alloc_consistent(pdev, sz, &pHCB->HCS_physScbArray);
pHCB->HCS_virScbArray = pci_alloc_consistent(pdev, sz,
&pHCB->HCS_physScbArray);
if (!pHCB->HCS_virScbArray) {
printk("inia100: SCB memory allocation error\n");
goto out_host_put;
......@@ -469,7 +470,8 @@ static int __devinit inia100_probe_one(struct pci_dev *pdev,
/* Get total memory needed for ESCB */
sz = ORC_MAXQUEUE * sizeof(ESCB);
pHCB->HCS_virEscbArray = pci_alloc_consistent(pdev, sz, &pHCB->HCS_physEscbArray);
pHCB->HCS_virEscbArray = pci_alloc_consistent(pdev, sz,
&pHCB->HCS_physEscbArray);
if (!pHCB->HCS_virEscbArray) {
printk("inia100: ESCB memory allocation error\n");
goto out_free_scb_array;
......@@ -490,21 +492,23 @@ static int __devinit inia100_probe_one(struct pci_dev *pdev,
shost->unique_id = shost->io_port;
shost->max_id = pHCB->HCS_MaxTar;
shost->max_lun = 16;
shost->irq = pHCB->HCS_Intr;
shost->irq = pHCB->HCS_Intr = pdev->irq;
shost->this_id = pHCB->HCS_SCSI_ID; /* Assign HCS index */
shost->sg_tablesize = TOTAL_SG_ENTRY;
/* Initial orc chip */
ok = request_irq(pHCB->HCS_Intr, inia100_intr, SA_SHIRQ, "inia100", shost);
if (ok < 0) {
printk(KERN_WARNING "inia100: unable to get irq %d\n", pHCB->HCS_Intr);
error = request_irq(pdev->irq, inia100_intr, SA_SHIRQ,
"inia100", shost);
if (error < 0) {
printk(KERN_WARNING "inia100: unable to get irq %d\n",
pdev->irq);
goto out_free_escb_array;
}
pci_set_drvdata(pdev, shost);
ok = scsi_add_host(shost, &pdev->dev);
if (!ok)
error = scsi_add_host(shost, &pdev->dev);
if (error)
goto out_free_irq;
scsi_scan_host(shost);
......@@ -521,11 +525,11 @@ static int __devinit inia100_probe_one(struct pci_dev *pdev,
out_host_put:
scsi_host_put(shost);
out_release_region:
release_region(pHCB->HCS_Base, 256);
release_region(port, 256);
out_disable_device:
pci_disable_device(pdev);
out:
return ok;
return error;
}
static void __devexit inia100_remove_one(struct pci_dev *pdev)
......
......@@ -667,10 +667,5 @@ static inline struct Scsi_Host *scsi_host_hn_get(unsigned short hostno)
}
#endif
/* for Kernel 2.6 */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
# define __devinitdata /* */
#endif
#endif /* _NSP32_H */
/* end */
......@@ -173,7 +173,7 @@ static inline void nsp32_index_write4(unsigned int base,
/*==============================================*/
static inline unsigned char nsp32_mmio_index_read1(unsigned int base,
static inline unsigned char nsp32_mmio_index_read1(unsigned long base,
unsigned int reg)
{
volatile unsigned short *index_ptr, *data_ptr;
......@@ -185,7 +185,7 @@ static inline unsigned char nsp32_mmio_index_read1(unsigned int base,
return readb(data_ptr);
}
static inline void nsp32_mmio_index_write1(unsigned int base,
static inline void nsp32_mmio_index_write1(unsigned long base,
unsigned int reg,
unsigned char val)
{
......@@ -198,7 +198,7 @@ static inline void nsp32_mmio_index_write1(unsigned int base,
writeb(val, data_ptr );
}
static inline unsigned short nsp32_mmio_index_read2(unsigned int base,
static inline unsigned short nsp32_mmio_index_read2(unsigned long base,
unsigned int reg)
{
volatile unsigned short *index_ptr, *data_ptr;
......@@ -210,7 +210,7 @@ static inline unsigned short nsp32_mmio_index_read2(unsigned int base,
return le16_to_cpu(readw(data_ptr));
}
static inline void nsp32_mmio_index_write2(unsigned int base,
static inline void nsp32_mmio_index_write2(unsigned long base,
unsigned int reg,
unsigned short val)
{
......
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