/*
*/
/*
*
* Prototypes, structure definitions and macros.
*
* Copyright (c) 2000-2003 Johannes Erdfelt <johannes@erdfelt.com>
*
* This file (and only this file) may alternatively be licensed under the
* BSD license as well, read LICENSE for details.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _SYS_USB_LIBUSB_USB_H
#define _SYS_USB_LIBUSB_USB_H
#ifdef __cplusplus
extern "C" {
#endif
#include <unistd.h>
#include <stdlib.h>
#include <limits.h>
#include <dirent.h>
/*
* USB spec information
*
* This is all stuff grabbed from various USB specs and is pretty much
* not subject to change
*/
/*
*/
/*
* Descriptor types
*/
/*
* Descriptor sizes per descriptor type
*/
/* All standard descriptors have these 2 fields in common */
struct usb_descriptor_header {
};
/* String descriptor */
struct usb_string_descriptor {
};
/* HID descriptor */
struct usb_hid_descriptor {
/* u_int8_t bReportDescriptorType; */
/* u_int16_t wDescriptorLength; */
/* ... */
};
/* Endpoint descriptor */
struct usb_endpoint_descriptor {
int extralen;
};
#define USB_ENDPOINT_TYPE_CONTROL 0
/* Interface descriptor */
struct usb_interface_descriptor {
int extralen;
};
struct usb_interface {
int num_altsetting;
};
/* Configuration descriptor information.. */
struct usb_config_descriptor {
int extralen;
};
/* Device descriptor */
struct usb_device_descriptor {
};
struct usb_ctrl_setup {
};
/*
* Standard requests
*/
/* 0x02 is reserved */
/* 0x04 is reserved */
/*
* Various libusb API related stuff
*/
/* Error codes */
#define USB_LE16_TO_CPU(x) do { \
x = ((x & 0xff) << 8) | ((x & 0xff00) >> 8); \
} while (0)
/* Data types */
struct usb_device {
};
struct usb_bus {
};
/* Variables */
extern struct usb_bus *usb_busses;
/* Function prototypes */
int configuration);
char *usb_strerror(void);
void usb_init(void);
void usb_set_debug(int level);
int usb_find_busses(void);
int usb_find_devices(void);
struct usb_bus *usb_get_busses(void);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_USB_LIBUSB_USB_H */