18d59ecb2SHans Petter Selasky /*- 28d59ecb2SHans Petter Selasky * Copyright (c) 2010 Isilon Systems, Inc. 38d59ecb2SHans Petter Selasky * Copyright (c) 2010 iX Systems, Inc. 48d59ecb2SHans Petter Selasky * Copyright (c) 2010 Panasas, Inc. 54a19cc98SHans Petter Selasky * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. 68d59ecb2SHans Petter Selasky * All rights reserved. 78d59ecb2SHans Petter Selasky * 88d59ecb2SHans Petter Selasky * Redistribution and use in source and binary forms, with or without 98d59ecb2SHans Petter Selasky * modification, are permitted provided that the following conditions 108d59ecb2SHans Petter Selasky * are met: 118d59ecb2SHans Petter Selasky * 1. Redistributions of source code must retain the above copyright 128d59ecb2SHans Petter Selasky * notice unmodified, this list of conditions, and the following 138d59ecb2SHans Petter Selasky * disclaimer. 148d59ecb2SHans Petter Selasky * 2. Redistributions in binary form must reproduce the above copyright 158d59ecb2SHans Petter Selasky * notice, this list of conditions and the following disclaimer in the 168d59ecb2SHans Petter Selasky * documentation and/or other materials provided with the distribution. 178d59ecb2SHans Petter Selasky * 188d59ecb2SHans Petter Selasky * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 198d59ecb2SHans Petter Selasky * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 208d59ecb2SHans Petter Selasky * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 218d59ecb2SHans Petter Selasky * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 228d59ecb2SHans Petter Selasky * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 238d59ecb2SHans Petter Selasky * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 248d59ecb2SHans Petter Selasky * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 258d59ecb2SHans Petter Selasky * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 268d59ecb2SHans Petter Selasky * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 278d59ecb2SHans Petter Selasky * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 288d59ecb2SHans Petter Selasky */ 29307f78f3SVladimir Kondratyev #ifndef _LINUXKPI_LINUX_NOTIFIER_H_ 30307f78f3SVladimir Kondratyev #define _LINUXKPI_LINUX_NOTIFIER_H_ 318d59ecb2SHans Petter Selasky 328e7baabcSHans Petter Selasky #include <sys/types.h> 338d59ecb2SHans Petter Selasky #include <sys/eventhandler.h> 348d59ecb2SHans Petter Selasky 358d59ecb2SHans Petter Selasky #define NOTIFY_DONE 0 36*7d2702a1SEmmanuel Vadot #define NOTIFY_OK 0x0001 37*7d2702a1SEmmanuel Vadot #define NOTIFY_STOP_MASK 0x8000 38*7d2702a1SEmmanuel Vadot #define NOTIFY_BAD (NOTIFY_STOP_MASK | 0x0002) 394a19cc98SHans Petter Selasky 404a19cc98SHans Petter Selasky enum { 414a19cc98SHans Petter Selasky NETDEV_CHANGE, 424a19cc98SHans Petter Selasky NETDEV_UP, 434a19cc98SHans Petter Selasky NETDEV_DOWN, 444a19cc98SHans Petter Selasky NETDEV_REGISTER, 454a19cc98SHans Petter Selasky NETDEV_UNREGISTER, 464a19cc98SHans Petter Selasky NETDEV_CHANGEADDR, 474a19cc98SHans Petter Selasky NETDEV_CHANGEIFADDR, 484a19cc98SHans Petter Selasky LINUX_NOTIFY_TAGS /* must be last */ 494a19cc98SHans Petter Selasky }; 508d59ecb2SHans Petter Selasky 518d59ecb2SHans Petter Selasky struct notifier_block { 528d59ecb2SHans Petter Selasky int (*notifier_call) (struct notifier_block *, unsigned long, void *); 538d59ecb2SHans Petter Selasky struct notifier_block *next; 548d59ecb2SHans Petter Selasky int priority; 554a19cc98SHans Petter Selasky eventhandler_tag tags[LINUX_NOTIFY_TAGS]; 568d59ecb2SHans Petter Selasky }; 578d59ecb2SHans Petter Selasky 58307f78f3SVladimir Kondratyev #endif /* _LINUXKPI_LINUX_NOTIFIER_H_ */ 59