2013-03-20 15:22:08

by nick

[permalink] [raw]
Subject: ath6kl_usb - ping problems when compiled for sh4.

Hi
I tried a wek or so ago to get some help with my ping problems.

Essentially, the problem I see is that my AR6004 based USB wifi adaptor can associate with an AP OK, and gets an IP address via DHCP just fine.
But, pings don't work.

I can't ping to the device from another PC on the same subnet, and I can't ping out.

And, I think my problem has something to do with MAC addresses.

According to wireshark, pings are received by the USB wifi device OK, but the echo reply is going back out to the wrong MAC address - so it's never received by the ping originator.

Attached is some debug from the driver - which hopefully someone will understand.

Someone suggested that my problem might be endianness related - but I can see that myself - because Association with the AP, and DHCP wouldn't work if that was the case.
The problem looks to me more like a problem with structure alignment - where the MAC address table is shifted over.


You will see in the attached file that the ping originator MAC address is 20:CF:30:94:83:7B
And, the MAC address of the wifi adaptor itself is 00:03:7F:20:50:59

According to wireshark the MAC address which the echo reply is going back to is neither of these.

Any ideas what's wrong?


Regards

Nick


Attachments:
ath6kl_debug.txt (16.35 kB)

2013-03-20 16:06:53

by nick

[permalink] [raw]
Subject: Re: ath6kl_usb - ping problems when compiled for sh4.


> + ath6kl-devel
>
>
> care to check with the latest driver and firmware
> https://github.com/cernekee/linux-firmware/tree/master/ath6k/AR6004
> http://linuxwireless.org/download/compat-wireless-2.6/
>
> AR6004 is pretty decent working.
>

Hi, Yes, I have the latest driver - from Qualcomm.

I think my problem is that I've compiled it for 'sh4' - and it's not guaranteed to work on that platform.

And, indeed it doesn't.

I've just sent out a ping from the wifi adaptor to a PC on the local subnet.
Wireshark says that a ping request was sent out from Src=00:03:7f:20:50:59 (which is correct),
And the destination is Dst=7f:20:50:59:00:5c (which is wrong).

The destination MAC address should be 20:cf:30:94:83:7b .

But, look at the two Src and Dst MAC addresses - they are very similar ! !!?!?!?!

I don't understand where the Dst MAC comes from. That's my bug I think.


Regards

Nick

2013-03-21 13:34:59

by nick

[permalink] [raw]
Subject: Re: ath6kl_usb - ping problems when compiled for sh4.

Hi Mohammed,

What do you need to me to do on this?
I see that function in the wmi.c file.

Do you want me to add some debug printk's in there somewhere?

Regards

Nick

> Message Received: Mar 21 2013, 11:42 AM
> From: "Mohammed Shafi"
> To: [email protected]
> Cc: [email protected]
> Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
>
> On Wed, Mar 20, 2013 at 10:33 PM, wrote:
> >
> > Here is another example, taken from Wireshark.
> > It's an ARP response, effectively saying IP address 192.168.0.107 is at 00:03:7f:20:50:59
> >
> > This is a message coming out of the wifi adaptor, and the above numbers are the IP address, and MAC address of the wifi device.
> >
> > 7f 20 50 59 00 24 00 03 7f 20 50 59 08 06 00 01
> > 08 00 06 04 00 02 00 03 7f 20 50 59 c0 a8 00 07
> > 20 cf 30 94 83 7b c0 a8 00 65
> >
> > What we see here is the Destination MAC address is 7f:20:50:59:00:24 (first 6 bytes).
> > But that's wrong. It should be 20:cf:30:94:83:7b .
> >
> > The other parts look right though:
> > 00:03:7f:20:50:59 is the MAC of the wifi device.
> > c0 a8 00 65 is 192.168.0.101 which is the IP address of the destination.
> > c0 a8 00 07 is the IP address of the wifi adaptor itself.
>
> let us check in ath6kl_wmi_dix_2_dot3, that should give us some clue.
>
> >
> > So, where in the code is the first 6 bytes generated ?
> >
> >
> > Regards
> >
> > Nick
>
>
>
> --
> thanks,
> shafi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>


2013-03-21 14:25:44

by nick

[permalink] [raw]
Subject: Re: ath6kl_usb - ping problems when compiled for sh4.

Hi Mohammed,

OK, so I added the same printks further down in that function.
There is a memcpy in there, and I added the same debug just after the memcpy.

And, the eth_hdr->h_dest has been changed to a wrong MAC address - by something.

And, it must be something wrong in skb_push .


