Lines Matching refs:padapter
117 static int WriteData (PADAPTER240I padapter) in WriteData() argument
120 USHORT *pports = padapter->ports; in WriteData()
126 outsw (pports[PORT_DATA], padapter->buffer, (USHORT)padapter->ide.ide.ide[2] * 256); in WriteData()
131 padapter->ide.ide.ides.cmd = 0; // null out the command byte in WriteData()
144 static UCHAR IdeCmd (PADAPTER240I padapter) in IdeCmd() argument
147 USHORT *pports = padapter->ports; in IdeCmd()
150 outb_p (padapter->ide.ide.ides.spigot, pports[PORT_SEL_FAIL]); // select the spigot in IdeCmd()
151 outb_p (padapter->ide.ide.ide[6], pports[PORT_LBA_24]); // select the drive in IdeCmd()
154 status = inb_p (padapter->ports[PORT_STAT_CMD]); in IdeCmd()
157 outb_p (padapter->ide.ide.ide[2], pports[PORT_SECTOR_COUNT]); in IdeCmd()
158 outb_p (padapter->ide.ide.ide[3], pports[PORT_LBA_0]); in IdeCmd()
159 outb_p (padapter->ide.ide.ide[4], pports[PORT_LBA_8]); in IdeCmd()
160 outb_p (padapter->ide.ide.ide[5], pports[PORT_LBA_16]); in IdeCmd()
161 padapter->expectingIRQ = 1; in IdeCmd()
162 outb_p (padapter->ide.ide.ide[7], pports[PORT_STAT_CMD]); in IdeCmd()
164 if ( padapter->ide.ide.ides.cmd == IDE_CMD_WRITE_MULTIPLE ) in IdeCmd()
165 return (WriteData (padapter)); in IdeCmd()
171 padapter->ide.ide.ides.cmd = 0; // null out the command byte in IdeCmd()
185 static int SetupTransfer (PADAPTER240I padapter, UCHAR drive) in SetupTransfer() argument
187 if ( padapter->sectorCount ) in SetupTransfer()
189 *(ULONG *)padapter->ide.ide.ides.lba = padapter->startSector; in SetupTransfer()
190 padapter->ide.ide.ide[6] |= drive; in SetupTransfer()
191 …padapter->ide.ide.ides.sectors = ( padapter->sectorCount > SECTORSXFER ) ? SECTORSXFER : padapter-… in SetupTransfer()
192 padapter->sectorCount -= padapter->ide.ide.ides.sectors; // bump the start and count for next xfer in SetupTransfer()
193 padapter->startSector += padapter->ide.ide.ides.sectors; in SetupTransfer()
198 padapter->ide.ide.ides.cmd = 0; // null out the command byte in SetupTransfer()
199 padapter->SCpnt = NULL; in SetupTransfer()
216 PADAPTER240I padapter = HOSTDATA(pshost); in DecodeError() local
219 padapter->expectingIRQ = 0; in DecodeError()
220 padapter->SCpnt = NULL; in DecodeError()
228 error = inb_p (padapter->ports[PORT_ERROR]); in DecodeError()
258 PADAPTER240I padapter; // Pointer to adapter control structure in Irq_Handler() local
270 padapter = HOSTDATA(shost); in Irq_Handler()
271 pports = padapter->ports; in Irq_Handler()
272 SCpnt = padapter->SCpnt; in Irq_Handler()
274 if ( !padapter->expectingIRQ ) in Irq_Handler()
279 padapter->expectingIRQ = 0; in Irq_Handler()
281 status = inb_p (padapter->ports[PORT_STAT_CMD]); // read the device status in Irq_Handler()
286 switch ( padapter->ide.ide.ides.cmd ) // decide how to handle the interrupt in Irq_Handler()
291 insw (pports[PORT_DATA], padapter->buffer, (USHORT)padapter->ide.ide.ides.sectors * 256); in Irq_Handler()
292 padapter->buffer += padapter->ide.ide.ides.sectors * 512; in Irq_Handler()
293 if ( SetupTransfer (padapter, padapter->ide.ide.ide[6] & 0xF0) ) in Irq_Handler()
296 padapter->SCpnt = NULL; in Irq_Handler()
300 if ( !(status = IdeCmd (padapter)) ) in Irq_Handler()
306 padapter->buffer += padapter->ide.ide.ides.sectors * 512; in Irq_Handler()
307 if ( SetupTransfer (padapter, padapter->ide.ide.ide[6] & 0xF0) ) in Irq_Handler()
310 padapter->SCpnt = NULL; in Irq_Handler()
314 if ( !(status = IdeCmd (padapter)) ) in Irq_Handler()
351 padapter->SCpnt = NULL; in Irq_Handler()
360 padapter->SCpnt = NULL; in Irq_Handler()
392 PADAPTER240I padapter = HOSTDATA(SCpnt->host); // Pointer to adapter control structure in Psi240i_QueueCommand() local
393 POUR_DEVICE pdev = &padapter->device[SCpnt->target];// Pointer to device information in Psi240i_QueueCommand()
397 padapter->ide.ide.ides.spigot = pdev->spigot; in Psi240i_QueueCommand()
398 padapter->buffer = SCpnt->request_buffer; in Psi240i_QueueCommand()
418 padapter->ide.ide.ide[6] = pdev->byte6; in Psi240i_QueueCommand()
419 padapter->ide.ide.ides.cmd = IDE_COMMAND_IDENTIFY; in Psi240i_QueueCommand()
440 *(ULONG *)padapter->ide.ide.ides.lba = XSCSI2LONG (&cdb[2]); in Psi240i_QueueCommand()
441 padapter->ide.ide.ide[6] |= pdev->byte6; in Psi240i_QueueCommand()
442 padapter->ide.ide.ide[2] = (UCHAR)((USHORT)cdb[8] | ((USHORT)cdb[7] << 8)); in Psi240i_QueueCommand()
443 padapter->ide.ide.ides.cmd = IDE_COMMAND_VERIFY; in Psi240i_QueueCommand()
447 padapter->startSector = XSCSI2LONG (&cdb[2]); in Psi240i_QueueCommand()
448 padapter->sectorCount = (USHORT)cdb[8] | ((USHORT)cdb[7] << 8); in Psi240i_QueueCommand()
449 SetupTransfer (padapter, pdev->byte6); in Psi240i_QueueCommand()
450 padapter->ide.ide.ides.cmd = IDE_CMD_READ_MULTIPLE; in Psi240i_QueueCommand()
454 padapter->startSector = SCSI2LONG (&cdb[1]); in Psi240i_QueueCommand()
455 padapter->sectorCount = cdb[4]; in Psi240i_QueueCommand()
456 SetupTransfer (padapter, pdev->byte6); in Psi240i_QueueCommand()
457 padapter->ide.ide.ides.cmd = IDE_CMD_READ_MULTIPLE; in Psi240i_QueueCommand()
461 padapter->startSector = XSCSI2LONG (&cdb[2]); in Psi240i_QueueCommand()
462 padapter->sectorCount = (USHORT)cdb[8] | ((USHORT)cdb[7] << 8); in Psi240i_QueueCommand()
463 SetupTransfer (padapter, pdev->byte6); in Psi240i_QueueCommand()
464 padapter->ide.ide.ides.cmd = IDE_CMD_WRITE_MULTIPLE; in Psi240i_QueueCommand()
467 padapter->startSector = SCSI2LONG (&cdb[1]); in Psi240i_QueueCommand()
468 padapter->sectorCount = cdb[4]; in Psi240i_QueueCommand()
469 SetupTransfer (padapter, pdev->byte6); in Psi240i_QueueCommand()
470 padapter->ide.ide.ides.cmd = IDE_CMD_WRITE_MULTIPLE; in Psi240i_QueueCommand()
480 padapter->SCpnt = SCpnt; // Save this command data in Psi240i_QueueCommand()
482 rc = IdeCmd (padapter); in Psi240i_QueueCommand()
485 padapter->expectingIRQ = 0; in Psi240i_QueueCommand()
486 …ueuecommand: %02X, %02X: Device failed to respond for command\n", *cdb, padapter->ide.ide.ides.cmd… in Psi240i_QueueCommand()
491 …DEB (printk("psi240i_queuecommand: %02X, %02X now waiting for interrupt ", *cdb, padapter->ide.ide… in Psi240i_QueueCommand()