Fix device freeze to reduce output packet size.
And make this value configurable by kernel config or sysctl.
This commit is contained in:
parent
4e6f1adc6b
commit
20280807ca
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user