mirror of
https://github.com/fpganinja/taxi.git
synced 2026-01-18 01:30:36 -08:00
cndm: Add support for ethtool
Signed-off-by: Alex Forencich <alex@alexforencich.com>
This commit is contained in:
@@ -8,6 +8,7 @@ cndm-y += cndm_main.o
|
|||||||
cndm-y += cndm_devlink.o
|
cndm-y += cndm_devlink.o
|
||||||
cndm-y += cndm_dev.o
|
cndm-y += cndm_dev.o
|
||||||
cndm-y += cndm_netdev.o
|
cndm-y += cndm_netdev.o
|
||||||
|
cndm-y += cndm_ethtool.o
|
||||||
cndm-y += cndm_tx.o
|
cndm-y += cndm_tx.o
|
||||||
cndm-y += cndm_rx.o
|
cndm-y += cndm_rx.o
|
||||||
|
|
||||||
|
|||||||
@@ -141,6 +141,9 @@ void cndm_destroy_netdev(struct net_device *ndev);
|
|||||||
// cndm_dev.c
|
// cndm_dev.c
|
||||||
extern const struct file_operations cndm_fops;
|
extern const struct file_operations cndm_fops;
|
||||||
|
|
||||||
|
// cndm_ethtool.c
|
||||||
|
extern const struct ethtool_ops cndm_ethtool_ops;
|
||||||
|
|
||||||
// cndm_tx.c
|
// cndm_tx.c
|
||||||
int cndm_free_tx_buf(struct cndm_priv *priv);
|
int cndm_free_tx_buf(struct cndm_priv *priv);
|
||||||
int cndm_poll_tx_cq(struct napi_struct *napi, int budget);
|
int cndm_poll_tx_cq(struct napi_struct *napi, int budget);
|
||||||
|
|||||||
29
src/cndm/modules/cndm/cndm_ethtool.c
Normal file
29
src/cndm/modules/cndm/cndm_ethtool.c
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
// SPDX-License-Identifier: GPL
|
||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (c) 2025 FPGA Ninja, LLC
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
- Alex Forencich
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "cndm.h"
|
||||||
|
|
||||||
|
#include <linux/ethtool.h>
|
||||||
|
|
||||||
|
static void cndm_get_drvinfo(struct net_device *ndev,
|
||||||
|
struct ethtool_drvinfo *drvinfo)
|
||||||
|
{
|
||||||
|
struct cndm_priv *priv = netdev_priv(ndev);
|
||||||
|
struct cndm_dev *cdev = priv->cdev;
|
||||||
|
|
||||||
|
strscpy(drvinfo->driver, DRIVER_NAME, sizeof(drvinfo->driver));
|
||||||
|
strscpy(drvinfo->version, DRIVER_VERSION, sizeof(drvinfo->version));
|
||||||
|
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), "TODO"); // TODO
|
||||||
|
strscpy(drvinfo->bus_info, dev_name(cdev->dev), sizeof(drvinfo->bus_info));
|
||||||
|
}
|
||||||
|
|
||||||
|
const struct ethtool_ops cndm_ethtool_ops = {
|
||||||
|
.get_drvinfo = cndm_get_drvinfo,
|
||||||
|
};
|
||||||
@@ -104,6 +104,7 @@ struct net_device *cndm_create_netdev(struct cndm_dev *cdev, int port, void __io
|
|||||||
eth_hw_addr_random(ndev);
|
eth_hw_addr_random(ndev);
|
||||||
|
|
||||||
ndev->netdev_ops = &cndm_netdev_ops;
|
ndev->netdev_ops = &cndm_netdev_ops;
|
||||||
|
ndev->ethtool_ops = &cndm_ethtool_ops;
|
||||||
|
|
||||||
ndev->hw_features = 0;
|
ndev->hw_features = 0;
|
||||||
ndev->features = 0;
|
ndev->features = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user