Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Jun 2016 14:58:34 +0000 (UTC)
From:      Andrew Rybchenko <arybchik@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r301340 - stable/10/sys/dev/sfxge/common
Message-ID:  <201606041458.u54EwYiE000940@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arybchik
Date: Sat Jun  4 14:58:34 2016
New Revision: 301340
URL: https://svnweb.freebsd.org/changeset/base/301340

Log:
  MFC r299517
  
  sfxge(4): cleanup: constify common code method tables
  
  Submitted by:   Andy Moreton <amoreton at solarflare.com>
  Sponsored by:   Solarflare Communications, Inc.

Modified:
  stable/10/sys/dev/sfxge/common/efx_ev.c
  stable/10/sys/dev/sfxge/common/efx_filter.c
  stable/10/sys/dev/sfxge/common/efx_impl.h
  stable/10/sys/dev/sfxge/common/efx_intr.c
  stable/10/sys/dev/sfxge/common/efx_lic.c
  stable/10/sys/dev/sfxge/common/efx_mac.c
  stable/10/sys/dev/sfxge/common/efx_mcdi.c
  stable/10/sys/dev/sfxge/common/efx_mon.c
  stable/10/sys/dev/sfxge/common/efx_nic.c
  stable/10/sys/dev/sfxge/common/efx_nvram.c
  stable/10/sys/dev/sfxge/common/efx_phy.c
  stable/10/sys/dev/sfxge/common/efx_port.c
  stable/10/sys/dev/sfxge/common/efx_rx.c
  stable/10/sys/dev/sfxge/common/efx_tx.c
  stable/10/sys/dev/sfxge/common/efx_vpd.c
  stable/10/sys/dev/sfxge/common/hunt_mac.c
  stable/10/sys/dev/sfxge/common/hunt_nic.c
  stable/10/sys/dev/sfxge/common/siena_mac.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/sfxge/common/efx_ev.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_ev.c	Sat Jun  4 14:57:25 2016	(r301339)
