1/*-
2 * Copyright (c) 2008-2015 Solarflare Communications Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
--- 15 unchanged lines hidden (view full) ---
24 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * The views and conclusions contained in the software and documentation are
27 * those of the authors and should not be interpreted as representing official
28 * policies, either expressed or implied, of the FreeBSD Project.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/efx_mcdi.c 292051 2015-12-10 07:16:21Z arybchik $");
33
34#include "efsys.h"
35#include "efx.h"
36#include "efx_types.h"
37#include "efx_regs.h"
38#include "efx_regs_mcdi.h"
39#include "efx_impl.h"
40
--- 4 unchanged lines hidden (view full) ---
45
46static efx_mcdi_ops_t __efx_mcdi_siena_ops = {
47 siena_mcdi_init, /* emco_init */
48 siena_mcdi_request_copyin, /* emco_request_copyin */
49 siena_mcdi_request_poll, /* emco_request_poll */
50 siena_mcdi_request_copyout, /* emco_request_copyout */
51 siena_mcdi_poll_reboot, /* emco_poll_reboot */
52 siena_mcdi_fini, /* emco_fini */
53 siena_mcdi_fw_update_supported, /* emco_fw_update_supported */
54 siena_mcdi_macaddr_change_supported,
55 /* emco_macaddr_change_supported */
56 siena_mcdi_link_control_supported,
57 /* emco_link_control_supported */
58 NULL, /* emco_mac_spoofing_supported */
59 siena_mcdi_read_response, /* emco_read_response */
60};
61
62#endif /* EFSYS_OPT_SIENA */
63
64#if EFSYS_OPT_HUNTINGTON
65
66static efx_mcdi_ops_t __efx_mcdi_hunt_ops = {
67 hunt_mcdi_init, /* emco_init */
68 hunt_mcdi_request_copyin, /* emco_request_copyin */
69 hunt_mcdi_request_poll, /* emco_request_poll */
70 hunt_mcdi_request_copyout, /* emco_request_copyout */
71 hunt_mcdi_poll_reboot, /* emco_poll_reboot */
72 hunt_mcdi_fini, /* emco_fini */
73 hunt_mcdi_fw_update_supported, /* emco_fw_update_supported */
74 hunt_mcdi_macaddr_change_supported,
75 /* emco_macaddr_change_supported */
76 hunt_mcdi_link_control_supported,
77 /* emco_link_control_supported */
78 hunt_mcdi_mac_spoofing_supported,
79 /* emco_mac_spoofing_supported */
80 hunt_mcdi_read_response, /* emco_read_response */
81};
82
83#endif /* EFSYS_OPT_HUNTINGTON */
84
85
86
87 __checkReturn efx_rc_t
--- 1223 unchanged lines hidden (view full) ---
1311fail2:
1312 EFSYS_PROBE(fail2);
1313fail1:
1314 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1315
1316 return (rc);
1317}
1318
1319
1320 __checkReturn efx_rc_t
1321efx_mcdi_firmware_update_supported(
1322 __in efx_nic_t *enp,
1323 __out boolean_t *supportedp)
1324{
1325 efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
1326 efx_rc_t rc;
1327
1328 if (emcop != NULL && emcop->emco_fw_update_supported != NULL) {
1329 if ((rc = emcop->emco_fw_update_supported(enp, supportedp))
1330 != 0)
1331 goto fail1;
1332 } else {
1333 /* Earlier devices always supported updates */
1334 *supportedp = B_TRUE;
1335 }
1336
1337 return (0);
1338
--- 6 unchanged lines hidden (view full) ---
1345 __checkReturn efx_rc_t
1346efx_mcdi_macaddr_change_supported(
1347 __in efx_nic_t *enp,
1348 __out boolean_t *supportedp)
1349{
1350 efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
1351 efx_rc_t rc;
1352
1353 if (emcop != NULL && emcop->emco_macaddr_change_supported != NULL) {
1354 if ((rc = emcop->emco_macaddr_change_supported(enp, supportedp))
1355 != 0)
1356 goto fail1;
1357 } else {
1358 /* Earlier devices always supported MAC changes */
1359 *supportedp = B_TRUE;
1360 }
1361
1362 return (0);
1363
--- 6 unchanged lines hidden (view full) ---
1370 __checkReturn efx_rc_t
1371efx_mcdi_link_control_supported(
1372 __in efx_nic_t *enp,
1373 __out boolean_t *supportedp)
1374{
1375 efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
1376 efx_rc_t rc;
1377
1378 if (emcop != NULL && emcop->emco_link_control_supported != NULL) {
1379 if ((rc = emcop->emco_link_control_supported(enp, supportedp))
1380 != 0)
1381 goto fail1;
1382 } else {
1383 /* Earlier devices always supported link control */
1384 *supportedp = B_TRUE;
1385 }
1386
1387 return (0);
1388
--- 6 unchanged lines hidden (view full) ---
1395 __checkReturn efx_rc_t
1396efx_mcdi_mac_spoofing_supported(
1397 __in efx_nic_t *enp,
1398 __out boolean_t *supportedp)
1399{
1400 efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
1401 efx_rc_t rc;
1402
1403 if (emcop != NULL && emcop->emco_mac_spoofing_supported != NULL) {
1404 if ((rc = emcop->emco_mac_spoofing_supported(enp, supportedp))
1405 != 0)
1406 goto fail1;
1407 } else {
1408 /* Earlier devices always supported MAC spoofing */
1409 *supportedp = B_TRUE;
1410 }
1411
1412 return (0);
1413
--- 494 unchanged lines hidden ---
2 * Copyright (c) 2008-2015 Solarflare Communications Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,
--- 15 unchanged lines hidden (view full) ---
24 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * The views and conclusions contained in the software and documentation are
27 * those of the authors and should not be interpreted as representing official
28 * policies, either expressed or implied, of the FreeBSD Project.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/efx_mcdi.c 292051 2015-12-10 07:16:21Z arybchik $");
33
34#include "efsys.h"
35#include "efx.h"
36#include "efx_types.h"
37#include "efx_regs.h"
38#include "efx_regs_mcdi.h"
39#include "efx_impl.h"
40
--- 4 unchanged lines hidden (view full) ---
45
46static efx_mcdi_ops_t __efx_mcdi_siena_ops = {
47 siena_mcdi_init, /* emco_init */
48 siena_mcdi_request_copyin, /* emco_request_copyin */
49 siena_mcdi_request_poll, /* emco_request_poll */
50 siena_mcdi_request_copyout, /* emco_request_copyout */
51 siena_mcdi_poll_reboot, /* emco_poll_reboot */
52 siena_mcdi_fini, /* emco_fini */
53 siena_mcdi_fw_update_supported, /* emco_fw_update_supported */
54 siena_mcdi_macaddr_change_supported,
55 /* emco_macaddr_change_supported */
56 siena_mcdi_link_control_supported,
57 /* emco_link_control_supported */
58 NULL, /* emco_mac_spoofing_supported */
59 siena_mcdi_read_response, /* emco_read_response */
60};
61
62#endif /* EFSYS_OPT_SIENA */
63
64#if EFSYS_OPT_HUNTINGTON
65
66static efx_mcdi_ops_t __efx_mcdi_hunt_ops = {
67 hunt_mcdi_init, /* emco_init */
68 hunt_mcdi_request_copyin, /* emco_request_copyin */
69 hunt_mcdi_request_poll, /* emco_request_poll */
70 hunt_mcdi_request_copyout, /* emco_request_copyout */
71 hunt_mcdi_poll_reboot, /* emco_poll_reboot */
72 hunt_mcdi_fini, /* emco_fini */
73 hunt_mcdi_fw_update_supported, /* emco_fw_update_supported */
74 hunt_mcdi_macaddr_change_supported,
75 /* emco_macaddr_change_supported */
76 hunt_mcdi_link_control_supported,
77 /* emco_link_control_supported */
78 hunt_mcdi_mac_spoofing_supported,
79 /* emco_mac_spoofing_supported */
80 hunt_mcdi_read_response, /* emco_read_response */
81};
82
83#endif /* EFSYS_OPT_HUNTINGTON */
84
85
86
87 __checkReturn efx_rc_t
--- 1223 unchanged lines hidden (view full) ---
1311fail2:
1312 EFSYS_PROBE(fail2);
1313fail1:
1314 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1315
1316 return (rc);
1317}
1318
1319
1320 __checkReturn efx_rc_t
1321efx_mcdi_firmware_update_supported(
1322 __in efx_nic_t *enp,
1323 __out boolean_t *supportedp)
1324{
1325 efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
1326 efx_rc_t rc;
1327
1328 if (emcop != NULL && emcop->emco_fw_update_supported != NULL) {
1329 if ((rc = emcop->emco_fw_update_supported(enp, supportedp))
1330 != 0)
1331 goto fail1;
1332 } else {
1333 /* Earlier devices always supported updates */
1334 *supportedp = B_TRUE;
1335 }
1336
1337 return (0);
1338
--- 6 unchanged lines hidden (view full) ---
1345 __checkReturn efx_rc_t
1346efx_mcdi_macaddr_change_supported(
1347 __in efx_nic_t *enp,
1348 __out boolean_t *supportedp)
1349{
1350 efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
1351 efx_rc_t rc;
1352
1353 if (emcop != NULL && emcop->emco_macaddr_change_supported != NULL) {
1354 if ((rc = emcop->emco_macaddr_change_supported(enp, supportedp))
1355 != 0)
1356 goto fail1;
1357 } else {
1358 /* Earlier devices always supported MAC changes */
1359 *supportedp = B_TRUE;
1360 }
1361
1362 return (0);
1363
--- 6 unchanged lines hidden (view full) ---
1370 __checkReturn efx_rc_t
1371efx_mcdi_link_control_supported(
1372 __in efx_nic_t *enp,
1373 __out boolean_t *supportedp)
1374{
1375 efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
1376 efx_rc_t rc;
1377
1378 if (emcop != NULL && emcop->emco_link_control_supported != NULL) {
1379 if ((rc = emcop->emco_link_control_supported(enp, supportedp))
1380 != 0)
1381 goto fail1;
1382 } else {
1383 /* Earlier devices always supported link control */
1384 *supportedp = B_TRUE;
1385 }
1386
1387 return (0);
1388
--- 6 unchanged lines hidden (view full) ---
1395 __checkReturn efx_rc_t
1396efx_mcdi_mac_spoofing_supported(
1397 __in efx_nic_t *enp,
1398 __out boolean_t *supportedp)
1399{
1400 efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
1401 efx_rc_t rc;
1402
1403 if (emcop != NULL && emcop->emco_mac_spoofing_supported != NULL) {
1404 if ((rc = emcop->emco_mac_spoofing_supported(enp, supportedp))
1405 != 0)
1406 goto fail1;
1407 } else {
1408 /* Earlier devices always supported MAC spoofing */
1409 *supportedp = B_TRUE;
1410 }
1411
1412 return (0);
1413
--- 494 unchanged lines hidden ---