athn0: bad ROM checksum 0x2c64

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

athn0: bad ROM checksum 0x2c64

Sebastian Reitenbach
Hi,

got a cheap TP-Link TL-WN821N, which shows up as Atheros AR7015 under Windows 10.

athn0 at uhub3 port 3 configuration 1 interface 0 "ATHEROS USB WLAN" rev 2.00/2.02 addr 5
athn0: failed loadfirmware of file athn-open-ar7010 (error 2)
athn0: could not load firmware
athn0 at uhub3 port 3 configuration 1 interface 0 "ATHEROS USB WLAN" rev 2.00/2.02 addr 5
athn0: bad ROM checksum 0x2c64
athn0: could not read ROM
athn0: could not attach chip

usbdevs -v:
addr 05: 0cf3:7015 ATHEROS, USB WLAN
         high speed, power 500 mA, config 1, rev 2.02, iSerial 12345
         driver: athn0

Just wanted to make sure I don't miss anything, don't see that chpset somehow
listed in athn(4) page, so guess this is just not supported yet?

cheers,
Sebastian

Reply | Threaded
Open this post in threaded view
|

Re: athn0: bad ROM checksum 0x2c64

Sebastian Reitenbach


Sent from my iPhone

> On 9. Feb 2019, at 18:56, Sebastian Reitenbach <[hidden email]> wrote:
>
> Hi,
>
> got a cheap TP-Link TL-WN821N, which shows up as Atheros AR7015 under Windows 10.
>
> athn0 at uhub3 port 3 configuration 1 interface 0 "ATHEROS USB WLAN" rev 2.00/2.02 addr 5
> athn0: failed loadfirmware of file athn-open-ar7010 (error 2)
> athn0: could not load firmware

Damn, forgot to mention that between above and below dmesg output I ran fw_update to fetch Athen firmware, then below on second insertion of the device i get the bad ROM checksum. That is on i386, amd64 and mips64el.

> athn0 at uhub3 port 3 configuration 1 interface 0 "ATHEROS USB WLAN" rev 2.00/2.02 addr 5
> athn0: bad ROM checksum 0x2c64
> athn0: could not read ROM
> athn0: could not attach chip
>
> usbdevs -v:
> addr 05: 0cf3:7015 ATHEROS, USB WLAN
>         high speed, power 500 mA, config 1, rev 2.02, iSerial 12345
>         driver: athn0
>
> Just wanted to make sure I don't miss anything, don't see that chpset somehow
> listed in athn(4) page, so guess this is just not supported yet?
>
> cheers,
> Sebastian
>

Reply | Threaded
Open this post in threaded view
|

Re: athn0: bad ROM checksum 0x2c64

Stefan Sperling-5
In reply to this post by Sebastian Reitenbach
On Sat, Feb 09, 2019 at 06:56:45PM +0100, Sebastian Reitenbach wrote:

> Hi,
>
> got a cheap TP-Link TL-WN821N, which shows up as Atheros AR7015 under Windows 10.
>
> athn0 at uhub3 port 3 configuration 1 interface 0 "ATHEROS USB WLAN" rev 2.00/2.02 addr 5
> athn0: failed loadfirmware of file athn-open-ar7010 (error 2)
> athn0: could not load firmware
> athn0 at uhub3 port 3 configuration 1 interface 0 "ATHEROS USB WLAN" rev 2.00/2.02 addr 5
> athn0: bad ROM checksum 0x2c64
> athn0: could not read ROM
> athn0: could not attach chip

>
> usbdevs -v:
> addr 05: 0cf3:7015 ATHEROS, USB WLAN
>          high speed, power 500 mA, config 1, rev 2.02, iSerial 12345
>          driver: athn0
>
> Just wanted to make sure I don't miss anything, don't see that chpset somehow
> listed in athn(4) page, so guess this is just not supported yet?

Please try this device on a another USB port and/or another machine.
There's a long-standing bug where these devices don't work on some
USB host controllers with our drivers, in particular ehci(4).

Last I tried plugging an athn(4) behind a hub, it would not work at all.

