Changeset 4e78236 in mainline
- Timestamp:
- 2011-05-24T19:10:49Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d7c72db
- Parents:
- e7079cf
- Location:
- uspace
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/mkbd/Makefile
re7079cf r4e78236 31 31 32 32 LIBS = \ 33 $(LIBUSBHID_PREFIX)/libusbhid.a \ 33 34 $(LIBUSBDEV_PREFIX)/libusbdev.a \ 34 35 $(LIBUSB_PREFIX)/libusb.a \ 35 $(LIBDRV_PREFIX)/libdrv.a \ 36 $(LIBUSBHID_PREFIX)/libusbhid.a 36 $(LIBDRV_PREFIX)/libdrv.a 37 37 EXTRA_CFLAGS = \ 38 38 -I$(LIBUSB_PREFIX)/include \ -
uspace/app/mkbd/main.c
re7079cf r4e78236 49 49 #include <usb/hid/iface.h> 50 50 #include <usb/dev/pipes.h> 51 #include <async.h> 51 52 52 53 #define NAME "mkbd" … … 229 230 } 230 231 231 char *devpath = argv[1]; 232 //char *devpath = argv[1]; 233 const char *devpath = "/hw/pci0/00:06.0/ohci-rh/usb00_a2/HID0/hid"; 232 234 233 235 // /* The initialization is here only to make compiler happy. */ … … 323 325 324 326 printf("Got buffer: %p, size: %zu\n", event, actual_size); 327 328 async_usleep(10000); 325 329 } 326 330 -
uspace/drv/usbhid/generic/hiddev.c
re7079cf r4e78236 83 83 static size_t usb_generic_hid_get_event_length(ddf_fun_t *fun) 84 84 { 85 usb_log_debug("Generic HID: Get event length.\n"); 85 usb_log_debug("Generic HID: Get event length (fun: %p, " 86 "fun->driver_data: %p.\n", fun, fun->driver_data); 86 87 87 if (fun == NULL || fun->driver_data ) {88 if (fun == NULL || fun->driver_data == NULL) { 88 89 return 0; 89 90 } … … 91 92 usb_hid_dev_t *hid_dev = (usb_hid_dev_t *)fun->driver_data; 92 93 93 return hid_dev->input_report_size; 94 usb_log_debug("hid_dev: %p, Max input report size (%d).\n", 95 hid_dev, hid_dev->max_input_report_size); 96 97 return hid_dev->max_input_report_size; 94 98 } 95 99 … … 101 105 usb_log_debug("Generic HID: Get event.\n"); 102 106 103 if (fun == NULL || fun->driver_data) { 107 if (fun == NULL || fun->driver_data == NULL) { 108 usb_log_debug("No function"); 104 109 return EINVAL; 105 110 } -
uspace/lib/drv/Makefile
re7079cf r4e78236 40 40 generic/remote_usb.c \ 41 41 generic/remote_pci.c \ 42 generic/remote_usbhc.c 42 generic/remote_usbhc.c \ 43 generic/remote_usbhid.c 43 44 44 45 include $(USPACE_PREFIX)/Makefile.common -
uspace/lib/drv/generic/dev_iface.c
re7079cf r4e78236 46 46 #include "remote_pci.h" 47 47 48 #include <stdio.h> 49 48 50 static iface_dipatch_table_t remote_ifaces = { 49 51 .ifaces = { … … 59 61 remote_iface_t *get_remote_iface(int idx) 60 62 { 63 printf("get_remote_iface(): idx: %d\n", idx); 61 64 assert(is_valid_iface_idx(idx)); 65 printf("remote iface: %p\n", remote_ifaces.ifaces[idx]); 66 67 printf("remote_usbhid_iface ptr: %p\n", &remote_usbhid_iface); 68 62 69 return remote_ifaces.ifaces[idx]; 63 70 } … … 66 73 get_remote_method(remote_iface_t *rem_iface, sysarg_t iface_method_idx) 67 74 { 75 printf("remote iface: %p\n", rem_iface); 76 printf("Method count: %d\n", rem_iface->method_count); 68 77 if (iface_method_idx >= rem_iface->method_count) { 69 78 return NULL; -
uspace/lib/drv/generic/driver.c
re7079cf r4e78236 397 397 * handling ("remote interface"). 398 398 */ 399 printf("iface_idx: %d\n", iface_idx); 399 400 remote_iface_t *rem_iface = get_remote_iface(iface_idx); 400 401 assert(rem_iface != NULL); -
uspace/lib/drv/generic/remote_usbhid.c
re7079cf r4e78236 36 36 #include <errno.h> 37 37 #include <assert.h> 38 #include <stdio.h> 38 39 39 40 #include "usbhid_iface.h" … … 58 59 }; 59 60 60 usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface;61 //usbhc_iface_t *usb_iface = (usbhc_iface_t *) iface; 61 62 62 63 … … 75 76 76 77 size_t len = hid_iface->get_event_length(fun); 77 if (len == 0) { 78 len = EEMPTY; 79 } 80 if (len < 0) { 81 async_answer_0(callid, len); 82 } else { 83 async_answer_1(callid, EOK, len); 84 } 78 // if (len == 0) { 79 // len = EEMPTY; 80 // } 81 async_answer_1(callid, EOK, len); 82 83 // if (len < 0) { 84 // async_answer_0(callid, len); 85 // } else { 86 // async_answer_1(callid, EOK, len); 87 // } 85 88 } 86 89 -
uspace/lib/drv/include/remote_usbhid.h
re7079cf r4e78236 36 36 #define LIBDRV_REMOTE_USBHID_H_ 37 37 38 remote_iface_t remote_usbhid_iface;38 extern remote_iface_t remote_usbhid_iface; 39 39 40 40 #endif -
uspace/lib/usbhid/src/hidiface.c
re7079cf r4e78236 86 86 return EINVAL; 87 87 } 88 89 // if (size == 0) { 90 // return EOK; 91 // } 88 92 89 93 size_t buffer_size = size;
Note:
See TracChangeset
for help on using the changeset viewer.