diff options
author | Remi Denis-Courmont <remi.denis-courmont@nokia.com> | 2008-09-22 23:03:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-22 23:03:44 -0400 |
commit | f8ff60283de2b6775d7a14619056a08e3083bd40 (patch) | |
tree | aea8a14283aa5b5f7952e6e7b8e4adcc4422c592 /include/net/phonet | |
parent | 8ead536dec142f27d5b5f72c3994eb39f4741717 (diff) |
Phonet: network device and address handling
This provides support for adding Phonet addresses to and removing
Phonet addresses from network devices.
Signed-off-by: RĂ©mi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/phonet')
-rw-r--r-- | include/net/phonet/pn_dev.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h new file mode 100644 index 000000000000..bbd2a836e04c --- /dev/null +++ b/include/net/phonet/pn_dev.h | |||
@@ -0,0 +1,50 @@ | |||
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 | |||
26 | struct phonet_device_list { | ||
27 | struct list_head list; | ||
28 | spinlock_t lock; | ||
29 | }; | ||
30 | |||
31 | extern struct phonet_device_list pndevs; | ||
32 | |||
33 | struct phonet_device { | ||
34 | struct list_head list; | ||
35 | struct net_device *netdev; | ||
36 | DECLARE_BITMAP(addrs, 64); | ||
37 | }; | ||
38 | |||
39 | void phonet_device_init(void); | ||
40 | void phonet_device_exit(void); | ||
41 | struct net_device *phonet_device_get(struct net *net); | ||
42 | |||
43 | int phonet_address_add(struct net_device *dev, u8 addr); | ||
44 | int phonet_address_del(struct net_device *dev, u8 addr); | ||
45 | u8 phonet_address_get(struct net_device *dev, u8 addr); | ||
46 | int phonet_address_lookup(u8 addr); | ||
47 | |||
48 | #define PN_NO_ADDR 0xff | ||
49 | |||
50 | #endif | ||