diff options
author | hselasky <hselasky@FreeBSD.org> | 2013-02-01 07:05:43 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2013-02-01 07:05:43 +0000 |
commit | ce15d88b31f3ddecdecc282326f41ff92658552e (patch) | |
tree | a62df3886148122d1d17219df126410bbd4e231c | |
parent | 57c1c0e0f90ffdcbb675b23c5771c4e42e45d157 (diff) | |
download | FreeBSD-src-ce15d88b31f3ddecdecc282326f41ff92658552e.zip FreeBSD-src-ce15d88b31f3ddecdecc282326f41ff92658552e.tar.gz |
Make use of USB ID sections configurable.
-rw-r--r-- | sys/dev/usb/usb_freebsd.h | 1 | ||||
-rw-r--r-- | sys/dev/usb/usb_freebsd_loader.h | 1 | ||||
-rw-r--r-- | sys/dev/usb/usb_lookup.c | 2 | ||||
-rw-r--r-- | sys/dev/usb/usbdi.h | 9 |
4 files changed, 12 insertions, 1 deletions
diff --git a/sys/dev/usb/usb_freebsd.h b/sys/dev/usb/usb_freebsd.h index b599b74..e93bee7 100644 --- a/sys/dev/usb/usb_freebsd.h +++ b/sys/dev/usb/usb_freebsd.h @@ -43,6 +43,7 @@ #define USB_HAVE_MSCTEST 1 #define USB_HAVE_PF 1 #define USB_HAVE_ROOT_MOUNT_HOLD 1 +#define USB_HAVE_ID_SECTION 1 #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid diff --git a/sys/dev/usb/usb_freebsd_loader.h b/sys/dev/usb/usb_freebsd_loader.h index bb3250a7..566f922 100644 --- a/sys/dev/usb/usb_freebsd_loader.h +++ b/sys/dev/usb/usb_freebsd_loader.h @@ -43,6 +43,7 @@ #define USB_HAVE_MSCTEST 0 #define USB_HAVE_PF 0 #define USB_HAVE_ROOT_MOUNT_HOLD 0 +#define USB_HAVE_ID_SECTION 0 #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid diff --git a/sys/dev/usb/usb_lookup.c b/sys/dev/usb/usb_lookup.c index 769f9b6..f3dc551 100644 --- a/sys/dev/usb/usb_lookup.c +++ b/sys/dev/usb/usb_lookup.c @@ -178,7 +178,7 @@ usbd_lookup_id_by_uaa(const struct usb_device_id *id, usb_size_t sizeof_id, #define MFL_SIZE "0" #endif -#ifdef KLD_MODULE +#if defined(KLD_MODULE) && (USB_HAVE_ID_SECTION != 0) static const char __section("bus_autoconf_format") __used usb_id_format[] = { /* Declare that three different sections use the same format */ diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h index d39a84d..26f7769 100644 --- a/sys/dev/usb/usbdi.h +++ b/sys/dev/usb/usbdi.h @@ -241,12 +241,21 @@ struct usb_config { * have your driver module automatically loaded in host, device or * both modes respectivly: */ +#if USB_HAVE_ID_SECTION #define STRUCT_USB_HOST_ID \ struct usb_device_id __section("usb_host_id") #define STRUCT_USB_DEVICE_ID \ struct usb_device_id __section("usb_device_id") #define STRUCT_USB_DUAL_ID \ struct usb_device_id __section("usb_dual_id") +#else +#define STRUCT_USB_HOST_ID \ + struct usb_device_id +#define STRUCT_USB_DEVICE_ID \ + struct usb_device_id +#define STRUCT_USB_DUAL_ID \ + struct usb_device_id +#endif /* USB_HAVE_ID_SECTION */ /* * The following structure is used when looking up an USB driver for |