PERFORCE change 128841 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Thu Nov 8 14:03:01 PST 2007
http://perforce.freebsd.org/chv.cgi?CH=128841
Change 128841 by hselasky at hselasky_laptop001 on 2007/11/08 22:02:56
Substitute UPACKED by __packed .
Affected files ...
.. //depot/projects/usb/src/sys/dev/ata/ata-usb.c#22 edit
.. //depot/projects/usb/src/sys/dev/sound/usb/uaudioreg.h#6 edit
.. //depot/projects/usb/src/sys/dev/usb/if_zydreg.h#6 edit
.. //depot/projects/usb/src/sys/dev/usb/ufoma.c#27 edit
.. //depot/projects/usb/src/sys/dev/usb/umass.c#29 edit
.. //depot/projects/usb/src/sys/dev/usb/usb.h#19 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_hid.h#9 edit
.. //depot/projects/usb/src/sys/dev/usb/uvisor.c#23 edit
Differences ...
==== //depot/projects/usb/src/sys/dev/ata/ata-usb.c#22 (text) ====
@@ -66,7 +66,7 @@
#define CBWCDBLENGTH 16
uint8_t cdb[CBWCDBLENGTH];
-} UPACKED;
+} __packed;
/* Command Status Wrapper */
struct bbb_csw {
@@ -79,7 +79,7 @@
#define CSWSTATUS_GOOD 0x0
#define CSWSTATUS_FAILED 0x1
#define CSWSTATUS_PHASE 0x2
-} UPACKED;
+} __packed;
/* USB-ATA 'controller' softc */
struct atausb_softc {
@@ -861,7 +861,7 @@
uint8_t product[16];
uint8_t revision[4];
/* uint8_t crap[60]; */
-} UPACKED;
+} __packed;
static int
ata_usbchannel_begin_transaction(struct ata_request *request)
==== //depot/projects/usb/src/sys/dev/sound/usb/uaudioreg.h#6 (text+ko) ====
@@ -71,7 +71,7 @@
*/
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 @@
uWord wTotalLength;
uByte bInCollection;
uByte baInterfaceNr[1];
-} UPACKED;
+} __packed;
struct usb_audio_streaming_interface_descriptor {
uByte bLength;
@@ -90,7 +90,7 @@
uByte bTerminalLink;
uByte bDelay;
uWord wFormatTag;
-} UPACKED;
+} __packed;
struct usb_audio_streaming_endpoint_descriptor {
uByte bLength;
@@ -102,7 +102,7 @@
#define UA_SED_MAXPACKETSONLY 0x80
uByte bLockDelayUnits;
uWord wLockDelay;
-} UPACKED;
+} __packed;
struct usb_audio_streaming_type1_descriptor {
uByte bLength;
@@ -120,7 +120,7 @@
((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;
@@ -138,7 +138,7 @@
#define UA_CHANNEL_R_SIDE 0x0400
#define UA_CHANNEL_TOP 0x0800
uByte iChannelNames;
-} UPACKED;
+} __packed;
/* Shared by all units and terminals */
struct usb_audio_unit {
@@ -160,7 +160,7 @@
uWord wChannelConfig;
uByte iChannelNames;
/* uByte iTerminal; */
-} UPACKED;
+} __packed;
/* UDESCSUB_AC_OUTPUT */
struct usb_audio_output_terminal {
@@ -172,7 +172,7 @@
uByte bAssocTerminal;
uByte bSourceId;
uByte iTerminal;
-} UPACKED;
+} __packed;
/* UDESCSUB_AC_MIXER */
struct usb_audio_mixer_unit_0 {
@@ -183,14 +183,14 @@
uByte bNrInPins;
uByte baSourceId[0]; /* [bNrInPins] */
/* struct usb_audio_mixer_unit_1 */
-} UPACKED;
+} __packed;
struct usb_audio_mixer_unit_1 {
uByte bNrChannels;
uWord wChannelConfig;
uByte iChannelNames;
uByte bmControls[0]; /* [see source code] */
/* uByte iMixer; */
-} UPACKED;
+} __packed;
/* UDESCSUB_AC_SELECTOR */
struct usb_audio_selector_unit {
@@ -201,7 +201,7 @@
uByte bNrInPins;
uByte baSourceId[0]; /* [bNrInPins] */
/* uByte iSelector; */
-} UPACKED;
+} __packed;
/* UDESCSUB_AC_FEATURE */
struct usb_audio_feature_unit {
@@ -213,7 +213,7 @@
uByte bControlSize;
uByte bmaControls[0]; /* [bControlSize * x] */
/* uByte iFeature; */
-} UPACKED;
+} __packed;
/* UDESCSUB_AC_PROCESSING */
struct usb_audio_processing_unit_0 {
@@ -225,7 +225,7 @@
uByte bNrInPins;
uByte baSourceId[0]; /* [bNrInPins] */
/* struct usb_audio_processing_unit_1 */
-} UPACKED;
+} __packed;
struct usb_audio_processing_unit_1 {
uByte bNrChannels;
uWord wChannelConfig;
@@ -233,13 +233,13 @@
uByte bControlSize;
uByte bmControls[0]; /* [bControlSize] */
#define UA_PROC_ENABLE_MASK 1
-} UPACKED;
+} __packed;
struct usb_audio_processing_unit_updown {
uByte iProcessing;
uByte bNrModes;
uWord waModes[0]; /* [bNrModes] */
-} UPACKED;
+} __packed;
/* UDESCSUB_AC_EXTENSION */
struct usb_audio_extension_unit_0 {
@@ -251,7 +251,7 @@
uByte bNrInPins;
uByte baSourceId[0]; /* [bNrInPins] */
/* struct usb_audio_extension_unit_1 */
-} UPACKED;
+} __packed;
struct usb_audio_extension_unit_1 {
uByte bNrChannels;
uWord wChannelConfig;
@@ -261,7 +261,7 @@
#define UA_EXT_ENABLE_MASK 1
#define UA_EXT_ENABLE 1
/* uByte iExtension; */
-} UPACKED;
+} __packed;
/* USB terminal types */
#define UAT_UNDEFINED 0x0100
==== //depot/projects/usb/src/sys/dev/usb/if_zydreg.h#6 (text+ko) ====
@@ -1128,7 +1128,7 @@
uint16_t currentlength;
uint8_t service;
uint16_t nextframelen;
-} UPACKED;
+} __packed;
struct zyd_rxstatusreport {
uint8_t signalstrength;
@@ -1139,14 +1139,14 @@
uint8_t modulationtype:1;
uint8_t rxerrorreason:6;
uint8_t errorindication:1;
-} UPACKED;
+} __packed;
/* Appended length info for multiframe transmission */
struct zyd_rxleninfoapp {
uWord len[3];
uWord marker; /* 0x697E */
#define ZYD_MULTIFRAME_MARKER 0x697E
-} UPACKED;
+} __packed;
struct zyd_aw_pt_bi {
uint32_t atim_wnd_period;
@@ -1176,11 +1176,11 @@
/* RF2595: 24 */
uWord bit_values[ZYD_REQ_RFWRITE_BITS_MAX];
/* (CR203 & ~(RF_IF_LE | RF_CLK | RF_DATA)) | (bit ? RF_DATA : 0) */
-} UPACKED;
+} __packed;
struct zyd_macaddr {
uint8_t addr[6];
-} UPACKED;
+} __packed;
/* Control interface @ EP 0 */
struct zyd_control {
@@ -1190,7 +1190,7 @@
uint16_t index;
uint16_t length;
void *data;
-} UPACKED;
+} __packed;
/* Int IN interface @ EP 3 (single register access) */
struct zyd_intinsingle {
@@ -1200,7 +1200,7 @@
uWord sts3;
uWord sts4;
uWord sts5;
-} UPACKED;
+} __packed;
/* Int/bulk OUT interface @ EP 4 (single register access) */
struct zyd_intoutsingle {
@@ -1210,33 +1210,33 @@
uWord length;
uWord data1;
uWord data2;
-} UPACKED;
+} __packed;
/* Register addr/data combo */
struct zyd_regadcombo {
uWord addr;
uWord data;
-} UPACKED;
+} __packed;
/* Int IN interface @ EP 3 (multi register access) output */
struct zyd_intinmultioutput {
uWord id;
/* pairs of addr-data-addr-data-... */
struct zyd_regadcombo registers[15];
-} UPACKED;
+} __packed;
/* Int/bulk OUT interface @ EP 4 (multi register access) read */
struct zyd_intoutmultiread {
uWord id;
uWord addr[15];
-} UPACKED;
+} __packed;
/* Int/bulk OUT interface @ EP 4 (multi register access) write */
struct zyd_intoutmultiwrite {
uWord id;
/* pairs of addr-data-addr-data-... */
struct zyd_regadcombo registers[15];
-} UPACKED;
+} __packed;
/* Pairs of address and 16-bit data. For batch write. */
struct zyd_adpairs16 {
==== //depot/projects/usb/src/sys/dev/usb/ufoma.c#27 (text+ko) ====
@@ -105,7 +105,7 @@
uint8_t bDescriptorSubtype;
uint8_t bType;
uint8_t bMode[1];
-} UPACKED usb_mcpc_acm_descriptor;
+} __packed usb_mcpc_acm_descriptor;
#define UISUBCLASS_MCPC 0x88
==== //depot/projects/usb/src/sys/dev/usb/umass.c#29 (text+ko) ====
@@ -229,7 +229,7 @@
uByte bCDBLength;
#define CBWCDBLENGTH 16
uByte CBWCDB[CBWCDBLENGTH];
-} UPACKED umass_bbb_cbw_t;
+} __packed umass_bbb_cbw_t;
#define UMASS_BBB_CBW_SIZE 31
@@ -245,7 +245,7 @@
#define CSWSTATUS_GOOD 0x0
#define CSWSTATUS_FAILED 0x1
#define CSWSTATUS_PHASE 0x2
-} UPACKED umass_bbb_csw_t;
+} __packed umass_bbb_csw_t;
#define UMASS_BBB_CSW_SIZE 13
@@ -263,13 +263,13 @@
#define IDB_VALUE_PHASE 0x02
#define IDB_VALUE_PERSISTENT 0x03
#define IDB_VALUE_STATUS_MASK 0x03
- } UPACKED common;
+ } __packed common;
struct {
uint8_t asc;
uint8_t ascq;
- } UPACKED ufi;
-} UPACKED umass_cbi_sbl_t;
+ } __packed ufi;
+} __packed umass_cbi_sbl_t;
struct umass_softc; /* see below */
==== //depot/projects/usb/src/sys/dev/usb/usb.h#19 (text+ko) ====
@@ -109,8 +109,6 @@
#define USETDW(w,v) (*(uint32_t *)(w) = (v))
#endif
-#define UPACKED __packed
-
typedef struct {
uByte bmRequestType;
uByte bRequest;
@@ -118,7 +116,7 @@
uWord wIndex;
uWord wLength;
uByte bData[0];
-} UPACKED usb_device_request_t;
+} __packed usb_device_request_t;
#define UT_WRITE 0x00
#define UT_READ 0x80
@@ -192,7 +190,7 @@
uByte bLength;
uByte bDescriptorType;
uByte bDescriptorSubtype;
-} UPACKED usb_descriptor_t;
+} __packed usb_descriptor_t;
typedef struct {
uByte bLength;
@@ -212,7 +210,7 @@
uByte iProduct;
uByte iSerialNumber;
uByte bNumConfigurations;
-} UPACKED usb_device_descriptor_t;
+} __packed usb_device_descriptor_t;
#define USB_DEVICE_DESCRIPTOR_SIZE 18
@@ -229,7 +227,7 @@
#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
@@ -243,7 +241,7 @@
uByte bInterfaceSubClass;
uByte bInterfaceProtocol;
uByte iInterface;
-} UPACKED usb_interface_descriptor_t;
+} __packed usb_interface_descriptor_t;
#define USB_INTERFACE_DESCRIPTOR_SIZE 9
@@ -275,7 +273,7 @@
#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
@@ -284,7 +282,7 @@
uByte bDescriptorType;
uWord bString[126];
uByte bUnused;
-} UPACKED usb_string_descriptor_t;
+} __packed usb_string_descriptor_t;
#define USB_STRING_DESC_LEN(len) ((2*(len)) + 2)
#define USB_LANGUAGE_TABLE 0 /* # of the string language id table */
@@ -341,7 +339,7 @@
#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 */
@@ -356,7 +354,7 @@
uByte bMaxPacketSize0;
uByte bNumConfigurations;
uByte bReserved;
-} UPACKED usb_device_qualifier_t;
+} __packed usb_device_qualifier_t;
#define USB_DEVICE_QUALIFIER_SIZE 10
@@ -366,7 +364,7 @@
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
@@ -380,14 +378,14 @@
#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;
@@ -407,7 +405,7 @@
#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
==== //depot/projects/usb/src/sys/dev/usb/usb_hid.h#9 (text+ko) ====
@@ -64,7 +64,7 @@
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))
==== //depot/projects/usb/src/sys/dev/usb/uvisor.c#23 (text+ko) ====
@@ -117,8 +117,8 @@
struct {
uByte port_function_id;
uByte port;
- } UPACKED connections[UVISOR_MAX_CONN];
-} UPACKED;
+ } __packed connections[UVISOR_MAX_CONN];
+} __packed;
#define UVISOR_CONNECTION_INFO_SIZE 18
@@ -148,8 +148,8 @@
uByte port;
uByte end_point_info;
uWord reserved;
- } UPACKED connections[UVISOR_MAX_CONN];
-} UPACKED;
+ } __packed connections[UVISOR_MAX_CONN];
+} __packed;
struct uvisor_softc {
struct ucom_super_softc sc_super_ucom;
More information about the p4-projects
mailing list