Changeset c4fb5ecd in mainline
- Timestamp:
- 2011-06-18T19:18:41Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 497b6f31
- Parents:
- 84eb7432
- Location:
- uspace
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ehci_hcd/hc_iface.c
r84eb7432 rc4fb5ecd 45 45 46 46 #define UNSUPPORTED(methodname) \ 47 usb_log_warning("Unsupported interface method `%s()' in %s:%d.\n", \ 47 usb_log_debug("Client called unsupported interface method " \ 48 "`%s()' in %s:%d.\n", \ 48 49 methodname, __FILE__, __LINE__) 49 50 -
uspace/drv/ohci/hc.c
r84eb7432 rc4fb5ecd 65 65 device_keeper_get_free_address(&instance->manager, USB_SPEED_FULL); 66 66 if (hub_address <= 0) { 67 usb_log_error("Failed (%d) to get OHCI root hub address.\n",68 hub_address);67 usb_log_error("Failed to get OHCI root hub address: %s\n", 68 str_error(hub_address)); 69 69 return hub_address; 70 70 } … … 445 445 /* HC is in reset (hw startup) => no other driver 446 446 * maintain reset for at least the time specified in USB spec (50 ms)*/ 447 usb_log_ info("HC found in reset.\n");447 usb_log_debug("Host controller found in reset state.\n"); 448 448 async_usleep(50000); 449 449 } … … 516 516 517 517 instance->registers->control &= (C_HCFS_OPERATIONAL << C_HCFS_SHIFT); 518 usb_log_ info("OHCI HC up and running(%x).\n",518 usb_log_debug("OHCI HC up and running (ctl_reg=0x%x).\n", 519 519 instance->registers->control); 520 520 } -
uspace/drv/ohci/root_hub.c
r84eb7432 rc4fb5ecd 232 232 return ENOMEM; 233 233 234 usb_log_info(" OHCI root hub with %zu portsinitialized.\n",234 usb_log_info("Root hub (%zu ports) initialized.\n", 235 235 instance->port_count); 236 236 … … 521 521 case USB_DESCTYPE_HUB: 522 522 { 523 usb_log_debug ("USB_DESCTYPE_HUB\n");523 usb_log_debug2("USB_DESCTYPE_HUB\n"); 524 524 result_descriptor = instance->hub_descriptor; 525 525 size = instance->descriptor_size; … … 528 528 case USB_DESCTYPE_DEVICE: 529 529 { 530 usb_log_debug ("USB_DESCTYPE_DEVICE\n");530 usb_log_debug2("USB_DESCTYPE_DEVICE\n"); 531 531 result_descriptor = &ohci_rh_device_descriptor; 532 532 size = sizeof (ohci_rh_device_descriptor); … … 535 535 case USB_DESCTYPE_CONFIGURATION: 536 536 { 537 usb_log_debug ("USB_DESCTYPE_CONFIGURATION\n");537 usb_log_debug2("USB_DESCTYPE_CONFIGURATION\n"); 538 538 result_descriptor = instance->descriptors.configuration; 539 539 size = instance->descriptors.configuration_size; … … 542 542 case USB_DESCTYPE_INTERFACE: 543 543 { 544 usb_log_debug ("USB_DESCTYPE_INTERFACE\n");544 usb_log_debug2("USB_DESCTYPE_INTERFACE\n"); 545 545 result_descriptor = &ohci_rh_iface_descriptor; 546 546 size = sizeof (ohci_rh_iface_descriptor); … … 549 549 case USB_DESCTYPE_ENDPOINT: 550 550 { 551 usb_log_debug ("USB_DESCTYPE_ENDPOINT\n");551 usb_log_debug2("USB_DESCTYPE_ENDPOINT\n"); 552 552 result_descriptor = &ohci_rh_ep_descriptor; 553 553 size = sizeof (ohci_rh_ep_descriptor); … … 556 556 default: 557 557 { 558 usb_log_debug ("USB_DESCTYPE_EINVAL %d \n",558 usb_log_debug2("USB_DESCTYPE_EINVAL %d \n", 559 559 setup_request->value); 560 usb_log_debug ("\ttype %d\n\trequest %d\n\tvalue "560 usb_log_debug2("\ttype %d\n\trequest %d\n\tvalue " 561 561 "%d\n\tindex %d\n\tlen %d\n ", 562 562 setup_request->request_type, … … 789 789 } 790 790 if (setup_request->request_type == USB_HUB_REQ_TYPE_SET_PORT_FEATURE) { 791 usb_log_debug ("USB_HUB_REQ_TYPE_SET_PORT_FEATURE\n");791 usb_log_debug2("USB_HUB_REQ_TYPE_SET_PORT_FEATURE\n"); 792 792 return process_port_feature_clear_request(instance, 793 793 setup_request->value, … … 854 854 return EINVAL; 855 855 } 856 usb_log_ info("CTRL packet: %s.\n",856 usb_log_debug("CTRL packet: %s.\n", 857 857 usb_debug_str_buffer( 858 858 (const uint8_t *) request->setup_buffer, 8, 8)); … … 864 864 case USB_DEVREQ_GET_DESCRIPTOR: 865 865 case USB_DEVREQ_GET_CONFIGURATION: 866 usb_log_debug ("Processing request with output\n");866 usb_log_debug2("Processing request with output\n"); 867 867 opResult = process_request_with_output( 868 868 instance, request); … … 871 871 case USB_DEVREQ_SET_FEATURE: 872 872 case USB_DEVREQ_SET_ADDRESS: 873 usb_log_debug ("Processing request without "873 usb_log_debug2("Processing request without " 874 874 "additional data\n"); 875 875 opResult = process_request_without_data( … … 878 878 case USB_DEVREQ_SET_DESCRIPTOR: 879 879 case USB_DEVREQ_SET_CONFIGURATION: 880 usb_log_debug("Processing request with " 881 "input\n"); 880 usb_log_debug2("Processing request with input\n"); 882 881 opResult = process_request_with_input( 883 882 instance, request); … … 885 884 break; 886 885 default: 887 usb_log_warning("Received unsuported request: " 888 "%d\n", 889 setup_request->request 890 ); 886 usb_log_warning("Received unsupported request: %d.\n", 887 setup_request->request); 891 888 opResult = ENOTSUP; 892 889 } -
uspace/drv/uhci_hcd/batch.c
r84eb7432 rc4fb5ecd 147 147 + sizeof(qh_t); 148 148 void *data_buffer = setup + setup_size; 149 usb_target_t target =150 { .address = ep->address, .endpoint = ep->endpoint };151 149 usb_transfer_batch_init(instance, ep, buffer, data_buffer, buffer_size, 152 150 setup, setup_size, func_in, func_out, arg, fun, … … 154 152 155 153 memcpy(instance->setup_buffer, setup_buffer, setup_size); 156 usb_log_debug("Batch(%p) %d:%d memory structures ready.\n", 157 instance, target.address, target.endpoint); 154 usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT 155 " memory structures ready.\n", instance, 156 USB_TRANSFER_BATCH_ARGS(*instance)); 158 157 return instance; 159 158 } … … 205 204 return true; 206 205 } 206 207 #define LOG_BATCH_INITIALIZED(batch, name) \ 208 usb_log_debug2("Batch %p %s " USB_TRANSFER_BATCH_FMT " initialized.\n", \ 209 (batch), (name), USB_TRANSFER_BATCH_ARGS(*(batch))) 210 207 211 /*----------------------------------------------------------------------------*/ 208 212 /** Prepares control write transfer. … … 219 223 batch_control(instance, USB_PID_OUT, USB_PID_IN); 220 224 instance->next_step = usb_transfer_batch_call_out_and_dispose; 221 usb_log_debug("Batch(%p) CONTROL WRITE initialized.\n", instance);225 LOG_BATCH_INITIALIZED(instance, "control write"); 222 226 } 223 227 /*----------------------------------------------------------------------------*/ … … 233 237 batch_control(instance, USB_PID_IN, USB_PID_OUT); 234 238 instance->next_step = usb_transfer_batch_call_in_and_dispose; 235 usb_log_debug("Batch(%p) CONTROL READ initialized.\n", instance);239 LOG_BATCH_INITIALIZED(instance, "control read"); 236 240 } 237 241 /*----------------------------------------------------------------------------*/ … … 247 251 batch_data(instance, USB_PID_IN); 248 252 instance->next_step = usb_transfer_batch_call_in_and_dispose; 249 usb_log_debug("Batch(%p) INTERRUPT IN initialized.\n", instance);253 LOG_BATCH_INITIALIZED(instance, "interrupt in"); 250 254 } 251 255 /*----------------------------------------------------------------------------*/ … … 263 267 batch_data(instance, USB_PID_OUT); 264 268 instance->next_step = usb_transfer_batch_call_out_and_dispose; 265 usb_log_debug("Batch(%p) INTERRUPT OUT initialized.\n", instance);269 LOG_BATCH_INITIALIZED(instance, "interrupt out"); 266 270 } 267 271 /*----------------------------------------------------------------------------*/ … … 277 281 batch_data(instance, USB_PID_IN); 278 282 instance->next_step = usb_transfer_batch_call_in_and_dispose; 279 usb_log_debug("Batch(%p) BULK IN initialized.\n", instance);283 LOG_BATCH_INITIALIZED(instance, "bulk in"); 280 284 } 281 285 /*----------------------------------------------------------------------------*/ … … 293 297 batch_data(instance, USB_PID_OUT); 294 298 instance->next_step = usb_transfer_batch_call_out_and_dispose; 295 usb_log_debug("Batch(%p) BULK OUT initialized.\n", instance);299 LOG_BATCH_INITIALIZED(instance, "bulk out"); 296 300 } 297 301 /*----------------------------------------------------------------------------*/ -
uspace/drv/uhci_hcd/hw_struct/transfer_descriptor.c
r84eb7432 rc4fb5ecd 103 103 td_print_status(instance); 104 104 if (pid == USB_PID_SETUP) { 105 usb_log_debug ("SETUP BUFFER: %s\n",105 usb_log_debug2("SETUP BUFFER: %s\n", 106 106 usb_debug_str_buffer(buffer, 8, 8)); 107 107 } -
uspace/drv/uhci_hcd/iface.c
r84eb7432 rc4fb5ecd 64 64 } 65 65 66 usb_log_debug ("%s %d:%d %zu(%zu).\n",66 usb_log_debug2("%s %d:%d %zu(%zu).\n", 67 67 name, target.address, target.endpoint, size, ep->max_packet_size); 68 68 … … 172 172 speed = ep_speed; 173 173 } 174 usb_log_debug("Register endpoint %d:%d %s %s(%d) %zu(%zu) %u.\n",174 usb_log_debug("Register endpoint %d:%d %s-%s %s %zuB %ums.\n", 175 175 address, endpoint, usb_str_transfer_type(transfer_type), 176 usb_str_speed(speed), direction, size, max_packet_size, interval); 176 usb_str_direction(direction), usb_str_speed(speed), 177 max_packet_size, interval); 177 178 178 179 return usb_endpoint_manager_add_ep(&hc->ep_manager, address, endpoint, … … 187 188 hc_t *hc = fun_to_hc(fun); 188 189 assert(hc); 189 usb_log_debug("Unregister endpoint %d:%d % d.\n",190 address, endpoint, direction);190 usb_log_debug("Unregister endpoint %d:%d %s.\n", 191 address, endpoint, usb_str_direction(direction)); 191 192 return usb_endpoint_manager_unregister_ep(&hc->ep_manager, address, 192 193 endpoint, direction); -
uspace/drv/uhci_hcd/transfer_list.c
r84eb7432 rc4fb5ecd 141 141 list_append(&batch->link, &instance->batch_list); 142 142 143 usb_transfer_batch_t *first = list_get_instance( 144 instance->batch_list.next, usb_transfer_batch_t, link); 145 usb_log_debug("Batch(%p) added to queue %s, first is %p.\n", 146 batch, instance->name, first); 143 usb_log_debug("Batch %p " USB_TRANSFER_BATCH_FMT " scheduled in queue %s.\n", 144 batch, USB_TRANSFER_BATCH_ARGS(*batch), instance->name); 147 145 fibril_mutex_unlock(&instance->guard); 148 146 } … … 234 232 /* Remove from the batch list */ 235 233 list_remove(&batch->link); 236 usb_log_debug("Batch(%p) removed (%s) from %s, next: %x.\n", 237 batch, qpos, instance->name, batch_qh(batch)->next); 234 usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT " removed (%s) " 235 "from %s, next: %x.\n", 236 batch, USB_TRANSFER_BATCH_ARGS(*batch), 237 qpos, instance->name, batch_qh(batch)->next); 238 238 } 239 239 /** -
uspace/lib/usbhost/include/usb/host/batch.h
r84eb7432 rc4fb5ecd 61 61 }; 62 62 63 /** Printf formatting string for dumping usb_transfer_batch_t. */ 64 #define USB_TRANSFER_BATCH_FMT "[%d:%d %s %s-%s %zuB/%zu]" 65 66 /** Printf arguments for dumping usb_transfer_batch_t. 67 * @param batch USB transfer batch to be dumped. 68 */ 69 #define USB_TRANSFER_BATCH_ARGS(batch) \ 70 (batch).ep->address, (batch).ep->endpoint, \ 71 usb_str_speed((batch).ep->speed), \ 72 usb_str_transfer_type_short((batch).ep->transfer_type), \ 73 usb_str_direction((batch).ep->direction), \ 74 (batch).buffer_size, (batch).ep->max_packet_size 75 76 63 77 void usb_transfer_batch_init( 64 78 usb_transfer_batch_t *instance, -
uspace/lib/usbhost/src/batch.c
r84eb7432 rc4fb5ecd 128 128 memcpy(instance->buffer, instance->data_buffer, instance->buffer_size); 129 129 130 usb_log_debug("Batch(%p) done (T%d.%d, %s %s in, %zuB): %s (%d).\n", 131 instance, instance->ep->address, instance->ep->endpoint, 132 usb_str_speed(instance->ep->speed), 133 usb_str_transfer_type_short(instance->ep->transfer_type), 134 instance->transfered_size, str_error(instance->error), 135 instance->error); 130 usb_log_debug("Batch %p " USB_TRANSFER_BATCH_FMT " completed (%zuB): %s.\n", 131 instance, USB_TRANSFER_BATCH_ARGS(*instance), 132 instance->transfered_size, str_error(instance->error)); 136 133 137 134 instance->callback_in(instance->fun, instance->error, … … 148 145 assert(instance->callback_out); 149 146 150 usb_log_debug("Batch(%p) done (T%d.%d, %s %s out): %s (%d).\n", 151 instance, instance->ep->address, instance->ep->endpoint, 152 usb_str_speed(instance->ep->speed), 153 usb_str_transfer_type_short(instance->ep->transfer_type), 154 str_error(instance->error), instance->error); 147 usb_log_debug("Batch %p " USB_TRANSFER_BATCH_FMT " completed: %s.\n", 148 instance, USB_TRANSFER_BATCH_ARGS(*instance), 149 str_error(instance->error)); 155 150 156 151 instance->callback_out(instance->fun, … … 165 160 { 166 161 assert(instance); 167 usb_log_debug("Batch(%p) disposing.\n", instance); 162 usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT " disposing.\n", 163 instance, USB_TRANSFER_BATCH_ARGS(*instance)); 168 164 if (instance->private_data) { 169 165 assert(instance->private_data_dtor);
Note:
See TracChangeset
for help on using the changeset viewer.