notifier.h revision 289644
1255570Strasz/*-
2255570Strasz * Copyright (c) 2010 Isilon Systems, Inc.
3255570Strasz * Copyright (c) 2010 iX Systems, Inc.
4255570Strasz * Copyright (c) 2010 Panasas, Inc.
5255570Strasz * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
6255570Strasz * All rights reserved.
7255570Strasz *
8255570Strasz * Redistribution and use in source and binary forms, with or without
9255570Strasz * modification, are permitted provided that the following conditions
10255570Strasz * are met:
11255570Strasz * 1. Redistributions of source code must retain the above copyright
12255570Strasz *    notice unmodified, this list of conditions, and the following
13255570Strasz *    disclaimer.
14255570Strasz * 2. Redistributions in binary form must reproduce the above copyright
15255570Strasz *    notice, this list of conditions and the following disclaimer in the
16255570Strasz *    documentation and/or other materials provided with the distribution.
17255570Strasz *
18255570Strasz * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19255570Strasz * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20255570Strasz * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21255570Strasz * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22255570Strasz * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23255570Strasz * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24255570Strasz * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25255570Strasz * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26255570Strasz * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27255570Strasz * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28255570Strasz *
29255570Strasz * $FreeBSD: head/sys/ofed/include/linux/notifier.h 289644 2015-10-20 19:08:26Z hselasky $
30303262Strasz */
31255570Strasz#ifndef	_LINUX_NOTIFIER_H_
32255570Strasz#define	_LINUX_NOTIFIER_H_
33255570Strasz
34255570Strasz#include <sys/eventhandler.h>
35255570Strasz
36255570Strasz/*
37255570Strasz * Max number of FreeBSD events to map to Linux events per notify type.
38255570Strasz */
39255570Strasz#define	NOTIFY_DONE	0
40303262Strasz#define	_NOTIFY_COUNT	7
41255570Strasz
42255570Straszstruct notifier_block {
43255570Strasz	int (*notifier_call)(struct notifier_block *, unsigned long, void *);
44255570Strasz	struct notifier_block	*next;
45255570Strasz	int			priority;
46255570Strasz	eventhandler_tag	tags[_NOTIFY_COUNT];
47255570Strasz};
48255570Strasz
49255570Strasz/* Values must be less than NOTIFY_COUNT */
50255570Strasz#define	NETDEV_UP		0x0001
51255570Strasz#define	NETDEV_DOWN		0x0002
52255570Strasz#define	NETDEV_REGISTER		0x0003
53255570Strasz#define	NETDEV_UNREGISTER	0x0004
54255570Strasz#define	NETDEV_CHANGEADDR       0x0005
55268931Swblock#define	NETDEV_CHANGEIFADDR     0x0006
56255570Strasz
57255570Strasz
58255570Strasz#endif	/* _LINUX_NOTIFIER_H_ */
59255570Strasz