summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-05-24 20:33:16 +0100
committerPete Batard <pbatard@gmail.com>2010-05-24 20:33:16 +0100
commit6c18964a6d605bd539a863718ed91021159d823a (patch)
treeafcceca358587bd7e2b14f850b8fd12576b0afbd
parent63f97c600e4d8a59e16375c0900adc36861c629c (diff)
downloadlibusb-6c18964a6d605bd539a863718ed91021159d823a.tar.gz
additional HID error messagespbr281
-rw-r--r--libusb/os/windows_usb.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index b8fefdb..8b94084 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -3739,6 +3739,7 @@ static int hid_submit_control_transfer(struct usbi_transfer *itransfer)
struct windows_transfer_priv *transfer_priv = usbi_transfer_get_os_priv(itransfer);
struct windows_device_handle_priv *handle_priv = __device_handle_priv(transfer->dev_handle);
struct windows_device_priv *priv = __device_priv(transfer->dev_handle->dev);
+ struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
WINUSB_SETUP_PACKET *setup = (WINUSB_SETUP_PACKET *) transfer->buffer;
HANDLE hid_handle;
struct winfd wfd;
@@ -3796,6 +3797,7 @@ static int hid_submit_control_transfer(struct usbi_transfer *itransfer)
if (setup->value == priv->active_config) {
r = LIBUSB_COMPLETED;
} else {
+ usbi_warn(ctx, "cannot set configuration other than the default one");
r = LIBUSB_ERROR_INVALID_PARAM;
}
break;
@@ -3811,16 +3813,18 @@ static int hid_submit_control_transfer(struct usbi_transfer *itransfer)
}
break;
default:
+ usbi_warn(ctx, "unsupported HID control request");
r = LIBUSB_ERROR_INVALID_PARAM;
break;
}
break;
- case LIBUSB_REQUEST_TYPE_CLASS:
- r =_hid_class_request(priv->hid, wfd.handle, setup->request_type, setup->request, setup->value,
- setup->index, transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE, transfer_priv,
- &size, wfd.overlapped);
- break;
+ case LIBUSB_REQUEST_TYPE_CLASS:
+ r =_hid_class_request(priv->hid, wfd.handle, setup->request_type, setup->request, setup->value,
+ setup->index, transfer->buffer + LIBUSB_CONTROL_SETUP_SIZE, transfer_priv,
+ &size, wfd.overlapped);
+ break;
default:
+ usbi_warn(ctx, "unsupported HID control request");
r = LIBUSB_ERROR_INVALID_PARAM;
break;
}