Skip to contentSkip to conversation

net: Remove VLANState

PATCH New [email protected] 1 participant 1 message Jun 19, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 8/17 net: Remove VLANState

From: Stefan Hajnoczi <[email protected]>

VLANState is no longer used and can be removed.

---
 hw/dp8393x.c        |    1 -
 hw/exynos4_boards.c |    2 +-
 hw/highbank.c       |    2 +-
 hw/integratorcp.c   |    2 +-
 hw/mcf5208.c        |    2 +-
 hw/mcf_fec.c        |    1 -
 hw/mips_mipssim.c   |    2 +-
 hw/mips_r4k.c       |    2 +-
 hw/vexpress.c       |    2 +-
 hw/xtensa_lx60.c    |    2 +-
 net.c               |  127 +++++++++------------------------------------------
 net.h               |    8 ---
 net/socket.c        |    6 +-
 net/tap.c           |    6 +-
 net/tap.h           |    2 +-
 qemu-common.h       |    1 -
 16 files changed, 37 insertions(+), 131 deletions(-)
hw/dp8393x.c +0 -1
index 017d074..3fd7677 100644
@@ -899,7 +899,6 @@ void dp83932_init(NICInfo *nd, target_phys_addr_t base, int it_shift,
     s->regs[SONIC_SR] = 0x0004; /* only revision recognized by Linux */
 
     s->conf.macaddr = nd->macaddr;
-    s->conf.vlan = nd->vlan;
     s->conf.peer = nd->netdev;
 
     s->nic = qemu_new_nic(&net_dp83932_info, &s->conf, nd->model, nd->name, s);
hw/exynos4_boards.c +1 -1
index e5c2a5f..4bb0a60 100644
@@ -81,7 +81,7 @@ static void lan9215_init(uint32_t base, qemu_irq irq)
     SysBusDevice *s;
 
     /* This should be a 9215 but the 9118 is close enough */
-    if (nd_table[0].vlan) {
+    if (nd_table[0].used) {
         qemu_check_nic_model(&nd_table[0], "lan9118");
         dev = qdev_create(NULL, "lan9118");
         qdev_set_nic_properties(dev, &nd_table[0]);
hw/highbank.c +1 -1
index 4bdea5d..11aa131 100644
@@ -284,7 +284,7 @@ static void highbank_init(ram_addr_t ram_size,
 
     sysbus_create_simple("sysbus-ahci", 0xffe08000, pic[83]);
 
-    if (nd_table[0].vlan) {
+    if (nd_table[0].used) {
         qemu_check_nic_model(&nd_table[0], "xgmac");
         dev = qdev_create(NULL, "xgmac");
         qdev_set_nic_properties(dev, &nd_table[0]);
hw/integratorcp.c +1 -1
index deacbf4..d0e2e90 100644
@@ -493,7 +493,7 @@ static void integratorcp_init(ram_addr_t ram_size,
     sysbus_create_simple("pl050_keyboard", 0x18000000, pic[3]);
     sysbus_create_simple("pl050_mouse", 0x19000000, pic[4]);
     sysbus_create_varargs("pl181", 0x1c000000, pic[23], pic[24], NULL);
-    if (nd_table[0].vlan)
+    if (nd_table[0].used)
         smc91c111_init(&nd_table[0], 0xc8000000, pic[27]);
 
     sysbus_create_simple("pl110", 0xc0000000, pic[22]);
hw/mcf5208.c +1 -1
index d3ebe8d..ee25b1b 100644
@@ -236,7 +236,7 @@ static void mcf5208evb_init(ram_addr_t ram_size,
         fprintf(stderr, "Too many NICs\n");
         exit(1);
     }
-    if (nd_table[0].vlan)
+    if (nd_table[0].used)
         mcf_fec_init(address_space_mem, &nd_table[0],
                      0xfc030000, pic + 36);
 
hw/mcf_fec.c +0 -1
index ae37bef..739b349 100644
@@ -472,7 +472,6 @@ void mcf_fec_init(MemoryRegion *sysmem, NICInfo *nd,
     memory_region_add_subregion(sysmem, base, &s->iomem);
 
     s->conf.macaddr = nd->macaddr;
-    s->conf.vlan = nd->vlan;
     s->conf.peer = nd->netdev;
 
     s->nic = qemu_new_nic(&net_mcf_fec_info, &s->conf, nd->model, nd->name, s);
hw/mips_mipssim.c +1 -1
index eb03047..830f635 100644
@@ -217,7 +217,7 @@ mips_mipssim_init (ram_addr_t ram_size,
     if (serial_hds[0])
         serial_init(0x3f8, env->irq[4], 115200, serial_hds[0]);
 
-    if (nd_table[0].vlan)
+    if (nd_table[0].used)
         /* MIPSnet uses the MIPS CPU INT0, which is interrupt 2. */
         mipsnet_init(0x4200, env->irq[2], &nd_table[0]);
 }
hw/mips_r4k.c +1 -1
index d685999..967a76e 100644
@@ -283,7 +283,7 @@ void mips_r4k_init (ram_addr_t ram_size,
 
     isa_vga_init(isa_bus);
 
-    if (nd_table[0].vlan)
+    if (nd_table[0].used)
         isa_ne2000_init(isa_bus, 0x300, 9, &nd_table[0]);
 
     ide_drive_get(hd, MAX_IDE_BUS);
hw/vexpress.c +1 -1
index 8072c5a..12aa2d5 100644
@@ -420,7 +420,7 @@ static void vexpress_common_init(const VEDBoardInfo *daughterboard,
     memory_region_add_subregion(sysmem, map[VE_VIDEORAM], vram);
 
     /* 0x4e000000 LAN9118 Ethernet */
-    if (nd_table[0].vlan) {
+    if (nd_table[0].used) {
         lan9118_init(&nd_table[0], map[VE_ETHERNET], pic[15]);
     }
 
hw/xtensa_lx60.c +1 -1
index 152eed9..c4f616f 100644
@@ -201,7 +201,7 @@ static void lx_init(const LxBoardDesc *board,
     memory_region_init(system_io, "lx60.io", 224 * 1024 * 1024);
     memory_region_add_subregion(system_memory, 0xf0000000, system_io);
     lx60_fpga_init(system_io, 0x0d020000);
-    if (nd_table[0].vlan) {
+    if (nd_table[0].used) {
         lx60_net_init(system_io, 0x0d030000, 0x0d030400, 0x0d800000,
                 xtensa_get_extint(env, 1), nd_table);
     }
net.c +22 -105

246 lines not on this page · raw message

net.h +0 -8
index 791ca4f..7b8501a 100644
@@ -64,7 +64,6 @@ struct VLANClientState {
     NetClientInfo *info;
     int link_down;
     QTAILQ_ENTRY(VLANClientState) next;
-    struct VLANState *vlan;
     VLANClientState *peer;
     NetQueue *send_queue;
     char *model;
@@ -80,13 +79,6 @@ typedef struct NICState {
     bool peer_deleted;
 } NICState;
 
-struct VLANState {
-    int id;
-    QTAILQ_HEAD(, VLANClientState) clients;
-    QTAILQ_ENTRY(VLANState) next;
-    NetQueue *send_queue;
-};
-
 VLANClientState *qemu_find_netdev(const char *id);
 VLANClientState *qemu_new_net_client(NetClientInfo *info,
                                      VLANClientState *peer,
net/socket.c +3 -3
index d4f7a7b..62e5ac5 100644
@@ -537,7 +537,7 @@ static int net_socket_mcast_init(VLANClientState *peer,
 
 }
 
-static int net_socket_udp_init(VLANState *vlan,
+static int net_socket_udp_init(NetClientState *peer,
                                  const char *model,
                                  const char *name,
                                  const char *rhost,
@@ -575,7 +575,7 @@ static int net_socket_udp_init(VLANState *vlan,
         return -1;
     }
 
-    s = net_socket_fd_init(vlan, model, name, fd, 0);
+    s = net_socket_fd_init(peer, model, name, fd, 0);
     if (!s) {
         return -1;
     }
@@ -678,7 +678,7 @@ int net_init_socket(QemuOpts *opts, const char *name, VLANClientState *peer)
                 return -1;
         }
 
-        if (net_socket_udp_init(vlan, "udp", name, udp, localaddr) == -1) {
+        if (net_socket_udp_init(peer, "udp", name, udp, localaddr) == -1) {
             return -1;
         }
     } else {
net/tap.c +3 -3
index 42e29fe..c241a65 100644
@@ -513,7 +513,7 @@ static int net_bridge_run_helper(const char *helper, const char *bridge)
     return -1;
 }
 
-int net_init_bridge(QemuOpts *opts, const char *name, VLANState *vlan)
+int net_init_bridge(QemuOpts *opts, const char *name, NetClientState *peer)
 {
     TAPState *s;
     int fd, vnet_hdr;
@@ -535,7 +535,7 @@ int net_init_bridge(QemuOpts *opts, const char *name, VLANState *vlan)
 
     vnet_hdr = tap_probe_vnet_hdr(fd);
 
-    s = net_tap_fd_init(vlan, "bridge", name, fd, vnet_hdr);
+    s = net_tap_fd_init(peer, "bridge", name, fd, vnet_hdr);
     if (!s) {
         close(fd);
         return -1;
@@ -650,7 +650,7 @@ int net_init_tap(QemuOpts *opts, const char *name, VLANClientState *peer)
         model = "tap";
     }
 
-    s = net_tap_fd_init(vlan, model, name, fd, vnet_hdr);
+    s = net_tap_fd_init(peer, model, name, fd, vnet_hdr);
     if (!s) {
         close(fd);
         return -1;
net/tap.h +1 -1
index d8bbc39..fcc90dc 100644
@@ -57,6 +57,6 @@ int tap_get_fd(VLANClientState *vc);
 struct vhost_net;
 struct vhost_net *tap_get_vhost_net(VLANClientState *vc);
 
-int net_init_bridge(QemuOpts *opts, const char *name, VLANState *vlan);
+int net_init_bridge(QemuOpts *opts, const char *name, NetClientState *peer);
 
 #endif /* QEMU_NET_TAP_H */
qemu-common.h +0 -1
index 8f87e41..b72ee07 100644
@@ -235,7 +235,6 @@ typedef struct TextConsole TextConsole;
 typedef TextConsole QEMUConsole;
 typedef struct CharDriverState CharDriverState;
 typedef struct MACAddr MACAddr;
-typedef struct VLANState VLANState;
 typedef struct VLANClientState VLANClientState;
 typedef struct i2c_bus i2c_bus;
 typedef struct ISABus ISABus;
Signature · 1 line
1.7.6