Regards

Nick




> Message Received: Mar 21 2013, 02:09 PM
> From: [email protected]
> To: "Mohammed Shafi"
> Cc: [email protected]
> Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
>
>
> Hi Mohammed,
>
> I've added some debug at the top of ath6kl_wmi_dix_2_dot3 function.
>
> Just after:
>
> eth_hdr = (struct ethhdr *) skb->data;
> type = eth_hdr->h_proto;
>
> I added some debug to print all the values of eth_hdr->h_dest and eth_hdr->h_source .
> And, all look correct at that point.
>
> Regards
>
> Nick
>
>
> > Message Received: Mar 21 2013, 01:35 PM
> > From: [email protected]
> > To: "Mohammed Shafi"
> > Cc: [email protected]
> > Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
> >
> > Hi Mohammed,
> >
> > What do you need to me to do on this?
> > I see that function in the wmi.c file.
> >
> > Do you want me to add some debug printk's in there somewhere?
> >
> > Regards
> >
> > Nick
> >
> > > Message Received: Mar 21 2013, 11:42 AM
> > > From: "Mohammed Shafi"
> > > To: [email protected]
> > > Cc: [email protected]
> > > Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
> > >
> > > On Wed, Mar 20, 2013 at 10:33 PM, wrote:
> > > >
> > > > Here is another example, taken from Wireshark.
> > > > It's an ARP response, effectively saying IP address 192.168.0.107 is at 00:03:7f:20:50:59
> > > >
> > > > This is a message coming out of the wifi adaptor, and the above numbers are the IP address, and MAC address of the wifi device.
> > > >
> > > > 7f 20 50 59 00 24 00 03 7f 20 50 59 08 06 00 01
> > > > 08 00 06 04 00 02 00 03 7f 20 50 59 c0 a8 00 07
> > > > 20 cf 30 94 83 7b c0 a8 00 65
> > > >
> > > > What we see here is the Destination MAC address is 7f:20:50:59:00:24 (first 6 bytes).
> > > > But that's wrong. It should be 20:cf:30:94:83:7b .
> > > >
> > > > The other parts look right though:
> > > > 00:03:7f:20:50:59 is the MAC of the wifi device.
> > > > c0 a8 00 65 is 192.168.0.101 which is the IP address of the destination.
> > > > c0 a8 00 07 is the IP address of the wifi adaptor itself.
> > >
> > > let us check in ath6kl_wmi_dix_2_dot3, that should give us some clue.
> > >
> > > >
> > > > So, where in the code is the first 6 bytes generated ?
> > > >
> > > >
> > > > Regards
> > > >
> > > > Nick
> > >
> > >
> > >
> > > --
> > > thanks,
> > > shafi
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> > > the body of a message to [email protected]
> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
> > >
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> > the body of a message to [email protected]
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>


2013-03-21 11:41:12

by Mohammed Shafi

[permalink] [raw]
Subject: Re: ath6kl_usb - ping problems when compiled for sh4.

On Wed, Mar 20, 2013 at 10:33 PM, <[email protected]> wrote:
>
> Here is another example, taken from Wireshark.
> It's an ARP response, effectively saying IP address 192.168.0.107 is at 00:03:7f:20:50:59
>
> This is a message coming out of the wifi adaptor, and the above numbers are the IP address, and MAC address of the wifi device.
>
> 7f 20 50 59 00 24 00 03 7f 20 50 59 08 06 00 01
> 08 00 06 04 00 02 00 03 7f 20 50 59 c0 a8 00 07
> 20 cf 30 94 83 7b c0 a8 00 65
>
> What we see here is the Destination MAC address is 7f:20:50:59:00:24 (first 6 bytes).
> But that's wrong. It should be 20:cf:30:94:83:7b .
>
> The other parts look right though:
> 00:03:7f:20:50:59 is the MAC of the wifi device.
> c0 a8 00 65 is 192.168.0.101 which is the IP address of the destination.
> c0 a8 00 07 is the IP address of the wifi adaptor itself.

let us check in ath6kl_wmi_dix_2_dot3, that should give us some clue.

>
> So, where in the code is the first 6 bytes generated ?
>
>
> Regards
>
> Nick



--
thanks,
shafi

2013-03-21 14:09:48

by nick

[permalink] [raw]
Subject: Re: ath6kl_usb - ping problems when compiled for sh4.


Hi Mohammed,

I've added some debug at the top of ath6kl_wmi_dix_2_dot3 function.

Just after:

eth_hdr = (struct ethhdr *) skb->data;
type = eth_hdr->h_proto;

