Print this page


Split Close
Expand all
Collapse all
          --- old/./mr_sas.h
          +++ new/./mr_sas.h
↓ open down ↓ 4 lines elided ↑ open up ↑
   5    5   * Copyright (c) 2008-2012, LSI Logic Corporation.
   6    6   * All rights reserved.
   7    7   *
   8    8   * Version:
   9    9   * Author:
  10   10   *              Swaminathan K S
  11   11   *              Arun Chandrashekhar
  12   12   *              Manju R
  13   13   *              Rasheed
  14   14   *              Shakeel Bukhari
       15 + *
       16 + * Redistribution and use in source and binary forms, with or without
       17 + * modification, are permitted provided that the following conditions are met:
       18 + *
       19 + * 1. Redistributions of source code must retain the above copyright notice,
       20 + *    this list of conditions and the following disclaimer.
       21 + *
       22 + * 2. Redistributions in binary form must reproduce the above copyright notice,
       23 + *    this list of conditions and the following disclaimer in the documentation
       24 + *    and/or other materials provided with the distribution.
       25 + *
       26 + * 3. Neither the name of the author nor the names of its contributors may be
       27 + *    used to endorse or promote products derived from this software without
       28 + *    specific prior written permission.
       29 + *
       30 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
       31 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
       32 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
       33 + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
       34 + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
       35 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
       36 + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
       37 + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
       38 + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
       39 + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
       40 + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
       41 + * DAMAGE.
  15   42   */
  16   43  
       44 +/*
       45 + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
       46 + */
       47 +
  17   48  #ifndef _MR_SAS_H_
  18   49  #define _MR_SAS_H_
  19   50  
  20   51  #ifdef  __cplusplus
  21   52  extern "C" {
  22   53  #endif
  23   54  
  24   55  #include <sys/scsi/scsi.h>
  25   56  #include "mr_sas_list.h"
  26   57  #include "ld_pd_map.h"
  27   58  
  28   59  /*
  29   60   * MegaRAID SAS2.0 Driver meta data
  30   61   */
  31      -#define MRSAS_VERSION                           "6.503.00.00JOYENT"
       62 +#define MRSAS_VERSION                           "6.503.00.00ILLUMOS"
  32   63  #define MRSAS_RELDATE                           "July 30, 2012"
  33   64  
  34   65  #define MRSAS_TRUE                              1
  35   66  #define MRSAS_FALSE                             0
  36   67  
  37   68  #define ADAPTER_RESET_NOT_REQUIRED              0
  38   69  #define ADAPTER_RESET_REQUIRED                  1
  39   70  
  40      -#define PDSUPPORT       1
       71 +#define PDSUPPORT       1
  41   72  
  42      -#define SWAP_BYTES(w)   ((((w)>>8)&0xFF) | (((w)&0xFF)<<8))
  43      -#define BIG_ENDIAN(d)   (SWAP_BYTES((d) >> 16) | (SWAP_BYTES(d) << 16))
  44   73  /*
  45   74   * MegaRAID SAS2.0 device id conversion definitions.
  46   75   */
  47   76  #define INST2LSIRDCTL(x)                ((x) << INST_MINOR_SHIFT)
  48      -#define MRSAS_GET_BOUNDARY_ALIGNED_LEN(len, new_len, boundary_len)  { \
  49      -        int rem; \
  50      -        rem = (len / boundary_len); \
  51      -        if ((rem * boundary_len) != len) { \
  52      -                new_len = len + ((rem + 1) * boundary_len - len); \
  53      -         } else { \
  54      -                new_len = len; \
  55      -        } \
  56      -} \
       77 +#define MRSAS_GET_BOUNDARY_ALIGNED_LEN(len, new_len, boundary_len)  { \
       78 +        int rem; \
       79 +        rem = (len / boundary_len); \
       80 +        if ((rem * boundary_len) != len) { \
       81 +                new_len = len + ((rem + 1) * boundary_len - len); \
       82 +        } else { \
       83 +                new_len = len; \
       84 +        } \
       85 +}
  57   86  
  58   87  
  59   88  /*
  60   89   * MegaRAID SAS2.0 supported controllers
  61   90   */
  62   91  #define PCI_DEVICE_ID_LSI_2108VDE               0x0078
  63   92  #define PCI_DEVICE_ID_LSI_2108V                 0x0079
  64   93  #define PCI_DEVICE_ID_LSI_TBOLT                 0x005b
  65   94  #define PCI_DEVICE_ID_LSI_INVADER               0x005d
  66   95  
