12 #include <linux/errno.h>
14 #include <linux/hdlc.h>
15 #include <linux/if_arp.h>
18 #include <linux/kernel.h>
20 #include <linux/module.h>
22 #include <linux/poll.h>
23 #include <linux/rtnetlink.h>
36 if ((skb = dev_alloc_skb(1)) ==
NULL) {
37 netdev_err(dev,
"out of memory\n");
44 skb->
protocol = x25_type_trans(skb, dev);
50 static void x25_connected(
struct net_device *dev,
int reason)
57 static void x25_disconnected(
struct net_device *dev,
int reason)
76 skb->
protocol = x25_type_trans(skb, dev);
96 switch (skb->
data[0]) {
107 x25_connected(dev, 0);
109 netdev_err(dev,
"LAPB connect request failed, error code = %i\n",
118 x25_disconnected(dev, 0);
120 netdev_err(dev,
"LAPB disconnect request failed, error code = %i\n",
139 .connect_confirmation = x25_connected,
140 .connect_indication = x25_connected,
141 .disconnect_confirmation = x25_disconnected,
142 .disconnect_indication = x25_disconnected,
143 .data_indication = x25_data_indication,
144 .data_transmit = x25_data_transmit,
162 static int x25_rx(
struct sk_buff *skb)
167 dev->
stats.rx_dropped++;
174 dev->
stats.rx_errors++;
195 switch (ifr->ifr_settings.type) {
197 if (dev_to_hdlc(dev)->proto != &proto)
216 netif_dormant_off(dev);
224 static int __init mod_init(
void)
232 static void __exit mod_exit(
void)