summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShunsuke Akiyama <akiyama@FreeBSD.org>2003-03-09 11:50:27 +0000
committerShunsuke Akiyama <akiyama@FreeBSD.org>2003-03-09 11:50:27 +0000
commit20280807ca2ec3614abc98712915b6032cec1413 (patch)
tree73bdcde8ae1400af9ef41adaee12ff981d9b0541
parent4e6f1adc6b0d975fde7e40db5a06b3f53b88f044 (diff)
Notes
-rw-r--r--sys/conf/NOTES3
-rw-r--r--sys/conf/options1
-rw-r--r--sys/dev/usb/uvscom.c37
-rw-r--r--sys/modules/uvscom/Makefile3
4 files changed, 39 insertions, 5 deletions
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index 125cfc3e8182..006708d346a9 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -2129,6 +2129,9 @@ options USB_DEBUG
options UKBD_DFLT_KEYMAP # specify the built-in keymap
makeoptions UKBD_DFLT_KEYMAP=it.iso
+# options for uvscom:
+options UVSCOM_DEFAULT_OPKTSIZE=8 # default output packet size
+
#####################################################################
# Firewire support
diff --git a/sys/conf/options b/sys/conf/options
index 09467eed5e41..49906f339e8a 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -544,6 +544,7 @@ UMASS_DEBUG opt_usb.h
UMS_DEBUG opt_usb.h
URIO_DEBUG opt_usb.h
UKBD_DFLT_KEYMAP opt_ukbd.h
+UVSCOM_DEFAULT_OPKTSIZE opt_uvscom.h
# Vinum options
VINUMDEBUG opt_vinum.h
diff --git a/sys/dev/usb/uvscom.c b/sys/dev/usb/uvscom.c
index 8c225e13a91d..2b012b17d4e5 100644
--- a/sys/dev/usb/uvscom.c
+++ b/sys/dev/usb/uvscom.c
@@ -34,6 +34,8 @@
* P-in m@ater and various data communication card adapters.
*/
+#include "opt_uvscom.h"
+
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
@@ -69,9 +71,9 @@
#include <dev/usb/ucomvar.h>
+SYSCTL_NODE(_hw_usb, OID_AUTO, uvscom, CTLFLAG_RW, 0, "USB uvscom");
#ifdef USB_DEBUG
static int uvscomdebug = 0;
-SYSCTL_NODE(_hw_usb, OID_AUTO, uvscom, CTLFLAG_RW, 0, "USB uvscom");
SYSCTL_INT(_hw_usb_uvscom, OID_AUTO, debug, CTLFLAG_RW,
&uvscomdebug, 0, "uvscom debug level");
@@ -173,8 +175,12 @@ struct uvscom_softc {
* These are the maximum number of bytes transferred per frame.
* The output buffer size cannot be increased due to the size encoding.
*/
-#define UVSCOMIBUFSIZE 512
-#define UVSCOMOBUFSIZE 64
+#define UVSCOMIBUFSIZE 512
+#define UVSCOMOBUFSIZE 64
+
+#ifndef UVSCOM_DEFAULT_OPKTSIZE
+#define UVSCOM_DEFAULT_OPKTSIZE 8
+#endif
Static usbd_status uvscom_shutdown(struct uvscom_softc *);
Static usbd_status uvscom_reset(struct uvscom_softc *);
@@ -242,6 +248,29 @@ MODULE_DEPEND(uvscom, usb, 1, 1, 1);
MODULE_DEPEND(uvscom, ucom, UCOM_MINVER, UCOM_PREFVER, UCOM_MAXVER);
MODULE_VERSION(uvscom, UVSCOM_MODVER);
+static int uvscomobufsiz = UVSCOM_DEFAULT_OPKTSIZE;
+
+static int
+sysctl_hw_usb_uvscom_opktsize(SYSCTL_HANDLER_ARGS)
+{
+ int err, val;
+
+ val = uvscomobufsiz;
+ err = sysctl_handle_int(oidp, &val, sizeof(val), req);
+ if (err != 0 || req->newptr == NULL)
+ return (err);
+ if (0 < val && val <= UVSCOMOBUFSIZE)
+ uvscomobufsiz = val;
+ else
+ err = EINVAL;
+
+ return (err);
+}
+
+SYSCTL_PROC(_hw_usb_uvscom, OID_AUTO, opktsize, CTLTYPE_INT | CTLFLAG_RW,
+ 0, sizeof(int), sysctl_hw_usb_uvscom_opktsize,
+ "I", "uvscom output packet size");
+
USB_MATCH(uvscom)
{
USB_MATCH_START(uvscom, uaa);
@@ -364,7 +393,7 @@ USB_ATTACH(uvscom)
ucom->sc_portno = UCOM_UNK_PORTNO;
/* bulkin, bulkout set above */
ucom->sc_ibufsize = UVSCOMIBUFSIZE;
- ucom->sc_obufsize = UVSCOMOBUFSIZE;
+ ucom->sc_obufsize = uvscomobufsiz;
ucom->sc_ibufsizepad = UVSCOMIBUFSIZE;
ucom->sc_opkthdrlen = 0;
ucom->sc_callback = &uvscom_callback;
diff --git a/sys/modules/uvscom/Makefile b/sys/modules/uvscom/Makefile
index ddbdaf50bb47..b8459e3d259f 100644
--- a/sys/modules/uvscom/Makefile
+++ b/sys/modules/uvscom/Makefile
@@ -4,7 +4,8 @@ S= ${.CURDIR}/../..
.PATH: $S/dev/usb
KMOD= uvscom
-SRCS= uvscom.c ucomvar.h opt_usb.h device_if.h bus_if.h vnode_if.h
+SRCS= uvscom.c ucomvar.h opt_usb.h opt_uvscom.h \
+ device_if.h bus_if.h vnode_if.h
NOMAN=
.include <bsd.kmod.mk>