usb.h (8bde7f776c77b343aca29b8c7b58464d915ac245) | usb.h (149dded2b178bc0fb62cb6f61b87968d914b580a) |
---|---|
1/* 2 * (C) Copyright 2001 3 * Denis Peter, MPL AG Switzerland 4 * 5 * See file CREDITS for list of people who contributed to this 6 * project. 7 * 8 * This program is free software; you can redistribute it and/or --- 155 unchanged lines hidden (view full) --- 164 struct usb_device *parent; 165 struct usb_device *children[USB_MAXCHILDREN]; 166}; 167 168/********************************************************************** 169 * this is how the lowlevel part communicate with the outer world 170 */ 171 | 1/* 2 * (C) Copyright 2001 3 * Denis Peter, MPL AG Switzerland 4 * 5 * See file CREDITS for list of people who contributed to this 6 * project. 7 * 8 * This program is free software; you can redistribute it and/or --- 155 unchanged lines hidden (view full) --- 164 struct usb_device *parent; 165 struct usb_device *children[USB_MAXCHILDREN]; 166}; 167 168/********************************************************************** 169 * this is how the lowlevel part communicate with the outer world 170 */ 171 |
172#ifdef CONFIG_USB_UHCI | 172#if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) |
173int usb_lowlevel_init(void); 174int usb_lowlevel_stop(void); 175int submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer,int transfer_len); 176int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, 177 int transfer_len,struct devrequest *setup); 178int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, 179 int transfer_len, int interval); 180 --- 42 unchanged lines hidden (view full) --- 223int usb_get_report(struct usb_device *dev, int ifnum, unsigned char type, unsigned char id, void *buf, int size); 224int usb_get_class_descriptor(struct usb_device *dev, int ifnum, 225 unsigned char type, unsigned char id, void *buf, int size); 226int usb_clear_halt(struct usb_device *dev, int pipe); 227int usb_string(struct usb_device *dev, int index, char *buf, size_t size); 228int usb_set_interface(struct usb_device *dev, int interface, int alternate); 229 230/* big endian -> little endian conversion */ | 173int usb_lowlevel_init(void); 174int usb_lowlevel_stop(void); 175int submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer,int transfer_len); 176int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer, 177 int transfer_len,struct devrequest *setup); 178int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, 179 int transfer_len, int interval); 180 --- 42 unchanged lines hidden (view full) --- 223int usb_get_report(struct usb_device *dev, int ifnum, unsigned char type, unsigned char id, void *buf, int size); 224int usb_get_class_descriptor(struct usb_device *dev, int ifnum, 225 unsigned char type, unsigned char id, void *buf, int size); 226int usb_clear_halt(struct usb_device *dev, int pipe); 227int usb_string(struct usb_device *dev, int index, char *buf, size_t size); 228int usb_set_interface(struct usb_device *dev, int interface, int alternate); 229 230/* big endian -> little endian conversion */ |
231/* some CPUs are already little endian e.g. the ARM920T */ 232#ifdef LITTLEENDIAN 233#define swap_16(x) ((unsigned short)(x)) 234#define swap_32(x) ((unsigned long)(x)) 235#else |
|
231#define swap_16(x) \ 232 ((unsigned short)( \ 233 (((unsigned short)(x) & (unsigned short)0x00ffU) << 8) | \ 234 (((unsigned short)(x) & (unsigned short)0xff00U) >> 8) )) 235#define swap_32(x) \ 236 ((unsigned long)( \ 237 (((unsigned long)(x) & (unsigned long)0x000000ffUL) << 24) | \ 238 (((unsigned long)(x) & (unsigned long)0x0000ff00UL) << 8) | \ 239 (((unsigned long)(x) & (unsigned long)0x00ff0000UL) >> 8) | \ 240 (((unsigned long)(x) & (unsigned long)0xff000000UL) >> 24) )) | 236#define swap_16(x) \ 237 ((unsigned short)( \ 238 (((unsigned short)(x) & (unsigned short)0x00ffU) << 8) | \ 239 (((unsigned short)(x) & (unsigned short)0xff00U) >> 8) )) 240#define swap_32(x) \ 241 ((unsigned long)( \ 242 (((unsigned long)(x) & (unsigned long)0x000000ffUL) << 24) | \ 243 (((unsigned long)(x) & (unsigned long)0x0000ff00UL) << 8) | \ 244 (((unsigned long)(x) & (unsigned long)0x00ff0000UL) >> 8) | \ 245 (((unsigned long)(x) & (unsigned long)0xff000000UL) >> 24) )) |
246#endif /* LITTLEENDIAN */ |
|
241 242/* 243 * Calling this entity a "pipe" is glorifying it. A USB pipe 244 * is something embarrassingly simple: it basically consists 245 * of the following information: 246 * - device number (7 bits) 247 * - endpoint number (4 bits) 248 * - current Data0/1 state (1 bit) --- 103 unchanged lines hidden --- | 247 248/* 249 * Calling this entity a "pipe" is glorifying it. A USB pipe 250 * is something embarrassingly simple: it basically consists 251 * of the following information: 252 * - device number (7 bits) 253 * - endpoint number (4 bits) 254 * - current Data0/1 state (1 bit) --- 103 unchanged lines hidden --- |