tracing: Unify arch_syscall_addr() implementations
[safe/jmp/linux-2.6] / drivers / net / wan / hdlc.c
index dbc1798..9937bba 100644 (file)
@@ -44,7 +44,7 @@ static const char* version = "HDLC support module revision 1.22";
 
 static struct hdlc_proto *first_proto;
 
-static int hdlc_change_mtu(struct net_device *dev, int new_mtu)
+int hdlc_change_mtu(struct net_device *dev, int new_mtu)
 {
        if ((new_mtu < 68) || (new_mtu > HDLC_MAX_MTU))
                return -EINVAL;
@@ -57,7 +57,7 @@ static int hdlc_rcv(struct sk_buff *skb, struct net_device *dev,
 {
        struct hdlc_device *hdlc = dev_to_hdlc(dev);
 
-       if (dev_net(dev) != &init_net) {
+       if (!net_eq(dev_net(dev), &init_net)) {
                kfree_skb(skb);
                return 0;
        }
@@ -66,7 +66,15 @@ static int hdlc_rcv(struct sk_buff *skb, struct net_device *dev,
        return hdlc->proto->netif_rx(skb);
 }
 
+netdev_tx_t hdlc_start_xmit(struct sk_buff *skb, struct net_device *dev)
+{
+       hdlc_device *hdlc = dev_to_hdlc(dev);
 
+       if (hdlc->proto->xmit)
+               return hdlc->proto->xmit(skb, dev);
+
+       return hdlc->xmit(skb, dev); /* call hardware driver directly */
+}
 
 static inline void hdlc_proto_start(struct net_device *dev)
 {
@@ -94,7 +102,7 @@ static int hdlc_device_event(struct notifier_block *this, unsigned long event,
        unsigned long flags;
        int on;
 
-       if (dev_net(dev) != &init_net)
+       if (!net_eq(dev_net(dev), &init_net))
                return NOTIFY_DONE;
 
        if (!(dev->priv_flags & IFF_WAN_HDLC))
@@ -231,8 +239,6 @@ static void hdlc_setup_dev(struct net_device *dev)
        dev->hard_header_len     = 16;
        dev->addr_len            = 0;
        dev->header_ops          = &hdlc_null_ops;
-
-       dev->change_mtu          = hdlc_change_mtu;
 }
 
 static void hdlc_setup(struct net_device *dev)
@@ -330,6 +336,8 @@ MODULE_AUTHOR("Krzysztof Halasa <khc@pm.waw.pl>");
 MODULE_DESCRIPTION("HDLC support module");
 MODULE_LICENSE("GPL v2");
 
+EXPORT_SYMBOL(hdlc_change_mtu);
+EXPORT_SYMBOL(hdlc_start_xmit);
 EXPORT_SYMBOL(hdlc_open);
 EXPORT_SYMBOL(hdlc_close);
 EXPORT_SYMBOL(hdlc_ioctl);
@@ -340,8 +348,8 @@ EXPORT_SYMBOL(unregister_hdlc_protocol);
 EXPORT_SYMBOL(attach_hdlc_protocol);
 EXPORT_SYMBOL(detach_hdlc_protocol);
 
-static struct packet_type hdlc_packet_type = {
-       .type = __constant_htons(ETH_P_HDLC),
+static struct packet_type hdlc_packet_type __read_mostly = {
+       .type = cpu_to_be16(ETH_P_HDLC),
        .func = hdlc_rcv,
 };