diff options
author | akw27@boulderdash.cl.cam.ac.uk <akw27@boulderdash.cl.cam.ac.uk> | 2003-02-11 13:05:51 +0000 |
---|---|---|
committer | akw27@boulderdash.cl.cam.ac.uk <akw27@boulderdash.cl.cam.ac.uk> | 2003-02-11 13:05:51 +0000 |
commit | 51da3fa5733d39832a781571bc63f17a9a198c50 (patch) | |
tree | fb4ae11cfa635759f64f134ad4a08632d38bf034 /xen-2.4.16/include/xeno/notifier.h | |
parent | 0c9fe16459541e1e08dd289e4b39191bbd79b81f (diff) | |
parent | 24116e31a5a2ed3b1dc989c9f9c841f1fc9161d6 (diff) | |
download | xen-51da3fa5733d39832a781571bc63f17a9a198c50.tar.gz xen-51da3fa5733d39832a781571bc63f17a9a198c50.tar.bz2 xen-51da3fa5733d39832a781571bc63f17a9a198c50.zip |
bitkeeper revision 1.22.1.11 (3e48f52fRxNrVg2Tsq7Qa1P9cXmCeA)
Merge with main repository.
Diffstat (limited to 'xen-2.4.16/include/xeno/notifier.h')
-rw-r--r-- | xen-2.4.16/include/xeno/notifier.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/xen-2.4.16/include/xeno/notifier.h b/xen-2.4.16/include/xeno/notifier.h new file mode 100644 index 0000000000..0db9736c11 --- /dev/null +++ b/xen-2.4.16/include/xeno/notifier.h @@ -0,0 +1,64 @@ +/* + * Routines to manage notifier chains for passing status changes to any + * interested routines. We need this instead of hard coded call lists so + * that modules can poke their nose into the innards. The network devices + * needed them so here they are for the rest of you. + * + * Alan Cox <Alan.Cox@linux.org> + */ + +#ifndef _LINUX_NOTIFIER_H +#define _LINUX_NOTIFIER_H +#include <linux/errno.h> + +struct notifier_block +{ + int (*notifier_call)(struct notifier_block *self, unsigned long, void *); + struct notifier_block *next; + int priority; +}; + + +#ifdef __KERNEL__ + +extern int notifier_chain_register(struct notifier_block **list, struct notifier_block *n); +extern int notifier_chain_unregister(struct notifier_block **nl, struct notifier_block *n); +extern int notifier_call_chain(struct notifier_block **n, unsigned long val, void *v); + +#define NOTIFY_DONE 0x0000 /* Don't care */ +#define NOTIFY_OK 0x0001 /* Suits me */ +#define NOTIFY_STOP_MASK 0x8000 /* Don't call further */ +#define NOTIFY_BAD (NOTIFY_STOP_MASK|0x0002) /* Bad/Veto action */ + +/* + * Declared notifiers so far. I can imagine quite a few more chains + * over time (eg laptop power reset chains, reboot chain (to clean + * device units up), device [un]mount chain, module load/unload chain, + * low memory chain, screenblank chain (for plug in modular screenblankers) + * VC switch chains (for loadable kernel svgalib VC switch helpers) etc... + */ + +/* netdevice notifier chain */ +#define NETDEV_UP 0x0001 /* For now you can't veto a device up/down */ +#define NETDEV_DOWN 0x0002 +#define NETDEV_REBOOT 0x0003 /* Tell a protocol stack a network interface + detected a hardware crash and restarted + - we can use this eg to kick tcp sessions + once done */ +#define NETDEV_CHANGE 0x0004 /* Notify device state change */ +#define NETDEV_REGISTER 0x0005 +#define NETDEV_UNREGISTER 0x0006 +#define NETDEV_CHANGEMTU 0x0007 +#define NETDEV_CHANGEADDR 0x0008 +#define NETDEV_GOING_DOWN 0x0009 +#define NETDEV_CHANGENAME 0x000A + +#define SYS_DOWN 0x0001 /* Notify of system down */ +#define SYS_RESTART SYS_DOWN +#define SYS_HALT 0x0002 /* Notify of system halt */ +#define SYS_POWER_OFF 0x0003 /* Notify of system power off */ + +#define NETLINK_URELEASE 0x0001 /* Unicast netlink socket released */ + +#endif /* __KERNEL__ */ +#endif /* _LINUX_NOTIFIER_H */ |