History log of /freebsd-current/sys/compat/linuxkpi/common/include/linux/netdevice.h
Revision Date Author Comments
# 21761f2e 31-Mar-2024 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: napi_schedule() requires return value, implement napi_is_scheduled()

A newer version of iwlwifi requires a return value from napi_schedule();
unclear if the function always should have been bool. Add the bool to test
based on the napi_schedule_prep() result.

Also add napi_is_scheduled() for rtw89.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Reviewed by: emaste (previous version)
Differential Revision: https://reviews.freebsd.org/D44591


# 95ee2897 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# 6153bef9 19-May-2023 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: netdevice: add dev_set_threaded()

Add dev_set_threaded() to the dummy functions of netdevice.h in order
to keep an upcoming wireless driver compiling.
While here also update the name of a function argument for consistency.

MFC after: 10 days


# 97583aa2 03-Apr-2023 Justin Hibbits <jhibbits@FreeBSD.org>

linuxkpi: Migrate to IfAPI

Summary:
Trivial changes for LinuxKPI to use IfAPI. The 'bsdifp' looks unused,
so removed it instead of converting it to a pointer.

Bump __FreeBSD_version for change to struct net_device.

Reviewed by: bz, hselasky
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D39491


# 75388b9c 03-Dec-2022 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: add (skeleton) functions to make drivers compile

Add more functions to netdevice.h (netif_napi_add_tx() being the only
one implemented) and add platform_device.h and netlink.h in order to
make driver code compile.
The skeleton functions are used only in very limited scope and not at
all in our usage so far but add (invasive) #ifdef if removed.
Add pr_debug() calls to each of them in order to log a TODO (if DEBUG
compiled in) and someone should hit them in the future.

MFC after: 3 days
Commented on by: hselasky (earlier version)
Differential Revision: https://reviews.freebsd.org/D37599


# 23c73dba 28-Nov-2022 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: iwlwifi: rtw88: rtw89: remove budget argument from netif_napi_add()

In preparation for future updates remove the budget argument from the
netif_napi_add() in drivers and update LinuxKPI to reflect that it is
gone and only set it internally. This required changes to the currently
committed wireless drivers based on LinuxKPI (iwlwifi, rtw88, rtw89).

Sponsored by: The FreeBSD Foundation
MFC after: 3 days


# ac07a3b8 07-Sep-2022 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: netdev: expose napi state

There are drivers directly accessing napi->state testing for bits
(NAPI_STATE_SCHED encountered so far). Rename the internal _flags
struct field to state and expose our internal state flag bits along
with the one official aliased.

As I left in a comment, I wished Linux would hide these accesses
behind inline functions or by other means and not public expose
the implementation details.

MFC after: 1 week


# d1058958 26-Dec-2021 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: import beginning of a new version of netdevice.h

Import a netdevice update complementing the last remaining bits of
the old ifnet derived implementation. Along add a (for now) task
based NAPI implementation.

This is the minimal set of chnages which are needed for the initial
support of wireless drivers. The NAPI implementation has an option to
still switch to "direct dispatch" as it had been used by these drivers
before not relying on a deferred context along with some printf tracing.
This has been helpful in the last weeks for debugging and will be
cleaned once we have had broader testing and are sure this is fine as-is.
Should we need a more time-sensitive or load-sensitive response
in the future we can always switch to something more sophisticated.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days
X-Differential Revision: D33075 (abandoned without feedback a while ago)


# 801cf532 27-May-2021 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: add KPI for netdev_notifier_info returning ifp

While currently the ifp gets cast to a net_device and then returned
and consumers are expecting an ifp again, allow parallel usage now and
in the future by extending and also passing the ifp directly back in
the netdev_notifier_info. Add a function to return the ifp instead of
the net_device.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Suggested by: hselasky
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D30522


# 9b6835f3 26-May-2021 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: netdevice.h remove more ifnet operating macros

