2 * Network device driver for Cell Processor-Based Blade
4 * (C) Copyright IBM Corp. 2005
6 * Authors : Utz Bacher <utz.bacher@de.ibm.com>
7 * Jens Osterkamp <Jens.Osterkamp@de.ibm.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include <linux/netdevice.h>
25 #include <linux/ethtool.h>
26 #include <linux/pci.h>
28 #include "spider_net.h"
31 spider_net_ethtool_get_drvinfo(struct net_device *netdev,
32 struct ethtool_drvinfo *drvinfo)
34 struct spider_net_card *card;
35 card = netdev_priv(netdev);
37 /* clear and fill out info */
38 memset(drvinfo, 0, sizeof(struct ethtool_drvinfo));
39 strncpy(drvinfo->driver, spider_net_driver_name, 32);
40 strncpy(drvinfo->version, "0.1", 32);
41 strcpy(drvinfo->fw_version, "no information");
42 strncpy(drvinfo->bus_info, pci_name(card->pdev), 32);
46 spider_net_ethtool_get_wol(struct net_device *netdev,
47 struct ethtool_wolinfo *wolinfo)
49 /* no support for wol */
50 wolinfo->supported = 0;
55 spider_net_ethtool_get_msglevel(struct net_device *netdev)
57 struct spider_net_card *card;
58 card = netdev_priv(netdev);
59 return card->msg_enable;
63 spider_net_ethtool_set_msglevel(struct net_device *netdev,
66 struct spider_net_card *card;
67 card = netdev_priv(netdev);
68 card->msg_enable = level;
72 spider_net_ethtool_nway_reset(struct net_device *netdev)
74 if (netif_running(netdev)) {
75 spider_net_stop(netdev);
76 spider_net_open(netdev);
82 spider_net_ethtool_get_rx_csum(struct net_device *netdev)
84 struct spider_net_card *card = netdev->priv;
86 return card->options.rx_csum;
90 spider_net_ethtool_set_rx_csum(struct net_device *netdev, u32 n)
92 struct spider_net_card *card = netdev->priv;
94 card->options.rx_csum = n;
98 struct ethtool_ops spider_net_ethtool_ops = {
99 .get_drvinfo = spider_net_ethtool_get_drvinfo,
100 .get_wol = spider_net_ethtool_get_wol,
101 .get_msglevel = spider_net_ethtool_get_msglevel,
102 .set_msglevel = spider_net_ethtool_set_msglevel,
103 .nway_reset = spider_net_ethtool_nway_reset,
104 .get_rx_csum = spider_net_ethtool_get_rx_csum,
105 .set_rx_csum = spider_net_ethtool_set_rx_csum,