Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/usb/serial/uchcom.c
Context not available. | |||||
#define UCHCOM_BULK_BUF_SIZE 1024 /* bytes */ | #define UCHCOM_BULK_BUF_SIZE 1024 /* bytes */ | ||||
/* | |||||
* As speeds for uchcom devices increase, these numbers will need to | |||||
* be increased. This needs to be tested. | |||||
* | |||||
* TODO: The TTY buffers should be increased! | |||||
*/ | |||||
#define UCHCOM_BUF_SIZE 1024 | |||||
enum { | enum { | ||||
UCHCOM_BULK_DT_WR, | UCHCOM_BULK_DT_WR, | ||||
UCHCOM_BULK_DT_RD, | UCHCOM_BULK_DT_RD, | ||||
Context not available. | |||||
static usb_callback_t uchcom_read_callback; | static usb_callback_t uchcom_read_callback; | ||||
static const struct usb_config uchcom_config_data[UCHCOM_N_TRANSFER] = { | static const struct usb_config uchcom_config_data[UCHCOM_N_TRANSFER] = { | ||||
[UCHCOM_BULK_WR] = { | |||||
.type = UE_BULK, | |||||
.endpoint = UE_ADDR_ANY, | |||||
.direction = UE_DIR_TX, | |||||
.if_index = 0, | |||||
.bufsize = UCHCOM_BUF_SIZE, | |||||
.flags = {.pipe_bof = 1,.force_short_xfer = 1,}, | |||||
.callback = &uchcom_write_callback, | |||||
.usb_mode = USB_MODE_DUAL, | |||||
}, | |||||
[UCHCOM_BULK_RD] = { | |||||
.type = UE_BULK, | |||||
.endpoint = UE_ADDR_ANY, | |||||
.direction = UE_DIR_RX, | |||||
.if_index = 0, | |||||
.bufsize = UCHCOM_BUF_SIZE, | |||||
.flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, | |||||
.callback = &uchcom_read_callback, | |||||
.usb_mode = USB_MODE_DUAL, | |||||
}, | |||||
[UCHCOM_BULK_DT_WR] = { | [UCHCOM_BULK_DT_WR] = { | ||||
.type = UE_BULK, | .type = UE_BULK, | ||||
.endpoint = UE_ADDR_ANY, | .endpoint = UE_ADDR_ANY, | ||||
Context not available. | |||||
uchcom_cfg_open(struct ucom_softc *ucom) | uchcom_cfg_open(struct ucom_softc *ucom) | ||||
{ | { | ||||
struct uchcom_softc *sc = ucom->sc_parent; | struct uchcom_softc *sc = ucom->sc_parent; | ||||
/* clear stall */ | |||||
if ((sc->sc_super_ucom.sc_flag & UCOM_FLAG_DEVICE_MODE) == 0) { | |||||
usbd_xfer_set_stall(sc->sc_xfer[UCHCOM_BULK_WR]); | |||||
usbd_xfer_set_stall(sc->sc_xfer[UCHCOM_BULK_RD]); | |||||
} | |||||
DPRINTF("\n"); | DPRINTF("\n"); | ||||
Context not available. |