Skip to content

Commit

Permalink
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/…
Browse files Browse the repository at this point in the history
…jkirsher/net-next-2.6
  • Loading branch information
David S. Miller committed Jan 24, 2011
2 parents 2362493 + 6493d24 commit b6f4098
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 76 deletions.
5 changes: 4 additions & 1 deletion drivers/net/e1000e/e1000.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ struct e1000_adapter {
/* structs defined in e1000_hw.h */
struct e1000_hw hw;

spinlock_t stats64_lock;
struct e1000_hw_stats stats;
struct e1000_phy_info phy_info;
struct e1000_phy_stats phy_stats;
Expand Down Expand Up @@ -494,7 +495,9 @@ extern int e1000e_setup_rx_resources(struct e1000_adapter *adapter);
extern int e1000e_setup_tx_resources(struct e1000_adapter *adapter);
extern void e1000e_free_rx_resources(struct e1000_adapter *adapter);
extern void e1000e_free_tx_resources(struct e1000_adapter *adapter);
extern void e1000e_update_stats(struct e1000_adapter *adapter);
extern struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev,
struct rtnl_link_stats64
*stats);
extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter);
extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter);
extern void e1000e_get_hw_control(struct e1000_adapter *adapter);
Expand Down
52 changes: 22 additions & 30 deletions drivers/net/e1000e/ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ struct e1000_stats {
};

#define E1000_STAT(str, m) { \
.stat_string = str, \
.type = E1000_STATS, \
.sizeof_stat = sizeof(((struct e1000_adapter *)0)->m), \
.stat_offset = offsetof(struct e1000_adapter, m) }
.stat_string = str, \
.type = E1000_STATS, \
.sizeof_stat = sizeof(((struct e1000_adapter *)0)->m), \
.stat_offset = offsetof(struct e1000_adapter, m) }
#define E1000_NETDEV_STAT(str, m) { \
.stat_string = str, \
.type = NETDEV_STATS, \
.sizeof_stat = sizeof(((struct net_device *)0)->m), \
.stat_offset = offsetof(struct net_device, m) }
.stat_string = str, \
.type = NETDEV_STATS, \
.sizeof_stat = sizeof(((struct rtnl_link_stats64 *)0)->m), \
.stat_offset = offsetof(struct rtnl_link_stats64, m) }

