3 int ql_read_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 *data)
6 /* wait for reg to come ready */
7 status = ql_wait_reg_rdy(qdev, PROC_ADDR, PROC_ADDR_RDY, PROC_ADDR_ERR);
10 /* set up for reg read */
11 ql_write32(qdev, PROC_ADDR, reg | PROC_ADDR_R);
12 /* wait for reg to come ready */
13 status = ql_wait_reg_rdy(qdev, PROC_ADDR, PROC_ADDR_RDY, PROC_ADDR_ERR);
17 *data = ql_read32(qdev, PROC_DATA);
22 int ql_write_mpi_reg(struct ql_adapter *qdev, u32 reg, u32 data)
25 /* wait for reg to come ready */
26 status = ql_wait_reg_rdy(qdev, PROC_ADDR, PROC_ADDR_RDY, PROC_ADDR_ERR);
29 /* write the data to the data reg */
30 ql_write32(qdev, PROC_DATA, data);
31 /* trigger the write */
32 ql_write32(qdev, PROC_ADDR, reg);
33 /* wait for reg to come ready */
34 status = ql_wait_reg_rdy(qdev, PROC_ADDR, PROC_ADDR_RDY, PROC_ADDR_ERR);
41 int ql_soft_reset_mpi_risc(struct ql_adapter *qdev)
44 status = ql_write_mpi_reg(qdev, 0x00001010, 1);
48 static int ql_get_mb_sts(struct ql_adapter *qdev, struct mbox_params *mbcp)
52 status = ql_sem_spinlock(qdev, SEM_PROC_REG_MASK);
55 for (i = 0; i < mbcp->out_count; i++) {
57 ql_read_mpi_reg(qdev, qdev->mailbox_out + i,
60 QPRINTK(qdev, DRV, ERR, "Failed mailbox read.\n");
64 ql_sem_unlock(qdev, SEM_PROC_REG_MASK); /* does flush too */
68 /* Wait for a single mailbox command to complete.
69 * Returns zero on success.
71 static int ql_wait_mbx_cmd_cmplt(struct ql_adapter *qdev)
77 value = ql_read32(qdev, STS);
80 mdelay(UDELAY_DELAY); /* 100ms */
85 /* Execute a single mailbox command.
86 * Caller must hold PROC_ADDR semaphore.
88 static int ql_exec_mb_cmd(struct ql_adapter *qdev, struct mbox_params *mbcp)
93 * Make sure there's nothing pending.
94 * This shouldn't happen.
96 if (ql_read32(qdev, CSR) & CSR_HRI)
99 status = ql_sem_spinlock(qdev, SEM_PROC_REG_MASK);
104 * Fill the outbound mailboxes.
106 for (i = 0; i < mbcp->in_count; i++) {
107 status = ql_write_mpi_reg(qdev, qdev->mailbox_in + i,
113 * Wake up the MPI firmware.
115 ql_write32(qdev, CSR, CSR_CMD_SET_H2R_INT);
117 ql_sem_unlock(qdev, SEM_PROC_REG_MASK);
121 /* We are being asked by firmware to accept
122 * a change to the port. This is only
123 * a change to max frame sizes (Tx/Rx), pause
124 * parameters, or loopback mode. We wake up a worker
125 * to handler processing this since a mailbox command
126 * will need to be sent to ACK the request.
128 static int ql_idc_req_aen(struct ql_adapter *qdev)
131 struct mbox_params *mbcp = &qdev->idc_mbc;
133 QPRINTK(qdev, DRV, ERR, "Enter!\n");
134 /* Get the status data and start up a thread to
135 * handle the request.
137 mbcp = &qdev->idc_mbc;
139 status = ql_get_mb_sts(qdev, mbcp);
141 QPRINTK(qdev, DRV, ERR,
142 "Could not read MPI, resetting ASIC!\n");
143 ql_queue_asic_error(qdev);
145 /* Begin polled mode early so
146 * we don't get another interrupt
147 * when we leave mpi_worker.
149 ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16));
150 queue_delayed_work(qdev->workqueue, &qdev->mpi_idc_work, 0);
155 /* Process an inter-device event completion.
156 * If good, signal the caller's completion.
158 static int ql_idc_cmplt_aen(struct ql_adapter *qdev)
161 struct mbox_params *mbcp = &qdev->idc_mbc;
163 status = ql_get_mb_sts(qdev, mbcp);
165 QPRINTK(qdev, DRV, ERR,
166 "Could not read MPI, resetting RISC!\n");
167 ql_queue_fw_error(qdev);
169 /* Wake up the sleeping mpi_idc_work thread that is
170 * waiting for this event.
172 complete(&qdev->ide_completion);
177 static void ql_link_up(struct ql_adapter *qdev, struct mbox_params *mbcp)
182 status = ql_get_mb_sts(qdev, mbcp);
184 QPRINTK(qdev, DRV, ERR,
185 "%s: Could not get mailbox status.\n", __func__);
189 qdev->link_status = mbcp->mbox_out[1];
190 QPRINTK(qdev, DRV, ERR, "Link Up.\n");
192 /* If we're coming back from an IDC event
193 * then set up the CAM and frame routing.
195 if (test_bit(QL_CAM_RT_SET, &qdev->flags)) {
196 status = ql_cam_route_initialize(qdev);
198 QPRINTK(qdev, IFUP, ERR,
199 "Failed to init CAM/Routing tables.\n");
202 clear_bit(QL_CAM_RT_SET, &qdev->flags);
205 /* Queue up a worker to check the frame
206 * size information, and fix it if it's not
209 if (!test_bit(QL_PORT_CFG, &qdev->flags)) {
210 QPRINTK(qdev, DRV, ERR, "Queue Port Config Worker!\n");
211 set_bit(QL_PORT_CFG, &qdev->flags);
212 /* Begin polled mode early so
213 * we don't get another interrupt
214 * when we leave mpi_worker dpc.
216 ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16));
217 queue_delayed_work(qdev->workqueue,
218 &qdev->mpi_port_cfg_work, 0);
224 static void ql_link_down(struct ql_adapter *qdev, struct mbox_params *mbcp)
230 status = ql_get_mb_sts(qdev, mbcp);
232 QPRINTK(qdev, DRV, ERR, "Link down AEN broken!\n");
237 static int ql_sfp_in(struct ql_adapter *qdev, struct mbox_params *mbcp)
243 status = ql_get_mb_sts(qdev, mbcp);
245 QPRINTK(qdev, DRV, ERR, "SFP in AEN broken!\n");
247 QPRINTK(qdev, DRV, ERR, "SFP insertion detected.\n");
252 static int ql_sfp_out(struct ql_adapter *qdev, struct mbox_params *mbcp)
258 status = ql_get_mb_sts(qdev, mbcp);
260 QPRINTK(qdev, DRV, ERR, "SFP out AEN broken!\n");
262 QPRINTK(qdev, DRV, ERR, "SFP removal detected.\n");
267 static int ql_aen_lost(struct ql_adapter *qdev, struct mbox_params *mbcp)
273 status = ql_get_mb_sts(qdev, mbcp);
275 QPRINTK(qdev, DRV, ERR, "Lost AEN broken!\n");
278 QPRINTK(qdev, DRV, ERR, "Lost AEN detected.\n");
279 for (i = 0; i < mbcp->out_count; i++)
280 QPRINTK(qdev, DRV, ERR, "mbox_out[%d] = 0x%.08x.\n",
281 i, mbcp->mbox_out[i]);
288 static void ql_init_fw_done(struct ql_adapter *qdev, struct mbox_params *mbcp)
294 status = ql_get_mb_sts(qdev, mbcp);
296 QPRINTK(qdev, DRV, ERR, "Firmware did not initialize!\n");
298 QPRINTK(qdev, DRV, ERR, "Firmware Revision = 0x%.08x.\n",
300 qdev->fw_rev_id = mbcp->mbox_out[1];
301 status = ql_cam_route_initialize(qdev);
303 QPRINTK(qdev, IFUP, ERR,
304 "Failed to init CAM/Routing tables.\n");
308 /* Process an async event and clear it unless it's an
310 * This can get called iteratively from the mpi_work thread
311 * when events arrive via an interrupt.
312 * It also gets called when a mailbox command is polling for
313 * it's completion. */
314 static int ql_mpi_handler(struct ql_adapter *qdev, struct mbox_params *mbcp)
317 int orig_count = mbcp->out_count;
319 /* Just get mailbox zero for now. */
321 status = ql_get_mb_sts(qdev, mbcp);
323 QPRINTK(qdev, DRV, ERR,
324 "Could not read MPI, resetting ASIC!\n");
325 ql_queue_asic_error(qdev);
329 switch (mbcp->mbox_out[0]) {
331 /* This case is only active when we arrive here
332 * as a result of issuing a mailbox command to
335 case MB_CMD_STS_INTRMDT:
336 case MB_CMD_STS_GOOD:
337 case MB_CMD_STS_INVLD_CMD:
338 case MB_CMD_STS_XFC_ERR:
339 case MB_CMD_STS_CSUM_ERR:
341 case MB_CMD_STS_PARAM_ERR:
342 /* We can only get mailbox status if we're polling from an
343 * unfinished command. Get the rest of the status data and
344 * return back to the caller.
345 * We only end up here when we're polling for a mailbox
346 * command completion.
348 mbcp->out_count = orig_count;
349 status = ql_get_mb_sts(qdev, mbcp);
352 /* We are being asked by firmware to accept
353 * a change to the port. This is only
354 * a change to max frame sizes (Tx/Rx), pause
355 * parameters, or loopback mode.
358 status = ql_idc_req_aen(qdev);
361 /* Process and inbound IDC event.
362 * This will happen when we're trying to
363 * change tx/rx max frame size, change pause
364 * parameters or loopback mode.
368 status = ql_idc_cmplt_aen(qdev);
372 ql_link_up(qdev, mbcp);
376 ql_link_down(qdev, mbcp);
379 case AEN_FW_INIT_DONE:
380 /* If we're in process on executing the firmware,
381 * then convert the status to normal mailbox status.
383 if (mbcp->mbox_in[0] == MB_CMD_EX_FW) {
384 mbcp->out_count = orig_count;
385 status = ql_get_mb_sts(qdev, mbcp);
386 mbcp->mbox_out[0] = MB_CMD_STS_GOOD;
389 ql_init_fw_done(qdev, mbcp);
393 ql_sfp_in(qdev, mbcp);
396 case AEN_AEN_SFP_OUT:
397 ql_sfp_out(qdev, mbcp);
400 /* This event can arrive at boot time or after an
401 * MPI reset if the firmware failed to initialize.
403 case AEN_FW_INIT_FAIL:
404 /* If we're in process on executing the firmware,
405 * then convert the status to normal mailbox status.
407 if (mbcp->mbox_in[0] == MB_CMD_EX_FW) {
408 mbcp->out_count = orig_count;
409 status = ql_get_mb_sts(qdev, mbcp);
410 mbcp->mbox_out[0] = MB_CMD_STS_ERR;
413 QPRINTK(qdev, DRV, ERR,
414 "Firmware initialization failed.\n");
416 ql_queue_fw_error(qdev);
420 QPRINTK(qdev, DRV, ERR,
422 ql_queue_fw_error(qdev);
427 ql_aen_lost(qdev, mbcp);
431 /* Need to support AEN 8110 */
434 QPRINTK(qdev, DRV, ERR,
435 "Unsupported AE %.08x.\n", mbcp->mbox_out[0]);
436 /* Clear the MPI firmware status. */
439 ql_write32(qdev, CSR, CSR_CMD_CLR_R2PCI_INT);
440 /* Restore the original mailbox count to
441 * what the caller asked for. This can get
442 * changed when a mailbox command is waiting
443 * for a response and an AEN arrives and
446 mbcp->out_count = orig_count;
450 /* Execute a single mailbox command.
451 * mbcp is a pointer to an array of u32. Each
452 * element in the array contains the value for it's
453 * respective mailbox register.
455 static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp)
460 /* Begin polled mode for MPI */
461 ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16));
463 /* Load the mailbox registers and wake up MPI RISC. */
464 status = ql_exec_mb_cmd(qdev, mbcp);
469 /* If we're generating a system error, then there's nothing
472 if (mbcp->mbox_in[0] == MB_CMD_MAKE_SYS_ERR)
475 /* Wait for the command to complete. We loop
476 * here because some AEN might arrive while
477 * we're waiting for the mailbox command to
478 * complete. If more than 5 arrive then we can
479 * assume something is wrong. */
482 /* Wait for the interrupt to come in. */
483 status = ql_wait_mbx_cmd_cmplt(qdev);
487 /* Process the event. If it's an AEN, it
488 * will be handled in-line or a worker
489 * will be spawned. If it's our completion
490 * we will catch it below.
492 status = ql_mpi_handler(qdev, mbcp);
496 /* It's either the completion for our mailbox
497 * command complete or an AEN. If it's our
498 * completion then get out.
500 if (((mbcp->mbox_out[0] & 0x0000f000) ==
502 ((mbcp->mbox_out[0] & 0x0000f000) ==
508 QPRINTK(qdev, DRV, ERR,
509 "Timed out waiting for mailbox complete.\n");
514 /* Now we can clear the interrupt condition
515 * and look at our status.
517 ql_write32(qdev, CSR, CSR_CMD_CLR_R2PCI_INT);
519 if (((mbcp->mbox_out[0] & 0x0000f000) !=
521 ((mbcp->mbox_out[0] & 0x0000f000) !=
522 MB_CMD_STS_INTRMDT)) {
526 /* End polled mode for MPI */
527 ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16) | INTR_MASK_PI);
532 /* Get MPI firmware version. This will be used for
533 * driver banner and for ethtool info.
534 * Returns zero on success.
536 int ql_mb_about_fw(struct ql_adapter *qdev)
538 struct mbox_params mbc;
539 struct mbox_params *mbcp = &mbc;
542 memset(mbcp, 0, sizeof(struct mbox_params));
547 mbcp->mbox_in[0] = MB_CMD_ABOUT_FW;
549 status = ql_mailbox_command(qdev, mbcp);
553 if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) {
554 QPRINTK(qdev, DRV, ERR,
555 "Failed about firmware command\n");
559 /* Store the firmware version */
560 qdev->fw_rev_id = mbcp->mbox_out[1];
565 /* Get functional state for MPI firmware.
566 * Returns zero on success.
568 int ql_mb_get_fw_state(struct ql_adapter *qdev)
570 struct mbox_params mbc;
571 struct mbox_params *mbcp = &mbc;
574 memset(mbcp, 0, sizeof(struct mbox_params));
579 mbcp->mbox_in[0] = MB_CMD_GET_FW_STATE;
581 status = ql_mailbox_command(qdev, mbcp);
585 if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) {
586 QPRINTK(qdev, DRV, ERR,
587 "Failed Get Firmware State.\n");
591 /* If bit zero is set in mbx 1 then the firmware is
592 * running, but not initialized. This should never
595 if (mbcp->mbox_out[1] & 1) {
596 QPRINTK(qdev, DRV, ERR,
597 "Firmware waiting for initialization.\n");
604 /* Send and ACK mailbox command to the firmware to
605 * let it continue with the change.
607 int ql_mb_idc_ack(struct ql_adapter *qdev)
609 struct mbox_params mbc;
610 struct mbox_params *mbcp = &mbc;
613 memset(mbcp, 0, sizeof(struct mbox_params));
618 mbcp->mbox_in[0] = MB_CMD_IDC_ACK;
619 mbcp->mbox_in[1] = qdev->idc_mbc.mbox_out[1];
620 mbcp->mbox_in[2] = qdev->idc_mbc.mbox_out[2];
621 mbcp->mbox_in[3] = qdev->idc_mbc.mbox_out[3];
622 mbcp->mbox_in[4] = qdev->idc_mbc.mbox_out[4];
624 status = ql_mailbox_command(qdev, mbcp);
628 if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) {
629 QPRINTK(qdev, DRV, ERR,
630 "Failed IDC ACK send.\n");
636 /* Get link settings and maximum frame size settings
637 * for the current port.
638 * Most likely will block.
640 int ql_mb_set_port_cfg(struct ql_adapter *qdev)
642 struct mbox_params mbc;
643 struct mbox_params *mbcp = &mbc;
646 memset(mbcp, 0, sizeof(struct mbox_params));
651 mbcp->mbox_in[0] = MB_CMD_SET_PORT_CFG;
652 mbcp->mbox_in[1] = qdev->link_config;
653 mbcp->mbox_in[2] = qdev->max_frame_size;
656 status = ql_mailbox_command(qdev, mbcp);
660 if (mbcp->mbox_out[0] == MB_CMD_STS_INTRMDT) {
661 QPRINTK(qdev, DRV, ERR,
662 "Port Config sent, wait for IDC.\n");
663 } else if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) {
664 QPRINTK(qdev, DRV, ERR,
665 "Failed Set Port Configuration.\n");
671 /* Get link settings and maximum frame size settings
672 * for the current port.
673 * Most likely will block.
675 int ql_mb_get_port_cfg(struct ql_adapter *qdev)
677 struct mbox_params mbc;
678 struct mbox_params *mbcp = &mbc;
681 memset(mbcp, 0, sizeof(struct mbox_params));
686 mbcp->mbox_in[0] = MB_CMD_GET_PORT_CFG;
688 status = ql_mailbox_command(qdev, mbcp);
692 if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) {
693 QPRINTK(qdev, DRV, ERR,
694 "Failed Get Port Configuration.\n");
697 QPRINTK(qdev, DRV, DEBUG,
698 "Passed Get Port Configuration.\n");
699 qdev->link_config = mbcp->mbox_out[1];
700 qdev->max_frame_size = mbcp->mbox_out[2];
705 /* IDC - Inter Device Communication...
706 * Some firmware commands require consent of adjacent FCOE
707 * function. This function waits for the OK, or a
708 * counter-request for a little more time.i
709 * The firmware will complete the request if the other
710 * function doesn't respond.
712 static int ql_idc_wait(struct ql_adapter *qdev)
714 int status = -ETIMEDOUT;
715 long wait_time = 1 * HZ;
716 struct mbox_params *mbcp = &qdev->idc_mbc;
718 /* Wait here for the command to complete
719 * via the IDC process.
722 wait_for_completion_timeout(&qdev->ide_completion,
725 QPRINTK(qdev, DRV, ERR,
729 /* Now examine the response from the IDC process.
730 * We might have a good completion or a request for
733 if (mbcp->mbox_out[0] == AEN_IDC_EXT) {
734 QPRINTK(qdev, DRV, ERR,
735 "IDC Time Extension from function.\n");
736 wait_time += (mbcp->mbox_out[1] >> 8) & 0x0000000f;
737 } else if (mbcp->mbox_out[0] == AEN_IDC_CMPLT) {
738 QPRINTK(qdev, DRV, ERR,
743 QPRINTK(qdev, DRV, ERR,
744 "IDC: Invalid State 0x%.04x.\n",
754 int ql_mb_set_mgmnt_traffic_ctl(struct ql_adapter *qdev, u32 control)
756 struct mbox_params mbc;
757 struct mbox_params *mbcp = &mbc;
760 memset(mbcp, 0, sizeof(struct mbox_params));
765 mbcp->mbox_in[0] = MB_CMD_SET_MGMNT_TFK_CTL;
766 mbcp->mbox_in[1] = control;
768 status = ql_mailbox_command(qdev, mbcp);
772 if (mbcp->mbox_out[0] == MB_CMD_STS_GOOD)
775 if (mbcp->mbox_out[0] == MB_CMD_STS_INVLD_CMD) {
776 QPRINTK(qdev, DRV, ERR,
777 "Command not supported by firmware.\n");
779 } else if (mbcp->mbox_out[0] == MB_CMD_STS_ERR) {
780 /* This indicates that the firmware is
781 * already in the state we are trying to
784 QPRINTK(qdev, DRV, ERR,
785 "Command parameters make no change.\n");
790 /* Returns a negative error code or the mailbox command status. */
791 static int ql_mb_get_mgmnt_traffic_ctl(struct ql_adapter *qdev, u32 *control)
793 struct mbox_params mbc;
794 struct mbox_params *mbcp = &mbc;
797 memset(mbcp, 0, sizeof(struct mbox_params));
803 mbcp->mbox_in[0] = MB_CMD_GET_MGMNT_TFK_CTL;
805 status = ql_mailbox_command(qdev, mbcp);
809 if (mbcp->mbox_out[0] == MB_CMD_STS_GOOD) {
810 *control = mbcp->mbox_in[1];
814 if (mbcp->mbox_out[0] == MB_CMD_STS_INVLD_CMD) {
815 QPRINTK(qdev, DRV, ERR,
816 "Command not supported by firmware.\n");
818 } else if (mbcp->mbox_out[0] == MB_CMD_STS_ERR) {
819 QPRINTK(qdev, DRV, ERR,
820 "Failed to get MPI traffic control.\n");
826 int ql_wait_fifo_empty(struct ql_adapter *qdev)
829 u32 mgmnt_fifo_empty;
833 nic_fifo_empty = ql_read32(qdev, STS) & STS_NFE;
834 ql_mb_get_mgmnt_traffic_ctl(qdev, &mgmnt_fifo_empty);
835 mgmnt_fifo_empty &= MB_GET_MPI_TFK_FIFO_EMPTY;
836 if (nic_fifo_empty && mgmnt_fifo_empty)
839 } while (count-- > 0);
843 /* API called in work thread context to set new TX/RX
844 * maximum frame size values to match MTU.
846 static int ql_set_port_cfg(struct ql_adapter *qdev)
850 status = ql_mb_set_port_cfg(qdev);
854 status = ql_idc_wait(qdev);
858 /* The following routines are worker threads that process
859 * events that may sleep waiting for completion.
862 /* This thread gets the maximum TX and RX frame size values
863 * from the firmware and, if necessary, changes them to match
866 void ql_mpi_port_cfg_work(struct work_struct *work)
868 struct ql_adapter *qdev =
869 container_of(work, struct ql_adapter, mpi_port_cfg_work.work);
873 status = ql_mb_get_port_cfg(qdev);
876 QPRINTK(qdev, DRV, ERR,
877 "Bug: Failed to get port config data.\n");
881 if (qdev->link_config & CFG_JUMBO_FRAME_SIZE &&
882 qdev->max_frame_size ==
883 CFG_DEFAULT_MAX_FRAME_SIZE)
886 qdev->link_config |= CFG_JUMBO_FRAME_SIZE;
887 qdev->max_frame_size = CFG_DEFAULT_MAX_FRAME_SIZE;
888 status = ql_set_port_cfg(qdev);
890 QPRINTK(qdev, DRV, ERR,
891 "Bug: Failed to set port config data.\n");
895 clear_bit(QL_PORT_CFG, &qdev->flags);
898 ql_queue_fw_error(qdev);
902 /* Process an inter-device request. This is issues by
903 * the firmware in response to another function requesting
904 * a change to the port. We set a flag to indicate a change
905 * has been made and then send a mailbox command ACKing
906 * the change request.
908 void ql_mpi_idc_work(struct work_struct *work)
910 struct ql_adapter *qdev =
911 container_of(work, struct ql_adapter, mpi_idc_work.work);
913 struct mbox_params *mbcp = &qdev->idc_mbc;
916 aen = mbcp->mbox_out[1] >> 16;
920 QPRINTK(qdev, DRV, ERR,
921 "Bug: Unhandled IDC action.\n");
923 case MB_CMD_PORT_RESET:
924 case MB_CMD_SET_PORT_CFG:
927 /* Signal the resulting link up AEN
928 * that the frame routing and mac addr
931 set_bit(QL_CAM_RT_SET, &qdev->flags);
933 status = ql_mb_idc_ack(qdev);
936 QPRINTK(qdev, DRV, ERR,
937 "Bug: No pending IDC!\n");
942 void ql_mpi_work(struct work_struct *work)
944 struct ql_adapter *qdev =
945 container_of(work, struct ql_adapter, mpi_work.work);
946 struct mbox_params mbc;
947 struct mbox_params *mbcp = &mbc;
951 /* Begin polled mode for MPI */
952 ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16));
954 while (ql_read32(qdev, STS) & STS_PI) {
955 memset(mbcp, 0, sizeof(struct mbox_params));
957 /* Don't continue if an async event
958 * did not complete properly.
960 err = ql_mpi_handler(qdev, mbcp);
965 /* End polled mode for MPI */
966 ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16) | INTR_MASK_PI);
968 ql_enable_completion_interrupt(qdev, 0);
971 void ql_mpi_reset_work(struct work_struct *work)
973 struct ql_adapter *qdev =
974 container_of(work, struct ql_adapter, mpi_reset_work.work);
975 cancel_delayed_work_sync(&qdev->mpi_work);
976 cancel_delayed_work_sync(&qdev->mpi_port_cfg_work);
977 cancel_delayed_work_sync(&qdev->mpi_idc_work);
978 ql_soft_reset_mpi_risc(qdev);