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.
This commit is contained in:
Warner Losh 2017-12-23 06:49:27 +00:00
parent 75d0374765
commit 5fe4723c70
20 changed files with 34 additions and 19 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -322,3 +322,4 @@ atkbdc_isa_release_resource(device_t dev, device_t child, int type, int rid,
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);

View File

@ -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);

View File

@ -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);

View File

@ -395,3 +395,4 @@ DRIVER_MODULE(ep, isa, ep_isa_driver, ep_devclass, 0, 0);
#ifdef __i386__
MODULE_DEPEND(ep, elink, 1, 1, 1);
#endif
ISA_PNP_INFO(ep_ids);

View File

@ -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);

View File

@ -224,3 +224,4 @@ static driver_t fdc_driver = {
};
DRIVER_MODULE(fdc, isa, fdc_driver, fdc_devclass, 0, 0);
ISA_PNP_INFO(fdc_ids);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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, int *but)
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);

View File

@ -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);

View File

@ -106,7 +106,6 @@ SYSCTL_INT(_hw_pcic, OID_AUTO, pd6722_vsense, CTLFLAG_RDTUN,
#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);

View File

@ -274,3 +274,4 @@ ppc_isa_write(device_t dev, char *buf, int len, int how)
}
DRIVER_MODULE(ppc, isa, ppc_isa_driver, ppc_devclass, 0, 0);
ISA_PNP_INFO(lpc_ids);

View File

@ -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);

View File

@ -175,3 +175,4 @@ DRIVER_MODULE(sio, isa, sio_isa_driver, sio_devclass, 0, 0);
#ifndef COM_NO_ACPI
DRIVER_MODULE(sio, acpi, sio_isa_driver, sio_devclass, 0, 0);
#endif
ISA_PNP_INFO(sio_ids);

View File

@ -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);

View File

@ -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
*/