if (!(sp->fclun->fcport->flags & FCF_TAPE_PRESENT)) 
sfcp = sp->fcport; if (!(sfcp->flags & FCF_TAPE_PRESENT)) 
qla2x00_timer(scsi_qla_host_t *ha){	unsigned long	cpu_flags = 0;	fc_port_t	*fcport;	int		start_dpc = 0;	int		index;	srb_t		*sp;	int		t;	/*	 * Ports - Port down timer.	 *	 * Whenever, a port is in the LOST state we start decrementing its port	 * down timer every second until it reaches zero. Once  it reaches zero	 * the port it marked DEAD. 	 */	t = 0;	list_for_each_entry(fcport, &ha->fcports, list) {		if (fcport->port_type != FCT_TARGET)			continue;		if (atomic_read(&fcport->state) == FCS_DEVICE_LOST) {			if (atomic_read(&fcport->port_down_timer) == 0)				continue;			if (atomic_dec_and_test(&fcport->port_down_timer) != 0) 				atomic_set(&fcport->state, FCS_DEVICE_DEAD);						DEBUG(printk("scsi(%ld): fcport-%d - port retry count: "			    "%d remainning\n",			    ha->host_no,			    t, atomic_read(&fcport->port_down_timer)));		}		t++;	} /* End of for fcport  */	/* Loop down handler. */	if (atomic_read(&ha->loop_down_timer) > 0 &&	    !(test_bit(ABORT_ISP_ACTIVE, &ha->dpc_flags)) && ha->flags.online) {		if (atomic_read(&ha->loop_down_timer) ==		    ha->loop_down_abort_time) {			DEBUG(printk("scsi(%ld): Loop Down - aborting the "			    "queues before time expire\n",			    ha->host_no));			if (!IS_QLA2100(ha) && ha->link_down_timeout)				atomic_set(&ha->loop_state, LOOP_DEAD); 			/* Schedule an ISP abort to return any tape commands. */			spin_lock_irqsave(&ha->hardware_lock, cpu_flags);			for (index = 1; index < MAX_OUTSTANDING_COMMANDS;			    index++) {				sp = ha->outstanding_cmds[index];				if (!sp)					continue;				if (!(sp->fclun->fcport->flags &				    FCF_TAPE_PRESENT))					continue;				set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);				break;			}			spin_unlock_irqrestore(&ha->hardware_lock, cpu_flags);			set_bit(ABORT_QUEUES_NEEDED, &ha->dpc_flags);			start_dpc++;		}		/* if the loop has been down for 4 minutes, reinit adapter */		if (atomic_dec_and_test(&ha->loop_down_timer) != 0) {			DEBUG(printk("scsi(%ld): Loop down exceed 4 mins - "			    "restarting queues.\n",			    ha->host_no));			set_bit(RESTART_QUEUES_NEEDED, &ha->dpc_flags);			start_dpc++;			if (!(ha->device_flags & DFLG_NO_CABLE)) {				DEBUG(printk("scsi(%ld): Loop down - "				    "aborting ISP.\n",				    ha->host_no));				qla_printk(KERN_WARNING, ha,				    "Loop down - aborting ISP.\n");				set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);			}		}		DEBUG3(printk("scsi(%ld): Loop Down - seconds remainning %d\n",		    ha->host_no,		    atomic_read(&ha->loop_down_timer)));	}	/* Schedule the DPC routine if needed */	if ((test_bit(ISP_ABORT_NEEDED, &ha->dpc_flags) ||	    test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) ||	    start_dpc ||	    test_bit(LOGIN_RETRY_NEEDED, &ha->dpc_flags) ||	    test_bit(RESET_MARKER_NEEDED, &ha->dpc_flags) ||	    test_bit(RELOGIN_NEEDED, &ha->dpc_flags)) &&	    ha->dpc_wait && !ha->dpc_active) {		up(ha->dpc_wait);	}	qla2x00_restart_timer(ha, WATCH_INTERVAL);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/bdf796210e01145fd77bbb3ae644d04f982b6c3b/qla_os.c/buggy/drivers/scsi/qla2xxx/qla_os.c