s/usb2_/usb_/ on all typedefs for the USB stack.
This commit is contained in:
parent
40062c9280
commit
44c17bdf07
@ -76,8 +76,8 @@ __FBSDID("$FreeBSD$");
|
||||
#include <dev/if_ndis/if_ndisvar.h>
|
||||
|
||||
static driver_object usbd_driver;
|
||||
static usb2_callback_t usbd_non_isoc_callback;
|
||||
static usb2_callback_t usbd_ctrl_callback;
|
||||
static usb_callback_t usbd_non_isoc_callback;
|
||||
static usb_callback_t usbd_ctrl_callback;
|
||||
|
||||
#define USBD_CTRL_READ_PIPE 0
|
||||
#define USBD_CTRL_WRITE_PIPE 1
|
||||
@ -114,10 +114,10 @@ static int32_t usbd_func_bulkintr(irp *);
|
||||
static int32_t usbd_func_vendorclass(irp *);
|
||||
static int32_t usbd_func_selconf(irp *);
|
||||
static int32_t usbd_func_abort_pipe(irp *);
|
||||
static usb2_error_t usbd_setup_endpoint(irp *, uint8_t,
|
||||
static usb_error_t usbd_setup_endpoint(irp *, uint8_t,
|
||||
struct usb_endpoint_descriptor *);
|
||||
static usb2_error_t usbd_setup_endpoint_default(irp *, uint8_t);
|
||||
static usb2_error_t usbd_setup_endpoint_one(irp *, uint8_t,
|
||||
static usb_error_t usbd_setup_endpoint_default(irp *, uint8_t);
|
||||
static usb_error_t usbd_setup_endpoint_one(irp *, uint8_t,
|
||||
struct ndisusb_ep *, struct usb_config *);
|
||||
static int32_t usbd_func_getdesc(irp *);
|
||||
static union usbd_urb *usbd_geturb(irp *);
|
||||
@ -353,7 +353,7 @@ usbd_urb2nt(status)
|
||||
return (STATUS_FAILURE);
|
||||
}
|
||||
|
||||
/* Convert FreeBSD's usb2_error_t to USBD_STATUS */
|
||||
/* Convert FreeBSD's usb_error_t to USBD_STATUS */
|
||||
static int32_t
|
||||
usbd_usb2urb(int status)
|
||||
{
|
||||
@ -463,7 +463,7 @@ usbd_func_getdesc(ip)
|
||||
uint32_t len;
|
||||
union usbd_urb *urb;
|
||||
usb_config_descriptor_t *cdp;
|
||||
usb2_error_t status;
|
||||
usb_error_t status;
|
||||
|
||||
urb = usbd_geturb(ip);
|
||||
ctldesc = &urb->uu_ctldesc;
|
||||
@ -527,7 +527,7 @@ usbd_func_selconf(ip)
|
||||
union usbd_urb *urb;
|
||||
usb_config_descriptor_t *conf;
|
||||
usb_endpoint_descriptor_t *edesc;
|
||||
usb2_error_t ret;
|
||||
usb_error_t ret;
|
||||
|
||||
urb = usbd_geturb(ip);
|
||||
|
||||
@ -592,7 +592,7 @@ usbd_func_selconf(ip)
|
||||
return USBD_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
usbd_setup_endpoint_one(ip, ifidx, ne, epconf)
|
||||
irp *ip;
|
||||
uint8_t ifidx;
|
||||
@ -602,7 +602,7 @@ usbd_setup_endpoint_one(ip, ifidx, ne, epconf)
|
||||
device_t dev = IRP_NDIS_DEV(ip);
|
||||
struct ndis_softc *sc = device_get_softc(dev);
|
||||
struct usb_xfer *xfer;
|
||||
usb2_error_t status;
|
||||
usb_error_t status;
|
||||
|
||||
InitializeListHead(&ne->ne_active);
|
||||
InitializeListHead(&ne->ne_pending);
|
||||
@ -621,14 +621,14 @@ usbd_setup_endpoint_one(ip, ifidx, ne, epconf)
|
||||
return (status);
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
usbd_setup_endpoint_default(ip, ifidx)
|
||||
irp *ip;
|
||||
uint8_t ifidx;
|
||||
{
|
||||
device_t dev = IRP_NDIS_DEV(ip);
|
||||
struct ndis_softc *sc = device_get_softc(dev);
|
||||
usb2_error_t status;
|
||||
usb_error_t status;
|
||||
|
||||
if (ifidx > 0)
|
||||
device_printf(dev, "warning: ifidx > 0 isn't supported.\n");
|
||||
@ -643,7 +643,7 @@ usbd_setup_endpoint_default(ip, ifidx)
|
||||
return (status);
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
usbd_setup_endpoint(ip, ifidx, ep)
|
||||
irp *ip;
|
||||
uint8_t ifidx;
|
||||
@ -654,7 +654,7 @@ usbd_setup_endpoint(ip, ifidx, ep)
|
||||
struct ndisusb_ep *ne;
|
||||
struct usb_config cfg;
|
||||
struct usb_xfer *xfer;
|
||||
usb2_error_t status;
|
||||
usb_error_t status;
|
||||
|
||||
/* check for non-supported transfer types */
|
||||
if (UE_GET_XFERTYPE(ep->bmAttributes) == UE_CONTROL ||
|
||||
@ -810,7 +810,7 @@ usbd_irpcancel(dobj, ip)
|
||||
|
||||
static void
|
||||
usbd_xfer_complete(struct ndis_softc *sc, struct ndisusb_ep *ne,
|
||||
struct ndisusb_xfer *nx, usb2_error_t status)
|
||||
struct ndisusb_xfer *nx, usb_error_t status)
|
||||
{
|
||||
struct ndisusb_xferdone *nd;
|
||||
uint8_t irql;
|
||||
@ -1122,7 +1122,7 @@ usbd_xfertask(dobj, arg)
|
||||
struct usbd_urb_bulk_or_intr_transfer *ubi;
|
||||
struct usbd_urb_vendor_or_class_request *vcreq;
|
||||
union usbd_urb *urb;
|
||||
usb2_error_t status;
|
||||
usb_error_t status;
|
||||
void *priv;
|
||||
|
||||
dev = sc->ndis_dev;
|
||||
|
@ -132,16 +132,16 @@ static device_probe_t atausb2_probe;
|
||||
static device_attach_t atausb2_attach;
|
||||
static device_detach_t atausb2_detach;
|
||||
|
||||
static usb2_callback_t atausb2_t_bbb_reset1_callback;
|
||||
static usb2_callback_t atausb2_t_bbb_reset2_callback;
|
||||
static usb2_callback_t atausb2_t_bbb_reset3_callback;
|
||||
static usb2_callback_t atausb2_t_bbb_command_callback;
|
||||
static usb2_callback_t atausb2_t_bbb_data_read_callback;
|
||||
static usb2_callback_t atausb2_t_bbb_data_rd_cs_callback;
|
||||
static usb2_callback_t atausb2_t_bbb_data_write_callback;
|
||||
static usb2_callback_t atausb2_t_bbb_data_wr_cs_callback;
|
||||
static usb2_callback_t atausb2_t_bbb_status_callback;
|
||||
static usb2_callback_t atausb2_tr_error;
|
||||
static usb_callback_t atausb2_t_bbb_reset1_callback;
|
||||
static usb_callback_t atausb2_t_bbb_reset2_callback;
|
||||
static usb_callback_t atausb2_t_bbb_reset3_callback;
|
||||
static usb_callback_t atausb2_t_bbb_command_callback;
|
||||
static usb_callback_t atausb2_t_bbb_data_read_callback;
|
||||
static usb_callback_t atausb2_t_bbb_data_rd_cs_callback;
|
||||
static usb_callback_t atausb2_t_bbb_data_write_callback;
|
||||
static usb_callback_t atausb2_t_bbb_data_wr_cs_callback;
|
||||
static usb_callback_t atausb2_t_bbb_status_callback;
|
||||
static usb_callback_t atausb2_tr_error;
|
||||
|
||||
static void atausb2_cancel_request(struct atausb2_softc *sc);
|
||||
static void atausb2_transfer_start(struct atausb2_softc *sc, uint8_t xfer_no);
|
||||
|
@ -138,7 +138,7 @@ struct ndisusb_xfer {
|
||||
};
|
||||
struct ndisusb_xferdone {
|
||||
struct ndisusb_xfer *nd_xfer;
|
||||
usb2_error_t nd_status;
|
||||
usb_error_t nd_status;
|
||||
list_entry nd_donelist;
|
||||
};
|
||||
|
||||
|
@ -308,13 +308,13 @@ static device_probe_t uaudio_probe;
|
||||
static device_attach_t uaudio_attach;
|
||||
static device_detach_t uaudio_detach;
|
||||
|
||||
static usb2_callback_t uaudio_chan_play_callback;
|
||||
static usb2_callback_t uaudio_chan_record_callback;
|
||||
static usb2_callback_t uaudio_mixer_write_cfg_callback;
|
||||
static usb2_callback_t umidi_read_clear_stall_callback;
|
||||
static usb2_callback_t umidi_bulk_read_callback;
|
||||
static usb2_callback_t umidi_write_clear_stall_callback;
|
||||
static usb2_callback_t umidi_bulk_write_callback;
|
||||
static usb_callback_t uaudio_chan_play_callback;
|
||||
static usb_callback_t uaudio_chan_record_callback;
|
||||
static usb_callback_t uaudio_mixer_write_cfg_callback;
|
||||
static usb_callback_t umidi_read_clear_stall_callback;
|
||||
static usb_callback_t umidi_bulk_read_callback;
|
||||
static usb_callback_t umidi_write_clear_stall_callback;
|
||||
static usb_callback_t umidi_bulk_write_callback;
|
||||
|
||||
static void uaudio_chan_fill_info_sub(struct uaudio_softc *,
|
||||
struct usb_device *, uint32_t, uint16_t, uint8_t, uint8_t);
|
||||
@ -362,7 +362,7 @@ static uint16_t uaudio_mixer_get(struct usb_device *, uint8_t,
|
||||
struct uaudio_mixer_node *);
|
||||
static void uaudio_mixer_ctl_set(struct uaudio_softc *,
|
||||
struct uaudio_mixer_node *, uint8_t, int32_t val);
|
||||
static usb2_error_t uaudio_set_speed(struct usb_device *, uint8_t, uint32_t);
|
||||
static usb_error_t uaudio_set_speed(struct usb_device *, uint8_t, uint32_t);
|
||||
static int uaudio_mixer_signext(uint8_t, int);
|
||||
static int uaudio_mixer_bsd2value(struct uaudio_mixer_node *, int32_t val);
|
||||
static const void *uaudio_mixer_verify_desc(const void *, uint32_t);
|
||||
@ -1295,7 +1295,7 @@ uaudio_chan_init(struct uaudio_softc *sc, struct snd_dbuf *b,
|
||||
uint8_t endpoint;
|
||||
uint8_t iface_index;
|
||||
uint8_t alt_index;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
/* compute required buffer size */
|
||||
buf_size = (ch->bytes_per_frame * UAUDIO_MINFRAMES);
|
||||
@ -2873,7 +2873,7 @@ uaudio_mixer_get(struct usb_device *udev, uint8_t what,
|
||||
uint16_t val;
|
||||
uint16_t len = MIX_SIZE(mc->type);
|
||||
uint8_t data[4];
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
if (mc->wValue[0] == -1) {
|
||||
return (0);
|
||||
@ -2987,7 +2987,7 @@ uaudio_mixer_write_cfg_callback(struct usb_xfer *xfer)
|
||||
}
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
uaudio_set_speed(struct usb_device *udev, uint8_t endpt, uint32_t speed)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
|
@ -92,7 +92,7 @@ static at91dci_cmd_t at91dci_setup_rx;
|
||||
static at91dci_cmd_t at91dci_data_rx;
|
||||
static at91dci_cmd_t at91dci_data_tx;
|
||||
static at91dci_cmd_t at91dci_data_tx_sync;
|
||||
static void at91dci_device_done(struct usb_xfer *, usb2_error_t);
|
||||
static void at91dci_device_done(struct usb_xfer *, usb_error_t);
|
||||
static void at91dci_do_poll(struct usb_bus *);
|
||||
static void at91dci_standard_done(struct usb_xfer *);
|
||||
static void at91dci_root_intr(struct at91dci_softc *sc);
|
||||
@ -1070,7 +1070,7 @@ at91dci_root_intr(struct at91dci_softc *sc)
|
||||
sizeof(sc->sc_hub_idata));
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
at91dci_standard_done_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
struct at91dci_td *td;
|
||||
@ -1137,7 +1137,7 @@ at91dci_standard_done_sub(struct usb_xfer *xfer)
|
||||
static void
|
||||
at91dci_standard_done(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
usb_error_t err = 0;
|
||||
|
||||
DPRINTFN(13, "xfer=%p pipe=%p transfer done\n",
|
||||
xfer, xfer->pipe);
|
||||
@ -1184,7 +1184,7 @@ at91dci_standard_done(struct usb_xfer *xfer)
|
||||
* same USB transfer!
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
at91dci_device_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
at91dci_device_done(struct usb_xfer *xfer, usb_error_t error)
|
||||
{
|
||||
struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus);
|
||||
uint8_t ep_no;
|
||||
@ -1355,7 +1355,7 @@ at91dci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
|
||||
(ed->bEndpointAddress & (UE_DIR_IN | UE_DIR_OUT)));
|
||||
}
|
||||
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
at91dci_init(struct at91dci_softc *sc)
|
||||
{
|
||||
uint32_t csr_val;
|
||||
@ -1745,7 +1745,7 @@ USB_MAKE_STRING_DESC(STRING_LANG, at91dci_langtab);
|
||||
USB_MAKE_STRING_DESC(STRING_VENDOR, at91dci_vendor);
|
||||
USB_MAKE_STRING_DESC(STRING_PRODUCT, at91dci_product);
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
at91dci_roothub_exec(struct usb_device *udev,
|
||||
struct usb_device_request *req, const void **pptr, uint16_t *plength)
|
||||
{
|
||||
@ -1754,7 +1754,7 @@ at91dci_roothub_exec(struct usb_device *udev,
|
||||
uint16_t len;
|
||||
uint16_t value;
|
||||
uint16_t index;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED);
|
||||
|
||||
|
@ -233,7 +233,7 @@ struct at91dci_softc {
|
||||
|
||||
/* prototypes */
|
||||
|
||||
usb2_error_t at91dci_init(struct at91dci_softc *sc);
|
||||
usb_error_t at91dci_init(struct at91dci_softc *sc);
|
||||
void at91dci_uninit(struct at91dci_softc *sc);
|
||||
void at91dci_suspend(struct at91dci_softc *sc);
|
||||
void at91dci_resume(struct at91dci_softc *sc);
|
||||
|
@ -82,7 +82,7 @@ static atmegadci_cmd_t atmegadci_setup_rx;
|
||||
static atmegadci_cmd_t atmegadci_data_rx;
|
||||
static atmegadci_cmd_t atmegadci_data_tx;
|
||||
static atmegadci_cmd_t atmegadci_data_tx_sync;
|
||||
static void atmegadci_device_done(struct usb_xfer *, usb2_error_t);
|
||||
static void atmegadci_device_done(struct usb_xfer *, usb_error_t);
|
||||
static void atmegadci_do_poll(struct usb_bus *);
|
||||
static void atmegadci_standard_done(struct usb_xfer *);
|
||||
static void atmegadci_root_intr(struct atmegadci_softc *sc);
|
||||
@ -953,7 +953,7 @@ atmegadci_root_intr(struct atmegadci_softc *sc)
|
||||
sizeof(sc->sc_hub_idata));
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
atmegadci_standard_done_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
struct atmegadci_td *td;
|
||||
@ -1020,7 +1020,7 @@ atmegadci_standard_done_sub(struct usb_xfer *xfer)
|
||||
static void
|
||||
atmegadci_standard_done(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
usb_error_t err = 0;
|
||||
|
||||
DPRINTFN(13, "xfer=%p pipe=%p transfer done\n",
|
||||
xfer, xfer->pipe);
|
||||
@ -1067,7 +1067,7 @@ atmegadci_standard_done(struct usb_xfer *xfer)
|
||||
* same USB transfer!
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
atmegadci_device_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
atmegadci_device_done(struct usb_xfer *xfer, usb_error_t error)
|
||||
{
|
||||
struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus);
|
||||
uint8_t ep_no;
|
||||
@ -1205,7 +1205,7 @@ atmegadci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
|
||||
(ed->bEndpointAddress & (UE_DIR_IN | UE_DIR_OUT)));
|
||||
}
|
||||
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
atmegadci_init(struct atmegadci_softc *sc)
|
||||
{
|
||||
uint8_t n;
|
||||
@ -1566,7 +1566,7 @@ USB_MAKE_STRING_DESC(STRING_LANG, atmegadci_langtab);
|
||||
USB_MAKE_STRING_DESC(STRING_VENDOR, atmegadci_vendor);
|
||||
USB_MAKE_STRING_DESC(STRING_PRODUCT, atmegadci_product);
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
atmegadci_roothub_exec(struct usb_device *udev,
|
||||
struct usb_device_request *req, const void **pptr, uint16_t *plength)
|
||||
{
|
||||
@ -1576,7 +1576,7 @@ atmegadci_roothub_exec(struct usb_device *udev,
|
||||
uint16_t value;
|
||||
uint16_t index;
|
||||
uint8_t temp;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED);
|
||||
|
||||
|
@ -276,7 +276,7 @@ struct atmegadci_softc {
|
||||
|
||||
/* prototypes */
|
||||
|
||||
usb2_error_t atmegadci_init(struct atmegadci_softc *sc);
|
||||
usb_error_t atmegadci_init(struct atmegadci_softc *sc);
|
||||
void atmegadci_uninit(struct atmegadci_softc *sc);
|
||||
void atmegadci_suspend(struct atmegadci_softc *sc);
|
||||
void atmegadci_resume(struct atmegadci_softc *sc);
|
||||
|
@ -82,7 +82,7 @@ static avr32dci_cmd_t avr32dci_setup_rx;
|
||||
static avr32dci_cmd_t avr32dci_data_rx;
|
||||
static avr32dci_cmd_t avr32dci_data_tx;
|
||||
static avr32dci_cmd_t avr32dci_data_tx_sync;
|
||||
static void avr32dci_device_done(struct usb_xfer *, usb2_error_t);
|
||||
static void avr32dci_device_done(struct usb_xfer *, usb_error_t);
|
||||
static void avr32dci_do_poll(struct usb_bus *);
|
||||
static void avr32dci_standard_done(struct usb_xfer *);
|
||||
static void avr32dci_root_intr(struct avr32dci_softc *sc);
|
||||
@ -924,7 +924,7 @@ avr32dci_root_intr(struct avr32dci_softc *sc)
|
||||
sizeof(sc->sc_hub_idata));
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
avr32dci_standard_done_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
struct avr32dci_td *td;
|
||||
@ -991,7 +991,7 @@ avr32dci_standard_done_sub(struct usb_xfer *xfer)
|
||||
static void
|
||||
avr32dci_standard_done(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
usb_error_t err = 0;
|
||||
|
||||
DPRINTFN(13, "xfer=%p pipe=%p transfer done\n",
|
||||
xfer, xfer->pipe);
|
||||
@ -1038,7 +1038,7 @@ avr32dci_standard_done(struct usb_xfer *xfer)
|
||||
* same USB transfer!
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
avr32dci_device_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
avr32dci_device_done(struct usb_xfer *xfer, usb_error_t error)
|
||||
{
|
||||
struct avr32dci_softc *sc = AVR32_BUS2SC(xfer->xroot->bus);
|
||||
uint8_t ep_no;
|
||||
@ -1175,7 +1175,7 @@ avr32dci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
|
||||
(ed->bEndpointAddress & (UE_DIR_IN | UE_DIR_OUT)));
|
||||
}
|
||||
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
avr32dci_init(struct avr32dci_softc *sc)
|
||||
{
|
||||
uint8_t n;
|
||||
@ -1500,7 +1500,7 @@ USB_MAKE_STRING_DESC(STRING_LANG, avr32dci_langtab);
|
||||
USB_MAKE_STRING_DESC(STRING_VENDOR, avr32dci_vendor);
|
||||
USB_MAKE_STRING_DESC(STRING_PRODUCT, avr32dci_product);
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
avr32dci_roothub_exec(struct usb_device *udev,
|
||||
struct usb_device_request *req, const void **pptr, uint16_t *plength)
|
||||
{
|
||||
@ -1510,7 +1510,7 @@ avr32dci_roothub_exec(struct usb_device *udev,
|
||||
uint16_t value;
|
||||
uint16_t index;
|
||||
uint32_t temp;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED);
|
||||
|
||||
|
@ -244,7 +244,7 @@ struct avr32dci_softc {
|
||||
|
||||
/* prototypes */
|
||||
|
||||
usb2_error_t avr32dci_init(struct avr32dci_softc *sc);
|
||||
usb_error_t avr32dci_init(struct avr32dci_softc *sc);
|
||||
void avr32dci_uninit(struct avr32dci_softc *sc);
|
||||
void avr32dci_suspend(struct avr32dci_softc *sc);
|
||||
void avr32dci_resume(struct avr32dci_softc *sc);
|
||||
|
@ -94,7 +94,7 @@ extern struct usb_pipe_methods ehci_device_isoc_fs_methods;
|
||||
extern struct usb_pipe_methods ehci_device_isoc_hs_methods;
|
||||
|
||||
static void ehci_do_poll(struct usb_bus *bus);
|
||||
static void ehci_device_done(struct usb_xfer *xfer, usb2_error_t error);
|
||||
static void ehci_device_done(struct usb_xfer *xfer, usb_error_t error);
|
||||
static uint8_t ehci_check_transfer(struct usb_xfer *xfer);
|
||||
static void ehci_timeout(void *arg);
|
||||
static void ehci_root_intr(ehci_softc_t *sc);
|
||||
@ -115,7 +115,7 @@ struct ehci_std_temp {
|
||||
};
|
||||
|
||||
void
|
||||
ehci_iterate_hw_softc(struct usb_bus *bus, usb2_bus_mem_sub_cb_t *cb)
|
||||
ehci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(bus);
|
||||
uint32_t i;
|
||||
@ -145,7 +145,7 @@ ehci_iterate_hw_softc(struct usb_bus *bus, usb2_bus_mem_sub_cb_t *cb)
|
||||
}
|
||||
}
|
||||
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
ehci_reset(ehci_softc_t *sc)
|
||||
{
|
||||
uint32_t hcr;
|
||||
@ -181,7 +181,7 @@ ehci_reset(ehci_softc_t *sc)
|
||||
return (USB_ERR_IOERROR);
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
ehci_hcreset(ehci_softc_t *sc)
|
||||
{
|
||||
uint32_t hcr;
|
||||
@ -205,7 +205,7 @@ ehci_hcreset(ehci_softc_t *sc)
|
||||
return ehci_reset(sc);
|
||||
}
|
||||
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
ehci_init(ehci_softc_t *sc)
|
||||
{
|
||||
struct usb_page_search buf_res;
|
||||
@ -217,7 +217,7 @@ ehci_init(ehci_softc_t *sc)
|
||||
uint16_t x;
|
||||
uint16_t y;
|
||||
uint16_t bit;
|
||||
usb2_error_t err = 0;
|
||||
usb_error_t err = 0;
|
||||
|
||||
DPRINTF("start\n");
|
||||
|
||||
@ -1120,7 +1120,7 @@ _ehci_remove_qh(ehci_qh_t *sqh, ehci_qh_t *last)
|
||||
return (last);
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
ehci_non_isoc_done_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
|
||||
@ -1216,7 +1216,7 @@ ehci_non_isoc_done_sub(struct usb_xfer *xfer)
|
||||
static void
|
||||
ehci_non_isoc_done(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
usb_error_t err = 0;
|
||||
|
||||
DPRINTFN(13, "xfer=%p pipe=%p transfer done\n",
|
||||
xfer, xfer->pipe);
|
||||
@ -2111,7 +2111,7 @@ ehci_isoc_hs_done(ehci_softc_t *sc, struct usb_xfer *xfer)
|
||||
* from close and from interrupt
|
||||
*/
|
||||
static void
|
||||
ehci_device_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
ehci_device_done(struct usb_xfer *xfer, usb_error_t error)
|
||||
{
|
||||
struct usb_pipe_methods *methods = xfer->pipe->methods;
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
|
||||
@ -2984,7 +2984,7 @@ ehci_disown(ehci_softc_t *sc, uint16_t index, uint8_t lowspeed)
|
||||
EOWRITE4(sc, port, v | EHCI_PS_PO);
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
ehci_roothub_exec(struct usb_device *udev,
|
||||
struct usb_device_request *req, const void **pptr, uint16_t *plength)
|
||||
{
|
||||
@ -2998,7 +2998,7 @@ ehci_roothub_exec(struct usb_device *udev,
|
||||
uint16_t value;
|
||||
uint16_t index;
|
||||
uint8_t l;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED);
|
||||
|
||||
|
@ -574,10 +574,10 @@ hc16toh(const struct ehci_softc *sc, const uint16_t v)
|
||||
}
|
||||
#endif
|
||||
|
||||
usb2_bus_mem_cb_t ehci_iterate_hw_softc;
|
||||
usb_bus_mem_cb_t ehci_iterate_hw_softc;
|
||||
|
||||
usb2_error_t ehci_reset(ehci_softc_t *sc);
|
||||
usb2_error_t ehci_init(ehci_softc_t *sc);
|
||||
usb_error_t ehci_reset(ehci_softc_t *sc);
|
||||
usb_error_t ehci_init(ehci_softc_t *sc);
|
||||
void ehci_detach(struct ehci_softc *sc);
|
||||
void ehci_suspend(struct ehci_softc *sc);
|
||||
void ehci_resume(struct ehci_softc *sc);
|
||||
|
@ -86,7 +86,7 @@ static musbotg_cmd_t musbotg_setup_data_tx;
|
||||
static musbotg_cmd_t musbotg_setup_status;
|
||||
static musbotg_cmd_t musbotg_data_rx;
|
||||
static musbotg_cmd_t musbotg_data_tx;
|
||||
static void musbotg_device_done(struct usb_xfer *, usb2_error_t);
|
||||
static void musbotg_device_done(struct usb_xfer *, usb_error_t);
|
||||
static void musbotg_do_poll(struct usb_bus *);
|
||||
static void musbotg_standard_done(struct usb_xfer *);
|
||||
static void musbotg_interrupt_poll(struct musbotg_softc *);
|
||||
@ -1321,7 +1321,7 @@ musbotg_root_intr(struct musbotg_softc *sc)
|
||||
sizeof(sc->sc_hub_idata));
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
musbotg_standard_done_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
struct musbotg_td *td;
|
||||
@ -1388,7 +1388,7 @@ musbotg_standard_done_sub(struct usb_xfer *xfer)
|
||||
static void
|
||||
musbotg_standard_done(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
usb_error_t err = 0;
|
||||
|
||||
DPRINTFN(12, "xfer=%p pipe=%p transfer done\n",
|
||||
xfer, xfer->pipe);
|
||||
@ -1435,7 +1435,7 @@ musbotg_standard_done(struct usb_xfer *xfer)
|
||||
* same USB transfer!
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
musbotg_device_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
musbotg_device_done(struct usb_xfer *xfer, usb_error_t error)
|
||||
{
|
||||
USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED);
|
||||
|
||||
@ -1664,7 +1664,7 @@ musbotg_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
|
||||
(ed->bEndpointAddress & (UE_DIR_IN | UE_DIR_OUT)));
|
||||
}
|
||||
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
musbotg_init(struct musbotg_softc *sc)
|
||||
{
|
||||
struct usb_hw_ep_profile *pf;
|
||||
@ -2153,7 +2153,7 @@ USB_MAKE_STRING_DESC(STRING_LANG, musbotg_langtab);
|
||||
USB_MAKE_STRING_DESC(STRING_VENDOR, musbotg_vendor);
|
||||
USB_MAKE_STRING_DESC(STRING_PRODUCT, musbotg_product);
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
musbotg_roothub_exec(struct usb_device *udev,
|
||||
struct usb_device_request *req, const void **pptr, uint16_t *plength)
|
||||
{
|
||||
@ -2162,7 +2162,7 @@ musbotg_roothub_exec(struct usb_device *udev,
|
||||
uint16_t len;
|
||||
uint16_t value;
|
||||
uint16_t index;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED);
|
||||
|
||||
|
@ -396,7 +396,7 @@ struct musbotg_softc {
|
||||
|
||||
/* prototypes */
|
||||
|
||||
usb2_error_t musbotg_init(struct musbotg_softc *sc);
|
||||
usb_error_t musbotg_init(struct musbotg_softc *sc);
|
||||
void musbotg_uninit(struct musbotg_softc *sc);
|
||||
void musbotg_suspend(struct musbotg_softc *sc);
|
||||
void musbotg_resume(struct musbotg_softc *sc);
|
||||
|
@ -94,7 +94,7 @@ extern struct usb_pipe_methods ohci_device_intr_methods;
|
||||
extern struct usb_pipe_methods ohci_device_isoc_methods;
|
||||
|
||||
static void ohci_do_poll(struct usb_bus *bus);
|
||||
static void ohci_device_done(struct usb_xfer *xfer, usb2_error_t error);
|
||||
static void ohci_device_done(struct usb_xfer *xfer, usb_error_t error);
|
||||
static void ohci_timeout(void *arg);
|
||||
static uint8_t ohci_check_transfer(struct usb_xfer *xfer);
|
||||
static void ohci_root_intr(ohci_softc_t *sc);
|
||||
@ -120,7 +120,7 @@ ohci_get_hcca(ohci_softc_t *sc)
|
||||
}
|
||||
|
||||
void
|
||||
ohci_iterate_hw_softc(struct usb_bus *bus, usb2_bus_mem_sub_cb_t *cb)
|
||||
ohci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb)
|
||||
{
|
||||
struct ohci_softc *sc = OHCI_BUS2SC(bus);
|
||||
uint32_t i;
|
||||
@ -143,7 +143,7 @@ ohci_iterate_hw_softc(struct usb_bus *bus, usb2_bus_mem_sub_cb_t *cb)
|
||||
}
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
ohci_controller_init(ohci_softc_t *sc)
|
||||
{
|
||||
struct usb_page_search buf_res;
|
||||
@ -289,7 +289,7 @@ ohci_init_ed(struct usb_page_cache *pc)
|
||||
return (ed);
|
||||
}
|
||||
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
ohci_init(ohci_softc_t *sc)
|
||||
{
|
||||
struct usb_page_search buf_res;
|
||||
@ -812,7 +812,7 @@ static const char *const
|
||||
|
||||
#endif
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
ohci_non_isoc_done_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
ohci_td_t *td;
|
||||
@ -908,7 +908,7 @@ ohci_non_isoc_done_sub(struct usb_xfer *xfer)
|
||||
static void
|
||||
ohci_non_isoc_done(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
usb_error_t err = 0;
|
||||
|
||||
DPRINTFN(13, "xfer=%p pipe=%p transfer done\n",
|
||||
xfer, xfer->pipe);
|
||||
@ -1645,7 +1645,7 @@ ohci_root_intr(ohci_softc_t *sc)
|
||||
* from close and from interrupt
|
||||
*/
|
||||
static void
|
||||
ohci_device_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
ohci_device_done(struct usb_xfer *xfer, usb_error_t error)
|
||||
{
|
||||
struct usb_pipe_methods *methods = xfer->pipe->methods;
|
||||
ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus);
|
||||
@ -2106,7 +2106,7 @@ struct usb_hub_descriptor ohci_hubd =
|
||||
{0},
|
||||
};
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
ohci_roothub_exec(struct usb_device *udev,
|
||||
struct usb_device_request *req, const void **pptr, uint16_t *plength)
|
||||
{
|
||||
@ -2119,7 +2119,7 @@ ohci_roothub_exec(struct usb_device *udev,
|
||||
uint16_t value;
|
||||
uint16_t index;
|
||||
uint8_t l;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED);
|
||||
|
||||
|
@ -352,9 +352,9 @@ typedef struct ohci_softc {
|
||||
|
||||
} ohci_softc_t;
|
||||
|
||||
usb2_bus_mem_cb_t ohci_iterate_hw_softc;
|
||||
usb_bus_mem_cb_t ohci_iterate_hw_softc;
|
||||
|
||||
usb2_error_t ohci_init(ohci_softc_t *sc);
|
||||
usb_error_t ohci_init(ohci_softc_t *sc);
|
||||
void ohci_detach(struct ohci_softc *sc);
|
||||
void ohci_suspend(ohci_softc_t *sc);
|
||||
void ohci_resume(ohci_softc_t *sc);
|
||||
|
@ -134,14 +134,14 @@ extern struct usb_pipe_methods uhci_device_isoc_methods;
|
||||
|
||||
static uint8_t uhci_restart(uhci_softc_t *sc);
|
||||
static void uhci_do_poll(struct usb_bus *);
|
||||
static void uhci_device_done(struct usb_xfer *, usb2_error_t);
|
||||
static void uhci_device_done(struct usb_xfer *, usb_error_t);
|
||||
static void uhci_transfer_intr_enqueue(struct usb_xfer *);
|
||||
static void uhci_timeout(void *);
|
||||
static uint8_t uhci_check_transfer(struct usb_xfer *);
|
||||
static void uhci_root_intr(uhci_softc_t *sc);
|
||||
|
||||
void
|
||||
uhci_iterate_hw_softc(struct usb_bus *bus, usb2_bus_mem_sub_cb_t *cb)
|
||||
uhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb)
|
||||
{
|
||||
struct uhci_softc *sc = UHCI_BUS2SC(bus);
|
||||
uint32_t i;
|
||||
@ -424,7 +424,7 @@ uhci_init_td(struct usb_page_cache *pc)
|
||||
return (td);
|
||||
}
|
||||
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
uhci_init(uhci_softc_t *sc)
|
||||
{
|
||||
uint16_t bit;
|
||||
@ -1089,7 +1089,7 @@ uhci_isoc_done(uhci_softc_t *sc, struct usb_xfer *xfer)
|
||||
xfer->aframes = xfer->nframes;
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
uhci_non_isoc_done_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb_page_search res;
|
||||
@ -1205,7 +1205,7 @@ uhci_non_isoc_done_sub(struct usb_xfer *xfer)
|
||||
static void
|
||||
uhci_non_isoc_done(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
usb_error_t err = 0;
|
||||
|
||||
DPRINTFN(13, "xfer=%p pipe=%p transfer done\n",
|
||||
xfer, xfer->pipe);
|
||||
@ -1857,7 +1857,7 @@ uhci_setup_standard_chain(struct usb_xfer *xfer)
|
||||
*/
|
||||
|
||||
static void
|
||||
uhci_device_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
uhci_device_done(struct usb_xfer *xfer, usb_error_t error)
|
||||
{
|
||||
struct usb_pipe_methods *methods = xfer->pipe->methods;
|
||||
uhci_softc_t *sc = UHCI_BUS2SC(xfer->xroot->bus);
|
||||
@ -2392,7 +2392,7 @@ struct usb_hub_descriptor_min uhci_hubd_piix =
|
||||
* outstanding "port enable change" and "connection status change"
|
||||
* events have been reset.
|
||||
*/
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
uhci_portreset(uhci_softc_t *sc, uint16_t index)
|
||||
{
|
||||
uint16_t port;
|
||||
@ -2493,7 +2493,7 @@ uhci_portreset(uhci_softc_t *sc, uint16_t index)
|
||||
return (USB_ERR_NORMAL_COMPLETION);
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
uhci_roothub_exec(struct usb_device *udev,
|
||||
struct usb_device_request *req, const void **pptr, uint16_t *plength)
|
||||
{
|
||||
@ -2507,7 +2507,7 @@ uhci_roothub_exec(struct usb_device *udev,
|
||||
uint16_t status;
|
||||
uint16_t change;
|
||||
uint16_t len;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED);
|
||||
|
||||
|
@ -309,9 +309,9 @@ typedef struct uhci_softc {
|
||||
char sc_vendor[16]; /* vendor string for root hub */
|
||||
} uhci_softc_t;
|
||||
|
||||
usb2_bus_mem_cb_t uhci_iterate_hw_softc;
|
||||
usb_bus_mem_cb_t uhci_iterate_hw_softc;
|
||||
|
||||
usb2_error_t uhci_init(uhci_softc_t *sc);
|
||||
usb_error_t uhci_init(uhci_softc_t *sc);
|
||||
void uhci_suspend(uhci_softc_t *sc);
|
||||
void uhci_resume(uhci_softc_t *sc);
|
||||
void uhci_reset(uhci_softc_t *sc);
|
||||
|
@ -289,7 +289,7 @@ usb2_bus_attach(struct usb_proc_msg *pm)
|
||||
struct usb_bus *bus;
|
||||
struct usb_device *child;
|
||||
device_t dev;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
enum usb_dev_speed speed;
|
||||
|
||||
bus = ((struct usb_bus_msg *)pm)->bus;
|
||||
@ -496,7 +496,7 @@ usb2_bus_mem_flush_all_cb(struct usb_bus *bus, struct usb_page_cache *pc,
|
||||
*------------------------------------------------------------------------*/
|
||||
#if USB_HAVE_BUSDMA
|
||||
void
|
||||
usb2_bus_mem_flush_all(struct usb_bus *bus, usb2_bus_mem_cb_t *cb)
|
||||
usb2_bus_mem_flush_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb)
|
||||
{
|
||||
if (cb) {
|
||||
cb(bus, &usb2_bus_mem_flush_all_cb);
|
||||
@ -530,7 +530,7 @@ usb2_bus_mem_alloc_all_cb(struct usb_bus *bus, struct usb_page_cache *pc,
|
||||
*------------------------------------------------------------------------*/
|
||||
uint8_t
|
||||
usb2_bus_mem_alloc_all(struct usb_bus *bus, bus_dma_tag_t dmat,
|
||||
usb2_bus_mem_cb_t *cb)
|
||||
usb_bus_mem_cb_t *cb)
|
||||
{
|
||||
bus->alloc_failed = 0;
|
||||
|
||||
@ -580,7 +580,7 @@ usb2_bus_mem_free_all_cb(struct usb_bus *bus, struct usb_page_cache *pc,
|
||||
* usb2_bus_mem_free_all - factored out code
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_bus_mem_free_all(struct usb_bus *bus, usb2_bus_mem_cb_t *cb)
|
||||
usb2_bus_mem_free_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb)
|
||||
{
|
||||
#if USB_HAVE_BUSDMA
|
||||
if (cb) {
|
||||
|
@ -81,7 +81,7 @@ static uss820dci_cmd_t uss820dci_setup_rx;
|
||||
static uss820dci_cmd_t uss820dci_data_rx;
|
||||
static uss820dci_cmd_t uss820dci_data_tx;
|
||||
static uss820dci_cmd_t uss820dci_data_tx_sync;
|
||||
static void uss820dci_device_done(struct usb_xfer *, usb2_error_t);
|
||||
static void uss820dci_device_done(struct usb_xfer *, usb_error_t);
|
||||
static void uss820dci_do_poll(struct usb_bus *);
|
||||
static void uss820dci_standard_done(struct usb_xfer *);
|
||||
static void uss820dci_intr_set(struct usb_xfer *, uint8_t);
|
||||
@ -1054,7 +1054,7 @@ uss820dci_root_intr(struct uss820dci_softc *sc)
|
||||
sizeof(sc->sc_hub_idata));
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
uss820dci_standard_done_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uss820dci_td *td;
|
||||
@ -1121,7 +1121,7 @@ uss820dci_standard_done_sub(struct usb_xfer *xfer)
|
||||
static void
|
||||
uss820dci_standard_done(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
usb_error_t err = 0;
|
||||
|
||||
DPRINTFN(13, "xfer=%p pipe=%p transfer done\n",
|
||||
xfer, xfer->pipe);
|
||||
@ -1168,7 +1168,7 @@ uss820dci_standard_done(struct usb_xfer *xfer)
|
||||
* same USB transfer!
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
uss820dci_device_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
uss820dci_device_done(struct usb_xfer *xfer, usb_error_t error)
|
||||
{
|
||||
USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED);
|
||||
|
||||
@ -1298,7 +1298,7 @@ uss820dci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
|
||||
(ed->bEndpointAddress & (UE_DIR_IN | UE_DIR_OUT)));
|
||||
}
|
||||
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
uss820dci_init(struct uss820dci_softc *sc)
|
||||
{
|
||||
const struct usb_hw_ep_profile *pf;
|
||||
@ -1790,7 +1790,7 @@ USB_MAKE_STRING_DESC(STRING_LANG, uss820dci_langtab);
|
||||
USB_MAKE_STRING_DESC(STRING_VENDOR, uss820dci_vendor);
|
||||
USB_MAKE_STRING_DESC(STRING_PRODUCT, uss820dci_product);
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
uss820dci_roothub_exec(struct usb_device *udev,
|
||||
struct usb_device_request *req, const void **pptr, uint16_t *plength)
|
||||
{
|
||||
@ -1799,7 +1799,7 @@ uss820dci_roothub_exec(struct usb_device *udev,
|
||||
uint16_t len;
|
||||
uint16_t value;
|
||||
uint16_t index;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED);
|
||||
|
||||
|
@ -347,7 +347,7 @@ struct uss820dci_softc {
|
||||
|
||||
/* prototypes */
|
||||
|
||||
usb2_error_t uss820dci_init(struct uss820dci_softc *sc);
|
||||
usb_error_t uss820dci_init(struct uss820dci_softc *sc);
|
||||
void uss820dci_uninit(struct uss820dci_softc *sc);
|
||||
void uss820dci_suspend(struct uss820dci_softc *sc);
|
||||
void uss820dci_resume(struct uss820dci_softc *sc);
|
||||
|
@ -126,17 +126,17 @@ static device_probe_t uhid_probe;
|
||||
static device_attach_t uhid_attach;
|
||||
static device_detach_t uhid_detach;
|
||||
|
||||
static usb2_callback_t uhid_intr_callback;
|
||||
static usb2_callback_t uhid_write_callback;
|
||||
static usb2_callback_t uhid_read_callback;
|
||||
static usb_callback_t uhid_intr_callback;
|
||||
static usb_callback_t uhid_write_callback;
|
||||
static usb_callback_t uhid_read_callback;
|
||||
|
||||
static usb2_fifo_cmd_t uhid_start_read;
|
||||
static usb2_fifo_cmd_t uhid_stop_read;
|
||||
static usb2_fifo_cmd_t uhid_start_write;
|
||||
static usb2_fifo_cmd_t uhid_stop_write;
|
||||
static usb2_fifo_open_t uhid_open;
|
||||
static usb2_fifo_close_t uhid_close;
|
||||
static usb2_fifo_ioctl_t uhid_ioctl;
|
||||
static usb_fifo_cmd_t uhid_start_read;
|
||||
static usb_fifo_cmd_t uhid_stop_read;
|
||||
static usb_fifo_cmd_t uhid_start_write;
|
||||
static usb_fifo_cmd_t uhid_stop_write;
|
||||
static usb_fifo_open_t uhid_open;
|
||||
static usb_fifo_close_t uhid_close;
|
||||
static usb_fifo_ioctl_t uhid_ioctl;
|
||||
|
||||
static struct usb_fifo_methods uhid_fifo_methods = {
|
||||
.f_open = &uhid_open,
|
||||
|
@ -688,7 +688,7 @@ ukbd_attach(device_t dev)
|
||||
int32_t unit = device_get_unit(dev);
|
||||
keyboard_t *kbd = &sc->sc_kbd;
|
||||
void *hid_ptr = NULL;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint32_t flags;
|
||||
uint16_t n;
|
||||
uint16_t hid_len;
|
||||
|
@ -136,17 +136,17 @@ struct ums_softc {
|
||||
|
||||
static void ums_put_queue_timeout(void *__sc);
|
||||
|
||||
static usb2_callback_t ums_intr_callback;
|
||||
static usb_callback_t ums_intr_callback;
|
||||
|
||||
static device_probe_t ums_probe;
|
||||
static device_attach_t ums_attach;
|
||||
static device_detach_t ums_detach;
|
||||
|
||||
static usb2_fifo_cmd_t ums_start_read;
|
||||
static usb2_fifo_cmd_t ums_stop_read;
|
||||
static usb2_fifo_open_t ums_open;
|
||||
static usb2_fifo_close_t ums_close;
|
||||
static usb2_fifo_ioctl_t ums_ioctl;
|
||||
static usb_fifo_cmd_t ums_start_read;
|
||||
static usb_fifo_cmd_t ums_stop_read;
|
||||
static usb_fifo_open_t ums_open;
|
||||
static usb_fifo_close_t ums_close;
|
||||
static usb_fifo_ioctl_t ums_ioctl;
|
||||
|
||||
static void ums_put_queue(struct ums_softc *sc, int32_t dx, int32_t dy, int32_t dz, int32_t dt, int32_t buttons);
|
||||
|
||||
|
@ -128,10 +128,10 @@ static device_probe_t udbp_probe;
|
||||
static device_attach_t udbp_attach;
|
||||
static device_detach_t udbp_detach;
|
||||
|
||||
static usb2_callback_t udbp_bulk_read_callback;
|
||||
static usb2_callback_t udbp_bulk_read_clear_stall_callback;
|
||||
static usb2_callback_t udbp_bulk_write_callback;
|
||||
static usb2_callback_t udbp_bulk_write_clear_stall_callback;
|
||||
static usb_callback_t udbp_bulk_read_callback;
|
||||
static usb_callback_t udbp_bulk_read_clear_stall_callback;
|
||||
static usb_callback_t udbp_bulk_write_callback;
|
||||
static usb_callback_t udbp_bulk_write_clear_stall_callback;
|
||||
|
||||
static void udbp_bulk_read_complete(node_p, hook_p, void *, int);
|
||||
|
||||
|
@ -72,8 +72,8 @@ static device_probe_t ufm_probe;
|
||||
static device_attach_t ufm_attach;
|
||||
static device_detach_t ufm_detach;
|
||||
|
||||
static usb2_fifo_ioctl_t ufm_ioctl;
|
||||
static usb2_fifo_open_t ufm_open;
|
||||
static usb_fifo_ioctl_t ufm_ioctl;
|
||||
static usb_fifo_open_t ufm_open;
|
||||
|
||||
static struct usb_fifo_methods ufm_fifo_methods = {
|
||||
.f_ioctl = &ufm_ioctl,
|
||||
|
@ -177,17 +177,17 @@ static miibus_readreg_t aue_miibus_readreg;
|
||||
static miibus_writereg_t aue_miibus_writereg;
|
||||
static miibus_statchg_t aue_miibus_statchg;
|
||||
|
||||
static usb2_callback_t aue_intr_callback;
|
||||
static usb2_callback_t aue_bulk_read_callback;
|
||||
static usb2_callback_t aue_bulk_write_callback;
|
||||
static usb_callback_t aue_intr_callback;
|
||||
static usb_callback_t aue_bulk_read_callback;
|
||||
static usb_callback_t aue_bulk_write_callback;
|
||||
|
||||
static usb2_ether_fn_t aue_attach_post;
|
||||
static usb2_ether_fn_t aue_init;
|
||||
static usb2_ether_fn_t aue_stop;
|
||||
static usb2_ether_fn_t aue_start;
|
||||
static usb2_ether_fn_t aue_tick;
|
||||
static usb2_ether_fn_t aue_setmulti;
|
||||
static usb2_ether_fn_t aue_setpromisc;
|
||||
static uether_fn_t aue_attach_post;
|
||||
static uether_fn_t aue_init;
|
||||
static uether_fn_t aue_stop;
|
||||
static uether_fn_t aue_start;
|
||||
static uether_fn_t aue_tick;
|
||||
static uether_fn_t aue_setmulti;
|
||||
static uether_fn_t aue_setpromisc;
|
||||
|
||||
static uint8_t aue_csr_read_1(struct aue_softc *, uint16_t);
|
||||
static uint16_t aue_csr_read_2(struct aue_softc *, uint16_t);
|
||||
@ -288,7 +288,7 @@ static uint8_t
|
||||
aue_csr_read_1(struct aue_softc *sc, uint16_t reg)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint8_t val;
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
@ -307,7 +307,7 @@ static uint16_t
|
||||
aue_csr_read_2(struct aue_softc *sc, uint16_t reg)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint16_t val;
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
|
@ -152,21 +152,21 @@ static device_probe_t axe_probe;
|
||||
static device_attach_t axe_attach;
|
||||
static device_detach_t axe_detach;
|
||||
|
||||
static usb2_callback_t axe_intr_callback;
|
||||
static usb2_callback_t axe_bulk_read_callback;
|
||||
static usb2_callback_t axe_bulk_write_callback;
|
||||
static usb_callback_t axe_intr_callback;
|
||||
static usb_callback_t axe_bulk_read_callback;
|
||||
static usb_callback_t axe_bulk_write_callback;
|
||||
|
||||
static miibus_readreg_t axe_miibus_readreg;
|
||||
static miibus_writereg_t axe_miibus_writereg;
|
||||
static miibus_statchg_t axe_miibus_statchg;
|
||||
|
||||
static usb2_ether_fn_t axe_attach_post;
|
||||
static usb2_ether_fn_t axe_init;
|
||||
static usb2_ether_fn_t axe_stop;
|
||||
static usb2_ether_fn_t axe_start;
|
||||
static usb2_ether_fn_t axe_tick;
|
||||
static usb2_ether_fn_t axe_setmulti;
|
||||
static usb2_ether_fn_t axe_setpromisc;
|
||||
static uether_fn_t axe_attach_post;
|
||||
static uether_fn_t axe_init;
|
||||
static uether_fn_t axe_stop;
|
||||
static uether_fn_t axe_start;
|
||||
static uether_fn_t axe_tick;
|
||||
static uether_fn_t axe_setmulti;
|
||||
static uether_fn_t axe_setpromisc;
|
||||
|
||||
static int axe_ifmedia_upd(struct ifnet *);
|
||||
static void axe_ifmedia_sts(struct ifnet *, struct ifmediareq *);
|
||||
@ -259,7 +259,7 @@ static int
|
||||
axe_cmd(struct axe_softc *sc, int cmd, int index, int val, void *buf)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
AXE_LOCK_ASSERT(sc, MA_OWNED);
|
||||
|
||||
@ -600,7 +600,7 @@ static void
|
||||
axe_reset(struct axe_softc *sc)
|
||||
{
|
||||
struct usb_config_descriptor *cd;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
cd = usb2_get_config_descriptor(sc->sc_ue.ue_udev);
|
||||
|
||||
|
@ -71,17 +71,17 @@ static device_suspend_t cdce_suspend;
|
||||
static device_resume_t cdce_resume;
|
||||
static usb_handle_request_t cdce_handle_request;
|
||||
|
||||
static usb2_callback_t cdce_bulk_write_callback;
|
||||
static usb2_callback_t cdce_bulk_read_callback;
|
||||
static usb2_callback_t cdce_intr_read_callback;
|
||||
static usb2_callback_t cdce_intr_write_callback;
|
||||
static usb_callback_t cdce_bulk_write_callback;
|
||||
static usb_callback_t cdce_bulk_read_callback;
|
||||
static usb_callback_t cdce_intr_read_callback;
|
||||
static usb_callback_t cdce_intr_write_callback;
|
||||
|
||||
static usb2_ether_fn_t cdce_attach_post;
|
||||
static usb2_ether_fn_t cdce_init;
|
||||
static usb2_ether_fn_t cdce_stop;
|
||||
static usb2_ether_fn_t cdce_start;
|
||||
static usb2_ether_fn_t cdce_setmulti;
|
||||
static usb2_ether_fn_t cdce_setpromisc;
|
||||
static uether_fn_t cdce_attach_post;
|
||||
static uether_fn_t cdce_init;
|
||||
static uether_fn_t cdce_stop;
|
||||
static uether_fn_t cdce_start;
|
||||
static uether_fn_t cdce_setmulti;
|
||||
static uether_fn_t cdce_setpromisc;
|
||||
|
||||
static uint32_t cdce_m_crc32(struct mbuf *, uint32_t, uint32_t);
|
||||
|
||||
|
@ -87,16 +87,16 @@ static device_probe_t cue_probe;
|
||||
static device_attach_t cue_attach;
|
||||
static device_detach_t cue_detach;
|
||||
|
||||
static usb2_callback_t cue_bulk_read_callback;
|
||||
static usb2_callback_t cue_bulk_write_callback;
|
||||
static usb_callback_t cue_bulk_read_callback;
|
||||
static usb_callback_t cue_bulk_write_callback;
|
||||
|
||||
static usb2_ether_fn_t cue_attach_post;
|
||||
static usb2_ether_fn_t cue_init;
|
||||
static usb2_ether_fn_t cue_stop;
|
||||
static usb2_ether_fn_t cue_start;
|
||||
static usb2_ether_fn_t cue_tick;
|
||||
static usb2_ether_fn_t cue_setmulti;
|
||||
static usb2_ether_fn_t cue_setpromisc;
|
||||
static uether_fn_t cue_attach_post;
|
||||
static uether_fn_t cue_init;
|
||||
static uether_fn_t cue_stop;
|
||||
static uether_fn_t cue_start;
|
||||
static uether_fn_t cue_tick;
|
||||
static uether_fn_t cue_setmulti;
|
||||
static uether_fn_t cue_setpromisc;
|
||||
|
||||
static uint8_t cue_csr_read_1(struct cue_softc *, uint16_t);
|
||||
static uint16_t cue_csr_read_2(struct cue_softc *, uint8_t);
|
||||
|
@ -130,15 +130,15 @@ static device_probe_t kue_probe;
|
||||
static device_attach_t kue_attach;
|
||||
static device_detach_t kue_detach;
|
||||
|
||||
static usb2_callback_t kue_bulk_read_callback;
|
||||
static usb2_callback_t kue_bulk_write_callback;
|
||||
static usb_callback_t kue_bulk_read_callback;
|
||||
static usb_callback_t kue_bulk_write_callback;
|
||||
|
||||
static usb2_ether_fn_t kue_attach_post;
|
||||
static usb2_ether_fn_t kue_init;
|
||||
static usb2_ether_fn_t kue_stop;
|
||||
static usb2_ether_fn_t kue_start;
|
||||
static usb2_ether_fn_t kue_setmulti;
|
||||
static usb2_ether_fn_t kue_setpromisc;
|
||||
static uether_fn_t kue_attach_post;
|
||||
static uether_fn_t kue_init;
|
||||
static uether_fn_t kue_stop;
|
||||
static uether_fn_t kue_start;
|
||||
static uether_fn_t kue_setmulti;
|
||||
static uether_fn_t kue_setpromisc;
|
||||
|
||||
static int kue_do_request(struct kue_softc *,
|
||||
struct usb_device_request *, void *);
|
||||
@ -221,7 +221,7 @@ static int
|
||||
kue_do_request(struct kue_softc *sc, struct usb_device_request *req,
|
||||
void *data)
|
||||
{
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
err = usb2_ether_do_request(&sc->sc_ue, req, data, 60000);
|
||||
|
||||
@ -267,7 +267,7 @@ kue_load_fw(struct kue_softc *sc)
|
||||
{
|
||||
struct usb_device_descriptor *dd;
|
||||
uint16_t hwrev;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
dd = usb2_get_device_descriptor(sc->sc_ue.ue_udev);
|
||||
hwrev = UGETW(dd->bcdDevice);
|
||||
@ -391,7 +391,7 @@ static void
|
||||
kue_reset(struct kue_softc *sc)
|
||||
{
|
||||
struct usb_config_descriptor *cd;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
cd = usb2_get_config_descriptor(sc->sc_ue.ue_udev);
|
||||
|
||||
|
@ -110,17 +110,17 @@ static miibus_readreg_t rue_miibus_readreg;
|
||||
static miibus_writereg_t rue_miibus_writereg;
|
||||
static miibus_statchg_t rue_miibus_statchg;
|
||||
|
||||
static usb2_callback_t rue_intr_callback;
|
||||
static usb2_callback_t rue_bulk_read_callback;
|
||||
static usb2_callback_t rue_bulk_write_callback;
|
||||
static usb_callback_t rue_intr_callback;
|
||||
static usb_callback_t rue_bulk_read_callback;
|
||||
static usb_callback_t rue_bulk_write_callback;
|
||||
|
||||
static usb2_ether_fn_t rue_attach_post;
|
||||
static usb2_ether_fn_t rue_init;
|
||||
static usb2_ether_fn_t rue_stop;
|
||||
static usb2_ether_fn_t rue_start;
|
||||
static usb2_ether_fn_t rue_tick;
|
||||
static usb2_ether_fn_t rue_setmulti;
|
||||
static usb2_ether_fn_t rue_setpromisc;
|
||||
static uether_fn_t rue_attach_post;
|
||||
static uether_fn_t rue_init;
|
||||
static uether_fn_t rue_stop;
|
||||
static uether_fn_t rue_start;
|
||||
static uether_fn_t rue_tick;
|
||||
static uether_fn_t rue_setmulti;
|
||||
static uether_fn_t rue_setpromisc;
|
||||
|
||||
static int rue_read_mem(struct rue_softc *, uint16_t, void *, int);
|
||||
static int rue_write_mem(struct rue_softc *, uint16_t, void *, int);
|
||||
|
@ -70,17 +70,17 @@ static device_probe_t udav_probe;
|
||||
static device_attach_t udav_attach;
|
||||
static device_detach_t udav_detach;
|
||||
|
||||
static usb2_callback_t udav_bulk_write_callback;
|
||||
static usb2_callback_t udav_bulk_read_callback;
|
||||
static usb2_callback_t udav_intr_callback;
|
||||
static usb_callback_t udav_bulk_write_callback;
|
||||
static usb_callback_t udav_bulk_read_callback;
|
||||
static usb_callback_t udav_intr_callback;
|
||||
|
||||
static usb2_ether_fn_t udav_attach_post;
|
||||
static usb2_ether_fn_t udav_init;
|
||||
static usb2_ether_fn_t udav_stop;
|
||||
static usb2_ether_fn_t udav_start;
|
||||
static usb2_ether_fn_t udav_tick;
|
||||
static usb2_ether_fn_t udav_setmulti;
|
||||
static usb2_ether_fn_t udav_setpromisc;
|
||||
static uether_fn_t udav_attach_post;
|
||||
static uether_fn_t udav_init;
|
||||
static uether_fn_t udav_stop;
|
||||
static uether_fn_t udav_start;
|
||||
static uether_fn_t udav_tick;
|
||||
static uether_fn_t udav_setmulti;
|
||||
static uether_fn_t udav_setpromisc;
|
||||
|
||||
static int udav_csr_read(struct udav_softc *, uint16_t, void *, int);
|
||||
static int udav_csr_write(struct udav_softc *, uint16_t, void *, int);
|
||||
|
@ -48,13 +48,13 @@ MODULE_DEPEND(uether, miibus, 1, 1, 1);
|
||||
|
||||
static struct unrhdr *ueunit;
|
||||
|
||||
static usb2_proc_callback_t ue_attach_post_task;
|
||||
static usb2_proc_callback_t ue_promisc_task;
|
||||
static usb2_proc_callback_t ue_setmulti_task;
|
||||
static usb2_proc_callback_t ue_ifmedia_task;
|
||||
static usb2_proc_callback_t ue_tick_task;
|
||||
static usb2_proc_callback_t ue_start_task;
|
||||
static usb2_proc_callback_t ue_stop_task;
|
||||
static usb_proc_callback_t ue_attach_post_task;
|
||||
static usb_proc_callback_t ue_promisc_task;
|
||||
static usb_proc_callback_t ue_setmulti_task;
|
||||
static usb_proc_callback_t ue_ifmedia_task;
|
||||
static usb_proc_callback_t ue_tick_task;
|
||||
static usb_proc_callback_t ue_start_task;
|
||||
static usb_proc_callback_t ue_stop_task;
|
||||
|
||||
static void ue_init(void *);
|
||||
static void ue_start(struct ifnet *);
|
||||
@ -79,7 +79,7 @@ usb2_ether_pause(struct usb_ether *ue, unsigned int _ticks)
|
||||
|
||||
static void
|
||||
ue_queue_command(struct usb_ether *ue,
|
||||
usb2_proc_callback_t *fn,
|
||||
usb_proc_callback_t *fn,
|
||||
struct usb_proc_msg *t0, struct usb_proc_msg *t1)
|
||||
{
|
||||
struct usb_ether_cfg_task *task;
|
||||
|
@ -52,16 +52,16 @@
|
||||
struct usb_ether;
|
||||
struct usb_device_request;
|
||||
|
||||
typedef void (usb2_ether_fn_t)(struct usb_ether *);
|
||||
typedef void (uether_fn_t)(struct usb_ether *);
|
||||
|
||||
struct usb_ether_methods {
|
||||
usb2_ether_fn_t *ue_attach_post;
|
||||
usb2_ether_fn_t *ue_start;
|
||||
usb2_ether_fn_t *ue_init;
|
||||
usb2_ether_fn_t *ue_stop;
|
||||
usb2_ether_fn_t *ue_setmulti;
|
||||
usb2_ether_fn_t *ue_setpromisc;
|
||||
usb2_ether_fn_t *ue_tick;
|
||||
uether_fn_t *ue_attach_post;
|
||||
uether_fn_t *ue_start;
|
||||
uether_fn_t *ue_init;
|
||||
uether_fn_t *ue_stop;
|
||||
uether_fn_t *ue_setmulti;
|
||||
uether_fn_t *ue_setpromisc;
|
||||
uether_fn_t *ue_tick;
|
||||
int (*ue_mii_upd)(struct ifnet *);
|
||||
void (*ue_mii_sts)(struct ifnet *,
|
||||
struct ifmediareq *);
|
||||
|
@ -99,8 +99,8 @@ static device_probe_t u3g_probe;
|
||||
static device_attach_t u3g_attach;
|
||||
static device_detach_t u3g_detach;
|
||||
|
||||
static usb2_callback_t u3g_write_callback;
|
||||
static usb2_callback_t u3g_read_callback;
|
||||
static usb_callback_t u3g_write_callback;
|
||||
static usb_callback_t u3g_read_callback;
|
||||
|
||||
static void u3g_start_read(struct ucom_softc *ucom);
|
||||
static void u3g_stop_read(struct ucom_softc *ucom);
|
||||
@ -299,7 +299,7 @@ u3g_sael_m460_init(struct usb_device *udev)
|
||||
};
|
||||
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint16_t len;
|
||||
uint8_t buf[0x300];
|
||||
uint8_t n;
|
||||
@ -358,7 +358,7 @@ u3g_lookup_huawei(struct usb_attach_arg *uaa)
|
||||
* interface. After some command or some delay they change appearance
|
||||
* to a modem.
|
||||
*/
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
u3g_test_huawei_autoinst(struct usb_device *udev,
|
||||
struct usb_attach_arg *uaa)
|
||||
{
|
||||
|
@ -85,8 +85,8 @@ static device_probe_t uark_probe;
|
||||
static device_attach_t uark_attach;
|
||||
static device_detach_t uark_detach;
|
||||
|
||||
static usb2_callback_t uark_bulk_write_callback;
|
||||
static usb2_callback_t uark_bulk_read_callback;
|
||||
static usb_callback_t uark_bulk_write_callback;
|
||||
static usb_callback_t uark_bulk_read_callback;
|
||||
|
||||
static void uark_start_read(struct ucom_softc *);
|
||||
static void uark_stop_read(struct ucom_softc *);
|
||||
@ -394,7 +394,7 @@ static void
|
||||
uark_cfg_write(struct uark_softc *sc, uint16_t index, uint16_t value)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
req.bmRequestType = UARK_WRITE;
|
||||
req.bRequest = UARK_REQUEST;
|
||||
|
@ -165,9 +165,9 @@ static device_probe_t ubsa_probe;
|
||||
static device_attach_t ubsa_attach;
|
||||
static device_detach_t ubsa_detach;
|
||||
|
||||
static usb2_callback_t ubsa_write_callback;
|
||||
static usb2_callback_t ubsa_read_callback;
|
||||
static usb2_callback_t ubsa_intr_callback;
|
||||
static usb_callback_t ubsa_write_callback;
|
||||
static usb_callback_t ubsa_read_callback;
|
||||
static usb_callback_t ubsa_intr_callback;
|
||||
|
||||
static void ubsa_cfg_request(struct ubsa_softc *, uint8_t, uint16_t);
|
||||
static void ubsa_cfg_set_dtr(struct ucom_softc *, uint8_t);
|
||||
@ -340,7 +340,7 @@ static void
|
||||
ubsa_cfg_request(struct ubsa_softc *sc, uint8_t index, uint16_t value)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
req.bRequest = index;
|
||||
|
@ -138,8 +138,8 @@ static device_probe_t ubser_probe;
|
||||
static device_attach_t ubser_attach;
|
||||
static device_detach_t ubser_detach;
|
||||
|
||||
static usb2_callback_t ubser_write_callback;
|
||||
static usb2_callback_t ubser_read_callback;
|
||||
static usb_callback_t ubser_write_callback;
|
||||
static usb_callback_t ubser_read_callback;
|
||||
|
||||
static int ubser_pre_param(struct ucom_softc *, struct termios *);
|
||||
static void ubser_cfg_set_break(struct ucom_softc *, uint8_t);
|
||||
@ -455,7 +455,7 @@ ubser_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
|
||||
struct ubser_softc *sc = ucom->sc_parent;
|
||||
uint8_t x = ucom->sc_portno;
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
if (onoff) {
|
||||
|
||||
|
@ -223,9 +223,9 @@ static device_probe_t uchcom_probe;
|
||||
static device_attach_t uchcom_attach;
|
||||
static device_detach_t uchcom_detach;
|
||||
|
||||
static usb2_callback_t uchcom_intr_callback;
|
||||
static usb2_callback_t uchcom_write_callback;
|
||||
static usb2_callback_t uchcom_read_callback;
|
||||
static usb_callback_t uchcom_intr_callback;
|
||||
static usb_callback_t uchcom_write_callback;
|
||||
static usb_callback_t uchcom_read_callback;
|
||||
|
||||
static const struct usb_config uchcom_config_data[UCHCOM_N_TRANSFER] = {
|
||||
|
||||
|
@ -102,8 +102,8 @@ static device_probe_t ucycom_probe;
|
||||
static device_attach_t ucycom_attach;
|
||||
static device_detach_t ucycom_detach;
|
||||
|
||||
static usb2_callback_t ucycom_ctrl_write_callback;
|
||||
static usb2_callback_t ucycom_intr_read_callback;
|
||||
static usb_callback_t ucycom_ctrl_write_callback;
|
||||
static usb_callback_t ucycom_intr_read_callback;
|
||||
|
||||
static void ucycom_cfg_open(struct ucom_softc *);
|
||||
static void ucycom_start_read(struct ucom_softc *);
|
||||
@ -401,7 +401,7 @@ ucycom_cfg_write(struct ucycom_softc *sc, uint32_t baud, uint8_t cfg)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
uint16_t len;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
len = sc->sc_flen;
|
||||
if (len > sizeof(sc->sc_temp_cfg)) {
|
||||
|
@ -193,11 +193,11 @@ static device_probe_t ufoma_probe;
|
||||
static device_attach_t ufoma_attach;
|
||||
static device_detach_t ufoma_detach;
|
||||
|
||||
static usb2_callback_t ufoma_ctrl_read_callback;
|
||||
static usb2_callback_t ufoma_ctrl_write_callback;
|
||||
static usb2_callback_t ufoma_intr_callback;
|
||||
static usb2_callback_t ufoma_bulk_write_callback;
|
||||
static usb2_callback_t ufoma_bulk_read_callback;
|
||||
static usb_callback_t ufoma_ctrl_read_callback;
|
||||
static usb_callback_t ufoma_ctrl_write_callback;
|
||||
static usb_callback_t ufoma_intr_callback;
|
||||
static usb_callback_t ufoma_bulk_write_callback;
|
||||
static usb_callback_t ufoma_bulk_read_callback;
|
||||
|
||||
static void *ufoma_get_intconf(struct usb_config_descriptor *,
|
||||
struct usb_interface_descriptor *, uint8_t, uint8_t);
|
||||
|
@ -125,8 +125,8 @@ static device_probe_t uftdi_probe;
|
||||
static device_attach_t uftdi_attach;
|
||||
static device_detach_t uftdi_detach;
|
||||
|
||||
static usb2_callback_t uftdi_write_callback;
|
||||
static usb2_callback_t uftdi_read_callback;
|
||||
static usb_callback_t uftdi_write_callback;
|
||||
static usb_callback_t uftdi_read_callback;
|
||||
|
||||
static void uftdi_cfg_open(struct ucom_softc *);
|
||||
static void uftdi_cfg_set_dtr(struct ucom_softc *, uint8_t);
|
||||
|
@ -91,8 +91,8 @@ static device_probe_t ugensa_probe;
|
||||
static device_attach_t ugensa_attach;
|
||||
static device_detach_t ugensa_detach;
|
||||
|
||||
static usb2_callback_t ugensa_bulk_write_callback;
|
||||
static usb2_callback_t ugensa_bulk_read_callback;
|
||||
static usb_callback_t ugensa_bulk_write_callback;
|
||||
static usb_callback_t ugensa_bulk_read_callback;
|
||||
|
||||
static void ugensa_start_read(struct ucom_softc *);
|
||||
static void ugensa_stop_read(struct ucom_softc *);
|
||||
|
@ -98,8 +98,8 @@ static device_probe_t uipaq_probe;
|
||||
static device_attach_t uipaq_attach;
|
||||
static device_detach_t uipaq_detach;
|
||||
|
||||
static usb2_callback_t uipaq_write_callback;
|
||||
static usb2_callback_t uipaq_read_callback;
|
||||
static usb_callback_t uipaq_write_callback;
|
||||
static usb_callback_t uipaq_read_callback;
|
||||
|
||||
static void uipaq_start_read(struct ucom_softc *);
|
||||
static void uipaq_stop_read(struct ucom_softc *);
|
||||
|
@ -118,21 +118,21 @@ static device_probe_t ulpt_probe;
|
||||
static device_attach_t ulpt_attach;
|
||||
static device_detach_t ulpt_detach;
|
||||
|
||||
static usb2_callback_t ulpt_write_callback;
|
||||
static usb2_callback_t ulpt_read_callback;
|
||||
static usb2_callback_t ulpt_status_callback;
|
||||
static usb_callback_t ulpt_write_callback;
|
||||
static usb_callback_t ulpt_read_callback;
|
||||
static usb_callback_t ulpt_status_callback;
|
||||
|
||||
static void ulpt_reset(struct ulpt_softc *);
|
||||
static void ulpt_watchdog(void *);
|
||||
|
||||
static usb2_fifo_close_t ulpt_close;
|
||||
static usb2_fifo_cmd_t ulpt_start_read;
|
||||
static usb2_fifo_cmd_t ulpt_start_write;
|
||||
static usb2_fifo_cmd_t ulpt_stop_read;
|
||||
static usb2_fifo_cmd_t ulpt_stop_write;
|
||||
static usb2_fifo_ioctl_t ulpt_ioctl;
|
||||
static usb2_fifo_open_t ulpt_open;
|
||||
static usb2_fifo_open_t unlpt_open;
|
||||
static usb_fifo_close_t ulpt_close;
|
||||
static usb_fifo_cmd_t ulpt_start_read;
|
||||
static usb_fifo_cmd_t ulpt_start_write;
|
||||
static usb_fifo_cmd_t ulpt_stop_read;
|
||||
static usb_fifo_cmd_t ulpt_stop_write;
|
||||
static usb_fifo_ioctl_t ulpt_ioctl;
|
||||
static usb_fifo_open_t ulpt_open;
|
||||
static usb_fifo_open_t unlpt_open;
|
||||
|
||||
static struct usb_fifo_methods ulpt_fifo_methods = {
|
||||
.f_close = &ulpt_close,
|
||||
|
@ -112,9 +112,9 @@ static device_probe_t umct_probe;
|
||||
static device_attach_t umct_attach;
|
||||
static device_detach_t umct_detach;
|
||||
|
||||
static usb2_callback_t umct_intr_callback;
|
||||
static usb2_callback_t umct_write_callback;
|
||||
static usb2_callback_t umct_read_callback;
|
||||
static usb_callback_t umct_intr_callback;
|
||||
static usb_callback_t umct_write_callback;
|
||||
static usb_callback_t umct_read_callback;
|
||||
|
||||
static void umct_cfg_do_request(struct umct_softc *sc, uint8_t request,
|
||||
uint16_t len, uint32_t value);
|
||||
@ -303,7 +303,7 @@ umct_cfg_do_request(struct umct_softc *sc, uint8_t request,
|
||||
uint16_t len, uint32_t value)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint8_t temp[4];
|
||||
|
||||
if (len > 4)
|
||||
|
@ -160,9 +160,9 @@ static device_probe_t umodem_probe;
|
||||
static device_attach_t umodem_attach;
|
||||
static device_detach_t umodem_detach;
|
||||
|
||||
static usb2_callback_t umodem_intr_callback;
|
||||
static usb2_callback_t umodem_write_callback;
|
||||
static usb2_callback_t umodem_read_callback;
|
||||
static usb_callback_t umodem_intr_callback;
|
||||
static usb_callback_t umodem_write_callback;
|
||||
static usb_callback_t umodem_read_callback;
|
||||
|
||||
static void umodem_start_read(struct ucom_softc *);
|
||||
static void umodem_stop_read(struct ucom_softc *);
|
||||
@ -179,7 +179,7 @@ static void umodem_cfg_set_dtr(struct ucom_softc *, uint8_t);
|
||||
static void umodem_cfg_set_rts(struct ucom_softc *, uint8_t);
|
||||
static void umodem_cfg_set_break(struct ucom_softc *, uint8_t);
|
||||
static void *umodem_get_desc(struct usb_attach_arg *, uint8_t, uint8_t);
|
||||
static usb2_error_t umodem_set_comm_feature(struct usb_device *, uint8_t,
|
||||
static usb_error_t umodem_set_comm_feature(struct usb_device *, uint8_t,
|
||||
uint16_t, uint16_t);
|
||||
|
||||
static const struct usb_config umodem_config[UMODEM_N_TRANSFER] = {
|
||||
@ -750,7 +750,7 @@ umodem_get_desc(struct usb_attach_arg *uaa, uint8_t type, uint8_t subtype)
|
||||
type, 0 - 1, subtype, 0 - 1));
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
umodem_set_comm_feature(struct usb_device *udev, uint8_t iface_no,
|
||||
uint16_t feature, uint16_t state)
|
||||
{
|
||||
|
@ -178,9 +178,9 @@ static device_probe_t umoscom_probe;
|
||||
static device_attach_t umoscom_attach;
|
||||
static device_detach_t umoscom_detach;
|
||||
|
||||
static usb2_callback_t umoscom_write_callback;
|
||||
static usb2_callback_t umoscom_read_callback;
|
||||
static usb2_callback_t umoscom_intr_callback;
|
||||
static usb_callback_t umoscom_write_callback;
|
||||
static usb_callback_t umoscom_read_callback;
|
||||
static usb_callback_t umoscom_intr_callback;
|
||||
|
||||
static void umoscom_cfg_open(struct ucom_softc *);
|
||||
static void umoscom_cfg_close(struct ucom_softc *);
|
||||
|
@ -159,7 +159,7 @@ struct uplcom_softc {
|
||||
|
||||
/* prototypes */
|
||||
|
||||
static usb2_error_t uplcom_reset(struct uplcom_softc *, struct usb_device *);
|
||||
static usb_error_t uplcom_reset(struct uplcom_softc *, struct usb_device *);
|
||||
static int uplcom_pl2303x_init(struct usb_device *);
|
||||
static void uplcom_cfg_set_dtr(struct ucom_softc *, uint8_t);
|
||||
static void uplcom_cfg_set_rts(struct ucom_softc *, uint8_t);
|
||||
@ -177,9 +177,9 @@ static device_probe_t uplcom_probe;
|
||||
static device_attach_t uplcom_attach;
|
||||
static device_detach_t uplcom_detach;
|
||||
|
||||
static usb2_callback_t uplcom_intr_callback;
|
||||
static usb2_callback_t uplcom_write_callback;
|
||||
static usb2_callback_t uplcom_read_callback;
|
||||
static usb_callback_t uplcom_intr_callback;
|
||||
static usb_callback_t uplcom_write_callback;
|
||||
static usb_callback_t uplcom_read_callback;
|
||||
|
||||
static const struct usb_config uplcom_config_data[UPLCOM_N_TRANSFER] = {
|
||||
|
||||
@ -429,7 +429,7 @@ uplcom_detach(device_t dev)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
uplcom_reset(struct uplcom_softc *sc, struct usb_device *udev)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
@ -474,7 +474,7 @@ static int
|
||||
uplcom_pl2303x_init(struct usb_device *udev)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint8_t buf[4];
|
||||
uint8_t i;
|
||||
|
||||
|
@ -92,19 +92,19 @@ SYSCTL_INT(_hw_usb_ucom, OID_AUTO, debug, CTLFLAG_RW,
|
||||
&usb2_com_debug, 0, "ucom debug level");
|
||||
#endif
|
||||
|
||||
static usb2_proc_callback_t usb2_com_cfg_start_transfers;
|
||||
static usb2_proc_callback_t usb2_com_cfg_open;
|
||||
static usb2_proc_callback_t usb2_com_cfg_close;
|
||||
static usb2_proc_callback_t usb2_com_cfg_line_state;
|
||||
static usb2_proc_callback_t usb2_com_cfg_status_change;
|
||||
static usb2_proc_callback_t usb2_com_cfg_param;
|
||||
static usb_proc_callback_t usb2_com_cfg_start_transfers;
|
||||
static usb_proc_callback_t usb2_com_cfg_open;
|
||||
static usb_proc_callback_t usb2_com_cfg_close;
|
||||
static usb_proc_callback_t usb2_com_cfg_line_state;
|
||||
static usb_proc_callback_t usb2_com_cfg_status_change;
|
||||
static usb_proc_callback_t usb2_com_cfg_param;
|
||||
|
||||
static uint8_t usb2_com_units_alloc(uint32_t, uint32_t *);
|
||||
static void usb2_com_units_free(uint32_t, uint32_t);
|
||||
static int usb2_com_attach_tty(struct ucom_softc *, uint32_t);
|
||||
static void usb2_com_detach_tty(struct ucom_softc *);
|
||||
static void usb2_com_queue_command(struct ucom_softc *,
|
||||
usb2_proc_callback_t *, struct termios *pt,
|
||||
usb_proc_callback_t *, struct termios *pt,
|
||||
struct usb_proc_msg *t0, struct usb_proc_msg *t1);
|
||||
static void usb2_com_shutdown(struct ucom_softc *);
|
||||
static void usb2_com_break(struct ucom_softc *, uint8_t);
|
||||
@ -375,7 +375,7 @@ usb2_com_detach_tty(struct ucom_softc *sc)
|
||||
|
||||
static void
|
||||
usb2_com_queue_command(struct ucom_softc *sc,
|
||||
usb2_proc_callback_t *fn, struct termios *pt,
|
||||
usb_proc_callback_t *fn, struct termios *pt,
|
||||
struct usb_proc_msg *t0, struct usb_proc_msg *t1)
|
||||
{
|
||||
struct ucom_super_softc *ssc = sc->sc_super;
|
||||
|
@ -106,8 +106,8 @@ static device_probe_t uslcom_probe;
|
||||
static device_attach_t uslcom_attach;
|
||||
static device_detach_t uslcom_detach;
|
||||
|
||||
static usb2_callback_t uslcom_write_callback;
|
||||
static usb2_callback_t uslcom_read_callback;
|
||||
static usb_callback_t uslcom_write_callback;
|
||||
static usb_callback_t uslcom_read_callback;
|
||||
|
||||
static void uslcom_open(struct ucom_softc *);
|
||||
static void uslcom_close(struct ucom_softc *);
|
||||
|
@ -178,10 +178,10 @@ static device_probe_t uvisor_probe;
|
||||
static device_attach_t uvisor_attach;
|
||||
static device_detach_t uvisor_detach;
|
||||
|
||||
static usb2_callback_t uvisor_write_callback;
|
||||
static usb2_callback_t uvisor_read_callback;
|
||||
static usb_callback_t uvisor_write_callback;
|
||||
static usb_callback_t uvisor_read_callback;
|
||||
|
||||
static usb2_error_t uvisor_init(struct uvisor_softc *, struct usb_device *,
|
||||
static usb_error_t uvisor_init(struct uvisor_softc *, struct usb_device *,
|
||||
struct usb_config *);
|
||||
static void uvisor_cfg_open(struct ucom_softc *);
|
||||
static void uvisor_cfg_close(struct ucom_softc *);
|
||||
@ -355,10 +355,10 @@ uvisor_detach(device_t dev)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
uvisor_init(struct uvisor_softc *sc, struct usb_device *udev, struct usb_config *config)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
usb_error_t err = 0;
|
||||
struct usb_device_request req;
|
||||
struct uvisor_connection_info coninfo;
|
||||
struct uvisor_palm_connection_info pconinfo;
|
||||
@ -513,7 +513,7 @@ uvisor_cfg_close(struct ucom_softc *ucom)
|
||||
struct uvisor_softc *sc = ucom->sc_parent;
|
||||
uint8_t buffer[UVISOR_CONNECTION_INFO_SIZE];
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_ENDPOINT; /* XXX read? */
|
||||
req.bRequest = UVISOR_CLOSE_NOTIFICATION;
|
||||
|
@ -152,9 +152,9 @@ static device_probe_t uvscom_probe;
|
||||
static device_attach_t uvscom_attach;
|
||||
static device_detach_t uvscom_detach;
|
||||
|
||||
static usb2_callback_t uvscom_write_callback;
|
||||
static usb2_callback_t uvscom_read_callback;
|
||||
static usb2_callback_t uvscom_intr_callback;
|
||||
static usb_callback_t uvscom_write_callback;
|
||||
static usb_callback_t uvscom_read_callback;
|
||||
static usb_callback_t uvscom_intr_callback;
|
||||
|
||||
static void uvscom_cfg_set_dtr(struct ucom_softc *, uint8_t);
|
||||
static void uvscom_cfg_set_rts(struct ucom_softc *, uint8_t);
|
||||
@ -672,7 +672,7 @@ static void
|
||||
uvscom_cfg_write(struct uvscom_softc *sc, uint8_t index, uint16_t value)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
req.bRequest = index;
|
||||
@ -692,7 +692,7 @@ static uint16_t
|
||||
uvscom_cfg_read_status(struct uvscom_softc *sc)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint8_t data[2];
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
|
@ -1008,26 +1008,26 @@ static device_probe_t umass_probe;
|
||||
static device_attach_t umass_attach;
|
||||
static device_detach_t umass_detach;
|
||||
|
||||
static usb2_callback_t umass_tr_error;
|
||||
static usb2_callback_t umass_t_bbb_reset1_callback;
|
||||
static usb2_callback_t umass_t_bbb_reset2_callback;
|
||||
static usb2_callback_t umass_t_bbb_reset3_callback;
|
||||
static usb2_callback_t umass_t_bbb_command_callback;
|
||||
static usb2_callback_t umass_t_bbb_data_read_callback;
|
||||
static usb2_callback_t umass_t_bbb_data_rd_cs_callback;
|
||||
static usb2_callback_t umass_t_bbb_data_write_callback;
|
||||
static usb2_callback_t umass_t_bbb_data_wr_cs_callback;
|
||||
static usb2_callback_t umass_t_bbb_status_callback;
|
||||
static usb2_callback_t umass_t_cbi_reset1_callback;
|
||||
static usb2_callback_t umass_t_cbi_reset2_callback;
|
||||
static usb2_callback_t umass_t_cbi_reset3_callback;
|
||||
static usb2_callback_t umass_t_cbi_reset4_callback;
|
||||
static usb2_callback_t umass_t_cbi_command_callback;
|
||||
static usb2_callback_t umass_t_cbi_data_read_callback;
|
||||
static usb2_callback_t umass_t_cbi_data_rd_cs_callback;
|
||||
static usb2_callback_t umass_t_cbi_data_write_callback;
|
||||
static usb2_callback_t umass_t_cbi_data_wr_cs_callback;
|
||||
static usb2_callback_t umass_t_cbi_status_callback;
|
||||
static usb_callback_t umass_tr_error;
|
||||
static usb_callback_t umass_t_bbb_reset1_callback;
|
||||
static usb_callback_t umass_t_bbb_reset2_callback;
|
||||
static usb_callback_t umass_t_bbb_reset3_callback;
|
||||
static usb_callback_t umass_t_bbb_command_callback;
|
||||
static usb_callback_t umass_t_bbb_data_read_callback;
|
||||
static usb_callback_t umass_t_bbb_data_rd_cs_callback;
|
||||
static usb_callback_t umass_t_bbb_data_write_callback;
|
||||
static usb_callback_t umass_t_bbb_data_wr_cs_callback;
|
||||
static usb_callback_t umass_t_bbb_status_callback;
|
||||
static usb_callback_t umass_t_cbi_reset1_callback;
|
||||
static usb_callback_t umass_t_cbi_reset2_callback;
|
||||
static usb_callback_t umass_t_cbi_reset3_callback;
|
||||
static usb_callback_t umass_t_cbi_reset4_callback;
|
||||
static usb_callback_t umass_t_cbi_command_callback;
|
||||
static usb_callback_t umass_t_cbi_data_read_callback;
|
||||
static usb_callback_t umass_t_cbi_data_rd_cs_callback;
|
||||
static usb_callback_t umass_t_cbi_data_write_callback;
|
||||
static usb_callback_t umass_t_cbi_data_wr_cs_callback;
|
||||
static usb_callback_t umass_t_cbi_status_callback;
|
||||
|
||||
static void umass_cancel_ccb(struct umass_softc *);
|
||||
static void umass_init_shuttle(struct umass_softc *);
|
||||
@ -1636,7 +1636,7 @@ static void
|
||||
umass_init_shuttle(struct umass_softc *sc)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint8_t status[2] = {0, 0};
|
||||
|
||||
/*
|
||||
@ -2157,7 +2157,7 @@ static uint8_t
|
||||
umass_bbb_get_max_lun(struct umass_softc *sc)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint8_t buf = 0;
|
||||
|
||||
/* The Get Max Lun command is a class-specific request. */
|
||||
|
@ -101,18 +101,18 @@ static device_probe_t urio_probe;
|
||||
static device_attach_t urio_attach;
|
||||
static device_detach_t urio_detach;
|
||||
|
||||
static usb2_callback_t urio_write_callback;
|
||||
static usb2_callback_t urio_write_clear_stall_callback;
|
||||
static usb2_callback_t urio_read_callback;
|
||||
static usb2_callback_t urio_read_clear_stall_callback;
|
||||
static usb_callback_t urio_write_callback;
|
||||
static usb_callback_t urio_write_clear_stall_callback;
|
||||
static usb_callback_t urio_read_callback;
|
||||
static usb_callback_t urio_read_clear_stall_callback;
|
||||
|
||||
static usb2_fifo_close_t urio_close;
|
||||
static usb2_fifo_cmd_t urio_start_read;
|
||||
static usb2_fifo_cmd_t urio_start_write;
|
||||
static usb2_fifo_cmd_t urio_stop_read;
|
||||
static usb2_fifo_cmd_t urio_stop_write;
|
||||
static usb2_fifo_ioctl_t urio_ioctl;
|
||||
static usb2_fifo_open_t urio_open;
|
||||
static usb_fifo_close_t urio_close;
|
||||
static usb_fifo_cmd_t urio_start_read;
|
||||
static usb_fifo_cmd_t urio_start_write;
|
||||
static usb_fifo_cmd_t urio_stop_read;
|
||||
static usb_fifo_cmd_t urio_stop_write;
|
||||
static usb_fifo_ioctl_t urio_ioctl;
|
||||
static usb_fifo_open_t urio_open;
|
||||
|
||||
static struct usb_fifo_methods urio_fifo_methods = {
|
||||
.f_close = &urio_close,
|
||||
|
@ -204,11 +204,11 @@ static device_suspend_t ustorage_fs_suspend;
|
||||
static device_resume_t ustorage_fs_resume;
|
||||
static usb_handle_request_t ustorage_fs_handle_request;
|
||||
|
||||
static usb2_callback_t ustorage_fs_t_bbb_command_callback;
|
||||
static usb2_callback_t ustorage_fs_t_bbb_data_dump_callback;
|
||||
static usb2_callback_t ustorage_fs_t_bbb_data_read_callback;
|
||||
static usb2_callback_t ustorage_fs_t_bbb_data_write_callback;
|
||||
static usb2_callback_t ustorage_fs_t_bbb_status_callback;
|
||||
static usb_callback_t ustorage_fs_t_bbb_command_callback;
|
||||
static usb_callback_t ustorage_fs_t_bbb_data_dump_callback;
|
||||
static usb_callback_t ustorage_fs_t_bbb_data_read_callback;
|
||||
static usb_callback_t ustorage_fs_t_bbb_data_write_callback;
|
||||
static usb_callback_t ustorage_fs_t_bbb_status_callback;
|
||||
|
||||
static void ustorage_fs_transfer_start(struct ustorage_fs_softc *sc, uint8_t xfer_index);
|
||||
static void ustorage_fs_transfer_stop(struct ustorage_fs_softc *sc);
|
||||
|
@ -69,7 +69,7 @@ static uint8_t usb2_hw_ep_find_match(struct usb_hw_ep_scratch *,
|
||||
struct usb_hw_ep_scratch_sub *, uint8_t);
|
||||
static uint8_t usb2_hw_ep_get_needs(struct usb_hw_ep_scratch *, uint8_t,
|
||||
uint8_t);
|
||||
static usb2_error_t usb2_hw_ep_resolve(struct usb_device *,
|
||||
static usb_error_t usb2_hw_ep_resolve(struct usb_device *,
|
||||
struct usb_descriptor *);
|
||||
static const struct usb_temp_device_desc *usb2_temp_get_tdd(struct usb_device *);
|
||||
static void *usb2_temp_get_device_desc(struct usb_device *);
|
||||
@ -81,12 +81,12 @@ static const void *usb2_temp_get_string_desc(struct usb_device *, uint16_t,
|
||||
static const void *usb2_temp_get_vendor_desc(struct usb_device *,
|
||||
const struct usb_device_request *);
|
||||
static const void *usb2_temp_get_hub_desc(struct usb_device *);
|
||||
static usb2_error_t usb2_temp_get_desc(struct usb_device *,
|
||||
static usb_error_t usb2_temp_get_desc(struct usb_device *,
|
||||
struct usb_device_request *, const void **, uint16_t *);
|
||||
static usb2_error_t usb_temp_setup(struct usb_device *,
|
||||
static usb_error_t usb_temp_setup(struct usb_device *,
|
||||
const struct usb_temp_device_desc *);
|
||||
static void usb2_temp_unsetup(struct usb_device *);
|
||||
static usb2_error_t usb2_temp_setup_by_index(struct usb_device *,
|
||||
static usb_error_t usb2_temp_setup_by_index(struct usb_device *,
|
||||
uint16_t index);
|
||||
static void usb2_temp_init(void *);
|
||||
|
||||
@ -780,7 +780,7 @@ usb2_hw_ep_get_needs(struct usb_hw_ep_scratch *ues,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
usb2_hw_ep_resolve(struct usb_device *udev,
|
||||
struct usb_descriptor *desc)
|
||||
{
|
||||
@ -1072,7 +1072,7 @@ usb2_temp_get_hub_desc(struct usb_device *udev)
|
||||
* This function is a demultiplexer for local USB device side control
|
||||
* endpoint requests.
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
usb2_temp_get_desc(struct usb_device *udev, struct usb_device_request *req,
|
||||
const void **pPtr, uint16_t *pLength)
|
||||
{
|
||||
@ -1176,7 +1176,7 @@ usb2_temp_get_desc(struct usb_device *udev, struct usb_device_request *req,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
usb_temp_setup(struct usb_device *udev,
|
||||
const struct usb_temp_device_desc *tdd)
|
||||
{
|
||||
@ -1277,10 +1277,10 @@ usb2_temp_unsetup(struct usb_device *udev)
|
||||
}
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
usb2_temp_setup_by_index(struct usb_device *udev, uint16_t index)
|
||||
{
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
switch (index) {
|
||||
case 0:
|
||||
|
@ -86,8 +86,8 @@ struct usb_bus {
|
||||
struct usb_bus_methods *methods; /* filled by HC driver */
|
||||
struct usb_device **devices;
|
||||
|
||||
usb2_power_mask_t hw_power_state; /* see USB_HW_POWER_XXX */
|
||||
usb2_size_t uframe_usage[USB_HS_MICRO_FRAMES_MAX];
|
||||
usb_power_mask_t hw_power_state; /* see USB_HW_POWER_XXX */
|
||||
size_t uframe_usage[USB_HS_MICRO_FRAMES_MAX];
|
||||
|
||||
uint16_t isoc_time_last; /* in milliseconds */
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include <dev/usb/usb_bus.h>
|
||||
|
||||
#if USB_HAVE_BUSDMA
|
||||
static void usb2_dma_tag_create(struct usb_dma_tag *, usb2_size_t, usb2_size_t);
|
||||
static void usb2_dma_tag_create(struct usb_dma_tag *, size_t, size_t);
|
||||
static void usb2_dma_tag_destroy(struct usb_dma_tag *);
|
||||
static void usb2_dma_lock_cb(void *, bus_dma_lock_op_t);
|
||||
static void usb2_pc_alloc_mem_cb(void *, bus_dma_segment_t *, int, int);
|
||||
@ -58,7 +58,7 @@ static void usb2_pc_common_mem_cb(void *, bus_dma_segment_t *, int, int,
|
||||
* been properly initialized !
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_get_page(struct usb_page_cache *pc, usb2_frlength_t offset,
|
||||
usb2_get_page(struct usb_page_cache *pc, usb_frlength_t offset,
|
||||
struct usb_page_search *res)
|
||||
{
|
||||
struct usb_page *page;
|
||||
@ -114,8 +114,8 @@ usb2_get_page(struct usb_page_cache *pc, usb2_frlength_t offset,
|
||||
* usb2_copy_in - copy directly to DMA-able memory
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_copy_in(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
const void *ptr, usb2_frlength_t len)
|
||||
usb2_copy_in(struct usb_page_cache *cache, usb_frlength_t offset,
|
||||
const void *ptr, usb_frlength_t len)
|
||||
{
|
||||
struct usb_page_search buf_res;
|
||||
|
||||
@ -143,8 +143,8 @@ usb2_copy_in(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
*------------------------------------------------------------------------*/
|
||||
#if USB_HAVE_USER_IO
|
||||
int
|
||||
usb2_copy_in_user(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
const void *ptr, usb2_frlength_t len)
|
||||
usb2_copy_in_user(struct usb_page_cache *cache, usb_frlength_t offset,
|
||||
const void *ptr, usb_frlength_t len)
|
||||
{
|
||||
struct usb_page_search buf_res;
|
||||
int error;
|
||||
@ -174,7 +174,7 @@ usb2_copy_in_user(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
#if USB_HAVE_MBUF
|
||||
struct usb2_m_copy_in_arg {
|
||||
struct usb_page_cache *cache;
|
||||
usb2_frlength_t dst_offset;
|
||||
usb_frlength_t dst_offset;
|
||||
};
|
||||
|
||||
static int
|
||||
@ -188,8 +188,8 @@ usb2_m_copy_in_cb(void *arg, void *src, uint32_t count)
|
||||
}
|
||||
|
||||
void
|
||||
usb2_m_copy_in(struct usb_page_cache *cache, usb2_frlength_t dst_offset,
|
||||
struct mbuf *m, usb2_size_t src_offset, usb2_frlength_t src_len)
|
||||
usb2_m_copy_in(struct usb_page_cache *cache, usb_frlength_t dst_offset,
|
||||
struct mbuf *m, size_t src_offset, usb_frlength_t src_len)
|
||||
{
|
||||
struct usb2_m_copy_in_arg arg = {cache, dst_offset};
|
||||
int error;
|
||||
@ -204,7 +204,7 @@ usb2_m_copy_in(struct usb_page_cache *cache, usb2_frlength_t dst_offset,
|
||||
#if USB_HAVE_USER_IO
|
||||
int
|
||||
usb2_uiomove(struct usb_page_cache *pc, struct uio *uio,
|
||||
usb2_frlength_t pc_offset, usb2_frlength_t len)
|
||||
usb_frlength_t pc_offset, usb_frlength_t len)
|
||||
{
|
||||
struct usb_page_search res;
|
||||
int error = 0;
|
||||
@ -236,8 +236,8 @@ usb2_uiomove(struct usb_page_cache *pc, struct uio *uio,
|
||||
* usb2_copy_out - copy directly from DMA-able memory
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_copy_out(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
void *ptr, usb2_frlength_t len)
|
||||
usb2_copy_out(struct usb_page_cache *cache, usb_frlength_t offset,
|
||||
void *ptr, usb_frlength_t len)
|
||||
{
|
||||
struct usb_page_search res;
|
||||
|
||||
@ -265,8 +265,8 @@ usb2_copy_out(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
*------------------------------------------------------------------------*/
|
||||
#if USB_HAVE_USER_IO
|
||||
int
|
||||
usb2_copy_out_user(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
void *ptr, usb2_frlength_t len)
|
||||
usb2_copy_out_user(struct usb_page_cache *cache, usb_frlength_t offset,
|
||||
void *ptr, usb_frlength_t len)
|
||||
{
|
||||
struct usb_page_search res;
|
||||
int error;
|
||||
@ -294,8 +294,8 @@ usb2_copy_out_user(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
* usb2_bzero - zero DMA-able memory
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_bzero(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
usb2_frlength_t len)
|
||||
usb2_bzero(struct usb_page_cache *cache, usb_frlength_t offset,
|
||||
usb_frlength_t len)
|
||||
{
|
||||
struct usb_page_search res;
|
||||
|
||||
@ -332,7 +332,7 @@ usb2_dma_lock_cb(void *arg, bus_dma_lock_op_t op)
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_dma_tag_create(struct usb_dma_tag *udt,
|
||||
usb2_size_t size, usb2_size_t align)
|
||||
size_t size, size_t align)
|
||||
{
|
||||
bus_dma_tag_t tag;
|
||||
|
||||
@ -397,7 +397,7 @@ usb2_pc_common_mem_cb(void *arg, bus_dma_segment_t *segs,
|
||||
struct usb_dma_parent_tag *uptag;
|
||||
struct usb_page_cache *pc;
|
||||
struct usb_page *pg;
|
||||
usb2_size_t rem;
|
||||
size_t rem;
|
||||
uint8_t owned;
|
||||
|
||||
pc = arg;
|
||||
@ -460,7 +460,7 @@ usb2_pc_common_mem_cb(void *arg, bus_dma_segment_t *segs,
|
||||
*------------------------------------------------------------------------*/
|
||||
uint8_t
|
||||
usb2_pc_alloc_mem(struct usb_page_cache *pc, struct usb_page *pg,
|
||||
usb2_size_t size, usb2_size_t align)
|
||||
size_t size, size_t align)
|
||||
{
|
||||
struct usb_dma_parent_tag *uptag;
|
||||
struct usb_dma_tag *utag;
|
||||
@ -583,7 +583,7 @@ usb2_pc_free_mem(struct usb_page_cache *pc)
|
||||
* Else: Error
|
||||
*------------------------------------------------------------------------*/
|
||||
uint8_t
|
||||
usb2_pc_load_mem(struct usb_page_cache *pc, usb2_size_t size, uint8_t sync)
|
||||
usb2_pc_load_mem(struct usb_page_cache *pc, size_t size, uint8_t sync)
|
||||
{
|
||||
/* setup page cache */
|
||||
pc->page_offset_buf = 0;
|
||||
@ -684,7 +684,7 @@ usb2_pc_cpu_flush(struct usb_page_cache *pc)
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
uint8_t
|
||||
usb2_pc_dmamap_create(struct usb_page_cache *pc, usb2_size_t size)
|
||||
usb2_pc_dmamap_create(struct usb_page_cache *pc, size_t size)
|
||||
{
|
||||
struct usb_xfer_root *info;
|
||||
struct usb_dma_tag *utag;
|
||||
@ -733,7 +733,7 @@ usb2_pc_dmamap_destroy(struct usb_page_cache *pc)
|
||||
*------------------------------------------------------------------------*/
|
||||
struct usb_dma_tag *
|
||||
usb2_dma_tag_find(struct usb_dma_parent_tag *udpt,
|
||||
usb2_size_t size, usb2_size_t align)
|
||||
size_t size, size_t align)
|
||||
{
|
||||
struct usb_dma_tag *udt;
|
||||
uint8_t nudt;
|
||||
@ -769,7 +769,7 @@ usb2_dma_tag_find(struct usb_dma_parent_tag *udpt,
|
||||
void
|
||||
usb2_dma_tag_setup(struct usb_dma_parent_tag *udpt,
|
||||
struct usb_dma_tag *udt, bus_dma_tag_t dmat,
|
||||
struct mtx *mtx, usb2_dma_callback_t *func,
|
||||
struct mtx *mtx, usb_dma_callback_t *func,
|
||||
uint8_t ndmabits, uint8_t nudt)
|
||||
{
|
||||
bzero(udpt, sizeof(*udpt));
|
||||
@ -838,7 +838,7 @@ usb2_bdma_work_loop(struct usb_xfer_queue *pq)
|
||||
{
|
||||
struct usb_xfer_root *info;
|
||||
struct usb_xfer *xfer;
|
||||
usb2_frcount_t nframes;
|
||||
usb_frcount_t nframes;
|
||||
|
||||
xfer = pq->curr;
|
||||
info = xfer->xroot;
|
||||
@ -854,7 +854,7 @@ usb2_bdma_work_loop(struct usb_xfer_queue *pq)
|
||||
}
|
||||
if (!xfer->flags_int.bdma_setup) {
|
||||
struct usb_page *pg;
|
||||
usb2_frlength_t frlength_0;
|
||||
usb_frlength_t frlength_0;
|
||||
uint8_t isread;
|
||||
|
||||
xfer->flags_int.bdma_setup = 1;
|
||||
@ -987,7 +987,7 @@ void
|
||||
usb2_bdma_pre_sync(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb_page_cache *pc;
|
||||
usb2_frcount_t nframes;
|
||||
usb_frcount_t nframes;
|
||||
|
||||
if (xfer->flags_int.isochronous_xfr) {
|
||||
/* only one frame buffer */
|
||||
@ -1020,7 +1020,7 @@ void
|
||||
usb2_bdma_post_sync(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb_page_cache *pc;
|
||||
usb2_frcount_t nframes;
|
||||
usb_frcount_t nframes;
|
||||
|
||||
if (xfer->flags_int.isochronous_xfr) {
|
||||
/* only one frame buffer */
|
||||
|
@ -52,7 +52,7 @@ struct usb_dma_tag;
|
||||
* The following typedef defines the USB DMA load done callback.
|
||||
*/
|
||||
|
||||
typedef void (usb2_dma_callback_t)(struct usb_dma_parent_tag *udpt);
|
||||
typedef void (usb_dma_callback_t)(struct usb_dma_parent_tag *udpt);
|
||||
|
||||
/*
|
||||
* The following structure defines physical and non kernel virtual
|
||||
@ -75,7 +75,7 @@ struct usb_page_search {
|
||||
#if USB_HAVE_BUSDMA
|
||||
bus_size_t physaddr;
|
||||
#endif
|
||||
usb2_size_t length;
|
||||
size_t length;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -92,8 +92,8 @@ struct usb_page_cache {
|
||||
struct usb_dma_parent_tag *tag_parent; /* always set */
|
||||
void *buffer; /* virtual buffer pointer */
|
||||
#if USB_HAVE_BUSDMA
|
||||
usb2_size_t page_offset_buf;
|
||||
usb2_size_t page_offset_end;
|
||||
size_t page_offset_buf;
|
||||
size_t page_offset_end;
|
||||
uint8_t isread:1; /* set if we are currently reading
|
||||
* from the memory. Else write. */
|
||||
uint8_t ismultiseg:1; /* set if we can have multiple
|
||||
@ -110,7 +110,7 @@ struct usb_dma_parent_tag {
|
||||
bus_dma_tag_t tag; /* always set */
|
||||
|
||||
struct mtx *mtx; /* private mutex, always set */
|
||||
usb2_dma_callback_t *func; /* load complete callback function */
|
||||
usb_dma_callback_t *func; /* load complete callback function */
|
||||
struct usb_dma_tag *utag_first;/* pointer to first USB DMA tag */
|
||||
uint8_t dma_error; /* set if DMA load operation failed */
|
||||
uint8_t dma_bits; /* number of DMA address lines */
|
||||
@ -127,8 +127,8 @@ struct usb_dma_parent_tag {}; /* empty struct */
|
||||
struct usb_dma_tag {
|
||||
struct usb_dma_parent_tag *tag_parent;
|
||||
bus_dma_tag_t tag;
|
||||
usb2_size_t align;
|
||||
usb2_size_t size;
|
||||
size_t align;
|
||||
size_t size;
|
||||
};
|
||||
#else
|
||||
struct usb_dma_tag {}; /* empty struct */
|
||||
@ -137,36 +137,36 @@ struct usb_dma_tag {}; /* empty struct */
|
||||
/* function prototypes */
|
||||
|
||||
int usb2_uiomove(struct usb_page_cache *pc, struct uio *uio,
|
||||
usb2_frlength_t pc_offset, usb2_frlength_t len);
|
||||
usb_frlength_t pc_offset, usb_frlength_t len);
|
||||
struct usb_dma_tag *usb2_dma_tag_find(struct usb_dma_parent_tag *udpt,
|
||||
usb2_size_t size, usb2_size_t align);
|
||||
size_t size, size_t align);
|
||||
uint8_t usb2_pc_alloc_mem(struct usb_page_cache *pc, struct usb_page *pg,
|
||||
usb2_size_t size, usb2_size_t align);
|
||||
uint8_t usb2_pc_dmamap_create(struct usb_page_cache *pc, usb2_size_t size);
|
||||
uint8_t usb2_pc_load_mem(struct usb_page_cache *pc, usb2_size_t size,
|
||||
size_t size, size_t align);
|
||||
uint8_t usb2_pc_dmamap_create(struct usb_page_cache *pc, size_t size);
|
||||
uint8_t usb2_pc_load_mem(struct usb_page_cache *pc, size_t size,
|
||||
uint8_t sync);
|
||||
void usb2_bdma_done_event(struct usb_dma_parent_tag *udpt);
|
||||
void usb2_bdma_post_sync(struct usb_xfer *xfer);
|
||||
void usb2_bdma_pre_sync(struct usb_xfer *xfer);
|
||||
void usb2_bdma_work_loop(struct usb_xfer_queue *pq);
|
||||
void usb2_bzero(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
usb2_frlength_t len);
|
||||
void usb2_copy_in(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
const void *ptr, usb2_frlength_t len);
|
||||
int usb2_copy_in_user(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
const void *ptr, usb2_frlength_t len);
|
||||
void usb2_copy_out(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
void *ptr, usb2_frlength_t len);
|
||||
int usb2_copy_out_user(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
void *ptr, usb2_frlength_t len);
|
||||
void usb2_bzero(struct usb_page_cache *cache, usb_frlength_t offset,
|
||||
usb_frlength_t len);
|
||||
void usb2_copy_in(struct usb_page_cache *cache, usb_frlength_t offset,
|
||||
const void *ptr, usb_frlength_t len);
|
||||
int usb2_copy_in_user(struct usb_page_cache *cache, usb_frlength_t offset,
|
||||
const void *ptr, usb_frlength_t len);
|
||||
void usb2_copy_out(struct usb_page_cache *cache, usb_frlength_t offset,
|
||||
void *ptr, usb_frlength_t len);
|
||||
int usb2_copy_out_user(struct usb_page_cache *cache, usb_frlength_t offset,
|
||||
void *ptr, usb_frlength_t len);
|
||||
void usb2_dma_tag_setup(struct usb_dma_parent_tag *udpt,
|
||||
struct usb_dma_tag *udt, bus_dma_tag_t dmat, struct mtx *mtx,
|
||||
usb2_dma_callback_t *func, uint8_t ndmabits, uint8_t nudt);
|
||||
usb_dma_callback_t *func, uint8_t ndmabits, uint8_t nudt);
|
||||
void usb2_dma_tag_unsetup(struct usb_dma_parent_tag *udpt);
|
||||
void usb2_get_page(struct usb_page_cache *pc, usb2_frlength_t offset,
|
||||
void usb2_get_page(struct usb_page_cache *pc, usb_frlength_t offset,
|
||||
struct usb_page_search *res);
|
||||
void usb2_m_copy_in(struct usb_page_cache *cache, usb2_frlength_t dst_offset,
|
||||
struct mbuf *m, usb2_size_t src_offset, usb2_frlength_t src_len);
|
||||
void usb2_m_copy_in(struct usb_page_cache *cache, usb_frlength_t dst_offset,
|
||||
struct mbuf *m, size_t src_offset, usb_frlength_t src_len);
|
||||
void usb2_pc_cpu_flush(struct usb_page_cache *pc);
|
||||
void usb2_pc_cpu_invalidate(struct usb_page_cache *pc);
|
||||
void usb2_pc_dmamap_destroy(struct usb_page_cache *pc);
|
||||
|
@ -60,13 +60,13 @@ static device_detach_t usb_linux_detach;
|
||||
static device_suspend_t usb_linux_suspend;
|
||||
static device_resume_t usb_linux_resume;
|
||||
|
||||
static usb2_callback_t usb_linux_isoc_callback;
|
||||
static usb2_callback_t usb_linux_non_isoc_callback;
|
||||
static usb_callback_t usb_linux_isoc_callback;
|
||||
static usb_callback_t usb_linux_non_isoc_callback;
|
||||
|
||||
static usb_complete_t usb_linux_wait_complete;
|
||||
|
||||
static uint16_t usb_max_isoc_frames(struct usb_device *);
|
||||
static int usb_start_wait_urb(struct urb *, usb2_timeout_t, uint16_t *);
|
||||
static int usb_start_wait_urb(struct urb *, usb_timeout_t, uint16_t *);
|
||||
static const struct usb_device_id *usb_linux_lookup_id(
|
||||
const struct usb_device_id *, struct usb_attach_arg *);
|
||||
static struct usb_driver *usb_linux_get_usb_driver(struct usb_linux_softc *);
|
||||
@ -533,7 +533,7 @@ usb_clear_halt(struct usb_device *dev, struct usb_host_endpoint *uhe)
|
||||
* Linux USB transfers.
|
||||
*------------------------------------------------------------------------*/
|
||||
static int
|
||||
usb_start_wait_urb(struct urb *urb, usb2_timeout_t timeout, uint16_t *p_actlen)
|
||||
usb_start_wait_urb(struct urb *urb, usb_timeout_t timeout, uint16_t *p_actlen)
|
||||
{
|
||||
int err;
|
||||
|
||||
@ -589,7 +589,7 @@ int
|
||||
usb_control_msg(struct usb_device *dev, struct usb_host_endpoint *uhe,
|
||||
uint8_t request, uint8_t requesttype,
|
||||
uint16_t value, uint16_t index, void *data,
|
||||
uint16_t size, usb2_timeout_t timeout)
|
||||
uint16_t size, usb_timeout_t timeout)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
struct urb *urb;
|
||||
@ -710,7 +710,7 @@ usb_set_interface(struct usb_device *dev, uint8_t iface_no, uint8_t alt_index)
|
||||
*------------------------------------------------------------------------*/
|
||||
int
|
||||
usb_setup_endpoint(struct usb_device *dev,
|
||||
struct usb_host_endpoint *uhe, usb2_size_t bufsize)
|
||||
struct usb_host_endpoint *uhe, size_t bufsize)
|
||||
{
|
||||
struct usb_config cfg[2];
|
||||
uint8_t type = uhe->desc.bmAttributes & UE_XFERTYPE;
|
||||
@ -804,7 +804,7 @@ usb_linux_create_usb_device(struct usb_device *udev, device_t dev)
|
||||
struct usb_interface *p_ui = NULL;
|
||||
struct usb_host_interface *p_uhi = NULL;
|
||||
struct usb_host_endpoint *p_uhe = NULL;
|
||||
usb2_size_t size;
|
||||
size_t size;
|
||||
uint16_t niface_total;
|
||||
uint16_t nedesc;
|
||||
uint16_t iface_no_curr;
|
||||
@ -928,7 +928,7 @@ struct urb *
|
||||
usb_alloc_urb(uint16_t iso_packets, uint16_t mem_flags)
|
||||
{
|
||||
struct urb *urb;
|
||||
usb2_size_t size;
|
||||
size_t size;
|
||||
|
||||
if (iso_packets == 0xFFFF) {
|
||||
/*
|
||||
@ -1059,7 +1059,7 @@ usb_ifnum_to_if(struct usb_device *dev, uint8_t iface_no)
|
||||
* usb_buffer_alloc
|
||||
*------------------------------------------------------------------------*/
|
||||
void *
|
||||
usb_buffer_alloc(struct usb_device *dev, usb2_size_t size, uint16_t mem_flags, uint8_t *dma_addr)
|
||||
usb_buffer_alloc(struct usb_device *dev, size_t size, uint16_t mem_flags, uint8_t *dma_addr)
|
||||
{
|
||||
return (malloc(size, M_USBDEV, M_WAITOK | M_ZERO));
|
||||
}
|
||||
@ -1150,7 +1150,7 @@ usb_linux_free_device(struct usb_device *dev)
|
||||
* usb_buffer_free
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb_buffer_free(struct usb_device *dev, usb2_size_t size,
|
||||
usb_buffer_free(struct usb_device *dev, size_t size,
|
||||
void *addr, uint8_t dma_addr)
|
||||
{
|
||||
free(addr, M_USBDEV);
|
||||
@ -1283,9 +1283,9 @@ usb_linux_complete(struct usb_xfer *xfer)
|
||||
static void
|
||||
usb_linux_isoc_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_frlength_t max_frame = xfer->max_frame_size;
|
||||
usb2_frlength_t offset;
|
||||
usb2_frcount_t x;
|
||||
usb_frlength_t max_frame = xfer->max_frame_size;
|
||||
usb_frlength_t offset;
|
||||
usb_frcount_t x;
|
||||
struct urb *urb = xfer->priv_fifo;
|
||||
struct usb_host_endpoint *uhe = xfer->priv_sc;
|
||||
struct usb_iso_packet_descriptor *uipd;
|
||||
@ -1457,7 +1457,7 @@ usb_linux_non_isoc_callback(struct usb_xfer *xfer)
|
||||
struct urb *urb = xfer->priv_fifo;
|
||||
struct usb_host_endpoint *uhe = xfer->priv_sc;
|
||||
uint8_t *ptr;
|
||||
usb2_frlength_t max_bulk = xfer->max_data_length;
|
||||
usb_frlength_t max_bulk = xfer->max_data_length;
|
||||
uint8_t data_frame = xfer->flags_int.control_xfr ? 1 : 0;
|
||||
|
||||
DPRINTF("\n");
|
||||
|
@ -278,10 +278,10 @@ struct urb {
|
||||
void *context; /* (in) context for completion */
|
||||
usb_complete_t *complete; /* (in) completion routine */
|
||||
|
||||
usb2_size_t transfer_buffer_length;/* (in) data buffer length */
|
||||
usb2_size_t bsd_length_rem;
|
||||
usb2_size_t actual_length; /* (return) actual transfer length */
|
||||
usb2_timeout_t timeout; /* FreeBSD specific */
|
||||
size_t transfer_buffer_length;/* (in) data buffer length */
|
||||
size_t bsd_length_rem;
|
||||
size_t actual_length; /* (return) actual transfer length */
|
||||
usb_timeout_t timeout; /* FreeBSD specific */
|
||||
|
||||
uint16_t transfer_flags; /* (in) */
|
||||
#define URB_SHORT_NOT_OK 0x0001 /* report short transfers like errors */
|
||||
@ -292,8 +292,8 @@ struct urb {
|
||||
#define URB_WAIT_WAKEUP 0x0010 /* custom flags */
|
||||
#define URB_IS_SLEEPING 0x0020 /* custom flags */
|
||||
|
||||
usb2_frcount_t start_frame; /* (modify) start frame (ISO) */
|
||||
usb2_frcount_t number_of_packets; /* (in) number of ISO packets */
|
||||
usb_frcount_t start_frame; /* (modify) start frame (ISO) */
|
||||
usb_frcount_t number_of_packets; /* (in) number of ISO packets */
|
||||
uint16_t interval; /* (modify) transfer interval
|
||||
* (INT/ISO) */
|
||||
uint16_t error_count; /* (return) number of ISO errors */
|
||||
@ -313,11 +313,11 @@ int usb_unlink_urb(struct urb *urb);
|
||||
int usb_clear_halt(struct usb_device *dev, struct usb_host_endpoint *uhe);
|
||||
int usb_control_msg(struct usb_device *dev, struct usb_host_endpoint *pipe,
|
||||
uint8_t request, uint8_t requesttype, uint16_t value,
|
||||
uint16_t index, void *data, uint16_t size, usb2_timeout_t timeout);
|
||||
uint16_t index, void *data, uint16_t size, usb_timeout_t timeout);
|
||||
int usb_set_interface(struct usb_device *dev, uint8_t ifnum,
|
||||
uint8_t alternate);
|
||||
int usb_setup_endpoint(struct usb_device *dev,
|
||||
struct usb_host_endpoint *uhe, usb2_frlength_t bufsize);
|
||||
struct usb_host_endpoint *uhe, usb_frlength_t bufsize);
|
||||
|
||||
struct usb_host_endpoint *usb_find_host_endpoint(struct usb_device *dev,
|
||||
uint8_t type, uint8_t ep);
|
||||
@ -326,11 +326,11 @@ struct usb_host_interface *usb_altnum_to_altsetting(
|
||||
const struct usb_interface *intf, uint8_t alt_index);
|
||||
struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, uint8_t iface_no);
|
||||
|
||||
void *usb_buffer_alloc(struct usb_device *dev, usb2_size_t size,
|
||||
void *usb_buffer_alloc(struct usb_device *dev, size_t size,
|
||||
uint16_t mem_flags, uint8_t *dma_addr);
|
||||
void *usb_get_intfdata(struct usb_interface *intf);
|
||||
|
||||
void usb_buffer_free(struct usb_device *dev, usb2_size_t size, void *addr, uint8_t dma_addr);
|
||||
void usb_buffer_free(struct usb_device *dev, size_t size, void *addr, uint8_t dma_addr);
|
||||
void usb_free_urb(struct urb *urb);
|
||||
void usb_init_urb(struct urb *urb);
|
||||
void usb_kill_urb(struct urb *urb);
|
||||
|
@ -45,8 +45,8 @@ struct usb_endpoint_descriptor;
|
||||
|
||||
/* typedefs */
|
||||
|
||||
typedef void (usb2_bus_mem_sub_cb_t)(struct usb_bus *bus, struct usb_page_cache *pc, struct usb_page *pg, usb2_size_t size, usb2_size_t align);
|
||||
typedef void (usb2_bus_mem_cb_t)(struct usb_bus *bus, usb2_bus_mem_sub_cb_t *scb);
|
||||
typedef void (usb_bus_mem_sub_cb_t)(struct usb_bus *bus, struct usb_page_cache *pc, struct usb_page *pg, size_t size, size_t align);
|
||||
typedef void (usb_bus_mem_cb_t)(struct usb_bus *bus, usb_bus_mem_sub_cb_t *scb);
|
||||
|
||||
/*
|
||||
* The following structure is used to define all the USB BUS
|
||||
@ -56,7 +56,7 @@ struct usb_bus_methods {
|
||||
|
||||
/* USB Device and Host mode - Mandatory */
|
||||
|
||||
usb2_handle_request_t *roothub_exec;
|
||||
usb_handle_req_t *roothub_exec;
|
||||
|
||||
void (*pipe_init) (struct usb_device *, struct usb_endpoint_descriptor *, struct usb_pipe *);
|
||||
void (*xfer_setup) (struct usb_setup_params *);
|
||||
@ -108,11 +108,11 @@ struct usb_pipe_methods {
|
||||
|
||||
/* Mandatory USB Device and Host mode callbacks: */
|
||||
|
||||
usb2_callback_t *open;
|
||||
usb2_callback_t *close;
|
||||
usb_callback_t *open;
|
||||
usb_callback_t *close;
|
||||
|
||||
usb2_callback_t *enter;
|
||||
usb2_callback_t *start;
|
||||
usb_callback_t *enter;
|
||||
usb_callback_t *start;
|
||||
|
||||
/* Optional */
|
||||
|
||||
@ -170,21 +170,21 @@ struct usb_hw_ep_scratch {
|
||||
*/
|
||||
struct usb_temp_setup {
|
||||
void *buf;
|
||||
usb2_size_t size;
|
||||
size_t size;
|
||||
enum usb_dev_speed usb_speed;
|
||||
uint8_t self_powered;
|
||||
uint8_t bNumEndpoints;
|
||||
uint8_t bInterfaceNumber;
|
||||
uint8_t bAlternateSetting;
|
||||
uint8_t bConfigurationValue;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
};
|
||||
|
||||
/* prototypes */
|
||||
|
||||
void usb2_bus_mem_flush_all(struct usb_bus *bus, usb2_bus_mem_cb_t *cb);
|
||||
uint8_t usb2_bus_mem_alloc_all(struct usb_bus *bus, bus_dma_tag_t dmat, usb2_bus_mem_cb_t *cb);
|
||||
void usb2_bus_mem_free_all(struct usb_bus *bus, usb2_bus_mem_cb_t *cb);
|
||||
void usb2_bus_mem_flush_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb);
|
||||
uint8_t usb2_bus_mem_alloc_all(struct usb_bus *bus, bus_dma_tag_t dmat, usb_bus_mem_cb_t *cb);
|
||||
void usb2_bus_mem_free_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb);
|
||||
uint16_t usb2_isoc_time_expand(struct usb_bus *bus, uint16_t isoc_time_curr);
|
||||
uint16_t usb2_fs_isoc_schedule_isoc_time_expand(struct usb_device *udev, struct usb_fs_isoc_schedule **pp_start, struct usb_fs_isoc_schedule **pp_end, uint16_t isoc_time);
|
||||
uint8_t usb2_fs_isoc_schedule_alloc(struct usb_fs_isoc_schedule *fss, uint8_t *pstart, uint16_t len);
|
||||
|
@ -266,37 +266,33 @@ struct usb_xfer_root;
|
||||
|
||||
/* typedefs */
|
||||
|
||||
typedef void (usb2_callback_t)(struct usb_xfer *);
|
||||
typedef void (usb_callback_t)(struct usb_xfer *);
|
||||
|
||||
#ifndef USB_HAVE_USB_ERROR_T
|
||||
typedef uint8_t usb2_error_t; /* see "USB_ERR_XXX" */
|
||||
typedef uint8_t usb_error_t; /* see "USB_ERR_XXX" */
|
||||
#endif
|
||||
|
||||
#ifndef USB_HAVE_TIMEOUT_T
|
||||
typedef uint32_t usb2_timeout_t; /* milliseconds */
|
||||
typedef uint32_t usb_timeout_t; /* milliseconds */
|
||||
#endif
|
||||
|
||||
#ifndef USB_HAVE_FRLENGTH_T
|
||||
typedef uint32_t usb2_frlength_t; /* bytes */
|
||||
typedef uint32_t usb_frlength_t; /* bytes */
|
||||
#endif
|
||||
|
||||
#ifndef USB_HAVE_FRCOUNT_T
|
||||
typedef uint32_t usb2_frcount_t; /* units */
|
||||
#endif
|
||||
|
||||
#ifndef USB_HAVE_SIZE_T
|
||||
typedef uint32_t usb2_size_t; /* bytes */
|
||||
typedef uint32_t usb_frcount_t; /* units */
|
||||
#endif
|
||||
|
||||
#ifndef USB_HAVE_TICKS_T
|
||||
typedef uint32_t usb2_ticks_t; /* system defined */
|
||||
typedef uint32_t usb_ticks_t; /* system defined */
|
||||
#endif
|
||||
|
||||
#ifndef USB_HAVE_POWER_MASK_T
|
||||
typedef uint16_t usb2_power_mask_t; /* see "USB_HW_POWER_XXX" */
|
||||
typedef uint16_t usb_power_mask_t; /* see "USB_HW_POWER_XXX" */
|
||||
#endif
|
||||
|
||||
typedef usb2_error_t (usb2_handle_request_t)(struct usb_device *,
|
||||
typedef usb_error_t (usb_handle_req_t)(struct usb_device *,
|
||||
struct usb_device_request *, const void **, uint16_t *);
|
||||
|
||||
/* structures */
|
||||
@ -386,12 +382,12 @@ struct usb_xfer_flags_int {
|
||||
* is used when setting up an USB transfer.
|
||||
*/
|
||||
struct usb_config {
|
||||
usb2_callback_t *callback; /* USB transfer callback */
|
||||
usb2_frlength_t bufsize; /* total pipe buffer size in bytes */
|
||||
usb2_frcount_t frames; /* maximum number of USB frames */
|
||||
usb2_timeout_t interval; /* interval in milliseconds */
|
||||
usb_callback_t *callback; /* USB transfer callback */
|
||||
usb_frlength_t bufsize; /* total pipe buffer size in bytes */
|
||||
usb_frcount_t frames; /* maximum number of USB frames */
|
||||
usb_timeout_t interval; /* interval in milliseconds */
|
||||
#define USB_DEFAULT_INTERVAL 0
|
||||
usb2_timeout_t timeout; /* transfer timeout in milliseconds */
|
||||
usb_timeout_t timeout; /* transfer timeout in milliseconds */
|
||||
struct usb_xfer_flags flags; /* transfer flags */
|
||||
enum usb_hc_mode usb_mode; /* host or device mode */
|
||||
uint8_t type; /* pipe type */
|
||||
@ -422,29 +418,29 @@ struct usb_xfer {
|
||||
void *priv_sc; /* device driver data pointer 1 */
|
||||
void *priv_fifo; /* device driver data pointer 2 */
|
||||
void *local_buffer;
|
||||
usb2_frlength_t *frlengths;
|
||||
usb_frlength_t *frlengths;
|
||||
struct usb_page_cache *frbuffers;
|
||||
usb2_callback_t *callback;
|
||||
usb_callback_t *callback;
|
||||
|
||||
usb2_frlength_t max_hc_frame_size;
|
||||
usb2_frlength_t max_data_length;
|
||||
usb2_frlength_t sumlen; /* sum of all lengths in bytes */
|
||||
usb2_frlength_t actlen; /* actual length in bytes */
|
||||
usb2_timeout_t timeout; /* milliseconds */
|
||||
usb_frlength_t max_hc_frame_size;
|
||||
usb_frlength_t max_data_length;
|
||||
usb_frlength_t sumlen; /* sum of all lengths in bytes */
|
||||
usb_frlength_t actlen; /* actual length in bytes */
|
||||
usb_timeout_t timeout; /* milliseconds */
|
||||
#define USB_NO_TIMEOUT 0
|
||||
#define USB_DEFAULT_TIMEOUT 5000 /* 5000 ms = 5 seconds */
|
||||
|
||||
usb2_frcount_t max_frame_count; /* initial value of "nframes" after
|
||||
usb_frcount_t max_frame_count; /* initial value of "nframes" after
|
||||
* setup */
|
||||
usb2_frcount_t nframes; /* number of USB frames to transfer */
|
||||
usb2_frcount_t aframes; /* actual number of USB frames
|
||||
usb_frcount_t nframes; /* number of USB frames to transfer */
|
||||
usb_frcount_t aframes; /* actual number of USB frames
|
||||
* transferred */
|
||||
|
||||
uint16_t max_packet_size;
|
||||
uint16_t max_frame_size;
|
||||
uint16_t qh_pos;
|
||||
uint16_t isoc_time_complete; /* in ms */
|
||||
usb2_timeout_t interval; /* milliseconds */
|
||||
usb_timeout_t interval; /* milliseconds */
|
||||
|
||||
uint8_t address; /* physical USB address */
|
||||
uint8_t endpoint; /* physical USB endpoint */
|
||||
@ -454,7 +450,7 @@ struct usb_xfer {
|
||||
uint8_t usb2_uframe;
|
||||
uint8_t usb2_state;
|
||||
|
||||
usb2_error_t error;
|
||||
usb_error_t error;
|
||||
|
||||
struct usb_xfer_flags flags;
|
||||
struct usb_xfer_flags_int flags_int;
|
||||
@ -501,13 +497,9 @@ MALLOC_DECLARE(M_USBHC);
|
||||
|
||||
extern struct mtx usb2_ref_lock;
|
||||
|
||||
/* typedefs */
|
||||
|
||||
typedef struct malloc_type *usb2_malloc_type;
|
||||
|
||||
/* prototypes */
|
||||
|
||||
const char *usb2_errstr(usb2_error_t error);
|
||||
const char *usb2_errstr(usb_error_t error);
|
||||
const char *usb2_statestr(enum usb_dev_state state);
|
||||
struct usb_config_descriptor *usb2_get_config_descriptor(
|
||||
struct usb_device *udev);
|
||||
@ -520,19 +512,19 @@ struct usb_interface_descriptor *usb2_get_interface_descriptor(
|
||||
uint8_t usb2_clear_stall_callback(struct usb_xfer *xfer1,
|
||||
struct usb_xfer *xfer2);
|
||||
uint8_t usb2_get_interface_altindex(struct usb_interface *iface);
|
||||
usb2_error_t usb2_set_alt_interface_index(struct usb_device *udev,
|
||||
usb_error_t usb2_set_alt_interface_index(struct usb_device *udev,
|
||||
uint8_t iface_index, uint8_t alt_index);
|
||||
enum usb_hc_mode usb2_get_mode(struct usb_device *udev);
|
||||
enum usb_dev_speed usb2_get_speed(struct usb_device *udev);
|
||||
uint32_t usb2_get_isoc_fps(struct usb_device *udev);
|
||||
usb2_error_t usb2_transfer_setup(struct usb_device *udev,
|
||||
usb_error_t usb2_transfer_setup(struct usb_device *udev,
|
||||
const uint8_t *ifaces, struct usb_xfer **pxfer,
|
||||
const struct usb_config *setup_start, uint16_t n_setup,
|
||||
void *priv_sc, struct mtx *priv_mtx);
|
||||
void usb2_set_frame_data(struct usb_xfer *xfer, void *ptr,
|
||||
usb2_frcount_t frindex);
|
||||
void usb2_set_frame_offset(struct usb_xfer *xfer, usb2_frlength_t offset,
|
||||
usb2_frcount_t frindex);
|
||||
usb_frcount_t frindex);
|
||||
void usb2_set_frame_offset(struct usb_xfer *xfer, usb_frlength_t offset,
|
||||
usb_frcount_t frindex);
|
||||
void usb2_start_hardware(struct usb_xfer *xfer);
|
||||
void usb2_transfer_clear_stall(struct usb_xfer *xfer);
|
||||
void usb2_transfer_drain(struct usb_xfer *xfer);
|
||||
|
@ -88,8 +88,8 @@ static struct usb_pipe *usb2_dev_get_pipe(struct usb_device *, uint8_t,
|
||||
static void usb2_loc_fill(struct usb_fs_privdata *,
|
||||
struct usb_cdev_privdata *);
|
||||
static void usb2_close(void *);
|
||||
static usb2_error_t usb2_ref_device(struct usb_cdev_privdata *, int);
|
||||
static usb2_error_t usb2_usb_ref_device(struct usb_cdev_privdata *);
|
||||
static usb_error_t usb2_ref_device(struct usb_cdev_privdata *, int);
|
||||
static usb_error_t usb2_usb_ref_device(struct usb_cdev_privdata *);
|
||||
static void usb2_unref_device(struct usb_cdev_privdata *);
|
||||
|
||||
static d_open_t usb2_open;
|
||||
@ -100,10 +100,10 @@ static d_poll_t usb2_poll;
|
||||
|
||||
static d_ioctl_t usb2_static_ioctl;
|
||||
|
||||
static usb2_fifo_open_t usb2_fifo_dummy_open;
|
||||
static usb2_fifo_close_t usb2_fifo_dummy_close;
|
||||
static usb2_fifo_ioctl_t usb2_fifo_dummy_ioctl;
|
||||
static usb2_fifo_cmd_t usb2_fifo_dummy_cmd;
|
||||
static usb_fifo_open_t usb2_fifo_dummy_open;
|
||||
static usb_fifo_close_t usb2_fifo_dummy_close;
|
||||
static usb_fifo_ioctl_t usb2_fifo_dummy_ioctl;
|
||||
static usb_fifo_cmd_t usb2_fifo_dummy_cmd;
|
||||
|
||||
/* character device structure used for devices (/dev/ugenX.Y and /dev/uXXX) */
|
||||
struct cdevsw usb2_devsw = {
|
||||
@ -157,7 +157,7 @@ usb2_loc_fill(struct usb_fs_privdata* pd, struct usb_cdev_privdata *cpd)
|
||||
* 0: Success, refcount incremented on the given USB device.
|
||||
* Else: Failure.
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_ref_device(struct usb_cdev_privdata* cpd, int need_uref)
|
||||
{
|
||||
struct usb_fifo **ppf;
|
||||
@ -286,7 +286,7 @@ usb2_ref_device(struct usb_cdev_privdata* cpd, int need_uref)
|
||||
* 0: Success, refcount incremented on the given USB device.
|
||||
* Else: Failure.
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
usb2_usb_ref_device(struct usb_cdev_privdata *cpd)
|
||||
{
|
||||
/*
|
||||
@ -1683,7 +1683,7 @@ usb2_fifo_attach(struct usb_device *udev, void *priv_sc,
|
||||
* Else failure
|
||||
*------------------------------------------------------------------------*/
|
||||
int
|
||||
usb2_fifo_alloc_buffer(struct usb_fifo *f, usb2_size_t bufsize,
|
||||
usb2_fifo_alloc_buffer(struct usb_fifo *f, size_t bufsize,
|
||||
uint16_t nbuf)
|
||||
{
|
||||
usb2_fifo_free_buffer(f);
|
||||
@ -1748,11 +1748,11 @@ usb2_fifo_detach(struct usb_fifo_sc *f_sc)
|
||||
DPRINTFN(2, "detached %p\n", f_sc);
|
||||
}
|
||||
|
||||
usb2_size_t
|
||||
size_t
|
||||
usb2_fifo_put_bytes_max(struct usb_fifo *f)
|
||||
{
|
||||
struct usb_mbuf *m;
|
||||
usb2_size_t len;
|
||||
size_t len;
|
||||
|
||||
USB_IF_POLL(&f->free_q, m);
|
||||
|
||||
@ -1773,10 +1773,10 @@ usb2_fifo_put_bytes_max(struct usb_fifo *f)
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_fifo_put_data(struct usb_fifo *f, struct usb_page_cache *pc,
|
||||
usb2_frlength_t offset, usb2_frlength_t len, uint8_t what)
|
||||
usb_frlength_t offset, usb_frlength_t len, uint8_t what)
|
||||
{
|
||||
struct usb_mbuf *m;
|
||||
usb2_frlength_t io_len;
|
||||
usb_frlength_t io_len;
|
||||
|
||||
while (len || (what == 1)) {
|
||||
|
||||
@ -1811,10 +1811,10 @@ usb2_fifo_put_data(struct usb_fifo *f, struct usb_page_cache *pc,
|
||||
|
||||
void
|
||||
usb2_fifo_put_data_linear(struct usb_fifo *f, void *ptr,
|
||||
usb2_size_t len, uint8_t what)
|
||||
size_t len, uint8_t what)
|
||||
{
|
||||
struct usb_mbuf *m;
|
||||
usb2_size_t io_len;
|
||||
size_t io_len;
|
||||
|
||||
while (len || (what == 1)) {
|
||||
|
||||
@ -1848,7 +1848,7 @@ usb2_fifo_put_data_linear(struct usb_fifo *f, void *ptr,
|
||||
}
|
||||
|
||||
uint8_t
|
||||
usb2_fifo_put_data_buffer(struct usb_fifo *f, void *ptr, usb2_size_t len)
|
||||
usb2_fifo_put_data_buffer(struct usb_fifo *f, void *ptr, size_t len)
|
||||
{
|
||||
struct usb_mbuf *m;
|
||||
|
||||
@ -1884,11 +1884,11 @@ usb2_fifo_put_data_error(struct usb_fifo *f)
|
||||
*------------------------------------------------------------------------*/
|
||||
uint8_t
|
||||
usb2_fifo_get_data(struct usb_fifo *f, struct usb_page_cache *pc,
|
||||
usb2_frlength_t offset, usb2_frlength_t len, usb2_frlength_t *actlen,
|
||||
usb_frlength_t offset, usb_frlength_t len, usb_frlength_t *actlen,
|
||||
uint8_t what)
|
||||
{
|
||||
struct usb_mbuf *m;
|
||||
usb2_frlength_t io_len;
|
||||
usb_frlength_t io_len;
|
||||
uint8_t tr_data = 0;
|
||||
|
||||
actlen[0] = 0;
|
||||
@ -1950,10 +1950,10 @@ usb2_fifo_get_data(struct usb_fifo *f, struct usb_page_cache *pc,
|
||||
|
||||
uint8_t
|
||||
usb2_fifo_get_data_linear(struct usb_fifo *f, void *ptr,
|
||||
usb2_size_t len, usb2_size_t *actlen, uint8_t what)
|
||||
size_t len, size_t *actlen, uint8_t what)
|
||||
{
|
||||
struct usb_mbuf *m;
|
||||
usb2_size_t io_len;
|
||||
size_t io_len;
|
||||
uint8_t tr_data = 0;
|
||||
|
||||
actlen[0] = 0;
|
||||
@ -2014,7 +2014,7 @@ usb2_fifo_get_data_linear(struct usb_fifo *f, void *ptr,
|
||||
}
|
||||
|
||||
uint8_t
|
||||
usb2_fifo_get_data_buffer(struct usb_fifo *f, void **pptr, usb2_size_t *plen)
|
||||
usb2_fifo_get_data_buffer(struct usb_fifo *f, void **pptr, size_t *plen)
|
||||
{
|
||||
struct usb_mbuf *m;
|
||||
|
||||
|
@ -41,11 +41,11 @@
|
||||
struct usb_fifo;
|
||||
struct usb_mbuf;
|
||||
|
||||
typedef int (usb2_fifo_open_t)(struct usb_fifo *fifo, int fflags);
|
||||
typedef void (usb2_fifo_close_t)(struct usb_fifo *fifo, int fflags);
|
||||
typedef int (usb2_fifo_ioctl_t)(struct usb_fifo *fifo, u_long cmd, void *addr, int fflags);
|
||||
typedef void (usb2_fifo_cmd_t)(struct usb_fifo *fifo);
|
||||
typedef void (usb2_fifo_filter_t)(struct usb_fifo *fifo, struct usb_mbuf *m);
|
||||
typedef int (usb_fifo_open_t)(struct usb_fifo *fifo, int fflags);
|
||||
typedef void (usb_fifo_close_t)(struct usb_fifo *fifo, int fflags);
|
||||
typedef int (usb_fifo_ioctl_t)(struct usb_fifo *fifo, u_long cmd, void *addr, int fflags);
|
||||
typedef void (usb_fifo_cmd_t)(struct usb_fifo *fifo);
|
||||
typedef void (usb_fifo_filter_t)(struct usb_fifo *fifo, struct usb_mbuf *m);
|
||||
|
||||
struct usb_symlink {
|
||||
TAILQ_ENTRY(usb_symlink) sym_entry;
|
||||
@ -59,24 +59,24 @@ struct usb_symlink {
|
||||
|
||||
/*
|
||||
* Locking note for the following functions. All the
|
||||
* "usb2_fifo_cmd_t" and "usb2_fifo_filter_t" functions are called
|
||||
* "usb_fifo_cmd_t" and "usb_fifo_filter_t" functions are called
|
||||
* locked. The others are called unlocked.
|
||||
*/
|
||||
struct usb_fifo_methods {
|
||||
usb2_fifo_open_t *f_open;
|
||||
usb2_fifo_close_t *f_close;
|
||||
usb2_fifo_ioctl_t *f_ioctl;
|
||||
usb_fifo_open_t *f_open;
|
||||
usb_fifo_close_t *f_close;
|
||||
usb_fifo_ioctl_t *f_ioctl;
|
||||
/*
|
||||
* NOTE: The post-ioctl callback is called after the USB reference
|
||||
* gets locked in the IOCTL handler:
|
||||
*/
|
||||
usb2_fifo_ioctl_t *f_ioctl_post;
|
||||
usb2_fifo_cmd_t *f_start_read;
|
||||
usb2_fifo_cmd_t *f_stop_read;
|
||||
usb2_fifo_cmd_t *f_start_write;
|
||||
usb2_fifo_cmd_t *f_stop_write;
|
||||
usb2_fifo_filter_t *f_filter_read;
|
||||
usb2_fifo_filter_t *f_filter_write;
|
||||
usb_fifo_ioctl_t *f_ioctl_post;
|
||||
usb_fifo_cmd_t *f_start_read;
|
||||
usb_fifo_cmd_t *f_stop_read;
|
||||
usb_fifo_cmd_t *f_start_write;
|
||||
usb_fifo_cmd_t *f_stop_write;
|
||||
usb_fifo_filter_t *f_filter_read;
|
||||
usb_fifo_filter_t *f_filter_write;
|
||||
const char *basename[4];
|
||||
const char *postfix[4];
|
||||
};
|
||||
@ -135,9 +135,9 @@ struct usb_fifo {
|
||||
void *priv_sc0; /* client data */
|
||||
void *priv_sc1; /* client data */
|
||||
void *queue_data;
|
||||
usb2_timeout_t timeout; /* timeout in milliseconds */
|
||||
usb2_frlength_t bufsize; /* BULK and INTERRUPT buffer size */
|
||||
usb2_frcount_t nframes; /* for isochronous mode */
|
||||
usb_timeout_t timeout; /* timeout in milliseconds */
|
||||
usb_frlength_t bufsize; /* BULK and INTERRUPT buffer size */
|
||||
usb_frcount_t nframes; /* for isochronous mode */
|
||||
uint16_t dev_ep_index; /* our device endpoint index */
|
||||
uint8_t flag_sleeping; /* set if FIFO is sleeping */
|
||||
uint8_t flag_iscomplete; /* set if a USB transfer is complete */
|
||||
@ -175,18 +175,18 @@ int usb2_fifo_attach(struct usb_device *udev, void *priv_sc,
|
||||
void usb2_fifo_detach(struct usb_fifo_sc *f_sc);
|
||||
uint32_t usb2_fifo_put_bytes_max(struct usb_fifo *fifo);
|
||||
void usb2_fifo_put_data(struct usb_fifo *fifo, struct usb_page_cache *pc,
|
||||
usb2_frlength_t offset, usb2_frlength_t len, uint8_t what);
|
||||
usb_frlength_t offset, usb_frlength_t len, uint8_t what);
|
||||
void usb2_fifo_put_data_linear(struct usb_fifo *fifo, void *ptr,
|
||||
usb2_size_t len, uint8_t what);
|
||||
uint8_t usb2_fifo_put_data_buffer(struct usb_fifo *f, void *ptr, usb2_size_t len);
|
||||
size_t len, uint8_t what);
|
||||
uint8_t usb2_fifo_put_data_buffer(struct usb_fifo *f, void *ptr, size_t len);
|
||||
void usb2_fifo_put_data_error(struct usb_fifo *fifo);
|
||||
uint8_t usb2_fifo_get_data(struct usb_fifo *fifo, struct usb_page_cache *pc,
|
||||
usb2_frlength_t offset, usb2_frlength_t len, usb2_frlength_t *actlen,
|
||||
usb_frlength_t offset, usb_frlength_t len, usb_frlength_t *actlen,
|
||||
uint8_t what);
|
||||
uint8_t usb2_fifo_get_data_linear(struct usb_fifo *fifo, void *ptr,
|
||||
usb2_size_t len, usb2_size_t *actlen, uint8_t what);
|
||||
size_t len, size_t *actlen, uint8_t what);
|
||||
uint8_t usb2_fifo_get_data_buffer(struct usb_fifo *f, void **pptr,
|
||||
usb2_size_t *plen);
|
||||
size_t *plen);
|
||||
void usb2_fifo_get_data_error(struct usb_fifo *fifo);
|
||||
uint8_t usb2_fifo_opened(struct usb_fifo *fifo);
|
||||
void usb2_fifo_free(struct usb_fifo *f);
|
||||
|
@ -70,7 +70,7 @@ static void usb2_init_attach_arg(struct usb_device *,
|
||||
static void usb2_suspend_resume_sub(struct usb_device *, device_t,
|
||||
uint8_t);
|
||||
static void usb2_clear_stall_proc(struct usb_proc_msg *_pm);
|
||||
usb2_error_t usb2_config_parse(struct usb_device *, uint8_t, uint8_t);
|
||||
usb_error_t usb2_config_parse(struct usb_device *, uint8_t, uint8_t);
|
||||
static void usb2_set_device_strings(struct usb_device *);
|
||||
#if USB_HAVE_UGEN
|
||||
static void usb2_notify_addq(const char *type, struct usb_device *);
|
||||
@ -287,7 +287,7 @@ usb2_get_pipe(struct usb_device *udev, uint8_t iface_index,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_interface_count(struct usb_device *udev, uint8_t *count)
|
||||
{
|
||||
if (udev->cdesc == NULL) {
|
||||
@ -438,7 +438,7 @@ usb2_unconfigure(struct usb_device *udev, uint8_t flag)
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_set_config_index(struct usb_device *udev, uint8_t index)
|
||||
{
|
||||
struct usb_status ds;
|
||||
@ -447,7 +447,7 @@ usb2_set_config_index(struct usb_device *udev, uint8_t index)
|
||||
uint16_t max_power;
|
||||
uint8_t selfpowered;
|
||||
uint8_t do_unlock;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
DPRINTFN(6, "udev=%p index=%d\n", udev, index);
|
||||
|
||||
@ -588,7 +588,7 @@ usb2_set_config_index(struct usb_device *udev, uint8_t index)
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_config_parse(struct usb_device *udev, uint8_t iface_index, uint8_t cmd)
|
||||
{
|
||||
struct usb_idesc_parse_state ips;
|
||||
@ -596,7 +596,7 @@ usb2_config_parse(struct usb_device *udev, uint8_t iface_index, uint8_t cmd)
|
||||
struct usb_endpoint_descriptor *ed;
|
||||
struct usb_interface *iface;
|
||||
struct usb_pipe *pipe;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint8_t ep_curr;
|
||||
uint8_t ep_max;
|
||||
uint8_t temp;
|
||||
@ -794,12 +794,12 @@ usb2_config_parse(struct usb_device *udev, uint8_t iface_index, uint8_t cmd)
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_set_alt_interface_index(struct usb_device *udev,
|
||||
uint8_t iface_index, uint8_t alt_index)
|
||||
{
|
||||
struct usb_interface *iface = usb2_get_iface(udev, iface_index);
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint8_t do_unlock;
|
||||
|
||||
/* automatic locking */
|
||||
@ -858,7 +858,7 @@ usb2_set_alt_interface_index(struct usb_device *udev,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_set_endpoint_stall(struct usb_device *udev, struct usb_pipe *pipe,
|
||||
uint8_t do_stall)
|
||||
{
|
||||
@ -934,12 +934,12 @@ usb2_set_endpoint_stall(struct usb_device *udev, struct usb_pipe *pipe,
|
||||
/*------------------------------------------------------------------------*
|
||||
* usb2_reset_iface_endpoints - used in USB device side mode
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_reset_iface_endpoints(struct usb_device *udev, uint8_t iface_index)
|
||||
{
|
||||
struct usb_pipe *pipe;
|
||||
struct usb_pipe *pipe_end;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
pipe = udev->pipes;
|
||||
pipe_end = udev->pipes + udev->pipes_max;
|
||||
@ -1199,7 +1199,7 @@ usb2_init_attach_arg(struct usb_device *udev,
|
||||
* 0: Success
|
||||
* Else: A control transfer failed
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_probe_and_attach(struct usb_device *udev, uint8_t iface_index)
|
||||
{
|
||||
struct usb_attach_arg uaa;
|
||||
@ -1339,7 +1339,7 @@ usb2_suspend_resume_sub(struct usb_device *udev, device_t dev, uint8_t do_suspen
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_suspend_resume(struct usb_device *udev, uint8_t do_suspend)
|
||||
{
|
||||
struct usb_interface *iface;
|
||||
@ -1423,7 +1423,7 @@ usb2_alloc_device(device_t parent_dev, struct usb_bus *bus,
|
||||
struct usb_device *hub;
|
||||
uint8_t *scratch_ptr;
|
||||
uint32_t scratch_size;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint8_t device_index;
|
||||
|
||||
DPRINTF("parent_dev=%p, bus=%p, parent_hub=%p, depth=%u, "
|
||||
@ -1484,7 +1484,7 @@ usb2_alloc_device(device_t parent_dev, struct usb_bus *bus,
|
||||
udev->depth = depth;
|
||||
udev->bus = bus;
|
||||
udev->address = USB_START_ADDR; /* default value */
|
||||
udev->plugtime = (usb2_ticks_t)ticks;
|
||||
udev->plugtime = (usb_ticks_t)ticks;
|
||||
usb2_set_device_state(udev, USB_STATE_POWERED);
|
||||
/*
|
||||
* We need to force the power mode to "on" because there are plenty
|
||||
|
@ -61,7 +61,7 @@ struct usb_host_endpoint {
|
||||
TAILQ_HEAD(, urb) bsd_urb_list;
|
||||
struct usb_xfer *bsd_xfer[2];
|
||||
uint8_t *extra; /* Extra descriptors */
|
||||
usb2_frlength_t fbsd_buf_size;
|
||||
usb_frlength_t fbsd_buf_size;
|
||||
uint16_t extralen;
|
||||
uint8_t bsd_iface_index;
|
||||
} __aligned(USB_HOST_ALIGN);
|
||||
@ -139,10 +139,10 @@ struct usb_device_flags {
|
||||
* in this structure is protected by the USB BUS lock.
|
||||
*/
|
||||
struct usb_power_save {
|
||||
usb2_ticks_t last_xfer_time; /* copy of "ticks" */
|
||||
usb2_size_t type_refs[4]; /* transfer reference count */
|
||||
usb2_size_t read_refs; /* data read references */
|
||||
usb2_size_t write_refs; /* data write references */
|
||||
usb_ticks_t last_xfer_time; /* copy of "ticks" */
|
||||
size_t type_refs[4]; /* transfer reference count */
|
||||
size_t read_refs; /* data read references */
|
||||
size_t write_refs; /* data write references */
|
||||
};
|
||||
|
||||
/*
|
||||
@ -175,7 +175,7 @@ struct usb_device {
|
||||
LIST_HEAD(,usb_fs_privdata) pd_list;
|
||||
char ugen_name[20]; /* name of ugenX.X device */
|
||||
#endif
|
||||
usb2_ticks_t plugtime; /* copy of "ticks" */
|
||||
usb_ticks_t plugtime; /* copy of "ticks" */
|
||||
|
||||
enum usb_dev_state state;
|
||||
enum usb_dev_speed speed;
|
||||
@ -235,15 +235,15 @@ struct usb_device *usb2_alloc_device(device_t parent_dev, struct usb_bus *bus,
|
||||
struct usb_pipe *usb2_get_pipe(struct usb_device *udev, uint8_t iface_index,
|
||||
const struct usb_config *setup);
|
||||
struct usb_pipe *usb2_get_pipe_by_addr(struct usb_device *udev, uint8_t ea_val);
|
||||
usb2_error_t usb2_interface_count(struct usb_device *udev, uint8_t *count);
|
||||
usb2_error_t usb2_probe_and_attach(struct usb_device *udev,
|
||||
usb_error_t usb2_interface_count(struct usb_device *udev, uint8_t *count);
|
||||
usb_error_t usb2_probe_and_attach(struct usb_device *udev,
|
||||
uint8_t iface_index);
|
||||
usb2_error_t usb2_reset_iface_endpoints(struct usb_device *udev,
|
||||
usb_error_t usb2_reset_iface_endpoints(struct usb_device *udev,
|
||||
uint8_t iface_index);
|
||||
usb2_error_t usb2_set_config_index(struct usb_device *udev, uint8_t index);
|
||||
usb2_error_t usb2_set_endpoint_stall(struct usb_device *udev,
|
||||
usb_error_t usb2_set_config_index(struct usb_device *udev, uint8_t index);
|
||||
usb_error_t usb2_set_endpoint_stall(struct usb_device *udev,
|
||||
struct usb_pipe *pipe, uint8_t do_stall);
|
||||
usb2_error_t usb2_suspend_resume(struct usb_device *udev,
|
||||
usb_error_t usb2_suspend_resume(struct usb_device *udev,
|
||||
uint8_t do_suspend);
|
||||
void usb2_devinfo(struct usb_device *udev, char *dst_ptr, uint16_t dst_len);
|
||||
void usb2_free_device(struct usb_device *, uint8_t);
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include <dev/usb/usb_dynamic.h>
|
||||
|
||||
/* function prototypes */
|
||||
static usb2_handle_request_t usb2_temp_get_desc_w;
|
||||
static usb_handle_req_t usb2_temp_get_desc_w;
|
||||
static usb2_temp_setup_by_index_t usb2_temp_setup_by_index_w;
|
||||
static usb2_temp_unsetup_t usb2_temp_unsetup_w;
|
||||
static usb2_test_quirk_t usb2_test_quirk_w;
|
||||
@ -42,7 +42,7 @@ static usb2_test_huawei_autoinst_t usb2_test_huawei_autoinst_w;
|
||||
static usb2_quirk_ioctl_t usb2_quirk_ioctl_w;
|
||||
|
||||
/* global variables */
|
||||
usb2_handle_request_t *usb2_temp_get_desc_p = &usb2_temp_get_desc_w;
|
||||
usb_handle_req_t *usb2_temp_get_desc_p = &usb2_temp_get_desc_w;
|
||||
usb2_temp_setup_by_index_t *usb2_temp_setup_by_index_p = &usb2_temp_setup_by_index_w;
|
||||
usb2_temp_unsetup_t *usb2_temp_unsetup_p = &usb2_temp_unsetup_w;
|
||||
usb2_test_quirk_t *usb2_test_quirk_p = &usb2_test_quirk_w;
|
||||
@ -50,7 +50,7 @@ usb2_test_huawei_autoinst_t *usb2_test_huawei_autoinst_p = &usb2_test_huawei_aut
|
||||
usb2_quirk_ioctl_t *usb2_quirk_ioctl_p = &usb2_quirk_ioctl_w;
|
||||
devclass_t usb2_devclass_ptr = NULL;
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
usb2_temp_setup_by_index_w(struct usb_device *udev, uint16_t index)
|
||||
{
|
||||
return (USB_ERR_INVAL);
|
||||
@ -68,7 +68,7 @@ usb2_quirk_ioctl_w(unsigned long cmd, caddr_t data, int fflag, struct thread *td
|
||||
return (ENOIOCTL);
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
usb2_temp_get_desc_w(struct usb_device *udev, struct usb_device_request *req, const void **pPtr, uint16_t *pLength)
|
||||
{
|
||||
/* stall */
|
||||
|
@ -35,9 +35,9 @@ struct usb_device_request;
|
||||
|
||||
/* typedefs */
|
||||
|
||||
typedef usb2_error_t (usb2_temp_setup_by_index_t)(struct usb_device *udev,
|
||||
typedef usb_error_t (usb2_temp_setup_by_index_t)(struct usb_device *udev,
|
||||
uint16_t index);
|
||||
typedef usb2_error_t (usb2_test_huawei_autoinst_t)(struct usb_device *udev,
|
||||
typedef usb_error_t (usb2_test_huawei_autoinst_t)(struct usb_device *udev,
|
||||
struct usb_attach_arg *uaa);
|
||||
typedef uint8_t (usb2_test_quirk_t)(const struct usb_lookup_info *info,
|
||||
uint16_t quirk);
|
||||
@ -47,7 +47,7 @@ typedef void (usb2_temp_unsetup_t)(struct usb_device *udev);
|
||||
|
||||
/* global function pointers */
|
||||
|
||||
extern usb2_handle_request_t *usb2_temp_get_desc_p;
|
||||
extern usb_handle_req_t *usb2_temp_get_desc_p;
|
||||
extern usb2_temp_setup_by_index_t *usb2_temp_setup_by_index_p;
|
||||
extern usb2_temp_unsetup_t *usb2_temp_unsetup_p;
|
||||
extern usb2_test_quirk_t *usb2_test_quirk_p;
|
||||
|
@ -67,7 +67,7 @@ static const char* usb_errstr_table[USB_ERR_MAX] = {
|
||||
* This function converts an USB error code into a string.
|
||||
*------------------------------------------------------------------------*/
|
||||
const char *
|
||||
usb2_errstr(usb2_error_t err)
|
||||
usb2_errstr(usb_error_t err)
|
||||
{
|
||||
return (err < USB_ERR_MAX ? usb_errstr_table[err] : "USB_ERR_UNKNOWN");
|
||||
}
|
||||
|
@ -57,21 +57,21 @@
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
static usb2_callback_t ugen_read_clear_stall_callback;
|
||||
static usb2_callback_t ugen_write_clear_stall_callback;
|
||||
static usb2_callback_t ugen_default_read_callback;
|
||||
static usb2_callback_t ugen_default_write_callback;
|
||||
static usb2_callback_t ugen_isoc_read_callback;
|
||||
static usb2_callback_t ugen_isoc_write_callback;
|
||||
static usb2_callback_t ugen_default_fs_callback;
|
||||
static usb_callback_t ugen_read_clear_stall_callback;
|
||||
static usb_callback_t ugen_write_clear_stall_callback;
|
||||
static usb_callback_t ugen_default_read_callback;
|
||||
static usb_callback_t ugen_default_write_callback;
|
||||
static usb_callback_t ugen_isoc_read_callback;
|
||||
static usb_callback_t ugen_isoc_write_callback;
|
||||
static usb_callback_t ugen_default_fs_callback;
|
||||
|
||||
static usb2_fifo_open_t ugen_open;
|
||||
static usb2_fifo_close_t ugen_close;
|
||||
static usb2_fifo_ioctl_t ugen_ioctl;
|
||||
static usb2_fifo_ioctl_t ugen_ioctl_post;
|
||||
static usb2_fifo_cmd_t ugen_start_read;
|
||||
static usb2_fifo_cmd_t ugen_start_write;
|
||||
static usb2_fifo_cmd_t ugen_stop_io;
|
||||
static usb_fifo_open_t ugen_open;
|
||||
static usb_fifo_close_t ugen_close;
|
||||
static usb_fifo_ioctl_t ugen_ioctl;
|
||||
static usb_fifo_ioctl_t ugen_ioctl_post;
|
||||
static usb_fifo_cmd_t ugen_start_read;
|
||||
static usb_fifo_cmd_t ugen_start_write;
|
||||
static usb_fifo_cmd_t ugen_stop_io;
|
||||
|
||||
static int ugen_transfer_setup(struct usb_fifo *,
|
||||
const struct usb_config *, uint8_t);
|
||||
@ -432,7 +432,7 @@ static void
|
||||
ugen_default_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb_fifo *f = xfer->priv_sc;
|
||||
usb2_frlength_t actlen;
|
||||
usb_frlength_t actlen;
|
||||
|
||||
DPRINTFN(4, "actlen=%u, aframes=%u\n", xfer->actlen, xfer->aframes);
|
||||
|
||||
@ -504,8 +504,8 @@ static void
|
||||
ugen_isoc_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb_fifo *f = xfer->priv_sc;
|
||||
usb2_frlength_t offset;
|
||||
usb2_frcount_t n;
|
||||
usb_frlength_t offset;
|
||||
usb_frcount_t n;
|
||||
|
||||
DPRINTFN(4, "actlen=%u, aframes=%u\n", xfer->actlen, xfer->aframes);
|
||||
|
||||
@ -543,9 +543,9 @@ static void
|
||||
ugen_isoc_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb_fifo *f = xfer->priv_sc;
|
||||
usb2_frlength_t actlen;
|
||||
usb2_frlength_t offset;
|
||||
usb2_frcount_t n;
|
||||
usb_frlength_t actlen;
|
||||
usb_frlength_t offset;
|
||||
usb_frcount_t n;
|
||||
|
||||
DPRINTFN(4, "actlen=%u, aframes=%u\n", xfer->actlen, xfer->aframes);
|
||||
|
||||
@ -1017,9 +1017,9 @@ ugen_fs_copy_in(struct usb_fifo *f, uint8_t ep_index)
|
||||
struct usb_fs_endpoint fs_ep;
|
||||
void *uaddr; /* userland pointer */
|
||||
void *kaddr;
|
||||
usb2_frlength_t offset;
|
||||
usb2_frlength_t rem;
|
||||
usb2_frcount_t n;
|
||||
usb_frlength_t offset;
|
||||
usb_frlength_t rem;
|
||||
usb_frcount_t n;
|
||||
uint32_t length;
|
||||
int error;
|
||||
uint8_t isread;
|
||||
@ -1194,9 +1194,9 @@ ugen_fs_copy_out(struct usb_fifo *f, uint8_t ep_index)
|
||||
struct usb_fs_endpoint *fs_ep_uptr; /* userland ptr */
|
||||
void *uaddr; /* userland ptr */
|
||||
void *kaddr;
|
||||
usb2_frlength_t offset;
|
||||
usb2_frlength_t rem;
|
||||
usb2_frcount_t n;
|
||||
usb_frlength_t offset;
|
||||
usb_frlength_t rem;
|
||||
usb_frcount_t n;
|
||||
uint32_t length;
|
||||
uint32_t temp;
|
||||
int error;
|
||||
@ -1611,7 +1611,7 @@ ugen_get_frame_size(struct usb_fifo *f, void *addr)
|
||||
static int
|
||||
ugen_set_buffer_size(struct usb_fifo *f, void *addr)
|
||||
{
|
||||
usb2_frlength_t t;
|
||||
usb_frlength_t t;
|
||||
|
||||
if (*(int *)addr < 0)
|
||||
t = 0; /* use "wMaxPacketSize" */
|
||||
|
@ -52,12 +52,12 @@ enum {
|
||||
/* function prototypes */
|
||||
|
||||
static uint8_t usb2_handle_get_stall(struct usb_device *, uint8_t);
|
||||
static usb2_error_t usb2_handle_remote_wakeup(struct usb_xfer *, uint8_t);
|
||||
static usb2_error_t usb2_handle_request(struct usb_xfer *);
|
||||
static usb2_error_t usb2_handle_set_config(struct usb_xfer *, uint8_t);
|
||||
static usb2_error_t usb2_handle_set_stall(struct usb_xfer *, uint8_t,
|
||||
static usb_error_t usb2_handle_remote_wakeup(struct usb_xfer *, uint8_t);
|
||||
static usb_error_t usb2_handle_request(struct usb_xfer *);
|
||||
static usb_error_t usb2_handle_set_config(struct usb_xfer *, uint8_t);
|
||||
static usb_error_t usb2_handle_set_stall(struct usb_xfer *, uint8_t,
|
||||
uint8_t);
|
||||
static usb2_error_t usb2_handle_iface_request(struct usb_xfer *, void **,
|
||||
static usb_error_t usb2_handle_iface_request(struct usb_xfer *, void **,
|
||||
uint16_t *, struct usb_device_request, uint16_t,
|
||||
uint8_t);
|
||||
|
||||
@ -70,7 +70,7 @@ static usb2_error_t usb2_handle_iface_request(struct usb_xfer *, void **,
|
||||
void
|
||||
usb2_handle_request_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
/* check the current transfer state */
|
||||
|
||||
@ -122,11 +122,11 @@ usb2_handle_request_callback(struct usb_xfer *xfer)
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
usb2_handle_set_config(struct usb_xfer *xfer, uint8_t conf_no)
|
||||
{
|
||||
struct usb_device *udev = xfer->xroot->udev;
|
||||
usb2_error_t err = 0;
|
||||
usb_error_t err = 0;
|
||||
|
||||
/*
|
||||
* We need to protect against other threads doing probe and
|
||||
@ -170,7 +170,7 @@ usb2_handle_set_config(struct usb_xfer *xfer, uint8_t conf_no)
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
usb2_handle_iface_request(struct usb_xfer *xfer,
|
||||
void **ppdata, uint16_t *plen,
|
||||
struct usb_device_request req, uint16_t off, uint8_t state)
|
||||
@ -333,11 +333,11 @@ usb2_handle_iface_request(struct usb_xfer *xfer,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
usb2_handle_set_stall(struct usb_xfer *xfer, uint8_t ep, uint8_t do_stall)
|
||||
{
|
||||
struct usb_device *udev = xfer->xroot->udev;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
USB_XFER_UNLOCK(xfer);
|
||||
err = usb2_set_endpoint_stall(udev,
|
||||
@ -378,7 +378,7 @@ usb2_handle_get_stall(struct usb_device *udev, uint8_t ea_val)
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
usb2_handle_remote_wakeup(struct usb_xfer *xfer, uint8_t is_on)
|
||||
{
|
||||
struct usb_device *udev;
|
||||
@ -413,7 +413,7 @@ usb2_handle_remote_wakeup(struct usb_xfer *xfer, uint8_t is_on)
|
||||
* 0: Ready to start hardware
|
||||
* Else: Stall current transfer, if any
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
usb2_handle_request(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
@ -426,7 +426,7 @@ usb2_handle_request(struct usb_xfer *xfer)
|
||||
uint16_t wValue;
|
||||
uint16_t wIndex;
|
||||
uint8_t state;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
union {
|
||||
uWord wStatus;
|
||||
uint8_t buf[2];
|
||||
|
@ -105,7 +105,7 @@ hid_clear_local(struct hid_item *c)
|
||||
* hid_start_parse
|
||||
*------------------------------------------------------------------------*/
|
||||
struct hid_data *
|
||||
hid_start_parse(const void *d, usb2_size_t len, int kindset)
|
||||
hid_start_parse(const void *d, size_t len, int kindset)
|
||||
{
|
||||
struct hid_data *s;
|
||||
|
||||
@ -491,7 +491,7 @@ hid_get_item(struct hid_data *s, struct hid_item *h)
|
||||
* hid_report_size
|
||||
*------------------------------------------------------------------------*/
|
||||
int
|
||||
hid_report_size(const void *buf, usb2_size_t len, enum hid_kind k, uint8_t *id)
|
||||
hid_report_size(const void *buf, size_t len, enum hid_kind k, uint8_t *id)
|
||||
{
|
||||
struct hid_data *d;
|
||||
struct hid_item h;
|
||||
@ -544,7 +544,7 @@ hid_report_size(const void *buf, usb2_size_t len, enum hid_kind k, uint8_t *id)
|
||||
* hid_locate
|
||||
*------------------------------------------------------------------------*/
|
||||
int
|
||||
hid_locate(const void *desc, usb2_size_t size, uint32_t u, enum hid_kind k,
|
||||
hid_locate(const void *desc, size_t size, uint32_t u, enum hid_kind k,
|
||||
uint8_t index, struct hid_location *loc, uint32_t *flags, uint8_t *id)
|
||||
{
|
||||
struct hid_data *d;
|
||||
@ -578,7 +578,7 @@ hid_locate(const void *desc, usb2_size_t size, uint32_t u, enum hid_kind k,
|
||||
* hid_get_data
|
||||
*------------------------------------------------------------------------*/
|
||||
uint32_t
|
||||
hid_get_data(const uint8_t *buf, usb2_size_t len, struct hid_location *loc)
|
||||
hid_get_data(const uint8_t *buf, size_t len, struct hid_location *loc)
|
||||
{
|
||||
uint32_t hpos = loc->pos;
|
||||
uint32_t hsize = loc->size;
|
||||
@ -621,7 +621,7 @@ hid_get_data(const uint8_t *buf, usb2_size_t len, struct hid_location *loc)
|
||||
* hid_is_collection
|
||||
*------------------------------------------------------------------------*/
|
||||
int
|
||||
hid_is_collection(const void *desc, usb2_size_t size, uint32_t usage)
|
||||
hid_is_collection(const void *desc, size_t size, uint32_t usage)
|
||||
{
|
||||
struct hid_data *hd;
|
||||
struct hid_item hi;
|
||||
@ -681,14 +681,14 @@ hid_get_descriptor_from_usb(struct usb_config_descriptor *cd,
|
||||
* NULL: Failure.
|
||||
* Else: Success. The pointer should eventually be passed to free().
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_get_hid_desc(struct usb_device *udev, struct mtx *mtx,
|
||||
void **descp, uint16_t *sizep,
|
||||
usb2_malloc_type mem, uint8_t iface_index)
|
||||
struct malloc_type *mem, uint8_t iface_index)
|
||||
{
|
||||
struct usb_interface *iface = usb2_get_iface(udev, iface_index);
|
||||
struct usb_hid_descriptor *hid;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
if ((iface == NULL) || (iface->idesc == NULL)) {
|
||||
return (USB_ERR_INVAL);
|
||||
|
@ -74,22 +74,22 @@ struct hid_item {
|
||||
|
||||
/* prototypes from "usb2_hid.c" */
|
||||
|
||||
struct hid_data *hid_start_parse(const void *d, usb2_size_t len, int kindset);
|
||||
struct hid_data *hid_start_parse(const void *d, size_t len, int kindset);
|
||||
void hid_end_parse(struct hid_data *s);
|
||||
int hid_get_item(struct hid_data *s, struct hid_item *h);
|
||||
int hid_report_size(const void *buf, usb2_size_t len, enum hid_kind k,
|
||||
int hid_report_size(const void *buf, size_t len, enum hid_kind k,
|
||||
uint8_t *id);
|
||||
int hid_locate(const void *desc, usb2_size_t size, uint32_t usage,
|
||||
int hid_locate(const void *desc, size_t size, uint32_t usage,
|
||||
enum hid_kind kind, uint8_t index, struct hid_location *loc,
|
||||
uint32_t *flags, uint8_t *id);
|
||||
uint32_t hid_get_data(const uint8_t *buf, usb2_size_t len,
|
||||
uint32_t hid_get_data(const uint8_t *buf, size_t len,
|
||||
struct hid_location *loc);
|
||||
int hid_is_collection(const void *desc, usb2_size_t size, uint32_t usage);
|
||||
int hid_is_collection(const void *desc, size_t size, uint32_t usage);
|
||||
struct usb_hid_descriptor *hid_get_descriptor_from_usb(
|
||||
struct usb_config_descriptor *cd,
|
||||
struct usb_interface_descriptor *id);
|
||||
usb2_error_t usb2_req_get_hid_desc(struct usb_device *udev, struct mtx *mtx,
|
||||
void **descp, uint16_t *sizep, usb2_malloc_type mem,
|
||||
usb_error_t usb2_req_get_hid_desc(struct usb_device *udev, struct mtx *mtx,
|
||||
void **descp, uint16_t *sizep, struct malloc_type *mem,
|
||||
uint8_t iface_index);
|
||||
|
||||
#endif /* _USB2_CORE_HID_H_ */
|
||||
|
@ -100,7 +100,7 @@ static bus_driver_added_t uhub_driver_added;
|
||||
static bus_child_location_str_t uhub_child_location_string;
|
||||
static bus_child_pnpinfo_str_t uhub_child_pnpinfo_string;
|
||||
|
||||
static usb2_callback_t uhub_intr_callback;
|
||||
static usb_callback_t uhub_intr_callback;
|
||||
|
||||
static void usb2_dev_resume_peer(struct usb_device *udev);
|
||||
static void usb2_dev_suspend_peer(struct usb_device *udev);
|
||||
@ -191,13 +191,13 @@ uhub_intr_callback(struct usb_xfer *xfer)
|
||||
* 0: Success
|
||||
* Else: A control transaction failed
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
uhub_explore_sub(struct uhub_softc *sc, struct usb_port *up)
|
||||
{
|
||||
struct usb_bus *bus;
|
||||
struct usb_device *child;
|
||||
uint8_t refcount;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
bus = sc->sc_udev->bus;
|
||||
err = 0;
|
||||
@ -238,11 +238,11 @@ uhub_explore_sub(struct uhub_softc *sc, struct usb_port *up)
|
||||
/*------------------------------------------------------------------------*
|
||||
* uhub_read_port_status - factored out code
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
uhub_read_port_status(struct uhub_softc *sc, uint8_t portno)
|
||||
{
|
||||
struct usb_port_status ps;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
err = usb2_req_get_port_status(
|
||||
sc->sc_udev, NULL, &ps, portno);
|
||||
@ -268,14 +268,14 @@ uhub_read_port_status(struct uhub_softc *sc, uint8_t portno)
|
||||
* 0: Success
|
||||
* Else: A control transaction failed
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
uhub_reattach_port(struct uhub_softc *sc, uint8_t portno)
|
||||
{
|
||||
struct usb_device *child;
|
||||
struct usb_device *udev;
|
||||
enum usb_dev_speed speed;
|
||||
enum usb_hc_mode mode;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint8_t timeout;
|
||||
|
||||
DPRINTF("reattaching port %d\n", portno);
|
||||
@ -446,13 +446,13 @@ uhub_reattach_port(struct uhub_softc *sc, uint8_t portno)
|
||||
* 0: Success
|
||||
* Else: A control transaction failed
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
uhub_suspend_resume_port(struct uhub_softc *sc, uint8_t portno)
|
||||
{
|
||||
struct usb_device *child;
|
||||
struct usb_device *udev;
|
||||
uint8_t is_suspend;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
DPRINTF("port %d\n", portno);
|
||||
|
||||
@ -524,13 +524,13 @@ uhub_root_intr(struct usb_bus *bus, const uint8_t *ptr, uint8_t len)
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
uhub_explore(struct usb_device *udev)
|
||||
{
|
||||
struct usb_hub *hub;
|
||||
struct uhub_softc *sc;
|
||||
struct usb_port *up;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint8_t portno;
|
||||
uint8_t x;
|
||||
|
||||
@ -667,7 +667,7 @@ uhub_attach(device_t dev)
|
||||
uint8_t portno;
|
||||
uint8_t removable;
|
||||
uint8_t iface_index;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
sc->sc_udev = udev;
|
||||
sc->sc_dev = dev;
|
||||
@ -1058,9 +1058,9 @@ uhub_child_pnpinfo_string(device_t parent, device_t child,
|
||||
* The best Transaction Translation slot for an interrupt endpoint.
|
||||
*------------------------------------------------------------------------*/
|
||||
static uint8_t
|
||||
usb2_intr_find_best_slot(usb2_size_t *ptr, uint8_t start, uint8_t end)
|
||||
usb2_intr_find_best_slot(size_t *ptr, uint8_t start, uint8_t end)
|
||||
{
|
||||
usb2_size_t max = 0 - 1;
|
||||
size_t max = 0 - 1;
|
||||
uint8_t x;
|
||||
uint8_t y;
|
||||
|
||||
@ -1475,7 +1475,7 @@ usb2_bus_power_update(struct usb_bus *bus)
|
||||
void
|
||||
usb2_transfer_power_ref(struct usb_xfer *xfer, int val)
|
||||
{
|
||||
static const usb2_power_mask_t power_mask[4] = {
|
||||
static const usb_power_mask_t power_mask[4] = {
|
||||
[UE_CONTROL] = USB_HW_POWER_CONTROL,
|
||||
[UE_BULK] = USB_HW_POWER_BULK,
|
||||
[UE_INTERRUPT] = USB_HW_POWER_INTERRUPT,
|
||||
@ -1555,10 +1555,10 @@ void
|
||||
usb2_bus_powerd(struct usb_bus *bus)
|
||||
{
|
||||
struct usb_device *udev;
|
||||
usb2_ticks_t temp;
|
||||
usb2_ticks_t limit;
|
||||
usb2_ticks_t mintime;
|
||||
usb2_size_t type_refs[5];
|
||||
usb_ticks_t temp;
|
||||
usb_ticks_t limit;
|
||||
usb_ticks_t mintime;
|
||||
size_t type_refs[5];
|
||||
uint8_t x;
|
||||
uint8_t rem_wakeup;
|
||||
|
||||
@ -1846,7 +1846,7 @@ usb2_dev_suspend_peer(struct usb_device *udev)
|
||||
USB_BUS_UNLOCK(udev->bus);
|
||||
|
||||
if (udev->bus->methods->device_suspend != NULL) {
|
||||
usb2_timeout_t temp;
|
||||
usb_timeout_t temp;
|
||||
|
||||
/* suspend device on the USB controller */
|
||||
(udev->bus->methods->device_suspend) (udev);
|
||||
|
@ -55,9 +55,9 @@ struct usb_hub {
|
||||
struct usb_fs_isoc_schedule fs_isoc_schedule[USB_ISOC_TIME_MAX];
|
||||
#endif
|
||||
struct usb_device *hubudev; /* the HUB device */
|
||||
usb2_error_t (*explore) (struct usb_device *hub);
|
||||
usb_error_t (*explore) (struct usb_device *hub);
|
||||
void *hubsoftc;
|
||||
usb2_size_t uframe_usage[USB_HS_MICRO_FRAMES_MAX];
|
||||
size_t uframe_usage[USB_HS_MICRO_FRAMES_MAX];
|
||||
uint16_t portpower; /* mA per USB port */
|
||||
uint8_t isoc_last_time;
|
||||
uint8_t nports;
|
||||
|
@ -42,7 +42,7 @@
|
||||
* Else: Pointer to matching entry.
|
||||
*------------------------------------------------------------------------*/
|
||||
const struct usb_device_id *
|
||||
usb2_lookup_id_by_info(const struct usb_device_id *id, usb2_size_t sizeof_id,
|
||||
usb2_lookup_id_by_info(const struct usb_device_id *id, size_t sizeof_id,
|
||||
const struct usb_lookup_info *info)
|
||||
{
|
||||
const struct usb_device_id *id_end;
|
||||
@ -121,7 +121,7 @@ usb2_lookup_id_by_info(const struct usb_device_id *id, usb2_size_t sizeof_id,
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
int
|
||||
usb2_lookup_id_by_uaa(const struct usb_device_id *id, usb2_size_t sizeof_id,
|
||||
usb2_lookup_id_by_uaa(const struct usb_device_id *id, size_t sizeof_id,
|
||||
struct usb_attach_arg *uaa)
|
||||
{
|
||||
id = usb2_lookup_id_by_info(id, sizeof_id, &uaa->info);
|
||||
|
@ -114,9 +114,9 @@ struct usb_device_id {
|
||||
(((const uint8_t *)((did)->driver_info)) - ((const uint8_t *)0))
|
||||
|
||||
const struct usb_device_id *usb2_lookup_id_by_info(
|
||||
const struct usb_device_id *id, usb2_size_t sizeof_id,
|
||||
const struct usb_device_id *id, size_t sizeof_id,
|
||||
const struct usb_lookup_info *info);
|
||||
int usb2_lookup_id_by_uaa(const struct usb_device_id *id,
|
||||
usb2_size_t sizeof_id, struct usb_attach_arg *uaa);
|
||||
size_t sizeof_id, struct usb_attach_arg *uaa);
|
||||
|
||||
#endif /* _USB2_LOOKUP_H_ */
|
||||
|
@ -36,12 +36,12 @@
|
||||
*------------------------------------------------------------------------*/
|
||||
void *
|
||||
usb2_alloc_mbufs(struct malloc_type *type, struct usb_ifqueue *ifq,
|
||||
usb2_size_t block_size, uint16_t nblocks)
|
||||
size_t block_size, uint16_t nblocks)
|
||||
{
|
||||
struct usb_mbuf *m_ptr;
|
||||
uint8_t *data_ptr;
|
||||
void *free_ptr = NULL;
|
||||
usb2_size_t alloc_size;
|
||||
size_t alloc_size;
|
||||
|
||||
/* align data */
|
||||
block_size += ((-block_size) & (USB_HOST_ALIGN - 1));
|
||||
|
@ -37,8 +37,8 @@ struct usb_mbuf {
|
||||
struct usb_mbuf *usb2_nextpkt;
|
||||
struct usb_mbuf *usb2_next;
|
||||
|
||||
usb2_size_t cur_data_len;
|
||||
usb2_size_t max_data_len;
|
||||
size_t cur_data_len;
|
||||
size_t max_data_len;
|
||||
uint8_t last_packet:1;
|
||||
uint8_t unused:7;
|
||||
};
|
||||
@ -51,8 +51,8 @@ struct usb_ifqueue {
|
||||
struct usb_mbuf *ifq_head;
|
||||
struct usb_mbuf *ifq_tail;
|
||||
|
||||
usb2_size_t ifq_len;
|
||||
usb2_size_t ifq_maxlen;
|
||||
size_t ifq_len;
|
||||
size_t ifq_maxlen;
|
||||
};
|
||||
|
||||
#define USB_IF_ENQUEUE(ifq, m) do { \
|
||||
@ -97,6 +97,6 @@ struct usb_ifqueue {
|
||||
|
||||
/* prototypes */
|
||||
void *usb2_alloc_mbufs(struct malloc_type *type, struct usb_ifqueue *ifq,
|
||||
usb2_size_t block_size, uint16_t nblocks);
|
||||
size_t block_size, uint16_t nblocks);
|
||||
|
||||
#endif /* _USB2_MBUF_H_ */
|
||||
|
@ -109,10 +109,10 @@ struct bbb_transfer {
|
||||
|
||||
uint8_t *data_ptr;
|
||||
|
||||
usb2_size_t data_len; /* bytes */
|
||||
usb2_size_t data_rem; /* bytes */
|
||||
usb2_timeout_t data_timeout; /* ms */
|
||||
usb2_frlength_t actlen; /* bytes */
|
||||
size_t data_len; /* bytes */
|
||||
size_t data_rem; /* bytes */
|
||||
usb_timeout_t data_timeout; /* ms */
|
||||
usb_frlength_t actlen; /* bytes */
|
||||
|
||||
uint8_t cmd_len; /* bytes */
|
||||
uint8_t dir;
|
||||
@ -124,12 +124,12 @@ struct bbb_transfer {
|
||||
uint8_t buffer[256];
|
||||
};
|
||||
|
||||
static usb2_callback_t bbb_command_callback;
|
||||
static usb2_callback_t bbb_data_read_callback;
|
||||
static usb2_callback_t bbb_data_rd_cs_callback;
|
||||
static usb2_callback_t bbb_data_write_callback;
|
||||
static usb2_callback_t bbb_data_wr_cs_callback;
|
||||
static usb2_callback_t bbb_status_callback;
|
||||
static usb_callback_t bbb_command_callback;
|
||||
static usb_callback_t bbb_data_read_callback;
|
||||
static usb_callback_t bbb_data_rd_cs_callback;
|
||||
static usb_callback_t bbb_data_write_callback;
|
||||
static usb_callback_t bbb_data_wr_cs_callback;
|
||||
static usb_callback_t bbb_status_callback;
|
||||
|
||||
static const struct usb_config bbb_config[ST_MAX] = {
|
||||
|
||||
@ -286,7 +286,7 @@ static void
|
||||
bbb_data_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct bbb_transfer *sc = xfer->priv_sc;
|
||||
usb2_frlength_t max_bulk = xfer->max_data_length;
|
||||
usb_frlength_t max_bulk = xfer->max_data_length;
|
||||
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
case USB_ST_TRANSFERRED:
|
||||
@ -337,7 +337,7 @@ static void
|
||||
bbb_data_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct bbb_transfer *sc = xfer->priv_sc;
|
||||
usb2_frlength_t max_bulk = xfer->max_data_length;
|
||||
usb_frlength_t max_bulk = xfer->max_data_length;
|
||||
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
case USB_ST_TRANSFERRED:
|
||||
@ -435,8 +435,8 @@ bbb_status_callback(struct usb_xfer *xfer)
|
||||
*------------------------------------------------------------------------*/
|
||||
static uint8_t
|
||||
bbb_command_start(struct bbb_transfer *sc, uint8_t dir, uint8_t lun,
|
||||
void *data_ptr, usb2_size_t data_len, uint8_t cmd_len,
|
||||
usb2_timeout_t data_timeout)
|
||||
void *data_ptr, size_t data_len, uint8_t cmd_len,
|
||||
usb_timeout_t data_timeout)
|
||||
{
|
||||
sc->lun = lun;
|
||||
sc->dir = data_len ? dir : DIR_NONE;
|
||||
@ -462,13 +462,13 @@ bbb_command_start(struct bbb_transfer *sc, uint8_t dir, uint8_t lun,
|
||||
* 0: This interface is an auto install disk (CD-ROM)
|
||||
* Else: Not an auto install disk.
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_test_autoinstall(struct usb_device *udev, uint8_t iface_index,
|
||||
uint8_t do_eject)
|
||||
{
|
||||
struct usb_interface *iface;
|
||||
struct usb_interface_descriptor *id;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint8_t timeout;
|
||||
uint8_t sid_type;
|
||||
struct bbb_transfer *sc;
|
||||
|
@ -27,7 +27,7 @@
|
||||
#ifndef _USB2_MSCTEST_H_
|
||||
#define _USB2_MSCTEST_H_
|
||||
|
||||
usb2_error_t usb2_test_autoinstall(struct usb_device *udev,
|
||||
usb_error_t usb2_test_autoinstall(struct usb_device *udev,
|
||||
uint8_t iface_index, uint8_t do_eject);
|
||||
|
||||
#endif /* _USB2_MSCTEST_H_ */
|
||||
|
@ -243,7 +243,7 @@ usb2_proc_msignal(struct usb_process *up, void *_pm0, void *_pm1)
|
||||
struct usb_proc_msg *pm0 = _pm0;
|
||||
struct usb_proc_msg *pm1 = _pm1;
|
||||
struct usb_proc_msg *pm2;
|
||||
usb2_size_t d;
|
||||
size_t d;
|
||||
uint8_t t;
|
||||
|
||||
/* check if gone, return dummy value */
|
||||
|
@ -43,15 +43,15 @@ struct usb_proc_msg;
|
||||
|
||||
/* typedefs */
|
||||
|
||||
typedef void (usb2_proc_callback_t)(struct usb_proc_msg *hdr);
|
||||
typedef void (usb_proc_callback_t)(struct usb_proc_msg *hdr);
|
||||
|
||||
/*
|
||||
* The following structure defines the USB process message header.
|
||||
*/
|
||||
struct usb_proc_msg {
|
||||
TAILQ_ENTRY(usb_proc_msg) pm_qentry;
|
||||
usb2_proc_callback_t *pm_callback;
|
||||
usb2_size_t pm_num;
|
||||
usb_proc_callback_t *pm_callback;
|
||||
size_t pm_num;
|
||||
};
|
||||
|
||||
/*
|
||||
@ -66,7 +66,7 @@ struct usb_process {
|
||||
struct thread *up_curtd;
|
||||
struct mtx *up_mtx;
|
||||
|
||||
usb2_size_t up_msg_num;
|
||||
size_t up_msg_num;
|
||||
|
||||
uint8_t up_prio;
|
||||
uint8_t up_gone;
|
||||
|
@ -172,7 +172,7 @@ usb2_do_clear_stall_callback(struct usb_xfer *xfer)
|
||||
USB_BUS_UNLOCK(udev->bus);
|
||||
}
|
||||
|
||||
static usb2_handle_request_t *
|
||||
static usb_handle_req_t *
|
||||
usb2_get_hr_func(struct usb_device *udev)
|
||||
{
|
||||
/* figure out if there is a Handle Request function */
|
||||
@ -239,18 +239,18 @@ usb2_get_hr_func(struct usb_device *udev)
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_do_request_flags(struct usb_device *udev, struct mtx *mtx,
|
||||
struct usb_device_request *req, void *data, uint16_t flags,
|
||||
uint16_t *actlen, usb2_timeout_t timeout)
|
||||
uint16_t *actlen, usb_timeout_t timeout)
|
||||
{
|
||||
usb2_handle_request_t *hr_func;
|
||||
usb_handle_req_t *hr_func;
|
||||
struct usb_xfer *xfer;
|
||||
const void *desc;
|
||||
int err = 0;
|
||||
usb2_ticks_t start_ticks;
|
||||
usb2_ticks_t delta_ticks;
|
||||
usb2_ticks_t max_ticks;
|
||||
usb_ticks_t start_ticks;
|
||||
usb_ticks_t delta_ticks;
|
||||
usb_ticks_t max_ticks;
|
||||
uint16_t length;
|
||||
uint16_t temp;
|
||||
|
||||
@ -519,7 +519,7 @@ usb2_do_request_flags(struct usb_device *udev, struct mtx *mtx,
|
||||
if (mtx) {
|
||||
mtx_lock(mtx);
|
||||
}
|
||||
return ((usb2_error_t)err);
|
||||
return ((usb_error_t)err);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
@ -532,12 +532,12 @@ usb2_do_request_flags(struct usb_device *udev, struct mtx *mtx,
|
||||
* is assumed that the mutex associated with the process is locked
|
||||
* when calling this function.
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_do_request_proc(struct usb_device *udev, struct usb_process *pproc,
|
||||
struct usb_device_request *req, void *data, uint16_t flags,
|
||||
uint16_t *actlen, usb2_timeout_t timeout)
|
||||
uint16_t *actlen, usb_timeout_t timeout)
|
||||
{
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint16_t len;
|
||||
|
||||
/* get request data length */
|
||||
@ -576,11 +576,11 @@ usb2_do_request_proc(struct usb_device *udev, struct usb_process *pproc,
|
||||
* Else: Failure. No USB device is present and the USB port should be
|
||||
* disabled.
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_reset_port(struct usb_device *udev, struct mtx *mtx, uint8_t port)
|
||||
{
|
||||
struct usb_port_status ps;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint16_t n;
|
||||
|
||||
#if USB_DEBUG
|
||||
@ -684,7 +684,7 @@ usb2_req_reset_port(struct usb_device *udev, struct mtx *mtx, uint8_t port)
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_get_desc(struct usb_device *udev,
|
||||
struct mtx *mtx, uint16_t *actlen, void *desc,
|
||||
uint16_t min_len, uint16_t max_len,
|
||||
@ -693,7 +693,7 @@ usb2_req_get_desc(struct usb_device *udev,
|
||||
{
|
||||
struct usb_device_request req;
|
||||
uint8_t *buf;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
DPRINTFN(4, "id=%d, type=%d, index=%d, max_len=%d\n",
|
||||
id, type, index, max_len);
|
||||
@ -775,7 +775,7 @@ usb2_req_get_desc(struct usb_device *udev,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_get_string_any(struct usb_device *udev, struct mtx *mtx, char *buf,
|
||||
uint16_t len, uint8_t string_index)
|
||||
{
|
||||
@ -785,7 +785,7 @@ usb2_req_get_string_any(struct usb_device *udev, struct mtx *mtx, char *buf,
|
||||
uint16_t n;
|
||||
uint16_t c;
|
||||
uint8_t swap;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
if (len == 0) {
|
||||
/* should not happen */
|
||||
@ -870,7 +870,7 @@ usb2_req_get_string_any(struct usb_device *udev, struct mtx *mtx, char *buf,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_get_string_desc(struct usb_device *udev, struct mtx *mtx, void *sdesc,
|
||||
uint16_t max_len, uint16_t lang_id,
|
||||
uint8_t string_index)
|
||||
@ -890,15 +890,15 @@ usb2_req_get_string_desc(struct usb_device *udev, struct mtx *mtx, void *sdesc,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_get_descriptor_ptr(struct usb_device *udev,
|
||||
struct usb_config_descriptor **ppcd, uint16_t wValue)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_handle_request_t *hr_func;
|
||||
usb_handle_req_t *hr_func;
|
||||
const void *ptr;
|
||||
uint16_t len;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
req.bmRequestType = UT_READ_DEVICE;
|
||||
req.bRequest = UR_GET_DESCRIPTOR;
|
||||
@ -936,11 +936,11 @@ usb2_req_get_descriptor_ptr(struct usb_device *udev,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_get_config_desc(struct usb_device *udev, struct mtx *mtx,
|
||||
struct usb_config_descriptor *d, uint8_t conf_index)
|
||||
{
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
DPRINTFN(4, "confidx=%d\n", conf_index);
|
||||
|
||||
@ -967,7 +967,7 @@ usb2_req_get_config_desc(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_get_config_desc_full(struct usb_device *udev, struct mtx *mtx,
|
||||
struct usb_config_descriptor **ppcd, struct malloc_type *mtype,
|
||||
uint8_t index)
|
||||
@ -975,7 +975,7 @@ usb2_req_get_config_desc_full(struct usb_device *udev, struct mtx *mtx,
|
||||
struct usb_config_descriptor cd;
|
||||
struct usb_config_descriptor *cdesc;
|
||||
uint16_t len;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
DPRINTFN(4, "index=%d\n", index);
|
||||
|
||||
@ -1016,7 +1016,7 @@ usb2_req_get_config_desc_full(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_get_device_desc(struct usb_device *udev, struct mtx *mtx,
|
||||
struct usb_device_descriptor *d)
|
||||
{
|
||||
@ -1032,7 +1032,7 @@ usb2_req_get_device_desc(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_get_alt_interface_no(struct usb_device *udev, struct mtx *mtx,
|
||||
uint8_t *alt_iface_no, uint8_t iface_index)
|
||||
{
|
||||
@ -1058,7 +1058,7 @@ usb2_req_get_alt_interface_no(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_set_alt_interface_no(struct usb_device *udev, struct mtx *mtx,
|
||||
uint8_t iface_index, uint8_t alt_no)
|
||||
{
|
||||
@ -1085,7 +1085,7 @@ usb2_req_set_alt_interface_no(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_get_device_status(struct usb_device *udev, struct mtx *mtx,
|
||||
struct usb_status *st)
|
||||
{
|
||||
@ -1106,7 +1106,7 @@ usb2_req_get_device_status(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_get_hub_descriptor(struct usb_device *udev, struct mtx *mtx,
|
||||
struct usb_hub_descriptor *hd, uint8_t nports)
|
||||
{
|
||||
@ -1128,7 +1128,7 @@ usb2_req_get_hub_descriptor(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_get_hub_status(struct usb_device *udev, struct mtx *mtx,
|
||||
struct usb_hub_status *st)
|
||||
{
|
||||
@ -1152,7 +1152,7 @@ usb2_req_get_hub_status(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_set_address(struct usb_device *udev, struct mtx *mtx, uint16_t addr)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
@ -1177,7 +1177,7 @@ usb2_req_set_address(struct usb_device *udev, struct mtx *mtx, uint16_t addr)
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_get_port_status(struct usb_device *udev, struct mtx *mtx,
|
||||
struct usb_port_status *ps, uint8_t port)
|
||||
{
|
||||
@ -1199,7 +1199,7 @@ usb2_req_get_port_status(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_clear_hub_feature(struct usb_device *udev, struct mtx *mtx,
|
||||
uint16_t sel)
|
||||
{
|
||||
@ -1220,7 +1220,7 @@ usb2_req_clear_hub_feature(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_set_hub_feature(struct usb_device *udev, struct mtx *mtx,
|
||||
uint16_t sel)
|
||||
{
|
||||
@ -1241,7 +1241,7 @@ usb2_req_set_hub_feature(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_clear_port_feature(struct usb_device *udev, struct mtx *mtx,
|
||||
uint8_t port, uint16_t sel)
|
||||
{
|
||||
@ -1263,7 +1263,7 @@ usb2_req_clear_port_feature(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_set_port_feature(struct usb_device *udev, struct mtx *mtx,
|
||||
uint8_t port, uint16_t sel)
|
||||
{
|
||||
@ -1285,7 +1285,7 @@ usb2_req_set_port_feature(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_set_protocol(struct usb_device *udev, struct mtx *mtx,
|
||||
uint8_t iface_index, uint16_t report)
|
||||
{
|
||||
@ -1314,7 +1314,7 @@ usb2_req_set_protocol(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_set_report(struct usb_device *udev, struct mtx *mtx, void *data, uint16_t len,
|
||||
uint8_t iface_index, uint8_t type, uint8_t id)
|
||||
{
|
||||
@ -1342,7 +1342,7 @@ usb2_req_set_report(struct usb_device *udev, struct mtx *mtx, void *data, uint16
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_get_report(struct usb_device *udev, struct mtx *mtx, void *data,
|
||||
uint16_t len, uint8_t iface_index, uint8_t type, uint8_t id)
|
||||
{
|
||||
@ -1370,7 +1370,7 @@ usb2_req_get_report(struct usb_device *udev, struct mtx *mtx, void *data,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_set_idle(struct usb_device *udev, struct mtx *mtx,
|
||||
uint8_t iface_index, uint8_t duration, uint8_t id)
|
||||
{
|
||||
@ -1398,7 +1398,7 @@ usb2_req_set_idle(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_get_report_descriptor(struct usb_device *udev, struct mtx *mtx,
|
||||
void *d, uint16_t size, uint8_t iface_index)
|
||||
{
|
||||
@ -1428,7 +1428,7 @@ usb2_req_get_report_descriptor(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_set_config(struct usb_device *udev, struct mtx *mtx, uint8_t conf)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
@ -1453,7 +1453,7 @@ usb2_req_set_config(struct usb_device *udev, struct mtx *mtx, uint8_t conf)
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_get_config(struct usb_device *udev, struct mtx *mtx, uint8_t *pconf)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
@ -1477,11 +1477,11 @@ usb2_req_get_config(struct usb_device *udev, struct mtx *mtx, uint8_t *pconf)
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_re_enumerate(struct usb_device *udev, struct mtx *mtx)
|
||||
{
|
||||
struct usb_device *parent_hub;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
uint8_t old_addr;
|
||||
uint8_t do_retry = 1;
|
||||
|
||||
@ -1562,7 +1562,7 @@ usb2_req_re_enumerate(struct usb_device *udev, struct mtx *mtx)
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_clear_device_feature(struct usb_device *udev, struct mtx *mtx,
|
||||
uint16_t sel)
|
||||
{
|
||||
@ -1583,7 +1583,7 @@ usb2_req_clear_device_feature(struct usb_device *udev, struct mtx *mtx,
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_req_set_device_feature(struct usb_device *udev, struct mtx *mtx,
|
||||
uint16_t sel)
|
||||
{
|
||||
|
@ -29,76 +29,76 @@
|
||||
|
||||
struct usb_process;
|
||||
|
||||
usb2_error_t usb2_do_request_flags(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_do_request_flags(struct usb_device *udev, struct mtx *mtx,
|
||||
struct usb_device_request *req, void *data, uint16_t flags,
|
||||
uint16_t *actlen, usb2_timeout_t timeout);
|
||||
usb2_error_t usb2_do_request_proc(struct usb_device *udev, struct usb_process *pproc,
|
||||
uint16_t *actlen, usb_timeout_t timeout);
|
||||
usb_error_t usb2_do_request_proc(struct usb_device *udev, struct usb_process *pproc,
|
||||
struct usb_device_request *req, void *data, uint16_t flags,
|
||||
uint16_t *actlen, usb2_timeout_t timeout);
|
||||
usb2_error_t usb2_req_clear_hub_feature(struct usb_device *udev,
|
||||
uint16_t *actlen, usb_timeout_t timeout);
|
||||
usb_error_t usb2_req_clear_hub_feature(struct usb_device *udev,
|
||||
struct mtx *mtx, uint16_t sel);
|
||||
usb2_error_t usb2_req_clear_port_feature(struct usb_device *udev,
|
||||
usb_error_t usb2_req_clear_port_feature(struct usb_device *udev,
|
||||
struct mtx *mtx, uint8_t port, uint16_t sel);
|
||||
usb2_error_t usb2_req_get_alt_interface_no(struct usb_device *udev,
|
||||
usb_error_t usb2_req_get_alt_interface_no(struct usb_device *udev,
|
||||
struct mtx *mtx, uint8_t *alt_iface_no,
|
||||
uint8_t iface_index);
|
||||
usb2_error_t usb2_req_get_config(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_req_get_config(struct usb_device *udev, struct mtx *mtx,
|
||||
uint8_t *pconf);
|
||||
usb2_error_t usb2_req_get_descriptor_ptr(struct usb_device *udev,
|
||||
usb_error_t usb2_req_get_descriptor_ptr(struct usb_device *udev,
|
||||
struct usb_config_descriptor **ppcd, uint16_t wValue);
|
||||
usb2_error_t usb2_req_get_config_desc(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_req_get_config_desc(struct usb_device *udev, struct mtx *mtx,
|
||||
struct usb_config_descriptor *d, uint8_t conf_index);
|
||||
usb2_error_t usb2_req_get_config_desc_full(struct usb_device *udev,
|
||||
usb_error_t usb2_req_get_config_desc_full(struct usb_device *udev,
|
||||
struct mtx *mtx, struct usb_config_descriptor **ppcd,
|
||||
struct malloc_type *mtype, uint8_t conf_index);
|
||||
usb2_error_t usb2_req_get_desc(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_req_get_desc(struct usb_device *udev, struct mtx *mtx,
|
||||
uint16_t *actlen, void *desc, uint16_t min_len,
|
||||
uint16_t max_len, uint16_t id, uint8_t type,
|
||||
uint8_t index, uint8_t retries);
|
||||
usb2_error_t usb2_req_get_device_desc(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_req_get_device_desc(struct usb_device *udev, struct mtx *mtx,
|
||||
struct usb_device_descriptor *d);
|
||||
usb2_error_t usb2_req_get_device_status(struct usb_device *udev,
|
||||
usb_error_t usb2_req_get_device_status(struct usb_device *udev,
|
||||
struct mtx *mtx, struct usb_status *st);
|
||||
usb2_error_t usb2_req_get_hub_descriptor(struct usb_device *udev,
|
||||
usb_error_t usb2_req_get_hub_descriptor(struct usb_device *udev,
|
||||
struct mtx *mtx, struct usb_hub_descriptor *hd,
|
||||
uint8_t nports);
|
||||
usb2_error_t usb2_req_get_hub_status(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_req_get_hub_status(struct usb_device *udev, struct mtx *mtx,
|
||||
struct usb_hub_status *st);
|
||||
usb2_error_t usb2_req_get_port_status(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_req_get_port_status(struct usb_device *udev, struct mtx *mtx,
|
||||
struct usb_port_status *ps, uint8_t port);
|
||||
usb2_error_t usb2_req_get_report(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_req_get_report(struct usb_device *udev, struct mtx *mtx,
|
||||
void *data, uint16_t len, uint8_t iface_index, uint8_t type,
|
||||
uint8_t id);
|
||||
usb2_error_t usb2_req_get_report_descriptor(struct usb_device *udev,
|
||||
usb_error_t usb2_req_get_report_descriptor(struct usb_device *udev,
|
||||
struct mtx *mtx, void *d, uint16_t size,
|
||||
uint8_t iface_index);
|
||||
usb2_error_t usb2_req_get_string_any(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_req_get_string_any(struct usb_device *udev, struct mtx *mtx,
|
||||
char *buf, uint16_t len, uint8_t string_index);
|
||||
usb2_error_t usb2_req_get_string_desc(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_req_get_string_desc(struct usb_device *udev, struct mtx *mtx,
|
||||
void *sdesc, uint16_t max_len, uint16_t lang_id,
|
||||
uint8_t string_index);
|
||||
usb2_error_t usb2_req_reset_port(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_req_reset_port(struct usb_device *udev, struct mtx *mtx,
|
||||
uint8_t port);
|
||||
usb2_error_t usb2_req_set_address(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_req_set_address(struct usb_device *udev, struct mtx *mtx,
|
||||
uint16_t addr);
|
||||
usb2_error_t usb2_req_set_alt_interface_no(struct usb_device *udev,
|
||||
usb_error_t usb2_req_set_alt_interface_no(struct usb_device *udev,
|
||||
struct mtx *mtx, uint8_t iface_index, uint8_t alt_no);
|
||||
usb2_error_t usb2_req_set_config(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_req_set_config(struct usb_device *udev, struct mtx *mtx,
|
||||
uint8_t conf);
|
||||
usb2_error_t usb2_req_set_hub_feature(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_req_set_hub_feature(struct usb_device *udev, struct mtx *mtx,
|
||||
uint16_t sel);
|
||||
usb2_error_t usb2_req_set_idle(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_req_set_idle(struct usb_device *udev, struct mtx *mtx,
|
||||
uint8_t iface_index, uint8_t duration, uint8_t id);
|
||||
usb2_error_t usb2_req_set_port_feature(struct usb_device *udev,
|
||||
usb_error_t usb2_req_set_port_feature(struct usb_device *udev,
|
||||
struct mtx *mtx, uint8_t port, uint16_t sel);
|
||||
usb2_error_t usb2_req_set_protocol(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_req_set_protocol(struct usb_device *udev, struct mtx *mtx,
|
||||
uint8_t iface_index, uint16_t report);
|
||||
usb2_error_t usb2_req_set_report(struct usb_device *udev, struct mtx *mtx,
|
||||
usb_error_t usb2_req_set_report(struct usb_device *udev, struct mtx *mtx,
|
||||
void *data, uint16_t len, uint8_t iface_index,
|
||||
uint8_t type, uint8_t id);
|
||||
usb2_error_t usb2_req_re_enumerate(struct usb_device *udev, struct mtx *mtx);
|
||||
usb2_error_t usb2_req_clear_device_feature(struct usb_device *udev, struct mtx *mtx, uint16_t sel);
|
||||
usb2_error_t usb2_req_set_device_feature(struct usb_device *udev, struct mtx *mtx, uint16_t sel);
|
||||
usb_error_t usb2_req_re_enumerate(struct usb_device *udev, struct mtx *mtx);
|
||||
usb_error_t usb2_req_clear_device_feature(struct usb_device *udev, struct mtx *mtx, uint16_t sel);
|
||||
usb_error_t usb2_req_set_device_feature(struct usb_device *udev, struct mtx *mtx, uint16_t sel);
|
||||
|
||||
#define usb2_do_request(u,m,r,d) \
|
||||
usb2_do_request_flags(u,m,r,d,0,NULL,USB_DEFAULT_TIMEOUT)
|
||||
|
@ -50,7 +50,7 @@ struct usb2_std_packet_size {
|
||||
uint16_t fixed[4];
|
||||
};
|
||||
|
||||
static usb2_callback_t usb2_request_callback;
|
||||
static usb_callback_t usb2_request_callback;
|
||||
|
||||
static const struct usb_config usb2_control_ep_cfg[USB_DEFAULT_XFER_MAX] = {
|
||||
|
||||
@ -137,7 +137,7 @@ usb2_update_max_frame_size(struct usb_xfer *xfer)
|
||||
* 0: no DMA delay required
|
||||
* Else: milliseconds of DMA delay
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_timeout_t
|
||||
usb_timeout_t
|
||||
usb2_get_dma_delay(struct usb_bus *bus)
|
||||
{
|
||||
uint32_t temp = 0;
|
||||
@ -168,18 +168,18 @@ usb2_get_dma_delay(struct usb_bus *bus)
|
||||
#if USB_HAVE_BUSDMA
|
||||
uint8_t
|
||||
usb2_transfer_setup_sub_malloc(struct usb_setup_params *parm,
|
||||
struct usb_page_cache **ppc, usb2_size_t size, usb2_size_t align,
|
||||
usb2_size_t count)
|
||||
struct usb_page_cache **ppc, size_t size, size_t align,
|
||||
size_t count)
|
||||
{
|
||||
struct usb_page_cache *pc;
|
||||
struct usb_page *pg;
|
||||
void *buf;
|
||||
usb2_size_t n_dma_pc;
|
||||
usb2_size_t n_obj;
|
||||
usb2_size_t x;
|
||||
usb2_size_t y;
|
||||
usb2_size_t r;
|
||||
usb2_size_t z;
|
||||
size_t n_dma_pc;
|
||||
size_t n_obj;
|
||||
size_t x;
|
||||
size_t y;
|
||||
size_t r;
|
||||
size_t z;
|
||||
|
||||
USB_ASSERT(align > 1, ("Invalid alignment, 0x%08x!\n",
|
||||
align));
|
||||
@ -298,9 +298,9 @@ usb2_transfer_setup_sub(struct usb_setup_params *parm)
|
||||
const struct usb_config *setup = parm->curr_setup;
|
||||
struct usb_endpoint_descriptor *edesc;
|
||||
struct usb2_std_packet_size std_size;
|
||||
usb2_frcount_t n_frlengths;
|
||||
usb2_frcount_t n_frbuffers;
|
||||
usb2_frcount_t x;
|
||||
usb_frcount_t n_frlengths;
|
||||
usb_frcount_t n_frbuffers;
|
||||
usb_frcount_t x;
|
||||
uint8_t type;
|
||||
uint8_t zmps;
|
||||
|
||||
@ -713,7 +713,7 @@ usb2_transfer_setup_sub(struct usb_setup_params *parm)
|
||||
* 0: Success
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb_error_t
|
||||
usb2_transfer_setup(struct usb_device *udev,
|
||||
const uint8_t *ifaces, struct usb_xfer **ppxfer,
|
||||
const struct usb_config *setup_start, uint16_t n_setup,
|
||||
@ -754,7 +754,7 @@ usb2_transfer_setup(struct usb_device *udev,
|
||||
/* sanity checks */
|
||||
for (setup = setup_start, n = 0;
|
||||
setup != setup_end; setup++, n++) {
|
||||
if (setup->bufsize == (usb2_frlength_t)-1) {
|
||||
if (setup->bufsize == (usb_frlength_t)-1) {
|
||||
parm.err = USB_ERR_BAD_BUFSIZE;
|
||||
DPRINTF("invalid bufsize\n");
|
||||
}
|
||||
@ -1059,7 +1059,7 @@ usb2_transfer_unsetup_sub(struct usb_xfer_root *info, uint8_t needs_delay)
|
||||
/* wait for any outstanding DMA operations */
|
||||
|
||||
if (needs_delay) {
|
||||
usb2_timeout_t temp;
|
||||
usb_timeout_t temp;
|
||||
temp = usb2_get_dma_delay(info->bus);
|
||||
usb2_pause_mtx(&info->bus->bus_mtx,
|
||||
USB_MS_TO_TICKS(temp));
|
||||
@ -1222,7 +1222,7 @@ usb2_control_transfer_init(struct usb_xfer *xfer)
|
||||
static uint8_t
|
||||
usb2_start_hardware_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_frlength_t len;
|
||||
usb_frlength_t len;
|
||||
|
||||
/* Check for control endpoint stall */
|
||||
if (xfer->flags.stall_pipe && xfer->flags_int.control_act) {
|
||||
@ -1371,7 +1371,7 @@ usb2_start_hardware(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb_xfer_root *info;
|
||||
struct usb_bus *bus;
|
||||
usb2_frcount_t x;
|
||||
usb_frcount_t x;
|
||||
|
||||
info = xfer->xroot;
|
||||
bus = info->bus;
|
||||
@ -1789,7 +1789,7 @@ usb2_transfer_drain(struct usb_xfer *xfer)
|
||||
* than zero gives undefined results!
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_set_frame_data(struct usb_xfer *xfer, void *ptr, usb2_frcount_t frindex)
|
||||
usb2_set_frame_data(struct usb_xfer *xfer, void *ptr, usb_frcount_t frindex)
|
||||
{
|
||||
/* set virtual address to load and length */
|
||||
xfer->frbuffers[frindex].buffer = ptr;
|
||||
@ -1802,8 +1802,8 @@ usb2_set_frame_data(struct usb_xfer *xfer, void *ptr, usb2_frcount_t frindex)
|
||||
* of the USB DMA buffer allocated for this USB transfer.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_set_frame_offset(struct usb_xfer *xfer, usb2_frlength_t offset,
|
||||
usb2_frcount_t frindex)
|
||||
usb2_set_frame_offset(struct usb_xfer *xfer, usb_frlength_t offset,
|
||||
usb_frcount_t frindex)
|
||||
{
|
||||
USB_ASSERT(!xfer->flags.ext_buffer, ("Cannot offset data frame "
|
||||
"when the USB buffer is external!\n"));
|
||||
@ -2070,7 +2070,7 @@ usb2_transfer_enqueue(struct usb_xfer_queue *pq, struct usb_xfer *xfer)
|
||||
* - This function is used to stop any USB transfer timeouts.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_transfer_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
usb2_transfer_done(struct usb_xfer *xfer, usb_error_t error)
|
||||
{
|
||||
USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED);
|
||||
|
||||
@ -2316,7 +2316,7 @@ usb2_pipe_start(struct usb_xfer_queue *pq)
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_transfer_timeout_ms(struct usb_xfer *xfer,
|
||||
void (*cb) (void *arg), usb2_timeout_t ms)
|
||||
void (*cb) (void *arg), usb_timeout_t ms)
|
||||
{
|
||||
USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED);
|
||||
|
||||
@ -2346,7 +2346,7 @@ static uint8_t
|
||||
usb2_callback_wrapper_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb_pipe *pipe;
|
||||
usb2_frcount_t x;
|
||||
usb_frcount_t x;
|
||||
|
||||
if ((!xfer->flags_int.open) &&
|
||||
(!xfer->flags_int.did_close)) {
|
||||
@ -2366,7 +2366,7 @@ usb2_callback_wrapper_sub(struct usb_xfer *xfer)
|
||||
(xfer->error == USB_ERR_TIMEOUT)) &&
|
||||
(!xfer->flags_int.did_dma_delay)) {
|
||||
|
||||
usb2_timeout_t temp;
|
||||
usb_timeout_t temp;
|
||||
|
||||
/* only delay once */
|
||||
xfer->flags_int.did_dma_delay = 1;
|
||||
|
@ -67,12 +67,12 @@ struct usb_xfer_root {
|
||||
struct usb_bus *bus; /* pointer to USB bus (cached) */
|
||||
struct usb_device *udev; /* pointer to USB device */
|
||||
|
||||
usb2_size_t memory_size;
|
||||
usb2_size_t setup_refcount;
|
||||
size_t memory_size;
|
||||
size_t setup_refcount;
|
||||
#if USB_HAVE_BUSDMA
|
||||
usb2_frcount_t dma_nframes; /* number of page caches to load */
|
||||
usb2_frcount_t dma_currframe; /* currect page cache number */
|
||||
usb2_frlength_t dma_frlength_0; /* length of page cache zero */
|
||||
usb_frcount_t dma_nframes; /* number of page caches to load */
|
||||
usb_frcount_t dma_currframe; /* currect page cache number */
|
||||
usb_frlength_t dma_frlength_0; /* length of page cache zero */
|
||||
uint8_t dma_error; /* set if virtual memory could not be
|
||||
* loaded */
|
||||
#endif
|
||||
@ -95,31 +95,31 @@ struct usb_setup_params {
|
||||
const struct usb_config *curr_setup;
|
||||
const struct usb_pipe_methods *methods;
|
||||
void *buf;
|
||||
usb2_frlength_t *xfer_length_ptr;
|
||||
usb_frlength_t *xfer_length_ptr;
|
||||
|
||||
usb2_size_t size[7];
|
||||
usb2_frlength_t bufsize;
|
||||
usb2_frlength_t bufsize_max;
|
||||
size_t size[7];
|
||||
usb_frlength_t bufsize;
|
||||
usb_frlength_t bufsize_max;
|
||||
|
||||
uint16_t hc_max_frame_size;
|
||||
uint16_t hc_max_packet_size;
|
||||
uint8_t hc_max_packet_count;
|
||||
enum usb_dev_speed speed;
|
||||
uint8_t dma_tag_max;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
};
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
uint8_t usb2_transfer_setup_sub_malloc(struct usb_setup_params *parm,
|
||||
struct usb_page_cache **ppc, usb2_size_t size, usb2_size_t align,
|
||||
usb2_size_t count);
|
||||
struct usb_page_cache **ppc, size_t size, size_t align,
|
||||
size_t count);
|
||||
void usb2_command_wrapper(struct usb_xfer_queue *pq,
|
||||
struct usb_xfer *xfer);
|
||||
void usb2_pipe_enter(struct usb_xfer *xfer);
|
||||
void usb2_pipe_start(struct usb_xfer_queue *pq);
|
||||
void usb2_transfer_dequeue(struct usb_xfer *xfer);
|
||||
void usb2_transfer_done(struct usb_xfer *xfer, usb2_error_t error);
|
||||
void usb2_transfer_done(struct usb_xfer *xfer, usb_error_t error);
|
||||
void usb2_transfer_enqueue(struct usb_xfer_queue *pq,
|
||||
struct usb_xfer *xfer);
|
||||
void usb2_transfer_setup_sub(struct usb_setup_params *parm);
|
||||
@ -127,12 +127,12 @@ void usb2_default_transfer_setup(struct usb_device *udev);
|
||||
void usb2_clear_data_toggle(struct usb_device *udev,
|
||||
struct usb_pipe *pipe);
|
||||
void usb2_do_poll(struct usb_xfer **ppxfer, uint16_t max);
|
||||
usb2_callback_t usb2_do_request_callback;
|
||||
usb2_callback_t usb2_handle_request_callback;
|
||||
usb2_callback_t usb2_do_clear_stall_callback;
|
||||
usb_callback_t usb2_do_request_callback;
|
||||
usb_callback_t usb2_handle_request_callback;
|
||||
usb_callback_t usb2_do_clear_stall_callback;
|
||||
void usb2_transfer_timeout_ms(struct usb_xfer *xfer,
|
||||
void (*cb) (void *arg), usb2_timeout_t ms);
|
||||
usb2_timeout_t usb2_get_dma_delay(struct usb_bus *bus);
|
||||
void (*cb) (void *arg), usb_timeout_t ms);
|
||||
usb_timeout_t usb2_get_dma_delay(struct usb_bus *bus);
|
||||
void usb2_transfer_power_ref(struct usb_xfer *xfer, int val);
|
||||
|
||||
#endif /* _USB2_TRANSFER_H_ */
|
||||
|
@ -82,7 +82,7 @@ device_set_usb2_desc(device_t dev)
|
||||
struct usb_device *udev;
|
||||
struct usb_interface *iface;
|
||||
char *temp_p;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
if (dev == NULL) {
|
||||
/* should not happen */
|
||||
|
@ -149,10 +149,10 @@ static device_probe_t rum_match;
|
||||
static device_attach_t rum_attach;
|
||||
static device_detach_t rum_detach;
|
||||
|
||||
static usb2_callback_t rum_bulk_read_callback;
|
||||
static usb2_callback_t rum_bulk_write_callback;
|
||||
static usb_callback_t rum_bulk_read_callback;
|
||||
static usb_callback_t rum_bulk_write_callback;
|
||||
|
||||
static usb2_error_t rum_do_request(struct rum_softc *sc,
|
||||
static usb_error_t rum_do_request(struct rum_softc *sc,
|
||||
struct usb_device_request *req, void *data);
|
||||
static struct ieee80211vap *rum_vap_create(struct ieee80211com *,
|
||||
const char name[IFNAMSIZ], int unit, int opmode,
|
||||
@ -181,8 +181,8 @@ static void rum_eeprom_read(struct rum_softc *, uint16_t, void *,
|
||||
static uint32_t rum_read(struct rum_softc *, uint16_t);
|
||||
static void rum_read_multi(struct rum_softc *, uint16_t, void *,
|
||||
int);
|
||||
static usb2_error_t rum_write(struct rum_softc *, uint16_t, uint32_t);
|
||||
static usb2_error_t rum_write_multi(struct rum_softc *, uint16_t, void *,
|
||||
static usb_error_t rum_write(struct rum_softc *, uint16_t, uint32_t);
|
||||
static usb_error_t rum_write_multi(struct rum_softc *, uint16_t, void *,
|
||||
size_t);
|
||||
static void rum_bbp_write(struct rum_softc *, uint8_t, uint8_t);
|
||||
static uint8_t rum_bbp_read(struct rum_softc *, uint8_t);
|
||||
@ -564,11 +564,11 @@ rum_detach(device_t self)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
rum_do_request(struct rum_softc *sc,
|
||||
struct usb_device_request *req, void *data)
|
||||
{
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
int ntries = 10;
|
||||
|
||||
while (ntries--) {
|
||||
@ -1340,7 +1340,7 @@ static void
|
||||
rum_eeprom_read(struct rum_softc *sc, uint16_t addr, void *buf, int len)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t error;
|
||||
usb_error_t error;
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
req.bRequest = RT2573_READ_EEPROM;
|
||||
@ -1369,7 +1369,7 @@ static void
|
||||
rum_read_multi(struct rum_softc *sc, uint16_t reg, void *buf, int len)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t error;
|
||||
usb_error_t error;
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
req.bRequest = RT2573_READ_MULTI_MAC;
|
||||
@ -1385,7 +1385,7 @@ rum_read_multi(struct rum_softc *sc, uint16_t reg, void *buf, int len)
|
||||
}
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
rum_write(struct rum_softc *sc, uint16_t reg, uint32_t val)
|
||||
{
|
||||
uint32_t tmp = htole32(val);
|
||||
@ -1393,11 +1393,11 @@ rum_write(struct rum_softc *sc, uint16_t reg, uint32_t val)
|
||||
return (rum_write_multi(sc, reg, &tmp, sizeof tmp));
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
rum_write_multi(struct rum_softc *sc, uint16_t reg, void *buf, size_t len)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t error;
|
||||
usb_error_t error;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
req.bRequest = RT2573_WRITE_MULTI_MAC;
|
||||
@ -1945,7 +1945,7 @@ rum_init_locked(struct rum_softc *sc)
|
||||
struct ifnet *ifp = sc->sc_ifp;
|
||||
struct ieee80211com *ic = ifp->if_l2com;
|
||||
uint32_t tmp;
|
||||
usb2_error_t error;
|
||||
usb_error_t error;
|
||||
int i, ntries;
|
||||
|
||||
RUM_LOCK_ASSERT(sc, MA_OWNED);
|
||||
@ -2070,7 +2070,7 @@ rum_load_microcode(struct rum_softc *sc, const uint8_t *ucode, size_t size)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
uint16_t reg = RT2573_MCU_CODE_BASE;
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
|
||||
/* copy firmware image into NIC */
|
||||
for (; size >= 4; reg += 4, ucode += 4, size -= 4) {
|
||||
|
@ -201,10 +201,10 @@ static const struct usb_device_id uath_devs[] = {
|
||||
#undef UATH_DEV
|
||||
};
|
||||
|
||||
static usb2_callback_t uath_intr_rx_callback;
|
||||
static usb2_callback_t uath_intr_tx_callback;
|
||||
static usb2_callback_t uath_bulk_rx_callback;
|
||||
static usb2_callback_t uath_bulk_tx_callback;
|
||||
static usb_callback_t uath_intr_rx_callback;
|
||||
static usb_callback_t uath_intr_tx_callback;
|
||||
static usb_callback_t uath_bulk_rx_callback;
|
||||
static usb_callback_t uath_bulk_tx_callback;
|
||||
|
||||
static const struct usb_config uath_usbconfig[UATH_N_XFERS] = {
|
||||
[UATH_INTR_RX] = {
|
||||
@ -349,7 +349,7 @@ uath_attach(device_t dev)
|
||||
struct ieee80211com *ic;
|
||||
struct ifnet *ifp;
|
||||
uint8_t bands, iface_index = UATH_IFACE_INDEX; /* XXX */
|
||||
usb2_error_t error;
|
||||
usb_error_t error;
|
||||
uint8_t macaddr[IEEE80211_ADDR_LEN];
|
||||
|
||||
sc->sc_dev = dev;
|
||||
|
@ -196,8 +196,8 @@ static const struct usb_device_id upgt_devs_2[] = {
|
||||
UPGT_DEV(ZCOM, XM142)
|
||||
};
|
||||
|
||||
static usb2_callback_t upgt_bulk_rx_callback;
|
||||
static usb2_callback_t upgt_bulk_tx_callback;
|
||||
static usb_callback_t upgt_bulk_rx_callback;
|
||||
static usb_callback_t upgt_bulk_tx_callback;
|
||||
|
||||
static const struct usb_config upgt_config[UPGT_N_XFERS] = {
|
||||
[UPGT_BULK_TX] = {
|
||||
|
@ -129,10 +129,10 @@ static const struct usb_device_id ural_devs[] = {
|
||||
{ USB_VP(USB_VENDOR_ZINWELL, USB_PRODUCT_ZINWELL_RT2570) },
|
||||
};
|
||||
|
||||
static usb2_callback_t ural_bulk_read_callback;
|
||||
static usb2_callback_t ural_bulk_write_callback;
|
||||
static usb_callback_t ural_bulk_read_callback;
|
||||
static usb_callback_t ural_bulk_write_callback;
|
||||
|
||||
static usb2_error_t ural_do_request(struct ural_softc *sc,
|
||||
static usb_error_t ural_do_request(struct ural_softc *sc,
|
||||
struct usb_device_request *req, void *data);
|
||||
static struct ieee80211vap *ural_vap_create(struct ieee80211com *,
|
||||
const char name[IFNAMSIZ], int unit, int opmode,
|
||||
@ -555,11 +555,11 @@ ural_detach(device_t self)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
static usb_error_t
|
||||
ural_do_request(struct ural_softc *sc,
|
||||
struct usb_device_request *req, void *data)
|
||||
{
|
||||
usb2_error_t err;
|
||||
usb_error_t err;
|
||||
int ntries = 10;
|
||||
|
||||
while (ntries--) {
|
||||
@ -1392,7 +1392,7 @@ static void
|
||||
ural_set_testmode(struct ural_softc *sc)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t error;
|
||||
usb_error_t error;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
req.bRequest = RAL_VENDOR_REQUEST;
|
||||
@ -1411,7 +1411,7 @@ static void
|
||||
ural_eeprom_read(struct ural_softc *sc, uint16_t addr, void *buf, int len)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t error;
|
||||
usb_error_t error;
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
req.bRequest = RAL_READ_EEPROM;
|
||||
@ -1430,7 +1430,7 @@ static uint16_t
|
||||
ural_read(struct ural_softc *sc, uint16_t reg)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t error;
|
||||
usb_error_t error;
|
||||
uint16_t val;
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
@ -1453,7 +1453,7 @@ static void
|
||||
ural_read_multi(struct ural_softc *sc, uint16_t reg, void *buf, int len)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t error;
|
||||
usb_error_t error;
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
req.bRequest = RAL_READ_MULTI_MAC;
|
||||
@ -1472,7 +1472,7 @@ static void
|
||||
ural_write(struct ural_softc *sc, uint16_t reg, uint16_t val)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t error;
|
||||
usb_error_t error;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
req.bRequest = RAL_WRITE_MAC;
|
||||
@ -1491,7 +1491,7 @@ static void
|
||||
ural_write_multi(struct ural_softc *sc, uint16_t reg, void *buf, int len)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t error;
|
||||
usb_error_t error;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
req.bRequest = RAL_WRITE_MULTI_MAC;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -111,12 +111,12 @@ struct urtw_softc {
|
||||
struct ieee80211_channel *sc_curchan;
|
||||
|
||||
/* for RF */
|
||||
usb2_error_t (*sc_rf_init)(struct urtw_softc *);
|
||||
usb2_error_t (*sc_rf_set_chan)(struct urtw_softc *,
|
||||
usb_error_t (*sc_rf_init)(struct urtw_softc *);
|
||||
usb_error_t (*sc_rf_set_chan)(struct urtw_softc *,
|
||||
int);
|
||||
usb2_error_t (*sc_rf_set_sens)(struct urtw_softc *,
|
||||
usb_error_t (*sc_rf_set_sens)(struct urtw_softc *,
|
||||
int);
|
||||
usb2_error_t (*sc_rf_stop)(struct urtw_softc *);
|
||||
usb_error_t (*sc_rf_stop)(struct urtw_softc *);
|
||||
uint8_t sc_rfchip;
|
||||
uint32_t sc_max_sens;
|
||||
uint32_t sc_sens;
|
||||
|
@ -116,10 +116,10 @@ static device_probe_t zyd_match;
|
||||
static device_attach_t zyd_attach;
|
||||
static device_detach_t zyd_detach;
|
||||
|
||||
static usb2_callback_t zyd_intr_read_callback;
|
||||
static usb2_callback_t zyd_intr_write_callback;
|
||||
static usb2_callback_t zyd_bulk_read_callback;
|
||||
static usb2_callback_t zyd_bulk_write_callback;
|
||||
static usb_callback_t zyd_intr_read_callback;
|
||||
static usb_callback_t zyd_intr_write_callback;
|
||||
static usb_callback_t zyd_bulk_read_callback;
|
||||
static usb_callback_t zyd_bulk_write_callback;
|
||||
|
||||
static struct ieee80211vap *zyd_vap_create(struct ieee80211com *,
|
||||
const char name[IFNAMSIZ], int unit, int opmode,
|
||||
@ -1877,7 +1877,7 @@ static int
|
||||
zyd_get_macaddr(struct zyd_softc *sc)
|
||||
{
|
||||
struct usb_device_request req;
|
||||
usb2_error_t error;
|
||||
usb_error_t error;
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
req.bRequest = ZYD_READFWDATAREQ;
|
||||
|
@ -238,12 +238,12 @@ static struct ng_type typestruct =
|
||||
****************************************************************************/
|
||||
|
||||
/* USB methods */
|
||||
static usb2_callback_t ubt_ctrl_write_callback;
|
||||
static usb2_callback_t ubt_intr_read_callback;
|
||||
static usb2_callback_t ubt_bulk_read_callback;
|
||||
static usb2_callback_t ubt_bulk_write_callback;
|
||||
static usb2_callback_t ubt_isoc_read_callback;
|
||||
static usb2_callback_t ubt_isoc_write_callback;
|
||||
static usb_callback_t ubt_ctrl_write_callback;
|
||||
static usb_callback_t ubt_intr_read_callback;
|
||||
static usb_callback_t ubt_bulk_read_callback;
|
||||
static usb_callback_t ubt_bulk_write_callback;
|
||||
static usb_callback_t ubt_isoc_read_callback;
|
||||
static usb_callback_t ubt_isoc_write_callback;
|
||||
|
||||
static int ubt_fwd_mbuf_up(ubt_softc_p, struct mbuf **);
|
||||
static int ubt_isoc_read_one_frame(struct usb_xfer *, int);
|
||||
|
@ -79,16 +79,16 @@ static device_probe_t ubtbcmfw_probe;
|
||||
static device_attach_t ubtbcmfw_attach;
|
||||
static device_detach_t ubtbcmfw_detach;
|
||||
|
||||
static usb2_callback_t ubtbcmfw_write_callback;
|
||||
static usb2_callback_t ubtbcmfw_read_callback;
|
||||
static usb_callback_t ubtbcmfw_write_callback;
|
||||
static usb_callback_t ubtbcmfw_read_callback;
|
||||
|
||||
static usb2_fifo_close_t ubtbcmfw_close;
|
||||
static usb2_fifo_cmd_t ubtbcmfw_start_read;
|
||||
static usb2_fifo_cmd_t ubtbcmfw_start_write;
|
||||
static usb2_fifo_cmd_t ubtbcmfw_stop_read;
|
||||
static usb2_fifo_cmd_t ubtbcmfw_stop_write;
|
||||
static usb2_fifo_ioctl_t ubtbcmfw_ioctl;
|
||||
static usb2_fifo_open_t ubtbcmfw_open;
|
||||
static usb_fifo_close_t ubtbcmfw_close;
|
||||
static usb_fifo_cmd_t ubtbcmfw_start_read;
|
||||
static usb_fifo_cmd_t ubtbcmfw_start_write;
|
||||
static usb_fifo_cmd_t ubtbcmfw_stop_read;
|
||||
static usb_fifo_cmd_t ubtbcmfw_stop_write;
|
||||
static usb_fifo_ioctl_t ubtbcmfw_ioctl;
|
||||
static usb_fifo_open_t ubtbcmfw_open;
|
||||
|
||||
static struct usb_fifo_methods ubtbcmfw_fifo_methods =
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user