printk(KERN_NOTICE "eata_pio_queue target %d, pid %ld, HBA busy, " "returning DID_BUS_BUSY, done.\n", cmd->device->id, cmd->pid); 
scmd_printk(KERN_NOTICE, cmd, "eata_pio_queue pid %ld, HBA busy, " "returning DID_BUS_BUSY, done.\n", cmd->pid); 
static int eata_pio_queue(struct scsi_cmnd *cmd,		void (*done)(struct scsi_cmnd *)){	uint x, y;	uint base;	hostdata *hd;	struct Scsi_Host *sh;	struct eata_ccb *cp;	queue_counter++;	hd = HD(cmd);	sh = cmd->device->host;	base = (uint) sh->base;	/* use only slot 0, as 2001 can handle only one cmd at a time */	y = x = 0;	if (hd->ccb[y].status != FREE) {		DBG(DBG_QUEUE, printk(KERN_EMERG "can_queue %d, x %d, y %d\n", sh->can_queue, x, y));#if DEBUG_EATA		panic(KERN_EMERG "eata_pio: run out of queue slots cmdno:%ld " "intrno: %ld\n", queue_counter, int_counter);#else		panic(KERN_EMERG "eata_pio: run out of queue slots....\n");#endif	}	cp = &hd->ccb[y];	memset(cp, 0, sizeof(struct eata_ccb));	memset(cmd->sense_buffer, 0, sizeof(cmd->sense_buffer));	cp->status = USED;	/* claim free slot */	DBG(DBG_QUEUE, printk(KERN_DEBUG "eata_pio_queue pid %ld, target: %x, lun:" " %x, y %d\n", cmd->pid, cmd->device->id, cmd->device->lun, y));	cmd->scsi_done = (void *) done;	if (cmd->sc_data_direction == DMA_TO_DEVICE)		cp->DataOut = 1;	/* Output mode */	else		cp->DataIn = 0;	/* Input mode  */	cp->Interpret = (cmd->device->id == hd->hostid);	cp->cp_datalen = htonl((unsigned long) cmd->request_bufflen);	cp->Auto_Req_Sen = 0;	cp->cp_reqDMA = htonl(0);	cp->reqlen = 0;	cp->cp_id = cmd->device->id;	cp->cp_lun = cmd->device->lun;	cp->cp_dispri = 0;	cp->cp_identify = 1;	memcpy(cp->cp_cdb, cmd->cmnd, COMMAND_SIZE(*cmd->cmnd));	cp->cp_statDMA = htonl(0);	cp->cp_viraddr = cp;	cp->cmd = cmd;	cmd->host_scribble = (char *) &hd->ccb[y];	if (cmd->use_sg == 0) {		cmd->SCp.buffers_residual = 1;		cmd->SCp.ptr = cmd->request_buffer;		cmd->SCp.this_residual = cmd->request_bufflen;		cmd->SCp.buffer = NULL;	} else {		cmd->SCp.buffer = cmd->request_buffer;		cmd->SCp.buffers_residual = cmd->use_sg;		cmd->SCp.ptr = page_address(cmd->SCp.buffer->page) + cmd->SCp.buffer->offset;		cmd->SCp.this_residual = cmd->SCp.buffer->length;	}	cmd->SCp.Status = (cmd->SCp.this_residual != 0);	/* TRUE as long as bytes 								 * are to transfer */	if (eata_pio_send_command(base, EATA_CMD_PIO_SEND_CP)) {		cmd->result = DID_BUS_BUSY << 16;		printk(KERN_NOTICE "eata_pio_queue target %d, pid %ld, HBA busy, " "returning DID_BUS_BUSY, done.\n", cmd->device->id, cmd->pid);		done(cmd);		cp->status = FREE;		return (0);	}	/* FIXME: timeout */	while (!(inb(base + HA_RSTATUS) & HA_SDRQ))		cpu_relax();	outsw(base + HA_RDATA, cp, hd->cplen);	outb(EATA_CMD_PIO_TRUNC, base + HA_WCOMMAND);	for (x = 0; x < hd->cppadlen; x++)		outw(0, base + HA_RDATA);	DBG(DBG_QUEUE, printk(KERN_DEBUG "Queued base %#.4lx pid: %ld target: %x " "lun: %x slot %d irq %d\n", (long) sh->base, cmd->pid, cmd->device->id, cmd->device->lun, y, sh->irq));	return (0);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/017560fca496f72ed9dd734ffde63ce39dfe0411/eata_pio.c/clean/drivers/scsi/eata_pio.c