summaryrefslogtreecommitdiffstats
path: root/sys/dev/ed/if_ed.c
Commit message (Collapse)AuthorAgeFilesLines
* 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).
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-14/+12
| | | | | | | | | | | | | 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)
* There is no way to enter the attach routine twice with the same softcbrooks2003-10-301-43/+41
| | | | | | | without a detach call in between so don't try to deal with that possiability. This is a diff-reduction commit for the upcoming if_xname conversion.
* Add Allied Telesis SIC-AT boards support.shiba2003-10-151-0/+114
| | | | | | | | | | | | | Discussed in from [FreeBSD-tech-jp 3396] to [FreeBSD-tech-jp 3407] at FreeBSD-tech-jp@jp.freebsd.org. NOTE: We must put ed_probe_SIC() function into if_ed_isa.c because this is a bus dependent code. But the ed driver code is not separated explicitly whether it is bus dependent or independent now. Refer to: http://plaza17.mbn.or.jp/~chi/myprog/FreeBSD/sicat.html Submitted by: chi@bd.mbn.or.jp (Chiharu Shibata)
* Consistently use the BSD u_int and u_short instead of the SYSV uint andjhb2003-08-071-1/+1
| | | | | | | ushort. In most of these files, there was a mixture of both styles and this change just makes them self-consistent. Requested by: bde (kern_ktrace.c)
* Fix ed compilation with PAE by using %jx instead of %x.cognet2003-04-051-4/+4
|
* - Add vm_paddr_t, a physical address type. This is required for systemsjake2003-03-251-2/+2
| | | | | | | | | | | | | | | where physical addresses larger than virtual addresses, such as i386s with PAE. - Use this to represent physical addresses in the MI vm system and in the i386 pmap code. This also changes the paddr parameter to d_mmap_t. - Fix printf formats to handle physical addresses >4G in the i386 memory detection code, and due to kvtop returning vm_paddr_t instead of u_long. Note that this is a name change only; vm_paddr_t is still the same as vm_offset_t on all currently supported platforms. Sponsored by: DARPA, Network Associates Laboratories Discussed with: re, phk (cdevsw change)
* Back out M_* changes, per decision of the TRB.imp2003-02-191-2/+2
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-2/+2
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,schweikh2003-01-011-1/+1
| | | | especially in troff files.
* network interface driver changes:sam2002-11-141-21/+9
| | | | | | | | | | | | | | o don't strip the Ethernet header from inbound packets; pass packets up the stack intact (required significant changes to some drivers) o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN) o track ether_ifattach/ether_ifdetach API changes o track bpf changes (use BPF_TAP and BPF_MTAP) o track vlan changes (ifnet capabilities, revised processing scheme, etc.) o use if_input to pass packets "up" o call ether_ioctl for default handling of ioctls Reviewed by: many Approved by: re
* Use if_printf() instead of printf() to print "ed#: blah".brooks2002-10-011-3/+2
|
* mbuf leak in the error case has been fixed. When we haveimp2002-09-301-1/+3
| | | | | | | an error, go ahead and m_freem the buffer. PR: 32666 Submitted by: Chi-Fung Fan
* Be consistent about "static" functions: if the function is markedphk2002-09-281-2/+2
| | | | | | static in its prototype, mark it static at the definition too. Inspired by: FlexeLint warning #512
* Remove __P.alfred2002-03-201-23/+21
|
* Patch to allow the ed driver interrupt routine to terminate if theimp2001-11-241-4/+17
| | | | | | | | | | | | card is ejected while we're in this routine. yamamoto-san's original patch had a small race window for AX88190 chips, which I corrected by limiting the number of iterations we'd try to reset the bits to be about 15ms rather than forever. This seems to work for me, but I don't have a large collections of cards based on this chipset. Submitted by: YAMAMOTO Shigeru
* MFS: sync the ipfw/dummynet/bridge code with the one recently mergedluigi2001-11-041-3/+1
| | | | into stable (mostly , but not only, formatting and comments changes).
* Always compile in bridge hooks, or this code will not work (efficiently) withluigi2001-11-011-8/+4
| | | | the loadable bridge module.
* Fix obvious bug where return from probe was botched.asmodai2001-10-311-1/+1
| | | | | | | People with HP PCLAN+ NICs can now happily use the card again PR: 21087 Submitted by: M. B. Buchanan <buchanan@orbitworld.net>
OpenPOWER on IntegriCloud