From owner-freebsd-arm@FreeBSD.ORG Sun Jul 28 04:29:09 2013 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DDEE29C7; Sun, 28 Jul 2013 04:29:09 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2C7422074; Sun, 28 Jul 2013 04:29:09 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id a12so166239wgh.18 for ; Sat, 27 Jul 2013 21:29:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=3fbgSisgCmiyIlCRHbhkR7+t0j1GMd0Np8AlAtf9Fqc=; b=aGpEhuXwovZB3cjLg9h78FeSVkdC4BptzNrSkiW1Jcii686oyevKsWLmIFCLayLBs/ taXEow2r6PNxjNOfYcJYO6wgOSZIfQWi5tWM++DEgmo+8wrE/ssqDWCplHi4vRLdW+Eb O6f5opY8/LNnlid56TrIILl1ha08Da/UsIT008PQzjCR0MqqJ6xMipPR8EYLJSnL+eIt yhufzTXLlrdIhfatq8OkJzfLeQy5rN1S6CclnRC0ayeX9eiPfcEYZdC9HPYw5MQF5Z0a Or7B3uP02ytM5YoOrlR2fox4orOFEE9ppPH5NS98eYNvT6kCOMOrVbmzQMUewsnl7wyL LUCg== MIME-Version: 1.0 X-Received: by 10.194.203.73 with SMTP id ko9mr284376wjc.79.1374985747503; Sat, 27 Jul 2013 21:29:07 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Sat, 27 Jul 2013 21:29:07 -0700 (PDT) In-Reply-To: References: <1374573600-2351360719.d37ada5f86@bliksem.vehosting.nl> <201307231220.52817.Daan@vitsch.nl> Date: Sat, 27 Jul 2013 21:29:07 -0700 X-Google-Sender-Auth: ovnjjrr0zOPS-TibZ_pKUS2ID6I Message-ID: Subject: Re: My WLI-UC-GNM up crash From: Adrian Chadd To: XiaoQI Ge Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable Cc: freebsd-arm , freebsd-wireless@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jul 2013 04:29:10 -0000 Not sure, I haven't dug into it. It shouldn't be hard to fix though. I think someone just screwed up in defining the structures in the USB drivers and didn't specify alignment. ath(4) got it right because Sam ran it on MIPS/ARM boards. -adrian On 27 July 2013 20:34, XiaoQI Ge wrote: > That should be how to solve it? > -- > Regards. > By: XiaoQI Ge; PGP:8B09D5F7 > WWW: https://www.7axu.com/ > > > > 2013/7/27 Adrian Chadd : >> This is known; there's some alignment issue with the radiotap TX/RX >> structures in some of these USB devices. >> >> >> >> -adrain >> >> On 25 July 2013 20:23, XiaoQI Ge wrote: >>> =CE=D2=B8=FC=D0=C2=B5=BD=D7=EE=D0=C2=B5=C4=D4=B4=C2=EB=A3=A8r253662=A3= =A9=A3=AC=D5=E2=B4=CE=B4=ED=CE=F3=D0=C5=CF=A2=B1=E4=B3=C9=C1=CB0xde9f4d34 >>> >>> [root@FreeBSD.ttyu0] ~ # Fatal kernel mode data abort: 'Alignment Fault= 1' >>> trapframe: 0xde9f4d34 >>> FSR=3D00000801, FAR=3Dc284afbb, spsr=3D00000013 >>> r0 =3Dc284c000, r1 =3Dc284afbb, r2 =3Dc284c210, r3 =3D0000096c >>> r4 =3Dc284c024, r5 =3Dc05f07c5, r6 =3D00000014, r7 =3Dc2844800 >>> r8 =3Dc05f07c5, r9 =3Dc284c000, r10=3D000035cb, r11=3Dde9f4e10 >>> r12=3D0000002e, ssp=3Dde9f4d80, slr=3D00000000, pc =3Dc046d20c >>> >>> [ thread pid 0 tid 100053 ] >>> Stopped at ieee80211_radiotap_chan_change+0x90: strh r3, [r1= ] >>> db> >>> --- >>> Kernel wlan related options >>> device wlan # 802.11 support >>> options IEEE80211_DEBUG # enable debug msgs >>> options IEEE80211_AMPDU_AGE # age frames in AMPDU reorder q's >>> options IEEE80211_SUPPORT_MESH # enable 802.11s draft support >>> device wlan_wep # 802.11 WEP support >>> device wlan_ccmp # 802.11 CCMP support >>> device wlan_tkip # 802.11 TKIP support >>> device wlan_amrr # AMRR transmit rate control algorithm >>> device firmware # firmware assist module >>> device run #Ralink Technology USB IEEE 802.11a/g/n >>> wireless network device >>> device runfw #Firmware Module for Ralink driver >>> >>> --- >>> The compiler command >>> make TARGET_ARCH=3Darmv6 TARGET_CPUTYPE=3Darmv6 KERNCONF=3DBBB WITH_FDT= =3Dyes >>> buildkernel >>> -- >>> Regards. >>> By: XiaoQI Ge; PGP:8B09D5F7 >>> WWW: https://www.7axu.com/ >>> >>> >>> >>> 2013/7/24 XiaoQI Ge : >>>> How do I debug it? Can provide useful information >>>> >>>> login: root >>>> Jul 24 18:27:31 FreeBSD login: ROOT LOGIN (root) ON ttyu0 >>>> FreeBSD 10.0-CURRENT (BBB) #4 r253585M: Wed Jul 24 17:07:53 CST 2013 >>>> [root@FreeBSD.ttyu0] ~ # ifconfig wlan create wlandev run0 >>>> wlan0: Ethernet address: 10:6f:3f:2b:fd:6d >>>> wlan0 >>>> [root@FreeBSD.ttyu0] ~ # ifconfig wlan0 up >>>> run0: firmware RT2870 ver. 0.236 loaded >>>> Fatal kernel mode data abort: 'Alignment Fault 1' >>>> trapframe: 0xde9e4d5c >>>> FSR=3D00000801, FAR=3Dc282ffbb, spsr=3D00000013 >>>> r0 =3Dc2831000, r1 =3Dc282ffbb, r2 =3Dc2831210, r3 =3D0000096c >>>> r4 =3Dc2831024, r5 =3Dc2831000, r6 =3Dc05d9362, r7 =3Dc2829800 >>>> r8 =3D00000014, r9 =3Dc08144d8, r10=3D80001cce, r11=3Dde9e4e10 >>>> r12=3D0000002e, ssp=3Dde9e4da8, slr=3D00000000, pc =3Dc045c510 >>>> >>>> [ thread pid 0 tid 100053 ] >>>> Stopped at ieee80211_radiotap_chan_change+0x90: strh r3, [r= 1] >>>> db> >>>> >>>> >>>> These two places modified: >>>> 2522 } >>>> 2523 >>>> 2524 ant =3D run_maxrssi_chain(sc, rxwi); >>>> 2525 rssi =3D rxwi->rssi[ant]; >>>> 2526 nf =3D run_rssi2dbm(sc, rssi, ant); >>>> 2527 >>>> 2528 m->m_pkthdr.rcvif =3D ifp; >>>> 2529 m->m_pkthdr.len =3D m->m_len =3D len; >>>> 2530 /* >>>> 2531 if (ni !=3D NULL) { >>>> 2532 (void)ieee80211_input(ni, m, rssi, nf); >>>> 2533 ieee80211_free_node(ni); >>>> 2534 } else { >>>> 2535 (void)ieee80211_input_all(ic, m, rssi, nf); >>>> 2536 } >>>> 2537 */ >>>> 2538 /* >>>> 2539 * DAAN: fill-in tap header BEFORE calling ieee80211_input*()= so the >>>> 2540 * user will see the actual data that belongs to THIS packet.= . >>>> 2541 */ >>>> 2542 if (__predict_false(ieee80211_radiotap_active(ic))) { >>>> 2543 struct run_rx_radiotap_header *tap =3D &sc->sc_rxtap; >>>> 2544 >>>> 2545 tap->wr_flags =3D 0; >>>> 2546 tap->wr_chan_freq =3D htole16(ic->ic_curchan->ic_freq); >>>> 2547 tap->wr_chan_flags =3D htole16(ic->ic_curchan->ic_flags); >>>> 2548 tap->wr_antsignal =3D rssi; >>>> 2549 tap->wr_antenna =3D ant; >>>> 2550 tap->wr_dbm_antsignal =3D run_rssi2dbm(sc, rssi, ant); >>>> 2551 tap->wr_rate =3D 2; /* in case it can't be found below = */ >>>> 2552 phy =3D le16toh(rxwi->phy); >>>> 2553 switch (phy & RT2860_PHY_MODE) { >>>> 2554 case RT2860_PHY_CCK: >>>> 2555 switch ((phy & RT2860_PHY_MCS) & ~RT2860_PHY_SHPRE) { >>>> 2556 case 0: tap->wr_rate =3D 2; break; >>>> 2557 case 1: tap->wr_rate =3D 4; break; >>>> 2558 case 2: tap->wr_rate =3D 11; break; >>>> 2559 case 3: tap->wr_rate =3D 22; break; >>>> 2560 } >>>> 2561 if (phy & RT2860_PHY_SHPRE) >>>> 2562 tap->wr_flags |=3D IEEE80211_RADIOTAP_F_SHORTPRE; >>>> 2563 break; >>>> 2564 case RT2860_PHY_OFDM: >>>> 2565 switch (phy & RT2860_PHY_MCS) { >>>> 2566 case 0: tap->wr_rate =3D 12; break; >>>> 2567 case 1: tap->wr_rate =3D 18; break; >>>> 2568 case 2: tap->wr_rate =3D 24; break; >>>> 2569 case 3: tap->wr_rate =3D 36; break; >>>> 2570 case 4: tap->wr_rate =3D 48; break; >>>> 2571 case 5: tap->wr_rate =3D 72; break; >>>> 2572 case 6: tap->wr_rate =3D 96; break; >>>> 2573 case 7: tap->wr_rate =3D 108; break; >>>> 2574 } >>>> 2575 break; >>>> 2576 } >>>> 2577 } >>>> 2578 >>>> 2579 if (ni !=3D NULL) { >>>> 2580 (void)ieee80211_input(ni, m, rssi, nf); >>>> 2581 ieee80211_free_node(ni); >>>> 2582 } else { >>>> 2583 (void)ieee80211_input_all(ic, m, rssi, nf); >>>> 2584 } >>>> 2585 >>>> 2586 } >>>> 2587 >>>> 2588 static void >>>> >>>> >>>> Index: sys/vm/vm_map.c >>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>>> --- sys/vm/vm_map.c (revision 253514) >>>> +++ sys/vm/vm_map.c (working copy) >>>> @@ -239,8 +239,7 @@ >>>> vm_map_t map; >>>> >>>> map =3D (vm_map_t)mem; >>>> - map->nentries =3D 0; >>>> - map->size =3D 0; >>>> + memset(map, 0, sizeof(*map)); >>>> mtx_init(&map->system_mtx, "vm map (system)", NULL, MTX_DEF | >>>> MTX_DUPOK); >>>> sx_init(&map->lock, "vm map (user)"); >>>> return (0); >>>> >>>> -- >>>> Regards. >>>> By: XiaoQI Ge; PGP:8B09D5F7 >>>> WWW: https://www.7axu.com/ >>>> >>>> >>>> >>>> 2013/7/24 XiaoQI Ge : >>>>> I manually make up, is compiling the kernel >>>>> -- >>>>> Regards. >>>>> By: XiaoQI Ge; PGP:8B09D5F7 >>>>> WWW: https://www.7axu.com/ >>>>> >>>>> >>>>> >>>>> 2013/7/24 XiaoQI Ge : >>>>>> patch < /root/if_run_2013_01_19_radiotap_fix_only.diff appears to b= e invalid >>>>>> >>>>>> ] /usr/src/sys/dev/usb/wlan # patch < >>>>>> /root/if_run_2013_01_19_radiotap_fix_only.diff >>>>>> Hmm... Looks like a unified diff to me... >>>>>> The text leading up to this was: >>>>>> -------------------------- >>>>>> |--- if_run.c.fix1_vnet 2013-06-14 10:12:49.786774072 +0200 >>>>>> |+++ if_run.c.fix2_vnet_plus_radiotap 2013-06-14 10:15:34.89077431= 4 +0200 >>>>>> -------------------------- >>>>>> File to patch: >>>>>> >>>>>> >>>>>> 2013/7/23 Daan Vreeken : >>>>>>> cd /usr/src/sys/dev/usb/wlan >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Regards. >>>>>> By: XiaoQI Ge; PGP:8B09D5F7 >>>>>> WWW: https://www.7axu.com/ >>> _______________________________________________ >>> freebsd-wireless@freebsd.org mailing list >>> http://lists.freebsd.org/mailman/listinfo/freebsd-wireless >>> To unsubscribe, send any mail to "freebsd-wireless-unsubscribe@freebsd.= org"