diff options
Diffstat (limited to 'static/netbsd/man9/ucom.9 3.html')
| -rw-r--r-- | static/netbsd/man9/ucom.9 3.html | 204 |
1 files changed, 0 insertions, 204 deletions
diff --git a/static/netbsd/man9/ucom.9 3.html b/static/netbsd/man9/ucom.9 3.html deleted file mode 100644 index 774d39d3..00000000 --- a/static/netbsd/man9/ucom.9 3.html +++ /dev/null @@ -1,204 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">UCOM(9)</td> - <td class="head-vol">Kernel Developer's Manual</td> - <td class="head-rtitle">UCOM(9)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">ucom</code> — <span class="Nd">interface - for USB tty like devices</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">The <code class="Nm">ucom</code> driver is a (relatively) easy way - to make a USB device look like a <a class="Xr">tty(4)</a>. It basically - takes two bulk pipes, input and output, and makes a tty out of them. This is - useful for a number of device types, e.g., serial ports (see - <a class="Xr">uftdi(4)</a>), modems (see <a class="Xr">umodem(4)</a>), and - devices that traditionally look like a tty (see - <a class="Xr">uvisor(4)</a>).</p> -<p class="Pp">Communication between the real driver and the - <code class="Nm">ucom</code> driver is via the attachment arguments (when - attached) and via the <var class="Va">ucom_methods</var> struct</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="ATTACHMENT"><a class="permalink" href="#ATTACHMENT">ATTACHMENT</a></h1> -<div class="Bd Li"> -<pre>struct ucom_attach_args { - int ucaa_portno; - int ucaa_bulkin; - int ucaa_bulkout; - u_int ucaa_ibufsize; - u_int ucaa_ibufsizepad; - u_int ucaa_obufsize; - u_int ucaa_opkthdrlen; - const char *ucaa_info; - struct usbd_device *ucaa_device; - struct usbd_interface *ucaa_iface; - const struct ucom_methods *ucaa_methods; - void *ucaa_arg; -};</pre> -</div> -<dl class="Bl-tag"> - <dt id="int"><a class="permalink" href="#int"><code class="Dv">int - ucaa_portno</code></a></dt> - <dd>identifies the port if the devices should have more than one - <code class="Nm">ucom</code> attached. Use the value - <code class="Dv">UCOM_UNK_PORTNO</code> if there is only one port.</dd> - <dt id="int~2"><a class="permalink" href="#int~2"><code class="Dv">int - ucaa_bulkin</code></a></dt> - <dd>the number of the bulk input pipe.</dd> - <dt id="int~3"><a class="permalink" href="#int~3"><code class="Dv">int - ucaa_bulkout</code></a></dt> - <dd>the number of the bulk output pipe.</dd> - <dt id="u_int"><a class="permalink" href="#u_int"><code class="Dv">u_int - ucaa_ibufsize</code></a></dt> - <dd>the size of the read requests on the bulk in pipe.</dd> - <dt id="u_int~2"><a class="permalink" href="#u_int~2"><code class="Dv">u_int - ucaa_ibufsizepad</code></a></dt> - <dd>the size of the input buffer. This is usually the same as - <code class="Dv">ibufsize</code>.</dd> - <dt id="u_int~3"><a class="permalink" href="#u_int~3"><code class="Dv">u_int - ucaa_obufsize</code></a></dt> - <dd>the size of the write requests on the bulk out pipe.</dd> - <dt id="u_int~4"><a class="permalink" href="#u_int~4"><code class="Dv">u_int - ucaa_obufsizepad</code></a></dt> - <dd>the size of the output buffer. This is usually the same as - <code class="Dv">ucaa_obufsize</code>.</dd> - <dt id="struct"><a class="permalink" href="#struct"><code class="Dv">struct - usbd_device *ucaa_device</code></a></dt> - <dd>a handle to the device.</dd> - <dt>struct usbd_interface *ucaa_iface</dt> - <dd>a handle to the interface that should be used.</dd> - <dt>struct ucom_methods *ucaa_methods</dt> - <dd>a pointer to the methods that the <code class="Nm">ucom</code> driver - should use for further communication with the driver.</dd> - <dt>void *ucaa_arg</dt> - <dd>the value that should be passed as first argument to each method.</dd> -</dl> -</section> -<section class="Sh"> -<h1 class="Sh" id="METHODS"><a class="permalink" href="#METHODS">METHODS</a></h1> -<p class="Pp">The <code class="Dv">ucom_methods</code> struct contains a number - of function pointers used by the <code class="Nm">ucom</code> driver at - various stages. If the device is not interested in being called at a - particular point it should just use a <code class="Dv">NULL</code> pointer - and the <code class="Nm">ucom</code> driver will use a sensible default.</p> -<div class="Bd Pp Li"> -<pre>struct ucom_methods { - void (*ucom_get_status)(void *sc, int portno, - u_char *lsr, u_char *msr); - void (*ucom_set)(void *sc, int portno, int reg, int onoff); -#define UCOM_SET_DTR 1 -#define UCOM_SET_RTS 2 -#define UCOM_SET_BREAK 3 - int (*ucom_param)(void *sc, int portno, struct termios *); - int (*ucom_ioctl)(void *sc, int portno, u_long cmd, - void *data, int flag, proc_t *p); - int (*ucom_open)(void *sc, int portno); - void (*ucom_close)(void *sc, int portno); - void (*ucom_read)(void *sc, int portno, u_char **ptr, - uint32_t *count); - void (*ucom_write)(void *sc, int portno, u_char *to, - u_char *from, uint32_t *count); -};</pre> -</div> -<dl class="Bl-tag"> - <dt><var class="Ft">void</var> - <code class="Fn">(*ucom_get_status)</code>(<var class="Fa">void *sc</var>, - <var class="Fa">int portno</var>, <var class="Fa">u_char *lsr</var>, - <var class="Fa">u_char *msr</var>)</dt> - <dd>get the status of port <var class="Fa">portno</var>. The status consists - of the line status, <var class="Fa">lsr</var>, and the modem status - <var class="Fa">msr</var>. The contents of these two bytes is exactly as - for a 16550 UART.</dd> - <dt><var class="Ft">void</var> - <code class="Fn">(*ucom_set)</code>(<var class="Fa">void *sc</var>, - <var class="Fa">int portno</var>, <var class="Fa">int reg</var>, - <var class="Fa">int onoff</var>)</dt> - <dd>Set (or unset) a particular feature of a port.</dd> - <dt><var class="Ft">int</var> - <code class="Fn">(*ucom_param)</code>(<var class="Fa">void *sc</var>, - <var class="Fa">int portno</var>, <var class="Fa">struct termios - *t</var>)</dt> - <dd>Set the speed, number of data bit, stop bits, and parity of a port - according to the <a class="Xr">termios(4)</a> struct.</dd> - <dt><var class="Ft">int</var> - <code class="Fn">(*ucom_ioctl)</code>(<var class="Fa">void *sc</var>, - <var class="Fa">int portno</var>, <var class="Fa">u_long cmd</var>, - <var class="Fa">void *data</var>, <var class="Fa">int flag</var>, - <var class="Fa">proc_t *p</var>)</dt> - <dd>implements any non-standard <a class="Xr">ioctl(2)</a> that a device - needs.</dd> - <dt><var class="Ft">int</var> - <code class="Fn">(*ucom_open)</code>(<var class="Fa">void *sc</var>, - <var class="Fa">int portno</var>)</dt> - <dd>called just before the <code class="Nm">ucom</code> driver opens the bulk - pipes for the port.</dd> - <dt><var class="Ft">void</var> - <code class="Fn">(*ucom_close)</code>(<var class="Fa">void *sc</var>, - <var class="Fa">int portno</var>)</dt> - <dd>called just after the <code class="Nm">ucom</code> driver closes the bulk - pipes for the port.</dd> - <dt><var class="Ft">void</var> - <code class="Fn">(*ucom_read)</code>(<var class="Fa">void *sc</var>, - <var class="Fa">int portno</var>, <var class="Fa">u_char **ptr</var>, - <var class="Fa">uint32_t *count</var>)</dt> - <dd>if the data delivered on the bulk pipe is not just the raw input - characters this routine needs to increment <var class="Fa">ptr</var> by as - many characters to skip from the start of the raw input and decrement - <var class="Fa">count</var> by as many characters to truncate from the end - of the raw input.</dd> - <dt><var class="Ft">void</var> - <code class="Fn">(*ucom_write)</code>(<var class="Fa">void *sc</var>, - <var class="Fa">int portno</var>, <var class="Fa">u_char *dst</var>, - <var class="Fa">u_char *src</var>, <var class="Fa">uint32_t - *count</var>)</dt> - <dd>if the data written to the bulk pipe is not just the raw characters then - this routine needs to copy <var class="Fa">count</var> raw characters from - <var class="Fa">src</var> into the buffer at <var class="Fa">dst</var> and - do the appropriate padding. The <var class="Fa">count</var> should be - updated to the new size. The buffer at <var class="Fa">src</var> is at - most <var class="Va">ibufsize</var> bytes and the buffer at - <var class="Fa">dst</var> is <var class="Va">ibufsizepad</var> bytes.</dd> -</dl> -<p class="Pp">Apart from these methods there is a function</p> -<div class="Bd-indent"> -<dl class="Bl-tag"> - <dt id="void"><var class="Ft">void</var> - <a class="permalink" href="#void"><code class="Fn">ucom_status_change</code></a>(<var class="Fa">struct - ucom_softc *</var>)</dt> - <dd style="width: auto;"> </dd> -</dl> -</div> -<p class="Pp">which should be called by the driver whenever it notices a status - change.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">tty(4)</a>, <a class="Xr">u3g(4)</a>, - <a class="Xr">uark(4)</a>, <a class="Xr">ubsa(4)</a>, - <a class="Xr">uchcom(4)</a>, <a class="Xr">uftdi(4)</a>, - <a class="Xr">ugensa(4)</a>, <a class="Xr">uhmodem(4)</a>, - <a class="Xr">uipaq(4)</a>, <a class="Xr">ukyopon(4)</a>, - <a class="Xr">umct(4)</a>, <a class="Xr">umodem(4)</a>, - <a class="Xr">uplcom(4)</a>, <a class="Xr">usb(4)</a>, - <a class="Xr">uslsa(4)</a>, <a class="Xr">uvisor(4)</a>, - <a class="Xr">uvscom(4)</a></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> -<p class="Pp">This <code class="Nm">ucom</code> interface first appeared in - <span class="Ux">NetBSD 1.5</span>.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">September 12, 2016</td> - <td class="foot-os">NetBSD 10.1</td> - </tr> -</table> |
