pn_dev.c (163849ea9b4c5d50fbd324692461983d18faadad) pn_dev.c (2c8c1e7297e19bdef3c178c3ea41d898a7716e3e)
1/*
2 * File: pn_dev.c
3 *
4 * Phonet network device
5 *
6 * Copyright (C) 2008 Nokia Corporation.
7 *
8 * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com>

--- 297 unchanged lines hidden (view full) ---

306}
307
308static struct notifier_block phonet_device_notifier = {
309 .notifier_call = phonet_device_notify,
310 .priority = 0,
311};
312
313/* Per-namespace Phonet devices handling */
1/*
2 * File: pn_dev.c
3 *
4 * Phonet network device
5 *
6 * Copyright (C) 2008 Nokia Corporation.
7 *
8 * Contact: Remi Denis-Courmont <remi.denis-courmont@nokia.com>

--- 297 unchanged lines hidden (view full) ---

306}
307
308static struct notifier_block phonet_device_notifier = {
309 .notifier_call = phonet_device_notify,
310 .priority = 0,
311};
312
313/* Per-namespace Phonet devices handling */
314static int phonet_init_net(struct net *net)
314static int __net_init phonet_init_net(struct net *net)
315{
316 struct phonet_net *pnn = net_generic(net, phonet_net_id);
317
318 if (!proc_net_fops_create(net, "phonet", 0, &pn_sock_seq_fops))
319 return -ENOMEM;
320
321 INIT_LIST_HEAD(&pnn->pndevs.list);
322 mutex_init(&pnn->pndevs.lock);
323 mutex_init(&pnn->routes.lock);
324 return 0;
325}
326
315{
316 struct phonet_net *pnn = net_generic(net, phonet_net_id);
317
318 if (!proc_net_fops_create(net, "phonet", 0, &pn_sock_seq_fops))
319 return -ENOMEM;
320
321 INIT_LIST_HEAD(&pnn->pndevs.list);
322 mutex_init(&pnn->pndevs.lock);
323 mutex_init(&pnn->routes.lock);
324 return 0;
325}
326
327static void phonet_exit_net(struct net *net)
327static void __net_exit phonet_exit_net(struct net *net)
328{
329 struct phonet_net *pnn = net_generic(net, phonet_net_id);
330 struct net_device *dev;
331 unsigned i;
332
333 rtnl_lock();
334 for_each_netdev(net, dev)
335 phonet_device_destroy(dev);

--- 110 unchanged lines hidden ---
328{
329 struct phonet_net *pnn = net_generic(net, phonet_net_id);
330 struct net_device *dev;
331 unsigned i;
332
333 rtnl_lock();
334 for_each_netdev(net, dev)
335 phonet_device_destroy(dev);

--- 110 unchanged lines hidden ---