void falc_check_status(pc300_t * card, int ch, unsigned char frs0) 
static void falc_check_status(pc300_t * card, int ch, unsigned char frs0) 
void falc_check_status(pc300_t * card, int ch, unsigned char frs0){	pc300ch_t *chan = (pc300ch_t *) & card->chan[ch];	pc300chconf_t *conf = (pc300chconf_t *) & chan->conf;	falc_t *pfalc = (falc_t *) & chan->falc;	void __iomem *falcbase = card->hw.falcbase;	/* Verify LOS */	if (frs0 & FRS0_LOS) {		if (!pfalc->red_alarm) {			pfalc->red_alarm = 1;			pfalc->los++;			if (!pfalc->blue_alarm) {				// EVENT_FALC_ABNORMAL				if (conf->media == IF_IFACE_T1) {					/* Disable this interrupt as it may otherwise interfere 					 * with other working boards. */					cpc_writeb(falcbase + F_REG(IMR0, ch), 						   cpc_readb(falcbase + F_REG(IMR0, ch))						   | IMR0_PDEN);				}				falc_disable_comm(card, ch);				// EVENT_FALC_ABNORMAL			}		}	} else {		if (pfalc->red_alarm) {			pfalc->red_alarm = 0;			pfalc->losr++;		}	}	if (conf->fr_mode != PC300_FR_UNFRAMED) {		/* Verify AIS alarm */		if (frs0 & FRS0_AIS) {			if (!pfalc->blue_alarm) {				pfalc->blue_alarm = 1;				pfalc->ais++;				// EVENT_AIS				if (conf->media == IF_IFACE_T1) {					/* Disable this interrupt as it may otherwise interfere with                       other working boards. */					cpc_writeb(falcbase + F_REG(IMR0, ch),						   cpc_readb(falcbase + F_REG(IMR0, ch)) | IMR0_PDEN);				}				falc_disable_comm(card, ch);				// EVENT_AIS			}		} else {			pfalc->blue_alarm = 0;		}		/* Verify LFA */		if (frs0 & FRS0_LFA) {			if (!pfalc->loss_fa) {				pfalc->loss_fa = 1;				pfalc->lfa++;				if (!pfalc->blue_alarm && !pfalc->red_alarm) {					// EVENT_FALC_ABNORMAL					if (conf->media == IF_IFACE_T1) {						/* Disable this interrupt as it may otherwise 						 * interfere with other working boards. */						cpc_writeb(falcbase + F_REG(IMR0, ch),							   cpc_readb(falcbase + F_REG(IMR0, ch))							   | IMR0_PDEN);					}					falc_disable_comm(card, ch);					// EVENT_FALC_ABNORMAL				}			}		} else {			if (pfalc->loss_fa) {				pfalc->loss_fa = 0;				pfalc->farec++;			}		}		/* Verify LMFA */		if (pfalc->multiframe_mode && (frs0 & FRS0_LMFA)) {			/* D4 or CRC4 frame mode */			if (!pfalc->loss_mfa) {				pfalc->loss_mfa = 1;				pfalc->lmfa++;				if (!pfalc->blue_alarm && !pfalc->red_alarm &&				    !pfalc->loss_fa) {					// EVENT_FALC_ABNORMAL					if (conf->media == IF_IFACE_T1) {						/* Disable this interrupt as it may otherwise 						 * interfere with other working boards. */						cpc_writeb(falcbase + F_REG(IMR0, ch),							   cpc_readb(falcbase + F_REG(IMR0, ch))							   | IMR0_PDEN);					}					falc_disable_comm(card, ch);					// EVENT_FALC_ABNORMAL				}			}		} else {			pfalc->loss_mfa = 0;		}		/* Verify Remote Alarm */		if (frs0 & FRS0_RRA) {			if (!pfalc->yellow_alarm) {				pfalc->yellow_alarm = 1;				pfalc->rai++;				if (pfalc->sync) {					// EVENT_RAI					falc_disable_comm(card, ch);					// EVENT_RAI				}			}		} else {			pfalc->yellow_alarm = 0;		}	} /* if !PC300_UNFRAMED */	if (pfalc->red_alarm || pfalc->loss_fa ||	    pfalc->loss_mfa || pfalc->blue_alarm) {		if (pfalc->sync) {			pfalc->sync = 0;			chan->d.line_off++;			cpc_writeb(falcbase + card->hw.cpld_reg2,				   cpc_readb(falcbase + card->hw.cpld_reg2) &				   ~(CPLD_REG2_FALC_LED2 << (2 * ch)));		}	} else {		if (!pfalc->sync) {			pfalc->sync = 1;			chan->d.line_on++;			cpc_writeb(falcbase + card->hw.cpld_reg2,				   cpc_readb(falcbase + card->hw.cpld_reg2) |				   (CPLD_REG2_FALC_LED2 << (2 * ch)));		}	}	if (pfalc->sync && !pfalc->yellow_alarm) {		if (!pfalc->active) {			// EVENT_FALC_NORMAL			if (pfalc->loop_active) {				return;			}			if (conf->media == IF_IFACE_T1) {				cpc_writeb(falcbase + F_REG(IMR0, ch),					   cpc_readb(falcbase + F_REG(IMR0, ch)) & ~IMR0_PDEN);			}			falc_enable_comm(card, ch);			// EVENT_FALC_NORMAL			pfalc->active = 1;		}	} else {		if (pfalc->active) {			pfalc->active = 0;		}	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/7665a08928f241247afe8c76865cdbe4ef5489bf/pc300_drv.c/buggy/drivers/net/wan/pc300_drv.c