Skip to content

Commit

Permalink
fjes: net_device_ops.ndo_get_stats64
Browse files Browse the repository at this point in the history
This patch adds net_device_ops.ndo_get_stats64 callback.

Signed-off-by: Taku Izumi <izumi.taku@jp.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Taku Izumi authored and David S. Miller committed Aug 24, 2015
1 parent 2658593 commit 879bc9a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions drivers/net/fjes/fjes_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ static netdev_tx_t fjes_xmit_frame(struct sk_buff *, struct net_device *);
static void fjes_raise_intr_rxdata_task(struct work_struct *);
static void fjes_tx_stall_task(struct work_struct *);
static irqreturn_t fjes_intr(int, void*);
static struct rtnl_link_stats64 *
fjes_get_stats64(struct net_device *, struct rtnl_link_stats64 *);

static int fjes_acpi_add(struct acpi_device *);
static int fjes_acpi_remove(struct acpi_device *);
Expand Down Expand Up @@ -219,6 +221,7 @@ static const struct net_device_ops fjes_netdev_ops = {
.ndo_open = fjes_open,
.ndo_stop = fjes_close,
.ndo_start_xmit = fjes_xmit_frame,
.ndo_get_stats64 = fjes_get_stats64,
};

/* fjes_open - Called when a network interface is made active */
Expand Down Expand Up @@ -700,6 +703,16 @@ fjes_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
return ret;
}

static struct rtnl_link_stats64 *
fjes_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
{
struct fjes_adapter *adapter = netdev_priv(netdev);

memcpy(stats, &adapter->stats64, sizeof(struct rtnl_link_stats64));

return stats;
}

static irqreturn_t fjes_intr(int irq, void *data)
{
struct fjes_adapter *adapter = data;
Expand Down

0 comments on commit 879bc9a

Please sign in to comment.