Lines Matching refs:rc

64 	int rc = -ENOMEM;
92 rc = efx_mcdi_handle_assertion(efx);
93 if (rc)
99 rc = efx_mcdi_drv_attach(efx, true, &already_attached);
100 if (rc) {
121 return rc;
357 int rc;
360 rc = efx_mcdi_poll_reboot(efx);
361 if (rc) {
363 mcdi->resprc = rc;
394 /* Return rc=0 like wait_event_timeout() */
504 int rc;
518 rc = -ETIMEDOUT;
522 rc = mcdi->resprc;
544 if (!timeout && rc && !async->quiet) {
549 err_len, rc);
553 async->complete(efx, async->cookie, rc, outbuf,
656 int rc;
659 rc = efx_mcdi_poll(efx);
661 rc = efx_mcdi_await_completion(efx);
663 if (rc != 0) {
671 rc = 0;
689 if (rc != 0) {
700 rc = mcdi->resprc;
708 BUG_ON(rc > 0);
717 if (cmd == MC_CMD_REBOOT && rc == -EIO) {
719 } else if (rc == -EIO || rc == -EINTR) {
721 netif_dbg(efx, hw, efx->net_dev, "MC rebooted during command %d rc %d\n",
722 cmd, -rc);
726 } else if (proxy_handle && (rc == -EPROTO) &&
732 } else if (rc && !quiet) {
734 rc);
737 if (rc == -EIO || rc == -EINTR) {
746 return rc;
777 int rc;
780 rc = wait_event_timeout(mcdi->proxy_rx_wq,
785 if (rc <= 0) {
805 int rc;
813 rc = efx_mcdi_rpc_start(efx, cmd, inbuf, inlen);
814 if (rc)
815 return rc;
817 rc = _efx_mcdi_rpc_finish(efx, cmd, inlen, outbuf, outlen,
830 rc = efx_mcdi_proxy_wait(efx, proxy_handle, quiet);
832 if (rc == 0) {
840 rc = _efx_mcdi_rpc_finish(efx, cmd, inlen,
844 netif_cond_dbg(efx, hw, efx->net_dev, rc == -EPERM, err,
845 "MC command 0x%x failed after proxy auth rc=%d\n",
846 cmd, rc);
848 if (rc == -EINTR || rc == -EIO)
854 return rc;
863 int rc;
865 rc = _efx_mcdi_rpc(efx, cmd, inbuf, inlen,
868 if ((rc == -EPROTO) && (raw_rc == MC_CMD_ERR_NO_EVB_PORT) &&
883 rc = _efx_mcdi_rpc(efx, cmd, inbuf, inlen,
888 } while ((rc == -EPROTO) &&
893 if (rc && !quiet && !(cmd == MC_CMD_REBOOT && rc == -EIO))
895 outbuf, outlen, rc);
897 return rc;
954 int rc;
956 rc = efx_mcdi_check_supported(efx, cmd, inlen);
957 if (rc)
958 return rc;
979 int rc;
981 rc = efx_mcdi_check_supported(efx, cmd, inlen);
982 if (rc)
983 return rc;
1017 rc = -ENETDOWN;
1022 return rc;
1081 size_t outlen, int rc)
1089 netif_cond_dbg(efx, hw, efx->net_dev, rc == -EPERM, err,
1090 "MC command 0x%x inlen %zu failed rc=%d (raw=%d) arg=%d\n",
1091 cmd, inlen, rc, code, err_arg);
1193 static void efx_mcdi_ev_death(struct efx_nic *efx, int rc)
1226 mcdi->resprc = rc;
1236 rc = efx_mcdi_poll_reboot(efx);
1237 if (rc)
1248 if (!rc && efx->type->mcdi_reboot_detected)
1408 int rc;
1411 rc = efx_mcdi_rpc(efx, MC_CMD_GET_VERSION, NULL, 0,
1413 if (rc)
1416 rc = -EIO;
1441 pci_err(efx->pci_dev, "%s: failed rc=%d\n", __func__, rc);
1451 int rc;
1458 rc = efx_mcdi_rpc_quiet(efx, MC_CMD_DRV_ATTACH, inbuf, sizeof(inbuf),
1464 if (rc == -EPERM) {
1470 rc = efx_mcdi_rpc_quiet(efx, MC_CMD_DRV_ATTACH, inbuf,
1474 if (rc) {
1476 outbuf, outlen, rc);
1480 rc = -EIO;
1509 pci_err(efx->pci_dev, "%s: failed rc=%d\n", __func__, rc);
1510 return rc;
1519 int rc;
1526 rc = efx_mcdi_rpc(efx, MC_CMD_GET_BOARD_CFG, NULL, 0,
1528 if (rc)
1532 rc = -EIO;
1563 netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d len=%d\n",
1564 __func__, rc, (int)outlen);
1566 return rc;
1573 int rc;
1585 rc = efx_mcdi_rpc(efx, MC_CMD_LOG_CTRL, inbuf, sizeof(inbuf),
1587 return rc;
1594 int rc;
1598 rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_TYPES, NULL, 0,
1600 if (rc)
1603 rc = -EIO;
1611 netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n",
1612 __func__, rc);
1613 return rc;
1623 int rc;
1630 rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_PARTITIONS, NULL, 0,
1632 if (rc)
1642 return rc;
1652 int rc;
1656 rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_INFO, inbuf, sizeof(inbuf),
1658 if (rc)
1661 rc = -EIO;
1672 netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc);
1673 return rc;
1680 int rc;
1684 rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_TEST, inbuf, sizeof(inbuf),
1686 if (rc)
1687 return rc;
1704 int rc, i;
1709 rc = efx_new_mcdi_nvram_types(efx, &number, nvram_types);
1710 if (rc)
1714 rc = -EAGAIN;
1721 rc = efx_mcdi_nvram_test(efx, nvram_types[i]);
1722 if (rc)
1728 return rc;
1735 int rc;
1737 rc = efx_mcdi_nvram_types(efx, &nvram_types);
1738 if (rc)
1744 rc = efx_mcdi_nvram_test(efx, type);
1745 if (rc)
1758 netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc);
1759 return rc;
1773 int rc;
1783 rc = efx_mcdi_rpc_quiet(efx, MC_CMD_GET_ASSERTS,
1786 if (rc == -EPERM)
1788 } while ((rc == -EINTR || rc == -EIO) && retry-- > 0);
1790 if (rc) {
1793 outlen, rc);
1794 return rc;
1831 int rc;
1842 rc = efx_mcdi_rpc_quiet(efx, MC_CMD_REBOOT, inbuf, MC_CMD_REBOOT_IN_LEN,
1844 if (rc == -EIO)
1845 rc = 0;
1846 if (rc)
1848 NULL, 0, rc);
1849 return rc;
1854 int rc;
1856 rc = efx_mcdi_read_assertion(efx);
1857 if (rc <= 0)
1858 return rc;
1881 int rc;
1886 rc = efx_mcdi_rpc(efx, MC_CMD_ENTITY_RESET, inbuf, sizeof(inbuf),
1888 return rc;
1894 int rc;
1898 rc = efx_mcdi_rpc(efx, MC_CMD_REBOOT, inbuf, sizeof(inbuf),
1901 if (rc == -EIO)
1903 if (rc == 0)
1904 rc = -EIO;
1905 return rc;
1915 int rc;
1919 rc = pci_reset_function(efx->pci_dev);
1920 if (rc)
1921 return rc;
1931 rc = efx_mcdi_handle_assertion(efx);
1932 if (rc)
1933 return rc;
1949 int rc;
1956 rc = efx_mcdi_rpc(efx, MC_CMD_WOL_FILTER_SET, inbuf, sizeof(inbuf),
1958 if (rc)
1962 rc = -EIO;
1972 netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc);
1973 return rc;
1989 int rc;
1991 rc = efx_mcdi_rpc(efx, MC_CMD_WOL_FILTER_GET, NULL, 0,
1993 if (rc)
1997 rc = -EIO;
2007 netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc);
2008 return rc;
2015 int rc;
2019 rc = efx_mcdi_rpc(efx, MC_CMD_WOL_FILTER_REMOVE, inbuf, sizeof(inbuf),
2021 return rc;
2030 int rc, count;
2049 rc = efx_mcdi_rpc(efx, MC_CMD_FLUSH_RX_QUEUES, inbuf,
2051 WARN_ON(rc < 0);
2053 return rc;
2058 int rc;
2060 rc = efx_mcdi_rpc(efx, MC_CMD_WOL_FILTER_RESET, NULL, 0, NULL, 0, NULL);
2061 return rc;
2070 int rc;
2075 rc = efx_mcdi_rpc(efx, MC_CMD_WORKAROUND, inbuf, sizeof(inbuf),
2077 if (rc)
2078 return rc;
2096 int rc;
2098 rc = efx_mcdi_rpc(efx, MC_CMD_GET_WORKAROUNDS, NULL, 0,
2100 if (rc)
2104 rc = -EIO;
2120 netif_cond_dbg(efx, hw, efx->net_dev, rc == -ENOSYS, err,
2121 "%s: failed rc=%d\n", __func__, rc);
2122 return rc;
2136 int rc;
2142 rc = efx_mcdi_rpc_quiet(efx, MC_CMD_GET_FUNCTION_INFO, NULL, 0,
2145 if (rc != 0)
2146 return rc;
2157 rc = efx_mcdi_rpc_quiet(efx, MC_CMD_PRIVILEGE_MASK,
2161 if (rc != 0)
2162 return rc;
2179 int rc;
2187 rc = efx_mcdi_rpc_quiet(efx, MC_CMD_NVRAM_METADATA, inbuf,
2191 if (rc)
2194 rc = -EIO;
2204 rc = -E2BIG;
2239 return rc;
2249 int rc;
2258 rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_UPDATE_START, inbuf, sizeof(inbuf),
2261 return rc;
2271 int rc;
2279 rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_READ, inbuf, sizeof(inbuf),
2281 if (rc)
2282 return rc;
2293 int rc;
2302 rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_WRITE, inbuf,
2305 return rc;
2312 int rc;
2320 rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_ERASE, inbuf, sizeof(inbuf),
2322 return rc;
2330 int rc, rc2;
2338 rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_UPDATE_FINISH, inbuf, sizeof(inbuf),
2340 if (!rc && outlen >= MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN) {
2354 rc = -EIO;
2358 rc = -EINVAL;
2363 rc = -EPERM;
2368 rc = -EIO;
2372 return rc;
2383 int rc = 0;
2387 rc = efx_mcdi_nvram_read(efx, part->nvram_type, offset,
2389 if (rc)
2396 return rc;
2406 int rc = 0;
2409 rc = efx_mcdi_nvram_update_start(efx, part->nvram_type);
2410 if (rc)
2419 rc = efx_mcdi_nvram_erase(efx, part->nvram_type, offset,
2421 if (rc)
2426 return rc;
2437 int rc = 0;
2440 rc = efx_mcdi_nvram_update_start(efx, part->nvram_type);
2441 if (rc)
2448 rc = efx_mcdi_nvram_write(efx, part->nvram_type, offset,
2450 if (rc)
2457 return rc;
2464 int rc = 0;
2468 rc = efx_mcdi_nvram_update_finish(efx, part->nvram_type);
2471 return rc;