Home | History | Annotate | Download | only in ic
History log of /src/sys/dev/ic/dp83932.c
RevisionDateAuthorComments
 1.50  29-Jun-2024  riastradh if_stats(9): Add ifp argument to if_stat..._ref.

This will enable us to pass the ifp through to a dtrace probe inside.

No functional change intended in this change, but this is an API
change visible to modules so it shouldn't be pulled up.

PR kern/58377
 1.49  25-Sep-2022  thorpej Remove unnecessary include of <sys/malloc.h>.
 1.48  25-Jun-2022  tsutsui Pass proper status values to rnd_add_uint32(9) as rnd(9) man page claims.
 1.47  20-Feb-2021  rin sn(4): Add rnd(9) support.
 1.46  15-Mar-2020  thorpej branches: 1.46.4;
Don't bother with IFF_OACTIVE.
 1.45  29-Jan-2020  thorpej Adopt <net/if_stats.h>.
 1.44  28-May-2019  msaitoh branches: 1.44.4;
Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.
 1.43  23-May-2019  msaitoh -No functional change:
- KNF
- u_int*_t -> uint*_t.
 1.42  26-Jun-2018  msaitoh branches: 1.42.2;
Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
 1.41  29-Jul-2017  riastradh branches: 1.41.2;
Plug mbuf leak on MCLGET failure in sonic_rxintr.

From Ilja Van Sprundel.
 1.40  23-May-2017  ozaki-r branches: 1.40.2;
Apply deferred if_start to more drivers

And annotate some XXX_start as it runs in softint to clarify that
it doesn't need deferred if_start.
 1.39  15-Dec-2016  ozaki-r Move bpf_mtap and if_ipackets++ on Rx of each driver to percpuq if_input

The benefits of the change are:
- We can reduce codes
- We can provide the same behavior between drivers
- Where/When if_ipackets is counted up
- Note that some drivers still update packet statistics in their own
way (periodical update)
- Moved bpf_mtap run in softint
- This makes it easy to MP-ify bpf

Proposed on tech-kern and tech-net
 1.38  10-Jun-2016  ozaki-r branches: 1.38.2;
Introduce m_set_rcvif and m_reset_rcvif

The API is used to set (or reset) a received interface of a mbuf.
They are counterpart of m_get_rcvif, which will come in another
commit, hide internal of rcvif operation, and reduce the diff of
the upcoming change.

No functional change.
 1.37  09-Feb-2016  ozaki-r Introduce softint-based if_input

This change intends to run the whole network stack in softint context
(or normal LWP), not hardware interrupt context. Note that the work is
still incomplete by this change; to that end, we also have to softint-ify
if_link_state_change (and bpf) which can still run in hardware interrupt.

This change softint-ifies at ifp->if_input that is called from
each device driver (and ieee80211_input) to ensure Layer 2 runs
in softint (e.g., ether_input and bridge_input). To this end,
we provide a framework (called percpuq) that utlizes softint(9)
and percpu ifqueues. With this patch, rxintr of most drivers just
queues received packets and schedules a softint, and the softint
dequeues packets and does rest packet processing.

To minimize changes to each driver, percpuq is allocated in struct
ifnet for now and that is initialized by default (in if_attach).
We probably have to move percpuq to softc of each driver, but it's
future work. At this point, only wm(4) has percpuq in its softc
as a reference implementation.

Additional information including performance numbers can be found
in the thread at tech-kern@ and tech-net@:
http://mail-index.netbsd.org/tech-kern/2016/01/14/msg019997.html

Acknowledgment: riastradh@ greatly helped this work.
Thank you very much!
 1.36  25-Oct-2013  martin branches: 1.36.4; 1.36.6; 1.36.8; 1.36.12;
Remove unused stuff
 1.35  13-Nov-2010  uebayasi branches: 1.35.8; 1.35.14; 1.35.18; 1.35.20; 1.35.22; 1.35.28;
Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants. These are provided by sys/param.h now.
 1.34  05-Apr-2010  joerg Push the bpf_ops usage back into bpf.h. Push the common ifp->if_bpf
