Consolidate all forward typedef declarations to rocker.h. Signed-off-by: David Ahern <dsah...@gmail.com> Acked-by: Scott Feldman <sfel...@gmail.com> --- hw/net/rocker/rocker.c | 4 ++-- hw/net/rocker/rocker.h | 7 +++---- hw/net/rocker/rocker_desc.c | 10 ++++------ hw/net/rocker/rocker_desc.h | 4 ---- hw/net/rocker/rocker_fp.c | 4 ++-- hw/net/rocker/rocker_fp.h | 2 -- hw/net/rocker/rocker_of_dpa.h | 3 --- hw/net/rocker/rocker_world.c | 6 ++---- hw/net/rocker/rocker_world.h | 7 ++----- 9 files changed, 15 insertions(+), 32 deletions(-)
diff --git a/hw/net/rocker/rocker.c b/hw/net/rocker/rocker.c index 41052750a434..de0f7b96c54e 100644 --- a/hw/net/rocker/rocker.c +++ b/hw/net/rocker/rocker.c @@ -32,7 +32,7 @@ #include "rocker_world.h" #include "rocker_of_dpa.h" -typedef struct rocker { +struct rocker { /* private */ PCIDevice parent_obj; /* public */ @@ -65,7 +65,7 @@ typedef struct rocker { World *world_dflt; QLIST_ENTRY(rocker) next; -} Rocker; +}; #define ROCKER "rocker" diff --git a/hw/net/rocker/rocker.h b/hw/net/rocker/rocker.h index 656d7226746b..b3310b61ebc2 100644 --- a/hw/net/rocker/rocker.h +++ b/hw/net/rocker/rocker.h @@ -21,8 +21,6 @@ #include "qemu/sockets.h" -#include "rocker_world.h" - #if defined(DEBUG_ROCKER) # define DPRINTF(fmt, ...) \ do { \ @@ -68,11 +66,12 @@ static inline bool ipv6_addr_is_multicast(const Ipv6Addr *addr) return (addr->addr32[0] & htonl(0xFF000000)) == htonl(0xFF000000); } -typedef struct world World; typedef struct rocker Rocker; +typedef struct world World; +typedef struct desc_info DescInfo; +typedef struct desc_ring DescRing; Rocker *rocker_find(const char *name); -World *rocker_get_world(Rocker *r, enum rocker_world_type type); uint32_t rocker_fp_ports(Rocker *r); int rocker_event_link_changed(Rocker *r, uint32_t pport, bool link_up); int rocker_event_mac_vlan_seen(Rocker *r, uint32_t pport, uint8_t *addr, diff --git a/hw/net/rocker/rocker_desc.c b/hw/net/rocker/rocker_desc.c index 0a6dfae63b26..9d896fe470d8 100644 --- a/hw/net/rocker/rocker_desc.c +++ b/hw/net/rocker/rocker_desc.c @@ -22,9 +22,7 @@ #include "rocker_hw.h" #include "rocker_desc.h" -typedef struct desc_info DescInfo; - -typedef struct desc_ring { +struct desc_ring { hwaddr base_addr; uint32_t size; uint32_t head; @@ -36,14 +34,14 @@ typedef struct desc_ring { int index; desc_ring_consume *consume; unsigned msix_vector; -} DescRing; +}; -typedef struct desc_info { +struct desc_info { DescRing *ring; RockerDesc desc; char *buf; size_t buf_size; -} DescInfo; +}; uint16_t desc_buf_size(DescInfo *info) { diff --git a/hw/net/rocker/rocker_desc.h b/hw/net/rocker/rocker_desc.h index 0b57ba75275e..d4041f5c4c58 100644 --- a/hw/net/rocker/rocker_desc.h +++ b/hw/net/rocker/rocker_desc.h @@ -20,10 +20,6 @@ #include "rocker_hw.h" -typedef struct rocker Rocker; -typedef struct desc_ring DescRing; -typedef struct desc_info DescInfo; - typedef int (desc_ring_consume)(Rocker *r, DescInfo *info); uint16_t desc_buf_size(DescInfo *info); diff --git a/hw/net/rocker/rocker_fp.c b/hw/net/rocker/rocker_fp.c index 75513309f9a3..2f1e3b348a52 100644 --- a/hw/net/rocker/rocker_fp.c +++ b/hw/net/rocker/rocker_fp.c @@ -26,7 +26,7 @@ enum duplex { DUPLEX_FULL }; -typedef struct fp_port { +struct fp_port { Rocker *r; World *world; unsigned int index; @@ -39,7 +39,7 @@ typedef struct fp_port { uint8_t learning; NICState *nic; NICConf conf; -} FpPort; +}; bool fp_port_get_link_up(FpPort *port) { diff --git a/hw/net/rocker/rocker_fp.h b/hw/net/rocker/rocker_fp.h index eb67c64abeec..a5f28f120d5a 100644 --- a/hw/net/rocker/rocker_fp.h +++ b/hw/net/rocker/rocker_fp.h @@ -22,9 +22,7 @@ #define ROCKER_FP_PORTS_MAX 62 -typedef struct rocker Rocker; typedef struct fp_port FpPort; -typedef struct world World; int fp_port_eg(FpPort *port, const struct iovec *iov, int iovcnt); diff --git a/hw/net/rocker/rocker_of_dpa.h b/hw/net/rocker/rocker_of_dpa.h index 0af479085fa7..f3f6d77807a6 100644 --- a/hw/net/rocker/rocker_of_dpa.h +++ b/hw/net/rocker/rocker_of_dpa.h @@ -17,9 +17,6 @@ #ifndef _ROCKER_OF_DPA_H_ #define _ROCKER_OF_DPA_H_ -typedef struct rocker Rocker; -typedef struct world World; - World *of_dpa_world_alloc(Rocker *r); #endif /* _ROCKER_OF_DPA_H_ */ diff --git a/hw/net/rocker/rocker_world.c b/hw/net/rocker/rocker_world.c index a21829071fbc..b991e871d3b6 100644 --- a/hw/net/rocker/rocker_world.c +++ b/hw/net/rocker/rocker_world.c @@ -19,13 +19,11 @@ #include "rocker.h" #include "rocker_world.h" -typedef struct rocker Rocker; - -typedef struct world { +struct world { Rocker *r; enum rocker_world_type type; WorldOps *ops; -} World; +}; ssize_t world_ingress(World *world, uint32_t pport, const struct iovec *iov, int iovcnt) diff --git a/hw/net/rocker/rocker_world.h b/hw/net/rocker/rocker_world.h index a84419884c73..18d277b92720 100644 --- a/hw/net/rocker/rocker_world.h +++ b/hw/net/rocker/rocker_world.h @@ -19,11 +19,6 @@ #include "rocker_hw.h" -typedef struct world World; -typedef struct rocker Rocker; -typedef struct rocker_tlv RockerTlv; -typedef struct desc_info DescInfo; - enum rocker_world_type { ROCKER_WORLD_TYPE_OF_DPA = ROCKER_PORT_MODE_OF_DPA, ROCKER_WORLD_TYPE_MAX, @@ -60,4 +55,6 @@ Rocker *world_rocker(World *world); enum rocker_world_type world_type(World *world); const char *world_name(World *world); +World *rocker_get_world(Rocker *r, enum rocker_world_type type); + #endif /* _ROCKER_WORLD_H_ */ -- 2.1.0