Deleted Added
full compact
efx_mcdi.c (292051) efx_mcdi.c (292055)
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>
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 $");
32__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/efx_mcdi.c 292055 2015-12-10 07:42:56Z 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 */
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 */
53 siena_mcdi_feature_supported, /* emco_feature_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 */
54 siena_mcdi_read_response, /* emco_read_response */
55};
56
57#endif /* EFSYS_OPT_SIENA */
58
59#if EFSYS_OPT_HUNTINGTON
60
61static efx_mcdi_ops_t __efx_mcdi_hunt_ops = {
62 hunt_mcdi_init, /* emco_init */
63 hunt_mcdi_request_copyin, /* emco_request_copyin */
64 hunt_mcdi_request_poll, /* emco_request_poll */
65 hunt_mcdi_request_copyout, /* emco_request_copyout */
66 hunt_mcdi_poll_reboot, /* emco_poll_reboot */
67 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 */
68 hunt_mcdi_feature_supported, /* emco_feature_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
69 hunt_mcdi_read_response, /* emco_read_response */
70};
71
72#endif /* EFSYS_OPT_HUNTINGTON */
73
74
75
76 __checkReturn efx_rc_t

--- 1223 unchanged lines hidden (view full) ---

1300fail2:
1301 EFSYS_PROBE(fail2);
1302fail1:
1303 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1304
1305 return (rc);
1306}
1307
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
1308 __checkReturn efx_rc_t
1309efx_mcdi_firmware_update_supported(
1310 __in efx_nic_t *enp,
1311 __out boolean_t *supportedp)
1312{
1313 efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
1314 efx_rc_t rc;
1315
1328 if (emcop != NULL && emcop->emco_fw_update_supported != NULL) {
1329 if ((rc = emcop->emco_fw_update_supported(enp, supportedp))
1330 != 0)
1316 if (emcop != NULL) {
1317 if ((rc = emcop->emco_feature_supported(enp,
1318 EFX_MCDI_FEATURE_FW_UPDATE, supportedp)) != 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
1319 goto fail1;
1320 } else {
1321 /* Earlier devices always supported updates */
1322 *supportedp = B_TRUE;
1323 }
1324
1325 return (0);
1326

--- 6 unchanged lines hidden (view full) ---

1333 __checkReturn efx_rc_t
1334efx_mcdi_macaddr_change_supported(
1335 __in efx_nic_t *enp,
1336 __out boolean_t *supportedp)
1337{
1338 efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
1339 efx_rc_t rc;
1340
1353 if (emcop != NULL && emcop->emco_macaddr_change_supported != NULL) {
1354 if ((rc = emcop->emco_macaddr_change_supported(enp, supportedp))
1355 != 0)
1341 if (emcop != NULL) {
1342 if ((rc = emcop->emco_feature_supported(enp,
1343 EFX_MCDI_FEATURE_MACADDR_CHANGE, supportedp)) != 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
1344 goto fail1;
1345 } else {
1346 /* Earlier devices always supported MAC changes */
1347 *supportedp = B_TRUE;
1348 }
1349
1350 return (0);
1351

--- 6 unchanged lines hidden (view full) ---

1358 __checkReturn efx_rc_t
1359efx_mcdi_link_control_supported(
1360 __in efx_nic_t *enp,
1361 __out boolean_t *supportedp)
1362{
1363 efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
1364 efx_rc_t rc;
1365
1378 if (emcop != NULL && emcop->emco_link_control_supported != NULL) {
1379 if ((rc = emcop->emco_link_control_supported(enp, supportedp))
1380 != 0)
1366 if (emcop != NULL) {
1367 if ((rc = emcop->emco_feature_supported(enp,
1368 EFX_MCDI_FEATURE_LINK_CONTROL, supportedp)) != 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
1369 goto fail1;
1370 } else {
1371 /* Earlier devices always supported link control */
1372 *supportedp = B_TRUE;
1373 }
1374
1375 return (0);
1376

--- 6 unchanged lines hidden (view full) ---

1383 __checkReturn efx_rc_t
1384efx_mcdi_mac_spoofing_supported(
1385 __in efx_nic_t *enp,
1386 __out boolean_t *supportedp)
1387{
1388 efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
1389 efx_rc_t rc;
1390
1403 if (emcop != NULL && emcop->emco_mac_spoofing_supported != NULL) {
1404 if ((rc = emcop->emco_mac_spoofing_supported(enp, supportedp))
1405 != 0)
1391 if (emcop != NULL) {
1392 if ((rc = emcop->emco_feature_supported(enp,
1393 EFX_MCDI_FEATURE_MAC_SPOOFING, supportedp)) != 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 ---
1394 goto fail1;
1395 } else {
1396 /* Earlier devices always supported MAC spoofing */
1397 *supportedp = B_TRUE;
1398 }
1399
1400 return (0);
1401

--- 494 unchanged lines hidden ---