I added some debug to print all the values of eth_hdr->h_dest and eth_hdr->h_source .
And, all look correct at that point.

Regards

Nick


> Message Received: Mar 21 2013, 01:35 PM
> From: [email protected]
> To: "Mohammed Shafi"
> Cc: [email protected]
> Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
>
> Hi Mohammed,
>
> What do you need to me to do on this?
> I see that function in the wmi.c file.
>
> Do you want me to add some debug printk's in there somewhere?
>
> Regards
>
> Nick
>
> > Message Received: Mar 21 2013, 11:42 AM
> > From: "Mohammed Shafi"
> > To: [email protected]
> > Cc: [email protected]
> > Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
> >
> > On Wed, Mar 20, 2013 at 10:33 PM, wrote:
> > >
> > > Here is another example, taken from Wireshark.
> > > It's an ARP response, effectively saying IP address 192.168.0.107 is at 00:03:7f:20:50:59
> > >
> > > This is a message coming out of the wifi adaptor, and the above numbers are the IP address, and MAC address of the wifi device.
> > >
> > > 7f 20 50 59 00 24 00 03 7f 20 50 59 08 06 00 01
> > > 08 00 06 04 00 02 00 03 7f 20 50 59 c0 a8 00 07
> > > 20 cf 30 94 83 7b c0 a8 00 65
> > >
> > > What we see here is the Destination MAC address is 7f:20:50:59:00:24 (first 6 bytes).
> > > But that's wrong. It should be 20:cf:30:94:83:7b .
> > >
> > > The other parts look right though:
> > > 00:03:7f:20:50:59 is the MAC of the wifi device.
> > > c0 a8 00 65 is 192.168.0.101 which is the IP address of the destination.
> > > c0 a8 00 07 is the IP address of the wifi adaptor itself.
> >
> > let us check in ath6kl_wmi_dix_2_dot3, that should give us some clue.
> >
> > >
> > > So, where in the code is the first 6 bytes generated ?
> > >
> > >
> > > Regards
> > >
> > > Nick
> >
> >
> >
> > --
> > thanks,
> > shafi
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> > the body of a message to [email protected]
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>


2013-03-22 07:15:56

by nick

[permalink] [raw]
Subject: Re: ath6kl_usb - ping problems when compiled for sh4.


Hi Mohammed,

We are using the SH4 in little endian mode.


Regards

Nick

> Message Received: Mar 22 2013, 05:28 AM
> From: "Mohammed Shafi"
> To: [email protected]
> Cc: [email protected]
> Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
>
> On Thu, Mar 21, 2013 at 7:55 PM, wrote:
> > Hi Mohammed,
> >
> > OK, so I added the same printks further down in that function.
> > There is a memcpy in there, and I added the same debug just after the memcpy.
> >
> > And, the eth_hdr->h_dest has been changed to a wrong MAC address - by something.
> >
> > And, it must be something wrong in skb_push .
>
> good Nick, I' ll try to analyze this.
> what platform are you using ? (is it a big/little endian)
>
> >
> >
> > Regards
> >
> > Nick
> >
> >
> >
> >
> >> Message Received: Mar 21 2013, 02:09 PM
> >> From: [email protected]
> >> To: "Mohammed Shafi"
> >> Cc: [email protected]
> >> Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
> >>
> >>
> >> Hi Mohammed,
> >>
> >> I've added some debug at the top of ath6kl_wmi_dix_2_dot3 function.
> >>
> >> Just after:
> >>
> >> eth_hdr = (struct ethhdr *) skb->data;
> >> type = eth_hdr->h_proto;
> >>
> >> I added some debug to print all the values of eth_hdr->h_dest and eth_hdr->h_source .
> >> And, all look correct at that point.
> >>
> >> Regards
> >>
> >> Nick
> >>
> >>
> >> > Message Received: Mar 21 2013, 01:35 PM
> >> > From: [email protected]
> >> > To: "Mohammed Shafi"
> >> > Cc: [email protected]
> >> > Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
> >> >
> >> > Hi Mohammed,
> >> >
> >> > What do you need to me to do on this?
> >> > I see that function in the wmi.c file.
> >> >
> >> > Do you want me to add some debug printk's in there somewhere?
> >> >
> >> > Regards
> >> >
> >> > Nick
> >> >
> >> > > Message Received: Mar 21 2013, 11:42 AM
> >> > > From: "Mohammed Shafi"
> >> > > To: [email protected]
> >> > > Cc: [email protected]
> >> > > Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
> >> > >
> >> > > On Wed, Mar 20, 2013 at 10:33 PM, wrote:
> >> > > >
> >> > > > Here is another example, taken from Wireshark.
> >> > > > It's an ARP response, effectively saying IP address 192.168.0.107 is at 00:03:7f:20:50:59
> >> > > >
> >> > > > This is a message coming out of the wifi adaptor, and the above numbers are the IP address, and MAC address of the wifi device.
> >> > > >
> >> > > > 7f 20 50 59 00 24 00 03 7f 20 50 59 08 06 00 01
> >> > > > 08 00 06 04 00 02 00 03 7f 20 50 59 c0 a8 00 07
> >> > > > 20 cf 30 94 83 7b c0 a8 00 65
> >> > > >
> >> > > > What we see here is the Destination MAC address is 7f:20:50:59:00:24 (first 6 bytes).
> >> > > > But that's wrong. It should be 20:cf:30:94:83:7b .
> >> > > >
> >> > > > The other parts look right though:
> >> > > > 00:03:7f:20:50:59 is the MAC of the wifi device.
> >> > > > c0 a8 00 65 is 192.168.0.101 which is the IP address of the destination.
> >> > > > c0 a8 00 07 is the IP address of the wifi adaptor itself.
> >> > >
> >> > > let us check in ath6kl_wmi_dix_2_dot3, that should give us some clue.
> >> > >
> >> > > >
> >> > > > So, where in the code is the first 6 bytes generated ?
> >> > > >
> >> > > >
> >> > > > Regards
> >> > > >
> >> > > > Nick
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > thanks,
> >> > > shafi
> >> > > --
> >> > > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> >> > > the body of a message to [email protected]
> >> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >> > >
> >> >
> >> > --
> >> > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> >> > the body of a message to [email protected]
> >> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >> >
> >>
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> >> the body of a message to [email protected]
> >> More majordomo info at http://vger.kernel.org/majordomo-info.html
> >>
> >
>
>
>
> --
> thanks,
> shafi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>


