Remove PAO3 dependent part.

This will not affect either -current nor -stable.
This commit is contained in:
Noriaki Mitsunaga 2001-11-03 08:55:34 +00:00
parent c2900483ae
commit c6a39821ec
10 changed files with 1 additions and 352 deletions

View File

@ -115,7 +115,7 @@
#include <cam/scsi/scsi_low.h>
#if !defined(__FreeBSD__) || __FreeBSD_version < 400001
#if !defined(__FreeBSD__)
#include <i386/i386/cons.h>
#else
#include <sys/cons.h>
@ -958,9 +958,6 @@ scsi_low_cam_rescan_callback(periph, ccb)
xpt_free_path(ccb->ccb_h.path);
free(ccb, M_DEVBUF);
#if __FreeBSD_version < 400001
free(periph, M_DEVBUF);
#endif
}
static void
@ -969,10 +966,6 @@ scsi_low_rescan_bus_cam(slp)
{
struct cam_path *path;
union ccb *ccb = malloc(sizeof(union ccb), M_DEVBUF, M_WAITOK);
#if __FreeBSD_version < 400001
struct cam_periph *xpt_periph = malloc(sizeof(struct cam_periph),
M_DEVBUF, M_WAITOK);
#endif
cam_status status;
bzero(ccb, sizeof(union ccb));

View File

@ -87,11 +87,6 @@
#include <dev/ncv/ncr53c500var.h>
#include <dev/ncv/ncr53c500hwtab.h>
#if __FreeBSD_version < 400001
#include "ncv.h"
struct ncv_softc *ncvdata[NNCV];
#endif
#endif /* __FreeBSD__ */
#define NCV_MAX_DATA_SIZE (64 * 1024)

View File

@ -52,16 +52,8 @@
#include <machine/bus.h>
#include <machine/bus_pio.h>
#include <i386/isa/isa_device.h>
#include <machine/dvcfg.h>
#if defined(__FreeBSD__) && __FreeBSD_version < 400001
static struct ncv_softc *ncv_get_softc(int);
extern struct ncv_softc *ncvdata[];
#define DEVPORT_ALLOCSOFTCFUNC ncv_get_softc
#define DEVPORT_SOFTCARRAY ncvdata
#endif
#include <sys/device_port.h>
#include <cam/scsi/scsi_low.h>
@ -70,16 +62,10 @@ extern struct ncv_softc *ncvdata[];
#include <dev/ncv/ncr53c500reg.h>
#include <dev/ncv/ncr53c500hw.h>
#include <dev/ncv/ncr53c500var.h>
#if defined(__NetBSD__) || (defined(__FreeBSD__) && __FreeBSD_version < 400001)
#include "ncv.h"
#endif
#define KME_KXLC004_01 0x100
#define OFFSET_KME_KXLC004_01 0x10
/* pccard support */
#include "card.h"
#if NCARD > 0
#include <sys/kernel.h>
#include <sys/module.h>
#if !defined(__FreeBSD__) || __FreeBSD_version < 500014
@ -92,12 +78,7 @@ static int ncvprobe(DEVPORT_PDEVICE devi);
static int ncvattach(DEVPORT_PDEVICE devi);
static void ncv_card_unload __P((DEVPORT_PDEVICE));
#if defined(__FreeBSD__) && __FreeBSD_version < 400001
static int ncv_card_init __P((DEVPORT_PDEVICE));
static int ncv_card_intr __P((DEVPORT_PDEVICE));
#endif
#if defined(__FreeBSD__) && __FreeBSD_version >= 400001
/*
* Additional code for FreeBSD new-bus PCCard frontend
*/
@ -282,61 +263,6 @@ static devclass_t ncv_devclass;
DRIVER_MODULE(ncv, pccard, ncv_pccard_driver, ncv_devclass, 0, 0);
#else
PCCARD_MODULE(ncv, ncv_card_init, ncv_card_unload, ncv_card_intr, 0, cam_imask);
#endif
#if defined(__FreeBSD__) && __FreeBSD_version < 400001
static struct ncv_softc *
ncv_get_softc(int unit)
{
struct ncv_softc *sc;
if (unit >= NNCV) {
return(NULL);
}
if (ncvdata[unit] == NULL) {
sc = malloc(sizeof(struct ncv_softc), M_TEMP,M_NOWAIT);
if (sc == NULL) {
printf("ncv_get_softc: cannot malloc!\n");
return(NULL);
}
ncvdata[unit] = sc;
} else {
sc = ncvdata[unit];
}
return(sc);
}
static int
ncv_card_init(DEVPORT_PDEVICE devi)
{
int unit = DEVPORT_PDEVUNIT(devi);
if (NNCV <= unit)
return (ENODEV);
if (ncvprobe(devi) == 0)
return (ENXIO);
if (ncvattach(devi) == 0)
return (ENXIO);
return (0);
}
static int
ncv_card_intr(DEVPORT_PDEVICE devi)
{
ncvintr(DEVPORT_PDEVGET_SOFTC(devi));
return 1;
}
#endif
static void
ncv_card_unload(DEVPORT_PDEVICE devi)
{
@ -357,21 +283,9 @@ ncvprobe(DEVPORT_PDEVICE devi)
struct ncv_softc *sc = device_get_softc(devi);
u_int32_t flags = DEVPORT_PDEVFLAGS(devi);
#if defined(__FreeBSD__) && __FreeBSD_version >= 400001
rv = ncvprobesubr(rman_get_bustag(sc->port_res),
rman_get_bushandle(sc->port_res),
flags, NCV_HOSTID);
#else
bus_addr_t offset = 0;
u_int iobase = DEVPORT_PDEVIOBASE(devi);
if(flags & KME_KXLC004_01)
offset = OFFSET_KME_KXLC004_01;
rv = ncvprobesubr(I386_BUS_SPACE_IO,
iobase + offset,
flags, NCV_HOSTID);
#endif
return rv;
}
@ -382,50 +296,20 @@ ncvattach(DEVPORT_PDEVICE devi)
struct ncv_softc *sc;
struct scsi_low_softc *slp;
u_int32_t flags = DEVPORT_PDEVFLAGS(devi);
#if defined(__FreeBSD__) && __FreeBSD_version < 400001
int unit = DEVPORT_PDEVUNIT(devi);
bus_addr_t offset = 0;
u_int iobase = DEVPORT_PDEVIOBASE(devi);
#endif
intrmask_t s;
char dvname[16]; /* SCSI_LOW_DVNAME_LEN */
strcpy(dvname, "ncv");
#if defined(__FreeBSD__) && __FreeBSD_version < 400001
if (unit >= NNCV)
{
printf("%s: unit number too high\n", dvname);
return (0);
}
if (iobase == 0)
{
printf("%s: no ioaddr is given\n", dvname);
return (0);
}
if(flags & KME_KXLC004_01)
offset = OFFSET_KME_KXLC004_01;
#endif
sc = DEVPORT_PDEVALLOC_SOFTC(devi);
if (sc == NULL) {
return(0);
}
slp = &sc->sc_sclow;
#if defined(__FreeBSD__) && __FreeBSD_version >= 400001
slp->sl_dev = devi;
sc->sc_iot = rman_get_bustag(sc->port_res);
sc->sc_ioh = rman_get_bushandle(sc->port_res);
#else
bzero(sc, sizeof(struct ncv_softc));
strcpy(slp->sl_dev.dv_xname, dvname);
slp->sl_dev.dv_unit = unit;
sc->sc_iot = I386_BUS_SPACE_IO;
sc->sc_ioh = iobase + offset;
#endif
slp->sl_hostid = NCV_HOSTID;
slp->sl_cfgflags = flags;
@ -436,4 +320,3 @@ ncvattach(DEVPORT_PDEVICE devi)
return(NCVIOSZ);
}
#endif /* NCARD */

