version 1.5, 2005/02/04 02:10:40 |
version 1.6, 2005/02/27 00:27:17 |
|
|
/* |
/* |
* Copyright (c) 1996 Arne Helme. All rights reserved. |
* Copyright (c) 1996 Arne Helme. All rights reserved. |
* |
* |
* Copyright (c) 1996 Gary Jennejohn. All rights reserved. |
* Copyright (c) 1996 Gary Jennejohn. All rights reserved. |
* |
* |
* Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved. |
* Copyright (c) 1997, 1999 Hellmuth Michaelis. All rights reserved. |
* |
* |
|
|
* without specific prior written permission. |
* without specific prior written permission. |
* 4. Altered versions must be plainly marked as such, and must not be |
* 4. Altered versions must be plainly marked as such, and must not be |
* misrepresented as being the original software and/or documentation. |
* misrepresented as being the original software and/or documentation. |
* |
* |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|
|
* isic - I4B Siemens ISDN Chipset Driver for Teles S0/8 and clones |
* isic - I4B Siemens ISDN Chipset Driver for Teles S0/8 and clones |
* ================================================================ |
* ================================================================ |
* |
* |
* $Id$ |
* $Id$ |
* |
* |
* last edit-date: [Fri Jan 5 11:37:22 2001] |
* last edit-date: [Fri Jan 5 11:37:22 2001] |
* |
* |
Line 173 tels08_read_reg(struct isic_softc *sc, i |
|
Line 173 tels08_read_reg(struct isic_softc *sc, i |
|
*---------------------------------------------------------------------------*/ |
*---------------------------------------------------------------------------*/ |
#ifdef __FreeBSD__ |
#ifdef __FreeBSD__ |
|
|
static void |
static void |
tels08_memcpyb(void *to, const void *from, size_t len) |
tels08_memcpyb(void *to, const void *from, size_t len) |
{ |
{ |
for(;len > 0; len--) |
for(;len > 0; len--) |
Line 210 isic_probe_s08(struct isa_device *dev) |
|
Line 210 isic_probe_s08(struct isa_device *dev) |
|
struct isic_softc *sc = &l1_sc[dev->id_unit]; |
struct isic_softc *sc = &l1_sc[dev->id_unit]; |
|
|
/* check max unit range */ |
/* check max unit range */ |
|
|
if(dev->id_unit >= ISIC_MAXUNIT) |
if(dev->id_unit >= ISIC_MAXUNIT) |
{ |
{ |
printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Teles S0/8!\n", |
printf("isic%d: Error, unit %d >= ISIC_MAXUNIT for Teles S0/8!\n", |
dev->id_unit, dev->id_unit); |
dev->id_unit, dev->id_unit); |
return(0); |
return(0); |
} |
} |
sc->sc_unit = dev->id_unit; |
sc->sc_unit = dev->id_unit; |
|
|
/* check IRQ validity */ |
/* check IRQ validity */ |
|
|
switch(ffs(dev->id_irq)-1) |
switch(ffs(dev->id_irq)-1) |
{ |
{ |
case 2: |
case 2: |
Line 231 isic_probe_s08(struct isa_device *dev) |
|
Line 231 isic_probe_s08(struct isa_device *dev) |
|
case 6: |
case 6: |
case 7: |
case 7: |
break; |
break; |
|
|
default: |
default: |
printf("isic%d: Error, invalid IRQ [%d] specified for Teles S0/8!\n", |
printf("isic%d: Error, invalid IRQ [%d] specified for Teles S0/8!\n", |
dev->id_unit, ffs(dev->id_irq)-1); |
dev->id_unit, ffs(dev->id_irq)-1); |
return(0); |
return(0); |
break; |
break; |
} |
} |
sc->sc_irq = dev->id_irq; |
sc->sc_irq = dev->id_irq; |
|
|
/* check if we got an iobase */ |
/* check if we got an iobase */ |
|
|
if(dev->id_iobase > 0) |
if(dev->id_iobase > 0) |
{ |
{ |
printf("isic%d: Error, iobase specified for Teles S0/8!\n", |
printf("isic%d: Error, iobase specified for Teles S0/8!\n", |
dev->id_unit); |
dev->id_unit); |
return(0); |
return(0); |
} |
} |
|
|
/* check if inside memory range of 0xA0000 .. 0xDF000 */ |
/* check if inside memory range of 0xA0000 .. 0xDF000 */ |
|
|
if( (kvtop(dev->id_maddr) < 0xa0000) || |
if( (kvtop(dev->id_maddr) < 0xa0000) || |
(kvtop(dev->id_maddr) > 0xdf000) ) |
(kvtop(dev->id_maddr) > 0xdf000) ) |
{ |
{ |
Line 258 isic_probe_s08(struct isa_device *dev) |
|
Line 258 isic_probe_s08(struct isa_device *dev) |
|
dev->id_unit, kvtop(dev->id_maddr)); |
dev->id_unit, kvtop(dev->id_maddr)); |
return(0); |
return(0); |
} |
} |
|
|
sc->sc_vmem_addr = (caddr_t) dev->id_maddr; |
sc->sc_vmem_addr = (caddr_t) dev->id_maddr; |
dev->id_msize = 0x1000; |
dev->id_msize = 0x1000; |
|
|
/* setup ISAC access routines */ |
/* setup ISAC access routines */ |
|
|
sc->clearirq = NULL; |
sc->clearirq = NULL; |
Line 272 isic_probe_s08(struct isa_device *dev) |
|
Line 272 isic_probe_s08(struct isa_device *dev) |
|
sc->writefifo = tels08_memcpyb; |
sc->writefifo = tels08_memcpyb; |
|
|
/* setup card type */ |
/* setup card type */ |
|
|
sc->sc_cardtyp = CARD_TYPEP_8; |
sc->sc_cardtyp = CARD_TYPEP_8; |
|
|
/* setup IOM bus type */ |
/* setup IOM bus type */ |
|
|
sc->sc_bustyp = BUS_TYPE_IOM1; |
sc->sc_bustyp = BUS_TYPE_IOM1; |
|
|
sc->sc_ipac = 0; |
sc->sc_ipac = 0; |
sc->sc_bfifolen = HSCX_FIFO_LEN; |
sc->sc_bfifolen = HSCX_FIFO_LEN; |
|
|
/* setup ISAC base addr */ |
/* setup ISAC base addr */ |
|
|
ISAC_BASE = (caddr_t)((dev->id_maddr) + 0x100); |
ISAC_BASE = (caddr_t)((dev->id_maddr) + 0x100); |
|
|
/* setup HSCX base addr */ |
/* setup HSCX base addr */ |
|
|
HSCX_A_BASE = (caddr_t)((dev->id_maddr) + 0x180); |
HSCX_A_BASE = (caddr_t)((dev->id_maddr) + 0x180); |
HSCX_B_BASE = (caddr_t)((dev->id_maddr) + 0x1c0); |
HSCX_B_BASE = (caddr_t)((dev->id_maddr) + 0x1c0); |
|
|
return (1); |
return (1); |
} |
} |
|
|
Line 302 isic_probe_s08(struct isic_attach_args * |
|
Line 302 isic_probe_s08(struct isic_attach_args * |
|
/* no real sensible probe is easy - write to fifo memory |
/* no real sensible probe is easy - write to fifo memory |
and read back to verify there is memory doesn't work, |
and read back to verify there is memory doesn't work, |
because you talk to tx fifo and rcv fifo. So, just check |
because you talk to tx fifo and rcv fifo. So, just check |
HSCX version, which at least fails if no card present |
HSCX version, which at least fails if no card present |
at the given location. */ |
at the given location. */ |
bus_space_tag_t t = ia->ia_maps[0].t; |
bus_space_tag_t t = ia->ia_maps[0].t; |
bus_space_handle_t h = ia->ia_maps[0].h; |
bus_space_handle_t h = ia->ia_maps[0].h; |
Line 364 isic_attach_s08(struct isic_softc *sc) |
|
Line 364 isic_attach_s08(struct isic_softc *sc) |
|
DELAY(SEC_DELAY / 5); |
DELAY(SEC_DELAY / 5); |
|
|
#ifndef __FreeBSD__ |
#ifndef __FreeBSD__ |
|
|
/* setup ISAC access routines */ |
/* setup ISAC access routines */ |
|
|
sc->clearirq = NULL; |
sc->clearirq = NULL; |
Line 374 isic_attach_s08(struct isic_softc *sc) |
|
Line 374 isic_attach_s08(struct isic_softc *sc) |
|
sc->writefifo = tels08_write_fifo; |
sc->writefifo = tels08_write_fifo; |
|
|
/* setup card type */ |
/* setup card type */ |
|
|
sc->sc_cardtyp = CARD_TYPEP_8; |
sc->sc_cardtyp = CARD_TYPEP_8; |
|
|
/* setup IOM bus type */ |
/* setup IOM bus type */ |
|
|
sc->sc_bustyp = BUS_TYPE_IOM1; |
sc->sc_bustyp = BUS_TYPE_IOM1; |
|
|
sc->sc_ipac = 0; |
sc->sc_ipac = 0; |
sc->sc_bfifolen = HSCX_FIFO_LEN; |
sc->sc_bfifolen = HSCX_FIFO_LEN; |
|
|
#endif |
#endif |
|
|
return (1); |
return (1); |
} |
} |
|
|