Deleted Added
full compact
efx_mac.c (294253) efx_mac.c (299320)
1/*-
2 * Copyright (c) 2007-2015 Solarflare Communications Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,

--- 15 unchanged lines hidden (view full) ---

24 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * The views and conclusions contained in the software and documentation are
27 * those of the authors and should not be interpreted as representing official
28 * policies, either expressed or implied, of the FreeBSD Project.
29 */
30
31#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2007-2015 Solarflare Communications Inc.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice,

--- 15 unchanged lines hidden (view full) ---

24 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * The views and conclusions contained in the software and documentation are
27 * those of the authors and should not be interpreted as representing official
28 * policies, either expressed or implied, of the FreeBSD Project.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/efx_mac.c 294253 2016-01-18 06:19:28Z arybchik $");
32__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/efx_mac.c 299320 2016-05-10 07:01:06Z arybchik $");
33
34#include "efx.h"
35#include "efx_impl.h"
36
37#if EFSYS_OPT_MAC_FALCON_GMAC
38#include "falcon_gmac.h"
39#endif
40
41#if EFSYS_OPT_MAC_FALCON_XMAC
42#include "falcon_xmac.h"
43#endif
44
33
34#include "efx.h"
35#include "efx_impl.h"
36
37#if EFSYS_OPT_MAC_FALCON_GMAC
38#include "falcon_gmac.h"
39#endif
40
41#if EFSYS_OPT_MAC_FALCON_XMAC
42#include "falcon_xmac.h"
43#endif
44
45#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
45#if EFSYS_OPT_SIENA
46
47static __checkReturn efx_rc_t
48falconsiena_mac_multicast_list_set(
49 __in efx_nic_t *enp);
50
46
47static __checkReturn efx_rc_t
48falconsiena_mac_multicast_list_set(
49 __in efx_nic_t *enp);
50
51#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
51#endif /* EFSYS_OPT_SIENA */
52
53#if EFSYS_OPT_MAC_FALCON_GMAC
54static efx_mac_ops_t __efx_falcon_gmac_ops = {
55 falcon_gmac_reset, /* emo_reset */
56 falcon_mac_poll, /* emo_poll */
57 falcon_mac_up, /* emo_up */
58 falcon_gmac_reconfigure, /* emo_addr_set */
59 falcon_gmac_reconfigure, /* emo_pdu_set */

--- 747 unchanged lines hidden (view full) ---

807
808#if EFSYS_OPT_MEDFORD
809 if (enp->en_family == EFX_FAMILY_MEDFORD) {
810 type = EFX_MAC_MEDFORD;
811 goto chosen;
812 }
813#endif
814
52
53#if EFSYS_OPT_MAC_FALCON_GMAC
54static efx_mac_ops_t __efx_falcon_gmac_ops = {
55 falcon_gmac_reset, /* emo_reset */
56 falcon_mac_poll, /* emo_poll */
57 falcon_mac_up, /* emo_up */
58 falcon_gmac_reconfigure, /* emo_addr_set */
59 falcon_gmac_reconfigure, /* emo_pdu_set */

--- 747 unchanged lines hidden (view full) ---

807
808#if EFSYS_OPT_MEDFORD
809 if (enp->en_family == EFX_FAMILY_MEDFORD) {
810 type = EFX_MAC_MEDFORD;
811 goto chosen;
812 }
813#endif
814
815#if EFSYS_OPT_FALCON
816 switch (epp->ep_link_mode) {
817#if EFSYS_OPT_MAC_FALCON_GMAC
818 case EFX_LINK_100HDX:
819 case EFX_LINK_100FDX:
820 case EFX_LINK_1000HDX:
821 case EFX_LINK_1000FDX:
822 type = EFX_MAC_FALCON_GMAC;
823 goto chosen;
824#endif /* EFSYS_OPT_FALCON_GMAC */
825
826#if EFSYS_OPT_MAC_FALCON_XMAC
827 case EFX_LINK_10000FDX:
828 type = EFX_MAC_FALCON_XMAC;
829 goto chosen;
830#endif /* EFSYS_OPT_FALCON_XMAC */
831
832 default:
833#if EFSYS_OPT_MAC_FALCON_GMAC && EFSYS_OPT_MAC_FALCON_XMAC
834 /* Only initialise a MAC supported by the PHY */
835 if (epp->ep_phy_cap_mask &
836 ((1 << EFX_PHY_CAP_1000FDX) |
837 (1 << EFX_PHY_CAP_1000HDX) |
838 (1 << EFX_PHY_CAP_100FDX) |
839 (1 << EFX_PHY_CAP_100HDX) |
840 (1 << EFX_PHY_CAP_10FDX) |
841 (1 << EFX_PHY_CAP_10FDX)))
842 type = EFX_MAC_FALCON_GMAC;
843 else
844 type = EFX_MAC_FALCON_XMAC;
845#elif EFSYS_OPT_MAC_FALCON_GMAC
846 type = EFX_MAC_FALCON_GMAC;
847#else
848 type = EFX_MAC_FALCON_XMAC;
849#endif
850 goto chosen;
851 }
852#endif /* EFSYS_OPT_FALCON */
853
854chosen:
855 EFSYS_ASSERT(type != EFX_MAC_INVALID);
856 EFSYS_ASSERT3U(type, <, EFX_MAC_NTYPES);
857 emop = epp->ep_emop = (efx_mac_ops_t *)__efx_mac_ops[type];
858 EFSYS_ASSERT(emop != NULL);
859
860 epp->ep_mac_type = type;
861

--- 9 unchanged lines hidden (view full) ---

871
872fail1:
873 EFSYS_PROBE1(fail1, efx_rc_t, rc);
874
875 return (rc);
876}
877
878
815chosen:
816 EFSYS_ASSERT(type != EFX_MAC_INVALID);
817 EFSYS_ASSERT3U(type, <, EFX_MAC_NTYPES);
818 emop = epp->ep_emop = (efx_mac_ops_t *)__efx_mac_ops[type];
819 EFSYS_ASSERT(emop != NULL);
820
821 epp->ep_mac_type = type;
822

--- 9 unchanged lines hidden (view full) ---

832
833fail1:
834 EFSYS_PROBE1(fail1, efx_rc_t, rc);
835
836 return (rc);
837}
838
839
879#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
840#if EFSYS_OPT_SIENA
880
881#define EFX_MAC_HASH_BITS (1 << 8)
882
883/* Compute the multicast hash as used on Falcon and Siena. */
884static void
885falconsiena_mac_multicast_hash_compute(
886 __in_ecount(6*count) uint8_t const *addrs,
887 __in int count,

--- 50 unchanged lines hidden (view full) ---

938fail1:
939 EFSYS_PROBE1(fail1, efx_rc_t, rc);
940
941 memcpy(epp->ep_multicst_hash, old_hash, sizeof (old_hash));
942
943 return (rc);
944}
945
841
842#define EFX_MAC_HASH_BITS (1 << 8)
843
844/* Compute the multicast hash as used on Falcon and Siena. */
845static void
846falconsiena_mac_multicast_hash_compute(
847 __in_ecount(6*count) uint8_t const *addrs,
848 __in int count,

--- 50 unchanged lines hidden (view full) ---

899fail1:
900 EFSYS_PROBE1(fail1, efx_rc_t, rc);
901
902 memcpy(epp->ep_multicst_hash, old_hash, sizeof (old_hash));
903
904 return (rc);
905}
906
946#endif /* EFSYS_OPT_FALCON || EFSYS_OPT_SIENA */
907#endif /* EFSYS_OPT_SIENA */