* to this logical unit) it will be converted to a 0x3 (i.e. The target is not 
* to this logical unit) it will be converted to a 0x3 (i.e. The target is not 
mptscsih_initTarget(MPT_SCSI_HOST *hd, int bus_id, int target_id, u8 lun, char *data, int dlen){	int		indexed_lun, lun_index;	VirtDevice	*vdev;	ScsiCfgData	*pSpi;	char		data_56;	dinitprintk((MYIOC_s_INFO_FMT "initTarget bus=%d id=%d lun=%d hd=%p\n",			hd->ioc->name, bus_id, target_id, lun, hd));	/*	 * If the peripheral qualifier filter is enabled then if the target reports a 0x1	 * (i.e. The targer is capable of supporting the specified peripheral device type	 * on this logical unit; however, the physical device is not currently connected	 * to this logical unit) it will be converted to a 0x3 (i.e. The target is not 	 * capable of supporting a physical device on this logical unit). This is to work	 * around a bug in th emid-layer in some distributions in which the mid-layer will	 * continue to try to communicate to the LUN and evntually create a dummy LUN.	*/	if (hd->mpt_pq_filter && dlen && (data[0] & 0xE0))		data[0] |= 0x40;	/* Is LUN supported? If so, upper 2 bits will be 0	* in first byte of inquiry data.	*/	if (data[0] & 0xe0)		return;	if ((vdev = hd->Targets[target_id]) == NULL) {		return;	}	lun_index = (lun >> 5);  /* 32 luns per lun_index */	indexed_lun = (lun % 32);	vdev->luns[lun_index] |= (1 << indexed_lun);	if (hd->ioc->bus_type == SCSI) {		if ((data[0] == TYPE_PROCESSOR) && (hd->ioc->spi_data.Saf_Te)) {			/* Treat all Processors as SAF-TE if			 * command line option is set */			vdev->tflags |= MPT_TARGET_FLAGS_SAF_TE_ISSUED;			mptscsih_writeIOCPage4(hd, target_id, bus_id);		}else if ((data[0] == TYPE_PROCESSOR) &&			!(vdev->tflags & MPT_TARGET_FLAGS_SAF_TE_ISSUED )) {			if ( dlen > 49 ) {				vdev->tflags |= MPT_TARGET_FLAGS_VALID_INQUIRY;				if ( data[44] == 'S' &&				     data[45] == 'A' &&				     data[46] == 'F' &&				     data[47] == '-' &&				     data[48] == 'T' &&				     data[49] == 'E' ) {					vdev->tflags |= MPT_TARGET_FLAGS_SAF_TE_ISSUED;					mptscsih_writeIOCPage4(hd, target_id, bus_id);				}			}		}		if (!(vdev->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY)) {			if ( dlen > 8 ) {				memcpy (vdev->inq_data, data, 8);			} else {				memcpy (vdev->inq_data, data, dlen);			}			/* If have not done DV, set the DV flag.			 */			pSpi = &hd->ioc->spi_data;			if ((data[0] == TYPE_TAPE) || (data[0] == TYPE_PROCESSOR)) {				if (pSpi->dvStatus[target_id] & MPT_SCSICFG_DV_NOT_DONE)					pSpi->dvStatus[target_id] |= MPT_SCSICFG_NEED_DV;			}			vdev->tflags |= MPT_TARGET_FLAGS_VALID_INQUIRY;			data_56 = 0x0F;  /* Default to full capabilities if Inq data length is < 57 */			if (dlen > 56) {				if ( (!(vdev->tflags & MPT_TARGET_FLAGS_VALID_56))) {				/* Update the target capabilities				 */					data_56 = data[56];					vdev->tflags |= MPT_TARGET_FLAGS_VALID_56;				}			}			mptscsih_setTargetNegoParms(hd, vdev, data_56);		} else {			/* Initial Inquiry may not request enough data bytes to			 * obtain byte 57.  DV will; if target doesn't return			 * at least 57 bytes, data[56] will be zero. */			if (dlen > 56) {				if ( (!(vdev->tflags & MPT_TARGET_FLAGS_VALID_56))) {				/* Update the target capabilities				 */					data_56 = data[56];					vdev->tflags |= MPT_TARGET_FLAGS_VALID_56;					mptscsih_setTargetNegoParms(hd, vdev, data_56);				}			}		}	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/c6678e0cfb41b029c3600c54b5bb65954de1230a/mptscsih.c/buggy/drivers/message/fusion/mptscsih.c