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

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

19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
1/*-
2 * Copyright 2007-2009 Solarflare Communications Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

19 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 * SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
27__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/efx_rx.c 228078 2011-11-28 17:19:05Z philip $");
27__FBSDID("$FreeBSD: head/sys/dev/sfxge/common/efx_rx.c 278839 2015-02-16 06:12:04Z arybchik $");
28
29#include "efsys.h"
30#include "efx.h"
31#include "efx_types.h"
32#include "efx_regs.h"
33#include "efx_impl.h"
34
35 __checkReturn int

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

522efx_rx_filter_insert(
523 __in efx_rxq_t *erp,
524 __inout efx_filter_spec_t *spec)
525{
526 EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
527 EFSYS_ASSERT3P(spec, !=, NULL);
528
529 spec->efs_dmaq_id = (uint16_t)erp->er_index;
28
29#include "efsys.h"
30#include "efx.h"
31#include "efx_types.h"
32#include "efx_regs.h"
33#include "efx_impl.h"
34
35 __checkReturn int

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

522efx_rx_filter_insert(
523 __in efx_rxq_t *erp,
524 __inout efx_filter_spec_t *spec)
525{
526 EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
527 EFSYS_ASSERT3P(spec, !=, NULL);
528
529 spec->efs_dmaq_id = (uint16_t)erp->er_index;
530 return efx_filter_insert_filter(erp->er_enp, spec, B_FALSE);
530 return (efx_filter_insert_filter(erp->er_enp, spec, B_FALSE));
531}
532#endif
533
534#if EFSYS_OPT_FILTER
535extern __checkReturn int
536efx_rx_filter_remove(
537 __in efx_rxq_t *erp,
538 __inout efx_filter_spec_t *spec)
539{
540 EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
541 EFSYS_ASSERT3P(spec, !=, NULL);
542
543 spec->efs_dmaq_id = (uint16_t)erp->er_index;
531}
532#endif
533
534#if EFSYS_OPT_FILTER
535extern __checkReturn int
536efx_rx_filter_remove(
537 __in efx_rxq_t *erp,
538 __inout efx_filter_spec_t *spec)
539{
540 EFSYS_ASSERT3U(erp->er_magic, ==, EFX_RXQ_MAGIC);
541 EFSYS_ASSERT3P(spec, !=, NULL);
542
543 spec->efs_dmaq_id = (uint16_t)erp->er_index;
544 return efx_filter_remove_filter(erp->er_enp, spec);
544 return (efx_filter_remove_filter(erp->er_enp, spec));
545}
546#endif
547
548extern void
549efx_rx_qpost(
550 __in efx_rxq_t *erp,
551 __in_ecount(n) efsys_dma_addr_t *addrp,
552 __in size_t size,

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

668 uint32_t size;
669 boolean_t split;
670 boolean_t jumbo;
671 int rc;
672
673 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
674 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
675
545}
546#endif
547
548extern void
549efx_rx_qpost(
550 __in efx_rxq_t *erp,
551 __in_ecount(n) efsys_dma_addr_t *addrp,
552 __in size_t size,

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

668 uint32_t size;
669 boolean_t split;
670 boolean_t jumbo;
671 int rc;
672
673 EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
674 EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_RX);
675
676 EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS == (1 << FRF_AZ_RX_DESCQ_LABEL_WIDTH));
676 EFX_STATIC_ASSERT(EFX_EV_RX_NLABELS ==
677 (1 << FRF_AZ_RX_DESCQ_LABEL_WIDTH));
677 EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS);
678 EFSYS_ASSERT3U(enp->en_rx_qcount + 1, <, encp->enc_rxq_limit);
679
680 if (!ISP2(n) || !(n & EFX_RXQ_NDESCS_MASK)) {
681 rc = EINVAL;
682 goto fail1;
683 }
684 if (index >= encp->enc_rxq_limit) {

--- 135 unchanged lines hidden ---
678 EFSYS_ASSERT3U(label, <, EFX_EV_RX_NLABELS);
679 EFSYS_ASSERT3U(enp->en_rx_qcount + 1, <, encp->enc_rxq_limit);
680
681 if (!ISP2(n) || !(n & EFX_RXQ_NDESCS_MASK)) {
682 rc = EINVAL;
683 goto fail1;
684 }
685 if (index >= encp->enc_rxq_limit) {

--- 135 unchanged lines hidden ---