View File

@ -55,7 +55,6 @@ struct ncv_softc {
bus_space_tag_t sc_memt;
bus_space_handle_t sc_ioh;
#if __FreeBSD_version >= 400001
int port_rid;
int port_rid_dmy;
int irq_rid;
@ -66,7 +65,6 @@ struct ncv_softc {
struct resource *mem_res;
void *ncv_intrhand;
#endif /* __FreeBSD_version__ */
#endif /* __FreeBSD__ */
int sc_tmaxcnt;

View File

@ -83,11 +83,6 @@
#include <cam/scsi/scsi_low.h>
#include <dev/nsp/nspreg.h>
#include <dev/nsp/nspvar.h>
#if __FreeBSD_version < 400001
#include "nsp.h"
struct nsp_softc *nspdata[NNSP];
#endif
#endif /* __FreeBSD__ */
/***************************************************

View File

@ -49,16 +49,8 @@
#include <vm/vm.h>
#include <machine/bus.h>
#include <i386/isa/isa_device.h>
#include <machine/dvcfg.h>
#if defined(__FreeBSD__) && __FreeBSD_version < 400001
static struct nsp_softc *nsp_get_softc(int);
extern struct nsp_softc *nspdata[];
#define DEVPORT_ALLOCSOFTCFUNC nsp_get_softc
#define DEVPORT_SOFTCARRAY nspdata
#endif
#include <sys/device_port.h>
#include <cam/scsi/scsi_low.h>
@ -66,15 +58,9 @@ extern struct nsp_softc *nspdata[];
#include <dev/nsp/nspreg.h>
#include <dev/nsp/nspvar.h>
#if defined(__NetBSD__) || (defined(__FreeBSD__) && __FreeBSD_version < 400001)
#include "nsp.h"
#endif
#define NSP_HOSTID 7
/* pccard support */
#include "card.h"
#if NCARD > 0
#include <sys/kernel.h>
#include <sys/module.h>
#if !defined(__FreeBSD__) || __FreeBSD_version < 500014
@ -89,12 +75,7 @@ static int nspprobe(DEVPORT_PDEVICE devi);
static int nspattach(DEVPORT_PDEVICE devi);
static void nsp_card_unload __P((DEVPORT_PDEVICE));
#if defined(__FreeBSD__) && __FreeBSD_version < 400001
static int nsp_card_init __P((DEVPORT_PDEVICE));
static int nsp_card_intr __P((DEVPORT_PDEVICE));
#endif
#if defined(__FreeBSD__) && __FreeBSD_version >= 400001
/*
* Additional code for FreeBSD new-bus PCCard frontend
*/
@ -259,61 +240,6 @@ static devclass_t nsp_devclass;
DRIVER_MODULE(nsp, pccard, nsp_pccard_driver, nsp_devclass, 0, 0);
#else
PCCARD_MODULE(nsp, nsp_card_init,nsp_card_unload, nsp_card_intr,0, cam_imask);
#endif
#if defined(__FreeBSD__) && __FreeBSD_version < 400001
static struct nsp_softc *
nsp_get_softc(int unit)
{
struct nsp_softc *sc;
if (unit >= NNSP) {
return(NULL);
}
if (nspdata[unit] == NULL) {
sc = malloc(sizeof(struct nsp_softc), M_TEMP,M_NOWAIT);
if (sc == NULL) {
printf("nsp_get_softc: cannot malloc!\n");
return(NULL);
}
nspdata[unit] = sc;
} else {
sc = nspdata[unit];
}
return(sc);
}
static int
nsp_card_init(DEVPORT_PDEVICE devi)
{
int unit = DEVPORT_PDEVUNIT(devi);
if (NNSP <= unit)
return (ENODEV);
if (nspprobe(devi) == 0)
return (ENXIO);
if (nspattach(devi) == 0)
return (ENXIO);
return (0);
}
static int
nsp_card_intr(DEVPORT_PDEVICE devi)
{
nspintr(DEVPORT_PDEVGET_SOFTC(devi));
return 1;
}
#endif
static void
nsp_card_unload(DEVPORT_PDEVICE devi)
{
@ -331,16 +257,11 @@ static int
nspprobe(DEVPORT_PDEVICE devi)
{
int rv;
#if defined(__FreeBSD__) && __FreeBSD_version >= 400001
struct nsp_softc *sc = device_get_softc(devi);
rv = nspprobesubr(rman_get_bustag(sc->port_res),
rman_get_bushandle(sc->port_res),
DEVPORT_PDEVFLAGS(devi));
#else
rv = nspprobesubr(I386_BUS_SPACE_IO,
DEVPORT_PDEVIOBASE(devi), DEVPORT_PDEVFLAGS(devi));
#endif
return rv;
}
@ -348,9 +269,6 @@ nspprobe(DEVPORT_PDEVICE devi)
static int
nspattach(DEVPORT_PDEVICE devi)
{
#if defined(__FreeBSD__) && __FreeBSD_version < 400001
int unit = DEVPORT_PDEVUNIT(devi);
#endif
struct nsp_softc *sc;
struct scsi_low_softc *slp;
u_int32_t flags = DEVPORT_PDEVFLAGS(devi);
@ -360,14 +278,6 @@ nspattach(DEVPORT_PDEVICE devi)
strcpy(dvname,"nsp");
#if defined(__FreeBSD__) && __FreeBSD_version < 400001
if (unit >= NNSP)
{
printf("%s: unit number too high\n",dvname);
return(0);
}
#endif
if (iobase == 0)
{
printf("%s: no ioaddr is given\n", dvname);
@ -380,26 +290,13 @@ nspattach(DEVPORT_PDEVICE devi)
}
slp = &sc->sc_sclow;
#if defined(__FreeBSD__) && __FreeBSD_version >= 400001
slp->sl_dev = devi;
sc->sc_iot = rman_get_bustag(sc->port_res);
sc->sc_ioh = rman_get_bushandle(sc->port_res);
#else
bzero(sc, sizeof(struct nsp_softc));
strcpy(slp->sl_dev.dv_xname, dvname);
slp->sl_dev.dv_unit = unit;
sc->sc_iot = I386_BUS_SPACE_IO;
sc->sc_ioh = iobase;
#endif
if((flags & PIO_MODE) == 0) {
#if defined(__FreeBSD__) && __FreeBSD_version >= 400001
sc->sc_memt = rman_get_bustag(sc->mem_res);
sc->sc_memh = rman_get_bushandle(sc->mem_res);
#else
sc->sc_memt = I386_BUS_SPACE_MEM;
sc->sc_memh = (bus_space_handle_t)DEVPORT_PDEVMADDR(devi);
#endif
} else {
sc->sc_memh = 0;
}
@ -416,4 +313,3 @@ nspattach(DEVPORT_PDEVICE devi)
return(NSP_IOSIZE);
}
#endif /* NCARD>0 */

View File

@ -58,7 +58,6 @@ struct nsp_softc {
bus_space_tag_t sc_memt;
bus_space_handle_t sc_memh;
#if __FreeBSD_version >= 400001
int port_rid;
int irq_rid;
int mem_rid;
@ -67,7 +66,6 @@ struct nsp_softc {
struct resource *mem_res;
void *nsp_intrhand;
#endif /* __FreeBSD_version */
#endif /* __FreeBSD__ */
int sc_tmaxcnt; /* timeout count */

View File

@ -81,11 +81,6 @@
#include <cam/scsi/scsi_low.h>
#include <dev/stg/tmc18c30reg.h>
#include <dev/stg/tmc18c30var.h>
#if __FreeBSD_version < 400001
#include "stg.h"
struct stg_softc *stgdata[NSTG];
#endif
#endif /* __FreeBSD__ */
/***************************************************

View File

@ -53,18 +53,9 @@
#include <vm/vm.h>
#include <machine/bus.h>
#include <machine/bus_pio.h>
#include <i386/isa/isa_device.h>
#include <machine/dvcfg.h>
#if defined(__FreeBSD__) && __FreeBSD_version < 400001
static struct stg_softc *stg_get_softc(int);
extern struct stg_softc *stgdata[];
#define DEVPORT_ALLOCSOFTCFUNC stg_get_softc
#define DEVPORT_SOFTCARRAY stgdata
#endif
#include <sys/device_port.h>
#include <cam/scsi/scsi_low.h>
@ -72,15 +63,9 @@ extern struct stg_softc *stgdata[];
#include <dev/stg/tmc18c30reg.h>
#include <dev/stg/tmc18c30var.h>
#if defined(__FreeBSD__) && __FreeBSD_version < 400001
#include "stg.h"
#endif
#define STG_HOSTID 7
/* pccard support */
#include "card.h"
#if NCARD > 0
#include <sys/kernel.h>
#include <sys/module.h>
#if !defined(__FreeBSD__) || __FreeBSD_version < 500014
@ -93,12 +78,7 @@ static int stgprobe(DEVPORT_PDEVICE devi);
static int stgattach(DEVPORT_PDEVICE devi);
static void stg_card_unload __P((DEVPORT_PDEVICE));
#if defined(__FreeBSD__) && __FreeBSD_version < 400001
static int stg_card_init __P((DEVPORT_PDEVICE));
static int stg_card_intr __P((DEVPORT_PDEVICE));
#endif
#if defined(__FreeBSD__) && __FreeBSD_version >= 400001
/*
* Additional code for FreeBSD new-bus PCCard frontend
*/
@ -258,63 +238,6 @@ static devclass_t stg_devclass;
DRIVER_MODULE(stg, pccard, stg_pccard_driver, stg_devclass, 0, 0);
#else
PCCARD_MODULE(stg, stg_card_init,stg_card_unload, stg_card_intr, 0, cam_imask);
#endif
#if defined(__FreeBSD__) && __FreeBSD_version < 400001
static struct stg_softc *
stg_get_softc(int unit)
{
struct stg_softc *sc;
if (unit >= NSTG) {
return(NULL);
}
if (stgdata[unit] == NULL) {
sc = malloc(sizeof(struct stg_softc), M_TEMP,M_NOWAIT);
if (sc == NULL) {
printf("stg_get_softc: cannot malloc!\n");
return(NULL);
}
stgdata[unit] = sc;
} else {
sc = stgdata[unit];
}
return(sc);
}
static int
stg_card_init(DEVPORT_PDEVICE devi)
{
int unit = DEVPORT_PDEVUNIT(devi);
if (NSTG <= unit)
return (ENODEV);
printf("probe stg\n");
if (stgprobe(devi) == 0)
return (ENXIO);
printf("attach stg\n");
if (stgattach(devi) == 0)
return (ENXIO);
return (0);
}
static int
stg_card_intr(DEVPORT_PDEVICE devi)
{
stgintr(DEVPORT_PDEVGET_SOFTC(devi));
return 1;
}
#endif
static void
stg_card_unload(DEVPORT_PDEVICE devi)
{
@ -332,16 +255,11 @@ static int
stgprobe(DEVPORT_PDEVICE devi)
{
int rv;
#if defined(__FreeBSD__) && __FreeBSD_version >= 400001
struct stg_softc *sc = device_get_softc(devi);
rv = stgprobesubr(rman_get_bustag(sc->port_res),
rman_get_bushandle(sc->port_res),
DEVPORT_PDEVFLAGS(devi));
#else
rv = stgprobesubr(I386_BUS_SPACE_IO,
DEVPORT_PDEVIOBASE(devi), DEVPORT_PDEVFLAGS(devi));
#endif
return rv;
}
@ -349,9 +267,6 @@ stgprobe(DEVPORT_PDEVICE devi)
static int
stgattach(DEVPORT_PDEVICE devi)
{
#if defined(__FreeBSD__) && __FreeBSD_version < 400001
int unit = DEVPORT_PDEVUNIT(devi);
#endif
struct stg_softc *sc;
struct scsi_low_softc *slp;
u_int32_t flags = DEVPORT_PDEVFLAGS(devi);
@ -361,14 +276,6 @@ stgattach(DEVPORT_PDEVICE devi)
strcpy(dvname,"stg");
#if defined(__FreeBSD__) && __FreeBSD_version < 400001
if (unit >= NSTG)
{
printf("%s: unit number too high\n",dvname);
return (0);
}
#endif
if (iobase == 0)
{
printf("%s: no ioaddr is given\n", dvname);
@ -381,17 +288,9 @@ stgattach(DEVPORT_PDEVICE devi)
}
slp = &sc->sc_sclow;
#if defined(__FreeBSD__) && __FreeBSD_version >= 400001
slp->sl_dev = devi;
sc->sc_iot = rman_get_bustag(sc->port_res);
sc->sc_ioh = rman_get_bushandle(sc->port_res);
#else
bzero(sc, sizeof(struct stg_softc));
strcpy(slp->sl_dev.dv_xname, dvname);
slp->sl_dev.dv_unit = unit;
sc->sc_iot = I386_BUS_SPACE_IO;
sc->sc_ioh = iobase;
#endif
slp->sl_hostid = STG_HOSTID;
slp->sl_cfgflags = flags;
@ -402,4 +301,3 @@ stgattach(DEVPORT_PDEVICE devi)
return(STGIOSZ);
}
#endif /* NCARD>0 */

View File

@ -57,7 +57,6 @@ struct stg_softc {
bus_space_tag_t sc_memt;
bus_space_handle_t sc_ioh;
#if __FreeBSD_version >= 400001
int port_rid;
int irq_rid;
int mem_rid;
@ -66,7 +65,6 @@ struct stg_softc {
struct resource *mem_res;
void *stg_intrhand;
#endif /* __FreeBSD_version */
#endif /* __FreeBSD__ */
int sc_tmaxcnt;