mirror of
https://github.com/rtlduino/RTL8710AF_GCC.git
synced 2026-07-13 23:05:41 +00:00
motify compile link error
motify compile link error
This commit is contained in:
parent
923914edae
commit
03e74a8e50
5418 changed files with 1367914 additions and 206149 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -1,82 +1,82 @@
|
|||
/* ==========================================================================
|
||||
* $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_adp.h $
|
||||
* $Revision: #8 $
|
||||
* $Date: 2013/04/09 $
|
||||
* $Change: 2201932 $
|
||||
*
|
||||
* Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
|
||||
* "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
|
||||
* otherwise expressly agreed to in writing between Synopsys and you.
|
||||
*
|
||||
* The Software IS NOT an item of Licensed Software or Licensed Product under
|
||||
* any End User Software License Agreement or Agreement for Licensed Product
|
||||
* with Synopsys or any supplement thereto. You are permitted to use and
|
||||
* redistribute this Software in source and binary forms, with or without
|
||||
* modification, provided that redistributions of source code must retain this
|
||||
* notice. You may not view, use, disclose, copy or distribute this file or
|
||||
* any information contained herein except pursuant to this license grant from
|
||||
* Synopsys. If you do not agree with this notice, including the disclaimer
|
||||
* below, then you are not authorized to use the Software.
|
||||
*
|
||||
* THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
* ========================================================================== */
|
||||
|
||||
#ifndef __DWC_OTG_ADP_H__
|
||||
#define __DWC_OTG_ADP_H__
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* This file contains the Attach Detect Protocol interfaces and defines
|
||||
* (functions) and structures for Linux.
|
||||
*
|
||||
*/
|
||||
|
||||
#define DWC_OTG_ADP_UNATTACHED 0
|
||||
#define DWC_OTG_ADP_ATTACHED 1
|
||||
#define DWC_OTG_ADP_UNKOWN 2
|
||||
#define HOST_RTIM_THRESHOLD 5
|
||||
#define DEVICE_RTIM_THRESHOLD 3
|
||||
|
||||
typedef struct dwc_otg_adp {
|
||||
uint32_t adp_started;
|
||||
uint32_t initial_probe;
|
||||
int32_t probe_timer_values[2];
|
||||
uint32_t probe_enabled;
|
||||
uint32_t sense_enabled;
|
||||
dwc_timer_t *sense_timer;
|
||||
uint32_t sense_timer_started;
|
||||
dwc_timer_t *vbuson_timer;
|
||||
uint32_t vbuson_timer_started;
|
||||
uint32_t attached;
|
||||
uint32_t probe_counter;
|
||||
uint32_t gpwrdn;
|
||||
} dwc_otg_adp_t;
|
||||
|
||||
/**
|
||||
* Attach Detect Protocol functions
|
||||
*/
|
||||
|
||||
extern void dwc_otg_adp_write_reg(dwc_otg_core_if_t * core_if, uint32_t value);
|
||||
extern uint32_t dwc_otg_adp_read_reg(dwc_otg_core_if_t * core_if);
|
||||
extern uint32_t dwc_otg_adp_probe_start(dwc_otg_core_if_t * core_if);
|
||||
extern uint32_t dwc_otg_adp_sense_start(dwc_otg_core_if_t * core_if);
|
||||
extern uint32_t dwc_otg_adp_probe_stop(dwc_otg_core_if_t * core_if);
|
||||
extern uint32_t dwc_otg_adp_sense_stop(dwc_otg_core_if_t * core_if);
|
||||
extern void dwc_otg_adp_start(dwc_otg_core_if_t * core_if, uint8_t is_host);
|
||||
extern void dwc_otg_adp_init(dwc_otg_core_if_t * core_if);
|
||||
extern void dwc_otg_adp_remove(dwc_otg_core_if_t * core_if);
|
||||
extern int32_t dwc_otg_adp_handle_intr(dwc_otg_core_if_t * core_if);
|
||||
extern int32_t dwc_otg_adp_handle_srp_intr(dwc_otg_core_if_t * core_if);
|
||||
|
||||
#endif //__DWC_OTG_ADP_H__
|
||||
/* ==========================================================================
|
||||
* $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_adp.h $
|
||||
* $Revision: #8 $
|
||||
* $Date: 2013/04/09 $
|
||||
* $Change: 2201932 $
|
||||
*
|
||||
* Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
|
||||
* "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
|
||||
* otherwise expressly agreed to in writing between Synopsys and you.
|
||||
*
|
||||
* The Software IS NOT an item of Licensed Software or Licensed Product under
|
||||
* any End User Software License Agreement or Agreement for Licensed Product
|
||||
* with Synopsys or any supplement thereto. You are permitted to use and
|
||||
* redistribute this Software in source and binary forms, with or without
|
||||
* modification, provided that redistributions of source code must retain this
|
||||
* notice. You may not view, use, disclose, copy or distribute this file or
|
||||
* any information contained herein except pursuant to this license grant from
|
||||
* Synopsys. If you do not agree with this notice, including the disclaimer
|
||||
* below, then you are not authorized to use the Software.
|
||||
*
|
||||
* THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
* ========================================================================== */
|
||||
|
||||
#ifndef __DWC_OTG_ADP_H__
|
||||
#define __DWC_OTG_ADP_H__
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* This file contains the Attach Detect Protocol interfaces and defines
|
||||
* (functions) and structures for Linux.
|
||||
*
|
||||
*/
|
||||
|
||||
#define DWC_OTG_ADP_UNATTACHED 0
|
||||
#define DWC_OTG_ADP_ATTACHED 1
|
||||
#define DWC_OTG_ADP_UNKOWN 2
|
||||
#define HOST_RTIM_THRESHOLD 5
|
||||
#define DEVICE_RTIM_THRESHOLD 3
|
||||
|
||||
typedef struct dwc_otg_adp {
|
||||
uint32_t adp_started;
|
||||
uint32_t initial_probe;
|
||||
int32_t probe_timer_values[2];
|
||||
uint32_t probe_enabled;
|
||||
uint32_t sense_enabled;
|
||||
dwc_timer_t *sense_timer;
|
||||
uint32_t sense_timer_started;
|
||||
dwc_timer_t *vbuson_timer;
|
||||
uint32_t vbuson_timer_started;
|
||||
uint32_t attached;
|
||||
uint32_t probe_counter;
|
||||
uint32_t gpwrdn;
|
||||
} dwc_otg_adp_t;
|
||||
|
||||
/**
|
||||
* Attach Detect Protocol functions
|
||||
*/
|
||||
|
||||
extern void dwc_otg_adp_write_reg(dwc_otg_core_if_t * core_if, uint32_t value);
|
||||
extern uint32_t dwc_otg_adp_read_reg(dwc_otg_core_if_t * core_if);
|
||||
extern uint32_t dwc_otg_adp_probe_start(dwc_otg_core_if_t * core_if);
|
||||
extern uint32_t dwc_otg_adp_sense_start(dwc_otg_core_if_t * core_if);
|
||||
extern uint32_t dwc_otg_adp_probe_stop(dwc_otg_core_if_t * core_if);
|
||||
extern uint32_t dwc_otg_adp_sense_stop(dwc_otg_core_if_t * core_if);
|
||||
extern void dwc_otg_adp_start(dwc_otg_core_if_t * core_if, uint8_t is_host);
|
||||
extern void dwc_otg_adp_init(dwc_otg_core_if_t * core_if);
|
||||
extern void dwc_otg_adp_remove(dwc_otg_core_if_t * core_if);
|
||||
extern int32_t dwc_otg_adp_handle_intr(dwc_otg_core_if_t * core_if);
|
||||
extern int32_t dwc_otg_adp_handle_srp_intr(dwc_otg_core_if_t * core_if);
|
||||
|
||||
#endif //__DWC_OTG_ADP_H__
|
||||
|
|
|
|||
|
|
@ -1,86 +1,86 @@
|
|||
/* ==========================================================================
|
||||
* $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_attr.h $
|
||||
* $Revision: #13 $
|
||||
* $Date: 2010/06/21 $
|
||||
* $Change: 1532021 $
|
||||
*
|
||||
* Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
|
||||
* "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
|
||||
* otherwise expressly agreed to in writing between Synopsys and you.
|
||||
*
|
||||
* The Software IS NOT an item of Licensed Software or Licensed Product under
|
||||
* any End User Software License Agreement or Agreement for Licensed Product
|
||||
* with Synopsys or any supplement thereto. You are permitted to use and
|
||||
* redistribute this Software in source and binary forms, with or without
|
||||
* modification, provided that redistributions of source code must retain this
|
||||
* notice. You may not view, use, disclose, copy or distribute this file or
|
||||
* any information contained herein except pursuant to this license grant from
|
||||
* Synopsys. If you do not agree with this notice, including the disclaimer
|
||||
* below, then you are not authorized to use the Software.
|
||||
*
|
||||
* THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
* ========================================================================== */
|
||||
|
||||
#if !defined(__DWC_OTG_ATTR_H__)
|
||||
#define __DWC_OTG_ATTR_H__
|
||||
#if 0
|
||||
/** @file
|
||||
* This file contains the interface to the Linux device attributes.
|
||||
*/
|
||||
extern struct device_attribute dev_attr_regoffset;
|
||||
extern struct device_attribute dev_attr_regvalue;
|
||||
|
||||
extern struct device_attribute dev_attr_mode;
|
||||
extern struct device_attribute dev_attr_hnpcapable;
|
||||
extern struct device_attribute dev_attr_srpcapable;
|
||||
extern struct device_attribute dev_attr_hnp;
|
||||
extern struct device_attribute dev_attr_srp;
|
||||
extern struct device_attribute dev_attr_buspower;
|
||||
extern struct device_attribute dev_attr_bussuspend;
|
||||
extern struct device_attribute dev_attr_mode_ch_tim_en;
|
||||
extern struct device_attribute dev_attr_fr_interval;
|
||||
extern struct device_attribute dev_attr_busconnected;
|
||||
extern struct device_attribute dev_attr_gotgctl;
|
||||
extern struct device_attribute dev_attr_gusbcfg;
|
||||
extern struct device_attribute dev_attr_grxfsiz;
|
||||
extern struct device_attribute dev_attr_gnptxfsiz;
|
||||
extern struct device_attribute dev_attr_gpvndctl;
|
||||
extern struct device_attribute dev_attr_ggpio;
|
||||
extern struct device_attribute dev_attr_guid;
|
||||
extern struct device_attribute dev_attr_gsnpsid;
|
||||
extern struct device_attribute dev_attr_devspeed;
|
||||
extern struct device_attribute dev_attr_enumspeed;
|
||||
extern struct device_attribute dev_attr_hptxfsiz;
|
||||
extern struct device_attribute dev_attr_hprt0;
|
||||
#ifdef CONFIG_USB_DWC_OTG_LPM
|
||||
extern struct device_attribute dev_attr_lpm_response;
|
||||
extern struct device_attribute devi_attr_sleep_status;
|
||||
#endif
|
||||
|
||||
void dwc_otg_attr_create(
|
||||
#ifdef LM_INTERFACE
|
||||
struct lm_device *dev
|
||||
#elif PCI_INTERFACE
|
||||
struct pci_dev *dev
|
||||
#endif
|
||||
);
|
||||
|
||||
void dwc_otg_attr_remove(
|
||||
#ifdef LM_INTERFACE
|
||||
struct lm_device *dev
|
||||
#elif PCI_INTERFACE
|
||||
struct pci_dev *dev
|
||||
#endif
|
||||
);
|
||||
#endif
|
||||
#endif
|
||||
/* ==========================================================================
|
||||
* $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_attr.h $
|
||||
* $Revision: #13 $
|
||||
* $Date: 2010/06/21 $
|
||||
* $Change: 1532021 $
|
||||
*
|
||||
* Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
|
||||
* "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
|
||||
* otherwise expressly agreed to in writing between Synopsys and you.
|
||||
*
|
||||
* The Software IS NOT an item of Licensed Software or Licensed Product under
|
||||
* any End User Software License Agreement or Agreement for Licensed Product
|
||||
* with Synopsys or any supplement thereto. You are permitted to use and
|
||||
* redistribute this Software in source and binary forms, with or without
|
||||
* modification, provided that redistributions of source code must retain this
|
||||
* notice. You may not view, use, disclose, copy or distribute this file or
|
||||
* any information contained herein except pursuant to this license grant from
|
||||
* Synopsys. If you do not agree with this notice, including the disclaimer
|
||||
* below, then you are not authorized to use the Software.
|
||||
*
|
||||
* THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
* ========================================================================== */
|
||||
|
||||
#if !defined(__DWC_OTG_ATTR_H__)
|
||||
#define __DWC_OTG_ATTR_H__
|
||||
#if 0
|
||||
/** @file
|
||||
* This file contains the interface to the Linux device attributes.
|
||||
*/
|
||||
extern struct device_attribute dev_attr_regoffset;
|
||||
extern struct device_attribute dev_attr_regvalue;
|
||||
|
||||
extern struct device_attribute dev_attr_mode;
|
||||
extern struct device_attribute dev_attr_hnpcapable;
|
||||
extern struct device_attribute dev_attr_srpcapable;
|
||||
extern struct device_attribute dev_attr_hnp;
|
||||
extern struct device_attribute dev_attr_srp;
|
||||
extern struct device_attribute dev_attr_buspower;
|
||||
extern struct device_attribute dev_attr_bussuspend;
|
||||
extern struct device_attribute dev_attr_mode_ch_tim_en;
|
||||
extern struct device_attribute dev_attr_fr_interval;
|
||||
extern struct device_attribute dev_attr_busconnected;
|
||||
extern struct device_attribute dev_attr_gotgctl;
|
||||
extern struct device_attribute dev_attr_gusbcfg;
|
||||
extern struct device_attribute dev_attr_grxfsiz;
|
||||
extern struct device_attribute dev_attr_gnptxfsiz;
|
||||
extern struct device_attribute dev_attr_gpvndctl;
|
||||
extern struct device_attribute dev_attr_ggpio;
|
||||
extern struct device_attribute dev_attr_guid;
|
||||
extern struct device_attribute dev_attr_gsnpsid;
|
||||
extern struct device_attribute dev_attr_devspeed;
|
||||
extern struct device_attribute dev_attr_enumspeed;
|
||||
extern struct device_attribute dev_attr_hptxfsiz;
|
||||
extern struct device_attribute dev_attr_hprt0;
|
||||
#ifdef CONFIG_USB_DWC_OTG_LPM
|
||||
extern struct device_attribute dev_attr_lpm_response;
|
||||
extern struct device_attribute devi_attr_sleep_status;
|
||||
#endif
|
||||
|
||||
void dwc_otg_attr_create(
|
||||
#ifdef LM_INTERFACE
|
||||
struct lm_device *dev
|
||||
#elif PCI_INTERFACE
|
||||
struct pci_dev *dev
|
||||
#endif
|
||||
);
|
||||
|
||||
void dwc_otg_attr_remove(
|
||||
#ifdef LM_INTERFACE
|
||||
struct lm_device *dev
|
||||
#elif PCI_INTERFACE
|
||||
struct pci_dev *dev
|
||||
#endif
|
||||
);
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,124 +1,124 @@
|
|||
/* ==========================================================================
|
||||
* $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_driver.h $
|
||||
* $Revision: #19 $
|
||||
* $Date: 2010/11/15 $
|
||||
* $Change: 1627671 $
|
||||
*
|
||||
* Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
|
||||
* "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
|
||||
* otherwise expressly agreed to in writing between Synopsys and you.
|
||||
*
|
||||
* The Software IS NOT an item of Licensed Software or Licensed Product under
|
||||
* any End User Software License Agreement or Agreement for Licensed Product
|
||||
* with Synopsys or any supplement thereto. You are permitted to use and
|
||||
* redistribute this Software in source and binary forms, with or without
|
||||
* modification, provided that redistributions of source code must retain this
|
||||
* notice. You may not view, use, disclose, copy or distribute this file or
|
||||
* any information contained herein except pursuant to this license grant from
|
||||
* Synopsys. If you do not agree with this notice, including the disclaimer
|
||||
* below, then you are not authorized to use the Software.
|
||||
*
|
||||
* THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
* ========================================================================== */
|
||||
|
||||
#ifndef __DWC_OTG_DRIVER_H__
|
||||
#define __DWC_OTG_DRIVER_H__
|
||||
|
||||
/** @file
|
||||
* This file contains the interface to the Linux driver.
|
||||
*/
|
||||
//#include "dwc_otg_os_dep.h"
|
||||
#include "dwc_otg_core_if.h"
|
||||
#include "osdep_service.h"
|
||||
|
||||
/* Type declarations */
|
||||
struct dwc_otg_pcd;
|
||||
struct dwc_otg_hcd;
|
||||
|
||||
/**
|
||||
* This structure is a wrapper that encapsulates the driver components used to
|
||||
* manage a single DWC_otg controller.
|
||||
*/
|
||||
typedef struct dwc_otg_device {
|
||||
/** Structure containing OS-dependent stuff. KEEP THIS STRUCT AT THE
|
||||
* VERY BEGINNING OF THE DEVICE STRUCT. OSes such as FreeBSD and NetBSD
|
||||
* require this. */
|
||||
//struct os_dependent os_dep;
|
||||
/** Base address returned from ioremap() */
|
||||
void *base;
|
||||
uint32_t reg_offset;
|
||||
/** Pointer to the core interface structure. */
|
||||
dwc_otg_core_if_t *core_if;
|
||||
|
||||
/** Pointer to the PCD structure. */
|
||||
struct dwc_otg_pcd *pcd;
|
||||
|
||||
/** Pointer to the HCD structure. */
|
||||
struct dwc_otg_hcd *hcd;
|
||||
|
||||
/** Flag to indicate whether the common IRQ handler is installed. */
|
||||
uint8_t common_irq_installed;
|
||||
|
||||
} dwc_otg_device_t;
|
||||
|
||||
/*We must clear S3C24XX_EINTPEND external interrupt register
|
||||
* because after clearing in this register trigerred IRQ from
|
||||
* H/W core in kernel interrupt can be occured again before OTG
|
||||
* handlers clear all IRQ sources of Core registers because of
|
||||
* timing latencies and Low Level IRQ Type.
|
||||
*/
|
||||
#ifdef CONFIG_MACH_IPMATE
|
||||
#define S3C2410X_CLEAR_EINTPEND() \
|
||||
do { \
|
||||
__raw_writel(1UL << 11,S3C24XX_EINTPEND); \
|
||||
} while (0)
|
||||
#else
|
||||
#define S3C2410X_CLEAR_EINTPEND() do { } while (0)
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct USB_OTG_DRV_ADP {
|
||||
dwc_otg_device_t *otgdev;
|
||||
IRQ_HANDLE *pIrqHnd;
|
||||
#if !TASK_SCHEDULER_DISABLED
|
||||
#if defined(DWC_WITH_WLAN_OSDEP)
|
||||
_sema Sema;
|
||||
#else
|
||||
_Sema Sema;
|
||||
#endif
|
||||
#else
|
||||
u32 Sema;
|
||||
#endif
|
||||
#if !TASK_SCHEDULER_DISABLED
|
||||
#if defined(DWC_WITH_WLAN_OSDEP)
|
||||
struct task_struct OTGTask;
|
||||
#else
|
||||
xTaskHandle OTGTask;
|
||||
#endif
|
||||
#else
|
||||
u32 OTGTask;
|
||||
#endif
|
||||
|
||||
}USB_OTG_DRV_ADP,*PUSB_OTG_DRV_ADP;
|
||||
|
||||
|
||||
|
||||
typedef struct _DWC_OTG_ADAPTER_ {
|
||||
u32 temp0;
|
||||
dwc_otg_device_t *otgdev;
|
||||
u8 TestItem;
|
||||
}DWC_OTG_ADAPTER, *PDWC_OTG_ADAPTER;
|
||||
void dwc_otg_disable_irq(IN VOID);
|
||||
void dwc_otg_enable_irq(IN VOID);
|
||||
|
||||
#endif
|
||||
/* ==========================================================================
|
||||
* $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_driver.h $
|
||||
* $Revision: #19 $
|
||||
* $Date: 2010/11/15 $
|
||||
* $Change: 1627671 $
|
||||
*
|
||||
* Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
|
||||
* "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
|
||||
* otherwise expressly agreed to in writing between Synopsys and you.
|
||||
*
|
||||
* The Software IS NOT an item of Licensed Software or Licensed Product under
|
||||
* any End User Software License Agreement or Agreement for Licensed Product
|
||||
* with Synopsys or any supplement thereto. You are permitted to use and
|
||||
* redistribute this Software in source and binary forms, with or without
|
||||
* modification, provided that redistributions of source code must retain this
|
||||
* notice. You may not view, use, disclose, copy or distribute this file or
|
||||
* any information contained herein except pursuant to this license grant from
|
||||
* Synopsys. If you do not agree with this notice, including the disclaimer
|
||||
* below, then you are not authorized to use the Software.
|
||||
*
|
||||
* THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
* ========================================================================== */
|
||||
|
||||
#ifndef __DWC_OTG_DRIVER_H__
|
||||
#define __DWC_OTG_DRIVER_H__
|
||||
|
||||
/** @file
|
||||
* This file contains the interface to the Linux driver.
|
||||
*/
|
||||
//#include "dwc_otg_os_dep.h"
|
||||
#include "dwc_otg_core_if.h"
|
||||
#include "osdep_service.h"
|
||||
|
||||
/* Type declarations */
|
||||
struct dwc_otg_pcd;
|
||||
struct dwc_otg_hcd;
|
||||
|
||||
/**
|
||||
* This structure is a wrapper that encapsulates the driver components used to
|
||||
* manage a single DWC_otg controller.
|
||||
*/
|
||||
typedef struct dwc_otg_device {
|
||||
/** Structure containing OS-dependent stuff. KEEP THIS STRUCT AT THE
|
||||
* VERY BEGINNING OF THE DEVICE STRUCT. OSes such as FreeBSD and NetBSD
|
||||
* require this. */
|
||||
//struct os_dependent os_dep;
|
||||
/** Base address returned from ioremap() */
|
||||
void *base;
|
||||
uint32_t reg_offset;
|
||||
/** Pointer to the core interface structure. */
|
||||
dwc_otg_core_if_t *core_if;
|
||||
|
||||
/** Pointer to the PCD structure. */
|
||||
struct dwc_otg_pcd *pcd;
|
||||
|
||||
/** Pointer to the HCD structure. */
|
||||
struct dwc_otg_hcd *hcd;
|
||||
|
||||
/** Flag to indicate whether the common IRQ handler is installed. */
|
||||
uint8_t common_irq_installed;
|
||||
|
||||
} dwc_otg_device_t;
|
||||
|
||||
/*We must clear S3C24XX_EINTPEND external interrupt register
|
||||
* because after clearing in this register trigerred IRQ from
|
||||
* H/W core in kernel interrupt can be occured again before OTG
|
||||
* handlers clear all IRQ sources of Core registers because of
|
||||
* timing latencies and Low Level IRQ Type.
|
||||
*/
|
||||
#ifdef CONFIG_MACH_IPMATE
|
||||
#define S3C2410X_CLEAR_EINTPEND() \
|
||||
do { \
|
||||
__raw_writel(1UL << 11,S3C24XX_EINTPEND); \
|
||||
} while (0)
|
||||
#else
|
||||
#define S3C2410X_CLEAR_EINTPEND() do { } while (0)
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct USB_OTG_DRV_ADP {
|
||||
dwc_otg_device_t *otgdev;
|
||||
IRQ_HANDLE *pIrqHnd;
|
||||
#if !TASK_SCHEDULER_DISABLED
|
||||
#if defined(DWC_WITH_WLAN_OSDEP)
|
||||
_sema Sema;
|
||||
#else
|
||||
_Sema Sema;
|
||||
#endif
|
||||
#else
|
||||
u32 Sema;
|
||||
#endif
|
||||
#if !TASK_SCHEDULER_DISABLED
|
||||
#if defined(DWC_WITH_WLAN_OSDEP)
|
||||
struct task_struct OTGTask;
|
||||
#else
|
||||
xTaskHandle OTGTask;
|
||||
#endif
|
||||
#else
|
||||
u32 OTGTask;
|
||||
#endif
|
||||
|
||||
}USB_OTG_DRV_ADP,*PUSB_OTG_DRV_ADP;
|
||||
|
||||
|
||||
|
||||
typedef struct _DWC_OTG_ADAPTER_ {
|
||||
u32 temp0;
|
||||
dwc_otg_device_t *otgdev;
|
||||
u8 TestItem;
|
||||
}DWC_OTG_ADAPTER, *PDWC_OTG_ADAPTER;
|
||||
void dwc_otg_disable_irq(IN VOID);
|
||||
void dwc_otg_enable_irq(IN VOID);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,412 +1,412 @@
|
|||
/* ==========================================================================
|
||||
* $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_if.h $
|
||||
* $Revision: #12 $
|
||||
* $Date: 2011/10/26 $
|
||||
* $Change: 1873028 $
|
||||
*
|
||||
* Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
|
||||
* "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
|
||||
* otherwise expressly agreed to in writing between Synopsys and you.
|
||||
*
|
||||
* The Software IS NOT an item of Licensed Software or Licensed Product under
|
||||
* any End User Software License Agreement or Agreement for Licensed Product
|
||||
* with Synopsys or any supplement thereto. You are permitted to use and
|
||||
* redistribute this Software in source and binary forms, with or without
|
||||
* modification, provided that redistributions of source code must retain this
|
||||
* notice. You may not view, use, disclose, copy or distribute this file or
|
||||
* any information contained herein except pursuant to this license grant from
|
||||
* Synopsys. If you do not agree with this notice, including the disclaimer
|
||||
* below, then you are not authorized to use the Software.
|
||||
*
|
||||
* THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
* ========================================================================== */
|
||||
#if 1//ndef DWC_DEVICE_ONLY
|
||||
#ifndef __DWC_HCD_IF_H__
|
||||
#define __DWC_HCD_IF_H__
|
||||
|
||||
#include "dwc_otg_core_if.h"
|
||||
|
||||
/** @file
|
||||
* This file defines DWC_OTG HCD Core API.
|
||||
*/
|
||||
|
||||
struct dwc_otg_hcd;
|
||||
typedef struct dwc_otg_hcd dwc_otg_hcd_t;
|
||||
|
||||
struct dwc_otg_hcd_urb;
|
||||
typedef struct dwc_otg_hcd_urb dwc_otg_hcd_urb_t;
|
||||
|
||||
/** @name HCD Function Driver Callbacks */
|
||||
/** @{ */
|
||||
|
||||
/** This function is called whenever core switches to host mode. */
|
||||
typedef int (*dwc_otg_hcd_start_cb_t) (dwc_otg_hcd_t * hcd);
|
||||
|
||||
/** This function is called when device has been disconnected */
|
||||
typedef int (*dwc_otg_hcd_disconnect_cb_t) (dwc_otg_hcd_t * hcd);
|
||||
|
||||
/** Wrapper provides this function to HCD to core, so it can get hub information to which device is connected */
|
||||
typedef int (*dwc_otg_hcd_hub_info_from_urb_cb_t) (dwc_otg_hcd_t * hcd,
|
||||
void *urb_handle,
|
||||
uint32_t * hub_addr,
|
||||
uint32_t * port_addr);
|
||||
/** Via this function HCD core gets device speed */
|
||||
typedef int (*dwc_otg_hcd_speed_from_urb_cb_t) (dwc_otg_hcd_t * hcd,
|
||||
void *urb_handle);
|
||||
|
||||
/** This function is called when urb is completed */
|
||||
typedef int (*dwc_otg_hcd_complete_urb_cb_t) (dwc_otg_hcd_t * hcd,
|
||||
void *urb_handle,
|
||||
dwc_otg_hcd_urb_t * dwc_otg_urb,
|
||||
int32_t status);
|
||||
|
||||
/** Via this function HCD core gets b_hnp_enable parameter */
|
||||
typedef int (*dwc_otg_hcd_get_b_hnp_enable) (dwc_otg_hcd_t * hcd);
|
||||
|
||||
struct dwc_otg_hcd_function_ops {
|
||||
dwc_otg_hcd_start_cb_t start;
|
||||
dwc_otg_hcd_disconnect_cb_t disconnect;
|
||||
dwc_otg_hcd_hub_info_from_urb_cb_t hub_info;
|
||||
dwc_otg_hcd_speed_from_urb_cb_t speed;
|
||||
dwc_otg_hcd_complete_urb_cb_t complete;
|
||||
dwc_otg_hcd_get_b_hnp_enable get_b_hnp_enable;
|
||||
};
|
||||
/** @} */
|
||||
|
||||
/** @name HCD Core API */
|
||||
/** @{ */
|
||||
/** This function allocates dwc_otg_hcd structure and returns pointer on it. */
|
||||
extern _LONG_CALL_ dwc_otg_hcd_t *dwc_otg_hcd_alloc_hcd(void);
|
||||
|
||||
/** This function should be called to initiate HCD Core.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param core_if The DWC_OTG Core
|
||||
*
|
||||
* Returns -DWC_E_NO_MEMORY if no enough memory.
|
||||
* Returns 0 on success
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_init(dwc_otg_hcd_t * hcd, dwc_otg_core_if_t * core_if);
|
||||
|
||||
/** Frees HCD
|
||||
*
|
||||
* @param hcd The HCD
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_hcd_remove(dwc_otg_hcd_t * hcd);
|
||||
|
||||
/** This function should be called on every hardware interrupt.
|
||||
*
|
||||
* @param dwc_otg_hcd The HCD
|
||||
*
|
||||
* Returns non zero if interrupt is handled
|
||||
* Return 0 if interrupt is not handled
|
||||
*/
|
||||
extern _LONG_CALL_ int32_t dwc_otg_hcd_handle_intr(dwc_otg_hcd_t * dwc_otg_hcd);
|
||||
|
||||
/**
|
||||
* Returns private data set by
|
||||
* dwc_otg_hcd_set_priv_data function.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
*/
|
||||
extern _LONG_CALL_ void *dwc_otg_hcd_get_priv_data(dwc_otg_hcd_t * hcd);
|
||||
|
||||
/**
|
||||
* Set private data.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param priv_data pointer to be stored in private data
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_hcd_set_priv_data(dwc_otg_hcd_t * hcd, void *priv_data);
|
||||
|
||||
/**
|
||||
* This function initializes the HCD Core.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param fops The Function Driver Operations data structure containing pointers to all callbacks.
|
||||
*
|
||||
* Returns -DWC_E_NO_DEVICE if Core is currently is in device mode.
|
||||
* Returns 0 on success
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_start(dwc_otg_hcd_t * hcd,
|
||||
struct dwc_otg_hcd_function_ops *fops);
|
||||
|
||||
/**
|
||||
* Halts the DWC_otg host mode operations in a clean manner. USB transfers are
|
||||
* stopped.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_hcd_stop(dwc_otg_hcd_t * hcd);
|
||||
|
||||
/**
|
||||
* Handles hub class-specific requests.
|
||||
*
|
||||
* @param dwc_otg_hcd The HCD
|
||||
* @param typeReq Request Type
|
||||
* @param wValue wValue from control request
|
||||
* @param wIndex wIndex from control request
|
||||
* @param buf data buffer
|
||||
* @param wLength data buffer length
|
||||
*
|
||||
* Returns -DWC_E_INVALID if invalid argument is passed
|
||||
* Returns 0 on success
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_hub_control(dwc_otg_hcd_t * dwc_otg_hcd,
|
||||
uint16_t typeReq, uint16_t wValue,
|
||||
uint16_t wIndex, uint8_t * buf,
|
||||
uint16_t wLength);
|
||||
|
||||
/**
|
||||
* Returns otg port number.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
*/
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_hcd_otg_port(dwc_otg_hcd_t * hcd);
|
||||
|
||||
/**
|
||||
* Returns OTG version - either 1.3 or 2.0.
|
||||
*
|
||||
* @param core_if The core_if structure pointer
|
||||
*/
|
||||
extern _LONG_CALL_ uint16_t dwc_otg_get_otg_version(dwc_otg_core_if_t * core_if);
|
||||
|
||||
/**
|
||||
* Returns 1 if currently core is acting as B host, and 0 otherwise.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
*/
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_hcd_is_b_host(dwc_otg_hcd_t * hcd);
|
||||
|
||||
/**
|
||||
* Returns current frame number.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_get_frame_number(dwc_otg_hcd_t * hcd);
|
||||
|
||||
/**
|
||||
* Dumps hcd state.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_hcd_dump_state(dwc_otg_hcd_t * hcd);
|
||||
|
||||
/**
|
||||
* Dump the average frame remaining at SOF. This can be used to
|
||||
* determine average interrupt latency. Frame remaining is also shown for
|
||||
* start transfer and two additional sample points.
|
||||
* Currently this function is not implemented.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_hcd_dump_frrem(dwc_otg_hcd_t * hcd);
|
||||
|
||||
/**
|
||||
* Sends LPM transaction to the local device.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param devaddr Device Address
|
||||
* @param hird Host initiated resume duration
|
||||
* @param bRemoteWake Value of bRemoteWake field in LPM transaction
|
||||
*
|
||||
* Returns negative value if sending LPM transaction was not succeeded.
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_send_lpm(dwc_otg_hcd_t * hcd, uint8_t devaddr,
|
||||
uint8_t hird, uint8_t bRemoteWake);
|
||||
|
||||
/* URB interface */
|
||||
|
||||
/**
|
||||
* Allocates memory for dwc_otg_hcd_urb structure.
|
||||
* Allocated memory should be freed by call of DWC_FREE.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param iso_desc_count Count of ISOC descriptors
|
||||
* @param atomic_alloc Specefies whether to perform atomic allocation.
|
||||
*/
|
||||
extern _LONG_CALL_ dwc_otg_hcd_urb_t *dwc_otg_hcd_urb_alloc(dwc_otg_hcd_t * hcd,
|
||||
int iso_desc_count,
|
||||
int atomic_alloc);
|
||||
|
||||
/**
|
||||
* Set pipe information in URB.
|
||||
*
|
||||
* @param hcd_urb DWC_OTG URB
|
||||
* @param devaddr Device Address
|
||||
* @param ep_num Endpoint Number
|
||||
* @param ep_type Endpoint Type
|
||||
* @param ep_dir Endpoint Direction
|
||||
* @param mps Max Packet Size
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_hcd_urb_set_pipeinfo(dwc_otg_hcd_urb_t * hcd_urb,
|
||||
uint8_t devaddr, uint8_t ep_num,
|
||||
uint8_t ep_type, uint8_t ep_dir,
|
||||
uint16_t mps);
|
||||
|
||||
/* Transfer flags */
|
||||
#define URB_GIVEBACK_ASAP 0x1
|
||||
#define URB_SEND_ZERO_PACKET 0x2
|
||||
|
||||
/**
|
||||
* Sets dwc_otg_hcd_urb parameters.
|
||||
*
|
||||
* @param urb DWC_OTG URB allocated by dwc_otg_hcd_urb_alloc function.
|
||||
* @param urb_handle Unique handle for request, this will be passed back
|
||||
* to function driver in completion callback.
|
||||
* @param buf The buffer for the data
|
||||
* @param dma The DMA buffer for the data
|
||||
* @param buflen Transfer length
|
||||
* @param sp Buffer for setup data
|
||||
* @param sp_dma DMA address of setup data buffer
|
||||
* @param flags Transfer flags
|
||||
* @param interval Polling interval for interrupt or isochronous transfers.
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_hcd_urb_set_params(dwc_otg_hcd_urb_t * urb,
|
||||
void *urb_handle, void *buf,
|
||||
dwc_dma_t dma, uint32_t buflen, void *sp,
|
||||
dwc_dma_t sp_dma, uint32_t flags,
|
||||
uint16_t interval);
|
||||
|
||||
/** Gets status from dwc_otg_hcd_urb
|
||||
*
|
||||
* @param dwc_otg_urb DWC_OTG URB
|
||||
*/
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_hcd_urb_get_status(dwc_otg_hcd_urb_t * dwc_otg_urb);
|
||||
|
||||
/** Gets actual length from dwc_otg_hcd_urb
|
||||
*
|
||||
* @param dwc_otg_urb DWC_OTG URB
|
||||
*/
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_hcd_urb_get_actual_length(dwc_otg_hcd_urb_t *
|
||||
dwc_otg_urb);
|
||||
|
||||
/** Gets error count from dwc_otg_hcd_urb. Only for ISOC URBs
|
||||
*
|
||||
* @param dwc_otg_urb DWC_OTG URB
|
||||
*/
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_hcd_urb_get_error_count(dwc_otg_hcd_urb_t *
|
||||
dwc_otg_urb);
|
||||
|
||||
/** Set ISOC descriptor offset and length
|
||||
*
|
||||
* @param dwc_otg_urb DWC_OTG URB
|
||||
* @param desc_num ISOC descriptor number
|
||||
* @param offset Offset from beginig of buffer.
|
||||
* @param length Transaction length
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_hcd_urb_set_iso_desc_params(dwc_otg_hcd_urb_t * dwc_otg_urb,
|
||||
int desc_num, uint32_t offset,
|
||||
uint32_t length);
|
||||
|
||||
/** Get status of ISOC descriptor, specified by desc_num
|
||||
*
|
||||
* @param dwc_otg_urb DWC_OTG URB
|
||||
* @param desc_num ISOC descriptor number
|
||||
*/
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_hcd_urb_get_iso_desc_status(dwc_otg_hcd_urb_t *
|
||||
dwc_otg_urb, int desc_num);
|
||||
|
||||
/** Get actual length of ISOC descriptor, specified by desc_num
|
||||
*
|
||||
* @param dwc_otg_urb DWC_OTG URB
|
||||
* @param desc_num ISOC descriptor number
|
||||
*/
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_hcd_urb_get_iso_desc_actual_length(dwc_otg_hcd_urb_t *
|
||||
dwc_otg_urb,
|
||||
int desc_num);
|
||||
|
||||
/** Queue URB. After transfer is completes, the complete callback will be called with the URB status
|
||||
*
|
||||
* @param dwc_otg_hcd The HCD
|
||||
* @param dwc_otg_urb DWC_OTG URB
|
||||
* @param ep_handle Out parameter for returning endpoint handle
|
||||
* @param atomic_alloc Flag to do atomic allocation if needed
|
||||
*
|
||||
* Returns -DWC_E_NO_DEVICE if no device is connected.
|
||||
* Returns -DWC_E_NO_MEMORY if there is no enough memory.
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_urb_enqueue(dwc_otg_hcd_t * dwc_otg_hcd,
|
||||
dwc_otg_hcd_urb_t * dwc_otg_urb,
|
||||
void **ep_handle, int atomic_alloc);
|
||||
|
||||
/** De-queue the specified URB
|
||||
*
|
||||
* @param dwc_otg_hcd The HCD
|
||||
* @param dwc_otg_urb DWC_OTG URB
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_urb_dequeue(dwc_otg_hcd_t * dwc_otg_hcd,
|
||||
dwc_otg_hcd_urb_t * dwc_otg_urb);
|
||||
|
||||
/** Frees resources in the DWC_otg controller related to a given endpoint.
|
||||
* Any URBs for the endpoint must already be dequeued.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param ep_handle Endpoint handle, returned by dwc_otg_hcd_urb_enqueue function
|
||||
* @param retry Number of retries if there are queued transfers.
|
||||
*
|
||||
* Returns -DWC_E_INVALID if invalid arguments are passed.
|
||||
* Returns 0 on success
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_endpoint_disable(dwc_otg_hcd_t * hcd, void *ep_handle,
|
||||
int retry);
|
||||
|
||||
/* Resets the data toggle in qh structure. This function can be called from
|
||||
* usb_clear_halt routine.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param ep_handle Endpoint handle, returned by dwc_otg_hcd_urb_enqueue function
|
||||
*
|
||||
* Returns -DWC_E_INVALID if invalid arguments are passed.
|
||||
* Returns 0 on success
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_endpoint_reset(dwc_otg_hcd_t * hcd, void *ep_handle);
|
||||
|
||||
/** Returns 1 if status of specified port is changed and 0 otherwise.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param port Port number
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_is_status_changed(dwc_otg_hcd_t * hcd, int port);
|
||||
|
||||
/** Call this function to check if bandwidth was allocated for specified endpoint.
|
||||
* Only for ISOC and INTERRUPT endpoints.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param ep_handle Endpoint handle
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_is_bandwidth_allocated(dwc_otg_hcd_t * hcd,
|
||||
void *ep_handle);
|
||||
|
||||
/** Call this function to check if bandwidth was freed for specified endpoint.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param ep_handle Endpoint handle
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_is_bandwidth_freed(dwc_otg_hcd_t * hcd, void *ep_handle);
|
||||
|
||||
/** Returns bandwidth allocated for specified endpoint in microseconds.
|
||||
* Only for ISOC and INTERRUPT endpoints.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param ep_handle Endpoint handle
|
||||
*/
|
||||
extern _LONG_CALL_ uint8_t dwc_otg_hcd_get_ep_bandwidth(dwc_otg_hcd_t * hcd,
|
||||
void *ep_handle);
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* __DWC_HCD_IF_H__ */
|
||||
#endif /* DWC_DEVICE_ONLY */
|
||||
/* ==========================================================================
|
||||
* $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_if.h $
|
||||
* $Revision: #12 $
|
||||
* $Date: 2011/10/26 $
|
||||
* $Change: 1873028 $
|
||||
*
|
||||
* Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
|
||||
* "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
|
||||
* otherwise expressly agreed to in writing between Synopsys and you.
|
||||
*
|
||||
* The Software IS NOT an item of Licensed Software or Licensed Product under
|
||||
* any End User Software License Agreement or Agreement for Licensed Product
|
||||
* with Synopsys or any supplement thereto. You are permitted to use and
|
||||
* redistribute this Software in source and binary forms, with or without
|
||||
* modification, provided that redistributions of source code must retain this
|
||||
* notice. You may not view, use, disclose, copy or distribute this file or
|
||||
* any information contained herein except pursuant to this license grant from
|
||||
* Synopsys. If you do not agree with this notice, including the disclaimer
|
||||
* below, then you are not authorized to use the Software.
|
||||
*
|
||||
* THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
* ========================================================================== */
|
||||
#if 1//ndef DWC_DEVICE_ONLY
|
||||
#ifndef __DWC_HCD_IF_H__
|
||||
#define __DWC_HCD_IF_H__
|
||||
|
||||
#include "dwc_otg_core_if.h"
|
||||
|
||||
/** @file
|
||||
* This file defines DWC_OTG HCD Core API.
|
||||
*/
|
||||
|
||||
struct dwc_otg_hcd;
|
||||
typedef struct dwc_otg_hcd dwc_otg_hcd_t;
|
||||
|
||||
struct dwc_otg_hcd_urb;
|
||||
typedef struct dwc_otg_hcd_urb dwc_otg_hcd_urb_t;
|
||||
|
||||
/** @name HCD Function Driver Callbacks */
|
||||
/** @{ */
|
||||
|
||||
/** This function is called whenever core switches to host mode. */
|
||||
typedef int (*dwc_otg_hcd_start_cb_t) (dwc_otg_hcd_t * hcd);
|
||||
|
||||
/** This function is called when device has been disconnected */
|
||||
typedef int (*dwc_otg_hcd_disconnect_cb_t) (dwc_otg_hcd_t * hcd);
|
||||
|
||||
/** Wrapper provides this function to HCD to core, so it can get hub information to which device is connected */
|
||||
typedef int (*dwc_otg_hcd_hub_info_from_urb_cb_t) (dwc_otg_hcd_t * hcd,
|
||||
void *urb_handle,
|
||||
uint32_t * hub_addr,
|
||||
uint32_t * port_addr);
|
||||
/** Via this function HCD core gets device speed */
|
||||
typedef int (*dwc_otg_hcd_speed_from_urb_cb_t) (dwc_otg_hcd_t * hcd,
|
||||
void *urb_handle);
|
||||
|
||||
/** This function is called when urb is completed */
|
||||
typedef int (*dwc_otg_hcd_complete_urb_cb_t) (dwc_otg_hcd_t * hcd,
|
||||
void *urb_handle,
|
||||
dwc_otg_hcd_urb_t * dwc_otg_urb,
|
||||
int32_t status);
|
||||
|
||||
/** Via this function HCD core gets b_hnp_enable parameter */
|
||||
typedef int (*dwc_otg_hcd_get_b_hnp_enable) (dwc_otg_hcd_t * hcd);
|
||||
|
||||
struct dwc_otg_hcd_function_ops {
|
||||
dwc_otg_hcd_start_cb_t start;
|
||||
dwc_otg_hcd_disconnect_cb_t disconnect;
|
||||
dwc_otg_hcd_hub_info_from_urb_cb_t hub_info;
|
||||
dwc_otg_hcd_speed_from_urb_cb_t speed;
|
||||
dwc_otg_hcd_complete_urb_cb_t complete;
|
||||
dwc_otg_hcd_get_b_hnp_enable get_b_hnp_enable;
|
||||
};
|
||||
/** @} */
|
||||
|
||||
/** @name HCD Core API */
|
||||
/** @{ */
|
||||
/** This function allocates dwc_otg_hcd structure and returns pointer on it. */
|
||||
extern _LONG_CALL_ dwc_otg_hcd_t *dwc_otg_hcd_alloc_hcd(void);
|
||||
|
||||
/** This function should be called to initiate HCD Core.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param core_if The DWC_OTG Core
|
||||
*
|
||||
* Returns -DWC_E_NO_MEMORY if no enough memory.
|
||||
* Returns 0 on success
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_init(dwc_otg_hcd_t * hcd, dwc_otg_core_if_t * core_if);
|
||||
|
||||
/** Frees HCD
|
||||
*
|
||||
* @param hcd The HCD
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_hcd_remove(dwc_otg_hcd_t * hcd);
|
||||
|
||||
/** This function should be called on every hardware interrupt.
|
||||
*
|
||||
* @param dwc_otg_hcd The HCD
|
||||
*
|
||||
* Returns non zero if interrupt is handled
|
||||
* Return 0 if interrupt is not handled
|
||||
*/
|
||||
extern _LONG_CALL_ int32_t dwc_otg_hcd_handle_intr(dwc_otg_hcd_t * dwc_otg_hcd);
|
||||
|
||||
/**
|
||||
* Returns private data set by
|
||||
* dwc_otg_hcd_set_priv_data function.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
*/
|
||||
extern _LONG_CALL_ void *dwc_otg_hcd_get_priv_data(dwc_otg_hcd_t * hcd);
|
||||
|
||||
/**
|
||||
* Set private data.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param priv_data pointer to be stored in private data
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_hcd_set_priv_data(dwc_otg_hcd_t * hcd, void *priv_data);
|
||||
|
||||
/**
|
||||
* This function initializes the HCD Core.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param fops The Function Driver Operations data structure containing pointers to all callbacks.
|
||||
*
|
||||
* Returns -DWC_E_NO_DEVICE if Core is currently is in device mode.
|
||||
* Returns 0 on success
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_start(dwc_otg_hcd_t * hcd,
|
||||
struct dwc_otg_hcd_function_ops *fops);
|
||||
|
||||
/**
|
||||
* Halts the DWC_otg host mode operations in a clean manner. USB transfers are
|
||||
* stopped.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_hcd_stop(dwc_otg_hcd_t * hcd);
|
||||
|
||||
/**
|
||||
* Handles hub class-specific requests.
|
||||
*
|
||||
* @param dwc_otg_hcd The HCD
|
||||
* @param typeReq Request Type
|
||||
* @param wValue wValue from control request
|
||||
* @param wIndex wIndex from control request
|
||||
* @param buf data buffer
|
||||
* @param wLength data buffer length
|
||||
*
|
||||
* Returns -DWC_E_INVALID if invalid argument is passed
|
||||
* Returns 0 on success
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_hub_control(dwc_otg_hcd_t * dwc_otg_hcd,
|
||||
uint16_t typeReq, uint16_t wValue,
|
||||
uint16_t wIndex, uint8_t * buf,
|
||||
uint16_t wLength);
|
||||
|
||||
/**
|
||||
* Returns otg port number.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
*/
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_hcd_otg_port(dwc_otg_hcd_t * hcd);
|
||||
|
||||
/**
|
||||
* Returns OTG version - either 1.3 or 2.0.
|
||||
*
|
||||
* @param core_if The core_if structure pointer
|
||||
*/
|
||||
extern _LONG_CALL_ uint16_t dwc_otg_get_otg_version(dwc_otg_core_if_t * core_if);
|
||||
|
||||
/**
|
||||
* Returns 1 if currently core is acting as B host, and 0 otherwise.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
*/
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_hcd_is_b_host(dwc_otg_hcd_t * hcd);
|
||||
|
||||
/**
|
||||
* Returns current frame number.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_get_frame_number(dwc_otg_hcd_t * hcd);
|
||||
|
||||
/**
|
||||
* Dumps hcd state.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_hcd_dump_state(dwc_otg_hcd_t * hcd);
|
||||
|
||||
/**
|
||||
* Dump the average frame remaining at SOF. This can be used to
|
||||
* determine average interrupt latency. Frame remaining is also shown for
|
||||
* start transfer and two additional sample points.
|
||||
* Currently this function is not implemented.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_hcd_dump_frrem(dwc_otg_hcd_t * hcd);
|
||||
|
||||
/**
|
||||
* Sends LPM transaction to the local device.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param devaddr Device Address
|
||||
* @param hird Host initiated resume duration
|
||||
* @param bRemoteWake Value of bRemoteWake field in LPM transaction
|
||||
*
|
||||
* Returns negative value if sending LPM transaction was not succeeded.
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_send_lpm(dwc_otg_hcd_t * hcd, uint8_t devaddr,
|
||||
uint8_t hird, uint8_t bRemoteWake);
|
||||
|
||||
/* URB interface */
|
||||
|
||||
/**
|
||||
* Allocates memory for dwc_otg_hcd_urb structure.
|
||||
* Allocated memory should be freed by call of DWC_FREE.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param iso_desc_count Count of ISOC descriptors
|
||||
* @param atomic_alloc Specefies whether to perform atomic allocation.
|
||||
*/
|
||||
extern _LONG_CALL_ dwc_otg_hcd_urb_t *dwc_otg_hcd_urb_alloc(dwc_otg_hcd_t * hcd,
|
||||
int iso_desc_count,
|
||||
int atomic_alloc);
|
||||
|
||||
/**
|
||||
* Set pipe information in URB.
|
||||
*
|
||||
* @param hcd_urb DWC_OTG URB
|
||||
* @param devaddr Device Address
|
||||
* @param ep_num Endpoint Number
|
||||
* @param ep_type Endpoint Type
|
||||
* @param ep_dir Endpoint Direction
|
||||
* @param mps Max Packet Size
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_hcd_urb_set_pipeinfo(dwc_otg_hcd_urb_t * hcd_urb,
|
||||
uint8_t devaddr, uint8_t ep_num,
|
||||
uint8_t ep_type, uint8_t ep_dir,
|
||||
uint16_t mps);
|
||||
|
||||
/* Transfer flags */
|
||||
#define URB_GIVEBACK_ASAP 0x1
|
||||
#define URB_SEND_ZERO_PACKET 0x2
|
||||
|
||||
/**
|
||||
* Sets dwc_otg_hcd_urb parameters.
|
||||
*
|
||||
* @param urb DWC_OTG URB allocated by dwc_otg_hcd_urb_alloc function.
|
||||
* @param urb_handle Unique handle for request, this will be passed back
|
||||
* to function driver in completion callback.
|
||||
* @param buf The buffer for the data
|
||||
* @param dma The DMA buffer for the data
|
||||
* @param buflen Transfer length
|
||||
* @param sp Buffer for setup data
|
||||
* @param sp_dma DMA address of setup data buffer
|
||||
* @param flags Transfer flags
|
||||
* @param interval Polling interval for interrupt or isochronous transfers.
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_hcd_urb_set_params(dwc_otg_hcd_urb_t * urb,
|
||||
void *urb_handle, void *buf,
|
||||
dwc_dma_t dma, uint32_t buflen, void *sp,
|
||||
dwc_dma_t sp_dma, uint32_t flags,
|
||||
uint16_t interval);
|
||||
|
||||
/** Gets status from dwc_otg_hcd_urb
|
||||
*
|
||||
* @param dwc_otg_urb DWC_OTG URB
|
||||
*/
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_hcd_urb_get_status(dwc_otg_hcd_urb_t * dwc_otg_urb);
|
||||
|
||||
/** Gets actual length from dwc_otg_hcd_urb
|
||||
*
|
||||
* @param dwc_otg_urb DWC_OTG URB
|
||||
*/
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_hcd_urb_get_actual_length(dwc_otg_hcd_urb_t *
|
||||
dwc_otg_urb);
|
||||
|
||||
/** Gets error count from dwc_otg_hcd_urb. Only for ISOC URBs
|
||||
*
|
||||
* @param dwc_otg_urb DWC_OTG URB
|
||||
*/
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_hcd_urb_get_error_count(dwc_otg_hcd_urb_t *
|
||||
dwc_otg_urb);
|
||||
|
||||
/** Set ISOC descriptor offset and length
|
||||
*
|
||||
* @param dwc_otg_urb DWC_OTG URB
|
||||
* @param desc_num ISOC descriptor number
|
||||
* @param offset Offset from beginig of buffer.
|
||||
* @param length Transaction length
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_hcd_urb_set_iso_desc_params(dwc_otg_hcd_urb_t * dwc_otg_urb,
|
||||
int desc_num, uint32_t offset,
|
||||
uint32_t length);
|
||||
|
||||
/** Get status of ISOC descriptor, specified by desc_num
|
||||
*
|
||||
* @param dwc_otg_urb DWC_OTG URB
|
||||
* @param desc_num ISOC descriptor number
|
||||
*/
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_hcd_urb_get_iso_desc_status(dwc_otg_hcd_urb_t *
|
||||
dwc_otg_urb, int desc_num);
|
||||
|
||||
/** Get actual length of ISOC descriptor, specified by desc_num
|
||||
*
|
||||
* @param dwc_otg_urb DWC_OTG URB
|
||||
* @param desc_num ISOC descriptor number
|
||||
*/
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_hcd_urb_get_iso_desc_actual_length(dwc_otg_hcd_urb_t *
|
||||
dwc_otg_urb,
|
||||
int desc_num);
|
||||
|
||||
/** Queue URB. After transfer is completes, the complete callback will be called with the URB status
|
||||
*
|
||||
* @param dwc_otg_hcd The HCD
|
||||
* @param dwc_otg_urb DWC_OTG URB
|
||||
* @param ep_handle Out parameter for returning endpoint handle
|
||||
* @param atomic_alloc Flag to do atomic allocation if needed
|
||||
*
|
||||
* Returns -DWC_E_NO_DEVICE if no device is connected.
|
||||
* Returns -DWC_E_NO_MEMORY if there is no enough memory.
|
||||
* Returns 0 on success.
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_urb_enqueue(dwc_otg_hcd_t * dwc_otg_hcd,
|
||||
dwc_otg_hcd_urb_t * dwc_otg_urb,
|
||||
void **ep_handle, int atomic_alloc);
|
||||
|
||||
/** De-queue the specified URB
|
||||
*
|
||||
* @param dwc_otg_hcd The HCD
|
||||
* @param dwc_otg_urb DWC_OTG URB
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_urb_dequeue(dwc_otg_hcd_t * dwc_otg_hcd,
|
||||
dwc_otg_hcd_urb_t * dwc_otg_urb);
|
||||
|
||||
/** Frees resources in the DWC_otg controller related to a given endpoint.
|
||||
* Any URBs for the endpoint must already be dequeued.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param ep_handle Endpoint handle, returned by dwc_otg_hcd_urb_enqueue function
|
||||
* @param retry Number of retries if there are queued transfers.
|
||||
*
|
||||
* Returns -DWC_E_INVALID if invalid arguments are passed.
|
||||
* Returns 0 on success
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_endpoint_disable(dwc_otg_hcd_t * hcd, void *ep_handle,
|
||||
int retry);
|
||||
|
||||
/* Resets the data toggle in qh structure. This function can be called from
|
||||
* usb_clear_halt routine.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param ep_handle Endpoint handle, returned by dwc_otg_hcd_urb_enqueue function
|
||||
*
|
||||
* Returns -DWC_E_INVALID if invalid arguments are passed.
|
||||
* Returns 0 on success
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_endpoint_reset(dwc_otg_hcd_t * hcd, void *ep_handle);
|
||||
|
||||
/** Returns 1 if status of specified port is changed and 0 otherwise.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param port Port number
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_is_status_changed(dwc_otg_hcd_t * hcd, int port);
|
||||
|
||||
/** Call this function to check if bandwidth was allocated for specified endpoint.
|
||||
* Only for ISOC and INTERRUPT endpoints.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param ep_handle Endpoint handle
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_is_bandwidth_allocated(dwc_otg_hcd_t * hcd,
|
||||
void *ep_handle);
|
||||
|
||||
/** Call this function to check if bandwidth was freed for specified endpoint.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param ep_handle Endpoint handle
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_hcd_is_bandwidth_freed(dwc_otg_hcd_t * hcd, void *ep_handle);
|
||||
|
||||
/** Returns bandwidth allocated for specified endpoint in microseconds.
|
||||
* Only for ISOC and INTERRUPT endpoints.
|
||||
*
|
||||
* @param hcd The HCD
|
||||
* @param ep_handle Endpoint handle
|
||||
*/
|
||||
extern _LONG_CALL_ uint8_t dwc_otg_hcd_get_ep_bandwidth(dwc_otg_hcd_t * hcd,
|
||||
void *ep_handle);
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* __DWC_HCD_IF_H__ */
|
||||
#endif /* DWC_DEVICE_ONLY */
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef _DWC_OS_DEP_H_
|
||||
#define _DWC_OS_DEP_H_
|
||||
#include "errno.h"
|
||||
|
||||
#endif /* _DWC_OS_DEP_H_ */
|
||||
#ifndef _DWC_OS_DEP_H_
|
||||
#define _DWC_OS_DEP_H_
|
||||
#include "errno.h"
|
||||
|
||||
#endif /* _DWC_OS_DEP_H_ */
|
||||
|
|
|
|||
|
|
@ -1,271 +1,271 @@
|
|||
/* ==========================================================================
|
||||
* $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd.h $
|
||||
* $Revision: #49 $
|
||||
* $Date: 2013/05/16 $
|
||||
* $Change: 2231774 $
|
||||
*
|
||||
* Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
|
||||
* "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
|
||||
* otherwise expressly agreed to in writing between Synopsys and you.
|
||||
*
|
||||
* The Software IS NOT an item of Licensed Software or Licensed Product under
|
||||
* any End User Software License Agreement or Agreement for Licensed Product
|
||||
* with Synopsys or any supplement thereto. You are permitted to use and
|
||||
* redistribute this Software in source and binary forms, with or without
|
||||
* modification, provided that redistributions of source code must retain this
|
||||
* notice. You may not view, use, disclose, copy or distribute this file or
|
||||
* any information contained herein except pursuant to this license grant from
|
||||
* Synopsys. If you do not agree with this notice, including the disclaimer
|
||||
* below, then you are not authorized to use the Software.
|
||||
*
|
||||
* THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
* ========================================================================== */
|
||||
#if 1//ndef DWC_HOST_ONLY
|
||||
#if !defined(__DWC_PCD_H__)
|
||||
#define __DWC_PCD_H__
|
||||
|
||||
#include "dwc_otg_os_dep.h"
|
||||
#include "usb.h"
|
||||
#include "dwc_otg_cil.h"
|
||||
#include "dwc_otg_pcd_if.h"
|
||||
struct cfiobject;
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* This file contains the structures, constants, and interfaces for
|
||||
* the Perpherial Contoller Driver (PCD).
|
||||
*
|
||||
* The Peripheral Controller Driver (PCD) for Linux will implement the
|
||||
* Gadget API, so that the existing Gadget drivers can be used. For
|
||||
* the Mass Storage Function driver the File-backed USB Storage Gadget
|
||||
* (FBS) driver will be used. The FBS driver supports the
|
||||
* Control-Bulk (CB), Control-Bulk-Interrupt (CBI), and Bulk-Only
|
||||
* transports.
|
||||
*
|
||||
*/
|
||||
|
||||
/** Invalid DMA Address */
|
||||
#define DWC_DMA_ADDR_INVALID (~(dwc_dma_t)0)
|
||||
|
||||
/** Max Transfer size for any EP */
|
||||
#define DDMA_MAX_TRANSFER_SIZE 65535
|
||||
|
||||
/**
|
||||
* Get the pointer to the core_if from the pcd pointer.
|
||||
*/
|
||||
#define GET_CORE_IF( _pcd ) (_pcd->core_if)
|
||||
|
||||
/**
|
||||
* States of EP0.
|
||||
*/
|
||||
typedef enum ep0_state {
|
||||
EP0_DISCONNECT, /* no host */
|
||||
EP0_IDLE,
|
||||
EP0_IN_DATA_PHASE,
|
||||
EP0_OUT_DATA_PHASE,
|
||||
EP0_IN_STATUS_PHASE,
|
||||
EP0_OUT_STATUS_PHASE,
|
||||
EP0_STALL,
|
||||
} ep0state_e;
|
||||
|
||||
/** Fordward declaration.*/
|
||||
struct dwc_otg_pcd;
|
||||
|
||||
/** DWC_otg iso request structure.
|
||||
*
|
||||
*/
|
||||
typedef struct usb_iso_request dwc_otg_pcd_iso_request_t;
|
||||
|
||||
#ifdef DWC_UTE_PER_IO
|
||||
XXX
|
||||
/**
|
||||
* This shall be the exact analogy of the same type structure defined in the
|
||||
* usb_gadget.h. Each descriptor contains
|
||||
*/
|
||||
struct dwc_iso_pkt_desc_port {
|
||||
uint32_t offset;
|
||||
uint32_t length; /* expected length */
|
||||
uint32_t actual_length;
|
||||
uint32_t status;
|
||||
};
|
||||
|
||||
struct dwc_iso_xreq_port {
|
||||
/** transfer/submission flag */
|
||||
uint32_t tr_sub_flags;
|
||||
/** Start the request ASAP */
|
||||
#define DWC_EREQ_TF_ASAP 0x00000002
|
||||
/** Just enqueue the request w/o initiating a transfer */
|
||||
#define DWC_EREQ_TF_ENQUEUE 0x00000004
|
||||
|
||||
/**
|
||||
* count of ISO packets attached to this request - shall
|
||||
* not exceed the pio_alloc_pkt_count
|
||||
*/
|
||||
uint32_t pio_pkt_count;
|
||||
/** count of ISO packets allocated for this request */
|
||||
uint32_t pio_alloc_pkt_count;
|
||||
/** number of ISO packet errors */
|
||||
uint32_t error_count;
|
||||
/** reserved for future extension */
|
||||
uint32_t res;
|
||||
/** Will be allocated and freed in the UTE gadget and based on the CFC value */
|
||||
struct dwc_iso_pkt_desc_port *per_io_frame_descs;
|
||||
};
|
||||
#endif
|
||||
/** DWC_otg request structure.
|
||||
* This structure is a list of requests.
|
||||
*/
|
||||
typedef struct dwc_otg_pcd_request {
|
||||
void *priv;
|
||||
void *buf;
|
||||
dwc_dma_t dma;
|
||||
uint32_t length;
|
||||
uint32_t actual;
|
||||
unsigned sent_zlp:1;
|
||||
/**
|
||||
* Used instead of original buffer if
|
||||
* it(physical address) is not dword-aligned.
|
||||
**/
|
||||
uint8_t *dw_align_buf;
|
||||
dwc_dma_t dw_align_buf_dma;
|
||||
|
||||
DWC_CIRCLEQ_ENTRY(dwc_otg_pcd_request) queue_entry;
|
||||
#ifdef DWC_UTE_PER_IO
|
||||
struct dwc_iso_xreq_port ext_req;
|
||||
//void *priv_ereq_nport; /* */
|
||||
#endif
|
||||
} dwc_otg_pcd_request_t;
|
||||
|
||||
DWC_CIRCLEQ_HEAD(req_list, dwc_otg_pcd_request);
|
||||
|
||||
/** PCD EP structure.
|
||||
* This structure describes an EP, there is an array of EPs in the PCD
|
||||
* structure.
|
||||
*/
|
||||
typedef struct dwc_otg_pcd_ep {
|
||||
/** USB EP Descriptor */
|
||||
const usb_endpoint_descriptor_t *desc;
|
||||
|
||||
/** queue of dwc_otg_pcd_requests. */
|
||||
struct req_list queue;
|
||||
unsigned stopped:1;
|
||||
unsigned disabling:1;
|
||||
unsigned dma:1;
|
||||
unsigned queue_sof:1;
|
||||
|
||||
#ifdef DWC_EN_ISOC
|
||||
/** ISOC req handle passed */
|
||||
void *iso_req_handle;
|
||||
#endif //_EN_ISOC_
|
||||
|
||||
/** DWC_otg ep data. */
|
||||
dwc_ep_t dwc_ep;
|
||||
|
||||
/** Pointer to PCD */
|
||||
struct dwc_otg_pcd *pcd;
|
||||
|
||||
void *priv;
|
||||
} dwc_otg_pcd_ep_t;
|
||||
|
||||
/** DWC_otg PCD Structure.
|
||||
* This structure encapsulates the data for the dwc_otg PCD.
|
||||
*/
|
||||
struct dwc_otg_pcd {
|
||||
const struct dwc_otg_pcd_function_ops *fops;
|
||||
/** The DWC otg device pointer */
|
||||
struct dwc_otg_device *otg_dev;
|
||||
/** Core Interface */
|
||||
dwc_otg_core_if_t *core_if;
|
||||
/** State of EP0 */
|
||||
ep0state_e ep0state;
|
||||
/** EP0 Request is pending */
|
||||
unsigned ep0_pending:1;
|
||||
/** Indicates when SET CONFIGURATION Request is in process */
|
||||
unsigned request_config:1;
|
||||
/** The state of the Remote Wakeup Enable. */
|
||||
unsigned remote_wakeup_enable:1;
|
||||
/** The state of the B-Device HNP Enable. */
|
||||
unsigned b_hnp_enable:1;
|
||||
/** The state of A-Device HNP Support. */
|
||||
unsigned a_hnp_support:1;
|
||||
/** The state of the A-Device Alt HNP support. */
|
||||
unsigned a_alt_hnp_support:1;
|
||||
/** Count of pending Requests */
|
||||
unsigned request_pending;
|
||||
|
||||
/** SETUP packet for EP0
|
||||
* This structure is allocated as a DMA buffer on PCD initialization
|
||||
* with enough space for up to 3 setup packets.
|
||||
*/
|
||||
union {
|
||||
usb_device_request_t req;
|
||||
uint32_t d32[2];
|
||||
} *setup_pkt;
|
||||
|
||||
dwc_dma_t setup_pkt_dma_handle;
|
||||
|
||||
/* Additional buffer and flag for CTRL_WR premature case */
|
||||
uint8_t *backup_buf;
|
||||
unsigned data_terminated;
|
||||
|
||||
/** 2-byte dma buffer used to return status from GET_STATUS */
|
||||
uint16_t *status_buf;
|
||||
dwc_dma_t status_buf_dma_handle;
|
||||
|
||||
/** EP0 */
|
||||
dwc_otg_pcd_ep_t ep0;
|
||||
|
||||
/** Array of IN EPs. */
|
||||
dwc_otg_pcd_ep_t in_ep[MAX_EPS_CHANNELS - 1];
|
||||
/** Array of OUT EPs. */
|
||||
dwc_otg_pcd_ep_t out_ep[MAX_EPS_CHANNELS - 1];
|
||||
/** number of valid EPs in the above array. */
|
||||
// unsigned num_eps : 4;
|
||||
dwc_spinlock_t *lock;
|
||||
|
||||
/** Tasklet to defer starting of TEST mode transmissions until
|
||||
* Status Phase has been completed.
|
||||
*/
|
||||
dwc_tasklet_t *test_mode_tasklet;
|
||||
|
||||
/** Tasklet to delay starting of xfer in DMA mode */
|
||||
dwc_tasklet_t *start_xfer_tasklet;
|
||||
|
||||
/** The test mode to enter when the tasklet is executed. */
|
||||
unsigned test_mode;
|
||||
/** The cfi_api structure that implements most of the CFI API
|
||||
* and OTG specific core configuration functionality
|
||||
*/
|
||||
#ifdef DWC_UTE_CFI
|
||||
struct cfiobject *cfi;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
//FIXME this functions should be static, and this prototypes should be removed
|
||||
extern _LONG_CALL_ void dwc_otg_request_nuke(dwc_otg_pcd_ep_t * ep);
|
||||
extern _LONG_CALL_ void dwc_otg_request_done(dwc_otg_pcd_ep_t * ep,
|
||||
dwc_otg_pcd_request_t * req, int32_t status);
|
||||
|
||||
_LONG_CALL_ void dwc_otg_iso_buffer_done(dwc_otg_pcd_t * pcd, dwc_otg_pcd_ep_t * ep,
|
||||
void *req_handle);
|
||||
extern _LONG_CALL_ void dwc_otg_pcd_start_iso_ddma(dwc_otg_core_if_t * core_if,
|
||||
dwc_otg_pcd_ep_t * ep);
|
||||
|
||||
extern _LONG_CALL_ void do_test_mode(void *data);
|
||||
|
||||
extern _LONG_CALL_ void dwc_pcd_data_init(VOID);
|
||||
|
||||
#endif
|
||||
#endif /* DWC_HOST_ONLY */
|
||||
/* ==========================================================================
|
||||
* $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd.h $
|
||||
* $Revision: #49 $
|
||||
* $Date: 2013/05/16 $
|
||||
* $Change: 2231774 $
|
||||
*
|
||||
* Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
|
||||
* "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
|
||||
* otherwise expressly agreed to in writing between Synopsys and you.
|
||||
*
|
||||
* The Software IS NOT an item of Licensed Software or Licensed Product under
|
||||
* any End User Software License Agreement or Agreement for Licensed Product
|
||||
* with Synopsys or any supplement thereto. You are permitted to use and
|
||||
* redistribute this Software in source and binary forms, with or without
|
||||
* modification, provided that redistributions of source code must retain this
|
||||
* notice. You may not view, use, disclose, copy or distribute this file or
|
||||
* any information contained herein except pursuant to this license grant from
|
||||
* Synopsys. If you do not agree with this notice, including the disclaimer
|
||||
* below, then you are not authorized to use the Software.
|
||||
*
|
||||
* THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
* ========================================================================== */
|
||||
#if 1//ndef DWC_HOST_ONLY
|
||||
#if !defined(__DWC_PCD_H__)
|
||||
#define __DWC_PCD_H__
|
||||
|
||||
#include "dwc_otg_os_dep.h"
|
||||
#include "usb.h"
|
||||
#include "dwc_otg_cil.h"
|
||||
#include "dwc_otg_pcd_if.h"
|
||||
struct cfiobject;
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* This file contains the structures, constants, and interfaces for
|
||||
* the Perpherial Contoller Driver (PCD).
|
||||
*
|
||||
* The Peripheral Controller Driver (PCD) for Linux will implement the
|
||||
* Gadget API, so that the existing Gadget drivers can be used. For
|
||||
* the Mass Storage Function driver the File-backed USB Storage Gadget
|
||||
* (FBS) driver will be used. The FBS driver supports the
|
||||
* Control-Bulk (CB), Control-Bulk-Interrupt (CBI), and Bulk-Only
|
||||
* transports.
|
||||
*
|
||||
*/
|
||||
|
||||
/** Invalid DMA Address */
|
||||
#define DWC_DMA_ADDR_INVALID (~(dwc_dma_t)0)
|
||||
|
||||
/** Max Transfer size for any EP */
|
||||
#define DDMA_MAX_TRANSFER_SIZE 65535
|
||||
|
||||
/**
|
||||
* Get the pointer to the core_if from the pcd pointer.
|
||||
*/
|
||||
#define GET_CORE_IF( _pcd ) (_pcd->core_if)
|
||||
|
||||
/**
|
||||
* States of EP0.
|
||||
*/
|
||||
typedef enum ep0_state {
|
||||
EP0_DISCONNECT, /* no host */
|
||||
EP0_IDLE,
|
||||
EP0_IN_DATA_PHASE,
|
||||
EP0_OUT_DATA_PHASE,
|
||||
EP0_IN_STATUS_PHASE,
|
||||
EP0_OUT_STATUS_PHASE,
|
||||
EP0_STALL,
|
||||
} ep0state_e;
|
||||
|
||||
/** Fordward declaration.*/
|
||||
struct dwc_otg_pcd;
|
||||
|
||||
/** DWC_otg iso request structure.
|
||||
*
|
||||
*/
|
||||
typedef struct usb_iso_request dwc_otg_pcd_iso_request_t;
|
||||
|
||||
#ifdef DWC_UTE_PER_IO
|
||||
XXX
|
||||
/**
|
||||
* This shall be the exact analogy of the same type structure defined in the
|
||||
* usb_gadget.h. Each descriptor contains
|
||||
*/
|
||||
struct dwc_iso_pkt_desc_port {
|
||||
uint32_t offset;
|
||||
uint32_t length; /* expected length */
|
||||
uint32_t actual_length;
|
||||
uint32_t status;
|
||||
};
|
||||
|
||||
struct dwc_iso_xreq_port {
|
||||
/** transfer/submission flag */
|
||||
uint32_t tr_sub_flags;
|
||||
/** Start the request ASAP */
|
||||
#define DWC_EREQ_TF_ASAP 0x00000002
|
||||
/** Just enqueue the request w/o initiating a transfer */
|
||||
#define DWC_EREQ_TF_ENQUEUE 0x00000004
|
||||
|
||||
/**
|
||||
* count of ISO packets attached to this request - shall
|
||||
* not exceed the pio_alloc_pkt_count
|
||||
*/
|
||||
uint32_t pio_pkt_count;
|
||||
/** count of ISO packets allocated for this request */
|
||||
uint32_t pio_alloc_pkt_count;
|
||||
/** number of ISO packet errors */
|
||||
uint32_t error_count;
|
||||
/** reserved for future extension */
|
||||
uint32_t res;
|
||||
/** Will be allocated and freed in the UTE gadget and based on the CFC value */
|
||||
struct dwc_iso_pkt_desc_port *per_io_frame_descs;
|
||||
};
|
||||
#endif
|
||||
/** DWC_otg request structure.
|
||||
* This structure is a list of requests.
|
||||
*/
|
||||
typedef struct dwc_otg_pcd_request {
|
||||
void *priv;
|
||||
void *buf;
|
||||
dwc_dma_t dma;
|
||||
uint32_t length;
|
||||
uint32_t actual;
|
||||
unsigned sent_zlp:1;
|
||||
/**
|
||||
* Used instead of original buffer if
|
||||
* it(physical address) is not dword-aligned.
|
||||
**/
|
||||
uint8_t *dw_align_buf;
|
||||
dwc_dma_t dw_align_buf_dma;
|
||||
|
||||
DWC_CIRCLEQ_ENTRY(dwc_otg_pcd_request) queue_entry;
|
||||
#ifdef DWC_UTE_PER_IO
|
||||
struct dwc_iso_xreq_port ext_req;
|
||||
//void *priv_ereq_nport; /* */
|
||||
#endif
|
||||
} dwc_otg_pcd_request_t;
|
||||
|
||||
DWC_CIRCLEQ_HEAD(req_list, dwc_otg_pcd_request);
|
||||
|
||||
/** PCD EP structure.
|
||||
* This structure describes an EP, there is an array of EPs in the PCD
|
||||
* structure.
|
||||
*/
|
||||
typedef struct dwc_otg_pcd_ep {
|
||||
/** USB EP Descriptor */
|
||||
const usb_endpoint_descriptor_t *desc;
|
||||
|
||||
/** queue of dwc_otg_pcd_requests. */
|
||||
struct req_list queue;
|
||||
unsigned stopped:1;
|
||||
unsigned disabling:1;
|
||||
unsigned dma:1;
|
||||
unsigned queue_sof:1;
|
||||
|
||||
#ifdef DWC_EN_ISOC
|
||||
/** ISOC req handle passed */
|
||||
void *iso_req_handle;
|
||||
#endif //_EN_ISOC_
|
||||
|
||||
/** DWC_otg ep data. */
|
||||
dwc_ep_t dwc_ep;
|
||||
|
||||
/** Pointer to PCD */
|
||||
struct dwc_otg_pcd *pcd;
|
||||
|
||||
void *priv;
|
||||
} dwc_otg_pcd_ep_t;
|
||||
|
||||
/** DWC_otg PCD Structure.
|
||||
* This structure encapsulates the data for the dwc_otg PCD.
|
||||
*/
|
||||
struct dwc_otg_pcd {
|
||||
const struct dwc_otg_pcd_function_ops *fops;
|
||||
/** The DWC otg device pointer */
|
||||
struct dwc_otg_device *otg_dev;
|
||||
/** Core Interface */
|
||||
dwc_otg_core_if_t *core_if;
|
||||
/** State of EP0 */
|
||||
ep0state_e ep0state;
|
||||
/** EP0 Request is pending */
|
||||
unsigned ep0_pending:1;
|
||||
/** Indicates when SET CONFIGURATION Request is in process */
|
||||
unsigned request_config:1;
|
||||
/** The state of the Remote Wakeup Enable. */
|
||||
unsigned remote_wakeup_enable:1;
|
||||
/** The state of the B-Device HNP Enable. */
|
||||
unsigned b_hnp_enable:1;
|
||||
/** The state of A-Device HNP Support. */
|
||||
unsigned a_hnp_support:1;
|
||||
/** The state of the A-Device Alt HNP support. */
|
||||
unsigned a_alt_hnp_support:1;
|
||||
/** Count of pending Requests */
|
||||
unsigned request_pending;
|
||||
|
||||
/** SETUP packet for EP0
|
||||
* This structure is allocated as a DMA buffer on PCD initialization
|
||||
* with enough space for up to 3 setup packets.
|
||||
*/
|
||||
union {
|
||||
usb_device_request_t req;
|
||||
uint32_t d32[2];
|
||||
} *setup_pkt;
|
||||
|
||||
dwc_dma_t setup_pkt_dma_handle;
|
||||
|
||||
/* Additional buffer and flag for CTRL_WR premature case */
|
||||
uint8_t *backup_buf;
|
||||
unsigned data_terminated;
|
||||
|
||||
/** 2-byte dma buffer used to return status from GET_STATUS */
|
||||
uint16_t *status_buf;
|
||||
dwc_dma_t status_buf_dma_handle;
|
||||
|
||||
/** EP0 */
|
||||
dwc_otg_pcd_ep_t ep0;
|
||||
|
||||
/** Array of IN EPs. */
|
||||
dwc_otg_pcd_ep_t in_ep[MAX_EPS_CHANNELS - 1];
|
||||
/** Array of OUT EPs. */
|
||||
dwc_otg_pcd_ep_t out_ep[MAX_EPS_CHANNELS - 1];
|
||||
/** number of valid EPs in the above array. */
|
||||
// unsigned num_eps : 4;
|
||||
dwc_spinlock_t *lock;
|
||||
|
||||
/** Tasklet to defer starting of TEST mode transmissions until
|
||||
* Status Phase has been completed.
|
||||
*/
|
||||
dwc_tasklet_t *test_mode_tasklet;
|
||||
|
||||
/** Tasklet to delay starting of xfer in DMA mode */
|
||||
dwc_tasklet_t *start_xfer_tasklet;
|
||||
|
||||
/** The test mode to enter when the tasklet is executed. */
|
||||
unsigned test_mode;
|
||||
/** The cfi_api structure that implements most of the CFI API
|
||||
* and OTG specific core configuration functionality
|
||||
*/
|
||||
#ifdef DWC_UTE_CFI
|
||||
struct cfiobject *cfi;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
//FIXME this functions should be static, and this prototypes should be removed
|
||||
extern _LONG_CALL_ void dwc_otg_request_nuke(dwc_otg_pcd_ep_t * ep);
|
||||
extern _LONG_CALL_ void dwc_otg_request_done(dwc_otg_pcd_ep_t * ep,
|
||||
dwc_otg_pcd_request_t * req, int32_t status);
|
||||
|
||||
_LONG_CALL_ void dwc_otg_iso_buffer_done(dwc_otg_pcd_t * pcd, dwc_otg_pcd_ep_t * ep,
|
||||
void *req_handle);
|
||||
extern _LONG_CALL_ void dwc_otg_pcd_start_iso_ddma(dwc_otg_core_if_t * core_if,
|
||||
dwc_otg_pcd_ep_t * ep);
|
||||
|
||||
extern _LONG_CALL_ void do_test_mode(void *data);
|
||||
|
||||
extern _LONG_CALL_ void dwc_pcd_data_init(VOID);
|
||||
|
||||
#endif
|
||||
#endif /* DWC_HOST_ONLY */
|
||||
|
|
|
|||
|
|
@ -1,367 +1,367 @@
|
|||
/* ==========================================================================
|
||||
* $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd_if.h $
|
||||
* $Revision: #13 $
|
||||
* $Date: 2012/12/12 $
|
||||
* $Change: 2125019 $
|
||||
*
|
||||
* Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
|
||||
* "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
|
||||
* otherwise expressly agreed to in writing between Synopsys and you.
|
||||
*
|
||||
* The Software IS NOT an item of Licensed Software or Licensed Product under
|
||||
* any End User Software License Agreement or Agreement for Licensed Product
|
||||
* with Synopsys or any supplement thereto. You are permitted to use and
|
||||
* redistribute this Software in source and binary forms, with or without
|
||||
* modification, provided that redistributions of source code must retain this
|
||||
* notice. You may not view, use, disclose, copy or distribute this file or
|
||||
* any information contained herein except pursuant to this license grant from
|
||||
* Synopsys. If you do not agree with this notice, including the disclaimer
|
||||
* below, then you are not authorized to use the Software.
|
||||
*
|
||||
* THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
* ========================================================================== */
|
||||
#if 1//ndef DWC_HOST_ONLY
|
||||
|
||||
#if !defined(__DWC_PCD_IF_H__)
|
||||
#define __DWC_PCD_IF_H__
|
||||
|
||||
//#include "dwc_os.h"
|
||||
#include "dwc_otg_core_if.h"
|
||||
|
||||
/** @file
|
||||
* This file defines DWC_OTG PCD Core API.
|
||||
*/
|
||||
|
||||
struct dwc_otg_pcd;
|
||||
typedef struct dwc_otg_pcd dwc_otg_pcd_t;
|
||||
|
||||
/** Maxpacket size for EP0 */
|
||||
#define MAX_EP0_SIZE 64
|
||||
/** Maxpacket size for any EP */
|
||||
#define MAX_PACKET_SIZE 2048
|
||||
|
||||
/** @name Function Driver Callbacks */
|
||||
/** @{ */
|
||||
|
||||
/** This function will be called whenever a previously queued request has
|
||||
* completed. The status value will be set to -DWC_E_SHUTDOWN to indicated a
|
||||
* failed or aborted transfer, or -DWC_E_RESTART to indicate the device was reset,
|
||||
* or -DWC_E_TIMEOUT to indicate it timed out, or -DWC_E_INVALID to indicate invalid
|
||||
* parameters. */
|
||||
typedef int (*dwc_completion_cb_t) (dwc_otg_pcd_t * pcd, void *ep_handle,
|
||||
void *req_handle, int32_t status,
|
||||
uint32_t actual);
|
||||
/**
|
||||
* This function will be called whenever a previousle queued ISOC request has
|
||||
* completed. Count of ISOC packets could be read using dwc_otg_pcd_get_iso_packet_count
|
||||
* function.
|
||||
* The status of each ISOC packet could be read using dwc_otg_pcd_get_iso_packet_*
|
||||
* functions.
|
||||
*/
|
||||
typedef int (*dwc_isoc_completion_cb_t) (dwc_otg_pcd_t * pcd, void *ep_handle,
|
||||
void *req_handle, int proc_buf_num);
|
||||
/** This function should handle any SETUP request that cannot be handled by the
|
||||
* PCD Core. This includes most GET_DESCRIPTORs, SET_CONFIGS, Any
|
||||
* class-specific requests, etc. The function must non-blocking.
|
||||
*
|
||||
* Returns 0 on success.
|
||||
* Returns -DWC_E_NOT_SUPPORTED if the request is not supported.
|
||||
* Returns -DWC_E_INVALID if the setup request had invalid parameters or bytes.
|
||||
* Returns -DWC_E_SHUTDOWN on any other error. */
|
||||
typedef int (*dwc_setup_cb_t) (dwc_otg_pcd_t * pcd, uint8_t * bytes);
|
||||
/** This is called whenever the device has been disconnected. The function
|
||||
* driver should take appropriate action to clean up all pending requests in the
|
||||
* PCD Core, remove all endpoints (except ep0), and initialize back to reset
|
||||
* state. */
|
||||
typedef int (*dwc_disconnect_cb_t) (dwc_otg_pcd_t * pcd);
|
||||
/** This function is called when device has been connected. */
|
||||
typedef int (*dwc_connect_cb_t) (dwc_otg_pcd_t * pcd, int speed);
|
||||
/** This function is called when device has been suspended */
|
||||
typedef int (*dwc_suspend_cb_t) (dwc_otg_pcd_t * pcd);
|
||||
/** This function is called when device has received LPM tokens, i.e.
|
||||
* device has been sent to sleep state. */
|
||||
typedef int (*dwc_sleep_cb_t) (dwc_otg_pcd_t * pcd);
|
||||
/** This function is called when device has been resumed
|
||||
* from suspend(L2) or L1 sleep state. */
|
||||
typedef int (*dwc_resume_cb_t) (dwc_otg_pcd_t * pcd);
|
||||
/** This function is called whenever hnp params has been changed.
|
||||
* User can call get_b_hnp_enable, get_a_hnp_support, get_a_alt_hnp_support functions
|
||||
* to get hnp parameters. */
|
||||
typedef int (*dwc_hnp_params_changed_cb_t) (dwc_otg_pcd_t * pcd);
|
||||
/** This function is called whenever USB RESET is detected. */
|
||||
typedef int (*dwc_reset_cb_t) (dwc_otg_pcd_t * pcd);
|
||||
|
||||
typedef int (*cfi_setup_cb_t) (dwc_otg_pcd_t * pcd, void *ctrl_req_bytes);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param ep_handle Void pointer to the usb_ep structure
|
||||
* @param ereq_port Pointer to the extended request structure created in the
|
||||
* portable part.
|
||||
*/
|
||||
typedef int (*xiso_completion_cb_t) (dwc_otg_pcd_t * pcd, void *ep_handle,
|
||||
void *req_handle, int32_t status,
|
||||
void *ereq_port);
|
||||
/** Function Driver Ops Data Structure */
|
||||
struct dwc_otg_pcd_function_ops {
|
||||
dwc_connect_cb_t connect;
|
||||
dwc_disconnect_cb_t disconnect;
|
||||
dwc_setup_cb_t setup;
|
||||
dwc_completion_cb_t complete;
|
||||
dwc_isoc_completion_cb_t isoc_complete;
|
||||
dwc_suspend_cb_t suspend;
|
||||
dwc_sleep_cb_t sleep;
|
||||
dwc_resume_cb_t resume;
|
||||
dwc_reset_cb_t reset;
|
||||
dwc_hnp_params_changed_cb_t hnp_changed;
|
||||
cfi_setup_cb_t cfi_setup;
|
||||
#ifdef DWC_UTE_PER_IO
|
||||
xiso_completion_cb_t xisoc_complete;
|
||||
#endif
|
||||
};
|
||||
/** @} */
|
||||
|
||||
/** @name Function Driver Functions */
|
||||
/** @{ */
|
||||
|
||||
/** Call this function to get pointer on dwc_otg_pcd_t,
|
||||
* this pointer will be used for all PCD API functions.
|
||||
*
|
||||
* @param core_if The DWC_OTG Core
|
||||
*/
|
||||
extern _LONG_CALL_ dwc_otg_pcd_t *dwc_otg_pcd_init(dwc_otg_core_if_t * core_if);
|
||||
|
||||
/** Frees PCD allocated by dwc_otg_pcd_init
|
||||
*
|
||||
* @param pcd The PCD
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_pcd_remove(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** Call this to bind the function driver to the PCD Core.
|
||||
*
|
||||
* @param pcd Pointer on dwc_otg_pcd_t returned by dwc_otg_pcd_init function.
|
||||
* @param fops The Function Driver Ops data structure containing pointers to all callbacks.
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_pcd_start(dwc_otg_pcd_t * pcd,
|
||||
const struct dwc_otg_pcd_function_ops *fops);
|
||||
|
||||
/** Enables an endpoint for use. This function enables an endpoint in
|
||||
* the PCD. The endpoint is described by the ep_desc which has the
|
||||
* same format as a USB ep descriptor. The ep_handle parameter is used to refer
|
||||
* to the endpoint from other API functions and in callbacks. Normally this
|
||||
* should be called after a SET_CONFIGURATION/SET_INTERFACE to configure the
|
||||
* core for that interface.
|
||||
*
|
||||
* Returns -DWC_E_INVALID if invalid parameters were passed.
|
||||
* Returns -DWC_E_SHUTDOWN if any other error ocurred.
|
||||
* Returns 0 on success.
|
||||
*
|
||||
* @param pcd The PCD
|
||||
* @param ep_desc Endpoint descriptor
|
||||
* @param ep_handle Handle on endpoint, that will be used to identify endpoint.
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_ep_enable(dwc_otg_pcd_t * pcd,
|
||||
const uint8_t * ep_desc, void *ep_handle);
|
||||
|
||||
/** Disable the endpoint referenced by ep_handle.
|
||||
*
|
||||
* Returns -DWC_E_INVALID if invalid parameters were passed.
|
||||
* Returns -DWC_E_SHUTDOWN if any other error occurred.
|
||||
* Returns 0 on success. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_ep_disable(dwc_otg_pcd_t * pcd, void *ep_handle);
|
||||
|
||||
/** Queue a data transfer request on the endpoint referenced by ep_handle.
|
||||
* After the transfer is completes, the complete callback will be called with
|
||||
* the request status.
|
||||
*
|
||||
* @param pcd The PCD
|
||||
* @param ep_handle The handle of the endpoint
|
||||
* @param buf The buffer for the data
|
||||
* @param dma_buf The DMA buffer for the data
|
||||
* @param buflen The length of the data transfer
|
||||
* @param zero Specifies whether to send zero length last packet.
|
||||
* @param req_handle Set this handle to any value to use to reference this
|
||||
* request in the ep_dequeue function or from the complete callback
|
||||
* @param atomic_alloc If driver need to perform atomic allocations
|
||||
* for internal data structures.
|
||||
*
|
||||
* Returns -DWC_E_INVALID if invalid parameters were passed.
|
||||
* Returns -DWC_E_SHUTDOWN if any other error ocurred.
|
||||
* Returns 0 on success. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_ep_queue(dwc_otg_pcd_t * pcd, void *ep_handle,
|
||||
uint8_t * buf, dwc_dma_t dma_buf,
|
||||
uint32_t buflen, int zero, void *req_handle,
|
||||
int atomic_alloc);
|
||||
#ifdef DWC_UTE_PER_IO
|
||||
XXXX
|
||||
/**
|
||||
*
|
||||
* @param ereq_nonport Pointer to the extended request part of the
|
||||
* usb_request structure defined in usb_gadget.h file.
|
||||
*/
|
||||
extern int dwc_otg_pcd_xiso_ep_queue(dwc_otg_pcd_t * pcd, void *ep_handle,
|
||||
uint8_t * buf, dwc_dma_t dma_buf,
|
||||
uint32_t buflen, int zero,
|
||||
void *req_handle, int atomic_alloc,
|
||||
void *ereq_nonport);
|
||||
|
||||
#endif
|
||||
|
||||
/** De-queue the specified data transfer that has not yet completed.
|
||||
*
|
||||
* Returns -DWC_E_INVALID if invalid parameters were passed.
|
||||
* Returns -DWC_E_SHUTDOWN if any other error ocurred.
|
||||
* Returns 0 on success. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_ep_dequeue(dwc_otg_pcd_t * pcd, void *ep_handle,
|
||||
void *req_handle);
|
||||
|
||||
/** Halt (STALL) an endpoint or clear it.
|
||||
*
|
||||
* Returns -DWC_E_INVALID if invalid parameters were passed.
|
||||
* Returns -DWC_E_SHUTDOWN if any other error ocurred.
|
||||
* Returns -DWC_E_AGAIN if the STALL cannot be sent and must be tried again later
|
||||
* Returns 0 on success. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_ep_halt(dwc_otg_pcd_t * pcd, void *ep_handle, int value);
|
||||
|
||||
/** This function should be called on every hardware interrupt */
|
||||
extern _LONG_CALL_ int32_t dwc_otg_pcd_handle_intr(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** This function returns current frame number */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_get_frame_number(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/**
|
||||
* Start isochronous transfers on the endpoint referenced by ep_handle.
|
||||
* For isochronous transfers duble buffering is used.
|
||||
* After processing each of buffers comlete callback will be called with
|
||||
* status for each transaction.
|
||||
*
|
||||
* @param pcd The PCD
|
||||
* @param ep_handle The handle of the endpoint
|
||||
* @param buf0 The virtual address of first data buffer
|
||||
* @param buf1 The virtual address of second data buffer
|
||||
* @param dma0 The DMA address of first data buffer
|
||||
* @param dma1 The DMA address of second data buffer
|
||||
* @param sync_frame Data pattern frame number
|
||||
* @param dp_frame Data size for pattern frame
|
||||
* @param data_per_frame Data size for regular frame
|
||||
* @param start_frame Frame number to start transfers, if -1 then start transfers ASAP.
|
||||
* @param buf_proc_intrvl Interval of ISOC Buffer processing
|
||||
* @param req_handle Handle of ISOC request
|
||||
* @param atomic_alloc Specefies whether to perform atomic allocation for
|
||||
* internal data structures.
|
||||
*
|
||||
* Returns -DWC_E_NO_MEMORY if there is no enough memory.
|
||||
* Returns -DWC_E_INVALID if incorrect arguments are passed to the function.
|
||||
* Returns -DW_E_SHUTDOWN for any other error.
|
||||
* Returns 0 on success
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_iso_ep_start(dwc_otg_pcd_t * pcd, void *ep_handle,
|
||||
uint8_t * buf0, uint8_t * buf1,
|
||||
dwc_dma_t dma0, dwc_dma_t dma1,
|
||||
int sync_frame, int dp_frame,
|
||||
int data_per_frame, int start_frame,
|
||||
int buf_proc_intrvl, void *req_handle,
|
||||
int atomic_alloc);
|
||||
|
||||
/** Stop ISOC transfers on endpoint referenced by ep_handle.
|
||||
*
|
||||
* @param pcd The PCD
|
||||
* @param ep_handle The handle of the endpoint
|
||||
* @param req_handle Handle of ISOC request
|
||||
*
|
||||
* Returns -DWC_E_INVALID if incorrect arguments are passed to the function
|
||||
* Returns 0 on success
|
||||
*/
|
||||
_LONG_CALL_ int dwc_otg_pcd_iso_ep_stop(dwc_otg_pcd_t * pcd, void *ep_handle,
|
||||
void *req_handle);
|
||||
|
||||
/** Get ISOC packet status.
|
||||
*
|
||||
* @param pcd The PCD
|
||||
* @param ep_handle The handle of the endpoint
|
||||
* @param iso_req_handle Isochronoush request handle
|
||||
* @param packet Number of packet
|
||||
* @param status Out parameter for returning status
|
||||
* @param actual Out parameter for returning actual length
|
||||
* @param offset Out parameter for returning offset
|
||||
*
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_pcd_get_iso_packet_params(dwc_otg_pcd_t * pcd,
|
||||
void *ep_handle,
|
||||
void *iso_req_handle, int packet,
|
||||
int *status, int *actual,
|
||||
int *offset);
|
||||
|
||||
/** Get ISOC packet count.
|
||||
*
|
||||
* @param pcd The PCD
|
||||
* @param ep_handle The handle of the endpoint
|
||||
* @param iso_req_handle
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_get_iso_packet_count(dwc_otg_pcd_t * pcd,
|
||||
void *ep_handle,
|
||||
void *iso_req_handle);
|
||||
|
||||
/** This function starts the SRP Protocol if no session is in progress. If
|
||||
* a session is already in progress, but the device is suspended,
|
||||
* remote wakeup signaling is started.
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_wakeup(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** This function returns 1 if LPM support is enabled, and 0 otherwise. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_is_lpm_enabled(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** This function returns 1 if LPM Errata support is enabled, and 0 otherwise. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_is_besl_enabled(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** This function returns baseline_besl module parametr. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_get_param_baseline_besl(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** This function returns deep_besl module parametr. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_get_param_deep_besl(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** This function returns 1 if remote wakeup is allowed and 0, otherwise. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_get_rmwkup_enable(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** Initiate SRP */
|
||||
extern _LONG_CALL_ void dwc_otg_pcd_initiate_srp(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** Starts remote wakeup signaling. */
|
||||
extern _LONG_CALL_ void dwc_otg_pcd_remote_wakeup(dwc_otg_pcd_t * pcd, int set);
|
||||
|
||||
/** Starts micorsecond soft disconnect. */
|
||||
extern _LONG_CALL_ void dwc_otg_pcd_disconnect_us(dwc_otg_pcd_t * pcd, int no_of_usecs);
|
||||
/** This function returns whether device is dualspeed.*/
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_pcd_is_dualspeed(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** This function returns whether device is otg. */
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_pcd_is_otg(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** These functions allow to get hnp parameters */
|
||||
extern _LONG_CALL_ uint32_t get_b_hnp_enable(dwc_otg_pcd_t * pcd);
|
||||
extern _LONG_CALL_ uint32_t get_a_hnp_support(dwc_otg_pcd_t * pcd);
|
||||
extern _LONG_CALL_ uint32_t get_a_alt_hnp_support(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** CFI specific Interface functions */
|
||||
/** Allocate a cfi buffer */
|
||||
extern _LONG_CALL_ uint8_t *cfiw_ep_alloc_buffer(dwc_otg_pcd_t * pcd, void *pep,
|
||||
dwc_dma_t * addr, size_t buflen,
|
||||
int flags);
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* __DWC_PCD_IF_H__ */
|
||||
|
||||
#endif /* DWC_HOST_ONLY */
|
||||
/* ==========================================================================
|
||||
* $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_pcd_if.h $
|
||||
* $Revision: #13 $
|
||||
* $Date: 2012/12/12 $
|
||||
* $Change: 2125019 $
|
||||
*
|
||||
* Synopsys HS OTG Linux Software Driver and documentation (hereinafter,
|
||||
* "Software") is an Unsupported proprietary work of Synopsys, Inc. unless
|
||||
* otherwise expressly agreed to in writing between Synopsys and you.
|
||||
*
|
||||
* The Software IS NOT an item of Licensed Software or Licensed Product under
|
||||
* any End User Software License Agreement or Agreement for Licensed Product
|
||||
* with Synopsys or any supplement thereto. You are permitted to use and
|
||||
* redistribute this Software in source and binary forms, with or without
|
||||
* modification, provided that redistributions of source code must retain this
|
||||
* notice. You may not view, use, disclose, copy or distribute this file or
|
||||
* any information contained herein except pursuant to this license grant from
|
||||
* Synopsys. If you do not agree with this notice, including the disclaimer
|
||||
* below, then you are not authorized to use the Software.
|
||||
*
|
||||
* THIS SOFTWARE IS BEING DISTRIBUTED BY SYNOPSYS SOLELY ON AN "AS IS" BASIS
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE HEREBY DISCLAIMED. IN NO EVENT SHALL SYNOPSYS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
* ========================================================================== */
|
||||
#if 1//ndef DWC_HOST_ONLY
|
||||
|
||||
#if !defined(__DWC_PCD_IF_H__)
|
||||
#define __DWC_PCD_IF_H__
|
||||
|
||||
//#include "dwc_os.h"
|
||||
#include "dwc_otg_core_if.h"
|
||||
|
||||
/** @file
|
||||
* This file defines DWC_OTG PCD Core API.
|
||||
*/
|
||||
|
||||
struct dwc_otg_pcd;
|
||||
typedef struct dwc_otg_pcd dwc_otg_pcd_t;
|
||||
|
||||
/** Maxpacket size for EP0 */
|
||||
#define MAX_EP0_SIZE 64
|
||||
/** Maxpacket size for any EP */
|
||||
#define MAX_PACKET_SIZE 2048
|
||||
|
||||
/** @name Function Driver Callbacks */
|
||||
/** @{ */
|
||||
|
||||
/** This function will be called whenever a previously queued request has
|
||||
* completed. The status value will be set to -DWC_E_SHUTDOWN to indicated a
|
||||
* failed or aborted transfer, or -DWC_E_RESTART to indicate the device was reset,
|
||||
* or -DWC_E_TIMEOUT to indicate it timed out, or -DWC_E_INVALID to indicate invalid
|
||||
* parameters. */
|
||||
typedef int (*dwc_completion_cb_t) (dwc_otg_pcd_t * pcd, void *ep_handle,
|
||||
void *req_handle, int32_t status,
|
||||
uint32_t actual);
|
||||
/**
|
||||
* This function will be called whenever a previousle queued ISOC request has
|
||||
* completed. Count of ISOC packets could be read using dwc_otg_pcd_get_iso_packet_count
|
||||
* function.
|
||||
* The status of each ISOC packet could be read using dwc_otg_pcd_get_iso_packet_*
|
||||
* functions.
|
||||
*/
|
||||
typedef int (*dwc_isoc_completion_cb_t) (dwc_otg_pcd_t * pcd, void *ep_handle,
|
||||
void *req_handle, int proc_buf_num);
|
||||
/** This function should handle any SETUP request that cannot be handled by the
|
||||
* PCD Core. This includes most GET_DESCRIPTORs, SET_CONFIGS, Any
|
||||
* class-specific requests, etc. The function must non-blocking.
|
||||
*
|
||||
* Returns 0 on success.
|
||||
* Returns -DWC_E_NOT_SUPPORTED if the request is not supported.
|
||||
* Returns -DWC_E_INVALID if the setup request had invalid parameters or bytes.
|
||||
* Returns -DWC_E_SHUTDOWN on any other error. */
|
||||
typedef int (*dwc_setup_cb_t) (dwc_otg_pcd_t * pcd, uint8_t * bytes);
|
||||
/** This is called whenever the device has been disconnected. The function
|
||||
* driver should take appropriate action to clean up all pending requests in the
|
||||
* PCD Core, remove all endpoints (except ep0), and initialize back to reset
|
||||
* state. */
|
||||
typedef int (*dwc_disconnect_cb_t) (dwc_otg_pcd_t * pcd);
|
||||
/** This function is called when device has been connected. */
|
||||
typedef int (*dwc_connect_cb_t) (dwc_otg_pcd_t * pcd, int speed);
|
||||
/** This function is called when device has been suspended */
|
||||
typedef int (*dwc_suspend_cb_t) (dwc_otg_pcd_t * pcd);
|
||||
/** This function is called when device has received LPM tokens, i.e.
|
||||
* device has been sent to sleep state. */
|
||||
typedef int (*dwc_sleep_cb_t) (dwc_otg_pcd_t * pcd);
|
||||
/** This function is called when device has been resumed
|
||||
* from suspend(L2) or L1 sleep state. */
|
||||
typedef int (*dwc_resume_cb_t) (dwc_otg_pcd_t * pcd);
|
||||
/** This function is called whenever hnp params has been changed.
|
||||
* User can call get_b_hnp_enable, get_a_hnp_support, get_a_alt_hnp_support functions
|
||||
* to get hnp parameters. */
|
||||
typedef int (*dwc_hnp_params_changed_cb_t) (dwc_otg_pcd_t * pcd);
|
||||
/** This function is called whenever USB RESET is detected. */
|
||||
typedef int (*dwc_reset_cb_t) (dwc_otg_pcd_t * pcd);
|
||||
|
||||
typedef int (*cfi_setup_cb_t) (dwc_otg_pcd_t * pcd, void *ctrl_req_bytes);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param ep_handle Void pointer to the usb_ep structure
|
||||
* @param ereq_port Pointer to the extended request structure created in the
|
||||
* portable part.
|
||||
*/
|
||||
typedef int (*xiso_completion_cb_t) (dwc_otg_pcd_t * pcd, void *ep_handle,
|
||||
void *req_handle, int32_t status,
|
||||
void *ereq_port);
|
||||
/** Function Driver Ops Data Structure */
|
||||
struct dwc_otg_pcd_function_ops {
|
||||
dwc_connect_cb_t connect;
|
||||
dwc_disconnect_cb_t disconnect;
|
||||
dwc_setup_cb_t setup;
|
||||
dwc_completion_cb_t complete;
|
||||
dwc_isoc_completion_cb_t isoc_complete;
|
||||
dwc_suspend_cb_t suspend;
|
||||
dwc_sleep_cb_t sleep;
|
||||
dwc_resume_cb_t resume;
|
||||
dwc_reset_cb_t reset;
|
||||
dwc_hnp_params_changed_cb_t hnp_changed;
|
||||
cfi_setup_cb_t cfi_setup;
|
||||
#ifdef DWC_UTE_PER_IO
|
||||
xiso_completion_cb_t xisoc_complete;
|
||||
#endif
|
||||
};
|
||||
/** @} */
|
||||
|
||||
/** @name Function Driver Functions */
|
||||
/** @{ */
|
||||
|
||||
/** Call this function to get pointer on dwc_otg_pcd_t,
|
||||
* this pointer will be used for all PCD API functions.
|
||||
*
|
||||
* @param core_if The DWC_OTG Core
|
||||
*/
|
||||
extern _LONG_CALL_ dwc_otg_pcd_t *dwc_otg_pcd_init(dwc_otg_core_if_t * core_if);
|
||||
|
||||
/** Frees PCD allocated by dwc_otg_pcd_init
|
||||
*
|
||||
* @param pcd The PCD
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_pcd_remove(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** Call this to bind the function driver to the PCD Core.
|
||||
*
|
||||
* @param pcd Pointer on dwc_otg_pcd_t returned by dwc_otg_pcd_init function.
|
||||
* @param fops The Function Driver Ops data structure containing pointers to all callbacks.
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_pcd_start(dwc_otg_pcd_t * pcd,
|
||||
const struct dwc_otg_pcd_function_ops *fops);
|
||||
|
||||
/** Enables an endpoint for use. This function enables an endpoint in
|
||||
* the PCD. The endpoint is described by the ep_desc which has the
|
||||
* same format as a USB ep descriptor. The ep_handle parameter is used to refer
|
||||
* to the endpoint from other API functions and in callbacks. Normally this
|
||||
* should be called after a SET_CONFIGURATION/SET_INTERFACE to configure the
|
||||
* core for that interface.
|
||||
*
|
||||
* Returns -DWC_E_INVALID if invalid parameters were passed.
|
||||
* Returns -DWC_E_SHUTDOWN if any other error ocurred.
|
||||
* Returns 0 on success.
|
||||
*
|
||||
* @param pcd The PCD
|
||||
* @param ep_desc Endpoint descriptor
|
||||
* @param ep_handle Handle on endpoint, that will be used to identify endpoint.
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_ep_enable(dwc_otg_pcd_t * pcd,
|
||||
const uint8_t * ep_desc, void *ep_handle);
|
||||
|
||||
/** Disable the endpoint referenced by ep_handle.
|
||||
*
|
||||
* Returns -DWC_E_INVALID if invalid parameters were passed.
|
||||
* Returns -DWC_E_SHUTDOWN if any other error occurred.
|
||||
* Returns 0 on success. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_ep_disable(dwc_otg_pcd_t * pcd, void *ep_handle);
|
||||
|
||||
/** Queue a data transfer request on the endpoint referenced by ep_handle.
|
||||
* After the transfer is completes, the complete callback will be called with
|
||||
* the request status.
|
||||
*
|
||||
* @param pcd The PCD
|
||||
* @param ep_handle The handle of the endpoint
|
||||
* @param buf The buffer for the data
|
||||
* @param dma_buf The DMA buffer for the data
|
||||
* @param buflen The length of the data transfer
|
||||
* @param zero Specifies whether to send zero length last packet.
|
||||
* @param req_handle Set this handle to any value to use to reference this
|
||||
* request in the ep_dequeue function or from the complete callback
|
||||
* @param atomic_alloc If driver need to perform atomic allocations
|
||||
* for internal data structures.
|
||||
*
|
||||
* Returns -DWC_E_INVALID if invalid parameters were passed.
|
||||
* Returns -DWC_E_SHUTDOWN if any other error ocurred.
|
||||
* Returns 0 on success. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_ep_queue(dwc_otg_pcd_t * pcd, void *ep_handle,
|
||||
uint8_t * buf, dwc_dma_t dma_buf,
|
||||
uint32_t buflen, int zero, void *req_handle,
|
||||
int atomic_alloc);
|
||||
#ifdef DWC_UTE_PER_IO
|
||||
XXXX
|
||||
/**
|
||||
*
|
||||
* @param ereq_nonport Pointer to the extended request part of the
|
||||
* usb_request structure defined in usb_gadget.h file.
|
||||
*/
|
||||
extern int dwc_otg_pcd_xiso_ep_queue(dwc_otg_pcd_t * pcd, void *ep_handle,
|
||||
uint8_t * buf, dwc_dma_t dma_buf,
|
||||
uint32_t buflen, int zero,
|
||||
void *req_handle, int atomic_alloc,
|
||||
void *ereq_nonport);
|
||||
|
||||
#endif
|
||||
|
||||
/** De-queue the specified data transfer that has not yet completed.
|
||||
*
|
||||
* Returns -DWC_E_INVALID if invalid parameters were passed.
|
||||
* Returns -DWC_E_SHUTDOWN if any other error ocurred.
|
||||
* Returns 0 on success. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_ep_dequeue(dwc_otg_pcd_t * pcd, void *ep_handle,
|
||||
void *req_handle);
|
||||
|
||||
/** Halt (STALL) an endpoint or clear it.
|
||||
*
|
||||
* Returns -DWC_E_INVALID if invalid parameters were passed.
|
||||
* Returns -DWC_E_SHUTDOWN if any other error ocurred.
|
||||
* Returns -DWC_E_AGAIN if the STALL cannot be sent and must be tried again later
|
||||
* Returns 0 on success. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_ep_halt(dwc_otg_pcd_t * pcd, void *ep_handle, int value);
|
||||
|
||||
/** This function should be called on every hardware interrupt */
|
||||
extern _LONG_CALL_ int32_t dwc_otg_pcd_handle_intr(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** This function returns current frame number */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_get_frame_number(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/**
|
||||
* Start isochronous transfers on the endpoint referenced by ep_handle.
|
||||
* For isochronous transfers duble buffering is used.
|
||||
* After processing each of buffers comlete callback will be called with
|
||||
* status for each transaction.
|
||||
*
|
||||
* @param pcd The PCD
|
||||
* @param ep_handle The handle of the endpoint
|
||||
* @param buf0 The virtual address of first data buffer
|
||||
* @param buf1 The virtual address of second data buffer
|
||||
* @param dma0 The DMA address of first data buffer
|
||||
* @param dma1 The DMA address of second data buffer
|
||||
* @param sync_frame Data pattern frame number
|
||||
* @param dp_frame Data size for pattern frame
|
||||
* @param data_per_frame Data size for regular frame
|
||||
* @param start_frame Frame number to start transfers, if -1 then start transfers ASAP.
|
||||
* @param buf_proc_intrvl Interval of ISOC Buffer processing
|
||||
* @param req_handle Handle of ISOC request
|
||||
* @param atomic_alloc Specefies whether to perform atomic allocation for
|
||||
* internal data structures.
|
||||
*
|
||||
* Returns -DWC_E_NO_MEMORY if there is no enough memory.
|
||||
* Returns -DWC_E_INVALID if incorrect arguments are passed to the function.
|
||||
* Returns -DW_E_SHUTDOWN for any other error.
|
||||
* Returns 0 on success
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_iso_ep_start(dwc_otg_pcd_t * pcd, void *ep_handle,
|
||||
uint8_t * buf0, uint8_t * buf1,
|
||||
dwc_dma_t dma0, dwc_dma_t dma1,
|
||||
int sync_frame, int dp_frame,
|
||||
int data_per_frame, int start_frame,
|
||||
int buf_proc_intrvl, void *req_handle,
|
||||
int atomic_alloc);
|
||||
|
||||
/** Stop ISOC transfers on endpoint referenced by ep_handle.
|
||||
*
|
||||
* @param pcd The PCD
|
||||
* @param ep_handle The handle of the endpoint
|
||||
* @param req_handle Handle of ISOC request
|
||||
*
|
||||
* Returns -DWC_E_INVALID if incorrect arguments are passed to the function
|
||||
* Returns 0 on success
|
||||
*/
|
||||
_LONG_CALL_ int dwc_otg_pcd_iso_ep_stop(dwc_otg_pcd_t * pcd, void *ep_handle,
|
||||
void *req_handle);
|
||||
|
||||
/** Get ISOC packet status.
|
||||
*
|
||||
* @param pcd The PCD
|
||||
* @param ep_handle The handle of the endpoint
|
||||
* @param iso_req_handle Isochronoush request handle
|
||||
* @param packet Number of packet
|
||||
* @param status Out parameter for returning status
|
||||
* @param actual Out parameter for returning actual length
|
||||
* @param offset Out parameter for returning offset
|
||||
*
|
||||
*/
|
||||
extern _LONG_CALL_ void dwc_otg_pcd_get_iso_packet_params(dwc_otg_pcd_t * pcd,
|
||||
void *ep_handle,
|
||||
void *iso_req_handle, int packet,
|
||||
int *status, int *actual,
|
||||
int *offset);
|
||||
|
||||
/** Get ISOC packet count.
|
||||
*
|
||||
* @param pcd The PCD
|
||||
* @param ep_handle The handle of the endpoint
|
||||
* @param iso_req_handle
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_get_iso_packet_count(dwc_otg_pcd_t * pcd,
|
||||
void *ep_handle,
|
||||
void *iso_req_handle);
|
||||
|
||||
/** This function starts the SRP Protocol if no session is in progress. If
|
||||
* a session is already in progress, but the device is suspended,
|
||||
* remote wakeup signaling is started.
|
||||
*/
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_wakeup(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** This function returns 1 if LPM support is enabled, and 0 otherwise. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_is_lpm_enabled(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** This function returns 1 if LPM Errata support is enabled, and 0 otherwise. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_is_besl_enabled(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** This function returns baseline_besl module parametr. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_get_param_baseline_besl(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** This function returns deep_besl module parametr. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_get_param_deep_besl(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** This function returns 1 if remote wakeup is allowed and 0, otherwise. */
|
||||
extern _LONG_CALL_ int dwc_otg_pcd_get_rmwkup_enable(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** Initiate SRP */
|
||||
extern _LONG_CALL_ void dwc_otg_pcd_initiate_srp(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** Starts remote wakeup signaling. */
|
||||
extern _LONG_CALL_ void dwc_otg_pcd_remote_wakeup(dwc_otg_pcd_t * pcd, int set);
|
||||
|
||||
/** Starts micorsecond soft disconnect. */
|
||||
extern _LONG_CALL_ void dwc_otg_pcd_disconnect_us(dwc_otg_pcd_t * pcd, int no_of_usecs);
|
||||
/** This function returns whether device is dualspeed.*/
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_pcd_is_dualspeed(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** This function returns whether device is otg. */
|
||||
extern _LONG_CALL_ uint32_t dwc_otg_pcd_is_otg(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** These functions allow to get hnp parameters */
|
||||
extern _LONG_CALL_ uint32_t get_b_hnp_enable(dwc_otg_pcd_t * pcd);
|
||||
extern _LONG_CALL_ uint32_t get_a_hnp_support(dwc_otg_pcd_t * pcd);
|
||||
extern _LONG_CALL_ uint32_t get_a_alt_hnp_support(dwc_otg_pcd_t * pcd);
|
||||
|
||||
/** CFI specific Interface functions */
|
||||
/** Allocate a cfi buffer */
|
||||
extern _LONG_CALL_ uint8_t *cfiw_ep_alloc_buffer(dwc_otg_pcd_t * pcd, void *pep,
|
||||
dwc_dma_t * addr, size_t buflen,
|
||||
int flags);
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
/** @} */
|
||||
|
||||
#endif /* __DWC_PCD_IF_H__ */
|
||||
|
||||
#endif /* DWC_HOST_ONLY */
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,149 +1,149 @@
|
|||
#ifndef _GENERIC_ERRNO_H
|
||||
#define _GENERIC_ERRNO_H
|
||||
|
||||
#define EPERM 1 /* Operation not permitted */
|
||||
#define ENOENT 2 /* No such file or directory */
|
||||
#define ESRCH 3 /* No such process */
|
||||
#define EINTR 4 /* Interrupted system call */
|
||||
#define EIO 5 /* I/O error */
|
||||
#define ENXIO 6 /* No such device or address */
|
||||
#define E2BIG 7 /* Argument list too long */
|
||||
#define ENOEXEC 8 /* Exec format error */
|
||||
#define EBADF 9 /* Bad file number */
|
||||
#define ECHILD 10 /* No child processes */
|
||||
#define EAGAIN 11 /* Try again */
|
||||
#define ENOMEM 12 /* Out of memory */
|
||||
#define EACCES 13 /* Permission denied */
|
||||
#define EFAULT 14 /* Bad address */
|
||||
#define ENOTBLK 15 /* Block device required */
|
||||
#define EBUSY 16 /* Device or resource busy */
|
||||
#define EEXIST 17 /* File exists */
|
||||
#define EXDEV 18 /* Cross-device link */
|
||||
#define ENODEV 19 /* No such device */
|
||||
#define ENOTDIR 20 /* Not a directory */
|
||||
#define EISDIR 21 /* Is a directory */
|
||||
#define EINVAL 22 /* Invalid argument */
|
||||
#define ENFILE 23 /* File table overflow */
|
||||
#define EMFILE 24 /* Too many open files */
|
||||
#define ENOTTY 25 /* Not a typewriter */
|
||||
#define ETXTBSY 26 /* Text file busy */
|
||||
#define EFBIG 27 /* File too large */
|
||||
#define ENOSPC 28 /* No space left on device */
|
||||
#define ESPIPE 29 /* Illegal seek */
|
||||
#define EROFS 30 /* Read-only file system */
|
||||
#define EMLINK 31 /* Too many links */
|
||||
#define EPIPE 32 /* Broken pipe */
|
||||
#define EDOM 33 /* Math argument out of domain of func */
|
||||
#define ERANGE 34 /* Math result not representable */
|
||||
|
||||
#define EDEADLK 35 /* Resource deadlock would occur */
|
||||
#define ENAMETOOLONG 36 /* File name too long */
|
||||
#define ENOLCK 37 /* No record locks available */
|
||||
#define ENOSYS 38 /* Function not implemented */
|
||||
#define ENOTEMPTY 39 /* Directory not empty */
|
||||
#define ELOOP 40 /* Too many symbolic links encountered */
|
||||
#define EWOULDBLOCK EAGAIN /* Operation would block */
|
||||
#define ENOMSG 42 /* No message of desired type */
|
||||
#define EIDRM 43 /* Identifier removed */
|
||||
#define ECHRNG 44 /* Channel number out of range */
|
||||
#define EL2NSYNC 45 /* Level 2 not synchronized */
|
||||
#define EL3HLT 46 /* Level 3 halted */
|
||||
#define EL3RST 47 /* Level 3 reset */
|
||||
#define ELNRNG 48 /* Link number out of range */
|
||||
#define EUNATCH 49 /* Protocol driver not attached */
|
||||
#define ENOCSI 50 /* No CSI structure available */
|
||||
#define EL2HLT 51 /* Level 2 halted */
|
||||
#define EBADE 52 /* Invalid exchange */
|
||||
#define EBADR 53 /* Invalid request descriptor */
|
||||
#define EXFULL 54 /* Exchange full */
|
||||
#define ENOANO 55 /* No anode */
|
||||
#define EBADRQC 56 /* Invalid request code */
|
||||
#define EBADSLT 57 /* Invalid slot */
|
||||
|
||||
#define EDEADLOCK EDEADLK
|
||||
|
||||
#define EBFONT 59 /* Bad font file format */
|
||||
#define ENOSTR 60 /* Device not a stream */
|
||||
#define ENODATA 61 /* No data available */
|
||||
#define ETIME 62 /* Timer expired */
|
||||
#define ENOSR 63 /* Out of streams resources */
|
||||
#define ENONET 64 /* Machine is not on the network */
|
||||
#define ENOPKG 65 /* Package not installed */
|
||||
#define EREMOTE 66 /* Object is remote */
|
||||
#define ENOLINK 67 /* Link has been severed */
|
||||
#define EADV 68 /* Advertise error */
|
||||
#define ESRMNT 69 /* Srmount error */
|
||||
#define ECOMM 70 /* Communication error on send */
|
||||
#define EPROTO 71 /* Protocol error */
|
||||
#define EMULTIHOP 72 /* Multihop attempted */
|
||||
#define EDOTDOT 73 /* RFS specific error */
|
||||
#define EBADMSG 74 /* Not a data message */
|
||||
#define EOVERFLOW 75 /* Value too large for defined data type */
|
||||
#define ENOTUNIQ 76 /* Name not unique on network */
|
||||
#define EBADFD 77 /* File descriptor in bad state */
|
||||
#define EREMCHG 78 /* Remote address changed */
|
||||
#define ELIBACC 79 /* Can not access a needed shared library */
|
||||
#define ELIBBAD 80 /* Accessing a corrupted shared library */
|
||||
#define ELIBSCN 81 /* .lib section in a.out corrupted */
|
||||
#define ELIBMAX 82 /* Attempting to link in too many shared libraries */
|
||||
#define ELIBEXEC 83 /* Cannot exec a shared library directly */
|
||||
#define EILSEQ 84 /* Illegal byte sequence */
|
||||
#define ERESTART 85 /* Interrupted system call should be restarted */
|
||||
#define ESTRPIPE 86 /* Streams pipe error */
|
||||
#define EUSERS 87 /* Too many users */
|
||||
#define ENOTSOCK 88 /* Socket operation on non-socket */
|
||||
#define EDESTADDRREQ 89 /* Destination address required */
|
||||
#define EMSGSIZE 90 /* Message too long */
|
||||
#define EPROTOTYPE 91 /* Protocol wrong type for socket */
|
||||
#define ENOPROTOOPT 92 /* Protocol not available */
|
||||
#define EPROTONOSUPPORT 93 /* Protocol not supported */
|
||||
#define ESOCKTNOSUPPORT 94 /* Socket type not supported */
|
||||
#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
|
||||
#define EPFNOSUPPORT 96 /* Protocol family not supported */
|
||||
#define EAFNOSUPPORT 97 /* Address family not supported by protocol */
|
||||
#define EADDRINUSE 98 /* Address already in use */
|
||||
#define EADDRNOTAVAIL 99 /* Cannot assign requested address */
|
||||
#define ENETDOWN 100 /* Network is down */
|
||||
#define ENETUNREACH 101 /* Network is unreachable */
|
||||
#define ENETRESET 102 /* Network dropped connection because of reset */
|
||||
#define ECONNABORTED 103 /* Software caused connection abort */
|
||||
#define ECONNRESET 104 /* Connection reset by peer */
|
||||
#define ENOBUFS 105 /* No buffer space available */
|
||||
#define EISCONN 106 /* Transport endpoint is already connected */
|
||||
#define ENOTCONN 107 /* Transport endpoint is not connected */
|
||||
#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
|
||||
#define ETOOMANYREFS 109 /* Too many references: cannot splice */
|
||||
#define ETIMEDOUT 110 /* Connection timed out */
|
||||
#define ECONNREFUSED 111 /* Connection refused */
|
||||
#define EHOSTDOWN 112 /* Host is down */
|
||||
#define EHOSTUNREACH 113 /* No route to host */
|
||||
#define EALREADY 114 /* Operation already in progress */
|
||||
#define EINPROGRESS 115 /* Operation now in progress */
|
||||
#define ESTALE 116 /* Stale NFS file handle */
|
||||
#define EUCLEAN 117 /* Structure needs cleaning */
|
||||
#define ENOTNAM 118 /* Not a XENIX named type file */
|
||||
#define ENAVAIL 119 /* No XENIX semaphores available */
|
||||
#define EISNAM 120 /* Is a named type file */
|
||||
#define EREMOTEIO 121 /* Remote I/O error */
|
||||
#define EDQUOT 122 /* Quota exceeded */
|
||||
|
||||
#define ENOMEDIUM 123 /* No medium found */
|
||||
#define EMEDIUMTYPE 124 /* Wrong medium type */
|
||||
#define ECANCELED 125 /* Operation Canceled */
|
||||
#define ENOKEY 126 /* Required key not available */
|
||||
#define EKEYEXPIRED 127 /* Key has expired */
|
||||
#define EKEYREVOKED 128 /* Key has been revoked */
|
||||
#define EKEYREJECTED 129 /* Key was rejected by service */
|
||||
|
||||
/* for robust mutexes */
|
||||
#define EOWNERDEAD 130 /* Owner died */
|
||||
#define ENOTRECOVERABLE 131 /* State not recoverable */
|
||||
|
||||
#define ERFKILL 132 /* Operation not possible due to RF-kill */
|
||||
|
||||
#define EHWPOISON 133 /* Memory page has hardware error */
|
||||
|
||||
|
||||
#define ENOTSUPP 524 /* Operation is not supported */
|
||||
|
||||
#endif
|
||||
#ifndef _GENERIC_ERRNO_H
|
||||
#define _GENERIC_ERRNO_H
|
||||
|
||||
#define EPERM 1 /* Operation not permitted */
|
||||
#define ENOENT 2 /* No such file or directory */
|
||||
#define ESRCH 3 /* No such process */
|
||||
#define EINTR 4 /* Interrupted system call */
|
||||
#define EIO 5 /* I/O error */
|
||||
#define ENXIO 6 /* No such device or address */
|
||||
#define E2BIG 7 /* Argument list too long */
|
||||
#define ENOEXEC 8 /* Exec format error */
|
||||
#define EBADF 9 /* Bad file number */
|
||||
#define ECHILD 10 /* No child processes */
|
||||
#define EAGAIN 11 /* Try again */
|
||||
#define ENOMEM 12 /* Out of memory */
|
||||
#define EACCES 13 /* Permission denied */
|
||||
#define EFAULT 14 /* Bad address */
|
||||
#define ENOTBLK 15 /* Block device required */
|
||||
#define EBUSY 16 /* Device or resource busy */
|
||||
#define EEXIST 17 /* File exists */
|
||||
#define EXDEV 18 /* Cross-device link */
|
||||
#define ENODEV 19 /* No such device */
|
||||
#define ENOTDIR 20 /* Not a directory */
|
||||
#define EISDIR 21 /* Is a directory */
|
||||
#define EINVAL 22 /* Invalid argument */
|
||||
#define ENFILE 23 /* File table overflow */
|
||||
#define EMFILE 24 /* Too many open files */
|
||||
#define ENOTTY 25 /* Not a typewriter */
|
||||
#define ETXTBSY 26 /* Text file busy */
|
||||
#define EFBIG 27 /* File too large */
|
||||
#define ENOSPC 28 /* No space left on device */
|
||||
#define ESPIPE 29 /* Illegal seek */
|
||||
#define EROFS 30 /* Read-only file system */
|
||||
#define EMLINK 31 /* Too many links */
|
||||
#define EPIPE 32 /* Broken pipe */
|
||||
#define EDOM 33 /* Math argument out of domain of func */
|
||||
#define ERANGE 34 /* Math result not representable */
|
||||
|
||||
#define EDEADLK 35 /* Resource deadlock would occur */
|
||||
#define ENAMETOOLONG 36 /* File name too long */
|
||||
#define ENOLCK 37 /* No record locks available */
|
||||
#define ENOSYS 38 /* Function not implemented */
|
||||
#define ENOTEMPTY 39 /* Directory not empty */
|
||||
#define ELOOP 40 /* Too many symbolic links encountered */
|
||||
#define EWOULDBLOCK EAGAIN /* Operation would block */
|
||||
#define ENOMSG 42 /* No message of desired type */
|
||||
#define EIDRM 43 /* Identifier removed */
|
||||
#define ECHRNG 44 /* Channel number out of range */
|
||||
#define EL2NSYNC 45 /* Level 2 not synchronized */
|
||||
#define EL3HLT 46 /* Level 3 halted */
|
||||
#define EL3RST 47 /* Level 3 reset */
|
||||
#define ELNRNG 48 /* Link number out of range */
|
||||
#define EUNATCH 49 /* Protocol driver not attached */
|
||||
#define ENOCSI 50 /* No CSI structure available */
|
||||
#define EL2HLT 51 /* Level 2 halted */
|
||||
#define EBADE 52 /* Invalid exchange */
|
||||
#define EBADR 53 /* Invalid request descriptor */
|
||||
#define EXFULL 54 /* Exchange full */
|
||||
#define ENOANO 55 /* No anode */
|
||||
#define EBADRQC 56 /* Invalid request code */
|
||||
#define EBADSLT 57 /* Invalid slot */
|
||||
|
||||
#define EDEADLOCK EDEADLK
|
||||
|
||||
#define EBFONT 59 /* Bad font file format */
|
||||
#define ENOSTR 60 /* Device not a stream */
|
||||
#define ENODATA 61 /* No data available */
|
||||
#define ETIME 62 /* Timer expired */
|
||||
#define ENOSR 63 /* Out of streams resources */
|
||||
#define ENONET 64 /* Machine is not on the network */
|
||||
#define ENOPKG 65 /* Package not installed */
|
||||
#define EREMOTE 66 /* Object is remote */
|
||||
#define ENOLINK 67 /* Link has been severed */
|
||||
#define EADV 68 /* Advertise error */
|
||||
#define ESRMNT 69 /* Srmount error */
|
||||
#define ECOMM 70 /* Communication error on send */
|
||||
#define EPROTO 71 /* Protocol error */
|
||||
#define EMULTIHOP 72 /* Multihop attempted */
|
||||
#define EDOTDOT 73 /* RFS specific error */
|
||||
#define EBADMSG 74 /* Not a data message */
|
||||
#define EOVERFLOW 75 /* Value too large for defined data type */
|
||||
#define ENOTUNIQ 76 /* Name not unique on network */
|
||||
#define EBADFD 77 /* File descriptor in bad state */
|
||||
#define EREMCHG 78 /* Remote address changed */
|
||||
#define ELIBACC 79 /* Can not access a needed shared library */
|
||||
#define ELIBBAD 80 /* Accessing a corrupted shared library */
|
||||
#define ELIBSCN 81 /* .lib section in a.out corrupted */
|
||||
#define ELIBMAX 82 /* Attempting to link in too many shared libraries */
|
||||
#define ELIBEXEC 83 /* Cannot exec a shared library directly */
|
||||
#define EILSEQ 84 /* Illegal byte sequence */
|
||||
#define ERESTART 85 /* Interrupted system call should be restarted */
|
||||
#define ESTRPIPE 86 /* Streams pipe error */
|
||||
#define EUSERS 87 /* Too many users */
|
||||
#define ENOTSOCK 88 /* Socket operation on non-socket */
|
||||
#define EDESTADDRREQ 89 /* Destination address required */
|
||||
#define EMSGSIZE 90 /* Message too long */
|
||||
#define EPROTOTYPE 91 /* Protocol wrong type for socket */
|
||||
#define ENOPROTOOPT 92 /* Protocol not available */
|
||||
#define EPROTONOSUPPORT 93 /* Protocol not supported */
|
||||
#define ESOCKTNOSUPPORT 94 /* Socket type not supported */
|
||||
#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
|
||||
#define EPFNOSUPPORT 96 /* Protocol family not supported */
|
||||
#define EAFNOSUPPORT 97 /* Address family not supported by protocol */
|
||||
#define EADDRINUSE 98 /* Address already in use */
|
||||
#define EADDRNOTAVAIL 99 /* Cannot assign requested address */
|
||||
#define ENETDOWN 100 /* Network is down */
|
||||
#define ENETUNREACH 101 /* Network is unreachable */
|
||||
#define ENETRESET 102 /* Network dropped connection because of reset */
|
||||
#define ECONNABORTED 103 /* Software caused connection abort */
|
||||
#define ECONNRESET 104 /* Connection reset by peer */
|
||||
#define ENOBUFS 105 /* No buffer space available */
|
||||
#define EISCONN 106 /* Transport endpoint is already connected */
|
||||
#define ENOTCONN 107 /* Transport endpoint is not connected */
|
||||
#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
|
||||
#define ETOOMANYREFS 109 /* Too many references: cannot splice */
|
||||
#define ETIMEDOUT 110 /* Connection timed out */
|
||||
#define ECONNREFUSED 111 /* Connection refused */
|
||||
#define EHOSTDOWN 112 /* Host is down */
|
||||
#define EHOSTUNREACH 113 /* No route to host */
|
||||
#define EALREADY 114 /* Operation already in progress */
|
||||
#define EINPROGRESS 115 /* Operation now in progress */
|
||||
#define ESTALE 116 /* Stale NFS file handle */
|
||||
#define EUCLEAN 117 /* Structure needs cleaning */
|
||||
#define ENOTNAM 118 /* Not a XENIX named type file */
|
||||
#define ENAVAIL 119 /* No XENIX semaphores available */
|
||||
#define EISNAM 120 /* Is a named type file */
|
||||
#define EREMOTEIO 121 /* Remote I/O error */
|
||||
#define EDQUOT 122 /* Quota exceeded */
|
||||
|
||||
#define ENOMEDIUM 123 /* No medium found */
|
||||
#define EMEDIUMTYPE 124 /* Wrong medium type */
|
||||
#define ECANCELED 125 /* Operation Canceled */
|
||||
#define ENOKEY 126 /* Required key not available */
|
||||
#define EKEYEXPIRED 127 /* Key has expired */
|
||||
#define EKEYREVOKED 128 /* Key has been revoked */
|
||||
#define EKEYREJECTED 129 /* Key was rejected by service */
|
||||
|
||||
/* for robust mutexes */
|
||||
#define EOWNERDEAD 130 /* Owner died */
|
||||
#define ENOTRECOVERABLE 131 /* State not recoverable */
|
||||
|
||||
#define ERFKILL 132 /* Operation not possible due to RF-kill */
|
||||
|
||||
#define EHWPOISON 133 /* Memory page has hardware error */
|
||||
|
||||
|
||||
#define ENOTSUPP 524 /* Operation is not supported */
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
/*
|
||||
* Routines to access hardware
|
||||
*
|
||||
* Copyright (c) 2013 Realtek Semiconductor Corp.
|
||||
*
|
||||
* This module is a confidential and proprietary property of RealTek and
|
||||
* possession or use of this module requires written permission of RealTek.
|
||||
*/
|
||||
|
||||
#ifndef _HAL_OTG_H_
|
||||
#define _HAL_OTG_H_
|
||||
|
||||
#include "rtl8195a_otg.h"
|
||||
#include "dwc_otg_regs.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
/*
|
||||
* Routines to access hardware
|
||||
*
|
||||
* Copyright (c) 2013 Realtek Semiconductor Corp.
|
||||
*
|
||||
* This module is a confidential and proprietary property of RealTek and
|
||||
* possession or use of this module requires written permission of RealTek.
|
||||
*/
|
||||
|
||||
#ifndef _HAL_OTG_H_
|
||||
#define _HAL_OTG_H_
|
||||
|
||||
#include "rtl8195a_otg.h"
|
||||
#include "dwc_otg_regs.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,378 +1,378 @@
|
|||
/*
|
||||
* (C) Copyright 2001
|
||||
* Denis Peter, MPL AG Switzerland
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*
|
||||
* Note: Part of this code has been derived from linux
|
||||
*
|
||||
*/
|
||||
#ifndef _USB_DEFS_H_
|
||||
#define _USB_DEFS_H_
|
||||
/* USB constants */
|
||||
|
||||
/* Device and/or Interface Class codes */
|
||||
#define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */
|
||||
#define USB_CLASS_AUDIO 1
|
||||
#define USB_CLASS_COMM 2
|
||||
#define USB_CLASS_HID 3
|
||||
#define USB_CLASS_PHYSICAL 5
|
||||
#define USB_CLASS_STILL_IMAGE 6
|
||||
|
||||
#define USB_CLASS_PRINTER 7
|
||||
#define USB_CLASS_MASS_STORAGE 8
|
||||
#define USB_CLASS_HUB 9
|
||||
#define USB_CLASS_CDC_DATA 0x0a
|
||||
|
||||
#define USB_CLASS_DATA 10
|
||||
#define USB_CLASS_CSCID 0x0b /* chip+ smart card */
|
||||
#define USB_CLASS_CONTENT_SEC 0x0d /* content security */
|
||||
#define USB_CLASS_VIDEO 0x0e
|
||||
#define USB_CLASS_WIRELESS_CONTROLLER 0xe0
|
||||
#define USB_CLASS_APP_SPEC 0xfe
|
||||
|
||||
#define USB_CLASS_VENDOR_SPEC 0xff
|
||||
|
||||
/* some HID sub classes */
|
||||
#define USB_SUB_HID_NONE 0
|
||||
#define USB_SUB_HID_BOOT 1
|
||||
|
||||
/* some UID Protocols */
|
||||
#define USB_PROT_HID_NONE 0
|
||||
#define USB_PROT_HID_KEYBOARD 1
|
||||
#define USB_PROT_HID_MOUSE 2
|
||||
|
||||
|
||||
/* Sub STORAGE Classes */
|
||||
#define US_SC_RBC 1 /* Typically, flash devices */
|
||||
#define US_SC_8020 2 /* CD-ROM */
|
||||
#define US_SC_QIC 3 /* QIC-157 Tapes */
|
||||
#define US_SC_UFI 4 /* Floppy */
|
||||
#define US_SC_8070 5 /* Removable media */
|
||||
#define US_SC_SCSI 6 /* Transparent */
|
||||
#define US_SC_MIN US_SC_RBC
|
||||
#define US_SC_MAX US_SC_SCSI
|
||||
|
||||
/* STORAGE Protocols */
|
||||
#define US_PR_CB 1 /* Control/Bulk w/o interrupt */
|
||||
#define US_PR_CBI 0 /* Control/Bulk/Interrupt */
|
||||
#define US_PR_BULK 0x50 /* bulk only */
|
||||
|
||||
/* USB types */
|
||||
#define USB_TYPE_STANDARD (0x00 << 5)
|
||||
#define USB_TYPE_CLASS (0x01 << 5)
|
||||
#define USB_TYPE_VENDOR (0x02 << 5)
|
||||
#define USB_TYPE_RESERVED (0x03 << 5)
|
||||
|
||||
/* USB recipients */
|
||||
#define USB_RECIP_DEVICE 0x00
|
||||
#define USB_RECIP_INTERFACE 0x01
|
||||
#define USB_RECIP_ENDPOINT 0x02
|
||||
#define USB_RECIP_OTHER 0x03
|
||||
|
||||
|
||||
#define USB_DT_CS_DEVICE 0x21
|
||||
#define USB_DT_CS_CONFIG 0x22
|
||||
#define USB_DT_CS_STRING 0x23
|
||||
#define USB_DT_CS_INTERFACE 0x24
|
||||
#define USB_DT_CS_ENDPOINT 0x25
|
||||
|
||||
|
||||
/* USB directions */
|
||||
#define USB_DIR_OUT 0 /* to device */
|
||||
#define USB_DIR_IN 0x80 /* to host */
|
||||
|
||||
#if 0
|
||||
enum usb_device_speed {
|
||||
USB_SPEED_UNKNOWN = 0, /* enumerating */
|
||||
USB_SPEED_LOW,
|
||||
USB_SPEED_FULL, /* usb 1.1 */
|
||||
USB_SPEED_HIGH, /* usb 2.0 */
|
||||
};
|
||||
#else
|
||||
enum usb_device_speed {
|
||||
USB_SPEED_UNKNOWN = 0, /* enumerating */
|
||||
USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */
|
||||
USB_SPEED_HIGH, /* usb 2.0 */
|
||||
USB_SPEED_VARIABLE, /* wireless (usb 2.5) */
|
||||
};
|
||||
|
||||
#endif
|
||||
/* Descriptor types */
|
||||
#define USB_DT_DEVICE 0x01
|
||||
#define USB_DT_CONFIG 0x02
|
||||
#define USB_DT_STRING 0x03
|
||||
#define USB_DT_INTERFACE 0x04
|
||||
#define USB_DT_ENDPOINT 0x05
|
||||
#define USB_DT_DEVICE_QUALIFIER 0x06
|
||||
#define USB_DT_OTHER_SPEED_CONFIG 0x07
|
||||
#define USB_DT_INTERFACE_POWER 0x08
|
||||
/* these are from a minor usb 2.0 revision (ECN) */
|
||||
#define USB_DT_OTG 0x09
|
||||
#define USB_DT_DEBUG 0x0a
|
||||
#define USB_DT_INTERFACE_ASSOCIATION 0x0b
|
||||
/* these are from the Wireless USB spec */
|
||||
#define USB_DT_SECURITY 0x0c
|
||||
#define USB_DT_KEY 0x0d
|
||||
#define USB_DT_ENCRYPTION_TYPE 0x0e
|
||||
#define USB_DT_BOS 0x0f
|
||||
#define USB_DT_DEVICE_CAPABILITY 0x10
|
||||
#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11
|
||||
#define USB_DT_WIRE_ADAPTER 0x21
|
||||
#define USB_DT_RPIPE 0x22
|
||||
|
||||
//#define USB_DT_INTERFACE_ASSOCIATION 0x0b
|
||||
|
||||
#define USB_DT_HID (USB_TYPE_CLASS | 0x01)
|
||||
#define USB_DT_REPORT (USB_TYPE_CLASS | 0x02)
|
||||
#define USB_DT_PHYSICAL (USB_TYPE_CLASS | 0x03)
|
||||
#define USB_DT_HUB (USB_TYPE_CLASS | 0x09)
|
||||
|
||||
/* Descriptor sizes per descriptor type */
|
||||
#define USB_DT_DEVICE_SIZE 18
|
||||
#define USB_DT_CONFIG_SIZE 9
|
||||
#define USB_DT_INTERFACE_SIZE 9
|
||||
#define USB_DT_ENDPOINT_SIZE 7
|
||||
#define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */
|
||||
#define USB_DT_HUB_NONVAR_SIZE 7
|
||||
#define USB_DT_HID_SIZE 9
|
||||
|
||||
/* Endpoints */
|
||||
#define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */
|
||||
#define USB_ENDPOINT_DIR_MASK 0x80
|
||||
|
||||
#define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */
|
||||
#define USB_ENDPOINT_XFER_CONTROL 0
|
||||
#define USB_ENDPOINT_XFER_ISOC 1
|
||||
#define USB_ENDPOINT_XFER_BULK 2
|
||||
#define USB_ENDPOINT_XFER_INT 3
|
||||
|
||||
#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */
|
||||
|
||||
/* USB Packet IDs (PIDs) */
|
||||
#define USB_PID_UNDEF_0 0xf0
|
||||
#define USB_PID_OUT 0xe1
|
||||
#define USB_PID_ACK 0xd2
|
||||
#define USB_PID_DATA0 0xc3
|
||||
#define USB_PID_UNDEF_4 0xb4
|
||||
#define USB_PID_SOF 0xa5
|
||||
#define USB_PID_UNDEF_6 0x96
|
||||
#define USB_PID_UNDEF_7 0x87
|
||||
#define USB_PID_UNDEF_8 0x78
|
||||
#define USB_PID_IN 0x69
|
||||
#define USB_PID_NAK 0x5a
|
||||
#define USB_PID_DATA1 0x4b
|
||||
#define USB_PID_PREAMBLE 0x3c
|
||||
#define USB_PID_SETUP 0x2d
|
||||
#define USB_PID_STALL 0x1e
|
||||
#define USB_PID_UNDEF_F 0x0f
|
||||
|
||||
/* Standard requests */
|
||||
#define USB_REQ_GET_STATUS 0x00
|
||||
#define USB_REQ_CLEAR_FEATURE 0x01
|
||||
#define USB_REQ_SET_FEATURE 0x03
|
||||
#define USB_REQ_SET_ADDRESS 0x05
|
||||
#define USB_REQ_GET_DESCRIPTOR 0x06
|
||||
#define USB_REQ_SET_DESCRIPTOR 0x07
|
||||
#define USB_REQ_GET_CONFIGURATION 0x08
|
||||
#define USB_REQ_SET_CONFIGURATION 0x09
|
||||
#define USB_REQ_GET_INTERFACE 0x0A
|
||||
#define USB_REQ_SET_INTERFACE 0x0B
|
||||
#define USB_REQ_SYNCH_FRAME 0x0C
|
||||
|
||||
/* HID requests */
|
||||
#define USB_REQ_GET_REPORT 0x01
|
||||
#define USB_REQ_GET_IDLE 0x02
|
||||
#define USB_REQ_GET_PROTOCOL 0x03
|
||||
#define USB_REQ_SET_REPORT 0x09
|
||||
#define USB_REQ_SET_IDLE 0x0A
|
||||
#define USB_REQ_SET_PROTOCOL 0x0B
|
||||
|
||||
|
||||
/* "pipe" definitions */
|
||||
|
||||
#define PIPE_ISOCHRONOUS 0
|
||||
#define PIPE_INTERRUPT 1
|
||||
#define PIPE_CONTROL 2
|
||||
#define PIPE_BULK 3
|
||||
#define PIPE_DEVEP_MASK 0x0007ff00
|
||||
|
||||
#define USB_ISOCHRONOUS 0
|
||||
#define USB_INTERRUPT 1
|
||||
#define USB_CONTROL 2
|
||||
#define USB_BULK 3
|
||||
|
||||
/* USB-status codes: */
|
||||
#define USB_ST_ACTIVE 0x1 /* TD is active */
|
||||
#define USB_ST_STALLED 0x2 /* TD is stalled */
|
||||
#define USB_ST_BUF_ERR 0x4 /* buffer error */
|
||||
#define USB_ST_BABBLE_DET 0x8 /* Babble detected */
|
||||
#define USB_ST_NAK_REC 0x10 /* NAK Received*/
|
||||
#define USB_ST_CRC_ERR 0x20 /* CRC/timeout Error */
|
||||
#define USB_ST_BIT_ERR 0x40 /* Bitstuff error */
|
||||
#define USB_ST_NOT_PROC 0x80000000L /* Not yet processed */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Hub defines
|
||||
*/
|
||||
|
||||
/*
|
||||
* Hub request types
|
||||
*/
|
||||
|
||||
#define USB_RT_HUB (USB_TYPE_CLASS | USB_RECIP_DEVICE)
|
||||
#define USB_RT_PORT (USB_TYPE_CLASS | USB_RECIP_OTHER)
|
||||
|
||||
/*
|
||||
* Hub Class feature numbers
|
||||
*/
|
||||
#define C_HUB_LOCAL_POWER 0
|
||||
#define C_HUB_OVER_CURRENT 1
|
||||
|
||||
/*
|
||||
* Port feature numbers
|
||||
*/
|
||||
#define USB_PORT_FEAT_CONNECTION 0
|
||||
#define USB_PORT_FEAT_ENABLE 1
|
||||
#define USB_PORT_FEAT_SUSPEND 2
|
||||
#define USB_PORT_FEAT_OVER_CURRENT 3
|
||||
#define USB_PORT_FEAT_RESET 4
|
||||
#define USB_PORT_FEAT_POWER 8
|
||||
#define USB_PORT_FEAT_LOWSPEED 9
|
||||
#define USB_PORT_FEAT_HIGHSPEED 10
|
||||
#define USB_PORT_FEAT_C_CONNECTION 16
|
||||
#define USB_PORT_FEAT_C_ENABLE 17
|
||||
#define USB_PORT_FEAT_C_SUSPEND 18
|
||||
#define USB_PORT_FEAT_C_OVER_CURRENT 19
|
||||
#define USB_PORT_FEAT_C_RESET 20
|
||||
|
||||
/* wPortStatus bits */
|
||||
#define USB_PORT_STAT_CONNECTION 0x0001
|
||||
#define USB_PORT_STAT_ENABLE 0x0002
|
||||
#define USB_PORT_STAT_SUSPEND 0x0004
|
||||
#define USB_PORT_STAT_OVERCURRENT 0x0008
|
||||
#define USB_PORT_STAT_RESET 0x0010
|
||||
#define USB_PORT_STAT_POWER 0x0100
|
||||
#define USB_PORT_STAT_LOW_SPEED 0x0200
|
||||
#define USB_PORT_STAT_HIGH_SPEED 0x0400 /* support for EHCI */
|
||||
#define USB_PORT_STAT_SPEED \
|
||||
(USB_PORT_STAT_LOW_SPEED | USB_PORT_STAT_HIGH_SPEED)
|
||||
|
||||
/* wPortChange bits */
|
||||
#define USB_PORT_STAT_C_CONNECTION 0x0001
|
||||
#define USB_PORT_STAT_C_ENABLE 0x0002
|
||||
#define USB_PORT_STAT_C_SUSPEND 0x0004
|
||||
#define USB_PORT_STAT_C_OVERCURRENT 0x0008
|
||||
#define USB_PORT_STAT_C_RESET 0x0010
|
||||
|
||||
/* wHubCharacteristics (masks) */
|
||||
#define HUB_CHAR_LPSM 0x0003
|
||||
#define HUB_CHAR_COMPOUND 0x0004
|
||||
#define HUB_CHAR_OCPM 0x0018
|
||||
|
||||
/*
|
||||
*Hub Status & Hub Change bit masks
|
||||
*/
|
||||
#define HUB_STATUS_LOCAL_POWER 0x0001
|
||||
#define HUB_STATUS_OVERCURRENT 0x0002
|
||||
|
||||
#define HUB_CHANGE_LOCAL_POWER 0x0001
|
||||
#define HUB_CHANGE_OVERCURRENT 0x0002
|
||||
|
||||
/* Struct USB_HCD defination */
|
||||
// for flags
|
||||
#define HCD_FLAG_HW_ACCESSIBLE 0 /* at full power */
|
||||
#define HCD_FLAG_POLL_RH 2 /* poll for rh status? */
|
||||
#define HCD_FLAG_POLL_PENDING 3 /* status has changed? */
|
||||
#define HCD_FLAG_WAKEUP_PENDING 4 /* root hub is resuming? */
|
||||
#define HCD_FLAG_RH_RUNNING 5 /* root hub is running? */
|
||||
#define HCD_FLAG_DEAD 6 /* controller has died? */
|
||||
|
||||
/* The flags can be tested using these macros; they are likely to
|
||||
* be slightly faster than test_bit().
|
||||
*/
|
||||
#define HCD_HW_ACCESSIBLE(hcd) ((hcd)->flags & (1U << HCD_FLAG_HW_ACCESSIBLE))
|
||||
#define HCD_POLL_RH(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_RH))
|
||||
#define HCD_POLL_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_PENDING))
|
||||
#define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING))
|
||||
#define HCD_RH_RUNNING(hcd) ((hcd)->flags & (1U << HCD_FLAG_RH_RUNNING))
|
||||
#define HCD_DEAD(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEAD))
|
||||
|
||||
// for state
|
||||
#define __ACTIVE 0x01
|
||||
#define __SUSPEND 0x04
|
||||
#define __TRANSIENT 0x80
|
||||
|
||||
#define HC_STATE_HALT 0
|
||||
#define HC_STATE_RUNNING (__ACTIVE)
|
||||
#define HC_STATE_QUIESCING (__SUSPEND|__TRANSIENT|__ACTIVE)
|
||||
#define HC_STATE_RESUMING (__SUSPEND|__TRANSIENT)
|
||||
#define HC_STATE_SUSPENDED (__SUSPEND)
|
||||
|
||||
#define HC_IS_RUNNING(state) ((state) & __ACTIVE)
|
||||
#define HC_IS_SUSPENDED(state) ((state) & __SUSPEND)
|
||||
|
||||
/*
|
||||
* USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and
|
||||
* are read as a bit array returned by USB_REQ_GET_STATUS. (So there
|
||||
* are at most sixteen features of each type.) Hubs may also support a
|
||||
* new USB_REQ_TEST_AND_SET_FEATURE to put ports into L1 suspend.
|
||||
*/
|
||||
#define USB_DEVICE_SELF_POWERED 0 /* (read only) */
|
||||
#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */
|
||||
#define USB_DEVICE_TEST_MODE 2 /* (wired high speed only) */
|
||||
#define USB_DEVICE_BATTERY 2 /* (wireless) */
|
||||
#define USB_DEVICE_B_HNP_ENABLE 3 /* (otg) dev may initiate HNP */
|
||||
#define USB_DEVICE_WUSB_DEVICE 3 /* (wireless)*/
|
||||
#define USB_DEVICE_A_HNP_SUPPORT 4 /* (otg) RH port supports HNP */
|
||||
#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */
|
||||
#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */
|
||||
|
||||
/* (shifted) direction/type/recipient from the USB 2.0 spec, table 9.2 */
|
||||
#define DeviceRequest \
|
||||
((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8)
|
||||
#define DeviceOutRequest \
|
||||
((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8)
|
||||
|
||||
#define InterfaceRequest \
|
||||
((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
|
||||
|
||||
#define EndpointRequest \
|
||||
((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
|
||||
#define EndpointOutRequest \
|
||||
((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
|
||||
|
||||
/* class requests from the USB 2.0 hub spec, table 11-15 */
|
||||
/* GetBusState and SetHubDescriptor are optional, omitted */
|
||||
#define ClearHubFeature (0x2000 | USB_REQ_CLEAR_FEATURE)
|
||||
#define ClearPortFeature (0x2300 | USB_REQ_CLEAR_FEATURE)
|
||||
#define GetHubDescriptor (0xa000 | USB_REQ_GET_DESCRIPTOR)
|
||||
#define GetHubStatus (0xa000 | USB_REQ_GET_STATUS)
|
||||
#define GetPortStatus (0xa300 | USB_REQ_GET_STATUS)
|
||||
#define SetHubFeature (0x2000 | USB_REQ_SET_FEATURE)
|
||||
#define SetPortFeature (0x2300 | USB_REQ_SET_FEATURE)
|
||||
|
||||
/* from config descriptor bmAttributes */
|
||||
#define USB_CONFIG_ATT_ONE (1 << 7) /* must be set */
|
||||
#define USB_CONFIG_ATT_SELFPOWER (1 << 6) /* self powered */
|
||||
#define USB_CONFIG_ATT_WAKEUP (1 << 5) /* can wakeup */
|
||||
#define USB_CONFIG_ATT_BATTERY (1 << 4) /* battery powered */
|
||||
|
||||
#endif /*_USB_DEFS_H_ */
|
||||
/*
|
||||
* (C) Copyright 2001
|
||||
* Denis Peter, MPL AG Switzerland
|
||||
*
|
||||
* See file CREDITS for list of people who contributed to this
|
||||
* project.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
||||
* MA 02111-1307 USA
|
||||
*
|
||||
* Note: Part of this code has been derived from linux
|
||||
*
|
||||
*/
|
||||
#ifndef _USB_DEFS_H_
|
||||
#define _USB_DEFS_H_
|
||||
/* USB constants */
|
||||
|
||||
/* Device and/or Interface Class codes */
|
||||
#define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */
|
||||
#define USB_CLASS_AUDIO 1
|
||||
#define USB_CLASS_COMM 2
|
||||
#define USB_CLASS_HID 3
|
||||
#define USB_CLASS_PHYSICAL 5
|
||||
#define USB_CLASS_STILL_IMAGE 6
|
||||
|
||||
#define USB_CLASS_PRINTER 7
|
||||
#define USB_CLASS_MASS_STORAGE 8
|
||||
#define USB_CLASS_HUB 9
|
||||
#define USB_CLASS_CDC_DATA 0x0a
|
||||
|
||||
#define USB_CLASS_DATA 10
|
||||
#define USB_CLASS_CSCID 0x0b /* chip+ smart card */
|
||||
#define USB_CLASS_CONTENT_SEC 0x0d /* content security */
|
||||
#define USB_CLASS_VIDEO 0x0e
|
||||
#define USB_CLASS_WIRELESS_CONTROLLER 0xe0
|
||||
#define USB_CLASS_APP_SPEC 0xfe
|
||||
|
||||
#define USB_CLASS_VENDOR_SPEC 0xff
|
||||
|
||||
/* some HID sub classes */
|
||||
#define USB_SUB_HID_NONE 0
|
||||
#define USB_SUB_HID_BOOT 1
|
||||
|
||||
/* some UID Protocols */
|
||||
#define USB_PROT_HID_NONE 0
|
||||
#define USB_PROT_HID_KEYBOARD 1
|
||||
#define USB_PROT_HID_MOUSE 2
|
||||
|
||||
|
||||
/* Sub STORAGE Classes */
|
||||
#define US_SC_RBC 1 /* Typically, flash devices */
|
||||
#define US_SC_8020 2 /* CD-ROM */
|
||||
#define US_SC_QIC 3 /* QIC-157 Tapes */
|
||||
#define US_SC_UFI 4 /* Floppy */
|
||||
#define US_SC_8070 5 /* Removable media */
|
||||
#define US_SC_SCSI 6 /* Transparent */
|
||||
#define US_SC_MIN US_SC_RBC
|
||||
#define US_SC_MAX US_SC_SCSI
|
||||
|
||||
/* STORAGE Protocols */
|
||||
#define US_PR_CB 1 /* Control/Bulk w/o interrupt */
|
||||
#define US_PR_CBI 0 /* Control/Bulk/Interrupt */
|
||||
#define US_PR_BULK 0x50 /* bulk only */
|
||||
|
||||
/* USB types */
|
||||
#define USB_TYPE_STANDARD (0x00 << 5)
|
||||
#define USB_TYPE_CLASS (0x01 << 5)
|
||||
#define USB_TYPE_VENDOR (0x02 << 5)
|
||||
#define USB_TYPE_RESERVED (0x03 << 5)
|
||||
|
||||
/* USB recipients */
|
||||
#define USB_RECIP_DEVICE 0x00
|
||||
#define USB_RECIP_INTERFACE 0x01
|
||||
#define USB_RECIP_ENDPOINT 0x02
|
||||
#define USB_RECIP_OTHER 0x03
|
||||
|
||||
|
||||
#define USB_DT_CS_DEVICE 0x21
|
||||
#define USB_DT_CS_CONFIG 0x22
|
||||
#define USB_DT_CS_STRING 0x23
|
||||
#define USB_DT_CS_INTERFACE 0x24
|
||||
#define USB_DT_CS_ENDPOINT 0x25
|
||||
|
||||
|
||||
/* USB directions */
|
||||
#define USB_DIR_OUT 0 /* to device */
|
||||
#define USB_DIR_IN 0x80 /* to host */
|
||||
|
||||
#if 0
|
||||
enum usb_device_speed {
|
||||
USB_SPEED_UNKNOWN = 0, /* enumerating */
|
||||
USB_SPEED_LOW,
|
||||
USB_SPEED_FULL, /* usb 1.1 */
|
||||
USB_SPEED_HIGH, /* usb 2.0 */
|
||||
};
|
||||
#else
|
||||
enum usb_device_speed {
|
||||
USB_SPEED_UNKNOWN = 0, /* enumerating */
|
||||
USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */
|
||||
USB_SPEED_HIGH, /* usb 2.0 */
|
||||
USB_SPEED_VARIABLE, /* wireless (usb 2.5) */
|
||||
};
|
||||
|
||||
#endif
|
||||
/* Descriptor types */
|
||||
#define USB_DT_DEVICE 0x01
|
||||
#define USB_DT_CONFIG 0x02
|
||||
#define USB_DT_STRING 0x03
|
||||
#define USB_DT_INTERFACE 0x04
|
||||
#define USB_DT_ENDPOINT 0x05
|
||||
#define USB_DT_DEVICE_QUALIFIER 0x06
|
||||
#define USB_DT_OTHER_SPEED_CONFIG 0x07
|
||||
#define USB_DT_INTERFACE_POWER 0x08
|
||||
/* these are from a minor usb 2.0 revision (ECN) */
|
||||
#define USB_DT_OTG 0x09
|
||||
#define USB_DT_DEBUG 0x0a
|
||||
#define USB_DT_INTERFACE_ASSOCIATION 0x0b
|
||||
/* these are from the Wireless USB spec */
|
||||
#define USB_DT_SECURITY 0x0c
|
||||
#define USB_DT_KEY 0x0d
|
||||
#define USB_DT_ENCRYPTION_TYPE 0x0e
|
||||
#define USB_DT_BOS 0x0f
|
||||
#define USB_DT_DEVICE_CAPABILITY 0x10
|
||||
#define USB_DT_WIRELESS_ENDPOINT_COMP 0x11
|
||||
#define USB_DT_WIRE_ADAPTER 0x21
|
||||
#define USB_DT_RPIPE 0x22
|
||||
|
||||
//#define USB_DT_INTERFACE_ASSOCIATION 0x0b
|
||||
|
||||
#define USB_DT_HID (USB_TYPE_CLASS | 0x01)
|
||||
#define USB_DT_REPORT (USB_TYPE_CLASS | 0x02)
|
||||
#define USB_DT_PHYSICAL (USB_TYPE_CLASS | 0x03)
|
||||
#define USB_DT_HUB (USB_TYPE_CLASS | 0x09)
|
||||
|
||||
/* Descriptor sizes per descriptor type */
|
||||
#define USB_DT_DEVICE_SIZE 18
|
||||
#define USB_DT_CONFIG_SIZE 9
|
||||
#define USB_DT_INTERFACE_SIZE 9
|
||||
#define USB_DT_ENDPOINT_SIZE 7
|
||||
#define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */
|
||||
#define USB_DT_HUB_NONVAR_SIZE 7
|
||||
#define USB_DT_HID_SIZE 9
|
||||
|
||||
/* Endpoints */
|
||||
#define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */
|
||||
#define USB_ENDPOINT_DIR_MASK 0x80
|
||||
|
||||
#define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */
|
||||
#define USB_ENDPOINT_XFER_CONTROL 0
|
||||
#define USB_ENDPOINT_XFER_ISOC 1
|
||||
#define USB_ENDPOINT_XFER_BULK 2
|
||||
#define USB_ENDPOINT_XFER_INT 3
|
||||
|
||||
#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */
|
||||
|
||||
/* USB Packet IDs (PIDs) */
|
||||
#define USB_PID_UNDEF_0 0xf0
|
||||
#define USB_PID_OUT 0xe1
|
||||
#define USB_PID_ACK 0xd2
|
||||
#define USB_PID_DATA0 0xc3
|
||||
#define USB_PID_UNDEF_4 0xb4
|
||||
#define USB_PID_SOF 0xa5
|
||||
#define USB_PID_UNDEF_6 0x96
|
||||
#define USB_PID_UNDEF_7 0x87
|
||||
#define USB_PID_UNDEF_8 0x78
|
||||
#define USB_PID_IN 0x69
|
||||
#define USB_PID_NAK 0x5a
|
||||
#define USB_PID_DATA1 0x4b
|
||||
#define USB_PID_PREAMBLE 0x3c
|
||||
#define USB_PID_SETUP 0x2d
|
||||
#define USB_PID_STALL 0x1e
|
||||
#define USB_PID_UNDEF_F 0x0f
|
||||
|
||||
/* Standard requests */
|
||||
#define USB_REQ_GET_STATUS 0x00
|
||||
#define USB_REQ_CLEAR_FEATURE 0x01
|
||||
#define USB_REQ_SET_FEATURE 0x03
|
||||
#define USB_REQ_SET_ADDRESS 0x05
|
||||
#define USB_REQ_GET_DESCRIPTOR 0x06
|
||||
#define USB_REQ_SET_DESCRIPTOR 0x07
|
||||
#define USB_REQ_GET_CONFIGURATION 0x08
|
||||
#define USB_REQ_SET_CONFIGURATION 0x09
|
||||
#define USB_REQ_GET_INTERFACE 0x0A
|
||||
#define USB_REQ_SET_INTERFACE 0x0B
|
||||
#define USB_REQ_SYNCH_FRAME 0x0C
|
||||
|
||||
/* HID requests */
|
||||
#define USB_REQ_GET_REPORT 0x01
|
||||
#define USB_REQ_GET_IDLE 0x02
|
||||
#define USB_REQ_GET_PROTOCOL 0x03
|
||||
#define USB_REQ_SET_REPORT 0x09
|
||||
#define USB_REQ_SET_IDLE 0x0A
|
||||
#define USB_REQ_SET_PROTOCOL 0x0B
|
||||
|
||||
|
||||
/* "pipe" definitions */
|
||||
|
||||
#define PIPE_ISOCHRONOUS 0
|
||||
#define PIPE_INTERRUPT 1
|
||||
#define PIPE_CONTROL 2
|
||||
#define PIPE_BULK 3
|
||||
#define PIPE_DEVEP_MASK 0x0007ff00
|
||||
|
||||
#define USB_ISOCHRONOUS 0
|
||||
#define USB_INTERRUPT 1
|
||||
#define USB_CONTROL 2
|
||||
#define USB_BULK 3
|
||||
|
||||
/* USB-status codes: */
|
||||
#define USB_ST_ACTIVE 0x1 /* TD is active */
|
||||
#define USB_ST_STALLED 0x2 /* TD is stalled */
|
||||
#define USB_ST_BUF_ERR 0x4 /* buffer error */
|
||||
#define USB_ST_BABBLE_DET 0x8 /* Babble detected */
|
||||
#define USB_ST_NAK_REC 0x10 /* NAK Received*/
|
||||
#define USB_ST_CRC_ERR 0x20 /* CRC/timeout Error */
|
||||
#define USB_ST_BIT_ERR 0x40 /* Bitstuff error */
|
||||
#define USB_ST_NOT_PROC 0x80000000L /* Not yet processed */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Hub defines
|
||||
*/
|
||||
|
||||
/*
|
||||
* Hub request types
|
||||
*/
|
||||
|
||||
#define USB_RT_HUB (USB_TYPE_CLASS | USB_RECIP_DEVICE)
|
||||
#define USB_RT_PORT (USB_TYPE_CLASS | USB_RECIP_OTHER)
|
||||
|
||||
/*
|
||||
* Hub Class feature numbers
|
||||
*/
|
||||
#define C_HUB_LOCAL_POWER 0
|
||||
#define C_HUB_OVER_CURRENT 1
|
||||
|
||||
/*
|
||||
* Port feature numbers
|
||||
*/
|
||||
#define USB_PORT_FEAT_CONNECTION 0
|
||||
#define USB_PORT_FEAT_ENABLE 1
|
||||
#define USB_PORT_FEAT_SUSPEND 2
|
||||
#define USB_PORT_FEAT_OVER_CURRENT 3
|
||||
#define USB_PORT_FEAT_RESET 4
|
||||
#define USB_PORT_FEAT_POWER 8
|
||||
#define USB_PORT_FEAT_LOWSPEED 9
|
||||
#define USB_PORT_FEAT_HIGHSPEED 10
|
||||
#define USB_PORT_FEAT_C_CONNECTION 16
|
||||
#define USB_PORT_FEAT_C_ENABLE 17
|
||||
#define USB_PORT_FEAT_C_SUSPEND 18
|
||||
#define USB_PORT_FEAT_C_OVER_CURRENT 19
|
||||
#define USB_PORT_FEAT_C_RESET 20
|
||||
|
||||
/* wPortStatus bits */
|
||||
#define USB_PORT_STAT_CONNECTION 0x0001
|
||||
#define USB_PORT_STAT_ENABLE 0x0002
|
||||
#define USB_PORT_STAT_SUSPEND 0x0004
|
||||
#define USB_PORT_STAT_OVERCURRENT 0x0008
|
||||
#define USB_PORT_STAT_RESET 0x0010
|
||||
#define USB_PORT_STAT_POWER 0x0100
|
||||
#define USB_PORT_STAT_LOW_SPEED 0x0200
|
||||
#define USB_PORT_STAT_HIGH_SPEED 0x0400 /* support for EHCI */
|
||||
#define USB_PORT_STAT_SPEED \
|
||||
(USB_PORT_STAT_LOW_SPEED | USB_PORT_STAT_HIGH_SPEED)
|
||||
|
||||
/* wPortChange bits */
|
||||
#define USB_PORT_STAT_C_CONNECTION 0x0001
|
||||
#define USB_PORT_STAT_C_ENABLE 0x0002
|
||||
#define USB_PORT_STAT_C_SUSPEND 0x0004
|
||||
#define USB_PORT_STAT_C_OVERCURRENT 0x0008
|
||||
#define USB_PORT_STAT_C_RESET 0x0010
|
||||
|
||||
/* wHubCharacteristics (masks) */
|
||||
#define HUB_CHAR_LPSM 0x0003
|
||||
#define HUB_CHAR_COMPOUND 0x0004
|
||||
#define HUB_CHAR_OCPM 0x0018
|
||||
|
||||
/*
|
||||
*Hub Status & Hub Change bit masks
|
||||
*/
|
||||
#define HUB_STATUS_LOCAL_POWER 0x0001
|
||||
#define HUB_STATUS_OVERCURRENT 0x0002
|
||||
|
||||
#define HUB_CHANGE_LOCAL_POWER 0x0001
|
||||
#define HUB_CHANGE_OVERCURRENT 0x0002
|
||||
|
||||
/* Struct USB_HCD defination */
|
||||
// for flags
|
||||
#define HCD_FLAG_HW_ACCESSIBLE 0 /* at full power */
|
||||
#define HCD_FLAG_POLL_RH 2 /* poll for rh status? */
|
||||
#define HCD_FLAG_POLL_PENDING 3 /* status has changed? */
|
||||
#define HCD_FLAG_WAKEUP_PENDING 4 /* root hub is resuming? */
|
||||
#define HCD_FLAG_RH_RUNNING 5 /* root hub is running? */
|
||||
#define HCD_FLAG_DEAD 6 /* controller has died? */
|
||||
|
||||
/* The flags can be tested using these macros; they are likely to
|
||||
* be slightly faster than test_bit().
|
||||
*/
|
||||
#define HCD_HW_ACCESSIBLE(hcd) ((hcd)->flags & (1U << HCD_FLAG_HW_ACCESSIBLE))
|
||||
#define HCD_POLL_RH(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_RH))
|
||||
#define HCD_POLL_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_POLL_PENDING))
|
||||
#define HCD_WAKEUP_PENDING(hcd) ((hcd)->flags & (1U << HCD_FLAG_WAKEUP_PENDING))
|
||||
#define HCD_RH_RUNNING(hcd) ((hcd)->flags & (1U << HCD_FLAG_RH_RUNNING))
|
||||
#define HCD_DEAD(hcd) ((hcd)->flags & (1U << HCD_FLAG_DEAD))
|
||||
|
||||
// for state
|
||||
#define __ACTIVE 0x01
|
||||
#define __SUSPEND 0x04
|
||||
#define __TRANSIENT 0x80
|
||||
|
||||
#define HC_STATE_HALT 0
|
||||
#define HC_STATE_RUNNING (__ACTIVE)
|
||||
#define HC_STATE_QUIESCING (__SUSPEND|__TRANSIENT|__ACTIVE)
|
||||
#define HC_STATE_RESUMING (__SUSPEND|__TRANSIENT)
|
||||
#define HC_STATE_SUSPENDED (__SUSPEND)
|
||||
|
||||
#define HC_IS_RUNNING(state) ((state) & __ACTIVE)
|
||||
#define HC_IS_SUSPENDED(state) ((state) & __SUSPEND)
|
||||
|
||||
/*
|
||||
* USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and
|
||||
* are read as a bit array returned by USB_REQ_GET_STATUS. (So there
|
||||
* are at most sixteen features of each type.) Hubs may also support a
|
||||
* new USB_REQ_TEST_AND_SET_FEATURE to put ports into L1 suspend.
|
||||
*/
|
||||
#define USB_DEVICE_SELF_POWERED 0 /* (read only) */
|
||||
#define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */
|
||||
#define USB_DEVICE_TEST_MODE 2 /* (wired high speed only) */
|
||||
#define USB_DEVICE_BATTERY 2 /* (wireless) */
|
||||
#define USB_DEVICE_B_HNP_ENABLE 3 /* (otg) dev may initiate HNP */
|
||||
#define USB_DEVICE_WUSB_DEVICE 3 /* (wireless)*/
|
||||
#define USB_DEVICE_A_HNP_SUPPORT 4 /* (otg) RH port supports HNP */
|
||||
#define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */
|
||||
#define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */
|
||||
|
||||
/* (shifted) direction/type/recipient from the USB 2.0 spec, table 9.2 */
|
||||
#define DeviceRequest \
|
||||
((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8)
|
||||
#define DeviceOutRequest \
|
||||
((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8)
|
||||
|
||||
#define InterfaceRequest \
|
||||
((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
|
||||
|
||||
#define EndpointRequest \
|
||||
((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
|
||||
#define EndpointOutRequest \
|
||||
((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
|
||||
|
||||
/* class requests from the USB 2.0 hub spec, table 11-15 */
|
||||
/* GetBusState and SetHubDescriptor are optional, omitted */
|
||||
#define ClearHubFeature (0x2000 | USB_REQ_CLEAR_FEATURE)
|
||||
#define ClearPortFeature (0x2300 | USB_REQ_CLEAR_FEATURE)
|
||||
#define GetHubDescriptor (0xa000 | USB_REQ_GET_DESCRIPTOR)
|
||||
#define GetHubStatus (0xa000 | USB_REQ_GET_STATUS)
|
||||
#define GetPortStatus (0xa300 | USB_REQ_GET_STATUS)
|
||||
#define SetHubFeature (0x2000 | USB_REQ_SET_FEATURE)
|
||||
#define SetPortFeature (0x2300 | USB_REQ_SET_FEATURE)
|
||||
|
||||
/* from config descriptor bmAttributes */
|
||||
#define USB_CONFIG_ATT_ONE (1 << 7) /* must be set */
|
||||
#define USB_CONFIG_ATT_SELFPOWER (1 << 6) /* self powered */
|
||||
#define USB_CONFIG_ATT_WAKEUP (1 << 5) /* can wakeup */
|
||||
#define USB_CONFIG_ATT_BATTERY (1 << 4) /* battery powered */
|
||||
|
||||
#endif /*_USB_DEFS_H_ */
|
||||
|
|
|
|||
|
|
@ -1,74 +1,74 @@
|
|||
#ifndef __LINUX_USB_ULINKER_H
|
||||
#define __LINUX_USB_ULINKER_H
|
||||
|
||||
//#include "linux/autoconf.h"
|
||||
|
||||
//#ifndef CONFIG_RTL_ULINKER_CUSTOMIZATION
|
||||
#if 1//ModifiedByJD
|
||||
#define ULINKER_ETHER_VID 0x0BDA
|
||||
#define ULINKER_ETHER_PID 0x8195
|
||||
#define ULINKER_MANUFACTURER "Realtek Semicoonductor Corp."
|
||||
|
||||
#define ULINKER_WINTOOLS_GUID "1CACC490-055C-4035-A026-1DAB0BDA8196"
|
||||
#define ULINKER_WINTOOLS_DISPLAY_NAME "Realtek RTL8196EU Universal Linker"
|
||||
#define ULINKER_WINTOOLS_CONTACT "nicfae@realtek.com.tw"
|
||||
#define ULINKER_WINTOOLS_DISPLAY_VERSION "v1.0.0.0"
|
||||
#define ULINKER_WINTOOLS_HELP_LINK "http://www.realtek.com.tw"
|
||||
#define ULINKER_WINTOOLS_PUBLISHER ULINKER_MANUFACTURER
|
||||
#define ULINKER_WINTOOLS_TARGET_DIR ULINKER_WINTOOLS_DISPLAY_NAME
|
||||
#else
|
||||
#define ULINKER_ETHER_VID CONFIG_RTL_ULINKER_VID
|
||||
#define ULINKER_ETHER_PID CONFIG_RTL_ULINKER_PID
|
||||
#define ULINKER_STORAGE_VID CONFIG_RTL_ULINKER_VID_S
|
||||
#define ULINKER_STORAGE_PID CONFIG_RTL_ULINKER_PID_S
|
||||
#define ULINKER_MANUFACTURER CONFIG_RTL_ULINKER_MANUFACTURE
|
||||
|
||||
#define ULINKER_WINTOOLS_GUID CONFIG_RTL_ULINKER_WINTOOLS_GUID
|
||||
#define ULINKER_WINTOOLS_DISPLAY_NAME CONFIG_RTL_ULINKER_WINTOOLS_DISPLAY_NAME
|
||||
#define ULINKER_WINTOOLS_CONTACT CONFIG_RTL_ULINKER_WINTOOLS_CONTACT
|
||||
#define ULINKER_WINTOOLS_DISPLAY_VERSION CONFIG_RTL_ULINKER_WINTOOLS_DISPLAY_VERSION
|
||||
#define ULINKER_WINTOOLS_HELP_LINK CONFIG_RTL_ULINKER_WINTOOLS_HELP_LINK
|
||||
#define ULINKER_WINTOOLS_PUBLISHER ULINKER_MANUFACTURER
|
||||
#define ULINKER_WINTOOLS_TARGET_DIR ULINKER_WINTOOLS_DISPLAY_NAME
|
||||
#endif
|
||||
|
||||
//------------------------------------------------
|
||||
// if you don't have a specific PID for storage, don't change following define of storage mode.
|
||||
//
|
||||
// begin: don't change
|
||||
#ifndef ULINKER_STORAGE_VID
|
||||
#define ULINKER_STORAGE_VID 0x0BDA
|
||||
#define ULINKER_STORAGE_PID 0x8197
|
||||
#endif
|
||||
|
||||
#define ULINKER_STORAGE_VID_STR "USB Ether "
|
||||
#define ULINKER_STORAGE_PID_DISK_STR "Driver DISC"
|
||||
#define ULINKER_STORAGE_PID_CDROM_STR "Driver CDROM"
|
||||
|
||||
#define ULINKER_WINTOOLS_DRIVER_PATH "Driver"
|
||||
// end: don't change
|
||||
//------------------------------------------------
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
#if defined(CONFIG_RTL_ULINKER)
|
||||
|
||||
#define ULINKER_DEVINIT
|
||||
#define ULINKER_DEVINITDATA
|
||||
#define ULINKER_DEVINITCONST
|
||||
#define ULINKER_DEVEXIT
|
||||
#define ULINKER_DEVEXITDATA
|
||||
#define ULINKER_DEVEXITCONST
|
||||
|
||||
#else
|
||||
|
||||
#define ULINKER_DEVINIT __devinit
|
||||
#define ULINKER_DEVINITDATA __devinitdata
|
||||
#define ULINKER_DEVINITCONST __devinitconst
|
||||
#define ULINKER_DEVEXIT __devexit
|
||||
#define ULINKER_DEVEXITDATA __devexitdata
|
||||
#define ULINKER_DEVEXITCONST __devexitconst
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __LINUX_USB_ULINKER_H */
|
||||
#ifndef __LINUX_USB_ULINKER_H
|
||||
#define __LINUX_USB_ULINKER_H
|
||||
|
||||
//#include "linux/autoconf.h"
|
||||
|
||||
//#ifndef CONFIG_RTL_ULINKER_CUSTOMIZATION
|
||||
#if 1//ModifiedByJD
|
||||
#define ULINKER_ETHER_VID 0x0BDA
|
||||
#define ULINKER_ETHER_PID 0x8195
|
||||
#define ULINKER_MANUFACTURER "Realtek Semicoonductor Corp."
|
||||
|
||||
#define ULINKER_WINTOOLS_GUID "1CACC490-055C-4035-A026-1DAB0BDA8196"
|
||||
#define ULINKER_WINTOOLS_DISPLAY_NAME "Realtek RTL8196EU Universal Linker"
|
||||
#define ULINKER_WINTOOLS_CONTACT "nicfae@realtek.com.tw"
|
||||
#define ULINKER_WINTOOLS_DISPLAY_VERSION "v1.0.0.0"
|
||||
#define ULINKER_WINTOOLS_HELP_LINK "http://www.realtek.com.tw"
|
||||
#define ULINKER_WINTOOLS_PUBLISHER ULINKER_MANUFACTURER
|
||||
#define ULINKER_WINTOOLS_TARGET_DIR ULINKER_WINTOOLS_DISPLAY_NAME
|
||||
#else
|
||||
#define ULINKER_ETHER_VID CONFIG_RTL_ULINKER_VID
|
||||
#define ULINKER_ETHER_PID CONFIG_RTL_ULINKER_PID
|
||||
#define ULINKER_STORAGE_VID CONFIG_RTL_ULINKER_VID_S
|
||||
#define ULINKER_STORAGE_PID CONFIG_RTL_ULINKER_PID_S
|
||||
#define ULINKER_MANUFACTURER CONFIG_RTL_ULINKER_MANUFACTURE
|
||||
|
||||
#define ULINKER_WINTOOLS_GUID CONFIG_RTL_ULINKER_WINTOOLS_GUID
|
||||
#define ULINKER_WINTOOLS_DISPLAY_NAME CONFIG_RTL_ULINKER_WINTOOLS_DISPLAY_NAME
|
||||
#define ULINKER_WINTOOLS_CONTACT CONFIG_RTL_ULINKER_WINTOOLS_CONTACT
|
||||
#define ULINKER_WINTOOLS_DISPLAY_VERSION CONFIG_RTL_ULINKER_WINTOOLS_DISPLAY_VERSION
|
||||
#define ULINKER_WINTOOLS_HELP_LINK CONFIG_RTL_ULINKER_WINTOOLS_HELP_LINK
|
||||
#define ULINKER_WINTOOLS_PUBLISHER ULINKER_MANUFACTURER
|
||||
#define ULINKER_WINTOOLS_TARGET_DIR ULINKER_WINTOOLS_DISPLAY_NAME
|
||||
#endif
|
||||
|
||||
//------------------------------------------------
|
||||
// if you don't have a specific PID for storage, don't change following define of storage mode.
|
||||
//
|
||||
// begin: don't change
|
||||
#ifndef ULINKER_STORAGE_VID
|
||||
#define ULINKER_STORAGE_VID 0x0BDA
|
||||
#define ULINKER_STORAGE_PID 0x8197
|
||||
#endif
|
||||
|
||||
#define ULINKER_STORAGE_VID_STR "USB Ether "
|
||||
#define ULINKER_STORAGE_PID_DISK_STR "Driver DISC"
|
||||
#define ULINKER_STORAGE_PID_CDROM_STR "Driver CDROM"
|
||||
|
||||
#define ULINKER_WINTOOLS_DRIVER_PATH "Driver"
|
||||
// end: don't change
|
||||
//------------------------------------------------
|
||||
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
#if defined(CONFIG_RTL_ULINKER)
|
||||
|
||||
#define ULINKER_DEVINIT
|
||||
#define ULINKER_DEVINITDATA
|
||||
#define ULINKER_DEVINITCONST
|
||||
#define ULINKER_DEVEXIT
|
||||
#define ULINKER_DEVEXITDATA
|
||||
#define ULINKER_DEVEXITCONST
|
||||
|
||||
#else
|
||||
|
||||
#define ULINKER_DEVINIT __devinit
|
||||
#define ULINKER_DEVINITDATA __devinitdata
|
||||
#define ULINKER_DEVINITCONST __devinitconst
|
||||
#define ULINKER_DEVEXIT __devexit
|
||||
#define ULINKER_DEVEXITDATA __devexitdata
|
||||
#define ULINKER_DEVEXITCONST __devexitconst
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __LINUX_USB_ULINKER_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue