svn commit: r327102 - in head/sys: dev/aha dev/aic dev/an dev/atkbdc dev/cs dev/ed dev/ep dev/ex dev/fdc dev/fe dev/joy dev/le dev/mse dev/pccard dev/pccbb dev/ppc dev/sbni dev/sio dev/uart isa

Warner Losh imp at FreeBSD.org
Sat Dec 23 06:49:30 UTC 2017


Author: imp
Date: Sat Dec 23 06:49:27 2017
New Revision: 327102
URL: https://svnweb.freebsd.org/changeset/base/327102

Log:
  Create a new ISA_PNP_INFO macro. Use this macro every where we have
  ISA PNP card support (replace by hand version in if_ed). Move module
  declarations to the end of some files. Fix PCCARD_PNP_INFO to use
  nitems(). Remove some stale comments about pc98, turns out the comment
  was simply wrong.

Modified:
  head/sys/dev/aha/aha_isa.c
  head/sys/dev/aic/aic_isa.c
  head/sys/dev/an/if_an_isa.c
  head/sys/dev/atkbdc/atkbdc_isa.c
  head/sys/dev/cs/if_cs_isa.c
  head/sys/dev/ed/if_ed_isa.c
  head/sys/dev/ep/if_ep_isa.c
  head/sys/dev/ex/if_ex_isa.c
  head/sys/dev/fdc/fdc_isa.c
  head/sys/dev/fe/if_fe_isa.c
  head/sys/dev/joy/joy_isa.c
  head/sys/dev/le/if_le_isa.c
  head/sys/dev/mse/mse_isa.c
  head/sys/dev/pccard/pccardvar.h
  head/sys/dev/pccbb/pccbb_isa.c
  head/sys/dev/ppc/ppc_isa.c
  head/sys/dev/sbni/if_sbni_isa.c
  head/sys/dev/sio/sio_isa.c
  head/sys/dev/uart/uart_bus_isa.c
  head/sys/isa/isavar.h

Modified: head/sys/dev/aha/aha_isa.c
==============================================================================
--- head/sys/dev/aha/aha_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/aha/aha_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -362,3 +362,4 @@ static devclass_t aha_devclass;
 
 DRIVER_MODULE(aha, isa, aha_isa_driver, aha_devclass, 0, 0);
 MODULE_DEPEND(aha, isa, 1, 1, 1);
+ISA_PNP_INFO(aha_ids);

Modified: head/sys/dev/aic/aic_isa.c
==============================================================================
--- head/sys/dev/aic/aic_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/aic/aic_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -242,3 +242,4 @@ extern devclass_t aic_devclass;
 
 MODULE_DEPEND(aic, cam, 1,1,1);
 DRIVER_MODULE(aic, isa, aic_isa_driver, aic_devclass, 0, 0);
+ISA_PNP_INFO(aic_ids);

Modified: head/sys/dev/an/if_an_isa.c
==============================================================================
--- head/sys/dev/an/if_an_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/an/if_an_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -150,3 +150,4 @@ static devclass_t an_isa_devclass;
 DRIVER_MODULE(an, isa, an_isa_driver, an_isa_devclass, 0, 0);
 MODULE_DEPEND(an, isa, 1, 1, 1);
 MODULE_DEPEND(an, wlan, 1, 1, 1);
+ISA_PNP_INFO(an_ids);

Modified: head/sys/dev/atkbdc/atkbdc_isa.c
==============================================================================
--- head/sys/dev/atkbdc/atkbdc_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/atkbdc/atkbdc_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -322,3 +322,4 @@ atkbdc_isa_release_resource(device_t dev, device_t chi
 
 DRIVER_MODULE(atkbdc, isa, atkbdc_isa_driver, atkbdc_devclass, 0, 0);
 DRIVER_MODULE(atkbdc, acpi, atkbdc_isa_driver, atkbdc_devclass, 0, 0);
+ISA_PNP_INFO(atkbdc_ids);

Modified: head/sys/dev/cs/if_cs_isa.c
==============================================================================
--- head/sys/dev/cs/if_cs_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/cs/if_cs_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -120,3 +120,4 @@ extern devclass_t cs_devclass;
 DRIVER_MODULE(cs, isa, cs_isa_driver, cs_devclass, 0, 0);
 MODULE_DEPEND(cs, isa, 1, 1, 1);
 MODULE_DEPEND(cs, ether, 1, 1, 1);
+ISA_PNP_INFO(cs_ids);

Modified: head/sys/dev/ed/if_ed_isa.c
==============================================================================
--- head/sys/dev/ed/if_ed_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/ed/if_ed_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -203,6 +203,4 @@ static driver_t ed_isa_driver = {
 DRIVER_MODULE(ed, isa, ed_isa_driver, ed_devclass, 0, 0);
 MODULE_DEPEND(ed, isa, 1, 1, 1);
 MODULE_DEPEND(ed, ether, 1, 1, 1);
-MODULE_PNP_INFO("E:pnpid;", isa, ed, ed_ids, sizeof(ed_ids[0]),
-    nitems(ed_ids) - 1);
-
+ISA_PNP_INFO(ed_ids);

Modified: head/sys/dev/ep/if_ep_isa.c
==============================================================================
--- head/sys/dev/ep/if_ep_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/ep/if_ep_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -395,3 +395,4 @@ DRIVER_MODULE(ep, isa, ep_isa_driver, ep_devclass, 0, 
 #ifdef __i386__
 MODULE_DEPEND(ep, elink, 1, 1, 1);
 #endif
+ISA_PNP_INFO(ep_ids);

Modified: head/sys/dev/ex/if_ex_isa.c
==============================================================================
--- head/sys/dev/ex/if_ex_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/ex/if_ex_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -82,8 +82,6 @@ static driver_t ex_isa_driver = {
 	sizeof(struct ex_softc),
 };
 
-DRIVER_MODULE(ex, isa, ex_isa_driver, ex_devclass, 0, 0);
-
 static struct isa_pnp_id ex_ids[] = {
 	{ 0x3110d425,	NULL },	/* INT1031 */
 	{ 0x3010d425,	NULL },	/* INT1030 */
@@ -337,3 +335,6 @@ ex_look_for_card(struct ex_softc *sc)
 
 	return((count2 & Counter_bits) == ((count1 + 0xc0) & Counter_bits));
 }
+
+DRIVER_MODULE(ex, isa, ex_isa_driver, ex_devclass, 0, 0);
+ISA_PNP_INFO(ex_ids);

Modified: head/sys/dev/fdc/fdc_isa.c
==============================================================================
--- head/sys/dev/fdc/fdc_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/fdc/fdc_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -224,3 +224,4 @@ static driver_t fdc_driver = {
 };
 
 DRIVER_MODULE(fdc, isa, fdc_driver, fdc_devclass, 0, 0);
+ISA_PNP_INFO(fdc_ids);

Modified: head/sys/dev/fe/if_fe_isa.c
==============================================================================
--- head/sys/dev/fe/if_fe_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/fe/if_fe_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -68,9 +68,6 @@ static driver_t fe_isa_driver = {
 	sizeof (struct fe_softc)
 };
 
-DRIVER_MODULE(fe, isa, fe_isa_driver, fe_devclass, 0, 0);
-
-
 static int fe_probe_ssi(device_t);
 static int fe_probe_jli(device_t);
 static int fe_probe_fmv(device_t);
@@ -1062,3 +1059,5 @@ fe_probe_ubn(device_t dev)
 
 	return 0;
 }
+
+DRIVER_MODULE(fe, isa, fe_isa_driver, fe_devclass, 0, 0);

Modified: head/sys/dev/joy/joy_isa.c
==============================================================================
--- head/sys/dev/joy/joy_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/joy/joy_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -85,3 +85,4 @@ static driver_t joy_isa_driver = {
 
 DRIVER_MODULE(joy, isa, joy_isa_driver, joy_devclass, 0, 0);
 DRIVER_MODULE(joy, acpi, joy_isa_driver, joy_devclass, 0, 0);
+ISA_PNP_INFO(joy_ids);

Modified: head/sys/dev/le/if_le_isa.c
==============================================================================
--- head/sys/dev/le/if_le_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/le/if_le_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -135,10 +135,6 @@ static device_method_t le_isa_methods[] = {
 	{ 0, 0 }
 };
 
-DEFINE_CLASS_0(le, le_isa_driver, le_isa_methods, sizeof(struct le_isa_softc));
-DRIVER_MODULE(le, isa, le_isa_driver, le_devclass, 0, 0);
-MODULE_DEPEND(le, ether, 1, 1, 1);
-
 struct le_isa_param {
 	const char	*name;
 	u_long		iosize;
@@ -496,3 +492,8 @@ le_isa_resume(device_t dev)
 
 	return (0);
 }
+
+DEFINE_CLASS_0(le, le_isa_driver, le_isa_methods, sizeof(struct le_isa_softc));
+DRIVER_MODULE(le, isa, le_isa_driver, le_devclass, 0, 0);
+MODULE_DEPEND(le, ether, 1, 1, 1);
+ISA_PNP_INFO(le_isa_ids);

Modified: head/sys/dev/mse/mse_isa.c
==============================================================================
--- head/sys/dev/mse/mse_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/mse/mse_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -107,8 +107,6 @@ static	driver_t	mse_driver = {
 	sizeof(mse_softc_t),
 };
 
-DRIVER_MODULE(mse, isa, mse_driver, mse_devclass, 0, 0);
-
 static struct isa_pnp_id mse_ids[] = {
 	{ 0x000fd041, "Bus mouse" },			/* PNP0F00 */
 	{ 0x020fd041, "InPort mouse" },			/* PNP0F02 */
@@ -390,3 +388,6 @@ mse_getati(struct resource *port, int *dx, int *dy, in
 	bus_write_1(port, MSE_PORTA, MSE_INPORT_MODE);
 	bus_write_1(port, MSE_PORTB, MSE_INPORT_INTREN);
 }
+
+DRIVER_MODULE(mse, isa, mse_driver, mse_devclass, 0, 0);
+ISA_PNP_INFO(mse_ids);

Modified: head/sys/dev/pccard/pccardvar.h
==============================================================================
--- head/sys/dev/pccard/pccardvar.h	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/pccard/pccardvar.h	Sat Dec 23 06:49:27 2017	(r327102)
@@ -103,7 +103,7 @@ struct pccard_product {
  */
 #define PCCARD_PNP_DESCR "D:#;V32:manufacturer;V32:product;Z:cisvendor;Z:cisproduct;"
 #define PCCARD_PNP_INFO(t) \
-	MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0]) - 1); \
+	MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), nitems(t) - 1); \
 
 typedef int (*pccard_product_match_fn) (device_t dev,
     const struct pccard_product *ent, int vpfmatch);

