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.
Showing the changes to include/uapi/linux (1 of 6 files). Show all
Unified · Split
| @@ -43,7 +43,7 @@ struct mic_device_desc { · 42 unmodified lines | |||
| 43 | __u8 feature_len; | 43 | __u8 feature_len; |
| 44 | __u8 config_len; | 44 | __u8 config_len; |
| 45 | __u8 status; | 45 | __u8 status; |
| 46 | __u64 config[0]; | 46 | __le64 config[0]; |
| 47 | } __attribute__ ((aligned(8))); | 47 | } __attribute__ ((aligned(8))); |
| 48 | 48 | ||
| 49 | /** | 49 | /** |
| @@ -61,7 +61,7 @@ struct mic_device_desc { · 11 unmodified lines | |||
| 61 | * @h2c_vdev_db: The doorbell number to be used by host. Set by guest. | 61 | * @h2c_vdev_db: The doorbell number to be used by host. Set by guest. |
| 62 | */ | 62 | */ |
| 63 | struct mic_device_ctrl { | 63 | struct mic_device_ctrl { |
| 64 | __u64 vdev; | 64 | __le64 vdev; |
| 65 | __u8 config_change; | 65 | __u8 config_change; |
| 66 | __u8 vdev_reset; | 66 | __u8 vdev_reset; |
| 67 | __u8 guest_ack; | 67 | __u8 guest_ack; |
| @@ -82,7 +82,7 @@ struct mic_device_ctrl { · 14 unmodified lines | |||
| 82 | * @shutdown_card: Set to 1 by the host when a card shutdown is initiated | 82 | * @shutdown_card: Set to 1 by the host when a card shutdown is initiated |
| 83 | */ | 83 | */ |
| 84 | struct mic_bootparam { | 84 | struct mic_bootparam { |
| 85 | __u32 magic; | 85 | __le32 magic; |
| 86 | __s8 c2h_shutdown_db; | 86 | __s8 c2h_shutdown_db; |
| 87 | __s8 h2c_shutdown_db; | 87 | __s8 h2c_shutdown_db; |
| 88 | __s8 h2c_config_db; | 88 | __s8 h2c_config_db; |
| @@ -111,9 +111,9 @@ struct mic_device_page { · 22 unmodified lines | |||
| 111 | * @num: The number of entries in the virtio_ring | 111 | * @num: The number of entries in the virtio_ring |
| 112 | */ | 112 | */ |
| 113 | struct mic_vqconfig { | 113 | struct mic_vqconfig { |
| 114 | __u64 address; | 114 | __le64 address; |
| 115 | __u64 used_address; | 115 | __le64 used_address; |
| 116 | __u16 num; | 116 | __le16 num; |
| 117 | } __attribute__ ((aligned(8))); | 117 | } __attribute__ ((aligned(8))); |
| 118 | 118 | ||
| 119 | /* | 119 | /* |
| @@ -149,7 +149,7 @@ struct mic_vqconfig { · 29 unmodified lines | |||
| 149 | */ | 149 | */ |
| 150 | struct _mic_vring_info { | 150 | struct _mic_vring_info { |
| 151 | __u16 avail_idx; | 151 | __u16 avail_idx; |
| 152 | int magic; | 152 | __le32 magic; |
| 153 | }; | 153 | }; |
| 154 | 154 | ||
| 155 | /** | 155 | /** |