PERFORCE change 126748 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Sun Sep 23 09:44:08 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=126748
Change 126748 by hselasky at hselasky_laptop001 on 2007/09/23 16:43:37
FYI; The comments follow the P4 diff from top to bottom.
- added ISOCHRONOUS number of frames limit
- removed USB_MAX_STRING_LEN, redundant
- added USB_STRING_DESC_LEN macro
- USB_UNCONFIG_INDEX is now unsigned and 0xFF
- [new] internal flag "USBD_USE_POLLING"
- USB_SPEED_XXX defined like enums. Old value preserved except
for USB_SPEED_VARIABLE, which is not yet used in userland.
Affected files ...
.. //depot/projects/usb/src/sys/dev/usb/usb.h#14 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/usb/usb.h#14 (text+ko) ====
@@ -75,6 +75,9 @@
#define USB_FS_BYTES_PER_HS_UFRAME 188 /* bytes */
#define USB_HS_MICRO_FRAMES_MAX 8 /* units */
+#define USB_MAX_FS_ISOC_FRAMES_PER_XFER (120)
+#define USB_MAX_HS_ISOC_FRAMES_PER_XFER (8*120)
+
/*
* The USB records contain some unaligned little-endian word
* components. The U[SG]ETW macros take care of both the alignment
@@ -281,7 +284,7 @@
uWord bString[126];
uByte bUnused;
} UPACKED usb_string_descriptor_t;
-#define USB_MAX_STRING_LEN 128
+#define USB_STRING_DESC_LEN(len) ((2*(len)) + 2)
#define USB_LANGUAGE_TABLE 0 /* # of the string language id table */
/* Hub specific request */
@@ -541,9 +544,8 @@
#define USB_BUS_RESET_DELAY 100 /* ms XXX?*/
-
#define USB_UNCONFIG_NO 0
-#define USB_UNCONFIG_INDEX (-1)
+#define USB_UNCONFIG_INDEX 0xFF
/*---------------------------------------------------------------------------*
* ioctl() related stuff
@@ -553,6 +555,7 @@
usb_device_request_t ucr_request;
void *ucr_data;
int ucr_flags;
+#define USBD_USE_POLLING 0x0001 /* internal flag */
#define USBD_SHORT_XFER_OK 0x0004 /* allow short reads */
int ucr_actlen; /* actual length transferred */
};
@@ -605,12 +608,21 @@
#define USB_MAX_DEVNAMES 4
#define USB_MAX_DEVNAMELEN 16
+
+enum {
+ USB_SPEED_VARIABLE,
+ USB_SPEED_LOW,
+ USB_SPEED_FULL,
+ USB_SPEED_HIGH,
+ USB_SPEED_MAX,
+};
+
struct usb_device_info {
u_int8_t udi_bus;
u_int8_t udi_addr; /* device address */
u_int32_t udi_unused; /* XXX remove */
- char udi_product[USB_MAX_STRING_LEN];
- char udi_vendor[USB_MAX_STRING_LEN];
+ char udi_product[128];
+ char udi_vendor[128];
char udi_release[8];
u_int16_t udi_productNo;
u_int16_t udi_vendorNo;
@@ -620,10 +632,6 @@
u_int8_t udi_protocol;
u_int8_t udi_config;
u_int8_t udi_speed;
-#define USB_SPEED_LOW 1
-#define USB_SPEED_FULL 2
-#define USB_SPEED_HIGH 3
-#define USB_SPEED_VARIABLE 4
int udi_power; /* power consumption in mA, 0 if selfpowered */
int udi_nports;
char udi_devnames[USB_MAX_DEVNAMES][USB_MAX_DEVNAMELEN];
More information about the p4-projects
mailing list