summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Drake <dsd@gentoo.org>2008-03-20 21:10:01 +0000
committerDaniel Drake <dsd@gentoo.org>2008-03-20 21:19:48 +0000
commit0499e9f418607b5786ac0c3e97bc46737a609ca3 (patch)
tree23881cd1048d08b9f4833f89facd6a838833a7f7
parent88884ae4bbe721dac117d5190303cb67852fa5d3 (diff)
downloadlibusb-0499e9f418607b5786ac0c3e97bc46737a609ca3.tar.gz
it's called bmRequestType
-rw-r--r--TODO1
-rw-r--r--libusb/io.c2
-rw-r--r--libusb/libusb.h16
-rw-r--r--libusb/os/linux_usbfs.h2
-rw-r--r--libusb/sync.c14
5 files changed, 17 insertions, 18 deletions
diff --git a/TODO b/TODO
index 717bc8f..ed8ace8 100644
--- a/TODO
+++ b/TODO
@@ -10,7 +10,6 @@ endianness of control setup, issues when resubmitting transfers
rename poll to handle_events
make libusb_get_pollfds return const?
doxygen warnings
-bmRequestType
make descriptor things const?
1.0 API style/naming points to reconsider
diff --git a/libusb/io.c b/libusb/io.c
index 7900603..96d98db 100644
--- a/libusb/io.c
+++ b/libusb/io.c
@@ -693,7 +693,7 @@ API_EXPORTED int libusb_submit_transfer(struct libusb_transfer *transfer)
(struct libusb_control_setup *) transfer->buffer;
usbi_dbg("RQT=%02x RQ=%02x VAL=%04x IDX=%04x length=%d",
- setup->bRequestType, setup->bRequest, setup->wValue, setup->wIndex,
+ setup->bmRequestType, setup->bRequest, setup->wValue, setup->wIndex,
setup->wLength);
setup->wValue = cpu_to_le16(setup->wValue);
diff --git a/libusb/libusb.h b/libusb/libusb.h
index a306af9..0b29223 100644
--- a/libusb/libusb.h
+++ b/libusb/libusb.h
@@ -185,7 +185,7 @@ enum libusb_standard_request {
/** \ingroup misc
* Request type bits of the
- * \ref libusb_control_setup::bRequestType "bRequestType" field in control
+ * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control
* transfers. */
enum libusb_request_type {
/** Standard */
@@ -203,7 +203,7 @@ enum libusb_request_type {
/** \ingroup misc
* Recipient bits of the
- * \ref libusb_control_setup::bRequestType "bRequestType" field in control
+ * \ref libusb_control_setup::bmRequestType "bmRequestType" field in control
* transfers. Values 4 through 31 are reserved. */
enum libusb_request_recipient {
/** Device */
@@ -462,9 +462,9 @@ struct libusb_control_setup {
* \ref libusb_request_type. Bit 7 determines data transfer direction, see
* \ref libusb_endpoint_direction.
*/
- uint8_t bRequestType;
+ uint8_t bmRequestType;
- /** Request. If the type bits of bRequestType are equal to
+ /** Request. If the type bits of bmRequestType are equal to
* \ref libusb_request_type::LIBUSB_REQUEST_TYPE_STANDARD
* "LIBUSB_REQUEST_TYPE_STANDARD" then this field refers to
* \ref libusb_standard_request. For other cases, use of this field is
@@ -640,8 +640,8 @@ static inline struct libusb_control_setup *libusb_control_transfer_get_setup(
* buffer) for a control transfer.
*
* \param buffer buffer to output the setup packet into
- * \param bRequestType see the
- * \ref libusb_control_setup::bRequestType "bRequestType" field of
+ * \param bmRequestType see the
+ * \ref libusb_control_setup::bmRequestType "bmRequestType" field of
* \ref libusb_control_setup
* \param bRequest see the
* \ref libusb_control_setup::bRequest "bRequest" field of
@@ -657,11 +657,11 @@ static inline struct libusb_control_setup *libusb_control_transfer_get_setup(
* \ref libusb_control_setup
*/
static inline void libusb_fill_control_setup(unsigned char *buffer,
- uint8_t bRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
+ uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
uint16_t wLength)
{
struct libusb_control_setup *setup = (struct libusb_control_setup *) buffer;
- setup->bRequestType = bRequestType;
+ setup->bmRequestType = bmRequestType;
setup->bRequest = bRequest;
setup->wValue = wValue;
setup->wIndex = wIndex;
diff --git a/libusb/os/linux_usbfs.h b/libusb/os/linux_usbfs.h
index 1642959..e96a16b 100644
--- a/libusb/os/linux_usbfs.h
+++ b/libusb/os/linux_usbfs.h
@@ -23,7 +23,7 @@
struct usbfs_ctrltransfer {
/* keep in sync with usbdevice_fs.h:usbdevfs_ctrltransfer */
- uint8_t bRequestType;
+ uint8_t bmRequestType;
uint8_t bRequest;
uint16_t wValue;
uint16_t wIndex;
diff --git a/libusb/sync.c b/libusb/sync.c
index 810c59c..15be26d 100644
--- a/libusb/sync.c
+++ b/libusb/sync.c
@@ -44,15 +44,15 @@ static void ctrl_transfer_cb(struct libusb_transfer *transfer)
/* FIXME: does this support partial transfers? */
/** \ingroup syncio
* Perform a USB control transfer. The direction of the transfer is inferred
- * from the bRequestType field of the setup packet.
+ * from the bmRequestType field of the setup packet.
*
* \param dev_handle a handle for the device to communicate with
- * \param bRequestType the request type field for the setup packet
+ * \param bmRequestType the request type field for the setup packet
* \param bRequest the request field for the setup packet
* \param wValue the value field for the setup packet
* \param wIndex the index field for the setup packet
* \param data a suitably-sized data buffer for either input or output
- * (depending on direction bits within bRequestType)
+ * (depending on direction bits within bmRequestType)
* \param wLength the length field for the setup packet. The data buffer should
* be at least this size.
* \param timeout timeout (in millseconds) that this function should wait
@@ -63,7 +63,7 @@ static void ctrl_transfer_cb(struct libusb_transfer *transfer)
* \returns other negative code on error
*/
API_EXPORTED int libusb_control_transfer(libusb_device_handle *dev_handle,
- uint8_t bRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
+ uint8_t bmRequestType, uint8_t bRequest, uint16_t wValue, uint16_t wIndex,
unsigned char *data, uint16_t wLength, unsigned int timeout)
{
struct libusb_transfer *transfer = libusb_alloc_transfer();
@@ -80,9 +80,9 @@ API_EXPORTED int libusb_control_transfer(libusb_device_handle *dev_handle,
return -ENOMEM;
}
- libusb_fill_control_setup(buffer, bRequestType, bRequest, wValue, wIndex,
+ libusb_fill_control_setup(buffer, bmRequestType, bRequest, wValue, wIndex,
wLength);
- if ((bRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_OUT)
+ if ((bmRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_OUT)
memcpy(buffer + LIBUSB_CONTROL_SETUP_SIZE, data, wLength);
libusb_fill_control_transfer(transfer, dev_handle, buffer,
@@ -102,7 +102,7 @@ API_EXPORTED int libusb_control_transfer(libusb_device_handle *dev_handle,
}
}
- if ((bRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN)
+ if ((bmRequestType & LIBUSB_ENDPOINT_DIR_MASK) == LIBUSB_ENDPOINT_IN)
memcpy(data, libusb_control_transfer_get_data(transfer),
transfer->actual_length);