Loading...
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * File: pn_dev.h
4 *
5 * Phonet network device
6 *
7 * Copyright (C) 2008 Nokia Corporation.
8 */
9
10#ifndef PN_DEV_H
11#define PN_DEV_H
12
13struct phonet_device_list {
14 struct list_head list;
15 struct mutex lock;
16};
17
18struct phonet_device_list *phonet_device_list(struct net *net);
19
20struct phonet_device {
21 struct list_head list;
22 struct net_device *netdev;
23 DECLARE_BITMAP(addrs, 64);
24 struct rcu_head rcu;
25};
26
27int phonet_device_init(void);
28void phonet_device_exit(void);
29int phonet_netlink_register(void);
30struct net_device *phonet_device_get(struct net *net);
31
32int phonet_address_add(struct net_device *dev, u8 addr);
33int phonet_address_del(struct net_device *dev, u8 addr);
34u8 phonet_address_get(struct net_device *dev, u8 addr);
35int phonet_address_lookup(struct net *net, u8 addr);
36void phonet_address_notify(int event, struct net_device *dev, u8 addr);
37
38int phonet_route_add(struct net_device *dev, u8 daddr);
39int phonet_route_del(struct net_device *dev, u8 daddr);
40void rtm_phonet_notify(int event, struct net_device *dev, u8 dst);
41struct net_device *phonet_route_get_rcu(struct net *net, u8 daddr);
42struct net_device *phonet_route_output(struct net *net, u8 daddr);
43
44#define PN_NO_ADDR 0xff
45
46extern const struct seq_operations pn_sock_seq_ops;
47extern const struct seq_operations pn_res_seq_ops;
48
49#endif
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * File: pn_dev.h
4 *
5 * Phonet network device
6 *
7 * Copyright (C) 2008 Nokia Corporation.
8 */
9
10#ifndef PN_DEV_H
11#define PN_DEV_H
12
13struct phonet_device_list {
14 struct list_head list;
15 struct mutex lock;
16};
17
18struct phonet_device_list *phonet_device_list(struct net *net);
19
20struct phonet_device {
21 struct list_head list;
22 struct net_device *netdev;
23 DECLARE_BITMAP(addrs, 64);
24 struct rcu_head rcu;
25};
26
27int phonet_device_init(void);
28void phonet_device_exit(void);
29int phonet_netlink_register(void);
30struct net_device *phonet_device_get(struct net *net);
31
32int phonet_address_add(struct net_device *dev, u8 addr);
33int phonet_address_del(struct net_device *dev, u8 addr);
34u8 phonet_address_get(struct net_device *dev, u8 addr);
35int phonet_address_lookup(struct net *net, u8 addr);
36void phonet_address_notify(int event, struct net_device *dev, u8 addr);
37
38int phonet_route_add(struct net_device *dev, u8 daddr);
39int phonet_route_del(struct net_device *dev, u8 daddr);
40void rtm_phonet_notify(int event, struct net_device *dev, u8 dst);
41struct net_device *phonet_route_get_rcu(struct net *net, u8 daddr);
42struct net_device *phonet_route_output(struct net *net, u8 daddr);
43
44#define PN_NO_ADDR 0xff
45
46extern const struct seq_operations pn_sock_seq_ops;
47extern const struct seq_operations pn_res_seq_ops;
48
49#endif