diff options
Diffstat (limited to 'drivers/scsi/csiostor/csio_mb.c')
-rw-r--r-- | drivers/scsi/csiostor/csio_mb.c | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/drivers/scsi/csiostor/csio_mb.c b/drivers/scsi/csiostor/csio_mb.c index 08c265c0f353..9451787ca7f2 100644 --- a/drivers/scsi/csiostor/csio_mb.c +++ b/drivers/scsi/csiostor/csio_mb.c | |||
@@ -327,7 +327,8 @@ csio_mb_caps_config(struct csio_hw *hw, struct csio_mb *mbp, uint32_t tmo, | |||
327 | } | 327 | } |
328 | 328 | ||
329 | #define CSIO_ADVERT_MASK (FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G |\ | 329 | #define CSIO_ADVERT_MASK (FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G |\ |
330 | FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_ANEG) | 330 | FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_40G |\ |
331 | FW_PORT_CAP_ANEG) | ||
331 | 332 | ||
332 | /* | 333 | /* |
333 | * csio_mb_port- FW PORT command helper | 334 | * csio_mb_port- FW PORT command helper |
@@ -1104,8 +1105,8 @@ csio_mb_process_portparams_rsp(struct csio_hw *hw, | |||
1104 | void | 1105 | void |
1105 | csio_mb_intr_enable(struct csio_hw *hw) | 1106 | csio_mb_intr_enable(struct csio_hw *hw) |
1106 | { | 1107 | { |
1107 | csio_wr_reg32(hw, MBMSGRDYINTEN(1), MYPF_REG(CIM_PF_HOST_INT_ENABLE)); | 1108 | csio_wr_reg32(hw, MBMSGRDYINTEN_F, MYPF_REG(CIM_PF_HOST_INT_ENABLE_A)); |
1108 | csio_rd_reg32(hw, MYPF_REG(CIM_PF_HOST_INT_ENABLE)); | 1109 | csio_rd_reg32(hw, MYPF_REG(CIM_PF_HOST_INT_ENABLE_A)); |
1109 | } | 1110 | } |
1110 | 1111 | ||
1111 | /* | 1112 | /* |
@@ -1117,8 +1118,9 @@ csio_mb_intr_enable(struct csio_hw *hw) | |||
1117 | void | 1118 | void |
1118 | csio_mb_intr_disable(struct csio_hw *hw) | 1119 | csio_mb_intr_disable(struct csio_hw *hw) |
1119 | { | 1120 | { |
1120 | csio_wr_reg32(hw, MBMSGRDYINTEN(0), MYPF_REG(CIM_PF_HOST_INT_ENABLE)); | 1121 | csio_wr_reg32(hw, MBMSGRDYINTEN_V(0), |
1121 | csio_rd_reg32(hw, MYPF_REG(CIM_PF_HOST_INT_ENABLE)); | 1122 | MYPF_REG(CIM_PF_HOST_INT_ENABLE_A)); |
1123 | csio_rd_reg32(hw, MYPF_REG(CIM_PF_HOST_INT_ENABLE_A)); | ||
1122 | } | 1124 | } |
1123 | 1125 | ||
1124 | static void | 1126 | static void |
@@ -1153,8 +1155,8 @@ csio_mb_debug_cmd_handler(struct csio_hw *hw) | |||
1153 | { | 1155 | { |
1154 | int i; | 1156 | int i; |
1155 | __be64 cmd[CSIO_MB_MAX_REGS]; | 1157 | __be64 cmd[CSIO_MB_MAX_REGS]; |
1156 | uint32_t ctl_reg = PF_REG(hw->pfn, CIM_PF_MAILBOX_CTRL); | 1158 | uint32_t ctl_reg = PF_REG(hw->pfn, CIM_PF_MAILBOX_CTRL_A); |
1157 | uint32_t data_reg = PF_REG(hw->pfn, CIM_PF_MAILBOX_DATA); | 1159 | uint32_t data_reg = PF_REG(hw->pfn, CIM_PF_MAILBOX_DATA_A); |
1158 | int size = sizeof(struct fw_debug_cmd); | 1160 | int size = sizeof(struct fw_debug_cmd); |
1159 | 1161 | ||
1160 | /* Copy mailbox data */ | 1162 | /* Copy mailbox data */ |
@@ -1164,8 +1166,8 @@ csio_mb_debug_cmd_handler(struct csio_hw *hw) | |||
1164 | csio_mb_dump_fw_dbg(hw, cmd); | 1166 | csio_mb_dump_fw_dbg(hw, cmd); |
1165 | 1167 | ||
1166 | /* Notify FW of mailbox by setting owner as UP */ | 1168 | /* Notify FW of mailbox by setting owner as UP */ |
1167 | csio_wr_reg32(hw, MBMSGVALID | MBINTREQ | MBOWNER(CSIO_MBOWNER_FW), | 1169 | csio_wr_reg32(hw, MBMSGVALID_F | MBINTREQ_F | |
1168 | ctl_reg); | 1170 | MBOWNER_V(CSIO_MBOWNER_FW), ctl_reg); |
1169 | 1171 | ||
1170 | csio_rd_reg32(hw, ctl_reg); | 1172 | csio_rd_reg32(hw, ctl_reg); |
1171 | wmb(); | 1173 | wmb(); |
@@ -1187,8 +1189,8 @@ csio_mb_issue(struct csio_hw *hw, struct csio_mb *mbp) | |||
1187 | __be64 *cmd = mbp->mb; | 1189 | __be64 *cmd = mbp->mb; |
1188 | __be64 hdr; | 1190 | __be64 hdr; |
1189 | struct csio_mbm *mbm = &hw->mbm; | 1191 | struct csio_mbm *mbm = &hw->mbm; |
1190 | uint32_t ctl_reg = PF_REG(hw->pfn, CIM_PF_MAILBOX_CTRL); | 1192 | uint32_t ctl_reg = PF_REG(hw->pfn, CIM_PF_MAILBOX_CTRL_A); |
1191 | uint32_t data_reg = PF_REG(hw->pfn, CIM_PF_MAILBOX_DATA); | 1193 | uint32_t data_reg = PF_REG(hw->pfn, CIM_PF_MAILBOX_DATA_A); |
1192 | int size = mbp->mb_size; | 1194 | int size = mbp->mb_size; |
1193 | int rv = -EINVAL; | 1195 | int rv = -EINVAL; |
1194 | struct fw_cmd_hdr *fw_hdr; | 1196 | struct fw_cmd_hdr *fw_hdr; |
@@ -1224,12 +1226,12 @@ csio_mb_issue(struct csio_hw *hw, struct csio_mb *mbp) | |||
1224 | } | 1226 | } |
1225 | 1227 | ||
1226 | /* Now get ownership of mailbox */ | 1228 | /* Now get ownership of mailbox */ |
1227 | owner = MBOWNER_GET(csio_rd_reg32(hw, ctl_reg)); | 1229 | owner = MBOWNER_G(csio_rd_reg32(hw, ctl_reg)); |
1228 | 1230 | ||
1229 | if (!csio_mb_is_host_owner(owner)) { | 1231 | if (!csio_mb_is_host_owner(owner)) { |
1230 | 1232 | ||
1231 | for (i = 0; (owner == CSIO_MBOWNER_NONE) && (i < 3); i++) | 1233 | for (i = 0; (owner == CSIO_MBOWNER_NONE) && (i < 3); i++) |
1232 | owner = MBOWNER_GET(csio_rd_reg32(hw, ctl_reg)); | 1234 | owner = MBOWNER_G(csio_rd_reg32(hw, ctl_reg)); |
1233 | /* | 1235 | /* |
1234 | * Mailbox unavailable. In immediate mode, fail the command. | 1236 | * Mailbox unavailable. In immediate mode, fail the command. |
1235 | * In other modes, enqueue the request. | 1237 | * In other modes, enqueue the request. |
@@ -1271,10 +1273,10 @@ csio_mb_issue(struct csio_hw *hw, struct csio_mb *mbp) | |||
1271 | if (mbp->mb_cbfn != NULL) { | 1273 | if (mbp->mb_cbfn != NULL) { |
1272 | mbm->mcurrent = mbp; | 1274 | mbm->mcurrent = mbp; |
1273 | mod_timer(&mbm->timer, jiffies + msecs_to_jiffies(mbp->tmo)); | 1275 | mod_timer(&mbm->timer, jiffies + msecs_to_jiffies(mbp->tmo)); |
1274 | csio_wr_reg32(hw, MBMSGVALID | MBINTREQ | | 1276 | csio_wr_reg32(hw, MBMSGVALID_F | MBINTREQ_F | |
1275 | MBOWNER(CSIO_MBOWNER_FW), ctl_reg); | 1277 | MBOWNER_V(CSIO_MBOWNER_FW), ctl_reg); |
1276 | } else | 1278 | } else |
1277 | csio_wr_reg32(hw, MBMSGVALID | MBOWNER(CSIO_MBOWNER_FW), | 1279 | csio_wr_reg32(hw, MBMSGVALID_F | MBOWNER_V(CSIO_MBOWNER_FW), |
1278 | ctl_reg); | 1280 | ctl_reg); |
1279 | 1281 | ||
1280 | /* Flush posted writes */ | 1282 | /* Flush posted writes */ |
@@ -1294,9 +1296,9 @@ csio_mb_issue(struct csio_hw *hw, struct csio_mb *mbp) | |||
1294 | 1296 | ||
1295 | /* Check for response */ | 1297 | /* Check for response */ |
1296 | ctl = csio_rd_reg32(hw, ctl_reg); | 1298 | ctl = csio_rd_reg32(hw, ctl_reg); |
1297 | if (csio_mb_is_host_owner(MBOWNER_GET(ctl))) { | 1299 | if (csio_mb_is_host_owner(MBOWNER_G(ctl))) { |
1298 | 1300 | ||
1299 | if (!(ctl & MBMSGVALID)) { | 1301 | if (!(ctl & MBMSGVALID_F)) { |
1300 | csio_wr_reg32(hw, 0, ctl_reg); | 1302 | csio_wr_reg32(hw, 0, ctl_reg); |
1301 | continue; | 1303 | continue; |
1302 | } | 1304 | } |
@@ -1457,16 +1459,16 @@ csio_mb_isr_handler(struct csio_hw *hw) | |||
1457 | __be64 *cmd; | 1459 | __be64 *cmd; |
1458 | uint32_t ctl, cim_cause, pl_cause; | 1460 | uint32_t ctl, cim_cause, pl_cause; |
1459 | int i; | 1461 | int i; |
1460 | uint32_t ctl_reg = PF_REG(hw->pfn, CIM_PF_MAILBOX_CTRL); | 1462 | uint32_t ctl_reg = PF_REG(hw->pfn, CIM_PF_MAILBOX_CTRL_A); |
1461 | uint32_t data_reg = PF_REG(hw->pfn, CIM_PF_MAILBOX_DATA); | 1463 | uint32_t data_reg = PF_REG(hw->pfn, CIM_PF_MAILBOX_DATA_A); |
1462 | int size; | 1464 | int size; |
1463 | __be64 hdr; | 1465 | __be64 hdr; |
1464 | struct fw_cmd_hdr *fw_hdr; | 1466 | struct fw_cmd_hdr *fw_hdr; |
1465 | 1467 | ||
1466 | pl_cause = csio_rd_reg32(hw, MYPF_REG(PL_PF_INT_CAUSE)); | 1468 | pl_cause = csio_rd_reg32(hw, MYPF_REG(PL_PF_INT_CAUSE_A)); |
1467 | cim_cause = csio_rd_reg32(hw, MYPF_REG(CIM_PF_HOST_INT_CAUSE)); | 1469 | cim_cause = csio_rd_reg32(hw, MYPF_REG(CIM_PF_HOST_INT_CAUSE_A)); |
1468 | 1470 | ||
1469 | if (!(pl_cause & PFCIM) || !(cim_cause & MBMSGRDYINT)) { | 1471 | if (!(pl_cause & PFCIM_F) || !(cim_cause & MBMSGRDYINT_F)) { |
1470 | CSIO_INC_STATS(hw, n_mbint_unexp); | 1472 | CSIO_INC_STATS(hw, n_mbint_unexp); |
1471 | return -EINVAL; | 1473 | return -EINVAL; |
1472 | } | 1474 | } |
@@ -1477,16 +1479,16 @@ csio_mb_isr_handler(struct csio_hw *hw) | |||
1477 | * the upper level cause register. In other words, CIM-cause | 1479 | * the upper level cause register. In other words, CIM-cause |
1478 | * first followed by PL-Cause next. | 1480 | * first followed by PL-Cause next. |
1479 | */ | 1481 | */ |
1480 | csio_wr_reg32(hw, MBMSGRDYINT, MYPF_REG(CIM_PF_HOST_INT_CAUSE)); | 1482 | csio_wr_reg32(hw, MBMSGRDYINT_F, MYPF_REG(CIM_PF_HOST_INT_CAUSE_A)); |
1481 | csio_wr_reg32(hw, PFCIM, MYPF_REG(PL_PF_INT_CAUSE)); | 1483 | csio_wr_reg32(hw, PFCIM_F, MYPF_REG(PL_PF_INT_CAUSE_A)); |
1482 | 1484 | ||
1483 | ctl = csio_rd_reg32(hw, ctl_reg); | 1485 | ctl = csio_rd_reg32(hw, ctl_reg); |
1484 | 1486 | ||
1485 | if (csio_mb_is_host_owner(MBOWNER_GET(ctl))) { | 1487 | if (csio_mb_is_host_owner(MBOWNER_G(ctl))) { |
1486 | 1488 | ||
1487 | CSIO_DUMP_MB(hw, hw->pfn, data_reg); | 1489 | CSIO_DUMP_MB(hw, hw->pfn, data_reg); |
1488 | 1490 | ||
1489 | if (!(ctl & MBMSGVALID)) { | 1491 | if (!(ctl & MBMSGVALID_F)) { |
1490 | csio_warn(hw, | 1492 | csio_warn(hw, |
1491 | "Stray mailbox interrupt recvd," | 1493 | "Stray mailbox interrupt recvd," |
1492 | " mailbox data not valid\n"); | 1494 | " mailbox data not valid\n"); |