blob: 29d126736611c7ad693f9e84439d3bab56f012ad [file] [log] [blame]
Remi Denis-Courmontf8ff6022008-09-22 20:03:44 -07001/*
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 spinlock_t lock;
29};
30
remi.denis-courmont@nokia9a3b7a42009-01-23 03:00:30 +000031struct phonet_device_list *phonet_device_list(struct net *net);
Remi Denis-Courmontf8ff6022008-09-22 20:03:44 -070032
33struct phonet_device {
34 struct list_head list;
35 struct net_device *netdev;
36 DECLARE_BITMAP(addrs, 64);
37};
38
remi.denis-courmont@nokia76e02cf2009-01-23 03:00:27 +000039int phonet_device_init(void);
Remi Denis-Courmontf8ff6022008-09-22 20:03:44 -070040void phonet_device_exit(void);
remi.denis-courmont@nokia660f7062009-01-23 03:00:28 +000041int phonet_netlink_register(void);
Remi Denis-Courmontf8ff6022008-09-22 20:03:44 -070042struct net_device *phonet_device_get(struct net *net);
43
44int phonet_address_add(struct net_device *dev, u8 addr);
45int phonet_address_del(struct net_device *dev, u8 addr);
46u8 phonet_address_get(struct net_device *dev, u8 addr);
Rémi Denis-Courmont52404882008-12-03 15:42:56 -080047int phonet_address_lookup(struct net *net, u8 addr);
Rémi Denis-Courmontc7a1a4c2009-06-24 01:07:44 +000048void phonet_address_notify(int event, struct net_device *dev, u8 addr);
Remi Denis-Courmontf8ff6022008-09-22 20:03:44 -070049
50#define PN_NO_ADDR 0xff
51
52#endif