diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-12-24 11:04:18 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-12-24 11:04:18 +0100 |
commit | d1799f65ca4835cbb896f802b297b39e518b9cc6 (patch) | |
tree | 0905e9121639512c830984745cc3b3a2f10d6f31 | |
parent | 7a3f0998a0ce7470d70c1a13bc4646abafdcc236 (diff) | |
download | plan9front-d1799f65ca4835cbb896f802b297b39e518b9cc6.tar.xz |
nusb/serial: fix nusb/serial hang with ftdi
have to create process, not a thread in ftdi code so main
process can exit after posting fs service.
-rwxr-xr-x | rc/bin/nusbrc | 3 | ||||
-rw-r--r-- | sys/src/cmd/nusb/serial/ftdi.c | 2 | ||||
-rw-r--r-- | sys/src/cmd/nusb/serial/serial.c | 6 |
3 files changed, 7 insertions, 4 deletions
diff --git a/rc/bin/nusbrc b/rc/bin/nusbrc index 23acf666e..338438935 100755 --- a/rc/bin/nusbrc +++ b/rc/bin/nusbrc @@ -30,6 +30,9 @@ if(! bind -a '#u' /dev) # HUAWEI E220 modem if(~ $2$3 12d11003) nusb/serial $id + # FTDI + if(~ $2 0403) + nusb/serial $id } } fn detach { diff --git a/sys/src/cmd/nusb/serial/ftdi.c b/sys/src/cmd/nusb/serial/ftdi.c index 67d28b897..1b1e88722 100644 --- a/sys/src/cmd/nusb/serial/ftdi.c +++ b/sys/src/cmd/nusb/serial/ftdi.c @@ -1470,7 +1470,7 @@ ftinit(Serialport *p) ftdiwrite(p, BMMPSSE|0x0b, 0, FTSETBITMODE); } incref(ser->dev); - threadcreate(statusreader, p, 8*1024); + proccreate(statusreader, p, 8*1024); return 0; } diff --git a/sys/src/cmd/nusb/serial/serial.c b/sys/src/cmd/nusb/serial/serial.c index 9f570791f..295333e00 100644 --- a/sys/src/cmd/nusb/serial/serial.c +++ b/sys/src/cmd/nusb/serial/serial.c @@ -747,10 +747,10 @@ threadmain(int argc, char* argv[]) ser->nifcs = 1; /* probe all the drivers */ - if(plprobe(ser) - && uconsprobe(ser) + if(uconsprobe(ser) && ftprobe(ser) - && slprobe(ser)) + && slprobe(ser) + && plprobe(ser)) sysfatal("no serial devices found"); for(i = 0; i < ser->nifcs; i++){ |