Lines Matching defs:ops

396 	const struct rtnl_link_ops *ops;
398 list_for_each_entry(ops, &link_ops, list) {
399 if (!strcmp(ops->kind, kind))
400 return ops;
407 * @ops: struct rtnl_link_ops * to register
415 int __rtnl_link_register(struct rtnl_link_ops *ops)
417 if (rtnl_link_ops_get(ops->kind))
420 /* The check for alloc/setup is here because if ops
422 * to use the ops for creating device. So do not
425 if ((ops->alloc || ops->setup) && !ops->dellink)
426 ops->dellink = unregister_netdevice_queue;
428 list_add_tail(&ops->list, &link_ops);
435 * @ops: struct rtnl_link_ops * to register
439 int rtnl_link_register(struct rtnl_link_ops *ops)
444 if (WARN_ON(ops->maxtype > RTNL_MAX_TYPE ||
445 ops->slave_maxtype > RTNL_SLAVE_MAX_TYPE))
449 err = __rtnl_link_register(ops);
455 static void __rtnl_kill_links(struct net *net, struct rtnl_link_ops *ops)
461 if (dev->rtnl_link_ops == ops)
462 ops->dellink(dev, &list_kill);
469 * @ops: struct rtnl_link_ops * to unregister
475 void __rtnl_link_unregister(struct rtnl_link_ops *ops)
480 __rtnl_kill_links(net, ops);
482 list_del(&ops->list);
519 * @ops: struct rtnl_link_ops * to unregister
521 void rtnl_link_unregister(struct rtnl_link_ops *ops)
526 __rtnl_link_unregister(ops);
535 const struct rtnl_link_ops *ops;
544 ops = master_dev->rtnl_link_ops;
545 if (!ops || !ops->get_slave_size)
549 ops->get_slave_size(master_dev, dev);
558 const struct rtnl_link_ops *ops = dev->rtnl_link_ops;
561 if (!ops)
565 nla_total_size(strlen(ops->kind) + 1); /* IFLA_INFO_KIND */
567 if (ops->get_size)
570 ops->get_size(dev);
572 if (ops->get_xstats_size)
574 size += nla_total_size(ops->get_xstats_size(dev));
585 const struct rtnl_af_ops *ops;
589 list_for_each_entry(ops, &rtnl_af_ops, list) {
590 if (ops->family == family)
591 return ops;
599 * @ops: struct rtnl_af_ops * to register
603 void rtnl_af_register(struct rtnl_af_ops *ops)
606 list_add_tail_rcu(&ops->list, &rtnl_af_ops);
613 * @ops: struct rtnl_af_ops * to unregister
615 void rtnl_af_unregister(struct rtnl_af_ops *ops)
618 list_del_rcu(&ops->list);
665 const struct rtnl_link_ops *ops;
672 ops = master_dev->rtnl_link_ops;
673 if (!ops)
675 if (nla_put_string(skb, IFLA_INFO_SLAVE_KIND, ops->kind) < 0)
677 if (ops->fill_slave_info) {
681 err = ops->fill_slave_info(skb, master_dev, dev);
696 const struct rtnl_link_ops *ops = dev->rtnl_link_ops;
700 if (!ops)
702 if (nla_put_string(skb, IFLA_INFO_KIND, ops->kind) < 0)
704 if (ops->fill_xstats) {
705 err = ops->fill_xstats(skb, dev);
709 if (ops->fill_info) {
713 err = ops->fill_info(skb, dev);
1830 nla_put_string(skb, IFLA_QDISC, qdisc->ops->id)) ||
2040 const struct rtnl_link_ops *ops = NULL;
2050 ops = rtnl_link_ops_get(kind);
2053 return ops;
2386 const struct net_device_ops *ops = dev->netdev_ops;
2388 if (!ops->ndo_set_vf_rate)
2393 return ops->ndo_set_vf_rate(dev, vf, min_tx_rate, max_tx_rate);
2466 const struct net_device_ops *ops = dev->netdev_ops;
2468 return ops->ndo_set_vf_guid(dev, ivt->vf, ivt->guid, guid_type);
2481 const struct net_device_ops *ops = dev->netdev_ops;
2490 if (ops->ndo_set_vf_mac)
2491 err = ops->ndo_set_vf_mac(dev, ivm->vf,
2503 if (ops->ndo_set_vf_vlan)
2504 err = ops->ndo_set_vf_vlan(dev, ivv->vf, ivv->vlan,
2517 if (!ops->ndo_set_vf_vlan)
2536 err = ops->ndo_set_vf_vlan(dev, ivvl[0]->vf, ivvl[0]->vlan,
2549 if (ops->ndo_get_vf_config)
2550 err = ops->ndo_get_vf_config(dev, ivt->vf, &ivf);
2578 if (ops->ndo_set_vf_spoofchk)
2579 err = ops->ndo_set_vf_spoofchk(dev, ivs->vf,
2591 if (ops->ndo_set_vf_link_state)
2592 err = ops->ndo_set_vf_link_state(dev, ivl->vf,
2605 if (ops->ndo_set_vf_rss_query_en)
2606 err = ops->ndo_set_vf_rss_query_en(dev, ivrssq_en->vf,
2618 if (ops->ndo_set_vf_trust)
2619 err = ops->ndo_set_vf_trust(dev, ivt->vf, ivt->setting);
2629 if (!ops->ndo_set_vf_guid)
2639 if (!ops->ndo_set_vf_guid)
2652 const struct net_device_ops *ops;
2658 ops = upper_dev->netdev_ops;
2659 if (ops->ndo_del_slave) {
2660 err = ops->ndo_del_slave(upper_dev, dev);
2672 ops = upper_dev->netdev_ops;
2673 if (ops->ndo_add_slave) {
2674 err = ops->ndo_add_slave(upper_dev, dev, extack);
2752 const struct net_device_ops *ops = dev->netdev_ops;
2789 if (!ops->ndo_set_config) {
2807 err = ops->ndo_set_config(dev, &k_map);
2992 if (!ops->ndo_set_vf_port)
3012 err = ops->ndo_set_vf_port(dev, vf, port);
3030 if (ops->ndo_set_vf_port)
3031 err = ops->ndo_set_vf_port(dev, PORT_SELF_VF, port);
3192 const struct rtnl_link_ops *ops;
3195 ops = dev->rtnl_link_ops;
3196 if (!ops || !ops->dellink)
3206 const struct rtnl_link_ops *ops;
3208 ops = dev->rtnl_link_ops;
3209 ops->dellink(dev, &list_kill);
3219 const struct rtnl_link_ops *ops;
3222 ops = dev->rtnl_link_ops;
3223 if (!ops || !ops->dellink)
3226 ops->dellink(dev, &list_kill);
3314 const struct rtnl_link_ops *ops,
3325 else if (ops->get_num_tx_queues)
3326 num_tx_queues = ops->get_num_tx_queues();
3330 else if (ops->get_num_rx_queues)
3331 num_rx_queues = ops->get_num_rx_queues();
3343 if (ops->alloc) {
3344 dev = ops->alloc(tb, ifname, name_assign_type,
3349 dev = alloc_netdev_mqs(ops->priv_size, ifname,
3350 name_assign_type, ops->setup,
3364 dev->rtnl_link_ops = ops;
3432 const struct rtnl_link_ops *ops,
3445 if (!ops->alloc && !ops->setup)
3451 snprintf(ifname, IFNAMSIZ, "%s%%d", ops->kind);
3476 name_assign_type, ops, tb, extack);
3484 if (ops->newlink)
3485 err = ops->newlink(link_net ? : net, dev, tb, data, extack);
3512 if (ops->newlink) {
3515 ops->dellink(dev, &list_kill);
3538 const struct rtnl_link_ops *ops;
3593 ops = rtnl_link_ops_get(kind);
3596 ops = NULL;
3600 if (ops) {
3601 if (ops->maxtype > RTNL_MAX_TYPE)
3604 if (ops->maxtype && linkinfo[IFLA_INFO_DATA]) {
3605 err = nla_parse_nested_deprecated(tbs->attr, ops->maxtype,
3607 ops->policy, extack);
3612 if (ops->validate) {
3613 err = ops->validate(tb, data, extack);
3650 if (!ops || ops != dev->rtnl_link_ops ||
3651 !ops->changelink)
3654 err = ops->changelink(dev, tb, data, extack);
3690 if (!ops) {
3696 ops = rtnl_link_ops_get(kind);
3697 if (ops)
3705 return rtnl_newlink_create(skb, ifm, ops, nlh, tb, data, extack);
4276 const struct net_device_ops *ops = br_dev->netdev_ops;
4278 err = ops->ndo_fdb_add(ndm, tb, dev, addr, vid,
4346 const struct net_device_ops *ops;
4403 ops = br_dev->netdev_ops;
4405 if (ops->ndo_fdb_del)
4406 err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid, extack);
4408 if (ops->ndo_fdb_del_bulk)
4409 err = ops->ndo_fdb_del_bulk(ndm, tb, dev, vid,
4421 ops = dev->netdev_ops;
4423 if (ops->ndo_fdb_del)
4424 err = ops->ndo_fdb_del(ndm, tb, dev, addr, vid, extack);
4430 if (ops->ndo_fdb_del_bulk)
4431 err = ops->ndo_fdb_del_bulk(ndm, tb, dev, vid,
4601 const struct net_device_ops *ops = NULL;
4626 ops = br_dev->netdev_ops;
4653 cops = ops;
4764 const struct net_device_ops *ops = NULL;
4804 ops = br_dev->netdev_ops;
4818 ops = br_dev->netdev_ops;
4824 ops = dev->netdev_ops;
4833 if (!ops || !ops->ndo_fdb_get) {
4844 err = ops->ndo_fdb_get(skb, tb, dev, addr, vid,
5039 const struct net_device_ops *ops = dev->netdev_ops;
5057 if (ops->ndo_bridge_getlink) {
5059 err = ops->ndo_bridge_getlink(skb, portid,
5604 const struct rtnl_link_ops *ops = dev->rtnl_link_ops;
5606 if (ops && ops->fill_linkxstats) {
5615 err = ops->fill_linkxstats(skb, dev, prividx, *idxattr);
5625 const struct rtnl_link_ops *ops = NULL;
5630 ops = master->rtnl_link_ops;
5631 if (ops && ops->fill_linkxstats) {
5640 err = ops->fill_linkxstats(skb, dev, prividx, *idxattr);
5738 const struct rtnl_link_ops *ops = dev->rtnl_link_ops;
5741 if (ops && ops->get_linkxstats_size) {
5742 size += nla_total_size(ops->get_linkxstats_size(dev,
5751 const struct rtnl_link_ops *ops = NULL;
5757 ops = master->rtnl_link_ops;
5758 if (ops && ops->get_linkxstats_size) {
5761 size += nla_total_size(ops->get_linkxstats_size(dev,