I'm working on pcap support for the native IEEE 802.15.4
implementation in the kernel.
http://sourceforge.net/apps/trac/linux-zigbee/

pcap uses ARPHRD_ to write the DLT value into the pcap file. We need a
new DLT for the internal Linux packets since they have had the two FCS
bytes stripped from the end.

The 802.15.4 implementation has used two different ARPHRD types, one
for the active interface and one for the monitor interface. Has that
been done correctly? Should there be two types?

void ieee802154_monitor_setup(struct net_device *dev)
{
       struct ieee802154_sub_if_data *priv;

       dev->addr_len           = 0;
       dev->features           = NETIF_F_NO_CSUM;
       dev->hard_header_len    = 0;
       dev->needed_tailroom    = 2; /* FCS */
       dev->mtu                = 127;
       dev->tx_queue_len       = 10;
       dev->type               = ARPHRD_IEEE802154_MONITOR;
       dev->flags              = IFF_NOARP | IFF_BROADCAST;
       dev->watchdog_timeo     = 0;

       dev->destructor         = free_netdev;
       dev->netdev_ops         = &ieee802154_monitor_ops;
       dev->ml_priv            = &mac802154_mlme;


void ieee802154_wpan_setup(struct net_device *dev)
{
       struct ieee802154_sub_if_data *priv;

       dev->addr_len           = IEEE802154_ADDR_LEN;
       memset(dev->broadcast, 0xff, IEEE802154_ADDR_LEN);
       dev->features           = NETIF_F_NO_CSUM;
       dev->hard_header_len    = 2 + 1 + 20 + 14;
       dev->header_ops         = &ieee802154_header_ops;
       dev->needed_tailroom    = 2; /* FCS */
       dev->mtu                = 1280;
       dev->tx_queue_len       = 10;
       dev->type               = ARPHRD_IEEE802154;
       dev->flags              = IFF_NOARP | IFF_BROADCAST;
       dev->watchdog_timeo     = 0;

       dev->destructor         = free_netdev;
       dev->netdev_ops         = &ieee802154_wpan_ops;
       dev->ml_priv            = &mac802154_mlme;




-- 
Jon Smirl
[email protected]

------------------------------------------------------------------------------
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

Reply via email to