Submitted by: wpaul (with 2 lines moved by rgrimes)

Add support for kern_devconf structure.
This commit is contained in:
Rodney W. Grimes 1995-05-10 15:19:29 +00:00
parent db27b2e18e
commit 3e0b4dc1f6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8411
2 changed files with 37 additions and 3 deletions

View file

@ -28,7 +28,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* $Id: if_ix.c,v 1.4 1995/03/02 07:40:26 rgrimes Exp $ * $Id: if_ix.c,v 1.5 1995/03/02 08:17:14 rgrimes Exp $
*/ */
#include "ix.h" #include "ix.h"
@ -169,6 +169,29 @@ RRR */
struct isa_driver ixdriver = {ixprobe, ixattach, "ix"}; struct isa_driver ixdriver = {ixprobe, ixattach, "ix"};
static struct kern_devconf kdc_ix_template = {
0, 0, 0, /* filled in by dev_attach */
"ix", 0, { MDDT_ISA, 0, "net" },
isa_generic_externalize, 0, 0, ISA_EXTERNALLEN,
&kdc_isa0, /* parent */
0, /* parentdata */
DC_UNCONFIGURED, /* state */
"", /* description */
DC_CLS_NETIF /* class */
};
static inline void
ix_registerdev(struct isa_device *id, const char *descr)
{
struct kern_devconf *kdc = &ix_softc[id->id_unit].kdc;
char *longdescr;
*kdc = kdc_ix_template;
kdc->kdc_unit = id->id_unit;
kdc->kdc_parentdata = id;
kdc->kdc_description = descr;
dev_attach(kdc);
}
/* /*
* Enable the interrupt signal on the board so that it may interrupt * Enable the interrupt signal on the board so that it may interrupt
* the host. * the host.
@ -513,6 +536,10 @@ ixprobe(struct isa_device *dvp) {
sc->flags = IXF_NONE; /* make sure the flag word is NONE */ sc->flags = IXF_NONE; /* make sure the flag word is NONE */
status = IX_IO_PORTS; status = IX_IO_PORTS;
#ifndef DEV_LKM
ix_registerdev(dvp, "Ethernet adapter: Intel EtherExpress16");
#endif /* not DEV_LKM */
ixprobe_exit: ixprobe_exit:
DEBUGBEGIN(DEBUGPROBE) DEBUGBEGIN(DEBUGPROBE)
DEBUGDO(printf ("ixprobe exited\n");) DEBUGDO(printf ("ixprobe exited\n");)
@ -599,7 +626,8 @@ ixattach(struct isa_device *dvp) {
#endif /* IXCOUNTERS */ #endif /* IXCOUNTERS */
if_attach(ifp); if_attach(ifp);
sc->kdc.kdc_state = DC_IDLE;
/* Search down the ifa address list looking for the AF_LINK type entry */ /* Search down the ifa address list looking for the AF_LINK type entry */
ifa = ifp->if_addrlist; ifa = ifp->if_addrlist;
while ((ifa != 0) && while ((ifa != 0) &&
@ -637,6 +665,8 @@ ixinit(int unit) {
DEBUGDO(printf("ixinit:");) DEBUGDO(printf("ixinit:");)
DEBUGEND DEBUGEND
sc->kdc.kdc_state = DC_BUSY;
/* Put bart into loopback until we are done intializing to /* Put bart into loopback until we are done intializing to
* make sure that packets don't hit the wire */ * make sure that packets don't hit the wire */
bart_config = inb(sc->iobase + config); bart_config = inb(sc->iobase + config);
@ -1460,6 +1490,8 @@ ixstop(struct ifnet *ifp) {
/* force the 82586 reset pin high */ /* force the 82586 reset pin high */
outb(sc->iobase + ee_ctrl, I586_RESET); outb(sc->iobase + ee_ctrl, I586_RESET);
sc->kdc.kdc_state = DC_IDLE;
DEBUGBEGIN(DEBUGSTOP) DEBUGBEGIN(DEBUGSTOP)
DEBUGDO(printf("ixstop exiting\n");) DEBUGDO(printf("ixstop exiting\n");)
DEBUGEND DEBUGEND
@ -1485,6 +1517,7 @@ int
ixioctl(struct ifnet *ifp, int cmd, caddr_t data) { ixioctl(struct ifnet *ifp, int cmd, caddr_t data) {
int unit = ifp->if_unit; int unit = ifp->if_unit;
int status = 0; int status = 0;
ix_softc_t *sc = &ix_softc[unit];
DEBUGBEGIN(DEBUGIOCTL) DEBUGBEGIN(DEBUGIOCTL)
DEBUGDO(printf("ixioctl:");) DEBUGDO(printf("ixioctl:");)

View file

@ -28,7 +28,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* $Id: if_ixreg.h,v 1.3 1995/02/26 20:13:15 rgrimes Exp $ * $Id: if_ixreg.h,v 1.4 1995/03/02 07:40:27 rgrimes Exp $
*/ */
/* /*
@ -364,4 +364,5 @@ typedef struct
rfd_t *rfd_tail; /* tail of the rfd list */ rfd_t *rfd_tail; /* tail of the rfd list */
rbd_t *rbd_head; /* head of the rbd list */ rbd_t *rbd_head; /* head of the rbd list */
rbd_t *rbd_tail; /* tail of the rbd list */ rbd_t *rbd_tail; /* tail of the rbd list */
struct kern_devconf kdc;
} ix_softc_t; } ix_softc_t;