#include <linux/netdevice.h>
#include <linux/netlink.h>
#include <linux/slab.h>
#include <net/netlink.h>
#include <net/rtnetlink.h>
#include <linux/dcbnl.h>
#include <net/dcbevent.h>
#include <linux/rtnetlink.h>
#include <linux/init.h>
#include <net/sock.h>
static const struct nla_policy dcbnl_rtnl_policy[DCB_ATTR_MAX + 1] = …;
static const struct nla_policy dcbnl_pfc_up_nest[DCB_PFC_UP_ATTR_MAX + 1] = …;
static const struct nla_policy dcbnl_pg_nest[DCB_PG_ATTR_MAX + 1] = …;
static const struct nla_policy dcbnl_tc_param_nest[DCB_TC_ATTR_PARAM_MAX + 1] = …;
static const struct nla_policy dcbnl_cap_nest[DCB_CAP_ATTR_MAX + 1] = …;
static const struct nla_policy dcbnl_numtcs_nest[DCB_NUMTCS_ATTR_MAX + 1] = …;
static const struct nla_policy dcbnl_bcn_nest[DCB_BCN_ATTR_MAX + 1] = …;
static const struct nla_policy dcbnl_app_nest[DCB_APP_ATTR_MAX + 1] = …;
static const struct nla_policy dcbnl_ieee_policy[DCB_ATTR_IEEE_MAX + 1] = …;
static const struct nla_policy dcbnl_featcfg_nest[DCB_FEATCFG_ATTR_MAX + 1] = …;
static LIST_HEAD(dcb_app_list);
static LIST_HEAD(dcb_rewr_list);
static DEFINE_SPINLOCK(dcb_lock);
static enum ieee_attrs_app dcbnl_app_attr_type_get(u8 selector)
{ … }
static bool dcbnl_app_attr_type_validate(enum ieee_attrs_app type)
{ … }
static bool dcbnl_app_selector_validate(enum ieee_attrs_app type, u8 selector)
{ … }
static struct sk_buff *dcbnl_newmsg(int type, u8 cmd, u32 port, u32 seq,
u32 flags, struct nlmsghdr **nlhp)
{ … }
static int dcbnl_getstate(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_getpfccfg(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_getperm_hwaddr(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_getcap(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_getnumtcs(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_setnumtcs(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_getpfcstate(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_setpfcstate(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_getapp(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_setapp(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int __dcbnl_pg_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,
struct nlattr **tb, struct sk_buff *skb, int dir)
{ … }
static int dcbnl_pgtx_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_pgrx_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_setstate(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_setpfccfg(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_setall(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int __dcbnl_pg_setcfg(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb,
int dir)
{ … }
static int dcbnl_pgtx_setcfg(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_pgrx_setcfg(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_bcn_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_bcn_setcfg(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_build_peer_app(struct net_device *netdev, struct sk_buff* skb,
int app_nested_type, int app_info_type,
int app_entry_type)
{ … }
static int dcbnl_getapptrust(struct net_device *netdev, struct sk_buff *skb)
{ … }
static int dcbnl_app_table_setdel(struct nlattr *attr,
struct net_device *netdev,
int (*setdel)(struct net_device *dev,
struct dcb_app *app))
{ … }
static int dcbnl_ieee_fill(struct sk_buff *skb, struct net_device *netdev)
{ … }
static int dcbnl_cee_pg_fill(struct sk_buff *skb, struct net_device *dev,
int dir)
{ … }
static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev)
{ … }
static int dcbnl_notify(struct net_device *dev, int event, int cmd,
u32 seq, u32 portid, int dcbx_ver)
{ … }
int dcbnl_ieee_notify(struct net_device *dev, int event, int cmd,
u32 seq, u32 portid)
{ … }
EXPORT_SYMBOL(…);
int dcbnl_cee_notify(struct net_device *dev, int event, int cmd,
u32 seq, u32 portid)
{ … }
EXPORT_SYMBOL(…);
static int dcbnl_ieee_set(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_ieee_get(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_ieee_del(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_getdcbx(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_setdcbx(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_getfeatcfg(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_setfeatcfg(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
static int dcbnl_cee_get(struct net_device *netdev, struct nlmsghdr *nlh,
u32 seq, struct nlattr **tb, struct sk_buff *skb)
{ … }
struct reply_func { … };
static const struct reply_func reply_funcs[DCB_CMD_MAX+1] = …;
static int dcb_doit(struct sk_buff *skb, struct nlmsghdr *nlh,
struct netlink_ext_ack *extack)
{ … }
static struct dcb_app_type *dcb_rewr_lookup(const struct dcb_app *app,
int ifindex, int proto)
{ … }
static struct dcb_app_type *dcb_app_lookup(const struct dcb_app *app,
int ifindex, int prio)
{ … }
static int dcb_app_add(struct list_head *list, const struct dcb_app *app,
int ifindex)
{ … }
u8 dcb_getapp(struct net_device *dev, struct dcb_app *app)
{ … }
EXPORT_SYMBOL(…);
int dcb_setapp(struct net_device *dev, struct dcb_app *new)
{ … }
EXPORT_SYMBOL(…);
u8 dcb_ieee_getapp_mask(struct net_device *dev, struct dcb_app *app)
{ … }
EXPORT_SYMBOL(…);
u16 dcb_getrewr(struct net_device *dev, struct dcb_app *app)
{ … }
EXPORT_SYMBOL(…);
int dcb_setrewr(struct net_device *dev, struct dcb_app *new)
{ … }
EXPORT_SYMBOL(…);
int dcb_delrewr(struct net_device *dev, struct dcb_app *del)
{ … }
EXPORT_SYMBOL(…);
int dcb_ieee_setapp(struct net_device *dev, struct dcb_app *new)
{ … }
EXPORT_SYMBOL(…);
int dcb_ieee_delapp(struct net_device *dev, struct dcb_app *del)
{ … }
EXPORT_SYMBOL(…);
void dcb_getrewr_prio_pcp_mask_map(const struct net_device *dev,
struct dcb_rewr_prio_pcp_map *p_map)
{ … }
EXPORT_SYMBOL(…);
void dcb_getrewr_prio_dscp_mask_map(const struct net_device *dev,
struct dcb_ieee_app_prio_map *p_map)
{ … }
EXPORT_SYMBOL(…);
void dcb_ieee_getapp_prio_dscp_mask_map(const struct net_device *dev,
struct dcb_ieee_app_prio_map *p_map)
{ … }
EXPORT_SYMBOL(…);
void
dcb_ieee_getapp_dscp_prio_mask_map(const struct net_device *dev,
struct dcb_ieee_app_dscp_map *p_map)
{ … }
EXPORT_SYMBOL(…);
u8 dcb_ieee_getapp_default_prio_mask(const struct net_device *dev)
{ … }
EXPORT_SYMBOL(…);
static void dcbnl_flush_dev(struct net_device *dev)
{ … }
static int dcbnl_netdevice_event(struct notifier_block *nb,
unsigned long event, void *ptr)
{ … }
static struct notifier_block dcbnl_nb __read_mostly = …;
static int __init dcbnl_init(void)
{ … }
device_initcall(dcbnl_init);