All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 10/12] qdev/isa: convert ne2000
Date: Wed, 09 Sep 2009 21:58:07 +0200	[thread overview]
Message-ID: <4AA808CF.5010402@redhat.com> (raw)
In-Reply-To: <877hw8qa7q.fsf@pike.pond.sub.org>

>> +
>> +void isa_ne2000_init(int base, int irq, NICInfo *nd)
>
> Nitpick: in qdev parlance, this function is a create_simple, not an
> init.

Long-term I want zap that anyway ...

>> +{
>> +    ISADevice *dev;
>> +    NE2000State *s;
>> +
>> +    qemu_check_nic_model(nd, "ne2k_isa");
>> +
>> +    dev = isa_create("ne2k_isa");
>> +    qdev_prop_set_uint32(&dev->qdev, "iobase", base);
>> +    qdev_prop_set_uint32(&dev->qdev, "irq",    irq);
>> +    qdev_init(&dev->qdev);
>> +
>
> Shouldn't the rest be in isa_ne2000_initfn()?  Think of -device, which
> doesn't go through this function...

It should.  Need to figure a way to handle that nicely though, see below.

Right now you can't create a single nic via -device because they are not 
yet completely qdev-ified.  ne2k_isa is no exception here ;)

>> +    s =&DO_UPCAST(ISANE2000State, dev, dev)->ne2000;
>> +    memcpy(s->macaddr, nd->macaddr, 6);
>> +    ne2000_reset(s); /* needs macaddr */
>> +    s->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
>> +                                          ne2000_can_receive, ne2000_receive,
>> +                                          NULL, isa_ne2000_cleanup, s);
>
> Shouldn't this use qdev_get_vlan_client(), like the other qdevified
> NICs?

Have a close look at this vlan stuff is on my todo list.  Right now it 
is a big hack.  DeviceState->nd must go away, likewise 
qdev_get_vlan_client() and qdev_get_macaddr().  Instead do something 
sane using properties.

>> +typedef struct ISANE2000State {
>> +    ISADevice dev;
>> +    uint32_t iobase;
>> +    uint32_t isairq;
>> +    NE2000State ne2000;
>> +} ISANE2000State;
>
> ISANE2000State doesn't belong here, and isn't used as far as I can see.

Indeed.

cheers,
   Gerd

  reply	other threads:[~2009-09-09 19:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-09 14:45 [Qemu-devel] [PATCH 00/12] qdev isa patches Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 01/12] isapc: Fix irq routing Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 02/12] isapc: pick a more sane default cpu for such old hardware Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 03/12] qdev: drop iobase properties from isa bus Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 04/12] qdev: simplify isa irq assignments Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 05/12] qdev: tag isabus-bridge as no-user Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 06/12] qdev: add isa_create() function Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 07/12] qdev/isa: convert soundblaster Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 08/12] qdev/isa: convert cs4231a sound card Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 09/12] qdev/isa: convert gravis ultrasound Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 10/12] qdev/isa: convert ne2000 Gerd Hoffmann
2009-09-09 17:29   ` Markus Armbruster
2009-09-09 17:50   ` Markus Armbruster
2009-09-09 19:58     ` Gerd Hoffmann [this message]
2009-09-09 14:45 ` [Qemu-devel] [PATCH 11/12] qdev/isa: finish pckbd conversion Gerd Hoffmann
2009-09-09 14:45 ` [Qemu-devel] [PATCH 12/12] qdev/isa: convert real time clock Gerd Hoffmann
2009-09-09 19:43   ` [Qemu-devel] " Gerd Hoffmann
2009-09-11  9:29     ` Jan Kiszka
2009-09-11  9:32       ` Jan Kiszka
2009-09-09 17:56 ` [Qemu-devel] [PATCH 00/12] qdev isa patches Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AA808CF.5010402@redhat.com \
    --to=kraxel@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.