diff options
author | Amerigo Wang <amwang@redhat.com> | 2011-07-25 20:13:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-25 23:57:14 -0400 |
commit | dcfe1421c916345b068f43749263b94270324500 (patch) | |
tree | 3a23960235eed24754b9775c85ff2e50ffc367bb /include/linux/netdevice.h | |
parent | 80f1ff97d0a9d92f44d2b2dd9425afa950e58f2b (diff) |
notifiers: net: move netdevice notifiers into netdevice.h
It is not necessary to share the same notifier.h.
Signed-off-by: WANG Cong <amwang@redhat.com>
Acked-by: David Miller <davem@davemloft.net>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 34f3abc6457a..ea6f4aa479d4 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1521,6 +1521,39 @@ struct packet_type { | |||
1521 | 1521 | ||
1522 | #include <linux/notifier.h> | 1522 | #include <linux/notifier.h> |
1523 | 1523 | ||
1524 | /* netdevice notifier chain. Please remember to update the rtnetlink | ||
1525 | * notification exclusion list in rtnetlink_event() when adding new | ||
1526 | * types. | ||
1527 | */ | ||
1528 | #define NETDEV_UP 0x0001 /* For now you can't veto a device up/down */ | ||
1529 | #define NETDEV_DOWN 0x0002 | ||
1530 | #define NETDEV_REBOOT 0x0003 /* Tell a protocol stack a network interface | ||
1531 | detected a hardware crash and restarted | ||
1532 | - we can use this eg to kick tcp sessions | ||
1533 | once done */ | ||
1534 | #define NETDEV_CHANGE 0x0004 /* Notify device state change */ | ||
1535 | #define NETDEV_REGISTER 0x0005 | ||
1536 | #define NETDEV_UNREGISTER 0x0006 | ||
1537 | #define NETDEV_CHANGEMTU 0x0007 | ||
1538 | #define NETDEV_CHANGEADDR 0x0008 | ||
1539 | #define NETDEV_GOING_DOWN 0x0009 | ||
1540 | #define NETDEV_CHANGENAME 0x000A | ||
1541 | #define NETDEV_FEAT_CHANGE 0x000B | ||
1542 | #define NETDEV_BONDING_FAILOVER 0x000C | ||
1543 | #define NETDEV_PRE_UP 0x000D | ||
1544 | #define NETDEV_PRE_TYPE_CHANGE 0x000E | ||
1545 | #define NETDEV_POST_TYPE_CHANGE 0x000F | ||
1546 | #define NETDEV_POST_INIT 0x0010 | ||
1547 | #define NETDEV_UNREGISTER_BATCH 0x0011 | ||
1548 | #define NETDEV_RELEASE 0x0012 | ||
1549 | #define NETDEV_NOTIFY_PEERS 0x0013 | ||
1550 | #define NETDEV_JOIN 0x0014 | ||
1551 | |||
1552 | extern int register_netdevice_notifier(struct notifier_block *nb); | ||
1553 | extern int unregister_netdevice_notifier(struct notifier_block *nb); | ||
1554 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | ||
1555 | |||
1556 | |||
1524 | extern rwlock_t dev_base_lock; /* Device list lock */ | 1557 | extern rwlock_t dev_base_lock; /* Device list lock */ |
1525 | 1558 | ||
1526 | 1559 | ||
@@ -1603,12 +1636,9 @@ static inline void unregister_netdevice(struct net_device *dev) | |||
1603 | extern int netdev_refcnt_read(const struct net_device *dev); | 1636 | extern int netdev_refcnt_read(const struct net_device *dev); |
1604 | extern void free_netdev(struct net_device *dev); | 1637 | extern void free_netdev(struct net_device *dev); |
1605 | extern void synchronize_net(void); | 1638 | extern void synchronize_net(void); |
1606 | extern int register_netdevice_notifier(struct notifier_block *nb); | ||
1607 | extern int unregister_netdevice_notifier(struct notifier_block *nb); | ||
1608 | extern int init_dummy_netdev(struct net_device *dev); | 1639 | extern int init_dummy_netdev(struct net_device *dev); |
1609 | extern void netdev_resync_ops(struct net_device *dev); | 1640 | extern void netdev_resync_ops(struct net_device *dev); |
1610 | 1641 | ||
1611 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | ||
1612 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); | 1642 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); |
1613 | extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); | 1643 | extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); |
1614 | extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); | 1644 | extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); |