Lines Matching refs:rc

66 	int rc = -ENOMEM;
94 rc = efx_siena_mcdi_handle_assertion(efx);
95 if (rc)
101 rc = efx_mcdi_drv_attach(efx, true, &already_attached);
102 if (rc) {
125 return rc;
361 int rc;
364 rc = efx_siena_mcdi_poll_reboot(efx);
365 if (rc) {
367 mcdi->resprc = rc;
398 /* Return rc=0 like wait_event_timeout() */
508 int rc;
522 rc = -ETIMEDOUT;
526 rc = mcdi->resprc;
548 if (!timeout && rc && !async->quiet) {
553 errbuf, err_len, rc);
557 async->complete(efx, async->cookie, rc, outbuf,
660 int rc;
663 rc = efx_mcdi_poll(efx);
665 rc = efx_mcdi_await_completion(efx);
667 if (rc != 0) {
675 rc = 0;
693 if (rc != 0) {
704 rc = mcdi->resprc;
712 BUG_ON(rc > 0);
721 if (cmd == MC_CMD_REBOOT && rc == -EIO) {
723 } else if (rc == -EIO || rc == -EINTR) {
725 netif_dbg(efx, hw, efx->net_dev, "MC rebooted during command %d rc %d\n",
726 cmd, -rc);
730 } else if (proxy_handle && (rc == -EPROTO) &&
736 } else if (rc && !quiet) {
738 err_len, rc);
741 if (rc == -EIO || rc == -EINTR) {
750 return rc;
781 int rc;
784 rc = wait_event_timeout(mcdi->proxy_rx_wq,
789 if (rc <= 0) {
809 int rc;
817 rc = efx_siena_mcdi_rpc_start(efx, cmd, inbuf, inlen);
818 if (rc)
819 return rc;
821 rc = _efx_mcdi_rpc_finish(efx, cmd, inlen, outbuf, outlen,
834 rc = efx_mcdi_proxy_wait(efx, proxy_handle, quiet);
836 if (rc == 0) {
844 rc = _efx_mcdi_rpc_finish(efx, cmd, inlen,
848 netif_cond_dbg(efx, hw, efx->net_dev, rc == -EPERM, err,
849 "MC command 0x%x failed after proxy auth rc=%d\n",
850 cmd, rc);
852 if (rc == -EINTR || rc == -EIO)
858 return rc;
867 int rc;
869 rc = _efx_mcdi_rpc(efx, cmd, inbuf, inlen,
872 if ((rc == -EPROTO) && (raw_rc == MC_CMD_ERR_NO_EVB_PORT) &&
887 rc = _efx_mcdi_rpc(efx, cmd, inbuf, inlen,
892 } while ((rc == -EPROTO) &&
897 if (rc && !quiet && !(cmd == MC_CMD_REBOOT && rc == -EIO))
899 outbuf, outlen, rc);
901 return rc;
958 int rc;
960 rc = efx_mcdi_check_supported(efx, cmd, inlen);
961 if (rc)
962 return rc;
983 int rc;
985 rc = efx_mcdi_check_supported(efx, cmd, inlen);
986 if (rc)
987 return rc;
1021 rc = -ENETDOWN;
1026 return rc;
1087 size_t outlen, int rc)
1095 netif_cond_dbg(efx, hw, efx->net_dev, rc == -EPERM, err,
1096 "MC command 0x%x inlen %zu failed rc=%d (raw=%d) arg=%d\n",
1097 cmd, inlen, rc, code, err_arg);
1199 static void efx_mcdi_ev_death(struct efx_nic *efx, int rc)
1232 mcdi->resprc = rc;
1242 rc = efx_siena_mcdi_poll_reboot(efx);
1243 if (rc)
1254 if (!rc && efx->type->mcdi_reboot_detected)
1420 int rc;
1423 rc = efx_siena_mcdi_rpc(efx, MC_CMD_GET_VERSION, NULL, 0,
1425 if (rc)
1428 rc = -EIO;
1453 netif_err(efx, probe, efx->net_dev, "%s: failed rc=%d\n", __func__, rc);
1463 int rc;
1470 rc = efx_siena_mcdi_rpc_quiet(efx, MC_CMD_DRV_ATTACH, inbuf,
1477 if (rc == -EPERM) {
1482 rc = efx_siena_mcdi_rpc_quiet(efx, MC_CMD_DRV_ATTACH, inbuf,
1486 if (rc) {
1488 sizeof(inbuf), outbuf, outlen, rc);
1492 rc = -EIO;
1521 netif_err(efx, probe, efx->net_dev, "%s: failed rc=%d\n", __func__, rc);
1522 return rc;
1531 int rc;
1538 rc = efx_siena_mcdi_rpc(efx, MC_CMD_GET_BOARD_CFG, NULL, 0,
1540 if (rc)
1544 rc = -EIO;
1575 netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d len=%d\n",
1576 __func__, rc, (int)outlen);
1578 return rc;
1586 int rc;
1598 rc = efx_siena_mcdi_rpc(efx, MC_CMD_LOG_CTRL, inbuf, sizeof(inbuf),
1600 return rc;
1607 int rc;
1611 rc = efx_siena_mcdi_rpc(efx, MC_CMD_NVRAM_TYPES, NULL, 0,
1613 if (rc)
1616 rc = -EIO;
1624 netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n",
1625 __func__, rc);
1626 return rc;
1636 int rc;
1640 rc = efx_siena_mcdi_rpc(efx, MC_CMD_NVRAM_INFO, inbuf, sizeof(inbuf),
1642 if (rc)
1645 rc = -EIO;
1656 netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc);
1657 return rc;
1664 int rc;
1668 rc = efx_siena_mcdi_rpc(efx, MC_CMD_NVRAM_TEST, inbuf, sizeof(inbuf),
1670 if (rc)
1671 return rc;
1686 int rc;
1688 rc = efx_siena_mcdi_nvram_types(efx, &nvram_types);
1689 if (rc)
1695 rc = efx_mcdi_nvram_test(efx, type);
1696 if (rc)
1709 netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc);
1710 return rc;
1724 int rc;
1734 rc = efx_siena_mcdi_rpc_quiet(efx, MC_CMD_GET_ASSERTS,
1737 if (rc == -EPERM)
1739 } while ((rc == -EINTR || rc == -EIO) && retry-- > 0);
1741 if (rc) {
1744 outlen, rc);
1745 return rc;
1782 int rc;
1793 rc = efx_siena_mcdi_rpc_quiet(efx, MC_CMD_REBOOT, inbuf,
1795 if (rc == -EIO)
1796 rc = 0;
1797 if (rc)
1799 MC_CMD_REBOOT_IN_LEN, NULL, 0, rc);
1800 return rc;
1805 int rc;
1807 rc = efx_mcdi_read_assertion(efx);
1808 if (rc <= 0)
1809 return rc;
1833 int rc;
1838 rc = efx_siena_mcdi_rpc(efx, MC_CMD_ENTITY_RESET, inbuf, sizeof(inbuf),
1840 return rc;
1846 int rc;
1850 rc = efx_siena_mcdi_rpc(efx, MC_CMD_REBOOT, inbuf, sizeof(inbuf),
1853 if (rc == -EIO)
1855 if (rc == 0)
1856 rc = -EIO;
1857 return rc;
1867 int rc;
1871 rc = pci_reset_function(efx->pci_dev);
1872 if (rc)
1873 return rc;
1883 rc = efx_siena_mcdi_handle_assertion(efx);
1884 if (rc)
1885 return rc;
1901 int rc;
1908 rc = efx_siena_mcdi_rpc(efx, MC_CMD_WOL_FILTER_SET, inbuf,
1910 if (rc)
1914 rc = -EIO;
1924 netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc);
1925 return rc;
1941 int rc;
1943 rc = efx_siena_mcdi_rpc(efx, MC_CMD_WOL_FILTER_GET, NULL, 0,
1945 if (rc)
1949 rc = -EIO;
1959 netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc);
1960 return rc;
1967 int rc;
1971 rc = efx_siena_mcdi_rpc(efx, MC_CMD_WOL_FILTER_REMOVE, inbuf,
1973 return rc;
1982 int rc, count;
2001 rc = efx_siena_mcdi_rpc(efx, MC_CMD_FLUSH_RX_QUEUES, inbuf,
2004 WARN_ON(rc < 0);
2006 return rc;
2011 int rc;
2013 rc = efx_siena_mcdi_rpc(efx, MC_CMD_WOL_FILTER_RESET, NULL, 0,
2015 return rc;
2025 int rc;
2034 rc = efx_siena_mcdi_rpc(efx, MC_CMD_NVRAM_UPDATE_START, inbuf,
2037 return rc;
2047 int rc;
2055 rc = efx_siena_mcdi_rpc(efx, MC_CMD_NVRAM_READ, inbuf, sizeof(inbuf),
2057 if (rc)
2058 return rc;
2069 int rc;
2078 rc = efx_siena_mcdi_rpc(efx, MC_CMD_NVRAM_WRITE, inbuf,
2081 return rc;
2088 int rc;
2096 rc = efx_siena_mcdi_rpc(efx, MC_CMD_NVRAM_ERASE, inbuf, sizeof(inbuf),
2098 return rc;
2106 int rc, rc2;
2114 rc = efx_siena_mcdi_rpc(efx, MC_CMD_NVRAM_UPDATE_FINISH, inbuf,
2116 if (!rc && outlen >= MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN) {
2130 rc = -EIO;
2134 rc = -EINVAL;
2139 rc = -EPERM;
2144 rc = -EIO;
2148 return rc;
2159 int rc = 0;
2163 rc = efx_mcdi_nvram_read(efx, part->nvram_type, offset,
2165 if (rc)
2172 return rc;
2182 int rc = 0;
2185 rc = efx_mcdi_nvram_update_start(efx, part->nvram_type);
2186 if (rc)
2195 rc = efx_mcdi_nvram_erase(efx, part->nvram_type, offset,
2197 if (rc)
2202 return rc;
2213 int rc = 0;
2216 rc = efx_mcdi_nvram_update_start(efx, part->nvram_type);
2217 if (rc)
2224 rc = efx_mcdi_nvram_write(efx, part->nvram_type, offset,
2226 if (rc)
2233 return rc;
2240 int rc = 0;
2244 rc = efx_mcdi_nvram_update_finish(efx, part->nvram_type);
2247 return rc;