Commit | Line | Data |
---|---|---|
2b27bdcc | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
f8ff6028 RDC |
2 | /* |
3 | * File: pn_dev.h | |
4 | * | |
5 | * Phonet network device | |
6 | * | |
7 | * Copyright (C) 2008 Nokia Corporation. | |
f8ff6028 RDC |
8 | */ |
9 | ||
10 | #ifndef PN_DEV_H | |
11 | #define PN_DEV_H | |
12 | ||
949d6b40 JK |
13 | #include <linux/list.h> |
14 | #include <linux/mutex.h> | |
15 | ||
16 | struct net; | |
17 | ||
f8ff6028 RDC |
18 | struct phonet_device_list { |
19 | struct list_head list; | |
eeb74a9d | 20 | struct mutex lock; |
f8ff6028 RDC |
21 | }; |
22 | ||
9a3b7a42 | 23 | struct phonet_device_list *phonet_device_list(struct net *net); |
f8ff6028 RDC |
24 | |
25 | struct phonet_device { | |
26 | struct list_head list; | |
27 | struct net_device *netdev; | |
28 | DECLARE_BITMAP(addrs, 64); | |
88e7594a | 29 | struct rcu_head rcu; |
f8ff6028 RDC |
30 | }; |
31 | ||
76e02cf6 | 32 | int phonet_device_init(void); |
f8ff6028 | 33 | void phonet_device_exit(void); |
660f706d | 34 | int phonet_netlink_register(void); |
f8ff6028 RDC |
35 | struct net_device *phonet_device_get(struct net *net); |
36 | ||
37 | int phonet_address_add(struct net_device *dev, u8 addr); | |
38 | int phonet_address_del(struct net_device *dev, u8 addr); | |
39 | u8 phonet_address_get(struct net_device *dev, u8 addr); | |
52404881 | 40 | int phonet_address_lookup(struct net *net, u8 addr); |
c7a1a4c8 | 41 | void phonet_address_notify(int event, struct net_device *dev, u8 addr); |
f8ff6028 | 42 | |
55748ac0 RDC |
43 | int phonet_route_add(struct net_device *dev, u8 daddr); |
44 | int phonet_route_del(struct net_device *dev, u8 daddr); | |
f062f41d | 45 | void rtm_phonet_notify(int event, struct net_device *dev, u8 dst); |
e67f88dd | 46 | struct net_device *phonet_route_get_rcu(struct net *net, u8 daddr); |
55748ac0 RDC |
47 | struct net_device *phonet_route_output(struct net *net, u8 daddr); |
48 | ||
f8ff6028 RDC |
49 | #define PN_NO_ADDR 0xff |
50 | ||
c3506372 CH |
51 | extern const struct seq_operations pn_sock_seq_ops; |
52 | extern const struct seq_operations pn_res_seq_ops; | |
c1dc13e9 | 53 | |
f8ff6028 | 54 | #endif |