summaryrefslogtreecommitdiff
path: root/sys/dev/usb
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
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')
-rw-r--r--sys/dev/usb/if_atureg.h24
-rw-r--r--sys/dev/usb/if_udavreg.h4
-rw-r--r--sys/dev/usb/uaudioreg.h36
-rw-r--r--sys/dev/usb/ueaglereg.h10
-rw-r--r--sys/dev/usb/umidireg.h8
-rw-r--r--sys/dev/usb/usb.h30
-rw-r--r--sys/dev/usb/usbcdc.h16
-rw-r--r--sys/dev/usb/usbhid.h4
8 files changed, 65 insertions, 67 deletions
diff --git a/sys/dev/usb/if_atureg.h b/sys/dev/usb/if_atureg.h
index 6d42913da30..c97306820c3 100644
--- a/sys/dev/usb/if_atureg.h
+++ b/sys/dev/usb/if_atureg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_atureg.h,v 1.29 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: if_atureg.h,v 1.30 2007/06/09 11:06:53 mbalmer Exp $ */
/*
* Copyright (c) 2003
* Daan Vreeken <Danovitsch@Vitsch.net>. All rights reserved.
@@ -277,7 +277,7 @@ struct atu_cmd {
uByte Cmd;
uByte Reserved;
uWord Size;
-} UPACKED;
+} __packed;
/* CMD_SET_MIB command (0x01) */
struct atu_cmd_set_mib {
@@ -294,7 +294,7 @@ struct atu_cmd_set_mib {
/* MIB data */
uByte data[72];
-} UPACKED;
+} __packed;
/* CMD_STARTUP command (0x0b) */
struct atu_cmd_card_config {
@@ -318,7 +318,7 @@ struct atu_cmd_card_config {
uByte SSID_Len;
uByte ShortPreamble;
uWord BeaconPeriod;
-} UPACKED;
+} __packed;
/* CMD_SCAN command (0x03) */
struct atu_cmd_do_scan {
@@ -335,7 +335,7 @@ struct atu_cmd_do_scan {
uWord MaxChannelTime;
uByte SSID_Len;
uByte InternationalScan;
-} UPACKED;
+} __packed;
#define ATU_SCAN_ACTIVE 0x00
#define ATU_SCAN_PASSIVE 0x01
@@ -353,7 +353,7 @@ struct atu_cmd_join {
uWord timeout;
uByte essid_size;
uByte reserved;
-} UPACKED;
+} __packed;
/* CMD_START_IBSS (0x05) */
struct atu_cmd_start_ibss {
@@ -367,7 +367,7 @@ struct atu_cmd_start_ibss {
uByte Channel;
uByte SSIDSize;
uByte Res[3];
-} UPACKED;
+} __packed;
/*
* The At76c503 adapters come with different types of radios on them.
@@ -387,7 +387,7 @@ struct atu_rfmd_conf {
u_int8_t Reserved[3];
/* then we have 84 bytes, somehow Windows reads 95?? */
u_int8_t Rest[11];
-} UPACKED;
+} __packed;
/* The config structure of an Intersil radio */
struct atu_intersil_conf {
@@ -400,7 +400,7 @@ struct atu_intersil_conf {
u_int8_t PidVid[4];
u_int8_t RegulatoryDomain;
u_int8_t Reserved[1];
-} UPACKED;
+} __packed;
/* Firmware information request */
@@ -409,7 +409,7 @@ struct atu_fw {
u_int8_t minor;
u_int8_t patch;
u_int8_t build;
-} UPACKED;
+} __packed;
/*
* The header the AT76c503 puts in front of RX packets (for both managment &
@@ -424,7 +424,7 @@ struct atu_rx_hdr {
uByte link_quality;
uByte noise_level;
uDWord rx_time;
-} UPACKED;
+} __packed;
#define ATU_RX_HDRLEN sizeof(struct atu_rx_hdr)
/*
@@ -436,7 +436,7 @@ struct atu_tx_hdr {
uByte tx_rate;
uByte padding;
uByte reserved[4];
-} UPACKED;
+} __packed;
#define ATU_TX_HDRLEN sizeof(struct atu_tx_hdr)
#define NR(x) (void *)((long)x)
diff --git a/sys/dev/usb/if_udavreg.h b/sys/dev/usb/if_udavreg.h
index 12f928f6aeb..78175afb75b 100644
--- a/sys/dev/usb/if_udavreg.h
+++ b/sys/dev/usb/if_udavreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_udavreg.h,v 1.7 2007/06/06 19:25:49 mk Exp $ */
+/* $OpenBSD: if_udavreg.h,v 1.8 2007/06/09 11:06:53 mbalmer Exp $ */
/* $NetBSD: if_udavreg.h,v 1.2 2003/09/04 15:17:39 tsutsui Exp $ */
/* $nabe: if_udavreg.h,v 1.2 2003/08/21 16:26:40 nabe Exp $ */
/*
@@ -198,7 +198,7 @@ struct udav_softc {
struct udav_rx_hdr {
uByte pktstat;
uWord length;
-} UPACKED;
+} __packed;
#define UDAV_RX_HDRLEN sizeof(struct udav_rx_hdr)
/* Packet length */
diff --git a/sys/dev/usb/uaudioreg.h b/sys/dev/usb/uaudioreg.h
index 498e3eb4f4b..dc0f7fabd0a 100644
--- a/sys/dev/usb/uaudioreg.h
+++ b/sys/dev/usb/uaudioreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uaudioreg.h,v 1.11 2003/05/19 05:27:00 nate Exp $ */
+/* $OpenBSD: uaudioreg.h,v 1.12 2007/06/09 11:06:53 mbalmer Exp $ */
/* $NetBSD: uaudioreg.h,v 1.11 2002/10/23 02:32:37 christos Exp $ */
/*
@@ -71,7 +71,7 @@ typedef struct {
*/
uByte bRefresh;
uByte bSynchAddress;
-} UPACKED usb_endpoint_descriptor_audio_t;
+} __packed usb_endpoint_descriptor_audio_t;
struct usb_audio_control_descriptor {
uByte bLength;
@@ -81,7 +81,7 @@ struct usb_audio_control_descriptor {
uWord wTotalLength;
uByte bInCollection;
uByte baInterfaceNr[1];
-} UPACKED;
+} __packed;
struct usb_audio_streaming_interface_descriptor {
uByte bLength;
@@ -90,7 +90,7 @@ struct usb_audio_streaming_interface_descriptor {
uByte bTerminalLink;
uByte bDelay;
uWord wFormatTag;
-} UPACKED;
+} __packed;
struct usb_audio_streaming_endpoint_descriptor {
uByte bLength;
@@ -102,7 +102,7 @@ struct usb_audio_streaming_endpoint_descriptor {
#define UA_SED_MAXPACKETSONLY 0x80
uByte bLockDelayUnits;
uWord wLockDelay;
-} UPACKED;
+} __packed;
struct usb_audio_streaming_type1_descriptor {
uByte bLength;
@@ -118,13 +118,13 @@ struct usb_audio_streaming_type1_descriptor {
#define UA_GETSAMP(p, n) ((p)->tSamFreq[(n)*3+0] | ((p)->tSamFreq[(n)*3+1] << 8) | ((p)->tSamFreq[(n)*3+2] << 16))
#define UA_SAMP_LO(p) UA_GETSAMP(p, 0)
#define UA_SAMP_HI(p) UA_GETSAMP(p, 1)
-} UPACKED;
+} __packed;
struct usb_audio_cluster {
uByte bNrChannels;
uWord wChannelConfig;
uByte iChannelNames;
-} UPACKED;
+} __packed;
/* Shared by all units and terminals */
struct usb_audio_unit {
@@ -146,7 +146,7 @@ struct usb_audio_input_terminal {
uWord wChannelConfig;
uByte iChannelNames;
uByte iTerminal;
-} UPACKED;
+} __packed;
/* UDESCSUB_AC_OUTPUT */
struct usb_audio_output_terminal {
@@ -158,7 +158,7 @@ struct usb_audio_output_terminal {
uByte bAssocTerminal;
uByte bSourceId;
uByte iTerminal;
-} UPACKED;
+} __packed;
/* UDESCSUB_AC_MIXER */
struct usb_audio_mixer_unit {
@@ -169,14 +169,14 @@ struct usb_audio_mixer_unit {
uByte bNrInPins;
uByte baSourceId[255]; /* [bNrInPins] */
/* struct usb_audio_mixer_unit_1 */
-} UPACKED;
+} __packed;
struct usb_audio_mixer_unit_1 {
uByte bNrChannels;
uWord wChannelConfig;
uByte iChannelNames;
uByte bmControls[255]; /* [bNrChannels] */
/*uByte iMixer;*/
-} UPACKED;
+} __packed;
/* UDESCSUB_AC_SELECTOR */
struct usb_audio_selector_unit {
@@ -187,7 +187,7 @@ struct usb_audio_selector_unit {
uByte bNrInPins;
uByte baSourceId[255]; /* [bNrInPins] */
/* uByte iSelector; */
-} UPACKED;
+} __packed;
/* UDESCSUB_AC_FEATURE */
struct usb_audio_feature_unit {
@@ -199,7 +199,7 @@ struct usb_audio_feature_unit {
uByte bControlSize;
uByte bmaControls[255]; /* size for more than enough */
/* uByte iFeature; */
-} UPACKED;
+} __packed;
/* UDESCSUB_AC_PROCESSING */
struct usb_audio_processing_unit {
@@ -211,7 +211,7 @@ struct usb_audio_processing_unit {
uByte bNrInPins;
uByte baSourceId[255]; /* [bNrInPins] */
/* struct usb_audio_processing_unit_1 */
-} UPACKED;
+} __packed;
struct usb_audio_processing_unit_1{
uByte bNrChannels;
uWord wChannelConfig;
@@ -219,13 +219,13 @@ struct usb_audio_processing_unit_1{
uByte bControlSize;
uByte bmControls[255]; /* [bControlSize] */
#define UA_PROC_ENABLE_MASK 1
-} UPACKED;
+} __packed;
struct usb_audio_processing_unit_updown {
uByte iProcessing;
uByte bNrModes;
uWord waModes[255]; /* [bNrModes] */
-} UPACKED;
+} __packed;
/* UDESCSUB_AC_EXTENSION */
struct usb_audio_extension_unit {
@@ -237,7 +237,7 @@ struct usb_audio_extension_unit {
uByte bNrInPins;
uByte baSourceId[255]; /* [bNrInPins] */
/* struct usb_audio_extension_unit_1 */
-} UPACKED;
+} __packed;
struct usb_audio_extension_unit_1 {
uByte bNrChannels;
uWord wChannelConfig;
@@ -247,7 +247,7 @@ struct usb_audio_extension_unit_1 {
#define UA_EXT_ENABLE_MASK 1
#define UA_EXT_ENABLE 1
/*uByte iExtension;*/
-} UPACKED;
+} __packed;
/* USB terminal types */
#define UAT_UNDEFINED 0x0100
diff --git a/sys/dev/usb/ueaglereg.h b/sys/dev/usb/ueaglereg.h
index 50da45ce610..8b3efbc153a 100644
--- a/sys/dev/usb/ueaglereg.h
+++ b/sys/dev/usb/ueaglereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ueaglereg.h,v 1.2 2005/04/19 08:21:47 damien Exp $ */
+/* $OpenBSD: ueaglereg.h,v 1.3 2007/06/09 11:06:53 mbalmer Exp $ */
/*-
* Copyright (c) 2003-2005
@@ -67,7 +67,7 @@ struct ueagle_block_info {
uWord wOvlOffset;
uWord wOvl; /* overlay */
uWord wLast;
-} UPACKED;
+} __packed;
/* CMV (Configuration and Management Variable) */
struct ueagle_cmv {
@@ -103,12 +103,12 @@ struct ueagle_cmv {
(w)[3] = (uint8_t)((v) >> 8), \
(w)[0] = (uint8_t)((v) >> 16), \
(w)[1] = (uint8_t)((v) >> 24))
-} UPACKED;
+} __packed;
struct ueagle_swap {
uByte bPageNo;
uByte bOvl; /* overlay */
-} UPACKED;
+} __packed;
struct ueagle_intr {
uByte bType;
@@ -119,6 +119,6 @@ struct ueagle_intr {
uWord wInterrupt;
#define UEAGLE_INTR_SWAP 1
#define UEAGLE_INTR_CMV 2
-} UPACKED;
+} __packed;
#define UEAGLE_INTR_MAXSIZE 28
diff --git a/sys/dev/usb/umidireg.h b/sys/dev/usb/umidireg.h
index 3db68c93c0a..318222587a3 100644
--- a/sys/dev/usb/umidireg.h
+++ b/sys/dev/usb/umidireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: umidireg.h,v 1.5 2004/10/01 04:08:46 jsg Exp $ */
+/* $OpenBSD: umidireg.h,v 1.6 2007/06/09 11:06:53 mbalmer Exp $ */
/* $NetBSD: umidireg.h,v 1.3 2003/12/04 13:57:31 keihan Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -51,7 +51,7 @@ typedef struct {
uByte bDescriptorSubtype;
uWord bcdMSC;
uWord wTotalLength;
-} UPACKED umidi_cs_interface_descriptor_t;
+} __packed umidi_cs_interface_descriptor_t;
#define UMIDI_CS_INTERFACE_DESCRIPTOR_SIZE 7
typedef struct {
@@ -59,7 +59,7 @@ typedef struct {
uByte bDescriptorType;
uByte bDescriptorSubType;
uByte bNumEmbMIDIJack;
-} UPACKED umidi_cs_endpoint_descriptor_t;
+} __packed umidi_cs_endpoint_descriptor_t;
#define UMIDI_CS_ENDPOINT_DESCRIPTOR_SIZE 4
typedef struct {
@@ -68,7 +68,7 @@ typedef struct {
uByte bDescriptorSubtype;
uByte bJackType;
uByte bJackID;
-} UPACKED umidi_jack_descriptor_t;
+} __packed umidi_jack_descriptor_t;
#define UMIDI_JACK_DESCRIPTOR_SIZE 5
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
diff --git a/sys/dev/usb/usbcdc.h b/sys/dev/usb/usbcdc.h
index 5efb316796c..b43a96decca 100644
--- a/sys/dev/usb/usbcdc.h
+++ b/sys/dev/usb/usbcdc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbcdc.h,v 1.5 2001/05/03 02:20:34 aaron Exp $ */
+/* $OpenBSD: usbcdc.h,v 1.6 2007/06/09 11:06:53 mbalmer Exp $ */
/* $NetBSD: usbcdc.h,v 1.8 2001/02/16 20:15:57 kenh Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbcdc.h,v 1.7 1999/11/17 22:33:48 n_hibma Exp $ */
@@ -58,7 +58,7 @@ typedef struct {
uByte bDescriptorType;
uByte bDescriptorSubtype;
uWord bcdCDC;
-} UPACKED usb_cdc_header_descriptor_t;
+} __packed usb_cdc_header_descriptor_t;
typedef struct {
uByte bLength;
@@ -68,7 +68,7 @@ typedef struct {
#define USB_CDC_CM_DOES_CM 0x01
#define USB_CDC_CM_OVER_DATA 0x02
uByte bDataInterface;
-} UPACKED usb_cdc_cm_descriptor_t;
+} __packed usb_cdc_cm_descriptor_t;
typedef struct {
uByte bLength;
@@ -79,7 +79,7 @@ typedef struct {
#define USB_CDC_ACM_HAS_LINE 0x02
#define USB_CDC_ACM_HAS_BREAK 0x04
#define USB_CDC_ACM_HAS_NETWORK_CONN 0x08
-} UPACKED usb_cdc_acm_descriptor_t;
+} __packed usb_cdc_acm_descriptor_t;
typedef struct {
uByte bLength;
@@ -87,7 +87,7 @@ typedef struct {
uByte bDescriptorSubtype;
uByte bMasterInterface;
uByte bSlaveInterface[1];
-} UPACKED usb_cdc_union_descriptor_t;
+} __packed usb_cdc_union_descriptor_t;
#define UCDC_SEND_ENCAPSULATED_COMMAND 0x00
#define UCDC_GET_ENCAPSULATED_RESPONSE 0x01
@@ -109,7 +109,7 @@ typedef struct {
uWord wState;
#define UCDC_IDLE_SETTING 0x0001
#define UCDC_DATA_MULTIPLEXED 0x0002
-} UPACKED usb_cdc_abstract_state_t;
+} __packed usb_cdc_abstract_state_t;
#define UCDC_ABSTRACT_STATE_LENGTH 2
typedef struct {
@@ -125,7 +125,7 @@ typedef struct {
#define UCDC_PARITY_MARK 3
#define UCDC_PARITY_SPACE 4
uByte bDataBits;
-} UPACKED usb_cdc_line_state_t;
+} __packed usb_cdc_line_state_t;
#define UCDC_LINE_STATE_LENGTH 7
typedef struct {
@@ -144,7 +144,7 @@ typedef struct {
uWord wIndex;
uWord wLength;
uByte data[16];
-} UPACKED usb_cdc_notification_t;
+} __packed usb_cdc_notification_t;
#define UCDC_NOTIFICATION_LENGTH 8
/*
diff --git a/sys/dev/usb/usbhid.h b/sys/dev/usb/usbhid.h
index b49f740b5a1..1ce0cd31cbf 100644
--- a/sys/dev/usb/usbhid.h
+++ b/sys/dev/usb/usbhid.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbhid.h,v 1.8 2006/06/26 22:14:12 miod Exp $ */
+/* $OpenBSD: usbhid.h,v 1.9 2007/06/09 11:06:53 mbalmer Exp $ */
/* $NetBSD: usbhid.h,v 1.11 2001/12/28 00:20:24 augustss Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbhid.h,v 1.7 1999/11/17 22:33:51 n_hibma Exp $ */
@@ -65,7 +65,7 @@ typedef struct usb_hid_descriptor {
uByte bDescriptorType;
uWord wDescriptorLength;
} descrs[1];
-} UPACKED usb_hid_descriptor_t;
+} __packed usb_hid_descriptor_t;
#define USB_HID_DESCRIPTOR_SIZE(n) (9+(n)*3)
/* Usage pages */