diff options
author | Ron Mercer <ron.mercer@qlogic.com> | 2009-11-03 08:49:30 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-04 08:01:37 -0500 |
commit | 1e34e307d0ebe536feb39c957c849a485bc81486 (patch) | |
tree | 1b835350717e9ffde6d29a734422931556f62c15 | |
parent | 32a5b2a0d516ba4056d9e9b8b14e34bef3f68921 (diff) |
qlge: Add firmware/driver sub-command support.
These sub-commands are issued by another (FCoE) function requesting
an operation on a shared resource.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/qlge/qlge.h | 12 | ||||
-rw-r--r-- | drivers/net/qlge/qlge_mpi.c | 56 |
2 files changed, 61 insertions, 7 deletions
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index 872e95ee40ee..5e4d3439043e 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h | |||
@@ -816,6 +816,18 @@ enum { | |||
816 | MB_CMD_GET_MGMNT_TFK_CTL = 0x00000161, /* Get Mgmnt Traffic Control */ | 816 | MB_CMD_GET_MGMNT_TFK_CTL = 0x00000161, /* Get Mgmnt Traffic Control */ |
817 | MB_GET_MPI_TFK_STOPPED = (1 << 0), | 817 | MB_GET_MPI_TFK_STOPPED = (1 << 0), |
818 | MB_GET_MPI_TFK_FIFO_EMPTY = (1 << 1), | 818 | MB_GET_MPI_TFK_FIFO_EMPTY = (1 << 1), |
819 | /* Sub-commands for IDC request. | ||
820 | * This describes the reason for the | ||
821 | * IDC request. | ||
822 | */ | ||
823 | MB_CMD_IOP_NONE = 0x0000, | ||
824 | MB_CMD_IOP_PREP_UPDATE_MPI = 0x0001, | ||
825 | MB_CMD_IOP_COMP_UPDATE_MPI = 0x0002, | ||
826 | MB_CMD_IOP_PREP_LINK_DOWN = 0x0010, | ||
827 | MB_CMD_IOP_DVR_START = 0x0100, | ||
828 | MB_CMD_IOP_FLASH_ACC = 0x0101, | ||
829 | MB_CMD_IOP_RESTART_MPI = 0x0102, | ||
830 | MB_CMD_IOP_CORE_DUMP_MPI = 0x0103, | ||
819 | 831 | ||
820 | /* Mailbox Command Status. */ | 832 | /* Mailbox Command Status. */ |
821 | MB_CMD_STS_GOOD = 0x00004000, /* Success. */ | 833 | MB_CMD_STS_GOOD = 0x00004000, /* Success. */ |
diff --git a/drivers/net/qlge/qlge_mpi.c b/drivers/net/qlge/qlge_mpi.c index bac7b86f2129..f5619fe87bb2 100644 --- a/drivers/net/qlge/qlge_mpi.c +++ b/drivers/net/qlge/qlge_mpi.c | |||
@@ -1038,8 +1038,11 @@ void ql_mpi_idc_work(struct work_struct *work) | |||
1038 | int status; | 1038 | int status; |
1039 | struct mbox_params *mbcp = &qdev->idc_mbc; | 1039 | struct mbox_params *mbcp = &qdev->idc_mbc; |
1040 | u32 aen; | 1040 | u32 aen; |
1041 | int timeout; | ||
1041 | 1042 | ||
1043 | rtnl_lock(); | ||
1042 | aen = mbcp->mbox_out[1] >> 16; | 1044 | aen = mbcp->mbox_out[1] >> 16; |
1045 | timeout = (mbcp->mbox_out[1] >> 8) & 0xf; | ||
1043 | 1046 | ||
1044 | switch (aen) { | 1047 | switch (aen) { |
1045 | default: | 1048 | default: |
@@ -1047,22 +1050,61 @@ void ql_mpi_idc_work(struct work_struct *work) | |||
1047 | "Bug: Unhandled IDC action.\n"); | 1050 | "Bug: Unhandled IDC action.\n"); |
1048 | break; | 1051 | break; |
1049 | case MB_CMD_PORT_RESET: | 1052 | case MB_CMD_PORT_RESET: |
1050 | case MB_CMD_SET_PORT_CFG: | ||
1051 | case MB_CMD_STOP_FW: | 1053 | case MB_CMD_STOP_FW: |
1052 | ql_link_off(qdev); | 1054 | ql_link_off(qdev); |
1055 | case MB_CMD_SET_PORT_CFG: | ||
1053 | /* Signal the resulting link up AEN | 1056 | /* Signal the resulting link up AEN |
1054 | * that the frame routing and mac addr | 1057 | * that the frame routing and mac addr |
1055 | * needs to be set. | 1058 | * needs to be set. |
1056 | * */ | 1059 | * */ |
1057 | set_bit(QL_CAM_RT_SET, &qdev->flags); | 1060 | set_bit(QL_CAM_RT_SET, &qdev->flags); |
1058 | rtnl_lock(); | 1061 | /* Do ACK if required */ |
1059 | status = ql_mb_idc_ack(qdev); | 1062 | if (timeout) { |
1060 | rtnl_unlock(); | 1063 | status = ql_mb_idc_ack(qdev); |
1061 | if (status) { | 1064 | if (status) |
1062 | QPRINTK(qdev, DRV, ERR, | 1065 | QPRINTK(qdev, DRV, ERR, |
1063 | "Bug: No pending IDC!\n"); | 1066 | "Bug: No pending IDC!\n"); |
1067 | } else { | ||
1068 | QPRINTK(qdev, DRV, DEBUG, | ||
1069 | "IDC ACK not required\n"); | ||
1070 | status = 0; /* success */ | ||
1071 | } | ||
1072 | break; | ||
1073 | |||
1074 | /* These sub-commands issued by another (FCoE) | ||
1075 | * function are requesting to do an operation | ||
1076 | * on the shared resource (MPI environment). | ||
1077 | * We currently don't issue these so we just | ||
1078 | * ACK the request. | ||
1079 | */ | ||
1080 | case MB_CMD_IOP_RESTART_MPI: | ||
1081 | case MB_CMD_IOP_PREP_LINK_DOWN: | ||
1082 | /* Drop the link, reload the routing | ||
1083 | * table when link comes up. | ||
1084 | */ | ||
1085 | ql_link_off(qdev); | ||
1086 | set_bit(QL_CAM_RT_SET, &qdev->flags); | ||
1087 | /* Fall through. */ | ||
1088 | case MB_CMD_IOP_DVR_START: | ||
1089 | case MB_CMD_IOP_FLASH_ACC: | ||
1090 | case MB_CMD_IOP_CORE_DUMP_MPI: | ||
1091 | case MB_CMD_IOP_PREP_UPDATE_MPI: | ||
1092 | case MB_CMD_IOP_COMP_UPDATE_MPI: | ||
1093 | case MB_CMD_IOP_NONE: /* an IDC without params */ | ||
1094 | /* Do ACK if required */ | ||
1095 | if (timeout) { | ||
1096 | status = ql_mb_idc_ack(qdev); | ||
1097 | if (status) | ||
1098 | QPRINTK(qdev, DRV, ERR, | ||
1099 | "Bug: No pending IDC!\n"); | ||
1100 | } else { | ||
1101 | QPRINTK(qdev, DRV, DEBUG, | ||
1102 | "IDC ACK not required\n"); | ||
1103 | status = 0; /* success */ | ||
1064 | } | 1104 | } |
1105 | break; | ||
1065 | } | 1106 | } |
1107 | rtnl_unlock(); | ||
1066 | } | 1108 | } |
1067 | 1109 | ||
1068 | void ql_mpi_work(struct work_struct *work) | 1110 | void ql_mpi_work(struct work_struct *work) |