Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189152
b: refs/heads/master
c: 4300e8c
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Mar 26, 2010
1 parent f0369de commit bb9d196
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3da0ae6298fa10d4f5e2855ae400b2470bc6693d
refs/heads/master: 4300e8c7f64d95a80ffa7d98d98738f41546bc30
21 changes: 7 additions & 14 deletions trunk/drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static DEFINE_PCI_DEVICE_TABLE(rtl8169_pci_tbl) = {
MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl);

static int rx_copybreak = 200;
static int use_dac = -1;
static int use_dac;
static struct {
u32 msg_enable;
} debug = { -1 };
Expand Down Expand Up @@ -511,8 +511,7 @@ MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver");
module_param(rx_copybreak, int, 0);
MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames");
module_param(use_dac, int, 0);
MODULE_PARM_DESC(use_dac, "Enable PCI DAC. -1 defaults on for PCI Express only."
" Unsafe on 32 bit PCI slot.");
MODULE_PARM_DESC(use_dac, "Enable PCI DAC. Unsafe on 32 bit PCI slot.");
module_param_named(debug, debug.msg_enable, int, 0);
MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 16=all)");
MODULE_LICENSE("GPL");
Expand Down Expand Up @@ -2974,7 +2973,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
void __iomem *ioaddr;
unsigned int i;
int rc;
int this_use_dac = use_dac;

if (netif_msg_drv(&debug)) {
printk(KERN_INFO "%s Gigabit Ethernet driver %s loaded\n",
Expand Down Expand Up @@ -3040,17 +3038,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)

tp->cp_cmd = PCIMulRW | RxChkSum;

tp->pcie_cap = pci_find_capability(pdev, PCI_CAP_ID_EXP);
if (!tp->pcie_cap)
netif_info(tp, probe, dev, "no PCI Express capability\n");

if (this_use_dac < 0)
this_use_dac = tp->pcie_cap != 0;

if ((sizeof(dma_addr_t) > 4) &&
this_use_dac &&
!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
netif_info(tp, probe, dev, "using 64-bit DMA\n");
!pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) && use_dac) {
tp->cp_cmd |= PCIDAC;
dev->features |= NETIF_F_HIGHDMA;
} else {
Expand All @@ -3069,6 +3058,10 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_out_free_res_4;
}

tp->pcie_cap = pci_find_capability(pdev, PCI_CAP_ID_EXP);
if (!tp->pcie_cap)
netif_info(tp, probe, dev, "no PCI Express capability\n");

RTL_W16(IntrMask, 0x0000);

/* Soft reset the chip. */
Expand Down

0 comments on commit bb9d196

Please sign in to comment.