Thomas Gleixner | 2b27bdc | 2019-05-29 16:57:50 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Remi Denis-Courmont | f8ff602 | 2008-09-22 20:03:44 -0700 | [diff] [blame] | 2 | /* |
| 3 | * File: pn_dev.h |
| 4 | * |
| 5 | * Phonet network device |
| 6 | * |
| 7 | * Copyright (C) 2008 Nokia Corporation. |
Remi Denis-Courmont | f8ff602 | 2008-09-22 20:03:44 -0700 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | #ifndef PN_DEV_H |
| 11 | #define PN_DEV_H |
| 12 | |
| 13 | struct phonet_device_list { |
| 14 | struct list_head list; |
Rémi Denis-Courmont | eeb74a9d | 2009-11-18 10:08:26 -0800 | [diff] [blame] | 15 | struct mutex lock; |
Remi Denis-Courmont | f8ff602 | 2008-09-22 20:03:44 -0700 | [diff] [blame] | 16 | }; |
| 17 | |
remi.denis-courmont@nokia | 9a3b7a4 | 2009-01-23 03:00:30 +0000 | [diff] [blame] | 18 | struct phonet_device_list *phonet_device_list(struct net *net); |
Remi Denis-Courmont | f8ff602 | 2008-09-22 20:03:44 -0700 | [diff] [blame] | 19 | |
| 20 | struct phonet_device { |
| 21 | struct list_head list; |
| 22 | struct net_device *netdev; |
| 23 | DECLARE_BITMAP(addrs, 64); |
Jiri Pirko | 88e7594 | 2010-06-07 03:27:39 +0000 | [diff] [blame] | 24 | struct rcu_head rcu; |
Remi Denis-Courmont | f8ff602 | 2008-09-22 20:03:44 -0700 | [diff] [blame] | 25 | }; |
| 26 | |
remi.denis-courmont@nokia | 76e02cf | 2009-01-23 03:00:27 +0000 | [diff] [blame] | 27 | int phonet_device_init(void); |
Remi Denis-Courmont | f8ff602 | 2008-09-22 20:03:44 -0700 | [diff] [blame] | 28 | void phonet_device_exit(void); |
remi.denis-courmont@nokia | 660f706 | 2009-01-23 03:00:28 +0000 | [diff] [blame] | 29 | int phonet_netlink_register(void); |
Remi Denis-Courmont | f8ff602 | 2008-09-22 20:03:44 -0700 | [diff] [blame] | 30 | struct net_device *phonet_device_get(struct net *net); |
| 31 | |
| 32 | int phonet_address_add(struct net_device *dev, u8 addr); |
| 33 | int phonet_address_del(struct net_device *dev, u8 addr); |
| 34 | u8 phonet_address_get(struct net_device *dev, u8 addr); |
Rémi Denis-Courmont | 5240488 | 2008-12-03 15:42:56 -0800 | [diff] [blame] | 35 | int phonet_address_lookup(struct net *net, u8 addr); |
Rémi Denis-Courmont | c7a1a4c | 2009-06-24 01:07:44 +0000 | [diff] [blame] | 36 | void phonet_address_notify(int event, struct net_device *dev, u8 addr); |
Remi Denis-Courmont | f8ff602 | 2008-09-22 20:03:44 -0700 | [diff] [blame] | 37 | |
Rémi Denis-Courmont | 55748ac0 | 2009-10-14 00:48:28 +0000 | [diff] [blame] | 38 | int phonet_route_add(struct net_device *dev, u8 daddr); |
| 39 | int phonet_route_del(struct net_device *dev, u8 daddr); |
Rémi Denis-Courmont | f062f41 | 2009-10-14 00:48:29 +0000 | [diff] [blame] | 40 | void rtm_phonet_notify(int event, struct net_device *dev, u8 dst); |
Eric Dumazet | e67f88d | 2011-04-27 22:56:07 +0000 | [diff] [blame] | 41 | struct net_device *phonet_route_get_rcu(struct net *net, u8 daddr); |
Rémi Denis-Courmont | 55748ac0 | 2009-10-14 00:48:28 +0000 | [diff] [blame] | 42 | struct net_device *phonet_route_output(struct net *net, u8 daddr); |
| 43 | |
Remi Denis-Courmont | f8ff602 | 2008-09-22 20:03:44 -0700 | [diff] [blame] | 44 | #define PN_NO_ADDR 0xff |
| 45 | |
Christoph Hellwig | c350637 | 2018-04-10 19:42:55 +0200 | [diff] [blame] | 46 | extern const struct seq_operations pn_sock_seq_ops; |
| 47 | extern const struct seq_operations pn_res_seq_ops; |
Rémi Denis-Courmont | c1dc13e | 2009-07-21 01:57:57 +0000 | [diff] [blame] | 48 | |
Remi Denis-Courmont | f8ff602 | 2008-09-22 20:03:44 -0700 | [diff] [blame] | 49 | #endif |