1 #include <u.h>
2 #include <libc.h>
3 #include <thread.h>
4 #include "usb.h"
5 #include "usbfs.h"
6 #include "serial.h"
7 #include "ucons.h"
8
9 Cinfo uconsinfo[] = {
10 { Net20DCVid, Net20DCDid },
11 { 0, 0 },
12 };
13
14 int
uconsmatch(char * info)15 uconsmatch(char *info)
16 {
17 Cinfo *ip;
18 char buf[50];
19
20 for(ip = uconsinfo; ip->vid != 0; ip++){
21 snprint(buf, sizeof buf, "vid %#06x did %#06x",
22 ip->vid, ip->did);
23 dsprint(2, "serial: %s %s\n", buf, info);
24 if(strstr(info, buf) != nil)
25 return 0;
26 }
27 return -1;
28 }
29
30 static int
ucseteps(Serialport * p)31 ucseteps(Serialport *p)
32 {
33 Serial *ser;
34
35 ser = p->s;
36
37 p->baud = ~0; /* not real port */
38 ser->maxrtrans = ser->maxwtrans = 8;
39 devctl(p->epin, "maxpkt 8");
40 devctl(p->epout, "maxpkt 8");
41 return 0;
42 }
43
44 /* all nops */
45 Serialops uconsops = {
46 .seteps = ucseteps,
47 };
48