History

misc: mic: Fix endianness issues.

Endianness issues are now consistent as per the documentation in host/mic_virtio.h. Sparse warnings related to endianness are also fixed. Note that the MIC driver implementation assumes that the host can be both BE or LE whereas the card is always LE.

Ashutosh Dixit committed 12 years ago

Commit 173c0721 parent 1e31aa96 files · +28 −28Browse files

Showing the changes to include/uapi/linux (1 of 6 files). Show all

Unified · Split

include/uapi/linux/mic_common.h+7−7
@@ -43,7 +43,7 @@ struct mic_device_desc { · 42 unmodified lines
4343 __u8 feature_len;
4444 __u8 config_len;
4545 __u8 status;
46− __u64 config[0];
46+ __le64 config[0];
4747 } __attribute__ ((aligned(8)));
4848
4949 /**
@@ -61,7 +61,7 @@ struct mic_device_desc { · 11 unmodified lines
6161 * @h2c_vdev_db: The doorbell number to be used by host. Set by guest.
6262 */
6363 struct mic_device_ctrl {
64− __u64 vdev;
64+ __le64 vdev;
6565 __u8 config_change;
6666 __u8 vdev_reset;
6767 __u8 guest_ack;
@@ -82,7 +82,7 @@ struct mic_device_ctrl { · 14 unmodified lines
8282 * @shutdown_card: Set to 1 by the host when a card shutdown is initiated
8383 */
8484 struct mic_bootparam {
85− __u32 magic;
85+ __le32 magic;
8686 __s8 c2h_shutdown_db;
8787 __s8 h2c_shutdown_db;
8888 __s8 h2c_config_db;
@@ -111,9 +111,9 @@ struct mic_device_page { · 22 unmodified lines
111111 * @num: The number of entries in the virtio_ring
112112 */
113113 struct mic_vqconfig {
114− __u64 address;
115− __u64 used_address;
116− __u16 num;
114+ __le64 address;
115+ __le64 used_address;
116+ __le16 num;
117117 } __attribute__ ((aligned(8)));
118118
119119 /*
@@ -149,7 +149,7 @@ struct mic_vqconfig { · 29 unmodified lines
149149 */
150150 struct _mic_vring_info {
151151 __u16 avail_idx;
152− int magic;
152+ __le32 magic;
153153 };
154154
155155 /**