Make use of USB ID sections configurable.

This commit is contained in:
Hans Petter Selasky 2013-02-01 07:05:43 +00:00
parent 8caac1d5ba
commit 7b0866b032
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=246194
4 changed files with 12 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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 */

View File

@ -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