|
23 | 23 | #include <linux/build_bug.h>
|
24 | 24 | #include <linux/clk.h>
|
25 | 25 | #include <linux/errname.h>
|
| 26 | +#include <linux/etherdevice.h> |
26 | 27 | #include <linux/fs_parser.h>
|
27 | 28 | #include <linux/gfp.h>
|
28 | 29 | #include <linux/highmem.h>
|
@@ -478,6 +479,12 @@ void *rust_helper_dev_get_drvdata(struct device *dev)
|
478 | 479 | }
|
479 | 480 | EXPORT_SYMBOL_GPL(rust_helper_dev_get_drvdata);
|
480 | 481 |
|
| 482 | +void rust_helper_dev_set_drvdata(struct device *dev, void *data) |
| 483 | +{ |
| 484 | + dev_set_drvdata(dev, data); |
| 485 | +} |
| 486 | +EXPORT_SYMBOL_GPL(rust_helper_dev_set_drvdata); |
| 487 | + |
481 | 488 | const char *rust_helper_dev_name(const struct device *dev)
|
482 | 489 | {
|
483 | 490 | return dev_name(dev);
|
@@ -655,6 +662,36 @@ int rust_helper_fs_parse(struct fs_context *fc,
|
655 | 662 | }
|
656 | 663 | EXPORT_SYMBOL_GPL(rust_helper_fs_parse);
|
657 | 664 |
|
| 665 | +#ifdef CONFIG_NET |
| 666 | +void rust_helper_eth_hw_addr_set(struct net_device *dev, const u8 *addr) |
| 667 | +{ |
| 668 | + eth_hw_addr_set(dev, addr); |
| 669 | +} |
| 670 | +EXPORT_SYMBOL_GPL(rust_helper_eth_hw_addr_set); |
| 671 | + |
| 672 | +void rust_helper_netif_start_queue(struct net_device *dev) |
| 673 | +{ |
| 674 | + netif_start_queue(dev); |
| 675 | +} |
| 676 | +EXPORT_SYMBOL_GPL(rust_helper_netif_start_queue); |
| 677 | + |
| 678 | +void rust_helper_netif_stop_queue(struct net_device *dev) { |
| 679 | + netif_stop_queue(dev); |
| 680 | +} |
| 681 | +EXPORT_SYMBOL_GPL(rust_helper_netif_stop_queue); |
| 682 | + |
| 683 | +void rust_helper_netdev_sent_queue(struct net_device *dev, unsigned int bytes) { |
| 684 | + return netdev_sent_queue(dev, bytes); |
| 685 | +} |
| 686 | +EXPORT_SYMBOL_GPL(rust_helper_netdev_sent_queue); |
| 687 | + |
| 688 | +struct sk_buff *rust_helper_netdev_alloc_skb_ip_align(struct net_device *dev, |
| 689 | + unsigned int length) { |
| 690 | + return netdev_alloc_skb_ip_align(dev, length); |
| 691 | +} |
| 692 | +EXPORT_SYMBOL_GPL(rust_helper_netdev_alloc_skb_ip_align); |
| 693 | +#endif |
| 694 | + |
658 | 695 | /*
|
659 | 696 | * We use `bindgen`'s `--size_t-is-usize` option to bind the C `size_t` type
|
660 | 697 | * as the Rust `usize` type, so we can use it in contexts where Rust
|
|
0 commit comments