Skip to contentSkip to conversation

Frames droped on Linksys WRT160NL Router

ath9k-devel Thomas Wagner 1 participant 1 message Jul 29, 2012

lore
Share & tools
lore
#0 lore raw

Hi,

I am trying to set up a 802.11s Meshnetwork using OpenWRT SVN trunk on a couple of Linksys WRT160NL Router (with compat-wireless-2012-06-14). The peers between the routers are established like expected but on sending IP traffic there is no reaction.

I monitored the wireless lan traffic using wireshark and I noticed that there where ARP-Request-Packages send but none of my routers react on them. Expanding "arp.c" in compat-wireless with an printk()-message showed that the ARP-Pakage were not passed to "arp.c".

Perhaps the error is in the MAC80211 layer? So I expand net/mac80211/rx.c:

void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)

{
	/*.....*/
	#define macaddr__stm "%X-%X-%X-%X-%X-%X"
	#define mac_3 hdr->addr3[0],hdr->addr3[1],hdr->addr3[2],hdr->addr3[3],hdr->addr3[4],hdr->addr3[5]
   printk(KERN_DEBUG "ieee80211_rx(): From:"macaddr__stm" arpcheck(08-06):%X-%X\n",
		 mac_3, skb->data[38], skb->data[39]
	  );
	/*.....*/
}

skb->data[38] and skb->data[39] will represent the LLC type field and 0x0806 defines ARP type in ARP-Packages on a 802.11s Meshnetwork.

Reading the Kernellog I noticed that ARP frames weren't passed to ieee80211_rx().
I monitored the WLAN channel with wireshark and compare the frames apperaing with my Kernellog. Byte 56 and 57 (Left block, 4th Line of the wireshark hex output) matches to skb->data[38], skb->data[39].

Nearly every frame appearing in Wireshark was also visible in the Kernellog. Even frames of other wirless networks.
MAC_3 (perprocessordefinition, see above) was matching to the "bssi" field in wireshark. skb->data[38], skb->data[39] where matching to byte 56 and 57. There where two frame types I saw only on Wireshark but not in the Kernelog.
One was a becon of a Sitecom router the other one where my 802.11s ARP Frames.

So I edited in "drivers/net/wireless/ath/ath9k/" "recv.c" and "main.c"
First I insert the printk statement in ath9k_tasklet() and ath_rx_tasklet(). Every frame appearing in ath9k_tasklet() where passed to ath_rx_tasklet() and ieee80211_rx(). Dropping the frame must happend somewere before ath9k_tasklet() is called.
Then I insert a printk() statement in ath_isr() saying "ath_isr() called".
I noticed that not every interupt causes a ath9k_tasklet() call.

Perhaps here my frames are droped. I would be nice if I would be able to access the frame content in ath_isr(). But I don't know how? Can some one tellme how to access the framedata in order to add a statement like this:

    printk(KERN_DEBUG "ath_isr(): From:"macaddr__stm" arpcheck(08-06):%X-%X\n", ...);

So I can follow and will be able to see where exactly the frames are droped.

By the way. Look at http://is.gd/zqQirl .
For me line 20 has no sens because "changed_flags" is never used.

Cheers,
Tom

p.s.: I'm completly new to kernel/driver development. So pleaes explain every thing in details.