diff options
author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2011-04-18 09:31:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-04-19 02:03:59 -0400 |
commit | 30f554f925335abad89aaa38eec6828242b27527 (patch) | |
tree | 6137d40e51d26cb39ec88fb2fe09ec79f41d44e4 /drivers/net/chelsio/sge.c | |
parent | b437a8cc7de4c9d8d0bdb37e7621c119f7640967 (diff) |
net: chelsio: convert to hw_features
Also remove flags that were not used or are now redundant to hw_features bits.
No device had UDP_CSUM_CAPABLE set.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/chelsio/sge.c')
-rw-r--r-- | drivers/net/chelsio/sge.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c index 8754d4473042..b948ea737550 100644 --- a/drivers/net/chelsio/sge.c +++ b/drivers/net/chelsio/sge.c | |||
@@ -929,7 +929,7 @@ void t1_sge_intr_enable(struct sge *sge) | |||
929 | u32 en = SGE_INT_ENABLE; | 929 | u32 en = SGE_INT_ENABLE; |
930 | u32 val = readl(sge->adapter->regs + A_PL_ENABLE); | 930 | u32 val = readl(sge->adapter->regs + A_PL_ENABLE); |
931 | 931 | ||
932 | if (sge->adapter->flags & TSO_CAPABLE) | 932 | if (sge->adapter->port[0].dev->hw_features & NETIF_F_TSO) |
933 | en &= ~F_PACKET_TOO_BIG; | 933 | en &= ~F_PACKET_TOO_BIG; |
934 | writel(en, sge->adapter->regs + A_SG_INT_ENABLE); | 934 | writel(en, sge->adapter->regs + A_SG_INT_ENABLE); |
935 | writel(val | SGE_PL_INTR_MASK, sge->adapter->regs + A_PL_ENABLE); | 935 | writel(val | SGE_PL_INTR_MASK, sge->adapter->regs + A_PL_ENABLE); |
@@ -952,7 +952,7 @@ int t1_sge_intr_error_handler(struct sge *sge) | |||
952 | struct adapter *adapter = sge->adapter; | 952 | struct adapter *adapter = sge->adapter; |
953 | u32 cause = readl(adapter->regs + A_SG_INT_CAUSE); | 953 | u32 cause = readl(adapter->regs + A_SG_INT_CAUSE); |
954 | 954 | ||
955 | if (adapter->flags & TSO_CAPABLE) | 955 | if (adapter->port[0].dev->hw_features & NETIF_F_TSO) |
956 | cause &= ~F_PACKET_TOO_BIG; | 956 | cause &= ~F_PACKET_TOO_BIG; |
957 | if (cause & F_RESPQ_EXHAUSTED) | 957 | if (cause & F_RESPQ_EXHAUSTED) |
958 | sge->stats.respQ_empty++; | 958 | sge->stats.respQ_empty++; |
@@ -1369,6 +1369,7 @@ static void sge_rx(struct sge *sge, struct freelQ *fl, unsigned int len) | |||
1369 | const struct cpl_rx_pkt *p; | 1369 | const struct cpl_rx_pkt *p; |
1370 | struct adapter *adapter = sge->adapter; | 1370 | struct adapter *adapter = sge->adapter; |
1371 | struct sge_port_stats *st; | 1371 | struct sge_port_stats *st; |
1372 | struct net_device *dev; | ||
1372 | 1373 | ||
1373 | skb = get_packet(adapter->pdev, fl, len - sge->rx_pkt_pad); | 1374 | skb = get_packet(adapter->pdev, fl, len - sge->rx_pkt_pad); |
1374 | if (unlikely(!skb)) { | 1375 | if (unlikely(!skb)) { |
@@ -1384,9 +1385,10 @@ static void sge_rx(struct sge *sge, struct freelQ *fl, unsigned int len) | |||
1384 | __skb_pull(skb, sizeof(*p)); | 1385 | __skb_pull(skb, sizeof(*p)); |
1385 | 1386 | ||
1386 | st = this_cpu_ptr(sge->port_stats[p->iff]); | 1387 | st = this_cpu_ptr(sge->port_stats[p->iff]); |
1388 | dev = adapter->port[p->iff].dev; | ||
1387 | 1389 | ||
1388 | skb->protocol = eth_type_trans(skb, adapter->port[p->iff].dev); | 1390 | skb->protocol = eth_type_trans(skb, dev); |
1389 | if ((adapter->flags & RX_CSUM_ENABLED) && p->csum == 0xffff && | 1391 | if ((dev->features & NETIF_F_RXCSUM) && p->csum == 0xffff && |
1390 | skb->protocol == htons(ETH_P_IP) && | 1392 | skb->protocol == htons(ETH_P_IP) && |
1391 | (skb->data[9] == IPPROTO_TCP || skb->data[9] == IPPROTO_UDP)) { | 1393 | (skb->data[9] == IPPROTO_TCP || skb->data[9] == IPPROTO_UDP)) { |
1392 | ++st->rx_cso_good; | 1394 | ++st->rx_cso_good; |
@@ -1838,8 +1840,7 @@ netdev_tx_t t1_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1838 | return NETDEV_TX_OK; | 1840 | return NETDEV_TX_OK; |
1839 | } | 1841 | } |
1840 | 1842 | ||
1841 | if (!(adapter->flags & UDP_CSUM_CAPABLE) && | 1843 | if (skb->ip_summed == CHECKSUM_PARTIAL && |
1842 | skb->ip_summed == CHECKSUM_PARTIAL && | ||
1843 | ip_hdr(skb)->protocol == IPPROTO_UDP) { | 1844 | ip_hdr(skb)->protocol == IPPROTO_UDP) { |
1844 | if (unlikely(skb_checksum_help(skb))) { | 1845 | if (unlikely(skb_checksum_help(skb))) { |
1845 | pr_debug("%s: unable to do udp checksum\n", dev->name); | 1846 | pr_debug("%s: unable to do udp checksum\n", dev->name); |