aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sfxge/common/efx_lic.c
diff options
context:
space:
mode:
authorAndrew Rybchenko <arybchik@FreeBSD.org>2016-05-17 06:23:50 +0000
committerAndrew Rybchenko <arybchik@FreeBSD.org>2016-05-17 06:23:50 +0000
commit5df3232c85c3c790cc714a895d74b90fed8cd7af (patch)
treecce4fda33e7bca8420cb1038dd1ac9a6a3c13649 /sys/dev/sfxge/common/efx_lic.c
parentb0f7be91aa103fa8452d87fdb5733cc04729cbb4 (diff)
downloadsrc-5df3232c85c3c790cc714a895d74b90fed8cd7af.tar.gz
src-5df3232c85c3c790cc714a895d74b90fed8cd7af.zip
sfxge(4): store licensing state in efx_lic
Check licensing support at NIC startup to avoid multiple checks later. As state is stored, licensing initialisation is moved later in start procedure. Submitted by: Richard Houldsworth <rhouldsworth at solarflare.com> Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6385
Notes
Notes: svn path=/head/; revision=300007
Diffstat (limited to 'sys/dev/sfxge/common/efx_lic.c')
-rw-r--r--sys/dev/sfxge/common/efx_lic.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/dev/sfxge/common/efx_lic.c b/sys/dev/sfxge/common/efx_lic.c
index 95e32b93def5..480f195a47aa 100644
--- a/sys/dev/sfxge/common/efx_lic.c
+++ b/sys/dev/sfxge/common/efx_lic.c
@@ -1330,6 +1330,7 @@ efx_lic_init(
__in efx_nic_t *enp)
{
const efx_lic_ops_t *elop;
+ efx_key_stats_t eks;
efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -1365,6 +1366,13 @@ efx_lic_init(
enp->en_elop = elop;
enp->en_mod_flags |= EFX_MOD_LIC;
+ /* Probe for support */
+ if (efx_lic_get_key_stats(enp, &eks) == 0) {
+ enp->en_licensing_supported = B_TRUE;
+ } else {
+ enp->en_licensing_supported = B_FALSE;
+ }
+
return (0);
fail1:
@@ -1373,6 +1381,17 @@ fail1:
return (rc);
}
+extern __checkReturn boolean_t
+efx_lic_check_support(
+ __in efx_nic_t *enp)
+{
+ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
+ EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_LIC);
+
+ return enp->en_licensing_supported;
+}
+
void
efx_lic_fini(
__in efx_nic_t *enp)