Commit 2d691920 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://linux-isdn.bkbits.net/linux-2.5.isdn

into home.osdl.org:/home/torvalds/v2.5/linux
parents 03b0b9ec bb4e009a
......@@ -160,8 +160,6 @@ static int DIVA_INIT_FUNCTION divacapi_init(void)
char tmprev[32];
int ret = 0;
MOD_INC_USE_COUNT;
sprintf(DRIVERRELEASE, "%d.%d%s", DRRELMAJOR, DRRELMINOR,
DRRELEXTRA);
......@@ -177,7 +175,6 @@ static int DIVA_INIT_FUNCTION divacapi_init(void)
ret = -EIO;
}
MOD_DEC_USE_COUNT;
return ret;
}
......
......@@ -135,8 +135,6 @@ static int DIVA_INIT_FUNCTION divadidd_init(void)
char tmprev[32];
int ret = 0;
MOD_INC_USE_COUNT;
printk(KERN_INFO "%s\n", DRIVERNAME);
printk(KERN_INFO "%s: Rel:%s Rev:", DRIVERLNAME, DRIVERRELEASE);
strcpy(tmprev, main_revision);
......@@ -159,7 +157,6 @@ static int DIVA_INIT_FUNCTION divadidd_init(void)
}
out:
MOD_DEC_USE_COUNT;
return (ret);
}
......
......@@ -442,8 +442,6 @@ static int DIVA_INIT_FUNCTION maint_init(void)
int ret = 0;
void *buffer = 0;
MOD_INC_USE_COUNT;
do_gettimeofday(&start_time);
init_waitqueue_head(&msgwaitq);
......@@ -479,7 +477,6 @@ static int DIVA_INIT_FUNCTION maint_init(void)
(diva_dbg_mem == 0) ? "internal" : "external");
out:
MOD_DEC_USE_COUNT;
return (ret);
}
......
......@@ -192,8 +192,6 @@ static int DIVA_INIT_FUNCTION divasi_init(void)
char tmprev[50];
int ret = 0;
MOD_INC_USE_COUNT;
printk(KERN_INFO "%s\n", DRIVERNAME);
printk(KERN_INFO "%s: Rel:%s Rev:", DRIVERLNAME, DRIVERRELEASE);
strcpy(tmprev, main_revision);
......@@ -223,7 +221,6 @@ static int DIVA_INIT_FUNCTION divasi_init(void)
}
out:
MOD_DEC_USE_COUNT;
return (ret);
}
......
......@@ -508,15 +508,11 @@ int
diva_os_register_io_port(int on, unsigned long port, unsigned long length,
const char *name)
{
int ret;
if (on) {
if ((ret = check_region(port, length)) < 0) {
DBG_ERR(("A: I/O: can't register port=%08x, error=%d",
port, ret))
if (!request_region(port, length, name)) {
DBG_ERR(("A: I/O: can't register port=%08x", port))
return (-1);
}
request_region(port, length, name);
} else {
release_region(port, length);
}
......@@ -880,8 +876,6 @@ static int DIVA_INIT_FUNCTION divas_init(void)
char tmprev[50];
int ret = 0;
MOD_INC_USE_COUNT;
printk(KERN_INFO "%s\n", DRIVERNAME);
printk(KERN_INFO "%s: Rel:%s Rev:", DRIVERLNAME, DRIVERRELEASE);
strcpy(tmprev, main_revision);
......@@ -932,7 +926,6 @@ static int DIVA_INIT_FUNCTION divas_init(void)
}
out:
MOD_DEC_USE_COUNT;
return (ret);
}
......
......@@ -1354,8 +1354,6 @@ i4l_idi_init(void)
status_lock = SPIN_LOCK_UNLOCKED;
ll_lock = SPIN_LOCK_UNLOCKED;
MOD_INC_USE_COUNT;
if (strlen(id) < 1)
strcpy(id, "diva");
......@@ -1382,7 +1380,6 @@ i4l_idi_init(void)
create_proc();
out:
MOD_DEC_USE_COUNT;
return(ret);
}
......
......@@ -530,21 +530,17 @@ inithdlc(struct IsdnCardState *cs)
modehdlc(cs->bcs + 1, -1, 1);
}
static void
static irqreturn_t
avm_pcipnp_interrupt(int intno, void *dev_id, struct pt_regs *regs)
{
struct IsdnCardState *cs = dev_id;
u8 val;
u8 sval;
if (!cs) {
printk(KERN_WARNING "AVM PCI: Spurious interrupt!\n");
return;
}
sval = inb(cs->hw.avm.cfg_reg + 2);
if ((sval & AVM_STATUS0_IRQ_MASK) == AVM_STATUS0_IRQ_MASK)
/* possible a shared IRQ reqest */
return;
return IRQ_NONE;
if (!(sval & AVM_STATUS0_IRQ_ISAC)) {
val = ReadISAC(cs, ISAC_ISTA);
isac_interrupt(cs, val);
......@@ -554,6 +550,7 @@ avm_pcipnp_interrupt(int intno, void *dev_id, struct pt_regs *regs)
}
WriteISAC(cs, ISAC_MASK, 0xFF);
WriteISAC(cs, ISAC_MASK, 0x0);
return IRQ_HANDLED;
}
static int
......
......@@ -859,6 +859,65 @@ 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
do_init(struct IsdnCardState *cs)
{
int ret;
init_tei(cs, cs->protocol);
ret = CallcNewChan(cs);
if (ret)
return -EIO;
/* ISAR needs firmware download first */
if (!test_bit(HW_ISAR, &cs->HW_Flags))
ll_run(cs, 0);
return 0;
}
static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
{
int ret = 0;
......@@ -889,41 +948,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:
......@@ -1117,17 +1143,11 @@ static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
ret = 0;
goto outf_cs;
}
init_tei(cs, cs->protocol);
ret = CallcNewChan(cs);
if (ret) {
if (do_init(cs)) {
closecard(cardnr);
ret = 0;
goto outf_cs;
}
/* ISAR needs firmware download first */
if (!test_bit(HW_ISAR, &cs->HW_Flags))
ll_run(cs, 0);
ret = 1;
goto out;
......@@ -1677,15 +1697,27 @@ static void hisax_bc_close(struct BCState *bcs);
static void hisax_bh(void *data);
static void EChannel_proc_rcv(struct hisax_d_if *d_if);
static int
hisax_l1_open(struct PStack *st, struct IsdnCardState *cs)
{
st->l1.l2l1 = hisax_d_l2l1;
return 0;
}
static struct dc_l1_ops hisax_l1_ops = {
.open = hisax_l1_open,
.bh_func = hisax_bh,
};
static struct bc_l1_ops hisax_bc_l1_ops = {
.open = hisax_bc_setstack,
.close = hisax_bc_close,
};
int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[],
char *name, int protocol)
{
int i, retval;
char id[20];
int i;
struct IsdnCardState *cs;
for (i = 0; i < HISAX_MAX_CARDS; i++) {
......@@ -1696,24 +1728,30 @@ int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[],
if (i >= HISAX_MAX_CARDS)
return -EBUSY;
cards[i].typ = ISDN_CTYPE_DYNAMIC;
cards[i].protocol = protocol;
sprintf(id, "%s%d", name, i);
nrcards++;
retval = checkcard(i, id, 0);
if (retval == 0) { // yuck
cards[i].typ = 0;
nrcards--;
return retval;
}
cs = cards[i].cs;
cs = alloc_IsdnCardState();
if (!cs)
return -ENOMEM;
#if TEI_PER_CARD
if (protocol == ISDN_PTYPE_NI1)
test_and_set_bit(FLG_TWO_DCHAN, &cs->HW_Flags);
#else
test_and_set_bit(FLG_TWO_DCHAN, &cs->HW_Flags);
#endif
cs->cardnr = i;
cs->protocol = protocol;
cs->typ = ISDN_CTYPE_DYNAMIC;
sprintf(cs->iif.id, "%s%d", name, i);
do_register_isdn(cs);
hisax_d_if->cs = cs;
cs->hw.hisax_d_if = hisax_d_if;
cs->iif.owner = hisax_d_if->owner; // FIXME should be done before registering
cs->iif.owner = hisax_d_if->owner;
dc_l1_init(cs, &hisax_l1_ops);
cs->channel[0].d_st->l1.l2l1 = hisax_d_l2l1;
cs->bc_l1_ops->open = hisax_bc_setstack;
cs->bc_l1_ops->close = hisax_bc_close;
cs->bc_l1_ops = &hisax_bc_l1_ops;
for (i = 0; i < 2; i++) {
b_if[i]->ifc.l1l2 = hisax_b_l1l2;
......@@ -1724,6 +1762,8 @@ int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[],
skb_queue_head_init(&hisax_d_if->erq);
clear_bit(0, &hisax_d_if->ph_state);
do_init(cs);
return 0;
}
......
......@@ -20,7 +20,7 @@
#define FSM_TIMER_DEBUG 0
int __init
int
FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount)
{
int i;
......
......@@ -196,7 +196,7 @@ static int __init st5481_usb_init(void)
st5481_debug = debug;
#endif
printk(KERN_INFO "hiax_st5481: ST5481 USB ISDN driver v0.1.0\n");
printk(KERN_INFO "hisax_st5481: ST5481 USB ISDN driver v0.1.0\n");
retval = st5481_d_init();
if (retval < 0)
......@@ -217,6 +217,7 @@ static int __init st5481_usb_init(void)
static void __exit st5481_usb_exit(void)
{
usb_deregister(&st5481_usb_driver);
st5481_d_exit();
}
module_init(st5481_usb_init);
......
......@@ -534,8 +534,7 @@ get_drv_by_nr(int di)
unsigned long flags;
struct isdn_driver *drv;
if (di < 0)
return NULL;
BUG_ON(di < 0 || di >= ISDN_MAX_DRIVERS);
spin_lock_irqsave(&drivers_lock, flags);
drv = drivers[di];
......@@ -1148,7 +1147,7 @@ get_slot_by_minor(int minor)
int di, ch;
struct isdn_driver *drv;
for (di = 0; di < ISDN_MAX_CHANNELS; di++) {
for (di = 0; di < ISDN_MAX_DRIVERS; di++) {
drv = get_drv_by_nr(di);
if (!drv)
continue;
......
......@@ -1151,6 +1151,8 @@ static inline void rebalance_tick(runqueue_t *this_rq, int idle)
DEFINE_PER_CPU(struct kernel_stat, kstat) = { { 0 } };
EXPORT_PER_CPU_SYMBOL(kstat);
/*
* We place interactive tasks back into the active array, if possible.
*
......
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