isns_dd.h revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct matrix {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* uint32_t *z; */ /* obsoleted- map between uid & mid */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define MATRIX_X_INFO(X) (X[0])
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define SIZEOF_X_UNIT(M) (((M)->x + MATRIX_X_HEADER) * sizeof (bmp_t))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define MATRIX_X_UNIT(M, N) &(M)->m[(N) * ((M)->x + MATRIX_X_HEADER)]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NUM_OF_MEMBER(M) ((M)->x * sizeof (bmp_t) * 8)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GET_PRIMARY(UID) (UID) / (sizeof (bmp_t) * 8)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GET_SECOND(UID) (UID) % (sizeof (bmp_t) * 8)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define COMP_UID(PRI, SND) ((PRI) * sizeof (bmp_t) * 8 + (SND))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (BMP)[(PRI) + MATRIX_X_HEADER] &= ~(0x1 << (SND))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte ((BMP)[(PRI) + MATRIX_X_HEADER] & (0x1 << (SEC)))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* functions */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint create_dd_object(isns_tlv_t *, uint16_t, isns_obj_t **);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint create_dds_object(isns_tlv_t *, uint16_t, isns_obj_t **);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint adm_create_dd(isns_obj_t **, uchar_t *, uint32_t, uint32_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint adm_create_dds(isns_obj_t **, uchar_t *, uint32_t, uint32_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint update_dd_name(uint32_t, uint32_t, uchar_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint update_dds_name(uint32_t, uint32_t, uchar_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteuint32_t get_common_dd(uint32_t, uint32_t, uint32_t);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint get_dd_matrix(const uint32_t, bmp_t **, uint32_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint get_dds_matrix(const uint32_t, bmp_t **, uint32_t *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint cb_clone_attrs(void *, void *);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _ISNS_DD_H */