X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=rc%2Fbin%2Fnusbrc;h=338438935690ce4d7276bac100fcce1ec87ab1bb;hb=61b1134df944eee5188214a9e249101f1ec095e7;hp=546803a4b56fc80a25b4b169bb2c44c6c38f1ecc;hpb=07506870120ed7d705da18b3a0c314cf3de1f9ce;p=plan9front.git diff --git a/rc/bin/nusbrc b/rc/bin/nusbrc index 546803a4b..338438935 100755 --- a/rc/bin/nusbrc +++ b/rc/bin/nusbrc @@ -7,22 +7,32 @@ if(! bind -a '#u' /dev) @{ rfork ne fn attach { + id=$1 + if(~ $#* 5 && ! test -e /env/nousbhname) + id=$1:$5 switch($4){ case *01 - nusb/audio $1 + nusb/audio $id case *02 # serial and ethernet - nusb/serial $1 + nusb/serial $id # handled /sys/src/9/boot/nusbrc - # nusb/ether $1 + # nusb/ether $id case *03 # handled /sys/src/9/boot/nusbrc - # nusb/kb $1 + # nusb/kb $id case *08 # handled /sys/src/9/boot/nusbrc - # nusb/disk $1 - case *10106 - nusb/ptp $1 + # nusb/disk $id + case 010106 + nusb/ptp $id + case * + # HUAWEI E220 modem + if(~ $2$3 12d11003) + nusb/serial $id + # FTDI + if(~ $2 0403) + nusb/serial $id } } fn detach {