From 4275c49e72544d5b92512e41ddecbd6af5bee6c3 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 28 Jun 2014 18:09:43 +0200 Subject: nusb: implement aijus stable uniqueue device names instead of naming devices by ther dynamically assigned device address, we hash device uniqueue fields from the device descriptor and produce a 5 digit hex string that will identify the device across machines. when there is a collision (less than 1% chance with 100 devices), usbd will append the device address to the name to make it uniqueue for this machine. the hname is passed to drivers in the devid argument, which now has the form addr:hname, where the colon and hname can be omited (for backwards compatibility). when the new behaviour isnt desired, nousbhname= environment variable can be defined giving the old behaviour. --- sys/src/cmd/nusb/kb/kb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/src/cmd/nusb/kb/kb.c') diff --git a/sys/src/cmd/nusb/kb/kb.c b/sys/src/cmd/nusb/kb/kb.c index 73cb52a41..0f60c9bad 100644 --- a/sys/src/cmd/nusb/kb/kb.c +++ b/sys/src/cmd/nusb/kb/kb.c @@ -794,7 +794,7 @@ threadmain(int argc, char* argv[]) }ARGEND; if(argc != 1) usage(); - d = getdev(atoi(*argv)); + d = getdev(*argv); if(d == nil) sysfatal("getdev: %r"); ud = d->usb; -- cgit v1.2.3