Now that mlx4 and ofed either are operating on ifnet functions
directly or have a private copy of these macros, we can remove them
from linux/netdevice.h.
With this only the #define for net_device to ifnet is left.

Sponsored by: The FreeBSD Foundation
MFC after: 12 days
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D30478


# c35034b3 25-May-2021 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI/OFED/mlx4: cleanup netdevice.h some more

This removes all unused bits from linux/netdevice.h and migrates two
inline functions into the mlx4 and ofed code respectively.

This gets the mlx4/ofed (struct ifnet) specific bits down to 7 lines
in netdevice.h.

Sponsored by: The FreeBSD Foundation
MFC after: 13 days
Reviewed by: hselasky, kib
Differential Revision: https://reviews.freebsd.org/D30461


# fdcfe8a2 21-Mar-2021 Bjoern A. Zeeb <bz@FreeBSD.org>

LinuxKPI: netdevice notifier callback argument

Introduce struct netdev_notifier_info as a container to pass
net_device to the callback functions.
Adjust netdev_notifier_info_to_dev() to return the net_device field.

Add explicit casts from ifp to ni->dev even though currently
struct net_device is defined to struct ifnet. This is needed in
preparation for untangling this and improving the net_device compat
code.

Obtained-from: bz_iwlwifi
Sponsored-by: The FreeBSD Foundation
MFC-after: 2 weeks
Reviewed-by: hselasky
Differential Revision: https://reviews.freebsd.org/D29365


# 427c402d 15-Oct-2019 Hans Petter Selasky <hselasky@FreeBSD.org>

Fix missing epochification of the LinuxKPI after r353292.

Sponsored by: Mellanox Technologies


# 92cbd830 05-Dec-2018 Slava Shwartsman <slavash@FreeBSD.org>

linuxkpi: properly implement netif_carrier_ok().

Submitted by: kib@
Approved by: hselasky (mentor)
MFC after: 1 week
Sponsored by: Mellanox Technologies


# 40402727 16-Mar-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Add basic support for VIMAGE to the LinuxKPI and ibcore.

Support is implemented by mapping Linux's "struct net" into FreeBSD's
"struct vnet". Currently only vnet0 is supported by ibcore.

MFC after: 1 week
Sponsored by: Mellanox Technologies


# d2111773 26-Jan-2016 Hans Petter Selasky <hselasky@FreeBSD.org>

Add more network related macros and functions to the LinuxKPI.

MFC after: 1 week
Sponsored by: Mellanox Technologies


# 0c510167 08-Jan-2016 Hans Petter Selasky <hselasky@FreeBSD.org>

LinuxKPI style changes:
- Properly prefix internal functions with "linux_" instead of only a
single underscore to avoid future namespace collisions.
- Make some functions global instead of inline to ease debugging and
to avoid unnecessary code duplication.
- Remove no longer existing kthread_create() function's prototype.

MFC after: 1 week
Sponsored by: Mellanox Technologies


# 8d59ecb2 29-Oct-2015 Hans Petter Selasky <hselasky@FreeBSD.org>

Finish process of moving the LinuxKPI module into the default kernel build.

- Move all files related to the LinuxKPI into sys/compat/linuxkpi and
its subfolders.
- Update sys/conf/files and some Makefiles to use new file locations.
- Added description of COMPAT_LINUXKPI to sys/conf/NOTES which in turn
adds the LinuxKPI to all LINT builds.
- The LinuxKPI can be added to the kernel by setting the
COMPAT_LINUXKPI option. The OFED kernel option no longer builds the
LinuxKPI into the kernel. This was done to keep the build rules for
the LinuxKPI in sys/conf/files simple.
- Extend the LinuxKPI module to include support for USB by moving the
Linux USB compat from usb.ko to linuxkpi.ko.
- Bump the FreeBSD_version.
- A universe kernel build has been done.

Reviewed by: np @ (cxgb and cxgbe related changes only)
Sponsored by: Mellanox Technologies