2013-03-22 05:28:22

by Mohammed Shafi

[permalink] [raw]
Subject: Re: ath6kl_usb - ping problems when compiled for sh4.

On Thu, Mar 21, 2013 at 7:55 PM, <[email protected]> wrote:
> Hi Mohammed,
>
> OK, so I added the same printks further down in that function.
> There is a memcpy in there, and I added the same debug just after the memcpy.
>
> And, the eth_hdr->h_dest has been changed to a wrong MAC address - by something.
>
> And, it must be something wrong in skb_push .

good Nick, I' ll try to analyze this.
what platform are you using ? (is it a big/little endian)

>
>
> Regards
>
> Nick
>
>
>
>
>> Message Received: Mar 21 2013, 02:09 PM
>> From: [email protected]
>> To: "Mohammed Shafi"
>> Cc: [email protected]
>> Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
>>
>>
>> Hi Mohammed,
>>
>> I've added some debug at the top of ath6kl_wmi_dix_2_dot3 function.
>>
>> Just after:
>>
>> eth_hdr = (struct ethhdr *) skb->data;
>> type = eth_hdr->h_proto;
>>
>> I added some debug to print all the values of eth_hdr->h_dest and eth_hdr->h_source .
>> And, all look correct at that point.
>>
>> Regards
>>
>> Nick
>>
>>
>> > Message Received: Mar 21 2013, 01:35 PM
>> > From: [email protected]
>> > To: "Mohammed Shafi"
>> > Cc: [email protected]
>> > Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
>> >
>> > Hi Mohammed,
>> >
>> > What do you need to me to do on this?
>> > I see that function in the wmi.c file.
>> >
>> > Do you want me to add some debug printk's in there somewhere?
>> >
>> > Regards
>> >
>> > Nick
>> >
>> > > Message Received: Mar 21 2013, 11:42 AM
>> > > From: "Mohammed Shafi"
>> > > To: [email protected]
>> > > Cc: [email protected]
>> > > Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
>> > >
>> > > On Wed, Mar 20, 2013 at 10:33 PM, wrote:
>> > > >
>> > > > Here is another example, taken from Wireshark.
>> > > > It's an ARP response, effectively saying IP address 192.168.0.107 is at 00:03:7f:20:50:59
>> > > >
>> > > > This is a message coming out of the wifi adaptor, and the above numbers are the IP address, and MAC address of the wifi device.
>> > > >
>> > > > 7f 20 50 59 00 24 00 03 7f 20 50 59 08 06 00 01
>> > > > 08 00 06 04 00 02 00 03 7f 20 50 59 c0 a8 00 07
>> > > > 20 cf 30 94 83 7b c0 a8 00 65
>> > > >
>> > > > What we see here is the Destination MAC address is 7f:20:50:59:00:24 (first 6 bytes).
>> > > > But that's wrong. It should be 20:cf:30:94:83:7b .
>> > > >
>> > > > The other parts look right though:
>> > > > 00:03:7f:20:50:59 is the MAC of the wifi device.
>> > > > c0 a8 00 65 is 192.168.0.101 which is the IP address of the destination.
>> > > > c0 a8 00 07 is the IP address of the wifi adaptor itself.
>> > >
>> > > let us check in ath6kl_wmi_dix_2_dot3, that should give us some clue.
>> > >
>> > > >
>> > > > So, where in the code is the first 6 bytes generated ?
>> > > >
>> > > >
>> > > > Regards
>> > > >
>> > > > Nick
>> > >
>> > >
>> > >
>> > > --
>> > > thanks,
>> > > shafi
>> > > --
>> > > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
>> > > the body of a message to [email protected]
>> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
>> > >
>> >
>> > --
>> > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
>> > the body of a message to [email protected]
>> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>> >
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
>> the body of a message to [email protected]
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>