↓ open down ↓ 9 lines elided ↑ open up ↑
  76  105  #define MRSAS_IOCTL_FIRMWARE                    0x12345678
  77  106  #define MRSAS_IOCTL_AEN                         0x87654321
  78  107  
  79  108  #define MRSAS_1_SECOND                          1000000
  80  109  
  81  110  #ifdef PDSUPPORT
  82  111  
  83  112  #define UNCONFIGURED_GOOD                       0x0
  84  113  #define PD_SYSTEM                               0x40
  85  114  #define MR_EVT_PD_STATE_CHANGE                  0x0072
  86      -#define MR_EVT_PD_REMOVED_EXT           0x00f8
      115 +#define MR_EVT_PD_REMOVED_EXT           0x00f8
  87  116  #define MR_EVT_PD_INSERTED_EXT          0x00f7
  88  117  #define MR_DCMD_PD_GET_INFO                     0x02020000
  89  118  #define MRSAS_TBOLT_PD_LUN              1
  90  119  #define MRSAS_TBOLT_PD_TGT_MAX  255
  91  120  #define MRSAS_TBOLT_GET_PD_MAX(s)       ((s)->mr_tbolt_pd_max)
  92  121  
  93  122  #endif
  94  123  
  95  124  /* Raid Context Flags */
  96      -#define MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT        0x4
  97      -#define MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_MASK 0x30
  98      -typedef enum    MR_RAID_FLAGS_IO_SUB_TYPE {
  99      -        MR_RAID_FLAGS_IO_SUB_TYPE_NONE = 0,
 100      -        MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD = 1
      125 +#define MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_SHIFT 0x4
      126 +#define MR_RAID_CTX_RAID_FLAGS_IO_SUB_TYPE_MASK 0x30
      127 +typedef enum MR_RAID_FLAGS_IO_SUB_TYPE {
      128 +        MR_RAID_FLAGS_IO_SUB_TYPE_NONE = 0,
      129 +        MR_RAID_FLAGS_IO_SUB_TYPE_SYSTEM_PD = 1
 101  130  } MR_RAID_FLAGS_IO_SUB_TYPE;
 102  131  
 103  132  /* Dynamic Enumeration Flags */
 104  133  #define MRSAS_LD_LUN            0
 105  134  #define WWN_STRLEN              17
 106  135  #define LD_SYNC_BIT     1
 107  136  #define LD_SYNC_SHIFT   14
 108  137  /* ThunderBolt (TB) specific */
 109  138  #define MRSAS_THUNDERBOLT_MSG_SIZE              256
 110  139  #define MRSAS_THUNDERBOLT_MAX_COMMANDS          1024
↓ open down ↓ 392 lines elided ↑ open up ↑
 503  532          uint32_t        internal_buf_size;
 504  533  
 505  534          uint16_t        vendor_id;
 506  535          uint16_t        device_id;
 507  536          uint16_t        subsysvid;
 508  537          uint16_t        subsysid;
 509  538          int             instance;
 510  539          int             baseaddress;
 511  540          char            iocnode[16];
 512  541  
 513      -        /*Driver resources unroll flags.
 514      -          The flag is set for resources that are needed to be free'd at detach() time */
 515      -
 516      -        struct _unroll {                             
 517      -                uint8_t softs;          // The software state was allocated.
 518      -                uint8_t regs;           // Controller registers mapped.
 519      -                uint8_t intr;           // Interrupt handler added.
 520      -                uint8_t reqs;           // Request structs allocated.
 521      -                uint8_t mutexs;         // Mutex's allocated.
 522      -                uint8_t taskq;          // Task q's created.
 523      -                uint8_t tran;           // Tran struct allocated
 524      -                uint8_t tranSetup;      // Tran attached to the ddi.
 525      -                uint8_t devctl;         // Device nodes for cfgadm created.
 526      -                uint8_t scsictl;        // Device nodes for cfgadm created.
 527      -                uint8_t ioctl;          // Device nodes for ioctl's created.
 528      -                uint8_t timer;          // Timer started.
 529      -                uint8_t aenPend;        // AEN cmd pending f/w.
 530      -                uint8_t mapUpdate_pend; // LD MAP update cmd pending f/w.
 531      -                uint8_t soft_isr;
 532      -                uint8_t ldlist_buff;
 533      -                uint8_t pdlist_buff;
 534      -                uint8_t syncCmd;
 535      -                uint8_t verBuff;
 536      -                uint8_t alloc_space_mfi;
 537      -                uint8_t alloc_space_mpi2;
      542 +        int             fm_capabilities;
      543 +        /*
      544 +         * Driver resources unroll flags.  The flag is set for resources that
      545 +         * are needed to be free'd at detach() time.
      546 +         */
      547 +        struct _unroll {
      548 +                uint8_t softs;          /* The software state was allocated. */
      549 +                uint8_t regs;           /* Controller registers mapped. */
      550 +                uint8_t intr;           /* Interrupt handler added. */
      551 +                uint8_t reqs;           /* Request structs allocated. */
      552 +                uint8_t mutexs;         /* Mutex's allocated. */
      553 +                uint8_t taskq;          /* Task q's created. */
      554 +                uint8_t tran;           /* Tran struct allocated */
      555 +                uint8_t tranSetup;      /* Tran attached to the ddi. */
      556 +                uint8_t devctl;         /* Device nodes for cfgadm created. */
      557 +                uint8_t scsictl;        /* Device nodes for cfgadm created. */
      558 +                uint8_t ioctl;          /* Device nodes for ioctl's created. */
      559 +                uint8_t timer;          /* Timer started. */
      560 +                uint8_t aenPend;        /* AEN cmd pending f/w. */
      561 +                uint8_t mapUpdate_pend; /* LD MAP update cmd pending f/w. */
      562 +                uint8_t soft_isr;       /* Soft interrupt handler allocated. */
      563 +                uint8_t ldlist_buff;    /* Logical disk list allocated. */
      564 +                uint8_t pdlist_buff;    /* Physical disk list allocated. */
      565 +                uint8_t syncCmd;        /* Sync map command allocated. */
      566 +                uint8_t verBuff;        /* 2108 MFI buffer allocated. */
      567 +                uint8_t alloc_space_mfi;  /* Allocated space for 2108 MFI. */
      568 +                uint8_t alloc_space_mpi2; /* Allocated space for 2208 MPI2. */
 538  569          } unroll;
 539  570  
 540  571  
 541  572          /* function template pointer */
 542  573          struct mrsas_function_template *func_ptr;
 543  574  
 544  575  
 545  576          /* MSI interrupts specific */
 546      -        ddi_intr_handle_t *intr_htable;       //Interrupt handle array
 547      -        size_t          intr_htable_size;     //Interrupt handle array size
      577 +        ddi_intr_handle_t *intr_htable;         /* Interrupt handle array */
      578 +        size_t          intr_htable_size;       /* Int. handle array size */
 548  579          int             intr_type;
 549  580          int             intr_cnt;
 550  581          uint_t          intr_pri;
 551  582          int             intr_cap;
 552  583  
 553  584          ddi_taskq_t     *taskq;
 554  585          struct mrsas_ld *mr_ld_list;
 555  586          kmutex_t        config_dev_mtx;
 556  587          /* ThunderBolt (TB) specific */
 557  588          ddi_softintr_t  tbolt_soft_intr_id;
 558  589  
 559  590  #ifdef PDSUPPORT
 560  591          uint32_t        mr_tbolt_pd_max;
 561  592          struct mrsas_tbolt_pd *mr_tbolt_pd_list;
 562  593  #endif
 563  594  
 564  595          uint8_t         fast_path_io;
 565  596  
 566  597          uint16_t        tbolt;
 567  598          uint16_t        reply_read_index;
 568      -        uint16_t        reply_size;             // Single Reply structure size
 569      -        uint16_t        raid_io_msg_size;       // Single message size
      599 +        uint16_t        reply_size;             /* Single Reply struct size */
      600 +        uint16_t        raid_io_msg_size;       /* Single message size */
 570  601          uint32_t        io_request_frames_phy;
 571  602          uint8_t         *io_request_frames;
 572      -        MRSAS_REQUEST_DESCRIPTOR_UNION  *request_message_pool;   // Virtual address of request desc frame pool
 573      -        uint32_t        request_message_pool_phy;                // Physical address of request desc frame pool
 574      -        MPI2_REPLY_DESCRIPTORS_UNION    *reply_frame_pool;       // Virtual address of reply Frame
 575      -        uint32_t        reply_frame_pool_phy;                    // Physical address of reply Frame
 576      -        uint8_t         *reply_pool_limit;                       // Last reply frame address
 577      -        uint32_t        reply_pool_limit_phy;                    // Physical address of Last reply frame
 578      -        uint32_t        reply_q_depth;                           // Reply Queue Depth
      603 +        /* Virtual address of request desc frame pool */
      604 +        MRSAS_REQUEST_DESCRIPTOR_UNION  *request_message_pool;
      605 +        /* Physical address of request desc frame pool */
      606 +        uint32_t        request_message_pool_phy;
      607 +        /* Virtual address of reply Frame */
      608 +        MPI2_REPLY_DESCRIPTORS_UNION    *reply_frame_pool;
      609 +        /* Physical address of reply Frame */
      610 +        uint32_t        reply_frame_pool_phy;
      611 +        uint8_t         *reply_pool_limit;      /* Last reply frame address */
      612 +        /* Physical address of Last reply frame */
      613 +        uint32_t        reply_pool_limit_phy;
      614 +        uint32_t        reply_q_depth;          /* Reply Queue Depth */
 579  615          uint8_t         max_sge_in_main_msg;
 580  616          uint8_t         max_sge_in_chain;
 581  617          uint8_t         chain_offset_io_req;
 582  618          uint8_t         chain_offset_mpt_msg;
 583  619          MR_FW_RAID_MAP_ALL *ld_map[2];
 584  620          uint32_t        ld_map_phy[2];
 585  621          uint32_t        size_map_info;
 586  622          uint64_t        map_id;
 587  623          LD_LOAD_BALANCE_INFO load_balance_info[MAX_LOGICAL_DRIVES];
 588  624          struct mrsas_cmd *map_update_cmd;
 589  625          uint32_t        SyncRequired;
 590  626          kmutex_t        ocr_flags_mtx;
 591      -        dma_obj_t        drv_ver_dma_obj;
      627 +        dma_obj_t       drv_ver_dma_obj;
 592  628  } mrsas_t;
 593  629  
 594  630  
 595  631  /*
 596  632   * Function templates for various controller specific functions
 597  633   */
 598  634  struct mrsas_function_template {
 599  635          uint32_t (*read_fw_status_reg)(struct mrsas_instance *);
 600  636          void (*issue_cmd)(struct mrsas_cmd *, struct mrsas_instance *);
 601  637          int (*issue_cmd_in_sync_mode)(struct mrsas_instance *,
 602  638              struct mrsas_cmd *);
 603  639          int (*issue_cmd_in_poll_mode)(struct mrsas_instance *,
 604  640              struct mrsas_cmd *);
 605  641          void (*enable_intr)(struct mrsas_instance *);
 606  642          void (*disable_intr)(struct mrsas_instance *);
 607  643          int (*intr_ack)(struct mrsas_instance *);
 608  644          int (*init_adapter)(struct mrsas_instance *);
 609      -//      int (*reset_adapter)(struct mrsas_instance *);
      645 +/*      int (*reset_adapter)(struct mrsas_instance *); */
 610  646  };
 611  647  
 612  648  /*
 613  649   * ### Helper routines ###
 614  650   */
 615  651  
 616  652  /*
 617  653   * con_log() - console log routine
 618  654   * @param level         : indicates the severity of the message.
 619  655   * @fparam mt           : format string
 620  656   *
 621  657   * con_log displays the error messages on the console based on the current
 622  658   * debug level. Also it attaches the appropriate kernel severity level with
 623  659   * the message.
 624  660   *
 625  661   *
 626  662   * console messages debug levels
 627  663   */
 628  664  #define CL_NONE         0       /* No debug information */
 629  665  #define CL_ANN          1       /* print unconditionally, announcements */
 630      -#define CL_ANN1         2       /* No o/p  */
      666 +#define CL_ANN1         2       /* No-op  */
 631  667  #define CL_DLEVEL1      3       /* debug level 1, informative */
 632  668  #define CL_DLEVEL2      4       /* debug level 2, verbose */
 633  669  #define CL_DLEVEL3      5       /* debug level 3, very verbose */
 634  670  
 635  671  #ifdef __SUNPRO_C
 636      -#define __func__        __FUNCTION__    //""
      672 +#define __func__ ""
 637  673  #endif
 638  674  
 639  675  #define con_log(level, fmt) { if (debug_level_g >= level) cmn_err fmt; }
 640  676  
 641  677  /*
 642  678   * ### SCSA definitions ###
 643  679   */
 644  680  #define PKT2TGT(pkt)    ((pkt)->pkt_address.a_target)
 645  681  #define PKT2LUN(pkt)    ((pkt)->pkt_address.a_lun)
 646  682  #define PKT2TRAN(pkt)   ((pkt)->pkt_adress.a_hba_tran)
↓ open down ↓ 1263 lines elided ↑ open up ↑
1910 1946          uint32_t        seq_num;
1911 1947          uint32_t        class_locale_word;
1912 1948  };
1913 1949  
1914 1950  #pragma pack()
1915 1951  
1916 1952  #ifndef DDI_VENDOR_LSI
1917 1953  #define DDI_VENDOR_LSI          "LSI"
1918 1954  #endif /* DDI_VENDOR_LSI */
1919 1955  
1920      -static int      mrsas_getinfo(dev_info_t *, ddi_info_cmd_t,  void *, void **);
1921      -static int      mrsas_attach(dev_info_t *, ddi_attach_cmd_t);
1922      -static int      mrsas_reset(dev_info_t *, ddi_reset_cmd_t);
1923      -int     mrsas_quiesce(dev_info_t *);
1924      -static int      mrsas_detach(dev_info_t *, ddi_detach_cmd_t);
1925      -static int      mrsas_open(dev_t *, int, int, cred_t *);
1926      -static int      mrsas_close(dev_t, int, int, cred_t *);
1927      -static int      mrsas_ioctl(dev_t, int, intptr_t, int, cred_t *, int *);
     1956 +int mrsas_config_scsi_device(struct mrsas_instance *,
     1957 +    struct scsi_device *, dev_info_t **);
