aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/de/if_devar.h
Commit message (Collapse)AuthorAgeFilesLines
* FCP-101: Remove de(4).Brooks Davis2019-05-171-932/+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=347910
* GC never enabled support for SIOCGADDRROM and SIOCGCHIPID.Brooks Davis2018-03-291-5/+0
| | | | | | | | | | | | | | | When de(4) was imported in 1997 the world was not ready for these ioctls. In over 20 years that hasn't changed so it seems safe to assume their time will never come. Reviewed by: imp, jhb Approved by: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14889 Notes: svn path=/head/; revision=331737
* 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: minor spelling fixes.Pedro F. Giffuni2016-05-031-1/+1
| | | | | | | Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
* Use a private timer to run the statistics timer instead of (ab)usingJohn Baldwin2009-11-171-2/+3
| | | | | | | | | if_watchdog and if_timer. Tested by: WATANABE Kazuhiro CQG00620 of nifty.ne.jp Notes: svn path=/head/; revision=199378
* Align Tx/Rx descriptors on 32 bytes boundary instead of PAGE_SIZE.Pyun YongHyeon2009-09-241-1/+0
| | | | | | | | | | | | | | | | | | | | | | Also align setup descriptor on 32 bytes boundary. Tx buffer have no alignment limitation so create dmamap without alignment restriction[1]. Rx buffer still seems to require 4 bytes alignment limitation but we can simply use MCLBYTES for size to map the buffer instead of TULIP_DATA_PER_DESC as the buffer is allocated with m_getcl(9). de(4) supports up to TULIP_MAX_TXSEG segments for Tx buffers, increase maximum dma segment size to TULIP_MAX_TXSEG * MCLBYTES. While I'm here remove TULIP_DATA_PER_DESC as it is not used anymore. This should fix de(4) breakage introduced after r176206. Submitted by: jhb [1] Reported by: WATANABE Kazuhiro < CQG00620 <> nifty dot ne dot jp > Tested by: WATANABE Kazuhiro < CQG00620 <> nifty dot ne dot jp >, Takahashi Yoshihiro < nyan <> jp dot freebsd dot org > Notes: svn path=/head/; revision=197465
* Consistently use bus_addr_t.Pyun YongHyeon2009-09-241-2/+2
| | | | Notes: svn path=/head/; revision=197463
* Use __NO_STRICT_ALIGNMENT to determine whether de(4) have to applyPyun YongHyeon2009-09-241-3/+0
| | | | | | | | alignment fixup code for received frames on strict alignment architectures. Notes: svn path=/head/; revision=197461
* Increase size of timer counter bitfield to accomodate the actual size of theMatt Jacob2007-05-201-1/+1
| | | | | | | | | | | default timer value. Discovered By: gcc 4.2 MFC after: 3 days Notes: svn path=/head/; revision=169797
* - Consistently use if_printf() only in interface methods: if_start(),Gleb Smirnoff2006-09-151-0/+1
| | | | | | | | | | | if_watchdog, etc., or in functions used only in these methods. In all other functions in the driver use device_printf(). - Use __func__ instead of typing function name. Submitted by: Alex Lyashkov <umka sevcity.net> Notes: svn path=/head/; revision=162321
* Repo copy de driver to dev/de, and adjust.Warner Losh2006-02-261-3/+3
| | | | Notes: svn path=/head/; revision=156034
* Use ETHER_ADDR_LEN rather than hardcoding 6.John Baldwin2005-12-211-1/+1
| | | | Notes: svn path=/head/; revision=153617
* Byte copy IF_LLADDR() on stack to align it to be safe for typecasts.Ruslan Ermilov2005-11-301-2/+2
| | | | | | | Tested by: jhb Notes: svn path=/head/; revision=152962
* Various fixes to make de(4) not panic after ru@'s IF_LLADDR() changes:John Baldwin2005-11-211-2/+2
| | | | | | | | | | | | | | | | | | - Don't call tulip_addr_filter() to reset the RX address filter in tulip_reset() since that gets called before ether_ifattach(). Just call it in tulip_init_locked(). - Use be16dec() and le16dec() to parse MAC addresses when programming the RX filter. - Let ether_ioctl() handle SIOCSIFMTU since we were doing the exact same thing with the added bonus that we leaked the driver lock if the MTU was > ETHERMTU in the homerolled version. This part will be MFC'd. Clue from: wpaul (1) Stolen from: marcel (2 via patch for dc(4)) MFC after: 1 week Notes: svn path=/head/; revision=152666
* - Remove non-bus-dma code.John Baldwin2005-08-251-28/+0
| | | | | | | | | | | - Remove form feed characters. - Fixup style of function declarations. - Assume that an mbuf cluster is big enough to hold an ethernet frame. (This should really be using m_defrag(), but this diff is just simple changes for now.) Notes: svn path=/head/; revision=149476
* Major rototill of this driver to add FreeBSD bus-dma support:John Baldwin2005-08-251-84/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Allocate arrays of metadata for the descriptors in the rx and tx rings and change the ring pointers to walk the metadata array rather than the actual descriptor rings. Each metadata object contains a pointer to its descriptor, a pointer to any associated mbuf, and a pointer to the associated bus_dmamap_t in the bus_dma case. The mbuf pointers replace the tulip_txq and tulip_rxq local ifqueue's in the softc. - Add lots of KTR trace entries using a local KTR_TULIP level which defaults to 0, but can be changed to KTR_DEV at the top of the file when debugging. - Rename tulip_init(), tulip_start(), tulip_ifinit(), and tulip_ifstart() to tulip_init_locked(), tulip_start_locked(), tulip_init(), and tulip_start(), respectively, to match the convention in other drivers. - Add a TULIP_SP_MAC() macro to encode two bytes of the MAC address into the setup buffer and use that in place of lots of BYTE_ORDER #ifdef's. Also, remove an incorrect XXX comment I added earlier, the driver was correct (at least it does the same thing dc(4) does). TULIP_SP_MAC was shamelessly copied from DC_SP_MAC() in dc(4). - Remove the #ifdef'd NetBSD bus-dma code and replace it with FreeBSD bus-dma code that not only compiles but even works at runtime. - Use callout_init_mtx() instead of just callout_init(). - Correct the various wrapper macros for bus_dmamap_sync() for the rx and tx buffers to only ask for the sync ops that they actually need. - Tidy the #ifdef TULIP_COPY_RXDATA code by expanding an #ifdef a bit so it becomes easier to read at the expense of a couple of duplicated lines of code. Also, use m_getcl() to get an mbuf cluster rather than MGETHDR() followed by MCLGET(). - Maintain the ring free (ri_free) count for the rx ring metadata since we no longer have tulip_rxq.ifq_len around to indicate how many mbuf's are currently in the rx ring. - Add code to teardown bus_dma resources when attach fails and generally fixup attach to do a better job of cleaning up when it fails. This gets us a good bit closer to possibly having a detach method someday and making this driver an unloadable module. - Add some functions that can be called from ddb to dump the state of a descriptor ring and to dump the state of an individual descriptor. - Various comment grammer and spelling fixes. I have bus-dma turned on by default, but I've left the non-bus-dma code around so that it can be turned off to aid in debugging should any problems turn up later on. I'll be removing the non-bus-dma code in a subsequent commit. Notes: svn path=/head/; revision=149473
* Remove the unused TULIP_CSR_{READ,WRITE}BYTE macros.John Baldwin2005-08-171-9/+0
| | | | Notes: svn path=/head/; revision=149205
* - Use callout_*() rather than timeout() to periodically poll the media.John Baldwin2005-07-271-0/+7
| | | | | | | | | | | | - Add locking to protect the softc and mark this driver as MP safe. There are still some edge cases with multiport cards that need more locking work. MFC after: 1 week Tested on: alpha Notes: svn path=/head/; revision=148445
* Remove conditional code that has largely rotted that is also not on byJohn Baldwin2005-07-211-11/+0
| | | | | | | | | | | | default: - TULIP_NEED_FASTTIMEOUT - tulip_fasttimeout() wasn't called anywhere - BIG_PACKET - only worked on i386 anyway - TULIP_USE_SOFTINTR - doesn't compile and was never updated to handle new netisr registration - non-FreeBSD code Notes: svn path=/head/; revision=148252
* Use get_cyclecount() rather than hardcoding rdtsc and rpcc in asm for i386John Baldwin2005-07-211-20/+2
| | | | | | | and alpha, respectively. Notes: svn path=/head/; revision=148249
* Fix a typo and some whitespace nits.John Baldwin2005-07-211-5/+3
| | | | Notes: svn path=/head/; revision=148248
* Stop embedding struct ifnet at the top of driver softcs. Instead theBrooks Davis2005-06-101-4/+2
| | | | | | | | | | | | | | | | | | | | | | | 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
* Apply the long-overdue hatchet of style(9) death to this file.Bruce M Simpson2004-07-091-458/+547
| | | | Notes: svn path=/head/; revision=131847
* Consistently use __inline instead of __inline__ as the former is an empty macroStefan Farfeleder2004-07-041-2/+2
| | | | | | | in <sys/cdefs.h> for compilers without support for inline. Notes: svn path=/head/; revision=131575
* Replace the if_name and if_unit members of struct ifnet with new membersBrooks Davis2003-10-311-4/+2
| | | | | | | | | | | | | | | | 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
* Fix alignment requirements of tulip_rombuf by further increasingBernd Walter2003-06-131-4/+4
| | | | | | | | | tulip_boardid size. Add a comment to tulip_rombuf about this requirement. I have had panics on alpha while probing a de card. Notes: svn path=/head/; revision=116321
* Move some FALLTHROUGH comments so they work.Poul-Henning Kamp2003-05-311-1/+1
| | | | | | | | | | | Fix indentation error. Make boardid string long enough. Remove unused variable. Found by: FlexeLint Notes: svn path=/head/; revision=115519
* Fix typo in the BSD copyright: s/withough/without/Jens Schweikhardt2002-06-021-1/+1
| | | | | | | | Spotted and suggested by: des MFC after: 3 weeks Notes: svn path=/head/; revision=97748
* No FreeBSD/vax here either.Peter Wemm2001-11-031-1/+1
| | | | Notes: svn path=/head/; revision=85959
* Use bus_space for all register accesses.Doug Rabson2000-05-131-38/+20
| | | | Notes: svn path=/head/; revision=60528
* A little more tidying up.Peter Wemm1999-08-091-23/+4
| | | | Notes: svn path=/head/; revision=49575
* Expand a heap of macros that obscure readability and are no longer neededPeter Wemm1999-08-091-67/+0
| | | | | | | here, and do a bit of general tidy up. Notes: svn path=/head/; revision=49572
* More pre-lite2 support zapped and some more tidy-up.Peter Wemm1999-08-091-21/+1
| | | | Notes: svn path=/head/; revision=49568
* Unifdef -D__FreeBSD__ - and remove pre-lite2 support.Peter Wemm1999-08-091-9/+3
| | | | Notes: svn path=/head/; revision=49567
* Unifdef -U__NetBSD__Peter Wemm1999-08-091-78/+0
| | | | Notes: svn path=/head/; revision=49566
* Unifdef -U__bsdi__Peter Wemm1999-08-091-49/+1
| | | | Notes: svn path=/head/; revision=49563
* s/Id/FreeBSD/Peter Wemm1999-08-091-1/+2
| | | | Notes: svn path=/head/; revision=49562
* Strip __FreeBSD_version >= 300000 conditionals.Peter Wemm1999-08-091-10/+2
| | | | Notes: svn path=/head/; revision=49561
* s/TULUP/TULIP/ - from vendor branch.Peter Wemm1999-08-081-3/+3
| | | | Notes: svn path=/head/; revision=49541
* Rename bpfilter to bpf.Dag-Erling Smørgrav1999-07-061-3/+3
| | | | Notes: svn path=/head/; revision=48645
* Forgotten in previous commit:Andrew Gallatin1999-05-261-2/+2
| | | | | | | | | | | | Allow chipset drivers to specify the direct-mapped DMA window's mask in preparation for tsunami support. Previous chipsets' direct-mapped DMA mask was always 1024*1024*1024. The Tsunami chipset needs it to be 2*1024*1024*1024 Reviewed by: Doug Rabson <dfr@nlsystems.com> Notes: svn path=/head/; revision=47530
* If this is going to have checks for kernel versions, it might as wellPeter Wemm1998-11-061-1/+13
| | | | | | | do it so that it works. This code should run on 2.2.x now. Notes: svn path=/head/; revision=40944
* Revert part of previous commit. vaddr_t doesn't exist on FreeBSD. ThisPeter Wemm1998-10-141-2/+2
| | | | | | | | didn't affect the x86 kernel due to #ifdefs. It broke FreeBSD/Alpha kernel compiles though. Notes: svn path=/head/; revision=40339
* Update from NetBSD if_de.c 1.72 to 1.80. This is mostly bugfixes, andPeter Wemm1998-10-131-4/+6
| | | | | | | | | | looks like it will have most effect on decoding device capabilities and configuration. Approved by: jkh Notes: svn path=/head/; revision=40290
* Port de driver to alpha.Doug Rabson1998-09-161-3/+37
| | | | Notes: svn path=/head/; revision=39345
* Merge changes from vendor branch;Peter Wemm1998-06-131-3/+3
| | | | | | | | | | | - connector selection values (should fix aui/bnc), - non-shifting version of crc calculation using a table, - interrupt mask adjustments, - add some brackets where a #ifdef could break an if(), - don't reset the card unless it's up. Notes: svn path=/head/; revision=36945
* Fixed pedantic semantics errors (bitfields not of type int, signed intBruce Evans1998-06-081-2/+2
| | | | | | | | | | or unsigned int (this doesn't change the struct layout, size or alignment in any of the files changed in this commit, at least for gcc on i386's. Using bitfields of type u_char may affect size and alignment but not packing)). Notes: svn path=/head/; revision=36767
* This commit fixes various 64bit portability problems required forDoug Rabson1998-06-071-2/+2
| | | | | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time. Notes: svn path=/head/; revision=36735
* merge benfor branch changes onto mainline.Peter Wemm1998-03-081-9/+81
| | | | Notes: svn path=/head/; revision=34317
* Merge 971020 stuff.. Check 21142? SROM CRC.Peter Wemm1997-11-081-2/+3
| | | | Notes: svn path=/head/; revision=31041