9 #define DRIVER_NAME "HFC-S_USB"
11 #define DBG_HFC_CALL_TRACE 0x00010000
12 #define DBG_HFC_FIFO_VERBOSE 0x00020000
13 #define DBG_HFC_USB_VERBOSE 0x00100000
14 #define DBG_HFC_URB_INFO 0x00200000
15 #define DBG_HFC_URB_ERROR 0x00400000
17 #define DEFAULT_TRANSP_BURST_SZ 128
19 #define HFC_CTRL_TIMEOUT 20
20 #define CLKDEL_TE 0x0f
21 #define CLKDEL_NT 0x6c
24 #define HFC_L1_ACTIVATE_TE 1
25 #define HFC_L1_ACTIVATE_NT 2
26 #define HFC_L1_DEACTIVATE_NT 3
27 #define HFC_L1_FORCE_DEACTIVATE_TE 4
30 #define HFCUSB_LOAD_STATE 0x10
31 #define HFCUSB_ACTIVATE 0x20
32 #define HFCUSB_DO_ACTION 0x40
33 #define HFCUSB_NT_G2_G3 0x80
36 #define NT_ACTIVATION_TIMER 0x01
37 #define NT_T1_COUNT 10
39 #define MAX_BCH_SIZE 2048
41 #define HFCUSB_RX_THRESHOLD 64
42 #define HFCUSB_TX_THRESHOLD 96
44 #define HFCUSB_CHIP_ID 0x16
45 #define HFCUSB_CIRM 0x00
46 #define HFCUSB_USB_SIZE 0x07
47 #define HFCUSB_USB_SIZE_I 0x06
48 #define HFCUSB_F_CROSS 0x0b
49 #define HFCUSB_CLKDEL 0x37
50 #define HFCUSB_CON_HDLC 0xfa
51 #define HFCUSB_HDLC_PAR 0xfb
52 #define HFCUSB_SCTRL 0x31
53 #define HFCUSB_SCTRL_E 0x32
54 #define HFCUSB_SCTRL_R 0x33
55 #define HFCUSB_F_THRES 0x0c
56 #define HFCUSB_FIFO 0x0f
57 #define HFCUSB_F_USAGE 0x1a
58 #define HFCUSB_MST_MODE0 0x14
59 #define HFCUSB_MST_MODE1 0x15
60 #define HFCUSB_P_DATA 0x1f
61 #define HFCUSB_INC_RES_F 0x0e
62 #define HFCUSB_B1_SSL 0x20
63 #define HFCUSB_B2_SSL 0x21
64 #define HFCUSB_B1_RSL 0x24
65 #define HFCUSB_B2_RSL 0x25
66 #define HFCUSB_STATES 0x30
69 #define HFCUSB_CHIPID 0x40
72 #define HFCUSB_NUM_FIFOS 8
73 #define HFCUSB_B1_TX 0
74 #define HFCUSB_B1_RX 1
75 #define HFCUSB_B2_TX 2
76 #define HFCUSB_B2_RX 3
79 #define HFCUSB_PCM_TX 6
80 #define HFCUSB_PCM_RX 7
87 #define ISOC_PACKETS_D 8
88 #define ISOC_PACKETS_B 8
89 #define ISO_BUFFER_SIZE 128
92 static int iso_packets[8] =
103 #define BITLINE_INF (-96 * 8)
106 #define write_reg_atomic(a, b, c) \
107 usb_control_msg((a)->dev, (a)->ctrl_out_pipe, 0, 0x40, (c), (b), \
108 0, 0, HFC_CTRL_TIMEOUT)
109 #define read_reg_atomic(a, b, c) \
110 usb_control_msg((a)->dev, (a)->ctrl_in_pipe, 1, 0xC0, 0, (b), (c), \
112 #define HFC_CTRL_BUFSIZE 64
129 {-
ENOMEM,
"No memory for allocation of internal structures"},
130 {-
ENOSPC,
"The host controller's bandwidth is already consumed"},
131 {-
ENOENT,
"URB was canceled by unlink_urb"},
132 {-
EXDEV,
"ISO transfer only partially completed"},
133 {-
EAGAIN,
"Too match scheduled for the future"},
134 {-
ENXIO,
"URB already queued"},
135 {-
EFBIG,
"Too much ISO frames requested"},
136 {-
ENOSR,
"Buffer error (overrun)"},
137 {-
EPIPE,
"Specified endpoint is stalled (device not responding)"},
139 {-
EPROTO,
"Bit-stuff error (bad cable?)"},
141 {-
ETIMEDOUT,
"NAK (device does not respond)"},
146 static inline const char *
151 if (list[i].num == num)
153 return "<unknown USB Error>";
157 #define CNF_4INT3ISO 1
158 #define CNF_3INT3ISO 2
159 #define CNF_4ISO3ISO 3
160 #define CNF_3ISO3ISO 4
168 #define HFC_CHAN_B1 0
169 #define HFC_CHAN_B2 1
197 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
201 static char *conf_str[] = {
202 "4 Interrupt IN + 3 Isochron OUT",
203 "3 Interrupt IN + 3 Isochron OUT",
204 "4 Isochron IN + 3 Isochron OUT",
205 "3 Isochron IN + 3 Isochron OUT"
210 #define LED_SCHEME1 1
211 #define LED_SCHEME2 2
213 #define LED_POWER_ON 1
214 #define LED_POWER_OFF 2
219 #define LED_B1_DATA 7
222 #define LED_B2_DATA 10
225 #define LED_INVERTED 1
241 #ifdef ISO_FRAME_START_DEBUG
242 int start_frames[ISO_FRAME_START_RING_COUNT];
243 __u8 iso_frm_strt_pos;
316 #define HFC_MAX_TE_LAYER1_STATE 8
317 #define HFC_MAX_NT_LAYER1_STATE 4
323 "TE F3 - Deactivated",
324 "TE F4 - Awaiting signal",
325 "TE F5 - Identifying input",
326 "TE F6 - Synchronized",
328 "TE F8 - Lost framing",
334 "NT G2 - Pending activation",
336 "NT G4 - Pending deactivation",
342 USB_DEVICE(0x0959, 0x2bd0),
345 "ISDN USB TA (Cologne Chip HFC-S USB based)"}),
348 USB_DEVICE(0x0675, 0x1688),
351 "DrayTek miniVigor 128 USB ISDN TA"}),
354 USB_DEVICE(0x07b0, 0x0007),
357 "Billion tiny USB ISDN TA 128"}),
360 USB_DEVICE(0x0742, 0x2008),
363 "Stollmann USB TA"}),
366 USB_DEVICE(0x0742, 0x2009),
369 "Aceex USB ISDN TA"}),
372 USB_DEVICE(0x0742, 0x200A),
378 USB_DEVICE(0x08e3, 0x0301),
384 USB_DEVICE(0x07fa, 0x0846),
387 "Bewan Modem RNIS USB"}),
390 USB_DEVICE(0x07fa, 0x0847),
393 "Djinn Numeris USB"}),
396 USB_DEVICE(0x07b0, 0x0006),
402 USB_DEVICE(0x071d, 0x1005),
405 "Eicon DIVA USB 4.0"}),
408 USB_DEVICE(0x0586, 0x0102),
411 "ZyXEL OMNI.NET USB II"}),
414 USB_DEVICE(0x1ae7, 0x0525),
417 "X-Tensions USB ISDN TA XC-525"}),