blob: b23548e0409848530b1c7f94fb805601c46e583c [file] [log] [blame]
Sergey Lapin2c21d112009-06-08 12:18:49 +00001/*
2 * nl802154.h
3 *
4 * Copyright (C) 2007, 2008, 2009 Siemens AG
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2
8 * as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 */
20
21#ifndef IEEE802154_NL_H
22#define IEEE802154_NL_H
23
24struct net_device;
Phoebe Buckheisterae531b92014-03-14 21:24:02 +010025struct ieee802154_addr;
Sergey Lapin2c21d112009-06-08 12:18:49 +000026
Daniel Silverstone878fa892009-07-22 18:51:24 +020027/**
28 * ieee802154_nl_assoc_indic - Notify userland of an association request.
29 * @dev: The network device on which this association request was
30 * received.
31 * @addr: The address of the device requesting association.
32 * @cap: The capability information field from the device.
33 *
34 * This informs a userland coordinator of a device requesting to
35 * associate with the PAN controlled by the coordinator.
36 *
37 * Note: This is in section 7.3.1 of the IEEE 802.15.4-2006 document.
38 */
Sergey Lapin2c21d112009-06-08 12:18:49 +000039int ieee802154_nl_assoc_indic(struct net_device *dev,
Phoebe Buckheisterae531b92014-03-14 21:24:02 +010040 struct ieee802154_addr *addr, u8 cap);
Daniel Silverstone878fa892009-07-22 18:51:24 +020041
42/**
43 * ieee802154_nl_assoc_confirm - Notify userland of association.
44 * @dev: The device which has completed association.
45 * @short_addr: The short address assigned to the device.
46 * @status: The status of the association.
47 *
48 * Inform userland of the result of an association request. If the
49 * association request included asking the coordinator to allocate
50 * a short address then it is returned in @short_addr.
51 *
52 * Note: This is in section 7.3.2 of the IEEE 802.15.4 document.
53 */
Sergey Lapin2c21d112009-06-08 12:18:49 +000054int ieee802154_nl_assoc_confirm(struct net_device *dev,
Phoebe Buckheisterb70ab2e2014-03-14 21:23:59 +010055 __le16 short_addr, u8 status);
Daniel Silverstone878fa892009-07-22 18:51:24 +020056
57/**
58 * ieee802154_nl_disassoc_indic - Notify userland of disassociation.
59 * @dev: The device on which disassociation was indicated.
60 * @addr: The device which is disassociating.
61 * @reason: The reason for the disassociation.
62 *
63 * Inform userland that a device has disassociated from the network.
64 *
65 * Note: This is in section 7.3.3 of the IEEE 802.15.4 document.
66 */
Sergey Lapin2c21d112009-06-08 12:18:49 +000067int ieee802154_nl_disassoc_indic(struct net_device *dev,
Phoebe Buckheisterae531b92014-03-14 21:24:02 +010068 struct ieee802154_addr *addr, u8 reason);
Daniel Silverstone878fa892009-07-22 18:51:24 +020069
70/**
71 * ieee802154_nl_disassoc_confirm - Notify userland of disassociation
72 * completion.
73 * @dev: The device on which disassociation was ordered.
74 * @status: The result of the disassociation.
75 *
76 * Inform userland of the result of requesting that a device
77 * disassociate, or the result of requesting that we disassociate from
78 * a PAN managed by another coordinator.
79 *
80 * Note: This is in section 7.1.4.3 of the IEEE 802.15.4 document.
81 */
Sergey Lapin2c21d112009-06-08 12:18:49 +000082int ieee802154_nl_disassoc_confirm(struct net_device *dev,
83 u8 status);
Daniel Silverstone878fa892009-07-22 18:51:24 +020084
85/**
86 * ieee802154_nl_scan_confirm - Notify userland of completion of scan.
87 * @dev: The device which was instructed to scan.
88 * @status: The status of the scan operation.
89 * @scan_type: What type of scan was performed.
90 * @unscanned: Any channels that the device was unable to scan.
91 * @edl: The energy levels (if a passive scan).
92 *
93 *
94 * Note: This is in section 7.1.11 of the IEEE 802.15.4 document.
95 * Note: This API does not permit the return of an active scan result.
96 */
Sergey Lapin2c21d112009-06-08 12:18:49 +000097int ieee802154_nl_scan_confirm(struct net_device *dev,
Dmitry Eremin-Solenikov16eea492009-08-19 19:32:24 +040098 u8 status, u8 scan_type, u32 unscanned, u8 page,
Sergey Lapin2c21d112009-06-08 12:18:49 +000099 u8 *edl/*, struct list_head *pan_desc_list */);
Daniel Silverstone878fa892009-07-22 18:51:24 +0200100
101/**
102 * ieee802154_nl_beacon_indic - Notify userland of a received beacon.
103 * @dev: The device on which a beacon was received.
104 * @panid: The PAN of the coordinator.
105 * @coord_addr: The short address of the coordinator on that PAN.
106 *
107 * Note: This is in section 7.1.5 of the IEEE 802.15.4 document.
108 * Note: This API does not provide extended information such as what
109 * channel the PAN is on or what the LQI of the beacon frame was on
110 * receipt.
111 * Note: This API cannot indicate a beacon frame for a coordinator
112 * operating in long addressing mode.
113 */
Phoebe Buckheisterb70ab2e2014-03-14 21:23:59 +0100114int ieee802154_nl_beacon_indic(struct net_device *dev, __le16 panid,
115 __le16 coord_addr);
Sergey Lapin2c21d112009-06-08 12:18:49 +0000116
Dmitry Baryshkovacb8aac2009-08-07 02:58:44 +0000117/**
118 * ieee802154_nl_start_confirm - Notify userland of completion of start.
119 * @dev: The device which was instructed to scan.
120 * @status: The status of the scan operation.
121 *
122 * Note: This is in section 7.1.14 of the IEEE 802.15.4 document.
123 */
124int ieee802154_nl_start_confirm(struct net_device *dev, u8 status);
125
Sergey Lapin2c21d112009-06-08 12:18:49 +0000126#endif