check into the inline functions as well the fourth argument for
bpf_attach.
 1.33  19-Jan-2010  pooka branches: 1.33.2; 1.33.4;
Redefine bpf linkage through an always present op vector, i.e.
#if NBPFILTER is no longer required in the client. This change
doesn't yet add support for loading bpf as a module, since drivers
can register before bpf is attached. However, callers of bpf can
now be modularized.

Dynamically loadable bpf could probably be done fairly easily with
coordination from the stub driver and the real driver by registering
attachments in the stub before the real driver is loaded and doing
a handoff. ... and I'm not going to ponder the depths of unload
here.

Tested with i386/MONOLITHIC, modified MONOLITHIC without bpf and rump.
 1.32  02-Sep-2009  tsutsui Use a proper local variable.
 1.31  02-Sep-2009  tsutsui Make local functions static.
 1.30  02-Sep-2009  tsutsui Invert logic around nested pmf(9) registrations for readability.
 1.29  01-Sep-2009  tsutsui Also call pmf_class_network_register(9).
 1.28  01-Sep-2009  tsutsui Replace shutdownhook_establish(9) with pmf_device_register1(9).
 1.27  23-Aug-2008  tsutsui Fix typo in comment.
 1.26  28-Apr-2008  martin branches: 1.26.2; 1.26.6;
Remove clause 3 and 4 from TNF licenses
 1.25  23-Apr-2008  tsutsui branches: 1.25.2;
Split softc/device_t and misc cleanup for sn(4).
 1.24  19-Apr-2008  tsutsui The DP83932C manual says the CAM enable register (CER) can't be
accessed on normal operations and the CER should be set up
through the last entry in the CAM desciptor area and loaded
via LCAM command, so make our driver do so, though the previoius
code (writing CER directly) worked without problems.

Tested on sn at jazzio on arc (in 32bit mode) by me and
sn at nubus on mac68k (in 16bit mode) by Paul Ripke on port-mac68k.
 1.23  08-Apr-2008  cegger branches: 1.23.2;
use aprint_*_dev and device_xname
 1.22  14-Mar-2008  tsutsui Enable ETHERCAP_VLAN_MTU.
 1.21  12-Mar-2008  dyoung sonic_stop: clear IFF_RUNNING before disabling.
 1.20  19-Jan-2008  dyoung branches: 1.20.2; 1.20.6;
There is really no use for switch when there is no case labels
except for the default, so remove the enclosing switch and the
default label.
 1.19  19-Oct-2007  ad branches: 1.19.2; 1.19.8;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.18  26-Aug-2007  dyoung branches: 1.18.2; 1.18.6;
Constify: LLADDR -> CLLADDR. I'm aiming here to make it easier to
identify sockaddr_dl abuse that remains in the kernel, especially
the potential for overwriting memory past the end of a sockaddr_dl
with, e.g., memcpy(LLADDR(), ...).
 1.17  08-Jun-2007  tsutsui branches: 1.17.2; 1.17.6;
Set DCR_TFT[01] and DCR_RFT[01] bits of DCR register for TX/RX thresholds
in each MD attachment since optimized values could be machine dependent.
 1.16  02-Jun-2007  tsutsui In sonic_reset(), make sure to stop TX, RX and timer
and clear and disable all interrupts.
Required by mac68k obio sonic cards, and
no bad side effect on arc jazzio sonic.
 1.15  02-Jun-2007  tsutsui Sync tda_status and rda_status DMA descriptors also after they are polled
in interrupt handlers for systems which don't have BUS_DMA_COHERENT support.
 1.14  04-Mar-2007  christos branches: 1.14.2; 1.14.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.13  11-Dec-2005  christos branches: 1.13.26;
