if (sdev->id == np->myaddr || sdev->id >= SYM_CONF_MAX_TARGET || sdev->lun >= SYM_CONF_MAX_LUN) { sym_xpt_done2(np, cmd, CAM_DEV_NOT_THERE); 
if (sdev->id == np->myaddr) { sym_xpt_done2(np, cmd, DID_NO_CONNECT); 
static int sym_queue_command(struct sym_hcb *np, struct scsi_cmnd *cmd){	struct scsi_device *sdev = cmd->device;	struct sym_tcb *tp;	struct sym_lcb *lp;	struct sym_ccb *cp;	int	order;	/*	 *  Minimal checkings, so that we will not 	 *  go outside our tables.	 */	if (sdev->id == np->myaddr ||	    sdev->id >= SYM_CONF_MAX_TARGET ||	    sdev->lun >= SYM_CONF_MAX_LUN) {		sym_xpt_done2(np, cmd, CAM_DEV_NOT_THERE);		return 0;	}	/*	 *  Retrieve the target descriptor.	 */	tp = &np->target[sdev->id];	/*	 *  Complete the 1st INQUIRY command with error 	 *  condition if the device is flagged NOSCAN 	 *  at BOOT in the NVRAM. This may speed up 	 *  the boot and maintain coherency with BIOS 	 *  device numbering. Clearing the flag allows 	 *  user to rescan skipped devices later.	 *  We also return error for devices not flagged 	 *  for SCAN LUNS in the NVRAM since some mono-lun 	 *  devices behave badly when asked for some non 	 *  zero LUN. Btw, this is an absolute hack.:-)	 */	if (cmd->cmnd[0] == 0x12 || cmd->cmnd[0] == 0x0) {		if ((tp->usrflags & SYM_SCAN_BOOT_DISABLED) ||		    ((tp->usrflags & SYM_SCAN_LUNS_DISABLED) && 		     sdev->lun != 0)) {			tp->usrflags &= ~SYM_SCAN_BOOT_DISABLED;			sym_xpt_done2(np, cmd, CAM_DEV_NOT_THERE);			return 0;		}	}	/*	 *  Select tagged/untagged.	 */	lp = sym_lp(tp, sdev->lun);	order = (lp && lp->s.reqtags) ? M_SIMPLE_TAG : 0;	/*	 *  Queue the SCSI IO.	 */	cp = sym_get_ccb(np, cmd, order);	if (!cp)		return 1;	/* Means resource shortage */	sym_queue_scsiio(np, cmd, cp);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/53222b906903fd861dc24ebccfa07ee125941313/sym_glue.c/clean/drivers/scsi/sym53c8xx_2/sym_glue.c