atomic_set(&fcport->state, FCS_DEVICE_LOST); 
qla2x00_mark_device_lost(ha, fcport, 0); 
qla2x00_device_resync(scsi_qla_host_t *ha) {	int	rval;	int	rval2;	uint32_t mask;	fc_port_t *fcport;	uint32_t rscn_entry;	uint8_t rscn_out_iter;	uint8_t format;	port_id_t d_id;	rval = QLA_RSCNS_HANDLED;	while (ha->rscn_out_ptr != ha->rscn_in_ptr ||	    ha->flags.rscn_queue_overflow) {		rscn_entry = ha->rscn_queue[ha->rscn_out_ptr];		format = MSB(MSW(rscn_entry));		d_id.b.domain = LSB(MSW(rscn_entry));		d_id.b.area = MSB(LSW(rscn_entry));		d_id.b.al_pa = LSB(LSW(rscn_entry));		DEBUG(printk("scsi(%ld): RSCN queue entry[%d] = "		    "[%02x/%02x%02x%02x].\n",		    ha->host_no, ha->rscn_out_ptr, format, d_id.b.domain,		    d_id.b.area, d_id.b.al_pa));		ha->rscn_out_ptr++;		if (ha->rscn_out_ptr == MAX_RSCN_COUNT)			ha->rscn_out_ptr = 0;		/* Skip duplicate entries. */		for (rscn_out_iter = ha->rscn_out_ptr;		    !ha->flags.rscn_queue_overflow &&		    rscn_out_iter != ha->rscn_in_ptr;		    rscn_out_iter = (rscn_out_iter ==			(MAX_RSCN_COUNT - 1)) ? 0: rscn_out_iter + 1) {			if (rscn_entry != ha->rscn_queue[rscn_out_iter])				break;			DEBUG(printk("scsi(%ld): Skipping duplicate RSCN queue "			    "entry found at [%d].\n", ha->host_no,			    rscn_out_iter));			ha->rscn_out_ptr = rscn_out_iter;		}		/* Queue overflow, set switch default case. */		if (ha->flags.rscn_queue_overflow) {			DEBUG(printk("scsi(%ld): device_resync: rscn "			    "overflow.\n", ha->host_no));			format = 3;			ha->flags.rscn_queue_overflow = 0;		}		switch (format) {		case 0:			if (!IS_QLA2100(ha) && !IS_QLA2200(ha) &&			    !IS_QLA6312(ha) && !IS_QLA6322(ha) &&			    ha->flags.init_done) {				/* Handle port RSCN via asyncronous IOCBs */				rval2 = qla2x00_handle_port_rscn(ha, rscn_entry,				    NULL, 0);				if (rval2 == QLA_SUCCESS)					continue;			}			mask = 0xffffff;			break;		case 1:			mask = 0xffff00;			break;		case 2:			mask = 0xff0000;			break;		default:			mask = 0x0;			d_id.b24 = 0;			ha->rscn_out_ptr = ha->rscn_in_ptr;			break;		}		rval = QLA_SUCCESS;		/* Abort any outstanding IO descriptors. */		if (!IS_QLA2100(ha) && !IS_QLA2200(ha))			qla2x00_cancel_io_descriptors(ha);		list_for_each_entry(fcport, &ha->fcports, list) {			if ((fcport->flags & FCF_FABRIC_DEVICE) == 0 ||			    (fcport->d_id.b24 & mask) != d_id.b24 ||			    fcport->port_type == FCT_BROADCAST)				continue;			if (atomic_read(&fcport->state) == FCS_ONLINE) {				if (format != 3 ||				    fcport->port_type != FCT_INITIATOR) {					atomic_set(&fcport->state,					    FCS_DEVICE_LOST);				}			}			fcport->flags &= ~FCF_FARP_DONE;		}	}	return (rval);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/8482e118afa0cb4321ab3d30b1100d27d63130c0/qla_init.c/clean/drivers/scsi/qla2xxx/qla_init.c