Changeset 1dc4a5e in mainline
- Timestamp:
- 2011-08-18T13:34:33Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 763e0cd
- Parents:
- 99ac5cf
- Location:
- uspace
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/lsusb/main.c
r99ac5cf r1dc4a5e 54 54 static void print_found_hc(service_id_t sid, const char *path) 55 55 { 56 // printf(NAME ": host controller %zu is `%s'.\n", class_index, path);57 56 printf("Bus %" PRIun ": %s\n", sid, path); 58 57 } 59 58 static void print_found_dev(usb_address_t addr, const char *path) 60 59 { 61 // printf(NAME ": device with address %d is `%s'.\n", addr, path);62 60 printf(" Device %02d: %s\n", addr, path); 63 61 } … … 100 98 int rc; 101 99 102 rc = loc_category_get_id(USB_HC_ DDF_CLASS_NAME, &usbhc_cat, 0);100 rc = loc_category_get_id(USB_HC_CATEGORY, &usbhc_cat, 0); 103 101 if (rc != EOK) { 104 102 printf(NAME ": Error resolving category '%s'", 105 USB_HC_ DDF_CLASS_NAME);103 USB_HC_CATEGORY); 106 104 return 1; 107 105 } -
uspace/drv/bus/usb/ehci/main.c
r99ac5cf r1dc4a5e 101 101 "Failed to bind EHCI function: %s.\n", 102 102 str_error(ret)); 103 ret = ddf_fun_add_to_c lass(hc_fun, USB_HC_DDF_CLASS_NAME);103 ret = ddf_fun_add_to_category(hc_fun, USB_HC_CATEGORY); 104 104 CHECK_RET_RETURN(ret, 105 105 "Failed to add EHCI to HC class: %s.\n", -
uspace/drv/bus/usb/ohci/ohci.c
r99ac5cf r1dc4a5e 244 244 "Failed to bind OHCI device function: %s.\n", str_error(ret)); 245 245 246 ret = ddf_fun_add_to_c lass(instance->hc_fun, USB_HC_DDF_CLASS_NAME);246 ret = ddf_fun_add_to_category(instance->hc_fun, USB_HC_CATEGORY); 247 247 CHECK_RET_FINI_RETURN(ret, 248 248 "Failed to add OHCI to HC class: %s.\n", str_error(ret)); -
uspace/drv/bus/usb/uhci/uhci.c
r99ac5cf r1dc4a5e 267 267 str_error(ret)); 268 268 269 ret = ddf_fun_add_to_c lass(instance->hc_fun, USB_HC_DDF_CLASS_NAME);269 ret = ddf_fun_add_to_category(instance->hc_fun, USB_HC_CATEGORY); 270 270 CHECK_RET_FINI_RETURN(ret, 271 271 "Failed to add UHCI to HC class: %s.\n", str_error(ret)); -
uspace/drv/bus/usb/usbhid/kbd/kbddev.c
r99ac5cf r1dc4a5e 102 102 103 103 const char *HID_KBD_FUN_NAME = "keyboard"; 104 const char *HID_KBD_C LASS_NAME = "keyboard";104 const char *HID_KBD_CATEGORY_NAME = "keyboard"; 105 105 106 106 static void usb_kbd_set_led(usb_hid_dev_t *hid_dev, usb_kbd_t *kbd_dev); … … 551 551 HID_KBD_FUN_NAME, fun->handle); 552 552 553 usb_log_debug("Adding DDF function to c lass%s...\n",553 usb_log_debug("Adding DDF function to category %s...\n", 554 554 HID_KBD_CLASS_NAME); 555 rc = ddf_fun_add_to_c lass(fun, HID_KBD_CLASS_NAME);555 rc = ddf_fun_add_to_category(fun, HID_KBD_CATEGORY_NAME); 556 556 if (rc != EOK) { 557 557 usb_log_error( 558 "Could not add DDF function to c lass%s: %s.\n",558 "Could not add DDF function to category %s: %s.\n", 559 559 HID_KBD_CLASS_NAME, str_error(rc)); 560 560 ddf_fun_destroy(fun); -
uspace/drv/bus/usb/usbhid/mouse/mousedev.c
r99ac5cf r1dc4a5e 74 74 const char *HID_MOUSE_FUN_NAME = "mouse"; 75 75 const char *HID_MOUSE_WHEEL_FUN_NAME = "mouse-wheel"; 76 const char *HID_MOUSE_C LASS_NAME= "mouse";77 const char *HID_MOUSE_WHEEL_C LASS_NAME= "keyboard";76 const char *HID_MOUSE_CATEGORY = "mouse"; 77 const char *HID_MOUSE_WHEEL_CATEGORY = "keyboard"; 78 78 79 79 /** Default idle rate for mouses. */ … … 345 345 } 346 346 347 usb_log_debug("Adding DDF function to c lass%s...\n",348 HID_MOUSE_C LASS_NAME);349 rc = ddf_fun_add_to_c lass(fun, HID_MOUSE_CLASS_NAME);347 usb_log_debug("Adding DDF function to category %s...\n", 348 HID_MOUSE_CATEGORY); 349 rc = ddf_fun_add_to_category(fun, HID_MOUSE_CATEGORY); 350 350 if (rc != EOK) { 351 351 usb_log_error( 352 "Could not add DDF function to c lass%s: %s.\n",353 HID_MOUSE_C LASS_NAME, str_error(rc));352 "Could not add DDF function to category %s: %s.\n", 353 HID_MOUSE_CATEGORY, str_error(rc)); 354 354 ddf_fun_destroy(fun); 355 355 return rc; … … 383 383 } 384 384 385 usb_log_debug("Adding DDF function to c lass%s...\n",386 HID_MOUSE_WHEEL_C LASS_NAME);387 rc = ddf_fun_add_to_c lass(fun, HID_MOUSE_WHEEL_CLASS_NAME);385 usb_log_debug("Adding DDF function to category %s...\n", 386 HID_MOUSE_WHEEL_CATEGORY); 387 rc = ddf_fun_add_to_category(fun, HID_MOUSE_WHEEL_CATEGORY); 388 388 if (rc != EOK) { 389 389 usb_log_error( 390 "Could not add DDF function to c lass%s: %s.\n",391 HID_MOUSE_WHEEL_C LASS_NAME, str_error(rc));390 "Could not add DDF function to category %s: %s.\n", 391 HID_MOUSE_WHEEL_CATEGORY, str_error(rc)); 392 392 ddf_fun_destroy(fun); 393 393 return rc; -
uspace/drv/bus/usb/usbhid/mouse/mousedev.h
r99ac5cf r1dc4a5e 59 59 60 60 const char *HID_MOUSE_FUN_NAME; 61 const char *HID_MOUSE_C LASS_NAME;61 const char *HID_MOUSE_CATEGORY; 62 62 63 63 /*----------------------------------------------------------------------------*/ -
uspace/drv/bus/usb/usbhid/multimedia/multimedia.c
r99ac5cf r1dc4a5e 205 205 } 206 206 207 usb_log_debug("%s function created ( jandle: %" PRIun ").\n",207 usb_log_debug("%s function created (handle: %" PRIun ").\n", 208 208 NAME, fun->handle); 209 209 210 rc = ddf_fun_add_to_c lass(fun, "keyboard");210 rc = ddf_fun_add_to_category(fun, "keyboard"); 211 211 if (rc != EOK) { 212 212 usb_log_error( 213 "Could not add DDF function to c lass'keyboard': %s.\n",213 "Could not add DDF function to category 'keyboard': %s.\n", 214 214 str_error(rc)); 215 215 // TODO: Can / should I destroy the DDF function? -
uspace/drv/bus/usb/usbhub/usbhub.c
r99ac5cf r1dc4a5e 131 131 opResult = ddf_fun_bind(hub_fun); 132 132 assert(opResult == EOK); 133 opResult = ddf_fun_add_to_c lass(hub_fun, "hub");133 opResult = ddf_fun_add_to_category(hub_fun, "hub"); 134 134 assert(opResult == EOK); 135 135 -
uspace/drv/bus/usb/usbmouse/init.c
r99ac5cf r1dc4a5e 116 116 117 117 /* Add the function to mouse class. */ 118 rc = ddf_fun_add_to_c lass(mouse->mouse_fun, "mouse");118 rc = ddf_fun_add_to_category(mouse->mouse_fun, "mouse"); 119 119 if (rc != EOK) 120 120 goto leave; -
uspace/drv/bus/usb/vhc/main.c
r99ac5cf r1dc4a5e 104 104 } 105 105 106 rc = ddf_fun_add_to_c lass(hc, USB_HC_DDF_CLASS_NAME);106 rc = ddf_fun_add_to_category(hc, USB_HC_CATEGORY); 107 107 if (rc != EOK) { 108 108 usb_log_fatal("Failed to add function to HC class: %s.\n", -
uspace/drv/char/ns8250/ns8250.c
r99ac5cf r1dc4a5e 781 781 ns->fun = fun; 782 782 783 ddf_fun_add_to_c lass(fun, "serial");783 ddf_fun_add_to_category(fun, "serial"); 784 784 785 785 ddf_msg(LVL_NOTE, "Device %s successfully initialized.", -
uspace/drv/test/test1/test1.c
r99ac5cf r1dc4a5e 143 143 } 144 144 145 ddf_fun_add_to_c lass(fun_a, "virtual");145 ddf_fun_add_to_category(fun_a, "virtual"); 146 146 147 147 if (str_cmp(dev->name, "null") == 0) { 148 148 fun_a->ops = &char_device_ops; 149 ddf_fun_add_to_c lass(fun_a, "virt-null");149 ddf_fun_add_to_category(fun_a, "virt-null"); 150 150 } else if (str_cmp(dev->name, "test1") == 0) { 151 151 (void) register_fun_verbose(dev, -
uspace/drv/test/test2/test2.c
r99ac5cf r1dc4a5e 123 123 } 124 124 125 ddf_fun_add_to_c lass(fun_a, "virtual");125 ddf_fun_add_to_category(fun_a, "virtual"); 126 126 127 127 return EOK; -
uspace/drv/test/test3/test3.c
r99ac5cf r1dc4a5e 50 50 }; 51 51 52 static int register_fun_and_add_to_c lass(ddf_dev_t *parent,52 static int register_fun_and_add_to_category(ddf_dev_t *parent, 53 53 const char *base_name, size_t index, const char *class_name) 54 54 { … … 77 77 } 78 78 79 ddf_fun_add_to_c lass(fun, class_name);79 ddf_fun_add_to_category(fun, class_name); 80 80 81 81 ddf_msg(LVL_NOTE, "Registered exposed function `%s'.", fun_name); … … 100 100 size_t i; 101 101 for (i = 0; i < 20; i++) { 102 rc = register_fun_and_add_to_c lass(dev,102 rc = register_fun_and_add_to_category(dev, 103 103 "test3_", i, "test3"); 104 104 if (rc != EOK) { -
uspace/lib/c/generic/devman.c
r99ac5cf r1dc4a5e 271 271 } 272 272 273 int devman_add_device_to_c lass(devman_handle_t devman_handle,274 const char *c lass_name)273 int devman_add_device_to_category(devman_handle_t devman_handle, 274 const char *cat_name) 275 275 { 276 276 async_exch_t *exch = devman_exchange_begin_blocking(DEVMAN_DRIVER); 277 277 278 278 ipc_call_t answer; 279 aid_t req = async_send_1(exch, DEVMAN_ADD_DEVICE_TO_C LASS,279 aid_t req = async_send_1(exch, DEVMAN_ADD_DEVICE_TO_CATEGORY, 280 280 devman_handle, &answer); 281 sysarg_t retval = async_data_write_start(exch, c lass_name,282 str_size(c lass_name));281 sysarg_t retval = async_data_write_start(exch, cat_name, 282 str_size(cat_name)); 283 283 284 284 devman_exchange_end(exch); -
uspace/lib/c/include/devman.h
r99ac5cf r1dc4a5e 59 59 extern int devman_get_device_path(devman_handle_t, char *, size_t); 60 60 61 extern int devman_add_device_to_c lass(devman_handle_t, const char *);61 extern int devman_add_device_to_category(devman_handle_t, const char *); 62 62 extern int devman_fun_sid_to_handle(service_id_t, devman_handle_t *); 63 63 -
uspace/lib/c/include/ipc/devman.h
r99ac5cf r1dc4a5e 138 138 DEVMAN_ADD_FUNCTION, 139 139 DEVMAN_ADD_MATCH_ID, 140 DEVMAN_ADD_DEVICE_TO_C LASS140 DEVMAN_ADD_DEVICE_TO_CATEGORY 141 141 142 142 } driver_to_devman_t; -
uspace/lib/drv/generic/driver.c
r99ac5cf r1dc4a5e 635 635 } 636 636 637 /** Add exposed function to c lass.637 /** Add exposed function to category. 638 638 * 639 639 * Must only be called when the function is bound. 640 640 */ 641 int ddf_fun_add_to_c lass(ddf_fun_t *fun, const char *class_name)641 int ddf_fun_add_to_category(ddf_fun_t *fun, const char *cat_name) 642 642 { 643 643 assert(fun->bound == true); 644 644 assert(fun->ftype == fun_exposed); 645 645 646 return devman_add_device_to_c lass(fun->handle, class_name);646 return devman_add_device_to_category(fun->handle, cat_name); 647 647 } 648 648 -
uspace/lib/drv/include/ddf/driver.h
r99ac5cf r1dc4a5e 151 151 extern int ddf_fun_add_match_id(ddf_fun_t *, const char *, int); 152 152 153 extern int ddf_fun_add_to_c lass(ddf_fun_t *, const char *);153 extern int ddf_fun_add_to_category(ddf_fun_t *, const char *); 154 154 155 155 #endif -
uspace/lib/usb/include/usb/usb.h
r99ac5cf r1dc4a5e 174 174 } usb_packet_id; 175 175 176 /** C lass namefor USB host controllers. */177 #define USB_HC_ DDF_CLASS_NAME"usbhc"176 /** Category for USB host controllers. */ 177 #define USB_HC_CATEGORY "usbhc" 178 178 179 179 #endif -
uspace/srv/devman/main.c
r99ac5cf r1dc4a5e 332 332 } 333 333 334 static void devman_add_function_to_c lass(ipc_callid_t callid, ipc_call_t *call)334 static void devman_add_function_to_cat(ipc_callid_t callid, ipc_call_t *call) 335 335 { 336 336 devman_handle_t handle = IPC_GET_ARG1(*call); … … 338 338 int rc; 339 339 340 /* Get c lassname. */341 char *c lass_name;342 rc = async_data_write_accept((void **) &c lass_name, true,340 /* Get category name. */ 341 char *cat_name; 342 rc = async_data_write_accept((void **) &cat_name, true, 343 343 0, 0, 0, 0); 344 344 if (rc != EOK) { … … 353 353 } 354 354 355 rc = loc_category_get_id(c lass_name, &cat_id, IPC_FLAG_BLOCKING);355 rc = loc_category_get_id(cat_name, &cat_id, IPC_FLAG_BLOCKING); 356 356 if (rc == EOK) { 357 357 loc_service_add_to_cat(fun->service_id, cat_id); 358 358 } else { 359 359 log_msg(LVL_ERROR, "Failed adding function `%s' to category " 360 "`%s'.", fun->pathname, c lass_name);361 } 362 363 log_msg(LVL_NOTE, "Function `%s' added to c lass`%s'.",364 fun->pathname, c lass_name);360 "`%s'.", fun->pathname, cat_name); 361 } 362 363 log_msg(LVL_NOTE, "Function `%s' added to category `%s'.", 364 fun->pathname, cat_name); 365 365 366 366 async_answer_0(callid, EOK); … … 416 416 devman_add_function(callid, &call); 417 417 break; 418 case DEVMAN_ADD_DEVICE_TO_C LASS:419 devman_add_function_to_c lass(callid, &call);418 case DEVMAN_ADD_DEVICE_TO_CATEGORY: 419 devman_add_function_to_cat(callid, &call); 420 420 break; 421 421 default:
Note:
See TracChangeset
for help on using the changeset viewer.