Lines Matching defs:mbcp
126 static int ql_get_mb_sts(struct ql_adapter *qdev, struct mbox_params *mbcp)
133 for (i = 0; i < mbcp->out_count; i++) {
136 &mbcp->mbox_out[i]);
166 static int ql_exec_mb_cmd(struct ql_adapter *qdev, struct mbox_params *mbcp)
184 for (i = 0; i < mbcp->in_count; i++) {
186 mbcp->mbox_in[i]);
209 struct mbox_params *mbcp = &qdev->idc_mbc;
215 mbcp = &qdev->idc_mbc;
216 mbcp->out_count = 4;
217 status = ql_get_mb_sts(qdev, mbcp);
239 struct mbox_params *mbcp = &qdev->idc_mbc;
240 mbcp->out_count = 4;
241 status = ql_get_mb_sts(qdev, mbcp);
255 static void ql_link_up(struct ql_adapter *qdev, struct mbox_params *mbcp)
258 mbcp->out_count = 2;
260 status = ql_get_mb_sts(qdev, mbcp);
267 qdev->link_status = mbcp->mbox_out[1];
302 static void ql_link_down(struct ql_adapter *qdev, struct mbox_params *mbcp)
306 mbcp->out_count = 3;
308 status = ql_get_mb_sts(qdev, mbcp);
315 static int ql_sfp_in(struct ql_adapter *qdev, struct mbox_params *mbcp)
319 mbcp->out_count = 5;
321 status = ql_get_mb_sts(qdev, mbcp);
330 static int ql_sfp_out(struct ql_adapter *qdev, struct mbox_params *mbcp)
334 mbcp->out_count = 1;
336 status = ql_get_mb_sts(qdev, mbcp);
345 static int ql_aen_lost(struct ql_adapter *qdev, struct mbox_params *mbcp)
349 mbcp->out_count = 6;
351 status = ql_get_mb_sts(qdev, mbcp);
357 for (i = 0; i < mbcp->out_count; i++)
359 i, mbcp->mbox_out[i]);
366 static void ql_init_fw_done(struct ql_adapter *qdev, struct mbox_params *mbcp)
370 mbcp->out_count = 2;
372 status = ql_get_mb_sts(qdev, mbcp);
377 mbcp->mbox_out[1]);
378 qdev->fw_rev_id = mbcp->mbox_out[1];
392 static int ql_mpi_handler(struct ql_adapter *qdev, struct mbox_params *mbcp)
395 int orig_count = mbcp->out_count;
398 mbcp->out_count = 1;
399 status = ql_get_mb_sts(qdev, mbcp);
407 switch (mbcp->mbox_out[0]) {
426 mbcp->out_count = orig_count;
427 status = ql_get_mb_sts(qdev, mbcp);
450 ql_link_up(qdev, mbcp);
454 ql_link_down(qdev, mbcp);
461 if (mbcp->mbox_in[0] == MB_CMD_EX_FW) {
462 mbcp->out_count = orig_count;
463 status = ql_get_mb_sts(qdev, mbcp);
464 mbcp->mbox_out[0] = MB_CMD_STS_GOOD;
467 ql_init_fw_done(qdev, mbcp);
471 ql_sfp_in(qdev, mbcp);
475 ql_sfp_out(qdev, mbcp);
485 if (mbcp->mbox_in[0] == MB_CMD_EX_FW) {
486 mbcp->out_count = orig_count;
487 status = ql_get_mb_sts(qdev, mbcp);
488 mbcp->mbox_out[0] = MB_CMD_STS_ERR;
504 ql_aen_lost(qdev, mbcp);
512 "Unsupported AE %.08x.\n", mbcp->mbox_out[0]);
523 mbcp->out_count = orig_count;
528 * mbcp is a pointer to an array of u32. Each
532 static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp)
542 status = ql_exec_mb_cmd(qdev, mbcp);
550 if (mbcp->mbox_in[0] == MB_CMD_MAKE_SYS_ERR)
570 status = ql_mpi_handler(qdev, mbcp);
578 if (((mbcp->mbox_out[0] & 0x0000f000) ==
580 ((mbcp->mbox_out[0] & 0x0000f000) ==
597 if (((mbcp->mbox_out[0] & 0x0000f000) !=
599 ((mbcp->mbox_out[0] & 0x0000f000) !=
616 struct mbox_params *mbcp = &mbc;
619 memset(mbcp, 0, sizeof(struct mbox_params));
621 mbcp->in_count = 1;
622 mbcp->out_count = 3;
624 mbcp->mbox_in[0] = MB_CMD_ABOUT_FW;
626 status = ql_mailbox_command(qdev, mbcp);
630 if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) {
637 qdev->fw_rev_id = mbcp->mbox_out[1];
648 struct mbox_params *mbcp = &mbc;
651 memset(mbcp, 0, sizeof(struct mbox_params));
653 mbcp->in_count = 1;
654 mbcp->out_count = 2;
656 mbcp->mbox_in[0] = MB_CMD_GET_FW_STATE;
658 status = ql_mailbox_command(qdev, mbcp);
662 if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) {
672 if (mbcp->mbox_out[1] & 1) {
687 struct mbox_params *mbcp = &mbc;
690 memset(mbcp, 0, sizeof(struct mbox_params));
692 mbcp->in_count = 5;
693 mbcp->out_count = 1;
695 mbcp->mbox_in[0] = MB_CMD_IDC_ACK;
696 mbcp->mbox_in[1] = qdev->idc_mbc.mbox_out[1];
697 mbcp->mbox_in[2] = qdev->idc_mbc.mbox_out[2];
698 mbcp->mbox_in[3] = qdev->idc_mbc.mbox_out[3];
699 mbcp->mbox_in[4] = qdev->idc_mbc.mbox_out[4];
701 status = ql_mailbox_command(qdev, mbcp);
705 if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) {
719 struct mbox_params *mbcp = &mbc;
722 memset(mbcp, 0, sizeof(struct mbox_params));
724 mbcp->in_count = 3;
725 mbcp->out_count = 1;
727 mbcp->mbox_in[0] = MB_CMD_SET_PORT_CFG;
728 mbcp->mbox_in[1] = qdev->link_config;
729 mbcp->mbox_in[2] = qdev->max_frame_size;
732 status = ql_mailbox_command(qdev, mbcp);
736 if (mbcp->mbox_out[0] == MB_CMD_STS_INTRMDT) {
739 } else if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) {
752 struct mbox_params *mbcp = &mbc;
754 memset(mbcp, 0, sizeof(struct mbox_params));
756 mbcp->in_count = 9;
757 mbcp->out_count = 1;
759 mbcp->mbox_in[0] = MB_CMD_DUMP_RISC_RAM;
760 mbcp->mbox_in[1] = LSW(addr);
761 mbcp->mbox_in[2] = MSW(req_dma);
762 mbcp->mbox_in[3] = LSW(req_dma);
763 mbcp->mbox_in[4] = MSW(size);
764 mbcp->mbox_in[5] = LSW(size);
765 mbcp->mbox_in[6] = MSW(MSD(req_dma));
766 mbcp->mbox_in[7] = LSW(MSD(req_dma));
767 mbcp->mbox_in[8] = MSW(addr);
770 status = ql_mailbox_command(qdev, mbcp);
774 if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) {
810 struct mbox_params *mbcp = &mbc;
813 memset(mbcp, 0, sizeof(struct mbox_params));
815 mbcp->in_count = 1;
816 mbcp->out_count = 3;
818 mbcp->mbox_in[0] = MB_CMD_GET_PORT_CFG;
820 status = ql_mailbox_command(qdev, mbcp);
824 if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) {
831 qdev->link_config = mbcp->mbox_out[1];
832 qdev->max_frame_size = mbcp->mbox_out[2];
840 struct mbox_params *mbcp = &mbc;
843 memset(mbcp, 0, sizeof(struct mbox_params));
845 mbcp->in_count = 2;
846 mbcp->out_count = 1;
848 mbcp->mbox_in[0] = MB_CMD_SET_WOL_MODE;
849 mbcp->mbox_in[1] = wol;
852 status = ql_mailbox_command(qdev, mbcp);
856 if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) {
866 struct mbox_params *mbcp = &mbc;
870 memset(mbcp, 0, sizeof(struct mbox_params));
872 mbcp->in_count = 8;
873 mbcp->out_count = 1;
875 mbcp->mbox_in[0] = MB_CMD_SET_WOL_MAGIC;
877 mbcp->mbox_in[1] = (u32)addr[0];
878 mbcp->mbox_in[2] = (u32)addr[1];
879 mbcp->mbox_in[3] = (u32)addr[2];
880 mbcp->mbox_in[4] = (u32)addr[3];
881 mbcp->mbox_in[5] = (u32)addr[4];
882 mbcp->mbox_in[6] = (u32)addr[5];
883 mbcp->mbox_in[7] = 0;
885 mbcp->mbox_in[1] = 0;
886 mbcp->mbox_in[2] = 1;
887 mbcp->mbox_in[3] = 1;
888 mbcp->mbox_in[4] = 1;
889 mbcp->mbox_in[5] = 1;
890 mbcp->mbox_in[6] = 1;
891 mbcp->mbox_in[7] = 0;
894 status = ql_mailbox_command(qdev, mbcp);
898 if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) {
916 struct mbox_params *mbcp = &qdev->idc_mbc;
932 if (mbcp->mbox_out[0] == AEN_IDC_EXT) {
935 wait_time += (mbcp->mbox_out[1] >> 8) & 0x0000000f;
936 } else if (mbcp->mbox_out[0] == AEN_IDC_CMPLT) {
943 mbcp->mbox_out[0]);
955 struct mbox_params *mbcp = &mbc;
958 memset(mbcp, 0, sizeof(struct mbox_params));
960 mbcp->in_count = 2;
961 mbcp->out_count = 1;
963 mbcp->mbox_in[0] = MB_CMD_SET_LED_CFG;
964 mbcp->mbox_in[1] = led_config;
967 status = ql_mailbox_command(qdev, mbcp);
971 if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) {
983 struct mbox_params *mbcp = &mbc;
986 memset(mbcp, 0, sizeof(struct mbox_params));
988 mbcp->in_count = 1;
989 mbcp->out_count = 2;
991 mbcp->mbox_in[0] = MB_CMD_GET_LED_CFG;
993 status = ql_mailbox_command(qdev, mbcp);
997 if (mbcp->mbox_out[0] != MB_CMD_STS_GOOD) {
1002 qdev->led_config = mbcp->mbox_out[1];
1010 struct mbox_params *mbcp = &mbc;
1013 memset(mbcp, 0, sizeof(struct mbox_params));
1015 mbcp->in_count = 1;
1016 mbcp->out_count = 2;
1018 mbcp->mbox_in[0] = MB_CMD_SET_MGMNT_TFK_CTL;
1019 mbcp->mbox_in[1] = control;
1021 status = ql_mailbox_command(qdev, mbcp);
1025 if (mbcp->mbox_out[0] == MB_CMD_STS_GOOD)
1028 if (mbcp->mbox_out[0] == MB_CMD_STS_INVLD_CMD) {
1032 } else if (mbcp->mbox_out[0] == MB_CMD_STS_ERR) {
1047 struct mbox_params *mbcp = &mbc;
1050 memset(mbcp, 0, sizeof(struct mbox_params));
1053 mbcp->in_count = 1;
1054 mbcp->out_count = 1;
1056 mbcp->mbox_in[0] = MB_CMD_GET_MGMNT_TFK_CTL;
1058 status = ql_mailbox_command(qdev, mbcp);
1062 if (mbcp->mbox_out[0] == MB_CMD_STS_GOOD) {
1063 *control = mbcp->mbox_in[1];
1067 if (mbcp->mbox_out[0] == MB_CMD_STS_INVLD_CMD) {
1071 } else if (mbcp->mbox_out[0] == MB_CMD_STS_ERR) {
1166 struct mbox_params *mbcp = &qdev->idc_mbc;
1171 aen = mbcp->mbox_out[1] >> 16;
1172 timeout = (mbcp->mbox_out[1] >> 8) & 0xf;
1242 struct mbox_params *mbcp = &mbc;
1250 memset(mbcp, 0, sizeof(struct mbox_params));
1251 mbcp->out_count = 1;
1255 err = ql_mpi_handler(qdev, mbcp);