summaryrefslogtreecommitdiffstats
path: root/sys/dev/gem
Commit message (Collapse)AuthorAgeFilesLines
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-041-3/+3
| | | | malloc(9) flags in sys/dev.
* Remove duplicate const specifiers in many drivers (I hope I got all ofdim2012-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | 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
* - There's no need to overwrite the default device method with the defaultmarius2011-11-222-10/+2
| | | | | | | | | | one. Interestingly, these are actually the default for quite some time (bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9) since r52045) but even recently added device drivers do this unnecessarily. Discussed with: jhb, marcel - While at it, use DEVMETHOD_END. Discussed with: jhb - Also while at it, use __FBSDID.
* Revert r224157, re-enabling r222135. The underlying problem keeping themarius2011-08-191-2/+0
| | | | | | | latter from working as expected was fixed in r225014. MFC after: 3 days Approved by: re (kib)
* Revert r222135 by allowing controller reinitialization. Due toyongari2011-07-171-0/+2
| | | | | | | | | unknown reason Apple UniNorth2 gem(4) device required manual interface down/up operation after r222135. Even though this is not correct thing and I don't like to revert it but it would be better than breaking gem(4) on PPC. This should be revisited. PR: kern/157405
* Correct r223648; as gem_init_locked() was calling gem_setladrf(), whichmarius2011-07-121-21/+20
| | | | | | | | | | | sets GEM_MAC_RX_CONFIG based on sc_mac_rxcfg which in turn is initialized to zero, before reading the supposedly default configuration we were effectively not basing sc_mac_rxcfg and thus GEM_MAC_RX_CONFIG on the default configuration. Solve this by calling gem_setladrf() after reading in the default configuration of GEM_MAC_RX_CONFIG. This also avoids the need to distinguish whether gem_setladrf() should enable the RX MAC again and should be slightly more correct as we're now doing all of the RX MAC configuration in the intended step.
* According to the OpenSolaris source the PCI latency and the cache line sizemarius2011-07-123-16/+29
| | | | | should be set for Sun ERI. Tested by: yongari
* Fix typo in r223648 which was accidentally committedmarius2011-06-281-1/+1
|
* - In gem_reset_rx() also reset the RX MAC which is necessary in order tomarius2011-06-282-48/+55
| | | | | | | | | | | | | | | | | get it out of a stuck condition that can be caused by GEM_MAC_RX_OVERFLOW. - In gem_reset_rxdma() call gem_setladrf() in order to reprogram the RX filter and restore the previous content of GEM_MAC_RX_CONFIG. While at it consistently use the newly introduced sc_mac_rxcfg throughout the driver instead of reading the its old content. - Increment if_iqdrops instead of if_ierrors in case of RX buffer allocation failure. - According to the GEM datasheet the RX MAC should also be disabled in gem_setladrf() before changing its configuration. - Add error messages to gem_disable_{r,t}x() and take advantage of these throughout the driver instead of duplicating their functionality all over the place. In joint forces with: yongari
* Remove unnecessary controller reinitialization by checkingyongari2011-05-201-1/+8
| | | | | | | | IFF_DRV_RUNNING flag. Previously running dhclient or adding alias addresses reinitialized controller and it resulted in unnecessary link flips. Reviewed by: marius
* Correct spelling in comments.marius2011-04-221-1/+1
| | | | Submitted by: brucec
* - Fix and enable support for flow control.marius2010-11-221-6/+10
| | | | | | | - Partially revert r172334; as it turns out the DELAYs in gem_reset_{r,t}x() are actually necessary although bus space barriers and gem_bitwait() are used, otherwise the controller may trigger an IOMMU errors on at least sparc64. This is in line with what Linux and OpenSolaris do.
* Convert the PHY drivers to honor the mii_flags passed down and convertmarius2010-10-152-24/+17
| | | | | | | | | | | | | | | | | | | | | | | 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
* Merge r207585 from cas(4):marius2010-09-163-5/+47
| | | | | | | | - Don't probe for PHYs if we already know to use a SERDES. Unlike as with cas(4) this only serves to speed up the the device attach though and can only be determined via the OFW device tree but not from the VPD. - Don't touch the MIF when using a SERDES. - Add some missing bus space barriers, mainly in the PCS code path.
* KTR_CTx are long time aliased by existing classes so they can't serveattilio2010-07-211-1/+1
| | | | | | | | their purpose anymore. Axe them out. Sponsored by: Sandvine Incorporated Discussed with: jhb, emaste Possible MFC: TBD
* According to the Linux sungem driver, in case of Apple (K2) GMACsmarius2010-02-221-1/+4
| | | | | | | | | | GEM_MIF_CONFIG_MDI0 cannot be trusted when the firmware has powered down the chip so the internal transceiver has to be hardcoded. This is also in line with the AppleGMACEthernet driver, which just doesn't distinguish between internal/external transceiver and MDIO/MDI1 respectively in the first place. Tested by: Andreas Tobler MFC after: 1 week
* Work around a quirk with the G5 Xserve, which has a fake GMAC controllernwhitehorn2009-10-181-0/+10
| | | | | | with an all-zero MAC address. In this case, don't attach. Discussed with: marius
* Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/rwatson2009-06-261-2/+2
| | | | | | | | | | | | | IF_ADDR_UNLOCK() across network device drivers when accessing the per-interface multicast address list, if_multiaddrs. This will allow us to change the locking strategy without affecting our driver programming interface or binary interface. For two wireless drivers, remove unnecessary locking, since they don't actually access the multicast address list. Approved by: re (kib) MFC after: 6 weeks
* Revert the part of r194763 which added a dying flag and insteadmarius2009-06-242-12/+5
| | | | | | | | call ether_ifdetach(9) before stopping the controller and the callouts. The consensus is that the latter is now safe to do and should also solve the problem of active BPF listeners clearing promiscuous mode can result in the tick callout being restarted which in turn will trigger a panic once it's actually gone.
* - Initialize the ifnet structure, especially if_dname, before probingmarius2009-06-235-316/+569
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the PHYs as some PHY drivers use it (but probably shouldn't). How gem(4) has worked with brgphy(4) on powerpc without this so far is unclear to me. - Introduce a dying flag which is set during detach and checked in gem_ioctl() in order to prevent active BPF listeners to clear promiscuous mode which may lead to the tick callout being restarted which will trigger a panic once it's actually gone. - In gem_stop() reset rather than just disable the transmitter and receiver in order to ensure we're not unloading DMA maps still in use by the hardware. [1] - The blanking time is specified in PCI clocks so we should use twice the value when operating at 66MHz. - Spell some 2 as ETHER_ALIGN and a 19 as GEM_STATUS_TX_COMPLETION_SHFT to make the actual intentions clear. - As we don't unload the peak attempts counter ignore its overflow interrupts. - Remove a stale setting of a variable to GEM_TD_INTERRUPT_ME which isn't used afterwards. - For optimum performance increment the TX kick register in multiples of 4 if possible as suggested by the documentation. - Partially revert r164931; drivers should only clear the watchdog timer if all outstanding TX descriptors are done. - Fix some debugging strings. - Add a missing BUS_DMASYNC_POSTWRITE in gem_rint(). - As the error paths in the interrupt handler are generally unlikely predict them as false. - Add support for the SBus version of the GEM controller. [2] - Add some lock assertions. - Improve some comments. - Fix some more or less cosmetic issues in the code of the PCI front-end. - Change some softc members to be unsigned where more appropriate and remove unused ones. Approved by: re (kib) Obtained from: NetBSD (partially) [2], OpenBSD [1] MFC after: 2 weeks
* - Restore the behavior of enabling the MII buffer for an internalmarius2008-08-231-10/+22
| | | | | | | | | | | | PHY only and not also in the case of an external PHY currently doing full duplex, which accidentally got broken in r172334. It's still not clear to me why we need to enable the buffer for an internal PHY though. - Count excess and late collisions as output errors. [1] - Count receive errors as input errors. [1] Obtained from: NetBSD [1] MFC after: 3 days
* o The FreeBSD bus_dmamap_sync(9) supports ored together flags for quitemarius2008-06-221-90/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | some time now so collapse calls accordingly. o Given that gem_load_txmbuf() is allowed to fail resulting in a packet drop also for quite some time now implement the functionality of gem_txcksum() by means of m_pullup(9), which de-obfuscates the code and allows to always retrieve the correct length of the IP header. o Add missing BUS_DMASYNC_PREREAD when syncing the control DMA maps in gem_rint() and gem_start_locked(). o Correct some bus_barrier(9) calls to do a read/write barrier as we do a read after a write. Add some missing ones in gem_mii_readreg() and gem_mii_writereg(). o According to the Apple GMAC driver, the GEM ASIC specification and the OpenSolaris eri(7D) the TX FIFO threshold has to be set to 0x4ff for the Gigabit variants and 0x100 for the ERI in order do avoid TX underruns. o In gem_init_locked(): - be conservative and enable the RX and TX MACs, - don't clear GEM_LINK otherwise we don't ever mark the link as up again if gem_init_locked() is called from gem_watchdog(), - remove superfluous setting of sc_ifflags. o Don't bother to check whether the interface is running or whether its queue is empty before calling gem_start_locked() in gem_tint(), the former will check these anyway. o Call gem_start_locked() in gem_watchdog() in order to try to get some more packets going. o In gem_mii_writereg() after reseting the PCS restore its configuration. GMAC testing: grehan, marcel MFC after: 2 weeks
* Split the registers into two halves in preparation for SBus support.marius2008-03-244-212/+285
| | | | | Obtained from: NetBSD (loosely) MFC after: 2 weeks
* - Fix some style bugs and remove another banal comment missed inmarius2008-03-091-10/+11
| | | | | | rev. 1.46. - Move the KASSERT on gem_add_rxbuf() to the right spot and add an equivalent one to gem_disable_tx().
* - Retire npe_defrag(), gem_defrag(), msk_defrag(), nfe_defrag(), andjhb2008-01-171-88/+1
| | | | | | re_defrag() and use m_collapse() instead. - Replace a reference to ath_defrag() in a comment in if_wpi.c with m_collapse().
* o In preparation for basing a new driver on this one:marius2007-12-304-514/+423
| | | | | | | - ANSIfy - try to bring closer to style(9) - remove banal comments. o Add my copyright for having done lots of fixes and improvements.
* Fix a NULL pointer dereference in Tx checksum calculation.yongari2007-10-131-0/+5
| | | | Pointed out by: marius
* o Revert the part of if_gem.c rev. 1.35 which added a call to gem_stop()marius2007-09-264-417/+774
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to gem_attach() as the former access softc members not yet initialized at that time and gem_reset() actually is enough to stop the chip. [1] o Revise the use of gem_bitwait(); add bus_barrier() calls before calling gem_bitwait() to ensure the respective bit has been written before we starting polling on it and poll for the right bits to change, f.e. even though we only reset RX we have to actually wait for both GEM_RESET_RX and GEM_RESET_TX to clear. Add some additional gem_bitwait() calls in places we've been missing them according to the GEM documentation. Along with this some excessive DELAYs, which probably only were added because of bugs in gem_bitwait() and its use in the first place, as well as as have of an gem_bitwait() reimplementation in gem_reset_tx() were removed. o Add gem_reset_rxdma() and use it to deal with GEM_MAC_RX_OVERFLOW errors more gracefully as unlike gem_init_locked() it resets the RX DMA engine only, causing no link loss and the FIFOs not to be cleared. Also use it deal with GEM_INTR_RX_TAG_ERR errors, with previously were unhandled. This was based on information obtained from the Linux GEM and OpenSolaris ERI drivers. o Turn on workarounds for silicon bugs in the Apple GMAC variants. This was based on information obtained from the Darwin GMAC and Linux GEM drivers. o Turn on "infinite" (i.e. maximum 31 * 64 bytes in length) DMA bursts. This greatly improves especially RX performance. o Optimize the RX path, this consists of: - kicking the receiver as soon as we've a spare descriptor in gem_rint() again instead of just once after all the ready ones have been handled; - kicking the receiver the right way, i.e. as outlined in the GEM documentation in batches of 4 and by pointing it to the descriptor after the last valid one; - calling gem_rint() before gem_tint() in gem_intr() as gem_tint() may take quite a while; - doubling the size of the RX ring to 256 descriptors. Overall the RX performance of a GEM in a 1GHz Sun Fire V210 was improved from ~100Mbit/s to ~850Mbit/s. o In gem_add_rxbuf() don't assign the newly allocated mbuf to rxs_mbuf before calling bus_dmamap_load_mbuf_sg(), if bus_dmamap_load_mbuf_sg() fails we'll free the newly allocated mbuf, unable to recycle the previous one but a NULL pointer dereference instead. o In gem_init_locked() honor the return value of gem_meminit(). o Simplify gem_ringsize() and dont' return garbage in the default case. Based on OpenBSD. o Don't turn on MAC control, MIF and PCS interrupts unless GEM_DEBUG is defined as we don't need/use these interrupts for operation. o In gem_start_locked() sync the DMA maps of the descriptor rings before every kick of the transmitter and not just once after enqueuing all packets as the NIC might instantly start transmitting after we kicked it the first time. o Keep state of the link state and use it to enable or disable the MAC in gem_mii_statchg() accordingly as well as to return early from gem_start_locked() in case the link is down. [3] o Initialize the maximum frame size to a sane value. o In gem_mii_statchg() enable carrier extension if appropriate. o Increment if_ierrors in case of an GEM_MAC_RX_OVERFLOW error and in gem_eint(). [3] o Handle IFF_ALLMULTI correctly; don't set it if we've turned promiscuous group mode on and don't clear the flag if we've disabled promiscuous group mode (these were mostly NOPs though). [2] o Let gem_eint() also report GEM_INTR_PERR errors. o Move setting sc_variant from gem_pci_probe() to gem_pci_attach() as device probe methods are not supposed to touch the softc. o Collapse sc_inited and sc_pci into bits for sc_flags. o Add CTASSERTs ensuring that GEM_NRXDESC and GEM_NTXDESC are set to legal values. o Correctly set up for 802.3x flow control, though #ifdef out the code that actually enables it as this needs more testing and mainly a proper framework to support it. o Correct and add some conversions from hard-coded functions names to __func__ which were borked or forgotten in if_gem.c rev. 1.42. o Use PCIR_BAR instead of a homegrown macro. o Replace sc_enaddr[6] with sc_enaddr[ETHER_ADDR_LEN]. o In gem_pci_attach() in case attaching fails release the resources in the opposite order they were allocated. o Make gem_reset() static to if_gem.c as it's not needed outside that module. o Remove the GEM_GIGABIT flag and the associated code; GEM_GIGABIT was never set and the associated code was in the wrong place. o Remove sc_mif_config; it was only used to cache the contents of the respective register within gem_attach(). o Remove the #ifdef'ed out NetBSD/OpenBSD code for establishing a suspend hook as it will never be used on FreeBSD. o Also probe Apple Intrepid 2 GMAC and Apple Shasta GMAC, add support for Apple K2 GMAC. Based on OpenBSD. o Add support for Sun GBE/P cards, or in other words actually add support for cards based on GEM to gem(4). This mainly consists of adding support for the TBI of these chips. Along with this the PHY selection code was rewritten to hardcode the PHY number for certain configurations as for example the PHY of the on-board ERI of Blade 1000 shows up twice causing no link as the second incarnation is isolated. These changes were ported from OpenBSD with some additional improvements and modulo some bugs. o Add code to if_gem_pci.c allowing to read the MAC-address from the VPD on systems without Open Firmware. This is an improved version of my variant of the respective code in if_hme_pci.c o Now that gem(4) is MI enable it for all archs. Pointed out by: yongari [1] Suggested by: rwatson [2], yongari [3] Tested on: i386 (GEM), powerpc (GMACs by marcel and yongari), sparc64 (ERI and GEM) Reviewed by: yongari Approved by: re (kensmith)
* - In gem_bitwait() check that the bit clears/was set in the contentmarius2007-06-161-2/+2
| | | | | | | | of the register rather than in the offset describing the register. - In gem_reset_rx() let gem_bitwait() check for the Rx reset bit rather than the Tx reset bit to clear. Obtained from: OpenBSD (same/similar bugs being fixed)
* o Implemented Rx/Tx checksum offload. The simple checksum logic inyongari2007-06-043-224/+420
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GEMs is unable to discriminate UDP from TCP packets such that it can generate 0x0000 checksum value for the UDP datagram. So the UDP checksum offload was disabled by default. You can enable it by setting link0 flag with ifconfig(8). o bus_dma(9) clean up. It now correctly set number of required DMA segments/size and removed incorrect use of BUS_DMA_ALLOCNOW flag in static allocations done via bus_dmamem_alloc(9). o Implemented ALTQ(9) support. o Implemented Tx side bus_dmamap_load_mbuf_sg(9) which can remove several book keeping chores orginated from call-back mechanism. Therefore gem_txdma_callback() was removed and its functionality was reimplemented in gem_load_txmbuf(). o Don't set GEM_TD_START_OF_PACKET flag until all remaining mbuf chains are set. I think it was a long standing bug and it caused fluctuating interrupts/CPU usage patterns while netperf test is in progress. Previously it seems that we race with the device. Because I don't have a documentation for GEM I'm not sure this is correct but almost all other documentations I have stated this implications on setting SOP mark in descriptor ring(e.g. hme(4)). o Borrowed gem_defrag() from ath(4) which is supposed to be much faster than m_defrag(9) since it's not need to defrag all mbuf chains. o gem_load_txmbuf() was changed to allow passed mbuf chains to free. Caller of gem_load_txmbuf() correctly handles freed mbuf chains. o In gem_start_locked(), added checks for availability of Tx descriptors before trying to load DMA maps which could save CPU cycles when number of available descriptors are low. Also, simplyfy IFF_DRV_OACTIVE detection logic. o Removed hard-coded function names in CTR macros and replaced it with __func__. o Moved statistics counter register access to gem_tick() to reduce number of PCI bus accesses. There is no reason to update statistics counters in interrupt handler. o Removed unnecessary call of gem_start_locked() in gem_ioctl(). Reviewed by: grehan (initial version), marius (with improvements and suggestions) Tested by: grehan (ppc), marius(sparc64)
* Since if_gem is being touted as one of our more architecturallyphk2007-05-043-195/+141
| | | | | | | | | | | | | | | correct network drivers with respect to busmaster DMA, go over it with at duster to make other aspects of it a role model: Eliminate the pci specific softc, it serves no rational purpose. Use convenience resource allocation/deallocation functions to save code and errorhandling. Switch from bus_space_{read|write}_%u() to bus_{read|write}_%u() functions and forget about tags and handles, the resource will know about those, should they be needed. This also eliminates a number of inconsistently named local variables.
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-231-1/+1
| | | | | | | | | | | | | 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@
* - Use the gem_tick() callout instead of if_slowtimo() for drivingmarius2006-12-062-22/+25
| | | | | | | | gem_watchdog() in order to avoid races accessing if_timer. While at it relax the watchdog a bit by reloading it in gem_tint() if there are still packets enqueued. - Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that. - Fix inconsistencies in prototypes.
* add a newbus method for obtaining the bus's bus_dma_tag_t... This isjmg2006-09-031-3/+4
| | | | | | | | | | | | | required by arches like sparc64 (not yet implemented) and sun4v where there are seperate IOMMU's for each PCI bus... For all other arches, it will end up returning NULL, which makes it a no-op... Convert a few drivers (the ones we've been working w/ on sun4v) to the new convection... Eventually all drivers will need to replace the parent tag of NULL, w/ bus_get_dma_tag(dev), though dev is usually different for each driver, and will require hand inspection... Reviewed by: scottl (earlier version)
* add missed calls to bpf_peers_presentsam2006-06-021-2/+1
|
* Fix -Wundef warnings found when compiling i386 LINT, GENERIC andru2005-12-051-1/+1
| | | | custom kernels.
* - Store pointer to the link-level address right in "struct ifnet"ru2005-11-111-1/+1
| | | | | | | | | | 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.
* - In gem_ioctl() move the call to ether_ioctl() to the default case ofmarius2005-09-181-47/+29
| | | | | | | | | | | | | | | | | | | | | | | | | the switch statement in order to make this driver more like other Ethernet NIC drivers. - In gem_attach() call gem_stop() in addition to gem_reset() to make sure the chip actually is stopped and not just reset. - In gem_stop() also stop the gem_rint_timeout() callout in case the driver is compiled with GEM_RINT_TIMEOUT defined. Merge some locking improvements from hme(4): - Use callout_init_mtx() to close races between gem_stop() and gem_tick() as weel as gem_stop() and gem_rint() in case the driver is compiled with GEM_RINT_TIMEOUT defined. - Use the driver lock instead of Giant in a bus dma callback. - Lock the driver lock around mii operations. - Cleanup locking in gem_ioctl(). - Remove redundant assertions that the driver lock is not held in gem_attach() and gem_detach() since mtx_lock() will assert that already since the driver lock is not recursive. - Add callout_drain()'s to gem_detach() after calling gem_stop() to make sure that if softclock is running on another CPU and is blocked on our driver lock, we will wait until it has acquired the lock, seen that it was cancelled, dropped the lock, and awakened us so that we can safely destroy the mutex.
* - Allow for VLAN-sized frames and set IFCAP_VLAN_MTU.marius2005-08-281-8/+23
| | | | | | | | | | | | | - On resume all registers have to be initialized again like after power-on so reset sc_inited in gem_suspend() in order get all of the registers set next time gem_init_regs() is called. - On at least some ERI and GEM revisions GEM_MAC_RX_OVERFLOW happen often due to a silicon bug and re-initializing is all we can do about these errors so make handling them non-verbose. - Remove a superfluous memset(3) call in gem_meminit(), all elements are initialized to 0 anyway. MFC after: 1 week
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-8/+9
| | | | | | | | | | | | | | 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
* Modify device drivers supporting multicast addresses to lock if_addr_mtxrwatson2005-08-031-0/+2
| | | | | | | | 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
* Remove NOP spl*() calls and add locking (making gem(4) MPSAFE).marius2005-07-243-35/+118
| | | | | | Based on: hme(4) Reviewed by: yongari Tested on: powerpc(grehan), sparc64
* - Wrap the handler and associated code for collecting completed RXmarius2005-07-241-31/+23
| | | | | | | | | | | | | | | | descriptors that are still marked owned in #ifdef GEM_RINT_TIMEOUT instead of #if 0 for convenience. - Remove stale code and comment about relying on the preset XIF config. - In case of a watchdog timeout call the init function instead of just the start function so the chip is properly reset. Merge from hme(4): - Convert to use bus_dmamap_load_mbuf_sg() for loading RX buffers. - Protect from a duplicate mbuf free panic in case the DMA engine hangs. Reviewed by: yongari Tested on: powerpc(grehan), sparc64 MFC after: 1 week
* Stop the interface before detaching and freeing it, rather than after.brooks2005-06-121-1/+1
| | | | Reported by: marius
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-103-15/+24
| | | | | | | | | | | | | | | | | | | | 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
* Use BUS_PROBE_DEFAULT for pci probe return valueimp2005-03-051-1/+1
|
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-063-3/+3
|
* Since if_gem doesn't contain locking or run with INTR_MPSAFE, markrwatson2004-08-131-1/+2
| | | | the interface as IFF_NEEDSGIANT so if_start is run holding Giant.
* - Remove a variable no longer used after the conversion to ether_crc32_le().marius2004-06-101-4/+2
| | | | | - While here, save on another one no longer really necessary after the conversion.
* Replace handrolled CRC calculation with ether_crc32_[lb]e().naddy2004-06-091-17/+1
|
OpenPOWER on IntegriCloud