blob: c67b5f97c133e18096516598a512b2366014c550 [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 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/* Kernel message macros for situations where dev_printk and friends cannot be
110 * used for lack of reliable access to a device structure.
111 * linux/usb.h already contains these but in an obsolete form which clutters
112 * the log needlessly, and according to the USB maintainer those should be
113 * removed rather than fixed anyway.
114 */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800115#undef err
Tilman Schmidt784d5852006-04-10 22:55:04 -0700116#undef info
117#undef warn
118#undef notice
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800119
Tilman Schmidt784d5852006-04-10 22:55:04 -0700120#define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \
121 format "\n" , ## arg)
122#define info(format, arg...) printk(KERN_INFO KBUILD_MODNAME ": " \
123 format "\n" , ## arg)
124#define warn(format, arg...) printk(KERN_WARNING KBUILD_MODNAME ": " \
125 format "\n" , ## arg)
126#define notice(format, arg...) printk(KERN_NOTICE KBUILD_MODNAME ": " \
127 format "\n" , ## arg)
128
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800129#ifdef CONFIG_GIGASET_DEBUG
Tilman Schmidt784d5852006-04-10 22:55:04 -0700130
131#define gig_dbg(level, format, arg...) \
Tilman Schmidt917f5082006-04-10 22:55:00 -0700132 do { \
133 if (unlikely(((enum debuglevel)gigaset_debuglevel) & (level))) \
Tilman Schmidt784d5852006-04-10 22:55:04 -0700134 printk(KERN_DEBUG KBUILD_MODNAME ": " format "\n", \
135 ## arg); \
Tilman Schmidt917f5082006-04-10 22:55:00 -0700136 } while (0)
Tilman Schmidt73a88812006-04-22 02:35:30 -0700137#define DEBUG_DEFAULT (DEBUG_TRANSCMD | DEBUG_CMD | DEBUG_USBREQ)
Tilman Schmidt784d5852006-04-10 22:55:04 -0700138
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800139#else
Tilman Schmidt784d5852006-04-10 22:55:04 -0700140
141#define gig_dbg(level, format, arg...) do {} while (0)
142#define DEBUG_DEFAULT 0
143
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800144#endif
145
146void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
Tilman Schmidt01371502006-04-10 22:55:11 -0700147 size_t len, const unsigned char *buf);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800148
149/* connection state */
150#define ZSAU_NONE 0
151#define ZSAU_DISCONNECT_IND 4
152#define ZSAU_OUTGOING_CALL_PROCEEDING 1
153#define ZSAU_PROCEEDING 1
154#define ZSAU_CALL_DELIVERED 2
155#define ZSAU_ACTIVE 3
156#define ZSAU_NULL 5
157#define ZSAU_DISCONNECT_REQ 6
158#define ZSAU_UNKNOWN -1
159
160/* USB control transfer requests */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700161#define OUT_VENDOR_REQ (USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT)
162#define IN_VENDOR_REQ (USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800163
164/* int-in-events 3070 */
165#define HD_B1_FLOW_CONTROL 0x80
166#define HD_B2_FLOW_CONTROL 0x81
Tilman Schmidt917f5082006-04-10 22:55:00 -0700167#define HD_RECEIVEATDATA_ACK (0x35) // 3070
168 // att: HD_RECEIVE>>AT<<DATA_ACK
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800169#define HD_READY_SEND_ATDATA (0x36) // 3070
170#define HD_OPEN_ATCHANNEL_ACK (0x37) // 3070
171#define HD_CLOSE_ATCHANNEL_ACK (0x38) // 3070
172#define HD_DEVICE_INIT_OK (0x11) // ISurf USB + 3070
173#define HD_OPEN_B1CHANNEL_ACK (0x51) // ISurf USB + 3070
174#define HD_OPEN_B2CHANNEL_ACK (0x52) // ISurf USB + 3070
175#define HD_CLOSE_B1CHANNEL_ACK (0x53) // ISurf USB + 3070
176#define HD_CLOSE_B2CHANNEL_ACK (0x54) // ISurf USB + 3070
177// Powermangment
178#define HD_SUSPEND_END (0x61) // ISurf USB
179// Configuration
180#define HD_RESET_INTERRUPT_PIPE_ACK (0xFF) // ISurf USB + 3070
181
182/* control requests 3070 */
183#define HD_OPEN_B1CHANNEL (0x23) // ISurf USB + 3070
184#define HD_CLOSE_B1CHANNEL (0x24) // ISurf USB + 3070
185#define HD_OPEN_B2CHANNEL (0x25) // ISurf USB + 3070
186#define HD_CLOSE_B2CHANNEL (0x26) // ISurf USB + 3070
187#define HD_RESET_INTERRUPT_PIPE (0x27) // ISurf USB + 3070
188#define HD_DEVICE_INIT_ACK (0x34) // ISurf USB + 3070
189#define HD_WRITE_ATMESSAGE (0x12) // 3070
190#define HD_READ_ATMESSAGE (0x13) // 3070
191#define HD_OPEN_ATCHANNEL (0x28) // 3070
192#define HD_CLOSE_ATCHANNEL (0x29) // 3070
193
194/* USB frames for isochronous transfer */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700195#define BAS_FRAMETIME 1 /* number of milliseconds between frames */
196#define BAS_NUMFRAMES 8 /* number of frames per URB */
197#define BAS_MAXFRAME 16 /* allocated bytes per frame */
198#define BAS_NORMFRAME 8 /* send size without flow control */
199#define BAS_HIGHFRAME 10 /* " " with positive flow control */
200#define BAS_LOWFRAME 5 /* " " with negative flow control */
201#define BAS_CORRFRAMES 4 /* flow control multiplicator */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800202
Tilman Schmidt917f5082006-04-10 22:55:00 -0700203#define BAS_INBUFSIZE (BAS_MAXFRAME * BAS_NUMFRAMES)
204 /* size of isoc in buf per URB */
205#define BAS_OUTBUFSIZE 4096 /* size of common isoc out buffer */
206#define BAS_OUTBUFPAD BAS_MAXFRAME /* size of pad area for isoc out buf */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800207
208#define BAS_INURBS 3
209#define BAS_OUTURBS 3
210
211/* variable commands in struct bc_state */
212#define AT_ISO 0
213#define AT_DIAL 1
214#define AT_MSN 2
215#define AT_BC 3
216#define AT_PROTO 4
217#define AT_TYPE 5
218#define AT_HLC 6
219#define AT_NUM 7
220
221/* variables in struct at_state_t */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700222#define VAR_ZSAU 0
223#define VAR_ZDLE 1
224#define VAR_ZVLS 2
225#define VAR_ZCTP 3
226#define VAR_NUM 4
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800227
Tilman Schmidt917f5082006-04-10 22:55:00 -0700228#define STR_NMBR 0
229#define STR_ZCPN 1
230#define STR_ZCON 2
231#define STR_ZBC 3
232#define STR_ZHLC 4
233#define STR_NUM 5
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800234
Tilman Schmidt917f5082006-04-10 22:55:00 -0700235#define EV_TIMEOUT -105
236#define EV_IF_VER -106
237#define EV_PROC_CIDMODE -107
238#define EV_SHUTDOWN -108
239#define EV_START -110
240#define EV_STOP -111
241#define EV_IF_LOCK -112
242#define EV_PROTO_L2 -113
243#define EV_ACCEPT -114
244#define EV_DIAL -115
245#define EV_HUP -116
246#define EV_BC_OPEN -117
247#define EV_BC_CLOSED -118
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800248
249/* input state */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700250#define INS_command 0x0001
251#define INS_DLE_char 0x0002
252#define INS_byte_stuff 0x0004
253#define INS_have_data 0x0008
254#define INS_skip_frame 0x0010
255#define INS_DLE_command 0x0020
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800256#define INS_flag_hunt 0x0040
257
258/* channel state */
259#define CHS_D_UP 0x01
260#define CHS_B_UP 0x02
261#define CHS_NOTIFY_LL 0x04
262
Tilman Schmidt917f5082006-04-10 22:55:00 -0700263#define ICALL_REJECT 0
264#define ICALL_ACCEPT 1
265#define ICALL_IGNORE 2
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800266
267/* device state */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700268#define MS_UNINITIALIZED 0
269#define MS_INIT 1
270#define MS_LOCKED 2
271#define MS_SHUTDOWN 3
272#define MS_RECOVER 4
273#define MS_READY 5
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800274
275/* mode */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700276#define M_UNKNOWN 0
277#define M_CONFIG 1
278#define M_UNIMODEM 2
279#define M_CID 3
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800280
281/* start mode */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700282#define SM_LOCKED 0
283#define SM_ISDN 1 /* default */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800284
285struct gigaset_ops;
286struct gigaset_driver;
287
288struct usb_cardstate;
289struct ser_cardstate;
290struct bas_cardstate;
291
292struct bc_state;
293struct usb_bc_state;
294struct ser_bc_state;
295struct bas_bc_state;
296
297struct reply_t {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700298 int resp_code; /* RSP_XXXX */
299 int min_ConState; /* <0 => ignore */
300 int max_ConState; /* <0 => ignore */
301 int parameter; /* e.g. ZSAU_XXXX <0: ignore*/
302 int new_ConState; /* <0 => ignore */
303 int timeout; /* >0 => *HZ; <=0 => TOUT_XXXX*/
304 int action[MAXACT]; /* ACT_XXXX */
305 char *command; /* NULL==none */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800306};
307
308extern struct reply_t gigaset_tab_cid_m10x[];
309extern struct reply_t gigaset_tab_nocid_m10x[];
310
311struct inbuf_t {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700312 unsigned char *rcvbuf; /* usb-gigaset receive buffer */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800313 struct bc_state *bcs;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700314 struct cardstate *cs;
315 int inputstate;
316 atomic_t head, tail;
317 unsigned char data[RBUFSIZE];
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800318};
319
320/* isochronous write buffer structure
321 * circular buffer with pad area for extraction of complete USB frames
322 * - data[read..nextread-1] is valid data already submitted to the USB subsystem
323 * - data[nextread..write-1] is valid data yet to be sent
324 * - data[write] is the next byte to write to
325 * - in byte-oriented L2 procotols, it is completely free
326 * - in bit-oriented L2 procotols, it may contain a partial byte of valid data
327 * - data[write+1..read-1] is free
328 * - wbits is the number of valid data bits in data[write], starting at the LSB
329 * - writesem is the semaphore for writing to the buffer:
330 * if writesem <= 0, data[write..read-1] is currently being written to
331 * - idle contains the byte value to repeat when the end of valid data is
332 * reached; if nextread==write (buffer contains no data to send), either the
Tilman Schmidt917f5082006-04-10 22:55:00 -0700333 * BAS_OUTBUFPAD bytes immediately before data[write] (if
334 * write>=BAS_OUTBUFPAD) or those of the pad area (if write<BAS_OUTBUFPAD)
335 * are also filled with that value
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800336 */
337struct isowbuf_t {
338 atomic_t read;
339 atomic_t nextread;
340 atomic_t write;
341 atomic_t writesem;
342 int wbits;
343 unsigned char data[BAS_OUTBUFSIZE + BAS_OUTBUFPAD];
344 unsigned char idle;
345};
346
347/* isochronous write URB context structure
348 * data to be stored along with the URB and retrieved when it is returned
349 * as completed by the USB subsystem
350 * - urb: pointer to the URB itself
351 * - bcs: pointer to the B Channel control structure
352 * - limit: end of write buffer area covered by this URB
Tilman Schmidtdbd98232008-02-06 01:38:23 -0800353 * - status: URB completion status
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800354 */
355struct isow_urbctx_t {
356 struct urb *urb;
357 struct bc_state *bcs;
358 int limit;
Tilman Schmidtdbd98232008-02-06 01:38:23 -0800359 int status;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800360};
361
362/* AT state structure
363 * data associated with the state of an ISDN connection, whether or not
364 * it is currently assigned a B channel
365 */
366struct at_state_t {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700367 struct list_head list;
368 int waiting;
369 int getstring;
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700370 unsigned timer_index;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800371 unsigned long timer_expires;
372 int timer_active;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700373 unsigned int ConState; /* State of connection */
374 struct reply_t *replystruct;
375 int cid;
376 int int_var[VAR_NUM]; /* see VAR_XXXX */
377 char *str_var[STR_NUM]; /* see STR_XXXX */
378 unsigned pending_commands; /* see PC_XXXX */
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700379 unsigned seq_index;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800380
Tilman Schmidt917f5082006-04-10 22:55:00 -0700381 struct cardstate *cs;
382 struct bc_state *bcs;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800383};
384
385struct resp_type_t {
386 unsigned char *response;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700387 int resp_code; /* RSP_XXXX */
388 int type; /* RT_XXXX */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800389};
390
391struct event_t {
392 int type;
393 void *ptr, *arg;
394 int parameter;
395 int cid;
396 struct at_state_t *at_state;
397};
398
399/* This buffer holds all information about the used B-Channel */
400struct bc_state {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700401 struct sk_buff *tx_skb; /* Current transfer buffer to modem */
402 struct sk_buff_head squeue; /* B-Channel send Queue */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800403
404 /* Variables for debugging .. */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700405 int corrupted; /* Counter for corrupted packages */
406 int trans_down; /* Counter of packages (downstream) */
407 int trans_up; /* Counter of packages (upstream) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800408
409 struct at_state_t at_state;
410 unsigned long rcvbytes;
411
412 __u16 fcs;
413 struct sk_buff *skb;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700414 int inputstate; /* see INS_XXXX */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800415
416 int channel;
417
418 struct cardstate *cs;
419
Tilman Schmidt917f5082006-04-10 22:55:00 -0700420 unsigned chstate; /* bitmap (CHS_*) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800421 int ignore;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700422 unsigned proto2; /* Layer 2 protocol (ISDN_PROTO_L2_*) */
423 char *commands[AT_NUM]; /* see AT_XXXX */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800424
425#ifdef CONFIG_GIGASET_DEBUG
426 int emptycount;
427#endif
428 int busy;
429 int use_count;
430
Tilman Schmidt784d5852006-04-10 22:55:04 -0700431 /* private data of hardware drivers */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800432 union {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700433 struct ser_bc_state *ser; /* serial hardware driver */
434 struct usb_bc_state *usb; /* usb hardware driver (m105) */
435 struct bas_bc_state *bas; /* usb hardware driver (base) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800436 } hw;
437};
438
439struct cardstate {
440 struct gigaset_driver *driver;
441 unsigned minor_index;
Tilman Schmidt784d5852006-04-10 22:55:04 -0700442 struct device *dev;
Greg Kroah-Hartman01107d32006-08-07 22:19:37 -0700443 struct device *tty_dev;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800444
445 const struct gigaset_ops *ops;
446
447 /* Stuff to handle communication */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800448 wait_queue_head_t waitqueue;
449 int waiting;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700450 atomic_t mode; /* see M_XXXX */
451 atomic_t mstate; /* Modem state: see MS_XXXX */
452 /* only changed by the event layer */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800453 int cmd_result;
454
455 int channels;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700456 struct bc_state *bcs; /* Array of struct bc_state */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800457
Tilman Schmidt917f5082006-04-10 22:55:00 -0700458 int onechannel; /* data and commands transmitted in one
459 stream (M10x) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800460
461 spinlock_t lock;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700462 struct at_state_t at_state; /* at_state_t for cid == 0 */
463 struct list_head temp_at_states;/* list of temporary "struct
464 at_state_t"s without B channel */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800465
466 struct inbuf_t *inbuf;
467
468 struct cmdbuf_t *cmdbuf, *lastcmdbuf;
469 spinlock_t cmdlock;
470 unsigned curlen, cmdbytes;
471
472 unsigned open_count;
473 struct tty_struct *tty;
474 struct tasklet_struct if_wake_tasklet;
475 unsigned control_state;
476
477 unsigned fwver[4];
478 int gotfwver;
479
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700480 unsigned running; /* !=0 if events are handled */
481 unsigned connected; /* !=0 if hardware is connected */
482 unsigned isdn_up; /* !=0 after ISDN_STAT_RUN */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800483
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700484 unsigned cidmode;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800485
Tilman Schmidt917f5082006-04-10 22:55:00 -0700486 int myid; /* id for communication with LL */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800487 isdn_if iif;
488
489 struct reply_t *tabnocid;
490 struct reply_t *tabcid;
491 int cs_init;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700492 int ignoreframes; /* frames to ignore after setting up the
493 B channel */
Tilman Schmidtabfd1dc2006-04-10 22:55:12 -0700494 struct mutex mutex; /* locks this structure:
Tilman Schmidt784d5852006-04-10 22:55:04 -0700495 * connected is not changed,
496 * hardware_up is not changed,
497 * MState is not changed to or from
498 * MS_LOCKED */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800499
500 struct timer_list timer;
501 int retry_count;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700502 int dle; /* !=0 if modem commands/responses are
503 dle encoded */
504 int cur_at_seq; /* sequence of AT commands being
505 processed */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700506 int curchannel; /* channel those commands are meant
Tilman Schmidt917f5082006-04-10 22:55:00 -0700507 for */
508 atomic_t commands_pending; /* flag(s) in xxx.commands_pending have
509 been set */
510 struct tasklet_struct event_tasklet;
511 /* tasklet for serializing AT commands.
512 * Scheduled
513 * -> for modem reponses (and
Tilman Schmidt784d5852006-04-10 22:55:04 -0700514 * incoming data for M10x)
Tilman Schmidt917f5082006-04-10 22:55:00 -0700515 * -> on timeout
516 * -> after setting bits in
517 * xxx.at_state.pending_command
518 * (e.g. command from LL) */
519 struct tasklet_struct write_tasklet;
520 /* tasklet for serial output
521 * (not used in base driver) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800522
523 /* event queue */
524 struct event_t events[MAX_EVENTS];
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700525 unsigned ev_tail, ev_head;
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800526 spinlock_t ev_lock;
527
528 /* current modem response */
529 unsigned char respdata[MAX_RESP_SIZE];
530 unsigned cbytes;
531
Tilman Schmidt784d5852006-04-10 22:55:04 -0700532 /* private data of hardware drivers */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800533 union {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700534 struct usb_cardstate *usb; /* USB hardware driver (m105) */
535 struct ser_cardstate *ser; /* serial hardware driver */
536 struct bas_cardstate *bas; /* USB hardware driver (base) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800537 } hw;
538};
539
540struct gigaset_driver {
541 struct list_head list;
Tilman Schmidt917f5082006-04-10 22:55:00 -0700542 spinlock_t lock; /* locks minor tables and blocked */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800543 struct tty_driver *tty;
544 unsigned have_tty;
545 unsigned minor;
546 unsigned minors;
547 struct cardstate *cs;
548 unsigned *flags;
549 int blocked;
550
551 const struct gigaset_ops *ops;
552 struct module *owner;
553};
554
555struct cmdbuf_t {
556 struct cmdbuf_t *next, *prev;
557 int len, offset;
558 struct tasklet_struct *wake_tasklet;
559 unsigned char buf[0];
560};
561
562struct bas_bc_state {
563 /* isochronous output state */
564 atomic_t running;
565 atomic_t corrbytes;
566 spinlock_t isooutlock;
567 struct isow_urbctx_t isoouturbs[BAS_OUTURBS];
568 struct isow_urbctx_t *isooutdone, *isooutfree, *isooutovfl;
569 struct isowbuf_t *isooutbuf;
Tilman Schmidt784d5852006-04-10 22:55:04 -0700570 unsigned numsub; /* submitted URB counter
571 (for diagnostic messages only) */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800572 struct tasklet_struct sent_tasklet;
573
574 /* isochronous input state */
575 spinlock_t isoinlock;
576 struct urb *isoinurbs[BAS_INURBS];
577 unsigned char isoinbuf[BAS_INBUFSIZE * BAS_INURBS];
Tilman Schmidt784d5852006-04-10 22:55:04 -0700578 struct urb *isoindone; /* completed isoc read URB */
Tilman Schmidtdbd98232008-02-06 01:38:23 -0800579 int isoinstatus; /* status of completed URB */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700580 int loststatus; /* status of dropped URB */
581 unsigned isoinlost; /* number of bytes lost */
582 /* state of bit unstuffing algorithm
583 (in addition to BC_state.inputstate) */
584 unsigned seqlen; /* number of '1' bits not yet
585 unstuffed */
586 unsigned inbyte, inbits; /* collected bits for next byte */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800587 /* statistics */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700588 unsigned goodbytes; /* bytes correctly received */
589 unsigned alignerrs; /* frames with incomplete byte at end */
590 unsigned fcserrs; /* FCS errors */
591 unsigned frameerrs; /* framing errors */
592 unsigned giants; /* long frames */
593 unsigned runts; /* short frames */
594 unsigned aborts; /* HDLC aborts */
595 unsigned shared0s; /* '0' bits shared between flags */
596 unsigned stolen0s; /* '0' stuff bits also serving as
597 leading flag bits */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800598 struct tasklet_struct rcvd_tasklet;
599};
600
601struct gigaset_ops {
Tilman Schmidt917f5082006-04-10 22:55:00 -0700602 /* Called from ev-layer.c/interface.c for sending AT commands to the
603 device */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800604 int (*write_cmd)(struct cardstate *cs,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700605 const unsigned char *buf, int len,
606 struct tasklet_struct *wake_tasklet);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800607
608 /* Called from interface.c for additional device control */
609 int (*write_room)(struct cardstate *cs);
610 int (*chars_in_buffer)(struct cardstate *cs);
611 int (*brkchars)(struct cardstate *cs, const unsigned char buf[6]);
612
613 /* Called from ev-layer.c after setting up connection
614 * Should call gigaset_bchannel_up(), when finished. */
615 int (*init_bchannel)(struct bc_state *bcs);
616
617 /* Called from ev-layer.c after hanging up
618 * Should call gigaset_bchannel_down(), when finished. */
619 int (*close_bchannel)(struct bc_state *bcs);
620
621 /* Called by gigaset_initcs() for setting up bcs->hw.xxx */
622 int (*initbcshw)(struct bc_state *bcs);
623
624 /* Called by gigaset_freecs() for freeing bcs->hw.xxx */
625 int (*freebcshw)(struct bc_state *bcs);
626
Tilman Schmidt73a88812006-04-22 02:35:30 -0700627 /* Called by gigaset_bchannel_down() for resetting bcs->hw.xxx */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800628 void (*reinitbcshw)(struct bc_state *bcs);
629
630 /* Called by gigaset_initcs() for setting up cs->hw.xxx */
631 int (*initcshw)(struct cardstate *cs);
632
633 /* Called by gigaset_freecs() for freeing cs->hw.xxx */
634 void (*freecshw)(struct cardstate *cs);
635
Tilman Schmidt917f5082006-04-10 22:55:00 -0700636 /* Called from common.c/interface.c for additional serial port
637 control */
638 int (*set_modem_ctrl)(struct cardstate *cs, unsigned old_state,
639 unsigned new_state);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800640 int (*baud_rate)(struct cardstate *cs, unsigned cflag);
641 int (*set_line_ctrl)(struct cardstate *cs, unsigned cflag);
642
643 /* Called from i4l.c to put an skb into the send-queue. */
644 int (*send_skb)(struct bc_state *bcs, struct sk_buff *skb);
645
646 /* Called from ev-layer.c to process a block of data
647 * received through the common/control channel. */
648 void (*handle_input)(struct inbuf_t *inbuf);
649
650};
651
652/* = Common structures and definitions ======================================= */
653
654/* Parser states for DLE-Event:
655 * <DLE-EVENT>: <DLE_FLAG> "X" <EVENT> <DLE_FLAG> "."
656 * <DLE_FLAG>: 0x10
657 * <EVENT>: ((a-z)* | (A-Z)* | (0-10)*)+
658 */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700659#define DLE_FLAG 0x10
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800660
661/* ===========================================================================
662 * Functions implemented in asyncdata.c
663 */
664
665/* Called from i4l.c to put an skb into the send-queue.
666 * After sending gigaset_skb_sent() should be called. */
667int gigaset_m10x_send_skb(struct bc_state *bcs, struct sk_buff *skb);
668
669/* Called from ev-layer.c to process a block of data
670 * received through the common/control channel. */
671void gigaset_m10x_input(struct inbuf_t *inbuf);
672
673/* ===========================================================================
674 * Functions implemented in isocdata.c
675 */
676
677/* Called from i4l.c to put an skb into the send-queue.
678 * After sending gigaset_skb_sent() should be called. */
679int gigaset_isoc_send_skb(struct bc_state *bcs, struct sk_buff *skb);
680
681/* Called from ev-layer.c to process a block of data
682 * received through the common/control channel. */
683void gigaset_isoc_input(struct inbuf_t *inbuf);
684
685/* Called from bas-gigaset.c to process a block of data
686 * received through the isochronous channel */
Tilman Schmidt917f5082006-04-10 22:55:00 -0700687void gigaset_isoc_receive(unsigned char *src, unsigned count,
688 struct bc_state *bcs);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800689
690/* Called from bas-gigaset.c to put a block of data
691 * into the isochronous output buffer */
692int gigaset_isoc_buildframe(struct bc_state *bcs, unsigned char *in, int len);
693
694/* Called from bas-gigaset.c to initialize the isochronous output buffer */
695void gigaset_isowbuf_init(struct isowbuf_t *iwb, unsigned char idle);
696
697/* Called from bas-gigaset.c to retrieve a block of bytes for sending */
698int gigaset_isowbuf_getbytes(struct isowbuf_t *iwb, int size);
699
700/* ===========================================================================
701 * Functions implemented in i4l.c/gigaset.h
702 */
703
704/* Called by gigaset_initcs() for setting up with the isdn4linux subsystem */
705int gigaset_register_to_LL(struct cardstate *cs, const char *isdnid);
706
707/* Called from xxx-gigaset.c to indicate completion of sending an skb */
708void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb);
709
710/* Called from common.c/ev-layer.c to indicate events relevant to the LL */
711int gigaset_isdn_icall(struct at_state_t *at_state);
712int gigaset_isdn_setup_accept(struct at_state_t *at_state);
713int gigaset_isdn_setup_dial(struct at_state_t *at_state, void *data);
714
715void gigaset_i4l_cmd(struct cardstate *cs, int cmd);
716void gigaset_i4l_channel_cmd(struct bc_state *bcs, int cmd);
717
718
719static inline void gigaset_isdn_rcv_err(struct bc_state *bcs)
720{
721 isdn_ctrl response;
722
723 /* error -> LL */
Tilman Schmidt784d5852006-04-10 22:55:04 -0700724 gig_dbg(DEBUG_CMD, "sending L1ERR");
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800725 response.driver = bcs->cs->myid;
726 response.command = ISDN_STAT_L1ERR;
727 response.arg = bcs->channel;
728 response.parm.errcode = ISDN_STAT_L1ERR_RECV;
729 bcs->cs->iif.statcallb(&response);
730}
731
732/* ===========================================================================
733 * Functions implemented in ev-layer.c
734 */
735
736/* tasklet called from common.c to process queued events */
737void gigaset_handle_event(unsigned long data);
738
739/* called from isocdata.c / asyncdata.c
740 * when a complete modem response line has been received */
741void gigaset_handle_modem_response(struct cardstate *cs);
742
743/* ===========================================================================
744 * Functions implemented in proc.c
745 */
746
747/* initialize sysfs for device */
Tilman Schmidtb1d47462006-04-10 22:55:07 -0700748void gigaset_init_dev_sysfs(struct cardstate *cs);
749void gigaset_free_dev_sysfs(struct cardstate *cs);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800750
751/* ===========================================================================
752 * Functions implemented in common.c/gigaset.h
753 */
754
755void gigaset_bcs_reinit(struct bc_state *bcs);
756void gigaset_at_init(struct at_state_t *at_state, struct bc_state *bcs,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700757 struct cardstate *cs, int cid);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800758int gigaset_get_channel(struct bc_state *bcs);
759void gigaset_free_channel(struct bc_state *bcs);
760int gigaset_get_channels(struct cardstate *cs);
761void gigaset_free_channels(struct cardstate *cs);
762void gigaset_block_channels(struct cardstate *cs);
763
764/* Allocate and initialize driver structure. */
765struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700766 const char *procname,
767 const char *devname,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700768 const struct gigaset_ops *ops,
769 struct module *owner);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800770
771/* Deallocate driver structure. */
772void gigaset_freedriver(struct gigaset_driver *drv);
773void gigaset_debugdrivers(void);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800774struct cardstate *gigaset_get_cs_by_tty(struct tty_struct *tty);
775struct cardstate *gigaset_get_cs_by_id(int id);
776
777/* For drivers without fixed assignment device<->cardstate (usb) */
778struct cardstate *gigaset_getunassignedcs(struct gigaset_driver *drv);
779void gigaset_unassign(struct cardstate *cs);
780void gigaset_blockdriver(struct gigaset_driver *drv);
781
Tilman Schmidt917f5082006-04-10 22:55:00 -0700782/* Allocate and initialize card state. Calls hardware dependent
783 gigaset_init[b]cs(). */
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800784struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
785 int onechannel, int ignoreframes,
786 int cidmode, const char *modulename);
787
788/* Free card state. Calls hardware dependent gigaset_free[b]cs(). */
789void gigaset_freecs(struct cardstate *cs);
790
791/* Tell common.c that hardware and driver are ready. */
792int gigaset_start(struct cardstate *cs);
793
794/* Tell common.c that the device is not present any more. */
795void gigaset_stop(struct cardstate *cs);
796
797/* Tell common.c that the driver is being unloaded. */
798void gigaset_shutdown(struct cardstate *cs);
799
800/* Tell common.c that an skb has been sent. */
801void gigaset_skb_sent(struct bc_state *bcs, struct sk_buff *skb);
802
803/* Append event to the queue.
804 * Returns NULL on failure or a pointer to the event on success.
805 * ptr must be kmalloc()ed (and not be freed by the caller).
806 */
807struct event_t *gigaset_add_event(struct cardstate *cs,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700808 struct at_state_t *at_state, int type,
809 void *ptr, int parameter, void *arg);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800810
811/* Called on CONFIG1 command from frontend. */
812int gigaset_enterconfigmode(struct cardstate *cs); //0: success <0: errorcode
813
814/* cs->lock must not be locked */
815static inline void gigaset_schedule_event(struct cardstate *cs)
816{
817 unsigned long flags;
818 spin_lock_irqsave(&cs->lock, flags);
Tilman Schmidt69049cc2006-04-10 22:55:16 -0700819 if (cs->running)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800820 tasklet_schedule(&cs->event_tasklet);
821 spin_unlock_irqrestore(&cs->lock, flags);
822}
823
824/* Tell common.c that B channel has been closed. */
825/* cs->lock must not be locked */
826static inline void gigaset_bchannel_down(struct bc_state *bcs)
827{
828 gigaset_add_event(bcs->cs, &bcs->at_state, EV_BC_CLOSED, NULL, 0, NULL);
829
Tilman Schmidt784d5852006-04-10 22:55:04 -0700830 gig_dbg(DEBUG_CMD, "scheduling BC_CLOSED");
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800831 gigaset_schedule_event(bcs->cs);
832}
833
834/* Tell common.c that B channel has been opened. */
835/* cs->lock must not be locked */
836static inline void gigaset_bchannel_up(struct bc_state *bcs)
837{
838 gigaset_add_event(bcs->cs, &bcs->at_state, EV_BC_OPEN, NULL, 0, NULL);
839
Tilman Schmidt784d5852006-04-10 22:55:04 -0700840 gig_dbg(DEBUG_CMD, "scheduling BC_OPEN");
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800841 gigaset_schedule_event(bcs->cs);
842}
843
844/* handling routines for sk_buff */
845/* ============================= */
846
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800847/* pass received skb to LL
848 * Warning: skb must not be accessed anymore!
849 */
850static inline void gigaset_rcv_skb(struct sk_buff *skb,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700851 struct cardstate *cs,
852 struct bc_state *bcs)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800853{
854 cs->iif.rcvcallb_skb(cs->myid, bcs->channel, skb);
855 bcs->trans_down++;
856}
857
858/* handle reception of corrupted skb
859 * Warning: skb must not be accessed anymore!
860 */
861static inline void gigaset_rcv_error(struct sk_buff *procskb,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700862 struct cardstate *cs,
863 struct bc_state *bcs)
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800864{
865 if (procskb)
866 dev_kfree_skb(procskb);
867
868 if (bcs->ignore)
869 --bcs->ignore;
870 else {
871 ++bcs->corrupted;
872 gigaset_isdn_rcv_err(bcs);
873 }
874}
875
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800876/* append received bytes to inbuf */
Tilman Schmidt714e8232006-04-10 22:55:09 -0700877int gigaset_fill_inbuf(struct inbuf_t *inbuf, const unsigned char *src,
878 unsigned numbytes);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800879
880/* ===========================================================================
881 * Functions implemented in interface.c
882 */
883
884/* initialize interface */
885void gigaset_if_initdriver(struct gigaset_driver *drv, const char *procname,
Greg Kroah-Hartmanf4eaa372005-06-20 21:15:16 -0700886 const char *devname);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800887/* release interface */
888void gigaset_if_freedriver(struct gigaset_driver *drv);
889/* add minor */
890void gigaset_if_init(struct cardstate *cs);
891/* remove minor */
892void gigaset_if_free(struct cardstate *cs);
893/* device received data */
894void gigaset_if_receive(struct cardstate *cs,
Tilman Schmidt784d5852006-04-10 22:55:04 -0700895 unsigned char *buffer, size_t len);
Hansjoerg Lipp6fd5ea62006-03-26 01:38:29 -0800896
897#endif