1 /*
2  * This software may be used and distributed according to the terms
3  * of the GNU General Public License, incorporated herein by reference.
4  */
5 
6 /*
7  * IOCTL Command Codes
8  */
9 #define SCIOCLOAD	0x01	/* Load a firmware record */
10 #define SCIOCRESET	0x02	/* Perform hard reset */
11 #define SCIOCDEBUG	0x03	/* Set debug level */
12 #define SCIOCREV	0x04	/* Get driver revision(s) */
13 #define SCIOCSTART	0x05	/* Start the firmware */
14 #define SCIOCGETSWITCH	0x06	/* Get switch type */
15 #define SCIOCSETSWITCH	0x07	/* Set switch type */
16 #define SCIOCGETSPID	0x08	/* Get channel SPID */
17 #define SCIOCSETSPID	0x09 	/* Set channel SPID */
18 #define SCIOCGETDN	0x0A	/* Get channel DN */
19 #define SCIOCSETDN	0x0B 	/* Set channel DN */
20 #define SCIOCTRACE	0x0C	/* Toggle trace mode */
21 #define SCIOCSTAT	0x0D	/* Get line status */
22 #define SCIOCGETSPEED	0x0E	/* Set channel speed */
23 #define SCIOCSETSPEED	0x0F	/* Set channel speed */
24 #define SCIOCLOOPTST	0x10	/* Perform loopback test */
25 
26 typedef struct {
27 	int device;
28 	int channel;
29 	unsigned long command;
30 	void *dataptr;
31 } scs_ioctl;
32 
33 /* Size of strings */
34 #define SCIOC_SPIDSIZE		49
35 #define SCIOC_DNSIZE		SCIOC_SPIDSIZE
36 #define SCIOC_REVSIZE		SCIOC_SPIDSIZE
37 #define SCIOC_SRECSIZE		49
38 
39 typedef struct {
40 	unsigned long tx_good;
41 	unsigned long tx_bad;
42 	unsigned long rx_good;
43 	unsigned long rx_bad;
44 } ChLinkStats;
45 
46 typedef struct {
47 	char spid[49];
48 	char dn[49];
49 	char call_type;
50 	char phy_stat;
51 	ChLinkStats link_stats;
52 } BRIStat;
53 
54 typedef BRIStat POTStat;
55 
56 typedef struct {
57 	char call_type;
58 	char call_state;
59 	char serv_state;
60 	char phy_stat;
61 	ChLinkStats link_stats;
62 } PRIStat;
63 
64 typedef char PRIInfo;
65 typedef char BRIInfo;
66 typedef char POTInfo;
67 
68 
69 typedef struct {
70 	char acfa_nos;
71 	char acfa_ais;
72 	char acfa_los;
73 	char acfa_rra;
74 	char acfa_slpp;
75 	char acfa_slpn;
76 	char acfa_fsrf;
77 } ACFAStat;
78 
79 typedef struct {
80 	unsigned char modelid;
81 	char serial_no[13];
82 	char part_no[13];
83 	char load_ver[11];
84 	char proc_ver[11];
85 	int iobase;
86 	long rambase;
87 	char irq;
88 	long ramsize;
89 	char interface;
90 	char switch_type;
91 	char l1_status;
92 	char l2_status;
93 	ChLinkStats dch_stats;
94 	ACFAStat AcfaStats;
95 	union {
96 		PRIStat pristats[23];
97 		BRIStat bristats[2];
98 		POTStat potsstats[2];
99 	} status;
100 	union {
101 		PRIInfo priinfo;
102 		BRIInfo briinfo;
103 		POTInfo potsinfo;
104 	} info;
105 } boardInfo;
106