forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/isdn/capi/kcapi.h
....@@ -30,22 +30,153 @@
3030 CAPI_CTR_RUNNING = 3,
3131 };
3232
33
-extern struct list_head capi_drivers;
34
-extern struct mutex capi_drivers_lock;
35
-
3633 extern struct capi_ctr *capi_controller[CAPI_MAXCONTR];
3734 extern struct mutex capi_controller_lock;
3835
3936 extern struct capi20_appl *capi_applications[CAPI_MAXAPPL];
4037
41
-#ifdef CONFIG_PROC_FS
42
-
4338 void kcapi_proc_init(void);
4439 void kcapi_proc_exit(void);
4540
46
-#else
41
+struct capi20_appl {
42
+ u16 applid;
43
+ capi_register_params rparam;
44
+ void (*recv_message)(struct capi20_appl *ap, struct sk_buff *skb);
45
+ void *private;
4746
48
-static inline void kcapi_proc_init(void) { };
49
-static inline void kcapi_proc_exit(void) { };
47
+ /* internal to kernelcapi.o */
48
+ unsigned long nrecvctlpkt;
49
+ unsigned long nrecvdatapkt;
50
+ unsigned long nsentctlpkt;
51
+ unsigned long nsentdatapkt;
52
+ struct mutex recv_mtx;
53
+ struct sk_buff_head recv_queue;
54
+ struct work_struct recv_work;
55
+ int release_in_progress;
56
+};
5057
51
-#endif
58
+u16 capi20_isinstalled(void);
59
+u16 capi20_register(struct capi20_appl *ap);
60
+u16 capi20_release(struct capi20_appl *ap);
61
+u16 capi20_put_message(struct capi20_appl *ap, struct sk_buff *skb);
62
+u16 capi20_get_manufacturer(u32 contr, u8 buf[CAPI_MANUFACTURER_LEN]);
63
+u16 capi20_get_version(u32 contr, struct capi_version *verp);
64
+u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]);
65
+u16 capi20_get_profile(u32 contr, struct capi_profile *profp);
66
+int capi20_manufacturer(unsigned long cmd, void __user *data);
67
+
68
+#define CAPICTR_UP 0
69
+#define CAPICTR_DOWN 1
70
+
71
+int kcapi_init(void);
72
+void kcapi_exit(void);
73
+
74
+/*----- basic-type definitions -----*/
75
+
76
+typedef __u8 *_cstruct;
77
+
78
+typedef enum {
79
+ CAPI_COMPOSE,
80
+ CAPI_DEFAULT
81
+} _cmstruct;
82
+
83
+/*
84
+ The _cmsg structure contains all possible CAPI 2.0 parameter.
85
+ All parameters are stored here first. The function CAPI_CMSG_2_MESSAGE
86
+ assembles the parameter and builds CAPI2.0 conform messages.
87
+ CAPI_MESSAGE_2_CMSG disassembles CAPI 2.0 messages and stores the
88
+ parameter in the _cmsg structure
89
+ */
90
+
91
+typedef struct {
92
+ /* Header */
93
+ __u16 ApplId;
94
+ __u8 Command;
95
+ __u8 Subcommand;
96
+ __u16 Messagenumber;
97
+
98
+ /* Parameter */
99
+ union {
100
+ __u32 adrController;
101
+ __u32 adrPLCI;
102
+ __u32 adrNCCI;
103
+ } adr;
104
+
105
+ _cmstruct AdditionalInfo;
106
+ _cstruct B1configuration;
107
+ __u16 B1protocol;
108
+ _cstruct B2configuration;
109
+ __u16 B2protocol;
110
+ _cstruct B3configuration;
111
+ __u16 B3protocol;
112
+ _cstruct BC;
113
+ _cstruct BChannelinformation;
114
+ _cmstruct BProtocol;
115
+ _cstruct CalledPartyNumber;
116
+ _cstruct CalledPartySubaddress;
117
+ _cstruct CallingPartyNumber;
118
+ _cstruct CallingPartySubaddress;
119
+ __u32 CIPmask;
120
+ __u32 CIPmask2;
121
+ __u16 CIPValue;
122
+ __u32 Class;
123
+ _cstruct ConnectedNumber;
124
+ _cstruct ConnectedSubaddress;
125
+ __u32 Data;
126
+ __u16 DataHandle;
127
+ __u16 DataLength;
128
+ _cstruct FacilityConfirmationParameter;
129
+ _cstruct Facilitydataarray;
130
+ _cstruct FacilityIndicationParameter;
131
+ _cstruct FacilityRequestParameter;
132
+ __u16 FacilitySelector;
133
+ __u16 Flags;
134
+ __u32 Function;
135
+ _cstruct HLC;
136
+ __u16 Info;
137
+ _cstruct InfoElement;
138
+ __u32 InfoMask;
139
+ __u16 InfoNumber;
140
+ _cstruct Keypadfacility;
141
+ _cstruct LLC;
142
+ _cstruct ManuData;
143
+ __u32 ManuID;
144
+ _cstruct NCPI;
145
+ __u16 Reason;
146
+ __u16 Reason_B3;
147
+ __u16 Reject;
148
+ _cstruct Useruserdata;
149
+
150
+ /* intern */
151
+ unsigned l, p;
152
+ unsigned char *par;
153
+ __u8 *m;
154
+
155
+ /* buffer to construct message */
156
+ __u8 buf[180];
157
+
158
+} _cmsg;
159
+
160
+/*-----------------------------------------------------------------------*/
161
+
162
+/*
163
+ * Debugging / Tracing functions
164
+ */
165
+
166
+char *capi_cmd2str(__u8 cmd, __u8 subcmd);
167
+
168
+typedef struct {
169
+ u_char *buf;
170
+ u_char *p;
171
+ size_t size;
172
+ size_t pos;
173
+} _cdebbuf;
174
+
175
+#define CDEBUG_SIZE 1024
176
+#define CDEBUG_GSIZE 4096
177
+
178
+void cdebbuf_free(_cdebbuf *cdb);
179
+int cdebug_init(void);
180
+void cdebug_exit(void);
181
+
182
+_cdebbuf *capi_message2str(__u8 *msg);