[ARM] 3373/1: move uengine loader to arch/arm/common
[linux-2.6/openmoko-kernel/knife-kernel.git] / include / linux / if_wanpipe.h
blobe594ca6069e5316acd90c4c5dcaf3d0527642e8f
1 /*****************************************************************************
2 * if_wanpipe.h Header file for the Sangoma AF_WANPIPE Socket
4 * Author: Nenad Corbic
6 * Copyright: (c) 2000 Sangoma Technologies Inc.
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 * ============================================================================
14 * Jan 28, 2000 Nenad Corbic Initial Version
16 *****************************************************************************/
18 #ifndef __LINUX_IF_WAN_PACKET_H
19 #define __LINUX_IF_WAN_PACKET_H
21 struct wan_sockaddr_ll
23 unsigned short sll_family;
24 unsigned short sll_protocol;
25 int sll_ifindex;
26 unsigned short sll_hatype;
27 unsigned char sll_pkttype;
28 unsigned char sll_halen;
29 unsigned char sll_addr[8];
30 unsigned char sll_device[14];
31 unsigned char sll_card[14];
34 typedef struct
36 unsigned char free;
37 unsigned char state_sk;
38 int rcvbuf;
39 int sndbuf;
40 int rmem;
41 int wmem;
42 int sk_count;
43 unsigned char bound;
44 char name[14];
45 unsigned char d_state;
46 unsigned char svc;
47 unsigned short lcn;
48 unsigned char mbox;
49 unsigned char cmd_busy;
50 unsigned char command;
51 unsigned poll;
52 unsigned poll_cnt;
53 int rblock;
54 } wan_debug_hdr_t;
56 #define MAX_NUM_DEBUG 10
57 #define X25_PROT 0x16
58 #define PVC_PROT 0x17
60 typedef struct
62 wan_debug_hdr_t debug[MAX_NUM_DEBUG];
63 }wan_debug_t;
65 #define SIOC_WANPIPE_GET_CALL_DATA (SIOCPROTOPRIVATE + 0)
66 #define SIOC_WANPIPE_SET_CALL_DATA (SIOCPROTOPRIVATE + 1)
67 #define SIOC_WANPIPE_ACCEPT_CALL (SIOCPROTOPRIVATE + 2)
68 #define SIOC_WANPIPE_CLEAR_CALL (SIOCPROTOPRIVATE + 3)
69 #define SIOC_WANPIPE_RESET_CALL (SIOCPROTOPRIVATE + 4)
70 #define SIOC_WANPIPE_DEBUG (SIOCPROTOPRIVATE + 5)
71 #define SIOC_WANPIPE_SET_NONBLOCK (SIOCPROTOPRIVATE + 6)
72 #define SIOC_WANPIPE_CHECK_TX (SIOCPROTOPRIVATE + 7)
73 #define SIOC_WANPIPE_SOCK_STATE (SIOCPROTOPRIVATE + 8)
75 /* Packet types */
77 #define WAN_PACKET_HOST 0 /* To us */
78 #define WAN_PACKET_BROADCAST 1 /* To all */
79 #define WAN_PACKET_MULTICAST 2 /* To group */
80 #define WAN_PACKET_OTHERHOST 3 /* To someone else */
81 #define WAN_PACKET_OUTGOING 4 /* Outgoing of any type */
82 /* These ones are invisible by user level */
83 #define WAN_PACKET_LOOPBACK 5 /* MC/BRD frame looped back */
84 #define WAN_PACKET_FASTROUTE 6 /* Fastrouted frame */
87 /* X25 specific */
88 #define WAN_PACKET_DATA 7
89 #define WAN_PACKET_CMD 8
90 #define WAN_PACKET_ASYNC 9
91 #define WAN_PACKET_ERR 10
93 /* Packet socket options */
95 #define WAN_PACKET_ADD_MEMBERSHIP 1
96 #define WAN_PACKET_DROP_MEMBERSHIP 2
98 #define WAN_PACKET_MR_MULTICAST 0
99 #define WAN_PACKET_MR_PROMISC 1
100 #define WAN_PACKET_MR_ALLMULTI 2
102 #ifdef __KERNEL__
104 /* Private wanpipe socket structures. */
105 struct wanpipe_opt
107 void *mbox; /* Mail box */
108 void *card; /* Card bouded to */
109 struct net_device *dev; /* Bounded device */
110 unsigned short lcn; /* Binded LCN */
111 unsigned char svc; /* 0=pvc, 1=svc */
112 unsigned char timer; /* flag for delayed transmit*/
113 struct timer_list tx_timer;
114 unsigned poll_cnt;
115 unsigned char force; /* Used to force sock release */
116 atomic_t packet_sent;
117 unsigned short num;
120 #define wp_sk(__sk) ((struct wanpipe_opt *)(__sk)->sk_protinfo)
122 #endif
124 #endif