linux/drivers/net/fddi/skfp/ecm.c

// SPDX-License-Identifier: GPL-2.0-or-later
/******************************************************************************
 *
 *	(C)Copyright 1998,1999 SysKonnect,
 *	a business unit of Schneider & Koch & Co. Datensysteme GmbH.
 *
 *	See the file "skfddi.c" for further information.
 *
 *	The information in this file is provided "AS IS" without warranty.
 *
 ******************************************************************************/

/*
	SMT ECM
	Entity Coordination Management
	Hardware independent state machine
*/

/*
 * Hardware independent state machine implemantation
 * The following external SMT functions are referenced :
 *
 * 		queue_event()
 * 		smt_timer_start()
 * 		smt_timer_stop()
 *
 * 	The following external HW dependent functions are referenced :
 * 		sm_pm_bypass_req()
 * 		sm_pm_get_ls()
 * 
 * 	The following HW dependent events are required :
 *		NONE
 *
 */

#include "h/types.h"
#include "h/fddi.h"
#include "h/smc.h"

#define KERNEL
#include "h/smtstate.h"

/*
 * FSM Macros
 */
#define AFLAG
#define GO_STATE(x)
#define ACTIONS_DONE()
#define ACTIONS(x)

#define EC0_OUT
#define EC1_IN
#define EC2_TRACE
#define EC3_LEAVE
#define EC4_PATH_TEST
#define EC5_INSERT
#define EC6_CHECK
#define EC7_DEINSERT

/*
 * symbolic state names
 */
static const char * const ecm_states[] = ;

/*
 * symbolic event names
 */
static const char * const ecm_events[] = ;

/*
 * all Globals  are defined in smc.h
 * struct s_ecm
 */

/*
 * function declarations
 */

static void ecm_fsm(struct s_smc *smc, int cmd);
static void start_ecm_timer(struct s_smc *smc, u_long value, int event);
static void stop_ecm_timer(struct s_smc *smc);
static void prop_actions(struct s_smc *smc);

/*
	init ECM state machine
	clear all ECM vars and flags
*/
void ecm_init(struct s_smc *smc)
{}

/*
	ECM state machine
	called by dispatcher

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

/*
	process ECM event
*/
static void ecm_fsm(struct s_smc *smc, int cmd)
{}

#ifndef	CONCENTRATOR
/*
 * trace propagation actions for SAS & DAS
 */
static void prop_actions(struct s_smc *smc)
{}
#else
/*
 * trace propagation actions for Concentrator
 */
static void prop_actions(struct s_smc *smc)
{
	int	initiator ;
	int	upstream ;
	int	p ;

	RS_SET(smc,RS_EVENT) ;
	while (smc->e.trace_prop) {
		DB_ECM("ECM : prop_actions - trace_prop %d",
		       smc->e.trace_prop);

		if (smc->e.trace_prop & ENTITY_BIT(ENTITY_MAC)) {
			initiator = ENTITY_MAC ;
			smc->e.trace_prop &= ~ENTITY_BIT(ENTITY_MAC) ;
			DB_ECM("ECM: MAC initiates trace");
		}
		else {
			for (p = NUMPHYS-1 ; p >= 0 ; p--) {
				if (smc->e.trace_prop &
					ENTITY_BIT(ENTITY_PHY(p)))
					break ;
			}
			initiator = ENTITY_PHY(p) ;
			smc->e.trace_prop &= ~ENTITY_BIT(ENTITY_PHY(p)) ;
		}
		upstream = cem_get_upstream(smc,initiator) ;

		if (upstream == ENTITY_MAC) {
			/* signal trace termination */
			DB_ECM("ECM : TRACE terminated");
			smc->e.path_test = PT_PENDING ;
		}
		else {
			/* trace propagate upstream */
			DB_ECM("ECM : propagate TRACE on PHY %d", upstream);
			queue_event(smc,EVENT_PCM+upstream,PC_TRACE) ;
		}
	}
}
#endif


/*
 * SMT timer interface
 *	start ECM timer
 */
static void start_ecm_timer(struct s_smc *smc, u_long value, int event)
{}

/*
 * SMT timer interface
 *	stop ECM timer
 */
static void stop_ecm_timer(struct s_smc *smc)
{}