196b99684SJohn Fastabend /* 296b99684SJohn Fastabend * Copyright (c) 2010, Intel Corporation. 396b99684SJohn Fastabend * 496b99684SJohn Fastabend * This program is free software; you can redistribute it and/or modify it 596b99684SJohn Fastabend * under the terms and conditions of the GNU General Public License, 696b99684SJohn Fastabend * version 2, as published by the Free Software Foundation. 796b99684SJohn Fastabend * 896b99684SJohn Fastabend * This program is distributed in the hope it will be useful, but WITHOUT 996b99684SJohn Fastabend * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1096b99684SJohn Fastabend * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 1196b99684SJohn Fastabend * more details. 1296b99684SJohn Fastabend * 1396b99684SJohn Fastabend * You should have received a copy of the GNU General Public License along with 1496b99684SJohn Fastabend * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 1596b99684SJohn Fastabend * Place - Suite 330, Boston, MA 02111-1307 USA. 1696b99684SJohn Fastabend * 1796b99684SJohn Fastabend * Author: John Fastabend <john.r.fastabend@intel.com> 1896b99684SJohn Fastabend */ 1996b99684SJohn Fastabend 2096b99684SJohn Fastabend #include <linux/rtnetlink.h> 2196b99684SJohn Fastabend #include <linux/notifier.h> 22*bc3b2d7fSPaul Gortmaker #include <linux/export.h> 2396b99684SJohn Fastabend 2496b99684SJohn Fastabend static ATOMIC_NOTIFIER_HEAD(dcbevent_notif_chain); 2596b99684SJohn Fastabend 2696b99684SJohn Fastabend int register_dcbevent_notifier(struct notifier_block *nb) 2796b99684SJohn Fastabend { 2896b99684SJohn Fastabend return atomic_notifier_chain_register(&dcbevent_notif_chain, nb); 2996b99684SJohn Fastabend } 3096b99684SJohn Fastabend EXPORT_SYMBOL(register_dcbevent_notifier); 3196b99684SJohn Fastabend 3296b99684SJohn Fastabend int unregister_dcbevent_notifier(struct notifier_block *nb) 3396b99684SJohn Fastabend { 3496b99684SJohn Fastabend return atomic_notifier_chain_unregister(&dcbevent_notif_chain, nb); 3596b99684SJohn Fastabend } 3696b99684SJohn Fastabend EXPORT_SYMBOL(unregister_dcbevent_notifier); 3796b99684SJohn Fastabend 3896b99684SJohn Fastabend int call_dcbevent_notifiers(unsigned long val, void *v) 3996b99684SJohn Fastabend { 4096b99684SJohn Fastabend return atomic_notifier_call_chain(&dcbevent_notif_chain, val, v); 4196b99684SJohn Fastabend } 42