Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265940
b: refs/heads/master
c: d7ccb8c
h: refs/heads/master
v: v3
  • Loading branch information
Michał Mirosław authored and Jeff Kirsher committed Sep 17, 2011
1 parent cbb08ba commit e000f58
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 62 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f78a5fda9116525809d088917638be912b85f838
refs/heads/master: d7ccb8c2f2f73a9fcdb8fb0f3bcdd09746f3a9ef
2 changes: 2 additions & 0 deletions trunk/drivers/net/ethernet/intel/ixgb/ixgb.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ extern void ixgb_set_ethtool_ops(struct net_device *netdev);
extern char ixgb_driver_name[];
extern const char ixgb_driver_version[];

extern void ixgb_set_speed_duplex(struct net_device *netdev);

extern int ixgb_up(struct ixgb_adapter *adapter);
extern void ixgb_down(struct ixgb_adapter *adapter, bool kill_watchdog);
extern void ixgb_reset(struct ixgb_adapter *adapter);
Expand Down
59 changes: 1 addition & 58 deletions trunk/drivers/net/ethernet/intel/ixgb/ixgb_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ ixgb_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
return 0;
}

static void ixgb_set_speed_duplex(struct net_device *netdev)
void ixgb_set_speed_duplex(struct net_device *netdev)
{
struct ixgb_adapter *adapter = netdev_priv(netdev);
/* be optimistic about our link, since we were up before */
Expand Down Expand Up @@ -194,57 +194,6 @@ ixgb_set_pauseparam(struct net_device *netdev,
return 0;
}

static u32
ixgb_get_rx_csum(struct net_device *netdev)
{
struct ixgb_adapter *adapter = netdev_priv(netdev);

return adapter->rx_csum;
}

static int
ixgb_set_rx_csum(struct net_device *netdev, u32 data)
{
struct ixgb_adapter *adapter = netdev_priv(netdev);

adapter->rx_csum = data;

if (netif_running(netdev)) {
ixgb_down(adapter, true);
ixgb_up(adapter);
ixgb_set_speed_duplex(netdev);
} else
ixgb_reset(adapter);
return 0;
}

static u32
ixgb_get_tx_csum(struct net_device *netdev)
{
return (netdev->features & NETIF_F_HW_CSUM) != 0;
}

static int
ixgb_set_tx_csum(struct net_device *netdev, u32 data)
{
if (data)
netdev->features |= NETIF_F_HW_CSUM;
else
netdev->features &= ~NETIF_F_HW_CSUM;

return 0;
}

static int
ixgb_set_tso(struct net_device *netdev, u32 data)
{
if (data)
netdev->features |= NETIF_F_TSO;
else
netdev->features &= ~NETIF_F_TSO;
return 0;
}

static u32
ixgb_get_msglevel(struct net_device *netdev)
{
Expand Down Expand Up @@ -736,14 +685,8 @@ static const struct ethtool_ops ixgb_ethtool_ops = {
.set_ringparam = ixgb_set_ringparam,
.get_pauseparam = ixgb_get_pauseparam,
.set_pauseparam = ixgb_set_pauseparam,
.get_rx_csum = ixgb_get_rx_csum,
.set_rx_csum = ixgb_set_rx_csum,
.get_tx_csum = ixgb_get_tx_csum,
.set_tx_csum = ixgb_set_tx_csum,
.set_sg = ethtool_op_set_sg,
.get_msglevel = ixgb_get_msglevel,
.set_msglevel = ixgb_set_msglevel,
.set_tso = ixgb_set_tso,
.get_strings = ixgb_get_strings,
.set_phys_id = ixgb_set_phys_id,
.get_sset_count = ixgb_get_sset_count,
Expand Down
31 changes: 28 additions & 3 deletions trunk/drivers/net/ethernet/intel/ixgb/ixgb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,28 @@ ixgb_reset(struct ixgb_adapter *adapter)
}
}

static int
ixgb_set_features(struct net_device *netdev, u32 features)
{
struct ixgb_adapter *adapter = netdev_priv(netdev);
u32 changed = features ^ netdev->features;

if (!(changed & NETIF_F_RXCSUM))
return 0;

adapter->rx_csum = !!(features & NETIF_F_RXCSUM);

if (netif_running(netdev)) {
ixgb_down(adapter, true);
ixgb_up(adapter);
ixgb_set_speed_duplex(netdev);
} else
ixgb_reset(adapter);

return 0;
}


static const struct net_device_ops ixgb_netdev_ops = {
.ndo_open = ixgb_open,
.ndo_stop = ixgb_close,
Expand All @@ -340,6 +362,7 @@ static const struct net_device_ops ixgb_netdev_ops = {
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = ixgb_netpoll,
#endif
.ndo_set_features = ixgb_set_features,
};

/**
Expand Down Expand Up @@ -439,12 +462,14 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (err)
goto err_sw_init;

netdev->features = NETIF_F_SG |
NETIF_F_HW_CSUM |
netdev->hw_features = NETIF_F_SG |
NETIF_F_TSO |
NETIF_F_HW_CSUM;
netdev->features = netdev->hw_features |
NETIF_F_HW_VLAN_TX |
NETIF_F_HW_VLAN_RX |
NETIF_F_HW_VLAN_FILTER;
netdev->features |= NETIF_F_TSO;
netdev->hw_features |= NETIF_F_RXCSUM;

if (pci_using_dac) {
netdev->features |= NETIF_F_HIGHDMA;
Expand Down

0 comments on commit e000f58

Please sign in to comment.