--
thanks,
shafi

2013-03-20 17:03:09

by nick

[permalink] [raw]
Subject: Re: ath6kl_usb - ping problems when compiled for sh4.


Here is another example, taken from Wireshark.
It's an ARP response, effectively saying IP address 192.168.0.107 is at 00:03:7f:20:50:59

This is a message coming out of the wifi adaptor, and the above numbers are the IP address, and MAC address of the wifi device.

7f 20 50 59 00 24 00 03 7f 20 50 59 08 06 00 01
08 00 06 04 00 02 00 03 7f 20 50 59 c0 a8 00 07
20 cf 30 94 83 7b c0 a8 00 65

What we see here is the Destination MAC address is 7f:20:50:59:00:24 (first 6 bytes).
But that's wrong. It should be 20:cf:30:94:83:7b .

The other parts look right though:
00:03:7f:20:50:59 is the MAC of the wifi device.
c0 a8 00 65 is 192.168.0.101 which is the IP address of the destination.
c0 a8 00 07 is the IP address of the wifi adaptor itself.

So, where in the code is the first 6 bytes generated ?


Regards

Nick

2013-03-22 07:10:17

by nick

[permalink] [raw]
Subject: Re: ath6kl_usb - ping problems when compiled for sh4.


Hi Mohammed.

The platform is H251, made by ST MicroElectronics.

The H251 is an intergrated chip, which has an ST7105 inside.
The ST7105 has a ST40-300, which has an SH4 CPU at its core.

The SH4 can be run in big or little endian mode.
I will try to find out what mode we are using.


Regards

Nick




