Commit 8d38b204 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN/HiSax: Move registering of a card out of line

This cset just introduces a new function do_register_isdn() which
takes care of what's necessary to register with the i4l link level.
parent 6c6bb465
......@@ -859,6 +859,47 @@ free_IsdnCardState(struct IsdnCardState *cs)
kfree(cs);
}
static void
do_register_isdn(struct IsdnCardState *cs)
{
if (!cs->iif.owner)
cs->iif.owner = THIS_MODULE;
cs->iif.channels = 2;
cs->iif.maxbufsize = MAX_DATA_SIZE;
cs->iif.hl_hdrlen = MAX_HEADER_LEN;
cs->iif.features =
ISDN_FEATURE_L2_X75I |
ISDN_FEATURE_L2_HDLC |
ISDN_FEATURE_L2_HDLC_56K |
ISDN_FEATURE_L2_TRANS |
ISDN_FEATURE_L3_TRANS |
#ifdef CONFIG_HISAX_1TR6
ISDN_FEATURE_P_1TR6 |
#endif
#ifdef CONFIG_HISAX_EURO
ISDN_FEATURE_P_EURO |
#endif
#ifdef CONFIG_HISAX_NI1
ISDN_FEATURE_P_NI1 |
#endif
0;
cs->iif.command = HiSax_command;
cs->iif.writecmd = NULL;
cs->iif.writebuf_skb = HiSax_writebuf_skb;
cs->iif.readstat = HiSax_readstatus;
register_isdn(&cs->iif);
cs->myid = cs->iif.channels;
printk(KERN_INFO
"HiSax: Card %d Protocol %s Id=%s (%d)\n", cs->cardnr + 1,
(cs->protocol == ISDN_PTYPE_1TR6) ? "1TR6" :
(cs->protocol == ISDN_PTYPE_EURO) ? "EDSS1" :
(cs->protocol == ISDN_PTYPE_LEASED) ? "LEASED" :
(cs->protocol == ISDN_PTYPE_NI1) ? "NI1" :
"NONE", cs->iif.id, cs->myid);
}
static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
{
int ret = 0;
......@@ -889,41 +930,8 @@ static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
"HiSax: Card Type %d out of range\n", card->typ);
goto outf_cs;
}
cs->iif.owner = THIS_MODULE;
strcpy(cs->iif.id, id);
cs->iif.channels = 2;
cs->iif.maxbufsize = MAX_DATA_SIZE;
cs->iif.hl_hdrlen = MAX_HEADER_LEN;
cs->iif.features =
ISDN_FEATURE_L2_X75I |
ISDN_FEATURE_L2_HDLC |
ISDN_FEATURE_L2_HDLC_56K |
ISDN_FEATURE_L2_TRANS |
ISDN_FEATURE_L3_TRANS |
#ifdef CONFIG_HISAX_1TR6
ISDN_FEATURE_P_1TR6 |
#endif
#ifdef CONFIG_HISAX_EURO
ISDN_FEATURE_P_EURO |
#endif
#ifdef CONFIG_HISAX_NI1
ISDN_FEATURE_P_NI1 |
#endif
0;
cs->iif.command = HiSax_command;
cs->iif.writecmd = NULL;
cs->iif.writebuf_skb = HiSax_writebuf_skb;
cs->iif.readstat = HiSax_readstatus;
register_isdn(&cs->iif);
cs->myid = cs->iif.channels;
printk(KERN_INFO
"HiSax: Card %d Protocol %s Id=%s (%d)\n", cardnr + 1,
(card->protocol == ISDN_PTYPE_1TR6) ? "1TR6" :
(card->protocol == ISDN_PTYPE_EURO) ? "EDSS1" :
(card->protocol == ISDN_PTYPE_LEASED) ? "LEASED" :
(card->protocol == ISDN_PTYPE_NI1) ? "NI1" :
"NONE", cs->iif.id, cs->myid);
do_register_isdn(cs);
switch (card->typ) {
#ifdef CONFIG_HISAX_16_0
case ISDN_CTYPE_16_0:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment