disk.c revision aed5247ff899ec457005d93dfbdb4ffd74574695
184cd04c26b064536977dfbb913a1240eaf6f708cth * CDDL HEADER START
184cd04c26b064536977dfbb913a1240eaf6f708cth * The contents of this file are subject to the terms of the
184cd04c26b064536977dfbb913a1240eaf6f708cth * Common Development and Distribution License (the "License").
184cd04c26b064536977dfbb913a1240eaf6f708cth * You may not use this file except in compliance with the License.
184cd04c26b064536977dfbb913a1240eaf6f708cth * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
184cd04c26b064536977dfbb913a1240eaf6f708cth * See the License for the specific language governing permissions
184cd04c26b064536977dfbb913a1240eaf6f708cth * and limitations under the License.
184cd04c26b064536977dfbb913a1240eaf6f708cth * When distributing Covered Code, include this CDDL HEADER in each
184cd04c26b064536977dfbb913a1240eaf6f708cth * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
184cd04c26b064536977dfbb913a1240eaf6f708cth * If applicable, add the following below this CDDL HEADER, with the
184cd04c26b064536977dfbb913a1240eaf6f708cth * fields enclosed by brackets "[]" replaced with your own identifying
184cd04c26b064536977dfbb913a1240eaf6f708cth * information: Portions Copyright [yyyy] [name of copyright owner]
184cd04c26b064536977dfbb913a1240eaf6f708cth * CDDL HEADER END
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
aed5247ff899ec457005d93dfbdb4ffd74574695Joshua M. Clulow * Copyright (c) 2013, Joyent, Inc. All rights reserved.
184cd04c26b064536977dfbb913a1240eaf6f708cthstatic int disk_enum(topo_mod_t *, tnode_t *, const char *,
aed5247ff899ec457005d93dfbdb4ffd74574695Joshua M. Clulowdisk_declare_driver(topo_mod_t *mod, tnode_t *baynode, topo_list_t *dlistp,
aed5247ff899ec457005d93dfbdb4ffd74574695Joshua M. Clulow if ((err = disk_mptsas_find_disk(mod, baynode,
aed5247ff899ec457005d93dfbdb4ffd74574695Joshua M. Clulow err = disk_declare_addr(mod, baynode, dlistp,
aed5247ff899ec457005d93dfbdb4ffd74574695Joshua M. Clulow topo_mod_dprintf(mod, "unknown disk driver '%s'\n", driver);
184cd04c26b064536977dfbb913a1240eaf6f708cth/*ARGSUSED*/
602ca9ea8f9ce0933f0944601cc5d230e91a950dcth const char *name, topo_instance_t min, topo_instance_t max,
184cd04c26b064536977dfbb913a1240eaf6f708cth return (-1);
602ca9ea8f9ce0933f0944601cc5d230e91a950dcth /* set the parent fru */
184cd04c26b064536977dfbb913a1240eaf6f708cth return (-1);
602ca9ea8f9ce0933f0944601cc5d230e91a950dcth return (-1);
aed5247ff899ec457005d93dfbdb4ffd74574695Joshua M. Clulow * For internal storage, first check to see if we need to
aed5247ff899ec457005d93dfbdb4ffd74574695Joshua M. Clulow * request more detail from an HBA driver.
aed5247ff899ec457005d93dfbdb4ffd74574695Joshua M. Clulow if (topo_prop_get_string(baynode, TOPO_PGROUP_BINDING,
aed5247ff899ec457005d93dfbdb4ffd74574695Joshua M. Clulow TOPO_BINDING_DRIVER, &driver, &err) == 0) {
aed5247ff899ec457005d93dfbdb4ffd74574695Joshua M. Clulow err = disk_declare_driver(mod, baynode, dlistp, driver);
602ca9ea8f9ce0933f0944601cc5d230e91a950dcth * For internal storage, get the path to the occupant from the
602ca9ea8f9ce0933f0944601cc5d230e91a950dcth * binding group of the bay node
602ca9ea8f9ce0933f0944601cc5d230e91a950dcth return (-1);
602ca9ea8f9ce0933f0944601cc5d230e91a950dcth /* locate and topo enumerate the disk with that path */
184cd04c26b064536977dfbb913a1240eaf6f708cth/*ARGSUSED*/
184cd04c26b064536977dfbb913a1240eaf6f708cth * Turn on module debugging output
184cd04c26b064536977dfbb913a1240eaf6f708cth if (topo_mod_register(mod, &disk_info, TOPO_VERSION) != 0) {
602ca9ea8f9ce0933f0944601cc5d230e91a950dcth "%s registration failed: %s\n", DISK, topo_mod_errmsg(mod));
602ca9ea8f9ce0933f0944601cc5d230e91a950dcth if ((dlistp = topo_mod_zalloc(mod, sizeof (topo_list_t))) == NULL) {
602ca9ea8f9ce0933f0944601cc5d230e91a950dcth "disk list");
184cd04c26b064536977dfbb913a1240eaf6f708cth return (-1);
602ca9ea8f9ce0933f0944601cc5d230e91a950dcth "failed to locate disks");
184cd04c26b064536977dfbb913a1240eaf6f708cth return (-1);
184cd04c26b064536977dfbb913a1240eaf6f708cth return (0);