notifier.h revision 219820
1107286Sobrien/*-
295349Sobrien * Copyright (c) 2010 Isilon Systems, Inc.
334229Speter * Copyright (c) 2010 iX Systems, Inc.
434229Speter * Copyright (c) 2010 Panasas, Inc.
551408Sobrien * All rights reserved.
652112Sobrien *
718334Speter * Redistribution and use in source and binary forms, with or without
818334Speter * modification, are permitted provided that the following conditions
918334Speter * are met:
1018334Speter * 1. Redistributions of source code must retain the above copyright
1118334Speter *    notice unmodified, this list of conditions, and the following
1218334Speter *    disclaimer.
1318334Speter * 2. Redistributions in binary form must reproduce the above copyright
1418334Speter *    notice, this list of conditions and the following disclaimer in the
1518334Speter *    documentation and/or other materials provided with the distribution.
1618334Speter *
1718334Speter * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1818334Speter * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1918334Speter * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2018334Speter * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2118334Speter * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2218334Speter * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2318334Speter * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2418334Speter * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2551408Sobrien * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2618334Speter * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2758478Sobrien */
2895810Sobrien
2958478Sobrien#ifndef	_LINUX_NOTIFIER_H_
30107286Sobrien#define	_LINUX_NOTIFIER_H_
3151408Sobrien
3258478Sobrien#include <sys/eventhandler.h>
33107286Sobrien
3458478Sobrien/*
3595349Sobrien * Max number of FreeBSD events to map to Linux events per notify type.
3658478Sobrien */
3758478Sobrien#define	NOTIFY_DONE	0
3858478Sobrien#define	_NOTIFY_COUNT	5
3958478Sobrien
4058478Sobrienstruct notifier_block {
4158478Sobrien	int (*notifier_call)(struct notifier_block *, unsigned long, void *);
4258478Sobrien	struct notifier_block	*next;
4358478Sobrien	int			priority;
4458478Sobrien	eventhandler_tag	tags[_NOTIFY_COUNT];
4558478Sobrien};
4658478Sobrien
4758478Sobrien/* Values must be less than NOTIFY_COUNT */
4858478Sobrien#define	NETDEV_UP		0x0001
4958478Sobrien#define	NETDEV_DOWN		0x0002
5058478Sobrien#define	NETDEV_REGISTER		0x0003
5158478Sobrien#define	NETDEV_UNREGISTER	0x0004
5258478Sobrien
5395349Sobrien
5458478Sobrien#endif	/* _LINUX_NOTIFIER_H_ */
5558478Sobrien