rtoss - Diff between revs 74 and 79

Subversion Repositories:
Rev:
Show entire file - Ignore whitespace
Rev 74 Rev 79
Line 65... Line 65...
65     } rx[31]; 65     } rx[31];
66     uint8_t *rx_fifo; 66     uint8_t *rx_fifo;
67     int rx_fifo_len; 67     int rx_fifo_len;
68     int next_packet; 68     int next_packet;
69     VLANClientState *vc; 69     VLANClientState *vc;
-   70     NICConf conf;
70     qemu_irq irq; 71     qemu_irq irq;
71     uint8_t macaddr[6]; -  
72     int mmio_index; 72     int mmio_index;
73 } stellaris_enet_state; 73 } stellaris_enet_state;
74 74
75 static void stellaris_enet_update(stellaris_enet_state *s) 75 static void stellaris_enet_update(stellaris_enet_state *s)
76 { 76 {
Line 167... Line 167...
167             s->np--; 167             s->np--;
168             DPRINTF("RX done np=%d\n", s->np); 168             DPRINTF("RX done np=%d\n", s->np);
169         } 169         }
170         return val; 170         return val;
171     case 0x14: /* IA0 */ 171     case 0x14: /* IA0 */
172         return s->macaddr[0] | (s->macaddr[1] << 8) -  
173                | (s->macaddr[2] << 16) | (s->macaddr[3] << 24); -  
-   172         return s->conf.macaddr.a[0] | (s->conf.macaddr.a[1] << 8)
-   173                | (s->conf.macaddr.a[2] << 16) | (s->conf.macaddr.a[3] << 24);
174     case 0x18: /* IA1 */ 174     case 0x18: /* IA1 */
175         return s->macaddr[4] | (s->macaddr[5] << 8); -  
-   175         return s->conf.macaddr.a[4] | (s->conf.macaddr.a[5] << 8);
176     case 0x1c: /* THR */ 176     case 0x1c: /* THR */
177         return s->thr; 177         return s->thr;
178     case 0x20: /* MCTL */ 178     case 0x20: /* MCTL */
179         return s->mctl; 179         return s->mctl;
180     case 0x24: /* MDV */ 180     case 0x24: /* MDV */
Line 265... Line 265...
265                 DPRINTF("Done TX\n"); 265                 DPRINTF("Done TX\n");
266             } 266             }
267         } 267         }
268         break; 268         break;
269     case 0x14: /* IA0 */ 269     case 0x14: /* IA0 */
270         s->macaddr[0] = value; -  
271         s->macaddr[1] = value >> 8; -  
272         s->macaddr[2] = value >> 16; -  
273         s->macaddr[3] = value >> 24; -  
-   270         s->conf.macaddr.a[0] = value;
-   271         s->conf.macaddr.a[1] = value >> 8;
-   272         s->conf.macaddr.a[2] = value >> 16;
-   273         s->conf.macaddr.a[3] = value >> 24;
274         break; 274         break;
275     case 0x18: /* IA1 */ 275     case 0x18: /* IA1 */
276         s->macaddr[4] = value; -  
277         s->macaddr[5] = value >> 8; -  
-   276         s->conf.macaddr.a[4] = value;
-   277         s->conf.macaddr.a[5] = value >> 8;
278         break; 278         break;
279     case 0x1c: /* THR */ 279     case 0x1c: /* THR */
280         s->thr = value; 280         s->thr = value;
281         break; 281         break;
282     case 0x20: /* MCTL */ 282     case 0x20: /* MCTL */
Line 402... Line 402...
402 402
403     s->mmio_index = cpu_register_io_memory(stellaris_enet_readfn, 403     s->mmio_index = cpu_register_io_memory(stellaris_enet_readfn,
404                                            stellaris_enet_writefn, s); 404                                            stellaris_enet_writefn, s);
405     sysbus_init_mmio(dev, 0x1000, s->mmio_index); 405     sysbus_init_mmio(dev, 0x1000, s->mmio_index);
406     sysbus_init_irq(dev, &s->irq); 406     sysbus_init_irq(dev, &s->irq);
407     qdev_get_macaddr(&dev->qdev, s->macaddr); -  
-   407     qemu_macaddr_default_if_unset(&s->conf.macaddr);
408 408
409     s->vc = qdev_get_vlan_client(&dev->qdev, -  
-   409     s->vc = qemu_new_vlan_client(NET_CLIENT_TYPE_NIC,
-   410                                  s->conf.vlan, s->conf.peer,
-   411                                  dev->qdev.info->name, dev->qdev.id,
410                                  stellaris_enet_can_receive, 412                                  stellaris_enet_can_receive,
411                                  stellaris_enet_receive, NULL, -  
-   413                                  stellaris_enet_receive, NULL, NULL,
412                                  stellaris_enet_cleanup, s); 414                                  stellaris_enet_cleanup, s);
413     qemu_format_nic_info_str(s->vc, s->macaddr); -  
-   415     qemu_format_nic_info_str(s->vc, s->conf.macaddr.a);
414 416
415     stellaris_enet_reset(s); 417     stellaris_enet_reset(s);
416     register_savevm("stellaris_enet", -1, 1, 418     register_savevm("stellaris_enet", -1, 1,
417                     stellaris_enet_save, stellaris_enet_load, s); 419                     stellaris_enet_save, stellaris_enet_load, s);
418     return 0; 420     return 0;
419 } 421 }
-   422
-   423 static SysBusDeviceInfo stellaris_enet_info = {
-   424     .init = stellaris_enet_init,
-   425     .qdev.name  = "stellaris_enet",
-   426     .qdev.size  = sizeof(stellaris_enet_state),
-   427     .qdev.props = (Property[]) {
-   428         DEFINE_NIC_PROPERTIES(stellaris_enet_state, conf),
-   429         DEFINE_PROP_END_OF_LIST(),
-   430     }
-   431 };
420 432
421 static void stellaris_enet_register_devices(void) 433 static void stellaris_enet_register_devices(void)
422 { 434 {
423     sysbus_register_dev("stellaris_enet", sizeof(stellaris_enet_state), -  
424                         stellaris_enet_init); -  
-   435     sysbus_register_withprop(&stellaris_enet_info);
425 } 436 }
426 437
427 device_init(stellaris_enet_register_devices) 438 device_init(stellaris_enet_register_devices)