Home | History | Annotate | Download | only in pci
History log of /src/sys/dev/pci/if_kse.c
RevisionDateAuthorComments
 1.59  24-Sep-2022  thorpej Remove unnecessary include of <sys/malloc.h>.
 1.58  31-Dec-2021  riastradh sys: Use if_init wrapper function.

Exception: Not in kern_pmf.c, for the kind of silly reason that it
avoids having kern_pmf.c refer to symbols defined only in net; this
avoids a pain in the rump.
 1.57  08-May-2021  thorpej Use pci_compatible_match().
 1.56  20-Sep-2020  nisimura branches: 1.56.6;

- rectify nonsense and bugs around statistics counter managment.
- scoop up counter values in one second interval comsolidating with phy_tick.
- reformat register definitions for ease to see.
 1.55  20-Sep-2020  nisimura guard statistics gathering callout with #ifdef
 1.54  20-Sep-2020  nisimura be more cautious about error exit path. nuke unused variables
 1.53  01-Apr-2020  nisimura insert missing ETHER_UNLOCK()
 1.52  01-Apr-2020  nisimura switch to use ETHER_F_ALLMULTI flag
 1.51  24-Mar-2020  nisimura nuke <sys/queue.h> and reorder #include
 1.50  02-Mar-2020  nisimura minor knits in mcast handling.
 1.49  17-Feb-2020  nisimura comment mods and code tiddy ups
 1.48  04-Feb-2020  skrll Adopt <net/if_stats.h>
 1.47  06-Jan-2020  nisimura branches: 1.47.2;
correct bogus comparison. pointed by msaitoh@
 1.46  14-Dec-2019  nisimura use FC enable bit for 8842 host port
 1.45  12-Dec-2019  nisimura use additional MAC addresses to accept mcast
 1.44  03-Dec-2019  nisimura streamline receive filter logic, work-in-progress.
 1.43  29-Nov-2019  nisimura switch to deferred if_start framework.
 1.42  26-Nov-2019  nisimura - use mii(4) layer to control KSZ8841 builtin PHY.
- handle PAUSE flow control properly according to ifconfig(8) mediaopt
selection.
- some style knits; use aprint(9) and modernise callout(9).
 1.41  07-Nov-2019  nisimura comment touchup
 1.40  07-Nov-2019  nisimura clarify 8842 MAC behaves 100FDX only has no alternative media selection
possible.
 1.39  06-Nov-2019  nisimura major rework to fix link control breakage
 1.38  29-May-2019  msaitoh branches: 1.38.2;
Even if we don't use MII(4), use the common path of SIOC[GS]IFMEDIA in
sys/net/if_ethersubr.c if we can.
- Add ec_ifmedia into struct ethercom.
- ec_mii in struct ethercom is kept and used as it is. It might be used in
future. Note that some Ethernet drivers which _DOESN'T_ use mii(4) use
ec_mii for keeping the if_media. Those should be changed in future.
 1.37  28-May-2019  msaitoh Use ETHER_LOCK()/ETHER_UNLOCK() for all ethernet drivers to protect ec_multi*.
 1.36  23-May-2019  msaitoh -No functional change:
- Simplify struct ethercom's pointer near ETHER_FIRST_MULTI().
- Simplify MII structure initialization.
- u_int*_t -> uint*_t.
- KNF
 1.35  26-Apr-2019  msaitoh No functional change:
- u_int_{8,16,32}_t -> uint_{8,16,32}_t
- KNF.
- Tabify.
- Remove extra space.
 1.34  09-Dec-2018  jdolecek use pci_intr_establish_xname() everywhere
 1.33  18-Jul-2018  sevan Be consistent among ethernet drivers on the convention for printing ethernet
addresses.

NFC
 1.32  26-Jun-2018  msaitoh branches: 1.32.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.31  15-Dec-2016  ozaki-r branches: 1.31.14;
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.30  10-Jun-2016  ozaki-r branches: 1.30.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.29  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.28  16-Jun-2014  msaitoh branches: 1.28.4;
IFM_FDX and IFM_HDX use different bit, so set IFM_HDX bit if it's not full
duplex. For many drivers, it recognize half duplex if IFM_FDX isn't set,
but not for others. Same as {Free|Open}BSD.
 1.27  29-Mar-2014  christos branches: 1.27.2;
