1 #include <linux/netdevice.h>
2 #include <linux/skbuff.h>
3 #include <net/datalink.h>
4 #include <linux/mm.h>
5 #include <linux/in.h>
6
7 static void
pEII_datalink_header(struct datalink_proto * dl,struct sk_buff * skb,unsigned char * dest_node)8 pEII_datalink_header(struct datalink_proto *dl,
9 struct sk_buff *skb, unsigned char *dest_node)
10 {
11 struct net_device *dev = skb->dev;
12
13 skb->protocol = htons (ETH_P_IPX);
14 if(dev->hard_header)
15 dev->hard_header(skb, dev, ETH_P_IPX, dest_node, NULL, skb->len);
16 }
17
18 struct datalink_proto *
make_EII_client(void)19 make_EII_client(void)
20 {
21 struct datalink_proto *proto;
22
23 proto = (struct datalink_proto *) kmalloc(sizeof(*proto), GFP_ATOMIC);
24 if (proto != NULL) {
25 proto->type_len = 0;
26 proto->header_length = 0;
27 proto->datalink_header = pEII_datalink_header;
28 proto->string_name = "EtherII";
29 }
30
31 return proto;
32 }
33
destroy_EII_client(struct datalink_proto * dl)34 void destroy_EII_client(struct datalink_proto *dl)
35 {
36 if (dl)
37 kfree(dl);
38 }
39