summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2015-12-11 05:27:56 +0000
committerimp <imp@FreeBSD.org>2015-12-11 05:27:56 +0000
commit77eac42e70f63160d6d267a51a880c804e5b20e7 (patch)
tree51c67d8f989abcf155937134d4d0168e42f113f9
parent870ecdf4d397cee51bc3827b3430ba890ffa6de7 (diff)
downloadFreeBSD-src-77eac42e70f63160d6d267a51a880c804e5b20e7.zip
FreeBSD-src-77eac42e70f63160d6d267a51a880c804e5b20e7.tar.gz
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
-rw-r--r--sys/dev/aic/aic_pccard.c1
-rw-r--r--sys/dev/an/if_an_pccard.c1
-rw-r--r--sys/dev/ata/ata-card.c1
-rw-r--r--sys/dev/cmx/cmx_pccard.c2
-rw-r--r--sys/dev/cs/if_cs_pccard.c2
-rw-r--r--sys/dev/ed/if_ed_pccard.c1
-rw-r--r--sys/dev/ep/if_ep_pccard.c1
-rw-r--r--sys/dev/ex/if_ex_pccard.c1
-rw-r--r--sys/dev/fdc/fdc_pccard.c1
-rw-r--r--sys/dev/fe/if_fe_pccard.c1
-rw-r--r--sys/dev/ncv/ncr53c500_pccard.c1
-rw-r--r--sys/dev/nsp/nsp_pccard.c1
-rw-r--r--sys/dev/pccard/pccardvar.h10
-rw-r--r--sys/dev/sn/if_sn_pccard.c1
-rw-r--r--sys/dev/snc/if_snc_pccard.c1
-rw-r--r--sys/dev/stg/tmc18c30_pccard.c1
-rw-r--r--sys/dev/uart/uart_bus_pccard.c6
-rw-r--r--sys/dev/wi/if_wi_pccard.c1
-rw-r--r--sys/dev/xe/if_xe_pccard.c1
-rw-r--r--sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c12
20 files changed, 39 insertions, 8 deletions
diff --git a/sys/dev/aic/aic_pccard.c b/sys/dev/aic/aic_pccard.c
index 31ba257..ef6dd9e 100644
--- a/sys/dev/aic/aic_pccard.c
+++ b/sys/dev/aic/aic_pccard.c
@@ -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);
diff --git a/sys/dev/an/if_an_pccard.c b/sys/dev/an/if_an_pccard.c
index e9485ea..6f26d7a 100644
--- a/sys/dev/an/if_an_pccard.c
+++ b/sys/dev/an/if_an_pccard.c
@@ -108,6 +108,7 @@ static const struct pccard_product an_pccard_products[] = {
PCMCIA_CARD(XIRCOM, CWE1130),
{ NULL }
};
+PCCARD_PNP_INFO(an_pccard_products);
static int
an_pccard_probe(device_t dev)
diff --git a/sys/dev/ata/ata-card.c b/sys/dev/ata/ata-card.c
index 5346b8f..4b0a3d1 100644
--- a/sys/dev/ata/ata-card.c
+++ b/sys/dev/ata/ata-card.c
@@ -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);
diff --git a/sys/dev/cmx/cmx_pccard.c b/sys/dev/cmx/cmx_pccard.c
index 32c4872..ebb57cc 100644
--- a/sys/dev/cmx/cmx_pccard.c
+++ b/sys/dev/cmx/cmx_pccard.c
@@ -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);
diff --git a/sys/dev/cs/if_cs_pccard.c b/sys/dev/cs/if_cs_pccard.c
index 575d7f0..645fbdd 100644
--- a/sys/dev/cs/if_cs_pccard.c
+++ b/sys/dev/cs/if_cs_pccard.c
@@ -56,6 +56,7 @@ static const struct pccard_product cs_pccard_products[] = {
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);
diff --git a/sys/dev/ed/if_ed_pccard.c b/sys/dev/ed/if_ed_pccard.c
index 505aff6..07cf892 100644
--- a/sys/dev/ed/if_ed_pccard.c
+++ b/sys/dev/ed/if_ed_pccard.c
@@ -1248,3 +1248,4 @@ DRIVER_MODULE(ed, pccard, ed_pccard_driver, ed_devclass, 0, NULL);
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);
diff --git a/sys/dev/ep/if_ep_pccard.c b/sys/dev/ep/if_ep_pccard.c
index 1b445f9..e0e680c 100644
--- a/sys/dev/ep/if_ep_pccard.c
+++ b/sys/dev/ep/if_ep_pccard.c
@@ -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);
diff --git a/sys/dev/ex/if_ex_pccard.c b/sys/dev/ex/if_ex_pccard.c
index 39fd6f6..6d13a72 100644
--- a/sys/dev/ex/if_ex_pccard.c
+++ b/sys/dev/ex/if_ex_pccard.c
@@ -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);
diff --git a/sys/dev/fdc/fdc_pccard.c b/sys/dev/fdc/fdc_pccard.c
index d959060..6197dcd 100644
--- a/sys/dev/fdc/fdc_pccard.c
+++ b/sys/dev/fdc/fdc_pccard.c
@@ -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);
diff --git a/sys/dev/fe/if_fe_pccard.c b/sys/dev/fe/if_fe_pccard.c
index b7c644e..41f7e18 100644
--- a/sys/dev/fe/if_fe_pccard.c
+++ b/sys/dev/fe/if_fe_pccard.c
@@ -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 *);
diff --git a/sys/dev/ncv/ncr53c500_pccard.c b/sys/dev/ncv/ncr53c500_pccard.c
index 23c207a..c3c997c 100644
--- a/sys/dev/ncv/ncr53c500_pccard.c
+++ b/sys/dev/ncv/ncr53c500_pccard.c
@@ -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)
diff --git a/sys/dev/nsp/nsp_pccard.c b/sys/dev/nsp/nsp_pccard.c
index a235c22..448836b 100644
--- a/sys/dev/nsp/nsp_pccard.c
+++ b/sys/dev/nsp/nsp_pccard.c
@@ -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)
diff --git a/sys/dev/pccard/pccardvar.h b/sys/dev/pccard/pccardvar.h
index bef4a7c..3bc27e3 100644
--- a/sys/dev/pccard/pccardvar.h
+++ b/sys/dev/pccard/pccardvar.h
@@ -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);
diff --git a/sys/dev/sn/if_sn_pccard.c b/sys/dev/sn/if_sn_pccard.c
index 5c0d4ee..13f4862 100644
--- a/sys/dev/sn/if_sn_pccard.c
+++ b/sys/dev/sn/if_sn_pccard.c
@@ -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);
diff --git a/sys/dev/snc/if_snc_pccard.c b/sys/dev/snc/if_snc_pccard.c
index 552a11c..7f975be 100644
--- a/sys/dev/snc/if_snc_pccard.c
+++ b/sys/dev/snc/if_snc_pccard.c
@@ -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.
diff --git a/sys/dev/stg/tmc18c30_pccard.c b/sys/dev/stg/tmc18c30_pccard.c
index a10c001..56ddc24 100644
--- a/sys/dev/stg/tmc18c30_pccard.c
+++ b/sys/dev/stg/tmc18c30_pccard.c
@@ -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);
diff --git a/sys/dev/uart/uart_bus_pccard.c b/sys/dev/uart/uart_bus_pccard.c
index 0189a5f..edd3f29 100644
--- a/sys/dev/uart/uart_bus_pccard.c
+++ b/sys/dev/uart/uart_bus_pccard.c
@@ -55,6 +55,8 @@ static device_method_t uart_pccard_methods[] = {
{ 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);
diff --git a/sys/dev/wi/if_wi_pccard.c b/sys/dev/wi/if_wi_pccard.c
index 414dc20d..82c1680 100644
--- a/sys/dev/wi/if_wi_pccard.c
+++ b/sys/dev/wi/if_wi_pccard.c
@@ -153,6 +153,7 @@ static const struct pccard_product wi_pccard_products[] = {
PCMCIA_CARD(TDK, LAK_CD011WL),
{ NULL }
};
+PCCARD_PNP_INFO(wi_pccard_products);
static int
wi_pccard_probe(device_t dev)
diff --git a/sys/dev/xe/if_xe_pccard.c b/sys/dev/xe/if_xe_pccard.c
index 4db7c8e..bbe6253 100644
--- a/sys/dev/xe/if_xe_pccard.c
+++ b/sys/dev/xe/if_xe_pccard.c
@@ -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);
diff --git a/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c b/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c
index d7cff74..634eb54 100644
--- a/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c
+++ b/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c
@@ -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, void *data)
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);
OpenPOWER on IntegriCloud