diff options
-rw-r--r-- | sys/dev/cxgbe/t4_ioctl.h | 2 | ||||
-rw-r--r-- | sys/dev/cxgbe/t4_main.c | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/sys/dev/cxgbe/t4_ioctl.h b/sys/dev/cxgbe/t4_ioctl.h index 45c2fcc..4a55c11 100644 --- a/sys/dev/cxgbe/t4_ioctl.h +++ b/sys/dev/cxgbe/t4_ioctl.h @@ -50,6 +50,7 @@ enum { T4_LOAD_FW, /* flash firmware */ T4_GET_MEM, /* read memory */ T4_GET_I2C, /* read from i2c addressible device */ + T4_CLEAR_STATS, /* clear a port's MAC statistics */ }; struct t4_reg { @@ -234,4 +235,5 @@ struct t4_mem_range { #define CHELSIO_T4_LOAD_FW _IOW('f', T4_LOAD_FW, struct t4_data) #define CHELSIO_T4_GET_MEM _IOW('f', T4_GET_MEM, struct t4_mem_range) #define CHELSIO_T4_GET_I2C _IOWR('f', T4_GET_I2C, struct t4_i2c_data) +#define CHELSIO_T4_CLEAR_STATS _IOW('f', T4_CLEAR_STATS, uint32_t) #endif diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 0097b44..dc8a2e4 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -5400,6 +5400,15 @@ t4_ioctl(struct cdev *dev, unsigned long cmd, caddr_t data, int fflag, rc = read_i2c(sc, (struct t4_i2c_data *)data); ADAPTER_UNLOCK(sc); break; + case CHELSIO_T4_CLEAR_STATS: { + u_int port_id = *(uint32_t *)data; + + if (port_id >= sc->params.nports) + return (EINVAL); + + t4_clr_port_stats(sc, port_id); + break; + } default: rc = EINVAL; } |