From 4a19cc98b3048de7ef846bea5c567756da33be47 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Tue, 26 Jan 2016 14:27:00 +0000 Subject: [PATCH] Add definition for the NETDEV_CHANGE event and tidy up the LinuxKPI notifier header file a bit while at it. MFC after: 1 week Sponsored by: Mellanox Technologies --- .../linuxkpi/common/include/linux/notifier.h | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/notifier.h b/sys/compat/linuxkpi/common/include/linux/notifier.h index 472236853dc..ae292439bf5 100644 --- a/sys/compat/linuxkpi/common/include/linux/notifier.h +++ b/sys/compat/linuxkpi/common/include/linux/notifier.h @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2016 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,26 +34,24 @@ #include #include -/* - * Max number of FreeBSD events to map to Linux events per notify type. - */ #define NOTIFY_DONE 0 -#define _NOTIFY_COUNT 7 -struct notifier_block { - int (*notifier_call)(struct notifier_block *, unsigned long, void *); - struct notifier_block *next; - int priority; - eventhandler_tag tags[_NOTIFY_COUNT]; +enum { + NETDEV_CHANGE, + NETDEV_UP, + NETDEV_DOWN, + NETDEV_REGISTER, + NETDEV_UNREGISTER, + NETDEV_CHANGEADDR, + NETDEV_CHANGEIFADDR, + LINUX_NOTIFY_TAGS /* must be last */ }; -/* Values must be less than NOTIFY_COUNT */ -#define NETDEV_UP 0x0001 -#define NETDEV_DOWN 0x0002 -#define NETDEV_REGISTER 0x0003 -#define NETDEV_UNREGISTER 0x0004 -#define NETDEV_CHANGEADDR 0x0005 -#define NETDEV_CHANGEIFADDR 0x0006 +struct notifier_block { + int (*notifier_call) (struct notifier_block *, unsigned long, void *); + struct notifier_block *next; + int priority; + eventhandler_tag tags[LINUX_NOTIFY_TAGS]; +}; - -#endif /* _LINUX_NOTIFIER_H_ */ +#endif /* _LINUX_NOTIFIER_H_ */