History log of /freebsd-11-stable/sys/dev/cs/if_cs.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 347962 18-May-2019 brooks

MFC r339703, r347365, r347703, r347940

r339703:
Deprecate a number of less used 10 and 10/100 Ethernet devices.

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

r347365:
Update dme(4) to reflect that it will not be removed due to FCP-101.

dme(4) is the built-in NIC on a couple non-expandable mips platforms and
thus should remain. The FCP has been updated to reflect this fact.

Discussed with: imp

r347703:
FCP-101: ae(4) is sufficently popular to be moved to the keep list.

r347940:
Remove the notice that ae(4) will be removed in FreeBSD 13.

MFC requested by: rgrimes
Approved by: re (kib)


# 331722 29-Mar-2018 eadler

Revert r330897:

This was intended to be a non-functional change. It wasn't. The commit
message was thus wrong. In addition it broke arm, and merged crypto
related code.

Revert with prejudice.

This revert skips files touched in r316370 since that commit was since
MFCed. This revert also skips files that require $FreeBSD$ property
changes.

Thank you to those who helped me get out of this mess including but not
limited to gonzo, kevans, rgrimes.

Requested by: gjb (re)


# 331643 27-Mar-2018 dim

MFC r314568 (by emaste):

kern_sig.c: ANSIfy and remove archaic register keyword

Sponsored by: The FreeBSD Foundation

MFC r318389 (by emaste):

Remove register keyword from sys/ and ANSIfy prototypes

A long long time ago the register keyword told the compiler to store
the corresponding variable in a CPU register, but it is not relevant
for any compiler used in the FreeBSD world today.

ANSIfy related prototypes while here.

Reviewed by: cem, jhb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D10193


# 330897 14-Mar-2018 eadler

Partial merge of the SPDX changes

These changes are incomplete but are making it difficult
to determine what other changes can/should be merged.

No objections from: pfg


# 302408 07-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
# 298955 03-May-2016 pfg

sys/dev: minor spelling fixes.

Most affect comments, very few have user-visible effects.


# 296137 27-Feb-2016 jhibbits

Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere().

Most calls to bus_alloc_resource() use "anywhere" as the range, with a given
count. Migrate these to use the new bus_alloc_resource_anywhere() API.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D5370


# 294883 27-Jan-2016 jhibbits

Convert rman to use rman_res_t instead of u_long

Summary:
Migrate to using the semi-opaque type rman_res_t to specify rman resources. For
now, this is still compatible with u_long.

This is step one in migrating rman to use uintmax_t for resources instead of
u_long.

Going forward, this could feasibly be used to specify architecture-specific
definitions of resource ranges, rather than baking a specific integer type into
the API.

This change has been broken out to facilitate MFC'ing drivers back to 10 without
breaking ABI.

Reviewed By: jhb
Sponsored by: Alex Perez/Inertial Computing
Differential Revision: https://reviews.freebsd.org/D5075


# 276750 06-Jan-2015 rwatson

In order to reduce use of M_EXT outside of the mbuf allocator and
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


# 271836 18-Sep-2014 glebius

Mechanically convert to if_inc_counter().


# 269980 14-Aug-2014 imp

Delete pp_isadma. It isn't use, and the code that used it has been
commented out (temporarily) since 1998 when this driver hit the
tree. Also, no need to compute the ethernet header and then never use
it.


# 267992 28-Jun-2014 hselasky

Pull in r267961 and r267973 again. Fix for issues reported will follow.


# 267985 27-Jun-2014 gjb

Revert r267961, r267973:

These changes prevent sysctl(8) from returning proper output,
such as:

1) no output from sysctl(8)
2) erroneously returning ENOMEM with tools like truss(1)
or uname(1)
truss: can not get etype: Cannot allocate memory


# 267961 27-Jun-2014 hselasky

Extend the meaning of the CTLFLAG_TUN flag to automatically check if
there is an environment variable which shall initialize the SYSCTL
during early boot. This works for all SYSCTL types both statically and
dynamically created ones, except for the SYSCTL NODE type and SYSCTLs
which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to
be used in the case a tunable sysctl has a custom initialisation
function allowing the sysctl to still be marked as a tunable. The
kernel SYSCTL API is mostly the same, with a few exceptions for some
special operations like iterating childrens of a static/extern SYSCTL
node. This operation should probably be made into a factored out
common macro, hence some device drivers use this. The reason for
changing the SYSCTL API was the need for a SYSCTL parent OID pointer
and not only the SYSCTL parent OID list pointer in order to quickly
generate the sysctl path. The motivation behind this patch is to avoid
parameter loading cludges inside the OFED driver subsystem. Instead of
adding special code to the OFED driver subsystem to post-load tunables
into dynamically created sysctls, we generalize this in the kernel.

