Linux Audio

Check our new training course

Loading...
v6.13.7
 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
13#include <linux/list.h>
14#include <linux/spinlock.h>
15
16struct net;
17
18struct phonet_device_list {
19	struct list_head list;
20	spinlock_t lock;
21};
22
23struct phonet_device_list *phonet_device_list(struct net *net);
24
25struct phonet_device {
26	struct list_head list;
27	struct net_device *netdev;
28	DECLARE_BITMAP(addrs, 64);
29	struct rcu_head	rcu;
30};
31
32int phonet_device_init(void);
33void phonet_device_exit(void);
34int phonet_netlink_register(void);
35struct net_device *phonet_device_get(struct net *net);
36
37int phonet_address_add(struct net_device *dev, u8 addr);
38int phonet_address_del(struct net_device *dev, u8 addr);
39u8 phonet_address_get(struct net_device *dev, u8 addr);
40int phonet_address_lookup(struct net *net, u8 addr);
41void phonet_address_notify(struct net *net, int event, u32 ifindex, u8 addr);
42
43int phonet_route_add(struct net_device *dev, u8 daddr);
44int phonet_route_del(struct net_device *dev, u8 daddr);
45void rtm_phonet_notify(struct net *net, int event, u32 ifindex, u8 dst);
46struct net_device *phonet_route_get_rcu(struct net *net, u8 daddr);
47struct net_device *phonet_route_output(struct net *net, u8 daddr);
48
49#define PN_NO_ADDR	0xff
50
51extern const struct seq_operations pn_sock_seq_ops;
52extern const struct seq_operations pn_res_seq_ops;
53
54#endif
v3.1
 
 1/*
 2 * File: pn_dev.h
 3 *
 4 * Phonet network device
 5 *
 6 * Copyright (C) 2008 Nokia Corporation.
 7 *
 8 * This program is free software; you can redistribute it and/or
 9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 */
22
23#ifndef PN_DEV_H
24#define PN_DEV_H
25
 
 
 
 
 
26struct phonet_device_list {
27	struct list_head list;
28	struct mutex lock;
29};
30
31struct phonet_device_list *phonet_device_list(struct net *net);
32
33struct phonet_device {
34	struct list_head list;
35	struct net_device *netdev;
36	DECLARE_BITMAP(addrs, 64);
37	struct rcu_head	rcu;
38};
39
40int phonet_device_init(void);
41void phonet_device_exit(void);
42int phonet_netlink_register(void);
43struct net_device *phonet_device_get(struct net *net);
44
45int phonet_address_add(struct net_device *dev, u8 addr);
46int phonet_address_del(struct net_device *dev, u8 addr);
47u8 phonet_address_get(struct net_device *dev, u8 addr);
48int phonet_address_lookup(struct net *net, u8 addr);
49void phonet_address_notify(int event, struct net_device *dev, u8 addr);
50
51int phonet_route_add(struct net_device *dev, u8 daddr);
52int phonet_route_del(struct net_device *dev, u8 daddr);
53void rtm_phonet_notify(int event, struct net_device *dev, u8 dst);
54struct net_device *phonet_route_get_rcu(struct net *net, u8 daddr);
55struct net_device *phonet_route_output(struct net *net, u8 daddr);
56
57#define PN_NO_ADDR	0xff
58
59extern const struct file_operations pn_sock_seq_fops;
60extern const struct file_operations pn_res_seq_fops;
61
62#endif