1928 1958  
1929      -static int      mrsas_tran_tgt_init(dev_info_t *, dev_info_t *,
1930      -                    scsi_hba_tran_t *, struct scsi_device *);
1931      -static struct scsi_pkt *mrsas_tran_init_pkt(struct scsi_address *, register
1932      -                    struct scsi_pkt *, struct buf *, int, int, int, int,
1933      -                    int (*)(), caddr_t);
1934      -static int      mrsas_tran_start(struct scsi_address *,
1935      -                    register struct scsi_pkt *);
1936      -static int      mrsas_tran_abort(struct scsi_address *, struct scsi_pkt *);
1937      -static int      mrsas_tran_reset(struct scsi_address *, int);
1938      -static int      mrsas_tran_bus_reset(dev_info_t *, int);
1939      -static int      mrsas_tran_getcap(struct scsi_address *, char *, int);
1940      -static int      mrsas_tran_setcap(struct scsi_address *, char *, int, int);
1941      -static void     mrsas_tran_destroy_pkt(struct scsi_address *,
1942      -                    struct scsi_pkt *);
1943      -static void     mrsas_tran_dmafree(struct scsi_address *, struct scsi_pkt *);
1944      -static void     mrsas_tran_sync_pkt(struct scsi_address *, struct scsi_pkt *);
1945      -static int      mrsas_tran_quiesce(dev_info_t *dip);
1946      -static int      mrsas_tran_unquiesce(dev_info_t *dip);
1947      -static uint_t   mrsas_isr();
1948      -static uint_t   mrsas_softintr();
1949      -
1950      -static struct mrsas_cmd *get_mfi_pkt(struct mrsas_instance *);
1951      -static void     return_mfi_pkt(struct mrsas_instance *,
1952      -                    struct mrsas_cmd *);
1953      -
1954      -static void     free_space_for_mfi(struct mrsas_instance *);
1955      -static int      mrsas_tbolt_alloc_additional_dma_buffer
1956      -(struct mrsas_instance *);
1957      -int             mrsas_tbolt_sync_map_info(struct mrsas_instance *instance);
1958      -static int      alloc_additional_dma_buffer(struct mrsas_instance *);
1959      -static uint32_t read_fw_status_reg_ppc(struct mrsas_instance *);
1960      -static void     issue_cmd_ppc(struct mrsas_cmd *, struct mrsas_instance *);
1961      -static int      issue_cmd_in_poll_mode_ppc(struct mrsas_instance *,
1962      -                    struct mrsas_cmd *);
1963      -static int      issue_cmd_in_sync_mode_ppc(struct mrsas_instance *,
1964      -                    struct mrsas_cmd *);
1965      -static void     enable_intr_ppc(struct mrsas_instance *);
1966      -static void     disable_intr_ppc(struct mrsas_instance *);
1967      -static int      intr_ack_ppc(struct mrsas_instance *);
1968      -int     mfi_state_transition_to_ready(struct mrsas_instance *);
1969      -static void     flush_cache(struct mrsas_instance *instance);
1970      -void    display_scsi_inquiry(caddr_t);
1971      -static int      start_mfi_aen(struct mrsas_instance *instance);
1972      -static int      handle_drv_ioctl(struct mrsas_instance *instance,
1973      -                    struct mrsas_ioctl *ioctl, int mode);
1974      -static int      handle_mfi_ioctl(struct mrsas_instance *instance,
1975      -                    struct mrsas_ioctl *ioctl, int mode);
1976      -static int      handle_mfi_aen(struct mrsas_instance *instance,
1977      -                    struct mrsas_aen *aen);
1978      -void    fill_up_drv_ver(struct mrsas_drv_ver *dv);
1979      -static struct mrsas_cmd *build_cmd(struct mrsas_instance *instance,
1980      -                    struct scsi_address *ap, struct scsi_pkt *pkt,
1981      -                    uchar_t *cmd_done);
1982      -static struct mrsas_cmd *mrsas_tbolt_build_cmd(struct mrsas_instance *instance,
1983      -                    struct scsi_address *ap, struct scsi_pkt *pkt,
1984      -                    uchar_t *cmd_done);
1985      -static int      wait_for_outstanding(struct mrsas_instance *instance);
1986      -static int      register_mfi_aen(struct mrsas_instance *instance,
1987      -                    uint32_t seq_num, uint32_t class_locale_word);
1988      -static int      issue_mfi_pthru(struct mrsas_instance *instance, struct
1989      -                    mrsas_ioctl *ioctl, struct mrsas_cmd *cmd, int mode);
1990      -static int      issue_mfi_dcmd(struct mrsas_instance *instance, struct
1991      -                    mrsas_ioctl *ioctl, struct mrsas_cmd *cmd, int mode);
1992      -static int      issue_mfi_smp(struct mrsas_instance *instance, struct
1993      -                    mrsas_ioctl *ioctl, struct mrsas_cmd *cmd, int mode);
1994      -static int      issue_mfi_stp(struct mrsas_instance *instance, struct
1995      -                    mrsas_ioctl *ioctl, struct mrsas_cmd *cmd, int mode);
1996      -static int      abort_aen_cmd(struct mrsas_instance *instance,
1997      -                    struct mrsas_cmd *cmd_to_abort);
1998      -
1999      -
2000      -static void     mrsas_rem_intrs(struct mrsas_instance *instance);
2001      -static int      mrsas_add_intrs(struct mrsas_instance *instance, int intr_type);
2002      -
2003      -static void     mrsas_tran_tgt_free(dev_info_t *, dev_info_t *,
2004      -                    scsi_hba_tran_t *, struct scsi_device *);
2005      -static int      mrsas_tran_bus_config(dev_info_t *, uint_t,
2006      -                    ddi_bus_config_op_t, void *, dev_info_t **);
2007      -static int      mrsas_parse_devname(char *, int *, int *);
2008      -static int      mrsas_config_all_devices(struct mrsas_instance *);
2009      -int     mrsas_config_scsi_device(struct mrsas_instance *,
2010      -                    struct scsi_device *, dev_info_t **);
2011      -static int      mrsas_config_ld(struct mrsas_instance *, uint16_t,
2012      -                        uint8_t, dev_info_t **);
2013      -
2014 1959  #ifdef PDSUPPORT
2015      -int     mrsas_tbolt_config_pd(struct mrsas_instance *, uint16_t,
2016      -                        uint8_t, dev_info_t **);
2017      -static void     mrsas_tbolt_get_pd_info(struct mrsas_instance *,
2018      -                        struct mrsas_tbolt_pd_info *, int);
     1960 +int mrsas_tbolt_config_pd(struct mrsas_instance *, uint16_t,
     1961 +    uint8_t, dev_info_t **);
