From: Daniel Drake Date: Thu, 20 Mar 2008 21:10:01 +0000 (+0000) Subject: it's called bmRequestType X-Git-Tag: upstream/1.0.21~1112 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0499e9f418607b5786ac0c3e97bc46737a609ca3;p=platform%2Fupstream%2Flibusb.git it's called bmRequestType --- 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);