summaryrefslogtreecommitdiffstats
path: root/sys/dev/ed/if_ed.c
Commit message (Collapse)AuthorAgeFilesLines
* When the miibus for the AX88x90 or TC5299J cards fails to attach, weimp2008-08-061-7/+9
| | | | | | | | | | | | | would call ed_release_resources() when we should have called ed_detach() to properly undo the effects of prior calls to ed_attach(). This would leave a stray ed interface ifnet alive in the system, which was, well, bad, since we called if_free() on the underlying memory... Fix the ed_detach routine to cope being called in this context now. This should never come up because the miibus is always there. Except for now when it seems to be failing for reasons unknown... That's a different bug that hits at least ed, xl, dc and fxp...
* Don't call bus_deactivate_resource() explicitly before callingnyan2007-03-211-6/+0
| | | | | bus_release_resource(). This is needed for pc98 by upcoming nexus related change.
* MFp4:imp2006-06-121-1/+20
| | | | | | | | | | | | o Implement a bunch of sysctl's to report the information that's now always reported. Mvoe reporting of that info to bootverbose, but maybe it can go away entirely. dev.ed.X.type: string name dev.ed.X.TxMem: amount of memory used for tx side of the card dev.ed.X.RxMem: amount of memory used for rx side of the card dev.ed.X.Mem: Total amount of mem on card. o Better comments about where NE-2000 (and clones) gets their MAC address from.
* Have a function pointer to the routine to call for writing an mbufimp2006-01-271-81/+81
| | | | | | | | | | into the card's memory. # this eliminates a more of the ifdef soup in if_ed and if_edvar # I've fixed the cbus drivers, but can't test them all easily. If I've broken anything, please let me know.
* Create mediachg functions for the 3c503 and hpp cards. This is usedimp2006-01-271-30/+4
| | | | | | | | | | | | to properly configure the right interface to use. Also call the mediachg function when we set flags UP and are already running. If this were a pure ifmedia driver, we'd not need to do this since we'd be ignoring the linkX flags. This reduces the number of ifdefs to support sub-devices a little as a nice side effect. It also reduces the number of hpp interfaces exposed by 33%.
* Transition from ALTPHYS to LINK2. We already document in the ed(4)imp2006-01-271-9/+13
| | | | | | | | | | | | | | | | | man page that the ifconfig option link2 is used to disable the AUI transceiver on the 3com boards (should also say HP PC Lan+). This makes the connection clearer. Add a note about why we set this flag prior to attaching the device. We never set or clear the flag later, only test it. There can be no races here, but this might be asthetically displeasing to some. Also note that we may no longer need to have this knob at all as we may be able to do it with the more sophisticated rc.d scripts we have today I think the only reason it is there is because we didn't used to allow its proper setting when configured to get the IP address via DHCP. I'll note that this would be better handled by using ifmedia for all ed cards, not just those with a miibus...
* - 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.
* Go ahead and detach our children in our detach routine. I'm undecidedimp2005-09-261-0/+1
| | | | | if we should delete them also or not, but have decided not to do so for the moment.
* Remove duplicate if_free().imp2005-09-191-1/+0
| | | | Submitted by: ru@
* Make sure that we call if_free(ifp) after bus_teardown_intr. Since weimp2005-09-191-1/+1
| | | | | | | could get an interrupt after we free the ifp, and the interrupt handler depended on the ifp being still alive, this could, in theory, cause a crash. Eliminate this possibility by moving the if_free to after the bus_teardown_intr() call.
* MFp4:imp2005-09-181-92/+11
| | | | | | | | | | | | | | | | | | o eliminate the ED_NO_MIIBUS option. Now, you need miibus to use ed with pccard. If you have an old ISA or PCI card w/o a miibus, then you'll still be able to use the ed driver w/o miibus in the kernel. If you have pccard you'll need mii now. Most pccards these days have miibus, and many cards have ISSUES if you don't attach miibus. issues I don't want to constantly rediagnose. - Add new media_ioctl, mediachg and tick function pointers. The core driver will call these if they aren't NULL, or return an error if they are. - migrate remaining mii code into if_ed_pccard. o include some notes from my datasheet fishing. this may allow us to get media status from some pccards. o Fix one bug that's common to many drivers. call if_free(ifp) after we tear down the interrupt. ed_intr() depends on ifp being there and freeing it while interrupts can still happen is, ummm, bad.
* Fix "struct ifnet" leaks when attach() fails in the middle.ru2005-09-161-1/+2
|
* MFp4: Omnibus ed changesimp2005-09-131-37/+0
| | | | | | | | | | | | | | | | | | | o Attach AX88x90's MII bus to system, and require its presence. o Reorg the mii code a little, and move more of it into pccard attachment. o Eliminate ed_pccard_{read,write}_attrmem in favor of a more appropriate function in the pccard layer. o Update comments to reflect knowledge gained. o Update how re recognize a NE-2000 ROM. I found a couple of different datasheets that define the structure of the PROM data, so the code's old heuristics have been removed, and comments updated to reflect the structure. o Eliminate work around for EC2T. It is no longer needed, and was wrong headed since the EC2T has a Winbound 82C926C in it, not a AX88x90. o Add copyright to if_ed_pccard.c, since I believe I've re-written more than 3/4 of it. # With these changes, all of my 20-odd ed based cards work, except for the # NetGear FA-410, and I'm pretty sure that's a MII/PHY problem.
* The ed driver lock is already held in the mii frobbing routines. Removeimp2005-09-081-11/+0
| | | | locking from these routines.
* MFp4: kill bogus commentimp2005-09-021-5/+0
|
* Finish conversion to bus space and make ed MP safe.imp2005-08-281-142/+182
| | | | | | | | | | | | | | | | | o Lock ed o Fix extra newline in probe messages o Eliminate gone. o Make detach less-racy. o Eliminate spl* o Switch from timeout/untimeout to callout interface. o Read/write card memory using bus_space calls. o generalize readmem so that we don't need ifs in the code. o Fix memory stuff to be consistant. o Remove OLDCARD compat stuff. o Mark interrupt as MPSAFE. # sic, hpp not tested at all # ISA and PCI attachments lightly tested
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-12/+12
| | | | | | | | | | | | | | 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
* Fix four casts of the softc to a struct ifnet.brooks2005-06-151-4/+4
| | | | | | | | Hopefully this fixes ed(4) under qemu. I'm shocked that real hardware is apparently working with these bugs. Approved by: re (ifnet blanket) Pointy hat: brooks
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-101-8/+16
| | | | | | | | | | | | | | | | | | | | 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
* Add a stratigic newlineimp2005-02-221-0/+1
|
* MFp4: Optimize in/out macros. Cache the handle and tag in softc andimp2005-02-221-0/+4
| | | | | use them in the macros. Since the rman_get_bus{tag,handle} transitioned from macros to function calls, this unpessimizes that conversion.
* Minor style(9)isms.imp2005-02-211-40/+32
|
* Minor optimizations to compile out bits that aren't necessary whenimp2005-02-201-5/+18
| | | | | | certain options aren't enabled. Submitted by: Chiharu Shibata-san (chi at bd mbn or jp)
* Add some comments in preparation for converting bcopy/bzero to busspace.imp2005-02-141-9/+14
| | | | Minor style nits.
* Diff reduction with p4.imp2005-02-111-6/+3
|
* Move enable/disable 16bit access routines into if_ed. Slightlyimp2005-02-101-21/+27
| | | | | | | pessmize the error recover path through edintr by calling these functions, rather than expanding it inline. This error path already does a lot in it, so an extra function call will be lost in the noise. It also happens rarely.
* useimp2005-02-101-3/+8
| | | | | | | | | | while (complicated-expr) continune; in preference to while (complicated-expr); since the code generated is identical, and the former is easier to read, especially for complicated-expr that reach to the end of the line...
* Break out obscure ISA cards into their own files, as well as ne2000imp2005-02-091-1720/+25
| | | | | | | | | | | | | | | | | | | | | | and wd80x3 support. Make the obscure ISA cards optional, and add those options to NOTES on i386 (note: the ifdef around the whole code is for module building). Tweak pc98 ed support to include wd80x3 too. Add goo for alpha too. The affected cards are the 3Com 3C503, HP LAN+ and SIC (whatever that is). I couldn't find any of these for sale on ebay, so they are untested. If you have one of these cards, and send it to me, I'll ensure that you have no future problems with it... Minor cleanups as well by using functions rather than cut and paste code for some probing operations (where the function call overhead is lost in the noise). Remove use of kvtop, since they aren't required anymore. This driver needs to get its memory mapped act together, however, and use bus space. It doesn't right now. This reduces the size of if_ed.ko from about 51k to 33k on my laptop.
* Convenience function to clear memory of the card, and then check to makeimp2005-02-081-0/+22
| | | | sure that it works by reading back as 0.
* Use ANSI function definitions, tweak a couple of prototypes to match (sinceimp2005-02-081-116/+48
| | | | | K&R prototypes needed to mismatch in the way that they were mismatched), rename ds_getmcaf to ed_ds_getmcaf. Remove a few register keywords.
* use fixed types for the calls to ed_pio_readmem, ed_pio_writemem.imp2005-02-081-31/+14
| | | | | | | Make the special hp versions match the general ones. Also use fixed types in the WD80x3_generic probe, and change callers' arrays to match. Fix a couple of minor style issues by using newstyle function definitions in a couple places.
* Make it possible to unload ed. Move the ed_pccard_detach routine toimp2005-02-081-0/+20
| | | | | | | | | | | | if_ed and rename it to ed_detach(). Tell other busses to use this routine for detach. Since I don't actually have any non-pccard ed hardware I can test with, I've only tested with my pccards. More improvements in this area likely are possible. Prodded by: rwatson
* Repair probe messages a bit. Previously, we'd print the ethernetimp2005-01-261-14/+17
| | | | | | | | address, and additional information. Then the printing of the ethernet address was moved into ether_attach, and so we were printing orphaned information about the card. Now the probe message is prefixed by edX:. Prepare for it to move under bootverbose, but don't move it there yet (the || 1 trick).
* MFp4: u_intXX_t to uintXX_t.imp2005-01-191-12/+12
|
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* Commit ALTQ-patch for ed(4).mlaier2004-11-211-2/+4
| | | | | Requested and tested by: pav MFC after: 1 week
* Fix build error with ED_DEBUG.nyan2004-11-101-2/+2
| | | | PR: kern/72753
* Remove layer intermixing. Device driver should pass the frame shouldglebius2004-09-061-20/+2
| | | | | | | | pass frame to ether_input(), and do not play with bridge itself. Reviewed by: sam, andre Approved by: julian (mentor) MFC after: 1 week
* Since if_ed doesn't contain locking or run with INTR_MPSAFE, markrwatson2004-08-131-2/+2
| | | | the interface as IFF_NEEDSGIANT so if_start is run holding Giant.
* Replace handrolled CRC calculation with ether_crc32_[lb]e().naddy2004-06-091-28/+2
|
* We don't need to initialize if_output, ether_ifattach() does itmux2004-05-231-1/+0
| | | | for us.
* Fix building on L64 machines.obrien2004-04-161-7/+7
|
* Remove improper use of if_addrhead in device drivers to checkluigi2004-04-151-4/+0
| | | | | | | | | | | | if the link-level address has been initialized already. The majority of modern drivers never does this and works fine, which makes me think that the check is totally unnecessary and a residue of cut&paste from other drivers. This change is done to simplify locking because now almost none of the drivers uses this field. The exceptions are "ct" "ctau" and "cx" where i am not sure if i can remove that part.
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-2/+2
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* Announce ethernet MAC addresss in ether_ifattach().mdodd2004-03-141-5/+0
|
* Adjust ed(4) for 64-bit platforms should it get newbus'ified.obrien2004-03-031-10/+11
|
* Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones.obrien2003-12-081-5/+5
| | | | Requested by: bde,imp
* Remove duplicate FBSDID's, move others to their right place.obrien2003-11-141-2/+3
|
* Try to create some sort of consistency in how the routings to find theobrien2003-11-131-13/+11
| | | | | | | 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).
OpenPOWER on IntegriCloud