Deleted Added
full compact
if_em.c (235527) if_em.c (238262)
1/******************************************************************************
2
3 Copyright (c) 2001-2011, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

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

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32******************************************************************************/
1/******************************************************************************
2
3 Copyright (c) 2001-2011, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

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

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32******************************************************************************/
33/*$FreeBSD: stable/9/sys/dev/e1000/if_em.c 235527 2012-05-16 22:22:52Z jfv $*/
33/*$FreeBSD: stable/9/sys/dev/e1000/if_em.c 238262 2012-07-08 20:35:56Z jfv $*/
34
35#ifdef HAVE_KERNEL_OPTION_HEADERS
36#include "opt_device_polling.h"
37#include "opt_inet.h"
38#include "opt_inet6.h"
39#endif
40
41#include <sys/param.h>

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

284static void em_msix_link(void *);
285static void em_handle_tx(void *context, int pending);
286static void em_handle_rx(void *context, int pending);
287static void em_handle_link(void *context, int pending);
288
289static void em_set_sysctl_value(struct adapter *, const char *,
290 const char *, int *, int);
291static int em_set_flowcntl(SYSCTL_HANDLER_ARGS);
34
35#ifdef HAVE_KERNEL_OPTION_HEADERS
36#include "opt_device_polling.h"
37#include "opt_inet.h"
38#include "opt_inet6.h"
39#endif
40
41#include <sys/param.h>

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

284static void em_msix_link(void *);
285static void em_handle_tx(void *context, int pending);
286static void em_handle_rx(void *context, int pending);
287static void em_handle_link(void *context, int pending);
288
289static void em_set_sysctl_value(struct adapter *, const char *,
290 const char *, int *, int);
291static int em_set_flowcntl(SYSCTL_HANDLER_ARGS);
292static int em_sysctl_eee(SYSCTL_HANDLER_ARGS);
292
293static __inline void em_rx_discard(struct rx_ring *, int);
294
295#ifdef DEVICE_POLLING
296static poll_handler_t em_poll;
297#endif /* POLLING */
298
299/*********************************************************************

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

384static int em_rx_process_limit = 100;
385TUNABLE_INT("hw.em.rx_process_limit", &em_rx_process_limit);
386SYSCTL_INT(_hw_em, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN,
387 &em_rx_process_limit, 0,
388 "Maximum number of received packets to process "
389 "at a time, -1 means unlimited");
390
391/* Energy efficient ethernet - default to OFF */
293
294static __inline void em_rx_discard(struct rx_ring *, int);
295
296#ifdef DEVICE_POLLING
297static poll_handler_t em_poll;
298#endif /* POLLING */
299
300/*********************************************************************

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

385static int em_rx_process_limit = 100;
386TUNABLE_INT("hw.em.rx_process_limit", &em_rx_process_limit);
387SYSCTL_INT(_hw_em, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN,
388 &em_rx_process_limit, 0,
389 "Maximum number of received packets to process "
390 "at a time, -1 means unlimited");
391
392/* Energy efficient ethernet - default to OFF */
392static int eee_setting = 0;
393static int eee_setting = 1;
393TUNABLE_INT("hw.em.eee_setting", &eee_setting);
394SYSCTL_INT(_hw_em, OID_AUTO, eee_setting, CTLFLAG_RDTUN, &eee_setting, 0,
395 "Enable Energy Efficient Ethernet");
396
397/* Global used in WOL setup with multiport cards */
398static int global_quad_port_a = 0;
399
400#ifdef DEV_NETMAP /* see ixgbe.c for details */

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

631 }
632
633 /* Check SOL/IDER usage */
634 if (e1000_check_reset_block(hw))
635 device_printf(dev, "PHY reset is blocked"
636 " due to SOL/IDER session.\n");
637
638 /* Sysctl for setting Energy Efficient Ethernet */
394TUNABLE_INT("hw.em.eee_setting", &eee_setting);
395SYSCTL_INT(_hw_em, OID_AUTO, eee_setting, CTLFLAG_RDTUN, &eee_setting, 0,
396 "Enable Energy Efficient Ethernet");
397
398/* Global used in WOL setup with multiport cards */
399static int global_quad_port_a = 0;
400
401#ifdef DEV_NETMAP /* see ixgbe.c for details */

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

632 }
633
634 /* Check SOL/IDER usage */
635 if (e1000_check_reset_block(hw))
636 device_printf(dev, "PHY reset is blocked"
637 " due to SOL/IDER session.\n");
638
639 /* Sysctl for setting Energy Efficient Ethernet */
639 em_set_sysctl_value(adapter, "eee_control",
640 "enable Energy Efficient Ethernet",
641 &hw->dev_spec.ich8lan.eee_disable, eee_setting);
640 hw->dev_spec.ich8lan.eee_disable = eee_setting;
641 SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
642 SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
643 OID_AUTO, "eee_control", CTLTYPE_INT|CTLFLAG_RW,
644 adapter, 0, em_sysctl_eee, "I",
645 "Disable Energy Efficient Ethernet");
642
643 /*
644 ** Start from a known state, this is
645 ** important in reading the nvm and
646 ** mac from that.
647 */
648 e1000_reset_hw(hw);
649

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

5690 return (error);
5691 }
5692
5693 adapter->hw.fc.current_mode = adapter->hw.fc.requested_mode;
5694 e1000_force_mac_fc(&adapter->hw);
5695 return (error);
5696}
5697
646
647 /*
648 ** Start from a known state, this is
649 ** important in reading the nvm and
650 ** mac from that.
651 */
652 e1000_reset_hw(hw);
653

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

5694 return (error);
5695 }
5696
5697 adapter->hw.fc.current_mode = adapter->hw.fc.requested_mode;
5698 e1000_force_mac_fc(&adapter->hw);
5699 return (error);
5700}
5701
5702/*
5703** Manage Energy Efficient Ethernet:
5704** Control values:
5705** 0/1 - enabled/disabled
5706*/
5707static int
5708em_sysctl_eee(SYSCTL_HANDLER_ARGS)
5709{
5710 struct adapter *adapter = (struct adapter *) arg1;
5711 int error, value;
5698
5712
5713 value = adapter->hw.dev_spec.ich8lan.eee_disable;
5714 error = sysctl_handle_int(oidp, &value, 0, req);
5715 if (error || req->newptr == NULL)
5716 return (error);
5717 EM_CORE_LOCK(adapter);
5718 adapter->hw.dev_spec.ich8lan.eee_disable = (value != 0);
5719 em_init_locked(adapter);
5720 EM_CORE_UNLOCK(adapter);
5721 return (0);
5722}
5723
5699static int
5700em_sysctl_debug_info(SYSCTL_HANDLER_ARGS)
5701{
5702 struct adapter *adapter;
5703 int error;
5704 int result;
5705
5706 result = -1;

--- 50 unchanged lines hidden ---
5724static int
5725em_sysctl_debug_info(SYSCTL_HANDLER_ARGS)
5726{
5727 struct adapter *adapter;
5728 int error;
5729 int result;
5730
5731 result = -1;

--- 50 unchanged lines hidden ---