On 8/5/10, Jon Smirl <[email protected]> wrote: >>> I'm trying to figure out where to insert 6lowpan support but I'm >> >> 6lowpan should be just a listener for all 802.15.4 frames. We have not had >> come with any interface (other than BSD sockets). You can either implement >> some custom in-kernel skb interchange mechanism (but keep in mind also >> other possible users, like ZigBee, ZigBee RF4CE, WirelessHART, MiWi, etc.) >> or just use in-kernel socket interface (which is used e.g. by >> nfs-kernel-server, >> IIRC). > > I've written protocol stacks for other OSes but not Linux. > > Can I set the protocol in mac802154_process_data()? > > skb->protocol = htons(ETH_P_6LOWPAN); > skb->pkt_type = PACKET_HOST; > > if (in_interrupt()) > return netif_rx(skb);
Even if this will work, it's hack, so it's not allowed. > What would be a good example for me to follow as a model of the > architecture of the protocol? Actually I suggest looking at two different approaches: 1) Various in-kernel network file systems, which use kernel socket API. You can use the same API for packet receiving/transmission. 2) Just register a listener for ETH_P_IEEE802154 and specified device. You can find an example at net/ieee802154/af_ieee802154.c Note: one cannot assume that all wpan devices bear 6lowpan traffic. So there should be some kind of bind/unbind functionality (It's easy to implement though). Another question is how to interface 6lowpan to IPv6 subsystem. The easiest solution is to create another device just for the purpose of IPv6 (e.g. like IPv6 over something tunnels do). I believe that things can be done w/o such special device (I just don't know how), and that going w/o special devices would be cleaner solution. However I'm really not an expert in this topic, so maybe you can ask smb. on netdev list (please keep me in cc). > In RFC4944 6lowpan has a dispatch byte at the front. 00xxxxxx is > reserved for other protocols. Does that happen to mesh with ZigBee, > etc? Yes. IIUC, ZigBee & ko. don't have such designation. It's really a pity, that 802.15.4 don't have SNAP/DNAP/ptype-like kind of things. >>> having trouble getting my head around the organization of the code. >> >> Maybe I should write some extended 'Design' documentation. >> Anyway I'll have to prepare that as a part of LinuxKongress talk. > > A diagram showing the relationships of the components and mapping them > to the 802.11 equivalents would make a good slide. Yes. -- With best wishes Dmitry ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm _______________________________________________ Linux-zigbee-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel
