~ubuntu-branches/ubuntu/quantal/zaptel/quantal

« back to all changes in this revision

Viewing changes to kernel/ztdummy.h

  • Committer: Bazaar Package Importer
  • Author(s): Tzafrir Cohen
  • Date: 2008-08-28 22:58:23 UTC
  • mfrom: (11.1.11 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080828225823-r8bdunirm8hmc76m
Tags: 1:1.4.11~dfsg-2
* Patch xpp_fxs_power: Fixed an issue with hook detection of the Astribank
  FXS module.
* Don't fail init.d script if fxotune fails. This may happen if running it
  when Asterisk is already running.
* Bump standards version to 3.8.0.0 .
* Ignore false lintian warning ("m-a a-i" has "a a").
* Patch xpp_fxo_cid_always: do always pass PCM if that's what the user
  asked.
* Patch vzaphfc_proc_root_dir: fix vzaphfc on 2.6.26.
* Patch wcte12xp_flags: Proper time for irq save flags.
* Patch headers_2627: Fix location of semaphore.h for 2.6.27 .
* Patch xpp_fxs_dtmf_leak: Don't play DTMFs to the wrong channel.
* Patch wctdm_fix_alarm: Fix sending channel alarms.
* Patch device_class_2626: Fix building 2.6.26 (Closes: #493397).
* Using dh_lintian for lintian overrides, hence requiring debhelper 6.0.7.
* Lintian: we know we have direct changes. Too bad we're half-upstream :-(
* Fix doc-base section names. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Dummy Zaptel Driver for Zapata Telephony interface
 
3
 *
 
4
 * Written by Robert Pleh <robert.pleh@hermes.si>
 
5
 *
 
6
 * Copyright (C) 2002, Hermes Softlab
 
7
 *
 
8
 * All rights reserved.
 
9
 *
 
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.
 
14
 *
 
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.
 
19
 *
 
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.
 
23
 *
 
24
 *
 
25
*/
 
26
 
 
27
#include <linux/version.h>
 
28
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,19)
 
29
#define USB2420
 
30
#endif
 
31
 
 
32
struct ztdummy {
 
33
        struct zt_span span;
 
34
        struct zt_chan chan;
 
35
#ifdef LINUX26
 
36
        unsigned int counter;
 
37
#ifdef USE_RTC
 
38
        spinlock_t rtclock;
 
39
        rtc_task_t rtc_task;
 
40
#endif
 
41
#endif
 
42
};
 
43
 
 
44
 
 
45
#ifndef LINUX26
 
46
/* Uhci definitions and structures - from file usb-uhci.h */
 
47
#define TD_CTRL_IOC             (1 << 24)       /* Interrupt on Complete */
 
48
#define USBSTS 2
 
49
 
 
50
typedef enum {
 
51
        TD_TYPE, QH_TYPE
 
52
} uhci_desc_type_t;
 
53
 
 
54
typedef struct {
 
55
        __u32 link;
 
56
        __u32 status;
 
57
        __u32 info;
 
58
        __u32 buffer;
 
59
} uhci_td_t, *puhci_td_t;
 
60
 
 
61
 
 
62
typedef struct {
 
63
        __u32 head;
 
64
        __u32 element;          /* Queue element pointer */
 
65
} uhci_qh_t, *puhci_qh_t;
 
66
 
 
67
typedef struct {
 
68
        union {
 
69
                uhci_td_t td;
 
70
                uhci_qh_t qh;
 
71
        } hw;
 
72
        uhci_desc_type_t type;
 
73
        dma_addr_t dma_addr;
 
74
        struct list_head horizontal;
 
75
        struct list_head vertical;
 
76
        struct list_head desc_list;
 
77
        int last_used;
 
78
} uhci_desc_t, *puhci_desc_t;
 
79
 
 
80
typedef struct {
 
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;
 
85
#ifdef USB2420
 
86
        struct urb *next_queued_urb;    // next queued urb for this EP
 
87
        struct urb *prev_queued_urb;
 
88
#else
 
89
        urb_t *next_queued_urb;         
 
90
        urb_t *prev_queued_urb;
 
91
#endif
 
92
        uhci_desc_t *bottom_qh;
 
93
        uhci_desc_t *next_qh;           // next helper QH
 
94
        char use_loop;
 
95
        char flags;
 
96
} urb_priv_t, *purb_priv_t;
 
97
 
 
98
struct virt_root_hub {
 
99
        int devnum;             /* Address of Root Hub endpoint */
 
100
        void *urb;
 
101
        void *int_addr;
 
102
        int send;
 
103
        int interval;
 
104
        int numports;
 
105
        int c_p_r[8];
 
106
        struct timer_list rh_int_timer;
 
107
};
 
108
 
 
109
typedef struct uhci {
 
110
        int irq;
 
111
        unsigned int io_addr;
 
112
        unsigned int io_size;
 
113
        unsigned int maxports;
 
114
        int running;
 
115
 
 
116
        int apm_state;
 
117
 
 
118
        struct uhci *next;      // chain of uhci device contexts
 
119
 
 
120
        struct list_head urb_list;      // list of all pending urbs
 
121
 
 
122
        spinlock_t urb_list_lock;       // lock to keep consistency
 
123
 
 
124
        int unlink_urb_done;
 
125
        atomic_t avoid_bulk;
 
126
 
 
127
        struct usb_bus *bus;    // our bus
 
128
 
 
129
        __u32 *framelist;
 
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;
 
137
        uhci_desc_t *td1ms;
 
138
        uhci_desc_t *td32ms;
 
139
        struct list_head free_desc;
 
140
        spinlock_t qh_lock;
 
141
        spinlock_t td_lock;
 
142
        struct virt_root_hub rh;        //private data of the virtual root hub
 
143
        int loop_usage;            // URBs using bandwidth reclamation
 
144
 
 
145
        struct list_head urb_unlinked;  // list of all unlinked  urbs
 
146
        long timeout_check;
 
147
        int timeout_urbs;
 
148
        struct pci_dev *uhci_pci;
 
149
        struct pci_pool *desc_pool;
 
150
        long last_error_time;          // last error output in uhci_interrupt()
 
151
} uhci_t, *puhci_t;
 
152
#endif