]> err.no Git - linux-2.6/blobdiff - drivers/net/hamradio/dmascc.c
sk98lin: resurrect driver
[linux-2.6] / drivers / net / hamradio / dmascc.c
index e6e721aff6f688baa925754b1df54ef8d12cce41..205f09672492b4f4ec42236a264779717cc6297d 100644 (file)
@@ -264,12 +264,6 @@ static int io[MAX_NUM_DEVS] __initdata = { 0, };
 
 /* Beware! hw[] is also used in cleanup_module(). */
 static struct scc_hardware hw[NUM_TYPES] __initdata_or_module = HARDWARE;
-static char ax25_broadcast[7] __initdata =
-    { 'Q' << 1, 'S' << 1, 'T' << 1, ' ' << 1, ' ' << 1, ' ' << 1,
-'0' << 1 };
-static char ax25_test[7] __initdata =
-    { 'L' << 1, 'I' << 1, 'N' << 1, 'U' << 1, 'X' << 1, ' ' << 1,
-'1' << 1 };
 
 
 /* Global variables */
@@ -443,8 +437,8 @@ static void __init dev_setup(struct net_device *dev)
        dev->mtu = 1500;
        dev->addr_len = AX25_ADDR_LEN;
        dev->tx_queue_len = 64;
-       memcpy(dev->broadcast, ax25_broadcast, AX25_ADDR_LEN);
-       memcpy(dev->dev_addr, ax25_test, AX25_ADDR_LEN);
+       memcpy(dev->broadcast, &ax25_bcast, AX25_ADDR_LEN);
+       memcpy(dev->dev_addr, &ax25_defaddr, AX25_ADDR_LEN);
 }
 
 static int __init setup_adapter(int card_base, int type, int n)
@@ -459,8 +453,8 @@ static int __init setup_adapter(int card_base, int type, int n)
        int scc_base = card_base + hw[type].scc_offset;
        char *chipnames[] = CHIPNAMES;
 
-       /* Allocate memory */
-       info = kmalloc(sizeof(struct scc_info), GFP_KERNEL | GFP_DMA);
+       /* Initialize what is necessary for write_scc and write_scc_data */
+       info = kzalloc(sizeof(struct scc_info), GFP_KERNEL | GFP_DMA);
        if (!info) {
                printk(KERN_ERR "dmascc: "
                       "could not allocate memory for %s at %#3x\n",
@@ -468,8 +462,6 @@ static int __init setup_adapter(int card_base, int type, int n)
                goto out;
        }
 
-       /* Initialize what is necessary for write_scc and write_scc_data */
-       memset(info, 0, sizeof(struct scc_info));
 
        info->dev[0] = alloc_netdev(0, "", dev_setup);
        if (!info->dev[0]) {
@@ -936,7 +928,7 @@ static int scc_send_packet(struct sk_buff *skb, struct net_device *dev)
 
        /* Transfer data to DMA buffer */
        i = priv->tx_head;
-       memcpy(priv->tx_buf[i], skb->data + 1, skb->len - 1);
+       skb_copy_from_linear_data_offset(skb, 1, priv->tx_buf[i], skb->len - 1);
        priv->tx_len[i] = skb->len - 1;
 
        /* Clear interrupts while we touch our circular buffers */