static const struct e1000_stats e1000_gstrings_stats[] = {
E1000_STAT("rx_packets", stats.gprc),
Expand All @@ -65,21 +65,21 @@ static const struct e1000_stats e1000_gstrings_stats[] = {
E1000_STAT("tx_broadcast", stats.bptc),
E1000_STAT("rx_multicast", stats.mprc),
E1000_STAT("tx_multicast", stats.mptc),
E1000_NETDEV_STAT("rx_errors", stats.rx_errors),
E1000_NETDEV_STAT("tx_errors", stats.tx_errors),
E1000_NETDEV_STAT("tx_dropped", stats.tx_dropped),
E1000_NETDEV_STAT("rx_errors", rx_errors),
E1000_NETDEV_STAT("tx_errors", tx_errors),
E1000_NETDEV_STAT("tx_dropped", tx_dropped),
E1000_STAT("multicast", stats.mprc),
E1000_STAT("collisions", stats.colc),
E1000_NETDEV_STAT("rx_length_errors", stats.rx_length_errors),
E1000_NETDEV_STAT("rx_over_errors", stats.rx_over_errors),
E1000_NETDEV_STAT("rx_length_errors", rx_length_errors),
E1000_NETDEV_STAT("rx_over_errors", rx_over_errors),
E1000_STAT("rx_crc_errors", stats.crcerrs),
E1000_NETDEV_STAT("rx_frame_errors", stats.rx_frame_errors),
E1000_NETDEV_STAT("rx_frame_errors", rx_frame_errors),
E1000_STAT("rx_no_buffer_count", stats.rnbc),
E1000_STAT("rx_missed_errors", stats.mpc),
E1000_STAT("tx_aborted_errors", stats.ecol),
E1000_STAT("tx_carrier_errors", stats.tncrs),
E1000_NETDEV_STAT("tx_fifo_errors", stats.tx_fifo_errors),
E1000_NETDEV_STAT("tx_heartbeat_errors", stats.tx_heartbeat_errors),
E1000_NETDEV_STAT("tx_fifo_errors", tx_fifo_errors),
E1000_NETDEV_STAT("tx_heartbeat_errors", tx_heartbeat_errors),
E1000_STAT("tx_window_errors", stats.latecol),
E1000_STAT("tx_abort_late_coll", stats.latecol),
E1000_STAT("tx_deferred_ok", stats.dc),
Expand Down Expand Up @@ -684,20 +684,13 @@ static int e1000_set_ringparam(struct net_device *netdev,
rx_old = adapter->rx_ring;

err = -ENOMEM;
tx_ring = kzalloc(sizeof(struct e1000_ring), GFP_KERNEL);
tx_ring = kmemdup(tx_old, sizeof(struct e1000_ring), GFP_KERNEL);
if (!tx_ring)
goto err_alloc_tx;
/*
* use a memcpy to save any previously configured
* items like napi structs from having to be
* reinitialized
*/
memcpy(tx_ring, tx_old, sizeof(struct e1000_ring));

rx_ring = kzalloc(sizeof(struct e1000_ring), GFP_KERNEL);
rx_ring = kmemdup(rx_old, sizeof(struct e1000_ring), GFP_KERNEL);
if (!rx_ring)
goto err_alloc_rx;
memcpy(rx_ring, rx_old, sizeof(struct e1000_ring));

adapter->tx_ring = tx_ring;
adapter->rx_ring = rx_ring;
Expand Down Expand Up @@ -1255,7 +1248,6 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
{
struct e1000_hw *hw = &adapter->hw;
u32 ctrl_reg = 0;
u32 stat_reg = 0;
u16 phy_reg = 0;
s32 ret_val = 0;

Expand Down Expand Up @@ -1363,8 +1355,7 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
* Set the ILOS bit on the fiber Nic if half duplex link is
* detected.
*/
stat_reg = er32(STATUS);
if ((stat_reg & E1000_STATUS_FD) == 0)
if ((er32(STATUS) & E1000_STATUS_FD) == 0)
ctrl_reg |= (E1000_CTRL_ILOS | E1000_CTRL_SLU);
}

Expand Down Expand Up @@ -1982,14 +1973,15 @@ static void e1000_get_ethtool_stats(struct net_device *netdev,
u64 *data)
{
struct e1000_adapter *adapter = netdev_priv(netdev);
struct rtnl_link_stats64 net_stats;
int i;
char *p = NULL;

e1000e_update_stats(adapter);
e1000e_get_stats64(netdev, &net_stats);
for (i = 0; i < E1000_GLOBAL_STATS_LEN; i++) {
switch (e1000_gstrings_stats[i].type) {
case NETDEV_STATS:
p = (char *) netdev +
p = (char *) &net_stats +
e1000_gstrings_stats[i].stat_offset;
break;
case E1000_STATS:
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/e1000e/ich8lan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2104,7 +2104,6 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
{
union ich8_hws_flash_status hsfsts;
s32 ret_val = -E1000_ERR_NVM;
s32 i = 0;

hsfsts.regval = er16flash(ICH_FLASH_HSFSTS);

Expand Down Expand Up @@ -2140,6 +2139,8 @@ static s32 e1000_flash_cycle_init_ich8lan(struct e1000_hw *hw)
ew16flash(ICH_FLASH_HSFSTS, hsfsts.regval);
ret_val = 0;
} else {
s32 i = 0;

/*
* Otherwise poll for sometime so the current
* cycle has a chance to end before giving up.
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/e1000e/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1978,15 +1978,15 @@ static s32 e1000_ready_nvm_eeprom(struct e1000_hw *hw)
{
struct e1000_nvm_info *nvm = &hw->nvm;
u32 eecd = er32(EECD);
u16 timeout = 0;
u8 spi_stat_reg;

if (nvm->type == e1000_nvm_eeprom_spi) {
u16 timeout = NVM_MAX_RETRY_SPI;

/* Clear SK and CS */
eecd &= ~(E1000_EECD_CS | E1000_EECD_SK);
ew32(EECD, eecd);
udelay(1);
timeout = NVM_MAX_RETRY_SPI;

/*
* Read "Status Register" repeatedly until the LSB is cleared.
Expand Down
Loading

0 comments on commit b6f4098

Please sign in to comment.