/* * NET3: Support for 802.2 demultiplexing off Ethernet * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * * Demultiplex 802.2 encoded protocols. We match the entry by the * SSAP/DSAP pair and then deliver to the registered datalink that * matches. The control byte is ignored and handling of such items * is up to the routine passed the frame. * * Unlike the 802.3 datalink we have a list of 802.2 entries as * there are multiple protocols to demux. The list is currently * short (3 or 4 entries at most). The current demux assumes this. */ #include #include #include #include #include #include #include #include #include #include static int p8022_request(struct datalink_proto *dl, struct sk_buff *skb, unsigned char *dest) { llc_build_and_send_ui_pkt(dl->sap, skb, dest, dl->sap->laddr.lsap); return 0; } struct datalink_proto *register_8022_client(unsigned char type, int (*func)(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev)) { struct datalink_proto *proto; proto = kmalloc(sizeof(*proto), GFP_ATOMIC); if (proto) { proto->type[0] = type; proto->header_length = 3; proto->request = p8022_request; proto->sap = llc_sap_open(type, func); if (!proto->sap) { kfree(proto); proto = NULL; } } return proto; } void unregister_8022_client(struct datalink_proto *proto) { llc_sap_put(proto->sap); kfree(proto); } EXPORT_SYMBOL(register_8022_client); EXPORT_SYMBOL(unregister_8022_client); MODULE_LICENSE("GPL"); gtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-30 15:47:19 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-30 15:47:19 -0800
commitf9a42e0d58cf0fe3d902e63d4582f2ea4cd2bb8b (patch)
tree4078d3ae27d4ebb85bdcd4d84e9b9a4d059f22bb /tools/perf/tests/mmap-thread-lookup.c
parent751321b3dd5040dc5be19bd23f985e80c914621a (diff)
parent54791b276b4000b307339f269d3bf7db877d536f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Pull sparc fixes from David Miller: "Several small bug fixes and tidies, along with a fix for non-resumable memory errors triggered by userspace" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc: sparc64: Handle PIO & MEM non-resumable errors. sparc64: Zero pages on allocation for mondo and error queues. sparc: Fixed typo in sstate.c. Replaced panicing with panicking sparc: use symbolic names for tsb indexing
Diffstat (limited to 'tools/perf/tests/mmap-thread-lookup.c')