summaryrefslogtreecommitdiffstats
path: root/sys/dev/ed
Commit message (Collapse)AuthorAgeFilesLines
* Unlock the main lock before returning rather than after to eliminateimp2015-03-011-1/+1
| | | | | | dead code that shouldn't have been dead. Reported by: Maxime Villard
* Fix typoimp2015-02-041-1/+1
| | | | Submitted by: matteo@
* Add comment about why checking for 0xff is OK. There's two bits in theimp2015-02-041-2/+4
| | | | | | | ISR that are normally clear. RST is one, though in some overflow cases it can be set. RDC is only set when a remote DMA is finished from the memory mapped memory to the transmit rings, which we poll fore in the code with ED_LOCK around the operation that would set it.
* In order to reduce use of M_EXT outside of the mbuf allocator andrwatson2015-01-061-4/+1
| | | | | | | | | | | | | | | | | | | | | socket-buffer implementations, introduce a return value for MCLGET() (and m_cljget() that underlies it) to allow the caller to avoid testing M_EXT itself. Update all callers to use the return value. With this change, very few network device drivers remain aware of M_EXT; the primary exceptions lie in mbuf-chain pretty printers for debugging, and in a few cases, custom mbuf and cluster allocation implementations. NB: This is a difficult-to-test change as it touches many drivers for which I don't have physical devices. Instead we've gone for intensive review, but further post-commit review would definitely be appreciated to spot errors where changes could not easily be made mechanically, but were largely mechanical in nature. Differential Revision: https://reviews.freebsd.org/D1440 Reviewed by: adrian, bz, gnn Sponsored by: EMC / Isilon Storage Division
* Mechanically convert to if_inc_counter().glebius2014-09-191-8/+8
|
* Add bus space barriers for page switches missed in r260050.marius2014-02-052-0/+54
|
* - Switch to using the common MII bitbang'ing code instead of duplicating it.marius2013-12-297-182/+218
| | | | | | | | | | | | | | | - Based on lessons learnt with dc(4) (see r185750), add bus space barriers to the MII bitbang read and write functions as well as to instances of page switching. - Add missing locking to ed_ifmedia_{upd,sts}(). - Canonicalize some messages. - Based on actual functionality, ED_TC5299J_MII_DIROUT should be rather named ED_TC5299J_MII_DIRIN. - Remove unused headers. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. MFC after: 1 week
* The r48589 promised to remove implicit inclusion of if_var.h soon. Prepareglebius2013-10-265-0/+5
| | | | | | | | 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.
* Mechanically substitute flags from historic mbuf allocator withglebius2012-12-041-2/+2
| | | | malloc(9) flags in sys/dev.
* Fix off by one error in mbuf access. Previously it caused panic.yongari2011-12-051-6/+13
| | | | | | | While I'm here use NULL to compare mbuf pointer and add additional check for zero length mbuf before accessing the mbuf. PR: kern/162932
* - Remove attempts to implement setting of BMCR_LOOP/MIIF_NOLOOPmarius2011-05-031-12/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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@
* sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.mdf2011-01-121-5/+5
| | | | Commit the rest of the devices.
* Converted the remainder of the NIC drivers to use the mii_attach()marius2010-10-151-15/+11
| | | | | | | introduced in r213878 instead of mii_phy_probe(). Unlike r213893 these are only straight forward conversions though. Reviewed by: yongari
* On second thought, we need to force 16-bit modeimp2010-08-251-0/+3
|
* Prodded by Yongari, add support for Holtek HT80232. Add the deviceimp2010-08-252-34/+46
| | | | | | | | | ID, plus the ability to force '16-bit mode' which really means NE-2000 mode. Other open source drivers suggest that the Holtek misbehaves if you allow the 8-bit probe. Also, all of the PCI chips emulate NE-2000ish cards, so always force 16-bit mode for memory transfers. PR: 84202 (patch not used)
* Add PNP id for Compex RL2000.yongari2010-08-241-0/+1
| | | | | | | | | | | I'm not sure whether adding this logical id is correct or not because Compex RL2000 is in the list of supported hardware list. I guess the Compex RL2000 could be PCI variant while the controller in question is ISA controller. It seems PNP compat id didn't match or it had multiple compat ids so isa_pnp_probe() seemed to return ENOENT. PR: kern/80853
* Fix a possible unaligned access to savebyte array.yongari2010-08-231-6/+9
| | | | PR: kern/122195
* Add new tunable 'net.link.ifqmaxlen' to set default send interfacesobomax2010-05-031-2/+2
| | | | | | | | | | queue length. The default value for this parameter is 50, which is quite low for many of today's uses and the only way to modify this parameter right now is to edit if_var.h file. Also add read-only sysctl with the same name, so that it's possible to retrieve the current value. MFC after: 1 month
* Use a private callout timer to drive the transmit watchdog instead of usingjhb2009-11-173-20/+33
| | | | | | | | | | | | if_watchdog and if_timer. The driver already contained an optional stats timer that individual attachments could use to provide a 'tick' event. The stats timer only ran if the tick function pointer was non-NULL and the attachment's tick routine had to call callout_reset(), etc. Now the driver always schedules a stat timer and manages the callout_reset() internally. This timer is used to drive the watchdog and will also call the attachment's 'tick' handler if one is provided. Tested by: WATANABE Kazuhiro
* 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
* ifp->if_softc is managed entirely by the driver. We never set it toimp2009-05-131-8/+0
| | | | | | NULL or change it. We initialize it before we set if_ioctl. It can therefore never be NULL, and most other drivers don't bother with this sanity check.
* Add Surecom EP-427X.imp2009-04-241-1/+2
|
* A couple of older Melco cards that missed the transition to newcardimp2009-04-221-1/+2
|
* Add Billionton LNT10TBimp2009-04-221-0/+1
|
* Add a few more models of AMBICOM cards from data from linux driver andimp2009-04-221-0/+4
| | | | pccard.conf.
* These were a placeholder and don't belong here. Remove them.imp2009-04-221-143/+1
|
* Kill stray bootverbose debug tool.imp2009-04-221-2/+0
| | | | Submitted by: juli@
* Turns out the code improvements I did for the TC5299J support wereimp2009-04-221-13/+154
| | | | | anti-improvements and broke support for this part. Revert the part of the improvement at fault.
* Sometimes we can call ed_detach() before the mtx has been initialized.imp2009-04-201-2/+4
| | | | Avoid it if it hasn't been initialized.
* Cleanup resource allocation code a bit. Store the rids on theimp2009-04-205-47/+48
| | | | | resources rather than on the softc. When we allocate resources for PC Card, if we only get 16 ports, try again to get the others.
* Make sure that the data in the ROM with a valid signature isn't allimp2009-04-181-1/+5
| | | | 0's. At least one PC Card ASIC does this...
* Add GVP NIC 2000P and New Media Livewire. Also New Media LanSurferimp2009-04-181-1/+3
| | | | doesn't have a function type of network, so add a quirk for that...
* Establish the interrupt handler AFTER we successfully attach. We needimp2009-04-184-22/+29
| | | | | to do this in case we have a shared interrupt that fires during the attach process....
* Remove debug write accidentally left in.imp2009-04-181-1/+0
|
* Don't specify a hint, since it isn't needed.imp2009-04-101-2/+2
|
* Fix commentimp2009-04-101-4/+3
| | | | Submitted by: danfe@
* Improvements for TC5299J MII support.imp2009-04-101-25/+15
|
* The D-Link DE-650 isn't tagged as a network card, so allow it toimp2009-04-101-1/+2
| | | | | | attach anyway. Add a comment about a 'common' mfg/prod pair that's used in a very large array of different cards.
* Fix some comments.imp2009-04-101-9/+12
|
* No need to check for chip type here.imp2009-04-101-1/+1
|
* More chip types, and fix a comment.imp2009-04-071-11/+14
|
* Fix a comment to match the code.imp2009-04-071-2/+1
|
* Remove DL10019 workaround, since the code it calls isn't quite ready.imp2009-04-071-1/+2
|
* Move tick to end of file for better code references.imp2009-04-071-24/+31
|
* The DL100xx cards have 24k of packet memory, not 16k. Use it for themimp2009-04-071-5/+20
| | | | | | | | | | and update comments about original patches doing this and it not working. It works for both the DL10019 and DL10022 based cards that I have. It really helps the DL10019 cards, since they were using 8k instead of the normal 16k that regular NE-2000 cards help. # Note to self: need to provide a common routine to setup memory # parameters.
* Apply generic media stuff to pccard case too, when we aren't using miibusimp2009-04-071-0/+3
| | | | for this.
* Minor fixes to comments about media autoselect.imp2009-04-071-5/+7
|
* Provide a generic ifmedia set of routines as a fallback. Theimp2009-04-075-8/+46
| | | | | | | | | DP8390-based cards have no generic way of reporting status of the link or setting the media type. Some specific versions of these cards do, however, allow for this, and we already support some of them. Make the 'ed' experience more uniform by providing "autoselect" as the meida and status "active" always. This won't affect the chips that provide more specific details.
* Remove more debug...imp2009-04-031-2/+0
|
* Retire two flags that haven't been used since OLDCARD was retiredimp2009-04-021-2/+0
| | | | | (well, since before OLDCARD was retired, since I removed their use somewhat before that).
OpenPOWER on IntegriCloud