scsi_adjust_queue_depth(sdev, MSG_ORDERED_TASK, dev->openings + dev->active); 
scsi_set_tag_type(sdev, MSG_ORDERED_TAG); scsi_activate_tcq(sdev, dev->openings + dev->active); 
ahc_platform_set_tags(struct ahc_softc *ahc, struct ahc_devinfo *devinfo,		      ahc_queue_alg alg){	struct scsi_target *starget;	struct ahc_linux_target *targ;	struct ahc_linux_device *dev;	struct scsi_device *sdev;	u_int target_offset;	int was_queuing;	int now_queuing;	target_offset = devinfo->target;	if (devinfo->channel != 'A')		target_offset += 8;	starget = ahc->platform_data->starget[target_offset];	targ = scsi_transport_target_data(starget);	BUG_ON(targ == NULL);	sdev = targ->sdev[devinfo->lun];	if (sdev == NULL)		return;	dev = scsi_transport_device_data(sdev);	was_queuing = dev->flags & (AHC_DEV_Q_BASIC|AHC_DEV_Q_TAGGED);	switch (alg) {	default:	case AHC_QUEUE_NONE:		now_queuing = 0;		break; 	case AHC_QUEUE_BASIC:		now_queuing = AHC_DEV_Q_BASIC;		break;	case AHC_QUEUE_TAGGED:		now_queuing = AHC_DEV_Q_TAGGED;		break;	}	if ((dev->flags & AHC_DEV_FREEZE_TIL_EMPTY) == 0	 && (was_queuing != now_queuing)	 && (dev->active != 0)) {		dev->flags |= AHC_DEV_FREEZE_TIL_EMPTY;		dev->qfrozen++;	}	dev->flags &= ~(AHC_DEV_Q_BASIC|AHC_DEV_Q_TAGGED|AHC_DEV_PERIODIC_OTAG);	if (now_queuing) {		u_int usertags;		usertags = ahc_linux_user_tagdepth(ahc, 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 == AHC_QUEUE_TAGGED) {			dev->flags |= AHC_DEV_Q_TAGGED;			if (aic7xxx_periodic_otag != 0)				dev->flags |= AHC_DEV_PERIODIC_OTAG;		} else			dev->flags |= AHC_DEV_Q_BASIC;	} else {		/* We can only have one opening. */		dev->maxtags = 0;		dev->openings =  1 - dev->active;	}	switch ((dev->flags & (AHC_DEV_Q_BASIC|AHC_DEV_Q_TAGGED))) {	case AHC_DEV_Q_BASIC:		scsi_adjust_queue_depth(sdev,					MSG_SIMPLE_TASK,					dev->openings + dev->active);		break;	case AHC_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;	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/fdd0edf2aca72e374d10e7a0957a006f18bffaf4/aic7xxx_osm.c/clean/drivers/scsi/aic7xxx/aic7xxx_osm.c