use of data info parameter (dinfo)
This commit is contained in:
parent
433a4b2929
commit
5ff9bc70f1
|
@ -576,7 +576,7 @@ HDLC_irq_main(fritzpnppci *fc)
|
|||
}
|
||||
|
||||
static int
|
||||
hdlc_down(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg)
|
||||
hdlc_down(hisaxif_t *hif, u_int prim, int dinfo, int len, void *arg)
|
||||
{
|
||||
bchannel_t *bch;
|
||||
fritzpnppci *fc;
|
||||
|
@ -623,7 +623,7 @@ hdlc_down(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg)
|
|||
test_and_clear_bit(BC_FLG_BUSY, &bch->Flag);
|
||||
modehdlc(bch, 0, bch->channel);
|
||||
bch->inst.up.func(&bch->inst.up,
|
||||
PH_DEACTIVATE | CONFIRM, nr, 0, NULL);
|
||||
PH_DEACTIVATE | CONFIRM, 0, 0, NULL);
|
||||
break;
|
||||
}
|
||||
return(0);
|
||||
|
@ -984,7 +984,7 @@ setup_fritz(fritzpnppci *fc, u_int io_cfg, u_int irq_cfg)
|
|||
}
|
||||
|
||||
static int
|
||||
dummy_down(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
||||
dummy_down(hisaxif_t *hif, u_int prim, int dinfo, int len, void *arg) {
|
||||
fritzpnppci *card;
|
||||
|
||||
if (!hif || !hif->fdata)
|
||||
|
|
|
@ -287,7 +287,8 @@ capi20_manager(void *data, u_int prim, void *arg) {
|
|||
case MGR_RELEASE | INDICATION:
|
||||
if (ctrl) {
|
||||
printk(KERN_DEBUG "release_capi20 id %x\n", ctrl->inst.st->id);
|
||||
delContr(ctrl);
|
||||
contrDestr(ctrl);
|
||||
kfree(ctrl);
|
||||
} else
|
||||
printk(KERN_WARNING "capi20_manager release no instance\n");
|
||||
break;
|
||||
|
@ -326,16 +327,17 @@ int Capi20Init(void)
|
|||
void cleanup_module(void)
|
||||
{
|
||||
int err;
|
||||
Contr_t *contrlist = (Contr_t *)capi_obj.ilist;
|
||||
Contr_t *contr;
|
||||
|
||||
if ((err = HiSax_unregister(&capi_obj))) {
|
||||
printk(KERN_ERR "Can't unregister User DSS1 error(%d)\n", err);
|
||||
}
|
||||
if (contrlist) {
|
||||
if (capi_obj.ilist) {
|
||||
printk(KERN_WARNING "hisaxl3 contrlist not empty\n");
|
||||
while(contrlist)
|
||||
delContr(contrlist);
|
||||
capi_obj.ilist = NULL;
|
||||
while((contr = capi_obj.ilist)) {
|
||||
contrDestr(contr);
|
||||
kfree(contr);
|
||||
}
|
||||
}
|
||||
detach_capi_driver(&hisax_driver);
|
||||
free_listen();
|
||||
|
|
|
@ -183,8 +183,8 @@ void contrDelPlci(Contr_t *contr, struct _Plci *plci);
|
|||
void contrDummyInd(Contr_t *, __u32, void *);
|
||||
DummyProcess_t *contrNewDummyPc(Contr_t *contr);
|
||||
DummyProcess_t *contrId2DummyPc(Contr_t *contr, __u16 invokeId);
|
||||
int contrL4L3(Contr_t *, __u32, l3msg_t *);
|
||||
int contrL3L4(hisaxif_t *, u_int, u_int, int, void *);
|
||||
int contrL4L3(Contr_t *, __u32, int, int, void *);
|
||||
int contrL3L4(hisaxif_t *, u_int, int, int, void *);
|
||||
BInst_t *contrSelChannel(Contr_t *, int);
|
||||
// ---------------------------------------------------------------------------
|
||||
// struct Listen
|
||||
|
@ -279,7 +279,7 @@ void plciAttachCplci(Plci_t *plci, struct _Cplci *cplci);
|
|||
void plciDetachCplci(Plci_t *plci, struct _Cplci *cplci);
|
||||
void plciNewCrInd(Plci_t *plci, void *);
|
||||
void plciNewCrReq(Plci_t *plci);
|
||||
int plciL4L3(Plci_t *plci, __u32 prim, void *arg);
|
||||
int plciL4L3(Plci_t *, __u32, int, void *);
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// struct Cplci
|
||||
|
|
|
@ -190,11 +190,14 @@ void contrSendMessage(Contr_t *contr, struct sk_buff *skb)
|
|||
|
||||
void contrLoadFirmware(Contr_t *contr, int len, void *data)
|
||||
{
|
||||
l3msg_t fmsg;
|
||||
struct firm {
|
||||
int len;
|
||||
void *data;
|
||||
} firm;
|
||||
|
||||
fmsg.id = len;
|
||||
fmsg.arg = data;
|
||||
contr->inst.obj->ctrl(contr->inst.st, MGR_LOADFIRM | REQUEST, &fmsg);
|
||||
firm.len = len;
|
||||
firm.data = data;
|
||||
contr->inst.obj->ctrl(contr->inst.st, MGR_LOADFIRM | REQUEST, &firm);
|
||||
contrRun(contr);
|
||||
}
|
||||
|
||||
|
@ -312,40 +315,40 @@ static Plci_t
|
|||
}
|
||||
|
||||
int
|
||||
contrL3L4(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg)
|
||||
contrL3L4(hisaxif_t *hif, u_int prim, int dinfo, int len, void *arg)
|
||||
{
|
||||
Contr_t *contr;
|
||||
Plci_t *plci;
|
||||
l3msg_t *l3msg = arg;
|
||||
__u32 *id = arg;
|
||||
|
||||
if (!hif || !hif->fdata)
|
||||
return(-EINVAL);
|
||||
contr = hif->fdata;
|
||||
if (!l3msg)
|
||||
return(-EINVAL);
|
||||
if (prim == (CC_NEW_CR | INDICATION)) {
|
||||
if (!arg)
|
||||
return(-EINVAL);
|
||||
plci = contrNewPlci(contr);
|
||||
if (!plci)
|
||||
return(-EBUSY);
|
||||
l3msg->id = plci->adrPLCI;
|
||||
} else if ((l3msg->id & ~CONTROLER_MASK) == DUMMY_CR_FLAG) {
|
||||
contrDummyInd(contr, prim, l3msg->arg);
|
||||
*id = plci->adrPLCI;
|
||||
} else if ((dinfo & ~CONTROLER_MASK) == DUMMY_CR_FLAG) {
|
||||
contrDummyInd(contr, prim, arg);
|
||||
} else {
|
||||
if (!(plci = contrGetPLCI4addr(contr, l3msg->id))) {
|
||||
contrDebug(contr, LL_DEB_WARN, __FUNCTION__ ": unknown plci prim(%x) id(%x)", prim, l3msg->id);
|
||||
if (!(plci = contrGetPLCI4addr(contr, dinfo))) {
|
||||
contrDebug(contr, LL_DEB_WARN, __FUNCTION__ ": unknown plci prim(%x) id(%x)", prim, dinfo);
|
||||
return(-ENODEV);
|
||||
}
|
||||
plci_l3l4(plci, prim, l3msg->arg);
|
||||
plci_l3l4(plci, prim, arg);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
int contrL4L3(Contr_t *contr, __u32 prim, l3msg_t *l3msg) {
|
||||
int contrL4L3(Contr_t *contr, __u32 prim, int dinfo, int len, void *arg) {
|
||||
int err = -EINVAL;
|
||||
|
||||
if (contr->inst.down.func) {
|
||||
err = contr->inst.down.func(&contr->inst.down, prim, 0,
|
||||
DTYPE_L3MSGP, l3msg);
|
||||
err = contr->inst.down.func(&contr->inst.down, prim, dinfo,
|
||||
len, arg);
|
||||
}
|
||||
return(err);
|
||||
}
|
||||
|
@ -378,12 +381,6 @@ Contr_t *newContr(hisaxobject_t *ocapi, hisaxstack_t *st, hisaxif_t *hif)
|
|||
return contr;
|
||||
}
|
||||
|
||||
void delContr(Contr_t *contr)
|
||||
{
|
||||
contrDestr(contr);
|
||||
kfree(contr);
|
||||
}
|
||||
|
||||
BInst_t *contrSelChannel(Contr_t *contr, int channr)
|
||||
{
|
||||
hisaxstack_t *cst;
|
||||
|
|
|
@ -110,10 +110,10 @@ remove_object(hisaxobject_t *obj) {
|
|||
}
|
||||
|
||||
static int
|
||||
dummy_if(hisaxif_t *hif, u_int prim, uint nr, int dtyp, void *arg) {
|
||||
dummy_if(hisaxif_t *hif, u_int prim, int dinfo, int len, void *arg) {
|
||||
if (debug & DEBUG_DUMMY_FUNC)
|
||||
printk(KERN_DEBUG "hisax dummy_if prim:%x hif:%p nr: %d dtyp %x arg:%p\n",
|
||||
prim, hif, nr, dtyp, arg);
|
||||
printk(KERN_DEBUG __FUNCTION__": prim:%x hif:%p dinfo:%x len:%d arg:%p\n",
|
||||
prim, hif, dinfo, len, arg);
|
||||
return(-EINVAL);
|
||||
}
|
||||
|
||||
|
|
|
@ -294,7 +294,7 @@ static void plci_connect_req(struct FsmInst *fi, int event, void *arg)
|
|||
}
|
||||
|
||||
plciNewCrReq(plci);
|
||||
plciL4L3(plci, CC_SETUP | REQUEST, &setup_req);
|
||||
plciL4L3(plci, CC_SETUP | REQUEST, sizeof(SETUP_t), &setup_req);
|
||||
answer:
|
||||
capi_cmsg_answer(cmsg);
|
||||
cmsg->Info = Info;
|
||||
|
@ -326,21 +326,30 @@ static void plci_suspend_req(struct FsmInst *fi, int event, void *arg)
|
|||
{
|
||||
Cplci_t *cplci = fi->userdata;
|
||||
Plci_t *plci = cplci->plci;
|
||||
int len;
|
||||
|
||||
plciL4L3(plci, CC_SUSPEND | REQUEST, arg);
|
||||
if (arg)
|
||||
len = sizeof(SUSPEND_t);
|
||||
else
|
||||
len = 0;
|
||||
plciL4L3(plci, CC_SUSPEND | REQUEST, len, arg);
|
||||
}
|
||||
|
||||
static void plci_resume_req(struct FsmInst *fi, int event, void *arg)
|
||||
{
|
||||
Cplci_t *cplci = fi->userdata;
|
||||
Plci_t *plci = cplci->plci;
|
||||
|
||||
int len;
|
||||
|
||||
if (arg)
|
||||
len = sizeof(RESUME_t);
|
||||
else
|
||||
len = 0;
|
||||
|
||||
// we already sent CONF with Info = SuppInfo = 0
|
||||
|
||||
FsmChangeState(fi, ST_PLCI_P_RES);
|
||||
|
||||
plciNewCrReq(plci);
|
||||
plciL4L3(plci, CC_RESUME | REQUEST, arg);
|
||||
plciL4L3(plci, CC_RESUME | REQUEST, len, arg);
|
||||
}
|
||||
|
||||
static void plci_alert_req(struct FsmInst *fi, int event, void *arg)
|
||||
|
@ -356,7 +365,8 @@ static void plci_alert_req(struct FsmInst *fi, int event, void *arg)
|
|||
} else {
|
||||
Info = cmsg2alerting_req(cmsg, &alerting_req);
|
||||
if (Info == 0) {
|
||||
plciL4L3(plci, CC_ALERTING | REQUEST, &alerting_req);
|
||||
plciL4L3(plci, CC_ALERTING | REQUEST,
|
||||
sizeof(ALERTING_t), &alerting_req);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -379,7 +389,7 @@ static void plci_connect_resp(struct FsmInst *fi, int event, void *arg)
|
|||
int_error();
|
||||
}
|
||||
cplciClearOtherApps(cplci);
|
||||
plciL4L3(plci, CC_CONNECT | REQUEST, 0);
|
||||
plciL4L3(plci, CC_CONNECT | REQUEST, 0, NULL);
|
||||
FsmChangeState(fi, ST_PLCI_P_4);
|
||||
break;
|
||||
default : // ignore, reject
|
||||
|
@ -409,9 +419,10 @@ static void plci_connect_resp(struct FsmInst *fi, int event, void *arg)
|
|||
// if we already answered, we can't just ignore but must clear actively
|
||||
memset(&disconnect_req, 0, sizeof(DISCONNECT_t));
|
||||
disconnect_req.CAUSE = cause;
|
||||
plciL4L3(plci, CC_DISCONNECT | REQUEST, &disconnect_req);
|
||||
plciL4L3(plci, CC_DISCONNECT | REQUEST,
|
||||
sizeof(DISCONNECT_t), &disconnect_req);
|
||||
} else {
|
||||
plciL4L3(plci, CC_RESET | REQUEST, 0);
|
||||
plciL4L3(plci, CC_RESET | REQUEST, 0, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -457,12 +468,13 @@ static void plci_disconnect_req(struct FsmInst *fi, int event, void *arg)
|
|||
cplciLinkDown(cplci);
|
||||
|
||||
if (cplci->cause[0]) { // FIXME
|
||||
plciL4L3(plci, CC_RELEASE | REQUEST, 0);
|
||||
plciL4L3(plci, CC_RELEASE | REQUEST, 0, NULL);
|
||||
} else {
|
||||
memset(&disconnect_req, 0, sizeof(DISCONNECT_t));
|
||||
memcpy(cause, "\x02\x80\x90", 3); // normal call clearing
|
||||
disconnect_req.CAUSE = cause;
|
||||
plciL4L3(plci, CC_DISCONNECT | REQUEST, &disconnect_req);
|
||||
plciL4L3(plci, CC_DISCONNECT | REQUEST, sizeof(DISCONNECT_t),
|
||||
&disconnect_req);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -565,7 +577,7 @@ static void plci_cc_disconnect_ind(struct FsmInst *fi, int event, void *arg)
|
|||
memcpy(cplci->cause, disc->CAUSE, 3);
|
||||
if (!(cplci->appl->listen.InfoMask & CAPI_INFOMASK_EARLYB3)) {
|
||||
cplciLinkDown(cplci);
|
||||
plciL4L3(cplci->plci, CC_RELEASE | REQUEST, 0);
|
||||
plciL4L3(cplci->plci, CC_RELEASE | REQUEST, 0, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -751,7 +763,8 @@ static void plci_info_req_overlap(struct FsmInst *fi, int event, void *arg)
|
|||
|
||||
Info = cmsg2info_req(cmsg, &info_req);
|
||||
if (Info == CapiSuccess) {
|
||||
plciL4L3(plci, CC_INFO | REQUEST, &info_req);
|
||||
plciL4L3(plci, CC_INFO | REQUEST, sizeof(INFORMATION_t),
|
||||
&info_req);
|
||||
}
|
||||
|
||||
capi_cmsg_answer(cmsg);
|
||||
|
|
|
@ -97,7 +97,6 @@ typedef struct _bchannel_t {
|
|||
u_char (*BC_Read_Reg)(void *, int, u_char);
|
||||
void (*BC_Write_Reg)(void *, int, u_char, u_char);
|
||||
struct sk_buff *next_skb;
|
||||
u_int next_nr;
|
||||
u_char *tx_buf;
|
||||
int tx_idx;
|
||||
int tx_len;
|
||||
|
@ -187,11 +186,9 @@ typedef struct _dchannel_t {
|
|||
void (*writeisacfifo) (void *, u_char *, int);
|
||||
char *dlog;
|
||||
int debug;
|
||||
u_int reqnr;
|
||||
u_char *rx_buf;
|
||||
int rx_idx;
|
||||
struct sk_buff *next_skb;
|
||||
u_int next_nr;
|
||||
u_char *tx_buf;
|
||||
int tx_idx;
|
||||
int tx_len;
|
||||
|
|
|
@ -24,8 +24,6 @@ static char *ISACVer[] =
|
|||
{"2086/2186 V1.1", "2085 B1", "2085 B2",
|
||||
"2085 V2.3"};
|
||||
|
||||
static u_int msgnr = 1;
|
||||
|
||||
void
|
||||
ISACVersion(dchannel_t *dch, char *s)
|
||||
{
|
||||
|
@ -48,7 +46,6 @@ isac_new_ph(dchannel_t *dch)
|
|||
{
|
||||
u_int prim = PH_SIGNAL | INDICATION;
|
||||
u_int para = 0;
|
||||
u_int nr = msgnr++;
|
||||
hisaxif_t *upif = &dch->inst.up;
|
||||
|
||||
switch (dch->hw.isac.ph_state) {
|
||||
|
@ -63,7 +60,6 @@ isac_new_ph(dchannel_t *dch)
|
|||
case (ISAC_IND_DID):
|
||||
prim = PH_CONTROL | CONFIRM;
|
||||
para = HW_DEACTIVATE;
|
||||
nr = dch->reqnr;
|
||||
break;
|
||||
case (ISAC_IND_DR):
|
||||
prim = PH_CONTROL | INDICATION;
|
||||
|
@ -89,7 +85,7 @@ isac_new_ph(dchannel_t *dch)
|
|||
return;
|
||||
}
|
||||
while(upif) {
|
||||
upif->func(upif, prim, nr, 4, (void *)para);
|
||||
upif->func(upif, prim, 0, 4, (void *)para);
|
||||
upif = upif->next;
|
||||
}
|
||||
}
|
||||
|
@ -106,7 +102,7 @@ isac_rcv(dchannel_t *dch)
|
|||
dev_kfree_skb(skb);
|
||||
continue;
|
||||
}
|
||||
err = upif->func(upif, PH_DATA_IND, msgnr++, DTYPE_SKB, skb);
|
||||
err = upif->func(upif, PH_DATA_IND, DINFO_SKB, 0, skb);
|
||||
if (err < 0) {
|
||||
printk(KERN_WARNING "HiSax: isac deliver err %d\n", err);
|
||||
dev_kfree_skb(skb);
|
||||
|
@ -138,9 +134,8 @@ isac_bh(dchannel_t *dch)
|
|||
if (skb) {
|
||||
dch->next_skb = NULL;
|
||||
dch->inst.up.func(&dch->inst.up, PH_DATA_CNF,
|
||||
dch->next_nr, DTYPE_SKB, skb);
|
||||
} else
|
||||
printk(KERN_WARNING "D_XMTBUFREADY without skb\n");
|
||||
DINFO_SKB, 0, skb);
|
||||
}
|
||||
}
|
||||
if (test_and_clear_bit(D_RCVBUFREADY, &dch->event))
|
||||
isac_rcv(dch);
|
||||
|
@ -306,7 +301,6 @@ isac_interrupt(dchannel_t *dch, u_char val)
|
|||
test_and_clear_bit(FLG_TX_BUSY, &dch->DFlags);
|
||||
}
|
||||
}
|
||||
afterXPR:
|
||||
if (val & 0x04) { /* CISQ */
|
||||
exval = dch->readisac(dch->inst.data, ISAC_CIR0);
|
||||
if (dch->debug & L1_DEB_ISAC)
|
||||
|
@ -497,7 +491,7 @@ isac_interrupt(dchannel_t *dch, u_char val)
|
|||
}
|
||||
|
||||
int
|
||||
ISAC_l1hw(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg)
|
||||
ISAC_l1hw(hisaxif_t *hif, u_int prim, int dinfo, int len, void *arg)
|
||||
{
|
||||
dchannel_t *dch = hif->fdata;
|
||||
struct sk_buff *skb = arg;
|
||||
|
@ -515,7 +509,6 @@ ISAC_l1hw(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg)
|
|||
if (test_and_set_bit(FLG_TX_BUSY, &dch->DFlags)) {
|
||||
test_and_set_bit(FLG_TX_NEXT, &dch->DFlags);
|
||||
dch->next_skb = skb;
|
||||
dch->next_nr = nr;
|
||||
dch->inst.unlock(dch->inst.data);
|
||||
} else {
|
||||
dch->tx_len = skb->len;
|
||||
|
@ -523,12 +516,11 @@ ISAC_l1hw(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg)
|
|||
dch->tx_idx = 0;
|
||||
isac_fill_fifo(dch);
|
||||
dch->inst.unlock(dch->inst.data);
|
||||
dch->inst.up.func(&dch->inst.up, PH_DATA_CNF, nr,
|
||||
DTYPE_SKB, skb);
|
||||
dch->inst.up.func(&dch->inst.up, PH_DATA_CNF,
|
||||
DINFO_SKB, 0, skb);
|
||||
}
|
||||
} else if (prim == (PH_SIGNAL | REQUEST)) {
|
||||
dch->inst.lock(dch->inst.data);
|
||||
dch->reqnr = nr;
|
||||
if (val == INFO3_P8)
|
||||
ph_command(dch, ISAC_CMD_AR8);
|
||||
else if (val == INFO3_P10)
|
||||
|
@ -538,7 +530,6 @@ ISAC_l1hw(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg)
|
|||
dch->inst.unlock(dch->inst.data);
|
||||
} else if (prim == (PH_CONTROL | REQUEST)) {
|
||||
dch->inst.lock(dch->inst.data);
|
||||
dch->reqnr = nr;
|
||||
if (val == HW_RESET) {
|
||||
if ((dch->hw.isac.ph_state == ISAC_IND_EI) ||
|
||||
(dch->hw.isac.ph_state == ISAC_IND_DR) ||
|
||||
|
|
|
@ -68,4 +68,4 @@ extern void free_isac(dchannel_t *dch);
|
|||
|
||||
extern void isac_interrupt(dchannel_t *, u_char);
|
||||
extern void clear_pending_isac_ints(dchannel_t *);
|
||||
extern int ISAC_l1hw(hisaxif_t *, u_int, u_int, int, void *);
|
||||
extern int ISAC_l1hw(hisaxif_t *, u_int, int, int, void *);
|
||||
|
|
|
@ -32,7 +32,6 @@ void isar_setup(bchannel_t *);
|
|||
static void isar_pump_cmd(bchannel_t *, int, u_char);
|
||||
static inline void deliver_status(bchannel_t *, int);
|
||||
|
||||
static u_int msgnr = 1;
|
||||
static int firmwaresize = 0;
|
||||
static u_char *firmware;
|
||||
static u_char *fw_p;
|
||||
|
@ -430,7 +429,7 @@ isar_bh(bchannel_t *bch)
|
|||
if (skb) {
|
||||
bch->next_skb = NULL;
|
||||
bch->inst.up.func(&bch->inst.up, PH_DATA_CNF,
|
||||
bch->next_nr, DTYPE_SKB, skb);
|
||||
DINFO_SKB, 0, skb);
|
||||
} else
|
||||
printk(KERN_WARNING "B_XMTBUFREADY without skb\n");
|
||||
}
|
||||
|
@ -444,8 +443,7 @@ isar_bh(bchannel_t *bch)
|
|||
dev_kfree_skb(skb);
|
||||
continue;
|
||||
}
|
||||
err = upif->func(upif, PH_DATA_IND, msgnr++,
|
||||
DTYPE_SKB, skb);
|
||||
err = upif->func(upif, PH_DATA_IND, DINFO_SKB, 0, skb);
|
||||
if (err < 0) {
|
||||
printk(KERN_WARNING "HiSax: isar deliver err %d\n",
|
||||
err);
|
||||
|
@ -468,7 +466,7 @@ isar_bh(bchannel_t *bch)
|
|||
|
||||
tt |= TOUCH_TONE_VAL;
|
||||
bch->inst.up.func(&bch->inst.up, PH_CONTROL | INDICATION,
|
||||
msgnr++, sizeof(int), &tt);
|
||||
0, sizeof(int), &tt);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -987,7 +985,7 @@ deliver_status(bchannel_t *bch, int status)
|
|||
{
|
||||
if (bch->debug & L1_DEB_HSCX)
|
||||
debugprint(&bch->inst, "HL->LL FAXIND %x", status);
|
||||
bch->inst.up.func(&bch->inst.up, PH_STATUS | INDICATION, msgnr++,
|
||||
bch->inst.up.func(&bch->inst.up, PH_STATUS | INDICATION, 0,
|
||||
sizeof(int), &status);
|
||||
}
|
||||
|
||||
|
@ -1599,7 +1597,7 @@ isar_setup(bchannel_t *bch)
|
|||
}
|
||||
|
||||
int
|
||||
isar_down(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg)
|
||||
isar_down(hisaxif_t *hif, u_int prim, int dinfo, int len, void *arg)
|
||||
{
|
||||
bchannel_t *bch = hif->fdata;
|
||||
int ret = 0;
|
||||
|
@ -1616,7 +1614,6 @@ isar_down(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg)
|
|||
if (test_and_set_bit(FLG_TX_BUSY, &bch->Flag)) {
|
||||
test_and_set_bit(FLG_TX_NEXT, &bch->Flag);
|
||||
bch->next_skb = skb;
|
||||
bch->next_nr = nr;
|
||||
bch->inst.unlock(bch->inst.data);
|
||||
} else {
|
||||
bch->tx_len = skb->len;
|
||||
|
@ -1624,8 +1621,8 @@ isar_down(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg)
|
|||
bch->tx_idx = 0;
|
||||
isar_fill_fifo(bch);
|
||||
bch->inst.unlock(bch->inst.data);
|
||||
bch->inst.up.func(&bch->inst.up, PH_DATA_CNF, nr,
|
||||
DTYPE_SKB, skb);
|
||||
bch->inst.up.func(&bch->inst.up, PH_DATA_CNF,
|
||||
DINFO_SKB, 0, skb);
|
||||
}
|
||||
} else if ((prim == (PH_ACTIVATE | REQUEST)) ||
|
||||
(prim == (DL_ESTABLISH | REQUEST))) {
|
||||
|
@ -1635,10 +1632,10 @@ isar_down(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg)
|
|||
bch->inst.pid.protocol[1], NULL);
|
||||
bch->inst.unlock(bch->inst.data);
|
||||
if (ret)
|
||||
bch->inst.up.func(&bch->inst.up, prim | CONFIRM, nr,
|
||||
bch->inst.up.func(&bch->inst.up, prim | CONFIRM, 0,
|
||||
ret, NULL);
|
||||
else
|
||||
bch->inst.up.func(&bch->inst.up, prim | CONFIRM, nr,
|
||||
bch->inst.up.func(&bch->inst.up, prim | CONFIRM, 0,
|
||||
0, NULL);
|
||||
} else if ((prim == (PH_DEACTIVATE | REQUEST)) ||
|
||||
(prim == (DL_RELEASE | REQUEST)) ||
|
||||
|
@ -1653,7 +1650,7 @@ isar_down(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg)
|
|||
test_and_clear_bit(BC_FLG_ACTIV, &bch->Flag);
|
||||
bch->inst.unlock(bch->inst.data);
|
||||
if (prim != (MGR_DELIF | REQUEST))
|
||||
bch->inst.up.func(&bch->inst.up, prim | CONFIRM, nr++,
|
||||
bch->inst.up.func(&bch->inst.up, prim | CONFIRM, 0,
|
||||
0, NULL);
|
||||
} else if (prim == (PH_CONTROL | REQUEST)) {
|
||||
int *val = arg;
|
||||
|
@ -1667,7 +1664,7 @@ isar_down(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg)
|
|||
isar_pump_cmd(bch, PCTRL_CMD_TDTMF, (*val & 0xff));
|
||||
bch->inst.unlock(bch->inst.data);
|
||||
bch->inst.up.func(&bch->inst.up, PH_CONTROL | CONFIRM,
|
||||
nr++, 0, 0);
|
||||
0, 0, 0);
|
||||
} else {
|
||||
printk(KERN_WARNING "isar_down TOUCH_TONE_SEND wrong protocol %x\n",
|
||||
bch->protocol);
|
||||
|
@ -1682,14 +1679,14 @@ isar_down(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg)
|
|||
}
|
||||
fw_p = firmware;
|
||||
bch->inst.up.func(&bch->inst.up, PH_CONTROL | RESPONSE,
|
||||
nr++, 0, 0);
|
||||
0, 0, NULL);
|
||||
} else if (*val == HW_FIRM_DATA) {
|
||||
val++;
|
||||
len = *val++;
|
||||
memcpy(fw_p, val, len);
|
||||
fw_p += len;
|
||||
bch->inst.up.func(&bch->inst.up, PH_CONTROL | RESPONSE,
|
||||
nr++, 0, 0);
|
||||
0, 0, NULL);
|
||||
} else if (*val == HW_FIRM_END) {
|
||||
if ((fw_p - firmware) == firmwaresize)
|
||||
ret = isar_load_firmware(bch, firmware, firmwaresize);
|
||||
|
@ -1702,7 +1699,7 @@ isar_down(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg)
|
|||
fw_p = firmware = NULL;
|
||||
firmwaresize = 0;
|
||||
bch->inst.up.func(&bch->inst.up, PH_CONTROL | RESPONSE,
|
||||
nr++, 0, 0);
|
||||
0, 0, NULL);
|
||||
}
|
||||
} else {
|
||||
printk(KERN_WARNING "isar_down unknown prim(%x)\n", prim);
|
||||
|
|
|
@ -211,5 +211,5 @@ extern int ISARVersion(bchannel_t *bch, char *s);
|
|||
extern void isar_int_main(bchannel_t *bch);
|
||||
extern int init_isar(bchannel_t *bch);
|
||||
extern void free_isar(bchannel_t *bch);
|
||||
extern int isar_down(hisaxif_t *, u_int, u_int, int, void *);
|
||||
extern int isar_down(hisaxif_t *, u_int, int, int, void *);
|
||||
extern int isar_load_firmware(bchannel_t *bch, u_char *buf, int size);
|
||||
|
|
|
@ -61,8 +61,7 @@ static int SendMsg(l3_process_t *pc, int state) {
|
|||
memcpy(skb_put(skb, l), &pc->obuf[0], l);
|
||||
if (state != -1)
|
||||
newl3state(pc, state);
|
||||
if ((ret=l3_msg(pc->l3, DL_DATA | REQUEST, pc->l3->msgnr++,
|
||||
DTYPE_SKB, skb)))
|
||||
if ((ret=l3_msg(pc->l3, DL_DATA | REQUEST, DINFO_SKB, 0, skb)))
|
||||
dev_kfree_skb(skb);
|
||||
return(ret);
|
||||
}
|
||||
|
@ -81,8 +80,7 @@ l3dss1_message(l3_process_t *pc, u_char mt)
|
|||
*p++ = 1;
|
||||
*p++ = pc->callref ^ 0x80;
|
||||
*p++ = mt;
|
||||
if ((ret=l3_msg(pc->l3, DL_DATA | REQUEST, pc->l3->msgnr++,
|
||||
DTYPE_SKB, skb)))
|
||||
if ((ret=l3_msg(pc->l3, DL_DATA | REQUEST, DINFO_SKB, 0, skb)))
|
||||
dev_kfree_skb(skb);
|
||||
return(ret);
|
||||
}
|
||||
|
@ -615,7 +613,7 @@ l3dss1_release_cmpl_req(l3_process_t *pc, u_char pr, void *arg)
|
|||
newl3state(pc, 0);
|
||||
l3dss1_message(pc, MT_RELEASE_COMPLETE);
|
||||
}
|
||||
hisax_l3up(pc, CC_RELEASE | INDICATION, pc);
|
||||
hisax_l3up(pc, CC_RELEASE_COMPLETE | CONFIRM, 0, NULL);
|
||||
release_l3_process(pc);
|
||||
}
|
||||
|
||||
|
@ -753,7 +751,8 @@ l3dss1_release_cmpl(l3_process_t *pc, u_char pr, void *arg)
|
|||
findie(skb->data, skb->len, IE_SIGNAL, 0);
|
||||
pc->para.RELEASE_COMPLETE.USER_USER =
|
||||
findie(skb->data, skb->len, IE_USER_USER, 0);
|
||||
hisax_l3up(pc, CC_RELEASE_COMPLETE | INDICATION, &pc->para.RELEASE_COMPLETE);
|
||||
hisax_l3up(pc, CC_RELEASE_COMPLETE | INDICATION,
|
||||
sizeof(RELEASE_COMPLETE_t), &pc->para.RELEASE_COMPLETE);
|
||||
release_l3_process(pc);
|
||||
}
|
||||
|
||||
|
@ -786,7 +785,7 @@ l3dss1_alerting(l3_process_t *pc, u_char pr, void *arg)
|
|||
findie(skb->data, skb->len, IE_USER_USER, 0);
|
||||
if (ret)
|
||||
l3dss1_std_ie_err(pc, ret);
|
||||
hisax_l3up(pc, CC_ALERTING | INDICATION, &pc->para.ALERTING);
|
||||
hisax_l3up(pc, CC_ALERTING | INDICATION, sizeof(ALERTING_t), &pc->para.ALERTING);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -835,7 +834,8 @@ l3dss1_call_proc(l3_process_t *pc, u_char pr, void *arg)
|
|||
L3AddTimer(&pc->timer, T310, CC_T310);
|
||||
if (ret) /* STATUS for none mandatory IE errors after actions are taken */
|
||||
l3dss1_std_ie_err(pc, ret);
|
||||
hisax_l3up(pc, CC_PROCEEDING | INDICATION, &pc->para.CALL_PROCEEDING);
|
||||
hisax_l3up(pc, CC_PROCEEDING | INDICATION, sizeof(CALL_PROCEEDING_t),
|
||||
&pc->para.CALL_PROCEEDING);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -875,7 +875,7 @@ l3dss1_connect(l3_process_t *pc, u_char pr, void *arg)
|
|||
findie(skb->data, skb->len, IE_USER_USER, 0);
|
||||
if (ret)
|
||||
l3dss1_std_ie_err(pc, ret);
|
||||
hisax_l3up(pc, CC_CONNECT | INDICATION, &pc->para.CONNECT);
|
||||
hisax_l3up(pc, CC_CONNECT | INDICATION, sizeof(CONNECT_t), &pc->para.CONNECT);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -899,7 +899,8 @@ l3dss1_connect_ack(l3_process_t *pc, u_char pr, void *arg)
|
|||
findie(skb->data, skb->len, IE_SIGNAL, 0);
|
||||
if (ret)
|
||||
l3dss1_std_ie_err(pc, ret);
|
||||
hisax_l3up(pc, CC_CONNECT_ACKNOWLEDGE | INDICATION, &pc->para.CONNECT_ACKNOWLEDGE);
|
||||
hisax_l3up(pc, CC_CONNECT_ACKNOWLEDGE | INDICATION,
|
||||
sizeof(CONNECT_ACKNOWLEDGE_t), &pc->para.CONNECT_ACKNOWLEDGE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -939,7 +940,8 @@ l3dss1_disconnect(l3_process_t *pc, u_char pr, void *arg)
|
|||
else
|
||||
newl3state(pc, 12);
|
||||
if (11 != ret)
|
||||
hisax_l3up(pc, CC_DISCONNECT | INDICATION, &pc->para.DISCONNECT);
|
||||
hisax_l3up(pc, CC_DISCONNECT | INDICATION, sizeof(DISCONNECT_t),
|
||||
&pc->para.DISCONNECT);
|
||||
else if (!cause)
|
||||
l3dss1_release_req(pc, pr, NULL);
|
||||
if (cause) {
|
||||
|
@ -992,7 +994,8 @@ l3dss1_setup_ack(l3_process_t *pc, u_char pr, void *arg)
|
|||
L3AddTimer(&pc->timer, T304, CC_T304);
|
||||
if (ret) /* STATUS for none mandatory IE errors after actions are taken */
|
||||
l3dss1_std_ie_err(pc, ret);
|
||||
hisax_l3up(pc, CC_SETUP_ACKNOWLEDGE | INDICATION, &pc->para.SETUP_ACKNOWLEDGE);
|
||||
hisax_l3up(pc, CC_SETUP_ACKNOWLEDGE | INDICATION,
|
||||
sizeof(SETUP_ACKNOWLEDGE_t), &pc->para.SETUP_ACKNOWLEDGE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1121,12 +1124,13 @@ l3dss1_setup(l3_process_t *pc, u_char pr, void *arg)
|
|||
L3AddTimer(&pc->timer, T_CTRL, CC_TCTRL);
|
||||
if (err) /* STATUS for none mandatory IE errors after actions are taken */
|
||||
l3dss1_std_ie_err(pc, err);
|
||||
if (hisax_l3up(pc, CC_NEW_CR | INDICATION, &pc->id)) {
|
||||
if (hisax_l3up(pc, CC_NEW_CR | INDICATION, 4, &pc->id)) {
|
||||
if (pc->l3->debug & L3_DEB_WARN)
|
||||
l3_debug(pc->l3, "cannot register SETUP CR");
|
||||
release_l3_process(pc);
|
||||
} else
|
||||
hisax_l3up(pc, CC_SETUP | INDICATION, &pc->para.SETUP);
|
||||
hisax_l3up(pc, CC_SETUP | INDICATION, sizeof(SETUP_t),
|
||||
&pc->para.SETUP);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1167,7 +1171,7 @@ l3dss1_release(l3_process_t *pc, u_char pr, void *arg)
|
|||
l3dss1_message_cause(pc, MT_RELEASE_COMPLETE, cause);
|
||||
else
|
||||
l3dss1_message(pc, MT_RELEASE_COMPLETE);
|
||||
hisax_l3up(pc, CC_RELEASE | INDICATION, &pc->para.RELEASE);
|
||||
hisax_l3up(pc, CC_RELEASE | INDICATION, sizeof(RELEASE_t), &pc->para.RELEASE);
|
||||
newl3state(pc, 0);
|
||||
release_l3_process(pc);
|
||||
}
|
||||
|
@ -1233,7 +1237,7 @@ l3dss1_progress(l3_process_t *pc, u_char pr, void *arg) {
|
|||
if (err)
|
||||
l3dss1_std_ie_err(pc, err);
|
||||
if (ERR_IE_COMPREHENSION != err)
|
||||
hisax_l3up(pc, CC_PROGRESS | INDICATION, &pc->para.PROGRESS);
|
||||
hisax_l3up(pc, CC_PROGRESS | INDICATION, sizeof(PROGRESS_t), &pc->para.PROGRESS);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1275,7 +1279,8 @@ l3dss1_notify(l3_process_t *pc, u_char pr, void *arg) {
|
|||
if (err)
|
||||
l3dss1_std_ie_err(pc, err);
|
||||
if (ERR_IE_COMPREHENSION != err)
|
||||
hisax_l3up(pc, CC_NOTIFY | INDICATION, &pc->para.NOTIFY);
|
||||
hisax_l3up(pc, CC_NOTIFY | INDICATION, sizeof(NOTIFY_t),
|
||||
&pc->para.NOTIFY);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1288,7 +1293,8 @@ l3dss1_status_enq(l3_process_t *pc, u_char pr, void *arg) {
|
|||
findie(skb->data, skb->len, IE_DISPLAY, 0);
|
||||
l3dss1_std_ie_err(pc, ret);
|
||||
l3dss1_status_send(pc, CAUSE_STATUS_RESPONSE);
|
||||
hisax_l3up(pc, CC_STATUS_ENQUIRY | INDICATION, &pc->para.STATUS_ENQUIRY);
|
||||
hisax_l3up(pc, CC_STATUS_ENQUIRY | INDICATION,
|
||||
sizeof(STATUS_ENQUIRY_t), &pc->para.STATUS_ENQUIRY);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1313,7 +1319,8 @@ l3dss1_information(l3_process_t *pc, u_char pr, void *arg) {
|
|||
L3DelTimer(&pc->timer);
|
||||
L3AddTimer(&pc->timer, T302, CC_T302);
|
||||
}
|
||||
hisax_l3up(pc, CC_INFORMATION | INDICATION, &pc->para.INFORMATION);
|
||||
hisax_l3up(pc, CC_INFORMATION | INDICATION, sizeof(INFORMATION_t),
|
||||
&pc->para.INFORMATION);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1331,18 +1338,18 @@ l3dss1_release_ind(l3_process_t *pc, u_char pr, void *arg)
|
|||
/* ETS 300-104 7.6.1, 8.6.1, 10.6.1... and 16.1
|
||||
* set down layer 3 without sending any message
|
||||
*/
|
||||
hisax_l3up(pc, CC_RELEASE | INDICATION, NULL);
|
||||
hisax_l3up(pc, CC_RELEASE | INDICATION, 0, NULL);
|
||||
newl3state(pc, 0);
|
||||
release_l3_process(pc);
|
||||
} else {
|
||||
hisax_l3up(pc, CC_RELEASE | INDICATION, NULL);
|
||||
hisax_l3up(pc, CC_RELEASE | INDICATION, 0, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
l3dss1_restart(l3_process_t *pc, u_char pr, void *arg) {
|
||||
L3DelTimer(&pc->timer);
|
||||
hisax_l3up(pc, CC_RELEASE | INDICATION, NULL);
|
||||
hisax_l3up(pc, CC_RELEASE | INDICATION, 0, NULL);
|
||||
release_l3_process(pc);
|
||||
}
|
||||
|
||||
|
@ -1394,11 +1401,13 @@ l3dss1_status(l3_process_t *pc, u_char pr, void *arg) {
|
|||
* if received MT_STATUS with cause == 111 and call
|
||||
* state == 0, then we must set down layer 3
|
||||
*/
|
||||
hisax_l3up(pc, CC_RELEASE | INDICATION, &pc->para.STATUS);
|
||||
hisax_l3up(pc, CC_STATUS| INDICATION, sizeof(STATUS_t),
|
||||
&pc->para.STATUS);
|
||||
newl3state(pc, 0);
|
||||
release_l3_process(pc);
|
||||
} else
|
||||
hisax_l3up(pc, CC_STATUS | INDICATION, &pc->para.STATUS);
|
||||
hisax_l3up(pc, CC_STATUS | INDICATION, sizeof(STATUS_t),
|
||||
&pc->para.STATUS);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1417,7 +1426,8 @@ l3dss1_facility(l3_process_t *pc, u_char pr, void *arg)
|
|||
}
|
||||
pc->para.FACILITY.DISPLAY =
|
||||
findie(skb->data, skb->len, IE_DISPLAY, 0);
|
||||
hisax_l3up(pc, CC_FACILITY | INDICATION, &pc->para.FACILITY);
|
||||
hisax_l3up(pc, CC_FACILITY | INDICATION, sizeof(FACILITY_t),
|
||||
&pc->para.FACILITY);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1435,7 +1445,8 @@ l3dss1_suspend_ack(l3_process_t *pc, u_char pr, void *arg) {
|
|||
if ((ret = check_infoelements(pc, skb, ie_SUSPEND_ACKNOWLEDGE)))
|
||||
if (pc->l3->debug & L3_DEB_WARN)
|
||||
l3_debug(pc->l3, "SUSPACK check ie(%d)",ret);
|
||||
hisax_l3up(pc, CC_SUSPEND_ACKNOWLEDGE | INDICATION, &pc->para.SUSPEND_ACKNOWLEDGE);
|
||||
hisax_l3up(pc, CC_SUSPEND_ACKNOWLEDGE | INDICATION,
|
||||
sizeof(SUSPEND_ACKNOWLEDGE_t), &pc->para.SUSPEND_ACKNOWLEDGE);
|
||||
release_l3_process(pc);
|
||||
}
|
||||
|
||||
|
@ -1464,7 +1475,8 @@ l3dss1_suspend_rej(l3_process_t *pc, u_char pr, void *arg)
|
|||
return;
|
||||
}
|
||||
L3DelTimer(&pc->timer);
|
||||
hisax_l3up(pc, CC_SUSPEND_REJECT | INDICATION, &pc->para.SUSPEND_REJECT);
|
||||
hisax_l3up(pc, CC_SUSPEND_REJECT | INDICATION,
|
||||
sizeof(SUSPEND_REJECT_t), &pc->para.SUSPEND_REJECT);
|
||||
newl3state(pc, 10);
|
||||
if (ret) /* STATUS for none mandatory IE errors after actions are taken */
|
||||
l3dss1_std_ie_err(pc, ret);
|
||||
|
@ -1501,7 +1513,8 @@ l3dss1_resume_ack(l3_process_t *pc, u_char pr, void *arg)
|
|||
pc->para.RESUME_ACKNOWLEDGE.DISPLAY =
|
||||
findie(skb->data, skb->len, IE_DISPLAY, 0);
|
||||
L3DelTimer(&pc->timer);
|
||||
hisax_l3up(pc, CC_RESUME_ACKNOWLEDGE | INDICATION, &pc->para.RESUME_ACKNOWLEDGE);
|
||||
hisax_l3up(pc, CC_RESUME_ACKNOWLEDGE | INDICATION,
|
||||
sizeof(RESUME_ACKNOWLEDGE_t), &pc->para.RESUME_ACKNOWLEDGE);
|
||||
newl3state(pc, 10);
|
||||
if (ret) /* STATUS for none mandatory IE errors after actions are taken */
|
||||
l3dss1_std_ie_err(pc, ret);
|
||||
|
@ -1532,7 +1545,8 @@ l3dss1_resume_rej(l3_process_t *pc, u_char pr, void *arg)
|
|||
return;
|
||||
}
|
||||
L3DelTimer(&pc->timer);
|
||||
hisax_l3up(pc, CC_RESUME_REJECT | INDICATION, &pc->para.RESUME_REJECT);
|
||||
hisax_l3up(pc, CC_RESUME_REJECT | INDICATION, sizeof(RESUME_REJECT_t),
|
||||
&pc->para.RESUME_REJECT);
|
||||
newl3state(pc, 0);
|
||||
if (ret) /* STATUS for none mandatory IE errors after actions are taken */
|
||||
l3dss1_std_ie_err(pc, ret);
|
||||
|
@ -1567,7 +1581,7 @@ l3dss1_global_restart(l3_process_t *pc, u_char pr, void *arg)
|
|||
if ((ri & 7) == 7)
|
||||
dss1man(up, CC_RESTART | REQUEST, NULL);
|
||||
else if (up->bc == chan)
|
||||
hisax_l3up(up, CC_RESTART | REQUEST, up);
|
||||
hisax_l3up(up, CC_RESTART | REQUEST, 0, NULL);
|
||||
up = up->next;
|
||||
}
|
||||
MsgStart(pc, MT_RESTART_ACKNOWLEDGE);
|
||||
|
@ -1593,7 +1607,7 @@ l3dss1_t302(l3_process_t *pc, u_char pr, void *arg)
|
|||
L3DelTimer(&pc->timer);
|
||||
newl3state(pc, 11);
|
||||
l3dss1_message_cause(pc, MT_DISCONNECT, CAUSE_INVALID_NUMBER);
|
||||
hisax_l3up(pc, CC_TIMEOUT | INDICATION, NULL);
|
||||
hisax_l3up(pc, CC_TIMEOUT | INDICATION, 0, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1610,7 +1624,7 @@ l3dss1_t303(l3_process_t *pc, u_char pr, void *arg)
|
|||
}
|
||||
}
|
||||
l3dss1_message_cause(pc, MT_RELEASE_COMPLETE, CAUSE_TIMER_EXPIRED);
|
||||
hisax_l3up(pc, CC_TIMEOUT | INDICATION, NULL);
|
||||
hisax_l3up(pc, CC_TIMEOUT | INDICATION, 0, NULL);
|
||||
release_l3_process(pc);
|
||||
}
|
||||
|
||||
|
@ -1620,7 +1634,7 @@ l3dss1_t304(l3_process_t *pc, u_char pr, void *arg)
|
|||
L3DelTimer(&pc->timer);
|
||||
newl3state(pc, 11);
|
||||
l3dss1_message_cause(pc, MT_DISCONNECT, CAUSE_TIMER_EXPIRED);
|
||||
hisax_l3up(pc, CC_TIMEOUT | INDICATION, NULL);
|
||||
hisax_l3up(pc, CC_TIMEOUT | INDICATION, 0, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1642,7 +1656,7 @@ l3dss1_t310(l3_process_t *pc, u_char pr, void *arg)
|
|||
L3DelTimer(&pc->timer);
|
||||
newl3state(pc, 11);
|
||||
l3dss1_message_cause(pc, MT_DISCONNECT, CAUSE_TIMER_EXPIRED);
|
||||
hisax_l3up(pc, CC_TIMEOUT | INDICATION, NULL);
|
||||
hisax_l3up(pc, CC_TIMEOUT | INDICATION, 0, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1651,7 +1665,7 @@ l3dss1_t313(l3_process_t *pc, u_char pr, void *arg)
|
|||
L3DelTimer(&pc->timer);
|
||||
newl3state(pc, 11);
|
||||
l3dss1_message_cause(pc, MT_DISCONNECT, CAUSE_TIMER_EXPIRED);
|
||||
hisax_l3up(pc, CC_TIMEOUT | INDICATION, NULL);
|
||||
hisax_l3up(pc, CC_TIMEOUT | INDICATION, 0, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1667,7 +1681,7 @@ static void
|
|||
l3dss1_t308_2(l3_process_t *pc, u_char pr, void *arg)
|
||||
{
|
||||
L3DelTimer(&pc->timer);
|
||||
hisax_l3up(pc, CC_TIMEOUT | INDICATION, NULL);
|
||||
hisax_l3up(pc, CC_TIMEOUT | INDICATION, 0, NULL);
|
||||
release_l3_process(pc);
|
||||
}
|
||||
|
||||
|
@ -1679,7 +1693,7 @@ l3dss1_t318(l3_process_t *pc, u_char pr, void *arg)
|
|||
pc->cause = 102; /* Timer expiry */
|
||||
pc->para.loc = 0; /* local */
|
||||
#endif
|
||||
hisax_l3up(pc, CC_RESUME_REJECT | INDICATION, NULL);
|
||||
hisax_l3up(pc, CC_RESUME_REJECT | INDICATION, 0, NULL);
|
||||
newl3state(pc, 19);
|
||||
l3dss1_message(pc, MT_RELEASE);
|
||||
L3AddTimer(&pc->timer, T308, CC_T308_1);
|
||||
|
@ -1693,7 +1707,7 @@ l3dss1_t319(l3_process_t *pc, u_char pr, void *arg)
|
|||
pc->cause = 102; /* Timer expiry */
|
||||
pc->para.loc = 0; /* local */
|
||||
#endif
|
||||
hisax_l3up(pc, CC_SUSPEND_REJECT | INDICATION, NULL);
|
||||
hisax_l3up(pc, CC_SUSPEND_REJECT | INDICATION, 0, NULL);
|
||||
newl3state(pc, 10);
|
||||
}
|
||||
|
||||
|
@ -1709,7 +1723,7 @@ l3dss1_dl_reset(l3_process_t *pc, u_char pr, void *arg)
|
|||
cause[1] = 0x80 | CAUSE_LOC_USER;
|
||||
cause[2] = 0x80 | CAUSE_TEMPORARY_FAILURE;
|
||||
l3dss1_disconnect_req(pc, pr, &disc);
|
||||
hisax_l3up(pc, CC_DISCONNECT | REQUEST, &disc);
|
||||
hisax_l3up(pc, CC_DISCONNECT | REQUEST, sizeof(DISCONNECT_t), &disc);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1720,7 +1734,7 @@ l3dss1_dl_release(l3_process_t *pc, u_char pr, void *arg)
|
|||
pc->cause = 0x1b; /* Destination out of order */
|
||||
pc->para.loc = 0;
|
||||
#endif
|
||||
hisax_l3up(pc, DL_RELEASE | INDICATION, NULL);
|
||||
hisax_l3up(pc, DL_RELEASE | INDICATION, 0, NULL);
|
||||
release_l3_process(pc);
|
||||
}
|
||||
|
||||
|
@ -1729,7 +1743,7 @@ l3dss1_dl_reestablish(l3_process_t *pc, u_char pr, void *arg)
|
|||
{
|
||||
L3DelTimer(&pc->timer);
|
||||
L3AddTimer(&pc->timer, T309, CC_T309);
|
||||
l3_msg(pc->l3, DL_ESTABLISH | REQUEST, pc->l3->msgnr++, 0, NULL);
|
||||
l3_msg(pc->l3, DL_ESTABLISH | REQUEST, 0, 0, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1911,7 +1925,7 @@ global_handler(layer3_t *l3, int mt, struct sk_buff *skb)
|
|||
}
|
||||
|
||||
static int
|
||||
dss1_fromdown(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
||||
dss1_fromdown(hisaxif_t *hif, u_int prim, int dinfo, int len, void *arg) {
|
||||
layer3_t *l3;
|
||||
int i, mt, cr, cause, callState;
|
||||
char *ptr;
|
||||
|
@ -1929,7 +1943,7 @@ dss1_fromdown(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
|||
case (DL_ESTABLISH | INDICATION):
|
||||
case (DL_RELEASE | INDICATION):
|
||||
case (DL_RELEASE | CONFIRM):
|
||||
l3_msg(l3, prim, nr, dtyp, arg);
|
||||
l3_msg(l3, prim, dinfo, len, arg);
|
||||
return(0);
|
||||
break;
|
||||
default:
|
||||
|
@ -1937,10 +1951,10 @@ dss1_fromdown(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
|||
"HiSax dss1up unknown pr=%04x\n", prim);
|
||||
return(-EINVAL);
|
||||
}
|
||||
if ((dtyp != DTYPE_SKB) || !arg) {
|
||||
if ((dinfo != DINFO_SKB) || !arg) {
|
||||
printk(KERN_WARNING
|
||||
"HiSax dss1_fromdown prim %x dtyp %x skb %p\n",
|
||||
prim, dtyp, arg);
|
||||
"HiSax dss1_fromdown prim %x dinfo %x skb %p\n",
|
||||
prim, dinfo, arg);
|
||||
return(-EINVAL);
|
||||
}
|
||||
if (skb->len < 3) {
|
||||
|
@ -2084,9 +2098,8 @@ dss1_fromdown(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
|||
}
|
||||
|
||||
static int
|
||||
dss1_fromup(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
||||
dss1_fromup(hisaxif_t *hif, u_int prim, int dinfo, int len, void *arg) {
|
||||
layer3_t *l3;
|
||||
l3msg_t *msg = arg;
|
||||
int i, cr;
|
||||
l3_process_t *proc;
|
||||
|
||||
|
@ -2094,23 +2107,19 @@ dss1_fromup(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
|||
return(-EINVAL);
|
||||
l3 = hif->fdata;
|
||||
if ((DL_ESTABLISH | REQUEST) == prim) {
|
||||
l3_msg(l3, prim, l3->msgnr++, 0, NULL);
|
||||
l3_msg(l3, prim, 0, 0, NULL);
|
||||
return(0);
|
||||
}
|
||||
if (!msg) {
|
||||
printk(KERN_WARNING "dss1_fromup no arg prim(%x)\n", prim);
|
||||
return(-EINVAL);
|
||||
}
|
||||
if ((CC_NEW_CR | REQUEST) == prim) {
|
||||
cr = newcallref();
|
||||
cr |= 0x80;
|
||||
if ((proc = new_l3_process(l3, cr, N303))) {
|
||||
proc->id = msg->id;
|
||||
proc->id = dinfo;
|
||||
return(0);
|
||||
}
|
||||
return(-ENOMEM);
|
||||
} else {
|
||||
proc = getl3proc4id(l3, msg->id);
|
||||
proc = getl3proc4id(l3, dinfo);
|
||||
}
|
||||
if (!proc) {
|
||||
printk(KERN_ERR "HiSax dss1 fromup without proc pr=%04x\n", prim);
|
||||
|
@ -2130,7 +2139,7 @@ dss1_fromup(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
|||
l3_debug(l3, "dss1down state %d prim %#x",
|
||||
proc->state, prim);
|
||||
}
|
||||
downstatelist[i].rout(proc, prim, msg->arg);
|
||||
downstatelist[i].rout(proc, prim, arg);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
|
|
@ -26,14 +26,12 @@ typedef struct _layer1 {
|
|||
struct FsmTimer timer;
|
||||
int debug;
|
||||
int delay;
|
||||
u_int last_nr;
|
||||
hisaxinstance_t inst;
|
||||
} layer1_t;
|
||||
|
||||
static layer1_t *l1list = NULL;
|
||||
static int debug = 0;
|
||||
static hisaxobject_t isdnl1;
|
||||
static u_int msgnr = 1;
|
||||
|
||||
#define TIMER3_VALUE 7000
|
||||
|
||||
|
@ -155,12 +153,12 @@ l1m_debug(struct FsmInst *fi, char *fmt, ...)
|
|||
}
|
||||
|
||||
static int
|
||||
l1up(layer1_t *l1, u_int prim, u_int nr, int dtyp, void *arg) {
|
||||
l1up(layer1_t *l1, u_int prim, int dinfo, int len, void *arg) {
|
||||
int err = -EINVAL;
|
||||
hisaxif_t *upif = &l1->inst.up;
|
||||
|
||||
if (upif) {
|
||||
err = upif->func(upif, prim, nr, dtyp, arg);
|
||||
err = upif->func(upif, prim, dinfo, len, arg);
|
||||
if (err < 0) {
|
||||
printk(KERN_WARNING "HiSax: l1up err %d\n", err);
|
||||
return(err);
|
||||
|
@ -183,7 +181,7 @@ l1_deact_cnf(struct FsmInst *fi, int event, void *arg)
|
|||
FsmChangeState(fi, ST_L1_F3);
|
||||
if (test_bit(FLG_L1_ACTIVATING, &l1->Flags))
|
||||
l1->inst.down.func(&l1->inst.down, PH_CONTROL | REQUEST,
|
||||
msgnr++, 4, (void *)HW_POWERUP);
|
||||
0, 4, (void *)HW_POWERUP);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -204,7 +202,7 @@ l1_power_up_s(struct FsmInst *fi, int event, void *arg)
|
|||
if (test_bit(FLG_L1_ACTIVATING, &l1->Flags)) {
|
||||
FsmChangeState(fi, ST_L1_F4);
|
||||
l1->inst.down.func(&l1->inst.down, PH_SIGNAL | REQUEST,
|
||||
msgnr++, 4, (void *)INFO3_P8);
|
||||
0, 4, (void *)INFO3_P8);
|
||||
FsmRestartTimer(&l1->timer, TIMER3_VALUE, EV_TIMER3, NULL, 2);
|
||||
test_and_set_bit(FLG_L1_T3RUN, &l1->Flags);
|
||||
} else
|
||||
|
@ -234,7 +232,7 @@ l1_info2_ind(struct FsmInst *fi, int event, void *arg)
|
|||
else
|
||||
#endif
|
||||
FsmChangeState(fi, ST_L1_F6);
|
||||
l1->inst.down.func(&l1->inst.down, PH_SIGNAL | REQUEST, msgnr++,
|
||||
l1->inst.down.func(&l1->inst.down, PH_SIGNAL | REQUEST, 0,
|
||||
4, (void *)INFO3_P8);
|
||||
}
|
||||
|
||||
|
@ -249,7 +247,7 @@ l1_info4_ind(struct FsmInst *fi, int event, void *arg)
|
|||
else
|
||||
#endif
|
||||
FsmChangeState(fi, ST_L1_F7);
|
||||
l1->inst.down.func(&l1->inst.down, PH_SIGNAL | REQUEST, msgnr++,
|
||||
l1->inst.down.func(&l1->inst.down, PH_SIGNAL | REQUEST, 0,
|
||||
4, (void *)INFO3_P8);
|
||||
if (test_and_clear_bit(FLG_L1_DEACTTIMER, &l1->Flags))
|
||||
FsmDelTimer(&l1->timer, 4);
|
||||
|
@ -270,8 +268,8 @@ l1_timer3(struct FsmInst *fi, int event, void *arg)
|
|||
test_and_clear_bit(FLG_L1_T3RUN, &l1->Flags);
|
||||
if (test_and_clear_bit(FLG_L1_ACTIVATING, &l1->Flags)) {
|
||||
if (test_and_clear_bit(FLG_L1_DBLOCKED, &l1->Flags))
|
||||
l1up(l1, PH_CONTROL | INDICATION, msgnr++, 4, &db);
|
||||
l1up(l1, PH_DEACTIVATE | INDICATION, msgnr++, 0, NULL);
|
||||
l1up(l1, PH_CONTROL | INDICATION, 0, 4, &db);
|
||||
l1up(l1, PH_DEACTIVATE | INDICATION, 0, 0, NULL);
|
||||
}
|
||||
#ifdef HISAX_UINTERFACE
|
||||
if (!test_bit(FLG_L1_UINT, &l1->Flags))
|
||||
|
@ -279,7 +277,7 @@ l1_timer3(struct FsmInst *fi, int event, void *arg)
|
|||
if (l1->l1m.state != ST_L1_F6) {
|
||||
FsmChangeState(fi, ST_L1_F3);
|
||||
l1->inst.down.func(&l1->inst.down, PH_CONTROL | REQUEST,
|
||||
msgnr++, 4, (void *)HW_POWERUP);
|
||||
0, 4, (void *)HW_POWERUP);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -291,9 +289,9 @@ l1_timer_act(struct FsmInst *fi, int event, void *arg)
|
|||
test_and_clear_bit(FLG_L1_ACTTIMER, &l1->Flags);
|
||||
test_and_set_bit(FLG_L1_ACTIVATED, &l1->Flags);
|
||||
if (test_and_clear_bit(FLG_L1_ACTIVATING, &l1->Flags))
|
||||
l1up(l1, PH_ACTIVATE | CONFIRM, l1->last_nr, 0, NULL);
|
||||
l1up(l1, PH_ACTIVATE | CONFIRM, 0, 0, NULL);
|
||||
else
|
||||
l1up(l1, PH_ACTIVATE | INDICATION, msgnr++, 0, NULL);
|
||||
l1up(l1, PH_ACTIVATE | INDICATION, 0, 0, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -305,9 +303,9 @@ l1_timer_deact(struct FsmInst *fi, int event, void *arg)
|
|||
test_and_clear_bit(FLG_L1_DEACTTIMER, &l1->Flags);
|
||||
test_and_clear_bit(FLG_L1_ACTIVATED, &l1->Flags);
|
||||
if (test_and_clear_bit(FLG_L1_DBLOCKED, &l1->Flags))
|
||||
l1up(l1, PH_CONTROL | INDICATION, msgnr++, 4, &db);
|
||||
l1up(l1, PH_DEACTIVATE | INDICATION, msgnr++, 0, NULL);
|
||||
l1->inst.down.func(&l1->inst.down, PH_CONTROL | REQUEST, msgnr++, 4,
|
||||
l1up(l1, PH_CONTROL | INDICATION, 0, 4, &db);
|
||||
l1up(l1, PH_DEACTIVATE | INDICATION, 0, 0, NULL);
|
||||
l1->inst.down.func(&l1->inst.down, PH_CONTROL | REQUEST, 0, 4,
|
||||
(void *)HW_DEACTIVATE);
|
||||
}
|
||||
|
||||
|
@ -316,7 +314,7 @@ l1_activate_s(struct FsmInst *fi, int event, void *arg)
|
|||
{
|
||||
layer1_t *l1 = fi->userdata;
|
||||
|
||||
l1->inst.down.func(&l1->inst.down, PH_CONTROL | REQUEST, msgnr++, 4,
|
||||
l1->inst.down.func(&l1->inst.down, PH_CONTROL | REQUEST, 0, 4,
|
||||
(void *)HW_RESET);
|
||||
}
|
||||
|
||||
|
@ -329,8 +327,8 @@ l1_activate_no(struct FsmInst *fi, int event, void *arg)
|
|||
if ((!test_bit(FLG_L1_DEACTTIMER, &l1->Flags)) && (!test_bit(FLG_L1_T3RUN, &l1->Flags))) {
|
||||
test_and_clear_bit(FLG_L1_ACTIVATING, &l1->Flags);
|
||||
if (test_and_clear_bit(FLG_L1_DBLOCKED, &l1->Flags))
|
||||
l1up(l1, PH_CONTROL | INDICATION, msgnr++, 4, &db);
|
||||
l1up(l1, PH_DEACTIVATE | INDICATION, msgnr++, 0, NULL);
|
||||
l1up(l1, PH_CONTROL | INDICATION, 0, 4, &db);
|
||||
l1up(l1, PH_DEACTIVATE | INDICATION, 0, 0, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -393,7 +391,7 @@ l1_deact_req_u(struct FsmInst *fi, int event, void *arg)
|
|||
FsmChangeState(fi, ST_L1_RESET);
|
||||
FsmRestartTimer(&l1->timer, 550, EV_TIMER_DEACT, NULL, 2);
|
||||
test_and_set_bit(FLG_L1_DEACTTIMER, &l1->Flags);
|
||||
l1->inst.down.func(&l1->inst.down, PH_CONTROL | REQUEST, msgnr++, 4,
|
||||
l1->inst.down.func(&l1->inst.down, PH_CONTROL | REQUEST, 0, 4,
|
||||
(void *)HW_POWERUP);
|
||||
}
|
||||
|
||||
|
@ -417,7 +415,7 @@ l1_activate_u(struct FsmInst *fi, int event, void *arg)
|
|||
{
|
||||
layer1_t *l1 = fi->userdata;
|
||||
|
||||
l1->inst.down.func(&l1->inst.down, PH_SIGNAL | REQUEST, msgnr++, 4,
|
||||
l1->inst.down.func(&l1->inst.down, PH_SIGNAL | REQUEST, 0, 4,
|
||||
(void *)INFO1);
|
||||
}
|
||||
|
||||
|
@ -471,7 +469,7 @@ l1b_timer_act(struct FsmInst *fi, int event, void *arg)
|
|||
layer1_t *l1 = fi->userdata;
|
||||
|
||||
FsmChangeState(fi, ST_L1_ACTIV);
|
||||
l1up(l1, PH_ACTIVATE | CONFIRM, l1->last_nr, 0, NULL);
|
||||
l1up(l1, PH_ACTIVATE | CONFIRM, 0, 0, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -480,7 +478,7 @@ l1b_timer_deact(struct FsmInst *fi, int event, void *arg)
|
|||
layer1_t *l1 = fi->userdata;
|
||||
|
||||
FsmChangeState(fi, ST_L1_NULL);
|
||||
l1up(l1, PH_DEACTIVATE | CONFIRM, l1->last_nr, 0, NULL);
|
||||
l1up(l1, PH_DEACTIVATE | CONFIRM, 0, 0, NULL);
|
||||
}
|
||||
|
||||
static struct FsmNode L1BFnList[] =
|
||||
|
@ -494,7 +492,7 @@ static struct FsmNode L1BFnList[] =
|
|||
#define L1B_FN_COUNT (sizeof(L1BFnList)/sizeof(struct FsmNode))
|
||||
|
||||
static int
|
||||
l1from_up(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
||||
l1from_up(hisaxif_t *hif, u_int prim, int dinfo, int len, void *arg) {
|
||||
layer1_t *l1;
|
||||
|
||||
if (!hif || !hif->fdata)
|
||||
|
@ -503,14 +501,13 @@ l1from_up(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
|||
switch(prim) {
|
||||
case (PH_DATA | REQUEST):
|
||||
case (PH_CONTROL | REQUEST):
|
||||
return(l1->inst.down.func(&l1->inst.down, prim, nr, dtyp, arg));
|
||||
return(l1->inst.down.func(&l1->inst.down, prim, dinfo, len, arg));
|
||||
break;
|
||||
case (PH_ACTIVATE | REQUEST):
|
||||
if (test_bit(FLG_L1_ACTIVATED, &l1->Flags))
|
||||
l1up(l1, PH_ACTIVATE | CONFIRM, nr, 0, NULL);
|
||||
l1up(l1, PH_ACTIVATE | CONFIRM, 0, 0, NULL);
|
||||
else {
|
||||
test_and_set_bit(FLG_L1_ACTIVATING, &l1->Flags);
|
||||
l1->last_nr = nr;
|
||||
FsmEvent(&l1->l1m, EV_PH_ACTIVATE, arg);
|
||||
}
|
||||
break;
|
||||
|
@ -525,7 +522,7 @@ l1from_up(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
|||
}
|
||||
|
||||
static int
|
||||
l1from_down(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
||||
l1from_down(hisaxif_t *hif, u_int prim, int dinfo, int len, void *arg) {
|
||||
layer1_t *l1;
|
||||
u_int val = (u_int)arg;
|
||||
|
||||
|
@ -535,9 +532,9 @@ l1from_down(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
|||
if (prim == PH_DATA_IND) {
|
||||
if (test_bit(FLG_L1_ACTTIMER, &l1->Flags))
|
||||
FsmEvent(&l1->l1m, EV_TIMER_ACT, NULL);
|
||||
return(l1up(l1, prim, nr, dtyp, arg));
|
||||
return(l1up(l1, prim, dinfo, len, arg));
|
||||
} else if (prim == PH_DATA_CNF) {
|
||||
return(l1up(l1, prim, nr, dtyp, arg));
|
||||
return(l1up(l1, prim, dinfo, len, arg));
|
||||
} else if (prim == (PH_CONTROL | INDICATION)) {
|
||||
if (val == HW_RESET)
|
||||
FsmEvent(&l1->l1m, EV_RESET_IND, arg);
|
||||
|
|
|
@ -104,69 +104,66 @@ static char *strL2Event[] =
|
|||
static int l2addrsize(layer2_t *l2);
|
||||
|
||||
static int
|
||||
l2up(layer2_t *l2, u_int prim, u_int nr, int dtyp, void *arg) {
|
||||
l2up(layer2_t *l2, u_int prim, int dinfo, int len, void *arg) {
|
||||
hisaxif_t *up = &l2->inst.up;
|
||||
int err = -EINVAL;
|
||||
|
||||
if(up)
|
||||
err = up->func(up, prim, nr, dtyp, arg);
|
||||
err = up->func(up, prim, dinfo, len, arg);
|
||||
return(err);
|
||||
}
|
||||
|
||||
static int
|
||||
l2down(layer2_t *l2, u_int prim, u_int nr, int dtyp, void *arg) {
|
||||
l2down(layer2_t *l2, u_int prim, int dinfo, int len, void *arg) {
|
||||
hisaxif_t *down = &l2->inst.down;
|
||||
int err = -EINVAL;
|
||||
|
||||
if (down) {
|
||||
if (prim == PH_DATA_REQ) {
|
||||
if (test_and_set_bit(FLG_L1_BUSY, &l2->flag)) {
|
||||
skb_queue_tail(&l2->ph_queue, arg);
|
||||
skb_queue_tail(&l2->down_queue, arg);
|
||||
return(0);
|
||||
}
|
||||
l2->ph_skb = arg;
|
||||
l2->ph_nr = nr;
|
||||
l2->down_skb = arg;
|
||||
}
|
||||
err = down->func(down, prim, nr, dtyp, arg);
|
||||
err = down->func(down, prim, dinfo, len, arg);
|
||||
} else
|
||||
printk(KERN_WARNING "l2down: no down func prim %x\n", prim);
|
||||
return(err);
|
||||
}
|
||||
|
||||
static int
|
||||
ph_data_confirm(hisaxif_t *up, u_int nr, int dtyp, void *arg) {
|
||||
ph_data_confirm(hisaxif_t *up, int dinfo, int len, void *arg) {
|
||||
layer2_t *l2 = up->fdata;
|
||||
struct sk_buff *skb = arg;
|
||||
hisaxif_t *next = up->next;
|
||||
int ret = -EAGAIN;
|
||||
|
||||
if (test_bit(FLG_L1_BUSY, &l2->flag)) {
|
||||
if (skb == l2->ph_skb) {
|
||||
if ((skb = skb_dequeue(&l2->ph_queue))) {
|
||||
l2->ph_skb = skb;
|
||||
l2->ph_nr = l2->msgnr++;
|
||||
l2down(l2, PH_DATA_REQ, l2->ph_nr, dtyp, skb);
|
||||
if (skb == l2->down_skb) {
|
||||
if ((skb = skb_dequeue(&l2->down_queue))) {
|
||||
l2->down_skb = skb;
|
||||
l2down(l2, PH_DATA_REQ, dinfo, len, skb);
|
||||
} else
|
||||
l2->ph_skb = NULL;
|
||||
l2->down_skb = NULL;
|
||||
if (next)
|
||||
ret = next->func(next, PH_DATA_CNF, nr, dtyp, arg);
|
||||
ret = next->func(next, PH_DATA_CNF, dinfo, len, arg);
|
||||
if (ret) {
|
||||
dev_kfree_skb(arg);
|
||||
ret = 0;
|
||||
}
|
||||
if (!l2->ph_skb) {
|
||||
if (!l2->down_skb) {
|
||||
test_and_clear_bit(FLG_L1_BUSY, &l2->flag);
|
||||
FsmEvent(&l2->l2m, EV_L2_ACK_PULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ret && next)
|
||||
ret = next->func(next, PH_DATA_CNF, nr, dtyp, arg);
|
||||
ret = next->func(next, PH_DATA_CNF, dinfo, len, arg);
|
||||
if (!test_and_set_bit(FLG_L1_BUSY, &l2->flag)) {
|
||||
if ((skb = skb_dequeue(&l2->ph_queue))) {
|
||||
l2->ph_skb = skb;
|
||||
l2->ph_nr = l2->msgnr++;
|
||||
l2down(l2, PH_DATA_REQ, l2->ph_nr, dtyp, skb);
|
||||
if ((skb = skb_dequeue(&l2->down_queue))) {
|
||||
l2->down_skb = skb;
|
||||
l2down(l2, PH_DATA_REQ, 0, 0, skb);
|
||||
} else
|
||||
test_and_clear_bit(FLG_L1_BUSY, &l2->flag);
|
||||
}
|
||||
|
@ -283,7 +280,7 @@ sethdraddr(layer2_t *l2, u_char * header, int rsp)
|
|||
inline static void
|
||||
enqueue_super(layer2_t *l2, struct sk_buff *skb)
|
||||
{
|
||||
l2down(l2, PH_DATA | REQUEST, l2->msgnr++, DTYPE_SKB, skb);
|
||||
l2down(l2, PH_DATA | REQUEST, DINFO_SKB, 0, skb);
|
||||
}
|
||||
|
||||
#define enqueue_ui(a, b) enqueue_super(a, b)
|
||||
|
@ -526,24 +523,21 @@ inline void
|
|||
st5_dl_release_l2l3(layer2_t *l2)
|
||||
{
|
||||
int pr;
|
||||
int nr;
|
||||
|
||||
if (test_and_clear_bit(FLG_PEND_REL, &l2->flag)) {
|
||||
pr = DL_RELEASE | CONFIRM;
|
||||
nr = l2->last_nr;
|
||||
} else {
|
||||
pr = DL_RELEASE | INDICATION;
|
||||
nr = l2->msgnr++;
|
||||
}
|
||||
l2up(l2, pr, nr, 0, NULL);
|
||||
l2up(l2, pr, 0, 0, NULL);
|
||||
}
|
||||
|
||||
inline void
|
||||
lapb_dl_release_l2l3(layer2_t *l2, int f, u_int nr)
|
||||
lapb_dl_release_l2l3(layer2_t *l2, int f)
|
||||
{
|
||||
if (test_bit(FLG_LAPB, &l2->flag))
|
||||
l2down(l2, PH_DEACTIVATE | REQUEST, l2->msgnr++, 0, NULL);
|
||||
l2up(l2, DL_RELEASE | f, nr, 0, NULL);
|
||||
l2down(l2, PH_DEACTIVATE | REQUEST, 0, 0, NULL);
|
||||
l2up(l2, DL_RELEASE | f, 0, 0, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -617,7 +611,7 @@ l2_mdl_assign(struct FsmInst *fi, int event, void *arg)
|
|||
layer2_t *l2 = fi->userdata;
|
||||
|
||||
FsmChangeState(fi, ST_L2_3);
|
||||
l2_tei(l2->tm, MDL_ASSIGN | INDICATION, l2->msgnr++, 0, NULL);
|
||||
l2_tei(l2->tm, MDL_ASSIGN | INDICATION, 0, 0, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -628,7 +622,7 @@ l2_queue_ui_assign(struct FsmInst *fi, int event, void *arg)
|
|||
|
||||
skb_queue_tail(&l2->ui_queue, skb);
|
||||
FsmChangeState(fi, ST_L2_2);
|
||||
l2_tei(l2->tm, MDL_ASSIGN | INDICATION, l2->msgnr++, 0, NULL);
|
||||
l2_tei(l2->tm, MDL_ASSIGN | INDICATION, 0, 0, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -672,7 +666,7 @@ l2_got_ui(struct FsmInst *fi, int event, void *arg)
|
|||
struct sk_buff *skb = arg;
|
||||
|
||||
skb_pull(skb, l2headersize(l2, 1));
|
||||
l2up(l2, DL_UNITDATA | INDICATION, l2->msgnr++, DTYPE_SKB, skb);
|
||||
l2up(l2, DL_UNITDATA | INDICATION, DINFO_SKB, 0, skb);
|
||||
/* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
* in states 1-3 for broadcast
|
||||
*/
|
||||
|
@ -712,7 +706,7 @@ l2_release(struct FsmInst *fi, int event, void *arg)
|
|||
{
|
||||
layer2_t *l2 = fi->userdata;
|
||||
|
||||
l2up(l2, DL_RELEASE | CONFIRM, l2->last_nr, 0, NULL);
|
||||
l2up(l2, DL_RELEASE | CONFIRM, 0, 0, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -753,7 +747,7 @@ l2_start_multi(struct FsmInst *fi, int event, void *arg)
|
|||
FsmChangeState(fi, ST_L2_7);
|
||||
FsmAddTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 3);
|
||||
|
||||
l2up(l2, DL_ESTABLISH | INDICATION, l2->msgnr++, 0, NULL);
|
||||
l2up(l2, DL_ESTABLISH | INDICATION, 0, 0, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -800,7 +794,7 @@ l2_restart_multi(struct FsmInst *fi, int event, void *arg)
|
|||
FsmRestartTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 3);
|
||||
|
||||
if (est)
|
||||
l2up(l2, DL_ESTABLISH | INDICATION, l2->msgnr++, 0, NULL);
|
||||
l2up(l2, DL_ESTABLISH | INDICATION, 0, 0, NULL);
|
||||
|
||||
if (skb_queue_len(&l2->i_queue) && cansend(l2))
|
||||
FsmEvent(fi, EV_L2_ACK_PULL, NULL);
|
||||
|
@ -819,7 +813,7 @@ l2_stop_multi(struct FsmInst *fi, int event, void *arg)
|
|||
send_uframe(l2, UA | get_PollFlagFree(l2, skb), RSP);
|
||||
discard_queue(&l2->i_queue);
|
||||
freewin(l2);
|
||||
lapb_dl_release_l2l3(l2, INDICATION, l2->msgnr++);
|
||||
lapb_dl_release_l2l3(l2, INDICATION);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -828,7 +822,6 @@ l2_connected(struct FsmInst *fi, int event, void *arg)
|
|||
layer2_t *l2 = fi->userdata;
|
||||
struct sk_buff *skb = arg;
|
||||
int pr=-1;
|
||||
u_int nr = l2->last_nr;
|
||||
|
||||
if (!get_PollFlag(l2, skb)) {
|
||||
l2_mdl_error_ua(fi, event, arg);
|
||||
|
@ -842,7 +835,6 @@ l2_connected(struct FsmInst *fi, int event, void *arg)
|
|||
} else if (l2->vs != l2->va) {
|
||||
discard_queue(&l2->i_queue);
|
||||
pr = DL_ESTABLISH | INDICATION;
|
||||
nr = l2->msgnr++;
|
||||
}
|
||||
stop_t200(l2, 5);
|
||||
|
||||
|
@ -853,7 +845,7 @@ l2_connected(struct FsmInst *fi, int event, void *arg)
|
|||
FsmChangeState(fi, ST_L2_7);
|
||||
FsmAddTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 4);
|
||||
if (pr != -1)
|
||||
l2up(l2, pr, nr, 0, NULL);
|
||||
l2up(l2, pr, 0, 0, NULL);
|
||||
|
||||
if (skb_queue_len(&l2->i_queue) && cansend(l2))
|
||||
FsmEvent(fi, EV_L2_ACK_PULL, NULL);
|
||||
|
@ -871,7 +863,7 @@ l2_released(struct FsmInst *fi, int event, void *arg)
|
|||
}
|
||||
dev_kfree_skb(skb);
|
||||
stop_t200(l2, 6);
|
||||
lapb_dl_release_l2l3(l2, CONFIRM, l2->last_nr);
|
||||
lapb_dl_release_l2l3(l2, CONFIRM);
|
||||
FsmChangeState(fi, ST_L2_4);
|
||||
}
|
||||
|
||||
|
@ -898,7 +890,7 @@ l2_st5_dm_release(struct FsmInst *fi, int event, void *arg)
|
|||
if (!test_bit(FLG_L3_INIT, &l2->flag))
|
||||
discard_queue(&l2->i_queue);
|
||||
if (test_bit(FLG_LAPB, &l2->flag))
|
||||
l2down(l2, PH_DEACTIVATE | REQUEST, l2->msgnr++, 0, NULL);
|
||||
l2down(l2, PH_DEACTIVATE | REQUEST, 0, 0, NULL);
|
||||
st5_dl_release_l2l3(l2);
|
||||
FsmChangeState(fi, ST_L2_4);
|
||||
}
|
||||
|
@ -912,7 +904,7 @@ l2_st6_dm_release(struct FsmInst *fi, int event, void *arg)
|
|||
|
||||
if (get_PollFlagFree(l2, skb)) {
|
||||
stop_t200(l2, 8);
|
||||
lapb_dl_release_l2l3(l2, CONFIRM, l2->last_nr);
|
||||
lapb_dl_release_l2l3(l2, CONFIRM);
|
||||
FsmChangeState(fi, ST_L2_4);
|
||||
}
|
||||
}
|
||||
|
@ -1127,7 +1119,7 @@ l2_got_iframe(struct FsmInst *fi, int event, void *arg)
|
|||
else
|
||||
test_and_set_bit(FLG_ACK_PEND, &l2->flag);
|
||||
skb_pull(skb, l2headersize(l2, 0));
|
||||
l2up(l2, DL_DATA | INDICATION, l2->msgnr++, DTYPE_SKB, skb);
|
||||
l2up(l2, DL_DATA | INDICATION, DINFO_SKB, 0, skb);
|
||||
} else {
|
||||
/* n(s)!=v(r) */
|
||||
dev_kfree_skb(skb);
|
||||
|
@ -1189,7 +1181,7 @@ l2_st5_tout_200(struct FsmInst *fi, int event, void *arg)
|
|||
discard_queue(&l2->i_queue);
|
||||
l2mgr(l2, MDL_ERROR | INDICATION, (void *) 'G');
|
||||
if (test_bit(FLG_LAPB, &l2->flag))
|
||||
l2down(l2, PH_DEACTIVATE | REQUEST, l2->msgnr++, 0, NULL);
|
||||
l2down(l2, PH_DEACTIVATE | REQUEST, 0, 0, NULL);
|
||||
st5_dl_release_l2l3(l2);
|
||||
} else {
|
||||
l2->rc++;
|
||||
|
@ -1211,7 +1203,7 @@ l2_st6_tout_200(struct FsmInst *fi, int event, void *arg)
|
|||
FsmChangeState(fi, ST_L2_4);
|
||||
test_and_clear_bit(FLG_T200_RUN, &l2->flag);
|
||||
l2mgr(l2, MDL_ERROR | INDICATION, (void *) 'H');
|
||||
lapb_dl_release_l2l3(l2, CONFIRM, l2->last_nr);
|
||||
lapb_dl_release_l2l3(l2, CONFIRM);
|
||||
} else {
|
||||
l2->rc++;
|
||||
FsmAddTimer(&l2->t200, l2->T200, EV_L2_T200,
|
||||
|
@ -1328,7 +1320,7 @@ l2_pull_iqueue(struct FsmInst *fi, int event, void *arg)
|
|||
memcpy(skb_put(skb, oskb->len), oskb->data, oskb->len);
|
||||
dev_kfree_skb(oskb);
|
||||
}
|
||||
l2down(l2, PH_DATA_REQ, l2->msgnr++, DTYPE_SKB, skb);
|
||||
l2down(l2, PH_DATA_REQ, DINFO_SKB, 0, skb);
|
||||
test_and_clear_bit(FLG_ACK_PEND, &l2->flag);
|
||||
if (!test_and_set_bit(FLG_T200_RUN, &l2->flag)) {
|
||||
FsmDelTimer(&l2->t203, 13);
|
||||
|
@ -1424,7 +1416,7 @@ l2_st3_tei_remove(struct FsmInst *fi, int event, void *arg)
|
|||
|
||||
discard_queue(&l2->ui_queue);
|
||||
l2->tei = -1;
|
||||
l2up(l2, DL_RELEASE | INDICATION, l2->msgnr++, 0, NULL);
|
||||
l2up(l2, DL_RELEASE | INDICATION, 0, 0, NULL);
|
||||
FsmChangeState(fi, ST_L2_1);
|
||||
}
|
||||
|
||||
|
@ -1450,7 +1442,7 @@ l2_st6_tei_remove(struct FsmInst *fi, int event, void *arg)
|
|||
discard_queue(&l2->ui_queue);
|
||||
l2->tei = -1;
|
||||
stop_t200(l2, 18);
|
||||
l2up(l2, DL_RELEASE | CONFIRM, l2->last_nr, 0, NULL);
|
||||
l2up(l2, DL_RELEASE | CONFIRM, 0, 0, NULL);
|
||||
FsmChangeState(fi, ST_L2_1);
|
||||
}
|
||||
|
||||
|
@ -1465,7 +1457,7 @@ l2_tei_remove(struct FsmInst *fi, int event, void *arg)
|
|||
l2->tei = -1;
|
||||
stop_t200(l2, 17);
|
||||
FsmDelTimer(&l2->t203, 19);
|
||||
l2up(l2, DL_RELEASE | INDICATION, l2->msgnr++, 0, NULL);
|
||||
l2up(l2, DL_RELEASE | INDICATION, 0, 0, NULL);
|
||||
FsmChangeState(fi, ST_L2_1);
|
||||
}
|
||||
|
||||
|
@ -1477,7 +1469,7 @@ l2_st14_persistant_da(struct FsmInst *fi, int event, void *arg)
|
|||
discard_queue(&l2->i_queue);
|
||||
discard_queue(&l2->ui_queue);
|
||||
if (test_and_clear_bit(FLG_ESTAB_PEND, &l2->flag))
|
||||
l2up(l2, DL_RELEASE | INDICATION, l2->msgnr++, 0, NULL);
|
||||
l2up(l2, DL_RELEASE | INDICATION, 0, 0, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1500,7 +1492,7 @@ l2_st6_persistant_da(struct FsmInst *fi, int event, void *arg)
|
|||
|
||||
discard_queue(&l2->ui_queue);
|
||||
stop_t200(l2, 20);
|
||||
l2up(l2, DL_RELEASE | CONFIRM, l2->last_nr, 0, NULL);
|
||||
l2up(l2, DL_RELEASE | CONFIRM, 0, 0, NULL);
|
||||
FsmChangeState(fi, ST_L2_4);
|
||||
}
|
||||
|
||||
|
@ -1514,7 +1506,7 @@ l2_persistant_da(struct FsmInst *fi, int event, void *arg)
|
|||
freewin(l2);
|
||||
stop_t200(l2, 19);
|
||||
FsmDelTimer(&l2->t203, 19);
|
||||
l2up(l2, DL_RELEASE | INDICATION, l2->msgnr++, 0, NULL);
|
||||
l2up(l2, DL_RELEASE | INDICATION, 0, 0, NULL);
|
||||
FsmChangeState(fi, ST_L2_4);
|
||||
}
|
||||
|
||||
|
@ -1653,30 +1645,30 @@ static struct FsmNode L2FnList[] =
|
|||
#define L2_FN_COUNT (sizeof(L2FnList)/sizeof(struct FsmNode))
|
||||
|
||||
static int
|
||||
ph_data_indication(hisaxif_t *hif, u_int nr, int dtyp, void *arg) {
|
||||
ph_data_indication(hisaxif_t *hif, int dinfo, int len, void *arg) {
|
||||
layer2_t *l2 = hif->fdata;
|
||||
struct sk_buff *skb = arg;
|
||||
u_char *datap;
|
||||
int ret = -EINVAL;
|
||||
int err = -EINVAL;
|
||||
int psapi, ptei;
|
||||
int len;
|
||||
int l;
|
||||
int c = 0;
|
||||
|
||||
if (!skb) {
|
||||
printk(KERN_WARNING "l2 ph_data_indication no data frame\n");
|
||||
if (hif->next)
|
||||
ret = hif->next->func(hif->next, PH_DATA_IND, nr, dtyp,
|
||||
arg);
|
||||
ret = hif->next->func(hif->next, PH_DATA_IND, dinfo,
|
||||
len, arg);
|
||||
return(ret);
|
||||
}
|
||||
datap = skb->data;
|
||||
len = l2addrsize(l2);
|
||||
if (skb->len <= len) {
|
||||
l = l2addrsize(l2);
|
||||
if (skb->len <= l) {
|
||||
FsmEvent(&l2->l2m, EV_L2_FRAME_ERROR, (void *) 'N');
|
||||
if (hif->next)
|
||||
ret = hif->next->func(hif->next, PH_DATA_IND, nr, dtyp,
|
||||
arg);
|
||||
ret = hif->next->func(hif->next, PH_DATA_IND, dinfo,
|
||||
len, arg);
|
||||
return(ret);
|
||||
}
|
||||
if (test_bit(FLG_LAPD, &l2->flag)) {
|
||||
|
@ -1691,14 +1683,14 @@ ph_data_indication(hisaxif_t *hif, u_int nr, int dtyp, void *arg) {
|
|||
if ((psapi != l2->sapi) && (psapi != TEI_SAPI)) {
|
||||
if (hif->next)
|
||||
ret = hif->next->func(hif->next, PH_DATA_IND,
|
||||
nr, dtyp, arg);
|
||||
dinfo, len, arg);
|
||||
return(ret);
|
||||
}
|
||||
if (ptei == GROUP_TEI) {
|
||||
if (hif->next) {
|
||||
if ((skb = skb_clone(arg, GFP_ATOMIC))) {
|
||||
err = hif->next->func(hif->next,
|
||||
PH_DATA_IND, nr, dtyp, skb);
|
||||
PH_DATA_IND, dinfo, len, skb);
|
||||
if (err)
|
||||
dev_kfree_skb(skb);
|
||||
}
|
||||
|
@ -1706,15 +1698,15 @@ ph_data_indication(hisaxif_t *hif, u_int nr, int dtyp, void *arg) {
|
|||
}
|
||||
if (psapi == TEI_SAPI)
|
||||
return(l2_tei(l2->tm,
|
||||
MDL_UNITDATA | INDICATION, nr, dtyp, skb));
|
||||
MDL_UNITDATA | INDICATION, dinfo, len, skb));
|
||||
} else if ((ptei != l2->tei) || (psapi == TEI_SAPI)) {
|
||||
if (hif->next)
|
||||
ret = hif->next->func(hif->next, PH_DATA_IND,
|
||||
nr, dtyp, arg);
|
||||
dinfo, len, arg);
|
||||
return(ret);
|
||||
}
|
||||
} else
|
||||
datap += len;
|
||||
datap += l;
|
||||
if (!(*datap & 1)) { /* I-Frame */
|
||||
if(!(c = iframe_error(l2, skb)))
|
||||
ret = FsmEvent(&l2->l2m, EV_L2_I, skb);
|
||||
|
@ -1756,7 +1748,7 @@ ph_data_indication(hisaxif_t *hif, u_int nr, int dtyp, void *arg) {
|
|||
}
|
||||
|
||||
static int
|
||||
l2from_down(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
||||
l2from_down(hisaxif_t *hif, u_int prim, int dinfo, int len, void *arg) {
|
||||
layer2_t *l2;
|
||||
int ret = -EINVAL;
|
||||
int *iarg;
|
||||
|
@ -1767,17 +1759,17 @@ l2from_down(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
|||
l2 = hif->fdata;
|
||||
if (!l2) {
|
||||
if (hif->next)
|
||||
ret = hif->next->func(hif->next, prim, nr, dtyp, arg);
|
||||
ret = hif->next->func(hif->next, prim, dinfo, len, arg);
|
||||
return(ret);
|
||||
}
|
||||
switch (prim) {
|
||||
case (PH_DATA_IND):
|
||||
return(ph_data_indication(hif, nr, dtyp, arg));
|
||||
return(ph_data_indication(hif, dinfo, len, arg));
|
||||
case (PH_DATA | CONFIRM):
|
||||
return(ph_data_confirm(hif, nr, dtyp, arg));
|
||||
return(ph_data_confirm(hif, dinfo, len, arg));
|
||||
case (PH_CONTROL | INDICATION):
|
||||
iarg = arg;
|
||||
if (dtyp == 4) {
|
||||
if (len == 4) {
|
||||
if (*iarg == HW_D_BLOCKED)
|
||||
test_and_set_bit(FLG_DCHAN_BUSY,
|
||||
&l2->flag);
|
||||
|
@ -1804,7 +1796,7 @@ l2from_down(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
|||
break;
|
||||
case (MDL_STATUS | REQUEST):
|
||||
if (test_bit(FLG_LAPD, &l2->flag)) {
|
||||
if (l2->tei == dtyp) {
|
||||
if (l2->tei == len) {
|
||||
teimgr_t **p = arg;
|
||||
if (p) {
|
||||
*p = l2->tm;
|
||||
|
@ -1819,12 +1811,12 @@ l2from_down(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
|||
break;
|
||||
}
|
||||
if (hif->next)
|
||||
ret = hif->next->func(hif->next, prim, nr, dtyp, arg);
|
||||
ret = hif->next->func(hif->next, prim, dinfo, len, arg);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
static int
|
||||
l2from_up(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
||||
l2from_up(hisaxif_t *hif, u_int prim, int dinfo, int len, void *arg) {
|
||||
layer2_t *l2;
|
||||
|
||||
printk(KERN_DEBUG __FUNCTION__ ": prim(%x)\n", prim);
|
||||
|
@ -1843,7 +1835,6 @@ l2from_up(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
|||
}
|
||||
break;
|
||||
case (DL_ESTABLISH | REQUEST):
|
||||
l2->last_nr = nr;
|
||||
if (test_bit(FLG_L1_ACTIV, &l2->flag)) {
|
||||
if (test_bit(FLG_LAPD, &l2->flag) ||
|
||||
test_bit(FLG_ORIG, &l2->flag)) {
|
||||
|
@ -1854,13 +1845,12 @@ l2from_up(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
|||
test_bit(FLG_ORIG, &l2->flag)) {
|
||||
test_and_set_bit(FLG_ESTAB_PEND, &l2->flag);
|
||||
}
|
||||
l2down(l2, PH_ACTIVATE | REQUEST, l2->msgnr++, 0, NULL);
|
||||
l2down(l2, PH_ACTIVATE | REQUEST, 0, 0, NULL);
|
||||
}
|
||||
break;
|
||||
case (DL_RELEASE | REQUEST):
|
||||
l2->last_nr = nr;
|
||||
if (test_bit(FLG_LAPB, &l2->flag)) {
|
||||
l2down(l2, PH_DEACTIVATE | REQUEST, l2->msgnr++, 0, NULL);
|
||||
l2down(l2, PH_DEACTIVATE | REQUEST, 0, 0, NULL);
|
||||
}
|
||||
FsmEvent(&l2->l2m, EV_L2_DL_RELEASE_REQ, arg);
|
||||
break;
|
||||
|
@ -1873,7 +1863,7 @@ l2from_up(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
|||
case (MDL_ERROR | RESPONSE):
|
||||
FsmEvent(&l2->l2m, EV_L2_MDL_ERROR, arg);
|
||||
case (MDL_STATUS | REQUEST):
|
||||
l2up(l2, MDL_STATUS | CONFIRM, nr, 0, (void *)l2->tei);
|
||||
l2up(l2, MDL_STATUS | CONFIRM, dinfo, 0, (void *)l2->tei);
|
||||
break;
|
||||
default:
|
||||
l2m_debug(&l2->l2m, "l2 unknown pr %04x", prim);
|
||||
|
@ -1883,13 +1873,13 @@ l2from_up(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
|||
}
|
||||
|
||||
int
|
||||
tei_l2(layer2_t *l2, u_int prim, u_int nr, int dtyp, void *arg)
|
||||
tei_l2(layer2_t *l2, u_int prim, int dinfo, int len, void *arg)
|
||||
{
|
||||
if (!l2)
|
||||
return(-EINVAL);
|
||||
switch(prim) {
|
||||
case (MDL_UNITDATA | REQUEST):
|
||||
return(l2down(l2, PH_DATA_REQ, nr, dtyp, arg));
|
||||
return(l2down(l2, PH_DATA_REQ, dinfo, len, arg));
|
||||
case (MDL_ASSIGN | REQUEST):
|
||||
FsmEvent(&l2->l2m, EV_L2_MDL_ASSIGN, arg);
|
||||
break;
|
||||
|
@ -1905,7 +1895,7 @@ tei_l2(layer2_t *l2, u_int prim, u_int nr, int dtyp, void *arg)
|
|||
hisaxif_t *up = &l2->inst.st->inst[1]->up;
|
||||
if (up)
|
||||
return(up->func(up, MDL_STATUS | REQUEST,
|
||||
nr, dtyp, arg));
|
||||
dinfo, len, arg));
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
@ -1936,9 +1926,9 @@ release_l2(layer2_t *l2)
|
|||
FsmDelTimer(&l2->t203, 16);
|
||||
discard_queue(&l2->i_queue);
|
||||
discard_queue(&l2->ui_queue);
|
||||
discard_queue(&l2->ph_queue);
|
||||
if (l2->ph_skb)
|
||||
dev_kfree_skb(l2->ph_skb);
|
||||
discard_queue(&l2->down_queue);
|
||||
if (l2->down_skb)
|
||||
dev_kfree_skb(l2->down_skb);
|
||||
ReleaseWin(l2);
|
||||
if (test_bit(FLG_LAPD, &l2->flag))
|
||||
release_tei(l2->tm);
|
||||
|
@ -2017,10 +2007,9 @@ create_l2(hisaxstack_t *st, hisaxif_t *hif) {
|
|||
return(NULL);
|
||||
}
|
||||
nl2->inst.obj = &isdnl2;
|
||||
nl2->msgnr = 1;
|
||||
skb_queue_head_init(&nl2->i_queue);
|
||||
skb_queue_head_init(&nl2->ui_queue);
|
||||
skb_queue_head_init(&nl2->ph_queue);
|
||||
skb_queue_head_init(&nl2->down_queue);
|
||||
InitWin(nl2);
|
||||
nl2->l2m.fsm = &l2fsm;
|
||||
if (test_bit(FLG_LAPB, &nl2->flag))
|
||||
|
|
|
@ -21,7 +21,6 @@ typedef struct _teimgr {
|
|||
struct FsmTimer t202;
|
||||
int T202, N202;
|
||||
int debug;
|
||||
u_int last_nr;
|
||||
struct _layer2 *l2;
|
||||
} teimgr_t;
|
||||
|
||||
|
@ -41,22 +40,19 @@ typedef struct _layer2 {
|
|||
struct FsmTimer t200, t203;
|
||||
int T200, N200, T203;
|
||||
int debug;
|
||||
u_int msgnr;
|
||||
u_int last_nr;
|
||||
u_int ph_nr;
|
||||
hisaxinstance_t inst;
|
||||
struct sk_buff *windowar[MAX_WINDOW];
|
||||
struct sk_buff *ph_skb;
|
||||
struct sk_buff *down_skb;
|
||||
struct sk_buff_head i_queue;
|
||||
struct sk_buff_head ui_queue;
|
||||
struct sk_buff_head ph_queue;
|
||||
struct sk_buff_head down_queue;
|
||||
} layer2_t;
|
||||
|
||||
/* from hisax_l2.c */
|
||||
extern int tei_l2(layer2_t *l2, u_int prim, u_int nr, int dtyp, void *arg);
|
||||
extern int tei_l2(layer2_t *l2, u_int prim, int dinfo, int len, void *arg);
|
||||
|
||||
/* from tei.c */
|
||||
extern int l2_tei(teimgr_t *tm, u_int prim, u_int nr, int dtyp, void *arg);
|
||||
extern int l2_tei(teimgr_t *tm, u_int prim, int dinfo, int len, void *arg);
|
||||
extern int create_teimgr(layer2_t *l2);
|
||||
extern void release_tei(teimgr_t *tm);
|
||||
extern int TEIInit(void);
|
||||
|
|
|
@ -294,7 +294,7 @@ release_l3_process(l3_process_t *p)
|
|||
if (!p)
|
||||
return;
|
||||
l3 = p->l3;
|
||||
hisax_l3up(p, CC_RELEASE_CR | INDICATION, NULL);
|
||||
hisax_l3up(p, CC_RELEASE_CR | INDICATION, 0, NULL);
|
||||
REMOVE_FROM_LISTBASE(p, l3->proc);
|
||||
StopAllL3Timer(p);
|
||||
kfree(p);
|
||||
|
@ -327,30 +327,27 @@ l3ml3p(layer3_t *l3, int pr)
|
|||
}
|
||||
|
||||
int
|
||||
hisax_l3up(l3_process_t *l3p, u_int prim, void *arg) {
|
||||
hisax_l3up(l3_process_t *l3p, u_int prim, int len, void *arg) {
|
||||
layer3_t *l3;
|
||||
hisaxif_t *up;
|
||||
l3msg_t l3msg;
|
||||
int err = -EINVAL;
|
||||
|
||||
if (!l3p)
|
||||
return(-EINVAL);
|
||||
l3 = l3p->l3;
|
||||
up = &l3->inst.up;
|
||||
l3msg.id = l3p->id;
|
||||
l3msg.arg = arg;
|
||||
if (up->func)
|
||||
err = up->func(up, prim, l3->msgnr++, DTYPE_L3MSGP, &l3msg);
|
||||
err = up->func(up, prim, l3p->id, len, arg);
|
||||
return(err);
|
||||
}
|
||||
|
||||
static int
|
||||
l3down(layer3_t *l3, u_int prim, u_int nr, int dtyp, void *arg) {
|
||||
l3down(layer3_t *l3, u_int prim, int dinfo, int len, void *arg) {
|
||||
hisaxif_t *down = &l3->inst.down;
|
||||
int err = -EINVAL;
|
||||
|
||||
if (down->func)
|
||||
err = down->func(down, prim, nr, dtyp, arg);
|
||||
err = down->func(down, prim, dinfo, len, arg);
|
||||
else
|
||||
printk(KERN_WARNING "l3down: no down func prim %x\n", prim);
|
||||
return(err);
|
||||
|
@ -364,7 +361,7 @@ lc_activate(struct FsmInst *fi, int event, void *arg)
|
|||
layer3_t *l3 = fi->userdata;
|
||||
|
||||
FsmChangeState(fi, ST_L3_LC_ESTAB_WAIT);
|
||||
l3down(l3, DL_ESTABLISH | REQUEST, l3->msgnr++, 0, NULL);
|
||||
l3down(l3, DL_ESTABLISH | REQUEST, 0, 0, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -376,7 +373,7 @@ lc_connect(struct FsmInst *fi, int event, void *arg)
|
|||
|
||||
FsmChangeState(fi, ST_L3_LC_ESTAB);
|
||||
while ((skb = skb_dequeue(&l3->squeue))) {
|
||||
l3down(l3, DL_DATA | REQUEST, l3->msgnr++, DTYPE_SKB, skb);
|
||||
l3down(l3, DL_DATA | REQUEST, DINFO_SKB, 0, skb);
|
||||
dequeued++;
|
||||
}
|
||||
if ((!l3->proc) && dequeued) {
|
||||
|
@ -397,7 +394,7 @@ lc_connected(struct FsmInst *fi, int event, void *arg)
|
|||
FsmDelTimer(&l3->l3m_timer, 51);
|
||||
FsmChangeState(fi, ST_L3_LC_ESTAB);
|
||||
while ((skb = skb_dequeue(&l3->squeue))) {
|
||||
l3down(l3, DL_DATA | REQUEST, l3->msgnr++, DTYPE_SKB, skb);
|
||||
l3down(l3, DL_DATA | REQUEST, DINFO_SKB, 0, skb);
|
||||
dequeued++;
|
||||
}
|
||||
if ((!l3->proc) && dequeued) {
|
||||
|
@ -429,7 +426,7 @@ lc_release_req(struct FsmInst *fi, int event, void *arg)
|
|||
FsmAddTimer(&l3->l3m_timer, DREL_TIMER_VALUE, EV_TIMEOUT, NULL, 51);
|
||||
} else {
|
||||
FsmChangeState(fi, ST_L3_LC_REL_WAIT);
|
||||
l3down(l3, DL_RELEASE | REQUEST, l3->msgnr++, 0, NULL);
|
||||
l3down(l3, DL_RELEASE | REQUEST, 0, 0, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -477,12 +474,12 @@ static struct FsmNode L3FnList[] =
|
|||
#define L3_FN_COUNT (sizeof(L3FnList)/sizeof(struct FsmNode))
|
||||
|
||||
int
|
||||
l3_msg(layer3_t *l3, u_int pr, u_int nr, int dtyp, void *arg)
|
||||
l3_msg(layer3_t *l3, u_int pr, int dinfo, int len, void *arg)
|
||||
{
|
||||
switch (pr) {
|
||||
case (DL_DATA | REQUEST):
|
||||
if (l3->l3m.state == ST_L3_LC_ESTAB) {
|
||||
l3down(l3, pr, l3->msgnr++, DTYPE_SKB, arg);
|
||||
l3down(l3, pr, dinfo, len, arg);
|
||||
} else {
|
||||
struct sk_buff *skb = arg;
|
||||
|
||||
|
@ -526,7 +523,6 @@ init_l3(layer3_t *l3)
|
|||
l3->l3m.userint = 0;
|
||||
l3->l3m.printdebug = l3m_debug;
|
||||
FsmInitTimer(&l3->l3m, &l3->l3m_timer);
|
||||
l3->msgnr = 1;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -83,7 +83,6 @@ typedef struct _layer3 {
|
|||
u_int id;
|
||||
int debug;
|
||||
u_int Flag;
|
||||
u_int msgnr;
|
||||
hisaxinstance_t inst;
|
||||
struct sk_buff_head squeue;
|
||||
} layer3_t;
|
||||
|
@ -94,7 +93,7 @@ struct stateentry {
|
|||
void (*rout) (l3_process_t *, u_char, void *);
|
||||
};
|
||||
|
||||
extern int l3_msg(layer3_t *, u_int, u_int, int, void *);
|
||||
extern int l3_msg(layer3_t *, u_int, int, int, void *);
|
||||
extern struct sk_buff *l3_alloc_skb(int);
|
||||
extern void newl3state(l3_process_t *, int);
|
||||
extern void L3InitTimer(l3_process_t *, L3Timer_t *);
|
||||
|
@ -106,7 +105,7 @@ extern l3_process_t *getl3proc(layer3_t *, int);
|
|||
extern l3_process_t *getl3proc4id(layer3_t *, int);
|
||||
extern l3_process_t *new_l3_process(layer3_t *, int, int);
|
||||
extern u_char *findie(u_char *, int, u_char, int);
|
||||
extern int hisax_l3up(l3_process_t *, u_int, void *);
|
||||
extern int hisax_l3up(l3_process_t *, u_int, int, void *);
|
||||
extern int getcallref(u_char * p);
|
||||
extern int newcallref(void);
|
||||
extern void init_l3(layer3_t *);
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "debug.h"
|
||||
#include "dss1.h"
|
||||
|
||||
static int ncciL4L3(Ncci_t *ncci, u_int prim, int dtyp, void *arg);
|
||||
static int ncciL4L3(Ncci_t *, u_int, int, int, void *);
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// NCCI state machine
|
||||
|
@ -126,7 +126,7 @@ static void ncci_connect_b3_req(struct FsmInst *fi, int event, void *arg)
|
|||
printk(KERN_DEBUG "ncci_connect_b3_req NCCI %x cmsg->Info(%x)\n",
|
||||
ncci->adrNCCI, cmsg->Info);
|
||||
if (cmsg->Info < 0x1000)
|
||||
ncciL4L3(ncci, DL_ESTABLISH | REQUEST, 0, 0);
|
||||
ncciL4L3(ncci, DL_ESTABLISH | REQUEST, 0, 0, NULL);
|
||||
}
|
||||
|
||||
static void ncci_connect_b3_ind(struct FsmInst *fi, int event, void *arg)
|
||||
|
@ -180,7 +180,7 @@ static void ncci_disconnect_b3_req(struct FsmInst *fi, int event, void *arg)
|
|||
ncciRecvCmsg(ncci, cmsg);
|
||||
} else {
|
||||
ncciRecvCmsg(ncci, cmsg);
|
||||
ncciL4L3(ncci, DL_RELEASE | REQUEST, 0, 0);
|
||||
ncciL4L3(ncci, DL_RELEASE | REQUEST, 0, 0, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -309,7 +309,7 @@ static struct FsmNode fn_ncci_list[] =
|
|||
|
||||
const int FN_NCCI_COUNT = sizeof(fn_ncci_list)/sizeof(struct FsmNode);
|
||||
|
||||
static int ncci_l3l4(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg);
|
||||
static int ncci_l3l4(hisaxif_t *hif, u_int prim, int dinfo, int len, void *arg);
|
||||
|
||||
void ncciConstr(Ncci_t *ncci, Cplci_t *cplci)
|
||||
{
|
||||
|
@ -397,7 +397,7 @@ void ncciInitSt(Ncci_t *ncci)
|
|||
}
|
||||
// if (sp.b2_mode != B2_MODE_TRANS || !test_bit(PLCI_FLAG_OUTGOING, &cplci->plci->flags)) {
|
||||
// listen for e.g. SABME
|
||||
// ncciL4L3(ncci, PH_ACTIVATE | REQUEST, 0, 0);
|
||||
// ncciL4L3(ncci, PH_ACTIVATE | REQUEST, 0, 0, NULL);
|
||||
// }
|
||||
}
|
||||
|
||||
|
@ -405,7 +405,7 @@ void ncciReleaseSt(Ncci_t *ncci)
|
|||
{
|
||||
int retval;
|
||||
|
||||
ncciL4L3(ncci, PH_DEACTIVATE | REQUEST, 0, 0);
|
||||
ncciL4L3(ncci, PH_DEACTIVATE | REQUEST, 0, 0, NULL);
|
||||
retval = ncci->binst->inst.obj->ctrl(ncci->binst->inst.st,
|
||||
MGR_CLEARSTACK | REQUEST, NULL);
|
||||
|
||||
|
@ -518,7 +518,7 @@ void ncciDataReq(Ncci_t *ncci, struct sk_buff *skb)
|
|||
ncci->xmit_skb_handles[i].MsgId = CAPIMSG_MSGID(skb->data);
|
||||
|
||||
skb_pull(skb, CAPIMSG_LEN(skb->data));
|
||||
ncciL4L3(ncci, DL_DATA | REQUEST, DTYPE_SKB, skb);
|
||||
ncciL4L3(ncci, DL_DATA | REQUEST, DINFO_SKB, 0, skb);
|
||||
return;
|
||||
|
||||
fail:
|
||||
|
@ -629,7 +629,7 @@ void ncci_l3l4st(struct PStack *st, int pr, void *arg)
|
|||
}
|
||||
#endif
|
||||
|
||||
static int ncci_l3l4(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg)
|
||||
static int ncci_l3l4(hisaxif_t *hif, u_int prim, int dinfo, int len, void *arg)
|
||||
{
|
||||
Ncci_t *ncci;
|
||||
struct sk_buff *skb = arg;
|
||||
|
@ -671,8 +671,8 @@ static int ncci_l3l4(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg)
|
|||
FsmEvent(&ncci->ncci_m, EV_NCCI_DL_RELEASE_CONF, arg);
|
||||
break;
|
||||
default:
|
||||
printk(KERN_DEBUG __FUNCTION__ ": unknown prim(%x) dtyp(%x) arg(%p)\n",
|
||||
prim, dtyp, arg);
|
||||
printk(KERN_DEBUG __FUNCTION__ ": unknown prim(%x) dinfo(%x) len(%d) arg(%p)\n",
|
||||
prim, dinfo, len, arg);
|
||||
int_error();
|
||||
}
|
||||
return(0);
|
||||
|
@ -682,8 +682,7 @@ void ncciSetInterface(hisaxif_t *hif) {
|
|||
hif->func = ncci_l3l4;
|
||||
}
|
||||
|
||||
|
||||
static int ncciL4L3(Ncci_t *ncci, u_int prim, int dtyp, void *arg)
|
||||
static int ncciL4L3(Ncci_t *ncci, u_int prim, int dtyp, int len, void *arg)
|
||||
{
|
||||
printk(KERN_DEBUG __FUNCTION__ ": NCCI %x prim(%x)\n",
|
||||
ncci->adrNCCI, prim);
|
||||
|
@ -691,7 +690,7 @@ static int ncciL4L3(Ncci_t *ncci, u_int prim, int dtyp, void *arg)
|
|||
int_error();
|
||||
return -EINVAL;
|
||||
}
|
||||
return(ncci->binst->inst.down.func(&ncci->binst->inst.down, prim, 0, dtyp, arg));
|
||||
return(ncci->binst->inst.down.func(&ncci->binst->inst.down, prim, dtyp, len, arg));
|
||||
}
|
||||
|
||||
void init_ncci(void)
|
||||
|
|
|
@ -54,7 +54,8 @@ void plciHandleSetupInd(Plci_t *plci, int pr, SETUP_t *setup)
|
|||
|
||||
memset(&relcmpl, 0, sizeof(RELEASE_COMPLETE_t));
|
||||
relcmpl.CAUSE = cause;
|
||||
plciL4L3(plci, CC_RELEASE_COMPLETE | REQUEST, &relcmpl);
|
||||
plciL4L3(plci, CC_RELEASE_COMPLETE | REQUEST,
|
||||
sizeof(RELEASE_COMPLETE_t), &relcmpl);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -119,18 +120,11 @@ void plciNewCrInd(Plci_t *plci, struct l3_process *l3_pc)
|
|||
|
||||
void plciNewCrReq(Plci_t *plci)
|
||||
{
|
||||
l3msg_t l3msg;
|
||||
l3msg.id = plci->adrPLCI;
|
||||
l3msg.arg = NULL;
|
||||
plciL4L3(plci, CC_NEW_CR | REQUEST, &l3msg);
|
||||
plciL4L3(plci, CC_NEW_CR | REQUEST, 0, NULL);
|
||||
}
|
||||
|
||||
int plciL4L3(Plci_t *plci, __u32 prim, void *arg)
|
||||
int plciL4L3(Plci_t *plci, __u32 prim, int len, void *arg)
|
||||
{
|
||||
l3msg_t l3msg;
|
||||
|
||||
l3msg.id = plci->adrPLCI;
|
||||
l3msg.arg = arg;
|
||||
return(contrL4L3(plci->contr, prim, &l3msg));
|
||||
return(contrL4L3(plci->contr, prim, plci->adrPLCI, len, arg));
|
||||
}
|
||||
|
||||
|
|
|
@ -564,7 +564,7 @@ setup_speedfax(sedl_fax *sf, u_int io_cfg, u_int irq_cfg)
|
|||
}
|
||||
|
||||
static int
|
||||
dummy_down(hisaxif_t *hif, u_int prim, u_int nr, int dtyp, void *arg) {
|
||||
dummy_down(hisaxif_t *hif, u_int prim, int dinfo, int len, void *arg) {
|
||||
sedl_fax *card;
|
||||
|
||||
if (!hif || !hif->fdata)
|
||||
|
@ -812,11 +812,14 @@ speedfax_manager(void *data, u_int prim, void *arg) {
|
|||
printk(KERN_WARNING "speedfax_manager MGR_LOADFIRM no card\n");
|
||||
return(-ENODEV);
|
||||
} else {
|
||||
l3msg_t *firm = arg;
|
||||
struct firm {
|
||||
int len;
|
||||
void *data;
|
||||
} *firm = arg;
|
||||
|
||||
if (!firm)
|
||||
if (!arg)
|
||||
return(-EINVAL);
|
||||
return(isar_load_firmware(&card->bch[0], firm->arg, firm->id));
|
||||
return(isar_load_firmware(&card->bch[0], firm->data, firm->len));
|
||||
}
|
||||
default:
|
||||
printk(KERN_WARNING "speedfax_manager prim %x not handled\n", prim);
|
||||
|
|
|
@ -273,13 +273,11 @@ void encodeInvokeComponentLength(__u8 *msg, __u8 *p)
|
|||
}
|
||||
|
||||
|
||||
static int dummy_L4L3(DummyProcess_t *dpc, __u32 prim, void *arg) {
|
||||
static int dummy_L4L3(DummyProcess_t *dpc, __u32 prim, int len, void *arg) {
|
||||
Contr_t *contr = dpc->contr;
|
||||
l3msg_t l3msg;
|
||||
|
||||
l3msg.id = contr->adrController | DUMMY_CR_FLAG;
|
||||
l3msg.arg = arg;
|
||||
return(contrL4L3(contr, prim, &l3msg));
|
||||
return(contrL4L3(contr, prim, contr->adrController | DUMMY_CR_FLAG,
|
||||
len, arg));
|
||||
}
|
||||
|
||||
DummyProcess_t *applNewDummyPc(Appl_t *appl, __u16 Function, __u32 Handle)
|
||||
|
@ -335,7 +333,7 @@ int applFacCFActivate(Appl_t *appl, struct FacReqParm *facReqParm,
|
|||
encodeInvokeComponentLength(dummy_pc->buf, p);
|
||||
fac.FACILITY = dummy_pc->buf;
|
||||
|
||||
dummy_L4L3(dummy_pc, CC_FACILITY | REQUEST, &fac);
|
||||
dummy_L4L3(dummy_pc, CC_FACILITY | REQUEST, sizeof(FACILITY_t), &fac);
|
||||
dummyPcAddTimer(dummy_pc, T_ACTIVATE);
|
||||
|
||||
facConfParm->u.Info.SupplementaryServiceInfo = CapiSuccess;
|
||||
|
@ -361,7 +359,7 @@ int applFacCFDeactivate(Appl_t *appl, struct FacReqParm *facReqParm,
|
|||
encodeInvokeComponentLength(dummy_pc->buf, p);
|
||||
fac.FACILITY = dummy_pc->buf;
|
||||
|
||||
dummy_L4L3(dummy_pc, CC_FACILITY | REQUEST, &fac);
|
||||
dummy_L4L3(dummy_pc, CC_FACILITY | REQUEST, sizeof(FACILITY_t), &fac);
|
||||
dummyPcAddTimer(dummy_pc, T_DEACTIVATE);
|
||||
|
||||
facConfParm->u.Info.SupplementaryServiceInfo = CapiSuccess;
|
||||
|
@ -388,7 +386,7 @@ int applFacCFInterrogateParameters(Appl_t *appl, struct FacReqParm *facReqParm,
|
|||
encodeInvokeComponentLength(dummy_pc->buf, p);
|
||||
fac.FACILITY = dummy_pc->buf;
|
||||
|
||||
dummy_L4L3(dummy_pc, CC_FACILITY | REQUEST, &fac);
|
||||
dummy_L4L3(dummy_pc, CC_FACILITY | REQUEST, sizeof(FACILITY_t), &fac);
|
||||
dummyPcAddTimer(dummy_pc, T_INTERROGATE);
|
||||
|
||||
facConfParm->u.Info.SupplementaryServiceInfo = CapiSuccess;
|
||||
|
@ -413,7 +411,7 @@ int applFacCFInterrogateNumbers(Appl_t *appl, struct FacReqParm *facReqParm,
|
|||
p += encodeInt(p, 0x11); // InterrogateServedUserNumbers
|
||||
encodeInvokeComponentLength(dummy_pc->buf, p);
|
||||
fac.FACILITY = dummy_pc->buf;
|
||||
dummy_L4L3(dummy_pc, CC_FACILITY | REQUEST, &fac);
|
||||
dummy_L4L3(dummy_pc, CC_FACILITY | REQUEST, sizeof(FACILITY_t), &fac);
|
||||
dummyPcAddTimer(dummy_pc, T_INTERROGATE);
|
||||
|
||||
facConfParm->u.Info.SupplementaryServiceInfo = CapiSuccess;
|
||||
|
|
|
@ -82,7 +82,7 @@ findtei(teimgr_t *tm, int tei)
|
|||
|
||||
if (tei == 127)
|
||||
return (NULL);
|
||||
if (!tei_l2(tm->l2, MDL_STATUS | REQUEST, tm->l2->msgnr++, tei, &ptr))
|
||||
if (!tei_l2(tm->l2, MDL_STATUS | REQUEST, tei, sizeof(void), &ptr))
|
||||
return(ptr);
|
||||
return (NULL);
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ put_tei_msg(teimgr_t *tm, u_char m_id, unsigned int ri, u_char tei)
|
|||
bp[2] = ri & 0xff;
|
||||
bp[3] = m_id;
|
||||
bp[4] = (tei << 1) | 1;
|
||||
tei_l2(tm->l2, MDL_UNITDATA | REQUEST, tm->l2->msgnr++, DTYPE_SKB, skb);
|
||||
tei_l2(tm->l2, MDL_UNITDATA | REQUEST, DINFO_SKB, 0, skb);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -149,12 +149,12 @@ tei_id_assign(struct FsmInst *fi, int event, void *arg)
|
|||
if (ri != otm->ri) {
|
||||
tm->tei_m.printdebug(fi,
|
||||
"possible duplicate assignment tei %d", tei);
|
||||
tei_l2(otm->l2, MDL_ERROR | RESPONSE, tm->last_nr, 0, NULL);
|
||||
tei_l2(otm->l2, MDL_ERROR | RESPONSE, 0, 0, NULL);
|
||||
}
|
||||
} else if (ri == tm->ri) {
|
||||
FsmDelTimer(&tm->t202, 1);
|
||||
FsmChangeState(fi, ST_TEI_NOP);
|
||||
tei_l2(tm->l2, MDL_ASSIGN | REQUEST, tm->l2->msgnr++, 4, &tei);
|
||||
tei_l2(tm->l2, MDL_ASSIGN | REQUEST, 0, 4, &tei);
|
||||
// cs->cardmsg(cs, MDL_ASSIGN | REQUEST, NULL);
|
||||
}
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ tei_id_remove(struct FsmInst *fi, int event, void *arg)
|
|||
if ((tm->l2->tei != -1) && ((tei == GROUP_TEI) || (tei == tm->l2->tei))) {
|
||||
FsmDelTimer(&tm->t202, 5);
|
||||
FsmChangeState(&tm->tei_m, ST_TEI_NOP);
|
||||
tei_l2(tm->l2, MDL_REMOVE | REQUEST, tm->l2->msgnr++, 0, NULL);
|
||||
tei_l2(tm->l2, MDL_REMOVE | REQUEST, 0, 0, NULL);
|
||||
// cs->cardmsg(cs, MDL_REMOVE | REQUEST, NULL);
|
||||
}
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ tei_id_req_tout(struct FsmInst *fi, int event, void *arg)
|
|||
FsmAddTimer(&tm->t202, tm->T202, EV_T202, NULL, 3);
|
||||
} else {
|
||||
tm->tei_m.printdebug(fi, "assign req failed");
|
||||
tei_l2(tm->l2, MDL_ERROR | RESPONSE, tm->last_nr, 0, NULL);
|
||||
tei_l2(tm->l2, MDL_ERROR | RESPONSE, 0, 0, NULL);
|
||||
// cs->cardmsg(cs, MDL_REMOVE | REQUEST, NULL);
|
||||
FsmChangeState(fi, ST_TEI_NOP);
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ tei_id_ver_tout(struct FsmInst *fi, int event, void *arg)
|
|||
} else {
|
||||
tm->tei_m.printdebug(fi, "verify req for tei %d failed",
|
||||
tm->l2->tei);
|
||||
tei_l2(tm->l2, MDL_REMOVE | REQUEST, tm->l2->msgnr++, 0, NULL);
|
||||
tei_l2(tm->l2, MDL_REMOVE | REQUEST, 0, 0, NULL);
|
||||
// cs->cardmsg(cs, MDL_REMOVE | REQUEST, NULL);
|
||||
FsmChangeState(fi, ST_TEI_NOP);
|
||||
}
|
||||
|
@ -339,20 +339,19 @@ tei_ph_data_ind(teimgr_t *tm, int dtyp, void *arg)
|
|||
}
|
||||
|
||||
int
|
||||
l2_tei(teimgr_t *tm, u_int prim, u_int nr, int dtyp, void *arg)
|
||||
l2_tei(teimgr_t *tm, u_int prim, int dinfo, int len, void *arg)
|
||||
{
|
||||
if (!tm)
|
||||
return(-EINVAL);
|
||||
switch (prim) {
|
||||
case (MDL_UNITDATA | INDICATION):
|
||||
return(tei_ph_data_ind(tm, dtyp, arg));
|
||||
return(tei_ph_data_ind(tm, dinfo, arg));
|
||||
case (MDL_ASSIGN | INDICATION):
|
||||
tm->last_nr = nr;
|
||||
if (test_bit(FLG_FIXED_TEI, &tm->l2->flag)) {
|
||||
if (tm->debug)
|
||||
tm->tei_m.printdebug(&tm->tei_m,
|
||||
"fixed assign tei %d", tm->l2->tei);
|
||||
tei_l2(tm->l2, MDL_ASSIGN | REQUEST, tm->l2->msgnr++,
|
||||
tei_l2(tm->l2, MDL_ASSIGN | REQUEST, 0,
|
||||
tm->l2->tei, NULL);
|
||||
// cs->cardmsg(cs, MDL_ASSIGN | REQUEST, NULL);
|
||||
} else
|
||||
|
|
|
@ -46,7 +46,7 @@ static int device_debug = 0;
|
|||
static int UD_Protocols[] = { ISDN_PID_ANY };
|
||||
#define PROTOCOLCNT (sizeof(UD_Protocols)/sizeof(int))
|
||||
|
||||
static int from_up_down(hisaxif_t *, u_int, u_int, int, void *);
|
||||
static int from_up_down(hisaxif_t *, u_int, int, int, void *);
|
||||
|
||||
static int
|
||||
hisax_rdata(hisaxdevice_t *dev, iframe_t *iff, int use_value) {
|
||||
|
@ -217,7 +217,7 @@ wdata_frame(hisaxdevice_t *dev, iframe_t *iff) {
|
|||
skb_reserve(skb, MAX_HEADER_LEN);
|
||||
dp = &iff->data.b[0];
|
||||
memcpy(skb_put(skb, len), dp, len);
|
||||
err = hif->func(hif, iff->prim, iff->nr, DTYPE_SKB, skb);
|
||||
err = hif->func(hif, iff->prim, DINFO_SKB, 0, skb);
|
||||
if (err)
|
||||
dev_kfree_skb(skb);
|
||||
return(err);
|
||||
|
@ -226,7 +226,7 @@ wdata_frame(hisaxdevice_t *dev, iframe_t *iff) {
|
|||
if (device_debug & DEBUG_WDATA)
|
||||
printk(KERN_DEBUG "wdata_frame: hif %p f:%p d:%p s:%p i:%p\n",
|
||||
hif, hif->func, hif->fdata, hif->st, hif->inst);
|
||||
err = hif->func(hif, iff->prim, iff->nr, iff->len, &iff->data.b[0]);
|
||||
err = hif->func(hif, iff->prim, iff->dinfo, iff->len, &iff->data.b[0]);
|
||||
} else {
|
||||
if (device_debug & DEBUG_WDATA)
|
||||
printk(KERN_DEBUG "hisax: no matching interface\n");
|
||||
|
@ -252,14 +252,14 @@ hisax_wdata(hisaxdevice_t *dev, void *dp, int len) {
|
|||
return(len);
|
||||
}
|
||||
if (device_debug & DEBUG_WDATA)
|
||||
printk(KERN_DEBUG "hisax_wdata: %x:%x %d %d\n",
|
||||
iff->addr, iff->prim, iff->nr, iff->len);
|
||||
printk(KERN_DEBUG "hisax_wdata: %x:%x %x %d\n",
|
||||
iff->addr, iff->prim, iff->dinfo, iff->len);
|
||||
switch(iff->prim) {
|
||||
case (MGR_GETSTACK | REQUEST):
|
||||
used = head;
|
||||
off.addr = iff->addr;
|
||||
off.prim = MGR_GETSTACK | CONFIRM;
|
||||
off.nr = iff->nr;
|
||||
off.dinfo = 0;
|
||||
if (iff->addr <= 0) {
|
||||
off.data.i = get_stack_cnt();
|
||||
off.len = sizeof(int);
|
||||
|
@ -277,7 +277,7 @@ hisax_wdata(hisaxdevice_t *dev, void *dp, int len) {
|
|||
return(len);
|
||||
off.addr = iff->addr;
|
||||
off.prim = MGR_GETLAYER | CONFIRM;
|
||||
off.nr = iff->nr;
|
||||
off.dinfo = 0;
|
||||
lay = iff->data.i;
|
||||
off.len = 0;
|
||||
if ((st = get_stack4id(iff->addr))) {
|
||||
|
@ -306,7 +306,7 @@ hisax_wdata(hisaxdevice_t *dev, void *dp, int len) {
|
|||
return(len);
|
||||
ip = &iff->data.i;
|
||||
off.addr = iff->addr;
|
||||
off.nr = iff->nr;
|
||||
off.dinfo = 0;
|
||||
off.prim = MGR_ADDLAYER | CONFIRM;
|
||||
off.len = 4;
|
||||
if ((st = get_stack4id(iff->addr))) {
|
||||
|
@ -323,7 +323,7 @@ hisax_wdata(hisaxdevice_t *dev, void *dp, int len) {
|
|||
used = head;
|
||||
off.addr = iff->addr;
|
||||
off.prim = MGR_DELLAYER | CONFIRM;
|
||||
off.nr = iff->nr;
|
||||
off.dinfo = 0;
|
||||
if ((dl=get_devlayer(dev, iff->addr)))
|
||||
off.len = del_layer(dl);
|
||||
else
|
||||
|
@ -558,7 +558,7 @@ static struct file_operations hisax_fops =
|
|||
};
|
||||
|
||||
static int
|
||||
from_up_down(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg) {
|
||||
from_up_down(hisaxif_t *hif, u_int prim, int dinfo, int len, void *arg) {
|
||||
|
||||
devicelayer_t *dl;
|
||||
iframe_t off;
|
||||
|
@ -573,12 +573,12 @@ from_up_down(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg) {
|
|||
off.addr = dl->iaddr | IF_TYPE(hif);
|
||||
off.prim = prim;
|
||||
off.len = 0;
|
||||
off.nr = nr;
|
||||
off.dinfo = dinfo;
|
||||
if (device_debug & DEBUG_RDATA)
|
||||
printk(KERN_DEBUG "from_up_down: %x(%x) nr:%d len:%d\n",
|
||||
off.prim, off.addr, nr, len);
|
||||
printk(KERN_DEBUG "from_up_down: %x(%x) dinfo:%x len:%d\n",
|
||||
off.prim, off.addr, dinfo, len);
|
||||
if (CMD_IS_DATA(prim)) {
|
||||
if (len == DTYPE_SKB) {
|
||||
if (dinfo == DINFO_SKB) {
|
||||
if ((sub == REQUEST) || (sub == INDICATION)) {
|
||||
if (!(skb = arg))
|
||||
return(-EINVAL);
|
||||
|
@ -595,11 +595,11 @@ from_up_down(hisaxif_t *hif, u_int prim, u_int nr, int len, void *arg) {
|
|||
if (IF_TYPE(hif) == IF_UP)
|
||||
retval = dl->inst.up.func(
|
||||
&dl->inst.up, prim,
|
||||
nr, len, arg);
|
||||
dinfo, len, arg);
|
||||
else if (IF_TYPE(hif) == IF_DOWN)
|
||||
retval = dl->inst.down.func(
|
||||
&dl->inst.down, prim,
|
||||
nr, len, arg);
|
||||
dinfo, len, arg);
|
||||
if (retval) {
|
||||
dev_kfree_skb(skb);
|
||||
retval = 0;
|
||||
|
|
|
@ -220,8 +220,7 @@
|
|||
#define IF_LAYERMASK 0x00FF0000
|
||||
#define IF_TYPE(i) ((i)->stat & IF_TYPEMASK)
|
||||
|
||||
#define DTYPE_SKB -1
|
||||
#define DTYPE_L3MSGP -2
|
||||
#define DINFO_SKB -1
|
||||
|
||||
#define DUMMY_CR_FLAG 0x7FFFFF00
|
||||
#define CONTROLER_MASK 0x000000FF
|
||||
|
@ -242,7 +241,7 @@
|
|||
typedef struct _iframe {
|
||||
u_int addr;
|
||||
u_int prim;
|
||||
u_int nr;
|
||||
u_int dinfo;
|
||||
int len;
|
||||
union {
|
||||
u_char b[4];
|
||||
|
@ -270,12 +269,6 @@ typedef struct _hisax_pid {
|
|||
} hisax_pid_t;
|
||||
|
||||
|
||||
typedef struct _l3msg_t {
|
||||
int id;
|
||||
void *arg;
|
||||
} l3msg_t;
|
||||
|
||||
|
||||
/* l3 pointer arrays */
|
||||
|
||||
typedef struct _ALERTING {
|
||||
|
@ -484,7 +477,7 @@ typedef struct _hisaxif {
|
|||
int stat;
|
||||
struct _hisaxstack *st;
|
||||
struct _hisaxinstance *inst;
|
||||
int (*func)(struct _hisaxif *, u_int, u_int, int, void *);
|
||||
int (*func)(struct _hisaxif *, u_int, int, int, void *);
|
||||
void *fdata;
|
||||
} hisaxif_t;
|
||||
|
||||
|
|
Loading…
Reference in New Issue