Other changes:
- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"
to "hw.pcic.intr_mask".
- Removed redundant TUNABLE statements throughout the kernel.
- Some minor code rewrites in connection to removing not needed
TUNABLE statements.
- Added a missing SYSCTL_DECL().
- Wrapped two very long lines.
- Avoid malloc()/free() inside sysctl string handling, in case it is
called to initialize a sysctl from a tunable, hence malloc()/free() is
not ready when sysctls from the sysctl dataset are registered.
- Bumped FreeBSD version to indicate SYSCTL API change.

MFC after: 2 weeks
Sponsored by: Mellanox Technologies


# 257176 26-Oct-2013 glebius

The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare
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.


# 243857 04-Dec-2012 glebius

Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags in sys/dev.


# 227309 07-Nov-2011 ed

Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.

The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.


# 218055 28-Jan-2011 andrew

Use bus space functions rather than inw/outw
to help a future port of the driver to ARM.

Approved by: imp (mentor)


# 217538 18-Jan-2011 jhb

Remove some always-true comparisons.

Submitted by: clang via rdivacky


# 207554 03-May-2010 sobomax

Add new tunable 'net.link.ifqmaxlen' to set default send interface
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


# 202580 18-Jan-2010 imp

Fix indentation nit.


# 201758 07-Jan-2010 mbr

Remove extraneous semicolons, no functional changes.

Submitted by: Marc Balmer <marc@msys.ch>
MFC after: 1 week


# 195049 26-Jun-2009 rwatson

Use if_maddr_rlock()/if_maddr_runlock() rather than IF_ADDR_LOCK()/
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


# 180388 09-Jul-2008 imp

Improve the EEPROM parsing, based on finding a datasheet that describes
it in detail.

When setting media, don't error out when a specific media is selected.
# Note: There may be some issues still here since the EtherJet PC Card doesn't
# conform to the datasheet. Many different kinds of dongles can be plugged in
# and it is unknown how to ask which one it is.

Also, add a /* bad! */ comment to a 1/2 second delay after we set the
DC/DC parameters. This should be a *sleep of some sort for !cold.
Fortunately it is the only one and is only used when setting media, so
the benefit from removing it is small. Unfortunately, it likely
serves as an exemplar of good programming techniques, which it isn't.


# 179621 06-Jun-2008 imp

Tweak a comment and a constant to restore old 30ms upper bound.
cs_readreg takes ~2us not ~1us to run.


# 179620 06-Jun-2008 imp

o Remove unused cs_debug tunable. I think I added it and then nothing with
it. Bad imp. Removing us dips us under 10,000 in size too.
o Replace an unconditional 30ms DELAY (yes, busy wait) with a check of the
SIBUSY bit in the SelfST register before accessing the eeprom. This changes
the time to read the EEPROM from 2 * 20 * 30ms (1.2s) to < 20*25us (.0005s)
and make the attach of the card tolerable when ethernet media is present.
Include data from the datasheet about why this works. While this is a 2500x
speed increase, it doesn't really matter at all once the card is probed...
o set dev earlier in softc.


# 179597 06-Jun-2008 imp

Minor clean up to shave about 1.5k off the size of the driver:
o remove unused fields from softc and args from cs_alloc_irq
o remove some commented code that will never be implemented.
o Don't try to send a packet and see if it worked. We don't
need this anymore, and it doesn't add any value.
o tweaks for BNC and AUI.
o limit possible time hung in the kernel to 4s rather than 40s.


# 179591 06-Jun-2008 imp

Remove unused fields in softc. If they are ever really needed again,
they can re-added. Remove CS_NAME. Don't whine when there's an
ignored checksum error: User has said STFU, so we should S the FU.
(remove mandated properties).


# 179560 05-Jun-2008 jhb

Make the cs(4) driver MPSAFE:
- Add a mutex to the softc to protect the softc and the device hardware.
- Add a private timer to manage transmit watchdogs rather than using
if_timer/if_watchdog.
- Setup the interrupt handler after ether_ifattach().

Tested by: imp


# 179553 05-Jun-2008 imp

Fix the media auto code by breaking it :-). Auto now just means 'use
10BaseT' since it required 10BaseT to have carrier to switch to it.
This chip makes it hard to do proper auto, so we don't do it. We
can't test carrier on things easily.

Don't insist on carrier when we set the media. Don't report failures.
Remove a 1s! delay that appears to not be needed.

With these patches, and John Baldwin's patches, I'm able to pass
packets on my IBM EtherJet card again.


# 179532 04-Jun-2008 imp

