X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2FNCR53C9x.c;h=bdc6bb262bced9c235234364f84f7b2707abd841;hb=97d41e90fe61399b99d74820cb7f2d6e0fbac91d;hp=26146a4b67b8dd4628f53d68e330aad9064ff799;hpb=0ad3a96f8ad910ecf87a25ec69ed360b284dee2e;p=pandora-kernel.git diff --git a/drivers/scsi/NCR53C9x.c b/drivers/scsi/NCR53C9x.c index 26146a4b67b8..bdc6bb262bce 100644 --- a/drivers/scsi/NCR53C9x.c +++ b/drivers/scsi/NCR53C9x.c @@ -23,7 +23,6 @@ #include -#include #include #include #include @@ -529,7 +528,7 @@ void esp_bootup_reset(struct NCR_ESP *esp, struct ESP_regs *eregs) /* Allocate structure and insert basic data such as SCSI chip frequency * data and a pointer to the device */ -struct NCR_ESP* esp_allocate(Scsi_Host_Template *tpnt, void *esp_dev) +struct NCR_ESP* esp_allocate(struct scsi_host_template *tpnt, void *esp_dev) { struct NCR_ESP *esp, *elink; struct Scsi_Host *esp_host; @@ -912,7 +911,7 @@ static void esp_get_dmabufs(struct NCR_ESP *esp, Scsi_Cmnd *sp) sp->SCp.ptr = (char *) virt_to_phys(sp->request_buffer); } else { - sp->SCp.buffer = (struct scatterlist *) sp->buffer; + sp->SCp.buffer = (struct scatterlist *) sp->request_buffer; sp->SCp.buffers_residual = sp->use_sg - 1; sp->SCp.this_residual = sp->SCp.buffer->length; if (esp->dma_mmu_get_scsi_sgl) @@ -1006,7 +1005,7 @@ static void esp_exec_cmd(struct NCR_ESP *esp) struct ESP_regs *eregs = esp->eregs; struct esp_device *esp_dev; Scsi_Cmnd *SCptr; - Scsi_Device *SDptr; + struct scsi_device *SDptr; volatile unchar *cmdp = esp->esp_command; unsigned char the_esp_command; int lun, target; @@ -1687,7 +1686,7 @@ static inline int reconnect_lun(struct NCR_ESP *esp, struct ESP_regs *eregs) static inline void esp_connect(struct NCR_ESP *esp, struct ESP_regs *eregs, Scsi_Cmnd *sp) { - Scsi_Device *dp = sp->device; + struct scsi_device *dp = sp->device; struct esp_device *esp_dev = dp->hostdata; if(esp->prev_soff != esp_dev->sync_max_offset || @@ -1799,6 +1798,7 @@ static int esp_do_data(struct NCR_ESP *esp, struct ESP_regs *eregs) */ int oldphase, i = 0; /* or where we left off last time ?? esp->current_data ?? */ int fifocnt = 0; + unsigned char *p = phys_to_virt((unsigned long)SCptr->SCp.ptr); oldphase = esp_read(eregs->esp_status) & ESP_STAT_PMASK; @@ -1860,7 +1860,7 @@ static int esp_do_data(struct NCR_ESP *esp, struct ESP_regs *eregs) /* read fifo */ for(j=0;jSCp.ptr[i++] = esp_read(eregs->esp_fdata); + p[i++] = esp_read(eregs->esp_fdata); ESPDATA(("(%d) ", i)); @@ -1882,7 +1882,7 @@ static int esp_do_data(struct NCR_ESP *esp, struct ESP_regs *eregs) /* fill fifo */ for(j=0;jesp_fdata, SCptr->SCp.ptr[i++]); + esp_write(eregs->esp_fdata, p[i++]); /* how many left if this goes out ?? */ hmuch -= this_count; @@ -2152,29 +2152,23 @@ static int esp_do_data_finale(struct NCR_ESP *esp, */ static int esp_should_clear_sync(Scsi_Cmnd *sp) { - unchar cmd1 = sp->cmnd[0]; - unchar cmd2 = sp->data_cmnd[0]; + unchar cmd = sp->cmnd[0]; /* These cases are for spinning up a disk and * waiting for that spinup to complete. */ - if(cmd1 == START_STOP || - cmd2 == START_STOP) + if(cmd == START_STOP) return 0; - if(cmd1 == TEST_UNIT_READY || - cmd2 == TEST_UNIT_READY) + if(cmd == TEST_UNIT_READY) return 0; /* One more special case for SCSI tape drives, * this is what is used to probe the device for * completion of a rewind or tape load operation. */ - if(sp->device->type == TYPE_TAPE) { - if(cmd1 == MODE_SENSE || - cmd2 == MODE_SENSE) - return 0; - } + if(sp->device->type == TYPE_TAPE && cmd == MODE_SENSE) + return 0; return 1; } @@ -3605,7 +3599,7 @@ out: } #endif -int esp_slave_alloc(Scsi_Device *SDptr) +int esp_slave_alloc(struct scsi_device *SDptr) { struct esp_device *esp_dev = kmalloc(sizeof(struct esp_device), GFP_ATOMIC); @@ -3617,7 +3611,7 @@ int esp_slave_alloc(Scsi_Device *SDptr) return 0; } -void esp_slave_destroy(Scsi_Device *SDptr) +void esp_slave_destroy(struct scsi_device *SDptr) { struct NCR_ESP *esp = (struct NCR_ESP *) SDptr->host->hostdata;