Author: arybchik
Date: Wed Nov 28 09:23:41 2018
New Revision: 341127
URL: https://svnweb.freebsd.org/changeset/base/341127

Log:
  sfxge(4): add Medford2 support for licensing
  
  Submitted by:   Andy Moreton <amoreton at solarflare.com>
  Sponsored by:   Solarflare Communications, Inc.
  Differential Revision:  https://reviews.freebsd.org/D18202

Modified:
  head/sys/dev/sfxge/common/efx_lic.c

Modified: head/sys/dev/sfxge/common/efx_lic.c
==============================================================================
--- head/sys/dev/sfxge/common/efx_lic.c Wed Nov 28 09:23:30 2018        
(r341126)
+++ head/sys/dev/sfxge/common/efx_lic.c Wed Nov 28 09:23:41 2018        
(r341127)
@@ -192,7 +192,7 @@ static const efx_lic_ops_t  __efx_lic_v2_ops = {
 
 #endif /* EFSYS_OPT_HUNTINGTON */
 
-#if EFSYS_OPT_MEDFORD
+#if EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2
 
 static __checkReturn   efx_rc_t
 efx_mcdi_licensing_v3_update_licenses(
@@ -316,7 +316,7 @@ static const efx_lic_ops_t  __efx_lic_v3_ops = {
        efx_lic_v3_finish_partition,            /* elo_finish_partition */
 };
 
-#endif /* EFSYS_OPT_MEDFORD */
+#endif /* EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */
 
 
 /* V1 Licensing - used in Siena Modena only */
@@ -849,7 +849,7 @@ fail1:
 
 /* V3 Licensing - used starting from Medford family. See SF-114884-SW */
 
-#if EFSYS_OPT_MEDFORD
+#if EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2
 
 static __checkReturn   efx_rc_t
 efx_mcdi_licensing_v3_update_licenses(
@@ -859,7 +859,8 @@ efx_mcdi_licensing_v3_update_licenses(
        uint8_t payload[MC_CMD_LICENSING_V3_IN_LEN];
        efx_rc_t rc;
 
-       EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD);
+       EFSYS_ASSERT((enp->en_family == EFX_FAMILY_MEDFORD) ||
+           (enp->en_family == EFX_FAMILY_MEDFORD2));
 
        (void) memset(payload, 0, sizeof (payload));
        req.emr_cmd = MC_CMD_LICENSING_V3;
@@ -896,7 +897,8 @@ efx_mcdi_licensing_v3_report_license(
                            MC_CMD_LICENSING_V3_OUT_LEN)];
        efx_rc_t rc;
 
-       EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD);
+       EFSYS_ASSERT((enp->en_family == EFX_FAMILY_MEDFORD) ||
+           (enp->en_family == EFX_FAMILY_MEDFORD2));
 
        (void) memset(payload, 0, sizeof (payload));
        req.emr_cmd = MC_CMD_LICENSING_V3;
@@ -960,7 +962,8 @@ efx_mcdi_licensing_v3_app_state(
        uint32_t app_state;
        efx_rc_t rc;
 
-       EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD);
+       EFSYS_ASSERT((enp->en_family == EFX_FAMILY_MEDFORD) ||
+           (enp->en_family == EFX_FAMILY_MEDFORD2));
 
        (void) memset(payload, 0, sizeof (payload));
        req.emr_cmd = MC_CMD_GET_LICENSED_V3_APP_STATE;
@@ -1292,7 +1295,7 @@ fail1:
 }
 
 
-#endif /* EFSYS_OPT_MEDFORD */
+#endif /* EFSYS_OPT_MEDFORD || EFSYS_OPT_MEDFORD2 */
 
        __checkReturn           efx_rc_t
 efx_lic_init(
@@ -1325,6 +1328,12 @@ efx_lic_init(
                elop = &__efx_lic_v3_ops;
                break;
 #endif /* EFSYS_OPT_MEDFORD */
+
+#if EFSYS_OPT_MEDFORD2
+       case EFX_FAMILY_MEDFORD2:
+               elop = &__efx_lic_v3_ops;
+               break;
+#endif /* EFSYS_OPT_MEDFORD2 */
 
        default:
                EFSYS_ASSERT(0);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to