diff --git a/NEWS b/NEWS index 9063a44e..bcf238e2 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ $Id$ +vim: spelllang=en spell + ------------------------------------------------------------------------------- Changes since 1.4.0: @@ -27,7 +29,9 @@ Changes since 1.4.0-rc3: * Fixed a kernel oops when a slave configuration is detached while the actual configuration is in progress. * Fixed typo in logging output. -* Removed bashisms from init script. +* Removed 'bashisms' from init script ('function' keyword). +* Fixed bug in e1000 drivers. Memory was allocated when sending the first + frame. Changes in 1.4.0-rc3: diff --git a/devices/e1000/e1000_main-2.6.13-ethercat.c b/devices/e1000/e1000_main-2.6.13-ethercat.c index 1ab075ab..430d7c04 100644 --- a/devices/e1000/e1000_main-2.6.13-ethercat.c +++ b/devices/e1000/e1000_main-2.6.13-ethercat.c @@ -24,6 +24,8 @@ Linux NICS Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + vim: noexpandtab + *******************************************************************************/ #include "e1000-2.6.13-ethercat.h" diff --git a/devices/e1000/e1000_main-2.6.18-ethercat.c b/devices/e1000/e1000_main-2.6.18-ethercat.c index 64175776..e5626552 100644 --- a/devices/e1000/e1000_main-2.6.18-ethercat.c +++ b/devices/e1000/e1000_main-2.6.18-ethercat.c @@ -25,6 +25,8 @@ e1000-devel Mailing List Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + vim: noexpandtab + *******************************************************************************/ #include "e1000-2.6.18-ethercat.h" @@ -465,8 +467,14 @@ e1000_up(struct e1000_adapter *adapter) * next_to_use != next_to_clean */ for (i = 0; i < adapter->num_rx_queues; i++) { struct e1000_rx_ring *ring = &adapter->rx_ring[i]; - adapter->alloc_rx_buf(adapter, ring, - E1000_DESC_UNUSED(ring)); + if (adapter->ecdev) { + /* fill rx ring completely! */ + adapter->alloc_rx_buf(adapter, ring, ring->count); + } else { + /* this one leaves the last ring element unallocated! */ + adapter->alloc_rx_buf(adapter, ring, + E1000_DESC_UNUSED(ring)); + } } adapter->tx_queue_len = netdev->tx_queue_len; @@ -2170,7 +2178,14 @@ e1000_leave_82542_rst(struct e1000_adapter *adapter) /* No need to loop, because 82542 supports only 1 queue */ struct e1000_rx_ring *ring = &adapter->rx_ring[0]; e1000_configure_rx(adapter); - adapter->alloc_rx_buf(adapter, ring, E1000_DESC_UNUSED(ring)); + if (adapter->ecdev) { + /* fill rx ring completely! */ + adapter->alloc_rx_buf(adapter, ring, ring->count); + } else { + /* this one leaves the last ring element unallocated! */ + adapter->alloc_rx_buf(adapter, ring, E1000_DESC_UNUSED(ring)); + } + } } diff --git a/devices/e1000/e1000_main-2.6.20-ethercat.c b/devices/e1000/e1000_main-2.6.20-ethercat.c index 0c5cdf64..3d19274d 100644 --- a/devices/e1000/e1000_main-2.6.20-ethercat.c +++ b/devices/e1000/e1000_main-2.6.20-ethercat.c @@ -23,6 +23,8 @@ Linux NICS e1000-devel Mailing List Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + + vim: noexpandtab *******************************************************************************/ @@ -557,8 +559,14 @@ e1000_up(struct e1000_adapter *adapter) * next_to_use != next_to_clean */ for (i = 0; i < adapter->num_rx_queues; i++) { struct e1000_rx_ring *ring = &adapter->rx_ring[i]; - adapter->alloc_rx_buf(adapter, ring, - E1000_DESC_UNUSED(ring)); + if (adapter->ecdev) { + /* fill rx ring completely! */ + adapter->alloc_rx_buf(adapter, ring, ring->count); + } else { + /* this one leaves the last ring element unallocated! */ + adapter->alloc_rx_buf(adapter, ring, + E1000_DESC_UNUSED(ring)); + } } adapter->tx_queue_len = netdev->tx_queue_len; @@ -2395,7 +2403,14 @@ e1000_leave_82542_rst(struct e1000_adapter *adapter) /* No need to loop, because 82542 supports only 1 queue */ struct e1000_rx_ring *ring = &adapter->rx_ring[0]; e1000_configure_rx(adapter); - adapter->alloc_rx_buf(adapter, ring, E1000_DESC_UNUSED(ring)); + if (adapter->ecdev) { + /* fill rx ring completely! */ + adapter->alloc_rx_buf(adapter, ring, ring->count); + } else { + /* this one leaves the last ring element unallocated! */ + adapter->alloc_rx_buf(adapter, ring, E1000_DESC_UNUSED(ring)); + } + } } @@ -3856,11 +3871,11 @@ irqreturn_t e1000_intr_msi(int irq, void *data) struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; int i; -#ifdef CONFIG_E1000_NAPI - int ec_work_done = 0; -#endif if (adapter->ecdev) { +#ifdef CONFIG_E1000_NAPI + int ec_work_done = 0; +#endif for (i = 0; i < E1000_MAX_INTR; i++) #ifdef CONFIG_E1000_NAPI if (unlikely(!adapter->clean_rx(adapter, adapter->rx_ring, @@ -3959,9 +3974,6 @@ e1000_intr(int irq, void *data) struct e1000_hw *hw = &adapter->hw; uint32_t rctl, icr = E1000_READ_REG(hw, ICR); int i; -#ifdef CONFIG_E1000_NAPI - int ec_work_done = 0; -#endif if (unlikely(!icr)) return IRQ_NONE; /* Not our interrupt */ @@ -3999,6 +4011,9 @@ e1000_intr(int irq, void *data) } if (adapter->ecdev) { +#ifdef CONFIG_E1000_NAPI + int ec_work_done = 0; +#endif for (i = 0; i < E1000_MAX_INTR; i++) #ifdef CONFIG_E1000_NAPI if (unlikely(!adapter->clean_rx(adapter, adapter->rx_ring, diff --git a/devices/e1000/e1000_main-2.6.22-ethercat.c b/devices/e1000/e1000_main-2.6.22-ethercat.c index de89ace2..6ccb16f9 100644 --- a/devices/e1000/e1000_main-2.6.22-ethercat.c +++ b/devices/e1000/e1000_main-2.6.22-ethercat.c @@ -24,6 +24,8 @@ e1000-devel Mailing List Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + vim: noexpandtab + *******************************************************************************/ #include "e1000-2.6.22-ethercat.h" @@ -540,8 +542,14 @@ static void e1000_configure(struct e1000_adapter *adapter) * next_to_use != next_to_clean */ for (i = 0; i < adapter->num_rx_queues; i++) { struct e1000_rx_ring *ring = &adapter->rx_ring[i]; - adapter->alloc_rx_buf(adapter, ring, - E1000_DESC_UNUSED(ring)); + if (adapter->ecdev) { + /* fill rx ring completely! */ + adapter->alloc_rx_buf(adapter, ring, ring->count); + } else { + /* this one leaves the last ring element unallocated! */ + adapter->alloc_rx_buf(adapter, ring, + E1000_DESC_UNUSED(ring)); + } } adapter->tx_queue_len = netdev->tx_queue_len; @@ -2396,7 +2404,14 @@ e1000_leave_82542_rst(struct e1000_adapter *adapter) /* No need to loop, because 82542 supports only 1 queue */ struct e1000_rx_ring *ring = &adapter->rx_ring[0]; e1000_configure_rx(adapter); - adapter->alloc_rx_buf(adapter, ring, E1000_DESC_UNUSED(ring)); + if (adapter->ecdev) { + /* fill rx ring completely! */ + adapter->alloc_rx_buf(adapter, ring, ring->count); + } else { + /* this one leaves the last ring element unallocated! */ + adapter->alloc_rx_buf(adapter, ring, E1000_DESC_UNUSED(ring)); + } + } } @@ -3836,12 +3851,12 @@ e1000_intr_msi(int irq, void *data) struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; int i; -#ifdef CONFIG_E1000_NAPI - int ec_work_done = 0; -#endif uint32_t icr = E1000_READ_REG(hw, ICR); if (adapter->ecdev) { +#ifdef CONFIG_E1000_NAPI + int ec_work_done = 0; +#endif for (i = 0; i < E1000_MAX_INTR; i++) #ifdef CONFIG_E1000_NAPI if (unlikely(!adapter->clean_rx(adapter, adapter->rx_ring, @@ -3916,9 +3931,6 @@ e1000_intr(int irq, void *data) struct e1000_hw *hw = &adapter->hw; uint32_t rctl, icr = E1000_READ_REG(hw, ICR); int i; -#ifdef CONFIG_E1000_NAPI - int ec_work_done = 0; -#endif if (unlikely(!icr)) return IRQ_NONE; /* Not our interrupt */ @@ -3956,6 +3968,9 @@ e1000_intr(int irq, void *data) } if (adapter->ecdev) { +#ifdef CONFIG_E1000_NAPI + int ec_work_done = 0; +#endif for (i = 0; i < E1000_MAX_INTR; i++) #ifdef CONFIG_E1000_NAPI if (unlikely(!adapter->clean_rx(adapter, adapter->rx_ring, diff --git a/devices/e1000/e1000_main-2.6.24-ethercat.c b/devices/e1000/e1000_main-2.6.24-ethercat.c index 00cfaf56..d17cb822 100644 --- a/devices/e1000/e1000_main-2.6.24-ethercat.c +++ b/devices/e1000/e1000_main-2.6.24-ethercat.c @@ -24,6 +24,8 @@ e1000-devel Mailing List Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + vim: noexpandtab + *******************************************************************************/ #include "e1000-2.6.24-ethercat.h" @@ -541,8 +543,14 @@ static void e1000_configure(struct e1000_adapter *adapter) * next_to_use != next_to_clean */ for (i = 0; i < adapter->num_rx_queues; i++) { struct e1000_rx_ring *ring = &adapter->rx_ring[i]; - adapter->alloc_rx_buf(adapter, ring, - E1000_DESC_UNUSED(ring)); + if (adapter->ecdev) { + /* fill rx ring completely! */ + adapter->alloc_rx_buf(adapter, ring, ring->count); + } else { + /* this one leaves the last ring element unallocated! */ + adapter->alloc_rx_buf(adapter, ring, + E1000_DESC_UNUSED(ring)); + } } adapter->tx_queue_len = netdev->tx_queue_len; @@ -2394,7 +2402,14 @@ e1000_leave_82542_rst(struct e1000_adapter *adapter) /* No need to loop, because 82542 supports only 1 queue */ struct e1000_rx_ring *ring = &adapter->rx_ring[0]; e1000_configure_rx(adapter); - adapter->alloc_rx_buf(adapter, ring, E1000_DESC_UNUSED(ring)); + if (adapter->ecdev) { + /* fill rx ring completely! */ + adapter->alloc_rx_buf(adapter, ring, ring->count); + } else { + /* this one leaves the last ring element unallocated! */ + adapter->alloc_rx_buf(adapter, ring, E1000_DESC_UNUSED(ring)); + } + } } @@ -3833,10 +3848,12 @@ e1000_intr_msi(int irq, void *data) struct net_device *netdev = data; struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_hw *hw = &adapter->hw; - int ec_work_done = 0; int i; if (adapter->ecdev) { +#ifdef CONFIG_E1000_NAPI + int ec_work_done = 0; +#endif for (i = 0; i < E1000_MAX_INTR; i++) #ifdef CONFIG_E1000_NAPI if (unlikely(!adapter->clean_rx(adapter, adapter->rx_ring, @@ -3913,7 +3930,6 @@ e1000_intr(int irq, void *data) struct e1000_hw *hw = &adapter->hw; uint32_t rctl, icr = E1000_READ_REG(hw, ICR); int i; - int ec_work_done = 0; if (unlikely(!icr)) return IRQ_NONE; /* Not our interrupt */ @@ -3951,6 +3967,9 @@ e1000_intr(int irq, void *data) } if (adapter->ecdev) { +#ifdef CONFIG_E1000_NAPI + int ec_work_done = 0; +#endif for (i = 0; i < E1000_MAX_INTR; i++) #ifdef CONFIG_E1000_NAPI if (unlikely(!adapter->clean_rx(adapter, adapter->rx_ring,