aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/netdevsim/netdevsim.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2019-04-25 15:59:48 +0200
committerDavid S. Miller <davem@davemloft.net>2019-04-26 01:52:02 -0400
commitf9d9db47d3ba87309e022efa33b438e5ef329411 (patch)
tree55c5193aa0844514cdaadb22ac71ac086aeb8df4 /drivers/net/netdevsim/netdevsim.h
parentnetdevsim: use ida for bus device ids (diff)
downloadlinux-dev-f9d9db47d3ba87309e022efa33b438e5ef329411.tar.xz
linux-dev-f9d9db47d3ba87309e022efa33b438e5ef329411.zip
netdevsim: add bus attributes to add new and delete devices
Add a way to add new netdevsim device on netdevsim bus and also to delete existing netdevsim device from the bus. Track the bus devices in using a list. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/netdevsim/netdevsim.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/netdevsim/netdevsim.h b/drivers/net/netdevsim/netdevsim.h
index 528d1e7d3e6b..8d61fcb55f39 100644
--- a/drivers/net/netdevsim/netdevsim.h
+++ b/drivers/net/netdevsim/netdevsim.h
@@ -196,11 +196,13 @@ struct nsim_vf_config {
struct nsim_bus_dev {
struct device dev;
+ struct list_head list;
+ unsigned int port_count;
unsigned int num_vfs;
struct nsim_vf_config *vfconfigs;
};
-struct nsim_bus_dev *nsim_bus_dev_new(void);
+struct nsim_bus_dev *nsim_bus_dev_new(unsigned int id, unsigned int port_count);
void nsim_bus_dev_del(struct nsim_bus_dev *nsim_bus_dev);
int nsim_bus_init(void);
void nsim_bus_exit(void);