net: pass info struct via netdevice notifier
So far, only net_device * could be passed along with netdevice notifier event. This patch provides a possibility to pass custom structure able to provide info that event listener needs to know. Signed-off-by: Jiri Pirko <jiri@resnulli.us> v2->v3: fix typo on simeth shortened dev_getter shortened notifier_info struct name v1->v2: fix notifier_call parameter in call_netdevice_notifier() Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b1098bbe1b
commit
351638e7de
@ -268,7 +268,7 @@ static __inline__ int dev_is_ethdev(struct net_device *dev)
|
|||||||
static int
|
static int
|
||||||
simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr)
|
simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct simeth_local *local;
|
struct simeth_local *local;
|
||||||
struct in_device *in_dev;
|
struct in_device *in_dev;
|
||||||
struct in_ifaddr **ifap = NULL;
|
struct in_ifaddr **ifap = NULL;
|
||||||
|
@ -331,7 +331,8 @@ static int tx4939_netdev_event(struct notifier_block *this,
|
|||||||
unsigned long event,
|
unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
if (event == NETDEV_CHANGE && netif_carrier_ok(dev)) {
|
if (event == NETDEV_CHANGE && netif_carrier_ok(dev)) {
|
||||||
__u64 bit = 0;
|
__u64 bit = 0;
|
||||||
if (dev->irq == TXX9_IRQ_BASE + TX4939_IR_ETH(0))
|
if (dev->irq == TXX9_IRQ_BASE + TX4939_IR_ETH(0))
|
||||||
|
@ -3269,9 +3269,9 @@ static int cma_netdev_change(struct net_device *ndev, struct rdma_id_private *id
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int cma_netdev_callback(struct notifier_block *self, unsigned long event,
|
static int cma_netdev_callback(struct notifier_block *self, unsigned long event,
|
||||||
void *ctx)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *ndev = (struct net_device *)ctx;
|
struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct cma_device *cma_dev;
|
struct cma_device *cma_dev;
|
||||||
struct rdma_id_private *id_priv;
|
struct rdma_id_private *id_priv;
|
||||||
int ret = NOTIFY_DONE;
|
int ret = NOTIFY_DONE;
|
||||||
|
@ -1161,7 +1161,7 @@ static void netdev_removed(struct mlx4_ib_dev *dev, int port)
|
|||||||
static int mlx4_ib_netdev_event(struct notifier_block *this, unsigned long event,
|
static int mlx4_ib_netdev_event(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct mlx4_ib_dev *ibdev;
|
struct mlx4_ib_dev *ibdev;
|
||||||
struct net_device *oldnd;
|
struct net_device *oldnd;
|
||||||
struct mlx4_ib_iboe *iboe;
|
struct mlx4_ib_iboe *iboe;
|
||||||
|
@ -3277,7 +3277,7 @@ static int bond_slave_netdev_event(unsigned long event,
|
|||||||
static int bond_netdev_event(struct notifier_block *this,
|
static int bond_netdev_event(struct notifier_block *this,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *event_dev = (struct net_device *)ptr;
|
struct net_device *event_dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
pr_debug("event_dev: %s, event: %lx\n",
|
pr_debug("event_dev: %s, event: %lx\n",
|
||||||
event_dev ? event_dev->name : "None",
|
event_dev ? event_dev->name : "None",
|
||||||
|
@ -88,9 +88,9 @@ EXPORT_SYMBOL_GPL(devm_can_led_init);
|
|||||||
|
|
||||||
/* NETDEV rename notifier to rename the associated led triggers too */
|
/* NETDEV rename notifier to rename the associated led triggers too */
|
||||||
static int can_led_notifier(struct notifier_block *nb, unsigned long msg,
|
static int can_led_notifier(struct notifier_block *nb, unsigned long msg,
|
||||||
void *data)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *netdev = data;
|
struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct can_priv *priv = safe_candev_priv(netdev);
|
struct can_priv *priv = safe_candev_priv(netdev);
|
||||||
char name[CAN_LED_NAME_SZ];
|
char name[CAN_LED_NAME_SZ];
|
||||||
|
|
||||||
|
@ -5622,7 +5622,7 @@ static void cnic_rcv_netevent(struct cnic_local *cp, unsigned long event,
|
|||||||
static int cnic_netdev_event(struct notifier_block *this, unsigned long event,
|
static int cnic_netdev_event(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *netdev = ptr;
|
struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct cnic_dev *dev;
|
struct cnic_dev *dev;
|
||||||
int new_dev = 0;
|
int new_dev = 0;
|
||||||
|
|
||||||
|
@ -3706,7 +3706,7 @@ static const struct file_operations skge_debug_fops = {
|
|||||||
static int skge_device_event(struct notifier_block *unused,
|
static int skge_device_event(struct notifier_block *unused,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct skge_port *skge;
|
struct skge_port *skge;
|
||||||
struct dentry *d;
|
struct dentry *d;
|
||||||
|
|
||||||
|
@ -4642,7 +4642,7 @@ static const struct file_operations sky2_debug_fops = {
|
|||||||
static int sky2_device_event(struct notifier_block *unused,
|
static int sky2_device_event(struct notifier_block *unused,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct sky2_port *sky2 = netdev_priv(dev);
|
struct sky2_port *sky2 = netdev_priv(dev);
|
||||||
|
|
||||||
if (dev->netdev_ops->ndo_open != sky2_open || !sky2_debug)
|
if (dev->netdev_ops->ndo_open != sky2_open || !sky2_debug)
|
||||||
|
@ -3311,7 +3311,7 @@ static int netxen_netdev_event(struct notifier_block *this,
|
|||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct netxen_adapter *adapter;
|
struct netxen_adapter *adapter;
|
||||||
struct net_device *dev = (struct net_device *)ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct net_device *orig_dev = dev;
|
struct net_device *orig_dev = dev;
|
||||||
struct net_device *slave;
|
struct net_device *slave;
|
||||||
|
|
||||||
|
@ -3530,7 +3530,7 @@ static int qlcnic_netdev_event(struct notifier_block *this,
|
|||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct qlcnic_adapter *adapter;
|
struct qlcnic_adapter *adapter;
|
||||||
struct net_device *dev = (struct net_device *)ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
recheck:
|
recheck:
|
||||||
if (dev == NULL)
|
if (dev == NULL)
|
||||||
|
@ -2120,7 +2120,7 @@ static void efx_update_name(struct efx_nic *efx)
|
|||||||
static int efx_netdev_event(struct notifier_block *this,
|
static int efx_netdev_event(struct notifier_block *this,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *net_dev = ptr;
|
struct net_device *net_dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
if (net_dev->netdev_ops == &efx_netdev_ops &&
|
if (net_dev->netdev_ops == &efx_netdev_ops &&
|
||||||
event == NETDEV_CHANGENAME)
|
event == NETDEV_CHANGENAME)
|
||||||
|
@ -103,7 +103,7 @@ static struct packet_type bpq_packet_type __read_mostly = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static struct notifier_block bpq_dev_notifier = {
|
static struct notifier_block bpq_dev_notifier = {
|
||||||
.notifier_call =bpq_device_event,
|
.notifier_call = bpq_device_event,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -544,9 +544,10 @@ static void bpq_free_device(struct net_device *ndev)
|
|||||||
/*
|
/*
|
||||||
* Handle device status changes.
|
* Handle device status changes.
|
||||||
*/
|
*/
|
||||||
static int bpq_device_event(struct notifier_block *this,unsigned long event, void *ptr)
|
static int bpq_device_event(struct notifier_block *this,
|
||||||
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *)ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
if (!net_eq(dev_net(dev), &init_net))
|
if (!net_eq(dev_net(dev), &init_net))
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
|
@ -921,7 +921,7 @@ static struct rtnl_link_ops macvlan_link_ops = {
|
|||||||
static int macvlan_device_event(struct notifier_block *unused,
|
static int macvlan_device_event(struct notifier_block *unused,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct macvlan_dev *vlan, *next;
|
struct macvlan_dev *vlan, *next;
|
||||||
struct macvlan_port *port;
|
struct macvlan_port *port;
|
||||||
LIST_HEAD(list_kill);
|
LIST_HEAD(list_kill);
|
||||||
|
@ -1053,7 +1053,7 @@ EXPORT_SYMBOL_GPL(macvtap_get_socket);
|
|||||||
static int macvtap_device_event(struct notifier_block *unused,
|
static int macvtap_device_event(struct notifier_block *unused,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct macvlan_dev *vlan;
|
struct macvlan_dev *vlan;
|
||||||
struct device *classdev;
|
struct device *classdev;
|
||||||
dev_t devt;
|
dev_t devt;
|
||||||
|
@ -653,12 +653,11 @@ static struct configfs_subsystem netconsole_subsys = {
|
|||||||
|
|
||||||
/* Handle network interface device notifications */
|
/* Handle network interface device notifications */
|
||||||
static int netconsole_netdev_event(struct notifier_block *this,
|
static int netconsole_netdev_event(struct notifier_block *this,
|
||||||
unsigned long event,
|
unsigned long event, void *ptr)
|
||||||
void *ptr)
|
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
struct netconsole_target *nt;
|
struct netconsole_target *nt;
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
bool stopped = false;
|
bool stopped = false;
|
||||||
|
|
||||||
if (!(event == NETDEV_CHANGENAME || event == NETDEV_UNREGISTER ||
|
if (!(event == NETDEV_CHANGENAME || event == NETDEV_UNREGISTER ||
|
||||||
|
@ -338,7 +338,7 @@ static void pppoe_flush_dev(struct net_device *dev)
|
|||||||
static int pppoe_device_event(struct notifier_block *this,
|
static int pppoe_device_event(struct notifier_block *this,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *)ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
/* Only look at sockets that are using this specific device. */
|
/* Only look at sockets that are using this specific device. */
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
@ -2647,7 +2647,7 @@ static void team_port_change_check(struct team_port *port, bool linkup)
|
|||||||
static int team_device_event(struct notifier_block *unused,
|
static int team_device_event(struct notifier_block *unused,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *) ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct team_port *port;
|
struct team_port *port;
|
||||||
|
|
||||||
port = team_port_get_rtnl(dev);
|
port = team_port_get_rtnl(dev);
|
||||||
|
@ -477,7 +477,7 @@ static void dlci_setup(struct net_device *dev)
|
|||||||
static int dlci_dev_event(struct notifier_block *unused,
|
static int dlci_dev_event(struct notifier_block *unused,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *) ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
if (dev_net(dev) != &init_net)
|
if (dev_net(dev) != &init_net)
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
|
@ -99,7 +99,7 @@ static inline void hdlc_proto_stop(struct net_device *dev)
|
|||||||
static int hdlc_device_event(struct notifier_block *this, unsigned long event,
|
static int hdlc_device_event(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
hdlc_device *hdlc;
|
hdlc_device *hdlc;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int on;
|
int on;
|
||||||
|
@ -370,7 +370,7 @@ static int lapbeth_device_event(struct notifier_block *this,
|
|||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct lapbethdev *lapbeth;
|
struct lapbethdev *lapbeth;
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
if (dev_net(dev) != &init_net)
|
if (dev_net(dev) != &init_net)
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
|
@ -1975,7 +1975,7 @@ static int fcoe_device_notification(struct notifier_block *notifier,
|
|||||||
{
|
{
|
||||||
struct fcoe_ctlr_device *cdev;
|
struct fcoe_ctlr_device *cdev;
|
||||||
struct fc_lport *lport = NULL;
|
struct fc_lport *lport = NULL;
|
||||||
struct net_device *netdev = ptr;
|
struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct fcoe_ctlr *ctlr;
|
struct fcoe_ctlr *ctlr;
|
||||||
struct fcoe_interface *fcoe;
|
struct fcoe_interface *fcoe;
|
||||||
struct fcoe_port *port;
|
struct fcoe_port *port;
|
||||||
|
@ -704,7 +704,7 @@ static struct net_device *fcoe_if_to_netdev(const char *buffer)
|
|||||||
static int libfcoe_device_notification(struct notifier_block *notifier,
|
static int libfcoe_device_notification(struct notifier_block *notifier,
|
||||||
ulong event, void *ptr)
|
ulong event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *netdev = ptr;
|
struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case NETDEV_UNREGISTER:
|
case NETDEV_UNREGISTER:
|
||||||
|
@ -2891,7 +2891,7 @@ void uf_net_get_name(struct net_device *dev, char *name, int len)
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
uf_netdev_event(struct notifier_block *notif, unsigned long event, void* ptr) {
|
uf_netdev_event(struct notifier_block *notif, unsigned long event, void* ptr) {
|
||||||
struct net_device *netdev = ptr;
|
struct net_device *netdev = netdev_notifier_info_to_dev(ptr);
|
||||||
netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv(netdev);
|
netInterface_priv_t *interfacePriv = (netInterface_priv_t *)netdev_priv(netdev);
|
||||||
unifi_priv_t *priv = NULL;
|
unifi_priv_t *priv = NULL;
|
||||||
static const CsrWifiMacAddress broadcast_address = {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}};
|
static const CsrWifiMacAddress broadcast_address = {{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}};
|
||||||
|
@ -164,7 +164,7 @@ static const struct file_operations ft1000_proc_fops = {
|
|||||||
static int ft1000NotifyProc(struct notifier_block *this, unsigned long event,
|
static int ft1000NotifyProc(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct ft1000_info *info;
|
struct ft1000_info *info;
|
||||||
|
|
||||||
info = netdev_priv(dev);
|
info = netdev_priv(dev);
|
||||||
|
@ -166,7 +166,7 @@ static const struct file_operations ft1000_proc_fops = {
|
|||||||
static int
|
static int
|
||||||
ft1000NotifyProc(struct notifier_block *this, unsigned long event, void *ptr)
|
ft1000NotifyProc(struct notifier_block *this, unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct ft1000_info *info;
|
struct ft1000_info *info;
|
||||||
struct proc_dir_entry *ft1000_proc_file;
|
struct proc_dir_entry *ft1000_proc_file;
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ static unsigned long str_to_hex(char *p);
|
|||||||
static int bp_device_event(struct notifier_block *unused,
|
static int bp_device_event(struct notifier_block *unused,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
static bpctl_dev_t *pbpctl_dev = NULL, *pbpctl_dev_m = NULL;
|
static bpctl_dev_t *pbpctl_dev = NULL, *pbpctl_dev_m = NULL;
|
||||||
int dev_num = 0, ret = 0, ret_d = 0, time_left = 0;
|
int dev_num = 0, ret = 0, ret_d = 0, time_left = 0;
|
||||||
/* printk("BP_PROC_SUPPORT event =%d %s %d\n", event,dev->name, dev->ifindex ); */
|
/* printk("BP_PROC_SUPPORT event =%d %s %d\n", event,dev->name, dev->ifindex ); */
|
||||||
|
@ -1599,6 +1599,19 @@ struct packet_offload {
|
|||||||
|
|
||||||
extern int register_netdevice_notifier(struct notifier_block *nb);
|
extern int register_netdevice_notifier(struct notifier_block *nb);
|
||||||
extern int unregister_netdevice_notifier(struct notifier_block *nb);
|
extern int unregister_netdevice_notifier(struct notifier_block *nb);
|
||||||
|
|
||||||
|
struct netdev_notifier_info {
|
||||||
|
struct net_device *dev;
|
||||||
|
};
|
||||||
|
|
||||||
|
static inline struct net_device *
|
||||||
|
netdev_notifier_info_to_dev(const struct netdev_notifier_info *info)
|
||||||
|
{
|
||||||
|
return info->dev;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev,
|
||||||
|
struct netdev_notifier_info *info);
|
||||||
extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
|
extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
|
||||||
|
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ static void __vlan_device_event(struct net_device *dev, unsigned long event)
|
|||||||
static int vlan_device_event(struct notifier_block *unused, unsigned long event,
|
static int vlan_device_event(struct notifier_block *unused, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct vlan_group *grp;
|
struct vlan_group *grp;
|
||||||
struct vlan_info *vlan_info;
|
struct vlan_info *vlan_info;
|
||||||
int i, flgs;
|
int i, flgs;
|
||||||
|
@ -332,7 +332,7 @@ static void aarp_expire_timeout(unsigned long unused)
|
|||||||
static int aarp_device_event(struct notifier_block *this, unsigned long event,
|
static int aarp_device_event(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
int ct;
|
int ct;
|
||||||
|
|
||||||
if (!net_eq(dev_net(dev), &init_net))
|
if (!net_eq(dev_net(dev), &init_net))
|
||||||
|
@ -644,7 +644,7 @@ static inline void atalk_dev_down(struct net_device *dev)
|
|||||||
static int ddp_device_event(struct notifier_block *this, unsigned long event,
|
static int ddp_device_event(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
if (!net_eq(dev_net(dev), &init_net))
|
if (!net_eq(dev_net(dev), &init_net))
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
|
@ -539,9 +539,9 @@ static int clip_create(int number)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int clip_device_event(struct notifier_block *this, unsigned long event,
|
static int clip_device_event(struct notifier_block *this, unsigned long event,
|
||||||
void *arg)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = arg;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
if (!net_eq(dev_net(dev), &init_net))
|
if (!net_eq(dev_net(dev), &init_net))
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
|
@ -998,14 +998,12 @@ int msg_to_mpoad(struct k_message *mesg, struct mpoa_client *mpc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int mpoa_event_listener(struct notifier_block *mpoa_notifier,
|
static int mpoa_event_listener(struct notifier_block *mpoa_notifier,
|
||||||
unsigned long event, void *dev_ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct mpoa_client *mpc;
|
struct mpoa_client *mpc;
|
||||||
struct lec_priv *priv;
|
struct lec_priv *priv;
|
||||||
|
|
||||||
dev = dev_ptr;
|
|
||||||
|
|
||||||
if (!net_eq(dev_net(dev), &init_net))
|
if (!net_eq(dev_net(dev), &init_net))
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
|
|
||||||
|
@ -111,9 +111,9 @@ static void ax25_kill_by_device(struct net_device *dev)
|
|||||||
* Handle device status changes.
|
* Handle device status changes.
|
||||||
*/
|
*/
|
||||||
static int ax25_device_event(struct notifier_block *this, unsigned long event,
|
static int ax25_device_event(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *)ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
if (!net_eq(dev_net(dev), &init_net))
|
if (!net_eq(dev_net(dev), &init_net))
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
@ -1974,7 +1974,7 @@ static struct packet_type ax25_packet_type __read_mostly = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static struct notifier_block ax25_dev_notifier = {
|
static struct notifier_block ax25_dev_notifier = {
|
||||||
.notifier_call =ax25_device_event,
|
.notifier_call = ax25_device_event,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __init ax25_init(void)
|
static int __init ax25_init(void)
|
||||||
|
@ -595,7 +595,7 @@ void batadv_hardif_remove_interfaces(void)
|
|||||||
static int batadv_hard_if_event(struct notifier_block *this,
|
static int batadv_hard_if_event(struct notifier_block *this,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *net_dev = ptr;
|
struct net_device *net_dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct batadv_hard_iface *hard_iface;
|
struct batadv_hard_iface *hard_iface;
|
||||||
struct batadv_hard_iface *primary_if = NULL;
|
struct batadv_hard_iface *primary_if = NULL;
|
||||||
struct batadv_priv *bat_priv;
|
struct batadv_priv *bat_priv;
|
||||||
|
@ -31,7 +31,7 @@ struct notifier_block br_device_notifier = {
|
|||||||
*/
|
*/
|
||||||
static int br_device_event(struct notifier_block *unused, unsigned long event, void *ptr)
|
static int br_device_event(struct notifier_block *unused, unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct net_bridge_port *p;
|
struct net_bridge_port *p;
|
||||||
struct net_bridge *br;
|
struct net_bridge *br;
|
||||||
bool changed_addr;
|
bool changed_addr;
|
||||||
|
@ -352,9 +352,9 @@ EXPORT_SYMBOL(caif_enroll_dev);
|
|||||||
|
|
||||||
/* notify Caif of device events */
|
/* notify Caif of device events */
|
||||||
static int caif_device_notify(struct notifier_block *me, unsigned long what,
|
static int caif_device_notify(struct notifier_block *me, unsigned long what,
|
||||||
void *arg)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = arg;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct caif_device_entry *caifd = NULL;
|
struct caif_device_entry *caifd = NULL;
|
||||||
struct caif_dev_common *caifdev;
|
struct caif_dev_common *caifdev;
|
||||||
struct cfcnfg *cfg;
|
struct cfcnfg *cfg;
|
||||||
|
@ -121,9 +121,9 @@ static struct packet_type caif_usb_type __read_mostly = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static int cfusbl_device_notify(struct notifier_block *me, unsigned long what,
|
static int cfusbl_device_notify(struct notifier_block *me, unsigned long what,
|
||||||
void *arg)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = arg;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct caif_dev_common common;
|
struct caif_dev_common common;
|
||||||
struct cflayer *layer, *link_support;
|
struct cflayer *layer, *link_support;
|
||||||
struct usbnet *usbnet;
|
struct usbnet *usbnet;
|
||||||
|
@ -794,9 +794,9 @@ EXPORT_SYMBOL(can_proto_unregister);
|
|||||||
* af_can notifier to create/remove CAN netdevice specific structs
|
* af_can notifier to create/remove CAN netdevice specific structs
|
||||||
*/
|
*/
|
||||||
static int can_notifier(struct notifier_block *nb, unsigned long msg,
|
static int can_notifier(struct notifier_block *nb, unsigned long msg,
|
||||||
void *data)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *)data;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct dev_rcv_lists *d;
|
struct dev_rcv_lists *d;
|
||||||
|
|
||||||
if (!net_eq(dev_net(dev), &init_net))
|
if (!net_eq(dev_net(dev), &init_net))
|
||||||
|
@ -1350,9 +1350,9 @@ static int bcm_sendmsg(struct kiocb *iocb, struct socket *sock,
|
|||||||
* notification handler for netdevice status changes
|
* notification handler for netdevice status changes
|
||||||
*/
|
*/
|
||||||
static int bcm_notifier(struct notifier_block *nb, unsigned long msg,
|
static int bcm_notifier(struct notifier_block *nb, unsigned long msg,
|
||||||
void *data)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *)data;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct bcm_sock *bo = container_of(nb, struct bcm_sock, notifier);
|
struct bcm_sock *bo = container_of(nb, struct bcm_sock, notifier);
|
||||||
struct sock *sk = &bo->sk;
|
struct sock *sk = &bo->sk;
|
||||||
struct bcm_op *op;
|
struct bcm_op *op;
|
||||||
|
@ -445,9 +445,9 @@ static inline void cgw_unregister_filter(struct cgw_job *gwj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int cgw_notifier(struct notifier_block *nb,
|
static int cgw_notifier(struct notifier_block *nb,
|
||||||
unsigned long msg, void *data)
|
unsigned long msg, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *)data;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
if (!net_eq(dev_net(dev), &init_net))
|
if (!net_eq(dev_net(dev), &init_net))
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
|
@ -239,9 +239,9 @@ static int raw_enable_allfilters(struct net_device *dev, struct sock *sk)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int raw_notifier(struct notifier_block *nb,
|
static int raw_notifier(struct notifier_block *nb,
|
||||||
unsigned long msg, void *data)
|
unsigned long msg, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *)data;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct raw_sock *ro = container_of(nb, struct raw_sock, notifier);
|
struct raw_sock *ro = container_of(nb, struct raw_sock, notifier);
|
||||||
struct sock *sk = &ro->sk;
|
struct sock *sk = &ro->sk;
|
||||||
|
|
||||||
|
@ -1391,6 +1391,20 @@ void dev_disable_lro(struct net_device *dev)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(dev_disable_lro);
|
EXPORT_SYMBOL(dev_disable_lro);
|
||||||
|
|
||||||
|
static void netdev_notifier_info_init(struct netdev_notifier_info *info,
|
||||||
|
struct net_device *dev)
|
||||||
|
{
|
||||||
|
info->dev = dev;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int call_netdevice_notifier(struct notifier_block *nb, unsigned long val,
|
||||||
|
struct net_device *dev)
|
||||||
|
{
|
||||||
|
struct netdev_notifier_info info;
|
||||||
|
|
||||||
|
netdev_notifier_info_init(&info, dev);
|
||||||
|
return nb->notifier_call(nb, val, &info);
|
||||||
|
}
|
||||||
|
|
||||||
static int dev_boot_phase = 1;
|
static int dev_boot_phase = 1;
|
||||||
|
|
||||||
@ -1423,7 +1437,7 @@ int register_netdevice_notifier(struct notifier_block *nb)
|
|||||||
goto unlock;
|
goto unlock;
|
||||||
for_each_net(net) {
|
for_each_net(net) {
|
||||||
for_each_netdev(net, dev) {
|
for_each_netdev(net, dev) {
|
||||||
err = nb->notifier_call(nb, NETDEV_REGISTER, dev);
|
err = call_netdevice_notifier(nb, NETDEV_REGISTER, dev);
|
||||||
err = notifier_to_errno(err);
|
err = notifier_to_errno(err);
|
||||||
if (err)
|
if (err)
|
||||||
goto rollback;
|
goto rollback;
|
||||||
@ -1431,7 +1445,7 @@ int register_netdevice_notifier(struct notifier_block *nb)
|
|||||||
if (!(dev->flags & IFF_UP))
|
if (!(dev->flags & IFF_UP))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
nb->notifier_call(nb, NETDEV_UP, dev);
|
call_netdevice_notifier(nb, NETDEV_UP, dev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1447,10 +1461,11 @@ int register_netdevice_notifier(struct notifier_block *nb)
|
|||||||
goto outroll;
|
goto outroll;
|
||||||
|
|
||||||
if (dev->flags & IFF_UP) {
|
if (dev->flags & IFF_UP) {
|
||||||
nb->notifier_call(nb, NETDEV_GOING_DOWN, dev);
|
call_netdevice_notifier(nb, NETDEV_GOING_DOWN,
|
||||||
nb->notifier_call(nb, NETDEV_DOWN, dev);
|
dev);
|
||||||
|
call_netdevice_notifier(nb, NETDEV_DOWN, dev);
|
||||||
}
|
}
|
||||||
nb->notifier_call(nb, NETDEV_UNREGISTER, dev);
|
call_netdevice_notifier(nb, NETDEV_UNREGISTER, dev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1488,10 +1503,11 @@ int unregister_netdevice_notifier(struct notifier_block *nb)
|
|||||||
for_each_net(net) {
|
for_each_net(net) {
|
||||||
for_each_netdev(net, dev) {
|
for_each_netdev(net, dev) {
|
||||||
if (dev->flags & IFF_UP) {
|
if (dev->flags & IFF_UP) {
|
||||||
nb->notifier_call(nb, NETDEV_GOING_DOWN, dev);
|
call_netdevice_notifier(nb, NETDEV_GOING_DOWN,
|
||||||
nb->notifier_call(nb, NETDEV_DOWN, dev);
|
dev);
|
||||||
|
call_netdevice_notifier(nb, NETDEV_DOWN, dev);
|
||||||
}
|
}
|
||||||
nb->notifier_call(nb, NETDEV_UNREGISTER, dev);
|
call_netdevice_notifier(nb, NETDEV_UNREGISTER, dev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unlock:
|
unlock:
|
||||||
@ -1500,6 +1516,25 @@ int unregister_netdevice_notifier(struct notifier_block *nb)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(unregister_netdevice_notifier);
|
EXPORT_SYMBOL(unregister_netdevice_notifier);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* call_netdevice_notifiers_info - call all network notifier blocks
|
||||||
|
* @val: value passed unmodified to notifier function
|
||||||
|
* @dev: net_device pointer passed unmodified to notifier function
|
||||||
|
* @info: notifier information data
|
||||||
|
*
|
||||||
|
* Call all network notifier blocks. Parameters and return value
|
||||||
|
* are as for raw_notifier_call_chain().
|
||||||
|
*/
|
||||||
|
|
||||||
|
int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev,
|
||||||
|
struct netdev_notifier_info *info)
|
||||||
|
{
|
||||||
|
ASSERT_RTNL();
|
||||||
|
netdev_notifier_info_init(info, dev);
|
||||||
|
return raw_notifier_call_chain(&netdev_chain, val, info);
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(call_netdevice_notifiers_info);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* call_netdevice_notifiers - call all network notifier blocks
|
* call_netdevice_notifiers - call all network notifier blocks
|
||||||
* @val: value passed unmodified to notifier function
|
* @val: value passed unmodified to notifier function
|
||||||
@ -1511,8 +1546,9 @@ EXPORT_SYMBOL(unregister_netdevice_notifier);
|
|||||||
|
|
||||||
int call_netdevice_notifiers(unsigned long val, struct net_device *dev)
|
int call_netdevice_notifiers(unsigned long val, struct net_device *dev)
|
||||||
{
|
{
|
||||||
ASSERT_RTNL();
|
struct netdev_notifier_info info;
|
||||||
return raw_notifier_call_chain(&netdev_chain, val, dev);
|
|
||||||
|
return call_netdevice_notifiers_info(val, dev, &info);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(call_netdevice_notifiers);
|
EXPORT_SYMBOL(call_netdevice_notifiers);
|
||||||
|
|
||||||
|
@ -295,9 +295,9 @@ static int net_dm_cmd_trace(struct sk_buff *skb,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int dropmon_net_event(struct notifier_block *ev_block,
|
static int dropmon_net_event(struct notifier_block *ev_block,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct dm_hw_stat_delta *new_stat = NULL;
|
struct dm_hw_stat_delta *new_stat = NULL;
|
||||||
struct dm_hw_stat_delta *tmp;
|
struct dm_hw_stat_delta *tmp;
|
||||||
|
|
||||||
|
@ -372,7 +372,7 @@ static void dst_ifdown(struct dst_entry *dst, struct net_device *dev,
|
|||||||
static int dst_dev_event(struct notifier_block *this, unsigned long event,
|
static int dst_dev_event(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct dst_entry *dst, *last = NULL;
|
struct dst_entry *dst, *last = NULL;
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
@ -705,9 +705,9 @@ static void detach_rules(struct list_head *rules, struct net_device *dev)
|
|||||||
|
|
||||||
|
|
||||||
static int fib_rules_event(struct notifier_block *this, unsigned long event,
|
static int fib_rules_event(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct net *net = dev_net(dev);
|
struct net *net = dev_net(dev);
|
||||||
struct fib_rules_ops *ops;
|
struct fib_rules_ops *ops;
|
||||||
|
|
||||||
|
@ -261,7 +261,7 @@ struct cgroup_subsys net_prio_subsys = {
|
|||||||
static int netprio_device_event(struct notifier_block *unused,
|
static int netprio_device_event(struct notifier_block *unused,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct netprio_map *old;
|
struct netprio_map *old;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1921,7 +1921,7 @@ static void pktgen_change_name(const struct pktgen_net *pn, struct net_device *d
|
|||||||
static int pktgen_device_event(struct notifier_block *unused,
|
static int pktgen_device_event(struct notifier_block *unused,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct pktgen_net *pn = net_generic(dev_net(dev), pg_net_id);
|
struct pktgen_net *pn = net_generic(dev_net(dev), pg_net_id);
|
||||||
|
|
||||||
if (pn->pktgen_exiting)
|
if (pn->pktgen_exiting)
|
||||||
|
@ -2667,7 +2667,7 @@ static void rtnetlink_rcv(struct sk_buff *skb)
|
|||||||
|
|
||||||
static int rtnetlink_event(struct notifier_block *this, unsigned long event, void *ptr)
|
static int rtnetlink_event(struct notifier_block *this, unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case NETDEV_UP:
|
case NETDEV_UP:
|
||||||
|
@ -2078,9 +2078,9 @@ static int dn_sendmsg(struct kiocb *iocb, struct socket *sock,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int dn_device_event(struct notifier_block *this, unsigned long event,
|
static int dn_device_event(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *)ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
if (!net_eq(dev_net(dev), &init_net))
|
if (!net_eq(dev_net(dev), &init_net))
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
|
@ -1352,10 +1352,9 @@ static inline void lowpan_netlink_fini(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int lowpan_device_event(struct notifier_block *unused,
|
static int lowpan_device_event(struct notifier_block *unused,
|
||||||
unsigned long event,
|
unsigned long event, void *ptr)
|
||||||
void *ptr)
|
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
LIST_HEAD(del_list);
|
LIST_HEAD(del_list);
|
||||||
struct lowpan_dev_record *entry, *tmp;
|
struct lowpan_dev_record *entry, *tmp;
|
||||||
|
|
||||||
|
@ -1234,7 +1234,7 @@ int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg)
|
|||||||
static int arp_netdev_event(struct notifier_block *this, unsigned long event,
|
static int arp_netdev_event(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case NETDEV_CHANGEADDR:
|
case NETDEV_CHANGEADDR:
|
||||||
|
@ -1333,7 +1333,7 @@ static void inetdev_send_gratuitous_arp(struct net_device *dev,
|
|||||||
static int inetdev_event(struct notifier_block *this, unsigned long event,
|
static int inetdev_event(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct in_device *in_dev = __in_dev_get_rtnl(dev);
|
struct in_device *in_dev = __in_dev_get_rtnl(dev);
|
||||||
|
|
||||||
ASSERT_RTNL();
|
ASSERT_RTNL();
|
||||||
|
@ -1038,7 +1038,7 @@ static int fib_inetaddr_event(struct notifier_block *this, unsigned long event,
|
|||||||
|
|
||||||
static int fib_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
|
static int fib_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct in_device *in_dev;
|
struct in_device *in_dev;
|
||||||
struct net *net = dev_net(dev);
|
struct net *net = dev_net(dev);
|
||||||
|
|
||||||
|
@ -1609,7 +1609,7 @@ int ipmr_compat_ioctl(struct sock *sk, unsigned int cmd, void __user *arg)
|
|||||||
|
|
||||||
static int ipmr_device_event(struct notifier_block *this, unsigned long event, void *ptr)
|
static int ipmr_device_event(struct notifier_block *this, unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct net *net = dev_net(dev);
|
struct net *net = dev_net(dev);
|
||||||
struct mr_table *mrt;
|
struct mr_table *mrt;
|
||||||
struct vif_device *v;
|
struct vif_device *v;
|
||||||
|
@ -108,7 +108,7 @@ static int masq_device_event(struct notifier_block *this,
|
|||||||
unsigned long event,
|
unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
const struct net_device *dev = ptr;
|
const struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct net *net = dev_net(dev);
|
struct net *net = dev_net(dev);
|
||||||
|
|
||||||
if (event == NETDEV_DOWN) {
|
if (event == NETDEV_DOWN) {
|
||||||
|
@ -2826,9 +2826,9 @@ static void addrconf_ip6_tnl_config(struct net_device *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int addrconf_notify(struct notifier_block *this, unsigned long event,
|
static int addrconf_notify(struct notifier_block *this, unsigned long event,
|
||||||
void *data)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *) data;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct inet6_dev *idev = __in6_dev_get(dev);
|
struct inet6_dev *idev = __in6_dev_get(dev);
|
||||||
int run_pending = 0;
|
int run_pending = 0;
|
||||||
int err;
|
int err;
|
||||||
|
@ -1319,7 +1319,7 @@ static int ip6mr_mfc_delete(struct mr6_table *mrt, struct mf6cctl *mfc,
|
|||||||
static int ip6mr_device_event(struct notifier_block *this,
|
static int ip6mr_device_event(struct notifier_block *this,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct net *net = dev_net(dev);
|
struct net *net = dev_net(dev);
|
||||||
struct mr6_table *mrt;
|
struct mr6_table *mrt;
|
||||||
struct mif_device *v;
|
struct mif_device *v;
|
||||||
|
@ -1568,7 +1568,7 @@ int ndisc_rcv(struct sk_buff *skb)
|
|||||||
|
|
||||||
static int ndisc_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
|
static int ndisc_netdev_event(struct notifier_block *this, unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct net *net = dev_net(dev);
|
struct net *net = dev_net(dev);
|
||||||
struct inet6_dev *idev;
|
struct inet6_dev *idev;
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ static int device_cmp(struct nf_conn *ct, void *ifindex)
|
|||||||
static int masq_device_event(struct notifier_block *this,
|
static int masq_device_event(struct notifier_block *this,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
const struct net_device *dev = ptr;
|
const struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct net *net = dev_net(dev);
|
struct net *net = dev_net(dev);
|
||||||
|
|
||||||
if (event == NETDEV_DOWN)
|
if (event == NETDEV_DOWN)
|
||||||
|
@ -2681,9 +2681,9 @@ void inet6_rt_notify(int event, struct rt6_info *rt, struct nl_info *info)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int ip6_route_dev_notify(struct notifier_block *this,
|
static int ip6_route_dev_notify(struct notifier_block *this,
|
||||||
unsigned long event, void *data)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *)data;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct net *net = dev_net(dev);
|
struct net *net = dev_net(dev);
|
||||||
|
|
||||||
if (event == NETDEV_REGISTER && (dev->flags & IFF_LOOPBACK)) {
|
if (event == NETDEV_REGISTER && (dev->flags & IFF_LOOPBACK)) {
|
||||||
|
@ -330,7 +330,7 @@ static __inline__ void __ipxitf_put(struct ipx_interface *intrfc)
|
|||||||
static int ipxitf_device_event(struct notifier_block *notifier,
|
static int ipxitf_device_event(struct notifier_block *notifier,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct ipx_interface *i, *tmp;
|
struct ipx_interface *i, *tmp;
|
||||||
|
|
||||||
if (!net_eq(dev_net(dev), &init_net))
|
if (!net_eq(dev_net(dev), &init_net))
|
||||||
|
@ -2293,7 +2293,7 @@ static void afiucv_hs_callback_txnotify(struct sk_buff *skb,
|
|||||||
static int afiucv_netdev_event(struct notifier_block *this,
|
static int afiucv_netdev_event(struct notifier_block *this,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *event_dev = (struct net_device *)ptr;
|
struct net_device *event_dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct sock *sk;
|
struct sock *sk;
|
||||||
struct iucv_sock *iucv;
|
struct iucv_sock *iucv;
|
||||||
|
|
||||||
|
@ -1717,10 +1717,9 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int netdev_notify(struct notifier_block *nb,
|
static int netdev_notify(struct notifier_block *nb,
|
||||||
unsigned long state,
|
unsigned long state, void *ptr)
|
||||||
void *ndev)
|
|
||||||
{
|
{
|
||||||
struct net_device *dev = ndev;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct ieee80211_sub_if_data *sdata;
|
struct ieee80211_sub_if_data *sdata;
|
||||||
|
|
||||||
if (state != NETDEV_CHANGENAME)
|
if (state != NETDEV_CHANGENAME)
|
||||||
|
@ -1487,9 +1487,9 @@ ip_vs_forget_dev(struct ip_vs_dest *dest, struct net_device *dev)
|
|||||||
* Currently only NETDEV_DOWN is handled to release refs to cached dsts
|
* Currently only NETDEV_DOWN is handled to release refs to cached dsts
|
||||||
*/
|
*/
|
||||||
static int ip_vs_dst_event(struct notifier_block *this, unsigned long event,
|
static int ip_vs_dst_event(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct net *net = dev_net(dev);
|
struct net *net = dev_net(dev);
|
||||||
struct netns_ipvs *ipvs = net_ipvs(net);
|
struct netns_ipvs *ipvs = net_ipvs(net);
|
||||||
struct ip_vs_service *svc;
|
struct ip_vs_service *svc;
|
||||||
|
@ -800,7 +800,7 @@ static int
|
|||||||
nfqnl_rcv_dev_event(struct notifier_block *this,
|
nfqnl_rcv_dev_event(struct notifier_block *this,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
/* Drop any packets associated with the downed device */
|
/* Drop any packets associated with the downed device */
|
||||||
if (event == NETDEV_DOWN)
|
if (event == NETDEV_DOWN)
|
||||||
|
@ -200,7 +200,7 @@ tee_tg6(struct sk_buff *skb, const struct xt_action_param *par)
|
|||||||
static int tee_netdev_event(struct notifier_block *this, unsigned long event,
|
static int tee_netdev_event(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct xt_tee_priv *priv;
|
struct xt_tee_priv *priv;
|
||||||
|
|
||||||
priv = container_of(this, struct xt_tee_priv, notifier);
|
priv = container_of(this, struct xt_tee_priv, notifier);
|
||||||
|
@ -708,7 +708,7 @@ int netlbl_unlhsh_remove(struct net *net,
|
|||||||
* netlbl_unlhsh_netdev_handler - Network device notification handler
|
* netlbl_unlhsh_netdev_handler - Network device notification handler
|
||||||
* @this: notifier block
|
* @this: notifier block
|
||||||
* @event: the event
|
* @event: the event
|
||||||
* @ptr: the network device (cast to void)
|
* @ptr: the netdevice notifier info (cast to void)
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Handle network device events, although at present all we care about is a
|
* Handle network device events, although at present all we care about is a
|
||||||
@ -717,10 +717,9 @@ int netlbl_unlhsh_remove(struct net *net,
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static int netlbl_unlhsh_netdev_handler(struct notifier_block *this,
|
static int netlbl_unlhsh_netdev_handler(struct notifier_block *this,
|
||||||
unsigned long event,
|
unsigned long event, void *ptr)
|
||||||
void *ptr)
|
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct netlbl_unlhsh_iface *iface = NULL;
|
struct netlbl_unlhsh_iface *iface = NULL;
|
||||||
|
|
||||||
if (!net_eq(dev_net(dev), &init_net))
|
if (!net_eq(dev_net(dev), &init_net))
|
||||||
|
@ -117,7 +117,7 @@ static void nr_kill_by_device(struct net_device *dev)
|
|||||||
*/
|
*/
|
||||||
static int nr_device_event(struct notifier_block *this, unsigned long event, void *ptr)
|
static int nr_device_event(struct notifier_block *this, unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *)ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
if (!net_eq(dev_net(dev), &init_net))
|
if (!net_eq(dev_net(dev), &init_net))
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
|
@ -78,7 +78,7 @@ static int dp_device_event(struct notifier_block *unused, unsigned long event,
|
|||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct ovs_net *ovs_net;
|
struct ovs_net *ovs_net;
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct vport *vport = NULL;
|
struct vport *vport = NULL;
|
||||||
|
|
||||||
if (!ovs_is_internal_dev(dev))
|
if (!ovs_is_internal_dev(dev))
|
||||||
|
@ -3331,10 +3331,11 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int packet_notifier(struct notifier_block *this, unsigned long msg, void *data)
|
static int packet_notifier(struct notifier_block *this,
|
||||||
|
unsigned long msg, void *ptr)
|
||||||
{
|
{
|
||||||
struct sock *sk;
|
struct sock *sk;
|
||||||
struct net_device *dev = data;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct net *net = dev_net(dev);
|
struct net *net = dev_net(dev);
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
|
@ -292,9 +292,9 @@ static void phonet_route_autodel(struct net_device *dev)
|
|||||||
|
|
||||||
/* notify Phonet of device events */
|
/* notify Phonet of device events */
|
||||||
static int phonet_device_notify(struct notifier_block *me, unsigned long what,
|
static int phonet_device_notify(struct notifier_block *me, unsigned long what,
|
||||||
void *arg)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = arg;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
switch (what) {
|
switch (what) {
|
||||||
case NETDEV_REGISTER:
|
case NETDEV_REGISTER:
|
||||||
|
@ -202,10 +202,10 @@ static void rose_kill_by_device(struct net_device *dev)
|
|||||||
/*
|
/*
|
||||||
* Handle device status changes.
|
* Handle device status changes.
|
||||||
*/
|
*/
|
||||||
static int rose_device_event(struct notifier_block *this, unsigned long event,
|
static int rose_device_event(struct notifier_block *this,
|
||||||
void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *)ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
if (!net_eq(dev_net(dev), &init_net))
|
if (!net_eq(dev_net(dev), &init_net))
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
|
@ -243,7 +243,7 @@ static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind, i
|
|||||||
static int mirred_device_event(struct notifier_block *unused,
|
static int mirred_device_event(struct notifier_block *unused,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct tcf_mirred *m;
|
struct tcf_mirred *m;
|
||||||
|
|
||||||
if (event == NETDEV_UNREGISTER)
|
if (event == NETDEV_UNREGISTER)
|
||||||
|
@ -251,9 +251,9 @@ static void disable_bearer(struct tipc_bearer *tb_ptr)
|
|||||||
* specified device.
|
* specified device.
|
||||||
*/
|
*/
|
||||||
static int recv_notification(struct notifier_block *nb, unsigned long evt,
|
static int recv_notification(struct notifier_block *nb, unsigned long evt,
|
||||||
void *dv)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *)dv;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct eth_bearer *eb_ptr = ð_bearers[0];
|
struct eth_bearer *eb_ptr = ð_bearers[0];
|
||||||
struct eth_bearer *stop = ð_bearers[MAX_ETH_BEARERS];
|
struct eth_bearer *stop = ð_bearers[MAX_ETH_BEARERS];
|
||||||
|
|
||||||
|
@ -244,9 +244,9 @@ static void disable_bearer(struct tipc_bearer *tb_ptr)
|
|||||||
* specified device.
|
* specified device.
|
||||||
*/
|
*/
|
||||||
static int recv_notification(struct notifier_block *nb, unsigned long evt,
|
static int recv_notification(struct notifier_block *nb, unsigned long evt,
|
||||||
void *dv)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = (struct net_device *)dv;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct ib_bearer *ib_ptr = &ib_bearers[0];
|
struct ib_bearer *ib_ptr = &ib_bearers[0];
|
||||||
struct ib_bearer *stop = &ib_bearers[MAX_IB_BEARERS];
|
struct ib_bearer *stop = &ib_bearers[MAX_IB_BEARERS];
|
||||||
|
|
||||||
|
@ -886,10 +886,9 @@ void cfg80211_leave(struct cfg80211_registered_device *rdev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
|
static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
|
||||||
unsigned long state,
|
unsigned long state, void *ptr)
|
||||||
void *ndev)
|
|
||||||
{
|
{
|
||||||
struct net_device *dev = ndev;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct wireless_dev *wdev = dev->ieee80211_ptr;
|
struct wireless_dev *wdev = dev->ieee80211_ptr;
|
||||||
struct cfg80211_registered_device *rdev;
|
struct cfg80211_registered_device *rdev;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -224,7 +224,7 @@ static void x25_kill_by_device(struct net_device *dev)
|
|||||||
static int x25_device_event(struct notifier_block *this, unsigned long event,
|
static int x25_device_event(struct notifier_block *this, unsigned long event,
|
||||||
void *ptr)
|
void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
struct x25_neigh *nb;
|
struct x25_neigh *nb;
|
||||||
|
|
||||||
if (!net_eq(dev_net(dev), &init_net))
|
if (!net_eq(dev_net(dev), &init_net))
|
||||||
|
@ -2784,7 +2784,7 @@ static void __net_init xfrm_dst_ops_init(struct net *net)
|
|||||||
|
|
||||||
static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void *ptr)
|
static int xfrm_dev_event(struct notifier_block *this, unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case NETDEV_DOWN:
|
case NETDEV_DOWN:
|
||||||
|
@ -264,7 +264,7 @@ static int sel_netif_avc_callback(u32 event)
|
|||||||
static int sel_netif_netdev_notifier_handler(struct notifier_block *this,
|
static int sel_netif_netdev_notifier_handler(struct notifier_block *this,
|
||||||
unsigned long event, void *ptr)
|
unsigned long event, void *ptr)
|
||||||
{
|
{
|
||||||
struct net_device *dev = ptr;
|
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
|
||||||
|
|
||||||
if (dev_net(dev) != &init_net)
|
if (dev_net(dev) != &init_net)
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
|
Loading…
Reference in New Issue
Block a user