hermon_cmd.c revision 30e01c537fd78d139ff463ccb3ef064e7190f9a8
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Hermon Firmware Command Routines
*
* Implements all the routines necessary for allocating, posting, and
* freeing commands for the Hermon firmware. These routines manage a
* preallocated list of command mailboxes and provide interfaces to post
* each of the several dozen commands to the Hermon firmware.
*/
hermon_mbox_t **mb);
hermon_cmd_t **cmd_ptr);
/*
* hermon_cmd_post()
* Context: Can be called from interrupt or base context.
*
* The "cp_flags" field in cmdpost
* is used to determine whether to wait for an available
* outstanding command (if necessary) or to return error.
*/
int
{
/* Determine if we are going to spin until completion */
/* Write the command to the HCR */
do {
/* Check if there is an error status in hermon_write_hcr() */
if (status != HERMON_CMD_SUCCESS) {
/*
* If there is a HW error, call hermon_cmd_retry_ok()
* to check the side-effect of the operation retry.
*/
if ((retry_cnt == HCA_PIO_RETRY_CNT &&
hw_err == HCA_PIO_OK) ||
return (status);
}
/* Check if there is a transient internal error */
} else if (retry_cnt != HCA_PIO_RETRY_CNT) {
}
} else { /* "HERMON_CMD_SLEEP_NOSPIN" */
/* NOTE: Expect threads to be waiting in here */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/*
* Set status to "HERMON_CMD_INVALID_STATUS". It is
* appropriate to do this here without the "cmd_comp_lock"
* because this register is overloaded. Later it will be
* used to indicate - through a change from this invalid
* value to some other value - that the condition variable
* has been signaled. Once it has, status will then contain
* the _real_ completion status
*/
/* Write the command to the HCR */
do {
&hw_err);
/* Check if there is an error status in hermon_write_hcr() */
if (status != HERMON_CMD_SUCCESS) {
/*
* If there is a HW error, call hermon_cmd_retry_ok()
* to check the side-effect of the operation retry.
*/
if ((retry_cnt == HCA_PIO_RETRY_CNT &&
hw_err == HCA_PIO_OK) ||
return (status);
}
/* Check if there is a transient internal error */
} else if (retry_cnt2 != HCA_PIO_RETRY_CNT) {
}
/*
* cv_wait() on the "command_complete" condition variable.
* Note: We have the "__lock_lint" here to workaround warlock.
* Since warlock doesn't know that other parts of the Hermon
* may occasionally call this routine while holding their own
* locks, it complains about this cv_wait. In reality,
* however, the rest of the driver never calls this routine
* with a lock held unless they pass HERMON_CMD_NOSLEEP.
*/
#ifndef __lock_lint
/* NOTE: EXPECT SEVERAL THREADS TO BE WAITING HERE */
#endif
}
/*
* Wake up after command completes (cv_signal). Read status
* from the command (success, fail, etc.). It is appropriate
* here (as above) to read the status field without the
* "cmd_comp_lock" because it is no longer being used to
* indicate whether the condition variable has been signaled
* (i.e. at this point we are certain that it already has).
*/
/* retry the operation if an internal error occurs */
goto retry;
/* Save the "outparam" values into the cmdpost struct */
/*
* Add the command back to the "outstanding commands list".
* Signal the "cmd_list" condition variable, if necessary.
*/
/* Check if there is an error status in hermon_write_hcr() */
if (status != HERMON_CMD_SUCCESS) {
/*
* If there is a HW error, call hermon_cmd_retry_ok()
* to check the side-effect of the operation retry.
*/
if ((retry_cnt == HCA_PIO_RETRY_CNT &&
hw_err == HCA_PIO_OK) ||
"opcode (0x%x) status (0x%x)\n",
status);
return (status);
}
/* Check if there is a transient internal error */
} else if (retry_cnt != HCA_PIO_RETRY_CNT) {
}
}
return (HERMON_CMD_SUCCESS);
}
/*
* hermon_cmd_check_status()
* Context: Can be called from interrupt or base
*
* checks the status returned from write_hcr and does the right
* notice to the console, if any
*/
static void
{
switch (status) {
break;
case HERMON_CMD_TIMEOUT_GOBIT:
break;
case HERMON_CMD_INSUFF_RSRC:
break;
break;
case HERMON_CMD_INTERNAL_ERR:
break;
case HERMON_CMD_BAD_NVMEM:
/*
* No need of an ereport here since this case
* is treated as a degradation later.
*/
break;
default:
break;
}
}
/*
* hermon_mbox_alloc()
* Context: Can be called from interrupt or base context.
*
* The "mbox_wait" parameter is used to determine whether to
* wait for a mailbox to become available or not.
*/
int
{
int status;
/* Allocate an "In" mailbox */
/* Determine correct mboxlist based on calling context */
if (sleep_context == HERMON_NOSLEEP) {
} else {
/* NOTE: Expect threads to be waiting in here */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
}
}
/* Allocate an "Out" mailbox */
/* Determine correct mboxlist based on calling context */
if (sleep_context == HERMON_NOSLEEP) {
} else {
/* NOTE: Expect threads to be waiting in here */
if (status != HERMON_CMD_SUCCESS) {
/* If we allocated an "In" mailbox, free it */
if (mbox_info->mbi_alloc_flags &
}
return (status);
}
}
}
/* Store appropriate context in mbox_info */
return (HERMON_CMD_SUCCESS);
}
/*
* hermon_mbox_free()
* Context: Can be called from interrupt or base context.
*/
void
{
/*
* The mailbox has to be freed in the same context from which it was
* allocated. The context is stored in the mbox_info at
* hermon_mbox_alloc() time. We check the stored context against the
* current context here.
*/
/* Determine correct mboxlist based on calling context */
/* Free the intr "In" mailbox */
}
/* Free the intr "Out" mailbox */
}
} else {
/* Free the "In" mailbox */
}
/* Free the "Out" mailbox */
}
}
}
/*
* hermon_cmd_complete_handler()
* Context: Called only from interrupt context.
*/
int
{
if (eqe_evttype == HERMON_EVT_EQ_OVERFLOW) {
return (DDI_FAILURE);
}
/*
* Find the outstanding command pointer based on value returned
* in "token"
*/
/* Signal the waiting thread */
return (DDI_SUCCESS);
}
/*
* hermon_inmbox_list_init()
* Context: Only called from attach() path context
*/
int
{
int status;
/* Initialize the "In" mailbox list */
if (status != DDI_SUCCESS) {
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
/*
* hermon_intr_inmbox_list_init()
* Context: Only called from attach() path context
*/
int
{
int status;
/* Initialize the interrupt "In" mailbox list */
if (status != DDI_SUCCESS) {
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
/*
* hermon_outmbox_list_init()
* Context: Only called from attach() path context
*/
int
{
int status;
/* Initialize the "Out" mailbox list */
if (status != DDI_SUCCESS) {
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
/*
* hermon_intr_outmbox_list_init()
* Context: Only called from attach() path context
*/
int
{
int status;
/* Initialize the interrupts "Out" mailbox list */
if (status != DDI_SUCCESS) {
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
/*
* hermon_inmbox_list_fini()
*/
void
{
/* Free up the "In" mailbox list */
}
/*
* hermon_intr_inmbox_list_fini()
*/
void
{
/* Free up the interupts "In" mailbox list */
}
/*
* hermon_outmbox_list_fini()
*/
void
{
/* Free up the "Out" mailbox list */
}
/*
* hermon_intr_outmbox_list_fini()
*/
void
{
/* Free up the interrupt "Out" mailbox list */
}
/*
* hermon_impl_mbox_alloc()
* Context: Can be called from interrupt or base context.
*/
static int
{
/*
* If the mailbox list is empty, then wait (if appropriate in the
* current context). Otherwise, grab the next available mailbox.
*/
if (mbox_wait == HERMON_NOSLEEP) {
count = 0;
mblist->mbl_pollers++;
while (mblist->mbl_entries_free == 0) {
/* Delay loop polling for an available mbox */
return (HERMON_CMD_INSUFF_RSRC);
}
/* Delay before polling for mailbox again */
}
mblist->mbl_pollers--;
/* HERMON_SLEEP */
} else {
/*
* Grab lock here as we prepare to cv_wait if needed.
*/
while (mblist->mbl_entries_free == 0) {
/*
* Wait (on cv) for a mailbox to become free. Note:
* Just as we do above in hermon_cmd_post(), we also
* have the "__lock_lint" here to workaround warlock.
* Warlock doesn't know that other parts of the Hermon
* may occasionally call this routine while holding
* their own locks, so it complains about this cv_wait.
* In reality, however, the rest of the driver never
* calls this routine with a lock held unless they pass
* HERMON_CMD_NOSLEEP.
*/
mblist->mbl_waiters++;
#ifndef __lock_lint
#endif
}
}
/* Grab the next available mailbox from list */
/* Remove it from the mailbox list */
/* Update the "free" count and return the mailbox pointer */
return (HERMON_CMD_SUCCESS);
}
/*
* hermon_impl_mbox_free()
* Context: Can be called from interrupt or base context.
*/
static void
{
/* Pull the "index" from mailbox entry */
/*
* If mailbox list is not empty, then insert the entry. Otherwise,
* this is the only entry. So update the pointers appropriately.
*/
if (mblist->mbl_entries_free++ != 0) {
/* Update the current mailbox */
/* Update head and tail mailboxes */
/* Update tail index */
} else {
/* Update the current mailbox */
/* Update head and tail indexes */
}
/*
* Because we can have both waiters (SLEEP treads waiting for a
* cv_signal to continue processing) and pollers (NOSLEEP treads
* polling for a mailbox to become available), we try to share CPU time
* between them. We do this by signalling the waiters only every other
* call to mbox_free. This gives the pollers a chance to get some CPU
* time to do their command. If we signalled every time, the pollers
* would have a much harder time getting CPU time.
*
* If there are waiters and no pollers, then we signal always.
*
* Otherwise, if there are either no waiters, there may in fact be
* pollers, so we do not signal in that case.
*/
/* flip the signal value */
} else if (mblist->mbl_waiters > 0) {
} else {
mblist->mbl_signal = 0;
}
/*
* Depending on the conditions in the previous check, we signal only if
* we are supposed to.
*/
if (mblist->mbl_signal) {
mblist->mbl_waiters--;
}
/* Clear out the mailbox entry pointer */
}
/*
* hermon_impl_mboxlist_init()
* Context: Only called from attach() path context
*/
static int
{
int status, i;
/* Allocate the memory for the mailbox entries list */
sizeof (hermon_mbox_t), KM_SLEEP);
/* Initialize the mailbox entries list */
mblist->mbl_head_indx = 0;
mblist->mbl_waiters = 0;
mblist->mbl_num_alloc = 0;
/* Set up the mailbox list's cv and mutex */
/* Initialize the mailbox list entries */
for (i = 0; i < mblist->mbl_list_sz; i++) {
/* Allocate resources for the mailbox */
&rsrc);
if (status != DDI_SUCCESS) {
/* Jump to cleanup and return error */
goto mboxlist_init_fail;
}
/* Save away the mailbox resource info */
/*
* Get a PCI mapped address for each mailbox. Note: this
* uses the ddi_dma_handle return from the resource
* allocation routine
*/
if (status != DDI_SUCCESS) {
/* Jump to cleanup and return error */
goto mboxlist_init_fail;
}
/* Save away the mapped address for the mailbox */
/* Make each entry point to the "next" and "prev" entries */
}
/* Make the "head" and "tail" entries point to each other */
return (DDI_SUCCESS);
return (DDI_FAILURE);
}
/*
* hermon_impl_mboxlist_fini()
*/
static void
{
int i, status;
/* Release the resources for each of the mailbox list entries */
for (i = 0; i < mblist->mbl_num_alloc; i++) {
/*
* First, unbind the DMA memory for the mailbox
*
* Note: The only way ddi_dma_unbind_handle() currently
* can return an error is if the handle passed in is invalid.
* Since this should never happen, we choose to return void
* from this function! If this does return an error,
* however, then we print a warning message to the console.
*/
if (status != DDI_SUCCESS) {
return;
}
/* Next, free the mailbox resource */
}
/* Destroy the mailbox list mutex and cv */
/* Free up the memory for tracking the mailbox list */
sizeof (hermon_mbox_t));
}
/*
* hermon_outstanding_cmd_alloc()
* Context: Can be called only from base context.
*/
static int
{
/* Ensure that outstanding commands are supported */
/*
* If the outstanding command list is empty, then wait (if
* appropriate in the current context). Otherwise, grab the
* next available command.
*/
while (cmd_list->cml_entries_free == 0) {
/* No free commands */
if (cmd_wait == HERMON_NOSLEEP) {
return (HERMON_CMD_INSUFF_RSRC);
}
/*
* Wait (on cv) for a command to become free. Note: Just
* as we do above in hermon_cmd_post(), we also have the
* "__lock_lint" here to workaround warlock. Warlock doesn't
* know that other parts of the Hermon may occasionally call
* this routine while holding their own locks, so it complains
* about this cv_wait. In reality, however, the rest of the
* driver never calls this routine with a lock held unless
* they pass HERMON_CMD_NOSLEEP.
*/
cmd_list->cml_waiters++;
#ifndef __lock_lint
#endif
}
/* Grab the next available command from the list */
/* Remove it from the command list */
/* Update the "free" count and return */
return (HERMON_CMD_SUCCESS);
}
/*
* hermon_outstanding_cmd_free()
* Context: Can be called only from base context.
*/
static void
{
/* Pull the "index" from command entry */
/*
* If outstanding command list is not empty, then insert the entry.
* Otherwise, this is the only entry. So update the pointers
* appropriately.
*/
if (cmd_list->cml_entries_free++ != 0) {
/* Update the current command */
/* Update head and tail commands */
/* Update tail index */
} else {
/* Update the current command */
/* Update head and tail indexes */
}
/* If there are threads waiting, signal one of them */
if (cmd_list->cml_waiters > 0) {
cmd_list->cml_waiters--;
}
/* Clear out the command entry pointer */
}
/*
* hermon_write_hcr()
* Context: Can be called from interrupt or base context.
*/
static int
{
/* initialize the FMA retry loop */
/*
* Grab the "HCR access" lock if the driver is not in
* fastreboot. In fastreboot, this function is called
* with the single thread but in high interrupt context
* (so that this mutex lock cannot be used).
*/
#ifdef __lock_lint
#else
if (!HERMON_IN_FASTREBOOT(state)) {
}
#endif
/*
* First, check the "go" bit to see if any previous hcr usage is
* complete. As long as it is set then we must continue to poll.
*/
/* the FMA retry loop starts. */
fm_test);
count = 0;
for (;;) {
/* If "go" bit is clear and toggle reset, then done */
if (((hcrreg & HERMON_HCR_CMD_GO_MASK) == 0) &&
break;
}
/* Delay before polling the "go" bit again */
/*
* If we poll more than the maximum number of times, then
* return a "timeout" error.
*/
#ifdef __lock_lint
#else
if (!HERMON_IN_FASTREBOOT(state)) {
}
#endif
return (HERMON_CMD_TIMEOUT_GOBIT);
}
}
/* the FMA retry loop ends. */
fm_test);
/* check if there is a transient error */
if (fm_loop_cnt != HCA_PIO_RETRY_CNT) {
}
/* succeeded, so update the cmd counter for this cmd's completion */
state->hs_cmd_toggle++;
/* the FMA retry loop starts. */
fm_test);
/* Write "inparam" as a 64-bit quantity */
/* Write "inmod" and 32-bits of "outparam" as 64-bit */
/* Write the other 32-bits of "outparam" and "token" as 64-bit */
/* Then setup the final hcrreg to hit doorbell (i.e. "go" bit) */
/* Then set the toggle bit for this command */
}
/* Write the doorbell to the HCR */
/* the FMA retry loop ends. */
fm_test);
/* check if there is a transient error */
if (fm_loop_cnt != HCA_PIO_RETRY_CNT) {
}
/*
* In the SPIN case we read the HCR and check the "go" bit. For the
* NOSPIN case we do not have to poll, we simply release the HCR lock
* and return.
*/
/* the FMA retry loop starts. */
count = 0;
for (;;) {
/* If "go" bit is clear and toggle reset, then done */
if (((hcrreg & HERMON_HCR_CMD_GO_MASK) == 0) &&
break;
}
/* Delay before polling the "go" bit again */
/*
* If we poll more than the maximum number of times,
* then return a "timeout" error.
*/
#ifdef __lock_lint
#else
if (!HERMON_IN_FASTREBOOT(state)) {
mutex_exit(&state->
}
#endif
"write_hcr: cannot complete cmd");
return (HERMON_CMD_TIMEOUT_GOBIT);
}
}
/* Pull out the "status" bits from the HCR */
/*
* Read the "outparam" value. Note: we have to read "outparam"
* as two separate 32-bit reads because the field in the HCR is
* not 64-bit aligned.
*/
/* the FMA retry loop ends. */
fm_test);
/* check if there is a transient error */
if (fm_loop_cnt != HCA_PIO_RETRY_CNT) {
}
/* END SPIN */
} else { /* NOSPIN */
}
/* Drop the "HCR access" lock */
#ifdef __lock_lint
#else
if (!HERMON_IN_FASTREBOOT(state)) {
}
#endif
} else {
*hw_err = HCA_PIO_OK;
}
#ifdef FMA_TEST
if (hermon_test_num == -3) {
}
#endif
return (status);
#ifdef __lock_lint
#else
if (!HERMON_IN_FASTREBOOT(state)) {
}
#endif
return (HERMON_CMD_INVALID_STATUS);
}
/*
* hermon_outstanding_cmdlist_init()
* Context: Only called from attach() path context
*/
int
{
int i;
/*
* Determine the number of the outstanding commands supported
* by the Hermon device (obtained from the QUERY_FW command). Note:
* Because we handle both SLEEP and NOSLEEP cases around the hermon HCR,
* we know that when an interrupt comes in it will be next on the
* command register, and will at most have to wait one commands time.
* We do not have to reserve an outstanding command here for
* interrupts.
*/
/* Initialize the outstanding command list */
/* Allocate the memory for the outstanding command list */
if (num_outstanding_cmds) {
sizeof (hermon_cmd_t), KM_SLEEP);
}
/* Initialize the individual outstanding command list entries */
}
if (num_outstanding_cmds) {
}
return (DDI_SUCCESS);
}
/*
* hermon_outstanding_cmdlist_fini()
*/
void
{
int i;
/* Destroy the outstanding command list entries */
}
/* Destroy the lock (and cv) and free up memory for list */
}
}
/*
* hermon_mbox_sync()
*/
static void
{
int status;
/* Get the DMA handle from mailbox */
/* Calculate offset into mailbox */
if (status != DDI_SUCCESS) {
return;
}
}
/*
* hermon_init_hca_cmd_post()
* Context: Can be called from interrupt or base context.
* (Currently called only from attach() path context)
*/
int
{
int status, i;
/* Make sure we are called with the correct flag */
/* Get an "In" mailbox for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Copy the Hermon "INIT_HCA" command into the mailbox */
size = sizeof (hermon_hw_initqueryhca_t);
for (i = 0; i < (size >> 3); i++) {
}
/* Sync the mailbox for the device to read */
/* Setup and post the Hermon "INIT_HCA" command */
cmd.cp_outparm = 0;
/* Free the mailbox */
return (status);
}
/*
* hermon_close_hca_cmd_post()
* Context: Can be called from interrupt or base context.
*/
int
{
int status;
/* Make sure we are called with the correct flag */
/* Setup and post the Hermon "CLOSE_HCA" command */
cmd.cp_outparm = 0;
return (status);
}
/*
* hermon_set_port_cmd_post()
* Context: Can be called from interrupt or base context.
* (Currently called only from attach() path context)
*/
int
{
int status, i;
/* Get an "In" mailbox for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Copy the Hermon "INIT_PORT" command into the mailbox */
size = sizeof (hermon_hw_set_port_t);
for (i = 0; i < (size >> 3); i++) {
}
/* Sync the mailbox for the device to read */
/* Setup and post the Hermon "SET_PORT" command */
cmd.cp_outparm = 0;
/* Free the mailbox */
return (status);
}
/*
* hermon_init_port_cmd_post()
* Context: Can be called from interrupt or base context.
*/
int
{
int status;
/* Setup and post the Hermon "INIT_PORT" command */
cmd.cp_outparm = 0;
return (status);
}
/*
* hermon_close_port_cmd_post()
* Context: Can be called from interrupt or base context.
*/
int
{
int status;
/* Setup and post the Hermon "CLOSE_PORT" command */
cmd.cp_outparm = 0;
return (status);
}
/*
* hermon_mod_stat_cfg_cmd_post()
* Context: Can be called only from attach() path
*
* This routine was initially implemented to enable SRQ. That's no longer needed
* in hermon, and the code is conditionally compiled OUT, but left here because
* there are other static configuration parameters we might one day want to set
*/
#ifdef HERMON_NO_MOD_STAT_CFG
int
{
int status, i;
/*
* "MOD_STAT_CFG" needs an INMBOX parameter, to specify what operations
* to do. However, at the point in time that we call this command, the
* DDR has not yet been initialized, and all INMBOX'es are located in
* DDR. Because we want to call MOD_STAT_CFG before QUERY_DEVLIM is
* called, and thus call it before DDR is setup, we simply use an
* OUTMBOX memory location here as our INMBOX parameter.
*/
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/*
* Allocate on the heap our 'mod_stat_cfg' structure. We want to
* ideally move all of this on to the stack in the future, but this
* works well for now.
*/
sizeof (hermon_hw_mod_stat_cfg_t), KM_SLEEP);
/* Setup "MOD_STAT_CFG" settings */
/* use DEV_LIMS num srq */
} else {
mod->log_max_srq = 0;
}
/* Copy the "MOD_STAT_CFG" command into the "In" mailbox */
size = sizeof (hermon_hw_mod_stat_cfg_t);
for (i = 0; i < (size >> 3); i++) {
}
/* Sync the mailbox for the device to read */
/* Setup and post the Hermon "MOD_STAT_CFG" command */
cmd.cp_outparm = 0;
/* Free "MOD_STAT_CFG" struct */
/* Free the mailbox */
return (status);
}
#endif
/*
* hermon_map_cmd_post()
* Context: Can be called only from attach() path
*
* Generic routine to map FW, ICMA, and ICM.
*/
int
{
int status, i, j, k = 0;
int max_mailbox_size;
int cookie_num_icm_pages;
int num_vpm_entries;
int log2_npages;
int npages;
/* Allocate an IN mailbox */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Initialize cmd parameters */
cmd.cp_outparm = 0;
/*
* Allocate a list of VPM (Virtual Physical Mapping) structures.
* A VPM encodes a power-of-2 number of DMA pages that have been
* allocated and are passed in the dma_info. We need to break up
* the DMA cookies that are in the dma_info into power-of-2 page
* mappings. We also need to keep track of the number of VPMs we
* have total, as it is used as the inmod for this command.
*/
/* Start with the ICM address passed and the first cookie */
/* Initialize the VPM count and the VPM struct */
num_vpm_entries = 0;
size = sizeof (hermon_hw_vpm_t);
/*
* Establish a max mailbox size (in VPM entries). If we reach this,
* we must post a MAP command, reinitialzie num_vpm_entries, and
* continue.
*/
/*
* First, walk through the DMA cookies and build VPMs from them.
*/
while (ccount-- > 0) {
/* Determine the number of ICM pages in this cookie. */
/* Initialize this set of VPM's starting physical address. */
/*
* Now build a set of VPMs for this cookie's memory, breaking
* up the cookies into multiple VPMs if necessary to achieve
* the required power-of-2 number of pages per VPM. Once each
* VPM is constructed, write it out to the mailbox memory.
*/
for (i = cookie_num_icm_pages; i > 0; i -= npages) {
/* Ensure this chunk is aligned on it's own size */
log2_npages--;
}
/* Increment the paddr for the next VPM */
/* Increment the ICM address for the next VPM */
}
/*
* Copy this VPM into the "In" mailbox. Note we're
* using 'k' as the offset from mb_addr for this cmd.
*/
for (j = 0; j < (size >> 3); j++, k++) {
data);
}
/*
* Increment the number of VPM entries and check
* against max mailbox size. If we have reached
* the maximum mailbox size, post the map cmd.
*/
if (++num_vpm_entries == max_mailbox_size) {
/* Sync the mailbox for the device to read */
/* Setup and post the command */
if (status != HERMON_CMD_SUCCESS) {
"UNKNOWN", status);
goto map_fail;
}
/*
* Reinitialize num_vpm_entries, and the
* mb_addr offset
*/
num_vpm_entries = k = 0;
}
}
/* If count remains, move onto the next cookie */
if (ccount != 0) {
}
}
if (num_vpm_entries) {
/* Sync the mailbox for the device to read */
/* Setup and post the command */
if (status != HERMON_CMD_SUCCESS) {
"UNKNOWN", status);
goto map_fail;
}
}
/* Free the mailbox */
return (status);
}
/*
* hermon_unmap_fa_cmd_post()
* Context: Can be called only from attach() path
*/
int
{
int status;
/* Setup and post the Hermon "UNMAP_FA" command */
cmd.cp_outparm = 0;
return (status);
}
/*
* hermon_run_fw_cmd_post()
* Context: Can be called only from attach() path
*/
int
{
int status;
/* Setup and post the Hermon "RUN_FW" command */
cmd.cp_outparm = 0;
#ifdef FMA_TEST
if (hermon_test_num == -2) {
/*
* No need of an ereport here since this case
* is treated as a degradation later.
*/
}
#endif
return (status);
}
/*
* hermon_set_icm_size_cmd_post()
* Context: Can be called only from attach() path
*/
int
{
int status;
/* Setup and post the Hermon "SET_ICM_SIZE" command */
cmd.cp_outparm = 0;
/*
* Aux ICM size in 4K pages returned in output param
* convert it to bytes
*/
return (status);
}
/*
* hermon_unmap_icm_aux_cmd_post()
* Context: Can be called only from attach() path
*/
int
{
int status;
/* Setup and post the Hermon "UNMAP_ICM_AUX" command */
cmd.cp_outparm = 0;
return (status);
}
/*
* hermon_unmap_icm_cmd_post()
* Context: Can be called from base or attach context
*/
int
{
int status;
/*
* Setup and post the Hermon "UNMAP_ICM" command. If a
* hermon_dma_info_t was passed, we want to unmap a set
* of pages. Otherwise, unmap all of ICM.
*/
} else {
addr = 0;
}
/* Setup and post the Hermon "UNMAP_ICM" command */
cmd.cp_outparm = 0;
return (status);
}
/*
* hermon_mad_ifc_cmd_post()
* Context: Can be called from interrupt or base context.
*/
int
{
int status;
/* Get "In" and "Out" mailboxes for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Copy the request MAD into the "In" mailbox */
/* Sync the mailbox for the device to read */
/* Setup the Hermon "MAD_IFC" command */
if (status != HERMON_CMD_SUCCESS) {
goto mad_ifc_fail;
}
/* Sync the mailbox to read the results */
/* Copy the response MAD into "resp" */
/* Free the mailbox */
return (status);
}
/*
* hermon_getportinfo_cmd_post()
* Context: Can be called from interrupt or base context.
*/
int
{
int status, i;
/* Get "In" and "Out" mailboxes for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Build the GetPortInfo request MAD in the "In" mailbox */
}
/* Sync the mailbox for the device to read */
/* Setup the Hermon "MAD_IFC" command */
if (status != HERMON_CMD_SUCCESS) {
goto getportinfo_fail;
}
/* Sync the mailbox to read the results */
size = sizeof (sm_portinfo_t);
/*
* Copy GetPortInfo response MAD into "portinfo". Do any endian
* swapping that may be necessary to flip any of the "portinfo"
* fields
*/
/* Free the mailbox */
return (status);
}
/*
* hermon_is_ext_port_counters_supported()
*
* Determine weather extended port counters are supported or not by sending
* ClassPortInfo perf mgmt class MAD.
*/
int
{
int status;
/* Get "In" and "Out" mailboxes for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Build the ClassPortInfo request MAD in the "In" mailbox */
/* Sync the mailbox for the device to read */
/* Setup the Hermon "MAD_IFC" command */
/* No MKey and BKey checking */
if (status != HERMON_CMD_SUCCESS) {
goto fail;
}
/* Sync the mailbox to read the results */
/*
* We can discard the MAD header and the reserved area of the
* perf mgmt class MAD
*/
HERMON_IS_EXT_WIDTH_SUPPORTED_NOIETF)) ? 1 : 0;
fail:
/* Free the mailbox */
return (status);
}
/*
* hermon_getextpefcntr_cmd_post()
*
* Read the extended performance counters of the specified port and
* copy them into perfinfo.
*/
int
{
int status, i;
/* Get "In" and "Out" mailboxes for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Build PortCountersExtended request MAD in the "In" mailbox */
/* Sync the mailbox for the device to read */
/* Setup the Hermon "MAD_IFC" command */
/* No MKey and BKey checking */
if (status != HERMON_CMD_SUCCESS) {
goto fail;
}
/* Sync the mailbox to read the results */
/*
* Copy Perfcounters into "perfinfo". We can discard the MAD
* header and the reserved area of the perf mgmt class MAD.
*/
for (i = 0; i < (sizeof (hermon_hw_sm_extperfcntr_t) >> 3); i++) {
}
fail:
/* Free the mailbox */
return (status);
}
/*
* hermon_getpefcntr_cmd_post()
* Context: Can be called from interrupt or base context.
*
* If reset is zero, read the performance counters of the specified port and
* copy them into perfinfo.
* If reset is non-zero reset the performance counters of the specified port.
*/
int
{
int status, i;
/* Get "In" and "Out" mailboxes for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Build the GetPortInfo request MAD in the "In" mailbox */
if (reset) {
} else {
}
if (reset) {
/* reset counters for XmitData, RcvData, XmitPkts, RcvPkts */
} else
/* Sync the mailbox for the device to read */
/* Setup the Hermon "MAD_IFC" command */
/* No MKey and BKey checking */
if (status != HERMON_CMD_SUCCESS) {
goto getperfinfo_fail;
}
/* Sync the mailbox to read the results */
if (reset == 0) {
/*
* Copy Perfcounters into "perfinfo". We can discard the MAD
* header and the 8 Quadword reserved area of the PERM mgmt
* class MAD
*/
for (i = 0; i < size >> 3; i++) {
}
}
/* Free the mailbox */
return (status);
}
/*
* hermon_getnodeinfo_cmd_post()
* Context: Can be called from interrupt or base context.
* (Currently called only from attach() and detach() path contexts)
*/
int
{
int status, i;
/* Make sure we are called with the correct flag */
/* Get "In" and "Out" mailboxes for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Build the GetNodeInfo request MAD into the "In" mailbox */
}
/* Sync the mailbox for the device to read */
/* Setup the Hermon "MAD_IFC" command */
if (status != HERMON_CMD_SUCCESS) {
goto getnodeinfo_fail;
}
/* Sync the mailbox to read the results */
size = sizeof (sm_nodeinfo_t);
/*
* Copy GetNodeInfo response MAD into "nodeinfo". Do any endian
* swapping that may be necessary to flip any of the "nodeinfo"
* fields
*/
/* Free the mailbox */
return (status);
}
/*
* hermon_getnodedesc_cmd_post()
* Context: Can be called from interrupt or base context.
* (Currently called only from attach() and detach() path contexts)
*/
int
{
int status, i;
/* Get "In" and "Out" mailboxes for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Build the GetNodeDesc request MAD into the "In" mailbox */
}
/* Sync the mailbox for the device to read */
/* Setup the Hermon "MAD_IFC" command */
if (status != HERMON_CMD_SUCCESS) {
goto getnodedesc_fail;
}
/* Sync the mailbox to read the results */
size = sizeof (sm_nodedesc_t);
/* Copy GetNodeDesc response MAD into "nodedesc" */
/* Free the mailbox */
return (status);
}
/*
* hermon_getguidinfo_cmd_post()
* Context: Can be called from interrupt or base context.
*/
int
{
int status, i;
/* Get "In" and "Out" mailboxes for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Build the GetGUIDInfo request MAD into the "In" mailbox */
}
/* Sync the mailbox for the device to read */
/* Setup the Hermon "MAD_IFC" command */
if (status != HERMON_CMD_SUCCESS) {
goto getguidinfo_fail;
}
/* Sync the mailbox to read the results */
size = sizeof (sm_guidinfo_t);
/*
* Copy GetGUIDInfo response MAD into "guidinfo". Do any endian
* swapping that may be necessary to flip the "guidinfo" fields
*/
/* Free the mailbox */
return (status);
}
/*
* hermon_getpkeytable_cmd_post()
* Context: Can be called from interrupt or base context.
*/
int
{
int status, i;
/* Get "In" and "Out" mailboxes for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Build the GetPkeyTable request MAD into the "In" mailbox */
}
/* Sync the mailbox for the device to read */
/* Setup the Hermon "MAD_IFC" command */
if (status != HERMON_CMD_SUCCESS) {
goto getpkeytable_fail;
}
/* Sync the mailbox to read the results */
size = sizeof (sm_pkey_table_t);
/*
* Copy GetPKeyTable response MAD into "pkeytable". Do any endian
* swapping that may be necessary to flip the "pkeytable" fields
*/
/* Free the mailbox */
return (status);
}
/*
* hermon_write_mtt_cmd_post()
* Context: Can be called from interrupt or base context.
*/
int
{
int status;
int i;
/* Get an "In" mailbox for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/*
* The WRITE_MTT command input parameter contains the 64-bit addr of
* the first target MTT, followed by 64 bits reserved, followed by an
* array of MTT entries.
*
*/
for (i = 0; i < nummtt; i++) {
}
/* Sync the mailbox for the device to read */
/* Setup and post Hermon "WRITE_MTT" command */
cmd.cp_outparm = 0;
if (status != HERMON_CMD_SUCCESS) {
}
/* Free the mailbox */
return (status);
}
/*
* hermon_sync_tpt_cmd_post()
* Context: Can be called from interrupt or base context.
*/
int
{
int status;
/* Setup and post the Hermon "SYNC_TPT" command */
cmd.cp_outparm = 0;
return (status);
}
/*
* hermon_map_eq_cmd_post()
* Context: Can be called from interrupt or base context.
*/
int
{
int status;
/* Setup and post Hermon "MAP_EQ" command */
cmd.cp_outparm = 0;
if (map != HERMON_CMD_MAP_EQ_EVT_MAP) {
}
return (status);
}
/*
* hermon_resize_cq_cmd_post()
* Context: Can be called from interrupt or base context.
*/
int
{
int status, i;
/* Get an "In" mailbox for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Copy the Hermon "MODIFY_CQ" command into mailbox */
size = sizeof (hermon_hw_cqc_t);
for (i = 0; i < (size >> 3); i++) {
}
/* Sync the mailbox for the device to read */
/* Setup and post Hermon "MODIFY_CQ" command */
/*
* New "producer index" is returned in the upper 32 bits of
* command "outparam"
*/
/* Free the mailbox */
return (status);
}
/*
* hermon_modify_cq_cmd_post()
* Context: Can be called from interrupt or base context.
*/
int
{
int status, i;
/* Get an "In" mailbox for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Copy the Hermon "MODIFY_CQ" command into mailbox */
size = sizeof (hermon_hw_cqc_t);
for (i = 0; i < (size >> 3); i++) {
}
/* Sync the mailbox for the device to read */
/* Setup and post Hermon "MODIFY_CQ" command */
cmd.cp_outparm = 0;
/* Free the mailbox */
return (status);
}
/*
* hermon_cmn_qp_cmd_post()
* Context: Can be called from interrupt or base context.
*
* This is the common function for posting all the various types of
* QP state transition related Hermon commands. Since some of the
* commands differ from the others in the number (and type) of arguments
* that each require, this routine does checks based on opcode type
* (explained in more detail below).
*
* Note: This common function should be used only with the following
* opcodes: RTS2SQD_QP, TOERR_QP, TORST_QP, RST2INIT_QP, INIT2INIT_QP,
* INIT2RTR_QP, RTR2RTS_QP, RTS2RTS_QP, SQD2RTS_QP, and SQERR2RTS_QP.
*/
int
{
int status, i;
/*
* Use the specified opcode type to set the appropriate parameters.
* Specifically, we need to set in_mapaddr, out_mapaddr, flags, and
* opmod (as necessary). Setting these parameters may also require
* us to allocate an "In" or "Out" mailbox depending on the command
* type.
*/
if (opcode == RTS2SQD_QP) {
/*
* Note: For RTS-to-SendQueueDrain state transitions we
* always want to request the event generation from the
* hardware. Though we may not notify the consumer of the
* drained event, the decision to forward (or not) is made
* later in the SQD event handler.
*/
/*
* The RTS2SQD_QP command uses no "In" or "Out" mailboxes (and
* has no special opcode modifiers).
*/
in_mapaddr = 0;
out_mapaddr = 0;
opmod = 0;
/*
* The TOERR_QP command uses no "In" or "Out" mailboxes, has no
* special opcode modifiers, and takes no special flags.
*/
in_mapaddr = 0;
out_mapaddr = 0;
opmod = 0;
flags = 0;
/*
* The TORST_QP command could take an "Out" mailbox, but we do
* not require it here. It also does not takes any special
* flags. It does however, take a HERMON_CMD_DIRECT_TO_RESET
* opcode modifier, which indicates that the transition to
* reset should happen without first moving the QP through the
* Error state (and, hence, without generating any unnecessary
* "flushed-in-error" completions).
*/
in_mapaddr = 0;
out_mapaddr = 0;
flags = 0;
} else {
/*
* All the other QP state transition commands (RST2INIT_QP,
* INIT2INIT_QP, INIT2RTR_QP, RTR2RTS_QP, RTS2RTS_QP,
* SQD2RTS_QP, and SQERR2RTS_QP) require an "In" mailbox.
* None of these require any special flags or opcode modifiers.
*/
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
out_mapaddr = 0;
flags = 0;
opmod = 0;
/* Copy the Hermon command into the "In" mailbox */
size = sizeof (hermon_hw_qpc_t);
for (i = 0; i < (size >> 3); i++) {
data);
}
/*
* Sync the mailbox for the device to read. We have to add
* eight bytes here to account for "opt_param_mask" and
* proper alignment.
*/
}
/* Setup and post Hermon QP state transition command */
/*
* If we allocated a mailbox (either an "In" or an "Out") above,
* then free it now before returning.
*/
/* Free the mailbox */
}
return (status);
}
/*
* hermon_cmn_query_cmd_post()
* Context: Can be called from interrupt or base context.
*
* This is the common function for posting all the various types of
* Hermon query commands. All Hermon query commands require an "Out"
* mailbox to be allocated for the resulting queried data.
*
* Note: This common function should be used only with the following
* opcodes: QUERY_DEV_LIM, QUERY_FW, QUERY_DDR, QUERY_ADAPTER, QUERY_PORT
* QUERY_HCA, QUERY_MPT, QUERY_EQ, QUERY_CQ, and QUERY_QP.
*/
int
{
int status, i;
/* Get an "Out" mailbox for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Setup and post the Hermon query command */
if (status != HERMON_CMD_SUCCESS) {
goto cmn_query_fail;
}
/* Sync the mailbox to read the results */
/*
* QUERY_QP is handled somewhat differently than the other query
* commands. For QUERY_QP, the actual queried data is offset into
* the mailbox (by one 64-bit word).
*/
/* Copy query command results into "query" */
for (i = 0; i < (size >> 3); i++) {
}
/* Free the mailbox */
return (status);
}
/*
* hermon_cmn_ownership_cmd_post()
* Context: Can be called from interrupt or base context.
*
* This is the common function for posting all the various types of
* differ from the others in the direction of ownership change (i.e.
* from HW ownership to SW, or vice versa), they differ in the type of
* mailbox and specific handling that each requires. This routine does
* certain checks based on opcode type to determine the direction of
* the transition and to correctly handle the request.
*
* Note: This common function should be used only with the following
* opcodes: HW2SW_MPT, HW2SW_EQ, HW2SW_CQ, SW2HW_MPT, SW2HW_EQ, and
* SW2HW_CQ
*/
int
{
int status, i;
/*
* Determine the direction of the ownership transfer based on the
* provided opcode
*/
} else {
return (HERMON_CMD_INVALID_STATUS);
}
/*
* If hwrsrc is NULL then we do not allocate a mailbox. This is used
* in the case of memory deregister where the out mailbox is not
* needed. In the case of re-register, we do use the hwrsrc.
*
* Otherwise, If ownership transfer is going from hardware to software,
* then allocate an "Out" mailbox. This will be filled in later as a
* result of the Hermon command.
*
* And if the ownership transfer is going from software to hardware,
* then we need an "In" mailbox, and we need to fill it in and sync it
* (if necessary). Then the mailbox can be passed to the Hermon
* firmware.
*
* For the HW2SW (dereg) case, we only use an out mbox if hwrsrc is !=
* NULL. This implies a re-reg, and the out mbox must be used. If
* hwrsrc is == NULL, then we can save some time and resources by not
* using an out mbox at all. We must set opmod to HERMON_CMD_DO_OUTMBOX
* and HERMON_CMD_NO_OUTMBOX appropriately in this case.
*
* For the SW2HW (reg) case, no out mbox is possible. We set opmod to
* 0 anyway, but this field is not used in this case.
*/
if (direction == HERMON_CMD_RSRC_HW2SW) {
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
in_mapaddr = 0;
} else {
in_mapaddr = 0;
out_mapaddr = 0;
}
} else { /* HERMON_CMD_RSRC_SW2HW */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Copy the SW2HW ownership command into mailbox */
for (i = 0; i < (size >> 3); i++) {
data);
}
/* Sync the mailbox for the device to read */
out_mapaddr = 0;
opmod = 0;
}
/* Setup and post the Hermon ownership command */
if (status != HERMON_CMD_SUCCESS) {
goto cmn_ownership_fail;
}
/*
* As mentioned above, for HW2SW ownership transfers we need to
* sync (if necessary) and copy out the resulting data from the
* "Out" mailbox" (assuming the above command was successful).
*/
/* Sync the mailbox to read the results */
/* Copy HW2SW ownership command results into "hwrsrc" */
for (i = 0; i < (size >> 3); i++) {
}
}
/* Free the mailbox */
}
return (status);
}
/*
* hermon_conf_special_qp_cmd_post()
* Context: Can be called from interrupt or base context.
*/
/*ARGSUSED*/
int
{
int status;
/* Setup and post Hermon "CONF_SPECIAL_QP" command */
cmd.cp_outparm = 0;
return (status);
}
/*
* hermon_mgid_hash_cmd_post()
* Context: Can be called from interrupt or base context.
*/
int
{
int status;
/* Get an "In" mailbox for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Copy the Hermon "MGID_HASH" command into mailbox */
/* Sync the mailbox for the device to read */
/* Setup and post the Hermon "MGID_HASH" command */
cmd.cp_outparm = 0;
/* MGID hash value is returned in command "outparam" */
/* Free the mailbox */
return (status);
}
/*
* hermon_read_mgm_cmd_post()
* Context: Can be called from interrupt or base context.
*
* Note: It is assumed that the "mcg" parameter is actually a pointer to a
* "hermon_hw_mcg_t" struct and some number of "hermon_hw_mcg_qp_list_t"
* structs. Combined size should be equal to result of HERMON_MCGMEM_SZ()
* macro.
*/
int
{
int status, i;
/* Get an "Out" mailbox for the results */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Setup and post Hermon "READ_MGM" command */
if (status != HERMON_CMD_SUCCESS) {
goto read_mgm_fail;
}
/* Sync the mailbox to read the results */
/* Copy the READ_MGM command results into "mcg" */
hdrsz = sizeof (hermon_hw_mcg_t);
for (i = 0; i < (hdrsz >> 3); i++) {
}
for (i = 0; i < (qplistsz >> 2); i++) {
}
/* Free the mailbox */
return (status);
}
/*
* hermon_write_mgm_cmd_post()
* Context: Can be called from interrupt or base context.
*
* Note: It is assumed that the "mcg" parameter is actually a pointer to a
* "hermon_hw_mcg_t" struct and some number of "hermon_hw_mcg_qp_list_t"
* structs. Combined size should be equal to result of HERMON_MCGMEM_SZ()
* macro.
*/
int
{
int status, i;
/* Get an "In" mailbox for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Copy the Hermon "WRITE_MGM" command into mailbox */
hdrsz = sizeof (hermon_hw_mcg_t);
for (i = 0; i < (hdrsz >> 3); i++) {
}
for (i = 0; i < (qplistsz >> 2); i++) {
}
/* Sync the mailbox for the device to read */
/* Setup and post Hermon "WRITE_MGM" command */
cmd.cp_outparm = 0;
/* Free the mailbox */
return (status);
}
/*
* hermon_resize_srq_cmd_post()
* Context: Can be called from interrupt or base context.
*/
{
int status, i;
/* Get an "In" mailbox for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Copy the Hermon "RESIZE_SRQ" command into mailbox */
size = sizeof (hermon_hw_srqc_t);
for (i = 0; i < (size >> 3); i++) {
}
/* Sync the mailbox for the device to read */
/* Setup and post Hermon "RESIZE_SRQ" command */
cmd.cp_outparm = 0;
/* Free the mailbox */
return (status);
}
/*
* hermon_modify_mpt_cmd_post()
* Context: Can be called from interrupt or base context.
*/
int
{
int status, i;
/* Get an "In" mailbox for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Copy the Hermon "MODIFY_MPT" command into mailbox */
size = sizeof (hermon_hw_dmpt_t);
for (i = 0; i < (size >> 3); i++) {
}
/* Sync the mailbox for the device to read */
/* Setup and post Hermon "MODIFY_MPT" command */
cmd.cp_outparm = 0;
/* Free the mailbox */
return (status);
}
int
{
int status;
/* Setup and post Hermon "CMD_NOP" command */
cmd.cp_outparm = 0;
return (status);
}
int
{
int status;
/* Setup and post Hermon "CMD_NOP" command */
cmd.cp_outparm = 0;
return (status);
}
int
{
int i, status;
/* Get an "Out" mailbox for the command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Setup and post the "READ_MTT" command */
if (status != HERMON_CMD_SUCCESS) {
return (status);
}
/* Sync the mailbox to read the results */
size = sizeof (hermon_hw_mtt_t);
/* Copy mtt read out */
for (i = 0; i < (size >> 3); i++) {
}
/* Free the mailbox */
return (status);
}