Ticket #1590: newbroadcom.diff
File newbroadcom.diff, 8.7 KB (added by , 15 years ago) |
---|
-
build/jam/HaikuImage
143 143 #vlance 144 144 $(X86_ONLY)marvell_yukon $(X86_ONLY)syskonnect usb_ecm 145 145 $(GPL_ONLY)bcm570x 146 broadcom570x 146 147 ; 147 148 #BEOS_ADD_ONS_DRIVERS_ACPI = $(X86_ONLY)acpi_button ; 148 149 BEOS_ADD_ONS_BUS_MANAGERS = pci $(X86_ONLY)ps2 $(X86_ONLY)isa ide scsi … … 161 162 : generic_ide_pci it8211 legacy_sata silicon_image_3112 $(X86_ONLY)ide_isa ; 162 163 AddFilesToHaikuImage beos system add-ons kernel busses scsi 163 164 : ahci ; 164 AddFilesToHaikuImage beos system add-ons kernel busses usb165 : <usb>uhci <usb>ohci <usb>ehci ;165 #AddFilesToHaikuImage beos system add-ons kernel busses usb 166 # : <usb>uhci <usb>ohci <usb>ehci ; 166 167 AddFilesToHaikuImage beos system add-ons kernel console : vga_text ; 167 168 AddFilesToHaikuImage beos system add-ons kernel debugger 168 169 : $(X86_ONLY)<kdebug>disasm <kdebug>hangman <kdebug>invalidate_on_exit ; … … 385 386 $(PPC_ONLY)openpic 386 387 ide_adapter locked_pool scsi_periph 387 388 ahci generic_ide_pci it8211 legacy_sata silicon_image_3112 $(X86_ONLY)ide_isa 388 <usb>uhci <usb>ohci <usb>ehci389 # <usb>uhci <usb>ohci <usb>ehci 389 390 scsi_cd scsi_disk usb_disk 390 391 intel 391 392 bfs -
src/add-ons/kernel/drivers/network/broadcom570x/dev/bge/if_bge.c
398 398 static void bge_sig_legacy(struct bge_softc *, int); 399 399 static void bge_sig_pre_reset(struct bge_softc *, int); 400 400 static int bge_reset(struct bge_softc *); 401 staticvoid bge_link_upd(struct bge_softc *);401 /*static*/ void bge_link_upd(struct bge_softc *); 402 402 403 403 /* 404 404 * The BGE_REGISTER_DEBUG option is only for low-level debugging. It may … … 3025 3025 if (sc->bge_rx_saved_considx == 3026 3026 sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx) 3027 3027 return; 3028 //dprintf("bge_rxeof\n"); 3028 3029 3029 3030 ifp = sc->bge_ifp; 3030 3031 … … 3194 3195 sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx) 3195 3196 return; 3196 3197 3198 //dprintf("bge_txeof\n"); 3197 3199 ifp = sc->bge_ifp; 3198 3200 3199 3201 bus_dmamap_sync(sc->bge_cdata.bge_tx_ring_tag, … … 3318 3320 * Do the mandatory PCI flush as well as get the link status. 3319 3321 */ 3320 3322 statusword = CSR_READ_4(sc, BGE_MAC_STS) & BGE_MACSTAT_LINK_CHANGED; 3321 3323 //dprintf("bge_intr statusword=0x%x\n", statusword); 3322 3324 /* Make sure the descriptor ring indexes are coherent. */ 3323 3325 bus_dmamap_sync(sc->bge_cdata.bge_status_tag, 3324 3326 sc->bge_cdata.bge_status_map, BUS_DMASYNC_POSTREAD); … … 4320 4322 return (0); 4321 4323 } 4322 4324 4323 staticvoid4325 /*static */void 4324 4326 bge_link_upd(struct bge_softc *sc) 4325 4327 { 4326 4328 struct mii_data *mii; … … 4330 4332 4331 4333 /* Clear 'pending link event' flag. */ 4332 4334 sc->bge_link_evt = 0; 4335 dprintf("bge_link_upd\n"); 4333 4336 4334 4337 /* 4335 4338 * Process link state changes. … … 4348 4351 4349 4352 if (sc->bge_asicrev == BGE_ASICREV_BCM5700 && 4350 4353 sc->bge_chipid != BGE_CHIPID_BCM5700_B2) { 4354 dprintf("case 1\n"); 4351 4355 status = CSR_READ_4(sc, BGE_MAC_STS); 4352 4356 if (status & BGE_MACSTAT_MI_INTERRUPT) { 4357 dprintf("interrupt\n"); 4353 4358 mii = device_get_softc(sc->bge_miibus); 4354 4359 mii_pollstat(mii); 4355 4360 if (!sc->bge_link && 4356 4361 mii->mii_media_status & IFM_ACTIVE && 4357 4362 IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { 4358 4363 sc->bge_link++; 4364 dprintf("link UP\n"); 4359 4365 if (bootverbose) 4360 4366 if_printf(sc->bge_ifp, "link UP\n"); 4361 4367 } else if (sc->bge_link && 4362 4368 (!(mii->mii_media_status & IFM_ACTIVE) || 4363 4369 IFM_SUBTYPE(mii->mii_media_active) == IFM_NONE)) { 4364 4370 sc->bge_link = 0; 4371 dprintf("link DOWN\n"); 4365 4372 if (bootverbose) 4366 4373 if_printf(sc->bge_ifp, "link DOWN\n"); 4367 4374 } … … 4377 4384 } 4378 4385 4379 4386 if (sc->bge_flags & BGE_FLAG_TBI) { 4387 dprintf("case 2\n"); 4380 4388 status = CSR_READ_4(sc, BGE_MAC_STS); 4381 4389 if (status & BGE_MACSTAT_TBI_PCS_SYNCHED) { 4390 dprintf("TBI_PCS_SYNCHED\n"); 4382 4391 if (!sc->bge_link) { 4383 4392 sc->bge_link++; 4384 4393 if (sc->bge_asicrev == BGE_ASICREV_BCM5704) … … 4403 4412 * PHY link status directly. 4404 4413 */ 4405 4414 link = (CSR_READ_4(sc, BGE_MI_STS) & BGE_MISTS_LINK) ? 1 : 0; 4415 dprintf("Case 3: link=0x%x, sc->bge_link=0x%x\n", link, 4416 sc->bge_link); 4406 4417 4407 4418 if (link != sc->bge_link || 4408 4419 sc->bge_asicrev == BGE_ASICREV_BCM5700) { 4409 4420 mii = device_get_softc(sc->bge_miibus); 4410 4421 mii_pollstat(mii); 4422 dprintf("link changed mii->mii_media_status=0x%x" 4423 "mii->mii_media_active=0x%x\n", 4424 mii->mii_media_status, mii->mii_media_active); 4411 4425 if (!sc->bge_link && 4412 4426 mii->mii_media_status & IFM_ACTIVE && 4413 4427 IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { 4414 4428 sc->bge_link++; 4429 dprintf("link UP\n"); 4415 4430 if (bootverbose) 4416 4431 if_printf(sc->bge_ifp, "link UP\n"); 4417 4432 } else if (sc->bge_link && 4418 4433 (!(mii->mii_media_status & IFM_ACTIVE) || 4419 4434 IFM_SUBTYPE(mii->mii_media_active) == IFM_NONE)) { 4420 4435 sc->bge_link = 0; 4436 dprintf("link DOWN\n"); 4421 4437 if (bootverbose) 4422 4438 if_printf(sc->bge_ifp, "link DOWN\n"); 4423 4439 } -
src/add-ons/kernel/drivers/network/broadcom570x/dev/bge/glue.c
39 39 CSR_WRITE_4(sc, off, val); 40 40 } 41 41 42 /* 43 #define BGE_MACSTAT_TBI_PCS_SYNCHED 0x00000001 44 #define BGE_MACSTAT_TBI_SIGNAL_DETECT 0x00000002 45 #define BGE_MACSTAT_RX_CFG 0x00000004 46 #define BGE_MACSTAT_CFG_CHANGED 0x00000008 47 #define BGE_MACSTAT_SYNC_CHANGED 0x00000010 48 #define BGE_MACSTAT_PORT_DECODE_ERROR 0x00000400 49 #define BGE_MACSTAT_LINK_CHANGED 0x00001000 50 #define BGE_MACSTAT_MI_COMPLETE 0x00400000 51 #define BGE_MACSTAT_MI_INTERRUPT 0x00800000 52 #define BGE_MACSTAT_AUTOPOLL_ERROR 0x01000000 53 #define BGE_MACSTAT_ODI_ERROR 0x02000000 54 #define BGE_MACSTAT_RXSTAT_OFLOW 0x04000000 55 #define BGE_MACSTAT_TXSTAT_OFLOW 0x08000000 42 56 57 * 58 * PCI state register -- note, this register is read only 59 * unless the PCISTATE_WR bit of the PCI Misc. Host Control 60 * register is set. 61 * 62 #define BGE_PCISTATE_FORCE_RESET 0x00000001 63 #define BGE_PCISTATE_INTR_STATE 0x00000002 64 #define BGE_PCISTATE_PCI_BUSMODE 0x00000004 * 1 = PCI, 0 = PCI-X * 65 #define BGE_PCISTATE_PCI_BUSSPEED 0x00000008 * 1 = 66/133, 0 = 33/66 * 66 #define BGE_PCISTATE_32BIT_BUS 0x00000010 * 1 = 32bit, 0 = 64bit * 67 #define BGE_PCISTATE_WANT_EXPROM 0x00000020 68 #define BGE_PCISTATE_EXPROM_RETRY 0x00000040 69 #define BGE_PCISTATE_FLATVIEW_MODE 0x00000100 70 #define BGE_PCISTATE_PCI_TGT_RETRY_MAX 0x00000E00 71 72 #define IFF_DRV_RUNNING 0x10000 73 #define IFF_DRV_OACTIVE 0x20000 74 #define IFF_LINK0 0x40000 75 #define IFF_DEBUG 0x80000 76 77 */ 78 79 43 80 int 44 81 __haiku_disable_interrupts(device_t dev) 45 82 { 46 83 struct bge_softc *sc = device_get_softc(dev); 47 84 48 uint32 statusword = CSR_READ_4(sc, BGE_MAC_STS) & BGE_MACSTAT_LINK_CHANGED; 85 uint32 macstatusword = CSR_READ_4(sc, BGE_MAC_STS); 86 uint32 pcistate = pci_read_config(sc->bge_dev, BGE_PCI_PCISTATE,4); 87 uint32 linkchanged = macstatusword & BGE_MACSTAT_LINK_CHANGED; 88 uint32 pci_interrupted = !(pcistate & BGE_PCISTATE_INTR_STATE); 89 uint32 if_drv_running = sc->bge_ifp->if_drv_flags & IFF_DRV_RUNNING; 90 49 91 50 if ((sc->bge_ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 && !statusword 51 && (pci_read_config(sc->bge_dev, BGE_PCI_PCISTATE,4) & BGE_PCISTATE_INTR_STATE))92 93 if (!pci_interrupted) /* if_drv_running == 0 && */ 52 94 return 0; 95 /* dprintf("__haiku_disable_interrupts handling macstatusword=0x%x, pcistate=0x%x, " 96 "if_drv_flags=0x%x, linkchanged=0x%x, pci_interrupted=0x%x, " 97 "if_drv_running=0x%x, sc->bge_link_evt=0x%x\n", 98 macstatusword, pcistate, sc->bge_ifp->if_drv_flags, linkchanged, 99 pci_interrupted, if_drv_running, sc->bge_link_evt); 100 */ 53 101 102 if ((sc->bge_asicrev == BGE_ASICREV_BCM5700 && 103 sc->bge_chipid != BGE_CHIPID_BCM5700_B2) || 104 linkchanged || sc->bge_link_evt) 105 bge_link_upd(sc); 106 54 107 BGE_SETBIT(sc, BGE_PCI_MISC_CTL, BGE_PCIMISCCTL_MASK_PCI_INTR); 55 108 bge_writembx(sc, BGE_MBX_IRQ0_LO, 1); 56 109 -
src/libs/compat/freebsd_network/fbsd_mii_physubr.c
510 510 } 511 511 512 512 if (sc->mii_capabilities & BMSR_ANEG) { 513 ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), 514 MII_NMEDIA); /* intentionally invalid index */ 513 //ADD(IFM_MAKEWORD(IFM_ETHER, IFM_AUTO, 0, sc->mii_inst), 514 // MII_NMEDIA); /* intentionally invalid index */ 515 dprintf("don't know how to handle sc->mii_capabilities & BMSR_ANEG\n"); 515 516 PRINT("auto"); 516 517 } 517 518 #undef ADD 518 519 #undef PRINT