Ticket #2998: bfe440x.2.diff
File bfe440x.2.diff, 2.1 KB (added by , 16 years ago) |
---|
-
src/add-ons/kernel/drivers/network/broadcom440x/dev/bfe/if_bfe.c
444 444 445 445 sc->bfe_dev = dev; 446 446 447 { 448 int i=0; 449 char buf[1024]; unsigned bp=0; 450 while (bp < 1024 && i < 256) 451 { 452 if ((i & 0xf) == 0) 453 bp += snprintf(&buf[bp], 1024-bp, "(%02x)%08x:", i, pci_read_config(dev, i, 4)); 454 else 455 bp += snprintf(&buf[bp], 1024-bp, "%08x:", pci_read_config(dev, i, 4)); 456 i+=4; 457 } 458 dprintf("bfe: pci: %s\n", buf); 459 } 460 447 461 /* 448 462 * Map control/status registers. 449 463 */ … … 458 472 goto fail; 459 473 } 460 474 475 dprintf("bfe: rman_get_bushandle(sc->bfe_res) 0x%x\n", rman_get_bushandle(sc->bfe_res)); 476 461 477 /* Allocate interrupt */ 462 478 rid = 0; 463 479 … … 498 514 ifp->if_snd.ifq_drv_maxlen = BFE_TX_QLEN; 499 515 IFQ_SET_READY(&ifp->if_snd); 500 516 517 { 518 char buf[1024]; unsigned bp=0; 519 int i=0; 520 while ( i < 256 && bp < 1024 ) 521 { 522 unsigned v= CSR_READ_4(sc, i); 523 if ((i & 0xf) == 0) 524 bp += snprintf(&buf[bp], 1024-bp, "(%02x)%08x/", i, v); 525 else 526 bp += snprintf(&buf[bp], 1024-bp, "%08x/", v); 527 i += 4; 528 } 529 530 dprintf("bfe: attach: %s\n", buf); 531 } 532 501 533 bfe_get_config(sc); 502 534 503 535 /* Reset the chip and turn on the PHY */ … … 854 886 sc->bfe_enaddr[4] = eeprom[83]; 855 887 sc->bfe_enaddr[5] = eeprom[82]; 856 888 857 sc->bfe_phyaddr = eeprom[90] & 0x1f; 889 //sc->bfe_phyaddr = eeprom[90] & 0x1f; 890 sc->bfe_phyaddr = 30; 858 891 sc->bfe_mdc_port = (eeprom[90] >> 14) & 0x1; 859 892 860 893 sc->bfe_core_unit = 0; … … 1161 1194 bfe_read_eeprom(struct bfe_softc *sc, u_int8_t *data) 1162 1195 { 1163 1196 long i; 1197 char buf[2048]; 1198 unsigned bp=0; 1164 1199 u_int16_t *ptr = (u_int16_t *)data; 1165 1200 1166 1201 for(i = 0; i < 128; i += 2) 1202 { 1203 unsigned v; 1167 1204 ptr[i/2] = CSR_READ_4(sc, 4096 + i); 1205 v= ptr[i/2]; 1206 if (bp < 2048 && (i & 0xf) == 0) 1207 bp += snprintf(&buf[bp], 2048-bp, "(%02x)", i); 1208 if (bp < 2048) 1209 bp += snprintf(&buf[bp], 2048-bp, "%08x/", v); 1210 } 1211 dprintf("bfe: bfe_read_eeprom: %s\n", buf); 1168 1212 } 1169 1213 1170 1214 static int