Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Feb 2013 07:05:43 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r246194 - head/sys/dev/usb
Message-ID:  <201302010705.r1175hvB008065@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Fri Feb  1 07:05:43 2013
New Revision: 246194
URL: http://svnweb.freebsd.org/changeset/base/246194

Log:
  Make use of USB ID sections configurable.

Modified:
  head/sys/dev/usb/usb_freebsd.h
  head/sys/dev/usb/usb_freebsd_loader.h
  head/sys/dev/usb/usb_lookup.c
  head/sys/dev/usb/usbdi.h

Modified: head/sys/dev/usb/usb_freebsd.h
==============================================================================
--- head/sys/dev/usb/usb_freebsd.h	Fri Feb  1 06:40:53 2013	(r246193)
+++ head/sys/dev/usb/usb_freebsd.h	Fri Feb  1 07:05:43 2013	(r246194)
@@ -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

Modified: head/sys/dev/usb/usb_freebsd_loader.h
==============================================================================
--- head/sys/dev/usb/usb_freebsd_loader.h	Fri Feb  1 06:40:53 2013	(r246193)
+++ head/sys/dev/usb/usb_freebsd_loader.h	Fri Feb  1 07:05:43 2013	(r246194)
@@ -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

Modified: head/sys/dev/usb/usb_lookup.c
==============================================================================
--- head/sys/dev/usb/usb_lookup.c	Fri Feb  1 06:40:53 2013	(r246193)
+++ head/sys/dev/usb/usb_lookup.c	Fri Feb  1 07:05:43 2013	(r246194)
@@ -178,7 +178,7 @@ usbd_lookup_id_by_uaa(const struct usb_d
 #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 */

Modified: head/sys/dev/usb/usbdi.h
==============================================================================
--- head/sys/dev/usb/usbdi.h	Fri Feb  1 06:40:53 2013	(r246193)
+++ head/sys/dev/usb/usbdi.h	Fri Feb  1 07:05:43 2013	(r246194)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302010705.r1175hvB008065>