summaryrefslogtreecommitdiffstats
path: root/sys/i4b/layer1
diff options
context:
space:
mode:
authorhm <hm@FreeBSD.org>2000-03-09 20:57:47 +0000
committerhm <hm@FreeBSD.org>2000-03-09 20:57:47 +0000
commitd6841c128a6ab7392af6959116e7ce54a1797e24 (patch)
treef44c4a70dcb4fd02d16cb93942a0a38e4a12139e /sys/i4b/layer1
parentdcbc63c349ffe3a36faef31f1369b130f77801fe (diff)
downloadFreeBSD-src-d6841c128a6ab7392af6959116e7ce54a1797e24.zip
FreeBSD-src-d6841c128a6ab7392af6959116e7ce54a1797e24.tar.gz
Fix a problem which caused i/o resource allocation conflict of this
particular ISDN card with the 2nd IDE controller and/or other cards depending on configuration. The amount of i/o ports allocated are reduced from 0x40 per range to 0x20 per range. Submitted by: Andrew Gordon <arg@arg1.demon.co.uk> Approved by: jkh
Diffstat (limited to 'sys/i4b/layer1')
-rw-r--r--sys/i4b/layer1/i4b_tel_s0163.c36
1 files changed, 26 insertions, 10 deletions
diff --git a/sys/i4b/layer1/i4b_tel_s0163.c b/sys/i4b/layer1/i4b_tel_s0163.c
index 9b4f06e..a446a44 100644
--- a/sys/i4b/layer1/i4b_tel_s0163.c
+++ b/sys/i4b/layer1/i4b_tel_s0163.c
@@ -74,9 +74,9 @@
static u_char intr_no[] = { 1, 1, 0, 2, 4, 6, 1, 1, 1, 0, 8, 10, 12, 1, 1, 14 };
-#define ISAC_OFFS 0x420
-#define HSCXA_OFFS 0xc20
-#define HSCXB_OFFS 0x820
+#define ISAC_OFFS 0x400
+#define HSCXA_OFFS 0xc00
+#define HSCXB_OFFS 0x800
/*---------------------------------------------------------------------------*
* Teles S0/16.3 read fifo routine
@@ -86,7 +86,7 @@ tels0163_read_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
{
bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[what+1]);
bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[what+1]);
- bus_space_read_multi_1(t,h,0x3e,buf,size);
+ bus_space_read_multi_1(t,h,0x1e,buf,size);
}
/*---------------------------------------------------------------------------*
@@ -97,7 +97,7 @@ tels0163_write_fifo(struct l1_softc *sc, int what, void *buf, size_t size)
{
bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[what+1]);
bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[what+1]);
- bus_space_write_multi_1(t,h,0x3e,buf,size);
+ bus_space_write_multi_1(t,h,0x1e,buf,size);
}
/*---------------------------------------------------------------------------*
@@ -108,7 +108,7 @@ tels0163_write_reg(struct l1_softc *sc, int what, bus_size_t offs, u_int8_t data
{
bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[what+1]);
bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[what+1]);
- bus_space_write_1(t,h,offs,data);
+ bus_space_write_1(t,h,offs - 0x20,data);
}
/*---------------------------------------------------------------------------*
@@ -119,7 +119,7 @@ tels0163_read_reg(struct l1_softc *sc, int what, bus_size_t offs)
{
bus_space_tag_t t = rman_get_bustag(sc->sc_resources.io_base[what+1]);
bus_space_handle_t h = rman_get_bushandle(sc->sc_resources.io_base[what+1]);
- return bus_space_read_1(t,h,offs);
+ return bus_space_read_1(t,h,offs - 0x20);
}
/*---------------------------------------------------------------------------*
@@ -163,6 +163,9 @@ isic_probe_s0163(device_t dev)
/* set io base */
sc->sc_port = rman_get_start(sc->sc_resources.io_base[0]);
+ /* Release the resource - re-allocate later with correct size */
+ bus_release_resource(dev, SYS_RES_IOPORT, sc->sc_resources.io_rid[0],
+ sc->sc_resources.io_base[0]);
switch(sc->sc_port)
{
@@ -192,9 +195,22 @@ isic_probe_s0163(device_t dev)
/* set io port resources */
+ sc->sc_resources.io_rid[0] = 0;
+ bus_set_resource(dev, SYS_RES_IOPORT, 0, sc->sc_port, 0x20);
+ sc->sc_resources.io_base[0] =
+ bus_alloc_resource(dev, SYS_RES_IOPORT,
+ &sc->sc_resources.io_rid[0],
+ 0ul, ~0ul, 1, RF_ACTIVE);
+ if(!sc->sc_resources.io_base[0])
+ {
+ printf("isic%d: Error allocating io at 0x%x for Teles S0/16.3!\n",
+ unit, sc->sc_port);
+ isic_detach_common(dev);
+ return ENXIO;
+ }
sc->sc_resources.io_rid[1] = 1;
bus_set_resource(dev, SYS_RES_IOPORT, 1,
- sc->sc_port-ISAC_OFFS, 0x40);
+ sc->sc_port-ISAC_OFFS, 0x20);
sc->sc_resources.io_base[1] =
bus_alloc_resource(dev, SYS_RES_IOPORT,
&sc->sc_resources.io_rid[1],
@@ -209,7 +225,7 @@ isic_probe_s0163(device_t dev)
sc->sc_resources.io_rid[2] = 2;
bus_set_resource(dev, SYS_RES_IOPORT, 2,
- sc->sc_port-HSCXA_OFFS, 0x40);
+ sc->sc_port-HSCXA_OFFS, 0x20);
sc->sc_resources.io_base[2] =
bus_alloc_resource(dev, SYS_RES_IOPORT,
&sc->sc_resources.io_rid[2],
@@ -224,7 +240,7 @@ isic_probe_s0163(device_t dev)
sc->sc_resources.io_rid[3] = 3;
bus_set_resource(dev, SYS_RES_IOPORT, 3,
- sc->sc_port-HSCXB_OFFS, 0x40);
+ sc->sc_port-HSCXB_OFFS, 0x20);
sc->sc_resources.io_base[3] =
bus_alloc_resource(dev, SYS_RES_IOPORT,
&sc->sc_resources.io_rid[3],
OpenPOWER on IntegriCloud