Lines Matching +full:out +full:- +full:of +full:- +full:reset
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
4 * Copyright (c) 2011-2015 LSI Corp.
5 * Copyright (c) 2013-2015 Avago Technologies
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
14 * notice, this list of conditions and the following disclaimer in the
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
61 * mps_config_get_ioc_pg8 - obtain ioc page 8
64 * @config_page: contents of the config page
67 * Returns 0 for success, non-zero for failure.
86 goto out; in mps_config_get_ioc_pg8()
88 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_get_ioc_pg8()
90 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_get_ioc_pg8()
91 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER; in mps_config_get_ioc_pg8()
92 request->Header.PageType = MPI2_CONFIG_PAGETYPE_IOC; in mps_config_get_ioc_pg8()
93 request->Header.PageNumber = 8; in mps_config_get_ioc_pg8()
94 request->Header.PageVersion = MPI2_IOCPAGE8_PAGEVERSION; in mps_config_get_ioc_pg8()
95 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_get_ioc_pg8()
96 cm->cm_data = NULL; in mps_config_get_ioc_pg8()
99 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_get_ioc_pg8()
104 * reset in mps_config_get_ioc_pg8()
109 goto out; in mps_config_get_ioc_pg8()
111 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_get_ioc_pg8()
117 * reset in mps_config_get_ioc_pg8()
122 goto out; in mps_config_get_ioc_pg8()
124 /* We have to do free and alloc for the reply-free and reply-post in mps_config_get_ioc_pg8()
125 * counters to match - Need to review the reply FIFO handling. in mps_config_get_ioc_pg8()
133 goto out; in mps_config_get_ioc_pg8()
135 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_get_ioc_pg8()
137 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_get_ioc_pg8()
138 request->Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT; in mps_config_get_ioc_pg8()
139 request->Header.PageType = MPI2_CONFIG_PAGETYPE_IOC; in mps_config_get_ioc_pg8()
140 request->Header.PageNumber = 8; in mps_config_get_ioc_pg8()
141 request->Header.PageVersion = MPI2_IOCPAGE8_PAGEVERSION; in mps_config_get_ioc_pg8()
142 request->Header.PageLength = mpi_reply->Header.PageLength; in mps_config_get_ioc_pg8()
143 cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; in mps_config_get_ioc_pg8()
144 cm->cm_sge = &request->PageBufferSGE; in mps_config_get_ioc_pg8()
145 cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); in mps_config_get_ioc_pg8()
146 cm->cm_flags = MPS_CM_FLAGS_SGE_SIMPLE | MPS_CM_FLAGS_DATAIN; in mps_config_get_ioc_pg8()
147 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_get_ioc_pg8()
148 page = malloc((cm->cm_length), M_MPT2, M_ZERO | M_NOWAIT); in mps_config_get_ioc_pg8()
152 goto out; in mps_config_get_ioc_pg8()
154 cm->cm_data = page; in mps_config_get_ioc_pg8()
158 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_get_ioc_pg8()
163 * reset in mps_config_get_ioc_pg8()
168 goto out; in mps_config_get_ioc_pg8()
170 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_get_ioc_pg8()
176 * reset in mps_config_get_ioc_pg8()
181 goto out; in mps_config_get_ioc_pg8()
183 bcopy(page, config_page, MIN(cm->cm_length, (sizeof(Mpi2IOCPage8_t)))); in mps_config_get_ioc_pg8()
185 out: in mps_config_get_ioc_pg8()
193 * mps_config_get_man_pg10 - obtain Manufacturing Page 10 data and set flags
199 * Returns 0 for success, non-zero for failure.
219 goto out; in mps_config_get_man_pg10()
221 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_get_man_pg10()
223 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_get_man_pg10()
224 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER; in mps_config_get_man_pg10()
225 request->Header.PageType = MPI2_CONFIG_PAGETYPE_MANUFACTURING; in mps_config_get_man_pg10()
226 request->Header.PageNumber = 10; in mps_config_get_man_pg10()
227 request->Header.PageVersion = MPI2_MANUFACTURING10_PAGEVERSION; in mps_config_get_man_pg10()
228 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_get_man_pg10()
229 cm->cm_data = NULL; in mps_config_get_man_pg10()
237 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_get_man_pg10()
240 /* If the poll returns error then we need to do diag reset */ in mps_config_get_man_pg10()
244 goto out; in mps_config_get_man_pg10()
246 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_get_man_pg10()
250 /* If the poll returns error then we need to do diag reset */ in mps_config_get_man_pg10()
254 goto out; in mps_config_get_man_pg10()
256 /* We have to do free and alloc for the reply-free and reply-post in mps_config_get_man_pg10()
257 * counters to match - Need to review the reply FIFO handling. in mps_config_get_man_pg10()
265 goto out; in mps_config_get_man_pg10()
267 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_get_man_pg10()
269 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_get_man_pg10()
270 request->Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT; in mps_config_get_man_pg10()
271 request->Header.PageType = MPI2_CONFIG_PAGETYPE_MANUFACTURING; in mps_config_get_man_pg10()
272 request->Header.PageNumber = 10; in mps_config_get_man_pg10()
273 request->Header.PageVersion = MPI2_MANUFACTURING10_PAGEVERSION; in mps_config_get_man_pg10()
274 request->Header.PageLength = mpi_reply->Header.PageLength; in mps_config_get_man_pg10()
275 cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; in mps_config_get_man_pg10()
276 cm->cm_sge = &request->PageBufferSGE; in mps_config_get_man_pg10()
277 cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); in mps_config_get_man_pg10()
278 cm->cm_flags = MPS_CM_FLAGS_SGE_SIMPLE | MPS_CM_FLAGS_DATAIN; in mps_config_get_man_pg10()
279 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_get_man_pg10()
284 goto out; in mps_config_get_man_pg10()
286 cm->cm_data = page; in mps_config_get_man_pg10()
294 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_get_man_pg10()
297 /* If the poll returns error then we need to do diag reset */ in mps_config_get_man_pg10()
301 goto out; in mps_config_get_man_pg10()
303 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_get_man_pg10()
307 /* If the poll returns error then we need to do diag reset */ in mps_config_get_man_pg10()
311 goto out; in mps_config_get_man_pg10()
317 sc->WD_hide_expose = MPS_WD_HIDE_ALWAYS; in mps_config_get_man_pg10()
318 OEM_Value = (uint8_t)(page->ProductSpecificInfo & 0x000000FF); in mps_config_get_man_pg10()
323 goto out; in mps_config_get_man_pg10()
329 pPS_info = &page->ProductSpecificInfo; in mps_config_get_man_pg10()
330 sc->WD_hide_expose = (uint8_t)(pPS_info[5]); in mps_config_get_man_pg10()
331 sc->WD_hide_expose &= MPS_WD_HIDE_EXPOSE_MASK; in mps_config_get_man_pg10()
332 if ((sc->WD_hide_expose != MPS_WD_HIDE_ALWAYS) && in mps_config_get_man_pg10()
333 (sc->WD_hide_expose != MPS_WD_EXPOSE_ALWAYS) && in mps_config_get_man_pg10()
334 (sc->WD_hide_expose != MPS_WD_HIDE_IF_VOLUME)) { in mps_config_get_man_pg10()
336 "hide/expose: 0x%x\n", sc->WD_hide_expose); in mps_config_get_man_pg10()
338 goto out; in mps_config_get_man_pg10()
341 out: in mps_config_get_man_pg10()
349 * mps_base_static_config_pages - static start of day config pages.
361 while (mps_config_get_ioc_pg8(sc, &mpi_reply, &sc->ioc_pg8)) { in mps_base_static_config_pages()
372 * mps_wd_config_pages - get info required to support WarpDrive. This needs to
392 * hidden, hidden only if part of a WD volume, or never hidden. Also, in mps_wd_config_pages()
398 sc->WD_valid_config = FALSE; in mps_wd_config_pages()
399 if (sc->mps_flags & MPS_FLAGS_WD_AVAILABLE) { in mps_wd_config_pages()
404 sc->WD_hide_expose = MPS_WD_HIDE_ALWAYS; in mps_wd_config_pages()
415 goto out; in mps_wd_config_pages()
423 goto out; in mps_wd_config_pages()
429 * number of phys disks in the volume is no more than 8 in mps_wd_config_pages()
431 if ((raid_vol_pg0->VolumeType != MPI2_RAID_VOL_TYPE_RAID0) || in mps_wd_config_pages()
432 (raid_vol_pg0->NumPhysDisks > 8)) { in mps_wd_config_pages()
436 goto out; in mps_wd_config_pages()
442 sc->DD_max_lba = le64toh((uint64_t)raid_vol_pg0->MaxLBA.High << in mps_wd_config_pages()
443 32 | (uint64_t)raid_vol_pg0->MaxLBA.Low); in mps_wd_config_pages()
444 sc->DD_num_phys_disks = raid_vol_pg0->NumPhysDisks; in mps_wd_config_pages()
445 sc->DD_dev_handle = raid_vol_pg0->DevHandle; in mps_wd_config_pages()
446 sc->DD_stripe_size = raid_vol_pg0->StripeSize; in mps_wd_config_pages()
447 sc->DD_block_size = raid_vol_pg0->BlockSize; in mps_wd_config_pages()
450 * Find power of 2 of stripe size and set this as the exponent. in mps_wd_config_pages()
453 stripe_size = raid_vol_pg0->StripeSize; in mps_wd_config_pages()
464 goto out; in mps_wd_config_pages()
466 sc->DD_stripe_exponent = stripe_exp; in mps_wd_config_pages()
469 * Find power of 2 of block size and set this as the exponent. in mps_wd_config_pages()
472 block_size = raid_vol_pg0->BlockSize; in mps_wd_config_pages()
483 goto out; in mps_wd_config_pages()
485 sc->DD_block_exponent = block_exp; in mps_wd_config_pages()
488 * Loop through all of the volume's Phys Disks to map the phys in mps_wd_config_pages()
492 pRVPD = (pMpi2RaidVol0PhysDisk_t)&raid_vol_pg0->PhysDisk; in mps_wd_config_pages()
493 for (index = 0; index < raid_vol_pg0->NumPhysDisks; index++) { in mps_wd_config_pages()
494 sc->DD_column_map[pRVPD->PhysDiskMap].phys_disk_num = in mps_wd_config_pages()
495 pRVPD->PhysDiskNum; in mps_wd_config_pages()
505 raid_vol_pg0, (u32)raid_vol_pg0->DevHandle)) { in mps_wd_config_pages()
512 goto out; in mps_wd_config_pages()
518 goto out; in mps_wd_config_pages()
524 for (index = 0; index < raid_vol_pg0->NumPhysDisks; index++) { in mps_wd_config_pages()
527 sc->DD_column_map[index].phys_disk_num; in mps_wd_config_pages()
533 goto out; in mps_wd_config_pages()
539 goto out; in mps_wd_config_pages()
541 sc->DD_column_map[index].dev_handle = in mps_wd_config_pages()
544 sc->WD_valid_config = TRUE; in mps_wd_config_pages()
545 out: in mps_wd_config_pages()
552 * mps_config_get_dpm_pg0 - obtain driver persistent mapping page0
555 * @config_page: contents of the config page
556 * @sz: size of buffer passed in config_page
559 * Returns 0 for success, non-zero for failure.
579 goto out; in mps_config_get_dpm_pg0()
581 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_get_dpm_pg0()
583 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_get_dpm_pg0()
584 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER; in mps_config_get_dpm_pg0()
585 request->Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED; in mps_config_get_dpm_pg0()
586 request->ExtPageType = MPI2_CONFIG_EXTPAGETYPE_DRIVER_MAPPING; in mps_config_get_dpm_pg0()
587 request->Header.PageNumber = 0; in mps_config_get_dpm_pg0()
588 request->Header.PageVersion = MPI2_DRIVERMAPPING0_PAGEVERSION; in mps_config_get_dpm_pg0()
589 request->PageAddress = sc->max_dpm_entries << in mps_config_get_dpm_pg0()
591 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_get_dpm_pg0()
592 cm->cm_data = NULL; in mps_config_get_dpm_pg0()
595 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_get_dpm_pg0()
600 * reset in mps_config_get_dpm_pg0()
605 goto out; in mps_config_get_dpm_pg0()
607 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_get_dpm_pg0()
613 * reset in mps_config_get_dpm_pg0()
618 goto out; in mps_config_get_dpm_pg0()
620 /* We have to do free and alloc for the reply-free and reply-post in mps_config_get_dpm_pg0()
621 * counters to match - Need to review the reply FIFO handling. in mps_config_get_dpm_pg0()
629 goto out; in mps_config_get_dpm_pg0()
631 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_get_dpm_pg0()
633 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_get_dpm_pg0()
634 request->Action = MPI2_CONFIG_ACTION_PAGE_READ_NVRAM; in mps_config_get_dpm_pg0()
635 request->Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED; in mps_config_get_dpm_pg0()
636 request->ExtPageType = MPI2_CONFIG_EXTPAGETYPE_DRIVER_MAPPING; in mps_config_get_dpm_pg0()
637 request->Header.PageNumber = 0; in mps_config_get_dpm_pg0()
638 request->Header.PageVersion = MPI2_DRIVERMAPPING0_PAGEVERSION; in mps_config_get_dpm_pg0()
639 request->PageAddress = sc->max_dpm_entries << in mps_config_get_dpm_pg0()
641 request->ExtPageLength = mpi_reply->ExtPageLength; in mps_config_get_dpm_pg0()
642 cm->cm_length = le16toh(request->ExtPageLength) * 4; in mps_config_get_dpm_pg0()
643 cm->cm_sge = &request->PageBufferSGE; in mps_config_get_dpm_pg0()
644 cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); in mps_config_get_dpm_pg0()
645 cm->cm_flags = MPS_CM_FLAGS_SGE_SIMPLE | MPS_CM_FLAGS_DATAIN; in mps_config_get_dpm_pg0()
646 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_get_dpm_pg0()
647 page = malloc(cm->cm_length, M_MPT2, M_ZERO|M_NOWAIT); in mps_config_get_dpm_pg0()
651 goto out; in mps_config_get_dpm_pg0()
653 cm->cm_data = page; in mps_config_get_dpm_pg0()
656 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_get_dpm_pg0()
661 * reset in mps_config_get_dpm_pg0()
666 goto out; in mps_config_get_dpm_pg0()
668 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_get_dpm_pg0()
674 * reset in mps_config_get_dpm_pg0()
679 goto out; in mps_config_get_dpm_pg0()
681 bcopy(page, config_page, MIN(cm->cm_length, sz)); in mps_config_get_dpm_pg0()
682 out: in mps_config_get_dpm_pg0()
690 * mps_config_set_dpm_pg0 - write an entry in driver persistent mapping page0
693 * @config_page: contents of the config page
697 * Returns 0 for success, non-zero for failure.
716 goto out; in mps_config_set_dpm_pg0()
718 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_set_dpm_pg0()
720 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_set_dpm_pg0()
721 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER; in mps_config_set_dpm_pg0()
722 request->Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED; in mps_config_set_dpm_pg0()
723 request->ExtPageType = MPI2_CONFIG_EXTPAGETYPE_DRIVER_MAPPING; in mps_config_set_dpm_pg0()
724 request->Header.PageNumber = 0; in mps_config_set_dpm_pg0()
725 request->Header.PageVersion = MPI2_DRIVERMAPPING0_PAGEVERSION; in mps_config_set_dpm_pg0()
727 request->PageAddress = 1 << MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT; in mps_config_set_dpm_pg0()
728 request->PageAddress |= htole16(entry_idx); in mps_config_set_dpm_pg0()
729 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_set_dpm_pg0()
730 cm->cm_data = NULL; in mps_config_set_dpm_pg0()
733 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_set_dpm_pg0()
738 * reset in mps_config_set_dpm_pg0()
743 goto out; in mps_config_set_dpm_pg0()
745 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_set_dpm_pg0()
751 * reset in mps_config_set_dpm_pg0()
756 goto out; in mps_config_set_dpm_pg0()
758 /* We have to do free and alloc for the reply-free and reply-post in mps_config_set_dpm_pg0()
759 * counters to match - Need to review the reply FIFO handling. in mps_config_set_dpm_pg0()
767 goto out; in mps_config_set_dpm_pg0()
769 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_set_dpm_pg0()
771 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_set_dpm_pg0()
772 request->Action = MPI2_CONFIG_ACTION_PAGE_WRITE_NVRAM; in mps_config_set_dpm_pg0()
773 request->Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED; in mps_config_set_dpm_pg0()
774 request->ExtPageType = MPI2_CONFIG_EXTPAGETYPE_DRIVER_MAPPING; in mps_config_set_dpm_pg0()
775 request->Header.PageNumber = 0; in mps_config_set_dpm_pg0()
776 request->Header.PageVersion = MPI2_DRIVERMAPPING0_PAGEVERSION; in mps_config_set_dpm_pg0()
777 request->ExtPageLength = mpi_reply->ExtPageLength; in mps_config_set_dpm_pg0()
778 request->PageAddress = 1 << MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT; in mps_config_set_dpm_pg0()
779 request->PageAddress |= htole16(entry_idx); in mps_config_set_dpm_pg0()
780 cm->cm_length = le16toh(mpi_reply->ExtPageLength) * 4; in mps_config_set_dpm_pg0()
781 cm->cm_sge = &request->PageBufferSGE; in mps_config_set_dpm_pg0()
782 cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); in mps_config_set_dpm_pg0()
783 cm->cm_flags = MPS_CM_FLAGS_SGE_SIMPLE | MPS_CM_FLAGS_DATAOUT; in mps_config_set_dpm_pg0()
784 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_set_dpm_pg0()
785 page = malloc(cm->cm_length, M_MPT2, M_ZERO | M_NOWAIT); in mps_config_set_dpm_pg0()
789 goto out; in mps_config_set_dpm_pg0()
791 bcopy(config_page, page, MIN(cm->cm_length, in mps_config_set_dpm_pg0()
793 cm->cm_data = page; in mps_config_set_dpm_pg0()
796 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_set_dpm_pg0()
801 * reset in mps_config_set_dpm_pg0()
806 goto out; in mps_config_set_dpm_pg0()
808 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_set_dpm_pg0()
814 * reset in mps_config_set_dpm_pg0()
819 goto out; in mps_config_set_dpm_pg0()
821 out: in mps_config_set_dpm_pg0()
829 * mps_config_get_sas_device_pg0 - obtain sas device page 0
832 * @config_page: contents of the config page
837 * Returns 0 for success, non-zero for failure.
856 goto out; in mps_config_get_sas_device_pg0()
858 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_get_sas_device_pg0()
860 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_get_sas_device_pg0()
861 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER; in mps_config_get_sas_device_pg0()
862 request->Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED; in mps_config_get_sas_device_pg0()
863 request->ExtPageType = MPI2_CONFIG_EXTPAGETYPE_SAS_DEVICE; in mps_config_get_sas_device_pg0()
864 request->Header.PageNumber = 0; in mps_config_get_sas_device_pg0()
865 request->Header.PageVersion = MPI2_SASDEVICE0_PAGEVERSION; in mps_config_get_sas_device_pg0()
866 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_get_sas_device_pg0()
867 cm->cm_data = NULL; in mps_config_get_sas_device_pg0()
870 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_get_sas_device_pg0()
875 * reset in mps_config_get_sas_device_pg0()
880 goto out; in mps_config_get_sas_device_pg0()
882 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_get_sas_device_pg0()
888 * reset in mps_config_get_sas_device_pg0()
893 goto out; in mps_config_get_sas_device_pg0()
895 /* We have to do free and alloc for the reply-free and reply-post in mps_config_get_sas_device_pg0()
896 * counters to match - Need to review the reply FIFO handling. in mps_config_get_sas_device_pg0()
904 goto out; in mps_config_get_sas_device_pg0()
906 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_get_sas_device_pg0()
908 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_get_sas_device_pg0()
909 request->Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT; in mps_config_get_sas_device_pg0()
910 request->Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED; in mps_config_get_sas_device_pg0()
911 request->ExtPageType = MPI2_CONFIG_EXTPAGETYPE_SAS_DEVICE; in mps_config_get_sas_device_pg0()
912 request->Header.PageNumber = 0; in mps_config_get_sas_device_pg0()
913 request->Header.PageVersion = MPI2_SASDEVICE0_PAGEVERSION; in mps_config_get_sas_device_pg0()
914 request->ExtPageLength = mpi_reply->ExtPageLength; in mps_config_get_sas_device_pg0()
915 request->PageAddress = htole32(form | handle); in mps_config_get_sas_device_pg0()
916 cm->cm_length = le16toh(mpi_reply->ExtPageLength) * 4; in mps_config_get_sas_device_pg0()
917 cm->cm_sge = &request->PageBufferSGE; in mps_config_get_sas_device_pg0()
918 cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); in mps_config_get_sas_device_pg0()
919 cm->cm_flags = MPS_CM_FLAGS_SGE_SIMPLE | MPS_CM_FLAGS_DATAIN; in mps_config_get_sas_device_pg0()
920 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_get_sas_device_pg0()
921 page = malloc(cm->cm_length, M_MPT2, M_ZERO | M_NOWAIT); in mps_config_get_sas_device_pg0()
925 goto out; in mps_config_get_sas_device_pg0()
927 cm->cm_data = page; in mps_config_get_sas_device_pg0()
931 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_get_sas_device_pg0()
936 * reset in mps_config_get_sas_device_pg0()
941 goto out; in mps_config_get_sas_device_pg0()
943 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_get_sas_device_pg0()
949 * reset in mps_config_get_sas_device_pg0()
954 goto out; in mps_config_get_sas_device_pg0()
956 bcopy(page, config_page, MIN(cm->cm_length, in mps_config_get_sas_device_pg0()
958 out: in mps_config_get_sas_device_pg0()
966 * mps_config_get_bios_pg3 - obtain BIOS page 3
969 * @config_page: contents of the config page
972 * Returns 0 for success, non-zero for failure.
991 goto out; in mps_config_get_bios_pg3()
993 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_get_bios_pg3()
995 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_get_bios_pg3()
996 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER; in mps_config_get_bios_pg3()
997 request->Header.PageType = MPI2_CONFIG_PAGETYPE_BIOS; in mps_config_get_bios_pg3()
998 request->Header.PageNumber = 3; in mps_config_get_bios_pg3()
999 request->Header.PageVersion = MPI2_BIOSPAGE3_PAGEVERSION; in mps_config_get_bios_pg3()
1000 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_get_bios_pg3()
1001 cm->cm_data = NULL; in mps_config_get_bios_pg3()
1004 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_get_bios_pg3()
1009 * reset in mps_config_get_bios_pg3()
1014 goto out; in mps_config_get_bios_pg3()
1016 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_get_bios_pg3()
1022 * reset in mps_config_get_bios_pg3()
1027 goto out; in mps_config_get_bios_pg3()
1029 /* We have to do free and alloc for the reply-free and reply-post in mps_config_get_bios_pg3()
1030 * counters to match - Need to review the reply FIFO handling. in mps_config_get_bios_pg3()
1038 goto out; in mps_config_get_bios_pg3()
1040 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_get_bios_pg3()
1042 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_get_bios_pg3()
1043 request->Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT; in mps_config_get_bios_pg3()
1044 request->Header.PageType = MPI2_CONFIG_PAGETYPE_BIOS; in mps_config_get_bios_pg3()
1045 request->Header.PageNumber = 3; in mps_config_get_bios_pg3()
1046 request->Header.PageVersion = MPI2_BIOSPAGE3_PAGEVERSION; in mps_config_get_bios_pg3()
1047 request->Header.PageLength = mpi_reply->Header.PageLength; in mps_config_get_bios_pg3()
1048 cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; in mps_config_get_bios_pg3()
1049 cm->cm_sge = &request->PageBufferSGE; in mps_config_get_bios_pg3()
1050 cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); in mps_config_get_bios_pg3()
1051 cm->cm_flags = MPS_CM_FLAGS_SGE_SIMPLE | MPS_CM_FLAGS_DATAIN; in mps_config_get_bios_pg3()
1052 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_get_bios_pg3()
1053 page = malloc(cm->cm_length, M_MPT2, M_ZERO | M_NOWAIT); in mps_config_get_bios_pg3()
1057 goto out; in mps_config_get_bios_pg3()
1059 cm->cm_data = page; in mps_config_get_bios_pg3()
1063 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_get_bios_pg3()
1068 * reset in mps_config_get_bios_pg3()
1073 goto out; in mps_config_get_bios_pg3()
1075 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_get_bios_pg3()
1081 * reset in mps_config_get_bios_pg3()
1086 goto out; in mps_config_get_bios_pg3()
1088 bcopy(page, config_page, MIN(cm->cm_length, sizeof(Mpi2BiosPage3_t))); in mps_config_get_bios_pg3()
1089 out: in mps_config_get_bios_pg3()
1097 * mps_config_get_raid_volume_pg0 - obtain raid volume page 0
1100 * @config_page: contents of the config page
1104 * Returns 0 for success, non-zero for failure.
1123 goto out; in mps_config_get_raid_volume_pg0()
1125 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_get_raid_volume_pg0()
1127 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_get_raid_volume_pg0()
1128 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER; in mps_config_get_raid_volume_pg0()
1129 request->Header.PageType = MPI2_CONFIG_PAGETYPE_RAID_VOLUME; in mps_config_get_raid_volume_pg0()
1130 request->Header.PageNumber = 0; in mps_config_get_raid_volume_pg0()
1131 request->Header.PageVersion = MPI2_RAIDVOLPAGE0_PAGEVERSION; in mps_config_get_raid_volume_pg0()
1132 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_get_raid_volume_pg0()
1133 cm->cm_data = NULL; in mps_config_get_raid_volume_pg0()
1141 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_get_raid_volume_pg0()
1144 /* If the poll returns error then we need to do diag reset */ in mps_config_get_raid_volume_pg0()
1148 goto out; in mps_config_get_raid_volume_pg0()
1150 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_get_raid_volume_pg0()
1154 /* If the poll returns error then we need to do diag reset */ in mps_config_get_raid_volume_pg0()
1158 goto out; in mps_config_get_raid_volume_pg0()
1160 /* We have to do free and alloc for the reply-free and reply-post in mps_config_get_raid_volume_pg0()
1161 * counters to match - Need to review the reply FIFO handling. in mps_config_get_raid_volume_pg0()
1169 goto out; in mps_config_get_raid_volume_pg0()
1171 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_get_raid_volume_pg0()
1173 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_get_raid_volume_pg0()
1174 request->Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT; in mps_config_get_raid_volume_pg0()
1175 request->Header.PageType = MPI2_CONFIG_PAGETYPE_RAID_VOLUME; in mps_config_get_raid_volume_pg0()
1176 request->Header.PageNumber = 0; in mps_config_get_raid_volume_pg0()
1177 request->Header.PageLength = mpi_reply->Header.PageLength; in mps_config_get_raid_volume_pg0()
1178 request->Header.PageVersion = mpi_reply->Header.PageVersion; in mps_config_get_raid_volume_pg0()
1179 request->PageAddress = page_address; in mps_config_get_raid_volume_pg0()
1180 cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; in mps_config_get_raid_volume_pg0()
1181 cm->cm_sge = &request->PageBufferSGE; in mps_config_get_raid_volume_pg0()
1182 cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); in mps_config_get_raid_volume_pg0()
1183 cm->cm_flags = MPS_CM_FLAGS_SGE_SIMPLE | MPS_CM_FLAGS_DATAIN; in mps_config_get_raid_volume_pg0()
1184 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_get_raid_volume_pg0()
1185 page = malloc(cm->cm_length, M_MPT2, M_ZERO | M_NOWAIT); in mps_config_get_raid_volume_pg0()
1189 goto out; in mps_config_get_raid_volume_pg0()
1191 cm->cm_data = page; in mps_config_get_raid_volume_pg0()
1199 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_get_raid_volume_pg0()
1202 /* If the poll returns error then we need to do diag reset */ in mps_config_get_raid_volume_pg0()
1206 goto out; in mps_config_get_raid_volume_pg0()
1208 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_get_raid_volume_pg0()
1212 /* If the poll returns error then we need to do diag reset */ in mps_config_get_raid_volume_pg0()
1216 goto out; in mps_config_get_raid_volume_pg0()
1218 bcopy(page, config_page, cm->cm_length); in mps_config_get_raid_volume_pg0()
1219 out: in mps_config_get_raid_volume_pg0()
1227 * mps_config_get_raid_volume_pg1 - obtain raid volume page 1
1230 * @config_page: contents of the config page
1235 * Returns 0 for success, non-zero for failure.
1254 goto out; in mps_config_get_raid_volume_pg1()
1256 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_get_raid_volume_pg1()
1258 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_get_raid_volume_pg1()
1259 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER; in mps_config_get_raid_volume_pg1()
1260 request->Header.PageType = MPI2_CONFIG_PAGETYPE_RAID_VOLUME; in mps_config_get_raid_volume_pg1()
1261 request->Header.PageNumber = 1; in mps_config_get_raid_volume_pg1()
1262 request->Header.PageVersion = MPI2_RAIDVOLPAGE1_PAGEVERSION; in mps_config_get_raid_volume_pg1()
1263 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_get_raid_volume_pg1()
1264 cm->cm_data = NULL; in mps_config_get_raid_volume_pg1()
1267 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_get_raid_volume_pg1()
1272 * reset in mps_config_get_raid_volume_pg1()
1277 goto out; in mps_config_get_raid_volume_pg1()
1279 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_get_raid_volume_pg1()
1285 * reset in mps_config_get_raid_volume_pg1()
1290 goto out; in mps_config_get_raid_volume_pg1()
1292 /* We have to do free and alloc for the reply-free and reply-post in mps_config_get_raid_volume_pg1()
1293 * counters to match - Need to review the reply FIFO handling. in mps_config_get_raid_volume_pg1()
1301 goto out; in mps_config_get_raid_volume_pg1()
1303 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_get_raid_volume_pg1()
1305 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_get_raid_volume_pg1()
1306 request->Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT; in mps_config_get_raid_volume_pg1()
1307 request->Header.PageType = MPI2_CONFIG_PAGETYPE_RAID_VOLUME; in mps_config_get_raid_volume_pg1()
1308 request->Header.PageNumber = 1; in mps_config_get_raid_volume_pg1()
1309 request->Header.PageLength = mpi_reply->Header.PageLength; in mps_config_get_raid_volume_pg1()
1310 request->Header.PageVersion = mpi_reply->Header.PageVersion; in mps_config_get_raid_volume_pg1()
1311 request->PageAddress = htole32(form | handle); in mps_config_get_raid_volume_pg1()
1312 cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; in mps_config_get_raid_volume_pg1()
1313 cm->cm_sge = &request->PageBufferSGE; in mps_config_get_raid_volume_pg1()
1314 cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); in mps_config_get_raid_volume_pg1()
1315 cm->cm_flags = MPS_CM_FLAGS_SGE_SIMPLE | MPS_CM_FLAGS_DATAIN; in mps_config_get_raid_volume_pg1()
1316 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_get_raid_volume_pg1()
1317 page = malloc(cm->cm_length, M_MPT2, M_ZERO | M_NOWAIT); in mps_config_get_raid_volume_pg1()
1321 goto out; in mps_config_get_raid_volume_pg1()
1323 cm->cm_data = page; in mps_config_get_raid_volume_pg1()
1327 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_get_raid_volume_pg1()
1332 * reset in mps_config_get_raid_volume_pg1()
1337 goto out; in mps_config_get_raid_volume_pg1()
1339 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_get_raid_volume_pg1()
1345 * reset in mps_config_get_raid_volume_pg1()
1350 goto out; in mps_config_get_raid_volume_pg1()
1352 bcopy(page, config_page, MIN(cm->cm_length, in mps_config_get_raid_volume_pg1()
1354 out: in mps_config_get_raid_volume_pg1()
1362 * mps_config_get_volume_wwid - returns wwid given the volume handle
1368 * Returns 0 for success, non-zero for failure.
1383 return -1; in mps_config_get_volume_wwid()
1387 * mps_config_get_pd_pg0 - obtain raid phys disk page 0
1390 * @config_page: contents of the config page
1394 * Returns 0 for success, non-zero for failure.
1413 goto out; in mps_config_get_raid_pd_pg0()
1415 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_get_raid_pd_pg0()
1417 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_get_raid_pd_pg0()
1418 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER; in mps_config_get_raid_pd_pg0()
1419 request->Header.PageType = MPI2_CONFIG_PAGETYPE_RAID_PHYSDISK; in mps_config_get_raid_pd_pg0()
1420 request->Header.PageNumber = 0; in mps_config_get_raid_pd_pg0()
1421 request->Header.PageVersion = MPI2_RAIDPHYSDISKPAGE0_PAGEVERSION; in mps_config_get_raid_pd_pg0()
1422 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_get_raid_pd_pg0()
1423 cm->cm_data = NULL; in mps_config_get_raid_pd_pg0()
1431 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_get_raid_pd_pg0()
1434 /* If the poll returns error then we need to do diag reset */ in mps_config_get_raid_pd_pg0()
1438 goto out; in mps_config_get_raid_pd_pg0()
1440 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_get_raid_pd_pg0()
1444 /* If the poll returns error then we need to do diag reset */ in mps_config_get_raid_pd_pg0()
1448 goto out; in mps_config_get_raid_pd_pg0()
1450 /* We have to do free and alloc for the reply-free and reply-post in mps_config_get_raid_pd_pg0()
1451 * counters to match - Need to review the reply FIFO handling. in mps_config_get_raid_pd_pg0()
1459 goto out; in mps_config_get_raid_pd_pg0()
1461 request = (MPI2_CONFIG_REQUEST *)cm->cm_req; in mps_config_get_raid_pd_pg0()
1463 request->Function = MPI2_FUNCTION_CONFIG; in mps_config_get_raid_pd_pg0()
1464 request->Action = MPI2_CONFIG_ACTION_PAGE_READ_CURRENT; in mps_config_get_raid_pd_pg0()
1465 request->Header.PageType = MPI2_CONFIG_PAGETYPE_RAID_PHYSDISK; in mps_config_get_raid_pd_pg0()
1466 request->Header.PageNumber = 0; in mps_config_get_raid_pd_pg0()
1467 request->Header.PageLength = mpi_reply->Header.PageLength; in mps_config_get_raid_pd_pg0()
1468 request->Header.PageVersion = mpi_reply->Header.PageVersion; in mps_config_get_raid_pd_pg0()
1469 request->PageAddress = page_address; in mps_config_get_raid_pd_pg0()
1470 cm->cm_length = le16toh(mpi_reply->Header.PageLength) * 4; in mps_config_get_raid_pd_pg0()
1471 cm->cm_sge = &request->PageBufferSGE; in mps_config_get_raid_pd_pg0()
1472 cm->cm_sglsize = sizeof(MPI2_SGE_IO_UNION); in mps_config_get_raid_pd_pg0()
1473 cm->cm_flags = MPS_CM_FLAGS_SGE_SIMPLE | MPS_CM_FLAGS_DATAIN; in mps_config_get_raid_pd_pg0()
1474 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; in mps_config_get_raid_pd_pg0()
1475 page = malloc(cm->cm_length, M_MPT2, M_ZERO | M_NOWAIT); in mps_config_get_raid_pd_pg0()
1479 goto out; in mps_config_get_raid_pd_pg0()
1481 cm->cm_data = page; in mps_config_get_raid_pd_pg0()
1489 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply; in mps_config_get_raid_pd_pg0()
1492 /* If the poll returns error then we need to do diag reset */ in mps_config_get_raid_pd_pg0()
1496 goto out; in mps_config_get_raid_pd_pg0()
1498 ioc_status = le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK; in mps_config_get_raid_pd_pg0()
1502 /* If the poll returns error then we need to do diag reset */ in mps_config_get_raid_pd_pg0()
1506 goto out; in mps_config_get_raid_pd_pg0()
1508 bcopy(page, config_page, MIN(cm->cm_length, in mps_config_get_raid_pd_pg0()
1510 out: in mps_config_get_raid_pd_pg0()