514 lines · 9.3 KB · Text
RawDownload
.TH USB 4.SH NAMEaudio,ccid,disk,ether,kb,print,probe,serial,usbeject,usbfat:\- Universal Serial Bus device drivers.SH SYNOPSIS.B usb/kb[.B -dkm] [.B -a.I accel] [.I dev ...].PP.B usb/disk[.B -Dd] [.B -m.I mnt] [.B -s.I srv] [.I dev ...].PP.B usbfat:[.I disk ...].PP.B usbeject[.I disk ...].PP.B usb/audio[.B -dpV] [.B -m.I mnt] [.B -s.I srv] [.B -v.I vol] [.I dev].PP.B usb/ether[.B -Dd] [.B -m.I mnt] [.B -s.I srv] [.I dev ...].PP.B usb/serial[.B -Dd] [.B -m.I mnt] [.B -s.I srv] [.I dev ...].PP.B usb/print[.B -d] [.I dev ...].PP.B usb/ccid[.B -d].ig.PP.B usb/ibuddy[.B -Dd] [.B -m.I mnt] [.B -s.I srv] [.I dev ...]...B usb/probe.SH DESCRIPTIONThese programs drive USB devices of specific classes via.IR usb (3).Usually they are started by.IR usbd (4)upon attachment of the device to the bus.Less often, users start them manually, depending on.IR usbd (4)'sconfiguration.Usually,.I kband.I diskare started by.I usbdand other programs are started by hand..PPWithout arguments, the drivers handle all the devices (ofthe appropriate USB class) found on the bus.To make a driver handle only certain devices, supply as argumentsthe paths for the directories of the devices(actually of their zero endpoints)..PPDrivers that provide file systems accept options.B -sand.B -mto instruct them to post a 9P connection at.IR srv (3)with the given name and/or to mount themselves at.IR mnt .When embedded into.IR usbdthese options may not be used.In this case,the file tree supplied by the device driver isavailable through the file system provided by.IR usbd ,usually mounted at.B /devand reachable through the 9P connection posted at.BR /srv/usb ..PPOptions.B -dand.B -Dpresent on most drivers trigger debug diagnostics andfile system debugging diagnostics.Repeating any one of these may increase verbosity..PPTo help locate devices of interest,.I probelists all the USB devices available,including those with no driver started..SS Keyboards and mice.I Kbsupports USB keyboards and mice either as separate USB devicesor as a single combined USB device.Scan codes from the keyboard are sent to.B /dev/kbinto let the kernel process them.Mouse events are sent to.B /dev/mouseinin the same way..PPThe following options are understood:.TF -k.TP.B \-aAccelerate the mouse to level.I n(similar to the kernel mouse driver acceleration)..TP.B \-kServe just the keyboard (and not the mouse)..TP.B \-mServe just the mouse (and not the keyboard)..SS Disks.I Diskconfigures and manages USB mass storage devices. Itprovides a file system (usually seen at.BR /dev )that includes one directory per storage device, named.BI sdU N . Min correspondence with the usb device number and the storageunit number (or LUN).For example, LUN number 2 on.B /dev/usb/ep3.0can be accessed through.BR /dev/sdU3.2 ..PPThe storage device directory contains the usual filesserved by.IR sd (3):.BR data ,.BR raw ,and.BR ctl ..PPThe.B ctlfile supplies the devicegeometry when read..PPThe script.B usbfat:mounts the FAT file systems in the DOS partitions of the named.IR disk s;if none, it mounts those file systems found at.BR /dev/sdU*.*/data .When more than one partition is found, a suffix is appended tothe disk name to identify the partition number.The script.B usbejectundoes the effect. If no argument is given, it unmounts all USBdisks. An argument.BI sdU Nunmounts all partitions from disk with USB target.IR N ..igAn argument.BI sdU N . Mor.BI sdU N . M . P.\" TODO: fill in missing words...SS Printers.I Printprovides a single file can be written to print on a USB printer.Options are similar to those of.IR disk .The file is also bound at.B /dev/lpas is customary..SS Ethernet adapters.I Etherprovides a file interface similar to that of.IR ether (3)for each USB Ethernet adapter found.The name of an Ethernet device is.BI etherU Nwhere.I Nis the device name.When started manually, the file interface is mounted at.B /netas is customary...SS Serial and JTAG ports.I Serialprovides a file system (usually mounted at.BR /dev )that includes one directory per USB serial port, named.BI eiaU Nor.BI eiaU N . M.In this directory there are two files,.BR eiaU ,similar to.BI eia Nin.IR uart (3),and.BR eiaUctl ,which admits writes in the same format as.BI eia N ctlin.IR uart (3).Reading from.B eiaUctlgives the serial port's settings in the same format as.BI eia N statusin.IR uart (3).Options are similar to those of.IR disk ..PPJTAG ports are similarbut the files are named.B jtagand.BR jtagctl ...SS Audio devices.I Usbaudioconfigures and manages a USB audio device.It implements a file system,normally mounted on.BI /dev ,but this can be changed with.BR \-m ,containing files.BR volume ,.BR audioctl ,.BR audio ,and.BR audioin .The names.B volumeand.B audiomaintain backward compatibility with the Soundblaster driver..PPThe.B \-Voption (verbose)causes.I audioto print information about the device on startup.The.B \-soption specifies a name for a file descriptor to be posted in.BR /srv .The.B \-voptions sets initial.IR volume ..PPReading.B volumeor.B audioctlyields the device's settings.The data format of.B volumeis compatible with the Soundblaster and produces output in thisformat:.IP.EXaudio out 65treb out 0bass out 0speed out 44100.EE.PPThis file can be written using the same syntax.The keyword.L outmay be omitted.Settings are given as percentages of the range,except for speed which is in Hz..PPThe file.B audioctlprovides more information, using up to 6 columns of 12 characters each.From left to right, the fields are:.IR "control name" ,.I inor.IR out ,.IR "current value" ,.IR "minimum value" ,.IR maximum ,and.IR resolution .There are 3, 5, or 6 columns present.Maxima and resolution are omitted when they are not available or not applicable.The resolution for.I speedis reported as 1 (one) if the sampling frequency is continuously variable.It is absent if it is settable at a fixed number of discrete values only..PPWhen all values from.B audioctlhave been read, a zero-length buffer is returned(the usual end-of-file indication).A new.I readwill then block until one of the settings changes,then report its new value..PPThe file.B audioctlcan be written like.BR volume ..PPAudio data is written to.B audioand read from.BR audioin .The data format is little-endian,samples ordered primarily by time andsecondarily by channel.Samples occupy the minimum integral number of bytes.Read and write operations of arbitrary size are allowed...SS Ccid.I Cciddiscovers and configures SIM or SAM cards using the CCID standard.It provides a file system (usually mounted at.BR /dev )that includes three files,.BI ctl ,.B rawand.BI rpc .Reading from.B ctla description of the smartcard reader capabilities is printed..B rawis just intended for debugging.Reads and writes to theraw file send and receive raw CCID packets.Smart cards identify themselves by giving out an ATR,an array of characters describing the card uniquely.Users of the driver write the ATR to the.B rpcfile and are blocked until a card with that ATR is seen.From then on they can do ICC RPCs using whateverlanguage the smart card speaks. A small write cancelsan outstanding RPC..PPThe driver takes care of powering the card adequately, basedon its ATR, and tunnelling the RPCs through the USB device.Only slot 0 is supported..PPWhen the smartcard disappears,all reads and write fail until the file is reopened anda new ATR is written to it...ig.SS Ibuddy.PPIbuddy supports a USB I-buddy toy, a little winged-demon.The driver provides one directory per attached toy with a single.BR ctlfile to control the device.Directories are named.BR ibuddyN ,being.I Nthe corresponding usb device number.When read, the.BR ctlfile provides the state of the device in this form:.IP.EXhips right|leftwings open|closered on|offgreen on|offblue on|offheart on|off.EE.PPEach line describes the status of one feature..IR  Red ,.IR  blue ,and.IR  greenare the different leds in the head ofthe toy..IR  Heartrepresents the red led in the chest ofthe toy..IR  Wingsrepresents the status of the wings, whichcan be closed or open..IR  Hipsrepresents the orientationof the toy (left or right, from the figure's point of view)..PPLines can be written to the.BR ctlfile to command the device.Multiple lines (six at most) can be writtenat once, with one action per line....SH SOURCE.B /sys/src/cmd/usb.SH "SEE ALSO".IR kbin (3),.IR mouse (3),.IR sd (3),.IR uart (3),.IR usb (3),.IR usbd (4),.IR partfs (8).SH BUGSThe various device drivers are generic USB drivers andmay work only for certain devices on each class..PP

Lines 1–500 of 514.