1 /*****************************************************************************
2 * if_wanipe_common.h   Sangoma Driver/Socket common area definitions.
3 *
4 * Author:       Nenad Corbic <ncorbic@sangoma.com>
5 *
6 * Copyright:    (c) 2000 Sangoma Technologies Inc.
7 *
8 *               This program is free software; you can redistribute it and/or
9 *               modify it under the terms of the GNU General Public License
10 *               as published by the Free Software Foundation; either version
11 *               2 of the License, or (at your option) any later version.
12 * ============================================================================
13 * Jan 13, 2000  Nenad Corbic      Initial version
14 *****************************************************************************/
15 
16 
17 #ifndef _WANPIPE_SOCK_DRIVER_COMMON_H
18 #define _WANPIPE_SOCK_DRIVER_COMMON_H
19 
20 #include <linux/version.h>
21 
22 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
23  #define netdevice_t struct net_device
24 #else
25  #define netdevice_t struct device
26 #endif
27 
28 
29 typedef struct {
30 	netdevice_t *slave;
31 	atomic_t packet_sent;
32 	atomic_t receive_block;
33 	atomic_t command;
34 	atomic_t disconnect;
35 	atomic_t driver_busy;
36 	unsigned char common_critical;
37 	struct timer_list *tx_timer;
38 	struct sock *sk;		/* Wanpipe Sock bind's here */
39 	int   (*func) (struct sk_buff *, netdevice_t *,
40                        struct sock *);
41 
42 	struct tq_struct wanpipe_task;    /* Immediate BH handler task */
43 	unsigned char rw_bind;			  /* Sock bind state */
44 	unsigned char usedby;
45 	unsigned char state;
46 	unsigned char svc;
47 	unsigned short lcn;
48 	void *mbox;
49 } wanpipe_common_t;
50 
51 
52 enum {
53 	WANSOCK_UNCONFIGURED,	/* link/channel is not configured */
54 	WANSOCK_DISCONNECTED,	/* link/channel is disconnected */
55 	WANSOCK_CONNECTING,		/* connection is in progress */
56 	WANSOCK_CONNECTED,		/* link/channel is operational */
57 	WANSOCK_LIMIT,		/* for verification only */
58 	WANSOCK_DUALPORT,		/* for Dual Port cards */
59 	WANSOCK_DISCONNECTING,
60 	WANSOCK_BINDED,
61 	WANSOCK_BIND_LISTEN,
62 	WANSOCK_LISTEN
63 };
64 
65 #endif
66 
67 
68