Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

dwc_otg_pcd_if.h

Go to the documentation of this file.
00001 /* ==========================================================================
00002  * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd_if.h $
00003  * $Revision: #11 $
00004  * $Date: 2011/10/26 $
00005  * $Change: 1873028 $
00006  *
00007  * Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
00008  * "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
00009  * otherwise expressly agreed to in writing between Synopsys and you.
00010  *
00011  * The Software IS NOT an item of Licensed Software or Licensed Product under
00012  * any End User Software License Agreement or Agreement for Licensed Product
00013  * with Synopsys or any supplement thereto. You are permitted to use and
00014  * redistribute this Software in source and binary forms, with or without
00015  * modification, provided that redistributions of source code must retain this
00016  * notice. You may not view, use, disclose, copy or distribute this file or
00017  * any information contained herein except pursuant to this license grant from
00018  * Synopsys. If you do not agree with this notice, including the disclaimer
00019  * below, then you are not authorized to use the Software.
00020  *
00021  * THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
00022  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00023  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00024  * ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
00025  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00026  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00027  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00028  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00029  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00030  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00031  * DAMAGE.
00032  * ========================================================================== */
00033 #ifndef DWC_HOST_ONLY
00034 
00035 #if !defined(__DWC_PCD_IF_H__)
00036 #define __DWC_PCD_IF_H__
00037 
00038 //#include "dwc_os.h"
00039 #include "dwc_otg_core_if.h"
00040 
00045 struct dwc_otg_pcd;
00046 typedef struct dwc_otg_pcd dwc_otg_pcd_t;
00047 
00049 #define MAX_EP0_SIZE    64
00050 
00051 #define MAX_PACKET_SIZE 1024
00052 
00061 typedef int (*dwc_completion_cb_t) (dwc_otg_pcd_t * pcd, void *ep_handle,
00062                                     void *req_handle, int32_t status,
00063                                     uint32_t actual);
00071 typedef int (*dwc_isoc_completion_cb_t) (dwc_otg_pcd_t * pcd, void *ep_handle,
00072                                          void *req_handle, int proc_buf_num);
00081 typedef int (*dwc_setup_cb_t) (dwc_otg_pcd_t * pcd, uint8_t * bytes);
00086 typedef int (*dwc_disconnect_cb_t) (dwc_otg_pcd_t * pcd);
00088 typedef int (*dwc_connect_cb_t) (dwc_otg_pcd_t * pcd, int speed);
00090 typedef int (*dwc_suspend_cb_t) (dwc_otg_pcd_t * pcd);
00093 typedef int (*dwc_sleep_cb_t) (dwc_otg_pcd_t * pcd);
00096 typedef int (*dwc_resume_cb_t) (dwc_otg_pcd_t * pcd);
00100 typedef int (*dwc_hnp_params_changed_cb_t) (dwc_otg_pcd_t * pcd);
00102 typedef int (*dwc_reset_cb_t) (dwc_otg_pcd_t * pcd);
00103 
00104 typedef int (*cfi_setup_cb_t) (dwc_otg_pcd_t * pcd, void *ctrl_req_bytes);
00105 
00112 typedef int (*xiso_completion_cb_t) (dwc_otg_pcd_t * pcd, void *ep_handle,
00113                                      void *req_handle, int32_t status,
00114                                      void *ereq_port);
00116 struct dwc_otg_pcd_function_ops {
00117         dwc_connect_cb_t connect;
00118         dwc_disconnect_cb_t disconnect;
00119         dwc_setup_cb_t setup;
00120         dwc_completion_cb_t complete;
00121         dwc_isoc_completion_cb_t isoc_complete;
00122         dwc_suspend_cb_t suspend;
00123         dwc_sleep_cb_t sleep;
00124         dwc_resume_cb_t resume;
00125         dwc_reset_cb_t reset;
00126         dwc_hnp_params_changed_cb_t hnp_changed;
00127         cfi_setup_cb_t cfi_setup;
00128 #ifdef DWC_UTE_PER_IO
00129         xiso_completion_cb_t xisoc_complete;
00130 #endif
00131 };
00142 extern dwc_otg_pcd_t *dwc_otg_pcd_init(dwc_otg_core_if_t * core_if);
00143 
00148 extern void dwc_otg_pcd_remove(dwc_otg_pcd_t * pcd);
00149 
00155 extern void dwc_otg_pcd_start(dwc_otg_pcd_t * pcd,
00156                               const struct dwc_otg_pcd_function_ops *fops);
00157 
00173 extern int dwc_otg_pcd_ep_enable(dwc_otg_pcd_t * pcd,
00174                                  const uint8_t * ep_desc, void *usb_ep);
00175 
00181 extern int dwc_otg_pcd_ep_disable(dwc_otg_pcd_t * pcd, void *ep_handle);
00182 
00201 extern int dwc_otg_pcd_ep_queue(dwc_otg_pcd_t * pcd, void *ep_handle,
00202                                 uint8_t * buf, dwc_dma_t dma_buf,
00203                                 uint32_t buflen, int zero, void *req_handle,
00204                                 int atomic_alloc);
00205 #ifdef DWC_UTE_PER_IO
00206 
00211 extern int dwc_otg_pcd_xiso_ep_queue(dwc_otg_pcd_t * pcd, void *ep_handle,
00212                                      uint8_t * buf, dwc_dma_t dma_buf,
00213                                      uint32_t buflen, int zero,
00214                                      void *req_handle, int atomic_alloc,
00215                                      void *ereq_nonport);
00216 
00217 #endif
00218 
00224 extern int dwc_otg_pcd_ep_dequeue(dwc_otg_pcd_t * pcd, void *ep_handle,
00225                                   void *req_handle);
00226 
00233 extern int dwc_otg_pcd_ep_halt(dwc_otg_pcd_t * pcd, void *ep_handle, int value);
00234 
00236 extern int32_t dwc_otg_pcd_handle_intr(dwc_otg_pcd_t * pcd);
00237 
00239 extern int dwc_otg_pcd_get_frame_number(dwc_otg_pcd_t * pcd);
00240 
00267 extern int dwc_otg_pcd_iso_ep_start(dwc_otg_pcd_t * pcd, void *ep_handle,
00268                                     uint8_t * buf0, uint8_t * buf1,
00269                                     dwc_dma_t dma0, dwc_dma_t dma1,
00270                                     int sync_frame, int dp_frame,
00271                                     int data_per_frame, int start_frame,
00272                                     int buf_proc_intrvl, void *req_handle,
00273                                     int atomic_alloc);
00274 
00284 int dwc_otg_pcd_iso_ep_stop(dwc_otg_pcd_t * pcd, void *ep_handle,
00285                             void *req_handle);
00286 
00298 extern void dwc_otg_pcd_get_iso_packet_params(dwc_otg_pcd_t * pcd,
00299                                               void *ep_handle,
00300                                               void *iso_req_handle, int packet,
00301                                               int *status, int *actual,
00302                                               int *offset);
00303 
00310 extern int dwc_otg_pcd_get_iso_packet_count(dwc_otg_pcd_t * pcd,
00311                                             void *ep_handle,
00312                                             void *iso_req_handle);
00313 
00318 extern int dwc_otg_pcd_wakeup(dwc_otg_pcd_t * pcd);
00319 
00321 extern int dwc_otg_pcd_is_lpm_enabled(dwc_otg_pcd_t * pcd);
00322 
00324 extern int dwc_otg_pcd_get_rmwkup_enable(dwc_otg_pcd_t * pcd);
00325 
00327 extern void dwc_otg_pcd_initiate_srp(dwc_otg_pcd_t * pcd);
00328 
00330 extern void dwc_otg_pcd_remote_wakeup(dwc_otg_pcd_t * pcd, int set);
00331 
00333 extern void dwc_otg_pcd_disconnect_us(dwc_otg_pcd_t * pcd, int no_of_usecs);
00335 extern uint32_t dwc_otg_pcd_is_dualspeed(dwc_otg_pcd_t * pcd);
00336 
00338 extern uint32_t dwc_otg_pcd_is_otg(dwc_otg_pcd_t * pcd);
00339 
00341 extern uint32_t get_b_hnp_enable(dwc_otg_pcd_t * pcd);
00342 extern uint32_t get_a_hnp_support(dwc_otg_pcd_t * pcd);
00343 extern uint32_t get_a_alt_hnp_support(dwc_otg_pcd_t * pcd);
00344 
00347 extern uint8_t *cfiw_ep_alloc_buffer(dwc_otg_pcd_t * pcd, void *pep,
00348                                      dwc_dma_t * addr, size_t buflen,
00349                                      int flags);
00350 
00351 /******************************************************************************/
00352 
00355 #endif                          /* __DWC_PCD_IF_H__ */
00356 
00357 #endif                          /* DWC_HOST_ONLY */

Generated on Thu Oct 27 03:56:37 2011 for DesignWare USB 2.0 OTG Controller (DWC_otg) Device Driver by  doxygen 1.3.9.1