2
* Dummy Zaptel Driver for Zapata Telephony interface
4
* Written by Robert Pleh <robert.pleh@hermes.si>
6
* Copyright (C) 2002, Hermes Softlab
10
* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU General Public License for more details.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27
#include <linux/version.h>
28
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,19)
46
/* Uhci definitions and structures - from file usb-uhci.h */
47
#define TD_CTRL_IOC (1 << 24) /* Interrupt on Complete */
59
} uhci_td_t, *puhci_td_t;
64
__u32 element; /* Queue element pointer */
65
} uhci_qh_t, *puhci_qh_t;
72
uhci_desc_type_t type;
74
struct list_head horizontal;
75
struct list_head vertical;
76
struct list_head desc_list;
78
} uhci_desc_t, *puhci_desc_t;
81
struct list_head desc_list; // list pointer to all corresponding TDs/QHs associated with this request
82
dma_addr_t setup_packet_dma;
83
dma_addr_t transfer_buffer_dma;
84
unsigned long started;
86
struct urb *next_queued_urb; // next queued urb for this EP
87
struct urb *prev_queued_urb;
89
urb_t *next_queued_urb;
90
urb_t *prev_queued_urb;
92
uhci_desc_t *bottom_qh;
93
uhci_desc_t *next_qh; // next helper QH
96
} urb_priv_t, *purb_priv_t;
98
struct virt_root_hub {
99
int devnum; /* Address of Root Hub endpoint */
106
struct timer_list rh_int_timer;
109
typedef struct uhci {
111
unsigned int io_addr;
112
unsigned int io_size;
113
unsigned int maxports;
118
struct uhci *next; // chain of uhci device contexts
120
struct list_head urb_list; // list of all pending urbs
122
spinlock_t urb_list_lock; // lock to keep consistency
127
struct usb_bus *bus; // our bus
130
dma_addr_t framelist_dma;
131
uhci_desc_t **iso_td;
132
uhci_desc_t *int_chain[8];
133
uhci_desc_t *ls_control_chain;
134
uhci_desc_t *control_chain;
135
uhci_desc_t *bulk_chain;
136
uhci_desc_t *chain_end;
139
struct list_head free_desc;
142
struct virt_root_hub rh; //private data of the virtual root hub
143
int loop_usage; // URBs using bandwidth reclamation
145
struct list_head urb_unlinked; // list of all unlinked urbs
148
struct pci_dev *uhci_pci;
149
struct pci_pool *desc_pool;
150
long last_error_time; // last error output in uhci_interrupt()