Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / drivers / net / ethernet / broadcom / bnxt / bnxt_devlink.h
blobe92a35d8b64204da64e240047a0cb914cc5cb354
1 /* Broadcom NetXtreme-C/E network driver.
3 * Copyright (c) 2017 Broadcom Limited
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation.
8 */
10 #ifndef BNXT_DEVLINK_H
11 #define BNXT_DEVLINK_H
13 /* Struct to hold housekeeping info needed by devlink interface */
14 struct bnxt_dl {
15 struct bnxt *bp; /* back ptr to the controlling dev */
18 static inline struct bnxt *bnxt_get_bp_from_dl(struct devlink *dl)
20 return ((struct bnxt_dl *)devlink_priv(dl))->bp;
23 /* To clear devlink pointer from bp, pass NULL dl */
24 static inline void bnxt_link_bp_to_dl(struct bnxt *bp, struct devlink *dl)
26 bp->dl = dl;
28 /* add a back pointer in dl to bp */
29 if (dl) {
30 struct bnxt_dl *bp_dl = devlink_priv(dl);
32 bp_dl->bp = bp;
36 int bnxt_dl_register(struct bnxt *bp);
37 void bnxt_dl_unregister(struct bnxt *bp);
39 #endif /* BNXT_DEVLINK_H */