summaryrefslogtreecommitdiff
path: root/sys/dev/vx/if_vx.c
Commit message (Collapse)AuthorAgeFilesLines
* FCP-101: Remove vx(4).Brooks Davis2019-05-171-1081/+0
| | | | | | | | | | Relnotes: yes FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Reviewed by: jhb, imp Differential Revision: https://reviews.freebsd.org/D20230 Notes: svn path=/head/; revision=347921
* Deprecate a number of less used 10 and 10/100 Ethernet devices.Brooks Davis2018-10-251-0/+2
| | | | | | | | | | | | | | The current deprecated list is: ae, bm, cs, de, dme, ed, ep, ex, fe, pcn, sf, sn, tl, tx, txp, vx, wb, xe The list as refined as part of FCP-0101. Per the FCP, devices may be removed from the deprecation list if enough users are found or they are converted to iflib. FCP: https://github.com/freebsd/fcp/blob/master/fcp-0101.md Notes: svn path=/head/; revision=339703
* sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
* sys/dev: Replace zero with NULL for pointers.Pedro F. Giffuni2017-02-201-2/+2
| | | | | | | | | | | Makes things easier to read, plus architectures may set NULL to something different than zero. Found with: devel/coccinelle MFC after: 3 weeks Notes: svn path=/head/; revision=313982
* sys/dev: minor spelling fixes.Pedro F. Giffuni2016-05-031-2/+2
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* In order to reduce use of M_EXT outside of the mbuf allocator andRobert Watson2015-01-061-2/+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 Notes: svn path=/head/; revision=276750
* Mechanically convert to if_inc_counter().Gleb Smirnoff2014-09-191-9/+9
| | | | Notes: svn path=/head/; revision=271849
* The r48589 promised to remove implicit inclusion of if_var.h soon. PrepareGleb Smirnoff2013-10-261-0/+1
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=257176
* Mechanically substitute flags from historic mbuf allocator withGleb Smirnoff2012-12-041-4/+4
| | | | | | | malloc(9) flags in sys/dev. Notes: svn path=/head/; revision=243857
* ether_ifattach() sets if_mtu to ETHERMTU, don't bother set it againKevin Lo2012-01-071-1/+0
| | | | | | | Reviewed by: yongari Notes: svn path=/head/; revision=229767
* Add new tunable 'net.link.ifqmaxlen' to set default send interfaceMaxim Sobolev2010-05-031-1/+1
| | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=207554
* - Add a private timer to drive the transmit watchdog instead of usingJohn Baldwin2009-11-191-13/+20
| | | | | | | | | 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. Notes: svn path=/head/; revision=199559
* - vx_stop() requires the driver lock to be held.Marius Strobl2008-04-241-3/+5
| | | | | | | | | - Add some missing newlines to messages printed by vx_getlink(). MFC after: 3 days Notes: svn path=/head/; revision=178469
* - Store pointer to the link-level address right in "struct ifnet"Ruslan Ermilov2005-11-111-3/+3
| | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=152315
* Rototill vx(4), add locking, and mark MPSAFE:John Baldwin2005-10-061-190/+235
| | | | | | | | | | | | | | | | | | | | | - Rename vxfoo() functions to vx_foo() to improve readability and consistency with other drivers. - Prefix most the softc members with 'vx_' (the other members already had the prefix). - Switch to using callout_init_mtx() and callout_*() rather than timeout() and untimeout(). - Add some missing calls to if_free() in some failure cases in vx_attach(). - Use if_printf() and remove the unit number from the softc. - Remove uses of the 'register' keyword and spls. - Add locked variants of vx_init() and vx_start(). - Add a mutex to the softc and lock it in various appropriate places. - Setup the interrupt handler last during attach. Tested by: imp MFC after: 1 week Notes: svn path=/head/; revision=151014
* Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE andRobert Watson2005-08-091-11/+11
| | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=148887
* Don't drop frames if interface is in promiscuous mode.Ruslan Ermilov2005-07-221-1/+2
| | | | | | | | | PR: kern/83833 Submitted by: Eygene A. Ryabinkin MFC after: 3 days Notes: svn path=/head/; revision=148284
* Stop embedding struct ifnet at the top of driver softcs. Instead theBrooks Davis2005-06-101-27/+35
| | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=147256
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386Yoshihiro Takahashi2005-05-291-1/+0
| | | | | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr) Notes: svn path=/head/; revision=146734
* Fix up assignment of negative number to char. Char's are unsigned byPeter Grehan2005-02-031-1/+1
| | | | | | | | | default on PowerPC. Approved by: mdodd Notes: svn path=/head/; revision=141166
* Start each of the license/copyright comments with /*-, minor shuffle of linesWarner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139749
* ss if_vx through indent, and use ANSI function definitions, prior to addingJustin T. Gibbs2004-08-181-779/+764
| | | | | | | | if_media and DMA support to the driver. The previous style was inconsistent making it difficult to emulate existing style. Notes: svn path=/head/; revision=133980
* Since if_vx doesn't contain locking or run with INTR_MPSAFE, markRobert Watson2004-08-141-1/+2
| | | | | | | the interface as IFF_NEEDSGIANT so if_start is run holding Giant. Notes: svn path=/head/; revision=133702
* We don't need to initialize if_output, ether_ifattach() does itMaxime Henrion2004-05-231-1/+0
| | | | | | | for us. Notes: svn path=/head/; revision=129616
* Announce ethernet MAC addresss in ether_ifattach().Matthew N. Dodd2004-03-141-2/+0
| | | | Notes: svn path=/head/; revision=126966
* Replace the if_name and if_unit members of struct ifnet with new membersBrooks Davis2003-10-311-4/+6
| | | | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=121816
* Start to minimize diffs between vx and ep. These latter is based on aWarner Losh2003-10-251-6/+6
| | | | | | | | more advanced version of the chips supported by the former. Matt Dodd and I are working towards merging them, and this a step on that path. Notes: svn path=/head/; revision=121491
* Use __FBSDID().David E. O'Brien2003-08-241-1/+3
| | | | | | | Also some minor style cleanups. Notes: svn path=/head/; revision=119418
* Revert part of rev 1.43. We want to fail gracefully if there is no packetDag-Erling Smørgrav2003-06-081-0/+3
| | | | | | | | | waiting in the interface queue. Submitted by: Yeasah Pell <yeasah@apocalypse.org> Notes: svn path=/head/; revision=116062
* Introduce an M_ASSERTPKTHDR() macro which performs the very common taskDag-Erling Smørgrav2003-04-081-5/+2
| | | | | | | | | | of asserting that an mbuf has a packet header. Use it instead of hand- rolled versions wherever applicable. Submitted by: Hiten Pandya <hiten@unixdaemons.com> Notes: svn path=/head/; revision=113255
* Back out M_* changes, per decision of the TRB.Warner Losh2003-02-191-4/+4
| | | | | | | Approved by: trb Notes: svn path=/head/; revision=111119
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.Alfred Perlstein2003-01-211-4/+4
| | | | | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT. Notes: svn path=/head/; revision=109623
* network interface driver changes:Sam Leffler2002-11-141-12/+5
| | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=106937
* Fix mis-indentation.Poul-Henning Kamp2002-10-021-3/+3
| | | | | | | Spotted by: FlexeLint Notes: svn path=/head/; revision=104363
* Use if_printf(ifp, "blah") instead of printf("vx%d: blah", ifp->if_unit).Brooks Davis2002-10-011-2/+2
| | | | Notes: svn path=/head/; revision=104259
* Increase size of ifnet.if_flags from 16 bits (short) to 32 bits (int). To avoidMaxim Sobolev2002-08-181-1/+1
| | | | | | | | | | breaking application ABI use unused ifreq.ifru_flags[1] for upper 16 bits in SIOCSIFFLAGS and SIOCGIFFLAGS ioctl's. Reviewed by: -hackers, -net Notes: svn path=/head/; revision=102052
* Remove __P.Alfred Perlstein2002-03-201-17/+17
| | | | Notes: svn path=/head/; revision=92739
* Get rid of the twisted MFREE() macro entirely.Matthew Dillon2002-02-051-14/+12
| | | | | | | | Reviewed by: dg, bmilekic MFC after: 3 days Notes: svn path=/head/; revision=90227
* Quiet a variable format-string warning.Kris Kennaway2001-07-191-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=79885
* Change m_devget()'s outdated and unused `offset' argument to actually meanBosko Milekic2001-06-201-4/+1
| | | | | | | | | | | | | | | | | | | | | | | something: offset into the first mbuf of the target chain before copying the source data over. Make drivers using m_devget() with a first argument "data - ETHER_ALIGN" to use the offset argument to pass ETHER_ALIGN in. The way it was previously done is potentially dangerous if the source data was at the top of a page and the offset caused the previous page to be copied (if the previous page has not yet been appropriately mapped). The old `offset' argument in m_devget() is not used anywhere (it's always 0) and dates back to ~1995 (and earlier?) when support for ethernet trailers existed. With that support gone, it was merely collecting dust. Tested on alpha by: jlemon Partially submitted by: jlemon Reviewed by: jlemon MFC after: 3 weeks Notes: svn path=/head/; revision=78508
* When I converted this driver, I neglected to deal with packet alignment.Bill Paul2000-12-071-0/+17
| | | | | | | | | | We must force payload alignment to a longword boundary to make the alpha happy. This should stop the driver from trapping on the alpha when the interface is ifconfig'ed (actually, when the first frame is received). Notes: svn path=/head/; revision=69732
* Update the vortex driver so that it no longer needs the PCI compatBill Paul2000-11-071-111/+69
| | | | | | | | | interface. In addition to using newbus, it also uses bus_space rather than inb/outb to make it MI. The grody static softc allocation stuff has been removed as well. Notes: svn path=/head/; revision=68417
* Remove unneeded #include <machine/clock.h>Poul-Henning Kamp2000-10-151-1/+0
| | | | Notes: svn path=/head/; revision=67164
* Make all Ethernet drivers attach using ether_ifattach() and detach usingArchie Cobbs2000-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 Notes: svn path=/head/; revision=63090
* be sure to wipe out m_pkthdr when you set M_PKTHDR, you may see junk pointerJun-ichiro itojun Hagino2000-07-041-1/+1
| | | | | | | | in m_pkthdr portion. actually, we should not change pkthdr mbuf <-> non-pkthdr mbuf. Notes: svn path=/head/; revision=62593
* Move code to handle BPF and bridging for incoming Ethernet packets outArchie Cobbs2000-05-141-13/+4
| | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=60536
* This driver attempts to cache mbufs, and re-use them as headers insteadJonathan Lemon2000-05-121-0/+1
| | | | | | | | | | | of using the MGETHDR macro all the time. When an mbuf is reused as a header, initialize csum_flags to zero as well, so the delayed_checksum call woks properly. Debbugging work done by: jmas Notes: svn path=/head/; revision=60475
* Remove #if NVX > 0 and #if NEISA > 0 (and #include "eisa.h") as it's notPeter Wemm2000-01-291-3/+0
| | | | | | | needed. Notes: svn path=/head/; revision=56833
* Set ifq_maxlen to default (IFQ_MAXLEN).Matthew N. Dodd2000-01-161-0/+1
| | | | Notes: svn path=/head/; revision=56077
* Remove NBPF conditionality of bpf calls in most of our network drivers.Poul-Henning Kamp1999-09-251-9/+0
| | | | | | | | | | | | | | | This means that we will not have to have a bpf and a non-bpf version of our driver modules. This does not open any security hole, because the bpf core isn't loadable The drivers left unchanged are the "cross platform" drivers where the respective maintainers are urged to DTRT, whatever that may be. Add a couple of missing FreeBSD tags. Notes: svn path=/head/; revision=51646