> Message Received: Mar 22 2013, 05:28 AM
> From: "Mohammed Shafi"
> To: [email protected]
> Cc: [email protected]
> Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
>
> On Thu, Mar 21, 2013 at 7:55 PM, wrote:
> > Hi Mohammed,
> >
> > OK, so I added the same printks further down in that function.
> > There is a memcpy in there, and I added the same debug just after the memcpy.
> >
> > And, the eth_hdr->h_dest has been changed to a wrong MAC address - by something.
> >
> > And, it must be something wrong in skb_push .
>
> good Nick, I' ll try to analyze this.
> what platform are you using ? (is it a big/little endian)
>
> >
> >
> > Regards
> >
> > Nick
> >
> >
> >
> >
> >> Message Received: Mar 21 2013, 02:09 PM
> >> From: [email protected]
> >> To: "Mohammed Shafi"
> >> Cc: [email protected]
> >> Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
> >>
> >>
> >> Hi Mohammed,
> >>
> >> I've added some debug at the top of ath6kl_wmi_dix_2_dot3 function.
> >>
> >> Just after:
> >>
> >> eth_hdr = (struct ethhdr *) skb->data;
> >> type = eth_hdr->h_proto;
> >>
> >> I added some debug to print all the values of eth_hdr->h_dest and eth_hdr->h_source .
> >> And, all look correct at that point.
> >>
> >> Regards
> >>
> >> Nick
> >>
> >>
> >> > Message Received: Mar 21 2013, 01:35 PM
> >> > From: [email protected]
> >> > To: "Mohammed Shafi"
> >> > Cc: [email protected]
> >> > Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
> >> >
> >> > Hi Mohammed,
> >> >
> >> > What do you need to me to do on this?
> >> > I see that function in the wmi.c file.
> >> >
> >> > Do you want me to add some debug printk's in there somewhere?
> >> >
> >> > Regards
> >> >
> >> > Nick
> >> >
> >> > > Message Received: Mar 21 2013, 11:42 AM
> >> > > From: "Mohammed Shafi"
> >> > > To: [email protected]
> >> > > Cc: [email protected]
> >> > > Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
> >> > >
> >> > > On Wed, Mar 20, 2013 at 10:33 PM, wrote:
> >> > > >
> >> > > > Here is another example, taken from Wireshark.
> >> > > > It's an ARP response, effectively saying IP address 192.168.0.107 is at 00:03:7f:20:50:59
> >> > > >
> >> > > > This is a message coming out of the wifi adaptor, and the above numbers are the IP address, and MAC address of the wifi device.
> >> > > >
> >> > > > 7f 20 50 59 00 24 00 03 7f 20 50 59 08 06 00 01
> >> > > > 08 00 06 04 00 02 00 03 7f 20 50 59 c0 a8 00 07
> >> > > > 20 cf 30 94 83 7b c0 a8 00 65
> >> > > >
> >> > > > What we see here is the Destination MAC address is 7f:20:50:59:00:24 (first 6 bytes).
> >> > > > But that's wrong. It should be 20:cf:30:94:83:7b .
> >> > > >
> >> > > > The other parts look right though:
> >> > > > 00:03:7f:20:50:59 is the MAC of the wifi device.
> >> > > > c0 a8 00 65 is 192.168.0.101 which is the IP address of the destination.
> >> > > > c0 a8 00 07 is the IP address of the wifi adaptor itself.
> >> > >
> >> > > let us check in ath6kl_wmi_dix_2_dot3, that should give us some clue.
> >> > >
> >> > > >
> >> > > > So, where in the code is the first 6 bytes generated ?
> >> > > >
> >> > > >
> >> > > > Regards
> >> > > >
> >> > > > Nick
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > thanks,
> >> > > shafi
> >> > > --
> >> > > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> >> > > the body of a message to [email protected]
> >> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >> > >
> >> >
> >> > --
> >> > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> >> > the body of a message to [email protected]
> >> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >> >
> >>
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> >> the body of a message to [email protected]
> >> More majordomo info at http://vger.kernel.org/majordomo-info.html
> >>
> >
>
>
>
> --
> thanks,
> shafi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>


2013-03-20 15:34:26

by Mohammed Shafi

[permalink] [raw]
Subject: Re: ath6kl_usb - ping problems when compiled for sh4.

+ ath6kl-devel

On Wed, Mar 20, 2013 at 8:52 PM, <[email protected]> wrote:
> Hi
> I tried a wek or so ago to get some help with my ping problems.
>
> Essentially, the problem I see is that my AR6004 based USB wifi adaptor can associate with an AP OK, and gets an IP address via DHCP just fine.
> But, pings don't work.
>
> I can't ping to the device from another PC on the same subnet, and I can't ping out.
>
> And, I think my problem has something to do with MAC addresses.
>
> According to wireshark, pings are received by the USB wifi device OK, but the echo reply is going back out to the wrong MAC address - so it's never received by the ping originator.
>
> Attached is some debug from the driver - which hopefully someone will understand.
>
> Someone suggested that my problem might be endianness related - but I can see that myself - because Association with the AP, and DHCP wouldn't work if that was the case.
> The problem looks to me more like a problem with structure alignment - where the MAC address table is shifted over.
>
>
> You will see in the attached file that the ping originator MAC address is 20:CF:30:94:83:7B
> And, the MAC address of the wifi adaptor itself is 00:03:7F:20:50:59
>
> According to wireshark the MAC address which the echo reply is going back to is neither of these.
>
> Any ideas what's wrong?

care to check with the latest driver and firmware
https://github.com/cernekee/linux-firmware/tree/master/ath6k/AR6004
http://linuxwireless.org/download/compat-wireless-2.6/

AR6004 is pretty decent working.

>
>
> Regards
>
> Nick



--
thanks,
shafi

2013-04-19 16:02:43

by nick

[permalink] [raw]
Subject: Re: ath6kl_usb - ping problems when compiled for sh4.


I see a problem with the ath6kl driver in wmi.c.
In the ath6kl_wmi_dix_2_dot3 function there is a memcpy being used with overlapping memory pointers.

