blob: 003752954993cffa46534a2a3a95383fcddd8645 [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
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800109
Tilman Schmidt784d5852006-04-10 22:55:04 -0700110#define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \
111 format "\n" , ## arg)
112#define info(format, arg...) printk(KERN_INFO KBUILD_MODNAME ": " \
113 format "\n" , ## arg)
114#define warn(format, arg...) printk(KERN_WARNING KBUILD_MODNAME ": " \
115 format "\n" , ## arg)
Tilman Schmidt784d5852006-04-10 22:55:04 -0700116
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800117#ifdef CONFIG_GIGASET_DEBUG
Tilman Schmidt784d5852006-04-10 22:55:04 -0700118
119#define gig_dbg(level, format, arg...) \
Tilman Schmidt917f5082006-04-10 22:55:00 -0700120 do { \
121 if (unlikely(((enum debuglevel)gigaset_debuglevel) & (level))) \
Tilman Schmidt784d5852006-04-10 22:55:04 -0700122 printk(KERN_DEBUG KBUILD_MODNAME ": " format "\n", \
123 ## arg); \
Tilman Schmidt917f5082006-04-10 22:55:00 -0700124 } while (0)
Tilman Schmidt73a88812006-04-22 02:35:30 -0700125#define DEBUG_DEFAULT (DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ)
Tilman Schmidt784d5852006-04-10 22:55:04 -0700126
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800127#else
Tilman Schmidt784d5852006-04-10 22:55:04 -0700128
129#define gig_dbg(level, format, arg...) do {} while (0)
130#define DEBUG_DEFAULT 0
131
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800132#endif
133
134void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
Tilman Schmidt01371502006-04-10 22:55:11 -0700135 size_t len, const unsigned char *buf);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800136
137/* connection state */
138#define ZSAU_NONE 0
139#define ZSAU_DISCONNECT_IND 4
140#define ZSAU_OUTGOING_CALL_PROCEEDING 1
141#define ZSAU_PROCEEDING 1
142#define ZSAU_CALL_DELIVERED 2
143#define ZSAU_ACTIVE 3
144#define ZSAU_NULL 5
145#define ZSAU_DISCONNECT_REQ 6
146#define ZSAU_UNKNOWN -1
147
148/* USB control transfer requests */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700149#define OUT_VENDOR_REQ (USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT)
150#define IN_VENDOR_REQ (USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800151
152/* int-in-events 3070 */
153#define HD_B1_FLOW_CONTROL 0x80
154#define HD_B2_FLOW_CONTROL 0x81
Tilman Schmidt917f5082006-04-10 22:55:00 -0700155#define HD_RECEIVEATDATA_ACK (0x35) // 3070
156 // att: HD_RECEIVE>>AT<<DATA_ACK
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800157#define HD_READY_SEND_ATDATA (0x36) // 3070
158#define HD_OPEN_ATCHANNEL_ACK (0x37) // 3070
159#define HD_CLOSE_ATCHANNEL_ACK (0x38) // 3070
160#define HD_DEVICE_INIT_OK (0x11) // ISurf USB + 3070
161#define HD_OPEN_B1CHANNEL_ACK (0x51) // ISurf USB + 3070
162#define HD_OPEN_B2CHANNEL_ACK (0x52) // ISurf USB + 3070
163#define HD_CLOSE_B1CHANNEL_ACK (0x53) // ISurf USB + 3070
164#define HD_CLOSE_B2CHANNEL_ACK (0x54) // ISurf USB + 3070
165// Powermangment
166#define HD_SUSPEND_END (0x61) // ISurf USB
167// Configuration
168#define HD_RESET_INTERRUPT_PIPE_ACK (0xFF) // ISurf USB + 3070
169
170/* control requests 3070 */
171#define HD_OPEN_B1CHANNEL (0x23) // ISurf USB + 3070
172#define HD_CLOSE_B1CHANNEL (0x24) // ISurf USB + 3070
173#define HD_OPEN_B2CHANNEL (0x25) // ISurf USB + 3070
174#define HD_CLOSE_B2CHANNEL (0x26) // ISurf USB + 3070
175#define HD_RESET_INTERRUPT_PIPE (0x27) // ISurf USB + 3070
176#define HD_DEVICE_INIT_ACK (0x34) // ISurf USB + 3070
177#define HD_WRITE_ATMESSAGE (0x12) // 3070
178#define HD_READ_ATMESSAGE (0x13) // 3070
179#define HD_OPEN_ATCHANNEL (0x28) // 3070
180#define HD_CLOSE_ATCHANNEL (0x29) // 3070
181
Tilman Schmidtc652cbd2008-02-06 01:38:24 -0800182/* number of B channels supported by base driver */
183#define BAS_CHANNELS 2
184
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800185/* USB frames for isochronous transfer */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700186#define BAS_FRAMETIME 1 /* number of milliseconds between frames */
187#define BAS_NUMFRAMES 8 /* number of frames per URB */
188#define BAS_MAXFRAME 16 /* allocated bytes per frame */
189#define BAS_NORMFRAME 8 /* send size without flow control */
190#define BAS_HIGHFRAME 10 /* " " with positive flow control */
191#define BAS_LOWFRAME 5 /* " " with negative flow control */
192#define BAS_CORRFRAMES 4 /* flow control multiplicator */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800193
Tilman Schmidt917f5082006-04-10 22:55:00 -0700194#define BAS_INBUFSIZE (BAS_MAXFRAME * BAS_NUMFRAMES)
195 /* size of isoc in buf per URB */
196#define BAS_OUTBUFSIZE 4096 /* size of common isoc out buffer */
197#define BAS_OUTBUFPAD BAS_MAXFRAME /* size of pad area for isoc out buf */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800198
199#define BAS_INURBS 3
200#define BAS_OUTURBS 3
201
202/* variable commands in struct bc_state */
203#define AT_ISO 0
204#define AT_DIAL 1
205#define AT_MSN 2
206#define AT_BC 3
207#define AT_PROTO 4
208#define AT_TYPE 5
209#define AT_HLC 6
210#define AT_NUM 7
211
212/* variables in struct at_state_t */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700213#define VAR_ZSAU 0
214#define VAR_ZDLE 1
215#define VAR_ZVLS 2
216#define VAR_ZCTP 3
217#define VAR_NUM 4
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800218
Tilman Schmidt917f5082006-04-10 22:55:00 -0700219#define STR_NMBR 0
220#define STR_ZCPN 1
221#define STR_ZCON 2
222#define STR_ZBC 3
223#define STR_ZHLC 4
224#define STR_NUM 5
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800225
Tilman Schmidt917f5082006-04-10 22:55:00 -0700226#define EV_TIMEOUT -105
227#define EV_IF_VER -106
228#define EV_PROC_CIDMODE -107
229#define EV_SHUTDOWN -108
230#define EV_START -110
231#define EV_STOP -111
232#define EV_IF_LOCK -112
233#define EV_PROTO_L2 -113
234#define EV_ACCEPT -114
235#define EV_DIAL -115
236#define EV_HUP -116
237#define EV_BC_OPEN -117
238#define EV_BC_CLOSED -118
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800239
240/* input state */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700241#define INS_command 0x0001
242#define INS_DLE_char 0x0002
243#define INS_byte_stuff 0x0004
244#define INS_have_data 0x0008
245#define INS_skip_frame 0x0010
246#define INS_DLE_command 0x0020
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800247#define INS_flag_hunt 0x0040
248
249/* channel state */
250#define CHS_D_UP 0x01
251#define CHS_B_UP 0x02
252#define CHS_NOTIFY_LL 0x04
253
Tilman Schmidt917f5082006-04-10 22:55:00 -0700254#define ICALL_REJECT 0
255#define ICALL_ACCEPT 1
256#define ICALL_IGNORE 2
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800257
258/* device state */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700259#define MS_UNINITIALIZED 0
260#define MS_INIT 1
261#define MS_LOCKED 2
262#define MS_SHUTDOWN 3
263#define MS_RECOVER 4
264#define MS_READY 5
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800265
266/* mode */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700267#define M_UNKNOWN 0
268#define M_CONFIG 1
269#define M_UNIMODEM 2
270#define M_CID 3
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800271
272/* start mode */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700273#define SM_LOCKED 0
274#define SM_ISDN 1 /* default */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800275
276struct gigaset_ops;
277struct gigaset_driver;
278
279struct usb_cardstate;
280struct ser_cardstate;
281struct bas_cardstate;
282
283struct bc_state;
284struct usb_bc_state;
285struct ser_bc_state;
286struct bas_bc_state;
287
288struct reply_t {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700289 int resp_code; /* RSP_XXXX */
290 int min_ConState; /* <0 => ignore */
291 int max_ConState; /* <0 => ignore */
292 int parameter; /* e.g. ZSAU_XXXX <0: ignore*/
293 int new_ConState; /* <0 => ignore */
294 int timeout; /* >0 => *HZ; <=0 => TOUT_XXXX*/
295 int action[MAXACT]; /* ACT_XXXX */
296 char *command; /* NULL==none */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800297};
298
299extern struct reply_t gigaset_tab_cid_m10x[];
300extern struct reply_t gigaset_tab_nocid_m10x[];
301
302struct inbuf_t {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700303 unsigned char *rcvbuf; /* usb-gigaset receive buffer */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800304 struct bc_state *bcs;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700305 struct cardstate *cs;
306 int inputstate;
Tilman Schmidt9d4bee22008-02-06 01:38:28 -0800307 int head, tail;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700308 unsigned char data[RBUFSIZE];
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800309};
310
311/* isochronous write buffer structure
312 * circular buffer with pad area for extraction of complete USB frames
313 * - data[read..nextread-1] is valid data already submitted to the USB subsystem
314 * - data[nextread..write-1] is valid data yet to be sent
315 * - data[write] is the next byte to write to
316 * - in byte-oriented L2 procotols, it is completely free
317 * - in bit-oriented L2 procotols, it may contain a partial byte of valid data
318 * - data[write+1..read-1] is free
319 * - wbits is the number of valid data bits in data[write], starting at the LSB
320 * - writesem is the semaphore for writing to the buffer:
321 * if writesem <= 0, data[write..read-1] is currently being written to
322 * - idle contains the byte value to repeat when the end of valid data is
323 * reached; if nextread==write (buffer contains no data to send), either the
Tilman Schmidt917f5082006-04-10 22:55:00 -0700324 * BAS_OUTBUFPAD bytes immediately before data[write] (if
325 * write>=BAS_OUTBUFPAD) or those of the pad area (if write<BAS_OUTBUFPAD)
326 * are also filled with that value
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800327 */
328struct isowbuf_t {
Tilman Schmidt9d4bee22008-02-06 01:38:28 -0800329 int read;
330 int nextread;
331 int write;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800332 atomic_t writesem;
333 int wbits;
334 unsigned char data[BAS_OUTBUFSIZE + BAS_OUTBUFPAD];
335 unsigned char idle;
336};
337
338/* isochronous write URB context structure
339 * data to be stored along with the URB and retrieved when it is returned
340 * as completed by the USB subsystem
341 * - urb: pointer to the URB itself
342 * - bcs: pointer to the B Channel control structure
343 * - limit: end of write buffer area covered by this URB
Tilman Schmidtdbd98232008-02-06 01:38:23 -0800344 * - status: URB completion status
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800345 */
346struct isow_urbctx_t {
347 struct urb *urb;
348 struct bc_state *bcs;
349 int limit;
Tilman Schmidtdbd98232008-02-06 01:38:23 -0800350 int status;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800351};
352
353/* AT state structure
354 * data associated with the state of an ISDN connection, whether or not
355 * it is currently assigned a B channel
356 */
357struct at_state_t {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700358 struct list_head list;
359 int waiting;
360 int getstring;
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700361 unsigned timer_index;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800362 unsigned long timer_expires;
363 int timer_active;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700364 unsigned int ConState; /* State of connection */
365 struct reply_t *replystruct;
366 int cid;
367 int int_var[VAR_NUM]; /* see VAR_XXXX */
368 char *str_var[STR_NUM]; /* see STR_XXXX */
369 unsigned pending_commands; /* see PC_XXXX */
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700370 unsigned seq_index;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800371
Tilman Schmidt917f5082006-04-10 22:55:00 -0700372 struct cardstate *cs;
373 struct bc_state *bcs;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800374};
375
376struct resp_type_t {
377 unsigned char *response;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700378 int resp_code; /* RSP_XXXX */
379 int type; /* RT_XXXX */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800380};
381
382struct event_t {
383 int type;
384 void *ptr, *arg;
385 int parameter;
386 int cid;
387 struct at_state_t *at_state;
388};
389
390/* This buffer holds all information about the used B-Channel */
391struct bc_state {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700392 struct sk_buff *tx_skb; /* Current transfer buffer to modem */
393 struct sk_buff_head squeue; /* B-Channel send Queue */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800394
395 /* Variables for debugging .. */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700396 int corrupted; /* Counter for corrupted packages */
397 int trans_down; /* Counter of packages (downstream) */
398 int trans_up; /* Counter of packages (upstream) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800399
400 struct at_state_t at_state;
401 unsigned long rcvbytes;
402
403 __u16 fcs;
404 struct sk_buff *skb;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700405 int inputstate; /* see INS_XXXX */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800406
407 int channel;
408
409 struct cardstate *cs;
410
Tilman Schmidt917f5082006-04-10 22:55:00 -0700411 unsigned chstate; /* bitmap (CHS_*) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800412 int ignore;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700413 unsigned proto2; /* Layer 2 protocol (ISDN_PROTO_L2_*) */
414 char *commands[AT_NUM]; /* see AT_XXXX */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800415
416#ifdef CONFIG_GIGASET_DEBUG
417 int emptycount;
418#endif
419 int busy;
420 int use_count;
421
Tilman Schmidt784d5852006-04-10 22:55:04 -0700422 /* private data of hardware drivers */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800423 union {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700424 struct ser_bc_state *ser; /* serial hardware driver */
425 struct usb_bc_state *usb; /* usb hardware driver (m105) */
426 struct bas_bc_state *bas; /* usb hardware driver (base) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800427 } hw;
428};
429
430struct cardstate {
431 struct gigaset_driver *driver;
432 unsigned minor_index;
Tilman Schmidt784d5852006-04-10 22:55:04 -0700433 struct device *dev;
Greg Kroah-Hartman01107d32006-08-07 22:19:37 -0700434 struct device *tty_dev;
Tilman Schmidte468c042008-02-06 01:38:29 -0800435 unsigned flags;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800436
437 const struct gigaset_ops *ops;
438
439 /* Stuff to handle communication */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800440 wait_queue_head_t waitqueue;
441 int waiting;
Tilman Schmidt9d4bee22008-02-06 01:38:28 -0800442 int mode; /* see M_XXXX */
443 int mstate; /* Modem state: see MS_XXXX */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700444 /* only changed by the event layer */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800445 int cmd_result;
446
447 int channels;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700448 struct bc_state *bcs; /* Array of struct bc_state */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800449
Tilman Schmidt917f5082006-04-10 22:55:00 -0700450 int onechannel; /* data and commands transmitted in one
451 stream (M10x) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800452
453 spinlock_t lock;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700454 struct at_state_t at_state; /* at_state_t for cid == 0 */
455 struct list_head temp_at_states;/* list of temporary "struct
456 at_state_t"s without B channel */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800457
458 struct inbuf_t *inbuf;
459
460 struct cmdbuf_t *cmdbuf, *lastcmdbuf;
461 spinlock_t cmdlock;
462 unsigned curlen, cmdbytes;
463
464 unsigned open_count;
465 struct tty_struct *tty;
466 struct tasklet_struct if_wake_tasklet;
467 unsigned control_state;
468
469 unsigned fwver[4];
470 int gotfwver;
471
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700472 unsigned running; /* !=0 if events are handled */
473 unsigned connected; /* !=0 if hardware is connected */
474 unsigned isdn_up; /* !=0 after ISDN_STAT_RUN */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800475
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700476 unsigned cidmode;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800477
Tilman Schmidt917f5082006-04-10 22:55:00 -0700478 int myid; /* id for communication with LL */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800479 isdn_if iif;
480
481 struct reply_t *tabnocid;
482 struct reply_t *tabcid;
483 int cs_init;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700484 int ignoreframes; /* frames to ignore after setting up the
485 B channel */
Tilman Schmidtabfd1dc2006-04-10 22:55:12 -0700486 struct mutex mutex; /* locks this structure:
Tilman Schmidt784d5852006-04-10 22:55:04 -0700487 * connected is not changed,
488 * hardware_up is not changed,
489 * MState is not changed to or from
490 * MS_LOCKED */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800491
492 struct timer_list timer;
493 int retry_count;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700494 int dle; /* !=0 if modem commands/responses are
495 dle encoded */
496 int cur_at_seq; /* sequence of AT commands being
497 processed */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700498 int curchannel; /* channel those commands are meant
Tilman Schmidt917f5082006-04-10 22:55:00 -0700499 for */
Tilman Schmidt9d4bee22008-02-06 01:38:28 -0800500 int commands_pending; /* flag(s) in xxx.commands_pending have
Tilman Schmidt917f5082006-04-10 22:55:00 -0700501 been set */
502 struct tasklet_struct event_tasklet;
503 /* tasklet for serializing AT commands.
504 * Scheduled
505 * -> for modem reponses (and
Tilman Schmidt784d5852006-04-10 22:55:04 -0700506 * incoming data for M10x)
Tilman Schmidt917f5082006-04-10 22:55:00 -0700507 * -> on timeout
508 * -> after setting bits in
509 * xxx.at_state.pending_command
510 * (e.g. command from LL) */
511 struct tasklet_struct write_tasklet;
512 /* tasklet for serial output
513 * (not used in base driver) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800514
515 /* event queue */
516 struct event_t events[MAX_EVENTS];
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700517 unsigned ev_tail, ev_head;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800518 spinlock_t ev_lock;
519
520 /* current modem response */
521 unsigned char respdata[MAX_RESP_SIZE];
522 unsigned cbytes;
523
Tilman Schmidt784d5852006-04-10 22:55:04 -0700524 /* private data of hardware drivers */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800525 union {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700526 struct usb_cardstate *usb; /* USB hardware driver (m105) */
527 struct ser_cardstate *ser; /* serial hardware driver */
528 struct bas_cardstate *bas; /* USB hardware driver (base) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800529 } hw;
530};
531
532struct gigaset_driver {
533 struct list_head list;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700534 spinlock_t lock; /* locks minor tables and blocked */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800535 struct tty_driver *tty;
536 unsigned have_tty;
537 unsigned minor;
538 unsigned minors;
539 struct cardstate *cs;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800540 int blocked;
541
542 const struct gigaset_ops *ops;
543 struct module *owner;
544};
545
546struct cmdbuf_t {
547 struct cmdbuf_t *next, *prev;
548 int len, offset;
549 struct tasklet_struct *wake_tasklet;
550 unsigned char buf[0];
551};
552
553struct bas_bc_state {
554 /* isochronous output state */
Tilman Schmidt9d4bee22008-02-06 01:38:28 -0800555 int running;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800556 atomic_t corrbytes;
557 spinlock_t isooutlock;
558 struct isow_urbctx_t isoouturbs[BAS_OUTURBS];
559 struct isow_urbctx_t *isooutdone, *isooutfree, *isooutovfl;
560 struct isowbuf_t *isooutbuf;
Tilman Schmidt784d5852006-04-10 22:55:04 -0700561 unsigned numsub; /* submitted URB counter
562 (for diagnostic messages only) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800563 struct tasklet_struct sent_tasklet;
564
565 /* isochronous input state */
566 spinlock_t isoinlock;
567 struct urb *isoinurbs[BAS_INURBS];
568 unsigned char isoinbuf[BAS_INBUFSIZE * BAS_INURBS];
Tilman Schmidt784d5852006-04-10 22:55:04 -0700569 struct urb *isoindone; /* completed isoc read URB */
Tilman Schmidtdbd98232008-02-06 01:38:23 -0800570 int isoinstatus; /* status of completed URB */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700571 int loststatus; /* status of dropped URB */
572 unsigned isoinlost; /* number of bytes lost */
573 /* state of bit unstuffing algorithm
574 (in addition to BC_state.inputstate) */
575 unsigned seqlen; /* number of '1' bits not yet
576 unstuffed */
577 unsigned inbyte, inbits; /* collected bits for next byte */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800578 /* statistics */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700579 unsigned goodbytes; /* bytes correctly received */
580 unsigned alignerrs; /* frames with incomplete byte at end */
581 unsigned fcserrs; /* FCS errors */
582 unsigned frameerrs; /* framing errors */
583 unsigned giants; /* long frames */
584 unsigned runts; /* short frames */
585 unsigned aborts; /* HDLC aborts */
586 unsigned shared0s; /* '0' bits shared between flags */
587 unsigned stolen0s; /* '0' stuff bits also serving as
588 leading flag bits */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800589 struct tasklet_struct rcvd_tasklet;
590};
591
592struct gigaset_ops {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700593 /* Called from ev-layer.c/interface.c for sending AT commands to the
594 device */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800595 int (*write_cmd)(struct cardstate *cs,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700596 const unsigned char *buf, int len,
597 struct tasklet_struct *wake_tasklet);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800598
599 /* Called from interface.c for additional device control */
600 int (*write_room)(struct cardstate *cs);
601 int (*chars_in_buffer)(struct cardstate *cs);
602 int (*brkchars)(struct cardstate *cs, const unsigned char buf[6]);
603
604 /* Called from ev-layer.c after setting up connection
605 * Should call gigaset_bchannel_up(), when finished. */
606 int (*init_bchannel)(struct bc_state *bcs);
607
608 /* Called from ev-layer.c after hanging up
609 * Should call gigaset_bchannel_down(), when finished. */
610 int (*close_bchannel)(struct bc_state *bcs);
611
612 /* Called by gigaset_initcs() for setting up bcs->hw.xxx */
613 int (*initbcshw)(struct bc_state *bcs);
614
615 /* Called by gigaset_freecs() for freeing bcs->hw.xxx */
616 int (*freebcshw)(struct bc_state *bcs);
617
Tilman Schmidt73a88812006-04-22 02:35:30 -0700618 /* Called by gigaset_bchannel_down() for resetting bcs->hw.xxx */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800619 void (*reinitbcshw)(struct bc_state *bcs);
620
621 /* Called by gigaset_initcs() for setting up cs->hw.xxx */
622 int (*initcshw)(struct cardstate *cs);
623
624 /* Called by gigaset_freecs() for freeing cs->hw.xxx */
625 void (*freecshw)(struct cardstate *cs);
626
Tilman Schmidt917f5082006-04-10 22:55:00 -0700627 /* Called from common.c/interface.c for additional serial port
628 control */
629 int (*set_modem_ctrl)(struct cardstate *cs, unsigned old_state,
630 unsigned new_state);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800631 int (*baud_rate)(struct cardstate *cs, unsigned cflag);
632 int (*set_line_ctrl)(struct cardstate *cs, unsigned cflag);
633
634 /* Called from i4l.c to put an skb into the send-queue. */
635 int (*send_skb)(struct bc_state *bcs, struct sk_buff *skb);
636
637 /* Called from ev-layer.c to process a block of data
638 * received through the common/control channel. */
639 void (*handle_input)(struct inbuf_t *inbuf);
640
641};
642
643/* = Common structures and definitions ======================================= */
644
645/* Parser states for DLE-Event:
646 * <DLE-EVENT>: <DLE_FLAG> "X" <EVENT> <DLE_FLAG> "."
647 * <DLE_FLAG>: 0x10
648 * <EVENT>: ((a-z)* | (A-Z)* | (0-10)*)+
649 */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700650#define DLE_FLAG 0x10
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800651
652/* ===========================================================================
653 * Functions implemented in asyncdata.c
654 */
655
656/* Called from i4l.c to put an skb into the send-queue.
657 * After sending gigaset_skb_sent() should be called. */
658int gigaset_m10x_send_skb(struct bc_state *bcs, struct sk_buff *skb);
659
660/* Called from ev-layer.c to process a block of data
661 * received through the common/control channel. */
662void gigaset_m10x_input(struct inbuf_t *inbuf);
663
664/* ===========================================================================
665 * Functions implemented in isocdata.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_isoc_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_isoc_input(struct inbuf_t *inbuf);
675
676/* Called from bas-gigaset.c to process a block of data
677 * received through the isochronous channel */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700678void gigaset_isoc_receive(unsigned char *src, unsigned count,
679 struct bc_state *bcs);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800680
681/* Called from bas-gigaset.c to put a block of data
682 * into the isochronous output buffer */
683int gigaset_isoc_buildframe(struct bc_state *bcs, unsigned char *in, int len);
684
685/* Called from bas-gigaset.c to initialize the isochronous output buffer */
686void gigaset_isowbuf_init(struct isowbuf_t *iwb, unsigned char idle);
687
688/* Called from bas-gigaset.c to retrieve a block of bytes for sending */
689int gigaset_isowbuf_getbytes(struct isowbuf_t *iwb, int size);
690
691/* ===========================================================================
692 * Functions implemented in i4l.c/gigaset.h
693 */
694
695/* Called by gigaset_initcs() for setting up with the isdn4linux subsystem */
696int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid);
697
698/* Called from xxx-gigaset.c to indicate completion of sending an skb */
699void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb);
700
701/* Called from common.c/ev-layer.c to indicate events relevant to the LL */
702int gigaset_isdn_icall(struct at_state_t *at_state);
703int gigaset_isdn_setup_accept(struct at_state_t *at_state);
704int gigaset_isdn_setup_dial(struct at_state_t *at_state, void *data);
705
706void gigaset_i4l_cmd(struct cardstate *cs, int cmd);
707void gigaset_i4l_channel_cmd(struct bc_state *bcs, int cmd);
708
709
710static inline void gigaset_isdn_rcv_err(struct bc_state *bcs)
711{
712 isdn_ctrl response;
713
714 /* error -> LL */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700715 gig_dbg(DEBUG_CMD, "sending L1ERR");
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800716 response.driver = bcs->cs->myid;
717 response.command = ISDN_STAT_L1ERR;
718 response.arg = bcs->channel;
719 response.parm.errcode = ISDN_STAT_L1ERR_RECV;
720 bcs->cs->iif.statcallb(&response);
721}
722
723/* ===========================================================================
724 * Functions implemented in ev-layer.c
725 */
726
727/* tasklet called from common.c to process queued events */
728void gigaset_handle_event(unsigned long data);
729
730/* called from isocdata.c / asyncdata.c
731 * when a complete modem response line has been received */
732void gigaset_handle_modem_response(struct cardstate *cs);
733
734/* ===========================================================================
735 * Functions implemented in proc.c
736 */
737
738/* initialize sysfs for device */
Tilman Schmidtb1d47462006-04-10 22:55:07 -0700739void gigaset_init_dev_sysfs(struct cardstate *cs);
740void gigaset_free_dev_sysfs(struct cardstate *cs);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800741
742/* ===========================================================================
743 * Functions implemented in common.c/gigaset.h
744 */
745
746void gigaset_bcs_reinit(struct bc_state *bcs);
747void gigaset_at_init(struct at_state_t *at_state, struct bc_state *bcs,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700748 struct cardstate *cs, int cid);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800749int gigaset_get_channel(struct bc_state *bcs);
750void gigaset_free_channel(struct bc_state *bcs);
751int gigaset_get_channels(struct cardstate *cs);
752void gigaset_free_channels(struct cardstate *cs);
753void gigaset_block_channels(struct cardstate *cs);
754
755/* Allocate and initialize driver structure. */
756struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700757 const char *procname,
758 const char *devname,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700759 const struct gigaset_ops *ops,
760 struct module *owner);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800761
762/* Deallocate driver structure. */
763void gigaset_freedriver(struct gigaset_driver *drv);
764void gigaset_debugdrivers(void);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800765struct cardstate *gigaset_get_cs_by_tty(struct tty_struct *tty);
766struct cardstate *gigaset_get_cs_by_id(int id);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800767void gigaset_blockdriver(struct gigaset_driver *drv);
768
Tilman Schmidt917f5082006-04-10 22:55:00 -0700769/* Allocate and initialize card state. Calls hardware dependent
770 gigaset_init[b]cs(). */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800771struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
772 int onechannel, int ignoreframes,
773 int cidmode, const char *modulename);
774
775/* Free card state. Calls hardware dependent gigaset_free[b]cs(). */
776void gigaset_freecs(struct cardstate *cs);
777
778/* Tell common.c that hardware and driver are ready. */
779int gigaset_start(struct cardstate *cs);
780
781/* Tell common.c that the device is not present any more. */
782void gigaset_stop(struct cardstate *cs);
783
784/* Tell common.c that the driver is being unloaded. */
Tilman Schmidte468c042008-02-06 01:38:29 -0800785int gigaset_shutdown(struct cardstate *cs);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800786
787/* Tell common.c that an skb has been sent. */
788void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb);
789
790/* Append event to the queue.
791 * Returns NULL on failure or a pointer to the event on success.
792 * ptr must be kmalloc()ed (and not be freed by the caller).
793 */
794struct event_t *gigaset_add_event(struct cardstate *cs,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700795 struct at_state_t *at_state, int type,
796 void *ptr, int parameter, void *arg);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800797
798/* Called on CONFIG1 command from frontend. */
799int gigaset_enterconfigmode(struct cardstate *cs); //0: success <0: errorcode
800
801/* cs->lock must not be locked */
802static inline void gigaset_schedule_event(struct cardstate *cs)
803{
804 unsigned long flags;
805 spin_lock_irqsave(&cs->lock, flags);
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700806 if (cs->running)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800807 tasklet_schedule(&cs->event_tasklet);
808 spin_unlock_irqrestore(&cs->lock, flags);
809}
810
811/* Tell common.c that B channel has been closed. */
812/* cs->lock must not be locked */
813static inline void gigaset_bchannel_down(struct bc_state *bcs)
814{
815 gigaset_add_event(bcs->cs, &bcs->at_state, EV_BC_CLOSED, NULL, 0, NULL);
816
Tilman Schmidt784d5852006-04-10 22:55:04 -0700817 gig_dbg(DEBUG_CMD, "scheduling BC_CLOSED");
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800818 gigaset_schedule_event(bcs->cs);
819}
820
821/* Tell common.c that B channel has been opened. */
822/* cs->lock must not be locked */
823static inline void gigaset_bchannel_up(struct bc_state *bcs)
824{
825 gigaset_add_event(bcs->cs, &bcs->at_state, EV_BC_OPEN, NULL, 0, NULL);
826
Tilman Schmidt784d5852006-04-10 22:55:04 -0700827 gig_dbg(DEBUG_CMD, "scheduling BC_OPEN");
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800828 gigaset_schedule_event(bcs->cs);
829}
830
831/* handling routines for sk_buff */
832/* ============================= */
833
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800834/* pass received skb to LL
835 * Warning: skb must not be accessed anymore!
836 */
837static inline void gigaset_rcv_skb(struct sk_buff *skb,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700838 struct cardstate *cs,
839 struct bc_state *bcs)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800840{
841 cs->iif.rcvcallb_skb(cs->myid, bcs->channel, skb);
842 bcs->trans_down++;
843}
844
845/* handle reception of corrupted skb
846 * Warning: skb must not be accessed anymore!
847 */
848static inline void gigaset_rcv_error(struct sk_buff *procskb,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700849 struct cardstate *cs,
850 struct bc_state *bcs)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800851{
852 if (procskb)
853 dev_kfree_skb(procskb);
854
855 if (bcs->ignore)
856 --bcs->ignore;
857 else {
858 ++bcs->corrupted;
859 gigaset_isdn_rcv_err(bcs);
860 }
861}
862
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800863/* append received bytes to inbuf */
Tilman Schmidt714e8232006-04-10 22:55:09 -0700864int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src,
865 unsigned numbytes);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800866
867/* ===========================================================================
868 * Functions implemented in interface.c
869 */
870
871/* initialize interface */
872void gigaset_if_initdriver(struct gigaset_driver *drv, const char *procname,
Greg Kroah-Hartmanf4eaa372005-06-20 21:15:16 -0700873 const char *devname);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800874/* release interface */
875void gigaset_if_freedriver(struct gigaset_driver *drv);
876/* add minor */
877void gigaset_if_init(struct cardstate *cs);
878/* remove minor */
879void gigaset_if_free(struct cardstate *cs);
880/* device received data */
881void gigaset_if_receive(struct cardstate *cs,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700882 unsigned char *buffer, size_t len);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800883
884#endif