bpqether.c (58e16d792a6a8c6b750f637a4649967fcac853dc) | bpqether.c (ab92d68fc22f9afab480153bd82a20f6e2533769) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * G8BPQ compatible "AX.25 via ethernet" driver release 004 4 * 5 * This code REQUIRES 2.0.0 or higher/ NET3.029 6 * 7 * This is a "pseudo" network driver to allow AX.25 over Ethernet 8 * using G8BPQ encapsulation. It has been extracted from the protocol --- 93 unchanged lines hidden (view full) --- 102 struct net_device *ethdev; /* link to ethernet device */ 103 struct net_device *axdev; /* bpq device (bpq#) */ 104 char dest_addr[6]; /* ether destination address */ 105 char acpt_addr[6]; /* accept ether frames from this address only */ 106}; 107 108static LIST_HEAD(bpq_devices); 109 | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* 3 * G8BPQ compatible "AX.25 via ethernet" driver release 004 4 * 5 * This code REQUIRES 2.0.0 or higher/ NET3.029 6 * 7 * This is a "pseudo" network driver to allow AX.25 over Ethernet 8 * using G8BPQ encapsulation. It has been extracted from the protocol --- 93 unchanged lines hidden (view full) --- 102 struct net_device *ethdev; /* link to ethernet device */ 103 struct net_device *axdev; /* bpq device (bpq#) */ 104 char dest_addr[6]; /* ether destination address */ 105 char acpt_addr[6]; /* accept ether frames from this address only */ 106}; 107 108static LIST_HEAD(bpq_devices); 109 |
110/* 111 * bpqether network devices are paired with ethernet devices below them, so 112 * form a special "super class" of normal ethernet devices; split their locks 113 * off into a separate class since they always nest. 114 */ 115static struct lock_class_key bpq_netdev_xmit_lock_key; 116static struct lock_class_key bpq_netdev_addr_lock_key; 117 118static void bpq_set_lockdep_class_one(struct net_device *dev, 119 struct netdev_queue *txq, 120 void *_unused) 121{ 122 lockdep_set_class(&txq->_xmit_lock, &bpq_netdev_xmit_lock_key); 123} 124 125static void bpq_set_lockdep_class(struct net_device *dev) 126{ 127 lockdep_set_class(&dev->addr_list_lock, &bpq_netdev_addr_lock_key); 128 netdev_for_each_tx_queue(dev, bpq_set_lockdep_class_one, NULL); 129} 130 | |
131/* ------------------------------------------------------------------------ */ 132 133 134/* 135 * Get the ethernet device for a BPQ device 136 */ 137static inline struct net_device *bpq_get_ether_dev(struct net_device *dev) 138{ --- 354 unchanged lines hidden (view full) --- 493 bpq->axdev = ndev; 494 495 eth_broadcast_addr(bpq->dest_addr); 496 eth_broadcast_addr(bpq->acpt_addr); 497 498 err = register_netdevice(ndev); 499 if (err) 500 goto error; | 110/* ------------------------------------------------------------------------ */ 111 112 113/* 114 * Get the ethernet device for a BPQ device 115 */ 116static inline struct net_device *bpq_get_ether_dev(struct net_device *dev) 117{ --- 354 unchanged lines hidden (view full) --- 472 bpq->axdev = ndev; 473 474 eth_broadcast_addr(bpq->dest_addr); 475 eth_broadcast_addr(bpq->acpt_addr); 476 477 err = register_netdevice(ndev); 478 if (err) 479 goto error; |
501 bpq_set_lockdep_class(ndev); | |
502 503 /* List protected by RTNL */ 504 list_add_rcu(&bpq->bpq_list, &bpq_devices); 505 return 0; 506 507 error: 508 dev_put(edev); 509 free_netdev(ndev); --- 99 unchanged lines hidden --- | 480 481 /* List protected by RTNL */ 482 list_add_rcu(&bpq->bpq_list, &bpq_devices); 483 return 0; 484 485 error: 486 dev_put(edev); 487 free_netdev(ndev); --- 99 unchanged lines hidden --- |