patch-2.4.7 linux/drivers/isdn/hisax/config.c
Next file: linux/drivers/isdn/hisax/elsa.c
Previous file: linux/drivers/isdn/hisax/bkm_a8.c
Back to the patch index
Back to the overall index
- Lines: 981
- Date:
Thu Jul 19 09:40:25 2001
- Orig file:
v2.4.6/linux/drivers/isdn/hisax/config.c
- Orig date:
Tue Jul 3 17:08:19 2001
diff -u --recursive --new-file v2.4.6/linux/drivers/isdn/hisax/config.c linux/drivers/isdn/hisax/config.c
@@ -1,4 +1,4 @@
-/* $Id: config.c,v 2.57.6.15 2001/06/09 15:14:17 kai Exp $
+/* $Id: config.c,v 2.57.6.16 2001/07/13 09:01:00 kai Exp $
*
* Author Karsten Keil (keil@isdn4linux.de)
* based on the teles driver from Jan den Ouden
@@ -56,8 +56,8 @@
* 26 AVM A1 PCMCIA (Fritz) p0=irq p1=iobase
* 27 AVM PnP/PCI p0=irq p1=iobase (PCI no parameter)
* 28 Sedlbauer Speed Fax+ p0=irq p1=iobase (from isapnp setup)
- * 29 Siemens I-Surf p0=irq p1=iobase p2=memory (from isapnp setup)
- * 30 ACER P10 p0=irq p1=iobase (from isapnp setup)
+ * 29 Siemens I-Surf p0=irq p1=iobase p2=memory (from isapnp setup)
+ * 30 ACER P10 p0=irq p1=iobase (from isapnp setup)
* 31 HST Saphir p0=irq p1=iobase
* 32 Telekom A4T none
* 33 Scitel Quadro p0=subcontroller (4*S0, subctrl 1...4)
@@ -73,16 +73,18 @@
*
*/
-const char *CardType[] =
-{"No Card", "Teles 16.0", "Teles 8.0", "Teles 16.3", "Creatix/Teles PnP",
- "AVM A1", "Elsa ML", "Elsa Quickstep", "Teles PCMCIA", "ITK ix1-micro Rev.2",
- "Elsa PCMCIA", "Eicon.Diehl Diva", "ISDNLink", "TeleInt", "Teles 16.3c",
- "Sedlbauer Speed Card", "USR Sportster", "ith mic Linux", "Elsa PCI",
- "Compaq ISA", "NETjet-S", "Teles PCI", "Sedlbauer Speed Star (PCMCIA)",
- "AMD 7930", "NICCY", "S0Box", "AVM A1 (PCMCIA)", "AVM Fritz PnP/PCI",
- "Sedlbauer Speed Fax +", "Siemens I-Surf", "Acer P10", "HST Saphir",
- "Telekom A4T", "Scitel Quadro", "Gazel", "HFC 2BDS0 PCI", "Winbond 6692",
- "HFC 2BDS0 SX", "NETspider-U", "HFC-2BDS0-SP PCMCIA",
+const char *CardType[] = {
+ "No Card", "Teles 16.0", "Teles 8.0", "Teles 16.3",
+ "Creatix/Teles PnP", "AVM A1", "Elsa ML", "Elsa Quickstep",
+ "Teles PCMCIA", "ITK ix1-micro Rev.2", "Elsa PCMCIA",
+ "Eicon.Diehl Diva", "ISDNLink", "TeleInt", "Teles 16.3c",
+ "Sedlbauer Speed Card", "USR Sportster", "ith mic Linux",
+ "Elsa PCI", "Compaq ISA", "NETjet-S", "Teles PCI",
+ "Sedlbauer Speed Star (PCMCIA)", "AMD 7930", "NICCY", "S0Box",
+ "AVM A1 (PCMCIA)", "AVM Fritz PnP/PCI", "Sedlbauer Speed Fax +",
+ "Siemens I-Surf", "Acer P10", "HST Saphir", "Telekom A4T",
+ "Scitel Quadro", "Gazel", "HFC 2BDS0 PCI", "Winbond 6692",
+ "HFC 2BDS0 SX", "NETspider-U", "HFC-2BDS0-SP PCMCIA",
};
void HiSax_closecard(int cardnr);
@@ -90,9 +92,9 @@
#ifdef CONFIG_HISAX_ELSA
#define DEFAULT_CARD ISDN_CTYPE_ELSA
#define DEFAULT_CFG {0,0,0,0}
-int elsa_init_pcmcia(void*, int, int*, int);
+int elsa_init_pcmcia(void *, int, int *, int);
EXPORT_SYMBOL(elsa_init_pcmcia);
-#endif /* CONFIG_HISAX_ELSA */
+#endif
#ifdef CONFIG_HISAX_AVM_A1
#undef DEFAULT_CARD
@@ -106,9 +108,9 @@
#undef DEFAULT_CFG
#define DEFAULT_CARD ISDN_CTYPE_A1_PCMCIA
#define DEFAULT_CFG {11,0x170,0,0}
-int avm_a1_init_pcmcia(void*, int, int*, int);
+int avm_a1_init_pcmcia(void *, int, int *, int);
EXPORT_SYMBOL(avm_a1_init_pcmcia);
-#endif /* CONFIG_HISAX_AVM_A1_PCMCIA */
+#endif
#ifdef CONFIG_HISAX_FRITZPCI
#undef DEFAULT_CARD
@@ -178,9 +180,9 @@
#undef DEFAULT_CFG
#define DEFAULT_CARD ISDN_CTYPE_SEDLBAUER
#define DEFAULT_CFG {11,0x270,0,0}
-int sedl_init_pcmcia(void*, int, int*, int);
+int sedl_init_pcmcia(void *, int, int *, int);
EXPORT_SYMBOL(sedl_init_pcmcia);
-#endif /* CONFIG_HISAX_SEDLBAUER */
+#endif
#ifdef CONFIG_HISAX_SPORTSTER
#undef DEFAULT_CARD
@@ -222,7 +224,7 @@
#undef DEFAULT_CFG
#define DEFAULT_CARD ISDN_CTYPE_HFC_SX
#define DEFAULT_CFG {5,0x2E0,0,0}
-int hfc_init_pcmcia(void*, int, int*, int);
+int hfc_init_pcmcia(void *, int, int *, int);
EXPORT_SYMBOL(hfc_init_pcmcia);
#endif
@@ -255,7 +257,7 @@
#define DEFAULT_CFG {5,0x250,0,0}
#endif
-#ifdef CONFIG_HISAX_BKM_A4T
+#ifdef CONFIG_HISAX_BKM_A4T
#undef DEFAULT_CARD
#undef DEFAULT_CFG
#define DEFAULT_CARD ISDN_CTYPE_BKM_A4T
@@ -327,8 +329,7 @@
#define EMPTY_CARD {0, DEFAULT_PROTO, {0, 0, 0, 0}, NULL}
-struct IsdnCard cards[] =
-{
+struct IsdnCard cards[] = {
FIRST_CARD,
EMPTY_CARD,
EMPTY_CARD,
@@ -373,7 +374,7 @@
#ifdef IO0_IO1
MODULE_PARM(io0, "1-8i");
MODULE_PARM(io1, "1-8i");
-#endif /* IO0_IO1 */
+#endif
#endif /* MODULE */
int nrcards;
@@ -384,8 +385,7 @@
extern char *lli_revision;
extern char *tei_revision;
-char *
-HiSax_getrev(const char *revision)
+char *HiSax_getrev(const char *revision)
{
char *rev;
char *p;
@@ -399,8 +399,7 @@
return rev;
}
-void __init
-HiSaxVersion(void)
+void __init HiSaxVersion(void)
{
char tmp[64];
@@ -419,26 +418,24 @@
strcpy(tmp, l3_revision);
printk(KERN_INFO "HiSax: Layer3 Revision %s\n", HiSax_getrev(tmp));
strcpy(tmp, lli_revision);
- printk(KERN_INFO "HiSax: LinkLayer Revision %s\n", HiSax_getrev(tmp));
+ printk(KERN_INFO "HiSax: LinkLayer Revision %s\n",
+ HiSax_getrev(tmp));
certification_check(1);
}
-void
-HiSax_mod_dec_use_count(void)
+void HiSax_mod_dec_use_count(void)
{
MOD_DEC_USE_COUNT;
}
-void
-HiSax_mod_inc_use_count(void)
+void HiSax_mod_inc_use_count(void)
{
MOD_INC_USE_COUNT;
}
#ifndef MODULE
#define MAX_ARG (HISAX_MAX_CARDS*5)
-static int __init
-HiSax_setup(char *line)
+static int __init HiSax_setup(char *line)
{
int i, j, argc;
int ints[MAX_ARG + 1];
@@ -446,7 +443,7 @@
str = get_options(line, MAX_ARG, ints);
argc = ints[0];
- printk(KERN_DEBUG"HiSax_setup: argc(%d) str(%s)\n", argc, str);
+ printk(KERN_DEBUG "HiSax_setup: argc(%d) str(%s)\n", argc, str);
i = 0;
j = 1;
while (argc && (i < HISAX_MAX_CARDS)) {
@@ -484,7 +481,7 @@
strcpy(HiSaxID, "HiSax");
HiSax_id = HiSaxID;
}
- return(1);
+ return 1;
}
__setup("hisax=", HiSax_setup);
@@ -527,7 +524,7 @@
#endif
#if CARD_DIEHLDIVA
-extern int setup_diva(struct IsdnCard *card);
+extern int setup_diva(struct IsdnCard *card);
#endif
#if CARD_ASUSCOM
@@ -609,43 +606,41 @@
/*
* Find card with given driverId
*/
-static inline struct IsdnCardState
-*hisax_findcard(int driverid)
+static inline struct IsdnCardState *hisax_findcard(int driverid)
{
int i;
for (i = 0; i < nrcards; i++)
if (cards[i].cs)
if (cards[i].cs->myid == driverid)
- return (cards[i].cs);
- return (NULL);
+ return cards[i].cs;
+ return NULL;
}
/*
* Find card with given card number
*/
-struct IsdnCardState
-*hisax_get_card(int cardnr)
+struct IsdnCardState *hisax_get_card(int cardnr)
{
- if ((cardnr <= nrcards) && (cardnr>0))
- if (cards[cardnr-1].cs)
- return (cards[cardnr-1].cs);
- return (NULL);
+ if ((cardnr <= nrcards) && (cardnr > 0))
+ if (cards[cardnr - 1].cs)
+ return cards[cardnr - 1].cs;
+ return NULL;
}
-int
-HiSax_readstatus(u_char * buf, int len, int user, int id, int channel)
+int HiSax_readstatus(u_char * buf, int len, int user, int id, int channel)
{
- int count,cnt;
+ int count, cnt;
u_char *p = buf;
struct IsdnCardState *cs = hisax_findcard(id);
if (cs) {
if (len > HISAX_STATUS_BUFSIZE) {
- printk(KERN_WARNING "HiSax: status overflow readstat %d/%d\n",
- len, HISAX_STATUS_BUFSIZE);
+ printk(KERN_WARNING
+ "HiSax: status overflow readstat %d/%d\n",
+ len, HISAX_STATUS_BUFSIZE);
}
- count = cs->status_end - cs->status_read +1;
+ count = cs->status_end - cs->status_read + 1;
if (count >= len)
count = len;
if (user)
@@ -673,13 +668,12 @@
return len;
} else {
printk(KERN_ERR
- "HiSax: if_readstatus called with invalid driverId!\n");
+ "HiSax: if_readstatus called with invalid driverId!\n");
return -ENODEV;
}
}
-inline int
-jiftime(char *s, long mark)
+int jiftime(char *s, long mark)
{
s += 8;
@@ -697,15 +691,15 @@
*s-- = mark % 10 + '0';
mark /= 10;
*s-- = mark % 10 + '0';
- return(8);
+ return 8;
}
static u_char tmpbuf[HISAX_STATUS_BUFSIZE];
-void
-VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args)
+void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt,
+ va_list args)
{
-/* if head == NULL the fmt contains the full info */
+ /* if head == NULL the fmt contains the full info */
long flags;
int count, i;
@@ -729,18 +723,19 @@
len = strlen(fmt);
}
if (!cs) {
- printk(KERN_WARNING "HiSax: No CardStatus for message %s", p);
+ printk(KERN_WARNING "HiSax: No CardStatus for message %s",
+ p);
restore_flags(flags);
return;
}
if (len > HISAX_STATUS_BUFSIZE) {
printk(KERN_WARNING "HiSax: status overflow %d/%d\n",
- len, HISAX_STATUS_BUFSIZE);
+ len, HISAX_STATUS_BUFSIZE);
restore_flags(flags);
return;
}
count = len;
- i = cs->status_end - cs->status_write +1;
+ i = cs->status_end - cs->status_write + 1;
if (i >= len)
i = len;
len -= i;
@@ -754,7 +749,7 @@
cs->status_write += len;
}
#ifdef KERNELSTACK_DEBUG
- i = (ulong)&len - current->kernel_stack_page;
+ i = (ulong) & len - current->kernel_stack_page;
sprintf(tmpbuf, "kstack %s %lx use %ld\n", current->comm,
current->kernel_stack_page, i);
len = strlen(tmpbuf);
@@ -774,8 +769,7 @@
}
}
-void
-HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...)
+void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...)
{
va_list args;
@@ -784,8 +778,7 @@
va_end(args);
}
-int
-ll_run(struct IsdnCardState *cs, int addfeatures)
+int ll_run(struct IsdnCardState *cs, int addfeatures)
{
long flags;
isdn_ctrl ic;
@@ -800,19 +793,17 @@
return 0;
}
-void
-ll_stop(struct IsdnCardState *cs)
+void ll_stop(struct IsdnCardState *cs)
{
isdn_ctrl ic;
ic.command = ISDN_STAT_STOP;
ic.driver = cs->myid;
cs->iif.statcallb(&ic);
-// CallcFreeChan(cs);
+ // CallcFreeChan(cs);
}
-static void
-ll_unload(struct IsdnCardState *cs)
+static void ll_unload(struct IsdnCardState *cs)
{
isdn_ctrl ic;
@@ -827,8 +818,7 @@
kfree(cs->dlog);
}
-static void
-closecard(int cardnr)
+static void closecard(int cardnr)
{
struct IsdnCardState *csta = cards[cardnr].cs;
@@ -856,56 +846,54 @@
ll_unload(csta);
}
-static int __devinit
-init_card(struct IsdnCardState *cs)
+static int __devinit init_card(struct IsdnCardState *cs)
{
int irq_cnt, cnt = 3;
long flags;
if (!cs->irq)
- return(cs->cardmsg(cs, CARD_INIT, NULL));
+ return cs->cardmsg(cs, CARD_INIT, NULL);
save_flags(flags);
cli();
irq_cnt = kstat_irqs(cs->irq);
- printk(KERN_INFO "%s: IRQ %d count %d\n", CardType[cs->typ], cs->irq,
- irq_cnt);
+ printk(KERN_INFO "%s: IRQ %d count %d\n", CardType[cs->typ],
+ cs->irq, irq_cnt);
if (request_irq(cs->irq, cs->irq_func, cs->irq_flags, "HiSax", cs)) {
printk(KERN_WARNING "HiSax: couldn't get interrupt %d\n",
- cs->irq);
+ cs->irq);
restore_flags(flags);
- return(1);
+ return 1;
}
while (cnt) {
cs->cardmsg(cs, CARD_INIT, NULL);
sti();
set_current_state(TASK_UNINTERRUPTIBLE);
/* Timeout 10ms */
- schedule_timeout((10*HZ)/1000);
+ schedule_timeout((10 * HZ) / 1000);
restore_flags(flags);
- printk(KERN_INFO "%s: IRQ %d count %d\n", CardType[cs->typ],
- cs->irq, kstat_irqs(cs->irq));
+ printk(KERN_INFO "%s: IRQ %d count %d\n",
+ CardType[cs->typ], cs->irq, kstat_irqs(cs->irq));
if (kstat_irqs(cs->irq) == irq_cnt) {
printk(KERN_WARNING
"%s: IRQ(%d) getting no interrupts during init %d\n",
CardType[cs->typ], cs->irq, 4 - cnt);
if (cnt == 1) {
free_irq(cs->irq, cs);
- return (2);
+ return 2;
} else {
cs->cardmsg(cs, CARD_RESET, NULL);
cnt--;
}
} else {
cs->cardmsg(cs, CARD_TEST, NULL);
- return(0);
+ return 0;
}
}
restore_flags(flags);
- return(3);
+ return 3;
}
-static int __devinit
-checkcard(int cardnr, char *id, int *busy_flag)
+static int __devinit checkcard(int cardnr, char *id, int *busy_flag)
{
long flags;
int ret = 0;
@@ -923,8 +911,8 @@
}
memset(cs, 0, sizeof(struct IsdnCardState));
card->cs = cs;
- cs->chanlimit = 2; /* maximum B-channel number */
- cs->logecho = 0; /* No echo logging */
+ cs->chanlimit = 2; /* maximum B-channel number */
+ cs->logecho = 0; /* No echo logging */
cs->cardnr = cardnr;
cs->debug = L1_DEB_WARN;
cs->HW_Flags = 0;
@@ -940,14 +928,12 @@
if (card->typ <= 0 || card->typ > ISDN_CTYPE_COUNT) {
printk(KERN_WARNING
- "HiSax: Card Type %d out of range\n",
- card->typ);
+ "HiSax: Card Type %d out of range\n", card->typ);
goto outf_cs;
}
if (!(cs->dlog = kmalloc(MAX_DLOG_SPACE, GFP_ATOMIC))) {
printk(KERN_WARNING
- "HiSax: No memory for dlog(card %d)\n",
- cardnr + 1);
+ "HiSax: No memory for dlog(card %d)\n", cardnr + 1);
goto outf_cs;
}
if (!(cs->status_buf = kmalloc(HISAX_STATUS_BUFSIZE, GFP_ATOMIC))) {
@@ -981,7 +967,7 @@
ISDN_FEATURE_P_NI1 |
#endif
0;
-
+
cs->iif.command = HiSax_command;
cs->iif.writecmd = NULL;
cs->iif.writebuf_skb = HiSax_writebuf_skb;
@@ -1092,12 +1078,12 @@
break;
#endif
#if CARD_HFC_PCI
- case ISDN_CTYPE_HFC_PCI:
+ case ISDN_CTYPE_HFC_PCI:
ret = setup_hfcpci(card);
break;
#endif
#if CARD_HFC_SX
- case ISDN_CTYPE_HFC_SX:
+ case ISDN_CTYPE_HFC_SX:
ret = setup_hfcsx(card);
break;
#endif
@@ -1126,7 +1112,7 @@
ret = setup_testemu(card);
break;
#endif
-#if CARD_BKM_A4T
+#if CARD_BKM_A4T
case ISDN_CTYPE_BKM_A4T:
ret = setup_bkm_a4t(card);
break;
@@ -1163,8 +1149,7 @@
goto outf_cs;
}
if (!(cs->rcvbuf = kmalloc(MAX_DFRAME_LEN_L1, GFP_ATOMIC))) {
- printk(KERN_WARNING
- "HiSax: No memory for isac rcvbuf\n");
+ printk(KERN_WARNING "HiSax: No memory for isac rcvbuf\n");
ll_unload(cs);
goto outf_cs;
}
@@ -1210,8 +1195,7 @@
return ret;
}
-void __devinit
-HiSax_shiftcards(int idx)
+void __devinit HiSax_shiftcards(int idx)
{
int i;
@@ -1219,8 +1203,7 @@
memcpy(&cards[i], &cards[i + 1], sizeof(cards[i]));
}
-int __devinit
-HiSax_inithardware(int *busy_flag)
+int __devinit HiSax_inithardware(int *busy_flag)
{
int foundcards = 0;
int i = 0;
@@ -1254,7 +1237,8 @@
foundcards++;
i++;
} else {
- printk(KERN_WARNING "HiSax: Card %s not installed !\n",
+ printk(KERN_WARNING
+ "HiSax: Card %s not installed !\n",
CardType[cards[i].typ]);
HiSax_shiftcards(i);
nrcards--;
@@ -1263,19 +1247,17 @@
return foundcards;
}
-void
-HiSax_closecard(int cardnr)
+void HiSax_closecard(int cardnr)
{
- int i,last=nrcards - 1;
+ int i, last = nrcards - 1;
- if (cardnr>last)
+ if (cardnr > last)
return;
if (cards[cardnr].cs) {
ll_stop(cards[cardnr].cs);
release_tei(cards[cardnr].cs);
-
CallcFreeChan(cards[cardnr].cs);
-
+
closecard(cardnr);
if (cards[cardnr].cs->irq)
free_irq(cards[cardnr].cs->irq, cards[cardnr].cs);
@@ -1283,15 +1265,14 @@
cards[cardnr].cs = NULL;
}
i = cardnr;
- while (i!=last) {
- cards[i] = cards[i+1];
+ while (i <= last) {
+ cards[i] = cards[i + 1];
i++;
}
nrcards--;
}
-void
-HiSax_reportcard(int cardnr, int sel)
+void HiSax_reportcard(int cardnr, int sel)
{
struct IsdnCardState *cs = cards[cardnr].cs;
@@ -1299,21 +1280,25 @@
printk(KERN_DEBUG "HiSax: Type %s\n", CardType[cs->typ]);
printk(KERN_DEBUG "HiSax: debuglevel %x\n", cs->debug);
printk(KERN_DEBUG "HiSax: HiSax_reportcard address 0x%lX\n",
- (ulong) & HiSax_reportcard);
+ (ulong) & HiSax_reportcard);
printk(KERN_DEBUG "HiSax: cs 0x%lX\n", (ulong) cs);
printk(KERN_DEBUG "HiSax: HW_Flags %lx bc0 flg %lx bc1 flg %lx\n",
- cs->HW_Flags, cs->bcs[0].Flag, cs->bcs[1].Flag);
+ cs->HW_Flags, cs->bcs[0].Flag, cs->bcs[1].Flag);
printk(KERN_DEBUG "HiSax: bcs 0 mode %d ch%d\n",
- cs->bcs[0].mode, cs->bcs[0].channel);
+ cs->bcs[0].mode, cs->bcs[0].channel);
printk(KERN_DEBUG "HiSax: bcs 1 mode %d ch%d\n",
- cs->bcs[1].mode, cs->bcs[1].channel);
+ cs->bcs[1].mode, cs->bcs[1].channel);
#ifdef ERROR_STATISTIC
printk(KERN_DEBUG "HiSax: dc errors(rx,crc,tx) %d,%d,%d\n",
- cs->err_rx, cs->err_crc, cs->err_tx);
- printk(KERN_DEBUG "HiSax: bc0 errors(inv,rdo,crc,tx) %d,%d,%d,%d\n",
- cs->bcs[0].err_inv, cs->bcs[0].err_rdo, cs->bcs[0].err_crc, cs->bcs[0].err_tx);
- printk(KERN_DEBUG "HiSax: bc1 errors(inv,rdo,crc,tx) %d,%d,%d,%d\n",
- cs->bcs[1].err_inv, cs->bcs[1].err_rdo, cs->bcs[1].err_crc, cs->bcs[1].err_tx);
+ cs->err_rx, cs->err_crc, cs->err_tx);
+ printk(KERN_DEBUG
+ "HiSax: bc0 errors(inv,rdo,crc,tx) %d,%d,%d,%d\n",
+ cs->bcs[0].err_inv, cs->bcs[0].err_rdo, cs->bcs[0].err_crc,
+ cs->bcs[0].err_tx);
+ printk(KERN_DEBUG
+ "HiSax: bc1 errors(inv,rdo,crc,tx) %d,%d,%d,%d\n",
+ cs->bcs[1].err_inv, cs->bcs[1].err_rdo, cs->bcs[1].err_crc,
+ cs->bcs[1].err_tx);
if (sel == 99) {
cs->err_rx = 0;
cs->err_crc = 0;
@@ -1333,7 +1318,7 @@
static int __init HiSax_init(void)
{
int i, retval;
-#ifdef MODULE
+#ifdef MODULE
int j;
int nzproto = 0;
#endif
@@ -1357,7 +1342,7 @@
#ifdef MODULE
if (!type[0]) {
- /* We 'll register drivers later, but init basic functions*/
+ /* We 'll register drivers later, but init basic functions */
return 0;
}
#ifdef CONFIG_HISAX_ELSA
@@ -1396,98 +1381,100 @@
nzproto++;
}
switch (type[i]) {
- case ISDN_CTYPE_16_0:
- cards[j].para[0] = irq[i];
- cards[j].para[1] = mem[i];
- cards[j].para[2] = io[i];
- break;
+ case ISDN_CTYPE_16_0:
+ cards[j].para[0] = irq[i];
+ cards[j].para[1] = mem[i];
+ cards[j].para[2] = io[i];
+ break;
- case ISDN_CTYPE_8_0:
- cards[j].para[0] = irq[i];
- cards[j].para[1] = mem[i];
- break;
+ case ISDN_CTYPE_8_0:
+ cards[j].para[0] = irq[i];
+ cards[j].para[1] = mem[i];
+ break;
#ifdef IO0_IO1
- case ISDN_CTYPE_PNP:
- case ISDN_CTYPE_NICCY:
- cards[j].para[0] = irq[i];
- cards[j].para[1] = io0[i];
- cards[j].para[2] = io1[i];
- break;
- case ISDN_CTYPE_COMPAQ_ISA:
- cards[j].para[0] = irq[i];
- cards[j].para[1] = io0[i];
- cards[j].para[2] = io1[i];
- cards[j].para[3] = io[i];
- break;
-#endif
- case ISDN_CTYPE_ELSA:
- case ISDN_CTYPE_HFC_PCI:
- cards[j].para[0] = io[i];
- break;
- case ISDN_CTYPE_16_3:
- case ISDN_CTYPE_TELESPCMCIA:
- case ISDN_CTYPE_A1:
- case ISDN_CTYPE_A1_PCMCIA:
- case ISDN_CTYPE_ELSA_PNP:
- case ISDN_CTYPE_ELSA_PCMCIA:
- case ISDN_CTYPE_IX1MICROR2:
- case ISDN_CTYPE_DIEHLDIVA:
- case ISDN_CTYPE_ASUSCOM:
- case ISDN_CTYPE_TELEINT:
- case ISDN_CTYPE_SEDLBAUER:
- case ISDN_CTYPE_SEDLBAUER_PCMCIA:
- case ISDN_CTYPE_SEDLBAUER_FAX:
- case ISDN_CTYPE_SPORTSTER:
- case ISDN_CTYPE_MIC:
- case ISDN_CTYPE_TELES3C:
- case ISDN_CTYPE_ACERP10:
- case ISDN_CTYPE_S0BOX:
- case ISDN_CTYPE_FRITZPCI:
- case ISDN_CTYPE_HSTSAPHIR:
- case ISDN_CTYPE_GAZEL:
- case ISDN_CTYPE_HFC_SX:
- case ISDN_CTYPE_HFC_SP_PCMCIA:
- cards[j].para[0] = irq[i];
- cards[j].para[1] = io[i];
- break;
- case ISDN_CTYPE_ISURF:
+ case ISDN_CTYPE_PNP:
+ case ISDN_CTYPE_NICCY:
+ cards[j].para[0] = irq[i];
+ cards[j].para[1] = io0[i];
+ cards[j].para[2] = io1[i];
+ break;
+ case ISDN_CTYPE_COMPAQ_ISA:
+ cards[j].para[0] = irq[i];
+ cards[j].para[1] = io0[i];
+ cards[j].para[2] = io1[i];
+ cards[j].para[3] = io[i];
+ break;
+#endif
+ case ISDN_CTYPE_ELSA:
+ case ISDN_CTYPE_HFC_PCI:
+ cards[j].para[0] = io[i];
+ break;
+ case ISDN_CTYPE_16_3:
+ case ISDN_CTYPE_TELESPCMCIA:
+ case ISDN_CTYPE_A1:
+ case ISDN_CTYPE_A1_PCMCIA:
+ case ISDN_CTYPE_ELSA_PNP:
+ case ISDN_CTYPE_ELSA_PCMCIA:
+ case ISDN_CTYPE_IX1MICROR2:
+ case ISDN_CTYPE_DIEHLDIVA:
+ case ISDN_CTYPE_ASUSCOM:
+ case ISDN_CTYPE_TELEINT:
+ case ISDN_CTYPE_SEDLBAUER:
+ case ISDN_CTYPE_SEDLBAUER_PCMCIA:
+ case ISDN_CTYPE_SEDLBAUER_FAX:
+ case ISDN_CTYPE_SPORTSTER:
+ case ISDN_CTYPE_MIC:
+ case ISDN_CTYPE_TELES3C:
+ case ISDN_CTYPE_ACERP10:
+ case ISDN_CTYPE_S0BOX:
+ case ISDN_CTYPE_FRITZPCI:
+ case ISDN_CTYPE_HSTSAPHIR:
+ case ISDN_CTYPE_GAZEL:
+ case ISDN_CTYPE_HFC_SX:
+ case ISDN_CTYPE_HFC_SP_PCMCIA:
+ cards[j].para[0] = irq[i];
+ cards[j].para[1] = io[i];
+ break;
+ case ISDN_CTYPE_ISURF:
+ cards[j].para[0] = irq[i];
+ cards[j].para[1] = io[i];
+ cards[j].para[2] = mem[i];
+ break;
+ case ISDN_CTYPE_ELSA_PCI:
+ case ISDN_CTYPE_NETJET_S:
+ case ISDN_CTYPE_AMD7930:
+ case ISDN_CTYPE_TELESPCI:
+ case ISDN_CTYPE_W6692:
+ case ISDN_CTYPE_NETJET_U:
+ break;
+ case ISDN_CTYPE_BKM_A4T:
+ break;
+ case ISDN_CTYPE_SCT_QUADRO:
+ if (irq[i]) {
cards[j].para[0] = irq[i];
- cards[j].para[1] = io[i];
- cards[j].para[2] = mem[i];
- break;
- case ISDN_CTYPE_ELSA_PCI:
- case ISDN_CTYPE_NETJET_S:
- case ISDN_CTYPE_AMD7930:
- case ISDN_CTYPE_TELESPCI:
- case ISDN_CTYPE_W6692:
- case ISDN_CTYPE_NETJET_U:
- break;
- case ISDN_CTYPE_BKM_A4T:
- break;
- case ISDN_CTYPE_SCT_QUADRO:
- if (irq[i]) {
- cards[j].para[0] = irq[i];
- } else {
- /* QUADRO is a 4 BRI card */
- cards[j++].para[0] = 1;
- cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
- cards[j].protocol = protocol[i];
- cards[j++].para[0] = 2;
- cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
- cards[j].protocol = protocol[i];
- cards[j++].para[0] = 3;
- cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
- cards[j].protocol = protocol[i];
- cards[j].para[0] = 4;
- }
- break;
+ } else {
+ /* QUADRO is a 4 BRI card */
+ cards[j++].para[0] = 1;
+ cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
+ cards[j].protocol = protocol[i];
+ cards[j++].para[0] = 2;
+ cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
+ cards[j].protocol = protocol[i];
+ cards[j++].para[0] = 3;
+ cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
+ cards[j].protocol = protocol[i];
+ cards[j].para[0] = 4;
+ }
+ break;
}
j++;
}
if (!nzproto) {
- printk(KERN_WARNING "HiSax: Warning - no protocol specified\n");
- printk(KERN_WARNING "HiSax: using protocol %s\n", DEFAULT_PROTO_NAME);
+ printk(KERN_WARNING
+ "HiSax: Warning - no protocol specified\n");
+ printk(KERN_WARNING "HiSax: using protocol %s\n",
+ DEFAULT_PROTO_NAME);
}
#endif
if (!HiSax_id)
@@ -1505,7 +1492,7 @@
retval = -EIO;
goto out_isdnl1;
}
-
+
return 0;
out_isdnl1:
@@ -1524,12 +1511,12 @@
static void __exit HiSax_exit(void)
{
- int cardnr = nrcards -1;
+ int cardnr = nrcards - 1;
long flags;
save_flags(flags);
cli();
- while(cardnr>=0)
+ while (cardnr >= 0)
HiSax_closecard(cardnr--);
Isdnl1Free();
TeiFree();
@@ -1549,7 +1536,7 @@
nrcards = 0;
/* Initialize all structs, even though we only accept
two pcmcia cards
- */
+ */
for (i = 0; i < HISAX_MAX_CARDS; i++) {
cards[i].para[0] = irq[i];
cards[i].para[1] = io[i];
@@ -1559,7 +1546,7 @@
}
}
cards[0].para[0] = pcm_irq;
- cards[0].para[1] = (int)pcm_iob;
+ cards[0].para[1] = (int) pcm_iob;
cards[0].protocol = prot;
cards[0].typ = ISDN_CTYPE_ELSA_PCMCIA;
@@ -1576,7 +1563,7 @@
HiSax_inithardware(busy_flag);
printk(KERN_NOTICE "HiSax: module installed\n");
#endif
- return (0);
+ return 0;
}
#endif
@@ -1590,7 +1577,7 @@
nrcards = 0;
/* Initialize all structs, even though we only accept
two pcmcia cards
- */
+ */
for (i = 0; i < HISAX_MAX_CARDS; i++) {
cards[i].para[0] = irq[i];
cards[i].para[1] = io[i];
@@ -1601,7 +1588,7 @@
}
}
cards[0].para[0] = pcm_irq;
- cards[0].para[1] = (int)pcm_iob;
+ cards[0].para[1] = (int) pcm_iob;
cards[0].protocol = prot;
cards[0].typ = ISDN_CTYPE_HFC_SP_PCMCIA;
nzproto = 1;
@@ -1619,7 +1606,7 @@
HiSax_inithardware(busy_flag);
printk(KERN_NOTICE "HiSax: module installed\n");
#endif
- return (0);
+ return 0;
}
#endif
@@ -1633,7 +1620,7 @@
nrcards = 0;
/* Initialize all structs, even though we only accept
two pcmcia cards
- */
+ */
for (i = 0; i < HISAX_MAX_CARDS; i++) {
cards[i].para[0] = irq[i];
cards[i].para[1] = io[i];
@@ -1644,7 +1631,7 @@
}
}
cards[0].para[0] = pcm_irq;
- cards[0].para[1] = (int)pcm_iob;
+ cards[0].para[1] = (int) pcm_iob;
cards[0].protocol = prot;
cards[0].typ = ISDN_CTYPE_SEDLBAUER_PCMCIA;
nzproto = 1;
@@ -1662,7 +1649,7 @@
HiSax_inithardware(busy_flag);
printk(KERN_NOTICE "HiSax: module installed\n");
#endif
- return (0);
+ return 0;
}
#endif
@@ -1676,7 +1663,7 @@
nrcards = 0;
/* Initialize all structs, even though we only accept
two pcmcia cards
- */
+ */
for (i = 0; i < HISAX_MAX_CARDS; i++) {
cards[i].para[0] = irq[i];
cards[i].para[1] = io[i];
@@ -1687,7 +1674,7 @@
}
}
cards[0].para[0] = pcm_irq;
- cards[0].para[1] = (int)pcm_iob;
+ cards[0].para[1] = (int) pcm_iob;
cards[0].protocol = prot;
cards[0].typ = ISDN_CTYPE_A1_PCMCIA;
nzproto = 1;
@@ -1705,11 +1692,12 @@
HiSax_inithardware(busy_flag);
printk(KERN_NOTICE "HiSax: module installed\n");
#endif
- return (0);
+ return 0;
}
#endif
-int __devinit hisax_init_pcmcia(void *pcm_iob, int *busy_flag, struct IsdnCard *card)
+int __devinit hisax_init_pcmcia(void *pcm_iob, int *busy_flag,
+ struct IsdnCard *card)
{
u_char ids[16];
int ret = -1;
@@ -1720,11 +1708,11 @@
else
sprintf(ids, "HiSax");
if (!checkcard(nrcards, ids, busy_flag)) {
- return(-1);
+ return -1;
}
ret = nrcards;
nrcards++;
- return (ret);
+ return ret;
}
#include <linux/pci.h>
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)