Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit abe834c8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'isdn-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/misc-2.6:
  [ISDN] Hisax: eliminate many unnecessary references to CardType[]
  [ISDN] HiSax: modularization prep
parents e16b2781 8349304d
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -20,8 +20,6 @@
#include "hscx.h"
#include "isdnl1.h"

extern const char *CardType[];

static const char *Asuscom_revision = "$Revision: 1.14.2.4 $";

#define byteout(addr,val) outb(val,addr)
@@ -376,8 +374,7 @@ setup_asuscom(struct IsdnCard *card)
	cs->irq = card->para[0];
	if (!request_region(cs->hw.asus.cfg_reg, bytecnt, "asuscom isdn")) {
		printk(KERN_WARNING
		       "HiSax: %s config port %x-%x already in use\n",
		       CardType[card->typ],
		       "HiSax: ISDNLink config port %x-%x already in use\n",
		       cs->hw.asus.cfg_reg,
		       cs->hw.asus.cfg_reg + bytecnt);
		return (0);
+9 −18
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@
#include "hscx.h"
#include "isdnl1.h"

extern const char *CardType[];
static const char *avm_revision = "$Revision: 2.15.2.4 $";

#define	 AVM_A1_STAT_ISAC	0x01
@@ -200,16 +199,14 @@ setup_avm_a1(struct IsdnCard *card)
	cs->irq = card->para[0];
	if (!request_region(cs->hw.avm.cfg_reg, 8, "avm cfg")) {
		printk(KERN_WARNING
		       "HiSax: %s config port %x-%x already in use\n",
		       CardType[card->typ],
		       "HiSax: AVM A1 config port %x-%x already in use\n",
		       cs->hw.avm.cfg_reg,
		       cs->hw.avm.cfg_reg + 8);
		return (0);
	}
	if (!request_region(cs->hw.avm.isac + 32, 32, "HiSax isac")) {
		printk(KERN_WARNING
		       "HiSax: %s isac ports %x-%x already in use\n",
		       CardType[cs->typ],
		       "HiSax: AVM A1 isac ports %x-%x already in use\n",
		       cs->hw.avm.isac + 32,
		       cs->hw.avm.isac + 64);
		release_ioregs(cs, 0);
@@ -217,16 +214,14 @@ setup_avm_a1(struct IsdnCard *card)
	}
	if (!request_region(cs->hw.avm.isacfifo, 1, "HiSax isac fifo")) {
		printk(KERN_WARNING
		       "HiSax: %s isac fifo port %x already in use\n",
		       CardType[cs->typ],
		       "HiSax: AVM A1 isac fifo port %x already in use\n",
		       cs->hw.avm.isacfifo);
		release_ioregs(cs, 1);
		return (0);
	}
	if (!request_region(cs->hw.avm.hscx[0] + 32, 32, "HiSax hscx A")) {
		printk(KERN_WARNING
		       "HiSax: %s hscx A ports %x-%x already in use\n",
		       CardType[cs->typ],
		       "HiSax: AVM A1 hscx A ports %x-%x already in use\n",
		       cs->hw.avm.hscx[0] + 32,
		       cs->hw.avm.hscx[0] + 64);
		release_ioregs(cs, 3);
@@ -234,16 +229,14 @@ setup_avm_a1(struct IsdnCard *card)
	}
	if (!request_region(cs->hw.avm.hscxfifo[0], 1, "HiSax hscx A fifo")) {
		printk(KERN_WARNING
		       "HiSax: %s hscx A fifo port %x already in use\n",
		       CardType[cs->typ],
		       "HiSax: AVM A1 hscx A fifo port %x already in use\n",
		       cs->hw.avm.hscxfifo[0]);
		release_ioregs(cs, 7);
		return (0);
	}
	if (!request_region(cs->hw.avm.hscx[1] + 32, 32, "HiSax hscx B")) {
		printk(KERN_WARNING
		       "HiSax: %s hscx B ports %x-%x already in use\n",
		       CardType[cs->typ],
		       "HiSax: AVM A1 hscx B ports %x-%x already in use\n",
		       cs->hw.avm.hscx[1] + 32,
		       cs->hw.avm.hscx[1] + 64);
		release_ioregs(cs, 0xf);
@@ -251,8 +244,7 @@ setup_avm_a1(struct IsdnCard *card)
	}
	if (!request_region(cs->hw.avm.hscxfifo[1], 1, "HiSax hscx B fifo")) {
		printk(KERN_WARNING
		       "HiSax: %s hscx B fifo port %x already in use\n",
		       CardType[cs->typ],
		       "HiSax: AVM A1 hscx B fifo port %x already in use\n",
		       cs->hw.avm.hscxfifo[1]);
		release_ioregs(cs, 0x1f);
		return (0);
@@ -284,9 +276,8 @@ setup_avm_a1(struct IsdnCard *card)
	printk(KERN_INFO "AVM A1: Byte at %x is %x\n",
	       cs->hw.avm.cfg_reg, val);

	printk(KERN_INFO
	       "HiSax: %s config irq:%d cfg:0x%X\n",
	       CardType[cs->typ], cs->irq,
	printk(KERN_INFO "HiSax: AVM A1 config irq:%d cfg:0x%X\n",
	       cs->irq,
	       cs->hw.avm.cfg_reg);
	printk(KERN_INFO
	       "HiSax: isac:0x%X/0x%X\n",
+10 −9
Original line number Diff line number Diff line
@@ -20,8 +20,6 @@
#include <linux/pci.h>
#include "bkm_ax.h"

extern const char *CardType[];

static const char *bkm_a4t_revision = "$Revision: 1.22.2.4 $";


@@ -284,15 +282,16 @@ static int __devinit a4t_cs_init(struct IsdnCard *card,
	I20_REGISTER_FILE *pI20_Regs;

	if (!cs->irq) {		/* IRQ range check ?? */
		printk(KERN_WARNING "HiSax: %s: No IRQ\n", CardType[card->typ]);
		printk(KERN_WARNING "HiSax: Telekom A4T: No IRQ\n");
		return (0);
	}
	cs->hw.ax.base = (long) ioremap(pci_memaddr, 4096);
	/* Check suspecious address */
	pI20_Regs = (I20_REGISTER_FILE *) (cs->hw.ax.base);
	if ((pI20_Regs->i20IntStatus & 0x8EFFFFFF) != 0) {
		printk(KERN_WARNING "HiSax: %s address %lx-%lx suspecious\n",
		       CardType[card->typ], cs->hw.ax.base, cs->hw.ax.base + 4096);
		printk(KERN_WARNING "HiSax: Telekom A4T address "
		       "%lx-%lx suspicious\n",
		       cs->hw.ax.base, cs->hw.ax.base + 4096);
		iounmap((void *) cs->hw.ax.base);
		cs->hw.ax.base = 0;
		return (0);
@@ -302,8 +301,9 @@ static int __devinit a4t_cs_init(struct IsdnCard *card,
	cs->hw.ax.isac_ale = GCS_1;
	cs->hw.ax.jade_ale = GCS_3;

	printk(KERN_INFO "HiSax: %s: Card configured at 0x%lX IRQ %d\n",
	       CardType[card->typ], cs->hw.ax.base, cs->irq);
	printk(KERN_INFO "HiSax: Telekom A4T: Card configured at "
	       "0x%lX IRQ %d\n",
	       cs->hw.ax.base, cs->irq);

	setup_isac(cs);
	cs->readisac = &ReadISAC;
@@ -349,11 +349,12 @@ setup_bkm_a4t(struct IsdnCard *card)
			break;
	}
	if (!found) {
		printk(KERN_WARNING "HiSax: %s: Card not found\n", CardType[card->typ]);
		printk(KERN_WARNING "HiSax: Telekom A4T: Card not found\n");
		return (0);
	}
	if (!pci_memaddr) {
		printk(KERN_WARNING "HiSax: %s: No Memory base address\n", CardType[card->typ]);
		printk(KERN_WARNING "HiSax: Telekom A4T: "
		       "No Memory base address\n");
		return (0);
	}

+13 −18
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@

#define	ATTEMPT_PCI_REMAPPING	/* Required for PLX rev 1 */

extern const char *CardType[];

static const char sct_quadro_revision[] = "$Revision: 1.22.2.4 $";

static const char *sct_quadro_subtypes[] =
@@ -181,8 +179,7 @@ bkm_interrupt_ipac(int intno, void *dev_id)
		goto Start_IPAC;
	}
	if (!icnt)
		printk(KERN_WARNING "HiSax: %s (%s) IRQ LOOP\n",
		       CardType[cs->typ],
		printk(KERN_WARNING "HiSax: Scitel Quadro (%s) IRQ LOOP\n",
		       sct_quadro_subtypes[cs->subtyp]);
	writereg(cs->hw.ax.base, cs->hw.ax.data_adr, IPAC_MASK, 0xFF);
	writereg(cs->hw.ax.base, cs->hw.ax.data_adr, IPAC_MASK, 0xC0);
@@ -296,8 +293,8 @@ setup_sct_quadro(struct IsdnCard *card)
	if (card->para[0] >= SCT_1 && card->para[0] <= SCT_4)
		cs->subtyp = card->para[0];
	else {
		printk(KERN_WARNING "HiSax: %s: Invalid subcontroller in configuration, default to 1\n",
			CardType[card->typ]);
		printk(KERN_WARNING "HiSax: Scitel Quadro: Invalid "
		       "subcontroller in configuration, default to 1\n");
		return (0);
	}
	if ((cs->subtyp != SCT_1) && ((sub_sys_id != PCI_DEVICE_ID_BERKOM_SCITEL_QUADRO) ||
@@ -322,16 +319,16 @@ setup_sct_quadro(struct IsdnCard *card)
			}
		}
		if (!found) {
			printk(KERN_WARNING "HiSax: %s (%s): Card not found\n",
				CardType[card->typ],
			printk(KERN_WARNING "HiSax: Scitel Quadro (%s): "
				"Card not found\n",
				sct_quadro_subtypes[cs->subtyp]);
			return (0);
		}
#ifdef ATTEMPT_PCI_REMAPPING
/* HACK: PLX revision 1 bug: PLX address bit 7 must not be set */
		if ((pci_ioaddr1 & 0x80) && (dev_a8->revision == 1)) {
			printk(KERN_WARNING "HiSax: %s (%s): PLX rev 1, remapping required!\n",
				CardType[card->typ],
			printk(KERN_WARNING "HiSax: Scitel Quadro (%s): "
				"PLX rev 1, remapping required!\n",
				sct_quadro_subtypes[cs->subtyp]);
			/* Restart PCI negotiation */
			pci_write_config_dword(dev_a8, PCI_BASE_ADDRESS_1, (u_int) - 1);
@@ -344,8 +341,7 @@ setup_sct_quadro(struct IsdnCard *card)
#endif /* End HACK */
	}
	if (!pci_irq) {		/* IRQ range check ?? */
		printk(KERN_WARNING "HiSax: %s (%s): No IRQ\n",
		       CardType[card->typ],
		printk(KERN_WARNING "HiSax: Scitel Quadro (%s): No IRQ\n",
		       sct_quadro_subtypes[cs->subtyp]);
		return (0);
	}
@@ -355,8 +351,8 @@ setup_sct_quadro(struct IsdnCard *card)
	pci_read_config_dword(dev_a8, PCI_BASE_ADDRESS_4, &pci_ioaddr4);
	pci_read_config_dword(dev_a8, PCI_BASE_ADDRESS_5, &pci_ioaddr5);
	if (!pci_ioaddr1 || !pci_ioaddr2 || !pci_ioaddr3 || !pci_ioaddr4 || !pci_ioaddr5) {
		printk(KERN_WARNING "HiSax: %s (%s): No IO base address(es)\n",
		       CardType[card->typ],
		printk(KERN_WARNING "HiSax: Scitel Quadro (%s): "
		       "No IO base address(es)\n",
		       sct_quadro_subtypes[cs->subtyp]);
		return (0);
	}
@@ -411,8 +407,8 @@ setup_sct_quadro(struct IsdnCard *card)
	/* For isac and hscx data path */
	cs->hw.ax.data_adr = cs->hw.ax.base + 4;

	printk(KERN_INFO "HiSax: %s (%s) configured at 0x%.4lX, 0x%.4lX, 0x%.4lX and IRQ %d\n",
	       CardType[card->typ],
	printk(KERN_INFO "HiSax: Scitel Quadro (%s) configured at "
	       "0x%.4lX, 0x%.4lX, 0x%.4lX and IRQ %d\n",
	       sct_quadro_subtypes[cs->subtyp],
	       cs->hw.ax.plx_adr,
	       cs->hw.ax.base,
@@ -432,8 +428,7 @@ setup_sct_quadro(struct IsdnCard *card)
	cs->cardmsg = &BKM_card_msg;
	cs->irq_func = &bkm_interrupt_ipac;

	printk(KERN_INFO "HiSax: %s (%s): IPAC Version %d\n",
		CardType[card->typ],
	printk(KERN_INFO "HiSax: Scitel Quadro (%s): IPAC Version %d\n",
		sct_quadro_subtypes[cs->subtyp],
		readreg(cs->hw.ax.base, cs->hw.ax.data_adr, IPAC_ID));
	return (1);
+9 −5
Original line number Diff line number Diff line
@@ -1169,7 +1169,9 @@ outf_cs:
/* Used from an exported function but calls __devinit functions.
 * Tell modpost not to warn (__ref)
 */
static int __ref checkcard(int cardnr, char *id, int *busy_flag, struct module *lockowner)
static int __ref checkcard(int cardnr, char *id, int *busy_flag,
			   struct module *lockowner,
			   hisax_setup_func_t card_setup)
{
	int ret;
	struct IsdnCard *card = cards + cardnr;
@@ -1187,7 +1189,7 @@ static int __ref checkcard(int cardnr, char *id, int *busy_flag, struct module *
	       (card->protocol == ISDN_PTYPE_NI1) ? "NI1" :
	       "NONE", cs->iif.id, cs->myid);

	ret = hisax_cs_setup_card(card);
	ret = card_setup(card);
	if (!ret) {
		ll_unload(cs);
		goto outf_cs;
@@ -1241,7 +1243,8 @@ static int HiSax_inithardware(int *busy_flag)
			else
				sprintf(ids, "%s%d", id, i);
		}
		if (checkcard(i, ids, busy_flag, THIS_MODULE)) {
		if (checkcard(i, ids, busy_flag, THIS_MODULE,
			      hisax_cs_setup_card)) {
			foundcards++;
			i++;
		} else {
@@ -1549,7 +1552,8 @@ int hisax_init_pcmcia(void *pcm_iob, int *busy_flag, struct IsdnCard *card)
		sprintf(ids, "HiSax%d", nrcards);
	else
		sprintf(ids, "HiSax");
	if (!checkcard(nrcards, ids, busy_flag, THIS_MODULE))
	if (!checkcard(nrcards, ids, busy_flag, THIS_MODULE,
		       hisax_cs_setup_card))
		goto error;

	ret = nrcards;
@@ -1595,7 +1599,7 @@ int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[],
	cards[i].protocol = protocol;
	sprintf(id, "%s%d", name, i);
	nrcards++;
	retval = checkcard(i, id, NULL, hisax_d_if->owner);
	retval = checkcard(i, id, NULL, hisax_d_if->owner, hisax_cs_setup_card);
	if (retval == 0) { // yuck
		cards[i].typ = 0;
		nrcards--;
Loading