o Improve the probe code dealing with interrupts.
o When forced to be 10baseT, don't require that the 10baseT interface
have link to succeed. Still require it for IFM_AUTO, however, since it
appears that there's no way to tell if a specific type of interface
worked. I'm doing a web search for a datasheet now to see if there's
anything obvious.
o Minor incidental formatting nits, including collapsing code of the form
if (foo) {
bar();
} else {
if (baz)
bing();
}
into:
if (foo) {
bar();
} else if (baz) {
bing();
}
to save an indentation level.
o Remove stray reference to 3.x config file syntax.

# I believe John's patches still apply after this...


# 179507 03-Jun-2008 imp

Correct logic error that would prevent cs pccards from working on
systems where the CardBus bridge was connected to a APIC. The case
where the probe routine is told to not setup the IRQ was mishandled
but the error was masked in the case where the IRQ was a valid one
for the card.

MFC after: 1 week


# 162321 15-Sep-2006 glebius

- Consistently use if_printf() only in interface methods: if_start(),
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>


# 156559 10-Mar-2006 philip

Fix multicast support for cs89x0 chips. Just setting the RX_MULTCAST_ACCEPT
flag isn't enough - the filter needs to be set up too, or no multicast frames
are accepted.

Sponsored by: Philips Industrial Applications (indirectly)
MFC after: 3 days


# 150306 19-Sep-2005 imp

Make sure that we call if_free(ifp) after bus_teardown_intr. Since we
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.


# 148887 09-Aug-2005 rwatson

Propagate rename of IFF_OACTIVE and IFF_RUNNING to IFF_DRV_OACTIVE and
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


# 147256 10-Jun-2005 brooks

Stop embedding struct ifnet at the top of driver softcs. Instead the
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


# 140928 28-Jan-2005 imp

Fix the worst offenders of style(9) with a small style sweep.


# 140927 28-Jan-2005 imp

Cleanup tabs vs spaces.


# 140926 28-Jan-2005 imp

For the PC Card implementation of the CS8920M that's in my IBM
EtherJet, the interrupt is selected in the eeprom based on the layout
of the PC Card board. Since this is encoded into the EEPROM, and has
no relationship to the IRQ that the pccard bridge routes the PC Card's
interrupt pin to.

As such, stop writing to that register. This gets my EtherJet working.

# The eeprom reading code appears to be totally wrong for my EtherJet
# card. This causes the card to bogusly detect the media options
# available.


# 140925 28-Jan-2005 imp

Setting hw.cs.recv_delay should set the delay, not the ignore the
eeprom checksum.


# 140921 27-Jan-2005 imp

error = is needed before ether_ioctl() so that unsupported/unknown
IOCLTs are properly handled. This gets the cs driver properly
reporting things via ifconfig.

# my pccard still doesn't work.


# 140888 27-Jan-2005 imp

Write cs_detach() and use it. This resolves the twin problems of the
cs1 interface linger on card eject, as well as the warnings about the
card still using resources. Ooops.


# 139749 05-Jan-2005 imp

