Deleted Added
full compact
efx_mcdi.c (291436) efx_mcdi.c (291588)
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 291436 2015-11-29 05:42:49Z arybchik $");
32__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/efx_mcdi.c 291588 2015-12-01 15:38:39Z 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

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

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 */
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

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

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 */
56};
57
58#endif /* EFSYS_OPT_SIENA */
59
60#if EFSYS_OPT_HUNTINGTON
61
62static efx_mcdi_ops_t __efx_mcdi_hunt_ops = {
63 hunt_mcdi_init, /* emco_init */
64 hunt_mcdi_request_copyin, /* emco_request_copyin */
65 hunt_mcdi_request_poll, /* emco_request_poll */
66 hunt_mcdi_request_copyout, /* emco_request_copyout */
67 hunt_mcdi_poll_reboot, /* emco_poll_reboot */
68 hunt_mcdi_fini, /* emco_fini */
69 hunt_mcdi_fw_update_supported, /* emco_fw_update_supported */
70 hunt_mcdi_macaddr_change_supported,
71 /* emco_macaddr_change_supported */
58};
59
60#endif /* EFSYS_OPT_SIENA */
61
62#if EFSYS_OPT_HUNTINGTON
63
64static efx_mcdi_ops_t __efx_mcdi_hunt_ops = {
65 hunt_mcdi_init, /* emco_init */
66 hunt_mcdi_request_copyin, /* emco_request_copyin */
67 hunt_mcdi_request_poll, /* emco_request_poll */
68 hunt_mcdi_request_copyout, /* emco_request_copyout */
69 hunt_mcdi_poll_reboot, /* emco_poll_reboot */
70 hunt_mcdi_fini, /* emco_fini */
71 hunt_mcdi_fw_update_supported, /* emco_fw_update_supported */
72 hunt_mcdi_macaddr_change_supported,
73 /* emco_macaddr_change_supported */
74 hunt_mcdi_link_control_supported,
75 /* emco_link_control_supported */
72};
73
74#endif /* EFSYS_OPT_HUNTINGTON */
75
76
77
78 __checkReturn efx_rc_t
79efx_mcdi_init(

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

1164 return (0);
1165
1166fail1:
1167 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1168
1169 return (rc);
1170}
1171
76};
77
78#endif /* EFSYS_OPT_HUNTINGTON */
79
80
81
82 __checkReturn efx_rc_t
83efx_mcdi_init(

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

1168 return (0);
1169
1170fail1:
1171 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1172
1173 return (rc);
1174}
1175
1176 __checkReturn efx_rc_t
1177efx_mcdi_link_control_supported(
1178 __in efx_nic_t *enp,
1179 __out boolean_t *supportedp)
1180{
1181 efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
1182 efx_rc_t rc;
1183
1184 if (emcop != NULL && emcop->emco_link_control_supported != NULL) {
1185 if ((rc = emcop->emco_link_control_supported(enp, supportedp))
1186 != 0)
1187 goto fail1;
1188 } else {
1189 /* Earlier devices always supported link control */
1190 *supportedp = B_TRUE;
1191 }
1192
1193 return (0);
1194
1195fail1:
1196 EFSYS_PROBE1(fail1, efx_rc_t, rc);
1197
1198 return (rc);
1199}
1200
1172#if EFSYS_OPT_BIST
1173
1174#if EFSYS_OPT_HUNTINGTON
1175/*
1176 * Enter bist offline mode. This is a fw mode which puts the NIC into a state
1177 * where memory BIST tests can be run and not much else can interfere or happen.
1178 * A reboot is required to exit this mode.
1179 */

--- 480 unchanged lines hidden ---
1201#if EFSYS_OPT_BIST
1202
1203#if EFSYS_OPT_HUNTINGTON
1204/*
1205 * Enter bist offline mode. This is a fw mode which puts the NIC into a state
1206 * where memory BIST tests can be run and not much else can interfere or happen.
1207 * A reboot is required to exit this mode.
1208 */

--- 480 unchanged lines hidden ---