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
3e5bc1d795e8c41f3680a71e3954e72d079ee46dReed * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Stuff strictly internal to fctl that
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * isn't exposed to any other modules.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define WWN_HASH_KEY(x) ((x)[0] + (x)[1] + (x)[2] +\
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define D_ID_HASH_FUNC(x, size) ((x) & (size - 1))
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Internally translated and used state change values to ULPs
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * port_dstate values
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define FCTL_DISALLOW_CALLBACKS(x) (!((x) & ULP_PORT_ATTACH) ||\
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Struct describing a remote node. A remote node is associated with one
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or more remote ports (fc_remote_port_t structs) that are all accessible
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * through one local port (fc_local_port_t struct).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Each fc_remote_node_t struct is also referenced by nwwn in the global
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * nwwn_hash_table[] list.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Mutex lock to protect access to all members of this struct.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Current implementation dictates acquisition of fd_mutex before
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pd_mutex can be acquired (when both locks must be acquired).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Node WWN for the remote node */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This is the number of (active) fc_remote_port_t structs that
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * are associated with this remote node.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Tracks whether this struct is "valid" or "invalid", using the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * FC_REMOTE_NODE_* values given above.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Linked list of remote ports associated with this remote node. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Stack depth for troubleshooting (only used in debug code)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The fc_remote_port_t struct represents a remote FC port that is
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * accessible via the local FC port (fc_local_port_t). Each remote
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * FC port is associated with one FC local port (fc_local_port_t,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * above) and one remote FC node (fc_remote_node_t, see below).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fc_remote_port_t structs are created and destroyed as needed to
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * correspond with changing conditions out on the link.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Ah, the infamous 'pd_mutex' that has given developers so much
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * joy over the years....
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * (Gotta love the original, extremely helpful comment.)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Reference count of the # of logins initiated by a ULP
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * (i.e., this is the # of ULPs accessing the struct). See
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fp_plogi_group() for more info.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This appears to track the login state of the remote FC port.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Used with the PORT_DEVICE_* macros in fc_appif.h.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Link pointers for the port wwn and D_ID hash lists. These point
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * to the next remote port in the current hash chain.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Link pointer for list of *all* fc_remote_port_t structs
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * associated with the same fc_local_port_t struct.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Pointer to the fc_remote_node_t struct for the remote node
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * associated with the remote port.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* port type for the remote port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Back pointer to the fc_local_port_t struct for the local port
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * associated with this remote port.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * (Sigh) this actually doesn't have anything to do with the "type"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * of the remote port per se. It's really more an indicator of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * most recently known state/status of the remote port. It's intended
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * to help figure out if/how the remote port has either gone away or
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * changed somehow after an event has occurred on the link.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * There also seems to be some connection to the "changed map".
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The legal values for this are the PORT_DEVICE_* definitions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * earlier in this file.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This tracks the current state/status of a login attempt at the
3e5bc1d795e8c41f3680a71e3954e72d079ee46dReed * remote port. Legal values are given above.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See also the pd_state field.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Legal values are given above (beware of the mipselling) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* This is _SO_ private that even we don't use it */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This is a count of the number of references to (or holds on)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * this remote port.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Re-login disable for FCP-2 error recovery. This is intended to
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * help with tape devices when an RSCN or Link Reset occurs during
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * a long write operations (like backup). fp's default action is
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * to try to log in again, but that forces a rewind on the LUN
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and corrupts its state.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The legal bit values are given below. Some specific definitions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * are as follows:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * PD_IN_DID_QUEUE: The fc_remote_port_t is present in the d_id
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * hash list of the associated fc_local_port_t. (This
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * is apparently meant to cover some races).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * PD_LOGGED_OUT: This is a directive to ignore the NORELOGIN if
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * an actual logout occurred
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Count of the # of unsolicited LOGOs received. See the definition
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * of FC_LOGO_TOLERANCE_LIMIT in fp.c.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Structs for the global nwwn_hash_table[] entries.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * At _init() time, fctl allocates an array of fctl_nwwn_list_t structs that
3e5bc1d795e8c41f3680a71e3954e72d079ee46dReed * has nwwn_table_size entries. The hash_head member anchors a linked
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * list of fctl_nwwn_elem_t structs that are linked via the fne_next pointer.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Each fctl_nwwn_elem_t also contains a pointer to one fc_remote_node_t struct.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Values for the fd_flags field in the fc_remote_node_t struct.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Note, the code seems to rely on the struct initialization using
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * kmem_zalloc() to set all the bits to zero, since FC_REMOTE_NODE_INVALID
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * is never explicitly set anywhere.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Values for the pd_flags field in the fc_remote_port_t struct. These
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * are used in a _lot_ of places. NOTE: these are values, not bit flags.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Bit values for the pd_aux_flags field in the fc_remote_port_t struct.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PD_IN_DID_QUEUE 0x01 /* The fc_remote_port_t is present */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* in the D_ID hash list of the */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* associated fc_local_port_t. (This */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* is apparently meant to narrow */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* some race windows). */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PD_LOGGED_OUT 0x08 /* This is a directive to ignore */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* the NORELOGIN if an actual logout */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* occurred */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define PD_GIVEN_TO_ULPS 0x10 /* A reference to this pd has been */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* given to one or more ULPs. */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Values for the pd_recepient field in the fc_remote_port_t struct.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Tries to describe where a PLOGI attempt originated.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The fc_local_port_t struct represents a local FC port. It is the softstate
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * struct for each fp instance, so it comes into existence at DDI_ATTACH
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and is deleted during DDI_DETACH.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Mutex to protect certain data fields in this struct.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fp_state sort of tracks the state of the link at the local port.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The actual 'state' is kept in the lower byte, and the port speed
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * is kept in the next most significant byte. The code makes
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * extensive use of the FC_PORT_SPEED_MASK() and FC_PORT_STATE_MASK()
3e5bc1d795e8c41f3680a71e3954e72d079ee46dReed * macros to separate these two items. The current link topology
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * is actually kept separately in the fp_topology field.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The legal values for fp_state are given above.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The S_ID for the local port. See fc_types.h for the fc_portid_t
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * definition.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Opaque reference handle for the local port device. This value
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * is supplied by the FCA driver and is passed unaltered to
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * various FCA driver entry point functions.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Entry point vectors for the FCA driver at this FC port */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fp's homegrown "job" threading mechanism (not a Solaris DDI taskq).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Head/tail pointers for a linked list of requests to be executed
3e5bc1d795e8c41f3680a71e3954e72d079ee46dReed * in a driver-private thread. One thread per fc_local_port_t struct.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The thread is created during DDI_ATTACH for the instance.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Current port topology. Uses the FC_TOP_* values defined in
3e5bc1d795e8c41f3680a71e3954e72d079ee46dReed * fc_appif.h. This is used with the FC_IS_TOP_SWITCH() macro and
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * is also used with the FC_TOP_EXTERNAL() macro in the ULPs.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The fp_task and fp_last_task fields are used mainly in the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fp_job_handler() function. These are used to indicate when a job
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * is executing. They also allow a second job to be issued while
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the current job is still in progress, but only one level of nesting
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * is permitted.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The legal values for these fields are given in fp.h
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This should not be confused with the Solaris DDI taskq mechanism,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * altho also fp makes use of that in some places (just to keep life
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * interesting).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fp_soft_state actually tracks the progression of the fp driver
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * in various code paths, particularly in attach, detach, suspend,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * resume, and state change callbacks.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The values for this are defined in fc_portif.h.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This is sometimes used in conjunction with the fp_statec_busy
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * field (see below), but there is no direct, 1-to-1 correlation
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * in how these are used together.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Software restoration bit fields for (PM)SUSPEND/(PM)RESUME (??)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Legal values are FP_RESTORE_* in fp.h
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Open/Close bit flags. Used in fp_open(), fp_close(), fp_ioctl()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and fp_fciocmd(). See fp.h for legal values.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t fp_sym_port_namelen; /* Symb port name len */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Base pointer for hash table of fc_remote_port_t structs (remote
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ports) accessible thru the local port. The table is hashed by
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the D_ID of the remote port.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Base pointer for hash table of fc_remote_port_t structs (remote
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * ports) accessible thru the local port. The table is hashed by
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * the port WWN of the remote port.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fp_statec_busy tracks the progression of state change
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * callbacks within the fp driver. It follows unsolicited callbacks
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and things like the port startup which happens during the attach.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The value increments when a state change is active and decrements
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * when it completes.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The benefit of this is that we should be processing only the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * latest state change and drop the existing one. Coalescing of
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * multiple outstanding state changes is NOT performed.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This is accessed in many places in the code, and also is buried
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * in some macros (see fp_soft_state above).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * IMPORTANT: The code currently permits nested state changes,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and there is no limitation on the allowed level of nesting.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct fp_cmd *fp_els_resp_pkt; /* ready response pkt */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Flag to indicate whether or not the ULP attach is in progress. Used
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * to synchronize execution of various functions. Seems intended to
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * have a value of either zero or one.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Another "busy/not busy" flag. Value is either 0 or 1.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This is the "state" of the link on the local port, as reported
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * by the underlying FCA driver at bind time. This uses the same
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * values as fp_state above, including FC_STATE_OFFLINE, FC_STATE_LOOP,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and FC_PORT_STATE_MASK(port->fp_bind_state).
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Bit field of various parameterized behaviors for the local port.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CAUTION: there is also an fp global variable called "fp_options"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * that is used to initialize this field during DDI_ATTACH.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Apparently intended to facilitate reporting the FC_HBA type
3e5bc1d795e8c41f3680a71e3954e72d079ee46dReed * for the local port. Legal values are in fcgs2.h. The
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fc_porttype_t typedef is in fc_types.h
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CV to inform fp "job" thread that there is work to do.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See fp_job_handler() function.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Apparently intended to prevent race conditions by holding off any
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * DDI_DETACHes for the local port while a ULP attach is in progress.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Save up the devinfo pointers from Solaris, for performing
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * pm_raise_power(), pm_busy_component(), and other DDI friends.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* This is a real Solaris DDI taskq (not the fp "job" queue) */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte timeout_id_t fp_offline_tid; /* Offline timeout ID */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte la_els_logi_t fp_service_params; /* service parameters */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc_reset_action_t fp_reset_action; /* FCA reset behavior */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte fc_dma_behavior_t fp_dma_behavior; /* FCA DMA behavior */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uchar_t fp_sym_node_namelen; /* Sym node name len */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct fc_orphan *fp_orphan_list; /* orphan list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Current PM power level of the local port device. Values
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * are given in fc_portif.h
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* Increment/decrement in fctl_busy_port() and fctl_idle_port() */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Opaque data for CALLB_CPR_* macros used by the per-local-port
3e5bc1d795e8c41f3680a71e3954e72d079ee46dReed * job thread. Required for safe thread shutdown during PM operations.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* T11 FC-HBA data */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Struct for the d_id hash table in the fc_local_port_t struct. The code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * allocates memory for an array of D_ID_HASH_TABLE_SIZE elements at
3e5bc1d795e8c41f3680a71e3954e72d079ee46dReed * attach time. The array pointer is saved at the fp_did_table member
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * in the fc_local_port_t struct.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Each hash chain is a singly-linked list of fc_remote_port_t
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * structs, using the pd_did_hnext pointer in the fc_remote_port_t struct.
3e5bc1d795e8c41f3680a71e3954e72d079ee46dReed struct fc_remote_port *d_id_head; /* Head of linked list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Struct for the pwwn hash table in the fc_local_port_t struct. The code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * allocates memory for an array of PWWN_HASH_TABLE_SIZE elements at
3e5bc1d795e8c41f3680a71e3954e72d079ee46dReed * attach time. The array pointer is saved at the fp_pwwn_table member
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * in the fc_local_port_t struct.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Each hash chain is a singly-linked list of fc_remote_port_t
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * structs, using the pd_wwn_hnext pointer in the fc_remote_port_t struct.
3e5bc1d795e8c41f3680a71e3954e72d079ee46dReed struct fc_remote_port *pwwn_head; /* Head of linked list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Function prototypes */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefctl_findchild(dev_info_t *pdip, char *cname, char *caddr);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte dev_info_t *phydip, char *nwwn, char *pwwn, uint32_t *vindex);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int fctl_fca_bus_ctl(dev_info_t *fca_dip, dev_info_t *rip,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int fctl_initchild(dev_info_t *fca_dip, dev_info_t *port_dip);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int fctl_uninitchild(dev_info_t *fca_dip, dev_info_t *port_dip);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int fctl_cache_constructor(void *buf, void *cdarg, int size);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void fctl_cache_destructor(void *buf, void *cdarg);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int fctl_pre_attach(fc_ulp_ports_t *ulp_port, fc_attach_cmd_t cmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void fctl_post_attach(fc_ulp_module_t *mod, fc_ulp_ports_t *ulp_port,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int fctl_pre_detach(fc_ulp_ports_t *ulp_port, fc_detach_cmd_t cmd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void fctl_post_detach(fc_ulp_module_t *mod, fc_ulp_ports_t *ulp_port,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic fc_ulp_ports_t *fctl_add_ulp_port(fc_ulp_module_t *ulp_module,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic fc_ulp_ports_t *fctl_alloc_ulp_port(int sleep);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int fctl_remove_ulp_port(struct ulp_module *ulp_module,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void fctl_dealloc_ulp_port(fc_ulp_ports_t *next);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic fc_ulp_ports_t *fctl_get_ulp_port(struct ulp_module *ulp_module,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int fctl_update_host_ns_values(fc_local_port_t *port,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int fctl_retrieve_host_ns_values(fc_local_port_t *port,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void fctl_print_if_not_orphan(fc_local_port_t *port,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void fctl_link_reset_done(opaque_t port_handle, uchar_t result);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int fctl_error(int fc_errno, char **errmsg);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int fctl_pkt_error(fc_packet_t *pkt, char **state, char **reason,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void fctl_check_alpa_list(fc_local_port_t *port, fc_remote_port_t *pd);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic int fctl_is_alpa_present(fc_local_port_t *port, uchar_t alpa);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void fc_trace_freemsg(fc_trace_logq_t *logq);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void fctl_init_dma_attr(fc_local_port_t *port, fc_ulp_module_t *mod,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefc_local_port_t *fc_get_npiv_port(fc_local_port_t *phyport, la_wwn_t *pwwn);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortefc_local_port_t *fc_delete_npiv_port(fc_local_port_t *phyport, la_wwn_t *pwwn);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _FCTL_PRIVATE_H */