Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290451
b: refs/heads/master
c: 6bbe021
h: refs/heads/master
i:
  290449: bf344bb
  290447: 2f5b94d
v: v3
  • Loading branch information
Ben Greear authored and Jeff Kirsher committed Feb 24, 2012
1 parent ddcfc26 commit 3a6e253
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 14 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: eeb69aa443e8cdc945405c48f21ce03f5a3b1f86
refs/heads/master: 6bbe021d405fff46b64a08dca51b06897b897a67
51 changes: 38 additions & 13 deletions trunk/drivers/net/ethernet/realtek/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -1626,21 +1626,32 @@ static void __rtl8169_set_features(struct net_device *dev,
netdev_features_t features)
{
struct rtl8169_private *tp = netdev_priv(dev);

netdev_features_t changed = features ^ dev->features;
void __iomem *ioaddr = tp->mmio_addr;

if (features & NETIF_F_RXCSUM)
tp->cp_cmd |= RxChkSum;
else
tp->cp_cmd &= ~RxChkSum;
if (!(changed & (NETIF_F_RXALL | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_RX)))
return;

if (dev->features & NETIF_F_HW_VLAN_RX)
tp->cp_cmd |= RxVlan;
else
tp->cp_cmd &= ~RxVlan;
if (changed & (NETIF_F_RXCSUM | NETIF_F_HW_VLAN_RX)) {
if (features & NETIF_F_RXCSUM)
tp->cp_cmd |= RxChkSum;
else
tp->cp_cmd &= ~RxChkSum;

RTL_W16(CPlusCmd, tp->cp_cmd);
RTL_R16(CPlusCmd);
if (dev->features & NETIF_F_HW_VLAN_RX)
tp->cp_cmd |= RxVlan;
else
tp->cp_cmd &= ~RxVlan;

RTL_W16(CPlusCmd, tp->cp_cmd);
RTL_R16(CPlusCmd);
}
if (changed & NETIF_F_RXALL) {
int tmp = (RTL_R32(RxConfig) & ~(AcceptErr | AcceptRunt));
if (features & NETIF_F_RXALL)
tmp |= (AcceptErr | AcceptRunt);
RTL_W32(RxConfig, tmp);
}
}

static int rtl8169_set_features(struct net_device *dev,
Expand Down Expand Up @@ -4174,6 +4185,8 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
/* 8110SCd requires hardware Rx VLAN - disallow toggling */
dev->hw_features &= ~NETIF_F_HW_VLAN_RX;

dev->hw_features |= NETIF_F_RXALL;

tp->hw_start = cfg->hw_start;
tp->event_slow = cfg->event_slow;

Expand Down Expand Up @@ -5747,11 +5760,20 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
dev->stats.rx_fifo_errors++;
}
if ((status & (RxRUNT | RxCRC)) &&
!(status & (RxRWT | RxFOVF)) &&
(dev->features & NETIF_F_RXALL))
goto process_pkt;

rtl8169_mark_to_asic(desc, rx_buf_sz);
} else {
struct sk_buff *skb;
dma_addr_t addr = le64_to_cpu(desc->addr);
int pkt_size = (status & 0x00003fff) - 4;
dma_addr_t addr;
int pkt_size;

process_pkt:
addr = le64_to_cpu(desc->addr);
pkt_size = (status & 0x00003fff) - 4;

/*
* The driver does not support incoming fragmented
Expand Down Expand Up @@ -6025,6 +6047,9 @@ static void rtl_set_rx_mode(struct net_device *dev)
}
}

if (dev->features & NETIF_F_RXALL)
rx_mode |= (AcceptErr | AcceptRunt);

tmp = (RTL_R32(RxConfig) & ~RX_CONFIG_ACCEPT_MASK) | rx_mode;

if (tp->mac_version > RTL_GIGA_MAC_VER_06) {
Expand Down

0 comments on commit 3a6e253

Please sign in to comment.