The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/twa/tw_cl_externs.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright (c) 2004-07 Applied Micro Circuits Corporation.
    3  * Copyright (c) 2004-05 Vinod Kashyap
    4  * All rights reserved.
    5  *
    6  * Redistribution and use in source and binary forms, with or without
    7  * modification, are permitted provided that the following conditions
    8  * are met:
    9  * 1. Redistributions of source code must retain the above copyright
   10  *    notice, this list of conditions and the following disclaimer.
   11  * 2. Redistributions in binary form must reproduce the above copyright
   12  *    notice, this list of conditions and the following disclaimer in the
   13  *    documentation and/or other materials provided with the distribution.
   14  *
   15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
   16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   18  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
   19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   25  * SUCH DAMAGE.
   26  *
   27  *      $FreeBSD$
   28  */
   29 
   30 /*
   31  * AMCC'S 3ware driver for 9000 series storage controllers.
   32  *
   33  * Author: Vinod Kashyap
   34  * Modifications by: Adam Radford
   35  */
   36 
   37 
   38 
   39 #ifndef TW_CL_EXTERNS_H
   40 
   41 #define TW_CL_EXTERNS_H
   42 
   43 
   44 /*
   45  * Data structures and functions global to the Common Layer.
   46  */
   47 
   48 
   49 extern TW_INT8                  tw_cli_fw_img[];
   50 extern TW_INT32                 tw_cli_fw_img_size;
   51 extern TW_INT8                  *tw_cli_severity_string_table[];
   52 
   53 
   54 /* Do controller initialization. */
   55 extern TW_INT32 tw_cli_start_ctlr(struct tw_cli_ctlr_context *ctlr);
   56 
   57 /* Establish a logical connection with the firmware on the controller. */
   58 extern TW_INT32 tw_cli_init_connection(struct tw_cli_ctlr_context *ctlr,
   59         TW_UINT16 message_credits, TW_UINT32 set_features,
   60         TW_UINT16 current_fw_srl, TW_UINT16 current_fw_arch_id,
   61         TW_UINT16 current_fw_branch, TW_UINT16 current_fw_build,
   62         TW_UINT16 *fw_on_ctlr_srl, TW_UINT16 *fw_on_ctlr_arch_id,
   63         TW_UINT16 *fw_on_ctlr_branch, TW_UINT16 *fw_on_ctlr_build,
   64         TW_UINT32 *init_connect_result);
   65 
   66 
   67 
   68 /* Functions in tw_cl_io.c */
   69 
   70 /* Submit a command packet to the firmware on the controller. */
   71 extern TW_INT32 tw_cli_submit_cmd(struct tw_cli_req_context *req);
   72 
   73 /* Get a firmware parameter. */
   74 extern TW_INT32 tw_cli_get_param(struct tw_cli_ctlr_context *ctlr,
   75         TW_INT32 table_id, TW_INT32 parameter_id, TW_VOID *param_data,
   76         TW_INT32 size, TW_VOID (* callback)(struct tw_cli_req_context *req));
   77 
   78 /* Set a firmware parameter. */
   79 extern TW_INT32 tw_cli_set_param(struct tw_cli_ctlr_context *ctlr,
   80         TW_INT32 table_id, TW_INT32 param_id, TW_INT32 param_size,
   81         TW_VOID *data, TW_VOID (* callback)(struct tw_cli_req_context *req));
   82 
   83 /* Submit a command to the firmware and poll for completion. */
   84 extern TW_INT32 tw_cli_submit_and_poll_request(struct tw_cli_req_context *req,
   85         TW_UINT32 timeout);
   86 
   87 /* Soft reset the controller. */
   88 extern TW_INT32 tw_cli_soft_reset(struct tw_cli_ctlr_context *ctlr);
   89 
   90 /* Send down a SCSI command to the firmware (usually, an internal Req Sense. */
   91 extern TW_INT32 tw_cli_send_scsi_cmd(struct tw_cli_req_context *req,
   92         TW_INT32 cmd);
   93 
   94 /* Get an AEN from the firmware (by sending down a Req Sense). */
   95 extern TW_INT32 tw_cli_get_aen(struct tw_cli_ctlr_context *ctlr);
   96 
   97 /* Fill in the scatter/gather list. */
   98 extern TW_VOID tw_cli_fill_sg_list(struct tw_cli_ctlr_context *ctlr,
   99         TW_VOID *sgl_src, TW_VOID *sgl_dest, TW_INT32 num_sgl_entries);
  100 
  101 
  102 
  103 /* Functions in tw_cl_intr.c */
  104 
  105 /* Process a host interrupt. */
  106 extern TW_VOID  tw_cli_process_host_intr(struct tw_cli_ctlr_context *ctlr);
  107 
  108 /* Process an attention interrupt. */
  109 extern TW_VOID  tw_cli_process_attn_intr(struct tw_cli_ctlr_context *ctlr);
  110 
  111 /* Process a command interrupt. */
  112 extern TW_VOID  tw_cli_process_cmd_intr(struct tw_cli_ctlr_context *ctlr);
  113 
  114 /* Process a response interrupt from the controller. */
  115 extern TW_INT32 tw_cli_process_resp_intr(struct tw_cli_ctlr_context *ctlr);
  116 
  117 /* Submit any requests in the pending queue to the firmware. */
  118 extern TW_INT32 tw_cli_submit_pending_queue(struct tw_cli_ctlr_context *ctlr);
  119 
  120 /* Process all requests in the complete queue. */
  121 extern TW_VOID  tw_cli_process_complete_queue(struct tw_cli_ctlr_context *ctlr);
  122 
  123 /* CL internal callback for SCSI/fw passthru requests. */
  124 extern TW_VOID  tw_cli_complete_io(struct tw_cli_req_context *req);
  125 
  126 /* Completion routine for SCSI requests. */
  127 extern TW_VOID  tw_cli_scsi_complete(struct tw_cli_req_context *req);
  128 
  129 /* Callback for get/set param requests. */
  130 extern TW_VOID  tw_cli_param_callback(struct tw_cli_req_context *req);
  131 
  132 /* Callback for Req Sense commands to get AEN's. */
  133 extern TW_VOID  tw_cli_aen_callback(struct tw_cli_req_context *req);
  134 
  135 /* Decide what to do with a retrieved AEN. */
  136 extern TW_UINT16        tw_cli_manage_aen(struct tw_cli_ctlr_context *ctlr,
  137         struct tw_cli_req_context *req);
  138 
  139 /* Enable controller interrupts. */
  140 extern TW_VOID
  141         tw_cli_enable_interrupts(struct tw_cli_ctlr_context *ctlr_handle);
  142 
  143 /* Disable controller interrupts. */
  144 extern TW_VOID
  145         tw_cli_disable_interrupts(struct tw_cli_ctlr_context *ctlr_handle);
  146 
  147 
  148 
  149 /* Functions in tw_cl_misc.c */
  150 
  151 /* Print if dbg_level is appropriate (by calling OS Layer). */
  152 extern TW_VOID  tw_cli_dbg_printf(TW_UINT8 dbg_level,
  153         struct tw_cl_ctlr_handle *ctlr_handle, const TW_INT8 *cur_func,
  154         TW_INT8 *fmt, ...);
  155 
  156 /* Describe meaning of each set bit in the given register. */
  157 extern TW_INT8  *tw_cli_describe_bits(TW_UINT32 reg, TW_INT8 *str);
  158 
  159 /* Complete all requests in the complete queue with a RESET status. */
  160 extern TW_VOID  tw_cli_drain_complete_queue(struct tw_cli_ctlr_context *ctlr);
  161 
  162 /* Complete all requests in the busy queue with a RESET status. */
  163 extern TW_VOID  tw_cli_drain_busy_queue(struct tw_cli_ctlr_context *ctlr);
  164 
  165 /* Complete all requests in the pending queue with a RESET status. */
  166 extern TW_VOID  tw_cli_drain_pending_queue(struct tw_cli_ctlr_context *ctlr);
  167 
  168 /* Drain the controller response queue. */
  169 extern TW_INT32 tw_cli_drain_response_queue(struct tw_cli_ctlr_context *ctlr);
  170 
  171 /* Find a particular response in the controller response queue. */
  172 extern TW_INT32 tw_cli_find_response(struct tw_cli_ctlr_context *ctlr,
  173         TW_INT32 req_id);
  174 
  175 /* Drain the controller AEN queue. */
  176 extern TW_INT32 tw_cli_drain_aen_queue(struct tw_cli_ctlr_context *ctlr);
  177 
  178 /* Determine if a given AEN has been posted by the firmware. */
  179 extern TW_INT32 tw_cli_find_aen(struct tw_cli_ctlr_context *ctlr,
  180         TW_UINT16 aen_code);
  181 
  182 /* Poll for a given status to show up in the firmware status register. */
  183 extern TW_INT32 tw_cli_poll_status(struct tw_cli_ctlr_context *ctlr,
  184         TW_UINT32 status, TW_UINT32 timeout);
  185 
  186 /* Get a free CL internal request context packet. */
  187 extern struct tw_cli_req_context *
  188         tw_cli_get_request(struct tw_cli_ctlr_context *ctlr
  189         );
  190 
  191 /* Notify OSL of controller info (fw/BIOS versions, etc.). */
  192 extern TW_VOID  tw_cli_notify_ctlr_info(struct tw_cli_ctlr_context *ctlr);
  193 
  194 /* Make sure that the firmware status register reports a proper status. */
  195 extern TW_INT32 tw_cli_check_ctlr_state(struct tw_cli_ctlr_context *ctlr,
  196         TW_UINT32 status_reg);
  197 
  198 
  199 
  200 #endif /* TW_CL_EXTERNS_H */

Cache object: d5fa87e3288df93b1dbbcfe687f840e2


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.