1 typedef struct Serial Serial;
2 typedef struct Serialops Serialops;
3 typedef struct Serialport Serialport;
6 int (*seteps)(Serialport*);
7 int (*init)(Serialport*);
8 int (*getparam)(Serialport*);
9 int (*setparam)(Serialport*);
10 int (*clearpipes)(Serialport*);
11 int (*reset)(Serial*, Serialport*);
12 int (*sendlines)(Serialport*);
13 int (*modemctl)(Serialport*, int);
14 int (*setbreak)(Serialport*, int);
15 int (*readstatus)(Serialport*);
16 int (*wait4data)(Serialport*, uchar *, int);
17 int (*wait4write)(Serialport*, uchar *, int);
28 Serial *s; /* device we belong to */
31 Dev *epintr; /* may not exist */
38 /* serial parameters */
54 int blocked; /* for sw flow ctl. BUG: not implemented yet */
62 int interfc; /* interfc on the device for ftdi */
66 Channel *readc; /* to uncouple reads, only used in ftdi... */
68 uchar data[DataBufSz];
71 Req *readfirst, *readlast; /* read request queue */
78 Dev *dev; /* usb device*/
80 int type; /* serial model subtype */
81 int recover; /* # of non-fatal recovery tries */
86 int jtag; /* index of jtag interface, -1 none */
87 int nifcs; /* # of serial interfaces, including JTAG */
97 int baudbase; /* for special baud base settings, see ftdi */
101 /* soft flow control chars */
109 * !hget http://lxr.linux.no/source/drivers/usb/serial/pl2303.h|htmlfmt
110 * !hget http://lxr.linux.no/source/drivers/usb/serial/pl2303.c|htmlfmt
113 int serialmain(Dev *d, int argc, char *argv[]);
115 typedef struct Cinfo Cinfo;
117 int vid; /* usb vendor id */
118 int did; /* usb device/product id */
119 int cid; /* controller id assigned by us */
122 extern Cinfo plinfo[];
123 extern Cinfo uconsinfo[];
124 extern int serialdebug;
126 #define dsprint if(serialdebug)fprint
128 int serialrecover(Serial *ser, Serialport *p, Dev *ep, char *err);
129 int serialreset(Serial *ser);
130 char *serdumpst(Serialport *p, char *buf, int bufsz);