aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python
Commit message (Expand)AuthorAge
* perf script: Add drop monitor scriptNeil Horman2011-09-29
* perf script: Finish the rename from trace to scriptArnaldo Carvalho de Melo2010-12-25
* perf: Rename 'perf trace' to 'perf script'Ingo Molnar2010-11-16
* perf trace scripting: remove system-wide param from shell scriptsTom Zanussi2010-11-10
* perf python scripting: Add futex-contention scriptArnaldo Carvalho de Melo2010-10-26
* perf python scripting: Fixup cut'n'paste error in sctop scriptArnaldo Carvalho de Melo2010-10-26
* perf python scripting: Support fedora 11 (audit 1.7.17)Arnaldo Carvalho de Melo2010-10-25
* perf python scripting: Improve the syscalls-by-pid scriptArnaldo Carvalho de Melo2010-10-25
* perf python scripting: print the syscall name on sctopArnaldo Carvalho de Melo2010-10-25
* perf python scripting: Improve the syscalls-counts scriptArnaldo Carvalho de Melo2010-10-25
* perf python scripting: Improve the failed-syscalls-by-pid scriptArnaldo Carvalho de Melo2010-10-25
* perf trace: Use $PERF_EXEC_PATH in canned report scriptsBen Hutchings2010-10-23
* perf: Add a script to show packets processingKoki Sanagi2010-09-07
* perf, sched migration: Librarize task states and event headers helpersFrederic Weisbecker2010-08-01
* perf, sched migration: Librarize the GUI classFrederic Weisbecker2010-08-01
* perf, sched migration: Make the GUI class client agnosticFrederic Weisbecker2010-08-01
* perf, sched migration: Make it vertically scrollableFrederic Weisbecker2010-08-01
* perf, sched migration: Parameterize cpu height and spacingNikhil Rao2010-08-01
* perf, sched migration: Fix key bindingsNikhil Rao2010-08-01
* perf, sched migration: Ignore unhandled task statesFrederic Weisbecker2010-08-01
* perf, sched migration: Handle ignored migrate out eventsFrederic Weisbecker2010-08-01
* perf: New migration tool overviewFrederic Weisbecker2010-08-01
* perf scripts python: Give field dict to unhandled callbackPierre Tardy2010-06-01
* perf/trace/scripting: syscall-counts script cleanupTom Zanussi2010-05-10
* perf/trace/scripting: syscall-counts-by-pid script cleanupTom Zanussi2010-05-10
* perf/trace/scripting: failed-syscalls-by-pid script cleanupTom Zanussi2010-05-10
* perf: Remove leftover useless options to record trace events from scriptsFrederic Weisbecker2010-04-30
* perf trace/scripting: Enable scripting shell scripts for live modeTom Zanussi2010-04-14
* perf trace/scripting: Add rwtop and sctop scriptsTom Zanussi2010-04-14
* perf/scripts: Add syscall tracing scriptsTom Zanussi2010-02-24
* perf/scripts: Add Python scripting engineTom Zanussi2010-02-24
vid S. Miller <davem@davemloft.net> 2009-06-09 08:25:33 -0400 net: add NL802154 interface for configuration of 802.15.4 devices' href='/cgit/cgit.cgi/litmus-rt-imx6.git/commit/net/ieee802154/netlink.c?id=2c21d11518b688cd4c8e7ddfcd4ba41482ad075b'>2c21d11518b6
2c21d11518b6
78fe738d1a63
2c21d11518b6


78fe738d1a63
2c21d11518b6


1eaa9d03d3ee



2c21d11518b6


78fe738d1a63
2c21d11518b6

2c21d11518b6
cb6b37635715
2c21d11518b6
78fe738d1a63
2c21d11518b6
dfd06fe8246c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139




















                                                                          
                                          


                         
                      

                           

                       

                                       
                                            
 
                                      






                                              
                           
                                                       

                  
                                                                        
                        



                            
                                                   
                                                       
                                                      
                                                        







                                
                                                                
 

                                                  
 
                                      

                         
                                                            




                        



                                                               
                                                                        















                                                                    

                                                  









                                        
                                   

               
 
                                                    


                          
                                     


                          



                                     


                 
                                                 

                  
 
                                    
 
                                                 
 
 
/*
 * Netlink inteface for IEEE 802.15.4 stack
 *
 * Copyright 2007, 2008 Siemens AG
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Written by:
 * Sergey Lapin <slapin@ossfans.org>
 * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
 * Maxim Osipov <maxim.osipov@siemens.com>
 */

#include <linux/kernel.h>
#include <linux/gfp.h>
#include <net/genetlink.h>
#include <linux/nl802154.h>

#include "ieee802154.h"

static unsigned int ieee802154_seq_num;
static DEFINE_SPINLOCK(ieee802154_seq_lock);

struct genl_family nl802154_family = {
	.id		= GENL_ID_GENERATE,
	.hdrsize	= 0,
	.name		= IEEE802154_NL_NAME,
	.version	= 1,
	.maxattr	= IEEE802154_ATTR_MAX,
};

/* Requests to userspace */
struct sk_buff *ieee802154_nl_create(int flags, u8 req)
{
	void *hdr;
	struct sk_buff *msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);
	unsigned long f;

	if (!msg)
		return NULL;

	spin_lock_irqsave(&ieee802154_seq_lock, f);
	hdr = genlmsg_put(msg, 0, ieee802154_seq_num++,
			&nl802154_family, flags, req);
	spin_unlock_irqrestore(&ieee802154_seq_lock, f);
	if (!hdr) {
		nlmsg_free(msg);
		return NULL;
	}

	return msg;
}

int ieee802154_nl_mcast(struct sk_buff *msg, unsigned int group)
{
	struct nlmsghdr *nlh = nlmsg_hdr(msg);
	void *hdr = genlmsg_data(nlmsg_data(nlh));

	if (genlmsg_end(msg, hdr) < 0)
		goto out;

	return genlmsg_multicast(msg, 0, group, GFP_ATOMIC);
out:
	nlmsg_free(msg);
	return -ENOBUFS;
}

struct sk_buff *ieee802154_nl_new_reply(struct genl_info *info,
		int flags, u8 req)
{
	void *hdr;
	struct sk_buff *msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC);

	if (!msg)
		return NULL;

	hdr = genlmsg_put_reply(msg, info,
			&nl802154_family, flags, req);
	if (!hdr) {
		nlmsg_free(msg);
		return NULL;
	}

	return msg;
}

int ieee802154_nl_reply(struct sk_buff *msg, struct genl_info *info)
{
	struct nlmsghdr *nlh = nlmsg_hdr(msg);
	void *hdr = genlmsg_data(nlmsg_data(nlh));

	if (genlmsg_end(msg, hdr) < 0)
		goto out;

	return genlmsg_reply(msg, info);
out:
	nlmsg_free(msg);
	return -ENOBUFS;
}

int __init ieee802154_nl_init(void)
{
	int rc;

	rc = genl_register_family(&nl802154_family);
	if (rc)
		goto fail;

	rc = nl802154_mac_register();
	if (rc)
		goto fail;

	rc = nl802154_phy_register();
	if (rc)
		goto fail;

	return 0;

fail:
	genl_unregister_family(&nl802154_family);
	return rc;
}

void __exit ieee802154_nl_exit(void)
{
	genl_unregister_family(&nl802154_family);
}