@@ -873,7 +873,7 @@ static void nic_cleanup(VLANClientState *nc)
qemu_free(s);
}
-static NetClientInfo net_dp83932_info = {
+static const NetClientInfo net_dp83932_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = nic_can_receive,
@@ -1067,7 +1067,7 @@ static void e1000_reset(void *opaque)
memset(&d->tx, 0, sizeof d->tx);
}
-static NetClientInfo net_e1000_info = {
+static const NetClientInfo net_e1000_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = e1000_can_receive,
@@ -1797,7 +1797,7 @@ static int pci_nic_uninit(PCIDevice *pci_dev)
return 0;
}
-static NetClientInfo net_eepro100_info = {
+static const NetClientInfo net_eepro100_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = nic_can_receive,
@@ -565,7 +565,7 @@ static void eth_cleanup(VLANClientState *nc)
qemu_free(eth);
}
-static NetClientInfo net_etraxfs_info = {
+static const NetClientInfo net_etraxfs_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = eth_can_receive,
@@ -1029,7 +1029,7 @@ static void lan9118_cleanup(VLANClientState *nc)
s->nic = NULL;
}
-static NetClientInfo net_lan9118_info = {
+static const NetClientInfo net_lan9118_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = lan9118_can_receive,
@@ -100,7 +100,7 @@ static void lance_cleanup(VLANClientState *nc)
pcnet_common_cleanup(d);
}
-static NetClientInfo net_lance_info = {
+static const NetClientInfo net_lance_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = pcnet_can_receive,
@@ -450,7 +450,7 @@ static void mcf_fec_cleanup(VLANClientState *nc)
qemu_free(s);
}
-static NetClientInfo net_mcf_fec_info = {
+static const NetClientInfo net_mcf_fec_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = mcf_fec_can_receive,
@@ -246,7 +246,7 @@ static void mipsnet_cleanup(VLANClientState *nc)
qemu_free(s);
}
-static NetClientInfo net_mipsnet_info = {
+static const NetClientInfo net_mipsnet_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = mipsnet_can_receive,
@@ -372,7 +372,7 @@ static void eth_cleanup(VLANClientState *nc)
s->nic = NULL;
}
-static NetClientInfo net_mv88w8618_info = {
+static const NetClientInfo net_mv88w8618_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = eth_can_receive,
@@ -42,7 +42,7 @@ static void isa_ne2000_cleanup(VLANClientState *nc)
s->nic = NULL;
}
-static NetClientInfo net_ne2000_isa_info = {
+static const NetClientInfo net_ne2000_isa_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = ne2000_can_receive,
@@ -705,7 +705,7 @@ static void ne2000_cleanup(VLANClientState *nc)
s->nic = NULL;
}
-static NetClientInfo net_ne2000_info = {
+static const NetClientInfo net_ne2000_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = ne2000_can_receive,
@@ -1891,7 +1891,7 @@ void pcnet_common_cleanup(PCNetState *d)
d->nic = NULL;
}
-int pcnet_common_init(DeviceState *dev, PCNetState *s, NetClientInfo *info)
+int pcnet_common_init(DeviceState *dev, PCNetState *s, const NetClientInfo *info)
{
s->poll_timer = qemu_new_timer(vm_clock, pcnet_poll_timer, s);
@@ -1959,7 +1959,7 @@ static int pci_pcnet_uninit(PCIDevice *dev)
return 0;
}
-static NetClientInfo net_pci_pcnet_info = {
+static const NetClientInfo net_pci_pcnet_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = pcnet_can_receive,
@@ -35,5 +35,5 @@ uint32_t pcnet_ioport_readw(void *opaque, uint32_t addr);
int pcnet_can_receive(VLANClientState *nc);
ssize_t pcnet_receive(VLANClientState *nc, const uint8_t *buf, size_t size_);
void pcnet_common_cleanup(PCNetState *d);
-int pcnet_common_init(DeviceState *dev, PCNetState *s, NetClientInfo *info);
+int pcnet_common_init(DeviceState *dev, PCNetState *s, const NetClientInfo *info);
extern const VMStateDescription vmstate_pcnet;
@@ -3305,7 +3305,7 @@ static int pci_rtl8139_uninit(PCIDevice *dev)
return 0;
}
-static NetClientInfo net_rtl8139_info = {
+static const NetClientInfo net_rtl8139_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = rtl8139_can_receive,
@@ -699,7 +699,7 @@ static void smc91c111_cleanup(VLANClientState *nc)
s->nic = NULL;
}
-static NetClientInfo net_smc91c111_info = {
+static const NetClientInfo net_smc91c111_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = smc91c111_can_receive,
@@ -396,7 +396,7 @@ static void stellaris_enet_cleanup(VLANClientState *nc)
qemu_free(s);
}
-static NetClientInfo net_stellaris_enet_info = {
+static const NetClientInfo net_stellaris_enet_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = stellaris_enet_can_receive,
@@ -1450,7 +1450,7 @@ static int usb_net_initfn(USBDevice *dev)
return 0;
}
-static NetClientInfo net_usbnet_info = {
+static const NetClientInfo net_usbnet_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = usbnet_can_receive,
@@ -818,7 +818,7 @@ static void virtio_net_cleanup(VLANClientState *nc)
n->nic = NULL;
}
-static NetClientInfo net_virtio_info = {
+static const NetClientInfo net_virtio_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = virtio_net_can_receive,
@@ -290,7 +290,7 @@ static ssize_t net_rx_packet(VLANClientState *nc, const uint8_t *buf, size_t siz
/* ------------------------------------------------------------- */
-static NetClientInfo net_xen_info = {
+static const NetClientInfo net_xen_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = net_rx_ok,
@@ -208,7 +208,7 @@ static void eth_cleanup(VLANClientState *nc)
s->nic = NULL;
}
-static NetClientInfo net_xilinx_ethlite_info = {
+static const NetClientInfo net_xilinx_ethlite_info = {
.type = NET_CLIENT_TYPE_NIC,
.size = sizeof(NICState),
.can_receive = eth_can_rx,
@@ -217,7 +217,7 @@ static ssize_t qemu_deliver_packet_iov(VLANClientState *sender,
int iovcnt,
void *opaque);
-VLANClientState *qemu_new_net_client(NetClientInfo *info,
+VLANClientState *qemu_new_net_client(const NetClientInfo *info,
VLANState *vlan,
VLANClientState *peer,
const char *model,
@@ -256,7 +256,7 @@ VLANClientState *qemu_new_net_client(NetClientInfo *info,
return vc;
}
-NICState *qemu_new_nic(NetClientInfo *info,
+NICState *qemu_new_nic(const NetClientInfo *info,
NICConf *conf,
const char *model,
const char *name,
@@ -54,7 +54,7 @@ typedef struct NetClientInfo {
} NetClientInfo;
struct VLANClientState {
- NetClientInfo *info;
+ const NetClientInfo *info;
int link_down;
QTAILQ_ENTRY(VLANClientState) next;
struct VLANState *vlan;
@@ -82,12 +82,12 @@ struct VLANState {
VLANState *qemu_find_vlan(int id, int allocate);
VLANClientState *qemu_find_netdev(const char *id);
-VLANClientState *qemu_new_net_client(NetClientInfo *info,
+VLANClientState *qemu_new_net_client(const NetClientInfo *info,
VLANState *vlan,
VLANClientState *peer,
const char *model,
const char *name);
-NICState *qemu_new_nic(NetClientInfo *info,
+NICState *qemu_new_nic(const NetClientInfo *info,
NICConf *conf,
const char *model,
const char *name,
@@ -90,7 +90,7 @@ static void dump_cleanup(VLANClientState *nc)
close(s->fd);
}
-static NetClientInfo net_dump_info = {
+static const NetClientInfo net_dump_info = {
.type = NET_CLIENT_TYPE_DUMP,
.size = sizeof(DumpState),
.receive = dump_receive,
@@ -125,7 +125,7 @@ static void net_slirp_cleanup(VLANClientState *nc)
QTAILQ_REMOVE(&slirp_stacks, s, entry);
}
-static NetClientInfo net_slirp_info = {
+static const NetClientInfo net_slirp_info = {
.type = NET_CLIENT_TYPE_SLIRP,
.size = sizeof(SlirpState),
.receive = net_slirp_receive,
@@ -216,7 +216,7 @@ static void net_socket_cleanup(VLANClientState *nc)
close(s->fd);
}
-static NetClientInfo net_dgram_socket_info = {
+static const NetClientInfo net_dgram_socket_info = {
.type = NET_CLIENT_TYPE_SOCKET,
.size = sizeof(NetSocketState),
.receive = net_socket_receive_dgram,
@@ -290,7 +290,7 @@ static void net_socket_connect(void *opaque)
qemu_set_fd_handler(s->fd, net_socket_send, NULL, s);
}
-static NetClientInfo net_socket_info = {
+static const NetClientInfo net_socket_info = {
.type = NET_CLIENT_TYPE_SOCKET,
.size = sizeof(NetSocketState),
.receive = net_socket_receive,
@@ -666,7 +666,7 @@ static void tap_win32_send(void *opaque)
}
}
-static NetClientInfo net_tap_win32_info = {
+static const NetClientInfo net_tap_win32_info = {
.type = NET_CLIENT_TYPE_TAP,
.size = sizeof(TAPState),
.receive = tap_receive,
@@ -264,7 +264,7 @@ static void tap_cleanup(VLANClientState *nc)
/* fd support */
-static NetClientInfo net_tap_info = {
+static const NetClientInfo net_tap_info = {
.type = NET_CLIENT_TYPE_TAP,
.size = sizeof(TAPState),
.receive = tap_receive,
@@ -69,7 +69,7 @@ static void vde_cleanup(VLANClientState *nc)
vde_close(s->vde);
}
-static NetClientInfo net_vde_info = {
+static const NetClientInfo net_vde_info = {
.type = NET_CLIENT_TYPE_VDE,
.size = sizeof(VDEState),
.receive = vde_receive,