xref: /linux/net/dcb/dcbevent.c (revision 96b99684e365f28d49bdb1221ca022b75cb91a98)
1*96b99684SJohn Fastabend /*
2*96b99684SJohn Fastabend  * Copyright (c) 2010, Intel Corporation.
3*96b99684SJohn Fastabend  *
4*96b99684SJohn Fastabend  * This program is free software; you can redistribute it and/or modify it
5*96b99684SJohn Fastabend  * under the terms and conditions of the GNU General Public License,
6*96b99684SJohn Fastabend  * version 2, as published by the Free Software Foundation.
7*96b99684SJohn Fastabend  *
8*96b99684SJohn Fastabend  * This program is distributed in the hope it will be useful, but WITHOUT
9*96b99684SJohn Fastabend  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10*96b99684SJohn Fastabend  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
11*96b99684SJohn Fastabend  * more details.
12*96b99684SJohn Fastabend  *
13*96b99684SJohn Fastabend  * You should have received a copy of the GNU General Public License along with
14*96b99684SJohn Fastabend  * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15*96b99684SJohn Fastabend  * Place - Suite 330, Boston, MA 02111-1307 USA.
16*96b99684SJohn Fastabend  *
17*96b99684SJohn Fastabend  * Author: John Fastabend <john.r.fastabend@intel.com>
18*96b99684SJohn Fastabend  */
19*96b99684SJohn Fastabend 
20*96b99684SJohn Fastabend #include <linux/rtnetlink.h>
21*96b99684SJohn Fastabend #include <linux/notifier.h>
22*96b99684SJohn Fastabend 
23*96b99684SJohn Fastabend static ATOMIC_NOTIFIER_HEAD(dcbevent_notif_chain);
24*96b99684SJohn Fastabend 
25*96b99684SJohn Fastabend int register_dcbevent_notifier(struct notifier_block *nb)
26*96b99684SJohn Fastabend {
27*96b99684SJohn Fastabend 	return atomic_notifier_chain_register(&dcbevent_notif_chain, nb);
28*96b99684SJohn Fastabend }
29*96b99684SJohn Fastabend EXPORT_SYMBOL(register_dcbevent_notifier);
30*96b99684SJohn Fastabend 
31*96b99684SJohn Fastabend int unregister_dcbevent_notifier(struct notifier_block *nb)
32*96b99684SJohn Fastabend {
33*96b99684SJohn Fastabend 	return atomic_notifier_chain_unregister(&dcbevent_notif_chain, nb);
34*96b99684SJohn Fastabend }
35*96b99684SJohn Fastabend EXPORT_SYMBOL(unregister_dcbevent_notifier);
36*96b99684SJohn Fastabend 
37*96b99684SJohn Fastabend int call_dcbevent_notifiers(unsigned long val, void *v)
38*96b99684SJohn Fastabend {
39*96b99684SJohn Fastabend 	return atomic_notifier_call_chain(&dcbevent_notif_chain, val, v);
40*96b99684SJohn Fastabend }
41