Lines Matching refs:netdev

241 static int dcbnl_getstate(struct net_device *netdev, struct nlmsghdr *nlh,
244 /* if (!tb[DCB_ATTR_STATE] || !netdev->dcbnl_ops->getstate) */
245 if (!netdev->dcbnl_ops->getstate)
249 netdev->dcbnl_ops->getstate(netdev));
252 static int dcbnl_getpfccfg(struct net_device *netdev, struct nlmsghdr *nlh,
264 if (!netdev->dcbnl_ops->getpfccfg)
284 netdev->dcbnl_ops->getpfccfg(netdev, i - DCB_PFC_UP_ATTR_0,
297 static int dcbnl_getperm_hwaddr(struct net_device *netdev, struct nlmsghdr *nlh,
302 if (!netdev->dcbnl_ops->getpermhwaddr)
306 netdev->dcbnl_ops->getpermhwaddr(netdev, perm_addr);
311 static int dcbnl_getcap(struct net_device *netdev, struct nlmsghdr *nlh,
323 if (!netdev->dcbnl_ops->getcap)
343 if (!netdev->dcbnl_ops->getcap(netdev, i, &value)) {
356 static int dcbnl_getnumtcs(struct net_device *netdev, struct nlmsghdr *nlh,
368 if (!netdev->dcbnl_ops->getnumtcs)
388 ret = netdev->dcbnl_ops->getnumtcs(netdev, i, &value);
403 static int dcbnl_setnumtcs(struct net_device *netdev, struct nlmsghdr *nlh,
414 if (!netdev->dcbnl_ops->setnumtcs)
429 ret = netdev->dcbnl_ops->setnumtcs(netdev, i, value);
437 static int dcbnl_getpfcstate(struct net_device *netdev, struct nlmsghdr *nlh,
440 if (!netdev->dcbnl_ops->getpfcstate)
444 netdev->dcbnl_ops->getpfcstate(netdev));
447 static int dcbnl_setpfcstate(struct net_device *netdev, struct nlmsghdr *nlh,
455 if (!netdev->dcbnl_ops->setpfcstate)
460 netdev->dcbnl_ops->setpfcstate(netdev, value);
465 static int dcbnl_getapp(struct net_device *netdev, struct nlmsghdr *nlh,
496 if (netdev->dcbnl_ops->getapp) {
497 ret = netdev->dcbnl_ops->getapp(netdev, idtype, id);
507 up = dcb_getapp(netdev, &app);
535 static int dcbnl_setapp(struct net_device *netdev, struct nlmsghdr *nlh,
567 if (netdev->dcbnl_ops->setapp) {
568 ret = netdev->dcbnl_ops->setapp(netdev, idtype, id, up);
576 ret = dcb_setapp(netdev, &app);
580 dcbnl_cee_notify(netdev, RTM_SETDCB, DCB_CMD_SAPP, seq, 0);
585 static int __dcbnl_pg_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,
599 if (!netdev->dcbnl_ops->getpgtccfgtx ||
600 !netdev->dcbnl_ops->getpgtccfgrx ||
601 !netdev->dcbnl_ops->getpgbwgcfgtx ||
602 !netdev->dcbnl_ops->getpgbwgcfgrx)
643 netdev->dcbnl_ops->getpgtccfgrx(netdev,
648 netdev->dcbnl_ops->getpgtccfgtx(netdev,
697 netdev->dcbnl_ops->getpgbwgcfgrx(netdev,
701 netdev->dcbnl_ops->getpgbwgcfgtx(netdev,
721 static int dcbnl_pgtx_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,
724 return __dcbnl_pg_getcfg(netdev, nlh, tb, skb, 0);
727 static int dcbnl_pgrx_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,
730 return __dcbnl_pg_getcfg(netdev, nlh, tb, skb, 1);
733 static int dcbnl_setstate(struct net_device *netdev, struct nlmsghdr *nlh,
741 if (!netdev->dcbnl_ops->setstate)
747 netdev->dcbnl_ops->setstate(netdev, value));
750 static int dcbnl_setpfccfg(struct net_device *netdev, struct nlmsghdr *nlh,
761 if (!netdev->dcbnl_ops->setpfccfg)
774 netdev->dcbnl_ops->setpfccfg(netdev,
781 static int dcbnl_setall(struct net_device *netdev, struct nlmsghdr *nlh,
789 if (!netdev->dcbnl_ops->setall)
793 netdev->dcbnl_ops->setall(netdev));
794 dcbnl_cee_notify(netdev, RTM_SETDCB, DCB_CMD_SET_ALL, seq, 0);
799 static int __dcbnl_pg_setcfg(struct net_device *netdev, struct nlmsghdr *nlh,
815 if (!netdev->dcbnl_ops->setpgtccfgtx ||
816 !netdev->dcbnl_ops->setpgtccfgrx ||
817 !netdev->dcbnl_ops->setpgbwgcfgtx ||
818 !netdev->dcbnl_ops->setpgbwgcfgrx)
860 netdev->dcbnl_ops->setpgtccfgrx(netdev,
865 netdev->dcbnl_ops->setpgtccfgtx(netdev,
880 netdev->dcbnl_ops->setpgbwgcfgrx(netdev,
884 netdev->dcbnl_ops->setpgbwgcfgtx(netdev,
892 static int dcbnl_pgtx_setcfg(struct net_device *netdev, struct nlmsghdr *nlh,
895 return __dcbnl_pg_setcfg(netdev, nlh, seq, tb, skb, 0);
898 static int dcbnl_pgrx_setcfg(struct net_device *netdev, struct nlmsghdr *nlh,
901 return __dcbnl_pg_setcfg(netdev, nlh, seq, tb, skb, 1);
904 static int dcbnl_bcn_getcfg(struct net_device *netdev, struct nlmsghdr *nlh,
918 if (!netdev->dcbnl_ops->getbcnrp ||
919 !netdev->dcbnl_ops->getbcncfg)
939 netdev->dcbnl_ops->getbcnrp(netdev, i - DCB_BCN_ATTR_RP_0,
950 netdev->dcbnl_ops->getbcncfg(netdev, i,
966 static int dcbnl_bcn_setcfg(struct net_device *netdev, struct nlmsghdr *nlh,
978 if (!netdev->dcbnl_ops->setbcncfg ||
979 !netdev->dcbnl_ops->setbcnrp)
992 netdev->dcbnl_ops->setbcnrp(netdev,
1000 netdev->dcbnl_ops->setbcncfg(netdev,
1007 static int dcbnl_build_peer_app(struct net_device *netdev, struct sk_buff* skb,
1013 const struct dcbnl_rtnl_ops *ops = netdev->dcbnl_ops;
1022 err = ops->peer_getappinfo(netdev, &info, &app_count);
1029 err = ops->peer_getapptable(netdev, table);
1064 static int dcbnl_getapptrust(struct net_device *netdev, struct sk_buff *skb)
1066 const struct dcbnl_rtnl_ops *ops = netdev->dcbnl_ops;
1076 err = ops->dcbnl_getapptrust(netdev, selectors, &nselectors);
1107 struct net_device *netdev,
1130 err = setdel(netdev, app_data);
1139 static int dcbnl_ieee_fill(struct sk_buff *skb, struct net_device *netdev)
1141 const struct dcbnl_rtnl_ops *ops = netdev->dcbnl_ops;
1147 if (nla_put_string(skb, DCB_ATTR_IFNAME, netdev->name))
1157 err = ops->ieee_getets(netdev, &ets);
1166 err = ops->ieee_getmaxrate(netdev, &maxrate);
1179 err = ops->ieee_getqcn(netdev, &qcn);
1192 err = ops->ieee_getqcnstats(netdev, &qcn_stats);
1204 err = ops->ieee_getpfc(netdev, &pfc);
1214 err = ops->dcbnl_getbuffer(netdev, &buffer);
1226 if (itr->ifindex == netdev->ifindex) {
1237 if (netdev->dcbnl_ops->getdcbx)
1238 dcbx = netdev->dcbnl_ops->getdcbx(netdev);
1251 if (itr->ifindex == netdev->ifindex) {
1267 err = dcbnl_getapptrust(netdev, skb);
1276 err = ops->ieee_peer_getets(netdev, &ets);
1285 err = ops->ieee_peer_getpfc(netdev, &pfc);
1292 err = dcbnl_build_peer_app(netdev, skb,
1363 static int dcbnl_cee_fill(struct sk_buff *skb, struct net_device *netdev)
1367 const struct dcbnl_rtnl_ops *ops = netdev->dcbnl_ops;
1371 if (nla_put_string(skb, DCB_ATTR_IFNAME, netdev->name))
1379 err = dcbnl_cee_pg_fill(skb, netdev, 1);
1385 err = dcbnl_cee_pg_fill(skb, netdev, 0);
1399 ops->getpfccfg(netdev, i - DCB_PFC_UP_ATTR_0, &value);
1413 if (itr->ifindex == netdev->ifindex) {
1439 if (netdev->dcbnl_ops->getdcbx)
1440 dcbx = netdev->dcbnl_ops->getdcbx(netdev);
1455 if (!ops->getfeatcfg(netdev, i, &value) &&
1466 err = ops->cee_peer_getpg(netdev, &pg);
1475 err = ops->cee_peer_getpfc(netdev, &pfc);
1482 err = dcbnl_build_peer_app(netdev, skb,
1560 static int dcbnl_ieee_set(struct net_device *netdev, struct nlmsghdr *nlh,
1563 const struct dcbnl_rtnl_ops *ops = netdev->dcbnl_ops;
1582 err = ops->ieee_setets(netdev, ets);
1590 err = ops->ieee_setmaxrate(netdev, maxrate);
1599 err = ops->ieee_setqcn(netdev, qcn);
1606 err = ops->ieee_setpfc(netdev, pfc);
1622 err = ops->dcbnl_setbuffer(netdev, buffer);
1629 netdev,
1637 netdev, ops->ieee_setapp ?:
1685 err = ops->dcbnl_setapptrust(netdev, selectors, nselectors);
1692 dcbnl_ieee_notify(netdev, RTM_SETDCB, DCB_CMD_IEEE_SET, seq, 0);
1696 static int dcbnl_ieee_get(struct net_device *netdev, struct nlmsghdr *nlh,
1699 const struct dcbnl_rtnl_ops *ops = netdev->dcbnl_ops;
1704 return dcbnl_ieee_fill(skb, netdev);
1707 static int dcbnl_ieee_del(struct net_device *netdev, struct nlmsghdr *nlh,
1710 const struct dcbnl_rtnl_ops *ops = netdev->dcbnl_ops;
1728 netdev, ops->ieee_delapp ?:
1736 netdev,
1744 dcbnl_ieee_notify(netdev, RTM_SETDCB, DCB_CMD_IEEE_DEL, seq, 0);
1750 static int dcbnl_getdcbx(struct net_device *netdev, struct nlmsghdr *nlh,
1753 if (!netdev->dcbnl_ops->getdcbx)
1757 netdev->dcbnl_ops->getdcbx(netdev));
1760 static int dcbnl_setdcbx(struct net_device *netdev, struct nlmsghdr *nlh,
1765 if (!netdev->dcbnl_ops->setdcbx)
1774 netdev->dcbnl_ops->setdcbx(netdev, value));
1777 static int dcbnl_getfeatcfg(struct net_device *netdev, struct nlmsghdr *nlh,
1785 if (!netdev->dcbnl_ops->getfeatcfg)
1808 ret = netdev->dcbnl_ops->getfeatcfg(netdev, i, &value);
1823 static int dcbnl_setfeatcfg(struct net_device *netdev, struct nlmsghdr *nlh,
1830 if (!netdev->dcbnl_ops->setfeatcfg)
1849 ret = netdev->dcbnl_ops->setfeatcfg(netdev, i, value);
1861 static int dcbnl_cee_get(struct net_device *netdev, struct nlmsghdr *nlh,
1864 const struct dcbnl_rtnl_ops *ops = netdev->dcbnl_ops;
1869 return dcbnl_cee_fill(skb, netdev);
1915 struct net_device *netdev;
1945 netdev = __dev_get_by_name(net, nla_data(tb[DCB_ATTR_IFNAME]));
1946 if (!netdev)
1949 if (!netdev->dcbnl_ops)
1957 ret = fn->cb(netdev, nlh, nlh->nlmsg_seq, tb, reply_skb);