#include <linux/kernelcapi.h>
#include <linux/ctype.h>
#include <linux/init.h>
+#include <linux/moduleparam.h>
#include <linux/isdn/capiutil.h>
#include <linux/isdn/capicmd.h>
MODULE_DESCRIPTION("CAPI4Linux: Interface to ISDN4Linux");
MODULE_AUTHOR("Carsten Paeth");
MODULE_LICENSE("GPL");
-MODULE_PARM(debugmode, "i");
+module_param(debugmode, uint, 0);
/* -------- type definitions ----------------------------------------- */
/* -------- data definitions ----------------------------------------- */
static capidrv_data global;
-static spinlock_t global_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(global_lock);
static void handle_dtrace_data(capidrv_contr *card,
int send, int level2, u8 *data, u16 len);
case ISDN_PROTO_L2_HDLC:
case ISDN_PROTO_L2_TRANS:
default:
- return 0;
+ return NULL;
case ISDN_PROTO_L2_V11096:
return b1config_async_v110(9600);
case ISDN_PROTO_L2_V11019:
plcip = (capidrv_plci *) kmalloc(sizeof(capidrv_plci), GFP_ATOMIC);
if (plcip == 0)
- return 0;
+ return NULL;
memset(plcip, 0, sizeof(capidrv_plci));
plcip->state = ST_PLCI_NONE;
for (p = card->plci_list; p; p = p->next)
if (p->plci == plci)
return p;
- return 0;
+ return NULL;
}
static capidrv_plci *find_plci_by_msgid(capidrv_contr * card, u16 msgid)
for (p = card->plci_list; p; p = p->next)
if (p->msgid == msgid)
return p;
- return 0;
+ return NULL;
}
static capidrv_plci *find_plci_by_ncci(capidrv_contr * card, u32 ncci)
for (p = card->plci_list; p; p = p->next)
if (p->plci == (ncci & 0xffff))
return p;
- return 0;
+ return NULL;
}
static void free_plci(capidrv_contr * card, capidrv_plci * plcip)
for (pp = &card->plci_list; *pp; pp = &(*pp)->next) {
if (*pp == plcip) {
*pp = (*pp)->next;
- card->bchans[plcip->chan].plcip = 0;
+ card->bchans[plcip->chan].plcip = NULL;
card->bchans[plcip->chan].disconnecting = 0;
card->bchans[plcip->chan].incoming = 0;
kfree(plcip);
nccip = (capidrv_ncci *) kmalloc(sizeof(capidrv_ncci), GFP_ATOMIC);
if (nccip == 0)
- return 0;
+ return NULL;
memset(nccip, 0, sizeof(capidrv_ncci));
nccip->ncci = ncci;
capidrv_ncci *p;
if ((plcip = find_plci_by_ncci(card, ncci)) == 0)
- return 0;
+ return NULL;
for (p = plcip->ncci_list; p; p = p->next)
if (p->ncci == ncci)
return p;
- return 0;
+ return NULL;
}
static inline capidrv_ncci *find_ncci_by_msgid(capidrv_contr * card,
capidrv_ncci *p;
if ((plcip = find_plci_by_ncci(card, ncci)) == 0)
- return 0;
+ return NULL;
for (p = plcip->ncci_list; p; p = p->next)
if (p->msgid == msgid)
return p;
- return 0;
+ return NULL;
}
static void free_ncci(capidrv_contr * card, struct capidrv_ncci *nccip)
break;
}
}
- card->bchans[nccip->chan].nccip = 0;
+ card->bchans[nccip->chan].nccip = NULL;
kfree(nccip);
}
printk(KERN_ERR "capidrv: kmalloc ncci_datahandle failed\n");
return -1;
}
- n->next = 0;
+ n->next = NULL;
n->datahandle = datahandle;
n->len = len;
for (pp = &nccip->ackqueue; *pp; pp = &(*pp)->next) ;
len = CAPIMSG_LEN(cmsg->buf);
skb = alloc_skb(len, GFP_ATOMIC);
memcpy(skb_put(skb, len), cmsg->buf, len);
- capi20_put_message(&global.ap, skb);
+ if (capi20_put_message(&global.ap, skb) != CAPI_NOERROR)
+ kfree_skb(skb);
}
/* -------- state machine -------------------------------------------- */
{
isdn_ctrl cmd;
- card->bchans[plci->chan].contr = 0;
+ card->bchans[plci->chan].contr = NULL;
cmd.command = ISDN_STAT_DHUP;
cmd.driver = card->myid;
cmd.arg = plci->chan;
static struct plcistatechange plcitable[] =
{
/* P-0 */
- {ST_PLCI_NONE, ST_PLCI_OUTGOING, EV_PLCI_CONNECT_REQ, 0},
- {ST_PLCI_NONE, ST_PLCI_ALLOCATED, EV_PLCI_FACILITY_IND_UP, 0},
- {ST_PLCI_NONE, ST_PLCI_INCOMING, EV_PLCI_CONNECT_IND, 0},
- {ST_PLCI_NONE, ST_PLCI_RESUMEING, EV_PLCI_RESUME_REQ, 0},
+ {ST_PLCI_NONE, ST_PLCI_OUTGOING, EV_PLCI_CONNECT_REQ, NULL},
+ {ST_PLCI_NONE, ST_PLCI_ALLOCATED, EV_PLCI_FACILITY_IND_UP, NULL},
+ {ST_PLCI_NONE, ST_PLCI_INCOMING, EV_PLCI_CONNECT_IND, NULL},
+ {ST_PLCI_NONE, ST_PLCI_RESUMEING, EV_PLCI_RESUME_REQ, NULL},
/* P-0.1 */
{ST_PLCI_OUTGOING, ST_PLCI_NONE, EV_PLCI_CONNECT_CONF_ERROR, p0},
- {ST_PLCI_OUTGOING, ST_PLCI_ALLOCATED, EV_PLCI_CONNECT_CONF_OK, 0},
+ {ST_PLCI_OUTGOING, ST_PLCI_ALLOCATED, EV_PLCI_CONNECT_CONF_OK, NULL},
/* P-1 */
- {ST_PLCI_ALLOCATED, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, 0},
- {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0},
- {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0},
- {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
+ {ST_PLCI_ALLOCATED, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, NULL},
+ {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
+ {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
+ {ST_PLCI_ALLOCATED, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
/* P-ACT */
- {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0},
- {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0},
- {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
- {ST_PLCI_ACTIVE, ST_PLCI_HELD, EV_PLCI_HOLD_IND, 0},
- {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_SUSPEND_IND, 0},
+ {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
+ {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
+ {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
+ {ST_PLCI_ACTIVE, ST_PLCI_HELD, EV_PLCI_HOLD_IND, NULL},
+ {ST_PLCI_ACTIVE, ST_PLCI_DISCONNECTING, EV_PLCI_SUSPEND_IND, NULL},
/* P-2 */
- {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, 0},
- {ST_PLCI_INCOMING, ST_PLCI_FACILITY_IND, EV_PLCI_FACILITY_IND_UP, 0},
- {ST_PLCI_INCOMING, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_RESP, 0},
- {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0},
- {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0},
- {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
- {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CD_IND, 0},
+ {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, NULL},
+ {ST_PLCI_INCOMING, ST_PLCI_FACILITY_IND, EV_PLCI_FACILITY_IND_UP, NULL},
+ {ST_PLCI_INCOMING, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_RESP, NULL},
+ {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
+ {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
+ {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
+ {ST_PLCI_INCOMING, ST_PLCI_DISCONNECTING, EV_PLCI_CD_IND, NULL},
/* P-3 */
- {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, 0},
- {ST_PLCI_FACILITY_IND, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_ACTIVE_IND, 0},
- {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0},
- {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0},
- {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
+ {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_CONNECT_REJECT, NULL},
+ {ST_PLCI_FACILITY_IND, ST_PLCI_ACCEPTING, EV_PLCI_CONNECT_ACTIVE_IND, NULL},
+ {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
+ {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
+ {ST_PLCI_FACILITY_IND, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
/* P-4 */
- {ST_PLCI_ACCEPTING, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, 0},
- {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, 0},
- {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, 0},
- {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
+ {ST_PLCI_ACCEPTING, ST_PLCI_ACTIVE, EV_PLCI_CONNECT_ACTIVE_IND, NULL},
+ {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_DISCONNECT_REQ, NULL},
+ {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTING, EV_PLCI_FACILITY_IND_DOWN, NULL},
+ {ST_PLCI_ACCEPTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
/* P-5 */
- {ST_PLCI_DISCONNECTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, 0},
+ {ST_PLCI_DISCONNECTING, ST_PLCI_DISCONNECTED, EV_PLCI_DISCONNECT_IND, NULL},
/* P-6 */
{ST_PLCI_DISCONNECTED, ST_PLCI_NONE, EV_PLCI_DISCONNECT_RESP, p0},
/* P-0.Res */
{ST_PLCI_RESUMEING, ST_PLCI_NONE, EV_PLCI_RESUME_CONF_ERROR, p0},
- {ST_PLCI_RESUMEING, ST_PLCI_RESUME, EV_PLCI_RESUME_CONF_OK, 0},
+ {ST_PLCI_RESUMEING, ST_PLCI_RESUME, EV_PLCI_RESUME_CONF_OK, NULL},
/* P-RES */
- {ST_PLCI_RESUME, ST_PLCI_ACTIVE, EV_PLCI_RESUME_IND, 0},
+ {ST_PLCI_RESUME, ST_PLCI_ACTIVE, EV_PLCI_RESUME_IND, NULL},
/* P-HELD */
- {ST_PLCI_HELD, ST_PLCI_ACTIVE, EV_PLCI_RETRIEVE_IND, 0},
+ {ST_PLCI_HELD, ST_PLCI_ACTIVE, EV_PLCI_RETRIEVE_IND, NULL},
{},
};
global.ap.applid,
card->msgid++,
ncci->plcip->plci,
- 0, /* BChannelinformation */
- 0, /* Keypadfacility */
- 0, /* Useruserdata */ /* $$$$ */
- 0 /* Facilitydataarray */
+ NULL, /* BChannelinformation */
+ NULL, /* Keypadfacility */
+ NULL, /* Useruserdata */ /* $$$$ */
+ NULL /* Facilitydataarray */
);
send_message(card, &cmsg);
plci_change_state(card, ncci->plcip, EV_PLCI_DISCONNECT_REQ);
static struct nccistatechange nccitable[] =
{
/* N-0 */
- {ST_NCCI_NONE, ST_NCCI_OUTGOING, EV_NCCI_CONNECT_B3_REQ, 0},
- {ST_NCCI_NONE, ST_NCCI_INCOMING, EV_NCCI_CONNECT_B3_IND, 0},
+ {ST_NCCI_NONE, ST_NCCI_OUTGOING, EV_NCCI_CONNECT_B3_REQ, NULL},
+ {ST_NCCI_NONE, ST_NCCI_INCOMING, EV_NCCI_CONNECT_B3_IND, NULL},
/* N-0.1 */
- {ST_NCCI_OUTGOING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_CONF_OK, 0},
+ {ST_NCCI_OUTGOING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_CONF_OK, NULL},
{ST_NCCI_OUTGOING, ST_NCCI_NONE, EV_NCCI_CONNECT_B3_CONF_ERROR, n0},
/* N-1 */
- {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_CONNECT_B3_REJECT, 0},
- {ST_NCCI_INCOMING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_RESP, 0},
- {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0},
- {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, 0},
+ {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_CONNECT_B3_REJECT, NULL},
+ {ST_NCCI_INCOMING, ST_NCCI_ALLOCATED, EV_NCCI_CONNECT_B3_RESP, NULL},
+ {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
+ {ST_NCCI_INCOMING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
/* N-2 */
- {ST_NCCI_ALLOCATED, ST_NCCI_ACTIVE, EV_NCCI_CONNECT_B3_ACTIVE_IND, 0},
- {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0},
- {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, 0},
+ {ST_NCCI_ALLOCATED, ST_NCCI_ACTIVE, EV_NCCI_CONNECT_B3_ACTIVE_IND, NULL},
+ {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
+ {ST_NCCI_ALLOCATED, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
/* N-ACT */
- {ST_NCCI_ACTIVE, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, 0},
- {ST_NCCI_ACTIVE, ST_NCCI_RESETING, EV_NCCI_RESET_B3_REQ, 0},
- {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0},
- {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, 0},
+ {ST_NCCI_ACTIVE, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, NULL},
+ {ST_NCCI_ACTIVE, ST_NCCI_RESETING, EV_NCCI_RESET_B3_REQ, NULL},
+ {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
+ {ST_NCCI_ACTIVE, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
/* N-3 */
- {ST_NCCI_RESETING, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, 0},
- {ST_NCCI_RESETING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0},
- {ST_NCCI_RESETING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, 0},
+ {ST_NCCI_RESETING, ST_NCCI_ACTIVE, EV_NCCI_RESET_B3_IND, NULL},
+ {ST_NCCI_RESETING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
+ {ST_NCCI_RESETING, ST_NCCI_DISCONNECTING, EV_NCCI_DISCONNECT_B3_REQ, NULL},
/* N-4 */
- {ST_NCCI_DISCONNECTING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, 0},
- {ST_NCCI_DISCONNECTING, ST_NCCI_PREVIOUS, EV_NCCI_DISCONNECT_B3_CONF_ERROR,0},
+ {ST_NCCI_DISCONNECTING, ST_NCCI_DISCONNECTED, EV_NCCI_DISCONNECT_B3_IND, NULL},
+ {ST_NCCI_DISCONNECTING, ST_NCCI_PREVIOUS, EV_NCCI_DISCONNECT_B3_CONF_ERROR,NULL},
/* N-5 */
{ST_NCCI_DISCONNECTED, ST_NCCI_NONE, EV_NCCI_DISCONNECT_B3_RESP, n0},
{},
goto ignored;
case CAPI_MANUFACTURER_CONF: /* Controller */
if (cmsg->ManuID == 0x214D5641) {
- char *s = 0;
+ char *s = NULL;
switch (cmsg->Class) {
case 0: break;
case 1: s = "unknown class"; break;
global.ap.applid,
card->msgid++,
plcip->plci, /* adr */
- 0, /* BChannelinformation */
- 0, /* Keypadfacility */
- 0, /* Useruserdata */
- 0 /* Facilitydataarray */
+ NULL,/* BChannelinformation */
+ NULL,/* Keypadfacility */
+ NULL,/* Useruserdata */
+ NULL /* Facilitydataarray */
);
plcip->msgid = cmsg->Messagenumber;
send_message(card, cmsg);
global.ap.applid,
card->msgid++,
plcip->plci, /* adr */
- 0 /* NCPI */
+ NULL /* NCPI */
);
nccip->msgid = cmsg->Messagenumber;
send_message(card, cmsg);
card->msgid++,
nccip->ncci, /* adr */
0, /* Reject */
- 0 /* NCPI */
+ NULL /* NCPI */
);
send_message(card, cmsg);
ncci_change_state(card, nccip, EV_NCCI_CONNECT_B3_RESP);
card->msgid++,
cmsg->adr.adrNCCI,
2, /* Reject */
- 0 /* NCPI */
+ NULL /* NCPI */
);
send_message(card, cmsg);
break;
si2cip(bchan->si1, bchan->si2), /* cipvalue */
called, /* CalledPartyNumber */
calling, /* CallingPartyNumber */
- 0, /* CalledPartySubaddress */
- 0, /* CallingPartySubaddress */
+ NULL, /* CalledPartySubaddress */
+ NULL, /* CallingPartySubaddress */
b1prot(bchan->l2, bchan->l3), /* B1protocol */
b2prot(bchan->l2, bchan->l3), /* B2protocol */
b3prot(bchan->l2, bchan->l3), /* B3protocol */
b1config(bchan->l2, bchan->l3), /* B1configuration */
- 0, /* B2configuration */
- 0, /* B3configuration */
- 0, /* BC */
- 0, /* LLC */
- 0, /* HLC */
+ NULL, /* B2configuration */
+ NULL, /* B3configuration */
+ NULL, /* BC */
+ NULL, /* LLC */
+ NULL, /* HLC */
/* BChannelinformation */
- isleasedline ? AdditionalInfo : 0,
- 0, /* Keypadfacility */
- 0, /* Useruserdata */
- 0 /* Facilitydataarray */
+ isleasedline ? AdditionalInfo : NULL,
+ NULL, /* Keypadfacility */
+ NULL, /* Useruserdata */
+ NULL /* Facilitydataarray */
);
if ((plcip = new_plci(card, (c->arg % card->nbchan))) == 0) {
cmd.command = ISDN_STAT_DHUP;
b2prot(bchan->l2, bchan->l3), /* B2protocol */
b3prot(bchan->l2, bchan->l3), /* B3protocol */
b1config(bchan->l2, bchan->l3), /* B1configuration */
- 0, /* B2configuration */
- 0, /* B3configuration */
- 0, /* ConnectedNumber */
- 0, /* ConnectedSubaddress */
- 0, /* LLC */
- 0, /* BChannelinformation */
- 0, /* Keypadfacility */
- 0, /* Useruserdata */
- 0 /* Facilitydataarray */
+ NULL, /* B2configuration */
+ NULL, /* B3configuration */
+ NULL, /* ConnectedNumber */
+ NULL, /* ConnectedSubaddress */
+ NULL, /* LLC */
+ NULL, /* BChannelinformation */
+ NULL, /* Keypadfacility */
+ NULL, /* Useruserdata */
+ NULL /* Facilitydataarray */
);
capi_cmsg2message(&cmdcmsg, cmdcmsg.buf);
plci_change_state(card, bchan->plcip, EV_PLCI_CONNECT_RESP);
global.ap.applid,
card->msgid++,
bchan->nccip->ncci,
- 0 /* NCPI */
+ NULL /* NCPI */
);
ncci_change_state(card, bchan->nccip, EV_NCCI_DISCONNECT_B3_REQ);
send_message(card, &cmdcmsg);
global.ap.applid,
card->msgid++,
bchan->plcip->plci,
- 0, /* BChannelinformation */
- 0, /* Keypadfacility */
- 0, /* Useruserdata */
- 0 /* Facilitydataarray */
+ NULL, /* BChannelinformation */
+ NULL, /* Keypadfacility */
+ NULL, /* Useruserdata */
+ NULL /* Facilitydataarray */
);
plci_change_state(card, bchan->plcip, EV_PLCI_DISCONNECT_REQ);
send_message(card, &cmdcmsg);
}
}
-static int if_readstat(u8 *buf, int len, int user, int id, int channel)
+static int if_readstat(u8 __user *buf, int len, int id, int channel)
{
capidrv_contr *card = findcontrbydriverid(id);
int count;
- u8 *p;
+ u8 __user *p;
if (!card) {
printk(KERN_ERR "capidrv: if_readstat called with invalid driverId %d!\n",
}
for (p=buf, count=0; count < len; p++, count++) {
- if (user)
- put_user(*card->q931_read++, p);
- else
- *p = *card->q931_read++;
+ put_user(*card->q931_read++, p);
if (card->q931_read > card->q931_end)
card->q931_read = card->q931_buf;
}
1 << 6, /* Infomask */
card->cipmask,
card->cipmask2,
- 0, 0);
+ NULL, NULL);
send_message(card, &cmdcmsg);
listen_change_state(card, EV_LISTEN_REQ);
}
card->interface.maxbufsize = 2048;
card->interface.command = if_command;
card->interface.writebuf_skb = if_sendbuf;
- card->interface.writecmd = 0;
+ card->interface.writecmd = NULL;
card->interface.readstat = if_readstat;
card->interface.features = ISDN_FEATURE_L2_HDLC |
ISDN_FEATURE_L2_TRANS |
return -1;
}
card->myid = card->interface.channels;
+ memset(card->bchans, 0, sizeof(capidrv_bchan) * card->nbchan);
+ for (i = 0; i < card->nbchan; i++) {
+ card->bchans[i].contr = card;
+ }
spin_lock_irqsave(&global_lock, flags);
card->next = global.contr_list;
global.ncontr++;
spin_unlock_irqrestore(&global_lock, flags);
- memset(card->bchans, 0, sizeof(capidrv_bchan) * card->nbchan);
- for (i = 0; i < card->nbchan; i++) {
- card->bchans[i].contr = card;
- }
-
cmd.command = ISDN_STAT_RUN;
cmd.driver = card->myid;
card->interface.statcallb(&cmd);
card->cipmask = 0x1FFF03FF; /* any */
card->cipmask2 = 0;
- send_listen(card);
-
card->listentimer.data = (unsigned long)card;
card->listentimer.function = listentimerfunc;
+ send_listen(card);
mod_timer(&card->listentimer, jiffies + 60*HZ);
printk(KERN_INFO "%s: now up (%d B channels)\n",
card->nbchan--;
}
kfree(card->bchans);
- card->bchans = 0;
+ card->bchans = NULL;
if (debugmode)
printk(KERN_DEBUG "capidrv-%d: id=%d isdn unload\n",
for (pp = &global.contr_list; *pp; pp = &(*pp)->next) {
if (*pp == card) {
*pp = (*pp)->next;
- card->next = 0;
+ card->next = NULL;
global.ncontr--;
break;
}
for (i=0; i < nelem; i++) {
struct procfsentries *p = procfsentries + i;
- p->procent = create_proc_entry(p->name, p->mode, 0);
+ p->procent = create_proc_entry(p->name, p->mode, NULL);
if (p->procent) p->procent->read_proc = p->read_proc;
}
}
for (i=nelem-1; i >= 0; i--) {
struct procfsentries *p = procfsentries + i;
if (p->procent) {
- remove_proc_entry(p->name, 0);
- p->procent = 0;
+ remove_proc_entry(p->name, NULL);
+ p->procent = NULL;
}
}
}