summaryrefslogtreecommitdiff
path: root/sys/dev/usb/usb.h
diff options
context:
space:
mode:
authorMarc Balmer <mbalmer@cvs.openbsd.org>2007-06-09 11:06:54 +0000
committerMarc Balmer <mbalmer@cvs.openbsd.org>2007-06-09 11:06:54 +0000
commit522658dc278638b28c649f32cd350159c91395cf (patch)
tree5272c92068b4e8eb82bf984825d5f42c87040fa0 /sys/dev/usb/usb.h
parent60582c6f13fde3de6874af4087ae9e22593ffde2 (diff)
Remove the definition and use of UPACKED and replace it with our own __packed
(to which UPACKED was define'd before anway). No binary change, just one layer of confusion less in the sourcecode. ok jsg
Diffstat (limited to 'sys/dev/usb/usb.h')
-rw-r--r--sys/dev/usb/usb.h30
1 files changed, 14 insertions, 16 deletions
diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h
index 5d351b6d949..7524faa067d 100644
--- a/sys/dev/usb/usb.h
+++ b/sys/dev/usb/usb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usb.h,v 1.26 2007/06/04 10:34:04 mbalmer Exp $ */
+/* $OpenBSD: usb.h,v 1.27 2007/06/09 11:06:53 mbalmer Exp $ */
/* $NetBSD: usb.h,v 1.69 2002/09/22 23:20:50 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usb.h,v 1.14 1999/11/17 22:33:46 n_hibma Exp $ */
@@ -93,15 +93,13 @@ typedef u_int8_t uDWord[4];
#define USETDW(w,v) (*(u_int32_t *)(w) = (v))
#endif
-#define UPACKED __packed
-
typedef struct {
uByte bmRequestType;
uByte bRequest;
uWord wValue;
uWord wIndex;
uWord wLength;
-} UPACKED usb_device_request_t;
+} __packed usb_device_request_t;
#define UT_WRITE 0x00
#define UT_READ 0x80
@@ -178,7 +176,7 @@ typedef struct {
uByte bLength;
uByte bDescriptorType;
uByte bDescriptorSubtype;
-} UPACKED usb_descriptor_t;
+} __packed usb_descriptor_t;
typedef struct {
uByte bLength;
@@ -198,7 +196,7 @@ typedef struct {
uByte iProduct;
uByte iSerialNumber;
uByte bNumConfigurations;
-} UPACKED usb_device_descriptor_t;
+} __packed usb_device_descriptor_t;
#define USB_DEVICE_DESCRIPTOR_SIZE 18
typedef struct {
@@ -214,7 +212,7 @@ typedef struct {
#define UC_REMOTE_WAKEUP 0x20
uByte bMaxPower; /* max current in 2 mA units */
#define UC_POWER_FACTOR 2
-} UPACKED usb_config_descriptor_t;
+} __packed usb_config_descriptor_t;
#define USB_CONFIG_DESCRIPTOR_SIZE 9
typedef struct {
@@ -227,7 +225,7 @@ typedef struct {
uByte bInterfaceSubClass;
uByte bInterfaceProtocol;
uByte iInterface;
-} UPACKED usb_interface_descriptor_t;
+} __packed usb_interface_descriptor_t;
#define USB_INTERFACE_DESCRIPTOR_SIZE 9
typedef struct {
@@ -254,14 +252,14 @@ typedef struct {
#define UE_GET_ISO_TYPE(a) ((a) & UE_ISO_TYPE)
uWord wMaxPacketSize;
uByte bInterval;
-} UPACKED usb_endpoint_descriptor_t;
+} __packed usb_endpoint_descriptor_t;
#define USB_ENDPOINT_DESCRIPTOR_SIZE 7
typedef struct {
uByte bLength;
uByte bDescriptorType;
uWord bString[127];
-} UPACKED usb_string_descriptor_t;
+} __packed usb_string_descriptor_t;
#define USB_MAX_STRING_LEN 128
#define USB_LANGUAGE_TABLE 0 /* # of the string language id table */
@@ -317,7 +315,7 @@ typedef struct {
#define UHD_NOT_REMOV(desc, i) \
(((desc)->DeviceRemovable[(i)/8] >> ((i) % 8)) & 1)
/* deprecated */ uByte PortPowerCtrlMask[1];
-} UPACKED usb_hub_descriptor_t;
+} __packed usb_hub_descriptor_t;
#define USB_HUB_DESCRIPTOR_SIZE 9 /* includes deprecated PortPowerCtrlMask */
typedef struct {
@@ -330,7 +328,7 @@ typedef struct {
uByte bMaxPacketSize0;
uByte bNumConfigurations;
uByte bReserved;
-} UPACKED usb_device_qualifier_t;
+} __packed usb_device_qualifier_t;
#define USB_DEVICE_QUALIFIER_SIZE 10
typedef struct {
@@ -339,7 +337,7 @@ typedef struct {
uByte bmAttributes;
#define UOTG_SRP 0x01
#define UOTG_HNP 0x02
-} UPACKED usb_otg_descriptor_t;
+} __packed usb_otg_descriptor_t;
/* OTG feature selectors */
#define UOTG_B_HNP_ENABLE 3
@@ -353,14 +351,14 @@ typedef struct {
#define UDS_REMOTE_WAKEUP 0x0002
/* Endpoint status flags */
#define UES_HALT 0x0001
-} UPACKED usb_status_t;
+} __packed usb_status_t;
typedef struct {
uWord wHubStatus;
#define UHS_LOCAL_POWER 0x0001
#define UHS_OVER_CURRENT 0x0002
uWord wHubChange;
-} UPACKED usb_hub_status_t;
+} __packed usb_hub_status_t;
typedef struct {
uWord wPortStatus;
@@ -380,7 +378,7 @@ typedef struct {
#define UPS_C_SUSPEND 0x0004
#define UPS_C_OVERCURRENT_INDICATOR 0x0008
#define UPS_C_PORT_RESET 0x0010
-} UPACKED usb_port_status_t;
+} __packed usb_port_status_t;
/* Device class codes */
#define UDCLASS_IN_INTERFACE 0x00