af_rose.c (75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37) af_rose.c (ab92d68fc22f9afab480153bd82a20f6e2533769)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 *
4 * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
5 * Copyright (C) Alan Cox GW4PTS (alan@lxorguk.ukuu.org.uk)
6 * Copyright (C) Terry Dawson VK2KTJ (terry@animats.net)
7 * Copyright (C) Tomi Manninen OH2BNS (oh2bns@sral.fi)
8 */

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

60static HLIST_HEAD(rose_list);
61static DEFINE_SPINLOCK(rose_list_lock);
62
63static const struct proto_ops rose_proto_ops;
64
65ax25_address rose_callsign;
66
67/*
1// SPDX-License-Identifier: GPL-2.0-or-later
2/*
3 *
4 * Copyright (C) Jonathan Naylor G4KLX (g4klx@g4klx.demon.co.uk)
5 * Copyright (C) Alan Cox GW4PTS (alan@lxorguk.ukuu.org.uk)
6 * Copyright (C) Terry Dawson VK2KTJ (terry@animats.net)
7 * Copyright (C) Tomi Manninen OH2BNS (oh2bns@sral.fi)
8 */

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

60static HLIST_HEAD(rose_list);
61static DEFINE_SPINLOCK(rose_list_lock);
62
63static const struct proto_ops rose_proto_ops;
64
65ax25_address rose_callsign;
66
67/*
68 * ROSE network devices are virtual network devices encapsulating ROSE
69 * frames into AX.25 which will be sent through an AX.25 device, so form a
70 * special "super class" of normal net devices; split their locks off into a
71 * separate class since they always nest.
72 */
73static struct lock_class_key rose_netdev_xmit_lock_key;
74static struct lock_class_key rose_netdev_addr_lock_key;
75
76static void rose_set_lockdep_one(struct net_device *dev,
77 struct netdev_queue *txq,
78 void *_unused)
79{
80 lockdep_set_class(&txq->_xmit_lock, &rose_netdev_xmit_lock_key);
81}
82
83static void rose_set_lockdep_key(struct net_device *dev)
84{
85 lockdep_set_class(&dev->addr_list_lock, &rose_netdev_addr_lock_key);
86 netdev_for_each_tx_queue(dev, rose_set_lockdep_one, NULL);
87}
88
89/*
90 * Convert a ROSE address into text.
91 */
92char *rose2asc(char *buf, const rose_address *addr)
93{
94 if (addr->rose_addr[0] == 0x00 && addr->rose_addr[1] == 0x00 &&
95 addr->rose_addr[2] == 0x00 && addr->rose_addr[3] == 0x00 &&
96 addr->rose_addr[4] == 0x00) {
97 strcpy(buf, "*");

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

1528 goto fail;
1529 }
1530 rc = register_netdev(dev);
1531 if (rc) {
1532 printk(KERN_ERR "ROSE: netdevice registration failed\n");
1533 free_netdev(dev);
1534 goto fail;
1535 }
68 * Convert a ROSE address into text.
69 */
70char *rose2asc(char *buf, const rose_address *addr)
71{
72 if (addr->rose_addr[0] == 0x00 && addr->rose_addr[1] == 0x00 &&
73 addr->rose_addr[2] == 0x00 && addr->rose_addr[3] == 0x00 &&
74 addr->rose_addr[4] == 0x00) {
75 strcpy(buf, "*");

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

1506 goto fail;
1507 }
1508 rc = register_netdev(dev);
1509 if (rc) {
1510 printk(KERN_ERR "ROSE: netdevice registration failed\n");
1511 free_netdev(dev);
1512 goto fail;
1513 }
1536 rose_set_lockdep_key(dev);
1537 dev_rose[i] = dev;
1538 }
1539
1540 sock_register(&rose_family_ops);
1541 register_netdevice_notifier(&rose_dev_notifier);
1542
1543 ax25_register_pid(&rose_pid);
1544 ax25_linkfail_register(&rose_linkfail_notifier);

--- 76 unchanged lines hidden ---
1514 dev_rose[i] = dev;
1515 }
1516
1517 sock_register(&rose_family_ops);
1518 register_netdevice_notifier(&rose_dev_notifier);
1519
1520 ax25_register_pid(&rose_pid);
1521 ax25_linkfail_register(&rose_linkfail_notifier);

--- 76 unchanged lines hidden ---