Lines Matching refs:netdev
198 static int dcbnl_getstate(struct net_device *netdev, struct nlattr **tb, in dcbnl_getstate() argument
204 if (!netdev->dcbnl_ops->getstate) in dcbnl_getstate()
207 ret = dcbnl_reply(netdev->dcbnl_ops->getstate(netdev), RTM_GETDCB, in dcbnl_getstate()
213 static int dcbnl_getpfccfg(struct net_device *netdev, struct nlattr **tb, in dcbnl_getpfccfg() argument
225 if (!tb[DCB_ATTR_PFC_CFG] || !netdev->dcbnl_ops->getpfccfg) in dcbnl_getpfccfg()
255 netdev->dcbnl_ops->getpfccfg(netdev, i - DCB_PFC_UP_ATTR_0, in dcbnl_getpfccfg()
280 static int dcbnl_getperm_hwaddr(struct net_device *netdev, struct nlattr **tb, in dcbnl_getperm_hwaddr() argument
289 if (!netdev->dcbnl_ops->getpermhwaddr) in dcbnl_getperm_hwaddr()
302 netdev->dcbnl_ops->getpermhwaddr(netdev, perm_addr); in dcbnl_getperm_hwaddr()
322 static int dcbnl_getcap(struct net_device *netdev, struct nlattr **tb, in dcbnl_getcap() argument
334 if (!tb[DCB_ATTR_CAP] || !netdev->dcbnl_ops->getcap) in dcbnl_getcap()
363 if (!netdev->dcbnl_ops->getcap(netdev, i, &value)) { in dcbnl_getcap()
388 static int dcbnl_getnumtcs(struct net_device *netdev, struct nlattr **tb, in dcbnl_getnumtcs() argument
400 if (!tb[DCB_ATTR_NUMTCS] || !netdev->dcbnl_ops->getnumtcs) in dcbnl_getnumtcs()
435 ret = netdev->dcbnl_ops->getnumtcs(netdev, i, &value); in dcbnl_getnumtcs()
466 static int dcbnl_setnumtcs(struct net_device *netdev, struct nlattr **tb, in dcbnl_setnumtcs() argument
474 if (!tb[DCB_ATTR_NUMTCS] || !netdev->dcbnl_ops->setnumtcs) in dcbnl_setnumtcs()
491 ret = netdev->dcbnl_ops->setnumtcs(netdev, i, value); in dcbnl_setnumtcs()
505 static int dcbnl_getpfcstate(struct net_device *netdev, struct nlattr **tb, in dcbnl_getpfcstate() argument
510 if (!netdev->dcbnl_ops->getpfcstate) in dcbnl_getpfcstate()
513 ret = dcbnl_reply(netdev->dcbnl_ops->getpfcstate(netdev), RTM_GETDCB, in dcbnl_getpfcstate()
520 static int dcbnl_setpfcstate(struct net_device *netdev, struct nlattr **tb, in dcbnl_setpfcstate() argument
526 if (!tb[DCB_ATTR_PFC_STATE] || !netdev->dcbnl_ops->setpfcstate) in dcbnl_setpfcstate()
531 netdev->dcbnl_ops->setpfcstate(netdev, value); in dcbnl_setpfcstate()
539 static int __dcbnl_pg_getcfg(struct net_device *netdev, struct nlattr **tb, in __dcbnl_pg_getcfg() argument
554 !netdev->dcbnl_ops->getpgtccfgtx || in __dcbnl_pg_getcfg()
555 !netdev->dcbnl_ops->getpgtccfgrx || in __dcbnl_pg_getcfg()
556 !netdev->dcbnl_ops->getpgbwgcfgtx || in __dcbnl_pg_getcfg()
557 !netdev->dcbnl_ops->getpgbwgcfgrx) in __dcbnl_pg_getcfg()
607 netdev->dcbnl_ops->getpgtccfgrx(netdev, in __dcbnl_pg_getcfg()
612 netdev->dcbnl_ops->getpgtccfgtx(netdev, in __dcbnl_pg_getcfg()
661 netdev->dcbnl_ops->getpgbwgcfgrx(netdev, in __dcbnl_pg_getcfg()
665 netdev->dcbnl_ops->getpgbwgcfgtx(netdev, in __dcbnl_pg_getcfg()
696 static int dcbnl_pgtx_getcfg(struct net_device *netdev, struct nlattr **tb, in dcbnl_pgtx_getcfg() argument
699 return __dcbnl_pg_getcfg(netdev, tb, pid, seq, flags, 0); in dcbnl_pgtx_getcfg()
702 static int dcbnl_pgrx_getcfg(struct net_device *netdev, struct nlattr **tb, in dcbnl_pgrx_getcfg() argument
705 return __dcbnl_pg_getcfg(netdev, tb, pid, seq, flags, 1); in dcbnl_pgrx_getcfg()
708 static int dcbnl_setstate(struct net_device *netdev, struct nlattr **tb, in dcbnl_setstate() argument
714 if (!tb[DCB_ATTR_STATE] || !netdev->dcbnl_ops->setstate) in dcbnl_setstate()
719 ret = dcbnl_reply(netdev->dcbnl_ops->setstate(netdev, value), in dcbnl_setstate()
726 static int dcbnl_setpfccfg(struct net_device *netdev, struct nlattr **tb, in dcbnl_setpfccfg() argument
734 if (!tb[DCB_ATTR_PFC_CFG] || !netdev->dcbnl_ops->setpfccfg) in dcbnl_setpfccfg()
747 netdev->dcbnl_ops->setpfccfg(netdev, in dcbnl_setpfccfg()
757 static int dcbnl_setall(struct net_device *netdev, struct nlattr **tb, in dcbnl_setall() argument
762 if (!tb[DCB_ATTR_SET_ALL] || !netdev->dcbnl_ops->setall) in dcbnl_setall()
765 ret = dcbnl_reply(netdev->dcbnl_ops->setall(netdev), RTM_SETDCB, in dcbnl_setall()
771 static int __dcbnl_pg_setcfg(struct net_device *netdev, struct nlattr **tb, in __dcbnl_pg_setcfg() argument
784 !netdev->dcbnl_ops->setpgtccfgtx || in __dcbnl_pg_setcfg()
785 !netdev->dcbnl_ops->setpgtccfgrx || in __dcbnl_pg_setcfg()
786 !netdev->dcbnl_ops->setpgbwgcfgtx || in __dcbnl_pg_setcfg()
787 !netdev->dcbnl_ops->setpgbwgcfgrx) in __dcbnl_pg_setcfg()
826 netdev->dcbnl_ops->setpgtccfgrx(netdev, in __dcbnl_pg_setcfg()
831 netdev->dcbnl_ops->setpgtccfgtx(netdev, in __dcbnl_pg_setcfg()
846 netdev->dcbnl_ops->setpgbwgcfgrx(netdev, in __dcbnl_pg_setcfg()
850 netdev->dcbnl_ops->setpgbwgcfgtx(netdev, in __dcbnl_pg_setcfg()
863 static int dcbnl_pgtx_setcfg(struct net_device *netdev, struct nlattr **tb, in dcbnl_pgtx_setcfg() argument
866 return __dcbnl_pg_setcfg(netdev, tb, pid, seq, flags, 0); in dcbnl_pgtx_setcfg()
869 static int dcbnl_pgrx_setcfg(struct net_device *netdev, struct nlattr **tb, in dcbnl_pgrx_setcfg() argument
872 return __dcbnl_pg_setcfg(netdev, tb, pid, seq, flags, 1); in dcbnl_pgrx_setcfg()
875 static int dcbnl_bcn_getcfg(struct net_device *netdev, struct nlattr **tb, in dcbnl_bcn_getcfg() argument
889 if (!tb[DCB_ATTR_BCN] || !netdev->dcbnl_ops->getbcnrp || in dcbnl_bcn_getcfg()
890 !netdev->dcbnl_ops->getbcncfg) in dcbnl_bcn_getcfg()
920 netdev->dcbnl_ops->getbcnrp(netdev, i - DCB_BCN_ATTR_RP_0, in dcbnl_bcn_getcfg()
931 netdev->dcbnl_ops->getbcncfg(netdev, i, in dcbnl_bcn_getcfg()
958 static int dcbnl_bcn_setcfg(struct net_device *netdev, struct nlattr **tb, in dcbnl_bcn_setcfg() argument
967 if (!tb[DCB_ATTR_BCN] || !netdev->dcbnl_ops->setbcncfg in dcbnl_bcn_setcfg()
968 || !netdev->dcbnl_ops->setbcnrp) in dcbnl_bcn_setcfg()
981 netdev->dcbnl_ops->setbcnrp(netdev, in dcbnl_bcn_setcfg()
989 netdev->dcbnl_ops->setbcncfg(netdev, in dcbnl_bcn_setcfg()
1002 struct net_device *netdev; in dcb_doit() local
1019 netdev = dev_get_by_name(&init_net, nla_data(tb[DCB_ATTR_IFNAME])); in dcb_doit()
1020 if (!netdev) in dcb_doit()
1023 if (!netdev->dcbnl_ops) in dcb_doit()
1028 ret = dcbnl_getstate(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1032 ret = dcbnl_getpfccfg(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1036 ret = dcbnl_getperm_hwaddr(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1040 ret = dcbnl_pgtx_getcfg(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1044 ret = dcbnl_pgrx_getcfg(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1048 ret = dcbnl_bcn_getcfg(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1052 ret = dcbnl_setstate(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1056 ret = dcbnl_setpfccfg(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1061 ret = dcbnl_setall(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1065 ret = dcbnl_pgtx_setcfg(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1069 ret = dcbnl_pgrx_setcfg(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1073 ret = dcbnl_getcap(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1077 ret = dcbnl_getnumtcs(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1081 ret = dcbnl_setnumtcs(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1085 ret = dcbnl_getpfcstate(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1089 ret = dcbnl_setpfcstate(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1093 ret = dcbnl_bcn_setcfg(netdev, tb, pid, nlh->nlmsg_seq, in dcb_doit()
1102 dev_put(netdev); in dcb_doit()