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
This commit is contained in:
Hans Petter Selasky 2020-11-18 13:22:22 +00:00
parent ac8c4a61af
commit a2dd1caade
5 changed files with 16 additions and 13 deletions

View File

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

View File

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

View File

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

View File

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

View File

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