Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Enumerations | Functions | Variables
ctcm_fsms.h File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/timer.h>
#include <linux/bitops.h>
#include <linux/signal.h>
#include <linux/string.h>
#include <linux/ip.h>
#include <linux/if_arp.h>
#include <linux/tcp.h>
#include <linux/skbuff.h>
#include <linux/ctype.h>
#include <net/dst.h>
#include <linux/io.h>
#include <asm/ccwdev.h>
#include <asm/ccwgroup.h>
#include <linux/uaccess.h>
#include <asm/idals.h>
#include "fsm.h"
#include "ctcm_main.h"

Go to the source code of this file.

Enumerations

enum  ctc_ch_events {
  CTC_EVENT_IO_SUCCESS, CTC_EVENT_IO_EBUSY, CTC_EVENT_IO_ENODEV, CTC_EVENT_IO_UNKNOWN,
  CTC_EVENT_ATTNBUSY, CTC_EVENT_ATTN, CTC_EVENT_BUSY, CTC_EVENT_UC_RCRESET,
  CTC_EVENT_UC_RSRESET, CTC_EVENT_UC_TXTIMEOUT, CTC_EVENT_UC_TXPARITY, CTC_EVENT_UC_HWFAIL,
  CTC_EVENT_UC_RXPARITY, CTC_EVENT_UC_ZERO, CTC_EVENT_UC_UNKNOWN, CTC_EVENT_SC_UNKNOWN,
  CTC_EVENT_MC_FAIL, CTC_EVENT_MC_GOOD, CTC_EVENT_IRQ, CTC_EVENT_FINSTAT,
  CTC_EVENT_TIMER, CTC_EVENT_START, CTC_EVENT_STOP, CTC_NR_EVENTS,
  CTC_EVENT_SEND_XID = CTC_NR_EVENTS, CTC_EVENT_RSWEEP_TIMER, CTC_MPC_NR_EVENTS
}
 
enum  ctc_ch_states {
  CTC_STATE_IDLE, CTC_STATE_STOPPED, CTC_STATE_STARTWAIT, CTC_STATE_STARTRETRY,
  CTC_STATE_SETUPWAIT, CTC_STATE_RXINIT, CTC_STATE_TXINIT, CTC_STATE_RX,
  CTC_STATE_TX, CTC_STATE_RXIDLE, CTC_STATE_TXIDLE, CTC_STATE_RXERR,
  CTC_STATE_TXERR, CTC_STATE_TERM, CTC_STATE_DTERM, CTC_STATE_NOTOP,
  CTC_NR_STATES, CH_XID0_PENDING = CTC_NR_STATES, CH_XID0_INPROGRESS, CH_XID7_PENDING,
  CH_XID7_PENDING1, CH_XID7_PENDING2, CH_XID7_PENDING3, CH_XID7_PENDING4,
  CTC_MPC_NR_STATES
}
 
enum  dev_states {
  DEV_STATE_STOPPED, DEV_STATE_STARTWAIT_RXTX, DEV_STATE_STARTWAIT_RX, DEV_STATE_STARTWAIT_TX,
  DEV_STATE_STOPWAIT_RXTX, DEV_STATE_STOPWAIT_RX, DEV_STATE_STOPWAIT_TX, DEV_STATE_RUNNING,
  CTCM_NR_DEV_STATES, DEV_STATE_STOPPED, DEV_STATE_STARTWAIT, DEV_STATE_STOPWAIT,
  DEV_STATE_RUNNING, NR_DEV_STATES
}
 
enum  dev_events {
  DEV_EVENT_START, DEV_EVENT_STOP, DEV_EVENT_RXUP, DEV_EVENT_TXUP,
  DEV_EVENT_RXDOWN, DEV_EVENT_TXDOWN, DEV_EVENT_RESTART, CTCM_NR_DEV_EVENTS,
  DEV_EVENT_START, DEV_EVENT_STOP, DEV_EVENT_CONUP, DEV_EVENT_CONDOWN,
  NR_DEV_EVENTS
}
 
enum  mpcg_events {
  MPCG_EVENT_INOP, MPCG_EVENT_DISCONC, MPCG_EVENT_XID0DO, MPCG_EVENT_XID2,
  MPCG_EVENT_XID2DONE, MPCG_EVENT_XID7DONE, MPCG_EVENT_TIMER, MPCG_EVENT_DOIO,
  MPCG_NR_EVENTS
}
 