make pci_intr_string and eisa_intr_string take a buffer and a length
instead of relying in local static storage.
 1.26  25-Mar-2014  christos kill sprintf
 1.25  08-Nov-2013  nisimura move EVCNT only variable inside #ifdef
 1.24  30-Mar-2013  christos branches: 1.24.4;
remove trailing whitespace
 1.23  27-Oct-2012  chs split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
 1.22  05-Apr-2010  joerg branches: 1.22.8; 1.22.14; 1.22.18;
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.21  19-Jan-2010  pooka branches: 1.21.2; 1.21.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.20  26-Nov-2009  njoly Cleanup interrupt establish error messages. Do not mix
aprint_error/aprint_normal/printf calls for a single line.
 1.19  12-May-2009  cegger use device_private().
"looks good" ad@
XXX for the device_t/softc split, please check the driver that no cases have been missed.
 1.18  06-May-2009  cegger struct device * -> device_t, no functional changes intended.
 1.17  06-May-2009  cegger struct cfdata * -> cfdata_t, no functional changes intended.
 1.16  14-Mar-2009  dsl Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
 1.15  26-May-2008  nisimura branches: 1.15.6; 1.15.12;
- assign 2 clause TNF license to the files cited as my ownership.
- abandon and remove my copyright notice from the three files were
copied in order to adapt HW I don't have; pvr.c, pm.c and stic.c
 1.14  10-Apr-2008  cegger branches: 1.14.2; 1.14.4; 1.14.6;
use aprint_*_dev and device_xname
 1.13  11-Mar-2008  dyoung Prepare for PMF self-suspension: in the if_stop() methods, clear
IFF_UP and IFF_RUNNING before running the 'disable' step, instead
of after. Soon I will handle the 'disable' step by calling into
PMF, which may call if_stop(, 0). Ordinarily, that is harmless.
This change lets the if_stop() routines exit early when they find
on entry that IFF_RUNNING is not set.
 1.12  07-Feb-2008  dyoung branches: 1.12.2; 1.12.6;
Start patching up the kernel so that a network driver always has
the opportunity to handle an ioctl before generic ifioctl handling
occurs. This will ease extending the kernel and sharing of code
between drivers.

First steps: Make the signature of ifioctl_common() match struct
ifinet->if_ioctl. Convert SIOCSIFCAP and SIOCSIFMTU to the new
ifioctl() regime, throughout the kernel.
 1.11  16-Nov-2007  nisimura reduce Tx/Rx maximum number of words (as PDF says) in one DMA
transaction to 8. value 32 triggers occational watchdog() Tx
timeout when higher system load. This symptom is observed in
ipforwarding across two PCI devices case so far, and it remains
unidentified what really happens for Tx DMA activity. 16 seems
ok, 8 is conservative and heuristic value. may need more adjustment
work in other parts.
 1.10  19-Oct-2007  ad branches: 1.10.2;
machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h
 1.9  19-Oct-2007  nisimura - fix an error when retriving two 16bit halves of 29bit stat value.
- port3 counters are found exist and in fact working as 0x102/0x105.
 1.8  19-Oct-2007  nisimura - add multicast Rx hash table feature.
- distinguish 8842 from 8841. 8842 now keeps media selection "auto"
and indicates "up 100baseTX-FDX flow" when either of two ports has
a valid link. There is no provision to see and control the two this
moment and their media selections remain in "auto" all the time. This
arrangement is considered acceptable since 8842's external ports are
connected with the internal EMAC via managed 3 port Ethernet switch.
- 8841 behaves a plain stanadrd 10/100 EMAC with standard media
selection feature.
- gather MIB statistics counter values with evcnt(8) framework.
- increase Tx/Rx DMA DMA burst transfer size from 16 to 32.
 1.7  14-Oct-2007  nisimura branches: 1.7.2;
fix typos about a pair of multicast hash table registers.
 1.6  14-Oct-2007  nisimura add multicast filter support; either to use HW hash table lookup
filter or to accept any mcast frames.
 1.5  07-Oct-2007  nisimura A typo fix in one of comments and some adjustments of register field names.
No functionality change intented.

