Commit 4e68f7a0 authored by Stefan Hajnoczi's avatar Stefan Hajnoczi

net: Rename VLANClientState to NetClientState

The vlan feature is no longer part of net core.  Rename VLANClientState
to NetClientState because net clients are not explicitly associated with
a vlan at all, instead they have a peer net client to which they are
connected.

This patch is a mechanical search-and-replace except for a few
whitespace fixups where changing VLANClientState to NetClientState
misaligned whitespace.
Signed-off-by: default avatarStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: default avatarZhi Yong Wu <wuzhy@linux.vnet.ibm.com>
Reviewed-by: default avatarLaszlo Ersek <lersek@redhat.com>
parent 94878994
......@@ -405,7 +405,7 @@ static void phy_update_link(GemState *s)
}
}
static int gem_can_receive(VLANClientState *nc)
static int gem_can_receive(NetClientState *nc)
{
GemState *s;
......@@ -602,7 +602,7 @@ static int gem_mac_address_filter(GemState *s, const uint8_t *packet)
* gem_receive:
* Fit a packet handed to us by QEMU into the receive descriptor ring.
*/
static ssize_t gem_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
unsigned desc[2];
target_phys_addr_t packet_desc_addr, last_desc_addr;
......@@ -1146,7 +1146,7 @@ static const MemoryRegionOps gem_ops = {
.endianness = DEVICE_LITTLE_ENDIAN,
};
static void gem_cleanup(VLANClientState *nc)
static void gem_cleanup(NetClientState *nc)
{
GemState *s = DO_UPCAST(NICState, nc, nc)->opaque;
......@@ -1154,7 +1154,7 @@ static void gem_cleanup(VLANClientState *nc)
s->nic = NULL;
}
static void gem_set_link(VLANClientState *nc)
static void gem_set_link(NetClientState *nc)
{
DB_PRINT("\n");
phy_update_link(DO_UPCAST(NICState, nc, nc)->opaque);
......
......@@ -673,7 +673,7 @@ static const MemoryRegionOps dp8393x_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
static int nic_can_receive(VLANClientState *nc)
static int nic_can_receive(NetClientState *nc)
{
dp8393xState *s = DO_UPCAST(NICState, nc, nc)->opaque;
......@@ -722,7 +722,7 @@ static int receive_filter(dp8393xState *s, const uint8_t * buf, int size)
return -1;
}
static ssize_t nic_receive(VLANClientState *nc, const uint8_t * buf, size_t size)
static ssize_t nic_receive(NetClientState *nc, const uint8_t * buf, size_t size)
{
dp8393xState *s = DO_UPCAST(NICState, nc, nc)->opaque;
uint16_t data[10];
......@@ -858,7 +858,7 @@ static void nic_reset(void *opaque)
dp8393x_update_irq(s);
}
static void nic_cleanup(VLANClientState *nc)
static void nic_cleanup(NetClientState *nc)
{
dp8393xState *s = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -720,7 +720,7 @@ receive_filter(E1000State *s, const uint8_t *buf, int size)
}
static void
e1000_set_link_status(VLANClientState *nc)
e1000_set_link_status(NetClientState *nc)
{
E1000State *s = DO_UPCAST(NICState, nc, nc)->opaque;
uint32_t old_status = s->mac_reg[STATUS];
......@@ -754,7 +754,7 @@ static bool e1000_has_rxbufs(E1000State *s, size_t total_size)
}
static int
e1000_can_receive(VLANClientState *nc)
e1000_can_receive(NetClientState *nc)
{
E1000State *s = DO_UPCAST(NICState, nc, nc)->opaque;
......@@ -770,7 +770,7 @@ static uint64_t rx_desc_base(E1000State *s)
}
static ssize_t
e1000_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
e1000_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
E1000State *s = DO_UPCAST(NICState, nc, nc)->opaque;
struct e1000_rx_desc desc;
......@@ -1185,7 +1185,7 @@ e1000_mmio_setup(E1000State *d)
}
static void
e1000_cleanup(VLANClientState *nc)
e1000_cleanup(NetClientState *nc)
{
E1000State *s = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -1616,7 +1616,7 @@ static const MemoryRegionOps eepro100_ops = {
.endianness = DEVICE_LITTLE_ENDIAN,
};
static int nic_can_receive(VLANClientState *nc)
static int nic_can_receive(NetClientState *nc)
{
EEPRO100State *s = DO_UPCAST(NICState, nc, nc)->opaque;
TRACE(RXTX, logout("%p\n", s));
......@@ -1626,7 +1626,7 @@ static int nic_can_receive(VLANClientState *nc)
#endif
}
static ssize_t nic_receive(VLANClientState *nc, const uint8_t * buf, size_t size)
static ssize_t nic_receive(NetClientState *nc, const uint8_t * buf, size_t size)
{
/* TODO:
* - Magic packets should set bit 30 in power management driver register.
......@@ -1831,7 +1831,7 @@ static const VMStateDescription vmstate_eepro100 = {
}
};
static void nic_cleanup(VLANClientState *nc)
static void nic_cleanup(NetClientState *nc)
{
EEPRO100State *s = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -507,12 +507,12 @@ static int eth_match_groupaddr(struct fs_eth *eth, const unsigned char *sa)
return match;
}
static int eth_can_receive(VLANClientState *nc)
static int eth_can_receive(NetClientState *nc)
{
return 1;
}
static ssize_t eth_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
static ssize_t eth_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
unsigned char sa_bcast[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
struct fs_eth *eth = DO_UPCAST(NICState, nc, nc)->opaque;
......@@ -549,7 +549,7 @@ static int eth_tx_push(void *opaque, unsigned char *buf, int len, bool eop)
return len;
}
static void eth_set_link(VLANClientState *nc)
static void eth_set_link(NetClientState *nc)
{
struct fs_eth *eth = DO_UPCAST(NICState, nc, nc)->opaque;
D(printf("%s %d\n", __func__, nc->link_down));
......@@ -566,7 +566,7 @@ static const MemoryRegionOps eth_ops = {
}
};
static void eth_cleanup(VLANClientState *nc)
static void eth_cleanup(NetClientState *nc)
{
struct fs_eth *eth = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -384,7 +384,7 @@ static void phy_update_link(lan9118_state *s)
phy_update_irq(s);
}
static void lan9118_set_link(VLANClientState *nc)
static void lan9118_set_link(NetClientState *nc)
{
phy_update_link(DO_UPCAST(NICState, nc, nc)->opaque);
}
......@@ -456,7 +456,7 @@ static void lan9118_reset(DeviceState *d)
lan9118_reload_eeprom(s);
}
static int lan9118_can_receive(VLANClientState *nc)
static int lan9118_can_receive(NetClientState *nc)
{
return 1;
}
......@@ -509,7 +509,7 @@ static int lan9118_filter(lan9118_state *s, const uint8_t *addr)
}
}
static ssize_t lan9118_receive(VLANClientState *nc, const uint8_t *buf,
static ssize_t lan9118_receive(NetClientState *nc, const uint8_t *buf,
size_t size)
{
lan9118_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
......@@ -1304,7 +1304,7 @@ static const MemoryRegionOps lan9118_16bit_mem_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
static void lan9118_cleanup(VLANClientState *nc)
static void lan9118_cleanup(NetClientState *nc)
{
lan9118_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -85,7 +85,7 @@ static const MemoryRegionOps lance_mem_ops = {
},
};
static void lance_cleanup(VLANClientState *nc)
static void lance_cleanup(NetClientState *nc)
{
PCNetState *d = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -351,13 +351,13 @@ static void mcf_fec_write(void *opaque, target_phys_addr_t addr,
mcf_fec_update(s);
}
static int mcf_fec_can_receive(VLANClientState *nc)
static int mcf_fec_can_receive(NetClientState *nc)
{
mcf_fec_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
return s->rx_enabled;
}
static ssize_t mcf_fec_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
static ssize_t mcf_fec_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
mcf_fec_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
mcf_fec_bd bd;
......@@ -439,7 +439,7 @@ static const MemoryRegionOps mcf_fec_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
static void mcf_fec_cleanup(VLANClientState *nc)
static void mcf_fec_cleanup(NetClientState *nc)
{
mcf_fec_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -278,7 +278,7 @@ static void update_rx_interrupt(MilkymistMinimac2State *s)
}
}
static ssize_t minimac2_rx(VLANClientState *nc, const uint8_t *buf, size_t size)
static ssize_t minimac2_rx(NetClientState *nc, const uint8_t *buf, size_t size)
{
MilkymistMinimac2State *s = DO_UPCAST(NICState, nc, nc)->opaque;
......@@ -408,7 +408,7 @@ static const MemoryRegionOps minimac2_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
static int minimac2_can_rx(VLANClientState *nc)
static int minimac2_can_rx(NetClientState *nc)
{
MilkymistMinimac2State *s = DO_UPCAST(NICState, nc, nc)->opaque;
......@@ -422,7 +422,7 @@ static int minimac2_can_rx(VLANClientState *nc)
return 0;
}
static void minimac2_cleanup(VLANClientState *nc)
static void minimac2_cleanup(NetClientState *nc)
{
MilkymistMinimac2State *s = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -62,7 +62,7 @@ static int mipsnet_buffer_full(MIPSnetState *s)
return 0;
}
static int mipsnet_can_receive(VLANClientState *nc)
static int mipsnet_can_receive(NetClientState *nc)
{
MIPSnetState *s = DO_UPCAST(NICState, nc, nc)->opaque;
......@@ -71,7 +71,7 @@ static int mipsnet_can_receive(VLANClientState *nc)
return !mipsnet_buffer_full(s);
}
static ssize_t mipsnet_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
static ssize_t mipsnet_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
MIPSnetState *s = DO_UPCAST(NICState, nc, nc)->opaque;
......@@ -209,7 +209,7 @@ static const VMStateDescription vmstate_mipsnet = {
}
};
static void mipsnet_cleanup(VLANClientState *nc)
static void mipsnet_cleanup(NetClientState *nc)
{
MIPSnetState *s = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -182,12 +182,12 @@ static void eth_rx_desc_get(uint32_t addr, mv88w8618_rx_desc *desc)
le32_to_cpus(&desc->next);
}
static int eth_can_receive(VLANClientState *nc)
static int eth_can_receive(NetClientState *nc)
{
return 1;
}
static ssize_t eth_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
static ssize_t eth_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
mv88w8618_eth_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
uint32_t desc_addr;
......@@ -366,7 +366,7 @@ static const MemoryRegionOps mv88w8618_eth_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
static void eth_cleanup(VLANClientState *nc)
static void eth_cleanup(NetClientState *nc)
{
mv88w8618_eth_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -36,7 +36,7 @@ typedef struct ISANE2000State {
NE2000State ne2000;
} ISANE2000State;
static void isa_ne2000_cleanup(VLANClientState *nc)
static void isa_ne2000_cleanup(NetClientState *nc)
{
NE2000State *s = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -165,7 +165,7 @@ static int ne2000_buffer_full(NE2000State *s)
return 0;
}
int ne2000_can_receive(VLANClientState *nc)
int ne2000_can_receive(NetClientState *nc)
{
NE2000State *s = DO_UPCAST(NICState, nc, nc)->opaque;
......@@ -176,7 +176,7 @@ int ne2000_can_receive(VLANClientState *nc)
#define MIN_BUF_SIZE 60
ssize_t ne2000_receive(VLANClientState *nc, const uint8_t *buf, size_t size_)
ssize_t ne2000_receive(NetClientState *nc, const uint8_t *buf, size_t size_)
{
NE2000State *s = DO_UPCAST(NICState, nc, nc)->opaque;
int size = size_;
......@@ -703,7 +703,7 @@ void ne2000_setup_io(NE2000State *s, unsigned size)
memory_region_init_io(&s->io, &ne2000_ops, s, "ne2000", size);
}
static void ne2000_cleanup(VLANClientState *nc)
static void ne2000_cleanup(NetClientState *nc)
{
NE2000State *s = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -31,5 +31,5 @@ typedef struct NE2000State {
void ne2000_setup_io(NE2000State *s, unsigned size);
extern const VMStateDescription vmstate_ne2000;
void ne2000_reset(NE2000State *s);
int ne2000_can_receive(VLANClientState *vc);
ssize_t ne2000_receive(VLANClientState *vc, const uint8_t *buf, size_t size_);
int ne2000_can_receive(NetClientState *vc);
ssize_t ne2000_receive(NetClientState *vc, const uint8_t *buf, size_t size_);
......@@ -311,7 +311,7 @@ static void open_eth_int_source_write(OpenEthState *s,
s->regs[INT_SOURCE] & s->regs[INT_MASK]);
}
static void open_eth_set_link_status(VLANClientState *nc)
static void open_eth_set_link_status(NetClientState *nc)
{
OpenEthState *s = DO_UPCAST(NICState, nc, nc)->opaque;
......@@ -342,7 +342,7 @@ static void open_eth_reset(void *opaque)
open_eth_set_link_status(&s->nic->nc);
}
static int open_eth_can_receive(VLANClientState *nc)
static int open_eth_can_receive(NetClientState *nc)
{
OpenEthState *s = DO_UPCAST(NICState, nc, nc)->opaque;
......@@ -351,7 +351,7 @@ static int open_eth_can_receive(VLANClientState *nc)
(rx_desc(s)->len_flags & RXD_E);
}
static ssize_t open_eth_receive(VLANClientState *nc,
static ssize_t open_eth_receive(NetClientState *nc,
const uint8_t *buf, size_t size)
{
OpenEthState *s = DO_UPCAST(NICState, nc, nc)->opaque;
......@@ -462,7 +462,7 @@ static ssize_t open_eth_receive(VLANClientState *nc,
return size;
}
static void open_eth_cleanup(VLANClientState *nc)
static void open_eth_cleanup(NetClientState *nc)
{
}
......
......@@ -264,7 +264,7 @@ static void pci_physical_memory_read(void *dma_opaque, target_phys_addr_t addr,
pci_dma_read(dma_opaque, addr, buf, len);
}
static void pci_pcnet_cleanup(VLANClientState *nc)
static void pci_pcnet_cleanup(NetClientState *nc)
{
PCNetState *d = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -1004,7 +1004,7 @@ static int pcnet_tdte_poll(PCNetState *s)
return !!(CSR_CXST(s) & 0x8000);
}
int pcnet_can_receive(VLANClientState *nc)
int pcnet_can_receive(NetClientState *nc)
{
PCNetState *s = DO_UPCAST(NICState, nc, nc)->opaque;
if (CSR_STOP(s) || CSR_SPND(s))
......@@ -1015,7 +1015,7 @@ int pcnet_can_receive(VLANClientState *nc)
#define MIN_BUF_SIZE 60
ssize_t pcnet_receive(VLANClientState *nc, const uint8_t *buf, size_t size_)
ssize_t pcnet_receive(NetClientState *nc, const uint8_t *buf, size_t size_)
{
PCNetState *s = DO_UPCAST(NICState, nc, nc)->opaque;
int is_padr = 0, is_bcast = 0, is_ladr = 0;
......@@ -1197,7 +1197,7 @@ ssize_t pcnet_receive(VLANClientState *nc, const uint8_t *buf, size_t size_)
return size_;
}
void pcnet_set_link_status(VLANClientState *nc)
void pcnet_set_link_status(NetClientState *nc)
{
PCNetState *d = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -57,9 +57,9 @@ uint32_t pcnet_ioport_readw(void *opaque, uint32_t addr);
void pcnet_ioport_writel(void *opaque, uint32_t addr, uint32_t val);
uint32_t pcnet_ioport_readl(void *opaque, uint32_t addr);
uint32_t pcnet_bcr_readw(PCNetState *s, uint32_t rap);
int pcnet_can_receive(VLANClientState *nc);
ssize_t pcnet_receive(VLANClientState *nc, const uint8_t *buf, size_t size_);
void pcnet_set_link_status(VLANClientState *nc);
int pcnet_can_receive(NetClientState *nc);
ssize_t pcnet_receive(NetClientState *nc, const uint8_t *buf, size_t size_);
void pcnet_set_link_status(NetClientState *nc);
void pcnet_common_cleanup(PCNetState *d);
int pcnet_common_init(DeviceState *dev, PCNetState *s, NetClientInfo *info);
extern const VMStateDescription vmstate_pcnet;
......@@ -584,7 +584,7 @@ PropertyInfo qdev_prop_chr = {
static int parse_netdev(DeviceState *dev, const char *str, void **ptr)
{
VLANClientState *netdev = qemu_find_netdev(str);
NetClientState *netdev = qemu_find_netdev(str);
if (netdev == NULL) {
return -ENOENT;
......@@ -598,7 +598,7 @@ static int parse_netdev(DeviceState *dev, const char *str, void **ptr)
static const char *print_netdev(void *ptr)
{
VLANClientState *netdev = ptr;
NetClientState *netdev = ptr;
return netdev->name ? netdev->name : "";
}
......@@ -625,7 +625,7 @@ PropertyInfo qdev_prop_netdev = {
static int print_vlan(DeviceState *dev, Property *prop, char *dest, size_t len)
{
VLANClientState **ptr = qdev_get_prop_ptr(dev, prop);
NetClientState **ptr = qdev_get_prop_ptr(dev, prop);
if (*ptr) {
int id;
......@@ -642,7 +642,7 @@ static void get_vlan(Object *obj, Visitor *v, void *opaque,
{
DeviceState *dev = DEVICE(obj);
Property *prop = opaque;
VLANClientState **ptr = qdev_get_prop_ptr(dev, prop);
NetClientState **ptr = qdev_get_prop_ptr(dev, prop);
int32_t id = -1;
if (*ptr) {
......@@ -660,10 +660,10 @@ static void set_vlan(Object *obj, Visitor *v, void *opaque,
{
DeviceState *dev = DEVICE(obj);
Property *prop = opaque;
VLANClientState **ptr = qdev_get_prop_ptr(dev, prop);
NetClientState **ptr = qdev_get_prop_ptr(dev, prop);
Error *local_err = NULL;
int32_t id;
VLANClientState *hubport;
NetClientState *hubport;
if (dev->state != DEV_STATE_CREATED) {
error_set(errp, QERR_PERMISSION_DENIED);
......@@ -1186,7 +1186,7 @@ void qdev_prop_set_chr(DeviceState *dev, const char *name, CharDriverState *valu
assert_no_error(errp);
}
void qdev_prop_set_netdev(DeviceState *dev, const char *name, VLANClientState *value)
void qdev_prop_set_netdev(DeviceState *dev, const char *name, NetClientState *value)
{
Error *errp = NULL;
assert(!value || value->name);
......
......@@ -289,9 +289,9 @@ extern PropertyInfo qdev_prop_pci_host_devaddr;
#define DEFINE_PROP_STRING(_n, _s, _f) \
DEFINE_PROP(_n, _s, _f, qdev_prop_string, char*)
#define DEFINE_PROP_NETDEV(_n, _s, _f) \
DEFINE_PROP(_n, _s, _f, qdev_prop_netdev, VLANClientState*)
DEFINE_PROP(_n, _s, _f, qdev_prop_netdev, NetClientState*)
#define DEFINE_PROP_VLAN(_n, _s, _f) \
DEFINE_PROP(_n, _s, _f, qdev_prop_vlan, VLANClientState*)
DEFINE_PROP(_n, _s, _f, qdev_prop_vlan, NetClientState*)
#define DEFINE_PROP_DRIVE(_n, _s, _f) \
DEFINE_PROP(_n, _s, _f, qdev_prop_drive, BlockDriverState *)
#define DEFINE_PROP_MACADDR(_n, _s, _f) \
......@@ -320,7 +320,7 @@ void qdev_prop_set_int32(DeviceState *dev, const char *name, int32_t value);
void qdev_prop_set_uint64(DeviceState *dev, const char *name, uint64_t value);
void qdev_prop_set_string(DeviceState *dev, const char *name, const char *value);
void qdev_prop_set_chr(DeviceState *dev, const char *name, CharDriverState *value);
void qdev_prop_set_netdev(DeviceState *dev, const char *name, VLANClientState *value);
void qdev_prop_set_netdev(DeviceState *dev, const char *name, NetClientState *value);
int qdev_prop_set_drive(DeviceState *dev, const char *name, BlockDriverState *value) QEMU_WARN_UNUSED_RESULT;
void qdev_prop_set_drive_nofail(DeviceState *dev, const char *name, BlockDriverState *value);
void qdev_prop_set_macaddr(DeviceState *dev, const char *name, uint8_t *value);
......
......@@ -788,7 +788,7 @@ static bool rtl8139_cp_rx_valid(RTL8139State *s)
return !(s->RxRingAddrLO == 0 && s->RxRingAddrHI == 0);
}
static int rtl8139_can_receive(VLANClientState *nc)
static int rtl8139_can_receive(NetClientState *nc)
{
RTL8139State *s = DO_UPCAST(NICState, nc, nc)->opaque;
int avail;
......@@ -810,7 +810,7 @@ static int rtl8139_can_receive(VLANClientState *nc)
}
}
static ssize_t rtl8139_do_receive(VLANClientState *nc, const uint8_t *buf, size_t size_, int do_interrupt)
static ssize_t rtl8139_do_receive(NetClientState *nc, const uint8_t *buf, size_t size_, int do_interrupt)
{
RTL8139State *s = DO_UPCAST(NICState, nc, nc)->opaque;
/* size is the length of the buffer passed to the driver */
......@@ -1187,7 +1187,7 @@ static ssize_t rtl8139_do_receive(VLANClientState *nc, const uint8_t *buf, size_
return size_;
}
static ssize_t rtl8139_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
static ssize_t rtl8139_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
return rtl8139_do_receive(nc, buf, size, 1);
}
......@@ -3431,7 +3431,7 @@ static void rtl8139_timer(void *opaque)
rtl8139_set_next_tctr_time(s, qemu_get_clock_ns(vm_clock));
}
static void rtl8139_cleanup(VLANClientState *nc)
static void rtl8139_cleanup(NetClientState *nc)
{
RTL8139State *s = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -628,7 +628,7 @@ static uint32_t smc91c111_readl(void *opaque, target_phys_addr_t offset)
return val;
}
static int smc91c111_can_receive(VLANClientState *nc)
static int smc91c111_can_receive(NetClientState *nc)
{
smc91c111_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
......@@ -639,7 +639,7 @@ static int smc91c111_can_receive(VLANClientState *nc)
return 1;
}
static ssize_t smc91c111_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
static ssize_t smc91c111_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
smc91c111_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
int status;
......@@ -728,7 +728,7 @@ static const MemoryRegionOps smc91c111_mem_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
static void smc91c111_cleanup(VLANClientState *nc)
static void smc91c111_cleanup(NetClientState *nc)
{
smc91c111_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -83,14 +83,14 @@ typedef struct VIOsPAPRVLANDevice {
target_ulong rxq_ptr;
} VIOsPAPRVLANDevice;
static int spapr_vlan_can_receive(VLANClientState *nc)
static int spapr_vlan_can_receive(NetClientState *nc)
{
VIOsPAPRVLANDevice *dev = DO_UPCAST(NICState, nc, nc)->opaque;
return (dev->isopen && dev->rx_bufs > 0);
}
static ssize_t spapr_vlan_receive(VLANClientState *nc, const uint8_t *buf,
static ssize_t spapr_vlan_receive(NetClientState *nc, const uint8_t *buf,
size_t size)
{
VIOsPAPRDevice *sdev = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -78,7 +78,7 @@ static void stellaris_enet_update(stellaris_enet_state *s)
}
/* TODO: Implement MAC address filtering. */
static ssize_t stellaris_enet_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
static ssize_t stellaris_enet_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
stellaris_enet_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
int n;
......@@ -120,7 +120,7 @@ static ssize_t stellaris_enet_receive(VLANClientState *nc, const uint8_t *buf, s
return size;
}
static int stellaris_enet_can_receive(VLANClientState *nc)
static int stellaris_enet_can_receive(NetClientState *nc)
{
stellaris_enet_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
......@@ -381,7 +381,7 @@ static int stellaris_enet_load(QEMUFile *f, void *opaque, int version_id)
return 0;
}
static void stellaris_enet_cleanup(VLANClientState *nc)
static void stellaris_enet_cleanup(NetClientState *nc)
{
stellaris_enet_state *s = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -1247,7 +1247,7 @@ static int usb_net_handle_data(USBDevice *dev, USBPacket *p)
return ret;
}
static ssize_t usbnet_receive(VLANClientState *nc, const uint8_t *buf, size_t size)
static ssize_t usbnet_receive(NetClientState *nc, const uint8_t *buf, size_t size)
{
USBNetState *s = DO_UPCAST(NICState, nc, nc)->opaque;
struct rndis_packet_msg_type *msg;
......@@ -1285,7 +1285,7 @@ static ssize_t usbnet_receive(VLANClientState *nc, const uint8_t *buf, size_t si
return size;
}
static int usbnet_can_receive(VLANClientState *nc)
static int usbnet_can_receive(NetClientState *nc)
{
USBNetState *s = DO_UPCAST(NICState, nc, nc)->opaque;
......@@ -1296,7 +1296,7 @@ static int usbnet_can_receive(VLANClientState *nc)
return !s->in_len;
}
static void usbnet_cleanup(VLANClientState *nc)
static void usbnet_cleanup(NetClientState *nc)
{
USBNetState *s = DO_UPCAST(NICState, nc, nc)->opaque;
......
......@@ -42,7 +42,7 @@ struct vhost_net {
struct vhost_dev dev;
struct vhost_virtqueue vqs[2];
int backend;
VLANClientState *vc;
NetClientState *vc;
};
unsigned vhost_net_get_features(struct vhost_net *net, unsigned features)
......@@ -80,7 +80,7 @@ void vhost_net_ack_features(struct vhost_net *net, unsigned features)
}
}
static int vhost_net_get_fd(VLANClientState *backend)
static int vhost_net_get_fd(NetClientState *backend)
{
switch (backend->info->type) {
case NET_CLIENT_OPTIONS_KIND_TAP:
......@@ -91,7 +91,7 @@ static int vhost_net_get_fd(VLANClientState *backend)
}
}
struct vhost_net *vhost_net_init(VLANClientState *backend, int devfd,
struct vhost_net *vhost_net_init(NetClientState *backend, int devfd,
bool force)
{
int r;
......@@ -214,7 +214,7 @@ void vhost_net_cleanup(struct vhost_net *net)
g_free(net);
}
#else
struct vhost_net *vhost_net_init(VLANClientState *backend, int devfd,
struct vhost_net *vhost_net_init(NetClientState *backend, int devfd,
bool force)
{
error_report("vhost-net support is not compiled in");
......
......@@ -6,7 +6,7 @@
struct vhost_net;
typedef struct vhost_net VHostNetState;
VHostNetState *vhost_net_init(VLANClientState *backend, int devfd, bool force);
VHostNetState *vhost_net_init(NetClientState *backend, int devfd, bool force);
bool vhost_net_query(VHostNetState *net, VirtIODevice *dev);
int vhost_net_start(VHostNetState *net, VirtIODevice *dev);
......
......@@ -163,7 +163,7 @@ static void virtio_net_set_status(struct VirtIODevice *vdev, uint8_t status)
}
}
static void virtio_net_set_link_status(VLANClientState *nc)
static void virtio_net_set_link_status(NetClientState *nc)
{
VirtIONet *n = DO_UPCAST(NICState, nc, nc)->opaque;
uint16_t old_status = n->status;
......@@ -453,7 +453,7 @@ static void virtio_net_handle_rx(VirtIODevice *vdev, VirtQueue *vq)
qemu_notify_event();
}
static int virtio_net_can_receive(VLANClientState *nc)
static int virtio_net_can_receive(NetClientState *nc)
{
VirtIONet *n = DO_UPCAST(NICState, nc, nc)->opaque;
if (!n->vdev.vm_running) {
......@@ -593,7 +593,7 @@ static int receive_filter(VirtIONet *n, const uint8_t *buf, int size)
return 0;
}