Commit 334e9d00 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Linus Torvalds

[PATCH] M68k SCSI driver updates

M68k SCSI drivers: update for the changes in 2.5.60:
  o Replace `->lun'    by `->device->lun'
  o Replace `->target' by `->device->id'
  o Replace `->host'   by `->device->host'
parent 55a248c7
This diff is collapsed.
......@@ -1099,7 +1099,7 @@ static void esp_exec_cmd(struct NCR_ESP *esp)
* disconnect.
*/
ESPMISC(("esp: Selecting device for first time. target=%d "
"lun=%d\n", target, SCptr->lun));
"lun=%d\n", target, SCptr->device->lun));
if(!SDptr->borken && !esp_dev->disconnect)
esp_dev->disconnect = 1;
......@@ -1173,7 +1173,7 @@ static void esp_exec_cmd(struct NCR_ESP *esp)
if(((SDptr->scsi_level < 3) && (SDptr->type != TYPE_TAPE)) ||
toshiba_cdrom_hwbug_wkaround || SDptr->borken) {
ESPMISC((KERN_INFO "esp%d: Disabling DISCONNECT for target %d "
"lun %d\n", esp->esp_id, SCptr->target, SCptr->lun));
"lun %d\n", esp->esp_id, SCptr->device->id, SCptr->device->lun));
esp_dev->disconnect = 0;
*cmdp++ = IDENTIFY(0, lun);
} else {
......@@ -1255,8 +1255,8 @@ int esp_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
esp->dma_led_on(esp);
/* We use the scratch area. */
ESPQUEUE(("esp_queue: target=%d lun=%d ", SCpnt->target, SCpnt->lun));
ESPDISC(("N<%02x,%02x>", SCpnt->target, SCpnt->lun));
ESPQUEUE(("esp_queue: target=%d lun=%d ", SCpnt->device->id, SCpnt->lun));
ESPDISC(("N<%02x,%02x>", SCpnt->device->id, SCpnt->lun));
esp_get_dmabufs(esp, SCpnt);
esp_save_pointers(esp, SCpnt); /* FIXME for tag queueing */
......@@ -2235,7 +2235,7 @@ static int esp_do_freebus(struct NCR_ESP *esp, struct ESP_regs *eregs)
* state.
*/
ESPMISC(("esp: Status <%d> for target %d lun %d\n",
SCptr->SCp.Status, SCptr->target, SCptr->lun));
SCptr->SCp.Status, SCptr->device->id, SCptr->device->lun));
/* But don't do this when spinning up a disk at
* boot time while we poll for completion as it
......@@ -2246,14 +2246,14 @@ static int esp_do_freebus(struct NCR_ESP *esp, struct ESP_regs *eregs)
if(esp_should_clear_sync(SCptr) != 0)
esp_dev->sync = 0;
}
ESPDISC(("F<%02x,%02x>", SCptr->target, SCptr->lun));
ESPDISC(("F<%02x,%02x>", SCptr->device->id, SCptr->device->lun));
esp_done(esp, ((SCptr->SCp.Status & 0xff) |
((SCptr->SCp.Message & 0xff)<<8) |
(DID_OK << 16)));
} else if(esp->prevmsgin == DISCONNECT) {
/* Normal disconnect. */
esp_cmd(esp, eregs, ESP_CMD_ESEL);
ESPDISC(("D<%02x,%02x>", SCptr->target, SCptr->lun));
ESPDISC(("D<%02x,%02x>", SCptr->device->id, SCptr->device->lun));
append_SC(&esp->disconnected_SC, SCptr);
esp->current_SC = NULL;
if(esp->issue_SC)
......@@ -2811,7 +2811,7 @@ static int esp_select_complete(struct NCR_ESP *esp, struct ESP_regs *eregs)
/* Else, there really isn't anyone there. */
ESPMISC(("esp: selection failure, maybe nobody there?\n"));
ESPMISC(("esp: target %d lun %d\n",
SCptr->target, SCptr->lun));
SCptr->device->id, SCptr->device->lun));
esp_done(esp, (DID_BAD_TARGET << 16));
}
return do_intr_end;
......@@ -3084,7 +3084,7 @@ static int check_multibyte_msg(struct NCR_ESP *esp,
ESPSDTR(("soff=%2x stp=%2x cfg3=%2x\n",
esp_dev->sync_max_offset,
esp_dev->sync_min_period,
esp->config3[SCptr->target]));
esp->config3[SCptr->device->id]));
esp->snip = 0;
} else if(esp_dev->sync_max_offset) {
......
......@@ -52,7 +52,7 @@ static int dma_setup (Scsi_Cmnd *cmd, int dir_in)
{
unsigned short cntr = CNTR_PDMD | CNTR_INTEN;
unsigned long addr = virt_to_bus(cmd->SCp.ptr);
struct Scsi_Host *instance = cmd->host;
struct Scsi_Host *instance = cmd->device->host;
/* don't allow DMA if the physical address is bad */
if (addr & A2091_XFER_MASK ||
......@@ -102,12 +102,12 @@ static int dma_setup (Scsi_Cmnd *cmd, int dir_in)
cntr |= CNTR_DDIR;
/* remember direction */
HDATA(cmd->host)->dma_dir = dir_in;
HDATA(cmd->device->host)->dma_dir = dir_in;
DMA(cmd->host)->CNTR = cntr;
DMA(cmd->device->host)->CNTR = cntr;
/* setup DMA *physical* address */
DMA(cmd->host)->ACR = addr;
DMA(cmd->device->host)->ACR = addr;
if (dir_in){
/* invalidate any cache */
......@@ -117,7 +117,7 @@ static int dma_setup (Scsi_Cmnd *cmd, int dir_in)
cache_push (addr, cmd->SCp.this_residual);
}
/* start DMA */
DMA(cmd->host)->ST_DMA = 1;
DMA(cmd->device->host)->ST_DMA = 1;
/* return success */
return 0;
......
This diff is collapsed.
......@@ -823,7 +823,7 @@ int atari_scsi_bus_reset(Scsi_Cmnd *cmd)
{
int rv;
struct NCR5380_hostdata *hostdata =
(struct NCR5380_hostdata *)cmd->host->hostdata;
(struct NCR5380_hostdata *)cmd->device->host->hostdata;
/* For doing the reset, SCSI interrupts must be disabled first,
* since the 5380 raises its IRQ line while _RST is active and we
......
......@@ -62,61 +62,62 @@ static int dma_setup (Scsi_Cmnd *cmd, int dir_in)
static int scsi_alloc_out_of_range = 0;
/* use bounce buffer if the physical address is bad */
if (addr & HDATA(cmd->host)->dma_xfer_mask ||
if (addr & HDATA(cmd->device->host)->dma_xfer_mask ||
(!dir_in && mm_end_of_chunk (addr, cmd->SCp.this_residual)))
{
HDATA(cmd->host)->dma_bounce_len = (cmd->SCp.this_residual + 511)
HDATA(cmd->device->host)->dma_bounce_len = (cmd->SCp.this_residual + 511)
& ~0x1ff;
if( !scsi_alloc_out_of_range ) {
HDATA(cmd->host)->dma_bounce_buffer =
kmalloc (HDATA(cmd->host)->dma_bounce_len, GFP_KERNEL);
HDATA(cmd->host)->dma_buffer_pool = BUF_SCSI_ALLOCED;
HDATA(cmd->device->host)->dma_bounce_buffer =
kmalloc (HDATA(cmd->device->host)->dma_bounce_len, GFP_KERNEL);
HDATA(cmd->device->host)->dma_buffer_pool = BUF_SCSI_ALLOCED;
}
if ( scsi_alloc_out_of_range || !HDATA(cmd->host)->dma_bounce_buffer) {
HDATA(cmd->host)->dma_bounce_buffer =
amiga_chip_alloc(HDATA(cmd->host)->dma_bounce_len,
if (scsi_alloc_out_of_range ||
!HDATA(cmd->device->host)->dma_bounce_buffer) {
HDATA(cmd->device->host)->dma_bounce_buffer =
amiga_chip_alloc(HDATA(cmd->device->host)->dma_bounce_len,
"GVP II SCSI Bounce Buffer");
if(!HDATA(cmd->host)->dma_bounce_buffer)
if(!HDATA(cmd->device->host)->dma_bounce_buffer)
{
HDATA(cmd->host)->dma_bounce_len = 0;
HDATA(cmd->device->host)->dma_bounce_len = 0;
return 1;
}
HDATA(cmd->host)->dma_buffer_pool = BUF_CHIP_ALLOCED;
HDATA(cmd->device->host)->dma_buffer_pool = BUF_CHIP_ALLOCED;
}
/* check if the address of the bounce buffer is OK */
addr = virt_to_bus(HDATA(cmd->host)->dma_bounce_buffer);
addr = virt_to_bus(HDATA(cmd->device->host)->dma_bounce_buffer);
if (addr & HDATA(cmd->host)->dma_xfer_mask) {
if (addr & HDATA(cmd->device->host)->dma_xfer_mask) {
/* fall back to Chip RAM if address out of range */
if( HDATA(cmd->host)->dma_buffer_pool == BUF_SCSI_ALLOCED) {
kfree (HDATA(cmd->host)->dma_bounce_buffer);
if( HDATA(cmd->device->host)->dma_buffer_pool == BUF_SCSI_ALLOCED) {
kfree (HDATA(cmd->device->host)->dma_bounce_buffer);
scsi_alloc_out_of_range = 1;
} else {
amiga_chip_free (HDATA(cmd->host)->dma_bounce_buffer);
amiga_chip_free (HDATA(cmd->device->host)->dma_bounce_buffer);
}
HDATA(cmd->host)->dma_bounce_buffer =
amiga_chip_alloc(HDATA(cmd->host)->dma_bounce_len,
HDATA(cmd->device->host)->dma_bounce_buffer =
amiga_chip_alloc(HDATA(cmd->device->host)->dma_bounce_len,
"GVP II SCSI Bounce Buffer");
if(!HDATA(cmd->host)->dma_bounce_buffer)
if(!HDATA(cmd->device->host)->dma_bounce_buffer)
{
HDATA(cmd->host)->dma_bounce_len = 0;
HDATA(cmd->device->host)->dma_bounce_len = 0;
return 1;
}
addr = virt_to_bus(HDATA(cmd->host)->dma_bounce_buffer);
HDATA(cmd->host)->dma_buffer_pool = BUF_CHIP_ALLOCED;
addr = virt_to_bus(HDATA(cmd->device->host)->dma_bounce_buffer);
HDATA(cmd->device->host)->dma_buffer_pool = BUF_CHIP_ALLOCED;
}
if (!dir_in) {
/* copy to bounce buffer for a write */
memcpy (HDATA(cmd->host)->dma_bounce_buffer,
memcpy (HDATA(cmd->device->host)->dma_bounce_buffer,
cmd->SCp.ptr, cmd->SCp.this_residual);
}
}
......@@ -125,11 +126,11 @@ static int dma_setup (Scsi_Cmnd *cmd, int dir_in)
if (!dir_in)
cntr |= GVP11_DMAC_DIR_WRITE;
HDATA(cmd->host)->dma_dir = dir_in;
DMA(cmd->host)->CNTR = cntr;
HDATA(cmd->device->host)->dma_dir = dir_in;
DMA(cmd->device->host)->CNTR = cntr;
/* setup DMA *physical* address */
DMA(cmd->host)->ACR = addr;
DMA(cmd->device->host)->ACR = addr;
if (dir_in)
/* invalidate any cache */
......@@ -138,11 +139,11 @@ static int dma_setup (Scsi_Cmnd *cmd, int dir_in)
/* push any dirty cache */
cache_push (addr, cmd->SCp.this_residual);
if ((bank_mask = (~HDATA(cmd->host)->dma_xfer_mask >> 18) & 0x01c0))
DMA(cmd->host)->BANK = bank_mask & (addr >> 18);
if ((bank_mask = (~HDATA(cmd->device->host)->dma_xfer_mask >> 18) & 0x01c0))
DMA(cmd->device->host)->BANK = bank_mask & (addr >> 18);
/* start DMA */
DMA(cmd->host)->ST_DMA = 1;
DMA(cmd->device->host)->ST_DMA = 1;
/* return success */
return 0;
......
This diff is collapsed.
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