Modified: head/sys/dev/pccbb/pccbb_isa.c
==============================================================================
--- head/sys/dev/pccbb/pccbb_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/pccbb/pccbb_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -106,7 +106,6 @@ SYSCTL_INT(_hw_pcic, OID_AUTO, pd6722_vsense, CTLFLAG_
 #define	DPRINTF(x) do { if (cbb_debug) printf x; } while (0)
 #define	DEVPRINTF(x) do { if (cbb_debug) device_printf x; } while (0)
 
-/* XXX Not sure that PNP0E03 should be claimed, except maybe on pc98 */
 static struct isa_pnp_id pcic_ids[] = {
 	{EXCA_PNP_ACTIONTEC,		NULL},		/* AEI0218 */
 	{EXCA_PNP_IBM3765,		NULL},		/* IBM3765 */
@@ -255,3 +254,4 @@ static driver_t cbb_isa_driver = {
 
 DRIVER_MODULE(cbb, isa, cbb_isa_driver, cbb_devclass, 0, 0);
 MODULE_DEPEND(cbb, exca, 1, 1, 1);
+ISA_PNP_INFO(pcic_ids);

Modified: head/sys/dev/ppc/ppc_isa.c
==============================================================================
--- head/sys/dev/ppc/ppc_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/ppc/ppc_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -274,3 +274,4 @@ error:
 }
 
 DRIVER_MODULE(ppc, isa, ppc_isa_driver, ppc_devclass, 0, 0);
+ISA_PNP_INFO(lpc_ids);

Modified: head/sys/dev/sbni/if_sbni_isa.c
==============================================================================
--- head/sys/dev/sbni/if_sbni_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/sbni/if_sbni_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -71,9 +71,6 @@ static struct isa_pnp_id  sbni_ids[] = {
 	{ 0, NULL }	/* we have no pnp sbni cards atm.  */
 };
 
-DRIVER_MODULE(sbni, isa, sbni_isa_driver, sbni_isa_devclass, 0, 0);
-MODULE_DEPEND(sbni, isa, 1, 1, 1);
-
 static int
 sbni_probe_isa(device_t dev)
 {
@@ -166,3 +163,6 @@ sbni_attach_isa(device_t dev)
 
 	return (0);
 }
+
+DRIVER_MODULE(sbni, isa, sbni_isa_driver, sbni_isa_devclass, 0, 0);
+MODULE_DEPEND(sbni, isa, 1, 1, 1);

Modified: head/sys/dev/sio/sio_isa.c
==============================================================================
--- head/sys/dev/sio/sio_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/sio/sio_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -175,3 +175,4 @@ DRIVER_MODULE(sio, isa, sio_isa_driver, sio_devclass, 
 #ifndef COM_NO_ACPI
 DRIVER_MODULE(sio, acpi, sio_isa_driver, sio_devclass, 0, 0);
 #endif
+ISA_PNP_INFO(sio_ids);

Modified: head/sys/dev/uart/uart_bus_isa.c
==============================================================================
--- head/sys/dev/uart/uart_bus_isa.c	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/dev/uart/uart_bus_isa.c	Sat Dec 23 06:49:27 2017	(r327102)
@@ -172,3 +172,4 @@ uart_isa_probe(device_t dev)
 }
 
 DRIVER_MODULE(uart, isa, uart_isa_driver, uart_devclass, 0, 0);
+ISA_PNP_INFO(isa_ns8250_ids);

Modified: head/sys/isa/isavar.h
==============================================================================
--- head/sys/isa/isavar.h	Sat Dec 23 06:11:19 2017	(r327101)
+++ head/sys/isa/isavar.h	Sat Dec 23 06:49:27 2017	(r327102)
@@ -140,6 +140,10 @@ enum isa_device_ivars {
 #define ISACFGATTR_DYNAMIC	(1 << 1)	/* dynamic configuration */
 #define ISACFGATTR_HINTS	(1 << 3)	/* source of config is hints */
 
+#define	ISA_PNP_DESCR "E:pnpid;D:#"
+#define ISA_PNP_INFO(t) \
+	MODULE_PNP_INFO(ISA_PNP_DESCR, pccard, t, t, sizeof(t[0]), nitems(t) - 1); \
+
 /*
  * Simplified accessors for isa devices
  */


More information about the svn-src-head mailing list