summaryrefslogtreecommitdiffstats
path: root/sys/dev/ep/if_ep.c
Commit message (Collapse)AuthorAgeFilesLines
* ALTQify ep(4).mlaier2006-12-011-5/+7
| | | | | Tested and Requested by: Andy Brook MFC after: 3 days
* Remove ifdef notdef SIOCHWADDR vestige.imp2006-02-041-6/+0
|
* - Store pointer to the link-level address right in "struct ifnet"ru2005-11-111-2/+2
| | | | | | | | | | 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.
* Better use of gone.imp2005-09-201-9/+5
|
* 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.
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-10/+10
| | | | | | | | | | | | | | 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
* The isa attachment calls ep_free after it has already been called onceimp2005-07-311-1/+3
| | | | | | | | in the resource error in ep_alloc case. This results in a panic. Zero resources to make it safe to call twice pending resolution of layering questions. MFC After: 3 days
* Spell destroy in a more traditional wayimp2005-07-191-3/+3
|
* Make a pass and cleanup the printfs from this driver.imp2005-07-011-4/+2
| | | | Approved by: re (scottl) blanket ep
* Minor cleanup of ep driver and pccard attachment:imp2005-07-011-34/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Grab the MAC address out of the CIS if the card has the special 3Com 0x88 tuple. Most 3Com cards don't have this tuple, but we prefer it to the eeprom since it only appears to be present when the eeprom doesn't have the info. So far, I've only observed this on my 3C362 and 3C362B cards, but the NetBSD driver implies that the 3C362C also has this tuple, and that some 3C574 cards do too (none of mine do). ep_pccard_mac was written after looking at the NetBSD code. o Store the enet addr in the softc for this device, so we can use the overridden MAC to set the station address. o Create a routine to set the station address and use it where we need it. o setup the cmd shitfs and such before we call ep_alloc(), and remove setting up the cmd shift value there. It initializes to 0, and those attachments that need to frob it do so before calling ep_alloc. o Remove some obsolete comments o No longer a need to export ep_get_macaddr, so make it static o ep_alloc already grabs the EEPROM id, so we don't need to grab it again in ep_pccard_attach. o eliminate unit, it isn't needed, fix some printfs to be device_printf instead. # All my pccards except the 3C1 work now. Didn't test ISA or cbus cards # that I have: 3C509B-TP or 3C569B-J-TPO Tested on: 3C589B, 3C589C, 3C589D, 3C589D-TP, 3C562, 3C562B/3C563B, 3C562D/3C563D, 3CCFE574BT, 3CXEM556, 3CCSH572BT, 3C574-TX, 3CCE589EC, 3CXE589EC, 3CCFEM556, 3C1 Approved by: re (scottl)
* o When calling ep_get_macaddr(), provide it a local buffer. Add a commentimp2005-06-261-4/+4
| | | | | | | | | that says why we do this (or rather, explains that it is some voodoo magic that's poorly understood). The local buffer fixes the crash on attach. o Rename get_e() to ep_get_e() to avoid namespace pollution. Submitted by: mux Approved by: re (scottl)
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-101-13/+18
| | | | | | | | | | | | | | | | | | | | 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
* Make it clear that the statement following the conditional is a NOP.mdodd2005-04-131-1/+2
|
* u_intXX_t -> uintXX_t while I'm here.imp2005-01-201-6/+6
|
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* We don't need to initialize if_output, ether_ifattach() does itmux2004-05-231-1/+0
| | | | for us.
* Convert callers to the new bus_alloc_resource_any(9) API.njl2004-03-171-4/+3
| | | | | Submitted by: Mark Santcroos <marks@ripe.net> Reviewed by: imp, dfr, bde
* Removed duplicate __FBSDID(). Keep the one that style(9) likes.ru2004-03-141-3/+0
|
* Announce ethernet MAC addresss in ether_ifattach().mdodd2004-03-141-3/+0
|
* MFp4:imp2003-11-021-1/+3
| | | | o Minor tweak to error processing in ep_alloc.
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-2/+1
| | | | | | | | | | | | | 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)
* Pass sc to GO_WINDOW macro.imp2003-10-261-18/+18
| | | | | | Use SET_IRQ for pccard case, rather than exapnding it inline. Requested by: mdodd
* Minor style nits suggested by sam and mdodd:imp2003-10-251-24/+25
| | | | | | o give an argument to EP_BUSY_WAIT o use foo_locked rather than foo_body o Add locking assertions for extra safety.
* Whole grab-bag of changes:imp2003-10-251-139/+159
| | | | | | | | o Make the driver MPSAFE o Some changes due to diff reduction effort with vx. o Removed some obsolete junk. Reviewed by: sam, modd
* Fix mismerge from one tree to another: add (imp2003-10-231-1/+1
|
* Learn basic C.imp2003-10-231-2/+3
| | | | | ((uint32_t *) v) + 10 != ((caddr_t) v) + 10 so apply the cast later.
* Transition to using bus_space macros rather than the inb/outb/etc.imp2003-10-181-98/+96
| | | | | | | | | | | | Use EP_{READ,WRITE}{,_MULTI}_{1,2,4} instead. I've had several people submit patches like this over the years of varying qualities, markm being the last. The names were chosen in consulation with mdodd on irc. I've tested this with only PCMCIA cards: 3CCE589EC and 3CCSH572BT. I've not tried with my more extensive ISA, EISA and cbus collection. Reviewed by: mdodd
* Style fixes of the whitespace variety. Fix long lines and tabs.markm2003-08-301-56/+78
|
* Use __FBSDID().obrien2003-08-241-0/+3
| | | | Also some minor style cleanups.
* Use bus_child_present() to make sure the card is still there before callingcognet2003-08-191-1/+2
| | | | | epstop() in ep_detach(). This fixes a freeze that happens when ejecting a ep(4) pcmcia card.
* Style(9) cleanup. There was no consistent style in this driver, andmarkm2003-07-171-559/+512
| | | | | | | The next round of commits will be to fix up locking in it. This lot is to at least give a consistent base to work off. OK'ed by: imp, mdodd
* Other minor style nits I missed in ep_if_start() in my previousmux2003-06-261-3/+4
| | | | commit.
* Make if_ep_start() look a bit more like other if_start() functions,mux2003-06-261-18/+13
| | | | | by calling the first mbuf in the chain m0 and fixing a few nearby style bugs, mostly s/0/NULL/.
* Fix a race condition that was introduced since pccbb interrupts aremux2003-06-261-7/+5
| | | | | | | | | | | | | flag'ed INTR_MPSAFE. In ep_if_start(), use the IF_DEQUEUE macro to grab the next mbuf to send, and use IF_PREPEND if the card is busy and we actually can't handle it right now. The old code was first getting the mbuf by taking it from the queue without using the macros, thus without locking, and without removing it from the queue either. It was later assuming that IF_DEQUEUE would give him this same mbuf. Tested by: mich
* - Free interrupt handler in ep_free().mdodd2003-03-291-0/+27
| | | | | - Move ep_pccard_detach() to if_ep.c and rename to ep_detach() - Specify detach methods for all bus frontends.
* - Return error status instead of value in get_e().mdodd2003-03-291-18/+44
| | | | | - Modify ep_get_macaddr() to return an error status. - Reverse the return value logic of eeprom_rdy().
* Back out M_* changes, per decision of the TRB.imp2003-02-191-4/+4
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-4/+4
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* network interface driver changes:sam2002-11-141-15/+4
| | | | | | | | | | | | | | 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
* Remove __P.alfred2002-03-201-9/+9
|
* Two fixes from Jonathan Hanna:imp2002-02-121-6/+4
| | | | | | | | | 1) We shouldn't continue when we get a RX complete because we ack it and the TX complete. 2) Fix a couple of spl leaks (why splbio is needed in ISR, I cannot understand). MFC after: 3 days
* Commit part of the patch that I have for card eject problems with theimp2001-06-051-0/+5
| | | | | | | | ep driver. The rest of the patch will wait until I can put the time into it to get it righter than the kludge it is. This protects us against card eject problems at all times,e xecpt when we're in the epintr ISR.
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* Remove 7 unnecessary includes frmo phk's scriptimp2000-09-201-5/+0
|
* Make all Ethernet drivers attach using ether_ifattach() and detach usingarchie2000-07-131-5/+2
| | | | | | | | | 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
* Move code to handle BPF and bridging for incoming Ethernet packets outarchie2000-05-141-33/+3
| | | | | | | | | | | | | | | 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
* Remove unneeded #include <sys/kernel.h>phk2000-04-291-1/+0
|
* Remove ~25 unneeded #include <sys/conf.h>phk2000-04-191-1/+0
| | | | Remove ~60 unneeded #include <sys/malloc.h>
* Fix a problem that caused TCP fragments to be lost (among other things.)mdodd2000-03-241-1/+1
|
* Copy how everyone else is doing packet transmission. (NetBSD mostly)mdodd2000-03-131-6/+8
| | | | | I've been running this for a month or so and have had no problems with it and if I recall it was my last speed tweak. Holler if this breaks anything.
OpenPOWER on IntegriCloud