diff options
author | marcel <marcel@FreeBSD.org> | 2003-09-26 04:44:55 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-09-26 04:44:55 +0000 |
commit | 728398b5c5d3b44e6f1c8ebecd6451c79b042c1a (patch) | |
tree | 34429ee66a42f9c49e7dcea5f498f88dcfbb04f7 /sys/dev/puc | |
parent | 1e9a7a2d2d4ca5fce37c54a0da58fc3beb992266 (diff) | |
download | FreeBSD-src-728398b5c5d3b44e6f1c8ebecd6451c79b042c1a.zip FreeBSD-src-728398b5c5d3b44e6f1c8ebecd6451c79b042c1a.tar.gz |
Make the port number available to the sub-device with PUC_IVAR_PORT.
Diffstat (limited to 'sys/dev/puc')
-rw-r--r-- | sys/dev/puc/puc.c | 11 | ||||
-rw-r--r-- | sys/dev/puc/pucvar.h | 3 |
2 files changed, 10 insertions, 4 deletions
diff --git a/sys/dev/puc/puc.c b/sys/dev/puc/puc.c index 8ba17b1..3703ae3 100644 --- a/sys/dev/puc/puc.c +++ b/sys/dev/puc/puc.c @@ -105,9 +105,10 @@ __FBSDID("$FreeBSD$"); struct puc_device { struct resource_list resources; + int port; + int regshft; u_int serialfreq; u_int subtype; - int regshft; }; static void puc_intr(void *arg); @@ -331,6 +332,7 @@ puc_attach(device_t dev, const struct puc_device_description *desc) &rle->res->r_bushandle); } + pdev->port = i + 1; pdev->serialfreq = sc->sc_desc.ports[i].serialfreq; pdev->subtype = sc->sc_desc.ports[i].type & PUC_PORT_SUBTYPE_MASK; @@ -598,12 +600,15 @@ puc_read_ivar(device_t dev, device_t child, int index, uintptr_t *result) case PUC_IVAR_FREQ: *result = pdev->serialfreq; break; - case PUC_IVAR_SUBTYPE: - *result = pdev->subtype; + case PUC_IVAR_PORT: + *result = pdev->port; break; case PUC_IVAR_REGSHFT: *result = pdev->regshft; break; + case PUC_IVAR_SUBTYPE: + *result = pdev->subtype; + break; default: return (ENOENT); } diff --git a/sys/dev/puc/pucvar.h b/sys/dev/puc/pucvar.h index 3415c89..4ea07dc 100644 --- a/sys/dev/puc/pucvar.h +++ b/sys/dev/puc/pucvar.h @@ -116,7 +116,8 @@ struct puc_device_description { enum puc_device_ivars { PUC_IVAR_FREQ, PUC_IVAR_SUBTYPE, - PUC_IVAR_REGSHFT + PUC_IVAR_REGSHFT, + PUC_IVAR_PORT }; #ifdef PUC_ENTRAILS |