507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * CDDL HEADER START
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * The contents of this file are subject to the terms of the
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * Common Development and Distribution License (the "License").
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * You may not use this file except in compliance with the License.
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * See the License for the specific language governing permissions
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * and limitations under the License.
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * When distributing Covered Code, include this CDDL HEADER in each
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * If applicable, add the following below this CDDL HEADER, with the
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * fields enclosed by brackets "[]" replaced with your own identifying
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * information: Portions Copyright [yyyy] [name of copyright owner]
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * CDDL HEADER END
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * Copyright 1999 Sun Microsystems, Inc. All rights reserved.
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * Use is subject to license terms.
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf#pragma ident "%Z%%M% %I% %E% SMI"
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * Round up all allocations so that we can guarantee
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * long-long alignment. This is the same alignment
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * provided by kmem_alloc().
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * Private wrapper for gcmd_t
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * round up the size so the HBA private area is on a 8 byte boundary
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * Allocate a gcmd_t wrapper and HBA private area
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf gwp = kmem_zalloc(gwrap_len, (sleep ? KM_SLEEP : KM_NOSLEEP));
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf /* save the total length for the free function */
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * save the ptr to HBA private area and initialize all
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * the gcmd_t members and save
507c32411f3f101e90ca2120f042b5ee698ba1d5mlf * Free the gcmd_t wrapper and HBA private area