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
This commit is contained in:
parent
e3cf3d4428
commit
8d59ecb214
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=290135
@ -54,7 +54,7 @@
|
||||
#define USB_DEBUG_VAR usb_debug
|
||||
|
||||
#include <dev/usb/usb_core.h>
|
||||
#include <dev/usb/usb_compat_linux.h>
|
||||
#include <linux/usb.h>
|
||||
#include <dev/usb/usb_process.h>
|
||||
#include <dev/usb/usb_device.h>
|
||||
#include <dev/usb/usb_util.h>
|
||||
@ -63,6 +63,7 @@
|
||||
#include <dev/usb/usb_hub.h>
|
||||
#include <dev/usb/usb_request.h>
|
||||
#include <dev/usb/usb_debug.h>
|
||||
#include <dev/usb/usb_dynamic.h>
|
||||
#endif /* USB_GLOBAL_INCLUDE_FILE */
|
||||
|
||||
struct usb_linux_softc {
|
||||
@ -1733,3 +1734,13 @@ usb_bulk_msg(struct usb_device *udev, struct usb_host_endpoint *uhe,
|
||||
|
||||
return (err);
|
||||
}
|
||||
MODULE_DEPEND(linuxkpi, usb, 1, 1, 1);
|
||||
|
||||
static void
|
||||
usb_linux_init(void *arg)
|
||||
{
|
||||
/* register our function */
|
||||
usb_linux_free_device_p = &usb_linux_free_device;
|
||||
}
|
||||
SYSINIT(usb_linux_init, SI_SUB_LOCK, SI_ORDER_FIRST, usb_linux_init, NULL);
|
||||
SYSUNINIT(usb_linux_unload, SI_SUB_LOCK, SI_ORDER_ANY, usb_linux_unload, NULL);
|
@ -359,6 +359,9 @@ options COMPAT_FREEBSD9
|
||||
# Enable FreeBSD10 compatibility syscalls
|
||||
options COMPAT_FREEBSD10
|
||||
|
||||
# Enable Linux Kernel Programming Interface
|
||||
options COMPAT_LINUXKPI
|
||||
|
||||
#
|
||||
# These three options provide support for System V Interface
|
||||
# Definition-style interprocess communication, in the form of shared
|
||||
|
@ -2574,7 +2574,6 @@ dev/usb/storage/ustorage_fs.c optional usfs
|
||||
# USB core
|
||||
#
|
||||
dev/usb/usb_busdma.c optional usb
|
||||
dev/usb/usb_compat_linux.c optional usb
|
||||
dev/usb/usb_core.c optional usb
|
||||
dev/usb/usb_debug.c optional usb
|
||||
dev/usb/usb_dev.c optional usb
|
||||
@ -3796,17 +3795,20 @@ nlm/nlm_prot_svc.c optional nfslockd | nfsd
|
||||
nlm/nlm_prot_xdr.c optional nfslockd | nfsd
|
||||
nlm/sm_inter_xdr.c optional nfslockd | nfsd
|
||||
|
||||
# Linux Kernel Compatibility API
|
||||
ofed/include/linux/linux_kmod.c optional ofed | compat_linuxkpi \
|
||||
no-depend compile-with "${OFED_C}"
|
||||
ofed/include/linux/linux_compat.c optional ofed | compat_linuxkpi \
|
||||
no-depend compile-with "${OFED_C}"
|
||||
ofed/include/linux/linux_pci.c optional ofed | compat_linuxkpi \
|
||||
no-depend compile-with "${OFED_C}"
|
||||
ofed/include/linux/linux_idr.c optional ofed | compat_linuxkpi \
|
||||
no-depend compile-with "${OFED_C}"
|
||||
ofed/include/linux/linux_radix.c optional ofed | compat_linuxkpi \
|
||||
no-depend compile-with "${OFED_C}"
|
||||
# Linux Kernel Programming Interface
|
||||
compat/linuxkpi/common/src/linux_kmod.c optional compat_linuxkpi \
|
||||
no-depend compile-with "${LINUXKPI_C}"
|
||||
compat/linuxkpi/common/src/linux_compat.c optional compat_linuxkpi \
|
||||
no-depend compile-with "${LINUXKPI_C}"
|
||||
compat/linuxkpi/common/src/linux_pci.c optional compat_linuxkpi pci \
|
||||
no-depend compile-with "${LINUXKPI_C}"
|
||||
compat/linuxkpi/common/src/linux_idr.c optional compat_linuxkpi \
|
||||
no-depend compile-with "${LINUXKPI_C}"
|
||||
compat/linuxkpi/common/src/linux_radix.c optional compat_linuxkpi \
|
||||
no-depend compile-with "${LINUXKPI_C}"
|
||||
compat/linuxkpi/common/src/linux_usb.c optional compat_linuxkpi usb \
|
||||
no-depend compile-with "${LINUXKPI_C}"
|
||||
|
||||
# OpenFabrics Enterprise Distribution (Infiniband)
|
||||
ofed/drivers/infiniband/core/addr.c optional ofed \
|
||||
no-depend \
|
||||
|
@ -177,9 +177,13 @@ NORMAL_CTFCONVERT= @:
|
||||
|
||||
NORMAL_LINT= ${LINT} ${LINTFLAGS} ${CFLAGS:M-[DIU]*} ${.IMPSRC}
|
||||
|
||||
# Linux Kernel Programming Interface C-flags
|
||||
LINUXKPI_INCLUDES= -I$S/compat/linuxkpi/common/include
|
||||
LINUXKPI_C= ${NORMAL_C} ${LINUXKPI_INCLUDES}
|
||||
|
||||
# Infiniband C flags. Correct include paths and omit errors that linux
|
||||
# does not honor.
|
||||
OFEDINCLUDES= -I$S/ofed/include/
|
||||
OFEDINCLUDES= -I$S/ofed/include ${LINUXKPI_INCLUDES}
|
||||
OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith
|
||||
OFEDCFLAGS= ${CFLAGS:N-I*} ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR}
|
||||
OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} ${PROF}
|
||||
|
@ -506,8 +506,8 @@ usb_unconfigure(struct usb_device *udev, uint8_t flag)
|
||||
|
||||
#if USB_HAVE_COMPAT_LINUX
|
||||
/* free Linux compat device, if any */
|
||||
if (udev->linux_endpoint_start) {
|
||||
usb_linux_free_device(udev);
|
||||
if (udev->linux_endpoint_start != NULL) {
|
||||
usb_linux_free_device_p(udev);
|
||||
udev->linux_endpoint_start = NULL;
|
||||
}
|
||||
#endif
|
||||
|
@ -59,6 +59,9 @@
|
||||
/* function prototypes */
|
||||
static usb_handle_req_t usb_temp_get_desc_w;
|
||||
static usb_temp_setup_by_index_t usb_temp_setup_by_index_w;
|
||||
#if USB_HAVE_COMPAT_LINUX
|
||||
static usb_linux_free_device_t usb_linux_free_device_w;
|
||||
#endif
|
||||
static usb_temp_unsetup_t usb_temp_unsetup_w;
|
||||
static usb_test_quirk_t usb_test_quirk_w;
|
||||
static usb_quirk_ioctl_t usb_quirk_ioctl_w;
|
||||
@ -66,6 +69,9 @@ static usb_quirk_ioctl_t usb_quirk_ioctl_w;
|
||||
/* global variables */
|
||||
usb_handle_req_t *usb_temp_get_desc_p = &usb_temp_get_desc_w;
|
||||
usb_temp_setup_by_index_t *usb_temp_setup_by_index_p = &usb_temp_setup_by_index_w;
|
||||
#if USB_HAVE_COMPAT_LINUX
|
||||
usb_linux_free_device_t *usb_linux_free_device_p = &usb_linux_free_device_w;
|
||||
#endif
|
||||
usb_temp_unsetup_t *usb_temp_unsetup_p = &usb_temp_unsetup_w;
|
||||
usb_test_quirk_t *usb_test_quirk_p = &usb_test_quirk_w;
|
||||
usb_quirk_ioctl_t *usb_quirk_ioctl_p = &usb_quirk_ioctl_w;
|
||||
@ -103,6 +109,14 @@ usb_temp_unsetup_w(struct usb_device *udev)
|
||||
udev->usb_template_ptr = NULL;
|
||||
}
|
||||
|
||||
#if USB_HAVE_COMPAT_LINUX
|
||||
static void
|
||||
usb_linux_free_device_w(struct usb_device *udev)
|
||||
{
|
||||
/* NOP */
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
usb_quirk_unload(void *arg)
|
||||
{
|
||||
@ -147,3 +161,19 @@ usb_bus_unload(void *arg)
|
||||
|
||||
pause("WAIT", hz);
|
||||
}
|
||||
|
||||
#if USB_HAVE_COMPAT_LINUX
|
||||
void
|
||||
usb_linux_unload(void *arg)
|
||||
{
|
||||
/* reset function pointers */
|
||||
|
||||
usb_linux_free_device_p = &usb_linux_free_device_w;
|
||||
|
||||
/* wait for CPU to exit the loaded functions, if any */
|
||||
|
||||
/* XXX this is a tradeoff */
|
||||
|
||||
pause("WAIT", hz);
|
||||
}
|
||||
#endif
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user