Deleted Added
full compact
mps_config.c (319436) mps_config.c (322661)
1/*-
2 * Copyright (c) 2011-2015 LSI Corp.
3 * Copyright (c) 2013-2015 Avago Technologies
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:

--- 14 unchanged lines hidden (view full) ---

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 * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
28 */
29
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2011-2015 LSI Corp.
3 * Copyright (c) 2013-2015 Avago Technologies
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:

--- 14 unchanged lines hidden (view full) ---

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 * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
28 */
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: stable/10/sys/dev/mps/mps_config.c 319436 2017-06-01 15:43:24Z slm $");
31__FBSDID("$FreeBSD: stable/10/sys/dev/mps/mps_config.c 322661 2017-08-18 15:38:08Z ken $");
32
33/* TODO Move headers to mpsvar */
34#include <sys/types.h>
35#include <sys/param.h>
36#include <sys/lock.h>
37#include <sys/mutex.h>
38#include <sys/systm.h>
39#include <sys/kernel.h>

--- 26 unchanged lines hidden (view full) ---

66 *
67 * Returns 0 for success, non-zero for failure.
68 */
69int
70mps_config_get_ioc_pg8(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply,
71 Mpi2IOCPage8_t *config_page)
72{
73 MPI2_CONFIG_REQUEST *request;
32
33/* TODO Move headers to mpsvar */
34#include <sys/types.h>
35#include <sys/param.h>
36#include <sys/lock.h>
37#include <sys/mutex.h>
38#include <sys/systm.h>
39#include <sys/kernel.h>

--- 26 unchanged lines hidden (view full) ---

66 *
67 * Returns 0 for success, non-zero for failure.
68 */
69int
70mps_config_get_ioc_pg8(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply,
71 Mpi2IOCPage8_t *config_page)
72{
73 MPI2_CONFIG_REQUEST *request;
74 MPI2_CONFIG_REPLY *reply;
74 MPI2_CONFIG_REPLY *reply = NULL;
75 struct mps_command *cm;
76 MPI2_CONFIG_PAGE_IOC_8 *page = NULL;
77 int error = 0;
78 u16 ioc_status;
79
80 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
81
82 if ((cm = mps_alloc_command(sc)) == NULL) {

--- 6 unchanged lines hidden (view full) ---

89 bzero(request, sizeof(MPI2_CONFIG_REQUEST));
90 request->Function = MPI2_FUNCTION_CONFIG;
91 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
92 request->Header.PageType = MPI2_CONFIG_PAGETYPE_IOC;
93 request->Header.PageNumber = 8;
94 request->Header.PageVersion = MPI2_IOCPAGE8_PAGEVERSION;
95 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
96 cm->cm_data = NULL;
75 struct mps_command *cm;
76 MPI2_CONFIG_PAGE_IOC_8 *page = NULL;
77 int error = 0;
78 u16 ioc_status;
79
80 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
81
82 if ((cm = mps_alloc_command(sc)) == NULL) {

--- 6 unchanged lines hidden (view full) ---

89 bzero(request, sizeof(MPI2_CONFIG_REQUEST));
90 request->Function = MPI2_FUNCTION_CONFIG;
91 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
92 request->Header.PageType = MPI2_CONFIG_PAGETYPE_IOC;
93 request->Header.PageNumber = 8;
94 request->Header.PageVersion = MPI2_IOCPAGE8_PAGEVERSION;
95 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
96 cm->cm_data = NULL;
97 error = mps_wait_command(sc, cm, 60, CAN_SLEEP);
98 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
97 error = mps_wait_command(sc, &cm, 60, CAN_SLEEP);
98 if (cm != NULL)
99 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
99 if (error || (reply == NULL)) {
100 /* FIXME */
101 /*
102 * If the request returns an error then we need to do a diag
103 * reset
104 */
105 printf("%s: request for header completed with error %d",
106 __func__, error);

--- 40 unchanged lines hidden (view full) ---

147 page = malloc((cm->cm_length), M_MPT2, M_ZERO | M_NOWAIT);
148 if (!page) {
149 printf("%s: page alloc failed\n", __func__);
150 error = ENOMEM;
151 goto out;
152 }
153 cm->cm_data = page;
154
100 if (error || (reply == NULL)) {
101 /* FIXME */
102 /*
103 * If the request returns an error then we need to do a diag
104 * reset
105 */
106 printf("%s: request for header completed with error %d",
107 __func__, error);

--- 40 unchanged lines hidden (view full) ---

148 page = malloc((cm->cm_length), M_MPT2, M_ZERO | M_NOWAIT);
149 if (!page) {
150 printf("%s: page alloc failed\n", __func__);
151 error = ENOMEM;
152 goto out;
153 }
154 cm->cm_data = page;
155
155 error = mps_wait_command(sc, cm, 60, CAN_SLEEP);
156 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
156 error = mps_wait_command(sc, &cm, 60, CAN_SLEEP);
157 if (cm != NULL)
158 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
157 if (error || (reply == NULL)) {
158 /* FIXME */
159 /*
160 * If the request returns an error then we need to do a diag
161 * reset
162 */
163 printf("%s: request for page completed with error %d",
164 __func__, error);

--- 30 unchanged lines hidden (view full) ---

195 * Context: sleep.
196 *
197 * Returns 0 for success, non-zero for failure.
198 */
199int
200mps_config_get_man_pg10(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply)
201{
202 MPI2_CONFIG_REQUEST *request;
159 if (error || (reply == NULL)) {
160 /* FIXME */
161 /*
162 * If the request returns an error then we need to do a diag
163 * reset
164 */
165 printf("%s: request for page completed with error %d",
166 __func__, error);

--- 30 unchanged lines hidden (view full) ---

197 * Context: sleep.
198 *
199 * Returns 0 for success, non-zero for failure.
200 */
201int
202mps_config_get_man_pg10(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply)
203{
204 MPI2_CONFIG_REQUEST *request;
203 MPI2_CONFIG_REPLY *reply;
205 MPI2_CONFIG_REPLY *reply = NULL;
204 struct mps_command *cm;
205 pMpi2ManufacturingPagePS_t page = NULL;
206 uint32_t *pPS_info;
207 uint8_t OEM_Value = 0;
208 int error = 0;
209 u16 ioc_status;
210
211 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);

--- 13 unchanged lines hidden (view full) ---

225 request->Header.PageVersion = MPI2_MANUFACTURING10_PAGEVERSION;
226 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
227 cm->cm_data = NULL;
228
229 /*
230 * This page must be polled because the IOC isn't ready yet when this
231 * page is needed.
232 */
206 struct mps_command *cm;
207 pMpi2ManufacturingPagePS_t page = NULL;
208 uint32_t *pPS_info;
209 uint8_t OEM_Value = 0;
210 int error = 0;
211 u16 ioc_status;
212
213 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);

--- 13 unchanged lines hidden (view full) ---

227 request->Header.PageVersion = MPI2_MANUFACTURING10_PAGEVERSION;
228 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
229 cm->cm_data = NULL;
230
231 /*
232 * This page must be polled because the IOC isn't ready yet when this
233 * page is needed.
234 */
233 error = mps_wait_command(sc, cm, 60, 0);
234 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
235 error = mps_wait_command(sc, &cm, 60, 0);
236 if (cm != NULL)
237 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
235 if (error || (reply == NULL)) {
236 /* FIXME */
237 /* If the poll returns error then we need to do diag reset */
238 printf("%s: poll for header completed with error %d",
239 __func__, error);
240 error = ENXIO;
241 goto out;
242 }

--- 38 unchanged lines hidden (view full) ---

281 goto out;
282 }
283 cm->cm_data = page;
284
285 /*
286 * This page must be polled because the IOC isn't ready yet when this
287 * page is needed.
288 */
238 if (error || (reply == NULL)) {
239 /* FIXME */
240 /* If the poll returns error then we need to do diag reset */
241 printf("%s: poll for header completed with error %d",
242 __func__, error);
243 error = ENXIO;
244 goto out;
245 }

--- 38 unchanged lines hidden (view full) ---

284 goto out;
285 }
286 cm->cm_data = page;
287
288 /*
289 * This page must be polled because the IOC isn't ready yet when this
290 * page is needed.
291 */
289 error = mps_wait_command(sc, cm, 60, 0);
290 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
292 error = mps_wait_command(sc, &cm, 60, 0);
293 if (cm != NULL)
294 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
291 if (error || (reply == NULL)) {
292 /* FIXME */
293 /* If the poll returns error then we need to do diag reset */
294 printf("%s: poll for page completed with error %d",
295 __func__, error);
296 error = ENXIO;
297 goto out;
298 }

--- 255 unchanged lines hidden (view full) ---

554 *
555 * Returns 0 for success, non-zero for failure.
556 */
557int
558mps_config_get_dpm_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply,
559 Mpi2DriverMappingPage0_t *config_page, u16 sz)
560{
561 MPI2_CONFIG_REQUEST *request;
295 if (error || (reply == NULL)) {
296 /* FIXME */
297 /* If the poll returns error then we need to do diag reset */
298 printf("%s: poll for page completed with error %d",
299 __func__, error);
300 error = ENXIO;
301 goto out;
302 }

--- 255 unchanged lines hidden (view full) ---

558 *
559 * Returns 0 for success, non-zero for failure.
560 */
561int
562mps_config_get_dpm_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply,
563 Mpi2DriverMappingPage0_t *config_page, u16 sz)
564{
565 MPI2_CONFIG_REQUEST *request;
562 MPI2_CONFIG_REPLY *reply;
566 MPI2_CONFIG_REPLY *reply = NULL;
563 struct mps_command *cm;
564 Mpi2DriverMappingPage0_t *page = NULL;
565 int error = 0;
566 u16 ioc_status;
567
568 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
569
570 memset(config_page, 0, sz);

--- 10 unchanged lines hidden (view full) ---

581 request->Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
582 request->ExtPageType = MPI2_CONFIG_EXTPAGETYPE_DRIVER_MAPPING;
583 request->Header.PageNumber = 0;
584 request->Header.PageVersion = MPI2_DRIVERMAPPING0_PAGEVERSION;
585 request->PageAddress = sc->max_dpm_entries <<
586 MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT;
587 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
588 cm->cm_data = NULL;
567 struct mps_command *cm;
568 Mpi2DriverMappingPage0_t *page = NULL;
569 int error = 0;
570 u16 ioc_status;
571
572 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
573
574 memset(config_page, 0, sz);

--- 10 unchanged lines hidden (view full) ---

585 request->Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
586 request->ExtPageType = MPI2_CONFIG_EXTPAGETYPE_DRIVER_MAPPING;
587 request->Header.PageNumber = 0;
588 request->Header.PageVersion = MPI2_DRIVERMAPPING0_PAGEVERSION;
589 request->PageAddress = sc->max_dpm_entries <<
590 MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT;
591 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
592 cm->cm_data = NULL;
589 error = mps_wait_command(sc, cm, 60, CAN_SLEEP);
590 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
593 error = mps_wait_command(sc, &cm, 60, CAN_SLEEP);
594 if (cm != NULL)
595 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
591 if (error || (reply == NULL)) {
592 /* FIXME */
593 /*
594 * If the request returns an error then we need to do a diag
595 * reset
596 */
597 printf("%s: request for header completed with error %d",
598 __func__, error);

--- 42 unchanged lines hidden (view full) ---

641 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
642 page = malloc(cm->cm_length, M_MPT2, M_ZERO|M_NOWAIT);
643 if (!page) {
644 printf("%s: page alloc failed\n", __func__);
645 error = ENOMEM;
646 goto out;
647 }
648 cm->cm_data = page;
596 if (error || (reply == NULL)) {
597 /* FIXME */
598 /*
599 * If the request returns an error then we need to do a diag
600 * reset
601 */
602 printf("%s: request for header completed with error %d",
603 __func__, error);

--- 42 unchanged lines hidden (view full) ---

646 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
647 page = malloc(cm->cm_length, M_MPT2, M_ZERO|M_NOWAIT);
648 if (!page) {
649 printf("%s: page alloc failed\n", __func__);
650 error = ENOMEM;
651 goto out;
652 }
653 cm->cm_data = page;
649 error = mps_wait_command(sc, cm, 60, CAN_SLEEP);
650 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
654 error = mps_wait_command(sc, &cm, 60, CAN_SLEEP);
655 if (cm != NULL)
656 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
651 if (error || (reply == NULL)) {
652 /* FIXME */
653 /*
654 * If the request returns an error then we need to do a diag
655 * reset
656 */
657 printf("%s: request for page completed with error %d",
658 __func__, error);

--- 31 unchanged lines hidden (view full) ---

690 *
691 * Returns 0 for success, non-zero for failure.
692 */
693
694int mps_config_set_dpm_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply,
695 Mpi2DriverMappingPage0_t *config_page, u16 entry_idx)
696{
697 MPI2_CONFIG_REQUEST *request;
657 if (error || (reply == NULL)) {
658 /* FIXME */
659 /*
660 * If the request returns an error then we need to do a diag
661 * reset
662 */
663 printf("%s: request for page completed with error %d",
664 __func__, error);

--- 31 unchanged lines hidden (view full) ---

696 *
697 * Returns 0 for success, non-zero for failure.
698 */
699
700int mps_config_set_dpm_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply,
701 Mpi2DriverMappingPage0_t *config_page, u16 entry_idx)
702{
703 MPI2_CONFIG_REQUEST *request;
698 MPI2_CONFIG_REPLY *reply;
704 MPI2_CONFIG_REPLY *reply = NULL;
699 struct mps_command *cm;
700 MPI2_CONFIG_PAGE_DRIVER_MAPPING_0 *page = NULL;
701 int error = 0;
702 u16 ioc_status;
703
704 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
705
706 if ((cm = mps_alloc_command(sc)) == NULL) {

--- 10 unchanged lines hidden (view full) ---

717 request->ExtPageType = MPI2_CONFIG_EXTPAGETYPE_DRIVER_MAPPING;
718 request->Header.PageNumber = 0;
719 request->Header.PageVersion = MPI2_DRIVERMAPPING0_PAGEVERSION;
720 /* We can remove below two lines ????*/
721 request->PageAddress = 1 << MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT;
722 request->PageAddress |= htole16(entry_idx);
723 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
724 cm->cm_data = NULL;
705 struct mps_command *cm;
706 MPI2_CONFIG_PAGE_DRIVER_MAPPING_0 *page = NULL;
707 int error = 0;
708 u16 ioc_status;
709
710 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
711
712 if ((cm = mps_alloc_command(sc)) == NULL) {

--- 10 unchanged lines hidden (view full) ---

723 request->ExtPageType = MPI2_CONFIG_EXTPAGETYPE_DRIVER_MAPPING;
724 request->Header.PageNumber = 0;
725 request->Header.PageVersion = MPI2_DRIVERMAPPING0_PAGEVERSION;
726 /* We can remove below two lines ????*/
727 request->PageAddress = 1 << MPI2_DPM_PGAD_ENTRY_COUNT_SHIFT;
728 request->PageAddress |= htole16(entry_idx);
729 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
730 cm->cm_data = NULL;
725 error = mps_wait_command(sc, cm, 60, CAN_SLEEP);
726 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
731 error = mps_wait_command(sc, &cm, 60, CAN_SLEEP);
732 if (cm != NULL)
733 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
727 if (error || (reply == NULL)) {
728 /* FIXME */
729 /*
730 * If the request returns an error then we need to do a diag
731 * reset
732 */
733 printf("%s: request for header completed with error %d",
734 __func__, error);

--- 44 unchanged lines hidden (view full) ---

779 if (!page) {
780 printf("%s: page alloc failed\n", __func__);
781 error = ENOMEM;
782 goto out;
783 }
784 bcopy(config_page, page, MIN(cm->cm_length,
785 (sizeof(Mpi2DriverMappingPage0_t))));
786 cm->cm_data = page;
734 if (error || (reply == NULL)) {
735 /* FIXME */
736 /*
737 * If the request returns an error then we need to do a diag
738 * reset
739 */
740 printf("%s: request for header completed with error %d",
741 __func__, error);

--- 44 unchanged lines hidden (view full) ---

786 if (!page) {
787 printf("%s: page alloc failed\n", __func__);
788 error = ENOMEM;
789 goto out;
790 }
791 bcopy(config_page, page, MIN(cm->cm_length,
792 (sizeof(Mpi2DriverMappingPage0_t))));
793 cm->cm_data = page;
787 error = mps_wait_command(sc, cm, 60, CAN_SLEEP);
788 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
794 error = mps_wait_command(sc, &cm, 60, CAN_SLEEP);
795 if (cm != NULL)
796 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
789 if (error || (reply == NULL)) {
790 /* FIXME */
791 /*
792 * If the request returns an error then we need to do a diag
793 * reset
794 */
795 printf("%s: request to write page completed with error %d",
796 __func__, error);

--- 31 unchanged lines hidden (view full) ---

828 *
829 * Returns 0 for success, non-zero for failure.
830 */
831int
832mps_config_get_sas_device_pg0(struct mps_softc *sc, Mpi2ConfigReply_t
833 *mpi_reply, Mpi2SasDevicePage0_t *config_page, u32 form, u16 handle)
834{
835 MPI2_CONFIG_REQUEST *request;
797 if (error || (reply == NULL)) {
798 /* FIXME */
799 /*
800 * If the request returns an error then we need to do a diag
801 * reset
802 */
803 printf("%s: request to write page completed with error %d",
804 __func__, error);

--- 31 unchanged lines hidden (view full) ---

836 *
837 * Returns 0 for success, non-zero for failure.
838 */
839int
840mps_config_get_sas_device_pg0(struct mps_softc *sc, Mpi2ConfigReply_t
841 *mpi_reply, Mpi2SasDevicePage0_t *config_page, u32 form, u16 handle)
842{
843 MPI2_CONFIG_REQUEST *request;
836 MPI2_CONFIG_REPLY *reply;
844 MPI2_CONFIG_REPLY *reply = NULL;
837 struct mps_command *cm;
838 Mpi2SasDevicePage0_t *page = NULL;
839 int error = 0;
840 u16 ioc_status;
841
842 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
843
844 if ((cm = mps_alloc_command(sc)) == NULL) {

--- 7 unchanged lines hidden (view full) ---

852 request->Function = MPI2_FUNCTION_CONFIG;
853 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
854 request->Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
855 request->ExtPageType = MPI2_CONFIG_EXTPAGETYPE_SAS_DEVICE;
856 request->Header.PageNumber = 0;
857 request->Header.PageVersion = MPI2_SASDEVICE0_PAGEVERSION;
858 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
859 cm->cm_data = NULL;
845 struct mps_command *cm;
846 Mpi2SasDevicePage0_t *page = NULL;
847 int error = 0;
848 u16 ioc_status;
849
850 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
851
852 if ((cm = mps_alloc_command(sc)) == NULL) {

--- 7 unchanged lines hidden (view full) ---

860 request->Function = MPI2_FUNCTION_CONFIG;
861 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
862 request->Header.PageType = MPI2_CONFIG_PAGETYPE_EXTENDED;
863 request->ExtPageType = MPI2_CONFIG_EXTPAGETYPE_SAS_DEVICE;
864 request->Header.PageNumber = 0;
865 request->Header.PageVersion = MPI2_SASDEVICE0_PAGEVERSION;
866 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
867 cm->cm_data = NULL;
860 error = mps_wait_command(sc, cm, 60, CAN_SLEEP);
861 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
868 error = mps_wait_command(sc, &cm, 60, CAN_SLEEP);
869 if (cm != NULL)
870 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
862 if (error || (reply == NULL)) {
863 /* FIXME */
864 /*
865 * If the request returns an error then we need to do a diag
866 * reset
867 */
868 printf("%s: request for header completed with error %d",
869 __func__, error);

--- 42 unchanged lines hidden (view full) ---

912 page = malloc(cm->cm_length, M_MPT2, M_ZERO | M_NOWAIT);
913 if (!page) {
914 printf("%s: page alloc failed\n", __func__);
915 error = ENOMEM;
916 goto out;
917 }
918 cm->cm_data = page;
919
871 if (error || (reply == NULL)) {
872 /* FIXME */
873 /*
874 * If the request returns an error then we need to do a diag
875 * reset
876 */
877 printf("%s: request for header completed with error %d",
878 __func__, error);

--- 42 unchanged lines hidden (view full) ---

921 page = malloc(cm->cm_length, M_MPT2, M_ZERO | M_NOWAIT);
922 if (!page) {
923 printf("%s: page alloc failed\n", __func__);
924 error = ENOMEM;
925 goto out;
926 }
927 cm->cm_data = page;
928
920 error = mps_wait_command(sc, cm, 60, CAN_SLEEP);
921 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
929 error = mps_wait_command(sc, &cm, 60, CAN_SLEEP);
930 if (cm != NULL)
931 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
922 if (error || (reply == NULL)) {
923 /* FIXME */
924 /*
925 * If the request returns an error then we need to do a diag
926 * reset
927 */
928 printf("%s: request for page completed with error %d",
929 __func__, error);

--- 31 unchanged lines hidden (view full) ---

961 *
962 * Returns 0 for success, non-zero for failure.
963 */
964int
965mps_config_get_bios_pg3(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply,
966 Mpi2BiosPage3_t *config_page)
967{
968 MPI2_CONFIG_REQUEST *request;
932 if (error || (reply == NULL)) {
933 /* FIXME */
934 /*
935 * If the request returns an error then we need to do a diag
936 * reset
937 */
938 printf("%s: request for page completed with error %d",
939 __func__, error);

--- 31 unchanged lines hidden (view full) ---

971 *
972 * Returns 0 for success, non-zero for failure.
973 */
974int
975mps_config_get_bios_pg3(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply,
976 Mpi2BiosPage3_t *config_page)
977{
978 MPI2_CONFIG_REQUEST *request;
969 MPI2_CONFIG_REPLY *reply;
979 MPI2_CONFIG_REPLY *reply = NULL;
970 struct mps_command *cm;
971 Mpi2BiosPage3_t *page = NULL;
972 int error = 0;
973 u16 ioc_status;
974
975 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
976
977 if ((cm = mps_alloc_command(sc)) == NULL) {

--- 6 unchanged lines hidden (view full) ---

984 bzero(request, sizeof(MPI2_CONFIG_REQUEST));
985 request->Function = MPI2_FUNCTION_CONFIG;
986 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
987 request->Header.PageType = MPI2_CONFIG_PAGETYPE_BIOS;
988 request->Header.PageNumber = 3;
989 request->Header.PageVersion = MPI2_BIOSPAGE3_PAGEVERSION;
990 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
991 cm->cm_data = NULL;
980 struct mps_command *cm;
981 Mpi2BiosPage3_t *page = NULL;
982 int error = 0;
983 u16 ioc_status;
984
985 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
986
987 if ((cm = mps_alloc_command(sc)) == NULL) {

--- 6 unchanged lines hidden (view full) ---

994 bzero(request, sizeof(MPI2_CONFIG_REQUEST));
995 request->Function = MPI2_FUNCTION_CONFIG;
996 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
997 request->Header.PageType = MPI2_CONFIG_PAGETYPE_BIOS;
998 request->Header.PageNumber = 3;
999 request->Header.PageVersion = MPI2_BIOSPAGE3_PAGEVERSION;
1000 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
1001 cm->cm_data = NULL;
992 error = mps_wait_command(sc, cm, 60, CAN_SLEEP);
993 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
1002 error = mps_wait_command(sc, &cm, 60, CAN_SLEEP);
1003 if (cm != NULL)
1004 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
994 if (error || (reply == NULL)) {
995 /* FIXME */
996 /*
997 * If the request returns an error then we need to do a diag
998 * reset
999 */
1000 printf("%s: request for header completed with error %d",
1001 __func__, error);

--- 40 unchanged lines hidden (view full) ---

1042 page = malloc(cm->cm_length, M_MPT2, M_ZERO | M_NOWAIT);
1043 if (!page) {
1044 printf("%s: page alloc failed\n", __func__);
1045 error = ENOMEM;
1046 goto out;
1047 }
1048 cm->cm_data = page;
1049
1005 if (error || (reply == NULL)) {
1006 /* FIXME */
1007 /*
1008 * If the request returns an error then we need to do a diag
1009 * reset
1010 */
1011 printf("%s: request for header completed with error %d",
1012 __func__, error);

--- 40 unchanged lines hidden (view full) ---

1053 page = malloc(cm->cm_length, M_MPT2, M_ZERO | M_NOWAIT);
1054 if (!page) {
1055 printf("%s: page alloc failed\n", __func__);
1056 error = ENOMEM;
1057 goto out;
1058 }
1059 cm->cm_data = page;
1060
1050 error = mps_wait_command(sc, cm, 60, CAN_SLEEP);
1051 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
1061 error = mps_wait_command(sc, &cm, 60, CAN_SLEEP);
1062 if (cm != NULL)
1063 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
1052 if (error || (reply == NULL)) {
1053 /* FIXME */
1054 /*
1055 * If the request returns an error then we need to do a diag
1056 * reset
1057 */
1058 printf("%s: request for page completed with error %d",
1059 __func__, error);

--- 31 unchanged lines hidden (view full) ---

1091 *
1092 * Returns 0 for success, non-zero for failure.
1093 */
1094int
1095mps_config_get_raid_volume_pg0(struct mps_softc *sc, Mpi2ConfigReply_t
1096 *mpi_reply, Mpi2RaidVolPage0_t *config_page, u32 page_address)
1097{
1098 MPI2_CONFIG_REQUEST *request;
1064 if (error || (reply == NULL)) {
1065 /* FIXME */
1066 /*
1067 * If the request returns an error then we need to do a diag
1068 * reset
1069 */
1070 printf("%s: request for page completed with error %d",
1071 __func__, error);

--- 31 unchanged lines hidden (view full) ---

1103 *
1104 * Returns 0 for success, non-zero for failure.
1105 */
1106int
1107mps_config_get_raid_volume_pg0(struct mps_softc *sc, Mpi2ConfigReply_t
1108 *mpi_reply, Mpi2RaidVolPage0_t *config_page, u32 page_address)
1109{
1110 MPI2_CONFIG_REQUEST *request;
1099 MPI2_CONFIG_REPLY *reply;
1111 MPI2_CONFIG_REPLY *reply = NULL;
1100 struct mps_command *cm;
1101 Mpi2RaidVolPage0_t *page = NULL;
1102 int error = 0;
1103 u16 ioc_status;
1104
1105 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
1106
1107 if ((cm = mps_alloc_command(sc)) == NULL) {

--- 11 unchanged lines hidden (view full) ---

1119 request->Header.PageVersion = MPI2_RAIDVOLPAGE0_PAGEVERSION;
1120 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
1121 cm->cm_data = NULL;
1122
1123 /*
1124 * This page must be polled because the IOC isn't ready yet when this
1125 * page is needed.
1126 */
1112 struct mps_command *cm;
1113 Mpi2RaidVolPage0_t *page = NULL;
1114 int error = 0;
1115 u16 ioc_status;
1116
1117 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
1118
1119 if ((cm = mps_alloc_command(sc)) == NULL) {

--- 11 unchanged lines hidden (view full) ---

1131 request->Header.PageVersion = MPI2_RAIDVOLPAGE0_PAGEVERSION;
1132 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
1133 cm->cm_data = NULL;
1134
1135 /*
1136 * This page must be polled because the IOC isn't ready yet when this
1137 * page is needed.
1138 */
1127 error = mps_wait_command(sc, cm, 60, 0);
1128 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
1139 error = mps_wait_command(sc, &cm, 60, 0);
1140 if (cm != NULL)
1141 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
1129 if (error || (reply == NULL)) {
1130 /* FIXME */
1131 /* If the poll returns error then we need to do diag reset */
1132 printf("%s: poll for header completed with error %d",
1133 __func__, error);
1134 error = ENXIO;
1135 goto out;
1136 }

--- 39 unchanged lines hidden (view full) ---

1176 goto out;
1177 }
1178 cm->cm_data = page;
1179
1180 /*
1181 * This page must be polled because the IOC isn't ready yet when this
1182 * page is needed.
1183 */
1142 if (error || (reply == NULL)) {
1143 /* FIXME */
1144 /* If the poll returns error then we need to do diag reset */
1145 printf("%s: poll for header completed with error %d",
1146 __func__, error);
1147 error = ENXIO;
1148 goto out;
1149 }

--- 39 unchanged lines hidden (view full) ---

1189 goto out;
1190 }
1191 cm->cm_data = page;
1192
1193 /*
1194 * This page must be polled because the IOC isn't ready yet when this
1195 * page is needed.
1196 */
1184 error = mps_wait_command(sc, cm, 60, 0);
1185 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
1197 error = mps_wait_command(sc, &cm, 60, 0);
1198 if (cm != NULL)
1199 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
1186 if (error || (reply == NULL)) {
1187 /* FIXME */
1188 /* If the poll returns error then we need to do diag reset */
1189 printf("%s: poll for page completed with error %d",
1190 __func__, error);
1191 error = ENXIO;
1192 goto out;
1193 }

--- 26 unchanged lines hidden (view full) ---

1220 *
1221 * Returns 0 for success, non-zero for failure.
1222 */
1223int
1224mps_config_get_raid_volume_pg1(struct mps_softc *sc, Mpi2ConfigReply_t
1225 *mpi_reply, Mpi2RaidVolPage1_t *config_page, u32 form, u16 handle)
1226{
1227 MPI2_CONFIG_REQUEST *request;
1200 if (error || (reply == NULL)) {
1201 /* FIXME */
1202 /* If the poll returns error then we need to do diag reset */
1203 printf("%s: poll for page completed with error %d",
1204 __func__, error);
1205 error = ENXIO;
1206 goto out;
1207 }

--- 26 unchanged lines hidden (view full) ---

1234 *
1235 * Returns 0 for success, non-zero for failure.
1236 */
1237int
1238mps_config_get_raid_volume_pg1(struct mps_softc *sc, Mpi2ConfigReply_t
1239 *mpi_reply, Mpi2RaidVolPage1_t *config_page, u32 form, u16 handle)
1240{
1241 MPI2_CONFIG_REQUEST *request;
1228 MPI2_CONFIG_REPLY *reply;
1242 MPI2_CONFIG_REPLY *reply = NULL;
1229 struct mps_command *cm;
1230 Mpi2RaidVolPage1_t *page = NULL;
1231 int error = 0;
1232 u16 ioc_status;
1233
1234 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
1235
1236 if ((cm = mps_alloc_command(sc)) == NULL) {

--- 6 unchanged lines hidden (view full) ---

1243 bzero(request, sizeof(MPI2_CONFIG_REQUEST));
1244 request->Function = MPI2_FUNCTION_CONFIG;
1245 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
1246 request->Header.PageType = MPI2_CONFIG_PAGETYPE_RAID_VOLUME;
1247 request->Header.PageNumber = 1;
1248 request->Header.PageVersion = MPI2_RAIDVOLPAGE1_PAGEVERSION;
1249 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
1250 cm->cm_data = NULL;
1243 struct mps_command *cm;
1244 Mpi2RaidVolPage1_t *page = NULL;
1245 int error = 0;
1246 u16 ioc_status;
1247
1248 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
1249
1250 if ((cm = mps_alloc_command(sc)) == NULL) {

--- 6 unchanged lines hidden (view full) ---

1257 bzero(request, sizeof(MPI2_CONFIG_REQUEST));
1258 request->Function = MPI2_FUNCTION_CONFIG;
1259 request->Action = MPI2_CONFIG_ACTION_PAGE_HEADER;
1260 request->Header.PageType = MPI2_CONFIG_PAGETYPE_RAID_VOLUME;
1261 request->Header.PageNumber = 1;
1262 request->Header.PageVersion = MPI2_RAIDVOLPAGE1_PAGEVERSION;
1263 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
1264 cm->cm_data = NULL;
1251 error = mps_wait_command(sc, cm, 60, CAN_SLEEP);
1252 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
1265 error = mps_wait_command(sc, &cm, 60, CAN_SLEEP);
1266 if (cm != NULL)
1267 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
1253 if (error || (reply == NULL)) {
1254 /* FIXME */
1255 /*
1256 * If the request returns an error then we need to do a diag
1257 * reset
1258 */
1259 printf("%s: request for header completed with error %d",
1260 __func__, error);

--- 41 unchanged lines hidden (view full) ---

1302 page = malloc(cm->cm_length, M_MPT2, M_ZERO | M_NOWAIT);
1303 if (!page) {
1304 printf("%s: page alloc failed\n", __func__);
1305 error = ENOMEM;
1306 goto out;
1307 }
1308 cm->cm_data = page;
1309
1268 if (error || (reply == NULL)) {
1269 /* FIXME */
1270 /*
1271 * If the request returns an error then we need to do a diag
1272 * reset
1273 */
1274 printf("%s: request for header completed with error %d",
1275 __func__, error);

--- 41 unchanged lines hidden (view full) ---

1317 page = malloc(cm->cm_length, M_MPT2, M_ZERO | M_NOWAIT);
1318 if (!page) {
1319 printf("%s: page alloc failed\n", __func__);
1320 error = ENOMEM;
1321 goto out;
1322 }
1323 cm->cm_data = page;
1324
1310 error = mps_wait_command(sc, cm, 60, CAN_SLEEP);
1311 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
1325 error = mps_wait_command(sc, &cm, 60, CAN_SLEEP);
1326 if (cm != NULL)
1327 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
1312 if (error || (reply == NULL)) {
1313 /* FIXME */
1314 /*
1315 * If the request returns an error then we need to do a diag
1316 * reset
1317 */
1318 printf("%s: request for page completed with error %d",
1319 __func__, error);

--- 57 unchanged lines hidden (view full) ---

1377 *
1378 * Returns 0 for success, non-zero for failure.
1379 */
1380int
1381mps_config_get_raid_pd_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply,
1382 Mpi2RaidPhysDiskPage0_t *config_page, u32 page_address)
1383{
1384 MPI2_CONFIG_REQUEST *request;
1328 if (error || (reply == NULL)) {
1329 /* FIXME */
1330 /*
1331 * If the request returns an error then we need to do a diag
1332 * reset
1333 */
1334 printf("%s: request for page completed with error %d",
1335 __func__, error);

--- 57 unchanged lines hidden (view full) ---

1393 *
1394 * Returns 0 for success, non-zero for failure.
1395 */
1396int
1397mps_config_get_raid_pd_pg0(struct mps_softc *sc, Mpi2ConfigReply_t *mpi_reply,
1398 Mpi2RaidPhysDiskPage0_t *config_page, u32 page_address)
1399{
1400 MPI2_CONFIG_REQUEST *request;
1385 MPI2_CONFIG_REPLY *reply;
1401 MPI2_CONFIG_REPLY *reply = NULL;
1386 struct mps_command *cm;
1387 Mpi2RaidPhysDiskPage0_t *page = NULL;
1388 int error = 0;
1389 u16 ioc_status;
1390
1391 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
1392
1393 if ((cm = mps_alloc_command(sc)) == NULL) {

--- 11 unchanged lines hidden (view full) ---

1405 request->Header.PageVersion = MPI2_RAIDPHYSDISKPAGE0_PAGEVERSION;
1406 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
1407 cm->cm_data = NULL;
1408
1409 /*
1410 * This page must be polled because the IOC isn't ready yet when this
1411 * page is needed.
1412 */
1402 struct mps_command *cm;
1403 Mpi2RaidPhysDiskPage0_t *page = NULL;
1404 int error = 0;
1405 u16 ioc_status;
1406
1407 mps_dprint(sc, MPS_TRACE, "%s\n", __func__);
1408
1409 if ((cm = mps_alloc_command(sc)) == NULL) {

--- 11 unchanged lines hidden (view full) ---

1421 request->Header.PageVersion = MPI2_RAIDPHYSDISKPAGE0_PAGEVERSION;
1422 cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
1423 cm->cm_data = NULL;
1424
1425 /*
1426 * This page must be polled because the IOC isn't ready yet when this
1427 * page is needed.
1428 */
1413 error = mps_wait_command(sc, cm, 60, 0);
1414 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
1429 error = mps_wait_command(sc, &cm, 60, 0);
1430 if (cm != NULL)
1431 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
1415 if (error || (reply == NULL)) {
1416 /* FIXME */
1417 /* If the poll returns error then we need to do diag reset */
1418 printf("%s: poll for header completed with error %d",
1419 __func__, error);
1420 error = ENXIO;
1421 goto out;
1422 }

--- 39 unchanged lines hidden (view full) ---

1462 goto out;
1463 }
1464 cm->cm_data = page;
1465
1466 /*
1467 * This page must be polled because the IOC isn't ready yet when this
1468 * page is needed.
1469 */
1432 if (error || (reply == NULL)) {
1433 /* FIXME */
1434 /* If the poll returns error then we need to do diag reset */
1435 printf("%s: poll for header completed with error %d",
1436 __func__, error);
1437 error = ENXIO;
1438 goto out;
1439 }

--- 39 unchanged lines hidden (view full) ---

1479 goto out;
1480 }
1481 cm->cm_data = page;
1482
1483 /*
1484 * This page must be polled because the IOC isn't ready yet when this
1485 * page is needed.
1486 */
1470 error = mps_wait_command(sc, cm, 60, 0);
1471 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
1487 error = mps_wait_command(sc, &cm, 60, 0);
1488 if (cm != NULL)
1489 reply = (MPI2_CONFIG_REPLY *)cm->cm_reply;
1472 if (error || (reply == NULL)) {
1473 /* FIXME */
1474 /* If the poll returns error then we need to do diag reset */
1475 printf("%s: poll for page completed with error %d",
1476 __func__, error);
1477 error = ENXIO;
1478 goto out;
1479 }

--- 18 unchanged lines hidden ---
1490 if (error || (reply == NULL)) {
1491 /* FIXME */
1492 /* If the poll returns error then we need to do diag reset */
1493 printf("%s: poll for page completed with error %d",
1494 __func__, error);
1495 error = ENXIO;
1496 goto out;
1497 }

--- 18 unchanged lines hidden ---