isp->isp_sendmarker = (1 << bus);
isp->isp_sendmarker |= (1 << bus);
isp_parse_async(isp, mbox)	struct ispsoftc *isp;	int mbox;{	int bus;	u_int32_t fast_post_handle = 0;	if (IS_DUALBUS(isp)) {		bus = ISP_READ(isp, OUTMAILBOX6);	} else {		bus = 0;	}	switch (mbox) {	case MBOX_COMMAND_COMPLETE:	/* sometimes these show up */		break;	case ASYNC_BUS_RESET:		isp->isp_sendmarker = (1 << bus);#ifdef	ISP_TARGET_MODE		isp_target_async(isp, bus, mbox);#endif		isp_async(isp, ISPASYNC_BUS_RESET, &bus);		break;	case ASYNC_SYSTEM_ERROR:		mbox = ISP_READ(isp, OUTMAILBOX1);		PRINTF("%s: Internal FW Error @ RISC Addr 0x%x\n",		    isp->isp_name, mbox);		isp_restart(isp);		/* no point continuing after this */		return (-1);	case ASYNC_RQS_XFER_ERR:		PRINTF("%s: Request Queue Transfer Error\n", isp->isp_name);		break;	case ASYNC_RSP_XFER_ERR:		PRINTF("%s: Response Queue Transfer Error\n", isp->isp_name);		break;	case ASYNC_QWAKEUP:		/*		 * We've just been notified that the Queue has woken up.		 * We don't need to be chatty about this- just unlatch things		 * and move on.		 */		mbox = ISP_READ(isp, OUTMAILBOX4);		break;	case ASYNC_TIMEOUT_RESET:		PRINTF("%s: timeout initiated SCSI bus reset of bus %d\n",		    isp->isp_name, bus);		isp->isp_sendmarker = (1 << bus);#ifdef	ISP_TARGET_MODE		isp_target_async(isp, bus, mbox);#endif		break;	case ASYNC_DEVICE_RESET:		PRINTF("%s: device reset on bus %d\n", isp->isp_name, bus);		isp->isp_sendmarker = 1 << bus;#ifdef	ISP_TARGET_MODE		isp_target_async(isp, bus, mbox);#endif		break;	case ASYNC_EXTMSG_UNDERRUN:		PRINTF("%s: extended message underrun\n", isp->isp_name);		break;	case ASYNC_SCAM_INT:		PRINTF("%s: SCAM interrupt\n", isp->isp_name);		break;	case ASYNC_HUNG_SCSI:		PRINTF("%s: stalled SCSI Bus after DATA Overrun\n",		    isp->isp_name);		/* XXX: Need to issue SCSI reset at this point */		break;	case ASYNC_KILLED_BUS:		PRINTF("%s: SCSI Bus reset after DATA Overrun\n",		    isp->isp_name);		break;	case ASYNC_BUS_TRANSIT:		mbox = ISP_READ(isp, OUTMAILBOX2);		switch (mbox & 0x1c00) {		case SXP_PINS_LVD_MODE:			PRINTF("%s: Transition to LVD mode\n", isp->isp_name);			((sdparam *)isp->isp_param)->isp_diffmode = 0;			((sdparam *)isp->isp_param)->isp_ultramode = 0;			((sdparam *)isp->isp_param)->isp_lvdmode = 1;			break;		case SXP_PINS_HVD_MODE:			PRINTF("%s: Transition to Differential mode\n",			    isp->isp_name);			((sdparam *)isp->isp_param)->isp_diffmode = 1;			((sdparam *)isp->isp_param)->isp_ultramode = 0;			((sdparam *)isp->isp_param)->isp_lvdmode = 0;			break;		case SXP_PINS_SE_MODE:			PRINTF("%s: Transition to Single Ended mode\n",			    isp->isp_name);			((sdparam *)isp->isp_param)->isp_diffmode = 0;			((sdparam *)isp->isp_param)->isp_ultramode = 1;			((sdparam *)isp->isp_param)->isp_lvdmode = 0;			break;		default:			PRINTF("%s: Transition to unknown mode 0x%x\n",			    isp->isp_name, mbox);			break;		}		/*		 * XXX: Set up to renegotiate again!		 */		/* Can only be for a 1080... */		isp->isp_sendmarker = (1 << bus);		break;	case ASYNC_CMD_CMPLT:		fast_post_handle = (ISP_READ(isp, OUTMAILBOX2) << 16) |		    ISP_READ(isp, OUTMAILBOX1);		IDPRINTF(4, ("%s: fast post completion of %u\n", isp->isp_name,		    fast_post_handle));		break;	case ASYNC_CTIO_DONE:		/* Should only occur when Fast Posting Set for 2100s */		PRINTF("%s: CTIO done\n", isp->isp_name);		break;	case ASYNC_LIP_OCCURRED:		((fcparam *) isp->isp_param)->isp_lipseq =		    ISP_READ(isp, OUTMAILBOX1);		((fcparam *) isp->isp_param)->isp_fwstate = FW_CONFIG_WAIT;		((fcparam *) isp->isp_param)->isp_loopstate = LOOP_LIP_RCVD;		isp->isp_sendmarker = 1;		isp_mark_getpdb_all(isp);		IDPRINTF(1, ("%s: LIP occurred\n", isp->isp_name));#ifdef	ISP_TARGET_MODE		isp_target_async(isp, bus, mbox);#endif		break;	case ASYNC_LOOP_UP:		isp->isp_sendmarker = 1;		((fcparam *) isp->isp_param)->isp_fwstate = FW_CONFIG_WAIT;		((fcparam *) isp->isp_param)->isp_loopstate = LOOP_LIP_RCVD;		isp_mark_getpdb_all(isp);		isp_async(isp, ISPASYNC_LOOP_UP, NULL);#ifdef	ISP_TARGET_MODE		isp_target_async(isp, bus, mbox);#endif		break;	case ASYNC_LOOP_DOWN:		isp->isp_sendmarker = 1;		((fcparam *) isp->isp_param)->isp_fwstate = FW_CONFIG_WAIT;		((fcparam *) isp->isp_param)->isp_loopstate = LOOP_NIL;		isp_mark_getpdb_all(isp);		isp_async(isp, ISPASYNC_LOOP_DOWN, NULL);#ifdef	ISP_TARGET_MODE		isp_target_async(isp, bus, mbox);#endif		break;	case ASYNC_LOOP_RESET:		isp->isp_sendmarker = 1 << bus;		((fcparam *) isp->isp_param)->isp_fwstate = FW_CONFIG_WAIT;		((fcparam *) isp->isp_param)->isp_loopstate = LOOP_NIL;		isp_mark_getpdb_all(isp);		PRINTF("%s: Loop RESET\n", isp->isp_name);#ifdef	ISP_TARGET_MODE		isp_target_async(isp, bus, mbox);#endif		break;	case ASYNC_PDB_CHANGED:		isp->isp_sendmarker = 1;		((fcparam *) isp->isp_param)->isp_loopstate = LOOP_PDB_RCVD;		isp_mark_getpdb_all(isp);		IDPRINTF(2, ("%s: Port Database Changed\n", isp->isp_name));		break;	case ASYNC_CHANGE_NOTIFY:		isp_mark_getpdb_all(isp);		/*		 * Not correct, but it will force us to rescan the loop.		 */		((fcparam *) isp->isp_param)->isp_loopstate = LOOP_PDB_RCVD;		isp_async(isp, ISPASYNC_CHANGE_NOTIFY, NULL);		break;	case ASYNC_PTPMODE:		PRINTF("%s: Point-to-Point mode\n", isp->isp_name);		break;	case ASYNC_CONNMODE:		mbox = ISP_READ(isp, OUTMAILBOX1);		switch (mbox) {		case ISP_CONN_LOOP:			PRINTF("%s: Point-to-Point -> Loop mode\n",			    isp->isp_name);			break;		case ISP_CONN_PTP:			PRINTF("%s: Loop -> Point-to-Point mode\n",			    isp->isp_name);			break;		case ISP_CONN_BADLIP:			PRINTF("%s: Point-to-Point -> Loop mode (1)\n",			    isp->isp_name);			break;		case ISP_CONN_FATAL:			PRINTF("%s: FATAL CONNECTION ERROR\n", isp->isp_name);			isp_restart(isp);			/* no point continuing after this */			return (-1);		case ISP_CONN_LOOPBACK:			PRINTF("%s: Looped Back in Point-to-Point mode\n",			     isp->isp_name);		}		break;	default:		PRINTF("%s: unknown async code 0x%x\n", isp->isp_name, mbox);		break;	}	return (fast_post_handle);}