it's called bmRequestType
authorDaniel Drake <dsd@gentoo.org>
Thu, 20 Mar 2008 21:10:01 +0000 (21:10 +0000)
committerDaniel Drake <dsd@gentoo.org>
Thu, 20 Mar 2008 21:19:48 +0000 (21:19 +0000)
TODO
libusb/io.c
libusb/libusb.h
libusb/os/linux_usbfs.h
libusb/sync.c

diff --git a/TODO b/TODO
index 717bc8f..ed8ace8 100644 (file)
--- 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
index 7900603..96d98db 100644 (file)
@@ -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);
index a306af9..0b29223 100644 (file)
@@ -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;
index 1642959..e96a16b 100644 (file)
@@ -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;
index 810c59c..15be26d 100644 (file)
@@ -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);