enum  mpcg_states {
  MPCG_STATE_RESET, MPCG_STATE_INOP, MPCG_STATE_XID2INITW, MPCG_STATE_XID2INITX,
  MPCG_STATE_XID7INITW, MPCG_STATE_XID7INITX, MPCG_STATE_XID0IOWAIT, MPCG_STATE_XID0IOWAIX,
  MPCG_STATE_XID7INITI, MPCG_STATE_XID7INITZ, MPCG_STATE_XID7INITF, MPCG_STATE_FLOWC,
  MPCG_STATE_READY, MPCG_NR_STATES
}
 

Functions

void ctcm_ccw_check_rc (struct channel *ch, int rc, char *msg)
 
void ctcm_purge_skb_queue (struct sk_buff_head *q)
 
void fsm_action_nop (fsm_instance *fi, int event, void *arg)
 
void ctcm_chx_txidle (fsm_instance *fi, int event, void *arg)
 
void ctcmpc_chx_rxidle (fsm_instance *fi, int event, void *arg)
 

Variables

const charctc_ch_event_names []
 
const charctc_ch_state_names []
 
const fsm_node ch_fsm []
 
int ch_fsm_len
 
const fsm_node ctcmpc_ch_fsm []
 
int mpc_ch_fsm_len
 
const chardev_state_names []
 
const chardev_event_names []
 
const fsm_node dev_fsm []
 
int dev_fsm_len
 

Enumeration Type Documentation

Enumerator:
CTC_EVENT_IO_SUCCESS 
CTC_EVENT_IO_EBUSY 
CTC_EVENT_IO_ENODEV 
CTC_EVENT_IO_UNKNOWN 
CTC_EVENT_ATTNBUSY 
CTC_EVENT_ATTN 
CTC_EVENT_BUSY 
CTC_EVENT_UC_RCRESET 
CTC_EVENT_UC_RSRESET 
CTC_EVENT_UC_TXTIMEOUT 
CTC_EVENT_UC_TXPARITY 
CTC_EVENT_UC_HWFAIL 
CTC_EVENT_UC_RXPARITY 
CTC_EVENT_UC_ZERO 
CTC_EVENT_UC_UNKNOWN 
CTC_EVENT_SC_UNKNOWN 
CTC_EVENT_MC_FAIL 
CTC_EVENT_MC_GOOD 
CTC_EVENT_IRQ 
CTC_EVENT_FINSTAT 
CTC_EVENT_TIMER 
CTC_EVENT_START 
CTC_EVENT_STOP 
CTC_NR_EVENTS 
CTC_EVENT_SEND_XID 
CTC_EVENT_RSWEEP_TIMER 
CTC_MPC_NR_EVENTS 

Definition at line 55 of file ctcm_fsms.h.

Enumerator:
CTC_STATE_IDLE 
CTC_STATE_STOPPED 
CTC_STATE_STARTWAIT 
CTC_STATE_STARTRETRY 
CTC_STATE_SETUPWAIT 
CTC_STATE_RXINIT 
CTC_STATE_TXINIT 
CTC_STATE_RX 
CTC_STATE_TX 
CTC_STATE_RXIDLE 
CTC_STATE_TXIDLE 
CTC_STATE_RXERR 
CTC_STATE_TXERR 
CTC_STATE_TERM 
CTC_STATE_DTERM 
CTC_STATE_NOTOP 
CTC_NR_STATES 
CH_XID0_PENDING 
CH_XID0_INPROGRESS 
CH_XID7_PENDING 
CH_XID7_PENDING1 
CH_XID7_PENDING2 
CH_XID7_PENDING3 
CH_XID7_PENDING4 
CTC_MPC_NR_STATES 

Definition at line 117 of file ctcm_fsms.h.

enum dev_events
Enumerator:
DEV_EVENT_START 
DEV_EVENT_STOP 
DEV_EVENT_RXUP 
DEV_EVENT_TXUP 
DEV_EVENT_RXDOWN 
DEV_EVENT_TXDOWN 
DEV_EVENT_RESTART 
CTCM_NR_DEV_EVENTS 
DEV_EVENT_START 
DEV_EVENT_STOP 
DEV_EVENT_CONUP 
DEV_EVENT_CONDOWN 
NR_DEV_EVENTS 