2019 1962  #endif
2020 1963  
2021      -dev_info_t *mrsas_find_child(struct mrsas_instance *, uint16_t,
2022      -                        uint8_t);
2023      -static int      mrsas_name_node(dev_info_t *, char *, int);
2024      -static void     mrsas_issue_evt_taskq(struct mrsas_eventinfo *);
2025      -int     mrsas_service_evt(struct mrsas_instance *, int, int, int,
2026      -                        uint64_t);
2027      -static void     free_additional_dma_buffer(struct mrsas_instance *);
2028      -
2029      -struct mrsas_cmd *get_raid_msg_pkt(struct mrsas_instance *);
     1964 +dev_info_t *mrsas_find_child(struct mrsas_instance *, uint16_t, uint8_t);
     1965 +int mrsas_service_evt(struct mrsas_instance *, int, int, int, uint64_t);
2030 1966  void return_raid_msg_pkt(struct mrsas_instance *, struct mrsas_cmd *);
2031 1967  struct mrsas_cmd *get_raid_msg_mfi_pkt(struct mrsas_instance *);
2032 1968  void return_raid_msg_mfi_pkt(struct mrsas_instance *, struct mrsas_cmd *);
2033 1969  
2034 1970  int     alloc_space_for_mpi2(struct mrsas_instance *);
2035      -int     alloc_additional_dma_buffer(struct mrsas_instance *);
     1971 +void    fill_up_drv_ver(struct mrsas_drv_ver *dv);
