331722 |
29-Mar-2018 |
eadler |
Revert r330897:
This was intended to be a non-functional change. It wasn't. The commit message was thus wrong. In addition it broke arm, and merged crypto related code.
Revert with prejudice.
This revert skips files touched in r316370 since that commit was since MFCed. This revert also skips files that require $FreeBSD$ property changes.
Thank you to those who helped me get out of this mess including but not limited to gonzo, kevans, rgrimes.
Requested by: gjb (re) |
330897 |
14-Mar-2018 |
eadler |
Partial merge of the SPDX changes
These changes are incomplete but are making it difficult to determine what other changes can/should be merged.
No objections from: pfg |
302408 |
08-Jul-2016 |
gjb |
Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle. Prune svn:mergeinfo from the new branch, as nothing has been merged here.
Additional commits post-branch will follow.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
277565 |
23-Jan-2015 |
kevlo |
Remove break after return.
|
271849 |
19-Sep-2014 |
glebius |
Mechanically convert to if_inc_counter().
|
270856 |
30-Aug-2014 |
glebius |
Use define from if_var.h to access a field inside struct if_data, that resides in struct ifnet.
Sponsored by: Nginx, Inc.
|
267363 |
11-Jun-2014 |
jhb |
Fix various NIC drivers to properly cleanup static DMA resources. In particular, don't check the value of the bus_dma map against NULL to determine if either bus_dmamem_alloc() or bus_dmamap_load() succeeded. Instead, assume that bus_dmamap_load() succeeeded (and thus that bus_dmamap_unload() should be called) if the bus address for a resource is non-zero, and assume that bus_dmamem_alloc() succeeded (and thus that bus_dmamem_free() should be called) if the virtual address for a resource is not NULL.
In many cases these bugs could result in leaks when a driver was detached.
Reviewed by: yongari MFC after: 2 weeks
|
266974 |
02-Jun-2014 |
marcel |
Introduce a procedural interface to the ifnet structure. The new interface allows the ifnet structure to be defined as an opaque type in NIC drivers. This then allows the ifnet structure to be changed without a need to change or recompile NIC drivers.
Put differently, NIC drivers can be written and compiled once and be used with different network stack implementations, provided of course that those network stack implementations have an API and ABI compatible interface.
This commit introduces the 'if_t' type to replace 'struct ifnet *' as the type of a network interface. The 'if_t' type is defined as 'void *' to enable the compiler to perform type conversion to 'struct ifnet *' and vice versa where needed and without warnings. The functions that implement the API are the only functions that need to have an explicit cast.
The MII code has been converted to use the driver API to avoid unnecessary code churn. Code churn comes from having to work with both converted and unconverted drivers in correlation with having callback functions that take an interface. By converting the MII code first, the callback functions can be defined so that the compiler will perform the typecasts automatically.
As soon as all drivers have been converted, the if_t type can be redefined as needed and the API functions can be fix to not need an explicit cast.
The immediate benefactors of this change are: 1. Juniper Networks - The network stack implementation in Junos is entirely different from FreeBSD's one and this change allows Juniper to build "stock" NIC drivers that can be used in combination with both the FreeBSD and Junos stacks. 2. FreeBSD - This change opens the door towards changing ifnet and implementing new features and optimizations in the network stack without it requiring a change in the many NIC drivers FreeBSD has.
Submitted by: Anuranjan Shukla <anshukla@juniper.net> Reviewed by: glebius@ Obtained from: Juniper Networks, Inc.
|
257176 |
26-Oct-2013 |
glebius |
The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare to this event, adding if_var.h to files that do need it. Also, include all includes that now are included due to implicit pollution via if_var.h
Sponsored by: Netflix Sponsored by: Nginx, Inc.
|
243857 |
04-Dec-2012 |
glebius |
Mechanically substitute flags from historic mbuf allocator with malloc(9) flags in sys/dev.
|
242625 |
05-Nov-2012 |
dim |
Remove duplicate const specifiers in many drivers (I hope I got all of them, please let me know if not). Most of these are of the form:
static const struct bzzt_type { [...list of members...] } const bzzt_devs[] = { [...list of initializers...] };
The second const is unnecessary, as arrays cannot be modified anyway, and if the elements are const, the whole thing is const automatically (e.g. it is placed in .rodata).
I have verified this does not change the binary output of a full kernel build (except for build timestamps embedded in the object files).
Reviewed by: yongari, marius MFC after: 1 week
|
235255 |
11-May-2012 |
marius |
- Change the module order of these MAC drivers to be last so they are deterministically handled after the corresponding PHY drivers when loaded as modules. Otherwise, when these MAC/PHY driver pairs are compiled into a single module probing the PHY driver may fail. This makes r151438 and r226154 actually work. [1] Reported and tested by: yongari (fxp(4)) - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers.
Submitted by: jhb [1] MFC after: 3 days
|
227908 |
23-Nov-2011 |
marius |
Use DEVMETHOD_END.
|
227843 |
22-Nov-2011 |
marius |
- There's no need to overwrite the default device method with the default 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.
|
227686 |
18-Nov-2011 |
marius |
There's no need to read DC_10BTSTAT twice in dcphy_status().
|
227685 |
18-Nov-2011 |
marius |
- There's no need to ignore the return value of mii_attach(9) when attaching dcphy(4) (CID 9283). - In dc_detach(), check whether ifp is NULL as dc_attach() may call the former without ifp being allocated (CID 4288).
Found with: Coverity Prevent(tm)
|
227675 |
18-Nov-2011 |
yongari |
Partially revert r218788. r218788 removed calling dc_setcfg() for !DC_IS_ADMTEK in dc_miibus_statchg(). This change broke link establishment of Intel 21143 with dcphy(4) where it stuck in "ability detect" state without completing auto-negotiation. Also nuke dc_if_media as it's not actually used.
Submitted by: marius
|
226995 |
01-Nov-2011 |
marius |
- Import the common MII bitbang'ing code from NetBSD and convert drivers to 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)
|
226701 |
24-Oct-2011 |
yongari |
Add support for ALi/ULi, now NVIDIA, M5261/M5263 PCI FastEthernet controller which is found on ULi M1563 South Bridge & M1689 Bridge. These controllers look like a tulip clone. M5263 controller does not support MII bitbang so use DC_ROM register to access MII registers. Like other tulip variants, ULi controller uses a setup frame to configure RX filter and uses new setup frame format. It's not clear to me whether the controller supports a hash based multicast filtering so this patch uses 14 perfect multicast filter to filter multicast frames. If number of multicast addresses is greater than 14, controller is put into a mode that receives all multicast frames. Due to lack of access to M5261, this change was not tested with M5261 but it probably works. Many thanks to Marco who provided remote access to M5263.
Tested by: Marco Steinbach <coco <> executive-computing dot de>, Martin MATO <martin.mato <> orange dot fr>
|
226699 |
24-Oct-2011 |
yongari |
When driver is run for the first time there would be no established link such that calling dc_setcfg() right after media change would be meaningless unless controller in question is not Davicom DM9102. Ideally dc_setcfg() should be called when speed/duplex is resolved otherwise it would reprogram controller with wrong speed/duplex information. Because MII status change callback already calls dc_setcfg() I think calling dc_setcfg() in dc_init_locked() is wrong. For instance, it would take some time to establish a link after mii_mediachg(), so blindly calling dc_setcfg() right after mii_mediachg() will always yield wrong media configuration.
Extend dc_ifmedia_upd() to handle media change and still allow 21143 and Davidcom controllers program speed/duplex regardless of current resolved speed/duplex of link. In theory 21143 may not need to call dc_setcfg() right after media change, but leave it as it is because there are too many variants to test that change. Probably dc(4) shall need a PHY reset in dc_ifmedia_upd() but it's hard to verify correctness of the change.
This change reliably makes ULi M5263 establish a link.
While I'm here correctly report media change result. Previously it always reported a success.
|
226696 |
24-Oct-2011 |
yongari |
Add missing bus_dmamap_sync() in setup frame transmit.
MFC after: 3 days
|
226695 |
24-Oct-2011 |
yongari |
Fix a regression introduced in r218832. For TX status check, driver should use a TX list DMA tag.
MFC after: 3 days
|
223624 |
28-Jun-2011 |
kevlo |
Remove duplicate header includes
|
223381 |
21-Jun-2011 |
imp |
Supress command completion failure warning when the card isn't present. Only call the bus to check if we actually do timeout so we don't affect the normal case (since this case needn't be optimized and this guards against all races).
|
221407 |
03-May-2011 |
marius |
- Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOP (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@
|
220106 |
28-Mar-2011 |
yongari |
Revise r220046 by introducing dc_netcfg_wait() which waits the end of active DMA cycle. dc_setcfg() also has to wait until the DMA engine is stopped so using a common function to handle the job is better than duplicating the code.
No objection from: marius
|
220046 |
26-Mar-2011 |
marius |
Wait until the DMA engine is stopped before unmapping buffers and descriptors, which fixes DMA errors seen on sparc64.
Obtained from: OpenBSD MFC after: 1 week
|
219701 |
16-Mar-2011 |
yongari |
Remove too expensive bus_dmamap_sync(9) call in dc_rx_resync(). With this change, driver may not notice updated descriptor status change when bounce buffers are active. However, rxeof() in next run will handle the synchronization.
Change dc_rxeof() a bit to return the number of processed frames in RX descriptor ring. Previously it returned the number of frames that were successfully passed to upper stack which in turn means it ignored frames that were discarded due to errors. The number of processed frames in RX descriptor ring is used to detect whether driver is out of sync with controller's current descriptor pointer. Returning number of processed frames reduces unnecessary (probably wrong) re-synchronization.
Reviewed by: marius
|
219407 |
08-Mar-2011 |
yongari |
Rearrange dc_tx_underrun() a bit to correctly set TX FIFO threshold value. Controllers that always require "store and forward" mode( Davicom and PNIC 82C168) have no way to recover from TX underrun except completely reinitializing hardware. Previously only Davicom was reinitialized and the TX FIFO threshold was changed not to use "store and forward" mode after reinitialization since the default FIFO threshold value was 0. This effectively disabled Davicom controller's "store and forward" mode once it encountered TX underruns. In theory, this can cause watchodg timeouts.
Intel 21143 controller requires TX MAC should be idle before changing TX FIFO threshold. So driver tried to disable TX MAC and checked whether it saw the idle state of TX MAC. Driver should perform full hardware reinitialization on failing to enter to idle state and it should not touch TX MAC again once it performed full reinitialization.
While I'm here remove resetting TX FIFO threshold to 0 when interface is put into down state. If driver ever encountered TX underrun, it's likely to trigger TX underrun again whenever interface is brought to up again. Keeping old/learned TX FIFO threshold value shall reduce the chance of seeing TX underrns in next run.
|
218964 |
23-Feb-2011 |
yongari |
Remove unnecessary controller reinitialization which resulted in link flips during alias address insertion or dhclient operation. While I'm here remove dc_reset() in DC_ISR_BUS_ERR case. Device is fully reinitialized again in dc_init_locked().
|
218835 |
19-Feb-2011 |
yongari |
s/u_intXX_t/uintXX_t/g
|
218834 |
19-Feb-2011 |
yongari |
Consistently use a tab character instead of space after #define. No functional changes.
|
218833 |
19-Feb-2011 |
yongari |
Count how many frames driver lost in interrupt handler. This register is cleared on read so make sure to clear it in driver initialization phase.
|
218832 |
19-Feb-2011 |
yongari |
Split common TX/RX descriptor DMA tag to TX and RX DMA tags respectively and fix all bus_dma(9) issues seen when bounce buffers are used. o Setup frame handling had no bus_dmamap_sync(9) which prevented driver from configuring RX filter. Add missing bus_dmamap_sync(9) in both dc_setfilt_21143()/dc_setfilt_xircom() and dc_txeof(). o Use bus_addr_t for DMA segment instead of using u_int32_t. o Introduce dc_dma_alloc()/dc_dma_free() functions to allocate/free DMA'able memory. o Create two DMA descriptor list for each TX/RX lists. This change will minimize the size of bounce buffers that would be used in each TX/RX path. Previously driver had to copy both TX/RX lists when bounce buffer is active. o 21143 data sheet says descriptor list requires 4 bytes alignment. Remove PAGE_SIZE alignment restriction and use sizeof(struct dc_dec). o Setup frame requires 4 bytes alignment. Remove PAGE_SIZE alignment restriction and use sizeof(struct dc_dec). o Add missing DMA map unload for both setup frame and TX/RX descriptor list. o Overhaul RX handling logic such that make driver always allocate new RX buffer with dc_newbuf(). Previously driver allowed to copy received frame with m_devget(9) after passing the descriptor ownership to controller. This can lead to passing wrong frame to upper stack. o Introduce dc_discard_rxbuf() which will discard received frame and reuse loaded DMA map and RX mbuf. o Correct several wrong bus_dmamap_sync(9) usage in dc_rxeof and dc_txeof. The TX/RX descriptor lists are updated by both driver and HW so READ/WRITE semantics should be used. o If driver failed to allocate new RX buffer, update if_iqdrops counter instead of if_ierrors since driver received the frame without errors. o Make sure to unload loaded setup frame DMA map in dc_txeof and clear the mark of setup frame of the TX descriptor in dc_txeof(). o Add check for possible TX descriptor overruns in dc_encap() and move check for free buffer to caller, dc_start_locked(). o Swap the loaded DMA map and the last DMA map for multi-segmented frames. Since dc_txeof() assumes the last descriptor of the frame has the DMA map, driver should swap the first and the last DMA map in dc_encap(). Previously driver tried to unload not-yet-loaded DMA map such that the loaded DMA map was not unloaded at all for multi-segmented frames. o Rewrite DC_RXDESC/DC_TXDESC macro to simpler one. o Remove definition of ETHER_ALIGN, it's already defined in ethernet.h.
With this changes, dc(4) works with bounce buffers and it shall also fix issues which might have shown in PAE environments.
Tested by: marius
|
218831 |
19-Feb-2011 |
yongari |
Rearrange interrupt handler a bit and remove forever loop. Previously dc(4) always checked whether there is pending interrupts and this consumed a lot of CPU cycles in interrupt handler. Limit the number of processing for TX/RX frames to 16. Also allow sending frames in the loop not to starve TX under high RX load. Reading DC_ISR register should be protected with driver lock, otherwise interrupt handler could be run(e.g. link state change) before the completion of dc_init_locked().
While I'm here remove unneeded code.
|
218830 |
19-Feb-2011 |
yongari |
Send frames only when there is a valid link and driver is running as well as controller has enough free TX descriptors. Remove check for number of queued frames before attempting to transmit. I guess it was added to allow draining queued frames even if there is no link. I'm under the impression this type of check should be done in upper layer. No other drivers in tree do that.
|
218828 |
18-Feb-2011 |
yongari |
Fix a long standing bug where driver handed over RX descriptor ownership to controller before completion of access to the descriptor. Driver is faking up status word so it should not give ownership to controller until it completes RX processing.
|
218827 |
18-Feb-2011 |
yongari |
There is no need to execute filter configuration when driver is not running. Remove wrong driver state change in dc_setfilt_xircom(). While I'm here nuke unnecessary assignments.
|
218826 |
18-Feb-2011 |
yongari |
Make sure to clear status word of TX descriptor in dc_list_tx_init(). Do not update if_opackets if the transmission had failed.
|
218820 |
18-Feb-2011 |
yongari |
For controllers that have TX interrupt moderation capability, request TX completion interrupt for every 8-th frames. Previously dc(4) requested TX completion interrupt if number of queued TX descriptors is greater than 64. This caused a lot of TX completion interrupt under high TX load once driver queued more than 64 TX descriptors. It's quite normal to see more than 64 queued TX descriptors under high TX load. This change reduces the number of TX completion interrupts to be less than 17k under high TX load. Because this change does not generate TX completion interrupt for each frame, add reclaiming transmitted buffers in dc_tick not to generate false watchdog timeouts. While I'm here add check for queued descriptors in dc_txeof() since there is no more work to do when there is no pending descriptors.
|
218789 |
18-Feb-2011 |
yongari |
Remove use case of DC_TX_ONE. It was used to limit queue just 1 TX frame in DM910x controllers. In r67595(more than 10 years ago) it was replaced to use "Store and Forward" mode and made controller generate TX completion interrupt for every frame.
|
218788 |
18-Feb-2011 |
yongari |
Apply special PHY initialization code for 21143 controllers before any other media configuration. Otherwise some 21143 controller cannot establish a link. While I'm here remove the PHY initialization code in dc_setcfg(). Since dc_setcfg() is called whenever link state is changed, having the PHY initialization code in dc_setcfg() resulted in continuous link flips. After driver resets SIA, use default SIA transmit/receive configuration instead of disabling autosense/autonegotiation. Otherwise, controller fails to establish a link as well as losing auto-negotiation capability. For manual media configuration, always configure 21143 controller with specified media to ensure media change. This change makes ANA-6922 establish link with/without auto-negotiation.
While I'm here be more strict on link UP/DOWN detection logic.
Many thanks to marius who fixed several bugs in initial patch and even tested the patch on a couple of dc(4) controllers.
PR: kern/79262 Reviewed by: marius Tested by: marius
|
218787 |
18-Feb-2011 |
yongari |
When driver have to use base softc due to lack of SROM on second port, copy SROM information from base softc as well and run SROM parser again. This change is necessary for some dual port controllers to make dc(4) correctly detect PHY media based on first port configuration table. While I'm here add a check for validity of the base softc before duplicating SROM contents from base softc. If driver failed to attach to the first port it can access invalid area.
PR: kern/79262 Reviewed by: marius
|
218786 |
18-Feb-2011 |
yongari |
Always check memory allocation failure. If driver encounter memory allocation error, do not attach driver.
Reviewed by: marius
|
217417 |
14-Jan-2011 |
marius |
- Even after masking the media with IFM_GMASK the result may have bits besides the duplex ones set so just comparing it with IFM_FDX may lead to false negatives. - Just let the default case handle all unsupported media types. - In pnphy_status() don't unnecessarily read a register twice. - Remove unnused macros.
MFC after: 1 week
|
213908 |
15-Oct-2010 |
marius |
Convert the PHY drivers to honor the mii_flags passed down and convert 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).
This file was missed in r213893.
|
213893 |
15-Oct-2010 |
marius |
Convert the PHY drivers to honor the mii_flags passed down and convert 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
|
213841 |
14-Oct-2010 |
yongari |
It seems some multi-port dc(4) controllers shares SROM of the first port such that reading station address from second port always returned 0xFF:0xFF:0xFF:0xFF:0xFF:0xFF Unfortunately it seems there is no easy way to know whether SROM is shared or not. Workaround the issue by traversing dc(4) device list and see whether we're using second port and use station address of controller 0 as base station address of second port.
PR: kern/79262 MFC after: 2 weeks
|
213384 |
03-Oct-2010 |
marius |
Consistently always explicitly set IFM_HDX for half-duplex.
Obtained from: OpenBSD (mostly)
|
213364 |
02-Oct-2010 |
marius |
- In the spirit of previous simplifications factor out the checks for a different PHY instance being selected and isolation out into the wrappers around the service methods rather than duplicating them over and over again (besides, a PHY driver shouldn't need to care about which instance it actually is). - Centralize the check for the need to isolate a non-zero PHY instance not supporting isolation in mii_mediachg() and just ignore it rather than panicing, which should sufficient given that a) things are likely to just work anyway if one doesn't plug in more than one port at a time and b) refusing to attach in this case just leaves us in a unknown but most likely also not exactly correct configuration (besides several drivers setting MIIF_NOISOLATE didn't care about these anyway, probably due to setting this flag for no real reason). - Minor fixes like removing unnecessary setting of sc->mii_anegticks, using sc->mii_anegticks instead of hardcoded values etc.
|
213229 |
27-Sep-2010 |
marius |
Use the mii_data provided via mii_attach_args and mii_pdata respectively instead of reaching out for the softc of the parent.
|
201451 |
03-Jan-2010 |
imp |
cardbus -> CardBus
|
201449 |
03-Jan-2010 |
imp |
Fix CardBus spelling.
MFC after: 1 month
|
201430 |
03-Jan-2010 |
mbr |
Fix card/device names, no functional change
The ADMtek AN985 is the cardbus variant of ADMtek AN983 The Netgear FA511 is just a relabled ADMtek AN985
PR: kern/50574 MFC after: 1 month
|
195049 |
26-Jun-2009 |
rwatson |
Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/ 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
|
193096 |
30-May-2009 |
attilio |
When user_frac in the polling subsystem is low it is going to busy the CPU for too long period than necessary. Additively, interfaces are kept polled (in the tick) even if no more packets are available. In order to avoid such situations a new generic mechanism can be implemented in proactive way, keeping track of the time spent on any packet and fragmenting the time for any tick, stopping the processing as soon as possible.
In order to implement such mechanism, the polling handler needs to change, returning the number of packets processed. While the intended logic is not part of this patch, the polling KPI is broken by this commit, adding an int return value and the new flag IFCAP_POLLING_NOCOUNT (which will signal that the return value is meaningless for the installed handler and checking should be skipped).
Bump __FreeBSD_version in order to signal such situation.
Reviewed by: emaste Sponsored by: Sandvine Incorporated
|
190117 |
19-Mar-2009 |
marius |
- Set MIIF_NOLOOP and don't add IFM_LOOP as loopback apparently isn't supported with these pseudo-PHYs. The MIIF_NOLOOP flag currently triggers nothing but hopefully will be respected by mii_phy_setmedia() later on. - Don't add IFM_NONE as isolation isn't supported by these pseudo-PHYs. - Use mii_phy_add_media() instead of mii_add_media() so the latter can be eventually retired.
|
189575 |
09-Mar-2009 |
imp |
remove now-redunant cardbus attachment.
|
185750 |
07-Dec-2008 |
marius |
- According to the corresponding Linux, NetBSD and OpenSolaris drivers, there should be a 1us delay after every write when bit-banging the MII. Also insert barriers in order to ensure the intended ordering. These changes hopefully will solve the bus wedging occasionally experienced with DM9102A since r182461. - Deobfuscate dc_mii_readreg() a bit.
|
183505 |
30-Sep-2008 |
marius |
cosmetic changes and style fixes
|
182461 |
29-Aug-2008 |
marius |
For chips with a broken DC_ISR_RX_STATE which f.e. never signals stopped nor the waiting state and also no other means to check whether the receiver is idle (see also r163774), we have no choice than to call mii_tick(9) unconditionally even in the case of the DC_REDUCED_MII_POLL handling as far as the RX side is concerned. This isn't necessarily worse than checking whether RX is idle though because unlike as with TX we're racing with the hardware, which might receive packets any time while we poll the MII, anyway.
Reported and tested by: Jacob Owens Reviewed by: yongari MFC after: 3 days
|
182079 |
23-Aug-2008 |
marius |
- Use m_collapse(9) instead of m_defrag(9) if possible. This results in a noticeable reduction in system time spent. - If bus_dmamap_load_mbuf_sg(9) fails with EFBIG and we already have defragmented the mbuf chain, don't bother to defragment and load it a second time just yet as it's likely to fail again anyway.
MFC after: 3 days
|
179647 |
08-Jun-2008 |
yongari |
Ethernet hardware address stored in DC_AL_PAR0/DC_AL_PAR1 register is in little endian form. Likewise setting DC_AL_PAR0/DC_AL_PAR1 register expect the address to be in little endian form. For big endian architectures the address should be swapped to get correct one. Change setting/getting ethernet hardware address to big endian architecture frendly.
Reported by: Robert Murillo ( billypilgrim782001 at yahoo dot com ) Tested by: Robert Murillo ( billypilgrim782001 at yahoo dot com )
|
177561 |
24-Mar-2008 |
marius |
- Const'ify the dc_devs array. - Correct the maxsize parameter when creating the mbufs busdma tag to reflect the actual requirement of dc(4). - Move the KASSERT in dc_newbuf() to the right spot. - Also convert the TX side to take advantage of bus_dmamap_load_mbuf_sg(9). - Move the comment regarding dc_start_locked() to the right spot.
MFC after: 2 weeks
|
173839 |
22-Nov-2007 |
yongari |
Fix function prototype for device_shutdown method.
|
173665 |
16-Nov-2007 |
yongari |
IEEE 802.3 Annex 28B.3 explicitly specifies the following relative priorities of the technologies supported by 802.3 Selector Field value.
1000BASE-T full duplex 1000BASE-T 100BASE-T2 full duplex 100BASE-TX full duplex 100BASE-T2 100BASE-T4 100BASE-TX 10BASE-T full duplex 10BAST-T
However PHY drivers didn't honor the order such that 100BASE-T4 had higher priority than 100BASE-TX full duplex. Fix that long standing bugs such that have PHY drivers choose the highest common denominator ability. Fix a bug in dcphy which inadvertently aceepts 100BASE-T4.
PR: 92599
|
171729 |
05-Aug-2007 |
marius |
o In order to reduce bug and code duplication fold handling of NICs requiring DC_TX_ALIGN or DC_TX_COALESCE, which was previously done in dc_start_locked(), into dc_encap(). o In dc_encap(): - If m_defrag() fails just drop the packet like other NIC drivers do. This should only happen when there's a mbuf shortage, in which case it was possible to end up with an IFQ full of packets which couldn't be processed as they couldn't be defragmented as they were taking up all the mbufs themselves. This includes adjusting dc_start_locked() to not trying to prepend the mbuf (chain) if dc_encap() has freed it. - Likewise, if bus_dmamap_load_mbuf() fails as dc_dma_map_txbuf() failed, free the mbuf possibly allocated by the above call to m_defrag() and drop the packet. o In dc_txeof(): - Don't clear IFF_DRV_OACTIVE unless there are at least 6 free TX descriptors. Further down the road dc_encap() will bail if there are only 5 or fewer free TX descriptors, causing dc_start_locked() to abort and prepend the dequeued mbuf again so it makes no sense to pretend we could process mbufs again when in fact we won't. While at it replace this magic 5 with a macro DC_TX_LIST_RSVD. - Just always assign idx to sc->dc_cdata.dc_tx_cons; it doesn't make much sense to exclude the idx == sc->dc_cdata.dc_tx_cons case. o In dc_dma_map_txbuf() there's no need to set sc->dc_cdata.dc_tx_err to error if the latter is != 0, bus_dmamap_load_mbuf() already returns the same error value in that case anyway. o For less overhead, convert to use bus_dmamap_load_mbuf_sg() for loading RX buffers. o Remove some banal and/or outdated comments.
Approved by: re (kensmith) MFC after: 1 week
|
166901 |
23-Feb-2007 |
piso |
o break newbus api: add a new argument of type driver_filter_t to bus_setup_intr()
o add an int return code to all fast handlers
o retire INTR_FAST/IH_FAST
For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current
Reviewed by: many Approved by: re@
|
165365 |
20-Dec-2006 |
marius |
Fix a bug originally introduced in rev. 1.74; don't reloaded the watchdog timer in dc_txeof() in case there are still unhandled descriptors as dc_poll() invokes dc_poll() unconditionally. Otherwise this would result in the watchdog timer constantly being being reloaded and thus circumvent that the watchdog ever fires in the DEVICE_POLLING case.
Pointed out by: bde
|
164930 |
06-Dec-2006 |
marius |
- Use our own callout (the dc_tick() callout uses varying periods depending on the NIC and isn't used at all with HomePNA links) instead of if_slowtimo() for driving dc_watchdog() in order to avoid races accessing if_timer. - Use bus_get_dma_tag() so dc(4) works on platforms requiring it. - Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that. - Remove an alpha remnant in dc_softc.
|
163892 |
02-Nov-2006 |
marius |
Remove <sys/types.h>; including both <sys/param.h> and <sys/types.h> violates style(9).
|
163774 |
29-Oct-2006 |
marius |
- Wrap code optimized for architectures without alignment constraints in #ifdef __NO_STRICT_ALIGNMENT rather than #ifdef __i386__. This means that amd64 now also uses the optimized code. [1] While at it, fix a nearby style(9) bug. - Remove the hw.dc_quick SYSCTL, which allowed to turn off the above mentioned optimization, as like the equivalent and already removed - In dc_setcfg() suppress printing a warning when forcing the receiver and transceiver to idle state times out for chips where the status bits in question just never change (observed in detail with DM9102A) and therefore the warning would be highly likely false positive. [2] - In dc_ifmedia_sts() add a missing DC_UNLOCK().
Tested by: Hans-Joerg Sirtl on amd64 [1] PR: 82681 [2] Obtained from: NetBSD tlp(4) [2] MFC after: 1 week
|
162321 |
15-Sep-2006 |
glebius |
- Consistently use if_printf() only in interface methods: if_start(), if_watchdog, etc., or in functions used only in these methods. In all other functions in the driver use device_printf(). - Use __func__ instead of typing function name.
Submitted by: Alex Lyashkov <umka sevcity.net>
|
160907 |
02-Aug-2006 |
yongari |
Replace hard-coded magic constants to system defined constants (BUS_PROBE_DEFAULT, BUS_PROBE_GENERIC etc). These pseudo PHY drivers were forgotten from the conversion due to the repo copy to dc driver location.
|
159393 |
08-Jun-2006 |
glebius |
Fix the last commit.
Submitted by: jhb Pointy hat to: glebius
|
159372 |
07-Jun-2006 |
glebius |
Add device IDs for Linksys PCMPC200 Cardbus card.
PR: kern/75582 Submitted by: Gary Palmer
|
159202 |
03-Jun-2006 |
jhb |
- Switch on the full 32-bit device ID to avoid collisions between the vendor-specific device ids across vendors. - Include the revision in the dc_devs[] array instead of special casing the revid handling in dc_devtype(). - Use PCI bus accessors to read registers instead of pci_read_config() where possible. - Use an 8-bit write to update the latency timer. - Use PCIR_xxx constants and remove unused DC_xxx related to standard PCI config registers.
MFC after: 1 week
|
159201 |
03-Jun-2006 |
jhb |
Use PCI bus accessors rather than reading config registers directly to get the subvendor device id.
|
158471 |
12-May-2006 |
jhb |
Remove various bits of conditional Alpha code and fixup a few comments.
|
156785 |
16-Mar-2006 |
jhb |
Add device-id for the Neteasy DRP-32TXD cardbus 10/100 card. It's another ADMTek AN985 clone.
MFC after: 3 days Tested by: Lila liladude at aruba dot it
|
155671 |
14-Feb-2006 |
glebius |
Do not touch ifp->if_baudrate in miibus aware drivers.
|
153800 |
28-Dec-2005 |
glebius |
Add missing parens.
Submitted by: njl
|
153792 |
28-Dec-2005 |
glebius |
Check for IFF_DRV_RUNNING in the interrupt loop.
Reported & tested by: Martin P. Hansen <mph lima.dyndns.dk>
|
153111 |
05-Dec-2005 |
marius |
- Rev. 1.175 fixed compilation on sparc64 but also backed out zeroing of the eaddr array (introduced in rev. 1.174) prior to writing to it. As dc_read_eeprom() is told to write only 3 16-bit words to eaddr but eaddr in fact is somewhat larger removal of the zeroing defeated the check whether the MAC address is all zero as there can be some random garbage in eaddr past the 3 words written to it and the check verifys all bits in eaddr. Solve this by changing the check to verify only the 3 words (happenning to be ETHER_ADDR_LEN bytes) written to eaddr. - While here change the notation of "FCode" in a nearby comment to the official way.
Ok'ed by: marcel, ru
|
153077 |
04-Dec-2005 |
ru |
Fix on sparc64.
|
153003 |
02-Dec-2005 |
marcel |
Fix the misalignment bugs differently than was done in the previous commit. Copy the ethernet address into a local buffer, which we know is sufficiently aligned for the width of the memory accesses that we do. This also eliminates all suspicious and potentionally harmful casts.
In collaboration with: ru
|
152671 |
22-Nov-2005 |
marcel |
Resolve misalignment traps caused by changes to IF_LLADDR(). Use de16dec() and le16dec() to fetch the link-level address from struct ifnet.
Tested on: alpha Reviewed by: jhb See also: de(4)
|
152315 |
11-Nov-2005 |
ru |
- Store pointer to the link-level address right in "struct ifnet" rather than in ifindex_table[]; all (except one) accesses are through ifp anyway. IF_LLADDR() works faster, and all (except one) ifaddr_byindex() users were converted to use ifp->if_addr.
- Stop storing a (pointer to) Ethernet address in "struct arpcom", and drop the IFP2ENADDR() macro; all users have been converted to use IF_LLADDR() instead.
|
151435 |
18-Oct-2005 |
imp |
Make dc compile after repo-copy.
|
150968 |
05-Oct-2005 |
glebius |
- Don't pollute opt_global.h with DEVICE_POLLING and introduce opt_device_polling.h - Include opt_device_polling.h into appropriate files. - Embrace with HAVE_KERNEL_OPTION_HEADERS the include in the files that can be compiled as loadable modules.
Reviewed by: bde
|
150789 |
01-Oct-2005 |
glebius |
Big polling(4) cleanup.
o Axe poll in trap.
o Axe IFF_POLLING flag from if_flags.
o Rework revision 1.21 (Giant removal), in such a way that poll_mtx is not dropped during call to polling handler. This fixes problem with idle polling.
o Make registration and deregistration from polling in a functional way, insted of next tick/interrupt.
o Obsolete kern.polling.enable. Polling is turned on/off with ifconfig.
Detailed kern_poll.c changes: - Remove polling handler flags, introduced in 1.21. The are not needed now. - Forget and do not check if_flags, if_capenable and if_drv_flags. - Call all registered polling handlers unconditionally. - Do not drop poll_mtx, when entering polling handlers. - In ether_poll() NET_LOCK_GIANT prior to locking poll_mtx. - In netisr_poll() axe the block, where polling code asks drivers to unregister. - In netisr_poll() and ether_poll() do polling always, if any handlers are present. - In ether_poll_[de]register() remove a lot of error hiding code. Assert that arguments are correct, instead. - In ether_poll_[de]register() use standard return values in case of error or success. - Introduce poll_switch() that is a sysctl handler for kern.polling.enable. poll_switch() goes through interface list and enabled/disables polling. A message that kern.polling.enable is deprecated is printed.
Detailed driver changes: - On attach driver announces IFCAP_POLLING in if_capabilities, but not in if_capenable. - On detach driver calls ether_poll_deregister() if polling is enabled. - In polling handler driver obtains its lock and checks IFF_DRV_RUNNING flag. If there is no, then unlocks and returns. - In ioctl handler driver checks for IFCAP_POLLING flag requested to be set or cleared. Driver first calls ether_poll_[de]register(), then obtains driver lock and [dis/en]ables interrupts. - In interrupt handler driver checks IFCAP_POLLING flag in if_capenable. If present, then returns.This is important to protect from spurious interrupts.
Reviewed by: ru, sam, jhb
|
150763 |
30-Sep-2005 |
imp |
Use ansi function definitions in preference to K&R to reduce diffs with NetBSD (and cause it looks cooler).
|
150213 |
16-Sep-2005 |
ru |
Fix "struct ifnet" leaks when attach() fails in the middle, e.g. when mii_phy_probe() or bus_setup_intr() fails. For drivers that call their detach() in this case, call if_free() there to cover this case too.
|
150174 |
15-Sep-2005 |
keramida |
When bus_alloc_resource_any() fails, dc_detach() is called and it attempts to deallocate busdma tags and resources that haven't been allocated yet, causing a panic every time a dc interface fails to attach. Fix by checking that we really have something to dealloc before calling bus_dma*() functions.
Approved by: jhb MFC after: 1 week
|
149595 |
29-Aug-2005 |
imp |
Better comment
|
149588 |
29-Aug-2005 |
imp |
Fix another instance of old info re: miibus
|
149249 |
18-Aug-2005 |
jhb |
Fixup locking and mark MPSAFE: - Add locked versions of start and init. The SRM_MEDIA code in dc_init() stayed in dc_init() instead of moving to dc_init_locked() to make the locking saner. - Use callout_init_mtx(). - Fixup locking in detach and ioctl. - Lock the driver in the ifmedia callouts. - Don't recurse on the driver lock. - De-spl.
MFC after: 3 days
|
148948 |
10-Aug-2005 |
jhb |
Use device_printf() and if_printf() and remove dc_unit from softc.
|
148887 |
09-Aug-2005 |
rwatson |
Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and IFF_DRV_RUNNING, as well as the move from ifnet.if_flags to ifnet.if_drv_flags. Device drivers are now responsible for synchronizing access to these flags, as they are in if_drv_flags. This helps prevent races between the network stack and device driver in maintaining the interface flags field.
Many __FreeBSD__ and __FreeBSD_version checks maintained and continued; some less so.
Reviewed by: pjd, bz MFC after: 7 days
|
148654 |
03-Aug-2005 |
rwatson |
Modify device drivers supporting multicast addresses to lock if_addr_mtx over iteration of their multicast address lists when synchronizing the hardware address filter with the network stack-maintained list.
Problem reported by: Ed Maste (emaste at phaedrus dot sandvine dot ca> MFC after: 1 week
|
147256 |
10-Jun-2005 |
brooks |
Stop embedding struct ifnet at the top of driver softcs. Instead the struct ifnet or the layer 2 common structure it was embedded in have been replaced with a struct ifnet pointer to be filled by a call to the new function, if_alloc(). The layer 2 common structure is also allocated via if_alloc() based on the interface type. It is hung off the new struct ifnet member, if_l2com.
This change removes the size of these structures from the kernel ABI and will allow us to better manage them as interfaces come and go.
Other changes of note: - Struct arpcom is no longer referenced in normal interface code. Instead the Ethernet address is accessed via the IFP2ENADDR() macro. To enforce this ac_enaddr has been renamed to _ac_enaddr. - The second argument to ether_ifattach is now always the mac address from driver private storage rather than sometimes being ac_enaddr.
Reviewed by: sobomax, sam
|
146734 |
29-May-2005 |
nyan |
Remove bus_{mem,p}io.h and related code for a micro-optimization on i386 and amd64. The optimization is a trivial on recent machines.
Reviewed by: -arch (imp, marcel, dfr)
|
145219 |
18-Apr-2005 |
imp |
Fix newer Xircom CBE2-100 cards that were reporting dc0: MII without any PHY! We have to enable the connection to the MII first. Doing so fixes the problem cards without breaking the older, working cards.
Bad card provided by: deischen
|
143309 |
09-Mar-2005 |
scottl |
Bugger, wiped out a needed comma in the previous commit.
|
143307 |
08-Mar-2005 |
scottl |
The DC driver asks for an alignment of PAGE_SIZE for data buffers, but also asks that each buffer be (2048 * 256) bytes long. I suspect that alignment isn't a real requirement since busdma only recently started honoring it. The size is also bogus. Fix both of these and stop busdma from trying to exhaust the system memory pool with bounce pages.
Submitted by: Kevin Oberman MFC After: 7 days
|
142407 |
24-Feb-2005 |
imp |
Fix style(9) issues with __P removal.
Noticed by: bde
|
142398 |
24-Feb-2005 |
imp |
Return BUS_PROBE_DEFAULT instead of 0.
|
139825 |
07-Jan-2005 |
imp |
/* -> /*- for license, minor formatting changes
|
139749 |
06-Jan-2005 |
imp |
Start each of the license/copyright comments with /*-, minor shuffle of lines
|
136026 |
01-Oct-2004 |
mux |
Read the MAC address in the EEPROM in the correct byte order. This is a no-op on little endian architectures, but fixes getting the MAC address for some dc(4) cards on big endian architectures.
This is a RELENG_5 candidate.
Tested by: gallatin (powerpc), marius (sparc64) First version of the patch written by: gallatin
|
136016 |
01-Oct-2004 |
green |
Add ALTQ support for dc(4), based upon a mostly-working patch from mlaier.
|
136015 |
01-Oct-2004 |
green |
Conditionalize IFF_NEEDSGIANT, like everything else here, on IS_MPSAFE. The driver doesn't look any less safe without Giant than with, and works with IS_MPSAFE set to 1 here, so others should probably test it as such.
|
134285 |
25-Aug-2004 |
rwatson |
if_dc includes locking, but that locking is disabled by a #ifdef by default. As such, mark if_dc as IFF_NEEDSGIANT until such time as appropriate locking review and testing can take place, and the locking can be enabled by default.
RELENG_5 candidate.
|
133728 |
14-Aug-2004 |
marius |
- Make OF_getetheraddr() honour the "local-mac-address?" system config variable. If set to "true" OF_getetheraddr() will now return the unique MAC address stored in the "local-mac-address" property of the device's OFW node if present and the host address/system default MAC address if the node doesn't doesn't have such a property. If set to "false" the host address will be returned for all devices like before this change. This brings the behaviour of device drivers for NICs with OFW support/ FCode, i.e. dc(4) for on-board DM9102A on Sun machines, gem(4) and hme(4), regarding "local-mac-address?" in line with NetBSD and Solaris. The man pages of the respective drivers will be updated separately to reflect this change. - Remove OF_getetheraddr2() which was used as a stopgap in dc(4). Its functionality is now part of OF_getetheraddr().
|
131652 |
05-Jul-2004 |
bms |
Whitespace nits
|
131289 |
29-Jun-2004 |
imp |
Remove saved_* from dc_softc. They are now no longer needed.
Submitted by: Marius Strobl
|
131253 |
28-Jun-2004 |
imp |
Remove burn bridges code that saved/restored the pci config registers that are now handled in the pci bus layer. They are no longer necessary.
|
130270 |
09-Jun-2004 |
naddy |
Replace handrolled CRC calculation with ether_crc32_[lb]e().
|
129878 |
30-May-2004 |
phk |
Add missing <sys/module.h> includes
|
129845 |
29-May-2004 |
marius |
Spelling fix in a comment.
|
129844 |
29-May-2004 |
marius |
Remove double __FBSDID and move the remaining one into a common place after the license(s) and before the driver comment (the latter only in drivers not having __FBSDID at that location).
|
129633 |
23-May-2004 |
yar |
A handler for ioctl(SIOCSIFCAP) should not alter a bit in if_capenable unless the interface driver is actually able to toggle the respective capability on and off.
Reviewed by: ru
|
128870 |
03-May-2004 |
andre |
Correct the phy_service() routine case MII_TICK to correctly track the falling edge of a media state change.
This is in preparation for media state change notification to the routing socket.
No objections by: sam, wpaul, ru, bms Brucification by: bde
|
128115 |
11-Apr-2004 |
ru |
First driver with user-configurable polling(4).
|
127135 |
17-Mar-2004 |
njl |
Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
|
126966 |
14-Mar-2004 |
mdodd |
Announce ethernet MAC addresss in ether_ifattach().
|
124259 |
08-Jan-2004 |
mux |
Some integrated Davicom cards in sparc64 boxes have an all zeros MAC address in the EEPROM, and we need to get it from OpenFirmware. This isn't very pretty but time is lacking to do this in a better way this near 5.2-RELEASE. This is a RELENG_5_2 candidate.
Original version by: Marius Strobl <marius@alchemy.franken.de> Tested by: Pete Bentley <pete@sorted.org> Reviewed by: jake
|
124240 |
08-Jan-2004 |
truckman |
The transmit frame status is stored in the last transmit descriptor for the frame, not the first. It is probably also not safe to free the mbuf chain as soon as the OWN bit is cleared on the first descriptor since the chip may not be done copying the frame into the transmit FIFO. Revert the part of of busdma conversion (if_dc.c rev 1.115) which changed dc_txeof() to look for the status in the first descriptor and free the mbuf chain when processing the first descriptor for the frame, and revert the matching changes elsewhere in the driver. This part of the busdma change caused the driver to report spurious collisions and output errors, even when running in full-duplex mode. Reverting the mbuf chain handling slightly complicates dc_dma_map_txbuf(), since it is responsible for setting the OWN bits on the descriptors, but does not normally have direct access to the mbuf chain.
Tested by: Dejan Lesjak <dejan.lesjak at ijs.si> alpha/<Intel 21143 10/100BaseTX> "Xin LI" <delphij at frontfree.net> i386/<Macronix 98713 10/100BaseTX> Wiktor Niesiobedzki <bsd at w.evip.pl> i386/<3Com OfficeConnect 10/100B>
Reviewed by: mux
|
123166 |
06-Dec-2003 |
sanpei |
Add support for ELECOM/Laneed CardBus FastEtherner Card(LD-CBL/TXA)
Submitted by: Masahiro Yamagishi <night@pluto.dti.ne.jp> Approved by: re (scottl)
|
123019 |
28-Nov-2003 |
imp |
Sometimes cardbus attachments don't attach, so while we track down this problem put these lines back in. While they should be unnecessary, they appear to be sometimes necessary.
Reviewed in concept: dfr Approved by: re (scottl@)
|
122689 |
14-Nov-2003 |
sam |
Drop the driver lock around calls to if_input to avoid a LOR when the packets are immediately returned for sending (e.g. when bridging or packet forwarding). There are more efficient ways to do this but for now use the least intrusive approach.
Reviewed by: imp, rwatson
|
122678 |
14-Nov-2003 |
obrien |
Remove duplicate FBSDID's, move others to their right place.
|
122643 |
14-Nov-2003 |
imp |
reconst poison re-de u_intXX_t
|
122625 |
13-Nov-2003 |
obrien |
Try to create some sort of consistency in how the routings to find the multicast hash are written. There are still two distinct algorithms used, and there actually isn't any reason each driver should have its own copy of this function as they could all share one copy of it (if it grew an additional argument).
|
121939 |
03-Nov-2003 |
dfr |
Remove explicit cardbus attachments from drivers where this is identical to the pci attachment. Cardbus is a derived class of pci so all pci drivers are automatically available for matching against cardbus devices.
Reviewed by: imp
|
121908 |
02-Nov-2003 |
ru |
Correct the spelling of m_devget() in the sysctl variable description.
|
121816 |
31-Oct-2003 |
brooks |
Replace the if_name and if_unit members of struct ifnet with new members if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance.
This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics.
Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname)
|
121433 |
23-Oct-2003 |
imp |
Const poison crc routines (why these aren't centralized, I'm not sure).
|
121261 |
19-Oct-2003 |
silby |
Fix a problem where m_defrag would allocate a new mbuf to replace the chain passed into dc_encap, which dc_start was unaware of. This caused the old (now invalid) mbuf to be passed to BPF_MTAP.
Spotted by: Kenjiro Cho <kjc@csl.sony.co.jp>
|
120822 |
05-Oct-2003 |
mbr |
Ignore CSR13, CSR14, CSR15 'Media Specific Data' registers for 21143 based cards which use SIA mode.
This fixes 10mbit mode for ZNYX ZX346Q cards and other 21143 based cards.
PR: 32118 Submitted by: Rene de Vries <rene@tunix.nl> Geert Jan de Groot <GeertJan.deGroot@tunix.nl>
Obtained from: BSDI
MFC after: 2 weeks
|
120111 |
16-Sep-2003 |
mbr |
Don't read the MAC address from a copy of the EEPROM in the softc that has been recorded earlier and overwrite it again later by reading it directly from the EEPROM again.
Read the MAC address from the PAR0/PAR1 registers instead, which are autoloaded on reboot.
Tested on AN985, AN983B. According to the datasheets, it should also work for the AL981 (I don't have such a chip on a card at home)
PR: 52988 Submitted by: Andrew Gordon <arg-bsd@arg.me.uk> MFC after: 2 weeks
|
119690 |
02-Sep-2003 |
jhb |
Use PCIR_BAR(x) instead of PCIR_MAPS.
Glanced over by: imp, gibbs Tested by: i386 LINT
|
119498 |
27-Aug-2003 |
mbr |
All davicom cards seem to need DC_TX_ALIGN.
|
119434 |
24-Aug-2003 |
mbr |
Make TX on davicom 9102A working again. This chip needs its mbufs aligned on TX.
PR: 53656, 42714 MFC after: 3 days
|
119418 |
24-Aug-2003 |
obrien |
Use __FBSDID(). Also some minor style cleanups.
|
119288 |
22-Aug-2003 |
imp |
Prefer new location of pci include files (which have only been in the tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
|
119285 |
22-Aug-2003 |
imp |
Prefer new location of pci include files (which have only been in the tree for two or more years now), except in a few places where there's code to be compatible with older versions of FreeBSD.
|
119137 |
19-Aug-2003 |
sam |
Change instances of callout_init that specify MPSAFE behaviour to use CALLOUT_MPSAFE instead of "1" for the second parameter. This does not change the behaviour; it just makes the intent more clear.
|
118084 |
27-Jul-2003 |
mux |
Use the BUS_DMA_ZERO flag.
|
117769 |
19-Jul-2003 |
imp |
Add support for FA-511; Submitted by: Kenneth P. Stox; Pr 42858
|
117386 |
10-Jul-2003 |
wpaul |
Add support for a bunch of Microsoft networking products:
- MN-110 10/100 USB ethernet (ADMtek Pegasus II, if_aue) - MN-120 10/100 cardbus (ADMtek Centaur-C, if_dc) - MN-130 10/100 PCI (ADMtek Centaur-P, if_dc)
Also update dc(4) man page to mention support for MN-120 and MN-130.
|
117354 |
09-Jul-2003 |
mux |
Make the dc(4) driver endian-clean, so to that it works on sparc64. There are such cards in Netra X1 boxes, which should thus be fully supported now.
Tested by: jake
|
117295 |
06-Jul-2003 |
mux |
Convert the dc(4) driver to the busdma API. This is a necessary step to have this driver working on sparc64. It still needs to be made endian-clean before it can work there.
Special thanks to dragonk@evilcode.net for sending me a dc(4) card so that I was able to do this work.
Many cheers to all the people that tested this change, thanks to them, this change shouldn't break anything :-).
Tested by: marcel (i386 and ia64), ru (i386), wilko (alpha), mbr (i386), wpaul (i386) and Will Saxon <WillS@housing.ufl.edu> (i386)
|
117282 |
06-Jul-2003 |
mux |
Fix a bug that could cause dc(4) to m_freem() an already freed mbuf or something that isn't an mbuf.
MFC after: 3 days
|
117281 |
06-Jul-2003 |
mux |
Various style(9) and readability fixes.
|
117208 |
03-Jul-2003 |
imp |
Due to extreme bogusness in the pci bus layer, these drivers were forced to do slightly bogus power state manipulation. However, this is one of those features that is preventing further progress, so mark them as BURN_BIRDGES like I did for the drivers in sys/dev/...
This, like the other change, are a no-op unless you have BURN_BRIDGES in your kernel.
|
116024 |
08-Jun-2003 |
mbr |
Add ADMtek ADM9511 and ADM9513 device ID's.
PR: PR51823 Submitted by: Kaho Toshikazu <kaho@elam.kais.kyoto-u.ac.jp> Reviewed by: phk MFC after: 2 days
|
115644 |
01-Jun-2003 |
mux |
Change a : bzero(ptr, sizeof(DC_RXLEN * 5)); which should obviously be: bzero(ptr, DC_RXLEN * 5);
Looks like this bug may have reduced the effectiveness of the workaround for the hardware bug in the PNIC chips.
MFC after: 1 week
|
115632 |
01-Jun-2003 |
mux |
- Style(9) fixes, most notably : o Remove register keyword o ANSIfy prototypes o Remove "return;" at the end of void functions o Remove trailing spaces o Don't align local variables with tabs and reorder them o Don't use /* FOO */ at the end of a #ifdef FOO block if it's a small block - Other non-functional changes : o 6 -> ETHER_ADDR_LEN o Don't initialize if_output; ether_ifattach() does it for us
|
115520 |
31-May-2003 |
phk |
Remove unnecessary breaks. Remove unused variables. Add XXX comment where a break may be missing. [lxtphy.c]
Found by: FlexeLint
|
115029 |
15-May-2003 |
mbr |
Only use a SIA/SYM media info block if no MII block is detected. The submitter of PR 32118 told me that this patch also fixes autoselecting for znyx 4 port cards (10baseT, 100baseTX did work already).
PR: 32118 Reviewed by: imp Approved by: rwatson (re)
|
114957 |
12-May-2003 |
mbr |
Add support for 3Com OfficeConnect 10/100B.
PR: 49059, 50747 Submitted by: Dax Eckenberg <daxbert@dweebsoft.com> Reviewed by: imp, jhb Approved by: jhb MFC after: 2 weeks
|
114399 |
01-May-2003 |
mbr |
Use only a 64bit hash filter table for ADM-Centaur cards like the Accton EN2242 and the ADMtek AN985 cards.
PR: 32699 Submitted by: Jean-Luc Richier <Jean-Luc.Richier@imag.fr> Reviewed by: phk MFC after: 2 weeks
|
113812 |
21-Apr-2003 |
imp |
Use newly minted device_is_attached rather than device_is_alive to see if attach succeeded. device_is_alive just tells us that probe succeeded. Since we were using it to do things like detach net interfaces, this caused problems when there were errors in the attach routine.
Symptoms of problem reported by: martin blapp
|
113669 |
18-Apr-2003 |
sanpei |
Add support for Planex FNW-3602-T(CardBus 100M/10M).
Submitted by: kazz <kazz@v001.vaio.ne.jp> Obtained from: [bsd-nomads:16637]
|
113609 |
17-Apr-2003 |
njl |
Revise attach/detach resource cleanup - Unconditionally call *_stop() if device is in the tree. This is to prevent callouts from happening after the device is gone. Checks for bus_child_present() should be added in the future to keep from touching potentially non-existent hardware in *_detach(). Found by iedowse@. - Always check for and free miibus children, even if the device is not in the tree since some failure cases could have gotten here. - Call ether_ifdetach() in the irq setup failure case - ti(4), xl(4): move ifmedia_init() calls to the beginning of attach so that ifmedia_removeall() can be unconditionally called on detach. There is no way to detect whether ifmedia has been initialized without using a separate variable (as tl(4) does). - Add comments to indicate assumptions of code path
|
113592 |
17-Apr-2003 |
iedowse |
Revert part of revision 1.97 by calling dc_stop() unconditionally in dc_detach() instead of only calling it if the hardware is preset. This is a workaround for page faults in softclock() after a `dc' device was detached, caused by not disabling a timer before freeing its memory. The bus_child_present() checks should probably be re-added later, but only to avoid the hardware accesses and not the other resource cleanups in dc_stop().
Approved by: njl
|
113545 |
16-Apr-2003 |
mdodd |
- Don't call pci_enable_io() in drivers (unless needed for resume). - Don't test memory/port status and emit an error message; the PCI bus code will do this now.
|
113506 |
15-Apr-2003 |
mdodd |
- Express hard dependencies on bus (pci, isa, pccard) and network layer (ether). - Don't abuse module names to facilitate ifconfig module loading; such abuse isn't really needed. (And if we do need type information associated with a module then we should make it explicit and not use hacks.)
|
113038 |
03-Apr-2003 |
obrien |
Use __FBSDID rather than rcsid[].
|
112880 |
31-Mar-2003 |
jhb |
Add missing ()'s so that these drivers all compile again.
Noticed by: jake Tested on: i386 (compile)
|
112872 |
31-Mar-2003 |
njl |
Clean up locking and resource management for pci/if_*
- Remove locking of the softc in the attach method, instead depending on bus_setup_intr being at the end of attach (delaying interrupt enable until after ether_ifattach is called) - Call *_detach directly in the error case of attach, depending on checking in detach to only free resources that were allocated. This puts all resource freeing in one place, avoiding thinkos that lead to memory leaks. - Add bus_child_present check to calls to *_stop in the detach method to be sure hw is present before touching its registers. - Remove bzero softc calls since device_t should do this for us. - dc: move interrupt allocation back where it was before. It was unnecessary to move it. This reverts part of 1.88 - rl: move irq allocation before ether_ifattach. Problems might have been caused by allocating the irq after enabling interrupts on the card. - rl: call rl_stop before ether_ifdetach - sf: call sf_stop before ether_ifdetach - sis: add missed free of sis_tag - sis: check errors from tag creation - sis: move dmamem_alloc and dmamap_load to happen at same time as tag creation - sk: remove duplicate initialization of sk_dev - ste: add missed bus_generic_detach - ti: call ti_stop before ether_ifdetach - ti: add missed error setting in ti_rdata alloc failure - vr: add missed error setting in I/O, memory mapping cases - xl: add missed error setting in I/O, memory mapping cases - xl: remove multi-level goto on attach failure - xl: move dmamem_alloc and dmamap_load to happen at same time as tag creation - Calls to free(9) are unconditional because it is valid to call free with a null pointer.
Reviewed by: imp, mdodd
|
112819 |
29-Mar-2003 |
silby |
Update if_dc to use m_defrag, removing the semi-duplicate dc_coal function.
Also, use m_defrag where appropriate to defrag long mbuf chains in the same fashion as was done in if_sis.c. Before this change, if_dc would blow up and take down the interface if fed a really long mbuf chain.
MFC after: 2 weeks
|
112469 |
21-Mar-2003 |
mdodd |
- Use if_broadcastaddr from struct ifnet rather than relying on extern 'etherbroadcastaddr'. - Make 'etherbroadcastaddr' static.
Reviewed by: imp
|
111119 |
19-Feb-2003 |
imp |
Back out M_* changes, per decision of the TRB.
Approved by: trb
|
110754 |
12-Feb-2003 |
imp |
Minor correction to comment: PNIC and XIRCOM have eeprom, its just non-standard.
|
110524 |
07-Feb-2003 |
mbr |
Fix the breakage resulting from Rev. 1.80. Get the eeprom width for all but two cards. This should fix broken cards like these:
DM9102 (Davicom, DEVICE_ID: 0x9002) DM9009 (Davicom, DEVICE_ID: 0x9009) DM9100 (Davicom, DEVICE_ID: 0x9100) 98713/98713_CP (Macronix PMAC, DEVICE_ID: 0x0512) 98713_CP (Macronix PMAC, DEVICE_ID: 0x0512) 987x5 (Macronix PMAC, DEVICE_ID: 0x0531) 98727 (Macronix PMAC, DEVICE_ID: 0x0532) 82C115 (Lite-On PNIC II, DEVICE_ID: 0xc115) AX88140A (ASIX Dev_ID: DEVICE_ID: 0x1400) EN1217 (Accton EN1217, DEVICE_ID: 0x1217)
Note that these cards sould still work in STABLE.
Reviewed by: imp
|
110497 |
07-Feb-2003 |
mbr |
Add missing braces.
Found by: FlexeLint (phk) Reviewed by: wpaul, phk
|
110420 |
05-Feb-2003 |
mbr |
Move the DC_SETBIT to the attach function.
Reviewed by: phk
|
109623 |
21-Jan-2003 |
alfred |
Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0. Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
|
109514 |
19-Jan-2003 |
obrien |
Remove miidevs.h and generate it from miidevs at compile time. The devlist2h.awk tool to do this has been repocopied to sys/tools/.
|
109245 |
14-Jan-2003 |
njl |
Remove bogus locking from dc(4). Instead, move interrupt allocation and ether_ifattach() to end. This fixes a "could sleep" case and simplifies error exit cases as well. Also be sure to set errno and clean up resources in !mac error case.
Tested by: Ryan Beasley
|
109048 |
10-Jan-2003 |
imp |
Add preliminary support for the Hawking PN672TX CardBus cards.
# Preliminary because there are some subtle things the NetBSD driver does # that we don't do yet. My card works for me w/o them.
|
109030 |
09-Jan-2003 |
trhodes |
Add support for the Davicom DM9009 chipset.
PR: 46859 Submitted by: Boaz Haberman <boaz@ool-182f8b09.dyn.optonline.net> Approved by: rwatson
|
108062 |
18-Dec-2002 |
semenu |
Fix the missspelt letter in DC_CTYPE_PUP_AUTOSENSe define.
Submitted by: marius@alchemy.franken.de MFC after: 3 days
|
107302 |
27-Nov-2002 |
imp |
Xircom cards store the MAC address in the CIS, so get it from the new pci_get_ether accesor, which gets it from the CIS for cardbus cards (and from other pci-like buses via whatever mechanism is used there).
Submitted by: sam Approved by: re (blanket)
|
107239 |
25-Nov-2002 |
luigi |
Fix handling of IFF_ALLMULTI. The same bug in various forms affects the following drivers:
dc mn sf sk ste ti tl xl an bge em gem gx ie lge sr aue cue kue wi xe
Approved by: re
|
106936 |
14-Nov-2002 |
sam |
o track either_ifattach/ether_ifdetach API changes o use if_input for input packet processing o don't strip the Ethernet header for input packets o use BPF_* macros bpf tapping o call ether_ioctl to handle default ioctl case o track vlan changes
Reviewed by: many Approved by: re
|
105219 |
16-Oct-2002 |
phk |
Be consistent about functions being static.
Spotted by: FlexeLint.
|
105135 |
14-Oct-2002 |
alfred |
Put function return types on a line by themselves. Cleanup my earlier de-__P sweep and remove whitespace between function names and paramters.
|
104600 |
07-Oct-2002 |
imp |
Ooops. Need to free dc_srom on detach to not leak memory.
Pointy Hat to: The Mad Redhead of Niwot
|
104599 |
07-Oct-2002 |
imp |
Dynamically configure the width of the srom. This code comes from OpenBSD who got the code (or the idea) from the NetBSD tlp driver.
This gets some cardbus dc cards working (either completely or nearly so). It also appears to get additional pci cards working, without breaking working ones.
# Maybe some additional work is needed here. Also, the cardbus attachment # might need to match on the CIS rather than on the vendor/device so we have # a finer level of detail as to what the card is. Technically, the # vendor/device fields are undefined for CardBus (even though most cards are # using common silicon with pci models).
|
103685 |
20-Sep-2002 |
mbr |
Fix the support for the AN985/983 chips, which do not set the RXSTATE to STOPPED, but to WAIT. This should fix hangs which could only be solved by replugging the cable.
Submitted by: jhb Reviewed by: phk MFC after: 2 weeks
|
103684 |
20-Sep-2002 |
mbr |
Enable the automatic TX underrun recovery for the ADMtek chips. This solves cvsup update on my laptop which aborts after a while without this patch.
PR: 34236 Reviewed by: phk MFC after: 2 weeks
|
102930 |
04-Sep-2002 |
markm |
Make consistent; turn spaces into tabs where there is a mixture.
|
102335 |
23-Aug-2002 |
alfred |
style: put return values on a line by themselves. fix some paste issues where whitespace was used instead of tabs.
|
102052 |
18-Aug-2002 |
sobomax |
Increase size of ifnet.if_flags from 16 bits (short) to 32 bits (int). To avoid breaking application ABI use unused ifreq.ifru_flags[1] for upper 16 bits in SIOCSIFFLAGS and SIOCGIFFLAGS ioctl's.
Reviewed by: -hackers, -net
|
99164 |
30-Jun-2002 |
luigi |
Fix if_timer logic to make sure that there is always a timeout pending if there are packets queued for transmission.
MFC after: 3 days
|
96111 |
06-May-2002 |
iwasaki |
Add suspend/resume code mostly merged from fxp/rl driver. This is temporary hack, better and generalized solution probably should be implemented at lower layer(MII or PCI?). Tested by: shoko.araki@soliton.co.jp MFC after: 1 week
|
96026 |
04-May-2002 |
phk |
Clean up mii/phy drivers: Remove the MIIF_DOINGAUTO which doesn't really do anything at the end of the day except bloat the drivers which has copy&pasted it.
|
95975 |
03-May-2002 |
phk |
Don't grab the lock until somewhat later in attach to avoid a lock reversal.
|
95722 |
29-Apr-2002 |
phk |
Make one generic mii_phy_detach() to replace 19 slightly different ones.
Rename mii_phy_auto_stop() mii_phy_down().
Introduce mii_down(), use it from nge. Do not indirect it to 19 identical case's in 19 switchstatements like NetBSD did.
|
95702 |
29-Apr-2002 |
phk |
Move us yet closer to IFM_* definitions in NetBSD.
|
95667 |
28-Apr-2002 |
phk |
Don't pass three args when one will do just fine, and even prevent mistakes like the one brgphy.c (now corrected).
|
95665 |
28-Apr-2002 |
phk |
Improve an API by about 4 lines per driver.
|
94994 |
18-Apr-2002 |
mckay |
Work around an Intel 21143 chip bug.
Rev 1.56 of if_dc.c removed calls to mii_pollstat() from the dc_tick() routine. dc_tick() is called regularly to detect link up and link down status, especially when autonegotiating.
The expectation was that mii_tick() (which is still called from dc_tick()) would update status information automatically in all cases where it would be sensible to do so.
Unfortunately, with authentic 21143 chips this is not the case, and the driver never successfully autonegotiates. This is because (despite what it says in the 21143 manual) the chip always claims that link is not present while the autonegotiation enable bit is set. Autonegotation takes place and succeeds, but the driver tests the link bits before it switches off the autonegotiation enable bit, and success is not recognised.
The simplest solution is to call dcphy_status() more often for MII_TICK calls by dropping out of the switch statement instead of exiting when we are autonegotiating and link appears to not be present. When autonegotiation succeeds, dcphy_status() will note the speed and fdx/hdx state and turn off the autonegotiation enable bit. The next call to dcphy_status() will notice that link is present, and the dc driver code will be notified.
Macronix chips also use this code, but implement link detection as described in the manual, and hence don't need this patch. However, tests on a Macronix 98715AEC-C show that it does not adversely affect them.
This could be done better but is the minimal effective change, and most closely mimics what was happening prior to rev 1.56 of if_dc.c. (Actually I also deleted a small amount of unnecessary code while I was in the area.)
Reviewed by: wpaul
|
93818 |
04-Apr-2002 |
jhb |
Change callers of mtx_init() to pass in an appropriate lock type name. In most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used.
Tested on: i386, alpha, sparc64
|
92739 |
20-Mar-2002 |
alfred |
Remove __P.
|
89436 |
16-Jan-2002 |
ambrisko |
Forgot one part of the VLAN support for the dc(4) driver.
Pointed out by: Shin-ichi YOSHIMOTO <yosimoto@waishi.jp>
|
89431 |
16-Jan-2002 |
ambrisko |
Add VLAN for the dc(4) driver (ie long frame). The patch is 2 parts. One to notify the system that the MTU for VLAN can be 1500 so the vlan will automatically be configured with a 1500 MTU the other is to ignore the error case if the received frame is to long.
The frame size notification came from code in the SIS driver, and the support for long frames derived from the NetBSD Tulip driver.
Tested on: 4 port D-Link adapter DFE-570TX 4 Intel 21143 Netgear card with 82c169 PNIC 10/100BaseTX
Reviewed by: ru (manpage), wpaul (not objected to), archie Approved by: imp Obtained from: NetBSD
|
88214 |
19-Dec-2001 |
wpaul |
Fix the "conexant chips don't work in full duplexmode" problem. According to Phil Kernick:
"The problem is that in full duplex mode, the Conexant chip always reports a carrier lost error, even when the frame is successfully sent. So, if we have a Conexant chip, then ignore carrier lost when in full duplex mode."
Since the Xircom chips seem to have the same issue and since we already have a workaround for this, just expand the workaround test to also check for DC_IS_CONEXANT().
|
88213 |
19-Dec-2001 |
wpaul |
Fix compiler warning in dc_intr(): if the only code that does a "goto" to a label is inside an #ifdef block, then the label should *also* be inside an #ifdef block. Hide the "done:" label which is only used if DEVICE_POLLING is enabled under #ifdef DEVICE_POLLING.
|
87973 |
15-Dec-2001 |
peter |
Patch up some existing style bugs and some that crept in with the DEVICE_POLLING stuff.
|
87902 |
14-Dec-2001 |
luigi |
Device Polling code for -current.
Non-SMP, i386-only, no polling in the idle loop at the moment.
To use this code you must compile a kernel with
options DEVICE_POLLING
and at runtime enable polling with
sysctl kern.polling.enable=1
The percentage of CPU reserved to userland can be set with
sysctl kern.polling.user_frac=NN (default is 50)
while the remainder is used by polling device drivers and netisr's. These are the only two variables that you should need to touch. There are a few more parameters in kern.polling but the default values are adequate for all purposes. See the code in kern_poll.c for more details on them.
Polling in the idle loop will be implemented shortly by introducing a kernel thread which does the job. Until then, the amount of CPU dedicated to polling will never exceed (100-user_frac). The equivalent (actually, better) code for -stable is at
http://info.iet.unipi.it/~luigi/polling/
and also supports polling in the idle loop.
NOTE to Alpha developers: There is really nothing in this code that is i386-specific. If you move the 2 lines supporting the new option from sys/conf/{files,options}.i386 to sys/conf/{files,options} I am pretty sure that this should work on the Alpha as well, just that I do not have a suitable test box to try it. If someone feels like trying it, I would appreciate it.
NOTE to other developers: sure some things could be done better, and as always I am open to constructive criticism, which a few of you have already given and I greatly appreciated. However, before proposing radical architectural changes, please take some time to possibly try out this code, or at the very least read the comments in kern_poll.c, especially re. the reason why I am using a soft netisr and cannot (I believe) replace it with a simple timeout.
Quick description of files touched by this commit:
sys/conf/files.i386 new file kern/kern_poll.c sys/conf/options.i386 new option sys/i386/i386/trap.c poll in trap (disabled by default) sys/kern/kern_clock.c initialization and hardclock hooks. sys/kern/kern_intr.c minor swi_net changes sys/kern/kern_poll.c the bulk of the code. sys/net/if.h new flag sys/net/if_var.h declaration for functions used in device drivers. sys/net/netisr.h NETISR_POLL sys/dev/fxp/if_fxp.c sys/dev/fxp/if_fxpvar.h sys/pci/if_dc.c sys/pci/if_dcreg.h sys/pci/if_sis.c sys/pci/if_sisreg.h device driver modifications
|
87638 |
11-Dec-2001 |
luigi |
Avoid an unnecessary copy of a packet if it is already in a single mbuf. Introduce an additional device flag for those NICs which require the transmit buffers to be aligned to 32-bit boundaries.
(the equivalen fix for STABLE is slightly simpler because there are no supported chips which require this alignment there.)
|
87471 |
07-Dec-2001 |
peter |
MFS (merge from stable): rev 1.9.2.28, fix ordering of IFF_RUNNING mods. The reason we are required to commit to -current first is so that later MFC's do not risk the loss of existing bug fixes. Even if this was not strictly required in -current, it should still be fixed there too.
|
87330 |
04-Dec-2001 |
luigi |
Remove error messages on mbuf allocation failures, now this is done more safely in kern/subr_mbuf.c
Two-days'-delay-thanks-to: @home shutting down service
|
87102 |
29-Nov-2001 |
luigi |
Per jlemon request, reintroduce some printf() when an mbuf allocation fails, and fix (i hope) a couple of style bugs.
I believe these printf() are extremely dangerous because now they can occur on every incoming packet and are not rate limited. They were meant to warn the sysadmin about lack of resources, but now they can become a nice way to panic your system under load.
Other drivers (e.g. the fxp driver) have nothing like this.
There is a pending discussion on putting this kind of warnings elsewhere, and I hope we can fix this soon.
|
87099 |
29-Nov-2001 |
luigi |
For i386 architecture, remove an expensive m_devget() (and the underlying unaligned bcopy) on incoming packets that are already available (albeit unaligned) in a buffer. The performance improvement varies, depending on CPU and memory speed, but can be quite large especially on slow CPUs. I have seen over 50% increase on forwarding speed on the sis driver for the 486/133 (embedded systems), which does exactly the same thing.
The behaviour is controlled by a sysctl variable, hw.dc_quick which defaults to 1. Set it to 0 to restore the old behaviour.
After running a few experiments (in userland, though) I am convinced that doing the m_devget() is detrimental to performance in almost all cases.
Even if your CPU has degraded performance with misaligned data, the bcopy() in the driver has the same overhead due to misaligment as the one that you save in the uiomove(), plus you do one extra copy and pollute the cache.
But more often than not, you do not even have to touch the payload, e.g. when you are forwarding packets, and even in the often-cited case of NFS, you often end up passing a pointer to the payload to the disk controller.
In any case, you can play with the sysctl variable to toggle between the two behaviours, and see if it makes a difference.
MFC-after: 3 days
|
86364 |
14-Nov-2001 |
jhb |
Remove ifnet.if_mpsafe for now. If this is needed, it won't be needed until much later when the network stack locking is farther along.
Approved by: jlemon
|
85571 |
27-Oct-2001 |
luigi |
Enable round-robin arbitration between transmit and receive unit in the 21143, instead of giving priority to the receive unit. This gives a 10-15% performance improvement in the forwarding rate under heavy load.
Reviewed-by: Bill Paul
|
85495 |
25-Oct-2001 |
luigi |
Defs for three (unused so far) bits in PCI command/status register were off by one bit.
|
84147 |
29-Sep-2001 |
jlemon |
Do not call mii_pollstat() from within device tick routines; the status information is updated by mii_tick().
Pointed out by: wpaul (a while back)
|
84145 |
29-Sep-2001 |
jlemon |
Cleanup pass for mii drivers. . Make internal service routines static. . Use a consistent ordering of checks in MII_TICK. Do the work in the mii_phy_tick() subroutine if appropriate. . Call mii_phy_update() to trigger the callbacks.
|
82978 |
04-Sep-2001 |
wpaul |
Add support for Conexant LANfinity miniPCI controllers. People who have laptops with this chip should test this and report back as I don't have access to this hardware myself. People with -stable systems should try the patch at:
http://www.freebsd.org/~wpaul/conexant.patch.gz
Submitted by: Phil Kernick <Phil@Kernick.org>
|
79648 |
12-Jul-2001 |
wpaul |
Deal with the condition where we lose link in the middle of transmitting a bunch of frames. In this case, the dc_link flag is cleared, and dc_start() stops draining the if_snd send queue, which results in lots of 'no buffers available' errors being reported to applications. The whole idea behind not draining the send queue until the link comes up was to avoid having the gratuitous ARP being lost while we're waiting for autoneg to complete after the interface is first brought up. As an optimization, change the test in dc_start() so that we only bail if dc_link is not set _and_ there are less than 10 packets in the send queue. If the queue has many frames in it, we need to drain them. If the queue has a small number of frames in it, we can hold off on sending them until the link comes up.
MFC after: 1 week
|
79472 |
09-Jul-2001 |
wpaul |
Apply patch supplied by Jonathan Chen: use the correct arguments to pci_enable_io(). We need to use SYS_RES_IOPORT/SYS_RES_MEMORY instead of PCIM_CMD_PORTEN/PCIM_CMD_MEMEN.
|
78508 |
20-Jun-2001 |
bmilekic |
Change m_devget()'s outdated and unused `offset' argument to actually mean something: offset into the first mbuf of the target chain before copying the source data over.
Make drivers using m_devget() with a first argument "data - ETHER_ALIGN" to use the offset argument to pass ETHER_ALIGN in. The way it was previously done is potentially dangerous if the source data was at the top of a page and the offset caused the previous page to be copied (if the previous page has not yet been appropriately mapped).
The old `offset' argument in m_devget() is not used anywhere (it's always 0) and dates back to ~1995 (and earlier?) when support for ethernet trailers existed. With that support gone, it was merely collecting dust.
Tested on alpha by: jlemon Partially submitted by: jlemon Reviewed by: jlemon MFC after: 3 weeks
|
74914 |
28-Mar-2001 |
jhb |
Catch up to header include changes: - <sys/mutex.h> now requires <sys/systm.h> - <sys/mutex.h> and <sys/sx.h> now require <sys/lock.h>
|
72915 |
22-Feb-2001 |
wpaul |
Apply patch to allow TX underrun handling without issuing a complete chip reset. Just temporarily turn off the transmitter instead.
Submitted by: Stephen McKay <mckay@freebsd.org>
|
72813 |
21-Feb-2001 |
wpaul |
Big round of minor updates:
- Use pci_get_powerstate()/pci_set_powerstate() in all the other drivers that need them so we don't have to fiddle with the PCI power management registers directly. - Use pci_enable_busmaster()/pci_enable_io() to turn on busmastering and PIO/memory mapped accesses. - Add support to the RealTek driver for the D-Link DFE-530TX+ which has a RealTek 8139 with its own PCI ID. (Submitted by Jason Wright) - Have the SiS 900/National DP83815 driver be sure to disable PME mode in sis_reset(). This apparently fixes a problem on some motherboards where the DP83815 chip fails to receive packets. (Submitted by Chuck McCrobie <mccrobie@cablespeed.com>)
|
72745 |
20-Feb-2001 |
imp |
Take luigi's suggestion and move the check for nothing to do to before the lock so we don't have lots of null lock/release pairs.
|
72743 |
20-Feb-2001 |
imp |
Add DC_UNLOCK before first return. This caused returns when dc was on a shared interrupt.
Pointed out by tegge.
|
72633 |
18-Feb-2001 |
luigi |
Add a check in the interrupt service routine to return quickly in case there is nothing to do. This happens normally when the card shares the interrupt line with other devices.
This code saves a couple of microseconds per interrupt even on a fast CPU. You normally would not care, except under heavy tinygram traffic where you can have some 50-100.000 interrupts per second...
On passing, correct a spelling error.
|
72200 |
09-Feb-2001 |
bmilekic |
Change and clean the mutex lock interface.
mtx_enter(lock, type) becomes:
mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)
similarily, for releasing a lock, we now have:
mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument.
The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind.
Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two:
MTX_QUIET and MTX_NOSWITCH
The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers:
mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively.
Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case.
Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled.
Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those.
Finally, caught up to the interface changes in all sys code.
Contributors: jake, jhb, jasone (in no particular order)
|
72084 |
06-Feb-2001 |
phk |
Convert if_multiaddrs from LIST to TAILQ so that it can be traversed backwards in the three drivers which want to do that.
Reviewed by: mikeh
|
71962 |
03-Feb-2001 |
phk |
Use LIST_FOREACH() to traverse ifp->if_multiaddrs list, instead of <sys/queue.h> implementation details.
Created with: /usr/sbin/sed Reviewed with: /sbin/md5
|
71272 |
20-Jan-2001 |
wpaul |
Silence compiler warnings.
|
71271 |
19-Jan-2001 |
wpaul |
Bug fixes that I've put together while working on a project in the office:
if_vr: handle the case where vr_encap() returns failure: bust out of the packet sending loop instead of panicking. Also add some missing newlines to some printf()s.
if_dc: The miibus_read and miibus_write methods keep swapping in and out of MII mode by fiddling with CSR6 for cards with MII PHYs. This is a hack to support the original Macronix 98713 card which has built-in NWAY that uses an MII-like management interface even though it uses serial transceivers. Conditionalize this so that we only do this on 98713 chips, since it does bad things to genuine tulip chips (and maybe other clones).
|
71228 |
19-Jan-2001 |
bmilekic |
Implement MTX_RECURSE flag for mtx_init(). All calls to mtx_init() for mutexes that recurse must now include the MTX_RECURSE bit in the flag argument variable. This change is in preparation for an upcoming (further) mutex API cleanup. The witness code will call panic() if a lock is found to recurse but the MTX_RECURSE bit was not set during the lock's initialization.
The old MTX_RECURSE "state" bit (in mtx_lock) has been renamed to MTX_RECURSED, which is more appropriate given its meaning.
The following locks have been made "recursive," thus far: eventhandler, Giant, callout, sched_lock, possibly some others declared in the architecture-specific code, all of the network card driver locks in pci/, as well as some other locks in dev/ stuff that I've found to be recursive.
Reviewed by: jhb
|
70167 |
18-Dec-2000 |
wpaul |
Use pci_get_powerstate()/pci_set_powerstate() which now exists in the PCI code. This saves each driver from having to grovel around looking for the right registers to twiddle.
I should eventually convert the other PCI drivers to do this; for now, these three are ones which I know need power state handling.
|
69583 |
04-Dec-2000 |
wpaul |
Initialize/grab the mutex earlier in the attach phase, so that bailing out to the fail: label where we release/destroy the mutex will work without exploding.
|
69154 |
25-Nov-2000 |
jlemon |
Change the driver to allocate its own callout structure, and modify the interface to use callout_* instead of timeout(). Also add an IS_MPSAFE #define (currently off) which will mark the driver as mpsafe to the upper layers.
|
68725 |
14-Nov-2000 |
wpaul |
Add support for the Accton EN2242 MiniPCI adapter. This is just an ADMtek Centaur chip, so all we need is the PCI ID.
Submitted by: Scott Lang <scottl@FreeBSD.org>
|
68268 |
03-Nov-2000 |
wpaul |
Grrrr. Remember to bzero() the mediainfo structures after we allocate them. If we leave garbage in them, the dc_apply_fixup() routine may try to follow bogus pointers when applying the reset fixup.
Noticed by: Andrew Gallatin
|
68015 |
31-Oct-2000 |
wpaul |
Call dc_apply_fixup() in dc_setcfg() for the MII case.
|
68013 |
30-Oct-2000 |
wpaul |
Grrr. The 'reg' variable in dc_apply_fixup() needs to be a u_int32_t, not a u_int8_t. Pass the conical hat. This should fix certain cardbus 21143 cards that require SROM h0h0magic in order to enable their transceivers.
|
67778 |
28-Oct-2000 |
peter |
Fix typo s/DE_DEVICEID_FE2500/DC_DEVICEID_FE2500/
|
67771 |
28-Oct-2000 |
wpaul |
Add PCI IDs for some additional cardbus cards. Yes, there really is a RealTek 8139 cardbus device. Unfortunately it doesn't quite work yet because the CIS parser barfs on it.
Submitted by msmith, with some small tweaks by me.
|
67668 |
27-Oct-2000 |
wpaul |
Yet another bug fix/optimization for the Davicom DM9100/9102: increase the PCI latency timer value to 0x80. Davicom's Linux driver does this, and it drastically reduces the number of TX underruns in my tests. (Note: this is done only for the Davicom chips. I'm not sure it's a good idea to do it for all of them.)
Again, still waiting on confirmation before merging to stable.
|
67595 |
25-Oct-2000 |
wpaul |
Set the DC_TX_INTR_ALWAYS and DC_TX_STORENFWD flags for the Davicom DM9100/DM9102 chips. Do not set DC_TX_ONE. The DC_TX_USE_TX_INTR flag causes dc_encap() to set the 'interrupt on TX completion' bit only once every 64 packets. This is an attempt to reduce the number of interrupts generated by the chip. You're supposed to get a 'no more TX buffers left' interrupt once you hit the last packet whether you ask for one or not, however it seems the Davicom chip doesn't generate this interrupt, or at least it doesn't generate it under the same circumstances. The result is that if you transmit n packets, where n is less than 64, and then wait 5 seconds, you'll get a watchdog timeout whether you want one or not. The DC_TX_INTR_ALWAYS causes dc_encap() to request an interrupt for every frame.
I'm still waiting on confirmation from a couple of users to see if this fixes their problems with the Davicom DM9102 before I merge this into -stable, but this fixed the problem for me in my own testing so I'm willing to make the change to -current right away.
|
67365 |
20-Oct-2000 |
jhb |
Catch up to moving headers: - machine/ipl.h -> sys/ipl.h - machine/mutex.h -> sys/mutex.h
|
67363 |
20-Oct-2000 |
jhb |
Remove unnecessary machine/mutex.h include.
|
67314 |
19-Oct-2000 |
jon |
NEWCARD/Cardbus -
This commit adds support for Xircom X3201 based cardbus cards. Support for the TDK 78Q2120 MII is also added. IBM Etherjet, Intel and Xircom cards uses these chips.
Note that as a result of this commit, some Intel/DEC 21143 based cardbus cards will also attach, but not get link. That is being looked at.
|
67164 |
15-Oct-2000 |
phk |
Remove unneeded #include <machine/clock.h>
|
67102 |
14-Oct-2000 |
wpaul |
Clean up a few things in dc_setcfg() pointed out to be me by aaron@openbsd.com on IRC earlier today.
|
67091 |
13-Oct-2000 |
wpaul |
Add #include <machine/mutex.h> since these files need it and don't include anything else that includes mutex.h. Needed to resolve struct mtx from struct dc_softc.
|
67089 |
13-Oct-2000 |
wpaul |
Use device_get_nameunit(dev) as the mutex string when calling mtx_init() instead of hard-coded string constant. Also remember to do the mutex changes to the ste driver, which I forgot in the first commit.
|
67087 |
13-Oct-2000 |
wpaul |
First round of converting network drivers from spls to mutexes. This takes care of all the 10/100 and gigE PCI drivers that I've done. Next will be the wireless drivers, then the USB ones. I may pick up some stragglers along the way. I'm sort of playing this by ear: if anyone spots any places where I've screwed up horribly, please let me know.
|
66681 |
05-Oct-2000 |
wpaul |
Add support for parsing the media blocks from the SROM on 21143 adapters. This is necessary in order to make this driver work with the built-in ethernet on the alpha Miata machines. These systems have a 21143-PC chip on-board and optional daughtercards with either a 10/100 MII transceiver or a 10baseT/10base2 transceiver. In both cases, you need to twiddle the GPIO bits on the controller in order to turn the transceivers on, and you have to read the media info from the SROM in order to find out what bits to twiddle.
|
66089 |
20-Sep-2000 |
wpaul |
If this is a Davicom DM9102A and we're enabling the homePNA link, force dc_link to 1 and don't activate the tick routine. Without this, dc_start() always thinks the link is down and never transmits in homePNA mode.
|
65584 |
07-Sep-2000 |
wpaul |
Special-case the LED twiddling code so that it doesn't do anything on the NEC VersaPro NoteBook PC. This 21143 implementation has no LEDs, and flipping the LED control bits somehow stops it from establishing a link. We check the subsystem ID and don't flip the LED control bits for the NEC NIC.
|
65350 |
02-Sep-2000 |
wpaul |
Define some more bits in CSR15 needed for previous change.
|
65349 |
01-Sep-2000 |
wpaul |
Make the blinkylights on non-MII 21143 cards work. We need to enable the link and activity LED control bits in CSR15 in order for the controller to drive the LEDs correctly. This was largely done for the ZNYX multiport cards, but should also work with the DEC DE500-BA and other non-MII cards.
|
64347 |
07-Aug-2000 |
wpaul |
Close PR 20438. Make fix for preserving LED settings conditional on presence Intel 21143 chip.
|
64134 |
02-Aug-2000 |
wpaul |
Grrrr. Add definition for DC_WDOG_CTLWREN. I made this change yesterday but stupidly only commited to if_dc.c.
|
64107 |
01-Aug-2000 |
wpaul |
Apply patch supplied by John Hood <jhood@sitaranetworks.com> to fix problems with LEDs on some cards being stomped on when clearing the "jabber disable" bit. Using DC_SETBIT() has an unwanted side effect of setting a write enable bit in the watchdog timer register which we really want to be cleared when we do a write.
|
63326 |
17-Jul-2000 |
wpaul |
Add the PCI IDs for the Macronix 98727 and 98732 parts. These are 3.3volt PCI/cardbus chipsets similar to the 98715 (and they have 512-bit hash tables). Also update the man page to mention the 98727/98732 and the SOHOware SFA110A Rev B4 card with the 98715AEC-C chip.
|
63229 |
15-Jul-2000 |
wpaul |
Apply patch to the dc driver to handle Macronix MX98715AEC-C/D/E chips, which differ slightly from the Macronix MX98715AEC chip on the sample adapter that I have in that the multicast hash table is only 128 bits wide instead of 512. New adapters are popping up with this chip, and due to improper handling of the smaller hash table, broadcast packets were not being received correctly.
|
63090 |
13-Jul-2000 |
archie |
Make all Ethernet drivers attach using ether_ifattach() and detach using ether_ifdetach().
The former consolidates the operations of if_attach(), ng_ether_attach(), and bpfattach(). The latter consolidates the corresponding detach operations.
Reviewed by: julian, freebsd-net
|
61545 |
11-Jun-2000 |
asmodai |
Add support for the Accton EN1217.
PR: 18735 Submitted by: Adoal Xu <adoal@iname.com>
|
61363 |
07-Jun-2000 |
wpaul |
When I tweaked if_dc.c to alter the polling interval for non-MII 21143 chips, I accidentally removed the DC_MII_REDUCED_POLL flag for all 21143 cards. This caused problems with timer-instigated TCP retransmits, which happened to occur at the same time as an MII poll tick on MII-based cards (e.g. D-Link DFE-570TX). Fixed this, plus made some other cleanups. The autoneg fixes for the non-MII cards still work. Also tested the PNIC II now that I have one again.
|
61290 |
05-Jun-2000 |
wpaul |
Don't bother checking the link state in dcphy_status() if the interface isn't up.
|
61110 |
31-May-2000 |
wpaul |
Rework the support for the internal autonegotiation on the 21143 and workalike chips (Macronix 98713A/98715 and PNIC II). Timing is somewhat critical: you need to bring the link as soon as possible after NWAY is done, and the old one second polling interval was too long. Now we poll every 10th of a second until NWAY completes (at which point we return to the 1 second interval again to keep an eye on the link state).
I tested all the other cards I had on hand to make sure I didn't bust any of them and they seem to work (including the MII-based 21143 card). This should fix some autoneg problems with DE500-BA cards and the built-in 10/100 ethernet on some alpha systems.
(Now before anyone asks why I never noticed this before, the old code worked just find with the Intel swich I used for testing back in NY. Apparently not all switches are as picky about the timing.)
|
61039 |
28-May-2000 |
peter |
Use the correct register names. s/PCI_COMMAND_STATUS_REG/PCIR_COMMAND/
|
60536 |
14-May-2000 |
archie |
Move code to handle BPF and bridging for incoming Ethernet packets out of the individual drivers and into the common routine ether_input(). Also, remove the (incomplete) hack for matching ethernet headers in the ip_fw code.
The good news: net result of 1016 lines removed, and this should make bridging now work with *all* Ethernet drivers.
The bad news: it's nearly impossible to test every driver, especially for bridging, and I was unable to get much testing help on the mailing lists.
Reviewed by: freebsd-net
|
59758 |
29-Apr-2000 |
peter |
Depend on miibus.
Note that if_aue doesn't strictly depend on usb because it uses the method interface for calls rather than using internal symbols, and because it's a child driver of usb and therefore will not try and do anything unless the parent usb code is loaded at some point. if_aue does strictly depend on miibus as it will fail to link if it is missing.
|
59391 |
19-Apr-2000 |
phk |
Remove ~25 unneeded #include <sys/conf.h> Remove ~60 unneeded #include <sys/malloc.h>
|
57901 |
11-Mar-2000 |
msmith |
Teach the 'dc' driver how to pick up settings left over by the SRM on alpha systems. This is an expedient if not entirely elegant solution to the problem.
Submitted by: gallatin Approved by: jkh
|
57871 |
09-Mar-2000 |
rwatson |
Introduce ethernet bridge support for if_dc
Approved by: jkh
|
56541 |
24-Jan-2000 |
wpaul |
Add support for DM9102A boards with Davicom DM9801 HomePNA PHYs.
|
56295 |
19-Jan-2000 |
wpaul |
Add support for the Davicom DM9102A 10/100 ethernet controller chip. This is just to make sure we initialize the chip correctly: we need to make the sure the port select bit in CSR6 is set properly so that we use the internal PHY for 10/100 support. (The eval boards I have also include an external HomePNA PHY, but I need to play with that more before I can support it.)
|
55866 |
12-Jan-2000 |
wpaul |
Reintroduce the dc_coal() workaround routine for coalescing outbound packets into a single buffer, and set the DC_TX_COALESCE flag for the Davicom DM9102 chip. I thought I had escaped this problem, but... This chip appears to silently corrupt or discard transmitted frames when using scatter/gather DMA (i.e. DMAing each packet fragment in place with a separate descriptor). The only way to insure reliable transmission is to coalesce transmitted packets into a single cluster buffer. (There may also be an alignment constraint here, but mbuf cluster buffers are naturally aligned on 2K boundaries, which seems to be good enough.)
The DM9102 driver for Linux written by Davicom also uses this workaround. Unfortunately, the Davicom datasheet has no errata section describing this or any other apparently known defect.
Problem noted by: allan_chou@davicom.com.tw
|
55340 |
03-Jan-2000 |
wpaul |
It appears that under certain circumstances that I still can't quite pin down, the dc driver and receiver can fall out of sync with one another, resulting in a condition where the chip continues to receive packets but the driver never notices. Normally, the receive handler checks each descriptor starting from the current producer index to see if the chip has relinquished ownership, indicating that a packet has been received. The driver hands the packet off to ether_input() and then prepares the descriptor to receive another frame before moving on to the next descriptor in the ring. But sometimes, the chip appears to skip a descriptor. This leaves the driver testing the status word in a descriptor that never gets updated. The driver still gets "RX done" interrupts but never advances further into the RX ring, until the ring fills up and the chip interrupts again to signal an error condition. Sometimes, the driver will remain in this desynchronized state, resulting in spotty performance until the interface is reset.
Fortunately, it's fairly simple to detect this condition: if we call the rxeof routine but the number of received packets doesn't increase, we suspect that there could be a problem. In this case, we call a new routine called dc_rx_resync(), which scans ahead in the RX ring to see if there's a frame waiting for us somewhere beyond that the driver thinks is the current producer index. If it finds one, it bumps up the index and calls the rxeof handler again to snarf up the packet and bring the driver back in sync with the chip. (It may actually do this several times in the event that there's more than one "hole" in the ring.)
So far the only card supported by if_dc which has exhibited this problem is a LinkSys LNE100TX v2.0 (82c115 PNIC II), and it only seems to happen on one particular system, however the fix is general enough and has low enough overhead that we may as well apply it for all supported chipsets. I also implemented the same fix for the 3Com xl driver, which is apparently vulnerable to the same problem.
Problem originally noted and patch tested by: Matt Dillon
|
54577 |
13-Dec-1999 |
wpaul |
Fix some problems reported by Mike Pritchard:
- Add a flag DC_TX_INTR_ALWAYS which causes the transmit code to request a TX done interrupt for every packet. The PNIC seems to need this to insure that the sent TX buffers get reaped in a timely fashion.
- Try to unreset the SIA as soon as possible after resetting the whole chip.
- Change dcphy to support either 10/100 or 10Mbps only NICs. The built-in 21143 ethernet in Compaq Presario machines is 10Mbps only and it doesn't work right if we try to advertise 100Mbps modes during autoneg. When restricted to only 10mbps modes, it works fine.
Note that for now, I detect this condition by checking the PCI subsystem ID on this NIC (which has a Compaq vendor/device ID). Yes, I know that's what the SROM is supposed to be for. I'm deliberately ignoring the SROM wherever possible. Sue me.
The latter two fixes allow if_dc to work correctly with the built-in ethernet on certain Compaq Presario boxes. There are liable to be quite a few people using these as their home systems who might want to try FreeBSD; may as well be nice to them.
Now if anybody out there has an Alpha miata with 10Mbps ethernet and can show me the output from pciconf -l on their system, I'd be grateful.
|
54266 |
07-Dec-1999 |
wpaul |
Tweak the DC_REDUCED_MII_POLL code in dc_mii_tick() for the DC_IS_INTEL() case. The idea is to reduce how often we call mii_tick(), however currently it may not be called often enough, which prevents autonegotiation from being driven correctly.
This should improve the chances of successfully autonegotiating media settings on non-MII 21143 NICs. (Still waiting for confirmation from some testers, but the code is clearly wrong in any case.)
|
54134 |
04-Dec-1999 |
wpaul |
Add the if_dc driver and remove all of the al, ax, dm, pn and mx drivers which it replaces. The new driver supports all of the chips supported by the ones it replaces, as well as many DEC/Intel 21143 10/100 cards.
This also completes my quest to convert things to miibus and add Alpha support.
|