merge ktrace-lwp.
 1.12  27-Feb-2005  perry branches: 1.12.4;
nuke trailing whitespace
 1.11  31-Jan-2005  thorpej Eliminate use of M_HASFCS.
 1.10  30-Oct-2004  thorpej branches: 1.10.4; 1.10.6;
When adding/deleting multicast addresses, only whack the address
filter if the interface is marked RUNNING.

Fixes kern/27678.
 1.9  29-Oct-2003  tsutsui branches: 1.9.4;
Fix bogus GCC uninitialized variable warning.
 1.8  18-Jan-2003  tsutsui branches: 1.8.2;
When the extra pad buffer is used, the number of TX segments
should be incremented than dm_nsegs.
 1.7  18-Jan-2003  tsutsui Fix pasto and typos.
 1.6  15-Jan-2003  bouyer Use a properly zero'd buffer to pad the packet to ETHER_MIN_LEN-ETHER_CRC_LEN
 1.5  13-Nov-2001  lukem branches: 1.5.10;
add/cleanup RCSID
 1.4  23-Jul-2001  tsutsui branches: 1.4.2;
Make sure to initialize the all Rx descriptors properly in sonic_init()
even if mbuf for them are already allocated.
This fixes "receive descriptor exhausted" errors.
 1.3  19-Jul-2001  thorpej Use BUS_DMA_READ and BUS_DMA_WRITE in some obvious places.
 1.2  05-Jul-2001  thorpej branches: 1.2.2;
Do a little manual CSE, taking unneeded comparisons out of loops,
and shrinking the object code somewhat. On an R4400:

Before:
text data bss dec hex filename
16248 16 0 16264 3f88 dp83932.o

Before:
text data bss dec hex filename
14424 16 0 14440 3868 dp83932.o
 1.1  05-Jul-2001  thorpej A new DP83932 ``SONIC'' driver, which uses bus_dma(9) and does I/O
directly to mbufs. Handles both 32-bit and 16-bit, big- and little-
endian configurations of the chip (we could squeeze out some conditionals
yet, though).
 1.2.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.2.2.1  03-Aug-2001  lukem update to -current
 1.4.2.4  17-Jan-2003  thorpej Sync with HEAD.
 1.4.2.3  14-Nov-2001  nathanw Catch up to -current.
 1.4.2.2  24-Aug-2001  nathanw Catch up with -current.
 1.4.2.1  23-Jul-2001  nathanw file dp83932.c was added on branch nathanw_sa on 2001-08-24 00:09:21 +0000
 1.5.10.1  26-Jan-2003  he Pull up revisions 1.6-1.8 (requested by bouyer in ticket #1084):
Use a properly zeroed buffer to pad small packets to make sure
the chip doesn't send random data.
 1.8.2.6  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.8.2.5  04-Feb-2005  skrll Sync with HEAD.
 1.8.2.4  02-Nov-2004  skrll Sync with HEAD.
 1.8.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.8.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.8.2.1  03-Aug-2004  skrll Sync with HEAD
 1.9.4.1  24-Jan-2005  he Pull up revision 1.10 (requested by thorpej in ticket #939):
When adding or deleting multicast addresses, only change
the address filter if the interface is marked RUNNING.
Fixes PR#27678.
 1.10.6.2  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.10.6.1  12-Feb-2005  yamt sync with head.
 1.10.4.1  29-Apr-2005  kent sync with -current
 1.12.4.4  17-Mar-2008  yamt sync with head.
 1.12.4.3  21-Jan-2008  yamt sync with head
 1.12.4.2  27-Oct-2007  yamt sync with head.
 1.12.4.1  03-Sep-2007  yamt sync with head.
 1.13.26.1  12-Mar-2007  rmind Sync with HEAD.
 1.14.4.1  11-Jul-2007  mjf Sync with head.
 1.14.2.4  23-Oct-2007  ad Sync with head.
 1.14.2.3  09-Oct-2007  ad Sync with head.
 1.14.2.2  15-Jul-2007  ad Sync with head.
 1.14.2.1  09-Jun-2007  ad Sync with head.
 1.17.6.2  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.17.6.1  03-Sep-2007  jmcneill Sync with HEAD.
 1.17.2.1  03-Sep-2007  skrll Sync with HEAD.
 1.18.6.1  25-Oct-2007  bouyer Sync with HEAD.
 1.18.2.2  23-Mar-2008  matt sync with HEAD
 1.18.2.1  06-Nov-2007  matt sync with HEAD
 1.19.8.1  20-Jan-2008  bouyer Sync with HEAD
 1.19.2.1  18-Feb-2008  mjf Sync with HEAD.
 1.20.6.3  28-Sep-2008  mjf Sync with HEAD.
 1.20.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.20.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.20.2.1  24-Mar-2008  keiichi sync with head.
 1.23.2.1  18-May-2008  yamt sync with head.
 1.25.2.5  11-Aug-2010  yamt sync with head.
 1.25.2.4  11-Mar-2010  yamt sync with head
 1.25.2.3  16-Sep-2009  yamt sync with head
 1.25.2.2  04-May-2009  yamt sync with head.
 1.25.2.1  16-May-2008  yamt sync with head.
 1.26.6.1  19-Oct-2008  haad Sync with HEAD.
 1.26.2.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.33.4.2  05-Mar-2011  rmind sync with head
 1.33.4.1  30-May-2010  rmind sync with head
 1.33.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.35.28.1  18-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1476):
sys/dev/ic/dp83932.c: revision 1.41
Plug mbuf leak on MCLGET failure in sonic_rxintr.
From Ilja Van Sprundel.
 1.35.22.1  18-May-2014  rmind sync with head
 1.35.20.1  18-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1476):
