History

virtio_bt: Fix alignment in configuration struct

The current version of the configuration structure has unaligned 16-bit fields, but according to the specification [1], access to the configuration space must be aligned. Add a second, aligned version of the configuration structure and a new feature bit indicating that this version is being used. [1] https://docs.oasis-open.org/virtio/virtio/v1.1/virtio-v1.1.pdf

Igor Skalkin committed 4 years ago

Commit 47c50851 parent 3b1c7c02 files · +21 −3Browse files

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

Unified · Split

include/uapi/linux/virtio_bt.h+8−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
9#define VIRTIO_BT_F_VND_HCI 0 /* Indicates vendor command support */9#define VIRTIO_BT_F_VND_HCI 0 /* Indicates vendor command support */
10#define VIRTIO_BT_F_MSFT_EXT 1 /* Indicates MSFT vendor support */10#define VIRTIO_BT_F_MSFT_EXT 1 /* Indicates MSFT vendor support */
11#define VIRTIO_BT_F_AOSP_EXT 2 /* Indicates AOSP vendor support */11#define VIRTIO_BT_F_AOSP_EXT 2 /* Indicates AOSP vendor support */
12#define VIRTIO_BT_F_CONFIG_V2 3 /* Use second version configuration */
12 13
13enum virtio_bt_config_type {14enum virtio_bt_config_type {
14 VIRTIO_BT_CONFIG_TYPE_PRIMARY = 0,15 VIRTIO_BT_CONFIG_TYPE_PRIMARY = 0,
@@ -28,4 +29,11 @@ struct virtio_bt_config { · 13 unmodified lines
28 __u16 msft_opcode;29 __u16 msft_opcode;
29} __attribute__((packed));30} __attribute__((packed));
30 31
32struct virtio_bt_config_v2 {
33 __u8 type;
34 __u8 alignment;
35 __u16 vendor;
36 __u16 msft_opcode;
37};
38
31#endif /* _UAPI_LINUX_VIRTIO_BT_H */39#endif /* _UAPI_LINUX_VIRTIO_BT_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t