aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_ethtool.c
diff options
context:
space:
mode:
authorPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>2009-07-16 11:50:12 -0400
committerDavid S. Miller <davem@davemloft.net>2009-07-17 12:47:33 -0400
commitf4ec443b2b27ecb401eee35a7bea330438556c7e (patch)
tree32cdb246f0d9789589e6eddac104642c65c357bf /drivers/net/ixgbe/ixgbe_ethtool.c
parentc482c568577a2b31716e1019f2868bda7cf5629c (diff)
ixgbe: Remove legacy descriptor support
The ethtool offline test is the only consumer of the legacy descriptors. Update that path to only use advanced descriptors, and remove all support for legacy descriptors. Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 2a978008fd6e..1464b33f1b8e 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -1440,7 +1440,7 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1440 goto err_nomem; 1440 goto err_nomem;
1441 } 1441 }
1442 1442
1443 tx_ring->size = tx_ring->count * sizeof(struct ixgbe_legacy_tx_desc); 1443 tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
1444 tx_ring->size = ALIGN(tx_ring->size, 4096); 1444 tx_ring->size = ALIGN(tx_ring->size, 4096);
1445 if (!(tx_ring->desc = pci_alloc_consistent(pdev, tx_ring->size, 1445 if (!(tx_ring->desc = pci_alloc_consistent(pdev, tx_ring->size,
1446 &tx_ring->dma))) { 1446 &tx_ring->dma))) {
@@ -1454,7 +1454,7 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1454 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDBAH(0), 1454 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDBAH(0),
1455 ((u64) tx_ring->dma >> 32)); 1455 ((u64) tx_ring->dma >> 32));
1456 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDLEN(0), 1456 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDLEN(0),
1457 tx_ring->count * sizeof(struct ixgbe_legacy_tx_desc)); 1457 tx_ring->count * sizeof(union ixgbe_adv_tx_desc));
1458 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDH(0), 0); 1458 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDH(0), 0);
1459 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDT(0), 0); 1459 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TDT(0), 0);
1460 1460
@@ -1472,7 +1472,7 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1472 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TXDCTL(0), reg_data); 1472 IXGBE_WRITE_REG(&adapter->hw, IXGBE_TXDCTL(0), reg_data);
1473 1473
1474 for (i = 0; i < tx_ring->count; i++) { 1474 for (i = 0; i < tx_ring->count; i++) {
1475 struct ixgbe_legacy_tx_desc *desc = IXGBE_TX_DESC(*tx_ring, i); 1475 union ixgbe_adv_tx_desc *desc = IXGBE_TX_DESC_ADV(*tx_ring, i);
1476 struct sk_buff *skb; 1476 struct sk_buff *skb;
1477 unsigned int size = 1024; 1477 unsigned int size = 1024;
1478 1478
@@ -1486,13 +1486,18 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1486 tx_ring->tx_buffer_info[i].length = skb->len; 1486 tx_ring->tx_buffer_info[i].length = skb->len;
1487 tx_ring->tx_buffer_info[i].dma = 1487 tx_ring->tx_buffer_info[i].dma =
1488 pci_map_single(pdev, skb->data, skb->len, 1488 pci_map_single(pdev, skb->data, skb->len,
1489 PCI_DMA_TODEVICE); 1489 PCI_DMA_TODEVICE);
1490 desc->buffer_addr = cpu_to_le64(tx_ring->tx_buffer_info[i].dma); 1490 desc->read.buffer_addr =
1491 desc->lower.data = cpu_to_le32(skb->len); 1491 cpu_to_le64(tx_ring->tx_buffer_info[i].dma);
1492 desc->lower.data |= cpu_to_le32(IXGBE_TXD_CMD_EOP | 1492 desc->read.cmd_type_len = cpu_to_le32(skb->len);
1493 IXGBE_TXD_CMD_IFCS | 1493 desc->read.cmd_type_len |= cpu_to_le32(IXGBE_TXD_CMD_EOP |
1494 IXGBE_TXD_CMD_RS); 1494 IXGBE_TXD_CMD_IFCS |
1495 desc->upper.data = 0; 1495 IXGBE_TXD_CMD_RS);
1496 desc->read.olinfo_status = 0;
1497 if (adapter->hw.mac.type == ixgbe_mac_82599EB)
1498 desc->read.olinfo_status |=
1499 (skb->len << IXGBE_ADVTXD_PAYLEN_SHIFT);
1500
1496 } 1501 }
1497 1502
1498 /* Setup Rx Descriptor ring and Rx buffers */ 1503 /* Setup Rx Descriptor ring and Rx buffers */
@@ -1508,7 +1513,7 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1508 goto err_nomem; 1513 goto err_nomem;
1509 } 1514 }
1510 1515
1511 rx_ring->size = rx_ring->count * sizeof(struct ixgbe_legacy_rx_desc); 1516 rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
1512 rx_ring->size = ALIGN(rx_ring->size, 4096); 1517 rx_ring->size = ALIGN(rx_ring->size, 4096);
1513 if (!(rx_ring->desc = pci_alloc_consistent(pdev, rx_ring->size, 1518 if (!(rx_ring->desc = pci_alloc_consistent(pdev, rx_ring->size,
1514 &rx_ring->dma))) { 1519 &rx_ring->dma))) {
@@ -1566,8 +1571,8 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1566 IXGBE_WRITE_REG(&adapter->hw, IXGBE_RXCTRL, rctl); 1571 IXGBE_WRITE_REG(&adapter->hw, IXGBE_RXCTRL, rctl);
1567 1572
1568 for (i = 0; i < rx_ring->count; i++) { 1573 for (i = 0; i < rx_ring->count; i++) {
1569 struct ixgbe_legacy_rx_desc *rx_desc = 1574 union ixgbe_adv_rx_desc *rx_desc =
1570 IXGBE_RX_DESC(*rx_ring, i); 1575 IXGBE_RX_DESC_ADV(*rx_ring, i);
1571 struct sk_buff *skb; 1576 struct sk_buff *skb;
1572 1577
1573 skb = alloc_skb(IXGBE_RXBUFFER_2048 + NET_IP_ALIGN, GFP_KERNEL); 1578 skb = alloc_skb(IXGBE_RXBUFFER_2048 + NET_IP_ALIGN, GFP_KERNEL);
@@ -1580,7 +1585,7 @@ static int ixgbe_setup_desc_rings(struct ixgbe_adapter *adapter)
1580 rx_ring->rx_buffer_info[i].dma = 1585 rx_ring->rx_buffer_info[i].dma =
1581 pci_map_single(pdev, skb->data, IXGBE_RXBUFFER_2048, 1586 pci_map_single(pdev, skb->data, IXGBE_RXBUFFER_2048,
1582 PCI_DMA_FROMDEVICE); 1587 PCI_DMA_FROMDEVICE);
1583 rx_desc->buffer_addr = 1588 rx_desc->read.pkt_addr =
1584 cpu_to_le64(rx_ring->rx_buffer_info[i].dma); 1589 cpu_to_le64(rx_ring->rx_buffer_info[i].dma);
1585 memset(skb->data, 0x00, skb->len); 1590 memset(skb->data, 0x00, skb->len);
1586 } 1591 }