- CAPI BxConfiguration was not handled

- add CAPI protocol IDs
This commit is contained in:
Karsten Keil 2004-01-30 23:46:39 +00:00
parent 4520efea23
commit f947bb1dda
6 changed files with 58 additions and 8 deletions

View File

@ -157,10 +157,33 @@ __u16 AppPlciCheckBprotocol(AppPlci_t *aplci, _cmsg *cmsg)
sprot = ctrl->profile.support3;
if (!test_bit(cmsg->B3protocol, &sprot))
return CapiB3ProtocolNotSupported;
aplci->Bprotocol.B1 = cmsg->B1protocol;
aplci->Bprotocol.B2 = cmsg->B2protocol;
aplci->Bprotocol.B3 = cmsg->B3protocol;
if (cmsg->B1configuration && cmsg->B1configuration[0]) {
if (cmsg->B1configuration[0] > 15) {
int_errtxt("B1cfg too large(%d)", cmsg->B1configuration[0]);
return CapiB1ProtocolParameterNotSupported;
}
memcpy(&aplci->Bprotocol.B1cfg[0], cmsg->B1configuration, cmsg->B1configuration[0] + 1);
} else
aplci->Bprotocol.B1cfg[0] = 0;
if (cmsg->B2configuration && cmsg->B2configuration[0]) {
if (cmsg->B2configuration[0] > 15) {
int_errtxt("B2cfg too large(%d)", cmsg->B2configuration[0]);
return CapiB2ProtocolParameterNotSupported;
}
memcpy(&aplci->Bprotocol.B2cfg[0], cmsg->B2configuration, cmsg->B2configuration[0] + 1);
} else
aplci->Bprotocol.B2cfg[0] = 0;
if (cmsg->B3configuration && cmsg->B3configuration[0]) {
if (cmsg->B3configuration[0] > 79) {
int_errtxt("B3cfg too large(%d)", cmsg->B3configuration[0]);
return CapiB3ProtocolParameterNotSupported;
}
memcpy(&aplci->Bprotocol.B3cfg[0], cmsg->B3configuration, cmsg->B3configuration[0] + 1);
} else
aplci->Bprotocol.B3cfg[0] = 0;
return 0;
}
@ -1211,12 +1234,16 @@ AppPlciLinkUp(AppPlci_t *aplci)
}
pid.protocol[1] = (1 << aplci->Bprotocol.B1) |
ISDN_PID_LAYER(1) | ISDN_PID_BCHANNEL_BIT;
if (aplci->Bprotocol.B1cfg[0])
pid.param[1] = &aplci->Bprotocol.B1cfg[0];
if (aplci->Bprotocol.B2 > 23) {
int_errtxt("wrong B2 prot %x", aplci->Bprotocol.B2);
return(0x3002);
}
pid.protocol[2] = (1 << aplci->Bprotocol.B2) |
ISDN_PID_LAYER(2) | ISDN_PID_BCHANNEL_BIT;
if (aplci->Bprotocol.B2cfg[0])
pid.param[2] = &aplci->Bprotocol.B2cfg[0];
/* handle DTMF TODO */
if ((pid.protocol[2] == ISDN_PID_L2_B_TRANS) &&
(pid.protocol[1] == ISDN_PID_L1_B_64TRANS))
@ -1227,6 +1254,8 @@ AppPlciLinkUp(AppPlci_t *aplci)
}
pid.protocol[3] = (1 << aplci->Bprotocol.B3) |
ISDN_PID_LAYER(3) | ISDN_PID_BCHANNEL_BIT;
if (aplci->Bprotocol.B3cfg[0])
pid.param[3] = &aplci->Bprotocol.B3cfg[0];
capidebug(CAPI_DBG_PLCI, "AppPlciLinkUp B1(%x) B2(%x) B3(%x) global(%d) ch(%x)",
pid.protocol[1], pid.protocol[2], pid.protocol[3], pid.global,
aplci->channel);

View File

@ -4,6 +4,9 @@
*
*/
#ifndef _MISDN_FSM_H
#define _MISDN_FSM_H
#include <linux/timer.h>
/* Statemachine */
@ -47,3 +50,5 @@ extern void mISDN_FsmInitTimer(struct FsmInst *, struct FsmTimer *);
extern int mISDN_FsmAddTimer(struct FsmTimer *, int, int, void *, int);
extern void mISDN_FsmRestartTimer(struct FsmTimer *, int, int, void *, int);
extern void mISDN_FsmDelTimer(struct FsmTimer *, int);
#endif

View File

@ -162,9 +162,12 @@ struct _ConfQueue {
};
struct Bprotocol {
__u16 B1;
__u16 B2;
__u16 B3;
__u16 B1;
__u16 B2;
__u16 B3;
__u8 B1cfg[16];
__u8 B2cfg[16];
__u8 B3cfg[80];
};
// ---------------------------------------------------------------------------

View File

@ -945,8 +945,9 @@ static int __init Speedfax_init(void)
ISDN_PID_L1_B_64HDLC |
ISDN_PID_L1_B_T30FAX |
ISDN_PID_L1_B_MODEM_ASYNC;
speedfax.BPROTO.protocol[2] = ISDN_PID_L2_B_TRANS;
// ISDN_PID_L2_B_TRANSDTMF;
speedfax.BPROTO.protocol[2] = ISDN_PID_L2_B_TRANS |
ISDN_PID_L2_B_T30;
speedfax.prev = NULL;
speedfax.next = NULL;

View File

@ -5,8 +5,8 @@
* This file is (c) under GNU PUBLIC LICENSE
*
*/
#ifndef _L3_X23_H
#define _L3_X23_H
#ifndef _L3_X25_H
#define _L3_X25_H
#include "m_capi.h"
typedef struct _x25_l3 x25_l3_t;

View File

@ -105,6 +105,7 @@
#define HW_MOD_OK 0x0411
#define HW_MOD_NOCARR 0x0412
#define HW_MOD_FCERROR 0x0413
#define HW_MOD_READY 0x0414
#define HW_HFC_COEFF 0x0500
#define HW_LOS 0x0501
#define HW_LOS_OFF 0x0502
@ -322,6 +323,17 @@
#define ISDN_PID_L2_B_TRANS 0x42000002
#define ISDN_PID_L2_B_TRANSDTMF 0x42300002
#define ISDN_PID_L2_B_RAWDEV 0x42400002
#define ISDN_PID_L2_B_SDLC 0x42000004
#define ISDN_PID_L2_B_LAPD 0x42000008
#define ISDN_PID_L2_B_T30 0x42000010
#define ISDN_PID_L2_B_PPP 0x42000020
#define ISDN_PID_L2_B_TRANSNOERR 0x42000040
#define ISDN_PID_L2_B_MODEM 0x42000080
#define ISDN_PID_L2_B_X75SLPV42BIS 0x42000100
#define ISDN_PID_L2_B_V120ASYNC 0x42000200
#define ISDN_PID_L2_B_V120ASYNCV42BIS 0x42000400
#define ISDN_PID_L2_B_V120TRANS 0x42000800
#define ISDN_PID_L2_B_LAPDFREESAPI 0x42001000
#define ISDN_PID_L3_B_TRANS 0x43000001
#define ISDN_PID_L3_B_T90NL 0x43000002
#define ISDN_PID_L3_B_X25DTE 0x43000004