~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to hw/smc91c111.c

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno, Aurelien Jarno
  • Date: 2009-03-22 10:13:17 UTC
  • mfrom: (1.2.1 upstream) (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090322101317-iigjtnu5qil35dtb
Tags: 0.10.1-1
[ Aurelien Jarno ]
* New upstream stable release:
  - patches/80_stable-branch.patch: remove.
* debian/control: 
  - Remove depends on proll.
  - Move depends on device-tree-compiler to build-depends.
  - Bump Standards-Version to 3.8.1 (no changes).
* patches/82_qemu-img_decimal.patch: new patch from upstream to make
  qemu-img accept sizes with decimal values (closes: bug#501400).

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
#define NUM_PACKETS 4
18
18
 
19
19
typedef struct {
20
 
    uint32_t base;
21
20
    VLANClientState *vc;
22
21
    uint16_t tcr;
23
22
    uint16_t rcr;
249
248
{
250
249
    smc91c111_state *s = (smc91c111_state *)opaque;
251
250
 
252
 
    offset -= s->base;
253
251
    if (offset == 14) {
254
252
        s->bank = value;
255
253
        return;
422
420
{
423
421
    smc91c111_state *s = (smc91c111_state *)opaque;
424
422
 
425
 
    offset -= s->base;
426
423
    if (offset == 14) {
427
424
        return s->bank;
428
425
    }
571
568
static void smc91c111_writel(void *opaque, target_phys_addr_t offset,
572
569
                             uint32_t value)
573
570
{
574
 
    smc91c111_state *s = (smc91c111_state *)opaque;
575
571
    /* 32-bit writes to offset 0xc only actually write to the bank select
576
572
       register (offset 0xe)  */
577
 
    if (offset != s->base + 0xc)
 
573
    if (offset != 0xc)
578
574
        smc91c111_writew(opaque, offset, value & 0xffff);
579
575
    smc91c111_writew(opaque, offset + 2, value >> 16);
580
576
}
699
695
    smc91c111_state *s;
700
696
    int iomemtype;
701
697
 
 
698
    qemu_check_nic_model(nd, "smc91c111");
 
699
 
702
700
    s = (smc91c111_state *)qemu_mallocz(sizeof(smc91c111_state));
703
701
    iomemtype = cpu_register_io_memory(0, smc91c111_readfn,
704
702
                                       smc91c111_writefn, s);
705
703
    cpu_register_physical_memory(base, 16, iomemtype);
706
 
    s->base = base;
707
704
    s->irq = irq;
708
705
    memcpy(s->macaddr, nd->macaddr, 6);
709
706
 
710
707
    smc91c111_reset(s);
711
708
 
712
 
    s->vc = qemu_new_vlan_client(nd->vlan, smc91c111_receive,
713
 
                                 smc91c111_can_receive, s);
 
709
    s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
 
710
                                 smc91c111_receive, smc91c111_can_receive, s);
 
711
    qemu_format_nic_info_str(s->vc, s->macaddr);
714
712
    /* ??? Save/restore.  */
715
713
}