net: xgmac: convert SysBus init method to a realize method
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 9/11 net: stellaris_enet: convert SysBus init method to a realize method
--- hw/net/stellaris_enet.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
hw/net/stellaris_enet.c +3 -5
@@ -473,9 +473,9 @@ static NetClientInfo net_stellaris_enet_info = { .receive = stellaris_enet_receive, }; -static int stellaris_enet_init (SysBusDevice *sbd) +static void stellaris_enet_realize (DeviceState *dev,Error **errp) { -DeviceState *dev =DEVICE (sbd); +SysBusDevice *sbd =SYS_BUS_DEVICE (dev);stellaris_enet_state *s =STELLARIS_ENET (dev); memory_region_init_io(&s->mmio, OBJECT(s), &stellaris_enet_ops, s,
@@ -489,7 +489,6 @@ static int stellaris_enet_init(SysBusDevice *sbd)qemu_format_nic_info_str (qemu_get_queue (s->nic), s->conf.macaddr.a);stellaris_enet_reset (s); -return 0 ; }static Property stellaris_enet_properties[] = {
@@ -500,9 +499,8 @@ static Property stellaris_enet_properties[] = {static void stellaris_enet_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass); -SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); - k->init = stellaris_enet_init; + dc->realize = stellaris_enet_realize; dc->props = stellaris_enet_properties; dc->vmsd = &vmstate_stellaris_enet; }
Signature · 1 line
2.17.1
Re: [Qemu-devel] [PATCH 09/11] net: stellaris_enet: convert SysBus init method to a realize method
Quoted 6 lines · Cédric Le Goater
Cc Peter Maydell <[email protected]>Signed-off-by Cédric Le Goater <[email protected]>--- hw/net/stellaris_enet.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
thanks
-- PMM
Re: [Qemu-devel] [PATCH 09/11] net: stellaris_enet: convert SysBus init method to a realize method
In reply to Cédric Le GoaterQuoted 3 lines · Cédric Le Goater
Cc Peter Maydell <[email protected]>Signed-off-by Cédric Le Goater <[email protected]>
Quoted 40 lines
--- hw/net/stellaris_enet.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)hw/net/stellaris_enet.c +3
-5@@ -473,9 +473,9 @@ static NetClientInfo net_stellaris_enet_info = { .receive = stellaris_enet_receive, }; -static int stellaris_enet_init (SysBusDevice *sbd) +static void stellaris_enet_realize (DeviceState *dev,Error **errp) { -DeviceState *dev =DEVICE (sbd); +SysBusDevice *sbd =SYS_BUS_DEVICE (dev);stellaris_enet_state *s =STELLARIS_ENET (dev); memory_region_init_io(&s->mmio, OBJECT(s), &stellaris_enet_ops, s,@@ -489,7 +489,6 @@ static int stellaris_enet_init(SysBusDevice *sbd)qemu_format_nic_info_str (qemu_get_queue (s->nic), s->conf.macaddr.a);stellaris_enet_reset (s); -return 0 ; }static Property stellaris_enet_properties[] = {@@ -500,9 +499,8 @@ static Property stellaris_enet_properties[] = {static void stellaris_enet_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass); -SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); - k->init = stellaris_enet_init; + dc->realize = stellaris_enet_realize; dc->props = stellaris_enet_properties; dc->vmsd = &vmstate_stellaris_enet; }
PATCH 10/11 net: stellaris_enet: add a reset method
In reply to a message not in the archive--- hw/net/stellaris_enet.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
hw/net/stellaris_enet.c +4 -3
@@ -457,8 +457,10 @@ static const MemoryRegionOps stellaris_enet_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; -static void stellaris_enet_reset (stellaris_enet_state *s) +static void stellaris_enet_reset (DeviceState *dev) { +stellaris_enet_state *s =STELLARIS_ENET (dev); + s->mdv =0x80 ; s->rctl =SE_RCTL_BADCRC ; s->im =SE_INT_PHY |SE_INT_MD |SE_INT_RXER |SE_INT_FOV |SE_INT_TXEMP
@@ -487,8 +489,6 @@ static void stellaris_enet_realize(DeviceState *dev, Error **errp) s->nic =qemu_new_nic (&net_stellaris_enet_info, &s->conf,object_get_typename (OBJECT (dev)), dev->id, s);qemu_format_nic_info_str (qemu_get_queue (s->nic), s->conf.macaddr.a); - -stellaris_enet_reset (s); }static Property stellaris_enet_properties[] = {
@@ -501,6 +501,7 @@ static void stellaris_enet_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = stellaris_enet_realize; + dc->reset = stellaris_enet_reset; dc->props = stellaris_enet_properties; dc->vmsd = &vmstate_stellaris_enet; }
Signature · 1 line
2.17.1
Re: [Qemu-arm] [PATCH 10/11] net: stellaris_enet: add a reset method
Quoted 7 lines · Cédric Le Goater
Cc Peter Maydell <[email protected]>Signed-off-by Cédric Le Goater <[email protected]>--- hw/net/stellaris_enet.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
thanks
-- PMM
Re: [Qemu-devel] [PATCH 10/11] net: stellaris_enet: add a reset method
In reply to Cédric Le GoaterQuoted 3 lines · Cédric Le Goater
Cc Peter Maydell <[email protected]>Signed-off-by Cédric Le Goater <[email protected]>
Quoted 38 lines
--- hw/net/stellaris_enet.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)hw/net/stellaris_enet.c +4
-3@@ -457,8 +457,10 @@ static const MemoryRegionOps stellaris_enet_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; -static void stellaris_enet_reset (stellaris_enet_state *s) +static void stellaris_enet_reset (DeviceState *dev) { +stellaris_enet_state *s =STELLARIS_ENET (dev); + s->mdv =0x80 ; s->rctl =SE_RCTL_BADCRC ; s->im =SE_INT_PHY |SE_INT_MD |SE_INT_RXER |SE_INT_FOV |SE_INT_TXEMP @@ -487,8 +489,6 @@ static void stellaris_enet_realize(DeviceState *dev, Error **errp) s->nic =qemu_new_nic (&net_stellaris_enet_info, &s->conf,object_get_typename (OBJECT (dev)), dev->id, s);qemu_format_nic_info_str (qemu_get_queue (s->nic), s->conf.macaddr.a); - -stellaris_enet_reset (s); }static Property stellaris_enet_properties[] = {@@ -501,6 +501,7 @@ static void stellaris_enet_class_init(ObjectClass *klass, void *data)DeviceClass *dc =DEVICE_CLASS (klass); dc->realize = stellaris_enet_realize; + dc->reset = stellaris_enet_reset; dc->props = stellaris_enet_properties; dc->vmsd = &vmstate_stellaris_enet; }
PATCH 11/11 net: xgmac: convert SysBus init method to a realize method
In reply to a message not in the archive--- hw/net/xgmac.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
hw/net/xgmac.c +3 -6
@@ -374,9 +374,9 @@ static NetClientInfo net_xgmac_enet_info = { .receive = eth_rx, }; -static int xgmac_enet_init (SysBusDevice *sbd) +static void xgmac_enet_realize (DeviceState *dev,Error **errp) { -DeviceState *dev =DEVICE (sbd); +SysBusDevice *sbd =SYS_BUS_DEVICE (dev);XgmacState *s =XGMAC (dev); memory_region_init_io(&s->iomem, OBJECT(s), &enet_mem_ops, s,
@@ -397,8 +397,6 @@ static int xgmac_enet_init(SysBusDevice *sbd) (s->conf.macaddr.a[2 ] <<16 ) | (s->conf.macaddr.a[1 ] <<8 ) | s->conf.macaddr.a[0 ]; - -return 0 ; }static Property xgmac_properties[] = {
@@ -408,10 +406,9 @@ static Property xgmac_properties[] = {static void xgmac_enet_class_init (ObjectClass *klass,void *data) { -SysBusDeviceClass *sbc =SYS_BUS_DEVICE_CLASS (klass);DeviceClass *dc =DEVICE_CLASS (klass); - sbc->init = xgmac_enet_init; + dc->realize = xgmac_enet_realize; dc->vmsd = &vmstate_xgmac; dc->props = xgmac_properties; }
Signature · 1 line
2.17.1
Quoted 8 lines · Cédric Le Goater
Cc Peter Maydell <[email protected]>Cc Rob Herring <[email protected]>Signed-off-by Cédric Le Goater <[email protected]>--- hw/net/xgmac.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
thanks
-- PMM
Quoted 4 lines · Cédric Le Goater
Cc Peter Maydell <[email protected]>Cc Rob Herring <[email protected]>Signed-off-by Cédric Le Goater <[email protected]>
Quoted 42 lines
--- hw/net/xgmac.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)hw/net/xgmac.c +3
-6@@ -374,9 +374,9 @@ static NetClientInfo net_xgmac_enet_info = { .receive = eth_rx, }; -static int xgmac_enet_init (SysBusDevice *sbd) +static void xgmac_enet_realize (DeviceState *dev,Error **errp) { -DeviceState *dev =DEVICE (sbd); +SysBusDevice *sbd =SYS_BUS_DEVICE (dev);XgmacState *s =XGMAC (dev); memory_region_init_io(&s->iomem, OBJECT(s), &enet_mem_ops, s,@@ -397,8 +397,6 @@ static int xgmac_enet_init(SysBusDevice *sbd) (s->conf.macaddr.a[2 ] <<16 ) | (s->conf.macaddr.a[1 ] <<8 ) | s->conf.macaddr.a[0 ]; - -return 0 ; }static Property xgmac_properties[] = {@@ -408,10 +406,9 @@ static Property xgmac_properties[] = {static void xgmac_enet_class_init (ObjectClass *klass,void *data) { -SysBusDeviceClass *sbc =SYS_BUS_DEVICE_CLASS (klass);DeviceClass *dc =DEVICE_CLASS (klass); - sbc->init = xgmac_enet_init; + dc->realize = xgmac_enet_realize; dc->vmsd = &vmstate_xgmac; dc->props = xgmac_properties; }
A message that is not in the archive (sent off-list or not yet received): [email protected]
Thomas Huth
Tested-byRe: [Qemu-devel] [PATCH 04/11] net: lance: convert SysBus init method to a realize method
Quoted 31 lines · Cédric Le Goater
Signed-off-by Cédric Le Goater <[email protected]>--- hw/net/lance.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)hw/net/lance.c +2
-3@@ -97,9 +97,9 @@ static const VMStateDescription vmstate_lance = { } }; -static int lance_init (SysBusDevice *sbd) +static void lance_realize (DeviceState *dev,Error **errp) { -DeviceState *dev =DEVICE (sbd); +SysBusDevice *sbd =SYS_BUS_DEVICE (dev);SysBusPCNetState *d =SYSBUS_PCNET (dev);PCNetState *s = &d->state;@@ -115,7 +115,6 @@ static int lance_init(SysBusDevice *sbd) s->phys_mem_read = ledma_memory_read; s->phys_mem_write = ledma_memory_write;pcnet_common_init (dev, s, &net_lance_info); -return 0 ; }static void lance_reset (DeviceState *dev)
hw/net/lance.c static Property lance_properties[] = { · line 150
Quoted 10 lines
hw/net/lance.c +1
-2@@ -144,9 +143,8 @@ static Property lance_properties[] = {static void lance_class_init (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass); -SysBusDeviceClass *k =SYS_BUS_DEVICE_CLASS (klass); - k->init = lance_init; + dc->realize = lance_realize;set_bit (DEVICE_CATEGORY_NETWORK , dc->categories); dc->fw_name ="ethernet" ; dc->reset = lance_reset;
Re: [Qemu-devel] [PATCH 00/11] net: convert SysBus init method to a realize method
In reply to a message not in the archiveHello,
Quoted 7 lines · Cédric Le Goater
Hello,
Here is my take to the SysBus init to realize method conversion. I picked the /net directory and did them all. Also added a couple of reset methods in separate patches.
make check tested
Do we have enough review for this series ? if so, may be it could go through Jason's tree ?
Thanks,
C.
Quoted 25 lines
Cédric Le Goater (11):
net:etraxfs_eth: convert SysBus init method to a realize method
net:etraxfs_eth: add a reset method
net: lan9118: convert SysBus init method to a realize method
net: lance: convert SysBus init method to a realize method
net:milkymist_minimac2: convert SysBus init method to a realize
method
net: mipsnet: convert SysBus init method to a realize method
net:opencores_eth: convert SysBus init method to a realize method
net: smc91c111: convert SysBus init method to a realize method
net:stellaris_enet: convert SysBus init method to a realize method
net:stellaris_enet: add a reset method
net: xgmac: convert SysBus init method to a realize methodhw/net/etraxfs_eth.c | 23 ++++++++++++++--------- hw/net/lan9118.c | 24 ++++++++++-------------- hw/net/lance.c | 8 +++----- hw/net/milkymist-minimac2.c | 9 +++------ hw/net/mipsnet.c | 9 +++------ hw/net/opencores_eth.c | 8 +++----- hw/net/smc91c111.c | 22 +++++++++------------- hw/net/stellaris_enet.c | 15 +++++++-------- hw/net/xgmac.c | 9 +++------ 9 files changed, 55 insertions(+), 72 deletions(-)
Re: [Qemu-devel] [PATCH 00/11] net: convert SysBus init method to a realize method
Quoted 5 lines · Cédric Le Goater
Hello,
Quoted 2 lines · Cédric Le Goater
Hello,
Quoted 8 lines
Quoted 5 lines
Here is my take to the SysBus init to realize method conversion. I picked the /net directory and did them all. Also added a couple of reset methods in separate patches.
make check tested
Do we have enough review for this series ? if so, may be it could go through Jason's tree ?
I meant v2.
https://patchwork.ozlabs.org/project/qemu-devel/list/?series=68378
Thanks,
C.