MUST be always the last element!!

Definition at line 219 of file ctcm_fsms.h.

enum dev_states
Enumerator:
DEV_STATE_STOPPED 
DEV_STATE_STARTWAIT_RXTX 
DEV_STATE_STARTWAIT_RX 
DEV_STATE_STARTWAIT_TX 
DEV_STATE_STOPWAIT_RXTX 
DEV_STATE_STOPWAIT_RX 
DEV_STATE_STOPWAIT_TX 
DEV_STATE_RUNNING 
CTCM_NR_DEV_STATES 
DEV_STATE_STOPPED 
DEV_STATE_STARTWAIT 
DEV_STATE_STOPWAIT 
DEV_STATE_RUNNING 
NR_DEV_STATES 

MUST be always the last element!!

Definition at line 198 of file ctcm_fsms.h.

Enumerator:
MPCG_EVENT_INOP 
MPCG_EVENT_DISCONC 
MPCG_EVENT_XID0DO 
MPCG_EVENT_XID2 
MPCG_EVENT_XID2DONE 
MPCG_EVENT_XID7DONE 
MPCG_EVENT_TIMER 
MPCG_EVENT_DOIO 
MPCG_NR_EVENTS 

Definition at line 326 of file ctcm_fsms.h.

Enumerator:
MPCG_STATE_RESET 
MPCG_STATE_INOP 
MPCG_STATE_XID2INITW 
MPCG_STATE_XID2INITX 
MPCG_STATE_XID7INITW 
MPCG_STATE_XID7INITX 
MPCG_STATE_XID0IOWAIT 
MPCG_STATE_XID0IOWAIX 
MPCG_STATE_XID7INITI 
MPCG_STATE_XID7INITZ 
MPCG_STATE_XID7INITF 
MPCG_STATE_FLOWC 
MPCG_STATE_READY 
MPCG_NR_STATES 

Definition at line 338 of file ctcm_fsms.h.

Function Documentation

void ctcm_ccw_check_rc ( struct channel ch,
int  rc,
char msg 
)

Check return code of a preceding ccw_device call, halt_IO etc...

ch : The channel, the error belongs to. Returns the error code (!= 0) to inspect.

Definition at line 190 of file ctcm_fsms.c.

void ctcm_chx_txidle ( fsm_instance fi,
int  event,
void arg 
)

Initial data is sent. Notify device statemachine that we are up and running.

fi An instance of a channel statemachine. event The event, just happened. arg Generic pointer, casted from channel * upon call.

Definition at line 336 of file ctcm_fsms.c.

void ctcm_purge_skb_queue ( struct sk_buff_head q)

Definition at line 213 of file ctcm_fsms.c.

void ctcmpc_chx_rxidle ( fsm_instance fi,
int  event,
void arg 
)

Got initial data, check it. If OK, notify device statemachine that we are up and running.

fi An instance of a channel statemachine. event The event, just happened. arg Generic pointer, casted from channel * upon call.

Definition at line 1546 of file ctcm_fsms.c.

void fsm_action_nop ( fsm_instance fi,
int  event,
void arg 
)

Variable Documentation

const fsm_node ch_fsm[]

Definition at line 1095 of file ctcm_fsms.c.

int ch_fsm_len

Definition at line 1193 of file ctcm_fsms.c.

const char* ctc_ch_event_names[]

Definition at line 71 of file ctcm_fsms.c.

const char* ctc_ch_state_names[]

Definition at line 102 of file ctcm_fsms.c.

const fsm_node ctcmpc_ch_fsm[]

Definition at line 1858 of file ctcm_fsms.c.

const char* dev_event_names[]

Definition at line 61 of file ctcm_fsms.c.

const fsm_node dev_fsm[]

Definition at line 2261 of file ctcm_fsms.c.

int dev_fsm_len

Definition at line 2301 of file ctcm_fsms.c.

const char* dev_state_names[]

Definition at line 50 of file ctcm_fsms.c.

int mpc_ch_fsm_len

Definition at line 2059 of file ctcm_fsms.c.