Reply | Threaded
Open this post in threaded view
|

Re: athn0: bad ROM checksum 0x2c64

Sebastian Reitenbach
Hi Stefan,

Am Sonntag, Februar 10, 2019 11:06 CET, Stefan Sperling <[hidden email]> schrieb:

> On Sat, Feb 09, 2019 at 06:56:45PM +0100, Sebastian Reitenbach wrote:
> > Hi,
> >
> > got a cheap TP-Link TL-WN821N, which shows up as Atheros AR7015 under Windows 10.
> >
> > athn0 at uhub3 port 3 configuration 1 interface 0 "ATHEROS USB WLAN" rev 2.00/2.02 addr 5
> > athn0: failed loadfirmware of file athn-open-ar7010 (error 2)
> > athn0: could not load firmware
> > athn0 at uhub3 port 3 configuration 1 interface 0 "ATHEROS USB WLAN" rev 2.00/2.02 addr 5
> > athn0: bad ROM checksum 0x2c64
> > athn0: could not read ROM
> > athn0: could not attach chip
>
> >
> > usbdevs -v:
> > addr 05: 0cf3:7015 ATHEROS, USB WLAN
> >          high speed, power 500 mA, config 1, rev 2.02, iSerial 12345
> >          driver: athn0
> >
> > Just wanted to make sure I don't miss anything, don't see that chpset somehow
> > listed in athn(4) page, so guess this is just not supported yet?
>
> Please try this device on a another USB port and/or another machine.
> There's a long-standing bug where these devices don't work on some
> USB host controllers with our drivers, in particular ehci(4).
>
> Last I tried plugging an athn(4) behind a hub, it would not work at all.
>

 I tried that device on my amd64 desktop, as well as on a i386, and mips64el notebook.
It's the same bad ROM checksum error I get on all three of them.

I've another athn stick which works well on all three:
athn0 at uhub3 port 3 configuration 1 interface 0 "ATHEROS USB2.0 WLAN" rev 2.00/1.08 addr 5
athn0: AR9271 rev 1 (1T1R), ROM rev 13, address e8:de:27:15:9e:5e

The non-working one shows up as AR7015 in Windows, but I don't see a AR7015 chipset
mentioned in athn(4), therefore I wanted to verify, if that particular chipset is actually
supported by our athn(4) at all?

cheers,
Sebastian

Reply | Threaded
Open this post in threaded view
|

Re: athn0: bad ROM checksum 0x2c64

Stefan Sperling-5
On Sun, Feb 10, 2019 at 11:50:35AM +0100, Sebastian Reitenbach wrote:
> The non-working one shows up as AR7015 in Windows, but I don't see a AR7015 chipset
> mentioned in athn(4), therefore I wanted to verify, if that particular chipset is actually
> supported by our athn(4) at all?

Indeed, it looks like our athn(4) driver does not support this device
properly. My guess is that the driver should be using ar9287_attach()
instead of ar9285_attach() for this device.

What happens when you try this diff with the non-working device?
(This diff will break devices which are already working, that is expected.)

Index: athn.c
===================================================================
RCS file: /cvs/src/sys/dev/ic/athn.c,v
retrieving revision 1.99
diff -u -p -r1.99 athn.c
--- athn.c 26 Apr 2018 12:50:07 -0000 1.99
+++ athn.c 10 Feb 2019 13:15:28 -0000
@@ -196,7 +196,7 @@ athn_attach(struct athn_softc *sc)
  error = ar9285_attach(sc);
 #if NATHN_USB > 0
  else if (AR_SREV_9271(sc))
- error = ar9285_attach(sc);
+ error = ar9287_attach(sc);
 #endif
  else if (AR_SREV_9287(sc))
  error = ar9287_attach(sc);




Reply | Threaded
Open this post in threaded view
|

Re: athn0: bad ROM checksum 0x2c64

Sebastian Reitenbach
Am Sonntag, Februar 10, 2019 14:19 CET, Stefan Sperling <[hidden email]> schrieb:

