s/usb2_/usb_/ on all C structs for the USB stack.
This commit is contained in:
parent
58de945eeb
commit
760bc48e7e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=192984
@ -109,7 +109,7 @@ USB access library (libusb -lusb)
|
||||
.Ft const char *
|
||||
.Fn libusb20_dev_get_backend_name "struct libusb20_device *"
|
||||
.Ft int
|
||||
.Fn libusb20_dev_get_info "struct libusb20_device *pdev" "struct usb2_device_info *pinfo"
|
||||
.Fn libusb20_dev_get_info "struct libusb20_device *pdev" "struct usb_device_info *pinfo"
|
||||
.Ft int
|
||||
.Fn libusb20_dev_get_iface_desc "struct libusb20_device *pdev" "uint8_t iface_index" "char *buf" "uint8_t len"
|
||||
.Ft const char *
|
||||
@ -465,7 +465,7 @@ returns a zero terminated string describing the backend used.
|
||||
.Pp
|
||||
.
|
||||
.Fn libusb20_dev_get_info
|
||||
retrives the BSD specific usb2_device_info structure into the memory location given by
|
||||
retrives the BSD specific usb_device_info structure into the memory location given by
|
||||
.Fa pinfo .
|
||||
The USB device given by
|
||||
.Fa pdev
|
||||
|
@ -925,7 +925,7 @@ libusb20_dev_free(struct libusb20_device *pdev)
|
||||
|
||||
int
|
||||
libusb20_dev_get_info(struct libusb20_device *pdev,
|
||||
struct usb2_device_info *pinfo)
|
||||
struct usb_device_info *pinfo)
|
||||
{
|
||||
if (pinfo == NULL)
|
||||
return (LIBUSB20_ERROR_INVALID_PARAM);
|
||||
|
@ -175,7 +175,7 @@ enum {
|
||||
LIBUSB20_POWER_RESUME,
|
||||
};
|
||||
|
||||
struct usb2_device_info;
|
||||
struct usb_device_info;
|
||||
struct libusb20_transfer;
|
||||
struct libusb20_backend;
|
||||
struct libusb20_backend_methods;
|
||||
@ -253,7 +253,7 @@ int libusb20_dev_reset(struct libusb20_device *pdev);
|
||||
int libusb20_dev_set_power_mode(struct libusb20_device *pdev, uint8_t power_mode);
|
||||
uint8_t libusb20_dev_get_power_mode(struct libusb20_device *pdev);
|
||||
int libusb20_dev_set_alt_index(struct libusb20_device *pdev, uint8_t iface_index, uint8_t alt_index);
|
||||
int libusb20_dev_get_info(struct libusb20_device *pdev, struct usb2_device_info *pinfo);
|
||||
int libusb20_dev_get_info(struct libusb20_device *pdev, struct usb_device_info *pinfo);
|
||||
int libusb20_dev_get_iface_desc(struct libusb20_device *pdev, uint8_t iface_index, char *buf, uint8_t len);
|
||||
|
||||
struct LIBUSB20_DEVICE_DESC_DECODED *libusb20_dev_get_device_desc(struct libusb20_device *pdev);
|
||||
|
@ -49,7 +49,7 @@ typedef int (libusb20_root_get_quirk_name_t)(struct libusb20_backend *pbe, uint1
|
||||
typedef int (libusb20_root_add_dev_quirk_t)(struct libusb20_backend *pbe, struct libusb20_quirk *pq);
|
||||
typedef int (libusb20_root_remove_dev_quirk_t)(struct libusb20_backend *pbe, struct libusb20_quirk *pq);
|
||||
typedef int (libusb20_close_device_t)(struct libusb20_device *pdev);
|
||||
typedef int (libusb20_dev_get_info_t)(struct libusb20_device *pdev, struct usb2_device_info *pinfo);
|
||||
typedef int (libusb20_dev_get_info_t)(struct libusb20_device *pdev, struct usb_device_info *pinfo);
|
||||
typedef int (libusb20_dev_get_iface_desc_t)(struct libusb20_device *pdev, uint8_t iface_index, char *buf, uint8_t len);
|
||||
typedef int (libusb20_init_backend_t)(struct libusb20_backend *pbe);
|
||||
typedef int (libusb20_open_device_t)(struct libusb20_device *pdev, uint16_t transfer_count_max);
|
||||
|
@ -126,8 +126,8 @@ static int
|
||||
ugen20_enumerate(struct libusb20_device *pdev, const char *id)
|
||||
{
|
||||
const char *tmp = id;
|
||||
struct usb2_device_descriptor ddesc;
|
||||
struct usb2_device_info devinfo;
|
||||
struct usb_device_descriptor ddesc;
|
||||
struct usb_device_info devinfo;
|
||||
uint32_t plugtime;
|
||||
char buf[64];
|
||||
int f;
|
||||
@ -213,7 +213,7 @@ ugen20_enumerate(struct libusb20_device *pdev, const char *id)
|
||||
}
|
||||
|
||||
struct ugen20_urd_state {
|
||||
struct usb2_read_dir urd;
|
||||
struct usb_read_dir urd;
|
||||
uint32_t nparsed;
|
||||
int f;
|
||||
uint8_t *ptr;
|
||||
@ -298,7 +298,7 @@ ugen20_init_backend(struct libusb20_backend *pbe)
|
||||
static void
|
||||
ugen20_tr_release(struct libusb20_device *pdev)
|
||||
{
|
||||
struct usb2_fs_uninit fs_uninit;
|
||||
struct usb_fs_uninit fs_uninit;
|
||||
|
||||
if (pdev->nTransfer == 0) {
|
||||
return;
|
||||
@ -316,8 +316,8 @@ ugen20_tr_release(struct libusb20_device *pdev)
|
||||
static int
|
||||
ugen20_tr_renew(struct libusb20_device *pdev)
|
||||
{
|
||||
struct usb2_fs_init fs_init;
|
||||
struct usb2_fs_endpoint *pfse;
|
||||
struct usb_fs_init fs_init;
|
||||
struct usb_fs_endpoint *pfse;
|
||||
int error;
|
||||
uint32_t size;
|
||||
uint16_t nMaxTransfer;
|
||||
@ -419,7 +419,7 @@ ugen20_open_device(struct libusb20_device *pdev, uint16_t nMaxTransfer)
|
||||
static int
|
||||
ugen20_close_device(struct libusb20_device *pdev)
|
||||
{
|
||||
struct usb2_fs_uninit fs_uninit;
|
||||
struct usb_fs_uninit fs_uninit;
|
||||
|
||||
if (pdev->privBeData) {
|
||||
memset(&fs_uninit, 0, sizeof(fs_uninit));
|
||||
@ -447,8 +447,8 @@ static int
|
||||
ugen20_get_config_desc_full(struct libusb20_device *pdev,
|
||||
uint8_t **ppbuf, uint16_t *plen, uint8_t cfg_index)
|
||||
{
|
||||
struct usb2_gen_descriptor gen_desc;
|
||||
struct usb2_config_descriptor cdesc;
|
||||
struct usb_gen_descriptor gen_desc;
|
||||
struct usb_config_descriptor cdesc;
|
||||
uint8_t *ptr;
|
||||
uint16_t len;
|
||||
int error;
|
||||
@ -542,7 +542,7 @@ static int
|
||||
ugen20_set_alt_index(struct libusb20_device *pdev,
|
||||
uint8_t iface_index, uint8_t alt_index)
|
||||
{
|
||||
struct usb2_alt_interface alt_iface;
|
||||
struct usb_alt_interface alt_iface;
|
||||
|
||||
memset(&alt_iface, 0, sizeof(alt_iface));
|
||||
|
||||
@ -663,7 +663,7 @@ ugen20_do_request_sync(struct libusb20_device *pdev,
|
||||
struct LIBUSB20_CONTROL_SETUP_DECODED *setup,
|
||||
void *data, uint16_t *pactlen, uint32_t timeout, uint8_t flags)
|
||||
{
|
||||
struct usb2_ctl_request req;
|
||||
struct usb_ctl_request req;
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
|
||||
@ -688,8 +688,8 @@ ugen20_do_request_sync(struct libusb20_device *pdev,
|
||||
static int
|
||||
ugen20_process(struct libusb20_device *pdev)
|
||||
{
|
||||
struct usb2_fs_complete temp;
|
||||
struct usb2_fs_endpoint *fsep;
|
||||
struct usb_fs_complete temp;
|
||||
struct usb_fs_endpoint *fsep;
|
||||
struct libusb20_transfer *xfer;
|
||||
|
||||
while (1) {
|
||||
@ -739,8 +739,8 @@ static int
|
||||
ugen20_tr_open(struct libusb20_transfer *xfer, uint32_t MaxBufSize,
|
||||
uint32_t MaxFrameCount, uint8_t ep_no)
|
||||
{
|
||||
struct usb2_fs_open temp;
|
||||
struct usb2_fs_endpoint *fsep;
|
||||
struct usb_fs_open temp;
|
||||
struct usb_fs_endpoint *fsep;
|
||||
|
||||
memset(&temp, 0, sizeof(temp));
|
||||
|
||||
@ -772,7 +772,7 @@ ugen20_tr_open(struct libusb20_transfer *xfer, uint32_t MaxBufSize,
|
||||
static int
|
||||
ugen20_tr_close(struct libusb20_transfer *xfer)
|
||||
{
|
||||
struct usb2_fs_close temp;
|
||||
struct usb_fs_close temp;
|
||||
|
||||
memset(&temp, 0, sizeof(temp));
|
||||
|
||||
@ -787,7 +787,7 @@ ugen20_tr_close(struct libusb20_transfer *xfer)
|
||||
static int
|
||||
ugen20_tr_clear_stall_sync(struct libusb20_transfer *xfer)
|
||||
{
|
||||
struct usb2_fs_clear_stall_sync temp;
|
||||
struct usb_fs_clear_stall_sync temp;
|
||||
|
||||
memset(&temp, 0, sizeof(temp));
|
||||
|
||||
@ -804,8 +804,8 @@ ugen20_tr_clear_stall_sync(struct libusb20_transfer *xfer)
|
||||
static void
|
||||
ugen20_tr_submit(struct libusb20_transfer *xfer)
|
||||
{
|
||||
struct usb2_fs_start temp;
|
||||
struct usb2_fs_endpoint *fsep;
|
||||
struct usb_fs_start temp;
|
||||
struct usb_fs_endpoint *fsep;
|
||||
|
||||
memset(&temp, 0, sizeof(temp));
|
||||
|
||||
@ -839,7 +839,7 @@ ugen20_tr_submit(struct libusb20_transfer *xfer)
|
||||
static void
|
||||
ugen20_tr_cancel_async(struct libusb20_transfer *xfer)
|
||||
{
|
||||
struct usb2_fs_stop temp;
|
||||
struct usb_fs_stop temp;
|
||||
|
||||
memset(&temp, 0, sizeof(temp));
|
||||
|
||||
@ -876,7 +876,7 @@ static int
|
||||
ugen20_dev_get_iface_desc(struct libusb20_device *pdev,
|
||||
uint8_t iface_index, char *buf, uint8_t len)
|
||||
{
|
||||
struct usb2_gen_descriptor ugd;
|
||||
struct usb_gen_descriptor ugd;
|
||||
|
||||
memset(&ugd, 0, sizeof(ugd));
|
||||
|
||||
@ -892,7 +892,7 @@ ugen20_dev_get_iface_desc(struct libusb20_device *pdev,
|
||||
|
||||
static int
|
||||
ugen20_dev_get_info(struct libusb20_device *pdev,
|
||||
struct usb2_device_info *pinfo)
|
||||
struct usb_device_info *pinfo)
|
||||
{
|
||||
if (ioctl(pdev->file, USB_GET_DEVICEINFO, pinfo)) {
|
||||
return (LIBUSB20_ERROR_INVALID_PARAM);
|
||||
@ -904,7 +904,7 @@ static int
|
||||
ugen20_root_get_dev_quirk(struct libusb20_backend *pbe,
|
||||
uint16_t quirk_index, struct libusb20_quirk *pq)
|
||||
{
|
||||
struct usb2_gen_quirk q;
|
||||
struct usb_gen_quirk q;
|
||||
int error;
|
||||
|
||||
memset(&q, 0, sizeof(q));
|
||||
@ -931,7 +931,7 @@ static int
|
||||
ugen20_root_get_quirk_name(struct libusb20_backend *pbe, uint16_t quirk_index,
|
||||
struct libusb20_quirk *pq)
|
||||
{
|
||||
struct usb2_gen_quirk q;
|
||||
struct usb_gen_quirk q;
|
||||
int error;
|
||||
|
||||
memset(&q, 0, sizeof(q));
|
||||
@ -954,7 +954,7 @@ static int
|
||||
ugen20_root_add_dev_quirk(struct libusb20_backend *pbe,
|
||||
struct libusb20_quirk *pq)
|
||||
{
|
||||
struct usb2_gen_quirk q;
|
||||
struct usb_gen_quirk q;
|
||||
int error;
|
||||
|
||||
memset(&q, 0, sizeof(q));
|
||||
@ -978,7 +978,7 @@ static int
|
||||
ugen20_root_remove_dev_quirk(struct libusb20_backend *pbe,
|
||||
struct libusb20_quirk *pq)
|
||||
{
|
||||
struct usb2_gen_quirk q;
|
||||
struct usb_gen_quirk q;
|
||||
int error;
|
||||
|
||||
memset(&q, 0, sizeof(q));
|
||||
|
@ -84,10 +84,10 @@ static usb2_callback_t usbd_ctrl_callback;
|
||||
#define USBD_CTRL_MAX_PIPE 2
|
||||
#define USBD_CTRL_READ_BUFFER_SP 256
|
||||
#define USBD_CTRL_READ_BUFFER_SIZE \
|
||||
(sizeof(struct usb2_device_request) + USBD_CTRL_READ_BUFFER_SP)
|
||||
(sizeof(struct usb_device_request) + USBD_CTRL_READ_BUFFER_SP)
|
||||
#define USBD_CTRL_WRITE_BUFFER_SIZE \
|
||||
(sizeof(struct usb2_device_request))
|
||||
static struct usb2_config usbd_default_epconfig[USBD_CTRL_MAX_PIPE] = {
|
||||
(sizeof(struct usb_device_request))
|
||||
static struct usb_config usbd_default_epconfig[USBD_CTRL_MAX_PIPE] = {
|
||||
[USBD_CTRL_READ_PIPE] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* control pipe */
|
||||
@ -115,10 +115,10 @@ 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,
|
||||
struct usb2_endpoint_descriptor *);
|
||||
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,
|
||||
struct ndisusb_ep *, struct usb2_config *);
|
||||
struct ndisusb_ep *, struct usb_config *);
|
||||
static int32_t usbd_func_getdesc(irp *);
|
||||
static union usbd_urb *usbd_geturb(irp *);
|
||||
static struct ndisusb_ep*usbd_get_ndisep(irp *, usb_endpoint_descriptor_t *);
|
||||
@ -519,8 +519,8 @@ usbd_func_selconf(ip)
|
||||
device_t dev = IRP_NDIS_DEV(ip);
|
||||
int i, j;
|
||||
struct ndis_softc *sc = device_get_softc(dev);
|
||||
struct usb2_device *udev = sc->ndisusb_dev;
|
||||
struct usb2_pipe *p = NULL;
|
||||
struct usb_device *udev = sc->ndisusb_dev;
|
||||
struct usb_pipe *p = NULL;
|
||||
struct usbd_interface_information *intf;
|
||||
struct usbd_pipe_information *pipe;
|
||||
struct usbd_urb_select_configuration *selconf;
|
||||
@ -597,11 +597,11 @@ usbd_setup_endpoint_one(ip, ifidx, ne, epconf)
|
||||
irp *ip;
|
||||
uint8_t ifidx;
|
||||
struct ndisusb_ep *ne;
|
||||
struct usb2_config *epconf;
|
||||
struct usb_config *epconf;
|
||||
{
|
||||
device_t dev = IRP_NDIS_DEV(ip);
|
||||
struct ndis_softc *sc = device_get_softc(dev);
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
usb2_error_t status;
|
||||
|
||||
InitializeListHead(&ne->ne_active);
|
||||
@ -647,13 +647,13 @@ static usb2_error_t
|
||||
usbd_setup_endpoint(ip, ifidx, ep)
|
||||
irp *ip;
|
||||
uint8_t ifidx;
|
||||
struct usb2_endpoint_descriptor *ep;
|
||||
struct usb_endpoint_descriptor *ep;
|
||||
{
|
||||
device_t dev = IRP_NDIS_DEV(ip);
|
||||
struct ndis_softc *sc = device_get_softc(dev);
|
||||
struct ndisusb_ep *ne;
|
||||
struct usb2_config cfg;
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_config cfg;
|
||||
struct usb_xfer *xfer;
|
||||
usb2_error_t status;
|
||||
|
||||
/* check for non-supported transfer types */
|
||||
@ -670,7 +670,7 @@ usbd_setup_endpoint(ip, ifidx, ep)
|
||||
KeInitializeSpinLock(&ne->ne_lock);
|
||||
ne->ne_dirin = UE_GET_DIR(ep->bEndpointAddress) >> 7;
|
||||
|
||||
memset(&cfg, 0, sizeof(struct usb2_config));
|
||||
memset(&cfg, 0, sizeof(struct usb_config));
|
||||
cfg.type = UE_GET_XFERTYPE(ep->bmAttributes);
|
||||
cfg.endpoint = UE_GET_ADDR(ep->bEndpointAddress);
|
||||
cfg.direction = UE_GET_DIR(ep->bEndpointAddress);
|
||||
@ -853,7 +853,7 @@ usbd_aq_getfirst(struct ndis_softc *sc, struct ndisusb_ep *ne)
|
||||
}
|
||||
|
||||
static void
|
||||
usbd_non_isoc_callback(struct usb2_xfer *xfer)
|
||||
usbd_non_isoc_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
irp *ip;
|
||||
struct ndis_softc *sc = xfer->priv_sc;
|
||||
@ -951,7 +951,7 @@ usbd_non_isoc_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
usbd_ctrl_callback(struct usb2_xfer *xfer)
|
||||
usbd_ctrl_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
irp *ip;
|
||||
struct ndis_softc *sc = xfer->priv_sc;
|
||||
@ -961,7 +961,7 @@ usbd_ctrl_callback(struct usb2_xfer *xfer)
|
||||
union usbd_urb *urb;
|
||||
struct usbd_urb_vendor_or_class_request *vcreq;
|
||||
uint8_t type = 0;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
case USB_ST_TRANSFERRED:
|
||||
@ -1434,7 +1434,7 @@ USBD_ParseConfigurationDescriptorEx(conf, start, intfnum,
|
||||
int32_t intfsubclass;
|
||||
int32_t intfproto;
|
||||
{
|
||||
struct usb2_descriptor *next = NULL;
|
||||
struct usb_descriptor *next = NULL;
|
||||
usb_interface_descriptor_t *desc;
|
||||
|
||||
while ((next = usb2_desc_foreach(conf, next)) != NULL) {
|
||||
|
@ -108,7 +108,7 @@ struct atausb2_softc {
|
||||
|
||||
#define ATAUSB_T_MAX ATAUSB_T_BBB_MAX
|
||||
|
||||
struct usb2_xfer *xfer[ATAUSB_T_MAX];
|
||||
struct usb_xfer *xfer[ATAUSB_T_MAX];
|
||||
caddr_t ata_data;
|
||||
device_t dev;
|
||||
|
||||
@ -145,7 +145,7 @@ static usb2_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);
|
||||
static void atausb2_t_bbb_data_clear_stall_callback(struct usb2_xfer *xfer, uint8_t next_xfer, uint8_t stall_xfer);
|
||||
static void atausb2_t_bbb_data_clear_stall_callback(struct usb_xfer *xfer, uint8_t next_xfer, uint8_t stall_xfer);
|
||||
static int ata_usbchannel_begin_transaction(struct ata_request *request);
|
||||
static int ata_usbchannel_end_transaction(struct ata_request *request);
|
||||
|
||||
@ -160,13 +160,13 @@ static ata_locking_t ata_usbchannel_locking;
|
||||
* USB frontend part
|
||||
*/
|
||||
|
||||
struct usb2_config atausb2_config[ATAUSB_T_BBB_MAX] = {
|
||||
struct usb_config atausb2_config[ATAUSB_T_BBB_MAX] = {
|
||||
|
||||
[ATAUSB_T_BBB_RESET1] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.mh.bufsize = sizeof(struct usb2_device_request),
|
||||
.mh.bufsize = sizeof(struct usb_device_request),
|
||||
.mh.flags = {},
|
||||
.mh.callback = &atausb2_t_bbb_reset1_callback,
|
||||
.mh.timeout = 5000, /* 5 seconds */
|
||||
@ -177,7 +177,7 @@ struct usb2_config atausb2_config[ATAUSB_T_BBB_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.mh.bufsize = sizeof(struct usb2_device_request),
|
||||
.mh.bufsize = sizeof(struct usb_device_request),
|
||||
.mh.flags = {},
|
||||
.mh.callback = &atausb2_t_bbb_reset2_callback,
|
||||
.mh.timeout = 5000, /* 5 seconds */
|
||||
@ -188,7 +188,7 @@ struct usb2_config atausb2_config[ATAUSB_T_BBB_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.mh.bufsize = sizeof(struct usb2_device_request),
|
||||
.mh.bufsize = sizeof(struct usb_device_request),
|
||||
.mh.flags = {},
|
||||
.mh.callback = &atausb2_t_bbb_reset3_callback,
|
||||
.mh.timeout = 5000, /* 5 seconds */
|
||||
@ -219,7 +219,7 @@ struct usb2_config atausb2_config[ATAUSB_T_BBB_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.mh.bufsize = sizeof(struct usb2_device_request),
|
||||
.mh.bufsize = sizeof(struct usb_device_request),
|
||||
.mh.flags = {},
|
||||
.mh.callback = &atausb2_t_bbb_data_rd_cs_callback,
|
||||
.mh.timeout = 5000, /* 5 seconds */
|
||||
@ -239,7 +239,7 @@ struct usb2_config atausb2_config[ATAUSB_T_BBB_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.mh.bufsize = sizeof(struct usb2_device_request),
|
||||
.mh.bufsize = sizeof(struct usb_device_request),
|
||||
.mh.flags = {},
|
||||
.mh.callback = &atausb2_t_bbb_data_wr_cs_callback,
|
||||
.mh.timeout = 5000, /* 5 seconds */
|
||||
@ -278,8 +278,8 @@ MODULE_VERSION(atausb, 1);
|
||||
static int
|
||||
atausb2_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_interface_descriptor *id;
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
return (ENXIO);
|
||||
@ -318,10 +318,10 @@ static int
|
||||
atausb2_attach(device_t dev)
|
||||
{
|
||||
struct atausb2_softc *sc = device_get_softc(dev);
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_interface_descriptor *id;
|
||||
const char *proto, *subclass;
|
||||
struct usb2_device_request request;
|
||||
struct usb_device_request request;
|
||||
device_t child;
|
||||
uint16_t i;
|
||||
uint8_t maxlun;
|
||||
@ -467,10 +467,10 @@ atausb2_transfer_start(struct atausb2_softc *sc, uint8_t xfer_no)
|
||||
}
|
||||
|
||||
static void
|
||||
atausb2_t_bbb_reset1_callback(struct usb2_xfer *xfer)
|
||||
atausb2_t_bbb_reset1_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct atausb2_softc *sc = xfer->priv_sc;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
case USB_ST_TRANSFERRED:
|
||||
@ -500,21 +500,21 @@ atausb2_t_bbb_reset1_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
atausb2_t_bbb_reset2_callback(struct usb2_xfer *xfer)
|
||||
atausb2_t_bbb_reset2_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
atausb2_t_bbb_data_clear_stall_callback(xfer, ATAUSB_T_BBB_RESET3,
|
||||
ATAUSB_T_BBB_DATA_READ);
|
||||
}
|
||||
|
||||
static void
|
||||
atausb2_t_bbb_reset3_callback(struct usb2_xfer *xfer)
|
||||
atausb2_t_bbb_reset3_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
atausb2_t_bbb_data_clear_stall_callback(xfer, ATAUSB_T_BBB_COMMAND,
|
||||
ATAUSB_T_BBB_DATA_WRITE);
|
||||
}
|
||||
|
||||
static void
|
||||
atausb2_t_bbb_data_clear_stall_callback(struct usb2_xfer *xfer,
|
||||
atausb2_t_bbb_data_clear_stall_callback(struct usb_xfer *xfer,
|
||||
uint8_t next_xfer,
|
||||
uint8_t stall_xfer)
|
||||
{
|
||||
@ -540,7 +540,7 @@ atausb2_t_bbb_data_clear_stall_callback(struct usb2_xfer *xfer,
|
||||
}
|
||||
|
||||
static void
|
||||
atausb2_t_bbb_command_callback(struct usb2_xfer *xfer)
|
||||
atausb2_t_bbb_command_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct atausb2_softc *sc = xfer->priv_sc;
|
||||
struct ata_request *request = sc->ata_request;
|
||||
@ -590,7 +590,7 @@ atausb2_t_bbb_command_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
atausb2_t_bbb_data_read_callback(struct usb2_xfer *xfer)
|
||||
atausb2_t_bbb_data_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct atausb2_softc *sc = xfer->priv_sc;
|
||||
uint32_t max_bulk = xfer->max_data_length;
|
||||
@ -640,14 +640,14 @@ atausb2_t_bbb_data_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
atausb2_t_bbb_data_rd_cs_callback(struct usb2_xfer *xfer)
|
||||
atausb2_t_bbb_data_rd_cs_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
atausb2_t_bbb_data_clear_stall_callback(xfer, ATAUSB_T_BBB_STATUS,
|
||||
ATAUSB_T_BBB_DATA_READ);
|
||||
}
|
||||
|
||||
static void
|
||||
atausb2_t_bbb_data_write_callback(struct usb2_xfer *xfer)
|
||||
atausb2_t_bbb_data_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct atausb2_softc *sc = xfer->priv_sc;
|
||||
uint32_t max_bulk = xfer->max_data_length;
|
||||
@ -693,14 +693,14 @@ atausb2_t_bbb_data_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
atausb2_t_bbb_data_wr_cs_callback(struct usb2_xfer *xfer)
|
||||
atausb2_t_bbb_data_wr_cs_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
atausb2_t_bbb_data_clear_stall_callback(xfer, ATAUSB_T_BBB_STATUS,
|
||||
ATAUSB_T_BBB_DATA_WRITE);
|
||||
}
|
||||
|
||||
static void
|
||||
atausb2_t_bbb_status_callback(struct usb2_xfer *xfer)
|
||||
atausb2_t_bbb_status_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct atausb2_softc *sc = xfer->priv_sc;
|
||||
struct ata_request *request = sc->ata_request;
|
||||
@ -820,7 +820,7 @@ atausb2_cancel_request(struct atausb2_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
atausb2_tr_error(struct usb2_xfer *xfer)
|
||||
atausb2_tr_error(struct usb_xfer *xfer)
|
||||
{
|
||||
struct atausb2_softc *sc = xfer->priv_sc;
|
||||
|
||||
|
@ -111,7 +111,7 @@ DRIVER_MODULE(ndis, uhub, ndis_driver, ndis_devclass, ndisdrv_modevent, 0);
|
||||
static int
|
||||
ndisusb_devcompare(interface_type bustype, struct ndis_usb_type *t, device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa;
|
||||
struct usb_attach_arg *uaa;
|
||||
|
||||
if (bustype != PNPBus)
|
||||
return (FALSE);
|
||||
@ -134,7 +134,7 @@ static int
|
||||
ndisusb_match(device_t self)
|
||||
{
|
||||
struct drvdb_ent *db;
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(self);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(self);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST)
|
||||
return (ENXIO);
|
||||
@ -159,7 +159,7 @@ ndisusb_attach(device_t self)
|
||||
{
|
||||
const struct drvdb_ent *db;
|
||||
struct ndisusb_softc *dummy = device_get_softc(self);
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(self);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(self);
|
||||
struct ndis_softc *sc;
|
||||
struct ndis_usb_type *t;
|
||||
driver_object *drv;
|
||||
|
@ -121,7 +121,7 @@ struct ndis_vap {
|
||||
#define NDISUSB_TX_TIMEOUT 10000
|
||||
struct ndisusb_xfer;
|
||||
struct ndisusb_ep {
|
||||
struct usb2_xfer *ne_xfer[1];
|
||||
struct usb_xfer *ne_xfer[1];
|
||||
list_entry ne_active;
|
||||
list_entry ne_pending;
|
||||
kspin_lock ne_lock;
|
||||
@ -225,7 +225,7 @@ struct ndis_softc {
|
||||
int ndis_tx_timer;
|
||||
int ndis_hang_timer;
|
||||
|
||||
struct usb2_device *ndisusb_dev;
|
||||
struct usb_device *ndisusb_dev;
|
||||
struct mtx ndisusb_mtx;
|
||||
struct ndisusb_ep ndisusb_dread_ep;
|
||||
struct ndisusb_ep ndisusb_dwrite_ep;
|
||||
|
@ -135,11 +135,11 @@ struct uaudio_chan {
|
||||
struct pcmchan_caps pcm_cap; /* capabilities */
|
||||
|
||||
struct snd_dbuf *pcm_buf;
|
||||
const struct usb2_config *usb2_cfg;
|
||||
const struct usb_config *usb2_cfg;
|
||||
struct mtx *pcm_mtx; /* lock protecting this structure */
|
||||
struct uaudio_softc *priv_sc;
|
||||
struct pcm_channel *pcm_ch;
|
||||
struct usb2_xfer *xfer[UAUDIO_NCHANBUFS];
|
||||
struct usb_xfer *xfer[UAUDIO_NCHANBUFS];
|
||||
const struct usb2_audio_streaming_interface_descriptor *p_asid;
|
||||
const struct usb2_audio_streaming_type1_descriptor *p_asf1d;
|
||||
const struct usb2_audio_streaming_endpoint_descriptor *p_sed;
|
||||
@ -171,7 +171,7 @@ struct uaudio_chan {
|
||||
#define UMIDI_BULK_SIZE 1024 /* bytes */
|
||||
|
||||
struct umidi_sub_chan {
|
||||
struct usb2_fifo_sc fifo;
|
||||
struct usb_fifo_sc fifo;
|
||||
uint8_t *temp_cmd;
|
||||
uint8_t temp_0[4];
|
||||
uint8_t temp_1[4];
|
||||
@ -194,7 +194,7 @@ struct umidi_chan {
|
||||
struct umidi_sub_chan sub[UMIDI_CABLES_MAX];
|
||||
struct mtx mtx;
|
||||
|
||||
struct usb2_xfer *xfer[UMIDI_N_TRANSFER];
|
||||
struct usb_xfer *xfer[UMIDI_N_TRANSFER];
|
||||
|
||||
uint8_t iface_index;
|
||||
uint8_t iface_alt_index;
|
||||
@ -218,8 +218,8 @@ struct uaudio_softc {
|
||||
struct uaudio_chan sc_play_chan;
|
||||
struct umidi_chan sc_midi_chan;
|
||||
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb2_xfer *sc_mixer_xfer[1];
|
||||
struct usb_device *sc_udev;
|
||||
struct usb_xfer *sc_mixer_xfer[1];
|
||||
struct uaudio_mixer_node *sc_mixer_root;
|
||||
struct uaudio_mixer_node *sc_mixer_curr;
|
||||
|
||||
@ -251,7 +251,7 @@ struct uaudio_search_result {
|
||||
|
||||
struct uaudio_terminal_node {
|
||||
union {
|
||||
const struct usb2_descriptor *desc;
|
||||
const struct usb_descriptor *desc;
|
||||
const struct usb2_audio_input_terminal *it;
|
||||
const struct usb2_audio_output_terminal *ot;
|
||||
const struct usb2_audio_mixer_unit_0 *mu;
|
||||
@ -317,9 +317,9 @@ static usb2_callback_t umidi_write_clear_stall_callback;
|
||||
static usb2_callback_t umidi_bulk_write_callback;
|
||||
|
||||
static void uaudio_chan_fill_info_sub(struct uaudio_softc *,
|
||||
struct usb2_device *, uint32_t, uint16_t, uint8_t, uint8_t);
|
||||
struct usb_device *, uint32_t, uint16_t, uint8_t, uint8_t);
|
||||
static void uaudio_chan_fill_info(struct uaudio_softc *,
|
||||
struct usb2_device *);
|
||||
struct usb_device *);
|
||||
static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *,
|
||||
struct uaudio_mixer_node *);
|
||||
static void uaudio_mixer_add_ctl(struct uaudio_softc *,
|
||||
@ -357,25 +357,25 @@ static void uaudio_mixer_find_inputs_sub(struct uaudio_terminal_node *,
|
||||
static void uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *,
|
||||
uint8_t, uint8_t, struct uaudio_search_result *);
|
||||
static void uaudio_mixer_fill_info(struct uaudio_softc *,
|
||||
struct usb2_device *, void *);
|
||||
static uint16_t uaudio_mixer_get(struct usb2_device *, uint8_t,
|
||||
struct usb_device *, void *);
|
||||
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 usb2_device *, uint8_t, uint32_t);
|
||||
static usb2_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);
|
||||
static void uaudio_mixer_init(struct uaudio_softc *);
|
||||
static uint8_t umidi_convert_to_usb(struct umidi_sub_chan *, uint8_t, uint8_t);
|
||||
static struct umidi_sub_chan *umidi_sub_by_fifo(struct usb2_fifo *);
|
||||
static void umidi_start_read(struct usb2_fifo *);
|
||||
static void umidi_stop_read(struct usb2_fifo *);
|
||||
static void umidi_start_write(struct usb2_fifo *);
|
||||
static void umidi_stop_write(struct usb2_fifo *);
|
||||
static int umidi_open(struct usb2_fifo *, int);
|
||||
static int umidi_ioctl(struct usb2_fifo *, u_long cmd, void *, int);
|
||||
static void umidi_close(struct usb2_fifo *, int);
|
||||
static struct umidi_sub_chan *umidi_sub_by_fifo(struct usb_fifo *);
|
||||
static void umidi_start_read(struct usb_fifo *);
|
||||
static void umidi_stop_read(struct usb_fifo *);
|
||||
static void umidi_start_write(struct usb_fifo *);
|
||||
static void umidi_stop_write(struct usb_fifo *);
|
||||
static int umidi_open(struct usb_fifo *, int);
|
||||
static int umidi_ioctl(struct usb_fifo *, u_long cmd, void *, int);
|
||||
static void umidi_close(struct usb_fifo *, int);
|
||||
static void umidi_init(device_t dev);
|
||||
static int32_t umidi_probe(device_t dev);
|
||||
static int32_t umidi_detach(device_t dev);
|
||||
@ -388,7 +388,7 @@ static void uaudio_mixer_dump_cluster(uint8_t,
|
||||
static const char *uaudio_mixer_get_terminal_name(uint16_t);
|
||||
#endif
|
||||
|
||||
static const struct usb2_config
|
||||
static const struct usb_config
|
||||
uaudio_cfg_record[UAUDIO_NCHANBUFS] = {
|
||||
[0] = {
|
||||
.type = UE_ISOCHRONOUS,
|
||||
@ -411,7 +411,7 @@ static const struct usb2_config
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_config
|
||||
static const struct usb_config
|
||||
uaudio_cfg_play[UAUDIO_NCHANBUFS] = {
|
||||
[0] = {
|
||||
.type = UE_ISOCHRONOUS,
|
||||
@ -434,13 +434,13 @@ static const struct usb2_config
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_config
|
||||
static const struct usb_config
|
||||
uaudio_mixer_config[1] = {
|
||||
[0] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = (sizeof(struct usb2_device_request) + 4),
|
||||
.bufsize = (sizeof(struct usb_device_request) + 4),
|
||||
.callback = &uaudio_mixer_write_cfg_callback,
|
||||
.timeout = 1000, /* 1 second */
|
||||
},
|
||||
@ -466,7 +466,7 @@ uint8_t umidi_cmd_to_len[16] = {
|
||||
[0xF] = 1, /* bytes */
|
||||
};
|
||||
|
||||
static const struct usb2_config
|
||||
static const struct usb_config
|
||||
umidi_config[UMIDI_N_TRANSFER] = {
|
||||
[0] = {
|
||||
.type = UE_BULK,
|
||||
@ -490,7 +490,7 @@ static const struct usb2_config
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request),
|
||||
.bufsize = sizeof(struct usb_device_request),
|
||||
.flags = {},
|
||||
.callback = &umidi_write_clear_stall_callback,
|
||||
.timeout = 1000, /* 1 second */
|
||||
@ -501,7 +501,7 @@ static const struct usb2_config
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request),
|
||||
.bufsize = sizeof(struct usb_device_request),
|
||||
.flags = {},
|
||||
.callback = &umidi_read_clear_stall_callback,
|
||||
.timeout = 1000, /* 1 second */
|
||||
@ -531,7 +531,7 @@ static driver_t uaudio_driver = {
|
||||
static int
|
||||
uaudio_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST)
|
||||
return (ENXIO);
|
||||
@ -554,9 +554,9 @@ uaudio_probe(device_t dev)
|
||||
static int
|
||||
uaudio_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct uaudio_softc *sc = device_get_softc(dev);
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb_interface_descriptor *id;
|
||||
device_t child;
|
||||
|
||||
sc->sc_play_chan.priv_sc = sc;
|
||||
@ -767,18 +767,18 @@ uaudio_chan_dump_ep_desc(const usb2_endpoint_descriptor_audio_t *ed)
|
||||
#endif
|
||||
|
||||
static void
|
||||
uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb2_device *udev,
|
||||
uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb_device *udev,
|
||||
uint32_t rate, uint16_t fps, uint8_t channels,
|
||||
uint8_t bit_resolution)
|
||||
{
|
||||
struct usb2_descriptor *desc = NULL;
|
||||
struct usb_descriptor *desc = NULL;
|
||||
const struct usb2_audio_streaming_interface_descriptor *asid = NULL;
|
||||
const struct usb2_audio_streaming_type1_descriptor *asf1d = NULL;
|
||||
const struct usb2_audio_streaming_endpoint_descriptor *sed = NULL;
|
||||
const usb2_endpoint_descriptor_audio_t *ed1 = NULL;
|
||||
const usb2_endpoint_descriptor_audio_t *ed2 = NULL;
|
||||
struct usb2_config_descriptor *cd = usb2_get_config_descriptor(udev);
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb_config_descriptor *cd = usb2_get_config_descriptor(udev);
|
||||
struct usb_interface_descriptor *id;
|
||||
const struct uaudio_format *p_fmt;
|
||||
struct uaudio_chan *chan;
|
||||
uint16_t curidx = 0xFFFF;
|
||||
@ -1049,7 +1049,7 @@ uaudio_chan_fill_info_sub(struct uaudio_softc *sc, struct usb2_device *udev,
|
||||
}
|
||||
|
||||
static void
|
||||
uaudio_chan_fill_info(struct uaudio_softc *sc, struct usb2_device *udev)
|
||||
uaudio_chan_fill_info(struct uaudio_softc *sc, struct usb_device *udev)
|
||||
{
|
||||
uint32_t rate = uaudio_default_rate;
|
||||
uint32_t z;
|
||||
@ -1098,7 +1098,7 @@ uaudio_chan_fill_info(struct uaudio_softc *sc, struct usb2_device *udev)
|
||||
}
|
||||
|
||||
static void
|
||||
uaudio_chan_play_callback(struct usb2_xfer *xfer)
|
||||
uaudio_chan_play_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uaudio_chan *ch = xfer->priv_sc;
|
||||
uint32_t *p_len = xfer->frlengths;
|
||||
@ -1187,7 +1187,7 @@ uaudio_chan_play_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uaudio_chan_record_callback(struct usb2_xfer *xfer)
|
||||
uaudio_chan_record_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uaudio_chan *ch = xfer->priv_sc;
|
||||
uint32_t *p_len = xfer->frlengths;
|
||||
@ -1999,7 +1999,7 @@ uaudio_mixer_verify_desc(const void *arg, uint32_t len)
|
||||
const struct usb2_audio_processing_unit_1 *u1;
|
||||
|
||||
union {
|
||||
const struct usb2_descriptor *desc;
|
||||
const struct usb_descriptor *desc;
|
||||
const struct usb2_audio_input_terminal *it;
|
||||
const struct usb2_audio_output_terminal *ot;
|
||||
const struct usb2_audio_mixer_unit_0 *mu;
|
||||
@ -2151,7 +2151,7 @@ static struct usb2_audio_cluster
|
||||
uaudio_mixer_get_cluster(uint8_t id, const struct uaudio_terminal_node *iot)
|
||||
{
|
||||
struct usb2_audio_cluster r;
|
||||
const struct usb2_descriptor *dp;
|
||||
const struct usb_descriptor *dp;
|
||||
uint8_t i;
|
||||
|
||||
for (i = 0; i < UAUDIO_RECURSE_LIMIT; i++) { /* avoid infinite loops */
|
||||
@ -2618,12 +2618,12 @@ uaudio_mixer_find_outputs_sub(struct uaudio_terminal_node *root, uint8_t id,
|
||||
}
|
||||
|
||||
static void
|
||||
uaudio_mixer_fill_info(struct uaudio_softc *sc, struct usb2_device *udev,
|
||||
uaudio_mixer_fill_info(struct uaudio_softc *sc, struct usb_device *udev,
|
||||
void *desc)
|
||||
{
|
||||
const struct usb2_audio_control_descriptor *acdp;
|
||||
struct usb2_config_descriptor *cd = usb2_get_config_descriptor(udev);
|
||||
const struct usb2_descriptor *dp;
|
||||
struct usb_config_descriptor *cd = usb2_get_config_descriptor(udev);
|
||||
const struct usb_descriptor *dp;
|
||||
const struct usb2_audio_unit *au;
|
||||
struct uaudio_terminal_node *iot = NULL;
|
||||
uint16_t wTotalLen;
|
||||
@ -2866,10 +2866,10 @@ uaudio_mixer_fill_info(struct uaudio_softc *sc, struct usb2_device *udev,
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
uaudio_mixer_get(struct usb2_device *udev, uint8_t what,
|
||||
uaudio_mixer_get(struct usb_device *udev, uint8_t what,
|
||||
struct uaudio_mixer_node *mc)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint16_t val;
|
||||
uint16_t len = MIX_SIZE(mc->type);
|
||||
uint8_t data[4];
|
||||
@ -2903,9 +2903,9 @@ uaudio_mixer_get(struct usb2_device *udev, uint8_t what,
|
||||
}
|
||||
|
||||
static void
|
||||
uaudio_mixer_write_cfg_callback(struct usb2_xfer *xfer)
|
||||
uaudio_mixer_write_cfg_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
struct uaudio_softc *sc = xfer->priv_sc;
|
||||
struct uaudio_mixer_node *mc = sc->sc_mixer_curr;
|
||||
uint16_t len;
|
||||
@ -2988,9 +2988,9 @@ uaudio_mixer_write_cfg_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
uaudio_set_speed(struct usb2_device *udev, uint8_t endpt, uint32_t speed)
|
||||
uaudio_set_speed(struct usb_device *udev, uint8_t endpt, uint32_t speed)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint8_t data[3];
|
||||
|
||||
DPRINTFN(6, "endpt=%d speed=%u\n", endpt, speed);
|
||||
@ -3182,10 +3182,10 @@ uaudio_mixer_setrecsrc(struct uaudio_softc *sc, uint32_t src)
|
||||
*========================================================================*/
|
||||
|
||||
static void
|
||||
umidi_read_clear_stall_callback(struct usb2_xfer *xfer)
|
||||
umidi_read_clear_stall_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umidi_chan *chan = xfer->priv_sc;
|
||||
struct usb2_xfer *xfer_other = chan->xfer[1];
|
||||
struct usb_xfer *xfer_other = chan->xfer[1];
|
||||
|
||||
if (usb2_clear_stall_callback(xfer, xfer_other)) {
|
||||
DPRINTF("stall cleared\n");
|
||||
@ -3195,7 +3195,7 @@ umidi_read_clear_stall_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umidi_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
umidi_bulk_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umidi_chan *chan = xfer->priv_sc;
|
||||
struct umidi_sub_chan *sub;
|
||||
@ -3261,10 +3261,10 @@ umidi_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umidi_write_clear_stall_callback(struct usb2_xfer *xfer)
|
||||
umidi_write_clear_stall_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umidi_chan *chan = xfer->priv_sc;
|
||||
struct usb2_xfer *xfer_other = chan->xfer[0];
|
||||
struct usb_xfer *xfer_other = chan->xfer[0];
|
||||
|
||||
if (usb2_clear_stall_callback(xfer, xfer_other)) {
|
||||
DPRINTF("stall cleared\n");
|
||||
@ -3407,7 +3407,7 @@ umidi_convert_to_usb(struct umidi_sub_chan *sub, uint8_t cn, uint8_t b)
|
||||
}
|
||||
|
||||
static void
|
||||
umidi_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
umidi_bulk_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umidi_chan *chan = xfer->priv_sc;
|
||||
struct umidi_sub_chan *sub;
|
||||
@ -3507,7 +3507,7 @@ umidi_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static struct umidi_sub_chan *
|
||||
umidi_sub_by_fifo(struct usb2_fifo *fifo)
|
||||
umidi_sub_by_fifo(struct usb_fifo *fifo)
|
||||
{
|
||||
struct umidi_chan *chan = fifo->priv_sc0;
|
||||
struct umidi_sub_chan *sub;
|
||||
@ -3521,14 +3521,14 @@ umidi_sub_by_fifo(struct usb2_fifo *fifo)
|
||||
}
|
||||
}
|
||||
|
||||
panic("%s:%d cannot find usb2_fifo!\n",
|
||||
panic("%s:%d cannot find usb_fifo!\n",
|
||||
__FILE__, __LINE__);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
umidi_start_read(struct usb2_fifo *fifo)
|
||||
umidi_start_read(struct usb_fifo *fifo)
|
||||
{
|
||||
struct umidi_chan *chan = fifo->priv_sc0;
|
||||
|
||||
@ -3536,7 +3536,7 @@ umidi_start_read(struct usb2_fifo *fifo)
|
||||
}
|
||||
|
||||
static void
|
||||
umidi_stop_read(struct usb2_fifo *fifo)
|
||||
umidi_stop_read(struct usb_fifo *fifo)
|
||||
{
|
||||
struct umidi_chan *chan = fifo->priv_sc0;
|
||||
struct umidi_sub_chan *sub = umidi_sub_by_fifo(fifo);
|
||||
@ -3555,7 +3555,7 @@ umidi_stop_read(struct usb2_fifo *fifo)
|
||||
}
|
||||
|
||||
static void
|
||||
umidi_start_write(struct usb2_fifo *fifo)
|
||||
umidi_start_write(struct usb_fifo *fifo)
|
||||
{
|
||||
struct umidi_chan *chan = fifo->priv_sc0;
|
||||
|
||||
@ -3563,7 +3563,7 @@ umidi_start_write(struct usb2_fifo *fifo)
|
||||
}
|
||||
|
||||
static void
|
||||
umidi_stop_write(struct usb2_fifo *fifo)
|
||||
umidi_stop_write(struct usb_fifo *fifo)
|
||||
{
|
||||
struct umidi_chan *chan = fifo->priv_sc0;
|
||||
struct umidi_sub_chan *sub = umidi_sub_by_fifo(fifo);
|
||||
@ -3580,7 +3580,7 @@ umidi_stop_write(struct usb2_fifo *fifo)
|
||||
}
|
||||
|
||||
static int
|
||||
umidi_open(struct usb2_fifo *fifo, int fflags)
|
||||
umidi_open(struct usb_fifo *fifo, int fflags)
|
||||
{
|
||||
struct umidi_chan *chan = fifo->priv_sc0;
|
||||
struct umidi_sub_chan *sub = umidi_sub_by_fifo(fifo);
|
||||
@ -3612,7 +3612,7 @@ umidi_open(struct usb2_fifo *fifo, int fflags)
|
||||
}
|
||||
|
||||
static void
|
||||
umidi_close(struct usb2_fifo *fifo, int fflags)
|
||||
umidi_close(struct usb_fifo *fifo, int fflags)
|
||||
{
|
||||
if (fflags & FREAD) {
|
||||
usb2_fifo_free_buffer(fifo);
|
||||
@ -3624,7 +3624,7 @@ umidi_close(struct usb2_fifo *fifo, int fflags)
|
||||
|
||||
|
||||
static int
|
||||
umidi_ioctl(struct usb2_fifo *fifo, u_long cmd, void *data,
|
||||
umidi_ioctl(struct usb_fifo *fifo, u_long cmd, void *data,
|
||||
int fflags)
|
||||
{
|
||||
return (ENODEV);
|
||||
@ -3639,7 +3639,7 @@ umidi_init(device_t dev)
|
||||
mtx_init(&chan->mtx, "umidi lock", NULL, MTX_DEF | MTX_RECURSE);
|
||||
}
|
||||
|
||||
static struct usb2_fifo_methods umidi_fifo_methods = {
|
||||
static struct usb_fifo_methods umidi_fifo_methods = {
|
||||
.f_start_read = &umidi_start_read,
|
||||
.f_start_write = &umidi_start_write,
|
||||
.f_stop_read = &umidi_stop_read,
|
||||
@ -3654,7 +3654,7 @@ static int32_t
|
||||
umidi_probe(device_t dev)
|
||||
{
|
||||
struct uaudio_softc *sc = device_get_softc(dev);
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct umidi_chan *chan = &sc->sc_midi_chan;
|
||||
struct umidi_sub_chan *sub;
|
||||
int unit = device_get_unit(dev);
|
||||
|
@ -47,7 +47,7 @@
|
||||
#define UDESCSUB_AC_PROCESSING 7
|
||||
#define UDESCSUB_AC_EXTENSION 8
|
||||
|
||||
/* The first fields are identical to struct usb2_endpoint_descriptor */
|
||||
/* The first fields are identical to struct usb_endpoint_descriptor */
|
||||
typedef struct {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
|
@ -82,19 +82,19 @@ SYSCTL_INT(_hw_usb_at91dci, OID_AUTO, debug, CTLFLAG_RW,
|
||||
|
||||
/* prototypes */
|
||||
|
||||
struct usb2_bus_methods at91dci_bus_methods;
|
||||
struct usb2_pipe_methods at91dci_device_bulk_methods;
|
||||
struct usb2_pipe_methods at91dci_device_ctrl_methods;
|
||||
struct usb2_pipe_methods at91dci_device_intr_methods;
|
||||
struct usb2_pipe_methods at91dci_device_isoc_fs_methods;
|
||||
struct usb_bus_methods at91dci_bus_methods;
|
||||
struct usb_pipe_methods at91dci_device_bulk_methods;
|
||||
struct usb_pipe_methods at91dci_device_ctrl_methods;
|
||||
struct usb_pipe_methods at91dci_device_intr_methods;
|
||||
struct usb_pipe_methods at91dci_device_isoc_fs_methods;
|
||||
|
||||
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 usb2_xfer *, usb2_error_t);
|
||||
static void at91dci_do_poll(struct usb2_bus *);
|
||||
static void at91dci_standard_done(struct usb2_xfer *);
|
||||
static void at91dci_device_done(struct usb_xfer *, usb2_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);
|
||||
|
||||
/*
|
||||
@ -116,7 +116,7 @@ static void at91dci_root_intr(struct at91dci_softc *sc);
|
||||
* Here is a list of what the chip supports.
|
||||
* Probably it supports more than listed here!
|
||||
*/
|
||||
static const struct usb2_hw_ep_profile
|
||||
static const struct usb_hw_ep_profile
|
||||
at91dci_ep_profile[AT91_UDP_EP_MAX] = {
|
||||
|
||||
[0] = {
|
||||
@ -181,8 +181,8 @@ static const struct usb2_hw_ep_profile
|
||||
};
|
||||
|
||||
static void
|
||||
at91dci_get_hw_ep_profile(struct usb2_device *udev,
|
||||
const struct usb2_hw_ep_profile **ppf, uint8_t ep_addr)
|
||||
at91dci_get_hw_ep_profile(struct usb_device *udev,
|
||||
const struct usb_hw_ep_profile **ppf, uint8_t ep_addr)
|
||||
{
|
||||
if (ep_addr < AT91_UDP_EP_MAX) {
|
||||
*ppf = (at91dci_ep_profile + ep_addr);
|
||||
@ -278,7 +278,7 @@ static uint8_t
|
||||
at91dci_setup_rx(struct at91dci_td *td)
|
||||
{
|
||||
struct at91dci_softc *sc;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint32_t csr;
|
||||
uint32_t temp;
|
||||
uint16_t count;
|
||||
@ -372,7 +372,7 @@ at91dci_setup_rx(struct at91dci_td *td)
|
||||
static uint8_t
|
||||
at91dci_data_rx(struct at91dci_td *td)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
uint32_t csr;
|
||||
uint32_t temp;
|
||||
uint16_t count;
|
||||
@ -499,7 +499,7 @@ at91dci_data_rx(struct at91dci_td *td)
|
||||
static uint8_t
|
||||
at91dci_data_tx(struct at91dci_td *td)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
uint32_t csr;
|
||||
uint32_t temp;
|
||||
uint16_t count;
|
||||
@ -643,7 +643,7 @@ at91dci_data_tx_sync(struct at91dci_td *td)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
at91dci_xfer_do_fifo(struct usb2_xfer *xfer)
|
||||
at91dci_xfer_do_fifo(struct usb_xfer *xfer)
|
||||
{
|
||||
struct at91dci_softc *sc;
|
||||
struct at91dci_td *td;
|
||||
@ -706,7 +706,7 @@ at91dci_xfer_do_fifo(struct usb2_xfer *xfer)
|
||||
static void
|
||||
at91dci_interrupt_poll(struct at91dci_softc *sc)
|
||||
{
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
|
||||
repeat:
|
||||
TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) {
|
||||
@ -854,7 +854,7 @@ at91dci_setup_standard_chain_sub(struct at91dci_std_temp *temp)
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_setup_standard_chain(struct usb2_xfer *xfer)
|
||||
at91dci_setup_standard_chain(struct usb_xfer *xfer)
|
||||
{
|
||||
struct at91dci_std_temp temp;
|
||||
struct at91dci_softc *sc;
|
||||
@ -1015,7 +1015,7 @@ at91dci_setup_standard_chain(struct usb2_xfer *xfer)
|
||||
static void
|
||||
at91dci_timeout(void *arg)
|
||||
{
|
||||
struct usb2_xfer *xfer = arg;
|
||||
struct usb_xfer *xfer = arg;
|
||||
|
||||
DPRINTF("xfer=%p\n", xfer);
|
||||
|
||||
@ -1026,7 +1026,7 @@ at91dci_timeout(void *arg)
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_start_standard_chain(struct usb2_xfer *xfer)
|
||||
at91dci_start_standard_chain(struct usb_xfer *xfer)
|
||||
{
|
||||
DPRINTFN(9, "\n");
|
||||
|
||||
@ -1071,7 +1071,7 @@ at91dci_root_intr(struct at91dci_softc *sc)
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
at91dci_standard_done_sub(struct usb2_xfer *xfer)
|
||||
at91dci_standard_done_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
struct at91dci_td *td;
|
||||
uint32_t len;
|
||||
@ -1135,7 +1135,7 @@ at91dci_standard_done_sub(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_standard_done(struct usb2_xfer *xfer)
|
||||
at91dci_standard_done(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
|
||||
@ -1184,7 +1184,7 @@ at91dci_standard_done(struct usb2_xfer *xfer)
|
||||
* same USB transfer!
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
at91dci_device_done(struct usb2_xfer *xfer, usb2_error_t error)
|
||||
at91dci_device_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
{
|
||||
struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus);
|
||||
uint8_t ep_no;
|
||||
@ -1207,8 +1207,8 @@ at91dci_device_done(struct usb2_xfer *xfer, usb2_error_t error)
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_set_stall(struct usb2_device *udev, struct usb2_xfer *xfer,
|
||||
struct usb2_pipe *pipe)
|
||||
at91dci_set_stall(struct usb_device *udev, struct usb_xfer *xfer,
|
||||
struct usb_pipe *pipe)
|
||||
{
|
||||
struct at91dci_softc *sc;
|
||||
uint32_t csr_val;
|
||||
@ -1235,7 +1235,7 @@ static void
|
||||
at91dci_clear_stall_sub(struct at91dci_softc *sc, uint8_t ep_no,
|
||||
uint8_t ep_type, uint8_t ep_dir)
|
||||
{
|
||||
const struct usb2_hw_ep_profile *pf;
|
||||
const struct usb_hw_ep_profile *pf;
|
||||
uint32_t csr_val;
|
||||
uint32_t temp;
|
||||
uint8_t csr_reg;
|
||||
@ -1328,10 +1328,10 @@ at91dci_clear_stall_sub(struct at91dci_softc *sc, uint8_t ep_no,
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_clear_stall(struct usb2_device *udev, struct usb2_pipe *pipe)
|
||||
at91dci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
|
||||
{
|
||||
struct at91dci_softc *sc;
|
||||
struct usb2_endpoint_descriptor *ed;
|
||||
struct usb_endpoint_descriptor *ed;
|
||||
|
||||
DPRINTFN(5, "pipe=%p\n", pipe);
|
||||
|
||||
@ -1455,7 +1455,7 @@ at91dci_resume(struct at91dci_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_do_poll(struct usb2_bus *bus)
|
||||
at91dci_do_poll(struct usb_bus *bus)
|
||||
{
|
||||
struct at91dci_softc *sc = AT9100_DCI_BUS2SC(bus);
|
||||
|
||||
@ -1468,32 +1468,32 @@ at91dci_do_poll(struct usb2_bus *bus)
|
||||
* at91dci bulk support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
at91dci_device_bulk_open(struct usb2_xfer *xfer)
|
||||
at91dci_device_bulk_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_device_bulk_close(struct usb2_xfer *xfer)
|
||||
at91dci_device_bulk_close(struct usb_xfer *xfer)
|
||||
{
|
||||
at91dci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_device_bulk_enter(struct usb2_xfer *xfer)
|
||||
at91dci_device_bulk_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_device_bulk_start(struct usb2_xfer *xfer)
|
||||
at91dci_device_bulk_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* setup TDs */
|
||||
at91dci_setup_standard_chain(xfer);
|
||||
at91dci_start_standard_chain(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods at91dci_device_bulk_methods =
|
||||
struct usb_pipe_methods at91dci_device_bulk_methods =
|
||||
{
|
||||
.open = at91dci_device_bulk_open,
|
||||
.close = at91dci_device_bulk_close,
|
||||
@ -1505,32 +1505,32 @@ struct usb2_pipe_methods at91dci_device_bulk_methods =
|
||||
* at91dci control support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
at91dci_device_ctrl_open(struct usb2_xfer *xfer)
|
||||
at91dci_device_ctrl_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_device_ctrl_close(struct usb2_xfer *xfer)
|
||||
at91dci_device_ctrl_close(struct usb_xfer *xfer)
|
||||
{
|
||||
at91dci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_device_ctrl_enter(struct usb2_xfer *xfer)
|
||||
at91dci_device_ctrl_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_device_ctrl_start(struct usb2_xfer *xfer)
|
||||
at91dci_device_ctrl_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* setup TDs */
|
||||
at91dci_setup_standard_chain(xfer);
|
||||
at91dci_start_standard_chain(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods at91dci_device_ctrl_methods =
|
||||
struct usb_pipe_methods at91dci_device_ctrl_methods =
|
||||
{
|
||||
.open = at91dci_device_ctrl_open,
|
||||
.close = at91dci_device_ctrl_close,
|
||||
@ -1542,32 +1542,32 @@ struct usb2_pipe_methods at91dci_device_ctrl_methods =
|
||||
* at91dci interrupt support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
at91dci_device_intr_open(struct usb2_xfer *xfer)
|
||||
at91dci_device_intr_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_device_intr_close(struct usb2_xfer *xfer)
|
||||
at91dci_device_intr_close(struct usb_xfer *xfer)
|
||||
{
|
||||
at91dci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_device_intr_enter(struct usb2_xfer *xfer)
|
||||
at91dci_device_intr_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_device_intr_start(struct usb2_xfer *xfer)
|
||||
at91dci_device_intr_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* setup TDs */
|
||||
at91dci_setup_standard_chain(xfer);
|
||||
at91dci_start_standard_chain(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods at91dci_device_intr_methods =
|
||||
struct usb_pipe_methods at91dci_device_intr_methods =
|
||||
{
|
||||
.open = at91dci_device_intr_open,
|
||||
.close = at91dci_device_intr_close,
|
||||
@ -1579,19 +1579,19 @@ struct usb2_pipe_methods at91dci_device_intr_methods =
|
||||
* at91dci full speed isochronous support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
at91dci_device_isoc_fs_open(struct usb2_xfer *xfer)
|
||||
at91dci_device_isoc_fs_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_device_isoc_fs_close(struct usb2_xfer *xfer)
|
||||
at91dci_device_isoc_fs_close(struct usb_xfer *xfer)
|
||||
{
|
||||
at91dci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_device_isoc_fs_enter(struct usb2_xfer *xfer)
|
||||
at91dci_device_isoc_fs_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
struct at91dci_softc *sc = AT9100_DCI_BUS2SC(xfer->xroot->bus);
|
||||
uint32_t temp;
|
||||
@ -1643,13 +1643,13 @@ at91dci_device_isoc_fs_enter(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_device_isoc_fs_start(struct usb2_xfer *xfer)
|
||||
at91dci_device_isoc_fs_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* start TD chain */
|
||||
at91dci_start_standard_chain(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods at91dci_device_isoc_fs_methods =
|
||||
struct usb_pipe_methods at91dci_device_isoc_fs_methods =
|
||||
{
|
||||
.open = at91dci_device_isoc_fs_open,
|
||||
.close = at91dci_device_isoc_fs_close,
|
||||
@ -1663,8 +1663,8 @@ struct usb2_pipe_methods at91dci_device_isoc_fs_methods =
|
||||
* Simulate a hardware HUB by handling all the necessary requests.
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
static const struct usb2_device_descriptor at91dci_devd = {
|
||||
.bLength = sizeof(struct usb2_device_descriptor),
|
||||
static const struct usb_device_descriptor at91dci_devd = {
|
||||
.bLength = sizeof(struct usb_device_descriptor),
|
||||
.bDescriptorType = UDESC_DEVICE,
|
||||
.bcdUSB = {0x00, 0x02},
|
||||
.bDeviceClass = UDCLASS_HUB,
|
||||
@ -1677,8 +1677,8 @@ static const struct usb2_device_descriptor at91dci_devd = {
|
||||
.bNumConfigurations = 1,
|
||||
};
|
||||
|
||||
static const struct usb2_device_qualifier at91dci_odevd = {
|
||||
.bLength = sizeof(struct usb2_device_qualifier),
|
||||
static const struct usb_device_qualifier at91dci_odevd = {
|
||||
.bLength = sizeof(struct usb_device_qualifier),
|
||||
.bDescriptorType = UDESC_DEVICE_QUALIFIER,
|
||||
.bcdUSB = {0x00, 0x02},
|
||||
.bDeviceClass = UDCLASS_HUB,
|
||||
@ -1690,7 +1690,7 @@ static const struct usb2_device_qualifier at91dci_odevd = {
|
||||
|
||||
static const struct at91dci_config_desc at91dci_confd = {
|
||||
.confd = {
|
||||
.bLength = sizeof(struct usb2_config_descriptor),
|
||||
.bLength = sizeof(struct usb_config_descriptor),
|
||||
.bDescriptorType = UDESC_CONFIG,
|
||||
.wTotalLength[0] = sizeof(at91dci_confd),
|
||||
.bNumInterface = 1,
|
||||
@ -1700,7 +1700,7 @@ static const struct at91dci_config_desc at91dci_confd = {
|
||||
.bMaxPower = 0,
|
||||
},
|
||||
.ifcd = {
|
||||
.bLength = sizeof(struct usb2_interface_descriptor),
|
||||
.bLength = sizeof(struct usb_interface_descriptor),
|
||||
.bDescriptorType = UDESC_INTERFACE,
|
||||
.bNumEndpoints = 1,
|
||||
.bInterfaceClass = UICLASS_HUB,
|
||||
@ -1708,7 +1708,7 @@ static const struct at91dci_config_desc at91dci_confd = {
|
||||
.bInterfaceProtocol = UIPROTO_HSHUBSTT,
|
||||
},
|
||||
.endpd = {
|
||||
.bLength = sizeof(struct usb2_endpoint_descriptor),
|
||||
.bLength = sizeof(struct usb_endpoint_descriptor),
|
||||
.bDescriptorType = UDESC_ENDPOINT,
|
||||
.bEndpointAddress = (UE_DIR_IN | AT9100_DCI_INTR_ENDPT),
|
||||
.bmAttributes = UE_INTERRUPT,
|
||||
@ -1717,7 +1717,7 @@ static const struct at91dci_config_desc at91dci_confd = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_hub_descriptor_min at91dci_hubd = {
|
||||
static const struct usb_hub_descriptor_min at91dci_hubd = {
|
||||
.bDescLength = sizeof(at91dci_hubd),
|
||||
.bDescriptorType = UDESC_HUB,
|
||||
.bNbrPorts = 1,
|
||||
@ -1746,8 +1746,8 @@ USB_MAKE_STRING_DESC(STRING_VENDOR, at91dci_vendor);
|
||||
USB_MAKE_STRING_DESC(STRING_PRODUCT, at91dci_product);
|
||||
|
||||
static usb2_error_t
|
||||
at91dci_roothub_exec(struct usb2_device *udev,
|
||||
struct usb2_device_request *req, const void **pptr, uint16_t *plength)
|
||||
at91dci_roothub_exec(struct usb_device *udev,
|
||||
struct usb_device_request *req, const void **pptr, uint16_t *plength)
|
||||
{
|
||||
struct at91dci_softc *sc = AT9100_DCI_BUS2SC(udev->bus);
|
||||
const void *ptr;
|
||||
@ -2143,11 +2143,11 @@ at91dci_roothub_exec(struct usb2_device *udev,
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_xfer_setup(struct usb2_setup_params *parm)
|
||||
at91dci_xfer_setup(struct usb_setup_params *parm)
|
||||
{
|
||||
const struct usb2_hw_ep_profile *pf;
|
||||
const struct usb_hw_ep_profile *pf;
|
||||
struct at91dci_softc *sc;
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
void *last_obj;
|
||||
uint32_t ntd;
|
||||
uint32_t n;
|
||||
@ -2252,14 +2252,14 @@ at91dci_xfer_setup(struct usb2_setup_params *parm)
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_xfer_unsetup(struct usb2_xfer *xfer)
|
||||
at91dci_xfer_unsetup(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
at91dci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *edesc,
|
||||
struct usb2_pipe *pipe)
|
||||
at91dci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
|
||||
struct usb_pipe *pipe)
|
||||
{
|
||||
struct at91dci_softc *sc = AT9100_DCI_BUS2SC(udev->bus);
|
||||
|
||||
@ -2298,7 +2298,7 @@ at91dci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *ede
|
||||
}
|
||||
}
|
||||
|
||||
struct usb2_bus_methods at91dci_bus_methods =
|
||||
struct usb_bus_methods at91dci_bus_methods =
|
||||
{
|
||||
.pipe_init = &at91dci_pipe_init,
|
||||
.xfer_setup = &at91dci_xfer_setup,
|
||||
|
@ -141,7 +141,7 @@ struct at91dci_td {
|
||||
bus_space_handle_t io_hdl;
|
||||
struct at91dci_td *obj_next;
|
||||
at91dci_cmd_t *func;
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_cache *pc;
|
||||
uint32_t offset;
|
||||
uint32_t remainder;
|
||||
uint16_t max_packet_size;
|
||||
@ -157,7 +157,7 @@ struct at91dci_td {
|
||||
|
||||
struct at91dci_std_temp {
|
||||
at91dci_cmd_t *func;
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_cache *pc;
|
||||
struct at91dci_td *td;
|
||||
struct at91dci_td *td_next;
|
||||
uint32_t len;
|
||||
@ -173,14 +173,14 @@ struct at91dci_std_temp {
|
||||
};
|
||||
|
||||
struct at91dci_config_desc {
|
||||
struct usb2_config_descriptor confd;
|
||||
struct usb2_interface_descriptor ifcd;
|
||||
struct usb2_endpoint_descriptor endpd;
|
||||
struct usb_config_descriptor confd;
|
||||
struct usb_interface_descriptor ifcd;
|
||||
struct usb_endpoint_descriptor endpd;
|
||||
} __packed;
|
||||
|
||||
union at91dci_hub_temp {
|
||||
uWord wValue;
|
||||
struct usb2_port_status ps;
|
||||
struct usb_port_status ps;
|
||||
};
|
||||
|
||||
struct at91dci_ep_flags {
|
||||
@ -202,10 +202,10 @@ struct at91dci_flags {
|
||||
};
|
||||
|
||||
struct at91dci_softc {
|
||||
struct usb2_bus sc_bus;
|
||||
struct usb_bus sc_bus;
|
||||
union at91dci_hub_temp sc_hub_temp;
|
||||
|
||||
struct usb2_device *sc_devices[AT91_MAX_DEVICES];
|
||||
struct usb_device *sc_devices[AT91_MAX_DEVICES];
|
||||
struct resource *sc_io_res;
|
||||
struct resource *sc_irq_res;
|
||||
void *sc_intr_hdl;
|
||||
|
@ -74,23 +74,23 @@ SYSCTL_INT(_hw_usb_atmegadci, OID_AUTO, debug, CTLFLAG_RW,
|
||||
|
||||
/* prototypes */
|
||||
|
||||
struct usb2_bus_methods atmegadci_bus_methods;
|
||||
struct usb2_pipe_methods atmegadci_device_non_isoc_methods;
|
||||
struct usb2_pipe_methods atmegadci_device_isoc_fs_methods;
|
||||
struct usb_bus_methods atmegadci_bus_methods;
|
||||
struct usb_pipe_methods atmegadci_device_non_isoc_methods;
|
||||
struct usb_pipe_methods atmegadci_device_isoc_fs_methods;
|
||||
|
||||
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 usb2_xfer *, usb2_error_t);
|
||||
static void atmegadci_do_poll(struct usb2_bus *);
|
||||
static void atmegadci_standard_done(struct usb2_xfer *);
|
||||
static void atmegadci_device_done(struct usb_xfer *, usb2_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);
|
||||
|
||||
/*
|
||||
* Here is a list of what the chip supports:
|
||||
*/
|
||||
static const struct usb2_hw_ep_profile
|
||||
static const struct usb_hw_ep_profile
|
||||
atmegadci_ep_profile[2] = {
|
||||
|
||||
[0] = {
|
||||
@ -112,8 +112,8 @@ static const struct usb2_hw_ep_profile
|
||||
};
|
||||
|
||||
static void
|
||||
atmegadci_get_hw_ep_profile(struct usb2_device *udev,
|
||||
const struct usb2_hw_ep_profile **ppf, uint8_t ep_addr)
|
||||
atmegadci_get_hw_ep_profile(struct usb_device *udev,
|
||||
const struct usb_hw_ep_profile **ppf, uint8_t ep_addr)
|
||||
{
|
||||
if (ep_addr == 0)
|
||||
*ppf = atmegadci_ep_profile;
|
||||
@ -223,7 +223,7 @@ static uint8_t
|
||||
atmegadci_setup_rx(struct atmegadci_td *td)
|
||||
{
|
||||
struct atmegadci_softc *sc;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint16_t count;
|
||||
uint8_t temp;
|
||||
|
||||
@ -308,7 +308,7 @@ static uint8_t
|
||||
atmegadci_data_rx(struct atmegadci_td *td)
|
||||
{
|
||||
struct atmegadci_softc *sc;
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
uint16_t count;
|
||||
uint8_t temp;
|
||||
uint8_t to;
|
||||
@ -422,7 +422,7 @@ static uint8_t
|
||||
atmegadci_data_tx(struct atmegadci_td *td)
|
||||
{
|
||||
struct atmegadci_softc *sc;
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
uint16_t count;
|
||||
uint8_t to;
|
||||
uint8_t temp;
|
||||
@ -549,7 +549,7 @@ atmegadci_data_tx_sync(struct atmegadci_td *td)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
atmegadci_xfer_do_fifo(struct usb2_xfer *xfer)
|
||||
atmegadci_xfer_do_fifo(struct usb_xfer *xfer)
|
||||
{
|
||||
struct atmegadci_td *td;
|
||||
|
||||
@ -594,7 +594,7 @@ atmegadci_xfer_do_fifo(struct usb2_xfer *xfer)
|
||||
static void
|
||||
atmegadci_interrupt_poll(struct atmegadci_softc *sc)
|
||||
{
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
|
||||
repeat:
|
||||
TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) {
|
||||
@ -757,7 +757,7 @@ atmegadci_setup_standard_chain_sub(struct atmegadci_std_temp *temp)
|
||||
}
|
||||
|
||||
static void
|
||||
atmegadci_setup_standard_chain(struct usb2_xfer *xfer)
|
||||
atmegadci_setup_standard_chain(struct usb_xfer *xfer)
|
||||
{
|
||||
struct atmegadci_std_temp temp;
|
||||
struct atmegadci_softc *sc;
|
||||
@ -910,7 +910,7 @@ atmegadci_setup_standard_chain(struct usb2_xfer *xfer)
|
||||
static void
|
||||
atmegadci_timeout(void *arg)
|
||||
{
|
||||
struct usb2_xfer *xfer = arg;
|
||||
struct usb_xfer *xfer = arg;
|
||||
|
||||
DPRINTF("xfer=%p\n", xfer);
|
||||
|
||||
@ -921,7 +921,7 @@ atmegadci_timeout(void *arg)
|
||||
}
|
||||
|
||||
static void
|
||||
atmegadci_start_standard_chain(struct usb2_xfer *xfer)
|
||||
atmegadci_start_standard_chain(struct usb_xfer *xfer)
|
||||
{
|
||||
DPRINTFN(9, "\n");
|
||||
|
||||
@ -954,7 +954,7 @@ atmegadci_root_intr(struct atmegadci_softc *sc)
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
atmegadci_standard_done_sub(struct usb2_xfer *xfer)
|
||||
atmegadci_standard_done_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
struct atmegadci_td *td;
|
||||
uint32_t len;
|
||||
@ -1018,7 +1018,7 @@ atmegadci_standard_done_sub(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
atmegadci_standard_done(struct usb2_xfer *xfer)
|
||||
atmegadci_standard_done(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
|
||||
@ -1067,7 +1067,7 @@ atmegadci_standard_done(struct usb2_xfer *xfer)
|
||||
* same USB transfer!
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
atmegadci_device_done(struct usb2_xfer *xfer, usb2_error_t error)
|
||||
atmegadci_device_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
{
|
||||
struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus);
|
||||
uint8_t ep_no;
|
||||
@ -1093,8 +1093,8 @@ atmegadci_device_done(struct usb2_xfer *xfer, usb2_error_t error)
|
||||
}
|
||||
|
||||
static void
|
||||
atmegadci_set_stall(struct usb2_device *udev, struct usb2_xfer *xfer,
|
||||
struct usb2_pipe *pipe)
|
||||
atmegadci_set_stall(struct usb_device *udev, struct usb_xfer *xfer,
|
||||
struct usb_pipe *pipe)
|
||||
{
|
||||
struct atmegadci_softc *sc;
|
||||
uint8_t ep_no;
|
||||
@ -1178,10 +1178,10 @@ atmegadci_clear_stall_sub(struct atmegadci_softc *sc, uint8_t ep_no,
|
||||
}
|
||||
|
||||
static void
|
||||
atmegadci_clear_stall(struct usb2_device *udev, struct usb2_pipe *pipe)
|
||||
atmegadci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
|
||||
{
|
||||
struct atmegadci_softc *sc;
|
||||
struct usb2_endpoint_descriptor *ed;
|
||||
struct usb_endpoint_descriptor *ed;
|
||||
|
||||
DPRINTFN(5, "pipe=%p\n", pipe);
|
||||
|
||||
@ -1344,7 +1344,7 @@ atmegadci_resume(struct atmegadci_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
atmegadci_do_poll(struct usb2_bus *bus)
|
||||
atmegadci_do_poll(struct usb_bus *bus)
|
||||
{
|
||||
struct atmegadci_softc *sc = ATMEGA_BUS2SC(bus);
|
||||
|
||||
@ -1359,32 +1359,32 @@ atmegadci_do_poll(struct usb2_bus *bus)
|
||||
* at91dci interrupt support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
atmegadci_device_non_isoc_open(struct usb2_xfer *xfer)
|
||||
atmegadci_device_non_isoc_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
atmegadci_device_non_isoc_close(struct usb2_xfer *xfer)
|
||||
atmegadci_device_non_isoc_close(struct usb_xfer *xfer)
|
||||
{
|
||||
atmegadci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
atmegadci_device_non_isoc_enter(struct usb2_xfer *xfer)
|
||||
atmegadci_device_non_isoc_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
atmegadci_device_non_isoc_start(struct usb2_xfer *xfer)
|
||||
atmegadci_device_non_isoc_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* setup TDs */
|
||||
atmegadci_setup_standard_chain(xfer);
|
||||
atmegadci_start_standard_chain(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods atmegadci_device_non_isoc_methods =
|
||||
struct usb_pipe_methods atmegadci_device_non_isoc_methods =
|
||||
{
|
||||
.open = atmegadci_device_non_isoc_open,
|
||||
.close = atmegadci_device_non_isoc_close,
|
||||
@ -1396,19 +1396,19 @@ struct usb2_pipe_methods atmegadci_device_non_isoc_methods =
|
||||
* at91dci full speed isochronous support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
atmegadci_device_isoc_fs_open(struct usb2_xfer *xfer)
|
||||
atmegadci_device_isoc_fs_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
atmegadci_device_isoc_fs_close(struct usb2_xfer *xfer)
|
||||
atmegadci_device_isoc_fs_close(struct usb_xfer *xfer)
|
||||
{
|
||||
atmegadci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
atmegadci_device_isoc_fs_enter(struct usb2_xfer *xfer)
|
||||
atmegadci_device_isoc_fs_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
struct atmegadci_softc *sc = ATMEGA_BUS2SC(xfer->xroot->bus);
|
||||
uint32_t temp;
|
||||
@ -1464,13 +1464,13 @@ atmegadci_device_isoc_fs_enter(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
atmegadci_device_isoc_fs_start(struct usb2_xfer *xfer)
|
||||
atmegadci_device_isoc_fs_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* start TD chain */
|
||||
atmegadci_start_standard_chain(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods atmegadci_device_isoc_fs_methods =
|
||||
struct usb_pipe_methods atmegadci_device_isoc_fs_methods =
|
||||
{
|
||||
.open = atmegadci_device_isoc_fs_open,
|
||||
.close = atmegadci_device_isoc_fs_close,
|
||||
@ -1484,8 +1484,8 @@ struct usb2_pipe_methods atmegadci_device_isoc_fs_methods =
|
||||
* Simulate a hardware HUB by handling all the necessary requests.
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
static const struct usb2_device_descriptor atmegadci_devd = {
|
||||
.bLength = sizeof(struct usb2_device_descriptor),
|
||||
static const struct usb_device_descriptor atmegadci_devd = {
|
||||
.bLength = sizeof(struct usb_device_descriptor),
|
||||
.bDescriptorType = UDESC_DEVICE,
|
||||
.bcdUSB = {0x00, 0x02},
|
||||
.bDeviceClass = UDCLASS_HUB,
|
||||
@ -1498,8 +1498,8 @@ static const struct usb2_device_descriptor atmegadci_devd = {
|
||||
.bNumConfigurations = 1,
|
||||
};
|
||||
|
||||
static const struct usb2_device_qualifier atmegadci_odevd = {
|
||||
.bLength = sizeof(struct usb2_device_qualifier),
|
||||
static const struct usb_device_qualifier atmegadci_odevd = {
|
||||
.bLength = sizeof(struct usb_device_qualifier),
|
||||
.bDescriptorType = UDESC_DEVICE_QUALIFIER,
|
||||
.bcdUSB = {0x00, 0x02},
|
||||
.bDeviceClass = UDCLASS_HUB,
|
||||
@ -1511,7 +1511,7 @@ static const struct usb2_device_qualifier atmegadci_odevd = {
|
||||
|
||||
static const struct atmegadci_config_desc atmegadci_confd = {
|
||||
.confd = {
|
||||
.bLength = sizeof(struct usb2_config_descriptor),
|
||||
.bLength = sizeof(struct usb_config_descriptor),
|
||||
.bDescriptorType = UDESC_CONFIG,
|
||||
.wTotalLength[0] = sizeof(atmegadci_confd),
|
||||
.bNumInterface = 1,
|
||||
@ -1521,7 +1521,7 @@ static const struct atmegadci_config_desc atmegadci_confd = {
|
||||
.bMaxPower = 0,
|
||||
},
|
||||
.ifcd = {
|
||||
.bLength = sizeof(struct usb2_interface_descriptor),
|
||||
.bLength = sizeof(struct usb_interface_descriptor),
|
||||
.bDescriptorType = UDESC_INTERFACE,
|
||||
.bNumEndpoints = 1,
|
||||
.bInterfaceClass = UICLASS_HUB,
|
||||
@ -1529,7 +1529,7 @@ static const struct atmegadci_config_desc atmegadci_confd = {
|
||||
.bInterfaceProtocol = UIPROTO_HSHUBSTT,
|
||||
},
|
||||
.endpd = {
|
||||
.bLength = sizeof(struct usb2_endpoint_descriptor),
|
||||
.bLength = sizeof(struct usb_endpoint_descriptor),
|
||||
.bDescriptorType = UDESC_ENDPOINT,
|
||||
.bEndpointAddress = (UE_DIR_IN | ATMEGA_INTR_ENDPT),
|
||||
.bmAttributes = UE_INTERRUPT,
|
||||
@ -1538,7 +1538,7 @@ static const struct atmegadci_config_desc atmegadci_confd = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_hub_descriptor_min atmegadci_hubd = {
|
||||
static const struct usb_hub_descriptor_min atmegadci_hubd = {
|
||||
.bDescLength = sizeof(atmegadci_hubd),
|
||||
.bDescriptorType = UDESC_HUB,
|
||||
.bNbrPorts = 1,
|
||||
@ -1567,8 +1567,8 @@ USB_MAKE_STRING_DESC(STRING_VENDOR, atmegadci_vendor);
|
||||
USB_MAKE_STRING_DESC(STRING_PRODUCT, atmegadci_product);
|
||||
|
||||
static usb2_error_t
|
||||
atmegadci_roothub_exec(struct usb2_device *udev,
|
||||
struct usb2_device_request *req, const void **pptr, uint16_t *plength)
|
||||
atmegadci_roothub_exec(struct usb_device *udev,
|
||||
struct usb_device_request *req, const void **pptr, uint16_t *plength)
|
||||
{
|
||||
struct atmegadci_softc *sc = ATMEGA_BUS2SC(udev->bus);
|
||||
const void *ptr;
|
||||
@ -1995,11 +1995,11 @@ atmegadci_roothub_exec(struct usb2_device *udev,
|
||||
}
|
||||
|
||||
static void
|
||||
atmegadci_xfer_setup(struct usb2_setup_params *parm)
|
||||
atmegadci_xfer_setup(struct usb_setup_params *parm)
|
||||
{
|
||||
const struct usb2_hw_ep_profile *pf;
|
||||
const struct usb_hw_ep_profile *pf;
|
||||
struct atmegadci_softc *sc;
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
void *last_obj;
|
||||
uint32_t ntd;
|
||||
uint32_t n;
|
||||
@ -2082,14 +2082,14 @@ atmegadci_xfer_setup(struct usb2_setup_params *parm)
|
||||
}
|
||||
|
||||
static void
|
||||
atmegadci_xfer_unsetup(struct usb2_xfer *xfer)
|
||||
atmegadci_xfer_unsetup(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
atmegadci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *edesc,
|
||||
struct usb2_pipe *pipe)
|
||||
atmegadci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
|
||||
struct usb_pipe *pipe)
|
||||
{
|
||||
struct atmegadci_softc *sc = ATMEGA_BUS2SC(udev->bus);
|
||||
|
||||
@ -2115,7 +2115,7 @@ atmegadci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *e
|
||||
}
|
||||
}
|
||||
|
||||
struct usb2_bus_methods atmegadci_bus_methods =
|
||||
struct usb_bus_methods atmegadci_bus_methods =
|
||||
{
|
||||
.pipe_init = &atmegadci_pipe_init,
|
||||
.xfer_setup = &atmegadci_xfer_setup,
|
||||
|
@ -191,12 +191,12 @@
|
||||
struct atmegadci_td;
|
||||
|
||||
typedef uint8_t (atmegadci_cmd_t)(struct atmegadci_td *td);
|
||||
typedef void (atmegadci_clocks_t)(struct usb2_bus *);
|
||||
typedef void (atmegadci_clocks_t)(struct usb_bus *);
|
||||
|
||||
struct atmegadci_td {
|
||||
struct atmegadci_td *obj_next;
|
||||
atmegadci_cmd_t *func;
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_cache *pc;
|
||||
uint32_t offset;
|
||||
uint32_t remainder;
|
||||
uint16_t max_packet_size;
|
||||
@ -210,7 +210,7 @@ struct atmegadci_td {
|
||||
|
||||
struct atmegadci_std_temp {
|
||||
atmegadci_cmd_t *func;
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_cache *pc;
|
||||
struct atmegadci_td *td;
|
||||
struct atmegadci_td *td_next;
|
||||
uint32_t len;
|
||||
@ -226,14 +226,14 @@ struct atmegadci_std_temp {
|
||||
};
|
||||
|
||||
struct atmegadci_config_desc {
|
||||
struct usb2_config_descriptor confd;
|
||||
struct usb2_interface_descriptor ifcd;
|
||||
struct usb2_endpoint_descriptor endpd;
|
||||
struct usb_config_descriptor confd;
|
||||
struct usb_interface_descriptor ifcd;
|
||||
struct usb_endpoint_descriptor endpd;
|
||||
} __packed;
|
||||
|
||||
union atmegadci_hub_temp {
|
||||
uWord wValue;
|
||||
struct usb2_port_status ps;
|
||||
struct usb_port_status ps;
|
||||
};
|
||||
|
||||
struct atmegadci_flags {
|
||||
@ -251,14 +251,14 @@ struct atmegadci_flags {
|
||||
};
|
||||
|
||||
struct atmegadci_softc {
|
||||
struct usb2_bus sc_bus;
|
||||
struct usb_bus sc_bus;
|
||||
union atmegadci_hub_temp sc_hub_temp;
|
||||
|
||||
/* must be set by by the bus interface layer */
|
||||
atmegadci_clocks_t *sc_clocks_on;
|
||||
atmegadci_clocks_t *sc_clocks_off;
|
||||
|
||||
struct usb2_device *sc_devices[ATMEGA_MAX_DEVICES];
|
||||
struct usb_device *sc_devices[ATMEGA_MAX_DEVICES];
|
||||
struct resource *sc_irq_res;
|
||||
void *sc_intr_hdl;
|
||||
struct resource *sc_io_res;
|
||||
|
@ -49,13 +49,13 @@ struct atmegadci_super_softc {
|
||||
};
|
||||
|
||||
static void
|
||||
atmegadci_clocks_on(struct usb2_bus *bus)
|
||||
atmegadci_clocks_on(struct usb_bus *bus)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
static void
|
||||
atmegadci_clocks_off(struct usb2_bus *bus)
|
||||
atmegadci_clocks_off(struct usb_bus *bus)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
|
@ -74,23 +74,23 @@ SYSCTL_INT(_hw_usb_avr32dci, OID_AUTO, debug, CTLFLAG_RW,
|
||||
|
||||
/* prototypes */
|
||||
|
||||
struct usb2_bus_methods avr32dci_bus_methods;
|
||||
struct usb2_pipe_methods avr32dci_device_non_isoc_methods;
|
||||
struct usb2_pipe_methods avr32dci_device_isoc_fs_methods;
|
||||
struct usb_bus_methods avr32dci_bus_methods;
|
||||
struct usb_pipe_methods avr32dci_device_non_isoc_methods;
|
||||
struct usb_pipe_methods avr32dci_device_isoc_fs_methods;
|
||||
|
||||
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 usb2_xfer *, usb2_error_t);
|
||||
static void avr32dci_do_poll(struct usb2_bus *);
|
||||
static void avr32dci_standard_done(struct usb2_xfer *);
|
||||
static void avr32dci_device_done(struct usb_xfer *, usb2_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);
|
||||
|
||||
/*
|
||||
* Here is a list of what the chip supports:
|
||||
*/
|
||||
static const struct usb2_hw_ep_profile
|
||||
static const struct usb_hw_ep_profile
|
||||
avr32dci_ep_profile[4] = {
|
||||
|
||||
[0] = {
|
||||
@ -134,8 +134,8 @@ static const struct usb2_hw_ep_profile
|
||||
};
|
||||
|
||||
static void
|
||||
avr32dci_get_hw_ep_profile(struct usb2_device *udev,
|
||||
const struct usb2_hw_ep_profile **ppf, uint8_t ep_addr)
|
||||
avr32dci_get_hw_ep_profile(struct usb_device *udev,
|
||||
const struct usb_hw_ep_profile **ppf, uint8_t ep_addr)
|
||||
{
|
||||
if (ep_addr == 0)
|
||||
*ppf = avr32dci_ep_profile;
|
||||
@ -254,7 +254,7 @@ static uint8_t
|
||||
avr32dci_setup_rx(struct avr32dci_td *td)
|
||||
{
|
||||
struct avr32dci_softc *sc;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint16_t count;
|
||||
uint32_t temp;
|
||||
|
||||
@ -329,7 +329,7 @@ static uint8_t
|
||||
avr32dci_data_rx(struct avr32dci_td *td)
|
||||
{
|
||||
struct avr32dci_softc *sc;
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
uint16_t count;
|
||||
uint32_t temp;
|
||||
uint8_t to;
|
||||
@ -429,7 +429,7 @@ static uint8_t
|
||||
avr32dci_data_tx(struct avr32dci_td *td)
|
||||
{
|
||||
struct avr32dci_softc *sc;
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
uint16_t count;
|
||||
uint8_t to;
|
||||
uint32_t temp;
|
||||
@ -538,7 +538,7 @@ avr32dci_data_tx_sync(struct avr32dci_td *td)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
avr32dci_xfer_do_fifo(struct usb2_xfer *xfer)
|
||||
avr32dci_xfer_do_fifo(struct usb_xfer *xfer)
|
||||
{
|
||||
struct avr32dci_td *td;
|
||||
|
||||
@ -583,7 +583,7 @@ avr32dci_xfer_do_fifo(struct usb2_xfer *xfer)
|
||||
static void
|
||||
avr32dci_interrupt_poll(struct avr32dci_softc *sc)
|
||||
{
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
|
||||
repeat:
|
||||
TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) {
|
||||
@ -727,7 +727,7 @@ avr32dci_setup_standard_chain_sub(struct avr32dci_std_temp *temp)
|
||||
}
|
||||
|
||||
static void
|
||||
avr32dci_setup_standard_chain(struct usb2_xfer *xfer)
|
||||
avr32dci_setup_standard_chain(struct usb_xfer *xfer)
|
||||
{
|
||||
struct avr32dci_std_temp temp;
|
||||
struct avr32dci_softc *sc;
|
||||
@ -878,7 +878,7 @@ avr32dci_setup_standard_chain(struct usb2_xfer *xfer)
|
||||
static void
|
||||
avr32dci_timeout(void *arg)
|
||||
{
|
||||
struct usb2_xfer *xfer = arg;
|
||||
struct usb_xfer *xfer = arg;
|
||||
|
||||
DPRINTF("xfer=%p\n", xfer);
|
||||
|
||||
@ -889,7 +889,7 @@ avr32dci_timeout(void *arg)
|
||||
}
|
||||
|
||||
static void
|
||||
avr32dci_start_standard_chain(struct usb2_xfer *xfer)
|
||||
avr32dci_start_standard_chain(struct usb_xfer *xfer)
|
||||
{
|
||||
DPRINTFN(9, "\n");
|
||||
|
||||
@ -925,7 +925,7 @@ avr32dci_root_intr(struct avr32dci_softc *sc)
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
avr32dci_standard_done_sub(struct usb2_xfer *xfer)
|
||||
avr32dci_standard_done_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
struct avr32dci_td *td;
|
||||
uint32_t len;
|
||||
@ -989,7 +989,7 @@ avr32dci_standard_done_sub(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
avr32dci_standard_done(struct usb2_xfer *xfer)
|
||||
avr32dci_standard_done(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
|
||||
@ -1038,7 +1038,7 @@ avr32dci_standard_done(struct usb2_xfer *xfer)
|
||||
* same USB transfer!
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
avr32dci_device_done(struct usb2_xfer *xfer, usb2_error_t error)
|
||||
avr32dci_device_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
{
|
||||
struct avr32dci_softc *sc = AVR32_BUS2SC(xfer->xroot->bus);
|
||||
uint8_t ep_no;
|
||||
@ -1061,8 +1061,8 @@ avr32dci_device_done(struct usb2_xfer *xfer, usb2_error_t error)
|
||||
}
|
||||
|
||||
static void
|
||||
avr32dci_set_stall(struct usb2_device *udev, struct usb2_xfer *xfer,
|
||||
struct usb2_pipe *pipe)
|
||||
avr32dci_set_stall(struct usb_device *udev, struct usb_xfer *xfer,
|
||||
struct usb_pipe *pipe)
|
||||
{
|
||||
struct avr32dci_softc *sc;
|
||||
uint8_t ep_no;
|
||||
@ -1086,7 +1086,7 @@ static void
|
||||
avr32dci_clear_stall_sub(struct avr32dci_softc *sc, uint8_t ep_no,
|
||||
uint8_t ep_type, uint8_t ep_dir)
|
||||
{
|
||||
const struct usb2_hw_ep_profile *pf;
|
||||
const struct usb_hw_ep_profile *pf;
|
||||
uint32_t temp;
|
||||
uint32_t epsize;
|
||||
uint8_t n;
|
||||
@ -1148,10 +1148,10 @@ avr32dci_clear_stall_sub(struct avr32dci_softc *sc, uint8_t ep_no,
|
||||
}
|
||||
|
||||
static void
|
||||
avr32dci_clear_stall(struct usb2_device *udev, struct usb2_pipe *pipe)
|
||||
avr32dci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
|
||||
{
|
||||
struct avr32dci_softc *sc;
|
||||
struct usb2_endpoint_descriptor *ed;
|
||||
struct usb_endpoint_descriptor *ed;
|
||||
|
||||
DPRINTFN(5, "pipe=%p\n", pipe);
|
||||
|
||||
@ -1279,7 +1279,7 @@ avr32dci_resume(struct avr32dci_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
avr32dci_do_poll(struct usb2_bus *bus)
|
||||
avr32dci_do_poll(struct usb_bus *bus)
|
||||
{
|
||||
struct avr32dci_softc *sc = AVR32_BUS2SC(bus);
|
||||
|
||||
@ -1294,32 +1294,32 @@ avr32dci_do_poll(struct usb2_bus *bus)
|
||||
* at91dci interrupt support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
avr32dci_device_non_isoc_open(struct usb2_xfer *xfer)
|
||||
avr32dci_device_non_isoc_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
avr32dci_device_non_isoc_close(struct usb2_xfer *xfer)
|
||||
avr32dci_device_non_isoc_close(struct usb_xfer *xfer)
|
||||
{
|
||||
avr32dci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
avr32dci_device_non_isoc_enter(struct usb2_xfer *xfer)
|
||||
avr32dci_device_non_isoc_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
avr32dci_device_non_isoc_start(struct usb2_xfer *xfer)
|
||||
avr32dci_device_non_isoc_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* setup TDs */
|
||||
avr32dci_setup_standard_chain(xfer);
|
||||
avr32dci_start_standard_chain(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods avr32dci_device_non_isoc_methods =
|
||||
struct usb_pipe_methods avr32dci_device_non_isoc_methods =
|
||||
{
|
||||
.open = avr32dci_device_non_isoc_open,
|
||||
.close = avr32dci_device_non_isoc_close,
|
||||
@ -1331,19 +1331,19 @@ struct usb2_pipe_methods avr32dci_device_non_isoc_methods =
|
||||
* at91dci full speed isochronous support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
avr32dci_device_isoc_fs_open(struct usb2_xfer *xfer)
|
||||
avr32dci_device_isoc_fs_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
avr32dci_device_isoc_fs_close(struct usb2_xfer *xfer)
|
||||
avr32dci_device_isoc_fs_close(struct usb_xfer *xfer)
|
||||
{
|
||||
avr32dci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
avr32dci_device_isoc_fs_enter(struct usb2_xfer *xfer)
|
||||
avr32dci_device_isoc_fs_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
struct avr32dci_softc *sc = AVR32_BUS2SC(xfer->xroot->bus);
|
||||
uint32_t temp;
|
||||
@ -1398,13 +1398,13 @@ avr32dci_device_isoc_fs_enter(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
avr32dci_device_isoc_fs_start(struct usb2_xfer *xfer)
|
||||
avr32dci_device_isoc_fs_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* start TD chain */
|
||||
avr32dci_start_standard_chain(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods avr32dci_device_isoc_fs_methods =
|
||||
struct usb_pipe_methods avr32dci_device_isoc_fs_methods =
|
||||
{
|
||||
.open = avr32dci_device_isoc_fs_open,
|
||||
.close = avr32dci_device_isoc_fs_close,
|
||||
@ -1418,8 +1418,8 @@ struct usb2_pipe_methods avr32dci_device_isoc_fs_methods =
|
||||
* Simulate a hardware HUB by handling all the necessary requests.
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
static const struct usb2_device_descriptor avr32dci_devd = {
|
||||
.bLength = sizeof(struct usb2_device_descriptor),
|
||||
static const struct usb_device_descriptor avr32dci_devd = {
|
||||
.bLength = sizeof(struct usb_device_descriptor),
|
||||
.bDescriptorType = UDESC_DEVICE,
|
||||
.bcdUSB = {0x00, 0x02},
|
||||
.bDeviceClass = UDCLASS_HUB,
|
||||
@ -1432,8 +1432,8 @@ static const struct usb2_device_descriptor avr32dci_devd = {
|
||||
.bNumConfigurations = 1,
|
||||
};
|
||||
|
||||
static const struct usb2_device_qualifier avr32dci_odevd = {
|
||||
.bLength = sizeof(struct usb2_device_qualifier),
|
||||
static const struct usb_device_qualifier avr32dci_odevd = {
|
||||
.bLength = sizeof(struct usb_device_qualifier),
|
||||
.bDescriptorType = UDESC_DEVICE_QUALIFIER,
|
||||
.bcdUSB = {0x00, 0x02},
|
||||
.bDeviceClass = UDCLASS_HUB,
|
||||
@ -1445,7 +1445,7 @@ static const struct usb2_device_qualifier avr32dci_odevd = {
|
||||
|
||||
static const struct avr32dci_config_desc avr32dci_confd = {
|
||||
.confd = {
|
||||
.bLength = sizeof(struct usb2_config_descriptor),
|
||||
.bLength = sizeof(struct usb_config_descriptor),
|
||||
.bDescriptorType = UDESC_CONFIG,
|
||||
.wTotalLength[0] = sizeof(avr32dci_confd),
|
||||
.bNumInterface = 1,
|
||||
@ -1455,7 +1455,7 @@ static const struct avr32dci_config_desc avr32dci_confd = {
|
||||
.bMaxPower = 0,
|
||||
},
|
||||
.ifcd = {
|
||||
.bLength = sizeof(struct usb2_interface_descriptor),
|
||||
.bLength = sizeof(struct usb_interface_descriptor),
|
||||
.bDescriptorType = UDESC_INTERFACE,
|
||||
.bNumEndpoints = 1,
|
||||
.bInterfaceClass = UICLASS_HUB,
|
||||
@ -1463,7 +1463,7 @@ static const struct avr32dci_config_desc avr32dci_confd = {
|
||||
.bInterfaceProtocol = UIPROTO_HSHUBSTT,
|
||||
},
|
||||
.endpd = {
|
||||
.bLength = sizeof(struct usb2_endpoint_descriptor),
|
||||
.bLength = sizeof(struct usb_endpoint_descriptor),
|
||||
.bDescriptorType = UDESC_ENDPOINT,
|
||||
.bEndpointAddress = (UE_DIR_IN | AVR32_INTR_ENDPT),
|
||||
.bmAttributes = UE_INTERRUPT,
|
||||
@ -1472,7 +1472,7 @@ static const struct avr32dci_config_desc avr32dci_confd = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_hub_descriptor_min avr32dci_hubd = {
|
||||
static const struct usb_hub_descriptor_min avr32dci_hubd = {
|
||||
.bDescLength = sizeof(avr32dci_hubd),
|
||||
.bDescriptorType = UDESC_HUB,
|
||||
.bNbrPorts = 1,
|
||||
@ -1501,8 +1501,8 @@ USB_MAKE_STRING_DESC(STRING_VENDOR, avr32dci_vendor);
|
||||
USB_MAKE_STRING_DESC(STRING_PRODUCT, avr32dci_product);
|
||||
|
||||
static usb2_error_t
|
||||
avr32dci_roothub_exec(struct usb2_device *udev,
|
||||
struct usb2_device_request *req, const void **pptr, uint16_t *plength)
|
||||
avr32dci_roothub_exec(struct usb_device *udev,
|
||||
struct usb_device_request *req, const void **pptr, uint16_t *plength)
|
||||
{
|
||||
struct avr32dci_softc *sc = AVR32_BUS2SC(udev->bus);
|
||||
const void *ptr;
|
||||
@ -1928,11 +1928,11 @@ avr32dci_roothub_exec(struct usb2_device *udev,
|
||||
}
|
||||
|
||||
static void
|
||||
avr32dci_xfer_setup(struct usb2_setup_params *parm)
|
||||
avr32dci_xfer_setup(struct usb_setup_params *parm)
|
||||
{
|
||||
const struct usb2_hw_ep_profile *pf;
|
||||
const struct usb_hw_ep_profile *pf;
|
||||
struct avr32dci_softc *sc;
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
void *last_obj;
|
||||
uint32_t ntd;
|
||||
uint32_t n;
|
||||
@ -2019,14 +2019,14 @@ avr32dci_xfer_setup(struct usb2_setup_params *parm)
|
||||
}
|
||||
|
||||
static void
|
||||
avr32dci_xfer_unsetup(struct usb2_xfer *xfer)
|
||||
avr32dci_xfer_unsetup(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
avr32dci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *edesc,
|
||||
struct usb2_pipe *pipe)
|
||||
avr32dci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
|
||||
struct usb_pipe *pipe)
|
||||
{
|
||||
struct avr32dci_softc *sc = AVR32_BUS2SC(udev->bus);
|
||||
|
||||
@ -2053,7 +2053,7 @@ avr32dci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *ed
|
||||
}
|
||||
}
|
||||
|
||||
struct usb2_bus_methods avr32dci_bus_methods =
|
||||
struct usb_bus_methods avr32dci_bus_methods =
|
||||
{
|
||||
.pipe_init = &avr32dci_pipe_init,
|
||||
.xfer_setup = &avr32dci_xfer_setup,
|
||||
|
@ -157,12 +157,12 @@
|
||||
struct avr32dci_td;
|
||||
|
||||
typedef uint8_t (avr32dci_cmd_t)(struct avr32dci_td *td);
|
||||
typedef void (avr32dci_clocks_t)(struct usb2_bus *);
|
||||
typedef void (avr32dci_clocks_t)(struct usb_bus *);
|
||||
|
||||
struct avr32dci_td {
|
||||
struct avr32dci_td *obj_next;
|
||||
avr32dci_cmd_t *func;
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_cache *pc;
|
||||
uint32_t offset;
|
||||
uint32_t remainder;
|
||||
uint16_t max_packet_size;
|
||||
@ -176,7 +176,7 @@ struct avr32dci_td {
|
||||
|
||||
struct avr32dci_std_temp {
|
||||
avr32dci_cmd_t *func;
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_cache *pc;
|
||||
struct avr32dci_td *td;
|
||||
struct avr32dci_td *td_next;
|
||||
uint32_t len;
|
||||
@ -193,14 +193,14 @@ struct avr32dci_std_temp {
|
||||
};
|
||||
|
||||
struct avr32dci_config_desc {
|
||||
struct usb2_config_descriptor confd;
|
||||
struct usb2_interface_descriptor ifcd;
|
||||
struct usb2_endpoint_descriptor endpd;
|
||||
struct usb_config_descriptor confd;
|
||||
struct usb_interface_descriptor ifcd;
|
||||
struct usb_endpoint_descriptor endpd;
|
||||
} __packed;
|
||||
|
||||
union avr32dci_hub_temp {
|
||||
uWord wValue;
|
||||
struct usb2_port_status ps;
|
||||
struct usb_port_status ps;
|
||||
};
|
||||
|
||||
struct avr32dci_flags {
|
||||
@ -218,14 +218,14 @@ struct avr32dci_flags {
|
||||
};
|
||||
|
||||
struct avr32dci_softc {
|
||||
struct usb2_bus sc_bus;
|
||||
struct usb_bus sc_bus;
|
||||
union avr32dci_hub_temp sc_hub_temp;
|
||||
|
||||
/* must be set by by the bus interface layer */
|
||||
avr32dci_clocks_t *sc_clocks_on;
|
||||
avr32dci_clocks_t *sc_clocks_off;
|
||||
|
||||
struct usb2_device *sc_devices[AVR32_MAX_DEVICES];
|
||||
struct usb_device *sc_devices[AVR32_MAX_DEVICES];
|
||||
struct resource *sc_irq_res;
|
||||
void *sc_intr_hdl;
|
||||
struct resource *sc_io_res;
|
||||
|
@ -86,22 +86,22 @@ static void ehci_dump_sqh(ehci_softc_t *sc, ehci_qh_t *sqh);
|
||||
|
||||
#define EHCI_INTR_ENDPT 1
|
||||
|
||||
extern struct usb2_bus_methods ehci_bus_methods;
|
||||
extern struct usb2_pipe_methods ehci_device_bulk_methods;
|
||||
extern struct usb2_pipe_methods ehci_device_ctrl_methods;
|
||||
extern struct usb2_pipe_methods ehci_device_intr_methods;
|
||||
extern struct usb2_pipe_methods ehci_device_isoc_fs_methods;
|
||||
extern struct usb2_pipe_methods ehci_device_isoc_hs_methods;
|
||||
extern struct usb_bus_methods ehci_bus_methods;
|
||||
extern struct usb_pipe_methods ehci_device_bulk_methods;
|
||||
extern struct usb_pipe_methods ehci_device_ctrl_methods;
|
||||
extern struct usb_pipe_methods ehci_device_intr_methods;
|
||||
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 usb2_bus *bus);
|
||||
static void ehci_device_done(struct usb2_xfer *xfer, usb2_error_t error);
|
||||
static uint8_t ehci_check_transfer(struct usb2_xfer *xfer);
|
||||
static void ehci_do_poll(struct usb_bus *bus);
|
||||
static void ehci_device_done(struct usb_xfer *xfer, usb2_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);
|
||||
|
||||
struct ehci_std_temp {
|
||||
ehci_softc_t *sc;
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_cache *pc;
|
||||
ehci_qtd_t *td;
|
||||
ehci_qtd_t *td_next;
|
||||
uint32_t average;
|
||||
@ -115,7 +115,7 @@ struct ehci_std_temp {
|
||||
};
|
||||
|
||||
void
|
||||
ehci_iterate_hw_softc(struct usb2_bus *bus, usb2_bus_mem_sub_cb_t *cb)
|
||||
ehci_iterate_hw_softc(struct usb_bus *bus, usb2_bus_mem_sub_cb_t *cb)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(bus);
|
||||
uint32_t i;
|
||||
@ -208,7 +208,7 @@ ehci_hcreset(ehci_softc_t *sc)
|
||||
usb2_error_t
|
||||
ehci_init(ehci_softc_t *sc)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
uint32_t version;
|
||||
uint32_t sparams;
|
||||
uint32_t cparams;
|
||||
@ -570,7 +570,7 @@ ehci_suspend(ehci_softc_t *sc)
|
||||
void
|
||||
ehci_resume(ehci_softc_t *sc)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
uint32_t cmd;
|
||||
uint32_t hcr;
|
||||
uint8_t i;
|
||||
@ -952,7 +952,7 @@ ehci_dump_isoc(ehci_softc_t *sc)
|
||||
#endif
|
||||
|
||||
static void
|
||||
ehci_transfer_intr_enqueue(struct usb2_xfer *xfer)
|
||||
ehci_transfer_intr_enqueue(struct usb_xfer *xfer)
|
||||
{
|
||||
/* check for early completion */
|
||||
if (ehci_check_transfer(xfer)) {
|
||||
@ -1121,7 +1121,7 @@ _ehci_remove_qh(ehci_qh_t *sqh, ehci_qh_t *last)
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
ehci_non_isoc_done_sub(struct usb2_xfer *xfer)
|
||||
ehci_non_isoc_done_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
|
||||
ehci_qtd_t *td;
|
||||
@ -1214,7 +1214,7 @@ ehci_non_isoc_done_sub(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_non_isoc_done(struct usb2_xfer *xfer)
|
||||
ehci_non_isoc_done(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
|
||||
@ -1272,9 +1272,9 @@ ehci_non_isoc_done(struct usb2_xfer *xfer)
|
||||
* Else: USB transfer is finished
|
||||
*------------------------------------------------------------------------*/
|
||||
static uint8_t
|
||||
ehci_check_transfer(struct usb2_xfer *xfer)
|
||||
ehci_check_transfer(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_pipe_methods *methods = xfer->pipe->methods;
|
||||
struct usb_pipe_methods *methods = xfer->pipe->methods;
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
|
||||
|
||||
uint32_t status;
|
||||
@ -1408,7 +1408,7 @@ ehci_pcd_enable(ehci_softc_t *sc)
|
||||
static void
|
||||
ehci_interrupt_poll(ehci_softc_t *sc)
|
||||
{
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
|
||||
repeat:
|
||||
TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) {
|
||||
@ -1499,7 +1499,7 @@ ehci_interrupt(ehci_softc_t *sc)
|
||||
static void
|
||||
ehci_timeout(void *arg)
|
||||
{
|
||||
struct usb2_xfer *xfer = arg;
|
||||
struct usb_xfer *xfer = arg;
|
||||
|
||||
DPRINTF("xfer=%p\n", xfer);
|
||||
|
||||
@ -1510,7 +1510,7 @@ ehci_timeout(void *arg)
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_do_poll(struct usb2_bus *bus)
|
||||
ehci_do_poll(struct usb_bus *bus)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(bus);
|
||||
|
||||
@ -1522,7 +1522,7 @@ ehci_do_poll(struct usb2_bus *bus)
|
||||
static void
|
||||
ehci_setup_standard_chain_sub(struct ehci_std_temp *temp)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
ehci_qtd_t *td;
|
||||
ehci_qtd_t *td_next;
|
||||
ehci_qtd_t *td_alt_next;
|
||||
@ -1705,10 +1705,10 @@ ehci_setup_standard_chain_sub(struct ehci_std_temp *temp)
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_setup_standard_chain(struct usb2_xfer *xfer, ehci_qh_t **qh_last)
|
||||
ehci_setup_standard_chain(struct usb_xfer *xfer, ehci_qh_t **qh_last)
|
||||
{
|
||||
struct ehci_std_temp temp;
|
||||
struct usb2_pipe_methods *methods;
|
||||
struct usb_pipe_methods *methods;
|
||||
ehci_qh_t *qh;
|
||||
ehci_qtd_t *td;
|
||||
uint32_t qh_endp;
|
||||
@ -1990,7 +1990,7 @@ ehci_root_intr(ehci_softc_t *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_isoc_fs_done(ehci_softc_t *sc, struct usb2_xfer *xfer)
|
||||
ehci_isoc_fs_done(ehci_softc_t *sc, struct usb_xfer *xfer)
|
||||
{
|
||||
uint32_t nframes = xfer->nframes;
|
||||
uint32_t status;
|
||||
@ -2043,7 +2043,7 @@ ehci_isoc_fs_done(ehci_softc_t *sc, struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_isoc_hs_done(ehci_softc_t *sc, struct usb2_xfer *xfer)
|
||||
ehci_isoc_hs_done(ehci_softc_t *sc, struct usb_xfer *xfer)
|
||||
{
|
||||
uint32_t nframes = xfer->nframes;
|
||||
uint32_t status;
|
||||
@ -2111,9 +2111,9 @@ ehci_isoc_hs_done(ehci_softc_t *sc, struct usb2_xfer *xfer)
|
||||
* from close and from interrupt
|
||||
*/
|
||||
static void
|
||||
ehci_device_done(struct usb2_xfer *xfer, usb2_error_t error)
|
||||
ehci_device_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
{
|
||||
struct usb2_pipe_methods *methods = xfer->pipe->methods;
|
||||
struct usb_pipe_methods *methods = xfer->pipe->methods;
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
|
||||
|
||||
USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED);
|
||||
@ -2162,25 +2162,25 @@ ehci_device_done(struct usb2_xfer *xfer, usb2_error_t error)
|
||||
* ehci bulk support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
ehci_device_bulk_open(struct usb2_xfer *xfer)
|
||||
ehci_device_bulk_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_bulk_close(struct usb2_xfer *xfer)
|
||||
ehci_device_bulk_close(struct usb_xfer *xfer)
|
||||
{
|
||||
ehci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_bulk_enter(struct usb2_xfer *xfer)
|
||||
ehci_device_bulk_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_bulk_start(struct usb2_xfer *xfer)
|
||||
ehci_device_bulk_start(struct usb_xfer *xfer)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
|
||||
uint32_t temp;
|
||||
@ -2200,7 +2200,7 @@ ehci_device_bulk_start(struct usb2_xfer *xfer)
|
||||
EOWRITE4(sc, EHCI_USBCMD, temp | EHCI_CMD_IAAD);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods ehci_device_bulk_methods =
|
||||
struct usb_pipe_methods ehci_device_bulk_methods =
|
||||
{
|
||||
.open = ehci_device_bulk_open,
|
||||
.close = ehci_device_bulk_close,
|
||||
@ -2212,25 +2212,25 @@ struct usb2_pipe_methods ehci_device_bulk_methods =
|
||||
* ehci control support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
ehci_device_ctrl_open(struct usb2_xfer *xfer)
|
||||
ehci_device_ctrl_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_ctrl_close(struct usb2_xfer *xfer)
|
||||
ehci_device_ctrl_close(struct usb_xfer *xfer)
|
||||
{
|
||||
ehci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_ctrl_enter(struct usb2_xfer *xfer)
|
||||
ehci_device_ctrl_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_ctrl_start(struct usb2_xfer *xfer)
|
||||
ehci_device_ctrl_start(struct usb_xfer *xfer)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
|
||||
|
||||
@ -2241,7 +2241,7 @@ ehci_device_ctrl_start(struct usb2_xfer *xfer)
|
||||
ehci_transfer_intr_enqueue(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods ehci_device_ctrl_methods =
|
||||
struct usb_pipe_methods ehci_device_ctrl_methods =
|
||||
{
|
||||
.open = ehci_device_ctrl_open,
|
||||
.close = ehci_device_ctrl_close,
|
||||
@ -2253,7 +2253,7 @@ struct usb2_pipe_methods ehci_device_ctrl_methods =
|
||||
* ehci interrupt support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
ehci_device_intr_open(struct usb2_xfer *xfer)
|
||||
ehci_device_intr_open(struct usb_xfer *xfer)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
|
||||
uint16_t best;
|
||||
@ -2306,7 +2306,7 @@ ehci_device_intr_open(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_intr_close(struct usb2_xfer *xfer)
|
||||
ehci_device_intr_close(struct usb_xfer *xfer)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
|
||||
uint8_t slot;
|
||||
@ -2320,13 +2320,13 @@ ehci_device_intr_close(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_intr_enter(struct usb2_xfer *xfer)
|
||||
ehci_device_intr_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_intr_start(struct usb2_xfer *xfer)
|
||||
ehci_device_intr_start(struct usb_xfer *xfer)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
|
||||
|
||||
@ -2337,7 +2337,7 @@ ehci_device_intr_start(struct usb2_xfer *xfer)
|
||||
ehci_transfer_intr_enqueue(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods ehci_device_intr_methods =
|
||||
struct usb_pipe_methods ehci_device_intr_methods =
|
||||
{
|
||||
.open = ehci_device_intr_open,
|
||||
.close = ehci_device_intr_close,
|
||||
@ -2349,7 +2349,7 @@ struct usb2_pipe_methods ehci_device_intr_methods =
|
||||
* ehci full speed isochronous support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
ehci_device_isoc_fs_open(struct usb2_xfer *xfer)
|
||||
ehci_device_isoc_fs_open(struct usb_xfer *xfer)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
|
||||
ehci_sitd_t *td;
|
||||
@ -2390,19 +2390,19 @@ ehci_device_isoc_fs_open(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_isoc_fs_close(struct usb2_xfer *xfer)
|
||||
ehci_device_isoc_fs_close(struct usb_xfer *xfer)
|
||||
{
|
||||
ehci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_isoc_fs_enter(struct usb2_xfer *xfer)
|
||||
ehci_device_isoc_fs_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
|
||||
struct usb2_fs_isoc_schedule *fss_start;
|
||||
struct usb2_fs_isoc_schedule *fss_end;
|
||||
struct usb2_fs_isoc_schedule *fss;
|
||||
struct usb_fs_isoc_schedule *fss_start;
|
||||
struct usb_fs_isoc_schedule *fss_end;
|
||||
struct usb_fs_isoc_schedule *fss;
|
||||
ehci_sitd_t *td;
|
||||
ehci_sitd_t *td_last = NULL;
|
||||
ehci_sitd_t **pp_last;
|
||||
@ -2614,13 +2614,13 @@ ehci_device_isoc_fs_enter(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_isoc_fs_start(struct usb2_xfer *xfer)
|
||||
ehci_device_isoc_fs_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* put transfer on interrupt queue */
|
||||
ehci_transfer_intr_enqueue(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods ehci_device_isoc_fs_methods =
|
||||
struct usb_pipe_methods ehci_device_isoc_fs_methods =
|
||||
{
|
||||
.open = ehci_device_isoc_fs_open,
|
||||
.close = ehci_device_isoc_fs_close,
|
||||
@ -2632,7 +2632,7 @@ struct usb2_pipe_methods ehci_device_isoc_fs_methods =
|
||||
* ehci high speed isochronous support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
ehci_device_isoc_hs_open(struct usb2_xfer *xfer)
|
||||
ehci_device_isoc_hs_open(struct usb_xfer *xfer)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
|
||||
ehci_itd_t *td;
|
||||
@ -2679,15 +2679,15 @@ ehci_device_isoc_hs_open(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_isoc_hs_close(struct usb2_xfer *xfer)
|
||||
ehci_device_isoc_hs_close(struct usb_xfer *xfer)
|
||||
{
|
||||
ehci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_isoc_hs_enter(struct usb2_xfer *xfer)
|
||||
ehci_device_isoc_hs_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(xfer->xroot->bus);
|
||||
ehci_itd_t *td;
|
||||
ehci_itd_t *td_last = NULL;
|
||||
@ -2880,13 +2880,13 @@ ehci_device_isoc_hs_enter(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_isoc_hs_start(struct usb2_xfer *xfer)
|
||||
ehci_device_isoc_hs_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* put transfer on interrupt queue */
|
||||
ehci_transfer_intr_enqueue(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods ehci_device_isoc_hs_methods =
|
||||
struct usb_pipe_methods ehci_device_isoc_hs_methods =
|
||||
{
|
||||
.open = ehci_device_isoc_hs_open,
|
||||
.close = ehci_device_isoc_hs_close,
|
||||
@ -2901,9 +2901,9 @@ struct usb2_pipe_methods ehci_device_isoc_hs_methods =
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
static const
|
||||
struct usb2_device_descriptor ehci_devd =
|
||||
struct usb_device_descriptor ehci_devd =
|
||||
{
|
||||
sizeof(struct usb2_device_descriptor),
|
||||
sizeof(struct usb_device_descriptor),
|
||||
UDESC_DEVICE, /* type */
|
||||
{0x00, 0x02}, /* USB version */
|
||||
UDCLASS_HUB, /* class */
|
||||
@ -2916,9 +2916,9 @@ struct usb2_device_descriptor ehci_devd =
|
||||
};
|
||||
|
||||
static const
|
||||
struct usb2_device_qualifier ehci_odevd =
|
||||
struct usb_device_qualifier ehci_odevd =
|
||||
{
|
||||
sizeof(struct usb2_device_qualifier),
|
||||
sizeof(struct usb_device_qualifier),
|
||||
UDESC_DEVICE_QUALIFIER, /* type */
|
||||
{0x00, 0x02}, /* USB version */
|
||||
UDCLASS_HUB, /* class */
|
||||
@ -2931,7 +2931,7 @@ struct usb2_device_qualifier ehci_odevd =
|
||||
|
||||
static const struct ehci_config_desc ehci_confd = {
|
||||
.confd = {
|
||||
.bLength = sizeof(struct usb2_config_descriptor),
|
||||
.bLength = sizeof(struct usb_config_descriptor),
|
||||
.bDescriptorType = UDESC_CONFIG,
|
||||
.wTotalLength[0] = sizeof(ehci_confd),
|
||||
.bNumInterface = 1,
|
||||
@ -2941,7 +2941,7 @@ static const struct ehci_config_desc ehci_confd = {
|
||||
.bMaxPower = 0 /* max power */
|
||||
},
|
||||
.ifcd = {
|
||||
.bLength = sizeof(struct usb2_interface_descriptor),
|
||||
.bLength = sizeof(struct usb_interface_descriptor),
|
||||
.bDescriptorType = UDESC_INTERFACE,
|
||||
.bNumEndpoints = 1,
|
||||
.bInterfaceClass = UICLASS_HUB,
|
||||
@ -2950,7 +2950,7 @@ static const struct ehci_config_desc ehci_confd = {
|
||||
0
|
||||
},
|
||||
.endpd = {
|
||||
.bLength = sizeof(struct usb2_endpoint_descriptor),
|
||||
.bLength = sizeof(struct usb_endpoint_descriptor),
|
||||
.bDescriptorType = UDESC_ENDPOINT,
|
||||
.bEndpointAddress = UE_DIR_IN | EHCI_INTR_ENDPT,
|
||||
.bmAttributes = UE_INTERRUPT,
|
||||
@ -2960,7 +2960,7 @@ static const struct ehci_config_desc ehci_confd = {
|
||||
};
|
||||
|
||||
static const
|
||||
struct usb2_hub_descriptor ehci_hubd =
|
||||
struct usb_hub_descriptor ehci_hubd =
|
||||
{
|
||||
0, /* dynamic length */
|
||||
UDESC_HUB,
|
||||
@ -2985,8 +2985,8 @@ ehci_disown(ehci_softc_t *sc, uint16_t index, uint8_t lowspeed)
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
ehci_roothub_exec(struct usb2_device *udev,
|
||||
struct usb2_device_request *req, const void **pptr, uint16_t *plength)
|
||||
ehci_roothub_exec(struct usb_device *udev,
|
||||
struct usb_device_request *req, const void **pptr, uint16_t *plength)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(udev->bus);
|
||||
const char *str_ptr;
|
||||
@ -3378,12 +3378,12 @@ ehci_roothub_exec(struct usb2_device *udev,
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_xfer_setup(struct usb2_setup_params *parm)
|
||||
ehci_xfer_setup(struct usb_setup_params *parm)
|
||||
{
|
||||
struct usb2_page_search page_info;
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_search page_info;
|
||||
struct usb_page_cache *pc;
|
||||
ehci_softc_t *sc;
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
void *last_obj;
|
||||
uint32_t nqtd;
|
||||
uint32_t nqh;
|
||||
@ -3629,14 +3629,14 @@ ehci_xfer_setup(struct usb2_setup_params *parm)
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_xfer_unsetup(struct usb2_xfer *xfer)
|
||||
ehci_xfer_unsetup(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *edesc,
|
||||
struct usb2_pipe *pipe)
|
||||
ehci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
|
||||
struct usb_pipe *pipe)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(udev->bus);
|
||||
|
||||
@ -3688,7 +3688,7 @@ ehci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *edesc,
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_get_dma_delay(struct usb2_bus *bus, uint32_t *pus)
|
||||
ehci_get_dma_delay(struct usb_bus *bus, uint32_t *pus)
|
||||
{
|
||||
/*
|
||||
* Wait until the hardware has finished any possible use of
|
||||
@ -3698,11 +3698,11 @@ ehci_get_dma_delay(struct usb2_bus *bus, uint32_t *pus)
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_resume(struct usb2_device *udev)
|
||||
ehci_device_resume(struct usb_device *udev)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(udev->bus);
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb2_pipe_methods *methods;
|
||||
struct usb_xfer *xfer;
|
||||
struct usb_pipe_methods *methods;
|
||||
|
||||
DPRINTF("\n");
|
||||
|
||||
@ -3732,11 +3732,11 @@ ehci_device_resume(struct usb2_device *udev)
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_device_suspend(struct usb2_device *udev)
|
||||
ehci_device_suspend(struct usb_device *udev)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(udev->bus);
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb2_pipe_methods *methods;
|
||||
struct usb_xfer *xfer;
|
||||
struct usb_pipe_methods *methods;
|
||||
|
||||
DPRINTF("\n");
|
||||
|
||||
@ -3766,7 +3766,7 @@ ehci_device_suspend(struct usb2_device *udev)
|
||||
}
|
||||
|
||||
static void
|
||||
ehci_set_hw_power(struct usb2_bus *bus)
|
||||
ehci_set_hw_power(struct usb_bus *bus)
|
||||
{
|
||||
ehci_softc_t *sc = EHCI_BUS2SC(bus);
|
||||
uint32_t temp;
|
||||
@ -3799,7 +3799,7 @@ ehci_set_hw_power(struct usb2_bus *bus)
|
||||
return;
|
||||
}
|
||||
|
||||
struct usb2_bus_methods ehci_bus_methods =
|
||||
struct usb_bus_methods ehci_bus_methods =
|
||||
{
|
||||
.pipe_init = ehci_pipe_init,
|
||||
.xfer_setup = ehci_xfer_setup,
|
||||
|
@ -253,7 +253,7 @@ struct ehci_itd {
|
||||
struct ehci_itd *next;
|
||||
struct ehci_itd *prev;
|
||||
struct ehci_itd *obj_next;
|
||||
struct usb2_page_cache *page_cache;
|
||||
struct usb_page_cache *page_cache;
|
||||
} __aligned(EHCI_ITD_ALIGN);
|
||||
|
||||
typedef struct ehci_itd ehci_itd_t;
|
||||
@ -301,7 +301,7 @@ struct ehci_sitd {
|
||||
struct ehci_sitd *next;
|
||||
struct ehci_sitd *prev;
|
||||
struct ehci_sitd *obj_next;
|
||||
struct usb2_page_cache *page_cache;
|
||||
struct usb_page_cache *page_cache;
|
||||
} __aligned(EHCI_SITD_ALIGN);
|
||||
|
||||
typedef struct ehci_sitd ehci_sitd_t;
|
||||
@ -347,7 +347,7 @@ struct ehci_qtd {
|
||||
*/
|
||||
struct ehci_qtd *alt_next;
|
||||
struct ehci_qtd *obj_next;
|
||||
struct usb2_page_cache *page_cache;
|
||||
struct usb_page_cache *page_cache;
|
||||
uint32_t qtd_self;
|
||||
uint16_t len;
|
||||
} __aligned(EHCI_QTD_ALIGN);
|
||||
@ -409,7 +409,7 @@ struct ehci_qh {
|
||||
struct ehci_qh *next;
|
||||
struct ehci_qh *prev;
|
||||
struct ehci_qh *obj_next;
|
||||
struct usb2_page_cache *page_cache;
|
||||
struct usb_page_cache *page_cache;
|
||||
uint32_t qh_self;
|
||||
} __aligned(EHCI_QH_ALIGN);
|
||||
|
||||
@ -424,39 +424,39 @@ struct ehci_fstn {
|
||||
typedef struct ehci_fstn ehci_fstn_t;
|
||||
|
||||
struct ehci_hw_softc {
|
||||
struct usb2_page_cache pframes_pc;
|
||||
struct usb2_page_cache async_start_pc;
|
||||
struct usb2_page_cache intr_start_pc[EHCI_VIRTUAL_FRAMELIST_COUNT];
|
||||
struct usb2_page_cache isoc_hs_start_pc[EHCI_VIRTUAL_FRAMELIST_COUNT];
|
||||
struct usb2_page_cache isoc_fs_start_pc[EHCI_VIRTUAL_FRAMELIST_COUNT];
|
||||
struct usb_page_cache pframes_pc;
|
||||
struct usb_page_cache async_start_pc;
|
||||
struct usb_page_cache intr_start_pc[EHCI_VIRTUAL_FRAMELIST_COUNT];
|
||||
struct usb_page_cache isoc_hs_start_pc[EHCI_VIRTUAL_FRAMELIST_COUNT];
|
||||
struct usb_page_cache isoc_fs_start_pc[EHCI_VIRTUAL_FRAMELIST_COUNT];
|
||||
|
||||
struct usb2_page pframes_pg;
|
||||
struct usb2_page async_start_pg;
|
||||
struct usb2_page intr_start_pg[EHCI_VIRTUAL_FRAMELIST_COUNT];
|
||||
struct usb2_page isoc_hs_start_pg[EHCI_VIRTUAL_FRAMELIST_COUNT];
|
||||
struct usb2_page isoc_fs_start_pg[EHCI_VIRTUAL_FRAMELIST_COUNT];
|
||||
struct usb_page pframes_pg;
|
||||
struct usb_page async_start_pg;
|
||||
struct usb_page intr_start_pg[EHCI_VIRTUAL_FRAMELIST_COUNT];
|
||||
struct usb_page isoc_hs_start_pg[EHCI_VIRTUAL_FRAMELIST_COUNT];
|
||||
struct usb_page isoc_fs_start_pg[EHCI_VIRTUAL_FRAMELIST_COUNT];
|
||||
};
|
||||
|
||||
struct ehci_config_desc {
|
||||
struct usb2_config_descriptor confd;
|
||||
struct usb2_interface_descriptor ifcd;
|
||||
struct usb2_endpoint_descriptor endpd;
|
||||
struct usb_config_descriptor confd;
|
||||
struct usb_interface_descriptor ifcd;
|
||||
struct usb_endpoint_descriptor endpd;
|
||||
} __packed;
|
||||
|
||||
union ehci_hub_desc {
|
||||
struct usb2_status stat;
|
||||
struct usb2_port_status ps;
|
||||
struct usb2_hub_descriptor hubd;
|
||||
struct usb_status stat;
|
||||
struct usb_port_status ps;
|
||||
struct usb_hub_descriptor hubd;
|
||||
uint8_t temp[128];
|
||||
};
|
||||
|
||||
typedef struct ehci_softc {
|
||||
struct ehci_hw_softc sc_hw;
|
||||
struct usb2_bus sc_bus; /* base device */
|
||||
struct usb2_callout sc_tmo_pcd;
|
||||
struct usb_bus sc_bus; /* base device */
|
||||
struct usb_callout sc_tmo_pcd;
|
||||
union ehci_hub_desc sc_hub_desc;
|
||||
|
||||
struct usb2_device *sc_devices[EHCI_MAX_DEVICES];
|
||||
struct usb_device *sc_devices[EHCI_MAX_DEVICES];
|
||||
struct resource *sc_io_res;
|
||||
struct resource *sc_irq_res;
|
||||
struct ehci_qh *sc_async_p_last;
|
||||
|
@ -74,11 +74,11 @@ SYSCTL_INT(_hw_usb_musbotg, OID_AUTO, debug, CTLFLAG_RW,
|
||||
|
||||
/* prototypes */
|
||||
|
||||
struct usb2_bus_methods musbotg_bus_methods;
|
||||
struct usb2_pipe_methods musbotg_device_bulk_methods;
|
||||
struct usb2_pipe_methods musbotg_device_ctrl_methods;
|
||||
struct usb2_pipe_methods musbotg_device_intr_methods;
|
||||
struct usb2_pipe_methods musbotg_device_isoc_methods;
|
||||
struct usb_bus_methods musbotg_bus_methods;
|
||||
struct usb_pipe_methods musbotg_device_bulk_methods;
|
||||
struct usb_pipe_methods musbotg_device_ctrl_methods;
|
||||
struct usb_pipe_methods musbotg_device_intr_methods;
|
||||
struct usb_pipe_methods musbotg_device_isoc_methods;
|
||||
|
||||
static musbotg_cmd_t musbotg_setup_rx;
|
||||
static musbotg_cmd_t musbotg_setup_data_rx;
|
||||
@ -86,16 +86,16 @@ 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 usb2_xfer *, usb2_error_t);
|
||||
static void musbotg_do_poll(struct usb2_bus *);
|
||||
static void musbotg_standard_done(struct usb2_xfer *);
|
||||
static void musbotg_device_done(struct usb_xfer *, usb2_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 *);
|
||||
static void musbotg_root_intr(struct musbotg_softc *);
|
||||
|
||||
/*
|
||||
* Here is a configuration that the chip supports.
|
||||
*/
|
||||
static const struct usb2_hw_ep_profile musbotg_ep_profile[1] = {
|
||||
static const struct usb_hw_ep_profile musbotg_ep_profile[1] = {
|
||||
|
||||
[0] = {
|
||||
.max_in_frame_size = 64,/* fixed */
|
||||
@ -106,8 +106,8 @@ static const struct usb2_hw_ep_profile musbotg_ep_profile[1] = {
|
||||
};
|
||||
|
||||
static void
|
||||
musbotg_get_hw_ep_profile(struct usb2_device *udev,
|
||||
const struct usb2_hw_ep_profile **ppf, uint8_t ep_addr)
|
||||
musbotg_get_hw_ep_profile(struct usb_device *udev,
|
||||
const struct usb_hw_ep_profile **ppf, uint8_t ep_addr)
|
||||
{
|
||||
struct musbotg_softc *sc;
|
||||
|
||||
@ -228,7 +228,7 @@ static uint8_t
|
||||
musbotg_setup_rx(struct musbotg_td *td)
|
||||
{
|
||||
struct musbotg_softc *sc;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint16_t count;
|
||||
uint8_t csr;
|
||||
|
||||
@ -337,7 +337,7 @@ musbotg_setup_rx(struct musbotg_td *td)
|
||||
static uint8_t
|
||||
musbotg_setup_data_rx(struct musbotg_td *td)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
struct musbotg_softc *sc;
|
||||
uint16_t count;
|
||||
uint8_t csr;
|
||||
@ -480,7 +480,7 @@ musbotg_setup_data_rx(struct musbotg_td *td)
|
||||
static uint8_t
|
||||
musbotg_setup_data_tx(struct musbotg_td *td)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
struct musbotg_softc *sc;
|
||||
uint16_t count;
|
||||
uint8_t csr;
|
||||
@ -632,7 +632,7 @@ musbotg_setup_status(struct musbotg_td *td)
|
||||
static uint8_t
|
||||
musbotg_data_rx(struct musbotg_td *td)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
struct musbotg_softc *sc;
|
||||
uint16_t count;
|
||||
uint8_t csr;
|
||||
@ -771,7 +771,7 @@ musbotg_data_rx(struct musbotg_td *td)
|
||||
static uint8_t
|
||||
musbotg_data_tx(struct musbotg_td *td)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
struct musbotg_softc *sc;
|
||||
uint16_t count;
|
||||
uint8_t csr;
|
||||
@ -887,7 +887,7 @@ musbotg_data_tx(struct musbotg_td *td)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
musbotg_xfer_do_fifo(struct usb2_xfer *xfer)
|
||||
musbotg_xfer_do_fifo(struct usb_xfer *xfer)
|
||||
{
|
||||
struct musbotg_softc *sc;
|
||||
struct musbotg_td *td;
|
||||
@ -936,7 +936,7 @@ musbotg_xfer_do_fifo(struct usb2_xfer *xfer)
|
||||
static void
|
||||
musbotg_interrupt_poll(struct musbotg_softc *sc)
|
||||
{
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
|
||||
repeat:
|
||||
TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) {
|
||||
@ -1105,7 +1105,7 @@ musbotg_setup_standard_chain_sub(struct musbotg_std_temp *temp)
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_setup_standard_chain(struct usb2_xfer *xfer)
|
||||
musbotg_setup_standard_chain(struct usb_xfer *xfer)
|
||||
{
|
||||
struct musbotg_std_temp temp;
|
||||
struct musbotg_softc *sc;
|
||||
@ -1234,7 +1234,7 @@ musbotg_setup_standard_chain(struct usb2_xfer *xfer)
|
||||
static void
|
||||
musbotg_timeout(void *arg)
|
||||
{
|
||||
struct usb2_xfer *xfer = arg;
|
||||
struct usb_xfer *xfer = arg;
|
||||
|
||||
DPRINTFN(1, "xfer=%p\n", xfer);
|
||||
|
||||
@ -1245,7 +1245,7 @@ musbotg_timeout(void *arg)
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_ep_int_set(struct usb2_xfer *xfer, uint8_t on)
|
||||
musbotg_ep_int_set(struct usb_xfer *xfer, uint8_t on)
|
||||
{
|
||||
struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus);
|
||||
uint16_t temp;
|
||||
@ -1285,7 +1285,7 @@ musbotg_ep_int_set(struct usb2_xfer *xfer, uint8_t on)
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_start_standard_chain(struct usb2_xfer *xfer)
|
||||
musbotg_start_standard_chain(struct usb_xfer *xfer)
|
||||
{
|
||||
DPRINTFN(8, "\n");
|
||||
|
||||
@ -1322,7 +1322,7 @@ musbotg_root_intr(struct musbotg_softc *sc)
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
musbotg_standard_done_sub(struct usb2_xfer *xfer)
|
||||
musbotg_standard_done_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
struct musbotg_td *td;
|
||||
uint32_t len;
|
||||
@ -1386,7 +1386,7 @@ musbotg_standard_done_sub(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_standard_done(struct usb2_xfer *xfer)
|
||||
musbotg_standard_done(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
|
||||
@ -1435,7 +1435,7 @@ musbotg_standard_done(struct usb2_xfer *xfer)
|
||||
* same USB transfer!
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
musbotg_device_done(struct usb2_xfer *xfer, usb2_error_t error)
|
||||
musbotg_device_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
{
|
||||
USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED);
|
||||
|
||||
@ -1453,8 +1453,8 @@ musbotg_device_done(struct usb2_xfer *xfer, usb2_error_t error)
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_set_stall(struct usb2_device *udev, struct usb2_xfer *xfer,
|
||||
struct usb2_pipe *pipe)
|
||||
musbotg_set_stall(struct usb_device *udev, struct usb_xfer *xfer,
|
||||
struct usb_pipe *pipe)
|
||||
{
|
||||
struct musbotg_softc *sc;
|
||||
uint8_t ep_no;
|
||||
@ -1636,10 +1636,10 @@ musbotg_clear_stall_sub(struct musbotg_softc *sc, uint16_t wMaxPacket,
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_clear_stall(struct usb2_device *udev, struct usb2_pipe *pipe)
|
||||
musbotg_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
|
||||
{
|
||||
struct musbotg_softc *sc;
|
||||
struct usb2_endpoint_descriptor *ed;
|
||||
struct usb_endpoint_descriptor *ed;
|
||||
|
||||
DPRINTFN(4, "pipe=%p\n", pipe);
|
||||
|
||||
@ -1667,7 +1667,7 @@ musbotg_clear_stall(struct usb2_device *udev, struct usb2_pipe *pipe)
|
||||
usb2_error_t
|
||||
musbotg_init(struct musbotg_softc *sc)
|
||||
{
|
||||
struct usb2_hw_ep_profile *pf;
|
||||
struct usb_hw_ep_profile *pf;
|
||||
uint8_t nrx;
|
||||
uint8_t ntx;
|
||||
uint8_t temp;
|
||||
@ -1855,7 +1855,7 @@ musbotg_resume(struct musbotg_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_do_poll(struct usb2_bus *bus)
|
||||
musbotg_do_poll(struct usb_bus *bus)
|
||||
{
|
||||
struct musbotg_softc *sc = MUSBOTG_BUS2SC(bus);
|
||||
|
||||
@ -1868,32 +1868,32 @@ musbotg_do_poll(struct usb2_bus *bus)
|
||||
* musbotg bulk support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
musbotg_device_bulk_open(struct usb2_xfer *xfer)
|
||||
musbotg_device_bulk_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_device_bulk_close(struct usb2_xfer *xfer)
|
||||
musbotg_device_bulk_close(struct usb_xfer *xfer)
|
||||
{
|
||||
musbotg_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_device_bulk_enter(struct usb2_xfer *xfer)
|
||||
musbotg_device_bulk_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_device_bulk_start(struct usb2_xfer *xfer)
|
||||
musbotg_device_bulk_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* setup TDs */
|
||||
musbotg_setup_standard_chain(xfer);
|
||||
musbotg_start_standard_chain(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods musbotg_device_bulk_methods =
|
||||
struct usb_pipe_methods musbotg_device_bulk_methods =
|
||||
{
|
||||
.open = musbotg_device_bulk_open,
|
||||
.close = musbotg_device_bulk_close,
|
||||
@ -1905,32 +1905,32 @@ struct usb2_pipe_methods musbotg_device_bulk_methods =
|
||||
* musbotg control support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
musbotg_device_ctrl_open(struct usb2_xfer *xfer)
|
||||
musbotg_device_ctrl_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_device_ctrl_close(struct usb2_xfer *xfer)
|
||||
musbotg_device_ctrl_close(struct usb_xfer *xfer)
|
||||
{
|
||||
musbotg_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_device_ctrl_enter(struct usb2_xfer *xfer)
|
||||
musbotg_device_ctrl_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_device_ctrl_start(struct usb2_xfer *xfer)
|
||||
musbotg_device_ctrl_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* setup TDs */
|
||||
musbotg_setup_standard_chain(xfer);
|
||||
musbotg_start_standard_chain(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods musbotg_device_ctrl_methods =
|
||||
struct usb_pipe_methods musbotg_device_ctrl_methods =
|
||||
{
|
||||
.open = musbotg_device_ctrl_open,
|
||||
.close = musbotg_device_ctrl_close,
|
||||
@ -1942,32 +1942,32 @@ struct usb2_pipe_methods musbotg_device_ctrl_methods =
|
||||
* musbotg interrupt support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
musbotg_device_intr_open(struct usb2_xfer *xfer)
|
||||
musbotg_device_intr_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_device_intr_close(struct usb2_xfer *xfer)
|
||||
musbotg_device_intr_close(struct usb_xfer *xfer)
|
||||
{
|
||||
musbotg_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_device_intr_enter(struct usb2_xfer *xfer)
|
||||
musbotg_device_intr_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_device_intr_start(struct usb2_xfer *xfer)
|
||||
musbotg_device_intr_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* setup TDs */
|
||||
musbotg_setup_standard_chain(xfer);
|
||||
musbotg_start_standard_chain(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods musbotg_device_intr_methods =
|
||||
struct usb_pipe_methods musbotg_device_intr_methods =
|
||||
{
|
||||
.open = musbotg_device_intr_open,
|
||||
.close = musbotg_device_intr_close,
|
||||
@ -1979,19 +1979,19 @@ struct usb2_pipe_methods musbotg_device_intr_methods =
|
||||
* musbotg full speed isochronous support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
musbotg_device_isoc_open(struct usb2_xfer *xfer)
|
||||
musbotg_device_isoc_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_device_isoc_close(struct usb2_xfer *xfer)
|
||||
musbotg_device_isoc_close(struct usb_xfer *xfer)
|
||||
{
|
||||
musbotg_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_device_isoc_enter(struct usb2_xfer *xfer)
|
||||
musbotg_device_isoc_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
struct musbotg_softc *sc = MUSBOTG_BUS2SC(xfer->xroot->bus);
|
||||
uint32_t temp;
|
||||
@ -2050,13 +2050,13 @@ musbotg_device_isoc_enter(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_device_isoc_start(struct usb2_xfer *xfer)
|
||||
musbotg_device_isoc_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* start TD chain */
|
||||
musbotg_start_standard_chain(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods musbotg_device_isoc_methods =
|
||||
struct usb_pipe_methods musbotg_device_isoc_methods =
|
||||
{
|
||||
.open = musbotg_device_isoc_open,
|
||||
.close = musbotg_device_isoc_close,
|
||||
@ -2070,8 +2070,8 @@ struct usb2_pipe_methods musbotg_device_isoc_methods =
|
||||
* Simulate a hardware HUB by handling all the necessary requests.
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
static const struct usb2_device_descriptor musbotg_devd = {
|
||||
.bLength = sizeof(struct usb2_device_descriptor),
|
||||
static const struct usb_device_descriptor musbotg_devd = {
|
||||
.bLength = sizeof(struct usb_device_descriptor),
|
||||
.bDescriptorType = UDESC_DEVICE,
|
||||
.bcdUSB = {0x00, 0x02},
|
||||
.bDeviceClass = UDCLASS_HUB,
|
||||
@ -2084,8 +2084,8 @@ static const struct usb2_device_descriptor musbotg_devd = {
|
||||
.bNumConfigurations = 1,
|
||||
};
|
||||
|
||||
static const struct usb2_device_qualifier musbotg_odevd = {
|
||||
.bLength = sizeof(struct usb2_device_qualifier),
|
||||
static const struct usb_device_qualifier musbotg_odevd = {
|
||||
.bLength = sizeof(struct usb_device_qualifier),
|
||||
.bDescriptorType = UDESC_DEVICE_QUALIFIER,
|
||||
.bcdUSB = {0x00, 0x02},
|
||||
.bDeviceClass = UDCLASS_HUB,
|
||||
@ -2097,7 +2097,7 @@ static const struct usb2_device_qualifier musbotg_odevd = {
|
||||
|
||||
static const struct musbotg_config_desc musbotg_confd = {
|
||||
.confd = {
|
||||
.bLength = sizeof(struct usb2_config_descriptor),
|
||||
.bLength = sizeof(struct usb_config_descriptor),
|
||||
.bDescriptorType = UDESC_CONFIG,
|
||||
.wTotalLength[0] = sizeof(musbotg_confd),
|
||||
.bNumInterface = 1,
|
||||
@ -2107,7 +2107,7 @@ static const struct musbotg_config_desc musbotg_confd = {
|
||||
.bMaxPower = 0,
|
||||
},
|
||||
.ifcd = {
|
||||
.bLength = sizeof(struct usb2_interface_descriptor),
|
||||
.bLength = sizeof(struct usb_interface_descriptor),
|
||||
.bDescriptorType = UDESC_INTERFACE,
|
||||
.bNumEndpoints = 1,
|
||||
.bInterfaceClass = UICLASS_HUB,
|
||||
@ -2115,7 +2115,7 @@ static const struct musbotg_config_desc musbotg_confd = {
|
||||
.bInterfaceProtocol = UIPROTO_HSHUBSTT,
|
||||
},
|
||||
.endpd = {
|
||||
.bLength = sizeof(struct usb2_endpoint_descriptor),
|
||||
.bLength = sizeof(struct usb_endpoint_descriptor),
|
||||
.bDescriptorType = UDESC_ENDPOINT,
|
||||
.bEndpointAddress = (UE_DIR_IN | MUSBOTG_INTR_ENDPT),
|
||||
.bmAttributes = UE_INTERRUPT,
|
||||
@ -2124,7 +2124,7 @@ static const struct musbotg_config_desc musbotg_confd = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_hub_descriptor_min musbotg_hubd = {
|
||||
static const struct usb_hub_descriptor_min musbotg_hubd = {
|
||||
.bDescLength = sizeof(musbotg_hubd),
|
||||
.bDescriptorType = UDESC_HUB,
|
||||
.bNbrPorts = 1,
|
||||
@ -2154,8 +2154,8 @@ USB_MAKE_STRING_DESC(STRING_VENDOR, musbotg_vendor);
|
||||
USB_MAKE_STRING_DESC(STRING_PRODUCT, musbotg_product);
|
||||
|
||||
static usb2_error_t
|
||||
musbotg_roothub_exec(struct usb2_device *udev,
|
||||
struct usb2_device_request *req, const void **pptr, uint16_t *plength)
|
||||
musbotg_roothub_exec(struct usb_device *udev,
|
||||
struct usb_device_request *req, const void **pptr, uint16_t *plength)
|
||||
{
|
||||
struct musbotg_softc *sc = MUSBOTG_BUS2SC(udev->bus);
|
||||
const void *ptr;
|
||||
@ -2554,11 +2554,11 @@ musbotg_roothub_exec(struct usb2_device *udev,
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_xfer_setup(struct usb2_setup_params *parm)
|
||||
musbotg_xfer_setup(struct usb_setup_params *parm)
|
||||
{
|
||||
const struct usb2_hw_ep_profile *pf;
|
||||
const struct usb_hw_ep_profile *pf;
|
||||
struct musbotg_softc *sc;
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
void *last_obj;
|
||||
uint32_t ntd;
|
||||
uint32_t n;
|
||||
@ -2661,14 +2661,14 @@ musbotg_xfer_setup(struct usb2_setup_params *parm)
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_xfer_unsetup(struct usb2_xfer *xfer)
|
||||
musbotg_xfer_unsetup(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
musbotg_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *edesc,
|
||||
struct usb2_pipe *pipe)
|
||||
musbotg_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
|
||||
struct usb_pipe *pipe)
|
||||
{
|
||||
struct musbotg_softc *sc = MUSBOTG_BUS2SC(udev->bus);
|
||||
|
||||
@ -2708,7 +2708,7 @@ musbotg_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *ede
|
||||
}
|
||||
}
|
||||
|
||||
struct usb2_bus_methods musbotg_bus_methods =
|
||||
struct usb_bus_methods musbotg_bus_methods =
|
||||
{
|
||||
.pipe_init = &musbotg_pipe_init,
|
||||
.xfer_setup = &musbotg_xfer_setup,
|
||||
|
@ -305,7 +305,7 @@ struct musbotg_dma {
|
||||
struct musbotg_td {
|
||||
struct musbotg_td *obj_next;
|
||||
musbotg_cmd_t *func;
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_cache *pc;
|
||||
uint32_t offset;
|
||||
uint32_t remainder;
|
||||
uint16_t max_frame_size; /* packet_size * mult */
|
||||
@ -320,7 +320,7 @@ struct musbotg_td {
|
||||
|
||||
struct musbotg_std_temp {
|
||||
musbotg_cmd_t *func;
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_cache *pc;
|
||||
struct musbotg_td *td;
|
||||
struct musbotg_td *td_next;
|
||||
uint32_t len;
|
||||
@ -336,14 +336,14 @@ struct musbotg_std_temp {
|
||||
};
|
||||
|
||||
struct musbotg_config_desc {
|
||||
struct usb2_config_descriptor confd;
|
||||
struct usb2_interface_descriptor ifcd;
|
||||
struct usb2_endpoint_descriptor endpd;
|
||||
struct usb_config_descriptor confd;
|
||||
struct usb_interface_descriptor ifcd;
|
||||
struct usb_endpoint_descriptor endpd;
|
||||
} __packed;
|
||||
|
||||
union musbotg_hub_temp {
|
||||
uWord wValue;
|
||||
struct usb2_port_status ps;
|
||||
struct usb_port_status ps;
|
||||
};
|
||||
|
||||
struct musbotg_flags {
|
||||
@ -362,11 +362,11 @@ struct musbotg_flags {
|
||||
};
|
||||
|
||||
struct musbotg_softc {
|
||||
struct usb2_bus sc_bus;
|
||||
struct usb_bus sc_bus;
|
||||
union musbotg_hub_temp sc_hub_temp;
|
||||
struct usb2_hw_ep_profile sc_hw_ep_profile[16];
|
||||
struct usb_hw_ep_profile sc_hw_ep_profile[16];
|
||||
|
||||
struct usb2_device *sc_devices[MUSB2_MAX_DEVICES];
|
||||
struct usb_device *sc_devices[MUSB2_MAX_DEVICES];
|
||||
struct resource *sc_io_res;
|
||||
struct resource *sc_irq_res;
|
||||
void *sc_intr_hdl;
|
||||
|
@ -87,20 +87,20 @@ static void ohci_dump_itds(ohci_itd_t *);
|
||||
|
||||
#define OHCI_INTR_ENDPT 1
|
||||
|
||||
extern struct usb2_bus_methods ohci_bus_methods;
|
||||
extern struct usb2_pipe_methods ohci_device_bulk_methods;
|
||||
extern struct usb2_pipe_methods ohci_device_ctrl_methods;
|
||||
extern struct usb2_pipe_methods ohci_device_intr_methods;
|
||||
extern struct usb2_pipe_methods ohci_device_isoc_methods;
|
||||
extern struct usb_bus_methods ohci_bus_methods;
|
||||
extern struct usb_pipe_methods ohci_device_bulk_methods;
|
||||
extern struct usb_pipe_methods ohci_device_ctrl_methods;
|
||||
extern struct usb_pipe_methods ohci_device_intr_methods;
|
||||
extern struct usb_pipe_methods ohci_device_isoc_methods;
|
||||
|
||||
static void ohci_do_poll(struct usb2_bus *bus);
|
||||
static void ohci_device_done(struct usb2_xfer *xfer, usb2_error_t error);
|
||||
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_timeout(void *arg);
|
||||
static uint8_t ohci_check_transfer(struct usb2_xfer *xfer);
|
||||
static uint8_t ohci_check_transfer(struct usb_xfer *xfer);
|
||||
static void ohci_root_intr(ohci_softc_t *sc);
|
||||
|
||||
struct ohci_std_temp {
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_cache *pc;
|
||||
ohci_td_t *td;
|
||||
ohci_td_t *td_next;
|
||||
uint32_t average;
|
||||
@ -120,7 +120,7 @@ ohci_get_hcca(ohci_softc_t *sc)
|
||||
}
|
||||
|
||||
void
|
||||
ohci_iterate_hw_softc(struct usb2_bus *bus, usb2_bus_mem_sub_cb_t *cb)
|
||||
ohci_iterate_hw_softc(struct usb_bus *bus, usb2_bus_mem_sub_cb_t *cb)
|
||||
{
|
||||
struct ohci_softc *sc = OHCI_BUS2SC(bus);
|
||||
uint32_t i;
|
||||
@ -146,7 +146,7 @@ ohci_iterate_hw_softc(struct usb2_bus *bus, usb2_bus_mem_sub_cb_t *cb)
|
||||
static usb2_error_t
|
||||
ohci_controller_init(ohci_softc_t *sc)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
uint32_t i;
|
||||
uint32_t ctl;
|
||||
uint32_t ival;
|
||||
@ -273,9 +273,9 @@ ohci_controller_init(ohci_softc_t *sc)
|
||||
}
|
||||
|
||||
static struct ohci_ed *
|
||||
ohci_init_ed(struct usb2_page_cache *pc)
|
||||
ohci_init_ed(struct usb_page_cache *pc)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
struct ohci_ed *ed;
|
||||
|
||||
usb2_get_page(pc, 0, &buf_res);
|
||||
@ -292,7 +292,7 @@ ohci_init_ed(struct usb2_page_cache *pc)
|
||||
usb2_error_t
|
||||
ohci_init(ohci_softc_t *sc)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
uint16_t i;
|
||||
uint16_t bit;
|
||||
uint16_t x;
|
||||
@ -653,7 +653,7 @@ ohci_dump_ed(ohci_ed_t *sed)
|
||||
#endif
|
||||
|
||||
static void
|
||||
ohci_transfer_intr_enqueue(struct usb2_xfer *xfer)
|
||||
ohci_transfer_intr_enqueue(struct usb_xfer *xfer)
|
||||
{
|
||||
/* check for early completion */
|
||||
if (ohci_check_transfer(xfer)) {
|
||||
@ -731,7 +731,7 @@ _ohci_remove_qh(ohci_ed_t *sed, ohci_ed_t *last)
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_isoc_done(struct usb2_xfer *xfer)
|
||||
ohci_isoc_done(struct usb_xfer *xfer)
|
||||
{
|
||||
uint8_t nframes;
|
||||
uint32_t *plen = xfer->frlengths;
|
||||
@ -813,7 +813,7 @@ static const char *const
|
||||
#endif
|
||||
|
||||
static usb2_error_t
|
||||
ohci_non_isoc_done_sub(struct usb2_xfer *xfer)
|
||||
ohci_non_isoc_done_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
ohci_td_t *td;
|
||||
ohci_td_t *td_alt_next;
|
||||
@ -906,7 +906,7 @@ ohci_non_isoc_done_sub(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_non_isoc_done(struct usb2_xfer *xfer)
|
||||
ohci_non_isoc_done(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
|
||||
@ -958,7 +958,7 @@ ohci_non_isoc_done(struct usb2_xfer *xfer)
|
||||
* ohci_check_transfer_sub
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
ohci_check_transfer_sub(struct usb2_xfer *xfer)
|
||||
ohci_check_transfer_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
ohci_td_t *td;
|
||||
ohci_ed_t *ed;
|
||||
@ -1042,7 +1042,7 @@ ohci_check_transfer_sub(struct usb2_xfer *xfer)
|
||||
* Else: USB transfer is finished
|
||||
*------------------------------------------------------------------------*/
|
||||
static uint8_t
|
||||
ohci_check_transfer(struct usb2_xfer *xfer)
|
||||
ohci_check_transfer(struct usb_xfer *xfer)
|
||||
{
|
||||
ohci_ed_t *ed;
|
||||
uint32_t ed_headp;
|
||||
@ -1104,7 +1104,7 @@ ohci_rhsc_enable(ohci_softc_t *sc)
|
||||
static void
|
||||
ohci_interrupt_poll(ohci_softc_t *sc)
|
||||
{
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
|
||||
repeat:
|
||||
TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) {
|
||||
@ -1240,7 +1240,7 @@ ohci_interrupt(ohci_softc_t *sc)
|
||||
static void
|
||||
ohci_timeout(void *arg)
|
||||
{
|
||||
struct usb2_xfer *xfer = arg;
|
||||
struct usb_xfer *xfer = arg;
|
||||
|
||||
DPRINTF("xfer=%p\n", xfer);
|
||||
|
||||
@ -1251,7 +1251,7 @@ ohci_timeout(void *arg)
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_do_poll(struct usb2_bus *bus)
|
||||
ohci_do_poll(struct usb_bus *bus)
|
||||
{
|
||||
struct ohci_softc *sc = OHCI_BUS2SC(bus);
|
||||
|
||||
@ -1263,7 +1263,7 @@ ohci_do_poll(struct usb2_bus *bus)
|
||||
static void
|
||||
ohci_setup_standard_chain_sub(struct ohci_std_temp *temp)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
ohci_td_t *td;
|
||||
ohci_td_t *td_next;
|
||||
ohci_td_t *td_alt_next;
|
||||
@ -1405,10 +1405,10 @@ ohci_setup_standard_chain_sub(struct ohci_std_temp *temp)
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_setup_standard_chain(struct usb2_xfer *xfer, ohci_ed_t **ed_last)
|
||||
ohci_setup_standard_chain(struct usb_xfer *xfer, ohci_ed_t **ed_last)
|
||||
{
|
||||
struct ohci_std_temp temp;
|
||||
struct usb2_pipe_methods *methods;
|
||||
struct usb_pipe_methods *methods;
|
||||
ohci_ed_t *ed;
|
||||
ohci_td_t *td;
|
||||
uint32_t ed_flags;
|
||||
@ -1645,9 +1645,9 @@ ohci_root_intr(ohci_softc_t *sc)
|
||||
* from close and from interrupt
|
||||
*/
|
||||
static void
|
||||
ohci_device_done(struct usb2_xfer *xfer, usb2_error_t error)
|
||||
ohci_device_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
{
|
||||
struct usb2_pipe_methods *methods = xfer->pipe->methods;
|
||||
struct usb_pipe_methods *methods = xfer->pipe->methods;
|
||||
ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus);
|
||||
ohci_ed_t *ed;
|
||||
|
||||
@ -1684,25 +1684,25 @@ ohci_device_done(struct usb2_xfer *xfer, usb2_error_t error)
|
||||
* ohci bulk support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
ohci_device_bulk_open(struct usb2_xfer *xfer)
|
||||
ohci_device_bulk_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_device_bulk_close(struct usb2_xfer *xfer)
|
||||
ohci_device_bulk_close(struct usb_xfer *xfer)
|
||||
{
|
||||
ohci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_device_bulk_enter(struct usb2_xfer *xfer)
|
||||
ohci_device_bulk_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_device_bulk_start(struct usb2_xfer *xfer)
|
||||
ohci_device_bulk_start(struct usb_xfer *xfer)
|
||||
{
|
||||
ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus);
|
||||
|
||||
@ -1713,7 +1713,7 @@ ohci_device_bulk_start(struct usb2_xfer *xfer)
|
||||
ohci_transfer_intr_enqueue(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods ohci_device_bulk_methods =
|
||||
struct usb_pipe_methods ohci_device_bulk_methods =
|
||||
{
|
||||
.open = ohci_device_bulk_open,
|
||||
.close = ohci_device_bulk_close,
|
||||
@ -1725,25 +1725,25 @@ struct usb2_pipe_methods ohci_device_bulk_methods =
|
||||
* ohci control support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
ohci_device_ctrl_open(struct usb2_xfer *xfer)
|
||||
ohci_device_ctrl_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_device_ctrl_close(struct usb2_xfer *xfer)
|
||||
ohci_device_ctrl_close(struct usb_xfer *xfer)
|
||||
{
|
||||
ohci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_device_ctrl_enter(struct usb2_xfer *xfer)
|
||||
ohci_device_ctrl_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_device_ctrl_start(struct usb2_xfer *xfer)
|
||||
ohci_device_ctrl_start(struct usb_xfer *xfer)
|
||||
{
|
||||
ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus);
|
||||
|
||||
@ -1754,7 +1754,7 @@ ohci_device_ctrl_start(struct usb2_xfer *xfer)
|
||||
ohci_transfer_intr_enqueue(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods ohci_device_ctrl_methods =
|
||||
struct usb_pipe_methods ohci_device_ctrl_methods =
|
||||
{
|
||||
.open = ohci_device_ctrl_open,
|
||||
.close = ohci_device_ctrl_close,
|
||||
@ -1766,7 +1766,7 @@ struct usb2_pipe_methods ohci_device_ctrl_methods =
|
||||
* ohci interrupt support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
ohci_device_intr_open(struct usb2_xfer *xfer)
|
||||
ohci_device_intr_open(struct usb_xfer *xfer)
|
||||
{
|
||||
ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus);
|
||||
uint16_t best;
|
||||
@ -1799,7 +1799,7 @@ ohci_device_intr_open(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_device_intr_close(struct usb2_xfer *xfer)
|
||||
ohci_device_intr_close(struct usb_xfer *xfer)
|
||||
{
|
||||
ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus);
|
||||
|
||||
@ -1809,13 +1809,13 @@ ohci_device_intr_close(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_device_intr_enter(struct usb2_xfer *xfer)
|
||||
ohci_device_intr_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_device_intr_start(struct usb2_xfer *xfer)
|
||||
ohci_device_intr_start(struct usb_xfer *xfer)
|
||||
{
|
||||
ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus);
|
||||
|
||||
@ -1826,7 +1826,7 @@ ohci_device_intr_start(struct usb2_xfer *xfer)
|
||||
ohci_transfer_intr_enqueue(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods ohci_device_intr_methods =
|
||||
struct usb_pipe_methods ohci_device_intr_methods =
|
||||
{
|
||||
.open = ohci_device_intr_open,
|
||||
.close = ohci_device_intr_close,
|
||||
@ -1838,22 +1838,22 @@ struct usb2_pipe_methods ohci_device_intr_methods =
|
||||
* ohci isochronous support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
ohci_device_isoc_open(struct usb2_xfer *xfer)
|
||||
ohci_device_isoc_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_device_isoc_close(struct usb2_xfer *xfer)
|
||||
ohci_device_isoc_close(struct usb_xfer *xfer)
|
||||
{
|
||||
/**/
|
||||
ohci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_device_isoc_enter(struct usb2_xfer *xfer)
|
||||
ohci_device_isoc_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
ohci_softc_t *sc = OHCI_BUS2SC(xfer->xroot->bus);
|
||||
struct ohci_hcca *hcca;
|
||||
uint32_t buf_offset;
|
||||
@ -2028,13 +2028,13 @@ ohci_device_isoc_enter(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_device_isoc_start(struct usb2_xfer *xfer)
|
||||
ohci_device_isoc_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* put transfer on interrupt queue */
|
||||
ohci_transfer_intr_enqueue(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods ohci_device_isoc_methods =
|
||||
struct usb_pipe_methods ohci_device_isoc_methods =
|
||||
{
|
||||
.open = ohci_device_isoc_open,
|
||||
.close = ohci_device_isoc_close,
|
||||
@ -2049,9 +2049,9 @@ struct usb2_pipe_methods ohci_device_isoc_methods =
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
static const
|
||||
struct usb2_device_descriptor ohci_devd =
|
||||
struct usb_device_descriptor ohci_devd =
|
||||
{
|
||||
sizeof(struct usb2_device_descriptor),
|
||||
sizeof(struct usb_device_descriptor),
|
||||
UDESC_DEVICE, /* type */
|
||||
{0x00, 0x01}, /* USB version */
|
||||
UDCLASS_HUB, /* class */
|
||||
@ -2067,7 +2067,7 @@ static const
|
||||
struct ohci_config_desc ohci_confd =
|
||||
{
|
||||
.confd = {
|
||||
.bLength = sizeof(struct usb2_config_descriptor),
|
||||
.bLength = sizeof(struct usb_config_descriptor),
|
||||
.bDescriptorType = UDESC_CONFIG,
|
||||
.wTotalLength[0] = sizeof(ohci_confd),
|
||||
.bNumInterface = 1,
|
||||
@ -2077,7 +2077,7 @@ struct ohci_config_desc ohci_confd =
|
||||
.bMaxPower = 0, /* max power */
|
||||
},
|
||||
.ifcd = {
|
||||
.bLength = sizeof(struct usb2_interface_descriptor),
|
||||
.bLength = sizeof(struct usb_interface_descriptor),
|
||||
.bDescriptorType = UDESC_INTERFACE,
|
||||
.bNumEndpoints = 1,
|
||||
.bInterfaceClass = UICLASS_HUB,
|
||||
@ -2085,7 +2085,7 @@ struct ohci_config_desc ohci_confd =
|
||||
.bInterfaceProtocol = UIPROTO_FSHUB,
|
||||
},
|
||||
.endpd = {
|
||||
.bLength = sizeof(struct usb2_endpoint_descriptor),
|
||||
.bLength = sizeof(struct usb_endpoint_descriptor),
|
||||
.bDescriptorType = UDESC_ENDPOINT,
|
||||
.bEndpointAddress = UE_DIR_IN | OHCI_INTR_ENDPT,
|
||||
.bmAttributes = UE_INTERRUPT,
|
||||
@ -2095,7 +2095,7 @@ struct ohci_config_desc ohci_confd =
|
||||
};
|
||||
|
||||
static const
|
||||
struct usb2_hub_descriptor ohci_hubd =
|
||||
struct usb_hub_descriptor ohci_hubd =
|
||||
{
|
||||
0, /* dynamic length */
|
||||
UDESC_HUB,
|
||||
@ -2107,8 +2107,8 @@ struct usb2_hub_descriptor ohci_hubd =
|
||||
};
|
||||
|
||||
static usb2_error_t
|
||||
ohci_roothub_exec(struct usb2_device *udev,
|
||||
struct usb2_device_request *req, const void **pptr, uint16_t *plength)
|
||||
ohci_roothub_exec(struct usb_device *udev,
|
||||
struct usb_device_request *req, const void **pptr, uint16_t *plength)
|
||||
{
|
||||
ohci_softc_t *sc = OHCI_BUS2SC(udev->bus);
|
||||
const void *ptr;
|
||||
@ -2399,12 +2399,12 @@ ohci_roothub_exec(struct usb2_device *udev,
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_xfer_setup(struct usb2_setup_params *parm)
|
||||
ohci_xfer_setup(struct usb_setup_params *parm)
|
||||
{
|
||||
struct usb2_page_search page_info;
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_search page_info;
|
||||
struct usb_page_cache *pc;
|
||||
ohci_softc_t *sc;
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
void *last_obj;
|
||||
uint32_t ntd;
|
||||
uint32_t nitd;
|
||||
@ -2563,8 +2563,8 @@ ohci_xfer_setup(struct usb2_setup_params *parm)
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *edesc,
|
||||
struct usb2_pipe *pipe)
|
||||
ohci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
|
||||
struct usb_pipe *pipe)
|
||||
{
|
||||
ohci_softc_t *sc = OHCI_BUS2SC(udev->bus);
|
||||
|
||||
@ -2603,13 +2603,13 @@ ohci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *edesc,
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_xfer_unsetup(struct usb2_xfer *xfer)
|
||||
ohci_xfer_unsetup(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_get_dma_delay(struct usb2_bus *bus, uint32_t *pus)
|
||||
ohci_get_dma_delay(struct usb_bus *bus, uint32_t *pus)
|
||||
{
|
||||
/*
|
||||
* Wait until hardware has finished any possible use of the
|
||||
@ -2619,11 +2619,11 @@ ohci_get_dma_delay(struct usb2_bus *bus, uint32_t *pus)
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_device_resume(struct usb2_device *udev)
|
||||
ohci_device_resume(struct usb_device *udev)
|
||||
{
|
||||
struct ohci_softc *sc = OHCI_BUS2SC(udev->bus);
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb2_pipe_methods *methods;
|
||||
struct usb_xfer *xfer;
|
||||
struct usb_pipe_methods *methods;
|
||||
ohci_ed_t *ed;
|
||||
|
||||
DPRINTF("\n");
|
||||
@ -2657,11 +2657,11 @@ ohci_device_resume(struct usb2_device *udev)
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_device_suspend(struct usb2_device *udev)
|
||||
ohci_device_suspend(struct usb_device *udev)
|
||||
{
|
||||
struct ohci_softc *sc = OHCI_BUS2SC(udev->bus);
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb2_pipe_methods *methods;
|
||||
struct usb_xfer *xfer;
|
||||
struct usb_pipe_methods *methods;
|
||||
ohci_ed_t *ed;
|
||||
|
||||
DPRINTF("\n");
|
||||
@ -2693,7 +2693,7 @@ ohci_device_suspend(struct usb2_device *udev)
|
||||
}
|
||||
|
||||
static void
|
||||
ohci_set_hw_power(struct usb2_bus *bus)
|
||||
ohci_set_hw_power(struct usb_bus *bus)
|
||||
{
|
||||
struct ohci_softc *sc = OHCI_BUS2SC(bus);
|
||||
uint32_t temp;
|
||||
@ -2727,7 +2727,7 @@ ohci_set_hw_power(struct usb2_bus *bus)
|
||||
return;
|
||||
}
|
||||
|
||||
struct usb2_bus_methods ohci_bus_methods =
|
||||
struct usb_bus_methods ohci_bus_methods =
|
||||
{
|
||||
.pipe_init = ohci_pipe_init,
|
||||
.xfer_setup = ohci_xfer_setup,
|
||||
|
@ -196,7 +196,7 @@ struct ohci_ed {
|
||||
struct ohci_ed *next;
|
||||
struct ohci_ed *prev;
|
||||
struct ohci_ed *obj_next;
|
||||
struct usb2_page_cache *page_cache;
|
||||
struct usb_page_cache *page_cache;
|
||||
uint32_t ed_self;
|
||||
} __aligned(OHCI_ED_ALIGN);
|
||||
|
||||
@ -230,7 +230,7 @@ struct ohci_td {
|
||||
*/
|
||||
struct ohci_td *obj_next;
|
||||
struct ohci_td *alt_next;
|
||||
struct usb2_page_cache *page_cache;
|
||||
struct usb_page_cache *page_cache;
|
||||
uint32_t td_self;
|
||||
uint16_t len;
|
||||
} __aligned(OHCI_TD_ALIGN);
|
||||
@ -262,7 +262,7 @@ struct ohci_itd {
|
||||
* Extra information needed:
|
||||
*/
|
||||
struct ohci_itd *obj_next;
|
||||
struct usb2_page_cache *page_cache;
|
||||
struct usb_page_cache *page_cache;
|
||||
uint32_t itd_self;
|
||||
uint8_t frames;
|
||||
} __aligned(OHCI_ITD_ALIGN);
|
||||
@ -290,39 +290,39 @@ typedef struct ohci_itd ohci_itd_t;
|
||||
#define OHCI_NO_EDS (2*OHCI_NO_INTRS)
|
||||
|
||||
struct ohci_hw_softc {
|
||||
struct usb2_page_cache hcca_pc;
|
||||
struct usb2_page_cache ctrl_start_pc;
|
||||
struct usb2_page_cache bulk_start_pc;
|
||||
struct usb2_page_cache isoc_start_pc;
|
||||
struct usb2_page_cache intr_start_pc[OHCI_NO_EDS];
|
||||
struct usb_page_cache hcca_pc;
|
||||
struct usb_page_cache ctrl_start_pc;
|
||||
struct usb_page_cache bulk_start_pc;
|
||||
struct usb_page_cache isoc_start_pc;
|
||||
struct usb_page_cache intr_start_pc[OHCI_NO_EDS];
|
||||
|
||||
struct usb2_page hcca_pg;
|
||||
struct usb2_page ctrl_start_pg;
|
||||
struct usb2_page bulk_start_pg;
|
||||
struct usb2_page isoc_start_pg;
|
||||
struct usb2_page intr_start_pg[OHCI_NO_EDS];
|
||||
struct usb_page hcca_pg;
|
||||
struct usb_page ctrl_start_pg;
|
||||
struct usb_page bulk_start_pg;
|
||||
struct usb_page isoc_start_pg;
|
||||
struct usb_page intr_start_pg[OHCI_NO_EDS];
|
||||
};
|
||||
|
||||
struct ohci_config_desc {
|
||||
struct usb2_config_descriptor confd;
|
||||
struct usb2_interface_descriptor ifcd;
|
||||
struct usb2_endpoint_descriptor endpd;
|
||||
struct usb_config_descriptor confd;
|
||||
struct usb_interface_descriptor ifcd;
|
||||
struct usb_endpoint_descriptor endpd;
|
||||
} __packed;
|
||||
|
||||
union ohci_hub_desc {
|
||||
struct usb2_status stat;
|
||||
struct usb2_port_status ps;
|
||||
struct usb2_hub_descriptor hubd;
|
||||
struct usb_status stat;
|
||||
struct usb_port_status ps;
|
||||
struct usb_hub_descriptor hubd;
|
||||
uint8_t temp[128];
|
||||
};
|
||||
|
||||
typedef struct ohci_softc {
|
||||
struct ohci_hw_softc sc_hw;
|
||||
struct usb2_bus sc_bus; /* base device */
|
||||
struct usb2_callout sc_tmo_rhsc;
|
||||
struct usb_bus sc_bus; /* base device */
|
||||
struct usb_callout sc_tmo_rhsc;
|
||||
union ohci_hub_desc sc_hub_desc;
|
||||
|
||||
struct usb2_device *sc_devices[OHCI_MAX_DEVICES];
|
||||
struct usb_device *sc_devices[OHCI_MAX_DEVICES];
|
||||
struct resource *sc_io_res;
|
||||
struct resource *sc_irq_res;
|
||||
struct ohci_hcca *sc_hcca_p;
|
||||
|
@ -100,11 +100,11 @@ static void uhci_dump_tds(uhci_td_t *td);
|
||||
|
||||
struct uhci_mem_layout {
|
||||
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb2_page_search fix_res;
|
||||
struct usb_page_search buf_res;
|
||||
struct usb_page_search fix_res;
|
||||
|
||||
struct usb2_page_cache *buf_pc;
|
||||
struct usb2_page_cache *fix_pc;
|
||||
struct usb_page_cache *buf_pc;
|
||||
struct usb_page_cache *fix_pc;
|
||||
|
||||
uint32_t buf_offset;
|
||||
|
||||
@ -126,22 +126,22 @@ struct uhci_std_temp {
|
||||
uint8_t last_frame;
|
||||
};
|
||||
|
||||
extern struct usb2_bus_methods uhci_bus_methods;
|
||||
extern struct usb2_pipe_methods uhci_device_bulk_methods;
|
||||
extern struct usb2_pipe_methods uhci_device_ctrl_methods;
|
||||
extern struct usb2_pipe_methods uhci_device_intr_methods;
|
||||
extern struct usb2_pipe_methods uhci_device_isoc_methods;
|
||||
extern struct usb_bus_methods uhci_bus_methods;
|
||||
extern struct usb_pipe_methods uhci_device_bulk_methods;
|
||||
extern struct usb_pipe_methods uhci_device_ctrl_methods;
|
||||
extern struct usb_pipe_methods uhci_device_intr_methods;
|
||||
extern struct usb_pipe_methods uhci_device_isoc_methods;
|
||||
|
||||
static uint8_t uhci_restart(uhci_softc_t *sc);
|
||||
static void uhci_do_poll(struct usb2_bus *);
|
||||
static void uhci_device_done(struct usb2_xfer *, usb2_error_t);
|
||||
static void uhci_transfer_intr_enqueue(struct usb2_xfer *);
|
||||
static void uhci_do_poll(struct usb_bus *);
|
||||
static void uhci_device_done(struct usb_xfer *, usb2_error_t);
|
||||
static void uhci_transfer_intr_enqueue(struct usb_xfer *);
|
||||
static void uhci_timeout(void *);
|
||||
static uint8_t uhci_check_transfer(struct usb2_xfer *);
|
||||
static uint8_t uhci_check_transfer(struct usb_xfer *);
|
||||
static void uhci_root_intr(uhci_softc_t *sc);
|
||||
|
||||
void
|
||||
uhci_iterate_hw_softc(struct usb2_bus *bus, usb2_bus_mem_sub_cb_t *cb)
|
||||
uhci_iterate_hw_softc(struct usb_bus *bus, usb2_bus_mem_sub_cb_t *cb)
|
||||
{
|
||||
struct uhci_softc *sc = UHCI_BUS2SC(bus);
|
||||
uint32_t i;
|
||||
@ -178,7 +178,7 @@ uhci_iterate_hw_softc(struct usb2_bus *bus, usb2_bus_mem_sub_cb_t *cb)
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_mem_layout_init(struct uhci_mem_layout *ml, struct usb2_xfer *xfer)
|
||||
uhci_mem_layout_init(struct uhci_mem_layout *ml, struct usb_xfer *xfer)
|
||||
{
|
||||
ml->buf_pc = xfer->frbuffers + 0;
|
||||
ml->fix_pc = xfer->buf_fixup;
|
||||
@ -255,7 +255,7 @@ uhci_mem_layout_fixup(struct uhci_mem_layout *ml, struct uhci_td *td)
|
||||
static uint8_t
|
||||
uhci_restart(uhci_softc_t *sc)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
|
||||
USB_BUS_LOCK_ASSERT(&sc->sc_bus, MA_OWNED);
|
||||
|
||||
@ -387,9 +387,9 @@ uhci_start(uhci_softc_t *sc)
|
||||
}
|
||||
|
||||
static struct uhci_qh *
|
||||
uhci_init_qh(struct usb2_page_cache *pc)
|
||||
uhci_init_qh(struct usb_page_cache *pc)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
struct uhci_qh *qh;
|
||||
|
||||
usb2_get_page(pc, 0, &buf_res);
|
||||
@ -406,9 +406,9 @@ uhci_init_qh(struct usb2_page_cache *pc)
|
||||
}
|
||||
|
||||
static struct uhci_td *
|
||||
uhci_init_td(struct usb2_page_cache *pc)
|
||||
uhci_init_td(struct usb_page_cache *pc)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
struct uhci_td *td;
|
||||
|
||||
usb2_get_page(pc, 0, &buf_res);
|
||||
@ -591,7 +591,7 @@ uhci_init(uhci_softc_t *sc)
|
||||
td_lst->td_buffer = htole32(0);
|
||||
}
|
||||
if (1) {
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
uint32_t *pframes;
|
||||
|
||||
usb2_get_page(&sc->sc_hw.pframes_pc, 0, &buf_res);
|
||||
@ -896,7 +896,7 @@ uhci_rem_loop(uhci_softc_t *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_transfer_intr_enqueue(struct usb2_xfer *xfer)
|
||||
uhci_transfer_intr_enqueue(struct usb_xfer *xfer)
|
||||
{
|
||||
/* check for early completion */
|
||||
if (uhci_check_transfer(xfer)) {
|
||||
@ -1023,9 +1023,9 @@ _uhci_remove_qh(uhci_qh_t *sqh, uhci_qh_t *last)
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_isoc_done(uhci_softc_t *sc, struct usb2_xfer *xfer)
|
||||
uhci_isoc_done(uhci_softc_t *sc, struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_page_search res;
|
||||
struct usb_page_search res;
|
||||
uint32_t nframes = xfer->nframes;
|
||||
uint32_t status;
|
||||
uint32_t offset = 0;
|
||||
@ -1090,9 +1090,9 @@ uhci_isoc_done(uhci_softc_t *sc, struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
uhci_non_isoc_done_sub(struct usb2_xfer *xfer)
|
||||
uhci_non_isoc_done_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_page_search res;
|
||||
struct usb_page_search res;
|
||||
uhci_td_t *td;
|
||||
uhci_td_t *td_alt_next;
|
||||
uint32_t status;
|
||||
@ -1203,7 +1203,7 @@ uhci_non_isoc_done_sub(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_non_isoc_done(struct usb2_xfer *xfer)
|
||||
uhci_non_isoc_done(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
|
||||
@ -1261,7 +1261,7 @@ uhci_non_isoc_done(struct usb2_xfer *xfer)
|
||||
* in case it is wrong.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
uhci_check_transfer_sub(struct usb2_xfer *xfer)
|
||||
uhci_check_transfer_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
uhci_qh_t *qh;
|
||||
uhci_td_t *td;
|
||||
@ -1321,7 +1321,7 @@ uhci_check_transfer_sub(struct usb2_xfer *xfer)
|
||||
* Else: USB transfer is finished
|
||||
*------------------------------------------------------------------------*/
|
||||
static uint8_t
|
||||
uhci_check_transfer(struct usb2_xfer *xfer)
|
||||
uhci_check_transfer(struct usb_xfer *xfer)
|
||||
{
|
||||
uint32_t status;
|
||||
uint32_t token;
|
||||
@ -1419,7 +1419,7 @@ uhci_check_transfer(struct usb2_xfer *xfer)
|
||||
static void
|
||||
uhci_interrupt_poll(uhci_softc_t *sc)
|
||||
{
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
|
||||
repeat:
|
||||
TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) {
|
||||
@ -1514,7 +1514,7 @@ uhci_interrupt(uhci_softc_t *sc)
|
||||
static void
|
||||
uhci_timeout(void *arg)
|
||||
{
|
||||
struct usb2_xfer *xfer = arg;
|
||||
struct usb_xfer *xfer = arg;
|
||||
|
||||
DPRINTF("xfer=%p\n", xfer);
|
||||
|
||||
@ -1525,7 +1525,7 @@ uhci_timeout(void *arg)
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_do_poll(struct usb2_bus *bus)
|
||||
uhci_do_poll(struct usb_bus *bus)
|
||||
{
|
||||
struct uhci_softc *sc = UHCI_BUS2SC(bus);
|
||||
|
||||
@ -1676,7 +1676,7 @@ uhci_setup_standard_chain_sub(struct uhci_std_temp *temp)
|
||||
}
|
||||
|
||||
static uhci_td_t *
|
||||
uhci_setup_standard_chain(struct usb2_xfer *xfer)
|
||||
uhci_setup_standard_chain(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uhci_std_temp temp;
|
||||
uhci_td_t *td;
|
||||
@ -1857,9 +1857,9 @@ uhci_setup_standard_chain(struct usb2_xfer *xfer)
|
||||
*/
|
||||
|
||||
static void
|
||||
uhci_device_done(struct usb2_xfer *xfer, usb2_error_t error)
|
||||
uhci_device_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
{
|
||||
struct usb2_pipe_methods *methods = xfer->pipe->methods;
|
||||
struct usb_pipe_methods *methods = xfer->pipe->methods;
|
||||
uhci_softc_t *sc = UHCI_BUS2SC(xfer->xroot->bus);
|
||||
uhci_qh_t *qh;
|
||||
|
||||
@ -1909,25 +1909,25 @@ uhci_device_done(struct usb2_xfer *xfer, usb2_error_t error)
|
||||
* uhci bulk support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
uhci_device_bulk_open(struct usb2_xfer *xfer)
|
||||
uhci_device_bulk_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_device_bulk_close(struct usb2_xfer *xfer)
|
||||
uhci_device_bulk_close(struct usb_xfer *xfer)
|
||||
{
|
||||
uhci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_device_bulk_enter(struct usb2_xfer *xfer)
|
||||
uhci_device_bulk_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_device_bulk_start(struct usb2_xfer *xfer)
|
||||
uhci_device_bulk_start(struct usb_xfer *xfer)
|
||||
{
|
||||
uhci_softc_t *sc = UHCI_BUS2SC(xfer->xroot->bus);
|
||||
uhci_td_t *td;
|
||||
@ -1954,7 +1954,7 @@ uhci_device_bulk_start(struct usb2_xfer *xfer)
|
||||
uhci_transfer_intr_enqueue(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods uhci_device_bulk_methods =
|
||||
struct usb_pipe_methods uhci_device_bulk_methods =
|
||||
{
|
||||
.open = uhci_device_bulk_open,
|
||||
.close = uhci_device_bulk_close,
|
||||
@ -1966,25 +1966,25 @@ struct usb2_pipe_methods uhci_device_bulk_methods =
|
||||
* uhci control support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
uhci_device_ctrl_open(struct usb2_xfer *xfer)
|
||||
uhci_device_ctrl_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_device_ctrl_close(struct usb2_xfer *xfer)
|
||||
uhci_device_ctrl_close(struct usb_xfer *xfer)
|
||||
{
|
||||
uhci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_device_ctrl_enter(struct usb2_xfer *xfer)
|
||||
uhci_device_ctrl_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_device_ctrl_start(struct usb2_xfer *xfer)
|
||||
uhci_device_ctrl_start(struct usb_xfer *xfer)
|
||||
{
|
||||
uhci_softc_t *sc = UHCI_BUS2SC(xfer->xroot->bus);
|
||||
uhci_qh_t *qh;
|
||||
@ -2016,7 +2016,7 @@ uhci_device_ctrl_start(struct usb2_xfer *xfer)
|
||||
uhci_transfer_intr_enqueue(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods uhci_device_ctrl_methods =
|
||||
struct usb_pipe_methods uhci_device_ctrl_methods =
|
||||
{
|
||||
.open = uhci_device_ctrl_open,
|
||||
.close = uhci_device_ctrl_close,
|
||||
@ -2028,7 +2028,7 @@ struct usb2_pipe_methods uhci_device_ctrl_methods =
|
||||
* uhci interrupt support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
uhci_device_intr_open(struct usb2_xfer *xfer)
|
||||
uhci_device_intr_open(struct usb_xfer *xfer)
|
||||
{
|
||||
uhci_softc_t *sc = UHCI_BUS2SC(xfer->xroot->bus);
|
||||
uint16_t best;
|
||||
@ -2061,7 +2061,7 @@ uhci_device_intr_open(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_device_intr_close(struct usb2_xfer *xfer)
|
||||
uhci_device_intr_close(struct usb_xfer *xfer)
|
||||
{
|
||||
uhci_softc_t *sc = UHCI_BUS2SC(xfer->xroot->bus);
|
||||
|
||||
@ -2071,13 +2071,13 @@ uhci_device_intr_close(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_device_intr_enter(struct usb2_xfer *xfer)
|
||||
uhci_device_intr_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_device_intr_start(struct usb2_xfer *xfer)
|
||||
uhci_device_intr_start(struct usb_xfer *xfer)
|
||||
{
|
||||
uhci_softc_t *sc = UHCI_BUS2SC(xfer->xroot->bus);
|
||||
uhci_qh_t *qh;
|
||||
@ -2103,7 +2103,7 @@ uhci_device_intr_start(struct usb2_xfer *xfer)
|
||||
uhci_transfer_intr_enqueue(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods uhci_device_intr_methods =
|
||||
struct usb_pipe_methods uhci_device_intr_methods =
|
||||
{
|
||||
.open = uhci_device_intr_open,
|
||||
.close = uhci_device_intr_close,
|
||||
@ -2115,7 +2115,7 @@ struct usb2_pipe_methods uhci_device_intr_methods =
|
||||
* uhci isochronous support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
uhci_device_isoc_open(struct usb2_xfer *xfer)
|
||||
uhci_device_isoc_open(struct usb_xfer *xfer)
|
||||
{
|
||||
uhci_td_t *td;
|
||||
uint32_t td_token;
|
||||
@ -2144,13 +2144,13 @@ uhci_device_isoc_open(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_device_isoc_close(struct usb2_xfer *xfer)
|
||||
uhci_device_isoc_close(struct usb_xfer *xfer)
|
||||
{
|
||||
uhci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_device_isoc_enter(struct usb2_xfer *xfer)
|
||||
uhci_device_isoc_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uhci_mem_layout ml;
|
||||
uhci_softc_t *sc = UHCI_BUS2SC(xfer->xroot->bus);
|
||||
@ -2305,13 +2305,13 @@ uhci_device_isoc_enter(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_device_isoc_start(struct usb2_xfer *xfer)
|
||||
uhci_device_isoc_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* put transfer on interrupt queue */
|
||||
uhci_transfer_intr_enqueue(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods uhci_device_isoc_methods =
|
||||
struct usb_pipe_methods uhci_device_isoc_methods =
|
||||
{
|
||||
.open = uhci_device_isoc_open,
|
||||
.close = uhci_device_isoc_close,
|
||||
@ -2326,9 +2326,9 @@ struct usb2_pipe_methods uhci_device_isoc_methods =
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
static const
|
||||
struct usb2_device_descriptor uhci_devd =
|
||||
struct usb_device_descriptor uhci_devd =
|
||||
{
|
||||
sizeof(struct usb2_device_descriptor),
|
||||
sizeof(struct usb_device_descriptor),
|
||||
UDESC_DEVICE, /* type */
|
||||
{0x00, 0x01}, /* USB version */
|
||||
UDCLASS_HUB, /* class */
|
||||
@ -2342,7 +2342,7 @@ struct usb2_device_descriptor uhci_devd =
|
||||
|
||||
static const struct uhci_config_desc uhci_confd = {
|
||||
.confd = {
|
||||
.bLength = sizeof(struct usb2_config_descriptor),
|
||||
.bLength = sizeof(struct usb_config_descriptor),
|
||||
.bDescriptorType = UDESC_CONFIG,
|
||||
.wTotalLength[0] = sizeof(uhci_confd),
|
||||
.bNumInterface = 1,
|
||||
@ -2352,7 +2352,7 @@ static const struct uhci_config_desc uhci_confd = {
|
||||
.bMaxPower = 0 /* max power */
|
||||
},
|
||||
.ifcd = {
|
||||
.bLength = sizeof(struct usb2_interface_descriptor),
|
||||
.bLength = sizeof(struct usb_interface_descriptor),
|
||||
.bDescriptorType = UDESC_INTERFACE,
|
||||
.bNumEndpoints = 1,
|
||||
.bInterfaceClass = UICLASS_HUB,
|
||||
@ -2360,7 +2360,7 @@ static const struct uhci_config_desc uhci_confd = {
|
||||
.bInterfaceProtocol = UIPROTO_FSHUB,
|
||||
},
|
||||
.endpd = {
|
||||
.bLength = sizeof(struct usb2_endpoint_descriptor),
|
||||
.bLength = sizeof(struct usb_endpoint_descriptor),
|
||||
.bDescriptorType = UDESC_ENDPOINT,
|
||||
.bEndpointAddress = UE_DIR_IN | UHCI_INTR_ENDPT,
|
||||
.bmAttributes = UE_INTERRUPT,
|
||||
@ -2370,7 +2370,7 @@ static const struct uhci_config_desc uhci_confd = {
|
||||
};
|
||||
|
||||
static const
|
||||
struct usb2_hub_descriptor_min uhci_hubd_piix =
|
||||
struct usb_hub_descriptor_min uhci_hubd_piix =
|
||||
{
|
||||
sizeof(uhci_hubd_piix),
|
||||
UDESC_HUB,
|
||||
@ -2494,8 +2494,8 @@ uhci_portreset(uhci_softc_t *sc, uint16_t index)
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
uhci_roothub_exec(struct usb2_device *udev,
|
||||
struct usb2_device_request *req, const void **pptr, uint16_t *plength)
|
||||
uhci_roothub_exec(struct usb_device *udev,
|
||||
struct usb_device_request *req, const void **pptr, uint16_t *plength)
|
||||
{
|
||||
uhci_softc_t *sc = UHCI_BUS2SC(udev->bus);
|
||||
const void *ptr;
|
||||
@ -2847,12 +2847,12 @@ uhci_root_intr(uhci_softc_t *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_xfer_setup(struct usb2_setup_params *parm)
|
||||
uhci_xfer_setup(struct usb_setup_params *parm)
|
||||
{
|
||||
struct usb2_page_search page_info;
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_search page_info;
|
||||
struct usb_page_cache *pc;
|
||||
uhci_softc_t *sc;
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
void *last_obj;
|
||||
uint32_t ntd;
|
||||
uint32_t nqh;
|
||||
@ -3043,8 +3043,8 @@ uhci_xfer_setup(struct usb2_setup_params *parm)
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *edesc,
|
||||
struct usb2_pipe *pipe)
|
||||
uhci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
|
||||
struct usb_pipe *pipe)
|
||||
{
|
||||
uhci_softc_t *sc = UHCI_BUS2SC(udev->bus);
|
||||
|
||||
@ -3083,13 +3083,13 @@ uhci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *edesc,
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_xfer_unsetup(struct usb2_xfer *xfer)
|
||||
uhci_xfer_unsetup(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_get_dma_delay(struct usb2_bus *bus, uint32_t *pus)
|
||||
uhci_get_dma_delay(struct usb_bus *bus, uint32_t *pus)
|
||||
{
|
||||
/*
|
||||
* Wait until hardware has finished any possible use of the
|
||||
@ -3099,11 +3099,11 @@ uhci_get_dma_delay(struct usb2_bus *bus, uint32_t *pus)
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_device_resume(struct usb2_device *udev)
|
||||
uhci_device_resume(struct usb_device *udev)
|
||||
{
|
||||
struct uhci_softc *sc = UHCI_BUS2SC(udev->bus);
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb2_pipe_methods *methods;
|
||||
struct usb_xfer *xfer;
|
||||
struct usb_pipe_methods *methods;
|
||||
uhci_qh_t *qh;
|
||||
|
||||
DPRINTF("\n");
|
||||
@ -3141,11 +3141,11 @@ uhci_device_resume(struct usb2_device *udev)
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_device_suspend(struct usb2_device *udev)
|
||||
uhci_device_suspend(struct usb_device *udev)
|
||||
{
|
||||
struct uhci_softc *sc = UHCI_BUS2SC(udev->bus);
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb2_pipe_methods *methods;
|
||||
struct usb_xfer *xfer;
|
||||
struct usb_pipe_methods *methods;
|
||||
uhci_qh_t *qh;
|
||||
|
||||
DPRINTF("\n");
|
||||
@ -3185,7 +3185,7 @@ uhci_device_suspend(struct usb2_device *udev)
|
||||
}
|
||||
|
||||
static void
|
||||
uhci_set_hw_power(struct usb2_bus *bus)
|
||||
uhci_set_hw_power(struct usb_bus *bus)
|
||||
{
|
||||
struct uhci_softc *sc = UHCI_BUS2SC(bus);
|
||||
uint32_t flags;
|
||||
@ -3222,7 +3222,7 @@ uhci_set_hw_power(struct usb2_bus *bus)
|
||||
}
|
||||
|
||||
|
||||
struct usb2_bus_methods uhci_bus_methods =
|
||||
struct usb_bus_methods uhci_bus_methods =
|
||||
{
|
||||
.pipe_init = uhci_pipe_init,
|
||||
.xfer_setup = uhci_xfer_setup,
|
||||
|
@ -174,8 +174,8 @@ struct uhci_td {
|
||||
struct uhci_td *next;
|
||||
struct uhci_td *prev;
|
||||
struct uhci_td *obj_next;
|
||||
struct usb2_page_cache *page_cache;
|
||||
struct usb2_page_cache *fix_pc;
|
||||
struct usb_page_cache *page_cache;
|
||||
struct usb_page_cache *fix_pc;
|
||||
uint32_t td_self;
|
||||
uint16_t len;
|
||||
} __aligned(UHCI_TD_ALIGN);
|
||||
@ -213,7 +213,7 @@ struct uhci_qh {
|
||||
struct uhci_qh *h_prev;
|
||||
struct uhci_qh *obj_next;
|
||||
struct uhci_td *e_next;
|
||||
struct usb2_page_cache *page_cache;
|
||||
struct usb_page_cache *page_cache;
|
||||
uint32_t qh_self;
|
||||
uint16_t intr_pos;
|
||||
} __aligned(UHCI_QH_ALIGN);
|
||||
@ -235,44 +235,44 @@ typedef struct uhci_qh uhci_qh_t;
|
||||
#endif
|
||||
|
||||
struct uhci_config_desc {
|
||||
struct usb2_config_descriptor confd;
|
||||
struct usb2_interface_descriptor ifcd;
|
||||
struct usb2_endpoint_descriptor endpd;
|
||||
struct usb_config_descriptor confd;
|
||||
struct usb_interface_descriptor ifcd;
|
||||
struct usb_endpoint_descriptor endpd;
|
||||
} __packed;
|
||||
|
||||
union uhci_hub_desc {
|
||||
struct usb2_status stat;
|
||||
struct usb2_port_status ps;
|
||||
struct usb_status stat;
|
||||
struct usb_port_status ps;
|
||||
uint8_t temp[128];
|
||||
};
|
||||
|
||||
struct uhci_hw_softc {
|
||||
struct usb2_page_cache pframes_pc;
|
||||
struct usb2_page_cache isoc_start_pc[UHCI_VFRAMELIST_COUNT];
|
||||
struct usb2_page_cache intr_start_pc[UHCI_IFRAMELIST_COUNT];
|
||||
struct usb2_page_cache ls_ctl_start_pc;
|
||||
struct usb2_page_cache fs_ctl_start_pc;
|
||||
struct usb2_page_cache bulk_start_pc;
|
||||
struct usb2_page_cache last_qh_pc;
|
||||
struct usb2_page_cache last_td_pc;
|
||||
struct usb_page_cache pframes_pc;
|
||||
struct usb_page_cache isoc_start_pc[UHCI_VFRAMELIST_COUNT];
|
||||
struct usb_page_cache intr_start_pc[UHCI_IFRAMELIST_COUNT];
|
||||
struct usb_page_cache ls_ctl_start_pc;
|
||||
struct usb_page_cache fs_ctl_start_pc;
|
||||
struct usb_page_cache bulk_start_pc;
|
||||
struct usb_page_cache last_qh_pc;
|
||||
struct usb_page_cache last_td_pc;
|
||||
|
||||
struct usb2_page pframes_pg;
|
||||
struct usb2_page isoc_start_pg[UHCI_VFRAMELIST_COUNT];
|
||||
struct usb2_page intr_start_pg[UHCI_IFRAMELIST_COUNT];
|
||||
struct usb2_page ls_ctl_start_pg;
|
||||
struct usb2_page fs_ctl_start_pg;
|
||||
struct usb2_page bulk_start_pg;
|
||||
struct usb2_page last_qh_pg;
|
||||
struct usb2_page last_td_pg;
|
||||
struct usb_page pframes_pg;
|
||||
struct usb_page isoc_start_pg[UHCI_VFRAMELIST_COUNT];
|
||||
struct usb_page intr_start_pg[UHCI_IFRAMELIST_COUNT];
|
||||
struct usb_page ls_ctl_start_pg;
|
||||
struct usb_page fs_ctl_start_pg;
|
||||
struct usb_page bulk_start_pg;
|
||||
struct usb_page last_qh_pg;
|
||||
struct usb_page last_td_pg;
|
||||
};
|
||||
|
||||
typedef struct uhci_softc {
|
||||
struct uhci_hw_softc sc_hw;
|
||||
struct usb2_bus sc_bus; /* base device */
|
||||
struct usb_bus sc_bus; /* base device */
|
||||
union uhci_hub_desc sc_hub_desc;
|
||||
struct usb2_callout sc_root_intr;
|
||||
struct usb_callout sc_root_intr;
|
||||
|
||||
struct usb2_device *sc_devices[UHCI_MAX_DEVICES];
|
||||
struct usb_device *sc_devices[UHCI_MAX_DEVICES];
|
||||
/* pointer to last TD for isochronous */
|
||||
struct uhci_td *sc_isoc_p_last[UHCI_VFRAMELIST_COUNT];
|
||||
/* pointer to last QH for interrupt */
|
||||
|
@ -47,7 +47,7 @@ static device_probe_t usb2_probe;
|
||||
static device_attach_t usb2_attach;
|
||||
static device_detach_t usb2_detach;
|
||||
|
||||
static void usb2_attach_sub(device_t, struct usb2_bus *);
|
||||
static void usb2_attach_sub(device_t, struct usb_bus *);
|
||||
static void usb2_post_init(void *);
|
||||
|
||||
/* static variables */
|
||||
@ -104,7 +104,7 @@ usb2_probe(device_t dev)
|
||||
static int
|
||||
usb2_attach(device_t dev)
|
||||
{
|
||||
struct usb2_bus *bus = device_get_ivars(dev);
|
||||
struct usb_bus *bus = device_get_ivars(dev);
|
||||
|
||||
DPRINTF("\n");
|
||||
|
||||
@ -131,7 +131,7 @@ usb2_attach(device_t dev)
|
||||
static int
|
||||
usb2_detach(device_t dev)
|
||||
{
|
||||
struct usb2_bus *bus = device_get_softc(dev);
|
||||
struct usb_bus *bus = device_get_softc(dev);
|
||||
|
||||
DPRINTF("\n");
|
||||
|
||||
@ -182,12 +182,12 @@ usb2_detach(device_t dev)
|
||||
* This function is used to explore the device tree from the root.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_bus_explore(struct usb2_proc_msg *pm)
|
||||
usb2_bus_explore(struct usb_proc_msg *pm)
|
||||
{
|
||||
struct usb2_bus *bus;
|
||||
struct usb2_device *udev;
|
||||
struct usb_bus *bus;
|
||||
struct usb_device *udev;
|
||||
|
||||
bus = ((struct usb2_bus_msg *)pm)->bus;
|
||||
bus = ((struct usb_bus_msg *)pm)->bus;
|
||||
udev = bus->devices[USB_ROOT_HUB_ADDR];
|
||||
|
||||
if (udev && udev->hub) {
|
||||
@ -230,13 +230,13 @@ usb2_bus_explore(struct usb2_proc_msg *pm)
|
||||
* This function is used to detach the device tree from the root.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_bus_detach(struct usb2_proc_msg *pm)
|
||||
usb2_bus_detach(struct usb_proc_msg *pm)
|
||||
{
|
||||
struct usb2_bus *bus;
|
||||
struct usb2_device *udev;
|
||||
struct usb_bus *bus;
|
||||
struct usb_device *udev;
|
||||
device_t dev;
|
||||
|
||||
bus = ((struct usb2_bus_msg *)pm)->bus;
|
||||
bus = ((struct usb_bus_msg *)pm)->bus;
|
||||
udev = bus->devices[USB_ROOT_HUB_ADDR];
|
||||
dev = bus->bdev;
|
||||
/* clear the softc */
|
||||
@ -264,7 +264,7 @@ usb2_bus_detach(struct usb2_proc_msg *pm)
|
||||
static void
|
||||
usb2_power_wdog(void *arg)
|
||||
{
|
||||
struct usb2_bus *bus = arg;
|
||||
struct usb_bus *bus = arg;
|
||||
|
||||
USB_BUS_LOCK_ASSERT(bus, MA_OWNED);
|
||||
|
||||
@ -284,15 +284,15 @@ usb2_power_wdog(void *arg)
|
||||
* This function attaches USB in context of the explore thread.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_bus_attach(struct usb2_proc_msg *pm)
|
||||
usb2_bus_attach(struct usb_proc_msg *pm)
|
||||
{
|
||||
struct usb2_bus *bus;
|
||||
struct usb2_device *child;
|
||||
struct usb_bus *bus;
|
||||
struct usb_device *child;
|
||||
device_t dev;
|
||||
usb2_error_t err;
|
||||
enum usb_dev_speed speed;
|
||||
|
||||
bus = ((struct usb2_bus_msg *)pm)->bus;
|
||||
bus = ((struct usb_bus_msg *)pm)->bus;
|
||||
dev = bus->bdev;
|
||||
|
||||
DPRINTF("\n");
|
||||
@ -382,7 +382,7 @@ usb2_bus_attach(struct usb2_proc_msg *pm)
|
||||
* "usb2_attach()" method.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_attach_sub(device_t dev, struct usb2_bus *bus)
|
||||
usb2_attach_sub(device_t dev, struct usb_bus *bus)
|
||||
{
|
||||
const char *pname = device_get_nameunit(dev);
|
||||
|
||||
@ -440,7 +440,7 @@ usb2_attach_sub(device_t dev, struct usb2_bus *bus)
|
||||
static void
|
||||
usb2_post_init(void *arg)
|
||||
{
|
||||
struct usb2_bus *bus;
|
||||
struct usb_bus *bus;
|
||||
devclass_t dc;
|
||||
device_t dev;
|
||||
int max;
|
||||
@ -484,8 +484,8 @@ SYSUNINIT(usb2_bus_unload, SI_SUB_KLD, SI_ORDER_ANY, usb2_bus_unload, NULL);
|
||||
*------------------------------------------------------------------------*/
|
||||
#if USB_HAVE_BUSDMA
|
||||
static void
|
||||
usb2_bus_mem_flush_all_cb(struct usb2_bus *bus, struct usb2_page_cache *pc,
|
||||
struct usb2_page *pg, uint32_t size, uint32_t align)
|
||||
usb2_bus_mem_flush_all_cb(struct usb_bus *bus, struct usb_page_cache *pc,
|
||||
struct usb_page *pg, uint32_t size, uint32_t align)
|
||||
{
|
||||
usb2_pc_cpu_flush(pc);
|
||||
}
|
||||
@ -496,7 +496,7 @@ usb2_bus_mem_flush_all_cb(struct usb2_bus *bus, struct usb2_page_cache *pc,
|
||||
*------------------------------------------------------------------------*/
|
||||
#if USB_HAVE_BUSDMA
|
||||
void
|
||||
usb2_bus_mem_flush_all(struct usb2_bus *bus, usb2_bus_mem_cb_t *cb)
|
||||
usb2_bus_mem_flush_all(struct usb_bus *bus, usb2_bus_mem_cb_t *cb)
|
||||
{
|
||||
if (cb) {
|
||||
cb(bus, &usb2_bus_mem_flush_all_cb);
|
||||
@ -509,8 +509,8 @@ usb2_bus_mem_flush_all(struct usb2_bus *bus, usb2_bus_mem_cb_t *cb)
|
||||
*------------------------------------------------------------------------*/
|
||||
#if USB_HAVE_BUSDMA
|
||||
static void
|
||||
usb2_bus_mem_alloc_all_cb(struct usb2_bus *bus, struct usb2_page_cache *pc,
|
||||
struct usb2_page *pg, uint32_t size, uint32_t align)
|
||||
usb2_bus_mem_alloc_all_cb(struct usb_bus *bus, struct usb_page_cache *pc,
|
||||
struct usb_page *pg, uint32_t size, uint32_t align)
|
||||
{
|
||||
/* need to initialize the page cache */
|
||||
pc->tag_parent = bus->dma_parent_tag;
|
||||
@ -529,7 +529,7 @@ usb2_bus_mem_alloc_all_cb(struct usb2_bus *bus, struct usb2_page_cache *pc,
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
uint8_t
|
||||
usb2_bus_mem_alloc_all(struct usb2_bus *bus, bus_dma_tag_t dmat,
|
||||
usb2_bus_mem_alloc_all(struct usb_bus *bus, bus_dma_tag_t dmat,
|
||||
usb2_bus_mem_cb_t *cb)
|
||||
{
|
||||
bus->alloc_failed = 0;
|
||||
@ -569,8 +569,8 @@ usb2_bus_mem_alloc_all(struct usb2_bus *bus, bus_dma_tag_t dmat,
|
||||
*------------------------------------------------------------------------*/
|
||||
#if USB_HAVE_BUSDMA
|
||||
static void
|
||||
usb2_bus_mem_free_all_cb(struct usb2_bus *bus, struct usb2_page_cache *pc,
|
||||
struct usb2_page *pg, uint32_t size, uint32_t align)
|
||||
usb2_bus_mem_free_all_cb(struct usb_bus *bus, struct usb_page_cache *pc,
|
||||
struct usb_page *pg, uint32_t size, uint32_t align)
|
||||
{
|
||||
usb2_pc_free_mem(pc);
|
||||
}
|
||||
@ -580,7 +580,7 @@ usb2_bus_mem_free_all_cb(struct usb2_bus *bus, struct usb2_page_cache *pc,
|
||||
* usb2_bus_mem_free_all - factored out code
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_bus_mem_free_all(struct usb2_bus *bus, usb2_bus_mem_cb_t *cb)
|
||||
usb2_bus_mem_free_all(struct usb_bus *bus, usb2_bus_mem_cb_t *cb)
|
||||
{
|
||||
#if USB_HAVE_BUSDMA
|
||||
if (cb) {
|
||||
|
@ -71,20 +71,20 @@ SYSCTL_INT(_hw_usb_uss820dci, OID_AUTO, debug, CTLFLAG_RW,
|
||||
|
||||
/* prototypes */
|
||||
|
||||
struct usb2_bus_methods uss820dci_bus_methods;
|
||||
struct usb2_pipe_methods uss820dci_device_bulk_methods;
|
||||
struct usb2_pipe_methods uss820dci_device_ctrl_methods;
|
||||
struct usb2_pipe_methods uss820dci_device_intr_methods;
|
||||
struct usb2_pipe_methods uss820dci_device_isoc_fs_methods;
|
||||
struct usb_bus_methods uss820dci_bus_methods;
|
||||
struct usb_pipe_methods uss820dci_device_bulk_methods;
|
||||
struct usb_pipe_methods uss820dci_device_ctrl_methods;
|
||||
struct usb_pipe_methods uss820dci_device_intr_methods;
|
||||
struct usb_pipe_methods uss820dci_device_isoc_fs_methods;
|
||||
|
||||
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 usb2_xfer *, usb2_error_t);
|
||||
static void uss820dci_do_poll(struct usb2_bus *);
|
||||
static void uss820dci_standard_done(struct usb2_xfer *);
|
||||
static void uss820dci_intr_set(struct usb2_xfer *, uint8_t);
|
||||
static void uss820dci_device_done(struct usb_xfer *, usb2_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);
|
||||
static void uss820dci_update_shared_1(struct uss820dci_softc *, uint8_t,
|
||||
uint8_t, uint8_t);
|
||||
static void uss820dci_root_intr(struct uss820dci_softc *);
|
||||
@ -94,7 +94,7 @@ static void uss820dci_root_intr(struct uss820dci_softc *);
|
||||
* limitation is that the sum of the buffer sizes must be less than
|
||||
* 1120 bytes.
|
||||
*/
|
||||
static const struct usb2_hw_ep_profile
|
||||
static const struct usb_hw_ep_profile
|
||||
uss820dci_ep_profile[] = {
|
||||
|
||||
[0] = {
|
||||
@ -149,8 +149,8 @@ uss820dci_update_shared_1(struct uss820dci_softc *sc, uint8_t reg,
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_get_hw_ep_profile(struct usb2_device *udev,
|
||||
const struct usb2_hw_ep_profile **ppf, uint8_t ep_addr)
|
||||
uss820dci_get_hw_ep_profile(struct usb_device *udev,
|
||||
const struct usb_hw_ep_profile **ppf, uint8_t ep_addr)
|
||||
{
|
||||
if (ep_addr == 0) {
|
||||
*ppf = uss820dci_ep_profile + 0;
|
||||
@ -223,7 +223,7 @@ static uint8_t
|
||||
uss820dci_setup_rx(struct uss820dci_td *td)
|
||||
{
|
||||
struct uss820dci_softc *sc;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint16_t count;
|
||||
uint8_t rx_stat;
|
||||
uint8_t temp;
|
||||
@ -353,7 +353,7 @@ uss820dci_setup_rx(struct uss820dci_td *td)
|
||||
static uint8_t
|
||||
uss820dci_data_rx(struct uss820dci_td *td)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
uint16_t count;
|
||||
uint8_t rx_flag;
|
||||
uint8_t rx_stat;
|
||||
@ -486,7 +486,7 @@ uss820dci_data_rx(struct uss820dci_td *td)
|
||||
static uint8_t
|
||||
uss820dci_data_tx(struct uss820dci_td *td)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
uint16_t count;
|
||||
uint16_t count_copy;
|
||||
uint8_t rx_stat;
|
||||
@ -640,7 +640,7 @@ uss820dci_data_tx_sync(struct uss820dci_td *td)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
uss820dci_xfer_do_fifo(struct usb2_xfer *xfer)
|
||||
uss820dci_xfer_do_fifo(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uss820dci_td *td;
|
||||
|
||||
@ -685,7 +685,7 @@ uss820dci_xfer_do_fifo(struct usb2_xfer *xfer)
|
||||
static void
|
||||
uss820dci_interrupt_poll(struct uss820dci_softc *sc)
|
||||
{
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
|
||||
repeat:
|
||||
TAILQ_FOREACH(xfer, &sc->sc_bus.intr_q.head, wait_entry) {
|
||||
@ -820,7 +820,7 @@ uss820dci_setup_standard_chain_sub(struct uss820_std_temp *temp)
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_setup_standard_chain(struct usb2_xfer *xfer)
|
||||
uss820dci_setup_standard_chain(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uss820_std_temp temp;
|
||||
struct uss820dci_softc *sc;
|
||||
@ -965,7 +965,7 @@ uss820dci_setup_standard_chain(struct usb2_xfer *xfer)
|
||||
static void
|
||||
uss820dci_timeout(void *arg)
|
||||
{
|
||||
struct usb2_xfer *xfer = arg;
|
||||
struct usb_xfer *xfer = arg;
|
||||
|
||||
DPRINTF("xfer=%p\n", xfer);
|
||||
|
||||
@ -976,7 +976,7 @@ uss820dci_timeout(void *arg)
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_intr_set(struct usb2_xfer *xfer, uint8_t set)
|
||||
uss820dci_intr_set(struct usb_xfer *xfer, uint8_t set)
|
||||
{
|
||||
struct uss820dci_softc *sc = USS820_DCI_BUS2SC(xfer->xroot->bus);
|
||||
uint8_t ep_no = (xfer->endpoint & UE_ADDR);
|
||||
@ -1015,7 +1015,7 @@ uss820dci_intr_set(struct usb2_xfer *xfer, uint8_t set)
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_start_standard_chain(struct usb2_xfer *xfer)
|
||||
uss820dci_start_standard_chain(struct usb_xfer *xfer)
|
||||
{
|
||||
DPRINTFN(9, "\n");
|
||||
|
||||
@ -1055,7 +1055,7 @@ uss820dci_root_intr(struct uss820dci_softc *sc)
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
uss820dci_standard_done_sub(struct usb2_xfer *xfer)
|
||||
uss820dci_standard_done_sub(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uss820dci_td *td;
|
||||
uint32_t len;
|
||||
@ -1119,7 +1119,7 @@ uss820dci_standard_done_sub(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_standard_done(struct usb2_xfer *xfer)
|
||||
uss820dci_standard_done(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
|
||||
@ -1168,7 +1168,7 @@ uss820dci_standard_done(struct usb2_xfer *xfer)
|
||||
* same USB transfer!
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
uss820dci_device_done(struct usb2_xfer *xfer, usb2_error_t error)
|
||||
uss820dci_device_done(struct usb_xfer *xfer, usb2_error_t error)
|
||||
{
|
||||
USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED);
|
||||
|
||||
@ -1183,8 +1183,8 @@ uss820dci_device_done(struct usb2_xfer *xfer, usb2_error_t error)
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_set_stall(struct usb2_device *udev, struct usb2_xfer *xfer,
|
||||
struct usb2_pipe *pipe)
|
||||
uss820dci_set_stall(struct usb_device *udev, struct usb_xfer *xfer,
|
||||
struct usb_pipe *pipe)
|
||||
{
|
||||
struct uss820dci_softc *sc;
|
||||
uint8_t ep_no;
|
||||
@ -1271,10 +1271,10 @@ uss820dci_clear_stall_sub(struct uss820dci_softc *sc,
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_clear_stall(struct usb2_device *udev, struct usb2_pipe *pipe)
|
||||
uss820dci_clear_stall(struct usb_device *udev, struct usb_pipe *pipe)
|
||||
{
|
||||
struct uss820dci_softc *sc;
|
||||
struct usb2_endpoint_descriptor *ed;
|
||||
struct usb_endpoint_descriptor *ed;
|
||||
|
||||
USB_BUS_LOCK_ASSERT(udev->bus, MA_OWNED);
|
||||
|
||||
@ -1301,7 +1301,7 @@ uss820dci_clear_stall(struct usb2_device *udev, struct usb2_pipe *pipe)
|
||||
usb2_error_t
|
||||
uss820dci_init(struct uss820dci_softc *sc)
|
||||
{
|
||||
const struct usb2_hw_ep_profile *pf;
|
||||
const struct usb_hw_ep_profile *pf;
|
||||
uint8_t n;
|
||||
uint8_t temp;
|
||||
|
||||
@ -1499,7 +1499,7 @@ uss820dci_resume(struct uss820dci_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_do_poll(struct usb2_bus *bus)
|
||||
uss820dci_do_poll(struct usb_bus *bus)
|
||||
{
|
||||
struct uss820dci_softc *sc = USS820_DCI_BUS2SC(bus);
|
||||
|
||||
@ -1512,32 +1512,32 @@ uss820dci_do_poll(struct usb2_bus *bus)
|
||||
* at91dci bulk support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
uss820dci_device_bulk_open(struct usb2_xfer *xfer)
|
||||
uss820dci_device_bulk_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_device_bulk_close(struct usb2_xfer *xfer)
|
||||
uss820dci_device_bulk_close(struct usb_xfer *xfer)
|
||||
{
|
||||
uss820dci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_device_bulk_enter(struct usb2_xfer *xfer)
|
||||
uss820dci_device_bulk_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_device_bulk_start(struct usb2_xfer *xfer)
|
||||
uss820dci_device_bulk_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* setup TDs */
|
||||
uss820dci_setup_standard_chain(xfer);
|
||||
uss820dci_start_standard_chain(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods uss820dci_device_bulk_methods =
|
||||
struct usb_pipe_methods uss820dci_device_bulk_methods =
|
||||
{
|
||||
.open = uss820dci_device_bulk_open,
|
||||
.close = uss820dci_device_bulk_close,
|
||||
@ -1549,32 +1549,32 @@ struct usb2_pipe_methods uss820dci_device_bulk_methods =
|
||||
* at91dci control support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
uss820dci_device_ctrl_open(struct usb2_xfer *xfer)
|
||||
uss820dci_device_ctrl_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_device_ctrl_close(struct usb2_xfer *xfer)
|
||||
uss820dci_device_ctrl_close(struct usb_xfer *xfer)
|
||||
{
|
||||
uss820dci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_device_ctrl_enter(struct usb2_xfer *xfer)
|
||||
uss820dci_device_ctrl_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_device_ctrl_start(struct usb2_xfer *xfer)
|
||||
uss820dci_device_ctrl_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* setup TDs */
|
||||
uss820dci_setup_standard_chain(xfer);
|
||||
uss820dci_start_standard_chain(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods uss820dci_device_ctrl_methods =
|
||||
struct usb_pipe_methods uss820dci_device_ctrl_methods =
|
||||
{
|
||||
.open = uss820dci_device_ctrl_open,
|
||||
.close = uss820dci_device_ctrl_close,
|
||||
@ -1586,32 +1586,32 @@ struct usb2_pipe_methods uss820dci_device_ctrl_methods =
|
||||
* at91dci interrupt support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
uss820dci_device_intr_open(struct usb2_xfer *xfer)
|
||||
uss820dci_device_intr_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_device_intr_close(struct usb2_xfer *xfer)
|
||||
uss820dci_device_intr_close(struct usb_xfer *xfer)
|
||||
{
|
||||
uss820dci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_device_intr_enter(struct usb2_xfer *xfer)
|
||||
uss820dci_device_intr_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_device_intr_start(struct usb2_xfer *xfer)
|
||||
uss820dci_device_intr_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* setup TDs */
|
||||
uss820dci_setup_standard_chain(xfer);
|
||||
uss820dci_start_standard_chain(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods uss820dci_device_intr_methods =
|
||||
struct usb_pipe_methods uss820dci_device_intr_methods =
|
||||
{
|
||||
.open = uss820dci_device_intr_open,
|
||||
.close = uss820dci_device_intr_close,
|
||||
@ -1623,19 +1623,19 @@ struct usb2_pipe_methods uss820dci_device_intr_methods =
|
||||
* at91dci full speed isochronous support
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
uss820dci_device_isoc_fs_open(struct usb2_xfer *xfer)
|
||||
uss820dci_device_isoc_fs_open(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_device_isoc_fs_close(struct usb2_xfer *xfer)
|
||||
uss820dci_device_isoc_fs_close(struct usb_xfer *xfer)
|
||||
{
|
||||
uss820dci_device_done(xfer, USB_ERR_CANCELLED);
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_device_isoc_fs_enter(struct usb2_xfer *xfer)
|
||||
uss820dci_device_isoc_fs_enter(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uss820dci_softc *sc = USS820_DCI_BUS2SC(xfer->xroot->bus);
|
||||
uint32_t temp;
|
||||
@ -1687,13 +1687,13 @@ uss820dci_device_isoc_fs_enter(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_device_isoc_fs_start(struct usb2_xfer *xfer)
|
||||
uss820dci_device_isoc_fs_start(struct usb_xfer *xfer)
|
||||
{
|
||||
/* start TD chain */
|
||||
uss820dci_start_standard_chain(xfer);
|
||||
}
|
||||
|
||||
struct usb2_pipe_methods uss820dci_device_isoc_fs_methods =
|
||||
struct usb_pipe_methods uss820dci_device_isoc_fs_methods =
|
||||
{
|
||||
.open = uss820dci_device_isoc_fs_open,
|
||||
.close = uss820dci_device_isoc_fs_close,
|
||||
@ -1707,8 +1707,8 @@ struct usb2_pipe_methods uss820dci_device_isoc_fs_methods =
|
||||
* Simulate a hardware HUB by handling all the necessary requests.
|
||||
*------------------------------------------------------------------------*/
|
||||
|
||||
static const struct usb2_device_descriptor uss820dci_devd = {
|
||||
.bLength = sizeof(struct usb2_device_descriptor),
|
||||
static const struct usb_device_descriptor uss820dci_devd = {
|
||||
.bLength = sizeof(struct usb_device_descriptor),
|
||||
.bDescriptorType = UDESC_DEVICE,
|
||||
.bcdUSB = {0x00, 0x02},
|
||||
.bDeviceClass = UDCLASS_HUB,
|
||||
@ -1721,8 +1721,8 @@ static const struct usb2_device_descriptor uss820dci_devd = {
|
||||
.bNumConfigurations = 1,
|
||||
};
|
||||
|
||||
static const struct usb2_device_qualifier uss820dci_odevd = {
|
||||
.bLength = sizeof(struct usb2_device_qualifier),
|
||||
static const struct usb_device_qualifier uss820dci_odevd = {
|
||||
.bLength = sizeof(struct usb_device_qualifier),
|
||||
.bDescriptorType = UDESC_DEVICE_QUALIFIER,
|
||||
.bcdUSB = {0x00, 0x02},
|
||||
.bDeviceClass = UDCLASS_HUB,
|
||||
@ -1734,7 +1734,7 @@ static const struct usb2_device_qualifier uss820dci_odevd = {
|
||||
|
||||
static const struct uss820dci_config_desc uss820dci_confd = {
|
||||
.confd = {
|
||||
.bLength = sizeof(struct usb2_config_descriptor),
|
||||
.bLength = sizeof(struct usb_config_descriptor),
|
||||
.bDescriptorType = UDESC_CONFIG,
|
||||
.wTotalLength[0] = sizeof(uss820dci_confd),
|
||||
.bNumInterface = 1,
|
||||
@ -1744,7 +1744,7 @@ static const struct uss820dci_config_desc uss820dci_confd = {
|
||||
.bMaxPower = 0,
|
||||
},
|
||||
.ifcd = {
|
||||
.bLength = sizeof(struct usb2_interface_descriptor),
|
||||
.bLength = sizeof(struct usb_interface_descriptor),
|
||||
.bDescriptorType = UDESC_INTERFACE,
|
||||
.bNumEndpoints = 1,
|
||||
.bInterfaceClass = UICLASS_HUB,
|
||||
@ -1753,7 +1753,7 @@ static const struct uss820dci_config_desc uss820dci_confd = {
|
||||
},
|
||||
|
||||
.endpd = {
|
||||
.bLength = sizeof(struct usb2_endpoint_descriptor),
|
||||
.bLength = sizeof(struct usb_endpoint_descriptor),
|
||||
.bDescriptorType = UDESC_ENDPOINT,
|
||||
.bEndpointAddress = (UE_DIR_IN | USS820_DCI_INTR_ENDPT),
|
||||
.bmAttributes = UE_INTERRUPT,
|
||||
@ -1762,7 +1762,7 @@ static const struct uss820dci_config_desc uss820dci_confd = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_hub_descriptor_min uss820dci_hubd = {
|
||||
static const struct usb_hub_descriptor_min uss820dci_hubd = {
|
||||
.bDescLength = sizeof(uss820dci_hubd),
|
||||
.bDescriptorType = UDESC_HUB,
|
||||
.bNbrPorts = 1,
|
||||
@ -1791,8 +1791,8 @@ USB_MAKE_STRING_DESC(STRING_VENDOR, uss820dci_vendor);
|
||||
USB_MAKE_STRING_DESC(STRING_PRODUCT, uss820dci_product);
|
||||
|
||||
static usb2_error_t
|
||||
uss820dci_roothub_exec(struct usb2_device *udev,
|
||||
struct usb2_device_request *req, const void **pptr, uint16_t *plength)
|
||||
uss820dci_roothub_exec(struct usb_device *udev,
|
||||
struct usb_device_request *req, const void **pptr, uint16_t *plength)
|
||||
{
|
||||
struct uss820dci_softc *sc = USS820_DCI_BUS2SC(udev->bus);
|
||||
const void *ptr;
|
||||
@ -2179,11 +2179,11 @@ uss820dci_roothub_exec(struct usb2_device *udev,
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_xfer_setup(struct usb2_setup_params *parm)
|
||||
uss820dci_xfer_setup(struct usb_setup_params *parm)
|
||||
{
|
||||
const struct usb2_hw_ep_profile *pf;
|
||||
const struct usb_hw_ep_profile *pf;
|
||||
struct uss820dci_softc *sc;
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
void *last_obj;
|
||||
uint32_t ntd;
|
||||
uint32_t n;
|
||||
@ -2287,14 +2287,14 @@ uss820dci_xfer_setup(struct usb2_setup_params *parm)
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_xfer_unsetup(struct usb2_xfer *xfer)
|
||||
uss820dci_xfer_unsetup(struct usb_xfer *xfer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
uss820dci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *edesc,
|
||||
struct usb2_pipe *pipe)
|
||||
uss820dci_pipe_init(struct usb_device *udev, struct usb_endpoint_descriptor *edesc,
|
||||
struct usb_pipe *pipe)
|
||||
{
|
||||
struct uss820dci_softc *sc = USS820_DCI_BUS2SC(udev->bus);
|
||||
|
||||
@ -2333,7 +2333,7 @@ uss820dci_pipe_init(struct usb2_device *udev, struct usb2_endpoint_descriptor *e
|
||||
}
|
||||
}
|
||||
|
||||
struct usb2_bus_methods uss820dci_bus_methods =
|
||||
struct usb_bus_methods uss820dci_bus_methods =
|
||||
{
|
||||
.pipe_init = &uss820dci_pipe_init,
|
||||
.xfer_setup = &uss820dci_xfer_setup,
|
||||
|
@ -270,7 +270,7 @@ struct uss820dci_td {
|
||||
bus_space_handle_t io_hdl;
|
||||
struct uss820dci_td *obj_next;
|
||||
uss820dci_cmd_t *func;
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_cache *pc;
|
||||
uint32_t offset;
|
||||
uint32_t remainder;
|
||||
uint16_t max_packet_size;
|
||||
@ -285,7 +285,7 @@ struct uss820dci_td {
|
||||
|
||||
struct uss820_std_temp {
|
||||
uss820dci_cmd_t *func;
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_cache *pc;
|
||||
struct uss820dci_td *td;
|
||||
struct uss820dci_td *td_next;
|
||||
uint32_t len;
|
||||
@ -301,14 +301,14 @@ struct uss820_std_temp {
|
||||
};
|
||||
|
||||
struct uss820dci_config_desc {
|
||||
struct usb2_config_descriptor confd;
|
||||
struct usb2_interface_descriptor ifcd;
|
||||
struct usb2_endpoint_descriptor endpd;
|
||||
struct usb_config_descriptor confd;
|
||||
struct usb_interface_descriptor ifcd;
|
||||
struct usb_endpoint_descriptor endpd;
|
||||
} __packed;
|
||||
|
||||
union uss820_hub_temp {
|
||||
uWord wValue;
|
||||
struct usb2_port_status ps;
|
||||
struct usb_port_status ps;
|
||||
};
|
||||
|
||||
struct uss820_flags {
|
||||
@ -325,10 +325,10 @@ struct uss820_flags {
|
||||
};
|
||||
|
||||
struct uss820dci_softc {
|
||||
struct usb2_bus sc_bus;
|
||||
struct usb_bus sc_bus;
|
||||
union uss820_hub_temp sc_hub_temp;
|
||||
|
||||
struct usb2_device *sc_devices[USS820_MAX_DEVICES];
|
||||
struct usb_device *sc_devices[USS820_MAX_DEVICES];
|
||||
struct resource *sc_io_res;
|
||||
struct resource *sc_irq_res;
|
||||
void *sc_intr_hdl;
|
||||
|
@ -92,11 +92,11 @@ enum {
|
||||
};
|
||||
|
||||
struct uhid_softc {
|
||||
struct usb2_fifo_sc sc_fifo;
|
||||
struct usb_fifo_sc sc_fifo;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
struct usb2_xfer *sc_xfer[UHID_N_TRANSFER];
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[UHID_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
void *sc_repdesc_ptr;
|
||||
|
||||
uint32_t sc_isize;
|
||||
@ -138,7 +138,7 @@ static usb2_fifo_open_t uhid_open;
|
||||
static usb2_fifo_close_t uhid_close;
|
||||
static usb2_fifo_ioctl_t uhid_ioctl;
|
||||
|
||||
static struct usb2_fifo_methods uhid_fifo_methods = {
|
||||
static struct usb_fifo_methods uhid_fifo_methods = {
|
||||
.f_open = &uhid_open,
|
||||
.f_close = &uhid_close,
|
||||
.f_ioctl = &uhid_ioctl,
|
||||
@ -150,7 +150,7 @@ static struct usb2_fifo_methods uhid_fifo_methods = {
|
||||
};
|
||||
|
||||
static void
|
||||
uhid_intr_callback(struct usb2_xfer *xfer)
|
||||
uhid_intr_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uhid_softc *sc = xfer->priv_sc;
|
||||
|
||||
@ -189,7 +189,7 @@ uhid_intr_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uhid_fill_set_report(struct usb2_device_request *req, uint8_t iface_no,
|
||||
uhid_fill_set_report(struct usb_device_request *req, uint8_t iface_no,
|
||||
uint8_t type, uint8_t id, uint16_t size)
|
||||
{
|
||||
req->bmRequestType = UT_WRITE_CLASS_INTERFACE;
|
||||
@ -201,7 +201,7 @@ uhid_fill_set_report(struct usb2_device_request *req, uint8_t iface_no,
|
||||
}
|
||||
|
||||
static void
|
||||
uhid_fill_get_report(struct usb2_device_request *req, uint8_t iface_no,
|
||||
uhid_fill_get_report(struct usb_device_request *req, uint8_t iface_no,
|
||||
uint8_t type, uint8_t id, uint16_t size)
|
||||
{
|
||||
req->bmRequestType = UT_READ_CLASS_INTERFACE;
|
||||
@ -213,10 +213,10 @@ uhid_fill_get_report(struct usb2_device_request *req, uint8_t iface_no,
|
||||
}
|
||||
|
||||
static void
|
||||
uhid_write_callback(struct usb2_xfer *xfer)
|
||||
uhid_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uhid_softc *sc = xfer->priv_sc;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint32_t size = sc->sc_osize;
|
||||
uint32_t actlen;
|
||||
uint8_t id;
|
||||
@ -275,10 +275,10 @@ uhid_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uhid_read_callback(struct usb2_xfer *xfer)
|
||||
uhid_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uhid_softc *sc = xfer->priv_sc;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
case USB_ST_TRANSFERRED:
|
||||
@ -310,7 +310,7 @@ uhid_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
}
|
||||
|
||||
static const struct usb2_config uhid_config[UHID_N_TRANSFER] = {
|
||||
static const struct usb_config uhid_config[UHID_N_TRANSFER] = {
|
||||
|
||||
[UHID_INTR_DT_RD] = {
|
||||
.type = UE_INTERRUPT,
|
||||
@ -325,7 +325,7 @@ static const struct usb2_config uhid_config[UHID_N_TRANSFER] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request) + UHID_BSIZE,
|
||||
.bufsize = sizeof(struct usb_device_request) + UHID_BSIZE,
|
||||
.callback = &uhid_write_callback,
|
||||
.timeout = 1000, /* 1 second */
|
||||
},
|
||||
@ -334,14 +334,14 @@ static const struct usb2_config uhid_config[UHID_N_TRANSFER] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request) + UHID_BSIZE,
|
||||
.bufsize = sizeof(struct usb_device_request) + UHID_BSIZE,
|
||||
.callback = &uhid_read_callback,
|
||||
.timeout = 1000, /* 1 second */
|
||||
},
|
||||
};
|
||||
|
||||
static void
|
||||
uhid_start_read(struct usb2_fifo *fifo)
|
||||
uhid_start_read(struct usb_fifo *fifo)
|
||||
{
|
||||
struct uhid_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -353,7 +353,7 @@ uhid_start_read(struct usb2_fifo *fifo)
|
||||
}
|
||||
|
||||
static void
|
||||
uhid_stop_read(struct usb2_fifo *fifo)
|
||||
uhid_stop_read(struct usb_fifo *fifo)
|
||||
{
|
||||
struct uhid_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -362,7 +362,7 @@ uhid_stop_read(struct usb2_fifo *fifo)
|
||||
}
|
||||
|
||||
static void
|
||||
uhid_start_write(struct usb2_fifo *fifo)
|
||||
uhid_start_write(struct usb_fifo *fifo)
|
||||
{
|
||||
struct uhid_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -370,7 +370,7 @@ uhid_start_write(struct usb2_fifo *fifo)
|
||||
}
|
||||
|
||||
static void
|
||||
uhid_stop_write(struct usb2_fifo *fifo)
|
||||
uhid_stop_write(struct usb_fifo *fifo)
|
||||
{
|
||||
struct uhid_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -447,7 +447,7 @@ uhid_set_report(struct uhid_softc *sc, uint8_t type,
|
||||
}
|
||||
|
||||
static int
|
||||
uhid_open(struct usb2_fifo *fifo, int fflags)
|
||||
uhid_open(struct usb_fifo *fifo, int fflags)
|
||||
{
|
||||
struct uhid_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -474,7 +474,7 @@ uhid_open(struct usb2_fifo *fifo, int fflags)
|
||||
}
|
||||
|
||||
static void
|
||||
uhid_close(struct usb2_fifo *fifo, int fflags)
|
||||
uhid_close(struct usb_fifo *fifo, int fflags)
|
||||
{
|
||||
if (fflags & (FREAD | FWRITE)) {
|
||||
usb2_fifo_free_buffer(fifo);
|
||||
@ -482,11 +482,11 @@ uhid_close(struct usb2_fifo *fifo, int fflags)
|
||||
}
|
||||
|
||||
static int
|
||||
uhid_ioctl(struct usb2_fifo *fifo, u_long cmd, void *addr,
|
||||
uhid_ioctl(struct usb_fifo *fifo, u_long cmd, void *addr,
|
||||
int fflags)
|
||||
{
|
||||
struct uhid_softc *sc = fifo->priv_sc0;
|
||||
struct usb2_gen_descriptor *ugd;
|
||||
struct usb_gen_descriptor *ugd;
|
||||
uint32_t size;
|
||||
int error = 0;
|
||||
uint8_t id;
|
||||
@ -595,7 +595,7 @@ uhid_ioctl(struct usb2_fifo *fifo, u_long cmd, void *addr,
|
||||
static int
|
||||
uhid_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
DPRINTFN(11, "\n");
|
||||
|
||||
@ -625,7 +625,7 @@ uhid_probe(device_t dev)
|
||||
static int
|
||||
uhid_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct uhid_softc *sc = device_get_softc(dev);
|
||||
int unit = device_get_unit(dev);
|
||||
int error = 0;
|
||||
|
@ -129,13 +129,13 @@ struct ukbd_softc {
|
||||
fkeytab_t sc_fkeymap[UKBD_NFKEY];
|
||||
struct hid_location sc_loc_apple_eject;
|
||||
struct hid_location sc_loc_apple_fn;
|
||||
struct usb2_callout sc_callout;
|
||||
struct usb_callout sc_callout;
|
||||
struct ukbd_data sc_ndata;
|
||||
struct ukbd_data sc_odata;
|
||||
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb2_interface *sc_iface;
|
||||
struct usb2_xfer *sc_xfer[UKBD_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct usb_interface *sc_iface;
|
||||
struct usb_xfer *sc_xfer[UKBD_N_TRANSFER];
|
||||
|
||||
uint32_t sc_ntime[UKBD_NKEYCODE];
|
||||
uint32_t sc_otime[UKBD_NKEYCODE];
|
||||
@ -480,7 +480,7 @@ ukbd_apple_swap(uint8_t keycode) {
|
||||
}
|
||||
|
||||
static void
|
||||
ukbd_intr_callback(struct usb2_xfer *xfer)
|
||||
ukbd_intr_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ukbd_softc *sc = xfer->priv_sc;
|
||||
uint16_t len = xfer->actlen;
|
||||
@ -587,9 +587,9 @@ ukbd_intr_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ukbd_set_leds_callback(struct usb2_xfer *xfer)
|
||||
ukbd_set_leds_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint8_t buf[2];
|
||||
struct ukbd_softc *sc = xfer->priv_sc;
|
||||
|
||||
@ -633,7 +633,7 @@ ukbd_set_leds_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
}
|
||||
|
||||
static const struct usb2_config ukbd_config[UKBD_N_TRANSFER] = {
|
||||
static const struct usb_config ukbd_config[UKBD_N_TRANSFER] = {
|
||||
|
||||
[UKBD_INTR_DT] = {
|
||||
.type = UE_INTERRUPT,
|
||||
@ -648,7 +648,7 @@ static const struct usb2_config ukbd_config[UKBD_N_TRANSFER] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request) + 8,
|
||||
.bufsize = sizeof(struct usb_device_request) + 8,
|
||||
.callback = &ukbd_set_leds_callback,
|
||||
.timeout = 1000, /* 1 second */
|
||||
},
|
||||
@ -658,7 +658,7 @@ static int
|
||||
ukbd_probe(device_t dev)
|
||||
{
|
||||
keyboard_switch_t *sw = kbd_get_switch(UKBD_DRIVER_NAME);
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
DPRINTFN(11, "\n");
|
||||
|
||||
@ -684,7 +684,7 @@ static int
|
||||
ukbd_attach(device_t dev)
|
||||
{
|
||||
struct ukbd_softc *sc = device_get_softc(dev);
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
int32_t unit = device_get_unit(dev);
|
||||
keyboard_t *kbd = &sc->sc_kbd;
|
||||
void *hid_ptr = NULL;
|
||||
|
@ -118,16 +118,16 @@ struct ums_info {
|
||||
};
|
||||
|
||||
struct ums_softc {
|
||||
struct usb2_fifo_sc sc_fifo;
|
||||
struct usb_fifo_sc sc_fifo;
|
||||
struct mtx sc_mtx;
|
||||
struct usb2_callout sc_callout;
|
||||
struct usb_callout sc_callout;
|
||||
struct ums_info sc_info[UMS_INFO_MAX];
|
||||
|
||||
mousehw_t sc_hw;
|
||||
mousemode_t sc_mode;
|
||||
mousestatus_t sc_status;
|
||||
|
||||
struct usb2_xfer *sc_xfer[UMS_N_TRANSFER];
|
||||
struct usb_xfer *sc_xfer[UMS_N_TRANSFER];
|
||||
|
||||
uint8_t sc_buttons;
|
||||
uint8_t sc_iid;
|
||||
@ -150,7 +150,7 @@ static usb2_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);
|
||||
|
||||
static struct usb2_fifo_methods ums_fifo_methods = {
|
||||
static struct usb_fifo_methods ums_fifo_methods = {
|
||||
.f_open = &ums_open,
|
||||
.f_close = &ums_close,
|
||||
.f_ioctl = &ums_ioctl,
|
||||
@ -170,7 +170,7 @@ ums_put_queue_timeout(void *__sc)
|
||||
}
|
||||
|
||||
static void
|
||||
ums_intr_callback(struct usb2_xfer *xfer)
|
||||
ums_intr_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ums_softc *sc = xfer->priv_sc;
|
||||
struct ums_info *info = &sc->sc_info[0];
|
||||
@ -316,7 +316,7 @@ ums_intr_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
}
|
||||
|
||||
static const struct usb2_config ums_config[UMS_N_TRANSFER] = {
|
||||
static const struct usb_config ums_config[UMS_N_TRANSFER] = {
|
||||
|
||||
[UMS_INTR_DT] = {
|
||||
.type = UE_INTERRUPT,
|
||||
@ -331,8 +331,8 @@ static const struct usb2_config ums_config[UMS_N_TRANSFER] = {
|
||||
static int
|
||||
ums_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_interface_descriptor *id;
|
||||
void *d_ptr;
|
||||
int error;
|
||||
uint16_t d_len;
|
||||
@ -467,7 +467,7 @@ ums_hid_parse(struct ums_softc *sc, device_t dev, const uint8_t *buf,
|
||||
static int
|
||||
ums_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct ums_softc *sc = device_get_softc(dev);
|
||||
struct ums_info *info;
|
||||
void *d_ptr = NULL;
|
||||
@ -638,7 +638,7 @@ ums_detach(device_t self)
|
||||
}
|
||||
|
||||
static void
|
||||
ums_start_read(struct usb2_fifo *fifo)
|
||||
ums_start_read(struct usb_fifo *fifo)
|
||||
{
|
||||
struct ums_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -646,7 +646,7 @@ ums_start_read(struct usb2_fifo *fifo)
|
||||
}
|
||||
|
||||
static void
|
||||
ums_stop_read(struct usb2_fifo *fifo)
|
||||
ums_stop_read(struct usb_fifo *fifo)
|
||||
{
|
||||
struct ums_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -713,7 +713,7 @@ ums_reset_buf(struct ums_softc *sc)
|
||||
}
|
||||
|
||||
static int
|
||||
ums_open(struct usb2_fifo *fifo, int fflags)
|
||||
ums_open(struct usb_fifo *fifo, int fflags)
|
||||
{
|
||||
struct ums_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -740,7 +740,7 @@ ums_open(struct usb2_fifo *fifo, int fflags)
|
||||
}
|
||||
|
||||
static void
|
||||
ums_close(struct usb2_fifo *fifo, int fflags)
|
||||
ums_close(struct usb_fifo *fifo, int fflags)
|
||||
{
|
||||
if (fflags & FREAD) {
|
||||
usb2_fifo_free_buffer(fifo);
|
||||
@ -748,7 +748,7 @@ ums_close(struct usb2_fifo *fifo, int fflags)
|
||||
}
|
||||
|
||||
static int
|
||||
ums_ioctl(struct usb2_fifo *fifo, u_long cmd, void *addr, int fflags)
|
||||
ums_ioctl(struct usb_fifo *fifo, u_long cmd, void *addr, int fflags)
|
||||
{
|
||||
struct ums_softc *sc = fifo->priv_sc0;
|
||||
mousemode_t mode;
|
||||
|
@ -105,7 +105,7 @@ struct udbp_softc {
|
||||
struct ng_bt_mbufq sc_xmitq_hipri; /* hi-priority transmit queue */
|
||||
struct ng_bt_mbufq sc_xmitq; /* low-priority transmit queue */
|
||||
|
||||
struct usb2_xfer *sc_xfer[UDBP_T_MAX];
|
||||
struct usb_xfer *sc_xfer[UDBP_T_MAX];
|
||||
node_p sc_node; /* back pointer to node */
|
||||
hook_p sc_hook; /* pointer to the hook */
|
||||
struct mbuf *sc_bulk_in_buffer;
|
||||
@ -186,7 +186,7 @@ static struct ng_type ng_udbp_typestruct = {
|
||||
};
|
||||
|
||||
/* USB config */
|
||||
static const struct usb2_config udbp_config[UDBP_T_MAX] = {
|
||||
static const struct usb_config udbp_config[UDBP_T_MAX] = {
|
||||
|
||||
[UDBP_T_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -211,7 +211,7 @@ static const struct usb2_config udbp_config[UDBP_T_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request),
|
||||
.bufsize = sizeof(struct usb_device_request),
|
||||
.callback = &udbp_bulk_write_clear_stall_callback,
|
||||
.timeout = 1000, /* 1 second */
|
||||
.interval = 50, /* 50ms */
|
||||
@ -221,7 +221,7 @@ static const struct usb2_config udbp_config[UDBP_T_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request),
|
||||
.bufsize = sizeof(struct usb_device_request),
|
||||
.callback = &udbp_bulk_read_clear_stall_callback,
|
||||
.timeout = 1000, /* 1 second */
|
||||
.interval = 50, /* 50ms */
|
||||
@ -277,7 +277,7 @@ udbp_modload(module_t mod, int event, void *data)
|
||||
static int
|
||||
udbp_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
return (ENXIO);
|
||||
@ -313,7 +313,7 @@ udbp_probe(device_t dev)
|
||||
static int
|
||||
udbp_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct udbp_softc *sc = device_get_softc(dev);
|
||||
int error;
|
||||
|
||||
@ -395,7 +395,7 @@ udbp_detach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
udbp_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
udbp_bulk_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct udbp_softc *sc = xfer->priv_sc;
|
||||
struct mbuf *m;
|
||||
@ -451,10 +451,10 @@ udbp_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
udbp_bulk_read_clear_stall_callback(struct usb2_xfer *xfer)
|
||||
udbp_bulk_read_clear_stall_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct udbp_softc *sc = xfer->priv_sc;
|
||||
struct usb2_xfer *xfer_other = sc->sc_xfer[UDBP_T_RD];
|
||||
struct usb_xfer *xfer_other = sc->sc_xfer[UDBP_T_RD];
|
||||
|
||||
if (usb2_clear_stall_callback(xfer, xfer_other)) {
|
||||
DPRINTF("stall cleared\n");
|
||||
@ -504,7 +504,7 @@ udbp_bulk_read_complete(node_p node, hook_p hook, void *arg1, int arg2)
|
||||
}
|
||||
|
||||
static void
|
||||
udbp_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
udbp_bulk_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct udbp_softc *sc = xfer->priv_sc;
|
||||
struct mbuf *m;
|
||||
@ -559,10 +559,10 @@ udbp_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
udbp_bulk_write_clear_stall_callback(struct usb2_xfer *xfer)
|
||||
udbp_bulk_write_clear_stall_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct udbp_softc *sc = xfer->priv_sc;
|
||||
struct usb2_xfer *xfer_other = sc->sc_xfer[UDBP_T_WR];
|
||||
struct usb_xfer *xfer_other = sc->sc_xfer[UDBP_T_WR];
|
||||
|
||||
if (usb2_clear_stall_callback(xfer, xfer_other)) {
|
||||
DPRINTF("stall cleared\n");
|
||||
|
@ -55,10 +55,10 @@ __FBSDID("$FreeBSD$");
|
||||
#define UFM_CMD2 0x02
|
||||
|
||||
struct ufm_softc {
|
||||
struct usb2_fifo_sc sc_fifo;
|
||||
struct usb_fifo_sc sc_fifo;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb_device *sc_udev;
|
||||
|
||||
uint32_t sc_unit;
|
||||
uint32_t sc_freq;
|
||||
@ -75,7 +75,7 @@ static device_detach_t ufm_detach;
|
||||
static usb2_fifo_ioctl_t ufm_ioctl;
|
||||
static usb2_fifo_open_t ufm_open;
|
||||
|
||||
static struct usb2_fifo_methods ufm_fifo_methods = {
|
||||
static struct usb_fifo_methods ufm_fifo_methods = {
|
||||
.f_ioctl = &ufm_ioctl,
|
||||
.f_open = &ufm_open,
|
||||
.basename[0] = "ufm",
|
||||
@ -110,7 +110,7 @@ MODULE_DEPEND(ufm, usb, 1, 1, 1);
|
||||
static int
|
||||
ufm_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
return (ENXIO);
|
||||
@ -125,7 +125,7 @@ ufm_probe(device_t dev)
|
||||
static int
|
||||
ufm_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct ufm_softc *sc = device_get_softc(dev);
|
||||
int error;
|
||||
|
||||
@ -166,7 +166,7 @@ ufm_detach(device_t dev)
|
||||
}
|
||||
|
||||
static int
|
||||
ufm_open(struct usb2_fifo *dev, int fflags)
|
||||
ufm_open(struct usb_fifo *dev, int fflags)
|
||||
{
|
||||
if ((fflags & (FWRITE | FREAD)) != (FWRITE | FREAD)) {
|
||||
return (EACCES);
|
||||
@ -180,7 +180,7 @@ ufm_do_req(struct ufm_softc *sc, uint8_t request,
|
||||
{
|
||||
int error;
|
||||
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint8_t buf[1];
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
@ -296,7 +296,7 @@ ufm_get_stat(struct ufm_softc *sc, void *addr)
|
||||
}
|
||||
|
||||
static int
|
||||
ufm_ioctl(struct usb2_fifo *fifo, u_long cmd, void *addr,
|
||||
ufm_ioctl(struct usb_fifo *fifo, u_long cmd, void *addr,
|
||||
int fflags)
|
||||
{
|
||||
struct ufm_softc *sc = fifo->priv_sc0;
|
||||
|
@ -97,7 +97,7 @@ SYSCTL_INT(_hw_usb_aue, OID_AUTO, debug, CTLFLAG_RW, &aue_debug, 0,
|
||||
/*
|
||||
* Various supported device vendors/products.
|
||||
*/
|
||||
static const struct usb2_device_id aue_devs[] = {
|
||||
static const struct usb_device_id aue_devs[] = {
|
||||
{USB_VPI(USB_VENDOR_3COM, USB_PRODUCT_3COM_3C460B, AUE_FLAG_PII)},
|
||||
{USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_DSB650TX_PNA, 0)},
|
||||
{USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_UFE1000, AUE_FLAG_LSYS)},
|
||||
@ -202,7 +202,7 @@ static void aue_reset_pegasus_II(struct aue_softc *);
|
||||
static int aue_ifmedia_upd(struct ifnet *);
|
||||
static void aue_ifmedia_sts(struct ifnet *, struct ifmediareq *);
|
||||
|
||||
static const struct usb2_config aue_config[AUE_N_TRANSFER] = {
|
||||
static const struct usb_config aue_config[AUE_N_TRANSFER] = {
|
||||
|
||||
[AUE_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -266,7 +266,7 @@ MODULE_DEPEND(aue, usb, 1, 1, 1);
|
||||
MODULE_DEPEND(aue, ether, 1, 1, 1);
|
||||
MODULE_DEPEND(aue, miibus, 1, 1, 1);
|
||||
|
||||
static const struct usb2_ether_methods aue_ue_methods = {
|
||||
static const struct usb_ether_methods aue_ue_methods = {
|
||||
.ue_attach_post = aue_attach_post,
|
||||
.ue_start = aue_start,
|
||||
.ue_init = aue_init,
|
||||
@ -287,7 +287,7 @@ static const struct usb2_ether_methods aue_ue_methods = {
|
||||
static uint8_t
|
||||
aue_csr_read_1(struct aue_softc *sc, uint16_t reg)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
uint8_t val;
|
||||
|
||||
@ -306,7 +306,7 @@ aue_csr_read_1(struct aue_softc *sc, uint16_t reg)
|
||||
static uint16_t
|
||||
aue_csr_read_2(struct aue_softc *sc, uint16_t reg)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
uint16_t val;
|
||||
|
||||
@ -325,7 +325,7 @@ aue_csr_read_2(struct aue_softc *sc, uint16_t reg)
|
||||
static void
|
||||
aue_csr_write_1(struct aue_softc *sc, uint16_t reg, uint8_t val)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
req.bRequest = AUE_UR_WRITEREG;
|
||||
@ -342,7 +342,7 @@ aue_csr_write_1(struct aue_softc *sc, uint16_t reg, uint8_t val)
|
||||
static void
|
||||
aue_csr_write_2(struct aue_softc *sc, uint16_t reg, uint16_t val)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
req.bRequest = AUE_UR_WRITEREG;
|
||||
@ -518,7 +518,7 @@ aue_miibus_statchg(device_t dev)
|
||||
|
||||
#define AUE_BITS 6
|
||||
static void
|
||||
aue_setmulti(struct usb2_ether *ue)
|
||||
aue_setmulti(struct usb_ether *ue)
|
||||
{
|
||||
struct aue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -609,7 +609,7 @@ aue_reset(struct aue_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
aue_attach_post(struct usb2_ether *ue)
|
||||
aue_attach_post(struct usb_ether *ue)
|
||||
{
|
||||
struct aue_softc *sc = usb2_ether_getsc(ue);
|
||||
|
||||
@ -626,7 +626,7 @@ aue_attach_post(struct usb2_ether *ue)
|
||||
static int
|
||||
aue_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST)
|
||||
return (ENXIO);
|
||||
@ -654,9 +654,9 @@ aue_probe(device_t dev)
|
||||
static int
|
||||
aue_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct aue_softc *sc = device_get_softc(dev);
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
uint8_t iface_index;
|
||||
int error;
|
||||
|
||||
@ -701,7 +701,7 @@ static int
|
||||
aue_detach(device_t dev)
|
||||
{
|
||||
struct aue_softc *sc = device_get_softc(dev);
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
|
||||
usb2_transfer_unsetup(sc->sc_xfer, AUE_N_TRANSFER);
|
||||
usb2_ether_ifdetach(ue);
|
||||
@ -711,7 +711,7 @@ aue_detach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
aue_intr_callback(struct usb2_xfer *xfer)
|
||||
aue_intr_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct aue_softc *sc = xfer->priv_sc;
|
||||
struct ifnet *ifp = usb2_ether_getifp(&sc->sc_ue);
|
||||
@ -749,10 +749,10 @@ aue_intr_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
aue_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
aue_bulk_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct aue_softc *sc = xfer->priv_sc;
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
struct aue_rxpkt stat;
|
||||
|
||||
@ -811,7 +811,7 @@ aue_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
aue_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
aue_bulk_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct aue_softc *sc = xfer->priv_sc;
|
||||
struct ifnet *ifp = usb2_ether_getifp(&sc->sc_ue);
|
||||
@ -893,7 +893,7 @@ aue_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
aue_tick(struct usb2_ether *ue)
|
||||
aue_tick(struct usb_ether *ue)
|
||||
{
|
||||
struct aue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct mii_data *mii = GET_MII(sc);
|
||||
@ -910,7 +910,7 @@ aue_tick(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
aue_start(struct usb2_ether *ue)
|
||||
aue_start(struct usb_ether *ue)
|
||||
{
|
||||
struct aue_softc *sc = usb2_ether_getsc(ue);
|
||||
|
||||
@ -923,7 +923,7 @@ aue_start(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
aue_init(struct usb2_ether *ue)
|
||||
aue_init(struct usb_ether *ue)
|
||||
{
|
||||
struct aue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -958,7 +958,7 @@ aue_init(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
aue_setpromisc(struct usb2_ether *ue)
|
||||
aue_setpromisc(struct usb_ether *ue)
|
||||
{
|
||||
struct aue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -1015,7 +1015,7 @@ aue_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
* RX and TX lists.
|
||||
*/
|
||||
static void
|
||||
aue_stop(struct usb2_ether *ue)
|
||||
aue_stop(struct usb_ether *ue)
|
||||
{
|
||||
struct aue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
|
@ -202,9 +202,9 @@ struct aue_rxpkt {
|
||||
} __packed;
|
||||
|
||||
struct aue_softc {
|
||||
struct usb2_ether sc_ue;
|
||||
struct usb_ether sc_ue;
|
||||
struct mtx sc_mtx;
|
||||
struct usb2_xfer *sc_xfer[AUE_N_TRANSFER];
|
||||
struct usb_xfer *sc_xfer[AUE_N_TRANSFER];
|
||||
|
||||
int sc_flags;
|
||||
#define AUE_FLAG_LSYS 0x0001 /* use Linksys reset */
|
||||
|
@ -120,7 +120,7 @@ SYSCTL_INT(_hw_usb_axe, OID_AUTO, debug, CTLFLAG_RW, &axe_debug, 0,
|
||||
/*
|
||||
* Various supported device vendors/products.
|
||||
*/
|
||||
static const struct usb2_device_id axe_devs[] = {
|
||||
static const struct usb_device_id axe_devs[] = {
|
||||
{USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_UF200, 0)},
|
||||
{USB_VPI(USB_VENDOR_ACERCM, USB_PRODUCT_ACERCM_EP1427X2, 0)},
|
||||
{USB_VPI(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_ETHERNET, AXE_FLAG_772)},
|
||||
@ -175,7 +175,7 @@ static void axe_ax88178_init(struct axe_softc *);
|
||||
static void axe_ax88772_init(struct axe_softc *);
|
||||
static int axe_get_phyno(struct axe_softc *, int);
|
||||
|
||||
static const struct usb2_config axe_config[AXE_N_TRANSFER] = {
|
||||
static const struct usb_config axe_config[AXE_N_TRANSFER] = {
|
||||
|
||||
[AXE_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -243,7 +243,7 @@ MODULE_DEPEND(axe, usb, 1, 1, 1);
|
||||
MODULE_DEPEND(axe, ether, 1, 1, 1);
|
||||
MODULE_DEPEND(axe, miibus, 1, 1, 1);
|
||||
|
||||
static const struct usb2_ether_methods axe_ue_methods = {
|
||||
static const struct usb_ether_methods axe_ue_methods = {
|
||||
.ue_attach_post = axe_attach_post,
|
||||
.ue_start = axe_start,
|
||||
.ue_init = axe_init,
|
||||
@ -258,7 +258,7 @@ static const struct usb2_ether_methods axe_ue_methods = {
|
||||
static int
|
||||
axe_cmd(struct axe_softc *sc, int cmd, int index, int val, void *buf)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
|
||||
AXE_LOCK_ASSERT(sc, MA_OWNED);
|
||||
@ -440,7 +440,7 @@ axe_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
}
|
||||
|
||||
static void
|
||||
axe_setmulti(struct usb2_ether *ue)
|
||||
axe_setmulti(struct usb_ether *ue)
|
||||
{
|
||||
struct axe_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -599,7 +599,7 @@ axe_ax88772_init(struct axe_softc *sc)
|
||||
static void
|
||||
axe_reset(struct axe_softc *sc)
|
||||
{
|
||||
struct usb2_config_descriptor *cd;
|
||||
struct usb_config_descriptor *cd;
|
||||
usb2_error_t err;
|
||||
|
||||
cd = usb2_get_config_descriptor(sc->sc_ue.ue_udev);
|
||||
@ -614,7 +614,7 @@ axe_reset(struct axe_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
axe_attach_post(struct usb2_ether *ue)
|
||||
axe_attach_post(struct usb_ether *ue)
|
||||
{
|
||||
struct axe_softc *sc = usb2_ether_getsc(ue);
|
||||
|
||||
@ -660,7 +660,7 @@ axe_attach_post(struct usb2_ether *ue)
|
||||
static int
|
||||
axe_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST)
|
||||
return (ENXIO);
|
||||
@ -679,9 +679,9 @@ axe_probe(device_t dev)
|
||||
static int
|
||||
axe_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct axe_softc *sc = device_get_softc(dev);
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
uint8_t iface_index;
|
||||
int error;
|
||||
|
||||
@ -721,7 +721,7 @@ static int
|
||||
axe_detach(device_t dev)
|
||||
{
|
||||
struct axe_softc *sc = device_get_softc(dev);
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
|
||||
usb2_transfer_unsetup(sc->sc_xfer, AXE_N_TRANSFER);
|
||||
usb2_ether_ifdetach(ue);
|
||||
@ -731,7 +731,7 @@ axe_detach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
axe_intr_callback(struct usb2_xfer *xfer)
|
||||
axe_intr_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
case USB_ST_TRANSFERRED:
|
||||
@ -756,10 +756,10 @@ axe_intr_callback(struct usb2_xfer *xfer)
|
||||
#endif
|
||||
|
||||
static void
|
||||
axe_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
axe_bulk_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct axe_softc *sc = xfer->priv_sc;
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
struct axe_sframe_hdr hdr;
|
||||
int error, pos, len, adjust;
|
||||
@ -838,7 +838,7 @@ axe_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
#endif
|
||||
|
||||
static void
|
||||
axe_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
axe_bulk_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct axe_softc *sc = xfer->priv_sc;
|
||||
struct axe_sframe_hdr hdr;
|
||||
@ -935,7 +935,7 @@ axe_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
axe_tick(struct usb2_ether *ue)
|
||||
axe_tick(struct usb_ether *ue)
|
||||
{
|
||||
struct axe_softc *sc = usb2_ether_getsc(ue);
|
||||
struct mii_data *mii = GET_MII(sc);
|
||||
@ -951,7 +951,7 @@ axe_tick(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
axe_start(struct usb2_ether *ue)
|
||||
axe_start(struct usb_ether *ue)
|
||||
{
|
||||
struct axe_softc *sc = usb2_ether_getsc(ue);
|
||||
|
||||
@ -964,7 +964,7 @@ axe_start(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
axe_init(struct usb2_ether *ue)
|
||||
axe_init(struct usb_ether *ue)
|
||||
{
|
||||
struct axe_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -1017,7 +1017,7 @@ axe_init(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
axe_setpromisc(struct usb2_ether *ue)
|
||||
axe_setpromisc(struct usb_ether *ue)
|
||||
{
|
||||
struct axe_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -1039,7 +1039,7 @@ axe_setpromisc(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
axe_stop(struct usb2_ether *ue)
|
||||
axe_stop(struct usb_ether *ue)
|
||||
{
|
||||
struct axe_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
|
@ -177,9 +177,9 @@ enum {
|
||||
};
|
||||
|
||||
struct axe_softc {
|
||||
struct usb2_ether sc_ue;
|
||||
struct usb_ether sc_ue;
|
||||
struct mtx sc_mtx;
|
||||
struct usb2_xfer *sc_xfer[AXE_N_TRANSFER];
|
||||
struct usb_xfer *sc_xfer[AXE_N_TRANSFER];
|
||||
int sc_phyno;
|
||||
|
||||
int sc_flags;
|
||||
|
@ -93,7 +93,7 @@ SYSCTL_INT(_hw_usb_cdce, OID_AUTO, debug, CTLFLAG_RW, &cdce_debug, 0,
|
||||
"Debug level");
|
||||
#endif
|
||||
|
||||
static const struct usb2_config cdce_config[CDCE_N_TRANSFER] = {
|
||||
static const struct usb_config cdce_config[CDCE_N_TRANSFER] = {
|
||||
|
||||
[CDCE_BULK_RX] = {
|
||||
.type = UE_BULK,
|
||||
@ -174,7 +174,7 @@ MODULE_DEPEND(cdce, uether, 1, 1, 1);
|
||||
MODULE_DEPEND(cdce, usb, 1, 1, 1);
|
||||
MODULE_DEPEND(cdce, ether, 1, 1, 1);
|
||||
|
||||
static const struct usb2_ether_methods cdce_ue_methods = {
|
||||
static const struct usb_ether_methods cdce_ue_methods = {
|
||||
.ue_attach_post = cdce_attach_post,
|
||||
.ue_start = cdce_start,
|
||||
.ue_init = cdce_init,
|
||||
@ -183,7 +183,7 @@ static const struct usb2_ether_methods cdce_ue_methods = {
|
||||
.ue_setpromisc = cdce_setpromisc,
|
||||
};
|
||||
|
||||
static const struct usb2_device_id cdce_devs[] = {
|
||||
static const struct usb_device_id cdce_devs[] = {
|
||||
{USB_IF_CSI(UICLASS_CDC, UISUBCLASS_ETHERNET_NETWORKING_CONTROL_MODEL, 0)},
|
||||
{USB_IF_CSI(UICLASS_CDC, UISUBCLASS_MOBILE_DIRECT_LINE_MODEL, 0)},
|
||||
|
||||
@ -205,13 +205,13 @@ static const struct usb2_device_id cdce_devs[] = {
|
||||
static int
|
||||
cdce_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
return (usb2_lookup_id_by_uaa(cdce_devs, sizeof(cdce_devs), uaa));
|
||||
}
|
||||
|
||||
static void
|
||||
cdce_attach_post(struct usb2_ether *ue)
|
||||
cdce_attach_post(struct usb_ether *ue)
|
||||
{
|
||||
/* no-op */
|
||||
return;
|
||||
@ -221,12 +221,12 @@ static int
|
||||
cdce_attach(device_t dev)
|
||||
{
|
||||
struct cdce_softc *sc = device_get_softc(dev);
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb2_interface *iface;
|
||||
const struct usb2_cdc_union_descriptor *ud;
|
||||
const struct usb2_interface_descriptor *id;
|
||||
const struct usb2_cdc_ethernet_descriptor *ued;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_interface *iface;
|
||||
const struct usb_cdc_union_descriptor *ud;
|
||||
const struct usb_interface_descriptor *id;
|
||||
const struct usb_cdc_ethernet_descriptor *ued;
|
||||
int error;
|
||||
uint8_t i;
|
||||
char eaddr_str[5 * ETHER_ADDR_LEN]; /* approx */
|
||||
@ -391,7 +391,7 @@ static int
|
||||
cdce_detach(device_t dev)
|
||||
{
|
||||
struct cdce_softc *sc = device_get_softc(dev);
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
|
||||
/* stop all USB transfers first */
|
||||
usb2_transfer_unsetup(sc->sc_xfer, CDCE_N_TRANSFER);
|
||||
@ -402,7 +402,7 @@ cdce_detach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
cdce_start(struct usb2_ether *ue)
|
||||
cdce_start(struct usb_ether *ue)
|
||||
{
|
||||
struct cdce_softc *sc = usb2_ether_getsc(ue);
|
||||
|
||||
@ -426,7 +426,7 @@ cdce_free_queue(struct mbuf **ppm, uint8_t n)
|
||||
}
|
||||
|
||||
static void
|
||||
cdce_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
cdce_bulk_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct cdce_softc *sc = xfer->priv_sc;
|
||||
struct ifnet *ifp = usb2_ether_getifp(&sc->sc_ue);
|
||||
@ -540,7 +540,7 @@ cdce_m_crc32(struct mbuf *m, uint32_t src_offset, uint32_t src_len)
|
||||
}
|
||||
|
||||
static void
|
||||
cdce_init(struct usb2_ether *ue)
|
||||
cdce_init(struct usb_ether *ue)
|
||||
{
|
||||
struct cdce_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -561,7 +561,7 @@ cdce_init(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
cdce_stop(struct usb2_ether *ue)
|
||||
cdce_stop(struct usb_ether *ue)
|
||||
{
|
||||
struct cdce_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -580,14 +580,14 @@ cdce_stop(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
cdce_setmulti(struct usb2_ether *ue)
|
||||
cdce_setmulti(struct usb_ether *ue)
|
||||
{
|
||||
/* no-op */
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
cdce_setpromisc(struct usb2_ether *ue)
|
||||
cdce_setpromisc(struct usb_ether *ue)
|
||||
{
|
||||
/* no-op */
|
||||
return;
|
||||
@ -608,7 +608,7 @@ cdce_resume(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
cdce_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
cdce_bulk_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct cdce_softc *sc = xfer->priv_sc;
|
||||
struct mbuf *m;
|
||||
@ -684,7 +684,7 @@ cdce_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
cdce_intr_read_callback(struct usb2_xfer *xfer)
|
||||
cdce_intr_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
; /* style fix */
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
@ -713,7 +713,7 @@ cdce_intr_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
cdce_intr_write_callback(struct usb2_xfer *xfer)
|
||||
cdce_intr_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
; /* style fix */
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
|
@ -47,9 +47,9 @@ enum {
|
||||
};
|
||||
|
||||
struct cdce_softc {
|
||||
struct usb2_ether sc_ue;
|
||||
struct usb_ether sc_ue;
|
||||
struct mtx sc_mtx;
|
||||
struct usb2_xfer *sc_xfer[CDCE_N_TRANSFER];
|
||||
struct usb_xfer *sc_xfer[CDCE_N_TRANSFER];
|
||||
struct mbuf *sc_rx_buf[CDCE_FRAMES_MAX];
|
||||
struct mbuf *sc_tx_buf[CDCE_FRAMES_MAX];
|
||||
|
||||
|
@ -75,7 +75,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
/* Belkin F5U111 adapter covered by NETMATE entry */
|
||||
|
||||
static const struct usb2_device_id cue_devs[] = {
|
||||
static const struct usb_device_id cue_devs[] = {
|
||||
{USB_VPI(USB_VENDOR_CATC, USB_PRODUCT_CATC_NETMATE, 0)},
|
||||
{USB_VPI(USB_VENDOR_CATC, USB_PRODUCT_CATC_NETMATE2, 0)},
|
||||
{USB_VPI(USB_VENDOR_SMARTBRIDGES, USB_PRODUCT_SMARTBRIDGES_SMARTLINK, 0)},
|
||||
@ -114,7 +114,7 @@ SYSCTL_INT(_hw_usb_cue, OID_AUTO, debug, CTLFLAG_RW, &cue_debug, 0,
|
||||
"Debug level");
|
||||
#endif
|
||||
|
||||
static const struct usb2_config cue_config[CUE_N_TRANSFER] = {
|
||||
static const struct usb_config cue_config[CUE_N_TRANSFER] = {
|
||||
|
||||
[CUE_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -158,7 +158,7 @@ MODULE_DEPEND(cue, uether, 1, 1, 1);
|
||||
MODULE_DEPEND(cue, usb, 1, 1, 1);
|
||||
MODULE_DEPEND(cue, ether, 1, 1, 1);
|
||||
|
||||
static const struct usb2_ether_methods cue_ue_methods = {
|
||||
static const struct usb_ether_methods cue_ue_methods = {
|
||||
.ue_attach_post = cue_attach_post,
|
||||
.ue_start = cue_start,
|
||||
.ue_init = cue_init,
|
||||
@ -177,7 +177,7 @@ static const struct usb2_ether_methods cue_ue_methods = {
|
||||
static uint8_t
|
||||
cue_csr_read_1(struct cue_softc *sc, uint16_t reg)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint8_t val;
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
@ -195,7 +195,7 @@ cue_csr_read_1(struct cue_softc *sc, uint16_t reg)
|
||||
static uint16_t
|
||||
cue_csr_read_2(struct cue_softc *sc, uint8_t reg)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint16_t val;
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
@ -211,7 +211,7 @@ cue_csr_read_2(struct cue_softc *sc, uint8_t reg)
|
||||
static int
|
||||
cue_csr_write_1(struct cue_softc *sc, uint16_t reg, uint16_t val)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
req.bRequest = CUE_CMD_WRITEREG;
|
||||
@ -225,7 +225,7 @@ cue_csr_write_1(struct cue_softc *sc, uint16_t reg, uint16_t val)
|
||||
static int
|
||||
cue_mem(struct cue_softc *sc, uint8_t cmd, uint16_t addr, void *buf, int len)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
if (cmd == CUE_CMD_READSRAM)
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
@ -242,7 +242,7 @@ cue_mem(struct cue_softc *sc, uint8_t cmd, uint16_t addr, void *buf, int len)
|
||||
static int
|
||||
cue_getmac(struct cue_softc *sc, void *buf)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
req.bRequest = CUE_CMD_GET_MACADDR;
|
||||
@ -267,7 +267,7 @@ cue_mchash(const uint8_t *addr)
|
||||
}
|
||||
|
||||
static void
|
||||
cue_setpromisc(struct usb2_ether *ue)
|
||||
cue_setpromisc(struct usb_ether *ue)
|
||||
{
|
||||
struct cue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -285,7 +285,7 @@ cue_setpromisc(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
cue_setmulti(struct usb2_ether *ue)
|
||||
cue_setmulti(struct usb_ether *ue)
|
||||
{
|
||||
struct cue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -329,7 +329,7 @@ cue_setmulti(struct usb2_ether *ue)
|
||||
static void
|
||||
cue_reset(struct cue_softc *sc)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
req.bRequest = CUE_CMD_RESET;
|
||||
@ -348,7 +348,7 @@ cue_reset(struct cue_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
cue_attach_post(struct usb2_ether *ue)
|
||||
cue_attach_post(struct usb_ether *ue)
|
||||
{
|
||||
struct cue_softc *sc = usb2_ether_getsc(ue);
|
||||
|
||||
@ -358,7 +358,7 @@ cue_attach_post(struct usb2_ether *ue)
|
||||
static int
|
||||
cue_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST)
|
||||
return (ENXIO);
|
||||
@ -377,9 +377,9 @@ cue_probe(device_t dev)
|
||||
static int
|
||||
cue_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct cue_softc *sc = device_get_softc(dev);
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
uint8_t iface_index;
|
||||
int error;
|
||||
|
||||
@ -416,7 +416,7 @@ static int
|
||||
cue_detach(device_t dev)
|
||||
{
|
||||
struct cue_softc *sc = device_get_softc(dev);
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
|
||||
usb2_transfer_unsetup(sc->sc_xfer, CUE_N_TRANSFER);
|
||||
usb2_ether_ifdetach(ue);
|
||||
@ -426,10 +426,10 @@ cue_detach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
cue_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
cue_bulk_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct cue_softc *sc = xfer->priv_sc;
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
uint8_t buf[2];
|
||||
int len;
|
||||
@ -470,7 +470,7 @@ cue_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
cue_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
cue_bulk_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct cue_softc *sc = xfer->priv_sc;
|
||||
struct ifnet *ifp = usb2_ether_getifp(&sc->sc_ue);
|
||||
@ -531,7 +531,7 @@ cue_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
cue_tick(struct usb2_ether *ue)
|
||||
cue_tick(struct usb_ether *ue)
|
||||
{
|
||||
struct cue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -547,7 +547,7 @@ cue_tick(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
cue_start(struct usb2_ether *ue)
|
||||
cue_start(struct usb_ether *ue)
|
||||
{
|
||||
struct cue_softc *sc = usb2_ether_getsc(ue);
|
||||
|
||||
@ -559,7 +559,7 @@ cue_start(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
cue_init(struct usb2_ether *ue)
|
||||
cue_init(struct usb_ether *ue)
|
||||
{
|
||||
struct cue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -609,7 +609,7 @@ cue_init(struct usb2_ether *ue)
|
||||
* RX and TX lists.
|
||||
*/
|
||||
static void
|
||||
cue_stop(struct usb2_ether *ue)
|
||||
cue_stop(struct usb_ether *ue)
|
||||
{
|
||||
struct cue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
|
@ -119,9 +119,9 @@ enum {
|
||||
};
|
||||
|
||||
struct cue_softc {
|
||||
struct usb2_ether sc_ue;
|
||||
struct usb_ether sc_ue;
|
||||
struct mtx sc_mtx;
|
||||
struct usb2_xfer *sc_xfer[CUE_N_TRANSFER];
|
||||
struct usb_xfer *sc_xfer[CUE_N_TRANSFER];
|
||||
|
||||
int sc_flags;
|
||||
#define CUE_FLAG_LINK 0x0001 /* got a link */
|
||||
|
@ -87,7 +87,7 @@ __FBSDID("$FreeBSD$");
|
||||
/*
|
||||
* Various supported device vendors/products.
|
||||
*/
|
||||
static const struct usb2_device_id kue_devs[] = {
|
||||
static const struct usb_device_id kue_devs[] = {
|
||||
{USB_VPI(USB_VENDOR_3COM, USB_PRODUCT_3COM_3C19250, 0)},
|
||||
{USB_VPI(USB_VENDOR_3COM, USB_PRODUCT_3COM_3C460, 0)},
|
||||
{USB_VPI(USB_VENDOR_ABOCOM, USB_PRODUCT_ABOCOM_URE450, 0)},
|
||||
@ -141,7 +141,7 @@ static usb2_ether_fn_t kue_setmulti;
|
||||
static usb2_ether_fn_t kue_setpromisc;
|
||||
|
||||
static int kue_do_request(struct kue_softc *,
|
||||
struct usb2_device_request *, void *);
|
||||
struct usb_device_request *, void *);
|
||||
static int kue_setword(struct kue_softc *, uint8_t, uint16_t);
|
||||
static int kue_ctl(struct kue_softc *, uint8_t, uint8_t, uint16_t,
|
||||
void *, int);
|
||||
@ -156,7 +156,7 @@ SYSCTL_INT(_hw_usb_kue, OID_AUTO, debug, CTLFLAG_RW, &kue_debug, 0,
|
||||
"Debug level");
|
||||
#endif
|
||||
|
||||
static const struct usb2_config kue_config[KUE_N_TRANSFER] = {
|
||||
static const struct usb_config kue_config[KUE_N_TRANSFER] = {
|
||||
|
||||
[KUE_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -201,7 +201,7 @@ MODULE_DEPEND(kue, uether, 1, 1, 1);
|
||||
MODULE_DEPEND(kue, usb, 1, 1, 1);
|
||||
MODULE_DEPEND(kue, ether, 1, 1, 1);
|
||||
|
||||
static const struct usb2_ether_methods kue_ue_methods = {
|
||||
static const struct usb_ether_methods kue_ue_methods = {
|
||||
.ue_attach_post = kue_attach_post,
|
||||
.ue_start = kue_start,
|
||||
.ue_init = kue_init,
|
||||
@ -218,7 +218,7 @@ static const struct usb2_ether_methods kue_ue_methods = {
|
||||
* than the default timeout.
|
||||
*/
|
||||
static int
|
||||
kue_do_request(struct kue_softc *sc, struct usb2_device_request *req,
|
||||
kue_do_request(struct kue_softc *sc, struct usb_device_request *req,
|
||||
void *data)
|
||||
{
|
||||
usb2_error_t err;
|
||||
@ -231,7 +231,7 @@ kue_do_request(struct kue_softc *sc, struct usb2_device_request *req,
|
||||
static int
|
||||
kue_setword(struct kue_softc *sc, uint8_t breq, uint16_t word)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
req.bRequest = breq;
|
||||
@ -246,7 +246,7 @@ static int
|
||||
kue_ctl(struct kue_softc *sc, uint8_t rw, uint8_t breq,
|
||||
uint16_t val, void *data, int len)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
if (rw == KUE_CTL_WRITE)
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
@ -265,7 +265,7 @@ kue_ctl(struct kue_softc *sc, uint8_t rw, uint8_t breq,
|
||||
static int
|
||||
kue_load_fw(struct kue_softc *sc)
|
||||
{
|
||||
struct usb2_device_descriptor *dd;
|
||||
struct usb_device_descriptor *dd;
|
||||
uint16_t hwrev;
|
||||
usb2_error_t err;
|
||||
|
||||
@ -320,7 +320,7 @@ kue_load_fw(struct kue_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
kue_setpromisc(struct usb2_ether *ue)
|
||||
kue_setpromisc(struct usb_ether *ue)
|
||||
{
|
||||
struct kue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -336,7 +336,7 @@ kue_setpromisc(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
kue_setmulti(struct usb2_ether *ue)
|
||||
kue_setmulti(struct usb_ether *ue)
|
||||
{
|
||||
struct kue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -390,7 +390,7 @@ kue_setmulti(struct usb2_ether *ue)
|
||||
static void
|
||||
kue_reset(struct kue_softc *sc)
|
||||
{
|
||||
struct usb2_config_descriptor *cd;
|
||||
struct usb_config_descriptor *cd;
|
||||
usb2_error_t err;
|
||||
|
||||
cd = usb2_get_config_descriptor(sc->sc_ue.ue_udev);
|
||||
@ -405,7 +405,7 @@ kue_reset(struct kue_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
kue_attach_post(struct usb2_ether *ue)
|
||||
kue_attach_post(struct usb_ether *ue)
|
||||
{
|
||||
struct kue_softc *sc = usb2_ether_getsc(ue);
|
||||
int error;
|
||||
@ -434,7 +434,7 @@ kue_attach_post(struct usb2_ether *ue)
|
||||
static int
|
||||
kue_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST)
|
||||
return (ENXIO);
|
||||
@ -453,9 +453,9 @@ kue_probe(device_t dev)
|
||||
static int
|
||||
kue_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct kue_softc *sc = device_get_softc(dev);
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
uint8_t iface_index;
|
||||
int error;
|
||||
|
||||
@ -499,7 +499,7 @@ static int
|
||||
kue_detach(device_t dev)
|
||||
{
|
||||
struct kue_softc *sc = device_get_softc(dev);
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
|
||||
usb2_transfer_unsetup(sc->sc_xfer, KUE_N_TRANSFER);
|
||||
usb2_ether_ifdetach(ue);
|
||||
@ -514,10 +514,10 @@ kue_detach(device_t dev)
|
||||
* the higher level protocols.
|
||||
*/
|
||||
static void
|
||||
kue_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
kue_bulk_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct kue_softc *sc = xfer->priv_sc;
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
uint8_t buf[2];
|
||||
int len;
|
||||
@ -558,7 +558,7 @@ kue_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
kue_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
kue_bulk_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct kue_softc *sc = xfer->priv_sc;
|
||||
struct ifnet *ifp = usb2_ether_getifp(&sc->sc_ue);
|
||||
@ -628,7 +628,7 @@ kue_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
kue_start(struct usb2_ether *ue)
|
||||
kue_start(struct usb_ether *ue)
|
||||
{
|
||||
struct kue_softc *sc = usb2_ether_getsc(ue);
|
||||
|
||||
@ -640,7 +640,7 @@ kue_start(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
kue_init(struct usb2_ether *ue)
|
||||
kue_init(struct usb_ether *ue)
|
||||
{
|
||||
struct kue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -671,7 +671,7 @@ kue_init(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
kue_stop(struct usb2_ether *ue)
|
||||
kue_stop(struct usb_ether *ue)
|
||||
{
|
||||
struct kue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
|
@ -124,10 +124,10 @@ enum {
|
||||
};
|
||||
|
||||
struct kue_softc {
|
||||
struct usb2_ether sc_ue;
|
||||
struct usb_ether sc_ue;
|
||||
struct mtx sc_mtx;
|
||||
struct kue_ether_desc sc_desc;
|
||||
struct usb2_xfer *sc_xfer[KUE_N_TRANSFER];
|
||||
struct usb_xfer *sc_xfer[KUE_N_TRANSFER];
|
||||
uint8_t *sc_mcfilters;
|
||||
|
||||
int sc_flags;
|
||||
|
@ -95,7 +95,7 @@ SYSCTL_INT(_hw_usb_rue, OID_AUTO, debug, CTLFLAG_RW,
|
||||
* Various supported device vendors/products.
|
||||
*/
|
||||
|
||||
static const struct usb2_device_id rue_devs[] = {
|
||||
static const struct usb_device_id rue_devs[] = {
|
||||
{USB_VPI(USB_VENDOR_MELCO, USB_PRODUCT_MELCO_LUAKTX, 0)},
|
||||
{USB_VPI(USB_VENDOR_REALTEK, USB_PRODUCT_REALTEK_USBKR100, 0)},
|
||||
};
|
||||
@ -134,7 +134,7 @@ static void rue_reset(struct rue_softc *);
|
||||
static int rue_ifmedia_upd(struct ifnet *);
|
||||
static void rue_ifmedia_sts(struct ifnet *, struct ifmediareq *);
|
||||
|
||||
static const struct usb2_config rue_config[RUE_N_TRANSFER] = {
|
||||
static const struct usb_config rue_config[RUE_N_TRANSFER] = {
|
||||
|
||||
[RUE_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -199,7 +199,7 @@ MODULE_DEPEND(rue, usb, 1, 1, 1);
|
||||
MODULE_DEPEND(rue, ether, 1, 1, 1);
|
||||
MODULE_DEPEND(rue, miibus, 1, 1, 1);
|
||||
|
||||
static const struct usb2_ether_methods rue_ue_methods = {
|
||||
static const struct usb_ether_methods rue_ue_methods = {
|
||||
.ue_attach_post = rue_attach_post,
|
||||
.ue_start = rue_start,
|
||||
.ue_init = rue_init,
|
||||
@ -220,7 +220,7 @@ static const struct usb2_ether_methods rue_ue_methods = {
|
||||
static int
|
||||
rue_read_mem(struct rue_softc *sc, uint16_t addr, void *buf, int len)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
req.bRequest = UR_SET_ADDRESS;
|
||||
@ -234,7 +234,7 @@ rue_read_mem(struct rue_softc *sc, uint16_t addr, void *buf, int len)
|
||||
static int
|
||||
rue_write_mem(struct rue_softc *sc, uint16_t addr, void *buf, int len)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
req.bRequest = UR_SET_ADDRESS;
|
||||
@ -434,7 +434,7 @@ rue_miibus_statchg(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
rue_setpromisc(struct usb2_ether *ue)
|
||||
rue_setpromisc(struct usb_ether *ue)
|
||||
{
|
||||
struct rue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -452,7 +452,7 @@ rue_setpromisc(struct usb2_ether *ue)
|
||||
* Program the 64-bit multicast hash filter.
|
||||
*/
|
||||
static void
|
||||
rue_setmulti(struct usb2_ether *ue)
|
||||
rue_setmulti(struct usb_ether *ue)
|
||||
{
|
||||
struct rue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -527,7 +527,7 @@ rue_reset(struct rue_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
rue_attach_post(struct usb2_ether *ue)
|
||||
rue_attach_post(struct usb_ether *ue)
|
||||
{
|
||||
struct rue_softc *sc = usb2_ether_getsc(ue);
|
||||
|
||||
@ -544,7 +544,7 @@ rue_attach_post(struct usb2_ether *ue)
|
||||
static int
|
||||
rue_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST)
|
||||
return (ENXIO);
|
||||
@ -563,9 +563,9 @@ rue_probe(device_t dev)
|
||||
static int
|
||||
rue_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct rue_softc *sc = device_get_softc(dev);
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
uint8_t iface_index;
|
||||
int error;
|
||||
|
||||
@ -603,7 +603,7 @@ static int
|
||||
rue_detach(device_t dev)
|
||||
{
|
||||
struct rue_softc *sc = device_get_softc(dev);
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
|
||||
usb2_transfer_unsetup(sc->sc_xfer, RUE_N_TRANSFER);
|
||||
usb2_ether_ifdetach(ue);
|
||||
@ -613,7 +613,7 @@ rue_detach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
rue_intr_callback(struct usb2_xfer *xfer)
|
||||
rue_intr_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct rue_softc *sc = xfer->priv_sc;
|
||||
struct ifnet *ifp = usb2_ether_getifp(&sc->sc_ue);
|
||||
@ -649,10 +649,10 @@ rue_intr_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
rue_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
rue_bulk_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct rue_softc *sc = xfer->priv_sc;
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
uint16_t status;
|
||||
|
||||
@ -696,7 +696,7 @@ rue_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
rue_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
rue_bulk_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct rue_softc *sc = xfer->priv_sc;
|
||||
struct ifnet *ifp = usb2_ether_getifp(&sc->sc_ue);
|
||||
@ -768,7 +768,7 @@ rue_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
rue_tick(struct usb2_ether *ue)
|
||||
rue_tick(struct usb_ether *ue)
|
||||
{
|
||||
struct rue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct mii_data *mii = GET_MII(sc);
|
||||
@ -785,7 +785,7 @@ rue_tick(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
rue_start(struct usb2_ether *ue)
|
||||
rue_start(struct usb_ether *ue)
|
||||
{
|
||||
struct rue_softc *sc = usb2_ether_getsc(ue);
|
||||
|
||||
@ -798,7 +798,7 @@ rue_start(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
rue_init(struct usb2_ether *ue)
|
||||
rue_init(struct usb_ether *ue)
|
||||
{
|
||||
struct rue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
@ -874,7 +874,7 @@ rue_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
}
|
||||
|
||||
static void
|
||||
rue_stop(struct usb2_ether *ue)
|
||||
rue_stop(struct usb_ether *ue)
|
||||
{
|
||||
struct rue_softc *sc = usb2_ether_getsc(ue);
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
|
@ -170,9 +170,9 @@ enum {
|
||||
};
|
||||
|
||||
struct rue_softc {
|
||||
struct usb2_ether sc_ue;
|
||||
struct usb_ether sc_ue;
|
||||
struct mtx sc_mtx;
|
||||
struct usb2_xfer *sc_xfer[RUE_N_TRANSFER];
|
||||
struct usb_xfer *sc_xfer[RUE_N_TRANSFER];
|
||||
|
||||
int sc_flags;
|
||||
#define RUE_FLAG_LINK 0x0001
|
||||
|
@ -94,7 +94,7 @@ static miibus_readreg_t udav_miibus_readreg;
|
||||
static miibus_writereg_t udav_miibus_writereg;
|
||||
static miibus_statchg_t udav_miibus_statchg;
|
||||
|
||||
static const struct usb2_config udav_config[UDAV_N_TRANSFER] = {
|
||||
static const struct usb_config udav_config[UDAV_N_TRANSFER] = {
|
||||
|
||||
[UDAV_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -159,7 +159,7 @@ MODULE_DEPEND(udav, usb, 1, 1, 1);
|
||||
MODULE_DEPEND(udav, ether, 1, 1, 1);
|
||||
MODULE_DEPEND(udav, miibus, 1, 1, 1);
|
||||
|
||||
static const struct usb2_ether_methods udav_ue_methods = {
|
||||
static const struct usb_ether_methods udav_ue_methods = {
|
||||
.ue_attach_post = udav_attach_post,
|
||||
.ue_start = udav_start,
|
||||
.ue_init = udav_init,
|
||||
@ -185,7 +185,7 @@ SYSCTL_INT(_hw_usb_udav, OID_AUTO, debug, CTLFLAG_RW, &udav_debug, 0,
|
||||
#define UDAV_CLRBIT(sc, reg, x) \
|
||||
udav_csr_write1(sc, reg, udav_csr_read1(sc, reg) & ~(x))
|
||||
|
||||
static const struct usb2_device_id udav_devs[] = {
|
||||
static const struct usb_device_id udav_devs[] = {
|
||||
/* ShanTou DM9601 USB NIC */
|
||||
{USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_DM9601, 0)},
|
||||
/* ShanTou ST268 USB NIC */
|
||||
@ -195,7 +195,7 @@ static const struct usb2_device_id udav_devs[] = {
|
||||
};
|
||||
|
||||
static void
|
||||
udav_attach_post(struct usb2_ether *ue)
|
||||
udav_attach_post(struct usb_ether *ue)
|
||||
{
|
||||
struct udav_softc *sc = usb2_ether_getsc(ue);
|
||||
|
||||
@ -209,7 +209,7 @@ udav_attach_post(struct usb2_ether *ue)
|
||||
static int
|
||||
udav_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST)
|
||||
return (ENXIO);
|
||||
@ -224,9 +224,9 @@ udav_probe(device_t dev)
|
||||
static int
|
||||
udav_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct udav_softc *sc = device_get_softc(dev);
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
uint8_t iface_index;
|
||||
int error;
|
||||
|
||||
@ -267,7 +267,7 @@ static int
|
||||
udav_detach(device_t dev)
|
||||
{
|
||||
struct udav_softc *sc = device_get_softc(dev);
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
|
||||
usb2_transfer_unsetup(sc->sc_xfer, UDAV_N_TRANSFER);
|
||||
usb2_ether_ifdetach(ue);
|
||||
@ -281,7 +281,7 @@ static int
|
||||
udav_mem_read(struct udav_softc *sc, uint16_t offset, void *buf,
|
||||
int len)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
len &= 0xff;
|
||||
|
||||
@ -298,7 +298,7 @@ static int
|
||||
udav_mem_write(struct udav_softc *sc, uint16_t offset, void *buf,
|
||||
int len)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
len &= 0xff;
|
||||
|
||||
@ -315,7 +315,7 @@ static int
|
||||
udav_mem_write1(struct udav_softc *sc, uint16_t offset,
|
||||
uint8_t ch)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
req.bRequest = UDAV_REQ_MEM_WRITE1;
|
||||
@ -330,7 +330,7 @@ udav_mem_write1(struct udav_softc *sc, uint16_t offset,
|
||||
static int
|
||||
udav_csr_read(struct udav_softc *sc, uint16_t offset, void *buf, int len)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
len &= 0xff;
|
||||
|
||||
@ -346,7 +346,7 @@ udav_csr_read(struct udav_softc *sc, uint16_t offset, void *buf, int len)
|
||||
static int
|
||||
udav_csr_write(struct udav_softc *sc, uint16_t offset, void *buf, int len)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
offset &= 0xff;
|
||||
len &= 0xff;
|
||||
@ -373,7 +373,7 @@ static int
|
||||
udav_csr_write1(struct udav_softc *sc, uint16_t offset,
|
||||
uint8_t ch)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
offset &= 0xff;
|
||||
|
||||
@ -387,7 +387,7 @@ udav_csr_write1(struct udav_softc *sc, uint16_t offset,
|
||||
}
|
||||
|
||||
static void
|
||||
udav_init(struct usb2_ether *ue)
|
||||
udav_init(struct usb_ether *ue)
|
||||
{
|
||||
struct udav_softc *sc = ue->ue_sc;
|
||||
struct ifnet *ifp = usb2_ether_getifp(&sc->sc_ue);
|
||||
@ -459,7 +459,7 @@ udav_reset(struct udav_softc *sc)
|
||||
|
||||
#define UDAV_BITS 6
|
||||
static void
|
||||
udav_setmulti(struct usb2_ether *ue)
|
||||
udav_setmulti(struct usb_ether *ue)
|
||||
{
|
||||
struct udav_softc *sc = ue->ue_sc;
|
||||
struct ifnet *ifp = usb2_ether_getifp(&sc->sc_ue);
|
||||
@ -499,7 +499,7 @@ udav_setmulti(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
udav_setpromisc(struct usb2_ether *ue)
|
||||
udav_setpromisc(struct usb_ether *ue)
|
||||
{
|
||||
struct udav_softc *sc = ue->ue_sc;
|
||||
struct ifnet *ifp = usb2_ether_getifp(&sc->sc_ue);
|
||||
@ -518,7 +518,7 @@ udav_setpromisc(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
udav_start(struct usb2_ether *ue)
|
||||
udav_start(struct usb_ether *ue)
|
||||
{
|
||||
struct udav_softc *sc = ue->ue_sc;
|
||||
|
||||
@ -531,7 +531,7 @@ udav_start(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
udav_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
udav_bulk_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct udav_softc *sc = xfer->priv_sc;
|
||||
struct ifnet *ifp = usb2_ether_getifp(&sc->sc_ue);
|
||||
@ -614,10 +614,10 @@ udav_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
udav_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
udav_bulk_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct udav_softc *sc = xfer->priv_sc;
|
||||
struct usb2_ether *ue = &sc->sc_ue;
|
||||
struct usb_ether *ue = &sc->sc_ue;
|
||||
struct ifnet *ifp = usb2_ether_getifp(ue);
|
||||
struct udav_rxpkt stat;
|
||||
int len;
|
||||
@ -665,7 +665,7 @@ udav_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
udav_intr_callback(struct usb2_xfer *xfer)
|
||||
udav_intr_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
case USB_ST_TRANSFERRED:
|
||||
@ -686,7 +686,7 @@ udav_intr_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
udav_stop(struct usb2_ether *ue)
|
||||
udav_stop(struct usb_ether *ue)
|
||||
{
|
||||
struct udav_softc *sc = ue->ue_sc;
|
||||
struct ifnet *ifp = usb2_ether_getifp(&sc->sc_ue);
|
||||
@ -739,7 +739,7 @@ udav_ifmedia_status(struct ifnet *ifp, struct ifmediareq *ifmr)
|
||||
}
|
||||
|
||||
static void
|
||||
udav_tick(struct usb2_ether *ue)
|
||||
udav_tick(struct usb_ether *ue)
|
||||
{
|
||||
struct udav_softc *sc = ue->ue_sc;
|
||||
struct mii_data *mii = GET_MII(sc);
|
||||
|
@ -152,9 +152,9 @@ enum {
|
||||
};
|
||||
|
||||
struct udav_softc {
|
||||
struct usb2_ether sc_ue;
|
||||
struct usb_ether sc_ue;
|
||||
struct mtx sc_mtx;
|
||||
struct usb2_xfer *sc_xfer[UDAV_N_TRANSFER];
|
||||
struct usb_xfer *sc_xfer[UDAV_N_TRANSFER];
|
||||
|
||||
int sc_flags;
|
||||
#define UDAV_FLAG_LINK 0x0001
|
||||
|
@ -67,7 +67,7 @@ static void ue_watchdog(void *);
|
||||
* Else: device has been detached
|
||||
*/
|
||||
uint8_t
|
||||
usb2_ether_pause(struct usb2_ether *ue, unsigned int _ticks)
|
||||
usb2_ether_pause(struct usb_ether *ue, unsigned int _ticks)
|
||||
{
|
||||
if (usb2_proc_is_gone(&ue->ue_tq)) {
|
||||
/* nothing to do */
|
||||
@ -78,11 +78,11 @@ usb2_ether_pause(struct usb2_ether *ue, unsigned int _ticks)
|
||||
}
|
||||
|
||||
static void
|
||||
ue_queue_command(struct usb2_ether *ue,
|
||||
ue_queue_command(struct usb_ether *ue,
|
||||
usb2_proc_callback_t *fn,
|
||||
struct usb2_proc_msg *t0, struct usb2_proc_msg *t1)
|
||||
struct usb_proc_msg *t0, struct usb_proc_msg *t1)
|
||||
{
|
||||
struct usb2_ether_cfg_task *task;
|
||||
struct usb_ether_cfg_task *task;
|
||||
|
||||
UE_LOCK_ASSERT(ue, MA_OWNED);
|
||||
|
||||
@ -94,7 +94,7 @@ ue_queue_command(struct usb2_ether *ue,
|
||||
* "sc_mtx" mutex. It is safe to update fields in the message
|
||||
* structure after that the message got queued.
|
||||
*/
|
||||
task = (struct usb2_ether_cfg_task *)
|
||||
task = (struct usb_ether_cfg_task *)
|
||||
usb2_proc_msignal(&ue->ue_tq, t0, t1);
|
||||
|
||||
/* Setup callback and self pointers */
|
||||
@ -109,19 +109,19 @@ ue_queue_command(struct usb2_ether *ue,
|
||||
}
|
||||
|
||||
struct ifnet *
|
||||
usb2_ether_getifp(struct usb2_ether *ue)
|
||||
usb2_ether_getifp(struct usb_ether *ue)
|
||||
{
|
||||
return (ue->ue_ifp);
|
||||
}
|
||||
|
||||
struct mii_data *
|
||||
usb2_ether_getmii(struct usb2_ether *ue)
|
||||
usb2_ether_getmii(struct usb_ether *ue)
|
||||
{
|
||||
return (device_get_softc(ue->ue_miibus));
|
||||
}
|
||||
|
||||
void *
|
||||
usb2_ether_getsc(struct usb2_ether *ue)
|
||||
usb2_ether_getsc(struct usb_ether *ue)
|
||||
{
|
||||
return (ue->ue_sc);
|
||||
}
|
||||
@ -129,7 +129,7 @@ usb2_ether_getsc(struct usb2_ether *ue)
|
||||
static int
|
||||
ue_sysctl_parent(SYSCTL_HANDLER_ARGS)
|
||||
{
|
||||
struct usb2_ether *ue = arg1;
|
||||
struct usb_ether *ue = arg1;
|
||||
const char *name;
|
||||
|
||||
name = device_get_nameunit(ue->ue_dev);
|
||||
@ -137,7 +137,7 @@ ue_sysctl_parent(SYSCTL_HANDLER_ARGS)
|
||||
}
|
||||
|
||||
int
|
||||
usb2_ether_ifattach(struct usb2_ether *ue)
|
||||
usb2_ether_ifattach(struct usb_ether *ue)
|
||||
{
|
||||
int error;
|
||||
|
||||
@ -167,11 +167,11 @@ usb2_ether_ifattach(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
static void
|
||||
ue_attach_post_task(struct usb2_proc_msg *_task)
|
||||
ue_attach_post_task(struct usb_proc_msg *_task)
|
||||
{
|
||||
struct usb2_ether_cfg_task *task =
|
||||
(struct usb2_ether_cfg_task *)_task;
|
||||
struct usb2_ether *ue = task->ue;
|
||||
struct usb_ether_cfg_task *task =
|
||||
(struct usb_ether_cfg_task *)_task;
|
||||
struct usb_ether *ue = task->ue;
|
||||
struct ifnet *ifp;
|
||||
int error;
|
||||
char num[14]; /* sufficient for 32 bits */
|
||||
@ -244,7 +244,7 @@ ue_attach_post_task(struct usb2_proc_msg *_task)
|
||||
}
|
||||
|
||||
void
|
||||
usb2_ether_ifdetach(struct usb2_ether *ue)
|
||||
usb2_ether_ifdetach(struct usb_ether *ue)
|
||||
{
|
||||
struct ifnet *ifp;
|
||||
|
||||
@ -289,7 +289,7 @@ usb2_ether_ifdetach(struct usb2_ether *ue)
|
||||
}
|
||||
|
||||
uint8_t
|
||||
usb2_ether_is_gone(struct usb2_ether *ue)
|
||||
usb2_ether_is_gone(struct usb_ether *ue)
|
||||
{
|
||||
return (usb2_proc_is_gone(&ue->ue_tq));
|
||||
}
|
||||
@ -297,7 +297,7 @@ usb2_ether_is_gone(struct usb2_ether *ue)
|
||||
static void
|
||||
ue_init(void *arg)
|
||||
{
|
||||
struct usb2_ether *ue = arg;
|
||||
struct usb_ether *ue = arg;
|
||||
|
||||
UE_LOCK(ue);
|
||||
ue_queue_command(ue, ue_start_task,
|
||||
@ -307,11 +307,11 @@ ue_init(void *arg)
|
||||
}
|
||||
|
||||
static void
|
||||
ue_start_task(struct usb2_proc_msg *_task)
|
||||
ue_start_task(struct usb_proc_msg *_task)
|
||||
{
|
||||
struct usb2_ether_cfg_task *task =
|
||||
(struct usb2_ether_cfg_task *)_task;
|
||||
struct usb2_ether *ue = task->ue;
|
||||
struct usb_ether_cfg_task *task =
|
||||
(struct usb_ether_cfg_task *)_task;
|
||||
struct usb_ether *ue = task->ue;
|
||||
struct ifnet *ifp = ue->ue_ifp;
|
||||
|
||||
UE_LOCK_ASSERT(ue, MA_OWNED);
|
||||
@ -326,11 +326,11 @@ ue_start_task(struct usb2_proc_msg *_task)
|
||||
}
|
||||
|
||||
static void
|
||||
ue_stop_task(struct usb2_proc_msg *_task)
|
||||
ue_stop_task(struct usb_proc_msg *_task)
|
||||
{
|
||||
struct usb2_ether_cfg_task *task =
|
||||
(struct usb2_ether_cfg_task *)_task;
|
||||
struct usb2_ether *ue = task->ue;
|
||||
struct usb_ether_cfg_task *task =
|
||||
(struct usb_ether_cfg_task *)_task;
|
||||
struct usb_ether *ue = task->ue;
|
||||
|
||||
UE_LOCK_ASSERT(ue, MA_OWNED);
|
||||
|
||||
@ -342,7 +342,7 @@ ue_stop_task(struct usb2_proc_msg *_task)
|
||||
static void
|
||||
ue_start(struct ifnet *ifp)
|
||||
{
|
||||
struct usb2_ether *ue = ifp->if_softc;
|
||||
struct usb_ether *ue = ifp->if_softc;
|
||||
|
||||
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
|
||||
return;
|
||||
@ -353,21 +353,21 @@ ue_start(struct ifnet *ifp)
|
||||
}
|
||||
|
||||
static void
|
||||
ue_promisc_task(struct usb2_proc_msg *_task)
|
||||
ue_promisc_task(struct usb_proc_msg *_task)
|
||||
{
|
||||
struct usb2_ether_cfg_task *task =
|
||||
(struct usb2_ether_cfg_task *)_task;
|
||||
struct usb2_ether *ue = task->ue;
|
||||
struct usb_ether_cfg_task *task =
|
||||
(struct usb_ether_cfg_task *)_task;
|
||||
struct usb_ether *ue = task->ue;
|
||||
|
||||
ue->ue_methods->ue_setpromisc(ue);
|
||||
}
|
||||
|
||||
static void
|
||||
ue_setmulti_task(struct usb2_proc_msg *_task)
|
||||
ue_setmulti_task(struct usb_proc_msg *_task)
|
||||
{
|
||||
struct usb2_ether_cfg_task *task =
|
||||
(struct usb2_ether_cfg_task *)_task;
|
||||
struct usb2_ether *ue = task->ue;
|
||||
struct usb_ether_cfg_task *task =
|
||||
(struct usb_ether_cfg_task *)_task;
|
||||
struct usb_ether *ue = task->ue;
|
||||
|
||||
ue->ue_methods->ue_setmulti(ue);
|
||||
}
|
||||
@ -375,7 +375,7 @@ ue_setmulti_task(struct usb2_proc_msg *_task)
|
||||
static int
|
||||
ue_ifmedia_upd(struct ifnet *ifp)
|
||||
{
|
||||
struct usb2_ether *ue = ifp->if_softc;
|
||||
struct usb_ether *ue = ifp->if_softc;
|
||||
|
||||
/* Defer to process context */
|
||||
UE_LOCK(ue);
|
||||
@ -388,11 +388,11 @@ ue_ifmedia_upd(struct ifnet *ifp)
|
||||
}
|
||||
|
||||
static void
|
||||
ue_ifmedia_task(struct usb2_proc_msg *_task)
|
||||
ue_ifmedia_task(struct usb_proc_msg *_task)
|
||||
{
|
||||
struct usb2_ether_cfg_task *task =
|
||||
(struct usb2_ether_cfg_task *)_task;
|
||||
struct usb2_ether *ue = task->ue;
|
||||
struct usb_ether_cfg_task *task =
|
||||
(struct usb_ether_cfg_task *)_task;
|
||||
struct usb_ether *ue = task->ue;
|
||||
struct ifnet *ifp = ue->ue_ifp;
|
||||
|
||||
ue->ue_methods->ue_mii_upd(ifp);
|
||||
@ -401,7 +401,7 @@ ue_ifmedia_task(struct usb2_proc_msg *_task)
|
||||
static void
|
||||
ue_watchdog(void *arg)
|
||||
{
|
||||
struct usb2_ether *ue = arg;
|
||||
struct usb_ether *ue = arg;
|
||||
struct ifnet *ifp = ue->ue_ifp;
|
||||
|
||||
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
|
||||
@ -415,11 +415,11 @@ ue_watchdog(void *arg)
|
||||
}
|
||||
|
||||
static void
|
||||
ue_tick_task(struct usb2_proc_msg *_task)
|
||||
ue_tick_task(struct usb_proc_msg *_task)
|
||||
{
|
||||
struct usb2_ether_cfg_task *task =
|
||||
(struct usb2_ether_cfg_task *)_task;
|
||||
struct usb2_ether *ue = task->ue;
|
||||
struct usb_ether_cfg_task *task =
|
||||
(struct usb_ether_cfg_task *)_task;
|
||||
struct usb_ether *ue = task->ue;
|
||||
struct ifnet *ifp = ue->ue_ifp;
|
||||
|
||||
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
|
||||
@ -431,7 +431,7 @@ ue_tick_task(struct usb2_proc_msg *_task)
|
||||
int
|
||||
usb2_ether_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
||||
{
|
||||
struct usb2_ether *ue = ifp->if_softc;
|
||||
struct usb_ether *ue = ifp->if_softc;
|
||||
struct ifreq *ifr = (struct ifreq *)data;
|
||||
struct mii_data *mii;
|
||||
int error = 0;
|
||||
@ -514,7 +514,7 @@ usb2_ether_newbuf(void)
|
||||
}
|
||||
|
||||
int
|
||||
usb2_ether_rxmbuf(struct usb2_ether *ue, struct mbuf *m,
|
||||
usb2_ether_rxmbuf(struct usb_ether *ue, struct mbuf *m,
|
||||
unsigned int len)
|
||||
{
|
||||
struct ifnet *ifp = ue->ue_ifp;
|
||||
@ -532,7 +532,7 @@ usb2_ether_rxmbuf(struct usb2_ether *ue, struct mbuf *m,
|
||||
}
|
||||
|
||||
int
|
||||
usb2_ether_rxbuf(struct usb2_ether *ue, struct usb2_page_cache *pc,
|
||||
usb2_ether_rxbuf(struct usb_ether *ue, struct usb_page_cache *pc,
|
||||
unsigned int offset, unsigned int len)
|
||||
{
|
||||
struct ifnet *ifp = ue->ue_ifp;
|
||||
@ -562,7 +562,7 @@ usb2_ether_rxbuf(struct usb2_ether *ue, struct usb2_page_cache *pc,
|
||||
}
|
||||
|
||||
void
|
||||
usb2_ether_rxflush(struct usb2_ether *ue)
|
||||
usb2_ether_rxflush(struct usb_ether *ue)
|
||||
{
|
||||
struct ifnet *ifp = ue->ue_ifp;
|
||||
struct mbuf *m;
|
||||
|
@ -49,12 +49,12 @@
|
||||
#include <dev/mii/mii.h>
|
||||
#include <dev/mii/miivar.h>
|
||||
|
||||
struct usb2_ether;
|
||||
struct usb2_device_request;
|
||||
struct usb_ether;
|
||||
struct usb_device_request;
|
||||
|
||||
typedef void (usb2_ether_fn_t)(struct usb2_ether *);
|
||||
typedef void (usb2_ether_fn_t)(struct usb_ether *);
|
||||
|
||||
struct usb2_ether_methods {
|
||||
struct usb_ether_methods {
|
||||
usb2_ether_fn_t *ue_attach_post;
|
||||
usb2_ether_fn_t *ue_start;
|
||||
usb2_ether_fn_t *ue_init;
|
||||
@ -69,31 +69,31 @@ struct usb2_ether_methods {
|
||||
|
||||
};
|
||||
|
||||
struct usb2_ether_cfg_task {
|
||||
struct usb2_proc_msg hdr;
|
||||
struct usb2_ether *ue;
|
||||
struct usb_ether_cfg_task {
|
||||
struct usb_proc_msg hdr;
|
||||
struct usb_ether *ue;
|
||||
};
|
||||
|
||||
struct usb2_ether {
|
||||
struct usb_ether {
|
||||
/* NOTE: the "ue_ifp" pointer must be first --hps */
|
||||
struct ifnet *ue_ifp;
|
||||
struct mtx *ue_mtx;
|
||||
const struct usb2_ether_methods *ue_methods;
|
||||
const struct usb_ether_methods *ue_methods;
|
||||
struct sysctl_oid *ue_sysctl_oid;
|
||||
void *ue_sc;
|
||||
struct usb2_device *ue_udev; /* used by usb2_ether_do_request() */
|
||||
struct usb_device *ue_udev; /* used by usb2_ether_do_request() */
|
||||
device_t ue_dev;
|
||||
device_t ue_miibus;
|
||||
|
||||
struct usb2_process ue_tq;
|
||||
struct usb_process ue_tq;
|
||||
struct sysctl_ctx_list ue_sysctl_ctx;
|
||||
struct ifqueue ue_rxq;
|
||||
struct usb2_callout ue_watchdog;
|
||||
struct usb2_ether_cfg_task ue_sync_task[2];
|
||||
struct usb2_ether_cfg_task ue_media_task[2];
|
||||
struct usb2_ether_cfg_task ue_multi_task[2];
|
||||
struct usb2_ether_cfg_task ue_promisc_task[2];
|
||||
struct usb2_ether_cfg_task ue_tick_task[2];
|
||||
struct usb_callout ue_watchdog;
|
||||
struct usb_ether_cfg_task ue_sync_task[2];
|
||||
struct usb_ether_cfg_task ue_media_task[2];
|
||||
struct usb_ether_cfg_task ue_multi_task[2];
|
||||
struct usb_ether_cfg_task ue_promisc_task[2];
|
||||
struct usb_ether_cfg_task ue_tick_task[2];
|
||||
|
||||
int ue_unit;
|
||||
|
||||
@ -104,19 +104,19 @@ struct usb2_ether {
|
||||
#define usb2_ether_do_request(ue,req,data,timo) \
|
||||
usb2_do_request_proc((ue)->ue_udev,&(ue)->ue_tq,req,data,0,NULL,timo)
|
||||
|
||||
uint8_t usb2_ether_pause(struct usb2_ether *, unsigned int);
|
||||
struct ifnet *usb2_ether_getifp(struct usb2_ether *);
|
||||
struct mii_data *usb2_ether_getmii(struct usb2_ether *);
|
||||
void *usb2_ether_getsc(struct usb2_ether *);
|
||||
int usb2_ether_ifattach(struct usb2_ether *);
|
||||
void usb2_ether_ifdetach(struct usb2_ether *);
|
||||
uint8_t usb2_ether_pause(struct usb_ether *, unsigned int);
|
||||
struct ifnet *usb2_ether_getifp(struct usb_ether *);
|
||||
struct mii_data *usb2_ether_getmii(struct usb_ether *);
|
||||
void *usb2_ether_getsc(struct usb_ether *);
|
||||
int usb2_ether_ifattach(struct usb_ether *);
|
||||
void usb2_ether_ifdetach(struct usb_ether *);
|
||||
int usb2_ether_ioctl(struct ifnet *, u_long, caddr_t);
|
||||
struct mbuf *usb2_ether_newbuf(void);
|
||||
int usb2_ether_rxmbuf(struct usb2_ether *, struct mbuf *,
|
||||
int usb2_ether_rxmbuf(struct usb_ether *, struct mbuf *,
|
||||
unsigned int);
|
||||
int usb2_ether_rxbuf(struct usb2_ether *,
|
||||
struct usb2_page_cache *,
|
||||
int usb2_ether_rxbuf(struct usb_ether *,
|
||||
struct usb_page_cache *,
|
||||
unsigned int, unsigned int);
|
||||
void usb2_ether_rxflush(struct usb2_ether *);
|
||||
uint8_t usb2_ether_is_gone(struct usb2_ether *);
|
||||
void usb2_ether_rxflush(struct usb_ether *);
|
||||
uint8_t usb2_ether_is_gone(struct usb_ether *);
|
||||
#endif /* _USB2_ETHERNET_H_ */
|
||||
|
@ -156,7 +156,7 @@ usb2_quirkstr(uint16_t quirk)
|
||||
* Else: Quirk found
|
||||
*------------------------------------------------------------------------*/
|
||||
static uint8_t
|
||||
usb2_test_quirk_by_info(const struct usb2_lookup_info *info, uint16_t quirk)
|
||||
usb2_test_quirk_by_info(const struct usb_lookup_info *info, uint16_t quirk)
|
||||
{
|
||||
uint16_t x;
|
||||
uint16_t y;
|
||||
@ -249,7 +249,7 @@ static int
|
||||
usb2_quirk_ioctl(unsigned long cmd, caddr_t data,
|
||||
int fflag, struct thread *td)
|
||||
{
|
||||
struct usb2_gen_quirk *pgq;
|
||||
struct usb_gen_quirk *pgq;
|
||||
struct usb2_quirk_entry *pqe;
|
||||
uint32_t x;
|
||||
uint32_t y;
|
||||
|
@ -83,11 +83,11 @@ enum {
|
||||
};
|
||||
|
||||
struct u3g_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom[U3G_MAXPORTS];
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom[U3G_MAXPORTS];
|
||||
|
||||
struct usb2_xfer *sc_xfer[U3G_MAXPORTS][U3G_N_TRANSFER];
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[U3G_MAXPORTS][U3G_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
uint8_t sc_lsr; /* local status register */
|
||||
@ -102,14 +102,14 @@ static device_detach_t u3g_detach;
|
||||
static usb2_callback_t u3g_write_callback;
|
||||
static usb2_callback_t u3g_read_callback;
|
||||
|
||||
static void u3g_start_read(struct usb2_com_softc *ucom);
|
||||
static void u3g_stop_read(struct usb2_com_softc *ucom);
|
||||
static void u3g_start_write(struct usb2_com_softc *ucom);
|
||||
static void u3g_stop_write(struct usb2_com_softc *ucom);
|
||||
static void u3g_start_read(struct ucom_softc *ucom);
|
||||
static void u3g_stop_read(struct ucom_softc *ucom);
|
||||
static void u3g_start_write(struct ucom_softc *ucom);
|
||||
static void u3g_stop_write(struct ucom_softc *ucom);
|
||||
|
||||
static int u3g_driver_loaded(struct module *mod, int what, void *arg);
|
||||
|
||||
static const struct usb2_config u3g_config[U3G_N_TRANSFER] = {
|
||||
static const struct usb_config u3g_config[U3G_N_TRANSFER] = {
|
||||
|
||||
[U3G_BULK_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -130,7 +130,7 @@ static const struct usb2_config u3g_config[U3G_N_TRANSFER] = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_com_callback u3g_callback = {
|
||||
static const struct ucom_callback u3g_callback = {
|
||||
.usb2_com_start_read = &u3g_start_read,
|
||||
.usb2_com_stop_read = &u3g_stop_read,
|
||||
.usb2_com_start_write = &u3g_start_write,
|
||||
@ -156,7 +156,7 @@ DRIVER_MODULE(u3g, uhub, u3g_driver, u3g_devclass, u3g_driver_loaded, 0);
|
||||
MODULE_DEPEND(u3g, ucom, 1, 1, 1);
|
||||
MODULE_DEPEND(u3g, usb, 1, 1, 1);
|
||||
|
||||
static const struct usb2_device_id u3g_devs[] = {
|
||||
static const struct usb_device_id u3g_devs[] = {
|
||||
#define U3G_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) }
|
||||
/* OEM: Option */
|
||||
U3G_DEV(OPTION, GT3G, 0),
|
||||
@ -226,9 +226,9 @@ static const struct usb2_device_id u3g_devs[] = {
|
||||
};
|
||||
|
||||
static void
|
||||
u3g_sierra_init(struct usb2_device *udev)
|
||||
u3g_sierra_init(struct usb_device *udev)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
DPRINTFN(0, "\n");
|
||||
|
||||
@ -246,9 +246,9 @@ u3g_sierra_init(struct usb2_device *udev)
|
||||
}
|
||||
|
||||
static void
|
||||
u3g_huawei_init(struct usb2_device *udev)
|
||||
u3g_huawei_init(struct usb_device *udev)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
DPRINTFN(0, "\n");
|
||||
|
||||
@ -266,7 +266,7 @@ u3g_huawei_init(struct usb2_device *udev)
|
||||
}
|
||||
|
||||
static void
|
||||
u3g_sael_m460_init(struct usb2_device *udev)
|
||||
u3g_sael_m460_init(struct usb_device *udev)
|
||||
{
|
||||
static const uint8_t setup[][24] = {
|
||||
{ 0x41, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
@ -298,7 +298,7 @@ u3g_sael_m460_init(struct usb2_device *udev)
|
||||
{ 0x41, 0x07, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00 },
|
||||
};
|
||||
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
uint16_t len;
|
||||
uint8_t buf[0x300];
|
||||
@ -346,7 +346,7 @@ u3g_sael_m460_init(struct usb2_device *udev)
|
||||
}
|
||||
|
||||
static int
|
||||
u3g_lookup_huawei(struct usb2_attach_arg *uaa)
|
||||
u3g_lookup_huawei(struct usb_attach_arg *uaa)
|
||||
{
|
||||
/* Calling the lookup function will also set the driver info! */
|
||||
return (usb2_lookup_id_by_uaa(u3g_devs, sizeof(u3g_devs), uaa));
|
||||
@ -359,11 +359,11 @@ u3g_lookup_huawei(struct usb2_attach_arg *uaa)
|
||||
* to a modem.
|
||||
*/
|
||||
static usb2_error_t
|
||||
u3g_test_huawei_autoinst(struct usb2_device *udev,
|
||||
struct usb2_attach_arg *uaa)
|
||||
u3g_test_huawei_autoinst(struct usb_device *udev,
|
||||
struct usb_attach_arg *uaa)
|
||||
{
|
||||
struct usb2_interface *iface;
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb_interface *iface;
|
||||
struct usb_interface_descriptor *id;
|
||||
uint32_t flags;
|
||||
|
||||
if (udev == NULL) {
|
||||
@ -419,7 +419,7 @@ u3g_driver_loaded(struct module *mod, int what, void *arg)
|
||||
static int
|
||||
u3g_probe(device_t self)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(self);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(self);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
return (ENXIO);
|
||||
@ -436,11 +436,11 @@ u3g_probe(device_t self)
|
||||
static int
|
||||
u3g_attach(device_t dev)
|
||||
{
|
||||
struct usb2_config u3g_config_tmp[U3G_N_TRANSFER];
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_config u3g_config_tmp[U3G_N_TRANSFER];
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct u3g_softc *sc = device_get_softc(dev);
|
||||
struct usb2_interface *iface;
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb_interface *iface;
|
||||
struct usb_interface_descriptor *id;
|
||||
uint32_t iface_valid;
|
||||
int error, flags, nports;
|
||||
int ep, n;
|
||||
@ -550,7 +550,7 @@ u3g_detach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
u3g_start_read(struct usb2_com_softc *ucom)
|
||||
u3g_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct u3g_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -560,7 +560,7 @@ u3g_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
u3g_stop_read(struct usb2_com_softc *ucom)
|
||||
u3g_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct u3g_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -570,7 +570,7 @@ u3g_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
u3g_start_write(struct usb2_com_softc *ucom)
|
||||
u3g_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct u3g_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -579,7 +579,7 @@ u3g_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
u3g_stop_write(struct usb2_com_softc *ucom)
|
||||
u3g_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct u3g_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -588,9 +588,9 @@ u3g_stop_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
u3g_write_callback(struct usb2_xfer *xfer)
|
||||
u3g_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_com_softc *ucom = xfer->priv_sc;
|
||||
struct ucom_softc *ucom = xfer->priv_sc;
|
||||
uint32_t actlen;
|
||||
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
@ -616,9 +616,9 @@ u3g_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
u3g_read_callback(struct usb2_xfer *xfer)
|
||||
u3g_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_com_softc *ucom = xfer->priv_sc;
|
||||
struct ucom_softc *ucom = xfer->priv_sc;
|
||||
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
case USB_ST_TRANSFERRED:
|
||||
|
@ -68,11 +68,11 @@ enum {
|
||||
};
|
||||
|
||||
struct uark_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom;
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom;
|
||||
|
||||
struct usb2_xfer *sc_xfer[UARK_N_TRANSFER];
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[UARK_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
uint8_t sc_msr;
|
||||
@ -88,18 +88,18 @@ static device_detach_t uark_detach;
|
||||
static usb2_callback_t uark_bulk_write_callback;
|
||||
static usb2_callback_t uark_bulk_read_callback;
|
||||
|
||||
static void uark_start_read(struct usb2_com_softc *);
|
||||
static void uark_stop_read(struct usb2_com_softc *);
|
||||
static void uark_start_write(struct usb2_com_softc *);
|
||||
static void uark_stop_write(struct usb2_com_softc *);
|
||||
static int uark_pre_param(struct usb2_com_softc *, struct termios *);
|
||||
static void uark_cfg_param(struct usb2_com_softc *, struct termios *);
|
||||
static void uark_cfg_get_status(struct usb2_com_softc *, uint8_t *,
|
||||
static void uark_start_read(struct ucom_softc *);
|
||||
static void uark_stop_read(struct ucom_softc *);
|
||||
static void uark_start_write(struct ucom_softc *);
|
||||
static void uark_stop_write(struct ucom_softc *);
|
||||
static int uark_pre_param(struct ucom_softc *, struct termios *);
|
||||
static void uark_cfg_param(struct ucom_softc *, struct termios *);
|
||||
static void uark_cfg_get_status(struct ucom_softc *, uint8_t *,
|
||||
uint8_t *);
|
||||
static void uark_cfg_set_break(struct usb2_com_softc *, uint8_t);
|
||||
static void uark_cfg_set_break(struct ucom_softc *, uint8_t);
|
||||
static void uark_cfg_write(struct uark_softc *, uint16_t, uint16_t);
|
||||
|
||||
static const struct usb2_config
|
||||
static const struct usb_config
|
||||
uark_xfer_config[UARK_N_TRANSFER] = {
|
||||
|
||||
[UARK_BULK_DT_WR] = {
|
||||
@ -121,7 +121,7 @@ static const struct usb2_config
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_com_callback uark_callback = {
|
||||
static const struct ucom_callback uark_callback = {
|
||||
.usb2_com_cfg_get_status = &uark_cfg_get_status,
|
||||
.usb2_com_cfg_set_break = &uark_cfg_set_break,
|
||||
.usb2_com_cfg_param = &uark_cfg_param,
|
||||
@ -152,14 +152,14 @@ DRIVER_MODULE(uark, uhub, uark_driver, uark_devclass, NULL, 0);
|
||||
MODULE_DEPEND(uark, ucom, 1, 1, 1);
|
||||
MODULE_DEPEND(uark, usb, 1, 1, 1);
|
||||
|
||||
static const struct usb2_device_id uark_devs[] = {
|
||||
static const struct usb_device_id uark_devs[] = {
|
||||
{USB_VPI(USB_VENDOR_ARKMICRO, USB_PRODUCT_ARKMICRO_ARK3116, 0)},
|
||||
};
|
||||
|
||||
static int
|
||||
uark_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
return (ENXIO);
|
||||
@ -176,7 +176,7 @@ uark_probe(device_t dev)
|
||||
static int
|
||||
uark_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct uark_softc *sc = device_get_softc(dev);
|
||||
int32_t error;
|
||||
uint8_t iface_index;
|
||||
@ -228,7 +228,7 @@ uark_detach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
uark_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
uark_bulk_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uark_softc *sc = xfer->priv_sc;
|
||||
uint32_t actlen;
|
||||
@ -256,7 +256,7 @@ uark_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uark_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
uark_bulk_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uark_softc *sc = xfer->priv_sc;
|
||||
|
||||
@ -282,7 +282,7 @@ uark_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uark_start_read(struct usb2_com_softc *ucom)
|
||||
uark_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uark_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -290,7 +290,7 @@ uark_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uark_stop_read(struct usb2_com_softc *ucom)
|
||||
uark_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uark_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -298,7 +298,7 @@ uark_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uark_start_write(struct usb2_com_softc *ucom)
|
||||
uark_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uark_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -306,7 +306,7 @@ uark_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uark_stop_write(struct usb2_com_softc *ucom)
|
||||
uark_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uark_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -314,7 +314,7 @@ uark_stop_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static int
|
||||
uark_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
uark_pre_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
if ((t->c_ospeed < 300) || (t->c_ospeed > 115200))
|
||||
return (EINVAL);
|
||||
@ -322,7 +322,7 @@ uark_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
uark_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
uark_cfg_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
struct uark_softc *sc = ucom->sc_parent;
|
||||
uint32_t speed = t->c_ospeed;
|
||||
@ -372,7 +372,7 @@ uark_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
uark_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
uark_cfg_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
{
|
||||
struct uark_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -381,7 +381,7 @@ uark_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
}
|
||||
|
||||
static void
|
||||
uark_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uark_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uark_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -393,7 +393,7 @@ uark_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
static void
|
||||
uark_cfg_write(struct uark_softc *sc, uint16_t index, uint16_t value)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
|
||||
req.bmRequestType = UARK_WRITE;
|
||||
|
@ -148,11 +148,11 @@ enum {
|
||||
};
|
||||
|
||||
struct ubsa_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom;
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom;
|
||||
|
||||
struct usb2_xfer *sc_xfer[UBSA_N_TRANSFER];
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[UBSA_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
uint8_t sc_iface_no; /* interface number */
|
||||
@ -170,19 +170,19 @@ static usb2_callback_t ubsa_read_callback;
|
||||
static usb2_callback_t ubsa_intr_callback;
|
||||
|
||||
static void ubsa_cfg_request(struct ubsa_softc *, uint8_t, uint16_t);
|
||||
static void ubsa_cfg_set_dtr(struct usb2_com_softc *, uint8_t);
|
||||
static void ubsa_cfg_set_rts(struct usb2_com_softc *, uint8_t);
|
||||
static void ubsa_cfg_set_break(struct usb2_com_softc *, uint8_t);
|
||||
static int ubsa_pre_param(struct usb2_com_softc *, struct termios *);
|
||||
static void ubsa_cfg_param(struct usb2_com_softc *, struct termios *);
|
||||
static void ubsa_start_read(struct usb2_com_softc *);
|
||||
static void ubsa_stop_read(struct usb2_com_softc *);
|
||||
static void ubsa_start_write(struct usb2_com_softc *);
|
||||
static void ubsa_stop_write(struct usb2_com_softc *);
|
||||
static void ubsa_cfg_get_status(struct usb2_com_softc *, uint8_t *,
|
||||
static void ubsa_cfg_set_dtr(struct ucom_softc *, uint8_t);
|
||||
static void ubsa_cfg_set_rts(struct ucom_softc *, uint8_t);
|
||||
static void ubsa_cfg_set_break(struct ucom_softc *, uint8_t);
|
||||
static int ubsa_pre_param(struct ucom_softc *, struct termios *);
|
||||
static void ubsa_cfg_param(struct ucom_softc *, struct termios *);
|
||||
static void ubsa_start_read(struct ucom_softc *);
|
||||
static void ubsa_stop_read(struct ucom_softc *);
|
||||
static void ubsa_start_write(struct ucom_softc *);
|
||||
static void ubsa_stop_write(struct ucom_softc *);
|
||||
static void ubsa_cfg_get_status(struct ucom_softc *, uint8_t *,
|
||||
uint8_t *);
|
||||
|
||||
static const struct usb2_config ubsa_config[UBSA_N_TRANSFER] = {
|
||||
static const struct usb_config ubsa_config[UBSA_N_TRANSFER] = {
|
||||
|
||||
[UBSA_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -212,7 +212,7 @@ static const struct usb2_config ubsa_config[UBSA_N_TRANSFER] = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_com_callback ubsa_callback = {
|
||||
static const struct ucom_callback ubsa_callback = {
|
||||
.usb2_com_cfg_get_status = &ubsa_cfg_get_status,
|
||||
.usb2_com_cfg_set_dtr = &ubsa_cfg_set_dtr,
|
||||
.usb2_com_cfg_set_rts = &ubsa_cfg_set_rts,
|
||||
@ -225,7 +225,7 @@ static const struct usb2_com_callback ubsa_callback = {
|
||||
.usb2_com_stop_write = &ubsa_stop_write,
|
||||
};
|
||||
|
||||
static const struct usb2_device_id ubsa_devs[] = {
|
||||
static const struct usb_device_id ubsa_devs[] = {
|
||||
/* AnyData ADU-500A */
|
||||
{USB_VPI(USB_VENDOR_ANYDATA, USB_PRODUCT_ANYDATA_ADU_500A, 0)},
|
||||
/* AnyData ADU-E100A/H */
|
||||
@ -266,7 +266,7 @@ MODULE_DEPEND(ubsa, usb, 1, 1, 1);
|
||||
static int
|
||||
ubsa_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
return (ENXIO);
|
||||
@ -283,7 +283,7 @@ ubsa_probe(device_t dev)
|
||||
static int
|
||||
ubsa_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct ubsa_softc *sc = device_get_softc(dev);
|
||||
int error;
|
||||
|
||||
@ -339,7 +339,7 @@ ubsa_detach(device_t dev)
|
||||
static void
|
||||
ubsa_cfg_request(struct ubsa_softc *sc, uint8_t index, uint16_t value)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
@ -358,7 +358,7 @@ ubsa_cfg_request(struct ubsa_softc *sc, uint8_t index, uint16_t value)
|
||||
}
|
||||
|
||||
static void
|
||||
ubsa_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
ubsa_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct ubsa_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -368,7 +368,7 @@ ubsa_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
ubsa_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
ubsa_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct ubsa_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -378,7 +378,7 @@ ubsa_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
ubsa_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
ubsa_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct ubsa_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -388,7 +388,7 @@ ubsa_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static int
|
||||
ubsa_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
ubsa_pre_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
struct ubsa_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -415,7 +415,7 @@ ubsa_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
ubsa_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
ubsa_cfg_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
struct ubsa_softc *sc = ucom->sc_parent;
|
||||
uint16_t value = 0;
|
||||
@ -486,7 +486,7 @@ ubsa_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
ubsa_start_read(struct usb2_com_softc *ucom)
|
||||
ubsa_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ubsa_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -498,7 +498,7 @@ ubsa_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ubsa_stop_read(struct usb2_com_softc *ucom)
|
||||
ubsa_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ubsa_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -510,7 +510,7 @@ ubsa_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ubsa_start_write(struct usb2_com_softc *ucom)
|
||||
ubsa_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ubsa_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -518,7 +518,7 @@ ubsa_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ubsa_stop_write(struct usb2_com_softc *ucom)
|
||||
ubsa_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ubsa_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -526,7 +526,7 @@ ubsa_stop_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ubsa_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
ubsa_cfg_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
{
|
||||
struct ubsa_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -537,7 +537,7 @@ ubsa_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
}
|
||||
|
||||
static void
|
||||
ubsa_write_callback(struct usb2_xfer *xfer)
|
||||
ubsa_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ubsa_softc *sc = xfer->priv_sc;
|
||||
uint32_t actlen;
|
||||
@ -566,7 +566,7 @@ ubsa_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ubsa_read_callback(struct usb2_xfer *xfer)
|
||||
ubsa_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ubsa_softc *sc = xfer->priv_sc;
|
||||
|
||||
@ -592,7 +592,7 @@ ubsa_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ubsa_intr_callback(struct usb2_xfer *xfer)
|
||||
ubsa_intr_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ubsa_softc *sc = xfer->priv_sc;
|
||||
uint8_t buf[4];
|
||||
|
@ -116,11 +116,11 @@ enum {
|
||||
};
|
||||
|
||||
struct ubser_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom[UBSER_UNIT_MAX];
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom[UBSER_UNIT_MAX];
|
||||
|
||||
struct usb2_xfer *sc_xfer[UBSER_N_TRANSFER];
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[UBSER_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
uint16_t sc_tx_size;
|
||||
@ -141,16 +141,16 @@ static device_detach_t ubser_detach;
|
||||
static usb2_callback_t ubser_write_callback;
|
||||
static usb2_callback_t ubser_read_callback;
|
||||
|
||||
static int ubser_pre_param(struct usb2_com_softc *, struct termios *);
|
||||
static void ubser_cfg_set_break(struct usb2_com_softc *, uint8_t);
|
||||
static void ubser_cfg_get_status(struct usb2_com_softc *, uint8_t *,
|
||||
static int ubser_pre_param(struct ucom_softc *, struct termios *);
|
||||
static void ubser_cfg_set_break(struct ucom_softc *, uint8_t);
|
||||
static void ubser_cfg_get_status(struct ucom_softc *, uint8_t *,
|
||||
uint8_t *);
|
||||
static void ubser_start_read(struct usb2_com_softc *);
|
||||
static void ubser_stop_read(struct usb2_com_softc *);
|
||||
static void ubser_start_write(struct usb2_com_softc *);
|
||||
static void ubser_stop_write(struct usb2_com_softc *);
|
||||
static void ubser_start_read(struct ucom_softc *);
|
||||
static void ubser_stop_read(struct ucom_softc *);
|
||||
static void ubser_start_write(struct ucom_softc *);
|
||||
static void ubser_stop_write(struct ucom_softc *);
|
||||
|
||||
static const struct usb2_config ubser_config[UBSER_N_TRANSFER] = {
|
||||
static const struct usb_config ubser_config[UBSER_N_TRANSFER] = {
|
||||
|
||||
[UBSER_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -171,7 +171,7 @@ static const struct usb2_config ubser_config[UBSER_N_TRANSFER] = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_com_callback ubser_callback = {
|
||||
static const struct ucom_callback ubser_callback = {
|
||||
.usb2_com_cfg_set_break = &ubser_cfg_set_break,
|
||||
.usb2_com_cfg_get_status = &ubser_cfg_get_status,
|
||||
.usb2_com_pre_param = &ubser_pre_param,
|
||||
@ -203,7 +203,7 @@ MODULE_DEPEND(ubser, usb, 1, 1, 1);
|
||||
static int
|
||||
ubser_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
return (ENXIO);
|
||||
@ -220,9 +220,9 @@ ubser_probe(device_t dev)
|
||||
static int
|
||||
ubser_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct ubser_softc *sc = device_get_softc(dev);
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint8_t n;
|
||||
int error;
|
||||
|
||||
@ -309,7 +309,7 @@ ubser_detach(device_t dev)
|
||||
}
|
||||
|
||||
static int
|
||||
ubser_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
ubser_pre_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
DPRINTF("\n");
|
||||
|
||||
@ -367,7 +367,7 @@ ubser_inc_tx_unit(struct ubser_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
ubser_write_callback(struct usb2_xfer *xfer)
|
||||
ubser_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ubser_softc *sc = xfer->priv_sc;
|
||||
uint8_t buf[1];
|
||||
@ -412,7 +412,7 @@ ubser_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ubser_read_callback(struct usb2_xfer *xfer)
|
||||
ubser_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ubser_softc *sc = xfer->priv_sc;
|
||||
uint8_t buf[1];
|
||||
@ -450,11 +450,11 @@ ubser_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ubser_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
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 usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
|
||||
if (onoff) {
|
||||
@ -477,7 +477,7 @@ ubser_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
ubser_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
ubser_cfg_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
{
|
||||
/* fake status bits */
|
||||
*lsr = 0;
|
||||
@ -485,7 +485,7 @@ ubser_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
}
|
||||
|
||||
static void
|
||||
ubser_start_read(struct usb2_com_softc *ucom)
|
||||
ubser_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ubser_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -493,7 +493,7 @@ ubser_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ubser_stop_read(struct usb2_com_softc *ucom)
|
||||
ubser_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ubser_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -501,7 +501,7 @@ ubser_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ubser_start_write(struct usb2_com_softc *ucom)
|
||||
ubser_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ubser_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -509,7 +509,7 @@ ubser_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ubser_stop_write(struct usb2_com_softc *ucom)
|
||||
ubser_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ubser_softc *sc = ucom->sc_parent;
|
||||
|
||||
|
@ -153,11 +153,11 @@ enum {
|
||||
};
|
||||
|
||||
struct uchcom_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom;
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom;
|
||||
|
||||
struct usb2_xfer *sc_xfer[UCHCOM_N_TRANSFER];
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[UCHCOM_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
uint8_t sc_dtr; /* local copy */
|
||||
@ -192,23 +192,23 @@ static const struct uchcom_divider_record dividers[] =
|
||||
|
||||
#define NUM_DIVIDERS (sizeof (dividers) / sizeof (dividers[0]))
|
||||
|
||||
static const struct usb2_device_id uchcom_devs[] = {
|
||||
static const struct usb_device_id uchcom_devs[] = {
|
||||
{USB_VPI(USB_VENDOR_WCH, USB_PRODUCT_WCH_CH341SER, 0)},
|
||||
};
|
||||
|
||||
/* protypes */
|
||||
|
||||
static int uchcom_pre_param(struct usb2_com_softc *, struct termios *);
|
||||
static void uchcom_cfg_get_status(struct usb2_com_softc *, uint8_t *,
|
||||
static int uchcom_pre_param(struct ucom_softc *, struct termios *);
|
||||
static void uchcom_cfg_get_status(struct ucom_softc *, uint8_t *,
|
||||
uint8_t *);
|
||||
static void uchcom_cfg_param(struct usb2_com_softc *, struct termios *);
|
||||
static void uchcom_cfg_set_break(struct usb2_com_softc *, uint8_t);
|
||||
static void uchcom_cfg_set_dtr(struct usb2_com_softc *, uint8_t);
|
||||
static void uchcom_cfg_set_rts(struct usb2_com_softc *, uint8_t);
|
||||
static void uchcom_start_read(struct usb2_com_softc *);
|
||||
static void uchcom_start_write(struct usb2_com_softc *);
|
||||
static void uchcom_stop_read(struct usb2_com_softc *);
|
||||
static void uchcom_stop_write(struct usb2_com_softc *);
|
||||
static void uchcom_cfg_param(struct ucom_softc *, struct termios *);
|
||||
static void uchcom_cfg_set_break(struct ucom_softc *, uint8_t);
|
||||
static void uchcom_cfg_set_dtr(struct ucom_softc *, uint8_t);
|
||||
static void uchcom_cfg_set_rts(struct ucom_softc *, uint8_t);
|
||||
static void uchcom_start_read(struct ucom_softc *);
|
||||
static void uchcom_start_write(struct ucom_softc *);
|
||||
static void uchcom_stop_read(struct ucom_softc *);
|
||||
static void uchcom_stop_write(struct ucom_softc *);
|
||||
static void uchcom_update_version(struct uchcom_softc *);
|
||||
static void uchcom_convert_status(struct uchcom_softc *, uint8_t);
|
||||
static void uchcom_update_status(struct uchcom_softc *);
|
||||
@ -227,7 +227,7 @@ static usb2_callback_t uchcom_intr_callback;
|
||||
static usb2_callback_t uchcom_write_callback;
|
||||
static usb2_callback_t uchcom_read_callback;
|
||||
|
||||
static const struct usb2_config uchcom_config_data[UCHCOM_N_TRANSFER] = {
|
||||
static const struct usb_config uchcom_config_data[UCHCOM_N_TRANSFER] = {
|
||||
|
||||
[UCHCOM_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -257,7 +257,7 @@ static const struct usb2_config uchcom_config_data[UCHCOM_N_TRANSFER] = {
|
||||
},
|
||||
};
|
||||
|
||||
struct usb2_com_callback uchcom_callback = {
|
||||
struct ucom_callback uchcom_callback = {
|
||||
.usb2_com_cfg_get_status = &uchcom_cfg_get_status,
|
||||
.usb2_com_cfg_set_dtr = &uchcom_cfg_set_dtr,
|
||||
.usb2_com_cfg_set_rts = &uchcom_cfg_set_rts,
|
||||
@ -277,7 +277,7 @@ struct usb2_com_callback uchcom_callback = {
|
||||
static int
|
||||
uchcom_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
DPRINTFN(11, "\n");
|
||||
|
||||
@ -297,7 +297,7 @@ static int
|
||||
uchcom_attach(device_t dev)
|
||||
{
|
||||
struct uchcom_softc *sc = device_get_softc(dev);
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
int error;
|
||||
uint8_t iface_index;
|
||||
|
||||
@ -379,7 +379,7 @@ static void
|
||||
uchcom_ctrl_write(struct uchcom_softc *sc, uint8_t reqno,
|
||||
uint16_t value, uint16_t index)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
req.bRequest = reqno;
|
||||
@ -395,7 +395,7 @@ static void
|
||||
uchcom_ctrl_read(struct uchcom_softc *sc, uint8_t reqno,
|
||||
uint16_t value, uint16_t index, void *buf, uint16_t buflen)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
req.bRequest = reqno;
|
||||
@ -517,7 +517,7 @@ uchcom_set_dtrrts(struct uchcom_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
uchcom_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uchcom_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uchcom_softc *sc = ucom->sc_parent;
|
||||
uint8_t brk1;
|
||||
@ -667,7 +667,7 @@ uchcom_reset_chip(struct uchcom_softc *sc)
|
||||
* methods for ucom
|
||||
*/
|
||||
static void
|
||||
uchcom_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
uchcom_cfg_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
{
|
||||
struct uchcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -678,7 +678,7 @@ uchcom_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
}
|
||||
|
||||
static void
|
||||
uchcom_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uchcom_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uchcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -689,7 +689,7 @@ uchcom_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
uchcom_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uchcom_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uchcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -700,7 +700,7 @@ uchcom_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static int
|
||||
uchcom_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
uchcom_pre_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
struct uchcom_divider dv;
|
||||
|
||||
@ -720,7 +720,7 @@ uchcom_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
uchcom_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
uchcom_cfg_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
struct uchcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -729,7 +729,7 @@ uchcom_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
uchcom_start_read(struct usb2_com_softc *ucom)
|
||||
uchcom_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uchcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -741,7 +741,7 @@ uchcom_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uchcom_stop_read(struct usb2_com_softc *ucom)
|
||||
uchcom_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uchcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -753,7 +753,7 @@ uchcom_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uchcom_start_write(struct usb2_com_softc *ucom)
|
||||
uchcom_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uchcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -761,7 +761,7 @@ uchcom_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uchcom_stop_write(struct usb2_com_softc *ucom)
|
||||
uchcom_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uchcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -772,7 +772,7 @@ uchcom_stop_write(struct usb2_com_softc *ucom)
|
||||
* callback when the modem status is changed.
|
||||
*/
|
||||
static void
|
||||
uchcom_intr_callback(struct usb2_xfer *xfer)
|
||||
uchcom_intr_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uchcom_softc *sc = xfer->priv_sc;
|
||||
uint8_t buf[UCHCOM_INTR_LEAST];
|
||||
@ -810,7 +810,7 @@ uchcom_intr_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uchcom_write_callback(struct usb2_xfer *xfer)
|
||||
uchcom_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uchcom_softc *sc = xfer->priv_sc;
|
||||
uint32_t actlen;
|
||||
@ -841,7 +841,7 @@ uchcom_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uchcom_read_callback(struct usb2_xfer *xfer)
|
||||
uchcom_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uchcom_softc *sc = xfer->priv_sc;
|
||||
|
||||
|
@ -66,11 +66,11 @@ enum {
|
||||
};
|
||||
|
||||
struct ucycom_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom;
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom;
|
||||
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb2_xfer *sc_xfer[UCYCOM_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[UCYCOM_N_TRANSFER];
|
||||
struct mtx sc_mtx;
|
||||
|
||||
uint32_t sc_model;
|
||||
@ -105,22 +105,22 @@ static device_detach_t ucycom_detach;
|
||||
static usb2_callback_t ucycom_ctrl_write_callback;
|
||||
static usb2_callback_t ucycom_intr_read_callback;
|
||||
|
||||
static void ucycom_cfg_open(struct usb2_com_softc *);
|
||||
static void ucycom_start_read(struct usb2_com_softc *);
|
||||
static void ucycom_stop_read(struct usb2_com_softc *);
|
||||
static void ucycom_start_write(struct usb2_com_softc *);
|
||||
static void ucycom_stop_write(struct usb2_com_softc *);
|
||||
static void ucycom_cfg_open(struct ucom_softc *);
|
||||
static void ucycom_start_read(struct ucom_softc *);
|
||||
static void ucycom_stop_read(struct ucom_softc *);
|
||||
static void ucycom_start_write(struct ucom_softc *);
|
||||
static void ucycom_stop_write(struct ucom_softc *);
|
||||
static void ucycom_cfg_write(struct ucycom_softc *, uint32_t, uint8_t);
|
||||
static int ucycom_pre_param(struct usb2_com_softc *, struct termios *);
|
||||
static void ucycom_cfg_param(struct usb2_com_softc *, struct termios *);
|
||||
static int ucycom_pre_param(struct ucom_softc *, struct termios *);
|
||||
static void ucycom_cfg_param(struct ucom_softc *, struct termios *);
|
||||
|
||||
static const struct usb2_config ucycom_config[UCYCOM_N_TRANSFER] = {
|
||||
static const struct usb_config ucycom_config[UCYCOM_N_TRANSFER] = {
|
||||
|
||||
[UCYCOM_CTRL_RD] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = (sizeof(struct usb2_device_request) + UCYCOM_MAX_IOLEN),
|
||||
.bufsize = (sizeof(struct usb_device_request) + UCYCOM_MAX_IOLEN),
|
||||
.callback = &ucycom_ctrl_write_callback,
|
||||
.timeout = 1000, /* 1 second */
|
||||
},
|
||||
@ -135,7 +135,7 @@ static const struct usb2_config ucycom_config[UCYCOM_N_TRANSFER] = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_com_callback ucycom_callback = {
|
||||
static const struct ucom_callback ucycom_callback = {
|
||||
.usb2_com_cfg_param = &ucycom_cfg_param,
|
||||
.usb2_com_cfg_open = &ucycom_cfg_open,
|
||||
.usb2_com_pre_param = &ucycom_pre_param,
|
||||
@ -167,7 +167,7 @@ MODULE_DEPEND(ucycom, usb, 1, 1, 1);
|
||||
/*
|
||||
* Supported devices
|
||||
*/
|
||||
static const struct usb2_device_id ucycom_devs[] = {
|
||||
static const struct usb_device_id ucycom_devs[] = {
|
||||
{USB_VPI(USB_VENDOR_DELORME, USB_PRODUCT_DELORME_EARTHMATE, MODEL_CY7C64013)},
|
||||
};
|
||||
|
||||
@ -177,7 +177,7 @@ static const struct usb2_device_id ucycom_devs[] = {
|
||||
static int
|
||||
ucycom_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
return (ENXIO);
|
||||
@ -194,7 +194,7 @@ ucycom_probe(device_t dev)
|
||||
static int
|
||||
ucycom_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct ucycom_softc *sc = device_get_softc(dev);
|
||||
void *urd_ptr = NULL;
|
||||
int32_t error;
|
||||
@ -288,7 +288,7 @@ ucycom_detach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
ucycom_cfg_open(struct usb2_com_softc *ucom)
|
||||
ucycom_cfg_open(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ucycom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -297,7 +297,7 @@ ucycom_cfg_open(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ucycom_start_read(struct usb2_com_softc *ucom)
|
||||
ucycom_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ucycom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -305,7 +305,7 @@ ucycom_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ucycom_stop_read(struct usb2_com_softc *ucom)
|
||||
ucycom_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ucycom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -313,7 +313,7 @@ ucycom_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ucycom_start_write(struct usb2_com_softc *ucom)
|
||||
ucycom_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ucycom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -321,7 +321,7 @@ ucycom_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ucycom_stop_write(struct usb2_com_softc *ucom)
|
||||
ucycom_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ucycom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -329,10 +329,10 @@ ucycom_stop_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ucycom_ctrl_write_callback(struct usb2_xfer *xfer)
|
||||
ucycom_ctrl_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ucycom_softc *sc = xfer->priv_sc;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint8_t data[2];
|
||||
uint8_t offset;
|
||||
uint32_t actlen;
|
||||
@ -399,7 +399,7 @@ ucycom_ctrl_write_callback(struct usb2_xfer *xfer)
|
||||
static void
|
||||
ucycom_cfg_write(struct ucycom_softc *sc, uint32_t baud, uint8_t cfg)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint16_t len;
|
||||
usb2_error_t err;
|
||||
|
||||
@ -431,7 +431,7 @@ ucycom_cfg_write(struct ucycom_softc *sc, uint32_t baud, uint8_t cfg)
|
||||
}
|
||||
|
||||
static int
|
||||
ucycom_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
ucycom_pre_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
switch (t->c_ospeed) {
|
||||
case 600:
|
||||
@ -459,7 +459,7 @@ ucycom_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
ucycom_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
ucycom_cfg_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
struct ucycom_softc *sc = ucom->sc_parent;
|
||||
uint8_t cfg;
|
||||
@ -494,7 +494,7 @@ ucycom_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
ucycom_intr_read_callback(struct usb2_xfer *xfer)
|
||||
ucycom_intr_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ucycom_softc *sc = xfer->priv_sc;
|
||||
uint8_t buf[2];
|
||||
|
@ -157,16 +157,16 @@ enum {
|
||||
};
|
||||
|
||||
struct ufoma_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom;
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom;
|
||||
struct cv sc_cv;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
struct usb2_xfer *sc_ctrl_xfer[UFOMA_CTRL_ENDPT_MAX];
|
||||
struct usb2_xfer *sc_bulk_xfer[UFOMA_BULK_ENDPT_MAX];
|
||||
struct usb_xfer *sc_ctrl_xfer[UFOMA_CTRL_ENDPT_MAX];
|
||||
struct usb_xfer *sc_bulk_xfer[UFOMA_BULK_ENDPT_MAX];
|
||||
uint8_t *sc_modetable;
|
||||
device_t sc_dev;
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb_device *sc_udev;
|
||||
|
||||
uint32_t sc_unit;
|
||||
|
||||
@ -199,25 +199,25 @@ static usb2_callback_t ufoma_intr_callback;
|
||||
static usb2_callback_t ufoma_bulk_write_callback;
|
||||
static usb2_callback_t ufoma_bulk_read_callback;
|
||||
|
||||
static void *ufoma_get_intconf(struct usb2_config_descriptor *,
|
||||
struct usb2_interface_descriptor *, uint8_t, uint8_t);
|
||||
static void *ufoma_get_intconf(struct usb_config_descriptor *,
|
||||
struct usb_interface_descriptor *, uint8_t, uint8_t);
|
||||
static void ufoma_cfg_link_state(struct ufoma_softc *);
|
||||
static void ufoma_cfg_activate_state(struct ufoma_softc *, uint16_t);
|
||||
static void ufoma_cfg_open(struct usb2_com_softc *);
|
||||
static void ufoma_cfg_close(struct usb2_com_softc *);
|
||||
static void ufoma_cfg_set_break(struct usb2_com_softc *, uint8_t);
|
||||
static void ufoma_cfg_get_status(struct usb2_com_softc *, uint8_t *,
|
||||
static void ufoma_cfg_open(struct ucom_softc *);
|
||||
static void ufoma_cfg_close(struct ucom_softc *);
|
||||
static void ufoma_cfg_set_break(struct ucom_softc *, uint8_t);
|
||||
static void ufoma_cfg_get_status(struct ucom_softc *, uint8_t *,
|
||||
uint8_t *);
|
||||
static void ufoma_cfg_set_dtr(struct usb2_com_softc *, uint8_t);
|
||||
static void ufoma_cfg_set_rts(struct usb2_com_softc *, uint8_t);
|
||||
static int ufoma_pre_param(struct usb2_com_softc *, struct termios *);
|
||||
static void ufoma_cfg_param(struct usb2_com_softc *, struct termios *);
|
||||
static void ufoma_cfg_set_dtr(struct ucom_softc *, uint8_t);
|
||||
static void ufoma_cfg_set_rts(struct ucom_softc *, uint8_t);
|
||||
static int ufoma_pre_param(struct ucom_softc *, struct termios *);
|
||||
static void ufoma_cfg_param(struct ucom_softc *, struct termios *);
|
||||
static int ufoma_modem_setup(device_t, struct ufoma_softc *,
|
||||
struct usb2_attach_arg *);
|
||||
static void ufoma_start_read(struct usb2_com_softc *);
|
||||
static void ufoma_stop_read(struct usb2_com_softc *);
|
||||
static void ufoma_start_write(struct usb2_com_softc *);
|
||||
static void ufoma_stop_write(struct usb2_com_softc *);
|
||||
struct usb_attach_arg *);
|
||||
static void ufoma_start_read(struct ucom_softc *);
|
||||
static void ufoma_stop_read(struct ucom_softc *);
|
||||
static void ufoma_start_write(struct ucom_softc *);
|
||||
static void ufoma_stop_write(struct ucom_softc *);
|
||||
|
||||
/*sysctl stuff*/
|
||||
static int ufoma_sysctl_support(SYSCTL_HANDLER_ARGS);
|
||||
@ -225,7 +225,7 @@ static int ufoma_sysctl_current(SYSCTL_HANDLER_ARGS);
|
||||
static int ufoma_sysctl_open(SYSCTL_HANDLER_ARGS);
|
||||
|
||||
|
||||
static const struct usb2_config
|
||||
static const struct usb_config
|
||||
ufoma_ctrl_config[UFOMA_CTRL_ENDPT_MAX] = {
|
||||
|
||||
[UFOMA_CTRL_ENDPT_INTR] = {
|
||||
@ -233,7 +233,7 @@ static const struct usb2_config
|
||||
.endpoint = UE_ADDR_ANY,
|
||||
.direction = UE_DIR_IN,
|
||||
.flags = {.pipe_bof = 1,.short_xfer_ok = 1,},
|
||||
.bufsize = sizeof(struct usb2_cdc_notification),
|
||||
.bufsize = sizeof(struct usb_cdc_notification),
|
||||
.callback = &ufoma_intr_callback,
|
||||
},
|
||||
|
||||
@ -241,7 +241,7 @@ static const struct usb2_config
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = (sizeof(struct usb2_device_request) + UFOMA_CMD_BUF_SIZE),
|
||||
.bufsize = (sizeof(struct usb_device_request) + UFOMA_CMD_BUF_SIZE),
|
||||
.flags = {.short_xfer_ok = 1,},
|
||||
.callback = &ufoma_ctrl_read_callback,
|
||||
.timeout = 1000, /* 1 second */
|
||||
@ -251,13 +251,13 @@ static const struct usb2_config
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = (sizeof(struct usb2_device_request) + 1),
|
||||
.bufsize = (sizeof(struct usb_device_request) + 1),
|
||||
.callback = &ufoma_ctrl_write_callback,
|
||||
.timeout = 1000, /* 1 second */
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_config
|
||||
static const struct usb_config
|
||||
ufoma_bulk_config[UFOMA_BULK_ENDPT_MAX] = {
|
||||
|
||||
[UFOMA_BULK_ENDPT_WRITE] = {
|
||||
@ -279,7 +279,7 @@ static const struct usb2_config
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_com_callback ufoma_callback = {
|
||||
static const struct ucom_callback ufoma_callback = {
|
||||
.usb2_com_cfg_get_status = &ufoma_cfg_get_status,
|
||||
.usb2_com_cfg_set_dtr = &ufoma_cfg_set_dtr,
|
||||
.usb2_com_cfg_set_rts = &ufoma_cfg_set_rts,
|
||||
@ -317,9 +317,9 @@ MODULE_DEPEND(ufoma, usb, 1, 1, 1);
|
||||
static int
|
||||
ufoma_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb2_config_descriptor *cd;
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_interface_descriptor *id;
|
||||
struct usb_config_descriptor *cd;
|
||||
usb2_mcpc_acm_descriptor *mad;
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
@ -350,10 +350,10 @@ ufoma_probe(device_t dev)
|
||||
static int
|
||||
ufoma_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct ufoma_softc *sc = device_get_softc(dev);
|
||||
struct usb2_config_descriptor *cd;
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb_config_descriptor *cd;
|
||||
struct usb_interface_descriptor *id;
|
||||
struct sysctl_ctx_list *sctx;
|
||||
struct sysctl_oid *soid;
|
||||
|
||||
@ -481,10 +481,10 @@ ufoma_detach(device_t dev)
|
||||
}
|
||||
|
||||
static void *
|
||||
ufoma_get_intconf(struct usb2_config_descriptor *cd, struct usb2_interface_descriptor *id,
|
||||
ufoma_get_intconf(struct usb_config_descriptor *cd, struct usb_interface_descriptor *id,
|
||||
uint8_t type, uint8_t subtype)
|
||||
{
|
||||
struct usb2_descriptor *desc = (void *)id;
|
||||
struct usb_descriptor *desc = (void *)id;
|
||||
|
||||
while ((desc = usb2_desc_foreach(cd, desc))) {
|
||||
|
||||
@ -502,7 +502,7 @@ ufoma_get_intconf(struct usb2_config_descriptor *cd, struct usb2_interface_descr
|
||||
static void
|
||||
ufoma_cfg_link_state(struct ufoma_softc *sc)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
int32_t error;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_INTERFACE;
|
||||
@ -524,7 +524,7 @@ ufoma_cfg_link_state(struct ufoma_softc *sc)
|
||||
static void
|
||||
ufoma_cfg_activate_state(struct ufoma_softc *sc, uint16_t state)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
int32_t error;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_INTERFACE;
|
||||
@ -544,10 +544,10 @@ ufoma_cfg_activate_state(struct ufoma_softc *sc, uint16_t state)
|
||||
}
|
||||
|
||||
static void
|
||||
ufoma_ctrl_read_callback(struct usb2_xfer *xfer)
|
||||
ufoma_ctrl_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ufoma_softc *sc = xfer->priv_sc;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
case USB_ST_TRANSFERRED:
|
||||
@ -594,10 +594,10 @@ ufoma_ctrl_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ufoma_ctrl_write_callback(struct usb2_xfer *xfer)
|
||||
ufoma_ctrl_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ufoma_softc *sc = xfer->priv_sc;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint32_t actlen;
|
||||
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
@ -639,10 +639,10 @@ ufoma_ctrl_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ufoma_intr_callback(struct usb2_xfer *xfer)
|
||||
ufoma_intr_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ufoma_softc *sc = xfer->priv_sc;
|
||||
struct usb2_cdc_notification pkt;
|
||||
struct usb_cdc_notification pkt;
|
||||
uint16_t wLen;
|
||||
uint16_t temp;
|
||||
uint8_t mstatus;
|
||||
@ -745,7 +745,7 @@ ufoma_intr_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ufoma_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
ufoma_bulk_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ufoma_softc *sc = xfer->priv_sc;
|
||||
uint32_t actlen;
|
||||
@ -772,7 +772,7 @@ ufoma_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ufoma_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
ufoma_bulk_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ufoma_softc *sc = xfer->priv_sc;
|
||||
|
||||
@ -798,7 +798,7 @@ ufoma_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ufoma_cfg_open(struct usb2_com_softc *ucom)
|
||||
ufoma_cfg_open(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ufoma_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -816,7 +816,7 @@ ufoma_cfg_open(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ufoma_cfg_close(struct usb2_com_softc *ucom)
|
||||
ufoma_cfg_close(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ufoma_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -824,10 +824,10 @@ ufoma_cfg_close(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ufoma_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
ufoma_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct ufoma_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint16_t wValue;
|
||||
|
||||
if (sc->sc_nobulk ||
|
||||
@ -851,7 +851,7 @@ ufoma_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
ufoma_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
ufoma_cfg_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
{
|
||||
struct ufoma_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -862,7 +862,7 @@ ufoma_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
static void
|
||||
ufoma_cfg_set_line_state(struct ufoma_softc *sc)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
/* Don't send line state emulation request for OBEX port */
|
||||
if (sc->sc_currentmode == UMCPC_ACM_MODE_OBEX) {
|
||||
@ -880,7 +880,7 @@ ufoma_cfg_set_line_state(struct ufoma_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
ufoma_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
ufoma_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct ufoma_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -896,7 +896,7 @@ ufoma_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
ufoma_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
ufoma_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct ufoma_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -912,17 +912,17 @@ ufoma_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static int
|
||||
ufoma_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
ufoma_pre_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
return (0); /* we accept anything */
|
||||
}
|
||||
|
||||
static void
|
||||
ufoma_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
ufoma_cfg_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
struct ufoma_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb2_cdc_line_state ls;
|
||||
struct usb_device_request req;
|
||||
struct usb_cdc_line_state ls;
|
||||
|
||||
if (sc->sc_nobulk ||
|
||||
(sc->sc_currentmode == UMCPC_ACM_MODE_OBEX)) {
|
||||
@ -978,13 +978,13 @@ ufoma_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
|
||||
static int
|
||||
ufoma_modem_setup(device_t dev, struct ufoma_softc *sc,
|
||||
struct usb2_attach_arg *uaa)
|
||||
struct usb_attach_arg *uaa)
|
||||
{
|
||||
struct usb2_config_descriptor *cd;
|
||||
struct usb2_cdc_acm_descriptor *acm;
|
||||
struct usb2_cdc_cm_descriptor *cmd;
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb2_interface *iface;
|
||||
struct usb_config_descriptor *cd;
|
||||
struct usb_cdc_acm_descriptor *acm;
|
||||
struct usb_cdc_cm_descriptor *cmd;
|
||||
struct usb_interface_descriptor *id;
|
||||
struct usb_interface *iface;
|
||||
uint8_t i;
|
||||
int32_t error;
|
||||
|
||||
@ -1048,7 +1048,7 @@ ufoma_modem_setup(device_t dev, struct ufoma_softc *sc,
|
||||
}
|
||||
|
||||
static void
|
||||
ufoma_start_read(struct usb2_com_softc *ucom)
|
||||
ufoma_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ufoma_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -1064,7 +1064,7 @@ ufoma_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ufoma_stop_read(struct usb2_com_softc *ucom)
|
||||
ufoma_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ufoma_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -1080,7 +1080,7 @@ ufoma_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ufoma_start_write(struct usb2_com_softc *ucom)
|
||||
ufoma_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ufoma_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -1092,7 +1092,7 @@ ufoma_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ufoma_stop_write(struct usb2_com_softc *ucom)
|
||||
ufoma_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ufoma_softc *sc = ucom->sc_parent;
|
||||
|
||||
|
@ -90,11 +90,11 @@ enum {
|
||||
};
|
||||
|
||||
struct uftdi_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom;
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom;
|
||||
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb2_xfer *sc_xfer[UFTDI_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[UFTDI_N_TRANSFER];
|
||||
device_t sc_dev;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
@ -128,23 +128,23 @@ static device_detach_t uftdi_detach;
|
||||
static usb2_callback_t uftdi_write_callback;
|
||||
static usb2_callback_t uftdi_read_callback;
|
||||
|
||||
static void uftdi_cfg_open(struct usb2_com_softc *);
|
||||
static void uftdi_cfg_set_dtr(struct usb2_com_softc *, uint8_t);
|
||||
static void uftdi_cfg_set_rts(struct usb2_com_softc *, uint8_t);
|
||||
static void uftdi_cfg_set_break(struct usb2_com_softc *, uint8_t);
|
||||
static void uftdi_cfg_open(struct ucom_softc *);
|
||||
static void uftdi_cfg_set_dtr(struct ucom_softc *, uint8_t);
|
||||
static void uftdi_cfg_set_rts(struct ucom_softc *, uint8_t);
|
||||
static void uftdi_cfg_set_break(struct ucom_softc *, uint8_t);
|
||||
static int uftdi_set_parm_soft(struct termios *,
|
||||
struct uftdi_param_config *, uint8_t);
|
||||
static int uftdi_pre_param(struct usb2_com_softc *, struct termios *);
|
||||
static void uftdi_cfg_param(struct usb2_com_softc *, struct termios *);
|
||||
static void uftdi_cfg_get_status(struct usb2_com_softc *, uint8_t *,
|
||||
static int uftdi_pre_param(struct ucom_softc *, struct termios *);
|
||||
static void uftdi_cfg_param(struct ucom_softc *, struct termios *);
|
||||
static void uftdi_cfg_get_status(struct ucom_softc *, uint8_t *,
|
||||
uint8_t *);
|
||||
static void uftdi_start_read(struct usb2_com_softc *);
|
||||
static void uftdi_stop_read(struct usb2_com_softc *);
|
||||
static void uftdi_start_write(struct usb2_com_softc *);
|
||||
static void uftdi_stop_write(struct usb2_com_softc *);
|
||||
static void uftdi_start_read(struct ucom_softc *);
|
||||
static void uftdi_stop_read(struct ucom_softc *);
|
||||
static void uftdi_start_write(struct ucom_softc *);
|
||||
static void uftdi_stop_write(struct ucom_softc *);
|
||||
static uint8_t uftdi_8u232am_getrate(uint32_t, uint16_t *);
|
||||
|
||||
static const struct usb2_config uftdi_config[UFTDI_N_TRANSFER] = {
|
||||
static const struct usb_config uftdi_config[UFTDI_N_TRANSFER] = {
|
||||
|
||||
[UFTDI_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -165,7 +165,7 @@ static const struct usb2_config uftdi_config[UFTDI_N_TRANSFER] = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_com_callback uftdi_callback = {
|
||||
static const struct ucom_callback uftdi_callback = {
|
||||
.usb2_com_cfg_get_status = &uftdi_cfg_get_status,
|
||||
.usb2_com_cfg_set_dtr = &uftdi_cfg_set_dtr,
|
||||
.usb2_com_cfg_set_rts = &uftdi_cfg_set_rts,
|
||||
@ -200,7 +200,7 @@ DRIVER_MODULE(uftdi, uhub, uftdi_driver, uftdi_devclass, NULL, 0);
|
||||
MODULE_DEPEND(uftdi, ucom, 1, 1, 1);
|
||||
MODULE_DEPEND(uftdi, usb, 1, 1, 1);
|
||||
|
||||
static struct usb2_device_id uftdi_devs[] = {
|
||||
static struct usb_device_id uftdi_devs[] = {
|
||||
{USB_VPI(USB_VENDOR_ATMEL, USB_PRODUCT_ATMEL_STK541, UFTDI_TYPE_8U232AM)},
|
||||
{USB_VPI(USB_VENDOR_DRESDENELEKTRONIK, USB_PRODUCT_DRESDENELEKTRONIK_SENSORTERMINALBOARD, UFTDI_TYPE_8U232AM)},
|
||||
{USB_VPI(USB_VENDOR_DRESDENELEKTRONIK, USB_PRODUCT_DRESDENELEKTRONIK_WIRELESSHANDHELDTERMINAL, UFTDI_TYPE_8U232AM)},
|
||||
@ -238,7 +238,7 @@ static struct usb2_device_id uftdi_devs[] = {
|
||||
static int
|
||||
uftdi_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
return (ENXIO);
|
||||
@ -254,7 +254,7 @@ uftdi_probe(device_t dev)
|
||||
static int
|
||||
uftdi_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct uftdi_softc *sc = device_get_softc(dev);
|
||||
int error;
|
||||
|
||||
@ -332,11 +332,11 @@ uftdi_detach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
uftdi_cfg_open(struct usb2_com_softc *ucom)
|
||||
uftdi_cfg_open(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uftdi_softc *sc = ucom->sc_parent;
|
||||
uint16_t wIndex = ucom->sc_portno;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
DPRINTF("");
|
||||
|
||||
@ -368,7 +368,7 @@ uftdi_cfg_open(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uftdi_write_callback(struct usb2_xfer *xfer)
|
||||
uftdi_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uftdi_softc *sc = xfer->priv_sc;
|
||||
uint32_t actlen;
|
||||
@ -403,7 +403,7 @@ uftdi_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uftdi_read_callback(struct usb2_xfer *xfer)
|
||||
uftdi_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uftdi_softc *sc = xfer->priv_sc;
|
||||
uint8_t buf[2];
|
||||
@ -466,12 +466,12 @@ uftdi_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uftdi_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uftdi_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uftdi_softc *sc = ucom->sc_parent;
|
||||
uint16_t wIndex = ucom->sc_portno;
|
||||
uint16_t wValue;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
wValue = onoff ? FTDI_SIO_SET_DTR_HIGH : FTDI_SIO_SET_DTR_LOW;
|
||||
|
||||
@ -485,12 +485,12 @@ uftdi_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
uftdi_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uftdi_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uftdi_softc *sc = ucom->sc_parent;
|
||||
uint16_t wIndex = ucom->sc_portno;
|
||||
uint16_t wValue;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
wValue = onoff ? FTDI_SIO_SET_RTS_HIGH : FTDI_SIO_SET_RTS_LOW;
|
||||
|
||||
@ -504,12 +504,12 @@ uftdi_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
uftdi_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uftdi_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uftdi_softc *sc = ucom->sc_parent;
|
||||
uint16_t wIndex = ucom->sc_portno;
|
||||
uint16_t wValue;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
if (onoff) {
|
||||
sc->sc_last_lcr |= FTDI_SIO_SET_BREAK;
|
||||
@ -626,7 +626,7 @@ uftdi_set_parm_soft(struct termios *t,
|
||||
}
|
||||
|
||||
static int
|
||||
uftdi_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
uftdi_pre_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
struct uftdi_softc *sc = ucom->sc_parent;
|
||||
struct uftdi_param_config cfg;
|
||||
@ -637,12 +637,12 @@ uftdi_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
uftdi_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
uftdi_cfg_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
struct uftdi_softc *sc = ucom->sc_parent;
|
||||
uint16_t wIndex = ucom->sc_portno;
|
||||
struct uftdi_param_config cfg;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
if (uftdi_set_parm_soft(t, &cfg, sc->sc_type)) {
|
||||
/* should not happen */
|
||||
@ -678,7 +678,7 @@ uftdi_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
uftdi_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
uftdi_cfg_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
{
|
||||
struct uftdi_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -690,7 +690,7 @@ uftdi_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
}
|
||||
|
||||
static void
|
||||
uftdi_start_read(struct usb2_com_softc *ucom)
|
||||
uftdi_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uftdi_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -698,7 +698,7 @@ uftdi_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uftdi_stop_read(struct usb2_com_softc *ucom)
|
||||
uftdi_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uftdi_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -706,7 +706,7 @@ uftdi_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uftdi_start_write(struct usb2_com_softc *ucom)
|
||||
uftdi_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uftdi_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -714,7 +714,7 @@ uftdi_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uftdi_stop_write(struct usb2_com_softc *ucom)
|
||||
uftdi_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uftdi_softc *sc = ucom->sc_parent;
|
||||
|
||||
|
@ -72,13 +72,13 @@ enum {
|
||||
};
|
||||
|
||||
struct ugensa_sub_softc {
|
||||
struct usb2_com_softc *sc_usb2_com_ptr;
|
||||
struct usb2_xfer *sc_xfer[UGENSA_N_TRANSFER];
|
||||
struct ucom_softc *sc_usb2_com_ptr;
|
||||
struct usb_xfer *sc_xfer[UGENSA_N_TRANSFER];
|
||||
};
|
||||
|
||||
struct ugensa_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom[UGENSA_IFACE_MAX];
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom[UGENSA_IFACE_MAX];
|
||||
struct ugensa_sub_softc sc_sub[UGENSA_IFACE_MAX];
|
||||
|
||||
struct mtx sc_mtx;
|
||||
@ -94,12 +94,12 @@ static device_detach_t ugensa_detach;
|
||||
static usb2_callback_t ugensa_bulk_write_callback;
|
||||
static usb2_callback_t ugensa_bulk_read_callback;
|
||||
|
||||
static void ugensa_start_read(struct usb2_com_softc *);
|
||||
static void ugensa_stop_read(struct usb2_com_softc *);
|
||||
static void ugensa_start_write(struct usb2_com_softc *);
|
||||
static void ugensa_stop_write(struct usb2_com_softc *);
|
||||
static void ugensa_start_read(struct ucom_softc *);
|
||||
static void ugensa_stop_read(struct ucom_softc *);
|
||||
static void ugensa_start_write(struct ucom_softc *);
|
||||
static void ugensa_stop_write(struct ucom_softc *);
|
||||
|
||||
static const struct usb2_config
|
||||
static const struct usb_config
|
||||
ugensa_xfer_config[UGENSA_N_TRANSFER] = {
|
||||
|
||||
[UGENSA_BULK_DT_WR] = {
|
||||
@ -121,7 +121,7 @@ static const struct usb2_config
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_com_callback ugensa_callback = {
|
||||
static const struct ucom_callback ugensa_callback = {
|
||||
.usb2_com_start_read = &ugensa_start_read,
|
||||
.usb2_com_stop_read = &ugensa_stop_read,
|
||||
.usb2_com_start_write = &ugensa_start_write,
|
||||
@ -148,7 +148,7 @@ DRIVER_MODULE(ugensa, uhub, ugensa_driver, ugensa_devclass, NULL, 0);
|
||||
MODULE_DEPEND(ugensa, ucom, 1, 1, 1);
|
||||
MODULE_DEPEND(ugensa, usb, 1, 1, 1);
|
||||
|
||||
static const struct usb2_device_id ugensa_devs[] = {
|
||||
static const struct usb_device_id ugensa_devs[] = {
|
||||
{USB_VPI(USB_VENDOR_AIRPRIME, USB_PRODUCT_AIRPRIME_PC5220, 0)},
|
||||
{USB_VPI(USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CDMA_MODEM1, 0)},
|
||||
{USB_VPI(USB_VENDOR_KYOCERA2, USB_PRODUCT_KYOCERA2_CDMA_MSM_K, 0)},
|
||||
@ -159,7 +159,7 @@ static const struct usb2_device_id ugensa_devs[] = {
|
||||
static int
|
||||
ugensa_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
return (ENXIO);
|
||||
@ -176,10 +176,10 @@ ugensa_probe(device_t dev)
|
||||
static int
|
||||
ugensa_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct ugensa_softc *sc = device_get_softc(dev);
|
||||
struct ugensa_sub_softc *ssc;
|
||||
struct usb2_interface *iface;
|
||||
struct usb_interface *iface;
|
||||
int32_t error;
|
||||
uint8_t iface_index;
|
||||
int x, cnt;
|
||||
@ -264,7 +264,7 @@ ugensa_detach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
ugensa_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
ugensa_bulk_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ugensa_sub_softc *ssc = xfer->priv_sc;
|
||||
uint32_t actlen;
|
||||
@ -291,7 +291,7 @@ ugensa_bulk_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ugensa_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
ugensa_bulk_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ugensa_sub_softc *ssc = xfer->priv_sc;
|
||||
|
||||
@ -317,7 +317,7 @@ ugensa_bulk_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ugensa_start_read(struct usb2_com_softc *ucom)
|
||||
ugensa_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ugensa_softc *sc = ucom->sc_parent;
|
||||
struct ugensa_sub_softc *ssc = sc->sc_sub + ucom->sc_portno;
|
||||
@ -326,7 +326,7 @@ ugensa_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ugensa_stop_read(struct usb2_com_softc *ucom)
|
||||
ugensa_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ugensa_softc *sc = ucom->sc_parent;
|
||||
struct ugensa_sub_softc *ssc = sc->sc_sub + ucom->sc_portno;
|
||||
@ -335,7 +335,7 @@ ugensa_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ugensa_start_write(struct usb2_com_softc *ucom)
|
||||
ugensa_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ugensa_softc *sc = ucom->sc_parent;
|
||||
struct ugensa_sub_softc *ssc = sc->sc_sub + ucom->sc_portno;
|
||||
@ -344,7 +344,7 @@ ugensa_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
ugensa_stop_write(struct usb2_com_softc *ucom)
|
||||
ugensa_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct ugensa_softc *sc = ucom->sc_parent;
|
||||
struct ugensa_sub_softc *ssc = sc->sc_sub + ucom->sc_portno;
|
||||
|
@ -81,11 +81,11 @@ enum {
|
||||
};
|
||||
|
||||
struct uipaq_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom;
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom;
|
||||
|
||||
struct usb2_xfer *sc_xfer[UIPAQ_N_TRANSFER];
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[UIPAQ_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
uint16_t sc_line;
|
||||
@ -101,15 +101,15 @@ static device_detach_t uipaq_detach;
|
||||
static usb2_callback_t uipaq_write_callback;
|
||||
static usb2_callback_t uipaq_read_callback;
|
||||
|
||||
static void uipaq_start_read(struct usb2_com_softc *);
|
||||
static void uipaq_stop_read(struct usb2_com_softc *);
|
||||
static void uipaq_start_write(struct usb2_com_softc *);
|
||||
static void uipaq_stop_write(struct usb2_com_softc *);
|
||||
static void uipaq_cfg_set_dtr(struct usb2_com_softc *, uint8_t);
|
||||
static void uipaq_cfg_set_rts(struct usb2_com_softc *, uint8_t);
|
||||
static void uipaq_cfg_set_break(struct usb2_com_softc *, uint8_t);
|
||||
static void uipaq_start_read(struct ucom_softc *);
|
||||
static void uipaq_stop_read(struct ucom_softc *);
|
||||
static void uipaq_start_write(struct ucom_softc *);
|
||||
static void uipaq_stop_write(struct ucom_softc *);
|
||||
static void uipaq_cfg_set_dtr(struct ucom_softc *, uint8_t);
|
||||
static void uipaq_cfg_set_rts(struct ucom_softc *, uint8_t);
|
||||
static void uipaq_cfg_set_break(struct ucom_softc *, uint8_t);
|
||||
|
||||
static const struct usb2_config uipaq_config_data[UIPAQ_N_TRANSFER] = {
|
||||
static const struct usb_config uipaq_config_data[UIPAQ_N_TRANSFER] = {
|
||||
|
||||
[UIPAQ_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -130,7 +130,7 @@ static const struct usb2_config uipaq_config_data[UIPAQ_N_TRANSFER] = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_com_callback uipaq_callback = {
|
||||
static const struct ucom_callback uipaq_callback = {
|
||||
.usb2_com_cfg_set_dtr = &uipaq_cfg_set_dtr,
|
||||
.usb2_com_cfg_set_rts = &uipaq_cfg_set_rts,
|
||||
.usb2_com_cfg_set_break = &uipaq_cfg_set_break,
|
||||
@ -145,7 +145,7 @@ static const struct usb2_com_callback uipaq_callback = {
|
||||
* support the same hardware. Numeric values are used where no usbdevs
|
||||
* entries exist.
|
||||
*/
|
||||
static const struct usb2_device_id uipaq_devs[] = {
|
||||
static const struct usb_device_id uipaq_devs[] = {
|
||||
/* Socket USB Sync */
|
||||
{USB_VPI(0x0104, 0x00be, 0)},
|
||||
/* USB Sync 0301 */
|
||||
@ -1078,7 +1078,7 @@ MODULE_DEPEND(uipaq, usb, 1, 1, 1);
|
||||
static int
|
||||
uipaq_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
return (ENXIO);
|
||||
@ -1095,8 +1095,8 @@ uipaq_probe(device_t dev)
|
||||
static int
|
||||
uipaq_attach(device_t dev)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_device_request req;
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct uipaq_softc *sc = device_get_softc(dev);
|
||||
int error;
|
||||
uint8_t iface_index;
|
||||
@ -1165,7 +1165,7 @@ uipaq_detach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
uipaq_start_read(struct usb2_com_softc *ucom)
|
||||
uipaq_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uipaq_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -1174,7 +1174,7 @@ uipaq_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uipaq_stop_read(struct usb2_com_softc *ucom)
|
||||
uipaq_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uipaq_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -1183,7 +1183,7 @@ uipaq_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uipaq_start_write(struct usb2_com_softc *ucom)
|
||||
uipaq_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uipaq_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -1191,7 +1191,7 @@ uipaq_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uipaq_stop_write(struct usb2_com_softc *ucom)
|
||||
uipaq_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uipaq_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -1199,10 +1199,10 @@ uipaq_stop_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uipaq_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uipaq_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uipaq_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
DPRINTF("onoff=%d\n", onoff);
|
||||
|
||||
@ -1223,10 +1223,10 @@ uipaq_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
uipaq_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uipaq_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uipaq_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
DPRINTF("onoff=%d\n", onoff);
|
||||
|
||||
@ -1247,10 +1247,10 @@ uipaq_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
uipaq_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uipaq_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uipaq_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint16_t temp;
|
||||
|
||||
temp = onoff ? UCDC_BREAK_ON : UCDC_BREAK_OFF;
|
||||
@ -1267,7 +1267,7 @@ uipaq_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
uipaq_write_callback(struct usb2_xfer *xfer)
|
||||
uipaq_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uipaq_softc *sc = xfer->priv_sc;
|
||||
uint32_t actlen;
|
||||
@ -1294,7 +1294,7 @@ uipaq_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uipaq_read_callback(struct usb2_xfer *xfer)
|
||||
uipaq_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uipaq_softc *sc = xfer->priv_sc;
|
||||
|
||||
|
@ -94,15 +94,15 @@ enum {
|
||||
};
|
||||
|
||||
struct ulpt_softc {
|
||||
struct usb2_fifo_sc sc_fifo;
|
||||
struct usb2_fifo_sc sc_fifo_noreset;
|
||||
struct usb_fifo_sc sc_fifo;
|
||||
struct usb_fifo_sc sc_fifo_noreset;
|
||||
struct mtx sc_mtx;
|
||||
struct usb2_callout sc_watchdog;
|
||||
struct usb_callout sc_watchdog;
|
||||
|
||||
device_t sc_dev;
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb2_fifo *sc_fifo_open[2];
|
||||
struct usb2_xfer *sc_xfer[ULPT_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct usb_fifo *sc_fifo_open[2];
|
||||
struct usb_xfer *sc_xfer[ULPT_N_TRANSFER];
|
||||
|
||||
int sc_fflags; /* current open flags, FREAD and
|
||||
* FWRITE */
|
||||
@ -134,7 +134,7 @@ static usb2_fifo_ioctl_t ulpt_ioctl;
|
||||
static usb2_fifo_open_t ulpt_open;
|
||||
static usb2_fifo_open_t unlpt_open;
|
||||
|
||||
static struct usb2_fifo_methods ulpt_fifo_methods = {
|
||||
static struct usb_fifo_methods ulpt_fifo_methods = {
|
||||
.f_close = &ulpt_close,
|
||||
.f_ioctl = &ulpt_ioctl,
|
||||
.f_open = &ulpt_open,
|
||||
@ -145,7 +145,7 @@ static struct usb2_fifo_methods ulpt_fifo_methods = {
|
||||
.basename[0] = "ulpt",
|
||||
};
|
||||
|
||||
static struct usb2_fifo_methods unlpt_fifo_methods = {
|
||||
static struct usb_fifo_methods unlpt_fifo_methods = {
|
||||
.f_close = &ulpt_close,
|
||||
.f_ioctl = &ulpt_ioctl,
|
||||
.f_open = &unlpt_open,
|
||||
@ -159,7 +159,7 @@ static struct usb2_fifo_methods unlpt_fifo_methods = {
|
||||
static void
|
||||
ulpt_reset(struct ulpt_softc *sc)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
DPRINTFN(2, "\n");
|
||||
|
||||
@ -189,10 +189,10 @@ ulpt_reset(struct ulpt_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
ulpt_write_callback(struct usb2_xfer *xfer)
|
||||
ulpt_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ulpt_softc *sc = xfer->priv_sc;
|
||||
struct usb2_fifo *f = sc->sc_fifo_open[USB_FIFO_TX];
|
||||
struct usb_fifo *f = sc->sc_fifo_open[USB_FIFO_TX];
|
||||
uint32_t actlen;
|
||||
|
||||
if (f == NULL) {
|
||||
@ -225,10 +225,10 @@ ulpt_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ulpt_read_callback(struct usb2_xfer *xfer)
|
||||
ulpt_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ulpt_softc *sc = xfer->priv_sc;
|
||||
struct usb2_fifo *f = sc->sc_fifo_open[USB_FIFO_RX];
|
||||
struct usb_fifo *f = sc->sc_fifo_open[USB_FIFO_RX];
|
||||
|
||||
if (f == NULL) {
|
||||
/* should not happen */
|
||||
@ -281,10 +281,10 @@ ulpt_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ulpt_status_callback(struct usb2_xfer *xfer)
|
||||
ulpt_status_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ulpt_softc *sc = xfer->priv_sc;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint8_t cur_status;
|
||||
uint8_t new_status;
|
||||
|
||||
@ -333,7 +333,7 @@ ulpt_status_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
}
|
||||
|
||||
static const struct usb2_config ulpt_config[ULPT_N_TRANSFER] = {
|
||||
static const struct usb_config ulpt_config[ULPT_N_TRANSFER] = {
|
||||
[ULPT_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
.endpoint = UE_ADDR_ANY,
|
||||
@ -356,14 +356,14 @@ static const struct usb2_config ulpt_config[ULPT_N_TRANSFER] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request) + 1,
|
||||
.bufsize = sizeof(struct usb_device_request) + 1,
|
||||
.callback = &ulpt_status_callback,
|
||||
.timeout = 1000, /* 1 second */
|
||||
},
|
||||
};
|
||||
|
||||
static void
|
||||
ulpt_start_read(struct usb2_fifo *fifo)
|
||||
ulpt_start_read(struct usb_fifo *fifo)
|
||||
{
|
||||
struct ulpt_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -371,7 +371,7 @@ ulpt_start_read(struct usb2_fifo *fifo)
|
||||
}
|
||||
|
||||
static void
|
||||
ulpt_stop_read(struct usb2_fifo *fifo)
|
||||
ulpt_stop_read(struct usb_fifo *fifo)
|
||||
{
|
||||
struct ulpt_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -379,7 +379,7 @@ ulpt_stop_read(struct usb2_fifo *fifo)
|
||||
}
|
||||
|
||||
static void
|
||||
ulpt_start_write(struct usb2_fifo *fifo)
|
||||
ulpt_start_write(struct usb_fifo *fifo)
|
||||
{
|
||||
struct ulpt_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -387,7 +387,7 @@ ulpt_start_write(struct usb2_fifo *fifo)
|
||||
}
|
||||
|
||||
static void
|
||||
ulpt_stop_write(struct usb2_fifo *fifo)
|
||||
ulpt_stop_write(struct usb_fifo *fifo)
|
||||
{
|
||||
struct ulpt_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -395,7 +395,7 @@ ulpt_stop_write(struct usb2_fifo *fifo)
|
||||
}
|
||||
|
||||
static int
|
||||
ulpt_open(struct usb2_fifo *fifo, int fflags)
|
||||
ulpt_open(struct usb_fifo *fifo, int fflags)
|
||||
{
|
||||
struct ulpt_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -408,7 +408,7 @@ ulpt_open(struct usb2_fifo *fifo, int fflags)
|
||||
}
|
||||
|
||||
static int
|
||||
unlpt_open(struct usb2_fifo *fifo, int fflags)
|
||||
unlpt_open(struct usb_fifo *fifo, int fflags)
|
||||
{
|
||||
struct ulpt_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -446,7 +446,7 @@ unlpt_open(struct usb2_fifo *fifo, int fflags)
|
||||
}
|
||||
|
||||
static void
|
||||
ulpt_close(struct usb2_fifo *fifo, int fflags)
|
||||
ulpt_close(struct usb_fifo *fifo, int fflags)
|
||||
{
|
||||
struct ulpt_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -458,7 +458,7 @@ ulpt_close(struct usb2_fifo *fifo, int fflags)
|
||||
}
|
||||
|
||||
static int
|
||||
ulpt_ioctl(struct usb2_fifo *fifo, u_long cmd, void *data,
|
||||
ulpt_ioctl(struct usb_fifo *fifo, u_long cmd, void *data,
|
||||
int fflags)
|
||||
{
|
||||
return (ENODEV);
|
||||
@ -467,7 +467,7 @@ ulpt_ioctl(struct usb2_fifo *fifo, u_long cmd, void *data,
|
||||
static int
|
||||
ulpt_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
DPRINTFN(11, "\n");
|
||||
|
||||
@ -487,9 +487,9 @@ ulpt_probe(device_t dev)
|
||||
static int
|
||||
ulpt_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct ulpt_softc *sc = device_get_softc(dev);
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb_interface_descriptor *id;
|
||||
int unit = device_get_unit(dev);
|
||||
int error;
|
||||
uint8_t iface_index = uaa->info.bIfaceIndex;
|
||||
@ -566,8 +566,8 @@ ulpt_attach(device_t dev)
|
||||
* UHCI and less often with OHCI. *sigh*
|
||||
*/
|
||||
{
|
||||
struct usb2_config_descriptor *cd = usb2_get_config_descriptor(dev);
|
||||
struct usb2_device_request req;
|
||||
struct usb_config_descriptor *cd = usb2_get_config_descriptor(dev);
|
||||
struct usb_device_request req;
|
||||
int len, alen;
|
||||
|
||||
req.bmRequestType = UT_READ_CLASS_INTERFACE;
|
||||
|
@ -87,11 +87,11 @@ enum {
|
||||
};
|
||||
|
||||
struct umct_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom;
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom;
|
||||
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb2_xfer *sc_xfer[UMCT_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[UMCT_N_TRANSFER];
|
||||
struct mtx sc_mtx;
|
||||
|
||||
uint32_t sc_unit;
|
||||
@ -118,20 +118,20 @@ static usb2_callback_t umct_read_callback;
|
||||
|
||||
static void umct_cfg_do_request(struct umct_softc *sc, uint8_t request,
|
||||
uint16_t len, uint32_t value);
|
||||
static void umct_cfg_get_status(struct usb2_com_softc *, uint8_t *,
|
||||
static void umct_cfg_get_status(struct ucom_softc *, uint8_t *,
|
||||
uint8_t *);
|
||||
static void umct_cfg_set_break(struct usb2_com_softc *, uint8_t);
|
||||
static void umct_cfg_set_dtr(struct usb2_com_softc *, uint8_t);
|
||||
static void umct_cfg_set_rts(struct usb2_com_softc *, uint8_t);
|
||||
static void umct_cfg_set_break(struct ucom_softc *, uint8_t);
|
||||
static void umct_cfg_set_dtr(struct ucom_softc *, uint8_t);
|
||||
static void umct_cfg_set_rts(struct ucom_softc *, uint8_t);
|
||||
static uint8_t umct_calc_baud(uint32_t);
|
||||
static int umct_pre_param(struct usb2_com_softc *, struct termios *);
|
||||
static void umct_cfg_param(struct usb2_com_softc *, struct termios *);
|
||||
static void umct_start_read(struct usb2_com_softc *);
|
||||
static void umct_stop_read(struct usb2_com_softc *);
|
||||
static void umct_start_write(struct usb2_com_softc *);
|
||||
static void umct_stop_write(struct usb2_com_softc *);
|
||||
static int umct_pre_param(struct ucom_softc *, struct termios *);
|
||||
static void umct_cfg_param(struct ucom_softc *, struct termios *);
|
||||
static void umct_start_read(struct ucom_softc *);
|
||||
static void umct_stop_read(struct ucom_softc *);
|
||||
static void umct_start_write(struct ucom_softc *);
|
||||
static void umct_stop_write(struct ucom_softc *);
|
||||
|
||||
static const struct usb2_config umct_config[UMCT_N_TRANSFER] = {
|
||||
static const struct usb_config umct_config[UMCT_N_TRANSFER] = {
|
||||
|
||||
[UMCT_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -163,7 +163,7 @@ static const struct usb2_config umct_config[UMCT_N_TRANSFER] = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_com_callback umct_callback = {
|
||||
static const struct ucom_callback umct_callback = {
|
||||
.usb2_com_cfg_get_status = &umct_cfg_get_status,
|
||||
.usb2_com_cfg_set_dtr = &umct_cfg_set_dtr,
|
||||
.usb2_com_cfg_set_rts = &umct_cfg_set_rts,
|
||||
@ -176,7 +176,7 @@ static const struct usb2_com_callback umct_callback = {
|
||||
.usb2_com_stop_write = &umct_stop_write,
|
||||
};
|
||||
|
||||
static const struct usb2_device_id umct_devs[] = {
|
||||
static const struct usb_device_id umct_devs[] = {
|
||||
{USB_VPI(USB_VENDOR_MCT, USB_PRODUCT_MCT_USB232, 0)},
|
||||
{USB_VPI(USB_VENDOR_MCT, USB_PRODUCT_MCT_SITECOM_USB232, 0)},
|
||||
{USB_VPI(USB_VENDOR_MCT, USB_PRODUCT_MCT_DU_H3SP_USB232, 0)},
|
||||
@ -206,7 +206,7 @@ MODULE_DEPEND(umct, usb, 1, 1, 1);
|
||||
static int
|
||||
umct_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
return (ENXIO);
|
||||
@ -223,7 +223,7 @@ umct_probe(device_t dev)
|
||||
static int
|
||||
umct_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct umct_softc *sc = device_get_softc(dev);
|
||||
int32_t error;
|
||||
uint16_t maxp;
|
||||
@ -259,7 +259,7 @@ umct_attach(device_t dev)
|
||||
|
||||
/* guessed wrong - switch around endpoints */
|
||||
|
||||
struct usb2_xfer *temp = sc->sc_xfer[UMCT_INTR_DT_RD];
|
||||
struct usb_xfer *temp = sc->sc_xfer[UMCT_INTR_DT_RD];
|
||||
|
||||
sc->sc_xfer[UMCT_INTR_DT_RD] = sc->sc_xfer[UMCT_BULK_DT_RD];
|
||||
sc->sc_xfer[UMCT_BULK_DT_RD] = temp;
|
||||
@ -302,7 +302,7 @@ static void
|
||||
umct_cfg_do_request(struct umct_softc *sc, uint8_t request,
|
||||
uint16_t len, uint32_t value)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
uint8_t temp[4];
|
||||
|
||||
@ -326,7 +326,7 @@ umct_cfg_do_request(struct umct_softc *sc, uint8_t request,
|
||||
}
|
||||
|
||||
static void
|
||||
umct_intr_callback(struct usb2_xfer *xfer)
|
||||
umct_intr_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umct_softc *sc = xfer->priv_sc;
|
||||
uint8_t buf[2];
|
||||
@ -361,7 +361,7 @@ umct_intr_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umct_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
umct_cfg_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
{
|
||||
struct umct_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -370,7 +370,7 @@ umct_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
}
|
||||
|
||||
static void
|
||||
umct_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
umct_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct umct_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -383,7 +383,7 @@ umct_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
umct_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
umct_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct umct_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -396,7 +396,7 @@ umct_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
umct_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
umct_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct umct_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -439,13 +439,13 @@ umct_calc_baud(uint32_t baud)
|
||||
}
|
||||
|
||||
static int
|
||||
umct_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
umct_pre_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
return (0); /* we accept anything */
|
||||
}
|
||||
|
||||
static void
|
||||
umct_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
umct_cfg_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
struct umct_softc *sc = ucom->sc_parent;
|
||||
uint32_t value;
|
||||
@ -486,7 +486,7 @@ umct_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
umct_start_read(struct usb2_com_softc *ucom)
|
||||
umct_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct umct_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -498,7 +498,7 @@ umct_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
umct_stop_read(struct usb2_com_softc *ucom)
|
||||
umct_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct umct_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -510,7 +510,7 @@ umct_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
umct_start_write(struct usb2_com_softc *ucom)
|
||||
umct_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct umct_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -518,7 +518,7 @@ umct_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
umct_stop_write(struct usb2_com_softc *ucom)
|
||||
umct_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct umct_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -526,7 +526,7 @@ umct_stop_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
umct_write_callback(struct usb2_xfer *xfer)
|
||||
umct_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umct_softc *sc = xfer->priv_sc;
|
||||
uint32_t actlen;
|
||||
@ -554,7 +554,7 @@ umct_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umct_read_callback(struct usb2_xfer *xfer)
|
||||
umct_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umct_softc *sc = xfer->priv_sc;
|
||||
|
||||
|
@ -108,7 +108,7 @@ SYSCTL_INT(_hw_usb_umodem, OID_AUTO, debug, CTLFLAG_RW,
|
||||
&umodem_debug, 0, "Debug level");
|
||||
#endif
|
||||
|
||||
static const struct usb2_device_id umodem_devs[] = {
|
||||
static const struct usb_device_id umodem_devs[] = {
|
||||
/* Generic Modem class match */
|
||||
{USB_IFACE_CLASS(UICLASS_CDC),
|
||||
USB_IFACE_SUBCLASS(UISUBCLASS_ABSTRACT_CONTROL_MODEL),
|
||||
@ -137,11 +137,11 @@ enum {
|
||||
#define UMODEM_MODVER 1 /* module version */
|
||||
|
||||
struct umodem_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom;
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom;
|
||||
|
||||
struct usb2_xfer *sc_xfer[UMODEM_N_TRANSFER];
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[UMODEM_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
uint16_t sc_line;
|
||||
@ -164,25 +164,25 @@ static usb2_callback_t umodem_intr_callback;
|
||||
static usb2_callback_t umodem_write_callback;
|
||||
static usb2_callback_t umodem_read_callback;
|
||||
|
||||
static void umodem_start_read(struct usb2_com_softc *);
|
||||
static void umodem_stop_read(struct usb2_com_softc *);
|
||||
static void umodem_start_write(struct usb2_com_softc *);
|
||||
static void umodem_stop_write(struct usb2_com_softc *);
|
||||
static void umodem_get_caps(struct usb2_attach_arg *, uint8_t *, uint8_t *);
|
||||
static void umodem_cfg_get_status(struct usb2_com_softc *, uint8_t *,
|
||||
static void umodem_start_read(struct ucom_softc *);
|
||||
static void umodem_stop_read(struct ucom_softc *);
|
||||
static void umodem_start_write(struct ucom_softc *);
|
||||
static void umodem_stop_write(struct ucom_softc *);
|
||||
static void umodem_get_caps(struct usb_attach_arg *, uint8_t *, uint8_t *);
|
||||
static void umodem_cfg_get_status(struct ucom_softc *, uint8_t *,
|
||||
uint8_t *);
|
||||
static int umodem_pre_param(struct usb2_com_softc *, struct termios *);
|
||||
static void umodem_cfg_param(struct usb2_com_softc *, struct termios *);
|
||||
static int umodem_ioctl(struct usb2_com_softc *, uint32_t, caddr_t, int,
|
||||
static int umodem_pre_param(struct ucom_softc *, struct termios *);
|
||||
static void umodem_cfg_param(struct ucom_softc *, struct termios *);
|
||||
static int umodem_ioctl(struct ucom_softc *, uint32_t, caddr_t, int,
|
||||
struct thread *);
|
||||
static void umodem_cfg_set_dtr(struct usb2_com_softc *, uint8_t);
|
||||
static void umodem_cfg_set_rts(struct usb2_com_softc *, uint8_t);
|
||||
static void umodem_cfg_set_break(struct usb2_com_softc *, uint8_t);
|
||||
static void *umodem_get_desc(struct usb2_attach_arg *, uint8_t, uint8_t);
|
||||
static usb2_error_t umodem_set_comm_feature(struct usb2_device *, uint8_t,
|
||||
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,
|
||||
uint16_t, uint16_t);
|
||||
|
||||
static const struct usb2_config umodem_config[UMODEM_N_TRANSFER] = {
|
||||
static const struct usb_config umodem_config[UMODEM_N_TRANSFER] = {
|
||||
|
||||
[UMODEM_BULK_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -215,7 +215,7 @@ static const struct usb2_config umodem_config[UMODEM_N_TRANSFER] = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_com_callback umodem_callback = {
|
||||
static const struct ucom_callback umodem_callback = {
|
||||
.usb2_com_cfg_get_status = &umodem_cfg_get_status,
|
||||
.usb2_com_cfg_set_dtr = &umodem_cfg_set_dtr,
|
||||
.usb2_com_cfg_set_rts = &umodem_cfg_set_rts,
|
||||
@ -252,7 +252,7 @@ MODULE_VERSION(umodem, UMODEM_MODVER);
|
||||
static int
|
||||
umodem_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
int error;
|
||||
|
||||
DPRINTFN(11, "\n");
|
||||
@ -267,10 +267,10 @@ umodem_probe(device_t dev)
|
||||
static int
|
||||
umodem_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct umodem_softc *sc = device_get_softc(dev);
|
||||
struct usb2_cdc_cm_descriptor *cmd;
|
||||
struct usb2_cdc_union_descriptor *cud;
|
||||
struct usb_cdc_cm_descriptor *cmd;
|
||||
struct usb_cdc_union_descriptor *cud;
|
||||
uint8_t i;
|
||||
int error;
|
||||
|
||||
@ -312,8 +312,8 @@ umodem_attach(device_t dev)
|
||||
/* get the data interface too */
|
||||
|
||||
for (i = 0;; i++) {
|
||||
struct usb2_interface *iface;
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb_interface *iface;
|
||||
struct usb_interface_descriptor *id;
|
||||
|
||||
iface = usb2_get_iface(uaa->device, i);
|
||||
|
||||
@ -370,7 +370,7 @@ umodem_attach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
umodem_start_read(struct usb2_com_softc *ucom)
|
||||
umodem_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct umodem_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -382,7 +382,7 @@ umodem_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
umodem_stop_read(struct usb2_com_softc *ucom)
|
||||
umodem_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct umodem_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -394,7 +394,7 @@ umodem_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
umodem_start_write(struct usb2_com_softc *ucom)
|
||||
umodem_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct umodem_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -402,7 +402,7 @@ umodem_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
umodem_stop_write(struct usb2_com_softc *ucom)
|
||||
umodem_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct umodem_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -410,10 +410,10 @@ umodem_stop_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
umodem_get_caps(struct usb2_attach_arg *uaa, uint8_t *cm, uint8_t *acm)
|
||||
umodem_get_caps(struct usb_attach_arg *uaa, uint8_t *cm, uint8_t *acm)
|
||||
{
|
||||
struct usb2_cdc_cm_descriptor *cmd;
|
||||
struct usb2_cdc_acm_descriptor *cad;
|
||||
struct usb_cdc_cm_descriptor *cmd;
|
||||
struct usb_cdc_acm_descriptor *cad;
|
||||
|
||||
cmd = umodem_get_desc(uaa, UDESC_CS_INTERFACE, UDESCSUB_CDC_CM);
|
||||
if ((cmd == NULL) || (cmd->bLength < sizeof(*cmd))) {
|
||||
@ -431,7 +431,7 @@ umodem_get_caps(struct usb2_attach_arg *uaa, uint8_t *cm, uint8_t *acm)
|
||||
}
|
||||
|
||||
static void
|
||||
umodem_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
umodem_cfg_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
{
|
||||
struct umodem_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -442,17 +442,17 @@ umodem_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
}
|
||||
|
||||
static int
|
||||
umodem_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
umodem_pre_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
return (0); /* we accept anything */
|
||||
}
|
||||
|
||||
static void
|
||||
umodem_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
umodem_cfg_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
struct umodem_softc *sc = ucom->sc_parent;
|
||||
struct usb2_cdc_line_state ls;
|
||||
struct usb2_device_request req;
|
||||
struct usb_cdc_line_state ls;
|
||||
struct usb_device_request req;
|
||||
|
||||
DPRINTF("sc=%p\n", sc);
|
||||
|
||||
@ -498,7 +498,7 @@ umodem_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static int
|
||||
umodem_ioctl(struct usb2_com_softc *ucom, uint32_t cmd, caddr_t data,
|
||||
umodem_ioctl(struct ucom_softc *ucom, uint32_t cmd, caddr_t data,
|
||||
int flag, struct thread *td)
|
||||
{
|
||||
struct umodem_softc *sc = ucom->sc_parent;
|
||||
@ -527,10 +527,10 @@ umodem_ioctl(struct usb2_com_softc *ucom, uint32_t cmd, caddr_t data,
|
||||
}
|
||||
|
||||
static void
|
||||
umodem_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
umodem_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct umodem_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
DPRINTF("onoff=%d\n", onoff);
|
||||
|
||||
@ -551,10 +551,10 @@ umodem_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
umodem_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
umodem_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct umodem_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
DPRINTF("onoff=%d\n", onoff);
|
||||
|
||||
@ -575,10 +575,10 @@ umodem_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
umodem_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
umodem_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct umodem_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint16_t temp;
|
||||
|
||||
DPRINTF("onoff=%d\n", onoff);
|
||||
@ -600,9 +600,9 @@ umodem_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
umodem_intr_callback(struct usb2_xfer *xfer)
|
||||
umodem_intr_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_cdc_notification pkt;
|
||||
struct usb_cdc_notification pkt;
|
||||
struct umodem_softc *sc = xfer->priv_sc;
|
||||
uint16_t wLen;
|
||||
|
||||
@ -687,7 +687,7 @@ umodem_intr_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umodem_write_callback(struct usb2_xfer *xfer)
|
||||
umodem_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umodem_softc *sc = xfer->priv_sc;
|
||||
uint32_t actlen;
|
||||
@ -715,7 +715,7 @@ umodem_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umodem_read_callback(struct usb2_xfer *xfer)
|
||||
umodem_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umodem_softc *sc = xfer->priv_sc;
|
||||
|
||||
@ -744,18 +744,18 @@ umodem_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void *
|
||||
umodem_get_desc(struct usb2_attach_arg *uaa, uint8_t type, uint8_t subtype)
|
||||
umodem_get_desc(struct usb_attach_arg *uaa, uint8_t type, uint8_t subtype)
|
||||
{
|
||||
return (usb2_find_descriptor(uaa->device, NULL, uaa->info.bIfaceIndex,
|
||||
type, 0 - 1, subtype, 0 - 1));
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
umodem_set_comm_feature(struct usb2_device *udev, uint8_t iface_no,
|
||||
umodem_set_comm_feature(struct usb_device *udev, uint8_t iface_no,
|
||||
uint16_t feature, uint16_t state)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb2_cdc_abstract_state ast;
|
||||
struct usb_device_request req;
|
||||
struct usb_cdc_abstract_state ast;
|
||||
|
||||
DPRINTF("feature=%d state=%d\n",
|
||||
feature, state);
|
||||
|
@ -161,11 +161,11 @@ enum {
|
||||
};
|
||||
|
||||
struct umoscom_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom;
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom;
|
||||
|
||||
struct usb2_xfer *sc_xfer[UMOSCOM_N_TRANSFER];
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[UMOSCOM_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
uint8_t sc_mcr;
|
||||
@ -182,23 +182,23 @@ static usb2_callback_t umoscom_write_callback;
|
||||
static usb2_callback_t umoscom_read_callback;
|
||||
static usb2_callback_t umoscom_intr_callback;
|
||||
|
||||
static void umoscom_cfg_open(struct usb2_com_softc *);
|
||||
static void umoscom_cfg_close(struct usb2_com_softc *);
|
||||
static void umoscom_cfg_set_break(struct usb2_com_softc *, uint8_t);
|
||||
static void umoscom_cfg_set_dtr(struct usb2_com_softc *, uint8_t);
|
||||
static void umoscom_cfg_set_rts(struct usb2_com_softc *, uint8_t);
|
||||
static int umoscom_pre_param(struct usb2_com_softc *, struct termios *);
|
||||
static void umoscom_cfg_param(struct usb2_com_softc *, struct termios *);
|
||||
static void umoscom_cfg_get_status(struct usb2_com_softc *, uint8_t *,
|
||||
static void umoscom_cfg_open(struct ucom_softc *);
|
||||
static void umoscom_cfg_close(struct ucom_softc *);
|
||||
static void umoscom_cfg_set_break(struct ucom_softc *, uint8_t);
|
||||
static void umoscom_cfg_set_dtr(struct ucom_softc *, uint8_t);
|
||||
static void umoscom_cfg_set_rts(struct ucom_softc *, uint8_t);
|
||||
static int umoscom_pre_param(struct ucom_softc *, struct termios *);
|
||||
static void umoscom_cfg_param(struct ucom_softc *, struct termios *);
|
||||
static void umoscom_cfg_get_status(struct ucom_softc *, uint8_t *,
|
||||
uint8_t *);
|
||||
static void umoscom_cfg_write(struct umoscom_softc *, uint16_t, uint16_t);
|
||||
static uint8_t umoscom_cfg_read(struct umoscom_softc *, uint16_t);
|
||||
static void umoscom_start_read(struct usb2_com_softc *);
|
||||
static void umoscom_stop_read(struct usb2_com_softc *);
|
||||
static void umoscom_start_write(struct usb2_com_softc *);
|
||||
static void umoscom_stop_write(struct usb2_com_softc *);
|
||||
static void umoscom_start_read(struct ucom_softc *);
|
||||
static void umoscom_stop_read(struct ucom_softc *);
|
||||
static void umoscom_start_write(struct ucom_softc *);
|
||||
static void umoscom_stop_write(struct ucom_softc *);
|
||||
|
||||
static const struct usb2_config umoscom_config_data[UMOSCOM_N_TRANSFER] = {
|
||||
static const struct usb_config umoscom_config_data[UMOSCOM_N_TRANSFER] = {
|
||||
|
||||
[UMOSCOM_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -228,7 +228,7 @@ static const struct usb2_config umoscom_config_data[UMOSCOM_N_TRANSFER] = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_com_callback umoscom_callback = {
|
||||
static const struct ucom_callback umoscom_callback = {
|
||||
/* configuration callbacks */
|
||||
.usb2_com_cfg_get_status = &umoscom_cfg_get_status,
|
||||
.usb2_com_cfg_set_dtr = &umoscom_cfg_set_dtr,
|
||||
@ -265,14 +265,14 @@ DRIVER_MODULE(umoscom, uhub, umoscom_driver, umoscom_devclass, NULL, 0);
|
||||
MODULE_DEPEND(umoscom, ucom, 1, 1, 1);
|
||||
MODULE_DEPEND(umoscom, usb, 1, 1, 1);
|
||||
|
||||
static const struct usb2_device_id umoscom_devs[] = {
|
||||
static const struct usb_device_id umoscom_devs[] = {
|
||||
{USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7703, 0)}
|
||||
};
|
||||
|
||||
static int
|
||||
umoscom_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
return (ENXIO);
|
||||
@ -289,7 +289,7 @@ umoscom_probe(device_t dev)
|
||||
static int
|
||||
umoscom_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct umoscom_softc *sc = device_get_softc(dev);
|
||||
int error;
|
||||
uint8_t iface_index;
|
||||
@ -343,7 +343,7 @@ umoscom_detach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
umoscom_cfg_open(struct usb2_com_softc *ucom)
|
||||
umoscom_cfg_open(struct ucom_softc *ucom)
|
||||
{
|
||||
struct umoscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -369,13 +369,13 @@ umoscom_cfg_open(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
umoscom_cfg_close(struct usb2_com_softc *ucom)
|
||||
umoscom_cfg_close(struct ucom_softc *ucom)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
umoscom_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
umoscom_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct umoscom_softc *sc = ucom->sc_parent;
|
||||
uint16_t val;
|
||||
@ -388,7 +388,7 @@ umoscom_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
umoscom_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
umoscom_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct umoscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -401,7 +401,7 @@ umoscom_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
umoscom_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
umoscom_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct umoscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -414,7 +414,7 @@ umoscom_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static int
|
||||
umoscom_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
umoscom_pre_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
if ((t->c_ospeed <= 1) || (t->c_ospeed > 115200))
|
||||
return (EINVAL);
|
||||
@ -423,7 +423,7 @@ umoscom_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
umoscom_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
umoscom_cfg_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
struct umoscom_softc *sc = ucom->sc_parent;
|
||||
uint16_t data;
|
||||
@ -478,7 +478,7 @@ umoscom_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
umoscom_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *p_lsr, uint8_t *p_msr)
|
||||
umoscom_cfg_get_status(struct ucom_softc *ucom, uint8_t *p_lsr, uint8_t *p_msr)
|
||||
{
|
||||
struct umoscom_softc *sc = ucom->sc_parent;
|
||||
uint8_t lsr;
|
||||
@ -509,7 +509,7 @@ umoscom_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *p_lsr, uint8_t *p_m
|
||||
static void
|
||||
umoscom_cfg_write(struct umoscom_softc *sc, uint16_t reg, uint16_t val)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
req.bRequest = UMOSCOM_WRITE;
|
||||
@ -524,7 +524,7 @@ umoscom_cfg_write(struct umoscom_softc *sc, uint16_t reg, uint16_t val)
|
||||
static uint8_t
|
||||
umoscom_cfg_read(struct umoscom_softc *sc, uint16_t reg)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint8_t val;
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_DEVICE;
|
||||
@ -542,7 +542,7 @@ umoscom_cfg_read(struct umoscom_softc *sc, uint16_t reg)
|
||||
}
|
||||
|
||||
static void
|
||||
umoscom_start_read(struct usb2_com_softc *ucom)
|
||||
umoscom_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct umoscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -555,7 +555,7 @@ umoscom_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
umoscom_stop_read(struct usb2_com_softc *ucom)
|
||||
umoscom_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct umoscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -567,7 +567,7 @@ umoscom_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
umoscom_start_write(struct usb2_com_softc *ucom)
|
||||
umoscom_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct umoscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -575,7 +575,7 @@ umoscom_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
umoscom_stop_write(struct usb2_com_softc *ucom)
|
||||
umoscom_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct umoscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -583,7 +583,7 @@ umoscom_stop_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
umoscom_write_callback(struct usb2_xfer *xfer)
|
||||
umoscom_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umoscom_softc *sc = xfer->priv_sc;
|
||||
uint32_t actlen;
|
||||
@ -614,7 +614,7 @@ umoscom_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umoscom_read_callback(struct usb2_xfer *xfer)
|
||||
umoscom_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umoscom_softc *sc = xfer->priv_sc;
|
||||
|
||||
@ -643,7 +643,7 @@ umoscom_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umoscom_intr_callback(struct usb2_xfer *xfer)
|
||||
umoscom_intr_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umoscom_softc *sc = xfer->priv_sc;
|
||||
|
||||
|
@ -140,11 +140,11 @@ enum {
|
||||
};
|
||||
|
||||
struct uplcom_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom;
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom;
|
||||
|
||||
struct usb2_xfer *sc_xfer[UPLCOM_N_TRANSFER];
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[UPLCOM_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
uint16_t sc_line;
|
||||
@ -159,18 +159,18 @@ struct uplcom_softc {
|
||||
|
||||
/* prototypes */
|
||||
|
||||
static usb2_error_t uplcom_reset(struct uplcom_softc *, struct usb2_device *);
|
||||
static int uplcom_pl2303x_init(struct usb2_device *);
|
||||
static void uplcom_cfg_set_dtr(struct usb2_com_softc *, uint8_t);
|
||||
static void uplcom_cfg_set_rts(struct usb2_com_softc *, uint8_t);
|
||||
static void uplcom_cfg_set_break(struct usb2_com_softc *, uint8_t);
|
||||
static int uplcom_pre_param(struct usb2_com_softc *, struct termios *);
|
||||
static void uplcom_cfg_param(struct usb2_com_softc *, struct termios *);
|
||||
static void uplcom_start_read(struct usb2_com_softc *);
|
||||
static void uplcom_stop_read(struct usb2_com_softc *);
|
||||
static void uplcom_start_write(struct usb2_com_softc *);
|
||||
static void uplcom_stop_write(struct usb2_com_softc *);
|
||||
static void uplcom_cfg_get_status(struct usb2_com_softc *, uint8_t *,
|
||||
static usb2_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);
|
||||
static void uplcom_cfg_set_break(struct ucom_softc *, uint8_t);
|
||||
static int uplcom_pre_param(struct ucom_softc *, struct termios *);
|
||||
static void uplcom_cfg_param(struct ucom_softc *, struct termios *);
|
||||
static void uplcom_start_read(struct ucom_softc *);
|
||||
static void uplcom_stop_read(struct ucom_softc *);
|
||||
static void uplcom_start_write(struct ucom_softc *);
|
||||
static void uplcom_stop_write(struct ucom_softc *);
|
||||
static void uplcom_cfg_get_status(struct ucom_softc *, uint8_t *,
|
||||
uint8_t *);
|
||||
|
||||
static device_probe_t uplcom_probe;
|
||||
@ -181,7 +181,7 @@ static usb2_callback_t uplcom_intr_callback;
|
||||
static usb2_callback_t uplcom_write_callback;
|
||||
static usb2_callback_t uplcom_read_callback;
|
||||
|
||||
static const struct usb2_config uplcom_config_data[UPLCOM_N_TRANSFER] = {
|
||||
static const struct usb_config uplcom_config_data[UPLCOM_N_TRANSFER] = {
|
||||
|
||||
[UPLCOM_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -214,7 +214,7 @@ static const struct usb2_config uplcom_config_data[UPLCOM_N_TRANSFER] = {
|
||||
},
|
||||
};
|
||||
|
||||
struct usb2_com_callback uplcom_callback = {
|
||||
struct ucom_callback uplcom_callback = {
|
||||
.usb2_com_cfg_get_status = &uplcom_cfg_get_status,
|
||||
.usb2_com_cfg_set_dtr = &uplcom_cfg_set_dtr,
|
||||
.usb2_com_cfg_set_rts = &uplcom_cfg_set_rts,
|
||||
@ -231,7 +231,7 @@ struct usb2_com_callback uplcom_callback = {
|
||||
USB_VENDOR(v), USB_PRODUCT(p), USB_DEV_BCD_GTEQ(rl), \
|
||||
USB_DEV_BCD_LTEQ(rh), USB_DRIVER_INFO(t)
|
||||
|
||||
static const struct usb2_device_id uplcom_devs[] = {
|
||||
static const struct usb_device_id uplcom_devs[] = {
|
||||
/* Belkin F5U257 */
|
||||
{USB_UPL(USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_F5U257, 0, 0xFFFF, TYPE_PL2303X)},
|
||||
/* I/O DATA USB-RSAQ */
|
||||
@ -302,7 +302,7 @@ MODULE_VERSION(uplcom, UPLCOM_MODVER);
|
||||
static int
|
||||
uplcom_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
DPRINTFN(11, "\n");
|
||||
|
||||
@ -321,10 +321,10 @@ uplcom_probe(device_t dev)
|
||||
static int
|
||||
uplcom_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct uplcom_softc *sc = device_get_softc(dev);
|
||||
struct usb2_interface *iface;
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb_interface *iface;
|
||||
struct usb_interface_descriptor *id;
|
||||
int error;
|
||||
|
||||
DPRINTFN(11, "\n");
|
||||
@ -430,9 +430,9 @@ uplcom_detach(device_t dev)
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
uplcom_reset(struct uplcom_softc *sc, struct usb2_device *udev)
|
||||
uplcom_reset(struct uplcom_softc *sc, struct usb_device *udev)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
req.bRequest = UPLCOM_SET_REQUEST;
|
||||
@ -471,9 +471,9 @@ static const struct pl2303x_init pl2303x[] = {
|
||||
#define N_PL2302X_INIT (sizeof(pl2303x)/sizeof(pl2303x[0]))
|
||||
|
||||
static int
|
||||
uplcom_pl2303x_init(struct usb2_device *udev)
|
||||
uplcom_pl2303x_init(struct usb_device *udev)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
uint8_t buf[4];
|
||||
uint8_t i;
|
||||
@ -495,10 +495,10 @@ uplcom_pl2303x_init(struct usb2_device *udev)
|
||||
}
|
||||
|
||||
static void
|
||||
uplcom_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uplcom_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uplcom_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
DPRINTF("onoff = %d\n", onoff);
|
||||
|
||||
@ -519,10 +519,10 @@ uplcom_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
uplcom_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uplcom_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uplcom_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
DPRINTF("onoff = %d\n", onoff);
|
||||
|
||||
@ -543,10 +543,10 @@ uplcom_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
uplcom_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uplcom_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uplcom_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint16_t temp;
|
||||
|
||||
DPRINTF("onoff = %d\n", onoff);
|
||||
@ -577,7 +577,7 @@ static const int32_t uplcom_rates[] = {
|
||||
#define N_UPLCOM_RATES (sizeof(uplcom_rates)/sizeof(uplcom_rates[0]))
|
||||
|
||||
static int
|
||||
uplcom_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
uplcom_pre_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
uint8_t i;
|
||||
|
||||
@ -601,11 +601,11 @@ uplcom_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
uplcom_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
uplcom_cfg_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
struct uplcom_softc *sc = ucom->sc_parent;
|
||||
struct usb2_cdc_line_state ls;
|
||||
struct usb2_device_request req;
|
||||
struct usb_cdc_line_state ls;
|
||||
struct usb_device_request req;
|
||||
|
||||
DPRINTF("sc = %p\n", sc);
|
||||
|
||||
@ -685,7 +685,7 @@ uplcom_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
uplcom_start_read(struct usb2_com_softc *ucom)
|
||||
uplcom_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uplcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -697,7 +697,7 @@ uplcom_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uplcom_stop_read(struct usb2_com_softc *ucom)
|
||||
uplcom_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uplcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -709,7 +709,7 @@ uplcom_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uplcom_start_write(struct usb2_com_softc *ucom)
|
||||
uplcom_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uplcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -717,7 +717,7 @@ uplcom_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uplcom_stop_write(struct usb2_com_softc *ucom)
|
||||
uplcom_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uplcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -725,7 +725,7 @@ uplcom_stop_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uplcom_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
uplcom_cfg_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
{
|
||||
struct uplcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -736,7 +736,7 @@ uplcom_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
}
|
||||
|
||||
static void
|
||||
uplcom_intr_callback(struct usb2_xfer *xfer)
|
||||
uplcom_intr_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uplcom_softc *sc = xfer->priv_sc;
|
||||
uint8_t buf[9];
|
||||
@ -783,7 +783,7 @@ uplcom_intr_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uplcom_write_callback(struct usb2_xfer *xfer)
|
||||
uplcom_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uplcom_softc *sc = xfer->priv_sc;
|
||||
uint32_t actlen;
|
||||
@ -813,7 +813,7 @@ uplcom_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uplcom_read_callback(struct usb2_xfer *xfer)
|
||||
uplcom_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uplcom_softc *sc = xfer->priv_sc;
|
||||
|
||||
|
@ -101,15 +101,15 @@ static usb2_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 usb2_com_softc *, uint32_t);
|
||||
static void usb2_com_detach_tty(struct usb2_com_softc *);
|
||||
static void usb2_com_queue_command(struct usb2_com_softc *,
|
||||
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,
|
||||
struct usb2_proc_msg *t0, struct usb2_proc_msg *t1);
|
||||
static void usb2_com_shutdown(struct usb2_com_softc *);
|
||||
static void usb2_com_break(struct usb2_com_softc *, uint8_t);
|
||||
static void usb2_com_dtr(struct usb2_com_softc *, uint8_t);
|
||||
static void usb2_com_rts(struct usb2_com_softc *, uint8_t);
|
||||
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);
|
||||
static void usb2_com_dtr(struct ucom_softc *, uint8_t);
|
||||
static void usb2_com_rts(struct ucom_softc *, uint8_t);
|
||||
|
||||
static tsw_open_t usb2_com_open;
|
||||
static tsw_close_t usb2_com_close;
|
||||
@ -215,9 +215,9 @@ usb2_com_units_free(uint32_t root_unit, uint32_t sub_units)
|
||||
* before calling into the ucom-layer!
|
||||
*/
|
||||
int
|
||||
usb2_com_attach(struct usb2_com_super_softc *ssc, struct usb2_com_softc *sc,
|
||||
usb2_com_attach(struct ucom_super_softc *ssc, struct ucom_softc *sc,
|
||||
uint32_t sub_units, void *parent,
|
||||
const struct usb2_com_callback *callback, struct mtx *mtx)
|
||||
const struct ucom_callback *callback, struct mtx *mtx)
|
||||
{
|
||||
uint32_t n;
|
||||
uint32_t root_unit;
|
||||
@ -265,7 +265,7 @@ usb2_com_attach(struct usb2_com_super_softc *ssc, struct usb2_com_softc *sc,
|
||||
* the structure pointed to by "ssc" and "sc" is zero.
|
||||
*/
|
||||
void
|
||||
usb2_com_detach(struct usb2_com_super_softc *ssc, struct usb2_com_softc *sc,
|
||||
usb2_com_detach(struct ucom_super_softc *ssc, struct ucom_softc *sc,
|
||||
uint32_t sub_units)
|
||||
{
|
||||
uint32_t n;
|
||||
@ -287,7 +287,7 @@ usb2_com_detach(struct usb2_com_super_softc *ssc, struct usb2_com_softc *sc,
|
||||
}
|
||||
|
||||
static int
|
||||
usb2_com_attach_tty(struct usb2_com_softc *sc, uint32_t sub_units)
|
||||
usb2_com_attach_tty(struct ucom_softc *sc, uint32_t sub_units)
|
||||
{
|
||||
struct tty *tp;
|
||||
int error = 0;
|
||||
@ -335,7 +335,7 @@ usb2_com_attach_tty(struct usb2_com_softc *sc, uint32_t sub_units)
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_com_detach_tty(struct usb2_com_softc *sc)
|
||||
usb2_com_detach_tty(struct ucom_softc *sc)
|
||||
{
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
||||
@ -374,12 +374,12 @@ usb2_com_detach_tty(struct usb2_com_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_com_queue_command(struct usb2_com_softc *sc,
|
||||
usb2_com_queue_command(struct ucom_softc *sc,
|
||||
usb2_proc_callback_t *fn, struct termios *pt,
|
||||
struct usb2_proc_msg *t0, struct usb2_proc_msg *t1)
|
||||
struct usb_proc_msg *t0, struct usb_proc_msg *t1)
|
||||
{
|
||||
struct usb2_com_super_softc *ssc = sc->sc_super;
|
||||
struct usb2_com_param_task *task;
|
||||
struct ucom_super_softc *ssc = sc->sc_super;
|
||||
struct ucom_param_task *task;
|
||||
|
||||
mtx_assert(sc->sc_mtx, MA_OWNED);
|
||||
|
||||
@ -392,7 +392,7 @@ usb2_com_queue_command(struct usb2_com_softc *sc,
|
||||
* "sc_mtx" mutex. It is safe to update fields in the message
|
||||
* structure after that the message got queued.
|
||||
*/
|
||||
task = (struct usb2_com_param_task *)
|
||||
task = (struct ucom_param_task *)
|
||||
usb2_proc_msignal(&ssc->sc_tq, t0, t1);
|
||||
|
||||
/* Setup callback and softc pointers */
|
||||
@ -421,7 +421,7 @@ usb2_com_queue_command(struct usb2_com_softc *sc,
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_com_shutdown(struct usb2_com_softc *sc)
|
||||
usb2_com_shutdown(struct ucom_softc *sc)
|
||||
{
|
||||
struct tty *tp = sc->sc_tty;
|
||||
|
||||
@ -443,19 +443,19 @@ usb2_com_shutdown(struct usb2_com_softc *sc)
|
||||
* else: taskqueue is draining or gone
|
||||
*/
|
||||
uint8_t
|
||||
usb2_com_cfg_is_gone(struct usb2_com_softc *sc)
|
||||
usb2_com_cfg_is_gone(struct ucom_softc *sc)
|
||||
{
|
||||
struct usb2_com_super_softc *ssc = sc->sc_super;
|
||||
struct ucom_super_softc *ssc = sc->sc_super;
|
||||
|
||||
return (usb2_proc_is_gone(&ssc->sc_tq));
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_com_cfg_start_transfers(struct usb2_proc_msg *_task)
|
||||
usb2_com_cfg_start_transfers(struct usb_proc_msg *_task)
|
||||
{
|
||||
struct usb2_com_cfg_task *task =
|
||||
(struct usb2_com_cfg_task *)_task;
|
||||
struct usb2_com_softc *sc = task->sc;
|
||||
struct ucom_cfg_task *task =
|
||||
(struct ucom_cfg_task *)_task;
|
||||
struct ucom_softc *sc = task->sc;
|
||||
|
||||
if (!(sc->sc_flag & UCOM_FLAG_LL_READY)) {
|
||||
return;
|
||||
@ -477,7 +477,7 @@ usb2_com_cfg_start_transfers(struct usb2_proc_msg *_task)
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_com_start_transfers(struct usb2_com_softc *sc)
|
||||
usb2_com_start_transfers(struct ucom_softc *sc)
|
||||
{
|
||||
if (!(sc->sc_flag & UCOM_FLAG_HL_READY)) {
|
||||
return;
|
||||
@ -495,11 +495,11 @@ usb2_com_start_transfers(struct usb2_com_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_com_cfg_open(struct usb2_proc_msg *_task)
|
||||
usb2_com_cfg_open(struct usb_proc_msg *_task)
|
||||
{
|
||||
struct usb2_com_cfg_task *task =
|
||||
(struct usb2_com_cfg_task *)_task;
|
||||
struct usb2_com_softc *sc = task->sc;
|
||||
struct ucom_cfg_task *task =
|
||||
(struct ucom_cfg_task *)_task;
|
||||
struct ucom_softc *sc = task->sc;
|
||||
|
||||
DPRINTF("\n");
|
||||
|
||||
@ -523,7 +523,7 @@ usb2_com_cfg_open(struct usb2_proc_msg *_task)
|
||||
static int
|
||||
usb2_com_open(struct tty *tp)
|
||||
{
|
||||
struct usb2_com_softc *sc = tty_softc(tp);
|
||||
struct ucom_softc *sc = tty_softc(tp);
|
||||
int error;
|
||||
|
||||
mtx_assert(sc->sc_mtx, MA_OWNED);
|
||||
@ -580,11 +580,11 @@ usb2_com_open(struct tty *tp)
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_com_cfg_close(struct usb2_proc_msg *_task)
|
||||
usb2_com_cfg_close(struct usb_proc_msg *_task)
|
||||
{
|
||||
struct usb2_com_cfg_task *task =
|
||||
(struct usb2_com_cfg_task *)_task;
|
||||
struct usb2_com_softc *sc = task->sc;
|
||||
struct ucom_cfg_task *task =
|
||||
(struct ucom_cfg_task *)_task;
|
||||
struct ucom_softc *sc = task->sc;
|
||||
|
||||
DPRINTF("\n");
|
||||
|
||||
@ -600,7 +600,7 @@ usb2_com_cfg_close(struct usb2_proc_msg *_task)
|
||||
static void
|
||||
usb2_com_close(struct tty *tp)
|
||||
{
|
||||
struct usb2_com_softc *sc = tty_softc(tp);
|
||||
struct ucom_softc *sc = tty_softc(tp);
|
||||
|
||||
mtx_assert(sc->sc_mtx, MA_OWNED);
|
||||
|
||||
@ -626,7 +626,7 @@ usb2_com_close(struct tty *tp)
|
||||
static int
|
||||
usb2_com_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td)
|
||||
{
|
||||
struct usb2_com_softc *sc = tty_softc(tp);
|
||||
struct ucom_softc *sc = tty_softc(tp);
|
||||
int error;
|
||||
|
||||
mtx_assert(sc->sc_mtx, MA_OWNED);
|
||||
@ -660,7 +660,7 @@ usb2_com_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td)
|
||||
static int
|
||||
usb2_com_modem(struct tty *tp, int sigon, int sigoff)
|
||||
{
|
||||
struct usb2_com_softc *sc = tty_softc(tp);
|
||||
struct ucom_softc *sc = tty_softc(tp);
|
||||
uint8_t onoff;
|
||||
|
||||
mtx_assert(sc->sc_mtx, MA_OWNED);
|
||||
@ -712,11 +712,11 @@ usb2_com_modem(struct tty *tp, int sigon, int sigoff)
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_com_cfg_line_state(struct usb2_proc_msg *_task)
|
||||
usb2_com_cfg_line_state(struct usb_proc_msg *_task)
|
||||
{
|
||||
struct usb2_com_cfg_task *task =
|
||||
(struct usb2_com_cfg_task *)_task;
|
||||
struct usb2_com_softc *sc = task->sc;
|
||||
struct ucom_cfg_task *task =
|
||||
(struct ucom_cfg_task *)_task;
|
||||
struct ucom_softc *sc = task->sc;
|
||||
uint8_t notch_bits;
|
||||
uint8_t any_bits;
|
||||
uint8_t prev_value;
|
||||
@ -771,7 +771,7 @@ usb2_com_cfg_line_state(struct usb2_proc_msg *_task)
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_com_line_state(struct usb2_com_softc *sc,
|
||||
usb2_com_line_state(struct ucom_softc *sc,
|
||||
uint8_t set_bits, uint8_t clear_bits)
|
||||
{
|
||||
mtx_assert(sc->sc_mtx, MA_OWNED);
|
||||
@ -795,7 +795,7 @@ usb2_com_line_state(struct usb2_com_softc *sc,
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_com_break(struct usb2_com_softc *sc, uint8_t onoff)
|
||||
usb2_com_break(struct ucom_softc *sc, uint8_t onoff)
|
||||
{
|
||||
DPRINTF("onoff = %d\n", onoff);
|
||||
|
||||
@ -806,7 +806,7 @@ usb2_com_break(struct usb2_com_softc *sc, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_com_dtr(struct usb2_com_softc *sc, uint8_t onoff)
|
||||
usb2_com_dtr(struct ucom_softc *sc, uint8_t onoff)
|
||||
{
|
||||
DPRINTF("onoff = %d\n", onoff);
|
||||
|
||||
@ -817,7 +817,7 @@ usb2_com_dtr(struct usb2_com_softc *sc, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_com_rts(struct usb2_com_softc *sc, uint8_t onoff)
|
||||
usb2_com_rts(struct ucom_softc *sc, uint8_t onoff)
|
||||
{
|
||||
DPRINTF("onoff = %d\n", onoff);
|
||||
|
||||
@ -828,11 +828,11 @@ usb2_com_rts(struct usb2_com_softc *sc, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_com_cfg_status_change(struct usb2_proc_msg *_task)
|
||||
usb2_com_cfg_status_change(struct usb_proc_msg *_task)
|
||||
{
|
||||
struct usb2_com_cfg_task *task =
|
||||
(struct usb2_com_cfg_task *)_task;
|
||||
struct usb2_com_softc *sc = task->sc;
|
||||
struct ucom_cfg_task *task =
|
||||
(struct ucom_cfg_task *)_task;
|
||||
struct ucom_softc *sc = task->sc;
|
||||
struct tty *tp;
|
||||
uint8_t new_msr;
|
||||
uint8_t new_lsr;
|
||||
@ -875,7 +875,7 @@ usb2_com_cfg_status_change(struct usb2_proc_msg *_task)
|
||||
}
|
||||
|
||||
void
|
||||
usb2_com_status_change(struct usb2_com_softc *sc)
|
||||
usb2_com_status_change(struct ucom_softc *sc)
|
||||
{
|
||||
mtx_assert(sc->sc_mtx, MA_OWNED);
|
||||
|
||||
@ -890,11 +890,11 @@ usb2_com_status_change(struct usb2_com_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_com_cfg_param(struct usb2_proc_msg *_task)
|
||||
usb2_com_cfg_param(struct usb_proc_msg *_task)
|
||||
{
|
||||
struct usb2_com_param_task *task =
|
||||
(struct usb2_com_param_task *)_task;
|
||||
struct usb2_com_softc *sc = task->sc;
|
||||
struct ucom_param_task *task =
|
||||
(struct ucom_param_task *)_task;
|
||||
struct ucom_softc *sc = task->sc;
|
||||
|
||||
if (!(sc->sc_flag & UCOM_FLAG_LL_READY)) {
|
||||
return;
|
||||
@ -912,7 +912,7 @@ usb2_com_cfg_param(struct usb2_proc_msg *_task)
|
||||
static int
|
||||
usb2_com_param(struct tty *tp, struct termios *t)
|
||||
{
|
||||
struct usb2_com_softc *sc = tty_softc(tp);
|
||||
struct ucom_softc *sc = tty_softc(tp);
|
||||
uint8_t opened;
|
||||
int error;
|
||||
|
||||
@ -986,7 +986,7 @@ usb2_com_param(struct tty *tp, struct termios *t)
|
||||
static void
|
||||
usb2_com_outwakeup(struct tty *tp)
|
||||
{
|
||||
struct usb2_com_softc *sc = tty_softc(tp);
|
||||
struct ucom_softc *sc = tty_softc(tp);
|
||||
|
||||
mtx_assert(sc->sc_mtx, MA_OWNED);
|
||||
|
||||
@ -1007,10 +1007,10 @@ usb2_com_outwakeup(struct tty *tp)
|
||||
* Else: Data is available.
|
||||
*------------------------------------------------------------------------*/
|
||||
uint8_t
|
||||
usb2_com_get_data(struct usb2_com_softc *sc, struct usb2_page_cache *pc,
|
||||
usb2_com_get_data(struct ucom_softc *sc, struct usb_page_cache *pc,
|
||||
uint32_t offset, uint32_t len, uint32_t *actlen)
|
||||
{
|
||||
struct usb2_page_search res;
|
||||
struct usb_page_search res;
|
||||
struct tty *tp = sc->sc_tty;
|
||||
uint32_t cnt;
|
||||
uint32_t offset_orig;
|
||||
@ -1054,10 +1054,10 @@ usb2_com_get_data(struct usb2_com_softc *sc, struct usb2_page_cache *pc,
|
||||
}
|
||||
|
||||
void
|
||||
usb2_com_put_data(struct usb2_com_softc *sc, struct usb2_page_cache *pc,
|
||||
usb2_com_put_data(struct ucom_softc *sc, struct usb_page_cache *pc,
|
||||
uint32_t offset, uint32_t len)
|
||||
{
|
||||
struct usb2_page_search res;
|
||||
struct usb_page_search res;
|
||||
struct tty *tp = sc->sc_tty;
|
||||
char *buf;
|
||||
uint32_t cnt;
|
||||
@ -1113,7 +1113,7 @@ usb2_com_put_data(struct usb2_com_softc *sc, struct usb2_page_cache *pc,
|
||||
static void
|
||||
usb2_com_free(void *xsc)
|
||||
{
|
||||
struct usb2_com_softc *sc = xsc;
|
||||
struct ucom_softc *sc = xsc;
|
||||
|
||||
mtx_lock(sc->sc_mtx);
|
||||
sc->sc_ttyfreed = 1;
|
||||
|
@ -79,9 +79,9 @@
|
||||
#define UCOM_PREFVER UCOM_MODVER
|
||||
#define UCOM_MAXVER 1
|
||||
|
||||
struct usb2_device;
|
||||
struct usb2_com_softc;
|
||||
struct usb2_device_request;
|
||||
struct usb_device;
|
||||
struct ucom_softc;
|
||||
struct usb_device_request;
|
||||
struct thread;
|
||||
|
||||
/*
|
||||
@ -89,22 +89,22 @@ struct thread;
|
||||
* be called after "usb2_com_cfg_open()" if the device is detached
|
||||
* while it is open!
|
||||
*/
|
||||
struct usb2_com_callback {
|
||||
void (*usb2_com_cfg_get_status) (struct usb2_com_softc *, uint8_t *plsr, uint8_t *pmsr);
|
||||
void (*usb2_com_cfg_set_dtr) (struct usb2_com_softc *, uint8_t);
|
||||
void (*usb2_com_cfg_set_rts) (struct usb2_com_softc *, uint8_t);
|
||||
void (*usb2_com_cfg_set_break) (struct usb2_com_softc *, uint8_t);
|
||||
void (*usb2_com_cfg_param) (struct usb2_com_softc *, struct termios *);
|
||||
void (*usb2_com_cfg_open) (struct usb2_com_softc *);
|
||||
void (*usb2_com_cfg_close) (struct usb2_com_softc *);
|
||||
int (*usb2_com_pre_open) (struct usb2_com_softc *);
|
||||
int (*usb2_com_pre_param) (struct usb2_com_softc *, struct termios *);
|
||||
int (*usb2_com_ioctl) (struct usb2_com_softc *, uint32_t, caddr_t, int, struct thread *);
|
||||
void (*usb2_com_start_read) (struct usb2_com_softc *);
|
||||
void (*usb2_com_stop_read) (struct usb2_com_softc *);
|
||||
void (*usb2_com_start_write) (struct usb2_com_softc *);
|
||||
void (*usb2_com_stop_write) (struct usb2_com_softc *);
|
||||
void (*usb2_com_tty_name) (struct usb2_com_softc *, char *pbuf, uint16_t buflen, uint16_t local_subunit);
|
||||
struct ucom_callback {
|
||||
void (*usb2_com_cfg_get_status) (struct ucom_softc *, uint8_t *plsr, uint8_t *pmsr);
|
||||
void (*usb2_com_cfg_set_dtr) (struct ucom_softc *, uint8_t);
|
||||
void (*usb2_com_cfg_set_rts) (struct ucom_softc *, uint8_t);
|
||||
void (*usb2_com_cfg_set_break) (struct ucom_softc *, uint8_t);
|
||||
void (*usb2_com_cfg_param) (struct ucom_softc *, struct termios *);
|
||||
void (*usb2_com_cfg_open) (struct ucom_softc *);
|
||||
void (*usb2_com_cfg_close) (struct ucom_softc *);
|
||||
int (*usb2_com_pre_open) (struct ucom_softc *);
|
||||
int (*usb2_com_pre_param) (struct ucom_softc *, struct termios *);
|
||||
int (*usb2_com_ioctl) (struct ucom_softc *, uint32_t, caddr_t, int, struct thread *);
|
||||
void (*usb2_com_start_read) (struct ucom_softc *);
|
||||
void (*usb2_com_stop_read) (struct ucom_softc *);
|
||||
void (*usb2_com_start_write) (struct ucom_softc *);
|
||||
void (*usb2_com_stop_write) (struct ucom_softc *);
|
||||
void (*usb2_com_tty_name) (struct ucom_softc *, char *pbuf, uint16_t buflen, uint16_t local_subunit);
|
||||
};
|
||||
|
||||
/* Line status register */
|
||||
@ -118,22 +118,22 @@ struct usb2_com_callback {
|
||||
#define ULSR_RXRDY 0x01 /* Byte ready in Receive Buffer */
|
||||
#define ULSR_RCV_MASK 0x1f /* Mask for incoming data or error */
|
||||
|
||||
struct usb2_com_cfg_task {
|
||||
struct usb2_proc_msg hdr;
|
||||
struct usb2_com_softc *sc;
|
||||
struct ucom_cfg_task {
|
||||
struct usb_proc_msg hdr;
|
||||
struct ucom_softc *sc;
|
||||
};
|
||||
|
||||
struct usb2_com_param_task {
|
||||
struct usb2_proc_msg hdr;
|
||||
struct usb2_com_softc *sc;
|
||||
struct ucom_param_task {
|
||||
struct usb_proc_msg hdr;
|
||||
struct ucom_softc *sc;
|
||||
struct termios termios_copy;
|
||||
};
|
||||
|
||||
struct usb2_com_super_softc {
|
||||
struct usb2_process sc_tq;
|
||||
struct ucom_super_softc {
|
||||
struct usb_process sc_tq;
|
||||
};
|
||||
|
||||
struct usb2_com_softc {
|
||||
struct ucom_softc {
|
||||
/*
|
||||
* NOTE: To avoid loosing level change information we use two
|
||||
* tasks instead of one for all commands.
|
||||
@ -145,17 +145,17 @@ struct usb2_com_softc {
|
||||
* OPEN->CLOSE
|
||||
* CLOSE->OPEN
|
||||
*/
|
||||
struct usb2_com_cfg_task sc_start_task[2];
|
||||
struct usb2_com_cfg_task sc_open_task[2];
|
||||
struct usb2_com_cfg_task sc_close_task[2];
|
||||
struct usb2_com_cfg_task sc_line_state_task[2];
|
||||
struct usb2_com_cfg_task sc_status_task[2];
|
||||
struct usb2_com_param_task sc_param_task[2];
|
||||
struct ucom_cfg_task sc_start_task[2];
|
||||
struct ucom_cfg_task sc_open_task[2];
|
||||
struct ucom_cfg_task sc_close_task[2];
|
||||
struct ucom_cfg_task sc_line_state_task[2];
|
||||
struct ucom_cfg_task sc_status_task[2];
|
||||
struct ucom_param_task sc_param_task[2];
|
||||
struct cv sc_cv;
|
||||
/* Used to set "UCOM_FLAG_GP_DATA" flag: */
|
||||
struct usb2_proc_msg *sc_last_start_xfer;
|
||||
const struct usb2_com_callback *sc_callback;
|
||||
struct usb2_com_super_softc *sc_super;
|
||||
struct usb_proc_msg *sc_last_start_xfer;
|
||||
const struct ucom_callback *sc_callback;
|
||||
struct ucom_super_softc *sc_super;
|
||||
struct tty *sc_tty;
|
||||
struct mtx *sc_mtx;
|
||||
void *sc_parent;
|
||||
@ -185,15 +185,15 @@ struct usb2_com_softc {
|
||||
#define usb2_com_cfg_do_request(udev,com,req,ptr,flags,timo) \
|
||||
usb2_do_request_proc(udev,&(com)->sc_super->sc_tq,req,ptr,flags,NULL,timo)
|
||||
|
||||
int usb2_com_attach(struct usb2_com_super_softc *,
|
||||
struct usb2_com_softc *, uint32_t, void *,
|
||||
const struct usb2_com_callback *callback, struct mtx *);
|
||||
void usb2_com_detach(struct usb2_com_super_softc *,
|
||||
struct usb2_com_softc *, uint32_t);
|
||||
void usb2_com_status_change(struct usb2_com_softc *);
|
||||
uint8_t usb2_com_get_data(struct usb2_com_softc *, struct usb2_page_cache *,
|
||||
int usb2_com_attach(struct ucom_super_softc *,
|
||||
struct ucom_softc *, uint32_t, void *,
|
||||
const struct ucom_callback *callback, struct mtx *);
|
||||
void usb2_com_detach(struct ucom_super_softc *,
|
||||
struct ucom_softc *, uint32_t);
|
||||
void usb2_com_status_change(struct ucom_softc *);
|
||||
uint8_t usb2_com_get_data(struct ucom_softc *, struct usb_page_cache *,
|
||||
uint32_t, uint32_t, uint32_t *);
|
||||
void usb2_com_put_data(struct usb2_com_softc *, struct usb2_page_cache *,
|
||||
void usb2_com_put_data(struct ucom_softc *, struct usb_page_cache *,
|
||||
uint32_t, uint32_t);
|
||||
uint8_t usb2_com_cfg_is_gone(struct usb2_com_softc *);
|
||||
uint8_t usb2_com_cfg_is_gone(struct ucom_softc *);
|
||||
#endif /* _USB2_SERIAL_H_ */
|
||||
|
@ -91,11 +91,11 @@ enum {
|
||||
};
|
||||
|
||||
struct uslcom_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom;
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom;
|
||||
|
||||
struct usb2_xfer *sc_xfer[USLCOM_N_TRANSFER];
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[USLCOM_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
uint8_t sc_msr;
|
||||
@ -109,20 +109,20 @@ static device_detach_t uslcom_detach;
|
||||
static usb2_callback_t uslcom_write_callback;
|
||||
static usb2_callback_t uslcom_read_callback;
|
||||
|
||||
static void uslcom_open(struct usb2_com_softc *);
|
||||
static void uslcom_close(struct usb2_com_softc *);
|
||||
static void uslcom_set_dtr(struct usb2_com_softc *, uint8_t);
|
||||
static void uslcom_set_rts(struct usb2_com_softc *, uint8_t);
|
||||
static void uslcom_set_break(struct usb2_com_softc *, uint8_t);
|
||||
static int uslcom_pre_param(struct usb2_com_softc *, struct termios *);
|
||||
static void uslcom_param(struct usb2_com_softc *, struct termios *);
|
||||
static void uslcom_get_status(struct usb2_com_softc *, uint8_t *, uint8_t *);
|
||||
static void uslcom_start_read(struct usb2_com_softc *);
|
||||
static void uslcom_stop_read(struct usb2_com_softc *);
|
||||
static void uslcom_start_write(struct usb2_com_softc *);
|
||||
static void uslcom_stop_write(struct usb2_com_softc *);
|
||||
static void uslcom_open(struct ucom_softc *);
|
||||
static void uslcom_close(struct ucom_softc *);
|
||||
static void uslcom_set_dtr(struct ucom_softc *, uint8_t);
|
||||
static void uslcom_set_rts(struct ucom_softc *, uint8_t);
|
||||
static void uslcom_set_break(struct ucom_softc *, uint8_t);
|
||||
static int uslcom_pre_param(struct ucom_softc *, struct termios *);
|
||||
static void uslcom_param(struct ucom_softc *, struct termios *);
|
||||
static void uslcom_get_status(struct ucom_softc *, uint8_t *, uint8_t *);
|
||||
static void uslcom_start_read(struct ucom_softc *);
|
||||
static void uslcom_stop_read(struct ucom_softc *);
|
||||
static void uslcom_start_write(struct ucom_softc *);
|
||||
static void uslcom_stop_write(struct ucom_softc *);
|
||||
|
||||
static const struct usb2_config uslcom_config[USLCOM_N_TRANSFER] = {
|
||||
static const struct usb_config uslcom_config[USLCOM_N_TRANSFER] = {
|
||||
|
||||
[USLCOM_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -143,7 +143,7 @@ static const struct usb2_config uslcom_config[USLCOM_N_TRANSFER] = {
|
||||
},
|
||||
};
|
||||
|
||||
struct usb2_com_callback uslcom_callback = {
|
||||
struct ucom_callback uslcom_callback = {
|
||||
.usb2_com_cfg_open = &uslcom_open,
|
||||
.usb2_com_cfg_close = &uslcom_close,
|
||||
.usb2_com_cfg_get_status = &uslcom_get_status,
|
||||
@ -158,7 +158,7 @@ struct usb2_com_callback uslcom_callback = {
|
||||
.usb2_com_stop_write = &uslcom_stop_write,
|
||||
};
|
||||
|
||||
static const struct usb2_device_id uslcom_devs[] = {
|
||||
static const struct usb_device_id uslcom_devs[] = {
|
||||
{ USB_VPI(USB_VENDOR_BALTECH, USB_PRODUCT_BALTECH_CARDREADER, 0) },
|
||||
{ USB_VPI(USB_VENDOR_DYNASTREAM, USB_PRODUCT_DYNASTREAM_ANTDEVBOARD, 0) },
|
||||
{ USB_VPI(USB_VENDOR_JABLOTRON, USB_PRODUCT_JABLOTRON_PC60B, 0) },
|
||||
@ -202,7 +202,7 @@ MODULE_VERSION(uslcom, 1);
|
||||
static int
|
||||
uslcom_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
DPRINTFN(11, "\n");
|
||||
|
||||
@ -221,7 +221,7 @@ uslcom_probe(device_t dev)
|
||||
static int
|
||||
uslcom_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct uslcom_softc *sc = device_get_softc(dev);
|
||||
int error;
|
||||
|
||||
@ -273,10 +273,10 @@ uslcom_detach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
uslcom_open(struct usb2_com_softc *ucom)
|
||||
uslcom_open(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uslcom_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
req.bmRequestType = USLCOM_WRITE;
|
||||
req.bRequest = USLCOM_UART;
|
||||
@ -291,10 +291,10 @@ uslcom_open(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uslcom_close(struct usb2_com_softc *ucom)
|
||||
uslcom_close(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uslcom_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
req.bmRequestType = USLCOM_WRITE;
|
||||
req.bRequest = USLCOM_UART;
|
||||
@ -309,10 +309,10 @@ uslcom_close(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uslcom_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uslcom_set_dtr(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uslcom_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint16_t ctl;
|
||||
|
||||
DPRINTF("onoff = %d\n", onoff);
|
||||
@ -333,10 +333,10 @@ uslcom_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
uslcom_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uslcom_set_rts(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uslcom_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint16_t ctl;
|
||||
|
||||
DPRINTF("onoff = %d\n", onoff);
|
||||
@ -357,7 +357,7 @@ uslcom_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static int
|
||||
uslcom_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
uslcom_pre_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
if (t->c_ospeed <= 0 || t->c_ospeed > 921600)
|
||||
return (EINVAL);
|
||||
@ -365,10 +365,10 @@ uslcom_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
uslcom_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
uslcom_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
struct uslcom_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint16_t data;
|
||||
|
||||
DPRINTF("\n");
|
||||
@ -424,7 +424,7 @@ uslcom_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
uslcom_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
uslcom_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
{
|
||||
struct uslcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -435,10 +435,10 @@ uslcom_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
}
|
||||
|
||||
static void
|
||||
uslcom_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uslcom_set_break(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uslcom_softc *sc = ucom->sc_parent;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint16_t brk = onoff ? USLCOM_BREAK_ON : USLCOM_BREAK_OFF;
|
||||
|
||||
req.bmRequestType = USLCOM_WRITE;
|
||||
@ -454,7 +454,7 @@ uslcom_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
uslcom_write_callback(struct usb2_xfer *xfer)
|
||||
uslcom_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uslcom_softc *sc = xfer->priv_sc;
|
||||
uint32_t actlen;
|
||||
@ -484,7 +484,7 @@ uslcom_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uslcom_read_callback(struct usb2_xfer *xfer)
|
||||
uslcom_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uslcom_softc *sc = xfer->priv_sc;
|
||||
|
||||
@ -509,7 +509,7 @@ uslcom_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uslcom_start_read(struct usb2_com_softc *ucom)
|
||||
uslcom_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uslcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -518,7 +518,7 @@ uslcom_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uslcom_stop_read(struct usb2_com_softc *ucom)
|
||||
uslcom_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uslcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -527,7 +527,7 @@ uslcom_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uslcom_start_write(struct usb2_com_softc *ucom)
|
||||
uslcom_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uslcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -535,7 +535,7 @@ uslcom_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uslcom_stop_write(struct usb2_com_softc *ucom)
|
||||
uslcom_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uslcom_softc *sc = ucom->sc_parent;
|
||||
|
||||
|
@ -155,11 +155,11 @@ enum {
|
||||
};
|
||||
|
||||
struct uvisor_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom;
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom;
|
||||
|
||||
struct usb2_xfer *sc_xfer[UVISOR_N_TRANSFER];
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[UVISOR_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
uint16_t sc_flag;
|
||||
@ -181,16 +181,16 @@ static device_detach_t uvisor_detach;
|
||||
static usb2_callback_t uvisor_write_callback;
|
||||
static usb2_callback_t uvisor_read_callback;
|
||||
|
||||
static usb2_error_t uvisor_init(struct uvisor_softc *, struct usb2_device *,
|
||||
struct usb2_config *);
|
||||
static void uvisor_cfg_open(struct usb2_com_softc *);
|
||||
static void uvisor_cfg_close(struct usb2_com_softc *);
|
||||
static void uvisor_start_read(struct usb2_com_softc *);
|
||||
static void uvisor_stop_read(struct usb2_com_softc *);
|
||||
static void uvisor_start_write(struct usb2_com_softc *);
|
||||
static void uvisor_stop_write(struct usb2_com_softc *);
|
||||
static usb2_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 *);
|
||||
static void uvisor_start_read(struct ucom_softc *);
|
||||
static void uvisor_stop_read(struct ucom_softc *);
|
||||
static void uvisor_start_write(struct ucom_softc *);
|
||||
static void uvisor_stop_write(struct ucom_softc *);
|
||||
|
||||
static const struct usb2_config uvisor_config[UVISOR_N_TRANSFER] = {
|
||||
static const struct usb_config uvisor_config[UVISOR_N_TRANSFER] = {
|
||||
|
||||
[UVISOR_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -211,7 +211,7 @@ static const struct usb2_config uvisor_config[UVISOR_N_TRANSFER] = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_com_callback uvisor_callback = {
|
||||
static const struct ucom_callback uvisor_callback = {
|
||||
.usb2_com_cfg_open = &uvisor_cfg_open,
|
||||
.usb2_com_cfg_close = &uvisor_cfg_close,
|
||||
.usb2_com_start_read = &uvisor_start_read,
|
||||
@ -239,7 +239,7 @@ DRIVER_MODULE(uvisor, uhub, uvisor_driver, uvisor_devclass, NULL, 0);
|
||||
MODULE_DEPEND(uvisor, ucom, 1, 1, 1);
|
||||
MODULE_DEPEND(uvisor, usb, 1, 1, 1);
|
||||
|
||||
static const struct usb2_device_id uvisor_devs[] = {
|
||||
static const struct usb_device_id uvisor_devs[] = {
|
||||
{USB_VPI(USB_VENDOR_ACEECA, USB_PRODUCT_ACEECA_MEZ1000, UVISOR_FLAG_PALM4)},
|
||||
{USB_VPI(USB_VENDOR_GARMIN, USB_PRODUCT_GARMIN_IQUE_3600, UVISOR_FLAG_PALM4)},
|
||||
{USB_VPI(USB_VENDOR_FOSSIL, USB_PRODUCT_FOSSIL_WRISTPDA, UVISOR_FLAG_PALM4)},
|
||||
@ -271,7 +271,7 @@ static const struct usb2_device_id uvisor_devs[] = {
|
||||
static int
|
||||
uvisor_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
return (ENXIO);
|
||||
@ -288,9 +288,9 @@ uvisor_probe(device_t dev)
|
||||
static int
|
||||
uvisor_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct uvisor_softc *sc = device_get_softc(dev);
|
||||
struct usb2_config uvisor_config_copy[UVISOR_N_TRANSFER];
|
||||
struct usb_config uvisor_config_copy[UVISOR_N_TRANSFER];
|
||||
int error;
|
||||
|
||||
DPRINTF("sc=%p\n", sc);
|
||||
@ -356,10 +356,10 @@ uvisor_detach(device_t dev)
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
uvisor_init(struct uvisor_softc *sc, struct usb2_device *udev, struct usb2_config *config)
|
||||
uvisor_init(struct uvisor_softc *sc, struct usb_device *udev, struct usb_config *config)
|
||||
{
|
||||
usb2_error_t err = 0;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
struct uvisor_connection_info coninfo;
|
||||
struct uvisor_palm_connection_info pconinfo;
|
||||
uint16_t actlen;
|
||||
@ -502,17 +502,17 @@ uvisor_init(struct uvisor_softc *sc, struct usb2_device *udev, struct usb2_confi
|
||||
}
|
||||
|
||||
static void
|
||||
uvisor_cfg_open(struct usb2_com_softc *ucom)
|
||||
uvisor_cfg_open(struct ucom_softc *ucom)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
uvisor_cfg_close(struct usb2_com_softc *ucom)
|
||||
uvisor_cfg_close(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uvisor_softc *sc = ucom->sc_parent;
|
||||
uint8_t buffer[UVISOR_CONNECTION_INFO_SIZE];
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
|
||||
req.bmRequestType = UT_READ_VENDOR_ENDPOINT; /* XXX read? */
|
||||
@ -530,7 +530,7 @@ uvisor_cfg_close(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uvisor_start_read(struct usb2_com_softc *ucom)
|
||||
uvisor_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uvisor_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -538,7 +538,7 @@ uvisor_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uvisor_stop_read(struct usb2_com_softc *ucom)
|
||||
uvisor_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uvisor_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -546,7 +546,7 @@ uvisor_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uvisor_start_write(struct usb2_com_softc *ucom)
|
||||
uvisor_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uvisor_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -554,7 +554,7 @@ uvisor_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uvisor_stop_write(struct usb2_com_softc *ucom)
|
||||
uvisor_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uvisor_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -562,7 +562,7 @@ uvisor_stop_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uvisor_write_callback(struct usb2_xfer *xfer)
|
||||
uvisor_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uvisor_softc *sc = xfer->priv_sc;
|
||||
uint32_t actlen;
|
||||
@ -590,7 +590,7 @@ uvisor_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uvisor_read_callback(struct usb2_xfer *xfer)
|
||||
uvisor_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uvisor_softc *sc = xfer->priv_sc;
|
||||
|
||||
|
@ -130,11 +130,11 @@ enum {
|
||||
};
|
||||
|
||||
struct uvscom_softc {
|
||||
struct usb2_com_super_softc sc_super_ucom;
|
||||
struct usb2_com_softc sc_ucom;
|
||||
struct ucom_super_softc sc_super_ucom;
|
||||
struct ucom_softc sc_ucom;
|
||||
|
||||
struct usb2_xfer *sc_xfer[UVSCOM_N_TRANSFER];
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[UVSCOM_N_TRANSFER];
|
||||
struct usb_device *sc_udev;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
uint16_t sc_line; /* line control register */
|
||||
@ -156,24 +156,24 @@ static usb2_callback_t uvscom_write_callback;
|
||||
static usb2_callback_t uvscom_read_callback;
|
||||
static usb2_callback_t uvscom_intr_callback;
|
||||
|
||||
static void uvscom_cfg_set_dtr(struct usb2_com_softc *, uint8_t);
|
||||
static void uvscom_cfg_set_rts(struct usb2_com_softc *, uint8_t);
|
||||
static void uvscom_cfg_set_break(struct usb2_com_softc *, uint8_t);
|
||||
static int uvscom_pre_param(struct usb2_com_softc *, struct termios *);
|
||||
static void uvscom_cfg_param(struct usb2_com_softc *, struct termios *);
|
||||
static int uvscom_pre_open(struct usb2_com_softc *);
|
||||
static void uvscom_cfg_open(struct usb2_com_softc *);
|
||||
static void uvscom_cfg_close(struct usb2_com_softc *);
|
||||
static void uvscom_start_read(struct usb2_com_softc *);
|
||||
static void uvscom_stop_read(struct usb2_com_softc *);
|
||||
static void uvscom_start_write(struct usb2_com_softc *);
|
||||
static void uvscom_stop_write(struct usb2_com_softc *);
|
||||
static void uvscom_cfg_get_status(struct usb2_com_softc *, uint8_t *,
|
||||
static void uvscom_cfg_set_dtr(struct ucom_softc *, uint8_t);
|
||||
static void uvscom_cfg_set_rts(struct ucom_softc *, uint8_t);
|
||||
static void uvscom_cfg_set_break(struct ucom_softc *, uint8_t);
|
||||
static int uvscom_pre_param(struct ucom_softc *, struct termios *);
|
||||
static void uvscom_cfg_param(struct ucom_softc *, struct termios *);
|
||||
static int uvscom_pre_open(struct ucom_softc *);
|
||||
static void uvscom_cfg_open(struct ucom_softc *);
|
||||
static void uvscom_cfg_close(struct ucom_softc *);
|
||||
static void uvscom_start_read(struct ucom_softc *);
|
||||
static void uvscom_stop_read(struct ucom_softc *);
|
||||
static void uvscom_start_write(struct ucom_softc *);
|
||||
static void uvscom_stop_write(struct ucom_softc *);
|
||||
static void uvscom_cfg_get_status(struct ucom_softc *, uint8_t *,
|
||||
uint8_t *);
|
||||
static void uvscom_cfg_write(struct uvscom_softc *, uint8_t, uint16_t);
|
||||
static uint16_t uvscom_cfg_read_status(struct uvscom_softc *);
|
||||
|
||||
static const struct usb2_config uvscom_config[UVSCOM_N_TRANSFER] = {
|
||||
static const struct usb_config uvscom_config[UVSCOM_N_TRANSFER] = {
|
||||
|
||||
[UVSCOM_BULK_DT_WR] = {
|
||||
.type = UE_BULK,
|
||||
@ -203,7 +203,7 @@ static const struct usb2_config uvscom_config[UVSCOM_N_TRANSFER] = {
|
||||
},
|
||||
};
|
||||
|
||||
static const struct usb2_com_callback uvscom_callback = {
|
||||
static const struct ucom_callback uvscom_callback = {
|
||||
.usb2_com_cfg_get_status = &uvscom_cfg_get_status,
|
||||
.usb2_com_cfg_set_dtr = &uvscom_cfg_set_dtr,
|
||||
.usb2_com_cfg_set_rts = &uvscom_cfg_set_rts,
|
||||
@ -219,7 +219,7 @@ static const struct usb2_com_callback uvscom_callback = {
|
||||
.usb2_com_stop_write = &uvscom_stop_write,
|
||||
};
|
||||
|
||||
static const struct usb2_device_id uvscom_devs[] = {
|
||||
static const struct usb_device_id uvscom_devs[] = {
|
||||
/* SUNTAC U-Cable type A4 */
|
||||
{USB_VPI(USB_VENDOR_SUNTAC, USB_PRODUCT_SUNTAC_AS144L4, 0)},
|
||||
/* SUNTAC U-Cable type D2 */
|
||||
@ -255,7 +255,7 @@ MODULE_VERSION(uvscom, UVSCOM_MODVER);
|
||||
static int
|
||||
uvscom_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
return (ENXIO);
|
||||
@ -272,7 +272,7 @@ uvscom_probe(device_t dev)
|
||||
static int
|
||||
uvscom_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct uvscom_softc *sc = device_get_softc(dev);
|
||||
int error;
|
||||
|
||||
@ -338,7 +338,7 @@ uvscom_detach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
uvscom_write_callback(struct usb2_xfer *xfer)
|
||||
uvscom_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uvscom_softc *sc = xfer->priv_sc;
|
||||
uint32_t actlen;
|
||||
@ -366,7 +366,7 @@ uvscom_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uvscom_read_callback(struct usb2_xfer *xfer)
|
||||
uvscom_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uvscom_softc *sc = xfer->priv_sc;
|
||||
|
||||
@ -391,7 +391,7 @@ uvscom_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uvscom_intr_callback(struct usb2_xfer *xfer)
|
||||
uvscom_intr_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct uvscom_softc *sc = xfer->priv_sc;
|
||||
uint8_t buf[2];
|
||||
@ -444,7 +444,7 @@ uvscom_intr_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
uvscom_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uvscom_cfg_set_dtr(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uvscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -459,7 +459,7 @@ uvscom_cfg_set_dtr(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
uvscom_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uvscom_cfg_set_rts(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uvscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -474,7 +474,7 @@ uvscom_cfg_set_rts(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static void
|
||||
uvscom_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
uvscom_cfg_set_break(struct ucom_softc *ucom, uint8_t onoff)
|
||||
{
|
||||
struct uvscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -489,7 +489,7 @@ uvscom_cfg_set_break(struct usb2_com_softc *ucom, uint8_t onoff)
|
||||
}
|
||||
|
||||
static int
|
||||
uvscom_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
uvscom_pre_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
switch (t->c_ospeed) {
|
||||
case B150:
|
||||
@ -510,7 +510,7 @@ uvscom_pre_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static void
|
||||
uvscom_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
uvscom_cfg_param(struct ucom_softc *ucom, struct termios *t)
|
||||
{
|
||||
struct uvscom_softc *sc = ucom->sc_parent;
|
||||
uint16_t value;
|
||||
@ -592,7 +592,7 @@ uvscom_cfg_param(struct usb2_com_softc *ucom, struct termios *t)
|
||||
}
|
||||
|
||||
static int
|
||||
uvscom_pre_open(struct usb2_com_softc *ucom)
|
||||
uvscom_pre_open(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uvscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -608,7 +608,7 @@ uvscom_pre_open(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uvscom_cfg_open(struct usb2_com_softc *ucom)
|
||||
uvscom_cfg_open(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uvscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -618,7 +618,7 @@ uvscom_cfg_open(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uvscom_cfg_close(struct usb2_com_softc *ucom)
|
||||
uvscom_cfg_close(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uvscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -628,7 +628,7 @@ uvscom_cfg_close(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uvscom_start_read(struct usb2_com_softc *ucom)
|
||||
uvscom_start_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uvscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -636,7 +636,7 @@ uvscom_start_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uvscom_stop_read(struct usb2_com_softc *ucom)
|
||||
uvscom_stop_read(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uvscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -644,7 +644,7 @@ uvscom_stop_read(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uvscom_start_write(struct usb2_com_softc *ucom)
|
||||
uvscom_start_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uvscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -652,7 +652,7 @@ uvscom_start_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uvscom_stop_write(struct usb2_com_softc *ucom)
|
||||
uvscom_stop_write(struct ucom_softc *ucom)
|
||||
{
|
||||
struct uvscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -660,7 +660,7 @@ uvscom_stop_write(struct usb2_com_softc *ucom)
|
||||
}
|
||||
|
||||
static void
|
||||
uvscom_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
uvscom_cfg_get_status(struct ucom_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
{
|
||||
struct uvscom_softc *sc = ucom->sc_parent;
|
||||
|
||||
@ -671,7 +671,7 @@ uvscom_cfg_get_status(struct usb2_com_softc *ucom, uint8_t *lsr, uint8_t *msr)
|
||||
static void
|
||||
uvscom_cfg_write(struct uvscom_softc *sc, uint8_t index, uint16_t value)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
|
||||
req.bmRequestType = UT_WRITE_VENDOR_DEVICE;
|
||||
@ -691,7 +691,7 @@ uvscom_cfg_write(struct uvscom_softc *sc, uint8_t index, uint16_t value)
|
||||
static uint16_t
|
||||
uvscom_cfg_read_status(struct uvscom_softc *sc)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
uint8_t data[2];
|
||||
|
||||
|
@ -973,9 +973,9 @@ struct umass_softc {
|
||||
umass_cbi_sbl_t sbl; /* status block */
|
||||
|
||||
device_t sc_dev;
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb_device *sc_udev;
|
||||
struct cam_sim *sc_sim; /* SCSI Interface Module */
|
||||
struct usb2_xfer *sc_xfer[UMASS_T_MAX];
|
||||
struct usb_xfer *sc_xfer[UMASS_T_MAX];
|
||||
|
||||
/*
|
||||
* The command transform function is used to convert the SCSI
|
||||
@ -1032,13 +1032,13 @@ static usb2_callback_t umass_t_cbi_status_callback;
|
||||
static void umass_cancel_ccb(struct umass_softc *);
|
||||
static void umass_init_shuttle(struct umass_softc *);
|
||||
static void umass_reset(struct umass_softc *);
|
||||
static void umass_t_bbb_data_clear_stall_callback(struct usb2_xfer *,
|
||||
static void umass_t_bbb_data_clear_stall_callback(struct usb_xfer *,
|
||||
uint8_t, uint8_t);
|
||||
static void umass_command_start(struct umass_softc *, uint8_t, void *,
|
||||
uint32_t, uint32_t, umass_callback_t *, union ccb *);
|
||||
static uint8_t umass_bbb_get_max_lun(struct umass_softc *);
|
||||
static void umass_cbi_start_status(struct umass_softc *);
|
||||
static void umass_t_cbi_data_clear_stall_callback(struct usb2_xfer *,
|
||||
static void umass_t_cbi_data_clear_stall_callback(struct usb_xfer *,
|
||||
uint8_t, uint8_t);
|
||||
static int umass_cam_attach_sim(struct umass_softc *);
|
||||
static void umass_cam_rescan_callback(struct cam_periph *, union ccb *);
|
||||
@ -1070,13 +1070,13 @@ static void umass_dump_buffer(struct umass_softc *, uint8_t *, uint32_t,
|
||||
uint32_t);
|
||||
#endif
|
||||
|
||||
struct usb2_config umass_bbb_config[UMASS_T_BBB_MAX] = {
|
||||
struct usb_config umass_bbb_config[UMASS_T_BBB_MAX] = {
|
||||
|
||||
[UMASS_T_BBB_RESET1] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request),
|
||||
.bufsize = sizeof(struct usb_device_request),
|
||||
.callback = &umass_t_bbb_reset1_callback,
|
||||
.timeout = 5000, /* 5 seconds */
|
||||
.interval = 500, /* 500 milliseconds */
|
||||
@ -1086,7 +1086,7 @@ struct usb2_config umass_bbb_config[UMASS_T_BBB_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request),
|
||||
.bufsize = sizeof(struct usb_device_request),
|
||||
.callback = &umass_t_bbb_reset2_callback,
|
||||
.timeout = 5000, /* 5 seconds */
|
||||
.interval = 50, /* 50 milliseconds */
|
||||
@ -1096,7 +1096,7 @@ struct usb2_config umass_bbb_config[UMASS_T_BBB_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request),
|
||||
.bufsize = sizeof(struct usb_device_request),
|
||||
.callback = &umass_t_bbb_reset3_callback,
|
||||
.timeout = 5000, /* 5 seconds */
|
||||
.interval = 50, /* 50 milliseconds */
|
||||
@ -1125,7 +1125,7 @@ struct usb2_config umass_bbb_config[UMASS_T_BBB_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request),
|
||||
.bufsize = sizeof(struct usb_device_request),
|
||||
.callback = &umass_t_bbb_data_rd_cs_callback,
|
||||
.timeout = 5000, /* 5 seconds */
|
||||
},
|
||||
@ -1144,7 +1144,7 @@ struct usb2_config umass_bbb_config[UMASS_T_BBB_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request),
|
||||
.bufsize = sizeof(struct usb_device_request),
|
||||
.callback = &umass_t_bbb_data_wr_cs_callback,
|
||||
.timeout = 5000, /* 5 seconds */
|
||||
},
|
||||
@ -1160,13 +1160,13 @@ struct usb2_config umass_bbb_config[UMASS_T_BBB_MAX] = {
|
||||
},
|
||||
};
|
||||
|
||||
struct usb2_config umass_cbi_config[UMASS_T_CBI_MAX] = {
|
||||
struct usb_config umass_cbi_config[UMASS_T_CBI_MAX] = {
|
||||
|
||||
[UMASS_T_CBI_RESET1] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = (sizeof(struct usb2_device_request) +
|
||||
.bufsize = (sizeof(struct usb_device_request) +
|
||||
UMASS_CBI_DIAGNOSTIC_CMDLEN),
|
||||
.callback = &umass_t_cbi_reset1_callback,
|
||||
.timeout = 5000, /* 5 seconds */
|
||||
@ -1177,7 +1177,7 @@ struct usb2_config umass_cbi_config[UMASS_T_CBI_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request),
|
||||
.bufsize = sizeof(struct usb_device_request),
|
||||
.callback = &umass_t_cbi_reset2_callback,
|
||||
.timeout = 5000, /* 5 seconds */
|
||||
.interval = 50, /* 50 milliseconds */
|
||||
@ -1187,7 +1187,7 @@ struct usb2_config umass_cbi_config[UMASS_T_CBI_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request),
|
||||
.bufsize = sizeof(struct usb_device_request),
|
||||
.callback = &umass_t_cbi_reset3_callback,
|
||||
.timeout = 5000, /* 5 seconds */
|
||||
.interval = 50, /* 50 milliseconds */
|
||||
@ -1197,7 +1197,7 @@ struct usb2_config umass_cbi_config[UMASS_T_CBI_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = (sizeof(struct usb2_device_request) +
|
||||
.bufsize = (sizeof(struct usb_device_request) +
|
||||
UMASS_MAX_CMDLEN),
|
||||
.callback = &umass_t_cbi_command_callback,
|
||||
.timeout = 5000, /* 5 seconds */
|
||||
@ -1217,7 +1217,7 @@ struct usb2_config umass_cbi_config[UMASS_T_CBI_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request),
|
||||
.bufsize = sizeof(struct usb_device_request),
|
||||
.callback = &umass_t_cbi_data_rd_cs_callback,
|
||||
.timeout = 5000, /* 5 seconds */
|
||||
},
|
||||
@ -1236,7 +1236,7 @@ struct usb2_config umass_cbi_config[UMASS_T_CBI_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request),
|
||||
.bufsize = sizeof(struct usb_device_request),
|
||||
.callback = &umass_t_cbi_data_wr_cs_callback,
|
||||
.timeout = 5000, /* 5 seconds */
|
||||
},
|
||||
@ -1255,7 +1255,7 @@ struct usb2_config umass_cbi_config[UMASS_T_CBI_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request),
|
||||
.bufsize = sizeof(struct usb_device_request),
|
||||
.callback = &umass_t_cbi_reset4_callback,
|
||||
.timeout = 5000, /* ms */
|
||||
},
|
||||
@ -1295,9 +1295,9 @@ MODULE_DEPEND(umass, cam, 1, 1, 1);
|
||||
*/
|
||||
|
||||
static uint16_t
|
||||
umass_get_proto(struct usb2_interface *iface)
|
||||
umass_get_proto(struct usb_interface *iface)
|
||||
{
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb_interface_descriptor *id;
|
||||
uint16_t retval;
|
||||
|
||||
retval = 0;
|
||||
@ -1351,7 +1351,7 @@ umass_get_proto(struct usb2_interface *iface)
|
||||
* devices supported.
|
||||
*/
|
||||
static struct umass_probe_proto
|
||||
umass_probe_proto(device_t dev, struct usb2_attach_arg *uaa)
|
||||
umass_probe_proto(device_t dev, struct usb_attach_arg *uaa)
|
||||
{
|
||||
const struct umass_devdescr *udd = umass_devdescr;
|
||||
struct umass_probe_proto ret;
|
||||
@ -1425,7 +1425,7 @@ umass_probe_proto(device_t dev, struct usb2_attach_arg *uaa)
|
||||
static int
|
||||
umass_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct umass_probe_proto temp;
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
@ -1444,9 +1444,9 @@ static int
|
||||
umass_attach(device_t dev)
|
||||
{
|
||||
struct umass_softc *sc = device_get_softc(dev);
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct umass_probe_proto temp = umass_probe_proto(dev, uaa);
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb_interface_descriptor *id;
|
||||
int32_t err;
|
||||
|
||||
/*
|
||||
@ -1635,7 +1635,7 @@ umass_detach(device_t dev)
|
||||
static void
|
||||
umass_init_shuttle(struct umass_softc *sc)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
uint8_t status[2] = {0, 0};
|
||||
|
||||
@ -1704,7 +1704,7 @@ umass_cancel_ccb(struct umass_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
umass_tr_error(struct usb2_xfer *xfer)
|
||||
umass_tr_error(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umass_softc *sc = xfer->priv_sc;
|
||||
|
||||
@ -1721,10 +1721,10 @@ umass_tr_error(struct usb2_xfer *xfer)
|
||||
*/
|
||||
|
||||
static void
|
||||
umass_t_bbb_reset1_callback(struct usb2_xfer *xfer)
|
||||
umass_t_bbb_reset1_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umass_softc *sc = xfer->priv_sc;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
case USB_ST_TRANSFERRED:
|
||||
@ -1770,21 +1770,21 @@ umass_t_bbb_reset1_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_bbb_reset2_callback(struct usb2_xfer *xfer)
|
||||
umass_t_bbb_reset2_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
umass_t_bbb_data_clear_stall_callback(xfer, UMASS_T_BBB_RESET3,
|
||||
UMASS_T_BBB_DATA_READ);
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_bbb_reset3_callback(struct usb2_xfer *xfer)
|
||||
umass_t_bbb_reset3_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
umass_t_bbb_data_clear_stall_callback(xfer, UMASS_T_BBB_COMMAND,
|
||||
UMASS_T_BBB_DATA_WRITE);
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_bbb_data_clear_stall_callback(struct usb2_xfer *xfer,
|
||||
umass_t_bbb_data_clear_stall_callback(struct usb_xfer *xfer,
|
||||
uint8_t next_xfer,
|
||||
uint8_t stall_xfer)
|
||||
{
|
||||
@ -1810,7 +1810,7 @@ umass_t_bbb_data_clear_stall_callback(struct usb2_xfer *xfer,
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_bbb_command_callback(struct usb2_xfer *xfer)
|
||||
umass_t_bbb_command_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umass_softc *sc = xfer->priv_sc;
|
||||
union ccb *ccb = sc->sc_transfer.ccb;
|
||||
@ -1892,7 +1892,7 @@ umass_t_bbb_command_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_bbb_data_read_callback(struct usb2_xfer *xfer)
|
||||
umass_t_bbb_data_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umass_softc *sc = xfer->priv_sc;
|
||||
uint32_t max_bulk = xfer->max_data_length;
|
||||
@ -1943,14 +1943,14 @@ umass_t_bbb_data_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_bbb_data_rd_cs_callback(struct usb2_xfer *xfer)
|
||||
umass_t_bbb_data_rd_cs_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
umass_t_bbb_data_clear_stall_callback(xfer, UMASS_T_BBB_STATUS,
|
||||
UMASS_T_BBB_DATA_READ);
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_bbb_data_write_callback(struct usb2_xfer *xfer)
|
||||
umass_t_bbb_data_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umass_softc *sc = xfer->priv_sc;
|
||||
uint32_t max_bulk = xfer->max_data_length;
|
||||
@ -2001,14 +2001,14 @@ umass_t_bbb_data_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_bbb_data_wr_cs_callback(struct usb2_xfer *xfer)
|
||||
umass_t_bbb_data_wr_cs_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
umass_t_bbb_data_clear_stall_callback(xfer, UMASS_T_BBB_STATUS,
|
||||
UMASS_T_BBB_DATA_WRITE);
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_bbb_status_callback(struct usb2_xfer *xfer)
|
||||
umass_t_bbb_status_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umass_softc *sc = xfer->priv_sc;
|
||||
union ccb *ccb = sc->sc_transfer.ccb;
|
||||
@ -2156,7 +2156,7 @@ umass_command_start(struct umass_softc *sc, uint8_t dir,
|
||||
static uint8_t
|
||||
umass_bbb_get_max_lun(struct umass_softc *sc)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
usb2_error_t err;
|
||||
uint8_t buf = 0;
|
||||
|
||||
@ -2202,10 +2202,10 @@ umass_cbi_start_status(struct umass_softc *sc)
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_cbi_reset1_callback(struct usb2_xfer *xfer)
|
||||
umass_t_cbi_reset1_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umass_softc *sc = xfer->priv_sc;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
uint8_t buf[UMASS_CBI_DIAGNOSTIC_CMDLEN];
|
||||
|
||||
uint8_t i;
|
||||
@ -2268,14 +2268,14 @@ umass_t_cbi_reset1_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_cbi_reset2_callback(struct usb2_xfer *xfer)
|
||||
umass_t_cbi_reset2_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
umass_t_cbi_data_clear_stall_callback(xfer, UMASS_T_CBI_RESET3,
|
||||
UMASS_T_CBI_DATA_READ);
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_cbi_reset3_callback(struct usb2_xfer *xfer)
|
||||
umass_t_cbi_reset3_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umass_softc *sc = xfer->priv_sc;
|
||||
|
||||
@ -2287,14 +2287,14 @@ umass_t_cbi_reset3_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_cbi_reset4_callback(struct usb2_xfer *xfer)
|
||||
umass_t_cbi_reset4_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
umass_t_cbi_data_clear_stall_callback(xfer, UMASS_T_CBI_COMMAND,
|
||||
UMASS_T_CBI_STATUS);
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_cbi_data_clear_stall_callback(struct usb2_xfer *xfer,
|
||||
umass_t_cbi_data_clear_stall_callback(struct usb_xfer *xfer,
|
||||
uint8_t next_xfer,
|
||||
uint8_t stall_xfer)
|
||||
{
|
||||
@ -2324,11 +2324,11 @@ umass_t_cbi_data_clear_stall_callback(struct usb2_xfer *xfer,
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_cbi_command_callback(struct usb2_xfer *xfer)
|
||||
umass_t_cbi_command_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umass_softc *sc = xfer->priv_sc;
|
||||
union ccb *ccb = sc->sc_transfer.ccb;
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
case USB_ST_TRANSFERRED:
|
||||
@ -2386,7 +2386,7 @@ umass_t_cbi_command_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_cbi_data_read_callback(struct usb2_xfer *xfer)
|
||||
umass_t_cbi_data_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umass_softc *sc = xfer->priv_sc;
|
||||
uint32_t max_bulk = xfer->max_data_length;
|
||||
@ -2438,14 +2438,14 @@ umass_t_cbi_data_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_cbi_data_rd_cs_callback(struct usb2_xfer *xfer)
|
||||
umass_t_cbi_data_rd_cs_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
umass_t_cbi_data_clear_stall_callback(xfer, UMASS_T_CBI_STATUS,
|
||||
UMASS_T_CBI_DATA_READ);
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_cbi_data_write_callback(struct usb2_xfer *xfer)
|
||||
umass_t_cbi_data_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umass_softc *sc = xfer->priv_sc;
|
||||
uint32_t max_bulk = xfer->max_data_length;
|
||||
@ -2497,14 +2497,14 @@ umass_t_cbi_data_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_cbi_data_wr_cs_callback(struct usb2_xfer *xfer)
|
||||
umass_t_cbi_data_wr_cs_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
umass_t_cbi_data_clear_stall_callback(xfer, UMASS_T_CBI_STATUS,
|
||||
UMASS_T_CBI_DATA_WRITE);
|
||||
}
|
||||
|
||||
static void
|
||||
umass_t_cbi_status_callback(struct usb2_xfer *xfer)
|
||||
umass_t_cbi_status_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct umass_softc *sc = xfer->priv_sc;
|
||||
union ccb *ccb = sc->sc_transfer.ccb;
|
||||
|
@ -82,11 +82,11 @@ SYSCTL_INT(_hw_usb_urio, OID_AUTO, debug, CTLFLAG_RW,
|
||||
#define URIO_IFQ_MAXLEN 2 /* units */
|
||||
|
||||
struct urio_softc {
|
||||
struct usb2_fifo_sc sc_fifo;
|
||||
struct usb_fifo_sc sc_fifo;
|
||||
struct mtx sc_mtx;
|
||||
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb2_xfer *sc_xfer[URIO_T_MAX];
|
||||
struct usb_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[URIO_T_MAX];
|
||||
|
||||
uint8_t sc_flags;
|
||||
#define URIO_FLAG_READ_STALL 0x01 /* read transfer stalled */
|
||||
@ -114,7 +114,7 @@ static usb2_fifo_cmd_t urio_stop_write;
|
||||
static usb2_fifo_ioctl_t urio_ioctl;
|
||||
static usb2_fifo_open_t urio_open;
|
||||
|
||||
static struct usb2_fifo_methods urio_fifo_methods = {
|
||||
static struct usb_fifo_methods urio_fifo_methods = {
|
||||
.f_close = &urio_close,
|
||||
.f_ioctl = &urio_ioctl,
|
||||
.f_open = &urio_open,
|
||||
@ -125,7 +125,7 @@ static struct usb2_fifo_methods urio_fifo_methods = {
|
||||
.basename[0] = "urio",
|
||||
};
|
||||
|
||||
static const struct usb2_config urio_config[URIO_T_MAX] = {
|
||||
static const struct usb_config urio_config[URIO_T_MAX] = {
|
||||
[URIO_T_WR] = {
|
||||
.type = UE_BULK,
|
||||
.endpoint = UE_ADDR_ANY,
|
||||
@ -148,7 +148,7 @@ static const struct usb2_config urio_config[URIO_T_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request),
|
||||
.bufsize = sizeof(struct usb_device_request),
|
||||
.callback = &urio_write_clear_stall_callback,
|
||||
.timeout = 1000, /* 1 second */
|
||||
.interval = 50, /* 50ms */
|
||||
@ -158,7 +158,7 @@ static const struct usb2_config urio_config[URIO_T_MAX] = {
|
||||
.type = UE_CONTROL,
|
||||
.endpoint = 0x00, /* Control pipe */
|
||||
.direction = UE_DIR_ANY,
|
||||
.bufsize = sizeof(struct usb2_device_request),
|
||||
.bufsize = sizeof(struct usb_device_request),
|
||||
.callback = &urio_read_clear_stall_callback,
|
||||
.timeout = 1000, /* 1 second */
|
||||
.interval = 50, /* 50ms */
|
||||
@ -187,7 +187,7 @@ MODULE_DEPEND(urio, usb, 1, 1, 1);
|
||||
static int
|
||||
urio_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_HOST) {
|
||||
return (ENXIO);
|
||||
@ -205,7 +205,7 @@ urio_probe(device_t dev)
|
||||
static int
|
||||
urio_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct urio_softc *sc = device_get_softc(dev);
|
||||
int error;
|
||||
|
||||
@ -242,10 +242,10 @@ urio_attach(device_t dev)
|
||||
}
|
||||
|
||||
static void
|
||||
urio_write_callback(struct usb2_xfer *xfer)
|
||||
urio_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct urio_softc *sc = xfer->priv_sc;
|
||||
struct usb2_fifo *f = sc->sc_fifo.fp[USB_FIFO_TX];
|
||||
struct usb_fifo *f = sc->sc_fifo.fp[USB_FIFO_TX];
|
||||
uint32_t actlen;
|
||||
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
@ -274,10 +274,10 @@ urio_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
urio_write_clear_stall_callback(struct usb2_xfer *xfer)
|
||||
urio_write_clear_stall_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct urio_softc *sc = xfer->priv_sc;
|
||||
struct usb2_xfer *xfer_other = sc->sc_xfer[URIO_T_WR];
|
||||
struct usb_xfer *xfer_other = sc->sc_xfer[URIO_T_WR];
|
||||
|
||||
if (usb2_clear_stall_callback(xfer, xfer_other)) {
|
||||
DPRINTF("stall cleared\n");
|
||||
@ -287,10 +287,10 @@ urio_write_clear_stall_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
urio_read_callback(struct usb2_xfer *xfer)
|
||||
urio_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct urio_softc *sc = xfer->priv_sc;
|
||||
struct usb2_fifo *f = sc->sc_fifo.fp[USB_FIFO_RX];
|
||||
struct usb_fifo *f = sc->sc_fifo.fp[USB_FIFO_RX];
|
||||
|
||||
switch (USB_GET_STATE(xfer)) {
|
||||
case USB_ST_TRANSFERRED:
|
||||
@ -319,10 +319,10 @@ urio_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
urio_read_clear_stall_callback(struct usb2_xfer *xfer)
|
||||
urio_read_clear_stall_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct urio_softc *sc = xfer->priv_sc;
|
||||
struct usb2_xfer *xfer_other = sc->sc_xfer[URIO_T_RD];
|
||||
struct usb_xfer *xfer_other = sc->sc_xfer[URIO_T_RD];
|
||||
|
||||
if (usb2_clear_stall_callback(xfer, xfer_other)) {
|
||||
DPRINTF("stall cleared\n");
|
||||
@ -332,7 +332,7 @@ urio_read_clear_stall_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
urio_start_read(struct usb2_fifo *fifo)
|
||||
urio_start_read(struct usb_fifo *fifo)
|
||||
{
|
||||
struct urio_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -340,7 +340,7 @@ urio_start_read(struct usb2_fifo *fifo)
|
||||
}
|
||||
|
||||
static void
|
||||
urio_stop_read(struct usb2_fifo *fifo)
|
||||
urio_stop_read(struct usb_fifo *fifo)
|
||||
{
|
||||
struct urio_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -349,7 +349,7 @@ urio_stop_read(struct usb2_fifo *fifo)
|
||||
}
|
||||
|
||||
static void
|
||||
urio_start_write(struct usb2_fifo *fifo)
|
||||
urio_start_write(struct usb_fifo *fifo)
|
||||
{
|
||||
struct urio_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -357,7 +357,7 @@ urio_start_write(struct usb2_fifo *fifo)
|
||||
}
|
||||
|
||||
static void
|
||||
urio_stop_write(struct usb2_fifo *fifo)
|
||||
urio_stop_write(struct usb_fifo *fifo)
|
||||
{
|
||||
struct urio_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -366,7 +366,7 @@ urio_stop_write(struct usb2_fifo *fifo)
|
||||
}
|
||||
|
||||
static int
|
||||
urio_open(struct usb2_fifo *fifo, int fflags)
|
||||
urio_open(struct usb_fifo *fifo, int fflags)
|
||||
{
|
||||
struct urio_softc *sc = fifo->priv_sc0;
|
||||
|
||||
@ -399,7 +399,7 @@ urio_open(struct usb2_fifo *fifo, int fflags)
|
||||
}
|
||||
|
||||
static void
|
||||
urio_close(struct usb2_fifo *fifo, int fflags)
|
||||
urio_close(struct usb_fifo *fifo, int fflags)
|
||||
{
|
||||
if (fflags & (FREAD | FWRITE)) {
|
||||
usb2_fifo_free_buffer(fifo);
|
||||
@ -407,10 +407,10 @@ urio_close(struct usb2_fifo *fifo, int fflags)
|
||||
}
|
||||
|
||||
static int
|
||||
urio_ioctl(struct usb2_fifo *fifo, u_long cmd, void *addr,
|
||||
urio_ioctl(struct usb_fifo *fifo, u_long cmd, void *addr,
|
||||
int fflags)
|
||||
{
|
||||
struct usb2_ctl_request ur;
|
||||
struct usb_ctl_request ur;
|
||||
struct RioCommand *rio_cmd;
|
||||
int error;
|
||||
|
||||
|
@ -186,8 +186,8 @@ struct ustorage_fs_softc {
|
||||
} sc_transfer;
|
||||
|
||||
device_t sc_dev;
|
||||
struct usb2_device *sc_udev;
|
||||
struct usb2_xfer *sc_xfer[USTORAGE_FS_T_BBB_MAX];
|
||||
struct usb_device *sc_udev;
|
||||
struct usb_xfer *sc_xfer[USTORAGE_FS_T_BBB_MAX];
|
||||
|
||||
uint8_t sc_iface_no; /* interface number */
|
||||
uint8_t sc_last_lun;
|
||||
@ -254,7 +254,7 @@ DRIVER_MODULE(ustorage_fs, uhub, ustorage_fs_driver, ustorage_fs_devclass, NULL,
|
||||
MODULE_VERSION(ustorage_fs, 0);
|
||||
MODULE_DEPEND(ustorage_fs, usb, 1, 1, 1);
|
||||
|
||||
struct usb2_config ustorage_fs_bbb_config[USTORAGE_FS_T_BBB_MAX] = {
|
||||
struct usb_config ustorage_fs_bbb_config[USTORAGE_FS_T_BBB_MAX] = {
|
||||
|
||||
[USTORAGE_FS_T_BBB_COMMAND] = {
|
||||
.type = UE_BULK,
|
||||
@ -314,8 +314,8 @@ struct usb2_config ustorage_fs_bbb_config[USTORAGE_FS_T_BBB_MAX] = {
|
||||
static int
|
||||
ustorage_fs_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_interface_descriptor *id;
|
||||
|
||||
if (uaa->usb_mode != USB_MODE_DEVICE) {
|
||||
return (ENXIO);
|
||||
@ -339,8 +339,8 @@ static int
|
||||
ustorage_fs_attach(device_t dev)
|
||||
{
|
||||
struct ustorage_fs_softc *sc = device_get_softc(dev);
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_interface_descriptor *id;
|
||||
int err;
|
||||
int unit;
|
||||
|
||||
@ -463,7 +463,7 @@ ustorage_fs_handle_request(device_t dev,
|
||||
uint16_t offset, uint8_t is_complete)
|
||||
{
|
||||
struct ustorage_fs_softc *sc = device_get_softc(dev);
|
||||
const struct usb2_device_request *req = preq;
|
||||
const struct usb_device_request *req = preq;
|
||||
|
||||
if (!is_complete) {
|
||||
if ((req->bmRequestType == UT_WRITE_CLASS_INTERFACE) &&
|
||||
@ -491,7 +491,7 @@ ustorage_fs_handle_request(device_t dev,
|
||||
}
|
||||
|
||||
static void
|
||||
ustorage_fs_t_bbb_command_callback(struct usb2_xfer *xfer)
|
||||
ustorage_fs_t_bbb_command_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ustorage_fs_softc *sc = xfer->priv_sc;
|
||||
uint32_t tag;
|
||||
@ -621,7 +621,7 @@ ustorage_fs_t_bbb_command_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ustorage_fs_t_bbb_data_dump_callback(struct usb2_xfer *xfer)
|
||||
ustorage_fs_t_bbb_data_dump_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ustorage_fs_softc *sc = xfer->priv_sc;
|
||||
uint32_t max_bulk = xfer->max_data_length;
|
||||
@ -673,7 +673,7 @@ ustorage_fs_t_bbb_data_dump_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ustorage_fs_t_bbb_data_read_callback(struct usb2_xfer *xfer)
|
||||
ustorage_fs_t_bbb_data_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ustorage_fs_softc *sc = xfer->priv_sc;
|
||||
uint32_t max_bulk = xfer->max_data_length;
|
||||
@ -726,7 +726,7 @@ ustorage_fs_t_bbb_data_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ustorage_fs_t_bbb_data_write_callback(struct usb2_xfer *xfer)
|
||||
ustorage_fs_t_bbb_data_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ustorage_fs_softc *sc = xfer->priv_sc;
|
||||
uint32_t max_bulk = xfer->max_data_length;
|
||||
@ -788,7 +788,7 @@ ustorage_fs_t_bbb_data_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ustorage_fs_t_bbb_status_callback(struct usb2_xfer *xfer)
|
||||
ustorage_fs_t_bbb_status_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct ustorage_fs_softc *sc = xfer->priv_sc;
|
||||
|
||||
|
@ -54,39 +54,39 @@ MODULE_VERSION(usb_template, 1);
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
static void usb2_make_raw_desc(struct usb2_temp_setup *, const uint8_t *);
|
||||
static void usb2_make_endpoint_desc(struct usb2_temp_setup *,
|
||||
const struct usb2_temp_endpoint_desc *);
|
||||
static void usb2_make_interface_desc(struct usb2_temp_setup *,
|
||||
const struct usb2_temp_interface_desc *);
|
||||
static void usb2_make_config_desc(struct usb2_temp_setup *,
|
||||
const struct usb2_temp_config_desc *);
|
||||
static void usb2_make_device_desc(struct usb2_temp_setup *,
|
||||
const struct usb2_temp_device_desc *);
|
||||
static uint8_t usb2_hw_ep_match(const struct usb2_hw_ep_profile *, uint8_t,
|
||||
static void usb2_make_raw_desc(struct usb_temp_setup *, const uint8_t *);
|
||||
static void usb2_make_endpoint_desc(struct usb_temp_setup *,
|
||||
const struct usb_temp_endpoint_desc *);
|
||||
static void usb2_make_interface_desc(struct usb_temp_setup *,
|
||||
const struct usb_temp_interface_desc *);
|
||||
static void usb2_make_config_desc(struct usb_temp_setup *,
|
||||
const struct usb_temp_config_desc *);
|
||||
static void usb2_make_device_desc(struct usb_temp_setup *,
|
||||
const struct usb_temp_device_desc *);
|
||||
static uint8_t usb2_hw_ep_match(const struct usb_hw_ep_profile *, uint8_t,
|
||||
uint8_t);
|
||||
static uint8_t usb2_hw_ep_find_match(struct usb2_hw_ep_scratch *,
|
||||
struct usb2_hw_ep_scratch_sub *, uint8_t);
|
||||
static uint8_t usb2_hw_ep_get_needs(struct usb2_hw_ep_scratch *, uint8_t,
|
||||
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 usb2_device *,
|
||||
struct usb2_descriptor *);
|
||||
static const struct usb2_temp_device_desc *usb2_temp_get_tdd(struct usb2_device *);
|
||||
static void *usb2_temp_get_device_desc(struct usb2_device *);
|
||||
static void *usb2_temp_get_qualifier_desc(struct usb2_device *);
|
||||
static void *usb2_temp_get_config_desc(struct usb2_device *, uint16_t *,
|
||||
static usb2_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 *);
|
||||
static void *usb2_temp_get_qualifier_desc(struct usb_device *);
|
||||
static void *usb2_temp_get_config_desc(struct usb_device *, uint16_t *,
|
||||
uint8_t);
|
||||
static const void *usb2_temp_get_string_desc(struct usb2_device *, uint16_t,
|
||||
static const void *usb2_temp_get_string_desc(struct usb_device *, uint16_t,
|
||||
uint8_t);
|
||||
static const void *usb2_temp_get_vendor_desc(struct usb2_device *,
|
||||
const struct usb2_device_request *);
|
||||
static const void *usb2_temp_get_hub_desc(struct usb2_device *);
|
||||
static usb2_error_t usb2_temp_get_desc(struct usb2_device *,
|
||||
struct usb2_device_request *, const void **, uint16_t *);
|
||||
static usb2_error_t usb2_temp_setup(struct usb2_device *,
|
||||
const struct usb2_temp_device_desc *);
|
||||
static void usb2_temp_unsetup(struct usb2_device *);
|
||||
static usb2_error_t usb2_temp_setup_by_index(struct usb2_device *,
|
||||
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 *,
|
||||
struct usb_device_request *, const void **, uint16_t *);
|
||||
static usb2_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 *,
|
||||
uint16_t index);
|
||||
static void usb2_temp_init(void *);
|
||||
|
||||
@ -97,7 +97,7 @@ static void usb2_temp_init(void *);
|
||||
* USB configuration.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_make_raw_desc(struct usb2_temp_setup *temp,
|
||||
usb2_make_raw_desc(struct usb_temp_setup *temp,
|
||||
const uint8_t *raw)
|
||||
{
|
||||
void *dst;
|
||||
@ -114,10 +114,10 @@ usb2_make_raw_desc(struct usb2_temp_setup *temp,
|
||||
|
||||
/* check if we have got a CDC union descriptor */
|
||||
|
||||
if ((raw[0] >= sizeof(struct usb2_cdc_union_descriptor)) &&
|
||||
if ((raw[0] >= sizeof(struct usb_cdc_union_descriptor)) &&
|
||||
(raw[1] == UDESC_CS_INTERFACE) &&
|
||||
(raw[2] == UDESCSUB_CDC_UNION)) {
|
||||
struct usb2_cdc_union_descriptor *ud = (void *)dst;
|
||||
struct usb_cdc_union_descriptor *ud = (void *)dst;
|
||||
|
||||
/* update the interface numbers */
|
||||
|
||||
@ -139,10 +139,10 @@ usb2_make_raw_desc(struct usb2_temp_setup *temp,
|
||||
* the USB configuration.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_make_endpoint_desc(struct usb2_temp_setup *temp,
|
||||
const struct usb2_temp_endpoint_desc *ted)
|
||||
usb2_make_endpoint_desc(struct usb_temp_setup *temp,
|
||||
const struct usb_temp_endpoint_desc *ted)
|
||||
{
|
||||
struct usb2_endpoint_descriptor *ed;
|
||||
struct usb_endpoint_descriptor *ed;
|
||||
const void **rd;
|
||||
uint16_t old_size;
|
||||
uint16_t mps;
|
||||
@ -239,11 +239,11 @@ usb2_make_endpoint_desc(struct usb2_temp_setup *temp,
|
||||
* into the USB configuration.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_make_interface_desc(struct usb2_temp_setup *temp,
|
||||
const struct usb2_temp_interface_desc *tid)
|
||||
usb2_make_interface_desc(struct usb_temp_setup *temp,
|
||||
const struct usb_temp_interface_desc *tid)
|
||||
{
|
||||
struct usb2_interface_descriptor *id;
|
||||
const struct usb2_temp_endpoint_desc **ted;
|
||||
struct usb_interface_descriptor *id;
|
||||
const struct usb_temp_endpoint_desc **ted;
|
||||
const void **rd;
|
||||
uint16_t old_size;
|
||||
|
||||
@ -310,11 +310,11 @@ usb2_make_interface_desc(struct usb2_temp_setup *temp,
|
||||
* configuration.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_make_config_desc(struct usb2_temp_setup *temp,
|
||||
const struct usb2_temp_config_desc *tcd)
|
||||
usb2_make_config_desc(struct usb_temp_setup *temp,
|
||||
const struct usb_temp_config_desc *tcd)
|
||||
{
|
||||
struct usb2_config_descriptor *cd;
|
||||
const struct usb2_temp_interface_desc **tid;
|
||||
struct usb_config_descriptor *cd;
|
||||
const struct usb_temp_interface_desc **tid;
|
||||
uint16_t old_size;
|
||||
|
||||
/* Reserve memory */
|
||||
@ -371,11 +371,11 @@ usb2_make_config_desc(struct usb2_temp_setup *temp,
|
||||
* given USB template device descriptor.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_make_device_desc(struct usb2_temp_setup *temp,
|
||||
const struct usb2_temp_device_desc *tdd)
|
||||
usb2_make_device_desc(struct usb_temp_setup *temp,
|
||||
const struct usb_temp_device_desc *tdd)
|
||||
{
|
||||
struct usb2_temp_data *utd;
|
||||
const struct usb2_temp_config_desc **tcd;
|
||||
struct usb_temp_data *utd;
|
||||
const struct usb_temp_config_desc **tcd;
|
||||
uint16_t old_size;
|
||||
|
||||
/* Reserve memory */
|
||||
@ -467,7 +467,7 @@ usb2_make_device_desc(struct usb2_temp_setup *temp,
|
||||
* Else: The endpoint profile matches the criterias
|
||||
*------------------------------------------------------------------------*/
|
||||
static uint8_t
|
||||
usb2_hw_ep_match(const struct usb2_hw_ep_profile *pf,
|
||||
usb2_hw_ep_match(const struct usb_hw_ep_profile *pf,
|
||||
uint8_t ep_type, uint8_t ep_dir_in)
|
||||
{
|
||||
if (ep_type == UE_CONTROL) {
|
||||
@ -496,10 +496,10 @@ usb2_hw_ep_match(const struct usb2_hw_ep_profile *pf,
|
||||
* Else: Failure. No match.
|
||||
*------------------------------------------------------------------------*/
|
||||
static uint8_t
|
||||
usb2_hw_ep_find_match(struct usb2_hw_ep_scratch *ues,
|
||||
struct usb2_hw_ep_scratch_sub *ep, uint8_t is_simplex)
|
||||
usb2_hw_ep_find_match(struct usb_hw_ep_scratch *ues,
|
||||
struct usb_hw_ep_scratch_sub *ep, uint8_t is_simplex)
|
||||
{
|
||||
const struct usb2_hw_ep_profile *pf;
|
||||
const struct usb_hw_ep_profile *pf;
|
||||
uint16_t distance;
|
||||
uint16_t temp;
|
||||
uint16_t max_frame_size;
|
||||
@ -611,17 +611,17 @@ usb2_hw_ep_find_match(struct usb2_hw_ep_scratch *ues,
|
||||
* Else: Failure.
|
||||
*------------------------------------------------------------------------*/
|
||||
static uint8_t
|
||||
usb2_hw_ep_get_needs(struct usb2_hw_ep_scratch *ues,
|
||||
usb2_hw_ep_get_needs(struct usb_hw_ep_scratch *ues,
|
||||
uint8_t ep_type, uint8_t is_complete)
|
||||
{
|
||||
const struct usb2_hw_ep_profile *pf;
|
||||
struct usb2_hw_ep_scratch_sub *ep_iface;
|
||||
struct usb2_hw_ep_scratch_sub *ep_curr;
|
||||
struct usb2_hw_ep_scratch_sub *ep_max;
|
||||
struct usb2_hw_ep_scratch_sub *ep_end;
|
||||
struct usb2_descriptor *desc;
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb2_endpoint_descriptor *ed;
|
||||
const struct usb_hw_ep_profile *pf;
|
||||
struct usb_hw_ep_scratch_sub *ep_iface;
|
||||
struct usb_hw_ep_scratch_sub *ep_curr;
|
||||
struct usb_hw_ep_scratch_sub *ep_max;
|
||||
struct usb_hw_ep_scratch_sub *ep_end;
|
||||
struct usb_descriptor *desc;
|
||||
struct usb_interface_descriptor *id;
|
||||
struct usb_endpoint_descriptor *ed;
|
||||
enum usb_dev_speed speed;
|
||||
uint16_t wMaxPacketSize;
|
||||
uint16_t temp;
|
||||
@ -781,14 +781,14 @@ usb2_hw_ep_get_needs(struct usb2_hw_ep_scratch *ues,
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
usb2_hw_ep_resolve(struct usb2_device *udev,
|
||||
struct usb2_descriptor *desc)
|
||||
usb2_hw_ep_resolve(struct usb_device *udev,
|
||||
struct usb_descriptor *desc)
|
||||
{
|
||||
struct usb2_hw_ep_scratch *ues;
|
||||
struct usb2_hw_ep_scratch_sub *ep;
|
||||
const struct usb2_hw_ep_profile *pf;
|
||||
struct usb2_bus_methods *methods;
|
||||
struct usb2_device_descriptor *dd;
|
||||
struct usb_hw_ep_scratch *ues;
|
||||
struct usb_hw_ep_scratch_sub *ep;
|
||||
const struct usb_hw_ep_profile *pf;
|
||||
struct usb_bus_methods *methods;
|
||||
struct usb_device_descriptor *dd;
|
||||
uint16_t mps;
|
||||
|
||||
if (desc == NULL) {
|
||||
@ -912,8 +912,8 @@ usb2_hw_ep_resolve(struct usb2_device *udev,
|
||||
* NULL: No USB template device descriptor found.
|
||||
* Else: Pointer to the USB template device descriptor.
|
||||
*------------------------------------------------------------------------*/
|
||||
static const struct usb2_temp_device_desc *
|
||||
usb2_temp_get_tdd(struct usb2_device *udev)
|
||||
static const struct usb_temp_device_desc *
|
||||
usb2_temp_get_tdd(struct usb_device *udev)
|
||||
{
|
||||
if (udev->usb2_template_ptr == NULL) {
|
||||
return (NULL);
|
||||
@ -929,9 +929,9 @@ usb2_temp_get_tdd(struct usb2_device *udev)
|
||||
* Else: Pointer to USB device descriptor.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void *
|
||||
usb2_temp_get_device_desc(struct usb2_device *udev)
|
||||
usb2_temp_get_device_desc(struct usb_device *udev)
|
||||
{
|
||||
struct usb2_device_descriptor *dd;
|
||||
struct usb_device_descriptor *dd;
|
||||
|
||||
if (udev->usb2_template_ptr == NULL) {
|
||||
return (NULL);
|
||||
@ -952,9 +952,9 @@ usb2_temp_get_device_desc(struct usb2_device *udev)
|
||||
* Else: Pointer to USB device_qualifier descriptor.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void *
|
||||
usb2_temp_get_qualifier_desc(struct usb2_device *udev)
|
||||
usb2_temp_get_qualifier_desc(struct usb_device *udev)
|
||||
{
|
||||
struct usb2_device_qualifier *dq;
|
||||
struct usb_device_qualifier *dq;
|
||||
|
||||
if (udev->usb2_template_ptr == NULL) {
|
||||
return (NULL);
|
||||
@ -975,11 +975,11 @@ usb2_temp_get_qualifier_desc(struct usb2_device *udev)
|
||||
* Else: Pointer to USB config descriptor having index "index".
|
||||
*------------------------------------------------------------------------*/
|
||||
static void *
|
||||
usb2_temp_get_config_desc(struct usb2_device *udev,
|
||||
usb2_temp_get_config_desc(struct usb_device *udev,
|
||||
uint16_t *pLength, uint8_t index)
|
||||
{
|
||||
struct usb2_device_descriptor *dd;
|
||||
struct usb2_config_descriptor *cd;
|
||||
struct usb_device_descriptor *dd;
|
||||
struct usb_config_descriptor *cd;
|
||||
uint16_t temp;
|
||||
|
||||
if (udev->usb2_template_ptr == NULL) {
|
||||
@ -1015,10 +1015,10 @@ usb2_temp_get_config_desc(struct usb2_device *udev,
|
||||
* Else: Pointer to a vendor descriptor.
|
||||
*------------------------------------------------------------------------*/
|
||||
static const void *
|
||||
usb2_temp_get_vendor_desc(struct usb2_device *udev,
|
||||
const struct usb2_device_request *req)
|
||||
usb2_temp_get_vendor_desc(struct usb_device *udev,
|
||||
const struct usb_device_request *req)
|
||||
{
|
||||
const struct usb2_temp_device_desc *tdd;
|
||||
const struct usb_temp_device_desc *tdd;
|
||||
|
||||
tdd = usb2_temp_get_tdd(udev);
|
||||
if (tdd == NULL) {
|
||||
@ -1038,10 +1038,10 @@ usb2_temp_get_vendor_desc(struct usb2_device *udev,
|
||||
* Else: Pointer to a string descriptor.
|
||||
*------------------------------------------------------------------------*/
|
||||
static const void *
|
||||
usb2_temp_get_string_desc(struct usb2_device *udev,
|
||||
usb2_temp_get_string_desc(struct usb_device *udev,
|
||||
uint16_t lang_id, uint8_t string_index)
|
||||
{
|
||||
const struct usb2_temp_device_desc *tdd;
|
||||
const struct usb_temp_device_desc *tdd;
|
||||
|
||||
tdd = usb2_temp_get_tdd(udev);
|
||||
if (tdd == NULL) {
|
||||
@ -1061,7 +1061,7 @@ usb2_temp_get_string_desc(struct usb2_device *udev,
|
||||
* Else: Pointer to a USB HUB descriptor.
|
||||
*------------------------------------------------------------------------*/
|
||||
static const void *
|
||||
usb2_temp_get_hub_desc(struct usb2_device *udev)
|
||||
usb2_temp_get_hub_desc(struct usb_device *udev)
|
||||
{
|
||||
return (NULL); /* needs to be implemented */
|
||||
}
|
||||
@ -1073,7 +1073,7 @@ usb2_temp_get_hub_desc(struct usb2_device *udev)
|
||||
* endpoint requests.
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
usb2_temp_get_desc(struct usb2_device *udev, struct usb2_device_request *req,
|
||||
usb2_temp_get_desc(struct usb_device *udev, struct usb_device_request *req,
|
||||
const void **pPtr, uint16_t *pLength)
|
||||
{
|
||||
const uint8_t *buf;
|
||||
@ -1166,7 +1166,7 @@ usb2_temp_get_desc(struct usb2_device *udev, struct usb2_device_request *req,
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* usb2_temp_setup
|
||||
* usb_temp_setup
|
||||
*
|
||||
* This function generates USB descriptors according to the given USB
|
||||
* template device descriptor. It will also try to figure out the best
|
||||
@ -1177,10 +1177,10 @@ usb2_temp_get_desc(struct usb2_device *udev, struct usb2_device_request *req,
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
usb2_temp_setup(struct usb2_device *udev,
|
||||
const struct usb2_temp_device_desc *tdd)
|
||||
usb_temp_setup(struct usb_device *udev,
|
||||
const struct usb_temp_device_desc *tdd)
|
||||
{
|
||||
struct usb2_temp_setup *uts;
|
||||
struct usb_temp_setup *uts;
|
||||
void *buf;
|
||||
uint8_t n;
|
||||
|
||||
@ -1267,7 +1267,7 @@ usb2_temp_setup(struct usb2_device *udev,
|
||||
* setup template, if any.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_temp_unsetup(struct usb2_device *udev)
|
||||
usb2_temp_unsetup(struct usb_device *udev)
|
||||
{
|
||||
if (udev->usb2_template_ptr) {
|
||||
|
||||
@ -1278,19 +1278,19 @@ usb2_temp_unsetup(struct usb2_device *udev)
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
usb2_temp_setup_by_index(struct usb2_device *udev, uint16_t index)
|
||||
usb2_temp_setup_by_index(struct usb_device *udev, uint16_t index)
|
||||
{
|
||||
usb2_error_t err;
|
||||
|
||||
switch (index) {
|
||||
case 0:
|
||||
err = usb2_temp_setup(udev, &usb2_template_msc);
|
||||
err = usb_temp_setup(udev, &usb2_template_msc);
|
||||
break;
|
||||
case 1:
|
||||
err = usb2_temp_setup(udev, &usb2_template_cdce);
|
||||
err = usb_temp_setup(udev, &usb2_template_cdce);
|
||||
break;
|
||||
case 2:
|
||||
err = usb2_temp_setup(udev, &usb2_template_mtp);
|
||||
err = usb_temp_setup(udev, &usb2_template_mtp);
|
||||
break;
|
||||
default:
|
||||
return (USB_ERR_INVAL);
|
||||
|
@ -31,20 +31,20 @@
|
||||
#define _USB_TEMPLATE_H_
|
||||
|
||||
typedef const void *(usb2_temp_get_string_desc_t)(uint16_t lang_id, uint8_t string_index);
|
||||
typedef const void *(usb2_temp_get_vendor_desc_t)(const struct usb2_device_request *req);
|
||||
typedef const void *(usb2_temp_get_vendor_desc_t)(const struct usb_device_request *req);
|
||||
|
||||
struct usb2_temp_packet_size {
|
||||
struct usb_temp_packet_size {
|
||||
uint16_t mps[USB_SPEED_MAX];
|
||||
};
|
||||
|
||||
struct usb2_temp_interval {
|
||||
struct usb_temp_interval {
|
||||
uint8_t bInterval[USB_SPEED_MAX];
|
||||
};
|
||||
|
||||
struct usb2_temp_endpoint_desc {
|
||||
struct usb_temp_endpoint_desc {
|
||||
const void **ppRawDesc;
|
||||
const struct usb2_temp_packet_size *pPacketSize;
|
||||
const struct usb2_temp_interval *pIntervals;
|
||||
const struct usb_temp_packet_size *pPacketSize;
|
||||
const struct usb_temp_interval *pIntervals;
|
||||
/*
|
||||
* If (bEndpointAddress & UE_ADDR) is non-zero the endpoint number
|
||||
* is pre-selected for this endpoint descriptor. Else an endpoint
|
||||
@ -54,9 +54,9 @@ struct usb2_temp_endpoint_desc {
|
||||
uint8_t bmAttributes;
|
||||
};
|
||||
|
||||
struct usb2_temp_interface_desc {
|
||||
struct usb_temp_interface_desc {
|
||||
const void **ppRawDesc;
|
||||
const struct usb2_temp_endpoint_desc **ppEndpoints;
|
||||
const struct usb_temp_endpoint_desc **ppEndpoints;
|
||||
uint8_t bInterfaceClass;
|
||||
uint8_t bInterfaceSubClass;
|
||||
uint8_t bInterfaceProtocol;
|
||||
@ -64,17 +64,17 @@ struct usb2_temp_interface_desc {
|
||||
uint8_t isAltInterface;
|
||||
};
|
||||
|
||||
struct usb2_temp_config_desc {
|
||||
const struct usb2_temp_interface_desc **ppIfaceDesc;
|
||||
struct usb_temp_config_desc {
|
||||
const struct usb_temp_interface_desc **ppIfaceDesc;
|
||||
uint8_t bmAttributes;
|
||||
uint8_t bMaxPower;
|
||||
uint8_t iConfiguration;
|
||||
};
|
||||
|
||||
struct usb2_temp_device_desc {
|
||||
struct usb_temp_device_desc {
|
||||
usb2_temp_get_string_desc_t *getStringDesc;
|
||||
usb2_temp_get_vendor_desc_t *getVendorDesc;
|
||||
const struct usb2_temp_config_desc **ppConfigDesc;
|
||||
const struct usb_temp_config_desc **ppConfigDesc;
|
||||
uint16_t idVendor;
|
||||
uint16_t idProduct;
|
||||
uint16_t bcdDevice;
|
||||
@ -86,17 +86,17 @@ struct usb2_temp_device_desc {
|
||||
uint8_t iSerialNumber;
|
||||
};
|
||||
|
||||
struct usb2_temp_data {
|
||||
const struct usb2_temp_device_desc *tdd;
|
||||
struct usb2_device_descriptor udd; /* device descriptor */
|
||||
struct usb2_device_qualifier udq; /* device qualifier */
|
||||
struct usb_temp_data {
|
||||
const struct usb_temp_device_desc *tdd;
|
||||
struct usb_device_descriptor udd; /* device descriptor */
|
||||
struct usb_device_qualifier udq; /* device qualifier */
|
||||
};
|
||||
|
||||
/* prototypes */
|
||||
|
||||
extern const struct usb2_temp_device_desc usb2_template_cdce;
|
||||
extern const struct usb2_temp_device_desc usb2_template_msc; /* Mass Storage Class */
|
||||
extern const struct usb2_temp_device_desc usb2_template_mtp; /* Message Transfer
|
||||
extern const struct usb_temp_device_desc usb2_template_cdce;
|
||||
extern const struct usb_temp_device_desc usb2_template_msc; /* Mass Storage Class */
|
||||
extern const struct usb_temp_device_desc usb2_template_mtp; /* Message Transfer
|
||||
* Protocol */
|
||||
|
||||
#endif /* _USB_TEMPLATE_H_ */
|
||||
|
@ -118,7 +118,7 @@ USB_MAKE_STRING_DESC(STRING_ETH_SERIAL, string_eth_serial);
|
||||
|
||||
static usb2_temp_get_string_desc_t eth_get_string_desc;
|
||||
|
||||
static const struct usb2_cdc_union_descriptor eth_union_desc = {
|
||||
static const struct usb_cdc_union_descriptor eth_union_desc = {
|
||||
.bLength = sizeof(eth_union_desc),
|
||||
.bDescriptorType = UDESC_CS_INTERFACE,
|
||||
.bDescriptorSubtype = UDESCSUB_CDC_UNION,
|
||||
@ -126,7 +126,7 @@ static const struct usb2_cdc_union_descriptor eth_union_desc = {
|
||||
.bSlaveInterface[0] = 1, /* this is automatically updated */
|
||||
};
|
||||
|
||||
static const struct usb2_cdc_header_descriptor eth_header_desc = {
|
||||
static const struct usb_cdc_header_descriptor eth_header_desc = {
|
||||
.bLength = sizeof(eth_header_desc),
|
||||
.bDescriptorType = UDESC_CS_INTERFACE,
|
||||
.bDescriptorSubtype = UDESCSUB_CDC_HEADER,
|
||||
@ -134,7 +134,7 @@ static const struct usb2_cdc_header_descriptor eth_header_desc = {
|
||||
.bcdCDC[1] = 0x01,
|
||||
};
|
||||
|
||||
static const struct usb2_cdc_ethernet_descriptor eth_enf_desc = {
|
||||
static const struct usb_cdc_ethernet_descriptor eth_enf_desc = {
|
||||
.bLength = sizeof(eth_enf_desc),
|
||||
.bDescriptorType = UDESC_CS_INTERFACE,
|
||||
.bDescriptorSubtype = UDESCSUB_CDC_ENF,
|
||||
@ -152,17 +152,17 @@ static const void *eth_control_if_desc[] = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_packet_size bulk_mps = {
|
||||
static const struct usb_temp_packet_size bulk_mps = {
|
||||
.mps[USB_SPEED_FULL] = 64,
|
||||
.mps[USB_SPEED_HIGH] = 512,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_packet_size intr_mps = {
|
||||
static const struct usb_temp_packet_size intr_mps = {
|
||||
.mps[USB_SPEED_FULL] = 8,
|
||||
.mps[USB_SPEED_HIGH] = 8,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_endpoint_desc bulk_in_ep = {
|
||||
static const struct usb_temp_endpoint_desc bulk_in_ep = {
|
||||
.pPacketSize = &bulk_mps,
|
||||
#ifdef USB_HIP_IN_EP_0
|
||||
.bEndpointAddress = USB_HIP_IN_EP_0,
|
||||
@ -172,7 +172,7 @@ static const struct usb2_temp_endpoint_desc bulk_in_ep = {
|
||||
.bmAttributes = UE_BULK,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_endpoint_desc bulk_out_ep = {
|
||||
static const struct usb_temp_endpoint_desc bulk_out_ep = {
|
||||
.pPacketSize = &bulk_mps,
|
||||
#ifdef USB_HIP_OUT_EP_0
|
||||
.bEndpointAddress = USB_HIP_OUT_EP_0,
|
||||
@ -182,18 +182,18 @@ static const struct usb2_temp_endpoint_desc bulk_out_ep = {
|
||||
.bmAttributes = UE_BULK,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_endpoint_desc intr_in_ep = {
|
||||
static const struct usb_temp_endpoint_desc intr_in_ep = {
|
||||
.pPacketSize = &intr_mps,
|
||||
.bEndpointAddress = UE_DIR_IN,
|
||||
.bmAttributes = UE_INTERRUPT,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_endpoint_desc *eth_intr_endpoints[] = {
|
||||
static const struct usb_temp_endpoint_desc *eth_intr_endpoints[] = {
|
||||
&intr_in_ep,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_interface_desc eth_control_interface = {
|
||||
static const struct usb_temp_interface_desc eth_control_interface = {
|
||||
.ppEndpoints = eth_intr_endpoints,
|
||||
.ppRawDesc = eth_control_if_desc,
|
||||
.bInterfaceClass = UICLASS_CDC,
|
||||
@ -202,13 +202,13 @@ static const struct usb2_temp_interface_desc eth_control_interface = {
|
||||
.iInterface = STRING_ETH_CONTROL_INDEX,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_endpoint_desc *eth_data_endpoints[] = {
|
||||
static const struct usb_temp_endpoint_desc *eth_data_endpoints[] = {
|
||||
&bulk_in_ep,
|
||||
&bulk_out_ep,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_interface_desc eth_data_null_interface = {
|
||||
static const struct usb_temp_interface_desc eth_data_null_interface = {
|
||||
.ppEndpoints = NULL, /* no endpoints */
|
||||
.bInterfaceClass = UICLASS_CDC_DATA,
|
||||
.bInterfaceSubClass = 0,
|
||||
@ -216,7 +216,7 @@ static const struct usb2_temp_interface_desc eth_data_null_interface = {
|
||||
.iInterface = STRING_ETH_DATA_INDEX,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_interface_desc eth_data_interface = {
|
||||
static const struct usb_temp_interface_desc eth_data_interface = {
|
||||
.ppEndpoints = eth_data_endpoints,
|
||||
.bInterfaceClass = UICLASS_CDC_DATA,
|
||||
.bInterfaceSubClass = UISUBCLASS_DATA,
|
||||
@ -225,26 +225,26 @@ static const struct usb2_temp_interface_desc eth_data_interface = {
|
||||
.isAltInterface = 1, /* this is an alternate setting */
|
||||
};
|
||||
|
||||
static const struct usb2_temp_interface_desc *eth_interfaces[] = {
|
||||
static const struct usb_temp_interface_desc *eth_interfaces[] = {
|
||||
ð_control_interface,
|
||||
ð_data_null_interface,
|
||||
ð_data_interface,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_config_desc eth_config_desc = {
|
||||
static const struct usb_temp_config_desc eth_config_desc = {
|
||||
.ppIfaceDesc = eth_interfaces,
|
||||
.bmAttributes = UC_BUS_POWERED,
|
||||
.bMaxPower = 25, /* 50 mA */
|
||||
.iConfiguration = STRING_ETH_CONFIG_INDEX,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_config_desc *eth_configs[] = {
|
||||
static const struct usb_temp_config_desc *eth_configs[] = {
|
||||
ð_config_desc,
|
||||
NULL,
|
||||
};
|
||||
|
||||
const struct usb2_temp_device_desc usb2_template_cdce = {
|
||||
const struct usb_temp_device_desc usb2_template_cdce = {
|
||||
.getStringDesc = ð_get_string_desc,
|
||||
.ppConfigDesc = eth_configs,
|
||||
.idVendor = 0x0001,
|
||||
|
@ -97,12 +97,12 @@ USB_MAKE_STRING_DESC(STRING_MSC_SERIAL, string_msc_serial);
|
||||
|
||||
static usb2_temp_get_string_desc_t msc_get_string_desc;
|
||||
|
||||
static const struct usb2_temp_packet_size bulk_mps = {
|
||||
static const struct usb_temp_packet_size bulk_mps = {
|
||||
.mps[USB_SPEED_FULL] = 64,
|
||||
.mps[USB_SPEED_HIGH] = 512,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_endpoint_desc bulk_in_ep = {
|
||||
static const struct usb_temp_endpoint_desc bulk_in_ep = {
|
||||
.pPacketSize = &bulk_mps,
|
||||
#ifdef USB_HIP_IN_EP_0
|
||||
.bEndpointAddress = USB_HIP_IN_EP_0,
|
||||
@ -112,7 +112,7 @@ static const struct usb2_temp_endpoint_desc bulk_in_ep = {
|
||||
.bmAttributes = UE_BULK,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_endpoint_desc bulk_out_ep = {
|
||||
static const struct usb_temp_endpoint_desc bulk_out_ep = {
|
||||
.pPacketSize = &bulk_mps,
|
||||
#ifdef USB_HIP_OUT_EP_0
|
||||
.bEndpointAddress = USB_HIP_OUT_EP_0,
|
||||
@ -122,13 +122,13 @@ static const struct usb2_temp_endpoint_desc bulk_out_ep = {
|
||||
.bmAttributes = UE_BULK,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_endpoint_desc *msc_data_endpoints[] = {
|
||||
static const struct usb_temp_endpoint_desc *msc_data_endpoints[] = {
|
||||
&bulk_in_ep,
|
||||
&bulk_out_ep,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_interface_desc msc_data_interface = {
|
||||
static const struct usb_temp_interface_desc msc_data_interface = {
|
||||
.ppEndpoints = msc_data_endpoints,
|
||||
.bInterfaceClass = UICLASS_MASS,
|
||||
.bInterfaceSubClass = UISUBCLASS_SCSI,
|
||||
@ -136,24 +136,24 @@ static const struct usb2_temp_interface_desc msc_data_interface = {
|
||||
.iInterface = STRING_MSC_DATA_INDEX,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_interface_desc *msc_interfaces[] = {
|
||||
static const struct usb_temp_interface_desc *msc_interfaces[] = {
|
||||
&msc_data_interface,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_config_desc msc_config_desc = {
|
||||
static const struct usb_temp_config_desc msc_config_desc = {
|
||||
.ppIfaceDesc = msc_interfaces,
|
||||
.bmAttributes = UC_BUS_POWERED,
|
||||
.bMaxPower = 25, /* 50 mA */
|
||||
.iConfiguration = STRING_MSC_CONFIG_INDEX,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_config_desc *msc_configs[] = {
|
||||
static const struct usb_temp_config_desc *msc_configs[] = {
|
||||
&msc_config_desc,
|
||||
NULL,
|
||||
};
|
||||
|
||||
const struct usb2_temp_device_desc usb2_template_msc = {
|
||||
const struct usb_temp_device_desc usb2_template_msc = {
|
||||
.getStringDesc = &msc_get_string_desc,
|
||||
.ppConfigDesc = msc_configs,
|
||||
.idVendor = 0x0001,
|
||||
|
@ -103,17 +103,17 @@ USB_MAKE_STRING_DESC(STRING_MTP_SERIAL, string_mtp_serial);
|
||||
static usb2_temp_get_string_desc_t mtp_get_string_desc;
|
||||
static usb2_temp_get_vendor_desc_t mtp_get_vendor_desc;
|
||||
|
||||
static const struct usb2_temp_packet_size bulk_mps = {
|
||||
static const struct usb_temp_packet_size bulk_mps = {
|
||||
.mps[USB_SPEED_FULL] = 64,
|
||||
.mps[USB_SPEED_HIGH] = 512,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_packet_size intr_mps = {
|
||||
static const struct usb_temp_packet_size intr_mps = {
|
||||
.mps[USB_SPEED_FULL] = 64,
|
||||
.mps[USB_SPEED_HIGH] = 64,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_endpoint_desc bulk_out_ep = {
|
||||
static const struct usb_temp_endpoint_desc bulk_out_ep = {
|
||||
.pPacketSize = &bulk_mps,
|
||||
#ifdef USB_HIP_OUT_EP_0
|
||||
.bEndpointAddress = USB_HIP_OUT_EP_0,
|
||||
@ -123,13 +123,13 @@ static const struct usb2_temp_endpoint_desc bulk_out_ep = {
|
||||
.bmAttributes = UE_BULK,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_endpoint_desc intr_in_ep = {
|
||||
static const struct usb_temp_endpoint_desc intr_in_ep = {
|
||||
.pPacketSize = &intr_mps,
|
||||
.bEndpointAddress = UE_DIR_IN,
|
||||
.bmAttributes = UE_INTERRUPT,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_endpoint_desc bulk_in_ep = {
|
||||
static const struct usb_temp_endpoint_desc bulk_in_ep = {
|
||||
.pPacketSize = &bulk_mps,
|
||||
#ifdef USB_HIP_IN_EP_0
|
||||
.bEndpointAddress = USB_HIP_IN_EP_0,
|
||||
@ -139,14 +139,14 @@ static const struct usb2_temp_endpoint_desc bulk_in_ep = {
|
||||
.bmAttributes = UE_BULK,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_endpoint_desc *mtp_data_endpoints[] = {
|
||||
static const struct usb_temp_endpoint_desc *mtp_data_endpoints[] = {
|
||||
&bulk_in_ep,
|
||||
&bulk_out_ep,
|
||||
&intr_in_ep,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_interface_desc mtp_data_interface = {
|
||||
static const struct usb_temp_interface_desc mtp_data_interface = {
|
||||
.ppEndpoints = mtp_data_endpoints,
|
||||
.bInterfaceClass = UICLASS_IMAGE,
|
||||
.bInterfaceSubClass = UISUBCLASS_SIC, /* Still Image Class */
|
||||
@ -154,24 +154,24 @@ static const struct usb2_temp_interface_desc mtp_data_interface = {
|
||||
.iInterface = STRING_MTP_DATA_INDEX,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_interface_desc *mtp_interfaces[] = {
|
||||
static const struct usb_temp_interface_desc *mtp_interfaces[] = {
|
||||
&mtp_data_interface,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_config_desc mtp_config_desc = {
|
||||
static const struct usb_temp_config_desc mtp_config_desc = {
|
||||
.ppIfaceDesc = mtp_interfaces,
|
||||
.bmAttributes = UC_BUS_POWERED,
|
||||
.bMaxPower = 25, /* 50 mA */
|
||||
.iConfiguration = STRING_MTP_CONFIG_INDEX,
|
||||
};
|
||||
|
||||
static const struct usb2_temp_config_desc *mtp_configs[] = {
|
||||
static const struct usb_temp_config_desc *mtp_configs[] = {
|
||||
&mtp_config_desc,
|
||||
NULL,
|
||||
};
|
||||
|
||||
const struct usb2_temp_device_desc usb2_template_mtp = {
|
||||
const struct usb_temp_device_desc usb2_template_mtp = {
|
||||
.getStringDesc = &mtp_get_string_desc,
|
||||
.getVendorDesc = &mtp_get_vendor_desc,
|
||||
.ppConfigDesc = mtp_configs,
|
||||
@ -194,7 +194,7 @@ const struct usb2_temp_device_desc usb2_template_mtp = {
|
||||
* Else: Success. Pointer to vendor descriptor is returned.
|
||||
*------------------------------------------------------------------------*/
|
||||
static const void *
|
||||
mtp_get_vendor_desc(const struct usb2_device_request *req)
|
||||
mtp_get_vendor_desc(const struct usb_device_request *req)
|
||||
{
|
||||
static const uint8_t dummy_desc[0x28] = {
|
||||
0x28, 0, 0, 0, 0, 1, 4, 0,
|
||||
|
@ -102,14 +102,14 @@
|
||||
|
||||
/* Declaration of USB records */
|
||||
|
||||
struct usb2_device_request {
|
||||
struct usb_device_request {
|
||||
uByte bmRequestType;
|
||||
uByte bRequest;
|
||||
uWord wValue;
|
||||
uWord wIndex;
|
||||
uWord wLength;
|
||||
} __packed;
|
||||
typedef struct usb2_device_request usb_device_request_t;
|
||||
typedef struct usb_device_request usb_device_request_t;
|
||||
|
||||
#define UT_WRITE 0x00
|
||||
#define UT_READ 0x80
|
||||
@ -226,14 +226,14 @@ typedef struct usb2_device_request usb_device_request_t;
|
||||
#define UHF_C_BH_PORT_RESET 29
|
||||
#define UHF_FORCE_LINKPM_ACCEPT 30
|
||||
|
||||
struct usb2_descriptor {
|
||||
struct usb_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bDescriptorSubtype;
|
||||
} __packed;
|
||||
typedef struct usb2_descriptor usb_descriptor_t;
|
||||
typedef struct usb_descriptor usb_descriptor_t;
|
||||
|
||||
struct usb2_device_descriptor {
|
||||
struct usb_device_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uWord bcdUSB;
|
||||
@ -254,19 +254,19 @@ struct usb2_device_descriptor {
|
||||
uByte iSerialNumber;
|
||||
uByte bNumConfigurations;
|
||||
} __packed;
|
||||
typedef struct usb2_device_descriptor usb_device_descriptor_t;
|
||||
typedef struct usb_device_descriptor usb_device_descriptor_t;
|
||||
|
||||
/* Binary Device Object Store (BOS) */
|
||||
struct usb2_bos_descriptor {
|
||||
struct usb_bos_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uWord wTotalLength;
|
||||
uByte bNumDeviceCaps;
|
||||
} __packed;
|
||||
typedef struct usb2_bos_descriptor usb_bos_descriptor_t;
|
||||
typedef struct usb_bos_descriptor usb_bos_descriptor_t;
|
||||
|
||||
/* Binary Device Object Store Capability */
|
||||
struct usb2_bos_cap_descriptor {
|
||||
struct usb_bos_cap_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bDevCapabilityType;
|
||||
@ -277,18 +277,18 @@ struct usb2_bos_cap_descriptor {
|
||||
#define USB_DEVCAP_CONTAINER_ID 0x04
|
||||
/* data ... */
|
||||
} __packed;
|
||||
typedef struct usb2_bos_cap_descriptor usb_bos_cap_descriptor_t;
|
||||
typedef struct usb_bos_cap_descriptor usb_bos_cap_descriptor_t;
|
||||
|
||||
struct usb2_devcap_usb2ext_descriptor {
|
||||
struct usb_devcap_usb2ext_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bDevCapabilityType;
|
||||
uByte bmAttributes;
|
||||
#define USB_V2EXT_LPM 0x02
|
||||
} __packed;
|
||||
typedef struct usb2_devcap_usb2ext_descriptor usb_devcap_usb2ext_descriptor_t;
|
||||
typedef struct usb_devcap_usb2ext_descriptor usb_devcap_usb2ext_descriptor_t;
|
||||
|
||||
struct usb2_devcap_ss_descriptor {
|
||||
struct usb_devcap_ss_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bDevCapabilityType;
|
||||
@ -298,16 +298,16 @@ struct usb2_devcap_ss_descriptor {
|
||||
uByte bU1DevExitLat;
|
||||
uByte bU2DevExitLat;
|
||||
} __packed;
|
||||
typedef struct usb2_devcap_ss_descriptor usb_devcap_ss_descriptor_t;
|
||||
typedef struct usb_devcap_ss_descriptor usb_devcap_ss_descriptor_t;
|
||||
|
||||
struct usb2_devcap_container_id_descriptor {
|
||||
struct usb_devcap_container_id_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bDevCapabilityType;
|
||||
uByte bReserved;
|
||||
uByte ContainerID;
|
||||
} __packed;
|
||||
typedef struct usb2_devcap_container_id_descriptor
|
||||
typedef struct usb_devcap_container_id_descriptor
|
||||
usb_devcap_container_id_descriptor_t;
|
||||
|
||||
/* Device class codes */
|
||||
@ -324,7 +324,7 @@ typedef struct usb2_devcap_container_id_descriptor
|
||||
#define UDPROTO_BLUETOOTH 0x01
|
||||
#define UDCLASS_VENDOR 0xff
|
||||
|
||||
struct usb2_config_descriptor {
|
||||
struct usb_config_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uWord wTotalLength;
|
||||
@ -339,9 +339,9 @@ struct usb2_config_descriptor {
|
||||
uByte bMaxPower; /* max current in 2 mA units */
|
||||
#define UC_POWER_FACTOR 2
|
||||
} __packed;
|
||||
typedef struct usb2_config_descriptor usb_config_descriptor_t;
|
||||
typedef struct usb_config_descriptor usb_config_descriptor_t;
|
||||
|
||||
struct usb2_interface_descriptor {
|
||||
struct usb_interface_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bInterfaceNumber;
|
||||
@ -352,9 +352,9 @@ struct usb2_interface_descriptor {
|
||||
uByte bInterfaceProtocol;
|
||||
uByte iInterface;
|
||||
} __packed;
|
||||
typedef struct usb2_interface_descriptor usb_interface_descriptor_t;
|
||||
typedef struct usb_interface_descriptor usb_interface_descriptor_t;
|
||||
|
||||
struct usb2_interface_assoc_descriptor {
|
||||
struct usb_interface_assoc_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bFirstInterface;
|
||||
@ -364,7 +364,7 @@ struct usb2_interface_assoc_descriptor {
|
||||
uByte bFunctionProtocol;
|
||||
uByte iFunction;
|
||||
} __packed;
|
||||
typedef struct usb2_interface_assoc_descriptor usb_interface_assoc_descriptor_t;
|
||||
typedef struct usb_interface_assoc_descriptor usb_interface_assoc_descriptor_t;
|
||||
|
||||
/* Interface class codes */
|
||||
#define UICLASS_UNSPEC 0x00
|
||||
@ -455,7 +455,7 @@ typedef struct usb2_interface_assoc_descriptor usb_interface_assoc_descriptor_t;
|
||||
#define UISUBCLASS_XBOX360_CONTROLLER 0x5d
|
||||
#define UIPROTO_XBOX360_GAMEPAD 0x01
|
||||
|
||||
struct usb2_endpoint_descriptor {
|
||||
struct usb_endpoint_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bEndpointAddress;
|
||||
@ -487,25 +487,25 @@ struct usb2_endpoint_descriptor {
|
||||
#define UE_ZERO_MPS 0xFFFF /* for internal use only */
|
||||
uByte bInterval;
|
||||
} __packed;
|
||||
typedef struct usb2_endpoint_descriptor usb_endpoint_descriptor_t;
|
||||
typedef struct usb_endpoint_descriptor usb_endpoint_descriptor_t;
|
||||
|
||||
struct usb2_endpoint_ss_comp_descriptor {
|
||||
struct usb_endpoint_ss_comp_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uWord bMaxBurst;
|
||||
uByte bmAttributes;
|
||||
uWord wBytesPerInterval;
|
||||
} __packed;
|
||||
typedef struct usb2_endpoint_ss_comp_descriptor
|
||||
typedef struct usb_endpoint_ss_comp_descriptor
|
||||
usb_endpoint_ss_comp_descriptor_t;
|
||||
|
||||
struct usb2_string_descriptor {
|
||||
struct usb_string_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uWord bString[126];
|
||||
uByte bUnused;
|
||||
} __packed;
|
||||
typedef struct usb2_string_descriptor usb_string_descriptor_t;
|
||||
typedef struct usb_string_descriptor usb_string_descriptor_t;
|
||||
|
||||
#define USB_MAKE_STRING_DESC(m,name) \
|
||||
struct name { \
|
||||
@ -519,7 +519,7 @@ static const struct name name = { \
|
||||
.bData = { m }, \
|
||||
}
|
||||
|
||||
struct usb2_hub_descriptor {
|
||||
struct usb_hub_descriptor {
|
||||
uByte bDescLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bNbrPorts;
|
||||
@ -547,9 +547,9 @@ struct usb2_hub_descriptor {
|
||||
(((desc)->DeviceRemovable[(i)/8] >> ((i) % 8)) & 1)
|
||||
uByte PortPowerCtrlMask[1]; /* deprecated */
|
||||
} __packed;
|
||||
typedef struct usb2_hub_descriptor usb_hub_descriptor_t;
|
||||
typedef struct usb_hub_descriptor usb_hub_descriptor_t;
|
||||
|
||||
struct usb2_hub_ss_descriptor {
|
||||
struct usb_hub_ss_descriptor {
|
||||
uByte bDescLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bNbrPorts; /* max 15 */
|
||||
@ -560,10 +560,10 @@ struct usb2_hub_ss_descriptor {
|
||||
uWord wHubDelay;
|
||||
uByte DeviceRemovable[2]; /* max 15 ports */
|
||||
} __packed;
|
||||
typedef struct usb2_hub_ss_descriptor usb_hub_ss_descriptor_t;
|
||||
typedef struct usb_hub_ss_descriptor usb_hub_ss_descriptor_t;
|
||||
|
||||
/* minimum HUB descriptor (8-ports maximum) */
|
||||
struct usb2_hub_descriptor_min {
|
||||
struct usb_hub_descriptor_min {
|
||||
uByte bDescLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bNbrPorts;
|
||||
@ -573,9 +573,9 @@ struct usb2_hub_descriptor_min {
|
||||
uByte DeviceRemovable[1];
|
||||
uByte PortPowerCtrlMask[1];
|
||||
} __packed;
|
||||
typedef struct usb2_hub_descriptor_min usb_hub_descriptor_min_t;
|
||||
typedef struct usb_hub_descriptor_min usb_hub_descriptor_min_t;
|
||||
|
||||
struct usb2_device_qualifier {
|
||||
struct usb_device_qualifier {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uWord bcdUSB;
|
||||
@ -586,23 +586,23 @@ struct usb2_device_qualifier {
|
||||
uByte bNumConfigurations;
|
||||
uByte bReserved;
|
||||
} __packed;
|
||||
typedef struct usb2_device_qualifier usb_device_qualifier_t;
|
||||
typedef struct usb_device_qualifier usb_device_qualifier_t;
|
||||
|
||||
struct usb2_otg_descriptor {
|
||||
struct usb_otg_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bmAttributes;
|
||||
#define UOTG_SRP 0x01
|
||||
#define UOTG_HNP 0x02
|
||||
} __packed;
|
||||
typedef struct usb2_otg_descriptor usb_otg_descriptor_t;
|
||||
typedef struct usb_otg_descriptor usb_otg_descriptor_t;
|
||||
|
||||
/* OTG feature selectors */
|
||||
#define UOTG_B_HNP_ENABLE 3
|
||||
#define UOTG_A_HNP_SUPPORT 4
|
||||
#define UOTG_A_ALT_HNP_SUPPORT 5
|
||||
|
||||
struct usb2_status {
|
||||
struct usb_status {
|
||||
uWord wStatus;
|
||||
/* Device status flags */
|
||||
#define UDS_SELF_POWERED 0x0001
|
||||
@ -610,17 +610,17 @@ struct usb2_status {
|
||||
/* Endpoint status flags */
|
||||
#define UES_HALT 0x0001
|
||||
} __packed;
|
||||
typedef struct usb2_status usb_status_t;
|
||||
typedef struct usb_status usb_status_t;
|
||||
|
||||
struct usb2_hub_status {
|
||||
struct usb_hub_status {
|
||||
uWord wHubStatus;
|
||||
#define UHS_LOCAL_POWER 0x0001
|
||||
#define UHS_OVER_CURRENT 0x0002
|
||||
uWord wHubChange;
|
||||
} __packed;
|
||||
typedef struct usb2_hub_status usb_hub_status_t;
|
||||
typedef struct usb_hub_status usb_hub_status_t;
|
||||
|
||||
struct usb2_port_status {
|
||||
struct usb_port_status {
|
||||
uWord wPortStatus;
|
||||
#define UPS_CURRENT_CONNECT_STATUS 0x0001
|
||||
#define UPS_PORT_ENABLED 0x0002
|
||||
@ -640,6 +640,6 @@ struct usb2_port_status {
|
||||
#define UPS_C_OVERCURRENT_INDICATOR 0x0008
|
||||
#define UPS_C_PORT_RESET 0x0010
|
||||
} __packed;
|
||||
typedef struct usb2_port_status usb_port_status_t;
|
||||
typedef struct usb_port_status usb_port_status_t;
|
||||
|
||||
#endif /* _USB2_STANDARD_H_ */
|
||||
|
@ -32,15 +32,15 @@
|
||||
* explore process.
|
||||
*/
|
||||
|
||||
struct usb2_bus_msg {
|
||||
struct usb2_proc_msg hdr;
|
||||
struct usb2_bus *bus;
|
||||
struct usb_bus_msg {
|
||||
struct usb_proc_msg hdr;
|
||||
struct usb_bus *bus;
|
||||
};
|
||||
|
||||
/*
|
||||
* The following structure defines the USB statistics structure.
|
||||
*/
|
||||
struct usb2_bus_stat {
|
||||
struct usb_bus_stat {
|
||||
uint32_t uds_requests[4];
|
||||
};
|
||||
|
||||
@ -48,43 +48,43 @@ struct usb2_bus_stat {
|
||||
* The following structure defines an USB BUS. There is one USB BUS
|
||||
* for every Host or Device controller.
|
||||
*/
|
||||
struct usb2_bus {
|
||||
struct usb2_bus_stat stats_err;
|
||||
struct usb2_bus_stat stats_ok;
|
||||
struct usb_bus {
|
||||
struct usb_bus_stat stats_err;
|
||||
struct usb_bus_stat stats_ok;
|
||||
struct root_hold_token *bus_roothold;
|
||||
/*
|
||||
* There are two callback processes. One for Giant locked
|
||||
* callbacks. One for non-Giant locked callbacks. This should
|
||||
* avoid congestion and reduce response time in most cases.
|
||||
*/
|
||||
struct usb2_process giant_callback_proc;
|
||||
struct usb2_process non_giant_callback_proc;
|
||||
struct usb_process giant_callback_proc;
|
||||
struct usb_process non_giant_callback_proc;
|
||||
|
||||
/* Explore process */
|
||||
struct usb2_process explore_proc;
|
||||
struct usb_process explore_proc;
|
||||
|
||||
/* Control request process */
|
||||
struct usb2_process control_xfer_proc;
|
||||
struct usb_process control_xfer_proc;
|
||||
|
||||
struct usb2_bus_msg explore_msg[2];
|
||||
struct usb2_bus_msg detach_msg[2];
|
||||
struct usb2_bus_msg attach_msg[2];
|
||||
struct usb_bus_msg explore_msg[2];
|
||||
struct usb_bus_msg detach_msg[2];
|
||||
struct usb_bus_msg attach_msg[2];
|
||||
/*
|
||||
* This mutex protects the USB hardware:
|
||||
*/
|
||||
struct mtx bus_mtx;
|
||||
struct usb2_xfer_queue intr_q;
|
||||
struct usb2_callout power_wdog; /* power management */
|
||||
struct usb_xfer_queue intr_q;
|
||||
struct usb_callout power_wdog; /* power management */
|
||||
|
||||
device_t parent;
|
||||
device_t bdev; /* filled by HC driver */
|
||||
|
||||
#if USB_HAVE_BUSDMA
|
||||
struct usb2_dma_parent_tag dma_parent_tag[1];
|
||||
struct usb2_dma_tag dma_tags[USB_BUS_DMA_TAG_MAX];
|
||||
struct usb_dma_parent_tag dma_parent_tag[1];
|
||||
struct usb_dma_tag dma_tags[USB_BUS_DMA_TAG_MAX];
|
||||
#endif
|
||||
struct usb2_bus_methods *methods; /* filled by HC driver */
|
||||
struct usb2_device **devices;
|
||||
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];
|
||||
@ -99,8 +99,8 @@ struct usb2_bus {
|
||||
uint8_t do_probe; /* set if USB BUS should be re-probed */
|
||||
|
||||
union {
|
||||
struct usb2_hw_ep_scratch hw_ep_scratch[1];
|
||||
struct usb2_temp_setup temp_setup[1];
|
||||
struct usb_hw_ep_scratch hw_ep_scratch[1];
|
||||
struct usb_temp_setup temp_setup[1];
|
||||
uint8_t data[128];
|
||||
} scratch[1];
|
||||
};
|
||||
|
@ -42,8 +42,8 @@
|
||||
#include <dev/usb/usb_bus.h>
|
||||
|
||||
#if USB_HAVE_BUSDMA
|
||||
static void usb2_dma_tag_create(struct usb2_dma_tag *, usb2_size_t, usb2_size_t);
|
||||
static void usb2_dma_tag_destroy(struct usb2_dma_tag *);
|
||||
static void usb2_dma_tag_create(struct usb_dma_tag *, usb2_size_t, usb2_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);
|
||||
static void usb2_pc_load_mem_cb(void *, bus_dma_segment_t *, int, int);
|
||||
@ -58,10 +58,10 @@ static void usb2_pc_common_mem_cb(void *, bus_dma_segment_t *, int, int,
|
||||
* been properly initialized !
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_get_page(struct usb2_page_cache *pc, usb2_frlength_t offset,
|
||||
struct usb2_page_search *res)
|
||||
usb2_get_page(struct usb_page_cache *pc, usb2_frlength_t offset,
|
||||
struct usb_page_search *res)
|
||||
{
|
||||
struct usb2_page *page;
|
||||
struct usb_page *page;
|
||||
|
||||
#if USB_HAVE_BUSDMA
|
||||
if (pc->page_start) {
|
||||
@ -114,10 +114,10 @@ usb2_get_page(struct usb2_page_cache *pc, usb2_frlength_t offset,
|
||||
* usb2_copy_in - copy directly to DMA-able memory
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_copy_in(struct usb2_page_cache *cache, usb2_frlength_t offset,
|
||||
usb2_copy_in(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
const void *ptr, usb2_frlength_t len)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
|
||||
while (len != 0) {
|
||||
|
||||
@ -143,10 +143,10 @@ usb2_copy_in(struct usb2_page_cache *cache, usb2_frlength_t offset,
|
||||
*------------------------------------------------------------------------*/
|
||||
#if USB_HAVE_USER_IO
|
||||
int
|
||||
usb2_copy_in_user(struct usb2_page_cache *cache, usb2_frlength_t offset,
|
||||
usb2_copy_in_user(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
const void *ptr, usb2_frlength_t len)
|
||||
{
|
||||
struct usb2_page_search buf_res;
|
||||
struct usb_page_search buf_res;
|
||||
int error;
|
||||
|
||||
while (len != 0) {
|
||||
@ -173,7 +173,7 @@ usb2_copy_in_user(struct usb2_page_cache *cache, usb2_frlength_t offset,
|
||||
*------------------------------------------------------------------------*/
|
||||
#if USB_HAVE_MBUF
|
||||
struct usb2_m_copy_in_arg {
|
||||
struct usb2_page_cache *cache;
|
||||
struct usb_page_cache *cache;
|
||||
usb2_frlength_t dst_offset;
|
||||
};
|
||||
|
||||
@ -188,7 +188,7 @@ usb2_m_copy_in_cb(void *arg, void *src, uint32_t count)
|
||||
}
|
||||
|
||||
void
|
||||
usb2_m_copy_in(struct usb2_page_cache *cache, usb2_frlength_t dst_offset,
|
||||
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)
|
||||
{
|
||||
struct usb2_m_copy_in_arg arg = {cache, dst_offset};
|
||||
@ -203,10 +203,10 @@ usb2_m_copy_in(struct usb2_page_cache *cache, usb2_frlength_t dst_offset,
|
||||
*------------------------------------------------------------------------*/
|
||||
#if USB_HAVE_USER_IO
|
||||
int
|
||||
usb2_uiomove(struct usb2_page_cache *pc, struct uio *uio,
|
||||
usb2_uiomove(struct usb_page_cache *pc, struct uio *uio,
|
||||
usb2_frlength_t pc_offset, usb2_frlength_t len)
|
||||
{
|
||||
struct usb2_page_search res;
|
||||
struct usb_page_search res;
|
||||
int error = 0;
|
||||
|
||||
while (len != 0) {
|
||||
@ -236,10 +236,10 @@ usb2_uiomove(struct usb2_page_cache *pc, struct uio *uio,
|
||||
* usb2_copy_out - copy directly from DMA-able memory
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_copy_out(struct usb2_page_cache *cache, usb2_frlength_t offset,
|
||||
usb2_copy_out(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
void *ptr, usb2_frlength_t len)
|
||||
{
|
||||
struct usb2_page_search res;
|
||||
struct usb_page_search res;
|
||||
|
||||
while (len != 0) {
|
||||
|
||||
@ -265,10 +265,10 @@ usb2_copy_out(struct usb2_page_cache *cache, usb2_frlength_t offset,
|
||||
*------------------------------------------------------------------------*/
|
||||
#if USB_HAVE_USER_IO
|
||||
int
|
||||
usb2_copy_out_user(struct usb2_page_cache *cache, usb2_frlength_t offset,
|
||||
usb2_copy_out_user(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
void *ptr, usb2_frlength_t len)
|
||||
{
|
||||
struct usb2_page_search res;
|
||||
struct usb_page_search res;
|
||||
int error;
|
||||
|
||||
while (len != 0) {
|
||||
@ -294,10 +294,10 @@ usb2_copy_out_user(struct usb2_page_cache *cache, usb2_frlength_t offset,
|
||||
* usb2_bzero - zero DMA-able memory
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_bzero(struct usb2_page_cache *cache, usb2_frlength_t offset,
|
||||
usb2_bzero(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
usb2_frlength_t len)
|
||||
{
|
||||
struct usb2_page_search res;
|
||||
struct usb_page_search res;
|
||||
|
||||
while (len != 0) {
|
||||
|
||||
@ -331,7 +331,7 @@ usb2_dma_lock_cb(void *arg, bus_dma_lock_op_t op)
|
||||
* allow multi-segment mappings. Else all mappings are single-segment.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_dma_tag_create(struct usb2_dma_tag *udt,
|
||||
usb2_dma_tag_create(struct usb_dma_tag *udt,
|
||||
usb2_size_t size, usb2_size_t align)
|
||||
{
|
||||
bus_dma_tag_t tag;
|
||||
@ -362,7 +362,7 @@ usb2_dma_tag_create(struct usb2_dma_tag *udt,
|
||||
* usb2_dma_tag_free - free a DMA tag
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_dma_tag_destroy(struct usb2_dma_tag *udt)
|
||||
usb2_dma_tag_destroy(struct usb_dma_tag *udt)
|
||||
{
|
||||
bus_dma_tag_destroy(udt->tag);
|
||||
}
|
||||
@ -394,9 +394,9 @@ static void
|
||||
usb2_pc_common_mem_cb(void *arg, bus_dma_segment_t *segs,
|
||||
int nseg, int error, uint8_t isload)
|
||||
{
|
||||
struct usb2_dma_parent_tag *uptag;
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb2_page *pg;
|
||||
struct usb_dma_parent_tag *uptag;
|
||||
struct usb_page_cache *pc;
|
||||
struct usb_page *pg;
|
||||
usb2_size_t rem;
|
||||
uint8_t owned;
|
||||
|
||||
@ -459,11 +459,11 @@ usb2_pc_common_mem_cb(void *arg, bus_dma_segment_t *segs,
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
uint8_t
|
||||
usb2_pc_alloc_mem(struct usb2_page_cache *pc, struct usb2_page *pg,
|
||||
usb2_pc_alloc_mem(struct usb_page_cache *pc, struct usb_page *pg,
|
||||
usb2_size_t size, usb2_size_t align)
|
||||
{
|
||||
struct usb2_dma_parent_tag *uptag;
|
||||
struct usb2_dma_tag *utag;
|
||||
struct usb_dma_parent_tag *uptag;
|
||||
struct usb_dma_tag *utag;
|
||||
bus_dmamap_t map;
|
||||
void *ptr;
|
||||
int err;
|
||||
@ -563,7 +563,7 @@ usb2_pc_alloc_mem(struct usb2_page_cache *pc, struct usb2_page *pg,
|
||||
* This function is NULL safe.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_pc_free_mem(struct usb2_page_cache *pc)
|
||||
usb2_pc_free_mem(struct usb_page_cache *pc)
|
||||
{
|
||||
if (pc && pc->buffer) {
|
||||
|
||||
@ -583,7 +583,7 @@ usb2_pc_free_mem(struct usb2_page_cache *pc)
|
||||
* Else: Error
|
||||
*------------------------------------------------------------------------*/
|
||||
uint8_t
|
||||
usb2_pc_load_mem(struct usb2_page_cache *pc, usb2_size_t size, uint8_t sync)
|
||||
usb2_pc_load_mem(struct usb_page_cache *pc, usb2_size_t size, uint8_t sync)
|
||||
{
|
||||
/* setup page cache */
|
||||
pc->page_offset_buf = 0;
|
||||
@ -594,7 +594,7 @@ usb2_pc_load_mem(struct usb2_page_cache *pc, usb2_size_t size, uint8_t sync)
|
||||
|
||||
if (size > 0) {
|
||||
if (sync) {
|
||||
struct usb2_dma_parent_tag *uptag;
|
||||
struct usb_dma_parent_tag *uptag;
|
||||
int err;
|
||||
|
||||
uptag = pc->tag_parent;
|
||||
@ -652,7 +652,7 @@ usb2_pc_load_mem(struct usb2_page_cache *pc, usb2_size_t size, uint8_t sync)
|
||||
* usb2_pc_cpu_invalidate - invalidate CPU cache
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_pc_cpu_invalidate(struct usb2_page_cache *pc)
|
||||
usb2_pc_cpu_invalidate(struct usb_page_cache *pc)
|
||||
{
|
||||
if (pc->page_offset_end == pc->page_offset_buf) {
|
||||
/* nothing has been loaded into this page cache! */
|
||||
@ -666,7 +666,7 @@ usb2_pc_cpu_invalidate(struct usb2_page_cache *pc)
|
||||
* usb2_pc_cpu_flush - flush CPU cache
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_pc_cpu_flush(struct usb2_page_cache *pc)
|
||||
usb2_pc_cpu_flush(struct usb_page_cache *pc)
|
||||
{
|
||||
if (pc->page_offset_end == pc->page_offset_buf) {
|
||||
/* nothing has been loaded into this page cache! */
|
||||
@ -684,10 +684,10 @@ usb2_pc_cpu_flush(struct usb2_page_cache *pc)
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
uint8_t
|
||||
usb2_pc_dmamap_create(struct usb2_page_cache *pc, usb2_size_t size)
|
||||
usb2_pc_dmamap_create(struct usb_page_cache *pc, usb2_size_t size)
|
||||
{
|
||||
struct usb2_xfer_root *info;
|
||||
struct usb2_dma_tag *utag;
|
||||
struct usb_xfer_root *info;
|
||||
struct usb_dma_tag *utag;
|
||||
|
||||
/* get info */
|
||||
info = USB_DMATAG_TO_XROOT(pc->tag_parent);
|
||||
@ -719,7 +719,7 @@ usb2_pc_dmamap_create(struct usb2_page_cache *pc, usb2_size_t size)
|
||||
* This function is NULL safe.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_pc_dmamap_destroy(struct usb2_page_cache *pc)
|
||||
usb2_pc_dmamap_destroy(struct usb_page_cache *pc)
|
||||
{
|
||||
if (pc && pc->tag) {
|
||||
bus_dmamap_destroy(pc->tag, pc->map);
|
||||
@ -731,11 +731,11 @@ usb2_pc_dmamap_destroy(struct usb2_page_cache *pc)
|
||||
/*------------------------------------------------------------------------*
|
||||
* usb2_dma_tag_find - factored out code
|
||||
*------------------------------------------------------------------------*/
|
||||
struct usb2_dma_tag *
|
||||
usb2_dma_tag_find(struct usb2_dma_parent_tag *udpt,
|
||||
struct usb_dma_tag *
|
||||
usb2_dma_tag_find(struct usb_dma_parent_tag *udpt,
|
||||
usb2_size_t size, usb2_size_t align)
|
||||
{
|
||||
struct usb2_dma_tag *udt;
|
||||
struct usb_dma_tag *udt;
|
||||
uint8_t nudt;
|
||||
|
||||
USB_ASSERT(align > 0, ("Invalid parameter align = 0!\n"));
|
||||
@ -767,8 +767,8 @@ usb2_dma_tag_find(struct usb2_dma_parent_tag *udpt,
|
||||
* usb2_dma_tag_setup - initialise USB DMA tags
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_dma_tag_setup(struct usb2_dma_parent_tag *udpt,
|
||||
struct usb2_dma_tag *udt, bus_dma_tag_t dmat,
|
||||
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)
|
||||
{
|
||||
@ -803,9 +803,9 @@ usb2_dma_tag_setup(struct usb2_dma_parent_tag *udpt,
|
||||
* usb2_bus_tag_unsetup - factored out code
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_dma_tag_unsetup(struct usb2_dma_parent_tag *udpt)
|
||||
usb2_dma_tag_unsetup(struct usb_dma_parent_tag *udpt)
|
||||
{
|
||||
struct usb2_dma_tag *udt;
|
||||
struct usb_dma_tag *udt;
|
||||
uint8_t nudt;
|
||||
|
||||
udt = udpt->utag_first;
|
||||
@ -834,10 +834,10 @@ usb2_dma_tag_unsetup(struct usb2_dma_parent_tag *udpt)
|
||||
* only called when "dma_refcount" is zero.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_bdma_work_loop(struct usb2_xfer_queue *pq)
|
||||
usb2_bdma_work_loop(struct usb_xfer_queue *pq)
|
||||
{
|
||||
struct usb2_xfer_root *info;
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer_root *info;
|
||||
struct usb_xfer *xfer;
|
||||
usb2_frcount_t nframes;
|
||||
|
||||
xfer = pq->curr;
|
||||
@ -853,7 +853,7 @@ usb2_bdma_work_loop(struct usb2_xfer_queue *pq)
|
||||
return;
|
||||
}
|
||||
if (!xfer->flags_int.bdma_setup) {
|
||||
struct usb2_page *pg;
|
||||
struct usb_page *pg;
|
||||
usb2_frlength_t frlength_0;
|
||||
uint8_t isread;
|
||||
|
||||
@ -961,9 +961,9 @@ usb2_bdma_work_loop(struct usb2_xfer_queue *pq)
|
||||
* into DMA, if any.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_bdma_done_event(struct usb2_dma_parent_tag *udpt)
|
||||
usb2_bdma_done_event(struct usb_dma_parent_tag *udpt)
|
||||
{
|
||||
struct usb2_xfer_root *info;
|
||||
struct usb_xfer_root *info;
|
||||
|
||||
info = USB_DMATAG_TO_XROOT(udpt);
|
||||
|
||||
@ -984,9 +984,9 @@ usb2_bdma_done_event(struct usb2_dma_parent_tag *udpt)
|
||||
* an USB transfer is started.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_bdma_pre_sync(struct usb2_xfer *xfer)
|
||||
usb2_bdma_pre_sync(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_cache *pc;
|
||||
usb2_frcount_t nframes;
|
||||
|
||||
if (xfer->flags_int.isochronous_xfr) {
|
||||
@ -1017,9 +1017,9 @@ usb2_bdma_pre_sync(struct usb2_xfer *xfer)
|
||||
* an USB transfer is complete.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_bdma_post_sync(struct usb2_xfer *xfer)
|
||||
usb2_bdma_post_sync(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_page_cache *pc;
|
||||
struct usb_page_cache *pc;
|
||||
usb2_frcount_t nframes;
|
||||
|
||||
if (xfer->flags_int.isochronous_xfr) {
|
||||
|
@ -44,21 +44,21 @@
|
||||
|
||||
/* structure prototypes */
|
||||
|
||||
struct usb2_xfer_root;
|
||||
struct usb2_dma_parent_tag;
|
||||
struct usb2_dma_tag;
|
||||
struct usb_xfer_root;
|
||||
struct usb_dma_parent_tag;
|
||||
struct usb_dma_tag;
|
||||
|
||||
/*
|
||||
* The following typedef defines the USB DMA load done callback.
|
||||
*/
|
||||
|
||||
typedef void (usb2_dma_callback_t)(struct usb2_dma_parent_tag *udpt);
|
||||
typedef void (usb2_dma_callback_t)(struct usb_dma_parent_tag *udpt);
|
||||
|
||||
/*
|
||||
* The following structure defines physical and non kernel virtual
|
||||
* address of a memory page having size USB_PAGE_SIZE.
|
||||
*/
|
||||
struct usb2_page {
|
||||
struct usb_page {
|
||||
#if USB_HAVE_BUSDMA
|
||||
bus_size_t physaddr;
|
||||
void *buffer; /* non Kernel Virtual Address */
|
||||
@ -70,7 +70,7 @@ struct usb2_page {
|
||||
* pointer and the physical address belonging to an offset in an USB
|
||||
* page cache.
|
||||
*/
|
||||
struct usb2_page_search {
|
||||
struct usb_page_search {
|
||||
void *buffer;
|
||||
#if USB_HAVE_BUSDMA
|
||||
bus_size_t physaddr;
|
||||
@ -82,14 +82,14 @@ struct usb2_page_search {
|
||||
* The following structure is used to keep information about a DMA
|
||||
* memory allocation.
|
||||
*/
|
||||
struct usb2_page_cache {
|
||||
struct usb_page_cache {
|
||||
|
||||
#if USB_HAVE_BUSDMA
|
||||
bus_dma_tag_t tag;
|
||||
bus_dmamap_t map;
|
||||
struct usb2_page *page_start;
|
||||
struct usb_page *page_start;
|
||||
#endif
|
||||
struct usb2_dma_parent_tag *tag_parent; /* always set */
|
||||
struct usb_dma_parent_tag *tag_parent; /* always set */
|
||||
void *buffer; /* virtual buffer pointer */
|
||||
#if USB_HAVE_BUSDMA
|
||||
usb2_size_t page_offset_buf;
|
||||
@ -105,71 +105,71 @@ struct usb2_page_cache {
|
||||
* The following structure describes the parent USB DMA tag.
|
||||
*/
|
||||
#if USB_HAVE_BUSDMA
|
||||
struct usb2_dma_parent_tag {
|
||||
struct usb_dma_parent_tag {
|
||||
struct cv cv[1]; /* internal condition variable */
|
||||
bus_dma_tag_t tag; /* always set */
|
||||
|
||||
struct mtx *mtx; /* private mutex, always set */
|
||||
usb2_dma_callback_t *func; /* load complete callback function */
|
||||
struct usb2_dma_tag *utag_first;/* pointer to first USB DMA tag */
|
||||
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 */
|
||||
uint8_t utag_max; /* number of USB DMA tags */
|
||||
};
|
||||
#else
|
||||
struct usb2_dma_parent_tag {}; /* empty struct */
|
||||
struct usb_dma_parent_tag {}; /* empty struct */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following structure describes an USB DMA tag.
|
||||
*/
|
||||
#if USB_HAVE_BUSDMA
|
||||
struct usb2_dma_tag {
|
||||
struct usb2_dma_parent_tag *tag_parent;
|
||||
struct usb_dma_tag {
|
||||
struct usb_dma_parent_tag *tag_parent;
|
||||
bus_dma_tag_t tag;
|
||||
usb2_size_t align;
|
||||
usb2_size_t size;
|
||||
};
|
||||
#else
|
||||
struct usb2_dma_tag {}; /* empty struct */
|
||||
struct usb_dma_tag {}; /* empty struct */
|
||||
#endif
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
int usb2_uiomove(struct usb2_page_cache *pc, struct uio *uio,
|
||||
int usb2_uiomove(struct usb_page_cache *pc, struct uio *uio,
|
||||
usb2_frlength_t pc_offset, usb2_frlength_t len);
|
||||
struct usb2_dma_tag *usb2_dma_tag_find(struct usb2_dma_parent_tag *udpt,
|
||||
struct usb_dma_tag *usb2_dma_tag_find(struct usb_dma_parent_tag *udpt,
|
||||
usb2_size_t size, usb2_size_t align);
|
||||
uint8_t usb2_pc_alloc_mem(struct usb2_page_cache *pc, struct usb2_page *pg,
|
||||
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 usb2_page_cache *pc, usb2_size_t size);
|
||||
uint8_t usb2_pc_load_mem(struct usb2_page_cache *pc, usb2_size_t size,
|
||||
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,
|
||||
uint8_t sync);
|
||||
void usb2_bdma_done_event(struct usb2_dma_parent_tag *udpt);
|
||||
void usb2_bdma_post_sync(struct usb2_xfer *xfer);
|
||||
void usb2_bdma_pre_sync(struct usb2_xfer *xfer);
|
||||
void usb2_bdma_work_loop(struct usb2_xfer_queue *pq);
|
||||
void usb2_bzero(struct usb2_page_cache *cache, usb2_frlength_t offset,
|
||||
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 usb2_page_cache *cache, usb2_frlength_t offset,
|
||||
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 usb2_page_cache *cache, usb2_frlength_t offset,
|
||||
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 usb2_page_cache *cache, usb2_frlength_t offset,
|
||||
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 usb2_page_cache *cache, usb2_frlength_t offset,
|
||||
int usb2_copy_out_user(struct usb_page_cache *cache, usb2_frlength_t offset,
|
||||
void *ptr, usb2_frlength_t len);
|
||||
void usb2_dma_tag_setup(struct usb2_dma_parent_tag *udpt,
|
||||
struct usb2_dma_tag *udt, bus_dma_tag_t dmat, struct mtx *mtx,
|
||||
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);
|
||||
void usb2_dma_tag_unsetup(struct usb2_dma_parent_tag *udpt);
|
||||
void usb2_get_page(struct usb2_page_cache *pc, usb2_frlength_t offset,
|
||||
struct usb2_page_search *res);
|
||||
void usb2_m_copy_in(struct usb2_page_cache *cache, usb2_frlength_t dst_offset,
|
||||
void usb2_dma_tag_unsetup(struct usb_dma_parent_tag *udpt);
|
||||
void usb2_get_page(struct usb_page_cache *pc, usb2_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_pc_cpu_flush(struct usb2_page_cache *pc);
|
||||
void usb2_pc_cpu_invalidate(struct usb2_page_cache *pc);
|
||||
void usb2_pc_dmamap_destroy(struct usb2_page_cache *pc);
|
||||
void usb2_pc_free_mem(struct usb2_page_cache *pc);
|
||||
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);
|
||||
void usb2_pc_free_mem(struct usb_page_cache *pc);
|
||||
|
||||
#endif /* _USB2_BUSDMA_H_ */
|
||||
|
@ -59,14 +59,14 @@
|
||||
#define UDESCSUB_CDC_ENF 15
|
||||
#define UDESCSUB_CDC_ANF 16
|
||||
|
||||
struct usb2_cdc_header_descriptor {
|
||||
struct usb_cdc_header_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bDescriptorSubtype;
|
||||
uWord bcdCDC;
|
||||
} __packed;
|
||||
|
||||
struct usb2_cdc_cm_descriptor {
|
||||
struct usb_cdc_cm_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bDescriptorSubtype;
|
||||
@ -76,7 +76,7 @@ struct usb2_cdc_cm_descriptor {
|
||||
uByte bDataInterface;
|
||||
} __packed;
|
||||
|
||||
struct usb2_cdc_acm_descriptor {
|
||||
struct usb_cdc_acm_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bDescriptorSubtype;
|
||||
@ -87,7 +87,7 @@ struct usb2_cdc_acm_descriptor {
|
||||
#define USB_CDC_ACM_HAS_NETWORK_CONN 0x08
|
||||
} __packed;
|
||||
|
||||
struct usb2_cdc_union_descriptor {
|
||||
struct usb_cdc_union_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bDescriptorSubtype;
|
||||
@ -95,7 +95,7 @@ struct usb2_cdc_union_descriptor {
|
||||
uByte bSlaveInterface[1];
|
||||
} __packed;
|
||||
|
||||
struct usb2_cdc_ethernet_descriptor {
|
||||
struct usb_cdc_ethernet_descriptor {
|
||||
uByte bLength;
|
||||
uByte bDescriptorType;
|
||||
uByte bDescriptorSubtype;
|
||||
@ -122,7 +122,7 @@ struct usb2_cdc_ethernet_descriptor {
|
||||
#define UCDC_BREAK_ON 0xffff
|
||||
#define UCDC_BREAK_OFF 0x0000
|
||||
|
||||
struct usb2_cdc_abstract_state {
|
||||
struct usb_cdc_abstract_state {
|
||||
uWord wState;
|
||||
#define UCDC_IDLE_SETTING 0x0001
|
||||
#define UCDC_DATA_MULTIPLEXED 0x0002
|
||||
@ -130,7 +130,7 @@ struct usb2_cdc_abstract_state {
|
||||
|
||||
#define UCDC_ABSTRACT_STATE_LENGTH 2
|
||||
|
||||
struct usb2_cdc_line_state {
|
||||
struct usb_cdc_line_state {
|
||||
uDWord dwDTERate;
|
||||
uByte bCharFormat;
|
||||
#define UCDC_STOP_BIT_1 0
|
||||
@ -147,7 +147,7 @@ struct usb2_cdc_line_state {
|
||||
|
||||
#define UCDC_LINE_STATE_LENGTH 7
|
||||
|
||||
struct usb2_cdc_notification {
|
||||
struct usb_cdc_notification {
|
||||
uByte bmRequestType;
|
||||
#define UCDC_NOTIFICATION 0xa1
|
||||
uByte bNotification;
|
||||
|
@ -48,7 +48,7 @@ struct usb_linux_softc {
|
||||
LIST_ENTRY(usb_linux_softc) sc_attached_list;
|
||||
|
||||
device_t sc_fbsd_dev;
|
||||
struct usb2_device *sc_fbsd_udev;
|
||||
struct usb_device *sc_fbsd_udev;
|
||||
struct usb_interface *sc_ui;
|
||||
struct usb_driver *sc_udrv;
|
||||
};
|
||||
@ -68,13 +68,12 @@ 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 const struct usb_device_id *usb_linux_lookup_id(
|
||||
const struct usb_device_id *, struct usb2_attach_arg *);
|
||||
const struct usb_device_id *, struct usb_attach_arg *);
|
||||
static struct usb_driver *usb_linux_get_usb_driver(struct usb_linux_softc *);
|
||||
static struct usb_device *usb_linux_create_usb_device(struct usb2_device *,
|
||||
device_t);
|
||||
static int usb_linux_create_usb_device(struct usb_device *, device_t);
|
||||
static void usb_linux_cleanup_interface(struct usb_device *,
|
||||
struct usb_interface *);
|
||||
static void usb_linux_complete(struct usb2_xfer *);
|
||||
static void usb_linux_complete(struct usb_xfer *);
|
||||
static int usb_unlink_urb_sub(struct urb *, uint8_t);
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
@ -109,12 +108,12 @@ DRIVER_MODULE(usb_linux, uhub, usb_linux_driver, usb_linux_devclass, NULL, 0);
|
||||
* usb_linux_lookup_id
|
||||
*
|
||||
* This functions takes an array of "struct usb_device_id" and tries
|
||||
* to match the entries with the information in "struct usb2_attach_arg".
|
||||
* to match the entries with the information in "struct usb_attach_arg".
|
||||
* If it finds a match the matching entry will be returned.
|
||||
* Else "NULL" will be returned.
|
||||
*------------------------------------------------------------------------*/
|
||||
static const struct usb_device_id *
|
||||
usb_linux_lookup_id(const struct usb_device_id *id, struct usb2_attach_arg *uaa)
|
||||
usb_linux_lookup_id(const struct usb_device_id *id, struct usb_attach_arg *uaa)
|
||||
{
|
||||
if (id == NULL) {
|
||||
goto done;
|
||||
@ -190,7 +189,7 @@ usb_linux_lookup_id(const struct usb_device_id *id, struct usb2_attach_arg *uaa)
|
||||
static int
|
||||
usb_linux_probe(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_driver *udrv;
|
||||
int err = ENXIO;
|
||||
|
||||
@ -237,10 +236,9 @@ usb_linux_get_usb_driver(struct usb_linux_softc *sc)
|
||||
static int
|
||||
usb_linux_attach(device_t dev)
|
||||
{
|
||||
struct usb2_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_attach_arg *uaa = device_get_ivars(dev);
|
||||
struct usb_linux_softc *sc = device_get_softc(dev);
|
||||
struct usb_driver *udrv;
|
||||
struct usb_device *p_dev;
|
||||
const struct usb_device_id *id = NULL;
|
||||
|
||||
mtx_lock(&Giant);
|
||||
@ -254,24 +252,14 @@ usb_linux_attach(device_t dev)
|
||||
if (id == NULL) {
|
||||
return (ENXIO);
|
||||
}
|
||||
/*
|
||||
* Save some memory and only create the Linux compat structure when
|
||||
* needed:
|
||||
*/
|
||||
p_dev = uaa->device->linux_dev;
|
||||
if (p_dev == NULL) {
|
||||
p_dev = usb_linux_create_usb_device(uaa->device, dev);
|
||||
if (p_dev == NULL) {
|
||||
return (ENOMEM);
|
||||
}
|
||||
uaa->device->linux_dev = p_dev;
|
||||
}
|
||||
if (usb_linux_create_usb_device(uaa->device, dev) != 0)
|
||||
return (ENOMEM);
|
||||
device_set_usb2_desc(dev);
|
||||
|
||||
sc->sc_fbsd_udev = uaa->device;
|
||||
sc->sc_fbsd_dev = dev;
|
||||
sc->sc_udrv = udrv;
|
||||
sc->sc_ui = usb_ifnum_to_if(p_dev, uaa->info.bIfaceNum);
|
||||
sc->sc_ui = usb_ifnum_to_if(uaa->device, uaa->info.bIfaceNum);
|
||||
if (sc->sc_ui == NULL) {
|
||||
return (EINVAL);
|
||||
}
|
||||
@ -317,7 +305,7 @@ usb_linux_detach(device_t dev)
|
||||
* this Linux "usb_interface", hence they will most likely not be
|
||||
* needed any more.
|
||||
*/
|
||||
usb_linux_cleanup_interface(sc->sc_fbsd_udev->linux_dev, sc->sc_ui);
|
||||
usb_linux_cleanup_interface(sc->sc_fbsd_udev, sc->sc_ui);
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -371,7 +359,7 @@ static uint16_t
|
||||
usb_max_isoc_frames(struct usb_device *dev)
|
||||
{
|
||||
; /* indent fix */
|
||||
switch (usb2_get_speed(dev->bsd_udev)) {
|
||||
switch (usb2_get_speed(dev)) {
|
||||
case USB_SPEED_LOW:
|
||||
case USB_SPEED_FULL:
|
||||
return (USB_MAX_FULL_SPEED_ISOC_FRAMES);
|
||||
@ -438,7 +426,7 @@ usb_unlink_urb(struct urb *urb)
|
||||
}
|
||||
|
||||
static void
|
||||
usb_unlink_bsd(struct usb2_xfer *xfer,
|
||||
usb_unlink_bsd(struct usb_xfer *xfer,
|
||||
struct urb *urb, uint8_t drain)
|
||||
{
|
||||
if (xfer &&
|
||||
@ -510,8 +498,8 @@ usb_unlink_urb_sub(struct urb *urb, uint8_t drain)
|
||||
int
|
||||
usb_clear_halt(struct usb_device *dev, struct usb_host_endpoint *uhe)
|
||||
{
|
||||
struct usb2_config cfg[1];
|
||||
struct usb2_pipe *pipe;
|
||||
struct usb_config cfg[1];
|
||||
struct usb_pipe *pipe;
|
||||
uint8_t type;
|
||||
uint8_t addr;
|
||||
|
||||
@ -527,11 +515,11 @@ usb_clear_halt(struct usb_device *dev, struct usb_host_endpoint *uhe)
|
||||
cfg[0].endpoint = addr & UE_ADDR;
|
||||
cfg[0].direction = addr & (UE_DIR_OUT | UE_DIR_IN);
|
||||
|
||||
pipe = usb2_get_pipe(dev->bsd_udev, uhe->bsd_iface_index, cfg);
|
||||
pipe = usb2_get_pipe(dev, uhe->bsd_iface_index, cfg);
|
||||
if (pipe == NULL)
|
||||
return (-EINVAL);
|
||||
|
||||
usb2_clear_data_toggle(dev->bsd_udev, pipe);
|
||||
usb2_clear_data_toggle(dev, pipe);
|
||||
|
||||
return (usb_control_msg(dev, &dev->ep0,
|
||||
UR_CLEAR_FEATURE, UT_WRITE_ENDPOINT,
|
||||
@ -603,7 +591,7 @@ usb_control_msg(struct usb_device *dev, struct usb_host_endpoint *uhe,
|
||||
uint16_t value, uint16_t index, void *data,
|
||||
uint16_t size, usb2_timeout_t timeout)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb_device_request req;
|
||||
struct urb *urb;
|
||||
int err;
|
||||
uint16_t actlen;
|
||||
@ -630,7 +618,7 @@ usb_control_msg(struct usb_device *dev, struct usb_host_endpoint *uhe,
|
||||
* The FreeBSD USB stack supports standard control
|
||||
* transfers on control endpoint zero:
|
||||
*/
|
||||
err = usb2_do_request_flags(dev->bsd_udev,
|
||||
err = usb2_do_request_flags(dev,
|
||||
&Giant, &req, data, USB_SHORT_XFER_OK,
|
||||
&actlen, timeout);
|
||||
if (err) {
|
||||
@ -640,7 +628,7 @@ usb_control_msg(struct usb_device *dev, struct usb_host_endpoint *uhe,
|
||||
}
|
||||
return (err);
|
||||
}
|
||||
if (dev->bsd_udev->flags.usb_mode != USB_MODE_HOST) {
|
||||
if (dev->flags.usb_mode != USB_MODE_HOST) {
|
||||
/* not supported */
|
||||
return (-EINVAL);
|
||||
}
|
||||
@ -701,7 +689,7 @@ usb_set_interface(struct usb_device *dev, uint8_t iface_no, uint8_t alt_index)
|
||||
if (alt_index >= p_ui->num_altsetting)
|
||||
return (-EINVAL);
|
||||
usb_linux_cleanup_interface(dev, p_ui);
|
||||
err = -usb2_set_alt_interface_index(dev->bsd_udev,
|
||||
err = -usb2_set_alt_interface_index(dev,
|
||||
p_ui->bsd_iface_index, alt_index);
|
||||
if (err == 0) {
|
||||
p_ui->cur_altsetting = p_ui->altsetting + alt_index;
|
||||
@ -724,7 +712,7 @@ int
|
||||
usb_setup_endpoint(struct usb_device *dev,
|
||||
struct usb_host_endpoint *uhe, usb2_size_t bufsize)
|
||||
{
|
||||
struct usb2_config cfg[2];
|
||||
struct usb_config cfg[2];
|
||||
uint8_t type = uhe->desc.bmAttributes & UE_XFERTYPE;
|
||||
uint8_t addr = uhe->desc.bEndpointAddress;
|
||||
|
||||
@ -771,7 +759,7 @@ usb_setup_endpoint(struct usb_device *dev,
|
||||
|
||||
/* Allocate and setup two generic FreeBSD USB transfers */
|
||||
|
||||
if (usb2_transfer_setup(dev->bsd_udev, &uhe->bsd_iface_index,
|
||||
if (usb2_transfer_setup(dev, &uhe->bsd_iface_index,
|
||||
uhe->bsd_xfer, cfg, 2, uhe, &Giant)) {
|
||||
return (-EINVAL);
|
||||
}
|
||||
@ -791,7 +779,7 @@ usb_setup_endpoint(struct usb_device *dev,
|
||||
cfg[0].flags.proxy_buffer = 1;
|
||||
cfg[0].flags.short_xfer_ok = 1;
|
||||
|
||||
if (usb2_transfer_setup(dev->bsd_udev, &uhe->bsd_iface_index,
|
||||
if (usb2_transfer_setup(dev, &uhe->bsd_iface_index,
|
||||
uhe->bsd_xfer, cfg, 1, uhe, &Giant)) {
|
||||
return (-EINVAL);
|
||||
}
|
||||
@ -806,14 +794,13 @@ usb_setup_endpoint(struct usb_device *dev,
|
||||
* structure tree, that mimics the Linux one. The root structure
|
||||
* is returned by this function.
|
||||
*------------------------------------------------------------------------*/
|
||||
static struct usb_device *
|
||||
usb_linux_create_usb_device(struct usb2_device *udev, device_t dev)
|
||||
static int
|
||||
usb_linux_create_usb_device(struct usb_device *udev, device_t dev)
|
||||
{
|
||||
struct usb2_config_descriptor *cd = usb2_get_config_descriptor(udev);
|
||||
struct usb2_descriptor *desc;
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb2_endpoint_descriptor *ed;
|
||||
struct usb_device *p_ud = NULL;
|
||||
struct usb_config_descriptor *cd = usb2_get_config_descriptor(udev);
|
||||
struct usb_descriptor *desc;
|
||||
struct usb_interface_descriptor *id;
|
||||
struct usb_endpoint_descriptor *ed;
|
||||
struct usb_interface *p_ui = NULL;
|
||||
struct usb_host_interface *p_uhi = NULL;
|
||||
struct usb_host_endpoint *p_uhe = NULL;
|
||||
@ -887,7 +874,7 @@ usb_linux_create_usb_device(struct usb2_device *udev, device_t dev)
|
||||
p_ui->cur_altsetting = p_uhi - 1;
|
||||
p_ui->num_altsetting = 1;
|
||||
p_ui->bsd_iface_index = iface_index;
|
||||
p_ui->linux_udev = p_ud;
|
||||
p_ui->linux_udev = udev;
|
||||
p_ui++;
|
||||
}
|
||||
iface_no_curr = iface_no;
|
||||
@ -906,37 +893,26 @@ usb_linux_create_usb_device(struct usb2_device *udev, device_t dev)
|
||||
|
||||
if (pass == 0) {
|
||||
|
||||
size = ((sizeof(*p_ud) * 1) +
|
||||
(sizeof(*p_uhe) * nedesc) +
|
||||
size = (sizeof(*p_uhe) * nedesc) +
|
||||
(sizeof(*p_ui) * iface_index) +
|
||||
(sizeof(*p_uhi) * niface_total));
|
||||
(sizeof(*p_uhi) * niface_total);
|
||||
|
||||
p_ud = malloc(size, M_USBDEV, M_WAITOK | M_ZERO);
|
||||
if (p_ud == NULL) {
|
||||
goto done;
|
||||
}
|
||||
p_uhe = (void *)(p_ud + 1);
|
||||
p_uhe = malloc(size, M_USBDEV, M_WAITOK | M_ZERO);
|
||||
p_ui = (void *)(p_uhe + nedesc);
|
||||
p_uhi = (void *)(p_ui + iface_index);
|
||||
|
||||
p_ud->product = "";
|
||||
p_ud->manufacturer = "";
|
||||
p_ud->serial = "";
|
||||
p_ud->speed = usb2_get_speed(udev);
|
||||
p_ud->bsd_udev = udev;
|
||||
p_ud->bsd_iface_start = p_ui;
|
||||
p_ud->bsd_iface_end = p_ui + iface_index;
|
||||
p_ud->bsd_endpoint_start = p_uhe;
|
||||
p_ud->bsd_endpoint_end = p_uhe + nedesc;
|
||||
p_ud->devnum = device_get_unit(dev);
|
||||
bcopy(&udev->ddesc, &p_ud->descriptor,
|
||||
sizeof(p_ud->descriptor));
|
||||
bcopy(udev->default_pipe.edesc, &p_ud->ep0.desc,
|
||||
sizeof(p_ud->ep0.desc));
|
||||
udev->linux_iface_start = p_ui;
|
||||
udev->linux_iface_end = p_ui + iface_index;
|
||||
udev->linux_endpoint_start = p_uhe;
|
||||
udev->linux_endpoint_end = p_uhe + nedesc;
|
||||
udev->devnum = device_get_unit(dev);
|
||||
bcopy(&udev->ddesc, &udev->descriptor,
|
||||
sizeof(udev->descriptor));
|
||||
bcopy(udev->default_pipe.edesc, &udev->ep0.desc,
|
||||
sizeof(udev->ep0.desc));
|
||||
}
|
||||
}
|
||||
done:
|
||||
return (p_ud);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
@ -959,7 +935,7 @@ usb_alloc_urb(uint16_t iso_packets, uint16_t mem_flags)
|
||||
* FreeBSD specific magic value to ask for control transfer
|
||||
* memory allocation:
|
||||
*/
|
||||
size = sizeof(*urb) + sizeof(struct usb2_device_request) + mem_flags;
|
||||
size = sizeof(*urb) + sizeof(struct usb_device_request) + mem_flags;
|
||||
} else {
|
||||
size = sizeof(*urb) + (iso_packets * sizeof(urb->iso_frame_desc[0]));
|
||||
}
|
||||
@ -971,7 +947,7 @@ usb_alloc_urb(uint16_t iso_packets, uint16_t mem_flags)
|
||||
if (iso_packets == 0xFFFF) {
|
||||
urb->setup_packet = (void *)(urb + 1);
|
||||
urb->transfer_buffer = (void *)(urb->setup_packet +
|
||||
sizeof(struct usb2_device_request));
|
||||
sizeof(struct usb_device_request));
|
||||
} else {
|
||||
urb->number_of_packets = iso_packets;
|
||||
}
|
||||
@ -1013,8 +989,8 @@ usb_find_host_endpoint(struct usb_device *dev, uint8_t type, uint8_t ep)
|
||||
* Iterate over all the interfaces searching the selected alternate
|
||||
* setting only, and all belonging endpoints.
|
||||
*/
|
||||
for (ui = dev->bsd_iface_start;
|
||||
ui != dev->bsd_iface_end;
|
||||
for (ui = dev->linux_iface_start;
|
||||
ui != dev->linux_iface_end;
|
||||
ui++) {
|
||||
uhi = ui->cur_altsetting;
|
||||
if (uhi) {
|
||||
@ -1068,8 +1044,8 @@ usb_ifnum_to_if(struct usb_device *dev, uint8_t iface_no)
|
||||
{
|
||||
struct usb_interface *p_ui;
|
||||
|
||||
for (p_ui = dev->bsd_iface_start;
|
||||
p_ui != dev->bsd_iface_end;
|
||||
for (p_ui = dev->linux_iface_start;
|
||||
p_ui != dev->linux_iface_end;
|
||||
p_ui++) {
|
||||
if ((p_ui->num_altsetting > 0) &&
|
||||
(p_ui->altsetting->desc.bInterfaceNumber == iface_no)) {
|
||||
@ -1160,14 +1136,14 @@ usb_linux_free_device(struct usb_device *dev)
|
||||
struct usb_host_endpoint *uhe_end;
|
||||
int err;
|
||||
|
||||
uhe = dev->bsd_endpoint_start;
|
||||
uhe_end = dev->bsd_endpoint_end;
|
||||
uhe = dev->linux_endpoint_start;
|
||||
uhe_end = dev->linux_endpoint_end;
|
||||
while (uhe != uhe_end) {
|
||||
err = usb_setup_endpoint(dev, uhe, 0);
|
||||
uhe++;
|
||||
}
|
||||
err = usb_setup_endpoint(dev, &dev->ep0, 0);
|
||||
free(dev, M_USBDEV);
|
||||
free(uhe, M_USBDEV);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
@ -1285,7 +1261,7 @@ usb_linux_wait_complete(struct urb *urb)
|
||||
* usb_linux_complete
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb_linux_complete(struct usb2_xfer *xfer)
|
||||
usb_linux_complete(struct usb_xfer *xfer)
|
||||
{
|
||||
struct urb *urb;
|
||||
|
||||
@ -1305,7 +1281,7 @@ usb_linux_complete(struct usb2_xfer *xfer)
|
||||
* used.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb_linux_isoc_callback(struct usb2_xfer *xfer)
|
||||
usb_linux_isoc_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_frlength_t max_frame = xfer->max_frame_size;
|
||||
usb2_frlength_t offset;
|
||||
@ -1473,10 +1449,10 @@ usb_linux_isoc_callback(struct usb2_xfer *xfer)
|
||||
* callback is called.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb_linux_non_isoc_callback(struct usb2_xfer *xfer)
|
||||
usb_linux_non_isoc_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
enum {
|
||||
REQ_SIZE = sizeof(struct usb2_device_request)
|
||||
REQ_SIZE = sizeof(struct usb_device_request)
|
||||
};
|
||||
struct urb *urb = xfer->priv_fifo;
|
||||
struct usb_host_endpoint *uhe = xfer->priv_sc;
|
||||
|
@ -117,66 +117,6 @@ struct usb_driver {
|
||||
SYSINIT(id,SI_SUB_KLD,SI_ORDER_FIRST,usb_linux_register,p_usb_drv); \
|
||||
SYSUNINIT(id,SI_SUB_KLD,SI_ORDER_ANY,usb_linux_deregister,p_usb_drv)
|
||||
|
||||
/*
|
||||
* The following structure is the same as "usb_device_descriptor_t"
|
||||
* except that 16-bit values are "uint16_t" and not an array of "uint8_t".
|
||||
* It is used by Linux USB device drivers.
|
||||
*/
|
||||
struct usb_device_descriptor {
|
||||
uint8_t bLength;
|
||||
uint8_t bDescriptorType;
|
||||
|
||||
uint16_t bcdUSB;
|
||||
uint8_t bDeviceClass;
|
||||
uint8_t bDeviceSubClass;
|
||||
uint8_t bDeviceProtocol;
|
||||
uint8_t bMaxPacketSize0;
|
||||
uint16_t idVendor;
|
||||
uint16_t idProduct;
|
||||
uint16_t bcdDevice;
|
||||
uint8_t iManufacturer;
|
||||
uint8_t iProduct;
|
||||
uint8_t iSerialNumber;
|
||||
uint8_t bNumConfigurations;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
* The following structure is the same as
|
||||
* "usb_interface_descriptor_t". It is used by
|
||||
* Linux USB device drivers.
|
||||
*/
|
||||
struct usb_interface_descriptor {
|
||||
uint8_t bLength;
|
||||
uint8_t bDescriptorType;
|
||||
|
||||
uint8_t bInterfaceNumber;
|
||||
uint8_t bAlternateSetting;
|
||||
uint8_t bNumEndpoints;
|
||||
uint8_t bInterfaceClass;
|
||||
uint8_t bInterfaceSubClass;
|
||||
uint8_t bInterfaceProtocol;
|
||||
uint8_t iInterface;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
* The following structure is the same as "usb_endpoint_descriptor_t"
|
||||
* except that 16-bit values are "uint16_t" and not an array of "uint8_t".
|
||||
* It is used by Linux USB device drivers.
|
||||
*/
|
||||
struct usb_endpoint_descriptor {
|
||||
uint8_t bLength;
|
||||
uint8_t bDescriptorType;
|
||||
|
||||
uint8_t bEndpointAddress;
|
||||
uint8_t bmAttributes;
|
||||
uint16_t wMaxPacketSize;
|
||||
uint8_t bInterval;
|
||||
|
||||
/* extension for audio endpoints only: */
|
||||
uint8_t bRefresh;
|
||||
uint8_t bSynchAddress;
|
||||
} __packed;
|
||||
|
||||
#define USB_DT_ENDPOINT_SIZE 7
|
||||
#define USB_DT_ENDPOINT_AUDIO_SIZE 9
|
||||
|
||||
@ -305,74 +245,6 @@ struct usb_endpoint_descriptor {
|
||||
#define usb_rcvintpipe(dev,endpoint) \
|
||||
usb_find_host_endpoint(dev, PIPE_INTERRUPT, (endpoint) | USB_DIR_IN)
|
||||
|
||||
/* The following four structures makes up a tree, where we have the
|
||||
* leaf structure, "usb_host_endpoint", first, and the root structure,
|
||||
* "usb_device", last. The four structures below mirror the structure
|
||||
* of the USB descriptors belonging to an USB configuration. Please
|
||||
* refer to the USB specification for a definition of "endpoints" and
|
||||
* "interfaces".
|
||||
*/
|
||||
struct usb_host_endpoint {
|
||||
struct usb_endpoint_descriptor desc;
|
||||
|
||||
TAILQ_HEAD(, urb) bsd_urb_list;
|
||||
|
||||
struct usb2_xfer *bsd_xfer[2];
|
||||
|
||||
uint8_t *extra; /* Extra descriptors */
|
||||
|
||||
usb2_frlength_t fbsd_buf_size;
|
||||
|
||||
uint16_t extralen;
|
||||
|
||||
uint8_t bsd_iface_index;
|
||||
} __aligned(USB_HOST_ALIGN);
|
||||
|
||||
struct usb_host_interface {
|
||||
struct usb_interface_descriptor desc;
|
||||
|
||||
/* the following array has size "desc.bNumEndpoint" */
|
||||
struct usb_host_endpoint *endpoint;
|
||||
|
||||
const char *string; /* iInterface string, if present */
|
||||
uint8_t *extra; /* Extra descriptors */
|
||||
|
||||
uint16_t extralen;
|
||||
|
||||
uint8_t bsd_iface_index;
|
||||
} __aligned(USB_HOST_ALIGN);
|
||||
|
||||
struct usb_interface {
|
||||
/* array of alternate settings for this interface */
|
||||
struct usb_host_interface *altsetting;
|
||||
struct usb_host_interface *cur_altsetting;
|
||||
struct usb_device *linux_udev;
|
||||
void *bsd_priv_sc; /* device specific information */
|
||||
|
||||
uint8_t num_altsetting; /* number of alternate settings */
|
||||
uint8_t bsd_iface_index;
|
||||
} __aligned(USB_HOST_ALIGN);
|
||||
|
||||
struct usb_device {
|
||||
struct usb_device_descriptor descriptor;
|
||||
struct usb_host_endpoint ep0;
|
||||
|
||||
struct usb2_device *bsd_udev;
|
||||
struct usb_interface *bsd_iface_start;
|
||||
struct usb_interface *bsd_iface_end;
|
||||
struct usb_host_endpoint *bsd_endpoint_start;
|
||||
struct usb_host_endpoint *bsd_endpoint_end;
|
||||
|
||||
/* static strings from the device */
|
||||
const char *product; /* iProduct string, if present */
|
||||
const char *manufacturer; /* iManufacturer string, if present */
|
||||
const char *serial; /* iSerialNumber string, if present */
|
||||
|
||||
uint16_t devnum;
|
||||
|
||||
enum usb_dev_speed speed; /* USB_SPEED_XXX */
|
||||
} __aligned(USB_HOST_ALIGN);
|
||||
|
||||
/*
|
||||
* The following structure is used to extend "struct urb" when we are
|
||||
* dealing with an isochronous endpoint. It contains information about
|
||||
|
@ -33,38 +33,38 @@
|
||||
|
||||
/* structure prototypes */
|
||||
|
||||
struct usb2_bus;
|
||||
struct usb2_page;
|
||||
struct usb2_pipe;
|
||||
struct usb2_page_cache;
|
||||
struct usb2_setup_params;
|
||||
struct usb2_hw_ep_profile;
|
||||
struct usb2_fs_isoc_schedule;
|
||||
struct usb2_config_descriptor;
|
||||
struct usb2_endpoint_descriptor;
|
||||
struct usb_bus;
|
||||
struct usb_page;
|
||||
struct usb_pipe;
|
||||
struct usb_page_cache;
|
||||
struct usb_setup_params;
|
||||
struct usb_hw_ep_profile;
|
||||
struct usb_fs_isoc_schedule;
|
||||
struct usb_config_descriptor;
|
||||
struct usb_endpoint_descriptor;
|
||||
|
||||
/* typedefs */
|
||||
|
||||
typedef void (usb2_bus_mem_sub_cb_t)(struct usb2_bus *bus, struct usb2_page_cache *pc, struct usb2_page *pg, usb2_size_t size, usb2_size_t align);
|
||||
typedef void (usb2_bus_mem_cb_t)(struct usb2_bus *bus, usb2_bus_mem_sub_cb_t *scb);
|
||||
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);
|
||||
|
||||
/*
|
||||
* The following structure is used to define all the USB BUS
|
||||
* callbacks.
|
||||
*/
|
||||
struct usb2_bus_methods {
|
||||
struct usb_bus_methods {
|
||||
|
||||
/* USB Device and Host mode - Mandatory */
|
||||
|
||||
usb2_handle_request_t *roothub_exec;
|
||||
|
||||
void (*pipe_init) (struct usb2_device *, struct usb2_endpoint_descriptor *, struct usb2_pipe *);
|
||||
void (*xfer_setup) (struct usb2_setup_params *);
|
||||
void (*xfer_unsetup) (struct usb2_xfer *);
|
||||
void (*get_dma_delay) (struct usb2_bus *, uint32_t *);
|
||||
void (*device_suspend) (struct usb2_device *);
|
||||
void (*device_resume) (struct usb2_device *);
|
||||
void (*set_hw_power) (struct usb2_bus *);
|
||||
void (*pipe_init) (struct usb_device *, struct usb_endpoint_descriptor *, struct usb_pipe *);
|
||||
void (*xfer_setup) (struct usb_setup_params *);
|
||||
void (*xfer_unsetup) (struct usb_xfer *);
|
||||
void (*get_dma_delay) (struct usb_bus *, uint32_t *);
|
||||
void (*device_suspend) (struct usb_device *);
|
||||
void (*device_resume) (struct usb_device *);
|
||||
void (*set_hw_power) (struct usb_bus *);
|
||||
|
||||
/*
|
||||
* The following flag is set if one or more control transfers are
|
||||
@ -94,9 +94,9 @@ struct usb2_bus_methods {
|
||||
|
||||
/* USB Device mode only - Mandatory */
|
||||
|
||||
void (*get_hw_ep_profile) (struct usb2_device *udev, const struct usb2_hw_ep_profile **ppf, uint8_t ep_addr);
|
||||
void (*set_stall) (struct usb2_device *udev, struct usb2_xfer *xfer, struct usb2_pipe *pipe);
|
||||
void (*clear_stall) (struct usb2_device *udev, struct usb2_pipe *pipe);
|
||||
void (*get_hw_ep_profile) (struct usb_device *udev, const struct usb_hw_ep_profile **ppf, uint8_t ep_addr);
|
||||
void (*set_stall) (struct usb_device *udev, struct usb_xfer *xfer, struct usb_pipe *pipe);
|
||||
void (*clear_stall) (struct usb_device *udev, struct usb_pipe *pipe);
|
||||
|
||||
};
|
||||
|
||||
@ -104,7 +104,7 @@ struct usb2_bus_methods {
|
||||
* The following structure is used to define all the USB pipe
|
||||
* callbacks.
|
||||
*/
|
||||
struct usb2_pipe_methods {
|
||||
struct usb_pipe_methods {
|
||||
|
||||
/* Mandatory USB Device and Host mode callbacks: */
|
||||
|
||||
@ -123,7 +123,7 @@ struct usb2_pipe_methods {
|
||||
* The following structure keeps information about what a hardware USB
|
||||
* endpoint supports.
|
||||
*/
|
||||
struct usb2_hw_ep_profile {
|
||||
struct usb_hw_ep_profile {
|
||||
uint16_t max_in_frame_size; /* IN-token direction */
|
||||
uint16_t max_out_frame_size; /* OUT-token direction */
|
||||
uint8_t is_simplex:1;
|
||||
@ -140,8 +140,8 @@ struct usb2_hw_ep_profile {
|
||||
* The following structure is used when trying to allocate hardware
|
||||
* endpoints for an USB configuration in USB device side mode.
|
||||
*/
|
||||
struct usb2_hw_ep_scratch_sub {
|
||||
const struct usb2_hw_ep_profile *pf;
|
||||
struct usb_hw_ep_scratch_sub {
|
||||
const struct usb_hw_ep_profile *pf;
|
||||
uint16_t max_frame_size;
|
||||
uint8_t hw_endpoint_out;
|
||||
uint8_t hw_endpoint_in;
|
||||
@ -154,12 +154,12 @@ struct usb2_hw_ep_scratch_sub {
|
||||
* The following structure is used when trying to allocate hardware
|
||||
* endpoints for an USB configuration in USB device side mode.
|
||||
*/
|
||||
struct usb2_hw_ep_scratch {
|
||||
struct usb2_hw_ep_scratch_sub ep[USB_EP_MAX];
|
||||
struct usb2_hw_ep_scratch_sub *ep_max;
|
||||
struct usb2_config_descriptor *cd;
|
||||
struct usb2_device *udev;
|
||||
struct usb2_bus_methods *methods;
|
||||
struct usb_hw_ep_scratch {
|
||||
struct usb_hw_ep_scratch_sub ep[USB_EP_MAX];
|
||||
struct usb_hw_ep_scratch_sub *ep_max;
|
||||
struct usb_config_descriptor *cd;
|
||||
struct usb_device *udev;
|
||||
struct usb_bus_methods *methods;
|
||||
uint8_t bmOutAlloc[(USB_EP_MAX + 15) / 16];
|
||||
uint8_t bmInAlloc[(USB_EP_MAX + 15) / 16];
|
||||
};
|
||||
@ -168,7 +168,7 @@ struct usb2_hw_ep_scratch {
|
||||
* The following structure is used when generating USB descriptors
|
||||
* from USB templates.
|
||||
*/
|
||||
struct usb2_temp_setup {
|
||||
struct usb_temp_setup {
|
||||
void *buf;
|
||||
usb2_size_t size;
|
||||
enum usb_dev_speed usb_speed;
|
||||
@ -182,11 +182,11 @@ struct usb2_temp_setup {
|
||||
|
||||
/* prototypes */
|
||||
|
||||
void usb2_bus_mem_flush_all(struct usb2_bus *bus, usb2_bus_mem_cb_t *cb);
|
||||
uint8_t usb2_bus_mem_alloc_all(struct usb2_bus *bus, bus_dma_tag_t dmat, usb2_bus_mem_cb_t *cb);
|
||||
void usb2_bus_mem_free_all(struct usb2_bus *bus, usb2_bus_mem_cb_t *cb);
|
||||
uint16_t usb2_isoc_time_expand(struct usb2_bus *bus, uint16_t isoc_time_curr);
|
||||
uint16_t usb2_fs_isoc_schedule_isoc_time_expand(struct usb2_device *udev, struct usb2_fs_isoc_schedule **pp_start, struct usb2_fs_isoc_schedule **pp_end, uint16_t isoc_time);
|
||||
uint8_t usb2_fs_isoc_schedule_alloc(struct usb2_fs_isoc_schedule *fss, uint8_t *pstart, uint16_t len);
|
||||
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);
|
||||
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);
|
||||
|
||||
#endif /* _USB2_CONTROLLER_H_ */
|
||||
|
@ -256,17 +256,17 @@
|
||||
/* structure prototypes */
|
||||
|
||||
struct file;
|
||||
struct usb2_bus;
|
||||
struct usb2_device;
|
||||
struct usb2_device_request;
|
||||
struct usb2_page;
|
||||
struct usb2_page_cache;
|
||||
struct usb2_xfer;
|
||||
struct usb2_xfer_root;
|
||||
struct usb_bus;
|
||||
struct usb_device;
|
||||
struct usb_device_request;
|
||||
struct usb_page;
|
||||
struct usb_page_cache;
|
||||
struct usb_xfer;
|
||||
struct usb_xfer_root;
|
||||
|
||||
/* typedefs */
|
||||
|
||||
typedef void (usb2_callback_t)(struct usb2_xfer *);
|
||||
typedef void (usb2_callback_t)(struct usb_xfer *);
|
||||
|
||||
#ifndef USB_HAVE_USB_ERROR_T
|
||||
typedef uint8_t usb2_error_t; /* see "USB_ERR_XXX" */
|
||||
@ -296,18 +296,18 @@ typedef uint32_t usb2_ticks_t; /* system defined */
|
||||
typedef uint16_t usb2_power_mask_t; /* see "USB_HW_POWER_XXX" */
|
||||
#endif
|
||||
|
||||
typedef usb2_error_t (usb2_handle_request_t)(struct usb2_device *,
|
||||
struct usb2_device_request *, const void **, uint16_t *);
|
||||
typedef usb2_error_t (usb2_handle_request_t)(struct usb_device *,
|
||||
struct usb_device_request *, const void **, uint16_t *);
|
||||
|
||||
/* structures */
|
||||
|
||||
/*
|
||||
* Common queue structure for USB transfers.
|
||||
*/
|
||||
struct usb2_xfer_queue {
|
||||
TAILQ_HEAD(, usb2_xfer) head;
|
||||
struct usb2_xfer *curr; /* current USB transfer processed */
|
||||
void (*command) (struct usb2_xfer_queue *pq);
|
||||
struct usb_xfer_queue {
|
||||
TAILQ_HEAD(, usb_xfer) head;
|
||||
struct usb_xfer *curr; /* current USB transfer processed */
|
||||
void (*command) (struct usb_xfer_queue *pq);
|
||||
uint8_t recurse_1:1;
|
||||
uint8_t recurse_2:1;
|
||||
};
|
||||
@ -316,14 +316,14 @@ struct usb2_xfer_queue {
|
||||
* The following is a wrapper for the callout structure to ease
|
||||
* porting the code to other platforms.
|
||||
*/
|
||||
struct usb2_callout {
|
||||
struct usb_callout {
|
||||
struct callout co;
|
||||
};
|
||||
|
||||
/*
|
||||
* The following structure defines a set of USB transfer flags.
|
||||
*/
|
||||
struct usb2_xfer_flags {
|
||||
struct usb_xfer_flags {
|
||||
uint8_t force_short_xfer:1; /* force a short transmit transfer
|
||||
* last */
|
||||
uint8_t short_xfer_ok:1; /* allow short receive transfers */
|
||||
@ -345,7 +345,7 @@ struct usb2_xfer_flags {
|
||||
* The following structure defines a set of internal USB transfer
|
||||
* flags.
|
||||
*/
|
||||
struct usb2_xfer_flags_int {
|
||||
struct usb_xfer_flags_int {
|
||||
|
||||
enum usb_hc_mode usb_mode; /* shadow copy of "udev->usb_mode" */
|
||||
uint16_t control_rem; /* remainder in bytes */
|
||||
@ -385,14 +385,14 @@ struct usb2_xfer_flags_int {
|
||||
* The following structure define an USB configuration, that basically
|
||||
* is used when setting up an USB transfer.
|
||||
*/
|
||||
struct usb2_config {
|
||||
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 */
|
||||
#define USB_DEFAULT_INTERVAL 0
|
||||
usb2_timeout_t timeout; /* transfer timeout in milliseconds */
|
||||
struct usb2_xfer_flags flags; /* transfer flags */
|
||||
struct usb_xfer_flags flags; /* transfer flags */
|
||||
enum usb_hc_mode usb_mode; /* host or device mode */
|
||||
uint8_t type; /* pipe type */
|
||||
uint8_t endpoint; /* pipe number */
|
||||
@ -404,16 +404,16 @@ struct usb2_config {
|
||||
/*
|
||||
* The following structure defines an USB transfer.
|
||||
*/
|
||||
struct usb2_xfer {
|
||||
struct usb2_callout timeout_handle;
|
||||
TAILQ_ENTRY(usb2_xfer) wait_entry; /* used at various places */
|
||||
struct usb_xfer {
|
||||
struct usb_callout timeout_handle;
|
||||
TAILQ_ENTRY(usb_xfer) wait_entry; /* used at various places */
|
||||
|
||||
struct usb2_page_cache *buf_fixup; /* fixup buffer(s) */
|
||||
struct usb2_xfer_queue *wait_queue; /* pointer to queue that we
|
||||
struct usb_page_cache *buf_fixup; /* fixup buffer(s) */
|
||||
struct usb_xfer_queue *wait_queue; /* pointer to queue that we
|
||||
* are waiting on */
|
||||
struct usb2_page *dma_page_ptr;
|
||||
struct usb2_pipe *pipe; /* our USB pipe */
|
||||
struct usb2_xfer_root *xroot; /* used by HC driver */
|
||||
struct usb_page *dma_page_ptr;
|
||||
struct usb_pipe *pipe; /* our USB pipe */
|
||||
struct usb_xfer_root *xroot; /* used by HC driver */
|
||||
void *qh_start[2]; /* used by HC driver */
|
||||
void *td_start[2]; /* used by HC driver */
|
||||
void *td_transfer_first; /* used by HC driver */
|
||||
@ -423,7 +423,7 @@ struct usb2_xfer {
|
||||
void *priv_fifo; /* device driver data pointer 2 */
|
||||
void *local_buffer;
|
||||
usb2_frlength_t *frlengths;
|
||||
struct usb2_page_cache *frbuffers;
|
||||
struct usb_page_cache *frbuffers;
|
||||
usb2_callback_t *callback;
|
||||
|
||||
usb2_frlength_t max_hc_frame_size;
|
||||
@ -456,15 +456,15 @@ struct usb2_xfer {
|
||||
|
||||
usb2_error_t error;
|
||||
|
||||
struct usb2_xfer_flags flags;
|
||||
struct usb2_xfer_flags_int flags_int;
|
||||
struct usb_xfer_flags flags;
|
||||
struct usb_xfer_flags_int flags_int;
|
||||
};
|
||||
|
||||
/*
|
||||
* The following structure keeps information that is used to match
|
||||
* against an array of "usb2_device_id" elements.
|
||||
* against an array of "usb_device_id" elements.
|
||||
*/
|
||||
struct usb2_lookup_info {
|
||||
struct usb_lookup_info {
|
||||
uint16_t idVendor;
|
||||
uint16_t idProduct;
|
||||
uint16_t bcdDevice;
|
||||
@ -482,12 +482,12 @@ struct usb2_lookup_info {
|
||||
|
||||
/* Structure used by probe and attach */
|
||||
|
||||
struct usb2_attach_arg {
|
||||
struct usb2_lookup_info info;
|
||||
struct usb_attach_arg {
|
||||
struct usb_lookup_info info;
|
||||
device_t temp_dev; /* for internal use */
|
||||
const void *driver_info; /* for internal use */
|
||||
struct usb2_device *device; /* current device */
|
||||
struct usb2_interface *iface; /* current interface */
|
||||
struct usb_device *device; /* current device */
|
||||
struct usb_interface *iface; /* current interface */
|
||||
enum usb_hc_mode usb_mode; /* host or device mode */
|
||||
uint8_t port;
|
||||
uint8_t use_generic; /* hint for generic drivers */
|
||||
@ -509,43 +509,43 @@ typedef struct malloc_type *usb2_malloc_type;
|
||||
|
||||
const char *usb2_errstr(usb2_error_t error);
|
||||
const char *usb2_statestr(enum usb_dev_state state);
|
||||
struct usb2_config_descriptor *usb2_get_config_descriptor(
|
||||
struct usb2_device *udev);
|
||||
struct usb2_device_descriptor *usb2_get_device_descriptor(
|
||||
struct usb2_device *udev);
|
||||
struct usb2_interface *usb2_get_iface(struct usb2_device *udev,
|
||||
struct usb_config_descriptor *usb2_get_config_descriptor(
|
||||
struct usb_device *udev);
|
||||
struct usb_device_descriptor *usb2_get_device_descriptor(
|
||||
struct usb_device *udev);
|
||||
struct usb_interface *usb2_get_iface(struct usb_device *udev,
|
||||
uint8_t iface_index);
|
||||
struct usb2_interface_descriptor *usb2_get_interface_descriptor(
|
||||
struct usb2_interface *iface);
|
||||
uint8_t usb2_clear_stall_callback(struct usb2_xfer *xfer1,
|
||||
struct usb2_xfer *xfer2);
|
||||
uint8_t usb2_get_interface_altindex(struct usb2_interface *iface);
|
||||
usb2_error_t usb2_set_alt_interface_index(struct usb2_device *udev,
|
||||
struct usb_interface_descriptor *usb2_get_interface_descriptor(
|
||||
struct usb_interface *iface);
|
||||
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,
|
||||
uint8_t iface_index, uint8_t alt_index);
|
||||
enum usb_hc_mode usb2_get_mode(struct usb2_device *udev);
|
||||
enum usb_dev_speed usb2_get_speed(struct usb2_device *udev);
|
||||
uint32_t usb2_get_isoc_fps(struct usb2_device *udev);
|
||||
usb2_error_t usb2_transfer_setup(struct usb2_device *udev,
|
||||
const uint8_t *ifaces, struct usb2_xfer **pxfer,
|
||||
const struct usb2_config *setup_start, uint16_t n_setup,
|
||||
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,
|
||||
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 usb2_xfer *xfer, void *ptr,
|
||||
void usb2_set_frame_data(struct usb_xfer *xfer, void *ptr,
|
||||
usb2_frcount_t frindex);
|
||||
void usb2_set_frame_offset(struct usb2_xfer *xfer, usb2_frlength_t offset,
|
||||
void usb2_set_frame_offset(struct usb_xfer *xfer, usb2_frlength_t offset,
|
||||
usb2_frcount_t frindex);
|
||||
void usb2_start_hardware(struct usb2_xfer *xfer);
|
||||
void usb2_transfer_clear_stall(struct usb2_xfer *xfer);
|
||||
void usb2_transfer_drain(struct usb2_xfer *xfer);
|
||||
void usb2_transfer_set_stall(struct usb2_xfer *xfer);
|
||||
uint8_t usb2_transfer_pending(struct usb2_xfer *xfer);
|
||||
void usb2_transfer_start(struct usb2_xfer *xfer);
|
||||
void usb2_transfer_stop(struct usb2_xfer *xfer);
|
||||
void usb2_transfer_unsetup(struct usb2_xfer **pxfer, uint16_t n_setup);
|
||||
void usb2_set_parent_iface(struct usb2_device *udev, uint8_t iface_index,
|
||||
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);
|
||||
void usb2_transfer_set_stall(struct usb_xfer *xfer);
|
||||
uint8_t usb2_transfer_pending(struct usb_xfer *xfer);
|
||||
void usb2_transfer_start(struct usb_xfer *xfer);
|
||||
void usb2_transfer_stop(struct usb_xfer *xfer);
|
||||
void usb2_transfer_unsetup(struct usb_xfer **pxfer, uint16_t n_setup);
|
||||
void usb2_set_parent_iface(struct usb_device *udev, uint8_t iface_index,
|
||||
uint8_t parent_index);
|
||||
uint8_t usb2_get_bus_index(struct usb2_device *udev);
|
||||
uint8_t usb2_get_device_index(struct usb2_device *udev);
|
||||
void usb2_set_power_mode(struct usb2_device *udev, uint8_t power_mode);
|
||||
uint8_t usb2_device_attached(struct usb2_device *udev);
|
||||
uint8_t usb2_get_bus_index(struct usb_device *udev);
|
||||
uint8_t usb2_get_device_index(struct usb_device *udev);
|
||||
void usb2_set_power_mode(struct usb_device *udev, uint8_t power_mode);
|
||||
uint8_t usb2_device_attached(struct usb_device *udev);
|
||||
|
||||
#endif /* _USB2_CORE_H_ */
|
||||
|
@ -49,7 +49,7 @@ SYSCTL_INT(_hw_usb, OID_AUTO, debug, CTLFLAG_RW,
|
||||
* This function dumps information about an USB interface.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_dump_iface(struct usb2_interface *iface)
|
||||
usb2_dump_iface(struct usb_interface *iface)
|
||||
{
|
||||
printf("usb2_dump_iface: iface=%p\n", iface);
|
||||
if (iface == NULL) {
|
||||
@ -65,7 +65,7 @@ usb2_dump_iface(struct usb2_interface *iface)
|
||||
* This function dumps information about an USB device.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_dump_device(struct usb2_device *udev)
|
||||
usb2_dump_device(struct usb_device *udev)
|
||||
{
|
||||
printf("usb2_dump_device: dev=%p\n", udev);
|
||||
if (udev == NULL) {
|
||||
@ -85,9 +85,9 @@ usb2_dump_device(struct usb2_device *udev)
|
||||
* This function dumps the USB transfer that are queued up on an USB pipe.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_dump_queue(struct usb2_pipe *pipe)
|
||||
usb2_dump_queue(struct usb_pipe *pipe)
|
||||
{
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
|
||||
printf("usb2_dump_queue: pipe=%p xfer: ", pipe);
|
||||
TAILQ_FOREACH(xfer, &pipe->pipe_q.head, wait_entry) {
|
||||
@ -102,7 +102,7 @@ usb2_dump_queue(struct usb2_pipe *pipe)
|
||||
* This function dumps information about an USB pipe.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_dump_pipe(struct usb2_pipe *pipe)
|
||||
usb2_dump_pipe(struct usb_pipe *pipe)
|
||||
{
|
||||
if (pipe) {
|
||||
printf("usb2_dump_pipe: pipe=%p", pipe);
|
||||
@ -127,9 +127,9 @@ usb2_dump_pipe(struct usb2_pipe *pipe)
|
||||
* This function dumps information about an USB transfer.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_dump_xfer(struct usb2_xfer *xfer)
|
||||
usb2_dump_xfer(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_device *udev;
|
||||
struct usb_device *udev;
|
||||
printf("usb2_dump_xfer: xfer=%p\n", xfer);
|
||||
if (xfer == NULL) {
|
||||
return;
|
||||
|
@ -51,15 +51,15 @@ extern int usb2_debug;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
struct usb2_interface;
|
||||
struct usb2_device;
|
||||
struct usb2_pipe;
|
||||
struct usb2_xfer;
|
||||
struct usb_interface;
|
||||
struct usb_device;
|
||||
struct usb_pipe;
|
||||
struct usb_xfer;
|
||||
|
||||
void usb2_dump_iface(struct usb2_interface *iface);
|
||||
void usb2_dump_device(struct usb2_device *udev);
|
||||
void usb2_dump_queue(struct usb2_pipe *pipe);
|
||||
void usb2_dump_pipe(struct usb2_pipe *pipe);
|
||||
void usb2_dump_xfer(struct usb2_xfer *xfer);
|
||||
void usb2_dump_iface(struct usb_interface *iface);
|
||||
void usb2_dump_device(struct usb_device *udev);
|
||||
void usb2_dump_queue(struct usb_pipe *pipe);
|
||||
void usb2_dump_pipe(struct usb_pipe *pipe);
|
||||
void usb2_dump_xfer(struct usb_xfer *xfer);
|
||||
|
||||
#endif /* _USB2_DEBUG_H_ */
|
||||
|
@ -73,24 +73,24 @@ SYSCTL_INT(_hw_usb_dev, OID_AUTO, debug, CTLFLAG_RW,
|
||||
|
||||
/* prototypes */
|
||||
|
||||
static int usb2_fifo_open(struct usb2_cdev_privdata *,
|
||||
struct usb2_fifo *, int);
|
||||
static void usb2_fifo_close(struct usb2_fifo *, int);
|
||||
static int usb2_fifo_open(struct usb_cdev_privdata *,
|
||||
struct usb_fifo *, int);
|
||||
static void usb2_fifo_close(struct usb_fifo *, int);
|
||||
static void usb2_dev_init(void *);
|
||||
static void usb2_dev_init_post(void *);
|
||||
static void usb2_dev_uninit(void *);
|
||||
static int usb2_fifo_uiomove(struct usb2_fifo *, void *, int,
|
||||
static int usb2_fifo_uiomove(struct usb_fifo *, void *, int,
|
||||
struct uio *);
|
||||
static void usb2_fifo_check_methods(struct usb2_fifo_methods *);
|
||||
static struct usb2_fifo *usb2_fifo_alloc(void);
|
||||
static struct usb2_pipe *usb2_dev_get_pipe(struct usb2_device *, uint8_t,
|
||||
static void usb2_fifo_check_methods(struct usb_fifo_methods *);
|
||||
static struct usb_fifo *usb2_fifo_alloc(void);
|
||||
static struct usb_pipe *usb2_dev_get_pipe(struct usb_device *, uint8_t,
|
||||
uint8_t);
|
||||
static void usb2_loc_fill(struct usb2_fs_privdata *,
|
||||
struct usb2_cdev_privdata *);
|
||||
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 usb2_cdev_privdata *, int);
|
||||
static usb2_error_t usb2_usb_ref_device(struct usb2_cdev_privdata *);
|
||||
static void usb2_unref_device(struct usb2_cdev_privdata *);
|
||||
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 void usb2_unref_device(struct usb_cdev_privdata *);
|
||||
|
||||
static d_open_t usb2_open;
|
||||
static d_ioctl_t usb2_ioctl;
|
||||
@ -126,7 +126,7 @@ struct cdevsw usb2_static_devsw = {
|
||||
.d_name = "usb"
|
||||
};
|
||||
|
||||
static TAILQ_HEAD(, usb2_symlink) usb2_sym_head;
|
||||
static TAILQ_HEAD(, usb_symlink) usb2_sym_head;
|
||||
static struct sx usb2_sym_lock;
|
||||
|
||||
struct mtx usb2_ref_lock;
|
||||
@ -134,11 +134,11 @@ struct mtx usb2_ref_lock;
|
||||
/*------------------------------------------------------------------------*
|
||||
* usb2_loc_fill
|
||||
*
|
||||
* This is used to fill out a usb2_cdev_privdata structure based on the
|
||||
* device's address as contained in usb2_fs_privdata.
|
||||
* This is used to fill out a usb_cdev_privdata structure based on the
|
||||
* device's address as contained in usb_fs_privdata.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_loc_fill(struct usb2_fs_privdata* pd, struct usb2_cdev_privdata *cpd)
|
||||
usb2_loc_fill(struct usb_fs_privdata* pd, struct usb_cdev_privdata *cpd)
|
||||
{
|
||||
cpd->bus_index = pd->bus_index;
|
||||
cpd->dev_index = pd->dev_index;
|
||||
@ -158,10 +158,10 @@ usb2_loc_fill(struct usb2_fs_privdata* pd, struct usb2_cdev_privdata *cpd)
|
||||
* Else: Failure.
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb2_ref_device(struct usb2_cdev_privdata* cpd, int need_uref)
|
||||
usb2_ref_device(struct usb_cdev_privdata* cpd, int need_uref)
|
||||
{
|
||||
struct usb2_fifo **ppf;
|
||||
struct usb2_fifo *f;
|
||||
struct usb_fifo **ppf;
|
||||
struct usb_fifo *f;
|
||||
|
||||
DPRINTFN(2, "usb2_ref_device, cpd=%p need uref=%d\n", cpd, need_uref);
|
||||
|
||||
@ -287,7 +287,7 @@ usb2_ref_device(struct usb2_cdev_privdata* cpd, int need_uref)
|
||||
* Else: Failure.
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
usb2_usb_ref_device(struct usb2_cdev_privdata *cpd)
|
||||
usb2_usb_ref_device(struct usb_cdev_privdata *cpd)
|
||||
{
|
||||
/*
|
||||
* Check if we already got an USB reference on this location:
|
||||
@ -311,7 +311,7 @@ usb2_usb_ref_device(struct usb2_cdev_privdata *cpd)
|
||||
* given USB device.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_unref_device(struct usb2_cdev_privdata *cpd)
|
||||
usb2_unref_device(struct usb_cdev_privdata *cpd)
|
||||
{
|
||||
if (cpd->is_uref) {
|
||||
mtx_unlock(&Giant); /* XXX */
|
||||
@ -339,10 +339,10 @@ usb2_unref_device(struct usb2_cdev_privdata *cpd)
|
||||
mtx_unlock(&usb2_ref_lock);
|
||||
}
|
||||
|
||||
static struct usb2_fifo *
|
||||
static struct usb_fifo *
|
||||
usb2_fifo_alloc(void)
|
||||
{
|
||||
struct usb2_fifo *f;
|
||||
struct usb_fifo *f;
|
||||
|
||||
f = malloc(sizeof(*f), M_USBDEV, M_WAITOK | M_ZERO);
|
||||
if (f) {
|
||||
@ -357,11 +357,11 @@ usb2_fifo_alloc(void)
|
||||
* usb2_fifo_create
|
||||
*------------------------------------------------------------------------*/
|
||||
static int
|
||||
usb2_fifo_create(struct usb2_cdev_privdata *cpd)
|
||||
usb2_fifo_create(struct usb_cdev_privdata *cpd)
|
||||
{
|
||||
struct usb2_device *udev = cpd->udev;
|
||||
struct usb2_fifo *f;
|
||||
struct usb2_pipe *pipe;
|
||||
struct usb_device *udev = cpd->udev;
|
||||
struct usb_fifo *f;
|
||||
struct usb_pipe *pipe;
|
||||
uint8_t n;
|
||||
uint8_t is_tx;
|
||||
uint8_t is_rx;
|
||||
@ -531,7 +531,7 @@ usb2_fifo_create(struct usb2_cdev_privdata *cpd)
|
||||
}
|
||||
|
||||
void
|
||||
usb2_fifo_free(struct usb2_fifo *f)
|
||||
usb2_fifo_free(struct usb_fifo *f)
|
||||
{
|
||||
uint8_t n;
|
||||
|
||||
@ -587,10 +587,10 @@ usb2_fifo_free(struct usb2_fifo *f)
|
||||
free(f, M_USBDEV);
|
||||
}
|
||||
|
||||
static struct usb2_pipe *
|
||||
usb2_dev_get_pipe(struct usb2_device *udev, uint8_t ep_index, uint8_t dir)
|
||||
static struct usb_pipe *
|
||||
usb2_dev_get_pipe(struct usb_device *udev, uint8_t ep_index, uint8_t dir)
|
||||
{
|
||||
struct usb2_pipe *pipe;
|
||||
struct usb_pipe *pipe;
|
||||
uint8_t ep_dir;
|
||||
|
||||
if (ep_index == 0) {
|
||||
@ -631,8 +631,8 @@ usb2_dev_get_pipe(struct usb2_device *udev, uint8_t ep_index, uint8_t dir)
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static int
|
||||
usb2_fifo_open(struct usb2_cdev_privdata *cpd,
|
||||
struct usb2_fifo *f, int fflags)
|
||||
usb2_fifo_open(struct usb_cdev_privdata *cpd,
|
||||
struct usb_fifo *f, int fflags)
|
||||
{
|
||||
int err;
|
||||
|
||||
@ -703,9 +703,9 @@ usb2_fifo_open(struct usb2_cdev_privdata *cpd,
|
||||
* usb2_fifo_reset
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_fifo_reset(struct usb2_fifo *f)
|
||||
usb2_fifo_reset(struct usb_fifo *f)
|
||||
{
|
||||
struct usb2_mbuf *m;
|
||||
struct usb_mbuf *m;
|
||||
|
||||
if (f == NULL) {
|
||||
return;
|
||||
@ -724,7 +724,7 @@ usb2_fifo_reset(struct usb2_fifo *f)
|
||||
* usb2_fifo_close
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_fifo_close(struct usb2_fifo *f, int fflags)
|
||||
usb2_fifo_close(struct usb_fifo *f, int fflags)
|
||||
{
|
||||
int err;
|
||||
|
||||
@ -805,8 +805,8 @@ usb2_fifo_close(struct usb2_fifo *f, int fflags)
|
||||
static int
|
||||
usb2_open(struct cdev *dev, int fflags, int devtype, struct thread *td)
|
||||
{
|
||||
struct usb2_fs_privdata* pd = (struct usb2_fs_privdata*)dev->si_drv1;
|
||||
struct usb2_cdev_privdata *cpd;
|
||||
struct usb_fs_privdata* pd = (struct usb_fs_privdata*)dev->si_drv1;
|
||||
struct usb_cdev_privdata *cpd;
|
||||
int err, ep;
|
||||
|
||||
DPRINTFN(2, "%s fflags=0x%08x\n", dev->si_name, fflags);
|
||||
@ -872,7 +872,7 @@ usb2_open(struct cdev *dev, int fflags, int devtype, struct thread *td)
|
||||
static void
|
||||
usb2_close(void *arg)
|
||||
{
|
||||
struct usb2_cdev_privdata *cpd = arg;
|
||||
struct usb_cdev_privdata *cpd = arg;
|
||||
int err;
|
||||
|
||||
DPRINTFN(2, "cpd=%p\n", cpd);
|
||||
@ -938,7 +938,7 @@ usb2_dev_uninit(void *arg)
|
||||
SYSUNINIT(usb2_dev_uninit, SI_SUB_KICK_SCHEDULER, SI_ORDER_ANY, usb2_dev_uninit, NULL);
|
||||
|
||||
static int
|
||||
usb2_ioctl_f_sub(struct usb2_fifo *f, u_long cmd, void *addr,
|
||||
usb2_ioctl_f_sub(struct usb_fifo *f, u_long cmd, void *addr,
|
||||
struct thread *td)
|
||||
{
|
||||
int error = 0;
|
||||
@ -988,8 +988,8 @@ usb2_ioctl_f_sub(struct usb2_fifo *f, u_long cmd, void *addr,
|
||||
static int
|
||||
usb2_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int fflag, struct thread* td)
|
||||
{
|
||||
struct usb2_cdev_privdata* cpd;
|
||||
struct usb2_fifo *f;
|
||||
struct usb_cdev_privdata* cpd;
|
||||
struct usb_fifo *f;
|
||||
int fflags;
|
||||
int err;
|
||||
|
||||
@ -1046,9 +1046,9 @@ usb2_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int fflag, struct thread*
|
||||
static int
|
||||
usb2_poll(struct cdev* dev, int events, struct thread* td)
|
||||
{
|
||||
struct usb2_cdev_privdata* cpd;
|
||||
struct usb2_fifo *f;
|
||||
struct usb2_mbuf *m;
|
||||
struct usb_cdev_privdata* cpd;
|
||||
struct usb_fifo *f;
|
||||
struct usb_mbuf *m;
|
||||
int fflags, revents;
|
||||
|
||||
if (devfs_get_cdevpriv((void **)&cpd) != 0 ||
|
||||
@ -1150,9 +1150,9 @@ usb2_poll(struct cdev* dev, int events, struct thread* td)
|
||||
static int
|
||||
usb2_read(struct cdev *dev, struct uio *uio, int ioflag)
|
||||
{
|
||||
struct usb2_cdev_privdata* cpd;
|
||||
struct usb2_fifo *f;
|
||||
struct usb2_mbuf *m;
|
||||
struct usb_cdev_privdata* cpd;
|
||||
struct usb_fifo *f;
|
||||
struct usb_mbuf *m;
|
||||
int fflags;
|
||||
int resid;
|
||||
int io_len;
|
||||
@ -1271,9 +1271,9 @@ usb2_read(struct cdev *dev, struct uio *uio, int ioflag)
|
||||
static int
|
||||
usb2_write(struct cdev *dev, struct uio *uio, int ioflag)
|
||||
{
|
||||
struct usb2_cdev_privdata* cpd;
|
||||
struct usb2_fifo *f;
|
||||
struct usb2_mbuf *m;
|
||||
struct usb_cdev_privdata* cpd;
|
||||
struct usb_fifo *f;
|
||||
struct usb_mbuf *m;
|
||||
int fflags;
|
||||
int resid;
|
||||
int io_len;
|
||||
@ -1386,7 +1386,7 @@ usb2_static_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
|
||||
struct thread *td)
|
||||
{
|
||||
union {
|
||||
struct usb2_read_dir *urd;
|
||||
struct usb_read_dir *urd;
|
||||
void* data;
|
||||
} u;
|
||||
int err = ENOTTY;
|
||||
@ -1417,7 +1417,7 @@ usb2_static_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
|
||||
}
|
||||
|
||||
static int
|
||||
usb2_fifo_uiomove(struct usb2_fifo *f, void *cp,
|
||||
usb2_fifo_uiomove(struct usb_fifo *f, void *cp,
|
||||
int n, struct uio *uio)
|
||||
{
|
||||
int error;
|
||||
@ -1436,7 +1436,7 @@ usb2_fifo_uiomove(struct usb2_fifo *f, void *cp,
|
||||
}
|
||||
|
||||
int
|
||||
usb2_fifo_wait(struct usb2_fifo *f)
|
||||
usb2_fifo_wait(struct usb_fifo *f)
|
||||
{
|
||||
int err;
|
||||
|
||||
@ -1458,7 +1458,7 @@ usb2_fifo_wait(struct usb2_fifo *f)
|
||||
}
|
||||
|
||||
void
|
||||
usb2_fifo_signal(struct usb2_fifo *f)
|
||||
usb2_fifo_signal(struct usb_fifo *f)
|
||||
{
|
||||
if (f->flag_sleeping) {
|
||||
f->flag_sleeping = 0;
|
||||
@ -1467,7 +1467,7 @@ usb2_fifo_signal(struct usb2_fifo *f)
|
||||
}
|
||||
|
||||
void
|
||||
usb2_fifo_wakeup(struct usb2_fifo *f)
|
||||
usb2_fifo_wakeup(struct usb_fifo *f)
|
||||
{
|
||||
usb2_fifo_signal(f);
|
||||
|
||||
@ -1483,31 +1483,31 @@ usb2_fifo_wakeup(struct usb2_fifo *f)
|
||||
}
|
||||
|
||||
static int
|
||||
usb2_fifo_dummy_open(struct usb2_fifo *fifo, int fflags)
|
||||
usb2_fifo_dummy_open(struct usb_fifo *fifo, int fflags)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_fifo_dummy_close(struct usb2_fifo *fifo, int fflags)
|
||||
usb2_fifo_dummy_close(struct usb_fifo *fifo, int fflags)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static int
|
||||
usb2_fifo_dummy_ioctl(struct usb2_fifo *fifo, u_long cmd, void *addr, int fflags)
|
||||
usb2_fifo_dummy_ioctl(struct usb_fifo *fifo, u_long cmd, void *addr, int fflags)
|
||||
{
|
||||
return (ENOIOCTL);
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_fifo_dummy_cmd(struct usb2_fifo *fifo)
|
||||
usb2_fifo_dummy_cmd(struct usb_fifo *fifo)
|
||||
{
|
||||
fifo->flag_flushing = 0; /* not flushing */
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_fifo_check_methods(struct usb2_fifo_methods *pm)
|
||||
usb2_fifo_check_methods(struct usb_fifo_methods *pm)
|
||||
{
|
||||
/* check that all callback functions are OK */
|
||||
|
||||
@ -1546,16 +1546,16 @@ usb2_fifo_check_methods(struct usb2_fifo_methods *pm)
|
||||
* Else: Failure.
|
||||
*------------------------------------------------------------------------*/
|
||||
int
|
||||
usb2_fifo_attach(struct usb2_device *udev, void *priv_sc,
|
||||
struct mtx *priv_mtx, struct usb2_fifo_methods *pm,
|
||||
struct usb2_fifo_sc *f_sc, uint16_t unit, uint16_t subunit,
|
||||
usb2_fifo_attach(struct usb_device *udev, void *priv_sc,
|
||||
struct mtx *priv_mtx, struct usb_fifo_methods *pm,
|
||||
struct usb_fifo_sc *f_sc, uint16_t unit, uint16_t subunit,
|
||||
uint8_t iface_index, uid_t uid, gid_t gid, int mode)
|
||||
{
|
||||
struct usb2_fifo *f_tx;
|
||||
struct usb2_fifo *f_rx;
|
||||
struct usb_fifo *f_tx;
|
||||
struct usb_fifo *f_rx;
|
||||
char devname[32];
|
||||
uint8_t n;
|
||||
struct usb2_fs_privdata* pd;
|
||||
struct usb_fs_privdata* pd;
|
||||
|
||||
f_sc->fp[USB_FIFO_TX] = NULL;
|
||||
f_sc->fp[USB_FIFO_RX] = NULL;
|
||||
@ -1657,7 +1657,7 @@ usb2_fifo_attach(struct usb2_device *udev, void *priv_sc,
|
||||
* Initialize device private data - this is used to find the
|
||||
* actual USB device itself.
|
||||
*/
|
||||
pd = malloc(sizeof(struct usb2_fs_privdata), M_USBDEV, M_WAITOK | M_ZERO);
|
||||
pd = malloc(sizeof(struct usb_fs_privdata), M_USBDEV, M_WAITOK | M_ZERO);
|
||||
pd->bus_index = device_get_unit(udev->bus->bdev);
|
||||
pd->dev_index = udev->device_index;
|
||||
pd->ep_addr = -1; /* not an endpoint */
|
||||
@ -1683,7 +1683,7 @@ usb2_fifo_attach(struct usb2_device *udev, void *priv_sc,
|
||||
* Else failure
|
||||
*------------------------------------------------------------------------*/
|
||||
int
|
||||
usb2_fifo_alloc_buffer(struct usb2_fifo *f, usb2_size_t bufsize,
|
||||
usb2_fifo_alloc_buffer(struct usb_fifo *f, usb2_size_t bufsize,
|
||||
uint16_t nbuf)
|
||||
{
|
||||
usb2_fifo_free_buffer(f);
|
||||
@ -1708,7 +1708,7 @@ usb2_fifo_alloc_buffer(struct usb2_fifo *f, usb2_size_t bufsize,
|
||||
* function can be called multiple times in a row.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_fifo_free_buffer(struct usb2_fifo *f)
|
||||
usb2_fifo_free_buffer(struct usb_fifo *f)
|
||||
{
|
||||
if (f->queue_data) {
|
||||
/* free old buffer */
|
||||
@ -1728,7 +1728,7 @@ usb2_fifo_cleanup(void* ptr)
|
||||
}
|
||||
|
||||
void
|
||||
usb2_fifo_detach(struct usb2_fifo_sc *f_sc)
|
||||
usb2_fifo_detach(struct usb_fifo_sc *f_sc)
|
||||
{
|
||||
if (f_sc == NULL) {
|
||||
return;
|
||||
@ -1749,9 +1749,9 @@ usb2_fifo_detach(struct usb2_fifo_sc *f_sc)
|
||||
}
|
||||
|
||||
usb2_size_t
|
||||
usb2_fifo_put_bytes_max(struct usb2_fifo *f)
|
||||
usb2_fifo_put_bytes_max(struct usb_fifo *f)
|
||||
{
|
||||
struct usb2_mbuf *m;
|
||||
struct usb_mbuf *m;
|
||||
usb2_size_t len;
|
||||
|
||||
USB_IF_POLL(&f->free_q, m);
|
||||
@ -1772,10 +1772,10 @@ usb2_fifo_put_bytes_max(struct usb2_fifo *f)
|
||||
* 1 - set last packet flag to enforce framing
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_fifo_put_data(struct usb2_fifo *f, struct usb2_page_cache *pc,
|
||||
usb2_fifo_put_data(struct usb_fifo *f, struct usb_page_cache *pc,
|
||||
usb2_frlength_t offset, usb2_frlength_t len, uint8_t what)
|
||||
{
|
||||
struct usb2_mbuf *m;
|
||||
struct usb_mbuf *m;
|
||||
usb2_frlength_t io_len;
|
||||
|
||||
while (len || (what == 1)) {
|
||||
@ -1810,10 +1810,10 @@ usb2_fifo_put_data(struct usb2_fifo *f, struct usb2_page_cache *pc,
|
||||
}
|
||||
|
||||
void
|
||||
usb2_fifo_put_data_linear(struct usb2_fifo *f, void *ptr,
|
||||
usb2_fifo_put_data_linear(struct usb_fifo *f, void *ptr,
|
||||
usb2_size_t len, uint8_t what)
|
||||
{
|
||||
struct usb2_mbuf *m;
|
||||
struct usb_mbuf *m;
|
||||
usb2_size_t io_len;
|
||||
|
||||
while (len || (what == 1)) {
|
||||
@ -1848,9 +1848,9 @@ usb2_fifo_put_data_linear(struct usb2_fifo *f, void *ptr,
|
||||
}
|
||||
|
||||
uint8_t
|
||||
usb2_fifo_put_data_buffer(struct usb2_fifo *f, void *ptr, usb2_size_t len)
|
||||
usb2_fifo_put_data_buffer(struct usb_fifo *f, void *ptr, usb2_size_t len)
|
||||
{
|
||||
struct usb2_mbuf *m;
|
||||
struct usb_mbuf *m;
|
||||
|
||||
USB_IF_DEQUEUE(&f->free_q, m);
|
||||
|
||||
@ -1865,7 +1865,7 @@ usb2_fifo_put_data_buffer(struct usb2_fifo *f, void *ptr, usb2_size_t len)
|
||||
}
|
||||
|
||||
void
|
||||
usb2_fifo_put_data_error(struct usb2_fifo *f)
|
||||
usb2_fifo_put_data_error(struct usb_fifo *f)
|
||||
{
|
||||
f->flag_iserror = 1;
|
||||
usb2_fifo_wakeup(f);
|
||||
@ -1876,18 +1876,18 @@ usb2_fifo_put_data_error(struct usb2_fifo *f)
|
||||
*
|
||||
* what:
|
||||
* 0 - normal operation
|
||||
* 1 - only get one "usb2_mbuf"
|
||||
* 1 - only get one "usb_mbuf"
|
||||
*
|
||||
* returns:
|
||||
* 0 - no more data
|
||||
* 1 - data in buffer
|
||||
*------------------------------------------------------------------------*/
|
||||
uint8_t
|
||||
usb2_fifo_get_data(struct usb2_fifo *f, struct usb2_page_cache *pc,
|
||||
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,
|
||||
uint8_t what)
|
||||
{
|
||||
struct usb2_mbuf *m;
|
||||
struct usb_mbuf *m;
|
||||
usb2_frlength_t io_len;
|
||||
uint8_t tr_data = 0;
|
||||
|
||||
@ -1949,10 +1949,10 @@ usb2_fifo_get_data(struct usb2_fifo *f, struct usb2_page_cache *pc,
|
||||
}
|
||||
|
||||
uint8_t
|
||||
usb2_fifo_get_data_linear(struct usb2_fifo *f, void *ptr,
|
||||
usb2_fifo_get_data_linear(struct usb_fifo *f, void *ptr,
|
||||
usb2_size_t len, usb2_size_t *actlen, uint8_t what)
|
||||
{
|
||||
struct usb2_mbuf *m;
|
||||
struct usb_mbuf *m;
|
||||
usb2_size_t io_len;
|
||||
uint8_t tr_data = 0;
|
||||
|
||||
@ -2014,9 +2014,9 @@ usb2_fifo_get_data_linear(struct usb2_fifo *f, void *ptr,
|
||||
}
|
||||
|
||||
uint8_t
|
||||
usb2_fifo_get_data_buffer(struct usb2_fifo *f, void **pptr, usb2_size_t *plen)
|
||||
usb2_fifo_get_data_buffer(struct usb_fifo *f, void **pptr, usb2_size_t *plen)
|
||||
{
|
||||
struct usb2_mbuf *m;
|
||||
struct usb_mbuf *m;
|
||||
|
||||
USB_IF_POLL(&f->used_q, m);
|
||||
|
||||
@ -2030,7 +2030,7 @@ usb2_fifo_get_data_buffer(struct usb2_fifo *f, void **pptr, usb2_size_t *plen)
|
||||
}
|
||||
|
||||
void
|
||||
usb2_fifo_get_data_error(struct usb2_fifo *f)
|
||||
usb2_fifo_get_data_error(struct usb_fifo *f)
|
||||
{
|
||||
f->flag_iserror = 1;
|
||||
usb2_fifo_wakeup(f);
|
||||
@ -2043,10 +2043,10 @@ usb2_fifo_get_data_error(struct usb2_fifo *f)
|
||||
* NULL: Failure
|
||||
* Else: Pointer to symlink entry
|
||||
*------------------------------------------------------------------------*/
|
||||
struct usb2_symlink *
|
||||
struct usb_symlink *
|
||||
usb2_alloc_symlink(const char *target)
|
||||
{
|
||||
struct usb2_symlink *ps;
|
||||
struct usb_symlink *ps;
|
||||
|
||||
ps = malloc(sizeof(*ps), M_USBDEV, M_WAITOK);
|
||||
if (ps == NULL) {
|
||||
@ -2068,7 +2068,7 @@ usb2_alloc_symlink(const char *target)
|
||||
* usb2_free_symlink
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_free_symlink(struct usb2_symlink *ps)
|
||||
usb2_free_symlink(struct usb_symlink *ps)
|
||||
{
|
||||
if (ps == NULL) {
|
||||
return;
|
||||
@ -2090,7 +2090,7 @@ usb2_free_symlink(struct usb2_symlink *ps)
|
||||
int
|
||||
usb2_read_symlink(uint8_t *user_ptr, uint32_t startentry, uint32_t user_len)
|
||||
{
|
||||
struct usb2_symlink *ps;
|
||||
struct usb_symlink *ps;
|
||||
uint32_t temp;
|
||||
uint32_t delta = 0;
|
||||
uint8_t len;
|
||||
@ -2182,7 +2182,7 @@ usb2_read_symlink(uint8_t *user_ptr, uint32_t startentry, uint32_t user_len)
|
||||
}
|
||||
|
||||
void
|
||||
usb2_fifo_set_close_zlp(struct usb2_fifo *f, uint8_t onoff)
|
||||
usb2_fifo_set_close_zlp(struct usb_fifo *f, uint8_t onoff)
|
||||
{
|
||||
if (f == NULL)
|
||||
return;
|
||||
|
@ -38,17 +38,17 @@
|
||||
#define USB_FIFO_TX 0
|
||||
#define USB_FIFO_RX 1
|
||||
|
||||
struct usb2_fifo;
|
||||
struct usb2_mbuf;
|
||||
struct usb_fifo;
|
||||
struct usb_mbuf;
|
||||
|
||||
typedef int (usb2_fifo_open_t)(struct usb2_fifo *fifo, int fflags);
|
||||
typedef void (usb2_fifo_close_t)(struct usb2_fifo *fifo, int fflags);
|
||||
typedef int (usb2_fifo_ioctl_t)(struct usb2_fifo *fifo, u_long cmd, void *addr, int fflags);
|
||||
typedef void (usb2_fifo_cmd_t)(struct usb2_fifo *fifo);
|
||||
typedef void (usb2_fifo_filter_t)(struct usb2_fifo *fifo, struct usb2_mbuf *m);
|
||||
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);
|
||||
|
||||
struct usb2_symlink {
|
||||
TAILQ_ENTRY(usb2_symlink) sym_entry;
|
||||
struct usb_symlink {
|
||||
TAILQ_ENTRY(usb_symlink) sym_entry;
|
||||
char src_path[32]; /* Source path - including terminating
|
||||
* zero */
|
||||
char dst_path[32]; /* Destination path - including
|
||||
@ -62,7 +62,7 @@ struct usb2_symlink {
|
||||
* "usb2_fifo_cmd_t" and "usb2_fifo_filter_t" functions are called
|
||||
* locked. The others are called unlocked.
|
||||
*/
|
||||
struct usb2_fifo_methods {
|
||||
struct usb_fifo_methods {
|
||||
usb2_fifo_open_t *f_open;
|
||||
usb2_fifo_close_t *f_close;
|
||||
usb2_fifo_ioctl_t *f_ioctl;
|
||||
@ -84,12 +84,12 @@ struct usb2_fifo_methods {
|
||||
/*
|
||||
* Private per-device information.
|
||||
*/
|
||||
struct usb2_cdev_privdata {
|
||||
struct usb2_bus *bus;
|
||||
struct usb2_device *udev;
|
||||
struct usb2_interface *iface;
|
||||
struct usb2_fifo *rxfifo;
|
||||
struct usb2_fifo *txfifo;
|
||||
struct usb_cdev_privdata {
|
||||
struct usb_bus *bus;
|
||||
struct usb_device *udev;
|
||||
struct usb_interface *iface;
|
||||
struct usb_fifo *rxfifo;
|
||||
struct usb_fifo *txfifo;
|
||||
int bus_index; /* bus index */
|
||||
int dev_index; /* device index */
|
||||
int ep_addr; /* endpoint address */
|
||||
@ -101,7 +101,7 @@ struct usb2_cdev_privdata {
|
||||
uint8_t is_usbfs; /* USB-FS is active */
|
||||
};
|
||||
|
||||
struct usb2_fs_privdata {
|
||||
struct usb_fs_privdata {
|
||||
int bus_index;
|
||||
int dev_index;
|
||||
int ep_addr;
|
||||
@ -109,29 +109,29 @@ struct usb2_fs_privdata {
|
||||
int fifo_index;
|
||||
struct cdev *cdev;
|
||||
|
||||
LIST_ENTRY(usb2_fs_privdata) pd_next;
|
||||
LIST_ENTRY(usb_fs_privdata) pd_next;
|
||||
};
|
||||
|
||||
/*
|
||||
* Most of the fields in the "usb2_fifo" structure are used by the
|
||||
* Most of the fields in the "usb_fifo" structure are used by the
|
||||
* generic USB access layer.
|
||||
*/
|
||||
struct usb2_fifo {
|
||||
struct usb2_ifqueue free_q;
|
||||
struct usb2_ifqueue used_q;
|
||||
struct usb_fifo {
|
||||
struct usb_ifqueue free_q;
|
||||
struct usb_ifqueue used_q;
|
||||
struct selinfo selinfo;
|
||||
struct cv cv_io;
|
||||
struct cv cv_drain;
|
||||
struct usb2_fifo_methods *methods;
|
||||
struct usb2_symlink *symlink[2];/* our symlinks */
|
||||
struct usb_fifo_methods *methods;
|
||||
struct usb_symlink *symlink[2];/* our symlinks */
|
||||
struct proc *async_p; /* process that wants SIGIO */
|
||||
struct usb2_fs_endpoint *fs_ep_ptr;
|
||||
struct usb2_device *udev;
|
||||
struct usb2_xfer *xfer[2];
|
||||
struct usb2_xfer **fs_xfer;
|
||||
struct usb_fs_endpoint *fs_ep_ptr;
|
||||
struct usb_device *udev;
|
||||
struct usb_xfer *xfer[2];
|
||||
struct usb_xfer **fs_xfer;
|
||||
struct mtx *priv_mtx; /* client data */
|
||||
/* set if FIFO is opened by a FILE: */
|
||||
struct usb2_cdev_privdata *curr_cpd;
|
||||
struct usb_cdev_privdata *curr_cpd;
|
||||
void *priv_sc0; /* client data */
|
||||
void *priv_sc1; /* client data */
|
||||
void *queue_data;
|
||||
@ -149,53 +149,53 @@ struct usb2_fifo {
|
||||
uint8_t flag_stall; /* set if clear stall should be run */
|
||||
uint8_t iface_index; /* set to the interface we belong to */
|
||||
uint8_t fifo_index; /* set to the FIFO index in "struct
|
||||
* usb2_device" */
|
||||
* usb_device" */
|
||||
uint8_t fs_ep_max;
|
||||
uint8_t fifo_zlp; /* zero length packet count */
|
||||
uint8_t refcount;
|
||||
#define USB_FIFO_REF_MAX 0xFF
|
||||
};
|
||||
|
||||
struct usb2_fifo_sc {
|
||||
struct usb2_fifo *fp[2];
|
||||
struct usb_fifo_sc {
|
||||
struct usb_fifo *fp[2];
|
||||
struct cdev* dev;
|
||||
};
|
||||
|
||||
extern struct cdevsw usb2_devsw;
|
||||
|
||||
int usb2_fifo_wait(struct usb2_fifo *fifo);
|
||||
void usb2_fifo_signal(struct usb2_fifo *fifo);
|
||||
int usb2_fifo_alloc_buffer(struct usb2_fifo *f, uint32_t bufsize,
|
||||
int usb2_fifo_wait(struct usb_fifo *fifo);
|
||||
void usb2_fifo_signal(struct usb_fifo *fifo);
|
||||
int usb2_fifo_alloc_buffer(struct usb_fifo *f, uint32_t bufsize,
|
||||
uint16_t nbuf);
|
||||
void usb2_fifo_free_buffer(struct usb2_fifo *f);
|
||||
int usb2_fifo_attach(struct usb2_device *udev, void *priv_sc,
|
||||
struct mtx *priv_mtx, struct usb2_fifo_methods *pm,
|
||||
struct usb2_fifo_sc *f_sc, uint16_t unit, uint16_t subunit,
|
||||
void usb2_fifo_free_buffer(struct usb_fifo *f);
|
||||
int usb2_fifo_attach(struct usb_device *udev, void *priv_sc,
|
||||
struct mtx *priv_mtx, struct usb_fifo_methods *pm,
|
||||
struct usb_fifo_sc *f_sc, uint16_t unit, uint16_t subunit,
|
||||
uint8_t iface_index, uid_t uid, gid_t gid, int mode);
|
||||
void usb2_fifo_detach(struct usb2_fifo_sc *f_sc);
|
||||
uint32_t usb2_fifo_put_bytes_max(struct usb2_fifo *fifo);
|
||||
void usb2_fifo_put_data(struct usb2_fifo *fifo, struct usb2_page_cache *pc,
|
||||
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);
|
||||
void usb2_fifo_put_data_linear(struct usb2_fifo *fifo, void *ptr,
|
||||
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 usb2_fifo *f, void *ptr, usb2_size_t len);
|
||||
void usb2_fifo_put_data_error(struct usb2_fifo *fifo);
|
||||
uint8_t usb2_fifo_get_data(struct usb2_fifo *fifo, struct usb2_page_cache *pc,
|
||||
uint8_t usb2_fifo_put_data_buffer(struct usb_fifo *f, void *ptr, usb2_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,
|
||||
uint8_t what);
|
||||
uint8_t usb2_fifo_get_data_linear(struct usb2_fifo *fifo, void *ptr,
|
||||
uint8_t usb2_fifo_get_data_linear(struct usb_fifo *fifo, void *ptr,
|
||||
usb2_size_t len, usb2_size_t *actlen, uint8_t what);
|
||||
uint8_t usb2_fifo_get_data_buffer(struct usb2_fifo *f, void **pptr,
|
||||
uint8_t usb2_fifo_get_data_buffer(struct usb_fifo *f, void **pptr,
|
||||
usb2_size_t *plen);
|
||||
void usb2_fifo_get_data_error(struct usb2_fifo *fifo);
|
||||
uint8_t usb2_fifo_opened(struct usb2_fifo *fifo);
|
||||
void usb2_fifo_free(struct usb2_fifo *f);
|
||||
void usb2_fifo_reset(struct usb2_fifo *f);
|
||||
void usb2_fifo_wakeup(struct usb2_fifo *f);
|
||||
struct usb2_symlink *usb2_alloc_symlink(const char *target);
|
||||
void usb2_free_symlink(struct usb2_symlink *ps);
|
||||
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);
|
||||
void usb2_fifo_reset(struct usb_fifo *f);
|
||||
void usb2_fifo_wakeup(struct usb_fifo *f);
|
||||
struct usb_symlink *usb2_alloc_symlink(const char *target);
|
||||
void usb2_free_symlink(struct usb_symlink *ps);
|
||||
int usb2_read_symlink(uint8_t *user_ptr, uint32_t startentry,
|
||||
uint32_t user_len);
|
||||
void usb2_fifo_set_close_zlp(struct usb2_fifo *, uint8_t);
|
||||
void usb2_fifo_set_close_zlp(struct usb_fifo *, uint8_t);
|
||||
|
||||
#endif /* _USB2_DEV_H_ */
|
||||
|
@ -57,27 +57,27 @@
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
static void usb2_init_pipe(struct usb2_device *, uint8_t,
|
||||
struct usb2_endpoint_descriptor *, struct usb2_pipe *);
|
||||
static void usb2_unconfigure(struct usb2_device *, uint8_t);
|
||||
static void usb2_detach_device(struct usb2_device *, uint8_t, uint8_t);
|
||||
static void usb2_detach_device_sub(struct usb2_device *, device_t *,
|
||||
static void usb2_init_pipe(struct usb_device *, uint8_t,
|
||||
struct usb_endpoint_descriptor *, struct usb_pipe *);
|
||||
static void usb2_unconfigure(struct usb_device *, uint8_t);
|
||||
static void usb2_detach_device(struct usb_device *, uint8_t, uint8_t);
|
||||
static void usb2_detach_device_sub(struct usb_device *, device_t *,
|
||||
uint8_t);
|
||||
static uint8_t usb2_probe_and_attach_sub(struct usb2_device *,
|
||||
struct usb2_attach_arg *);
|
||||
static void usb2_init_attach_arg(struct usb2_device *,
|
||||
struct usb2_attach_arg *);
|
||||
static void usb2_suspend_resume_sub(struct usb2_device *, device_t,
|
||||
static uint8_t usb2_probe_and_attach_sub(struct usb_device *,
|
||||
struct usb_attach_arg *);
|
||||
static void usb2_init_attach_arg(struct usb_device *,
|
||||
struct usb_attach_arg *);
|
||||
static void usb2_suspend_resume_sub(struct usb_device *, device_t,
|
||||
uint8_t);
|
||||
static void usb2_clear_stall_proc(struct usb2_proc_msg *_pm);
|
||||
usb2_error_t usb2_config_parse(struct usb2_device *, uint8_t, uint8_t);
|
||||
static void usb2_set_device_strings(struct usb2_device *);
|
||||
static void usb2_clear_stall_proc(struct usb_proc_msg *_pm);
|
||||
usb2_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 usb2_device *);
|
||||
static void usb2_fifo_free_wrap(struct usb2_device *, uint8_t, uint8_t);
|
||||
static struct cdev *usb2_make_dev(struct usb2_device *, int, int);
|
||||
static void usb2_cdev_create(struct usb2_device *);
|
||||
static void usb2_cdev_free(struct usb2_device *);
|
||||
static void usb2_notify_addq(const char *type, struct usb_device *);
|
||||
static void usb2_fifo_free_wrap(struct usb_device *, uint8_t, uint8_t);
|
||||
static struct cdev *usb2_make_dev(struct usb_device *, int, int);
|
||||
static void usb2_cdev_create(struct usb_device *);
|
||||
static void usb2_cdev_free(struct usb_device *);
|
||||
static void usb2_cdev_cleanup(void *);
|
||||
#endif
|
||||
|
||||
@ -112,11 +112,11 @@ usb2_statestr(enum usb_dev_state state)
|
||||
* NULL: Failure
|
||||
* Else: Success
|
||||
*------------------------------------------------------------------------*/
|
||||
struct usb2_pipe *
|
||||
usb2_get_pipe_by_addr(struct usb2_device *udev, uint8_t ea_val)
|
||||
struct usb_pipe *
|
||||
usb2_get_pipe_by_addr(struct usb_device *udev, uint8_t ea_val)
|
||||
{
|
||||
struct usb2_pipe *pipe = udev->pipes;
|
||||
struct usb2_pipe *pipe_end = udev->pipes + udev->pipes_max;
|
||||
struct usb_pipe *pipe = udev->pipes;
|
||||
struct usb_pipe *pipe_end = udev->pipes + udev->pipes_max;
|
||||
enum {
|
||||
EA_MASK = (UE_DIR_IN | UE_DIR_OUT | UE_ADDR),
|
||||
};
|
||||
@ -160,18 +160,18 @@ usb2_get_pipe_by_addr(struct usb2_device *udev, uint8_t ea_val)
|
||||
* usb2_get_pipe
|
||||
*
|
||||
* This function searches for an USB pipe based on the information
|
||||
* given by the passed "struct usb2_config" pointer.
|
||||
* given by the passed "struct usb_config" pointer.
|
||||
*
|
||||
* Return values:
|
||||
* NULL: No match.
|
||||
* Else: Pointer to "struct usb2_pipe".
|
||||
* Else: Pointer to "struct usb_pipe".
|
||||
*------------------------------------------------------------------------*/
|
||||
struct usb2_pipe *
|
||||
usb2_get_pipe(struct usb2_device *udev, uint8_t iface_index,
|
||||
const struct usb2_config *setup)
|
||||
struct usb_pipe *
|
||||
usb2_get_pipe(struct usb_device *udev, uint8_t iface_index,
|
||||
const struct usb_config *setup)
|
||||
{
|
||||
struct usb2_pipe *pipe = udev->pipes;
|
||||
struct usb2_pipe *pipe_end = udev->pipes + udev->pipes_max;
|
||||
struct usb_pipe *pipe = udev->pipes;
|
||||
struct usb_pipe *pipe_end = udev->pipes + udev->pipes_max;
|
||||
uint8_t index = setup->ep_index;
|
||||
uint8_t ea_mask;
|
||||
uint8_t ea_val;
|
||||
@ -288,7 +288,7 @@ usb2_get_pipe(struct usb2_device *udev, uint8_t iface_index,
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb2_interface_count(struct usb2_device *udev, uint8_t *count)
|
||||
usb2_interface_count(struct usb_device *udev, uint8_t *count)
|
||||
{
|
||||
if (udev->cdesc == NULL) {
|
||||
*count = 0;
|
||||
@ -307,10 +307,10 @@ usb2_interface_count(struct usb2_device *udev, uint8_t *count)
|
||||
* zeroed before calling this function.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_init_pipe(struct usb2_device *udev, uint8_t iface_index,
|
||||
struct usb2_endpoint_descriptor *edesc, struct usb2_pipe *pipe)
|
||||
usb2_init_pipe(struct usb_device *udev, uint8_t iface_index,
|
||||
struct usb_endpoint_descriptor *edesc, struct usb_pipe *pipe)
|
||||
{
|
||||
struct usb2_bus_methods *methods;
|
||||
struct usb_bus_methods *methods;
|
||||
|
||||
methods = udev->bus->methods;
|
||||
|
||||
@ -344,10 +344,10 @@ usb2_init_pipe(struct usb2_device *udev, uint8_t iface_index,
|
||||
* NULL: End of USB pipes
|
||||
* Else: Pointer to next USB pipe
|
||||
*------------------------------------------------------------------------*/
|
||||
struct usb2_pipe *
|
||||
usb2_pipe_foreach(struct usb2_device *udev, struct usb2_pipe *pipe)
|
||||
struct usb_pipe *
|
||||
usb2_pipe_foreach(struct usb_device *udev, struct usb_pipe *pipe)
|
||||
{
|
||||
struct usb2_pipe *pipe_end = udev->pipes + udev->pipes_max;
|
||||
struct usb_pipe *pipe_end = udev->pipes + udev->pipes_max;
|
||||
|
||||
/* be NULL safe */
|
||||
if (udev == NULL)
|
||||
@ -377,7 +377,7 @@ usb2_pipe_foreach(struct usb2_device *udev, struct usb2_pipe *pipe)
|
||||
* Flag values, see "USB_UNCFG_FLAG_XXX".
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_unconfigure(struct usb2_device *udev, uint8_t flag)
|
||||
usb2_unconfigure(struct usb_device *udev, uint8_t flag)
|
||||
{
|
||||
uint8_t do_unlock;
|
||||
|
||||
@ -404,9 +404,9 @@ usb2_unconfigure(struct usb2_device *udev, uint8_t flag)
|
||||
|
||||
#if USB_HAVE_COMPAT_LINUX
|
||||
/* free Linux compat device, if any */
|
||||
if (udev->linux_dev) {
|
||||
usb_linux_free_device(udev->linux_dev);
|
||||
udev->linux_dev = NULL;
|
||||
if (udev->linux_endpoint_start) {
|
||||
usb_linux_free_device(udev);
|
||||
udev->linux_endpoint_start = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -439,10 +439,10 @@ usb2_unconfigure(struct usb2_device *udev, uint8_t flag)
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb2_set_config_index(struct usb2_device *udev, uint8_t index)
|
||||
usb2_set_config_index(struct usb_device *udev, uint8_t index)
|
||||
{
|
||||
struct usb2_status ds;
|
||||
struct usb2_config_descriptor *cdp;
|
||||
struct usb_status ds;
|
||||
struct usb_config_descriptor *cdp;
|
||||
uint16_t power;
|
||||
uint16_t max_power;
|
||||
uint8_t selfpowered;
|
||||
@ -589,13 +589,13 @@ usb2_set_config_index(struct usb2_device *udev, uint8_t index)
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb2_config_parse(struct usb2_device *udev, uint8_t iface_index, uint8_t cmd)
|
||||
usb2_config_parse(struct usb_device *udev, uint8_t iface_index, uint8_t cmd)
|
||||
{
|
||||
struct usb2_idesc_parse_state ips;
|
||||
struct usb2_interface_descriptor *id;
|
||||
struct usb2_endpoint_descriptor *ed;
|
||||
struct usb2_interface *iface;
|
||||
struct usb2_pipe *pipe;
|
||||
struct usb_idesc_parse_state ips;
|
||||
struct usb_interface_descriptor *id;
|
||||
struct usb_endpoint_descriptor *ed;
|
||||
struct usb_interface *iface;
|
||||
struct usb_pipe *pipe;
|
||||
usb2_error_t err;
|
||||
uint8_t ep_curr;
|
||||
uint8_t ep_max;
|
||||
@ -698,7 +698,7 @@ usb2_config_parse(struct usb2_device *udev, uint8_t iface_index, uint8_t cmd)
|
||||
|
||||
DPRINTFN(5, "found idesc nendpt=%d\n", id->bNumEndpoints);
|
||||
|
||||
ed = (struct usb2_endpoint_descriptor *)id;
|
||||
ed = (struct usb_endpoint_descriptor *)id;
|
||||
|
||||
temp = ep_curr;
|
||||
|
||||
@ -722,7 +722,7 @@ usb2_config_parse(struct usb2_device *udev, uint8_t iface_index, uint8_t cmd)
|
||||
ep_max = temp;
|
||||
|
||||
/* optimalisation */
|
||||
id = (struct usb2_interface_descriptor *)ed;
|
||||
id = (struct usb_interface_descriptor *)ed;
|
||||
}
|
||||
}
|
||||
|
||||
@ -795,10 +795,10 @@ usb2_config_parse(struct usb2_device *udev, uint8_t iface_index, uint8_t cmd)
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb2_set_alt_interface_index(struct usb2_device *udev,
|
||||
usb2_set_alt_interface_index(struct usb_device *udev,
|
||||
uint8_t iface_index, uint8_t alt_index)
|
||||
{
|
||||
struct usb2_interface *iface = usb2_get_iface(udev, iface_index);
|
||||
struct usb_interface *iface = usb2_get_iface(udev, iface_index);
|
||||
usb2_error_t err;
|
||||
uint8_t do_unlock;
|
||||
|
||||
@ -859,10 +859,10 @@ usb2_set_alt_interface_index(struct usb2_device *udev,
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb2_set_endpoint_stall(struct usb2_device *udev, struct usb2_pipe *pipe,
|
||||
usb2_set_endpoint_stall(struct usb_device *udev, struct usb_pipe *pipe,
|
||||
uint8_t do_stall)
|
||||
{
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb_xfer *xfer;
|
||||
uint8_t et;
|
||||
uint8_t was_stalled;
|
||||
|
||||
@ -935,10 +935,10 @@ usb2_set_endpoint_stall(struct usb2_device *udev, struct usb2_pipe *pipe,
|
||||
* usb2_reset_iface_endpoints - used in USB device side mode
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb2_reset_iface_endpoints(struct usb2_device *udev, uint8_t iface_index)
|
||||
usb2_reset_iface_endpoints(struct usb_device *udev, uint8_t iface_index)
|
||||
{
|
||||
struct usb2_pipe *pipe;
|
||||
struct usb2_pipe *pipe_end;
|
||||
struct usb_pipe *pipe;
|
||||
struct usb_pipe *pipe_end;
|
||||
usb2_error_t err;
|
||||
|
||||
pipe = udev->pipes;
|
||||
@ -968,7 +968,7 @@ usb2_reset_iface_endpoints(struct usb2_device *udev, uint8_t iface_index)
|
||||
* Flag values, see "USB_UNCFG_FLAG_XXX".
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_detach_device_sub(struct usb2_device *udev, device_t *ppdev,
|
||||
usb2_detach_device_sub(struct usb_device *udev, device_t *ppdev,
|
||||
uint8_t flag)
|
||||
{
|
||||
device_t dev;
|
||||
@ -1024,10 +1024,10 @@ usb2_detach_device_sub(struct usb2_device *udev, device_t *ppdev,
|
||||
* Flag values, see "USB_UNCFG_FLAG_XXX".
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_detach_device(struct usb2_device *udev, uint8_t iface_index,
|
||||
usb2_detach_device(struct usb_device *udev, uint8_t iface_index,
|
||||
uint8_t flag)
|
||||
{
|
||||
struct usb2_interface *iface;
|
||||
struct usb_interface *iface;
|
||||
uint8_t i;
|
||||
|
||||
if (udev == NULL) {
|
||||
@ -1073,10 +1073,10 @@ usb2_detach_device(struct usb2_device *udev, uint8_t iface_index,
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static uint8_t
|
||||
usb2_probe_and_attach_sub(struct usb2_device *udev,
|
||||
struct usb2_attach_arg *uaa)
|
||||
usb2_probe_and_attach_sub(struct usb_device *udev,
|
||||
struct usb_attach_arg *uaa)
|
||||
{
|
||||
struct usb2_interface *iface;
|
||||
struct usb_interface *iface;
|
||||
device_t dev;
|
||||
int err;
|
||||
|
||||
@ -1158,10 +1158,10 @@ usb2_probe_and_attach_sub(struct usb2_device *udev,
|
||||
* locked.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_set_parent_iface(struct usb2_device *udev, uint8_t iface_index,
|
||||
usb2_set_parent_iface(struct usb_device *udev, uint8_t iface_index,
|
||||
uint8_t parent_index)
|
||||
{
|
||||
struct usb2_interface *iface;
|
||||
struct usb_interface *iface;
|
||||
|
||||
iface = usb2_get_iface(udev, iface_index);
|
||||
if (iface) {
|
||||
@ -1170,8 +1170,8 @@ usb2_set_parent_iface(struct usb2_device *udev, uint8_t iface_index,
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_init_attach_arg(struct usb2_device *udev,
|
||||
struct usb2_attach_arg *uaa)
|
||||
usb2_init_attach_arg(struct usb_device *udev,
|
||||
struct usb_attach_arg *uaa)
|
||||
{
|
||||
bzero(uaa, sizeof(*uaa));
|
||||
|
||||
@ -1200,10 +1200,10 @@ usb2_init_attach_arg(struct usb2_device *udev,
|
||||
* Else: A control transfer failed
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb2_probe_and_attach(struct usb2_device *udev, uint8_t iface_index)
|
||||
usb2_probe_and_attach(struct usb_device *udev, uint8_t iface_index)
|
||||
{
|
||||
struct usb2_attach_arg uaa;
|
||||
struct usb2_interface *iface;
|
||||
struct usb_attach_arg uaa;
|
||||
struct usb_interface *iface;
|
||||
uint8_t i;
|
||||
uint8_t j;
|
||||
uint8_t do_unlock;
|
||||
@ -1309,7 +1309,7 @@ usb2_probe_and_attach(struct usb2_device *udev, uint8_t iface_index)
|
||||
* be executed on an USB device.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_suspend_resume_sub(struct usb2_device *udev, device_t dev, uint8_t do_suspend)
|
||||
usb2_suspend_resume_sub(struct usb_device *udev, device_t dev, uint8_t do_suspend)
|
||||
{
|
||||
int err;
|
||||
|
||||
@ -1340,9 +1340,9 @@ usb2_suspend_resume_sub(struct usb2_device *udev, device_t dev, uint8_t do_suspe
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb2_suspend_resume(struct usb2_device *udev, uint8_t do_suspend)
|
||||
usb2_suspend_resume(struct usb_device *udev, uint8_t do_suspend)
|
||||
{
|
||||
struct usb2_interface *iface;
|
||||
struct usb_interface *iface;
|
||||
uint8_t i;
|
||||
|
||||
if (udev == NULL) {
|
||||
@ -1383,10 +1383,10 @@ usb2_suspend_resume(struct usb2_device *udev, uint8_t do_suspend)
|
||||
* This function performs generic USB clear stall operations.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_clear_stall_proc(struct usb2_proc_msg *_pm)
|
||||
usb2_clear_stall_proc(struct usb_proc_msg *_pm)
|
||||
{
|
||||
struct usb2_clear_stall_msg *pm = (void *)_pm;
|
||||
struct usb2_device *udev = pm->udev;
|
||||
struct usb_clear_stall_msg *pm = (void *)_pm;
|
||||
struct usb_device *udev = pm->udev;
|
||||
|
||||
/* Change lock */
|
||||
USB_BUS_UNLOCK(udev->bus);
|
||||
@ -1412,15 +1412,15 @@ usb2_clear_stall_proc(struct usb2_proc_msg *_pm)
|
||||
* 0: Failure
|
||||
* Else: Success
|
||||
*------------------------------------------------------------------------*/
|
||||
struct usb2_device *
|
||||
usb2_alloc_device(device_t parent_dev, struct usb2_bus *bus,
|
||||
struct usb2_device *parent_hub, uint8_t depth, uint8_t port_index,
|
||||
struct usb_device *
|
||||
usb2_alloc_device(device_t parent_dev, struct usb_bus *bus,
|
||||
struct usb_device *parent_hub, uint8_t depth, uint8_t port_index,
|
||||
uint8_t port_no, enum usb_dev_speed speed, enum usb_hc_mode mode)
|
||||
{
|
||||
struct usb2_attach_arg uaa;
|
||||
struct usb2_device *udev;
|
||||
struct usb2_device *adev;
|
||||
struct usb2_device *hub;
|
||||
struct usb_attach_arg uaa;
|
||||
struct usb_device *udev;
|
||||
struct usb_device *adev;
|
||||
struct usb_device *hub;
|
||||
uint8_t *scratch_ptr;
|
||||
uint32_t scratch_size;
|
||||
usb2_error_t err;
|
||||
@ -1796,13 +1796,13 @@ usb2_alloc_device(device_t parent_dev, struct usb2_bus *bus,
|
||||
|
||||
#if USB_HAVE_UGEN
|
||||
static struct cdev *
|
||||
usb2_make_dev(struct usb2_device *udev, int ep, int mode)
|
||||
usb2_make_dev(struct usb_device *udev, int ep, int mode)
|
||||
{
|
||||
struct usb2_fs_privdata* pd;
|
||||
struct usb_fs_privdata* pd;
|
||||
char devname[20];
|
||||
|
||||
/* Store information to locate ourselves again later */
|
||||
pd = malloc(sizeof(struct usb2_fs_privdata), M_USBDEV,
|
||||
pd = malloc(sizeof(struct usb_fs_privdata), M_USBDEV,
|
||||
M_WAITOK | M_ZERO);
|
||||
pd->bus_index = device_get_unit(udev->bus->bdev);
|
||||
pd->dev_index = udev->device_index;
|
||||
@ -1820,12 +1820,12 @@ usb2_make_dev(struct usb2_device *udev, int ep, int mode)
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_cdev_create(struct usb2_device *udev)
|
||||
usb2_cdev_create(struct usb_device *udev)
|
||||
{
|
||||
struct usb2_config_descriptor *cd;
|
||||
struct usb2_endpoint_descriptor *ed;
|
||||
struct usb2_descriptor *desc;
|
||||
struct usb2_fs_privdata* pd;
|
||||
struct usb_config_descriptor *cd;
|
||||
struct usb_endpoint_descriptor *ed;
|
||||
struct usb_descriptor *desc;
|
||||
struct usb_fs_privdata* pd;
|
||||
struct cdev *dev;
|
||||
int inmode, outmode, inmask, outmask, mode;
|
||||
uint8_t ep;
|
||||
@ -1855,7 +1855,7 @@ usb2_cdev_create(struct usb2_device *udev)
|
||||
/* filter out all endpoint descriptors */
|
||||
if ((desc->bDescriptorType == UDESC_ENDPOINT) &&
|
||||
(desc->bLength >= sizeof(*ed))) {
|
||||
ed = (struct usb2_endpoint_descriptor *)desc;
|
||||
ed = (struct usb_endpoint_descriptor *)desc;
|
||||
|
||||
/* update masks */
|
||||
ep = ed->bEndpointAddress;
|
||||
@ -1880,9 +1880,9 @@ usb2_cdev_create(struct usb2_device *udev)
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_cdev_free(struct usb2_device *udev)
|
||||
usb2_cdev_free(struct usb_device *udev)
|
||||
{
|
||||
struct usb2_fs_privdata* pd;
|
||||
struct usb_fs_privdata* pd;
|
||||
|
||||
DPRINTFN(2, "Freeing device nodes\n");
|
||||
|
||||
@ -1910,9 +1910,9 @@ usb2_cdev_cleanup(void* arg)
|
||||
* Flag values, see "USB_UNCFG_FLAG_XXX".
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_free_device(struct usb2_device *udev, uint8_t flag)
|
||||
usb2_free_device(struct usb_device *udev, uint8_t flag)
|
||||
{
|
||||
struct usb2_bus *bus;
|
||||
struct usb_bus *bus;
|
||||
|
||||
if (udev == NULL)
|
||||
return; /* already freed */
|
||||
@ -2003,10 +2003,10 @@ usb2_free_device(struct usb2_device *udev, uint8_t flag)
|
||||
* NULL: Interface not present.
|
||||
* Else: Pointer to USB interface structure.
|
||||
*------------------------------------------------------------------------*/
|
||||
struct usb2_interface *
|
||||
usb2_get_iface(struct usb2_device *udev, uint8_t iface_index)
|
||||
struct usb_interface *
|
||||
usb2_get_iface(struct usb_device *udev, uint8_t iface_index)
|
||||
{
|
||||
struct usb2_interface *iface = udev->ifaces + iface_index;
|
||||
struct usb_interface *iface = udev->ifaces + iface_index;
|
||||
|
||||
if (iface_index >= udev->ifaces_max)
|
||||
return (NULL);
|
||||
@ -2029,13 +2029,13 @@ usb2_get_iface(struct usb2_device *udev, uint8_t iface_index)
|
||||
* Else: A descriptor matching the criteria
|
||||
*------------------------------------------------------------------------*/
|
||||
void *
|
||||
usb2_find_descriptor(struct usb2_device *udev, void *id, uint8_t iface_index,
|
||||
usb2_find_descriptor(struct usb_device *udev, void *id, uint8_t iface_index,
|
||||
uint8_t type, uint8_t type_mask,
|
||||
uint8_t subtype, uint8_t subtype_mask)
|
||||
{
|
||||
struct usb2_descriptor *desc;
|
||||
struct usb2_config_descriptor *cd;
|
||||
struct usb2_interface *iface;
|
||||
struct usb_descriptor *desc;
|
||||
struct usb_config_descriptor *cd;
|
||||
struct usb_interface *iface;
|
||||
|
||||
cd = usb2_get_config_descriptor(udev);
|
||||
if (cd == NULL) {
|
||||
@ -2075,9 +2075,9 @@ usb2_find_descriptor(struct usb2_device *udev, void *id, uint8_t iface_index,
|
||||
* including the terminating zero.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_devinfo(struct usb2_device *udev, char *dst_ptr, uint16_t dst_len)
|
||||
usb2_devinfo(struct usb_device *udev, char *dst_ptr, uint16_t dst_len)
|
||||
{
|
||||
struct usb2_device_descriptor *udd = &udev->ddesc;
|
||||
struct usb_device_descriptor *udd = &udev->ddesc;
|
||||
uint16_t bcdDevice;
|
||||
uint16_t bcdUSB;
|
||||
|
||||
@ -2121,9 +2121,9 @@ struct usb_knowndev {
|
||||
#endif /* USB_VERBOSE */
|
||||
|
||||
static void
|
||||
usb2_set_device_strings(struct usb2_device *udev)
|
||||
usb2_set_device_strings(struct usb_device *udev)
|
||||
{
|
||||
struct usb2_device_descriptor *udd = &udev->ddesc;
|
||||
struct usb_device_descriptor *udd = &udev->ddesc;
|
||||
#if USB_VERBOSE
|
||||
const struct usb_knowndev *kdp;
|
||||
#endif
|
||||
@ -2194,7 +2194,7 @@ usb2_set_device_strings(struct usb2_device *udev)
|
||||
* See: USB_MODE_XXX
|
||||
*/
|
||||
enum usb_hc_mode
|
||||
usb2_get_mode(struct usb2_device *udev)
|
||||
usb2_get_mode(struct usb_device *udev)
|
||||
{
|
||||
return (udev->flags.usb_mode);
|
||||
}
|
||||
@ -2204,13 +2204,13 @@ usb2_get_mode(struct usb2_device *udev)
|
||||
* See: USB_SPEED_XXX
|
||||
*/
|
||||
enum usb_dev_speed
|
||||
usb2_get_speed(struct usb2_device *udev)
|
||||
usb2_get_speed(struct usb_device *udev)
|
||||
{
|
||||
return (udev->speed);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
usb2_get_isoc_fps(struct usb2_device *udev)
|
||||
usb2_get_isoc_fps(struct usb_device *udev)
|
||||
{
|
||||
; /* indent fix */
|
||||
switch (udev->speed) {
|
||||
@ -2222,16 +2222,16 @@ usb2_get_isoc_fps(struct usb2_device *udev)
|
||||
}
|
||||
}
|
||||
|
||||
struct usb2_device_descriptor *
|
||||
usb2_get_device_descriptor(struct usb2_device *udev)
|
||||
struct usb_device_descriptor *
|
||||
usb2_get_device_descriptor(struct usb_device *udev)
|
||||
{
|
||||
if (udev == NULL)
|
||||
return (NULL); /* be NULL safe */
|
||||
return (&udev->ddesc);
|
||||
}
|
||||
|
||||
struct usb2_config_descriptor *
|
||||
usb2_get_config_descriptor(struct usb2_device *udev)
|
||||
struct usb_config_descriptor *
|
||||
usb2_get_config_descriptor(struct usb_device *udev)
|
||||
{
|
||||
if (udev == NULL)
|
||||
return (NULL); /* be NULL safe */
|
||||
@ -2246,7 +2246,7 @@ usb2_get_config_descriptor(struct usb2_device *udev)
|
||||
* Else: The USB device has the given quirk.
|
||||
*------------------------------------------------------------------------*/
|
||||
uint8_t
|
||||
usb2_test_quirk(const struct usb2_attach_arg *uaa, uint16_t quirk)
|
||||
usb2_test_quirk(const struct usb_attach_arg *uaa, uint16_t quirk)
|
||||
{
|
||||
uint8_t found;
|
||||
|
||||
@ -2254,8 +2254,8 @@ usb2_test_quirk(const struct usb2_attach_arg *uaa, uint16_t quirk)
|
||||
return (found);
|
||||
}
|
||||
|
||||
struct usb2_interface_descriptor *
|
||||
usb2_get_interface_descriptor(struct usb2_interface *iface)
|
||||
struct usb_interface_descriptor *
|
||||
usb2_get_interface_descriptor(struct usb_interface *iface)
|
||||
{
|
||||
if (iface == NULL)
|
||||
return (NULL); /* be NULL safe */
|
||||
@ -2263,19 +2263,19 @@ usb2_get_interface_descriptor(struct usb2_interface *iface)
|
||||
}
|
||||
|
||||
uint8_t
|
||||
usb2_get_interface_altindex(struct usb2_interface *iface)
|
||||
usb2_get_interface_altindex(struct usb_interface *iface)
|
||||
{
|
||||
return (iface->alt_index);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
usb2_get_bus_index(struct usb2_device *udev)
|
||||
usb2_get_bus_index(struct usb_device *udev)
|
||||
{
|
||||
return ((uint8_t)device_get_unit(udev->bus->bdev));
|
||||
}
|
||||
|
||||
uint8_t
|
||||
usb2_get_device_index(struct usb2_device *udev)
|
||||
usb2_get_device_index(struct usb_device *udev)
|
||||
{
|
||||
return (udev->device_index);
|
||||
}
|
||||
@ -2287,7 +2287,7 @@ usb2_get_device_index(struct usb2_device *udev)
|
||||
* This function will generate events for dev.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_notify_addq(const char *type, struct usb2_device *udev)
|
||||
usb2_notify_addq(const char *type, struct usb_device *udev)
|
||||
{
|
||||
char *data = NULL;
|
||||
struct malloc_type *mt;
|
||||
@ -2343,10 +2343,10 @@ usb2_notify_addq(const char *type, struct usb2_device *udev)
|
||||
* "USB_IFACE_INDEX_ANY" the flag has no effect.
|
||||
*------------------------------------------------------------------------*/
|
||||
static void
|
||||
usb2_fifo_free_wrap(struct usb2_device *udev,
|
||||
usb2_fifo_free_wrap(struct usb_device *udev,
|
||||
uint8_t iface_index, uint8_t flag)
|
||||
{
|
||||
struct usb2_fifo *f;
|
||||
struct usb_fifo *f;
|
||||
uint16_t i;
|
||||
|
||||
/*
|
||||
@ -2397,9 +2397,9 @@ usb2_fifo_free_wrap(struct usb2_device *udev,
|
||||
* Else: Peer can do resume signalling.
|
||||
*------------------------------------------------------------------------*/
|
||||
uint8_t
|
||||
usb2_peer_can_wakeup(struct usb2_device *udev)
|
||||
usb2_peer_can_wakeup(struct usb_device *udev)
|
||||
{
|
||||
const struct usb2_config_descriptor *cdp;
|
||||
const struct usb_config_descriptor *cdp;
|
||||
|
||||
cdp = udev->cdesc;
|
||||
if ((cdp != NULL) && (udev->flags.usb_mode == USB_MODE_HOST)) {
|
||||
@ -2409,7 +2409,7 @@ usb2_peer_can_wakeup(struct usb2_device *udev)
|
||||
}
|
||||
|
||||
void
|
||||
usb2_set_device_state(struct usb2_device *udev, enum usb_dev_state state)
|
||||
usb2_set_device_state(struct usb_device *udev, enum usb_dev_state state)
|
||||
{
|
||||
|
||||
KASSERT(state < USB_STATE_MAX, ("invalid udev state"));
|
||||
@ -2420,7 +2420,7 @@ usb2_set_device_state(struct usb2_device *udev, enum usb_dev_state state)
|
||||
}
|
||||
|
||||
uint8_t
|
||||
usb2_device_attached(struct usb2_device *udev)
|
||||
usb2_device_attached(struct usb_device *udev)
|
||||
{
|
||||
return (udev->state > USB_STATE_DETACHED);
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
#ifndef _USB2_DEVICE_H_
|
||||
#define _USB2_DEVICE_H_
|
||||
|
||||
struct usb2_symlink; /* UGEN */
|
||||
struct usb_symlink; /* UGEN */
|
||||
struct usb_device; /* linux compat */
|
||||
|
||||
#define USB_DEFAULT_XFER_MAX 2
|
||||
@ -44,20 +44,47 @@ struct usb_device; /* linux compat */
|
||||
#define USB_UNCFG_FLAG_FREE_SUBDEV 0x01 /* subdevices are freed */
|
||||
#define USB_UNCFG_FLAG_FREE_EP0 0x02 /* endpoint zero is freed */
|
||||
|
||||
struct usb2_clear_stall_msg {
|
||||
struct usb2_proc_msg hdr;
|
||||
struct usb2_device *udev;
|
||||
struct usb_clear_stall_msg {
|
||||
struct usb_proc_msg hdr;
|
||||
struct usb_device *udev;
|
||||
};
|
||||
|
||||
/* The following four structures makes up a tree, where we have the
|
||||
* leaf structure, "usb_host_endpoint", first, and the root structure,
|
||||
* "usb_device", last. The four structures below mirror the structure
|
||||
* of the USB descriptors belonging to an USB configuration. Please
|
||||
* refer to the USB specification for a definition of "endpoints" and
|
||||
* "interfaces".
|
||||
*/
|
||||
struct usb_host_endpoint {
|
||||
struct usb_endpoint_descriptor desc;
|
||||
TAILQ_HEAD(, urb) bsd_urb_list;
|
||||
struct usb_xfer *bsd_xfer[2];
|
||||
uint8_t *extra; /* Extra descriptors */
|
||||
usb2_frlength_t fbsd_buf_size;
|
||||
uint16_t extralen;
|
||||
uint8_t bsd_iface_index;
|
||||
} __aligned(USB_HOST_ALIGN);
|
||||
|
||||
struct usb_host_interface {
|
||||
struct usb_interface_descriptor desc;
|
||||
/* the following array has size "desc.bNumEndpoint" */
|
||||
struct usb_host_endpoint *endpoint;
|
||||
const char *string; /* iInterface string, if present */
|
||||
uint8_t *extra; /* Extra descriptors */
|
||||
uint16_t extralen;
|
||||
uint8_t bsd_iface_index;
|
||||
} __aligned(USB_HOST_ALIGN);
|
||||
|
||||
/*
|
||||
* The following structure defines an USB pipe which is equal to an
|
||||
* USB endpoint.
|
||||
*/
|
||||
struct usb2_pipe {
|
||||
struct usb2_xfer_queue pipe_q; /* queue of USB transfers */
|
||||
struct usb_pipe {
|
||||
struct usb_xfer_queue pipe_q; /* queue of USB transfers */
|
||||
|
||||
struct usb2_endpoint_descriptor *edesc;
|
||||
struct usb2_pipe_methods *methods; /* set by HC driver */
|
||||
struct usb_endpoint_descriptor *edesc;
|
||||
struct usb_pipe_methods *methods; /* set by HC driver */
|
||||
|
||||
uint16_t isoc_next;
|
||||
uint16_t refcount;
|
||||
@ -72,17 +99,25 @@ struct usb2_pipe {
|
||||
/*
|
||||
* The following structure defines an USB interface.
|
||||
*/
|
||||
struct usb2_interface {
|
||||
struct usb2_interface_descriptor *idesc;
|
||||
struct usb_interface {
|
||||
struct usb_interface_descriptor *idesc;
|
||||
device_t subdev;
|
||||
uint8_t alt_index;
|
||||
uint8_t parent_iface_index;
|
||||
|
||||
/* Linux compat */
|
||||
struct usb_host_interface *altsetting;
|
||||
struct usb_host_interface *cur_altsetting;
|
||||
struct usb_device *linux_udev;
|
||||
void *bsd_priv_sc; /* device specific information */
|
||||
uint8_t num_altsetting; /* number of alternate settings */
|
||||
uint8_t bsd_iface_index;
|
||||
};
|
||||
|
||||
/*
|
||||
* The following structure defines the USB device flags.
|
||||
*/
|
||||
struct usb2_device_flags {
|
||||
struct usb_device_flags {
|
||||
enum usb_hc_mode usb_mode; /* host or device mode */
|
||||
uint8_t self_powered:1; /* set if USB device is self powered */
|
||||
uint8_t no_strings:1; /* set if USB device does not support
|
||||
@ -103,7 +138,7 @@ struct usb2_device_flags {
|
||||
* The following structure is used for power-save purposes. The data
|
||||
* in this structure is protected by the USB BUS lock.
|
||||
*/
|
||||
struct usb2_power_save {
|
||||
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 */
|
||||
@ -114,33 +149,30 @@ struct usb2_power_save {
|
||||
* The following structure defines an USB device. There exists one of
|
||||
* these structures for every USB device.
|
||||
*/
|
||||
struct usb2_device {
|
||||
struct usb2_clear_stall_msg cs_msg[2]; /* generic clear stall
|
||||
struct usb_device {
|
||||
struct usb_clear_stall_msg cs_msg[2]; /* generic clear stall
|
||||
* messages */
|
||||
struct sx default_sx[2];
|
||||
struct mtx default_mtx[1];
|
||||
struct cv default_cv[2];
|
||||
struct usb2_interface *ifaces;
|
||||
struct usb2_pipe default_pipe; /* Control Endpoint 0 */
|
||||
struct usb2_pipe *pipes;
|
||||
struct usb2_power_save pwr_save;/* power save data */
|
||||
struct usb2_bus *bus; /* our USB BUS */
|
||||
struct usb_interface *ifaces;
|
||||
struct usb_pipe default_pipe; /* Control Endpoint 0 */
|
||||
struct usb_pipe *pipes;
|
||||
struct usb_power_save pwr_save;/* power save data */
|
||||
struct usb_bus *bus; /* our USB BUS */
|
||||
device_t parent_dev; /* parent device */
|
||||
struct usb2_device *parent_hub;
|
||||
struct usb2_device *parent_hs_hub; /* high-speed parent HUB */
|
||||
struct usb2_config_descriptor *cdesc; /* full config descr */
|
||||
struct usb2_hub *hub; /* only if this is a hub */
|
||||
#if USB_HAVE_COMPAT_LINUX
|
||||
struct usb_device *linux_dev;
|
||||
#endif
|
||||
struct usb2_xfer *default_xfer[USB_DEFAULT_XFER_MAX];
|
||||
struct usb2_temp_data *usb2_template_ptr;
|
||||
struct usb2_pipe *pipe_curr; /* current clear stall pipe */
|
||||
struct usb_device *parent_hub;
|
||||
struct usb_device *parent_hs_hub; /* high-speed parent HUB */
|
||||
struct usb_config_descriptor *cdesc; /* full config descr */
|
||||
struct usb_hub *hub; /* only if this is a hub */
|
||||
struct usb_xfer *default_xfer[USB_DEFAULT_XFER_MAX];
|
||||
struct usb_temp_data *usb2_template_ptr;
|
||||
struct usb_pipe *pipe_curr; /* current clear stall pipe */
|
||||
#if USB_HAVE_UGEN
|
||||
struct usb2_fifo *fifo[USB_FIFO_MAX];
|
||||
struct usb2_symlink *ugen_symlink; /* our generic symlink */
|
||||
struct usb_fifo *fifo[USB_FIFO_MAX];
|
||||
struct usb_symlink *ugen_symlink; /* our generic symlink */
|
||||
struct cdev *default_dev; /* Control Endpoint 0 device node */
|
||||
LIST_HEAD(,usb2_fs_privdata) pd_list;
|
||||
LIST_HEAD(,usb_fs_privdata) pd_list;
|
||||
char ugen_name[20]; /* name of ugenX.X device */
|
||||
#endif
|
||||
usb2_ticks_t plugtime; /* copy of "ticks" */
|
||||
@ -169,14 +201,25 @@ struct usb2_device {
|
||||
|
||||
/* the "flags" field is write-protected by "bus->mtx" */
|
||||
|
||||
struct usb2_device_flags flags;
|
||||
struct usb_device_flags flags;
|
||||
|
||||
struct usb2_endpoint_descriptor default_ep_desc; /* for pipe 0 */
|
||||
struct usb2_device_descriptor ddesc; /* device descriptor */
|
||||
struct usb_endpoint_descriptor default_ep_desc; /* for pipe 0 */
|
||||
struct usb_device_descriptor ddesc; /* device descriptor */
|
||||
|
||||
char *serial; /* serial number */
|
||||
char *manufacturer; /* manufacturer string */
|
||||
char *product; /* product string */
|
||||
|
||||
#if USB_HAVE_COMPAT_LINUX
|
||||
/* Linux compat */
|
||||
struct usb_device_descriptor descriptor;
|
||||
struct usb_host_endpoint ep0;
|
||||
struct usb_interface *linux_iface_start;
|
||||
struct usb_interface *linux_iface_end;
|
||||
struct usb_host_endpoint *linux_endpoint_start;
|
||||
struct usb_host_endpoint *linux_endpoint_end;
|
||||
uint16_t devnum;
|
||||
#endif
|
||||
};
|
||||
|
||||
/* globals */
|
||||
@ -185,32 +228,32 @@ extern int usb2_template;
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
struct usb2_device *usb2_alloc_device(device_t parent_dev, struct usb2_bus *bus,
|
||||
struct usb2_device *parent_hub, uint8_t depth,
|
||||
struct usb_device *usb2_alloc_device(device_t parent_dev, struct usb_bus *bus,
|
||||
struct usb_device *parent_hub, uint8_t depth,
|
||||
uint8_t port_index, uint8_t port_no,
|
||||
enum usb_dev_speed speed, enum usb_hc_mode mode);
|
||||
struct usb2_pipe *usb2_get_pipe(struct usb2_device *udev, uint8_t iface_index,
|
||||
const struct usb2_config *setup);
|
||||
struct usb2_pipe *usb2_get_pipe_by_addr(struct usb2_device *udev, uint8_t ea_val);
|
||||
usb2_error_t usb2_interface_count(struct usb2_device *udev, uint8_t *count);
|
||||
usb2_error_t usb2_probe_and_attach(struct usb2_device *udev,
|
||||
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,
|
||||
uint8_t iface_index);
|
||||
usb2_error_t usb2_reset_iface_endpoints(struct usb2_device *udev,
|
||||
usb2_error_t usb2_reset_iface_endpoints(struct usb_device *udev,
|
||||
uint8_t iface_index);
|
||||
usb2_error_t usb2_set_config_index(struct usb2_device *udev, uint8_t index);
|
||||
usb2_error_t usb2_set_endpoint_stall(struct usb2_device *udev,
|
||||
struct usb2_pipe *pipe, uint8_t do_stall);
|
||||
usb2_error_t usb2_suspend_resume(struct usb2_device *udev,
|
||||
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,
|
||||
struct usb_pipe *pipe, uint8_t do_stall);
|
||||
usb2_error_t usb2_suspend_resume(struct usb_device *udev,
|
||||
uint8_t do_suspend);
|
||||
void usb2_devinfo(struct usb2_device *udev, char *dst_ptr, uint16_t dst_len);
|
||||
void usb2_free_device(struct usb2_device *, uint8_t);
|
||||
void *usb2_find_descriptor(struct usb2_device *udev, void *id,
|
||||
void usb2_devinfo(struct usb_device *udev, char *dst_ptr, uint16_t dst_len);
|
||||
void usb2_free_device(struct usb_device *, uint8_t);
|
||||
void *usb2_find_descriptor(struct usb_device *udev, void *id,
|
||||
uint8_t iface_index, uint8_t type, uint8_t type_mask,
|
||||
uint8_t subtype, uint8_t subtype_mask);
|
||||
void usb_linux_free_device(struct usb_device *dev);
|
||||
uint8_t usb2_peer_can_wakeup(struct usb2_device *udev);
|
||||
struct usb2_pipe *usb2_pipe_foreach(struct usb2_device *udev, struct usb2_pipe *pipe);
|
||||
void usb2_set_device_state(struct usb2_device *udev,
|
||||
uint8_t usb2_peer_can_wakeup(struct usb_device *udev);
|
||||
struct usb_pipe *usb2_pipe_foreach(struct usb_device *udev, struct usb_pipe *pipe);
|
||||
void usb2_set_device_state(struct usb_device *udev,
|
||||
enum usb_dev_state state);
|
||||
|
||||
#endif /* _USB2_DEVICE_H_ */
|
||||
|
@ -51,13 +51,13 @@ usb2_quirk_ioctl_t *usb2_quirk_ioctl_p = &usb2_quirk_ioctl_w;
|
||||
devclass_t usb2_devclass_ptr = NULL;
|
||||
|
||||
static usb2_error_t
|
||||
usb2_temp_setup_by_index_w(struct usb2_device *udev, uint16_t index)
|
||||
usb2_temp_setup_by_index_w(struct usb_device *udev, uint16_t index)
|
||||
{
|
||||
return (USB_ERR_INVAL);
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
usb2_test_quirk_w(const struct usb2_lookup_info *info, uint16_t quirk)
|
||||
usb2_test_quirk_w(const struct usb_lookup_info *info, uint16_t quirk)
|
||||
{
|
||||
return (0); /* no match */
|
||||
}
|
||||
@ -69,14 +69,14 @@ usb2_quirk_ioctl_w(unsigned long cmd, caddr_t data, int fflag, struct thread *td
|
||||
}
|
||||
|
||||
static usb2_error_t
|
||||
usb2_temp_get_desc_w(struct usb2_device *udev, struct usb2_device_request *req, const void **pPtr, uint16_t *pLength)
|
||||
usb2_temp_get_desc_w(struct usb_device *udev, struct usb_device_request *req, const void **pPtr, uint16_t *pLength)
|
||||
{
|
||||
/* stall */
|
||||
return (USB_ERR_STALLED);
|
||||
}
|
||||
|
||||
static void
|
||||
usb2_temp_unsetup_w(struct usb2_device *udev)
|
||||
usb2_temp_unsetup_w(struct usb_device *udev)
|
||||
{
|
||||
if (udev->usb2_template_ptr) {
|
||||
|
||||
@ -87,8 +87,8 @@ usb2_temp_unsetup_w(struct usb2_device *udev)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
usb2_test_huawei_autoinst_w(struct usb2_device *udev,
|
||||
struct usb2_attach_arg *uaa)
|
||||
usb2_test_huawei_autoinst_w(struct usb_device *udev,
|
||||
struct usb_attach_arg *uaa)
|
||||
{
|
||||
return (USB_ERR_INVAL);
|
||||
}
|
||||
|
@ -29,21 +29,21 @@
|
||||
|
||||
/* prototypes */
|
||||
|
||||
struct usb2_device;
|
||||
struct usb2_lookup_info;
|
||||
struct usb2_device_request;
|
||||
struct usb_device;
|
||||
struct usb_lookup_info;
|
||||
struct usb_device_request;
|
||||
|
||||
/* typedefs */
|
||||
|
||||
typedef usb2_error_t (usb2_temp_setup_by_index_t)(struct usb2_device *udev,
|
||||
typedef usb2_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 usb2_device *udev,
|
||||
struct usb2_attach_arg *uaa);
|
||||
typedef uint8_t (usb2_test_quirk_t)(const struct usb2_lookup_info *info,
|
||||
typedef usb2_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);
|
||||
typedef int (usb2_quirk_ioctl_t)(unsigned long cmd, caddr_t data,
|
||||
int fflag, struct thread *td);
|
||||
typedef void (usb2_temp_unsetup_t)(struct usb2_device *udev);
|
||||
typedef void (usb2_temp_unsetup_t)(struct usb_device *udev);
|
||||
|
||||
/* global function pointers */
|
||||
|
||||
@ -62,6 +62,6 @@ void usb2_temp_unload(void *);
|
||||
void usb2_quirk_unload(void *);
|
||||
void usb2_bus_unload(void *);
|
||||
|
||||
uint8_t usb2_test_quirk(const struct usb2_attach_arg *uaa, uint16_t quirk);
|
||||
uint8_t usb2_test_quirk(const struct usb_attach_arg *uaa, uint16_t quirk);
|
||||
|
||||
#endif /* _USB2_DYNAMIC_H_ */
|
||||
|
@ -73,25 +73,25 @@ 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 int ugen_transfer_setup(struct usb2_fifo *,
|
||||
const struct usb2_config *, uint8_t);
|
||||
static int ugen_open_pipe_write(struct usb2_fifo *);
|
||||
static int ugen_open_pipe_read(struct usb2_fifo *);
|
||||
static int ugen_set_config(struct usb2_fifo *, uint8_t);
|
||||
static int ugen_set_interface(struct usb2_fifo *, uint8_t, uint8_t);
|
||||
static int ugen_get_cdesc(struct usb2_fifo *, struct usb2_gen_descriptor *);
|
||||
static int ugen_get_sdesc(struct usb2_fifo *, struct usb2_gen_descriptor *);
|
||||
static int ugen_get_iface_driver(struct usb2_fifo *f, struct usb2_gen_descriptor *ugd);
|
||||
static int usb2_gen_fill_deviceinfo(struct usb2_fifo *,
|
||||
struct usb2_device_info *);
|
||||
static int ugen_re_enumerate(struct usb2_fifo *);
|
||||
static int ugen_iface_ioctl(struct usb2_fifo *, u_long, void *, int);
|
||||
static uint8_t ugen_fs_get_complete(struct usb2_fifo *, uint8_t *);
|
||||
static int ugen_fs_uninit(struct usb2_fifo *f);
|
||||
static int ugen_transfer_setup(struct usb_fifo *,
|
||||
const struct usb_config *, uint8_t);
|
||||
static int ugen_open_pipe_write(struct usb_fifo *);
|
||||
static int ugen_open_pipe_read(struct usb_fifo *);
|
||||
static int ugen_set_config(struct usb_fifo *, uint8_t);
|
||||
static int ugen_set_interface(struct usb_fifo *, uint8_t, uint8_t);
|
||||
static int ugen_get_cdesc(struct usb_fifo *, struct usb_gen_descriptor *);
|
||||
static int ugen_get_sdesc(struct usb_fifo *, struct usb_gen_descriptor *);
|
||||
static int ugen_get_iface_driver(struct usb_fifo *f, struct usb_gen_descriptor *ugd);
|
||||
static int usb2_gen_fill_deviceinfo(struct usb_fifo *,
|
||||
struct usb_device_info *);
|
||||
static int ugen_re_enumerate(struct usb_fifo *);
|
||||
static int ugen_iface_ioctl(struct usb_fifo *, u_long, void *, int);
|
||||
static uint8_t ugen_fs_get_complete(struct usb_fifo *, uint8_t *);
|
||||
static int ugen_fs_uninit(struct usb_fifo *f);
|
||||
|
||||
/* structures */
|
||||
|
||||
struct usb2_fifo_methods usb2_ugen_methods = {
|
||||
struct usb_fifo_methods usb2_ugen_methods = {
|
||||
.f_open = &ugen_open,
|
||||
.f_close = &ugen_close,
|
||||
.f_ioctl = &ugen_ioctl,
|
||||
@ -114,11 +114,11 @@ SYSCTL_INT(_hw_usb_ugen, OID_AUTO, debug, CTLFLAG_RW, &ugen_debug,
|
||||
/* prototypes */
|
||||
|
||||
static int
|
||||
ugen_transfer_setup(struct usb2_fifo *f,
|
||||
const struct usb2_config *setup, uint8_t n_setup)
|
||||
ugen_transfer_setup(struct usb_fifo *f,
|
||||
const struct usb_config *setup, uint8_t n_setup)
|
||||
{
|
||||
struct usb2_pipe *pipe = f->priv_sc0;
|
||||
struct usb2_device *udev = f->udev;
|
||||
struct usb_pipe *pipe = f->priv_sc0;
|
||||
struct usb_device *udev = f->udev;
|
||||
uint8_t iface_index = pipe->iface_index;
|
||||
int error;
|
||||
|
||||
@ -150,10 +150,10 @@ ugen_transfer_setup(struct usb2_fifo *f,
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_open(struct usb2_fifo *f, int fflags)
|
||||
ugen_open(struct usb_fifo *f, int fflags)
|
||||
{
|
||||
struct usb2_pipe *pipe = f->priv_sc0;
|
||||
struct usb2_endpoint_descriptor *ed = pipe->edesc;
|
||||
struct usb_pipe *pipe = f->priv_sc0;
|
||||
struct usb_endpoint_descriptor *ed = pipe->edesc;
|
||||
uint8_t type;
|
||||
|
||||
DPRINTFN(6, "flag=0x%x\n", fflags);
|
||||
@ -184,7 +184,7 @@ ugen_open(struct usb2_fifo *f, int fflags)
|
||||
}
|
||||
|
||||
static void
|
||||
ugen_close(struct usb2_fifo *f, int fflags)
|
||||
ugen_close(struct usb_fifo *f, int fflags)
|
||||
{
|
||||
DPRINTFN(6, "flag=0x%x\n", fflags);
|
||||
|
||||
@ -205,11 +205,11 @@ ugen_close(struct usb2_fifo *f, int fflags)
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_open_pipe_write(struct usb2_fifo *f)
|
||||
ugen_open_pipe_write(struct usb_fifo *f)
|
||||
{
|
||||
struct usb2_config usb2_config[2];
|
||||
struct usb2_pipe *pipe = f->priv_sc0;
|
||||
struct usb2_endpoint_descriptor *ed = pipe->edesc;
|
||||
struct usb_config usb_config[2];
|
||||
struct usb_pipe *pipe = f->priv_sc0;
|
||||
struct usb_endpoint_descriptor *ed = pipe->edesc;
|
||||
|
||||
mtx_assert(f->priv_mtx, MA_OWNED);
|
||||
|
||||
@ -217,35 +217,35 @@ ugen_open_pipe_write(struct usb2_fifo *f)
|
||||
/* transfers are already opened */
|
||||
return (0);
|
||||
}
|
||||
bzero(usb2_config, sizeof(usb2_config));
|
||||
bzero(usb_config, sizeof(usb_config));
|
||||
|
||||
usb2_config[1].type = UE_CONTROL;
|
||||
usb2_config[1].endpoint = 0;
|
||||
usb2_config[1].direction = UE_DIR_ANY;
|
||||
usb2_config[1].timeout = 1000; /* 1 second */
|
||||
usb2_config[1].interval = 50;/* 50 milliseconds */
|
||||
usb2_config[1].bufsize = sizeof(struct usb2_device_request);
|
||||
usb2_config[1].callback = &ugen_write_clear_stall_callback;
|
||||
usb2_config[1].usb_mode = USB_MODE_HOST;
|
||||
usb_config[1].type = UE_CONTROL;
|
||||
usb_config[1].endpoint = 0;
|
||||
usb_config[1].direction = UE_DIR_ANY;
|
||||
usb_config[1].timeout = 1000; /* 1 second */
|
||||
usb_config[1].interval = 50;/* 50 milliseconds */
|
||||
usb_config[1].bufsize = sizeof(struct usb_device_request);
|
||||
usb_config[1].callback = &ugen_write_clear_stall_callback;
|
||||
usb_config[1].usb_mode = USB_MODE_HOST;
|
||||
|
||||
usb2_config[0].type = ed->bmAttributes & UE_XFERTYPE;
|
||||
usb2_config[0].endpoint = ed->bEndpointAddress & UE_ADDR;
|
||||
usb2_config[0].direction = UE_DIR_TX;
|
||||
usb2_config[0].interval = USB_DEFAULT_INTERVAL;
|
||||
usb2_config[0].flags.proxy_buffer = 1;
|
||||
usb2_config[0].usb_mode = USB_MODE_DUAL; /* both modes */
|
||||
usb_config[0].type = ed->bmAttributes & UE_XFERTYPE;
|
||||
usb_config[0].endpoint = ed->bEndpointAddress & UE_ADDR;
|
||||
usb_config[0].direction = UE_DIR_TX;
|
||||
usb_config[0].interval = USB_DEFAULT_INTERVAL;
|
||||
usb_config[0].flags.proxy_buffer = 1;
|
||||
usb_config[0].usb_mode = USB_MODE_DUAL; /* both modes */
|
||||
|
||||
switch (ed->bmAttributes & UE_XFERTYPE) {
|
||||
case UE_INTERRUPT:
|
||||
case UE_BULK:
|
||||
if (f->flag_short) {
|
||||
usb2_config[0].flags.force_short_xfer = 1;
|
||||
usb_config[0].flags.force_short_xfer = 1;
|
||||
}
|
||||
usb2_config[0].callback = &ugen_default_write_callback;
|
||||
usb2_config[0].timeout = f->timeout;
|
||||
usb2_config[0].frames = 1;
|
||||
usb2_config[0].bufsize = f->bufsize;
|
||||
if (ugen_transfer_setup(f, usb2_config, 2)) {
|
||||
usb_config[0].callback = &ugen_default_write_callback;
|
||||
usb_config[0].timeout = f->timeout;
|
||||
usb_config[0].frames = 1;
|
||||
usb_config[0].bufsize = f->bufsize;
|
||||
if (ugen_transfer_setup(f, usb_config, 2)) {
|
||||
return (EIO);
|
||||
}
|
||||
/* first transfer does not clear stall */
|
||||
@ -253,16 +253,16 @@ ugen_open_pipe_write(struct usb2_fifo *f)
|
||||
break;
|
||||
|
||||
case UE_ISOCHRONOUS:
|
||||
usb2_config[0].flags.short_xfer_ok = 1;
|
||||
usb2_config[0].bufsize = 0; /* use default */
|
||||
usb2_config[0].frames = f->nframes;
|
||||
usb2_config[0].callback = &ugen_isoc_write_callback;
|
||||
usb2_config[0].timeout = 0;
|
||||
usb_config[0].flags.short_xfer_ok = 1;
|
||||
usb_config[0].bufsize = 0; /* use default */
|
||||
usb_config[0].frames = f->nframes;
|
||||
usb_config[0].callback = &ugen_isoc_write_callback;
|
||||
usb_config[0].timeout = 0;
|
||||
|
||||
/* clone configuration */
|
||||
usb2_config[1] = usb2_config[0];
|
||||
usb_config[1] = usb_config[0];
|
||||
|
||||
if (ugen_transfer_setup(f, usb2_config, 2)) {
|
||||
if (ugen_transfer_setup(f, usb_config, 2)) {
|
||||
return (EIO);
|
||||
}
|
||||
break;
|
||||
@ -273,11 +273,11 @@ ugen_open_pipe_write(struct usb2_fifo *f)
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_open_pipe_read(struct usb2_fifo *f)
|
||||
ugen_open_pipe_read(struct usb_fifo *f)
|
||||
{
|
||||
struct usb2_config usb2_config[2];
|
||||
struct usb2_pipe *pipe = f->priv_sc0;
|
||||
struct usb2_endpoint_descriptor *ed = pipe->edesc;
|
||||
struct usb_config usb_config[2];
|
||||
struct usb_pipe *pipe = f->priv_sc0;
|
||||
struct usb_endpoint_descriptor *ed = pipe->edesc;
|
||||
|
||||
mtx_assert(f->priv_mtx, MA_OWNED);
|
||||
|
||||
@ -285,36 +285,36 @@ ugen_open_pipe_read(struct usb2_fifo *f)
|
||||
/* transfers are already opened */
|
||||
return (0);
|
||||
}
|
||||
bzero(usb2_config, sizeof(usb2_config));
|
||||
bzero(usb_config, sizeof(usb_config));
|
||||
|
||||
usb2_config[1].type = UE_CONTROL;
|
||||
usb2_config[1].endpoint = 0;
|
||||
usb2_config[1].direction = UE_DIR_ANY;
|
||||
usb2_config[1].timeout = 1000; /* 1 second */
|
||||
usb2_config[1].interval = 50;/* 50 milliseconds */
|
||||
usb2_config[1].bufsize = sizeof(struct usb2_device_request);
|
||||
usb2_config[1].callback = &ugen_read_clear_stall_callback;
|
||||
usb2_config[1].usb_mode = USB_MODE_HOST;
|
||||
usb_config[1].type = UE_CONTROL;
|
||||
usb_config[1].endpoint = 0;
|
||||
usb_config[1].direction = UE_DIR_ANY;
|
||||
usb_config[1].timeout = 1000; /* 1 second */
|
||||
usb_config[1].interval = 50;/* 50 milliseconds */
|
||||
usb_config[1].bufsize = sizeof(struct usb_device_request);
|
||||
usb_config[1].callback = &ugen_read_clear_stall_callback;
|
||||
usb_config[1].usb_mode = USB_MODE_HOST;
|
||||
|
||||
usb2_config[0].type = ed->bmAttributes & UE_XFERTYPE;
|
||||
usb2_config[0].endpoint = ed->bEndpointAddress & UE_ADDR;
|
||||
usb2_config[0].direction = UE_DIR_RX;
|
||||
usb2_config[0].interval = USB_DEFAULT_INTERVAL;
|
||||
usb2_config[0].flags.proxy_buffer = 1;
|
||||
usb2_config[0].usb_mode = USB_MODE_DUAL; /* both modes */
|
||||
usb_config[0].type = ed->bmAttributes & UE_XFERTYPE;
|
||||
usb_config[0].endpoint = ed->bEndpointAddress & UE_ADDR;
|
||||
usb_config[0].direction = UE_DIR_RX;
|
||||
usb_config[0].interval = USB_DEFAULT_INTERVAL;
|
||||
usb_config[0].flags.proxy_buffer = 1;
|
||||
usb_config[0].usb_mode = USB_MODE_DUAL; /* both modes */
|
||||
|
||||
switch (ed->bmAttributes & UE_XFERTYPE) {
|
||||
case UE_INTERRUPT:
|
||||
case UE_BULK:
|
||||
if (f->flag_short) {
|
||||
usb2_config[0].flags.short_xfer_ok = 1;
|
||||
usb_config[0].flags.short_xfer_ok = 1;
|
||||
}
|
||||
usb2_config[0].timeout = f->timeout;
|
||||
usb2_config[0].frames = 1;
|
||||
usb2_config[0].callback = &ugen_default_read_callback;
|
||||
usb2_config[0].bufsize = f->bufsize;
|
||||
usb_config[0].timeout = f->timeout;
|
||||
usb_config[0].frames = 1;
|
||||
usb_config[0].callback = &ugen_default_read_callback;
|
||||
usb_config[0].bufsize = f->bufsize;
|
||||
|
||||
if (ugen_transfer_setup(f, usb2_config, 2)) {
|
||||
if (ugen_transfer_setup(f, usb_config, 2)) {
|
||||
return (EIO);
|
||||
}
|
||||
/* first transfer does not clear stall */
|
||||
@ -322,16 +322,16 @@ ugen_open_pipe_read(struct usb2_fifo *f)
|
||||
break;
|
||||
|
||||
case UE_ISOCHRONOUS:
|
||||
usb2_config[0].flags.short_xfer_ok = 1;
|
||||
usb2_config[0].bufsize = 0; /* use default */
|
||||
usb2_config[0].frames = f->nframes;
|
||||
usb2_config[0].callback = &ugen_isoc_read_callback;
|
||||
usb2_config[0].timeout = 0;
|
||||
usb_config[0].flags.short_xfer_ok = 1;
|
||||
usb_config[0].bufsize = 0; /* use default */
|
||||
usb_config[0].frames = f->nframes;
|
||||
usb_config[0].callback = &ugen_isoc_read_callback;
|
||||
usb_config[0].timeout = 0;
|
||||
|
||||
/* clone configuration */
|
||||
usb2_config[1] = usb2_config[0];
|
||||
usb_config[1] = usb_config[0];
|
||||
|
||||
if (ugen_transfer_setup(f, usb2_config, 2)) {
|
||||
if (ugen_transfer_setup(f, usb_config, 2)) {
|
||||
return (EIO);
|
||||
}
|
||||
break;
|
||||
@ -343,7 +343,7 @@ ugen_open_pipe_read(struct usb2_fifo *f)
|
||||
}
|
||||
|
||||
static void
|
||||
ugen_start_read(struct usb2_fifo *f)
|
||||
ugen_start_read(struct usb_fifo *f)
|
||||
{
|
||||
/* check that pipes are open */
|
||||
if (ugen_open_pipe_read(f)) {
|
||||
@ -356,7 +356,7 @@ ugen_start_read(struct usb2_fifo *f)
|
||||
}
|
||||
|
||||
static void
|
||||
ugen_start_write(struct usb2_fifo *f)
|
||||
ugen_start_write(struct usb_fifo *f)
|
||||
{
|
||||
/* check that pipes are open */
|
||||
if (ugen_open_pipe_write(f)) {
|
||||
@ -369,7 +369,7 @@ ugen_start_write(struct usb2_fifo *f)
|
||||
}
|
||||
|
||||
static void
|
||||
ugen_stop_io(struct usb2_fifo *f)
|
||||
ugen_stop_io(struct usb_fifo *f)
|
||||
{
|
||||
/* stop transfers */
|
||||
usb2_transfer_stop(f->xfer[0]);
|
||||
@ -377,10 +377,10 @@ ugen_stop_io(struct usb2_fifo *f)
|
||||
}
|
||||
|
||||
static void
|
||||
ugen_default_read_callback(struct usb2_xfer *xfer)
|
||||
ugen_default_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_fifo *f = xfer->priv_sc;
|
||||
struct usb2_mbuf *m;
|
||||
struct usb_fifo *f = xfer->priv_sc;
|
||||
struct usb_mbuf *m;
|
||||
|
||||
DPRINTFN(4, "actlen=%u, aframes=%u\n", xfer->actlen, xfer->aframes);
|
||||
|
||||
@ -429,9 +429,9 @@ ugen_default_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ugen_default_write_callback(struct usb2_xfer *xfer)
|
||||
ugen_default_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_fifo *f = xfer->priv_sc;
|
||||
struct usb_fifo *f = xfer->priv_sc;
|
||||
usb2_frlength_t actlen;
|
||||
|
||||
DPRINTFN(4, "actlen=%u, aframes=%u\n", xfer->actlen, xfer->aframes);
|
||||
@ -467,10 +467,10 @@ ugen_default_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ugen_read_clear_stall_callback(struct usb2_xfer *xfer)
|
||||
ugen_read_clear_stall_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_fifo *f = xfer->priv_sc;
|
||||
struct usb2_xfer *xfer_other = f->xfer[0];
|
||||
struct usb_fifo *f = xfer->priv_sc;
|
||||
struct usb_xfer *xfer_other = f->xfer[0];
|
||||
|
||||
if (f->flag_stall == 0) {
|
||||
/* nothing to do */
|
||||
@ -484,10 +484,10 @@ ugen_read_clear_stall_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ugen_write_clear_stall_callback(struct usb2_xfer *xfer)
|
||||
ugen_write_clear_stall_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_fifo *f = xfer->priv_sc;
|
||||
struct usb2_xfer *xfer_other = f->xfer[0];
|
||||
struct usb_fifo *f = xfer->priv_sc;
|
||||
struct usb_xfer *xfer_other = f->xfer[0];
|
||||
|
||||
if (f->flag_stall == 0) {
|
||||
/* nothing to do */
|
||||
@ -501,9 +501,9 @@ ugen_write_clear_stall_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ugen_isoc_read_callback(struct usb2_xfer *xfer)
|
||||
ugen_isoc_read_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_fifo *f = xfer->priv_sc;
|
||||
struct usb_fifo *f = xfer->priv_sc;
|
||||
usb2_frlength_t offset;
|
||||
usb2_frcount_t n;
|
||||
|
||||
@ -540,9 +540,9 @@ ugen_isoc_read_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static void
|
||||
ugen_isoc_write_callback(struct usb2_xfer *xfer)
|
||||
ugen_isoc_write_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_fifo *f = xfer->priv_sc;
|
||||
struct usb_fifo *f = xfer->priv_sc;
|
||||
usb2_frlength_t actlen;
|
||||
usb2_frlength_t offset;
|
||||
usb2_frcount_t n;
|
||||
@ -580,7 +580,7 @@ ugen_isoc_write_callback(struct usb2_xfer *xfer)
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_set_config(struct usb2_fifo *f, uint8_t index)
|
||||
ugen_set_config(struct usb_fifo *f, uint8_t index)
|
||||
{
|
||||
DPRINTFN(2, "index %u\n", index);
|
||||
|
||||
@ -610,7 +610,7 @@ ugen_set_config(struct usb2_fifo *f, uint8_t index)
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_set_interface(struct usb2_fifo *f,
|
||||
ugen_set_interface(struct usb_fifo *f,
|
||||
uint8_t iface_index, uint8_t alt_index)
|
||||
{
|
||||
DPRINTFN(2, "%u, %u\n", iface_index, alt_index);
|
||||
@ -643,10 +643,10 @@ ugen_set_interface(struct usb2_fifo *f,
|
||||
* at the given index.
|
||||
*------------------------------------------------------------------------*/
|
||||
static int
|
||||
ugen_get_cdesc(struct usb2_fifo *f, struct usb2_gen_descriptor *ugd)
|
||||
ugen_get_cdesc(struct usb_fifo *f, struct usb_gen_descriptor *ugd)
|
||||
{
|
||||
struct usb2_config_descriptor *cdesc;
|
||||
struct usb2_device *udev = f->udev;
|
||||
struct usb_config_descriptor *cdesc;
|
||||
struct usb_device *udev = f->udev;
|
||||
int error;
|
||||
uint16_t len;
|
||||
uint8_t free_data;
|
||||
@ -692,7 +692,7 @@ ugen_get_cdesc(struct usb2_fifo *f, struct usb2_gen_descriptor *ugd)
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_get_sdesc(struct usb2_fifo *f, struct usb2_gen_descriptor *ugd)
|
||||
ugen_get_sdesc(struct usb_fifo *f, struct usb_gen_descriptor *ugd)
|
||||
{
|
||||
void *ptr = f->udev->bus->scratch[0].data;
|
||||
uint16_t size = sizeof(f->udev->bus->scratch[0].data);
|
||||
@ -727,10 +727,10 @@ ugen_get_sdesc(struct usb2_fifo *f, struct usb2_gen_descriptor *ugd)
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static int
|
||||
ugen_get_iface_driver(struct usb2_fifo *f, struct usb2_gen_descriptor *ugd)
|
||||
ugen_get_iface_driver(struct usb_fifo *f, struct usb_gen_descriptor *ugd)
|
||||
{
|
||||
struct usb2_device *udev = f->udev;
|
||||
struct usb2_interface *iface;
|
||||
struct usb_device *udev = f->udev;
|
||||
struct usb_interface *iface;
|
||||
const char *ptr;
|
||||
const char *desc;
|
||||
unsigned int len;
|
||||
@ -789,10 +789,10 @@ ugen_get_iface_driver(struct usb2_fifo *f, struct usb2_gen_descriptor *ugd)
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static int
|
||||
usb2_gen_fill_deviceinfo(struct usb2_fifo *f, struct usb2_device_info *di)
|
||||
usb2_gen_fill_deviceinfo(struct usb_fifo *f, struct usb_device_info *di)
|
||||
{
|
||||
struct usb2_device *udev;
|
||||
struct usb2_device *hub;
|
||||
struct usb_device *udev;
|
||||
struct usb_device *hub;
|
||||
|
||||
udev = f->udev;
|
||||
|
||||
@ -837,9 +837,9 @@ usb2_gen_fill_deviceinfo(struct usb2_fifo *f, struct usb2_device_info *di)
|
||||
* Else: No access
|
||||
*------------------------------------------------------------------------*/
|
||||
static int
|
||||
ugen_check_request(struct usb2_device *udev, struct usb2_device_request *req)
|
||||
ugen_check_request(struct usb_device *udev, struct usb_device_request *req)
|
||||
{
|
||||
struct usb2_pipe *pipe;
|
||||
struct usb_pipe *pipe;
|
||||
int error;
|
||||
|
||||
/*
|
||||
@ -879,7 +879,7 @@ ugen_check_request(struct usb2_device *udev, struct usb2_device_request *req)
|
||||
}
|
||||
|
||||
int
|
||||
ugen_do_request(struct usb2_fifo *f, struct usb2_ctl_request *ur)
|
||||
ugen_do_request(struct usb_fifo *f, struct usb_ctl_request *ur)
|
||||
{
|
||||
int error;
|
||||
uint16_t len;
|
||||
@ -915,9 +915,9 @@ ugen_do_request(struct usb2_fifo *f, struct usb2_ctl_request *ur)
|
||||
* ugen_re_enumerate
|
||||
*------------------------------------------------------------------------*/
|
||||
static int
|
||||
ugen_re_enumerate(struct usb2_fifo *f)
|
||||
ugen_re_enumerate(struct usb_fifo *f)
|
||||
{
|
||||
struct usb2_device *udev = f->udev;
|
||||
struct usb_device *udev = f->udev;
|
||||
int error;
|
||||
|
||||
/*
|
||||
@ -949,7 +949,7 @@ ugen_re_enumerate(struct usb2_fifo *f)
|
||||
}
|
||||
|
||||
int
|
||||
ugen_fs_uninit(struct usb2_fifo *f)
|
||||
ugen_fs_uninit(struct usb_fifo *f)
|
||||
{
|
||||
if (f->fs_xfer == NULL) {
|
||||
return (EINVAL);
|
||||
@ -965,9 +965,9 @@ ugen_fs_uninit(struct usb2_fifo *f)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
ugen_fs_get_complete(struct usb2_fifo *f, uint8_t *pindex)
|
||||
ugen_fs_get_complete(struct usb_fifo *f, uint8_t *pindex)
|
||||
{
|
||||
struct usb2_mbuf *m;
|
||||
struct usb_mbuf *m;
|
||||
|
||||
USB_IF_DEQUEUE(&f->used_q, m);
|
||||
|
||||
@ -987,9 +987,9 @@ ugen_fs_get_complete(struct usb2_fifo *f, uint8_t *pindex)
|
||||
}
|
||||
|
||||
static void
|
||||
ugen_fs_set_complete(struct usb2_fifo *f, uint8_t index)
|
||||
ugen_fs_set_complete(struct usb_fifo *f, uint8_t index)
|
||||
{
|
||||
struct usb2_mbuf *m;
|
||||
struct usb_mbuf *m;
|
||||
|
||||
USB_IF_DEQUEUE(&f->free_q, m);
|
||||
|
||||
@ -1010,11 +1010,11 @@ ugen_fs_set_complete(struct usb2_fifo *f, uint8_t index)
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_fs_copy_in(struct usb2_fifo *f, uint8_t ep_index)
|
||||
ugen_fs_copy_in(struct usb_fifo *f, uint8_t ep_index)
|
||||
{
|
||||
struct usb2_device_request *req;
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb2_fs_endpoint fs_ep;
|
||||
struct usb_device_request *req;
|
||||
struct usb_xfer *xfer;
|
||||
struct usb_fs_endpoint fs_ep;
|
||||
void *uaddr; /* userland pointer */
|
||||
void *kaddr;
|
||||
usb2_frlength_t offset;
|
||||
@ -1186,12 +1186,12 @@ ugen_fs_copy_in(struct usb2_fifo *f, uint8_t ep_index)
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_fs_copy_out(struct usb2_fifo *f, uint8_t ep_index)
|
||||
ugen_fs_copy_out(struct usb_fifo *f, uint8_t ep_index)
|
||||
{
|
||||
struct usb2_device_request *req;
|
||||
struct usb2_xfer *xfer;
|
||||
struct usb2_fs_endpoint fs_ep;
|
||||
struct usb2_fs_endpoint *fs_ep_uptr; /* userland ptr */
|
||||
struct usb_device_request *req;
|
||||
struct usb_xfer *xfer;
|
||||
struct usb_fs_endpoint fs_ep;
|
||||
struct usb_fs_endpoint *fs_ep_uptr; /* userland ptr */
|
||||
void *uaddr; /* userland ptr */
|
||||
void *kaddr;
|
||||
usb2_frlength_t offset;
|
||||
@ -1339,10 +1339,10 @@ ugen_fs_copy_out(struct usb2_fifo *f, uint8_t ep_index)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
ugen_fifo_in_use(struct usb2_fifo *f, int fflags)
|
||||
ugen_fifo_in_use(struct usb_fifo *f, int fflags)
|
||||
{
|
||||
struct usb2_fifo *f_rx;
|
||||
struct usb2_fifo *f_tx;
|
||||
struct usb_fifo *f_rx;
|
||||
struct usb_fifo *f_tx;
|
||||
|
||||
f_rx = f->udev->fifo[(f->fifo_index & ~1) + USB_FIFO_RX];
|
||||
f_tx = f->udev->fifo[(f->fifo_index & ~1) + USB_FIFO_TX];
|
||||
@ -1359,21 +1359,21 @@ ugen_fifo_in_use(struct usb2_fifo *f, int fflags)
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_ioctl(struct usb2_fifo *f, u_long cmd, void *addr, int fflags)
|
||||
ugen_ioctl(struct usb_fifo *f, u_long cmd, void *addr, int fflags)
|
||||
{
|
||||
struct usb2_config usb2_config[1];
|
||||
struct usb2_device_request req;
|
||||
struct usb_config usb_config[1];
|
||||
struct usb_device_request req;
|
||||
union {
|
||||
struct usb2_fs_complete *pcomp;
|
||||
struct usb2_fs_start *pstart;
|
||||
struct usb2_fs_stop *pstop;
|
||||
struct usb2_fs_open *popen;
|
||||
struct usb2_fs_close *pclose;
|
||||
struct usb2_fs_clear_stall_sync *pstall;
|
||||
struct usb_fs_complete *pcomp;
|
||||
struct usb_fs_start *pstart;
|
||||
struct usb_fs_stop *pstop;
|
||||
struct usb_fs_open *popen;
|
||||
struct usb_fs_close *pclose;
|
||||
struct usb_fs_clear_stall_sync *pstall;
|
||||
void *addr;
|
||||
} u;
|
||||
struct usb2_pipe *pipe;
|
||||
struct usb2_endpoint_descriptor *ed;
|
||||
struct usb_pipe *pipe;
|
||||
struct usb_endpoint_descriptor *ed;
|
||||
int error = 0;
|
||||
uint8_t iface_index;
|
||||
uint8_t isread;
|
||||
@ -1449,27 +1449,27 @@ ugen_ioctl(struct usb2_fifo *f, u_long cmd, void *addr, int fflags)
|
||||
}
|
||||
iface_index = pipe->iface_index;
|
||||
|
||||
bzero(usb2_config, sizeof(usb2_config));
|
||||
bzero(usb_config, sizeof(usb_config));
|
||||
|
||||
usb2_config[0].type = ed->bmAttributes & UE_XFERTYPE;
|
||||
usb2_config[0].endpoint = ed->bEndpointAddress & UE_ADDR;
|
||||
usb2_config[0].direction = ed->bEndpointAddress & (UE_DIR_OUT | UE_DIR_IN);
|
||||
usb2_config[0].interval = USB_DEFAULT_INTERVAL;
|
||||
usb2_config[0].flags.proxy_buffer = 1;
|
||||
usb2_config[0].callback = &ugen_default_fs_callback;
|
||||
usb2_config[0].timeout = 0; /* no timeout */
|
||||
usb2_config[0].frames = u.popen->max_frames;
|
||||
usb2_config[0].bufsize = u.popen->max_bufsize;
|
||||
usb2_config[0].usb_mode = USB_MODE_DUAL; /* both modes */
|
||||
usb_config[0].type = ed->bmAttributes & UE_XFERTYPE;
|
||||
usb_config[0].endpoint = ed->bEndpointAddress & UE_ADDR;
|
||||
usb_config[0].direction = ed->bEndpointAddress & (UE_DIR_OUT | UE_DIR_IN);
|
||||
usb_config[0].interval = USB_DEFAULT_INTERVAL;
|
||||
usb_config[0].flags.proxy_buffer = 1;
|
||||
usb_config[0].callback = &ugen_default_fs_callback;
|
||||
usb_config[0].timeout = 0; /* no timeout */
|
||||
usb_config[0].frames = u.popen->max_frames;
|
||||
usb_config[0].bufsize = u.popen->max_bufsize;
|
||||
usb_config[0].usb_mode = USB_MODE_DUAL; /* both modes */
|
||||
|
||||
if (usb2_config[0].type == UE_CONTROL) {
|
||||
if (usb_config[0].type == UE_CONTROL) {
|
||||
if (f->udev->flags.usb_mode != USB_MODE_HOST) {
|
||||
error = EINVAL;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
isread = ((usb2_config[0].endpoint &
|
||||
isread = ((usb_config[0].endpoint &
|
||||
(UE_DIR_IN | UE_DIR_OUT)) == UE_DIR_IN);
|
||||
|
||||
if (f->udev->flags.usb_mode != USB_MODE_HOST) {
|
||||
@ -1489,7 +1489,7 @@ ugen_ioctl(struct usb2_fifo *f, u_long cmd, void *addr, int fflags)
|
||||
}
|
||||
}
|
||||
error = usb2_transfer_setup(f->udev, &iface_index,
|
||||
f->fs_xfer + u.popen->ep_index, usb2_config, 1,
|
||||
f->fs_xfer + u.popen->ep_index, usb_config, 1,
|
||||
f, f->priv_mtx);
|
||||
if (error == 0) {
|
||||
/* update maximums */
|
||||
@ -1565,7 +1565,7 @@ ugen_ioctl(struct usb2_fifo *f, u_long cmd, void *addr, int fflags)
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_set_short_xfer(struct usb2_fifo *f, void *addr)
|
||||
ugen_set_short_xfer(struct usb_fifo *f, void *addr)
|
||||
{
|
||||
uint8_t t;
|
||||
|
||||
@ -1587,7 +1587,7 @@ ugen_set_short_xfer(struct usb2_fifo *f, void *addr)
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_set_timeout(struct usb2_fifo *f, void *addr)
|
||||
ugen_set_timeout(struct usb_fifo *f, void *addr)
|
||||
{
|
||||
f->timeout = *(int *)addr;
|
||||
if (f->timeout > 65535) {
|
||||
@ -1598,7 +1598,7 @@ ugen_set_timeout(struct usb2_fifo *f, void *addr)
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_get_frame_size(struct usb2_fifo *f, void *addr)
|
||||
ugen_get_frame_size(struct usb_fifo *f, void *addr)
|
||||
{
|
||||
if (f->xfer[0]) {
|
||||
*(int *)addr = f->xfer[0]->max_frame_size;
|
||||
@ -1609,7 +1609,7 @@ ugen_get_frame_size(struct usb2_fifo *f, void *addr)
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_set_buffer_size(struct usb2_fifo *f, void *addr)
|
||||
ugen_set_buffer_size(struct usb_fifo *f, void *addr)
|
||||
{
|
||||
usb2_frlength_t t;
|
||||
|
||||
@ -1633,17 +1633,17 @@ ugen_set_buffer_size(struct usb2_fifo *f, void *addr)
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_get_buffer_size(struct usb2_fifo *f, void *addr)
|
||||
ugen_get_buffer_size(struct usb_fifo *f, void *addr)
|
||||
{
|
||||
*(int *)addr = f->bufsize;
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_get_iface_desc(struct usb2_fifo *f,
|
||||
struct usb2_interface_descriptor *idesc)
|
||||
ugen_get_iface_desc(struct usb_fifo *f,
|
||||
struct usb_interface_descriptor *idesc)
|
||||
{
|
||||
struct usb2_interface *iface;
|
||||
struct usb_interface *iface;
|
||||
|
||||
iface = usb2_get_iface(f->udev, f->iface_index);
|
||||
if (iface && iface->idesc) {
|
||||
@ -1655,10 +1655,10 @@ ugen_get_iface_desc(struct usb2_fifo *f,
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_get_endpoint_desc(struct usb2_fifo *f,
|
||||
struct usb2_endpoint_descriptor *ed)
|
||||
ugen_get_endpoint_desc(struct usb_fifo *f,
|
||||
struct usb_endpoint_descriptor *ed)
|
||||
{
|
||||
struct usb2_pipe *pipe;
|
||||
struct usb_pipe *pipe;
|
||||
|
||||
pipe = f->priv_sc0;
|
||||
|
||||
@ -1671,9 +1671,9 @@ ugen_get_endpoint_desc(struct usb2_fifo *f,
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_set_power_mode(struct usb2_fifo *f, int mode)
|
||||
ugen_set_power_mode(struct usb_fifo *f, int mode)
|
||||
{
|
||||
struct usb2_device *udev = f->udev;
|
||||
struct usb_device *udev = f->udev;
|
||||
int err;
|
||||
uint8_t old_mode;
|
||||
|
||||
@ -1743,9 +1743,9 @@ ugen_set_power_mode(struct usb2_fifo *f, int mode)
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_get_power_mode(struct usb2_fifo *f)
|
||||
ugen_get_power_mode(struct usb_fifo *f)
|
||||
{
|
||||
struct usb2_device *udev = f->udev;
|
||||
struct usb_device *udev = f->udev;
|
||||
|
||||
if ((udev == NULL) ||
|
||||
(udev->parent_hub == NULL)) {
|
||||
@ -1755,11 +1755,11 @@ ugen_get_power_mode(struct usb2_fifo *f)
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_do_port_feature(struct usb2_fifo *f, uint8_t port_no,
|
||||
ugen_do_port_feature(struct usb_fifo *f, uint8_t port_no,
|
||||
uint8_t set, uint16_t feature)
|
||||
{
|
||||
struct usb2_device *udev = f->udev;
|
||||
struct usb2_hub *hub;
|
||||
struct usb_device *udev = f->udev;
|
||||
struct usb_hub *hub;
|
||||
int err;
|
||||
|
||||
err = priv_check(curthread, PRIV_DRIVER);
|
||||
@ -1792,10 +1792,10 @@ ugen_do_port_feature(struct usb2_fifo *f, uint8_t port_no,
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_iface_ioctl(struct usb2_fifo *f, u_long cmd, void *addr, int fflags)
|
||||
ugen_iface_ioctl(struct usb_fifo *f, u_long cmd, void *addr, int fflags)
|
||||
{
|
||||
struct usb2_fifo *f_rx;
|
||||
struct usb2_fifo *f_tx;
|
||||
struct usb_fifo *f_rx;
|
||||
struct usb_fifo *f_tx;
|
||||
int error = 0;
|
||||
|
||||
f_rx = f->udev->fifo[(f->fifo_index & ~1) + USB_FIFO_RX];
|
||||
@ -1934,23 +1934,23 @@ ugen_iface_ioctl(struct usb2_fifo *f, u_long cmd, void *addr, int fflags)
|
||||
}
|
||||
|
||||
static int
|
||||
ugen_ioctl_post(struct usb2_fifo *f, u_long cmd, void *addr, int fflags)
|
||||
ugen_ioctl_post(struct usb_fifo *f, u_long cmd, void *addr, int fflags)
|
||||
{
|
||||
union {
|
||||
struct usb2_interface_descriptor *idesc;
|
||||
struct usb2_alt_interface *ai;
|
||||
struct usb2_device_descriptor *ddesc;
|
||||
struct usb2_config_descriptor *cdesc;
|
||||
struct usb2_device_stats *stat;
|
||||
struct usb2_fs_init *pinit;
|
||||
struct usb2_fs_uninit *puninit;
|
||||
struct usb_interface_descriptor *idesc;
|
||||
struct usb_alt_interface *ai;
|
||||
struct usb_device_descriptor *ddesc;
|
||||
struct usb_config_descriptor *cdesc;
|
||||
struct usb_device_stats *stat;
|
||||
struct usb_fs_init *pinit;
|
||||
struct usb_fs_uninit *puninit;
|
||||
uint32_t *ptime;
|
||||
void *addr;
|
||||
int *pint;
|
||||
} u;
|
||||
struct usb2_device_descriptor *dtemp;
|
||||
struct usb2_config_descriptor *ctemp;
|
||||
struct usb2_interface *iface;
|
||||
struct usb_device_descriptor *dtemp;
|
||||
struct usb_config_descriptor *ctemp;
|
||||
struct usb_interface *iface;
|
||||
int error = 0;
|
||||
uint8_t n;
|
||||
|
||||
@ -2162,7 +2162,7 @@ ugen_ioctl_post(struct usb2_fifo *f, u_long cmd, void *addr, int fflags)
|
||||
}
|
||||
|
||||
static void
|
||||
ugen_default_fs_callback(struct usb2_xfer *xfer)
|
||||
ugen_default_fs_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
; /* workaround for a bug in "indent" */
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
#ifndef _USB2_GENERIC_H_
|
||||
#define _USB2_GENERIC_H_
|
||||
|
||||
extern struct usb2_fifo_methods usb2_ugen_methods;
|
||||
int ugen_do_request(struct usb2_fifo *f, struct usb2_ctl_request *ur);
|
||||
extern struct usb_fifo_methods usb2_ugen_methods;
|
||||
int ugen_do_request(struct usb_fifo *f, struct usb_ctl_request *ur);
|
||||
|
||||
#endif /* _USB2_GENERIC_H_ */
|
||||
|
@ -51,14 +51,14 @@ enum {
|
||||
|
||||
/* function prototypes */
|
||||
|
||||
static uint8_t usb2_handle_get_stall(struct usb2_device *, uint8_t);
|
||||
static usb2_error_t usb2_handle_remote_wakeup(struct usb2_xfer *, uint8_t);
|
||||
static usb2_error_t usb2_handle_request(struct usb2_xfer *);
|
||||
static usb2_error_t usb2_handle_set_config(struct usb2_xfer *, uint8_t);
|
||||
static usb2_error_t usb2_handle_set_stall(struct usb2_xfer *, uint8_t,
|
||||
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,
|
||||
uint8_t);
|
||||
static usb2_error_t usb2_handle_iface_request(struct usb2_xfer *, void **,
|
||||
uint16_t *, struct usb2_device_request, uint16_t,
|
||||
static usb2_error_t usb2_handle_iface_request(struct usb_xfer *, void **,
|
||||
uint16_t *, struct usb_device_request, uint16_t,
|
||||
uint8_t);
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
@ -68,7 +68,7 @@ static usb2_error_t usb2_handle_iface_request(struct usb2_xfer *, void **,
|
||||
* transfers.
|
||||
*------------------------------------------------------------------------*/
|
||||
void
|
||||
usb2_handle_request_callback(struct usb2_xfer *xfer)
|
||||
usb2_handle_request_callback(struct usb_xfer *xfer)
|
||||
{
|
||||
usb2_error_t err;
|
||||
|
||||
@ -107,7 +107,7 @@ usb2_handle_request_callback(struct usb2_xfer *xfer)
|
||||
return;
|
||||
|
||||
tr_restart:
|
||||
xfer->frlengths[0] = sizeof(struct usb2_device_request);
|
||||
xfer->frlengths[0] = sizeof(struct usb_device_request);
|
||||
xfer->nframes = 1;
|
||||
xfer->flags.manual_status = 1;
|
||||
xfer->flags.force_short_xfer = 0;
|
||||
@ -123,9 +123,9 @@ usb2_handle_request_callback(struct usb2_xfer *xfer)
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
usb2_handle_set_config(struct usb2_xfer *xfer, uint8_t conf_no)
|
||||
usb2_handle_set_config(struct usb_xfer *xfer, uint8_t conf_no)
|
||||
{
|
||||
struct usb2_device *udev = xfer->xroot->udev;
|
||||
struct usb_device *udev = xfer->xroot->udev;
|
||||
usb2_error_t err = 0;
|
||||
|
||||
/*
|
||||
@ -171,13 +171,13 @@ usb2_handle_set_config(struct usb2_xfer *xfer, uint8_t conf_no)
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
usb2_handle_iface_request(struct usb2_xfer *xfer,
|
||||
usb2_handle_iface_request(struct usb_xfer *xfer,
|
||||
void **ppdata, uint16_t *plen,
|
||||
struct usb2_device_request req, uint16_t off, uint8_t state)
|
||||
struct usb_device_request req, uint16_t off, uint8_t state)
|
||||
{
|
||||
struct usb2_interface *iface;
|
||||
struct usb2_interface *iface_parent; /* parent interface */
|
||||
struct usb2_device *udev = xfer->xroot->udev;
|
||||
struct usb_interface *iface;
|
||||
struct usb_interface *iface_parent; /* parent interface */
|
||||
struct usb_device *udev = xfer->xroot->udev;
|
||||
int error;
|
||||
uint8_t iface_index;
|
||||
|
||||
@ -334,9 +334,9 @@ usb2_handle_iface_request(struct usb2_xfer *xfer,
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
usb2_handle_set_stall(struct usb2_xfer *xfer, uint8_t ep, uint8_t do_stall)
|
||||
usb2_handle_set_stall(struct usb_xfer *xfer, uint8_t ep, uint8_t do_stall)
|
||||
{
|
||||
struct usb2_device *udev = xfer->xroot->udev;
|
||||
struct usb_device *udev = xfer->xroot->udev;
|
||||
usb2_error_t err;
|
||||
|
||||
USB_XFER_UNLOCK(xfer);
|
||||
@ -354,9 +354,9 @@ usb2_handle_set_stall(struct usb2_xfer *xfer, uint8_t ep, uint8_t do_stall)
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static uint8_t
|
||||
usb2_handle_get_stall(struct usb2_device *udev, uint8_t ea_val)
|
||||
usb2_handle_get_stall(struct usb_device *udev, uint8_t ea_val)
|
||||
{
|
||||
struct usb2_pipe *pipe;
|
||||
struct usb_pipe *pipe;
|
||||
uint8_t halted;
|
||||
|
||||
pipe = usb2_get_pipe_by_addr(udev, ea_val);
|
||||
@ -379,10 +379,10 @@ usb2_handle_get_stall(struct usb2_device *udev, uint8_t ea_val)
|
||||
* Else: Failure
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
usb2_handle_remote_wakeup(struct usb2_xfer *xfer, uint8_t is_on)
|
||||
usb2_handle_remote_wakeup(struct usb_xfer *xfer, uint8_t is_on)
|
||||
{
|
||||
struct usb2_device *udev;
|
||||
struct usb2_bus *bus;
|
||||
struct usb_device *udev;
|
||||
struct usb_bus *bus;
|
||||
|
||||
udev = xfer->xroot->udev;
|
||||
bus = udev->bus;
|
||||
@ -414,10 +414,10 @@ usb2_handle_remote_wakeup(struct usb2_xfer *xfer, uint8_t is_on)
|
||||
* Else: Stall current transfer, if any
|
||||
*------------------------------------------------------------------------*/
|
||||
static usb2_error_t
|
||||
usb2_handle_request(struct usb2_xfer *xfer)
|
||||
usb2_handle_request(struct usb_xfer *xfer)
|
||||
{
|
||||
struct usb2_device_request req;
|
||||
struct usb2_device *udev;
|
||||
struct usb_device_request req;
|
||||
struct usb_device *udev;
|
||||
const void *src_zcopy; /* zero-copy source pointer */
|
||||
const void *src_mcopy; /* non zero-copy source pointer */
|
||||
uint16_t off; /* data offset */
|
||||
|
@ -650,11 +650,11 @@ hid_is_collection(const void *desc, usb2_size_t size, uint32_t usage)
|
||||
* NULL: No more HID descriptors.
|
||||
* Else: Pointer to HID descriptor.
|
||||
*------------------------------------------------------------------------*/
|
||||
struct usb2_hid_descriptor *
|
||||
hid_get_descriptor_from_usb(struct usb2_config_descriptor *cd,
|
||||
struct usb2_interface_descriptor *id)
|
||||
struct usb_hid_descriptor *
|
||||
hid_get_descriptor_from_usb(struct usb_config_descriptor *cd,
|
||||
struct usb_interface_descriptor *id)
|
||||
{
|
||||
struct usb2_descriptor *desc = (void *)id;
|
||||
struct usb_descriptor *desc = (void *)id;
|
||||
|
||||
if (desc == NULL) {
|
||||
return (NULL);
|
||||
@ -682,12 +682,12 @@ hid_get_descriptor_from_usb(struct usb2_config_descriptor *cd,
|
||||
* Else: Success. The pointer should eventually be passed to free().
|
||||
*------------------------------------------------------------------------*/
|
||||
usb2_error_t
|
||||
usb2_req_get_hid_desc(struct usb2_device *udev, struct mtx *mtx,
|
||||
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 usb2_interface *iface = usb2_get_iface(udev, iface_index);
|
||||
struct usb2_hid_descriptor *hid;
|
||||
struct usb_interface *iface = usb2_get_iface(udev, iface_index);
|
||||
struct usb_hid_descriptor *hid;
|
||||
usb2_error_t err;
|
||||
|
||||
if ((iface == NULL) || (iface->idesc == NULL)) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user