2 * Copyright (c) 2008 Yahoo!, Inc.
4 * Written by: John Baldwin <jhb@FreeBSD.org>
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. Neither the name of the author nor the names of any co-contributors
15 * may be used to endorse or promote products derived from this software
16 * without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * LSI MPT-Fusion Host Adapter FreeBSD userland interface
33 #include <sys/cdefs.h>
34 __FBSDID("$FreeBSD$");
36 #include <sys/param.h>
38 #include <sys/errno.h>
39 #include <sys/ioccom.h>
40 #include <sys/mpt_ioctl.h>
42 #include <dev/mpt/mpt.h>
44 struct mpt_user_raid_action_result {
45 uint32_t volume_status;
46 uint32_t action_data[4];
47 uint16_t action_status;
50 struct mpt_page_memory {
57 static mpt_probe_handler_t mpt_user_probe;
58 static mpt_attach_handler_t mpt_user_attach;
59 static mpt_enable_handler_t mpt_user_enable;
60 static mpt_ready_handler_t mpt_user_ready;
61 static mpt_event_handler_t mpt_user_event;
62 static mpt_reset_handler_t mpt_user_reset;
63 static mpt_detach_handler_t mpt_user_detach;
65 static struct mpt_personality mpt_user_personality = {
67 .probe = mpt_user_probe,
68 .attach = mpt_user_attach,
69 .enable = mpt_user_enable,
70 .ready = mpt_user_ready,
71 .event = mpt_user_event,
72 .reset = mpt_user_reset,
73 .detach = mpt_user_detach,
76 DECLARE_MPT_PERSONALITY(mpt_user, SI_ORDER_SECOND);
78 static mpt_reply_handler_t mpt_user_reply_handler;
80 static d_open_t mpt_open;
81 static d_close_t mpt_close;
82 static d_ioctl_t mpt_ioctl;
84 static struct cdevsw mpt_cdevsw = {
85 .d_version = D_VERSION,
93 static MALLOC_DEFINE(M_MPTUSER, "mpt_user", "Buffers for mpt(4) ioctls");
95 static uint32_t user_handler_id = MPT_HANDLER_ID_NONE;
98 mpt_user_probe(struct mpt_softc *mpt)
101 /* Attach to every controller. */
106 mpt_user_attach(struct mpt_softc *mpt)
108 mpt_handler_t handler;
112 handler.reply_handler = mpt_user_reply_handler;
113 error = mpt_register_handler(mpt, MPT_HANDLER_REPLY, handler,
117 mpt_prt(mpt, "Unable to register user handler!\n");
120 unit = device_get_unit(mpt->dev);
121 mpt->cdev = make_dev(&mpt_cdevsw, unit, UID_ROOT, GID_OPERATOR, 0640,
123 if (mpt->cdev == NULL) {
125 mpt_deregister_handler(mpt, MPT_HANDLER_REPLY, handler,
130 mpt->cdev->si_drv1 = mpt;
135 mpt_user_enable(struct mpt_softc *mpt)
142 mpt_user_ready(struct mpt_softc *mpt)
147 mpt_user_event(struct mpt_softc *mpt, request_t *req,
148 MSG_EVENT_NOTIFY_REPLY *msg)
151 /* Someday we may want to let a user daemon listen for events? */
156 mpt_user_reset(struct mpt_softc *mpt, int type)
161 mpt_user_detach(struct mpt_softc *mpt)
163 mpt_handler_t handler;
165 /* XXX: do a purge of pending requests? */
166 destroy_dev(mpt->cdev);
169 handler.reply_handler = mpt_user_reply_handler;
170 mpt_deregister_handler(mpt, MPT_HANDLER_REPLY, handler,
176 mpt_open(struct cdev *dev, int flags, int fmt, d_thread_t *td)
183 mpt_close(struct cdev *dev, int flags, int fmt, d_thread_t *td)
190 mpt_alloc_buffer(struct mpt_softc *mpt, struct mpt_page_memory *page_mem,
193 struct mpt_map_info mi;
196 page_mem->vaddr = NULL;
198 /* Limit requests to 16M. */
199 if (len > 16 * 1024 * 1024)
201 error = mpt_dma_tag_create(mpt, mpt->parent_dmat, 1, 0,
202 BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
203 len, 1, len, 0, &page_mem->tag);
206 error = bus_dmamem_alloc(page_mem->tag, &page_mem->vaddr,
207 BUS_DMA_NOWAIT, &page_mem->map);
209 bus_dma_tag_destroy(page_mem->tag);
213 error = bus_dmamap_load(page_mem->tag, page_mem->map, page_mem->vaddr,
214 len, mpt_map_rquest, &mi, BUS_DMA_NOWAIT);
218 bus_dmamem_free(page_mem->tag, page_mem->vaddr, page_mem->map);
219 bus_dma_tag_destroy(page_mem->tag);
220 page_mem->vaddr = NULL;
223 page_mem->paddr = mi.phys;
228 mpt_free_buffer(struct mpt_page_memory *page_mem)
231 if (page_mem->vaddr == NULL)
233 bus_dmamap_unload(page_mem->tag, page_mem->map);
234 bus_dmamem_free(page_mem->tag, page_mem->vaddr, page_mem->map);
235 bus_dma_tag_destroy(page_mem->tag);
236 page_mem->vaddr = NULL;
240 mpt_user_read_cfg_header(struct mpt_softc *mpt,
241 struct mpt_cfg_page_req *page_req)
248 req = mpt_get_request(mpt, TRUE);
250 mpt_prt(mpt, "mpt_user_read_cfg_header: Get request failed!\n");
254 params.Action = MPI_CONFIG_ACTION_PAGE_HEADER;
255 params.PageVersion = 0;
256 params.PageLength = 0;
257 params.PageNumber = page_req->header.PageNumber;
258 params.PageType = page_req->header.PageType;
259 params.PageAddress = le32toh(page_req->page_address);
260 error = mpt_issue_cfg_req(mpt, req, ¶ms, /*addr*/0, /*len*/0,
264 * Leave the request. Without resetting the chip, it's
265 * still owned by it and we'll just get into trouble
266 * freeing it now. Mark it as abandoned so that if it
267 * shows up later it can be freed.
269 mpt_prt(mpt, "read_cfg_header timed out\n");
273 page_req->ioc_status = htole16(req->IOCStatus);
274 if ((req->IOCStatus & MPI_IOCSTATUS_MASK) == MPI_IOCSTATUS_SUCCESS) {
275 cfgp = req->req_vbuf;
276 bcopy(&cfgp->Header, &page_req->header,
277 sizeof(page_req->header));
279 mpt_free_request(mpt, req);
284 mpt_user_read_cfg_page(struct mpt_softc *mpt, struct mpt_cfg_page_req *page_req,
285 struct mpt_page_memory *mpt_page)
287 CONFIG_PAGE_HEADER *hdr;
292 req = mpt_get_request(mpt, TRUE);
294 mpt_prt(mpt, "mpt_user_read_cfg_page: Get request failed!\n");
298 hdr = mpt_page->vaddr;
299 params.Action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
300 params.PageVersion = hdr->PageVersion;
301 params.PageLength = hdr->PageLength;
302 params.PageNumber = hdr->PageNumber;
303 params.PageType = hdr->PageType & MPI_CONFIG_PAGETYPE_MASK;
304 params.PageAddress = le32toh(page_req->page_address);
305 error = mpt_issue_cfg_req(mpt, req, ¶ms, mpt_page->paddr,
306 le32toh(page_req->len), TRUE, 5000);
308 mpt_prt(mpt, "mpt_user_read_cfg_page timed out\n");
312 page_req->ioc_status = htole16(req->IOCStatus);
313 if ((req->IOCStatus & MPI_IOCSTATUS_MASK) == MPI_IOCSTATUS_SUCCESS)
314 bus_dmamap_sync(mpt_page->tag, mpt_page->map,
315 BUS_DMASYNC_POSTREAD);
316 mpt_free_request(mpt, req);
321 mpt_user_read_extcfg_header(struct mpt_softc *mpt,
322 struct mpt_ext_cfg_page_req *ext_page_req)
326 MSG_CONFIG_REPLY *cfgp;
329 req = mpt_get_request(mpt, TRUE);
331 mpt_prt(mpt, "mpt_user_read_extcfg_header: Get request failed!\n");
335 params.Action = MPI_CONFIG_ACTION_PAGE_HEADER;
336 params.PageVersion = ext_page_req->header.PageVersion;
337 params.PageLength = 0;
338 params.PageNumber = ext_page_req->header.PageNumber;
339 params.PageType = MPI_CONFIG_PAGETYPE_EXTENDED;
340 params.PageAddress = le32toh(ext_page_req->page_address);
341 params.ExtPageType = ext_page_req->header.ExtPageType;
342 params.ExtPageLength = 0;
343 error = mpt_issue_cfg_req(mpt, req, ¶ms, /*addr*/0, /*len*/0,
347 * Leave the request. Without resetting the chip, it's
348 * still owned by it and we'll just get into trouble
349 * freeing it now. Mark it as abandoned so that if it
350 * shows up later it can be freed.
352 mpt_prt(mpt, "mpt_user_read_extcfg_header timed out\n");
356 ext_page_req->ioc_status = htole16(req->IOCStatus);
357 if ((req->IOCStatus & MPI_IOCSTATUS_MASK) == MPI_IOCSTATUS_SUCCESS) {
358 cfgp = req->req_vbuf;
359 ext_page_req->header.PageVersion = cfgp->Header.PageVersion;
360 ext_page_req->header.PageNumber = cfgp->Header.PageNumber;
361 ext_page_req->header.PageType = cfgp->Header.PageType;
362 ext_page_req->header.ExtPageLength = cfgp->ExtPageLength;
363 ext_page_req->header.ExtPageType = cfgp->ExtPageType;
365 mpt_free_request(mpt, req);
370 mpt_user_read_extcfg_page(struct mpt_softc *mpt,
371 struct mpt_ext_cfg_page_req *ext_page_req, struct mpt_page_memory *mpt_page)
373 CONFIG_EXTENDED_PAGE_HEADER *hdr;
378 req = mpt_get_request(mpt, TRUE);
380 mpt_prt(mpt, "mpt_user_read_extcfg_page: Get request failed!\n");
384 hdr = mpt_page->vaddr;
385 params.Action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;
386 params.PageVersion = hdr->PageVersion;
387 params.PageLength = 0;
388 params.PageNumber = hdr->PageNumber;
389 params.PageType = MPI_CONFIG_PAGETYPE_EXTENDED;
390 params.PageAddress = le32toh(ext_page_req->page_address);
391 params.ExtPageType = hdr->ExtPageType;
392 params.ExtPageLength = hdr->ExtPageLength;
393 error = mpt_issue_cfg_req(mpt, req, ¶ms, mpt_page->paddr,
394 le32toh(ext_page_req->len), TRUE, 5000);
396 mpt_prt(mpt, "mpt_user_read_extcfg_page timed out\n");
400 ext_page_req->ioc_status = htole16(req->IOCStatus);
401 if ((req->IOCStatus & MPI_IOCSTATUS_MASK) == MPI_IOCSTATUS_SUCCESS)
402 bus_dmamap_sync(mpt_page->tag, mpt_page->map,
403 BUS_DMASYNC_POSTREAD);
404 mpt_free_request(mpt, req);
409 mpt_user_write_cfg_page(struct mpt_softc *mpt,
410 struct mpt_cfg_page_req *page_req, struct mpt_page_memory *mpt_page)
412 CONFIG_PAGE_HEADER *hdr;
418 hdr = mpt_page->vaddr;
419 hdr_attr = hdr->PageType & MPI_CONFIG_PAGEATTR_MASK;
420 if (hdr_attr != MPI_CONFIG_PAGEATTR_CHANGEABLE &&
421 hdr_attr != MPI_CONFIG_PAGEATTR_PERSISTENT) {
422 mpt_prt(mpt, "page type 0x%x not changeable\n",
423 hdr->PageType & MPI_CONFIG_PAGETYPE_MASK);
429 * We shouldn't mask off other bits here.
431 hdr->PageType &= ~MPI_CONFIG_PAGETYPE_MASK;
434 req = mpt_get_request(mpt, TRUE);
438 bus_dmamap_sync(mpt_page->tag, mpt_page->map, BUS_DMASYNC_PREWRITE);
441 * There isn't any point in restoring stripped out attributes
442 * if you then mask them going down to issue the request.
445 params.Action = MPI_CONFIG_ACTION_PAGE_WRITE_CURRENT;
446 params.PageVersion = hdr->PageVersion;
447 params.PageLength = hdr->PageLength;
448 params.PageNumber = hdr->PageNumber;
449 params.PageAddress = le32toh(page_req->page_address);
451 /* Restore stripped out attributes */
452 hdr->PageType |= hdr_attr;
453 params.PageType = hdr->PageType & MPI_CONFIG_PAGETYPE_MASK;
455 params.PageType = hdr->PageType;
457 error = mpt_issue_cfg_req(mpt, req, ¶ms, mpt_page->paddr,
458 le32toh(page_req->len), TRUE, 5000);
460 mpt_prt(mpt, "mpt_write_cfg_page timed out\n");
464 page_req->ioc_status = htole16(req->IOCStatus);
465 mpt_free_request(mpt, req);
470 mpt_user_reply_handler(struct mpt_softc *mpt, request_t *req,
471 uint32_t reply_desc, MSG_DEFAULT_REPLY *reply_frame)
473 MSG_RAID_ACTION_REPLY *reply;
474 struct mpt_user_raid_action_result *res;
479 if (reply_frame != NULL) {
480 bus_dmamap_sync(mpt->request_dmat, mpt->request_dmap,
481 BUS_DMASYNC_POSTREAD);
482 reply = (MSG_RAID_ACTION_REPLY *)reply_frame;
483 req->IOCStatus = le16toh(reply->IOCStatus);
484 res = (struct mpt_user_raid_action_result *)
485 (((uint8_t *)req->req_vbuf) + MPT_RQSL(mpt));
486 res->action_status = reply->ActionStatus;
487 res->volume_status = reply->VolumeStatus;
488 bcopy(&reply->ActionData, res->action_data,
489 sizeof(res->action_data));
492 req->state &= ~REQ_STATE_QUEUED;
493 req->state |= REQ_STATE_DONE;
494 TAILQ_REMOVE(&mpt->request_pending_list, req, links);
496 if ((req->state & REQ_STATE_NEED_WAKEUP) != 0) {
498 } else if ((req->state & REQ_STATE_TIMEDOUT) != 0) {
500 * Whew- we can free this request (late completion)
502 mpt_free_request(mpt, req);
509 * We use the first part of the request buffer after the request frame
510 * to hold the action data and action status from the RAID reply. The
511 * rest of the request buffer is used to hold the buffer for the
515 mpt_user_raid_action(struct mpt_softc *mpt, struct mpt_raid_action *raid_act,
516 struct mpt_page_memory *mpt_page)
519 struct mpt_user_raid_action_result *res;
520 MSG_RAID_ACTION_REQUEST *rap;
524 req = mpt_get_request(mpt, TRUE);
528 memset(rap, 0, sizeof *rap);
529 rap->Action = raid_act->action;
530 rap->ActionDataWord = raid_act->action_data_word;
531 rap->Function = MPI_FUNCTION_RAID_ACTION;
532 rap->VolumeID = raid_act->volume_id;
533 rap->VolumeBus = raid_act->volume_bus;
534 rap->PhysDiskNum = raid_act->phys_disk_num;
535 se = (SGE_SIMPLE32 *)&rap->ActionDataSGE;
536 if (mpt_page->vaddr != NULL && raid_act->len != 0) {
537 bus_dmamap_sync(mpt_page->tag, mpt_page->map,
538 BUS_DMASYNC_PREWRITE);
539 se->Address = htole32(mpt_page->paddr);
540 MPI_pSGE_SET_LENGTH(se, le32toh(raid_act->len));
541 MPI_pSGE_SET_FLAGS(se, (MPI_SGE_FLAGS_SIMPLE_ELEMENT |
542 MPI_SGE_FLAGS_LAST_ELEMENT | MPI_SGE_FLAGS_END_OF_BUFFER |
543 MPI_SGE_FLAGS_END_OF_LIST |
544 raid_act->write ? MPI_SGE_FLAGS_HOST_TO_IOC :
545 MPI_SGE_FLAGS_IOC_TO_HOST));
547 se->FlagsLength = htole32(se->FlagsLength);
548 rap->MsgContext = htole32(req->index | user_handler_id);
550 mpt_check_doorbell(mpt);
551 mpt_send_cmd(mpt, req);
553 error = mpt_wait_req(mpt, req, REQ_STATE_DONE, REQ_STATE_DONE, TRUE,
557 * Leave request so it can be cleaned up later.
559 mpt_prt(mpt, "mpt_user_raid_action timed out\n");
563 raid_act->ioc_status = htole16(req->IOCStatus);
564 if ((req->IOCStatus & MPI_IOCSTATUS_MASK) != MPI_IOCSTATUS_SUCCESS) {
565 mpt_free_request(mpt, req);
569 res = (struct mpt_user_raid_action_result *)
570 (((uint8_t *)req->req_vbuf) + MPT_RQSL(mpt));
571 raid_act->volume_status = res->volume_status;
572 raid_act->action_status = res->action_status;
573 bcopy(res->action_data, raid_act->action_data,
574 sizeof(res->action_data));
575 if (mpt_page->vaddr != NULL)
576 bus_dmamap_sync(mpt_page->tag, mpt_page->map,
577 BUS_DMASYNC_POSTREAD);
578 mpt_free_request(mpt, req);
583 #define PTRIN(p) ((void *)(uintptr_t)(p))
584 #define PTROUT(v) ((u_int32_t)(uintptr_t)(v))
588 mpt_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, d_thread_t *td)
590 struct mpt_softc *mpt;
591 struct mpt_cfg_page_req *page_req;
592 struct mpt_ext_cfg_page_req *ext_page_req;
593 struct mpt_raid_action *raid_act;
594 struct mpt_page_memory mpt_page;
596 struct mpt_cfg_page_req32 *page_req32;
597 struct mpt_cfg_page_req page_req_swab;
598 struct mpt_ext_cfg_page_req32 *ext_page_req32;
599 struct mpt_ext_cfg_page_req ext_page_req_swab;
600 struct mpt_raid_action32 *raid_act32;
601 struct mpt_raid_action raid_act_swab;
606 page_req = (void *)arg;
607 ext_page_req = (void *)arg;
608 raid_act = (void *)arg;
609 mpt_page.vaddr = NULL;
612 /* Convert 32-bit structs to native ones. */
613 page_req32 = (void *)arg;
614 ext_page_req32 = (void *)arg;
615 raid_act32 = (void *)arg;
617 case MPTIO_READ_CFG_HEADER32:
618 case MPTIO_READ_CFG_PAGE32:
619 case MPTIO_WRITE_CFG_PAGE32:
620 page_req = &page_req_swab;
621 page_req->header = page_req32->header;
622 page_req->page_address = page_req32->page_address;
623 page_req->buf = PTRIN(page_req32->buf);
624 page_req->len = page_req32->len;
625 page_req->ioc_status = page_req32->ioc_status;
627 case MPTIO_READ_EXT_CFG_HEADER32:
628 case MPTIO_READ_EXT_CFG_PAGE32:
629 ext_page_req = &ext_page_req_swab;
630 ext_page_req->header = ext_page_req32->header;
631 ext_page_req->page_address = ext_page_req32->page_address;
632 ext_page_req->buf = PTRIN(ext_page_req32->buf);
633 ext_page_req->len = ext_page_req32->len;
634 ext_page_req->ioc_status = ext_page_req32->ioc_status;
636 case MPTIO_RAID_ACTION32:
637 raid_act = &raid_act_swab;
638 raid_act->action = raid_act32->action;
639 raid_act->volume_bus = raid_act32->volume_bus;
640 raid_act->volume_id = raid_act32->volume_id;
641 raid_act->phys_disk_num = raid_act32->phys_disk_num;
642 raid_act->action_data_word = raid_act32->action_data_word;
643 raid_act->buf = PTRIN(raid_act32->buf);
644 raid_act->len = raid_act32->len;
645 raid_act->volume_status = raid_act32->volume_status;
646 bcopy(raid_act32->action_data, raid_act->action_data,
647 sizeof(raid_act->action_data));
648 raid_act->action_status = raid_act32->action_status;
649 raid_act->ioc_status = raid_act32->ioc_status;
650 raid_act->write = raid_act32->write;
657 case MPTIO_READ_CFG_HEADER32:
659 case MPTIO_READ_CFG_HEADER:
661 error = mpt_user_read_cfg_header(mpt, page_req);
665 case MPTIO_READ_CFG_PAGE32:
667 case MPTIO_READ_CFG_PAGE:
668 error = mpt_alloc_buffer(mpt, &mpt_page, page_req->len);
671 error = copyin(page_req->buf, mpt_page.vaddr,
672 sizeof(CONFIG_PAGE_HEADER));
676 error = mpt_user_read_cfg_page(mpt, page_req, &mpt_page);
680 error = copyout(mpt_page.vaddr, page_req->buf, page_req->len);
683 case MPTIO_READ_EXT_CFG_HEADER32:
685 case MPTIO_READ_EXT_CFG_HEADER:
687 error = mpt_user_read_extcfg_header(mpt, ext_page_req);
691 case MPTIO_READ_EXT_CFG_PAGE32:
693 case MPTIO_READ_EXT_CFG_PAGE:
694 error = mpt_alloc_buffer(mpt, &mpt_page, ext_page_req->len);
697 error = copyin(ext_page_req->buf, mpt_page.vaddr,
698 sizeof(CONFIG_EXTENDED_PAGE_HEADER));
702 error = mpt_user_read_extcfg_page(mpt, ext_page_req, &mpt_page);
706 error = copyout(mpt_page.vaddr, ext_page_req->buf,
710 case MPTIO_WRITE_CFG_PAGE32:
712 case MPTIO_WRITE_CFG_PAGE:
713 error = mpt_alloc_buffer(mpt, &mpt_page, page_req->len);
716 error = copyin(page_req->buf, mpt_page.vaddr, page_req->len);
720 error = mpt_user_write_cfg_page(mpt, page_req, &mpt_page);
724 case MPTIO_RAID_ACTION32:
726 case MPTIO_RAID_ACTION:
727 if (raid_act->buf != NULL) {
728 error = mpt_alloc_buffer(mpt, &mpt_page, raid_act->len);
731 error = copyin(raid_act->buf, mpt_page.vaddr,
737 error = mpt_user_raid_action(mpt, raid_act, &mpt_page);
741 if (raid_act->buf != NULL)
742 error = copyout(mpt_page.vaddr, raid_act->buf,
750 mpt_free_buffer(&mpt_page);
756 /* Convert native structs to 32-bit ones. */
758 case MPTIO_READ_CFG_HEADER32:
759 case MPTIO_READ_CFG_PAGE32:
760 case MPTIO_WRITE_CFG_PAGE32:
761 page_req32->header = page_req->header;
762 page_req32->page_address = page_req->page_address;
763 page_req32->buf = PTROUT(page_req->buf);
764 page_req32->len = page_req->len;
765 page_req32->ioc_status = page_req->ioc_status;
767 case MPTIO_READ_EXT_CFG_HEADER32:
768 case MPTIO_READ_EXT_CFG_PAGE32:
769 ext_page_req32->header = ext_page_req->header;
770 ext_page_req32->page_address = ext_page_req->page_address;
771 ext_page_req32->buf = PTROUT(ext_page_req->buf);
772 ext_page_req32->len = ext_page_req->len;
773 ext_page_req32->ioc_status = ext_page_req->ioc_status;
775 case MPTIO_RAID_ACTION32:
776 raid_act32->action = raid_act->action;
777 raid_act32->volume_bus = raid_act->volume_bus;
778 raid_act32->volume_id = raid_act->volume_id;
779 raid_act32->phys_disk_num = raid_act->phys_disk_num;
780 raid_act32->action_data_word = raid_act->action_data_word;
781 raid_act32->buf = PTROUT(raid_act->buf);
782 raid_act32->len = raid_act->len;
783 raid_act32->volume_status = raid_act->volume_status;
784 bcopy(raid_act->action_data, raid_act32->action_data,
785 sizeof(raid_act->action_data));
786 raid_act32->action_status = raid_act->action_status;
787 raid_act32->ioc_status = raid_act->ioc_status;
788 raid_act32->write = raid_act->write;