mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-24 14:33:38 +00:00
DM USB: enable log level feature for USB subsystem
Change the DPRINTF macro to UPRINTF for USB subsystem. The UPRINTF will print log according to certain log level. Change-Id: I5db8813357c9f684c25f23650e7c914f9063f842 Signed-off-by: Wu, Xiaoguang <xiaoguang.wu@intel.com> Reviewed-by: Shuo Liu <shuo.a.liu@intel.com> Reviewed-by: Yu Wang <yu1.wang@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
3b616010e0
commit
8f3f66bae5
File diff suppressed because it is too large
Load Diff
@ -39,10 +39,8 @@
|
|||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "gc.h"
|
#include "gc.h"
|
||||||
|
|
||||||
static int umouse_debug;
|
#undef LOG_TAG
|
||||||
#define DPRINTF(params) do { if (umouse_debug) printf params; } while (0)
|
#define LOG_TAG "umouse: "
|
||||||
#define WPRINTF(params) (printf params)
|
|
||||||
|
|
||||||
/* USB endpoint context (1-15) for reporting mouse data events*/
|
/* USB endpoint context (1-15) for reporting mouse data events*/
|
||||||
#define UMOUSE_INTR_ENDPT 1
|
#define UMOUSE_INTR_ENDPT 1
|
||||||
|
|
||||||
@ -290,7 +288,7 @@ umouse_init(struct usb_hci *hci, char *opt)
|
|||||||
|
|
||||||
dev = calloc(1, sizeof(struct umouse_vdev));
|
dev = calloc(1, sizeof(struct umouse_vdev));
|
||||||
if (!dev) {
|
if (!dev) {
|
||||||
WPRINTF(("umouse: calloc returns NULL\n"));
|
UPRINTF(LFTL, "calloc returns NULL\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
dev->hci = hci;
|
dev->hci = hci;
|
||||||
@ -345,7 +343,7 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
|
|||||||
eshort = 0;
|
eshort = 0;
|
||||||
|
|
||||||
if (!xfer->ureq) {
|
if (!xfer->ureq) {
|
||||||
DPRINTF(("%s: port %d\r\n", __func__, dev->hci->hci_port));
|
UPRINTF(LDBG, "%s: port %d\r\n", __func__, dev->hci->hci_port);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,14 +351,14 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
|
|||||||
index = xfer->ureq->wIndex;
|
index = xfer->ureq->wIndex;
|
||||||
len = xfer->ureq->wLength;
|
len = xfer->ureq->wLength;
|
||||||
|
|
||||||
DPRINTF(("%s: port %d, type 0x%x, req 0x%x,"
|
UPRINTF(LDBG, "%s: port %d, type 0x%x, req 0x%x,"
|
||||||
"val 0x%x, idx 0x%x, len %u\r\n", __func__,
|
"val 0x%x, idx 0x%x, len %u\r\n", __func__,
|
||||||
dev->hci->hci_port, xfer->ureq->bmRequestType,
|
dev->hci->hci_port, xfer->ureq->bmRequestType,
|
||||||
xfer->ureq->bRequest, value, index, len));
|
xfer->ureq->bRequest, value, index, len);
|
||||||
|
|
||||||
switch (UREQ(xfer->ureq->bRequest, xfer->ureq->bmRequestType)) {
|
switch (UREQ(xfer->ureq->bRequest, xfer->ureq->bmRequestType)) {
|
||||||
case UREQ(UR_GET_CONFIG, UT_READ_DEVICE):
|
case UREQ(UR_GET_CONFIG, UT_READ_DEVICE):
|
||||||
DPRINTF(("umouse: (UR_GET_CONFIG, UT_READ_DEVICE)\r\n"));
|
UPRINTF(LDBG, "(UR_GET_CONFIG, UT_READ_DEVICE)\r\n");
|
||||||
if (!data)
|
if (!data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -371,17 +369,17 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case UREQ(UR_GET_DESCRIPTOR, UT_READ_DEVICE):
|
case UREQ(UR_GET_DESCRIPTOR, UT_READ_DEVICE):
|
||||||
DPRINTF(("umouse: (UR_GET_DESCRIPTOR,UT_READ_DEVICE)"
|
UPRINTF(LDBG, "(UR_GET_DESCRIPTOR,UT_READ_DEVICE)"
|
||||||
"val %x\r\n",
|
"val %x\r\n",
|
||||||
value >> 8));
|
value >> 8);
|
||||||
if (!data)
|
if (!data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
switch (value >> 8) {
|
switch (value >> 8) {
|
||||||
case UDESC_DEVICE:
|
case UDESC_DEVICE:
|
||||||
DPRINTF(("umouse: (->UDESC_DEVICE) len %u"
|
UPRINTF(LDBG, "(->UDESC_DEVICE) len %u"
|
||||||
"?= sizeof(umouse_dev_desc) %lu\r\n",
|
"?= sizeof(umouse_dev_desc) %lu\r\n",
|
||||||
len, sizeof(umouse_dev_desc)));
|
len, sizeof(umouse_dev_desc));
|
||||||
if ((value & 0xFF) != 0) {
|
if ((value & 0xFF) != 0) {
|
||||||
err = USB_ERR_IOERROR;
|
err = USB_ERR_IOERROR;
|
||||||
goto done;
|
goto done;
|
||||||
@ -396,7 +394,7 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case UDESC_CONFIG:
|
case UDESC_CONFIG:
|
||||||
DPRINTF(("umouse: (->UDESC_CONFIG)\r\n"));
|
UPRINTF(LDBG, "(->UDESC_CONFIG)\r\n");
|
||||||
if ((value & 0xFF) != 0) {
|
if ((value & 0xFF) != 0) {
|
||||||
err = USB_ERR_IOERROR;
|
err = USB_ERR_IOERROR;
|
||||||
goto done;
|
goto done;
|
||||||
@ -412,7 +410,7 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case UDESC_STRING:
|
case UDESC_STRING:
|
||||||
DPRINTF(("umouse: (->UDESC_STRING)\r\n"));
|
UPRINTF(LDBG, "(->UDESC_STRING)\r\n");
|
||||||
str = NULL;
|
str = NULL;
|
||||||
if ((value & 0xFF) < UMSTR_MAX)
|
if ((value & 0xFF) < UMSTR_MAX)
|
||||||
str = umouse_desc_strings[value & 0xFF];
|
str = umouse_desc_strings[value & 0xFF];
|
||||||
@ -455,7 +453,7 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case UDESC_BOS:
|
case UDESC_BOS:
|
||||||
DPRINTF(("umouse: USB3 BOS\r\n"));
|
UPRINTF(LDBG, "USB3 BOS\r\n");
|
||||||
if (len > sizeof(umouse_bosd)) {
|
if (len > sizeof(umouse_bosd)) {
|
||||||
data->blen = len - sizeof(umouse_bosd);
|
data->blen = len - sizeof(umouse_bosd);
|
||||||
len = sizeof(umouse_bosd);
|
len = sizeof(umouse_bosd);
|
||||||
@ -466,7 +464,7 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DPRINTF(("umouse: unknown(%d)->ERROR\r\n", value >> 8));
|
UPRINTF(LDBG, "unknown(%d)->ERROR\r\n", value >> 8);
|
||||||
err = USB_ERR_IOERROR;
|
err = USB_ERR_IOERROR;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
@ -474,9 +472,9 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case UREQ(UR_GET_DESCRIPTOR, UT_READ_INTERFACE):
|
case UREQ(UR_GET_DESCRIPTOR, UT_READ_INTERFACE):
|
||||||
DPRINTF(("umouse: (UR_GET_DESCRIPTOR, UT_READ_INTERFACE)"
|
UPRINTF(LDBG, "(UR_GET_DESCRIPTOR, UT_READ_INTERFACE)"
|
||||||
"0x%x\r\n",
|
"0x%x\r\n",
|
||||||
(value >> 8)));
|
(value >> 8));
|
||||||
if (!data)
|
if (!data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -491,7 +489,7 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
|
|||||||
data->bdone += len;
|
data->bdone += len;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DPRINTF(("umouse: IO ERROR\r\n"));
|
UPRINTF(LWRN, "IO ERROR\r\n");
|
||||||
err = USB_ERR_IOERROR;
|
err = USB_ERR_IOERROR;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
@ -499,10 +497,10 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case UREQ(UR_GET_INTERFACE, UT_READ_INTERFACE):
|
case UREQ(UR_GET_INTERFACE, UT_READ_INTERFACE):
|
||||||
DPRINTF(("umouse: (UR_GET_INTERFACE, UT_READ_INTERFACE)\r\n"));
|
UPRINTF(LDBG, "(UR_GET_INTERFACE, UT_READ_INTERFACE)\r\n");
|
||||||
if (index != 0) {
|
if (index != 0) {
|
||||||
DPRINTF(("umouse get_interface, invalid index %d\r\n",
|
UPRINTF(LDBG, "get_interface, invalid index %d\r\n",
|
||||||
index));
|
index);
|
||||||
err = USB_ERR_IOERROR;
|
err = USB_ERR_IOERROR;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
@ -519,7 +517,7 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case UREQ(UR_GET_STATUS, UT_READ_DEVICE):
|
case UREQ(UR_GET_STATUS, UT_READ_DEVICE):
|
||||||
DPRINTF(("umouse: (UR_GET_STATUS, UT_READ_DEVICE)\r\n"));
|
UPRINTF(LDBG, "umouse: (UR_GET_STATUS, UT_READ_DEVICE)\r\n");
|
||||||
if (!data)
|
if (!data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -537,7 +535,7 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
|
|||||||
|
|
||||||
case UREQ(UR_GET_STATUS, UT_READ_INTERFACE):
|
case UREQ(UR_GET_STATUS, UT_READ_INTERFACE):
|
||||||
case UREQ(UR_GET_STATUS, UT_READ_ENDPOINT):
|
case UREQ(UR_GET_STATUS, UT_READ_ENDPOINT):
|
||||||
DPRINTF(("umouse: (UR_GET_STATUS, UT_READ_INTERFACE)\r\n"));
|
UPRINTF(LDBG, "(UR_GET_STATUS, UT_READ_INTERFACE)\r\n");
|
||||||
if (!data)
|
if (!data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -551,28 +549,28 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
|
|||||||
|
|
||||||
case UREQ(UR_SET_ADDRESS, UT_WRITE_DEVICE):
|
case UREQ(UR_SET_ADDRESS, UT_WRITE_DEVICE):
|
||||||
/* XXX Controller should've handled this */
|
/* XXX Controller should've handled this */
|
||||||
DPRINTF(("umouse set address %u\r\n", value));
|
UPRINTF(LDBG, "set address %u\r\n", value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UREQ(UR_SET_CONFIG, UT_WRITE_DEVICE):
|
case UREQ(UR_SET_CONFIG, UT_WRITE_DEVICE):
|
||||||
DPRINTF(("umouse set config %u\r\n", value));
|
UPRINTF(LDBG, "set config %u\r\n", value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UREQ(UR_SET_DESCRIPTOR, UT_WRITE_DEVICE):
|
case UREQ(UR_SET_DESCRIPTOR, UT_WRITE_DEVICE):
|
||||||
DPRINTF(("umouse set descriptor %u\r\n", value));
|
UPRINTF(LDBG, "set descriptor %u\r\n", value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case UREQ(UR_CLEAR_FEATURE, UT_WRITE_DEVICE):
|
case UREQ(UR_CLEAR_FEATURE, UT_WRITE_DEVICE):
|
||||||
DPRINTF(("umouse: (UR_SET_FEATURE,UT_WRITE_DEVICE) %x\r\n",
|
UPRINTF(LDBG, "(UR_SET_FEATURE,UT_WRITE_DEVICE) %x\r\n",
|
||||||
value));
|
value);
|
||||||
if (value == UF_DEVICE_REMOTE_WAKEUP)
|
if (value == UF_DEVICE_REMOTE_WAKEUP)
|
||||||
dev->hid.feature = 0;
|
dev->hid.feature = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UREQ(UR_SET_FEATURE, UT_WRITE_DEVICE):
|
case UREQ(UR_SET_FEATURE, UT_WRITE_DEVICE):
|
||||||
DPRINTF(("umouse: (UR_SET_FEATURE,UT_WRITE_DEVICE) %x\r\n",
|
UPRINTF(LDBG, "(UR_SET_FEATURE,UT_WRITE_DEVICE) %x\r\n",
|
||||||
value));
|
value);
|
||||||
if (value == UF_DEVICE_REMOTE_WAKEUP)
|
if (value == UF_DEVICE_REMOTE_WAKEUP)
|
||||||
dev->hid.feature = UF_DEVICE_REMOTE_WAKEUP;
|
dev->hid.feature = UF_DEVICE_REMOTE_WAKEUP;
|
||||||
break;
|
break;
|
||||||
@ -581,32 +579,32 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
|
|||||||
case UREQ(UR_CLEAR_FEATURE, UT_WRITE_ENDPOINT):
|
case UREQ(UR_CLEAR_FEATURE, UT_WRITE_ENDPOINT):
|
||||||
case UREQ(UR_SET_FEATURE, UT_WRITE_INTERFACE):
|
case UREQ(UR_SET_FEATURE, UT_WRITE_INTERFACE):
|
||||||
case UREQ(UR_SET_FEATURE, UT_WRITE_ENDPOINT):
|
case UREQ(UR_SET_FEATURE, UT_WRITE_ENDPOINT):
|
||||||
DPRINTF(("umouse: (UR_CLEAR_FEATURE,UT_WRITE_INTERFACE)\r\n"
|
UPRINTF(LDBG, "(UR_CLEAR_FEATURE,UT_WRITE_INTERFACE)\r\n"
|
||||||
));
|
);
|
||||||
err = USB_ERR_IOERROR;
|
err = USB_ERR_IOERROR;
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
case UREQ(UR_SET_INTERFACE, UT_WRITE_INTERFACE):
|
case UREQ(UR_SET_INTERFACE, UT_WRITE_INTERFACE):
|
||||||
DPRINTF(("umouse set interface %u\r\n", value));
|
UPRINTF(LDBG, "set interface %u\r\n", value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UREQ(UR_ISOCH_DELAY, UT_WRITE_DEVICE):
|
case UREQ(UR_ISOCH_DELAY, UT_WRITE_DEVICE):
|
||||||
DPRINTF(("umouse set isoch delay %u\r\n", value));
|
UPRINTF(LDBG, "set isoch delay %u\r\n", value);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UREQ(UR_SET_SEL, 0):
|
case UREQ(UR_SET_SEL, 0):
|
||||||
DPRINTF(("umouse set sel\r\n"));
|
UPRINTF(LDBG, "set sel\r\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UREQ(UR_SYNCH_FRAME, UT_WRITE_ENDPOINT):
|
case UREQ(UR_SYNCH_FRAME, UT_WRITE_ENDPOINT):
|
||||||
DPRINTF(("umouse synch frame\r\n"));
|
UPRINTF(LDBG, "synch frame\r\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* HID device requests */
|
/* HID device requests */
|
||||||
|
|
||||||
case UREQ(UMOUSE_GET_REPORT, UT_READ_CLASS_INTERFACE):
|
case UREQ(UMOUSE_GET_REPORT, UT_READ_CLASS_INTERFACE):
|
||||||
DPRINTF(("umouse: (UMOUSE_GET_REPORT,UT_READ_CLASS_INTERFACE) "
|
UPRINTF(LDBG, "(UMOUSE_GET_REPORT,UT_READ_CLASS_INTERFACE) "
|
||||||
"0x%x\r\n", (value >> 8)));
|
"0x%x\r\n", (value >> 8));
|
||||||
if (!data)
|
if (!data)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -653,27 +651,27 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case UREQ(UMOUSE_SET_REPORT, UT_WRITE_CLASS_INTERFACE):
|
case UREQ(UMOUSE_SET_REPORT, UT_WRITE_CLASS_INTERFACE):
|
||||||
DPRINTF(("umouse: (UMOUSE_SET_REPORT,"
|
UPRINTF(LDBG, "(UMOUSE_SET_REPORT,"
|
||||||
"UT_WRITE_CLASS_INTERFACE) ignored\r\n"
|
"UT_WRITE_CLASS_INTERFACE) ignored\r\n"
|
||||||
));
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UREQ(UMOUSE_SET_IDLE, UT_WRITE_CLASS_INTERFACE):
|
case UREQ(UMOUSE_SET_IDLE, UT_WRITE_CLASS_INTERFACE):
|
||||||
dev->hid.idle = xfer->ureq->wValue >> 8;
|
dev->hid.idle = xfer->ureq->wValue >> 8;
|
||||||
DPRINTF(("umouse: (UMOUSE_SET_IDLE,"
|
UPRINTF(LDBG, "(UMOUSE_SET_IDLE,"
|
||||||
"UT_WRITE_CLASS_INTERFACE) %x\r\n",
|
"UT_WRITE_CLASS_INTERFACE) %x\r\n",
|
||||||
dev->hid.idle));
|
dev->hid.idle);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case UREQ(UMOUSE_SET_PROTOCOL, UT_WRITE_CLASS_INTERFACE):
|
case UREQ(UMOUSE_SET_PROTOCOL, UT_WRITE_CLASS_INTERFACE):
|
||||||
dev->hid.protocol = xfer->ureq->wValue >> 8;
|
dev->hid.protocol = xfer->ureq->wValue >> 8;
|
||||||
DPRINTF(("umouse: (UR_CLEAR_FEATURE,"
|
UPRINTF(LDBG, "(UR_CLEAR_FEATURE,"
|
||||||
"UT_WRITE_CLASS_INTERFACE) %x\r\n",
|
"UT_WRITE_CLASS_INTERFACE) %x\r\n",
|
||||||
dev->hid.protocol));
|
dev->hid.protocol);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
DPRINTF(("**** umouse request unhandled\r\n"));
|
UPRINTF(LDBG, "**** umouse request unhandled\r\n");
|
||||||
err = USB_ERR_IOERROR;
|
err = USB_ERR_IOERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -685,8 +683,8 @@ done:
|
|||||||
else if (eshort)
|
else if (eshort)
|
||||||
err = USB_ERR_SHORT_XFER;
|
err = USB_ERR_SHORT_XFER;
|
||||||
|
|
||||||
DPRINTF(("umouse request error code %d (0=ok), blen %u txlen %u\r\n",
|
UPRINTF(LDBG, "request error code %d (0=ok), blen %u txlen %u\r\n",
|
||||||
err, (data ? data->blen : 0), (data ? data->bdone : 0)));
|
err, (data ? data->blen : 0), (data ? data->bdone : 0));
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@ -703,8 +701,8 @@ umouse_data_handler(void *scarg, struct usb_data_xfer *xfer, int dir,
|
|||||||
|
|
||||||
assert(xfer != NULL && xfer->head >= 0);
|
assert(xfer != NULL && xfer->head >= 0);
|
||||||
|
|
||||||
DPRINTF(("umouse handle data - DIR=%s|EP=%d, blen %d\r\n",
|
UPRINTF(LDBG, "handle data - DIR=%s|EP=%d, blen %d\r\n",
|
||||||
dir ? "IN" : "OUT", epctx, xfer->data[0].blen));
|
dir ? "IN" : "OUT", epctx, xfer->data[0].blen);
|
||||||
|
|
||||||
/* find buffer to add data */
|
/* find buffer to add data */
|
||||||
udata = NULL;
|
udata = NULL;
|
||||||
@ -729,7 +727,7 @@ umouse_data_handler(void *scarg, struct usb_data_xfer *xfer, int dir,
|
|||||||
len = data->blen;
|
len = data->blen;
|
||||||
|
|
||||||
if (udata == NULL) {
|
if (udata == NULL) {
|
||||||
DPRINTF(("umouse no buffer provided for input\r\n"));
|
UPRINTF(LDBG, "no buffer provided for input\r\n");
|
||||||
err = USB_ERR_NOMEM;
|
err = USB_ERR_NOMEM;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "usb_core.h"
|
#include "usb_core.h"
|
||||||
|
|
||||||
SET_DECLARE(usb_emu_set, struct usb_devemu);
|
SET_DECLARE(usb_emu_set, struct usb_devemu);
|
||||||
|
int usb_log_level;
|
||||||
|
|
||||||
struct usb_devemu *
|
struct usb_devemu *
|
||||||
usb_emu_finddev(char *name)
|
usb_emu_finddev(char *name)
|
||||||
|
@ -141,6 +141,18 @@ enum USB_ERRCODE {
|
|||||||
#define USB_DATA_XFER_UNLOCK(x) \
|
#define USB_DATA_XFER_UNLOCK(x) \
|
||||||
pthread_mutex_unlock(&((x)->mtx))
|
pthread_mutex_unlock(&((x)->mtx))
|
||||||
|
|
||||||
|
#define LOG_TAG "USB: "
|
||||||
|
#define LFTL 0
|
||||||
|
#define LWRN 1
|
||||||
|
#define LINF 2
|
||||||
|
#define LDBG 3
|
||||||
|
#define LVRB 4
|
||||||
|
#define UPRINTF(lvl, fmt, args...) \
|
||||||
|
do { if (lvl <= usb_log_level) printf(LOG_TAG fmt, ##args); } while (0)
|
||||||
|
|
||||||
|
extern int usb_log_level;
|
||||||
|
inline int usb_get_log_level(void) { return usb_log_level; }
|
||||||
|
inline void usb_set_log_level(int level) { usb_log_level = level; }
|
||||||
struct usb_devemu *usb_emu_finddev(char *name);
|
struct usb_devemu *usb_emu_finddev(char *name);
|
||||||
|
|
||||||
struct usb_data_xfer_block *usb_data_xfer_append(struct usb_data_xfer *xfer,
|
struct usb_data_xfer_block *usb_data_xfer_append(struct usb_data_xfer *xfer,
|
||||||
|
Loading…
Reference in New Issue
Block a user