8 tmp = ql_read32(qdev,
CSR);
24 tmp = ql_read32(qdev,
CSR);
41 tmp = ql_read32(qdev,
CSR);
118 temp = ql_read32(qdev,
STS);
119 if (!(temp & (1 << (8 + qdev->
alt_func))))
149 static int ql_wait_mbx_cmd_cmplt(
struct ql_adapter *qdev)
155 value = ql_read32(qdev,
STS);
184 for (i = 0; i < mbcp->
in_count; i++) {
206 static int ql_idc_req_aen(
struct ql_adapter *qdev)
217 status = ql_get_mb_sts(qdev, mbcp);
220 "Could not read MPI, resetting ASIC!\n");
236 static int ql_idc_cmplt_aen(
struct ql_adapter *qdev)
241 status = ql_get_mb_sts(qdev, mbcp);
244 "Could not read MPI, resetting RISC!\n");
260 status = ql_get_mb_sts(qdev, mbcp);
263 "%s: Could not get mailbox status.\n", __func__);
277 "Failed to init CAM/Routing tables.\n");
288 netif_err(qdev, drv, qdev->
ndev,
"Queue Port Config Worker!\n");
308 status = ql_get_mb_sts(qdev, mbcp);
321 status = ql_get_mb_sts(qdev, mbcp);
325 netif_err(qdev, drv, qdev->
ndev,
"SFP insertion detected.\n");
336 status = ql_get_mb_sts(qdev, mbcp);
351 status = ql_get_mb_sts(qdev, mbcp);
358 netif_err(qdev, drv, qdev->
ndev,
"mbox_out[%d] = 0x%.08x.\n",
372 status = ql_get_mb_sts(qdev, mbcp);
374 netif_err(qdev, drv, qdev->
ndev,
"Firmware did not initialize!\n");
376 netif_err(qdev, drv, qdev->
ndev,
"Firmware Revision = 0x%.08x.\n",
382 "Failed to init CAM/Routing tables.\n");
399 status = ql_get_mb_sts(qdev, mbcp);
402 "Could not read MPI, resetting ASIC!\n");
427 status = ql_get_mb_sts(qdev, mbcp);
436 status = ql_idc_req_aen(qdev);
446 status = ql_idc_cmplt_aen(qdev);
450 ql_link_up(qdev, mbcp);
454 ql_link_down(qdev, mbcp);
463 status = ql_get_mb_sts(qdev, mbcp);
467 ql_init_fw_done(qdev, mbcp);
471 ql_sfp_in(qdev, mbcp);
475 ql_sfp_out(qdev, mbcp);
487 status = ql_get_mb_sts(qdev, mbcp);
492 "Firmware initialization failed.\n");
504 ql_aen_lost(qdev, mbcp);
512 "Unsupported AE %.08x.\n", mbcp->
mbox_out[0]);
543 status = ql_exec_mb_cmd(qdev, mbcp);
562 status = ql_wait_mbx_cmd_cmplt(qdev);
571 status = ql_mpi_handler(qdev, mbcp);
579 if (((mbcp->
mbox_out[0] & 0x0000f000) ==
581 ((mbcp->
mbox_out[0] & 0x0000f000) ==
587 "Timed out waiting for mailbox complete.\n");
598 if (((mbcp->
mbox_out[0] & 0x0000f000) !=
600 ((mbcp->
mbox_out[0] & 0x0000f000) !=
628 status = ql_mailbox_command(qdev, mbcp);
634 "Failed about firmware command\n");
660 status = ql_mailbox_command(qdev, mbcp);
666 "Failed Get Firmware State.\n");
676 "Firmware waiting for initialization.\n");
686 static int ql_mb_idc_ack(
struct ql_adapter *qdev)
703 status = ql_mailbox_command(qdev, mbcp);
734 status = ql_mailbox_command(qdev, mbcp);
740 "Port Config sent, wait for IDC.\n");
743 "Failed Set Port Configuration.\n");
772 status = ql_mailbox_command(qdev, mbcp);
777 netif_err(qdev, drv, qdev->
ndev,
"Failed to dump risc RAM.\n");
785 u32 ram_addr,
int word_count)
796 status = ql_mb_dump_ram(qdev, buf_dma, ram_addr, word_count);
798 memcpy(buf, my_buf, word_count *
sizeof(
u32));
822 status = ql_mailbox_command(qdev, mbcp);
828 "Failed Get Port Configuration.\n");
832 "Passed Get Port Configuration.\n");
854 status = ql_mailbox_command(qdev, mbcp);
859 netif_err(qdev, drv, qdev->
ndev,
"Failed to set WOL mode.\n");
870 u8 *addr = qdev->
ndev->dev_addr;
896 status = ql_mailbox_command(qdev, mbcp);
901 netif_err(qdev, drv, qdev->
ndev,
"Failed to set WOL mode.\n");
914 static int ql_idc_wait(
struct ql_adapter *qdev)
936 "IDC Time Extension from function.\n");
937 wait_time += (mbcp->
mbox_out[1] >> 8) & 0x0000000f;
944 "IDC: Invalid State 0x%.04x.\n",
969 status = ql_mailbox_command(qdev, mbcp);
975 "Failed to set LED Configuration.\n");
995 status = ql_mailbox_command(qdev, mbcp);
1001 "Failed to get LED Configuration.\n");
1023 status = ql_mailbox_command(qdev, mbcp);
1032 "Command not supported by firmware.\n");
1040 "Command parameters make no change.\n");
1060 status = ql_mailbox_command(qdev, mbcp);
1071 "Command not supported by firmware.\n");
1075 "Failed to get MPI traffic control.\n");
1084 u32 mgmnt_fifo_empty;
1088 nic_fifo_empty = ql_read32(qdev,
STS) &
STS_NFE;
1089 ql_mb_get_mgmnt_traffic_ctl(qdev, &mgmnt_fifo_empty);
1091 if (nic_fifo_empty && mgmnt_fifo_empty)
1094 }
while (count-- > 0);
1101 static int ql_set_port_cfg(
struct ql_adapter *qdev)
1107 status = ql_idc_wait(qdev);
1128 "Bug: Failed to get port config data.\n");
1139 status = ql_set_port_cfg(qdev);
1142 "Bug: Failed to set port config data.\n");
1169 timeout = (mbcp->
mbox_out[1] >> 8) & 0xf;
1174 "Bug: Unhandled IDC action.\n");
1187 status = ql_mb_idc_ack(qdev);
1190 "Bug: No pending IDC!\n");
1193 "IDC ACK not required\n");
1220 status = ql_mb_idc_ack(qdev);
1223 "Bug: No pending IDC!\n");
1226 "IDC ACK not required\n");
1251 err = ql_mpi_handler(qdev, mbcp);