Start each of the license/copyright comments with /*-, minor shuffle of lines


# 133681 13-Aug-2004 rwatson

Since if_cs doesn't contain locking or run with INTR_MPSAFE, mark
the interface as IFF_NEEDSGIANT so if_start is run holding Giant.


# 129616 23-May-2004 mux

We don't need to initialize if_output, ether_ifattach() does it
for us.


# 128293 15-Apr-2004 luigi

Remove improper use of if_addrhead in device drivers to check
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.


# 127135 17-Mar-2004 njl

Convert callers to the new bus_alloc_resource_any(9) API.

Submitted by: Mark Santcroos <marks@ripe.net>
Reviewed by: imp, dfr, bde


# 126966 14-Mar-2004 mdodd

Announce ethernet MAC addresss in ether_ifattach().


# 122024 04-Nov-2003 imp

o Add sysctl to allow ignoring checksum of eeprom.
o Fix minor type problems
o Fix minor problem with a couple debug printfs.
o Default to a sane media type when none is reported.
o Minor style changes

The PR complains this will fix the IBM 300GL cards.

Submitted by: Max Gotlib
PR: 11462


# 121816 31-Oct-2003 brooks

Replace the if_name and if_unit members of struct ifnet with new members
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)


# 121752 30-Oct-2003 brooks

There is no way to enter the attach routine twice with the same softc
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.


# 119418 24-Aug-2003 obrien

Use __FBSDID().
Also some minor style cleanups.


# 111119 19-Feb-2003 imp

Back out M_* changes, per decision of the TRB.

Approved by: trb


# 109623 21-Jan-2003 alfred

Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.


# 106937 14-Nov-2002 sam

network interface driver changes:

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


# 104252 30-Sep-2002 brooks

Use if_printf(ifp, "blah") instead of
printf(CS_NAME"%d: blah", ifp->if_unit);


# 72940 23-Feb-2001 imp

Additional enhancments to allow IBM Etherjet cards to be probed,
attached and ifconfigable. The card doesn't interrupt yet.

Also, move towards bus space by introducing new macros/inline
functions which make such a move much easier than before.

These inline functions are setup now to work around an IBM EtherJet
pccard cardbus bridge incompatibility. The card works in 8 bit mode,
but not in 16-bit mode when it is connected to a cardbus bridge for
reasons unknown. The Linux driver also has a similar workaround in
it.

Future work will include making the above workaround runtime
conditional rather than compile time conditional, as well as fixing
the interrupts in pccards and converting it to bus space.


# 71316 21-Jan-2001 imp

Break the isa attachment of the Crystal Semiconductor 89x0 into two
parts: isa and pccard. The isa one is known to work with an IBM
EtherJet ISA card. The pccard one isn't known to work because the
EtherJet pccard I purchased recently arrived DOA :-(. I'll commit the
pccard.conf entry when the replacement card arrives.

I plan on MFC this in a week or two.


# 67164 15-Oct-2000 phk

Remove unneeded #include <machine/clock.h>


# 63090 13-Jul-2000 archie

Make all Ethernet drivers attach using ether_ifattach() and detach using
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


# 60536 14-May-2000 archie

Move code to handle BPF and bridging for incoming Ethernet packets out
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


# 58816 30-Mar-2000 imp

NewBus the cs driver.

Submitted by: max@rsu.ru


# 51646 25-Sep-1999 phk

Remove NBPF conditionality of bpf calls in most of our network drivers.

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.


# 50782 02-Sep-1999 peter

Stub out the old pnp code till these are converted so GENERIC builds again.


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 48645 06-Jul-1999 des

Rename bpfilter to bpf.


# 45720 16-Apr-1999 peter

Bring the 'new-bus' to the i386. This extensively changes the way the
i386 platform boots, it is no longer ISA-centric, and is fully dynamic.
Most old drivers compile and run without modification via 'compatability
shims' to enable a smoother transition. eisa, isapnp and pccard* are
not yet using the new resource manager. Once fully converted, all drivers
will be loadable, including PCI and ISA.

(Some other changes appear to have snuck in, including a port of Soren's
ATA driver to the Alpha. Soren, back this out if you need to.)

This is a checkpoint of work-in-progress, but is quite functional.

The bulk of the work was done over the last few years by Doug Rabson and
Garrett Wollman.

Approved by: core


# 43314 27-Jan-1999 dillon

Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile


# 42545 11-Jan-1999 eivind

Clean up warnings; a couple of these came because of genuine errors in
parameter passing (passing a pointer to u_short where a pointer to int
is expected), for which the bugs have been fixed.


# 41591 07-Dec-1998 archie

The "easy" fixes for compiling the kernel -Wunused: remove unreferenced static
and local variables, goto labels, and functions declared but not defined.


# 40565 22-Oct-1998 bde

Initialize isa_devtab entries for interrupt handlers in individual
device drivers, not in ioconf.c. Use a different hack in isa_device.h
so that a new config(8) is not required yet.

pc98 parts approved by: kato


# 39937 04-Oct-1998 msmith

At net-jp@jp.freebsd.org mailing list, if_cs user in Japan
reported bug.

At using tcpdump for cs interface, tcpdump only dump packet which
src or dst MAC-address is cs interface. cs interface can't look up
packet between others.

Submitted by: MIHIRA "Sanpei" Yoshiro <sanpei@sanpei.org>


# 38592 27-Aug-1998 msmith

Enable duplex autodetection if UTP media are autodetected.
Add a sysctl 'machdep.cs_recv_delay' to specify how long to wait after
receiving a packet in order to check for a subsequent (back-to-back)
packet. The cs8900 has a very small receive buffer, so this helps avoid
overflows at the cost of some extra CPU overhead.

Submitted by: Oleg Sharoiko <os@rsu.ru>, MIHIRA "Sanpei" Yoshiro <sanpei@sanpei.org>


# 38305 13-Aug-1998 msmith

Fix BNC/AUI autodetection.
Submitted by: MIHIRA "Sanpei" Yoshiro <sanpei@sanpei.org>
Submitted by: Oleg Sharoiko <os@rsu.ru>


# 38286 12-Aug-1998 bde

Removed unused includes.


# 37785 20-Jul-1998 msmith

Add the 'cs' driver for Crystal Semiconductor CS89x0 devices. This
supports PnP and if_media. I've been running a slightly older version
here for several weeks now.
Submitted by: Maxim Bolotin <max@rsu.ru>