The staging isdn drivers are gone, and CONFIG_BT_CMTP is now the only user. This means a lot of the code in the subsystem has no remaining callers and can be removed. Change the capi user space front-end to be part of kernelcapi, and the combined module to only be compiled if BT_CMTP is also enabled, then remove the interfaces that have no remaining callers. As the notifier list and the capi_drivers list have no callers outside of kcapi.c, the implementation gets much simpler. Some definitions from the include/linux/*.h headers are only needed internally and are moved to kcapi.h.
Showing the changes to include/linux (3 of 14 files). Show all
Unified · Split
| @@ -69,7 +69,6 @@ struct capi_ctr { · 68 unmodified lines | ||
| 69 | 69 | unsigned short state; /* controller state */ |
| 70 | 70 | int blocked; /* output blocked */ |
| 71 | 71 | int traceflag; /* capi trace */ |
| 72 | − wait_queue_head_t state_wait_queue; | |
| 73 | 72 | |
| 74 | 73 | struct proc_dir_entry *procent; |
| 75 | 74 | char procfn[128]; |
| @@ -80,8 +79,6 @@ int detach_capi_ctr(struct capi_ctr *); · 4 unmodified lines | ||
| 80 | 79 | |
| 81 | 80 | void capi_ctr_ready(struct capi_ctr * card); |
| 82 | 81 | void capi_ctr_down(struct capi_ctr * card); |
| 83 | −void capi_ctr_suspend_output(struct capi_ctr * card); | |
| 84 | −void capi_ctr_resume_output(struct capi_ctr * card); | |
| 85 | 82 | void capi_ctr_handle_message(struct capi_ctr * card, u16 appl, struct sk_buff *skb); |
| 86 | 83 | |
| 87 | 84 | // --------------------------------------------------------------------------- |
| @@ -91,23 +88,8 @@ struct capi_driver { · 3 unmodified lines | ||
| 91 | 88 | char name[32]; /* driver name */ |
| 92 | 89 | char revision[32]; |
| 93 | 90 | |
| 94 | − int (*add_card)(struct capi_driver *driver, capicardparams *data); | |
| 95 | − | |
| 96 | 91 | /* management information for kcapi */ |
| 97 | 92 | struct list_head list; |
| 98 | 93 | }; |
| 99 | 94 | |
| 100 | −void register_capi_driver(struct capi_driver *driver); | |
| 101 | −void unregister_capi_driver(struct capi_driver *driver); | |
| 102 | − | |
| 103 | −// --------------------------------------------------------------------------- | |
| 104 | −// library functions for use by hardware controller drivers | |
| 105 | − | |
| 106 | −void capilib_new_ncci(struct list_head *head, u16 applid, u32 ncci, u32 winsize); | |
| 107 | −void capilib_free_ncci(struct list_head *head, u16 applid, u32 ncci); | |
| 108 | −void capilib_release_appl(struct list_head *head, u16 applid); | |
| 109 | −void capilib_release(struct list_head *head); | |
| 110 | −void capilib_data_b3_conf(struct list_head *head, u16 applid, u32 ncci, u16 msgid); | |
| 111 | −u16 capilib_data_b3_req(struct list_head *head, u16 applid, u32 ncci, u16 msgid); | |
| 112 | − | |
| 113 | 95 | #endif /* __CAPILLI_H__ */ |
| @@ -57,460 +57,4 @@ static inline void capimsg_setu32(void *m, int off, __u32 val) · 56 unmodified lines | ||
| 57 | 57 | #define CAPIMSG_SETCONTROL(m, contr) capimsg_setu32(m, 8, contr) |
| 58 | 58 | #define CAPIMSG_SETDATALEN(m, len) capimsg_setu16(m, 16, len) |
| 59 | 59 | |
| 60 | −/*----- basic-type definitions -----*/ | |
| 61 | − | |
| 62 | −typedef __u8 *_cstruct; | |
| 63 | − | |
| 64 | −typedef enum { | |
| 65 | − CAPI_COMPOSE, | |
| 66 | − CAPI_DEFAULT | |
| 67 | −} _cmstruct; | |
| 68 | − | |
| 69 | −/* | |
| 70 | − The _cmsg structure contains all possible CAPI 2.0 parameter. | |
| 71 | − All parameters are stored here first. The function CAPI_CMSG_2_MESSAGE | |
| 72 | − assembles the parameter and builds CAPI2.0 conform messages. | |
| 73 | − CAPI_MESSAGE_2_CMSG disassembles CAPI 2.0 messages and stores the | |
| 74 | − parameter in the _cmsg structure | |
| 75 | − */ | |
| 76 | − | |
| 77 | −typedef struct { | |
| 78 | − /* Header */ | |
| 79 | − __u16 ApplId; | |
| 80 | − __u8 Command; | |
| 81 | − __u8 Subcommand; | |
| 82 | − __u16 Messagenumber; | |
| 83 | − | |
| 84 | − /* Parameter */ | |
| 85 | − union { | |
| 86 | − __u32 adrController; | |
| 87 | − __u32 adrPLCI; | |
| 88 | − __u32 adrNCCI; | |
| 89 | − } adr; | |
| 90 | − | |
| 91 | − _cmstruct AdditionalInfo; | |
| 92 | − _cstruct B1configuration; | |
| 93 | − __u16 B1protocol; | |
| 94 | − _cstruct B2configuration; | |
| 95 | − __u16 B2protocol; | |
| 96 | − _cstruct B3configuration; | |
| 97 | − __u16 B3protocol; | |
| 98 | − _cstruct BC; | |
| 99 | − _cstruct BChannelinformation; | |
| 100 | − _cmstruct BProtocol; | |
| 101 | − _cstruct CalledPartyNumber; | |
| 102 | − _cstruct CalledPartySubaddress; | |
| 103 | − _cstruct CallingPartyNumber; | |
| 104 | − _cstruct CallingPartySubaddress; | |
| 105 | − __u32 CIPmask; | |
| 106 | − __u32 CIPmask2; | |
| 107 | − __u16 CIPValue; | |
| 108 | − __u32 Class; | |
| 109 | − _cstruct ConnectedNumber; | |
| 110 | − _cstruct ConnectedSubaddress; | |
| 111 | − __u32 Data; | |
| 112 | − __u16 DataHandle; | |
| 113 | − __u16 DataLength; | |
| 114 | − _cstruct FacilityConfirmationParameter; | |
| 115 | − _cstruct Facilitydataarray; | |
| 116 | − _cstruct FacilityIndicationParameter; | |
| 117 | − _cstruct FacilityRequestParameter; | |
| 118 | − __u16 FacilitySelector; | |
| 119 | − __u16 Flags; | |
| 120 | − __u32 Function; | |
| 121 | − _cstruct HLC; | |
| 122 | − __u16 Info; | |
| 123 | − _cstruct InfoElement; | |
| 124 | − __u32 InfoMask; | |
| 125 | − __u16 InfoNumber; | |
| 126 | − _cstruct Keypadfacility; | |
| 127 | − _cstruct LLC; | |
| 128 | − _cstruct ManuData; | |
| 129 | − __u32 ManuID; | |
| 130 | − _cstruct NCPI; | |
| 131 | − __u16 Reason; | |
| 132 | − __u16 Reason_B3; | |
| 133 | − __u16 Reject; | |
| 134 | − _cstruct Useruserdata; | |
| 135 | − | |
| 136 | − /* intern */ | |
| 137 | − unsigned l, p; | |
| 138 | − unsigned char *par; | |
| 139 | − __u8 *m; | |
| 140 | − | |
| 141 | − /* buffer to construct message */ | |
| 142 | − __u8 buf[180]; | |
| 143 | − | |
| 144 | −} _cmsg; | |
| 145 | − | |
| 146 | −/* | |
| 147 | − * capi_cmsg2message() assembles the parameter from _cmsg to a CAPI 2.0 | |
| 148 | − * conform message | |
| 149 | − */ | |
| 150 | −unsigned capi_cmsg2message(_cmsg * cmsg, __u8 * msg); | |
| 151 | − | |
| 152 | −/* | |
| 153 | − * capi_message2cmsg disassembles a CAPI message an writes the parameter | |
| 154 | − * into _cmsg for easy access | |
| 155 | − */ | |
| 156 | −unsigned capi_message2cmsg(_cmsg * cmsg, __u8 * msg); | |
| 157 | − | |
| 158 | −/* | |
| 159 | − * capi_cmsg_header() fills the _cmsg structure with default values, so only | |
| 160 | − * parameter with non default values must be changed before sending the | |
| 161 | − * message. | |
| 162 | − */ | |
| 163 | −unsigned capi_cmsg_header(_cmsg * cmsg, __u16 _ApplId, | |
| 164 | − __u8 _Command, __u8 _Subcommand, | |
| 165 | − __u16 _Messagenumber, __u32 _Controller); | |
| 166 | − | |
| 167 | −/*-----------------------------------------------------------------------*/ | |
| 168 | − | |
| 169 | −/* | |
| 170 | − * Debugging / Tracing functions | |
| 171 | − */ | |
| 172 | − | |
| 173 | −char *capi_cmd2str(__u8 cmd, __u8 subcmd); | |
| 174 | − | |
| 175 | −typedef struct { | |
| 176 | − u_char *buf; | |
| 177 | − u_char *p; | |
| 178 | − size_t size; | |
| 179 | − size_t pos; | |
| 180 | −} _cdebbuf; | |
| 181 | − | |
| 182 | −#define CDEBUG_SIZE 1024 | |
| 183 | −#define CDEBUG_GSIZE 4096 | |
| 184 | − | |
| 185 | −void cdebbuf_free(_cdebbuf *cdb); | |
| 186 | −int cdebug_init(void); | |
| 187 | −void cdebug_exit(void); | |
| 188 | − | |
| 189 | −_cdebbuf *capi_cmsg2str(_cmsg *cmsg); | |
| 190 | −_cdebbuf *capi_message2str(__u8 *msg); | |
| 191 | − | |
| 192 | −/*-----------------------------------------------------------------------*/ | |
| 193 | − | |
| 194 | −static inline void capi_cmsg_answer(_cmsg * cmsg) | |
| 195 | −{ | |
| 196 | − cmsg->Subcommand |= 0x01; | |
| 197 | −} | |
| 198 | − | |
| 199 | −/*-----------------------------------------------------------------------*/ | |
| 200 | − | |
| 201 | −static inline void capi_fill_CONNECT_B3_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 202 | − __u32 adr, | |
| 203 | − _cstruct NCPI) | |
| 204 | −{ | |
| 205 | − capi_cmsg_header(cmsg, ApplId, 0x82, 0x80, Messagenumber, adr); | |
| 206 | − cmsg->NCPI = NCPI; | |
| 207 | −} | |
| 208 | − | |
| 209 | −static inline void capi_fill_FACILITY_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 210 | − __u32 adr, | |
| 211 | − __u16 FacilitySelector, | |
| 212 | − _cstruct FacilityRequestParameter) | |
| 213 | −{ | |
| 214 | − capi_cmsg_header(cmsg, ApplId, 0x80, 0x80, Messagenumber, adr); | |
| 215 | − cmsg->FacilitySelector = FacilitySelector; | |
| 216 | − cmsg->FacilityRequestParameter = FacilityRequestParameter; | |
| 217 | −} | |
| 218 | − | |
| 219 | −static inline void capi_fill_INFO_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 220 | − __u32 adr, | |
| 221 | − _cstruct CalledPartyNumber, | |
| 222 | − _cstruct BChannelinformation, | |
| 223 | − _cstruct Keypadfacility, | |
| 224 | − _cstruct Useruserdata, | |
| 225 | − _cstruct Facilitydataarray) | |
| 226 | −{ | |
| 227 | − capi_cmsg_header(cmsg, ApplId, 0x08, 0x80, Messagenumber, adr); | |
| 228 | − cmsg->CalledPartyNumber = CalledPartyNumber; | |
| 229 | − cmsg->BChannelinformation = BChannelinformation; | |
| 230 | − cmsg->Keypadfacility = Keypadfacility; | |
| 231 | − cmsg->Useruserdata = Useruserdata; | |
| 232 | − cmsg->Facilitydataarray = Facilitydataarray; | |
| 233 | −} | |
| 234 | − | |
| 235 | −static inline void capi_fill_LISTEN_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 236 | − __u32 adr, | |
| 237 | − __u32 InfoMask, | |
| 238 | − __u32 CIPmask, | |
| 239 | − __u32 CIPmask2, | |
| 240 | − _cstruct CallingPartyNumber, | |
| 241 | − _cstruct CallingPartySubaddress) | |
| 242 | −{ | |
| 243 | − capi_cmsg_header(cmsg, ApplId, 0x05, 0x80, Messagenumber, adr); | |
| 244 | − cmsg->InfoMask = InfoMask; | |
| 245 | − cmsg->CIPmask = CIPmask; | |
| 246 | − cmsg->CIPmask2 = CIPmask2; | |
| 247 | − cmsg->CallingPartyNumber = CallingPartyNumber; | |
| 248 | − cmsg->CallingPartySubaddress = CallingPartySubaddress; | |
| 249 | −} | |
| 250 | − | |
| 251 | −static inline void capi_fill_ALERT_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 252 | − __u32 adr, | |
| 253 | − _cstruct BChannelinformation, | |
| 254 | − _cstruct Keypadfacility, | |
| 255 | − _cstruct Useruserdata, | |
| 256 | − _cstruct Facilitydataarray) | |
| 257 | −{ | |
| 258 | − capi_cmsg_header(cmsg, ApplId, 0x01, 0x80, Messagenumber, adr); | |
| 259 | − cmsg->BChannelinformation = BChannelinformation; | |
| 260 | − cmsg->Keypadfacility = Keypadfacility; | |
| 261 | − cmsg->Useruserdata = Useruserdata; | |
| 262 | − cmsg->Facilitydataarray = Facilitydataarray; | |
| 263 | −} | |
| 264 | − | |
| 265 | −static inline void capi_fill_CONNECT_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 266 | − __u32 adr, | |
| 267 | − __u16 CIPValue, | |
| 268 | − _cstruct CalledPartyNumber, | |
| 269 | − _cstruct CallingPartyNumber, | |
| 270 | − _cstruct CalledPartySubaddress, | |
| 271 | − _cstruct CallingPartySubaddress, | |
| 272 | − __u16 B1protocol, | |
| 273 | − __u16 B2protocol, | |
| 274 | − __u16 B3protocol, | |
| 275 | − _cstruct B1configuration, | |
| 276 | − _cstruct B2configuration, | |
| 277 | − _cstruct B3configuration, | |
| 278 | − _cstruct BC, | |
| 279 | − _cstruct LLC, | |
| 280 | − _cstruct HLC, | |
| 281 | − _cstruct BChannelinformation, | |
| 282 | − _cstruct Keypadfacility, | |
| 283 | − _cstruct Useruserdata, | |
| 284 | − _cstruct Facilitydataarray) | |
| 285 | −{ | |
| 286 | − | |
| 287 | − capi_cmsg_header(cmsg, ApplId, 0x02, 0x80, Messagenumber, adr); | |
| 288 | − cmsg->CIPValue = CIPValue; | |
| 289 | − cmsg->CalledPartyNumber = CalledPartyNumber; | |
| 290 | − cmsg->CallingPartyNumber = CallingPartyNumber; | |
| 291 | − cmsg->CalledPartySubaddress = CalledPartySubaddress; | |
| 292 | − cmsg->CallingPartySubaddress = CallingPartySubaddress; | |
| 293 | − cmsg->B1protocol = B1protocol; | |
| 294 | − cmsg->B2protocol = B2protocol; | |
| 295 | − cmsg->B3protocol = B3protocol; | |
| 296 | − cmsg->B1configuration = B1configuration; | |
| 297 | − cmsg->B2configuration = B2configuration; | |
| 298 | − cmsg->B3configuration = B3configuration; | |
| 299 | − cmsg->BC = BC; | |
| 300 | − cmsg->LLC = LLC; | |
| 301 | − cmsg->HLC = HLC; | |
| 302 | − cmsg->BChannelinformation = BChannelinformation; | |
| 303 | − cmsg->Keypadfacility = Keypadfacility; | |
| 304 | − cmsg->Useruserdata = Useruserdata; | |
| 305 | − cmsg->Facilitydataarray = Facilitydataarray; | |
| 306 | −} | |
| 307 | − | |
| 308 | −static inline void capi_fill_DATA_B3_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 309 | − __u32 adr, | |
| 310 | − __u32 Data, | |
| 311 | − __u16 DataLength, | |
| 312 | − __u16 DataHandle, | |
| 313 | − __u16 Flags) | |
| 314 | −{ | |
| 315 | − | |
| 316 | − capi_cmsg_header(cmsg, ApplId, 0x86, 0x80, Messagenumber, adr); | |
| 317 | − cmsg->Data = Data; | |
| 318 | − cmsg->DataLength = DataLength; | |
| 319 | − cmsg->DataHandle = DataHandle; | |
| 320 | − cmsg->Flags = Flags; | |
| 321 | −} | |
| 322 | − | |
| 323 | −static inline void capi_fill_DISCONNECT_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 324 | − __u32 adr, | |
| 325 | − _cstruct BChannelinformation, | |
| 326 | − _cstruct Keypadfacility, | |
| 327 | − _cstruct Useruserdata, | |
| 328 | − _cstruct Facilitydataarray) | |
| 329 | −{ | |
| 330 | − | |
| 331 | − capi_cmsg_header(cmsg, ApplId, 0x04, 0x80, Messagenumber, adr); | |
| 332 | − cmsg->BChannelinformation = BChannelinformation; | |
| 333 | − cmsg->Keypadfacility = Keypadfacility; | |
| 334 | − cmsg->Useruserdata = Useruserdata; | |
| 335 | − cmsg->Facilitydataarray = Facilitydataarray; | |
| 336 | −} | |
| 337 | − | |
| 338 | −static inline void capi_fill_DISCONNECT_B3_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 339 | − __u32 adr, | |
| 340 | − _cstruct NCPI) | |
| 341 | −{ | |
| 342 | − | |
| 343 | − capi_cmsg_header(cmsg, ApplId, 0x84, 0x80, Messagenumber, adr); | |
| 344 | − cmsg->NCPI = NCPI; | |
| 345 | −} | |
| 346 | − | |
| 347 | −static inline void capi_fill_MANUFACTURER_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 348 | − __u32 adr, | |
| 349 | − __u32 ManuID, | |
| 350 | − __u32 Class, | |
| 351 | − __u32 Function, | |
| 352 | − _cstruct ManuData) | |
| 353 | −{ | |
| 354 | − | |
| 355 | − capi_cmsg_header(cmsg, ApplId, 0xff, 0x80, Messagenumber, adr); | |
| 356 | − cmsg->ManuID = ManuID; | |
| 357 | − cmsg->Class = Class; | |
| 358 | − cmsg->Function = Function; | |
| 359 | − cmsg->ManuData = ManuData; | |
| 360 | −} | |
| 361 | − | |
| 362 | −static inline void capi_fill_RESET_B3_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 363 | − __u32 adr, | |
| 364 | − _cstruct NCPI) | |
| 365 | −{ | |
| 366 | − | |
| 367 | − capi_cmsg_header(cmsg, ApplId, 0x87, 0x80, Messagenumber, adr); | |
| 368 | − cmsg->NCPI = NCPI; | |
| 369 | −} | |
| 370 | − | |
| 371 | −static inline void capi_fill_SELECT_B_PROTOCOL_REQ(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 372 | − __u32 adr, | |
| 373 | − __u16 B1protocol, | |
| 374 | − __u16 B2protocol, | |
| 375 | − __u16 B3protocol, | |
| 376 | − _cstruct B1configuration, | |
| 377 | − _cstruct B2configuration, | |
| 378 | − _cstruct B3configuration) | |
| 379 | −{ | |
| 380 | − | |
| 381 | − capi_cmsg_header(cmsg, ApplId, 0x41, 0x80, Messagenumber, adr); | |
| 382 | − cmsg->B1protocol = B1protocol; | |
| 383 | − cmsg->B2protocol = B2protocol; | |
| 384 | − cmsg->B3protocol = B3protocol; | |
| 385 | − cmsg->B1configuration = B1configuration; | |
| 386 | − cmsg->B2configuration = B2configuration; | |
| 387 | − cmsg->B3configuration = B3configuration; | |
| 388 | −} | |
| 389 | − | |
| 390 | −static inline void capi_fill_CONNECT_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 391 | − __u32 adr, | |
| 392 | − __u16 Reject, | |
| 393 | − __u16 B1protocol, | |
| 394 | − __u16 B2protocol, | |
| 395 | − __u16 B3protocol, | |
| 396 | − _cstruct B1configuration, | |
| 397 | − _cstruct B2configuration, | |
| 398 | − _cstruct B3configuration, | |
| 399 | − _cstruct ConnectedNumber, | |
| 400 | − _cstruct ConnectedSubaddress, | |
| 401 | − _cstruct LLC, | |
| 402 | − _cstruct BChannelinformation, | |
| 403 | − _cstruct Keypadfacility, | |
| 404 | − _cstruct Useruserdata, | |
| 405 | − _cstruct Facilitydataarray) | |
| 406 | −{ | |
| 407 | − capi_cmsg_header(cmsg, ApplId, 0x02, 0x83, Messagenumber, adr); | |
| 408 | − cmsg->Reject = Reject; | |
| 409 | − cmsg->B1protocol = B1protocol; | |
| 410 | − cmsg->B2protocol = B2protocol; | |
| 411 | − cmsg->B3protocol = B3protocol; | |
| 412 | − cmsg->B1configuration = B1configuration; | |
| 413 | − cmsg->B2configuration = B2configuration; | |
| 414 | − cmsg->B3configuration = B3configuration; | |
| 415 | − cmsg->ConnectedNumber = ConnectedNumber; | |
| 416 | − cmsg->ConnectedSubaddress = ConnectedSubaddress; | |
| 417 | − cmsg->LLC = LLC; | |
| 418 | − cmsg->BChannelinformation = BChannelinformation; | |
| 419 | − cmsg->Keypadfacility = Keypadfacility; | |
| 420 | − cmsg->Useruserdata = Useruserdata; | |
| 421 | − cmsg->Facilitydataarray = Facilitydataarray; | |
| 422 | −} | |
| 423 | − | |
| 424 | −static inline void capi_fill_CONNECT_ACTIVE_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 425 | − __u32 adr) | |
| 426 | −{ | |
| 427 | − | |
| 428 | − capi_cmsg_header(cmsg, ApplId, 0x03, 0x83, Messagenumber, adr); | |
| 429 | −} | |
| 430 | − | |
| 431 | −static inline void capi_fill_CONNECT_B3_ACTIVE_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 432 | − __u32 adr) | |
| 433 | −{ | |
| 434 | − | |
| 435 | − capi_cmsg_header(cmsg, ApplId, 0x83, 0x83, Messagenumber, adr); | |
| 436 | −} | |
| 437 | − | |
| 438 | −static inline void capi_fill_CONNECT_B3_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 439 | − __u32 adr, | |
| 440 | − __u16 Reject, | |
| 441 | − _cstruct NCPI) | |
| 442 | −{ | |
| 443 | − capi_cmsg_header(cmsg, ApplId, 0x82, 0x83, Messagenumber, adr); | |
| 444 | − cmsg->Reject = Reject; | |
| 445 | − cmsg->NCPI = NCPI; | |
| 446 | −} | |
| 447 | − | |
| 448 | −static inline void capi_fill_CONNECT_B3_T90_ACTIVE_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 449 | − __u32 adr) | |
| 450 | −{ | |
| 451 | − | |
| 452 | − capi_cmsg_header(cmsg, ApplId, 0x88, 0x83, Messagenumber, adr); | |
| 453 | −} | |
| 454 | − | |
| 455 | −static inline void capi_fill_DATA_B3_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 456 | − __u32 adr, | |
| 457 | − __u16 DataHandle) | |
| 458 | −{ | |
| 459 | − | |
| 460 | − capi_cmsg_header(cmsg, ApplId, 0x86, 0x83, Messagenumber, adr); | |
| 461 | − cmsg->DataHandle = DataHandle; | |
| 462 | −} | |
| 463 | − | |
| 464 | −static inline void capi_fill_DISCONNECT_B3_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 465 | − __u32 adr) | |
| 466 | −{ | |
| 467 | − | |
| 468 | − capi_cmsg_header(cmsg, ApplId, 0x84, 0x83, Messagenumber, adr); | |
| 469 | −} | |
| 470 | − | |
| 471 | −static inline void capi_fill_DISCONNECT_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 472 | − __u32 adr) | |
| 473 | −{ | |
| 474 | − | |
| 475 | − capi_cmsg_header(cmsg, ApplId, 0x04, 0x83, Messagenumber, adr); | |
| 476 | −} | |
| 477 | − | |
| 478 | −static inline void capi_fill_FACILITY_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 479 | − __u32 adr, | |
| 480 | − __u16 FacilitySelector) | |
| 481 | −{ | |
| 482 | − | |
| 483 | − capi_cmsg_header(cmsg, ApplId, 0x80, 0x83, Messagenumber, adr); | |
| 484 | − cmsg->FacilitySelector = FacilitySelector; | |
| 485 | −} | |
| 486 | − | |
| 487 | −static inline void capi_fill_INFO_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 488 | − __u32 adr) | |
| 489 | −{ | |
| 490 | − | |
| 491 | − capi_cmsg_header(cmsg, ApplId, 0x08, 0x83, Messagenumber, adr); | |
| 492 | −} | |
| 493 | − | |
| 494 | −static inline void capi_fill_MANUFACTURER_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 495 | − __u32 adr, | |
| 496 | − __u32 ManuID, | |
| 497 | − __u32 Class, | |
| 498 | − __u32 Function, | |
| 499 | − _cstruct ManuData) | |
| 500 | −{ | |
| 501 | − | |
| 502 | − capi_cmsg_header(cmsg, ApplId, 0xff, 0x83, Messagenumber, adr); | |
| 503 | − cmsg->ManuID = ManuID; | |
| 504 | − cmsg->Class = Class; | |
| 505 | − cmsg->Function = Function; | |
| 506 | − cmsg->ManuData = ManuData; | |
| 507 | −} | |
| 508 | − | |
| 509 | −static inline void capi_fill_RESET_B3_RESP(_cmsg * cmsg, __u16 ApplId, __u16 Messagenumber, | |
| 510 | − __u32 adr) | |
| 511 | −{ | |
| 512 | − | |
| 513 | − capi_cmsg_header(cmsg, ApplId, 0x87, 0x83, Messagenumber, adr); | |
| 514 | −} | |
| 515 | − | |
| 516 | 60 | #endif /* __CAPIUTIL_H__ */ |
| @@ -10,46 +10,12 @@ · 9 unmodified lines | ||
| 10 | 10 | #ifndef __KERNELCAPI_H__ |
| 11 | 11 | #define __KERNELCAPI_H__ |
| 12 | 12 | |
| 13 | − | |
| 14 | 13 | #include <linux/list.h> |
| 15 | 14 | #include <linux/skbuff.h> |
| 16 | 15 | #include <linux/workqueue.h> |
| 17 | 16 | #include <linux/notifier.h> |
| 18 | 17 | #include <uapi/linux/kernelcapi.h> |
| 19 | 18 | |
| 20 | −struct capi20_appl { | |
| 21 | − u16 applid; | |
| 22 | − capi_register_params rparam; | |
| 23 | − void (*recv_message)(struct capi20_appl *ap, struct sk_buff *skb); | |
| 24 | − void *private; | |
| 25 | − | |
| 26 | − /* internal to kernelcapi.o */ | |
| 27 | − unsigned long nrecvctlpkt; | |
| 28 | − unsigned long nrecvdatapkt; | |
| 29 | − unsigned long nsentctlpkt; | |
| 30 | − unsigned long nsentdatapkt; | |
| 31 | − struct mutex recv_mtx; | |
| 32 | − struct sk_buff_head recv_queue; | |
| 33 | − struct work_struct recv_work; | |
| 34 | − int release_in_progress; | |
| 35 | −}; | |
| 36 | − | |
| 37 | −u16 capi20_isinstalled(void); | |
| 38 | −u16 capi20_register(struct capi20_appl *ap); | |
| 39 | −u16 capi20_release(struct capi20_appl *ap); | |
| 40 | −u16 capi20_put_message(struct capi20_appl *ap, struct sk_buff *skb); | |
| 41 | −u16 capi20_get_manufacturer(u32 contr, u8 buf[CAPI_MANUFACTURER_LEN]); | |
| 42 | −u16 capi20_get_version(u32 contr, struct capi_version *verp); | |
| 43 | −u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]); | |
| 44 | −u16 capi20_get_profile(u32 contr, struct capi_profile *profp); | |
| 45 | −int capi20_manufacturer(unsigned long cmd, void __user *data); | |
| 46 | − | |
| 47 | −#define CAPICTR_UP 0 | |
| 48 | −#define CAPICTR_DOWN 1 | |
| 49 | − | |
| 50 | −int register_capictr_notifier(struct notifier_block *nb); | |
| 51 | −int unregister_capictr_notifier(struct notifier_block *nb); | |
| 52 | − | |
| 53 | 19 | #define CAPI_NOERROR 0x0000 |
| 54 | 20 | |
| 55 | 21 | #define CAPI_TOOMANYAPPLS 0x1001 |
| @@ -76,45 +42,4 @@ int unregister_capictr_notifier(struct notifier_block *nb); · 20 unmodified lines | ||
| 76 | 42 | #define CAPI_MSGCTRLERNOTSUPPORTEXTEQUIP 0x110a |
| 77 | 43 | #define CAPI_MSGCTRLERONLYSUPPORTEXTEQUIP 0x110b |
| 78 | 44 | |
| 79 | −typedef enum { | |
| 80 | − CapiMessageNotSupportedInCurrentState = 0x2001, | |
| 81 | − CapiIllContrPlciNcci = 0x2002, | |
| 82 | − CapiNoPlciAvailable = 0x2003, | |
| 83 | − CapiNoNcciAvailable = 0x2004, | |
| 84 | − CapiNoListenResourcesAvailable = 0x2005, | |
| 85 | − CapiNoFaxResourcesAvailable = 0x2006, | |
| 86 | − CapiIllMessageParmCoding = 0x2007, | |
| 87 | −} RESOURCE_CODING_PROBLEM; | |
| 88 | − | |
| 89 | −typedef enum { | |
| 90 | − CapiB1ProtocolNotSupported = 0x3001, | |
| 91 | − CapiB2ProtocolNotSupported = 0x3002, | |
| 92 | − CapiB3ProtocolNotSupported = 0x3003, | |
| 93 | − CapiB1ProtocolParameterNotSupported = 0x3004, | |
| 94 | − CapiB2ProtocolParameterNotSupported = 0x3005, | |
| 95 | − CapiB3ProtocolParameterNotSupported = 0x3006, | |
| 96 | − CapiBProtocolCombinationNotSupported = 0x3007, | |
| 97 | − CapiNcpiNotSupported = 0x3008, | |
| 98 | − CapiCipValueUnknown = 0x3009, | |
| 99 | − CapiFlagsNotSupported = 0x300a, | |
| 100 | − CapiFacilityNotSupported = 0x300b, | |
| 101 | − CapiDataLengthNotSupportedByCurrentProtocol = 0x300c, | |
| 102 | − CapiResetProcedureNotSupportedByCurrentProtocol = 0x300d, | |
| 103 | − CapiTeiAssignmentFailed = 0x300e, | |
| 104 | −} REQUESTED_SERVICES_PROBLEM; | |
| 105 | − | |
| 106 | −typedef enum { | |
| 107 | − CapiSuccess = 0x0000, | |
| 108 | − CapiSupplementaryServiceNotSupported = 0x300e, | |
| 109 | − CapiRequestNotAllowedInThisState = 0x3010, | |
| 110 | −} SUPPLEMENTARY_SERVICE_INFO; | |
| 111 | − | |
| 112 | −typedef enum { | |
| 113 | − CapiProtocolErrorLayer1 = 0x3301, | |
| 114 | − CapiProtocolErrorLayer2 = 0x3302, | |
| 115 | − CapiProtocolErrorLayer3 = 0x3303, | |
| 116 | − CapiTimeOut = 0x3303, // SuppServiceReason | |
| 117 | − CapiCallGivenToOtherApplication = 0x3304, | |
| 118 | −} CAPI_REASON; | |
| 119 | − | |
| 120 | 45 | #endif /* __KERNELCAPI_H__ */ |