Date: Fri, 11 Dec 2015 05:27:56 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292079 - in head/sys: dev/aic dev/an dev/ata dev/cmx dev/cs dev/ed dev/ep dev/ex dev/fdc dev/fe dev/ncv dev/nsp dev/pccard dev/sn dev/snc dev/stg dev/uart dev/wi dev/xe netgraph/blueto... Message-ID: <201512110527.tBB5Ruiv011968@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Fri Dec 11 05:27:56 2015 New Revision: 292079 URL: https://svnweb.freebsd.org/changeset/base/292079 Log: Create a generic PCCARD_PNP_INFO from the MODULE_PNP_INFO building block. Use it in all the PNP drivers to export either the current PNP table. For uart, create a custom table and export it using MODULE_PNP_INFO since it's the only one that matches on function number. Differential Review: https://reviews.freebsd.org/D3461 Modified: head/sys/dev/aic/aic_pccard.c head/sys/dev/an/if_an_pccard.c head/sys/dev/ata/ata-card.c head/sys/dev/cmx/cmx_pccard.c head/sys/dev/cs/if_cs_pccard.c head/sys/dev/ed/if_ed_pccard.c head/sys/dev/ep/if_ep_pccard.c head/sys/dev/ex/if_ex_pccard.c head/sys/dev/fdc/fdc_pccard.c head/sys/dev/fe/if_fe_pccard.c head/sys/dev/ncv/ncr53c500_pccard.c head/sys/dev/nsp/nsp_pccard.c head/sys/dev/pccard/pccardvar.h head/sys/dev/sn/if_sn_pccard.c head/sys/dev/snc/if_snc_pccard.c head/sys/dev/stg/tmc18c30_pccard.c head/sys/dev/uart/uart_bus_pccard.c head/sys/dev/wi/if_wi_pccard.c head/sys/dev/xe/if_xe_pccard.c head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Modified: head/sys/dev/aic/aic_pccard.c ============================================================================== --- head/sys/dev/aic/aic_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/aic/aic_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -196,3 +196,4 @@ extern devclass_t aic_devclass; MODULE_DEPEND(aic, cam, 1,1,1); DRIVER_MODULE(aic, pccard, aic_pccard_driver, aic_devclass, 0, 0); +PCCARD_PNP_INFO(aic_pccard_products); Modified: head/sys/dev/an/if_an_pccard.c ============================================================================== --- head/sys/dev/an/if_an_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/an/if_an_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -108,6 +108,7 @@ static const struct pccard_product an_pc PCMCIA_CARD(XIRCOM, CWE1130), { NULL } }; +PCCARD_PNP_INFO(an_pccard_products); static int an_pccard_probe(device_t dev) Modified: head/sys/dev/ata/ata-card.c ============================================================================== --- head/sys/dev/ata/ata-card.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/ata/ata-card.c Fri Dec 11 05:27:56 2015 (r292079) @@ -183,3 +183,4 @@ static driver_t ata_pccard_driver = { DRIVER_MODULE(ata, pccard, ata_pccard_driver, ata_devclass, NULL, NULL); MODULE_DEPEND(ata, ata, 1, 1, 1); +PCCARD_PNP_INFO(ata_pccard_products); Modified: head/sys/dev/cmx/cmx_pccard.c ============================================================================== --- head/sys/dev/cmx/cmx_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/cmx/cmx_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -112,4 +112,4 @@ static driver_t cmx_pccard_driver = { }; DRIVER_MODULE(cmx, pccard, cmx_pccard_driver, cmx_devclass, 0, 0); - +PCCARD_PNP_INFO(cmx_pccard_products); Modified: head/sys/dev/cs/if_cs_pccard.c ============================================================================== --- head/sys/dev/cs/if_cs_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/cs/if_cs_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -56,6 +56,7 @@ static const struct pccard_product cs_pc PCMCIA_CARD(IBM, ETHERJET), { NULL } }; + static int cs_pccard_probe(device_t dev) { @@ -115,3 +116,4 @@ extern devclass_t cs_devclass; DRIVER_MODULE(cs, pccard, cs_pccard_driver, cs_devclass, 0, 0); MODULE_DEPEND(cs, ether, 1, 1, 1); +PCCARD_PNP_INFO(cs_pccard_products); Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/ed/if_ed_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -1248,3 +1248,4 @@ DRIVER_MODULE(ed, pccard, ed_pccard_driv DRIVER_MODULE(miibus, ed, miibus_driver, miibus_devclass, 0, NULL); MODULE_DEPEND(ed, miibus, 1, 1, 1); MODULE_DEPEND(ed, ether, 1, 1, 1); +PCCARD_PNP_INFO(ed_pccard_products); Modified: head/sys/dev/ep/if_ep_pccard.c ============================================================================== --- head/sys/dev/ep/if_ep_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/ep/if_ep_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -235,3 +235,4 @@ static driver_t ep_pccard_driver = { extern devclass_t ep_devclass; DRIVER_MODULE(ep, pccard, ep_pccard_driver, ep_devclass, 0, 0); +PCCARD_PNP_INFO(ep_pccard_products); Modified: head/sys/dev/ex/if_ex_pccard.c ============================================================================== --- head/sys/dev/ex/if_ex_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/ex/if_ex_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -228,3 +228,4 @@ static driver_t ex_pccard_driver = { DRIVER_MODULE(ex, pccard, ex_pccard_driver, ex_devclass, 0, 0); MODULE_DEPEND(ex, pccard, 1, 1, 1); +PCCARD_PNP_INFO(ex_pccard_products); Modified: head/sys/dev/fdc/fdc_pccard.c ============================================================================== --- head/sys/dev/fdc/fdc_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/fdc/fdc_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -139,3 +139,4 @@ static driver_t fdc_pccard_driver = { }; DRIVER_MODULE(fdc, pccard, fdc_pccard_driver, fdc_devclass, 0, 0); +PCCARD_PNP_INFO(fdc_pccard_products); Modified: head/sys/dev/fe/if_fe_pccard.c ============================================================================== --- head/sys/dev/fe/if_fe_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/fe/if_fe_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -145,6 +145,7 @@ static driver_t fe_pccard_driver = { DRIVER_MODULE(fe, pccard, fe_pccard_driver, fe_devclass, 0, 0); MODULE_DEPEND(fe, pccard, 1, 1, 1); +PCCARD_PNP_INFO(fe_pccard_products); static int fe_probe_mbh(device_t, const struct fe_pccard_product *); static int fe_probe_tdk(device_t, const struct fe_pccard_product *); Modified: head/sys/dev/ncv/ncr53c500_pccard.c ============================================================================== --- head/sys/dev/ncv/ncr53c500_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/ncv/ncr53c500_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -293,6 +293,7 @@ static devclass_t ncv_devclass; MODULE_DEPEND(ncv, scsi_low, 1, 1, 1); DRIVER_MODULE(ncv, pccard, ncv_pccard_driver, ncv_devclass, 0, 0); +PCCARD_PNP_INFO(ncv_pccard_products); static void ncv_card_unload(device_t devi) Modified: head/sys/dev/nsp/nsp_pccard.c ============================================================================== --- head/sys/dev/nsp/nsp_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/nsp/nsp_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -233,6 +233,7 @@ static devclass_t nsp_devclass; MODULE_DEPEND(nsp, scsi_low, 1, 1, 1); DRIVER_MODULE(nsp, pccard, nsp_pccard_driver, nsp_devclass, 0, 0); +PCCARD_PNP_INFO(nsp_pccard_products); static void nsp_card_unload(device_t devi) Modified: head/sys/dev/pccard/pccardvar.h ============================================================================== --- head/sys/dev/pccard/pccardvar.h Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/pccard/pccardvar.h Fri Dec 11 05:27:56 2015 (r292079) @@ -85,6 +85,16 @@ struct pccard_product { const char *pp_cis[4]; }; +/** + * Note: There's no cis3 or cis4 reported for NOMATCH / pnpinfo events for pccard + * It's unclear if we actually need that for automatic loading or not. These stirngs + * are informative, according to the standard, but I have a dim memory of using these + * strings to match things, though I can't find the example right now. + */ +#define PCCARD_PNP_DESCR "D:human;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])); \ + typedef int (*pccard_product_match_fn) (device_t dev, const struct pccard_product *ent, int vpfmatch); Modified: head/sys/dev/sn/if_sn_pccard.c ============================================================================== --- head/sys/dev/sn/if_sn_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/sn/if_sn_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -327,3 +327,4 @@ extern devclass_t sn_devclass; DRIVER_MODULE(sn, pccard, sn_pccard_driver, sn_devclass, 0, 0); MODULE_DEPEND(sn, ether, 1, 1, 1); +PCCARD_PNP_INFO(sn_pccard_products); Modified: head/sys/dev/snc/if_snc_pccard.c ============================================================================== --- head/sys/dev/snc/if_snc_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/snc/if_snc_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -92,6 +92,7 @@ static driver_t snc_pccard_driver = { DRIVER_MODULE(snc, pccard, snc_pccard_driver, snc_devclass, 0, 0); MODULE_DEPEND(snc, ether, 1, 1, 1); +PCCARD_PNP_INFO(snc_pccard_products); /* * snc_pccard_detach - detach this instance from the device. Modified: head/sys/dev/stg/tmc18c30_pccard.c ============================================================================== --- head/sys/dev/stg/tmc18c30_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/stg/tmc18c30_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -136,3 +136,4 @@ static driver_t stg_pccard_driver = { DRIVER_MODULE(stg, pccard, stg_pccard_driver, stg_devclass, 0, 0); MODULE_DEPEND(stg, scsi_low, 1, 1, 1); +PCCARD_PNP_INFO(stg_pccard_products); Modified: head/sys/dev/uart/uart_bus_pccard.c ============================================================================== --- head/sys/dev/uart/uart_bus_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/uart/uart_bus_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -55,6 +55,8 @@ static device_method_t uart_pccard_metho { 0, 0 } }; +static uint32_t uart_pccard_function = PCCARD_FUNCTION_SERIAL; + static driver_t uart_pccard_driver = { uart_driver_name, uart_pccard_methods, @@ -76,7 +78,7 @@ uart_pccard_probe(device_t dev) * some serial cards are better serviced by other drivers, so * allow other drivers to claim it, if they want. */ - if (fcn == PCCARD_FUNCTION_SERIAL) + if (fcn == uart_pccard_function) return (BUS_PROBE_GENERIC); return (ENXIO); @@ -98,3 +100,5 @@ uart_pccard_attach(device_t dev) } DRIVER_MODULE(uart, pccard, uart_pccard_driver, uart_devclass, 0, 0); +MODULE_PNP_INFO("U32:function_type;", pccard, uart, &uart_pccard_function, + sizeof(uart_pccard_function), 1); Modified: head/sys/dev/wi/if_wi_pccard.c ============================================================================== --- head/sys/dev/wi/if_wi_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/wi/if_wi_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -153,6 +153,7 @@ static const struct pccard_product wi_pc PCMCIA_CARD(TDK, LAK_CD011WL), { NULL } }; +PCCARD_PNP_INFO(wi_pccard_products); static int wi_pccard_probe(device_t dev) Modified: head/sys/dev/xe/if_xe_pccard.c ============================================================================== --- head/sys/dev/xe/if_xe_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/xe/if_xe_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -386,3 +386,4 @@ static driver_t xe_pccard_driver = { devclass_t xe_devclass; DRIVER_MODULE(xe, pccard, xe_pccard_driver, xe_devclass, 0, 0); +PCCARD_PNP_INFO(xe_pccard_products); Modified: head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c ============================================================================== --- head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -584,14 +584,14 @@ out: * PC Card (PCMCIA) probe routine */ +static struct pccard_product const bt3c_pccard_products[] = { + PCMCIA_CARD(3COM, 3CRWB609), + { NULL, } +}; + static int bt3c_pccard_probe(device_t dev) { - static struct pccard_product const bt3c_pccard_products[] = { - PCMCIA_CARD(3COM, 3CRWB609), - { NULL, } - }; - struct pccard_product const *pp = NULL; pp = pccard_product_lookup(dev, bt3c_pccard_products, @@ -1222,4 +1222,4 @@ bt3c_modevent(module_t mod, int event, v DRIVER_MODULE(bt3c, pccard, bt3c_pccard_driver, bt3c_devclass, bt3c_modevent,0); MODULE_VERSION(ng_bt3c, NG_BLUETOOTH_VERSION); MODULE_DEPEND(ng_bt3c, netgraph, NG_ABI_VERSION, NG_ABI_VERSION,NG_ABI_VERSION); - +PCCARD_PNP_INFO(bt3c_pccard_products);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512110527.tBB5Ruiv011968>