+++ stable/10/sys/dev/sfxge/common/efx_ev.c	Sat Jun  4 14:58:34 2016	(r301340)
@@ -109,7 +109,7 @@ falconsiena_ev_qstats_update(
 #endif /* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_SIENA
-static efx_ev_ops_t	__efx_ev_siena_ops = {
+static const efx_ev_ops_t	__efx_ev_siena_ops = {
 	falconsiena_ev_init,			/* eevo_init */
 	falconsiena_ev_fini,			/* eevo_fini */
 	falconsiena_ev_qcreate,			/* eevo_qcreate */
@@ -124,7 +124,7 @@ static efx_ev_ops_t	__efx_ev_siena_ops =
 #endif /* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
-static efx_ev_ops_t	__efx_ev_ef10_ops = {
+static const efx_ev_ops_t	__efx_ev_ef10_ops = {
 	ef10_ev_init,				/* eevo_init */
 	ef10_ev_fini,				/* eevo_fini */
 	ef10_ev_qcreate,			/* eevo_qcreate */
@@ -143,7 +143,7 @@ static efx_ev_ops_t	__efx_ev_ef10_ops = 
 efx_ev_init(
 	__in		efx_nic_t *enp)
 {
-	efx_ev_ops_t *eevop;
+	const efx_ev_ops_t *eevop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -157,19 +157,19 @@ efx_ev_init(
 	switch (enp->en_family) {
 #if EFSYS_OPT_SIENA
 	case EFX_FAMILY_SIENA:
-		eevop = (efx_ev_ops_t *)&__efx_ev_siena_ops;
+		eevop = &__efx_ev_siena_ops;
 		break;
 #endif /* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_HUNTINGTON
 	case EFX_FAMILY_HUNTINGTON:
-		eevop = (efx_ev_ops_t *)&__efx_ev_ef10_ops;
+		eevop = &__efx_ev_ef10_ops;
 		break;
 #endif /* EFSYS_OPT_HUNTINGTON */
 
 #if EFSYS_OPT_MEDFORD
 	case EFX_FAMILY_MEDFORD:
-		eevop = (efx_ev_ops_t *)&__efx_ev_ef10_ops;
+		eevop = &__efx_ev_ef10_ops;
 		break;
 #endif /* EFSYS_OPT_MEDFORD */
 
@@ -203,7 +203,7 @@ fail1:
 efx_ev_fini(
 	__in	efx_nic_t *enp)
 {
-	efx_ev_ops_t *eevop = enp->en_eevop;
+	const efx_ev_ops_t *eevop = enp->en_eevop;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
@@ -228,7 +228,7 @@ efx_ev_qcreate(
 	__in		uint32_t id,
 	__deref_out	efx_evq_t **eepp)
 {
-	efx_ev_ops_t *eevop = enp->en_eevop;
+	const efx_ev_ops_t *eevop = enp->en_eevop;
 	efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
 	efx_evq_t *eep;
 	efx_rc_t rc;
@@ -272,7 +272,7 @@ efx_ev_qdestroy(
 	__in	efx_evq_t *eep)
 {
 	efx_nic_t *enp = eep->ee_enp;
-	efx_ev_ops_t *eevop = enp->en_eevop;
+	const efx_ev_ops_t *eevop = enp->en_eevop;
 
 	EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
 
@@ -291,7 +291,7 @@ efx_ev_qprime(
 	__in		unsigned int count)
 {
 	efx_nic_t *enp = eep->ee_enp;
-	efx_ev_ops_t *eevop = enp->en_eevop;
+	const efx_ev_ops_t *eevop = enp->en_eevop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
@@ -383,7 +383,7 @@ efx_ev_qpost(
 	__in	uint16_t data)
 {
 	efx_nic_t *enp = eep->ee_enp;
-	efx_ev_ops_t *eevop = enp->en_eevop;
+	const efx_ev_ops_t *eevop = enp->en_eevop;
 
 	EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
 
@@ -399,7 +399,7 @@ efx_ev_qmoderate(
 	__in		unsigned int us)
 {
 	efx_nic_t *enp = eep->ee_enp;
-	efx_ev_ops_t *eevop = enp->en_eevop;
+	const efx_ev_ops_t *eevop = enp->en_eevop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
@@ -421,7 +421,7 @@ efx_ev_qstats_update(
 	__inout_ecount(EV_NQSTATS)	efsys_stat_t *stat)
 
 {	efx_nic_t *enp = eep->ee_enp;
-	efx_ev_ops_t *eevop = enp->en_eevop;
+	const efx_ev_ops_t *eevop = enp->en_eevop;
 
 	EFSYS_ASSERT3U(eep->ee_magic, ==, EFX_EVQ_MAGIC);
 

Modified: stable/10/sys/dev/sfxge/common/efx_filter.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_filter.c	Sat Jun  4 14:57:25 2016	(r301339)
+++ stable/10/sys/dev/sfxge/common/efx_filter.c	Sat Jun  4 14:58:34 2016	(r301340)
@@ -71,7 +71,7 @@ falconsiena_filter_supported_filters(
 #endif /* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_SIENA
-static efx_filter_ops_t	__efx_filter_siena_ops = {
+static const efx_filter_ops_t	__efx_filter_siena_ops = {
 	falconsiena_filter_init,		/* efo_init */
 	falconsiena_filter_fini,		/* efo_fini */
 	falconsiena_filter_restore,		/* efo_restore */
@@ -83,7 +83,7 @@ static efx_filter_ops_t	__efx_filter_sie
 #endif /* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
-static efx_filter_ops_t	__efx_filter_ef10_ops = {
+static const efx_filter_ops_t	__efx_filter_ef10_ops = {
 	ef10_filter_init,		/* efo_init */
 	ef10_filter_fini,		/* efo_fini */
 	ef10_filter_restore,		/* efo_restore */
@@ -99,7 +99,7 @@ efx_filter_insert(
 	__in		efx_nic_t *enp,
 	__inout		efx_filter_spec_t *spec)
 {
-	efx_filter_ops_t *efop = enp->en_efop;
+	const efx_filter_ops_t *efop = enp->en_efop;
 
 	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_FILTER);
 	EFSYS_ASSERT3P(spec, !=, NULL);
@@ -113,7 +113,7 @@ efx_filter_remove(
 	__in		efx_nic_t *enp,
 	__inout		efx_filter_spec_t *spec)
 {
-	efx_filter_ops_t *efop = enp->en_efop;
+	const efx_filter_ops_t *efop = enp->en_efop;
 
 	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_FILTER);
 	EFSYS_ASSERT3P(spec, !=, NULL);
@@ -149,7 +149,7 @@ fail1:
 efx_filter_init(
 	__in		efx_nic_t *enp)
 {
-	efx_filter_ops_t *efop;
+	const efx_filter_ops_t *efop;
 	efx_rc_t rc;
 
 	/* Check that efx_filter_spec_t is 64 bytes. */
@@ -162,19 +162,19 @@ efx_filter_init(
 	switch (enp->en_family) {
 #if EFSYS_OPT_SIENA
 	case EFX_FAMILY_SIENA:
-		efop = (efx_filter_ops_t *)&__efx_filter_siena_ops;
+		efop = &__efx_filter_siena_ops;
 		break;
 #endif /* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_HUNTINGTON
 	case EFX_FAMILY_HUNTINGTON:
-		efop = (efx_filter_ops_t *)&__efx_filter_ef10_ops;
+		efop = &__efx_filter_ef10_ops;
 		break;
 #endif /* EFSYS_OPT_HUNTINGTON */
 
 #if EFSYS_OPT_MEDFORD
 	case EFX_FAMILY_MEDFORD:
-		efop = (efx_filter_ops_t *)&__efx_filter_ef10_ops;
+		efop = &__efx_filter_ef10_ops;
 		break;
 #endif /* EFSYS_OPT_MEDFORD */
 

Modified: stable/10/sys/dev/sfxge/common/efx_impl.h
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_impl.h	Sat Jun  4 14:57:25 2016	(r301339)
+++ stable/10/sys/dev/sfxge/common/efx_impl.h	Sat Jun  4 14:58:34 2016	(r301340)
@@ -301,8 +301,8 @@ typedef struct efx_port_s {
 #if EFSYS_OPT_BIST
 	efx_bist_type_t		ep_current_bist;
 #endif
-	efx_mac_ops_t		*ep_emop;
-	efx_phy_ops_t		*ep_epop;
+	const efx_mac_ops_t	*ep_emop;
+	const efx_phy_ops_t	*ep_epop;
 } efx_port_t;
 
 typedef struct efx_mon_ops_s {
@@ -315,8 +315,8 @@ typedef struct efx_mon_ops_s {
 } efx_mon_ops_t;
 
 typedef struct efx_mon_s {
-	efx_mon_type_t	em_type;
-	efx_mon_ops_t	*em_emop;
+	efx_mon_type_t		em_type;
+	const efx_mon_ops_t	*em_emop;
 } efx_mon_t;
 
 typedef struct efx_intr_ops_s {
@@ -333,10 +333,10 @@ typedef struct efx_intr_ops_s {
 } efx_intr_ops_t;
 
 typedef struct efx_intr_s {
-	efx_intr_ops_t	*ei_eiop;
-	efsys_mem_t	*ei_esmp;
-	efx_intr_type_t	ei_type;
-	unsigned int	ei_level;
+	const efx_intr_ops_t	*ei_eiop;
+	efsys_mem_t		*ei_esmp;
+	efx_intr_type_t		ei_type;
+	unsigned int		ei_level;
 } efx_intr_t;
 
 typedef struct efx_nic_ops_s {
@@ -449,7 +449,7 @@ typedef struct efx_mcdi_ops_s {
 } efx_mcdi_ops_t;
 
 typedef struct efx_mcdi_s {
-	efx_mcdi_ops_t			*em_emcop;
+	const efx_mcdi_ops_t		*em_emcop;
 	const efx_mcdi_transport_t	*em_emtp;
 	efx_mcdi_iface_t		em_emip;
 } efx_mcdi_t;
@@ -617,23 +617,23 @@ struct efx_nic_s {
 	uint32_t		en_ev_qcount;
 	uint32_t		en_rx_qcount;
 	uint32_t		en_tx_qcount;
-	efx_nic_ops_t		*en_enop;
-	efx_ev_ops_t		*en_eevop;
-	efx_tx_ops_t		*en_etxop;
-	efx_rx_ops_t		*en_erxop;
+	const efx_nic_ops_t	*en_enop;
+	const efx_ev_ops_t	*en_eevop;
+	const efx_tx_ops_t	*en_etxop;
+	const efx_rx_ops_t	*en_erxop;
 #if EFSYS_OPT_FILTER
 	efx_filter_t		en_filter;
-	efx_filter_ops_t	*en_efop;
+	const efx_filter_ops_t	*en_efop;
 #endif	/* EFSYS_OPT_FILTER */
 #if EFSYS_OPT_MCDI
 	efx_mcdi_t		en_mcdi;
 #endif	/* EFSYS_OPT_MCDI */
 #if EFSYS_OPT_NVRAM
 	efx_nvram_type_t	en_nvram_locked;
-	efx_nvram_ops_t		*en_envop;
+	const efx_nvram_ops_t	*en_envop;
 #endif	/* EFSYS_OPT_NVRAM */
 #if EFSYS_OPT_VPD
-	efx_vpd_ops_t		*en_evpdop;
+	const efx_vpd_ops_t	*en_evpdop;
 #endif	/* EFSYS_OPT_VPD */
 #if EFSYS_OPT_RX_SCALE
 	efx_rx_hash_support_t	en_hash_support;
@@ -642,7 +642,7 @@ struct efx_nic_s {
 #endif	/* EFSYS_OPT_RX_SCALE */
 	uint32_t		en_vport_id;
 #if EFSYS_OPT_LICENSING
-	efx_lic_ops_t		*en_elop;
+	const efx_lic_ops_t	*en_elop;
 #endif
 	union {
 #if EFSYS_OPT_SIENA

Modified: stable/10/sys/dev/sfxge/common/efx_intr.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_intr.c	Sat Jun  4 14:57:25 2016	(r301339)
+++ stable/10/sys/dev/sfxge/common/efx_intr.c	Sat Jun  4 14:58:34 2016	(r301340)
@@ -89,7 +89,7 @@ falconsiena_intr_check_fatal(
 
 
 #if EFSYS_OPT_SIENA
-static efx_intr_ops_t	__efx_intr_siena_ops = {
+static const efx_intr_ops_t	__efx_intr_siena_ops = {
 	falconsiena_intr_init,			/* eio_init */
 	falconsiena_intr_enable,		/* eio_enable */
 	falconsiena_intr_disable,		/* eio_disable */
@@ -103,7 +103,7 @@ static efx_intr_ops_t	__efx_intr_siena_o
 #endif	/* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
-static efx_intr_ops_t	__efx_intr_ef10_ops = {
+static const efx_intr_ops_t	__efx_intr_ef10_ops = {
 	ef10_intr_init,			/* eio_init */
 	ef10_intr_enable,		/* eio_enable */
 	ef10_intr_disable,		/* eio_disable */
@@ -123,7 +123,7 @@ efx_intr_init(
 	__in		efsys_mem_t *esmp)
 {
 	efx_intr_t *eip = &(enp->en_intr);
-	efx_intr_ops_t *eiop;
+	const efx_intr_ops_t *eiop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -143,19 +143,19 @@ efx_intr_init(
 	switch (enp->en_family) {
 #if EFSYS_OPT_SIENA
 	case EFX_FAMILY_SIENA:
-		eiop = (efx_intr_ops_t *)&__efx_intr_siena_ops;
+		eiop = &__efx_intr_siena_ops;
 		break;
 #endif	/* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_HUNTINGTON
 	case EFX_FAMILY_HUNTINGTON:
-		eiop = (efx_intr_ops_t *)&__efx_intr_ef10_ops;
+		eiop = &__efx_intr_ef10_ops;
 		break;
 #endif	/* EFSYS_OPT_HUNTINGTON */
 
 #if EFSYS_OPT_MEDFORD
 	case EFX_FAMILY_MEDFORD:
-		eiop = (efx_intr_ops_t *)&__efx_intr_ef10_ops;
+		eiop = &__efx_intr_ef10_ops;
 		break;
 #endif	/* EFSYS_OPT_MEDFORD */
 
@@ -187,7 +187,7 @@ efx_intr_fini(
 	__in	efx_nic_t *enp)
 {
 	efx_intr_t *eip = &(enp->en_intr);
-	efx_intr_ops_t *eiop = eip->ei_eiop;
+	const efx_intr_ops_t *eiop = eip->ei_eiop;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
@@ -203,7 +203,7 @@ efx_intr_enable(
 	__in		efx_nic_t *enp)
 {
 	efx_intr_t *eip = &(enp->en_intr);
-	efx_intr_ops_t *eiop = eip->ei_eiop;
+	const efx_intr_ops_t *eiop = eip->ei_eiop;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
@@ -216,7 +216,7 @@ efx_intr_disable(
 	__in		efx_nic_t *enp)
 {
 	efx_intr_t *eip = &(enp->en_intr);
-	efx_intr_ops_t *eiop = eip->ei_eiop;
+	const efx_intr_ops_t *eiop = eip->ei_eiop;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
@@ -229,7 +229,7 @@ efx_intr_disable_unlocked(
 	__in		efx_nic_t *enp)
 {
 	efx_intr_t *eip = &(enp->en_intr);
-	efx_intr_ops_t *eiop = eip->ei_eiop;
+	const efx_intr_ops_t *eiop = eip->ei_eiop;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
@@ -244,7 +244,7 @@ efx_intr_trigger(
 	__in		unsigned int level)
 {
 	efx_intr_t *eip = &(enp->en_intr);
-	efx_intr_ops_t *eiop = eip->ei_eiop;
+	const efx_intr_ops_t *eiop = eip->ei_eiop;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
@@ -259,7 +259,7 @@ efx_intr_status_line(
 	__out		uint32_t *qmaskp)
 {
 	efx_intr_t *eip = &(enp->en_intr);
-	efx_intr_ops_t *eiop = eip->ei_eiop;
+	const efx_intr_ops_t *eiop = eip->ei_eiop;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
@@ -274,7 +274,7 @@ efx_intr_status_message(
 	__out		boolean_t *fatalp)
 {
 	efx_intr_t *eip = &(enp->en_intr);
-	efx_intr_ops_t *eiop = eip->ei_eiop;
+	const efx_intr_ops_t *eiop = eip->ei_eiop;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);
@@ -287,7 +287,7 @@ efx_intr_fatal(
 	__in	efx_nic_t *enp)
 {
 	efx_intr_t *eip = &(enp->en_intr);
-	efx_intr_ops_t *eiop = eip->ei_eiop;
+	const efx_intr_ops_t *eiop = eip->ei_eiop;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_INTR);

Modified: stable/10/sys/dev/sfxge/common/efx_lic.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_lic.c	Sat Jun  4 14:57:25 2016	(r301339)
+++ stable/10/sys/dev/sfxge/common/efx_lic.c	Sat Jun  4 14:58:34 2016	(r301340)
@@ -47,7 +47,7 @@ efx_mcdi_fc_license_get_key_stats(
 	__in		efx_nic_t *enp,
 	__out		efx_key_stats_t *eksp);
 
-static efx_lic_ops_t	__efx_lic_v1_ops = {
+static const efx_lic_ops_t	__efx_lic_v1_ops = {
 	efx_mcdi_fc_license_update_license,	/* elo_update_licenses */
 	efx_mcdi_fc_license_get_key_stats,	/* elo_get_key_stats */
 	NULL,					/* elo_app_state */
@@ -73,7 +73,7 @@ efx_mcdi_licensed_app_state(
 	__in		uint64_t app_id,
 	__out		boolean_t *licensedp);
 
-static efx_lic_ops_t	__efx_lic_v2_ops = {
+static const efx_lic_ops_t	__efx_lic_v2_ops = {
 	efx_mcdi_licensing_update_licenses,	/* elo_update_licenses */
 	efx_mcdi_licensing_get_key_stats,	/* elo_get_key_stats */
 	efx_mcdi_licensed_app_state,		/* elo_app_state */
@@ -108,7 +108,7 @@ efx_mcdi_licensing_v3_get_id(
 	__out_bcount_part_opt(buffer_size, *lengthp)
 			uint8_t *bufferp);
 
-static efx_lic_ops_t	__efx_lic_v3_ops = {
+static const efx_lic_ops_t	__efx_lic_v3_ops = {
 	efx_mcdi_licensing_v3_update_licenses,	/* elo_update_licenses */
 	efx_mcdi_licensing_v3_report_license,	/* elo_get_key_stats */
 	efx_mcdi_licensing_v3_app_state,	/* elo_app_state */
@@ -624,7 +624,7 @@ fail1:
 efx_lic_init(
 	__in			efx_nic_t *enp)
 {
-	efx_lic_ops_t *elop;
+	const efx_lic_ops_t *elop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -635,19 +635,19 @@ efx_lic_init(
 
 #if EFSYS_OPT_SIENA
 	case EFX_FAMILY_SIENA:
-		elop = (efx_lic_ops_t *)&__efx_lic_v1_ops;
+		elop = &__efx_lic_v1_ops;
 		break;
 #endif	/* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_HUNTINGTON
 	case EFX_FAMILY_HUNTINGTON:
-		elop = (efx_lic_ops_t *)&__efx_lic_v2_ops;
+		elop = &__efx_lic_v2_ops;
 		break;
 #endif	/* EFSYS_OPT_HUNTINGTON */
 
 #if EFSYS_OPT_MEDFORD
 	case EFX_FAMILY_MEDFORD:
-		elop = (efx_lic_ops_t *)&__efx_lic_v3_ops;
+		elop = &__efx_lic_v3_ops;
 		break;
 #endif	/* EFSYS_OPT_MEDFORD */
 
@@ -672,7 +672,7 @@ fail1:
 efx_lic_fini(
 	__in			efx_nic_t *enp)
 {
-	efx_lic_ops_t *elop = enp->en_elop;
+	const efx_lic_ops_t *elop = enp->en_elop;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE);
@@ -687,7 +687,7 @@ efx_lic_fini(
 efx_lic_update_licenses(
 	__in		efx_nic_t *enp)
 {
-	efx_lic_ops_t *elop = enp->en_elop;
+	const efx_lic_ops_t *elop = enp->en_elop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -709,7 +709,7 @@ efx_lic_get_key_stats(
 	__in		efx_nic_t *enp,
 	__out		efx_key_stats_t *eksp)
 {
-	efx_lic_ops_t *elop = enp->en_elop;
+	const efx_lic_ops_t *elop = enp->en_elop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -732,7 +732,7 @@ efx_lic_app_state(
 	__in		uint64_t app_id,
 	__out		boolean_t *licensedp)
 {
-	efx_lic_ops_t *elop = enp->en_elop;
+	const efx_lic_ops_t *elop = enp->en_elop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -764,7 +764,7 @@ efx_lic_get_id(
 	__out_opt	uint8_t *bufferp
 	)
 {
-	efx_lic_ops_t *elop = enp->en_elop;
+	const efx_lic_ops_t *elop = enp->en_elop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);

Modified: stable/10/sys/dev/sfxge/common/efx_mac.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_mac.c	Sat Jun  4 14:57:25 2016	(r301339)
+++ stable/10/sys/dev/sfxge/common/efx_mac.c	Sat Jun  4 14:58:34 2016	(r301340)
@@ -43,7 +43,7 @@ falconsiena_mac_multicast_list_set(
 #endif /* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_SIENA
-static efx_mac_ops_t	__efx_siena_mac_ops = {
+static const efx_mac_ops_t	__efx_siena_mac_ops = {
 	NULL,					/* emo_reset */
 	siena_mac_poll,				/* emo_poll */
 	siena_mac_up,				/* emo_up */
@@ -65,7 +65,7 @@ static efx_mac_ops_t	__efx_siena_mac_ops
 #endif	/* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
-static efx_mac_ops_t	__efx_ef10_mac_ops = {
+static const efx_mac_ops_t	__efx_ef10_mac_ops = {
 	NULL,					/* emo_reset */
 	ef10_mac_poll,				/* emo_poll */
 	ef10_mac_up,				/* emo_up */
@@ -94,7 +94,7 @@ efx_mac_pdu_set(
 	__in				size_t pdu)
 {
 	efx_port_t *epp = &(enp->en_port);
-	efx_mac_ops_t *emop = epp->ep_emop;
+	const efx_mac_ops_t *emop = epp->ep_emop;
 	uint32_t old_pdu;
 	efx_rc_t rc;
 
@@ -138,7 +138,7 @@ efx_mac_addr_set(
 	__in				uint8_t *addr)
 {
 	efx_port_t *epp = &(enp->en_port);
-	efx_mac_ops_t *emop = epp->ep_emop;
+	const efx_mac_ops_t *emop = epp->ep_emop;
 	uint8_t old_addr[6];
 	uint32_t oui;
 	efx_rc_t rc;
@@ -186,7 +186,7 @@ efx_mac_filter_set(
 	__in				boolean_t brdcst)
 {
 	efx_port_t *epp = &(enp->en_port);
-	efx_mac_ops_t *emop = epp->ep_emop;
+	const efx_mac_ops_t *emop = epp->ep_emop;
 	boolean_t old_all_unicst;
 	boolean_t old_mulcst;
 	boolean_t old_all_mulcst;
@@ -228,7 +228,7 @@ efx_mac_drain(
 	__in				boolean_t enabled)
 {
 	efx_port_t *epp = &(enp->en_port);
-	efx_mac_ops_t *emop = epp->ep_emop;
+	const efx_mac_ops_t *emop = epp->ep_emop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -267,7 +267,7 @@ efx_mac_up(
 	__out		boolean_t *mac_upp)
 {
 	efx_port_t *epp = &(enp->en_port);
-	efx_mac_ops_t *emop = epp->ep_emop;
+	const efx_mac_ops_t *emop = epp->ep_emop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -291,8 +291,8 @@ efx_mac_fcntl_set(
 	__in				boolean_t autoneg)
 {
 	efx_port_t *epp = &(enp->en_port);
-	efx_mac_ops_t *emop = epp->ep_emop;
-	efx_phy_ops_t *epop = epp->ep_epop;
+	const efx_mac_ops_t *emop = epp->ep_emop;
+	const efx_phy_ops_t *epop = epp->ep_epop;
 	unsigned int old_fcntl;
 	boolean_t old_autoneg;
 	unsigned int old_adv_cap;
@@ -391,7 +391,7 @@ efx_mac_multicast_list_set(
 	__in				int count)
 {
 	efx_port_t *epp = &(enp->en_port);
-	efx_mac_ops_t *emop = epp->ep_emop;
+	const efx_mac_ops_t *emop = epp->ep_emop;
 	uint8_t	*old_mulcst_addr_list = NULL;
 	uint32_t old_mulcst_addr_count;
 	efx_rc_t rc;
@@ -467,7 +467,7 @@ efx_mac_filter_default_rxq_set(
 	__in		boolean_t using_rss)
 {
 	efx_port_t *epp = &(enp->en_port);
-	efx_mac_ops_t *emop = epp->ep_emop;
+	const efx_mac_ops_t *emop = epp->ep_emop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -492,7 +492,7 @@ efx_mac_filter_default_rxq_clear(
 	__in		efx_nic_t *enp)
 {
 	efx_port_t *epp = &(enp->en_port);
-	efx_mac_ops_t *emop = epp->ep_emop;
+	const efx_mac_ops_t *emop = epp->ep_emop;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT);
@@ -612,7 +612,7 @@ efx_mac_stats_upload(
 	__in				efsys_mem_t *esmp)
 {
 	efx_port_t *epp = &(enp->en_port);
-	efx_mac_ops_t *emop = epp->ep_emop;
+	const efx_mac_ops_t *emop = epp->ep_emop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -645,7 +645,7 @@ efx_mac_stats_periodic(
 	__in				boolean_t events)
 {
 	efx_port_t *epp = &(enp->en_port);
-	efx_mac_ops_t *emop = epp->ep_emop;
+	const efx_mac_ops_t *emop = epp->ep_emop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -680,7 +680,7 @@ efx_mac_stats_update(
 	__inout_opt			uint32_t *generationp)
 {
 	efx_port_t *epp = &(enp->en_port);
-	efx_mac_ops_t *emop = epp->ep_emop;
+	const efx_mac_ops_t *emop = epp->ep_emop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -702,7 +702,7 @@ efx_mac_select(
 {
 	efx_port_t *epp = &(enp->en_port);
 	efx_mac_type_t type = EFX_MAC_INVALID;
-	efx_mac_ops_t *emop;
+	const efx_mac_ops_t *emop;
 	int rc = EINVAL;
 
 	switch (enp->en_family) {
@@ -798,7 +798,7 @@ falconsiena_mac_multicast_list_set(
 	__in		efx_nic_t *enp)
 {
 	efx_port_t *epp = &(enp->en_port);
-	efx_mac_ops_t *emop = epp->ep_emop;
+	const efx_mac_ops_t *emop = epp->ep_emop;
 	efx_oword_t old_hash[2];
 	efx_rc_t rc;
 

Modified: stable/10/sys/dev/sfxge/common/efx_mcdi.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_mcdi.c	Sat Jun  4 14:57:25 2016	(r301339)
+++ stable/10/sys/dev/sfxge/common/efx_mcdi.c	Sat Jun  4 14:58:34 2016	(r301340)
@@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$");
 
 #if EFSYS_OPT_SIENA
 
-static efx_mcdi_ops_t	__efx_mcdi_siena_ops = {
+static const efx_mcdi_ops_t	__efx_mcdi_siena_ops = {
 	siena_mcdi_init,		/* emco_init */
 	siena_mcdi_send_request,	/* emco_send_request */
 	siena_mcdi_poll_reboot,		/* emco_poll_reboot */
@@ -73,7 +73,7 @@ static efx_mcdi_ops_t	__efx_mcdi_siena_o
 
 #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
 
-static efx_mcdi_ops_t	__efx_mcdi_ef10_ops = {
+static const efx_mcdi_ops_t	__efx_mcdi_ef10_ops = {
 	ef10_mcdi_init,			/* emco_init */
 	ef10_mcdi_send_request,		/* emco_send_request */
 	ef10_mcdi_poll_reboot,		/* emco_poll_reboot */
@@ -92,7 +92,7 @@ efx_mcdi_init(
 	__in		efx_nic_t *enp,
 	__in		const efx_mcdi_transport_t *emtp)
 {
-	efx_mcdi_ops_t *emcop;
+	const efx_mcdi_ops_t *emcop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -101,19 +101,19 @@ efx_mcdi_init(
 	switch (enp->en_family) {
 #if EFSYS_OPT_SIENA
 	case EFX_FAMILY_SIENA:
-		emcop = (efx_mcdi_ops_t *)&__efx_mcdi_siena_ops;
+		emcop = &__efx_mcdi_siena_ops;
 		break;
 #endif	/* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_HUNTINGTON
 	case EFX_FAMILY_HUNTINGTON:
-		emcop = (efx_mcdi_ops_t *)&__efx_mcdi_ef10_ops;
+		emcop = &__efx_mcdi_ef10_ops;
 		break;
 #endif	/* EFSYS_OPT_HUNTINGTON */
 
 #if EFSYS_OPT_MEDFORD
 	case EFX_FAMILY_MEDFORD:
-		emcop = (efx_mcdi_ops_t *)&__efx_mcdi_ef10_ops;
+		emcop = &__efx_mcdi_ef10_ops;
 		break;
 #endif	/* EFSYS_OPT_MEDFORD */
 
@@ -161,7 +161,7 @@ efx_mcdi_fini(
 	__in		efx_nic_t *enp)
 {
 	efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip);
-	efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
+	const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT3U(enp->en_mod_flags, ==, EFX_MOD_MCDI);
@@ -197,7 +197,7 @@ efx_mcdi_send_request(
 	__in		void *sdup,
 	__in		size_t sdu_len)
 {
-	efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
+	const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
 
 	emcop->emco_send_request(enp, hdrp, hdr_len, sdup, sdu_len);
 }
@@ -206,7 +206,7 @@ static			efx_rc_t
 efx_mcdi_poll_reboot(
 	__in		efx_nic_t *enp)
 {
-	efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
+	const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
 	efx_rc_t rc;
 
 	rc = emcop->emco_poll_reboot(enp);
@@ -217,7 +217,7 @@ static			boolean_t
 efx_mcdi_poll_response(
 	__in		efx_nic_t *enp)
 {
-	efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
+	const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
 	boolean_t available;
 
 	available = emcop->emco_poll_response(enp);
@@ -231,7 +231,7 @@ efx_mcdi_read_response(
 	__in		size_t offset,
 	__in		size_t length)
 {
-	efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
+	const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
 
 	emcop->emco_read_response(enp, bufferp, offset, length);
 }
@@ -1490,7 +1490,7 @@ efx_mcdi_firmware_update_supported(
 	__in			efx_nic_t *enp,
 	__out			boolean_t *supportedp)
 {
-	efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
+	const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
 	efx_rc_t rc;
 
 	if (emcop != NULL) {
@@ -1515,7 +1515,7 @@ efx_mcdi_macaddr_change_supported(
 	__in			efx_nic_t *enp,
 	__out			boolean_t *supportedp)
 {
-	efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
+	const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
 	efx_rc_t rc;
 
 	if (emcop != NULL) {
@@ -1540,7 +1540,7 @@ efx_mcdi_link_control_supported(
 	__in			efx_nic_t *enp,
 	__out			boolean_t *supportedp)
 {
-	efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
+	const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
 	efx_rc_t rc;
 
 	if (emcop != NULL) {
@@ -1565,7 +1565,7 @@ efx_mcdi_mac_spoofing_supported(
 	__in			efx_nic_t *enp,
 	__out			boolean_t *supportedp)
 {
-	efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
+	const efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop;
 	efx_rc_t rc;
 
 	if (emcop != NULL) {

Modified: stable/10/sys/dev/sfxge/common/efx_mon.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_mon.c	Sat Jun  4 14:57:25 2016	(r301339)
+++ stable/10/sys/dev/sfxge/common/efx_mon.c	Sat Jun  4 14:58:34 2016	(r301340)
@@ -66,7 +66,7 @@ efx_mon_name(
 #endif	/* EFSYS_OPT_NAMES */
 
 #if EFSYS_OPT_MON_MCDI
-static efx_mon_ops_t	__efx_mon_mcdi_ops = {
+static const efx_mon_ops_t	__efx_mon_mcdi_ops = {
 	NULL,				/* emo_reset */
 	NULL,				/* emo_reconfigure */
 #if EFSYS_OPT_MON_STATS
@@ -82,7 +82,7 @@ efx_mon_init(
 {
 	efx_nic_cfg_t *encp = &(enp->en_nic_cfg);
 	efx_mon_t *emp = &(enp->en_mon);
-	efx_mon_ops_t *emop;
+	const efx_mon_ops_t *emop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -253,7 +253,7 @@ efx_mon_stats_update(
 	__inout_ecount(EFX_MON_NSTATS)	efx_mon_stat_value_t *values)
 {
 	efx_mon_t *emp = &(enp->en_mon);
-	efx_mon_ops_t *emop = emp->em_emop;
+	const efx_mon_ops_t *emop = emp->em_emop;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MON);
@@ -268,7 +268,7 @@ efx_mon_fini(
 	__in	efx_nic_t *enp)
 {
 	efx_mon_t *emp = &(enp->en_mon);
-	efx_mon_ops_t *emop = emp->em_emop;
+	const efx_mon_ops_t *emop = emp->em_emop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);

Modified: stable/10/sys/dev/sfxge/common/efx_nic.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_nic.c	Sat Jun  4 14:57:25 2016	(r301339)
+++ stable/10/sys/dev/sfxge/common/efx_nic.c	Sat Jun  4 14:58:34 2016	(r301340)
@@ -179,7 +179,7 @@ fail1:
 
 #if EFSYS_OPT_SIENA
 
-static efx_nic_ops_t	__efx_nic_siena_ops = {
+static const efx_nic_ops_t	__efx_nic_siena_ops = {
 	siena_nic_probe,		/* eno_probe */
 	NULL,				/* eno_board_cfg */
 	NULL,				/* eno_set_drv_limits */
@@ -198,7 +198,7 @@ static efx_nic_ops_t	__efx_nic_siena_ops
 
 #if EFSYS_OPT_HUNTINGTON
 
-static efx_nic_ops_t	__efx_nic_hunt_ops = {
+static const efx_nic_ops_t	__efx_nic_hunt_ops = {
 	ef10_nic_probe,			/* eno_probe */
 	hunt_board_cfg,			/* eno_board_cfg */
 	ef10_nic_set_drv_limits,	/* eno_set_drv_limits */
@@ -217,7 +217,7 @@ static efx_nic_ops_t	__efx_nic_hunt_ops 
 
 #if EFSYS_OPT_MEDFORD
 
-static efx_nic_ops_t	__efx_nic_medford_ops = {
+static const efx_nic_ops_t	__efx_nic_medford_ops = {
 	ef10_nic_probe,			/* eno_probe */
 	medford_board_cfg,		/* eno_board_cfg */
 	ef10_nic_set_drv_limits,	/* eno_set_drv_limits */
@@ -262,7 +262,7 @@ efx_nic_create(
 	switch (family) {
 #if EFSYS_OPT_SIENA
 	case EFX_FAMILY_SIENA:
-		enp->en_enop = (efx_nic_ops_t *)&__efx_nic_siena_ops;
+		enp->en_enop = &__efx_nic_siena_ops;
 		enp->en_features =
 		    EFX_FEATURE_IPV6 |
 		    EFX_FEATURE_LFSR_HASH_INSERT |
@@ -278,7 +278,7 @@ efx_nic_create(
 
 #if EFSYS_OPT_HUNTINGTON
 	case EFX_FAMILY_HUNTINGTON:
-		enp->en_enop = (efx_nic_ops_t *)&__efx_nic_hunt_ops;
+		enp->en_enop = &__efx_nic_hunt_ops;
 		/* FIXME: Add WOL support */
 		enp->en_features =
 		    EFX_FEATURE_IPV6 |
@@ -295,7 +295,7 @@ efx_nic_create(
 
 #if EFSYS_OPT_MEDFORD
 	case EFX_FAMILY_MEDFORD:
-		enp->en_enop = (efx_nic_ops_t *)&__efx_nic_medford_ops;
+		enp->en_enop = &__efx_nic_medford_ops;
 		/*
 		 * FW_ASSISTED_TSO ommitted as Medford only supports firmware
 		 * assisted TSO version 2, not the v1 scheme used on Huntington.
@@ -343,7 +343,7 @@ fail1:
 efx_nic_probe(
 	__in		efx_nic_t *enp)
 {
-	efx_nic_ops_t *enop;
+	const efx_nic_ops_t *enop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -379,7 +379,7 @@ efx_nic_set_drv_limits(
 	__inout		efx_nic_t *enp,
 	__in		efx_drv_limits_t *edlp)
 {
-	efx_nic_ops_t *enop = enp->en_enop;
+	const efx_nic_ops_t *enop = enp->en_enop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -405,7 +405,7 @@ efx_nic_get_bar_region(
 	__out		uint32_t *offsetp,
 	__out		size_t *sizep)
 {
-	efx_nic_ops_t *enop = enp->en_enop;
+	const efx_nic_ops_t *enop = enp->en_enop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -440,7 +440,7 @@ efx_nic_get_vi_pool(
 	__out		uint32_t *rxq_countp,
 	__out		uint32_t *txq_countp)
 {
-	efx_nic_ops_t *enop = enp->en_enop;
+	const efx_nic_ops_t *enop = enp->en_enop;
 	efx_nic_cfg_t *encp = &enp->en_nic_cfg;
 	efx_rc_t rc;
 
@@ -477,7 +477,7 @@ fail1:
 efx_nic_init(
 	__in		efx_nic_t *enp)
 {
-	efx_nic_ops_t *enop = enp->en_enop;
+	const efx_nic_ops_t *enop = enp->en_enop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -507,7 +507,7 @@ fail1:
 efx_nic_fini(
 	__in		efx_nic_t *enp)
 {
-	efx_nic_ops_t *enop = enp->en_enop;
+	const efx_nic_ops_t *enop = enp->en_enop;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 	EFSYS_ASSERT(enp->en_mod_flags & EFX_MOD_PROBE);
@@ -526,7 +526,7 @@ efx_nic_fini(
 efx_nic_unprobe(
 	__in		efx_nic_t *enp)
 {
-	efx_nic_ops_t *enop = enp->en_enop;
+	const efx_nic_ops_t *enop = enp->en_enop;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
 #if EFSYS_OPT_MCDI
@@ -572,7 +572,7 @@ efx_nic_destroy(
 efx_nic_reset(
 	__in		efx_nic_t *enp)
 {
-	efx_nic_ops_t *enop = enp->en_enop;
+	const efx_nic_ops_t *enop = enp->en_enop;
 	unsigned int mod_flags;
 	efx_rc_t rc;
 
@@ -626,7 +626,7 @@ efx_nic_cfg_get(
 efx_nic_register_test(
 	__in		efx_nic_t *enp)
 {
-	efx_nic_ops_t *enop = enp->en_enop;
+	const efx_nic_ops_t *enop = enp->en_enop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);

Modified: stable/10/sys/dev/sfxge/common/efx_nvram.c
==============================================================================
--- stable/10/sys/dev/sfxge/common/efx_nvram.c	Sat Jun  4 14:57:25 2016	(r301339)
+++ stable/10/sys/dev/sfxge/common/efx_nvram.c	Sat Jun  4 14:58:34 2016	(r301340)
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
 
 #if EFSYS_OPT_SIENA
 
-static efx_nvram_ops_t	__efx_nvram_siena_ops = {
+static const efx_nvram_ops_t	__efx_nvram_siena_ops = {
 #if EFSYS_OPT_DIAG
 	siena_nvram_test,		/* envo_test */
 #endif	/* EFSYS_OPT_DIAG */
@@ -58,7 +58,7 @@ static efx_nvram_ops_t	__efx_nvram_siena
 
 #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD
 
-static efx_nvram_ops_t	__efx_nvram_ef10_ops = {
+static const efx_nvram_ops_t	__efx_nvram_ef10_ops = {
 #if EFSYS_OPT_DIAG
 	ef10_nvram_test,		/* envo_test */
 #endif	/* EFSYS_OPT_DIAG */
@@ -80,7 +80,7 @@ static efx_nvram_ops_t	__efx_nvram_ef10_
 efx_nvram_init(
 	__in		efx_nic_t *enp)
 {
-	efx_nvram_ops_t *envop;
+	const efx_nvram_ops_t *envop;
 	efx_rc_t rc;
 
 	EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
@@ -90,19 +90,19 @@ efx_nvram_init(
 	switch (enp->en_family) {
 #if EFSYS_OPT_SIENA
 	case EFX_FAMILY_SIENA:
-		envop = (efx_nvram_ops_t *)&__efx_nvram_siena_ops;
+		envop = &__efx_nvram_siena_ops;
 		break;
 #endif	/* EFSYS_OPT_SIENA */
 
 #if EFSYS_OPT_HUNTINGTON
 	case EFX_FAMILY_HUNTINGTON:
-		envop = (efx_nvram_ops_t *)&__efx_nvram_ef10_ops;

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606041458.u54EwYiE000940>