1/*- 2 * Copyright (c) 1990, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from the Stanford/CMU enet packet filter, 6 * (net/enet.c) distributed as part of 4.3BSD, and code contributed 7 * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence 8 * Berkeley Laboratory. --- 17 unchanged lines hidden (view full) --- 26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * |
34 * $FreeBSD: head/sys/dev/usb/usb_pf.h 218165 2011-02-01 10:25:48Z hselasky $ |
35 */ 36 37#ifndef _DEV_USB_PF_H 38#define _DEV_USB_PF_H 39 40struct usbpf_pkthdr { |
41 uint32_t up_busunit; /* Host controller unit number */ 42 uint8_t up_address; /* USB device address */ 43 uint8_t up_endpoint; /* USB endpoint */ 44 uint8_t up_type; /* points SUBMIT / DONE */ 45 uint8_t up_xfertype; /* Transfer type */ 46 uint32_t up_flags; /* Transfer flags */ |
47#define USBPF_FLAG_FORCE_SHORT_XFER (1 << 0) 48#define USBPF_FLAG_SHORT_XFER_OK (1 << 1) 49#define USBPF_FLAG_SHORT_FRAMES_OK (1 << 2) 50#define USBPF_FLAG_PIPE_BOF (1 << 3) 51#define USBPF_FLAG_PROXY_BUFFER (1 << 4) 52#define USBPF_FLAG_EXT_BUFFER (1 << 5) 53#define USBPF_FLAG_MANUAL_STATUS (1 << 6) 54#define USBPF_FLAG_NO_PIPE_OK (1 << 7) 55#define USBPF_FLAG_STALL_PIPE (1 << 8) |
56 uint32_t up_status; /* Transfer status */ |
57#define USBPF_STATUS_OPEN (1 << 0) 58#define USBPF_STATUS_TRANSFERRING (1 << 1) 59#define USBPF_STATUS_DID_DMA_DELAY (1 << 2) 60#define USBPF_STATUS_DID_CLOSE (1 << 3) 61#define USBPF_STATUS_DRAINING (1 << 4) 62#define USBPF_STATUS_STARTED (1 << 5) 63#define USBPF_STATUS_BW_RECLAIMED (1 << 6) 64#define USBPF_STATUS_CONTROL_XFR (1 << 7) --- 6 unchanged lines hidden (view full) --- 71#define USBPF_STATUS_BDMA_ENABLE (1 << 13) 72#define USBPF_STATUS_BDMA_NO_POST_SYNC (1 << 14) 73#define USBPF_STATUS_BDMA_SETUP (1 << 15) 74#endif 75#define USBPF_STATUS_ISOCHRONOUS_XFR (1 << 16) 76#define USBPF_STATUS_CURR_DMA_SET (1 << 17) 77#define USBPF_STATUS_CAN_CANCEL_IMMED (1 << 18) 78#define USBPF_STATUS_DOING_CALLBACK (1 << 19) |
79 uint32_t up_length; /* Total data length (submit/actual) */ 80 uint32_t up_frames; /* USB frame number (submit/actual) */ 81 uint32_t up_error; /* usb_error_t */ 82 uint32_t up_interval; /* for interrupt and isoc */ |
83 /* sizeof(struct usbpf_pkthdr) == 128 bytes */ |
84 uint8_t up_reserved[96]; |
85}; 86 87#define USBPF_HDR_LEN 128 88 89#define USBPF_XFERTAP_SUBMIT 0 90#define USBPF_XFERTAP_DONE 1 91 92#ifdef _KERNEL 93void usbpf_attach(struct usb_bus *); 94void usbpf_detach(struct usb_bus *); 95void usbpf_xfertap(struct usb_xfer *, int); 96#endif 97 98#endif |