IHAE "IP Header Alignment Enable" feature of RXC register;
- careful cross referencing at KSZ8692P/8841P/8842P PDFs indicates IHEA
bit works as follows; When the feature is turned on, Rx DMA engine
will populate Rx frame data in the Rx memory with +2 or +3 byte swifted
to make its IP head field 32bit aligned. The shift amount is recorded
inside RDES0 to tell 0, 2 or 3. The automatic alignment is done only
when IHAE is enabled _and_ the Rx frame was IP frame. In other cases,
RDES0 swift amount field keeps 0.
- KSZ8841P document mentions the IHAE bit but its reference link is broken
to tell the new RDES0 field. KSZ8842P lacks both. The bit usage of
RDES0 23:20 seems different from KSZ8692P, which brings me a vague
suspiction of documentation error.
 1.4  09-Jul-2007  ad branches: 1.4.6; 1.4.8; 1.4.10;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.3  04-Mar-2007  christos branches: 1.3.2; 1.3.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.2  29-Sep-2006  tsutsui branches: 1.2.4; 1.2.6;
- trim CRC off rather than setting M_HASFCS
- use appropriate types instead of `unsigned'
 1.1  30-Jun-2006  nisimura branches: 1.1.2; 1.1.6; 1.1.8; 1.1.10; 1.1.12;
Add kse(4) driver for Micrel KSZ8842/8841 Ethernet controller.
 1.1.12.1  22-Oct-2006  yamt sync with head
 1.1.10.2  09-Sep-2006  rpaulo sync with head
 1.1.10.1  30-Jun-2006  rpaulo file if_kse.c was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:52:17 +0000
 1.1.8.1  18-Nov-2006  ad Sync with head.
 1.1.6.2  11-Aug-2006  yamt sync with head
 1.1.6.1  30-Jun-2006  yamt file if_kse.c was added on branch yamt-pdpolicy on 2006-08-11 15:44:25 +0000
 1.1.2.2  13-Jul-2006  gdamore Merge from HEAD.
 1.1.2.1  30-Jun-2006  gdamore file if_kse.c was added on branch gdamore-uart on 2006-07-13 17:49:27 +0000
 1.2.6.1  12-Mar-2007  rmind Sync with HEAD.
 1.2.4.7  17-Mar-2008  yamt sync with head.
 1.2.4.6  11-Feb-2008  yamt sync with head.
 1.2.4.5  07-Dec-2007  yamt sync with head
 1.2.4.4  27-Oct-2007  yamt sync with head.
 1.2.4.3  03-Sep-2007  yamt sync with head.
 1.2.4.2  30-Dec-2006  yamt sync with head.
 1.2.4.1  29-Sep-2006  yamt file if_kse.c was added on branch yamt-lazymbuf on 2006-12-30 20:48:44 +0000
 1.3.4.1  11-Jul-2007  mjf Sync with head.
 1.3.2.3  23-Oct-2007  ad Sync with head.
 1.3.2.2  09-Oct-2007  ad Sync with head.
 1.3.2.1  01-Jul-2007  ad Adapt to callout API change.
 1.4.10.2  18-Oct-2007  yamt sync with head.
 1.4.10.1  14-Oct-2007  yamt sync with head.
 1.4.8.3  23-Mar-2008  matt sync with HEAD
 1.4.8.2  09-Jan-2008  matt sync with HEAD
 1.4.8.1  06-Nov-2007  matt sync with HEAD
 1.4.6.3  21-Nov-2007  joerg Sync with HEAD.
 1.4.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.4.6.1  07-Oct-2007  joerg Sync with HEAD.
 1.7.2.2  18-Nov-2007  bouyer Sync with HEAD
 1.7.2.1  25-Oct-2007  bouyer Sync with HEAD.
 1.10.2.2  18-Feb-2008  mjf Sync with HEAD.
 1.10.2.1  19-Nov-2007  mjf Sync with HEAD.
 1.12.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.12.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.12.2.1  24-Mar-2008  keiichi sync with head.
 1.14.6.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.14.4.4  11-Aug-2010  yamt sync with head.
 1.14.4.3  11-Mar-2010  yamt sync with head
 1.14.4.2  16-May-2009  yamt sync with head
 1.14.4.1  04-May-2009  yamt sync with head.
 1.14.2.1  04-Jun-2008  yamt sync with head
 1.15.12.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.15.6.1  28-Apr-2009  skrll Sync with HEAD.
 1.21.4.1  30-May-2010  rmind sync with head
 1.21.2.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.22.18.4  03-Dec-2017  jdolecek update from HEAD
 1.22.18.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.22.18.2  23-Jun-2013  tls resync from head
 1.22.18.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.22.14.1  09-Nov-2014  martin Pull up following revision(s) (requested by msaitoh in ticket #1189):
sys/dev/pci/if_wm.c: revision 1.270
sys/dev/mii/inphy.c: revision 1.53
sys/dev/mii/glxtphy.c: revision 1.24
sys/dev/mii/tlphy.c: revision 1.62
sys/dev/mii/iophy.c: revision 1.37
sys/dev/mii/brgphy.c: revision 1.70
sys/dev/mii/ihphy.c: revision 1.8
sys/dev/mii/bmtphy.c: revision 1.31
sys/dev/mii/urlphy.c: revision 1.30
sys/dev/mii/makphy.c: revision 1.40
sys/dev/mii/qsphy.c: revision 1.48
sys/dev/mii/igphy.c: revision 1.23
sys/dev/mii/nsphy.c: revision 1.58
sys/dev/mii/mvphy.c: revision 1.10
sys/dev/pci/if_txp.c: revision 1.41
sys/dev/mii/nsphy.c: revision 1.59
sys/dev/mii/rlphy.c: revision 1.28
sys/dev/mii/icsphy.c: revision 1.49
sys/dev/mii/rlphy.c: revision 1.29
sys/dev/mii/lxtphy.c: revision 1.49
sys/dev/mii/ciphyreg.h: revision 1.5
sys/dev/mii/nsphyter.c: revision 1.38
sys/dev/mii/sqphy.c: revision 1.50
sys/dev/mii/gentbi.c: revision 1.26
sys/dev/mii/gentbi.c: revision 1.27
sys/dev/mii/tqphy.c: revision 1.39
sys/dev/mii/ikphy.c: revision 1.10
sys/dev/mii/dmphy.c: revision 1.35
sys/dev/mii/amhphy.c: revision 1.20
sys/dev/mii/acphy.c: revision 1.24
sys/dev/mii/ciphy.c: revision 1.25
sys/dev/mii/brgphyreg.h: revision 1.8
sys/dev/mii/ukphy_subr.c: revision 1.12
sys/dev/ic/rtl80x9.c: revision 1.16
sys/arch/mips/adm5120/dev/if_admsw.c: revision 1.12
sys/dev/pci/if_kse.c: revision 1.28
sys/dev/mii/ukphy_subr.c: revision 1.13
sys/dev/mii/mii.h: revision 1.18
sys/dev/mii/gphyter.c: revision 1.29
No functional change:
- Fix typo.
- Remove trailing white spaces.
- Capitalize comments.
- Tabify.
- KNF.
IFM_FDX and IFM_HDX use different bit, so set IFM_HDX bit if it's not full
duplex. For many drivers, it recognize half duplex if IFM_FDX isn't set,
but not for others. Same as {Free|Open}BSD.
 1.22.8.2  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.22.8.1  30-Oct-2012  yamt sync with head
 1.24.4.1  18-May-2014  rmind sync with head
 1.27.2.1  10-Aug-2014  tls Rebase.
 1.28.4.3  05-Feb-2017  skrll Sync with HEAD
 1.28.4.2  09-Jul-2016  skrll Sync with HEAD
 1.28.4.1  19-Mar-2016  skrll Sync with HEAD
 1.30.2.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.31.14.2  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.31.14.1  28-Jul-2018  pgoyette Sync with HEAD
 1.32.2.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.32.2.1  10-Jun-2019  christos Sync with HEAD
 1.38.2.1  10-Nov-2019  martin Pull up following revision(s) (requested by nisimura in ticket #406):

sys/dev/pci/if_kse.c: revision 1.40
sys/dev/pci/if_kse.c: revision 1.41
sys/dev/pci/if_kse.c: revision 1.39

comment touchup

-

clarify 8842 MAC behaves 100FDX only has no alternative media selection
possible.

-

major rework to fix link control breakage
 1.47.2.1  29-Feb-2020  ad Sync with head.
 1.56.6.1  13-May-2021  thorpej Sync with HEAD.

RSS XML Feed