blob: a0317abaeb111fc9ced966f62c11afbd3491bc35 [file] [log] [blame]
Tilman Schmidt917f5082006-04-10 22:55:00 -07001/*
2 * Siemens Gigaset 307x driver
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -08003 * Common header file for all connection variants
4 *
Tilman Schmidt70440cf2006-04-10 22:55:14 -07005 * Written by Stefan Eilers
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -08006 * and Hansjoerg Lipp <hjlipp@web.de>
7 *
Tilman Schmidt917f5082006-04-10 22:55:00 -07008 * =====================================================================
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
13 * =====================================================================
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080014 */
15
16#ifndef GIGASET_H
17#define GIGASET_H
18
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080019#include <linux/kernel.h>
20#include <linux/compiler.h>
21#include <linux/types.h>
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080022#include <linux/spinlock.h>
23#include <linux/isdnif.h>
24#include <linux/usb.h>
25#include <linux/skbuff.h>
26#include <linux/netdevice.h>
27#include <linux/ppp_defs.h>
28#include <linux/timer.h>
29#include <linux/interrupt.h>
30#include <linux/tty.h>
31#include <linux/tty_driver.h>
32#include <linux/list.h>
Tilman Schmidt917f5082006-04-10 22:55:00 -070033#include <asm/atomic.h>
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080034
35#define GIG_VERSION {0,5,0,0}
36#define GIG_COMPAT {0,4,0,0}
37
Tilman Schmidt917f5082006-04-10 22:55:00 -070038#define MAX_REC_PARAMS 10 /* Max. number of params in response string */
39#define MAX_RESP_SIZE 512 /* Max. size of a response string */
40#define HW_HDR_LEN 2 /* Header size used to store ack info */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080041
Tilman Schmidt917f5082006-04-10 22:55:00 -070042#define MAX_EVENTS 64 /* size of event queue */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080043
44#define RBUFSIZE 8192
Tilman Schmidt917f5082006-04-10 22:55:00 -070045#define SBUFSIZE 4096 /* sk_buff payload size */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080046
Tilman Schmidt917f5082006-04-10 22:55:00 -070047#define TRANSBUFSIZE 768 /* bytes per skb for transparent receive */
48#define MAX_BUF_SIZE (SBUFSIZE - 2) /* Max. size of a data packet from LL */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080049
50/* compile time options */
51#define GIG_MAJOR 0
52
53#define GIG_MAYINITONDIAL
54#define GIG_RETRYCID
55#define GIG_X75
56
Tilman Schmidtec81b5e2006-04-10 22:55:03 -070057#define GIG_TICK 100 /* in milliseconds */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080058
59/* timeout values (unit: 1 sec) */
60#define INIT_TIMEOUT 1
61
62/* timeout values (unit: 0.1 sec) */
63#define RING_TIMEOUT 3 /* for additional parameters to RING */
64#define BAS_TIMEOUT 20 /* for response to Base USB ops */
65#define ATRDY_TIMEOUT 3 /* for HD_READY_SEND_ATDATA */
66
67#define BAS_RETRY 3 /* max. retries for base USB ops */
68
69#define MAXACT 3
70
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080071extern int gigaset_debuglevel; /* "needs" cast to (enum debuglevel) */
72
Tilman Schmidt917f5082006-04-10 22:55:00 -070073/* any combination of these can be given with the 'debug=' parameter to insmod,
74 * e.g. 'insmod usb_gigaset.o debug=0x2c' will set DEBUG_OPEN, DEBUG_CMD and
75 * DEBUG_INTR.
76 */
Tilman Schmidt73a88812006-04-22 02:35:30 -070077enum debuglevel {
Tilman Schmidt784d5852006-04-10 22:55:04 -070078 DEBUG_REG = 0x0002, /* serial port I/O register operations */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080079 DEBUG_OPEN = 0x0004, /* open/close serial port */
80 DEBUG_INTR = 0x0008, /* interrupt processing */
Tilman Schmidt784d5852006-04-10 22:55:04 -070081 DEBUG_INTR_DUMP = 0x0010, /* Activating hexdump debug output on
Tilman Schmidt917f5082006-04-10 22:55:00 -070082 interrupt requests, not available as
83 run-time option */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080084 DEBUG_CMD = 0x00020, /* sent/received LL commands */
85 DEBUG_STREAM = 0x00040, /* application data stream I/O events */
86 DEBUG_STREAM_DUMP = 0x00080, /* application data stream content */
87 DEBUG_LLDATA = 0x00100, /* sent/received LL data */
Tilman Schmidt917f5082006-04-10 22:55:00 -070088 DEBUG_INTR_0 = 0x00200, /* serial port interrupt processing */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080089 DEBUG_DRIVER = 0x00400, /* driver structure */
90 DEBUG_HDLC = 0x00800, /* M10x HDLC processing */
91 DEBUG_WRITE = 0x01000, /* M105 data write */
Tilman Schmidt784d5852006-04-10 22:55:04 -070092 DEBUG_TRANSCMD = 0x02000, /* AT-COMMANDS+RESPONSES */
93 DEBUG_MCMD = 0x04000, /* COMMANDS THAT ARE SENT VERY OFTEN */
Tilman Schmidt917f5082006-04-10 22:55:00 -070094 DEBUG_INIT = 0x08000, /* (de)allocation+initialization of data
95 structures */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080096 DEBUG_LOCK = 0x10000, /* semaphore operations */
97 DEBUG_OUTPUT = 0x20000, /* output to device */
Tilman Schmidt784d5852006-04-10 22:55:04 -070098 DEBUG_ISO = 0x40000, /* isochronous transfers */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080099 DEBUG_IF = 0x80000, /* character device operations */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700100 DEBUG_USBREQ = 0x100000, /* USB communication (except payload
101 data) */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700102 DEBUG_LOCKCMD = 0x200000, /* AT commands and responses when
Tilman Schmidt917f5082006-04-10 22:55:00 -0700103 MS_LOCKED */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800104
Tilman Schmidt917f5082006-04-10 22:55:00 -0700105 DEBUG_ANY = 0x3fffff, /* print message if any of the others is
106 activated */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800107};
108
Tilman Schmidt784d5852006-04-10 22:55:04 -0700109/* missing from linux/device.h ... */
110#ifndef dev_notice
111#define dev_notice(dev, format, arg...) \
112 dev_printk(KERN_NOTICE , dev , format , ## arg)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800113#endif
114
Tilman Schmidt784d5852006-04-10 22:55:04 -0700115/* Kernel message macros for situations where dev_printk and friends cannot be
116 * used for lack of reliable access to a device structure.
117 * linux/usb.h already contains these but in an obsolete form which clutters
118 * the log needlessly, and according to the USB maintainer those should be
119 * removed rather than fixed anyway.
120 */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800121#undef err
Tilman Schmidt784d5852006-04-10 22:55:04 -0700122#undef info
123#undef warn
124#undef notice
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800125
Tilman Schmidt784d5852006-04-10 22:55:04 -0700126#define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \
127 format "\n" , ## arg)
128#define info(format, arg...) printk(KERN_INFO KBUILD_MODNAME ": " \
129 format "\n" , ## arg)
130#define warn(format, arg...) printk(KERN_WARNING KBUILD_MODNAME ": " \
131 format "\n" , ## arg)
132#define notice(format, arg...) printk(KERN_NOTICE KBUILD_MODNAME ": " \
133 format "\n" , ## arg)
134
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800135#ifdef CONFIG_GIGASET_DEBUG
Tilman Schmidt784d5852006-04-10 22:55:04 -0700136
137#define gig_dbg(level, format, arg...) \
Tilman Schmidt917f5082006-04-10 22:55:00 -0700138 do { \
139 if (unlikely(((enum debuglevel)gigaset_debuglevel) & (level))) \
Tilman Schmidt784d5852006-04-10 22:55:04 -0700140 printk(KERN_DEBUG KBUILD_MODNAME ": " format "\n", \
141 ## arg); \
Tilman Schmidt917f5082006-04-10 22:55:00 -0700142 } while (0)
Tilman Schmidt73a88812006-04-22 02:35:30 -0700143#define DEBUG_DEFAULT (DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ)
Tilman Schmidt784d5852006-04-10 22:55:04 -0700144
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800145#else
Tilman Schmidt784d5852006-04-10 22:55:04 -0700146
147#define gig_dbg(level, format, arg...) do {} while (0)
148#define DEBUG_DEFAULT 0
149
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800150#endif
151
152void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
Tilman Schmidt01371502006-04-10 22:55:11 -0700153 size_t len, const unsigned char *buf);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800154
155/* connection state */
156#define ZSAU_NONE 0
157#define ZSAU_DISCONNECT_IND 4
158#define ZSAU_OUTGOING_CALL_PROCEEDING 1
159#define ZSAU_PROCEEDING 1
160#define ZSAU_CALL_DELIVERED 2
161#define ZSAU_ACTIVE 3
162#define ZSAU_NULL 5
163#define ZSAU_DISCONNECT_REQ 6
164#define ZSAU_UNKNOWN -1
165
166/* USB control transfer requests */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700167#define OUT_VENDOR_REQ (USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT)
168#define IN_VENDOR_REQ (USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800169
170/* int-in-events 3070 */
171#define HD_B1_FLOW_CONTROL 0x80
172#define HD_B2_FLOW_CONTROL 0x81
Tilman Schmidt917f5082006-04-10 22:55:00 -0700173#define HD_RECEIVEATDATA_ACK (0x35) // 3070
174 // att: HD_RECEIVE>>AT<<DATA_ACK
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800175#define HD_READY_SEND_ATDATA (0x36) // 3070
176#define HD_OPEN_ATCHANNEL_ACK (0x37) // 3070
177#define HD_CLOSE_ATCHANNEL_ACK (0x38) // 3070
178#define HD_DEVICE_INIT_OK (0x11) // ISurf USB + 3070
179#define HD_OPEN_B1CHANNEL_ACK (0x51) // ISurf USB + 3070
180#define HD_OPEN_B2CHANNEL_ACK (0x52) // ISurf USB + 3070
181#define HD_CLOSE_B1CHANNEL_ACK (0x53) // ISurf USB + 3070
182#define HD_CLOSE_B2CHANNEL_ACK (0x54) // ISurf USB + 3070
183// Powermangment
184#define HD_SUSPEND_END (0x61) // ISurf USB
185// Configuration
186#define HD_RESET_INTERRUPT_PIPE_ACK (0xFF) // ISurf USB + 3070
187
188/* control requests 3070 */
189#define HD_OPEN_B1CHANNEL (0x23) // ISurf USB + 3070
190#define HD_CLOSE_B1CHANNEL (0x24) // ISurf USB + 3070
191#define HD_OPEN_B2CHANNEL (0x25) // ISurf USB + 3070
192#define HD_CLOSE_B2CHANNEL (0x26) // ISurf USB + 3070
193#define HD_RESET_INTERRUPT_PIPE (0x27) // ISurf USB + 3070
194#define HD_DEVICE_INIT_ACK (0x34) // ISurf USB + 3070
195#define HD_WRITE_ATMESSAGE (0x12) // 3070
196#define HD_READ_ATMESSAGE (0x13) // 3070
197#define HD_OPEN_ATCHANNEL (0x28) // 3070
198#define HD_CLOSE_ATCHANNEL (0x29) // 3070
199
200/* USB frames for isochronous transfer */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700201#define BAS_FRAMETIME 1 /* number of milliseconds between frames */
202#define BAS_NUMFRAMES 8 /* number of frames per URB */
203#define BAS_MAXFRAME 16 /* allocated bytes per frame */
204#define BAS_NORMFRAME 8 /* send size without flow control */
205#define BAS_HIGHFRAME 10 /* " " with positive flow control */
206#define BAS_LOWFRAME 5 /* " " with negative flow control */
207#define BAS_CORRFRAMES 4 /* flow control multiplicator */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800208
Tilman Schmidt917f5082006-04-10 22:55:00 -0700209#define BAS_INBUFSIZE (BAS_MAXFRAME * BAS_NUMFRAMES)
210 /* size of isoc in buf per URB */
211#define BAS_OUTBUFSIZE 4096 /* size of common isoc out buffer */
212#define BAS_OUTBUFPAD BAS_MAXFRAME /* size of pad area for isoc out buf */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800213
214#define BAS_INURBS 3
215#define BAS_OUTURBS 3
216
217/* variable commands in struct bc_state */
218#define AT_ISO 0
219#define AT_DIAL 1
220#define AT_MSN 2
221#define AT_BC 3
222#define AT_PROTO 4
223#define AT_TYPE 5
224#define AT_HLC 6
225#define AT_NUM 7
226
227/* variables in struct at_state_t */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700228#define VAR_ZSAU 0
229#define VAR_ZDLE 1
230#define VAR_ZVLS 2
231#define VAR_ZCTP 3
232#define VAR_NUM 4
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800233
Tilman Schmidt917f5082006-04-10 22:55:00 -0700234#define STR_NMBR 0
235#define STR_ZCPN 1
236#define STR_ZCON 2
237#define STR_ZBC 3
238#define STR_ZHLC 4
239#define STR_NUM 5
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800240
Tilman Schmidt917f5082006-04-10 22:55:00 -0700241#define EV_TIMEOUT -105
242#define EV_IF_VER -106
243#define EV_PROC_CIDMODE -107
244#define EV_SHUTDOWN -108
245#define EV_START -110
246#define EV_STOP -111
247#define EV_IF_LOCK -112
248#define EV_PROTO_L2 -113
249#define EV_ACCEPT -114
250#define EV_DIAL -115
251#define EV_HUP -116
252#define EV_BC_OPEN -117
253#define EV_BC_CLOSED -118
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800254
255/* input state */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700256#define INS_command 0x0001
257#define INS_DLE_char 0x0002
258#define INS_byte_stuff 0x0004
259#define INS_have_data 0x0008
260#define INS_skip_frame 0x0010
261#define INS_DLE_command 0x0020
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800262#define INS_flag_hunt 0x0040
263
264/* channel state */
265#define CHS_D_UP 0x01
266#define CHS_B_UP 0x02
267#define CHS_NOTIFY_LL 0x04
268
Tilman Schmidt917f5082006-04-10 22:55:00 -0700269#define ICALL_REJECT 0
270#define ICALL_ACCEPT 1
271#define ICALL_IGNORE 2
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800272
273/* device state */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700274#define MS_UNINITIALIZED 0
275#define MS_INIT 1
276#define MS_LOCKED 2
277#define MS_SHUTDOWN 3
278#define MS_RECOVER 4
279#define MS_READY 5
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800280
281/* mode */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700282#define M_UNKNOWN 0
283#define M_CONFIG 1
284#define M_UNIMODEM 2
285#define M_CID 3
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800286
287/* start mode */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700288#define SM_LOCKED 0
289#define SM_ISDN 1 /* default */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800290
291struct gigaset_ops;
292struct gigaset_driver;
293
294struct usb_cardstate;
295struct ser_cardstate;
296struct bas_cardstate;
297
298struct bc_state;
299struct usb_bc_state;
300struct ser_bc_state;
301struct bas_bc_state;
302
303struct reply_t {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700304 int resp_code; /* RSP_XXXX */
305 int min_ConState; /* <0 => ignore */
306 int max_ConState; /* <0 => ignore */
307 int parameter; /* e.g. ZSAU_XXXX <0: ignore*/
308 int new_ConState; /* <0 => ignore */
309 int timeout; /* >0 => *HZ; <=0 => TOUT_XXXX*/
310 int action[MAXACT]; /* ACT_XXXX */
311 char *command; /* NULL==none */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800312};
313
314extern struct reply_t gigaset_tab_cid_m10x[];
315extern struct reply_t gigaset_tab_nocid_m10x[];
316
317struct inbuf_t {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700318 unsigned char *rcvbuf; /* usb-gigaset receive buffer */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800319 struct bc_state *bcs;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700320 struct cardstate *cs;
321 int inputstate;
322 atomic_t head, tail;
323 unsigned char data[RBUFSIZE];
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800324};
325
326/* isochronous write buffer structure
327 * circular buffer with pad area for extraction of complete USB frames
328 * - data[read..nextread-1] is valid data already submitted to the USB subsystem
329 * - data[nextread..write-1] is valid data yet to be sent
330 * - data[write] is the next byte to write to
331 * - in byte-oriented L2 procotols, it is completely free
332 * - in bit-oriented L2 procotols, it may contain a partial byte of valid data
333 * - data[write+1..read-1] is free
334 * - wbits is the number of valid data bits in data[write], starting at the LSB
335 * - writesem is the semaphore for writing to the buffer:
336 * if writesem <= 0, data[write..read-1] is currently being written to
337 * - idle contains the byte value to repeat when the end of valid data is
338 * reached; if nextread==write (buffer contains no data to send), either the
Tilman Schmidt917f5082006-04-10 22:55:00 -0700339 * BAS_OUTBUFPAD bytes immediately before data[write] (if
340 * write>=BAS_OUTBUFPAD) or those of the pad area (if write<BAS_OUTBUFPAD)
341 * are also filled with that value
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800342 */
343struct isowbuf_t {
344 atomic_t read;
345 atomic_t nextread;
346 atomic_t write;
347 atomic_t writesem;
348 int wbits;
349 unsigned char data[BAS_OUTBUFSIZE + BAS_OUTBUFPAD];
350 unsigned char idle;
351};
352
353/* isochronous write URB context structure
354 * data to be stored along with the URB and retrieved when it is returned
355 * as completed by the USB subsystem
356 * - urb: pointer to the URB itself
357 * - bcs: pointer to the B Channel control structure
358 * - limit: end of write buffer area covered by this URB
359 */
360struct isow_urbctx_t {
361 struct urb *urb;
362 struct bc_state *bcs;
363 int limit;
364};
365
366/* AT state structure
367 * data associated with the state of an ISDN connection, whether or not
368 * it is currently assigned a B channel
369 */
370struct at_state_t {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700371 struct list_head list;
372 int waiting;
373 int getstring;
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700374 unsigned timer_index;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800375 unsigned long timer_expires;
376 int timer_active;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700377 unsigned int ConState; /* State of connection */
378 struct reply_t *replystruct;
379 int cid;
380 int int_var[VAR_NUM]; /* see VAR_XXXX */
381 char *str_var[STR_NUM]; /* see STR_XXXX */
382 unsigned pending_commands; /* see PC_XXXX */
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700383 unsigned seq_index;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800384
Tilman Schmidt917f5082006-04-10 22:55:00 -0700385 struct cardstate *cs;
386 struct bc_state *bcs;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800387};
388
389struct resp_type_t {
390 unsigned char *response;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700391 int resp_code; /* RSP_XXXX */
392 int type; /* RT_XXXX */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800393};
394
395struct event_t {
396 int type;
397 void *ptr, *arg;
398 int parameter;
399 int cid;
400 struct at_state_t *at_state;
401};
402
403/* This buffer holds all information about the used B-Channel */
404struct bc_state {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700405 struct sk_buff *tx_skb; /* Current transfer buffer to modem */
406 struct sk_buff_head squeue; /* B-Channel send Queue */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800407
408 /* Variables for debugging .. */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700409 int corrupted; /* Counter for corrupted packages */
410 int trans_down; /* Counter of packages (downstream) */
411 int trans_up; /* Counter of packages (upstream) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800412
413 struct at_state_t at_state;
414 unsigned long rcvbytes;
415
416 __u16 fcs;
417 struct sk_buff *skb;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700418 int inputstate; /* see INS_XXXX */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800419
420 int channel;
421
422 struct cardstate *cs;
423
Tilman Schmidt917f5082006-04-10 22:55:00 -0700424 unsigned chstate; /* bitmap (CHS_*) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800425 int ignore;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700426 unsigned proto2; /* Layer 2 protocol (ISDN_PROTO_L2_*) */
427 char *commands[AT_NUM]; /* see AT_XXXX */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800428
429#ifdef CONFIG_GIGASET_DEBUG
430 int emptycount;
431#endif
432 int busy;
433 int use_count;
434
Tilman Schmidt784d5852006-04-10 22:55:04 -0700435 /* private data of hardware drivers */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800436 union {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700437 struct ser_bc_state *ser; /* serial hardware driver */
438 struct usb_bc_state *usb; /* usb hardware driver (m105) */
439 struct bas_bc_state *bas; /* usb hardware driver (base) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800440 } hw;
441};
442
443struct cardstate {
444 struct gigaset_driver *driver;
445 unsigned minor_index;
Tilman Schmidt784d5852006-04-10 22:55:04 -0700446 struct device *dev;
Greg Kroah-Hartman01107d32006-08-07 22:19:37 -0700447 struct device *tty_dev;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800448
449 const struct gigaset_ops *ops;
450
451 /* Stuff to handle communication */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800452 wait_queue_head_t waitqueue;
453 int waiting;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700454 atomic_t mode; /* see M_XXXX */
455 atomic_t mstate; /* Modem state: see MS_XXXX */
456 /* only changed by the event layer */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800457 int cmd_result;
458
459 int channels;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700460 struct bc_state *bcs; /* Array of struct bc_state */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800461
Tilman Schmidt917f5082006-04-10 22:55:00 -0700462 int onechannel; /* data and commands transmitted in one
463 stream (M10x) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800464
465 spinlock_t lock;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700466 struct at_state_t at_state; /* at_state_t for cid == 0 */
467 struct list_head temp_at_states;/* list of temporary "struct
468 at_state_t"s without B channel */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800469
470 struct inbuf_t *inbuf;
471
472 struct cmdbuf_t *cmdbuf, *lastcmdbuf;
473 spinlock_t cmdlock;
474 unsigned curlen, cmdbytes;
475
476 unsigned open_count;
477 struct tty_struct *tty;
478 struct tasklet_struct if_wake_tasklet;
479 unsigned control_state;
480
481 unsigned fwver[4];
482 int gotfwver;
483
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700484 unsigned running; /* !=0 if events are handled */
485 unsigned connected; /* !=0 if hardware is connected */
486 unsigned isdn_up; /* !=0 after ISDN_STAT_RUN */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800487
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700488 unsigned cidmode;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800489
Tilman Schmidt917f5082006-04-10 22:55:00 -0700490 int myid; /* id for communication with LL */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800491 isdn_if iif;
492
493 struct reply_t *tabnocid;
494 struct reply_t *tabcid;
495 int cs_init;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700496 int ignoreframes; /* frames to ignore after setting up the
497 B channel */
Tilman Schmidtabfd1dc2006-04-10 22:55:12 -0700498 struct mutex mutex; /* locks this structure:
Tilman Schmidt784d5852006-04-10 22:55:04 -0700499 * connected is not changed,
500 * hardware_up is not changed,
501 * MState is not changed to or from
502 * MS_LOCKED */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800503
504 struct timer_list timer;
505 int retry_count;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700506 int dle; /* !=0 if modem commands/responses are
507 dle encoded */
508 int cur_at_seq; /* sequence of AT commands being
509 processed */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700510 int curchannel; /* channel those commands are meant
Tilman Schmidt917f5082006-04-10 22:55:00 -0700511 for */
512 atomic_t commands_pending; /* flag(s) in xxx.commands_pending have
513 been set */
514 struct tasklet_struct event_tasklet;
515 /* tasklet for serializing AT commands.
516 * Scheduled
517 * -> for modem reponses (and
Tilman Schmidt784d5852006-04-10 22:55:04 -0700518 * incoming data for M10x)
Tilman Schmidt917f5082006-04-10 22:55:00 -0700519 * -> on timeout
520 * -> after setting bits in
521 * xxx.at_state.pending_command
522 * (e.g. command from LL) */
523 struct tasklet_struct write_tasklet;
524 /* tasklet for serial output
525 * (not used in base driver) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800526
527 /* event queue */
528 struct event_t events[MAX_EVENTS];
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700529 unsigned ev_tail, ev_head;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800530 spinlock_t ev_lock;
531
532 /* current modem response */
533 unsigned char respdata[MAX_RESP_SIZE];
534 unsigned cbytes;
535
Tilman Schmidt784d5852006-04-10 22:55:04 -0700536 /* private data of hardware drivers */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800537 union {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700538 struct usb_cardstate *usb; /* USB hardware driver (m105) */
539 struct ser_cardstate *ser; /* serial hardware driver */
540 struct bas_cardstate *bas; /* USB hardware driver (base) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800541 } hw;
542};
543
544struct gigaset_driver {
545 struct list_head list;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700546 spinlock_t lock; /* locks minor tables and blocked */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800547 struct tty_driver *tty;
548 unsigned have_tty;
549 unsigned minor;
550 unsigned minors;
551 struct cardstate *cs;
552 unsigned *flags;
553 int blocked;
554
555 const struct gigaset_ops *ops;
556 struct module *owner;
557};
558
559struct cmdbuf_t {
560 struct cmdbuf_t *next, *prev;
561 int len, offset;
562 struct tasklet_struct *wake_tasklet;
563 unsigned char buf[0];
564};
565
566struct bas_bc_state {
567 /* isochronous output state */
568 atomic_t running;
569 atomic_t corrbytes;
570 spinlock_t isooutlock;
571 struct isow_urbctx_t isoouturbs[BAS_OUTURBS];
572 struct isow_urbctx_t *isooutdone, *isooutfree, *isooutovfl;
573 struct isowbuf_t *isooutbuf;
Tilman Schmidt784d5852006-04-10 22:55:04 -0700574 unsigned numsub; /* submitted URB counter
575 (for diagnostic messages only) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800576 struct tasklet_struct sent_tasklet;
577
578 /* isochronous input state */
579 spinlock_t isoinlock;
580 struct urb *isoinurbs[BAS_INURBS];
581 unsigned char isoinbuf[BAS_INBUFSIZE * BAS_INURBS];
Tilman Schmidt784d5852006-04-10 22:55:04 -0700582 struct urb *isoindone; /* completed isoc read URB */
583 int loststatus; /* status of dropped URB */
584 unsigned isoinlost; /* number of bytes lost */
585 /* state of bit unstuffing algorithm
586 (in addition to BC_state.inputstate) */
587 unsigned seqlen; /* number of '1' bits not yet
588 unstuffed */
589 unsigned inbyte, inbits; /* collected bits for next byte */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800590 /* statistics */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700591 unsigned goodbytes; /* bytes correctly received */
592 unsigned alignerrs; /* frames with incomplete byte at end */
593 unsigned fcserrs; /* FCS errors */
594 unsigned frameerrs; /* framing errors */
595 unsigned giants; /* long frames */
596 unsigned runts; /* short frames */
597 unsigned aborts; /* HDLC aborts */
598 unsigned shared0s; /* '0' bits shared between flags */
599 unsigned stolen0s; /* '0' stuff bits also serving as
600 leading flag bits */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800601 struct tasklet_struct rcvd_tasklet;
602};
603
604struct gigaset_ops {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700605 /* Called from ev-layer.c/interface.c for sending AT commands to the
606 device */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800607 int (*write_cmd)(struct cardstate *cs,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700608 const unsigned char *buf, int len,
609 struct tasklet_struct *wake_tasklet);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800610
611 /* Called from interface.c for additional device control */
612 int (*write_room)(struct cardstate *cs);
613 int (*chars_in_buffer)(struct cardstate *cs);
614 int (*brkchars)(struct cardstate *cs, const unsigned char buf[6]);
615
616 /* Called from ev-layer.c after setting up connection
617 * Should call gigaset_bchannel_up(), when finished. */
618 int (*init_bchannel)(struct bc_state *bcs);
619
620 /* Called from ev-layer.c after hanging up
621 * Should call gigaset_bchannel_down(), when finished. */
622 int (*close_bchannel)(struct bc_state *bcs);
623
624 /* Called by gigaset_initcs() for setting up bcs->hw.xxx */
625 int (*initbcshw)(struct bc_state *bcs);
626
627 /* Called by gigaset_freecs() for freeing bcs->hw.xxx */
628 int (*freebcshw)(struct bc_state *bcs);
629
Tilman Schmidt73a88812006-04-22 02:35:30 -0700630 /* Called by gigaset_bchannel_down() for resetting bcs->hw.xxx */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800631 void (*reinitbcshw)(struct bc_state *bcs);
632
633 /* Called by gigaset_initcs() for setting up cs->hw.xxx */
634 int (*initcshw)(struct cardstate *cs);
635
636 /* Called by gigaset_freecs() for freeing cs->hw.xxx */
637 void (*freecshw)(struct cardstate *cs);
638
Tilman Schmidt917f5082006-04-10 22:55:00 -0700639 /* Called from common.c/interface.c for additional serial port
640 control */
641 int (*set_modem_ctrl)(struct cardstate *cs, unsigned old_state,
642 unsigned new_state);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800643 int (*baud_rate)(struct cardstate *cs, unsigned cflag);
644 int (*set_line_ctrl)(struct cardstate *cs, unsigned cflag);
645
646 /* Called from i4l.c to put an skb into the send-queue. */
647 int (*send_skb)(struct bc_state *bcs, struct sk_buff *skb);
648
649 /* Called from ev-layer.c to process a block of data
650 * received through the common/control channel. */
651 void (*handle_input)(struct inbuf_t *inbuf);
652
653};
654
655/* = Common structures and definitions ======================================= */
656
657/* Parser states for DLE-Event:
658 * <DLE-EVENT>: <DLE_FLAG> "X" <EVENT> <DLE_FLAG> "."
659 * <DLE_FLAG>: 0x10
660 * <EVENT>: ((a-z)* | (A-Z)* | (0-10)*)+
661 */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700662#define DLE_FLAG 0x10
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800663
664/* ===========================================================================
665 * Functions implemented in asyncdata.c
666 */
667
668/* Called from i4l.c to put an skb into the send-queue.
669 * After sending gigaset_skb_sent() should be called. */
670int gigaset_m10x_send_skb(struct bc_state *bcs, struct sk_buff *skb);
671
672/* Called from ev-layer.c to process a block of data
673 * received through the common/control channel. */
674void gigaset_m10x_input(struct inbuf_t *inbuf);
675
676/* ===========================================================================
677 * Functions implemented in isocdata.c
678 */
679
680/* Called from i4l.c to put an skb into the send-queue.
681 * After sending gigaset_skb_sent() should be called. */
682int gigaset_isoc_send_skb(struct bc_state *bcs, struct sk_buff *skb);
683
684/* Called from ev-layer.c to process a block of data
685 * received through the common/control channel. */
686void gigaset_isoc_input(struct inbuf_t *inbuf);
687
688/* Called from bas-gigaset.c to process a block of data
689 * received through the isochronous channel */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700690void gigaset_isoc_receive(unsigned char *src, unsigned count,
691 struct bc_state *bcs);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800692
693/* Called from bas-gigaset.c to put a block of data
694 * into the isochronous output buffer */
695int gigaset_isoc_buildframe(struct bc_state *bcs, unsigned char *in, int len);
696
697/* Called from bas-gigaset.c to initialize the isochronous output buffer */
698void gigaset_isowbuf_init(struct isowbuf_t *iwb, unsigned char idle);
699
700/* Called from bas-gigaset.c to retrieve a block of bytes for sending */
701int gigaset_isowbuf_getbytes(struct isowbuf_t *iwb, int size);
702
703/* ===========================================================================
704 * Functions implemented in i4l.c/gigaset.h
705 */
706
707/* Called by gigaset_initcs() for setting up with the isdn4linux subsystem */
708int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid);
709
710/* Called from xxx-gigaset.c to indicate completion of sending an skb */
711void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb);
712
713/* Called from common.c/ev-layer.c to indicate events relevant to the LL */
714int gigaset_isdn_icall(struct at_state_t *at_state);
715int gigaset_isdn_setup_accept(struct at_state_t *at_state);
716int gigaset_isdn_setup_dial(struct at_state_t *at_state, void *data);
717
718void gigaset_i4l_cmd(struct cardstate *cs, int cmd);
719void gigaset_i4l_channel_cmd(struct bc_state *bcs, int cmd);
720
721
722static inline void gigaset_isdn_rcv_err(struct bc_state *bcs)
723{
724 isdn_ctrl response;
725
726 /* error -> LL */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700727 gig_dbg(DEBUG_CMD, "sending L1ERR");
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800728 response.driver = bcs->cs->myid;
729 response.command = ISDN_STAT_L1ERR;
730 response.arg = bcs->channel;
731 response.parm.errcode = ISDN_STAT_L1ERR_RECV;
732 bcs->cs->iif.statcallb(&response);
733}
734
735/* ===========================================================================
736 * Functions implemented in ev-layer.c
737 */
738
739/* tasklet called from common.c to process queued events */
740void gigaset_handle_event(unsigned long data);
741
742/* called from isocdata.c / asyncdata.c
743 * when a complete modem response line has been received */
744void gigaset_handle_modem_response(struct cardstate *cs);
745
746/* ===========================================================================
747 * Functions implemented in proc.c
748 */
749
750/* initialize sysfs for device */
Tilman Schmidtb1d47462006-04-10 22:55:07 -0700751void gigaset_init_dev_sysfs(struct cardstate *cs);
752void gigaset_free_dev_sysfs(struct cardstate *cs);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800753
754/* ===========================================================================
755 * Functions implemented in common.c/gigaset.h
756 */
757
758void gigaset_bcs_reinit(struct bc_state *bcs);
759void gigaset_at_init(struct at_state_t *at_state, struct bc_state *bcs,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700760 struct cardstate *cs, int cid);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800761int gigaset_get_channel(struct bc_state *bcs);
762void gigaset_free_channel(struct bc_state *bcs);
763int gigaset_get_channels(struct cardstate *cs);
764void gigaset_free_channels(struct cardstate *cs);
765void gigaset_block_channels(struct cardstate *cs);
766
767/* Allocate and initialize driver structure. */
768struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700769 const char *procname,
770 const char *devname,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700771 const struct gigaset_ops *ops,
772 struct module *owner);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800773
774/* Deallocate driver structure. */
775void gigaset_freedriver(struct gigaset_driver *drv);
776void gigaset_debugdrivers(void);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800777struct cardstate *gigaset_get_cs_by_tty(struct tty_struct *tty);
778struct cardstate *gigaset_get_cs_by_id(int id);
779
780/* For drivers without fixed assignment device<->cardstate (usb) */
781struct cardstate *gigaset_getunassignedcs(struct gigaset_driver *drv);
782void gigaset_unassign(struct cardstate *cs);
783void gigaset_blockdriver(struct gigaset_driver *drv);
784
Tilman Schmidt917f5082006-04-10 22:55:00 -0700785/* Allocate and initialize card state. Calls hardware dependent
786 gigaset_init[b]cs(). */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800787struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
788 int onechannel, int ignoreframes,
789 int cidmode, const char *modulename);
790
791/* Free card state. Calls hardware dependent gigaset_free[b]cs(). */
792void gigaset_freecs(struct cardstate *cs);
793
794/* Tell common.c that hardware and driver are ready. */
795int gigaset_start(struct cardstate *cs);
796
797/* Tell common.c that the device is not present any more. */
798void gigaset_stop(struct cardstate *cs);
799
800/* Tell common.c that the driver is being unloaded. */
801void gigaset_shutdown(struct cardstate *cs);
802
803/* Tell common.c that an skb has been sent. */
804void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb);
805
806/* Append event to the queue.
807 * Returns NULL on failure or a pointer to the event on success.
808 * ptr must be kmalloc()ed (and not be freed by the caller).
809 */
810struct event_t *gigaset_add_event(struct cardstate *cs,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700811 struct at_state_t *at_state, int type,
812 void *ptr, int parameter, void *arg);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800813
814/* Called on CONFIG1 command from frontend. */
815int gigaset_enterconfigmode(struct cardstate *cs); //0: success <0: errorcode
816
817/* cs->lock must not be locked */
818static inline void gigaset_schedule_event(struct cardstate *cs)
819{
820 unsigned long flags;
821 spin_lock_irqsave(&cs->lock, flags);
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700822 if (cs->running)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800823 tasklet_schedule(&cs->event_tasklet);
824 spin_unlock_irqrestore(&cs->lock, flags);
825}
826
827/* Tell common.c that B channel has been closed. */
828/* cs->lock must not be locked */
829static inline void gigaset_bchannel_down(struct bc_state *bcs)
830{
831 gigaset_add_event(bcs->cs, &bcs->at_state, EV_BC_CLOSED, NULL, 0, NULL);
832
Tilman Schmidt784d5852006-04-10 22:55:04 -0700833 gig_dbg(DEBUG_CMD, "scheduling BC_CLOSED");
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800834 gigaset_schedule_event(bcs->cs);
835}
836
837/* Tell common.c that B channel has been opened. */
838/* cs->lock must not be locked */
839static inline void gigaset_bchannel_up(struct bc_state *bcs)
840{
841 gigaset_add_event(bcs->cs, &bcs->at_state, EV_BC_OPEN, NULL, 0, NULL);
842
Tilman Schmidt784d5852006-04-10 22:55:04 -0700843 gig_dbg(DEBUG_CMD, "scheduling BC_OPEN");
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800844 gigaset_schedule_event(bcs->cs);
845}
846
847/* handling routines for sk_buff */
848/* ============================= */
849
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800850/* pass received skb to LL
851 * Warning: skb must not be accessed anymore!
852 */
853static inline void gigaset_rcv_skb(struct sk_buff *skb,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700854 struct cardstate *cs,
855 struct bc_state *bcs)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800856{
857 cs->iif.rcvcallb_skb(cs->myid, bcs->channel, skb);
858 bcs->trans_down++;
859}
860
861/* handle reception of corrupted skb
862 * Warning: skb must not be accessed anymore!
863 */
864static inline void gigaset_rcv_error(struct sk_buff *procskb,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700865 struct cardstate *cs,
866 struct bc_state *bcs)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800867{
868 if (procskb)
869 dev_kfree_skb(procskb);
870
871 if (bcs->ignore)
872 --bcs->ignore;
873 else {
874 ++bcs->corrupted;
875 gigaset_isdn_rcv_err(bcs);
876 }
877}
878
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800879/* append received bytes to inbuf */
Tilman Schmidt714e8232006-04-10 22:55:09 -0700880int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src,
881 unsigned numbytes);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800882
883/* ===========================================================================
884 * Functions implemented in interface.c
885 */
886
887/* initialize interface */
888void gigaset_if_initdriver(struct gigaset_driver *drv, const char *procname,
Greg Kroah-Hartmanf4eaa372005-06-20 21:15:16 -0700889 const char *devname);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800890/* release interface */
891void gigaset_if_freedriver(struct gigaset_driver *drv);
892/* add minor */
893void gigaset_if_init(struct cardstate *cs);
894/* remove minor */
895void gigaset_if_free(struct cardstate *cs);
896/* device received data */
897void gigaset_if_receive(struct cardstate *cs,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700898 unsigned char *buffer, size_t len);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800899
900#endif