Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F161233275
D4330.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
D4330.diff
View Options
Index: head/sys/dev/sfxge/common/efx_impl.h
===================================================================
--- head/sys/dev/sfxge/common/efx_impl.h
+++ head/sys/dev/sfxge/common/efx_impl.h
@@ -462,6 +462,7 @@
void (*emco_fini)(efx_nic_t *);
efx_rc_t (*emco_fw_update_supported)(efx_nic_t *, boolean_t *);
efx_rc_t (*emco_macaddr_change_supported)(efx_nic_t *, boolean_t *);
+ efx_rc_t (*emco_link_control_supported)(efx_nic_t *, boolean_t *);
} efx_mcdi_ops_t;
typedef struct efx_mcdi_s {
Index: head/sys/dev/sfxge/common/efx_mcdi.h
===================================================================
--- head/sys/dev/sfxge/common/efx_mcdi.h
+++ head/sys/dev/sfxge/common/efx_mcdi.h
@@ -151,6 +151,11 @@
__in efx_nic_t *enp,
__out boolean_t *supportedp);
+extern __checkReturn efx_rc_t
+efx_mcdi_link_control_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp);
+
#if EFSYS_OPT_BIST
#if EFSYS_OPT_HUNTINGTON
extern __checkReturn efx_rc_t
Index: head/sys/dev/sfxge/common/efx_mcdi.c
===================================================================
--- head/sys/dev/sfxge/common/efx_mcdi.c
+++ head/sys/dev/sfxge/common/efx_mcdi.c
@@ -53,6 +53,8 @@
siena_mcdi_fw_update_supported, /* emco_fw_update_supported */
siena_mcdi_macaddr_change_supported,
/* emco_macaddr_change_supported */
+ siena_mcdi_link_control_supported,
+ /* emco_link_control_supported */
};
#endif /* EFSYS_OPT_SIENA */
@@ -69,6 +71,8 @@
hunt_mcdi_fw_update_supported, /* emco_fw_update_supported */
hunt_mcdi_macaddr_change_supported,
/* emco_macaddr_change_supported */
+ hunt_mcdi_link_control_supported,
+ /* emco_link_control_supported */
};
#endif /* EFSYS_OPT_HUNTINGTON */
@@ -1169,6 +1173,31 @@
return (rc);
}
+ __checkReturn efx_rc_t
+efx_mcdi_link_control_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp)
+{
+ efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
+ efx_rc_t rc;
+
+ if (emcop != NULL && emcop->emco_link_control_supported != NULL) {
+ if ((rc = emcop->emco_link_control_supported(enp, supportedp))
+ != 0)
+ goto fail1;
+ } else {
+ /* Earlier devices always supported link control */
+ *supportedp = B_TRUE;
+ }
+
+ return (0);
+
+fail1:
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
+
+ return (rc);
+}
+
#if EFSYS_OPT_BIST
#if EFSYS_OPT_HUNTINGTON
Index: head/sys/dev/sfxge/common/hunt_impl.h
===================================================================
--- head/sys/dev/sfxge/common/hunt_impl.h
+++ head/sys/dev/sfxge/common/hunt_impl.h
@@ -286,6 +286,11 @@
__in efx_nic_t *enp,
__out boolean_t *supportedp);
+extern __checkReturn efx_rc_t
+hunt_mcdi_link_control_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp);
+
#endif /* EFSYS_OPT_MCDI */
/* NVRAM */
Index: head/sys/dev/sfxge/common/hunt_mcdi.c
===================================================================
--- head/sys/dev/sfxge/common/hunt_mcdi.c
+++ head/sys/dev/sfxge/common/hunt_mcdi.c
@@ -471,6 +471,30 @@
return (0);
}
+ __checkReturn efx_rc_t
+hunt_mcdi_link_control_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp)
+{
+ efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
+ uint32_t privilege_mask = encp->enc_privilege_mask;
+
+ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON);
+
+ /*
+ * Use privilege mask state at MCDI attach.
+ * Admin privilege used prior to introduction of
+ * specific flag.
+ */
+ *supportedp =
+ ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK) ==
+ MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK) ||
+ ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) ==
+ MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN);
+
+ return (0);
+}
+
#endif /* EFSYS_OPT_MCDI */
#endif /* EFSYS_OPT_HUNTINGTON */
Index: head/sys/dev/sfxge/common/siena_impl.h
===================================================================
--- head/sys/dev/sfxge/common/siena_impl.h
+++ head/sys/dev/sfxge/common/siena_impl.h
@@ -148,6 +148,11 @@
__in efx_nic_t *enp,
__out boolean_t *supportedp);
+extern __checkReturn efx_rc_t
+siena_mcdi_link_control_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp);
+
#endif /* EFSYS_OPT_MCDI */
#if EFSYS_OPT_NVRAM || EFSYS_OPT_VPD
Index: head/sys/dev/sfxge/common/siena_mcdi.c
===================================================================
--- head/sys/dev/sfxge/common/siena_mcdi.c
+++ head/sys/dev/sfxge/common/siena_mcdi.c
@@ -351,4 +351,16 @@
return (0);
}
+ __checkReturn efx_rc_t
+siena_mcdi_link_control_supported(
+ __in efx_nic_t *enp,
+ __out boolean_t *supportedp)
+{
+ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA);
+
+ *supportedp = B_TRUE;
+
+ return (0);
+}
+
#endif /* EFSYS_OPT_SIENA && EFSYS_OPT_MCDI */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jul 2, 11:34 PM (14 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34605663
Default Alt Text
D4330.diff (4 KB)
Attached To
Mode
D4330: sfxge: add function to query link control privilege
Attached
Detach File
Event Timeline
Log In to Comment