-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The devlink part, which is minimal at this time giving just the driver name. Signed-off-by: Dimitris Michailidis <dmichail@fungible.com> Signed-off-by: David S. Miller <davem@davemloft.net>
- Loading branch information
Dimitris Michailidis
authored and
David S. Miller
committed
Feb 27, 2022
1 parent
21c5ea9
commit d1d899f
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) | ||
|
||
#include "funeth.h" | ||
#include "funeth_devlink.h" | ||
|
||
static int fun_dl_info_get(struct devlink *dl, struct devlink_info_req *req, | ||
struct netlink_ext_ack *extack) | ||
{ | ||
int err; | ||
|
||
err = devlink_info_driver_name_put(req, KBUILD_MODNAME); | ||
if (err) | ||
return err; | ||
|
||
return 0; | ||
} | ||
|
||
static const struct devlink_ops fun_dl_ops = { | ||
.info_get = fun_dl_info_get, | ||
}; | ||
|
||
struct devlink *fun_devlink_alloc(struct device *dev) | ||
{ | ||
return devlink_alloc(&fun_dl_ops, sizeof(struct fun_ethdev), dev); | ||
} | ||
|
||
void fun_devlink_free(struct devlink *devlink) | ||
{ | ||
devlink_free(devlink); | ||
} | ||
|
||
void fun_devlink_register(struct devlink *devlink) | ||
{ | ||
devlink_register(devlink); | ||
} | ||
|
||
void fun_devlink_unregister(struct devlink *devlink) | ||
{ | ||
devlink_unregister(devlink); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ | ||
|
||
#ifndef __FUNETH_DEVLINK_H | ||
#define __FUNETH_DEVLINK_H | ||
|
||
#include <net/devlink.h> | ||
|
||
struct devlink *fun_devlink_alloc(struct device *dev); | ||
void fun_devlink_free(struct devlink *devlink); | ||
void fun_devlink_register(struct devlink *devlink); | ||
void fun_devlink_unregister(struct devlink *devlink); | ||
|
||
#endif /* __FUNETH_DEVLINK_H */ |