drivers/net/fddi/skfp/cfm.c

Source file repositories/reference/linux-study-clean/drivers/net/fddi/skfp/cfm.c

File Facts

System
Linux kernel
Corpus path
drivers/net/fddi/skfp/cfm.c
Extension
.c
Size
15940 bytes
Lines
609
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if ( !THRU_ENABLED(smc) && smc->y[PB].cf_join ) {
			phy->wc_flag = TRUE ;
		} else {
			phy->wc_flag = FALSE ;
		}

		break;
	case TB:
		/* take precedence over PA */
		phy->wc_flag = FALSE ;
		break;
	case TS:
		phy->wc_flag = FALSE ;
		break;
	case TM:
		phy->wc_flag = FALSE ;
		break;
	}

}

void all_selection_criteria(struct s_smc *smc)
{
	struct s_phy	*phy ;
	int		p ;

	for ( p = 0,phy = smc->y ; p < NUMPHYS; p++, phy++ ) {
		/* Do the selection criteria */
		selection_criteria (smc,phy);
	}
}

static void cem_priv_state(struct s_smc *smc, int event)
/* State machine for private PORT states: used to optimize dual homing */
{
	int	np;	/* Number of the port */
	int	i;

	/* Do this only in a DAS */
	if (smc->s.sas != SMT_DAS )
		return ;

	np = event - CF_JOIN;

	if (np != PA && np != PB) {
		return ;
	}
	/* Change the port state according to the event (portnumber) */
	if (smc->y[np].cf_join) {
		smc->y[np].cem_pst = CEM_PST_UP ;
	} else if (!smc->y[np].wc_flag) {
		/* set the port to done only if it is not withheld */
		smc->y[np].cem_pst = CEM_PST_DOWN ;
	}

	/* Don't set an hold port to down */

	/* Check all ports of restart conditions */
	for (i = 0 ; i < 2 ; i ++ ) {
		/* Check all port for PORT is on hold and no withhold is done */
		if ( smc->y[i].cem_pst == CEM_PST_HOLD && !smc->y[i].wc_flag ) {
			smc->y[i].cem_pst = CEM_PST_DOWN;
			queue_event(smc,(int)(EVENT_PCM+i),PC_START) ;
		}
		if ( smc->y[i].cem_pst == CEM_PST_UP && smc->y[i].wc_flag ) {
			smc->y[i].cem_pst = CEM_PST_HOLD;
			queue_event(smc,(int)(EVENT_PCM+i),PC_START) ;
		}
		if ( smc->y[i].cem_pst == CEM_PST_DOWN && smc->y[i].wc_flag ) {
			/*
			 * The port must be restarted when the wc_flag
			 * will be reset. So set the port on hold.
			 */
			smc->y[i].cem_pst = CEM_PST_HOLD;
		}
	}
	return ;
}

/*
	CFM state machine
	called by dispatcher

	do
		display state change
		process event
	until SM is stable
*/
void cfm(struct s_smc *smc, int event)
{

Annotation

Implementation Notes