Просмотр исходного кода

[tg3] Remove tg3_calc_dma_bndry()

This function never did much in this driver anyway, and after commit
b5ed30b2 ("[tg3] Fix compilation on newer gcc versions") it became
apparent that its remaining functionality could be easily moved to
tg3_test_dma().

Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Thomas Miletich 12 лет назад
Родитель
Сommit
1476d6f47c
3 измененных файлов: 6 добавлений и 29 удалений
  1. 6
    6
      src/drivers/net/tg3/tg3.c
  2. 0
    1
      src/drivers/net/tg3/tg3.h
  3. 0
    22
      src/drivers/net/tg3/tg3_hw.c

+ 6
- 6
src/drivers/net/tg3/tg3.c Просмотреть файл

@@ -544,13 +544,13 @@ static int tg3_test_dma(struct tg3 *tp)
544 544
 	buf_dma = virt_to_bus(buf);
545 545
 	DBGC2(tp->dev, "dma test buffer, virt: %p phys: %#08x\n", buf, buf_dma);
546 546
 
547
-	tp->dma_rwctrl = ((0x7 << DMA_RWCTRL_PCI_WRITE_CMD_SHIFT) |
548
-			  (0x6 << DMA_RWCTRL_PCI_READ_CMD_SHIFT));
549
-
550
-	tp->dma_rwctrl = tg3_calc_dma_bndry(tp, tp->dma_rwctrl);
551
-
552
-	if (tg3_flag(tp, 57765_PLUS))
547
+	if (tg3_flag(tp, 57765_PLUS)) {
548
+		tp->dma_rwctrl = DMA_RWCTRL_DIS_CACHE_ALIGNMENT;
553 549
 		goto out;
550
+	}
551
+
552
+	tp->dma_rwctrl = ((0x7 << DMA_RWCTRL_PCI_WRITE_CMD_SHIFT) |
553
+	                 (0x6 << DMA_RWCTRL_PCI_READ_CMD_SHIFT));
554 554
 
555 555
 	if (tg3_flag(tp, PCI_EXPRESS)) {
556 556
 		/* DMA read watermark not used on PCIE */

+ 0
- 1
src/drivers/net/tg3/tg3.h Просмотреть файл

@@ -3380,7 +3380,6 @@ void tg3_set_txd(struct tg3 *tp, int entry, dma_addr_t mapping, int len, u32 fla
3380 3380
 void tg3_set_power_state_0(struct tg3 *tp);
3381 3381
 int tg3_alloc_consistent(struct tg3 *tp);
3382 3382
 int tg3_init_hw(struct tg3 *tp, int reset_phy);
3383
-u32 tg3_calc_dma_bndry(struct tg3 *tp, u32 val);
3384 3383
 void tg3_poll_link(struct tg3 *tp);
3385 3384
 void tg3_wait_for_event_ack(struct tg3 *tp);
3386 3385
 void __tg3_set_mac_addr(struct tg3 *tp, int skip_mac_1);

+ 0
- 22
src/drivers/net/tg3/tg3_hw.c Просмотреть файл

@@ -2564,28 +2564,6 @@ void tg3_set_txd(struct tg3 *tp, int entry,
2564 2564
 	txd->vlan_tag = 0;
2565 2565
 }
2566 2566
 
2567
-u32 tg3_calc_dma_bndry(struct tg3 *tp, u32 val)
2568
-{	DBGP("%s\n", __func__);
2569
-
2570
-	u8 byte;
2571
-
2572
-	pci_read_config_byte(tp->pdev, PCI_CACHE_LINE_SIZE, &byte);
2573
-
2574
-	/* On 5703 and later chips, the boundary bits have no
2575
-	 * effect.
2576
-	 */
2577
-	if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5700 &&
2578
-	    GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701 &&
2579
-	    !tg3_flag(tp, PCI_EXPRESS))
2580
-		goto out;
2581
-
2582
-	if (tg3_flag(tp, 57765_PLUS))
2583
-		val = DMA_RWCTRL_DIS_CACHE_ALIGNMENT;
2584
-
2585
-out:
2586
-	return val;
2587
-}
2588
-
2589 2567
 int tg3_do_test_dma(struct tg3 *tp, u32 __unused *buf, dma_addr_t buf_dma, int size, int to_device)
2590 2568
 {	DBGP("%s\n", __func__);
2591 2569
 

Загрузка…
Отмена
Сохранить