History log of /openbsd-current/sys/dev/ic/mtd8xx.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.35 09-Jan-2022 jsg

spelling
feedback and ok tb@ jmc@ ok ratchov@


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.34 07-Mar-2021 jsg

ansi


Revision tags: OPENBSD_6_8_BASE
# 1.33 10-Jul-2020 patrick

Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.

ok dlg@ tobhe@


# 1.32 10-Jul-2020 patrick

Change users of IFQ_DEQUEUE(), IFQ_ENQUEUE() and IFQ_LEN() to use the
"new" API.

ok dlg@ tobhe@


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.31 22-Jan-2017 dlg

move counting if_opackets next to counting if_obytes in if_enqueue.

this means packets are consistently counted in one place, unlike the
many and various ways that drivers thought they should do it.

ok mpi@ deraadt@


Revision tags: OPENBSD_6_0_BASE
# 1.30 13-Apr-2016 mpi

G/C IFQ_SET_READY().


Revision tags: OPENBSD_5_9_BASE
# 1.29 25-Nov-2015 dlg

replace IFF_OACTIVE manipulation with mpsafe operations.

there are two things shared between the network stack and drivers
in the send path: the send queue and the IFF_OACTIVE flag. the send
queue is now protected by a mutex. this diff makes the oactive
functionality mpsafe too.

IFF_OACTIVE is part of if_flags. there are two problems with that.
firstly, if_flags is a short and we dont have any MI atomic operations
to manipulate a short. secondly, while we could make the IFF_OACTIVE
operates mpsafe, all changes to other flags would have to be made
safe at the same time, otherwise a read-modify-write cycle on their
updates could clobber the oactive change.

instead, this moves the oactive mark into struct ifqueue and provides
an API for changing it. there's ifq_set_oactive, ifq_clr_oactive,
and ifq_is_oactive. these are modelled on ifsq_set_oactive,
ifsq_clr_oactive, and ifsq_is_oactive in dragonflybsd.

this diff includes changes to all the drivers manipulating IFF_OACTIVE
to now use the ifsq_{set,clr_is}_oactive API too.

ok kettenis@ mpi@ jmatthew@ deraadt@


# 1.28 25-Oct-2015 mpi

arp_ifinit() is no longer needed.


Revision tags: OPENBSD_5_8_BASE
# 1.27 24-Jun-2015 mpi

Increment if_ipackets in if_input().

Note that pseudo-drivers not using if_input() are not affected by this
conversion.

ok mikeb@, kettenis@, claudio@, dlg@


# 1.26 13-Apr-2015 mpi

Now that if_input() set the receiving interface pointer on mbufs for us
there's no need to do it in m_devget(9).

Stop passing an ``ifp'' will help for upcoming interface pointer -> index
conversion.

While here remove unused ``ifp'' argument from m_clget(9) and kill two
birds^W layer violations in one commit.

ok henning@


# 1.25 08-Apr-2015 mpi

Convert to if_input().

ok dlg@


Revision tags: OPENBSD_5_7_BASE
# 1.24 22-Dec-2014 tedu

unifdef INET


# 1.23 08-Dec-2014 brad

Have foo_init() call foo_reset() to reset the chip to a known state
as is the case for a lot of the other drivers. Remove some redundant
calls to foo_stop() and foo_reset() before foo_init().

Tested with DP83815, 3c905C, 8139 and ST201.
Mostly from FreeBSD.


# 1.22 06-Sep-2014 jsg

reduce the amount of pci includes


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.21 26-Nov-2013 mpi

Instead of comparing the lower and higher addresses of all the multicast
entries to decide if the IFF_ALLMULTI flag should be set, check if there
is at least one real range between them.

This should not change the behavior of any driver but if you encounter
any problem, feel free to revert the offending chunk and ping me about
it.

ok naddy@, dlg@


# 1.20 21-Aug-2013 dlg

get rid of the copy argument in m_devget that let you provide an
alternative to bcopy since noone uses it.

while there use memcpy instead of bcopy because we know the memory cannot
overlap.

ok henning@ matthew@ mikeb@ deraadt@


