Date: Mon, 4 Sep 2006 04:02:54 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 105631 for review Message-ID: <200609040402.k8442sdY098167@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=105631 Change 105631 by kmacy@kmacy_storage:sun4v_work_stable on 2006/09/04 04:02:02 add support for obtaining a virtual device handle this allows us to query machine description node attributes for the device (local-mac-address, tx-ino, rx-ino) Affected files ... .. //depot/projects/kmacy_sun4v_stable/src/sys/conf/files.sun4v#4 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/include/cddl/mdesc.h#2 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/include/mdesc_bus.h#2 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/include/mdesc_bus_subr.h#2 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/mdesc/mdesc_bus_if.m#2 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/mdesc/mdesc_bus_subr.c#2 edit .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/mdesc/mdesc_vdevfindval.c#1 add Differences ... ==== //depot/projects/kmacy_sun4v_stable/src/sys/conf/files.sun4v#4 (text+ko) ==== @@ -112,4 +112,4 @@ sun4v/mdesc/mdesc_findname.c standard sun4v/mdesc/mdesc_nodecount.c standard sun4v/mdesc/mdesc_findnodeprop.c standard - +sun4v/mdesc/mdesc_vdevfindval.c standard ==== //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/include/cddl/mdesc.h#2 (text+ko) ==== @@ -177,6 +177,9 @@ #include <sys/malloc.h> extern int md_get_prop_alloc(md_t *, mde_cookie_t, char *, int, uint8_t **); +extern int md_vdev_find_val(device_t dev, char *namep, + uint64_t *valp); + MALLOC_DECLARE(M_MDPROP); extern void mdesc_init(void); ==== //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/include/mdesc_bus.h#2 (text+ko) ==== @@ -34,4 +34,11 @@ return (MDESC_BUS_GET_TYPE(device_get_parent(dev), dev)); } +static __inline uint64_t +mdesc_bus_get_handle(device_t dev) +{ + + return (MDESC_BUS_GET_HANDLE(device_get_parent(dev), dev)); +} + #endif /* !_MACHINE_MDESC_BUS_H_ */ ==== //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/include/mdesc_bus_subr.h#2 (text+ko) ==== @@ -14,5 +14,6 @@ mdesc_bus_get_compat_t mdesc_bus_gen_get_compat; mdesc_bus_get_name_t mdesc_bus_gen_get_name; mdesc_bus_get_type_t mdesc_bus_gen_get_type; +mdesc_bus_get_handle_t mdesc_bus_gen_get_handle; #endif /* !_MACHINE_MDESC_MDESC_BUS_SUBR_H_ */ ==== //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/mdesc/mdesc_bus_if.m#2 (text+ko) ==== @@ -82,6 +82,13 @@ return (NULL); } + + static uint64_t + mdesc_bus_default_get_handle(device_t bus, device_t dev) + { + + return (0); + } }; # Get the mdesc_bus_devinfo struct for the device dev on the bus. Used for bus @@ -113,3 +120,8 @@ device_t bus; device_t dev; } DEFAULT mdesc_bus_default_get_type; + +METHOD uint64_t get_handle { + device_t bus; + device_t dev; +} DEFAULT mdesc_bus_default_get_handle; ==== //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/mdesc/mdesc_bus_subr.c#2 (text+ko) ==== @@ -84,6 +84,21 @@ return (mbd->mbd_type); } +uint64_t +mdesc_bus_gen_get_handle(device_t bus, device_t dev) +{ + const struct mdesc_bus_devinfo *mbd; + + mbd = MDESC_BUS_GET_DEVINFO(bus, dev); + if (mbd == NULL) + return (0); + return (mbd->mbd_handle); +} + + + + +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200609040402.k8442sdY098167>