> On Sun, Feb 10, 2019 at 11:50:35AM +0100, Sebastian Reitenbach wrote:
> > The non-working one shows up as AR7015 in Windows, but I don't see a AR7015 chipset
> > mentioned in athn(4), therefore I wanted to verify, if that particular chipset is actually
> > supported by our athn(4) at all?
>
> Indeed, it looks like our athn(4) driver does not support this device
> properly. My guess is that the driver should be using ar9287_attach()
> instead of ar9285_attach() for this device.
>
> What happens when you try this diff with the non-working device?
> (This diff will break devices which are already working, that is expected.)

I get the same bad ROM checksum message with the broken device,
and indeed, the device that worked before, now gives the same bad ROM checksum
message when I insert it. It only give a different checksum:
previously working device: 0x2243
non-working device: 0x2c64

cheers,
Sebastian

>
> Index: athn.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/ic/athn.c,v
> retrieving revision 1.99
> diff -u -p -r1.99 athn.c
> --- athn.c 26 Apr 2018 12:50:07 -0000 1.99
> +++ athn.c 10 Feb 2019 13:15:28 -0000
> @@ -196,7 +196,7 @@ athn_attach(struct athn_softc *sc)
>   error = ar9285_attach(sc);
>  #if NATHN_USB > 0
>   else if (AR_SREV_9271(sc))
> - error = ar9285_attach(sc);
> + error = ar9287_attach(sc);
>  #endif
>   else if (AR_SREV_9287(sc))
>   error = ar9287_attach(sc);
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: athn0: bad ROM checksum 0x2c64

Stefan Sperling-5
On Sun, Feb 10, 2019 at 07:12:38PM +0100, Sebastian Reitenbach wrote:
> I get the same bad ROM checksum message with the broken device,
> and indeed, the device that worked before, now gives the same bad ROM checksum
> message when I insert it. It only give a different checksum:
> previously working device: 0x2243
> non-working device: 0x2c64
>
> cheers,
> Sebastian

This should fix attach but there's some other remaining problem.
The device detaches itself again when I try to use it.

