The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/emulation/ndis/usbd_var.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright (c) 2003
    3  *      Bill Paul <wpaul@windriver.com>.  All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  * 1. Redistributions of source code must retain the above copyright
    9  *    notice, this list of conditions and the following disclaimer.
   10  * 2. Redistributions in binary form must reproduce the above copyright
   11  *    notice, this list of conditions and the following disclaimer in the
   12  *    documentation and/or other materials provided with the distribution.
   13  * 3. All advertising materials mentioning features or use of this software
   14  *    must display the following acknowledgement:
   15  *      This product includes software developed by Bill Paul.
   16  * 4. Neither the name of the author nor the names of any co-contributors
   17  *    may be used to endorse or promote products derived from this software
   18  *    without specific prior written permission.
   19  *
   20  * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
   21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   23  * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
   24  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
   30  * THE POSSIBILITY OF SUCH DAMAGE.
   31  *
   32  * $FreeBSD: src/sys/compat/ndis/usbd_var.h,v 1.2 2008/12/27 08:03:32 weongyo Exp $
   33  */
   34 
   35 #ifndef _USBD_VAR_H_
   36 #define _USBD_VAR_H_
   37 
   38 #define IOCTL_INTERNAL_USB_SUBMIT_URB                   0x00220003
   39 
   40 #define URB_FUNCTION_SELECT_CONFIGURATION               0x0000
   41 #define URB_FUNCTION_ABORT_PIPE                         0x0002
   42 #define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER         0x0009
   43 #define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE         0x000B
   44 #define URB_FUNCTION_VENDOR_DEVICE                      0x0017
   45 #define URB_FUNCTION_VENDOR_INTERFACE                   0x0018
   46 #define URB_FUNCTION_VENDOR_ENDPOINT                    0x0019
   47 #define URB_FUNCTION_CLASS_DEVICE                       0x001A
   48 #define URB_FUNCTION_CLASS_INTERFACE                    0x001B
   49 #define URB_FUNCTION_CLASS_ENDPOINT                     0x001C
   50 #define URB_FUNCTION_CLASS_OTHER                        0x001F
   51 #define URB_FUNCTION_VENDOR_OTHER                       0x0020
   52 
   53 #define USBD_STATUS_SUCCESS                             0x00000000
   54 #define USBD_STATUS_CANCELED                            0x00010000
   55 #define USBD_STATUS_PENDING                             0x40000000
   56 #define USBD_STATUS_NO_MEMORY                           0x80000100
   57 #define USBD_STATUS_REQUEST_FAILED                      0x80000500
   58 #define USBD_STATUS_INVALID_PIPE_HANDLE                 0x80000600
   59 #define USBD_STATUS_ERROR_SHORT_TRANSFER                0x80000900
   60 #define USBD_STATUS_CRC                                 0xC0000001
   61 #define USBD_STATUS_BTSTUFF                             0xC0000002
   62 #define USBD_STATUS_DATA_TOGGLE_MISMATCH                0xC0000003
   63 #define USBD_STATUS_STALL_PID                           0xC0000004
   64 #define USBD_STATUS_DEV_NOT_RESPONDING                  0xC0000005
   65 #define USBD_STATUS_PID_CHECK_FAILURE                   0xC0000006
   66 #define USBD_STATUS_UNEXPECTED_PID                      0xC0000007
   67 #define USBD_STATUS_DATA_OVERRUN                        0xC0000008
   68 #define USBD_STATUS_DATA_UNDERRUN                       0xC0000009
   69 #define USBD_STATUS_RESERVED1                           0xC000000A
   70 #define USBD_STATUS_RESERVED2                           0xC000000B
   71 #define USBD_STATUS_BUFFER_OVERRUN                      0xC000000C
   72 #define USBD_STATUS_BUFFER_UNDERRUN                     0xC000000D
   73 #define USBD_STATUS_NOT_ACCESSED                        0xC000000F
   74 #define USBD_STATUS_FIFO                                0xC0000010
   75 #define USBD_STATUS_XACT_ERROR                          0xC0000011
   76 #define USBD_STATUS_BABBLE_DETECTED                     0xC0000012
   77 #define USBD_STATUS_DATA_BUFFER_ERROR                   0xC0000013
   78 #define USBD_STATUS_NOT_SUPPORTED                       0xC0000E00
   79 #define USBD_STATUS_TIMEOUT                             0xC0006000
   80 #define USBD_STATUS_DEVICE_GONE                         0xC0007000
   81 
   82 struct usbd_urb_header {
   83         uint16_t                uuh_len;
   84         uint16_t                uuh_func;
   85         int32_t                 uuh_status;
   86         void                    *uuh_handle;
   87         uint32_t                uuh_flags;
   88 };
   89 
   90 enum usbd_pipe_type {
   91         UsbdPipeTypeControl     = UE_CONTROL,
   92         UsbdPipeTypeIsochronous = UE_ISOCHRONOUS,
   93         UsbdPipeTypeBulk        = UE_BULK,
   94         UsbdPipeTypeInterrupt   = UE_INTERRUPT
   95 };
   96 
   97 struct usbd_pipe_information {
   98         uint16_t                upi_maxpktsize;
   99         uint8_t                 upi_epaddr;
  100         uint8_t                 upi_interval;
  101         enum usbd_pipe_type     upi_type;
  102         usb_endpoint_descriptor_t *upi_handle;
  103         uint32_t                upi_maxtxsize;
  104 #define USBD_DEFAULT_MAXIMUM_TRANSFER_SIZE              PAGE_SIZE
  105         uint32_t                upi_flags;
  106 };
  107 
  108 struct usbd_interface_information {
  109         uint16_t                uii_len;
  110         uint8_t                 uii_intfnum;
  111         uint8_t                 uii_altset;
  112         uint8_t                 uii_intfclass;
  113         uint8_t                 uii_intfsubclass;
  114         uint8_t                 uii_intfproto;
  115         uint8_t                 uii_reserved;
  116         void                    *uii_handle;
  117         uint32_t                uii_numeps;
  118         struct usbd_pipe_information uii_pipes[1];
  119 };
  120 
  121 struct usbd_urb_select_interface {
  122         struct usbd_urb_header  usi_hdr;
  123         void                    *usi_handle;
  124         struct usbd_interface_information uusi_intf;
  125 };
  126 
  127 struct usbd_urb_select_configuration {
  128         struct usbd_urb_header  usc_hdr;
  129         usb_config_descriptor_t *usc_conf;
  130         void                    *usc_handle;
  131         struct usbd_interface_information usc_intf;
  132 };
  133 
  134 struct usbd_hcd_area {
  135         void                    *reserved8[8];
  136 };
  137 
  138 struct usbd_urb_bulk_or_intr_transfer {
  139         struct usbd_urb_header  ubi_hdr;
  140         usb_endpoint_descriptor_t *ubi_epdesc;
  141         uint32_t                ubi_trans_flags;
  142 #define USBD_SHORT_TRANSFER_OK          0x00000002
  143         uint32_t                ubi_trans_buflen;
  144         void                    *ubi_trans_buf;
  145         struct mdl              *ubi_mdl;
  146         union usbd_urb          *ubi_urblink;
  147         struct usbd_hcd_area    ubi_hca;
  148 };
  149 
  150 struct usbd_urb_control_descriptor_request {
  151         struct usbd_urb_header  ucd_hdr;
  152         void                    *ucd_reserved0;
  153         uint32_t                ucd_reserved1;
  154         uint32_t                ucd_trans_buflen;
  155         void                    *ucd_trans_buf;
  156         struct mdl              *ucd_mdl;
  157         union nt_urb            *ucd_urblink;
  158         struct usbd_hcd_area    ucd_hca;
  159         uint16_t                ucd_reserved2;
  160         uint8_t                 ucd_idx;
  161         uint8_t                 ucd_desctype;
  162         uint16_t                ucd_langid;
  163         uint16_t                ucd_reserved3;
  164 };
  165 
  166 struct usbd_urb_vendor_or_class_request {
  167         struct usbd_urb_header  uvc_hdr;
  168         void                    *uvc_reserved0;
  169         uint32_t                uvc_trans_flags;
  170 #define USBD_TRANSFER_DIRECTION_IN      1
  171         uint32_t                uvc_trans_buflen;
  172         void                    *uvc_trans_buf;
  173         struct mdl              *uvc_mdl;
  174         union nt_urb            *uvc_urblink;
  175         struct usbd_hcd_area    uvc_hca;
  176         uint8_t                 uvc_reserved1;
  177         uint8_t                 uvc_req;
  178         uint16_t                uvc_value;
  179         uint16_t                uvc_idx;
  180         uint16_t                uvc_reserved2;
  181 };
  182 
  183 struct usbd_interface_list_entry {
  184         usb_interface_descriptor_t              *uil_intfdesc;
  185         struct usbd_interface_information       *uil_intf;
  186 };
  187 
  188 union usbd_urb {
  189         struct usbd_urb_header                  uu_hdr;
  190         struct usbd_urb_select_configuration    uu_selconf;
  191         struct usbd_urb_bulk_or_intr_transfer   uu_bulkintr;
  192         struct usbd_urb_control_descriptor_request      uu_ctldesc;
  193         struct usbd_urb_vendor_or_class_request uu_vcreq;
  194 };
  195 
  196 #define USBD_URB_STATUS(urb)    ((urb)->uu_hdr.uuh_status)
  197 
  198 #define USBDI_VERSION           0x00000500
  199 #define USB_VER_1_1             0x00000110
  200 #define USB_VER_2_0             0x00000200
  201 
  202 struct usbd_version_info {
  203         uint32_t                uvi_usbdi_vers;
  204         uint32_t                uvi_supported_vers;
  205 };
  206 
  207 typedef struct usbd_version_info usbd_version_info;
  208 
  209 /* used for IRP cancel.  */
  210 struct ndisusb_cancel {
  211         device_t                dev;
  212         usbd_xfer_handle        xfer;
  213         struct usb_task         task;
  214 };
  215 
  216 extern image_patch_table usbd_functbl[];
  217 
  218 __BEGIN_DECLS
  219 extern int usbd_libinit(void);
  220 extern int usbd_libfini(void);
  221 __END_DECLS
  222 
  223 #endif /* _USBD_VAR_H_ */

Cache object: 003a2c4ddca29cfd2046d5fde7ed51f5


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.