summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/usb_util.c
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-03-20 21:48:11 +0000
committerthompsa <thompsa@FreeBSD.org>2009-03-20 21:48:11 +0000
commite14295c787e7990fac7af1c1f196f279396b88a7 (patch)
tree5f5d9b7cd28551f4f3923401f6ffea491e559c3b /sys/dev/usb/usb_util.c
parent79aaac6e7b4553e4799500d20a8d63ea337b8925 (diff)
downloadFreeBSD-src-e14295c787e7990fac7af1c1f196f279396b88a7.zip
FreeBSD-src-e14295c787e7990fac7af1c1f196f279396b88a7.tar.gz
MFp4 //depot/projects/usb@159392
Add ifdefs for making parts of usb conditional. Submitted by: Hans Petter Selasky
Diffstat (limited to 'sys/dev/usb/usb_util.c')
-rw-r--r--sys/dev/usb/usb_util.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sys/dev/usb/usb_util.c b/sys/dev/usb/usb_util.c
index b22e35b..adc486d 100644
--- a/sys/dev/usb/usb_util.c
+++ b/sys/dev/usb/usb_util.c
@@ -39,7 +39,7 @@
#include <dev/usb/usb_bus.h>
/* function prototypes */
-#if (USB_USE_CONDVAR == 0)
+#if (USB_HAVE_CONDVAR == 0)
static int usb2_msleep(void *chan, struct mtx *mtx, int priority, const char *wmesg, int timo);
#endif
@@ -47,6 +47,7 @@ static int usb2_msleep(void *chan, struct mtx *mtx, int priority, const char *wm
/*------------------------------------------------------------------------*
* device_delete_all_children - delete all children of a device
*------------------------------------------------------------------------*/
+#ifndef device_delete_all_children
int
device_delete_all_children(device_t dev)
{
@@ -66,6 +67,7 @@ device_delete_all_children(device_t dev)
}
return (error);
}
+#endif
/*------------------------------------------------------------------------*
* device_set_usb2_desc
@@ -76,6 +78,7 @@ device_delete_all_children(device_t dev)
void
device_set_usb2_desc(device_t dev)
{
+#if USB_HAVE_STRINGS
struct usb2_attach_arg *uaa;
struct usb2_device *udev;
struct usb2_interface *iface;
@@ -118,6 +121,7 @@ device_set_usb2_desc(device_t dev)
device_set_desc_copy(dev, temp_p);
device_printf(dev, "<%s> on %s\n", temp_p,
device_get_nameunit(udev->bus->bdev));
+#endif
}
/*------------------------------------------------------------------------*
@@ -163,6 +167,7 @@ usb2_pause_mtx(struct mtx *mtx, int _ticks)
* pointed to by "p" having a maximum length of "p_len" bytes
* including the terminating zero.
*------------------------------------------------------------------------*/
+#if USB_HAVE_STRINGS
void
usb2_printBCD(char *p, uint16_t p_len, uint16_t bcd)
{
@@ -170,6 +175,7 @@ usb2_printBCD(char *p, uint16_t p_len, uint16_t bcd)
/* ignore any errors */
}
}
+#endif
/*------------------------------------------------------------------------*
* usb2_trim_spaces
@@ -177,6 +183,7 @@ usb2_printBCD(char *p, uint16_t p_len, uint16_t bcd)
* This function removes spaces at the beginning and the end of the string
* pointed to by the "p" argument.
*------------------------------------------------------------------------*/
+#if USB_HAVE_STRINGS
void
usb2_trim_spaces(char *p)
{
@@ -193,6 +200,7 @@ usb2_trim_spaces(char *p)
e = p;
*e = 0; /* kill trailing spaces */
}
+#endif
/*------------------------------------------------------------------------*
* usb2_get_devid
@@ -246,7 +254,7 @@ usb2_make_str_desc(void *ptr, uint16_t max_len, const char *s)
return (totlen);
}
-#if (USB_USE_CONDVAR == 0)
+#if (USB_HAVE_CONDVAR == 0)
/*------------------------------------------------------------------------*
* usb2_cv_init - wrapper function
OpenPOWER on IntegriCloud