2036 1972  
2037 1973  int     mrsas_issue_init_mpi2(struct mrsas_instance *);
2038 1974  struct scsi_pkt *mrsas_tbolt_tran_init_pkt(struct scsi_address *, register
2039 1975                      struct scsi_pkt *, struct buf *, int, int, int, int,
2040 1976                      int (*)(), caddr_t);
2041 1977  int     mrsas_tbolt_tran_start(struct scsi_address *,
2042 1978                      register struct scsi_pkt *);
2043 1979  uint32_t tbolt_read_fw_status_reg(struct mrsas_instance *);
2044 1980  void    tbolt_issue_cmd(struct mrsas_cmd *, struct mrsas_instance *);
2045 1981  int     tbolt_issue_cmd_in_poll_mode(struct mrsas_instance *,
↓ open down ↓ 7 lines elided ↑ open up ↑
2053 1989      uint_t tbolt_softintr();
2054 1990  int     mrsas_tbolt_dma(struct mrsas_instance *, uint32_t, int, int (*)());
2055 1991  int     mrsas_check_dma_handle(ddi_dma_handle_t handle);
2056 1992  int     mrsas_check_acc_handle(ddi_acc_handle_t handle);
2057 1993  int     mrsas_dma_alloc(struct mrsas_instance *, struct scsi_pkt *,
2058 1994                      struct buf *, int, int (*)());
2059 1995  int     mrsas_dma_move(struct mrsas_instance *,
2060 1996                          struct scsi_pkt *, struct buf *);
2061 1997  int     mrsas_alloc_dma_obj(struct mrsas_instance *, dma_obj_t *,
2062 1998                      uchar_t);
2063      -int     mrsas_tbolt_ioc_init(struct mrsas_instance *, dma_obj_t *,
2064      -        ddi_acc_handle_t);
2065      -int     mrsas_tbolt_prepare_pkt(struct scsa_cmd *);
2066 1999  void    mr_sas_tbolt_build_mfi_cmd(struct mrsas_instance *, struct mrsas_cmd *);
2067 2000  int     mrsas_dma_alloc_dmd(struct mrsas_instance *, dma_obj_t *);
2068      -int     mr_sas_tbolt_build_sgl(struct mrsas_instance *,
2069      -        struct scsa_cmd *,
2070      -        struct mrsas_cmd *,
2071      -        Mpi2RaidSCSIIORequest_t *,
2072      -        uint32_t *);
2073 2001  void    tbolt_complete_cmd_in_sync_mode(struct mrsas_instance *,
2074 2002          struct mrsas_cmd *);
2075 2003  int     alloc_req_rep_desc(struct mrsas_instance *);
2076      -static void     complete_cmd_in_sync_mode(struct mrsas_instance *,
2077      -                struct mrsas_cmd *);
2078      -static void     io_timeout_checker(void *instance);
2079      -static int      mrsas_kill_adapter(struct mrsas_instance *);
2080 2004  int             mrsas_mode_sense_build(struct scsi_pkt *);
2081 2005  void            push_pending_mfi_pkt(struct mrsas_instance *,
2082 2006                          struct mrsas_cmd *);
2083      -static int      mrsas_issue_init_mfi(struct mrsas_instance *);
2084      -int             mrsas_issue_pending_cmds(struct mrsas_instance *);
     2007 +int     mrsas_issue_pending_cmds(struct mrsas_instance *);
2085 2008  int     mrsas_print_pending_cmds(struct mrsas_instance *);
2086 2009  int     mrsas_complete_pending_cmds(struct mrsas_instance *);
2087      -static int      mrsas_reset_ppc(struct mrsas_instance *);
2088      -static uint32_t mrsas_initiate_ocr_if_fw_is_faulty(struct mrsas_instance *);
2089 2010  
2090      -MRSAS_REQUEST_DESCRIPTOR_UNION *\
2091      -        mr_sas_get_request_descriptor(struct mrsas_instance *,
2092      -        uint16_t, struct mrsas_cmd *);
2093      -
2094 2011  int     create_mfi_frame_pool(struct mrsas_instance *);
2095 2012  void    destroy_mfi_frame_pool(struct mrsas_instance *);
2096 2013  int     create_mfi_mpi_frame_pool(struct mrsas_instance *);
2097 2014  void    destroy_mfi_mpi_frame_pool(struct mrsas_instance *);
2098 2015  int     create_mpi2_frame_pool(struct mrsas_instance *);
2099 2016  void    destroy_mpi2_frame_pool(struct mrsas_instance *);
2100 2017  int     mrsas_free_dma_obj(struct mrsas_instance *, dma_obj_t);
2101 2018  void    mrsas_tbolt_free_additional_dma_buffer(struct mrsas_instance *);
2102 2019  void    free_req_desc_pool(struct mrsas_instance *);
2103 2020  void    free_space_for_mpi2(struct mrsas_instance *);
2104 2021  void    mrsas_dump_reply_desc(struct mrsas_instance *);
2105 2022  void    tbolt_complete_cmd(struct mrsas_instance *, struct mrsas_cmd *);
2106      -void    io_timeout_checker(void *);
2107 2023  void    display_scsi_inquiry(caddr_t);
2108 2024  void    service_mfi_aen(struct mrsas_instance *, struct mrsas_cmd *);
2109 2025  int     mrsas_mode_sense_build(struct scsi_pkt *);
2110 2026  int     mrsas_tbolt_get_ld_map_info(struct mrsas_instance *);
2111      -void    mrsas_tbolt_set_pd_lba(U8 cdb[], uint8_t *cdb_len, U64 start_blk, U32 num_blocks, U8 DifCapable);
2112      -U8      mrsas_tbolt_check_map_info(struct mrsas_instance *);
2113 2027  struct mrsas_cmd *mrsas_tbolt_build_poll_cmd(struct mrsas_instance *,
2114 2028          struct scsi_address *, struct scsi_pkt *, uchar_t *);
2115 2029  int     mrsas_tbolt_reset_ppc(struct mrsas_instance *instance);
2116      -int     mrsas_tbolt_kill_adapter(struct mrsas_instance *instance);
     2030 +void    mrsas_tbolt_kill_adapter(struct mrsas_instance *instance);
2117 2031  int     abort_syncmap_cmd(struct mrsas_instance *, struct mrsas_cmd *);
2118      -void    mrsas_tbolt_prepare_cdb(struct mrsas_instance *instance, U8 cdb[],struct IO_REQUEST_INFO *,
2119      -        Mpi2RaidSCSIIORequest_t *, U32);
     2032 +void    mrsas_tbolt_prepare_cdb(struct mrsas_instance *instance, U8 cdb[],
     2033 +    struct IO_REQUEST_INFO *, Mpi2RaidSCSIIORequest_t *, U32);
2120 2034  
2121 2035  
2122      -static int
2123      -mrsas_undo_resources (dev_info_t *dip, struct mrsas_instance *instance);
     2036 +int mrsas_init_adapter_ppc(struct mrsas_instance *instance);
     2037 +int mrsas_init_adapter_tbolt(struct mrsas_instance *instance);
     2038 +int mrsas_init_adapter(struct mrsas_instance *instance);
2124 2039  
2125      -int mrsas_init_adapter_ppc (struct mrsas_instance *instance);
2126      -int mrsas_init_adapter_tbolt (struct mrsas_instance *instance);
2127      -int mrsas_init_adapter (struct mrsas_instance *instance);
2128      -
2129 2040  int mrsas_alloc_cmd_pool(struct mrsas_instance *instance);
2130 2041  void mrsas_free_cmd_pool(struct mrsas_instance *instance);
2131 2042  
2132      -void mrsas_print_cmd_details(struct mrsas_instance *, struct mrsas_cmd *, int );
     2043 +void mrsas_print_cmd_details(struct mrsas_instance *, struct mrsas_cmd *, int);
     2044 +struct mrsas_cmd *get_raid_msg_pkt(struct mrsas_instance *);
2133 2045  
     2046 +int mfi_state_transition_to_ready(struct mrsas_instance *);
     2047 +
     2048 +
     2049 +/* FMA functions. */
     2050 +int mrsas_common_check(struct mrsas_instance *, struct  mrsas_cmd *);
     2051 +void mrsas_fm_ereport(struct mrsas_instance *, char *);
     2052 +
     2053 +
2134 2054  #ifdef  __cplusplus
2135 2055  }
2136 2056  #endif
2137 2057  
2138 2058  #endif /* _MR_SAS_H_ */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX