Page MenuHomeFreeBSD

D4436.id10901.diff
No OneTemporary

D4436.id10901.diff

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
@@ -463,6 +463,7 @@
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_rc_t (*emco_mac_spoofing_supported)(efx_nic_t *, boolean_t *);
void (*emco_read_response)(efx_nic_t *, void *, size_t, size_t);
} efx_mcdi_ops_t;
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
@@ -156,6 +156,12 @@
__in efx_nic_t *enp,
__out boolean_t *supportedp);
+extern __checkReturn efx_rc_t
+efx_mcdi_mac_spoofing_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
@@ -55,6 +55,7 @@
/* emco_macaddr_change_supported */
siena_mcdi_link_control_supported,
/* emco_link_control_supported */
+ NULL, /* emco_mac_spoofing_supported */
siena_mcdi_read_response, /* emco_read_response */
};
@@ -74,6 +75,8 @@
/* emco_macaddr_change_supported */
hunt_mcdi_link_control_supported,
/* emco_link_control_supported */
+ hunt_mcdi_mac_spoofing_supported,
+ /* emco_mac_spoofing_supported */
hunt_mcdi_read_response, /* emco_read_response */
};
@@ -1199,6 +1202,31 @@
return (rc);
}
+ __checkReturn efx_rc_t
+efx_mcdi_mac_spoofing_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_mac_spoofing_supported != NULL) {
+ if ((rc = emcop->emco_mac_spoofing_supported(enp, supportedp))
+ != 0)
+ goto fail1;
+ } else {
+ /* Earlier devices always supported MAC spoofing */
+ *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
@@ -298,6 +298,12 @@
__in efx_nic_t *enp,
__out boolean_t *supportedp);
+extern __checkReturn efx_rc_t
+hunt_mcdi_mac_spoofing_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
@@ -515,9 +515,12 @@
/*
* Use privilege mask state at MCDI attach.
* Admin privilege must be used prior to introduction of
- * specific flag (at v4.6).
+ * mac spoofing privilege (at v4.6), which is used up to
+ * introduction of change mac spoofing privilege (at v4.7)
*/
*supportedp =
+ ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_CHANGE_MAC) ==
+ MC_CMD_PRIVILEGE_MASK_IN_GRP_CHANGE_MAC) ||
((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) ==
MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) ||
((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) ==
@@ -527,6 +530,34 @@
}
__checkReturn efx_rc_t
+hunt_mcdi_mac_spoofing_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 must be used prior to introduction of
+ * mac spoofing privilege (at v4.6), which is used up to
+ * introduction of mac spoofing TX privilege (at v4.7)
+ */
+ *supportedp =
+ ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING_TX) ==
+ MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING_TX) ||
+ ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) ==
+ MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) ||
+ ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) ==
+ MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN);
+
+ return (0);
+}
+
+
+ __checkReturn efx_rc_t
hunt_mcdi_link_control_supported(
__in efx_nic_t *enp,
__out boolean_t *supportedp)

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 30, 7:00 PM (13 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27390937
Default Alt Text
D4436.id10901.diff (4 KB)

Event Timeline