if (dev->scsi_device != NULL) { switch ((dev->flags & (AHD_DEV_Q_BASIC|AHD_DEV_Q_TAGGED))) { case AHD_DEV_Q_BASIC: scsi_adjust_queue_depth(dev->scsi_device, MSG_SIMPLE_TASK, dev->openings + dev->active); break; case AHD_DEV_Q_TAGGED: scsi_adjust_queue_depth(dev->scsi_device, MSG_ORDERED_TASK, dev->openings + dev->active); break; default: /* * We allow the OS to queue 2 untagged transactions to * us at any time even though we can only execute them * serially on the controller/device.  This should * remove some latency. */ scsi_adjust_queue_depth(dev->scsi_device, /*NON-TAGGED*/0, /*queue depth*/2); break; } 
switch ((dev->flags & (AHD_DEV_Q_BASIC|AHD_DEV_Q_TAGGED))) { case AHD_DEV_Q_BASIC: scsi_adjust_queue_depth(sdev, MSG_SIMPLE_TASK, dev->openings + dev->active); break; case AHD_DEV_Q_TAGGED: scsi_adjust_queue_depth(sdev, MSG_ORDERED_TASK, dev->openings + dev->active); break; default: /* * We allow the OS to queue 2 untagged transactions to * us at any time even though we can only execute them * serially on the controller/device.  This should * remove some latency. */ scsi_adjust_queue_depth(sdev, /*NON-TAGGED*/0, /*queue depth*/2); break; 
ahd_platform_set_tags(struct ahd_softc *ahd, struct ahd_devinfo *devinfo,		      ahd_queue_alg alg){	struct ahd_linux_device *dev;	int was_queuing;	int now_queuing;	dev = ahd_linux_get_device(ahd, devinfo->channel - 'A',				   devinfo->target,				   devinfo->lun, /*alloc*/FALSE);	if (dev == NULL)		return;	was_queuing = dev->flags & (AHD_DEV_Q_BASIC|AHD_DEV_Q_TAGGED);	switch (alg) {	default:	case AHD_QUEUE_NONE:		now_queuing = 0;		break; 	case AHD_QUEUE_BASIC:		now_queuing = AHD_DEV_Q_BASIC;		break;	case AHD_QUEUE_TAGGED:		now_queuing = AHD_DEV_Q_TAGGED;		break;	}	if ((dev->flags & AHD_DEV_FREEZE_TIL_EMPTY) == 0	 && (was_queuing != now_queuing)	 && (dev->active != 0)) {		dev->flags |= AHD_DEV_FREEZE_TIL_EMPTY;		dev->qfrozen++;	}	dev->flags &= ~(AHD_DEV_Q_BASIC|AHD_DEV_Q_TAGGED|AHD_DEV_PERIODIC_OTAG);	if (now_queuing) {		u_int usertags;		usertags = ahd_linux_user_tagdepth(ahd, devinfo);		if (!was_queuing) {			/*			 * Start out agressively and allow our			 * dynamic queue depth algorithm to take			 * care of the rest.			 */			dev->maxtags = usertags;			dev->openings = dev->maxtags - dev->active;		}		if (dev->maxtags == 0) {			/*			 * Queueing is disabled by the user.			 */			dev->openings = 1;		} else if (alg == AHD_QUEUE_TAGGED) {			dev->flags |= AHD_DEV_Q_TAGGED;			if (aic79xx_periodic_otag != 0)				dev->flags |= AHD_DEV_PERIODIC_OTAG;		} else			dev->flags |= AHD_DEV_Q_BASIC;	} else {		/* We can only have one opening. */		dev->maxtags = 0;		dev->openings =  1 - dev->active;	}	if (dev->scsi_device != NULL) {		switch ((dev->flags & (AHD_DEV_Q_BASIC|AHD_DEV_Q_TAGGED))) {		case AHD_DEV_Q_BASIC:			scsi_adjust_queue_depth(dev->scsi_device,						MSG_SIMPLE_TASK,						dev->openings + dev->active);			break;		case AHD_DEV_Q_TAGGED:			scsi_adjust_queue_depth(dev->scsi_device,						MSG_ORDERED_TASK,						dev->openings + dev->active);			break;		default:			/*			 * We allow the OS to queue 2 untagged transactions to			 * us at any time even though we can only execute them			 * serially on the controller/device.  This should			 * remove some latency.			 */			scsi_adjust_queue_depth(dev->scsi_device,						/*NON-TAGGED*/0,						/*queue depth*/2);			break;		}	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/73a25462100772b72a5d62fd66dff01b53018618/aic79xx_osm.c/buggy/drivers/scsi/aic7xxx/aic79xx_osm.c