blob: 92986a5d40550e5309046721501d16dbb29e0161 [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 Schmidtec81b5e62006-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 Schmidtc652cbd2008-02-06 01:38:24 -080073/* debug flags, combine by adding/bitwise OR */
Tilman Schmidt73a88812006-04-22 02:35:30 -070074enum debuglevel {
Tilman Schmidtc652cbd2008-02-06 01:38:24 -080075 DEBUG_INTR = 0x00008, /* interrupt processing */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080076 DEBUG_CMD = 0x00020, /* sent/received LL commands */
77 DEBUG_STREAM = 0x00040, /* application data stream I/O events */
78 DEBUG_STREAM_DUMP = 0x00080, /* application data stream content */
79 DEBUG_LLDATA = 0x00100, /* sent/received LL data */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080080 DEBUG_DRIVER = 0x00400, /* driver structure */
81 DEBUG_HDLC = 0x00800, /* M10x HDLC processing */
82 DEBUG_WRITE = 0x01000, /* M105 data write */
Tilman Schmidt784d5852006-04-10 22:55:04 -070083 DEBUG_TRANSCMD = 0x02000, /* AT-COMMANDS+RESPONSES */
84 DEBUG_MCMD = 0x04000, /* COMMANDS THAT ARE SENT VERY OFTEN */
Tilman Schmidt917f5082006-04-10 22:55:00 -070085 DEBUG_INIT = 0x08000, /* (de)allocation+initialization of data
86 structures */
Tilman Schmidtc652cbd2008-02-06 01:38:24 -080087 DEBUG_SUSPEND = 0x10000, /* suspend/resume processing */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080088 DEBUG_OUTPUT = 0x20000, /* output to device */
Tilman Schmidt784d5852006-04-10 22:55:04 -070089 DEBUG_ISO = 0x40000, /* isochronous transfers */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080090 DEBUG_IF = 0x80000, /* character device operations */
Tilman Schmidt917f5082006-04-10 22:55:00 -070091 DEBUG_USBREQ = 0x100000, /* USB communication (except payload
92 data) */
Tilman Schmidt784d5852006-04-10 22:55:04 -070093 DEBUG_LOCKCMD = 0x200000, /* AT commands and responses when
Tilman Schmidt917f5082006-04-10 22:55:00 -070094 MS_LOCKED */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080095
Tilman Schmidt917f5082006-04-10 22:55:00 -070096 DEBUG_ANY = 0x3fffff, /* print message if any of the others is
97 activated */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -080098};
99
Tilman Schmidt784d5852006-04-10 22:55:04 -0700100/* Kernel message macros for situations where dev_printk and friends cannot be
101 * used for lack of reliable access to a device structure.
102 * linux/usb.h already contains these but in an obsolete form which clutters
103 * the log needlessly, and according to the USB maintainer those should be
104 * removed rather than fixed anyway.
105 */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800106#undef err
Tilman Schmidt784d5852006-04-10 22:55:04 -0700107#undef info
108#undef warn
109#undef notice
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800110
Tilman Schmidt784d5852006-04-10 22:55:04 -0700111#define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \
112 format "\n" , ## arg)
113#define info(format, arg...) printk(KERN_INFO KBUILD_MODNAME ": " \
114 format "\n" , ## arg)
115#define warn(format, arg...) printk(KERN_WARNING KBUILD_MODNAME ": " \
116 format "\n" , ## arg)
117#define notice(format, arg...) printk(KERN_NOTICE KBUILD_MODNAME ": " \
118 format "\n" , ## arg)
119
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800120#ifdef CONFIG_GIGASET_DEBUG
Tilman Schmidt784d5852006-04-10 22:55:04 -0700121
122#define gig_dbg(level, format, arg...) \
Tilman Schmidt917f5082006-04-10 22:55:00 -0700123 do { \
124 if (unlikely(((enum debuglevel)gigaset_debuglevel) & (level))) \
Tilman Schmidt784d5852006-04-10 22:55:04 -0700125 printk(KERN_DEBUG KBUILD_MODNAME ": " format "\n", \
126 ## arg); \
Tilman Schmidt917f5082006-04-10 22:55:00 -0700127 } while (0)
Tilman Schmidt73a88812006-04-22 02:35:30 -0700128#define DEBUG_DEFAULT (DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ)
Tilman Schmidt784d5852006-04-10 22:55:04 -0700129
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800130#else
Tilman Schmidt784d5852006-04-10 22:55:04 -0700131
132#define gig_dbg(level, format, arg...) do {} while (0)
133#define DEBUG_DEFAULT 0
134
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800135#endif
136
137void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
Tilman Schmidt01371502006-04-10 22:55:11 -0700138 size_t len, const unsigned char *buf);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800139
140/* connection state */
141#define ZSAU_NONE 0
142#define ZSAU_DISCONNECT_IND 4
143#define ZSAU_OUTGOING_CALL_PROCEEDING 1
144#define ZSAU_PROCEEDING 1
145#define ZSAU_CALL_DELIVERED 2
146#define ZSAU_ACTIVE 3
147#define ZSAU_NULL 5
148#define ZSAU_DISCONNECT_REQ 6
149#define ZSAU_UNKNOWN -1
150
151/* USB control transfer requests */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700152#define OUT_VENDOR_REQ (USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT)
153#define IN_VENDOR_REQ (USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800154
155/* int-in-events 3070 */
156#define HD_B1_FLOW_CONTROL 0x80
157#define HD_B2_FLOW_CONTROL 0x81
Tilman Schmidt917f5082006-04-10 22:55:00 -0700158#define HD_RECEIVEATDATA_ACK (0x35) // 3070
159 // att: HD_RECEIVE>>AT<<DATA_ACK
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800160#define HD_READY_SEND_ATDATA (0x36) // 3070
161#define HD_OPEN_ATCHANNEL_ACK (0x37) // 3070
162#define HD_CLOSE_ATCHANNEL_ACK (0x38) // 3070
163#define HD_DEVICE_INIT_OK (0x11) // ISurf USB + 3070
164#define HD_OPEN_B1CHANNEL_ACK (0x51) // ISurf USB + 3070
165#define HD_OPEN_B2CHANNEL_ACK (0x52) // ISurf USB + 3070
166#define HD_CLOSE_B1CHANNEL_ACK (0x53) // ISurf USB + 3070
167#define HD_CLOSE_B2CHANNEL_ACK (0x54) // ISurf USB + 3070
168// Powermangment
169#define HD_SUSPEND_END (0x61) // ISurf USB
170// Configuration
171#define HD_RESET_INTERRUPT_PIPE_ACK (0xFF) // ISurf USB + 3070
172
173/* control requests 3070 */
174#define HD_OPEN_B1CHANNEL (0x23) // ISurf USB + 3070
175#define HD_CLOSE_B1CHANNEL (0x24) // ISurf USB + 3070
176#define HD_OPEN_B2CHANNEL (0x25) // ISurf USB + 3070
177#define HD_CLOSE_B2CHANNEL (0x26) // ISurf USB + 3070
178#define HD_RESET_INTERRUPT_PIPE (0x27) // ISurf USB + 3070
179#define HD_DEVICE_INIT_ACK (0x34) // ISurf USB + 3070
180#define HD_WRITE_ATMESSAGE (0x12) // 3070
181#define HD_READ_ATMESSAGE (0x13) // 3070
182#define HD_OPEN_ATCHANNEL (0x28) // 3070
183#define HD_CLOSE_ATCHANNEL (0x29) // 3070
184
Tilman Schmidtc652cbd2008-02-06 01:38:24 -0800185/* number of B channels supported by base driver */
186#define BAS_CHANNELS 2
187
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800188/* USB frames for isochronous transfer */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700189#define BAS_FRAMETIME 1 /* number of milliseconds between frames */
190#define BAS_NUMFRAMES 8 /* number of frames per URB */
191#define BAS_MAXFRAME 16 /* allocated bytes per frame */
192#define BAS_NORMFRAME 8 /* send size without flow control */
193#define BAS_HIGHFRAME 10 /* " " with positive flow control */
194#define BAS_LOWFRAME 5 /* " " with negative flow control */
195#define BAS_CORRFRAMES 4 /* flow control multiplicator */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800196
Tilman Schmidt917f5082006-04-10 22:55:00 -0700197#define BAS_INBUFSIZE (BAS_MAXFRAME * BAS_NUMFRAMES)
198 /* size of isoc in buf per URB */
199#define BAS_OUTBUFSIZE 4096 /* size of common isoc out buffer */
200#define BAS_OUTBUFPAD BAS_MAXFRAME /* size of pad area for isoc out buf */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800201
202#define BAS_INURBS 3
203#define BAS_OUTURBS 3
204
205/* variable commands in struct bc_state */
206#define AT_ISO 0
207#define AT_DIAL 1
208#define AT_MSN 2
209#define AT_BC 3
210#define AT_PROTO 4
211#define AT_TYPE 5
212#define AT_HLC 6
213#define AT_NUM 7
214
215/* variables in struct at_state_t */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700216#define VAR_ZSAU 0
217#define VAR_ZDLE 1
218#define VAR_ZVLS 2
219#define VAR_ZCTP 3
220#define VAR_NUM 4
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800221
Tilman Schmidt917f5082006-04-10 22:55:00 -0700222#define STR_NMBR 0
223#define STR_ZCPN 1
224#define STR_ZCON 2
225#define STR_ZBC 3
226#define STR_ZHLC 4
227#define STR_NUM 5
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800228
Tilman Schmidt917f5082006-04-10 22:55:00 -0700229#define EV_TIMEOUT -105
230#define EV_IF_VER -106
231#define EV_PROC_CIDMODE -107
232#define EV_SHUTDOWN -108
233#define EV_START -110
234#define EV_STOP -111
235#define EV_IF_LOCK -112
236#define EV_PROTO_L2 -113
237#define EV_ACCEPT -114
238#define EV_DIAL -115
239#define EV_HUP -116
240#define EV_BC_OPEN -117
241#define EV_BC_CLOSED -118
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800242
243/* input state */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700244#define INS_command 0x0001
245#define INS_DLE_char 0x0002
246#define INS_byte_stuff 0x0004
247#define INS_have_data 0x0008
248#define INS_skip_frame 0x0010
249#define INS_DLE_command 0x0020
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800250#define INS_flag_hunt 0x0040
251
252/* channel state */
253#define CHS_D_UP 0x01
254#define CHS_B_UP 0x02
255#define CHS_NOTIFY_LL 0x04
256
Tilman Schmidt917f5082006-04-10 22:55:00 -0700257#define ICALL_REJECT 0
258#define ICALL_ACCEPT 1
259#define ICALL_IGNORE 2
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800260
261/* device state */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700262#define MS_UNINITIALIZED 0
263#define MS_INIT 1
264#define MS_LOCKED 2
265#define MS_SHUTDOWN 3
266#define MS_RECOVER 4
267#define MS_READY 5
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800268
269/* mode */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700270#define M_UNKNOWN 0
271#define M_CONFIG 1
272#define M_UNIMODEM 2
273#define M_CID 3
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800274
275/* start mode */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700276#define SM_LOCKED 0
277#define SM_ISDN 1 /* default */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800278
279struct gigaset_ops;
280struct gigaset_driver;
281
282struct usb_cardstate;
283struct ser_cardstate;
284struct bas_cardstate;
285
286struct bc_state;
287struct usb_bc_state;
288struct ser_bc_state;
289struct bas_bc_state;
290
291struct reply_t {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700292 int resp_code; /* RSP_XXXX */
293 int min_ConState; /* <0 => ignore */
294 int max_ConState; /* <0 => ignore */
295 int parameter; /* e.g. ZSAU_XXXX <0: ignore*/
296 int new_ConState; /* <0 => ignore */
297 int timeout; /* >0 => *HZ; <=0 => TOUT_XXXX*/
298 int action[MAXACT]; /* ACT_XXXX */
299 char *command; /* NULL==none */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800300};
301
302extern struct reply_t gigaset_tab_cid_m10x[];
303extern struct reply_t gigaset_tab_nocid_m10x[];
304
305struct inbuf_t {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700306 unsigned char *rcvbuf; /* usb-gigaset receive buffer */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800307 struct bc_state *bcs;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700308 struct cardstate *cs;
309 int inputstate;
Tilman Schmidt9d4bee22008-02-06 01:38:28 -0800310 int head, tail;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700311 unsigned char data[RBUFSIZE];
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800312};
313
314/* isochronous write buffer structure
315 * circular buffer with pad area for extraction of complete USB frames
316 * - data[read..nextread-1] is valid data already submitted to the USB subsystem
317 * - data[nextread..write-1] is valid data yet to be sent
318 * - data[write] is the next byte to write to
319 * - in byte-oriented L2 procotols, it is completely free
320 * - in bit-oriented L2 procotols, it may contain a partial byte of valid data
321 * - data[write+1..read-1] is free
322 * - wbits is the number of valid data bits in data[write], starting at the LSB
323 * - writesem is the semaphore for writing to the buffer:
324 * if writesem <= 0, data[write..read-1] is currently being written to
325 * - idle contains the byte value to repeat when the end of valid data is
326 * reached; if nextread==write (buffer contains no data to send), either the
Tilman Schmidt917f5082006-04-10 22:55:00 -0700327 * BAS_OUTBUFPAD bytes immediately before data[write] (if
328 * write>=BAS_OUTBUFPAD) or those of the pad area (if write<BAS_OUTBUFPAD)
329 * are also filled with that value
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800330 */
331struct isowbuf_t {
Tilman Schmidt9d4bee22008-02-06 01:38:28 -0800332 int read;
333 int nextread;
334 int write;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800335 atomic_t writesem;
336 int wbits;
337 unsigned char data[BAS_OUTBUFSIZE + BAS_OUTBUFPAD];
338 unsigned char idle;
339};
340
341/* isochronous write URB context structure
342 * data to be stored along with the URB and retrieved when it is returned
343 * as completed by the USB subsystem
344 * - urb: pointer to the URB itself
345 * - bcs: pointer to the B Channel control structure
346 * - limit: end of write buffer area covered by this URB
Tilman Schmidtdbd98232008-02-06 01:38:23 -0800347 * - status: URB completion status
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800348 */
349struct isow_urbctx_t {
350 struct urb *urb;
351 struct bc_state *bcs;
352 int limit;
Tilman Schmidtdbd98232008-02-06 01:38:23 -0800353 int status;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800354};
355
356/* AT state structure
357 * data associated with the state of an ISDN connection, whether or not
358 * it is currently assigned a B channel
359 */
360struct at_state_t {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700361 struct list_head list;
362 int waiting;
363 int getstring;
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700364 unsigned timer_index;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800365 unsigned long timer_expires;
366 int timer_active;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700367 unsigned int ConState; /* State of connection */
368 struct reply_t *replystruct;
369 int cid;
370 int int_var[VAR_NUM]; /* see VAR_XXXX */
371 char *str_var[STR_NUM]; /* see STR_XXXX */
372 unsigned pending_commands; /* see PC_XXXX */
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700373 unsigned seq_index;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800374
Tilman Schmidt917f5082006-04-10 22:55:00 -0700375 struct cardstate *cs;
376 struct bc_state *bcs;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800377};
378
379struct resp_type_t {
380 unsigned char *response;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700381 int resp_code; /* RSP_XXXX */
382 int type; /* RT_XXXX */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800383};
384
385struct event_t {
386 int type;
387 void *ptr, *arg;
388 int parameter;
389 int cid;
390 struct at_state_t *at_state;
391};
392
393/* This buffer holds all information about the used B-Channel */
394struct bc_state {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700395 struct sk_buff *tx_skb; /* Current transfer buffer to modem */
396 struct sk_buff_head squeue; /* B-Channel send Queue */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800397
398 /* Variables for debugging .. */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700399 int corrupted; /* Counter for corrupted packages */
400 int trans_down; /* Counter of packages (downstream) */
401 int trans_up; /* Counter of packages (upstream) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800402
403 struct at_state_t at_state;
404 unsigned long rcvbytes;
405
406 __u16 fcs;
407 struct sk_buff *skb;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700408 int inputstate; /* see INS_XXXX */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800409
410 int channel;
411
412 struct cardstate *cs;
413
Tilman Schmidt917f5082006-04-10 22:55:00 -0700414 unsigned chstate; /* bitmap (CHS_*) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800415 int ignore;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700416 unsigned proto2; /* Layer 2 protocol (ISDN_PROTO_L2_*) */
417 char *commands[AT_NUM]; /* see AT_XXXX */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800418
419#ifdef CONFIG_GIGASET_DEBUG
420 int emptycount;
421#endif
422 int busy;
423 int use_count;
424
Tilman Schmidt784d5852006-04-10 22:55:04 -0700425 /* private data of hardware drivers */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800426 union {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700427 struct ser_bc_state *ser; /* serial hardware driver */
428 struct usb_bc_state *usb; /* usb hardware driver (m105) */
429 struct bas_bc_state *bas; /* usb hardware driver (base) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800430 } hw;
431};
432
433struct cardstate {
434 struct gigaset_driver *driver;
435 unsigned minor_index;
Tilman Schmidt784d5852006-04-10 22:55:04 -0700436 struct device *dev;
Greg Kroah-Hartman01107d32006-08-07 22:19:37 -0700437 struct device *tty_dev;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800438
439 const struct gigaset_ops *ops;
440
441 /* Stuff to handle communication */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800442 wait_queue_head_t waitqueue;
443 int waiting;
Tilman Schmidt9d4bee22008-02-06 01:38:28 -0800444 int mode; /* see M_XXXX */
445 int mstate; /* Modem state: see MS_XXXX */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700446 /* only changed by the event layer */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800447 int cmd_result;
448
449 int channels;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700450 struct bc_state *bcs; /* Array of struct bc_state */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800451
Tilman Schmidt917f5082006-04-10 22:55:00 -0700452 int onechannel; /* data and commands transmitted in one
453 stream (M10x) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800454
455 spinlock_t lock;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700456 struct at_state_t at_state; /* at_state_t for cid == 0 */
457 struct list_head temp_at_states;/* list of temporary "struct
458 at_state_t"s without B channel */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800459
460 struct inbuf_t *inbuf;
461
462 struct cmdbuf_t *cmdbuf, *lastcmdbuf;
463 spinlock_t cmdlock;
464 unsigned curlen, cmdbytes;
465
466 unsigned open_count;
467 struct tty_struct *tty;
468 struct tasklet_struct if_wake_tasklet;
469 unsigned control_state;
470
471 unsigned fwver[4];
472 int gotfwver;
473
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700474 unsigned running; /* !=0 if events are handled */
475 unsigned connected; /* !=0 if hardware is connected */
476 unsigned isdn_up; /* !=0 after ISDN_STAT_RUN */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800477
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700478 unsigned cidmode;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800479
Tilman Schmidt917f5082006-04-10 22:55:00 -0700480 int myid; /* id for communication with LL */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800481 isdn_if iif;
482
483 struct reply_t *tabnocid;
484 struct reply_t *tabcid;
485 int cs_init;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700486 int ignoreframes; /* frames to ignore after setting up the
487 B channel */
Tilman Schmidtabfd1dc2006-04-10 22:55:12 -0700488 struct mutex mutex; /* locks this structure:
Tilman Schmidt784d5852006-04-10 22:55:04 -0700489 * connected is not changed,
490 * hardware_up is not changed,
491 * MState is not changed to or from
492 * MS_LOCKED */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800493
494 struct timer_list timer;
495 int retry_count;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700496 int dle; /* !=0 if modem commands/responses are
497 dle encoded */
498 int cur_at_seq; /* sequence of AT commands being
499 processed */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700500 int curchannel; /* channel those commands are meant
Tilman Schmidt917f5082006-04-10 22:55:00 -0700501 for */
Tilman Schmidt9d4bee22008-02-06 01:38:28 -0800502 int commands_pending; /* flag(s) in xxx.commands_pending have
Tilman Schmidt917f5082006-04-10 22:55:00 -0700503 been set */
504 struct tasklet_struct event_tasklet;
505 /* tasklet for serializing AT commands.
506 * Scheduled
507 * -> for modem reponses (and
Tilman Schmidt784d5852006-04-10 22:55:04 -0700508 * incoming data for M10x)
Tilman Schmidt917f5082006-04-10 22:55:00 -0700509 * -> on timeout
510 * -> after setting bits in
511 * xxx.at_state.pending_command
512 * (e.g. command from LL) */
513 struct tasklet_struct write_tasklet;
514 /* tasklet for serial output
515 * (not used in base driver) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800516
517 /* event queue */
518 struct event_t events[MAX_EVENTS];
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700519 unsigned ev_tail, ev_head;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800520 spinlock_t ev_lock;
521
522 /* current modem response */
523 unsigned char respdata[MAX_RESP_SIZE];
524 unsigned cbytes;
525
Tilman Schmidt784d5852006-04-10 22:55:04 -0700526 /* private data of hardware drivers */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800527 union {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700528 struct usb_cardstate *usb; /* USB hardware driver (m105) */
529 struct ser_cardstate *ser; /* serial hardware driver */
530 struct bas_cardstate *bas; /* USB hardware driver (base) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800531 } hw;
532};
533
534struct gigaset_driver {
535 struct list_head list;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700536 spinlock_t lock; /* locks minor tables and blocked */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800537 struct tty_driver *tty;
538 unsigned have_tty;
539 unsigned minor;
540 unsigned minors;
541 struct cardstate *cs;
542 unsigned *flags;
543 int blocked;
544
545 const struct gigaset_ops *ops;
546 struct module *owner;
547};
548
549struct cmdbuf_t {
550 struct cmdbuf_t *next, *prev;
551 int len, offset;
552 struct tasklet_struct *wake_tasklet;
553 unsigned char buf[0];
554};
555
556struct bas_bc_state {
557 /* isochronous output state */
Tilman Schmidt9d4bee22008-02-06 01:38:28 -0800558 int running;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800559 atomic_t corrbytes;
560 spinlock_t isooutlock;
561 struct isow_urbctx_t isoouturbs[BAS_OUTURBS];
562 struct isow_urbctx_t *isooutdone, *isooutfree, *isooutovfl;
563 struct isowbuf_t *isooutbuf;
Tilman Schmidt784d5852006-04-10 22:55:04 -0700564 unsigned numsub; /* submitted URB counter
565 (for diagnostic messages only) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800566 struct tasklet_struct sent_tasklet;
567
568 /* isochronous input state */
569 spinlock_t isoinlock;
570 struct urb *isoinurbs[BAS_INURBS];
571 unsigned char isoinbuf[BAS_INBUFSIZE * BAS_INURBS];
Tilman Schmidt784d5852006-04-10 22:55:04 -0700572 struct urb *isoindone; /* completed isoc read URB */
Tilman Schmidtdbd98232008-02-06 01:38:23 -0800573 int isoinstatus; /* status of completed URB */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700574 int loststatus; /* status of dropped URB */
575 unsigned isoinlost; /* number of bytes lost */
576 /* state of bit unstuffing algorithm
577 (in addition to BC_state.inputstate) */
578 unsigned seqlen; /* number of '1' bits not yet
579 unstuffed */
580 unsigned inbyte, inbits; /* collected bits for next byte */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800581 /* statistics */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700582 unsigned goodbytes; /* bytes correctly received */
583 unsigned alignerrs; /* frames with incomplete byte at end */
584 unsigned fcserrs; /* FCS errors */
585 unsigned frameerrs; /* framing errors */
586 unsigned giants; /* long frames */
587 unsigned runts; /* short frames */
588 unsigned aborts; /* HDLC aborts */
589 unsigned shared0s; /* '0' bits shared between flags */
590 unsigned stolen0s; /* '0' stuff bits also serving as
591 leading flag bits */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800592 struct tasklet_struct rcvd_tasklet;
593};
594
595struct gigaset_ops {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700596 /* Called from ev-layer.c/interface.c for sending AT commands to the
597 device */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800598 int (*write_cmd)(struct cardstate *cs,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700599 const unsigned char *buf, int len,
600 struct tasklet_struct *wake_tasklet);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800601
602 /* Called from interface.c for additional device control */
603 int (*write_room)(struct cardstate *cs);
604 int (*chars_in_buffer)(struct cardstate *cs);
605 int (*brkchars)(struct cardstate *cs, const unsigned char buf[6]);
606
607 /* Called from ev-layer.c after setting up connection
608 * Should call gigaset_bchannel_up(), when finished. */
609 int (*init_bchannel)(struct bc_state *bcs);
610
611 /* Called from ev-layer.c after hanging up
612 * Should call gigaset_bchannel_down(), when finished. */
613 int (*close_bchannel)(struct bc_state *bcs);
614
615 /* Called by gigaset_initcs() for setting up bcs->hw.xxx */
616 int (*initbcshw)(struct bc_state *bcs);
617
618 /* Called by gigaset_freecs() for freeing bcs->hw.xxx */
619 int (*freebcshw)(struct bc_state *bcs);
620
Tilman Schmidt73a88812006-04-22 02:35:30 -0700621 /* Called by gigaset_bchannel_down() for resetting bcs->hw.xxx */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800622 void (*reinitbcshw)(struct bc_state *bcs);
623
624 /* Called by gigaset_initcs() for setting up cs->hw.xxx */
625 int (*initcshw)(struct cardstate *cs);
626
627 /* Called by gigaset_freecs() for freeing cs->hw.xxx */
628 void (*freecshw)(struct cardstate *cs);
629
Tilman Schmidt917f5082006-04-10 22:55:00 -0700630 /* Called from common.c/interface.c for additional serial port
631 control */
632 int (*set_modem_ctrl)(struct cardstate *cs, unsigned old_state,
633 unsigned new_state);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800634 int (*baud_rate)(struct cardstate *cs, unsigned cflag);
635 int (*set_line_ctrl)(struct cardstate *cs, unsigned cflag);
636
637 /* Called from i4l.c to put an skb into the send-queue. */
638 int (*send_skb)(struct bc_state *bcs, struct sk_buff *skb);
639
640 /* Called from ev-layer.c to process a block of data
641 * received through the common/control channel. */
642 void (*handle_input)(struct inbuf_t *inbuf);
643
644};
645
646/* = Common structures and definitions ======================================= */
647
648/* Parser states for DLE-Event:
649 * <DLE-EVENT>: <DLE_FLAG> "X" <EVENT> <DLE_FLAG> "."
650 * <DLE_FLAG>: 0x10
651 * <EVENT>: ((a-z)* | (A-Z)* | (0-10)*)+
652 */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700653#define DLE_FLAG 0x10
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800654
655/* ===========================================================================
656 * Functions implemented in asyncdata.c
657 */
658
659/* Called from i4l.c to put an skb into the send-queue.
660 * After sending gigaset_skb_sent() should be called. */
661int gigaset_m10x_send_skb(struct bc_state *bcs, struct sk_buff *skb);
662
663/* Called from ev-layer.c to process a block of data
664 * received through the common/control channel. */
665void gigaset_m10x_input(struct inbuf_t *inbuf);
666
667/* ===========================================================================
668 * Functions implemented in isocdata.c
669 */
670
671/* Called from i4l.c to put an skb into the send-queue.
672 * After sending gigaset_skb_sent() should be called. */
673int gigaset_isoc_send_skb(struct bc_state *bcs, struct sk_buff *skb);
674
675/* Called from ev-layer.c to process a block of data
676 * received through the common/control channel. */
677void gigaset_isoc_input(struct inbuf_t *inbuf);
678
679/* Called from bas-gigaset.c to process a block of data
680 * received through the isochronous channel */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700681void gigaset_isoc_receive(unsigned char *src, unsigned count,
682 struct bc_state *bcs);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800683
684/* Called from bas-gigaset.c to put a block of data
685 * into the isochronous output buffer */
686int gigaset_isoc_buildframe(struct bc_state *bcs, unsigned char *in, int len);
687
688/* Called from bas-gigaset.c to initialize the isochronous output buffer */
689void gigaset_isowbuf_init(struct isowbuf_t *iwb, unsigned char idle);
690
691/* Called from bas-gigaset.c to retrieve a block of bytes for sending */
692int gigaset_isowbuf_getbytes(struct isowbuf_t *iwb, int size);
693
694/* ===========================================================================
695 * Functions implemented in i4l.c/gigaset.h
696 */
697
698/* Called by gigaset_initcs() for setting up with the isdn4linux subsystem */
699int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid);
700
701/* Called from xxx-gigaset.c to indicate completion of sending an skb */
702void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb);
703
704/* Called from common.c/ev-layer.c to indicate events relevant to the LL */
705int gigaset_isdn_icall(struct at_state_t *at_state);
706int gigaset_isdn_setup_accept(struct at_state_t *at_state);
707int gigaset_isdn_setup_dial(struct at_state_t *at_state, void *data);
708
709void gigaset_i4l_cmd(struct cardstate *cs, int cmd);
710void gigaset_i4l_channel_cmd(struct bc_state *bcs, int cmd);
711
712
713static inline void gigaset_isdn_rcv_err(struct bc_state *bcs)
714{
715 isdn_ctrl response;
716
717 /* error -> LL */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700718 gig_dbg(DEBUG_CMD, "sending L1ERR");
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800719 response.driver = bcs->cs->myid;
720 response.command = ISDN_STAT_L1ERR;
721 response.arg = bcs->channel;
722 response.parm.errcode = ISDN_STAT_L1ERR_RECV;
723 bcs->cs->iif.statcallb(&response);
724}
725
726/* ===========================================================================
727 * Functions implemented in ev-layer.c
728 */
729
730/* tasklet called from common.c to process queued events */
731void gigaset_handle_event(unsigned long data);
732
733/* called from isocdata.c / asyncdata.c
734 * when a complete modem response line has been received */
735void gigaset_handle_modem_response(struct cardstate *cs);
736
737/* ===========================================================================
738 * Functions implemented in proc.c
739 */
740
741/* initialize sysfs for device */
Tilman Schmidtb1d47462006-04-10 22:55:07 -0700742void gigaset_init_dev_sysfs(struct cardstate *cs);
743void gigaset_free_dev_sysfs(struct cardstate *cs);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800744
745/* ===========================================================================
746 * Functions implemented in common.c/gigaset.h
747 */
748
749void gigaset_bcs_reinit(struct bc_state *bcs);
750void gigaset_at_init(struct at_state_t *at_state, struct bc_state *bcs,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700751 struct cardstate *cs, int cid);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800752int gigaset_get_channel(struct bc_state *bcs);
753void gigaset_free_channel(struct bc_state *bcs);
754int gigaset_get_channels(struct cardstate *cs);
755void gigaset_free_channels(struct cardstate *cs);
756void gigaset_block_channels(struct cardstate *cs);
757
758/* Allocate and initialize driver structure. */
759struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700760 const char *procname,
761 const char *devname,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700762 const struct gigaset_ops *ops,
763 struct module *owner);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800764
765/* Deallocate driver structure. */
766void gigaset_freedriver(struct gigaset_driver *drv);
767void gigaset_debugdrivers(void);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800768struct cardstate *gigaset_get_cs_by_tty(struct tty_struct *tty);
769struct cardstate *gigaset_get_cs_by_id(int id);
770
771/* For drivers without fixed assignment device<->cardstate (usb) */
772struct cardstate *gigaset_getunassignedcs(struct gigaset_driver *drv);
773void gigaset_unassign(struct cardstate *cs);
774void gigaset_blockdriver(struct gigaset_driver *drv);
775
Tilman Schmidt917f5082006-04-10 22:55:00 -0700776/* Allocate and initialize card state. Calls hardware dependent
777 gigaset_init[b]cs(). */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800778struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
779 int onechannel, int ignoreframes,
780 int cidmode, const char *modulename);
781
782/* Free card state. Calls hardware dependent gigaset_free[b]cs(). */
783void gigaset_freecs(struct cardstate *cs);
784
785/* Tell common.c that hardware and driver are ready. */
786int gigaset_start(struct cardstate *cs);
787
788/* Tell common.c that the device is not present any more. */
789void gigaset_stop(struct cardstate *cs);
790
791/* Tell common.c that the driver is being unloaded. */
792void gigaset_shutdown(struct cardstate *cs);
793
794/* Tell common.c that an skb has been sent. */
795void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb);
796
797/* Append event to the queue.
798 * Returns NULL on failure or a pointer to the event on success.
799 * ptr must be kmalloc()ed (and not be freed by the caller).
800 */
801struct event_t *gigaset_add_event(struct cardstate *cs,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700802 struct at_state_t *at_state, int type,
803 void *ptr, int parameter, void *arg);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800804
805/* Called on CONFIG1 command from frontend. */
806int gigaset_enterconfigmode(struct cardstate *cs); //0: success <0: errorcode
807
808/* cs->lock must not be locked */
809static inline void gigaset_schedule_event(struct cardstate *cs)
810{
811 unsigned long flags;
812 spin_lock_irqsave(&cs->lock, flags);
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700813 if (cs->running)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800814 tasklet_schedule(&cs->event_tasklet);
815 spin_unlock_irqrestore(&cs->lock, flags);
816}
817
818/* Tell common.c that B channel has been closed. */
819/* cs->lock must not be locked */
820static inline void gigaset_bchannel_down(struct bc_state *bcs)
821{
822 gigaset_add_event(bcs->cs, &bcs->at_state, EV_BC_CLOSED, NULL, 0, NULL);
823
Tilman Schmidt784d5852006-04-10 22:55:04 -0700824 gig_dbg(DEBUG_CMD, "scheduling BC_CLOSED");
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800825 gigaset_schedule_event(bcs->cs);
826}
827
828/* Tell common.c that B channel has been opened. */
829/* cs->lock must not be locked */
830static inline void gigaset_bchannel_up(struct bc_state *bcs)
831{
832 gigaset_add_event(bcs->cs, &bcs->at_state, EV_BC_OPEN, NULL, 0, NULL);
833
Tilman Schmidt784d5852006-04-10 22:55:04 -0700834 gig_dbg(DEBUG_CMD, "scheduling BC_OPEN");
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800835 gigaset_schedule_event(bcs->cs);
836}
837
838/* handling routines for sk_buff */
839/* ============================= */
840
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800841/* pass received skb to LL
842 * Warning: skb must not be accessed anymore!
843 */
844static inline void gigaset_rcv_skb(struct sk_buff *skb,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700845 struct cardstate *cs,
846 struct bc_state *bcs)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800847{
848 cs->iif.rcvcallb_skb(cs->myid, bcs->channel, skb);
849 bcs->trans_down++;
850}
851
852/* handle reception of corrupted skb
853 * Warning: skb must not be accessed anymore!
854 */
855static inline void gigaset_rcv_error(struct sk_buff *procskb,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700856 struct cardstate *cs,
857 struct bc_state *bcs)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800858{
859 if (procskb)
860 dev_kfree_skb(procskb);
861
862 if (bcs->ignore)
863 --bcs->ignore;
864 else {
865 ++bcs->corrupted;
866 gigaset_isdn_rcv_err(bcs);
867 }
868}
869
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800870/* append received bytes to inbuf */
Tilman Schmidt714e8232006-04-10 22:55:09 -0700871int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src,
872 unsigned numbytes);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800873
874/* ===========================================================================
875 * Functions implemented in interface.c
876 */
877
878/* initialize interface */
879void gigaset_if_initdriver(struct gigaset_driver *drv, const char *procname,
Greg Kroah-Hartmanf4eaa372005-06-20 21:15:16 -0700880 const char *devname);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800881/* release interface */
882void gigaset_if_freedriver(struct gigaset_driver *drv);
883/* add minor */
884void gigaset_if_init(struct cardstate *cs);
885/* remove minor */
886void gigaset_if_free(struct cardstate *cs);
887/* device received data */
888void gigaset_if_receive(struct cardstate *cs,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700889 unsigned char *buffer, size_t len);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800890
891#endif