Changeset bb58dc0b in mainline for uspace/drv/bus/usb/ohci/root_hub.c
- Timestamp:
- 2011-07-11T15:29:03Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 56c6b88
- Parents:
- 40c6cdf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/root_hub.c
r40c6cdf rbb58dc0b 165 165 rh_t *instance, usb_transfer_batch_t *request); 166 166 167 168 167 static int get_descriptor_request( 169 168 rh_t *instance, usb_transfer_batch_t *request); 170 169 171 static int get_configuration_request(172 rh_t *instance, usb_transfer_batch_t *request);173 174 170 static int port_feature_set_request( 175 171 rh_t *instance, uint16_t feature, uint16_t port); … … 194 190 static bool is_zeros(const void *buffer, size_t size); 195 191 196 /** 197 * Register address to this device 198 * 199 * @param instance Root hub instance 200 * @param address New address 201 * @return Error code 202 */ 203 static inline int address_set_request(rh_t *instance, uint16_t address) 204 { return ENOTSUP; } 192 193 #define TRANSFER_OK(bytes) \ 194 do { \ 195 request->transfered_size = bytes; \ 196 return EOK; \ 197 while (0); 205 198 206 199 /** Root hub initialization … … 564 557 /*----------------------------------------------------------------------------*/ 565 558 /** 566 * Answer to get configuration request.567 *568 * Root hub works independently on the configuration.569 * Set and get configuration requests do not have any meaning,570 * dummy values are returned.571 *572 * @param instance Root hub instance573 * @param request Structure containing both request and response information574 * @return Error code575 */576 int get_configuration_request(577 rh_t *instance, usb_transfer_batch_t *request)578 {579 assert(request);580 581 if (request->buffer_size != 1)582 return EINVAL;583 request->data_buffer[0] = 1;584 request->transfered_size = 1;585 586 return EOK;587 }588 /*----------------------------------------------------------------------------*/589 /**590 559 * process feature-enabling request on hub 591 560 * … … 671 640 case USB_DEVREQ_GET_CONFIGURATION: 672 641 usb_log_debug("USB_DEVREQ_GET_CONFIGURATION\n"); 673 return get_configuration_request(instance, request); 642 if (request->buffer_size != 1) 643 return EINVAL; 644 request->data_buffer[0] = 1; 645 request->transfered_size = 1; 646 return EOK; 674 647 } 675 648 return ENOTSUP; … … 767 740 case USB_DEVREQ_SET_ADDRESS: 768 741 usb_log_debug("USB_DEVREQ_SET_ADDRESS\n"); 769 return address_set_request(instance, setup_request->value);742 return ENOTSUP; 770 743 771 744 default:
Note:
See TracChangeset
for help on using the changeset viewer.