2 * cyclomx.h Cyclom 2X WAN Link Driver.
3 * User-level API definitions.
5 * Author: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
7 * Copyright: (c) 1998-2000 Arnaldo Carvalho de Melo
9 * Based on wanpipe.h by Gene Kozin <genek@compuserve.com>
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version
14 * 2 of the License, or (at your option) any later version.
15 * ============================================================================
16 * 1999/05/19 acme wait_queue_head_t wait_stats(support for 2.3.*)
17 * 1999/01/03 acme judicious use of data types
18 * 1998/12/27 acme cleanup: PACKED not needed
19 * 1998/08/08 acme Version 0.0.1
24 #include <linux/config.h>
25 #include <linux/wanrouter.h>
26 #include <linux/spinlock.h>
29 /* Kernel Interface */
31 #include <linux/cycx_drv.h> /* Cyclom 2X support module API definitions */
32 #include <linux/cycx_cfm.h> /* Cyclom 2X firmware module definitions */
33 #ifdef CONFIG_CYCLOMX_X25
34 #include <linux/cycx_x25.h>
38 #define min(a,b) (((a)<(b))?(a):(b))
41 #define max(a,b) (((a)>(b))?(a):(b))
44 #define is_digit(ch) (((ch)>=(unsigned)'0'&&(ch)<=(unsigned)'9')?1:0)
46 /* Adapter Data Space.
47 * This structure is needed because we handle multiple cards, otherwise
48 * static data would do it.
51 char devname
[WAN_DRVNAME_SZ
+1]; /* card name */
52 cycxhw_t hw
; /* hardware configuration */
53 wan_device_t wandev
; /* WAN device data space */
54 u32 open_cnt
; /* number of open interfaces */
55 u32 state_tick
; /* link state timestamp */
57 char in_isr
; /* interrupt-in-service flag */
58 char buff_int_mode_unbusy
; /* flag for carrying out dev_tint */
59 #if (LINUX_VERSION_CODE >= 0x20300)
60 wait_queue_head_t wait_stats
; /* to wait for the STATS indication */
62 struct wait_queue
* wait_stats
; /* to wait for the STATS indication */
64 u32 mbox
; /* -> mailbox */
65 void (*isr
)(struct cycx
* card
); /* interrupt service routine */
66 int (*exec
)(struct cycx
* card
, void* u_cmd
, void* u_data
);
68 #ifdef CONFIG_CYCLOMX_X25
69 struct { /* X.25 specific data */
82 /* Public Functions */
83 void cyclomx_open (cycx_t
*card
); /* cycx_main.c */
84 void cyclomx_close (cycx_t
*card
); /* cycx_main.c */
85 void cyclomx_set_state (cycx_t
*card
, int state
); /* cycx_main.c */
87 #ifdef CONFIG_CYCLOMX_X25
88 int cyx_init (cycx_t
*card
, wandev_conf_t
*conf
); /* cycx_x25.c */
90 #endif /* __KERNEL__ */
91 #endif /* _CYCLOMX_H */