25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_le.c,v 1.39 2005/03/14 19:14:02 debug Exp $ |
* $Id: dev_le.c,v 1.40 2005/06/26 11:43:48 debug Exp $ |
29 |
* |
* |
30 |
* LANCE ethernet, as used in DECstations. |
* LANCE ethernet, as used in DECstations. |
31 |
* |
* |
768 |
uint64_t buf_start, uint64_t buf_end, int irq_nr, int len) |
uint64_t buf_start, uint64_t buf_end, int irq_nr, int len) |
769 |
{ |
{ |
770 |
char *name2; |
char *name2; |
771 |
|
size_t nlen = 55; |
772 |
struct le_data *d = malloc(sizeof(struct le_data)); |
struct le_data *d = malloc(sizeof(struct le_data)); |
773 |
|
|
774 |
if (d == NULL) { |
if (d == NULL) { |
819 |
SRAM_SIZE, dev_le_sram_access, (void *)d, |
SRAM_SIZE, dev_le_sram_access, (void *)d, |
820 |
MEM_BINTRANS_OK | MEM_BINTRANS_WRITE_OK, d->sram); |
MEM_BINTRANS_OK | MEM_BINTRANS_WRITE_OK, d->sram); |
821 |
|
|
822 |
name2 = malloc(50); |
name2 = malloc(nlen); |
823 |
if (name2 == NULL) { |
if (name2 == NULL) { |
824 |
fprintf(stderr, "out of memory in dev_le_init()\n"); |
fprintf(stderr, "out of memory in dev_le_init()\n"); |
825 |
exit(1); |
exit(1); |
826 |
} |
} |
827 |
sprintf(name2, "le [%02x:%02x:%02x:%02x:%02x:%02x]", |
snprintf(name2, nlen, "le [%02x:%02x:%02x:%02x:%02x:%02x]", |
828 |
d->rom[0], d->rom[1], d->rom[2], d->rom[3], d->rom[4], d->rom[5]); |
d->rom[0], d->rom[1], d->rom[2], d->rom[3], d->rom[4], d->rom[5]); |
829 |
|
|
830 |
memory_device_register(mem, name2, baseaddr + 0x100000, |
memory_device_register(mem, name2, baseaddr + 0x100000, |