1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-04 09:09:56 +00:00

Do some cleanups of the HARP atm codes interface into the system:

Define the NETISR just like all the other NETISRs.

unifdef -Usun -D__FreeBSD__  we will probably never support sun4c
and if we do we can't use the solaris code anyway and  I doubt
anybody will be running Fore ATM cards in then in the first place.
This commit is contained in:
Poul-Henning Kamp 2000-10-12 00:03:50 +00:00
parent 70351c9a14
commit 6cb2a0952f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=66988
14 changed files with 1 additions and 1356 deletions

View File

@ -53,19 +53,16 @@ static void eni_pci_attach __P((pcici_t, int));
static int eni_get_ack __P((Eni_unit *));
static int eni_get_sebyte __P((Eni_unit *));
static void eni_read_seeprom __P((Eni_unit *));
#ifdef __FreeBSD__
#if BSD < 199506
static int eni_pci_shutdown __P((struct kern_devconf *, int));
#else
static void eni_pci_shutdown __P((void *, int));
#endif
static void eni_pci_reset __P((Eni_unit *));
#endif /* __FreeBSD__ */
/*
* Used by kernel to return number of claimed devices
*/
#ifdef __FreeBSD__
static u_long eni_nunits;
static struct pci_device eni_pci_device = {
@ -81,7 +78,6 @@ static struct pci_device eni_pci_device = {
};
COMPAT_PCI_DRIVER (eni_pci, eni_pci_device);
#endif /* __FreeBSD__ */
/*
* Called by kernel with PCI device_id which was read from the PCI
@ -611,7 +607,6 @@ eni_pci_reset ( eup )
return;
}
#ifdef __FreeBSD__
#if BSD < 199506
/*
* Device shutdown routine
@ -666,4 +661,3 @@ eni_pci_shutdown ( eup, howto )
}
#endif /* BSD < 199506 */
#endif /* __FreeBSD__ */

File diff suppressed because it is too large Load Diff

View File

@ -163,9 +163,6 @@ typedef struct buf_handle Buf_handle;
*/
struct fore_unit {
Cmn_unit fu_cmn; /* Common unit stuff */
#ifdef sun
struct dev_info *fu_devinfo; /* Device node for this unit */
#endif
Fore_reg *fu_ctlreg; /* Device control register */
#ifdef FORE_SBUS
Fore_reg *fu_intlvl; /* Interrupt level register */

View File

@ -37,10 +37,6 @@
#include <net/netisr.h>
#include <net/intrq.h>
#ifdef __i386__
#include <netatm/kern_include.h> /* XXX overkill, fixme! */
#endif
/*
* If the appropriate intrq_present variable is zero, don't use
* the queue (as it'll never get processed).
@ -49,9 +45,7 @@
*/
const int atintrq1_present;
const int atintrq2_present;
#ifdef NETISR_ATM
const int atmintrq_present;
#endif
const int ipintrq_present;
const int ip6intrq_present;
const int ipxintrq_present;
@ -60,9 +54,7 @@ const int nsintrq_present;
struct ifqueue atintrq1;
struct ifqueue atintrq2;
#ifdef NETISR_ATM
struct ifqueue atm_intrq;
#endif
struct ifqueue ipintrq;
struct ifqueue ip6intrq;
struct ifqueue ipxintrq;
@ -76,9 +68,7 @@ static const struct {
int const *present;
int isr;
} queue[] = {
#ifdef NETISR_ATM
{ AF_ATM, &atm_intrq, &atmintrq_present, NETISR_ATM },
#endif
{ AF_INET, &ipintrq, &ipintrq_present, NETISR_IP },
{ AF_INET6, &ip6intrq, &ip6intrq_present, NETISR_IPV6 },
{ AF_IPX, &ipxintrq, &ipxintrq_present, NETISR_IPX },

View File

@ -61,6 +61,7 @@
#define NETISR_PPP 27 /* PPP soft interrupt */
#define NETISR_IPV6 28 /* same as AF_INET6 */
#define NETISR_NATM 29 /* same as AF_NATM */
#define NETISR_ATM 30 /* same as AF_ATM */
#define NETISR_NETGRAPH 31 /* same as AF_NETGRAPH */

View File

@ -449,19 +449,7 @@ atm_dev_alloc(size, align, flags)
*
* This is obviously very OS-specific stuff
*/
#ifdef sun
if (flags & ATM_DEV_NONCACHE) {
/* Byte-aligned */
kalign = sizeof(long);
} else {
/* Doubleword-aligned */
kalign = sizeof(double);
}
#elif (defined(BSD) && (BSD >= 199103))
kalign = MINALLOCSIZE;
#else
#error Unsupported/unconfigured OS
#endif
/*
* Figure out how much memory we must allocate to satify the
@ -476,13 +464,7 @@ atm_dev_alloc(size, align, flags)
* Finally, go get the memory
*/
if (flags & ATM_DEV_NONCACHE) {
#ifdef sun
mep->me_kaddr = IOPBALLOC(ksize);
#elif defined(__i386__)
mep->me_kaddr = KM_ALLOC(ksize, M_DEVBUF, M_NOWAIT);
#else
#error Unsupported/unconfigured OS
#endif
} else {
mep->me_kaddr = KM_ALLOC(ksize, M_DEVBUF, M_NOWAIT);
}
@ -572,13 +554,7 @@ atm_dev_free(uaddr)
* Give the memory space back to the kernel
*/
if (mep->me_flags & ATM_DEV_NONCACHE) {
#ifdef sun
IOPBFREE(mep->me_kaddr, mep->me_ksize);
#elif defined(__i386__)
KM_FREE(mep->me_kaddr, mep->me_ksize, M_DEVBUF);
#else
#error Unsupported/unconfigured OS
#endif
} else {
KM_FREE(mep->me_kaddr, mep->me_ksize, M_DEVBUF);
}

View File

@ -376,13 +376,7 @@ struct atm_ncm {
typedef void (atm_intr_t) __P((void *, KBuffer *)); /* Callback function type */
typedef atm_intr_t *atm_intr_func_t; /* Pointer to callback function */
#ifdef sun
#define SCHED_ATM schednetisr(atm_intr)
#endif
#ifdef __FreeBSD__
#define NETISR_ATM AF_ATM
#define SCHED_ATM schednetisr(NETISR_ATM)
#endif
#ifdef sgi
extern int atm_intr_index;
#define SCHED_ATM schednetisr(atm_intr_index)

View File

@ -108,9 +108,7 @@ struct domain atmdomain = {
&atmsw[sizeof(atmsw) / sizeof(atmsw[0])]
};
#ifdef __FreeBSD__
DOMAIN_SET(atm);
#endif
#if (defined(__FreeBSD__) && (BSD >= 199506))

View File

@ -115,20 +115,12 @@ atm_initialize()
return;
atm_init = 1;
#ifndef __FreeBSD__
/*
* Add ATM protocol family
*/
(void) protocol_family(&atmdomain, NULL, NULL);
#endif
atm_intrq.ifq_maxlen = ATM_INTRQ_MAX;
#ifdef sgi
atm_intr_index = register_isr(atm_intr);
#endif
#ifdef __FreeBSD__
register_netisr(NETISR_ATM, atm_intr);
#endif
/*
* Initialize subsystems

View File

@ -660,91 +660,8 @@ ipatm_dounload()
}
#ifdef sun
/*
* Loadable driver description
*/
struct vdldrv ipatm_drv = {
VDMAGIC_PSEUDO, /* Pseudo Driver */
"ipatm_mod", /* name */
NULL, /* dev_ops */
NULL, /* bdevsw */
NULL, /* cdevsw */
0, /* blockmajor */
0 /* charmajor */
};
/*
* Loadable module support entry point
*
* This is the routine called by the vd driver for all loadable module
* functions for this pseudo driver. This routine name must be specified
* on the modload(1) command. This routine will be called whenever the
* modload(1), modunload(1) or modstat(1) commands are issued for this
* module.
*
* Arguments:
* cmd vd command code
* vdp pointer to vd driver's structure
* vdi pointer to command-specific vdioctl_* structure
* vds pointer to status structure (VDSTAT only)
*
* Returns:
* 0 command was successful
* errno command failed - reason indicated
*
*/
int
ipatm_mod(cmd, vdp, vdi, vds)
int cmd;
struct vddrv *vdp;
caddr_t vdi;
struct vdstat *vds;
{
int err = 0;
switch (cmd) {
case VDLOAD:
/*
* Module Load
*
* We dont support any user configuration
*/
err = ipatm_doload();
if (err == 0)
/* Let vd driver know about us */
vdp->vdd_vdtab = (struct vdlinkage *)&ipatm_drv;
break;
case VDUNLOAD:
/*
* Module Unload
*/
err = ipatm_dounload();
break;
case VDSTAT:
/*
* Module Status
*/
/* Not much to say at the moment */
break;
default:
log(LOG_ERR, "ipatm_mod: Unknown vd command 0x%x\n", cmd);
err = EINVAL;
}
return (err);
}
#endif /* sun */
#ifdef __FreeBSD__
#include <sys/exec.h>
#include <sys/sysent.h>
#include <sys/lkm.h>
@ -831,7 +748,6 @@ ipatm_mod(lkmtp, cmd, ver)
MOD_DISPATCH(ipatm, lkmtp, cmd, ver,
ipatm_load, ipatm_unload, lkm_nullcmd);
}
#endif /* __FreeBSD__ */
#else /* !ATM_IP_MODULE */

View File

@ -59,21 +59,11 @@
#include <sys/socketvar.h>
#include <sys/syslog.h>
#ifdef sun
#include <machine/cpu.h>
#include <machine/mmu.h>
#include <machine/psl.h>
#include <sun/openprom.h>
#include <sun/vddrv.h>
#include <sundev/mbvar.h>
#endif
#ifdef __FreeBSD__
#include <sys/eventhandler.h>
#include <machine/clock.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#endif
/*
* Networking support

View File

@ -737,91 +737,8 @@ sigpvc_dounload()
}
#ifdef sun
/*
* Loadable driver description
*/
struct vdldrv sigpvc_drv = {
VDMAGIC_PSEUDO, /* Pseudo Driver */
"sigpvc_mod", /* name */
NULL, /* dev_ops */
NULL, /* bdevsw */
NULL, /* cdevsw */
0, /* blockmajor */
0 /* charmajor */
};
/*
* Loadable module support entry point
*
* This is the routine called by the vd driver for all loadable module
* functions for this pseudo driver. This routine name must be specified
* on the modload(1) command. This routine will be called whenever the
* modload(1), modunload(1) or modstat(1) commands are issued for this
* module.
*
* Arguments:
* cmd vd command code
* vdp pointer to vd driver's structure
* vdi pointer to command-specific vdioctl_* structure
* vds pointer to status structure (VDSTAT only)
*
* Returns:
* 0 command was successful
* errno command failed - reason indicated
*
*/
int
sigpvc_mod(cmd, vdp, vdi, vds)
int cmd;
struct vddrv *vdp;
caddr_t vdi;
struct vdstat *vds;
{
int err = 0;
switch (cmd) {
case VDLOAD:
/*
* Module Load
*
* We dont support any user configuration
*/
err = sigpvc_doload();
if (err == 0)
/* Let vd driver know about us */
vdp->vdd_vdtab = (struct vdlinkage *)&sigpvc_drv;
break;
case VDUNLOAD:
/*
* Module Unload
*/
err = sigpvc_dounload();
break;
case VDSTAT:
/*
* Module Status
*/
/* Not much to say at the moment */
break;
default:
log(LOG_ERR, "sigpvc_mod: Unknown vd command 0x%x\n", cmd);
err = EINVAL;
}
return (err);
}
#endif /* sun */
#ifdef __FreeBSD__
#include <sys/exec.h>
#include <sys/sysent.h>
#include <sys/lkm.h>
@ -908,7 +825,6 @@ sigpvc_mod(lkmtp, cmd, ver)
MOD_DISPATCH(sigpvc, lkmtp, cmd, ver,
sigpvc_load, sigpvc_unload, lkm_nullcmd);
}
#endif /* __FreeBSD__ */
#else /* !ATM_SIGPVC_MODULE */

View File

@ -1120,91 +1120,8 @@ spans_dounload()
}
#ifdef sun
/*
* Loadable driver description
*/
struct vdldrv spans_drv = {
VDMAGIC_PSEUDO, /* Pseudo Driver */
"spans_mod", /* name */
NULL, /* dev_ops */
NULL, /* bdevsw */
NULL, /* cdevsw */
0, /* blockmajor */
0 /* charmajor */
};
/*
* Loadable module support entry point
*
* This is the routine called by the vd driver for all loadable module
* functions for this pseudo driver. This routine name must be specified
* on the modload(1) command. This routine will be called whenever the
* modload(1), modunload(1) or modstat(1) commands are issued for this
* module.
*
* Arguments:
* cmd vd command code
* vdp pointer to vd driver's structure
* vdi pointer to command-specific vdioctl_* structure
* vds pointer to status structure (VDSTAT only)
*
* Returns:
* 0 command was successful
* errno command failed - reason indicated
*
*/
int
spans_mod(cmd, vdp, vdi, vds)
int cmd;
struct vddrv *vdp;
caddr_t vdi;
struct vdstat *vds;
{
int err = 0;
switch (cmd) {
case VDLOAD:
/*
* Module Load
*
* We dont support any user configuration
*/
err = spans_doload();
if (err == 0)
/* Let vd driver know about us */
vdp->vdd_vdtab = (struct vdlinkage *)&spans_drv;
break;
case VDUNLOAD:
/*
* Module Unload
*/
err = spans_dounload();
break;
case VDSTAT:
/*
* Module Status
*/
/* Not much to say at the moment */
break;
default:
log(LOG_ERR, "spans_mod: Unknown vd command 0x%x\n", cmd);
err = EINVAL;
}
return (err);
}
#endif /* sun */
#ifdef __FreeBSD__
#include <sys/exec.h>
#include <sys/sysent.h>
#include <sys/lkm.h>
@ -1291,7 +1208,6 @@ spans_mod(lkmtp, cmd, ver)
MOD_DISPATCH(spans, lkmtp, cmd, ver,
spans_load, spans_unload, lkm_nullcmd);
}
#endif /* __FreeBSD__ */
#else /* !ATM_SPANS_MODULE */

