X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fhamradio%2Fbpqether.c;h=656f2789c9ba03585866ba490f3ab1c11a306c98;hb=bc8a8387ba57db2275e717c19838a8d5a404c270;hp=0641f54fc6389d622c4e971a4da0a4083943928e;hpb=71bc7bf045262e82c645cad48fd56dd17e75344e;p=powerpc.git diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index 0641f54fc6..656f2789c9 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c @@ -88,11 +88,6 @@ static char banner[] __initdata = KERN_INFO "AX.25: bpqether driver version 004\n"; -static unsigned char ax25_bcast[AX25_ADDR_LEN] = - {'Q' << 1, 'S' << 1, 'T' << 1, ' ' << 1, ' ' << 1, ' ' << 1, '0' << 1}; -static unsigned char ax25_defaddr[AX25_ADDR_LEN] = - {'L' << 1, 'I' << 1, 'N' << 1, 'U' << 1, 'X' << 1, ' ' << 1, '1' << 1}; - static char bcast_addr[6]={0xFF,0xFF,0xFF,0xFF,0xFF,0xFF}; static char bpq_eth_addr[6]; @@ -122,6 +117,12 @@ struct bpqdev { static LIST_HEAD(bpq_devices); +/* + * bpqether network devices are paired with ethernet devices below them, so + * form a special "super class" of normal ethernet devices; split their locks + * off into a separate class since they always nest. + */ +static struct lock_class_key bpq_netdev_xmit_lock_key; /* ------------------------------------------------------------------------ */ @@ -281,7 +282,7 @@ static int bpq_xmit(struct sk_buff *skb, struct net_device *dev) } skb->protocol = ax25_type_trans(skb, dev); - skb->nh.raw = skb->data; + skb_reset_network_header(skb); dev->hard_header(skb, dev, ETH_P_BPQ, bpq->dest_addr, NULL, 0); bpq->stats.tx_packets++; bpq->stats.tx_bytes+=skb->len; @@ -458,7 +459,7 @@ static int bpq_info_open(struct inode *inode, struct file *file) return seq_open(file, &bpq_seqops); } -static struct file_operations bpq_info_fops = { +static const struct file_operations bpq_info_fops = { .owner = THIS_MODULE, .open = bpq_info_open, .read = seq_read, @@ -481,8 +482,8 @@ static void bpq_setup(struct net_device *dev) dev->do_ioctl = bpq_ioctl; dev->destructor = free_netdev; - memcpy(dev->broadcast, ax25_bcast, AX25_ADDR_LEN); - memcpy(dev->dev_addr, ax25_defaddr, AX25_ADDR_LEN); + memcpy(dev->broadcast, &ax25_bcast, AX25_ADDR_LEN); + memcpy(dev->dev_addr, &ax25_defaddr, AX25_ADDR_LEN); dev->flags = 0; @@ -528,6 +529,7 @@ static int bpq_new_device(struct net_device *edev) err = register_netdevice(ndev); if (err) goto error; + lockdep_set_class(&ndev->_xmit_lock, &bpq_netdev_xmit_lock_key); /* List protected by RTNL */ list_add_rcu(&bpq->bpq_list, &bpq_devices);