Print this page
968 fct driver sets incorrect fc-ct revision


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.

  23  */
  24 
  25 #include <sys/conf.h>
  26 #include <sys/file.h>
  27 #include <sys/ddi.h>
  28 #include <sys/sunddi.h>
  29 #include <sys/modctl.h>
  30 #include <sys/scsi/scsi.h>
  31 #include <sys/scsi/impl/scsi_reset_notify.h>
  32 #include <sys/disp.h>
  33 #include <sys/byteorder.h>
  34 #include <sys/varargs.h>
  35 #include <sys/atomic.h>
  36 #include <sys/sdt.h>
  37 
  38 #include <sys/stmf.h>
  39 #include <sys/stmf_ioctl.h>
  40 #include <sys/portif.h>
  41 #include <sys/fct.h>
  42 #include <sys/fctio.h>


2722                 p[19] = (query_rp->rp_id >>  0) & 0xFF;
2723                 break;
2724 
2725         case NS_GID_PN:
2726                 ct->ct_resp_alloc_size = ct->ct_resp_size = 20;
2727                 ct->ct_resp_payload = (uint8_t *)kmem_zalloc(ct->ct_resp_size,
2728                     KM_SLEEP);
2729 
2730                 ct->ct_req_size = ct->ct_req_alloc_size = 24;
2731                 p = ct->ct_req_payload = (uint8_t *)kmem_zalloc(ct->ct_req_size,
2732                     KM_SLEEP);
2733 
2734                 bcopy(query_rp->rp_pwwn, p + 16, 8);
2735                 break;
2736 
2737         default:
2738                 /* CONSTCOND */
2739                 ASSERT(0);
2740         }
2741 
2742         FCT_FILL_CTIU_PREAMPLE(p, ctop);
2743         return (cmd);
2744 }
2745 
2746 /*
2747  * Cmd can only be solicited CT/ELS. They will be dispatched to the discovery
2748  * queue eventually too.
2749  * We queue solicited cmds here to track solicited cmds and to take full use
2750  * of single thread mechanism.
2751  * But in current implmentation, we don't use  this mechanism on SOL_CT, PLOGI.
2752  * To avoid to interrupt current flow, ICMD_IN_SOLCMD_QUEUE is used here.
2753  */
2754 void
2755 fct_post_to_solcmd_queue(fct_local_port_t *port, fct_cmd_t *cmd)
2756 {
2757         fct_i_local_port_t      *iport  = (fct_i_local_port_t *)
2758             port->port_fct_private;
2759         fct_i_cmd_t *icmd               = (fct_i_cmd_t *)cmd->cmd_fct_private;
2760 
2761         mutex_enter(&iport->iport_worker_lock);
2762         icmd->icmd_solcmd_next = iport->iport_solcmd_queue;




   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
  24  */
  25 
  26 #include <sys/conf.h>
  27 #include <sys/file.h>
  28 #include <sys/ddi.h>
  29 #include <sys/sunddi.h>
  30 #include <sys/modctl.h>
  31 #include <sys/scsi/scsi.h>
  32 #include <sys/scsi/impl/scsi_reset_notify.h>
  33 #include <sys/disp.h>
  34 #include <sys/byteorder.h>
  35 #include <sys/varargs.h>
  36 #include <sys/atomic.h>
  37 #include <sys/sdt.h>
  38 
  39 #include <sys/stmf.h>
  40 #include <sys/stmf_ioctl.h>
  41 #include <sys/portif.h>
  42 #include <sys/fct.h>
  43 #include <sys/fctio.h>


2723                 p[19] = (query_rp->rp_id >>  0) & 0xFF;
2724                 break;
2725 
2726         case NS_GID_PN:
2727                 ct->ct_resp_alloc_size = ct->ct_resp_size = 20;
2728                 ct->ct_resp_payload = (uint8_t *)kmem_zalloc(ct->ct_resp_size,
2729                     KM_SLEEP);
2730 
2731                 ct->ct_req_size = ct->ct_req_alloc_size = 24;
2732                 p = ct->ct_req_payload = (uint8_t *)kmem_zalloc(ct->ct_req_size,
2733                     KM_SLEEP);
2734 
2735                 bcopy(query_rp->rp_pwwn, p + 16, 8);
2736                 break;
2737 
2738         default:
2739                 /* CONSTCOND */
2740                 ASSERT(0);
2741         }
2742 
2743         FCT_FILL_CTIU_PREAMBLE(p, ctop);
2744         return (cmd);
2745 }
2746 
2747 /*
2748  * Cmd can only be solicited CT/ELS. They will be dispatched to the discovery
2749  * queue eventually too.
2750  * We queue solicited cmds here to track solicited cmds and to take full use
2751  * of single thread mechanism.
2752  * But in current implmentation, we don't use  this mechanism on SOL_CT, PLOGI.
2753  * To avoid to interrupt current flow, ICMD_IN_SOLCMD_QUEUE is used here.
2754  */
2755 void
2756 fct_post_to_solcmd_queue(fct_local_port_t *port, fct_cmd_t *cmd)
2757 {
2758         fct_i_local_port_t      *iport  = (fct_i_local_port_t *)
2759             port->port_fct_private;
2760         fct_i_cmd_t *icmd               = (fct_i_cmd_t *)cmd->cmd_fct_private;
2761 
2762         mutex_enter(&iport->iport_worker_lock);
2763         icmd->icmd_solcmd_next = iport->iport_solcmd_queue;