diff options
Diffstat (limited to 'drivers/scsi/bfa/bfa_fcport.c')
-rw-r--r-- | drivers/scsi/bfa/bfa_fcport.c | 59 |
1 files changed, 28 insertions, 31 deletions
diff --git a/drivers/scsi/bfa/bfa_fcport.c b/drivers/scsi/bfa/bfa_fcport.c index 992435987de..aef648b55df 100644 --- a/drivers/scsi/bfa/bfa_fcport.c +++ b/drivers/scsi/bfa/bfa_fcport.c | |||
@@ -388,32 +388,29 @@ bfa_pport_sm_linkup(struct bfa_pport_s *pport, enum bfa_pport_sm_event event) | |||
388 | bfa_pport_callback(pport, BFA_PPORT_LINKDOWN); | 388 | bfa_pport_callback(pport, BFA_PPORT_LINKDOWN); |
389 | bfa_plog_str(pport->bfa->plog, BFA_PL_MID_HAL, | 389 | bfa_plog_str(pport->bfa->plog, BFA_PL_MID_HAL, |
390 | BFA_PL_EID_PORT_ST_CHANGE, 0, "Port Linkdown"); | 390 | BFA_PL_EID_PORT_ST_CHANGE, 0, "Port Linkdown"); |
391 | if (BFA_PORT_IS_DISABLED(pport->bfa)) { | 391 | if (BFA_PORT_IS_DISABLED(pport->bfa)) |
392 | bfa_pport_aen_post(pport, BFA_PORT_AEN_OFFLINE); | 392 | bfa_pport_aen_post(pport, BFA_PORT_AEN_OFFLINE); |
393 | } else { | 393 | else |
394 | bfa_pport_aen_post(pport, BFA_PORT_AEN_DISCONNECT); | 394 | bfa_pport_aen_post(pport, BFA_PORT_AEN_DISCONNECT); |
395 | } | ||
396 | break; | 395 | break; |
397 | 396 | ||
398 | case BFA_PPORT_SM_STOP: | 397 | case BFA_PPORT_SM_STOP: |
399 | bfa_sm_set_state(pport, bfa_pport_sm_stopped); | 398 | bfa_sm_set_state(pport, bfa_pport_sm_stopped); |
400 | bfa_pport_reset_linkinfo(pport); | 399 | bfa_pport_reset_linkinfo(pport); |
401 | if (BFA_PORT_IS_DISABLED(pport->bfa)) { | 400 | if (BFA_PORT_IS_DISABLED(pport->bfa)) |
402 | bfa_pport_aen_post(pport, BFA_PORT_AEN_OFFLINE); | 401 | bfa_pport_aen_post(pport, BFA_PORT_AEN_OFFLINE); |
403 | } else { | 402 | else |
404 | bfa_pport_aen_post(pport, BFA_PORT_AEN_DISCONNECT); | 403 | bfa_pport_aen_post(pport, BFA_PORT_AEN_DISCONNECT); |
405 | } | ||
406 | break; | 404 | break; |
407 | 405 | ||
408 | case BFA_PPORT_SM_HWFAIL: | 406 | case BFA_PPORT_SM_HWFAIL: |
409 | bfa_sm_set_state(pport, bfa_pport_sm_iocdown); | 407 | bfa_sm_set_state(pport, bfa_pport_sm_iocdown); |
410 | bfa_pport_reset_linkinfo(pport); | 408 | bfa_pport_reset_linkinfo(pport); |
411 | bfa_pport_callback(pport, BFA_PPORT_LINKDOWN); | 409 | bfa_pport_callback(pport, BFA_PPORT_LINKDOWN); |
412 | if (BFA_PORT_IS_DISABLED(pport->bfa)) { | 410 | if (BFA_PORT_IS_DISABLED(pport->bfa)) |
413 | bfa_pport_aen_post(pport, BFA_PORT_AEN_OFFLINE); | 411 | bfa_pport_aen_post(pport, BFA_PORT_AEN_OFFLINE); |
414 | } else { | 412 | else |
415 | bfa_pport_aen_post(pport, BFA_PORT_AEN_DISCONNECT); | 413 | bfa_pport_aen_post(pport, BFA_PORT_AEN_DISCONNECT); |
416 | } | ||
417 | break; | 414 | break; |
418 | 415 | ||
419 | default: | 416 | default: |
@@ -999,10 +996,10 @@ bfa_pport_enable(struct bfa_s *bfa) | |||
999 | struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); | 996 | struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); |
1000 | 997 | ||
1001 | if (pport->diag_busy) | 998 | if (pport->diag_busy) |
1002 | return (BFA_STATUS_DIAG_BUSY); | 999 | return BFA_STATUS_DIAG_BUSY; |
1003 | else if (bfa_sm_cmp_state | 1000 | else if (bfa_sm_cmp_state |
1004 | (BFA_PORT_MOD(bfa), bfa_pport_sm_disabling_qwait)) | 1001 | (BFA_PORT_MOD(bfa), bfa_pport_sm_disabling_qwait)) |
1005 | return (BFA_STATUS_DEVBUSY); | 1002 | return BFA_STATUS_DEVBUSY; |
1006 | 1003 | ||
1007 | bfa_sm_send_event(BFA_PORT_MOD(bfa), BFA_PPORT_SM_ENABLE); | 1004 | bfa_sm_send_event(BFA_PORT_MOD(bfa), BFA_PPORT_SM_ENABLE); |
1008 | return BFA_STATUS_OK; | 1005 | return BFA_STATUS_OK; |
@@ -1032,7 +1029,7 @@ bfa_pport_cfg_speed(struct bfa_s *bfa, enum bfa_pport_speed speed) | |||
1032 | 1029 | ||
1033 | pport->cfg.speed = speed; | 1030 | pport->cfg.speed = speed; |
1034 | 1031 | ||
1035 | return (BFA_STATUS_OK); | 1032 | return BFA_STATUS_OK; |
1036 | } | 1033 | } |
1037 | 1034 | ||
1038 | /** | 1035 | /** |
@@ -1068,7 +1065,7 @@ bfa_pport_cfg_topology(struct bfa_s *bfa, enum bfa_pport_topology topology) | |||
1068 | } | 1065 | } |
1069 | 1066 | ||
1070 | pport->cfg.topology = topology; | 1067 | pport->cfg.topology = topology; |
1071 | return (BFA_STATUS_OK); | 1068 | return BFA_STATUS_OK; |
1072 | } | 1069 | } |
1073 | 1070 | ||
1074 | /** | 1071 | /** |
@@ -1094,7 +1091,7 @@ bfa_pport_cfg_hardalpa(struct bfa_s *bfa, u8 alpa) | |||
1094 | pport->cfg.cfg_hardalpa = BFA_TRUE; | 1091 | pport->cfg.cfg_hardalpa = BFA_TRUE; |
1095 | pport->cfg.hardalpa = alpa; | 1092 | pport->cfg.hardalpa = alpa; |
1096 | 1093 | ||
1097 | return (BFA_STATUS_OK); | 1094 | return BFA_STATUS_OK; |
1098 | } | 1095 | } |
1099 | 1096 | ||
1100 | bfa_status_t | 1097 | bfa_status_t |
@@ -1106,7 +1103,7 @@ bfa_pport_clr_hardalpa(struct bfa_s *bfa) | |||
1106 | bfa_trc(bfa, pport->cfg.hardalpa); | 1103 | bfa_trc(bfa, pport->cfg.hardalpa); |
1107 | 1104 | ||
1108 | pport->cfg.cfg_hardalpa = BFA_FALSE; | 1105 | pport->cfg.cfg_hardalpa = BFA_FALSE; |
1109 | return (BFA_STATUS_OK); | 1106 | return BFA_STATUS_OK; |
1110 | } | 1107 | } |
1111 | 1108 | ||
1112 | bfa_boolean_t | 1109 | bfa_boolean_t |
@@ -1138,16 +1135,16 @@ bfa_pport_cfg_maxfrsize(struct bfa_s *bfa, u16 maxfrsize) | |||
1138 | * with in range | 1135 | * with in range |
1139 | */ | 1136 | */ |
1140 | if ((maxfrsize > FC_MAX_PDUSZ) || (maxfrsize < FC_MIN_PDUSZ)) | 1137 | if ((maxfrsize > FC_MAX_PDUSZ) || (maxfrsize < FC_MIN_PDUSZ)) |
1141 | return (BFA_STATUS_INVLD_DFSZ); | 1138 | return BFA_STATUS_INVLD_DFSZ; |
1142 | 1139 | ||
1143 | /* | 1140 | /* |
1144 | * power of 2, if not the max frame size of 2112 | 1141 | * power of 2, if not the max frame size of 2112 |
1145 | */ | 1142 | */ |
1146 | if ((maxfrsize != FC_MAX_PDUSZ) && (maxfrsize & (maxfrsize - 1))) | 1143 | if ((maxfrsize != FC_MAX_PDUSZ) && (maxfrsize & (maxfrsize - 1))) |
1147 | return (BFA_STATUS_INVLD_DFSZ); | 1144 | return BFA_STATUS_INVLD_DFSZ; |
1148 | 1145 | ||
1149 | pport->cfg.maxfrsize = maxfrsize; | 1146 | pport->cfg.maxfrsize = maxfrsize; |
1150 | return (BFA_STATUS_OK); | 1147 | return BFA_STATUS_OK; |
1151 | } | 1148 | } |
1152 | 1149 | ||
1153 | u16 | 1150 | u16 |
@@ -1415,7 +1412,7 @@ bfa_pport_get_stats(struct bfa_s *bfa, union bfa_pport_stats_u *stats, | |||
1415 | 1412 | ||
1416 | if (port->stats_busy) { | 1413 | if (port->stats_busy) { |
1417 | bfa_trc(bfa, port->stats_busy); | 1414 | bfa_trc(bfa, port->stats_busy); |
1418 | return (BFA_STATUS_DEVBUSY); | 1415 | return BFA_STATUS_DEVBUSY; |
1419 | } | 1416 | } |
1420 | 1417 | ||
1421 | port->stats_busy = BFA_TRUE; | 1418 | port->stats_busy = BFA_TRUE; |
@@ -1427,7 +1424,7 @@ bfa_pport_get_stats(struct bfa_s *bfa, union bfa_pport_stats_u *stats, | |||
1427 | 1424 | ||
1428 | bfa_timer_start(bfa, &port->timer, bfa_port_stats_timeout, port, | 1425 | bfa_timer_start(bfa, &port->timer, bfa_port_stats_timeout, port, |
1429 | BFA_PORT_STATS_TOV); | 1426 | BFA_PORT_STATS_TOV); |
1430 | return (BFA_STATUS_OK); | 1427 | return BFA_STATUS_OK; |
1431 | } | 1428 | } |
1432 | 1429 | ||
1433 | bfa_status_t | 1430 | bfa_status_t |
@@ -1437,7 +1434,7 @@ bfa_pport_clear_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg) | |||
1437 | 1434 | ||
1438 | if (port->stats_busy) { | 1435 | if (port->stats_busy) { |
1439 | bfa_trc(bfa, port->stats_busy); | 1436 | bfa_trc(bfa, port->stats_busy); |
1440 | return (BFA_STATUS_DEVBUSY); | 1437 | return BFA_STATUS_DEVBUSY; |
1441 | } | 1438 | } |
1442 | 1439 | ||
1443 | port->stats_busy = BFA_TRUE; | 1440 | port->stats_busy = BFA_TRUE; |
@@ -1448,7 +1445,7 @@ bfa_pport_clear_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg) | |||
1448 | 1445 | ||
1449 | bfa_timer_start(bfa, &port->timer, bfa_port_stats_clr_timeout, port, | 1446 | bfa_timer_start(bfa, &port->timer, bfa_port_stats_clr_timeout, port, |
1450 | BFA_PORT_STATS_TOV); | 1447 | BFA_PORT_STATS_TOV); |
1451 | return (BFA_STATUS_OK); | 1448 | return BFA_STATUS_OK; |
1452 | } | 1449 | } |
1453 | 1450 | ||
1454 | bfa_status_t | 1451 | bfa_status_t |
@@ -1515,7 +1512,7 @@ bfa_pport_get_qos_stats(struct bfa_s *bfa, union bfa_pport_stats_u *stats, | |||
1515 | /* | 1512 | /* |
1516 | * QoS stats is embedded in port stats | 1513 | * QoS stats is embedded in port stats |
1517 | */ | 1514 | */ |
1518 | return (bfa_pport_get_stats(bfa, stats, cbfn, cbarg)); | 1515 | return bfa_pport_get_stats(bfa, stats, cbfn, cbarg); |
1519 | } | 1516 | } |
1520 | 1517 | ||
1521 | bfa_status_t | 1518 | bfa_status_t |
@@ -1525,7 +1522,7 @@ bfa_pport_clear_qos_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg) | |||
1525 | 1522 | ||
1526 | if (port->stats_busy) { | 1523 | if (port->stats_busy) { |
1527 | bfa_trc(bfa, port->stats_busy); | 1524 | bfa_trc(bfa, port->stats_busy); |
1528 | return (BFA_STATUS_DEVBUSY); | 1525 | return BFA_STATUS_DEVBUSY; |
1529 | } | 1526 | } |
1530 | 1527 | ||
1531 | port->stats_busy = BFA_TRUE; | 1528 | port->stats_busy = BFA_TRUE; |
@@ -1536,7 +1533,7 @@ bfa_pport_clear_qos_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg) | |||
1536 | 1533 | ||
1537 | bfa_timer_start(bfa, &port->timer, bfa_port_stats_clr_timeout, port, | 1534 | bfa_timer_start(bfa, &port->timer, bfa_port_stats_clr_timeout, port, |
1538 | BFA_PORT_STATS_TOV); | 1535 | BFA_PORT_STATS_TOV); |
1539 | return (BFA_STATUS_OK); | 1536 | return BFA_STATUS_OK; |
1540 | } | 1537 | } |
1541 | 1538 | ||
1542 | /** | 1539 | /** |
@@ -1545,7 +1542,7 @@ bfa_pport_clear_qos_stats(struct bfa_s *bfa, bfa_cb_pport_t cbfn, void *cbarg) | |||
1545 | bfa_status_t | 1542 | bfa_status_t |
1546 | bfa_pport_trunk_disable(struct bfa_s *bfa) | 1543 | bfa_pport_trunk_disable(struct bfa_s *bfa) |
1547 | { | 1544 | { |
1548 | return (BFA_STATUS_OK); | 1545 | return BFA_STATUS_OK; |
1549 | } | 1546 | } |
1550 | 1547 | ||
1551 | bfa_boolean_t | 1548 | bfa_boolean_t |
@@ -1562,8 +1559,8 @@ bfa_pport_is_disabled(struct bfa_s *bfa) | |||
1562 | { | 1559 | { |
1563 | struct bfa_pport_s *port = BFA_PORT_MOD(bfa); | 1560 | struct bfa_pport_s *port = BFA_PORT_MOD(bfa); |
1564 | 1561 | ||
1565 | return (bfa_sm_to_state(hal_pport_sm_table, port->sm) == | 1562 | return bfa_sm_to_state(hal_pport_sm_table, port->sm) == |
1566 | BFA_PPORT_ST_DISABLED); | 1563 | BFA_PPORT_ST_DISABLED; |
1567 | 1564 | ||
1568 | } | 1565 | } |
1569 | 1566 | ||
@@ -1572,7 +1569,7 @@ bfa_pport_is_ratelim(struct bfa_s *bfa) | |||
1572 | { | 1569 | { |
1573 | struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); | 1570 | struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); |
1574 | 1571 | ||
1575 | return (pport->cfg.ratelimit ? BFA_TRUE : BFA_FALSE); | 1572 | return pport->cfg.ratelimit ? BFA_TRUE : BFA_FALSE; |
1576 | 1573 | ||
1577 | } | 1574 | } |
1578 | 1575 | ||
@@ -1620,7 +1617,7 @@ bfa_pport_cfg_ratelim_speed(struct bfa_s *bfa, enum bfa_pport_speed speed) | |||
1620 | 1617 | ||
1621 | pport->cfg.trl_def_speed = speed; | 1618 | pport->cfg.trl_def_speed = speed; |
1622 | 1619 | ||
1623 | return (BFA_STATUS_OK); | 1620 | return BFA_STATUS_OK; |
1624 | } | 1621 | } |
1625 | 1622 | ||
1626 | /** | 1623 | /** |
@@ -1632,7 +1629,7 @@ bfa_pport_get_ratelim_speed(struct bfa_s *bfa) | |||
1632 | struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); | 1629 | struct bfa_pport_s *pport = BFA_PORT_MOD(bfa); |
1633 | 1630 | ||
1634 | bfa_trc(bfa, pport->cfg.trl_def_speed); | 1631 | bfa_trc(bfa, pport->cfg.trl_def_speed); |
1635 | return (pport->cfg.trl_def_speed); | 1632 | return pport->cfg.trl_def_speed; |
1636 | 1633 | ||
1637 | } | 1634 | } |
1638 | 1635 | ||