Ticket #2998: bfe440x.2.diff

File bfe440x.2.diff, 2.1 KB (added by Adek336, 15 years ago)
  • src/add-ons/kernel/drivers/network/broadcom440x/dev/bfe/if_bfe.c

     
    444444
    445445    sc->bfe_dev = dev;
    446446
     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
    447461    /*
    448462     * Map control/status registers.
    449463     */
     
    458472        goto fail;
    459473    }
    460474
     475    dprintf("bfe: rman_get_bushandle(sc->bfe_res) 0x%x\n", rman_get_bushandle(sc->bfe_res));
     476
    461477    /* Allocate interrupt */
    462478    rid = 0;
    463479
     
    498514    ifp->if_snd.ifq_drv_maxlen = BFE_TX_QLEN;
    499515    IFQ_SET_READY(&ifp->if_snd);
    500516
     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
    501533    bfe_get_config(sc);
    502534
    503535    /* Reset the chip and turn on the PHY */
     
    854886    sc->bfe_enaddr[4] = eeprom[83];
    855887    sc->bfe_enaddr[5] = eeprom[82];
    856888
    857     sc->bfe_phyaddr = eeprom[90] & 0x1f;
     889    //sc->bfe_phyaddr = eeprom[90] & 0x1f;
     890    sc->bfe_phyaddr = 30;
    858891    sc->bfe_mdc_port = (eeprom[90] >> 14) & 0x1;
    859892
    860893    sc->bfe_core_unit = 0;
     
    11611194bfe_read_eeprom(struct bfe_softc *sc, u_int8_t *data)
    11621195{
    11631196    long i;
     1197    char buf[2048];
     1198    unsigned bp=0;
    11641199    u_int16_t *ptr = (u_int16_t *)data;
    11651200
    11661201    for(i = 0; i < 128; i += 2)
     1202    {
     1203        unsigned v;
    11671204        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);
    11681212}
    11691213
    11701214static int