I see that skb_push is used to add 8 bytes of llc_snap header space.
Then, a memcpy is used to copy the original 14bytes of Destination MAC + Source MAC + Type fields.

But, that 14 byte block is longer than the 8 byte new area.

Effectively, what is happening is that a new block of 8 bytes is added to the head.
Then the exising eth_hdr data is moved up by 8 bytes to take up the new space, but there is ovelap of memory pointers.
And, memcpy doesn't behave properly like that.

It's causing MAC address corruption.

Anyone else agree with this?


Regards

Nick

> Message Received: Mar 22 2013, 05:28 AM
> From: "Mohammed Shafi"
> To: [email protected]
> Cc: [email protected]
> Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
>
> On Thu, Mar 21, 2013 at 7:55 PM, wrote:
> > Hi Mohammed,
> >
> > OK, so I added the same printks further down in that function.
> > There is a memcpy in there, and I added the same debug just after the memcpy.
> >
> > And, the eth_hdr->h_dest has been changed to a wrong MAC address - by something.
> >
> > And, it must be something wrong in skb_push .
>
> good Nick, I' ll try to analyze this.
> what platform are you using ? (is it a big/little endian)
>
> >
> >
> > Regards
> >
> > Nick
> >
> >
> >
> >
> >> Message Received: Mar 21 2013, 02:09 PM
> >> From: [email protected]
> >> To: "Mohammed Shafi"
> >> Cc: [email protected]
> >> Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
> >>
> >>
> >> Hi Mohammed,
> >>
> >> I've added some debug at the top of ath6kl_wmi_dix_2_dot3 function.
> >>
> >> Just after:
> >>
> >> eth_hdr = (struct ethhdr *) skb->data;
> >> type = eth_hdr->h_proto;
> >>
> >> I added some debug to print all the values of eth_hdr->h_dest and eth_hdr->h_source .
> >> And, all look correct at that point.
> >>
> >> Regards
> >>
> >> Nick
> >>
> >>
> >> > Message Received: Mar 21 2013, 01:35 PM
> >> > From: [email protected]
> >> > To: "Mohammed Shafi"
> >> > Cc: [email protected]
> >> > Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
> >> >
> >> > Hi Mohammed,
> >> >
> >> > What do you need to me to do on this?
> >> > I see that function in the wmi.c file.
> >> >
> >> > Do you want me to add some debug printk's in there somewhere?
> >> >
> >> > Regards
> >> >
> >> > Nick
> >> >
> >> > > Message Received: Mar 21 2013, 11:42 AM
> >> > > From: "Mohammed Shafi"
> >> > > To: [email protected]
> >> > > Cc: [email protected]
> >> > > Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
> >> > >
> >> > > On Wed, Mar 20, 2013 at 10:33 PM, wrote:
> >> > > >
> >> > > > Here is another example, taken from Wireshark.
> >> > > > It's an ARP response, effectively saying IP address 192.168.0.107 is at 00:03:7f:20:50:59
> >> > > >
> >> > > > This is a message coming out of the wifi adaptor, and the above numbers are the IP address, and MAC address of the wifi device.
> >> > > >
> >> > > > 7f 20 50 59 00 24 00 03 7f 20 50 59 08 06 00 01
> >> > > > 08 00 06 04 00 02 00 03 7f 20 50 59 c0 a8 00 07
> >> > > > 20 cf 30 94 83 7b c0 a8 00 65
> >> > > >
> >> > > > What we see here is the Destination MAC address is 7f:20:50:59:00:24 (first 6 bytes).
> >> > > > But that's wrong. It should be 20:cf:30:94:83:7b .
> >> > > >
> >> > > > The other parts look right though:
> >> > > > 00:03:7f:20:50:59 is the MAC of the wifi device.
> >> > > > c0 a8 00 65 is 192.168.0.101 which is the IP address of the destination.
> >> > > > c0 a8 00 07 is the IP address of the wifi adaptor itself.
> >> > >
> >> > > let us check in ath6kl_wmi_dix_2_dot3, that should give us some clue.
> >> > >
> >> > > >
> >> > > > So, where in the code is the first 6 bytes generated ?
> >> > > >
> >> > > >
> >> > > > Regards
> >> > > >
> >> > > > Nick
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > thanks,
> >> > > shafi
> >> > > --
> >> > > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> >> > > the body of a message to [email protected]
> >> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >> > >
> >> >
> >> > --
> >> > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> >> > the body of a message to [email protected]
> >> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >> >
> >>
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> >> the body of a message to [email protected]
> >> More majordomo info at http://vger.kernel.org/majordomo-info.html
> >>
> >
>
>
>
> --
> thanks,
> shafi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>


