1139790Simp/*- 2123120Simp * Ioctl interface to Cronyx serial drivers. 3123120Simp * 4123120Simp * Copyright (C) 1997-2002 Cronyx Engineering. 5123120Simp * Author: Serge Vakulenko, <vak@cronyx.ru> 6123120Simp * 7155049Srik * Copyright (C) 2001-2005 Cronyx Engineering. 8155049Srik * Author: Roman Kurakin, <rik@FreeBSD.org> 9123120Simp * 10155049Srik * Copyright (C) 2004-2005 Cronyx Engineering. 11155049Srik * Author: Leo Yuriev, <ly@cronyx.ru> 12155049Srik * 13123120Simp * This software is distributed with NO WARRANTIES, not even the implied 14123120Simp * warranties for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15123120Simp * 16123120Simp * Authors grant any other persons or organisations permission to use 17123120Simp * or modify this software as long as this message is kept with the software, 18123120Simp * all derivative works or modified versions. 19123120Simp * 20155049Srik * Cronyx Id: cserial.h,v 1.4.2.2 2005/11/09 13:01:35 rik Exp $ 21123120Simp * $FreeBSD$ 22123120Simp */ 23123120Simp 24123120Simp/* 25123120Simp * General channel statistics. 26123120Simp */ 27123120Simpstruct serial_statistics { 28123120Simp unsigned long rintr; /* receive interrupts */ 29123120Simp unsigned long tintr; /* transmit interrupts */ 30123120Simp unsigned long mintr; /* modem interrupts */ 31123120Simp unsigned long ibytes; /* input bytes */ 32123120Simp unsigned long ipkts; /* input packets */ 33123120Simp unsigned long ierrs; /* input errors */ 34123120Simp unsigned long obytes; /* output bytes */ 35123120Simp unsigned long opkts; /* output packets */ 36123120Simp unsigned long oerrs; /* output errors */ 37123120Simp}; 38123120Simp 39123120Simp/* 40123120Simp * Statistics for E1/G703 channels. 41123120Simp */ 42123120Simpstruct e1_counters { 43123120Simp unsigned long bpv; /* bipolar violations */ 44123120Simp unsigned long fse; /* frame sync errors */ 45123120Simp unsigned long crce; /* CRC errors */ 46123120Simp unsigned long rcrce; /* remote CRC errors (E-bit) */ 47123120Simp unsigned long uas; /* unavailable seconds */ 48123120Simp unsigned long les; /* line errored seconds */ 49123120Simp unsigned long es; /* errored seconds */ 50123120Simp unsigned long bes; /* bursty errored seconds */ 51123120Simp unsigned long ses; /* severely errored seconds */ 52123120Simp unsigned long oofs; /* out of frame seconds */ 53123120Simp unsigned long css; /* controlled slip seconds */ 54123120Simp unsigned long dm; /* degraded minutes */ 55123120Simp}; 56123120Simp 57123120Simpstruct e1_statistics { 58123120Simp unsigned long status; /* line status bit mask */ 59123120Simp unsigned long cursec; /* seconds in current interval */ 60123120Simp unsigned long totsec; /* total seconds elapsed */ 61123120Simp struct e1_counters currnt; /* current 15-min interval data */ 62123120Simp struct e1_counters total; /* total statistics data */ 63123120Simp struct e1_counters interval [48]; /* 12 hour period data */ 64123120Simp}; 65123120Simp 66123120Simpstruct e3_statistics { 67123120Simp unsigned long status; 68123120Simp unsigned long cursec; 69123120Simp unsigned long totsec; 70123120Simp unsigned long ccv; 71123120Simp unsigned long tcv; 72123120Simp unsigned long icv[48]; 73123120Simp}; 74123120Simp 75123120Simp#define M_ASYNC 0 /* asynchronous mode */ 76123120Simp#define M_HDLC 1 /* bit-sync mode (HDLC) */ 77123120Simp#define M_G703 2 78123120Simp#define M_E1 3 79123120Simp 80123120Simp/* 81123120Simp * Receive error codes. 82123120Simp */ 83123120Simp#define ER_FRAMING 1 /* framing error */ 84123120Simp#define ER_CHECKSUM 2 /* parity/CRC error */ 85123120Simp#define ER_BREAK 3 /* break state */ 86123120Simp#define ER_OVERFLOW 4 /* receive buffer overflow */ 87123120Simp#define ER_OVERRUN 5 /* receive fifo overrun */ 88123120Simp#define ER_UNDERRUN 6 /* transmit fifo underrun */ 89123120Simp#define ER_SCC_FRAMING 7 /* subchannel framing error */ 90123120Simp#define ER_SCC_OVERFLOW 8 /* subchannel receive buffer overflow */ 91123120Simp#define ER_SCC_OVERRUN 9 /* subchannel receiver overrun */ 92155049Srik#define ER_SCC_UNDERRUN 10 /* subchannel transmiter underrun */ 93155049Srik#define ER_BUS 11 /* system bus is too busy (e.g PCI) */ 94123120Simp 95123120Simp/* 96123120Simp * E1 channel status. 97123120Simp */ 98123120Simp#define E1_NOALARM 0x0001 /* no alarm present */ 99123120Simp#define E1_FARLOF 0x0002 /* receiving far loss of framing */ 100155049Srik#define E1_CRC4E 0x0004 /* crc4 errors */ 101123120Simp#define E1_AIS 0x0008 /* receiving all ones */ 102123120Simp#define E1_LOF 0x0020 /* loss of framing */ 103123120Simp#define E1_LOS 0x0040 /* loss of signal */ 104123120Simp#define E1_AIS16 0x0100 /* receiving all ones in timeslot 16 */ 105123120Simp#define E1_FARLOMF 0x0200 /* receiving alarm in timeslot 16 */ 106123120Simp#define E1_LOMF 0x0400 /* loss of multiframe sync */ 107123120Simp#define E1_TSTREQ 0x0800 /* test code detected */ 108123120Simp#define E1_TSTERR 0x1000 /* test error */ 109123120Simp 110123120Simp#define E3_LOS 0x00000002 /* Lost of synchronization */ 111123120Simp#define E3_TXE 0x00000004 /* Transmit error */ 112123120Simp 113123120Simp/* 114123120Simp * Query the mask of all registered channels, max 128. 115123120Simp */ 116123120Simp#define SERIAL_GETREGISTERED _IOR ('x', 0, char[16]) 117123120Simp 118123120Simp/* 119123120Simp * Attach/detach the protocol to the channel. 120123120Simp * The protocol is given by it's name, char[8]. 121123120Simp * For example "async", "hdlc", "cisco", "fr", "ppp". 122123120Simp */ 123123120Simp#define SERIAL_GETPROTO _IOR ('x', 1, char [8]) 124123120Simp#define SERIAL_SETPROTO _IOW ('x', 1, char [8]) 125123120Simp 126123120Simp/* 127123120Simp * Query/set the hardware mode for the channel. 128123120Simp */ 129123120Simp#define SERIAL_GETMODE _IOR ('x', 2, int) 130123120Simp#define SERIAL_SETMODE _IOW ('x', 2, int) 131123120Simp 132123120Simp#define SERIAL_ASYNC 1 133123120Simp#define SERIAL_HDLC 2 134155049Srik#define SERIAL_RAW 3 135123120Simp 136123120Simp/* 137123120Simp * Get/clear the channel statistics. 138123120Simp */ 139123120Simp#define SERIAL_GETSTAT _IOR ('x', 3, struct serial_statistics) 140123120Simp#define SERIAL_GETESTAT _IOR ('x', 3, struct e1_statistics) 141123120Simp#define SERIAL_GETE3STAT _IOR ('x', 3, struct e3_statistics) 142123120Simp#define SERIAL_CLRSTAT _IO ('x', 3) 143123120Simp 144123120Simp/* 145123120Simp * Query/set the synchronization mode and baud rate. 146123120Simp * If baud==0 then the external clock is used. 147123120Simp */ 148123120Simp#define SERIAL_GETBAUD _IOR ('x', 4, long) 149123120Simp#define SERIAL_SETBAUD _IOW ('x', 4, long) 150123120Simp 151123120Simp/* 152123120Simp * Query/set the internal loopback mode, 153123120Simp * useful for debugging purposes. 154123120Simp */ 155123120Simp#define SERIAL_GETLOOP _IOR ('x', 5, int) 156123120Simp#define SERIAL_SETLOOP _IOW ('x', 5, int) 157123120Simp 158123120Simp/* 159123120Simp * Query/set the DPLL mode, commonly used with NRZI 160123120Simp * for channels lacking synchro signals. 161123120Simp */ 162123120Simp#define SERIAL_GETDPLL _IOR ('x', 6, int) 163123120Simp#define SERIAL_SETDPLL _IOW ('x', 6, int) 164123120Simp 165123120Simp/* 166123120Simp * Query/set the NRZI encoding (default is NRZ). 167123120Simp */ 168123120Simp#define SERIAL_GETNRZI _IOR ('x', 7, int) 169123120Simp#define SERIAL_SETNRZI _IOW ('x', 7, int) 170123120Simp 171123120Simp/* 172123120Simp * Invert receive and transmit clock. 173123120Simp */ 174123120Simp#define SERIAL_GETINVCLK _IOR ('x', 8, int) 175123120Simp#define SERIAL_SETINVCLK _IOW ('x', 8, int) 176123120Simp 177123120Simp/* 178123120Simp * Query/set the E1/G703 synchronization mode. 179123120Simp */ 180123120Simp#define SERIAL_GETCLK _IOR ('x', 9, int) 181123120Simp#define SERIAL_SETCLK _IOW ('x', 9, int) 182123120Simp 183155049Srik#define E1CLK_RECOVERY -1 184123120Simp#define E1CLK_INTERNAL 0 185123120Simp#define E1CLK_RECEIVE 1 186123120Simp#define E1CLK_RECEIVE_CHAN0 2 187123120Simp#define E1CLK_RECEIVE_CHAN1 3 188123120Simp#define E1CLK_RECEIVE_CHAN2 4 189123120Simp#define E1CLK_RECEIVE_CHAN3 5 190123120Simp 191123120Simp/* 192123120Simp * Query/set the E1 timeslot mask. 193123120Simp */ 194123120Simp#define SERIAL_GETTIMESLOTS _IOR ('x', 10, long) 195123120Simp#define SERIAL_SETTIMESLOTS _IOW ('x', 10, long) 196123120Simp 197123120Simp/* 198123120Simp * Query/set the E1 subchannel timeslot mask. 199123120Simp */ 200123120Simp#define SERIAL_GETSUBCHAN _IOR ('x', 11, long) 201123120Simp#define SERIAL_SETSUBCHAN _IOW ('x', 11, long) 202123120Simp 203123120Simp/* 204123120Simp * Query/set the high input sensitivity mode (E1). 205123120Simp */ 206123120Simp#define SERIAL_GETHIGAIN _IOR ('x', 12, int) 207123120Simp#define SERIAL_SETHIGAIN _IOW ('x', 12, int) 208123120Simp 209123120Simp/* 210123120Simp * Query the input signal level in santibells. 211123120Simp */ 212123120Simp#define SERIAL_GETLEVEL _IOR ('x', 13, int) 213123120Simp 214123120Simp/* 215123120Simp * Get the channel name. 216123120Simp */ 217123120Simp#define SERIAL_GETNAME _IOR ('x', 14, char [32]) 218123120Simp 219123120Simp/* 220123120Simp * Get version string. 221123120Simp */ 222123120Simp#define SERIAL_GETVERSIONSTRING _IOR ('x', 15, char [256]) 223123120Simp 224123120Simp/* 225123120Simp * Query/set master channel. 226123120Simp */ 227123120Simp#define SERIAL_GETMASTER _IOR ('x', 16, char [16]) 228123120Simp#define SERIAL_SETMASTER _IOW ('x', 16, char [16]) 229123120Simp 230123120Simp/* 231123120Simp * Query/set keepalive. 232123120Simp */ 233123120Simp#define SERIAL_GETKEEPALIVE _IOR ('x', 17, int) 234123120Simp#define SERIAL_SETKEEPALIVE _IOW ('x', 17, int) 235123120Simp 236123120Simp/* 237123120Simp * Query/set E1 configuration. 238123120Simp */ 239123120Simp#define SERIAL_GETCFG _IOR ('x', 18, char) 240123120Simp#define SERIAL_SETCFG _IOW ('x', 18, char) 241123120Simp 242123120Simp/* 243123120Simp * Query/set debug. 244123120Simp */ 245123120Simp#define SERIAL_GETDEBUG _IOR ('x', 19, int) 246123120Simp#define SERIAL_SETDEBUG _IOW ('x', 19, int) 247123120Simp 248123120Simp/* 249123120Simp * Query/set phony mode (E1). 250123120Simp */ 251123120Simp#define SERIAL_GETPHONY _IOR ('x', 20, int) 252123120Simp#define SERIAL_SETPHONY _IOW ('x', 20, int) 253123120Simp 254123120Simp/* 255123120Simp * Query/set timeslot 16 usage mode (E1). 256123120Simp */ 257123120Simp#define SERIAL_GETUSE16 _IOR ('x', 21, int) 258123120Simp#define SERIAL_SETUSE16 _IOW ('x', 21, int) 259123120Simp 260123120Simp/* 261123120Simp * Query/set crc4 mode (E1). 262123120Simp */ 263123120Simp#define SERIAL_GETCRC4 _IOR ('x', 22, int) 264123120Simp#define SERIAL_SETCRC4 _IOW ('x', 22, int) 265123120Simp 266123120Simp/* 267123120Simp * Query/set the timeout to recover after transmit interrupt loss. 268123120Simp * If timo==0 recover will be disabled. 269123120Simp */ 270123120Simp#define SERIAL_GETTIMO _IOR ('x', 23, long) 271123120Simp#define SERIAL_SETTIMO _IOW ('x', 23, long) 272123120Simp 273123120Simp/* 274123120Simp * Query/set port type for old models of Sigma 275123120Simp * -1 Fixed or cable select 276123120Simp * 0 RS-232 277123120Simp * 1 V35 278123120Simp * 2 RS-449 279123120Simp * 3 E1 (only for Windows 2000) 280123120Simp * 4 G.703 (only for Windows 2000) 281123120Simp * 5 DATA (only for Windows 2000) 282123120Simp * 6 E3 (only for Windows 2000) 283123120Simp * 7 T3 (only for Windows 2000) 284123120Simp * 8 STS1 (only for Windows 2000) 285123120Simp */ 286123120Simp#define SERIAL_GETPORT _IOR ('x', 25, int) 287123120Simp#define SERIAL_SETPORT _IOW ('x', 25, int) 288123120Simp 289123120Simp/* 290123120Simp * Add the virtual channel DLCI (Frame Relay). 291123120Simp */ 292123120Simp#define SERIAL_ADDDLCI _IOW ('x', 26, int) 293123120Simp 294123120Simp/* 295123120Simp * Invert receive clock. 296123120Simp */ 297123120Simp#define SERIAL_GETINVRCLK _IOR ('x', 27, int) 298123120Simp#define SERIAL_SETINVRCLK _IOW ('x', 27, int) 299123120Simp 300123120Simp/* 301123120Simp * Invert transmit clock. 302123120Simp */ 303123120Simp#define SERIAL_GETINVTCLK _IOR ('x', 28, int) 304123120Simp#define SERIAL_SETINVTCLK _IOW ('x', 28, int) 305123120Simp 306123120Simp/* 307123120Simp * Unframed E1 mode. 308123120Simp */ 309123120Simp#define SERIAL_GETUNFRAM _IOR ('x', 29, int) 310123120Simp#define SERIAL_SETUNFRAM _IOW ('x', 29, int) 311123120Simp 312123120Simp/* 313123120Simp * E1 monitoring mode. 314123120Simp */ 315123120Simp#define SERIAL_GETMONITOR _IOR ('x', 30, int) 316123120Simp#define SERIAL_SETMONITOR _IOW ('x', 30, int) 317123120Simp 318123120Simp/* 319123120Simp * Interrupt number. 320123120Simp */ 321123120Simp#define SERIAL_GETIRQ _IOR ('x', 31, int) 322123120Simp 323123120Simp/* 324123120Simp * Reset. 325123120Simp */ 326123120Simp#define SERIAL_RESET _IO ('x', 32) 327123120Simp 328123120Simp/* 329123120Simp * Hard reset. 330123120Simp */ 331123120Simp#define SERIAL_HARDRESET _IO ('x', 33) 332123120Simp 333123120Simp/* 334123120Simp * Query cable type. 335123120Simp */ 336123120Simp#define SERIAL_GETCABLE _IOR ('x', 34, int) 337123120Simp 338123120Simp/* 339123120Simp * Assignment of HDLC ports to E1 channels. 340123120Simp */ 341123120Simp#define SERIAL_GETDIR _IOR ('x', 35, int) 342123120Simp#define SERIAL_SETDIR _IOW ('x', 35, int) 343123120Simp 344123120Simpstruct dxc_table { /* cross-connector parameters */ 345123120Simp unsigned char ts [32]; /* timeslot number */ 346123120Simp unsigned char link [32]; /* E1 link number */ 347123120Simp}; 348123120Simp 349123120Simp/* 350123120Simp * DXC cross-connector settings for E1 channels. 351123120Simp */ 352123120Simp#define SERIAL_GETDXC _IOR ('x', 36, struct dxc_table) 353123120Simp#define SERIAL_SETDXC _IOW ('x', 36, struct dxc_table) 354123120Simp 355123120Simp/* 356123120Simp * Scrambler for G.703. 357123120Simp */ 358123120Simp#define SERIAL_GETSCRAMBLER _IOR ('x', 37, int) 359123120Simp#define SERIAL_SETSCRAMBLER _IOW ('x', 37, int) 360123120Simp 361123120Simp/* 362123120Simp * Length of cable for T3 and STS-1. 363123120Simp */ 364123120Simp#define SERIAL_GETCABLEN _IOR ('x', 38, int) 365123120Simp#define SERIAL_SETCABLEN _IOW ('x', 38, int) 366123120Simp 367123120Simp/* 368123120Simp * Remote loopback for E3, T3 and STS-1. 369123120Simp */ 370123120Simp#define SERIAL_GETRLOOP _IOR ('x', 39, int) 371123120Simp#define SERIAL_SETRLOOP _IOW ('x', 39, int) 372123120Simp 373123120Simp/* 374155049Srik * G.703 line code 375155049Srik */ 376155049Srik#define SERIAL_GETLCODE _IOR ('x', 40, int) 377155049Srik#define SERIAL_SETLCODE _IOW ('x', 40, int) 378155049Srik 379155049Srik/* 380155049Srik * MTU 381155049Srik */ 382155049Srik#define SERIAL_GETMTU _IOR ('x', 41, int) 383155049Srik#define SERIAL_SETMTU _IOW ('x', 41, int) 384155049Srik 385155049Srik/* 386155049Srik * Receive Queue Length 387155049Srik */ 388155049Srik#define SERIAL_GETRQLEN _IOR ('x', 42, int) 389155049Srik#define SERIAL_SETRQLEN _IOW ('x', 42, int) 390155049Srik 391155049Srik#ifdef __KERNEL__ 392155049Srik#ifdef CRONYX_LYSAP 393155049Srik# define LYSAP_PEER_ADD _IOWR('x', 101, lysap_peer_config_t) 394155049Srik# define LYSAP_PEER_REMOVE _IOW('x', 102, unsigned) 395155049Srik# define LYSAP_PEER_INFO _IOWR('x', 103, lysap_peer_info_t) 396155049Srik# define LYSAP_PEER_COUNT _IOR('x', 104, unsigned) 397155049Srik# define LYSAP_PEER_ENUM _IOWR('x', 105, unsigned) 398155049Srik# define LYSAP_PEER_CLEAR _IOW('x', 106, unsigned) 399155049Srik 400155049Srik# define LYSAP_CHAN_ADD _IOWR('x', 111, lysap_channel_config_t) 401155049Srik# define LYSAP_CHAN_REMOVE _IO('x', 112) 402155049Srik# define LYSAP_CHAN_INFO _IOR('x', 113, lysap_channel_info_t) 403155049Srik# define LYSAP_CHAN_COUNT _IOR('x', 114, unsigned) 404155049Srik# define LYSAP_CHAN_ENUM _IOWR('x', 115, unsigned) 405155049Srik# define LYSAP_CHAN_CLEAR _IO('x', 116) 406155049Srik# include "lysap-linux.h" 407155049Srik#else /* CRONYX_LYSAP */ 408155049Srik typedef struct _lysap_channel_t lysap_channel_t; 409155049Srik typedef struct _lysap_channel_config_t lysap_channel_config_t; 410155049Srik typedef struct _LYSAP_DeviceInterfaceConfig LYSAP_DeviceInterfaceConfig; 411155049Srik typedef struct _LYSAP_ChannelConfig LYSAP_ChannelConfig; 412155049Srik typedef struct _lysap_buf_t lysap_buf_t; 413155049Srik#endif /* !CRONYX_LYSAP */ 414155049Srik 415155049Srik/* 416123120Simp * Dynamic binder interface. 417123120Simp */ 418123120Simptypedef struct _chan_t chan_t; 419123120Simptypedef struct _proto_t proto_t; 420123120Simp 421123120Simpvoid binder_register_protocol (proto_t *p); 422123120Simpvoid binder_unregister_protocol (proto_t *p); 423123120Simp 424123120Simpint binder_register_channel (chan_t *h, char *prefix, int minor); 425123120Simpvoid binder_unregister_channel (chan_t *h); 426123120Simp 427123120Simp/* 428123120Simp * Hardware channel driver structure. 429123120Simp */ 430123120Simpstruct sk_buff; 431123120Simp 432123120Simpstruct _chan_t { 433123120Simp char name [16]; 434123120Simp int mtu; /* max packet size */ 435123120Simp int fifosz; /* total hardware i/o buffer size */ 436123120Simp int port; /* hardware base i/o port */ 437123120Simp int irq; /* hardware interrupt line */ 438123120Simp int minor; /* minor number 0..127, assigned by binder */ 439123120Simp int debug; /* debug level, 0..2 */ 440123120Simp int running; /* running, 0..1 */ 441123120Simp struct _proto_t *proto; /* protocol interface data */ 442123120Simp void *sw; /* protocol private data */ 443123120Simp void *hw; /* hardware layer private data */ 444123120Simp 445123120Simp /* Interface to protocol */ 446123120Simp int (*up) (chan_t *h); 447123120Simp void (*down) (chan_t *h); 448123120Simp int (*transmit) (chan_t *h, struct sk_buff *skb); 449123120Simp void (*set_dtr) (chan_t *h, int val); 450123120Simp void (*set_rts) (chan_t *h, int val); 451123120Simp int (*query_dtr) (chan_t *h); 452123120Simp int (*query_rts) (chan_t *h); 453123120Simp int (*query_dsr) (chan_t *h); 454123120Simp int (*query_cts) (chan_t *h); 455123120Simp int (*query_dcd) (chan_t *h); 456123120Simp 457123120Simp /* Interface to async protocol */ 458123120Simp void (*set_async_param) (chan_t *h, int baud, int bits, int parity, 459123120Simp int stop2, int ignpar, int rtscts, 460123120Simp int ixon, int ixany, int symstart, int symstop); 461123120Simp void (*send_break) (chan_t *h, int msec); 462123120Simp void (*send_xon) (chan_t *h); 463123120Simp void (*send_xoff) (chan_t *h); 464123120Simp void (*start_transmitter) (chan_t *h); 465123120Simp void (*stop_transmitter) (chan_t *h); 466123120Simp void (*flush_transmit_buffer) (chan_t *h); 467123120Simp 468123120Simp /* Control interface */ 469123120Simp int (*control) (chan_t *h, unsigned int cmd, unsigned long arg); 470155049Srik 471155049Srik /* LYSAP interface */ 472155049Srik struct lysap_t 473155049Srik { 474155049Srik lysap_channel_t *link; 475155049Srik int (*inspect_config)(chan_t *h, lysap_channel_config_t *, 476155049Srik LYSAP_DeviceInterfaceConfig *, LYSAP_ChannelConfig *); 477155049Srik unsigned long (*probe_freq)(chan_t *h, unsigned long freq); 478155049Srik unsigned long (*set_freq)(chan_t *h, unsigned long freq); 479155049Srik unsigned (*get_status)(chan_t *h); 480155049Srik int (*transmit) (chan_t *h, lysap_buf_t *b); 481155049Srik lysap_buf_t* (*alloc_buf) (chan_t *h, unsigned len); 482155049Srik int (*set_clock_master)(chan_t *h, int enable); 483155049Srik unsigned long (*get_master_freq)(chan_t *h); 484155049Srik } lysap; 485123120Simp}; 486123120Simp 487123120Simp/* 488123120Simp * Protocol driver structure. 489123120Simp */ 490123120Simpstruct _proto_t { 491123120Simp char *name; 492123120Simp struct _proto_t *next; 493123120Simp 494123120Simp /* Interface to channel */ 495123120Simp void (*receive) (chan_t *h, struct sk_buff *skb); 496123120Simp void (*receive_error) (chan_t *h, int errcode); 497123120Simp void (*transmit) (chan_t *h); 498123120Simp void (*modem_event) (chan_t *h); 499123120Simp 500123120Simp /* Interface to binder */ 501123120Simp int (*open) (chan_t *h); 502123120Simp void (*close) (chan_t *h); 503123120Simp int (*read) (chan_t *h, unsigned short flg, char *buf, int len); 504123120Simp int (*write) (chan_t *h, unsigned short flg, const char *buf, int len); 505123120Simp int (*select) (chan_t *h, int type, void *st, struct file *filp); 506123120Simp struct fasync_struct *fasync; 507123120Simp 508123120Simp /* Control interface */ 509123120Simp int (*attach) (chan_t *h); 510123120Simp int (*detach) (chan_t *h); 511123120Simp int (*control) (chan_t *h, unsigned int cmd, unsigned long arg); 512155049Srik 513155049Srik /* LYSAP interface */ 514155049Srik void (*transmit_error) (chan_t *h, int errcode); 515155049Srik void (*lysap_notify_receive) (chan_t *h, lysap_buf_t *b); 516155049Srik void (*lysap_notify_transmit) (chan_t *h); 517155049Srik lysap_buf_t* (*lysap_get_data)(chan_t *h); 518123120Simp}; 519123120Simp#endif /* KERNEL */ 520