tulip: Move TulipState typedef to header

Move typedef closer to the type check macros, to make it easier
to convert the code to OBJECT_DEFINE_TYPE() in the future.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Tested-By: Roman Bolshakov <r.bolshakov@yadro.com>
Message-Id: <20200825192110.3528606-16-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
master
Eduardo Habkost 2020-08-25 15:20:11 -04:00
parent 79f6cf7e59
commit 57af4d7fbc
2 changed files with 3 additions and 2 deletions

View File

@ -18,7 +18,7 @@
#include "trace.h"
#include "net/eth.h"
typedef struct TULIPState {
struct TULIPState {
PCIDevice dev;
MemoryRegion io;
MemoryRegion memory;
@ -44,7 +44,7 @@ typedef struct TULIPState {
uint32_t rx_status;
uint8_t filter[16][6];
} TULIPState;
};
static const VMStateDescription vmstate_pci_tulip = {
.name = "tulip",

View File

@ -5,6 +5,7 @@
#include "net/net.h"
#define TYPE_TULIP "tulip"
typedef struct TULIPState TULIPState;
#define TULIP(obj) OBJECT_CHECK(TULIPState, (obj), TYPE_TULIP)
#define CSR(_x) ((_x) << 3)