summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2020-11-18 13:22:22 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2020-11-18 13:22:22 +0000
commita2dd1caade2f9cb829261a42812431781c685d46 (patch)
tree466a86138a99f5f6c73c54cd531dbdb9884678c0
parentac8c4a61af5007487eabf882e969dd9768549078 (diff)
downloadsrc-test-a2dd1caade2f9cb829261a42812431781c685d46.tar.gz
src-test-a2dd1caade2f9cb829261a42812431781c685d46.zip
Fix build of USB bootloader code by adding checks for _STANDALONE being defined.
Currently the USB bootloader code is not part of buildworld. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking
Notes
Notes: svn path=/head/; revision=367787
-rw-r--r--stand/kshim/bsd_kernel.h7
-rw-r--r--sys/dev/usb/usb.h4
-rw-r--r--sys/dev/usb/usb_pf.h6
-rw-r--r--sys/dev/usb/usbdi.h6
-rw-r--r--sys/dev/usb/usbhid.h6
5 files changed, 16 insertions, 13 deletions
diff --git a/stand/kshim/bsd_kernel.h b/stand/kshim/bsd_kernel.h
index 4dfe307fef0c7..89d87121c63e4 100644
--- a/stand/kshim/bsd_kernel.h
+++ b/stand/kshim/bsd_kernel.h
@@ -27,9 +27,12 @@
#ifndef _BSD_KERNEL_H_
#define _BSD_KERNEL_H_
-#define _KERNEL
+#if !defined(_STANDALONE)
+#error "_STANDALONE is not defined!"
+#endif
+
#undef __FreeBSD_version
-#define __FreeBSD_version 1100000
+#define __FreeBSD_version 1300000
#include <sys/cdefs.h>
#include <sys/queue.h>
diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h
index b7e51b9b876b9..346ecd3059d79 100644
--- a/sys/dev/usb/usb.h
+++ b/sys/dev/usb/usb.h
@@ -41,7 +41,7 @@
#ifndef _USB_STANDARD_H_
#define _USB_STANDARD_H_
-#if defined(_KERNEL)
+#if defined(_KERNEL) || defined(_STANDALONE)
#ifndef USB_GLOBAL_INCLUDE_FILE
#include "opt_usb.h"
#endif
@@ -57,7 +57,7 @@ SYSCTL_DECL(_hw_usb);
MALLOC_DECLARE(M_USB);
MALLOC_DECLARE(M_USBDEV);
-#endif /* _KERNEL */
+#endif /* _KERNEL || _STANDALONE */
#ifndef USB_GLOBAL_INCLUDE_FILE
#include <dev/usb/usb_endian.h>
diff --git a/sys/dev/usb/usb_pf.h b/sys/dev/usb/usb_pf.h
index 03f7ba9888279..0fc839b48323b 100644
--- a/sys/dev/usb/usb_pf.h
+++ b/sys/dev/usb/usb_pf.h
@@ -113,10 +113,10 @@ extern uint8_t usbpf_framehdr_size_ok[
#define USBPF_XFERTAP_SUBMIT 0
#define USBPF_XFERTAP_DONE 1
-#ifdef _KERNEL
+#if defined(_KERNEL) || defined(_STANDALONE)
void usbpf_attach(struct usb_bus *);
void usbpf_detach(struct usb_bus *);
void usbpf_xfertap(struct usb_xfer *, int);
-#endif
+#endif /* _KERNEL || _STANDALONE */
+#endif /* _DEV_USB_PF_H */
-#endif
diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h
index 834a04c95b177..a8ba5408f5c4d 100644
--- a/sys/dev/usb/usbdi.h
+++ b/sys/dev/usb/usbdi.h
@@ -88,7 +88,7 @@ typedef enum { /* keep in sync with usb_errstr_table */
#define USB_NO_TIMEOUT 0
#define USB_DEFAULT_TIMEOUT 5000 /* 5000 ms = 5 seconds */
-#if defined(_KERNEL)
+#if defined(_KERNEL) || defined(_STANDALONE)
/* typedefs */
typedef void (usb_callback_t)(struct usb_xfer *, usb_error_t);
@@ -709,5 +709,5 @@ void *usb_fifo_softc(struct usb_fifo *fifo);
void usb_fifo_set_close_zlp(struct usb_fifo *, uint8_t);
void usb_fifo_set_write_defrag(struct usb_fifo *, uint8_t);
void usb_fifo_free(struct usb_fifo *f);
-#endif /* _KERNEL */
-#endif /* _USB_USBDI_H_ */
+#endif /* _KERNEL || _STANDALONE */
+#endif /* _USB_USBDI_H_ */
diff --git a/sys/dev/usb/usbhid.h b/sys/dev/usb/usbhid.h
index 305166370559b..30949ea9a62a7 100644
--- a/sys/dev/usb/usbhid.h
+++ b/sys/dev/usb/usbhid.h
@@ -205,7 +205,7 @@ struct usb_hid_descriptor {
#define HUM_INCH 0x13
#define HUM_DEGREE 0x14
-#ifdef _KERNEL
+#if defined(_KERNEL) || defined(_STANDALONE)
struct usb_config_descriptor;
enum hid_kind {
@@ -274,5 +274,5 @@ usb_error_t usbd_req_get_hid_desc(struct usb_device *udev, struct mtx *mtx,
int32_t hid_item_resolution(struct hid_item *hi);
int hid_is_mouse(const void *d_ptr, uint16_t d_len);
int hid_is_keyboard(const void *d_ptr, uint16_t d_len);
-#endif /* _KERNEL */
-#endif /* _USB_HID_H_ */
+#endif /* _KERNEL || _STANDALONE */
+#endif /* _USB_HID_H_ */