version 1.26.10.5, 2009/01/17 13:29:09 |
version 1.27, 2008/02/22 23:07:12 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* documentation and/or other materials provided with the distribution. |
|
* 3. All advertising materials mentioning features or use of this software |
|
* must display the following acknowledgement: |
|
* This product includes software developed by the NetBSD |
|
* Foundation, Inc. and its contributors. |
|
* 4. Neither the name of The NetBSD Foundation nor the names of its |
|
* contributors may be used to endorse or promote products derived |
|
* from this software without specific prior written permission. |
* |
* |
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
Line 33 typedef struct ehci_soft_qtd { |
|
Line 40 typedef struct ehci_soft_qtd { |
|
ehci_qtd_t qtd; |
ehci_qtd_t qtd; |
struct ehci_soft_qtd *nextqtd; /* mirrors nextqtd in TD */ |
struct ehci_soft_qtd *nextqtd; /* mirrors nextqtd in TD */ |
ehci_physaddr_t physaddr; |
ehci_physaddr_t physaddr; |
usb_dma_t dma; /* qTD's DMA infos */ |
|
int offs; /* qTD's offset in usb_dma_t */ |
|
usbd_xfer_handle xfer; |
usbd_xfer_handle xfer; |
LIST_ENTRY(ehci_soft_qtd) hnext; |
LIST_ENTRY(ehci_soft_qtd) hnext; |
u_int16_t len; |
u_int16_t len; |
Line 47 typedef struct ehci_soft_qh { |
|
Line 52 typedef struct ehci_soft_qh { |
|
struct ehci_soft_qh *next; |
struct ehci_soft_qh *next; |
struct ehci_soft_qtd *sqtd; |
struct ehci_soft_qtd *sqtd; |
ehci_physaddr_t physaddr; |
ehci_physaddr_t physaddr; |
usb_dma_t dma; /* QH's DMA infos */ |
|
int offs; /* QH's offset in usb_dma_t */ |
|
int islot; |
int islot; |
} ehci_soft_qh_t; |
} ehci_soft_qh_t; |
#define EHCI_SQH_SIZE ((sizeof (struct ehci_soft_qh) + EHCI_QH_ALIGN - 1) / EHCI_QH_ALIGN * EHCI_QH_ALIGN) |
#define EHCI_SQH_SIZE ((sizeof (struct ehci_soft_qh) + EHCI_QH_ALIGN - 1) / EHCI_QH_ALIGN * EHCI_QH_ALIGN) |
#define EHCI_SQH_CHUNK (EHCI_PAGE_SIZE / EHCI_SQH_SIZE) |
#define EHCI_SQH_CHUNK (EHCI_PAGE_SIZE / EHCI_SQH_SIZE) |
|
|
typedef struct ehci_soft_itd { |
|
ehci_itd_t itd; |
|
union { |
|
struct { |
|
/* soft_itds links in a periodic frame*/ |
|
struct ehci_soft_itd *next; |
|
struct ehci_soft_itd *prev; |
|
} frame_list; |
|
/* circular list of free itds */ |
|
LIST_ENTRY(ehci_soft_itd) free_list; |
|
} u; |
|
struct ehci_soft_itd *xfer_next; /* Next soft_itd in xfer */ |
|
ehci_physaddr_t physaddr; |
|
usb_dma_t dma; |
|
int offs; |
|
int slot; |
|
struct timeval t; /* store free time */ |
|
} ehci_soft_itd_t; |
|
#define EHCI_ITD_SIZE ((sizeof(struct ehci_soft_itd) + EHCI_QH_ALIGN - 1) / EHCI_ITD_ALIGN * EHCI_ITD_ALIGN) |
|
#define EHCI_ITD_CHUNK (EHCI_PAGE_SIZE / EHCI_ITD_SIZE) |
|
|
|
struct ehci_xfer { |
struct ehci_xfer { |
struct usbd_xfer xfer; |
struct usbd_xfer xfer; |
struct usb_task abort_task; |
struct usb_task abort_task; |
TAILQ_ENTRY(ehci_xfer) inext; /* list of active xfers */ |
LIST_ENTRY(ehci_xfer) inext; /* list of active xfers */ |
ehci_soft_qtd_t *sqtdstart; |
ehci_soft_qtd_t *sqtdstart; |
ehci_soft_qtd_t *sqtdend; |
ehci_soft_qtd_t *sqtdend; |
ehci_soft_itd_t *itdstart; |
|
ehci_soft_itd_t *itdend; |
|
u_int isoc_len; |
|
int isdone; /* used only when DIAGNOSTIC is defined */ |
int isdone; /* used only when DIAGNOSTIC is defined */ |
}; |
}; |
#define EXFER(xfer) ((struct ehci_xfer *)(xfer)) |
#define EXFER(xfer) ((struct ehci_xfer *)(xfer)) |
Line 105 struct ehci_soft_islot { |
|
Line 84 struct ehci_soft_islot { |
|
#define EHCI_HASH_SIZE 128 |
#define EHCI_HASH_SIZE 128 |
#define EHCI_COMPANION_MAX 8 |
#define EHCI_COMPANION_MAX 8 |
|
|
#define EHCI_FREE_LIST_INTERVAL 100 |
|
|
|
typedef struct ehci_softc { |
typedef struct ehci_softc { |
device_t sc_dev; |
struct usbd_bus sc_bus; /* base device */ |
struct usbd_bus sc_bus; |
|
bus_space_tag_t iot; |
bus_space_tag_t iot; |
bus_space_handle_t ioh; |
bus_space_handle_t ioh; |
bus_size_t sc_size; |
bus_size_t sc_size; |
Line 121 typedef struct ehci_softc { |
|
Line 97 typedef struct ehci_softc { |
|
int sc_id_vendor; /* vendor ID for root hub */ |
int sc_id_vendor; /* vendor ID for root hub */ |
|
|
u_int32_t sc_cmd; /* shadow of cmd reg during suspend */ |
u_int32_t sc_cmd; /* shadow of cmd reg during suspend */ |
|
void *sc_shutdownhook; /* cookie from shutdown hook */ |
|
|
u_int sc_ncomp; |
u_int sc_ncomp; |
u_int sc_npcomp; |
u_int sc_npcomp; |
device_t sc_comps[EHCI_COMPANION_MAX]; |
struct usbd_bus *sc_comps[EHCI_COMPANION_MAX]; |
|
|
usb_dma_t sc_fldma; |
usb_dma_t sc_fldma; |
ehci_link_t *sc_flist; |
ehci_link_t *sc_flist; |
Line 133 typedef struct ehci_softc { |
|
Line 110 typedef struct ehci_softc { |
|
|
|
struct ehci_soft_islot sc_islots[EHCI_INTRQHS]; |
struct ehci_soft_islot sc_islots[EHCI_INTRQHS]; |
|
|
/* jcmm - an array matching sc_flist, but with software pointers, |
LIST_HEAD(, ehci_xfer) sc_intrhead; |
* not hardware address pointers |
|
*/ |
|
struct ehci_soft_itd **sc_softitds; |
|
|
|
TAILQ_HEAD(, ehci_xfer) sc_intrhead; |
|
kmutex_t sc_intrhead_lock; |
|
|
|
ehci_soft_qh_t *sc_freeqhs; |
ehci_soft_qh_t *sc_freeqhs; |
ehci_soft_qtd_t *sc_freeqtds; |
ehci_soft_qtd_t *sc_freeqtds; |
LIST_HEAD(sc_freeitds, ehci_soft_itd) sc_freeitds; |
|
|
|
int sc_noport; |
int sc_noport; |
u_int8_t sc_hasppc; /* has Port Power Control */ |
u_int8_t sc_hasppc; /* has Port Power Control */ |
Line 193 int ehci_activate(device_t, enum devact |
|
Line 163 int ehci_activate(device_t, enum devact |
|
void ehci_childdet(device_t, device_t); |
void ehci_childdet(device_t, device_t); |
bool ehci_suspend(device_t PMF_FN_PROTO); |
bool ehci_suspend(device_t PMF_FN_PROTO); |
bool ehci_resume(device_t PMF_FN_PROTO); |
bool ehci_resume(device_t PMF_FN_PROTO); |
bool ehci_shutdown(device_t, int); |
|