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: #6 $
00004  * $Date: 2009/04/03 $
00005  * $Change: 1225059 $
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 
00107 struct dwc_otg_pcd_function_ops {
00108         dwc_connect_cb_t connect;
00109         dwc_disconnect_cb_t disconnect;
00110         dwc_setup_cb_t setup;
00111         dwc_completion_cb_t complete;
00112         dwc_isoc_completion_cb_t isoc_complete;
00113         dwc_suspend_cb_t suspend;
00114         dwc_sleep_cb_t sleep;
00115         dwc_resume_cb_t resume;
00116         dwc_reset_cb_t reset;
00117         dwc_hnp_params_changed_cb_t hnp_changed;
00118         cfi_setup_cb_t cfi_setup;
00119 };
00130 extern dwc_otg_pcd_t *dwc_otg_pcd_init(dwc_otg_core_if_t * core_if);
00131 
00136 extern void dwc_otg_pcd_remove(dwc_otg_pcd_t * pcd);
00137 
00143 extern void dwc_otg_pcd_start(dwc_otg_pcd_t * pcd,
00144                               const struct dwc_otg_pcd_function_ops *fops);
00145 
00161 extern int dwc_otg_pcd_ep_enable(dwc_otg_pcd_t * pcd,
00162                                  const uint8_t * ep_desc, void *ep_handle);
00163 
00169 extern int dwc_otg_pcd_ep_disable(dwc_otg_pcd_t * pcd, void *ep_handle);
00170 
00189 extern int dwc_otg_pcd_ep_queue(dwc_otg_pcd_t * pcd, void *ep_handle,
00190                                 uint8_t * buf, dwc_dma_t dma_buf,
00191                                 uint32_t buflen, int zero, void *req_handle,
00192                                 int atomic_alloc);
00193 
00199 extern int dwc_otg_pcd_ep_dequeue(dwc_otg_pcd_t * pcd, void *ep_handle,
00200                                   void *req_handle);
00201 
00208 extern int dwc_otg_pcd_ep_halt(dwc_otg_pcd_t * pcd, void *ep_handle, int value);
00209 
00211 extern int32_t dwc_otg_pcd_handle_intr(dwc_otg_pcd_t * pcd);
00212 
00214 extern int dwc_otg_pcd_get_frame_number(dwc_otg_pcd_t * pcd);
00215 
00242 extern int dwc_otg_pcd_iso_ep_start(dwc_otg_pcd_t * pcd, void *ep_handle,
00243                                     uint8_t * buf0, uint8_t * buf1,
00244                                     dwc_dma_t dma0, dwc_dma_t dma1,
00245                                     int sync_frame, int dp_frame,
00246                                     int data_per_frame, int start_frame,
00247                                     int buf_proc_intrvl, void *req_handle,
00248                                     int atomic_alloc);
00249 
00259 int dwc_otg_pcd_iso_ep_stop(dwc_otg_pcd_t * pcd, void *ep_handle,
00260                             void *req_handle);
00261 
00273 extern void dwc_otg_pcd_get_iso_packet_params(dwc_otg_pcd_t * pcd,
00274                                               void *ep_handle,
00275                                               void *iso_req_handle, int packet,
00276                                               int *status, int *actual,
00277                                               int *offset);
00278 
00285 extern int dwc_otg_pcd_get_iso_packet_count(dwc_otg_pcd_t * pcd,
00286                                             void *ep_handle,
00287                                             void *iso_req_handle);
00288 
00293 extern int dwc_otg_pcd_wakeup(dwc_otg_pcd_t * pcd);
00294 
00296 extern int dwc_otg_pcd_is_lpm_enabled(dwc_otg_pcd_t * pcd);
00297 
00299 extern int dwc_otg_pcd_get_rmwkup_enable(dwc_otg_pcd_t * pcd);
00300 
00302 extern void dwc_otg_pcd_initiate_srp(dwc_otg_pcd_t * pcd);
00303 
00305 extern void dwc_otg_pcd_remote_wakeup(dwc_otg_pcd_t * pcd, int set);
00306 
00308 extern uint32_t dwc_otg_pcd_is_dualspeed(dwc_otg_pcd_t * pcd);
00309 
00311 extern uint32_t dwc_otg_pcd_is_otg(dwc_otg_pcd_t * pcd);
00312 
00314 extern uint32_t get_b_hnp_enable(dwc_otg_pcd_t * pcd);
00315 extern uint32_t get_a_hnp_support(dwc_otg_pcd_t * pcd);
00316 extern uint32_t get_a_alt_hnp_support(dwc_otg_pcd_t * pcd);
00317 
00320 extern uint8_t *cfiw_ep_alloc_buffer(dwc_otg_pcd_t * pcd, void *pep,
00321                                      dwc_dma_t * addr, size_t buflen,
00322                                      int flags);
00323 
00324 /******************************************************************************/
00325 
00328 #endif                          /* __DWC_PCD_IF_H__ */
00329 
00330 #endif                          /* DWC_HOST_ONLY */

Generated on Tue May 5 02:22:48 2009 for DesignWare USB 2.0 OTG Controller (DWC_otg) Device Driver by  doxygen 1.4.7