[Click] todevice and madwifi-ng in monitor mode

David Claffey dclaffey at jjplus.com
Wed Apr 12 12:50:18 EDT 2006


I have the click linuxmodule and the madwifi-ng driver running on linux-2.6.12. 
  I'm using todevice() to send packets out the ath device in monitor mode.  But 
this only works after adding the following patch:
--- click/elements/linuxmodule/todevice.cc
+++ tmp/elements/linuxmodule/todevice.cc
@@ -383,6 +383,12 @@
  	skb_put(skb1, 60 - skb1->len);
      }

+    skb1->dev = _dev;
+
      int ret;
  #if HAVE_LINUX_POLLING
      if (_dev->polling > 0)
	ret = _dev->tx_queue(_dev, skb1);
     else
#endif
	{
	    ret = _dev->hard_start_xmit(skb1, _dev);
	    _hard_start++;
	}

Todevice() passes the skb to ieee80211_hardstart(struct sk_buff *skb, struct 
net_device *dev) which then calls ieee80211_monitor_encap(struct ieee80211vap 
*vap, struct sk_buff *skb).  The problem arises when ieee80211_monitor_encap() 
references skb->dev->type with skb->dev NULL. Can anyone suggest which function 
should set skb->dev, todevice or ieee80211_hardstart?

- David


More information about the click mailing list