Revision tags: OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.19 29-Nov-2012 brad

Remove setting an initial assumed baudrate upon driver attach which is not
necessarily correct, there might not even be a link when attaching.

ok mikeb@ reyk@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
# 1.18 21-Jun-2011 tedu

remove some unnecessary casts. ok blambert deraadt kettenis matthew


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.17 19-May-2010 oga

BUS_DMA_ZERO instead of alloc, map, bzero.

ok krw@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.16 28-Nov-2008 brad

Eliminate the redundant bits of code for MTU and multicast handling
from the individual drivers now that ether_ioctl() handles this.

Shrinks the i386 kernels by..
RAMDISK - 2176 bytes
RAMDISKB - 1504 bytes
RAMDISKC - 736 bytes

Tested by naddy@/okan@/sthen@/brad@/todd@/jmc@ and lots of users.
Build tested on almost all archs by todd@/brad@

ok naddy@


# 1.15 14-Oct-2008 naddy

Change m_devget()'s outdated and unused "offset" argument: It is
now the offset into the first mbuf of the target chain before copying
the source data over. From FreeBSD.

Convert drivers' use of m_devget(). Mostly from thib@.

Update mbuf(9) man page.

ok claudio@, thib@


# 1.14 02-Oct-2008 brad

First step towards cleaning up the Ethernet driver ioctl handling.
Move calling ether_ioctl() from the top of the ioctl function, which
at the moment does absolutely nothing, to the default switch case.
Thus allowing drivers to define their own ioctl handlers and then
falling back on ether_ioctl(). The only functional change this results
in at the moment is having all Ethernet drivers returning the proper
errno of ENOTTY instead of EINVAL/ENXIO when encountering unknown
ioctl's.

Shrinks the i386 kernels by..
RAMDISK - 1024 bytes
RAMDISKB - 1120 bytes
RAMDISKC - 832 bytes

Tested by martin@/jsing@/todd@/brad@
Build tested on almost all archs by todd@/brad@

ok jsing@


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.13 26-Nov-2007 martynas

