]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/hamradio/mkiss.c
hamradio: ->hard_header() takes packet type in host-endian
[linux-2.6-omap-h63xx.git] / drivers / net / hamradio / mkiss.c
index d8715b200c17bfcdef02ee8aa5c8f2358a4bcecb..803a3bdea0af5f1e36d02055157f55107aff7c87 100644 (file)
@@ -578,11 +578,12 @@ static int ax_open_dev(struct net_device *dev)
 #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
 
 /* Return the frame type ID */
-static int ax_header(struct sk_buff *skb, struct net_device *dev, unsigned short type,
-         void *daddr, void *saddr, unsigned len)
+static int ax_header(struct sk_buff *skb, struct net_device *dev,
+                    unsigned short type, const void *daddr,
+                    const void *saddr, unsigned len)
 {
 #ifdef CONFIG_INET
-       if (type != htons(ETH_P_AX25))
+       if (type != ETH_P_AX25)
                return ax25_hard_header(skb, dev, type, daddr, saddr, len);
 #endif
        return 0;
@@ -670,13 +671,13 @@ static struct net_device_stats *ax_get_stats(struct net_device *dev)
        return &ax->stats;
 }
 
+static const struct header_ops ax_header_ops = {
+       .create    = ax_header,
+       .rebuild   = ax_rebuild_header,
+};
+
 static void ax_setup(struct net_device *dev)
 {
-       static char ax25_bcast[AX25_ADDR_LEN] =
-               {'Q'<<1,'S'<<1,'T'<<1,' '<<1,' '<<1,' '<<1,'0'<<1};
-       static char ax25_test[AX25_ADDR_LEN] =
-               {'L'<<1,'I'<<1,'N'<<1,'U'<<1,'X'<<1,' '<<1,'1'<<1};
-
        /* Finish setting up the DEVICE info. */
        dev->mtu             = AX_MTU;
        dev->hard_start_xmit = ax_xmit;
@@ -688,11 +689,11 @@ static void ax_setup(struct net_device *dev)
        dev->addr_len        = 0;
        dev->type            = ARPHRD_AX25;
        dev->tx_queue_len    = 10;
-       dev->hard_header     = ax_header;
-       dev->rebuild_header  = ax_rebuild_header;
+       dev->header_ops      = &ax_header_ops;
+
 
-       memcpy(dev->broadcast, ax25_bcast, 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);
 
        dev->flags      = IFF_BROADCAST | IFF_MULTICAST;
 }