Lines Matching refs:rc

103 	int rc;  in efx_ef10_init_datapath_caps()  local
107 rc = efx_mcdi_rpc(efx, MC_CMD_GET_CAPABILITIES, NULL, 0, in efx_ef10_init_datapath_caps()
109 if (rc) in efx_ef10_init_datapath_caps()
110 return rc; in efx_ef10_init_datapath_caps()
140 int rc; in efx_ef10_get_sysclk_freq() local
142 rc = efx_mcdi_rpc(efx, MC_CMD_GET_CLOCK, NULL, 0, in efx_ef10_get_sysclk_freq()
144 if (rc) in efx_ef10_get_sysclk_freq()
145 return rc; in efx_ef10_get_sysclk_freq()
146 rc = MCDI_DWORD(outbuf, GET_CLOCK_OUT_SYS_FREQ); in efx_ef10_get_sysclk_freq()
147 return rc > 0 ? rc : -ERANGE; in efx_ef10_get_sysclk_freq()
154 int rc; in efx_ef10_get_mac_address() local
158 rc = efx_mcdi_rpc(efx, MC_CMD_GET_MAC_ADDRESSES, NULL, 0, in efx_ef10_get_mac_address()
160 if (rc) in efx_ef10_get_mac_address()
161 return rc; in efx_ef10_get_mac_address()
173 int i, rc; in efx_ef10_probe() local
191 rc = efx_nic_alloc_buffer(efx, &nic_data->mcdi_buf, in efx_ef10_probe()
193 if (rc) in efx_ef10_probe()
201 rc = efx_ef10_get_warm_boot_count(efx); in efx_ef10_probe()
202 if (rc >= 0) in efx_ef10_probe()
208 nic_data->warm_boot_count = rc; in efx_ef10_probe()
219 rc = efx_mcdi_init(efx); in efx_ef10_probe()
220 if (rc) in efx_ef10_probe()
224 rc = efx_mcdi_reset(efx, RESET_TYPE_ALL); in efx_ef10_probe()
225 if (rc) in efx_ef10_probe()
229 rc = efx_mcdi_log_ctrl(efx, true, false, 0); in efx_ef10_probe()
230 if (rc) in efx_ef10_probe()
233 rc = efx_ef10_init_datapath_caps(efx); in efx_ef10_probe()
234 if (rc < 0) in efx_ef10_probe()
240 rc = efx_mcdi_port_get_number(efx); in efx_ef10_probe()
241 if (rc < 0) in efx_ef10_probe()
243 efx->port_num = rc; in efx_ef10_probe()
245 rc = efx_ef10_get_mac_address(efx, efx->net_dev->perm_addr); in efx_ef10_probe()
246 if (rc) in efx_ef10_probe()
249 rc = efx_ef10_get_sysclk_freq(efx); in efx_ef10_probe()
250 if (rc < 0) in efx_ef10_probe()
252 efx->timer_quantum_ns = 1536000 / rc; /* 1536 cycles */ in efx_ef10_probe()
255 rc = efx_mcdi_set_workaround(efx, MC_CMD_WORKAROUND_BUG35388, true); in efx_ef10_probe()
256 if (rc == 0) in efx_ef10_probe()
258 else if (rc != -ENOSYS && rc != -ENOENT) in efx_ef10_probe()
264 rc = efx_mcdi_mon_probe(efx); in efx_ef10_probe()
265 if (rc) in efx_ef10_probe()
279 return rc; in efx_ef10_probe()
286 int rc = efx_mcdi_rpc_quiet(efx, MC_CMD_FREE_VIS, NULL, 0, in efx_ef10_free_vis() local
290 if (rc == -EALREADY) in efx_ef10_free_vis()
291 rc = 0; in efx_ef10_free_vis()
292 if (rc) in efx_ef10_free_vis()
294 rc); in efx_ef10_free_vis()
295 return rc; in efx_ef10_free_vis()
305 int rc; in efx_ef10_free_piobufs() local
312 rc = efx_mcdi_rpc(efx, MC_CMD_FREE_PIOBUF, inbuf, sizeof(inbuf), in efx_ef10_free_piobufs()
314 WARN_ON(rc); in efx_ef10_free_piobufs()
326 int rc = 0; in efx_ef10_alloc_piobufs() local
331 rc = efx_mcdi_rpc(efx, MC_CMD_ALLOC_PIOBUF, NULL, 0, in efx_ef10_alloc_piobufs()
333 if (rc) in efx_ef10_alloc_piobufs()
336 rc = -EIO; in efx_ef10_alloc_piobufs()
347 if (rc) in efx_ef10_alloc_piobufs()
349 return rc; in efx_ef10_alloc_piobufs()
361 int rc; in efx_ef10_link_piobufs() local
372 rc = efx_mcdi_rpc(efx, MC_CMD_LINK_PIOBUF, in efx_ef10_link_piobufs()
375 if (rc) { in efx_ef10_link_piobufs()
379 rc); in efx_ef10_link_piobufs()
407 rc = 0; in efx_ef10_link_piobufs()
415 rc = efx_mcdi_rpc(efx, MC_CMD_LINK_PIOBUF, in efx_ef10_link_piobufs()
420 if (rc) { in efx_ef10_link_piobufs()
426 tx_queue->queue, index, rc); in efx_ef10_link_piobufs()
452 return rc; in efx_ef10_link_piobufs()
476 int rc; in efx_ef10_remove() local
487 rc = efx_ef10_free_vis(efx); in efx_ef10_remove()
488 WARN_ON(rc != 0); in efx_ef10_remove()
505 int rc; in efx_ef10_alloc_vis() local
509 rc = efx_mcdi_rpc(efx, MC_CMD_ALLOC_VIS, inbuf, sizeof(inbuf), in efx_ef10_alloc_vis()
511 if (rc != 0) in efx_ef10_alloc_vis()
512 return rc; in efx_ef10_alloc_vis()
534 int rc; in efx_ef10_dimension_resources() local
552 rc = efx_ef10_alloc_piobufs(efx, n_piobufs); in efx_ef10_dimension_resources()
553 if (rc) in efx_ef10_dimension_resources()
555 "failed to allocate PIO buffers (%d)\n", rc); in efx_ef10_dimension_resources()
593 rc = efx_ef10_free_vis(efx); in efx_ef10_dimension_resources()
594 if (rc != 0) in efx_ef10_dimension_resources()
595 return rc; in efx_ef10_dimension_resources()
597 rc = efx_ef10_alloc_vis(efx, min_vis, max_vis); in efx_ef10_dimension_resources()
598 if (rc != 0) in efx_ef10_dimension_resources()
599 return rc; in efx_ef10_dimension_resources()
641 rc = efx_ef10_link_piobufs(efx); in efx_ef10_dimension_resources()
642 if (rc) in efx_ef10_dimension_resources()
657 int rc; in efx_ef10_init_nic() local
660 rc = efx_ef10_init_datapath_caps(efx); in efx_ef10_init_nic()
661 if (rc) in efx_ef10_init_nic()
662 return rc; in efx_ef10_init_nic()
668 rc = efx_ef10_alloc_vis(efx, nic_data->n_allocated_vis, in efx_ef10_init_nic()
670 if (rc) in efx_ef10_init_nic()
671 return rc; in efx_ef10_init_nic()
676 rc = efx_ef10_alloc_piobufs(efx, nic_data->n_piobufs); in efx_ef10_init_nic()
677 if (rc == 0) { in efx_ef10_init_nic()
678 rc = efx_ef10_link_piobufs(efx); in efx_ef10_init_nic()
679 if (rc) in efx_ef10_init_nic()
684 if (rc) in efx_ef10_init_nic()
686 "failed to restore PIO buffers (%d)\n", rc); in efx_ef10_init_nic()
737 int rc = efx_mcdi_reset(efx, reset_type); in efx_ef10_reset() local
746 reset_type == RESET_TYPE_MCDI_TIMEOUT) && !rc) in efx_ef10_reset()
748 return rc; in efx_ef10_reset()
1106 int rc; in efx_ef10_mcdi_poll_reboot() local
1108 rc = efx_ef10_get_warm_boot_count(efx); in efx_ef10_mcdi_poll_reboot()
1109 if (rc < 0) { in efx_ef10_mcdi_poll_reboot()
1118 if (rc == nic_data->warm_boot_count) in efx_ef10_mcdi_poll_reboot()
1121 nic_data->warm_boot_count = rc; in efx_ef10_mcdi_poll_reboot()
1243 int rc; in efx_ef10_tx_init() local
1268 rc = efx_mcdi_rpc(efx, MC_CMD_INIT_TXQ, inbuf, inlen, in efx_ef10_tx_init()
1270 if (rc) in efx_ef10_tx_init()
1305 int rc; in efx_ef10_tx_fini() local
1310 rc = efx_mcdi_rpc_quiet(efx, MC_CMD_FINI_TXQ, inbuf, sizeof(inbuf), in efx_ef10_tx_fini()
1313 if (rc && rc != -EALREADY) in efx_ef10_tx_fini()
1320 outbuf, outlen, rc); in efx_ef10_tx_fini()
1388 int rc; in efx_ef10_alloc_rss_context() local
1397 rc = efx_mcdi_rpc(efx, MC_CMD_RSS_CONTEXT_ALLOC, inbuf, sizeof(inbuf), in efx_ef10_alloc_rss_context()
1399 if (rc != 0) in efx_ef10_alloc_rss_context()
1400 return rc; in efx_ef10_alloc_rss_context()
1413 int rc; in efx_ef10_free_rss_context() local
1418 rc = efx_mcdi_rpc(efx, MC_CMD_RSS_CONTEXT_FREE, inbuf, sizeof(inbuf), in efx_ef10_free_rss_context()
1420 WARN_ON(rc != 0); in efx_ef10_free_rss_context()
1427 int i, rc; in efx_ef10_populate_rss_table() local
1439 rc = efx_mcdi_rpc(efx, MC_CMD_RSS_CONTEXT_SET_TABLE, tablebuf, in efx_ef10_populate_rss_table()
1441 if (rc != 0) in efx_ef10_populate_rss_table()
1442 return rc; in efx_ef10_populate_rss_table()
1468 int rc; in efx_ef10_rx_push_rss_config() local
1473 rc = efx_ef10_alloc_rss_context(efx, &nic_data->rx_rss_context); in efx_ef10_rx_push_rss_config()
1474 if (rc != 0) in efx_ef10_rx_push_rss_config()
1478 rc = efx_ef10_populate_rss_table(efx, nic_data->rx_rss_context); in efx_ef10_rx_push_rss_config()
1479 if (rc != 0) in efx_ef10_rx_push_rss_config()
1485 netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc); in efx_ef10_rx_push_rss_config()
1507 int rc; in efx_ef10_rx_init() local
1536 rc = efx_mcdi_rpc(efx, MC_CMD_INIT_RXQ, inbuf, inlen, in efx_ef10_rx_init()
1538 if (rc) in efx_ef10_rx_init()
1549 int rc; in efx_ef10_rx_fini() local
1554 rc = efx_mcdi_rpc_quiet(efx, MC_CMD_FINI_RXQ, inbuf, sizeof(inbuf), in efx_ef10_rx_fini()
1557 if (rc && rc != -EALREADY) in efx_ef10_rx_fini()
1564 outbuf, outlen, rc); in efx_ef10_rx_fini()
1637 int rc, efx_dword_t *outbuf, in efx_ef10_rx_defer_refill_complete() argument
1663 int rc; in efx_ef10_ev_init() local
1699 rc = efx_mcdi_rpc(efx, MC_CMD_INIT_EVQ, inbuf, inlen, in efx_ef10_ev_init()
1702 return rc; in efx_ef10_ev_init()
1711 int rc; in efx_ef10_ev_fini() local
1715 rc = efx_mcdi_rpc_quiet(efx, MC_CMD_FINI_EVQ, inbuf, sizeof(inbuf), in efx_ef10_ev_fini()
1718 if (rc && rc != -EALREADY) in efx_ef10_ev_fini()
1725 outbuf, outlen, rc); in efx_ef10_ev_fini()
2085 int rc; in efx_ef10_ev_test_generate() local
2099 rc = efx_mcdi_rpc(efx, MC_CMD_DRIVER_EVENT, inbuf, sizeof(inbuf), in efx_ef10_ev_test_generate()
2101 if (rc != 0) in efx_ef10_ev_test_generate()
2108 netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc); in efx_ef10_ev_test_generate()
2318 int rc; in efx_ef10_filter_push() local
2321 rc = efx_mcdi_rpc(efx, MC_CMD_FILTER_OP, inbuf, sizeof(inbuf), in efx_ef10_filter_push()
2323 if (rc == 0) in efx_ef10_filter_push()
2325 if (rc == -ENOSPC) in efx_ef10_filter_push()
2326 rc = -EBUSY; /* to match efx_farch_filter_insert() */ in efx_ef10_filter_push()
2327 return rc; in efx_ef10_filter_push()
2357 s32 rc; in efx_ef10_filter_insert() local
2364 rc = efx_ef10_filter_rx_match_pri(table, spec->match_flags); in efx_ef10_filter_insert()
2365 if (rc < 0) in efx_ef10_filter_insert()
2366 return rc; in efx_ef10_filter_insert()
2367 match_pri = rc; in efx_ef10_filter_insert()
2397 rc = -EPERM; in efx_ef10_filter_insert()
2405 rc = -EEXIST; in efx_ef10_filter_insert()
2428 rc = -EBUSY; in efx_ef10_filter_insert()
2457 rc = ins_index; in efx_ef10_filter_insert()
2465 rc = -ENOMEM; in efx_ef10_filter_insert()
2488 rc = efx_ef10_filter_push(efx, spec, &table->entry[ins_index].handle, in efx_ef10_filter_insert()
2493 if (rc == 0) { in efx_ef10_filter_insert()
2528 if (rc == 0) { in efx_ef10_filter_insert()
2534 rc = efx_mcdi_rpc(efx, MC_CMD_FILTER_OP, in efx_ef10_filter_insert()
2540 if (rc == 0) { in efx_ef10_filter_insert()
2553 if (rc == 0) in efx_ef10_filter_insert()
2554 rc = match_pri * HUNT_FILTER_TBL_ROWS + ins_index; in efx_ef10_filter_insert()
2560 return rc; in efx_ef10_filter_insert()
2584 int rc; in efx_ef10_filter_remove_internal() local
2605 rc = -ENOENT; in efx_ef10_filter_remove_internal()
2614 rc = 0; in efx_ef10_filter_remove_internal()
2619 rc = -ENOENT; in efx_ef10_filter_remove_internal()
2636 rc = efx_ef10_filter_push(efx, &new_spec, in efx_ef10_filter_remove_internal()
2641 if (rc == 0) in efx_ef10_filter_remove_internal()
2652 rc = efx_mcdi_rpc(efx, MC_CMD_FILTER_OP, in efx_ef10_filter_remove_internal()
2656 if (rc == 0) { in efx_ef10_filter_remove_internal()
2667 return rc; in efx_ef10_filter_remove_internal()
2685 int rc; in efx_ef10_filter_get_safe() local
2693 rc = 0; in efx_ef10_filter_get_safe()
2695 rc = -ENOENT; in efx_ef10_filter_get_safe()
2698 return rc; in efx_ef10_filter_get_safe()
2706 int rc; in efx_ef10_filter_clear_rx() local
2712 rc = efx_ef10_filter_remove_internal(efx, priority_mask, in efx_ef10_filter_clear_rx()
2714 if (rc && rc != -ENOENT) in efx_ef10_filter_clear_rx()
2715 return rc; in efx_ef10_filter_clear_rx()
2787 s32 rc; in efx_ef10_filter_rfs_insert() local
2816 rc = -EBUSY; in efx_ef10_filter_rfs_insert()
2820 rc = -EPERM; in efx_ef10_filter_rfs_insert()
2833 rc = -EBUSY; in efx_ef10_filter_rfs_insert()
2853 rc = -ENOMEM; in efx_ef10_filter_rfs_insert()
2876 return rc; in efx_ef10_filter_rfs_insert()
2881 int rc, efx_dword_t *outbuf, in efx_ef10_filter_rfs_insert_complete() argument
2896 if (rc == 0) { in efx_ef10_filter_rfs_insert_complete()
2914 int rc, efx_dword_t *outbuf,
2949 int rc, efx_dword_t *outbuf, in efx_ef10_filter_rfs_expire_complete() argument
2957 if (rc == 0) { in efx_ef10_filter_rfs_expire_complete()
3007 int rc; in efx_ef10_filter_table_probe() local
3016 rc = efx_mcdi_rpc(efx, MC_CMD_GET_PARSER_DISP_INFO, in efx_ef10_filter_table_probe()
3019 if (rc) in efx_ef10_filter_table_probe()
3031 rc = efx_ef10_filter_match_flags_from_mcdi(mcdi_flags); in efx_ef10_filter_table_probe()
3032 if (rc < 0) { in efx_ef10_filter_table_probe()
3040 rc, table->rx_match_count); in efx_ef10_filter_table_probe()
3041 table->rx_match_flags[table->rx_match_count++] = rc; in efx_ef10_filter_table_probe()
3047 rc = -ENOMEM; in efx_ef10_filter_table_probe()
3057 return rc; in efx_ef10_filter_table_probe()
3067 int rc; in efx_ef10_filter_table_restore() local
3082 rc = efx_ef10_filter_push(efx, spec, in efx_ef10_filter_table_restore()
3085 if (rc) in efx_ef10_filter_table_restore()
3089 if (rc) { in efx_ef10_filter_table_restore()
3113 int rc; in efx_ef10_filter_table_remove() local
3126 rc = efx_mcdi_rpc(efx, MC_CMD_FILTER_OP, inbuf, sizeof(inbuf), in efx_ef10_filter_table_remove()
3128 if (rc) in efx_ef10_filter_table_remove()
3149 int i, n, rc; in efx_ef10_filter_sync_rx_mode() local
3206 rc = efx_ef10_filter_insert(efx, &spec, true); in efx_ef10_filter_sync_rx_mode()
3207 if (rc < 0) { in efx_ef10_filter_sync_rx_mode()
3216 table->dev_uc_list[i].id = rc; in efx_ef10_filter_sync_rx_mode()
3224 rc = efx_ef10_filter_insert(efx, &spec, true); in efx_ef10_filter_sync_rx_mode()
3225 if (rc < 0) { in efx_ef10_filter_sync_rx_mode()
3229 table->dev_uc_list[0].id = rc; in efx_ef10_filter_sync_rx_mode()
3241 rc = efx_ef10_filter_insert(efx, &spec, true); in efx_ef10_filter_sync_rx_mode()
3242 if (rc < 0) { in efx_ef10_filter_sync_rx_mode()
3251 table->dev_mc_list[i].id = rc; in efx_ef10_filter_sync_rx_mode()
3259 rc = efx_ef10_filter_insert(efx, &spec, true); in efx_ef10_filter_sync_rx_mode()
3260 if (rc < 0) { in efx_ef10_filter_sync_rx_mode()
3264 table->dev_mc_list[0].id = rc; in efx_ef10_filter_sync_rx_mode()
3307 int rc; in efx_ef10_poll_bist() local
3312 rc = efx_mcdi_rpc(efx, MC_CMD_POLL_BIST, NULL, 0, in efx_ef10_poll_bist()
3314 if (rc != 0) in efx_ef10_poll_bist()
3315 return rc; in efx_ef10_poll_bist()
3340 int rc; in efx_ef10_run_bist() local
3344 rc = efx_ef10_start_bist(efx, bist_type); in efx_ef10_run_bist()
3345 if (rc != 0) in efx_ef10_run_bist()
3346 return rc; in efx_ef10_run_bist()
3354 int rc, rc2; in efx_ef10_test_chip() local
3358 rc = efx_mcdi_rpc(efx, MC_CMD_ENABLE_OFFLINE_BIST, in efx_ef10_test_chip()
3360 if (rc != 0) in efx_ef10_test_chip()
3366 rc = efx_mcdi_reset(efx, RESET_TYPE_WORLD); in efx_ef10_test_chip()
3369 rc2 = efx_reset_up(efx, RESET_TYPE_WORLD, rc == 0); in efx_ef10_test_chip()
3370 return rc ? rc : rc2; in efx_ef10_test_chip()
3404 int rc; in efx_ef10_mtd_probe_partition() local
3416 rc = efx_mcdi_nvram_info(efx, type, &size, &erase_size, &protected); in efx_ef10_mtd_probe_partition()
3417 if (rc) in efx_ef10_mtd_probe_partition()
3418 return rc; in efx_ef10_mtd_probe_partition()
3425 rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_METADATA, inbuf, sizeof(inbuf), in efx_ef10_mtd_probe_partition()
3427 if (rc) in efx_ef10_mtd_probe_partition()
3428 return rc; in efx_ef10_mtd_probe_partition()
3453 int rc; in efx_ef10_mtd_probe() local
3458 rc = efx_mcdi_rpc(efx, MC_CMD_NVRAM_PARTITIONS, NULL, 0, in efx_ef10_mtd_probe()
3460 if (rc) in efx_ef10_mtd_probe()
3461 return rc; in efx_ef10_mtd_probe()
3478 rc = efx_ef10_mtd_probe_partition(efx, &parts[n_parts], type); in efx_ef10_mtd_probe()
3479 if (rc == 0) in efx_ef10_mtd_probe()
3481 else if (rc != -ENODEV) in efx_ef10_mtd_probe()
3485 rc = efx_mtd_add(efx, &parts[0].common, n_parts, sizeof(*parts)); in efx_ef10_mtd_probe()
3487 if (rc) in efx_ef10_mtd_probe()
3489 return rc; in efx_ef10_mtd_probe()
3503 int rc; in efx_ef10_rx_enable_timestamping() local
3516 rc = efx_mcdi_rpc(channel->efx, MC_CMD_PTP, in efx_ef10_rx_enable_timestamping()
3519 if (rc != 0) in efx_ef10_rx_enable_timestamping()
3523 return rc; in efx_ef10_rx_enable_timestamping()
3530 int rc; in efx_ef10_rx_disable_timestamping() local
3549 rc = efx_mcdi_rpc(channel->efx, MC_CMD_PTP, in efx_ef10_rx_disable_timestamping()
3552 return rc; in efx_ef10_rx_disable_timestamping()
3566 int rc = set(channel, temp); in efx_ef10_ptp_set_ts_sync_events() local
3567 if (en && rc != 0) { in efx_ef10_ptp_set_ts_sync_events()
3569 return rc; in efx_ef10_ptp_set_ts_sync_events()
3579 int rc; in efx_ef10_ptp_set_ts_config() local
3601 rc = efx_ptp_change_mode(efx, true, 0); in efx_ef10_ptp_set_ts_config()
3602 if (!rc) in efx_ef10_ptp_set_ts_config()
3603 rc = efx_ef10_ptp_set_ts_sync_events(efx, true, false); in efx_ef10_ptp_set_ts_config()
3604 if (rc) in efx_ef10_ptp_set_ts_config()
3606 return rc; in efx_ef10_ptp_set_ts_config()