assorted fixes, related to the Stanford checker project
This commit is contained in:
parent
afe0d1ce83
commit
b0f8f1dd42
|
@ -82,13 +82,9 @@ int
|
|||
act2000_isa_detect(unsigned short portbase)
|
||||
{
|
||||
int ret = 0;
|
||||
unsigned long flags;
|
||||
|
||||
save_flags(flags);
|
||||
cli();
|
||||
if (!check_region(portbase, ISA_REGION))
|
||||
ret = act2000_isa_reset(portbase);
|
||||
restore_flags(flags);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -168,7 +164,6 @@ int
|
|||
act2000_isa_config_irq(act2000_card * card, short irq)
|
||||
{
|
||||
int i;
|
||||
unsigned long flags;
|
||||
|
||||
if (card->flags & ACT2000_FLAGS_IVALID) {
|
||||
free_irq(card->irq, NULL);
|
||||
|
@ -178,30 +173,13 @@ act2000_isa_config_irq(act2000_card * card, short irq)
|
|||
outb(ISA_COR_IRQOFF, ISA_PORT_COR);
|
||||
if (!irq)
|
||||
return 0;
|
||||
save_flags(flags);
|
||||
cli();
|
||||
if (irq == -1) {
|
||||
/* Auto select */
|
||||
for (i = 0; i < ISA_NRIRQS; i++) {
|
||||
if (!request_irq(act2000_isa_irqs[i], &act2000_isa_interrupt, 0, card->regname, NULL)) {
|
||||
card->irq = act2000_isa_irqs[i];
|
||||
irq2card_map[card->irq] = card;
|
||||
card->flags |= ACT2000_FLAGS_IVALID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Fixed irq */
|
||||
if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, NULL)) {
|
||||
card->irq = irq;
|
||||
irq2card_map[card->irq] = card;
|
||||
card->flags |= ACT2000_FLAGS_IVALID;
|
||||
}
|
||||
}
|
||||
restore_flags(flags);
|
||||
if (!card->flags & ACT2000_FLAGS_IVALID) {
|
||||
|
||||
if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, NULL)) {
|
||||
card->irq = irq;
|
||||
irq2card_map[card->irq] = card;
|
||||
card->flags |= ACT2000_FLAGS_IVALID;
|
||||
printk(KERN_WARNING
|
||||
"act2000: Could not request irq\n");
|
||||
"act2000: Could not request irq %d\n",irq);
|
||||
return -EBUSY;
|
||||
} else {
|
||||
act2000_isa_select_irq(card);
|
||||
|
|
|
@ -38,7 +38,7 @@ static act2000_card *cards = (act2000_card *) NULL;
|
|||
/* Parameters to be set by insmod */
|
||||
static int act_bus = 0;
|
||||
static int act_port = -1; /* -1 = Autoprobe */
|
||||
static int act_irq = -1; /* -1 = Autoselect */
|
||||
static int act_irq = -1;
|
||||
static char *act_id = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
||||
|
||||
MODULE_DESCRIPTION( "Driver for IBM Active 2000 ISDN card");
|
||||
|
@ -46,7 +46,7 @@ MODULE_AUTHOR( "Fritz Elfert");
|
|||
MODULE_SUPPORTED_DEVICE( "ISDN subsystem");
|
||||
MODULE_PARM_DESC(act_bus, "BusType of first card, 1=ISA, 2=MCA, 3=PCMCIA, currently only ISA");
|
||||
MODULE_PARM_DESC(membase, "Base port address of first card");
|
||||
MODULE_PARM_DESC(act_irq, "IRQ of first card (-1 = grab next free IRQ)");
|
||||
MODULE_PARM_DESC(act_irq, "IRQ of first card");
|
||||
MODULE_PARM_DESC(act_id, "ID-String of first card");
|
||||
MODULE_PARM(act_bus, "i");
|
||||
MODULE_PARM(act_port, "i");
|
||||
|
|
|
@ -440,10 +440,6 @@ static int
|
|||
reserve_regions(struct IsdnCard *card, struct IsdnCardState *cs)
|
||||
{
|
||||
unsigned int i, base = 0, adr = 0, len = 0;
|
||||
long flags;
|
||||
|
||||
save_flags(flags);
|
||||
cli();
|
||||
|
||||
switch (cs->subtyp) {
|
||||
case R647:
|
||||
|
@ -488,11 +484,9 @@ reserve_regions(struct IsdnCard *card, struct IsdnCardState *cs)
|
|||
break;
|
||||
}
|
||||
|
||||
restore_flags(flags);
|
||||
return 0;
|
||||
|
||||
error:
|
||||
restore_flags(flags);
|
||||
printk(KERN_WARNING "Gazel: %s io ports 0x%x-0x%x already in use\n",
|
||||
CardType[cs->typ], adr, adr + len);
|
||||
return 1;
|
||||
|
|
|
@ -805,7 +805,6 @@ static int
|
|||
icn_loadboot(u_char * buffer, icn_card * card)
|
||||
{
|
||||
int ret;
|
||||
ulong flags;
|
||||
u_char *codebuf;
|
||||
|
||||
#ifdef BOOT_DEBUG
|
||||
|
@ -819,8 +818,6 @@ icn_loadboot(u_char * buffer, icn_card * card)
|
|||
kfree(codebuf);
|
||||
return ret;
|
||||
}
|
||||
save_flags(flags);
|
||||
cli();
|
||||
if (!card->rvalid) {
|
||||
if (check_region(card->port, ICN_PORTLEN)) {
|
||||
printk(KERN_WARNING
|
||||
|
@ -828,7 +825,6 @@ icn_loadboot(u_char * buffer, icn_card * card)
|
|||
CID,
|
||||
card->port,
|
||||
card->port + ICN_PORTLEN);
|
||||
restore_flags(flags);
|
||||
kfree(codebuf);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
@ -859,7 +855,6 @@ icn_loadboot(u_char * buffer, icn_card * card)
|
|||
#endif
|
||||
dev.mvalid = 1;
|
||||
}
|
||||
restore_flags(flags);
|
||||
OUTB_P(0, ICN_RUN); /* Reset Controller */
|
||||
OUTB_P(0, ICN_MAPRAM); /* Disable RAM */
|
||||
icn_shiftout(ICN_CFG, 0x0f, 3, 4); /* Windowsize= 16k */
|
||||
|
@ -1063,18 +1058,19 @@ icn_writecmd(const u_char * buf, int len, int user, icn_card * card)
|
|||
ocount = 1;
|
||||
xcount = loop = 0;
|
||||
while (len) {
|
||||
save_flags(flags);
|
||||
cli();
|
||||
lastmap_card = dev.mcard;
|
||||
lastmap_channel = dev.channel;
|
||||
icn_map_channel(card, mch);
|
||||
|
||||
avail = cmd_free;
|
||||
count = MIN(avail, len);
|
||||
if (user)
|
||||
copy_from_user(msg, buf, count);
|
||||
else
|
||||
memcpy(msg, buf, count);
|
||||
|
||||
save_flags(flags);
|
||||
cli();
|
||||
lastmap_card = dev.mcard;
|
||||
lastmap_channel = dev.channel;
|
||||
icn_map_channel(card, mch);
|
||||
|
||||
icn_putmsg(card, '>');
|
||||
for (p = msg, pp = readb(&cmd_i), i = count; i > 0; i--, p++, pp
|
||||
++) {
|
||||
|
@ -1152,10 +1148,7 @@ static void
|
|||
icn_disable_cards(void)
|
||||
{
|
||||
icn_card *card = cards;
|
||||
unsigned long flags;
|
||||
|
||||
save_flags(flags);
|
||||
cli();
|
||||
while (card) {
|
||||
if (check_region(card->port, ICN_PORTLEN)) {
|
||||
printk(KERN_WARNING
|
||||
|
@ -1163,14 +1156,12 @@ icn_disable_cards(void)
|
|||
CID,
|
||||
card->port,
|
||||
card->port + ICN_PORTLEN);
|
||||
cli();
|
||||
} else {
|
||||
OUTB_P(0, ICN_RUN); /* Reset Controller */
|
||||
OUTB_P(0, ICN_MAPRAM); /* Disable RAM */
|
||||
}
|
||||
card = card->next;
|
||||
}
|
||||
restore_flags(flags);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -1628,25 +1619,19 @@ icn_initcard(int port, char *id)
|
|||
static int
|
||||
icn_addcard(int port, char *id1, char *id2)
|
||||
{
|
||||
ulong flags;
|
||||
icn_card *card;
|
||||
icn_card *card2;
|
||||
|
||||
save_flags(flags);
|
||||
cli();
|
||||
if (!(card = icn_initcard(port, id1))) {
|
||||
restore_flags(flags);
|
||||
return -EIO;
|
||||
}
|
||||
if (!strlen(id2)) {
|
||||
restore_flags(flags);
|
||||
printk(KERN_INFO
|
||||
"icn: (%s) ICN-2B, port 0x%x added\n",
|
||||
card->interface.id, port);
|
||||
return 0;
|
||||
}
|
||||
if (!(card2 = icn_initcard(port, id2))) {
|
||||
restore_flags(flags);
|
||||
printk(KERN_INFO
|
||||
"icn: (%s) half ICN-4B, port 0x%x added\n",
|
||||
card2->interface.id, port);
|
||||
|
@ -1658,7 +1643,6 @@ icn_addcard(int port, char *id1, char *id2)
|
|||
card2->doubleS0 = 1;
|
||||
card2->secondhalf = 1;
|
||||
card2->other = card;
|
||||
restore_flags(flags);
|
||||
printk(KERN_INFO
|
||||
"icn: (%s and %s) ICN-4B, port 0x%x added\n",
|
||||
card->interface.id, card2->interface.id, port);
|
||||
|
|
|
@ -1523,13 +1523,9 @@ isdnloop_addcard(char *id1)
|
|||
ulong flags;
|
||||
isdnloop_card *card;
|
||||
|
||||
save_flags(flags);
|
||||
cli();
|
||||
if (!(card = isdnloop_initcard(id1))) {
|
||||
restore_flags(flags);
|
||||
return -EIO;
|
||||
}
|
||||
restore_flags(flags);
|
||||
printk(KERN_INFO
|
||||
"isdnloop: (%s) virtual card added\n",
|
||||
card->interface.id);
|
||||
|
|
Loading…
Reference in New Issue