remove the tina-dd driver fragment, it is unlikely that it will get finished.
This commit is contained in:
parent
440c876352
commit
a86390df07
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=66875
@ -1,20 +0,0 @@
|
||||
|
||||
THIS DRIVER IS NOT YET WORKING !
|
||||
================================
|
||||
|
||||
This adds support for the active ISDN card tina-dd manufactured by
|
||||
Stollmann E+V GmbH in Hamburg, Germany. This card was also sold by
|
||||
MIRO as the Miro P1.
|
||||
|
||||
Christian Luehrs and Manfred Jung of Stollmann were very helpful
|
||||
giving out docs and sources to support the development of a driver
|
||||
for this card.
|
||||
|
||||
The card supports many protocols. In order to make the card operable
|
||||
you'll need the downloadable firmware which also can be found on the
|
||||
www/ftp server, www.stollmann.de / ftp.stollmann.de.
|
||||
|
||||
While developing this driver, i used fcdddss1.loc as of April 1994.
|
||||
|
||||
The code is based in part on sources and header files written by
|
||||
Stollmann for their driver development kit for the tina-dd.
|
@ -1,339 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1994, 1998 Hellmuth Michaelis. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*---------------------------------------------------------------------------
|
||||
*
|
||||
* i4b_tina_dd.c - i4b Stollman Tina-dd control device driver
|
||||
* ----------------------------------------------------------
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
* last edit-date: [Sat Dec 5 18:41:38 1998]
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "tina.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
|
||||
#include <sys/ioccom.h>
|
||||
#else
|
||||
#include <sys/ioctl.h>
|
||||
#endif
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
|
||||
#ifdef __FreeBSD__
|
||||
#include <sys/bus.h>
|
||||
#include <machine/i4b_debug.h>
|
||||
#include <machine/i4b_ioctl.h>
|
||||
#include <i386/isa/isa_device.h>
|
||||
#else
|
||||
#include <machine/bus.h>
|
||||
#include <sys/device.h>
|
||||
#include <i4b/i4b_debug.h>
|
||||
#include <i4b/i4b_ioctl.h>
|
||||
#endif
|
||||
|
||||
#include <i4b/include/i4b_mbuf.h>
|
||||
#include <i4b/tina-dd/i4b_tina_ioctl.h>
|
||||
|
||||
#ifndef COMPAT_OLDISA
|
||||
#error "The tina device requires the old isa compatibility shims"
|
||||
#endif
|
||||
|
||||
static int openflag = 0;
|
||||
|
||||
int tinaprobe(struct isa_device *dev);
|
||||
int tinaattach(struct isa_device *dev);
|
||||
void tinaintr(int unit);
|
||||
|
||||
struct isa_driver tinadriver = {
|
||||
INTR_TYPE_NET,
|
||||
tinaprobe,
|
||||
tinaattach,
|
||||
"tina",
|
||||
0
|
||||
};
|
||||
COMPAT_ISA_DRIVER(tina, tinadriver);
|
||||
|
||||
static struct tina_softc {
|
||||
int sc_unit;
|
||||
int sc_iobase;
|
||||
} tina_sc[NTINA];
|
||||
|
||||
static d_open_t tinaopen;
|
||||
static d_close_t tinaclose;
|
||||
static d_ioctl_t tinaioctl;
|
||||
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
|
||||
static d_poll_t tinapoll;
|
||||
#define POLLFIELD tinapoll
|
||||
#else
|
||||
#define POLLFIELD noselect
|
||||
#endif
|
||||
|
||||
#define CDEV_MAJOR 54
|
||||
static struct cdevsw tina_cdevsw = {
|
||||
/* open */ tinaopen,
|
||||
/* close */ tinaclose,
|
||||
/* read */ noread,
|
||||
/* write */ nowrite,
|
||||
/* ioctl */ tinaioctl,
|
||||
/* poll */ POLLFIELD,
|
||||
/* mmap */ nommap,
|
||||
/* strategy */ nostrategy,
|
||||
/* name */ "tina",
|
||||
/* maj */ CDEV_MAJOR,
|
||||
/* dump */ nodump,
|
||||
/* psize */ nopsize,
|
||||
/* flags */ 0,
|
||||
/* bmaj */ -1
|
||||
};
|
||||
|
||||
static void setupaddr(unsigned short iobase, unsigned int addr);
|
||||
static void readblock(unsigned short iobase, unsigned int addr,
|
||||
unsigned char *dst, unsigned int len);
|
||||
static void writeblock(unsigned short iobase, unsigned char *src,
|
||||
unsigned long addr, int len);
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* tina - device driver probe routine
|
||||
*---------------------------------------------------------------------------*/
|
||||
int
|
||||
tinaprobe(struct isa_device *dev)
|
||||
{
|
||||
u_char byte;
|
||||
|
||||
#define SETLOW 0x55
|
||||
#define SETMID 0xaa
|
||||
#define SETHIGH 0x06
|
||||
|
||||
outb((dev->id_iobase + ADDR_CNTL), SETLOW);
|
||||
|
||||
if((byte = inb(dev->id_iobase + ADDR_CNTL)) != SETLOW)
|
||||
{
|
||||
printf("tina%d: probe low failed, 0x%x != 0x%x\n",
|
||||
dev->id_unit, byte, SETLOW);
|
||||
return(0);
|
||||
}
|
||||
|
||||
outb((dev->id_iobase + ADDR_CNTM), SETMID);
|
||||
if((byte = inb(dev->id_iobase + ADDR_CNTM)) != SETMID)
|
||||
{
|
||||
printf("tina%d: probe mid failed, 0x%x != 0x%x\n",
|
||||
dev->id_unit, byte, SETMID);
|
||||
return(0);
|
||||
}
|
||||
|
||||
outb((dev->id_iobase + ADDR_CNTH), SETHIGH);
|
||||
if(((byte = inb(dev->id_iobase + ADDR_CNTH)) & 0x0f) != SETHIGH)
|
||||
{
|
||||
printf("tina%d: probe high failed, 0x%x != 0x%x\n",
|
||||
dev->id_unit, byte, SETHIGH);
|
||||
return(0);
|
||||
}
|
||||
|
||||
printf("tina%d: status register = 0x%x\n",
|
||||
dev->id_unit, inb(dev->id_iobase + CTRL_STAT));
|
||||
|
||||
return(1); /* board found */
|
||||
}
|
||||
#undef SETLOW
|
||||
#undef SETMID
|
||||
#undef SETHIGH
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* tina - device driver attach routine
|
||||
*---------------------------------------------------------------------------*/
|
||||
int
|
||||
tinaattach(struct isa_device *dev)
|
||||
{
|
||||
struct tina_softc *sc = &tina_sc[dev->id_unit];
|
||||
|
||||
sc->sc_unit = dev->id_unit;
|
||||
sc->sc_iobase = dev->id_iobase;
|
||||
|
||||
printf("tina%d: attaching Tina-dd\n", dev->id_unit);
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* tina - device driver interrupt routine
|
||||
*---------------------------------------------------------------------------*/
|
||||
void
|
||||
tinaintr(int unit)
|
||||
{
|
||||
}
|
||||
|
||||
#if BSD > 199306 && defined(__FreeBSD__)
|
||||
/*---------------------------------------------------------------------------*
|
||||
* initialization at kernel load time
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
tinainit(void *unused)
|
||||
{
|
||||
|
||||
cdevsw_add(&tina_cdevsw);
|
||||
}
|
||||
|
||||
SYSINIT(tinadev, SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR, &tinainit, NULL);
|
||||
|
||||
#endif /* BSD > 199306 && defined(__FreeBSD__) */
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* tinaopen - device driver open routine
|
||||
*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
tinaopen(dev_t dev, int flag, int fmt, struct proc *p)
|
||||
{
|
||||
if(minor(dev))
|
||||
return (ENXIO);
|
||||
|
||||
if(openflag)
|
||||
return (EBUSY);
|
||||
|
||||
openflag = 1;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* tinaclose - device driver close routine
|
||||
*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
tinaclose(dev_t dev, int flag, int fmt, struct proc *p)
|
||||
{
|
||||
openflag = 0;
|
||||
return(0);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* tinaioctl - device driver ioctl routine
|
||||
*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
tinaioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
|
||||
{
|
||||
struct tina_softc *sc = &tina_sc[minor(dev)];
|
||||
u_short iobase = sc->sc_iobase;
|
||||
int error = 0;
|
||||
int s;
|
||||
|
||||
if(minor(dev))
|
||||
return(ENODEV);
|
||||
|
||||
s = splimp();
|
||||
|
||||
switch(cmd)
|
||||
{
|
||||
/* hardware layer - control & status register */
|
||||
|
||||
case ISDN_GETCSR: /* return control register */
|
||||
*(unsigned char *)data = inb(iobase + CTRL_STAT);
|
||||
break;
|
||||
|
||||
case ISDN_SETCSR: /* set status register */
|
||||
outb((iobase + CTRL_STAT), *(unsigned char *)data);
|
||||
break;
|
||||
|
||||
/* hardware layer - dual ported memory */
|
||||
|
||||
case ISDN_GETBLK: /* get block from dual port mem */
|
||||
readblock(iobase, (*(struct record *)data).addr,
|
||||
(*(struct record *)data).data,
|
||||
(*(struct record *)data).length);
|
||||
break;
|
||||
|
||||
case ISDN_SETBLK: /* write block to dual port mem */
|
||||
writeblock(iobase, (*(struct record *)data).data,
|
||||
(*(struct record *)data).addr,
|
||||
(*(struct record *)data).length);
|
||||
break;
|
||||
|
||||
default:
|
||||
error = ENOTTY;
|
||||
break;
|
||||
}
|
||||
return(error);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* tinapoll - device driver poll routine
|
||||
*---------------------------------------------------------------------------*/
|
||||
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
|
||||
static int
|
||||
tinapoll (dev_t dev, int events, struct proc *p)
|
||||
{
|
||||
return (ENODEV);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*===========================================================================*
|
||||
* tina dual ported memory access
|
||||
*===========================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* setup address for accessing tina-dd ram
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
setupaddr(unsigned short iobase, unsigned int addr)
|
||||
{
|
||||
outb((iobase + ADDR_CNTL), (unsigned char) addr & 0xff);
|
||||
outb((iobase + ADDR_CNTM), (unsigned char) ((addr >> 8) & 0xff));
|
||||
outb((iobase + ADDR_CNTH), (unsigned char) ((addr >> 16) & 0xff));
|
||||
}
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* read block from tina-dd dual ported ram
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
readblock(unsigned short iobase, unsigned int addr,
|
||||
unsigned char *dst, unsigned int len)
|
||||
{
|
||||
setupaddr(iobase, addr); /* setup start address */
|
||||
|
||||
while(len--) /* tina-dd mem -> pc mem */
|
||||
*dst++ = inb(iobase + DATA_LOW_INC);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* write block to tina-dd dual ported ram
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
writeblock(unsigned short iobase, unsigned char *src,
|
||||
unsigned long addr, int len)
|
||||
{
|
||||
setupaddr(iobase, addr); /* setup start address */
|
||||
|
||||
while(len--) /* pc mem -> tina-dd mem */
|
||||
outb((iobase + DATA_LOW_INC), *src++);
|
||||
}
|
@ -1,138 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1994, 1998 Hellmuth Michaelis. All rights reserved.
|
||||
*
|
||||
* Based on code written by Stollmann GmbH, Hamburg. Many thanks to
|
||||
* Christian Luehrs and Manfred Jung for docs, sources and answers!
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*---------------------------------------------------------------------------
|
||||
*
|
||||
* i4b_tina_ioctl.h - i4b Stollman Tina-dd ioctl header file
|
||||
* ---------------------------------------------------------
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
* last edit-date: [Sat Dec 5 18:41:51 1998]
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _I4B_TINA_IOCTL_H_
|
||||
#define _I4B_TINA_IOCTL_H_
|
||||
|
||||
#define TINA_IOSIZE 8 /* 8 byte wide iospace occupied */
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* register offsets in i/o address space
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#define CTRL_STAT 0 /* control & status */
|
||||
|
||||
#define ADDR_CNTL 1 /* address pointer low */
|
||||
#define ADDR_CNTM 2 /* address pointer mid */
|
||||
#define ADDR_CNTH 3 /* address pointer high */
|
||||
|
||||
#define DATA_LOW 4 /* data register low */
|
||||
#define DATA_HIGH 5 /* data register high */
|
||||
|
||||
#define DATA_LOW_INC 6 /* data register low, post inc */
|
||||
#define DATA_HIGH_INC 7 /* data register high, post inc */
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* status register (CTRL_STAT read access)
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#define CR_INTC 0x80 /* irq FROM tina-dd TO pc active */
|
||||
#define CR_INTP 0x40 /* irq FROM pc TO tina-dd active */
|
||||
#define CR_INTPA 0x20 /* irq FROM pc TO tina-dd active */
|
||||
#define CR_NMI 0x10 /* nmi FROM PC TO tina-dd active */
|
||||
#define CR_FLASHLD 0x08 /* read of the FLASHLD-bit (n/c) */
|
||||
#define CR_S2C 0x04 /* info bit */
|
||||
#define CR_S1C 0x02 /* info bit */
|
||||
#define CR_S0C 0x01 /* info bit */
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* control register (CTRL_STAT write access)
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#define CR_CLR_INTC 0x80 /* clear irq on tina-dd */
|
||||
#define CR_SET_INTP 0x40 /* trigger irq on tina-dd */
|
||||
#define CR_RESET 0x20 /* reset tina-dd */
|
||||
#define CR_SET_NMI 0x10 /* trigger nmi on tina-dd */
|
||||
#define CR_SET_FLASHLD 0x08 /* activates pin FLASHLD (n/c) */
|
||||
#define CR_S2P 0x04 /* info bit (not readable !) */
|
||||
#define CR_S1P 0x02 /* info bit (not readable !) */
|
||||
#define CR_S0P 0x01 /* info bit (not readable !) */
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* misc definitions in dual-ported mem on board of tina-dd
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#define FW_SYSCB 0x200 /* address of FW SYSCB / MJ 300392 */
|
||||
#define FW_SINFO_NAME 0x220 /* address of general info label */
|
||||
|
||||
#define FW_HW_TYPE 0x224 /* address of hardware type byte: */
|
||||
#define FW_HW_UNDEF 0x00 /* undefined .. */
|
||||
#define FW_HW_TINA_DD 0x10 /* TINA-dd */
|
||||
#define FW_HW_TINA_DS 0x20 /* TINA-ds (B channel/ser ?) */
|
||||
#define FW_HW_TINA_D 0x30 /* TINA-d (one B channel ?) */
|
||||
#define FW_HW_TINA_DDM 0x40 /* TINA-dd with fax module */
|
||||
#define FW_HW_TINA_DDS 0x50 /* TINA-dd with fax/voice module */
|
||||
#define FW_HW_SICCE 0x80 /* X.25 board */
|
||||
#define FW_HW_ASIC 0x01 /* ASIC version bit */
|
||||
|
||||
#define FW_STAT 0x228 /* address of firmware status byte */
|
||||
#define FW_READY 0x20 /* firmware ready bit */
|
||||
#define FW_BOOTPRM_RDY 0x02 /* boot PROM ready */
|
||||
#define FW_UNDEF_0 0x00 /* undefined */
|
||||
#define FW_UNDEF_1 0xFF /* undefined */
|
||||
|
||||
#define FW_SINFO_ID "SYSI" /* general info label for FW > 2.13*/
|
||||
#define FW_SINFO_ID_LEN 4
|
||||
|
||||
#define FW_ADDR_PROFPTR 0x260 /* addr of ptr to board profile */
|
||||
|
||||
/*===========================================================================*
|
||||
* Layer 0 - Hardware layer
|
||||
*===========================================================================*/
|
||||
|
||||
/* control and status register access */
|
||||
|
||||
#define ISDN_GETCSR _IOR('I', 1, unsigned char) /* get csr */
|
||||
#define ISDN_SETCSR _IOW('I', 2, unsigned char) /* set csr */
|
||||
|
||||
/* dual ported ram access */
|
||||
|
||||
#define ISDN_GETBLK _IOWR('I', 3, struct record) /* get dpr record */
|
||||
#define ISDN_SETBLK _IOW('I', 4, struct record) /* set dpr record */
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
* record structure for dual ported ram block rd/wr
|
||||
*---------------------------------------------------------------------------*/
|
||||
struct record {
|
||||
unsigned int length; /* length of data block */
|
||||
unsigned int addr; /* address of mem on tina-dd board */
|
||||
unsigned char *data; /* pointer to the datablock itself */
|
||||
};
|
||||
|
||||
#endif /* _I4B_TINA_IOCTL_H_ */
|
Loading…
Reference in New Issue
Block a user