74 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_type.h>
75 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2.h>
76 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_cnfg.h>
77 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_init.h>
78 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_ioc.h>
79 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_raid.h>
80 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_tool.h>
81
82 #pragma pack()
83
84 /*
85 * private header files.
86 */
87 #include <sys/scsi/adapters/mpt_sas/mptsas_var.h>
88
89 static int mptsas_get_raid_wwid(mptsas_t *mpt, mptsas_raidvol_t *raidvol);
90
91 extern int mptsas_check_dma_handle(ddi_dma_handle_t handle);
92 extern int mptsas_check_acc_handle(ddi_acc_handle_t handle);
93 extern mptsas_target_t *mptsas_tgt_alloc(mptsas_hash_table_t *, uint16_t,
94 uint64_t, uint32_t, mptsas_phymask_t, uint8_t, mptsas_t *);
95
96 static int
97 mptsas_raidconf_page_0_cb(mptsas_t *mpt, caddr_t page_memp,
98 ddi_acc_handle_t accessp, uint16_t iocstatus, uint32_t iocloginfo,
99 va_list ap)
100 {
101 #ifndef __lock_lint
102 _NOTE(ARGUNUSED(ap))
103 #endif
104 pMpi2RaidConfigurationPage0_t raidconfig_page0;
105 pMpi2RaidConfig0ConfigElement_t element;
106 uint32_t *confignum;
107 int rval = DDI_SUCCESS, i;
108 uint8_t numelements, vol, disk;
109 uint16_t elementtype, voldevhandle;
110 uint16_t etype_vol, etype_pd, etype_hs;
111 uint16_t etype_oce;
112 mptsas_slots_t *slots = mpt->m_active;
113 m_raidconfig_t *raidconfig;
114 uint64_t raidwwn;
199 */
200 if (mptsas_get_raid_settings(mpt,
201 &raidconfig->m_raidvol[vol]))
202 continue;
203
204 /*
205 * Get the WWID of the RAID volume for
206 * SAS HBA
207 */
208 if (mptsas_get_raid_wwid(mpt,
209 &raidconfig->m_raidvol[vol]))
210 continue;
211
212 raidwwn = raidconfig->m_raidvol[vol].
213 m_raidwwid;
214
215 /*
216 * RAID uses phymask of 0.
217 */
218 ptgt = mptsas_tgt_alloc(&slots->m_tgttbl,
219 voldevhandle, raidwwn, 0, 0, 0, mpt);
220
221 raidconfig->m_raidvol[vol].m_raidtgt =
222 ptgt;
223
224 /*
225 * Increment volume index within this
226 * raid config.
227 */
228 vol++;
229 } else if ((elementtype == etype_pd) ||
230 (elementtype == etype_hs) ||
231 (elementtype == etype_oce)) {
232 /*
233 * For all other element types, put
234 * their DevHandles in the phys disk
235 * list of the config. These are all
236 * some variation of a Phys Disk and
237 * this list is used to keep these
238 * disks from going online.
239 */
|
74 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_type.h>
75 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2.h>
76 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_cnfg.h>
77 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_init.h>
78 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_ioc.h>
79 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_raid.h>
80 #include <sys/scsi/adapters/mpt_sas/mpi/mpi2_tool.h>
81
82 #pragma pack()
83
84 /*
85 * private header files.
86 */
87 #include <sys/scsi/adapters/mpt_sas/mptsas_var.h>
88
89 static int mptsas_get_raid_wwid(mptsas_t *mpt, mptsas_raidvol_t *raidvol);
90
91 extern int mptsas_check_dma_handle(ddi_dma_handle_t handle);
92 extern int mptsas_check_acc_handle(ddi_acc_handle_t handle);
93 extern mptsas_target_t *mptsas_tgt_alloc(mptsas_hash_table_t *, uint16_t,
94 uint64_t, uint32_t, mptsas_phymask_t, uint8_t);
95
96 static int
97 mptsas_raidconf_page_0_cb(mptsas_t *mpt, caddr_t page_memp,
98 ddi_acc_handle_t accessp, uint16_t iocstatus, uint32_t iocloginfo,
99 va_list ap)
100 {
101 #ifndef __lock_lint
102 _NOTE(ARGUNUSED(ap))
103 #endif
104 pMpi2RaidConfigurationPage0_t raidconfig_page0;
105 pMpi2RaidConfig0ConfigElement_t element;
106 uint32_t *confignum;
107 int rval = DDI_SUCCESS, i;
108 uint8_t numelements, vol, disk;
109 uint16_t elementtype, voldevhandle;
110 uint16_t etype_vol, etype_pd, etype_hs;
111 uint16_t etype_oce;
112 mptsas_slots_t *slots = mpt->m_active;
113 m_raidconfig_t *raidconfig;
114 uint64_t raidwwn;
199 */
200 if (mptsas_get_raid_settings(mpt,
201 &raidconfig->m_raidvol[vol]))
202 continue;
203
204 /*
205 * Get the WWID of the RAID volume for
206 * SAS HBA
207 */
208 if (mptsas_get_raid_wwid(mpt,
209 &raidconfig->m_raidvol[vol]))
210 continue;
211
212 raidwwn = raidconfig->m_raidvol[vol].
213 m_raidwwid;
214
215 /*
216 * RAID uses phymask of 0.
217 */
218 ptgt = mptsas_tgt_alloc(&slots->m_tgttbl,
219 voldevhandle, raidwwn, 0, 0, 0);
220
221 raidconfig->m_raidvol[vol].m_raidtgt =
222 ptgt;
223
224 /*
225 * Increment volume index within this
226 * raid config.
227 */
228 vol++;
229 } else if ((elementtype == etype_pd) ||
230 (elementtype == etype_hs) ||
231 (elementtype == etype_oce)) {
232 /*
233 * For all other element types, put
234 * their DevHandles in the phys disk
235 * list of the config. These are all
236 * some variation of a Phys Disk and
237 * this list is used to keep these
238 * disks from going online.
239 */
|