From f72e17e2339137ec9c88b867fe83d7f55f1a0ac9 Mon Sep 17 00:00:00 2001 From: "Matthew N. Dodd" Date: Tue, 1 Oct 2002 22:04:31 +0000 Subject: [PATCH] Add a field to struct cmn_unit to hold a pointer to the driver's softc. --- sys/dev/hea/eni.h | 1 + sys/dev/hea/hea_freebsd.c | 1 + sys/dev/hfa/fore_var.h | 1 + sys/dev/hfa/hfa_freebsd.c | 1 + sys/dev/idt/idt_harp.c | 2 ++ sys/netatm/atm_if.h | 2 ++ 6 files changed, 8 insertions(+) diff --git a/sys/dev/hea/eni.h b/sys/dev/hea/eni.h index dde878825e8f..e3fd6440d059 100644 --- a/sys/dev/hea/eni.h +++ b/sys/dev/hea/eni.h @@ -499,5 +499,6 @@ typedef struct eni_unit Eni_unit; #define eu_closevcc eu_cmn.cu_closevcc #define eu_output eu_cmn.cu_output #define eu_config eu_cmn.cu_config +#define eu_softc eu_cmn.cu_softc #endif /* _ENI_ENI_H */ diff --git a/sys/dev/hea/hea_freebsd.c b/sys/dev/hea/hea_freebsd.c index 08b9e7518da1..6efabb56e24a 100644 --- a/sys/dev/hea/hea_freebsd.c +++ b/sys/dev/hea/hea_freebsd.c @@ -184,6 +184,7 @@ hea_attach (device_t dev) eup->eu_output = eni_output; eup->eu_pcitag = dev; + eup->eu_softc = (void *)sc; /* * Map memory structures into adapter space diff --git a/sys/dev/hfa/fore_var.h b/sys/dev/hfa/fore_var.h index 20856e8ea53a..6f7dd4c59f5b 100644 --- a/sys/dev/hfa/fore_var.h +++ b/sys/dev/hfa/fore_var.h @@ -245,6 +245,7 @@ typedef struct fore_unit Fore_unit; #define fu_closevcc fu_cmn.cu_closevcc #define fu_output fu_cmn.cu_output #define fu_config fu_cmn.cu_config +#define fu_softc fu_cmn.cu_softc /* * Device flags (in addition to CUF_* flags) diff --git a/sys/dev/hfa/hfa_freebsd.c b/sys/dev/hfa/hfa_freebsd.c index 40af3f8edf5f..67e4e760d856 100644 --- a/sys/dev/hfa/hfa_freebsd.c +++ b/sys/dev/hfa/hfa_freebsd.c @@ -176,6 +176,7 @@ hfa_attach (device_t dev) fup->fu_openvcc = fore_openvcc; fup->fu_closevcc = fore_closevcc; fup->fu_output = fore_output; + fup->fu_softc = (void *)sc; callout_handle_init(&fup->fu_thandle); diff --git a/sys/dev/idt/idt_harp.c b/sys/dev/idt/idt_harp.c index ace90ef8b8f1..44886c849837 100644 --- a/sys/dev/idt/idt_harp.c +++ b/sys/dev/idt/idt_harp.c @@ -109,6 +109,7 @@ #define iu_closevcc iu_cmn.cu_closevcc #define iu_output iu_cmn.cu_output #define iu_config iu_cmn.cu_config +#define iu_softc iu_cmn.cu_softc /* * ATM Interface services @@ -313,6 +314,7 @@ idt_harp_init(nicstar_reg_t *idt) idt->iu_output = idt_output; idt->iu_vcc_zone = idt_vcc_zone; idt->iu_nif_zone = idt_nif_zone; + idt->iu_softc = (void *)idt; /* * Copy serial number into config space diff --git a/sys/netatm/atm_if.h b/sys/netatm/atm_if.h index 4052f4b30157..f0cfbe70eee1 100644 --- a/sys/netatm/atm_if.h +++ b/sys/netatm/atm_if.h @@ -279,6 +279,8 @@ struct cmn_unit { (struct cmn_unit *, Cmn_vcc *, KBuffer *); Atm_config cu_config; /* Device configuration data */ + + void * cu_softc; /* pointer to driver state */ }; typedef struct cmn_unit Cmn_unit;