devices/e1000/e1000_main-2.6.18-ethercat.c
changeset 1325 16aacb421bd4
parent 1152 30f168c7f74f
child 2421 bc2d4bf9cbe5
child 2589 2b9c78543663
equal deleted inserted replaced
1324:08060693df37 1325:16aacb421bd4
    22   
    22   
    23   Contact Information:
    23   Contact Information:
    24   Linux NICS <linux.nics@intel.com>
    24   Linux NICS <linux.nics@intel.com>
    25   e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
    25   e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
    26   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
    26   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
       
    27 
       
    28   vim: noexpandtab
    27 
    29 
    28 *******************************************************************************/
    30 *******************************************************************************/
    29 
    31 
    30 #include "e1000-2.6.18-ethercat.h"
    32 #include "e1000-2.6.18-ethercat.h"
    31 
    33 
   463 	/* call E1000_DESC_UNUSED which always leaves
   465 	/* call E1000_DESC_UNUSED which always leaves
   464 	 * at least 1 descriptor unused to make sure
   466 	 * at least 1 descriptor unused to make sure
   465 	 * next_to_use != next_to_clean */
   467 	 * next_to_use != next_to_clean */
   466 	for (i = 0; i < adapter->num_rx_queues; i++) {
   468 	for (i = 0; i < adapter->num_rx_queues; i++) {
   467 		struct e1000_rx_ring *ring = &adapter->rx_ring[i];
   469 		struct e1000_rx_ring *ring = &adapter->rx_ring[i];
   468 		adapter->alloc_rx_buf(adapter, ring,
   470 		if (adapter->ecdev) {
   469 		                      E1000_DESC_UNUSED(ring));
   471 			/* fill rx ring completely! */
       
   472 			adapter->alloc_rx_buf(adapter, ring, ring->count);
       
   473 		} else {
       
   474             /* this one leaves the last ring element unallocated! */
       
   475 			adapter->alloc_rx_buf(adapter, ring,
       
   476 					E1000_DESC_UNUSED(ring));
       
   477 		}
   470 	}
   478 	}
   471 
   479 
   472 	adapter->tx_queue_len = netdev->tx_queue_len;
   480 	adapter->tx_queue_len = netdev->tx_queue_len;
   473 
   481 
   474 	if (!adapter->ecdev) {
   482 	if (!adapter->ecdev) {
  2168 
  2176 
  2169 	if (!adapter->ecdev && netif_running(netdev)) {
  2177 	if (!adapter->ecdev && netif_running(netdev)) {
  2170 		/* No need to loop, because 82542 supports only 1 queue */
  2178 		/* No need to loop, because 82542 supports only 1 queue */
  2171 		struct e1000_rx_ring *ring = &adapter->rx_ring[0];
  2179 		struct e1000_rx_ring *ring = &adapter->rx_ring[0];
  2172 		e1000_configure_rx(adapter);
  2180 		e1000_configure_rx(adapter);
  2173 		adapter->alloc_rx_buf(adapter, ring, E1000_DESC_UNUSED(ring));
  2181 		if (adapter->ecdev) { 
       
  2182 			/* fill rx ring completely! */
       
  2183 			adapter->alloc_rx_buf(adapter, ring, ring->count);
       
  2184 		} else {
       
  2185             /* this one leaves the last ring element unallocated! */
       
  2186 			adapter->alloc_rx_buf(adapter, ring, E1000_DESC_UNUSED(ring));
       
  2187 		}
       
  2188 
  2174 	}
  2189 	}
  2175 }
  2190 }
  2176 
  2191 
  2177 /**
  2192 /**
  2178  * e1000_set_mac - Change the Ethernet Address of the NIC
  2193  * e1000_set_mac - Change the Ethernet Address of the NIC