typos; ok jmc@
sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@
sys/dev/pci/bktr/* ok jakemsr@


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.12 25-Mar-2006 djm

allow bpf(4) to ignore packets based on their direction (inbound or
outbound), using a new BIOCSDIRFILT ioctl;
guidance, feedback and ok canacar@


Revision tags: OPENBSD_3_9_BASE
# 1.11 19-Nov-2005 aaron

Remove superfluous statement-ending semi-colons. i.e., "return foo;;" should
just be "return foo;". Cleaning out some M's in my tree.


# 1.10 07-Nov-2005 brad

splimp -> splnet


Revision tags: OPENBSD_3_8_BASE
# 1.9 02-Jul-2005 brad

set IFCAP_VLAN_MTU and do not whine if we cannot get mbufs


Revision tags: OPENBSD_3_7_BASE
# 1.8 15-Jan-2005 brad

make sure interface is in RUNNING state before touching the multicast filters

From NetBSD

NetBSD PR 27678 for details

ok mcbride@


# 1.7 28-Sep-2004 brad

Use ETHER_MAX_DIX_LEN/ETHER_MIN_LEN


# 1.6 23-Sep-2004 brad

don't need to set ifp->if_mtu or ifp->if_output in each driver,
{ether,atm,fddi}_ifattach already does this.

ok mcbride@ markus@ henning@


Revision tags: OPENBSD_3_6_BASE SMP_SYNC_A SMP_SYNC_B
# 1.5 05-Jun-2004 mcbride

Make multicast ranges work.

ok deraadt@


# 1.4 26-May-2004 brad

use ETHER_ALIGN


Revision tags: OPENBSD_3_5_BASE
# 1.3 17-Nov-2003 espie

branches: 1.3.2;
Defined behavior.

ok grange@ miod@


# 1.2 21-Oct-2003 jmc

typos from Tom Cosgrove;

Tom: I did not commit a couple of your changes.

i did not include some punctuation fixes (full stops, etc.)
mnemorable -> mnemonic: i decided memorable was probably better
instrunctions -> instruction: i kept the plural


# 1.1 25-Sep-2003 mickey

update fom form@ including support for 891 chips and more


# 1.34 07-Mar-2021 jsg

ansi


Revision tags: OPENBSD_6_8_BASE
# 1.33 10-Jul-2020 patrick

Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.

ok dlg@ tobhe@


# 1.32 10-Jul-2020 patrick

Change users of IFQ_DEQUEUE(), IFQ_ENQUEUE() and IFQ_LEN() to use the
"new" API.

ok dlg@ tobhe@


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.31 22-Jan-2017 dlg

move counting if_opackets next to counting if_obytes in if_enqueue.

this means packets are consistently counted in one place, unlike the
many and various ways that drivers thought they should do it.

ok mpi@ deraadt@


Revision tags: OPENBSD_6_0_BASE
# 1.30 13-Apr-2016 mpi

G/C IFQ_SET_READY().


Revision tags: OPENBSD_5_9_BASE
# 1.29 25-Nov-2015 dlg

replace IFF_OACTIVE manipulation with mpsafe operations.

there are two things shared between the network stack and drivers
in the send path: the send queue and the IFF_OACTIVE flag. the send
queue is now protected by a mutex. this diff makes the oactive
functionality mpsafe too.

IFF_OACTIVE is part of if_flags. there are two problems with that.
firstly, if_flags is a short and we dont have any MI atomic operations
to manipulate a short. secondly, while we could make the IFF_OACTIVE
operates mpsafe, all changes to other flags would have to be made
safe at the same time, otherwise a read-modify-write cycle on their
updates could clobber the oactive change.

instead, this moves the oactive mark into struct ifqueue and provides
an API for changing it. there's ifq_set_oactive, ifq_clr_oactive,
and ifq_is_oactive. these are modelled on ifsq_set_oactive,
ifsq_clr_oactive, and ifsq_is_oactive in dragonflybsd.

this diff includes changes to all the drivers manipulating IFF_OACTIVE
to now use the ifsq_{set,clr_is}_oactive API too.

ok kettenis@ mpi@ jmatthew@ deraadt@


# 1.28 25-Oct-2015 mpi

arp_ifinit() is no longer needed.


Revision tags: OPENBSD_5_8_BASE
# 1.27 24-Jun-2015 mpi

Increment if_ipackets in if_input().

Note that pseudo-drivers not using if_input() are not affected by this
conversion.

ok mikeb@, kettenis@, claudio@, dlg@


# 1.26 13-Apr-2015 mpi

Now that if_input() set the receiving interface pointer on mbufs for us
there's no need to do it in m_devget(9).

Stop passing an ``ifp'' will help for upcoming interface pointer -> index
conversion.

While here remove unused ``ifp'' argument from m_clget(9) and kill two
birds^W layer violations in one commit.

ok henning@


# 1.25 08-Apr-2015 mpi

Convert to if_input().

ok dlg@


Revision tags: OPENBSD_5_7_BASE
# 1.24 22-Dec-2014 tedu

unifdef INET


# 1.23 08-Dec-2014 brad

Have foo_init() call foo_reset() to reset the chip to a known state
as is the case for a lot of the other drivers. Remove some redundant
calls to foo_stop() and foo_reset() before foo_init().

Tested with DP83815, 3c905C, 8139 and ST201.
Mostly from FreeBSD.


# 1.22 06-Sep-2014 jsg

reduce the amount of pci includes


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.21 26-Nov-2013 mpi

Instead of comparing the lower and higher addresses of all the multicast
entries to decide if the IFF_ALLMULTI flag should be set, check if there
is at least one real range between them.

This should not change the behavior of any driver but if you encounter
any problem, feel free to revert the offending chunk and ping me about
it.

ok naddy@, dlg@


# 1.20 21-Aug-2013 dlg

get rid of the copy argument in m_devget that let you provide an
alternative to bcopy since noone uses it.

while there use memcpy instead of bcopy because we know the memory cannot
overlap.

ok henning@ matthew@ mikeb@ deraadt@


Revision tags: OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.19 29-Nov-2012 brad

Remove setting an initial assumed baudrate upon driver attach which is not
necessarily correct, there might not even be a link when attaching.

ok mikeb@ reyk@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
# 1.18 21-Jun-2011 tedu

remove some unnecessary casts. ok blambert deraadt kettenis matthew


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.17 19-May-2010 oga

BUS_DMA_ZERO instead of alloc, map, bzero.

ok krw@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.16 28-Nov-2008 brad

Eliminate the redundant bits of code for MTU and multicast handling
from the individual drivers now that ether_ioctl() handles this.

Shrinks the i386 kernels by..
RAMDISK - 2176 bytes
RAMDISKB - 1504 bytes
RAMDISKC - 736 bytes

Tested by naddy@/okan@/sthen@/brad@/todd@/jmc@ and lots of users.
Build tested on almost all archs by todd@/brad@

ok naddy@


# 1.15 14-Oct-2008 naddy

Change m_devget()'s outdated and unused "offset" argument: It is
now the offset into the first mbuf of the target chain before copying
the source data over. From FreeBSD.

Convert drivers' use of m_devget(). Mostly from thib@.

Update mbuf(9) man page.

ok claudio@, thib@


# 1.14 02-Oct-2008 brad

First step towards cleaning up the Ethernet driver ioctl handling.
Move calling ether_ioctl() from the top of the ioctl function, which
at the moment does absolutely nothing, to the default switch case.
Thus allowing drivers to define their own ioctl handlers and then
falling back on ether_ioctl(). The only functional change this results
in at the moment is having all Ethernet drivers returning the proper
errno of ENOTTY instead of EINVAL/ENXIO when encountering unknown
ioctl's.

Shrinks the i386 kernels by..
RAMDISK - 1024 bytes
RAMDISKB - 1120 bytes
RAMDISKC - 832 bytes

Tested by martin@/jsing@/todd@/brad@
Build tested on almost all archs by todd@/brad@

ok jsing@


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.13 26-Nov-2007 martynas

typos; ok jmc@
sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@
sys/dev/pci/bktr/* ok jakemsr@


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.12 25-Mar-2006 djm

allow bpf(4) to ignore packets based on their direction (inbound or
outbound), using a new BIOCSDIRFILT ioctl;
guidance, feedback and ok canacar@


Revision tags: OPENBSD_3_9_BASE
# 1.11 19-Nov-2005 aaron

Remove superfluous statement-ending semi-colons. i.e., "return foo;;" should
just be "return foo;". Cleaning out some M's in my tree.


# 1.10 07-Nov-2005 brad

splimp -> splnet


Revision tags: OPENBSD_3_8_BASE
# 1.9 02-Jul-2005 brad

set IFCAP_VLAN_MTU and do not whine if we cannot get mbufs


Revision tags: OPENBSD_3_7_BASE
# 1.8 15-Jan-2005 brad

make sure interface is in RUNNING state before touching the multicast filters

From NetBSD

NetBSD PR 27678 for details

ok mcbride@


# 1.7 28-Sep-2004 brad

Use ETHER_MAX_DIX_LEN/ETHER_MIN_LEN


# 1.6 23-Sep-2004 brad

don't need to set ifp->if_mtu or ifp->if_output in each driver,
{ether,atm,fddi}_ifattach already does this.

ok mcbride@ markus@ henning@


Revision tags: OPENBSD_3_6_BASE SMP_SYNC_A SMP_SYNC_B
# 1.5 05-Jun-2004 mcbride

Make multicast ranges work.

ok deraadt@


# 1.4 26-May-2004 brad

use ETHER_ALIGN


Revision tags: OPENBSD_3_5_BASE
# 1.3 17-Nov-2003 espie

branches: 1.3.2;
Defined behavior.

ok grange@ miod@


# 1.2 21-Oct-2003 jmc

typos from Tom Cosgrove;

Tom: I did not commit a couple of your changes.

i did not include some punctuation fixes (full stops, etc.)
mnemorable -> mnemonic: i decided memorable was probably better
instrunctions -> instruction: i kept the plural


# 1.1 25-Sep-2003 mickey

update fom form@ including support for 891 chips and more


# 1.33 10-Jul-2020 patrick

Change users of IFQ_SET_MAXLEN() and IFQ_IS_EMPTY() to use the "new" API.

ok dlg@ tobhe@


# 1.32 10-Jul-2020 patrick

Change users of IFQ_DEQUEUE(), IFQ_ENQUEUE() and IFQ_LEN() to use the
"new" API.

ok dlg@ tobhe@


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE
# 1.31 22-Jan-2017 dlg

move counting if_opackets next to counting if_obytes in if_enqueue.

this means packets are consistently counted in one place, unlike the
many and various ways that drivers thought they should do it.

ok mpi@ deraadt@


Revision tags: OPENBSD_6_0_BASE
# 1.30 13-Apr-2016 mpi

G/C IFQ_SET_READY().


Revision tags: OPENBSD_5_9_BASE
# 1.29 25-Nov-2015 dlg

replace IFF_OACTIVE manipulation with mpsafe operations.

there are two things shared between the network stack and drivers
in the send path: the send queue and the IFF_OACTIVE flag. the send
queue is now protected by a mutex. this diff makes the oactive
functionality mpsafe too.

IFF_OACTIVE is part of if_flags. there are two problems with that.
firstly, if_flags is a short and we dont have any MI atomic operations
to manipulate a short. secondly, while we could make the IFF_OACTIVE
operates mpsafe, all changes to other flags would have to be made
safe at the same time, otherwise a read-modify-write cycle on their
updates could clobber the oactive change.

instead, this moves the oactive mark into struct ifqueue and provides
an API for changing it. there's ifq_set_oactive, ifq_clr_oactive,
and ifq_is_oactive. these are modelled on ifsq_set_oactive,
ifsq_clr_oactive, and ifsq_is_oactive in dragonflybsd.

this diff includes changes to all the drivers manipulating IFF_OACTIVE
to now use the ifsq_{set,clr_is}_oactive API too.

ok kettenis@ mpi@ jmatthew@ deraadt@


# 1.28 25-Oct-2015 mpi

arp_ifinit() is no longer needed.


Revision tags: OPENBSD_5_8_BASE
# 1.27 24-Jun-2015 mpi

Increment if_ipackets in if_input().

Note that pseudo-drivers not using if_input() are not affected by this
conversion.

ok mikeb@, kettenis@, claudio@, dlg@


# 1.26 13-Apr-2015 mpi

Now that if_input() set the receiving interface pointer on mbufs for us
there's no need to do it in m_devget(9).

Stop passing an ``ifp'' will help for upcoming interface pointer -> index
conversion.

While here remove unused ``ifp'' argument from m_clget(9) and kill two
birds^W layer violations in one commit.

ok henning@


# 1.25 08-Apr-2015 mpi

Convert to if_input().

ok dlg@


Revision tags: OPENBSD_5_7_BASE
# 1.24 22-Dec-2014 tedu

unifdef INET


# 1.23 08-Dec-2014 brad

Have foo_init() call foo_reset() to reset the chip to a known state
as is the case for a lot of the other drivers. Remove some redundant
calls to foo_stop() and foo_reset() before foo_init().

Tested with DP83815, 3c905C, 8139 and ST201.
Mostly from FreeBSD.


# 1.22 06-Sep-2014 jsg

reduce the amount of pci includes


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.21 26-Nov-2013 mpi

Instead of comparing the lower and higher addresses of all the multicast
entries to decide if the IFF_ALLMULTI flag should be set, check if there
is at least one real range between them.

This should not change the behavior of any driver but if you encounter
any problem, feel free to revert the offending chunk and ping me about
it.

ok naddy@, dlg@


# 1.20 21-Aug-2013 dlg

get rid of the copy argument in m_devget that let you provide an
alternative to bcopy since noone uses it.

while there use memcpy instead of bcopy because we know the memory cannot
overlap.

ok henning@ matthew@ mikeb@ deraadt@


Revision tags: OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.19 29-Nov-2012 brad

Remove setting an initial assumed baudrate upon driver attach which is not
necessarily correct, there might not even be a link when attaching.

ok mikeb@ reyk@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
# 1.18 21-Jun-2011 tedu

remove some unnecessary casts. ok blambert deraadt kettenis matthew


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.17 19-May-2010 oga

BUS_DMA_ZERO instead of alloc, map, bzero.

ok krw@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.16 28-Nov-2008 brad

Eliminate the redundant bits of code for MTU and multicast handling
from the individual drivers now that ether_ioctl() handles this.

Shrinks the i386 kernels by..
RAMDISK - 2176 bytes
RAMDISKB - 1504 bytes
RAMDISKC - 736 bytes

Tested by naddy@/okan@/sthen@/brad@/todd@/jmc@ and lots of users.
Build tested on almost all archs by todd@/brad@

ok naddy@


# 1.15 14-Oct-2008 naddy

Change m_devget()'s outdated and unused "offset" argument: It is
now the offset into the first mbuf of the target chain before copying
the source data over. From FreeBSD.

Convert drivers' use of m_devget(). Mostly from thib@.

Update mbuf(9) man page.

ok claudio@, thib@


# 1.14 02-Oct-2008 brad

First step towards cleaning up the Ethernet driver ioctl handling.
Move calling ether_ioctl() from the top of the ioctl function, which
at the moment does absolutely nothing, to the default switch case.
Thus allowing drivers to define their own ioctl handlers and then
falling back on ether_ioctl(). The only functional change this results
in at the moment is having all Ethernet drivers returning the proper
errno of ENOTTY instead of EINVAL/ENXIO when encountering unknown
ioctl's.

Shrinks the i386 kernels by..
RAMDISK - 1024 bytes
RAMDISKB - 1120 bytes
RAMDISKC - 832 bytes

Tested by martin@/jsing@/todd@/brad@
Build tested on almost all archs by todd@/brad@

ok jsing@


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.13 26-Nov-2007 martynas

typos; ok jmc@
sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@
sys/dev/pci/bktr/* ok jakemsr@


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.12 25-Mar-2006 djm

allow bpf(4) to ignore packets based on their direction (inbound or
outbound), using a new BIOCSDIRFILT ioctl;
guidance, feedback and ok canacar@


Revision tags: OPENBSD_3_9_BASE
# 1.11 19-Nov-2005 aaron

Remove superfluous statement-ending semi-colons. i.e., "return foo;;" should
just be "return foo;". Cleaning out some M's in my tree.


# 1.10 07-Nov-2005 brad

splimp -> splnet


Revision tags: OPENBSD_3_8_BASE
# 1.9 02-Jul-2005 brad

set IFCAP_VLAN_MTU and do not whine if we cannot get mbufs


Revision tags: OPENBSD_3_7_BASE
# 1.8 15-Jan-2005 brad

make sure interface is in RUNNING state before touching the multicast filters

From NetBSD

NetBSD PR 27678 for details

ok mcbride@


# 1.7 28-Sep-2004 brad

Use ETHER_MAX_DIX_LEN/ETHER_MIN_LEN


# 1.6 23-Sep-2004 brad

don't need to set ifp->if_mtu or ifp->if_output in each driver,
{ether,atm,fddi}_ifattach already does this.

ok mcbride@ markus@ henning@


Revision tags: OPENBSD_3_6_BASE SMP_SYNC_A SMP_SYNC_B
# 1.5 05-Jun-2004 mcbride

Make multicast ranges work.

ok deraadt@


# 1.4 26-May-2004 brad

use ETHER_ALIGN


Revision tags: OPENBSD_3_5_BASE
# 1.3 17-Nov-2003 espie

branches: 1.3.2;
Defined behavior.

ok grange@ miod@


# 1.2 21-Oct-2003 jmc

typos from Tom Cosgrove;

Tom: I did not commit a couple of your changes.

i did not include some punctuation fixes (full stops, etc.)
mnemorable -> mnemonic: i decided memorable was probably better
instrunctions -> instruction: i kept the plural


# 1.1 25-Sep-2003 mickey

update fom form@ including support for 891 chips and more


Revision tags: OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.31 22-Jan-2017 dlg

move counting if_opackets next to counting if_obytes in if_enqueue.

this means packets are consistently counted in one place, unlike the
many and various ways that drivers thought they should do it.

ok mpi@ deraadt@


Revision tags: OPENBSD_6_0_BASE
# 1.30 13-Apr-2016 mpi

G/C IFQ_SET_READY().


Revision tags: OPENBSD_5_9_BASE
# 1.29 25-Nov-2015 dlg

replace IFF_OACTIVE manipulation with mpsafe operations.

there are two things shared between the network stack and drivers
in the send path: the send queue and the IFF_OACTIVE flag. the send
queue is now protected by a mutex. this diff makes the oactive
functionality mpsafe too.

IFF_OACTIVE is part of if_flags. there are two problems with that.
firstly, if_flags is a short and we dont have any MI atomic operations
to manipulate a short. secondly, while we could make the IFF_OACTIVE
operates mpsafe, all changes to other flags would have to be made
safe at the same time, otherwise a read-modify-write cycle on their
updates could clobber the oactive change.

instead, this moves the oactive mark into struct ifqueue and provides
an API for changing it. there's ifq_set_oactive, ifq_clr_oactive,
and ifq_is_oactive. these are modelled on ifsq_set_oactive,
ifsq_clr_oactive, and ifsq_is_oactive in dragonflybsd.

this diff includes changes to all the drivers manipulating IFF_OACTIVE
to now use the ifsq_{set,clr_is}_oactive API too.

ok kettenis@ mpi@ jmatthew@ deraadt@


# 1.28 25-Oct-2015 mpi

arp_ifinit() is no longer needed.


Revision tags: OPENBSD_5_8_BASE
# 1.27 24-Jun-2015 mpi

Increment if_ipackets in if_input().

Note that pseudo-drivers not using if_input() are not affected by this
conversion.

ok mikeb@, kettenis@, claudio@, dlg@


# 1.26 13-Apr-2015 mpi

Now that if_input() set the receiving interface pointer on mbufs for us
there's no need to do it in m_devget(9).

Stop passing an ``ifp'' will help for upcoming interface pointer -> index
conversion.

While here remove unused ``ifp'' argument from m_clget(9) and kill two
birds^W layer violations in one commit.

ok henning@


# 1.25 08-Apr-2015 mpi

Convert to if_input().

ok dlg@


Revision tags: OPENBSD_5_7_BASE
# 1.24 22-Dec-2014 tedu

unifdef INET


# 1.23 08-Dec-2014 brad

Have foo_init() call foo_reset() to reset the chip to a known state
as is the case for a lot of the other drivers. Remove some redundant
calls to foo_stop() and foo_reset() before foo_init().

Tested with DP83815, 3c905C, 8139 and ST201.
Mostly from FreeBSD.


# 1.22 06-Sep-2014 jsg

reduce the amount of pci includes


Revision tags: OPENBSD_5_5_BASE OPENBSD_5_6_BASE
# 1.21 26-Nov-2013 mpi

Instead of comparing the lower and higher addresses of all the multicast
entries to decide if the IFF_ALLMULTI flag should be set, check if there
is at least one real range between them.

This should not change the behavior of any driver but if you encounter
any problem, feel free to revert the offending chunk and ping me about
it.

ok naddy@, dlg@


# 1.20 21-Aug-2013 dlg

get rid of the copy argument in m_devget that let you provide an
alternative to bcopy since noone uses it.

while there use memcpy instead of bcopy because we know the memory cannot
overlap.

ok henning@ matthew@ mikeb@ deraadt@


Revision tags: OPENBSD_5_3_BASE OPENBSD_5_4_BASE
# 1.19 29-Nov-2012 brad

Remove setting an initial assumed baudrate upon driver attach which is not
necessarily correct, there might not even be a link when attaching.

ok mikeb@ reyk@


Revision tags: OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE
# 1.18 21-Jun-2011 tedu

remove some unnecessary casts. ok blambert deraadt kettenis matthew


Revision tags: OPENBSD_4_8_BASE OPENBSD_4_9_BASE
# 1.17 19-May-2010 oga

BUS_DMA_ZERO instead of alloc, map, bzero.

ok krw@


Revision tags: OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE
# 1.16 28-Nov-2008 brad

Eliminate the redundant bits of code for MTU and multicast handling
from the individual drivers now that ether_ioctl() handles this.

Shrinks the i386 kernels by..
RAMDISK - 2176 bytes
RAMDISKB - 1504 bytes
RAMDISKC - 736 bytes

Tested by naddy@/okan@/sthen@/brad@/todd@/jmc@ and lots of users.
Build tested on almost all archs by todd@/brad@

ok naddy@


# 1.15 14-Oct-2008 naddy

Change m_devget()'s outdated and unused "offset" argument: It is
now the offset into the first mbuf of the target chain before copying
the source data over. From FreeBSD.

Convert drivers' use of m_devget(). Mostly from thib@.

Update mbuf(9) man page.

ok claudio@, thib@


# 1.14 02-Oct-2008 brad

First step towards cleaning up the Ethernet driver ioctl handling.
Move calling ether_ioctl() from the top of the ioctl function, which
at the moment does absolutely nothing, to the default switch case.
Thus allowing drivers to define their own ioctl handlers and then
falling back on ether_ioctl(). The only functional change this results
in at the moment is having all Ethernet drivers returning the proper
errno of ENOTTY instead of EINVAL/ENXIO when encountering unknown
ioctl's.

Shrinks the i386 kernels by..
RAMDISK - 1024 bytes
RAMDISKB - 1120 bytes
RAMDISKC - 832 bytes

Tested by martin@/jsing@/todd@/brad@
Build tested on almost all archs by todd@/brad@

ok jsing@


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE
# 1.13 26-Nov-2007 martynas

typos; ok jmc@
sys/netinet/in_pcb.c and sys/net/bridgestp.c ok henning@
sys/dev/pci/bktr/* ok jakemsr@


Revision tags: OPENBSD_4_0_BASE OPENBSD_4_1_BASE OPENBSD_4_2_BASE
# 1.12 25-Mar-2006 djm

allow bpf(4) to ignore packets based on their direction (inbound or
outbound), using a new BIOCSDIRFILT ioctl;
guidance, feedback and ok canacar@


Revision tags: OPENBSD_3_9_BASE
# 1.11 19-Nov-2005 aaron

Remove superfluous statement-ending semi-colons. i.e., "return foo;;" should
just be "return foo;". Cleaning out some M's in my tree.


# 1.10 07-Nov-2005 brad

splimp -> splnet


Revision tags: OPENBSD_3_8_BASE
# 1.9 02-Jul-2005 brad

set IFCAP_VLAN_MTU and do not whine if we cannot get mbufs


Revision tags: OPENBSD_3_7_BASE
# 1.8 15-Jan-2005 brad

make sure interface is in RUNNING state before touching the multicast filters

From NetBSD

NetBSD PR 27678 for details

ok mcbride@


# 1.7 28-Sep-2004 brad

Use ETHER_MAX_DIX_LEN/ETHER_MIN_LEN


# 1.6 23-Sep-2004 brad

don't need to set ifp->if_mtu or ifp->if_output in each driver,
{ether,atm,fddi}_ifattach already does this.

ok mcbride@ markus@ henning@


Revision tags: OPENBSD_3_6_BASE SMP_SYNC_A SMP_SYNC_B
# 1.5 05-Jun-2004 mcbride

Make multicast ranges work.

ok deraadt@


# 1.4 26-May-2004 brad

use ETHER_ALIGN


Revision tags: OPENBSD_3_5_BASE
# 1.3 17-Nov-2003 espie

branches: 1.3.2;
Defined behavior.

ok grange@ miod@


# 1.2 21-Oct-2003 jmc

typos from Tom Cosgrove;

Tom: I did not commit a couple of your changes.

i did not include some punctuation fixes (full stops, etc.)
mnemorable -> mnemonic: i decided memorable was probably better
instrunctions -> instruction: i kept the plural


# 1.1 25-Sep-2003 mickey

update fom form@ including support for 891 chips and more