summaryrefslogtreecommitdiffstats
path: root/sys/dev/bm
Commit message (Collapse)AuthorAgeFilesLines
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-041-3/+3
| | | | malloc(9) flags in sys/dev.
* ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it againkevlo2012-01-071-1/+0
| | | | Reviewed by: yongari
* - There's no need to overwrite the default device method with the defaultmarius2011-11-221-5/+2
| | | | | | | | | | one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID.
* - Import the common MII bitbang'ing code from NetBSD and convert drivers tomarius2011-11-013-200/+40
| | | | | | | | | | | | | | | | | | | | | | | | take advantage of it instead of duplicating it. This reduces the size of the i386 GENERIC kernel by about 4k. The only potential in-tree user left unconverted is xe(4), which generally should be changed to use miibus(4) instead of implementing PHY handling on its own, as otherwise it makes not much sense to add a dependency on miibus(4)/mii_bitbang(4) to xe(4) just for the MII bitbang'ing code. The common MII bitbang'ing code also is useful in the embedded space for using GPIO pins to implement MII access. - Based on lessons learnt with dc(4) (see r185750), add bus barriers to the MII bitbang read and write functions of the other drivers converted in order to ensure the intended ordering. Given that register access via an index register as well as register bank/window switching is subject to the same problem, also add bus barriers to the respective functions of smc(4), tl(4) and xl(4). - Sprinkle some const. Thanks to the following testers: Andrew Bliznak (nge(4)), nwhitehorn@ (bm(4)), yongari@ (sis(4) and ste(4)) Thanks to Hans-Joerg Sirtl for supplying hardware to test stge(4). Reviewed by: yongari (subset of drivers) Obtained from: NetBSD (partially)
* Remove some hacks to handle strange behavior of LXT 970 PHYs now betternwhitehorn2011-05-121-10/+0
| | | | | handled in miibus after r221812. Thanks to marius@ for piecing this together!
* Do not use Open Firmware to open the device and instead program its startnwhitehorn2011-05-061-19/+15
| | | | | | | | on our own. This prevents hangs at boot when using a bm(4) NIC where the cable is not plugged in at boot time. Obtained from: NetBSD MFC after: 1 week
* Convert the PHY drivers to honor the mii_flags passed down and convertmarius2010-10-151-5/+13
| | | | | | | | | | | | | | | | | | | | | | | the NIC drivers as well as the PHY drivers to take advantage of the mii_attach() introduced in r213878 to get rid of certain hacks. For the most part these were: - Artificially limiting miibus_{read,write}reg methods to certain PHY addresses; we now let mii_attach() only probe the PHY at the desired address(es) instead. - PHY drivers setting MIIF_* flags based on the NIC driver they hang off from, partly even based on grabbing and using the softc of the parent; we now pass these flags down from the NIC to the PHY drivers via mii_attach(). This got us rid of all such hacks except those of brgphy() in combination with bce(4) and bge(4), which is way beyond what can be expressed with simple flags. While at it, I took the opportunity to change the NIC drivers to pass up the error returned by mii_attach() (previously by mii_phy_probe()) and unify the error message used in this case where and as appropriate as mii_attach() actually can fail for a number of reasons, not just because of no PHY(s) being present at the expected address(es). Reviewed by: jhb, yongari
* Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/rwatson2009-06-261-2/+2
| | | | | | | | | | | | | IF_ADDR_UNLOCK() across network device drivers when accessing the per-interface multicast address list, if_multiaddrs. This will allow us to change the locking strategy without affecting our driver programming interface or binary interface. For two wireless drivers, remove unnecessary locking, since they don't actually access the multicast address list. Approved by: re (kib) MFC after: 6 weeks
* Fix bm_shutdown() KOBJ method to correspond to return int, as it should.nwhitehorn2009-02-041-2/+4
| | | | Found by: Andriy Gapon
* Change the way we enable the BMAC cell in macio. Instead of calling thenwhitehorn2008-10-131-9/+13
| | | | | | | | macio's enable-enet word, which apparently does nothing on some machines, open an OF instance of the ethernet controller. This fixes cold booting from disk on my Blue & White G3. MFC after: 3 days
* Change the DBDMA API to allow DBDMA registers in a subregion of a resource. ↵nwhitehorn2008-09-231-2/+2
| | | | | | This is necessary to allow future support of DMA for the various Apple on-board ATA controllers. MFC after: 1 week
* Fix a multiple locking bug in bm(4) that could cause panics on a ↵nwhitehorn2008-09-021-1/+1
| | | | | | | WITNESS-enabled kernel. Approved by: marcel (mentor) MFC after: 1 day
* Fix some locking and logic bugs pointed out by jhb. These fix driver detach ↵nwhitehorn2008-07-033-40/+26
| | | | | | and speed up data transfer by nearly a factor of 2. Approved by: marcel (mentor)
* Add support for the Apple Big Mac (BMAC) Ethernet controller,marcel2008-06-073-0/+1755
found on various Apple G3 models. Submitted by: Nathan Whitehorn
OpenPOWER on IntegriCloud