summaryrefslogtreecommitdiffstats
path: root/sys/dev/ae
Commit message (Collapse)AuthorAgeFilesLines
* MFC r259543:yongari2014-04-141-18/+13
| | | | | | Failed m_devget(9) indicates lack of free mbuf cluster. Update if_iqdrops counter for that case since the received frame is ok. While here, simplify updating counter logic.
* Avoid magic constant.yongari2013-07-172-7/+9
| | | | No functional change.
* o TxD ring requires 8 bytes alignment to work so change alignmentyongari2013-07-171-20/+30
| | | | | | | | | | | | | | | | | | constraint to 8. Previously it may have triggered watchdog timeouts. o Check whether interrupt is ours or not. o Enable interrupts before attemping to transmit queued packets. This will slightly improve TX performance. o No need to clear IFF_DRV_OACTIVE in a loop. AE_FLAG_TXAVAIL is used to know whether there are enough available TxD ring space. o Added missing bus_dmamap_sync(9) in ae_rx_intr() and rearranged code to avoid unncessary register access. o Make sure to clear TxD, TxS, RxD rings in driver initialization. Otherwise some data in these rings could be interpreted as 'updated' which in turn will advance internally maintained pointers and can trigger watchdog timeouts. PR: kern/180382
* Fix the build.pluknet2012-06-061-1/+1
|
* Check the return value of pci_find_cap()kevlo2012-06-061-6/+7
|
* To send a frame, controller requires a prepended TX header andyongari2011-11-111-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | the length of frame should be treated as multiple of 4. Actual frame length is set in the TX header. The TX header position should be aligned on 4 byte boundary and actual frame start position should be aligned on 4 byte boundary as well. This means we need 4(TX header length) + 3(frame length fixup) additional free space in TX buffer in addition to actual frame length. Make sure TX handler check these additional bytes. ae_tx_avail_size() returns actual free space in TX buffer to ease the calculation of available TX buffer space in caller. While I'm here, replace magic number to appropriate sizeof operator to enhance readability. This change should fix controller lockup issue happened under certain conditions but it still does not fix watchdog timeout. It seems the watchdog timeout is side-effect of TxS and TxD mismatches. The root cause of TxD/TxD mismatch is not known yet but it looks like silicon bug. I guess driver may have to reinitialize controller whenever it sees TxS and TxD mismatches but leave it as it was at this moment. PR: kern/145918
* - Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOPmarius2011-05-031-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (reporting IFM_LOOP based on BMCR_LOOP is left in place though as it might provide useful for debugging). For most mii(4) drivers it was unclear whether the PHYs driven by them actually support loopback or not. Moreover, typically loopback mode also needs to be activated on the MAC, which none of the Ethernet drivers using mii(4) implements. Given that loopback media has no real use (and obviously hardly had a chance to actually work) besides for driver development (which just loopback mode should be sufficient for though, i.e one doesn't necessary need support for loopback media) support for it is just dropped as both NetBSD and OpenBSD already did quite some time ago. - Let mii_phy_add_media() also announce the support of IFM_NONE. - Restructure the PHY entry points to use a structure of entry points instead of discrete function pointers, and extend this to include a "reset" entry point. Make sure any PHY-specific reset routine is always used, and provide one for lxtphy(4) which disables MII interrupts (as is done for a few other PHYs we have drivers for). This includes changing NIC drivers which previously just called the generic mii_phy_reset() to now actually call the PHY-specific reset routine, which might be crucial in some cases. While at it, the redundant checks in these NIC drivers for mii->mii_instance not being zero before calling the reset routines were removed because as soon as one PHY driver attaches mii->mii_instance is incremented and we hardly can end up in their media change callbacks etc if no PHY driver has attached as mii_attach() would have failed in that case and not attach a miibus(4) instance. Consequently, NIC drivers now no longer should call mii_phy_reset() directly, so it was removed from EXPORT_SYMS. - Add a mii_phy_dev_attach() as a companion helper to mii_phy_dev_probe(). The purpose of that function is to perform the common steps to attach a PHY driver instance and to hook it up to the miibus(4) instance and to optionally also handle the probing, addition and initialization of the supported media. So all a PHY driver without any special requirements has to do in its bus attach method is to call mii_phy_dev_attach() along with PHY-specific MIIF_* flags, a pointer to its PHY functions and the add_media set to one. All PHY drivers were updated to take advantage of mii_phy_dev_attach() as appropriate. Along with these changes the capability mask was added to the mii_softc structure so PHY drivers taking advantage of mii_phy_dev_attach() but still handling media on their own do not need to fiddle with the MII attach arguments anyway. - Keep track of the PHY offset in the mii_softc structure. This is done for compatibility with NetBSD/OpenBSD. - Keep track of the PHY's OUI, model and revision in the mii_softc structure. Several PHY drivers require this information also after attaching and previously had to wrap their own softc around mii_softc. NetBSD/OpenBSD also keep track of the model and revision on their mii_softc structure. All PHY drivers were updated to take advantage as appropriate. - Convert the mebers of the MII data structure to unsigned where appropriate. This is partly inspired by NetBSD/OpenBSD. - According to IEEE 802.3-2002 the bits actually have to be reversed when mapping an OUI to the MII ID registers. All PHY drivers and miidevs where changed as necessary. Actually this now again allows to largely share miidevs with NetBSD, which fixed this problem already 9 years ago. Consequently miidevs was synced as far as possible. - Add MIIF_NOMANPAUSE and mii_phy_flowstatus() calls to drivers that weren't explicitly converted to support flow control before. It's unclear whether flow control actually works with these but typically it should and their net behavior should be more correct with these changes in place than without if the MAC driver sets MIIF_DOPAUSE. Obtained from: NetBSD (partially) Reviewed by: yongari (earlier version), silence on arch@ and net@
* Do a sweep of the tree replacing calls to pci_find_extcap() with calls tojhb2011-03-231-3/+3
| | | | pci_find_cap() instead.
* sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.mdf2011-01-121-46/+45
| | | | Commit the rest of the devices.
* Add a 'locked' variant of the foo_start() routine and call it directlyjhb2011-01-032-20/+16
| | | | | | | | from interrupt handlers and watchdog routines instead of queueing a task to call foo_start(). Reviewed by: yongari MFC after: 1 month
* Convert the PHY drivers to honor the mii_flags passed down and convertmarius2010-10-152-13/+4
| | | | | | | | | | | | | | | | | | | | | | | 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
* Remove unnecessary controller reinitialization.yongari2010-09-211-1/+9
| | | | PR: kern/87506
* Add new tunable 'net.link.ifqmaxlen' to set default send interfacesobomax2010-05-031-1/+1
| | | | | | | | | | queue length. The default value for this parameter is 50, which is quite low for many of today's uses and the only way to modify this parameter right now is to edit if_var.h file. Also add read-only sysctl with the same name, so that it's possible to retrieve the current value. MFC after: 1 month
* Don't panic on attach if we can't allocate ifpgavin2010-01-101-0/+1
| | | | | Approved by: ed (mentor) MFC after: 2 weeks
* Small spelling fix, "Ethetnet" -> "Ethernet"gavin2009-12-251-1/+1
| | | | | Approved by: ed (mentor) MFC after: 1 week
* Fix multicast handling. All Atheros controllers use big-endian formyongari2009-09-291-1/+1
| | | | | | in computing multicast hash. PR: kern/139137
* Revert previous commit and add myself to the list of people who shouldphk2009-09-081-2/+0
| | | | know better than to commit with a cat in the area.
* Add necessary include.phk2009-09-081-0/+2
|
* 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
* detach doesn't return an unsinged int, but returns an int.imp2009-02-041-2/+2
|
* - Eliminate unused variable. [1]stas2008-12-061-5/+2
| | | | | | | | - Check for runt frames entering the stack. [2] Suggested by: ganbold[1], yongari[2] Approved by: kib (mentor) MFC after: 2 weeks
* - Add driver for Attansic L2 FastEthernet controller found onstas2008-10-033-0/+2817
Asus EeePC and some Asus mainboards. Reviewed by: yongari, rpaulo, jhb Tested by: many Approved by: kib (mentor) MFC after: 1 week
OpenPOWER on IntegriCloud