/* FALLTHROUGH */ } case SCSI_STATUS_BUSY: { /* * Set a short timer to defer sending commands for * a bit since Linux will not delay in this case. */ if ((dev->flags & AHC_DEV_TIMER_ACTIVE) != 0) { printf("%s:%c:%d: Device Timer still active during " "busy processing\n", ahc_name(ahc), dev->target->channel, dev->target->target); break; } dev->flags |= AHC_DEV_TIMER_ACTIVE; dev->qfrozen++; init_timer(&dev->timer); dev->timer.data = (u_long)dev; dev->timer.expires = jiffies + (HZ/2); dev->timer.function = ahc_linux_dev_timed_unfreeze; add_timer(&dev->timer); 
ahc_linux_handle_scsi_status(struct ahc_softc *ahc,			     struct ahc_linux_device *dev, struct scb *scb){	struct	ahc_devinfo devinfo;	ahc_compile_devinfo(&devinfo,			    ahc->our_id,			    dev->target->target, dev->lun,			    dev->target->channel == 0 ? 'A' : 'B',			    ROLE_INITIATOR);		/*	 * We don't currently trust the mid-layer to	 * properly deal with queue full or busy.  So,	 * when one occurs, we tell the mid-layer to	 * unconditionally requeue the command to us	 * so that we can retry it ourselves.  We also	 * implement our own throttling mechanism so	 * we don't clobber the device with too many	 * commands.	 */	switch (ahc_get_scsi_status(scb)) {	default:		break;	case SCSI_STATUS_CHECK_COND:	case SCSI_STATUS_CMD_TERMINATED:	{		struct scsi_cmnd *cmd;		/*		 * Copy sense information to the OS's cmd		 * structure if it is available.		 */		cmd = scb->io_ctx;		if (scb->flags & SCB_SENSE) {			u_int sense_size;			sense_size = MIN(sizeof(struct scsi_sense_data)				       - ahc_get_sense_residual(scb),					 sizeof(cmd->sense_buffer));			memcpy(cmd->sense_buffer,			       ahc_get_sense_buf(ahc, scb), sense_size);			if (sense_size < sizeof(cmd->sense_buffer))				memset(&cmd->sense_buffer[sense_size], 0,				       sizeof(cmd->sense_buffer) - sense_size);			cmd->result |= (DRIVER_SENSE << 24);#ifdef AHC_DEBUG			if (ahc_debug & AHC_SHOW_SENSE) {				int i;				printf("Copied %d bytes of sense data:",				       sense_size);				for (i = 0; i < sense_size; i++) {					if ((i & 0xF) == 0)						printf("\n");					printf("0x%x ", cmd->sense_buffer[i]);				}				printf("\n");			}#endif		}		break;	}	case SCSI_STATUS_QUEUE_FULL:	{		/*		 * By the time the core driver has returned this		 * command, all other commands that were queued		 * to us but not the device have been returned.		 * This ensures that dev->active is equal to		 * the number of commands actually queued to		 * the device.		 */		dev->tag_success_count = 0;		if (dev->active != 0) {			/*			 * Drop our opening count to the number			 * of commands currently outstanding.			 */			dev->openings = 0;/*			ahc_print_path(ahc, scb);			printf("Dropping tag count to %d\n", dev->active); */			if (dev->active == dev->tags_on_last_queuefull) {				dev->last_queuefull_same_count++;				/*				 * If we repeatedly see a queue full				 * at the same queue depth, this				 * device has a fixed number of tag				 * slots.  Lock in this tag depth				 * so we stop seeing queue fulls from				 * this device.				 */				if (dev->last_queuefull_same_count				 == AHC_LOCK_TAGS_COUNT) {					dev->maxtags = dev->active;					ahc_print_path(ahc, scb);					printf("Locking max tag count at %d\n",					       dev->active);				}			} else {				dev->tags_on_last_queuefull = dev->active;				dev->last_queuefull_same_count = 0;			}			ahc_set_transaction_status(scb, CAM_REQUEUE_REQ);			ahc_set_scsi_status(scb, SCSI_STATUS_OK);			ahc_platform_set_tags(ahc, &devinfo,				     (dev->flags & AHC_DEV_Q_BASIC)				   ? AHC_QUEUE_BASIC : AHC_QUEUE_TAGGED);			break;		}		/*		 * Drop down to a single opening, and treat this		 * as if the target returned BUSY SCSI status.		 */		dev->openings = 1;		ahc_set_scsi_status(scb, SCSI_STATUS_BUSY);		ahc_platform_set_tags(ahc, &devinfo,			     (dev->flags & AHC_DEV_Q_BASIC)			   ? AHC_QUEUE_BASIC : AHC_QUEUE_TAGGED);		/* FALLTHROUGH */	}	case SCSI_STATUS_BUSY:	{		/*		 * Set a short timer to defer sending commands for		 * a bit since Linux will not delay in this case.		 */		if ((dev->flags & AHC_DEV_TIMER_ACTIVE) != 0) {			printf("%s:%c:%d: Device Timer still active during "			       "busy processing\n", ahc_name(ahc),				dev->target->channel, dev->target->target);			break;		}		dev->flags |= AHC_DEV_TIMER_ACTIVE;		dev->qfrozen++;		init_timer(&dev->timer);		dev->timer.data = (u_long)dev;		dev->timer.expires = jiffies + (HZ/2);		dev->timer.function = ahc_linux_dev_timed_unfreeze;		add_timer(&dev->timer);		break;	}	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/c7525233d2df39b95552f6f49c6b390a9c4d2e80/aic7xxx_osm.c/buggy/drivers/scsi/aic7xxx/aic7xxx_osm.c