aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ps3_gelic_net.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/net/ps3_gelic_net.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'drivers/net/ps3_gelic_net.c')
-rw-r--r--drivers/net/ps3_gelic_net.c46
1 files changed, 15 insertions, 31 deletions
diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c
index 87d6b8f36304..b1f251da1535 100644
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -632,7 +632,7 @@ static inline void gelic_card_enable_rxdmac(struct gelic_card *card)
632 * @card: card structure 632 * @card: card structure
633 * 633 *
634 * gelic_card_disable_rxdmac terminates processing on the DMA controller by 634 * gelic_card_disable_rxdmac terminates processing on the DMA controller by
635 * turing off DMA and issueing a force end 635 * turing off DMA and issuing a force end
636 */ 636 */
637static inline void gelic_card_disable_rxdmac(struct gelic_card *card) 637static inline void gelic_card_disable_rxdmac(struct gelic_card *card)
638{ 638{
@@ -642,7 +642,7 @@ static inline void gelic_card_disable_rxdmac(struct gelic_card *card)
642 status = lv1_net_stop_rx_dma(bus_id(card), dev_id(card), 0); 642 status = lv1_net_stop_rx_dma(bus_id(card), dev_id(card), 0);
643 if (status) 643 if (status)
644 dev_err(ctodev(card), 644 dev_err(ctodev(card),
645 "lv1_net_stop_rx_dma faild, %d\n", status); 645 "lv1_net_stop_rx_dma failed, %d\n", status);
646} 646}
647 647
648/** 648/**
@@ -650,7 +650,7 @@ static inline void gelic_card_disable_rxdmac(struct gelic_card *card)
650 * @card: card structure 650 * @card: card structure
651 * 651 *
652 * gelic_card_disable_txdmac terminates processing on the DMA controller by 652 * gelic_card_disable_txdmac terminates processing on the DMA controller by
653 * turing off DMA and issueing a force end 653 * turing off DMA and issuing a force end
654 */ 654 */
655static inline void gelic_card_disable_txdmac(struct gelic_card *card) 655static inline void gelic_card_disable_txdmac(struct gelic_card *card)
656{ 656{
@@ -660,7 +660,7 @@ static inline void gelic_card_disable_txdmac(struct gelic_card *card)
660 status = lv1_net_stop_tx_dma(bus_id(card), dev_id(card), 0); 660 status = lv1_net_stop_tx_dma(bus_id(card), dev_id(card), 0);
661 if (status) 661 if (status)
662 dev_err(ctodev(card), 662 dev_err(ctodev(card),
663 "lv1_net_stop_tx_dma faild, status=%d\n", status); 663 "lv1_net_stop_tx_dma failed, status=%d\n", status);
664} 664}
665 665
666/** 666/**
@@ -951,14 +951,14 @@ static void gelic_net_pass_skb_up(struct gelic_descr *descr,
951 skb->protocol = eth_type_trans(skb, netdev); 951 skb->protocol = eth_type_trans(skb, netdev);
952 952
953 /* checksum offload */ 953 /* checksum offload */
954 if (card->rx_csum) { 954 if (netdev->features & NETIF_F_RXCSUM) {
955 if ((data_status & GELIC_DESCR_DATA_STATUS_CHK_MASK) && 955 if ((data_status & GELIC_DESCR_DATA_STATUS_CHK_MASK) &&
956 (!(data_error & GELIC_DESCR_DATA_ERROR_CHK_MASK))) 956 (!(data_error & GELIC_DESCR_DATA_ERROR_CHK_MASK)))
957 skb->ip_summed = CHECKSUM_UNNECESSARY; 957 skb->ip_summed = CHECKSUM_UNNECESSARY;
958 else 958 else
959 skb->ip_summed = CHECKSUM_NONE; 959 skb_checksum_none_assert(skb);
960 } else 960 } else
961 skb->ip_summed = CHECKSUM_NONE; 961 skb_checksum_none_assert(skb);
962 962
963 /* update netdevice statistics */ 963 /* update netdevice statistics */
964 netdev->stats.rx_packets++; 964 netdev->stats.rx_packets++;
@@ -1243,17 +1243,17 @@ static int gelic_ether_get_settings(struct net_device *netdev,
1243 1243
1244 switch (card->ether_port_status & GELIC_LV1_ETHER_SPEED_MASK) { 1244 switch (card->ether_port_status & GELIC_LV1_ETHER_SPEED_MASK) {
1245 case GELIC_LV1_ETHER_SPEED_10: 1245 case GELIC_LV1_ETHER_SPEED_10:
1246 cmd->speed = SPEED_10; 1246 ethtool_cmd_speed_set(cmd, SPEED_10);
1247 break; 1247 break;
1248 case GELIC_LV1_ETHER_SPEED_100: 1248 case GELIC_LV1_ETHER_SPEED_100:
1249 cmd->speed = SPEED_100; 1249 ethtool_cmd_speed_set(cmd, SPEED_100);
1250 break; 1250 break;
1251 case GELIC_LV1_ETHER_SPEED_1000: 1251 case GELIC_LV1_ETHER_SPEED_1000:
1252 cmd->speed = SPEED_1000; 1252 ethtool_cmd_speed_set(cmd, SPEED_1000);
1253 break; 1253 break;
1254 default: 1254 default:
1255 pr_info("%s: speed unknown\n", __func__); 1255 pr_info("%s: speed unknown\n", __func__);
1256 cmd->speed = SPEED_10; 1256 ethtool_cmd_speed_set(cmd, SPEED_10);
1257 break; 1257 break;
1258 } 1258 }
1259 1259
@@ -1312,21 +1312,6 @@ static int gelic_ether_set_settings(struct net_device *netdev,
1312 return 0; 1312 return 0;
1313} 1313}
1314 1314
1315u32 gelic_net_get_rx_csum(struct net_device *netdev)
1316{
1317 struct gelic_card *card = netdev_card(netdev);
1318
1319 return card->rx_csum;
1320}
1321
1322int gelic_net_set_rx_csum(struct net_device *netdev, u32 data)
1323{
1324 struct gelic_card *card = netdev_card(netdev);
1325
1326 card->rx_csum = data;
1327 return 0;
1328}
1329
1330static void gelic_net_get_wol(struct net_device *netdev, 1315static void gelic_net_get_wol(struct net_device *netdev,
1331 struct ethtool_wolinfo *wol) 1316 struct ethtool_wolinfo *wol)
1332{ 1317{
@@ -1411,10 +1396,6 @@ static const struct ethtool_ops gelic_ether_ethtool_ops = {
1411 .get_settings = gelic_ether_get_settings, 1396 .get_settings = gelic_ether_get_settings,
1412 .set_settings = gelic_ether_set_settings, 1397 .set_settings = gelic_ether_set_settings,
1413 .get_link = ethtool_op_get_link, 1398 .get_link = ethtool_op_get_link,
1414 .get_tx_csum = ethtool_op_get_tx_csum,
1415 .set_tx_csum = ethtool_op_set_tx_csum,
1416 .get_rx_csum = gelic_net_get_rx_csum,
1417 .set_rx_csum = gelic_net_set_rx_csum,
1418 .get_wol = gelic_net_get_wol, 1399 .get_wol = gelic_net_get_wol,
1419 .set_wol = gelic_net_set_wol, 1400 .set_wol = gelic_net_set_wol,
1420}; 1401};
@@ -1512,7 +1493,11 @@ int __devinit gelic_net_setup_netdev(struct net_device *netdev,
1512 int status; 1493 int status;
1513 u64 v1, v2; 1494 u64 v1, v2;
1514 1495
1496 netdev->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM;
1497
1515 netdev->features = NETIF_F_IP_CSUM; 1498 netdev->features = NETIF_F_IP_CSUM;
1499 if (GELIC_CARD_RX_CSUM_DEFAULT)
1500 netdev->features |= NETIF_F_RXCSUM;
1516 1501
1517 status = lv1_net_control(bus_id(card), dev_id(card), 1502 status = lv1_net_control(bus_id(card), dev_id(card),
1518 GELIC_LV1_GET_MAC_ADDRESS, 1503 GELIC_LV1_GET_MAC_ADDRESS,
@@ -1756,7 +1741,6 @@ static int __devinit ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)
1756 /* setup card structure */ 1741 /* setup card structure */
1757 card->irq_mask = GELIC_CARD_RXINT | GELIC_CARD_TXINT | 1742 card->irq_mask = GELIC_CARD_RXINT | GELIC_CARD_TXINT |
1758 GELIC_CARD_PORT_STATUS_CHANGED; 1743 GELIC_CARD_PORT_STATUS_CHANGED;
1759 card->rx_csum = GELIC_CARD_RX_CSUM_DEFAULT;
1760 1744
1761 1745
1762 if (gelic_card_init_chain(card, &card->tx_chain, 1746 if (gelic_card_init_chain(card, &card->tx_chain,