sys/dev/ic/dp83932.c: revision 1.41
Plug mbuf leak on MCLGET failure in sonic_rxintr.
From Ilja Van Sprundel.
 1.35.18.2  03-Dec-2017  jdolecek update from HEAD
 1.35.18.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.35.14.1  18-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1476):
sys/dev/ic/dp83932.c: revision 1.41
Plug mbuf leak on MCLGET failure in sonic_rxintr.
From Ilja Van Sprundel.
 1.35.8.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.36.12.1  12-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1472):
sys/dev/ic/dp83932.c: revision 1.41
Plug mbuf leak on MCLGET failure in sonic_rxintr.
From Ilja Van Sprundel.
 1.36.8.1  12-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1472):
sys/dev/ic/dp83932.c: revision 1.41
Plug mbuf leak on MCLGET failure in sonic_rxintr.
From Ilja Van Sprundel.
 1.36.6.4  28-Aug-2017  skrll Sync with HEAD
 1.36.6.3  05-Feb-2017  skrll Sync with HEAD
 1.36.6.2  09-Jul-2016  skrll Sync with HEAD
 1.36.6.1  19-Mar-2016  skrll Sync with HEAD
 1.36.4.1  12-Aug-2017  snj Pull up following revision(s) (requested by mrg in ticket #1472):
sys/dev/ic/dp83932.c: revision 1.41
Plug mbuf leak on MCLGET failure in sonic_rxintr.
From Ilja Van Sprundel.
 1.38.2.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.40.2.1  05-Aug-2017  snj Pull up following revision(s) (requested by spz in ticket #185):
sys/dev/ic/dp83932.c: revision 1.41
Plug mbuf leak on MCLGET failure in sonic_rxintr.
From Ilja Van Sprundel.
 1.41.2.1  28-Jul-2018  pgoyette Sync with HEAD
 1.42.2.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.42.2.1  10-Jun-2019  christos Sync with HEAD
 1.44.4.1  29-Feb-2020  ad Sync with head.
 1.46.4.1  03-Apr-2021  thorpej Sync with HEAD.

RSS XML Feed