2013-04-15 10:20:10

by nick

[permalink] [raw]
Subject: Re: ath6kl_usb - ping problems when compiled for sh4.


Hi Mohammed, did you get chance to look at the corrupted MAC address problem?

Regards

Nick Thomas


> Message Received: Mar 22 2013, 05:28 AM
> From: "Mohammed Shafi"
> To: [email protected]
> Cc: [email protected]
> Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
>
> On Thu, Mar 21, 2013 at 7:55 PM, wrote:
> > Hi Mohammed,
> >
> > OK, so I added the same printks further down in that function.
> > There is a memcpy in there, and I added the same debug just after the memcpy.
> >
> > And, the eth_hdr->h_dest has been changed to a wrong MAC address - by something.
> >
> > And, it must be something wrong in skb_push .
>
> good Nick, I' ll try to analyze this.
> what platform are you using ? (is it a big/little endian)
>
> >
> >
> > Regards
> >
> > Nick
> >
> >
> >
> >
> >> Message Received: Mar 21 2013, 02:09 PM
> >> From: [email protected]
> >> To: "Mohammed Shafi"
> >> Cc: [email protected]
> >> Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
> >>
> >>
> >> Hi Mohammed,
> >>
> >> I've added some debug at the top of ath6kl_wmi_dix_2_dot3 function.
> >>
> >> Just after:
> >>
> >> eth_hdr = (struct ethhdr *) skb->data;
> >> type = eth_hdr->h_proto;
> >>
> >> I added some debug to print all the values of eth_hdr->h_dest and eth_hdr->h_source .
> >> And, all look correct at that point.
> >>
> >> Regards
> >>
> >> Nick
> >>
> >>
> >> > Message Received: Mar 21 2013, 01:35 PM
> >> > From: [email protected]
> >> > To: "Mohammed Shafi"
> >> > Cc: [email protected]
> >> > Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
> >> >
> >> > Hi Mohammed,
> >> >
> >> > What do you need to me to do on this?
> >> > I see that function in the wmi.c file.
> >> >
> >> > Do you want me to add some debug printk's in there somewhere?
> >> >
> >> > Regards
> >> >
> >> > Nick
> >> >
> >> > > Message Received: Mar 21 2013, 11:42 AM
> >> > > From: "Mohammed Shafi"
> >> > > To: [email protected]
> >> > > Cc: [email protected]
> >> > > Subject: Re: ath6kl_usb - ping problems when compiled for sh4.
> >> > >
> >> > > On Wed, Mar 20, 2013 at 10:33 PM, wrote:
> >> > > >
> >> > > > Here is another example, taken from Wireshark.
> >> > > > It's an ARP response, effectively saying IP address 192.168.0.107 is at 00:03:7f:20:50:59
> >> > > >
> >> > > > This is a message coming out of the wifi adaptor, and the above numbers are the IP address, and MAC address of the wifi device.
> >> > > >
> >> > > > 7f 20 50 59 00 24 00 03 7f 20 50 59 08 06 00 01
> >> > > > 08 00 06 04 00 02 00 03 7f 20 50 59 c0 a8 00 07
> >> > > > 20 cf 30 94 83 7b c0 a8 00 65
> >> > > >
> >> > > > What we see here is the Destination MAC address is 7f:20:50:59:00:24 (first 6 bytes).
> >> > > > But that's wrong. It should be 20:cf:30:94:83:7b .
> >> > > >
> >> > > > The other parts look right though:
> >> > > > 00:03:7f:20:50:59 is the MAC of the wifi device.
> >> > > > c0 a8 00 65 is 192.168.0.101 which is the IP address of the destination.
> >> > > > c0 a8 00 07 is the IP address of the wifi adaptor itself.
> >> > >
> >> > > let us check in ath6kl_wmi_dix_2_dot3, that should give us some clue.
> >> > >
> >> > > >
> >> > > > So, where in the code is the first 6 bytes generated ?
> >> > > >
> >> > > >
> >> > > > Regards
> >> > > >
> >> > > > Nick
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > thanks,
> >> > > shafi
> >> > > --
> >> > > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> >> > > the body of a message to [email protected]
> >> > > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >> > >
> >> >
> >> > --
> >> > To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> >> > the body of a message to [email protected]
> >> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >> >
> >>
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> >> the body of a message to [email protected]
> >> More majordomo info at http://vger.kernel.org/majordomo-info.html
> >>
> >
>
>
>
> --
> thanks,
> shafi
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>