Commit f57fb884 authored by Anthony Liguori's avatar Anthony Liguori
Browse files

Merge remote-tracking branch 'stefanha/net' into staging

* stefanha/net:
  net: add the support for -netdev socket, listen
  net: fix the coding style
  hub: add the support for hub own flow control
  net: determine if packets can be sent before net queue deliver packets
  net: cleanup deliver/deliver_iov func pointers
  net: Make "info network" output more readable info
  net: Rename qemu_del_vlan_client() to qemu_del_net_client()
  net: Rename vc local variables to nc
  net: Rename VLANClientState to NetClientState
  net: Rename non_vlan_clients to net_clients
  net: Remove VLANState
  net: Remove vlan code from net.c
  net: Convert qdev_prop_vlan to peer with hub
  net: Drop vlan argument to qemu_new_net_client()
  hub: Check that hubs are configured correctly
  net: Look up 'vlan' net clients using hubs
  net: Use hubs for the vlan feature
  net: Add a hub net client
  net: Add interface to bridge when SIOCBRADDIF isn't available
parents 3d0b7b52 011de2b5
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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);
+3 −4
Original line number Diff line number Diff line
@@ -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;

@@ -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);
+5 −5
Original line number Diff line number Diff line
@@ -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;

@@ -1201,7 +1201,7 @@ pci_e1000_uninit(PCIDevice *dev)
    qemu_free_timer(d->autoneg_timer);
    memory_region_destroy(&d->mmio);
    memory_region_destroy(&d->io);
    qemu_del_vlan_client(&d->nic->nc);
    qemu_del_net_client(&d->nic->nc);
}

static NetClientInfo net_e1000_info = {
+4 −4
Original line number Diff line number Diff line
@@ -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;

@@ -1847,7 +1847,7 @@ static void pci_nic_uninit(PCIDevice *pci_dev)
    memory_region_destroy(&s->flash_bar);
    vmstate_unregister(&pci_dev->qdev, s->vmstate, s);
    eeprom93xx_free(&pci_dev->qdev, s->eeprom);
    qemu_del_vlan_client(&s->nic->nc);
    qemu_del_net_client(&s->nic->nc);
}

static NetClientInfo net_eepro100_info = {
+4 −4
Original line number Diff line number Diff line
@@ -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;

Loading