summaryrefslogtreecommitdiffstats
path: root/sys/dev/sn/if_sn.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
* - Add a private timer to drive the transmit watchdog instead of usingjhb2009-11-191-20/+37
| | | | | | if_watchdog and if_timer. - Fix some issues in detach for sn(4), ste(4), and ti(4). Primarily this means calling ether_ifdetach() before anything else.
* Use the bus_*() routines rather than bus_space_*() for register operations.jhb2009-11-171-2/+0
|
* Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/rwatson2009-06-261-3/+3
| | | | | | | | | | | | | 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
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-231-1/+2
| | | | | | | | | | | | | 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@
* Fix mismerge after last cvs update for the IFQ_DRV_DEQUEUE changes.imp2006-02-041-4/+4
|
* Remove ifdef notyet for SIOCGHWADDRimp2006-02-041-19/+7
| | | | | | Treat SIOCADDMULTI and SIOCDELMULTI the same, since they had the same code Remove redundant assignment to error Convert to using the altq interface completely.
* While reviewing if_sn in an attempt to understand network driversimp2006-01-071-34/+34
| | | | | | | | | | | | | | | better, I discovered sn doing too many pointer dereferences. This driver would do silly things like: sn_foo(struct ifnet *ifp) { struct sn_softc *sc = ifp->if_softc; sc->ifp->mumble /* Other stuff */ } while /* other stuff */ usually needed sc, the extra deref isn't needed. Eliminate a few dozen of them.
* 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.
* Spell "destroy" correctly.ru2005-09-151-1/+1
|
* Diff reduction to my tree: commit the trivial part of efforts to addimp2005-08-151-2/+6
| | | | support for the really old Megahertz ethernet/modem combo cards.
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andrwatson2005-08-091-13/+14
| | | | | | | | | | | | | | 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-1/+5
| | | | | | | | 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
* Better name for type 4 chipsimp2005-07-181-1/+1
|
* Add a boatload of new device ids, gleaned from the pcmcia-cs-3.2.8imp2005-07-101-1/+2
| | | | | | | distribution. Add the appropriate devices to the man pages. Obtained from: pcmcia-cs Approved by: re (scottl)
* Add support for Farallon EtherMAC PC Card.imp2005-07-061-28/+15
| | | | | | | | | Move ethernet MAC address setting into pccard attachment Fix panic from IFP2ENADDR() use prior to if_alloc Remove OLDCARD compat support. This should work still on oldcard, however. sn_attach now requires that the resources be activated now, so adjust. Approved by: re (scottl)
* Stop embedding struct ifnet at the top of driver softcs. Instead thebrooks2005-06-101-50/+59
| | | | | | | | | | | | | | | | | | | | 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
* Start each of the license/copyright comments with /*-, minor shuffle of linesimp2005-01-061-1/+1
|
* Replace handrolled CRC calculation with ether_crc32_[lb]e().naddy2004-06-091-22/+2
|
* We don't need to initialize if_output, ether_ifattach() does itmux2004-05-231-1/+0
| | | | for us.
* Remove two variables that became unused because of last commit.luigi2004-04-161-2/+0
| | | | Reported by: tinderbox
* Remove improper use of if_addrhead in device drivers to checkluigi2004-04-151-18/+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-1/+0
|
* Don't use caddr_t in mchash(). Also use C99 spellings over BSD ones.obrien2003-12-081-1/+1
| | | | Requested by: bde,imp
* Remove duplicate FBSDID's, move others to their right place.obrien2003-11-141-1/+0
|
* Reconst-poison crc routine that was renamed to mchash.imp2003-11-141-5/+5
| | | | re-remove the _ in u_intXX_t
* Try to create some sort of consistency in how the routings to find theobrien2003-11-131-15/+16
| | | | | | | 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).
* Don't establish the ISR in the sn_activate routine. I've had twoimp2003-11-101-7/+11
| | | | | | | crashes that had sn0 as the irq that's being serviced, when there was no sn0 in the system. This seems to prevent them. Also, we want to wait until after we've registered with the network layer before we turn on the interrupt spigot to avoid races.
* 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)
* Make sn MPSAFE. This has survived a couple of make buildworlds withimp2003-10-261-123/+118
| | | | my Megahertz XJ10BT.
* Style changes:imp2003-10-261-16/+16
| | | | | o kill register o minor function name tweaks.
* Convert to bus_space.imp2003-10-251-135/+134
| | | | | | | | | Make the pccard attachment work with NEWCARD Start locking of the driver, but only the macros are defined right now Tested on: Megahertz CC10BT/2 # (These cards are very popular on ebay these days, and run < $10 including # shipping from some sellers).
* Use __FBSDID().obrien2003-08-241-1/+3
| | | | Also some minor style cleanups.
* Finish driving a stake through the heart of netns and the associatedpeter2003-03-051-5/+0
| | | | | | ifdefs scattered around the place - its dead Jim! The SMB stuff had stolen AF_NS, make it official.
* 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.
* network interface driver changes:sam2002-11-141-17/+8
| | | | | | | | | | | | | | 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(ifp, "blah") instead of printf("sn%d: blah", ifp->if_unit).brooks2002-10-011-8/+7
|
* Minor whitespace nits. remove #if 1 and #endif pair, but not code between.imp2002-07-211-7/+0
|
* Kill debug output for sn device. It is confusing the nativesimp2001-08-041-1/+0
|
* Convert if_multiaddrs from LIST to TAILQ so that it can be traversedphk2001-02-061-1/+1
| | | | | | backwards in the three drivers which want to do that. Reviewed by: mikeh
* Another round of the <sys/queue.h> FOREACH transmogriffer.phk2001-02-041-2/+1
| | | | | Created with: sed(1) Reviewed by: md5(1)
* Mechanical change to use <sys/queue.h> macro API instead ofphk2001-02-041-2/+2
| | | | | | | fondling implementation details. Created with: sed(1) Reviewed by: md5(1)
* Add support for SMC91C100FD chip of MELCO LPC-TX.toshi2001-01-151-1/+2
| | | | | | | sn1 at port 0x240-0x24f irq 10 slot 0 on pccard0 sn1: SMC91C100FD UTP MAC address 00:a0:dc:22:26:8c Submitted by: "KOMURO" <komujun@nifty.com>
* Add isa support:imp2000-12-131-0/+11
| | | | | o write isa driver routines. o factor detach routine in sn_detach.
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* Implement indirection in the pccard probe/attach. This should make itimp2000-09-191-16/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | possible to have different probe/attach semantics between the two systems and yet still use the same driver for both. Compatibility methods for OLDCARD drivers. We use these routines to make it possible to call the OLDCARD driver's probe routine in the context that it expects. For OLDCARD these are implemented as pass throughs to the device_{probe,attach} routines. For NEWCARD they are implemented such such that probe becomes strictly a matching routine and attach does both the old probe and old attach. compat devices should use the following: /* Device interface */ DEVMETHOD(device_probe), pccard_compat_probe), DEVMETHOD(device_attach), pccard_compat_attach), /* Card interface */ DEVMETHOD(card_compat_match, foo_match), /* newly written */ DEVMETHOD(card_compat_probe, foo_probe), /* old probe */ DEVMETHOD(card_compat_attach, foo_attach), /* old attach */ This will allow a single driver binary image to be used for both OLDCARD and NEWCARD. Drivers wishing to not retain OLDCARD compatibility needn't do this. ep driver minorly updated. sn driver updated more than minorly. Add module dependencies to allow module to load. Also change name to if_sn. Add some debugging code. attempt to fix the cannot allocate memory problem I'd been seeing. Minor formatting nits.
* Make all Ethernet drivers attach using ether_ifattach() and detach usingarchie2000-07-131-4/+1
| | | | | | | | | 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-20/+0
| | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud