hc_iface.c

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2011 Vojtech Horky
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * - Redistributions of source code must retain the above copyright
00010  *   notice, this list of conditions and the following disclaimer.
00011  * - Redistributions in binary form must reproduce the above copyright
00012  *   notice, this list of conditions and the following disclaimer in the
00013  *   documentation and/or other materials provided with the distribution.
00014  * - The name of the author may not be used to endorse or promote products
00015  *   derived from this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00018  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00019  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00020  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00021  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00022  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00023  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00024  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00025  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00026  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
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 

Generated on Thu Jun 2 07:45:43 2011 for HelenOS/USB by  doxygen 1.4.7