Commit 42f04b6d authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'isdn-cleanups' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6

* 'isdn-cleanups' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/misc-2.6:
  [ISDN] HiSax diva: split setup into three smaller functions
  [ISDN] HiSax sedlbauer: move ISAPNP and PCI code into functions of their own
  [ISDN] HiSax elsa: split huge setup function into four smaller functions
  [ISDN] HiSax avm_pci: split setup into three smaller functions
  [ISDN] Remove CONFIG_PCI ifdefs from 100% PCI source code
parents 71a380d6 4b5a9b3d
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <linux/isapnp.h> #include <linux/isapnp.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
extern const char *CardType[];
static const char *avm_pci_rev = "$Revision: 1.29.2.4 $"; static const char *avm_pci_rev = "$Revision: 1.29.2.4 $";
#define AVM_FRITZ_PCI 1 #define AVM_FRITZ_PCI 1
...@@ -726,34 +725,74 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -726,34 +725,74 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg)
return(0); return(0);
} }
#ifdef CONFIG_PCI static int __devinit avm_setup_rest(struct IsdnCardState *cs)
static struct pci_dev *dev_avm __devinitdata = NULL;
#endif
#ifdef __ISAPNP__
static struct pnp_card *pnp_avm_c __devinitdata = NULL;
#endif
int __devinit
setup_avm_pcipnp(struct IsdnCard *card)
{ {
u_int val, ver; u_int val, ver;
struct IsdnCardState *cs = card->cs;
char tmp[64];
strcpy(tmp, avm_pci_rev); cs->hw.avm.isac = cs->hw.avm.cfg_reg + 0x10;
printk(KERN_INFO "HiSax: AVM PCI driver Rev. %s\n", HiSax_getrev(tmp)); if (!request_region(cs->hw.avm.cfg_reg, 32,
if (cs->typ != ISDN_CTYPE_FRITZPCI) (cs->subtyp == AVM_FRITZ_PCI) ? "avm PCI" : "avm PnP")) {
printk(KERN_WARNING
"HiSax: Fritz!PCI/PNP config port %x-%x already in use\n",
cs->hw.avm.cfg_reg,
cs->hw.avm.cfg_reg + 31);
return (0); return (0);
if (card->para[1]) {
/* old manual method */
cs->hw.avm.cfg_reg = card->para[1];
cs->irq = card->para[0];
cs->subtyp = AVM_FRITZ_PNP;
goto ready;
} }
#ifdef __ISAPNP__ switch (cs->subtyp) {
if (isapnp_present()) { case AVM_FRITZ_PCI:
val = inl(cs->hw.avm.cfg_reg);
printk(KERN_INFO "AVM PCI: stat %#x\n", val);
printk(KERN_INFO "AVM PCI: Class %X Rev %d\n",
val & 0xff, (val>>8) & 0xff);
cs->BC_Read_Reg = &ReadHDLC_s;
cs->BC_Write_Reg = &WriteHDLC_s;
break;
case AVM_FRITZ_PNP:
val = inb(cs->hw.avm.cfg_reg);
ver = inb(cs->hw.avm.cfg_reg + 1);
printk(KERN_INFO "AVM PnP: Class %X Rev %d\n", val, ver);
cs->BC_Read_Reg = &ReadHDLCPnP;
cs->BC_Write_Reg = &WriteHDLCPnP;
break;
default:
printk(KERN_WARNING "AVM unknown subtype %d\n", cs->subtyp);
return(0);
}
printk(KERN_INFO "HiSax: %s config irq:%d base:0x%X\n",
(cs->subtyp == AVM_FRITZ_PCI) ? "AVM Fritz!PCI" : "AVM Fritz!PnP",
cs->irq, cs->hw.avm.cfg_reg);
setup_isac(cs);
cs->readisac = &ReadISAC;
cs->writeisac = &WriteISAC;
cs->readisacfifo = &ReadISACfifo;
cs->writeisacfifo = &WriteISACfifo;
cs->BC_Send_Data = &hdlc_fill_fifo;
cs->cardmsg = &AVM_card_msg;
cs->irq_func = &avm_pcipnp_interrupt;
cs->writeisac(cs, ISAC_MASK, 0xFF);
ISACVersion(cs, (cs->subtyp == AVM_FRITZ_PCI) ? "AVM PCI:" : "AVM PnP:");
return (1);
}
#ifndef __ISAPNP__
static int __devinit avm_pnp_setup(struct IsdnCardState *cs)
{
return(1); /* no-op: success */
}
#else
static struct pnp_card *pnp_avm_c __devinitdata = NULL;
static int __devinit avm_pnp_setup(struct IsdnCardState *cs)
{
struct pnp_dev *pnp_avm_d = NULL; struct pnp_dev *pnp_avm_d = NULL;
if (!isapnp_present())
return(1); /* no-op: success */
if ((pnp_avm_c = pnp_find_card( if ((pnp_avm_c = pnp_find_card(
ISAPNP_VENDOR('A', 'V', 'M'), ISAPNP_VENDOR('A', 'V', 'M'),
ISAPNP_FUNCTION(0x0900), pnp_avm_c))) { ISAPNP_FUNCTION(0x0900), pnp_avm_c))) {
...@@ -781,82 +820,91 @@ setup_avm_pcipnp(struct IsdnCard *card) ...@@ -781,82 +820,91 @@ setup_avm_pcipnp(struct IsdnCard *card)
return(0); return(0);
} }
cs->subtyp = AVM_FRITZ_PNP; cs->subtyp = AVM_FRITZ_PNP;
goto ready;
} return (2); /* goto 'ready' label */
} }
} else {
printk(KERN_INFO "FritzPnP: no ISA PnP present\n");
} }
#endif
#ifdef CONFIG_PCI return (1);
}
#endif /* __ISAPNP__ */
#ifndef CONFIG_PCI
static int __devinit avm_pci_setup(struct IsdnCardState *cs)
{
return(1); /* no-op: success */
}
#else
static struct pci_dev *dev_avm __devinitdata = NULL;
static int __devinit avm_pci_setup(struct IsdnCardState *cs)
{
if ((dev_avm = pci_find_device(PCI_VENDOR_ID_AVM, if ((dev_avm = pci_find_device(PCI_VENDOR_ID_AVM,
PCI_DEVICE_ID_AVM_A1, dev_avm))) { PCI_DEVICE_ID_AVM_A1, dev_avm))) {
if (pci_enable_device(dev_avm)) if (pci_enable_device(dev_avm))
return(0); return(0);
cs->irq = dev_avm->irq; cs->irq = dev_avm->irq;
if (!cs->irq) { if (!cs->irq) {
printk(KERN_ERR "FritzPCI: No IRQ for PCI card found\n"); printk(KERN_ERR "FritzPCI: No IRQ for PCI card found\n");
return(0); return(0);
} }
cs->hw.avm.cfg_reg = pci_resource_start(dev_avm, 1); cs->hw.avm.cfg_reg = pci_resource_start(dev_avm, 1);
if (!cs->hw.avm.cfg_reg) { if (!cs->hw.avm.cfg_reg) {
printk(KERN_ERR "FritzPCI: No IO-Adr for PCI card found\n"); printk(KERN_ERR "FritzPCI: No IO-Adr for PCI card found\n");
return(0); return(0);
} }
cs->subtyp = AVM_FRITZ_PCI; cs->subtyp = AVM_FRITZ_PCI;
} else { } else {
printk(KERN_WARNING "FritzPCI: No PCI card found\n"); printk(KERN_WARNING "FritzPCI: No PCI card found\n");
return(0); return(0);
} }
cs->irq_flags |= IRQF_SHARED; cs->irq_flags |= IRQF_SHARED;
#else
printk(KERN_WARNING "FritzPCI: NO_PCI_BIOS\n"); return (1);
return (0); }
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
ready:
cs->hw.avm.isac = cs->hw.avm.cfg_reg + 0x10; int __devinit
if (!request_region(cs->hw.avm.cfg_reg, 32, setup_avm_pcipnp(struct IsdnCard *card)
(cs->subtyp == AVM_FRITZ_PCI) ? "avm PCI" : "avm PnP")) { {
printk(KERN_WARNING struct IsdnCardState *cs = card->cs;
"HiSax: %s config port %x-%x already in use\n", char tmp[64];
CardType[card->typ], int rc;
cs->hw.avm.cfg_reg,
cs->hw.avm.cfg_reg + 31); strcpy(tmp, avm_pci_rev);
printk(KERN_INFO "HiSax: AVM PCI driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_FRITZPCI)
return (0); return (0);
if (card->para[1]) {
/* old manual method */
cs->hw.avm.cfg_reg = card->para[1];
cs->irq = card->para[0];
cs->subtyp = AVM_FRITZ_PNP;
goto ready;
} }
switch (cs->subtyp) {
case AVM_FRITZ_PCI:
val = inl(cs->hw.avm.cfg_reg);
printk(KERN_INFO "AVM PCI: stat %#x\n", val);
printk(KERN_INFO "AVM PCI: Class %X Rev %d\n",
val & 0xff, (val>>8) & 0xff);
cs->BC_Read_Reg = &ReadHDLC_s;
cs->BC_Write_Reg = &WriteHDLC_s;
break;
case AVM_FRITZ_PNP:
val = inb(cs->hw.avm.cfg_reg);
ver = inb(cs->hw.avm.cfg_reg + 1);
printk(KERN_INFO "AVM PnP: Class %X Rev %d\n", val, ver);
cs->BC_Read_Reg = &ReadHDLCPnP;
cs->BC_Write_Reg = &WriteHDLCPnP;
break;
default:
printk(KERN_WARNING "AVM unknown subtype %d\n", cs->subtyp);
return(0);
}
printk(KERN_INFO "HiSax: %s config irq:%d base:0x%X\n",
(cs->subtyp == AVM_FRITZ_PCI) ? "AVM Fritz!PCI" : "AVM Fritz!PnP",
cs->irq, cs->hw.avm.cfg_reg);
setup_isac(cs); rc = avm_pnp_setup(cs);
cs->readisac = &ReadISAC; if (rc < 1)
cs->writeisac = &WriteISAC; return (0);
cs->readisacfifo = &ReadISACfifo; if (rc == 2)
cs->writeisacfifo = &WriteISACfifo; goto ready;
cs->BC_Send_Data = &hdlc_fill_fifo;
cs->cardmsg = &AVM_card_msg; rc = avm_pci_setup(cs);
cs->irq_func = &avm_pcipnp_interrupt; if (rc < 1)
cs->writeisac(cs, ISAC_MASK, 0xFF); return (0);
ISACVersion(cs, (cs->subtyp == AVM_FRITZ_PCI) ? "AVM PCI:" : "AVM PnP:");
return (1); ready:
return avm_setup_rest(cs);
} }
...@@ -20,8 +20,6 @@ ...@@ -20,8 +20,6 @@
#include <linux/pci.h> #include <linux/pci.h>
#include "bkm_ax.h" #include "bkm_ax.h"
#ifdef CONFIG_PCI
#define ATTEMPT_PCI_REMAPPING /* Required for PLX rev 1 */ #define ATTEMPT_PCI_REMAPPING /* Required for PLX rev 1 */
extern const char *CardType[]; extern const char *CardType[];
...@@ -279,12 +277,9 @@ static u_char pci_bus __devinitdata = 0; ...@@ -279,12 +277,9 @@ static u_char pci_bus __devinitdata = 0;
static u_char pci_device_fn __devinitdata = 0; static u_char pci_device_fn __devinitdata = 0;
static u_char pci_irq __devinitdata = 0; static u_char pci_irq __devinitdata = 0;
#endif /* CONFIG_PCI */
int __devinit int __devinit
setup_sct_quadro(struct IsdnCard *card) setup_sct_quadro(struct IsdnCard *card)
{ {
#ifdef CONFIG_PCI
struct IsdnCardState *cs = card->cs; struct IsdnCardState *cs = card->cs;
char tmp[64]; char tmp[64];
u_int found = 0; u_int found = 0;
...@@ -442,7 +437,4 @@ setup_sct_quadro(struct IsdnCard *card) ...@@ -442,7 +437,4 @@ setup_sct_quadro(struct IsdnCard *card)
sct_quadro_subtypes[cs->subtyp], sct_quadro_subtypes[cs->subtyp],
readreg(cs->hw.ax.base, cs->hw.ax.data_adr, IPAC_ID)); readreg(cs->hw.ax.base, cs->hw.ax.data_adr, IPAC_ID));
return (1); return (1);
#else
printk(KERN_ERR "HiSax: bkm_a8 only supported on PCI Systems\n");
#endif /* CONFIG_PCI */
} }
This diff is collapsed.
...@@ -30,8 +30,6 @@ ...@@ -30,8 +30,6 @@
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/serial_reg.h> #include <linux/serial_reg.h>
extern const char *CardType[];
static const char *Elsa_revision = "$Revision: 2.32.2.4 $"; static const char *Elsa_revision = "$Revision: 2.32.2.4 $";
static const char *Elsa_Types[] = static const char *Elsa_Types[] =
{"None", "PC", "PCC-8", "PCC-16", "PCF", "PCF-Pro", {"None", "PC", "PCC-8", "PCC-16", "PCF", "PCF-Pro",
...@@ -832,39 +830,12 @@ probe_elsa(struct IsdnCardState *cs) ...@@ -832,39 +830,12 @@ probe_elsa(struct IsdnCardState *cs)
return (CARD_portlist[i]); return (CARD_portlist[i]);
} }
static struct pci_dev *dev_qs1000 __devinitdata = NULL; static int __devinit
static struct pci_dev *dev_qs3000 __devinitdata = NULL; setup_elsa_isa(struct IsdnCard *card)
#ifdef __ISAPNP__
static struct isapnp_device_id elsa_ids[] __devinitdata = {
{ ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133),
ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133),
(unsigned long) "Elsa QS1000" },
{ ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0134),
ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0134),
(unsigned long) "Elsa QS3000" },
{ 0, }
};
static struct isapnp_device_id *ipid __devinitdata = &elsa_ids[0];
static struct pnp_card *pnp_c __devinitdata = NULL;
#endif
int __devinit
setup_elsa(struct IsdnCard *card)
{ {
int bytecnt;
u_char val;
struct IsdnCardState *cs = card->cs; struct IsdnCardState *cs = card->cs;
char tmp[64]; u_char val;
strcpy(tmp, Elsa_revision);
printk(KERN_INFO "HiSax: Elsa driver Rev. %s\n", HiSax_getrev(tmp));
cs->hw.elsa.ctrl_reg = 0;
cs->hw.elsa.status = 0;
cs->hw.elsa.MFlag = 0;
cs->subtyp = 0;
if (cs->typ == ISDN_CTYPE_ELSA) {
cs->hw.elsa.base = card->para[0]; cs->hw.elsa.base = card->para[0];
printk(KERN_INFO "Elsa: Microlink IO probing\n"); printk(KERN_INFO "Elsa: Microlink IO probing\n");
if (cs->hw.elsa.base) { if (cs->hw.elsa.base) {
...@@ -877,7 +848,13 @@ setup_elsa(struct IsdnCard *card) ...@@ -877,7 +848,13 @@ setup_elsa(struct IsdnCard *card)
} }
} else } else
cs->hw.elsa.base = probe_elsa(cs); cs->hw.elsa.base = probe_elsa(cs);
if (cs->hw.elsa.base) {
if (!cs->hw.elsa.base) {
printk(KERN_WARNING
"No Elsa Microlink found\n");
return (0);
}
cs->hw.elsa.cfg = cs->hw.elsa.base + ELSA_CONFIG; cs->hw.elsa.cfg = cs->hw.elsa.base + ELSA_CONFIG;
cs->hw.elsa.ctrl = cs->hw.elsa.base + ELSA_CONTROL; cs->hw.elsa.ctrl = cs->hw.elsa.base + ELSA_CONTROL;
cs->hw.elsa.ale = cs->hw.elsa.base + ELSA_ALE; cs->hw.elsa.ale = cs->hw.elsa.base + ELSA_ALE;
...@@ -919,12 +896,30 @@ setup_elsa(struct IsdnCard *card) ...@@ -919,12 +896,30 @@ setup_elsa(struct IsdnCard *card)
"Elsa: Microlink S0 bus power bad\n"); "Elsa: Microlink S0 bus power bad\n");
cs->hw.elsa.status |= ELSA_BAD_PWR; cs->hw.elsa.status |= ELSA_BAD_PWR;
} }
} else {
printk(KERN_WARNING return (1);
"No Elsa Microlink found\n"); }
return (0);
} #ifdef __ISAPNP__
} else if (cs->typ == ISDN_CTYPE_ELSA_PNP) { static struct isapnp_device_id elsa_ids[] __devinitdata = {
{ ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133),
ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0133),
(unsigned long) "Elsa QS1000" },
{ ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0134),
ISAPNP_VENDOR('E', 'L', 'S'), ISAPNP_FUNCTION(0x0134),
(unsigned long) "Elsa QS3000" },
{ 0, }
};
static struct isapnp_device_id *ipid __devinitdata = &elsa_ids[0];
static struct pnp_card *pnp_c __devinitdata = NULL;
#endif /* __ISAPNP__ */
static int __devinit
setup_elsa_isapnp(struct IsdnCard *card)
{
struct IsdnCardState *cs = card->cs;
#ifdef __ISAPNP__ #ifdef __ISAPNP__
if (!card->para[1] && isapnp_present()) { if (!card->para[1] && isapnp_present()) {
struct pnp_dev *pnp_d; struct pnp_dev *pnp_d;
...@@ -972,7 +967,8 @@ setup_elsa(struct IsdnCard *card) ...@@ -972,7 +967,8 @@ setup_elsa(struct IsdnCard *card)
return(0); return(0);
} }
} }
#endif #endif /* __ISAPNP__ */
if (card->para[1] && card->para[0]) { if (card->para[1] && card->para[0]) {
cs->hw.elsa.base = card->para[1]; cs->hw.elsa.base = card->para[1];
cs->irq = card->para[0]; cs->irq = card->para[0];
...@@ -993,7 +989,16 @@ setup_elsa(struct IsdnCard *card) ...@@ -993,7 +989,16 @@ setup_elsa(struct IsdnCard *card)
Elsa_Types[cs->subtyp], Elsa_Types[cs->subtyp],
cs->hw.elsa.base, cs->hw.elsa.base,
cs->irq); cs->irq);
} else if (cs->typ == ISDN_CTYPE_ELSA_PCMCIA) {
return (1);
}
static void __devinit
setup_elsa_pcmcia(struct IsdnCard *card)
{
struct IsdnCardState *cs = card->cs;
u_char val;
cs->hw.elsa.base = card->para[1]; cs->hw.elsa.base = card->para[1];
cs->irq = card->para[0]; cs->irq = card->para[0];
val = readreg(cs->hw.elsa.base + 0, cs->hw.elsa.base + 2, IPAC_ID); val = readreg(cs->hw.elsa.base + 0, cs->hw.elsa.base + 2, IPAC_ID);
...@@ -1018,8 +1023,17 @@ setup_elsa(struct IsdnCard *card) ...@@ -1018,8 +1023,17 @@ setup_elsa(struct IsdnCard *card)
Elsa_Types[cs->subtyp], Elsa_Types[cs->subtyp],
cs->hw.elsa.base, cs->hw.elsa.base,
cs->irq); cs->irq);
} else if (cs->typ == ISDN_CTYPE_ELSA_PCI) { }
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
static struct pci_dev *dev_qs1000 __devinitdata = NULL;
static struct pci_dev *dev_qs3000 __devinitdata = NULL;
static int __devinit
setup_elsa_pci(struct IsdnCard *card)
{
struct IsdnCardState *cs = card->cs;
cs->subtyp = 0; cs->subtyp = 0;
if ((dev_qs1000 = pci_find_device(PCI_VENDOR_ID_ELSA, if ((dev_qs1000 = pci_find_device(PCI_VENDOR_ID_ELSA,
PCI_DEVICE_ID_ELSA_MICROLINK, dev_qs1000))) { PCI_DEVICE_ID_ELSA_MICROLINK, dev_qs1000))) {
...@@ -1068,13 +1082,25 @@ setup_elsa(struct IsdnCard *card) ...@@ -1068,13 +1082,25 @@ setup_elsa(struct IsdnCard *card)
cs->hw.elsa.base, cs->hw.elsa.base,
cs->hw.elsa.cfg, cs->hw.elsa.cfg,
cs->irq); cs->irq);
return (1);
}
#else #else
printk(KERN_WARNING "Elsa: Elsa PCI and NO_PCI_BIOS\n");
printk(KERN_WARNING "Elsa: unable to config Elsa PCI\n"); static void __devinit
return (0); setup_elsa_pci(struct IsdnCard *card)
{
return (1);
}
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
} else
return (0); static int __devinit
setup_elsa_common(struct IsdnCard *card)
{
struct IsdnCardState *cs = card->cs;
u_char val;
int bytecnt;
switch (cs->subtyp) { switch (cs->subtyp) {
case ELSA_PC: case ELSA_PC:
...@@ -1104,8 +1130,7 @@ setup_elsa(struct IsdnCard *card) ...@@ -1104,8 +1130,7 @@ setup_elsa(struct IsdnCard *card)
here, it would fail. */ here, it would fail. */
if (cs->typ != ISDN_CTYPE_ELSA_PCMCIA && !request_region(cs->hw.elsa.base, bytecnt, "elsa isdn")) { if (cs->typ != ISDN_CTYPE_ELSA_PCMCIA && !request_region(cs->hw.elsa.base, bytecnt, "elsa isdn")) {
printk(KERN_WARNING printk(KERN_WARNING
"HiSax: %s config port %#lx-%#lx already in use\n", "HiSax: ELSA config port %#lx-%#lx already in use\n",
CardType[card->typ],
cs->hw.elsa.base, cs->hw.elsa.base,
cs->hw.elsa.base + bytecnt); cs->hw.elsa.base + bytecnt);
return (0); return (0);
...@@ -1113,8 +1138,7 @@ setup_elsa(struct IsdnCard *card) ...@@ -1113,8 +1138,7 @@ setup_elsa(struct IsdnCard *card)
if ((cs->subtyp == ELSA_QS1000PCI) || (cs->subtyp == ELSA_QS3000PCI)) { if ((cs->subtyp == ELSA_QS1000PCI) || (cs->subtyp == ELSA_QS3000PCI)) {
if (!request_region(cs->hw.elsa.cfg, 0x80, "elsa isdn pci")) { if (!request_region(cs->hw.elsa.cfg, 0x80, "elsa isdn pci")) {
printk(KERN_WARNING printk(KERN_WARNING
"HiSax: %s pci port %x-%x already in use\n", "HiSax: ELSA pci port %x-%x already in use\n",
CardType[card->typ],
cs->hw.elsa.cfg, cs->hw.elsa.cfg,
cs->hw.elsa.cfg + 0x80); cs->hw.elsa.cfg + 0x80);
release_region(cs->hw.elsa.base, bytecnt); release_region(cs->hw.elsa.base, bytecnt);
...@@ -1186,3 +1210,41 @@ setup_elsa(struct IsdnCard *card) ...@@ -1186,3 +1210,41 @@ setup_elsa(struct IsdnCard *card)
} }
return (1); return (1);
} }
int __devinit
setup_elsa(struct IsdnCard *card)
{
int rc;
struct IsdnCardState *cs = card->cs;
char tmp[64];
strcpy(tmp, Elsa_revision);
printk(KERN_INFO "HiSax: Elsa driver Rev. %s\n", HiSax_getrev(tmp));
cs->hw.elsa.ctrl_reg = 0;
cs->hw.elsa.status = 0;
cs->hw.elsa.MFlag = 0;
cs->subtyp = 0;
if (cs->typ == ISDN_CTYPE_ELSA) {
rc = setup_elsa_isa(card);
if (!rc)
return (0);
} else if (cs->typ == ISDN_CTYPE_ELSA_PNP) {
rc = setup_elsa_isapnp(card);
if (!rc)
return (0);
} else if (cs->typ == ISDN_CTYPE_ELSA_PCMCIA)
setup_elsa_pcmcia(card);
else if (cs->typ == ISDN_CTYPE_ELSA_PCI) {
rc = setup_elsa_pci(card);
if (!rc)
return (0);
} else
return (0);
return setup_elsa_common(card);
}
...@@ -518,8 +518,6 @@ Sedl_card_msg(struct IsdnCardState *cs, int mt, void *arg) ...@@ -518,8 +518,6 @@ Sedl_card_msg(struct IsdnCardState *cs, int mt, void *arg)
return(0); return(0);
} }
static struct pci_dev *dev_sedl __devinitdata = NULL;
#ifdef __ISAPNP__ #ifdef __ISAPNP__
static struct isapnp_device_id sedl_ids[] __devinitdata = { static struct isapnp_device_id sedl_ids[] __devinitdata = {
{ ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01), { ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01),
...@@ -533,45 +531,16 @@ static struct isapnp_device_id sedl_ids[] __devinitdata = { ...@@ -533,45 +531,16 @@ static struct isapnp_device_id sedl_ids[] __devinitdata = {
static struct isapnp_device_id *ipid __devinitdata = &sedl_ids[0]; static struct isapnp_device_id *ipid __devinitdata = &sedl_ids[0];
static struct pnp_card *pnp_c __devinitdata = NULL; static struct pnp_card *pnp_c __devinitdata = NULL;
#endif
int __devinit static int __devinit
setup_sedlbauer(struct IsdnCard *card) setup_sedlbauer_isapnp(struct IsdnCard *card, int *bytecnt)
{ {
int bytecnt, ver, val;
struct IsdnCardState *cs = card->cs; struct IsdnCardState *cs = card->cs;
char tmp[64]; struct pnp_dev *pnp_d;
u16 sub_vendor_id, sub_id;
strcpy(tmp, Sedlbauer_revision); if (!isapnp_present())
printk(KERN_INFO "HiSax: Sedlbauer driver Rev. %s\n", HiSax_getrev(tmp)); return -1;
if (cs->typ == ISDN_CTYPE_SEDLBAUER) {
cs->subtyp = SEDL_SPEED_CARD_WIN;
cs->hw.sedl.bus = SEDL_BUS_ISA;
cs->hw.sedl.chip = SEDL_CHIP_TEST;
} else if (cs->typ == ISDN_CTYPE_SEDLBAUER_PCMCIA) {
cs->subtyp = SEDL_SPEED_STAR;
cs->hw.sedl.bus = SEDL_BUS_PCMCIA;
cs->hw.sedl.chip = SEDL_CHIP_TEST;
} else if (cs->typ == ISDN_CTYPE_SEDLBAUER_FAX) {
cs->subtyp = SEDL_SPEED_FAX;
cs->hw.sedl.bus = SEDL_BUS_ISA;
cs->hw.sedl.chip = SEDL_CHIP_ISAC_ISAR;
} else
return (0);
bytecnt = 8;
if (card->para[1]) {
cs->hw.sedl.cfg_reg = card->para[1];
cs->irq = card->para[0];
if (cs->hw.sedl.chip == SEDL_CHIP_ISAC_ISAR) {
bytecnt = 16;
}
} else {
#ifdef __ISAPNP__
if (isapnp_present()) {
struct pnp_dev *pnp_d;
while(ipid->card_vendor) { while(ipid->card_vendor) {
if ((pnp_c = pnp_find_card(ipid->card_vendor, if ((pnp_c = pnp_find_card(ipid->card_vendor,
ipid->card_device, pnp_c))) { ipid->card_device, pnp_c))) {
...@@ -603,12 +572,13 @@ setup_sedlbauer(struct IsdnCard *card) ...@@ -603,12 +572,13 @@ setup_sedlbauer(struct IsdnCard *card)
if (ipid->function == ISAPNP_FUNCTION(0x2)) { if (ipid->function == ISAPNP_FUNCTION(0x2)) {
cs->subtyp = SEDL_SPEED_FAX; cs->subtyp = SEDL_SPEED_FAX;
cs->hw.sedl.chip = SEDL_CHIP_ISAC_ISAR; cs->hw.sedl.chip = SEDL_CHIP_ISAC_ISAR;
bytecnt = 16; *bytecnt = 16;
} else { } else {
cs->subtyp = SEDL_SPEED_CARD_WIN; cs->subtyp = SEDL_SPEED_CARD_WIN;
cs->hw.sedl.chip = SEDL_CHIP_TEST; cs->hw.sedl.chip = SEDL_CHIP_TEST;
} }
goto ready;
return (1);
} else { } else {
printk(KERN_ERR "Sedlbauer PnP: PnP error card found, no device\n"); printk(KERN_ERR "Sedlbauer PnP: PnP error card found, no device\n");
return(0); return(0);
...@@ -617,13 +587,28 @@ setup_sedlbauer(struct IsdnCard *card) ...@@ -617,13 +587,28 @@ setup_sedlbauer(struct IsdnCard *card)
ipid++; ipid++;
pnp_c = NULL; pnp_c = NULL;
} }
if (!ipid->card_vendor) {
printk(KERN_INFO "Sedlbauer PnP: no ISAPnP card found\n"); printk(KERN_INFO "Sedlbauer PnP: no ISAPnP card found\n");
} return -1;
} }
#endif #else
/* Probe for Sedlbauer speed pci */
static int __devinit
setup_sedlbauer_isapnp(struct IsdnCard *card, int *bytecnt)
{
return -1;
}
#endif /* __ISAPNP__ */
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
static struct pci_dev *dev_sedl __devinitdata = NULL;
static int __devinit
setup_sedlbauer_pci(struct IsdnCard *card)
{
struct IsdnCardState *cs = card->cs;
u16 sub_vendor_id, sub_id;
if ((dev_sedl = pci_find_device(PCI_VENDOR_ID_TIGERJET, if ((dev_sedl = pci_find_device(PCI_VENDOR_ID_TIGERJET,
PCI_DEVICE_ID_TIGERJET_100, dev_sedl))) { PCI_DEVICE_ID_TIGERJET_100, dev_sedl))) {
if (pci_enable_device(dev_sedl)) if (pci_enable_device(dev_sedl))
...@@ -667,7 +652,7 @@ setup_sedlbauer(struct IsdnCard *card) ...@@ -667,7 +652,7 @@ setup_sedlbauer(struct IsdnCard *card)
sub_vendor_id); sub_vendor_id);
return(0); return(0);
} }
bytecnt = 256;
cs->hw.sedl.reset_on = SEDL_ISAR_PCI_ISAR_RESET_ON; cs->hw.sedl.reset_on = SEDL_ISAR_PCI_ISAR_RESET_ON;
cs->hw.sedl.reset_off = SEDL_ISAR_PCI_ISAR_RESET_OFF; cs->hw.sedl.reset_off = SEDL_ISAR_PCI_ISAR_RESET_OFF;
byteout(cs->hw.sedl.cfg_reg, 0xff); byteout(cs->hw.sedl.cfg_reg, 0xff);
...@@ -678,15 +663,68 @@ setup_sedlbauer(struct IsdnCard *card) ...@@ -678,15 +663,68 @@ setup_sedlbauer(struct IsdnCard *card)
mdelay(2); mdelay(2);
byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_off); byteout(cs->hw.sedl.cfg_reg +3, cs->hw.sedl.reset_off);
mdelay(10); mdelay(10);
return (1);
}
#else #else
printk(KERN_WARNING "Sedlbauer: NO_PCI_BIOS\n");
return (0); static int __devinit
setup_sedlbauer_pci(struct IsdnCard *card)
{
return (1);
}
#endif /* CONFIG_PCI */ #endif /* CONFIG_PCI */
int __devinit
setup_sedlbauer(struct IsdnCard *card)
{
int bytecnt = 8, ver, val, rc;
struct IsdnCardState *cs = card->cs;
char tmp[64];
strcpy(tmp, Sedlbauer_revision);
printk(KERN_INFO "HiSax: Sedlbauer driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ == ISDN_CTYPE_SEDLBAUER) {
cs->subtyp = SEDL_SPEED_CARD_WIN;
cs->hw.sedl.bus = SEDL_BUS_ISA;
cs->hw.sedl.chip = SEDL_CHIP_TEST;
} else if (cs->typ == ISDN_CTYPE_SEDLBAUER_PCMCIA) {
cs->subtyp = SEDL_SPEED_STAR;
cs->hw.sedl.bus = SEDL_BUS_PCMCIA;
cs->hw.sedl.chip = SEDL_CHIP_TEST;
} else if (cs->typ == ISDN_CTYPE_SEDLBAUER_FAX) {
cs->subtyp = SEDL_SPEED_FAX;
cs->hw.sedl.bus = SEDL_BUS_ISA;
cs->hw.sedl.chip = SEDL_CHIP_ISAC_ISAR;
} else
return (0);
bytecnt = 8;
if (card->para[1]) {
cs->hw.sedl.cfg_reg = card->para[1];
cs->irq = card->para[0];
if (cs->hw.sedl.chip == SEDL_CHIP_ISAC_ISAR) {
bytecnt = 16;
}
} else {
rc = setup_sedlbauer_isapnp(card, &bytecnt);
if (!rc)
return (0);
if (rc > 0)
goto ready;
/* Probe for Sedlbauer speed pci */
rc = setup_sedlbauer_pci(card);
if (!rc)
return (0);
bytecnt = 256;
} }
#ifdef __ISAPNP__
ready: ready:
#endif
/* In case of the sedlbauer pcmcia card, this region is in use, /* In case of the sedlbauer pcmcia card, this region is in use,
* reserved for us by the card manager. So we do not check it * reserved for us by the card manager. So we do not check it
......
...@@ -295,11 +295,12 @@ setup_telespci(struct IsdnCard *card) ...@@ -295,11 +295,12 @@ setup_telespci(struct IsdnCard *card)
#ifdef __BIG_ENDIAN #ifdef __BIG_ENDIAN
#error "not running on big endian machines now" #error "not running on big endian machines now"
#endif #endif
strcpy(tmp, telespci_revision); strcpy(tmp, telespci_revision);
printk(KERN_INFO "HiSax: Teles/PCI driver Rev. %s\n", HiSax_getrev(tmp)); printk(KERN_INFO "HiSax: Teles/PCI driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_TELESPCI) if (cs->typ != ISDN_CTYPE_TELESPCI)
return (0); return (0);
#ifdef CONFIG_PCI
if ((dev_tel = pci_find_device (PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36120, dev_tel))) { if ((dev_tel = pci_find_device (PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36120, dev_tel))) {
if (pci_enable_device(dev_tel)) if (pci_enable_device(dev_tel))
return(0); return(0);
...@@ -317,11 +318,6 @@ setup_telespci(struct IsdnCard *card) ...@@ -317,11 +318,6 @@ setup_telespci(struct IsdnCard *card)
printk(KERN_WARNING "TelesPCI: No PCI card found\n"); printk(KERN_WARNING "TelesPCI: No PCI card found\n");
return(0); return(0);
} }
#else
printk(KERN_WARNING "HiSax: Teles/PCI and NO_PCI_BIOS\n");
printk(KERN_WARNING "HiSax: Teles/PCI unable to config\n");
return (0);
#endif /* CONFIG_PCI */
/* Initialize Zoran PCI controller */ /* Initialize Zoran PCI controller */
writel(0x00000000, cs->hw.teles0.membase + 0x28); writel(0x00000000, cs->hw.teles0.membase + 0x28);
......
...@@ -1009,7 +1009,7 @@ setup_w6692(struct IsdnCard *card) ...@@ -1009,7 +1009,7 @@ setup_w6692(struct IsdnCard *card)
printk(KERN_INFO "HiSax: W6692 driver Rev. %s\n", HiSax_getrev(tmp)); printk(KERN_INFO "HiSax: W6692 driver Rev. %s\n", HiSax_getrev(tmp));
if (cs->typ != ISDN_CTYPE_W6692) if (cs->typ != ISDN_CTYPE_W6692)
return (0); return (0);
#ifdef CONFIG_PCI
while (id_list[id_idx].vendor_id) { while (id_list[id_idx].vendor_id) {
dev_w6692 = pci_find_device(id_list[id_idx].vendor_id, dev_w6692 = pci_find_device(id_list[id_idx].vendor_id,
id_list[id_idx].device_id, id_list[id_idx].device_id,
...@@ -1061,11 +1061,6 @@ setup_w6692(struct IsdnCard *card) ...@@ -1061,11 +1061,6 @@ setup_w6692(struct IsdnCard *card)
cs->hw.w6692.iobase + 255); cs->hw.w6692.iobase + 255);
return (0); return (0);
} }
#else
printk(KERN_WARNING "HiSax: W6692 and NO_PCI_BIOS\n");
printk(KERN_WARNING "HiSax: W6692 unable to config\n");
return (0);
#endif /* CONFIG_PCI */
printk(KERN_INFO printk(KERN_INFO
"HiSax: %s config irq:%d I/O:%x\n", "HiSax: %s config irq:%d I/O:%x\n",
......
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