diff 709e530bc956c51de2da4aff727d8da450babdc4 /usr/src
blob - 74025dba1aff37e328c92779398e428caef72c04
file + sys/dev/ic/ar9287.c
--- sys/dev/ic/ar9287.c
+++ sys/dev/ic/ar9287.c
@@ -100,7 +100,8 @@ void ar9280_spur_mitigate(struct athn_softc *, struct
 int
 ar9287_attach(struct athn_softc *sc)
 {
- sc->eep_base = AR9287_EEP_START_LOC;
+ sc->eep_base = (sc->flags & ATHN_FLAG_USB) ?
+    AR9287_HTC_EEP_START_LOC : AR9287_EEP_START_LOC;
  sc->eep_size = sizeof(struct ar9287_eeprom);
  sc->ngpiopins = (sc->flags & ATHN_FLAG_USB) ? 16 : 11;
  sc->led_pin = 8;
blob - 340b28c2f84de4d40f15c42f13b1727a6f497bb0
file + sys/dev/ic/ar9287reg.h
--- sys/dev/ic/ar9287reg.h
+++ sys/dev/ic/ar9287reg.h
@@ -60,6 +60,7 @@
  * ROM layout used by AR9287 (2GHz only).
  */
 #define AR9287_EEP_START_LOC 128
+#define AR9287_HTC_EEP_START_LOC 256
 #define AR9287_NUM_2G_CAL_PIERS 3
 #define AR9287_NUM_2G_CCK_TARGET_POWERS 3
 #define AR9287_NUM_2G_20_TARGET_POWERS 3

Reply | Threaded
Open this post in threaded view
|

Re: athn0: bad ROM checksum 0x2c64

BABUT
> This should fix attach but there's some other remaining problem.
> The device detaches itself again when I try to use it.

> diff 709e530bc956c51de2da4aff727d8da450babdc4 /usr/src
> blob - 74025dba1aff37e328c92779398e428caef72c04
> file + sys/dev/ic/ar9287.c
> --- sys/dev/ic/ar9287.c
> +++ sys/dev/ic/ar9287.c
> @@ -100,7 +100,8 @@ void        ar9280_spur_mitigate(struct athn_softc *, struct
>  int
>  ar9287_attach(struct athn_softc *sc)
>  {
-       sc->>eep_base = AR9287_EEP_START_LOC;
+       sc->>eep_base = (sc->flags & ATHN_FLAG_USB) ?

> +           AR9287_HTC_EEP_START_LOC : AR9287_EEP_START_LOC;
>         sc->eep_size = sizeof(struct ar9287_eeprom);
>         sc->ngpiopins = (sc->flags & ATHN_FLAG_USB) ? 16 : 11;
>         sc->led_pin = 8;
> blob - 340b28c2f84de4d40f15c42f13b1727a6f497bb0
> file + sys/dev/ic/ar9287reg.h
> --- sys/dev/ic/ar9287reg.h
> +++ sys/dev/ic/ar9287reg.h
> @@ -60,6 +60,7 @@
>   * ROM layout used by AR9287 (2GHz only).
>   */
>  #define AR9287_EEP_START_LOC           128
> +#define AR9287_HTC_EEP_START_LOC       256
>  #define AR9287_NUM_2G_CAL_PIERS                3
>  #define AR9287_NUM_2G_CCK_TARGET_POWERS        3
>  #define AR9287_NUM_2G_20_TARGET_POWERS       3

thx! your hack does work with "rev 2.00/2.02" on 6.4. tested with
firmware from 6.3, 6.4, 6.5, current. binary 1.1p4 differ from other
1.1p4 %\ tested only AP mode

Reply | Threaded
Open this post in threaded view
|

Re: athn0: bad ROM checksum 0x2c64

BABUT
In reply to this post by Stefan Sperling-5
> This should fix attach but there's some other remaining problem.
> The device detaches itself again when I try to use it.

> diff 709e530bc956c51de2da4aff727d8da450babdc4 /usr/src
> blob - 74025dba1aff37e328c92779398e428caef72c04
> file + sys/dev/ic/ar9287.c
> --- sys/dev/ic/ar9287.c
> +++ sys/dev/ic/ar9287.c
> @@ -100,7 +100,8 @@ void        ar9280_spur_mitigate(struct athn_softc *, struct
>  int
>  ar9287_attach(struct athn_softc *sc)
>  {
-       sc->>eep_base = AR9287_EEP_START_LOC;
+       sc->>eep_base = (sc->flags & ATHN_FLAG_USB) ?

> +           AR9287_HTC_EEP_START_LOC : AR9287_EEP_START_LOC;
>         sc->eep_size = sizeof(struct ar9287_eeprom);
>         sc->ngpiopins = (sc->flags & ATHN_FLAG_USB) ? 16 : 11;
>         sc->led_pin = 8;
> blob - 340b28c2f84de4d40f15c42f13b1727a6f497bb0
> file + sys/dev/ic/ar9287reg.h
> --- sys/dev/ic/ar9287reg.h
> +++ sys/dev/ic/ar9287reg.h
> @@ -60,6 +60,7 @@
>   * ROM layout used by AR9287 (2GHz only).
>   */
>  #define AR9287_EEP_START_LOC           128
> +#define AR9287_HTC_EEP_START_LOC       256
>  #define AR9287_NUM_2G_CAL_PIERS                3
>  #define AR9287_NUM_2G_CCK_TARGET_POWERS        3
>  #define AR9287_NUM_2G_20_TARGET_POWERS       3

shit. i have upgraded to 6.5 and now the interface is losing settings
after about 30 seconds:
athn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        lladdr b0:48:7a:8c:41:79
        index 17 priority 4 llprio 3
        groups: wlan
        media: IEEE802.11 autoselect (DS1)
        status: no network
        ieee80211: nwid ""

but within 30 seconds it works(though losing a lot of packets).
maybe some more rescue patches? ;)

ps:
athn0 at uhub0 port 5 configuration 1 interface 0 "ATHEROS USB WLAN" rev 2.00/2.02 addr 3
athn0: AR9287 rev 2 (2T2R), ROM rev 4, address b0:48:7a:8c:41:79

Reply | Threaded
Open this post in threaded view
|

Re: athn0: bad ROM checksum 0x2c64

Stefan Sperling-5
On Sun, May 19, 2019 at 12:33:33PM +0300, 3 wrote:

> shit. i have upgraded to 6.5 and now the interface is losing settings
> after about 30 seconds:
> athn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         lladdr b0:48:7a:8c:41:79
>         index 17 priority 4 llprio 3
>         groups: wlan
>         media: IEEE802.11 autoselect (DS1)
>         status: no network
>         ieee80211: nwid ""
>
> but within 30 seconds it works(though losing a lot of packets).
> maybe some more rescue patches? ;)
>
> ps:
> athn0 at uhub0 port 5 configuration 1 interface 0 "ATHEROS USB WLAN" rev 2.00/2.02 addr 3
> athn0: AR9287 rev 2 (2T2R), ROM rev 4, address b0:48:7a:8c:41:79
>

Try -current. kevlo@ has comitted a fix for this device.

Reply | Threaded
Open this post in threaded view
|

Re: athn0: bad ROM checksum 0x2c64

BABUT
> On Sun, May 19, 2019 at 12:33:33PM +0300, 3 wrote:
>> shit. i have upgraded to 6.5 and now the interface is losing settings
>> after about 30 seconds:
>> athn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>>         lladdr b0:48:7a:8c:41:79
>>         index 17 priority 4 llprio 3
>>         groups: wlan
>>         media: IEEE802.11 autoselect (DS1)
>>         status: no network
>>         ieee80211: nwid ""
>>
>> but within 30 seconds it works(though losing a lot of packets).
>> maybe some more rescue patches? ;)
>>
>> ps:
>> athn0 at uhub0 port 5 configuration 1 interface 0 "ATHEROS USB WLAN" rev 2.00/2.02 addr 3
>> athn0: AR9287 rev 2 (2T2R), ROM rev 4, address b0:48:7a:8c:41:79
>>

> Try -current. kevlo@ has comitted a fix for this device.

i built the kernel with its fixes. little has changed. now after
rebooting the device does not up(netstart does not help), only a
physical power outage helps. but after that only sometimes the device
works as it should, more often it turns off after about 30 seconds. in
this case, netstart helps to start the device again, more often for 30
seconds, but sometimes it continues to work as it should. all this is
very sad -_-      

Reply | Threaded
Open this post in threaded view
|

Re: athn0: bad ROM checksum 0x2c64

Stefan Sperling-5
On Sun, May 19, 2019 at 06:49:25PM +0300, 3 wrote:

> > On Sun, May 19, 2019 at 12:33:33PM +0300, 3 wrote:
> >> shit. i have upgraded to 6.5 and now the interface is losing settings
> >> after about 30 seconds:
> >> athn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
> >>         lladdr b0:48:7a:8c:41:79
> >>         index 17 priority 4 llprio 3
> >>         groups: wlan
> >>         media: IEEE802.11 autoselect (DS1)
> >>         status: no network
> >>         ieee80211: nwid ""
> >>
> >> but within 30 seconds it works(though losing a lot of packets).
> >> maybe some more rescue patches? ;)
> >>
> >> ps:
> >> athn0 at uhub0 port 5 configuration 1 interface 0 "ATHEROS USB WLAN" rev 2.00/2.02 addr 3
> >> athn0: AR9287 rev 2 (2T2R), ROM rev 4, address b0:48:7a:8c:41:79
> >>
>
> > Try -current. kevlo@ has comitted a fix for this device.
>
> i built the kernel with its fixes. little has changed. now after
> rebooting the device does not up(netstart does not help), only a
> physical power outage helps. but after that only sometimes the device
> works as it should, more often it turns off after about 30 seconds. in
> this case, netstart helps to start the device again, more often for 30
> seconds, but sometimes it continues to work as it should. all this is
> very sad -_-      

Try it on a different machine and/or USB port.

This driver has known issues on some host controllers but there is
no way to tell what you have plugged the device into because your
report lacks a full dmesg.