View File

@ -231,91 +231,8 @@ uni_dounload()
}
#ifdef sun
/*
* Loadable driver description
*/
struct vdldrv uni_drv = {
VDMAGIC_PSEUDO, /* Pseudo Driver */
"uni_mod", /* name */
NULL, /* dev_ops */
NULL, /* bdevsw */
NULL, /* cdevsw */
0, /* blockmajor */
0 /* charmajor */
};
/*
* Loadable module support entry point
*
* This is the routine called by the vd driver for all loadable module
* functions for this pseudo driver. This routine name must be specified
* on the modload(1) command. This routine will be called whenever the
* modload(1), modunload(1) or modstat(1) commands are issued for this
* module.
*
* Arguments:
* cmd vd command code
* vdp pointer to vd driver's structure
* vdi pointer to command-specific vdioctl_* structure
* vds pointer to status structure (VDSTAT only)
*
* Returns:
* 0 command was successful
* errno command failed - reason indicated
*
*/
int
uni_mod(cmd, vdp, vdi, vds)
int cmd;
struct vddrv *vdp;
caddr_t vdi;
struct vdstat *vds;
{
int err = 0;
switch (cmd) {
case VDLOAD:
/*
* Module Load
*
* We dont support any user configuration
*/
err = uni_doload();
if (err == 0)
/* Let vd driver know about us */
vdp->vdd_vdtab = (struct vdlinkage *)&uni_drv;
break;
case VDUNLOAD:
/*
* Module Unload
*/
err = uni_dounload();
break;
case VDSTAT:
/*
* Module Status
*/
/* Not much to say at the moment */
break;
default:
log(LOG_ERR, "uni_mod: Unknown vd command 0x%x\n", cmd);
err = EINVAL;
}
return (err);
}
#endif /* sun */
#ifdef __FreeBSD__
#include <sys/exec.h>
#include <sys/sysent.h>
#include <sys/lkm.h>
@ -402,7 +319,6 @@ uni_mod(lkmtp, cmd, ver)
MOD_DISPATCH(uni, lkmtp, cmd, ver,
uni_load, uni_unload, lkm_nullcmd);
}
#endif /* __FreeBSD__ */
#else /* !ATM_UNI_MODULE */