qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

i2c: Move the bus class to i2c.h

Some devices need access to it.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Message-id: 20180227104903.21353-3-linus.walleij@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

authored by

Corey Minyard and committed by
Peter Maydell
aa88d7ad 373b8ac7

+17 -17
-17
hw/i2c/core.c
··· 10 10 #include "qemu/osdep.h" 11 11 #include "hw/i2c/i2c.h" 12 12 13 - typedef struct I2CNode I2CNode; 14 - 15 - struct I2CNode { 16 - I2CSlave *elt; 17 - QLIST_ENTRY(I2CNode) next; 18 - }; 19 - 20 13 #define I2C_BROADCAST 0x00 21 14 22 - struct I2CBus { 23 - BusState qbus; 24 - QLIST_HEAD(, I2CNode) current_devs; 25 - uint8_t saved_address; 26 - bool broadcast; 27 - }; 28 - 29 15 static Property i2c_props[] = { 30 16 DEFINE_PROP_UINT8("address", struct I2CSlave, address, 0), 31 17 DEFINE_PROP_END_OF_LIST(), 32 18 }; 33 - 34 - #define TYPE_I2C_BUS "i2c-bus" 35 - #define I2C_BUS(obj) OBJECT_CHECK(I2CBus, (obj), TYPE_I2C_BUS) 36 19 37 20 static const TypeInfo i2c_bus_info = { 38 21 .name = TYPE_I2C_BUS,
+17
include/hw/i2c/i2c.h
··· 56 56 uint8_t address; 57 57 }; 58 58 59 + #define TYPE_I2C_BUS "i2c-bus" 60 + #define I2C_BUS(obj) OBJECT_CHECK(I2CBus, (obj), TYPE_I2C_BUS) 61 + 62 + typedef struct I2CNode I2CNode; 63 + 64 + struct I2CNode { 65 + I2CSlave *elt; 66 + QLIST_ENTRY(I2CNode) next; 67 + }; 68 + 69 + struct I2CBus { 70 + BusState qbus; 71 + QLIST_HEAD(, I2CNode) current_devs; 72 + uint8_t saved_address; 73 + bool broadcast; 74 + }; 75 + 59 76 I2CBus *i2c_init_bus(DeviceState *parent, const char *name); 60 77 void i2c_set_slave_address(I2CSlave *dev, uint8_t address); 61 78 int i2c_bus_busy(I2CBus *bus);