18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * File: pn_dev.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Phonet network device
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (C) 2008 Nokia Corporation.
88c2ecf20Sopenharmony_ci */
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci#ifndef PN_DEV_H
118c2ecf20Sopenharmony_ci#define PN_DEV_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_cistruct phonet_device_list {
148c2ecf20Sopenharmony_ci	struct list_head list;
158c2ecf20Sopenharmony_ci	struct mutex lock;
168c2ecf20Sopenharmony_ci};
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_cistruct phonet_device_list *phonet_device_list(struct net *net);
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_cistruct phonet_device {
218c2ecf20Sopenharmony_ci	struct list_head list;
228c2ecf20Sopenharmony_ci	struct net_device *netdev;
238c2ecf20Sopenharmony_ci	DECLARE_BITMAP(addrs, 64);
248c2ecf20Sopenharmony_ci	struct rcu_head	rcu;
258c2ecf20Sopenharmony_ci};
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ciint phonet_device_init(void);
288c2ecf20Sopenharmony_civoid phonet_device_exit(void);
298c2ecf20Sopenharmony_ciint phonet_netlink_register(void);
308c2ecf20Sopenharmony_cistruct net_device *phonet_device_get(struct net *net);
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ciint phonet_address_add(struct net_device *dev, u8 addr);
338c2ecf20Sopenharmony_ciint phonet_address_del(struct net_device *dev, u8 addr);
348c2ecf20Sopenharmony_ciu8 phonet_address_get(struct net_device *dev, u8 addr);
358c2ecf20Sopenharmony_ciint phonet_address_lookup(struct net *net, u8 addr);
368c2ecf20Sopenharmony_civoid phonet_address_notify(int event, struct net_device *dev, u8 addr);
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ciint phonet_route_add(struct net_device *dev, u8 daddr);
398c2ecf20Sopenharmony_ciint phonet_route_del(struct net_device *dev, u8 daddr);
408c2ecf20Sopenharmony_civoid rtm_phonet_notify(int event, struct net_device *dev, u8 dst);
418c2ecf20Sopenharmony_cistruct net_device *phonet_route_get_rcu(struct net *net, u8 daddr);
428c2ecf20Sopenharmony_cistruct net_device *phonet_route_output(struct net *net, u8 daddr);
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#define PN_NO_ADDR	0xff
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ciextern const struct seq_operations pn_sock_seq_ops;
478c2ecf20Sopenharmony_ciextern const struct seq_operations pn_res_seq_ops;
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci#endif
50