00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00034 #include <ddf/driver.h>
00035 #include <ddf/interrupt.h>
00036 #include <device/hw_res.h>
00037 #include <errno.h>
00038 #include <str_error.h>
00039
00040 #include <usb_iface.h>
00041 #include <usb/ddfiface.h>
00042 #include <usb/debug.h>
00043
00044 #include "ehci.h"
00045
00046 #define UNSUPPORTED(methodname) \
00047 usb_log_warning("Unsupported interface method `%s()' in %s:%d.\n", \
00048 methodname, __FILE__, __LINE__)
00049
00057 static int request_address(ddf_fun_t *fun, usb_speed_t speed,
00058 usb_address_t *address)
00059 {
00060 UNSUPPORTED("request_address");
00061
00062 return ENOTSUP;
00063 }
00064
00072 static int bind_address(ddf_fun_t *fun,
00073 usb_address_t address, devman_handle_t handle)
00074 {
00075 UNSUPPORTED("bind_address");
00076
00077 return ENOTSUP;
00078 }
00079
00087 static int find_by_address(ddf_fun_t *fun, usb_address_t address,
00088 devman_handle_t *handle)
00089 {
00090 UNSUPPORTED("find_by_address");
00091
00092 return ENOTSUP;
00093 }
00094
00101 static int release_address(ddf_fun_t *fun, usb_address_t address)
00102 {
00103 UNSUPPORTED("release_address");
00104
00105 return ENOTSUP;
00106 }
00107
00120 static int register_endpoint(ddf_fun_t *fun,
00121 usb_address_t address, usb_speed_t speed, usb_endpoint_t endpoint,
00122 usb_transfer_type_t transfer_type, usb_direction_t direction,
00123 size_t max_packet_size, unsigned int interval)
00124 {
00125 UNSUPPORTED("register_endpoint");
00126
00127 return ENOTSUP;
00128 }
00129
00138 static int unregister_endpoint(ddf_fun_t *fun, usb_address_t address,
00139 usb_endpoint_t endpoint, usb_direction_t direction)
00140 {
00141 UNSUPPORTED("unregister_endpoint");
00142
00143 return ENOTSUP;
00144 }
00145
00162 static int interrupt_out(ddf_fun_t *fun, usb_target_t target,
00163 void *data, size_t size,
00164 usbhc_iface_transfer_out_callback_t callback, void *arg)
00165 {
00166 UNSUPPORTED("interrupt_out");
00167
00168 return ENOTSUP;
00169 }
00170
00187 static int interrupt_in(ddf_fun_t *fun, usb_target_t target,
00188 void *data, size_t size,
00189 usbhc_iface_transfer_in_callback_t callback, void *arg)
00190 {
00191 UNSUPPORTED("interrupt_in");
00192
00193 return ENOTSUP;
00194 }
00195
00212 static int bulk_out(ddf_fun_t *fun, usb_target_t target,
00213 void *data, size_t size,
00214 usbhc_iface_transfer_out_callback_t callback, void *arg)
00215 {
00216 UNSUPPORTED("bulk_out");
00217
00218 return ENOTSUP;
00219 }
00220
00237 static int bulk_in(ddf_fun_t *fun, usb_target_t target,
00238 void *data, size_t size,
00239 usbhc_iface_transfer_in_callback_t callback, void *arg)
00240 {
00241 UNSUPPORTED("bulk_in");
00242
00243 return ENOTSUP;
00244 }
00245
00265 static int control_write(ddf_fun_t *fun, usb_target_t target,
00266 void *setup_packet, size_t setup_packet_size,
00267 void *data_buffer, size_t data_buffer_size,
00268 usbhc_iface_transfer_out_callback_t callback, void *arg)
00269 {
00270 UNSUPPORTED("control_write");
00271
00272 return ENOTSUP;
00273 }
00274
00294 static int control_read(ddf_fun_t *fun, usb_target_t target,
00295 void *setup_packet, size_t setup_packet_size,
00296 void *data_buffer, size_t data_buffer_size,
00297 usbhc_iface_transfer_in_callback_t callback, void *arg)
00298 {
00299 UNSUPPORTED("control_read");
00300
00301 return ENOTSUP;
00302 }
00303
00305 usbhc_iface_t ehci_hc_iface = {
00306 .request_address = request_address,
00307 .bind_address = bind_address,
00308 .find_by_address = find_by_address,
00309 .release_address = release_address,
00310
00311 .register_endpoint = register_endpoint,
00312 .unregister_endpoint = unregister_endpoint,
00313
00314 .interrupt_out = interrupt_out,
00315 .interrupt_in = interrupt_in,
00316
00317 .bulk_out = bulk_out,
00318 .bulk_in = bulk_in,
00319
00320 .control_write = control_write,
00321 .control_read = control_read
00322 };
00323