mirror of
https://gitlab.com/etherlab.org/ethercat.git
synced 2026-08-18 09:07:24 +08:00
Appiled patches from 2.6.20 to 2.6.22 to e1000 driver.
This commit is contained in:
@@ -69,6 +69,7 @@
|
||||
#include <linux/mii.h>
|
||||
#include <linux/ethtool.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#include "../ecdev.h"
|
||||
|
||||
#define BAR_0 0
|
||||
#define BAR_1 1
|
||||
@@ -82,14 +83,14 @@ struct e1000_adapter;
|
||||
#include "e1000_hw-2.6.22-ethercat.h"
|
||||
|
||||
#ifdef DBG
|
||||
#define E1000_DBG(args...) printk(KERN_DEBUG "e1000: " args)
|
||||
#define E1000_DBG(args...) printk(KERN_DEBUG "ec_e1000: " args)
|
||||
#else
|
||||
#define E1000_DBG(args...)
|
||||
#endif
|
||||
|
||||
#define E1000_ERR(args...) printk(KERN_ERR "e1000: " args)
|
||||
#define E1000_ERR(args...) printk(KERN_ERR "ec_e1000: " args)
|
||||
|
||||
#define PFX "e1000: "
|
||||
#define PFX "ec_e1000: "
|
||||
#define DPRINTK(nlevel, klevel, fmt, args...) \
|
||||
(void)((NETIF_MSG_##nlevel & adapter->msg_enable) && \
|
||||
printk(KERN_##klevel PFX "%s: %s: " fmt, adapter->netdev->name, \
|
||||
@@ -342,6 +343,9 @@ struct e1000_adapter {
|
||||
boolean_t quad_port_a;
|
||||
unsigned long flags;
|
||||
uint32_t eeprom_wol;
|
||||
|
||||
ec_device_t *ecdev;
|
||||
unsigned long ec_watchdog_jiffies;
|
||||
};
|
||||
|
||||
enum e1000_state_t {
|
||||
|
||||
@@ -195,6 +195,9 @@ e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
|
||||
if (adapter->ecdev)
|
||||
return -EBUSY;
|
||||
|
||||
/* When SoL/IDER sessions are active, autoneg/speed/duplex
|
||||
* cannot be changed */
|
||||
if (e1000_check_phy_reset_block(hw)) {
|
||||
@@ -263,6 +266,9 @@ e1000_set_pauseparam(struct net_device *netdev,
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
int retval = 0;
|
||||
|
||||
if (adapter->ecdev)
|
||||
return -EBUSY;
|
||||
|
||||
adapter->fc_autoneg = pause->autoneg;
|
||||
|
||||
while (test_and_set_bit(__E1000_RESETTING, &adapter->flags))
|
||||
@@ -304,6 +310,10 @@ static int
|
||||
e1000_set_rx_csum(struct net_device *netdev, uint32_t data)
|
||||
{
|
||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||
|
||||
if (adapter->ecdev)
|
||||
return -EBUSY;
|
||||
|
||||
adapter->rx_csum = data;
|
||||
|
||||
if (netif_running(netdev))
|
||||
@@ -656,6 +666,9 @@ e1000_set_ringparam(struct net_device *netdev,
|
||||
struct e1000_rx_ring *rxdr, *rx_old;
|
||||
int i, err;
|
||||
|
||||
if (adapter->ecdev)
|
||||
return -EBUSY;
|
||||
|
||||
if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
|
||||
return -EINVAL;
|
||||
|
||||
@@ -1624,7 +1637,12 @@ e1000_diag_test(struct net_device *netdev,
|
||||
struct ethtool_test *eth_test, uint64_t *data)
|
||||
{
|
||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||
boolean_t if_running = netif_running(netdev);
|
||||
boolean_t if_running;
|
||||
|
||||
if (adapter->ecdev)
|
||||
return;
|
||||
|
||||
if_running = netif_running(netdev);
|
||||
|
||||
set_bit(__E1000_TESTING, &adapter->flags);
|
||||
if (eth_test->flags == ETH_TEST_FL_OFFLINE) {
|
||||
@@ -1891,6 +1909,10 @@ static int
|
||||
e1000_nway_reset(struct net_device *netdev)
|
||||
{
|
||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||
|
||||
if (adapter->ecdev)
|
||||
return -EBUSY;
|
||||
|
||||
if (netif_running(netdev))
|
||||
e1000_reinit_locked(adapter);
|
||||
return 0;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user