mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-29 17:23:36 +00:00
net: atm: use address setting helpers
Get it ready for constant netdev->dev_addr. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8bc7823ed3
commit
d6b3daf24e
@ -577,10 +577,12 @@ static int br2684_regvcc(struct atm_vcc *atmvcc, void __user * arg)
|
|||||||
pr_debug("vcc=%p, encaps=%d, brvcc=%p\n", atmvcc, be.encaps, brvcc);
|
pr_debug("vcc=%p, encaps=%d, brvcc=%p\n", atmvcc, be.encaps, brvcc);
|
||||||
if (list_empty(&brdev->brvccs) && !brdev->mac_was_set) {
|
if (list_empty(&brdev->brvccs) && !brdev->mac_was_set) {
|
||||||
unsigned char *esi = atmvcc->dev->esi;
|
unsigned char *esi = atmvcc->dev->esi;
|
||||||
|
const u8 one = 1;
|
||||||
|
|
||||||
if (esi[0] | esi[1] | esi[2] | esi[3] | esi[4] | esi[5])
|
if (esi[0] | esi[1] | esi[2] | esi[3] | esi[4] | esi[5])
|
||||||
dev_addr_set(net_dev, esi);
|
dev_addr_set(net_dev, esi);
|
||||||
else
|
else
|
||||||
net_dev->dev_addr[2] = 1;
|
dev_addr_mod(net_dev, 2, &one, 1);
|
||||||
}
|
}
|
||||||
list_add(&brvcc->brvccs, &brdev->brvccs);
|
list_add(&brvcc->brvccs, &brdev->brvccs);
|
||||||
write_unlock_irq(&devs_lock);
|
write_unlock_irq(&devs_lock);
|
||||||
|
@ -340,12 +340,12 @@ static int lec_close(struct net_device *dev)
|
|||||||
|
|
||||||
static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
|
static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
|
static const u8 zero_addr[ETH_ALEN] = {};
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
struct net_device *dev = (struct net_device *)vcc->proto_data;
|
struct net_device *dev = (struct net_device *)vcc->proto_data;
|
||||||
struct lec_priv *priv = netdev_priv(dev);
|
struct lec_priv *priv = netdev_priv(dev);
|
||||||
struct atmlec_msg *mesg;
|
struct atmlec_msg *mesg;
|
||||||
struct lec_arp_table *entry;
|
struct lec_arp_table *entry;
|
||||||
int i;
|
|
||||||
char *tmp; /* FIXME */
|
char *tmp; /* FIXME */
|
||||||
|
|
||||||
WARN_ON(refcount_sub_and_test(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc));
|
WARN_ON(refcount_sub_and_test(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc));
|
||||||
@ -358,8 +358,7 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
|
|||||||
eth_hw_addr_set(dev, mesg->content.normal.mac_addr);
|
eth_hw_addr_set(dev, mesg->content.normal.mac_addr);
|
||||||
break;
|
break;
|
||||||
case l_del_mac_addr:
|
case l_del_mac_addr:
|
||||||
for (i = 0; i < 6; i++)
|
eth_hw_addr_set(dev, zero_addr);
|
||||||
dev->dev_addr[i] = 0;
|
|
||||||
break;
|
break;
|
||||||
case l_addr_delete:
|
case l_addr_delete:
|
||||||
lec_addr_delete(priv, mesg->content.normal.atm_addr,
|
lec_addr_delete(priv, mesg->content.normal.atm_addr,
|
||||||
|
Loading…
Reference in New Issue
Block a user