Date: Sat, 12 Aug 2006 23:39:38 GMT From: Kip Macy <kmacy@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 103738 for review Message-ID: <200608122339.k7CNdc5h000468@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=103738 Change 103738 by kmacy@kmacy_storage:sun4v_work_stable on 2006/08/12 23:39:16 probe the channel devices node which serves as a nexus for the virtual disk and virtual network Affected files ... .. //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/sun4v/vnex.c#2 edit Differences ... ==== //depot/projects/kmacy_sun4v_stable/src/sys/sun4v/sun4v/vnex.c#2 (text+ko) ==== @@ -53,6 +53,7 @@ #define SUN4V_REG_SPEC2CFG_HDL(x) ((x >> 32) & ~(0xfull << 28)) static device_probe_t vnex_probe; +static device_probe_t channex_probe; static device_attach_t vnex_attach; static bus_print_child_t vnex_print_child; static bus_add_child_t vnex_add_child; @@ -80,6 +81,62 @@ struct rman sc_mem_rman; }; +static device_method_t channex_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, channex_probe), + DEVMETHOD(device_attach, vnex_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface */ + DEVMETHOD(bus_print_child, vnex_print_child), + DEVMETHOD(bus_probe_nomatch, vnex_probe_nomatch), + DEVMETHOD(bus_read_ivar, bus_generic_read_ivar), + DEVMETHOD(bus_write_ivar, bus_generic_write_ivar), + DEVMETHOD(bus_add_child, vnex_add_child), + DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_setup_intr, vnex_setup_intr), + DEVMETHOD(bus_teardown_intr, vnex_teardown_intr), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_get_resource_list, vnex_get_resource_list), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, vnex_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + { 0, 0 } +}; + +static driver_t channex_driver = { + "channex", + channex_methods, + sizeof(struct vnex_softc), +}; + + +static devclass_t channex_devclass; +DRIVER_MODULE(channex, vnex, channex_driver, channex_devclass, 0, 0); + + +static int +channex_probe(device_t dev) +{ + if (strcmp(ofw_bus_get_name(dev), "channel-devices")) + return (ENXIO); + + device_set_desc(dev, "virtual channel devices"); + return (0); +} + static device_method_t vnex_methods[] = { /* Device interface */ DEVMETHOD(device_probe, vnex_probe), @@ -115,6 +172,7 @@ { 0, 0 } }; + static driver_t vnex_driver = { "vnex", vnex_methods, @@ -132,10 +190,11 @@ if (strcmp(ofw_bus_get_name(dev), "virtual-devices")) return (ENXIO); - device_set_desc(dev, "Open Firmware Virtual Nexus device"); + device_set_desc(dev, "virtual nexus device"); return (0); } + static int vnex_attach(device_t dev) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608122339.k7CNdc5h000468>