From owner-freebsd-wireless@FreeBSD.ORG Sun Jul 28 03:34:56 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B94AD5AD for ; Sun, 28 Jul 2013 03:34:56 +0000 (UTC) (envelope-from ghw@7axu.com) Received: from mail-we0-f174.google.com (mail-we0-f174.google.com [74.125.82.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3DDD42F70 for ; Sun, 28 Jul 2013 03:34:55 +0000 (UTC) Received: by mail-we0-f174.google.com with SMTP id q54so2938143wes.5 for ; Sat, 27 Jul 2013 20:34:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding :x-gm-message-state; bh=VgW1gJSECZYkqjb/gE6knxdo/O98gmTjsqiwN1p7kMc=; b=W81P04iktUsMvsEf7lWjfa8w1VtytnlBHO4TjIt+WhU/vTKauK9b1Mcx6ILE2NvCRB 7x9WoRjrwfhjqxWihcbUBHhgKKbrIAOLNJcxGvbdJMyRQscCiP7XFS2WBmJTmPgxwnFL RxlIPqXdyOm41z/wW1EHM5mvWGkkMC6a1gVORtmIpbhIxHFJYWcY9zh9z8IM7N+zLHRp GxC0ZlNGe4YGSofi7+RAwcNwSB4egTlLHqXkcGZw027CBMXHUlbDsv4Z8v2T5IrgmaZ3 Tp6lfg0mED723Ahr27JGWPGuFAGVOTCn70nhIWpSDmN2VBu4yanykHrXCCUmrsPMzmDd 6AkA== X-Received: by 10.180.73.103 with SMTP id k7mr3308140wiv.24.1374982487615; Sat, 27 Jul 2013 20:34:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.93.34 with HTTP; Sat, 27 Jul 2013 20:34:07 -0700 (PDT) X-Originating-IP: [54.249.112.206] In-Reply-To: References: <1374573600-2351360719.d37ada5f86@bliksem.vehosting.nl> <201307231220.52817.Daan@vitsch.nl> From: XiaoQI Ge Date: Sun, 28 Jul 2013 11:34:07 +0800 Message-ID: Subject: Re: My WLI-UC-GNM up crash To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlpW6dILBu/Q/buUBtGP/tO0HdI3XflgF73NpKzq+TliKJ9jatSxTnZpzNya0TCcO/VN6oZ Cc: freebsd-arm , freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jul 2013 03:34:56 -0000 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: >> =E6=88=91=E6=9B=B4=E6=96=B0=E5=88=B0=E6=9C=80=E6=96=B0=E7=9A=84=E6=BA=90= =E7=A0=81=EF=BC=88r253662=EF=BC=89=EF=BC=8C=E8=BF=99=E6=AC=A1=E9=94=99=E8= =AF=AF=E4=BF=A1=E6=81=AF=E5=8F=98=E6=88=90=E4=BA=860xde9f4d34 >> >> [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, [r1= ] >>> 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 be= 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.890774314= +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.o= rg" From owner-freebsd-wireless@FreeBSD.ORG Sun Jul 28 04:29:09 2013 Return-Path: Delivered-To: freebsd-wireless@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-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." 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" From owner-freebsd-wireless@FreeBSD.ORG Sun Jul 28 05:13:45 2013 Return-Path: Delivered-To: freebsd-wireless@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 D3F4E31A for ; Sun, 28 Jul 2013 05:13:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x22a.google.com (mail-wg0-x22a.google.com [IPv6:2a00:1450:400c:c00::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6E9202122 for ; Sun, 28 Jul 2013 05:13:45 +0000 (UTC) Received: by mail-wg0-f42.google.com with SMTP id j13so1873403wgh.5 for ; Sat, 27 Jul 2013 22:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=hU5qcrQwW7trRjqvv6vv/e5I4mRtb4XtbN8/dGV7Ptw=; b=GlCbqApto3AVI/FvoCXYe1Vx3SxLrNiGTA89eO8AddIlzDzVAww0Xo2oAqAY8W984k UtphYoPrO3pRfp33SKDsGp6GEJEwsKQiT+ncjv1yYXRhqy2dh9QRlDiWAShV12Gn4v+x aiGKaDPm/8ocIvV7zJS8MVAAgQ4TlZXjLQsdG0eiWD4/vp2yjk4k1acDJNDo8Wo6b5AP ZNTWVbEgdLXgdBMTUfnURfcvOge7L+fXMAG7w40d6x1x+w3ndnrVP5dmBZcSpLYK6LZs 6cuChf2A4aG/tF3JZqHm3MLua2kUSjg2LlOSR3PUFUPS0AIy9rvK3SMNnlSuX+k8A98W XCgw== MIME-Version: 1.0 X-Received: by 10.180.185.148 with SMTP id fc20mr3559845wic.0.1374988423216; Sat, 27 Jul 2013 22:13:43 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Sat, 27 Jul 2013 22:13:43 -0700 (PDT) Date: Sat, 27 Jul 2013 22:13:43 -0700 X-Google-Sender-Auth: nADysuQKS3UB1py_eDsYkr_GyFU Message-ID: Subject: mesh tidyup, 1 of (...) From: Adrian Chadd To: freebsd-wireless@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jul 2013 05:13:45 -0000 Hiya, I've just committed a bit of a refactor of the mesh and non-mesh transmit path to -HEAD. This unifies a large part of the transmit code into a single path which handles power save and 11n aggregation preparation. Next is the TX stuff that Monthadar and I have talked about a bit. We need to figure out a clean way to reinject these mesh frames into the TX path for general processing. I'd appreciate it if it could get some further (non-11n!) mesh testing. I'll do some more minimal testing to ensure that I haven't done anything daft and broken things but I won't be able to do that for another week or so. So if you have an 11s setup or can set one up quickly, I'd really appreciate it. I'm going to start sketching out the upcoming A-MSDU support and per-node software queues in net80211 as a precursor for pushing aggregation, powersave and general queue management into net80211 rather than requiring driver hacks. Right now the power save stuff is just not good enough for 11n, 11s, TDMA , P2P/TDLS and other kinds of newer technologies. Thanks! -adrian From owner-freebsd-wireless@FreeBSD.ORG Sun Jul 28 09:23:01 2013 Return-Path: Delivered-To: freebsd-wireless@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 80552FAD; Sun, 28 Jul 2013 09:23:01 +0000 (UTC) (envelope-from hans.petter.selasky@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id 6422C2688; Sun, 28 Jul 2013 09:22:59 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id 438707A26F; Sun, 28 Jul 2013 11:22:59 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 478288F04D5; Sun, 28 Jul 2013 11:23:04 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Kf76i5NiuR3I; Sun, 28 Jul 2013 11:23:02 +0200 (CEST) Received: from mail.lockless.no (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 0C63A8F04D4; Sun, 28 Jul 2013 11:23:02 +0200 (CEST) Subject: RE: My WLI-UC-GNM up crash From: =?utf-8?Q?Hans_Petter_Selasky?= To: =?utf-8?Q?Adrian_Chadd?= , =?utf-8?Q?XiaoQI_Ge?= , =?utf-8?Q?sam=40freebsd=2Eorg?= Date: Sun, 28 Jul 2013 11:23:01 +0200 Mime-Version: 1.0 In-Reply-To: References: X-Priority: 3 (Normal) X-Mailer: Zarafa 7.1.4-41394 Message-Id: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: =?utf-8?Q?freebsd-arm?= , =?utf-8?Q?freebsd-wireless=40freebsd=2Eorg?= X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jul 2013 09:23:01 -0000 This patch=3F=0D=0A=0D=0Acommit bae4e38c197f464c4bffe7037d5d491e462105b0=0D= =0AAuthor: sam =0D=0ADate: Thu Apr 1 00:38:45 2004 +00= 00=0D=0A=0D=0A radiotap updates:=0D=0A =20=0D=0A o force little-e= ndian byte order for header=0D=0A o pad header to 32-bit boundary to g= uard against applications that assume=0D=0A packet data alignment=0D= =0A=0D=0A--HPS=0D=0A=20=0D=0A=20=0D=0A-----Original message-----=0D=0A> F= rom:Adrian Chadd >=0D=0A>= Sent: Sunday 28th July 2013 6:29=0D=0A> To: XiaoQI Ge >=0D=0A> Cc: freebsd-arm >; freebsd-wireless@freebsd.org =20=0D=0A> Subject: Re: My WLI-UC-GNM up crash=0D= =0A>=20=0D=0A> Not sure, I haven't dug into it. It shouldn't be hard to f= ix though.=0D=0A>=20=0D=0A> I think someone just screwed up in defining t= he structures in the USB=0D=0A> drivers and didn't specify alignment. ath= (4) got it right because Sam=0D=0A> ran it on MIPS/ARM boards.=0D=0A>=20=0D= =0A>=20=0D=0A>=20=0D=0A> -adrian=0D=0A>=20=0D=0A> On 27 July 2013 20:34, = XiaoQI Ge > wrote:=0D=0A> > That shou= ld be how to solve it=3F=0D=0A> > --=0D=0A> > Regards.=0D=0A> > By: XiaoQ= I Ge; PGP:8B09D5F7=0D=0A> > WWW: https://www.7axu.com/=0D=0A> >=0D=0A> >=0D= =0A> >=0D=0A> > 2013/7/27 Adrian Chadd >:=0D=0A> >> This is known; there's some alignment issue wi= th the radiotap TX/RX=0D=0A> >> structures in some of these USB devices.=0D= =0A> >>=0D=0A> >>=0D=0A> >>=0D=0A> >> -adrain=0D=0A> >>=0D=0A> >> On 25 J= uly 2013 20:23, XiaoQI Ge > wrote:=0D= =0A> >>> =E6=88=91=E6=9B=B4=E6=96=B0=E5=88=B0=E6=9C=80=E6=96=B0=E7=9A=84=E6= =BA=90=E7=A0=81=EF=BC=88r253662=EF=BC=89=EF=BC=8C=E8=BF=99=E6=AC=A1=E9=94= =99=E8=AF=AF=E4=BF=A1=E6=81=AF=E5=8F=98=E6=88=90=E4=BA=860xde9f4d34=0D=0A= > >>>=0D=0A> >>> [root@FreeBSD.ttyu0 ] =CB=9C= # Fatal kernel mode data abort: 'Alignment Fault 1'=0D=0A> >>> trapframe= : 0xde9f4d34=0D=0A> >>> FSR=3D00000801, FAR=3Dc284afbb, spsr=3D00000013=0D= =0A> >>> r0 =3Dc284c000, r1 =3Dc284afbb, r2 =3Dc284c210, r3 =3D0000096c=0D= =0A> >>> r4 =3Dc284c024, r5 =3Dc05f07c5, r6 =3D00000014, r7 =3Dc2844800=0D= =0A> >>> r8 =3Dc05f07c5, r9 =3Dc284c000, r10=3D000035cb, r11=3Dde9f4e10=0D= =0A> >>> r12=3D0000002e, ssp=3Dde9f4d80, slr=3D00000000, pc =3Dc046d20c=0D= =0A> >>>=0D=0A> >>> [ thread pid 0 tid 100053 ]=0D=0A> >>> Stopped at = ieee80211_radiotap_chan_change+0x90: strh r3, [r1]=0D=0A> >>> db>= =0D=0A> >>> ---=0D=0A> >>> Kernel wlan related options=0D=0A> >>> device = wlan # 802.11 support=0D=0A> >>> options IEEE= 80211_DEBUG # enable debug msgs=0D=0A> >>> options IEEE80211_AMPD= U_AGE # age frames in AMPDU reorder q's=0D=0A> >>> options IEEE80= 211_SUPPORT_MESH # enable 802.11s draft support=0D=0A> >>> device = wlan_wep # 802.11 WEP support=0D=0A> >>> device wlan_c= cmp # 802.11 CCMP support=0D=0A> >>> device wlan_tkip = # 802.11 TKIP support=0D=0A> >>> device wlan_amrr # AMRR= transmit rate control algorithm=0D=0A> >>> device firmware = # firmware assist module=0D=0A> >>> device run #Ralink Te= chnology USB IEEE 802.11a/g/n=0D=0A> >>> wireless network device=0D=0A> >= >> device runfw #Firmware Module for Ralink driver=0D=0A> >>>=0D= =0A> >>> ---=0D=0A> >>> The compiler command=0D=0A> >>> make TARGET_ARCH=3D= armv6 TARGET_CPUTYPE=3Darmv6 KERNCONF=3DBBB WITH_FDT=3Dyes=0D=0A> >>> bui= ldkernel=0D=0A> >>> --=0D=0A> >>> Regards.=0D=0A> >>> By: XiaoQI Ge; PGP:= 8B09D5F7=0D=0A> >>> WWW: https://www.7axu.com/=0D=0A> >>>=0D=0A> >>>=0D=0A= > >>>=0D=0A> >>> 2013/7/24 XiaoQI Ge = >:=0D=0A> >>>> How do I debug it=3F Can provide useful information=0D=0A>= >>>>=0D=0A> >>>> login: root=0D=0A> >>>> Jul 24 18:27:31 FreeBSD login: = ROOT LOGIN (root) ON ttyu0=0D=0A> >>>> FreeBSD 10.0-CURRENT (BBB) #4 r253= 585M: Wed Jul 24 17:07:53 CST 2013=0D=0A> >>>> [root@FreeBSD.ttyu0 ] =CB=9C # ifconfig wlan create wlandev run0=0D=0A>= >>>> wlan0: Ethernet address: 10:6f:3f:2b:fd:6d=0D=0A> >>>> wlan0=0D=0A>= >>>> [root@FreeBSD.ttyu0 ] =CB=9C # ifconfig= wlan0 up=0D=0A> >>>> run0: firmware RT2870 ver. 0.236 loaded=0D=0A> >>>>= Fatal kernel mode data abort: 'Alignment Fault 1'=0D=0A> >>>> trapframe:= 0xde9e4d5c=0D=0A> >>>> FSR=3D00000801, FAR=3Dc282ffbb, spsr=3D00000013=0D= =0A> >>>> r0 =3Dc2831000, r1 =3Dc282ffbb, r2 =3Dc2831210, r3 =3D0000096c=0D= =0A> >>>> r4 =3Dc2831024, r5 =3Dc2831000, r6 =3Dc05d9362, r7 =3Dc2829800=0D= =0A> >>>> r8 =3D00000014, r9 =3Dc08144d8, r10=3D80001cce, r11=3Dde9e4e10=0D= =0A> >>>> r12=3D0000002e, ssp=3Dde9e4da8, slr=3D00000000, pc =3Dc045c510=0D= =0A> >>>>=0D=0A> >>>> [ thread pid 0 tid 100053 ]=0D=0A> >>>> Stopped at = ieee80211_radiotap_chan_change+0x90: strh r3, [r1]=0D=0A> >>>>= db>=0D=0A> >>>>=0D=0A> >>>>=0D=0A> >>>> These two places modified:=0D=0A= > >>>> 2522 }=0D=0A> >>>> 2523=0D=0A> >>>> 2524 ant =3D run_maxrs= si_chain(sc, rxwi);=0D=0A> >>>> 2525 rssi =3D rxwi->rssi[ant];=0D=0A>= >>>> 2526 nf =3D run_rssi2dbm(sc, rssi, ant);=0D=0A> >>>> 2527=0D=0A= > >>>> 2528 m->m_pkthdr.rcvif =3D ifp;=0D=0A> >>>> 2529 m->m_pkth= dr.len =3D m->m_len =3D len;=0D=0A> >>>> 2530 /*=0D=0A> >>>> 2531 if = (ni !=3D NULL) {=0D=0A> >>>> 2532 (void)ieee80211_input(ni, m, rs= si, nf);=0D=0A> >>>> 2533 ieee80211_free_node(ni);=0D=0A> >>>> 25= 34 } else {=0D=0A> >>>> 2535 (void)ieee80211_input_all(ic, m,= rssi, nf);=0D=0A> >>>> 2536 }=0D=0A> >>>> 2537 */=0D=0A> >>>> 2538 = /*=0D=0A> >>>> 2539 * DAAN: fill-in tap header BEFORE calling iee= e80211_input*() so the=0D=0A> >>>> 2540 * user will see the actual d= ata that belongs to THIS packet..=0D=0A> >>>> 2541 */=0D=0A> >>>> 25= 42 if (__predict_false(ieee80211_radiotap_active(ic))) {=0D=0A> >>>> = 2543 struct run_rx_radiotap_header *tap =3D &sc->sc_rxtap;=0D=0A>= >>>> 2544=0D=0A> >>>> 2545 tap->wr_flags =3D 0;=0D=0A> >>>> 2546= tap->wr_chan_freq =3D htole16(ic->ic_curchan->ic_freq);=0D=0A> >= >>> 2547 tap->wr_chan_flags =3D htole16(ic->ic_curchan->ic_flags)= ;=0D=0A> >>>> 2548 tap->wr_antsignal =3D rssi;=0D=0A> >>>> 2549 = tap->wr_antenna =3D ant;=0D=0A> >>>> 2550 tap->wr_dbm_ants= ignal =3D run_rssi2dbm(sc, rssi, ant);=0D=0A> >>>> 2551 tap->wr_r= ate =3D 2; /* in case it can't be found below */=0D=0A> >>>> 2552 = phy =3D le16toh(rxwi->phy);=0D=0A> >>>> 2553 switch (phy & RT2= 860_PHY_MODE) {=0D=0A> >>>> 2554 case RT2860_PHY_CCK:=0D=0A> >>>>= 2555 switch ((phy & RT2860_PHY_MCS) & =CB=9CRT2860_PHY_SHPRE= ) {=0D=0A> >>>> 2556 case 0: tap->wr_rate =3D 2; break;=0D=0A= > >>>> 2557 case 1: tap->wr_rate =3D 4; break;=0D=0A> >>>> = 2558 case 2: tap->wr_rate =3D 11; break;=0D=0A> >>>> 2559 = case 3: tap->wr_rate =3D 22; break;=0D=0A> >>>> 2560 = }=0D=0A> >>>> 2561 if (phy & RT2860_PHY_SHPRE)=0D=0A> >>>>= 2562 tap->wr_flags |=3D IEEE80211_RADIOTAP_F_SHORTPRE;=0D= =0A> >>>> 2563 break;=0D=0A> >>>> 2564 case RT2860_PH= Y_OFDM:=0D=0A> >>>> 2565 switch (phy & RT2860_PHY_MCS) {=0D=0A= > >>>> 2566 case 0: tap->wr_rate =3D 12; break;=0D=0A> >>>> = 2567 case 1: tap->wr_rate =3D 18; break;=0D=0A> >>>> 2568 = case 2: tap->wr_rate =3D 24; break;=0D=0A> >>>> 2569 = case 3: tap->wr_rate =3D 36; break;=0D=0A> >>>> 2570 case= 4: tap->wr_rate =3D 48; break;=0D=0A> >>>> 2571 case 5: tap= ->wr_rate =3D 72; break;=0D=0A> >>>> 2572 case 6: tap->wr_ra= te =3D 96; break;=0D=0A> >>>> 2573 case 7: tap->wr_rate =3D = 108; break;=0D=0A> >>>> 2574 }=0D=0A> >>>> 2575 b= reak;=0D=0A> >>>> 2576 }=0D=0A> >>>> 2577 }=0D=0A> >>>> 2578=0D= =0A> >>>> 2579 if (ni !=3D NULL) {=0D=0A> >>>> 2580 (void)iee= e80211_input(ni, m, rssi, nf);=0D=0A> >>>> 2581 ieee80211_free_no= de(ni);=0D=0A> >>>> 2582 } else {=0D=0A> >>>> 2583 (void)ieee= 80211_input_all(ic, m, rssi, nf);=0D=0A> >>>> 2584 }=0D=0A> >>>> 2585= =0D=0A> >>>> 2586 }=0D=0A> >>>> 2587=0D=0A> >>>> 2588 static void=0D=0A> = >>>>=0D=0A> >>>>=0D=0A> >>>> Index: sys/vm/vm_map.c=0D=0A> >>>> =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=0D=0A> >>>> --- sys/vm/vm_map.= c (revision 253514)=0D=0A> >>>> +++ sys/vm/vm_map.c (working copy= )=0D=0A> >>>> @@ -239,8 +239,7 @@=0D=0A> >>>> vm_map_t map;=0D=0A= > >>>>=0D=0A> >>>> map =3D (vm_map_t)mem;=0D=0A> >>>> - map= ->nentries =3D 0;=0D=0A> >>>> - map->size =3D 0;=0D=0A> >>>> + = memset(map, 0, sizeof(*map));=0D=0A> >>>> mtx_init(&map->system= _mtx, "vm map (system)", NULL, MTX_DEF |=0D=0A> >>>> MTX_DUPOK);=0D=0A> >= >>> sx_init(&map->lock, "vm map (user)");=0D=0A> >>>> ret= urn (0);=0D=0A> >>>>=0D=0A> >>>> --=0D=0A> >>>> Regards.=0D=0A> >>>> By: = XiaoQI Ge; PGP:8B09D5F7=0D=0A> >>>> WWW: https://www.7axu.com/=0D=0A> >>>= >=0D=0A> >>>>=0D=0A> >>>>=0D=0A> >>>> 2013/7/24 XiaoQI Ge >:=0D=0A> >>>>> I manually make up, is compiling the= kernel=0D=0A> >>>>> --=0D=0A> >>>>> Regards.=0D=0A> >>>>> By: XiaoQI Ge;= PGP:8B09D5F7=0D=0A> >>>>> WWW: https://www.7axu.com/=0D=0A> >>>>>=0D=0A>= >>>>>=0D=0A> >>>>>=0D=0A> >>>>> 2013/7/24 XiaoQI Ge >:=0D=0A> >>>>>> patch < /root/if_run_2013_01_19_radiota= p_fix_only.diff appears to be invalid=0D=0A> >>>>>>=0D=0A> >>>>>> ] /usr/= src/sys/dev/usb/wlan # patch <=0D=0A> >>>>>> /root/if_run_2013_01_19_radi= otap_fix_only.diff=0D=0A> >>>>>> Hmm... Looks like a unified diff to me.= =2E.=0D=0A> >>>>>> The text leading up to this was:=0D=0A> >>>>>> -------= -------------------=0D=0A> >>>>>> |--- if_run.c.fix1_vnet 2013-06-14 10:1= 2:49.786774072 +0200=0D=0A> >>>>>> |+++ if_run.c.fix2_vnet_plus_radiotap = 2013-06-14 10:15:34.890774314 +0200=0D=0A> >>>>>> ---------------------= -----=0D=0A> >>>>>> File to patch:=0D=0A> >>>>>>=0D=0A> >>>>>>=0D=0A> >>>= >>> 2013/7/23 Daan Vreeken >:=0D=0A= > >>>>>>> cd /usr/src/sys/dev/usb/wlan=0D=0A> >>>>>>=0D=0A> >>>>>>=0D=0A>= >>>>>>=0D=0A> >>>>>> --=0D=0A> >>>>>> Regards.=0D=0A> >>>>>> By: XiaoQI = Ge; PGP:8B09D5F7=0D=0A> >>>>>> WWW: https://www.7axu.com/=0D=0A> >>> ____= ___________________________________________=0D=0A> >>> freebsd-wireless@f= reebsd.org mailing list=0D=0A> >>>= http://lists.freebsd.org/mailman/listinfo/freebsd-wireless =20=0D=0A> >>> To unsubs= cribe, send any mail to "freebsd-wireless-unsubscribe@freebsd.org "=0D=0A> _____________________= __________________________=0D=0A> freebsd-arm@freebsd.org mailing list=0D=0A> http://lists.freebsd.org/mailman/l= istinfo/freebsd-arm =20=0D=0A> To unsubscribe, send any mail to "freebsd-arm-unsubscribe@fr= eebsd.org "=0D=0A=0D=0A From owner-freebsd-wireless@FreeBSD.ORG Sun Jul 28 10:33:51 2013 Return-Path: Delivered-To: freebsd-wireless@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 AC7D2D5A; Sun, 28 Jul 2013 10:33:51 +0000 (UTC) (envelope-from hps@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id 207BB289E; Sun, 28 Jul 2013 10:33:50 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id 0DC197A270; Sun, 28 Jul 2013 12:33:49 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 1C4C88F04E2; Sun, 28 Jul 2013 12:33:54 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fyuxMI1VnXwj; Sun, 28 Jul 2013 12:33:53 +0200 (CEST) Received: from laptop015.hselasky.homeunix.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id D4CAA8F04E1; Sun, 28 Jul 2013 12:33:52 +0200 (CEST) Message-ID: <51F4F3E9.9010605@bitfrost.no> Date: Sun, 28 Jul 2013 12:35:21 +0200 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130522 Thunderbird/17.0.6 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: My WLI-UC-GNM up crash References: <1374573600-2351360719.d37ada5f86@bliksem.vehosting.nl> <201307231220.52817.Daan@vitsch.nl> In-Reply-To: Content-Type: multipart/mixed; boundary="------------090509080502000108040303" Cc: freebsd-arm , freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jul 2013 10:33:51 -0000 This is a multi-part message in MIME format. --------------090509080502000108040303 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Hi, Can you try the attached patch? --HPS --------------090509080502000108040303 Content-Type: text/x-patch; name="radiotap.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="radiotap.diff" === sys/dev/usb/wlan/if_rumvar.h ================================================================== --- sys/dev/usb/wlan/if_rumvar.h (revision 253548) +++ sys/dev/usb/wlan/if_rumvar.h (local) @@ -29,7 +29,7 @@ int8_t wr_antsignal; int8_t wr_antnoise; uint8_t wr_antenna; -}; +} __packed __aligned(8); #define RT2573_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ @@ -47,7 +47,7 @@ uint16_t wt_chan_freq; uint16_t wt_chan_flags; uint8_t wt_antenna; -}; +} __packed __aligned(8); #define RT2573_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ === sys/dev/usb/wlan/if_runvar.h ================================================================== --- sys/dev/usb/wlan/if_runvar.h (revision 253548) +++ sys/dev/usb/wlan/if_runvar.h (local) @@ -58,7 +58,7 @@ int8_t wr_dbm_antsignal; uint8_t wr_antenna; uint8_t wr_antsignal; -} __packed; +} __packed __aligned(8); #define RUN_RX_RADIOTAP_PRESENT \ (1 << IEEE80211_RADIOTAP_FLAGS | \ @@ -75,7 +75,7 @@ uint16_t wt_chan_freq; uint16_t wt_chan_flags; uint8_t wt_hwqueue; -} __packed; +} __packed __aligned(8); #define IEEE80211_RADIOTAP_HWQUEUE 15 === sys/dev/usb/wlan/if_uathvar.h ================================================================== --- sys/dev/usb/wlan/if_uathvar.h (revision 253548) +++ sys/dev/usb/wlan/if_uathvar.h (local) @@ -52,7 +52,7 @@ int8_t wr_antsignal; int8_t wr_antnoise; u_int8_t wr_antenna; -} __packed; +} __packed __aligned(8); #define UATH_RX_RADIOTAP_PRESENT ( \ (1 << IEEE80211_RADIOTAP_TSFT) | \ @@ -69,7 +69,7 @@ uint8_t wt_flags; uint16_t wt_chan_freq; uint16_t wt_chan_flags; -} __packed; +} __packed __aligned(8); #define UATH_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ === sys/dev/usb/wlan/if_upgtvar.h ================================================================== --- sys/dev/usb/wlan/if_upgtvar.h (revision 253548) +++ sys/dev/usb/wlan/if_upgtvar.h (local) @@ -380,7 +380,7 @@ uint16_t wr_chan_freq; uint16_t wr_chan_flags; int8_t wr_antsignal; -} __packed; +} __packed __aligned(8); #define UPGT_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ @@ -394,7 +394,7 @@ uint8_t wt_rate; uint16_t wt_chan_freq; uint16_t wt_chan_flags; -} __packed; +} __packed __aligned(8); #define UPGT_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ === sys/dev/usb/wlan/if_uralvar.h ================================================================== --- sys/dev/usb/wlan/if_uralvar.h (revision 253548) +++ sys/dev/usb/wlan/if_uralvar.h (local) @@ -34,7 +34,7 @@ int8_t wr_antsignal; int8_t wr_antnoise; uint8_t wr_antenna; -}; +} __packed __aligned(8); #define RAL_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ @@ -51,7 +51,7 @@ uint16_t wt_chan_freq; uint16_t wt_chan_flags; uint8_t wt_antenna; -}; +} __packed __aligned(8); #define RAL_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ === sys/dev/usb/wlan/if_urtwnreg.h ================================================================== --- sys/dev/usb/wlan/if_urtwnreg.h (revision 253548) +++ sys/dev/usb/wlan/if_urtwnreg.h (local) @@ -1030,7 +1030,7 @@ uint16_t wr_chan_freq; uint16_t wr_chan_flags; uint8_t wr_dbm_antsignal; -} __packed; +} __packed __aligned(8); #define URTWN_RX_RADIOTAP_PRESENT \ (1 << IEEE80211_RADIOTAP_FLAGS | \ @@ -1043,7 +1043,7 @@ uint8_t wt_flags; uint16_t wt_chan_freq; uint16_t wt_chan_flags; -} __packed; +} __packed __aligned(8); #define URTWN_TX_RADIOTAP_PRESENT \ (1 << IEEE80211_RADIOTAP_FLAGS | \ === sys/dev/usb/wlan/if_urtwvar.h ================================================================== --- sys/dev/usb/wlan/if_urtwvar.h (revision 253548) +++ sys/dev/usb/wlan/if_urtwvar.h (local) @@ -63,7 +63,7 @@ uint16_t wr_chan_freq; uint16_t wr_chan_flags; int8_t wr_dbm_antsignal; -} __packed; +} __packed __aligned(8); #define URTW_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ @@ -75,7 +75,7 @@ uint8_t wt_flags; uint16_t wt_chan_freq; uint16_t wt_chan_flags; -} __packed; +} __packed __aligned(8); #define URTW_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ === sys/dev/usb/wlan/if_zydreg.h ================================================================== --- sys/dev/usb/wlan/if_zydreg.h (revision 253548) +++ sys/dev/usb/wlan/if_zydreg.h (local) @@ -1185,7 +1185,7 @@ uint16_t wr_chan_flags; int8_t wr_antsignal; int8_t wr_antnoise; -} __packed; +} __packed __aligned(8); #define ZYD_RX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ @@ -1200,7 +1200,7 @@ uint8_t wt_rate; uint16_t wt_chan_freq; uint16_t wt_chan_flags; -} __packed; +} __packed __aligned(8); #define ZYD_TX_RADIOTAP_PRESENT \ ((1 << IEEE80211_RADIOTAP_FLAGS) | \ --------------090509080502000108040303-- From owner-freebsd-wireless@FreeBSD.ORG Sun Jul 28 08:45:32 2013 Return-Path: Delivered-To: freebsd-wireless@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 5EA4D830 for ; Sun, 28 Jul 2013 08:45:32 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [178.32.219.166]) by mx1.freebsd.org (Postfix) with ESMTP id 4CBE9254C for ; Sun, 28 Jul 2013 08:45:31 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id 91F1E336 for ; Sun, 28 Jul 2013 10:45:21 +0200 (CEST) From: "Cedric GROSS" To: Subject: [IWN] Centrino 2230 patch. Date: Sun, 28 Jul 2013 10:45:19 +0200 Message-ID: <000301ce8b6e$cbca9dc0$635fd940$@info> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0004_01CE8B7F.8F536DC0" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac6Lbsn2Wfd27sneQ9KprX0NpQuzAw== Content-Language: fr X-Mailman-Approved-At: Sun, 28 Jul 2013 13:04:29 +0000 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jul 2013 08:45:32 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_0004_01CE8B7F.8F536DC0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, Here is the full patch against -HEAD for managing 2230 NIC and 6235. You will need firmware file. It's too big for the ML. Cedric ------=_NextPart_000_0004_01CE8B7F.8F536DC0 Content-Type: application/octet-stream; name="full.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="full.patch" Index: sys/dev/iwn/if_iwn.c=0A= =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=0A= --- sys/dev/iwn/if_iwn.c (revision 253707)=0A= +++ sys/dev/iwn/if_iwn.c (working copy)=0A= @@ -1,4 +1,6 @@=0A= /*-=0A= + * Copyright (c) 2013 Cedric GROSS =0A= + * Copyright (c) 2011 Intel Corporation=0A= * Copyright (c) 2007-2009=0A= * Damien Bergamini =0A= * Copyright (c) 2008=0A= @@ -22,7 +24,7 @@=0A= * Driver for Intel WiFi Link 4965 and 1000/5000/6000 Series 802.11 = network=0A= * adapters.=0A= */=0A= -=0A= + =0A= #include =0A= __FBSDID("$FreeBSD$");=0A= =0A= @@ -74,6 +76,7 @@=0A= #include =0A= #include =0A= =0A= +=0A= struct iwn_ident {=0A= uint16_t vendor;=0A= uint16_t device;=0A= @@ -81,40 +84,42 @@=0A= };=0A= =0A= static const struct iwn_ident iwn_ident_table[] =3D {=0A= - { 0x8086, 0x0082, "Intel Centrino Advanced-N 6205" },=0A= - { 0x8086, 0x0083, "Intel Centrino Wireless-N 1000" },=0A= - { 0x8086, 0x0084, "Intel Centrino Wireless-N 1000" },=0A= - { 0x8086, 0x0085, "Intel Centrino Advanced-N 6205" },=0A= - { 0x8086, 0x0087, "Intel Centrino Advanced-N + WiMAX 6250" },=0A= - { 0x8086, 0x0089, "Intel Centrino Advanced-N + WiMAX 6250" },=0A= - { 0x8086, 0x008a, "Intel Centrino Wireless-N 1030" },=0A= - { 0x8086, 0x008b, "Intel Centrino Wireless-N 1030" },=0A= - { 0x8086, 0x0090, "Intel Centrino Advanced-N 6230" },=0A= - { 0x8086, 0x0091, "Intel Centrino Advanced-N 6230" },=0A= - { 0x8086, 0x0885, "Intel Centrino Wireless-N + WiMAX 6150" },=0A= - { 0x8086, 0x0886, "Intel Centrino Wireless-N + WiMAX 6150" },=0A= - { 0x8086, 0x0887, "Intel Centrino Wireless-N 2230" },=0A= - { 0x8086, 0x0888, "Intel Centrino Wireless-N 2230" },=0A= - { 0x8086, 0x0896, "Intel Centrino Wireless-N 130" },=0A= - { 0x8086, 0x0897, "Intel Centrino Wireless-N 130" },=0A= - { 0x8086, 0x08ae, "Intel Centrino Wireless-N 100" },=0A= - { 0x8086, 0x08af, "Intel Centrino Wireless-N 100" },=0A= + { 0x8086, IWN_DID_6x05_1, "Intel Centrino Advanced-N 6205" },=0A= + { 0x8086, IWN_DID_1000_1, "Intel Centrino Wireless-N 1000" },=0A= + { 0x8086, IWN_DID_1000_2, "Intel Centrino Wireless-N 1000" },=0A= + { 0x8086, IWN_DID_6x05_2, "Intel Centrino Advanced-N 6205" },=0A= + { 0x8086, IWN_DID_6050_1, "Intel Centrino Advanced-N + WiMAX 6250" },=0A= + { 0x8086, IWN_DID_6050_2, "Intel Centrino Advanced-N + WiMAX 6250" },=0A= + { 0x8086, IWN_DID_x030_1, "Intel Centrino Wireless-N 1030" },=0A= + { 0x8086, IWN_DID_x030_2, "Intel Centrino Wireless-N 1030" },=0A= + { 0x8086, IWN_DID_x030_3, "Intel Centrino Advanced-N 6230" },=0A= + { 0x8086, IWN_DID_x030_4, "Intel Centrino Advanced-N 6230" },=0A= + { 0x8086, IWN_DID_6150_1, "Intel Centrino Wireless-N + WiMAX 6150" },=0A= + { 0x8086, IWN_DID_6150_2, "Intel Centrino Wireless-N + WiMAX 6150" },=0A= + { 0x8086, IWN_DID_2x30_1, "Intel Centrino Wireless-N 2230"},=0A= + { 0x8086, IWN_DID_2x30_2, "Intel Centrino Wireless-N 2230"},=0A= + { 0x8086, IWN_DID_130_1, "Intel Centrino Wireless-N 130" },=0A= + { 0x8086, IWN_DID_130_2, "Intel Centrino Wireless-N 130" },=0A= + { 0x8086, IWN_DID_100_1, "Intel Centrino Wireless-N 100" },=0A= + { 0x8086, IWN_DID_100_2, "Intel Centrino Wireless-N 100" },=0A= { 0x8086, 0x4229, "Intel Wireless WiFi Link 4965" },=0A= - { 0x8086, 0x422b, "Intel Centrino Ultimate-N 6300" },=0A= - { 0x8086, 0x422c, "Intel Centrino Advanced-N 6200" },=0A= + { 0x8086, IWN_DID_6x00_1, "Intel Centrino Ultimate-N 6300" },=0A= + { 0x8086, IWN_DID_6x00_2, "Intel Centrino Advanced-N 6200" },=0A= { 0x8086, 0x422d, "Intel Wireless WiFi Link 4965" },=0A= { 0x8086, 0x4230, "Intel Wireless WiFi Link 4965" },=0A= - { 0x8086, 0x4232, "Intel WiFi Link 5100" },=0A= + { 0x8086, IWN_DID_5x00_1, "Intel WiFi Link 5100" },=0A= { 0x8086, 0x4233, "Intel Wireless WiFi Link 4965" },=0A= - { 0x8086, 0x4235, "Intel Ultimate N WiFi Link 5300" },=0A= - { 0x8086, 0x4236, "Intel Ultimate N WiFi Link 5300" },=0A= - { 0x8086, 0x4237, "Intel WiFi Link 5100" },=0A= - { 0x8086, 0x4238, "Intel Centrino Ultimate-N 6300" },=0A= - { 0x8086, 0x4239, "Intel Centrino Advanced-N 6200" },=0A= - { 0x8086, 0x423a, "Intel WiMAX/WiFi Link 5350" },=0A= - { 0x8086, 0x423b, "Intel WiMAX/WiFi Link 5350" },=0A= - { 0x8086, 0x423c, "Intel WiMAX/WiFi Link 5150" },=0A= - { 0x8086, 0x423d, "Intel WiMAX/WiFi Link 5150" },=0A= + { 0x8086, IWN_DID_5x00_3, "Intel Ultimate N WiFi Link 5300" },=0A= + { 0x8086, IWN_DID_5x00_4, "Intel Ultimate N WiFi Link 5300" },=0A= + { 0x8086, IWN_DID_5x00_2, "Intel WiFi Link 5100" },=0A= + { 0x8086, IWN_DID_6x00_3, "Intel Centrino Ultimate-N 6300" },=0A= + { 0x8086, IWN_DID_6x00_4, "Intel Centrino Advanced-N 6200" },=0A= + { 0x8086, IWN_DID_5x50_1, "Intel WiMAX/WiFi Link 5350" },=0A= + { 0x8086, IWN_DID_5x50_2, "Intel WiMAX/WiFi Link 5350" },=0A= + { 0x8086, IWN_DID_5x50_3, "Intel WiMAX/WiFi Link 5150" },=0A= + { 0x8086, IWN_DID_5x50_4, "Intel WiMAX/WiFi Link 5150" },=0A= + { 0x8086, IWN_DID_6035_1, "Centrino Advanced-N 6235" },=0A= + { 0x8086, IWN_DID_6035_2, "Centrino Advanced-N 6235" },=0A= { 0, 0, NULL }=0A= };=0A= =0A= @@ -160,7 +165,9 @@=0A= static int iwn_read_eeprom(struct iwn_softc *,=0A= uint8_t macaddr[IEEE80211_ADDR_LEN]);=0A= static void iwn4965_read_eeprom(struct iwn_softc *);=0A= +#ifdef IWN_DEBUG=0A= static void iwn4965_print_power_group(struct iwn_softc *, int);=0A= +#endif=0A= static void iwn5000_read_eeprom(struct iwn_softc *);=0A= static uint32_t iwn_eeprom_channel_flags(struct iwn_eeprom_chan *);=0A= static void iwn_read_eeprom_band(struct iwn_softc *, int);=0A= @@ -229,7 +236,7 @@=0A= static int iwn_add_broadcast_node(struct iwn_softc *, int);=0A= static int iwn_updateedca(struct ieee80211com *);=0A= static void iwn_update_mcast(struct ifnet *);=0A= -static void iwn_set_led(struct iwn_softc *, uint8_t, uint8_t, uint8_t);=0A= +static void iwn_set_led(struct iwn_softc *, uint8_t , uint8_t , uint8_t = , uint8_t );=0A= static int iwn_set_critical_temp(struct iwn_softc *);=0A= static int iwn_set_timing(struct iwn_softc *, struct ieee80211_node *);=0A= static void iwn4965_power_calibration(struct iwn_softc *, int);=0A= @@ -255,7 +262,7 @@=0A= static int iwn_set_pslevel(struct iwn_softc *, int, int, int);=0A= static int iwn_send_btcoex(struct iwn_softc *);=0A= static int iwn_send_advanced_btcoex(struct iwn_softc *);=0A= -static int iwn5000_runtime_calib(struct iwn_softc *);=0A= +//static int iwn5000_runtime_calib(struct iwn_softc *);=0A= static int iwn_config(struct iwn_softc *);=0A= static uint8_t *ieee80211_add_ssid(uint8_t *, const uint8_t *, u_int);=0A= static int iwn_scan(struct iwn_softc *);=0A= @@ -286,6 +293,7 @@=0A= static int iwn5000_send_wimax_coex(struct iwn_softc *);=0A= static int iwn5000_crystal_calib(struct iwn_softc *);=0A= static int iwn5000_temp_offset_calib(struct iwn_softc *);=0A= +static int iwn5000_temp_offset_calibv2(struct iwn_softc *);=0A= static int iwn4965_post_alive(struct iwn_softc *);=0A= static int iwn5000_post_alive(struct iwn_softc *);=0A= static int iwn4965_load_bootcode(struct iwn_softc *, const uint8_t *,=0A= @@ -320,8 +328,27 @@=0A= static void iwn_scan_curchan(struct ieee80211_scan_state *, unsigned = long);=0A= static void iwn_scan_mindwell(struct ieee80211_scan_state *);=0A= static void iwn_hw_reset(void *, int);=0A= +#ifdef IWN_DEBUG=0A= +static char *iwn_get_csr_string(int);=0A= +static void iwn_debug_register(struct iwn_softc *);=0A= +#endif=0A= +static int iwn_config_specific(struct iwn_softc *,uint16_t);=0A= +//static int iwn_prepare_crystal_calib(struct iwn_softc *sc);=0A= +static int iwn_set_statistics_request(struct iwn_softc *,bool ,bool = ,int );=0A= +static int iwn_cfg_ucode_post_alive(struct iwn_softc *);=0A= +static int iwn_iv_reset(struct ieee80211vap *, u_long );=0A= +static int iwn_newstate_u1(struct ieee80211vap *, enum ieee80211_state = , int );=0A= +static int iwn_auth_u1(struct iwn_softc *, struct ieee80211vap *);=0A= +static int iwn_run_u1(struct iwn_softc *, struct ieee80211vap *);=0A= +static int iwn_set_timing_u1(struct iwn_softc *);=0A= +static int iwn_config_u1(struct iwn_softc *);=0A= +static int iwn_set_pan_params(struct iwn_softc *);=0A= +static int iwn_updateedca_u1(struct ieee80211com *);=0A= +static int iwn_add_broadcast_node_u1(struct iwn_softc *, int );=0A= +static uint16_t iwn_get_active_dwell(struct iwn_softc *, struct = ieee80211_channel *);=0A= +static uint16_t iwn_get_passive_dwell(struct iwn_softc *, struct = ieee80211_channel *);=0A= +static void iwn_led_pattern(struct iwn_softc *);=0A= =0A= -#define IWN_DEBUG=0A= #ifdef IWN_DEBUG=0A= enum {=0A= IWN_DEBUG_XMIT =3D 0x00000001, /* basic xmit operation */=0A= @@ -339,6 +366,7 @@=0A= IWN_DEBUG_CMD =3D 0x00001000, /* cmd submission */=0A= IWN_DEBUG_TXRATE =3D 0x00002000, /* TX rate debugging */=0A= IWN_DEBUG_PWRSAVE =3D 0x00004000, /* Power save operations */=0A= + IWN_DEBUG_REGISTER =3D 0x20000000, /* print chipset register */=0A= IWN_DEBUG_TRACE =3D 0x40000000, /* Print begin and start driver = function */=0A= IWN_DEBUG_FATAL =3D 0x80000000, /* fatal errors */=0A= IWN_DEBUG_ANY =3D 0xffffffff=0A= @@ -345,7 +373,7 @@=0A= };=0A= =0A= #define DPRINTF(sc, m, fmt, ...) do { \=0A= - if (sc->sc_debug & (m)) \=0A= + if ((sc->sc_debug & (m))=3D=3D (m)) \=0A= printf(fmt, __VA_ARGS__); \=0A= } while (0)=0A= =0A= @@ -366,6 +394,7 @@=0A= case IWN_RX_PHY: return "RX_PHY";=0A= case IWN_MPDU_RX_DONE: return "MPDU_RX_DONE";=0A= case IWN_RX_DONE: return "RX_DONE";=0A= + case IWN_TEMP_NOTIFICATION: return "TEMPERATURE_NOTIFICATION";=0A= =0A= /* Command Notifications */=0A= case IWN_CMD_RXON: return "IWN_CMD_RXON";=0A= @@ -388,6 +417,21 @@=0A= case IWN_CMD_SET_CRITICAL_TEMP: return "IWN_CMD_SET_CRITICAL_TEMP";=0A= case IWN_CMD_SET_SENSITIVITY: return "IWN_CMD_SET_SENSITIVITY";=0A= case IWN_CMD_PHY_CALIB: return "IWN_CMD_PHY_CALIB";=0A= + case IWN_CMD_BT_COEX_PRIOTABLE: return "IWN_CMD_BT_COEX_PRIOTABLE";=0A= + case IWN_CMD_BT_COEX_PROT: return "IWN_CMD_BT_COEX_PROT";=0A= + case IWN_CMD_BT_COEX_NOTIF: return "IWN_CMD_BT_COEX_NOTIF";=0A= + /* PAN commands */=0A= + case IWN_CMD_WIPAN_PARAMS: return "IWN_CMD_WIPAN_PARAMS"; =0A= + case IWN_CMD_WIPAN_RXON: return "IWN_CMD_WIPAN_RXON"; =0A= + case IWN_CMD_WIPAN_RXON_TIMING: return "IWN_CMD_WIPAN_RXON_TIMING"; =0A= + case IWN_CMD_WIPAN_RXON_ASSOC: return "IWN_CMD_WIPAN_RXON_ASSOC"; =0A= + case IWN_CMD_WIPAN_QOS_PARAM: return "IWN_CMD_WIPAN_QOS_PARAM";=0A= + case IWN_CMD_WIPAN_WEPKEY: return "IWN_CMD_WIPAN_WEPKEY"; =0A= + case IWN_CMD_WIPAN_P2P_CHANNEL_SWITCH: return = "IWN_CMD_WIPAN_P2P_CHANNEL_SWITCH";=0A= + case IWN_CMD_WIPAN_NOA_NOTIFICATION: return = "IWN_CMD_WIPAN_NOA_NOTIFICATION"; =0A= + case IWN_CMD_WIPAN_DEACTIVATION_COMPLETE: return = "IWN_CMD_WIPAN_DEACTIVATION_COMPLETE";=0A= +=0A= +=0A= }=0A= return "UNKNOWN INTR NOTIF/CMD";=0A= }=0A= @@ -421,6 +465,7 @@=0A= MODULE_DEPEND(iwn, pci, 1, 1, 1);=0A= MODULE_DEPEND(iwn, wlan, 1, 1, 1);=0A= =0A= +/* Should be better to add subdevice dependency*/=0A= static int=0A= iwn_probe(device_t dev)=0A= {=0A= @@ -436,6 +481,7 @@=0A= return ENXIO;=0A= }=0A= =0A= +/* Here we detect chipset */=0A= static int=0A= iwn_attach(device_t dev)=0A= {=0A= @@ -446,8 +492,12 @@=0A= int i, error, result;=0A= uint8_t macaddr[IEEE80211_ADDR_LEN];=0A= =0A= + sc->desired_pwrsave_level =3D IWN_POWERSAVE_LVL_DEFAULT;=0A= + sc->current_pwrsave_level =3D -1; /* signifies uninitialized */=0A= +=0A= + =0A= sc->sc_dev =3D dev;=0A= -=0A= + =0A= #ifdef IWN_DEBUG=0A= error =3D resource_int_value(device_get_name(sc->sc_dev),=0A= device_get_unit(sc->sc_dev), "debug", &(sc->sc_debug));=0A= @@ -456,9 +506,9 @@=0A= #else=0A= sc->sc_debug =3D 0;=0A= #endif=0A= + =0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_RESET, "->%s: begin\n",__func__);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: begin\n",__func__);=0A= -=0A= /*=0A= * Get the offset of the PCI Express Capability Structure in PCI=0A= * Configuration Space.=0A= @@ -511,7 +561,8 @@=0A= IWN_LOCK_INIT(sc);=0A= =0A= /* Read hardware revision and attach. */=0A= - sc->hw_type =3D (IWN_READ(sc, IWN_HW_REV) >> 4) & 0xf;=0A= + sc->hw_type =3D (IWN_READ(sc, IWN_HW_REV) >> 4) & 0xff;=0A= + sc->subdevice_id=3Dpci_get_subdevice(dev);=0A= if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_4965)=0A= error =3D iwn4965_attach(sc, pci_get_device(dev));=0A= else=0A= @@ -603,6 +654,11 @@=0A= | IEEE80211_C_WME /* WME */=0A= | IEEE80211_C_PMGT /* Station-side power mgmt */=0A= ;=0A= + if (sc->base_params->support_hostap) {=0A= + ic->ic_caps |=3D IEEE80211_C_HOSTAP ;/* HOSTAP mode supported */=0A= + } else {=0A= + ic->ic_caps &=3D ~ IEEE80211_C_HOSTAP ; /* HOSTAP mode not supported = */=0A= + }=0A= =0A= /* Read MAC address, channels, etc from EEPROM. */=0A= if ((error =3D iwn_read_eeprom(sc, macaddr)) !=3D 0) {=0A= @@ -686,14 +742,24 @@=0A= ic->ic_scan_mindwell =3D iwn_scan_mindwell;=0A= ic->ic_setregdomain =3D iwn_setregdomain;=0A= =0A= + sc->sc_led.led_cur_mode =3D IWN_LED_STATIC_OFF;=0A= + sc->sc_led.led_cur_tpt =3D 0;=0A= + sc->sc_led.led_last_tpt =3D 0;=0A= + sc->sc_led.led_cur_time =3D 0;=0A= + sc->sc_led.led_last_time =3D 0;=0A= +=0A= + =0A= + =0A= iwn_radiotap_attach(sc);=0A= =0A= callout_init_mtx(&sc->calib_to, &sc->sc_mtx, 0);=0A= callout_init_mtx(&sc->watchdog_to, &sc->sc_mtx, 0);=0A= + callout_init_mtx(&sc->ct_kill_exit_to, &sc->sc_mtx, 0);=0A= TASK_INIT(&sc->sc_reinit_task, 0, iwn_hw_reset, sc);=0A= TASK_INIT(&sc->sc_radioon_task, 0, iwn_radio_on, sc);=0A= TASK_INIT(&sc->sc_radiooff_task, 0, iwn_radio_off, sc);=0A= =0A= + =0A= iwn_sysctlattach(sc);=0A= =0A= /*=0A= @@ -706,14 +772,21 @@=0A= error);=0A= goto fail;=0A= }=0A= + /* update ic->ic_flags to the default power save mode */=0A= + if (IWN_POWERSAVE_LVL_DEFAULT !=3D IWN_POWERSAVE_LVL_NONE)=0A= + ic->ic_flags |=3D IEEE80211_F_PMGTON;=0A= + else=0A= + ic->ic_flags &=3D ~IEEE80211_F_PMGTON;=0A= =0A= +=0A= if (bootverbose)=0A= ieee80211_announce(ic);=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s: end\n",__func__);=0A= return 0;=0A= fail:=0A= iwn_detach(dev);=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET | IWN_DEBUG_FATAL,=0A= + "->%s: end in error\n",__func__);=0A= return error;=0A= }=0A= =0A= @@ -722,7 +795,8 @@=0A= {=0A= struct iwn_ops *ops =3D &sc->ops;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= +=0A= ops->load_firmware =3D iwn4965_load_firmware;=0A= ops->read_eeprom =3D iwn4965_read_eeprom;=0A= ops->post_alive =3D iwn4965_post_alive;=0A= @@ -752,9 +826,10 @@=0A= /* Override chains masks, ROM is known to be broken. */=0A= sc->txchainmask =3D IWN_ANT_AB;=0A= sc->rxchainmask =3D IWN_ANT_ABC;=0A= + sc->base_params =3D &iwn_default_base_params; /* !! TODO : Define = something may be more specific */=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "%s: end\n",__func__);=0A= -=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "%s: end\n",__func__);=0A= + =0A= return 0;=0A= }=0A= =0A= @@ -762,9 +837,9 @@=0A= iwn5000_attach(struct iwn_softc *sc, uint16_t pid)=0A= {=0A= struct iwn_ops *ops =3D &sc->ops;=0A= + =0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= -=0A= ops->load_firmware =3D iwn5000_load_firmware;=0A= ops->read_eeprom =3D iwn5000_read_eeprom;=0A= ops->post_alive =3D iwn5000_post_alive;=0A= @@ -792,59 +867,7 @@=0A= sc->reset_noise_gain =3D IWN5000_PHY_CALIB_RESET_NOISE_GAIN;=0A= sc->noise_gain =3D IWN5000_PHY_CALIB_NOISE_GAIN;=0A= =0A= - switch (sc->hw_type) {=0A= - case IWN_HW_REV_TYPE_5100:=0A= - sc->limits =3D &iwn5000_sensitivity_limits;=0A= - sc->fwname =3D "iwn5000fw";=0A= - /* Override chains masks, ROM is known to be broken. */=0A= - sc->txchainmask =3D IWN_ANT_B;=0A= - sc->rxchainmask =3D IWN_ANT_AB;=0A= - break;=0A= - case IWN_HW_REV_TYPE_5150:=0A= - sc->limits =3D &iwn5150_sensitivity_limits;=0A= - sc->fwname =3D "iwn5150fw";=0A= - break;=0A= - case IWN_HW_REV_TYPE_5300:=0A= - case IWN_HW_REV_TYPE_5350:=0A= - sc->limits =3D &iwn5000_sensitivity_limits;=0A= - sc->fwname =3D "iwn5000fw";=0A= - break;=0A= - case IWN_HW_REV_TYPE_1000:=0A= - sc->limits =3D &iwn1000_sensitivity_limits;=0A= - sc->fwname =3D "iwn1000fw";=0A= - break;=0A= - case IWN_HW_REV_TYPE_6000:=0A= - sc->limits =3D &iwn6000_sensitivity_limits;=0A= - sc->fwname =3D "iwn6000fw";=0A= - if (pid =3D=3D 0x422c || pid =3D=3D 0x4239) {=0A= - sc->sc_flags |=3D IWN_FLAG_INTERNAL_PA;=0A= - /* Override chains masks, ROM is known to be broken. */=0A= - sc->txchainmask =3D IWN_ANT_BC;=0A= - sc->rxchainmask =3D IWN_ANT_BC;=0A= - }=0A= - break;=0A= - case IWN_HW_REV_TYPE_6050:=0A= - sc->limits =3D &iwn6000_sensitivity_limits;=0A= - sc->fwname =3D "iwn6050fw";=0A= - /* Override chains masks, ROM is known to be broken. */=0A= - sc->txchainmask =3D IWN_ANT_AB;=0A= - sc->rxchainmask =3D IWN_ANT_AB;=0A= - break;=0A= - case IWN_HW_REV_TYPE_6005:=0A= - sc->limits =3D &iwn6000_sensitivity_limits;=0A= - if (pid !=3D 0x0082 && pid !=3D 0x0085) {=0A= - sc->fwname =3D "iwn6000g2bfw";=0A= - sc->sc_flags |=3D IWN_FLAG_ADV_BTCOEX;=0A= - } else=0A= - sc->fwname =3D "iwn6000g2afw";=0A= - break;=0A= - default:=0A= - device_printf(sc->sc_dev, "adapter type %d not supported\n",=0A= - sc->hw_type);=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__);=0A= - return ENOTSUP;=0A= - }=0A= - return 0;=0A= + return iwn_config_specific(sc,pid);=0A= }=0A= =0A= /*=0A= @@ -855,15 +878,19 @@=0A= {=0A= struct ifnet *ifp =3D sc->sc_ifp;=0A= struct ieee80211com *ic =3D ifp->if_l2com;=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= +=0A= ieee80211_radiotap_attach(ic,=0A= &sc->sc_txtap.wt_ihdr, sizeof(sc->sc_txtap),=0A= IWN_TX_RADIOTAP_PRESENT,=0A= &sc->sc_rxtap.wr_ihdr, sizeof(sc->sc_rxtap),=0A= IWN_RX_RADIOTAP_PRESENT);=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= -}=0A= =0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", = __func__);=0A= +=0A= + }=0A= +=0A= static void=0A= iwn_sysctlattach(struct iwn_softc *sc)=0A= {=0A= @@ -885,19 +912,54 @@=0A= {=0A= struct iwn_vap *ivp;=0A= struct ieee80211vap *vap;=0A= + uint8_t mac1[IEEE80211_ADDR_LEN];=0A= + struct iwn_softc *sc =3D ic->ic_ifp->if_softc;=0A= =0A= - if (!TAILQ_EMPTY(&ic->ic_vaps)) /* only one at a time */=0A= - return NULL;=0A= + =0A= + if (sc->base_params->no_multi_vaps) {=0A= + if (!TAILQ_EMPTY(&ic->ic_vaps)) /* only one at a time */=0A= + return NULL;=0A= + }=0A= + =0A= + IEEE80211_ADDR_COPY(mac1, mac);=0A= + =0A= + if(unit =3D=3D 1) {=0A= + if(!(sc->sc_flags & IWN_FLAG_PAN_SUPPORT))=0A= + return NULL;=0A= + mac1[5] +=3D 1;=0A= + sc->ctx =3D IWN_RXON_PAN_CTX;=0A= + }=0A= +=0A= ivp =3D (struct iwn_vap *) malloc(sizeof(struct iwn_vap),=0A= M_80211_VAP, M_NOWAIT | M_ZERO);=0A= if (ivp =3D=3D NULL)=0A= return NULL;=0A= vap =3D &ivp->iv_vap;=0A= - ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac);=0A= + =0A= + ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac1);=0A= +=0A= + if(unit =3D=3D 1) {=0A= + ivp->ctx =3D IWN_RXON_PAN_CTX;=0A= + ivp->iv_newstate =3D vap->iv_newstate;=0A= + vap->iv_newstate =3D iwn_newstate_u1;=0A= + IEEE80211_ADDR_COPY(ivp->macaddr, mac1);=0A= + memset(&sc->rx_on[IWN_RXON_PAN_CTX], 0, sizeof (struct iwn_rxon));=0A= + memcpy(&sc->rx_on[IWN_RXON_PAN_CTX], &sc->rx_on[IWN_RXON_BSS_CTX], = sc->rxonsz);=0A= + IEEE80211_ADDR_COPY(sc->rx_on[IWN_RXON_PAN_CTX].myaddr, mac1);=0A= + sc->rx_on[IWN_RXON_PAN_CTX].mode =3D IWN_MODE_2STA;=0A= + sc->ivap[IWN_RXON_PAN_CTX] =3D vap;=0A= + }=0A= + else {=0A= + ivp->ctx =3D IWN_RXON_BSS_CTX;=0A= + IEEE80211_ADDR_COPY(ivp->macaddr, mac1);=0A= + ivp->iv_newstate =3D vap->iv_newstate;=0A= + vap->iv_newstate =3D iwn_newstate;=0A= + sc->ivap[IWN_RXON_BSS_CTX] =3D vap;=0A= + }=0A= + =0A= vap->iv_bmissthreshold =3D 10; /* override default */=0A= - /* Override with driver methods. */=0A= - ivp->iv_newstate =3D vap->iv_newstate;=0A= - vap->iv_newstate =3D iwn_newstate;=0A= + /* handler for setting change (partial 're'set) requested via ioctl */=0A= + vap->iv_reset =3D iwn_iv_reset;=0A= =0A= ieee80211_ratectl_init(vap);=0A= /* Complete setup. */=0A= @@ -910,7 +972,12 @@=0A= iwn_vap_delete(struct ieee80211vap *vap)=0A= {=0A= struct iwn_vap *ivp =3D IWN_VAP(vap);=0A= + struct iwn_softc *sc =3D vap->iv_ic->ic_ifp->if_softc;=0A= =0A= + if(ivp->ctx =3D=3D IWN_RXON_PAN_CTX)=0A= + sc->ctx =3D 0;=0A= + =0A= + =0A= ieee80211_ratectl_deinit(vap);=0A= ieee80211_vap_detach(vap);=0A= free(ivp, M_80211_VAP);=0A= @@ -924,6 +991,8 @@=0A= struct ieee80211com *ic;=0A= int qid;=0A= =0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= +=0A= if (ifp !=3D NULL) {=0A= ic =3D ifp->if_l2com;=0A= =0A= @@ -933,6 +1002,7 @@=0A= =0A= iwn_stop(sc);=0A= callout_drain(&sc->watchdog_to);=0A= + callout_drain(&sc->ct_kill_exit_to);=0A= callout_drain(&sc->calib_to);=0A= ieee80211_ifdetach(ic);=0A= }=0A= @@ -961,7 +1031,8 @@=0A= if (ifp !=3D NULL)=0A= if_free(ifp);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s done\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s: end\n",__func__);=0A= +=0A= IWN_LOCK_DESTROY(sc);=0A= return 0;=0A= }=0A= @@ -980,8 +1051,15 @@=0A= {=0A= struct iwn_softc *sc =3D device_get_softc(dev);=0A= struct ieee80211com *ic =3D sc->sc_ifp->if_l2com;=0A= + struct ieee80211vap *vap =3D TAILQ_FIRST(&ic->ic_vaps);=0A= =0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing = %s\n",__func__);=0A= +=0A= ieee80211_suspend_all(ic);=0A= + iwn_stop(sc);=0A= + if (vap !=3D NULL)=0A= + ieee80211_stop(vap);=0A= +=0A= return 0;=0A= }=0A= =0A= @@ -989,12 +1067,23 @@=0A= iwn_resume(device_t dev)=0A= {=0A= struct iwn_softc *sc =3D device_get_softc(dev);=0A= - struct ieee80211com *ic =3D sc->sc_ifp->if_l2com;=0A= + struct ifnet *ifp =3D sc->sc_ifp;=0A= + struct ieee80211com *ic =3D ifp->if_l2com;=0A= + struct ieee80211vap *vap =3D TAILQ_FIRST(&ic->ic_vaps);=0A= =0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s\n", = __func__);=0A= /* Clear device-specific "PCI retry timeout" register (41h). */=0A= pci_write_config(dev, 0x41, 0, 1);=0A= =0A= ieee80211_resume_all(ic);=0A= + if (ifp->if_flags & IFF_UP) {=0A= + iwn_init(sc);=0A= + if (vap !=3D NULL)=0A= + ieee80211_init(vap);=0A= + if (ifp->if_drv_flags & IFF_DRV_RUNNING)=0A= + iwn_start(ifp);=0A= + }=0A= +=0A= return 0;=0A= }=0A= =0A= @@ -1002,7 +1091,7 @@=0A= iwn_nic_lock(struct iwn_softc *sc)=0A= {=0A= int ntries;=0A= -=0A= + =0A= /* Request exclusive access to NIC. */=0A= IWN_SETBITS(sc, IWN_GP_CNTRL, IWN_GP_CNTRL_MAC_ACCESS_REQ);=0A= =0A= @@ -1011,9 +1100,11 @@=0A= if ((IWN_READ(sc, IWN_GP_CNTRL) &=0A= (IWN_GP_CNTRL_MAC_ACCESS_ENA | IWN_GP_CNTRL_SLEEP)) =3D=3D=0A= IWN_GP_CNTRL_MAC_ACCESS_ENA)=0A= - return 0;=0A= + return 0;=0A= DELAY(10);=0A= }=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_FATAL, "->%s timeout\n", = __func__);=0A= +=0A= return ETIMEDOUT;=0A= }=0A= =0A= @@ -1122,7 +1213,7 @@=0A= DELAY(10);=0A= }=0A= }=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end timeout\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_FATAL, "->%s end timeout\n", = __func__);=0A= return ETIMEDOUT;=0A= }=0A= =0A= @@ -1142,8 +1233,8 @@=0A= uint16_t prev, base, next;=0A= int count, error;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= -=0A= + DPRINTF(sc, IWN_DEBUG_TRACE| IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= + =0A= /* Wait for clock stabilization before accessing prph. */=0A= if ((error =3D iwn_clock_wait(sc)) !=3D 0)=0A= return error;=0A= @@ -1156,7 +1247,7 @@=0A= iwn_nic_unlock(sc);=0A= =0A= /* Set auto clock gate disable bit for HW with OTP shadow RAM. */=0A= - if (sc->hw_type !=3D IWN_HW_REV_TYPE_1000) {=0A= + if (sc->base_params->shadow_ram_support) {=0A= IWN_SETBITS(sc, IWN_DBG_LINK_PWR_MGMT,=0A= IWN_RESET_LINK_PWR_MGMT_DIS);=0A= }=0A= @@ -1169,11 +1260,11 @@=0A= * Find the block before last block (contains the EEPROM image)=0A= * for HW without OTP shadow RAM.=0A= */=0A= - if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_1000) {=0A= + if (!(sc->base_params->shadow_ram_support)) {=0A= /* Switch to absolute addressing mode. */=0A= IWN_CLRBITS(sc, IWN_OTP_GP, IWN_OTP_GP_RELATIVE_ACCESS);=0A= base =3D prev =3D 0;=0A= - for (count =3D 0; count < IWN1000_OTP_NBLOCKS; count++) {=0A= + for (count =3D 0; count < sc->base_params->max_ll_items; count++) {=0A= error =3D iwn_read_prom_data(sc, base, &next, 2);=0A= if (error !=3D 0)=0A= return error;=0A= @@ -1182,14 +1273,12 @@=0A= prev =3D base;=0A= base =3D le16toh(next);=0A= }=0A= - if (count =3D=3D 0 || count =3D=3D IWN1000_OTP_NBLOCKS)=0A= + if (count =3D=3D 0 || count =3D=3D sc->base_params->max_ll_items)=0A= return EIO;=0A= /* Skip "next" word. */=0A= sc->prom_base =3D prev + 1;=0A= }=0A= -=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= -=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= return 0;=0A= }=0A= =0A= @@ -1200,7 +1289,7 @@=0A= uint32_t val, tmp;=0A= int ntries;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= addr +=3D sc->prom_base;=0A= for (; count > 0; count -=3D 2, addr++) {=0A= @@ -1235,7 +1324,7 @@=0A= *out++ =3D val >> 24;=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= =0A= return 0;=0A= }=0A= @@ -1293,7 +1382,7 @@=0A= bus_dmamap_sync(dma->tag, dma->map,=0A= BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);=0A= bus_dmamap_unload(dma->tag, dma->map);=0A= - bus_dmamem_free(dma->tag, dma->vaddr, dma->map);=0A= + bus_dmamem_free(dma->tag, &dma->vaddr, dma->map);=0A= dma->vaddr =3D NULL;=0A= }=0A= bus_dmamap_destroy(dma->tag, dma->map);=0A= @@ -1367,7 +1456,7 @@=0A= =0A= ring->cur =3D 0;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= /* Allocate RX descriptors (256-byte aligned). */=0A= size =3D IWN_RX_RING_COUNT * sizeof (uint32_t);=0A= @@ -1417,7 +1506,7 @@=0A= goto fail;=0A= }=0A= =0A= - data->m =3D m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR,=0A= + data->m =3D m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR,=0A= IWN_RBUF_SIZE);=0A= if (data->m =3D=3D NULL) {=0A= device_printf(sc->sc_dev,=0A= @@ -1443,13 +1532,13 @@=0A= bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map,=0A= BUS_DMASYNC_PREWRITE);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s: end\n",__func__);=0A= =0A= return 0;=0A= =0A= fail: iwn_free_rx_ring(sc, ring);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s: end in = error\n",__func__);=0A= =0A= return error;=0A= }=0A= @@ -1459,7 +1548,7 @@=0A= {=0A= int ntries;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s\n", = __func__);=0A= =0A= if (iwn_nic_lock(sc) =3D=3D 0) {=0A= IWN_WRITE(sc, IWN_FH_RX_CONFIG, 0);=0A= @@ -1480,7 +1569,7 @@=0A= {=0A= int i;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s \n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s \n", = __func__);=0A= =0A= iwn_dma_contig_free(&ring->desc_dma);=0A= iwn_dma_contig_free(&ring->stat_dma);=0A= @@ -1515,7 +1604,7 @@=0A= ring->queued =3D 0;=0A= ring->cur =3D 0;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= /* Allocate TX descriptors (256-byte aligned). */=0A= size =3D IWN_TX_RING_COUNT * sizeof (struct iwn_tx_desc);=0A= @@ -1566,12 +1655,12 @@=0A= }=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= =0A= return 0;=0A= =0A= fail: iwn_free_tx_ring(sc, ring);=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end in error\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end in error\n", = __func__);=0A= return error;=0A= }=0A= =0A= @@ -1580,7 +1669,7 @@=0A= {=0A= int i;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->doing %s \n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->doing %s \n", = __func__);=0A= =0A= for (i =3D 0; i < IWN_TX_RING_COUNT; i++) {=0A= struct iwn_tx_data *data =3D &ring->data[i];=0A= @@ -1607,7 +1696,7 @@=0A= {=0A= int i;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s \n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s \n", = __func__);=0A= =0A= iwn_dma_contig_free(&ring->desc_dma);=0A= iwn_dma_contig_free(&ring->cmd_dma);=0A= @@ -1633,6 +1722,9 @@=0A= static void=0A= iwn5000_ict_reset(struct iwn_softc *sc)=0A= {=0A= + =0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= + =0A= /* Disable interrupts. */=0A= IWN_WRITE(sc, IWN_INT_MASK, 0);=0A= =0A= @@ -1653,6 +1745,9 @@=0A= /* Re-enable interrupts. */=0A= IWN_WRITE(sc, IWN_INT, 0xffffffff);=0A= IWN_WRITE(sc, IWN_INT_MASK, sc->int_mask);=0A= + =0A= + =0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= }=0A= =0A= static int=0A= @@ -1662,8 +1757,8 @@=0A= uint16_t val;=0A= int error;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= -=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= + =0A= /* Check whether adapter has an EEPROM or an OTPROM. */=0A= if (sc->hw_type >=3D IWN_HW_REV_TYPE_1000 &&=0A= (IWN_READ(sc, IWN_OTP_GP) & IWN_OTP_GP_DEV_SEL_OTP))=0A= @@ -1698,6 +1793,7 @@=0A= }=0A= =0A= iwn_read_prom_data(sc, IWN_EEPROM_SKU_CAP, &val, 2);=0A= + =0A= DPRINTF(sc, IWN_DEBUG_RESET, "SKU capabilities=3D0x%04x\n", = le16toh(val));=0A= /* Check if HT support is bonded out. */=0A= if (val & htole16(IWN_EEPROM_SKU_CAP_11N))=0A= @@ -1722,8 +1818,8 @@=0A= =0A= iwn_eeprom_unlock(sc);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= -=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= + =0A= return 0;=0A= }=0A= =0A= @@ -1734,7 +1830,7 @@=0A= uint16_t val;=0A= int i;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= /* Read regulatory domain (4 ASCII characters). */=0A= iwn_read_prom_data(sc, IWN4965_EEPROM_DOMAIN, sc->eeprom_domain, 4);=0A= @@ -1775,7 +1871,7 @@=0A= }=0A= #endif=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= }=0A= =0A= #ifdef IWN_DEBUG=0A= @@ -1818,12 +1914,11 @@=0A= {=0A= struct iwn5000_eeprom_calib_hdr hdr;=0A= int32_t volt;=0A= - uint32_t base, addr;=0A= + uint32_t base;=0A= uint16_t val;=0A= int i;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= -=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= /* Read regulatory domain (4 ASCII characters). */=0A= iwn_read_prom_data(sc, IWN5000_EEPROM_REG, &val, 2);=0A= base =3D le16toh(val);=0A= @@ -1831,16 +1926,12 @@=0A= sc->eeprom_domain, 4);=0A= =0A= /* Read the list of authorized channels (20MHz ones only). */=0A= - for (i =3D 0; i < 7; i++) {=0A= - if (sc->hw_type >=3D IWN_HW_REV_TYPE_6000)=0A= - addr =3D base + iwn6000_regulatory_bands[i];=0A= - else=0A= - addr =3D base + iwn5000_regulatory_bands[i];=0A= - iwn_read_eeprom_channels(sc, i, addr);=0A= + for (i =3D 0; i < (IWN_NBANDS - 1); i++) {=0A= + iwn_read_eeprom_channels(sc, i, = base+sc->base_params->regulatory_bands[i]);=0A= }=0A= =0A= /* Read enhanced TX power information for 6000 Series. */=0A= - if (sc->hw_type >=3D IWN_HW_REV_TYPE_6000)=0A= + if (sc->base_params->enhanced_TX_power)=0A= iwn_read_eeprom_enhinfo(sc);=0A= =0A= iwn_read_prom_data(sc, IWN5000_EEPROM_CAL, &val, 2);=0A= @@ -1850,6 +1941,14 @@=0A= "%s: calib version=3D%u pa type=3D%u voltage=3D%u\n", __func__,=0A= hdr.version, hdr.pa_type, le16toh(hdr.volt));=0A= sc->calib_ver =3D hdr.version;=0A= + =0A= + if (sc->base_params->calib_need & = IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSETv2) {=0A= + sc->eeprom_voltage =3D le16toh(hdr.volt);=0A= + iwn_read_prom_data(sc, base + IWN5000_EEPROM_TEMP, &val, 2);=0A= + sc->eeprom_temp_high=3Dle16toh(val);=0A= + iwn_read_prom_data(sc, base + IWN5000_EEPROM_VOLT, &val, 2);=0A= + sc->eeprom_temp =3D le16toh(val);=0A= + }=0A= =0A= if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_5150) {=0A= /* Compute temperature offset. */=0A= @@ -1867,9 +1966,8 @@=0A= DPRINTF(sc, IWN_DEBUG_CALIBRATE, "crystal calibration 0x%08x\n",=0A= le32toh(sc->eeprom_crystal));=0A= }=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= -=0A= }=0A= =0A= /*=0A= @@ -1905,7 +2003,7 @@=0A= uint8_t chan;=0A= int i, nflags;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= for (i =3D 0; i < band->nchan; i++) {=0A= if (!(channels[i].flags & IWN_EEPROM_CHAN_VALID)) {=0A= @@ -1950,7 +2048,7 @@=0A= }=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= =0A= }=0A= =0A= @@ -1967,8 +2065,8 @@=0A= =0A= DPRINTF(sc, IWN_DEBUG_TRACE, "->%s start\n", __func__);=0A= =0A= - if (!(sc->sc_flags & IWN_FLAG_HAS_11N)) {=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end no 11n\n", __func__);=0A= + if (!(sc->sc_flags & IWN_FLAG_HAS_11N)){=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end no 11n\n", = __func__);=0A= return;=0A= }=0A= =0A= @@ -2019,7 +2117,7 @@=0A= c->ic_flags |=3D IEEE80211_CHAN_HT40D | nflags;=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= =0A= }=0A= =0A= @@ -2104,7 +2202,7 @@=0A= uint8_t flags;=0A= int i, j;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= iwn_read_prom_data(sc, IWN5000_EEPROM_REG, &val, 2);=0A= base =3D le16toh(val);=0A= @@ -2157,7 +2255,7 @@=0A= }=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= =0A= }=0A= =0A= @@ -2230,12 +2328,12 @@=0A= /*=0A= * Set the channel width and guard interval.=0A= */=0A= - if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) {=0A= - plcp |=3D IWN_RFLAG_HT40;=0A= - if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40)=0A= + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) {=0A= + plcp |=3D IWN_RFLAG_HT40;=0A= + if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40)=0A= + plcp |=3D IWN_RFLAG_SGI;=0A= + } else if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) {=0A= plcp |=3D IWN_RFLAG_SGI;=0A= - } else if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) {=0A= - plcp |=3D IWN_RFLAG_SGI;=0A= }=0A= =0A= /*=0A= @@ -2245,9 +2343,9 @@=0A= * XXX three stream rates?=0A= */=0A= if (rate > 0x87)=0A= - plcp |=3D IWN_RFLAG_ANT(txant1 | txant2);=0A= - else=0A= - plcp |=3D IWN_RFLAG_ANT(txant1);=0A= + plcp |=3D IWN_RFLAG_ANT(txant1 | txant2);=0A= + else=0A= + plcp |=3D IWN_RFLAG_ANT(txant1);=0A= } else {=0A= /*=0A= * Set the initial PLCP - fine for both=0A= @@ -2264,13 +2362,13 @@=0A= */=0A= ridx =3D ieee80211_legacy_rate_lookup(ic->ic_rt,=0A= rate & IEEE80211_RATE_VAL);=0A= - if (ridx < IWN_RIDX_OFDM6 &&=0A= - IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))=0A= - plcp |=3D IWN_RFLAG_CCK;=0A= + if (ridx < IWN_RIDX_OFDM6 &&=0A= + IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))=0A= + plcp |=3D IWN_RFLAG_CCK;=0A= =0A= /* Set antenna configuration */=0A= - plcp |=3D IWN_RFLAG_ANT(txant1);=0A= - }=0A= + plcp |=3D IWN_RFLAG_ANT(txant1);=0A= + }=0A= =0A= DPRINTF(sc, IWN_DEBUG_TXRATE, "%s: rate=3D0x%02x, plcp=3D0x%08x\n",=0A= __func__,=0A= @@ -2305,8 +2403,7 @@=0A= struct iwn_softc *sc =3D ic->ic_ifp->if_softc;=0A= int error =3D 0;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= -=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_STATE, "->%s begin\n", = __func__);=0A= DPRINTF(sc, IWN_DEBUG_STATE, "%s: %s -> %s\n", __func__,=0A= ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate]);=0A= =0A= @@ -2313,6 +2410,8 @@=0A= IEEE80211_UNLOCK(ic);=0A= IWN_LOCK(sc);=0A= callout_stop(&sc->calib_to);=0A= + =0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A= =0A= switch (nstate) {=0A= case IEEE80211_S_ASSOC:=0A= @@ -2327,8 +2426,8 @@=0A= * !AUTH -> AUTH transition requires state reset to handle=0A= * reassociations correctly.=0A= */=0A= - sc->rxon.associd =3D 0;=0A= - sc->rxon.filter &=3D ~htole32(IWN_FILTER_BSS);=0A= + sc->rxon->associd =3D 0;=0A= + sc->rxon->filter &=3D ~htole32(IWN_FILTER_BSS);=0A= sc->calib.state =3D IWN_CALIB_STATE_INIT;=0A= =0A= if ((error =3D iwn_auth(sc, vap)) !=3D 0) {=0A= @@ -2367,11 +2466,11 @@=0A= IWN_UNLOCK(sc);=0A= IEEE80211_LOCK(ic);=0A= if (error !=3D 0){=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end in error\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_STATE, "->%s end in error\n", = __func__);=0A= return error;=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_STATE, "->%s: end\n",__func__);=0A= =0A= return ivp->iv_newstate(vap, nstate, arg);=0A= }=0A= @@ -2385,12 +2484,7 @@=0A= =0A= /* Force automatic TX power calibration every 60 secs. */=0A= if (++sc->calib_cnt >=3D 120) {=0A= - uint32_t flags =3D 0;=0A= -=0A= - DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s\n",=0A= - "sending request for statistics");=0A= - (void)iwn_cmd(sc, IWN_CMD_GET_STATISTICS, &flags,=0A= - sizeof flags, 1);=0A= + iwn_set_statistics_request(sc,true,false,1);=0A= sc->calib_cnt =3D 0;=0A= }=0A= callout_reset(&sc->calib_to, msecs_to_ticks(500), iwn_calib_timeout,=0A= @@ -2436,7 +2530,7 @@=0A= uint32_t flags;=0A= int error, len, rssi, nf;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RECV, "->%s begin\n", = __func__);=0A= =0A= if (desc->type =3D=3D IWN_MPDU_RX_DONE) {=0A= /* Check for prior RX_PHY notification. */=0A= @@ -2483,7 +2577,7 @@=0A= return;=0A= }=0A= =0A= - m1 =3D m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, IWN_RBUF_SIZE);=0A= + m1 =3D m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, IWN_RBUF_SIZE);=0A= if (m1 =3D=3D NULL) {=0A= DPRINTF(sc, IWN_DEBUG_ANY, "%s: no mbuf to restock ring\n",=0A= __func__);=0A= @@ -2577,7 +2671,7 @@=0A= =0A= IWN_LOCK(sc);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RECV, "->%s: end\n",__func__);=0A= =0A= }=0A= =0A= @@ -2600,7 +2694,7 @@=0A= uint8_t tid;=0A= int ackfailcnt =3D 0, i, lastidx, qid, *res, shift;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RECV, "->%s begin\n", = __func__);=0A= =0A= bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD);=0A= =0A= @@ -2674,7 +2768,7 @@=0A= bitmap >>=3D 1;=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RECV, "->%s: end\n",__func__);=0A= =0A= }=0A= =0A= @@ -2689,11 +2783,10 @@=0A= struct iwn_phy_calib *calib =3D (struct iwn_phy_calib *)(desc + 1);=0A= int len, idx =3D -1;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= -=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s begin\n", = __func__);=0A= /* Runtime firmware should not send such a notification. */=0A= if (sc->sc_flags & IWN_FLAG_CALIB_DONE){=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s received after clib done\n",=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s received = after clib done\n",=0A= __func__);=0A= return;=0A= }=0A= @@ -2702,29 +2795,30 @@=0A= =0A= switch (calib->code) {=0A= case IWN5000_PHY_CALIB_DC:=0A= - if ((sc->sc_flags & IWN_FLAG_INTERNAL_PA) =3D=3D 0 &&=0A= - (sc->hw_type =3D=3D IWN_HW_REV_TYPE_5150 ||=0A= - sc->hw_type >=3D IWN_HW_REV_TYPE_6000) &&=0A= - sc->hw_type !=3D IWN_HW_REV_TYPE_6050)=0A= + if (sc->base_params->calib_need & IWN_FLG_NEED_PHY_CALIB_DC)=0A= idx =3D 0;=0A= break;=0A= case IWN5000_PHY_CALIB_LO:=0A= - idx =3D 1;=0A= + if (sc->base_params->calib_need & IWN_FLG_NEED_PHY_CALIB_LO)=0A= + idx =3D 1;=0A= break;=0A= case IWN5000_PHY_CALIB_TX_IQ:=0A= - idx =3D 2;=0A= + if (sc->base_params->calib_need & IWN_FLG_NEED_PHY_CALIB_TX_IQ)=0A= + idx =3D 2;=0A= break;=0A= case IWN5000_PHY_CALIB_TX_IQ_PERIODIC:=0A= - if (sc->hw_type < IWN_HW_REV_TYPE_6000 &&=0A= - sc->hw_type !=3D IWN_HW_REV_TYPE_5150)=0A= + if (sc->base_params->calib_need & = IWN_FLG_NEED_PHY_CALIB_TX_IQ_PERIODIC)=0A= idx =3D 3;=0A= break;=0A= case IWN5000_PHY_CALIB_BASE_BAND:=0A= - idx =3D 4;=0A= + if (sc->base_params->calib_need & IWN_FLG_NEED_PHY_CALIB_BASE_BAND)=0A= + idx =3D 4;=0A= break;=0A= }=0A= - if (idx =3D=3D -1) /* Ignore other results. */=0A= + if (idx =3D=3D -1) { /* Ignore other results. */=0A= + DPRINTF(sc,IWN_DEBUG_CALIBRATE,"Ignoring calib result = %d",calib->code);=0A= return;=0A= + }=0A= =0A= /* Save calibration result. */=0A= if (sc->calibcmd[idx].buf !=3D NULL)=0A= @@ -2740,6 +2834,7 @@=0A= "saving calibration result code=3D%d len=3D%d\n", calib->code, = len);=0A= sc->calibcmd[idx].len =3D len;=0A= memcpy(sc->calibcmd[idx].buf, calib, len);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s end\n", = __func__);=0A= }=0A= =0A= /*=0A= @@ -2756,18 +2851,60 @@=0A= struct ieee80211vap *vap =3D TAILQ_FIRST(&ic->ic_vaps);=0A= struct iwn_calib_state *calib =3D &sc->calib;=0A= struct iwn_stats *stats =3D (struct iwn_stats *)(desc + 1);=0A= + struct ieee80211_node *ni =3D vap->iv_bss;=0A= + struct ieee80211_nodestats ns =3D ni->ni_stats;=0A= + struct bintime bt;=0A= +=0A= + struct ieee80211vap *vap1;=0A= +=0A= int temp;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s begin\n", = __func__);=0A= =0A= /* Ignore statistics received during a scan. */=0A= if (vap->iv_state !=3D IEEE80211_S_RUN ||=0A= (ic->ic_flags & IEEE80211_F_SCAN)){=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s received during calib\n",=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s received = during calib\n",=0A= __func__);=0A= return;=0A= }=0A= + if(sc->ctx =3D=3D IWN_RXON_PAN_CTX) {=0A= + vap1 =3D sc->ivap[IWN_RXON_PAN_CTX];=0A= + /* Ignore statistics received during a scan. */=0A= + if (vap1->iv_state !=3D IEEE80211_S_RUN ||=0A= + (ic->ic_flags & IEEE80211_F_SCAN))=0A= + return;=0A= + }=0A= =0A= + getbinuptime(&bt);=0A= + sc->sc_led.led_cur_time =3D bt.sec;=0A= + int time_diff =3D (sc->sc_led.led_cur_time - sc->sc_led.led_last_time);=0A= +=0A= + if(time_diff >=3D 4) {=0A= + if(vap->iv_state =3D=3D IEEE80211_S_RUN) {=0A= + sc->sc_led.led_cur_bt =3D (ns.ns_rx_bytes + ns.ns_tx_bytes);=0A= + if(sc->sc_led.led_cur_bt < sc->sc_led.led_last_bt) {=0A= + sc->sc_led.led_cur_bt =3D 0;=0A= + sc->sc_led.led_last_bt =3D 0;=0A= + }=0A= + sc->sc_led.led_bt_diff =3D (sc->sc_led.led_cur_bt - = sc->sc_led.led_last_bt);=0A= + sc->sc_led.led_last_bt =3D sc->sc_led.led_cur_bt;=0A= + sc->sc_led.led_cur_tpt =3D (sc->sc_led.led_bt_diff / time_diff);=0A= + sc->sc_led.led_last_time =3D sc->sc_led.led_cur_time;=0A= +=0A= + if(sc->sc_led.led_cur_tpt > 0) {=0A= + sc->sc_led.led_cur_mode =3D IWN_LED_INT_BLINK;=0A= + iwn_led_pattern(sc);=0A= + } else {=0A= + sc->sc_led.led_cur_mode =3D IWN_LED_STATIC_ON;=0A= + iwn_set_led(sc, IWN_LED_LINK, 0, 1, IWN_LED_STATIC_ON);=0A= + }=0A= +=0A= + sc->sc_led.led_last_tpt =3D sc->sc_led.led_cur_tpt;=0A= + }=0A= + }=0A= +=0A= + =0A= bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD);=0A= =0A= DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: received statistics, cmd %d\n",=0A= @@ -2805,7 +2942,7 @@=0A= else if (calib->state =3D=3D IWN_CALIB_STATE_RUN)=0A= iwn_tune_sensitivity(sc, &stats->rx);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s: = end\n",__func__);=0A= }=0A= =0A= /*=0A= @@ -2881,21 +3018,38 @@=0A= struct ifnet *ifp =3D sc->sc_ifp;=0A= struct iwn_tx_ring *ring =3D &sc->txq[desc->qid & 0xf];=0A= struct iwn_tx_data *data =3D &ring->data[desc->idx];=0A= + =0A= + struct iwn_tx_cmd *cmd;=0A= + struct iwn_cmd_data *tx;=0A= +=0A= struct mbuf *m;=0A= struct ieee80211_node *ni;=0A= struct ieee80211vap *vap;=0A= + struct ieee80211_frame *wh;=0A= =0A= KASSERT(data->ni !=3D NULL, ("no node"));=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s begin\n", = __func__);=0A= =0A= /* Unmap and free mbuf. */=0A= + uint8_t ridx;=0A= bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTWRITE);=0A= bus_dmamap_unload(ring->data_dmat, data->map);=0A= m =3D data->m, data->m =3D NULL;=0A= ni =3D data->ni, data->ni =3D NULL;=0A= + uint8_t type;=0A= vap =3D ni->ni_vap;=0A= =0A= + cmd =3D &ring->cmd[desc->idx];=0A= + tx =3D (struct iwn_cmd_data *)cmd->data;=0A= + wh =3D (struct ieee80211_frame *)(tx + 1);=0A= +=0A= + struct ieee80211com *ic =3D ni->ni_ic;=0A= +=0A= + type =3D wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;=0A= +=0A= + =0A= + =0A= if (m->m_flags & M_TXCB) {=0A= /*=0A= * Channels marked for "radar" require traffic to be received=0A= @@ -2919,6 +3073,9 @@=0A= (status & IWN_TX_FAIL) !=3D 0);=0A= }=0A= =0A= + =0A= + ridx =3D ic->ic_rt->rateCodeToIndex[ni->ni_txrate];=0A= + =0A= /*=0A= * Update rate control statistics for the node.=0A= */=0A= @@ -2944,7 +3101,7 @@=0A= }=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s: end\n",__func__);=0A= =0A= }=0A= =0A= @@ -2955,12 +3112,24 @@=0A= static void=0A= iwn_cmd_done(struct iwn_softc *sc, struct iwn_rx_desc *desc)=0A= {=0A= - struct iwn_tx_ring *ring =3D &sc->txq[4];=0A= + struct iwn_tx_ring *ring;=0A= struct iwn_tx_data *data;=0A= + int cmd_queue_num;=0A= =0A= - if ((desc->qid & 0xf) !=3D 4)=0A= + if(sc->sc_flags & IWN_FLAG_PAN_SUPPORT)=0A= + cmd_queue_num =3D IWN_PAN_CMD_QUEUE;=0A= + else=0A= + cmd_queue_num =3D IWN_CMD_QUEUE_NUM;=0A= + =0A= + =0A= + DPRINTF(sc, IWN_DEBUG_CMD, "%s: qid: %d PAN Active : %d\n",=0A= + __func__, (desc->qid & 0xf),(sc->sc_flags & IWN_FLAG_PAN_SUPPORT) = );=0A= + =0A= + =0A= + if ((desc->qid & 0xf) !=3D cmd_queue_num)=0A= return; /* Not a command ack. */=0A= -=0A= + =0A= + ring =3D &sc->txq[cmd_queue_num];=0A= data =3D &ring->data[desc->idx];=0A= =0A= /* If the command was mapped in an mbuf, free it. */=0A= @@ -2993,7 +3162,7 @@=0A= uint8_t tid;=0A= int bit, i, lastidx, *res, seqno, shift, start;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s begin\n", = __func__);=0A= =0A= #ifdef NOT_YET=0A= if (nframes =3D=3D 1) {=0A= @@ -3082,7 +3251,7 @@=0A= }=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s: end\n",__func__);=0A= =0A= }=0A= =0A= @@ -3095,7 +3264,9 @@=0A= struct iwn_ops *ops =3D &sc->ops;=0A= struct ifnet *ifp =3D sc->sc_ifp;=0A= struct ieee80211com *ic =3D ifp->if_l2com;=0A= - struct ieee80211vap *vap =3D TAILQ_FIRST(&ic->ic_vaps);=0A= + struct ieee80211_scan_state *ss =3D ic->ic_scan;=0A= + struct ieee80211vap *vapscan =3D ss->ss_vap;=0A= +=0A= uint16_t hw;=0A= =0A= bus_dmamap_sync(sc->rxq.stat_dma.tag, sc->rxq.stat_dma.map,=0A= @@ -3150,7 +3321,12 @@=0A= struct iwn_beacon_missed *miss =3D=0A= (struct iwn_beacon_missed *)(desc + 1);=0A= int misses;=0A= + int iv_bmissthreshold;=0A= + int DoReinit =3D0 ;=0A= + struct ieee80211vap *vap0 =3D sc->ivap[IWN_RXON_BSS_CTX];=0A= + struct ieee80211vap *vap1 =3D sc->ivap[IWN_RXON_PAN_CTX];=0A= =0A= +=0A= bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= BUS_DMASYNC_POSTREAD);=0A= misses =3D le32toh(miss->consecutive);=0A= @@ -3158,15 +3334,28 @@=0A= DPRINTF(sc, IWN_DEBUG_STATE,=0A= "%s: beacons missed %d/%d\n", __func__,=0A= misses, le32toh(miss->total));=0A= + =0A= + iv_bmissthreshold =3D vap0->iv_bmissthreshold;=0A= + =0A= + if(sc->ctx =3D=3D IWN_RXON_PAN_CTX) {=0A= + iv_bmissthreshold =3D vap1->iv_bmissthreshold;=0A= + if (vap0->iv_state =3D=3D IEEE80211_S_RUN &&=0A= + vap1->iv_state =3D=3D IEEE80211_S_RUN &&=0A= + (ic->ic_flags & IEEE80211_F_SCAN) =3D=3D 0)=0A= + DoReinit =3D 1;=0A= + }=0A= + else if (vap0->iv_state =3D=3D IEEE80211_S_RUN &&=0A= + (ic->ic_flags & IEEE80211_F_SCAN) =3D=3D 0)=0A= + DoReinit =3D 1;=0A= +=0A= /*=0A= * If more than 5 consecutive beacons are missed,=0A= * reinitialize the sensitivity state machine.=0A= */=0A= - if (vap->iv_state =3D=3D IEEE80211_S_RUN &&=0A= - (ic->ic_flags & IEEE80211_F_SCAN) =3D=3D 0) {=0A= + if (DoReinit=3D=3D1) {=0A= if (misses > 5)=0A= (void)iwn_init_sensitivity(sc);=0A= - if (misses >=3D vap->iv_bmissthreshold) {=0A= + if (misses >=3D iv_bmissthreshold) {=0A= IWN_UNLOCK(sc);=0A= ieee80211_beacon_miss(ic);=0A= IWN_LOCK(sc);=0A= @@ -3176,6 +3365,13 @@=0A= }=0A= case IWN_UC_READY:=0A= {=0A= +/**=0A= + * uCode issues this "alive" notification once the runtime image is = ready=0A= + * to receive commands from the driver. This is the *second* "alive"=0A= + * notification that the driver will receive after rebooting uCode;=0A= + * this "alive" is indicated by subtype field !=3D 9.=0A= + *=0A= + **/=0A= struct iwn_ucode_info *uc =3D=0A= (struct iwn_ucode_info *)(desc + 1);=0A= =0A= @@ -3210,36 +3406,62 @@=0A= * get both the enable/disble intr.=0A= */=0A= bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= - BUS_DMASYNC_POSTREAD);=0A= - DPRINTF(sc, IWN_DEBUG_INTR, "state changed to %x\n",=0A= + BUS_DMASYNC_POSTREAD);=0A= + if (*status & (IWN_STATE_CHANGE_HW_CARD_DISABLED | = IWN_STATE_CHANGE_CT_CARD_DISABLED |IWN_STATE_CHANGE_SW_CARD_DISABLED)){=0A= + IWN_WRITE(sc, IWN_UCODE_GP1_SET, IWN_UCODE_GP1_CMD_BLOCKED);=0A= + IWN_WRITE(sc,IWN_TARG_MBX_C, 0x00000004);=0A= + =0A= + if (!(*status & IWN_STATE_CHANGE_RXON_CARD_DISABLED)) {=0A= + IWN_WRITE(sc, IWN_UCODE_GP1_CLR, IWN_UCODE_GP1_CMD_BLOCKED);=0A= + IWN_WRITE(sc, IWN_TARG_MBX_C, 0x00000004);=0A= + }=0A= + =0A= + if(*status & IWN_STATE_CHANGE_CT_CARD_DISABLED) {=0A= + device_printf(sc->sc_dev,"critical temp. reached\n");=0A= + /* XXX: enter CT kill */=0A= + }=0A= + } =0A= + if(!(*status & IWN_STATE_CHANGE_CT_CARD_DISABLED)){=0A= + callout_stop(&sc->ct_kill_exit_to);=0A= + /* XXX: exit CT kill */=0A= + }=0A= + /*=0A= + * State change allows hardware switch change to be=0A= + * noted. However, we handle this in iwn_intr as we=0A= + * get both the enable/disble intr.=0A= + */=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_INTR, "state changed to %x\n",=0A= le32toh(*status));=0A= break;=0A= }=0A= case IWN_START_SCAN:=0A= {=0A= + bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= + BUS_DMASYNC_POSTREAD);=0A= +#ifdef IWN_DEBUG=0A= struct iwn_start_scan *scan =3D=0A= (struct iwn_start_scan *)(desc + 1);=0A= -=0A= - bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= - BUS_DMASYNC_POSTREAD);=0A= DPRINTF(sc, IWN_DEBUG_ANY,=0A= "%s: scanning channel %d status %x\n",=0A= __func__, scan->chan, le32toh(scan->status));=0A= +#endif=0A= break;=0A= }=0A= case IWN_STOP_SCAN:=0A= {=0A= + bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= + BUS_DMASYNC_POSTREAD);=0A= +#ifdef IWN_DEBUG=0A= struct iwn_stop_scan *scan =3D=0A= (struct iwn_stop_scan *)(desc + 1);=0A= -=0A= - bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= - BUS_DMASYNC_POSTREAD);=0A= DPRINTF(sc, IWN_DEBUG_STATE,=0A= "scan finished nchan=3D%d status=3D%d chan=3D%d\n",=0A= scan->nchan, scan->status, scan->chan);=0A= +#endif=0A= =0A= IWN_UNLOCK(sc);=0A= - ieee80211_scan_next(vap);=0A= + ieee80211_scan_next(vapscan);=0A= IWN_LOCK(sc);=0A= break;=0A= }=0A= @@ -3251,7 +3473,11 @@=0A= sc->sc_flags |=3D IWN_FLAG_CALIB_DONE;=0A= wakeup(sc);=0A= break;=0A= + default:=0A= + DPRINTF(sc,IWN_DEBUG_INTR,"Interrupt type %d not managed\n",=0A= + desc->type);=0A= }=0A= + =0A= =0A= sc->rxq.cur =3D (sc->rxq.cur + 1) % IWN_RX_RING_COUNT;=0A= }=0A= @@ -3309,6 +3535,7 @@=0A= struct iwn_fw_dump dump;=0A= int i;=0A= =0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= IWN_LOCK_ASSERT(sc);=0A= =0A= /* Force a complete recalibration on next init. */=0A= @@ -3358,6 +3585,7 @@=0A= i, ring->qid, ring->cur, ring->queued);=0A= }=0A= printf(" rx ring: cur=3D%d\n", sc->rxq.cur);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= }=0A= =0A= static void=0A= @@ -3394,9 +3622,7 @@=0A= r2 =3D IWN_READ(sc, IWN_FH_INT);=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_INTR, "interrupt reg1=3D0x%08x reg2=3D0x%08x\n"=0A= - , r1, r2);=0A= -=0A= + =0A= if (r1 =3D=3D 0 && r2 =3D=3D 0)=0A= goto done; /* Interrupt not for us. */=0A= =0A= @@ -3405,6 +3631,9 @@=0A= if (!(sc->sc_flags & IWN_FLAG_USE_ICT))=0A= IWN_WRITE(sc, IWN_FH_INT, r2);=0A= =0A= +=0A= + DPRINTF(sc, IWN_DEBUG_INTR, "Acked interupt reg1=3D0x%08x = reg2=3D0x%08x\n", r1, r2);=0A= +=0A= if (r1 & IWN_INT_RF_TOGGLED) {=0A= iwn_rftoggle_intr(sc);=0A= goto done;=0A= @@ -3413,9 +3642,13 @@=0A= device_printf(sc->sc_dev, "%s: critical temperature reached!\n",=0A= __func__);=0A= }=0A= + /* Todo : Make separate action for HW Error and SW_error. SW Error = maybe require just a restart */=0A= if (r1 & (IWN_INT_SW_ERR | IWN_INT_HW_ERR)) {=0A= device_printf(sc->sc_dev, "%s: fatal firmware error\n",=0A= __func__);=0A= +#ifdef IWN_DEBUG=0A= + iwn_debug_register(sc);=0A= +#endif=0A= /* Dump firmware error log and stop. */=0A= iwn_fatal_intr(sc);=0A= ifp->if_flags &=3D ~IFF_UP;=0A= @@ -3504,7 +3737,7 @@=0A= {=0A= uint16_t *w =3D &sc->sched[qid * IWN5000_SCHED_COUNT + idx];=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s\n", = __func__);=0A= =0A= *w =3D (*w & htole16(0xf000)) | htole16(1);=0A= bus_dmamap_sync(sc->sched_dma.tag, sc->sched_dma.map,=0A= @@ -3539,9 +3772,10 @@=0A= bus_dma_segment_t *seg, segs[IWN_MAX_SCATTER];=0A= uint8_t tid, ridx, txant, type;=0A= int ac, i, totlen, error, pad, nsegs =3D 0, rate;=0A= + struct iwn_vap *ivp =3D IWN_VAP(vap);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= -=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s begin\n", = __func__);=0A= + =0A= IWN_LOCK_ASSERT(sc);=0A= =0A= wh =3D mtod(m, struct ieee80211_frame *);=0A= @@ -3556,21 +3790,24 @@=0A= qos =3D 0;=0A= tid =3D 0;=0A= }=0A= - ac =3D M_WME_GETAC(m);=0A= - if (m->m_flags & M_AMPDU_MPDU) {=0A= +=0A= + if(ivp->ctx =3D=3D IWN_RXON_PAN_CTX)=0A= + ac =3D iwn_pan_ac_to_queue[M_WME_GETAC(m)];=0A= + else=0A= + ac =3D iwn_bss_ac_to_queue[M_WME_GETAC(m)];=0A= +=0A= + =0A= + if (IEEE80211_QOS_HAS_SEQ(wh) &&=0A= + IEEE80211_AMPDU_RUNNING(&ni->ni_tx_ampdu[ac])) {=0A= struct ieee80211_tx_ampdu *tap =3D &ni->ni_tx_ampdu[ac];=0A= =0A= - if (!IEEE80211_AMPDU_RUNNING(tap)) {=0A= - m_freem(m);=0A= - return EINVAL;=0A= - }=0A= -=0A= - ac =3D *(int *)tap->txa_private;=0A= + ring =3D &sc->txq[*(int *)tap->txa_private];=0A= *(uint16_t *)wh->i_seq =3D=0A= htole16(ni->ni_txseqs[tid] << IEEE80211_SEQ_SEQ_SHIFT);=0A= ni->ni_txseqs[tid]++;=0A= - }=0A= - ring =3D &sc->txq[ac];=0A= + } else =0A= + ring =3D &sc->txq[ac];=0A= +=0A= desc =3D &ring->desc[ring->cur];=0A= data =3D &ring->data[ring->cur];=0A= =0A= @@ -3662,10 +3899,12 @@=0A= }=0A= }=0A= =0A= - if (IEEE80211_IS_MULTICAST(wh->i_addr1) ||=0A= - type !=3D IEEE80211_FC0_TYPE_DATA)=0A= - tx->id =3D sc->broadcast_id;=0A= - else=0A= + if (IEEE80211_IS_MULTICAST(wh->i_addr1) || type !=3D = IEEE80211_FC0_TYPE_DATA) {=0A= + if(ivp->ctx =3D=3D IWN_RXON_PAN_CTX)=0A= + tx->id =3D IWN_PAN_BCAST_ID;=0A= + else=0A= + tx->id =3D IWN_BROADCAST_ID;=0A= + } else=0A= tx->id =3D wn->id;=0A= =0A= if (type =3D=3D IEEE80211_FC0_TYPE_MGT) {=0A= @@ -3695,7 +3934,7 @@=0A= tx->data_ntries =3D 15;=0A= tx->lifetime =3D htole32(IWN_LIFETIME_INFINITE);=0A= tx->rate =3D iwn_rate_to_plcp(sc, ni, rate);=0A= - if (tx->id =3D=3D sc->broadcast_id) {=0A= + if ((tx->id =3D=3D IWN_PAN_BCAST_ID) || (tx->id =3D=3D = IWN_BROADCAST_ID)) {=0A= /* Group or management frame. */=0A= tx->linkq =3D 0;=0A= /* XXX Alternate between antenna A and B? */=0A= @@ -3727,7 +3966,7 @@=0A= return error;=0A= }=0A= /* Too many DMA segments, linearize mbuf. */=0A= - m1 =3D m_collapse(m, M_NOWAIT, IWN_MAX_SCATTER);=0A= + m1 =3D m_collapse(m, M_DONTWAIT, IWN_MAX_SCATTER);=0A= if (m1 =3D=3D NULL) {=0A= device_printf(sc->sc_dev,=0A= "%s: could not defrag mbuf\n", __func__);=0A= @@ -3786,9 +4025,8 @@=0A= /* Mark TX ring as full if we reach a certain threshold. */=0A= if (++ring->queued > IWN_TX_RING_HIMARK)=0A= sc->qfullmsk |=3D 1 << ring->qid;=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s: end\n",__func__);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= -=0A= return 0;=0A= }=0A= =0A= @@ -3812,9 +4050,9 @@=0A= u_int hdrlen;=0A= int ac, totlen, error, pad, nsegs =3D 0, i, rate;=0A= uint8_t ridx, type, txant;=0A= + struct iwn_vap *ivp =3D IWN_VAP(vap);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s begin\n", = __func__);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= -=0A= IWN_LOCK_ASSERT(sc);=0A= =0A= wh =3D mtod(m, struct ieee80211_frame *);=0A= @@ -3902,7 +4140,10 @@=0A= =0A= tx->len =3D htole16(totlen);=0A= tx->tid =3D 0;=0A= - tx->id =3D sc->broadcast_id;=0A= + if(ivp->ctx =3D=3D IWN_RXON_PAN_CTX)=0A= + tx->id =3D IWN_PAN_BCAST_ID;=0A= + else=0A= + tx->id =3D IWN_BROADCAST_ID;=0A= tx->rts_ntries =3D params->ibp_try1;=0A= tx->data_ntries =3D params->ibp_try0;=0A= tx->lifetime =3D htole32(IWN_LIFETIME_INFINITE);=0A= @@ -3912,12 +4153,10 @@=0A= if (ridx < IWN_RIDX_OFDM6 &&=0A= IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))=0A= tx->rate |=3D htole32(IWN_RFLAG_CCK);=0A= -=0A= /* Group or management frame. */=0A= tx->linkq =3D 0;=0A= txant =3D IWN_LSB(sc->txchainmask);=0A= tx->rate |=3D htole32(IWN_RFLAG_ANT(txant));=0A= -=0A= /* Set physical address of "scratch area". */=0A= tx->loaddr =3D htole32(IWN_LOADDR(data->scratch_paddr));=0A= tx->hiaddr =3D IWN_HIADDR(data->scratch_paddr);=0A= @@ -3940,7 +4179,7 @@=0A= return error;=0A= }=0A= /* Too many DMA segments, linearize mbuf. */=0A= - m1 =3D m_collapse(m, M_NOWAIT, IWN_MAX_SCATTER);=0A= + m1 =3D m_collapse(m, M_DONTWAIT, IWN_MAX_SCATTER);=0A= if (m1 =3D=3D NULL) {=0A= device_printf(sc->sc_dev,=0A= "%s: could not defrag mbuf\n", __func__);=0A= @@ -4000,7 +4239,7 @@=0A= if (++ring->queued > IWN_TX_RING_HIMARK)=0A= sc->qfullmsk |=3D 1 << ring->qid;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s: end\n",__func__);=0A= =0A= return 0;=0A= }=0A= @@ -4014,7 +4253,7 @@=0A= struct iwn_softc *sc =3D ifp->if_softc;=0A= int error =3D 0;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s begin\n", = __func__);=0A= =0A= if ((ifp->if_drv_flags & IFF_DRV_RUNNING) =3D=3D 0) {=0A= ieee80211_free_node(ni);=0A= @@ -4045,7 +4284,7 @@=0A= =0A= IWN_UNLOCK(sc);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s: end\n",__func__);=0A= =0A= return error;=0A= }=0A= @@ -4097,12 +4336,15 @@=0A= struct iwn_softc *sc =3D arg;=0A= struct ifnet *ifp =3D sc->sc_ifp;=0A= struct ieee80211com *ic =3D ifp->if_l2com;=0A= + struct ieee80211_scan_state *ss =3D ic->ic_scan;=0A= + struct ieee80211vap *vapscan =3D ss->ss_vap;=0A= =0A= +=0A= IWN_LOCK_ASSERT(sc);=0A= =0A= KASSERT(ifp->if_drv_flags & IFF_DRV_RUNNING, ("not running"));=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s\n", = __func__);=0A= =0A= if (sc->sc_tx_timer > 0) {=0A= if (--sc->sc_tx_timer =3D=3D 0) {=0A= @@ -4111,6 +4353,12 @@=0A= return;=0A= }=0A= }=0A= + =0A= + if (sc->sc_scan_timer > 0) {=0A= + if (--sc->sc_scan_timer =3D=3D 0)=0A= + ieee80211_scan_next(vapscan);=0A= + }=0A= +=0A= callout_reset(&sc->watchdog_to, hz, iwn_watchdog, sc);=0A= }=0A= =0A= @@ -4163,7 +4411,7 @@=0A= static int=0A= iwn_cmd(struct iwn_softc *sc, int code, const void *buf, int size, int = async)=0A= {=0A= - struct iwn_tx_ring *ring =3D &sc->txq[4];=0A= + struct iwn_tx_ring *ring ;=0A= struct iwn_tx_desc *desc;=0A= struct iwn_tx_data *data;=0A= struct iwn_tx_cmd *cmd;=0A= @@ -4170,12 +4418,25 @@=0A= struct mbuf *m;=0A= bus_addr_t paddr;=0A= int totlen, error;=0A= + int cmd_queue_num;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + if((sc->uc_scan_progress =3D=3D 1) && (code !=3D IWN_CMD_SCAN)) {=0A= + DPRINTF(sc,IWN_DEBUG_CMD,"Scanning in progress..not sending cmd = %x.\n",code);=0A= + return 0;=0A= + }=0A= =0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CMD, "->%s begin\n", __func__);=0A= +=0A= if (async =3D=3D 0)=0A= IWN_LOCK_ASSERT(sc);=0A= + =0A= + if(sc->sc_flags & IWN_FLAG_PAN_SUPPORT)=0A= + cmd_queue_num =3D IWN_PAN_CMD_QUEUE;=0A= + else=0A= + cmd_queue_num =3D IWN_CMD_QUEUE_NUM;=0A= =0A= + ring =3D &sc->txq[cmd_queue_num];=0A= +=0A= desc =3D &ring->desc[ring->cur];=0A= data =3D &ring->data[ring->cur];=0A= totlen =3D 4 + size;=0A= @@ -4184,7 +4445,7 @@=0A= /* Command is too large to fit in a descriptor. */=0A= if (totlen > MCLBYTES)=0A= return EINVAL;=0A= - m =3D m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE);=0A= + m =3D m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE);=0A= if (m =3D=3D NULL)=0A= return ENOMEM;=0A= cmd =3D mtod(m, struct iwn_tx_cmd *);=0A= @@ -4210,8 +4471,8 @@=0A= desc->segs[0].addr =3D htole32(IWN_LOADDR(paddr));=0A= desc->segs[0].len =3D htole16(IWN_HIADDR(paddr) | totlen << 4);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_CMD, "%s: %s (0x%x) flags %d qid %d idx %d\n",=0A= - __func__, iwn_intr_str(cmd->code), cmd->code,=0A= + DPRINTF(sc, IWN_DEBUG_CMD, "Sending %s (0x%x) flags %d qid %d idx = %d\n",=0A= + iwn_intr_str(cmd->code), cmd->code,=0A= cmd->flags, cmd->qid, cmd->idx);=0A= =0A= if (size > sizeof cmd->data) {=0A= @@ -4228,7 +4489,7 @@=0A= ring->cur =3D (ring->cur + 1) % IWN_TX_RING_COUNT;=0A= IWN_WRITE(sc, IWN_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CMD, "->%s: end\n",__func__);=0A= =0A= return async ? 0 : msleep(desc, &sc->sc_mtx, PCATCH, "iwncmd", hz);=0A= }=0A= @@ -4267,6 +4528,10 @@=0A= static int=0A= iwn_set_link_quality(struct iwn_softc *sc, struct ieee80211_node *ni)=0A= {=0A= + =0A= + DPRINTF(sc,IWN_DEBUG_RESET,"Disabled %s reached\n",__func__);=0A= + return 0;=0A= + =0A= #define RV(v) ((v) & IEEE80211_RATE_VAL)=0A= struct iwn_node *wn =3D (void *)ni;=0A= struct ieee80211_rateset *rs =3D &ni->ni_rates;=0A= @@ -4334,11 +4599,13 @@=0A= uint8_t txant;=0A= int i, error;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s: = begin\n",__func__);=0A= =0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A= + =0A= memset(&node, 0, sizeof node);=0A= IEEE80211_ADDR_COPY(node.macaddr, ifp->if_broadcastaddr);=0A= - node.id =3D sc->broadcast_id;=0A= + node.id =3D IWN_BROADCAST_ID;=0A= DPRINTF(sc, IWN_DEBUG_RESET, "%s: adding broadcast node\n", __func__);=0A= if ((error =3D ops->add_node(sc, &node, async)) !=3D 0)=0A= return error;=0A= @@ -4347,7 +4614,7 @@=0A= txant =3D IWN_LSB(sc->txchainmask);=0A= =0A= memset(&linkq, 0, sizeof linkq);=0A= - linkq.id =3D sc->broadcast_id;=0A= + linkq.id =3D IWN_BROADCAST_ID;=0A= linkq.antmsk_1stream =3D txant;=0A= linkq.antmsk_2stream =3D IWN_ANT_AB;=0A= linkq.ampdu_max =3D 64;=0A= @@ -4365,7 +4632,7 @@=0A= linkq.retry[i] =3D linkq.retry[0];=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s: end\n",__func__);=0A= =0A= return iwn_cmd(sc, IWN_CMD_LINK_QUALITY, &linkq, sizeof linkq, async);=0A= }=0A= @@ -4409,23 +4676,31 @@=0A= /* Ignore */=0A= }=0A= =0A= +=0A= static void=0A= -iwn_set_led(struct iwn_softc *sc, uint8_t which, uint8_t off, uint8_t = on)=0A= +iwn_set_led(struct iwn_softc *sc, uint8_t which, uint8_t off, uint8_t = on, uint8_t mode)=0A= {=0A= struct iwn_cmd_led led;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_LED, "->Doing %s\n", __func__);=0A= =0A= /* Clear microcode LED ownership. */=0A= IWN_CLRBITS(sc, IWN_LED, IWN_LED_BSM_CTRL);=0A= =0A= led.which =3D which;=0A= - led.unit =3D htole32(10000); /* on/off in unit of 100ms */=0A= +=0A= + if(mode =3D=3D IWN_LED_SLOW_BLINK)=0A= + led.unit =3D htole32(IWN_LED_UNIT * 5); /* on/off in unit of 10ms */=0A= + else=0A= + led.unit =3D htole32(IWN_LED_UNIT);=0A= +=0A= led.off =3D off;=0A= - led.on =3D on;=0A= + led.on =3D on;=0A= +=0A= (void)iwn_cmd(sc, IWN_CMD_SET_LED, &led, sizeof led, 1);=0A= }=0A= =0A= +=0A= /*=0A= * Set the critical temperature at which the firmware will stop the = radio=0A= * and notify us.=0A= @@ -4434,21 +4709,30 @@=0A= iwn_set_critical_temp(struct iwn_softc *sc)=0A= {=0A= struct iwn_critical_temp crit;=0A= - int32_t temp;=0A= + int32_t ct_enter,ct_exit;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s\n", = __func__);=0A= =0A= IWN_WRITE(sc, IWN_UCODE_GP1_CLR, IWN_UCODE_GP1_CTEMP_STOP_RF);=0A= =0A= - if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_5150)=0A= - temp =3D (IWN_CTOK(110) - sc->temp_off) * -5;=0A= - else if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_4965)=0A= - temp =3D IWN_CTOK(110);=0A= - else=0A= - temp =3D 110;=0A= + ct_enter =3D IWN_CT_KILL_THRESHOLD;=0A= + ct_exit =3D IWN_CT_KILL_EXIT_THRESHOLD;=0A= +=0A= + if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_5150) {=0A= + ct_enter =3D (IWN_CTOK(IWN_CT_KILL_THRESHOLD) - sc->temp_off) * -5;=0A= + ct_exit =3D 0;=0A= + } else if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_4965) {=0A= + ct_enter =3D IWN_CTOK(IWN_CT_KILL_THRESHOLD);=0A= + ct_exit =3D 0;=0A= + } else {=0A= + ct_enter =3D IWN_CT_KILL_THRESHOLD;=0A= + ct_exit =3D IWN_CT_KILL_EXIT_THRESHOLD;=0A= + }=0A= +=0A= memset(&crit, 0, sizeof crit);=0A= - crit.tempR =3D htole32(temp);=0A= - DPRINTF(sc, IWN_DEBUG_RESET, "setting critical temp to %d\n", temp);=0A= + crit.tempR =3D htole32(ct_enter);=0A= + crit.tempM =3D htole32(ct_exit); =0A= + DPRINTF(sc, IWN_DEBUG_RESET, "setting critical temp to %d and exit to = %d \n", ct_enter,ct_exit);=0A= return iwn_cmd(sc, IWN_CMD_SET_CRITICAL_TEMP, &crit, sizeof crit, 0);=0A= }=0A= =0A= @@ -4457,9 +4741,9 @@=0A= {=0A= struct iwn_cmd_timing cmd;=0A= uint64_t val, mod;=0A= + =0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s\n", = __func__);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= -=0A= memset(&cmd, 0, sizeof cmd);=0A= memcpy(&cmd.tstamp, ni->ni_tstamp.data, sizeof (uint64_t));=0A= cmd.bintval =3D htole16(ni->ni_intval);=0A= @@ -4470,10 +4754,12 @@=0A= mod =3D le64toh(cmd.tstamp) % val;=0A= cmd.binitval =3D htole32((uint32_t)(val - mod));=0A= =0A= +// cmd.dtim_period=3D1; //XXX It's defined in linux kernel=0A= + =0A= DPRINTF(sc, IWN_DEBUG_RESET, "timing bintval=3D%u tstamp=3D%ju, = init=3D%u\n",=0A= - ni->ni_intval, le64toh(cmd.tstamp), (uint32_t)(val - mod));=0A= + le16toh(cmd.bintval), le64toh(cmd.tstamp), (uint32_t)(val - mod));=0A= =0A= - return iwn_cmd(sc, IWN_CMD_TIMING, &cmd, sizeof cmd, 1);=0A= + return iwn_cmd(sc, IWN_CMD_TIMING | IWN_DEBUG_RESET, &cmd, sizeof cmd, = 0);=0A= }=0A= =0A= static void=0A= @@ -4482,7 +4768,7 @@=0A= struct ifnet *ifp =3D sc->sc_ifp;=0A= struct ieee80211com *ic =3D ifp->if_l2com;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->Doing %s\n", = __func__);=0A= =0A= /* Adjust TX power if need be (delta >=3D 3 degC). */=0A= DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: temperature %d->%d\n",=0A= @@ -4519,8 +4805,9 @@=0A= int i, c, grp, maxpwr;=0A= uint8_t chan;=0A= =0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A= /* Retrieve current channel from last RXON. */=0A= - chan =3D sc->rxon.chan;=0A= + chan =3D sc->rxon->chan;=0A= DPRINTF(sc, IWN_DEBUG_RESET, "setting TX power for channel %d\n",=0A= chan);=0A= =0A= @@ -4649,6 +4936,11 @@=0A= #undef fdivround=0A= }=0A= =0A= +/*=0A= + * Set TX power for current channel (each rate has its own power = settings).=0A= + * This function takes into account the regulatory information from = EEPROM,=0A= + * the current temperature and the current voltage.=0A= + */=0A= static int=0A= iwn5000_set_txpower(struct iwn_softc *sc, struct ieee80211_channel *ch,=0A= int async)=0A= @@ -4655,7 +4947,7 @@=0A= {=0A= struct iwn5000_cmd_txpower cmd;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_TXPOW, "->Doing %s\n", = __func__);=0A= =0A= /*=0A= * TX power calibration is handled automatically by the firmware=0A= @@ -4679,7 +4971,7 @@=0A= uint8_t mask, agc;=0A= int rssi;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RECV, "->Doing %s\n", = __func__);=0A= =0A= mask =3D (le16toh(phy->antenna) >> 4) & IWN_ANT_ABC;=0A= agc =3D (le16toh(phy->agc) >> 7) & 0x7f;=0A= @@ -4706,7 +4998,7 @@=0A= uint8_t agc;=0A= int rssi;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RECV, "->Doing %s\n", = __func__);=0A= =0A= agc =3D (le32toh(phy->agc) >> 9) & 0x7f;=0A= =0A= @@ -4775,7 +5067,7 @@=0A= {=0A= int32_t temp;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->Doing %s\n", = __func__);=0A= =0A= /*=0A= * Temperature is not used by the driver for 5000 Series because=0A= @@ -4786,6 +5078,8 @@=0A= temp =3D (temp / -5) + sc->temp_off;=0A= temp =3D IWN_KTOC(temp);=0A= }=0A= + DPRINTF(sc,IWN_DEBUG_CALIBRATE,"Temperature %d\n",temp);=0A= + //XXX: handle thermal throttling state machine=0A= return temp;=0A= }=0A= =0A= @@ -4797,10 +5091,9 @@=0A= {=0A= struct iwn_ops *ops =3D &sc->ops;=0A= struct iwn_calib_state *calib =3D &sc->calib;=0A= - uint32_t flags;=0A= int error;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s\n", = __func__);=0A= =0A= /* Reset calibration state machine. */=0A= memset(calib, 0, sizeof (*calib));=0A= @@ -4811,9 +5104,10 @@=0A= calib->ofdm_mrc_x1 =3D sc->limits->min_ofdm_mrc_x1;=0A= calib->ofdm_x4 =3D sc->limits->min_ofdm_x4;=0A= calib->ofdm_mrc_x4 =3D sc->limits->min_ofdm_mrc_x4;=0A= - calib->cck_x4 =3D 125;=0A= + calib->cck_x4 =3D sc->limits->min_cck_x4;=0A= calib->cck_mrc_x4 =3D sc->limits->min_cck_mrc_x4;=0A= calib->energy_cck =3D sc->limits->energy_cck;=0A= + calib->corr_barker_mrc =3D sc->limits->min_corr_barker_mrc;=0A= =0A= /* Write initial sensitivity. */=0A= if ((error =3D iwn_send_sensitivity(sc)) !=3D 0)=0A= @@ -4824,10 +5118,7 @@=0A= return error;=0A= =0A= /* Request statistics at each beacon interval. */=0A= - flags =3D 0;=0A= - DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: sending request for = statistics\n",=0A= - __func__);=0A= - return iwn_cmd(sc, IWN_CMD_GET_STATISTICS, &flags, sizeof flags, 1);=0A= + return iwn_set_statistics_request(sc,true,false,1);=0A= }=0A= =0A= /*=0A= @@ -4846,7 +5137,7 @@=0A= uint32_t val;=0A= int i;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s begin\n", = __func__);=0A= =0A= /* Accumulate RSSI and noise for all 3 antennas. */=0A= for (i =3D 0; i < 3; i++) {=0A= @@ -4879,8 +5170,8 @@=0A= =0A= #ifdef notyet=0A= /* XXX Disable RX chains with no antennas connected. */=0A= - sc->rxon.rxchain =3D htole16(IWN_RXCHAIN_SEL(sc->chainmask));=0A= - (void)iwn_cmd(sc, IWN_CMD_RXON, &sc->rxon, sc->rxonsz, 1);=0A= + sc->rxon->rxchain =3D htole16(IWN_RXCHAIN_SEL(sc->chainmask));=0A= + (void)iwn_cmd(sc, IWN_CMD_RXON, sc->rxon, sc->rxonsz, 1);=0A= #endif=0A= =0A= /* Enable power-saving mode if requested by user. */=0A= @@ -4887,7 +5178,7 @@=0A= if (ic->ic_flags & IEEE80211_F_PMGTON)=0A= (void)iwn_set_pslevel(sc, 0, 3, 1);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s: = end\n",__func__);=0A= =0A= }=0A= =0A= @@ -4911,7 +5202,7 @@=0A= {=0A= struct iwn_phy_calib cmd;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->Doing %s\n", = __func__);=0A= =0A= memset(&cmd, 0, sizeof cmd);=0A= cmd.code =3D sc->reset_noise_gain;=0A= @@ -4929,7 +5220,7 @@=0A= struct iwn_phy_calib_gain cmd;=0A= int i, delta, noise;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->Doing %s\n", = __func__);=0A= =0A= /* Get minimal noise among connected antennas. */=0A= noise =3D INT_MAX; /* NB: There's at least one antenna. */=0A= @@ -4964,7 +5255,7 @@=0A= struct iwn_phy_calib_gain cmd;=0A= int i, ant, div, delta;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->Doing %s\n", = __func__);=0A= =0A= /* We collected 20 beacons and !=3D6050 need a 1.5 factor. */=0A= div =3D (sc->hw_type =3D=3D IWN_HW_REV_TYPE_6050) ? 20 : 30;=0A= @@ -5024,11 +5315,11 @@=0A= uint8_t noise[3], noise_ref;=0A= int i, needs_update =3D 0;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s begin\n", = __func__);=0A= =0A= /* Check that we've been enabled long enough. */=0A= if ((rxena =3D le32toh(stats->general.load)) =3D=3D 0){=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end not so long\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s end not so = long\n", __func__);=0A= return;=0A= }=0A= =0A= @@ -5149,7 +5440,7 @@=0A= if (needs_update)=0A= (void)iwn_send_sensitivity(sc);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s: = end\n",__func__);=0A= =0A= #undef dec=0A= #undef inc=0A= @@ -5170,15 +5461,15 @@=0A= cmd.corr_ofdm_mrc_x1 =3D htole16(calib->ofdm_mrc_x1);=0A= cmd.corr_ofdm_x4 =3D htole16(calib->ofdm_x4);=0A= cmd.corr_ofdm_mrc_x4 =3D htole16(calib->ofdm_mrc_x4);=0A= - cmd.energy_ofdm =3D htole16(sc->limits->energy_ofdm);=0A= - cmd.energy_ofdm_th =3D htole16(62);=0A= + cmd.energy_ofdm =3D htole16(calib->energy_ofdm);=0A= + cmd.energy_ofdm_th =3D htole16(62); //Value doesn't change in = linux Kernel=0A= /* CCK modulation. */=0A= cmd.corr_cck_x4 =3D htole16(calib->cck_x4);=0A= cmd.corr_cck_mrc_x4 =3D htole16(calib->cck_mrc_x4);=0A= cmd.energy_cck =3D htole16(calib->energy_cck);=0A= /* Barker modulation: use default values. */=0A= - cmd.corr_barker =3D htole16(190);=0A= - cmd.corr_barker_mrc =3D htole16(390);=0A= + cmd.corr_barker =3D htole16(190); //Value doesn't change in = linux Kernel=0A= + cmd.corr_barker_mrc =3D htole16(calib->corr_barker_mrc);=0A= =0A= DPRINTF(sc, IWN_DEBUG_CALIBRATE,=0A= "%s: set sensitivity %d/%d/%d/%d/%d/%d/%d\n", __func__,=0A= @@ -5205,6 +5496,8 @@=0A= /*=0A= * Set STA mode power saving level (between 0 and 5).=0A= * Level 0 is CAM (Continuously Aware Mode), 5 is for maximum power = saving.=0A= + * DTIM value passed in will if so configured, be ignored and taken from=0A= + * the value set at the AP.=0A= */=0A= static int=0A= iwn_set_pslevel(struct iwn_softc *sc, int dtim, int level, int async)=0A= @@ -5213,8 +5506,25 @@=0A= const struct iwn_pmgt *pmgt;=0A= uint32_t max, skip_dtim;=0A= uint32_t reg;=0A= - int i;=0A= + int i, retval;=0A= + struct ifnet *ifp =3D sc->sc_ifp;=0A= + struct ieee80211com *ic =3D ifp->if_l2com;=0A= =0A= + if(!TAILQ_EMPTY(&ic->ic_vaps)) {=0A= + /* At present the driver supports only a single vap. */=0A= + struct ieee80211vap *vap =3D TAILQ_FIRST(&ic->ic_vaps);=0A= +=0A= + /* XXX confirm PS level setting validity for various modes */=0A= + if(vap->iv_opmode =3D=3D IEEE80211_M_HOSTAP ||=0A= + vap->iv_opmode =3D=3D IEEE80211_M_MONITOR)=0A= + return 0;=0A= +=0A= + #ifdef IWN_DTIM_INDICATES_UNICAST_PENDING_AT_AP=0A= + if (vap->iv_state =3D=3D IEEE80211_S_RUN)=0A= + dtim =3D vap->iv_bss->ni_dtim_period;=0A= + #endif=0A= + }=0A= +=0A= DPRINTF(sc, IWN_DEBUG_PWRSAVE,=0A= "%s: dtim=3D%d, level=3D%d, async=3D%d\n",=0A= __func__,=0A= @@ -5221,7 +5531,7 @@=0A= dtim,=0A= level,=0A= async);=0A= -=0A= + =0A= /* Select which PS parameters to use. */=0A= if (dtim <=3D 2)=0A= pmgt =3D &iwn_pmgt[0][level];=0A= @@ -5232,7 +5542,7 @@=0A= =0A= memset(&cmd, 0, sizeof cmd);=0A= if (level !=3D 0) /* not CAM */=0A= - cmd.flags |=3D htole16(IWN_PS_ALLOW_SLEEP);=0A= + cmd.flags |=3D = htole16(IWN_PS_ALLOW_SLEEP)|htole16(IWN_PS_ADVANCED_PM);=0A= if (level =3D=3D 5)=0A= cmd.flags |=3D htole16(IWN_PS_FAST_PD);=0A= /* Retrieve PCIe Active State Power Management (ASPM). */=0A= @@ -5259,9 +5569,18 @@=0A= for (i =3D 0; i < 5; i++)=0A= cmd.intval[i] =3D htole32(MIN(max, pmgt->intval[i]));=0A= =0A= - DPRINTF(sc, IWN_DEBUG_RESET, "setting power saving level to %d\n",=0A= + DPRINTF(sc, IWN_DEBUG_PWRSAVE, "setting power saving level to %d\n",=0A= level);=0A= - return iwn_cmd(sc, IWN_CMD_SET_POWER_MODE, &cmd, sizeof cmd, async);=0A= + retval =3D iwn_cmd(sc, IWN_CMD_SET_POWER_MODE, &cmd, sizeof cmd, = async);=0A= + /*=0A= + * XXX: update current_pwrsave_level using completion notification=0A= + * in case of async mode=0A= + */=0A= + if(retval=3D=3D0)=0A= + sc->current_pwrsave_level =3D level;=0A= +=0A= + return retval;=0A= + =0A= }=0A= =0A= static int=0A= @@ -5286,26 +5605,63 @@=0A= 0xcc00ff28, 0x0000aaaa, 0xcc00aaaa, 0x0000aaaa,=0A= 0xc0004000, 0x00004000, 0xf0005000, 0xf0005000,=0A= };=0A= +=0A= struct iwn6000_btcoex_config btconfig;=0A= + struct iwn2000_btcoex_config btconfig2k;=0A= struct iwn_btcoex_priotable btprio;=0A= struct iwn_btcoex_prot btprot;=0A= int error, i;=0A= -=0A= + uint8_t flags;=0A= + =0A= memset(&btconfig, 0, sizeof btconfig);=0A= - btconfig.flags =3D 145;=0A= - btconfig.max_kill =3D 5;=0A= - btconfig.bt3_t7_timer =3D 1;=0A= - btconfig.kill_ack =3D htole32(0xffff0000);=0A= - btconfig.kill_cts =3D htole32(0xffff0000);=0A= - btconfig.sample_time =3D 2;=0A= - btconfig.bt3_t2_timer =3D 0xc;=0A= - for (i =3D 0; i < 12; i++)=0A= - btconfig.lookup_table[i] =3D htole32(btcoex_3wire[i]);=0A= - btconfig.valid =3D htole16(0xff);=0A= - btconfig.prio_boost =3D 0xf0;=0A= - DPRINTF(sc, IWN_DEBUG_RESET,=0A= - "%s: configuring advanced bluetooth coexistence\n", __func__);=0A= - error =3D iwn_cmd(sc, IWN_CMD_BT_COEX, &btconfig, sizeof(btconfig), 1);=0A= + memset(&btconfig2k, 0, sizeof btconfig2k);=0A= + =0A= + flags =3D IWN_BT_FLAG_COEX6000_MODE_3W << = IWN_BT_FLAG_COEX6000_MODE_SHIFT; // Done as is in linux kernel 3.2=0A= + =0A= + if (sc->base_params->bt_sco_disable)=0A= + flags &=3D ~IWN_BT_FLAG_SYNC_2_BT_DISABLE; =0A= + else=0A= + flags |=3D IWN_BT_FLAG_SYNC_2_BT_DISABLE; =0A= + =0A= + flags |=3D IWN_BT_FLAG_COEX6000_CHAN_INHIBITION;=0A= + =0A= + =0A= + /* Default flags result is 145 as old value */=0A= + =0A= + /* Flags value has to be review. Values must change if we which to = disable it */=0A= + if (sc->base_params->bt_session_2) {=0A= + btconfig2k.flags =3D flags; =0A= + btconfig2k.max_kill =3D 5;=0A= + btconfig2k.bt3_t7_timer =3D 1;=0A= + btconfig2k.kill_ack =3D htole32(0xffff0000);=0A= + btconfig2k.kill_cts =3D htole32(0xffff0000);=0A= + btconfig2k.sample_time =3D 2;=0A= + btconfig2k.bt3_t2_timer =3D 0xc;=0A= + =0A= + for (i =3D 0; i < 12; i++)=0A= + btconfig2k.lookup_table[i] =3D htole32(btcoex_3wire[i]);=0A= + btconfig2k.valid =3D htole16(0xff);=0A= + btconfig2k.prio_boost =3D htole32(0xf0);=0A= + DPRINTF(sc, IWN_DEBUG_RESET,=0A= + "%s: configuring advanced bluetooth coexistence session 2, flags : = 0X%x\n", __func__,flags);=0A= + error =3D iwn_cmd(sc, IWN_CMD_BT_COEX, &btconfig2k, = sizeof(btconfig2k), 1);=0A= + } else {=0A= + btconfig.flags =3D flags;=0A= + btconfig.max_kill =3D 5;=0A= + btconfig.bt3_t7_timer =3D 1;=0A= + btconfig.kill_ack =3D htole32(0xffff0000);=0A= + btconfig.kill_cts =3D htole32(0xffff0000);=0A= + btconfig.sample_time =3D 2;=0A= + btconfig.bt3_t2_timer =3D 0xc;=0A= + =0A= + for (i =3D 0; i < 12; i++)=0A= + btconfig.lookup_table[i] =3D htole32(btcoex_3wire[i]);=0A= + btconfig.valid =3D htole16(0xff);=0A= + btconfig.prio_boost =3D 0xf0;=0A= + DPRINTF(sc, IWN_DEBUG_RESET,=0A= + "%s: configuring advanced bluetooth coexistence, flags : 0X%x\n", = __func__,flags);=0A= + error =3D iwn_cmd(sc, IWN_CMD_BT_COEX, &btconfig, sizeof(btconfig), = 1);=0A= + }=0A= if (error !=3D 0)=0A= return error;=0A= =0A= @@ -5336,19 +5692,6 @@=0A= }=0A= =0A= static int=0A= -iwn5000_runtime_calib(struct iwn_softc *sc)=0A= -{=0A= - struct iwn5000_calib_config cmd;=0A= -=0A= - memset(&cmd, 0, sizeof cmd);=0A= - cmd.ucode.once.enable =3D 0xffffffff;=0A= - cmd.ucode.once.start =3D IWN5000_CALIB_DC;=0A= - DPRINTF(sc, IWN_DEBUG_CALIBRATE,=0A= - "%s: configuring runtime calibration\n", __func__);=0A= - return iwn_cmd(sc, IWN5000_CMD_CALIB_CONFIG, &cmd, sizeof(cmd), 0);=0A= -}=0A= -=0A= -static int=0A= iwn_config(struct iwn_softc *sc)=0A= {=0A= struct iwn_ops *ops =3D &sc->ops;=0A= @@ -5357,34 +5700,47 @@=0A= uint32_t txmask;=0A= uint16_t rxchain;=0A= int error;=0A= + =0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= -=0A= - if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_6005) {=0A= - /* Set radio temperature sensor offset. */=0A= + if ((sc->base_params->calib_need & IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET) = && (sc->base_params->calib_need & = IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSETv2)) {=0A= + device_printf(sc->sc_dev,"%s: temp_offset and temp_offsetv2 are = exclusive each together. Review NIC config file. Conf : 0x%08x Flags : = 0x%08x \n", = __func__,sc->base_params->calib_need,(IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET = | IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSETv2));=0A= + return EINVAL;=0A= + }=0A= + /* Compute temperature calib if needed. Will be send by send calib */=0A= + if (sc->base_params->calib_need & IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET) {=0A= error =3D iwn5000_temp_offset_calib(sc);=0A= if (error !=3D 0) {=0A= device_printf(sc->sc_dev,=0A= - "%s: could not set temperature offset\n", __func__);=0A= + "%s: could not compute temperature offset\n", __func__);=0A= return error;=0A= }=0A= - }=0A= -=0A= - if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_6050) {=0A= - /* Configure runtime DC calibration. */=0A= - error =3D iwn5000_runtime_calib(sc);=0A= + } else if (sc->base_params->calib_need & = IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSETv2) {=0A= + error =3D iwn5000_temp_offset_calibv2(sc);=0A= if (error !=3D 0) {=0A= device_printf(sc->sc_dev,=0A= - "%s: could not configure runtime calibration\n",=0A= - __func__);=0A= + "%s: could not compute temperature offset v2\n", __func__);=0A= return error;=0A= }=0A= }=0A= =0A= + /* Configure bluetooth coexistence. */=0A= + if (sc->base_params->advanced_bt_coexist) =0A= + error =3D iwn_send_advanced_btcoex(sc);=0A= + else=0A= + error =3D iwn_send_btcoex(sc);=0A= +=0A= + if (error !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not configure bluetooth coexistence, error %d\n",=0A= + __func__, error);=0A= + return error;=0A= + }=0A= +=0A= /* Configure valid TX chains for >=3D5000 Series. */=0A= if (sc->hw_type !=3D IWN_HW_REV_TYPE_4965) {=0A= txmask =3D htole32(sc->txchainmask);=0A= - DPRINTF(sc, IWN_DEBUG_RESET,=0A= + DPRINTF(sc, IWN_DEBUG_RESET ,=0A= "%s: configuring valid TX chains 0x%x\n", __func__, txmask);=0A= error =3D iwn_cmd(sc, IWN5000_CMD_TX_ANT_CONFIG, &txmask,=0A= sizeof txmask, 0);=0A= @@ -5396,34 +5752,24 @@=0A= }=0A= }=0A= =0A= - /* Configure bluetooth coexistence. */=0A= - if (sc->sc_flags & IWN_FLAG_ADV_BTCOEX)=0A= - error =3D iwn_send_advanced_btcoex(sc);=0A= - else=0A= - error =3D iwn_send_btcoex(sc);=0A= - if (error !=3D 0) {=0A= - device_printf(sc->sc_dev,=0A= - "%s: could not configure bluetooth coexistence, error %d\n",=0A= - __func__, error);=0A= - return error;=0A= - }=0A= -=0A= + =0A= /* Set mode, channel, RX filter and enable RX. */=0A= - memset(&sc->rxon, 0, sizeof (struct iwn_rxon));=0A= - IEEE80211_ADDR_COPY(sc->rxon.myaddr, IF_LLADDR(ifp));=0A= - IEEE80211_ADDR_COPY(sc->rxon.wlap, IF_LLADDR(ifp));=0A= - sc->rxon.chan =3D ieee80211_chan2ieee(ic, ic->ic_curchan);=0A= - sc->rxon.flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A= + memset(sc->rxon, 0, sizeof (struct iwn_rxon));=0A= + IEEE80211_ADDR_COPY(sc->rxon->myaddr, IF_LLADDR(ifp));=0A= + IEEE80211_ADDR_COPY(sc->rxon->wlap, IF_LLADDR(ifp));=0A= + sc->rxon->chan =3D ieee80211_chan2ieee(ic, ic->ic_curchan);=0A= + sc->rxon->flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A= if (IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan))=0A= - sc->rxon.flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= switch (ic->ic_opmode) {=0A= case IEEE80211_M_STA:=0A= - sc->rxon.mode =3D IWN_MODE_STA;=0A= - sc->rxon.filter =3D htole32(IWN_FILTER_MULTICAST);=0A= + sc->rxon->mode =3D IWN_MODE_STA;=0A= + sc->rxon->filter =3D htole32(IWN_FILTER_MULTICAST);=0A= break;=0A= case IEEE80211_M_MONITOR:=0A= - sc->rxon.mode =3D IWN_MODE_MONITOR;=0A= - sc->rxon.filter =3D htole32(IWN_FILTER_MULTICAST |=0A= + sc->rxon->mode =3D IWN_MODE_MONITOR;=0A= + sc->rxon->filter =3D htole32(IWN_FILTER_MULTICAST |=0A= IWN_FILTER_CTL | IWN_FILTER_PROMISC);=0A= break;=0A= default:=0A= @@ -5430,24 +5776,26 @@=0A= /* Should not get there. */=0A= break;=0A= }=0A= - sc->rxon.cck_mask =3D 0x0f; /* not yet negotiated */=0A= - sc->rxon.ofdm_mask =3D 0xff; /* not yet negotiated */=0A= - sc->rxon.ht_single_mask =3D 0xff;=0A= - sc->rxon.ht_dual_mask =3D 0xff;=0A= - sc->rxon.ht_triple_mask =3D 0xff;=0A= + =0A= + sc->rxon->cck_mask =3D 0x0f; /* not yet negotiated */=0A= + sc->rxon->ofdm_mask =3D 0xff; /* not yet negotiated */=0A= + sc->rxon->ht_single_mask =3D 0xff;=0A= + sc->rxon->ht_dual_mask =3D 0xff;=0A= + sc->rxon->ht_triple_mask =3D 0xff;=0A= rxchain =3D=0A= IWN_RXCHAIN_VALID(sc->rxchainmask) |=0A= IWN_RXCHAIN_MIMO_COUNT(2) |=0A= IWN_RXCHAIN_IDLE_COUNT(2);=0A= - sc->rxon.rxchain =3D htole16(rxchain);=0A= + sc->rxon->rxchain =3D htole16(rxchain);=0A= + =0A= DPRINTF(sc, IWN_DEBUG_RESET, "%s: setting configuration\n", __func__);=0A= - error =3D iwn_cmd(sc, IWN_CMD_RXON, &sc->rxon, sc->rxonsz, 0);=0A= + error =3D iwn_cmd(sc, IWN_CMD_RXON, sc->rxon, sc->rxonsz, 0);=0A= if (error !=3D 0) {=0A= device_printf(sc->sc_dev, "%s: RXON command failed\n",=0A= __func__);=0A= return error;=0A= }=0A= -=0A= + =0A= if ((error =3D iwn_add_broadcast_node(sc, 0)) !=3D 0) {=0A= device_printf(sc->sc_dev, "%s: could not add broadcast node\n",=0A= __func__);=0A= @@ -5467,14 +5815,24 @@=0A= return error;=0A= }=0A= =0A= - /* Set power saving level to CAM during initialization. */=0A= - if ((error =3D iwn_set_pslevel(sc, 0, 0, 0)) !=3D 0) {=0A= + /*=0A= + * Any vap's iv_flags are cloned from ic->ic_flags. Setting the flags=0A= + * on ic will allow a vap to get the correct powersave level once=0A= + * it is created.=0A= + */=0A= + if(sc->desired_pwrsave_level!=3DIWN_POWERSAVE_LVL_NONE)=0A= + ic->ic_flags |=3D IEEE80211_F_PMGTON;=0A= + else=0A= + ic->ic_flags &=3D ~IEEE80211_F_PMGTON;=0A= +=0A= + if ((error =3D iwn_set_pslevel(sc, IWN_POWERSAVE_DTIM_VOIP_COMPATIBLE,=0A= + sc->desired_pwrsave_level, 0)) !=3D 0) {=0A= device_printf(sc->sc_dev,=0A= "%s: could not set power saving level\n", __func__);=0A= return error;=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s: end\n",__func__);=0A= =0A= return 0;=0A= }=0A= @@ -5509,9 +5867,20 @@=0A= uint16_t rxchain;=0A= uint8_t txant;=0A= int buflen, error;=0A= + uint8_t new_scan_threshold;=0A= + struct iwn_eeprom_chan *channel;=0A= =0A= DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= =0A= +=0A= + struct ieee80211vap *vap =3D ni->ni_vap;=0A= + struct iwn_vap *ivp =3D IWN_VAP(vap);=0A= +=0A= + if(ivp->ctx =3D=3D IWN_RXON_BSS_CTX)=0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A= + else if(ivp->ctx =3D=3D IWN_RXON_PAN_CTX)=0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_PAN_CTX];=0A= + =0A= buf =3D malloc(IWN_SCAN_MAXSZ, M_DEVBUF, M_NOWAIT | M_ZERO);=0A= if (buf =3D=3D NULL) {=0A= device_printf(sc->sc_dev,=0A= @@ -5543,7 +5912,11 @@=0A= =0A= tx =3D (struct iwn_cmd_data *)(hdr + 1);=0A= tx->flags =3D htole32(IWN_TX_AUTO_SEQ);=0A= - tx->id =3D sc->broadcast_id;=0A= + if(ivp->ctx =3D=3D IWN_RXON_PAN_CTX)=0A= + tx->id =3D IWN_PAN_BCAST_ID;=0A= + else=0A= + tx->id =3D IWN_BROADCAST_ID;=0A= +=0A= tx->lifetime =3D htole32(IWN_LIFETIME_INFINITE);=0A= =0A= if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan)) {=0A= @@ -5553,7 +5926,7 @@=0A= } else {=0A= hdr->flags =3D htole32(IWN_RXON_24GHZ | IWN_RXON_AUTO);=0A= if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_4965 &&=0A= - sc->rxon.associd && sc->rxon.chan > 14)=0A= + sc->rxon->associd && sc->rxon->chan > 14)=0A= tx->rate =3D htole32(0xd);=0A= else {=0A= /* Send probe requests at 1Mbps. */=0A= @@ -5580,7 +5953,7 @@=0A= IEEE80211_FC0_SUBTYPE_PROBE_REQ;=0A= wh->i_fc[1] =3D IEEE80211_FC1_DIR_NODS;=0A= IEEE80211_ADDR_COPY(wh->i_addr1, ifp->if_broadcastaddr);=0A= - IEEE80211_ADDR_COPY(wh->i_addr2, IF_LLADDR(ifp));=0A= + IEEE80211_ADDR_COPY(wh->i_addr2, ivp->macaddr);=0A= IEEE80211_ADDR_COPY(wh->i_addr3, ifp->if_broadcastaddr);=0A= *(uint16_t *)&wh->i_dur[0] =3D 0; /* filled by HW */=0A= *(uint16_t *)&wh->i_seq[0] =3D 0; /* filled by HW */=0A= @@ -5602,36 +5975,65 @@=0A= chan->flags =3D 0;=0A= if (ss->ss_nssid > 0)=0A= chan->flags |=3D htole32(IWN_CHAN_NPBREQS(1));=0A= - chan->dsp_gain =3D 0x6e;=0A= - if (IEEE80211_IS_CHAN_5GHZ(c) &&=0A= - !(c->ic_flags & IEEE80211_CHAN_PASSIVE)) {=0A= - chan->rf_gain =3D 0x3b;=0A= - chan->active =3D htole16(24);=0A= - chan->passive =3D htole16(110);=0A= - chan->flags |=3D htole32(IWN_CHAN_ACTIVE);=0A= - } else if (IEEE80211_IS_CHAN_5GHZ(c)) {=0A= - chan->rf_gain =3D 0x3b;=0A= - chan->active =3D htole16(24);=0A= - if (sc->rxon.associd)=0A= - chan->passive =3D htole16(78);=0A= + /*=0A= + * If active scanning is requested but a certain channel is=0A= + * marked passive, we can do active scanning if we detect=0A= + * transmissions.=0A= + *=0A= + * There is an issue with some firmware versions that triggers=0A= + * a sysassert on a "good CRC threshold" of zero (=3D=3D disabled),=0A= + * on a radar channel even though this means that we should NOT=0A= + * send probes.=0A= + *=0A= + * The "good CRC threshold" is the number of frames that we=0A= + * need to receive during our dwell time on a channel before=0A= + * sending out probes -- setting this to a huge value will=0A= + * mean we never reach it, but at the same time work around=0A= + * the aforementioned issue. Thus use IWN_SCAN_CRC_TH_NEVER=0A= + * here instead of IWN_SCAN_CRC_TH_DISABLED.=0A= + *=0A= + * This was fixed in later versions along with some other=0A= + * scan changes, and the threshold behaves as a flag in those=0A= + * versions.=0A= + */=0A= +=0A= + channel =3D iwn_find_eeprom_channel(sc, c);=0A= + if (channel =3D=3D NULL) {=0A= + if_printf(ic->ic_ifp,=0A= + "%s: invalid channel %u freq %u/0x%x\n",=0A= + __func__, c->ic_ieee, c->ic_freq, c->ic_flags);=0A= + return EINVAL;=0A= + }=0A= +=0A= + new_scan_threshold =3D ((sc->tlv_feature_flags &=0A= + (1<> = IWN_FW_TLV_FLAGS_NEW_SCAN_BITPOS);=0A= +=0A= + /* Selection criteria for Active/Passive scanning */=0A= + if ((ss->ss_nssid =3D=3D 0) || ((channel->flags & = IWN_EEPROM_CHAN_ACTIVE) =3D=3D 0) ||=0A= + (c->ic_flags & IEEE80211_CHAN_PASSIVE)) {=0A= + chan->flags |=3D htole32(IWN_CHAN_PASSIVE);=0A= + if (new_scan_threshold =3D=3D 1)=0A= + hdr->crc_threshold =3D IWN_SCAN_CRC_TH_DISABLED;=0A= else=0A= - chan->passive =3D htole16(110);=0A= - hdr->crc_threshold =3D 0xffff;=0A= - } else if (!(c->ic_flags & IEEE80211_CHAN_PASSIVE)) {=0A= - chan->rf_gain =3D 0x28;=0A= - chan->active =3D htole16(36);=0A= - chan->passive =3D htole16(120);=0A= + hdr->crc_threshold =3D IWN_SCAN_CRC_TH_NEVER;=0A= + } else {=0A= chan->flags |=3D htole32(IWN_CHAN_ACTIVE);=0A= - } else {=0A= - chan->rf_gain =3D 0x28;=0A= - chan->active =3D htole16(36);=0A= - if (sc->rxon.associd)=0A= - chan->passive =3D htole16(88);=0A= - else=0A= - chan->passive =3D htole16(120);=0A= - hdr->crc_threshold =3D 0xffff;=0A= + hdr->crc_threshold =3D IWN_SCAN_CRC_TH_DEFAULT;=0A= }=0A= =0A= +=0A= + chan->dsp_gain =3D 0x6e;=0A= + if (IEEE80211_IS_CHAN_5GHZ(c))=0A= + chan->rf_gain =3D 0x3b;=0A= + else=0A= + chan->rf_gain =3D 0x28;=0A= +=0A= + =0A= + chan->active =3D htole16(iwn_get_active_dwell(sc, c));=0A= + chan->passive =3D htole16(iwn_get_passive_dwell(sc, c));=0A= +=0A= + =0A= + =0A= DPRINTF(sc, IWN_DEBUG_STATE,=0A= "%s: chan %u flags 0x%x rf_gain 0x%x "=0A= "dsp_gain 0x%x active 0x%x passive 0x%x\n", __func__,=0A= @@ -5645,6 +6047,9 @@=0A= =0A= DPRINTF(sc, IWN_DEBUG_STATE, "sending scan command nchan=3D%d\n",=0A= hdr->nchan);=0A= + =0A= + sc->sc_scan_timer =3D IWN_SCAN_CHAN_TIMEOUT;=0A= + =0A= error =3D iwn_cmd(sc, IWN_CMD_SCAN, buf, buflen, 1);=0A= free(buf, M_DEVBUF);=0A= =0A= @@ -5664,31 +6069,32 @@=0A= =0A= DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= =0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A= /* Update adapter configuration. */=0A= - IEEE80211_ADDR_COPY(sc->rxon.bssid, ni->ni_bssid);=0A= - sc->rxon.chan =3D ieee80211_chan2ieee(ic, ni->ni_chan);=0A= - sc->rxon.flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A= + IEEE80211_ADDR_COPY(sc->rxon->bssid, ni->ni_bssid);=0A= + sc->rxon->chan =3D ieee80211_chan2ieee(ic, ni->ni_chan);=0A= + sc->rxon->flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A= if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))=0A= - sc->rxon.flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= if (ic->ic_flags & IEEE80211_F_SHSLOT)=0A= - sc->rxon.flags |=3D htole32(IWN_RXON_SHSLOT);=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_SHSLOT);=0A= if (ic->ic_flags & IEEE80211_F_SHPREAMBLE)=0A= - sc->rxon.flags |=3D htole32(IWN_RXON_SHPREAMBLE);=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_SHPREAMBLE);=0A= if (IEEE80211_IS_CHAN_A(ni->ni_chan)) {=0A= - sc->rxon.cck_mask =3D 0;=0A= - sc->rxon.ofdm_mask =3D 0x15;=0A= + sc->rxon->cck_mask =3D 0;=0A= + sc->rxon->ofdm_mask =3D 0x15;=0A= } else if (IEEE80211_IS_CHAN_B(ni->ni_chan)) {=0A= - sc->rxon.cck_mask =3D 0x03;=0A= - sc->rxon.ofdm_mask =3D 0;=0A= + sc->rxon->cck_mask =3D 0x03;=0A= + sc->rxon->ofdm_mask =3D 0;=0A= } else {=0A= /* Assume 802.11b/g. */=0A= - sc->rxon.cck_mask =3D 0x0f;=0A= - sc->rxon.ofdm_mask =3D 0x15;=0A= + sc->rxon->cck_mask =3D 0x0f;=0A= + sc->rxon->ofdm_mask =3D 0x15;=0A= }=0A= DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x cck %x ofdm %x\n",=0A= - sc->rxon.chan, sc->rxon.flags, sc->rxon.cck_mask,=0A= - sc->rxon.ofdm_mask);=0A= - error =3D iwn_cmd(sc, IWN_CMD_RXON, &sc->rxon, sc->rxonsz, 1);=0A= + sc->rxon->chan, sc->rxon->flags, sc->rxon->cck_mask,=0A= + sc->rxon->ofdm_mask);=0A= + error =3D iwn_cmd(sc, IWN_CMD_RXON, sc->rxon, sc->rxonsz, 1);=0A= if (error !=3D 0) {=0A= device_printf(sc->sc_dev, "%s: RXON command failed, error %d\n",=0A= __func__, error);=0A= @@ -5705,7 +6111,7 @@=0A= * Reconfiguring RXON clears the firmware nodes table so we must=0A= * add the broadcast node again.=0A= */=0A= - if ((error =3D iwn_add_broadcast_node(sc, 1)) !=3D 0) {=0A= + if ((error =3D iwn_add_broadcast_node(sc, 0)) !=3D 0) {=0A= device_printf(sc->sc_dev,=0A= "%s: could not add broadcast node, error %d\n", __func__,=0A= error);=0A= @@ -5730,9 +6136,20 @@=0A= =0A= DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= =0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A= + =0A= + if(sc->ctx =3D=3D IWN_RXON_PAN_CTX) { =0A= + if ((error =3D iwn_set_pan_params(sc)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: iwn_set_pan_params error %d\n", __func__, error);=0A= + return error;=0A= + }=0A= + }=0A= +=0A= + =0A= if (ic->ic_opmode =3D=3D IEEE80211_M_MONITOR) {=0A= /* Link LED blinks while monitoring. */=0A= - iwn_set_led(sc, IWN_LED_LINK, 5, 5);=0A= + iwn_set_led(sc, IWN_LED_LINK, 5, 5,IWN_LED_INT_BLINK);=0A= return 0;=0A= }=0A= if ((error =3D iwn_set_timing(sc, ni)) !=3D 0) {=0A= @@ -5742,26 +6159,26 @@=0A= }=0A= =0A= /* Update adapter configuration. */=0A= - IEEE80211_ADDR_COPY(sc->rxon.bssid, ni->ni_bssid);=0A= - sc->rxon.associd =3D htole16(IEEE80211_AID(ni->ni_associd));=0A= - sc->rxon.chan =3D ieee80211_chan2ieee(ic, ni->ni_chan);=0A= - sc->rxon.flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A= + IEEE80211_ADDR_COPY(sc->rxon->bssid, ni->ni_bssid);=0A= + sc->rxon->associd =3D htole16(IEEE80211_AID(ni->ni_associd));=0A= + sc->rxon->chan =3D ieee80211_chan2ieee(ic, ni->ni_chan);=0A= + sc->rxon->flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A= if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))=0A= - sc->rxon.flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= if (ic->ic_flags & IEEE80211_F_SHSLOT)=0A= - sc->rxon.flags |=3D htole32(IWN_RXON_SHSLOT);=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_SHSLOT);=0A= if (ic->ic_flags & IEEE80211_F_SHPREAMBLE)=0A= - sc->rxon.flags |=3D htole32(IWN_RXON_SHPREAMBLE);=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_SHPREAMBLE);=0A= if (IEEE80211_IS_CHAN_A(ni->ni_chan)) {=0A= - sc->rxon.cck_mask =3D 0;=0A= - sc->rxon.ofdm_mask =3D 0x15;=0A= + sc->rxon->cck_mask =3D 0;=0A= + sc->rxon->ofdm_mask =3D 0x15;=0A= } else if (IEEE80211_IS_CHAN_B(ni->ni_chan)) {=0A= - sc->rxon.cck_mask =3D 0x03;=0A= - sc->rxon.ofdm_mask =3D 0;=0A= + sc->rxon->cck_mask =3D 0x03;=0A= + sc->rxon->ofdm_mask =3D 0;=0A= } else {=0A= /* Assume 802.11b/g. */=0A= - sc->rxon.cck_mask =3D 0x0f;=0A= - sc->rxon.ofdm_mask =3D 0x15;=0A= + sc->rxon->cck_mask =3D 0x0f;=0A= + sc->rxon->ofdm_mask =3D 0x15;=0A= }=0A= if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) {=0A= htflags |=3D IWN_RXON_HT_PROTMODE(ic->ic_curhtprotmode);=0A= @@ -5778,11 +6195,11 @@=0A= if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan))=0A= htflags |=3D IWN_RXON_HT_HT40MINUS;=0A= }=0A= - sc->rxon.flags |=3D htole32(htflags);=0A= - sc->rxon.filter |=3D htole32(IWN_FILTER_BSS);=0A= + sc->rxon->flags |=3D htole32(htflags);=0A= + sc->rxon->filter |=3D htole32(IWN_FILTER_BSS);=0A= DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x\n",=0A= - sc->rxon.chan, sc->rxon.flags);=0A= - error =3D iwn_cmd(sc, IWN_CMD_RXON, &sc->rxon, sc->rxonsz, 1);=0A= + sc->rxon->chan, sc->rxon->flags);=0A= + error =3D iwn_cmd(sc, IWN_CMD_RXON, sc->rxon, sc->rxonsz, 1);=0A= if (error !=3D 0) {=0A= device_printf(sc->sc_dev,=0A= "%s: could not update configuration, error %d\n", __func__,=0A= @@ -5820,12 +6237,13 @@=0A= node.htflags |=3D htole32(IWN_NODE_HT40);=0A= }=0A= DPRINTF(sc, IWN_DEBUG_STATE, "%s: adding BSS node\n", __func__);=0A= - error =3D ops->add_node(sc, &node, 1);=0A= + error =3D ops->add_node(sc, &node, 0);=0A= if (error !=3D 0) {=0A= device_printf(sc->sc_dev,=0A= "%s: could not add BSS node, error %d\n", __func__, error);=0A= return error;=0A= }=0A= + /*XXX Not done in iwl =0A= DPRINTF(sc, IWN_DEBUG_STATE, "%s: setting link quality for node %d\n",=0A= __func__, node.id);=0A= if ((error =3D iwn_set_link_quality(sc, ni)) !=3D 0) {=0A= @@ -5841,18 +6259,26 @@=0A= error);=0A= return error;=0A= }=0A= - /* Start periodic calibration timer. */=0A= + // Start periodic calibration timer. =0A= sc->calib.state =3D IWN_CALIB_STATE_ASSOC;=0A= sc->calib_cnt =3D 0;=0A= callout_reset(&sc->calib_to, msecs_to_ticks(500), iwn_calib_timeout,=0A= sc);=0A= =0A= + */=0A= + =0A= /* Link LED always on while associated. */=0A= - iwn_set_led(sc, IWN_LED_LINK, 0, 1);=0A= + iwn_set_led(sc, IWN_LED_LINK, 0, 1,IWN_LED_STATIC_ON);=0A= =0A= DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= =0A= - return 0;=0A= +#ifdef IWN_DTIM_INDICATES_UNICAST_PENDING_AT_AP=0A= + return iwn_set_pslevel(sc, IWN_POWERSAVE_DTIM_VOIP_COMPATIBLE,=0A= + sc->desired_pwrsave_level, 0);=0A= +#else=0A= + return 0;=0A= +#endif=0A= +=0A= }=0A= =0A= /*=0A= @@ -5986,7 +6412,7 @@=0A= iwn_ampdu_tx_start(struct ieee80211com *ic, struct ieee80211_node *ni,=0A= uint8_t tid)=0A= {=0A= - struct ieee80211_tx_ampdu *tap =3D &ni->ni_tx_ampdu[tid];=0A= + struct ieee80211_tx_ampdu *tap =3D = &ni->ni_tx_ampdu[TID_TO_WME_AC(tid)];=0A= struct iwn_softc *sc =3D ni->ni_ic->ic_ifp->if_softc;=0A= struct iwn_ops *ops =3D &sc->ops;=0A= struct iwn_node *wn =3D (void *)ni;=0A= @@ -6205,9 +6631,15 @@=0A= {=0A= int idx, error;=0A= =0A= - for (idx =3D 0; idx < 5; idx++) {=0A= - if (sc->calibcmd[idx].buf =3D=3D NULL)=0A= - continue; /* No results available. */=0A= + for (idx =3D 0; idx < IWN5000_PHY_CALIB_MAX_RESULT ; idx++) {=0A= + if (!(sc->base_params->calib_need & (1<calibcmd[idx].buf =3D=3D NULL) {=0A= + DPRINTF(sc, IWN_DEBUG_CALIBRATE, "Need calib idx : %d but no = available data\n",idx);=0A= + continue;=0A= + }=0A= DPRINTF(sc, IWN_DEBUG_CALIBRATE,=0A= "send calibration result idx=3D%d len=3D%d\n", idx,=0A= sc->calibcmd[idx].len);=0A= @@ -6279,11 +6711,43 @@=0A= cmd.offset =3D htole16(sc->eeprom_temp);=0A= else=0A= cmd.offset =3D htole16(IWN_DEFAULT_TEMP_OFFSET);=0A= + =0A= +=0A= DPRINTF(sc, IWN_DEBUG_CALIBRATE, "setting radio sensor offset to %d\n",=0A= le16toh(cmd.offset));=0A= return iwn_cmd(sc, IWN_CMD_PHY_CALIB, &cmd, sizeof cmd, 0);=0A= + =0A= + =0A= + =0A= }=0A= =0A= +static int=0A= +iwn5000_temp_offset_calibv2(struct iwn_softc *sc)=0A= +{=0A= + struct iwn5000_phy_calib_temp_offsetv2 cmd;=0A= +=0A= + memset(&cmd, 0, sizeof cmd);=0A= + cmd.code =3D IWN5000_PHY_CALIB_TEMP_OFFSET;=0A= + cmd.ngroups =3D 1;=0A= + cmd.isvalid =3D 1;=0A= + if (sc->eeprom_temp !=3D 0) {=0A= + cmd.offset_low =3D htole16(sc->eeprom_temp);=0A= + cmd.offset_high =3D htole16(sc->eeprom_temp_high);=0A= + } else {=0A= + cmd.offset_low =3D htole16(IWN_DEFAULT_TEMP_OFFSET);=0A= + cmd.offset_high =3D htole16(IWN_DEFAULT_TEMP_OFFSET);=0A= + }=0A= + cmd.burntVoltageRef =3D htole16(sc->eeprom_voltage);=0A= + =0A= + DPRINTF(sc, IWN_DEBUG_CALIBRATE, "setting radio sensor low offset to = %d, high offset to %d, voltage to %d\n",=0A= + le16toh(cmd.offset_low),=0A= + le16toh(cmd.offset_high),=0A= + le16toh(cmd.burntVoltageRef));=0A= + =0A= + return iwn_cmd(sc, IWN_CMD_PHY_CALIB, &cmd, sizeof cmd, 0);=0A= +}=0A= +=0A= +=0A= /*=0A= * This function is called after the runtime firmware notifies us of its=0A= * readiness (called in a process context).=0A= @@ -6353,10 +6817,8 @@=0A= /* Switch to using ICT interrupt mode. */=0A= iwn5000_ict_reset(sc);=0A= =0A= - if ((error =3D iwn_nic_lock(sc)) !=3D 0){=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end in error\n", __func__);=0A= + if ((error =3D iwn_nic_lock(sc)) !=3D 0)=0A= return error;=0A= - }=0A= =0A= /* Clear TX scheduler state in SRAM. */=0A= sc->sched_base =3D iwn_prph_read(sc, IWN_SCHED_SRAM_ADDR);=0A= @@ -6369,7 +6831,11 @@=0A= IWN_SETBITS(sc, IWN_FH_TX_CHICKEN, IWN_FH_TX_CHICKEN_SCHED_RETRY);=0A= =0A= /* Enable chain mode for all queues, except command queue. */=0A= - iwn_prph_write(sc, IWN5000_SCHED_QCHAIN_SEL, 0xfffef);=0A= + if(sc->sc_flags & IWN_FLAG_PAN_SUPPORT)=0A= + iwn_prph_write(sc, IWN5000_SCHED_QCHAIN_SEL, 0xffdff);=0A= + else=0A= + iwn_prph_write(sc, IWN5000_SCHED_QCHAIN_SEL, 0xfffef);=0A= +=0A= iwn_prph_write(sc, IWN5000_SCHED_AGGR_SEL, 0);=0A= =0A= for (qid =3D 0; qid < IWN5000_NTXQUEUES; qid++) {=0A= @@ -6389,32 +6855,29 @@=0A= /* Identify TX FIFO rings (0-7). */=0A= iwn_prph_write(sc, IWN5000_SCHED_TXFACT, 0xff);=0A= =0A= - /* Mark TX rings (4 EDCA + cmd + 2 HCCA) as active. */=0A= - for (qid =3D 0; qid < 7; qid++) {=0A= - static uint8_t qid2fifo[] =3D { 3, 2, 1, 0, 7, 5, 6 };=0A= - iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid),=0A= - IWN5000_TXQ_STATUS_ACTIVE | qid2fifo[qid]);=0A= + if(sc->sc_flags & IWN_FLAG_PAN_SUPPORT) { =0A= + /* Mark TX rings as active. */=0A= + for (qid =3D 0; qid < 11; qid++) {=0A= + static uint8_t qid2fifo[] =3D { 3, 2, 1, 0, 0, 4, 2, 5, 4, 7, 5 };=0A= + iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid),=0A= + IWN5000_TXQ_STATUS_ACTIVE | qid2fifo[qid]);=0A= + }=0A= + } else {=0A= + /* Mark TX rings (4 EDCA + cmd + 2 HCCA) as active. */=0A= + for (qid =3D 0; qid < 7; qid++) {=0A= + static uint8_t qid2fifo[] =3D { 3, 2, 1, 0, 7, 5, 6 };=0A= + iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid),=0A= + IWN5000_TXQ_STATUS_ACTIVE | qid2fifo[qid]);=0A= + }=0A= }=0A= iwn_nic_unlock(sc);=0A= =0A= - /* Configure WiMAX coexistence for combo adapters. */=0A= - error =3D iwn5000_send_wimax_coex(sc);=0A= - if (error !=3D 0) {=0A= - device_printf(sc->sc_dev,=0A= - "%s: could not configure WiMAX coexistence, error %d\n",=0A= - __func__, error);=0A= + =0A= + if ((error=3Diwn_cfg_ucode_post_alive(sc))!=3D0) {=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end in error\n", __func__);=0A= return error;=0A= }=0A= - if (sc->hw_type !=3D IWN_HW_REV_TYPE_5150) {=0A= - /* Perform crystal calibration. */=0A= - error =3D iwn5000_crystal_calib(sc);=0A= - if (error !=3D 0) {=0A= - device_printf(sc->sc_dev,=0A= - "%s: crystal calibration failed, error %d\n",=0A= - __func__, error);=0A= - return error;=0A= - }=0A= - }=0A= + =0A= if (!(sc->sc_flags & IWN_FLAG_CALIB_DONE)) {=0A= /* Query calibration from the initialization firmware. */=0A= if ((error =3D iwn5000_query_calibration(sc)) !=3D 0) {=0A= @@ -6423,6 +6886,7 @@=0A= __func__, error);=0A= return error;=0A= }=0A= +=0A= /*=0A= * We have the calibration results now, reboot with the=0A= * runtime firmware (call ourselves recursively!)=0A= @@ -6432,10 +6896,9 @@=0A= } else {=0A= /* Send calibration results to runtime firmware. */=0A= error =3D iwn5000_send_calibration(sc);=0A= + =0A= }=0A= -=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= -=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= return error;=0A= }=0A= =0A= @@ -6764,6 +7227,25 @@=0A= sc->noise_gain =3D tmp + 1;=0A= }=0A= break;=0A= + case IWN_FW_TLV_PAN:=0A= + sc->sc_flags |=3D IWN_FLAG_PAN_SUPPORT;=0A= + DPRINTF(sc, IWN_DEBUG_RESET,"PAN Support found : %d\n", 1);=0A= + break;=0A= + case IWN_FW_TLV_FLAGS :=0A= + sc->tlv_feature_flags =3D htole32(*ptr);=0A= + break;=0A= + case IWN_FW_TLV_PBREQ_MAXLEN:=0A= + case IWN_FW_TLV_RUNT_EVTLOG_PTR:=0A= + case IWN_FW_TLV_RUNT_EVTLOG_SIZE:=0A= + case IWN_FW_TLV_RUNT_ERRLOG_PTR:=0A= + case IWN_FW_TLV_INIT_EVTLOG_PTR:=0A= + case IWN_FW_TLV_INIT_EVTLOG_SIZE: =0A= + case IWN_FW_TLV_INIT_ERRLOG_PTR:=0A= + case IWN_FW_TLV_WOWLAN_INST:=0A= + case IWN_FW_TLV_WOWLAN_DATA:=0A= + DPRINTF(sc, IWN_DEBUG_RESET,=0A= + "TLV type %d reconized but not handled\n", le16toh(tlv->type));=0A= + break;=0A= default:=0A= DPRINTF(sc, IWN_DEBUG_RESET,=0A= "TLV type %d not handled\n", le16toh(tlv->type));=0A= @@ -6885,9 +7367,8 @@=0A= else=0A= IWN_CLRBITS(sc, IWN_GIO, IWN_GIO_L0S_ENA);=0A= =0A= - if (sc->hw_type !=3D IWN_HW_REV_TYPE_4965 &&=0A= - sc->hw_type <=3D IWN_HW_REV_TYPE_1000)=0A= - IWN_SETBITS(sc, IWN_ANA_PLL, IWN_ANA_PLL_INIT);=0A= + if (sc->base_params->pll_cfg_val)=0A= + IWN_SETBITS(sc, IWN_ANA_PLL, sc->base_params->pll_cfg_val);=0A= =0A= /* Wait for clock stabilization before accessing prph. */=0A= if ((error =3D iwn_clock_wait(sc)) !=3D 0)=0A= @@ -6931,13 +7412,20 @@=0A= static void=0A= iwn_apm_stop(struct iwn_softc *sc)=0A= {=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= +=0A= iwn_apm_stop_master(sc);=0A= =0A= +=0A= /* Reset the entire device. */=0A= IWN_SETBITS(sc, IWN_RESET, IWN_RESET_SW);=0A= DELAY(10);=0A= /* Clear "initialization complete" bit. */=0A= IWN_CLRBITS(sc, IWN_GP_CNTRL, IWN_GP_CNTRL_INIT_DONE);=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= +=0A= + =0A= }=0A= =0A= static int=0A= @@ -6999,13 +7487,15 @@=0A= /* Use internal power amplifier only. */=0A= IWN_WRITE(sc, IWN_GP_DRIVER, IWN_GP_DRIVER_RADIO_2X2_IPA);=0A= }=0A= - if ((sc->hw_type =3D=3D IWN_HW_REV_TYPE_6050 ||=0A= - sc->hw_type =3D=3D IWN_HW_REV_TYPE_6005) && sc->calib_ver >=3D 6) = {=0A= + if (sc->base_params->additional_nic_config && sc->calib_ver >=3D 6) {=0A= /* Indicate that ROM calibration version is >=3D6. */=0A= IWN_SETBITS(sc, IWN_GP_DRIVER, IWN_GP_DRIVER_CALIB_VER6);=0A= }=0A= - if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_6005)=0A= - IWN_SETBITS(sc, IWN_GP_DRIVER, IWN_GP_DRIVER_6050_1X2);=0A= + if (sc->base_params->additional_gp_drv_bit) =0A= + IWN_SETBITS(sc, IWN_GP_DRIVER, = sc->base_params->additional_gp_drv_bit);=0A= +/* if (sc->base_params->iq_invert) =0A= + IWN_SETBITS(sc, IWN_GP_DRIVER, IWN_GP_DRIVER_REG_BIT_RADIO_IQ_INVERT);=0A= +*/ DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= return 0;=0A= }=0A= =0A= @@ -7018,13 +7508,15 @@=0A= int ntries;=0A= =0A= DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= -=0A= + =0A= /* Check if hardware is ready. */=0A= IWN_SETBITS(sc, IWN_HW_IF_CONFIG, IWN_HW_IF_CONFIG_NIC_READY);=0A= for (ntries =3D 0; ntries < 5; ntries++) {=0A= if (IWN_READ(sc, IWN_HW_IF_CONFIG) &=0A= - IWN_HW_IF_CONFIG_NIC_READY)=0A= - return 0;=0A= + IWN_HW_IF_CONFIG_NIC_READY) {=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + return 0;=0A= + }=0A= DELAY(10);=0A= }=0A= =0A= @@ -7036,18 +7528,24 @@=0A= break;=0A= DELAY(10);=0A= }=0A= - if (ntries =3D=3D 15000)=0A= + if (ntries =3D=3D 15000) {=0A= + DPRINTF(sc, IWN_DEBUG_RESET, "->%s end timeout\n", __func__);=0A= return ETIMEDOUT;=0A= + }=0A= =0A= /* Hardware should be ready now. */=0A= IWN_SETBITS(sc, IWN_HW_IF_CONFIG, IWN_HW_IF_CONFIG_NIC_READY);=0A= for (ntries =3D 0; ntries < 5; ntries++) {=0A= if (IWN_READ(sc, IWN_HW_IF_CONFIG) &=0A= - IWN_HW_IF_CONFIG_NIC_READY)=0A= - return 0;=0A= + IWN_HW_IF_CONFIG_NIC_READY) {=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + return 0;=0A= + }=0A= DELAY(10);=0A= }=0A= + DPRINTF(sc, IWN_DEBUG_RESET, "->%s end timeout\n", __func__);=0A= return ETIMEDOUT;=0A= + =0A= }=0A= =0A= static int=0A= @@ -7060,7 +7558,7 @@=0A= =0A= /* Clear pending interrupts. */=0A= IWN_WRITE(sc, IWN_INT, 0xffffffff);=0A= -=0A= + =0A= if ((error =3D iwn_apm_init(sc)) !=3D 0) {=0A= device_printf(sc->sc_dev,=0A= "%s: could not power ON adapter, error %d\n", __func__,=0A= @@ -7140,7 +7638,7 @@=0A= IWN_WRITE(sc, IWN_UCODE_GP1_CLR, IWN_UCODE_GP1_RFKILL);=0A= =0A= /* Enable shadow registers. */=0A= - if (sc->hw_type >=3D IWN_HW_REV_TYPE_6000)=0A= + if (sc->base_params->shadow_reg_enable)=0A= IWN_SETBITS(sc, IWN_SHADOW_REG_CTRL, 0x800fffff);=0A= =0A= if ((error =3D ops->load_firmware(sc)) !=3D 0) {=0A= @@ -7211,6 +7709,12 @@=0A= iwn_nic_unlock(sc);=0A= }=0A= DELAY(5);=0A= + =0A= + if (sc->sc_led.led_cur_mode !=3D IWN_LED_STATIC_OFF) {=0A= + sc->sc_led.led_cur_mode =3D IWN_LED_STATIC_OFF;=0A= + iwn_set_led(sc, IWN_LED_LINK, 1, 0, IWN_LED_STATIC_OFF);=0A= + }=0A= +=0A= /* Power OFF adapter. */=0A= iwn_apm_stop(sc);=0A= }=0A= @@ -7259,7 +7763,6 @@=0A= int error;=0A= =0A= DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= -=0A= IWN_LOCK_ASSERT(sc);=0A= =0A= if ((error =3D iwn_hw_prepare(sc)) !=3D 0) {=0A= @@ -7329,6 +7832,7 @@=0A= struct ifnet *ifp =3D sc->sc_ifp;=0A= struct ieee80211com *ic =3D ifp->if_l2com;=0A= =0A= + =0A= IWN_LOCK(sc);=0A= iwn_init_locked(sc);=0A= IWN_UNLOCK(sc);=0A= @@ -7345,6 +7849,7 @@=0A= IWN_LOCK_ASSERT(sc);=0A= =0A= sc->sc_tx_timer =3D 0;=0A= + sc->sc_scan_timer =3D 0;=0A= callout_stop(&sc->watchdog_to);=0A= callout_stop(&sc->calib_to);=0A= ifp->if_drv_flags &=3D ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);=0A= @@ -7369,10 +7874,24 @@=0A= {=0A= struct ifnet *ifp =3D ic->ic_ifp;=0A= struct iwn_softc *sc =3D ifp->if_softc;=0A= + struct ieee80211_scan_state *ss =3D ic->ic_scan;=0A= + struct ieee80211vap *vap =3D ss->ss_vap;=0A= =0A= +=0A= IWN_LOCK(sc);=0A= + =0A= + sc->uc_scan_progress =3D 1;=0A= + if(sc->ctx =3D=3D IWN_RXON_PAN_CTX)=0A= + iwn_set_pan_params(sc);=0A= +=0A= /* make the link LED blink while we're scanning */=0A= - iwn_set_led(sc, IWN_LED_LINK, 20, 2);=0A= + if (vap->iv_state !=3D IEEE80211_S_RUN) {=0A= + if(sc->sc_led.led_cur_mode !=3D IWN_LED_SLOW_BLINK) {=0A= + sc->sc_led.led_cur_mode =3D IWN_LED_SLOW_BLINK;=0A= + iwn_set_led(sc, IWN_LED_LINK, 190, 10,IWN_LED_SLOW_BLINK);=0A= + }=0A= + }=0A= +=0A= IWN_UNLOCK(sc);=0A= }=0A= =0A= @@ -7384,12 +7903,20 @@=0A= {=0A= struct ifnet *ifp =3D ic->ic_ifp;=0A= struct iwn_softc *sc =3D ifp->if_softc;=0A= - struct ieee80211vap *vap =3D TAILQ_FIRST(&ic->ic_vaps);=0A= + struct ieee80211_scan_state *ss =3D ic->ic_scan;=0A= + struct ieee80211vap *vap =3D ss->ss_vap;=0A= =0A= +=0A= IWN_LOCK(sc);=0A= +=0A= + sc->uc_scan_progress =3D 0;=0A= + sc->sc_scan_timer =3D 0;=0A= + if(sc->ctx =3D=3D IWN_RXON_PAN_CTX)=0A= + iwn_set_pan_params(sc);=0A= + =0A= if (vap->iv_state =3D=3D IEEE80211_S_RUN) {=0A= - /* Set link LED to ON status if we are associated */=0A= - iwn_set_led(sc, IWN_LED_LINK, 0, 1);=0A= + sc->sc_led.led_cur_mode =3D IWN_LED_STATIC_ON;=0A= + iwn_set_led(sc, IWN_LED_LINK, 0, 1,IWN_LED_STATIC_ON);=0A= }=0A= IWN_UNLOCK(sc);=0A= }=0A= @@ -7437,10 +7964,14 @@=0A= int error;=0A= =0A= IWN_LOCK(sc);=0A= + sc->sc_scan_timer =3D 0;=0A= error =3D iwn_scan(sc);=0A= IWN_UNLOCK(sc);=0A= - if (error !=3D 0)=0A= + if (error !=3D 0) {=0A= + sc->uc_scan_progress =3D 0;=0A= + sc->sc_scan_timer =3D 0;=0A= ieee80211_cancel_scan(vap);=0A= + }=0A= }=0A= =0A= /*=0A= @@ -7467,3 +7998,1140 @@=0A= iwn_init(sc);=0A= ieee80211_notify_radio(ic, 1);=0A= }=0A= +#ifdef IWN_DEBUG=0A= +#define IWN_DESC(x) case x: return #x=0A= +#define COUNTOF(array) (sizeof(array) / sizeof(array[0]))=0A= +=0A= +/*=0A= + * Transate CSR code to string=0A= + */=0A= +static char *iwn_get_csr_string(int csr)=0A= +{=0A= + switch (csr) {=0A= + IWN_DESC(IWN_HW_IF_CONFIG); =0A= + IWN_DESC(IWN_INT_COALESCING); =0A= + IWN_DESC(IWN_INT);=0A= + IWN_DESC(IWN_INT_MASK);=0A= + IWN_DESC(IWN_FH_INT);=0A= + IWN_DESC(IWN_GPIO_IN);=0A= + IWN_DESC(IWN_RESET);=0A= + IWN_DESC(IWN_GP_CNTRL);=0A= + IWN_DESC(IWN_HW_REV); =0A= + IWN_DESC(IWN_EEPROM); =0A= + IWN_DESC(IWN_EEPROM_GP);=0A= + IWN_DESC(IWN_OTP_GP); =0A= + IWN_DESC(IWN_GIO);=0A= + IWN_DESC(IWN_GP_UCODE);=0A= + IWN_DESC(IWN_GP_DRIVER); =0A= + IWN_DESC(IWN_UCODE_GP1);=0A= + IWN_DESC(IWN_UCODE_GP2); =0A= + IWN_DESC(IWN_LED);=0A= + IWN_DESC(IWN_DRAM_INT_TBL);=0A= + IWN_DESC(IWN_GIO_CHICKEN); =0A= + IWN_DESC(IWN_ANA_PLL); =0A= + IWN_DESC(IWN_HW_REV_WA);=0A= + IWN_DESC(IWN_DBG_HPET_MEM);=0A= + default:=0A= + return "UNKNOWN CSR";=0A= + }=0A= +}=0A= +=0A= +/*=0A= + * This function print firmawre register=0A= + */=0A= +static void=0A= +iwn_debug_register(struct iwn_softc *sc)=0A= +{=0A= + int i;=0A= + static const uint32_t csr_tbl[] =3D {=0A= + IWN_HW_IF_CONFIG, =0A= + IWN_INT_COALESCING, =0A= + IWN_INT,=0A= + IWN_INT_MASK,=0A= + IWN_FH_INT,=0A= + IWN_GPIO_IN,=0A= + IWN_RESET, =0A= + IWN_GP_CNTRL, =0A= + IWN_HW_REV, =0A= + IWN_EEPROM,=0A= + IWN_EEPROM_GP, =0A= + IWN_OTP_GP, =0A= + IWN_GIO,=0A= + IWN_GP_UCODE, =0A= + IWN_GP_DRIVER, =0A= + IWN_UCODE_GP1, =0A= + IWN_UCODE_GP2, =0A= + IWN_LED, =0A= + IWN_DRAM_INT_TBL,=0A= + IWN_GIO_CHICKEN, =0A= + IWN_ANA_PLL, =0A= + IWN_HW_REV_WA, =0A= + IWN_DBG_HPET_MEM,=0A= + };=0A= + DPRINTF(sc, IWN_DEBUG_REGISTER,=0A= + "CSR values: (2nd byte of IWN_INT_COALESCING is = IWN_INT_PERIODIC)%s",=0A= + "\n");=0A= + for (i =3D 0; i < COUNTOF(csr_tbl); i++){=0A= + DPRINTF(sc, IWN_DEBUG_REGISTER," %10s: 0x%08x ",=0A= + iwn_get_csr_string(csr_tbl[i]), IWN_READ(sc, csr_tbl[i]));=0A= + if ((i+1) % 3 =3D=3D 0)=0A= + DPRINTF(sc, IWN_DEBUG_REGISTER,"%s","\n");=0A= + }=0A= + DPRINTF(sc, IWN_DEBUG_REGISTER,"%s","\n");=0A= +}=0A= +#endif=0A= +=0A= +=0A= +/* Define specific configuration based on device id and subdevice id */=0A= +/* pid : PCI device id */=0A= +static int=0A= +iwn_config_specific(struct iwn_softc *sc,uint16_t pid)=0A= +{=0A= + switch(pid) {=0A= +/* 1000 Series */=0A= + case IWN_DID_1000_1:=0A= + case IWN_DID_1000_2:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_1000_1:=0A= + case IWN_SDID_1000_2:=0A= + case IWN_SDID_1000_3:=0A= + case IWN_SDID_1000_4:=0A= + case IWN_SDID_1000_5:=0A= + case IWN_SDID_1000_6:=0A= + case IWN_SDID_1000_7:=0A= + case IWN_SDID_1000_8:=0A= + case IWN_SDID_1000_9:=0A= + case IWN_SDID_1000_10:=0A= + case IWN_SDID_1000_11:=0A= + case IWN_SDID_1000_12:=0A= + sc->limits =3D &iwn1000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_1000_base_params; =0A= + sc->fwname =3D "iwn1000fw";=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 6x00 Series */=0A= + case IWN_DID_6x00_2:=0A= + case IWN_DID_6x00_4:=0A= + case IWN_DID_6x00_1:=0A= + case IWN_DID_6x00_3:=0A= + sc->fwname =3D "iwn6000fw";=0A= + sc->limits =3D &iwn6000_sensitivity_limits;=0A= + switch(sc->subdevice_id) {=0A= +=0A= + case IWN_SDID_6x00_1:=0A= + case IWN_SDID_6x00_2:=0A= + case IWN_SDID_6x00_8:=0A= + //iwl6000_3agn_cfg=0A= + sc->base_params =3D &iwn_6000_base_params;=0A= + break;=0A= + case IWN_SDID_6x00_3:=0A= + case IWN_SDID_6x00_6:=0A= + case IWN_SDID_6x00_9:=0A= + ////iwl6000i_2agn=0A= + case IWN_SDID_6x00_4:=0A= + case IWN_SDID_6x00_7:=0A= + case IWN_SDID_6x00_10: =0A= + //iwl6000i_2abg_cfg=0A= + case IWN_SDID_6x00_5:=0A= + //iwl6000i_2bg_cfg=0A= + sc->base_params =3D &iwn_6000i_base_params;=0A= + sc->sc_flags |=3D IWN_FLAG_INTERNAL_PA;=0A= + sc->txchainmask =3D IWN_ANT_BC;=0A= + sc->rxchainmask =3D IWN_ANT_BC;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 6x05 Series */=0A= + case IWN_DID_6x05_1: =0A= + case IWN_DID_6x05_2:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_6x05_1:=0A= + case IWN_SDID_6x05_4:=0A= + case IWN_SDID_6x05_6:=0A= + //iwl6005_2agn_cfg=0A= + case IWN_SDID_6x05_2:=0A= + case IWN_SDID_6x05_5:=0A= + case IWN_SDID_6x05_7:=0A= + //iwl6005_2abg_cfg=0A= + case IWN_SDID_6x05_3:=0A= + //iwl6005_2bg_cfg=0A= + case IWN_SDID_6x05_8:=0A= + case IWN_SDID_6x05_9:=0A= + //iwl6005_2agn_sff_cfg=0A= + case IWN_SDID_6x05_10:=0A= + //iwl6005_2agn_d_cfg=0A= + case IWN_SDID_6x05_11:=0A= + //iwl6005_2agn_mow1_cfg=0A= + case IWN_SDID_6x05_12:=0A= + //iwl6005_2agn_mow2_cfg=0A= + sc->fwname =3D "iwn6000g2afw";=0A= + sc->limits =3D &iwn6000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_6000g2_base_params;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : = 0x%04x rev %d not supported (subdevice) = \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 6x35 Series */=0A= + case IWN_DID_6035_1:=0A= + case IWN_DID_6035_2:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_6035_1:=0A= + case IWN_SDID_6035_2:=0A= + case IWN_SDID_6035_3:=0A= + case IWN_SDID_6035_4:=0A= + sc->fwname =3D "iwn6000g2bfw";=0A= + sc->limits =3D &iwn6000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_6000g2b_base_params;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : = 0x%04x rev %d not supported (subdevice) = \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 6x50 WiFi/WiMax Series */=0A= + case IWN_DID_6050_1:=0A= + case IWN_DID_6050_2:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_6050_1:=0A= + case IWN_SDID_6050_3:=0A= + case IWN_SDID_6050_5:=0A= + //iwl6050_2agn_cfg=0A= + case IWN_SDID_6050_2:=0A= + case IWN_SDID_6050_4:=0A= + case IWN_SDID_6050_6:=0A= + //iwl6050_2abg_cfg=0A= + sc->fwname =3D "iwn6050fw";=0A= + sc->txchainmask =3D IWN_ANT_AB;=0A= + sc->rxchainmask =3D IWN_ANT_AB;=0A= + sc->limits =3D &iwn6000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_6050_base_params;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : = 0x%04x rev %d not supported (subdevice) = \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 6150 WiFi/WiMax Series */=0A= + case IWN_DID_6150_1:=0A= + case IWN_DID_6150_2:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_6150_1:=0A= + case IWN_SDID_6150_3:=0A= + case IWN_SDID_6150_5:=0A= + // iwl6150_bgn_cfg=0A= + case IWN_SDID_6150_2:=0A= + case IWN_SDID_6150_4:=0A= + case IWN_SDID_6150_6:=0A= + //iwl6150_bg_cfg=0A= + sc->fwname =3D "iwn6050fw";=0A= + sc->limits =3D &iwn6000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_6150_base_params;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : = 0x%04x rev %d not supported (subdevice) = \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 6030 Series and 1030 Series */=0A= + case IWN_DID_x030_1:=0A= + case IWN_DID_x030_2:=0A= + case IWN_DID_x030_3:=0A= + case IWN_DID_x030_4:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_x030_1:=0A= + case IWN_SDID_x030_3:=0A= + case IWN_SDID_x030_5:=0A= + // iwl1030_bgn_cfg=0A= + =0A= + case IWN_SDID_x030_2:=0A= + case IWN_SDID_x030_4:=0A= + case IWN_SDID_x030_6:=0A= + //iwl1030_bg_cfg=0A= + =0A= + case IWN_SDID_x030_7:=0A= + case IWN_SDID_x030_10:=0A= + case IWN_SDID_x030_14:=0A= + //iwl6030_2agn_cfg=0A= + =0A= + case IWN_SDID_x030_8:=0A= + case IWN_SDID_x030_11:=0A= + case IWN_SDID_x030_15:=0A= + // iwl6030_2bgn_cfg=0A= + =0A= + case IWN_SDID_x030_9:=0A= + case IWN_SDID_x030_12:=0A= + case IWN_SDID_x030_16:=0A= + // iwl6030_2abg_cfg=0A= + =0A= + case IWN_SDID_x030_13:=0A= + //iwl6030_2bg_cfg=0A= + sc->fwname =3D "iwn6000g2bfw";=0A= + sc->limits =3D &iwn6000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_6000g2b_base_params;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : = 0x%04x rev %d not supported (subdevice) = \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 130 Series WiFi */=0A= +/* XXX: This series will need adjustement for rate see = rx_with_siso_diversity in linux kernel */=0A= + case IWN_DID_130_1:=0A= + case IWN_DID_130_2:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_130_1: =0A= + case IWN_SDID_130_3:=0A= + case IWN_SDID_130_5:=0A= + //iwl130_bgn_cfg=0A= + case IWN_SDID_130_2:=0A= + case IWN_SDID_130_4:=0A= + case IWN_SDID_130_6:=0A= + //iwl130_bg_cfg=0A= + sc->fwname =3D "iwn6000g2bfw";=0A= + sc->limits =3D &iwn6000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_6000g2b_base_params;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : = 0x%04x rev %d not supported (subdevice) = \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 100 Series WiFi */=0A= + case IWN_DID_100_1:=0A= + case IWN_DID_100_2:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_100_1:=0A= + case IWN_SDID_100_2:=0A= + case IWN_SDID_100_3:=0A= + case IWN_SDID_100_4:=0A= + case IWN_SDID_100_5:=0A= + case IWN_SDID_100_6:=0A= + sc->limits =3D &iwn1000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_1000_base_params; =0A= + sc->fwname =3D "iwn100fw";=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +=0A= +/* 2x30 Series */=0A= + case IWN_DID_2x30_1:=0A= + case IWN_DID_2x30_2:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_2x30_1:=0A= + case IWN_SDID_2x30_3:=0A= + case IWN_SDID_2x30_5:=0A= + //iwl100_bgn_cfg=0A= + case IWN_SDID_2x30_2:=0A= + case IWN_SDID_2x30_4:=0A= + case IWN_SDID_2x30_6:=0A= + //iwl100_bg_cfg=0A= + sc->limits =3D &iwn2030_sensitivity_limits;=0A= + sc->base_params =3D &iwn2030_base_params; =0A= + sc->fwname =3D "iwn2030fw";=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 5x00 Series */=0A= + case IWN_DID_5x00_1:=0A= + case IWN_DID_5x00_2:=0A= + case IWN_DID_5x00_3:=0A= + case IWN_DID_5x00_4:=0A= + sc->limits =3D &iwn5000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_default_base_params; =0A= + sc->fwname =3D "iwn5000fw";=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_5x00_1:=0A= + case IWN_SDID_5x00_2:=0A= + case IWN_SDID_5x00_3:=0A= + case IWN_SDID_5x00_4:=0A= + case IWN_SDID_5x00_9:=0A= + case IWN_SDID_5x00_10:=0A= + case IWN_SDID_5x00_11:=0A= + case IWN_SDID_5x00_12:=0A= + case IWN_SDID_5x00_17:=0A= + case IWN_SDID_5x00_18:=0A= + case IWN_SDID_5x00_19:=0A= + case IWN_SDID_5x00_20:=0A= + //iwl5100_agn_cfg=0A= + sc->txchainmask =3D IWN_ANT_B;=0A= + sc->rxchainmask =3D IWN_ANT_AB;=0A= + break; =0A= + case IWN_SDID_5x00_5:=0A= + case IWN_SDID_5x00_6:=0A= + case IWN_SDID_5x00_13:=0A= + case IWN_SDID_5x00_14:=0A= + case IWN_SDID_5x00_21:=0A= + case IWN_SDID_5x00_22:=0A= + //iwl5100_bgn_cfg=0A= + sc->txchainmask =3D IWN_ANT_B;=0A= + sc->rxchainmask =3D IWN_ANT_AB;=0A= + break;=0A= + case IWN_SDID_5x00_7:=0A= + case IWN_SDID_5x00_8:=0A= + case IWN_SDID_5x00_15:=0A= + case IWN_SDID_5x00_16:=0A= + case IWN_SDID_5x00_23:=0A= + case IWN_SDID_5x00_24:=0A= + //iwl5100_abg_cfg=0A= + sc->txchainmask =3D IWN_ANT_B;=0A= + sc->rxchainmask =3D IWN_ANT_AB;=0A= + break;=0A= + =0A= + case IWN_SDID_5x00_25:=0A= + case IWN_SDID_5x00_26:=0A= + case IWN_SDID_5x00_27:=0A= + case IWN_SDID_5x00_28:=0A= + case IWN_SDID_5x00_29:=0A= + case IWN_SDID_5x00_30:=0A= + case IWN_SDID_5x00_31:=0A= + case IWN_SDID_5x00_32:=0A= + case IWN_SDID_5x00_33:=0A= + case IWN_SDID_5x00_34:=0A= + case IWN_SDID_5x00_35:=0A= + case IWN_SDID_5x00_36:=0A= + //iwl5300_agn_cfg=0A= + sc->txchainmask =3D IWN_ANT_ABC;=0A= + sc->rxchainmask =3D IWN_ANT_ABC;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 5x50 Series */=0A= + case IWN_DID_5x50_1:=0A= + case IWN_DID_5x50_2:=0A= + case IWN_DID_5x50_3:=0A= + case IWN_DID_5x50_4:=0A= + sc->limits =3D &iwn5000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_default_base_params; =0A= + sc->fwname =3D "iwn5000fw";=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_5x50_1:=0A= + case IWN_SDID_5x50_2:=0A= + case IWN_SDID_5x50_3:=0A= + //iwl5350_agn_cfg=0A= + sc->limits =3D &iwn5000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_default_base_params; =0A= + sc->fwname =3D "iwn5000fw";=0A= + break;=0A= +=0A= + case IWN_SDID_5x50_4:=0A= + case IWN_SDID_5x50_5:=0A= + case IWN_SDID_5x50_8:=0A= + case IWN_SDID_5x50_9:=0A= + case IWN_SDID_5x50_10:=0A= + case IWN_SDID_5x50_11:=0A= + //iwl5150_agn_cfg=0A= + case IWN_SDID_5x50_6:=0A= + case IWN_SDID_5x50_7:=0A= + case IWN_SDID_5x50_12:=0A= + case IWN_SDID_5x50_13:=0A= + //iwl5150_abg_cfg=0A= + sc->limits =3D &iwn5000_sensitivity_limits;=0A= + sc->fwname =3D "iwn5150fw";=0A= + sc->base_params =3D &iwn_5x50_base_params;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev 0x%08x not supported (device) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + return 0; =0A= +}=0A= +/*=0A= + * Send IWN_CMD_GET_STATISTICS to ucode.=0A= + * @enable: activate sending statistics from uCode=0A= + * @clear : ask uCode to clear internal counter=0A= + * @async : Sync mode for command (1=3D ASYNC, 0=3DSYNC)=0A= +*/=0A= +static int =0A= +iwn_set_statistics_request(struct iwn_softc *sc,bool enable,bool = clear,int async)=0A= +{=0A= + struct iwn_statistics_cmd cmd;=0A= + =0A= + if (enable) =0A= + cmd.configuration_flags=3D clear ? IWN_STATS_CONF_CLEAR_STATS :0;=0A= + else=0A= + cmd.configuration_flags=3D IWN_STATS_CONF_DISABLE_NOTIF;=0A= + =0A= + =0A= + DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: sending request for statistics = flags : 0x%x\n",=0A= + __func__,cmd.configuration_flags);=0A= + return iwn_cmd(sc, IWN_CMD_GET_STATISTICS, &cmd, sizeof cmd, async ? = 1:0);=0A= +}=0A= +=0A= +static int=0A= +iwn_cfg_ucode_post_alive(struct iwn_softc *sc)=0A= +{=0A= + int error;=0A= + =0A= + /* Configure WiMAX coexistence for combo adapters. */=0A= + error =3D iwn5000_send_wimax_coex(sc);=0A= + if (error !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not configure WiMAX coexistence, error %d\n",=0A= + __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + if (!(sc->base_params->no_crystal_calibration)) {=0A= + DPRINTF(sc, IWN_DEBUG_RESET, "Doing calib in %s\n",__func__);=0A= + error =3D iwn5000_crystal_calib(sc);=0A= + if (error !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: crystal calibration failed, error %d\n",=0A= + __func__, error);=0A= + return error;=0A= + }=0A= + } else {=0A= + DPRINTF(sc, IWN_DEBUG_RESET, "Crystal calibration disable in = %s\n",__func__);=0A= + }=0A= + =0A= + return 0;=0A= +}=0A= +//----------------- NEW----------------------=0A= +/*=0A= + * Handles ioctl change requests for power management state etc.=0A= + */=0A= +static int iwn_iv_reset(struct ieee80211vap *vap, u_long cmd)=0A= +{=0A= + int error =3D 0;=0A= + switch (cmd) {=0A= + case IEEE80211_IOC_POWERSAVE:{=0A= + struct iwn_softc * sc =3D (struct iwn_softc *)=0A= + (vap->iv_ic->ic_ifp->if_softc);=0A= + IWN_LOCK(sc);=0A= +=0A= + /* XXX to discuss */=0A= + int dtim =3D IWN_POWERSAVE_DTIM_VOIP_COMPATIBLE;=0A= +=0A= + int async =3D 0;=0A= +=0A= + /*=0A= + * At present the powersave level is set to 0 (receiver=0A= + * continuously on) if power save is disabled, and set to=0A= + * IWN_POWERSAVE_LVL_VOIP_COMPATIBLE otherwise.=0A= + * Later the power levels 0-5 could be exposed to the user.=0A= + */=0A= + if (vap->iv_flags & IEEE80211_F_PMGTON) {=0A= + /*=0A= + * In ieee80211_vap_setup() we have:=0A= + * vap->iv_flags =3D ic->ic_flags;=0A= + * i.e. any vap's iv_flags initialize to ic->ic_flags.=0A= + * Setting the flags on ic will allow a vap to get=0A= + * the correct powersave level once it is created.=0A= + */=0A= + vap->iv_ic->ic_flags |=3D IEEE80211_F_PMGTON;=0A= + sc->desired_pwrsave_level =3D=0A= + IWN_POWERSAVE_LVL_VOIP_COMPATIBLE;=0A= + } else {=0A= + vap->iv_ic->ic_flags &=3D ~IEEE80211_F_PMGTON;=0A= + sc->desired_pwrsave_level =3D IWN_POWERSAVE_LVL_NONE;=0A= + }=0A= + error =3D iwn_set_pslevel(sc, dtim, sc->desired_pwrsave_level,=0A= + async);=0A= + IWN_UNLOCK(sc);=0A= + }=0A= + break;=0A= + default:=0A= + /*=0A= + * For unhandled ioctls, ENETRESET has to be passed back to=0A= + * net80211 layer, which will in turn call the function to=0A= + * reinitialize the entire device.=0A= + */=0A= + error =3D ENETRESET;=0A= + break;=0A= + }=0A= + return error;=0A= +}=0A= +=0A= +static int=0A= +iwn_newstate_u1(struct ieee80211vap *vap, enum ieee80211_state nstate, = int arg)=0A= +{=0A= + struct iwn_vap *ivp =3D IWN_VAP(vap);=0A= + struct ieee80211com *ic =3D vap->iv_ic;=0A= + struct iwn_softc *sc =3D ic->ic_ifp->if_softc;=0A= +=0A= + int error =3D 0;=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + =0A= + DPRINTF(sc, IWN_DEBUG_STATE, "%s: %s -> %s\n", __func__,=0A= + ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate]);=0A= +=0A= + IEEE80211_UNLOCK(ic);=0A= + IWN_LOCK(sc);=0A= + callout_stop(&sc->calib_to);=0A= +=0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_PAN_CTX];=0A= +=0A= + switch (nstate) {=0A= + case IEEE80211_S_ASSOC:=0A= + if (vap->iv_state !=3D IEEE80211_S_RUN)=0A= + break;=0A= + /* FALLTHROUGH */=0A= + case IEEE80211_S_AUTH:=0A= + if (vap->iv_state =3D=3D IEEE80211_S_AUTH)=0A= + break;=0A= +=0A= + /*=0A= + * !AUTH -> AUTH transition requires state reset to handle=0A= + * reassociations correctly.=0A= + */=0A= + sc->rxon->associd =3D 0;=0A= + sc->rxon->filter &=3D ~htole32(IWN_FILTER_BSS);=0A= + sc->calib.state =3D IWN_CALIB_STATE_INIT;=0A= +=0A= + if ((error =3D iwn_auth_u1(sc, vap)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not move to auth state\n", __func__);=0A= + }=0A= + break;=0A= +=0A= + case IEEE80211_S_SCAN:=0A= +=0A= +=0A= + if ((error =3D iwn_set_timing_u1(sc)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: iwn_set_timing_u1 error %d\n", __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + break;=0A= +=0A= + case IEEE80211_S_RUN:=0A= +=0A= + /*=0A= + * RUN -> RUN transition; Just restart the timers.=0A= + */=0A= + if (vap->iv_state =3D=3D IEEE80211_S_RUN) {=0A= + sc->calib_cnt =3D 0;=0A= + break;=0A= + }=0A= +=0A= + /*=0A= + * !RUN -> RUN requires setting the association id=0A= + * which is done with a firmware cmd. We also defer=0A= + * starting the timers until that work is done.=0A= + */=0A= + if ((error =3D iwn_run_u1(sc, vap)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not move to run state\n", __func__);=0A= + }=0A= + break;=0A= +=0A= + case IEEE80211_S_INIT:=0A= + sc->calib.state =3D IWN_CALIB_STATE_INIT;=0A= + break;=0A= +=0A= + default:=0A= + break;=0A= + }=0A= + IWN_UNLOCK(sc);=0A= + IEEE80211_LOCK(ic);=0A= + if (error !=3D 0) {=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end in error\n", __func__);=0A= + return error;=0A= + }=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + return ivp->iv_newstate(vap, nstate, arg);=0A= +}=0A= +=0A= +static int=0A= +iwn_auth_u1(struct iwn_softc *sc, struct ieee80211vap *vap)=0A= +{=0A= + struct iwn_ops *ops =3D &sc->ops;=0A= + struct ifnet *ifp =3D sc->sc_ifp;=0A= + struct ieee80211com *ic =3D ifp->if_l2com;=0A= + struct ieee80211_node *ni =3D vap->iv_bss;=0A= + int error;=0A= + struct iwn_vap *ivp =3D IWN_VAP(vap);=0A= + =0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= +=0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_PAN_CTX];=0A= + IEEE80211_ADDR_COPY(sc->rxon->myaddr, ivp->macaddr);=0A= + IEEE80211_ADDR_COPY(sc->rxon->wlap, IF_LLADDR(ifp));=0A= + /* Update adapter configuration. */=0A= + IEEE80211_ADDR_COPY(sc->rxon->bssid, ni->ni_bssid);=0A= + sc->rxon->chan =3D ieee80211_chan2ieee(ic, ni->ni_chan);=0A= + sc->rxon->flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A= + if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= + if (ic->ic_flags & IEEE80211_F_SHSLOT)=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_SHSLOT);=0A= + if (ic->ic_flags & IEEE80211_F_SHPREAMBLE)=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_SHPREAMBLE);=0A= + if (IEEE80211_IS_CHAN_A(ni->ni_chan)) {=0A= + sc->rxon->cck_mask =3D 0;=0A= + sc->rxon->ofdm_mask =3D 0x15;=0A= + } else if (IEEE80211_IS_CHAN_B(ni->ni_chan)) {=0A= + sc->rxon->cck_mask =3D 0x03;=0A= + sc->rxon->ofdm_mask =3D 0;=0A= + } else {=0A= + /* Assume 802.11b/g. */=0A= + sc->rxon->cck_mask =3D 0x0f;=0A= + sc->rxon->ofdm_mask =3D 0x15;=0A= + }=0A= + DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x cck %x ofdm %x\n",=0A= + sc->rxon->chan, sc->rxon->flags, sc->rxon->cck_mask,=0A= + sc->rxon->ofdm_mask);=0A= + sc->rxon->mode =3D IWN_MODE_2STA;=0A= + error =3D iwn_cmd(sc, IWN_CMD_WIPAN_RXON, sc->rxon, sc->rxonsz, 0);=0A= + if (error !=3D 0) {=0A= + device_printf(sc->sc_dev, "%s: RXON command failed, error %d\n",=0A= + __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + /* Configuration has changed, set TX power accordingly. */=0A= + if ((error =3D ops->set_txpower(sc, ni->ni_chan, 1)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not set TX power, error %d\n", __func__, error);=0A= + return error;=0A= + }=0A= + /*=0A= + * Reconfiguring RXON clears the firmware nodes table so we must=0A= + * add the broadcast node again.=0A= + */=0A= + if ((error =3D iwn_add_broadcast_node_u1(sc, 0)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not add broadcast node, error %d\n", __func__,=0A= + error);=0A= + return error;=0A= + }=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + =0A= + return 0;=0A= +}=0A= +=0A= +static int=0A= +iwn_run_u1(struct iwn_softc *sc, struct ieee80211vap *vap)=0A= +{=0A= + struct iwn_ops *ops =3D &sc->ops;=0A= + struct ifnet *ifp =3D sc->sc_ifp;=0A= + struct ieee80211com *ic =3D ifp->if_l2com;=0A= + struct ieee80211_node *ni =3D vap->iv_bss;=0A= + struct iwn_node_info node;=0A= + uint32_t htflags =3D 0;=0A= + int error;=0A= + struct iwn_vap *ivp =3D IWN_VAP(vap);=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + =0A= + if (ic->ic_opmode =3D=3D IEEE80211_M_MONITOR) {=0A= + /* Link LED blinks while monitoring. */=0A= + return 0;=0A= + }=0A= +=0A= + if ((error =3D iwn_set_timing_u1(sc)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not set timing, error %d\n", __func__, error);=0A= + }=0A= +=0A= + if ((error =3D iwn_updateedca_u1(ic)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: iwn_updateedca_u1, error %d\n", __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_PAN_CTX];=0A= + IEEE80211_ADDR_COPY(sc->rxon->myaddr, ivp->macaddr);=0A= + IEEE80211_ADDR_COPY(sc->rxon->wlap, IF_LLADDR(ifp));=0A= + /* Update adapter configuration. */=0A= + IEEE80211_ADDR_COPY(sc->rxon->bssid, ni->ni_bssid);=0A= + sc->rxon->associd =3D htole16(IEEE80211_AID(ni->ni_associd));=0A= + sc->rxon->chan =3D ieee80211_chan2ieee(ic, ni->ni_chan);=0A= + sc->rxon->flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A= + if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= + if (ic->ic_flags & IEEE80211_F_SHSLOT)=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_SHSLOT);=0A= + if (ic->ic_flags & IEEE80211_F_SHPREAMBLE)=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_SHPREAMBLE);=0A= + if (IEEE80211_IS_CHAN_A(ni->ni_chan)) {=0A= + sc->rxon->cck_mask =3D 0;=0A= + sc->rxon->ofdm_mask =3D 0x15;=0A= + } else if (IEEE80211_IS_CHAN_B(ni->ni_chan)) {=0A= + sc->rxon->cck_mask =3D 0x03;=0A= + sc->rxon->ofdm_mask =3D 0;=0A= + } else {=0A= + /* Assume 802.11b/g. */=0A= + sc->rxon->cck_mask =3D 0x0f;=0A= + sc->rxon->ofdm_mask =3D 0x15;=0A= + }=0A= + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) {=0A= + htflags |=3D IWN_RXON_HT_PROTMODE(ic->ic_curhtprotmode);=0A= + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) {=0A= + switch (ic->ic_curhtprotmode) {=0A= + case IEEE80211_HTINFO_OPMODE_HT20PR:=0A= + htflags |=3D IWN_RXON_HT_MODEPURE40;=0A= + break;=0A= + default:=0A= + htflags |=3D IWN_RXON_HT_MODEMIXED;=0A= + break;=0A= + }=0A= + }=0A= + if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan))=0A= + htflags |=3D IWN_RXON_HT_HT40MINUS;=0A= + }=0A= + sc->rxon->flags |=3D htole32(htflags);=0A= + sc->rxon->filter |=3D htole32(IWN_FILTER_BSS);=0A= + DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x\n",=0A= + sc->rxon->chan, sc->rxon->flags);=0A= + sc->rxon->mode =3D IWN_MODE_2STA;=0A= + error =3D iwn_cmd(sc, IWN_CMD_WIPAN_RXON, sc->rxon, sc->rxonsz, 0);=0A= + if (error !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not update configuration, error %d\n", __func__,=0A= + error);=0A= + return error;=0A= + }=0A= +=0A= + /* Configuration has changed, set TX power accordingly. */=0A= + if ((error =3D ops->set_txpower(sc, ni->ni_chan, 1)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not set TX power, error %d\n", __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + /* Fake a join to initialize the TX rate. */=0A= + ((struct iwn_node *)ni)->id =3D IWN_STA_ID;=0A= + iwn_newassoc(ni, 1);=0A= +=0A= + /* Add BSS node. */=0A= + memset(&node, 0, sizeof node);=0A= + node.htflags |=3D htole32(IWN_STA_FLAG_PAN_STATION);=0A= + IEEE80211_ADDR_COPY(node.macaddr, ni->ni_macaddr);=0A= + node.id =3D IWN_STA_ID;=0A= + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) {=0A= + switch (ni->ni_htcap & IEEE80211_HTCAP_SMPS) {=0A= + case IEEE80211_HTCAP_SMPS_ENA:=0A= + node.htflags |=3D htole32(IWN_SMPS_MIMO_DIS);=0A= + break;=0A= + case IEEE80211_HTCAP_SMPS_DYNAMIC:=0A= + node.htflags |=3D htole32(IWN_SMPS_MIMO_PROT);=0A= + break;=0A= + }=0A= + node.htflags |=3D htole32(IWN_AMDPU_SIZE_FACTOR(3) |=0A= + IWN_AMDPU_DENSITY(5)); /* 4us */=0A= + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan))=0A= + node.htflags |=3D htole32(IWN_NODE_HT40);=0A= + }=0A= + DPRINTF(sc, IWN_DEBUG_STATE, "%s: adding BSS node1\n", __func__);=0A= + error =3D ops->add_node(sc, &node, 0);=0A= + if (error !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not add BSS node1, error %d\n", __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + /* Setting the initial rate for node */=0A= + ni->ni_txrate =3D ni->ni_rates.rs_rates[0];=0A= +=0A= + /* XXX: init rate scaling */=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + =0A= + #ifdef IWN_DTIM_INDICATES_UNICAST_PENDING_AT_AP=0A= + return iwn_set_pslevel(sc, IWN_POWERSAVE_DTIM_VOIP_COMPATIBLE,=0A= + sc->desired_pwrsave_level, 0);=0A= + #else=0A= + return 0;=0A= + #endif=0A= +=0A= +}=0A= +=0A= +static int=0A= +iwn_set_timing_u1(struct iwn_softc *sc)=0A= +{=0A= + struct iwn_cmd_timing cmd;=0A= + int error =3D 0;=0A= + struct ieee80211vap *vap;=0A= + struct iwn_vap *ivp;=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + =0A= + vap =3D sc->ivap[IWN_RXON_PAN_CTX];=0A= + ivp =3D IWN_VAP(vap);=0A= +=0A= + if ((error =3D iwn_config_u1(sc)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: iwn_config1 error %d\n", __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + if ((error =3D iwn_set_pan_params(sc)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: iwn_set_pan_params error %d\n", __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + memset(&cmd, 0, sizeof cmd);=0A= + cmd.lintval =3D htole16(10);=0A= + cmd.bintval =3D htole16(IWN_BEACON_INTERVAL_DEFAULT);=0A= + ivp->beacon_int =3D cmd.bintval;=0A= + cmd.binitval =3D htole32(0x032000);=0A= + cmd.dtim_period =3D 1;=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + =0A= + return iwn_cmd(sc, IWN_CMD_WIPAN_RXON_TIMING, &cmd, sizeof cmd, 0);=0A= +}=0A= +=0A= +static int=0A= +iwn_config_u1(struct iwn_softc *sc)=0A= +{=0A= + struct ifnet *ifp =3D sc->sc_ifp;=0A= + struct ieee80211com *ic =3D ifp->if_l2com;=0A= + uint16_t rxchain;=0A= + int error;=0A= + struct ieee80211vap *vap =3D sc->ivap[IWN_RXON_PAN_CTX];=0A= + struct iwn_vap *ivp =3D IWN_VAP(vap);=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + =0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_PAN_CTX];=0A= + IEEE80211_ADDR_COPY(sc->rxon->myaddr, ivp->macaddr);=0A= + IEEE80211_ADDR_COPY(sc->rxon->wlap, IF_LLADDR(ifp));=0A= + sc->rxon->chan =3D ieee80211_chan2ieee(ic, ic->ic_curchan);=0A= + sc->rxon->flags =3D htole32(IWN_RXON_TSF);=0A= + if (IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan))=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= + sc->rxon->mode =3D IWN_MODE_P2P;=0A= + sc->rxon->filter =3D htole32(IWN_FILTER_MULTICAST);=0A= + sc->rxon->cck_mask =3D 0x0f; /* not yet negotiated */=0A= + sc->rxon->ofdm_mask =3D 0xff; /* not yet negotiated */=0A= + sc->rxon->ht_single_mask =3D 0xff;=0A= + sc->rxon->ht_dual_mask =3D 0xff;=0A= + sc->rxon->ht_triple_mask =3D 0xff;=0A= + rxchain =3D=0A= + IWN_RXCHAIN_VALID(sc->rxchainmask) |=0A= + IWN_RXCHAIN_MIMO_COUNT(2) |=0A= + IWN_RXCHAIN_IDLE_COUNT(2);=0A= + sc->rxon->rxchain =3D htole16(rxchain);=0A= + sc->rxon->associd =3D 0;=0A= + sc->rxon->filter &=3D ~htole32(IWN_FILTER_BSS);=0A= +=0A= + error =3D iwn_cmd(sc, IWN_CMD_WIPAN_RXON, sc->rxon, sc->rxonsz, 0);=0A= + if (error !=3D 0) {=0A= + device_printf(sc->sc_dev, "%s: IWN_CMD_WIPAN_RXON command failed\n",=0A= + __func__);=0A= + return error;=0A= + }=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + =0A= + return 0;=0A= +}=0A= +=0A= +static int=0A= +iwn_set_pan_params(struct iwn_softc *sc)=0A= +{=0A= + struct iwn_pan_params_cmd cmd;=0A= + int slot0 =3D 300, slot1 =3D 0;=0A= + int bcnint;=0A= + int error =3D 0;=0A= + =0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + =0A= + /*=0A= + * If the PAN context is inactive, then we don't need=0A= + * to update the PAN parameters=0A= + */=0A= + if (sc->ctx !=3D IWN_RXON_PAN_CTX) {=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end with no need to do that\n", = __func__);=0A= + return 0;=0A= + }=0A= +=0A= + memset(&cmd, 0, sizeof(cmd));=0A= +=0A= + /* only 2 slots are currently allowed */=0A= + cmd.num_slots =3D 2;=0A= +=0A= + cmd.slots[0].type =3D IWN_RXON_BSS_CTX; /* BSS */=0A= + cmd.slots[1].type =3D IWN_RXON_PAN_CTX; /* PAN */=0A= +=0A= + cmd.flags |=3D htole16(IWN_PAN_PARAMS_FLG_SLOTTED_MODE);=0A= + bcnint =3D IWN_BEACON_INTERVAL_DEFAULT;=0A= + slot0 =3D (bcnint >> 1);=0A= + slot1 =3D (bcnint - slot0);=0A= +=0A= + if(sc->uc_scan_progress =3D=3D 1) {=0A= + slot0 =3D bcnint * 3 - IWN_SLOT_TIME_MIN;=0A= + slot1 =3D IWN_SLOT_TIME_MIN;=0A= + }=0A= + cmd.slots[0].time =3D htole16(slot0);=0A= + cmd.slots[1].time =3D htole16(slot1);=0A= +=0A= + error =3D iwn_cmd(sc, IWN_CMD_WIPAN_PARAMS, &cmd, sizeof(cmd), 0);=0A= + if (error !=3D 0) {=0A= + device_printf(sc->sc_dev, "%s: IWN_CMD_WIPAN_PARAMS command failed, = error %d\n",=0A= + __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + =0A= + return 0;=0A= +}=0A= +=0A= +static int=0A= +iwn_updateedca_u1(struct ieee80211com *ic)=0A= +{=0A= +#define IWN_EXP2(x) ((1 << (x)) - 1) /* CWmin =3D 2^ECWmin - 1 */=0A= + struct iwn_softc *sc =3D ic->ic_ifp->if_softc;=0A= + struct iwn_edca_params cmd;=0A= + int aci;=0A= +=0A= + memset(&cmd, 0, sizeof cmd);=0A= + cmd.flags =3D htole32(IWN_EDCA_UPDATE);=0A= + for (aci =3D 0; aci < WME_NUM_AC; aci++) {=0A= + const struct wmeParams *ac =3D=0A= + &ic->ic_wme.wme_chanParams.cap_wmeParams[aci];=0A= + cmd.ac[aci].aifsn =3D ac->wmep_aifsn;=0A= + cmd.ac[aci].cwmin =3D htole16(IWN_EXP2(ac->wmep_logcwmin));=0A= + cmd.ac[aci].cwmax =3D htole16(IWN_EXP2(ac->wmep_logcwmax));=0A= + cmd.ac[aci].txoplimit =3D=0A= + htole16(IEEE80211_TXOP_TO_US(ac->wmep_txopLimit));=0A= + }=0A= + return iwn_cmd(sc, IWN_CMD_WIPAN_QOS_PARAM, &cmd, sizeof cmd, 1);=0A= +#undef IWN_EXP2=0A= +}=0A= +=0A= +/*=0A= + * Broadcast node is used to send group-addressed and management frames.=0A= + */=0A= +static int=0A= +iwn_add_broadcast_node_u1(struct iwn_softc *sc, int async)=0A= +{=0A= + struct iwn_ops *ops =3D &sc->ops;=0A= + struct ifnet *ifp =3D sc->sc_ifp;=0A= + struct ieee80211com *ic =3D ifp->if_l2com;=0A= + struct iwn_node_info node;=0A= + struct iwn_cmd_link_quality linkq;=0A= + uint8_t txant;=0A= + int i, error;=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + =0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_PAN_CTX];=0A= +=0A= + memset(&node, 0, sizeof node);=0A= + IEEE80211_ADDR_COPY(node.macaddr, ifp->if_broadcastaddr);=0A= +=0A= + node.id =3D IWN_PAN_BCAST_ID;=0A= + node.htflags |=3D htole32(IWN_STA_FLAG_PAN_STATION);=0A= + DPRINTF(sc, IWN_DEBUG_RESET, "%s: adding broadcast node1\n", __func__);=0A= + if ((error =3D ops->add_node(sc, &node, async)) !=3D 0)=0A= + return error;=0A= +=0A= + /* Use the first valid TX antenna. */=0A= + txant =3D IWN_LSB(sc->txchainmask);=0A= +=0A= + memset(&linkq, 0, sizeof linkq);=0A= + linkq.id =3D IWN_PAN_BCAST_ID;=0A= + linkq.antmsk_1stream =3D txant;=0A= + linkq.antmsk_2stream =3D IWN_ANT_AB;=0A= + linkq.ampdu_max =3D 64;=0A= + linkq.ampdu_threshold =3D 3;=0A= + linkq.ampdu_limit =3D htole16(4000); /* 4ms */=0A= +=0A= + /* Use lowest mandatory bit-rate. */=0A= + if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan))=0A= + linkq.retry[0] =3D htole32(0xd);=0A= + else=0A= + linkq.retry[0] =3D htole32(10 | IWN_RFLAG_CCK);=0A= + linkq.retry[0] |=3D htole32(IWN_RFLAG_ANT(txant));=0A= + /* Use same bit-rate for all TX retries. */=0A= + for (i =3D 1; i < IWN_MAX_TX_RETRIES; i++) {=0A= + linkq.retry[i] =3D linkq.retry[0];=0A= + }=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + =0A= + return iwn_cmd(sc, IWN_CMD_LINK_QUALITY, &linkq, sizeof linkq, async);=0A= +}=0A= +=0A= +static uint16_t=0A= +iwn_get_active_dwell(struct iwn_softc *sc, struct ieee80211_channel *c)=0A= +{=0A= + int n_probes =3D 1;=0A= +=0A= + if (IEEE80211_IS_CHAN_5GHZ(c))=0A= + return IWN_ACTIVE_DWELL_TIME_52 +=0A= + IWN_ACTIVE_DWELL_FACTOR_52 * (n_probes + 1);=0A= + else=0A= + return IWN_ACTIVE_DWELL_TIME_24 +=0A= + IWN_ACTIVE_DWELL_FACTOR_24 * (n_probes + 1);=0A= +}=0A= +=0A= +static uint16_t=0A= +iwn_get_passive_dwell(struct iwn_softc *sc, struct ieee80211_channel *c)=0A= +{=0A= + uint8_t ctx_id =3D 0;=0A= + uint16_t beacon_int;=0A= + struct ieee80211vap *vap;=0A= + struct iwn_vap *ivp;=0A= + uint16_t dwell_time;=0A= +=0A= + dwell_time =3D (IEEE80211_IS_CHAN_2GHZ(c)) ?=0A= + IWN_PASSIVE_DWELL_BASE + IWN_PASSIVE_DWELL_TIME_24 :=0A= + IWN_PASSIVE_DWELL_BASE + IWN_PASSIVE_DWELL_TIME_52;=0A= +=0A= + for (ctx_id =3D 0; ctx_id < IWN_NUM_RXON_CTX; ctx_id++) {=0A= + vap =3D sc->ivap[ctx_id];=0A= + ivp =3D IWN_VAP(vap);=0A= + sc->rxon =3D &sc->rx_on[ctx_id];=0A= + if (!sc->rxon->associd)=0A= + continue;=0A= + beacon_int =3D ivp->beacon_int;=0A= + if (!beacon_int)=0A= + beacon_int =3D IWN_PASSIVE_DWELL_BASE;=0A= + beacon_int =3D (beacon_int * 98) / 100 - IWN_CHANNEL_TUNE_TIME * 2;=0A= + dwell_time =3D min(beacon_int, dwell_time);=0A= + if(sc->ctx !=3D IWN_RXON_PAN_CTX) break;=0A= + }=0A= +=0A= + return dwell_time;=0A= +}=0A= +static void=0A= +iwn_led_pattern(struct iwn_softc *sc)=0A= +{=0A= + int i,j;=0A= +=0A= + for(i =3D 0; i < IWN_MAX_BLINK_TBL; i++) {=0A= + if((sc->sc_led.led_last_tpt) > (blink_tbl[i].tpt * 1024 * 1024))=0A= + break;=0A= + }=0A= +=0A= + for(j =3D 0; j < IWN_MAX_BLINK_TBL; j++) {=0A= + if((sc->sc_led.led_cur_tpt) > (blink_tbl[j].tpt * 1024 * 1024))=0A= + break;=0A= + }=0A= +=0A= + if (i !=3D j)=0A= + iwn_set_led(sc, IWN_LED_LINK,blink_tbl[j].off_time,=0A= + blink_tbl[j].on_time, IWN_LED_INT_BLINK);=0A= +}=0A= +=0A= +=0A= + =0A= Index: sys/dev/iwn/if_iwnreg.h=0A= =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=0A= --- sys/dev/iwn/if_iwnreg.h (revision 253707)=0A= +++ sys/dev/iwn/if_iwnreg.h (working copy)=0A= @@ -2,6 +2,8 @@=0A= /* $OpenBSD: if_iwnreg.h,v 1.40 2010/05/05 19:41:57 damien Exp $ */=0A= =0A= /*-=0A= + * Copyright (c) 2013 Cedric GROSS =0A= + * Copyright (c) 2011 Intel Corporation=0A= * Copyright (c) 2007, 2008=0A= * Damien Bergamini =0A= *=0A= @@ -17,7 +19,267 @@=0A= * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT = OF=0A= * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.=0A= */=0A= + =0A= +#define IWN_CT_KILL_THRESHOLD 114 /* in = Celsius */=0A= +#define IWN_CT_KILL_EXIT_THRESHOLD 95 /* in = Celsius */=0A= =0A= + =0A= +/* = =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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=0A= + * DEVICE ID BLOCK=0A= + * = =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=3D=3D=3D=3D=3D=3D=3D=3D= =3D =0A= +*/ =0A= +/*=0A= + * = -------------------------------------------------------------------------= ----=0A= + * Device ID for 2x30 series =0A= + * = -------------------------------------------------------------------------= ----=0A= + */=0A= +#define IWN_DID_2x30_1 0x0887 =0A= +#define IWN_DID_2x30_2 0x0888 =0A= +/* SubDevice ID */=0A= +#define IWN_SDID_2x30_1 0x4062 // "2000 Series 2x2 BGN/BT"=0A= +#define IWN_SDID_2x30_2 0x4262 // "2000 Series 2x2 BGN/BT"=0A= +#define IWN_SDID_2x30_3 0x4462 // "2000 Series 2x2 BGN/BT"=0A= +#define IWN_SDID_2x30_4 0x4066 // "2000 Series 2x2 BG/BT"=0A= +#define IWN_SDID_2x30_5 0x4266 // "2000 Series 2x2 BG/BT"=0A= +#define IWN_SDID_2x30_6 0x4466 // "2000 Series 2x2 BG/BT"=0A= + =0A= +/*=0A= + * = -------------------------------------------------------------------------= ----=0A= + * Device ID for 1000 series =0A= + * = -------------------------------------------------------------------------= ----=0A= + */=0A= +#define IWN_DID_1000_1 0x0083=0A= +#define IWN_DID_1000_2 0x0084=0A= +=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_1000_1 0x1205 // iwl1000_bgn_cfg=0A= +#define IWN_SDID_1000_2 0x1305 // iwl1000_bgn_cfg=0A= +#define IWN_SDID_1000_3 0x1225 // iwl1000_bgn_cfg=0A= +#define IWN_SDID_1000_4 0x1325 // iwl1000_bgn_cfg=0A= +#define IWN_SDID_1000_5 0x1215 // iwl1000_bgn_cfg=0A= +#define IWN_SDID_1000_6 0x1315 // iwl1000_bgn_cfg=0A= +=0A= +#define IWN_SDID_1000_7 0x1206 // iwl1000_bg_cfg=0A= +#define IWN_SDID_1000_8 0x1306 // iwl1000_bg_cfg=0A= +#define IWN_SDID_1000_9 0x1226 // iwl1000_bg_cfg=0A= +#define IWN_SDID_1000_10 0x1326 // iwl1000_bg_cfg=0A= +#define IWN_SDID_1000_11 0x1216 // iwl1000_bg_cfg=0A= +#define IWN_SDID_1000_12 0x1316 // iwl1000_bg_cfg=0A= +=0A= +/*=0A= + * = -------------------------------------------------------------------------= ----=0A= + * Device ID for 6x00 series =0A= + * = -------------------------------------------------------------------------= ----=0A= + */=0A= +#define IWN_DID_6x00_1 0x422B=0A= +#define IWN_DID_6x00_2 0x422C=0A= +#define IWN_DID_6x00_3 0x4238=0A= +#define IWN_DID_6x00_4 0x4239=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_6x00_1 0x1101 // iwl6000_3agn_cfg=0A= +#define IWN_SDID_6x00_2 0x1121 // iwl6000_3agn_cfg=0A= +#define IWN_SDID_6x00_3 0x1301 // iwl6000i_2agn_cfg=0A= +#define IWN_SDID_6x00_4 0x1306 // iwl6000i_2abg_cfg=0A= +#define IWN_SDID_6x00_5 0x1307 // iwl6000i_2bg_cfg=0A= +#define IWN_SDID_6x00_6 0x1321 // iwl6000i_2agn_cfg=0A= +#define IWN_SDID_6x00_7 0x1326 // iwl6000i_2abg_cfg=0A= +#define IWN_SDID_6x00_8 0x1111 // iwl6000_3agn_cfg=0A= +#define IWN_SDID_6x00_9 0x1311 // iwl6000i_2agn_cfg=0A= +#define IWN_SDID_6x00_10 0x1316 // iwl6000i_2abg_cfg=0A= +/*=0A= + * = -------------------------------------------------------------------------= ----=0A= + * Device ID for 6x05 series =0A= + * = -------------------------------------------------------------------------= ----=0A= + */=0A= +#define IWN_DID_6x05_1 0x0082=0A= +#define IWN_DID_6x05_2 0x0085=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_6x05_1 0x1301 //iwl6005_2agn_cfg=0A= +#define IWN_SDID_6x05_2 0x1306 //iwl6005_2abg_cfg=0A= +#define IWN_SDID_6x05_3 0x1307 //iwl6005_2bg_cfg=0A= +#define IWN_SDID_6x05_4 0x1321 //iwl6005_2agn_cfg=0A= +#define IWN_SDID_6x05_5 0x1326 //iwl6005_2abg_cfg=0A= +#define IWN_SDID_6x05_6 0x1311 //iwl6005_2agn_cfg=0A= +#define IWN_SDID_6x05_7 0x1316 //iwl6005_2abg_cfg=0A= +#define IWN_SDID_6x05_8 0xC020 //iwl6005_2agn_sff_cfg=0A= +#define IWN_SDID_6x05_9 0xC220 //iwl6005_2agn_sff_cfg=0A= +#define IWN_SDID_6x05_10 0x4820 //iwl6005_2agn_d_cfg=0A= +#define IWN_SDID_6x05_11 0x1304 //iwl6005_2agn_mow1_cfg/* low 5GHz = active */=0A= +#define IWN_SDID_6x05_12 0x1305 //iwl6005_2agn_mow2_cfg/* high 5GHz = active */=0A= +=0A= +/*=0A= + * = -------------------------------------------------------------------------= ----=0A= + * Device ID for 6050 WiFi/WiMax Series =0A= + * = -------------------------------------------------------------------------= ----=0A= + */=0A= +#define IWN_DID_6050_1 0x0087=0A= +#define IWN_DID_6050_2 0x0089=0A= +=0A= +#define IWN_SDID_6050_1 0x1301 //iwl6050_2agn_cfg=0A= +#define IWN_SDID_6050_2 0x1306 //iwl6050_2abg_cfg=0A= +#define IWN_SDID_6050_3 0x1321 //iwl6050_2agn_cfg=0A= +#define IWN_SDID_6050_4 0x1326 //iwl6050_2abg_cfg=0A= +#define IWN_SDID_6050_5 0x1311 //iwl6050_2agn_cfg=0A= +#define IWN_SDID_6050_6 0x1316 //iwl6050_2abg_cfg=0A= +=0A= +/*=0A= + * = -------------------------------------------------------------------------= ----=0A= + * Device ID for 6150 Series =0A= + * = -------------------------------------------------------------------------= ----=0A= + */=0A= +=0A= +#define IWN_DID_6150_1 0x0885 =0A= +#define IWN_DID_6150_2 0x0886=0A= +=0A= +#define IWN_SDID_6150_1 0x1305 // iwl6150_bgn_cfg=0A= +#define IWN_SDID_6150_2 0x1307 // iwl6150_bg_cfg)=0A= +#define IWN_SDID_6150_3 0x1325 // iwl6150_bgn_cfg=0A= +#define IWN_SDID_6150_4 0x1327 // iwl6150_bg_cfg)=0A= +#define IWN_SDID_6150_5 0x1315 // iwl6150_bgn_cfg=0A= +#define IWN_SDID_6150_6 0x1317 // iwl6150_bg_cfg) =0A= + =0A= +/*=0A= + * = -------------------------------------------------------------------------= ----=0A= + * Device ID for 6035 Series =0A= + * = -------------------------------------------------------------------------= ----=0A= + */=0A= +#define IWN_DID_6035_1 0x088E=0A= +#define IWN_DID_6035_2 0x088F=0A= + =0A= +#define IWN_SDID_6035_1 0x4060 // iwl6035_2agn_cfg=0A= +#define IWN_SDID_6035_2 0x4260 // iwl6035_2agn_cfg=0A= +#define IWN_SDID_6035_3 0x4460 // iwl6035_2agn_cfg=0A= +#define IWN_SDID_6035_4 0x4860 // iwl6035_2agn_cfg=0A= +=0A= +/*=0A= + * = -------------------------------------------------------------------------= ----=0A= + * Device ID for 1030 and 6030 Series =0A= + * = -------------------------------------------------------------------------= ----=0A= + */=0A= +#define IWN_DID_x030_1 0x008A =0A= +#define IWN_DID_x030_2 0x008B=0A= +#define IWN_DID_x030_3 0x0090=0A= +#define IWN_DID_x030_4 0x0091=0A= +=0A= +#define IWN_SDID_x030_1 0x5305 // iwl1030_bgn_cfg=0A= +#define IWN_SDID_x030_2 0x5307 // iwl1030_bg_cfg=0A= +#define IWN_SDID_x030_3 0x5325 // iwl1030_bgn_cfg=0A= +#define IWN_SDID_x030_4 0x5327 // iwl1030_bg_cfg=0A= +#define IWN_SDID_x030_5 0x5315 // iwl1030_bgn_cfg=0A= +#define IWN_SDID_x030_6 0x5317 // iwl1030_bg_cfg=0A= +#define IWN_SDID_x030_7 0x5211 // iwl6030_2agn_cfg=0A= +#define IWN_SDID_x030_8 0x5215 // iwl6030_2bgn_cfg=0A= +#define IWN_SDID_x030_9 0x5216 // iwl6030_2abg_cfg=0A= +#define IWN_SDID_x030_10 0x5201 // iwl6030_2agn_cfg=0A= +#define IWN_SDID_x030_11 0x5205 // iwl6030_2bgn_cfg=0A= +#define IWN_SDID_x030_12 0x5206 // iwl6030_2abg_cfg=0A= +#define IWN_SDID_x030_13 0x5207 // iwl6030_2bg_cfg)=0A= +#define IWN_SDID_x030_14 0x5221 // iwl6030_2agn_cfg=0A= +#define IWN_SDID_x030_15 0x5225 // iwl6030_2bgn_cfg=0A= +#define IWN_SDID_x030_16 0x5226 // iwl6030_2abg_cfg=0A= +=0A= +/*=0A= + * = -------------------------------------------------------------------------= ----=0A= + * Device ID for 130 Series =0A= + * = -------------------------------------------------------------------------= ----=0A= + */=0A= +#define IWN_DID_130_1 0x0896=0A= +#define IWN_DID_130_2 0x0897=0A= +=0A= +#define IWN_SDID_130_1 0x5005 //iwl130_bgn_cfg=0A= +#define IWN_SDID_130_2 0x5007 //iwl130_bg_cfg=0A= +#define IWN_SDID_130_3 0x5015 //iwl130_bgn_cfg=0A= +#define IWN_SDID_130_4 0x5017 //iwl130_bg_cfg=0A= +#define IWN_SDID_130_5 0x5025 //iwl130_bgn_cfg=0A= +#define IWN_SDID_130_6 0x5027 //iwl130_bg_cfg=0A= +=0A= +/*=0A= + * = -------------------------------------------------------------------------= ----=0A= + * Device ID for 100 Series =0A= + * = -------------------------------------------------------------------------= ----=0A= + */=0A= +#define IWN_DID_100_1 0x08AE=0A= +#define IWN_DID_100_2 0x08AF=0A= +=0A= +#define IWN_SDID_100_1 0x1005 //iwl100_bgn_cfg)=0A= +#define IWN_SDID_100_2 0x1007 //iwl100_bg_cfg)}=0A= +#define IWN_SDID_100_3 0x1015 //iwl100_bgn_cfg)=0A= +#define IWN_SDID_100_4 0x1017 //iwl100_bg_cfg)}=0A= +#define IWN_SDID_100_5 0x1025 //iwl100_bgn_cfg)=0A= +#define IWN_SDID_100_6 0x1027 //iwl100_bg_cfg)}=0A= +=0A= +/*=0A= + * = -------------------------------------------------------------------------= ----=0A= + * Device ID for 5x00 Series =0A= + * = -------------------------------------------------------------------------= ----=0A= + */=0A= +#define IWN_DID_5x00_1 0x4232=0A= +#define IWN_DID_5x00_2 0x4237=0A= +#define IWN_DID_5x00_3 0x4235=0A= +#define IWN_DID_5x00_4 0x4236=0A= +=0A= +#define IWN_SDID_5x00_1 0x1201 //iwl5100_agn_cfg=0A= +#define IWN_SDID_5x00_2 0x1301 //iwl5100_agn_cfg=0A= +#define IWN_SDID_5x00_3 0x1204 //iwl5100_agn_cfg=0A= +#define IWN_SDID_5x00_4 0x1304 //iwl5100_agn_cfg=0A= +#define IWN_SDID_5x00_5 0x1205 //iwl5100_bgn_cfg=0A= +#define IWN_SDID_5x00_6 0x1305 //iwl5100_bgn_cfg=0A= +#define IWN_SDID_5x00_7 0x1206 //iwl5100_abg_cfg=0A= +#define IWN_SDID_5x00_8 0x1306 //iwl5100_abg_cfg=0A= +#define IWN_SDID_5x00_9 0x1221 //iwl5100_agn_cfg=0A= +#define IWN_SDID_5x00_10 0x1321 //iwl5100_agn_cfg=0A= +#define IWN_SDID_5x00_11 0x1224 //iwl5100_agn_cfg=0A= +#define IWN_SDID_5x00_12 0x1324 //iwl5100_agn_cfg=0A= +#define IWN_SDID_5x00_13 0x1225 //iwl5100_bgn_cfg=0A= +#define IWN_SDID_5x00_14 0x1325 //iwl5100_bgn_cfg=0A= +#define IWN_SDID_5x00_15 0x1226 //iwl5100_abg_cfg=0A= +#define IWN_SDID_5x00_16 0x1326 //iwl5100_abg_cfg=0A= +#define IWN_SDID_5x00_17 0x1211 //iwl5100_agn_cfg=0A= +#define IWN_SDID_5x00_18 0x1311 //iwl5100_agn_cfg=0A= +#define IWN_SDID_5x00_19 0x1214 //iwl5100_agn_cfg=0A= +#define IWN_SDID_5x00_20 0x1314 //iwl5100_agn_cfg=0A= +#define IWN_SDID_5x00_21 0x1215 //iwl5100_bgn_cfg=0A= +#define IWN_SDID_5x00_22 0x1315 //iwl5100_bgn_cfg=0A= +#define IWN_SDID_5x00_23 0x1216 //iwl5100_abg_cfg=0A= +#define IWN_SDID_5x00_24 0x1316 //iwl5100_abg_cfg=0A= +#define IWN_SDID_5x00_25 0x1021 //iwl5300_agn_cfg=0A= +#define IWN_SDID_5x00_26 0x1121 //iwl5300_agn_cfg=0A= +#define IWN_SDID_5x00_27 0x1024 //iwl5300_agn_cfg=0A= +#define IWN_SDID_5x00_28 0x1124 //iwl5300_agn_cfg=0A= +#define IWN_SDID_5x00_29 0x1001 //iwl5300_agn_cfg=0A= +#define IWN_SDID_5x00_30 0x1101 //iwl5300_agn_cfg=0A= +#define IWN_SDID_5x00_31 0x1004 //iwl5300_agn_cfg=0A= +#define IWN_SDID_5x00_32 0x1104 //iwl5300_agn_cfg=0A= +#define IWN_SDID_5x00_33 0x1011 //iwl5300_agn_cfg=0A= +#define IWN_SDID_5x00_34 0x1111 //iwl5300_agn_cfg=0A= +#define IWN_SDID_5x00_35 0x1014 //iwl5300_agn_cfg=0A= +#define IWN_SDID_5x00_36 0x1114 //iwl5300_agn_cfg=0A= +=0A= +/*=0A= + * = -------------------------------------------------------------------------= ----=0A= + * Device ID for 5x50 Series =0A= + * = -------------------------------------------------------------------------= ----=0A= + */=0A= +#define IWN_DID_5x50_1 0x423A=0A= +#define IWN_DID_5x50_2 0x423B=0A= +#define IWN_DID_5x50_3 0x423C=0A= +#define IWN_DID_5x50_4 0x423D=0A= +=0A= +#define IWN_SDID_5x50_1 0x1001 //iwl5350_agn_cfg=0A= +#define IWN_SDID_5x50_2 0x1021 //iwl5350_agn_cfg=0A= +#define IWN_SDID_5x50_3 0x1011 //iwl5350_agn_cfg=0A= +#define IWN_SDID_5x50_4 0x1201 //iwl5150_agn_cfg=0A= +#define IWN_SDID_5x50_5 0x1301 //iwl5150_agn_cfg=0A= +#define IWN_SDID_5x50_6 0x1206 //iwl5150_abg_cfg=0A= +#define IWN_SDID_5x50_7 0x1306 //iwl5150_abg_cfg=0A= +#define IWN_SDID_5x50_8 0x1221 //iwl5150_agn_cfg=0A= +#define IWN_SDID_5x50_9 0x1321 //iwl5150_agn_cfg=0A= +#define IWN_SDID_5x50_10 0x1211 //iwl5150_agn_cfg=0A= +#define IWN_SDID_5x50_11 0x1311 //iwl5150_agn_cfg=0A= +#define IWN_SDID_5x50_12 0x1216 //iwl5150_abg_cfg=0A= +#define IWN_SDID_5x50_13 0x1316 //iwl5150_abg_cfg=0A= +=0A= +=0A= #define IWN_TX_RING_COUNT 256=0A= #define IWN_TX_RING_LOMARK 192=0A= #define IWN_TX_RING_HIMARK 224=0A= @@ -38,6 +300,11 @@=0A= #define IWN_ICT_SIZE 4096=0A= #define IWN_ICT_COUNT (IWN_ICT_SIZE / sizeof (uint32_t))=0A= =0A= +/* For cards with PAN command default is IWN_CMD_QUEUE_NUM */=0A= +#define IWN_CMD_QUEUE_NUM 4=0A= +#define IWN_PAN_CMD_QUEUE 9=0A= +=0A= +=0A= /* Maximum number of DMA segments for TX. */=0A= #define IWN_MAX_SCATTER 20=0A= =0A= @@ -62,6 +329,7 @@=0A= #define IWN_INT 0x008=0A= #define IWN_INT_MASK 0x00c=0A= #define IWN_FH_INT 0x010=0A= +#define IWN_GPIO_IN 0x018 /* read external chip pins */=0A= #define IWN_RESET 0x020=0A= #define IWN_GP_CNTRL 0x024=0A= #define IWN_HW_REV 0x028=0A= @@ -69,8 +337,12 @@=0A= #define IWN_EEPROM_GP 0x030=0A= #define IWN_OTP_GP 0x034=0A= #define IWN_GIO 0x03c=0A= +#define IWN_GP_UCODE 0x048 =0A= #define IWN_GP_DRIVER 0x050=0A= +#define IWN_UCODE_GP1 0x054=0A= +#define IWN_UCODE_GP1_SET 0x058=0A= #define IWN_UCODE_GP1_CLR 0x05c=0A= +#define IWN_UCODE_GP2 0x060 =0A= #define IWN_LED 0x094=0A= #define IWN_DRAM_INT_TBL 0x0a0=0A= #define IWN_SHADOW_REG_CTRL 0x0a8=0A= @@ -79,10 +351,12 @@=0A= #define IWN_HW_REV_WA 0x22c=0A= #define IWN_DBG_HPET_MEM 0x240=0A= #define IWN_DBG_LINK_PWR_MGMT 0x250=0A= +// Need nic_lock for use above=0A= #define IWN_MEM_RADDR 0x40c=0A= #define IWN_MEM_WADDR 0x410=0A= #define IWN_MEM_WDATA 0x418=0A= #define IWN_MEM_RDATA 0x41c=0A= +#define IWN_TARG_MBX_C 0x430=0A= #define IWN_PRPH_WADDR 0x444=0A= #define IWN_PRPH_RADDR 0x448=0A= #define IWN_PRPH_WDATA 0x44c=0A= @@ -187,12 +461,50 @@=0A= #define IWN_RESET_LINK_PWR_MGMT_DIS (1 << 31)=0A= =0A= /* Possible flags for register IWN_GP_CNTRL. */=0A= -#define IWN_GP_CNTRL_MAC_ACCESS_ENA (1 << 0)=0A= +/*=0A= + * GP (general purpose) CONTROL REGISTER=0A= + * Bit fields:=0A= + * 27: HW_RF_KILL_SW=0A= + * Indicates state of (platform's) hardware RF-Kill switch=0A= + * 26-24: POWER_SAVE_TYPE=0A= + * Indicates current power-saving mode:=0A= + * 000 -- No power saving=0A= + * 001 -- MAC power-down=0A= + * 010 -- PHY (radio) power-down=0A= + * 011 -- Error=0A= + * 9-6: SYS_CONFIG=0A= + * Indicates current system configuration, reflecting pins on = chip=0A= + * as forced high/low by device circuit board.=0A= + * 4: GOING_TO_SLEEP=0A= + * Indicates MAC is entering a power-saving sleep power-down.=0A= + * Not a good time to access device-internal resources.=0A= + * 3: MAC_ACCESS_REQ=0A= + * Host sets this to request and maintain MAC wakeup, to allow = host=0A= + * access to device-internal resources. Host must wait for=0A= + * MAC_CLOCK_READY (and !GOING_TO_SLEEP) before accessing = non-CSR=0A= + * device registers.=0A= + * 2: INIT_DONE=0A= + * Host sets this to put device into fully operational D0 power = mode.=0A= + * Host resets this after SW_RESET to put device into low power = mode.=0A= + * 0: MAC_CLOCK_READY=0A= + * Indicates MAC (ucode processor, etc.) is powered up and can = run.=0A= + * Internal resources are accessible.=0A= + * NOTE: This does not indicate that the processor is actually = running.=0A= + * NOTE: This does not indicate that device has completed=0A= + * init or post-power-down restore of internal SRAM = memory.=0A= + * Use CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP as indication that=0A= + * SRAM is restored and uCode is in normal operation = mode.=0A= + * Later devices (5xxx/6xxx/1xxx) use non-volatile SRAM, = and=0A= + * do not need to save/restore it.=0A= + * NOTE: After device reset, this bit remains "0" until host = sets=0A= + * INIT_DONE=0A= + */=0A= +#define IWN_GP_CNTRL_MAC_ACCESS_ENA (1 << 0) //x00000001=0A= #define IWN_GP_CNTRL_MAC_CLOCK_READY (1 << 0)=0A= -#define IWN_GP_CNTRL_INIT_DONE (1 << 2)=0A= -#define IWN_GP_CNTRL_MAC_ACCESS_REQ (1 << 3)=0A= -#define IWN_GP_CNTRL_SLEEP (1 << 4)=0A= -#define IWN_GP_CNTRL_RFKILL (1 << 27)=0A= +#define IWN_GP_CNTRL_INIT_DONE (1 << 2) //x00000004=0A= +#define IWN_GP_CNTRL_MAC_ACCESS_REQ (1 << 3) //x00000008=0A= +#define IWN_GP_CNTRL_SLEEP (1 << 4) //x00000010=0A= +#define IWN_GP_CNTRL_RFKILL (1 << 27) //x08000000=0A= =0A= /* Possible flags for register IWN_HW_REV. */=0A= #define IWN_HW_REV_TYPE_SHIFT 4=0A= @@ -206,6 +518,7 @@=0A= #define IWN_HW_REV_TYPE_6000 7=0A= #define IWN_HW_REV_TYPE_6050 8=0A= #define IWN_HW_REV_TYPE_6005 11=0A= +#define IWN_HW_REV_TYPE_2230 12=0A= =0A= /* Possible flags for register IWN_GIO_CHICKEN. */=0A= #define IWN_GIO_CHICKEN_L1A_NO_L0S_RX (1 << 23)=0A= @@ -215,16 +528,20 @@=0A= #define IWN_GIO_L0S_ENA (1 << 1)=0A= =0A= /* Possible flags for register IWN_GP_DRIVER. */=0A= -#define IWN_GP_DRIVER_RADIO_3X3_HYB (0 << 0)=0A= -#define IWN_GP_DRIVER_RADIO_2X2_HYB (1 << 0)=0A= -#define IWN_GP_DRIVER_RADIO_2X2_IPA (2 << 0)=0A= -#define IWN_GP_DRIVER_CALIB_VER6 (1 << 2)=0A= -#define IWN_GP_DRIVER_6050_1X2 (1 << 3)=0A= +#define IWN_GP_DRIVER_RADIO_3X3_HYB (0 << 0)=0A= +#define IWN_GP_DRIVER_RADIO_2X2_HYB (1 << 0)=0A= +#define IWN_GP_DRIVER_RADIO_2X2_IPA (2 << 0)=0A= +#define IWN_GP_DRIVER_RADIO_MSK (0x00000003)=0A= +#define IWN_GP_DRIVER_CALIB_VER6 (1 << 2)=0A= +#define IWN_GP_DRIVER_6050_1X2 (1 << 3)=0A= +#define IWN_GP_DRIVER_REG_BIT_RADIO_IQ_INVERT (0x00000080)=0A= =0A= +=0A= /* Possible flags for register IWN_UCODE_GP1_CLR. */=0A= #define IWN_UCODE_GP1_RFKILL (1 << 1)=0A= #define IWN_UCODE_GP1_CMD_BLOCKED (1 << 2)=0A= #define IWN_UCODE_GP1_CTEMP_STOP_RF (1 << 3)=0A= +#define IWN_UCODE_GP1_CFG_COMPLETE (1 << 5)=0A= =0A= /* Possible flags/values for register IWN_LED. */=0A= #define IWN_LED_BSM_CTRL (1 << 5)=0A= @@ -231,6 +548,32 @@=0A= #define IWN_LED_OFF 0x00000038=0A= #define IWN_LED_ON 0x00000078=0A= =0A= +#define IWN_MAX_BLINK_TBL 10=0A= +#define IWN_LED_STATIC_ON 0=0A= +#define IWN_LED_STATIC_OFF 1=0A= +#define IWN_LED_SLOW_BLINK 2=0A= +#define IWN_LED_INT_BLINK 3=0A= +#define IWN_LED_UNIT 0x1388 /* 5 ms */=0A= +=0A= +static const struct {=0A= + uint16_t tpt; /* Mb/s */=0A= + uint8_t on_time;=0A= + uint8_t off_time;=0A= +} blink_tbl[] =3D=0A= +{=0A= + {300, 5, 5},=0A= + {200, 8, 8},=0A= + {100, 11, 11},=0A= + {70, 13, 13},=0A= + {50, 15, 15},=0A= + {20, 17, 17},=0A= + {10, 19, 19},=0A= + {5, 22, 22},=0A= + {1, 26, 26},=0A= + {0, 33, 33},=0A= + /* SOLID_ON */=0A= +};=0A= +=0A= /* Possible flags for register IWN_DRAM_INT_TBL. */=0A= #define IWN_DRAM_INT_TBL_WRAP_CHECK (1 << 27)=0A= #define IWN_DRAM_INT_TBL_ENABLE (1 << 31)=0A= @@ -246,18 +589,19 @@=0A= #define IWN_BSM_WR_CTRL_START (1 << 31)=0A= =0A= /* Possible flags for register IWN_INT. */=0A= -#define IWN_INT_ALIVE (1 << 0)=0A= -#define IWN_INT_WAKEUP (1 << 1)=0A= -#define IWN_INT_SW_RX (1 << 3)=0A= -#define IWN_INT_CT_REACHED (1 << 6)=0A= -#define IWN_INT_RF_TOGGLED (1 << 7)=0A= -#define IWN_INT_SW_ERR (1 << 25)=0A= -#define IWN_INT_SCHED (1 << 26)=0A= -#define IWN_INT_FH_TX (1 << 27)=0A= -#define IWN_INT_RX_PERIODIC (1 << 28)=0A= -#define IWN_INT_HW_ERR (1 << 29)=0A= -#define IWN_INT_FH_RX (1 << 31)=0A= +#define IWN_INT_ALIVE (1 << 0) // x00000001=0A= +#define IWN_INT_WAKEUP (1 << 1) // x00000002=0A= +#define IWN_INT_SW_RX (1 << 3) // x00000008=0A= +#define IWN_INT_CT_REACHED (1 << 6) // x00000040=0A= +#define IWN_INT_RF_TOGGLED (1 << 7) // x00000080=0A= +#define IWN_INT_SW_ERR (1 << 25) // x02000000=0A= +#define IWN_INT_SCHED (1 << 26) // x04000000=0A= +#define IWN_INT_FH_TX (1 << 27) // x08000000=0A= +#define IWN_INT_RX_PERIODIC (1 << 28) // x10000000=0A= +#define IWN_INT_HW_ERR (1 << 29) // x20000000=0A= +#define IWN_INT_FH_RX (1 << 31) // x80000000=0A= =0A= +=0A= /* Shortcut. */=0A= #define IWN_INT_MASK_DEF \=0A= (IWN_INT_SW_ERR | IWN_INT_HW_ERR | IWN_INT_FH_TX | \=0A= @@ -400,6 +744,12 @@=0A= uint8_t qid;=0A= } __packed;=0A= =0A= +/* CARD_STATE_NOTIFICATION */ =0A= +#define IWN_STATE_CHANGE_HW_CARD_DISABLED 0x01=0A= +#define IWN_STATE_CHANGE_SW_CARD_DISABLED 0x02=0A= +#define IWN_STATE_CHANGE_CT_CARD_DISABLED 0x04=0A= +#define IWN_STATE_CHANGE_RXON_CARD_DISABLED 0x10=0A= +=0A= /* Possible RX status flags. */=0A= #define IWN_RX_NO_CRC_ERR (1 << 0)=0A= #define IWN_RX_NO_OVFL_ERR (1 << 1)=0A= @@ -423,7 +773,8 @@=0A= #define IWN_CMD_LINK_QUALITY 78=0A= #define IWN_CMD_SET_LED 72=0A= #define IWN5000_CMD_WIMAX_COEX 90=0A= -#define IWN5000_CMD_CALIB_CONFIG 101=0A= +#define IWN_TEMP_NOTIFICATION 98=0A= +#define IWN5000_CMD_CALIB_CONFIG 101 // CALIBRATION_CFG_CMD=0A= #define IWN5000_CMD_CALIB_RESULT 102=0A= #define IWN5000_CMD_CALIB_COMPLETE 103=0A= #define IWN_CMD_SET_POWER_MODE 119=0A= @@ -436,9 +787,20 @@=0A= #define IWN_CMD_GET_STATISTICS 156=0A= #define IWN_CMD_SET_CRITICAL_TEMP 164=0A= #define IWN_CMD_SET_SENSITIVITY 168=0A= -#define IWN_CMD_PHY_CALIB 176=0A= +#define IWN_CMD_PHY_CALIB 176=0A= #define IWN_CMD_BT_COEX_PRIOTABLE 204=0A= #define IWN_CMD_BT_COEX_PROT 205=0A= +#define IWN_CMD_BT_COEX_NOTIF 206=0A= +/* PAN commands */=0A= +#define IWN_CMD_WIPAN_PARAMS 0xb2=0A= +#define IWN_CMD_WIPAN_RXON 0xb3=0A= +#define IWN_CMD_WIPAN_RXON_TIMING 0xb4=0A= +#define IWN_CMD_WIPAN_RXON_ASSOC 0xb6=0A= +#define IWN_CMD_WIPAN_QOS_PARAM 0xb7=0A= +#define IWN_CMD_WIPAN_WEPKEY 0xb8=0A= +#define IWN_CMD_WIPAN_P2P_CHANNEL_SWITCH 0xb9=0A= +#define IWN_CMD_WIPAN_NOA_NOTIFICATION 0xbc=0A= +#define IWN_CMD_WIPAN_DEACTIVATION_COMPLETE 0xbd=0A= =0A= uint8_t flags;=0A= uint8_t idx;=0A= @@ -446,6 +808,28 @@=0A= uint8_t data[136];=0A= } __packed;=0A= =0A= +/*=0A= + * Structure for IWN_CMD_GET_STATISTICS =3D (0x9c) 156=0A= + * all devices identical.=0A= + *=0A= + * This command triggers an immediate response containing uCode = statistics.=0A= + * The response is in the same format as IWN_BEACON_STATISTICS (0x9d) = 157.=0A= + *=0A= + * If the CLEAR_STATS configuration flag is set, uCode will clear its=0A= + * internal copy of the statistics (counters) after issuing the = response.=0A= + * This flag does not affect IWN_BEACON_STATISTICS after beacons (see = below).=0A= + *=0A= + * If the DISABLE_NOTIF configuration flag is set, uCode will not issue=0A= + * IWN_BEACON_STATISTICS after received beacons. This flag=0A= + * does not affect the response to the IWN_CMD_GET_STATISTICS 0x9c = itself.=0A= + */=0A= +struct iwn_statistics_cmd {=0A= + uint32_t configuration_flags; /* IWN_STATS_CONF_* */=0A= +#define IWN_STATS_CONF_CLEAR_STATS htole32(0x1) =0A= +#define IWN_STATS_CONF_DISABLE_NOTIF htole32(0x2)=0A= +=0A= +} __packed;=0A= +=0A= /* Antenna flags, used in various commands. */=0A= #define IWN_ANT_A (1 << 0)=0A= #define IWN_ANT_B (1 << 1)=0A= @@ -452,6 +836,7 @@=0A= #define IWN_ANT_C (1 << 2)=0A= /* Shortcuts. */=0A= #define IWN_ANT_AB (IWN_ANT_A | IWN_ANT_B)=0A= +#define IWN_ANT_AC (IWN_ANT_A | IWN_ANT_C)=0A= #define IWN_ANT_BC (IWN_ANT_B | IWN_ANT_C)=0A= #define IWN_ANT_ABC (IWN_ANT_A | IWN_ANT_B | IWN_ANT_C)=0A= =0A= @@ -468,6 +853,8 @@=0A= #define IWN_MODE_STA 3=0A= #define IWN_MODE_IBSS 4=0A= #define IWN_MODE_MONITOR 6=0A= +#define IWN_MODE_2STA 8=0A= +#define IWN_MODE_P2P 9=0A= =0A= uint8_t air;=0A= uint16_t rxchain;=0A= @@ -551,7 +938,8 @@=0A= uint16_t atim;=0A= uint32_t binitval;=0A= uint16_t lintval;=0A= - uint16_t reserved;=0A= + uint8_t dtim_period;=0A= + uint8_t delta_cp_bss_tbtts;=0A= } __packed;=0A= =0A= /* Structure for command IWN_CMD_ADD_NODE. */=0A= @@ -565,6 +953,11 @@=0A= uint16_t reserved2;=0A= uint8_t id;=0A= #define IWN_ID_BSS 0=0A= +#define IWN_STA_ID 1=0A= +=0A= +#define IWN_PAN_BCAST_ID 14=0A= +#define IWN_BROADCAST_ID 15=0A= +=0A= #define IWN5000_ID_BROADCAST 15=0A= #define IWN4965_ID_BROADCAST 31=0A= =0A= @@ -766,7 +1159,13 @@=0A= #define IWN_PS_SLEEP_OVER_DTIM (1 << 2)=0A= #define IWN_PS_PCI_PMGT (1 << 3)=0A= #define IWN_PS_FAST_PD (1 << 4)=0A= +#define IWN_PS_BEACON_FILTERING (1 << 5)=0A= +#define IWN_PS_SHADOW_REG (1 << 6)=0A= +#define IWN_PS_CT_KILL (1 << 7)=0A= +#define IWN_PS_BT_SCD (1 << 8)=0A= +#define IWN_PS_ADVANCED_PM (1 << 9)=0A= =0A= +=0A= uint8_t keepalive;=0A= uint8_t debug;=0A= uint32_t rxtimeout;=0A= @@ -803,6 +1202,7 @@=0A= =0A= struct iwn_scan_chan {=0A= uint32_t flags;=0A= +#define IWN_CHAN_PASSIVE (0 << 0)=0A= #define IWN_CHAN_ACTIVE (1 << 0)=0A= #define IWN_CHAN_NPBREQS(x) (((1 << (x)) - 1) << 1)=0A= =0A= @@ -813,9 +1213,26 @@=0A= uint16_t passive; /* msecs */=0A= } __packed;=0A= =0A= +#define IWN_SCAN_CRC_TH_DISABLED 0=0A= +#define IWN_SCAN_CRC_TH_DEFAULT htole16(1)=0A= +#define IWN_SCAN_CRC_TH_NEVER htole16(0xffff)=0A= +=0A= +=0A= /* Maximum size of a scan command. */=0A= #define IWN_SCAN_MAXSZ (MCLBYTES - 4)=0A= =0A= +#define IWN_ACTIVE_DWELL_TIME_24 (30) /* all times in msec */=0A= +#define IWN_ACTIVE_DWELL_TIME_52 (20)=0A= +#define IWN_ACTIVE_DWELL_FACTOR_24 (3)=0A= +#define IWN_ACTIVE_DWELL_FACTOR_52 (2)=0A= +=0A= +#define IWN_PASSIVE_DWELL_TIME_24 (20) /* all times in msec */=0A= +#define IWN_PASSIVE_DWELL_TIME_52 (10)=0A= +#define IWN_PASSIVE_DWELL_BASE (100)=0A= +#define IWN_CHANNEL_TUNE_TIME (5)=0A= +=0A= +#define IWN_SCAN_CHAN_TIMEOUT 2=0A= +=0A= /* Structure for command IWN_CMD_TXPOWER (4965AGN only.) */=0A= #define IWN_RIDX_MAX 32=0A= struct iwn4965_cmd_txpower {=0A= @@ -860,8 +1277,20 @@=0A= uint32_t kill_cts;=0A= } __packed;=0A= =0A= +/* Structures for enhanced command IWN_CMD_BLUETOOTH. */=0A= struct iwn6000_btcoex_config {=0A= uint8_t flags;=0A= +#define IWN_BT_FLAG_COEX6000_CHAN_INHIBITION 1=0A= +#define IWN_BT_FLAG_COEX6000_MODE_MASK ( (1 << 3) | (1 << 4) | (1 <<5 = ))=0A= +#define IWN_BT_FLAG_COEX6000_MODE_SHIFT 3=0A= +#define IWN_BT_FLAG_COEX6000_MODE_DISABLED 0=0A= +#define IWN_BT_FLAG_COEX6000_MODE_LEGACY_2W 1=0A= +#define IWN_BT_FLAG_COEX6000_MODE_3W 2=0A= +#define IWN_BT_FLAG_COEX6000_MODE_4W 3=0A= +=0A= +#define IWN_BT_FLAG_UCODE_DEFAULT (1 << 6)=0A= +/* Disable Sync PSPoll on SCO/eSCO */=0A= +#define IWN_BT_FLAG_SYNC_2_BT_DISABLE (1 << 7)=0A= uint8_t lead_time;=0A= uint8_t max_kill;=0A= uint8_t bt3_t7_timer;=0A= @@ -878,6 +1307,29 @@=0A= uint16_t rx_prio_boost;=0A= } __packed;=0A= =0A= +/* Structures for enhanced command IWN_CMD_BLUETOOTH for 2000 Series. */=0A= +struct iwn2000_btcoex_config {=0A= + uint8_t flags; // Cf Flags in iwn6000_btcoex_config=0A= + uint8_t lead_time;=0A= + uint8_t max_kill;=0A= + uint8_t bt3_t7_timer;=0A= + uint32_t kill_ack;=0A= + uint32_t kill_cts;=0A= + uint8_t sample_time;=0A= + uint8_t bt3_t2_timer;=0A= + uint16_t bt4_reaction;=0A= + uint32_t lookup_table[12];=0A= + uint16_t bt4_decision;=0A= + uint16_t valid;=0A= + =0A= + uint32_t prio_boost; // size change prior to iwn6000_btcoex_config=0A= + uint8_t reserved; // added prior to iwn6000_btcoex_config=0A= + =0A= + uint8_t tx_prio_boost;=0A= + uint16_t rx_prio_boost;=0A= +} __packed;=0A= +=0A= +=0A= struct iwn_btcoex_priotable {=0A= uint8_t calib_init1;=0A= uint8_t calib_init2;=0A= @@ -899,8 +1351,8 @@=0A= =0A= /* Structure for command IWN_CMD_SET_CRITICAL_TEMP. */=0A= struct iwn_critical_temp {=0A= + uint32_t tempM;=0A= uint32_t reserved;=0A= - uint32_t tempM;=0A= uint32_t tempR;=0A= /* degK <-> degC conversion macros. */=0A= #define IWN_CTOK(c) ((c) + 273)=0A= @@ -955,6 +1407,10 @@=0A= uint16_t reserved;=0A= } __packed;=0A= =0A= +/* Define maximal number of calib result send to runtime firmware =0A= +PS: TEMP_OFFSET count for 2 (std and v2)=0A= +*/=0A= +#define IWN5000_PHY_CALIB_MAX_RESULT 8=0A= /* Structures for command IWN_CMD_PHY_CALIB. */=0A= struct iwn_phy_calib {=0A= uint8_t code;=0A= @@ -962,7 +1418,7 @@=0A= #define IWN5000_PHY_CALIB_DC 8=0A= #define IWN5000_PHY_CALIB_LO 9=0A= #define IWN5000_PHY_CALIB_TX_IQ 11=0A= -#define IWN5000_PHY_CALIB_CRYSTAL 15=0A= +#define IWN5000_PHY_CALIB_CRYSTAL 15 //Linux =3D = IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD=0A= #define IWN5000_PHY_CALIB_BASE_BAND 16=0A= #define IWN5000_PHY_CALIB_TX_IQ_PERIODIC 17=0A= #define IWN5000_PHY_CALIB_TEMP_OFFSET 18=0A= @@ -975,6 +1431,15 @@=0A= uint8_t isvalid;=0A= } __packed;=0A= =0A= +#define IWN_BUF_IX_PHY_CALIB_DC 0=0A= +#define IWN_BUF_IX_PHY_CALIB_LO 1=0A= +#define IWN_BUF_IX_PHY_CALIB_TX_IQ 2=0A= +#define IWN_BUF_IX_PHY_CALIB_CRYSTAL 3=0A= +#define IWN_BUF_IX_PHY_CALIB_BASE_BAND 4=0A= +#define IWN_BUF_IX_PHY_CALIB_TX_IQ_PERIODIC 5=0A= +#define IWN_BUF_IX_PHY_CALIB_TEMP_OFFSET 6 =0A= +#define IWN_BUF_IX_PHY_CALIB_TEMP_OFFSETv2 7=0A= +=0A= struct iwn5000_phy_calib_crystal {=0A= uint8_t code;=0A= uint8_t group;=0A= @@ -996,6 +1461,17 @@=0A= uint16_t reserved;=0A= } __packed;=0A= =0A= +struct iwn5000_phy_calib_temp_offsetv2 {=0A= + uint8_t code;=0A= + uint8_t group;=0A= + uint8_t ngroups;=0A= + uint8_t isvalid;=0A= + int16_t offset_high;=0A= + int16_t offset_low;=0A= + int16_t burntVoltageRef;=0A= + int16_t reserved;=0A= +} __packed;=0A= +=0A= struct iwn_phy_calib_gain {=0A= uint8_t code;=0A= uint8_t group;=0A= @@ -1366,13 +1842,25 @@=0A= #define IWN_FW_TLV_INIT_DATA 4=0A= #define IWN_FW_TLV_BOOT_TEXT 5=0A= #define IWN_FW_TLV_PBREQ_MAXLEN 6=0A= -#define IWN_FW_TLV_ENH_SENS 14=0A= +#define IWN_FW_TLV_PAN 7=0A= +#define IWN_FW_TLV_RUNT_EVTLOG_PTR 8=0A= +#define IWN_FW_TLV_RUNT_EVTLOG_SIZE 9=0A= +#define IWN_FW_TLV_RUNT_ERRLOG_PTR 10=0A= +#define IWN_FW_TLV_INIT_EVTLOG_PTR 11=0A= +#define IWN_FW_TLV_INIT_EVTLOG_SIZE 12=0A= +#define IWN_FW_TLV_INIT_ERRLOG_PTR 13=0A= +#define IWN_FW_TLV_ENH_SENS 14=0A= #define IWN_FW_TLV_PHY_CALIB 15=0A= +#define IWN_FW_TLV_WOWLAN_INST 16=0A= +#define IWN_FW_TLV_WOWLAN_DATA 17=0A= +#define IWN_FW_TLV_FLAGS 18=0A= =0A= uint16_t alt;=0A= uint32_t len;=0A= } __packed;=0A= =0A= +#define IWN_FW_TLV_FLAGS_NEW_SCAN_BITPOS 1=0A= +=0A= #define IWN4965_FW_TEXT_MAXSZ ( 96 * 1024)=0A= #define IWN4965_FW_DATA_MAXSZ ( 40 * 1024)=0A= #define IWN5000_FW_TEXT_MAXSZ (256 * 1024)=0A= @@ -1389,8 +1877,8 @@=0A= #define IWN_EEPROM_RFCFG 0x048=0A= #define IWN4965_EEPROM_DOMAIN 0x060=0A= #define IWN4965_EEPROM_BAND1 0x063=0A= -#define IWN5000_EEPROM_REG 0x066=0A= -#define IWN5000_EEPROM_CAL 0x067=0A= +#define IWN5000_EEPROM_REG 0x066=0A= +#define IWN5000_EEPROM_CAL 0x067=0A= #define IWN4965_EEPROM_BAND2 0x072=0A= #define IWN4965_EEPROM_BAND3 0x080=0A= #define IWN4965_EEPROM_BAND4 0x08d=0A= @@ -1402,18 +1890,10 @@=0A= #define IWN4965_EEPROM_BANDS 0x0ea=0A= /* Indirect offsets. */=0A= #define IWN5000_EEPROM_DOMAIN 0x001=0A= -#define IWN5000_EEPROM_BAND1 0x004=0A= -#define IWN5000_EEPROM_BAND2 0x013=0A= -#define IWN5000_EEPROM_BAND3 0x021=0A= -#define IWN5000_EEPROM_BAND4 0x02e=0A= -#define IWN5000_EEPROM_BAND5 0x03a=0A= -#define IWN5000_EEPROM_BAND6 0x041=0A= -#define IWN6000_EEPROM_BAND6 0x040=0A= -#define IWN5000_EEPROM_BAND7 0x049=0A= #define IWN6000_EEPROM_ENHINFO 0x054=0A= -#define IWN5000_EEPROM_CRYSTAL 0x128=0A= -#define IWN5000_EEPROM_TEMP 0x12a=0A= -#define IWN5000_EEPROM_VOLT 0x12b=0A= +#define IWN5000_EEPROM_CRYSTAL 0x128 //XTAL in linux 3.2=0A= +#define IWN5000_EEPROM_TEMP 0x12a //KELVIN_TEMPERATURE in linux 3.2=0A= +#define IWN5000_EEPROM_VOLT 0x12b //RAW_TEMPERATURE in linux 3.2=0A= =0A= /* Possible flags for IWN_EEPROM_SKU_CAP. */=0A= #define IWN_EEPROM_SKU_CAP_11N (1 << 6)=0A= @@ -1479,9 +1959,29 @@=0A= struct iwn4965_eeprom_chan_samples chans[2];=0A= } __packed;=0A= =0A= +/* ADD / MODIFY STATION Command (Op Code 18) - byte 76-18 -bit13=0A= + STA_FLAG_PAN_STATION bit:=0A= + This bit is set (1) for a station in PAN mode */=0A= +#define IWN_STA_FLAG_PAN_STATION (1 << 13)=0A= +=0A= +#define IWN_BEACON_INTERVAL_DEFAULT 200=0A= +#define IWN_SLOT_TIME_MIN 20=0A= +=0A= +=0A= +=0A= /*=0A= * Offsets of channels descriptions in EEPROM.=0A= */=0A= +#define IWN5000_EEPROM_NO_HT40 0x000 //EEPROM_REGULATORY_BAND_NO_HT40=0A= +#define IWN5000_EEPROM_BAND1 0x004 //EEPROM_REG_BAND_1_CHANNELS=0A= +#define IWN5000_EEPROM_BAND2 0x013 //EEPROM_REG_BAND_2_CHANNELS=0A= +#define IWN5000_EEPROM_BAND3 0x021 //EEPROM_REG_BAND_3_CHANNELS=0A= +#define IWN5000_EEPROM_BAND4 0x02e //EEPROM_REG_BAND_4_CHANNELS=0A= +#define IWN5000_EEPROM_BAND5 0x03a //EEPROM_REG_BAND_5_CHANNELS=0A= +#define IWN5000_EEPROM_BAND6 0x041 //EEPROM_REG_BAND_24_HT40_CHANNELS=0A= +#define IWN6000_EEPROM_BAND6 0x040 = //EEPROM_6000_REG_BAND_24_HT40_CHANNELS=0A= +#define IWN5000_EEPROM_BAND7 0x049 //EEPROM_REG_BAND_52_HT40_CHANNELS=0A= +=0A= static const uint32_t iwn4965_regulatory_bands[IWN_NBANDS] =3D {=0A= IWN4965_EEPROM_BAND1,=0A= IWN4965_EEPROM_BAND2,=0A= @@ -1489,7 +1989,7 @@=0A= IWN4965_EEPROM_BAND4,=0A= IWN4965_EEPROM_BAND5,=0A= IWN4965_EEPROM_BAND6,=0A= - IWN4965_EEPROM_BAND7=0A= + IWN4965_EEPROM_BAND7 // Should be IWN5000_EEPRON_NO_HT40=0A= };=0A= =0A= static const uint32_t iwn5000_regulatory_bands[IWN_NBANDS] =3D {=0A= @@ -1512,6 +2012,16 @@=0A= IWN5000_EEPROM_BAND7=0A= };=0A= =0A= +static const uint32_t iwn1000_regulatory_bands[IWN_NBANDS] =3D {=0A= + IWN5000_EEPROM_BAND1,=0A= + IWN5000_EEPROM_BAND2,=0A= + IWN5000_EEPROM_BAND3,=0A= + IWN5000_EEPROM_BAND4,=0A= + IWN5000_EEPROM_BAND5,=0A= + IWN5000_EEPROM_BAND6,=0A= + IWN5000_EEPROM_NO_HT40,=0A= +};=0A= +=0A= #define IWN_CHAN_BANDS_COUNT 7=0A= #define IWN_MAX_CHAN_PER_BAND 14=0A= static const struct iwn_chan_band {=0A= @@ -1531,6 +2041,20 @@=0A= { 11, { 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157 } }=0A= };=0A= =0A= +static const uint8_t iwn_bss_ac_to_queue[] =3D {=0A= + 2, 3, 1, 0,=0A= +};=0A= +=0A= +static const uint8_t iwn_pan_ac_to_queue[] =3D {=0A= + 5, 4, 6, 7,=0A= +};=0A= +=0A= +=0A= +/* OTP */=0A= +/* lower blocks contain EEPROM image and calibration data */=0A= +#define OTP_LOW_IMAGE_SIZE (2 * 512 * sizeof(int)) /* 2 KB */=0A= +=0A= +=0A= #define IWN1000_OTP_NBLOCKS 3 =0A= #define IWN6000_OTP_NBLOCKS 4 =0A= #define IWN6050_OTP_NBLOCKS 7=0A= @@ -1541,7 +2065,33 @@=0A= =0A= #define IWN4965_MAX_PWR_INDEX 107=0A= =0A= +#define IWN_POWERSAVE_LVL_NONE 0=0A= +#define IWN_POWERSAVE_LVL_VOIP_COMPATIBLE 1=0A= +#define IWN_POWERSAVE_LVL_MAX 5=0A= +=0A= +#define IWN_POWERSAVE_LVL_DEFAULT IWN_POWERSAVE_LVL_NONE=0A= +=0A= +/* DTIM value to pass in for IWN_POWERSAVE_LVL_VOIP_COMPATIBLE */=0A= +#define IWN_POWERSAVE_DTIM_VOIP_COMPATIBLE 2=0A= +=0A= +=0A= /*=0A= + * If IWN_DTIM_INDICATES_UNICAST_PENDING_AT_AP is defined, then power = saving=0A= + * (including the power saving done for unicast traffic) becomes = proportional=0A= + * to the DTIM period received from the AP. Otherwise the constant DTIM=0A= + * period IWN_POWERSAVE_DTIM_VOIP_COMPATIBLE is used.=0A= + *=0A= + * Per the 802.11 spec DTIM value as applicable to power saving seems = to be=0A= + * relevant only for indicating the frequency at which = broadcast/multicast=0A= + * data is sent to the PS STAs.=0A= + * However in practice some APs may also send the unicast traffic along = with=0A= + * the DTIM.=0A= + */=0A= +#define IWN_DTIM_INDICATES_UNICAST_PENDING_AT_AP=0A= +=0A= +=0A= +=0A= +/*=0A= * RF Tx gain values from highest to lowest power (values obtained from=0A= * the reference driver.)=0A= */=0A= @@ -1657,6 +2207,7 @@=0A= uint32_t min_energy_cck;=0A= uint32_t energy_cck;=0A= uint32_t energy_ofdm;=0A= + uint32_t min_corr_barker_mrc;=0A= };=0A= =0A= /*=0A= @@ -1671,7 +2222,8 @@=0A= 200, 400,=0A= 97,=0A= 100,=0A= - 100=0A= + 100,=0A= + 390=0A= };=0A= =0A= static const struct iwn_sensitivity_limits iwn5000_sensitivity_limits = =3D {=0A= @@ -1683,7 +2235,8 @@=0A= 170, 400,=0A= 95,=0A= 95,=0A= - 95=0A= + 95,=0A= + 390=0A= };=0A= =0A= static const struct iwn_sensitivity_limits iwn5150_sensitivity_limits = =3D {=0A= @@ -1695,7 +2248,8 @@=0A= 170, 400,=0A= 95,=0A= 95,=0A= - 95=0A= + 95,=0A= + 390=0A= };=0A= =0A= static const struct iwn_sensitivity_limits iwn1000_sensitivity_limits = =3D {=0A= @@ -1707,10 +2261,23 @@=0A= 170, 400,=0A= 95,=0A= 95,=0A= - 95=0A= + 95,=0A= + 390=0A= };=0A= =0A= -static const struct iwn_sensitivity_limits iwn6000_sensitivity_limits = =3D {=0A= +/*min_ofdm_x1; // auto_corr_min_ofdm_x1 , max_ofdm_x1; = //auto_corr_max_ofdm_x1=0A= +min_ofdm_mrc_x1; //auto_corr_min_ofdm_mrc_x1, max_ofdm_mrc_x1; = //auto_corr_max_ofdm_mrc=0A= +min_ofdm_x4; //auto_corr_min_ofdm, max_ofdm_x4; //auto_corr_max_ofdm =0A= +min_ofdm_mrc_x4; //auto_corr_min_ofdm_mrc, max_ofdm_mrc_x4 = //max_ofdm_mrc_x4=0A= +min_cck_x4; //auto_corr_min_cck, max_cck_x4:auto_corr_max_cck=0A= +min_cck_mrc_x4 : auto_corr_min_cck_mrc max_cck_mrc_x4: = auto_corr_max_cck_mrc=0A= +min_energy_cck: min_nrg_cck=0A= +energy_cck:nrg_th_cck=0A= +energy_ofdm:nrg_th_ofdm=0A= +corr_barker_mrc :barker_corr_th_min_mrc=0A= +*/=0A= + /* Define several specific values for Intel 6000 series */=0A= + static const struct iwn_sensitivity_limits iwn6000_sensitivity_limits = =3D {=0A= 105, 110,=0A= 192, 232,=0A= 80, 145,=0A= @@ -1717,11 +2284,13 @@=0A= 128, 232,=0A= 125, 175,=0A= 160, 310,=0A= - 97,=0A= - 97,=0A= - 100=0A= + 110,=0A= + 110,=0A= + 110,=0A= + 336=0A= };=0A= =0A= +=0A= /* Map TID to TX scheduler's FIFO. */=0A= static const uint8_t iwn_tid2fifo[] =3D {=0A= 1, 0, 0, 1, 2, 2, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 3=0A= @@ -1805,3 +2374,364 @@=0A= #define IWN_BARRIER_READ_WRITE(sc) \=0A= bus_space_barrier((sc)->sc_st, (sc)->sc_sh, 0, (sc)->sc_sz, \=0A= BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE)=0A= +=0A= + =0A= +static const uint32_t iwn2030_regulatory_bands[IWN_NBANDS] =3D {=0A= + IWN5000_EEPROM_BAND1,=0A= + IWN5000_EEPROM_BAND2,=0A= + IWN5000_EEPROM_BAND3,=0A= + IWN5000_EEPROM_BAND4,=0A= + IWN5000_EEPROM_BAND5,=0A= + IWN6000_EEPROM_BAND6,=0A= + IWN5000_EEPROM_BAND7=0A= +};=0A= + /* Get value from linux kernel 3.2.+ in = Drivers/net/wireless/iwlwifi/iwl-2000.c*/=0A= +static const struct iwn_sensitivity_limits iwn2030_sensitivity_limits = =3D {=0A= + 105,110,=0A= + 128,232,=0A= + 80,145,=0A= + 128,232,=0A= + 125,175,=0A= + 160,310,=0A= + 97,=0A= + 97,=0A= + 110=0A= +}; =0A= + =0A= + =0A= +/* = =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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=0A= + * NIC PARAMETERS=0A= + *=0A= + * = =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=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=0A= + */=0A= + =0A= +/* Flags for managing calibration result. See calib_need in = iwn_base_params struct */=0A= +#define IWN_FLG_NEED_PHY_CALIB_DC (1<<0)=0A= +#define IWN_FLG_NEED_PHY_CALIB_LO (1<<1)=0A= +#define IWN_FLG_NEED_PHY_CALIB_TX_IQ (1<<2)=0A= +#define IWN_FLG_NEED_PHY_CALIB_CRYSTAL (1<<3)=0A= +#define IWN_FLG_NEED_PHY_CALIB_BASE_BAND (1<<4)=0A= +#define IWN_FLG_NEED_PHY_CALIB_TX_IQ_PERIODIC (1<<5)=0A= +#define IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET (1<<6)=0A= +#define IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSETv2 (1<<7)=0A= +=0A= + =0A= +/* Define some parameters for managing different NIC.=0A= + * Refer to linux specific file like iwl-xxxx.c to determine correct = value for NIC=0A= + *=0A= + *=0A= + * @max_ll_items: max number of OTP blocks=0A= + * @shadow_ram_support: shadow support for OTP memory=0A= + * @led_compensation: compensate on the led on/off time per HW according=0A= + * to the deviation to achieve the desired led frequency.=0A= + * The detail algorithm is described in iwl-led.c=0A= + * @chain_noise_num_beacons: number of beacons used to compute chain = noise=0A= + * @adv_thermal_throttle: support advance thermal throttle=0A= + * @support_ct_kill_exit: support ct kill exit condition=0A= + * @support_wimax_coexist: support wimax/wifi co-exist=0A= + * @plcp_delta_threshold: plcp error rate threshold used to trigger=0A= + * radio tuning when there is a high receiving plcp error rate=0A= + * @chain_noise_scale: default chain noise scale used for gain = computation=0A= + * @wd_timeout: TX queues watchdog timeout=0A= + * @max_event_log_size: size of event log buffer size for ucode event = logging=0A= + * @shadow_reg_enable: HW shadhow register bit=0A= + * @no_idle_support: do not support idle mode=0A= + * @hd_v2: v2 of enhanced sensitivity value, used for 2000 series and up=0A= + * advanced_bt_coexist : Advanced BT management=0A= + * bt_session_2 : NIC need a new struct for configure BT coexistence. = Needed only if advanced_bt_coexist is true =0A= + * bt_sco_disable :=0A= + * additional_nic_config: For 6005 series=0A= + * iq_invert : ? But need it for N 2000 series=0A= + * regulatory_bands :=0A= + * enhanced_TX_power : EEPROM Has advanced TX power options. Set 'True' = if update_enhanced_txpower =3D iwl_eeprom_enhanced_txpower =0A= + * need_temp_offset_calib : Need to compute some temp offset for = calibration.=0A= + * calib_need : Use IWN_FLG_NEED_PHY_CALIB_* flags to specify which = calibration data ucode need. See calib_init_cfg in iwl-xxxx.c linux = kernel file=0A= + * additional_gp_drv_bit : Specific bit to defined during nic_config=0A= + */=0A= +struct iwn_base_params {=0A= + uint32_t pll_cfg_val;=0A= + const uint16_t max_ll_items;=0A= +#define IWN_OTP_MAX_LL_ITEMS_1000 (3) /* OTP blocks for 1000 */=0A= +#define IWN_OTP_MAX_LL_ITEMS_6x00 (4) /* OTP blocks for 6x00 */=0A= +#define IWN_OTP_MAX_LL_ITEMS_6x50 (7) /* OTP blocks for 6x50 */=0A= +#define IWN_OTP_MAX_LL_ITEMS_2x00 (4) /* OTP blocks for 2x00 */=0A= + const bool shadow_ram_support;=0A= + uint16_t led_compensation;=0A= + bool adv_thermal_throttle;=0A= + bool support_ct_kill_exit;=0A= + uint8_t plcp_delta_threshold;=0A= + int chain_noise_scale;=0A= + unsigned int wd_timeout;=0A= + uint32_t max_event_log_size;=0A= + const bool shadow_reg_enable;=0A= + const bool hd_v2;=0A= + const bool advanced_bt_coexist;=0A= + const bool bt_session_2;=0A= + const bool bt_sco_disable;=0A= + const bool additional_nic_config;=0A= + const uint32_t *regulatory_bands;=0A= + const bool enhanced_TX_power; // See iwl-agn-devices.c file to = determine that(enhanced_txpower). =0A= + const uint16_t calib_need;=0A= + const bool no_crystal_calibration; // see no_xtal_calib in linux=0A= + const bool support_hostap; //Define IEEE80211_C_HOSTAP for ic_caps=0A= + const bool no_multi_vaps; // see iwn_vap_create=0A= + uint8_t additional_gp_drv_bit; //=0A= + =0A= +};=0A= +=0A= +/* NOTA : Values with comments BEFORE are not yet used in driver */=0A= +static struct iwn_base_params iwn_default_base_params =3D {=0A= + IWN_ANA_PLL_INIT, // pll_cfg_val=0A= + 4, //max_ll_items=0A= + true, // shadow_ram_support=0A= + /*.led_compensation =3D */57,=0A= + /*.adv_thermal_throttle =3D*/ true,=0A= + /*.support_ct_kill_exit =3D */true,=0A= + /*.plcp_delta_threshold =3D*/ 50, /*IWL_MAX_PLCP_ERR_THRESHOLD_DEF,*/=0A= + /*.chain_noise_scale =3D*/ 1000,=0A= + /*.wd_timeout =3D */2000, /* IWL_LONG_WD_TIMEOUT,*/=0A= + /*.max_event_log_size =3D*/ 512,=0A= + false, //shadow_reg_enable=0A= + /*.hd_v2 =3D */true,=0A= + false, // advanced_bt_coexist=0A= + false, // bt_session_2=0A= + true, // bt_sco_disable=0A= + false, //additional_nic_config=0A= + iwn5000_regulatory_bands, //regulatory_bands=0A= + false, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO | = IWN_FLG_NEED_PHY_CALIB_TX_IQ | IWN_FLG_NEED_PHY_CALIB_BASE_BAND ), = //calib_need=0A= + false, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, // no_multi_vaps=0A= + 0, //additional_gp_drv_bit=0A= +};=0A= +=0A= +static struct iwn_base_params iwn2030_base_params =3D {=0A= + 0, //pll_cfg_val=0A= + IWN_OTP_MAX_LL_ITEMS_2x00, //max_ll_items=0A= + true, //shadow_ram_support=0A= + /*.led_compensation =3D */ 57,=0A= + /*.adv_thermal_throttle =3D */ true,=0A= + /*.support_ct_kill_exit =3D */ true,=0A= + /*.plcp_delta_threshold =3D */ 50,=0A= + /*.chain_noise_scale =3D */ 1000,=0A= + /*.wd_timeout =3D */ 2000,=0A= + /*.max_event_log_size =3D */ 512,=0A= + false, //shadow_reg_enable=0A= + /*.hd_v2 =3D */ true,=0A= + true, //advanced_bt_coexist=0A= + true, //bt_session_2=0A= + true, //bt_sco_disable=0A= + false, //additional_nic_config=0A= + iwn2030_regulatory_bands, //regulatory_bands=0A= + true, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO | = IWN_FLG_NEED_PHY_CALIB_TX_IQ | IWN_FLG_NEED_PHY_CALIB_BASE_BAND | = IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSETv2 ), //calib_need=0A= + false, //no_crystal_calibration=0A= + true, //support_hostap=0A= + false, //no_multi_vaps=0A= + IWN_GP_DRIVER_REG_BIT_RADIO_IQ_INVERT, // additional_gp_drv_bit=0A= +};=0A= +=0A= +=0A= +static struct iwn_base_params iwn_1000_base_params =3D {=0A= + IWN_ANA_PLL_INIT, //pll_cfg_val=0A= + IWN_OTP_MAX_LL_ITEMS_1000, //max_ll_items=0A= + false, //shadow_ram_support=0A= + /*.led_compensation =3D */57,=0A= + /*.adv_thermal_throttle =3D*/ true,=0A= + /*.support_ct_kill_exit =3D */true,=0A= + /*.plcp_delta_threshold =3D*/ 50, /*IWL_MAX_PLCP_ERR_THRESHOLD_DEF,*/=0A= + /*.chain_noise_scale =3D*/ 1000,=0A= + /*.wd_timeout =3D */2000, /* IWL_LONG_WD_TIMEOUT,*/=0A= + /*.max_event_log_size =3D*/ 512,=0A= + false, //shadow_reg_enable=0A= + /*.hd_v2 =3D */true,=0A= + false, //advanced_bt_coexist=0A= + false, //bt_session_2=0A= + false, //bt_sco_disable=0A= + false, //additional_nic_config=0A= + iwn5000_regulatory_bands, //regulatory_bands=0A= + false, //enhanced_TX_power=0A= + ( IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO | = IWN_FLG_NEED_PHY_CALIB_TX_IQ | IWN_FLG_NEED_PHY_CALIB_BASE_BAND ), = //calib_need=0A= + false, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, //no_multi_vaps=0A= + 0, //additional_gp_drv_bit=0A= +};=0A= +static struct iwn_base_params iwn_6000_base_params =3D {=0A= + 0, //pll_cfg_val=0A= + IWN_OTP_MAX_LL_ITEMS_6x00, // max_ll_items=0A= + true, //shadow_ram_support=0A= + /*.led_compensation =3D */57,=0A= + /*.adv_thermal_throttle =3D*/ true,=0A= + /*.support_ct_kill_exit =3D */true,=0A= + /*.plcp_delta_threshold =3D*/ 50, /*IWL_MAX_PLCP_ERR_THRESHOLD_DEF,*/=0A= + /*.chain_noise_scale =3D*/ 1000,=0A= + /*.wd_timeout =3D */2000, /* IWL_LONG_WD_TIMEOUT,*/=0A= + /*.max_event_log_size =3D*/ 512,=0A= + false, //shadow_reg_enable=0A= + /*.hd_v2 =3D */true,=0A= + false, // advanced_bt_coexist=0A= + false, //bt_session_2=0A= + false, //bt_sco_disable=0A= + false, //additional_nic_config=0A= + iwn6000_regulatory_bands, //regulatory_bands=0A= + true, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO | = IWN_FLG_NEED_PHY_CALIB_TX_IQ | IWN_FLG_NEED_PHY_CALIB_BASE_BAND ), = //calib_need=0A= + false, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, //no_multi_vaps=0A= + 0, //additional_gp_drv_bit=0A= +};=0A= +static struct iwn_base_params iwn_6000i_base_params =3D {=0A= + 0, //pll_cfg_val=0A= + IWN_OTP_MAX_LL_ITEMS_6x00, // max_ll_items=0A= + true, //shadow_ram_support=0A= + /*.led_compensation =3D */57,=0A= + /*.adv_thermal_throttle =3D*/ true,=0A= + /*.support_ct_kill_exit =3D */true,=0A= + /*.plcp_delta_threshold =3D*/ 50, /*IWL_MAX_PLCP_ERR_THRESHOLD_DEF,*/=0A= + /*.chain_noise_scale =3D*/ 1000,=0A= + /*.wd_timeout =3D */2000, /* IWL_LONG_WD_TIMEOUT,*/=0A= + /*.max_event_log_size =3D*/ 512,=0A= + false, //shadow_reg_enable=0A= + /*.hd_v2 =3D */true,=0A= + false, // advanced_bt_coexist=0A= + false, //bt_session_2=0A= + true, //bt_sco_disable=0A= + false, //additional_nic_config=0A= + iwn6000_regulatory_bands, //regulatory_bands=0A= + true, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO | = IWN_FLG_NEED_PHY_CALIB_TX_IQ | IWN_FLG_NEED_PHY_CALIB_BASE_BAND ), = //calib_need=0A= + false, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, //no_multi_vaps=0A= + 0, //additional_gp_drv_bit=0A= +};=0A= +static struct iwn_base_params iwn_6000g2_base_params =3D {=0A= + 0, //pll_cfg_val=0A= + IWN_OTP_MAX_LL_ITEMS_6x00, // max_ll_items=0A= + true, //shadow_ram_support=0A= + /*.led_compensation =3D */57,=0A= + /*.adv_thermal_throttle =3D*/ true,=0A= + /*.support_ct_kill_exit =3D */true,=0A= + /*.plcp_delta_threshold =3D*/ 50, /*IWL_MAX_PLCP_ERR_THRESHOLD_DEF,*/=0A= + /*.chain_noise_scale =3D*/ 1000,=0A= + /*.wd_timeout =3D */2000, /* IWL_LONG_WD_TIMEOUT,*/=0A= + /*.max_event_log_size =3D*/ 512,=0A= + false, //shadow_reg_enable=0A= + /*.hd_v2 =3D */true,=0A= + false, // advanced_bt_coexist=0A= + false, //bt_session_2=0A= + true, //bt_sco_disable=0A= + false, //additional_nic_config=0A= + iwn6000_regulatory_bands, //regulatory_bands=0A= + true, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO | = IWN_FLG_NEED_PHY_CALIB_TX_IQ | = IWN_FLG_NEED_PHY_CALIB_BASE_BAND|IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET ), = //calib_need=0A= + false, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, //no_multi_vaps=0A= + 0, //additional_gp_drv_bit=0A= +};=0A= +static struct iwn_base_params iwn_6050_base_params =3D {=0A= + 0, //pll_cfg_val=0A= + IWN_OTP_MAX_LL_ITEMS_6x50, // max_ll_items=0A= + true, //shadow_ram_support=0A= + /*.led_compensation =3D */57,=0A= + /*.adv_thermal_throttle =3D*/ true,=0A= + /*.support_ct_kill_exit =3D */true,=0A= + /*.plcp_delta_threshold =3D*/ 50, /*IWL_MAX_PLCP_ERR_THRESHOLD_DEF,*/=0A= + /*.chain_noise_scale =3D*/ 1000,=0A= + /*.wd_timeout =3D */2000, /* IWL_LONG_WD_TIMEOUT,*/=0A= + /*.max_event_log_size =3D*/ 512,=0A= + false, //shadow_reg_enable=0A= + /*.hd_v2 =3D */true,=0A= + false, // advanced_bt_coexist=0A= + false, //bt_session_2=0A= + true, //bt_sco_disable=0A= + true, //additional_nic_config=0A= + iwn6000_regulatory_bands, //regulatory_bands=0A= + true, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO | = IWN_FLG_NEED_PHY_CALIB_TX_IQ | = IWN_FLG_NEED_PHY_CALIB_BASE_BAND|IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET ), = //calib_need=0A= + false, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, //no_multi_vaps=0A= + 0, //additional_gp_drv_bit=0A= +};=0A= +static struct iwn_base_params iwn_6150_base_params =3D {=0A= + 0, //pll_cfg_val=0A= + IWN_OTP_MAX_LL_ITEMS_6x50, // max_ll_items=0A= + true, //shadow_ram_support=0A= + /*.led_compensation =3D */57,=0A= + /*.adv_thermal_throttle =3D*/ true,=0A= + /*.support_ct_kill_exit =3D */true,=0A= + /*.plcp_delta_threshold =3D*/ 50, /*IWL_MAX_PLCP_ERR_THRESHOLD_DEF,*/=0A= + /*.chain_noise_scale =3D*/ 1000,=0A= + /*.wd_timeout =3D */2000, /* IWL_LONG_WD_TIMEOUT,*/=0A= + /*.max_event_log_size =3D*/ 512,=0A= + false, //shadow_reg_enable=0A= + /*.hd_v2 =3D */true,=0A= + false, // advanced_bt_coexist=0A= + false, //bt_session_2=0A= + true, //bt_sco_disable=0A= + true, //additional_nic_config=0A= + iwn6000_regulatory_bands, //regulatory_bands=0A= + true, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO | = IWN_FLG_NEED_PHY_CALIB_TX_IQ | = IWN_FLG_NEED_PHY_CALIB_BASE_BAND|IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET ), = //calib_need=0A= + false, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, //no_multi_vaps=0A= + IWN_GP_DRIVER_6050_1X2, //additional_gp_drv_bit=0A= +};=0A= +//IWL_DEVICE_6035 & IWL_DEVICE_6030=0A= +static struct iwn_base_params iwn_6000g2b_base_params =3D {=0A= + 0, //pll_cfg_val=0A= + IWN_OTP_MAX_LL_ITEMS_6x00, // max_ll_items=0A= + true, //shadow_ram_support=0A= + /*.led_compensation =3D */57,=0A= + /*.adv_thermal_throttle =3D*/ true,=0A= + /*.support_ct_kill_exit =3D */true,=0A= + /*.plcp_delta_threshold =3D*/ 50, /*IWL_MAX_PLCP_ERR_THRESHOLD_DEF,*/=0A= + /*.chain_noise_scale =3D*/ 1000,=0A= + /*.wd_timeout =3D */2000, /* IWL_LONG_WD_TIMEOUT,*/=0A= + /*.max_event_log_size =3D*/ 512,=0A= + false, //shadow_reg_enable=0A= + /*.hd_v2 =3D */true,=0A= + true, // advanced_bt_coexist=0A= + false, //bt_session_2=0A= + true, //bt_sco_disable=0A= + false, //additional_nic_config=0A= + iwn6000_regulatory_bands, //regulatory_bands=0A= + true, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO | = IWN_FLG_NEED_PHY_CALIB_TX_IQ | = IWN_FLG_NEED_PHY_CALIB_BASE_BAND|IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET ), = //calib_need=0A= + false, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, //no_multi_vaps=0A= + 0, //additional_gp_drv_bit=0A= +};=0A= +static struct iwn_base_params iwn_5x50_base_params =3D {=0A= + IWN_ANA_PLL_INIT, // pll_cfg_val=0A= + 4, //max_ll_items=0A= + true, // shadow_ram_support=0A= + /*.led_compensation =3D */57,=0A= + /*.adv_thermal_throttle =3D*/ true,=0A= + /*.support_ct_kill_exit =3D */true,=0A= + /*.plcp_delta_threshold =3D*/ 50, /*IWL_MAX_PLCP_ERR_THRESHOLD_DEF,*/=0A= + /*.chain_noise_scale =3D*/ 1000,=0A= + /*.wd_timeout =3D */2000, /* IWL_LONG_WD_TIMEOUT,*/=0A= + /*.max_event_log_size =3D*/ 512,=0A= + false, //shadow_reg_enable=0A= + /*.hd_v2 =3D */true,=0A= + false, // advanced_bt_coexist=0A= + false, // bt_session_2=0A= + true, // bt_sco_disable=0A= + false, //additional_nic_config=0A= + iwn5000_regulatory_bands, //regulatory_bands=0A= + false, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO | = IWN_FLG_NEED_PHY_CALIB_TX_IQ | IWN_FLG_NEED_PHY_CALIB_BASE_BAND ), = //calib_need=0A= + true, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, // no_multi_vaps=0A= + 0, //additional_gp_drv_bit=0A= +};=0A= +=0A= Index: sys/dev/iwn/if_iwnvar.h=0A= =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=0A= --- sys/dev/iwn/if_iwnvar.h (revision 253707)=0A= +++ sys/dev/iwn/if_iwnvar.h (working copy)=0A= @@ -2,6 +2,8 @@=0A= /* $OpenBSD: if_iwnvar.h,v 1.18 2010/04/30 16:06:46 damien Exp $ */=0A= =0A= /*-=0A= + * Copyright (c) 2013 Cedric GROSS =0A= + * Copyright (c) 2011 Intel Corporation=0A= * Copyright (c) 2007, 2008=0A= * Damien Bergamini =0A= * Copyright (c) 2008 Sam Leffler, Errno Consulting=0A= @@ -18,7 +20,42 @@=0A= * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT = OF=0A= * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.=0A= */=0A= +enum iwn_rxon_ctx_id {=0A= + IWN_RXON_BSS_CTX,=0A= + IWN_RXON_PAN_CTX,=0A= + IWN_NUM_RXON_CTX=0A= +};=0A= =0A= +=0A= +struct iwn_pan_slot {=0A= + uint16_t time;=0A= + uint8_t type;=0A= + uint8_t reserved;=0A= +} __packed;=0A= +=0A= +struct iwn_pan_params_cmd {=0A= + uint16_t flags;=0A= +#define IWN_PAN_PARAMS_FLG_SLOTTED_MODE (1 << 3)=0A= +=0A= + uint8_t reserved;=0A= + uint8_t num_slots;=0A= + struct iwn_pan_slot slots[10];=0A= +} __packed;=0A= +=0A= +=0A= +struct iwn_led_mode=0A= +{=0A= + uint8_t led_cur_mode;=0A= + uint64_t led_cur_bt;=0A= + uint64_t led_last_bt;=0A= + uint64_t led_cur_tpt;=0A= + uint64_t led_last_tpt;=0A= + uint64_t led_bt_diff;=0A= + int led_cur_time;=0A= + int led_last_time;=0A= +};=0A= + =0A= + =0A= struct iwn_rx_radiotap_header {=0A= struct ieee80211_radiotap_header wr_ihdr;=0A= uint64_t wr_tsft;=0A= @@ -140,6 +177,9 @@=0A= uint32_t energy_samples[10];=0A= u_int cur_energy_sample;=0A= uint32_t energy_cck;=0A= + =0A= + uint32_t corr_barker_mrc;=0A= + uint32_t energy_ofdm;=0A= };=0A= =0A= struct iwn_calib_info {=0A= @@ -191,6 +231,10 @@=0A= =0A= int (*iv_newstate)(struct ieee80211vap *,=0A= enum ieee80211_state, int);=0A= + int ctx;=0A= + int beacon_int;=0A= + uint8_t macaddr[IEEE80211_ADDR_LEN];=0A= +=0A= };=0A= #define IWN_VAP(_vap) ((struct iwn_vap *)(_vap))=0A= =0A= @@ -203,15 +247,18 @@=0A= struct mtx sc_mtx;=0A= =0A= u_int sc_flags;=0A= -#define IWN_FLAG_HAS_OTPROM (1 << 1)=0A= -#define IWN_FLAG_CALIB_DONE (1 << 2)=0A= -#define IWN_FLAG_USE_ICT (1 << 3)=0A= +#define IWN_FLAG_HAS_OTPROM (1 << 1)=0A= +#define IWN_FLAG_CALIB_DONE (1 << 2)=0A= +#define IWN_FLAG_USE_ICT (1 << 3)=0A= #define IWN_FLAG_INTERNAL_PA (1 << 4)=0A= -#define IWN_FLAG_HAS_11N (1 << 6)=0A= -#define IWN_FLAG_ENH_SENS (1 << 7)=0A= -#define IWN_FLAG_ADV_BTCOEX (1 << 8)=0A= +#define IWN_FLAG_HAS_11N (1 << 6)=0A= +#define IWN_FLAG_ENH_SENS (1 << 7)=0A= +#define IWN_FLAG_ADV_BTCOEX (1 << 8)=0A= +#define IWN_FLAG_PAN_SUPPORT (1 << 9)=0A= =0A= uint8_t hw_type;=0A= + /* subdevice_id used to adjust configuration */=0A= + uint16_t subdevice_id; =0A= =0A= struct iwn_ops ops;=0A= const char *fwname;=0A= @@ -272,15 +319,20 @@=0A= int calib_cnt;=0A= struct iwn_calib_state calib;=0A= struct callout watchdog_to;=0A= -=0A= + struct callout ct_kill_exit_to;=0A= struct iwn_fw_info fw;=0A= - struct iwn_calib_info calibcmd[5];=0A= + struct iwn_calib_info calibcmd[IWN5000_PHY_CALIB_MAX_RESULT];=0A= uint32_t errptr;=0A= =0A= struct iwn_rx_stat last_rx_stat;=0A= int last_rx_valid;=0A= struct iwn_ucode_info ucode_info;=0A= - struct iwn_rxon rxon;=0A= + struct iwn_rxon rx_on[IWN_NUM_RXON_CTX];=0A= + struct iwn_rxon *rxon;=0A= + int ctx;=0A= + struct ieee80211vap *ivap[IWN_NUM_RXON_CTX];=0A= + uint8_t uc_pan_support; /*CG: PAN support */=0A= + uint8_t uc_scan_progress;=0A= uint32_t rawtemp;=0A= int temp;=0A= int noise;=0A= @@ -295,11 +347,14 @@=0A= char eeprom_domain[4];=0A= uint32_t eeprom_crystal;=0A= int16_t eeprom_temp;=0A= + int16_t eeprom_temp_high;=0A= int16_t eeprom_voltage;=0A= int8_t maxpwr2GHz;=0A= int8_t maxpwr5GHz;=0A= int8_t maxpwr[IEEE80211_CHAN_MAX];=0A= =0A= + uint32_t tlv_feature_flags;=0A= +=0A= int32_t temp_off;=0A= uint32_t int_mask;=0A= uint8_t ntxchains;=0A= @@ -309,6 +364,7 @@=0A= uint8_t chainmask;=0A= =0A= int sc_tx_timer;=0A= + int sc_scan_timer;=0A= =0A= struct ieee80211_tx_ampdu *qid2tap[IWN5000_NTXQUEUES];=0A= =0A= @@ -323,9 +379,22 @@=0A= void (*sc_addba_stop)(struct ieee80211_node *,=0A= struct ieee80211_tx_ampdu *);=0A= =0A= + struct iwn_led_mode sc_led;=0A= =0A= struct iwn_rx_radiotap_header sc_rxtap;=0A= struct iwn_tx_radiotap_header sc_txtap;=0A= + =0A= +=0A= + /* The power save level originally configured by user */=0A= + int desired_pwrsave_level;=0A= +=0A= + /* The current power save level, this may differ from the configured = value due to=0A= + * thermal throttling etc.=0A= + * */=0A= + int current_pwrsave_level;=0A= +=0A= + /* For specifique params */=0A= + struct iwn_base_params *base_params;=0A= };=0A= =0A= #define IWN_LOCK_INIT(_sc) \=0A= @@ -335,3 +404,5 @@=0A= #define IWN_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED)=0A= #define IWN_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx)=0A= #define IWN_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx)=0A= +#define IWN_UC_PAN_PRESENT 1=0A= +=0A= Index: sys/modules/iwn/Makefile=0A= =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=0A= --- sys/modules/iwn/Makefile (revision 253707)=0A= +++ sys/modules/iwn/Makefile (working copy)=0A= @@ -5,4 +5,12 @@=0A= KMOD =3D if_iwn=0A= SRCS =3D if_iwn.c device_if.h bus_if.h pci_if.h=0A= =0A= +.if !defined(KERNBUILDDIR)=0A= +opt_wlan.h:=0A= + echo "#define IEEE80211_DEBUG 1" > ${.TARGET}=0A= +.endif=0A= +.if IWN_DEBUG=0A= +CFLAGS+=3D-DIWN_DEBUG=0A= +.endif=0A= +=0A= .include =0A= Index: sys/modules/iwnfw/Makefile=0A= =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=0A= --- sys/modules/iwnfw/Makefile (revision 253707)=0A= +++ sys/modules/iwnfw/Makefile (working copy)=0A= @@ -1,5 +1,5 @@=0A= # $FreeBSD$=0A= =0A= -SUBDIR=3D iwn1000 iwn4965 iwn5000 iwn5150 iwn6000 iwn6000g2a iwn6000g2b = iwn6050=0A= +SUBDIR=3D iwn1000 iwn4965 iwn5000 iwn5150 iwn6000 iwn6000g2a iwn6000g2b = iwn6050 iwn2030=0A= =0A= .include =0A= Index: sys/modules/iwnfw/iwn2030/Makefile=0A= =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=0A= --- sys/modules/iwnfw/iwn2030/Makefile (revision 0)=0A= +++ sys/modules/iwnfw/iwn2030/Makefile (working copy)=0A= @@ -0,0 +1,6 @@=0A= +# $FreeBSD$=0A= +=0A= +KMOD=3D iwn2030fw=0A= +IMG=3D iwnwifi-2030-18.168.6.1=0A= +=0A= +.include =0A= ------=_NextPart_000_0004_01CE8B7F.8F536DC0-- From owner-freebsd-wireless@FreeBSD.ORG Sun Jul 28 17:50:10 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 109C78DD; Sun, 28 Jul 2013 17:50:10 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6FA632384; Sun, 28 Jul 2013 17:50:09 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id hj13so119647wib.11 for ; Sun, 28 Jul 2013 10:50: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; bh=Dr/sF1MucNvTFmyLGpDlnNsfV8i75YDYJMkEok/Jl3g=; b=PMQEsGIwZSlZ8KTuBI9M88AEackxuRD2xfS94/P7B4SnnwFfFUzpF24Ciedx/+D8PG piaSc/EDzX/jMPael6Csf6f0Yb7OeDT3fftFSXq8DuPxJqujzW5MG9eQbtFSqm8B3ZYR SKUorgQJ9b6Y18/H9nnVF7ruyANkE23KshJj6PXHLxHGCIBuLF4gHHfmF/eEwXitaqKa OMWErlYkHWJh7zvzgbU9C5jQBZvlCvajnTvLjt1aq/6H02Li8TfwcoibYMHsk8HJT9bx Wrza7/CbmbcY8ud33PPczK+iRgesP1g7JJzQqCfTDNMH3iq2IwPVRZOGNKPI7kgni4Uy bRWw== MIME-Version: 1.0 X-Received: by 10.180.82.196 with SMTP id k4mr4880924wiy.0.1375033807662; Sun, 28 Jul 2013 10:50:07 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Sun, 28 Jul 2013 10:50:07 -0700 (PDT) In-Reply-To: <51F4F3E9.9010605@bitfrost.no> References: <1374573600-2351360719.d37ada5f86@bliksem.vehosting.nl> <201307231220.52817.Daan@vitsch.nl> <51F4F3E9.9010605@bitfrost.no> Date: Sun, 28 Jul 2013 10:50:07 -0700 X-Google-Sender-Auth: d8iUZNzunBc8Whk2H6Ryla1A5UU Message-ID: Subject: Re: My WLI-UC-GNM up crash From: Adrian Chadd To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-arm , freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jul 2013 17:50:10 -0000 As long as that results in the radiotap structures being 4 or 8 byte padded when it's embedded in the softc - then yes, indeed. Xiao, can you try? -adrian On 28 July 2013 03:35, Hans Petter Selasky wrote: > Hi, > > Can you try the attached patch? > > --HPS From owner-freebsd-wireless@FreeBSD.ORG Sun Jul 28 19:25:09 2013 Return-Path: Delivered-To: freebsd-wireless@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 98F52AF6 for ; Sun, 28 Jul 2013 19:25: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 31B4E26D9 for ; Sun, 28 Jul 2013 19:25:09 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id a12so488388wgh.30 for ; Sun, 28 Jul 2013 12:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=c36v8Rfi5Os88fQzb6yYthBl3D4TVmyzyBPvxSkPFVA=; b=LEmYs5EteIoy1iwlL9gzvAWyHkwUBJ+8enNDo6BZOGraPLZJHzpaGJHmywJMfKoY7z PZH6fWKcrojB7KE8cl4pBHc+yxVC0cxaljkY1djbW+j+VVrLeeuL+NdZ2buE91gFxMhA Bq2W3Y7CiS4O7svlTagPeYMvmSA0ZMnZiqPm7f8U9NEnyetaQUzHqua2+429NiD+4UNL 37HZtb+MRI1PjeEszGZcCUKlHnWh0qGpF5Glg8ACZCQF6hArMXSHT2jnre/xQcVTrqoX 2mAmRqWLcSLwyoXs9eqy7nnhCMPUo+FHdGO4KHd1GHRtUkX2Rsb4N5a0Ds1POj4bIVtX 2lAQ== MIME-Version: 1.0 X-Received: by 10.180.39.212 with SMTP id r20mr4943775wik.30.1375039507452; Sun, 28 Jul 2013 12:25:07 -0700 (PDT) Received: by 10.217.94.132 with HTTP; Sun, 28 Jul 2013 12:25:07 -0700 (PDT) In-Reply-To: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> References: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> Date: Sun, 28 Jul 2013 12:25:07 -0700 Message-ID: Subject: Re: [IWN] Reviw split 2 From: Adrian Chadd To: Cedric GROSS Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jul 2013 19:25:09 -0000 Hi! Feedback time! - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s done\n", __func__); + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); + .. all that did was delete a space and add a new line. Just add the space back in there, delete the new line; then that part of the diff will disappear. - if (!(sc->sc_flags & IWN_FLAG_HAS_11N)) { + if (!(sc->sc_flags & IWN_FLAG_HAS_11N)){ Again, you've just deleted a space. You don't need to do that. :-) Just put the space back in, that part of the diff will disappear. - break; +#endif + break; .. the #endif is fine, but you reformatted the "break" line. tsk. There's another break, and another DPRINTF that you did that to. Then in the include file: -#define IWN_INT 0x008 +#define IWN_INT 0x008 #define IWN_INT_MASK 0x00c -#define IWN_FH_INT 0x010 -#define IWN_RESET 0x020 +#define IWN_FH_INT 0x010 +#define IWN_GPIO_IN 0x018 /* read external chip pins */ +#define IWN_RESET 0x020 #define IWN_GP_CNTRL 0x024 -#define IWN_HW_REV 0x028 -#define IWN_EEPROM 0x02c +#define IWN_HW_REV 0x028 +#define IWN_EEPROM 0x02c .. most of those are just tab spaces. You can eliminate those, and all you'd be adding in is the GPIO_IN line. Here's my .vimrc file. It includes colour marking for tabs/spaces, indenting, and lines longer than 78 characters. Thank Bernhard for it. It's great for inspecting code and diffs for things like whitespace changes, trailing whitespace at the end of a line, tabs which should be spaces (and vice versa), etc. adrian@lucy:~]> cat ~/.vimrc " LCD-friendly! :set bg=dark " Do general syntax highlighting :syntax enable " Highlight tab characters as >. (with . being tab spaces) " Highlight extra spaces (ie, before the end of line) with "C" :set list :set listchars=tab:>.,trail:C :highlight NearLength ctermbg=magenta ctermfg=white guibg=#592959 :highlight OverLength ctermbg=red ctermfg=white guibg=#592929 " Match characters after position 78; set highlight to be magenta " Second match characters after position 80; set highlight to be red :match NearLength /\%78v.\+/ :2match OverLength /\%81v.\+/ " Enable auto-indenting :set ai On 27 July 2013 09:09, Cedric GROSS wrote: > Hello, > > > > A new patch. > > > > This one add : > > - a debugging function printing uCode registery. > > - IWN_DEBUG make option > > > > A review has be done also which can safely undefined IWN_DEBUG. Previously > do so lead to compile error. > > > > Cedric > > > > > _______________________________________________ > 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" From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 01:15:23 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4E578ECD for ; Mon, 29 Jul 2013 01:15:23 +0000 (UTC) (envelope-from ghw@7axu.com) Received: from mail-we0-f170.google.com (mail-we0-f170.google.com [74.125.82.170]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D27942339 for ; Mon, 29 Jul 2013 01:15:22 +0000 (UTC) Received: by mail-we0-f170.google.com with SMTP id w60so3487499wes.29 for ; Sun, 28 Jul 2013 18:15:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:x-gm-message-state; bh=g73r4cJ+nVL10bsS5+YYK7j757sANU2060WK6R01xjQ=; b=RBk0bckYhnoXT8kukGa5tgeH7D+OrLqwx82gFwIfRNVY3mBwmIJFovucSM7Id+KyBY BLS+laorxRpocDN0s1VG+qjvmV/pC6aZPCJGdstSuxpidHkdf4VkMxdjt/gcARsY9CAQ PIfYMlCmVhe7vC9OOoMe+x9HVmxrdOYhSmCAwmFxL9nE/DsBS/q3G5cAlE2Xv/034s6x O7QgYCn/d7oFUD6IVHzG3ccxp+F8ZNlF+00Eszxnm0mruqSORk1OMEbtt6QSOfp/YTQu 8TNVQB+C/lgfpt18PUEldEj+M0ELaB4yVlcyNcZ1AwVzH5o4OioEU0ugaN6Mf0Q8ugVx 6dQg== X-Received: by 10.180.90.240 with SMTP id bz16mr5458282wib.24.1375060514633; Sun, 28 Jul 2013 18:15:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.93.34 with HTTP; Sun, 28 Jul 2013 18:14:34 -0700 (PDT) X-Originating-IP: [54.249.112.206] In-Reply-To: References: <1374573600-2351360719.d37ada5f86@bliksem.vehosting.nl> <201307231220.52817.Daan@vitsch.nl> <51F4F3E9.9010605@bitfrost.no> From: XiaoQI Ge Date: Mon, 29 Jul 2013 09:14:34 +0800 Message-ID: Subject: Re: My WLI-UC-GNM up crash To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmuj4Z4HiD2fcCtV6wlwxsxpr79BYlMto8C2h/tMcf41WhaBn+OUwupOHL8ulMHatWqp5Ua Cc: Hans Petter Selasky , freebsd-arm , freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 01:15:23 -0000 Patch radiotap.diff ifconfig wlan0 normal execution through wifi wpa also be connected to the But often disconnected: Edit /etc/motd to change this login announcement. root@FreeBSD:~ # uptime 11:13PM up 33 secs, 1 user, load averages: 1.34, 0.37, 0.13 root@FreeBSD:~ # date Thu Jul 25 23:13:43 UTC 2013 root@FreeBSD:~ # ifconfig wlan create wlandev run0 wlan0: Ethernet address: 10:6f:3f:2b:fd:7d wlan0 ugen0.2: at usbus0 run0: <1.0> on usbus0 run0: MAC/BBP RT3070 (rev 0x0201), RF RT3020 (MIMO 1T1R), address 10:6f:3f:2b:fd:7d run0: firmware RT2870 ver. 0.236 loaded root@FreeBSD:~ # date Thu Jul 25 23:15:38 UTC 2013 root@FreeBSD:~ # uname -a FreeBSD FreeBSD.7axu.com 10.0-CURRENT FreeBSD 10.0-CURRENT #1 r253662M: Mon Jul 29 16:39:29 CST 2013 root@FreeBSD.7axu.com:/usr/obj/arm.armv6/usr/src/sys/CUBIEBOARD1G arm root@FreeBSD:~ # ugen0.2: at usbus0 (disconnected) run0: at uhub1, port 1, addr 2 (disconnected) root@FreeBSD:~ # ugen0.2: at usbus0 run0: <1.0> on usbus0 run0: MAC/BBP RT3070 (rev 0x0201), RF RT3020 (MIMO 1T1R), address 10:6f:3f:2b:fd:7d ifconfig run0: firmware RT2870 ver. 0.236 loaded run0 down root@FreeBSD:~ # run0: firmware RT2870 ver. 0.236 loaded root@FreeBSD:~ # -- Regards. By: XiaoQI Ge; PGP:8B09D5F7 WWW: https://www.7axu.com/ 2013/7/29 Adrian Chadd : > As long as that results in the radiotap structures being 4 or 8 byte > padded when it's embedded in the softc - then yes, indeed. > > Xiao, can you try? > > > -adrian > > On 28 July 2013 03:35, Hans Petter Selasky wrote: >> Hi, >> >> Can you try the attached patch? >> >> --HPS From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 03:32:31 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C86B1163 for ; Mon, 29 Jul 2013 03:32:31 +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 5D4B028A7 for ; Mon, 29 Jul 2013 03:32:31 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id a12so640128wgh.6 for ; Sun, 28 Jul 2013 20:32:29 -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; bh=4geWeUT1L55OQXyc+X4+pOyPRlmOHU+/TFlctDpvQ/g=; b=sAXdU2sMDaPlO/fr/PRbqk3tDlJl/9PMV1Qxma5EM+PQNhMizVMuZ/nVnZ6a/Gozx6 TZ6vEezPSjQETerLEdIH+Ok6KiKmQSPPhZF/ei4j40pW5uip4myBfPb7OwpvAqf/MP5x peQS+qyLTcYcqBVLgItvfRFdo1+iGeVzU5RFlgb0MwrVOQqkCe/7B5r0GzyeqQ6gTHkK Zi2uShesc6GxzV+0820rInNT5eHxRVazbLVlP5kij0sN8ueqKDpx+RmaIj4FLFvnr68W Sn30Y+Z9OquF5/uwaP4dIqhKnKWY0MvEQKfQf6MoKfMDr6GuAULEPaSvHvfvbCeh4Qv7 OluQ== MIME-Version: 1.0 X-Received: by 10.180.14.105 with SMTP id o9mr5725298wic.30.1375068749520; Sun, 28 Jul 2013 20:32:29 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Sun, 28 Jul 2013 20:32:29 -0700 (PDT) In-Reply-To: References: Date: Sun, 28 Jul 2013 20:32:29 -0700 X-Google-Sender-Auth: FTKqaBINR2Yk11Nn9CaZ1T0k_3Y Message-ID: Subject: Re: [802.11s] mesh_forward() and (re)-encapsulating frames From: Adrian Chadd To: Monthadar Al Jaberi Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 03:32:31 -0000 Hi, * I think we can get away with one queue per mesh STA neighbor for now. Which is effectively what we have in ath(4) and we will have in net80211 soon * THanks for the clarification for mesh sequence number. So we: + Increment it if we're generating a frame into the mesh network; + Keep it the same if we're forwarding a frame to a mesh peer / mesh gate * If we store the mesh control header in the mbuf, and de-encapsulate the frame, then re-inject into the VAP path with the correct destination node, we could then teach the VAP path to check for that tag and if it's there, populate the mesh header from _that_. If it's not there, we create a new mesh tag and continue the encapsulation phase. How's that sound? -adrian From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 04:40:26 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F27F59C3; Mon, 29 Jul 2013 04:40:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3CEE62A86; Mon, 29 Jul 2013 04:40:25 +0000 (UTC) Received: by mail-wi0-f176.google.com with SMTP id f14so600988wiw.3 for ; Sun, 28 Jul 2013 21:40:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=2vvqr2NiFTiqVt1JWq1ncIE+Ne73IcMyTc8GfYbPfCU=; b=s31UZgekWg24oe2aeZgis66RiNL8viJ2N0Vxm5kSiZrdEuoVXsv6tQWNagRFkvLhWW GAwVheChB7Z8GJhiaflscqv3sZuTIJVsG6ftfPZcMrXP45Pk1WRuvuolVi+6U9IOGXOj VRg5NjBpppJCY3508w/TGIhAY6N+Z1OVLVmClwezVfS43hCYA5+4K3TnblAYs/UaTNot J4QGMDXl20cglW6z18EjqZNv0KqR8pWPGJTXcn5gqfjX8fqd799j7qPjLfDbpTa+aT0t cP2/4+BpttpXqRN7w4xZe/iutN14qVput4Xc6w81qlHIChAADnH2F5sQwWAJbH/lTvvz xUBQ== MIME-Version: 1.0 X-Received: by 10.194.11.72 with SMTP id o8mr42571859wjb.0.1375072823509; Sun, 28 Jul 2013 21:40:23 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Sun, 28 Jul 2013 21:40:23 -0700 (PDT) Date: Sun, 28 Jul 2013 21:40:23 -0700 X-Google-Sender-Auth: GXrvc5pnyluPxdyVBexn0hD1whE Message-ID: Subject: [rfc] I'm going to nuke wi(4) (lucent/orinoco wireless PCMCIA devices) in a week's time unless someone steps up to look after it From: Adrian Chadd To: freebsd-wireless@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD Net , freebsd-current X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 04:40:26 -0000 Hi all, I have some reasonably drastic net80211 stack changes planned over the next few months which require some driver work to make happen. The specific big change is to call net80211 for each mbuf transmit completion so it can kick-start the next transmit from a software staging queue. Since this has to happen outside of any driver lock context, it can get a bit hairy. I'm going to do it for the following NICs as I have enough hardware to cover them: * ath (obviously) * iwn * wpi * ipw, if I can find the 2200 series NIC * iwi - same deal, if I can find the hardware * mwl If I can find a bwi and bwn NIC that works enough for basic traffic testing, I'll also do those NICs. There's a reasonably active group of people who (especially using USB wifi NICs) that I plan on enlisting to help me test those drivers. However, I can't test wi - the lucent/orinoco driver. Some changes were made a few years ago that changed the encapsulation frame format from 802.3 to 802.11 and this only seems to work on a very narrow, specific set of NICs and firmware. I have a _big_ collection of wi hardware and _I_ can't get it to work. I started hacking on it in 2011 and quickly realised that although I could likely back out the 802.3 -> 802.11 encapsulation changes so things work with a wider variety of NICs, I don't really want to. So, I'm going to disconnect wi(4) from the build in a week's time and shortly after I'm going to nuke it from the repository. As far as I'm aware no-one has actively used it in a number of years. Now - if someone wants to step up and claim ownership of the driver - then fix it to go _back_ to the 802.3 frame format and then make it work again, I'll be very happy. Sorry. I'd love to claim we still support wi(4) but the truth is that it's been broken since before I became wireless maintainer and it doesn't look like it's ever going to get better. Thanks, -adrian From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 05:40:01 2013 Return-Path: Delivered-To: freebsd-wireless@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C5E04D0 for ; Mon, 29 Jul 2013 05:40:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 999C52C2D for ; Mon, 29 Jul 2013 05:40:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r6T5e1ev083074 for ; Mon, 29 Jul 2013 05:40:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r6T5e1Va083073; Mon, 29 Jul 2013 05:40:01 GMT (envelope-from gnats) Date: Mon, 29 Jul 2013 05:40:01 GMT Message-Id: <201307290540.r6T5e1Va083073@freefall.freebsd.org> To: freebsd-wireless@FreeBSD.org Cc: From: dfilter@FreeBSD.ORG (dfilter service) Subject: Re: kern/164499: commit references a PR X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: dfilter service List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 05:40:01 -0000 The following reply was made to PR kern/164499; it has been noted by GNATS. From: dfilter@FreeBSD.ORG (dfilter service) To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/164499: commit references a PR Date: Mon, 29 Jul 2013 05:39:28 +0000 (UTC) Author: jhibbits Date: Mon Jul 29 05:39:20 2013 New Revision: 253756 URL: http://svnweb.freebsd.org/changeset/base/253756 Log: Use the streaming functions for reading/writing the BAP fields on wi(4). This fixes wi(4) device access on big endian architectures. PR: kern/164499 Reviewed by: adrian Obtained from: NetBSD Modified: head/sys/dev/wi/if_wi.c Modified: head/sys/dev/wi/if_wi.c ============================================================================== --- head/sys/dev/wi/if_wi.c Sun Jul 28 20:11:31 2013 (r253755) +++ head/sys/dev/wi/if_wi.c Mon Jul 29 05:39:20 2013 (r253756) @@ -1905,8 +1905,7 @@ wi_seek_bap(struct wi_softc *sc, int id, static int wi_read_bap(struct wi_softc *sc, int id, int off, void *buf, int buflen) { - u_int16_t *ptr; - int i, error, cnt; + int error, cnt; if (buflen == 0) return 0; @@ -1915,9 +1914,7 @@ wi_read_bap(struct wi_softc *sc, int id, return error; } cnt = (buflen + 1) / 2; - ptr = (u_int16_t *)buf; - for (i = 0; i < cnt; i++) - *ptr++ = CSR_READ_2(sc, WI_DATA0); + CSR_READ_MULTI_STREAM_2(sc, WI_DATA0, (u_int16_t *)buf, cnt); sc->sc_bap_off += cnt * 2; return 0; } @@ -1925,8 +1922,7 @@ wi_read_bap(struct wi_softc *sc, int id, static int wi_write_bap(struct wi_softc *sc, int id, int off, void *buf, int buflen) { - u_int16_t *ptr; - int i, error, cnt; + int error, cnt; if (buflen == 0) return 0; @@ -1936,9 +1932,7 @@ wi_write_bap(struct wi_softc *sc, int id return error; } cnt = (buflen + 1) / 2; - ptr = (u_int16_t *)buf; - for (i = 0; i < cnt; i++) - CSR_WRITE_2(sc, WI_DATA0, ptr[i]); + CSR_WRITE_MULTI_STREAM_2(sc, WI_DATA0, (u_int16_t *)buf, cnt); sc->sc_bap_off += cnt * 2; return 0; _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 05:48:58 2013 Return-Path: Delivered-To: freebsd-wireless@smarthost.ysv.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 0D8FC170; Mon, 29 Jul 2013 05:48:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D5EE12C6B; Mon, 29 Jul 2013 05:48:57 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r6T5mvPe084762; Mon, 29 Jul 2013 05:48:57 GMT (envelope-from jhibbits@freefall.freebsd.org) Received: (from jhibbits@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r6T5mvIB084761; Mon, 29 Jul 2013 05:48:57 GMT (envelope-from jhibbits) Date: Mon, 29 Jul 2013 05:48:57 GMT Message-Id: <201307290548.r6T5mvIB084761@freefall.freebsd.org> To: jrh29@alumni.cwru.edu, jhibbits@FreeBSD.org, freebsd-wireless@FreeBSD.org From: jhibbits@FreeBSD.org Subject: Re: kern/164499: [wi] [patch] if_wi needs fix for big endian architectures. X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 05:48:58 -0000 Synopsis: [wi] [patch] if_wi needs fix for big endian architectures. State-Changed-From-To: open->closed State-Changed-By: jhibbits State-Changed-When: Mon Jul 29 05:47:28 UTC 2013 State-Changed-Why: Patch committed in r253756. http://www.freebsd.org/cgi/query-pr.cgi?pr=164499 From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 09:59:48 2013 Return-Path: Delivered-To: wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CEAB6DD8; Mon, 29 Jul 2013 09:59:48 +0000 (UTC) (envelope-from lars@e-new.0x20.net) Received: from mail.0x20.net (mail.0x20.net [IPv6:2001:aa8:fffb:1::3]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F92F2ABA; Mon, 29 Jul 2013 09:59:48 +0000 (UTC) Received: from e-new.0x20.net (mail.0x20.net [IPv6:2001:aa8:fffb:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.0x20.net (Postfix) with ESMTPS id 3D7B56A6000; Mon, 29 Jul 2013 11:59:47 +0200 (CEST) Received: from e-new.0x20.net (localhost [127.0.0.1]) by e-new.0x20.net (8.14.7/8.14.7) with ESMTP id r6T9xkOg047722; Mon, 29 Jul 2013 11:59:46 +0200 (CEST) (envelope-from lars@e-new.0x20.net) Received: (from lars@localhost) by e-new.0x20.net (8.14.7/8.14.7/Submit) id r6T9xk8L047462; Mon, 29 Jul 2013 11:59:46 +0200 (CEST) (envelope-from lars) Date: Mon, 29 Jul 2013 11:59:46 +0200 From: Lars Engels To: =?utf-8?Q?Jean-S=C3=A9bastien_P=C3=A9dron?= Subject: Re: 802.1X: dhclient started before the auth. process ends Message-ID: <20130729095946.GK59101@e-new.0x20.net> References: <51F26CEB.9010200@dumbbell.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SC08udwvC/+on638" Content-Disposition: inline In-Reply-To: <51F26CEB.9010200@dumbbell.fr> X-Editor: VIM - Vi IMproved 7.3 X-Operation-System: FreeBSD 8.4-RELEASE User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@freebsd.org, wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 09:59:48 -0000 --SC08udwvC/+on638 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 26, 2013 at 02:34:51PM +0200, Jean-S=C3=A9bastien P=C3=A9dron w= rote: > Hi! >=20 > At $WORK, we use 802.1X to authenticate computers on the network. > Authenticated computers receive a lease in the 192.168.X.X/24 network. > Unauthenticated ones receive a lease in the 172.16.X.X/24 network. >=20 > Today, I upgraded one computer running 10-CURRENT to latest HEAD and it > seems that the interface is brought up to early now: dhclient is started > before wpa_supplicant finishes. This was working perfectly before the > upgrade. >=20 > I don't have logs of the working case, but here are the logs of the > non-working one: > http://pastebin.com/ZHcbHLQZ >=20 > Was I lucky with wpa_supplicant/dhclient timing? Or is there a real > issue here? >=20 CC'ed wireless@, that's probably the proper list for the issue. --SC08udwvC/+on638 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlH2PRIACgkQKc512sD3afin7QCfXPXwyiLZ08XARpCtf7/LpQSG SNQAoJoMbOY8gX4JvQ4ZdFklt7RIrjUs =enpl -----END PGP SIGNATURE----- --SC08udwvC/+on638-- From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 10:24:05 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4CA0F4B9; Mon, 29 Jul 2013 10:24:05 +0000 (UTC) (envelope-from monthadar@gmail.com) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B0F8D2BCA; Mon, 29 Jul 2013 10:24:04 +0000 (UTC) Received: by mail-wi0-f177.google.com with SMTP id hq12so2197234wib.4 for ; Mon, 29 Jul 2013 03:24:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=sMYvmg/kVaoRLepsjmxgZZPRwbyoMirtQyu0+0TqfK0=; b=ksEyGDNa354m7N7Imj5RfIT8aUtUBdARqPXrH1NL0d6QEMofOiz0luowARPBeP6M7g fxJQVSCX3hfcx54M018BvdAgiVtQirWf+qbw5AUl7jRI8h9EnA4cPHYME0Oa5x6mVtnO EPtpiEK0eY+mE7SvWZp8/v7GaKQEssK+lc7GVrkKVJNliBJcEuRJlzQI8yB8mEpWdxQI RKbEhThvrHdMOKQEBt7oiDf1hGKWdytAkdYR1JlSfUfqs/qp8hnAz8itqma7jS2Tc5ZK bh5AamvaH1rSiiW85KF9PJlfpJnqS3iNFUGfTdoi5f/sBG11lLGSmler/i8lzVi5cRba BY1A== MIME-Version: 1.0 X-Received: by 10.194.77.99 with SMTP id r3mr42708473wjw.5.1375093442950; Mon, 29 Jul 2013 03:24:02 -0700 (PDT) Received: by 10.227.212.133 with HTTP; Mon, 29 Jul 2013 03:24:02 -0700 (PDT) In-Reply-To: References: Date: Mon, 29 Jul 2013 12:24:02 +0200 Message-ID: Subject: Re: [802.11s] mesh_forward() and (re)-encapsulating frames From: Monthadar Al Jaberi To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 10:24:05 -0000 On Mon, Jul 29, 2013 at 5:32 AM, Adrian Chadd wrote: > Hi, > > * I think we can get away with one queue per mesh STA neighbor for > now. Which is effectively what we have in ath(4) and we will have in > net80211 soon Yupp, the 80211 queue per meshSTA neighbour part is important if we want to queue in net80211, and that what Linux have. > * THanks for the clarification for mesh sequence number. So we: > + Increment it if we're generating a frame into the mesh network; > + Keep it the same if we're forwarding a frame to a mesh peer / mesh gate Correct. > * If we store the mesh control header in the mbuf, and de-encapsulate > the frame, then re-inject into the VAP path with the correct > destination node, we could then teach the VAP path to check for that > tag and if it's there, populate the mesh header from _that_. If it's > not there, we create a new mesh tag and continue the encapsulation > phase. > > How's that sound? Sounds music to my ears =) Let's go for it! > > > > -adrian -- Monthadar Al Jaberi From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 10:30:24 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9CA776BC for ; Mon, 29 Jul 2013 10:30:24 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [IPv6:2001:41d0:8:dda6::1]) by mx1.freebsd.org (Postfix) with ESMTP id 0A7452C08 for ; Mon, 29 Jul 2013 10:30:24 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id 90BC1582 for ; Mon, 29 Jul 2013 12:30:22 +0200 (CEST) From: "Cedric GROSS" To: References: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> In-Reply-To: Subject: RE: [IWN] Reviw split 2 Date: Mon, 29 Jul 2013 12:30:19 +0200 Message-ID: <002d01ce8c46$a13b23d0$e3b16b70$@info> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_002E_01CE8C57.64C3F3D0" X-Mailer: Microsoft Office Outlook 12.0 thread-index: Ac6LyDgG2hgfJsOMQLmkQHUb7ezmygAffZ9Q Content-Language: fr X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 10:30:24 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_002E_01CE8C57.64C3F3D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > -----Message d'origine----- > De=A0: owner-freebsd-wireless@freebsd.org [mailto:owner-freebsd- > wireless@freebsd.org] De la part de Adrian Chadd > Envoy=E9=A0: dimanche 28 juillet 2013 21:25 > =C0=A0: Cedric GROSS > Cc=A0: freebsd-wireless@freebsd.org > Objet=A0: Re: [IWN] Reviw split 2 >=20 > Hi! >=20 > Feedback time! >=20 > - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s done\n", __func__); > + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__); > + >=20 > .. all that did was delete a space and add a new line. Just add the > space back in there, delete the new line; then that part of the diff > will disappear. Replace also "done" by "end" to be coherent with other trace >=20 > - if (!(sc->sc_flags & IWN_FLAG_HAS_11N)) { > + if (!(sc->sc_flags & IWN_FLAG_HAS_11N)){ >=20 > Again, you've just deleted a space. You don't need to do that. :-) = Just > put the space back in, that part of the diff will disappear. >=20 > - break; > +#endif > + break; >=20 > .. the #endif is fine, but you reformatted the "break" line. tsk. >=20 > There's another break, and another DPRINTF that you did that to. Ok >=20 > Then in the include file: >=20 > -#define IWN_INT 0x008 > +#define IWN_INT 0x008 > #define IWN_INT_MASK 0x00c > -#define IWN_FH_INT 0x010 > -#define IWN_RESET 0x020 >=20 > +#define IWN_FH_INT 0x010 > +#define IWN_GPIO_IN 0x018 /* read external chip > pins */ > +#define IWN_RESET 0x020 > #define IWN_GP_CNTRL 0x024 > -#define IWN_HW_REV 0x028 > -#define IWN_EEPROM 0x02c > +#define IWN_HW_REV 0x028 > +#define IWN_EEPROM 0x02c >=20 > .. most of those are just tab spaces. You can eliminate those, and all > you'd be adding in is the GPIO_IN line. >=20 I like to see align values but anyway. >=20 > Here's my .vimrc file. It includes colour marking for tabs/spaces, > indenting, and lines longer than 78 characters. Thank Bernhard for it. > It's great for inspecting code and diffs for things like whitespace > changes, trailing whitespace at the end of a line, tabs which should = be > spaces (and vice versa), etc. >=20 > adrian@lucy:~]> cat ~/.vimrc > " LCD-friendly! > :set bg=3Ddark >=20 > " Do general syntax highlighting > :syntax enable >=20 > " Highlight tab characters as >. (with . being tab spaces) " Highlight > extra spaces (ie, before the end of line) with "C" > :set list > :set listchars=3Dtab:>.,trail:C >=20 > :highlight NearLength ctermbg=3Dmagenta ctermfg=3Dwhite = guibg=3D#592959 > :highlight OverLength ctermbg=3Dred ctermfg=3Dwhite guibg=3D#592929 " = Match > characters after position 78; set highlight to be magenta " Second > match characters after position 80; set highlight to be red :match > NearLength /\%78v.\+/ :2match OverLength /\%81v.\+/ >=20 > " Enable auto-indenting > :set ai >=20 Thanks :) > On 27 July 2013 09:09, Cedric GROSS wrote: > > Hello, > > > > > > > > A new patch. > > > > > > > > This one add : > > > > - a debugging function printing uCode registery. > > > > - IWN_DEBUG make option > > > > > > > > A review has be done also which can safely undefined IWN_DEBUG. > > Previously do so lead to compile error. > > > > > > > > Cedric > > Joined, corrected patch. Cedric ------=_NextPart_000_002E_01CE8C57.64C3F3D0 Content-Type: application/octet-stream; name="register2.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="register2.patch" Index: sys/dev/iwn/if_iwn.c=0A= =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=0A= --- sys/dev/iwn/if_iwn.c (revision 253764)=0A= +++ sys/dev/iwn/if_iwn.c (working copy)=0A= @@ -160,7 +160,9 @@=0A= static int iwn_read_eeprom(struct iwn_softc *,=0A= uint8_t macaddr[IEEE80211_ADDR_LEN]);=0A= static void iwn4965_read_eeprom(struct iwn_softc *);=0A= +#ifdef IWN_DEBUG=0A= static void iwn4965_print_power_group(struct iwn_softc *, int);=0A= +#endif=0A= static void iwn5000_read_eeprom(struct iwn_softc *);=0A= static uint32_t iwn_eeprom_channel_flags(struct iwn_eeprom_chan *);=0A= static void iwn_read_eeprom_band(struct iwn_softc *, int);=0A= @@ -320,9 +322,12 @@=0A= static void iwn_scan_curchan(struct ieee80211_scan_state *, unsigned = long);=0A= static void iwn_scan_mindwell(struct ieee80211_scan_state *);=0A= static void iwn_hw_reset(void *, int);=0A= +#ifdef IWN_DEBUG=0A= +static char *iwn_get_csr_string(int);=0A= +static void iwn_debug_register(struct iwn_softc *);=0A= +#endif=0A= =0A= -#define IWN_DEBUG=0A= -#ifdef IWN_DEBUG=0A= +#ifdef IWN_DEBUG=0A= enum {=0A= IWN_DEBUG_XMIT =3D 0x00000001, /* basic xmit operation */=0A= IWN_DEBUG_RECV =3D 0x00000002, /* basic recv operation */=0A= @@ -339,6 +344,7 @@=0A= IWN_DEBUG_CMD =3D 0x00001000, /* cmd submission */=0A= IWN_DEBUG_TXRATE =3D 0x00002000, /* TX rate debugging */=0A= IWN_DEBUG_PWRSAVE =3D 0x00004000, /* Power save operations */=0A= + IWN_DEBUG_REGISTER =3D 0x20000000, /* print chipset register */=0A= IWN_DEBUG_TRACE =3D 0x40000000, /* Print begin and start driver = function */=0A= IWN_DEBUG_FATAL =3D 0x80000000, /* fatal errors */=0A= IWN_DEBUG_ANY =3D 0xffffffff=0A= @@ -924,6 +930,8 @@=0A= struct ieee80211com *ic;=0A= int qid;=0A= =0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= +=0A= if (ifp !=3D NULL) {=0A= ic =3D ifp->if_l2com;=0A= =0A= @@ -961,7 +969,7 @@=0A= if (ifp !=3D NULL)=0A= if_free(ifp);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s done\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n", __func__);=0A= IWN_LOCK_DESTROY(sc);=0A= return 0;=0A= }=0A= @@ -3202,8 +3210,6 @@=0A= }=0A= case IWN_STATE_CHANGED:=0A= {=0A= - uint32_t *status =3D (uint32_t *)(desc + 1);=0A= -=0A= /*=0A= * State change allows hardware switch change to be=0A= * noted. However, we handle this in iwn_intr as we=0A= @@ -3211,32 +3217,37 @@=0A= */=0A= bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= BUS_DMASYNC_POSTREAD);=0A= +#ifdef IWN_DEBUG=0A= + uint32_t *status =3D (uint32_t *)(desc + 1);=0A= DPRINTF(sc, IWN_DEBUG_INTR, "state changed to %x\n",=0A= le32toh(*status));=0A= +#endif=0A= break;=0A= }=0A= case IWN_START_SCAN:=0A= {=0A= + bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= + BUS_DMASYNC_POSTREAD);=0A= +#ifdef IWN_DEBUG=0A= struct iwn_start_scan *scan =3D=0A= (struct iwn_start_scan *)(desc + 1);=0A= -=0A= - bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= - BUS_DMASYNC_POSTREAD);=0A= - DPRINTF(sc, IWN_DEBUG_ANY,=0A= + DPRINTF(sc, IWN_DEBUG_ANY,=0A= "%s: scanning channel %d status %x\n",=0A= __func__, scan->chan, le32toh(scan->status));=0A= +#endif=0A= break;=0A= }=0A= case IWN_STOP_SCAN:=0A= {=0A= + bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= + BUS_DMASYNC_POSTREAD);=0A= +#ifdef IWN_DEBUG=0A= struct iwn_stop_scan *scan =3D=0A= (struct iwn_stop_scan *)(desc + 1);=0A= -=0A= - bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= - BUS_DMASYNC_POSTREAD);=0A= DPRINTF(sc, IWN_DEBUG_STATE,=0A= "scan finished nchan=3D%d status=3D%d chan=3D%d\n",=0A= scan->nchan, scan->status, scan->chan);=0A= +#endif=0A= =0A= IWN_UNLOCK(sc);=0A= ieee80211_scan_next(vap);=0A= @@ -3416,6 +3427,9 @@=0A= if (r1 & (IWN_INT_SW_ERR | IWN_INT_HW_ERR)) {=0A= device_printf(sc->sc_dev, "%s: fatal firmware error\n",=0A= __func__);=0A= +#ifdef IWN_DEBUG=0A= + iwn_debug_register(sc);=0A= +#endif=0A= /* Dump firmware error log and stop. */=0A= iwn_fatal_intr(sc);=0A= ifp->if_flags &=3D ~IFF_UP;=0A= @@ -7467,3 +7481,85 @@=0A= iwn_init(sc);=0A= ieee80211_notify_radio(ic, 1);=0A= }=0A= +#ifdef IWN_DEBUG=0A= +#define IWN_DESC(x) case x: return #x=0A= +#define COUNTOF(array) (sizeof(array) / sizeof(array[0]))=0A= +=0A= +/*=0A= + * Transate CSR code to string=0A= + */=0A= +static char *iwn_get_csr_string(int csr)=0A= +{=0A= + switch (csr) {=0A= + IWN_DESC(IWN_HW_IF_CONFIG);=0A= + IWN_DESC(IWN_INT_COALESCING);=0A= + IWN_DESC(IWN_INT);=0A= + IWN_DESC(IWN_INT_MASK);=0A= + IWN_DESC(IWN_FH_INT);=0A= + IWN_DESC(IWN_GPIO_IN);=0A= + IWN_DESC(IWN_RESET);=0A= + IWN_DESC(IWN_GP_CNTRL);=0A= + IWN_DESC(IWN_HW_REV);=0A= + IWN_DESC(IWN_EEPROM);=0A= + IWN_DESC(IWN_EEPROM_GP);=0A= + IWN_DESC(IWN_OTP_GP);=0A= + IWN_DESC(IWN_GIO);=0A= + IWN_DESC(IWN_GP_UCODE);=0A= + IWN_DESC(IWN_GP_DRIVER);=0A= + IWN_DESC(IWN_UCODE_GP1);=0A= + IWN_DESC(IWN_UCODE_GP2);=0A= + IWN_DESC(IWN_LED);=0A= + IWN_DESC(IWN_DRAM_INT_TBL);=0A= + IWN_DESC(IWN_GIO_CHICKEN);=0A= + IWN_DESC(IWN_ANA_PLL);=0A= + IWN_DESC(IWN_HW_REV_WA);=0A= + IWN_DESC(IWN_DBG_HPET_MEM);=0A= + default:=0A= + return "UNKNOWN CSR";=0A= + }=0A= +}=0A= +=0A= +/*=0A= + * This function print firmawre register=0A= + */=0A= +static void=0A= +iwn_debug_register(struct iwn_softc *sc)=0A= +{=0A= + int i;=0A= + static const uint32_t csr_tbl[] =3D {=0A= + IWN_HW_IF_CONFIG,=0A= + IWN_INT_COALESCING,=0A= + IWN_INT,=0A= + IWN_INT_MASK,=0A= + IWN_FH_INT,=0A= + IWN_GPIO_IN,=0A= + IWN_RESET,=0A= + IWN_GP_CNTRL,=0A= + IWN_HW_REV,=0A= + IWN_EEPROM,=0A= + IWN_EEPROM_GP,=0A= + IWN_OTP_GP,=0A= + IWN_GIO,=0A= + IWN_GP_UCODE,=0A= + IWN_GP_DRIVER,=0A= + IWN_UCODE_GP1,=0A= + IWN_UCODE_GP2,=0A= + IWN_LED,=0A= + IWN_DRAM_INT_TBL,=0A= + IWN_GIO_CHICKEN,=0A= + IWN_ANA_PLL,=0A= + IWN_HW_REV_WA,=0A= + IWN_DBG_HPET_MEM,=0A= + };=0A= + DPRINTF(sc, IWN_DEBUG_REGISTER,=0A= + "CSR values: (2nd byte of IWN_INT_COALESCING is = IWN_INT_PERIODIC)%s",=0A= + "\n");=0A= + for (i =3D 0; i < COUNTOF(csr_tbl); i++){=0A= + DPRINTF(sc, IWN_DEBUG_REGISTER," %10s: 0x%08x ",=0A= + iwn_get_csr_string(csr_tbl[i]), IWN_READ(sc, csr_tbl[i]));=0A= + if ((i+1) % 3 =3D=3D 0)=0A= + DPRINTF(sc, IWN_DEBUG_REGISTER,"%s","\n");=0A= + }=0A= + DPRINTF(sc, IWN_DEBUG_REGISTER,"%s","\n");=0A= +}=0A= +#endif=0A= Index: sys/dev/iwn/if_iwnreg.h=0A= =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=0A= --- sys/dev/iwn/if_iwnreg.h (revision 253764)=0A= +++ sys/dev/iwn/if_iwnreg.h (working copy)=0A= @@ -62,6 +62,7 @@=0A= #define IWN_INT 0x008=0A= #define IWN_INT_MASK 0x00c=0A= #define IWN_FH_INT 0x010=0A= +#define IWN_GPIO_IN 0x018 /* read external chip pins */=0A= #define IWN_RESET 0x020=0A= #define IWN_GP_CNTRL 0x024=0A= #define IWN_HW_REV 0x028=0A= @@ -69,8 +70,12 @@=0A= #define IWN_EEPROM_GP 0x030=0A= #define IWN_OTP_GP 0x034=0A= #define IWN_GIO 0x03c=0A= +#define IWN_GP_UCODE 0x048=0A= #define IWN_GP_DRIVER 0x050=0A= +#define IWN_UCODE_GP1 0x054=0A= +#define IWN_UCODE_GP1_SET 0x058=0A= #define IWN_UCODE_GP1_CLR 0x05c=0A= +#define IWN_UCODE_GP2 0x060=0A= #define IWN_LED 0x094=0A= #define IWN_DRAM_INT_TBL 0x0a0=0A= #define IWN_SHADOW_REG_CTRL 0x0a8=0A= @@ -79,6 +84,7 @@=0A= #define IWN_HW_REV_WA 0x22c=0A= #define IWN_DBG_HPET_MEM 0x240=0A= #define IWN_DBG_LINK_PWR_MGMT 0x250=0A= +/* Need nic_lock for use above */=0A= #define IWN_MEM_RADDR 0x40c=0A= #define IWN_MEM_WADDR 0x410=0A= #define IWN_MEM_WDATA 0x418=0A= Index: sys/modules/iwn/Makefile=0A= =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=0A= --- sys/modules/iwn/Makefile (revision 253764)=0A= +++ sys/modules/iwn/Makefile (working copy)=0A= @@ -5,4 +5,12 @@=0A= KMOD =3D if_iwn=0A= SRCS =3D if_iwn.c device_if.h bus_if.h pci_if.h=0A= =0A= +.if !defined(KERNBUILDDIR)=0A= +opt_wlan.h:=0A= + echo "#define IEEE80211_DEBUG 1" > ${.TARGET}=0A= +.endif=0A= +.if IWN_DEBUG=0A= +CFLAGS+=3D-DIWN_DEBUG=0A= +.endif=0A= +=0A= .include =0A= ------=_NextPart_000_002E_01CE8C57.64C3F3D0-- From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 11:06:55 2013 Return-Path: Delivered-To: freebsd-wireless@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3654C21E for ; Mon, 29 Jul 2013 11:06:55 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 137A92DEC for ; Mon, 29 Jul 2013 11:06:55 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r6TB6shu061971 for ; Mon, 29 Jul 2013 11:06:54 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r6TB6s1b061969 for freebsd-wireless@FreeBSD.org; Mon, 29 Jul 2013 11:06:54 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 29 Jul 2013 11:06:54 GMT Message-Id: <201307291106.r6TB6s1b061969@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-wireless@FreeBSD.org Subject: Current problem reports assigned to freebsd-wireless@FreeBSD.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 11:06:55 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/180816 wireless [iwl] Intel Centrino Wireless-N 2200 not supported o kern/179847 wireless [ath] [patch] Update regdomain in ath drivers includin o kern/179709 wireless [ath] Atheros 5212 does not work: stuck beacon; resett o kern/179547 wireless [ath] Add AR9485 custom board fixes (CUS198) o kern/179482 wireless [ath] [patch] Fix AR9462 external LNA configuration o kern/179269 wireless [ath] [AR9285] RX antenna diversity is not functioning o kern/179232 wireless [ath] panic in ath o kern/178986 wireless [ath] Change mac address of ath(4) is not reflected wh o kern/178492 wireless [ath] ath0 (AR9287) panic o kern/178491 wireless [ath] ath0 (AR9287) stuck beacon o kern/178477 wireless [ath] missed beacon / soft reset in STA mode results i o kern/178470 wireless [panic][ath] bss vap can and does change o kern/178411 wireless [ral] [panic] FreeBSD kernel crash in rt2860 o kern/178379 wireless [net80211] [ath] WPA rekey on the STA side fails when o kern/178378 wireless [net80211] crypto state isn't reset during a reassocia o kern/178263 wireless [ath] review the use of ic_freq / ic_ieee / ic_flags / o kern/177847 wireless [ath] With TPC enabled, TX power values aren't clamped o kern/177846 wireless [ath] [net80211] net80211 TX power limit isn't correct o conf/177688 wireless WiFi regodmains information is inconsistent between "e o kern/177530 wireless [ath] ath driver isn't 32 bit int clean o kern/177465 wireless [iwn] 20%-100% packet loss with iwn driver o kern/177451 wireless [ieee80211] page fault in ieee80211_tx_mgt_timeout o kern/176238 wireless [ath] [patch] Correct buffer size calculation and simp o kern/176201 wireless [net80211] [patch] 11n station includes unrelated ht p o kern/176104 wireless [iwn] iwn0: iwn_intr: fatal firmware error o kern/175722 wireless [ath]lot of bad seriesx hwrate in kernel messages o kern/175446 wireless [ath] high volumes of PHY errors lead to BB/MAC hangs o kern/175227 wireless [ath] beacon timers aren't necessarily reprogrammed af o kern/175183 wireless [iwn] iwn(4) becomes unresponsive during initial confi o kern/175053 wireless [iwn] iwn firmware error on 9-stable with Ultimate-N 6 o kern/174891 wireless [ieee80211] struct ieee80211_node is freed during acti o kern/174722 wireless [wlan] can't use channel 12 and 13 (14) with my wifi i o kern/174661 wireless [wlan] lost alias on wlan interface o kern/174283 wireless [net80211] panics in ieee80211_ff_age() and ieee80211_ o kern/174276 wireless [ath] if_ath memory modified after free o kern/174273 wireless [net80211] taking down a net80211 node with active fas o kern/173917 wireless [iwn] wpa-supplicant issues on iwn o kern/173898 wireless [iwn] [patch] iwn(4) DOES support 6235 chip. o kern/173883 wireless [ath] ath0: unable to attach - pci issue? o kern/173711 wireless [ath] powerd kills ath on the Asus EeePC 1005HA o kern/173342 wireless PS-Poll isn't working o kern/173336 wireless [ath] Atheros card improper device poweroff handling o o kern/172955 wireless [ath] 11n does not work in adhoc mode o kern/172706 wireless [wpi] wpi0 fails to load firmware when using country o kern/172672 wireless [ubt] Bluetooth device recognised but not working o kern/172661 wireless hostapd(8) securing wireless adapter in HostAP mode is o kern/172338 wireless [ath] [net80211] CCMP IV transmit counters are not cor o kern/171598 wireless [ath] TP-Link TL-WN951N W-LAN PCI Adapter 300 MBit stu o kern/171235 wireless [ath] ath loses connection, system freezes on netif re o kern/170889 wireless [ath] ath driver uses some uninitilized memory o kern/170620 wireless [ath] LOR and deadlock when multiple vaps are used o kern/170573 wireless [iwi] Intel 2200BG iwi NIC hangs with need multicast c o kern/170513 wireless [ath] ath logs: ath_tx_aggr_comp_aggr: AR5416 bug: o kern/170433 wireless [ath] TX hang after a stuck beacon message with active o kern/170397 wireless [ath] [patch] Uninitialized variables in ah_eeprom_928 o kern/170302 wireless [ath] 802.11n frames are not being transmitted with mu o kern/170281 wireless [ath] 802.11n locks up on aggregation setup (ampdutx) o kern/170098 wireless [ath] [net80211] VAPs (Virtual access points) with Ath o kern/170066 wireless [ral] ral(4) rt61pci Linksys freezes the machine as so o kern/169432 wireless [ath] BAR TX hang when aggregation session is reset du p kern/169362 wireless [ath] AR5416: radar pulse PHY errors sometimes include o kern/169336 wireless [ath] ANI isn't triggering in a busy/noisy environment o kern/169199 wireless [ath] Cannot set up static ip addresses for wireless w o kern/169084 wireless [ath] suspend/resume doesn't cause a rescan; the assoc o kern/168530 wireless [ath] Broken WEP probably o kern/168393 wireless AR9285: suspend/resume sometimes fails o kern/168170 wireless [net80211] ieee80211_send_bar() doesn't complete corre o kern/167870 wireless [ath] adhoc wifi client does not join an existing IBSS o kern/167834 wireless [ath] kickpcu; 'handled 0 packets' o kern/167828 wireless [iwn] iwn(4) doesn't recover automatically after firmw o kern/167798 wireless ifconfig(8): problem with "ifconfig list scan" command o kern/167491 wireless [ath] TID != hardware queue TID in ath_tx_aggr_comp_ag o kern/167113 wireless [ath] AR5210: "stuck" TX seems to be occuring, without o kern/167080 wireless [ath] channel switch on another VAP break channel setu o kern/166684 wireless [ath] [net80211] mgmtrate/mcastrate isn't updated base p kern/166642 wireless [ieee80211] [patch] in 802.11n mode for FreeBSD AP, ha o kern/166641 wireless [ieee80211] [patch] mbuf/cluster leak in AP mode in 80 p kern/166357 wireless [ath] 802.11n TX stall when the first frame in the BAW o kern/166286 wireless [net80211] [ath] initial switch to HT40 isn't causing p kern/166190 wireless [ath] TX hangs and frames stuck in TX queue o kern/166086 wireless [Patch][ath] Reflect state of rfkill switch in a sysct o kern/165969 wireless [ath] Slower performance in adhoc mode vs Client/AP mo o kern/165966 wireless [ath] ath0: device timeout on SMP machines due to race o kern/165895 wireless [ath] overly busy cabq can tie up all tx buffers o kern/165870 wireless [bwn] bwn driver does not attach on HP Pavilion dv9420 o kern/165866 wireless [ath] TX hangs, requiring a "scan" to properly reset t o kern/165849 wireless [ath] [hang] network ath driver freeze o kern/165595 wireless [ipw] ipw(4): Can't load firmare for ipw2200bg o kern/165543 wireless [ath] ath0 endless scanning of channels without connec o kern/165517 wireless [net80211] bgscan isn't triggered when invalid beacons o kern/165475 wireless [ath] operational mode change doesn't poke the underly o kern/165382 wireless [kernel] taskqueue_unblock doesn't unblock currently q o kern/165306 wireless [ath] race conditions between scanning and beacon time o kern/165220 wireless [ath] "ath_rx_tasklet: sc_inreset_cnt > 0; skipping" m o kern/165214 wireless [ieee80211] Kernel panic in ieee80211_output.c:2505 o kern/165212 wireless [ath] No WiFi on Acer Aspire One 751h (Atheros AR5BHB6 o kern/165149 wireless [ath] [net80211] Ping with data length more than iv_fr o kern/165146 wireless [net80211] Net802.11 Fragment number is assigned 1 (sh o kern/165060 wireless [ath] vap->iv_bss race conditions causing crashes insi o kern/165021 wireless [ath] ath device timeout during scan/attach, if wlan_c o kern/164721 wireless [ath] ath device timeouts o kern/164382 wireless [ath] crash when down/deleting a vap - inside ieee8021 o kern/164365 wireless [iwi] iwi0: UP/DOWN in o bin/164102 wireless hostapd not configured for 802.11n o kern/163759 wireless [ath] ath(4) "stops working" in hostap mode o kern/163724 wireless [mwl] [patch] NULL check before dereference o kern/163719 wireless [ath] ath interface do not receive multicast o kern/163689 wireless [ath] TX timeouts when sending probe/mgmt frames durin o kern/163574 wireless [net80211] overly-frequent HT occupancy changes o kern/163573 wireless [ath] hostap mode TX buffer hang o kern/163559 wireless [ath] kernel panic AH_DEBUG o kern/163318 wireless [ath] ath(4) stops working p kern/163312 wireless [panic] [ath driver] kernel panic: page fault with ath o kern/163237 wireless [ath] AR5416 as HostAP. Delays among clients when a cl o kern/163082 wireless [ath] ar9285 diversity fixes o kern/162648 wireless [ath] AR9227 ADC DC calibration failure o kern/162647 wireless [ath] 11n TX aggregation session / TX hang o kern/161293 wireless [iwn] hang at startup when starting network o kern/161035 wireless [ieee80211] Incorrect number describing 11ng MCS rate o kern/160391 wireless [ieee80211] [patch] Panic in mesh mode o kern/160296 wireless [zyd] [panic] 802.11 usb device reboots system on 'ifc o misc/160176 wireless [mips] [panic] Kernel panic on AR7161 platform with AR o kern/157449 wireless [ath] MAC address conflict causes system to freeze o kern/157243 wireless [ath] investigate beacon TX (AP) / RX (STA) when under o kern/156904 wireless [ath] AR9285 antenna diversity algorithm is buggy and o kern/156884 wireless [ath] ath instablity o kern/156327 wireless [bwn] bwn driver causes 20%-50% packet loss o kern/156322 wireless [wpi] no ahdemo support for if_wpi o kern/156321 wireless [ath] ahdemo doesn't work with if_ath o kern/155498 wireless [ral] ral(4) needs to be resynced with OpenBSD's to ga o kern/155100 wireless [ath] ath driver on busy channel: "stuck beacon" p kern/154598 wireless [ath] Atheros 5424/2424 can't connect to WPA network o kern/154567 wireless [ath] ath(4) lot of bad series(0) o kern/154327 wireless [ath] AR5416 in station mode hangs when transmitting f o kern/154284 wireless [ath] Modern ath wifi cards (such as AR9285) have miss o kern/154153 wireless [ath] AR5213 + MIPS + WPA group key packet corruption o kern/153594 wireless [wlan] netif/devd race o kern/153448 wireless [ath] ath networking device loses association after a o kern/152750 wireless [ath] ath0 lot of bad series hwrate o kern/151198 wireless [ath] ath/5416 fails bgscan with "ath0: ath_chan_set: o kern/149786 wireless [bwn] bwn on Dell Inspiron 1150: connections stall o kern/149516 wireless [ath] ath(4) hostap with fake MAC/BSSID results in sta o kern/149373 wireless [realtek/atheros]: None of my network card working o kern/148322 wireless [ath] Triggering atheros wifi beacon misses in hostap o kern/148317 wireless [ath] FreeBSD 7.x hostap memory leak in net80211 or At o kern/148078 wireless [ath] wireless networking stops functioning o kern/146426 wireless [mwl] 802.11n rates not possible on mwl o kern/146425 wireless [mwl] mwl dropping all packets during and after high u o kern/145826 wireless [panic] [ath] Unable to configure adhoc mode on ath0/w o kern/144987 wireless [wpi] [panic] injecting packets with wlaninject using o kern/144755 wireless [wlan] netif/devd race o bin/144109 wireless hostapd(8) uses the MAC of the wireless interface, but o conf/143079 wireless hostapd(8) startup missing multi wlan functionality p kern/140567 wireless [ath] [patch] ath is not worked on my notebook PC o kern/140245 wireless [ath] [panic] Kernel panic during network activity on o kern/137592 wireless [ath] panic - 7-STABLE (Aug 7, 2009 UTC) crashes on ne o kern/136943 wireless [wpi] [lor] wpi0_com_lock / wpi0 o kern/136836 wireless [ath] atheros card stops functioning after about 12 ho o kern/132722 wireless [ath] Wifi ath0 associates fine with AP, but DHCP or I o bin/131549 wireless ifconfig(8) can't clear 'monitor' mode on the wireless o kern/126475 wireless [ath] [panic] ath pcmcia card inevitably panics under o kern/125721 wireless [ath] Terrible throughput/high ping latency with Ubiqu o kern/125617 wireless [ath] [panic] ath(4) related panic o kern/125501 wireless [ath] atheros cardbus driver hangs o kern/125332 wireless [ath] [panic] crash under any non-tiny networking unde o kern/124767 wireless [iwi] Wireless connection using iwi0 driver (Intel 220 o kern/124753 wireless [ieee80211] net80211 discards power-save queue packets o kern/121061 wireless [ath] [panic] panic while ejecting ath(4)-adapter duri o docs/120456 wireless ath(4) needs to specify requirement on wlan_scan_sta o kern/119513 wireless [ath] [irq] inserting dlink dwl-g630 wireless card res o kern/116747 wireless [ndis] FreeBSD 7.0-CURRENT crash with Dell TrueMobile f kern/105348 wireless [ath] ath device stopps TX 172 problems total. From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 13:11:17 2013 Return-Path: Delivered-To: freebsd-wireless@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 3406564F for ; Mon, 29 Jul 2013 13:11:17 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-x22e.google.com (mail-we0-x22e.google.com [IPv6:2a00:1450:400c:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BC3EB256F for ; Mon, 29 Jul 2013 13:11:16 +0000 (UTC) Received: by mail-we0-f174.google.com with SMTP id q54so3873363wes.5 for ; Mon, 29 Jul 2013 06:11:15 -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; bh=Yn8JyojCDo3y9tsMUbAM9XZk4srIP+ztYUe3ZlBSpMs=; b=L1yWgbT4FIprUSHJKMdo62dptuYCqkX1BKRs1XPLwzVyNDv48ctLLT1Jc6ZkwNirzo 9NU3bdf+KRoV2uKd0Da3VgbRSCUCx6mEU3N/AETagWkZ6fXLYCfxXnbcAqRT0n3IKo4s +uQESB5aK3iA1rXFJGGbaBCHslmJcRZDGkZSYK8rOiUjSNWx4LnNwncF62zOIPHHXZ5C ABJD4xYZwsUuOQ2uARW76GHP5LanCi6hOG8Rk0V2g7bN4BYyoPoqJ/Wdt0xr8Gt1pzyG 6wQ3Hj3BItc+K1DQuJMpVlf/ilwX9ACCjEtlLjFJRsZ9nThIX376wtU22o08JbWbNZMv O75w== MIME-Version: 1.0 X-Received: by 10.180.39.212 with SMTP id r20mr7194233wik.30.1375103474996; Mon, 29 Jul 2013 06:11:14 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Mon, 29 Jul 2013 06:11:14 -0700 (PDT) In-Reply-To: References: Date: Mon, 29 Jul 2013 06:11:14 -0700 X-Google-Sender-Auth: s4i2fd6R1Y1tMsSy2g4IxCuhtTk Message-ID: Subject: Re: [802.11s] mesh_forward() and (re)-encapsulating frames From: Adrian Chadd To: Monthadar Al Jaberi Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 13:11:17 -0000 So what's the specific difference between normal station and meshSTA? -adrian On 29 July 2013 03:24, Monthadar Al Jaberi wrote: > On Mon, Jul 29, 2013 at 5:32 AM, Adrian Chadd wrote: >> Hi, >> >> * I think we can get away with one queue per mesh STA neighbor for >> now. Which is effectively what we have in ath(4) and we will have in >> net80211 soon > > Yupp, the 80211 queue per meshSTA neighbour part is important if we > want to queue in net80211, and that what Linux have. > >> * THanks for the clarification for mesh sequence number. So we: >> + Increment it if we're generating a frame into the mesh network; >> + Keep it the same if we're forwarding a frame to a mesh peer / mesh gate > > Correct. > >> * If we store the mesh control header in the mbuf, and de-encapsulate >> the frame, then re-inject into the VAP path with the correct >> destination node, we could then teach the VAP path to check for that >> tag and if it's there, populate the mesh header from _that_. If it's >> not there, we create a new mesh tag and continue the encapsulation >> phase. >> >> How's that sound? > > Sounds music to my ears =) > > Let's go for it! > >> >> >> >> -adrian > > > > -- > Monthadar Al Jaberi From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 13:34:09 2013 Return-Path: Delivered-To: wireless@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 94F6EC19; Mon, 29 Jul 2013 13:34:09 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-x231.google.com (mail-we0-x231.google.com [IPv6:2a00:1450:400c:c03::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 038122670; Mon, 29 Jul 2013 13:34:08 +0000 (UTC) Received: by mail-we0-f177.google.com with SMTP id m46so3933191wev.22 for ; Mon, 29 Jul 2013 06:34: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=mmE+VAjDh074+YgxCoSONDwyZOBeaNogLZ/zrCE6I2A=; b=qEEzHTLNt0cF2twqsz2pqlsY4potBmPtKnhAX3TlbemSsv1211ZKkcry5DeVJFOm8h cFQX4hmoO+DVvN1otnAiv23+ZtX9odMWiNBmqX+8Vo56JtrOzqUraRlgccktQsLTH1ki P3O1pD329Yta0xysPPs336oQCEFqmyYiQsoErsIffhBEVMvEfo3UABxTJlmeLmUBkNXh YgSbVxIz4wHd2N6bzTRo7/nkYb9MDZb+p9EqmsMH7PTgITzs6TU/1vkqShlIbV1P0+FJ j7VLrHaKzQRp6vMNX3tkrz6ODNYgZEwiP8aNnKuzuqqMYgTwU4JET9oH4WX2X/tIwHeN 5EmQ== MIME-Version: 1.0 X-Received: by 10.180.14.105 with SMTP id o9mr7266052wic.30.1375104847255; Mon, 29 Jul 2013 06:34:07 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Mon, 29 Jul 2013 06:34:07 -0700 (PDT) In-Reply-To: <20130729095946.GK59101@e-new.0x20.net> References: <51F26CEB.9010200@dumbbell.fr> <20130729095946.GK59101@e-new.0x20.net> Date: Mon, 29 Jul 2013 06:34:07 -0700 X-Google-Sender-Auth: S1Rb5zAvRjZesYjXG48REUDuOl0 Message-ID: Subject: Re: 802.1X: dhclient started before the auth. process ends From: Adrian Chadd To: Lars Engels Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: =?ISO-8859-1?Q?Jean=2DS=E9bastien_P=E9dron?= , freebsd-current@freebsd.org, wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 13:34:09 -0000 I think you were lucky. dhclient shouldn't start running until wpa_supplicant has completed authentication. -adrian On 29 July 2013 02:59, Lars Engels wrote: > On Fri, Jul 26, 2013 at 02:34:51PM +0200, Jean-S=E9bastien P=E9dron wrote= : >> Hi! >> >> At $WORK, we use 802.1X to authenticate computers on the network. >> Authenticated computers receive a lease in the 192.168.X.X/24 network. >> Unauthenticated ones receive a lease in the 172.16.X.X/24 network. >> >> Today, I upgraded one computer running 10-CURRENT to latest HEAD and it >> seems that the interface is brought up to early now: dhclient is started >> before wpa_supplicant finishes. This was working perfectly before the >> upgrade. >> >> I don't have logs of the working case, but here are the logs of the >> non-working one: >> http://pastebin.com/ZHcbHLQZ >> >> Was I lucky with wpa_supplicant/dhclient timing? Or is there a real >> issue here? >> > > CC'ed wireless@, that's probably the proper list for the issue. From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 14:00:51 2013 Return-Path: Delivered-To: wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5F9658B3; Mon, 29 Jul 2013 14:00:51 +0000 (UTC) (envelope-from jean-sebastien.pedron@dumbbell.fr) Received: from mail.made4.biz (unknown [IPv6:2001:41d0:1:7018::1:3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2047A27E8; Mon, 29 Jul 2013 14:00:51 +0000 (UTC) Received: from [2001:1b48:10b:cafe:225:64ff:febe:589f] (helo=viking.yzserv.com) by mail.made4.biz with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1V3o0G-0000nS-JK; Mon, 29 Jul 2013 16:00:49 +0200 Message-ID: <51F6758C.9020004@dumbbell.fr> Date: Mon, 29 Jul 2013 16:00:44 +0200 From: =?ISO-8859-1?Q?Jean-S=E9bastien_P=E9dron?= User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130626 Thunderbird/17.0.7 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: 802.1X: dhclient started before the auth. process ends References: <51F26CEB.9010200@dumbbell.fr> <20130729095946.GK59101@e-new.0x20.net> In-Reply-To: X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2DFSSGAASRDLLUSXNPUME" Cc: freebsd-current@freebsd.org, wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 14:00:51 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2DFSSGAASRDLLUSXNPUME Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 29.07.2013 15:34, Adrian Chadd wrote: > I think you were lucky. I think you're right. It works perfectly on FreeBSD 9.1, because wpa_supplicant finishes the auth process really quickly, ie. before dhclient receives an answer from dhcpd from the unauthenticated network: Jul 29 15:39:46 - kernel: bge0: link state changed to UP Jul 29 15:39:46 - dhclient[46150]: DHCPREQUEST on bge0 to 255.255.255.255 port 67 Jul 29 15:39:47 - wpa_supplicant[46119]: CTRL-EVENT-EAP-STARTED EAP authentication started =2E.. Jul 29 15:39:47 - wpa_supplicant[46119]: CTRL-EVENT-EAP-SUCCESS EAP authentication completed successfully Jul 29 15:39:48 - dhclient[46150]: DHCPREQUEST on bge0 to 255.255.255.255 port 67 Jul 29 15:39:48 - dhclient[46150]: DHCPACK from 192.168.200.224 Jul 29 15:39:48 - dhclient: New IP Address (bge0): 192.168.200.91 Jul 29 15:39:48 - dhclient: New Subnet Mask (bge0): 255.255.255.0 Jul 29 15:39:48 - dhclient: New Broadcast Address (bge0): 192.168.200.255= Jul 29 15:39:48 - dhclient: New Routers (bge0): 192.168.200.254 On -CURRENT, wpa_supplicant is started more than 10 seconds after the interface is UP and dhclient sent its request (http://pastebin.com/ZHcbHLQZ). Therefore, a lease from the unauthenticated network arrives first. It was working with a previous -CURRENT (buildworld from around April if memory serves). > dhclient shouldn't start running until wpa_supplicant has completed > authentication. Damn, I always thought it worked this way on FreeBSD and happily laughed at "Linux co-workers" who use some kind of rc.local script to work around this issue :-) In fact, we're all in the same boat! I may take a look at the issue. I guess the place to fix this is in the rc scripts. Does someone have a hint? --=20 Jean-S=E9bastien P=E9dron ------enig2DFSSGAASRDLLUSXNPUME Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlH2dZAACgkQa+xGJsFYOlOJ2wCgw5haBHblo8F7a4axlOiRGP8p TFkAoLaxVfQsplwokPuRGMHLgEAXk+n1 =FEy8 -----END PGP SIGNATURE----- ------enig2DFSSGAASRDLLUSXNPUME-- From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 14:02:58 2013 Return-Path: Delivered-To: wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AF512A10; Mon, 29 Jul 2013 14:02:58 +0000 (UTC) (envelope-from lars@e-new.0x20.net) Received: from mail.0x20.net (mail.0x20.net [217.69.76.211]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C1B42813; Mon, 29 Jul 2013 14:02:58 +0000 (UTC) Received: from e-new.0x20.net (mail.0x20.net [IPv6:2001:aa8:fffb:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.0x20.net (Postfix) with ESMTPS id 08B486A6000; Mon, 29 Jul 2013 16:02:56 +0200 (CEST) Received: from e-new.0x20.net (localhost [127.0.0.1]) by e-new.0x20.net (8.14.7/8.14.7) with ESMTP id r6TE2tAl021195; Mon, 29 Jul 2013 16:02:55 +0200 (CEST) (envelope-from lars@e-new.0x20.net) Received: (from lars@localhost) by e-new.0x20.net (8.14.7/8.14.7/Submit) id r6TE2tQt020982; Mon, 29 Jul 2013 16:02:55 +0200 (CEST) (envelope-from lars) Date: Mon, 29 Jul 2013 16:02:55 +0200 From: Lars Engels To: =?utf-8?Q?Jean-S=C3=A9bastien_P=C3=A9dron?= Subject: Re: 802.1X: dhclient started before the auth. process ends Message-ID: <20130729140255.GU59101@e-new.0x20.net> References: <51F26CEB.9010200@dumbbell.fr> <20130729095946.GK59101@e-new.0x20.net> <51F6758C.9020004@dumbbell.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Mo5R/H9UGRM/aoK7" Content-Disposition: inline In-Reply-To: <51F6758C.9020004@dumbbell.fr> X-Editor: VIM - Vi IMproved 7.3 X-Operation-System: FreeBSD 8.4-RELEASE User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@freebsd.org, wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 14:02:58 -0000 --Mo5R/H9UGRM/aoK7 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 29, 2013 at 04:00:44PM +0200, Jean-S=C3=A9bastien P=C3=A9dron w= rote: > On 29.07.2013 15:34, Adrian Chadd wrote: > > I think you were lucky. >=20 > I think you're right. >=20 > It works perfectly on FreeBSD 9.1, because wpa_supplicant finishes the > auth process really quickly, ie. before dhclient receives an answer from > dhcpd from the unauthenticated network: >=20 > Jul 29 15:39:46 - kernel: bge0: link state changed to UP > Jul 29 15:39:46 - dhclient[46150]: DHCPREQUEST on bge0 to > 255.255.255.255 port 67 > Jul 29 15:39:47 - wpa_supplicant[46119]: CTRL-EVENT-EAP-STARTED EAP > authentication started > ... > Jul 29 15:39:47 - wpa_supplicant[46119]: CTRL-EVENT-EAP-SUCCESS EAP > authentication completed successfully > Jul 29 15:39:48 - dhclient[46150]: DHCPREQUEST on bge0 to > 255.255.255.255 port 67 > Jul 29 15:39:48 - dhclient[46150]: DHCPACK from 192.168.200.224 > Jul 29 15:39:48 - dhclient: New IP Address (bge0): 192.168.200.91 > Jul 29 15:39:48 - dhclient: New Subnet Mask (bge0): 255.255.255.0 > Jul 29 15:39:48 - dhclient: New Broadcast Address (bge0): 192.168.200.255 > Jul 29 15:39:48 - dhclient: New Routers (bge0): 192.168.200.254 >=20 > On -CURRENT, wpa_supplicant is started more than 10 seconds after the > interface is UP and dhclient sent its request > (http://pastebin.com/ZHcbHLQZ). Therefore, a lease from the > unauthenticated network arrives first. It was working with a previous > -CURRENT (buildworld from around April if memory serves). AFAIK rui@ imported a new version of wpa_supplicant into -CURRENT. >=20 > > dhclient shouldn't start running until wpa_supplicant has completed > > authentication. >=20 > Damn, I always thought it worked this way on FreeBSD and happily laughed > at "Linux co-workers" who use some kind of rc.local script to work > around this issue :-) In fact, we're all in the same boat! >=20 > I may take a look at the issue. I guess the place to fix this is in the > rc scripts. Does someone have a hint? --Mo5R/H9UGRM/aoK7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlH2dg8ACgkQKc512sD3afgKUACghtVeVOeb7B+fa5Ay5yN7MMwz mU0AnjK4O/S6KMKDYVX36bDw/rlr4Szo =9NQr -----END PGP SIGNATURE----- --Mo5R/H9UGRM/aoK7-- From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 14:03:55 2013 Return-Path: Delivered-To: wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2F5F7B3B; Mon, 29 Jul 2013 14:03:55 +0000 (UTC) (envelope-from lars@e-new.0x20.net) Received: from mail.0x20.net (mail.0x20.net [IPv6:2001:aa8:fffb:1::3]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DEC592824; Mon, 29 Jul 2013 14:03:54 +0000 (UTC) Received: from e-new.0x20.net (mail.0x20.net [IPv6:2001:aa8:fffb:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.0x20.net (Postfix) with ESMTPS id 8A2426A6004; Mon, 29 Jul 2013 16:03:53 +0200 (CEST) Received: from e-new.0x20.net (localhost [127.0.0.1]) by e-new.0x20.net (8.14.7/8.14.7) with ESMTP id r6TE3rcc060376; Mon, 29 Jul 2013 16:03:53 +0200 (CEST) (envelope-from lars@e-new.0x20.net) Received: (from lars@localhost) by e-new.0x20.net (8.14.7/8.14.7/Submit) id r6TE3rcv059150; Mon, 29 Jul 2013 16:03:53 +0200 (CEST) (envelope-from lars) Date: Mon, 29 Jul 2013 16:03:53 +0200 From: Lars Engels To: =?utf-8?Q?Jean-S=C3=A9bastien_P=C3=A9dron?= Subject: Re: 802.1X: dhclient started before the auth. process ends Message-ID: <20130729140353.GA41336@e-new.0x20.net> References: <51F26CEB.9010200@dumbbell.fr> <20130729095946.GK59101@e-new.0x20.net> <51F6758C.9020004@dumbbell.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline In-Reply-To: <51F6758C.9020004@dumbbell.fr> X-Editor: VIM - Vi IMproved 7.3 X-Operation-System: FreeBSD 8.4-RELEASE User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@freebsd.org, wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 14:03:55 -0000 --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 29, 2013 at 04:00:44PM +0200, Jean-S=C3=A9bastien P=C3=A9dron w= rote: > On 29.07.2013 15:34, Adrian Chadd wrote: > > I think you were lucky. >=20 > I think you're right. >=20 > It works perfectly on FreeBSD 9.1, because wpa_supplicant finishes the > auth process really quickly, ie. before dhclient receives an answer from > dhcpd from the unauthenticated network: >=20 > Jul 29 15:39:46 - kernel: bge0: link state changed to UP > Jul 29 15:39:46 - dhclient[46150]: DHCPREQUEST on bge0 to > 255.255.255.255 port 67 > Jul 29 15:39:47 - wpa_supplicant[46119]: CTRL-EVENT-EAP-STARTED EAP > authentication started > ... > Jul 29 15:39:47 - wpa_supplicant[46119]: CTRL-EVENT-EAP-SUCCESS EAP > authentication completed successfully > Jul 29 15:39:48 - dhclient[46150]: DHCPREQUEST on bge0 to > 255.255.255.255 port 67 > Jul 29 15:39:48 - dhclient[46150]: DHCPACK from 192.168.200.224 > Jul 29 15:39:48 - dhclient: New IP Address (bge0): 192.168.200.91 > Jul 29 15:39:48 - dhclient: New Subnet Mask (bge0): 255.255.255.0 > Jul 29 15:39:48 - dhclient: New Broadcast Address (bge0): 192.168.200.255 > Jul 29 15:39:48 - dhclient: New Routers (bge0): 192.168.200.254 >=20 > On -CURRENT, wpa_supplicant is started more than 10 seconds after the > interface is UP and dhclient sent its request > (http://pastebin.com/ZHcbHLQZ). Therefore, a lease from the > unauthenticated network arrives first. It was working with a previous > -CURRENT (buildworld from around April if memory serves). AFAIK rpaulo@ imported a new version of wpa_supplicant into -CURRENT. >=20 > > dhclient shouldn't start running until wpa_supplicant has completed > > authentication. >=20 > Damn, I always thought it worked this way on FreeBSD and happily laughed > at "Linux co-workers" who use some kind of rc.local script to work > around this issue :-) In fact, we're all in the same boat! >=20 > I may take a look at the issue. I guess the place to fix this is in the > rc scripts. Does someone have a hint? --7AUc2qLy4jB3hD7Z Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iEYEARECAAYFAlH2dkkACgkQKc512sD3afiqNACgq5VtL40z42riSk2sRqiQcUUM ZaMAn0Kp/AjCdzt87VnxC3Z50eba9Ph8 =s152 -----END PGP SIGNATURE----- --7AUc2qLy4jB3hD7Z-- From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 14:24:41 2013 Return-Path: Delivered-To: freebsd-wireless@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 E13B8A6B for ; Mon, 29 Jul 2013 14:24:40 +0000 (UTC) (envelope-from Scoobi_doo@yahoo.com) Received: from nm47-vm1.bullet.mail.bf1.yahoo.com (nm47-vm1.bullet.mail.bf1.yahoo.com [216.109.115.124]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8778629AE for ; Mon, 29 Jul 2013 14:24:40 +0000 (UTC) Received: from [98.139.215.142] by nm47.bullet.mail.bf1.yahoo.com with NNFMP; 29 Jul 2013 14:21:20 -0000 Received: from [98.139.211.162] by tm13.bullet.mail.bf1.yahoo.com with NNFMP; 29 Jul 2013 14:21:20 -0000 Received: from [127.0.0.1] by smtp219.mail.bf1.yahoo.com with NNFMP; 29 Jul 2013 14:21:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1375107680; bh=M9P5BEfyqCtn1bGnXhlHAuuEd0dSKXPNnN5lpvssTbA=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding; b=Ny37ZG70sr/ozqx5TWowsJqgyMcZkMZTh/isHIZKlVun6t/5l+xqN6wjZE4zvXupg0iZaBOvKdrjYw4FFYuaOtA/w2rTYRA2LohSeOcynL9lfc9hGlh6iPnQ2VBeiKCc6hV6AbDObfk8dF3c6DrCt+jwbS7O41bV1lDjI+ft2PY= X-Yahoo-Newman-Id: 69543.26790.bm@smtp219.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: TWV_sgAVM1mwNntXzcZNvK2mBjElwCgu4CT9rHnPwGn91tF PvZoeb6T42Dd5kNk3FOHuQpYjbGgitTLInBu1jKibAY6_uQ4jBuniUWPsbDF pqRyk_.YpLWNI45Jjvev1raQzHSYhdvWh50uJoM0Xd_VuH5ElxcNwjmbJYtz 9tBgyh_Q_ZrzYixGNMlK_hVwB.MYAZLs.NJwkGt9oKr3Gpte215Uw6a1pKsC ViRizqTGxAACae4.2Njn_6Ij9XZg8jNWOe8X0SYea_o4tRuZYG4b0x7gQzBP V_vuB.yTcYDJ990eTOcCHRCHK1116yRBaVJ.TqcXpaVSv3aWGtTusKWYjEab hwbFIH9k41U9A3eN_ATtCaNI1CzPy7R9KUyJh5XsnY0hwDbGjLraTGNcNemM OMlPo87yQazsq73xqFyiC.KMBfMel0p0z4a_q8Ra64NQGsvEj0_0QKsVt7Ts 4lsMPkpFvbt7HyRE3_fwA768ndqEDHhxRqmo6GzPXk7XfYa6wsgoOyr9rzHj VscHVY2Je2ijR_R9gpNCi8CC2d4dDCtvsl5IExA5PFHXRY6Do5GaGY42Efgi IBdH0YrLspwmpnclXoZhdwXgdJH8qjUX5APoxLoU- X-Yahoo-SMTP: 9sPoSQ2swBBlERuQ.0vs8XLc_MeClW0- X-Rocket-Received: from laptop.qtchat.org (Scoobi_doo@174.107.139.161 with ) by smtp219.mail.bf1.yahoo.com with SMTP; 29 Jul 2013 07:21:19 -0700 PDT Message-ID: <51F67A5E.1010603@yahoo.com> Date: Mon, 29 Jul 2013 10:21:18 -0400 From: Anthony Jenkins User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130612 Thunderbird/17.0.6 MIME-Version: 1.0 To: "freebsd-wireless@freebsd.org" Subject: Atheros AR9565 detected, not working Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 14:24:41 -0000 I just got an HP ENVY Sleekbook 6z-1100 laptop hoping it came with a FreeBSD-supported wireless NIC. It has an Atheros AR9565 and looking at the logs it _seems_ like it should be working, but I get no network traffic. I haven't started the Atheros debugging procedure yet, save to compile in option AH_DEBUG and move ath(4) out of the kernel & to a module to facilitate changes. Works (of course) in Win8 which came with laptop. Wireless enabled LED is amber (disabled) in FreeBSD, goes from amber to white (enabled) when I boot the Win8 HDD. Here's various logs and misc. system info. What should I try next? Thanks in advance! [root@laptop /usr/src]# uname -a n FreeBSD laptop.qtchat.org 10.0-CURRENT FreeBSD 10.0-CURRENT #0: Sat Jul 27 23:45:30 EDT 2013 root@laptop.qtchat.org:/usr/obj/usr/src/sys/MYKERNEL amd64 [root@laptop /usr/src]# dmesg Copyright (c) 1992-2013 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 10.0-CURRENT #0: Sat Jul 27 23:45:30 EDT 2013 root@laptop.qtchat.org:/usr/obj/usr/src/sys/MYKERNEL amd64 FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 module_register: module pci/xhci already exists! Module pci/xhci failed to register: 17 CPU: AMD A10-4655M APU with Radeon(tm) HD Graphics (1996.31-MHz K8-class CPU) Origin = "AuthenticAMD" Id = 0x610f01 Family = 0x15 Model = 0x10 Stepping = 1 Features=0x178bfbff Features2=0x3e98320b AMD Features=0x2e500800 AMD Features2=0x1abbfff,NodeId,TBM,,> Standard Extended Features=0x8 TSC: P-state invariant, performance statistics real memory = 17179869184 (16384 MB) avail memory = 15463530496 (14747 MB) Event timer "LAPIC" quality 400 ACPI APIC Table: FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 4 core(s) cpu0 (BSP): APIC ID: 16 cpu1 (AP): APIC ID: 17 cpu2 (AP): APIC ID: 18 cpu3 (AP): APIC ID: 19 ioapic0: Changing APIC ID to 4 ioapic0 irqs 0-23 on motherboard kbd1 at kbdmux0 acpi0: on motherboard acpi0: Power Button (fixed) cpu0: on acpi0 cpu1: on acpi0 cpu2: on acpi0 cpu3: on acpi0 hpet0: iomem 0xfed00000-0xfed003ff irq 0,8 on acpi0 Timecounter "HPET" frequency 14318180 Hz quality 950 atrtc0: port 0x70-0x71 on acpi0 Event timer "RTC" frequency 32768 Hz quality 0 attimer0: port 0x40-0x43 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 Event timer "i8254" frequency 1193182 Hz quality 100 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 acpi_timer0: <32-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0 acpi_ec0: port 0x62,0x66 iomem 0xff000000-0xff000fff on acpi0 acpi_button0: on acpi0 pcib0: port 0xcf8-0xcff on acpi0 pci0: on pcib0 vgapci0: port 0x3000-0x30ff mem 0xe0000000-0xefffffff,0xf0300000-0xf033ffff irq 17 at device 1.0 on pci0 acpi_video0: on vgapci0 hdac0: mem 0xf0344000-0xf0347fff irq 18 at device 1.1 on pci0 hdac0: hdac_get_capabilities: Invalid corb size (0); assuming 256. hdac0: hdac_get_capabilities: Invalid rirb size (0); assuming 256. pcib1: at device 4.0 on pci0 pci1: on pcib1 pci1: at device 0.0 (no driver attached) re0: port 0x2000-0x20ff mem 0xf0004000-0xf0004fff,0xf0000000-0xf0003fff irq 16 at device 0.2 on pci1 re0: Using 1 MSI-X message re0: turning off MSI enable bit. re0: ASPM disabled re0: Chip rev. 0x48800000 re0: MAC rev. 0x00000000 miibus0: on re0 rgephy0: PHY 1 on miibus0 rgephy0: none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT-FDX, 1000baseT-FDX-master, 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto, auto-flow re0: Ethernet address: 6c:3b:e5:81:21:f0 pcib2: at device 5.0 on pci0 pci2: on pcib2 ath0: mem 0xf0100000-0xf017ffff irq 17 at device 0.0 on pci2 ar9300_set_stub_functions: setting stub functions ar9300_set_stub_functions: setting stub functions ar9300_attach: calling ar9300_hw_attach ar9300_hw_attach: calling ar9300_eeprom_attach ar9300_flash_map: unimplemented for now Restoring Cal data from DRAM Restoring Cal data from EEPROM Restoring Cal data from Flash Restoring Cal data from Flash Restoring Cal data from OTP ar9300_hw_attach: ar9300_eeprom_attach returned 0 ar9300_fill_capability_info: (MCI) MCI support = 1 ath0: RX status length: 48 ath0: RX buffer size: 4096 ath0: TX descriptor length: 128 ath0: TX status length: 36 ath0: TX buffers per descriptor: 4 ar9300_freebsd_setup_x_tx_desc: called, 0x0/0, 0x0/0, 0x0/0 ath0: ath_edma_setup_rxfifo: type=0, FIFO depth = 16 entries ath0: ath_edma_setup_rxfifo: type=1, FIFO depth = 128 entries ath0: [HT] enabling HT modes ath0: [HT] enabling short-GI in 20MHz mode ath0: [HT] 1 stream STBC receive enabled ath0: [HT] 1 RX streams; 1 TX streams ath0: AR9565 mac 704.0 RF5110 phy 526.12 ath0: 2GHz radio: 0x0000; 5GHz radio: 0x0000 xhci0: mem 0xf0348000-0xf0349fff irq 18 at device 16.0 on pci0 usbus0: waiting for BIOS to give up control xhci0: 32 byte context size. usbus0 on xhci0 ahci0: port 0x3118-0x311f,0x3124-0x3127,0x3110-0x3117,0x3120-0x3123,0x3100-0x310f mem 0xf034e000-0xf034e7ff irq 19 at device 17.0 on pci0 ahci0: AHCI v1.30 with 1 6Gbps ports, Port Multiplier supported ahcich0: at channel 0 on ahci0 ohci0: mem 0xf034d000-0xf034dfff irq 18 at device 18.0 on pci0 usbus1 on ohci0 ehci0: mem 0xf034c000-0xf034c0ff irq 17 at device 18.2 on pci0 usbus2: EHCI version 1.0 usbus2 on ehci0 ohci1: mem 0xf034b000-0xf034bfff irq 18 at device 19.0 on pci0 usbus3 on ohci1 ehci1: mem 0xf034a000-0xf034a0ff irq 17 at device 19.2 on pci0 usbus4: EHCI version 1.0 usbus4 on ehci1 pci0: at device 20.0 (no driver attached) hdac1: mem 0xf0340000-0xf0343fff irq 16 at device 20.2 on pci0 isab0: at device 20.3 on pci0 isa0: on isab0 pcib3: at device 20.4 on pci0 pci3: on pcib3 acpi_lid0: on acpi0 acpi_tz0: on acpi0 acpi_tz0: _CRT value is absurd, ignored (226.8C) atkbdc0: port 0x60,0x64 irq 1 on acpi0 atkbd0: irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] psm0: irq 12 on atkbdc0 psm0: [GIANT-LOCKED] psm0: model Synaptics Touchpad, device ID 0 battery0: on acpi0 acpi_acad0: on acpi0 sc0: at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 ctl: CAM Target Layer loaded acpi_throttle0: on cpu0 acpi_throttle1: on cpu1 acpi_throttle1: failed to attach P_CNT device_attach: acpi_throttle1 attach returned 6 acpi_throttle2: on cpu2 acpi_throttle2: failed to attach P_CNT device_attach: acpi_throttle2 attach returned 6 acpi_throttle3: on cpu3 acpi_throttle3: failed to attach P_CNT device_attach: acpi_throttle3 attach returned 6 ZFS filesystem version: 5 ZFS storage pool version: features support (5000) Timecounters tick every 1.000 msec hdacc0: at cad 0 on hdac0 hdaa0: at nid 1 on hdacc0 pcm0: at nid 3 on hdaa0 hdacc1: at cad 0 on hdac1 hdaa1: at nid 1 on hdacc1 pcm1: at nid 13,11 and 12 on hdaa1 pcm2: at nid 17 on hdaa1 usbus0: 5.0Gbps Super Speed USB v3.0 usbus1: 12Mbps Full Speed USB v1.0 usbus2: 480Mbps High Speed USB v2.0 usbus3: 12Mbps Full Speed USB v1.0 usbus4: 480Mbps High Speed USB v2.0 ugen3.1: at usbus3 uhub0: on usbus3 ugen2.1: at usbus2 uhub1: on usbus2 ugen1.1: at usbus1 uhub2: on usbus1 ugen0.1: <0x1022> at usbus0 uhub3: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0 ugen4.1: at usbus4 uhub4: on usbus4 ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 ada0: ATA-9 SATA 3.x device ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes) ada0: Command Queueing enabled ada0: 238475MB (488397168 512 byte sectors: 16H 63S/T 16383C) ada0: Previously was known as ad4 SMP: AP CPU #3 Launched! SMP: AP CPU #1 Launched! SMP: AP CPU #2 Launched! Timecounter "TSC" frequency 1996309068 Hz quality 1000 Root mount waiting for: usbus4 usbus3 usbus2 usbus1 usbus0 uhub0: 5 ports with 5 removable, self powered uhub2: 5 ports with 5 removable, self powered ACPI Error: No handler for Region [RCM0] (0xfffffe0026ac6b00) [SystemCMOS] (20130626/evregion-178) ACPI Error: Region SystemCMOS (ID=5) has no handler (20130626/exfldio-320) ACPI Error: Method parse/execution failed [\134_SB_.WMID.ESDT] (Node 0xfffffe0026adac40), AE_NOT_EXIST (20130626/psparse-553) ACPI Error: Method parse/execution failed [\134_SB_.PCI0.LPC0.EC0_._Q42] (Node 0xfffffe0026ae8340), AE_NOT_EXIST (20130626/psparse-553) acpi_ec0: evaluation of query method _Q42 failed: AE_NOT_EXIST uhub3: 4 ports with 4 removable, self powered Root mount waiting for: usbus4 usbus2 uhub1: 5 ports with 5 removable, self powered uhub4: 5 ports with 5 removable, self powered Root mount waiting for: usbus4 usbus2 ugen2.2: at usbus2 ugen4.2: at usbus4 Trying to mount root from zfs:sys []... can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND ugen3.2: at usbus3 ar9300_Stub_GetCTSTimeout: called ar9300_Stub_GetCTSTimeout: called ar9300_Stub_GetAntennaSwitch: called ar9300_Stub_GetAntennaSwitch: called wlan1: Ethernet address: 20:68:9d:c5:76:8d run0: on usbus2 run0: MAC/BBP RT3071 (rev 0x0213), RF RT3022 (MIMO 2T2R), address 1c:bd:b9:8c:9d:71 ubt0: on usbus3 wlan0: Ethernet address: 1c:bd:b9:8c:9d:71 run0: firmware RT3071 ver. 0.236 loaded WARNING: attempt to domain_add(bluetooth) after domainfinalize() WARNING: attempt to domain_add(netgraph) after domainfinalize() can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND WARNING pid 2654 (python2.7): ioctl sign-extension ioctl ffffffff80087467 WARNING pid 2655 (python2.7): ioctl sign-extension ioctl ffffffff80087467 WARNING pid 2656 (python2.7): ioctl sign-extension ioctl ffffffff80087467 wlan0: Ethernet address: 1c:bd:b9:8c:9d:71 run0: firmware RT3071 ver. 0.236 loaded wlan0: link state changed to UP can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND uhub3: at usbus0, port 1, addr 1 (disconnected) uhub2: at usbus1, port 1, addr 1 (disconnected) xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted uhub1: at usbus2, port 1, addr 1 (disconnected) ugen2.2: at usbus2 (disconnected) run0: at uhub1, port 1, addr 2 (disconnected) xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted xhci_interrupt: host controller halted wlan0: link state changed to DOWN uhub0: at usbus3, port 1, addr 1 (disconnected) ugen3.2: at usbus3 (disconnected) ubt0: at uhub0, port 4, addr 2 (disconnected) xhci_interrupt: host controller halted xhci_interrupt: host controller halted uhub4: at usbus4, port 1, addr 1 (disconnected) ugen4.2: at usbus4 (disconnected) ACPI Error: No handler for Region [RCM0] (0xfffffe0026ac6b00) [SystemCMOS] (20130626/evregion-178) ACPI Error: Region SystemCMOS (ID=5) has no handler (20130626/exfldio-320) ACPI Error: Method parse/execution failed [\134_SB_.WMID.ESDT] (Node 0xfffffe0026adac40), AE_NOT_EXIST (20130626/psparse-553) ACPI Error: Method parse/execution failed [\134_PTS] (Node 0xfffffe0026ab4c80), AE_NOT_EXIST (20130626/psparse-553) acpi0: AcpiEnterSleepStatePrep failed - AE_NOT_EXIST can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND xhci0: 32 byte context size. uhub0: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0 uhub1: on usbus2 uhub2: on usbus4 uhub3: on usbus3 uhub4: on usbus1 uhub0: 4 ports with 4 removable, self powered uhub4: 5 ports with 5 removable, self powered uhub3: 5 ports with 5 removable, self powered uhub1: 5 ports with 5 removable, self powered uhub2: 5 ports with 5 removable, self powered ugen2.2: at usbus2 run0: on usbus2 ugen4.2: at usbus4 run0: MAC/BBP RT3071 (rev 0x0213), RF RT3022 (MIMO 2T2R), address 1c:bd:b9:8c:9d:71 wlan0: Ethernet address: 1c:bd:b9:8c:9d:71 run0: firmware RT3071 ver. 0.236 loaded ugen3.2: at usbus3 ubt0: on usbus3 wlan0: link state changed to UP can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND [root@laptop /usr/src]# cat /etc/rc.conf wlans_run0="wlan0" wlans_ath0="wlan1" ifconfig_wlan0="DHCP WPA" ... [root@laptop /usr/src]# ifconfig -a ath0: flags=8802 metric 0 mtu 2290 ether 20:68:9d:c5:76:8d nd6 options=29 media: IEEE 802.11 Wireless Ethernet autoselect (autoselect) status: no carrier wlan1: flags=8802 metric 0 mtu 1500 ether 20:68:9d:c5:76:8d nd6 options=29 media: IEEE 802.11 Wireless Ethernet autoselect (autoselect) status: no carrier ssid "" channel 1 (2412 MHz 11b) regdomain 106 indoor ecm authmode OPEN privacy OFF txpower 20 bmiss 7 scanvalid 60 wme burst bintval 0 ... [root@laptop /usr/src]# /etc/rc.d/netif start ath0 Starting Network: ath0. ath0: flags=8843 metric 0 mtu 2290 ether 20:68:9d:c5:76:8d nd6 options=29 media: IEEE 802.11 Wireless Ethernet autoselect mode 11g status: associated Additional inet routing options: ignore ICMP redirect=YES log ICMP redirect=YES. [root@laptop /usr/src]# for iface in ath0 wlan1; do ifconfig ${iface}; done ath0: flags=8843 metric 0 mtu 2290 ether 20:68:9d:c5:76:8d nd6 options=29 media: IEEE 802.11 Wireless Ethernet autoselect mode 11g status: associated wlan1: flags=8843 metric 0 mtu 1500 ether 20:68:9d:c5:76:8d inet 67.215.65.145 netmask 0xff000000 broadcast 67.215.65.145 nd6 options=29 media: IEEE 802.11 Wireless Ethernet autoselect (autoselect) status: no carrier ssid "" channel 2 (2417 MHz 11g) regdomain 106 indoor ecm authmode OPEN privacy OFF txpower 20 bmiss 7 scanvalid 60 protmode CTS wme burst [root@laptop /usr/src]# dmesg ... ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping -- Anthony Jenkins From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 14:30:23 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D60C9CC5 for ; Mon, 29 Jul 2013 14:30:23 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 587F829FC for ; Mon, 29 Jul 2013 14:30:23 +0000 (UTC) Received: by mail-wi0-f181.google.com with SMTP id en1so3097785wid.2 for ; Mon, 29 Jul 2013 07:30:20 -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; bh=0UI2xq+Bb0/m12yxmO5dw6Q7WDG1f8qqy+Y2Vmvu/SU=; b=1GkZaftBjErbXLqvLF23pEOnLToxCCqPm6e5nQjOlKmy6QBexLLpspJQzDEtdao6js SFP+y0PaN4rrd4xLdCdj3n5S56fsKifDb0lEAUZM/TAhnGQu1WJ8Vn8Jrt5Ns9dc1u6v nejmu/Il+tzoWUp6Bh23bXz0tP23XVLfkB/sFCPUhbxgAWCR1V2K15NJhOW+Nyi+B1yv 1zxnvosH71dk2Yj2ALhLlqMMvq9fIbL88wXmpdM9vhLopnCkRi2riYGJoy74E6wwOI2p YODcfAScnwNS+EEI9aXfXHYrfkUxaJRNlgusj9XtH5tIxvdLHklmn+zhlEaWWTOXMryU ZOXg== MIME-Version: 1.0 X-Received: by 10.180.160.165 with SMTP id xl5mr7345258wib.46.1375108220668; Mon, 29 Jul 2013 07:30:20 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Mon, 29 Jul 2013 07:30:20 -0700 (PDT) In-Reply-To: <51F67A5E.1010603@yahoo.com> References: <51F67A5E.1010603@yahoo.com> Date: Mon, 29 Jul 2013 07:30:20 -0700 X-Google-Sender-Auth: gt_FRS2td3jIZg6xc5wPfRZBank Message-ID: Subject: Re: Atheros AR9565 detected, not working From: Adrian Chadd To: Anthony Jenkins Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-wireless@freebsd.org" X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 14:30:24 -0000 Hm, maybe rfkill is set? The AR9565 is supported. I have the reference NICs from Atheros; they work just fine. It may be some kind of ACPI setting to enable/disable RFKill so the radio side is actually enabled. I'm sorry, I don't have much more than that to offer without having the laptop here. If someone's willing to send me one, I'll get 10 + wireless working on it and then hand it over to ixsystems to join the 'stuff we really should get pcbsd running smoothly on' pile. They're about $500 off of amazon.com. Thanks, -adrian On 29 July 2013 07:21, Anthony Jenkins wrote: > I just got an HP ENVY Sleekbook 6z-1100 laptop hoping it came with a > FreeBSD-supported wireless NIC. It has an Atheros AR9565 and looking at the > logs it _seems_ like it should be working, but I get no network traffic. I > haven't started the Atheros debugging procedure yet, save to compile in > option AH_DEBUG and move ath(4) out of the kernel & to a module to > facilitate changes. Works (of course) in Win8 which came with laptop. > Wireless enabled LED is amber (disabled) in FreeBSD, goes from amber to > white (enabled) when I boot the Win8 HDD. > > Here's various logs and misc. system info. What should I try next? Thanks > in advance! > > [root@laptop /usr/src]# uname -a n > FreeBSD laptop.qtchat.org 10.0-CURRENT FreeBSD 10.0-CURRENT #0: Sat Jul 27 > 23:45:30 EDT 2013 root@laptop.qtchat.org:/usr/obj/usr/src/sys/MYKERNEL > amd64 > > [root@laptop /usr/src]# dmesg > Copyright (c) 1992-2013 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > The Regents of the University of California. All rights reserved. > FreeBSD is a registered trademark of The FreeBSD Foundation. > FreeBSD 10.0-CURRENT #0: Sat Jul 27 23:45:30 EDT 2013 > root@laptop.qtchat.org:/usr/obj/usr/src/sys/MYKERNEL amd64 > FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 > module_register: module pci/xhci already exists! > Module pci/xhci failed to register: 17 > CPU: AMD A10-4655M APU with Radeon(tm) HD Graphics (1996.31-MHz K8-class > CPU) > Origin = "AuthenticAMD" Id = 0x610f01 Family = 0x15 Model = 0x10 > Stepping = 1 > Features=0x178bfbff > Features2=0x3e98320b > AMD Features=0x2e500800 > AMD > Features2=0x1abbfff,NodeId,TBM,,> > Standard Extended Features=0x8 > TSC: P-state invariant, performance statistics > real memory = 17179869184 (16384 MB) > avail memory = 15463530496 (14747 MB) > Event timer "LAPIC" quality 400 > ACPI APIC Table: > FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs > FreeBSD/SMP: 1 package(s) x 4 core(s) > cpu0 (BSP): APIC ID: 16 > cpu1 (AP): APIC ID: 17 > cpu2 (AP): APIC ID: 18 > cpu3 (AP): APIC ID: 19 > ioapic0: Changing APIC ID to 4 > ioapic0 irqs 0-23 on motherboard > kbd1 at kbdmux0 > acpi0: on motherboard > acpi0: Power Button (fixed) > cpu0: on acpi0 > cpu1: on acpi0 > cpu2: on acpi0 > cpu3: on acpi0 > hpet0: iomem 0xfed00000-0xfed003ff irq 0,8 on > acpi0 > Timecounter "HPET" frequency 14318180 Hz quality 950 > atrtc0: port 0x70-0x71 on acpi0 > Event timer "RTC" frequency 32768 Hz quality 0 > attimer0: port 0x40-0x43 on acpi0 > Timecounter "i8254" frequency 1193182 Hz quality 0 > Event timer "i8254" frequency 1193182 Hz quality 100 > Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 > acpi_timer0: <32-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0 > acpi_ec0: port 0x62,0x66 iomem > 0xff000000-0xff000fff on acpi0 > acpi_button0: on acpi0 > pcib0: port 0xcf8-0xcff on acpi0 > pci0: on pcib0 > vgapci0: port 0x3000-0x30ff mem > 0xe0000000-0xefffffff,0xf0300000-0xf033ffff irq 17 at device 1.0 on pci0 > acpi_video0: on vgapci0 > hdac0: mem 0xf0344000-0xf0347fff irq 18 at > device 1.1 on pci0 > hdac0: hdac_get_capabilities: Invalid corb size (0); assuming 256. > hdac0: hdac_get_capabilities: Invalid rirb size (0); assuming 256. > pcib1: at device 4.0 on pci0 > pci1: on pcib1 > pci1: at device 0.0 (no driver attached) > re0: port > 0x2000-0x20ff mem 0xf0004000-0xf0004fff,0xf0000000-0xf0003fff irq 16 at > device 0.2 on pci1 > re0: Using 1 MSI-X message > re0: turning off MSI enable bit. > re0: ASPM disabled > re0: Chip rev. 0x48800000 > re0: MAC rev. 0x00000000 > miibus0: on re0 > rgephy0: PHY 1 on miibus0 > rgephy0: none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, > 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT-FDX, 1000baseT-FDX-master, > 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto, auto-flow > re0: Ethernet address: 6c:3b:e5:81:21:f0 > pcib2: at device 5.0 on pci0 > pci2: on pcib2 > ath0: mem 0xf0100000-0xf017ffff irq 17 at device > 0.0 on pci2 > ar9300_set_stub_functions: setting stub functions > ar9300_set_stub_functions: setting stub functions > ar9300_attach: calling ar9300_hw_attach > ar9300_hw_attach: calling ar9300_eeprom_attach > ar9300_flash_map: unimplemented for now > Restoring Cal data from DRAM > Restoring Cal data from EEPROM > Restoring Cal data from Flash > Restoring Cal data from Flash > Restoring Cal data from OTP > ar9300_hw_attach: ar9300_eeprom_attach returned 0 > ar9300_fill_capability_info: (MCI) MCI support = 1 > ath0: RX status length: 48 > ath0: RX buffer size: 4096 > ath0: TX descriptor length: 128 > ath0: TX status length: 36 > ath0: TX buffers per descriptor: 4 > ar9300_freebsd_setup_x_tx_desc: called, 0x0/0, 0x0/0, 0x0/0 > ath0: ath_edma_setup_rxfifo: type=0, FIFO depth = 16 entries > ath0: ath_edma_setup_rxfifo: type=1, FIFO depth = 128 entries > ath0: [HT] enabling HT modes > ath0: [HT] enabling short-GI in 20MHz mode > ath0: [HT] 1 stream STBC receive enabled > ath0: [HT] 1 RX streams; 1 TX streams > ath0: AR9565 mac 704.0 RF5110 phy 526.12 > ath0: 2GHz radio: 0x0000; 5GHz radio: 0x0000 > xhci0: mem 0xf0348000-0xf0349fff irq 18 > at device 16.0 on pci0 > usbus0: waiting for BIOS to give up control > xhci0: 32 byte context size. > usbus0 on xhci0 > ahci0: port > 0x3118-0x311f,0x3124-0x3127,0x3110-0x3117,0x3120-0x3123,0x3100-0x310f mem > 0xf034e000-0xf034e7ff irq 19 at device 17.0 on pci0 > ahci0: AHCI v1.30 with 1 6Gbps ports, Port Multiplier supported > ahcich0: at channel 0 on ahci0 > ohci0: mem 0xf034d000-0xf034dfff irq 18 at > device 18.0 on pci0 > usbus1 on ohci0 > ehci0: mem 0xf034c000-0xf034c0ff irq 17 > at device 18.2 on pci0 > usbus2: EHCI version 1.0 > usbus2 on ehci0 > ohci1: mem 0xf034b000-0xf034bfff irq 18 at > device 19.0 on pci0 > usbus3 on ohci1 > ehci1: mem 0xf034a000-0xf034a0ff irq 17 > at device 19.2 on pci0 > usbus4: EHCI version 1.0 > usbus4 on ehci1 > pci0: at device 20.0 (no driver attached) > hdac1: mem 0xf0340000-0xf0343fff irq > 16 at device 20.2 on pci0 > isab0: at device 20.3 on pci0 > isa0: on isab0 > pcib3: at device 20.4 on pci0 > pci3: on pcib3 > acpi_lid0: on acpi0 > acpi_tz0: on acpi0 > acpi_tz0: _CRT value is absurd, ignored (226.8C) > atkbdc0: port 0x60,0x64 irq 1 on acpi0 > atkbd0: irq 1 on atkbdc0 > kbd0 at atkbd0 > atkbd0: [GIANT-LOCKED] > psm0: irq 12 on atkbdc0 > psm0: [GIANT-LOCKED] > psm0: model Synaptics Touchpad, device ID 0 > battery0: on acpi0 > acpi_acad0: on acpi0 > sc0: at flags 0x100 on isa0 > sc0: VGA <16 virtual consoles, flags=0x300> > vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 > ctl: CAM Target Layer loaded > acpi_throttle0: on cpu0 > acpi_throttle1: on cpu1 > acpi_throttle1: failed to attach P_CNT > device_attach: acpi_throttle1 attach returned 6 > acpi_throttle2: on cpu2 > acpi_throttle2: failed to attach P_CNT > device_attach: acpi_throttle2 attach returned 6 > acpi_throttle3: on cpu3 > acpi_throttle3: failed to attach P_CNT > device_attach: acpi_throttle3 attach returned 6 > ZFS filesystem version: 5 > ZFS storage pool version: features support (5000) > Timecounters tick every 1.000 msec > hdacc0: at cad 0 on hdac0 > hdaa0: at nid 1 on hdacc0 > pcm0: at nid 3 on hdaa0 > hdacc1: at cad 0 on hdac1 > hdaa1: at nid 1 on hdacc1 > pcm1: at nid 13,11 and 12 on hdaa1 > pcm2: at nid 17 on hdaa1 > usbus0: 5.0Gbps Super Speed USB v3.0 > usbus1: 12Mbps Full Speed USB v1.0 > usbus2: 480Mbps High Speed USB v2.0 > usbus3: 12Mbps Full Speed USB v1.0 > usbus4: 480Mbps High Speed USB v2.0 > ugen3.1: at usbus3 > uhub0: on usbus3 > ugen2.1: at usbus2 > uhub1: on usbus2 > ugen1.1: at usbus1 > uhub2: on usbus1 > ugen0.1: <0x1022> at usbus0 > uhub3: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0 > ugen4.1: at usbus4 > uhub4: on usbus4 > ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 > ada0: ATA-9 SATA 3.x device > ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes) > ada0: Command Queueing enabled > ada0: 238475MB (488397168 512 byte sectors: 16H 63S/T 16383C) > ada0: Previously was known as ad4 > SMP: AP CPU #3 Launched! > SMP: AP CPU #1 Launched! > SMP: AP CPU #2 Launched! > Timecounter "TSC" frequency 1996309068 Hz quality 1000 > Root mount waiting for: usbus4 usbus3 usbus2 usbus1 usbus0 > uhub0: 5 ports with 5 removable, self powered > uhub2: 5 ports with 5 removable, self powered > ACPI Error: No handler for Region [RCM0] (0xfffffe0026ac6b00) [SystemCMOS] > (20130626/evregion-178) > ACPI Error: Region SystemCMOS (ID=5) has no handler (20130626/exfldio-320) > ACPI Error: Method parse/execution failed [\134_SB_.WMID.ESDT] (Node > 0xfffffe0026adac40), AE_NOT_EXIST (20130626/psparse-553) > ACPI Error: Method parse/execution failed [\134_SB_.PCI0.LPC0.EC0_._Q42] > (Node 0xfffffe0026ae8340), AE_NOT_EXIST (20130626/psparse-553) > acpi_ec0: evaluation of query method _Q42 failed: AE_NOT_EXIST > uhub3: 4 ports with 4 removable, self powered > Root mount waiting for: usbus4 usbus2 > uhub1: 5 ports with 5 removable, self powered > uhub4: 5 ports with 5 removable, self powered > Root mount waiting for: usbus4 usbus2 > ugen2.2: at usbus2 > ugen4.2: at usbus4 > Trying to mount root from zfs:sys []... > can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND > can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND > ugen3.2: at usbus3 > ar9300_Stub_GetCTSTimeout: called > ar9300_Stub_GetCTSTimeout: called > ar9300_Stub_GetAntennaSwitch: called > ar9300_Stub_GetAntennaSwitch: called > wlan1: Ethernet address: 20:68:9d:c5:76:8d > run0: on usbus2 > run0: MAC/BBP RT3071 (rev 0x0213), RF RT3022 (MIMO 2T2R), address > 1c:bd:b9:8c:9d:71 > ubt0: on > usbus3 > wlan0: Ethernet address: 1c:bd:b9:8c:9d:71 > run0: firmware RT3071 ver. 0.236 loaded > WARNING: attempt to domain_add(bluetooth) after domainfinalize() > WARNING: attempt to domain_add(netgraph) after domainfinalize() > can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND > can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND > WARNING pid 2654 (python2.7): ioctl sign-extension ioctl ffffffff80087467 > WARNING pid 2655 (python2.7): ioctl sign-extension ioctl ffffffff80087467 > WARNING pid 2656 (python2.7): ioctl sign-extension ioctl ffffffff80087467 > wlan0: Ethernet address: 1c:bd:b9:8c:9d:71 > run0: firmware RT3071 ver. 0.236 loaded > wlan0: link state changed to UP > can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND > uhub3: at usbus0, port 1, addr 1 (disconnected) > uhub2: at usbus1, port 1, addr 1 (disconnected) > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > uhub1: at usbus2, port 1, addr 1 (disconnected) > ugen2.2: at usbus2 (disconnected) > run0: at uhub1, port 1, addr 2 (disconnected) > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > wlan0: link state changed to DOWN > uhub0: at usbus3, port 1, addr 1 (disconnected) > ugen3.2: at usbus3 (disconnected) > ubt0: at uhub0, port 4, addr 2 (disconnected) > xhci_interrupt: host controller halted > xhci_interrupt: host controller halted > uhub4: at usbus4, port 1, addr 1 (disconnected) > ugen4.2: at usbus4 (disconnected) > ACPI Error: No handler for Region [RCM0] (0xfffffe0026ac6b00) [SystemCMOS] > (20130626/evregion-178) > ACPI Error: Region SystemCMOS (ID=5) has no handler (20130626/exfldio-320) > ACPI Error: Method parse/execution failed [\134_SB_.WMID.ESDT] (Node > 0xfffffe0026adac40), AE_NOT_EXIST (20130626/psparse-553) > ACPI Error: Method parse/execution failed [\134_PTS] (Node > 0xfffffe0026ab4c80), AE_NOT_EXIST (20130626/psparse-553) > acpi0: AcpiEnterSleepStatePrep failed - AE_NOT_EXIST > can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND > xhci0: 32 byte context size. > uhub0: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0 > uhub1: on usbus2 > uhub2: on usbus4 > uhub3: on usbus3 > uhub4: on usbus1 > uhub0: 4 ports with 4 removable, self powered > uhub4: 5 ports with 5 removable, self powered > uhub3: 5 ports with 5 removable, self powered > uhub1: 5 ports with 5 removable, self powered > uhub2: 5 ports with 5 removable, self powered > ugen2.2: at usbus2 > run0: on usbus2 > ugen4.2: at usbus4 > run0: MAC/BBP RT3071 (rev 0x0213), RF RT3022 (MIMO 2T2R), address > 1c:bd:b9:8c:9d:71 > wlan0: Ethernet address: 1c:bd:b9:8c:9d:71 > run0: firmware RT3071 ver. 0.236 loaded > ugen3.2: at usbus3 > ubt0: on > usbus3 > wlan0: link state changed to UP > can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND > > [root@laptop /usr/src]# cat /etc/rc.conf > wlans_run0="wlan0" > wlans_ath0="wlan1" > ifconfig_wlan0="DHCP WPA" > ... > > [root@laptop /usr/src]# ifconfig -a > ath0: flags=8802 metric 0 mtu 2290 > ether 20:68:9d:c5:76:8d > nd6 options=29 > media: IEEE 802.11 Wireless Ethernet autoselect (autoselect) > status: no carrier > wlan1: flags=8802 metric 0 mtu 1500 > ether 20:68:9d:c5:76:8d > nd6 options=29 > media: IEEE 802.11 Wireless Ethernet autoselect (autoselect) > status: no carrier > ssid "" channel 1 (2412 MHz 11b) > regdomain 106 indoor ecm authmode OPEN privacy OFF txpower 20 bmiss 7 > scanvalid 60 wme burst bintval 0 > ... > > [root@laptop /usr/src]# /etc/rc.d/netif start ath0 > Starting Network: ath0. > ath0: flags=8843 metric 0 mtu 2290 > ether 20:68:9d:c5:76:8d > nd6 options=29 > media: IEEE 802.11 Wireless Ethernet autoselect mode 11g > status: associated > Additional inet routing options: ignore ICMP redirect=YES log ICMP > redirect=YES. > > [root@laptop /usr/src]# for iface in ath0 wlan1; do ifconfig ${iface}; done > ath0: flags=8843 metric 0 mtu 2290 > ether 20:68:9d:c5:76:8d > nd6 options=29 > media: IEEE 802.11 Wireless Ethernet autoselect mode 11g > status: associated > wlan1: flags=8843 metric 0 mtu 1500 > ether 20:68:9d:c5:76:8d > inet 67.215.65.145 netmask 0xff000000 broadcast 67.215.65.145 > nd6 options=29 > media: IEEE 802.11 Wireless Ethernet autoselect (autoselect) > status: no carrier > ssid "" channel 2 (2417 MHz 11g) > regdomain 106 indoor ecm authmode OPEN privacy OFF txpower 20 bmiss 7 > scanvalid 60 protmode CTS wme burst > > [root@laptop /usr/src]# dmesg > ... > ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping > ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping > ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping > ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping > ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping > ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping > > > -- > Anthony Jenkins > _______________________________________________ > 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" From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 14:42:13 2013 Return-Path: Delivered-To: freebsd-wireless@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 1CC3A34E for ; Mon, 29 Jul 2013 14:42:13 +0000 (UTC) (envelope-from Scoobi_doo@yahoo.com) Received: from nm1-vm2.bullet.mail.ne1.yahoo.com (nm1-vm2.bullet.mail.ne1.yahoo.com [98.138.91.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B1FD52B04 for ; Mon, 29 Jul 2013 14:42:12 +0000 (UTC) Received: from [98.138.101.132] by nm1.bullet.mail.ne1.yahoo.com with NNFMP; 29 Jul 2013 14:36:38 -0000 Received: from [98.138.226.30] by tm20.bullet.mail.ne1.yahoo.com with NNFMP; 29 Jul 2013 14:36:38 -0000 Received: from [127.0.0.1] by smtp201.mail.ne1.yahoo.com with NNFMP; 29 Jul 2013 14:36:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1375108598; bh=D6Vd+i/nSYU9bb2+Ee3KcParcQwDxdO7fJ+L/tUc0Uk=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=4PFLj8XVltNCfZXMitG4sq8gEPZnF6PTnO+aPrjiQpuIh7fJizg+JqjwVP2mgpo1Burmr+v3ZKySLukq5R3VMTmyA2PKErtPiwGokTZ+U301Hkh2Tzi1YnAetxU7eyeA8Yy/s3Hd6ZrCt+A6ktS53UMBxAdLiqCLcNUvoHgxZt8= X-Yahoo-Newman-Id: 318583.50880.bm@smtp201.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 9vTdF4oVM1kseOZsWUNI4Mzh19J.TFapWCPHOOmIAxVTMpN 0leoFvZfNmtglG3RSFurDm30tpRY5XCKdpL9elmtFstyENIS19TI.ZwU2SsZ dKhp2PLC8qZs2pyGqLW4KjjBVM3mnGV9l3TAFt42X5AkqhHqqy5MYeOi5wkd zTQE3I1nZVhUa7VzP3a80fdG2a2gHjPiMPvJt.ORH1qo4aTG32.7XVY1Mw0Q W.Lw_Y8HdfS.0rk7RskV_S9hCiK3kjP2iYvsli2wapPNSgO7he0JeAdPdeXv 89PW_mpuDnPf6VtzBbbQsJW0mYKceXesp6_aboetv8Oz0lAav5fZRI3_QudS 610QM5UCTY0.uBPR47QHZpIqvKAwVk87P8QZqHwMwgwl7uqKUjwws597LJTc 49hQ3yb_KxbHoO0wmwsbkwfa9Zb7iVl4RxSRbIoi8RYBboFWAC5QiVYdT.HA CvQq_ogTqNXvFmgsZSi_5gbn6uyQqrgkvgW3lcaok4CawKN8_WHtqse8OBev XEHOVxe9sBiK7PP72vVlFOppe3TeeTrd0uMVizXNN8PjBThQPqF_8ufUpywi eQeHXQdI3Dhu6w0B3MIPCDUgDMSlwnOAykD0cES07Tvu6oSYZy9nvehOzJYG 8Eh4Jsnq_eSiEfS.tAhCvjWYEkAQ- X-Yahoo-SMTP: 9sPoSQ2swBBlERuQ.0vs8XLc_MeClW0- X-Rocket-Received: from laptop.qtchat.org (Scoobi_doo@174.107.139.161 with ) by smtp201.mail.ne1.yahoo.com with SMTP; 29 Jul 2013 07:36:38 -0700 PDT Message-ID: <51F67DF4.5070703@yahoo.com> Date: Mon, 29 Jul 2013 10:36:36 -0400 From: Anthony Jenkins User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130612 Thunderbird/17.0.6 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: Atheros AR9565 detected, not working References: <51F67A5E.1010603@yahoo.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "freebsd-wireless@freebsd.org" X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 14:42:13 -0000 Thanks Adrian, I've managed to fix a few things on this laptop, the remaining stuff is BIOS/ACPI related. acpi_hp(4) isn't working, has something to do with WMI. Hoping if I fix the ACPI stuff I can have me AR9565 working. I'll poke around and report back; the RFKill suggestion is a good place to start looking. Thanks, Anthony On 07/29/13 10:30, Adrian Chadd wrote: > Hm, maybe rfkill is set? > > The AR9565 is supported. I have the reference NICs from Atheros; they > work just fine. > > It may be some kind of ACPI setting to enable/disable RFKill so the > radio side is actually enabled. > > I'm sorry, I don't have much more than that to offer without having > the laptop here. > > If someone's willing to send me one, I'll get 10 + wireless working on > it and then hand it over to ixsystems to join the 'stuff we really > should get pcbsd running smoothly on' pile. They're about $500 off of > amazon.com. > > Thanks, > > > > -adrian > > On 29 July 2013 07:21, Anthony Jenkins wrote: >> I just got an HP ENVY Sleekbook 6z-1100 laptop hoping it came with a >> FreeBSD-supported wireless NIC. It has an Atheros AR9565 and looking at the >> logs it _seems_ like it should be working, but I get no network traffic. I >> haven't started the Atheros debugging procedure yet, save to compile in >> option AH_DEBUG and move ath(4) out of the kernel & to a module to >> facilitate changes. Works (of course) in Win8 which came with laptop. >> Wireless enabled LED is amber (disabled) in FreeBSD, goes from amber to >> white (enabled) when I boot the Win8 HDD. >> >> Here's various logs and misc. system info. What should I try next? Thanks >> in advance! >> >> [root@laptop /usr/src]# uname -a n >> FreeBSD laptop.qtchat.org 10.0-CURRENT FreeBSD 10.0-CURRENT #0: Sat Jul 27 >> 23:45:30 EDT 2013 root@laptop.qtchat.org:/usr/obj/usr/src/sys/MYKERNEL >> amd64 >> >> [root@laptop /usr/src]# dmesg >> Copyright (c) 1992-2013 The FreeBSD Project. >> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 >> The Regents of the University of California. All rights reserved. >> FreeBSD is a registered trademark of The FreeBSD Foundation. >> FreeBSD 10.0-CURRENT #0: Sat Jul 27 23:45:30 EDT 2013 >> root@laptop.qtchat.org:/usr/obj/usr/src/sys/MYKERNEL amd64 >> FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 >> module_register: module pci/xhci already exists! >> Module pci/xhci failed to register: 17 >> CPU: AMD A10-4655M APU with Radeon(tm) HD Graphics (1996.31-MHz K8-class >> CPU) >> Origin = "AuthenticAMD" Id = 0x610f01 Family = 0x15 Model = 0x10 >> Stepping = 1 >> Features=0x178bfbff >> Features2=0x3e98320b >> AMD Features=0x2e500800 >> AMD >> Features2=0x1abbfff,NodeId,TBM,,> >> Standard Extended Features=0x8 >> TSC: P-state invariant, performance statistics >> real memory = 17179869184 (16384 MB) >> avail memory = 15463530496 (14747 MB) >> Event timer "LAPIC" quality 400 >> ACPI APIC Table: >> FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs >> FreeBSD/SMP: 1 package(s) x 4 core(s) >> cpu0 (BSP): APIC ID: 16 >> cpu1 (AP): APIC ID: 17 >> cpu2 (AP): APIC ID: 18 >> cpu3 (AP): APIC ID: 19 >> ioapic0: Changing APIC ID to 4 >> ioapic0 irqs 0-23 on motherboard >> kbd1 at kbdmux0 >> acpi0: on motherboard >> acpi0: Power Button (fixed) >> cpu0: on acpi0 >> cpu1: on acpi0 >> cpu2: on acpi0 >> cpu3: on acpi0 >> hpet0: iomem 0xfed00000-0xfed003ff irq 0,8 on >> acpi0 >> Timecounter "HPET" frequency 14318180 Hz quality 950 >> atrtc0: port 0x70-0x71 on acpi0 >> Event timer "RTC" frequency 32768 Hz quality 0 >> attimer0: port 0x40-0x43 on acpi0 >> Timecounter "i8254" frequency 1193182 Hz quality 0 >> Event timer "i8254" frequency 1193182 Hz quality 100 >> Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 >> acpi_timer0: <32-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0 >> acpi_ec0: port 0x62,0x66 iomem >> 0xff000000-0xff000fff on acpi0 >> acpi_button0: on acpi0 >> pcib0: port 0xcf8-0xcff on acpi0 >> pci0: on pcib0 >> vgapci0: port 0x3000-0x30ff mem >> 0xe0000000-0xefffffff,0xf0300000-0xf033ffff irq 17 at device 1.0 on pci0 >> acpi_video0: on vgapci0 >> hdac0: mem 0xf0344000-0xf0347fff irq 18 at >> device 1.1 on pci0 >> hdac0: hdac_get_capabilities: Invalid corb size (0); assuming 256. >> hdac0: hdac_get_capabilities: Invalid rirb size (0); assuming 256. >> pcib1: at device 4.0 on pci0 >> pci1: on pcib1 >> pci1: at device 0.0 (no driver attached) >> re0: port >> 0x2000-0x20ff mem 0xf0004000-0xf0004fff,0xf0000000-0xf0003fff irq 16 at >> device 0.2 on pci1 >> re0: Using 1 MSI-X message >> re0: turning off MSI enable bit. >> re0: ASPM disabled >> re0: Chip rev. 0x48800000 >> re0: MAC rev. 0x00000000 >> miibus0: on re0 >> rgephy0: PHY 1 on miibus0 >> rgephy0: none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, >> 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT-FDX, 1000baseT-FDX-master, >> 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto, auto-flow >> re0: Ethernet address: 6c:3b:e5:81:21:f0 >> pcib2: at device 5.0 on pci0 >> pci2: on pcib2 >> ath0: mem 0xf0100000-0xf017ffff irq 17 at device >> 0.0 on pci2 >> ar9300_set_stub_functions: setting stub functions >> ar9300_set_stub_functions: setting stub functions >> ar9300_attach: calling ar9300_hw_attach >> ar9300_hw_attach: calling ar9300_eeprom_attach >> ar9300_flash_map: unimplemented for now >> Restoring Cal data from DRAM >> Restoring Cal data from EEPROM >> Restoring Cal data from Flash >> Restoring Cal data from Flash >> Restoring Cal data from OTP >> ar9300_hw_attach: ar9300_eeprom_attach returned 0 >> ar9300_fill_capability_info: (MCI) MCI support = 1 >> ath0: RX status length: 48 >> ath0: RX buffer size: 4096 >> ath0: TX descriptor length: 128 >> ath0: TX status length: 36 >> ath0: TX buffers per descriptor: 4 >> ar9300_freebsd_setup_x_tx_desc: called, 0x0/0, 0x0/0, 0x0/0 >> ath0: ath_edma_setup_rxfifo: type=0, FIFO depth = 16 entries >> ath0: ath_edma_setup_rxfifo: type=1, FIFO depth = 128 entries >> ath0: [HT] enabling HT modes >> ath0: [HT] enabling short-GI in 20MHz mode >> ath0: [HT] 1 stream STBC receive enabled >> ath0: [HT] 1 RX streams; 1 TX streams >> ath0: AR9565 mac 704.0 RF5110 phy 526.12 >> ath0: 2GHz radio: 0x0000; 5GHz radio: 0x0000 >> xhci0: mem 0xf0348000-0xf0349fff irq 18 >> at device 16.0 on pci0 >> usbus0: waiting for BIOS to give up control >> xhci0: 32 byte context size. >> usbus0 on xhci0 >> ahci0: port >> 0x3118-0x311f,0x3124-0x3127,0x3110-0x3117,0x3120-0x3123,0x3100-0x310f mem >> 0xf034e000-0xf034e7ff irq 19 at device 17.0 on pci0 >> ahci0: AHCI v1.30 with 1 6Gbps ports, Port Multiplier supported >> ahcich0: at channel 0 on ahci0 >> ohci0: mem 0xf034d000-0xf034dfff irq 18 at >> device 18.0 on pci0 >> usbus1 on ohci0 >> ehci0: mem 0xf034c000-0xf034c0ff irq 17 >> at device 18.2 on pci0 >> usbus2: EHCI version 1.0 >> usbus2 on ehci0 >> ohci1: mem 0xf034b000-0xf034bfff irq 18 at >> device 19.0 on pci0 >> usbus3 on ohci1 >> ehci1: mem 0xf034a000-0xf034a0ff irq 17 >> at device 19.2 on pci0 >> usbus4: EHCI version 1.0 >> usbus4 on ehci1 >> pci0: at device 20.0 (no driver attached) >> hdac1: mem 0xf0340000-0xf0343fff irq >> 16 at device 20.2 on pci0 >> isab0: at device 20.3 on pci0 >> isa0: on isab0 >> pcib3: at device 20.4 on pci0 >> pci3: on pcib3 >> acpi_lid0: on acpi0 >> acpi_tz0: on acpi0 >> acpi_tz0: _CRT value is absurd, ignored (226.8C) >> atkbdc0: port 0x60,0x64 irq 1 on acpi0 >> atkbd0: irq 1 on atkbdc0 >> kbd0 at atkbd0 >> atkbd0: [GIANT-LOCKED] >> psm0: irq 12 on atkbdc0 >> psm0: [GIANT-LOCKED] >> psm0: model Synaptics Touchpad, device ID 0 >> battery0: on acpi0 >> acpi_acad0: on acpi0 >> sc0: at flags 0x100 on isa0 >> sc0: VGA <16 virtual consoles, flags=0x300> >> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 >> ctl: CAM Target Layer loaded >> acpi_throttle0: on cpu0 >> acpi_throttle1: on cpu1 >> acpi_throttle1: failed to attach P_CNT >> device_attach: acpi_throttle1 attach returned 6 >> acpi_throttle2: on cpu2 >> acpi_throttle2: failed to attach P_CNT >> device_attach: acpi_throttle2 attach returned 6 >> acpi_throttle3: on cpu3 >> acpi_throttle3: failed to attach P_CNT >> device_attach: acpi_throttle3 attach returned 6 >> ZFS filesystem version: 5 >> ZFS storage pool version: features support (5000) >> Timecounters tick every 1.000 msec >> hdacc0: at cad 0 on hdac0 >> hdaa0: at nid 1 on hdacc0 >> pcm0: at nid 3 on hdaa0 >> hdacc1: at cad 0 on hdac1 >> hdaa1: at nid 1 on hdacc1 >> pcm1: at nid 13,11 and 12 on hdaa1 >> pcm2: at nid 17 on hdaa1 >> usbus0: 5.0Gbps Super Speed USB v3.0 >> usbus1: 12Mbps Full Speed USB v1.0 >> usbus2: 480Mbps High Speed USB v2.0 >> usbus3: 12Mbps Full Speed USB v1.0 >> usbus4: 480Mbps High Speed USB v2.0 >> ugen3.1: at usbus3 >> uhub0: on usbus3 >> ugen2.1: at usbus2 >> uhub1: on usbus2 >> ugen1.1: at usbus1 >> uhub2: on usbus1 >> ugen0.1: <0x1022> at usbus0 >> uhub3: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0 >> ugen4.1: at usbus4 >> uhub4: on usbus4 >> ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 >> ada0: ATA-9 SATA 3.x device >> ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes) >> ada0: Command Queueing enabled >> ada0: 238475MB (488397168 512 byte sectors: 16H 63S/T 16383C) >> ada0: Previously was known as ad4 >> SMP: AP CPU #3 Launched! >> SMP: AP CPU #1 Launched! >> SMP: AP CPU #2 Launched! >> Timecounter "TSC" frequency 1996309068 Hz quality 1000 >> Root mount waiting for: usbus4 usbus3 usbus2 usbus1 usbus0 >> uhub0: 5 ports with 5 removable, self powered >> uhub2: 5 ports with 5 removable, self powered >> ACPI Error: No handler for Region [RCM0] (0xfffffe0026ac6b00) [SystemCMOS] >> (20130626/evregion-178) >> ACPI Error: Region SystemCMOS (ID=5) has no handler (20130626/exfldio-320) >> ACPI Error: Method parse/execution failed [\134_SB_.WMID.ESDT] (Node >> 0xfffffe0026adac40), AE_NOT_EXIST (20130626/psparse-553) >> ACPI Error: Method parse/execution failed [\134_SB_.PCI0.LPC0.EC0_._Q42] >> (Node 0xfffffe0026ae8340), AE_NOT_EXIST (20130626/psparse-553) >> acpi_ec0: evaluation of query method _Q42 failed: AE_NOT_EXIST >> uhub3: 4 ports with 4 removable, self powered >> Root mount waiting for: usbus4 usbus2 >> uhub1: 5 ports with 5 removable, self powered >> uhub4: 5 ports with 5 removable, self powered >> Root mount waiting for: usbus4 usbus2 >> ugen2.2: at usbus2 >> ugen4.2: at usbus4 >> Trying to mount root from zfs:sys []... >> can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND >> can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND >> ugen3.2: at usbus3 >> ar9300_Stub_GetCTSTimeout: called >> ar9300_Stub_GetCTSTimeout: called >> ar9300_Stub_GetAntennaSwitch: called >> ar9300_Stub_GetAntennaSwitch: called >> wlan1: Ethernet address: 20:68:9d:c5:76:8d >> run0: on usbus2 >> run0: MAC/BBP RT3071 (rev 0x0213), RF RT3022 (MIMO 2T2R), address >> 1c:bd:b9:8c:9d:71 >> ubt0: on >> usbus3 >> wlan0: Ethernet address: 1c:bd:b9:8c:9d:71 >> run0: firmware RT3071 ver. 0.236 loaded >> WARNING: attempt to domain_add(bluetooth) after domainfinalize() >> WARNING: attempt to domain_add(netgraph) after domainfinalize() >> can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND >> can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND >> WARNING pid 2654 (python2.7): ioctl sign-extension ioctl ffffffff80087467 >> WARNING pid 2655 (python2.7): ioctl sign-extension ioctl ffffffff80087467 >> WARNING pid 2656 (python2.7): ioctl sign-extension ioctl ffffffff80087467 >> wlan0: Ethernet address: 1c:bd:b9:8c:9d:71 >> run0: firmware RT3071 ver. 0.236 loaded >> wlan0: link state changed to UP >> can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND >> uhub3: at usbus0, port 1, addr 1 (disconnected) >> uhub2: at usbus1, port 1, addr 1 (disconnected) >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> uhub1: at usbus2, port 1, addr 1 (disconnected) >> ugen2.2: at usbus2 (disconnected) >> run0: at uhub1, port 1, addr 2 (disconnected) >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> wlan0: link state changed to DOWN >> uhub0: at usbus3, port 1, addr 1 (disconnected) >> ugen3.2: at usbus3 (disconnected) >> ubt0: at uhub0, port 4, addr 2 (disconnected) >> xhci_interrupt: host controller halted >> xhci_interrupt: host controller halted >> uhub4: at usbus4, port 1, addr 1 (disconnected) >> ugen4.2: at usbus4 (disconnected) >> ACPI Error: No handler for Region [RCM0] (0xfffffe0026ac6b00) [SystemCMOS] >> (20130626/evregion-178) >> ACPI Error: Region SystemCMOS (ID=5) has no handler (20130626/exfldio-320) >> ACPI Error: Method parse/execution failed [\134_SB_.WMID.ESDT] (Node >> 0xfffffe0026adac40), AE_NOT_EXIST (20130626/psparse-553) >> ACPI Error: Method parse/execution failed [\134_PTS] (Node >> 0xfffffe0026ab4c80), AE_NOT_EXIST (20130626/psparse-553) >> acpi0: AcpiEnterSleepStatePrep failed - AE_NOT_EXIST >> can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND >> xhci0: 32 byte context size. >> uhub0: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0 >> uhub1: on usbus2 >> uhub2: on usbus4 >> uhub3: on usbus3 >> uhub4: on usbus1 >> uhub0: 4 ports with 4 removable, self powered >> uhub4: 5 ports with 5 removable, self powered >> uhub3: 5 ports with 5 removable, self powered >> uhub1: 5 ports with 5 removable, self powered >> uhub2: 5 ports with 5 removable, self powered >> ugen2.2: at usbus2 >> run0: on usbus2 >> ugen4.2: at usbus4 >> run0: MAC/BBP RT3071 (rev 0x0213), RF RT3022 (MIMO 2T2R), address >> 1c:bd:b9:8c:9d:71 >> wlan0: Ethernet address: 1c:bd:b9:8c:9d:71 >> run0: firmware RT3071 ver. 0.236 loaded >> ugen3.2: at usbus3 >> ubt0: on >> usbus3 >> wlan0: link state changed to UP >> can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND >> >> [root@laptop /usr/src]# cat /etc/rc.conf >> wlans_run0="wlan0" >> wlans_ath0="wlan1" >> ifconfig_wlan0="DHCP WPA" >> ... >> >> [root@laptop /usr/src]# ifconfig -a >> ath0: flags=8802 metric 0 mtu 2290 >> ether 20:68:9d:c5:76:8d >> nd6 options=29 >> media: IEEE 802.11 Wireless Ethernet autoselect (autoselect) >> status: no carrier >> wlan1: flags=8802 metric 0 mtu 1500 >> ether 20:68:9d:c5:76:8d >> nd6 options=29 >> media: IEEE 802.11 Wireless Ethernet autoselect (autoselect) >> status: no carrier >> ssid "" channel 1 (2412 MHz 11b) >> regdomain 106 indoor ecm authmode OPEN privacy OFF txpower 20 bmiss 7 >> scanvalid 60 wme burst bintval 0 >> ... >> >> [root@laptop /usr/src]# /etc/rc.d/netif start ath0 >> Starting Network: ath0. >> ath0: flags=8843 metric 0 mtu 2290 >> ether 20:68:9d:c5:76:8d >> nd6 options=29 >> media: IEEE 802.11 Wireless Ethernet autoselect mode 11g >> status: associated >> Additional inet routing options: ignore ICMP redirect=YES log ICMP >> redirect=YES. >> >> [root@laptop /usr/src]# for iface in ath0 wlan1; do ifconfig ${iface}; done >> ath0: flags=8843 metric 0 mtu 2290 >> ether 20:68:9d:c5:76:8d >> nd6 options=29 >> media: IEEE 802.11 Wireless Ethernet autoselect mode 11g >> status: associated >> wlan1: flags=8843 metric 0 mtu 1500 >> ether 20:68:9d:c5:76:8d >> inet 67.215.65.145 netmask 0xff000000 broadcast 67.215.65.145 >> nd6 options=29 >> media: IEEE 802.11 Wireless Ethernet autoselect (autoselect) >> status: no carrier >> ssid "" channel 2 (2417 MHz 11g) >> regdomain 106 indoor ecm authmode OPEN privacy OFF txpower 20 bmiss 7 >> scanvalid 60 protmode CTS wme burst >> >> [root@laptop /usr/src]# dmesg >> ... >> ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping >> ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping >> ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping >> ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping >> ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping >> ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping >> >> >> -- >> Anthony Jenkins >> _______________________________________________ >> 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" -- Anthony Jenkins From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 14:44:46 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AA0DA552 for ; Mon, 29 Jul 2013 14:44:46 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x22f.google.com (mail-wg0-x22f.google.com [IPv6:2a00:1450:400c:c00::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2C7FF2B50 for ; Mon, 29 Jul 2013 14:44:46 +0000 (UTC) Received: by mail-wg0-f47.google.com with SMTP id j13so5039520wgh.14 for ; Mon, 29 Jul 2013 07:44:44 -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; bh=zu5kwinJHOZjXli675UEzBhHaWHeelI9pdnWlPkgKms=; b=iGcgQkZ8zmbv/UEby72I+b/NCDQp1ZN9N7riVPXTVjjdWdmA57DCuOkk46mGtVub8D 11kxGEKYTggJ0NHboNXlrotr++8EuIffGMgnQJxu9wNj+jSN+6cofFY3PcSsfyBWzrZQ iLIJJgKeUM+ECsAVpfw3RIkKhMV3zQflY4OA73NrrQCNz+TcFbXIUwKnNJiop7dra8Nz rzQ57AmSI0ZrGpg3THbcJnyjbQ4iQwYhKch8YIj6YUxZsXQWD3ym3Mv5MU0HAORFcyv3 QRvVX4cyVF+GpgcTvvtuIRY/DOLjfMQZED4Z7t+CCDzvqoHFLuxmsJCeCi53Qb76mcj7 CJBw== MIME-Version: 1.0 X-Received: by 10.194.203.73 with SMTP id ko9mr4472002wjc.79.1375109084309; Mon, 29 Jul 2013 07:44:44 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Mon, 29 Jul 2013 07:44:44 -0700 (PDT) In-Reply-To: <51F67DF4.5070703@yahoo.com> References: <51F67A5E.1010603@yahoo.com> <51F67DF4.5070703@yahoo.com> Date: Mon, 29 Jul 2013 07:44:44 -0700 X-Google-Sender-Auth: 6TqeM0Q5KMQwFu3DaZi312zuZJo Message-ID: Subject: Re: Atheros AR9565 detected, not working From: Adrian Chadd To: Anthony Jenkins Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-wireless@freebsd.org" X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 14:44:46 -0000 Cool, thanks. Please make sure you post patches for all the things you fix. I'd love to see this kind of thing work out of the box. :) -adrian On 29 July 2013 07:36, Anthony Jenkins wrote: > Thanks Adrian, > > I've managed to fix a few things on this laptop, the remaining stuff is > BIOS/ACPI related. acpi_hp(4) isn't working, has something to do with WMI. > Hoping if I fix the ACPI stuff I can have me AR9565 working. I'll poke > around and report back; the RFKill suggestion is a good place to start > looking. > > Thanks, > Anthony > > > On 07/29/13 10:30, Adrian Chadd wrote: >> >> Hm, maybe rfkill is set? >> >> The AR9565 is supported. I have the reference NICs from Atheros; they >> work just fine. >> >> It may be some kind of ACPI setting to enable/disable RFKill so the >> radio side is actually enabled. >> >> I'm sorry, I don't have much more than that to offer without having >> the laptop here. >> >> If someone's willing to send me one, I'll get 10 + wireless working on >> it and then hand it over to ixsystems to join the 'stuff we really >> should get pcbsd running smoothly on' pile. They're about $500 off of >> amazon.com. >> >> Thanks, >> >> >> >> -adrian >> >> On 29 July 2013 07:21, Anthony Jenkins wrote: >>> >>> I just got an HP ENVY Sleekbook 6z-1100 laptop hoping it came with a >>> FreeBSD-supported wireless NIC. It has an Atheros AR9565 and looking at >>> the >>> logs it _seems_ like it should be working, but I get no network traffic. >>> I >>> haven't started the Atheros debugging procedure yet, save to compile in >>> option AH_DEBUG and move ath(4) out of the kernel & to a module to >>> facilitate changes. Works (of course) in Win8 which came with laptop. >>> Wireless enabled LED is amber (disabled) in FreeBSD, goes from amber to >>> white (enabled) when I boot the Win8 HDD. >>> >>> Here's various logs and misc. system info. What should I try next? >>> Thanks >>> in advance! >>> >>> [root@laptop /usr/src]# uname -a n >>> FreeBSD laptop.qtchat.org 10.0-CURRENT FreeBSD 10.0-CURRENT #0: Sat Jul >>> 27 >>> 23:45:30 EDT 2013 root@laptop.qtchat.org:/usr/obj/usr/src/sys/MYKERNEL >>> amd64 >>> >>> [root@laptop /usr/src]# dmesg >>> Copyright (c) 1992-2013 The FreeBSD Project. >>> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 >>> The Regents of the University of California. All rights reserved. >>> FreeBSD is a registered trademark of The FreeBSD Foundation. >>> FreeBSD 10.0-CURRENT #0: Sat Jul 27 23:45:30 EDT 2013 >>> root@laptop.qtchat.org:/usr/obj/usr/src/sys/MYKERNEL amd64 >>> FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 >>> module_register: module pci/xhci already exists! >>> Module pci/xhci failed to register: 17 >>> CPU: AMD A10-4655M APU with Radeon(tm) HD Graphics (1996.31-MHz >>> K8-class >>> CPU) >>> Origin = "AuthenticAMD" Id = 0x610f01 Family = 0x15 Model = 0x10 >>> Stepping = 1 >>> >>> Features=0x178bfbff >>> >>> Features2=0x3e98320b >>> AMD Features=0x2e500800 >>> AMD >>> >>> Features2=0x1abbfff,NodeId,TBM,,> >>> Standard Extended Features=0x8 >>> TSC: P-state invariant, performance statistics >>> real memory = 17179869184 (16384 MB) >>> avail memory = 15463530496 (14747 MB) >>> Event timer "LAPIC" quality 400 >>> ACPI APIC Table: >>> FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs >>> FreeBSD/SMP: 1 package(s) x 4 core(s) >>> cpu0 (BSP): APIC ID: 16 >>> cpu1 (AP): APIC ID: 17 >>> cpu2 (AP): APIC ID: 18 >>> cpu3 (AP): APIC ID: 19 >>> ioapic0: Changing APIC ID to 4 >>> ioapic0 irqs 0-23 on motherboard >>> kbd1 at kbdmux0 >>> acpi0: on motherboard >>> acpi0: Power Button (fixed) >>> cpu0: on acpi0 >>> cpu1: on acpi0 >>> cpu2: on acpi0 >>> cpu3: on acpi0 >>> hpet0: iomem 0xfed00000-0xfed003ff irq 0,8 >>> on >>> acpi0 >>> Timecounter "HPET" frequency 14318180 Hz quality 950 >>> atrtc0: port 0x70-0x71 on acpi0 >>> Event timer "RTC" frequency 32768 Hz quality 0 >>> attimer0: port 0x40-0x43 on acpi0 >>> Timecounter "i8254" frequency 1193182 Hz quality 0 >>> Event timer "i8254" frequency 1193182 Hz quality 100 >>> Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 >>> acpi_timer0: <32-bit timer at 3.579545MHz> port 0x408-0x40b on acpi0 >>> acpi_ec0: port 0x62,0x66 iomem >>> 0xff000000-0xff000fff on acpi0 >>> acpi_button0: on acpi0 >>> pcib0: port 0xcf8-0xcff on acpi0 >>> pci0: on pcib0 >>> vgapci0: port 0x3000-0x30ff mem >>> 0xe0000000-0xefffffff,0xf0300000-0xf033ffff irq 17 at device 1.0 on pci0 >>> acpi_video0: on vgapci0 >>> hdac0: mem 0xf0344000-0xf0347fff irq 18 at >>> device 1.1 on pci0 >>> hdac0: hdac_get_capabilities: Invalid corb size (0); assuming 256. >>> hdac0: hdac_get_capabilities: Invalid rirb size (0); assuming 256. >>> pcib1: at device 4.0 on pci0 >>> pci1: on pcib1 >>> pci1: at device 0.0 (no driver attached) >>> re0: port >>> 0x2000-0x20ff mem 0xf0004000-0xf0004fff,0xf0000000-0xf0003fff irq 16 at >>> device 0.2 on pci1 >>> re0: Using 1 MSI-X message >>> re0: turning off MSI enable bit. >>> re0: ASPM disabled >>> re0: Chip rev. 0x48800000 >>> re0: MAC rev. 0x00000000 >>> miibus0: on re0 >>> rgephy0: PHY 1 on >>> miibus0 >>> rgephy0: none, 10baseT, 10baseT-FDX, 10baseT-FDX-flow, 100baseTX, >>> 100baseTX-FDX, 100baseTX-FDX-flow, 1000baseT-FDX, 1000baseT-FDX-master, >>> 1000baseT-FDX-flow, 1000baseT-FDX-flow-master, auto, auto-flow >>> re0: Ethernet address: 6c:3b:e5:81:21:f0 >>> pcib2: at device 5.0 on pci0 >>> pci2: on pcib2 >>> ath0: mem 0xf0100000-0xf017ffff irq 17 at >>> device >>> 0.0 on pci2 >>> ar9300_set_stub_functions: setting stub functions >>> ar9300_set_stub_functions: setting stub functions >>> ar9300_attach: calling ar9300_hw_attach >>> ar9300_hw_attach: calling ar9300_eeprom_attach >>> ar9300_flash_map: unimplemented for now >>> Restoring Cal data from DRAM >>> Restoring Cal data from EEPROM >>> Restoring Cal data from Flash >>> Restoring Cal data from Flash >>> Restoring Cal data from OTP >>> ar9300_hw_attach: ar9300_eeprom_attach returned 0 >>> ar9300_fill_capability_info: (MCI) MCI support = 1 >>> ath0: RX status length: 48 >>> ath0: RX buffer size: 4096 >>> ath0: TX descriptor length: 128 >>> ath0: TX status length: 36 >>> ath0: TX buffers per descriptor: 4 >>> ar9300_freebsd_setup_x_tx_desc: called, 0x0/0, 0x0/0, 0x0/0 >>> ath0: ath_edma_setup_rxfifo: type=0, FIFO depth = 16 entries >>> ath0: ath_edma_setup_rxfifo: type=1, FIFO depth = 128 entries >>> ath0: [HT] enabling HT modes >>> ath0: [HT] enabling short-GI in 20MHz mode >>> ath0: [HT] 1 stream STBC receive enabled >>> ath0: [HT] 1 RX streams; 1 TX streams >>> ath0: AR9565 mac 704.0 RF5110 phy 526.12 >>> ath0: 2GHz radio: 0x0000; 5GHz radio: 0x0000 >>> xhci0: mem 0xf0348000-0xf0349fff irq >>> 18 >>> at device 16.0 on pci0 >>> usbus0: waiting for BIOS to give up control >>> xhci0: 32 byte context size. >>> usbus0 on xhci0 >>> ahci0: port >>> 0x3118-0x311f,0x3124-0x3127,0x3110-0x3117,0x3120-0x3123,0x3100-0x310f mem >>> 0xf034e000-0xf034e7ff irq 19 at device 17.0 on pci0 >>> ahci0: AHCI v1.30 with 1 6Gbps ports, Port Multiplier supported >>> ahcich0: at channel 0 on ahci0 >>> ohci0: mem 0xf034d000-0xf034dfff irq 18 >>> at >>> device 18.0 on pci0 >>> usbus1 on ohci0 >>> ehci0: mem 0xf034c000-0xf034c0ff irq >>> 17 >>> at device 18.2 on pci0 >>> usbus2: EHCI version 1.0 >>> usbus2 on ehci0 >>> ohci1: mem 0xf034b000-0xf034bfff irq 18 >>> at >>> device 19.0 on pci0 >>> usbus3 on ohci1 >>> ehci1: mem 0xf034a000-0xf034a0ff irq >>> 17 >>> at device 19.2 on pci0 >>> usbus4: EHCI version 1.0 >>> usbus4 on ehci1 >>> pci0: at device 20.0 (no driver attached) >>> hdac1: mem 0xf0340000-0xf0343fff >>> irq >>> 16 at device 20.2 on pci0 >>> isab0: at device 20.3 on pci0 >>> isa0: on isab0 >>> pcib3: at device 20.4 on pci0 >>> pci3: on pcib3 >>> acpi_lid0: on acpi0 >>> acpi_tz0: on acpi0 >>> acpi_tz0: _CRT value is absurd, ignored (226.8C) >>> atkbdc0: port 0x60,0x64 irq 1 on acpi0 >>> atkbd0: irq 1 on atkbdc0 >>> kbd0 at atkbd0 >>> atkbd0: [GIANT-LOCKED] >>> psm0: irq 12 on atkbdc0 >>> psm0: [GIANT-LOCKED] >>> psm0: model Synaptics Touchpad, device ID 0 >>> battery0: on acpi0 >>> acpi_acad0: on acpi0 >>> sc0: at flags 0x100 on isa0 >>> sc0: VGA <16 virtual consoles, flags=0x300> >>> vga0: at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 >>> ctl: CAM Target Layer loaded >>> acpi_throttle0: on cpu0 >>> acpi_throttle1: on cpu1 >>> acpi_throttle1: failed to attach P_CNT >>> device_attach: acpi_throttle1 attach returned 6 >>> acpi_throttle2: on cpu2 >>> acpi_throttle2: failed to attach P_CNT >>> device_attach: acpi_throttle2 attach returned 6 >>> acpi_throttle3: on cpu3 >>> acpi_throttle3: failed to attach P_CNT >>> device_attach: acpi_throttle3 attach returned 6 >>> ZFS filesystem version: 5 >>> ZFS storage pool version: features support (5000) >>> Timecounters tick every 1.000 msec >>> hdacc0: at cad 0 on hdac0 >>> hdaa0: at nid 1 on hdacc0 >>> pcm0: at nid 3 on hdaa0 >>> hdacc1: at cad 0 on hdac1 >>> hdaa1: at nid 1 on hdacc1 >>> pcm1: at nid 13,11 and 12 on hdaa1 >>> pcm2: at nid 17 on hdaa1 >>> usbus0: 5.0Gbps Super Speed USB v3.0 >>> usbus1: 12Mbps Full Speed USB v1.0 >>> usbus2: 480Mbps High Speed USB v2.0 >>> usbus3: 12Mbps Full Speed USB v1.0 >>> usbus4: 480Mbps High Speed USB v2.0 >>> ugen3.1: at usbus3 >>> uhub0: on usbus3 >>> ugen2.1: at usbus2 >>> uhub1: on usbus2 >>> ugen1.1: at usbus1 >>> uhub2: on usbus1 >>> ugen0.1: <0x1022> at usbus0 >>> uhub3: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0 >>> ugen4.1: at usbus4 >>> uhub4: on usbus4 >>> ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 >>> ada0: ATA-9 SATA 3.x device >>> ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 8192bytes) >>> ada0: Command Queueing enabled >>> ada0: 238475MB (488397168 512 byte sectors: 16H 63S/T 16383C) >>> ada0: Previously was known as ad4 >>> SMP: AP CPU #3 Launched! >>> SMP: AP CPU #1 Launched! >>> SMP: AP CPU #2 Launched! >>> Timecounter "TSC" frequency 1996309068 Hz quality 1000 >>> Root mount waiting for: usbus4 usbus3 usbus2 usbus1 usbus0 >>> uhub0: 5 ports with 5 removable, self powered >>> uhub2: 5 ports with 5 removable, self powered >>> ACPI Error: No handler for Region [RCM0] (0xfffffe0026ac6b00) >>> [SystemCMOS] >>> (20130626/evregion-178) >>> ACPI Error: Region SystemCMOS (ID=5) has no handler >>> (20130626/exfldio-320) >>> ACPI Error: Method parse/execution failed [\134_SB_.WMID.ESDT] (Node >>> 0xfffffe0026adac40), AE_NOT_EXIST (20130626/psparse-553) >>> ACPI Error: Method parse/execution failed [\134_SB_.PCI0.LPC0.EC0_._Q42] >>> (Node 0xfffffe0026ae8340), AE_NOT_EXIST (20130626/psparse-553) >>> acpi_ec0: evaluation of query method _Q42 failed: AE_NOT_EXIST >>> uhub3: 4 ports with 4 removable, self powered >>> Root mount waiting for: usbus4 usbus2 >>> uhub1: 5 ports with 5 removable, self powered >>> uhub4: 5 ports with 5 removable, self powered >>> Root mount waiting for: usbus4 usbus2 >>> ugen2.2: at usbus2 >>> ugen4.2: at usbus4 >>> Trying to mount root from zfs:sys []... >>> can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND >>> can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND >>> ugen3.2: at usbus3 >>> ar9300_Stub_GetCTSTimeout: called >>> ar9300_Stub_GetCTSTimeout: called >>> ar9300_Stub_GetAntennaSwitch: called >>> ar9300_Stub_GetAntennaSwitch: called >>> wlan1: Ethernet address: 20:68:9d:c5:76:8d >>> run0: on usbus2 >>> run0: MAC/BBP RT3071 (rev 0x0213), RF RT3022 (MIMO 2T2R), address >>> 1c:bd:b9:8c:9d:71 >>> ubt0: >>> on >>> usbus3 >>> wlan0: Ethernet address: 1c:bd:b9:8c:9d:71 >>> run0: firmware RT3071 ver. 0.236 loaded >>> WARNING: attempt to domain_add(bluetooth) after domainfinalize() >>> WARNING: attempt to domain_add(netgraph) after domainfinalize() >>> can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND >>> can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND >>> WARNING pid 2654 (python2.7): ioctl sign-extension ioctl ffffffff80087467 >>> WARNING pid 2655 (python2.7): ioctl sign-extension ioctl ffffffff80087467 >>> WARNING pid 2656 (python2.7): ioctl sign-extension ioctl ffffffff80087467 >>> wlan0: Ethernet address: 1c:bd:b9:8c:9d:71 >>> run0: firmware RT3071 ver. 0.236 loaded >>> wlan0: link state changed to UP >>> can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND >>> uhub3: at usbus0, port 1, addr 1 (disconnected) >>> uhub2: at usbus1, port 1, addr 1 (disconnected) >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> uhub1: at usbus2, port 1, addr 1 (disconnected) >>> ugen2.2: at usbus2 (disconnected) >>> run0: at uhub1, port 1, addr 2 (disconnected) >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> wlan0: link state changed to DOWN >>> uhub0: at usbus3, port 1, addr 1 (disconnected) >>> ugen3.2: at usbus3 (disconnected) >>> ubt0: at uhub0, port 4, addr 2 (disconnected) >>> xhci_interrupt: host controller halted >>> xhci_interrupt: host controller halted >>> uhub4: at usbus4, port 1, addr 1 (disconnected) >>> ugen4.2: at usbus4 (disconnected) >>> ACPI Error: No handler for Region [RCM0] (0xfffffe0026ac6b00) >>> [SystemCMOS] >>> (20130626/evregion-178) >>> ACPI Error: Region SystemCMOS (ID=5) has no handler >>> (20130626/exfldio-320) >>> ACPI Error: Method parse/execution failed [\134_SB_.WMID.ESDT] (Node >>> 0xfffffe0026adac40), AE_NOT_EXIST (20130626/psparse-553) >>> ACPI Error: Method parse/execution failed [\134_PTS] (Node >>> 0xfffffe0026ab4c80), AE_NOT_EXIST (20130626/psparse-553) >>> acpi0: AcpiEnterSleepStatePrep failed - AE_NOT_EXIST >>> can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND >>> xhci0: 32 byte context size. >>> uhub0: <0x1022 XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0 >>> uhub1: on usbus2 >>> uhub2: on usbus4 >>> uhub3: on usbus3 >>> uhub4: on usbus1 >>> uhub0: 4 ports with 4 removable, self powered >>> uhub4: 5 ports with 5 removable, self powered >>> uhub3: 5 ports with 5 removable, self powered >>> uhub1: 5 ports with 5 removable, self powered >>> uhub2: 5 ports with 5 removable, self powered >>> ugen2.2: at usbus2 >>> run0: on usbus2 >>> ugen4.2: at usbus4 >>> run0: MAC/BBP RT3071 (rev 0x0213), RF RT3022 (MIMO 2T2R), address >>> 1c:bd:b9:8c:9d:71 >>> wlan0: Ethernet address: 1c:bd:b9:8c:9d:71 >>> run0: firmware RT3071 ver. 0.236 loaded >>> ugen3.2: at usbus3 >>> ubt0: >>> on >>> usbus3 >>> wlan0: link state changed to UP >>> can't evaluate \134_SB_.PCI0.VGA_.LCD_._DCS - AE_NOT_FOUND >>> >>> [root@laptop /usr/src]# cat /etc/rc.conf >>> wlans_run0="wlan0" >>> wlans_ath0="wlan1" >>> ifconfig_wlan0="DHCP WPA" >>> ... >>> >>> [root@laptop /usr/src]# ifconfig -a >>> ath0: flags=8802 metric 0 mtu 2290 >>> ether 20:68:9d:c5:76:8d >>> nd6 options=29 >>> media: IEEE 802.11 Wireless Ethernet autoselect (autoselect) >>> status: no carrier >>> wlan1: flags=8802 metric 0 mtu 1500 >>> ether 20:68:9d:c5:76:8d >>> nd6 options=29 >>> media: IEEE 802.11 Wireless Ethernet autoselect (autoselect) >>> status: no carrier >>> ssid "" channel 1 (2412 MHz 11b) >>> regdomain 106 indoor ecm authmode OPEN privacy OFF txpower 20 bmiss >>> 7 >>> scanvalid 60 wme burst bintval 0 >>> ... >>> >>> [root@laptop /usr/src]# /etc/rc.d/netif start ath0 >>> Starting Network: ath0. >>> ath0: flags=8843 metric 0 mtu >>> 2290 >>> ether 20:68:9d:c5:76:8d >>> nd6 options=29 >>> media: IEEE 802.11 Wireless Ethernet autoselect mode 11g >>> status: associated >>> Additional inet routing options: ignore ICMP redirect=YES log ICMP >>> redirect=YES. >>> >>> [root@laptop /usr/src]# for iface in ath0 wlan1; do ifconfig ${iface}; >>> done >>> ath0: flags=8843 metric 0 mtu >>> 2290 >>> ether 20:68:9d:c5:76:8d >>> nd6 options=29 >>> media: IEEE 802.11 Wireless Ethernet autoselect mode 11g >>> status: associated >>> wlan1: flags=8843 metric 0 mtu >>> 1500 >>> ether 20:68:9d:c5:76:8d >>> inet 67.215.65.145 netmask 0xff000000 broadcast 67.215.65.145 >>> nd6 options=29 >>> media: IEEE 802.11 Wireless Ethernet autoselect (autoselect) >>> status: no carrier >>> ssid "" channel 2 (2417 MHz 11g) >>> regdomain 106 indoor ecm authmode OPEN privacy OFF txpower 20 bmiss >>> 7 >>> scanvalid 60 protmode CTS wme burst >>> >>> [root@laptop /usr/src]# dmesg >>> ... >>> ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping >>> ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping >>> ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping >>> ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping >>> ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping >>> ath0: ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping >>> >>> >>> -- >>> Anthony Jenkins >>> _______________________________________________ >>> 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" > > > > -- > Anthony Jenkins From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 15:00:08 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8A03FBD0 for ; Mon, 29 Jul 2013 15:00:08 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 58BF82C50 for ; Mon, 29 Jul 2013 15:00:08 +0000 (UTC) Received: by mail-pd0-f176.google.com with SMTP id q10so2382883pdj.35 for ; Mon, 29 Jul 2013 08:00:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=/2GrrONhHpRxqzZJzTZ3b8Zgtqq5e6SITrAppwxThDo=; b=b2TOTVJAe8iVWPPd+/URhcQMB2VCqO3xW01kn6/WmTDvh9mQ5jyMc7wIQzGyWtWjUn xW+BG/qK0MAbnHhTxP0iSNWgp2bqvN2mQ9djT/x+Vy5AXD1RZ/7H+M/lynP/dRSqrrrZ imxtgIPicyFIhxDWsnuAj4vNi7qjmJeS9eB9IzuX3tvXG0K3PRfjuHsAYe3HFQoYsOxZ ipE4FAlMrOJv786wPKCBXGi+a7WNGMrLViSasX0Nfs/jJ4m246NzeWfM7QhoC6ttzARb PzLCwOsYhp/VAUh+qsZ3ZusPXoWDfJCumo2ncVbnyq9ExqkxKvOTJ6+nbPdt7dB9DLzg 4BQg== X-Received: by 10.68.232.225 with SMTP id tr1mr67434098pbc.143.1375110001910; Mon, 29 Jul 2013 08:00:01 -0700 (PDT) Received: from 53.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id qf7sm335819pac.14.2013.07.29.07.59.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Jul 2013 08:00:00 -0700 (PDT) Sender: Warner Losh Subject: Re: My WLI-UC-GNM up crash Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <51F4F3E9.9010605@bitfrost.no> Date: Mon, 29 Jul 2013 08:59:58 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <1374573600-2351360719.d37ada5f86@bliksem.vehosting.nl> <201307231220.52817.Daan@vitsch.nl> <51F4F3E9.9010605@bitfrost.no> To: Hans Petter Selasky X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQlwVqsJIj+nLrlX2VHdsyWNDJ8veQJgANt247YgRjXOuYyj1YW3lxstlXfc/kDudO4zWMTw Cc: freebsd-wireless@freebsd.org, freebsd-arm X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 15:00:08 -0000 The __aligned(8) likely isn't going to do anything. It says that you are = guaranteeing to the compiler that you'll only ever allocate / cast = pointers to this data type on a 8-byte boundary. __packed might help, = but likely won't because that's for on-wire things and anything thing = that wasn't already not marked packed that should be would already be = broken, but broken giving bad data, not broken segfaulting. __aligned(1) is what you want. But that has other performance = problems... Warner On Jul 28, 2013, at 4:35 AM, Hans Petter Selasky wrote: > Hi, >=20 > Can you try the attached patch? >=20 > --HPS > _______________________________________________ > freebsd-arm@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 15:04:00 2013 Return-Path: Delivered-To: freebsd-wireless@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 6D04FC78 for ; Mon, 29 Jul 2013 15:04:00 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3C0252C82 for ; Mon, 29 Jul 2013 15:03:59 +0000 (UTC) Received: by mail-pd0-f174.google.com with SMTP id 3so4480922pdj.5 for ; Mon, 29 Jul 2013 08:03:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=xVhn9v4RdYHjQypyzbGU/JLoRZ4aa2B2fCcf9I8I7VY=; b=E9tlrHa1pTq5qdeEPHceWld6Z4nlx/DxzQOvQ7AlPN7VLIsocMNjlDNFSgE7LMbfvb NsaA51Q3SWhqfvuUc9CGr0Fexvm/49tF20In6iH5QswaGhvQvySoklchDM5vY8btd8Wc wzZErzCTWowcyt7z5iEGD3d03ZzOJXBlK46BhEbr5Fb3IfB+PDZyzgEzE7jgOfou59u/ uJX9PW6vQQfLqmEAz8n2O75CexkAGA+IxfThxfNSPv9YGfaqgpDXG0NJbM/1iHSaMQcN yyFE4qv6umGjsu8uDk8qbkz4hXn6CWIFZhpFy3jmV/8O2lEvGpEa3XUNY86On2PvU+ak Hh2w== X-Received: by 10.66.162.195 with SMTP id yc3mr23076862pab.64.1375110231467; Mon, 29 Jul 2013 08:03:51 -0700 (PDT) Received: from 53.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id py4sm77477752pbc.14.2013.07.29.08.03.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Jul 2013 08:03:50 -0700 (PDT) Sender: Warner Losh Subject: Re: My WLI-UC-GNM up crash Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Mon, 29 Jul 2013 09:03:48 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <8AFE4FCA-BCAA-460C-ABFE-EC7FC2991B8C@bsdimp.com> References: <1374573600-2351360719.d37ada5f86@bliksem.vehosting.nl> <201307231220.52817.Daan@vitsch.nl> <51F4F3E9.9010605@bitfrost.no> To: Adrian Chadd X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQnUZZwqGKvFiChu5S/fgGP+gjF1kxW5AnJVYzSQ48y7+lMzaUmtJ8oZDkSLzJiW2Sleu8Ls Cc: Hans Petter Selasky , freebsd-arm , freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 15:04:00 -0000 Aren't structures already aligned to 4 bytes when placed inside other = structures (unless marked __packed)? Warner On Jul 28, 2013, at 11:50 AM, Adrian Chadd wrote: > As long as that results in the radiotap structures being 4 or 8 byte > padded when it's embedded in the softc - then yes, indeed. >=20 > Xiao, can you try? >=20 >=20 > -adrian >=20 > On 28 July 2013 03:35, Hans Petter Selasky wrote: >> Hi, >>=20 >> Can you try the attached patch? >>=20 >> --HPS > _______________________________________________ > freebsd-arm@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 15:49:13 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 574BB661 for ; Mon, 29 Jul 2013 15:49:13 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [178.32.219.166]) by mx1.freebsd.org (Postfix) with ESMTP id D63372E54 for ; Mon, 29 Jul 2013 15:49:12 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id 5A2AE6EC for ; Mon, 29 Jul 2013 17:49:11 +0200 (CEST) From: "Cedric GROSS" To: Subject: [iwn] Review split 3 Date: Mon, 29 Jul 2013 17:49:08 +0200 Message-ID: <007601ce8c73$2b508cf0$81f1a6d0$@info> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0077_01CE8C83.EED95CF0" X-Mailer: Microsoft Office Outlook 12.0 thread-index: Ac6Mcymi0Cue2rANTIOwE30wLxYMHA== Content-Language: fr X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 15:49:13 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_0077_01CE8C83.EED95CF0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, As discuss we Adrian, previous big patch is too heavy for direct application in repo. So I resume splitting modification. Here is split 3. This one create if_iwn_devif.h for storing device ID and subdevice ID for later use. If_iwn.c and If_iwnreg.h modified as needed. Cedric ------=_NextPart_000_0077_01CE8C83.EED95CF0 Content-Type: application/octet-stream; name="deviceid.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="deviceid.patch" Index: sys/dev/iwn/if_iwn.c=0A= =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=0A= --- sys/dev/iwn/if_iwn.c (revision 2)=0A= +++ sys/dev/iwn/if_iwn.c (working copy)=0A= @@ -73,6 +73,7 @@=0A= =0A= #include =0A= #include =0A= +#include =0A= =0A= struct iwn_ident {=0A= uint16_t vendor;=0A= @@ -81,40 +82,40 @@=0A= };=0A= =0A= static const struct iwn_ident iwn_ident_table[] =3D {=0A= - { 0x8086, 0x0082, "Intel Centrino Advanced-N 6205" },=0A= - { 0x8086, 0x0083, "Intel Centrino Wireless-N 1000" },=0A= - { 0x8086, 0x0084, "Intel Centrino Wireless-N 1000" },=0A= - { 0x8086, 0x0085, "Intel Centrino Advanced-N 6205" },=0A= - { 0x8086, 0x0087, "Intel Centrino Advanced-N + WiMAX 6250" },=0A= - { 0x8086, 0x0089, "Intel Centrino Advanced-N + WiMAX 6250" },=0A= - { 0x8086, 0x008a, "Intel Centrino Wireless-N 1030" },=0A= - { 0x8086, 0x008b, "Intel Centrino Wireless-N 1030" },=0A= - { 0x8086, 0x0090, "Intel Centrino Advanced-N 6230" },=0A= - { 0x8086, 0x0091, "Intel Centrino Advanced-N 6230" },=0A= - { 0x8086, 0x0885, "Intel Centrino Wireless-N + WiMAX 6150" },=0A= - { 0x8086, 0x0886, "Intel Centrino Wireless-N + WiMAX 6150" },=0A= - { 0x8086, 0x0887, "Intel Centrino Wireless-N 2230" },=0A= - { 0x8086, 0x0888, "Intel Centrino Wireless-N 2230" },=0A= - { 0x8086, 0x0896, "Intel Centrino Wireless-N 130" },=0A= - { 0x8086, 0x0897, "Intel Centrino Wireless-N 130" },=0A= - { 0x8086, 0x08ae, "Intel Centrino Wireless-N 100" },=0A= - { 0x8086, 0x08af, "Intel Centrino Wireless-N 100" },=0A= - { 0x8086, 0x4229, "Intel Wireless WiFi Link 4965" },=0A= - { 0x8086, 0x422b, "Intel Centrino Ultimate-N 6300" },=0A= - { 0x8086, 0x422c, "Intel Centrino Advanced-N 6200" },=0A= - { 0x8086, 0x422d, "Intel Wireless WiFi Link 4965" },=0A= - { 0x8086, 0x4230, "Intel Wireless WiFi Link 4965" },=0A= - { 0x8086, 0x4232, "Intel WiFi Link 5100" },=0A= - { 0x8086, 0x4233, "Intel Wireless WiFi Link 4965" },=0A= - { 0x8086, 0x4235, "Intel Ultimate N WiFi Link 5300" },=0A= - { 0x8086, 0x4236, "Intel Ultimate N WiFi Link 5300" },=0A= - { 0x8086, 0x4237, "Intel WiFi Link 5100" },=0A= - { 0x8086, 0x4238, "Intel Centrino Ultimate-N 6300" },=0A= - { 0x8086, 0x4239, "Intel Centrino Advanced-N 6200" },=0A= - { 0x8086, 0x423a, "Intel WiMAX/WiFi Link 5350" },=0A= - { 0x8086, 0x423b, "Intel WiMAX/WiFi Link 5350" },=0A= - { 0x8086, 0x423c, "Intel WiMAX/WiFi Link 5150" },=0A= - { 0x8086, 0x423d, "Intel WiMAX/WiFi Link 5150" },=0A= + { 0x8086, IWN_DID_6x05_1, "Intel Centrino Advanced-N 6205" },=0A= + { 0x8086, IWN_DID_1000_1, "Intel Centrino Wireless-N 1000" },=0A= + { 0x8086, IWN_DID_1000_2, "Intel Centrino Wireless-N 1000" },=0A= + { 0x8086, IWN_DID_6x05_2, "Intel Centrino Advanced-N 6205" },=0A= + { 0x8086, IWN_DID_6050_1, "Intel Centrino Advanced-N + WiMAX 6250" },=0A= + { 0x8086, IWN_DID_6050_2, "Intel Centrino Advanced-N + WiMAX 6250" },=0A= + { 0x8086, IWN_DID_x030_1, "Intel Centrino Wireless-N 1030" },=0A= + { 0x8086, IWN_DID_x030_2, "Intel Centrino Wireless-N 1030" },=0A= + { 0x8086, IWN_DID_x030_3, "Intel Centrino Advanced-N 6230" },=0A= + { 0x8086, IWN_DID_x030_4, "Intel Centrino Advanced-N 6230" },=0A= + { 0x8086, IWN_DID_6150_1, "Intel Centrino Wireless-N + WiMAX 6150" },=0A= + { 0x8086, IWN_DID_6150_2, "Intel Centrino Wireless-N + WiMAX 6150" },=0A= + { 0x8086, IWN_DID_2x30_1, "Intel Centrino Wireless-N 2230" },=0A= + { 0x8086, IWN_DID_2x30_2, "Intel Centrino Wireless-N 2230" },=0A= + { 0x8086, IWN_DID_130_1, "Intel Centrino Wireless-N 130" },=0A= + { 0x8086, IWN_DID_130_2, "Intel Centrino Wireless-N 130" },=0A= + { 0x8086, IWN_DID_100_1, "Intel Centrino Wireless-N 100" },=0A= + { 0x8086, IWN_DID_100_2, "Intel Centrino Wireless-N 100" },=0A= + { 0x8086, IWN_DID_4965_1, "Intel Wireless WiFi Link 4965" },=0A= + { 0x8086, IWN_DID_6x00_1, "Intel Centrino Ultimate-N 6300" },=0A= + { 0x8086, IWN_DID_6x00_2, "Intel Centrino Advanced-N 6200" },=0A= + { 0x8086, IWN_DID_4965_2, "Intel Wireless WiFi Link 4965" },=0A= + { 0x8086, IWN_DID_4965_3, "Intel Wireless WiFi Link 4965" },=0A= + { 0x8086, IWN_DID_5x00_1, "Intel WiFi Link 5100" },=0A= + { 0x8086, IWN_DID_4965_4, "Intel Wireless WiFi Link 4965" },=0A= + { 0x8086, IWN_DID_5x00_3, "Intel Ultimate N WiFi Link 5300" },=0A= + { 0x8086, IWN_DID_5x00_4, "Intel Ultimate N WiFi Link 5300" },=0A= + { 0x8086, IWN_DID_5x00_2, "Intel WiFi Link 5100" },=0A= + { 0x8086, IWN_DID_6x00_3, "Intel Centrino Ultimate-N 6300" },=0A= + { 0x8086, IWN_DID_6x00_4, "Intel Centrino Advanced-N 6200" },=0A= + { 0x8086, IWN_DID_5x50_1, "Intel WiMAX/WiFi Link 5350" },=0A= + { 0x8086, IWN_DID_5x50_2, "Intel WiMAX/WiFi Link 5350" },=0A= + { 0x8086, IWN_DID_5x50_3, "Intel WiMAX/WiFi Link 5150" },=0A= + { 0x8086, IWN_DID_5x50_4, "Intel WiMAX/WiFi Link 5150" },=0A= { 0, 0, NULL }=0A= };=0A= =0A= @@ -517,7 +518,8 @@=0A= IWN_LOCK_INIT(sc);=0A= =0A= /* Read hardware revision and attach. */=0A= - sc->hw_type =3D (IWN_READ(sc, IWN_HW_REV) >> 4) & 0xf;=0A= + sc->hw_type =3D (IWN_READ(sc, IWN_HW_REV) >> IWN_HW_REV_TYPE_SHIFT)=0A= + & IWN_HW_REV_TYPE_MASK;=0A= if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_4965)=0A= error =3D iwn4965_attach(sc, pci_get_device(dev));=0A= else=0A= Index: sys/dev/iwn/if_iwn_devid.h=0A= =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=0A= --- sys/dev/iwn/if_iwn_devid.h (revision 0)=0A= +++ sys/dev/iwn/if_iwn_devid.h (working copy)=0A= @@ -0,0 +1,289 @@=0A= +/* $FreeBSD$ */=0A= +=0A= +/*-=0A= + * Copyright (c) 2013 Cedric GROSS =0A= + *=0A= + * Permission to use, copy, modify, and distribute this software for any=0A= + * purpose with or without fee is hereby granted, provided that the = above=0A= + * copyright notice and this permission notice appear in all copies.=0A= + *=0A= + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL = WARRANTIES=0A= + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF=0A= + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE = FOR=0A= + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY = DAMAGES=0A= + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN=0A= + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT = OF=0A= + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.=0A= + */=0A= +=0A= +#define IWN_HW_REV_TYPE_SHIFT 4=0A= +#define IWN_HW_REV_TYPE_MASK 0x1f=0A= +=0A= +/* Device revision */=0A= +#define IWN_HW_REV_TYPE_4965 0=0A= +#define IWN_HW_REV_TYPE_5300 2=0A= +#define IWN_HW_REV_TYPE_5350 3=0A= +#define IWN_HW_REV_TYPE_5150 4=0A= +#define IWN_HW_REV_TYPE_5100 5=0A= +#define IWN_HW_REV_TYPE_1000 6=0A= +#define IWN_HW_REV_TYPE_6000 7=0A= +#define IWN_HW_REV_TYPE_6050 8=0A= +#define IWN_HW_REV_TYPE_6005 11=0A= +#define IWN_HW_REV_TYPE_2030 12=0A= +#define IWN_HW_REV_TYPE_2000 16=0A= +#define IWN_HW_REV_TYPE_105 17=0A= +#define IWN_HW_REV_TYPE_135 18=0A= +=0A= + /* = =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=3D=3D=3D=3D=3D=3D=3D=0A= + * DEVICE ID BLOCK=0A= + * = =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=3D=3D=3D=3D=3D=3D=3D=0A= +*/ =0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 2x30 series =0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_2x30_1 0x0887 =0A= +#define IWN_DID_2x30_2 0x0888 =0A= +/* SubDevice ID */=0A= +#define IWN_SDID_2x30_1 0x4062=0A= +#define IWN_SDID_2x30_2 0x4262=0A= +#define IWN_SDID_2x30_3 0x4462=0A= +#define IWN_SDID_2x30_4 0x4066=0A= +#define IWN_SDID_2x30_5 0x4266=0A= +#define IWN_SDID_2x30_6 0x4466=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 1000 series =0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_1000_1 0x0083=0A= +#define IWN_DID_1000_2 0x0084=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_1000_1 0x1205=0A= +#define IWN_SDID_1000_2 0x1305=0A= +#define IWN_SDID_1000_3 0x1225=0A= +#define IWN_SDID_1000_4 0x1325=0A= +#define IWN_SDID_1000_5 0x1215=0A= +#define IWN_SDID_1000_6 0x1315=0A= +#define IWN_SDID_1000_7 0x1206=0A= +#define IWN_SDID_1000_8 0x1306=0A= +#define IWN_SDID_1000_9 0x1226=0A= +#define IWN_SDID_1000_10 0x1326=0A= +#define IWN_SDID_1000_11 0x1216=0A= +#define IWN_SDID_1000_12 0x1316=0A= +=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 6x00 series =0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_6x00_1 0x422B=0A= +#define IWN_DID_6x00_2 0x422C=0A= +#define IWN_DID_6x00_3 0x4238=0A= +#define IWN_DID_6x00_4 0x4239=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_6x00_1 0x1101=0A= +#define IWN_SDID_6x00_2 0x1121=0A= +#define IWN_SDID_6x00_3 0x1301=0A= +#define IWN_SDID_6x00_4 0x1306=0A= +#define IWN_SDID_6x00_5 0x1307=0A= +#define IWN_SDID_6x00_6 0x1321=0A= +#define IWN_SDID_6x00_7 0x1326=0A= +#define IWN_SDID_6x00_8 0x1111=0A= +#define IWN_SDID_6x00_9 0x1311=0A= +#define IWN_SDID_6x00_10 0x1316=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 6x05 series =0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_6x05_1 0x0082=0A= +#define IWN_DID_6x05_2 0x0085=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_6x05_1 0x1301=0A= +#define IWN_SDID_6x05_2 0x1306=0A= +#define IWN_SDID_6x05_3 0x1307=0A= +#define IWN_SDID_6x05_4 0x1321=0A= +#define IWN_SDID_6x05_5 0x1326=0A= +#define IWN_SDID_6x05_6 0x1311=0A= +#define IWN_SDID_6x05_7 0x1316=0A= +#define IWN_SDID_6x05_8 0xC020=0A= +#define IWN_SDID_6x05_9 0xC220=0A= +#define IWN_SDID_6x05_10 0x4820=0A= +#define IWN_SDID_6x05_11 0x1304=0A= +#define IWN_SDID_6x05_12 0x1305=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 6050 WiFi/WiMax Series =0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_6050_1 0x0087=0A= +#define IWN_DID_6050_2 0x0089=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_6050_1 0x1301=0A= +#define IWN_SDID_6050_2 0x1306=0A= +#define IWN_SDID_6050_3 0x1321=0A= +#define IWN_SDID_6050_4 0x1326=0A= +#define IWN_SDID_6050_5 0x1311=0A= +#define IWN_SDID_6050_6 0x1316=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 6150 Series =0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_6150_1 0x0885=0A= +#define IWN_DID_6150_2 0x0886=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_6150_1 0x1305=0A= +#define IWN_SDID_6150_2 0x1307=0A= +#define IWN_SDID_6150_3 0x1325=0A= +#define IWN_SDID_6150_4 0x1327=0A= +#define IWN_SDID_6150_5 0x1315=0A= +#define IWN_SDID_6150_6 0x1317=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 6035 Series =0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_6035_1 0x088E=0A= +#define IWN_DID_6035_2 0x088F=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_6035_1 0x4060=0A= +#define IWN_SDID_6035_2 0x4260=0A= +#define IWN_SDID_6035_3 0x4460=0A= +#define IWN_SDID_6035_4 0x4860=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 1030 and 6030 Series =0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_x030_1 0x008A=0A= +#define IWN_DID_x030_2 0x008B=0A= +#define IWN_DID_x030_3 0x0090=0A= +#define IWN_DID_x030_4 0x0091=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_x030_1 0x5305=0A= +#define IWN_SDID_x030_2 0x5307=0A= +#define IWN_SDID_x030_3 0x5325=0A= +#define IWN_SDID_x030_4 0x5327=0A= +#define IWN_SDID_x030_5 0x5315=0A= +#define IWN_SDID_x030_6 0x5317=0A= +#define IWN_SDID_x030_7 0x5211=0A= +#define IWN_SDID_x030_8 0x5215=0A= +#define IWN_SDID_x030_9 0x5216=0A= +#define IWN_SDID_x030_10 0x5201=0A= +#define IWN_SDID_x030_11 0x5205=0A= +#define IWN_SDID_x030_12 0x5206=0A= +#define IWN_SDID_x030_13 0x5207=0A= +#define IWN_SDID_x030_14 0x5221=0A= +#define IWN_SDID_x030_15 0x5225=0A= +#define IWN_SDID_x030_16 0x5226=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 130 Series =0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_130_1 0x0896=0A= +#define IWN_DID_130_2 0x0897=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_130_1 0x5005=0A= +#define IWN_SDID_130_2 0x5007=0A= +#define IWN_SDID_130_3 0x5015=0A= +#define IWN_SDID_130_4 0x5017=0A= +#define IWN_SDID_130_5 0x5025=0A= +#define IWN_SDID_130_6 0x5027=0A= +=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 100 Series =0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_100_1 0x08AE=0A= +#define IWN_DID_100_2 0x08AF=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_100_1 0x1005=0A= +#define IWN_SDID_100_2 0x1007=0A= +#define IWN_SDID_100_3 0x1015=0A= +#define IWN_SDID_100_4 0x1017=0A= +#define IWN_SDID_100_5 0x1025=0A= +#define IWN_SDID_100_6 0x1027=0A= +=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 5x00 Series =0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_5x00_1 0x4232=0A= +#define IWN_DID_5x00_2 0x4237=0A= +#define IWN_DID_5x00_3 0x4235=0A= +#define IWN_DID_5x00_4 0x4236=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_5x00_1 0x1201=0A= +#define IWN_SDID_5x00_2 0x1301=0A= +#define IWN_SDID_5x00_3 0x1204=0A= +#define IWN_SDID_5x00_4 0x1304=0A= +#define IWN_SDID_5x00_5 0x1205=0A= +#define IWN_SDID_5x00_6 0x1305=0A= +#define IWN_SDID_5x00_7 0x1206=0A= +#define IWN_SDID_5x00_8 0x1306=0A= +#define IWN_SDID_5x00_9 0x1221=0A= +#define IWN_SDID_5x00_10 0x1321=0A= +#define IWN_SDID_5x00_11 0x1224=0A= +#define IWN_SDID_5x00_12 0x1324=0A= +#define IWN_SDID_5x00_13 0x1225=0A= +#define IWN_SDID_5x00_14 0x1325=0A= +#define IWN_SDID_5x00_15 0x1226=0A= +#define IWN_SDID_5x00_16 0x1326=0A= +#define IWN_SDID_5x00_17 0x1211=0A= +#define IWN_SDID_5x00_18 0x1311=0A= +#define IWN_SDID_5x00_19 0x1214=0A= +#define IWN_SDID_5x00_20 0x1314=0A= +#define IWN_SDID_5x00_21 0x1215=0A= +#define IWN_SDID_5x00_22 0x1315=0A= +#define IWN_SDID_5x00_23 0x1216=0A= +#define IWN_SDID_5x00_24 0x1316=0A= +#define IWN_SDID_5x00_25 0x1021=0A= +#define IWN_SDID_5x00_26 0x1121=0A= +#define IWN_SDID_5x00_27 0x1024=0A= +#define IWN_SDID_5x00_28 0x1124=0A= +#define IWN_SDID_5x00_29 0x1001=0A= +#define IWN_SDID_5x00_30 0x1101=0A= +#define IWN_SDID_5x00_31 0x1004=0A= +#define IWN_SDID_5x00_32 0x1104=0A= +#define IWN_SDID_5x00_33 0x1011=0A= +#define IWN_SDID_5x00_34 0x1111=0A= +#define IWN_SDID_5x00_35 0x1014=0A= +#define IWN_SDID_5x00_36 0x1114=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 5x50 Series =0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_5x50_1 0x423A=0A= +#define IWN_DID_5x50_2 0x423B=0A= +#define IWN_DID_5x50_3 0x423C=0A= +#define IWN_DID_5x50_4 0x423D=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_5x50_1 0x1001=0A= +#define IWN_SDID_5x50_2 0x1021=0A= +#define IWN_SDID_5x50_3 0x1011=0A= +#define IWN_SDID_5x50_4 0x1201=0A= +#define IWN_SDID_5x50_5 0x1301=0A= +#define IWN_SDID_5x50_6 0x1206=0A= +#define IWN_SDID_5x50_7 0x1306=0A= +#define IWN_SDID_5x50_8 0x1221=0A= +#define IWN_SDID_5x50_9 0x1321=0A= +#define IWN_SDID_5x50_10 0x1211=0A= +#define IWN_SDID_5x50_11 0x1311=0A= +#define IWN_SDID_5x50_12 0x1216=0A= +#define IWN_SDID_5x50_13 0x1316=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 4965 Series =0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_4965_1 0x4229=0A= +#define IWN_DID_4965_2 0x422d=0A= +#define IWN_DID_4965_3 0x4230=0A= +#define IWN_DID_4965_4 0x4233=0A= Index: sys/dev/iwn/if_iwnreg.h=0A= =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=0A= --- sys/dev/iwn/if_iwnreg.h (revision 2)=0A= +++ sys/dev/iwn/if_iwnreg.h (working copy)=0A= @@ -200,19 +200,6 @@=0A= #define IWN_GP_CNTRL_SLEEP (1 << 4)=0A= #define IWN_GP_CNTRL_RFKILL (1 << 27)=0A= =0A= -/* Possible flags for register IWN_HW_REV. */=0A= -#define IWN_HW_REV_TYPE_SHIFT 4=0A= -#define IWN_HW_REV_TYPE_MASK 0x000000f0=0A= -#define IWN_HW_REV_TYPE_4965 0=0A= -#define IWN_HW_REV_TYPE_5300 2=0A= -#define IWN_HW_REV_TYPE_5350 3=0A= -#define IWN_HW_REV_TYPE_5150 4=0A= -#define IWN_HW_REV_TYPE_5100 5=0A= -#define IWN_HW_REV_TYPE_1000 6=0A= -#define IWN_HW_REV_TYPE_6000 7=0A= -#define IWN_HW_REV_TYPE_6050 8=0A= -#define IWN_HW_REV_TYPE_6005 11=0A= -=0A= /* Possible flags for register IWN_GIO_CHICKEN. */=0A= #define IWN_GIO_CHICKEN_L1A_NO_L0S_RX (1 << 23)=0A= #define IWN_GIO_CHICKEN_DIS_L0S_TIMER (1 << 29)=0A= ------=_NextPart_000_0077_01CE8C83.EED95CF0-- From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 16:03:08 2013 Return-Path: Delivered-To: freebsd-wireless@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 E19C09DC for ; Mon, 29 Jul 2013 16:03:07 +0000 (UTC) (envelope-from sbremal@hotmail.com) Received: from dub0-omc1-s14.dub0.hotmail.com (dub0-omc1-s14.dub0.hotmail.com [157.55.0.213]) by mx1.freebsd.org (Postfix) with ESMTP id 873822F52 for ; Mon, 29 Jul 2013 16:03:07 +0000 (UTC) Received: from DUB104-W1 ([157.55.0.238]) by dub0-omc1-s14.dub0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 29 Jul 2013 09:01:59 -0700 X-TMN: [w3EeTni1hTQ71j+Lp5z8iGu2wowbUAyC] X-Originating-Email: [sbremal@hotmail.com] Message-ID: From: To: "freebsd-wireless@freebsd.org" Subject: =?windows-1256?Q?WG111v3_+_?= =?windows-1256?Q?'urtw'_=3D_s?= =?windows-1256?Q?tatus:_no_?= =?windows-1256?Q?carrier=FE?= Date: Mon, 29 Jul 2013 16:01:59 +0000 Importance: Normal Content-Type: text/plain; charset="windows-1256" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginalArrivalTime: 29 Jul 2013 16:01:59.0545 (UTC) FILETIME=[F5095E90:01CE8C74] X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 16:03:08 -0000 SGVsbG8NCiANCkp1c3QgcmVjZW50bHkgdXBncmFkZWQgdG8gOC4xIGFuZCBpbnN0YWxsZWQgdGhl ICd1cnR3JyBkcml2ZXIgZm9yIG15IE5ldGdlYXIgV0cxMTF2MyBVU0IgV0xBTiBjYXJkLiBBbGwg ZmluZSwgc3lzdGVtcyBib290cywgV0xBTiBjYXJkIGdldHMgSVAgYWRkcmVzcywgbmV0d29yayBy dW5zLiBBbmQgdGhlbiBzdWRkZW5seSBuZXR3b3JrIGNvbm5lY3Rpb24gYnJlYWtzIGRvd24uIEFu ZCBuZXZlciByZWNvdmVycy4gT25seSByZWJvb3QgaGVscHMuDQogDQpBcHBhcmVudGx5IHRoZSBX TEFOIGNvbm5lY3Rpb24gbW92ZXMgZnJvbSAnc3RhdHVzOiBhc3NvY2lhdGVkJyB0byAnc3RhdHVz OiBubyBjYXJyaWVyJyBhbmQgc3RheXMgc3R1Y2sgdGhlcmUuDQogDQpJcyB0aGVyZSBhbnkgd2F5 IHRvIHByZXZlbnQgdGhpcz8gKFdMQU4gc2lnbmFsIGlzIE9LLCBwdXQgdGhlIGJveCBuZXh0IHRv IHRoZSBBUCB0byB0ZXN0LikNCiANCk9yLCBjYW4geW91IHJlY29tbWVuZCBhIFBDSS9QQ0llIGNh cmQgdGhhdCBpcyBwcm92ZW4gdG8gd29yayByZWxpYWJseT8NCiANClJlZ2FyZHMNCkJhbGF6cw0K IA0KLS0tDQogDQpUaGlzIGlzIGhvdyBpdCBzdGFydHM6DQogDQpuZmUwOiBmbGFncz04ODQzPFVQ LEJST0FEQ0FTVCxSVU5OSU5HLFNJTVBMRVgsTVVMVElDQVNUPiBtZXRyaWMgMCBtdHUgMTUwMA0K ICAgICAgICBvcHRpb25zPTgwMTBiPFJYQ1NVTSxUWENTVU0sVkxBTl9NVFUsVFNPNCxMSU5LU1RB VEU+DQogICAgICAgIGV0aGVyIDAwOjI2OjE4OjkxOjEzOmJjDQogICAgICAgIG1lZGlhOiBFdGhl cm5ldCBhdXRvc2VsZWN0IChub25lKQ0KICAgICAgICBzdGF0dXM6IG5vIGNhcnJpZXINCmxvMDog ZmxhZ3M9ODA0OTxVUCxMT09QQkFDSyxSVU5OSU5HLE1VTFRJQ0FTVD4gbWV0cmljIDAgbXR1IDE2 Mzg0DQogICAgICAgIG9wdGlvbnM9MzxSWENTVU0sVFhDU1VNPg0KICAgICAgICBpbmV0NiBmZTgw OjoxJWxvMCBwcmVmaXhsZW4gNjQgc2NvcGVpZCAweDINCiAgICAgICAgaW5ldDYgOjoxIHByZWZp eGxlbiAxMjgNCiAgICAgICAgaW5ldCAxMjcuMC4wLjEgbmV0bWFzayAweGZmMDAwMDAwDQogICAg ICAgIG5kNiBvcHRpb25zPTM8UEVSRk9STU5VRCxBQ0NFUFRfUlRBRFY+DQp1cnR3MDogZmxhZ3M9 ODg0MzxVUCxCUk9BRENBU1QsUlVOTklORyxTSU1QTEVYLE1VTFRJQ0FTVD4gbWV0cmljIDAgbXR1 IDIyOTANCiAgICAgICAgZXRoZXIgMDA6MWI6MmY6Y2U6ZTI6NzINCiAgICAgICAgbWVkaWE6IElF RUUgODAyLjExIFdpcmVsZXNzIEV0aGVybmV0IGF1dG9zZWxlY3QgbW9kZSAxMWcNCiAgICAgICAg c3RhdHVzOiBhc3NvY2lhdGVkDQp3bGFuMDogZmxhZ3M9ODg0MzxVUCxCUk9BRENBU1QsUlVOTklO RyxTSU1QTEVYLE1VTFRJQ0FTVD4gbWV0cmljIDAgbXR1IDE1MDANCiAgICAgICAgZXRoZXIgMDA6 MWI6MmY6Y2U6ZTI6NzINCiAgICAgICAgaW5ldCAxOTIuMTY4LjEuMiBuZXRtYXNrIDB4ZmZmZmZm MDAgYnJvYWRjYXN0IDE5Mi4xNjguMS4yNTUNCiAgICAgICAgbWVkaWE6IElFRUUgODAyLjExIFdp cmVsZXNzIEV0aGVybmV0IGF1dG9zZWxlY3QgbW9kZSAxMWcNCiAgICAgICAgc3RhdHVzOiBhc3Nv Y2lhdGVkDQogICAgICAgIHNzaWQgIkxlIFF1YWNrIiBjaGFubmVsIDYgKDI0MzcgTUh6IDExZykg YnNzaWQgMDA6MWU6MmE6NWU6MjU6NzANCiAgICAgICAgY291bnRyeSBVUyBhdXRobW9kZSBXUEEy LzgwMi4xMWkgcHJpdmFjeSBPTiBkZWZ0eGtleSBVTkRFRg0KICAgICAgICBUS0lQIDM6MTI4LWJp dCB0eHBvd2VyIDAgYm1pc3MgNyBzY2FudmFsaWQgNDUwIGJnc2NhbiBiZ3NjYW5pbnR2bCAzMDAN CiAgICAgICAgYmdzY2FuaWRsZSAyNTAgcm9hbTpyc3NpIDcgcm9hbTpyYXRlIDUgcHJvdG1vZGUg Q1RTIHJvYW1pbmcgTUFOVUFMDQogDQpBbmQgdGhpcyBpcyBob3cgaXQgZ2V0cyBicm9rZW4gYW5k IG5ldmVyIHJlY292ZXJzOg0KIA0KbmZlMDogZmxhZ3M9ODg0MzxVUCxCUk9BRENBU1QsUlVOTklO RyxTSU1QTEVYLE1VTFRJQ0FTVD4gbWV0cmljIDAgbXR1IDE1MDANCiAgICAgICAgb3B0aW9ucz04 MDEwYjxSWENTVU0sVFhDU1VNLFZMQU5fTVRVLFRTTzQsTElOS1NUQVRFPg0KICAgICAgICBldGhl ciAwMDoyNjoxODo5MToxMzpiYw0KICAgICAgICBtZWRpYTogRXRoZXJuZXQgYXV0b3NlbGVjdCAo bm9uZSkNCiAgICAgICAgc3RhdHVzOiBubyBjYXJyaWVyDQpsbzA6IGZsYWdzPTgwNDk8VVAsTE9P UEJBQ0ssUlVOTklORyxNVUxUSUNBU1Q+IG1ldHJpYyAwIG10dSAxNjM4NA0KICAgICAgICBvcHRp b25zPTM8UlhDU1VNLFRYQ1NVTT4NCiAgICAgICAgaW5ldDYgZmU4MDo6MSVsbzAgcHJlZml4bGVu IDY0IHNjb3BlaWQgMHgyDQogICAgICAgIGluZXQ2IDo6MSBwcmVmaXhsZW4gMTI4DQogICAgICAg IGluZXQgMTI3LjAuMC4xIG5ldG1hc2sgMHhmZjAwMDAwMA0KICAgICAgICBuZDYgb3B0aW9ucz0z PFBFUkZPUk1OVUQsQUNDRVBUX1JUQURWPg0KdXJ0dzA6IGZsYWdzPThjNDM8VVAsQlJPQURDQVNU LFJVTk5JTkcsT0FDVElWRSxTSU1QTEVYLE1VTFRJQ0FTVD4gbWV0cmljIDAgbXR1IDIyOTANCiAg ICAgICAgZXRoZXIgMDA6MWI6MmY6Y2U6ZTI6NzINCiAgICAgICAgbWVkaWE6IElFRUUgODAyLjEx IFdpcmVsZXNzIEV0aGVybmV0IGF1dG9zZWxlY3QgbW9kZSAxMWcNCiAgICAgICAgc3RhdHVzOiBh c3NvY2lhdGVkDQp3bGFuMDogZmxhZ3M9OGM0MzxVUCxCUk9BRENBU1QsUlVOTklORyxPQUNUSVZF LFNJTVBMRVgsTVVMVElDQVNUPiBtZXRyaWMgMCBtdHUgMTUwMA0KICAgICAgICBldGhlciAwMDox YjoyZjpjZTplMjo3Mg0KICAgICAgICBpbmV0IDE5Mi4xNjguMS4yIG5ldG1hc2sgMHhmZmZmZmYw MCBicm9hZGNhc3QgMTkyLjE2OC4xLjI1NQ0KICAgICAgICBtZWRpYTogSUVFRSA4MDIuMTEgV2ly ZWxlc3MgRXRoZXJuZXQgYXV0b3NlbGVjdCAoYXV0b3NlbGVjdCkNCiAgICAgICAgc3RhdHVzOiBu byBjYXJyaWVyDQogICAgICAgIHNzaWQgIkxlIFF1YWNrIiBjaGFubmVsIDYgKDI0MzcgTUh6IDEx ZykNCiAgICAgICAgY291bnRyeSBVUyBhdXRobW9kZSBXUEEyLzgwMi4xMWkgcHJpdmFjeSBPTiBk ZWZ0eGtleSBVTkRFRiB0eHBvd2VyIDANCiAgICAgICAgYm1pc3MgNyBzY2FudmFsaWQgNDUwIGJn c2NhbiBiZ3NjYW5pbnR2bCAzMDAgYmdzY2FuaWRsZSAyNTANCiAgICAgICAgcm9hbTpyc3NpIDcg cm9hbTpyYXRlIDUgcHJvdG1vZGUgQ1RTIHJvYW1pbmcgTUFOVUFMIAkJIAkgICAJCSAg From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 17:51:51 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 7A031C85 for ; Mon, 29 Jul 2013 17:51:51 +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 127382569 for ; Mon, 29 Jul 2013 17:51:50 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id a12so1384275wgh.6 for ; Mon, 29 Jul 2013 10:51:49 -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; bh=y5vTb+5ACH8w8wmmcVxhkuGDjy/daqzJI3FYzszf/pc=; b=dQY/C9RrogLSQH79uJgcjbNYXChJxOJEBwwme+mB2KMA+sPK5DVwHb0JYa3/lIDvJX zy98Ddwy/F2QEwBL95F01R8nW+KpNc8pD8cXqD3r0UaHtBL3CAhO/dtFZs29adBfHJ5/ IbLm7Q+hpN50X4FrjGG8m+I3OlaDLLd00m3fxBRUzf3TaUNanOqtXTbBFYWstA7PdWq5 Ovmn3fsarO1atH/Y/rWYXrX8m5IQsaujp4bmvNsf6yKk9UgDak6c9BlQthW7P3k+Ol+o RIb3pGGqhTlLj07Kog1RNjOQW4FIyZQEtoA7PGboZSNvlf7obRd4SSQJHIXYObYLYiEI Fipw== MIME-Version: 1.0 X-Received: by 10.180.39.212 with SMTP id r20mr8009353wik.30.1375120309312; Mon, 29 Jul 2013 10:51:49 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Mon, 29 Jul 2013 10:51:49 -0700 (PDT) In-Reply-To: <007601ce8c73$2b508cf0$81f1a6d0$@info> References: <007601ce8c73$2b508cf0$81f1a6d0$@info> Date: Mon, 29 Jul 2013 10:51:49 -0700 X-Google-Sender-Auth: HOt31lhQfNACJCsWDknvUT501co Message-ID: Subject: Re: [iwn] Review split 3 From: Adrian Chadd To: Cedric GROSS Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 17:51:51 -0000 Hi! Cool! ok, the style niggles. * Your #define IWN_blah needs a TAB between #define and the IWN_blah value. Right now you have spaces. * $FreeBSD$ should be after the copyright header, not before * Your new file is missing the standard single-include stuff.. ie #ifndef __IF_IWN_DEVID_H__ #define __IF_IWN_DEVID_H__ (header contents go here..) #endif /* __IF_IWN_DEVID_H__ */ -adrian On 29 July 2013 08:49, Cedric GROSS wrote: > Hello, > > > > As discuss we Adrian, previous big patch is too heavy for direct application > in repo. > > So I resume splitting modification. > > > > Here is split 3. > > This one create if_iwn_devif.h for storing device ID and subdevice ID for > later use. > > If_iwn.c and If_iwnreg.h modified as needed. > > > > Cedric > > > _______________________________________________ > 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" From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 17:55:25 2013 Return-Path: Delivered-To: freebsd-wireless@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 182F2EE8 for ; Mon, 29 Jul 2013 17:55:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A4F3E25A2 for ; Mon, 29 Jul 2013 17:55:24 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id hi8so1427796wib.1 for ; Mon, 29 Jul 2013 10:55:23 -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; bh=uPXBE1INdi2WwE+BRAf1s3v6VJruKVb3kszPs7FQ3iw=; b=eoVTFJbCnW3bjTRK26n90penuWgTxIoSzMkiMTj0cdP46MR0pkDchKlq0B7xCOXOFT pnoN2mrYPvR4DwiYLDdXYtpiBtZuQ5/Yx+SZ3i0ovGyW3Y5TLDkusQTyvWb/fubhGIk5 Ghyh696f9PKIfVak5Vg3NWQF/Mj/wU0cnqukcQLuxwq0sq8P4Litd8kUt+VKHIY1sR6E LY89x4Grpd51HTuEoLJh/zWhDCc4jdGn5Yn0UnsS+VI9hxkABjwc5BkPytgS2KTTlUkC GEvoMnnsGfJFqph1qrcAEckfRzoVT6HRdjma6+Vbd35qTdubBw4wkfTUQ4Ih52QKIMnc r2qg== MIME-Version: 1.0 X-Received: by 10.194.11.72 with SMTP id o8mr44879652wjb.0.1375120523012; Mon, 29 Jul 2013 10:55:23 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Mon, 29 Jul 2013 10:55:22 -0700 (PDT) In-Reply-To: References: Date: Mon, 29 Jul 2013 10:55:22 -0700 X-Google-Sender-Auth: RFrDehc_eq2RFw3ARBBqM-MbZLg Message-ID: Subject: Re: WG111v3 + 'urtw' = status: no carrier From: Adrian Chadd To: sbremal@hotmail.com Content-Type: text/plain; charset=ISO-8859-1 Cc: "freebsd-wireless@freebsd.org" X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 17:55:25 -0000 What's logged by the kernel? try 'dmesg' -adrian On 29 July 2013 09:01, wrote: > Hello > > Just recently upgraded to 8.1 and installed the 'urtw' driver for my Netgear WG111v3 USB WLAN card. All fine, systems boots, WLAN card gets IP address, network runs. And then suddenly network connection breaks down. And never recovers. Only reboot helps. > > Apparently the WLAN connection moves from 'status: associated' to 'status: no carrier' and stays stuck there. > > Is there any way to prevent this? (WLAN signal is OK, put the box next to the AP to test.) > > Or, can you recommend a PCI/PCIe card that is proven to work reliably? > > Regards > Balazs > > --- > > This is how it starts: > > nfe0: flags=8843 metric 0 mtu 1500 > options=8010b > ether 00:26:18:91:13:bc > media: Ethernet autoselect (none) > status: no carrier > lo0: flags=8049 metric 0 mtu 16384 > options=3 > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 > inet6 ::1 prefixlen 128 > inet 127.0.0.1 netmask 0xff000000 > nd6 options=3 > urtw0: flags=8843 metric 0 mtu 2290 > ether 00:1b:2f:ce:e2:72 > media: IEEE 802.11 Wireless Ethernet autoselect mode 11g > status: associated > wlan0: flags=8843 metric 0 mtu 1500 > ether 00:1b:2f:ce:e2:72 > inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255 > media: IEEE 802.11 Wireless Ethernet autoselect mode 11g > status: associated > ssid "Le Quack" channel 6 (2437 MHz 11g) bssid 00:1e:2a:5e:25:70 > country US authmode WPA2/802.11i privacy ON deftxkey UNDEF > TKIP 3:128-bit txpower 0 bmiss 7 scanvalid 450 bgscan bgscanintvl 300 > bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS roaming MANUAL > > And this is how it gets broken and never recovers: > > nfe0: flags=8843 metric 0 mtu 1500 > options=8010b > ether 00:26:18:91:13:bc > media: Ethernet autoselect (none) > status: no carrier > lo0: flags=8049 metric 0 mtu 16384 > options=3 > inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 > inet6 ::1 prefixlen 128 > inet 127.0.0.1 netmask 0xff000000 > nd6 options=3 > urtw0: flags=8c43 metric 0 mtu 2290 > ether 00:1b:2f:ce:e2:72 > media: IEEE 802.11 Wireless Ethernet autoselect mode 11g > status: associated > wlan0: flags=8c43 metric 0 mtu 1500 > ether 00:1b:2f:ce:e2:72 > inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255 > media: IEEE 802.11 Wireless Ethernet autoselect (autoselect) > status: no carrier > ssid "Le Quack" channel 6 (2437 MHz 11g) > country US authmode WPA2/802.11i privacy ON deftxkey UNDEF txpower 0 > bmiss 7 scanvalid 450 bgscan bgscanintvl 300 bgscanidle 250 > roam:rssi 7 roam:rate 5 protmode CTS roaming MANUAL > _______________________________________________ > 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" From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 17:58:27 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B774CF35; Mon, 29 Jul 2013 17:58:27 +0000 (UTC) (envelope-from hans.petter.selasky@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id 420F625B9; Mon, 29 Jul 2013 17:58:27 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id 311BD7A10F; Mon, 29 Jul 2013 19:58:25 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 7D6388F08E9; Mon, 29 Jul 2013 19:58:30 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QHqor4BVr9Hw; Mon, 29 Jul 2013 19:58:29 +0200 (CEST) Received: from mail.lockless.no (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 73D1A8F08E8; Mon, 29 Jul 2013 19:58:29 +0200 (CEST) Subject: RE: My WLI-UC-GNM up crash From: =?utf-8?Q?Hans_Petter_Selasky?= To: =?utf-8?Q?Warner_Losh?= , =?utf-8?Q?Adrian_Chadd?= Date: Mon, 29 Jul 2013 19:58:29 +0200 Mime-Version: 1.0 In-Reply-To: <8AFE4FCA-BCAA-460C-ABFE-EC7FC2991B8C@bsdimp.com> References: X-Priority: 3 (Normal) X-Mailer: Zarafa 7.1.4-41394 Message-Id: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: =?utf-8?Q?freebsd-arm?= , =?utf-8?Q?freebsd-wireless=40freebsd=2Eorg?= X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 17:58:27 -0000 Hi,=0D=0A=0D=0AThe aligned will make sure that the structure gets padded = properly to the size specified. Only on ARM/MIPS etc, structures get auto= matically aligned according to the element in the structure requiring the= greatest alignment. I've test-compiled the USB WLAN drivers, and the ali= gned makes a difference. The problem is that the radiotap header skews so= me following elements, so that they are no longer aligned. The radiotap h= eader itself is packed, and this is not a problem.=0D=0A=0D=0A--HPS=0D=0A= =0D=0A=20=0D=0A-----Original message-----=0D=0A> From:Warner Losh >=0D=0A> Sent: Monday 29th July 2013 17:= 04=0D=0A> To: Adrian Chadd >=0D=0A> Cc: Hans Petter Selasky >; freebsd-arm >; freebsd-wireless@freebsd.org =20=0D=0A> Subject: Re: My WLI-UC-GNM up = crash=0D=0A>=20=0D=0A> Aren't structures already aligned to 4 bytes when = placed inside other structures (unless marked __packed)=3F=0D=0A>=20=0D=0A= > Warner=0D=0A>=20=0D=0A> On Jul 28, 2013, at 11:50 AM, Adrian Chadd wrot= e:=0D=0A>=20=0D=0A> > As long as that results in the radiotap structures = being 4 or 8 byte=0D=0A> > padded when it's embedded in the softc - then = yes, indeed.=0D=0A> >=20=0D=0A> > Xiao, can you try=3F=0D=0A> >=20=0D=0A>= >=20=0D=0A> > -adrian=0D=0A> >=20=0D=0A> > On 28 July 2013 03:35, Hans P= etter Selasky > wrote:=0D=0A> >= > Hi,=0D=0A> >>=20=0D=0A> >> Can you try the attached patch=3F=0D=0A> >>=20= =0D=0A> >> --HPS=0D=0A> > _______________________________________________= =0D=0A> > freebsd-arm@freebsd.org maili= ng list=0D=0A> > http://lists.freebsd.org/mailman/listinfo/freebsd-arm =20=0D=0A> > To unsu= bscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org "=0D=0A>=20=0D=0A>=20=0D=0A=0D=0A From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 18:10:58 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 84B73215; Mon, 29 Jul 2013 18:10:58 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 35DC6265B; Mon, 29 Jul 2013 18:10:58 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.7/8.14.7) with ESMTP id r6TIAbx3045678; Mon, 29 Jul 2013 12:10:37 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.7/8.14.7/Submit) with ESMTP id r6TIAZjO045675; Mon, 29 Jul 2013 12:10:35 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Mon, 29 Jul 2013 12:10:35 -0600 (MDT) From: Warren Block To: Adrian Chadd Subject: Re: [iwn] Review split 3 In-Reply-To: Message-ID: References: <007601ce8c73$2b508cf0$81f1a6d0$@info> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Mon, 29 Jul 2013 12:10:37 -0600 (MDT) Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 18:10:58 -0000 On Mon, 29 Jul 2013, Adrian Chadd wrote: > Hi! > > Cool! ok, the style niggles. > > * Your #define IWN_blah needs a TAB between #define and the IWN_blah > value. Right now you have spaces. There is whitespace at the end of some of the comment lines also. textproc/igor will find problems like that: igor -R filename | less -RS From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 18:34:11 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AD656993 for ; Mon, 29 Jul 2013 18:34:11 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-oa0-f43.google.com (mail-oa0-f43.google.com [209.85.219.43]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 73A8027A2 for ; Mon, 29 Jul 2013 18:34:10 +0000 (UTC) Received: by mail-oa0-f43.google.com with SMTP id i10so8720889oag.16 for ; Mon, 29 Jul 2013 11:34:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:x-priority :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=bmz94YyDrTpr9oVE2lz+bEsdSfVB/dcjpy11m+d8Eic=; b=HqiQiTCFZxnM6q723f+oxMSL0J488jlEABXwdm+mSzyEhjeXqQNWMV7C3e4HNsXN7X PHMgcdV6gm5k2ZXjF1KbNmzzSxfzwbfrjQ9MYHZCRfP1KM4qWt2YOkL513XHUjZOoGm2 f3pLZOAhdNAt6vuYjXbJ7ENIvP7Qv64naUB5n8bGgssw3WCPt7JS49UM4wuttFESMNGv r8X9yhbIgvhICnAzfYO+Q40S9/izB4/IRLGfJI4l64WyWFTBmnWrpLsrMJZykKAt80pl ykpkvH+K64x4gj36GU3/plxZUNbFYHAXRNl43UPRfmSzNbK1F/3hvWwBOgUO/OWy/fh2 o7hw== X-Received: by 10.182.142.129 with SMTP id rw1mr4554697obb.67.1375122844546; Mon, 29 Jul 2013 11:34:04 -0700 (PDT) Received: from monkey-bot.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPSA id fk3sm89036646obb.2.2013.07.29.11.34.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 29 Jul 2013 11:34:03 -0700 (PDT) Sender: Warner Losh Subject: Re: My WLI-UC-GNM up crash Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh X-Priority: 3 (Normal) In-Reply-To: Date: Mon, 29 Jul 2013 12:34:00 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <3571E4A7-D153-448E-A234-302C9C5603E9@bsdimp.com> References: To: Hans Petter Selasky X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQnZfLCem9top0/maCiGMWkHhWdOb+wwikxL0obgXetzyM08tR3I4JGsmCc05U5e5CWYNyju Cc: freebsd-wireless@freebsd.org, freebsd-arm X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 18:34:11 -0000 On Jul 29, 2013, at 11:58 AM, Hans Petter Selasky wrote: > The aligned will make sure that the structure gets padded properly to = the size specified. Only on ARM/MIPS etc, structures get automatically = aligned according to the element in the structure requiring the greatest = alignment. I'd turn this around and say only on x86 do structures not get aligned = this way. On any riscy architecture, unaligned accesses are expensive, = which is why the ABI there mandates this. > I've test-compiled the USB WLAN drivers, and the aligned makes a = difference. The problem is that the radiotap header skews some following = elements, so that they are no longer aligned. The radiotap header itself = is packed, and this is not a problem. This suggests a bigger problem. How is the radiotap header being = popualted? Is it by DMA or programmatically? If by DMA then we have = cache line sharing, which is bad. If by program, why is it packed to = start with? Warner > --HPS >=20 > =20 > -----Original message----- > > From:Warner Losh > > Sent: Monday 29th July 2013 17:04 > > To: Adrian Chadd > > Cc: Hans Petter Selasky ; = freebsd-arm ; freebsd-wireless@freebsd.org > > Subject: Re: My WLI-UC-GNM up crash > >=20 > > Aren't structures already aligned to 4 bytes when placed inside = other structures (unless marked __packed)? > >=20 > > Warner > >=20 > > On Jul 28, 2013, at 11:50 AM, Adrian Chadd wrote: > >=20 > > > As long as that results in the radiotap structures being 4 or 8 = byte > > > padded when it's embedded in the softc - then yes, indeed. > > >=20 > > > Xiao, can you try? > > >=20 > > >=20 > > > -adrian > > >=20 > > > On 28 July 2013 03:35, Hans Petter Selasky = wrote: > > >> Hi, > > >>=20 > > >> Can you try the attached patch? > > >>=20 > > >> --HPS > > > _______________________________________________ > > > freebsd-arm@freebsd.org mailing list > > > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > > > To unsubscribe, send any mail to = "freebsd-arm-unsubscribe@freebsd.org" > >=20 > >=20 From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 18:39:25 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 826EFCB2; Mon, 29 Jul 2013 18:39:25 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [IPv6:2001:41d0:8:dda6::1]) by mx1.freebsd.org (Postfix) with ESMTP id 08D9327EE; Mon, 29 Jul 2013 18:39:25 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id C092B787; Mon, 29 Jul 2013 20:39:22 +0200 (CEST) From: "Cedric GROSS" To: References: <007601ce8c73$2b508cf0$81f1a6d0$@info> In-Reply-To: Subject: RE: [iwn] Review split 3 Date: Mon, 29 Jul 2013 20:39:20 +0200 Message-ID: <00a601ce8c8a$f21570f0$d64052d0$@info> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_00A7_01CE8C9B.B59E40F0" X-Mailer: Microsoft Office Outlook 12.0 thread-index: Ac6MhvtNElOsfx60S6C+AqFgwuzzAQAArWBw Content-Language: fr X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 18:39:25 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_00A7_01CE8C9B.B59E40F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > De=A0: Warren Block [mailto:wblock@wonkity.com] > Envoy=E9=A0: lundi 29 juillet 2013 20:11 > =C0=A0: Adrian Chadd > Cc=A0: Cedric GROSS; freebsd-wireless@freebsd.org >=20 > On Mon, 29 Jul 2013, Adrian Chadd wrote: >=20 > > Hi! > > > > Cool! ok, the style niggles. > > > > * Your #define IWN_blah needs a TAB between #define and the IWN_blah > > value. Right now you have spaces. Ok, I tough you need spaces between #define and values... standard single-include stuff : Done $FreeBSD$ : Moved Each file is different. Really hard to find something common. Man 9 = style is quite useful but enough precise for tab and space usage I think. >=20 > There is whitespace at the end of some of the comment lines also. >=20 > textproc/igor will find problems like that: >=20 > igor -R filename | less -RS Thanks for that Warren ! ------=_NextPart_000_00A7_01CE8C9B.B59E40F0 Content-Type: application/octet-stream; name="deviceid.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="deviceid.patch" Index: sys/dev/iwn/if_iwn.c=0A= =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=0A= --- sys/dev/iwn/if_iwn.c (revision 2)=0A= +++ sys/dev/iwn/if_iwn.c (working copy)=0A= @@ -73,6 +73,7 @@=0A= =0A= #include =0A= #include =0A= +#include =0A= =0A= struct iwn_ident {=0A= uint16_t vendor;=0A= @@ -81,40 +82,40 @@=0A= };=0A= =0A= static const struct iwn_ident iwn_ident_table[] =3D {=0A= - { 0x8086, 0x0082, "Intel Centrino Advanced-N 6205" },=0A= - { 0x8086, 0x0083, "Intel Centrino Wireless-N 1000" },=0A= - { 0x8086, 0x0084, "Intel Centrino Wireless-N 1000" },=0A= - { 0x8086, 0x0085, "Intel Centrino Advanced-N 6205" },=0A= - { 0x8086, 0x0087, "Intel Centrino Advanced-N + WiMAX 6250" },=0A= - { 0x8086, 0x0089, "Intel Centrino Advanced-N + WiMAX 6250" },=0A= - { 0x8086, 0x008a, "Intel Centrino Wireless-N 1030" },=0A= - { 0x8086, 0x008b, "Intel Centrino Wireless-N 1030" },=0A= - { 0x8086, 0x0090, "Intel Centrino Advanced-N 6230" },=0A= - { 0x8086, 0x0091, "Intel Centrino Advanced-N 6230" },=0A= - { 0x8086, 0x0885, "Intel Centrino Wireless-N + WiMAX 6150" },=0A= - { 0x8086, 0x0886, "Intel Centrino Wireless-N + WiMAX 6150" },=0A= - { 0x8086, 0x0887, "Intel Centrino Wireless-N 2230" },=0A= - { 0x8086, 0x0888, "Intel Centrino Wireless-N 2230" },=0A= - { 0x8086, 0x0896, "Intel Centrino Wireless-N 130" },=0A= - { 0x8086, 0x0897, "Intel Centrino Wireless-N 130" },=0A= - { 0x8086, 0x08ae, "Intel Centrino Wireless-N 100" },=0A= - { 0x8086, 0x08af, "Intel Centrino Wireless-N 100" },=0A= - { 0x8086, 0x4229, "Intel Wireless WiFi Link 4965" },=0A= - { 0x8086, 0x422b, "Intel Centrino Ultimate-N 6300" },=0A= - { 0x8086, 0x422c, "Intel Centrino Advanced-N 6200" },=0A= - { 0x8086, 0x422d, "Intel Wireless WiFi Link 4965" },=0A= - { 0x8086, 0x4230, "Intel Wireless WiFi Link 4965" },=0A= - { 0x8086, 0x4232, "Intel WiFi Link 5100" },=0A= - { 0x8086, 0x4233, "Intel Wireless WiFi Link 4965" },=0A= - { 0x8086, 0x4235, "Intel Ultimate N WiFi Link 5300" },=0A= - { 0x8086, 0x4236, "Intel Ultimate N WiFi Link 5300" },=0A= - { 0x8086, 0x4237, "Intel WiFi Link 5100" },=0A= - { 0x8086, 0x4238, "Intel Centrino Ultimate-N 6300" },=0A= - { 0x8086, 0x4239, "Intel Centrino Advanced-N 6200" },=0A= - { 0x8086, 0x423a, "Intel WiMAX/WiFi Link 5350" },=0A= - { 0x8086, 0x423b, "Intel WiMAX/WiFi Link 5350" },=0A= - { 0x8086, 0x423c, "Intel WiMAX/WiFi Link 5150" },=0A= - { 0x8086, 0x423d, "Intel WiMAX/WiFi Link 5150" },=0A= + { 0x8086, IWN_DID_6x05_1, "Intel Centrino Advanced-N 6205" },=0A= + { 0x8086, IWN_DID_1000_1, "Intel Centrino Wireless-N 1000" },=0A= + { 0x8086, IWN_DID_1000_2, "Intel Centrino Wireless-N 1000" },=0A= + { 0x8086, IWN_DID_6x05_2, "Intel Centrino Advanced-N 6205" },=0A= + { 0x8086, IWN_DID_6050_1, "Intel Centrino Advanced-N + WiMAX 6250" },=0A= + { 0x8086, IWN_DID_6050_2, "Intel Centrino Advanced-N + WiMAX 6250" },=0A= + { 0x8086, IWN_DID_x030_1, "Intel Centrino Wireless-N 1030" },=0A= + { 0x8086, IWN_DID_x030_2, "Intel Centrino Wireless-N 1030" },=0A= + { 0x8086, IWN_DID_x030_3, "Intel Centrino Advanced-N 6230" },=0A= + { 0x8086, IWN_DID_x030_4, "Intel Centrino Advanced-N 6230" },=0A= + { 0x8086, IWN_DID_6150_1, "Intel Centrino Wireless-N + WiMAX 6150" },=0A= + { 0x8086, IWN_DID_6150_2, "Intel Centrino Wireless-N + WiMAX 6150" },=0A= + { 0x8086, IWN_DID_2x30_1, "Intel Centrino Wireless-N 2230" },=0A= + { 0x8086, IWN_DID_2x30_2, "Intel Centrino Wireless-N 2230" },=0A= + { 0x8086, IWN_DID_130_1, "Intel Centrino Wireless-N 130" },=0A= + { 0x8086, IWN_DID_130_2, "Intel Centrino Wireless-N 130" },=0A= + { 0x8086, IWN_DID_100_1, "Intel Centrino Wireless-N 100" },=0A= + { 0x8086, IWN_DID_100_2, "Intel Centrino Wireless-N 100" },=0A= + { 0x8086, IWN_DID_4965_1, "Intel Wireless WiFi Link 4965" },=0A= + { 0x8086, IWN_DID_6x00_1, "Intel Centrino Ultimate-N 6300" },=0A= + { 0x8086, IWN_DID_6x00_2, "Intel Centrino Advanced-N 6200" },=0A= + { 0x8086, IWN_DID_4965_2, "Intel Wireless WiFi Link 4965" },=0A= + { 0x8086, IWN_DID_4965_3, "Intel Wireless WiFi Link 4965" },=0A= + { 0x8086, IWN_DID_5x00_1, "Intel WiFi Link 5100" },=0A= + { 0x8086, IWN_DID_4965_4, "Intel Wireless WiFi Link 4965" },=0A= + { 0x8086, IWN_DID_5x00_3, "Intel Ultimate N WiFi Link 5300" },=0A= + { 0x8086, IWN_DID_5x00_4, "Intel Ultimate N WiFi Link 5300" },=0A= + { 0x8086, IWN_DID_5x00_2, "Intel WiFi Link 5100" },=0A= + { 0x8086, IWN_DID_6x00_3, "Intel Centrino Ultimate-N 6300" },=0A= + { 0x8086, IWN_DID_6x00_4, "Intel Centrino Advanced-N 6200" },=0A= + { 0x8086, IWN_DID_5x50_1, "Intel WiMAX/WiFi Link 5350" },=0A= + { 0x8086, IWN_DID_5x50_2, "Intel WiMAX/WiFi Link 5350" },=0A= + { 0x8086, IWN_DID_5x50_3, "Intel WiMAX/WiFi Link 5150" },=0A= + { 0x8086, IWN_DID_5x50_4, "Intel WiMAX/WiFi Link 5150" },=0A= { 0, 0, NULL }=0A= };=0A= =0A= @@ -517,7 +518,8 @@=0A= IWN_LOCK_INIT(sc);=0A= =0A= /* Read hardware revision and attach. */=0A= - sc->hw_type =3D (IWN_READ(sc, IWN_HW_REV) >> 4) & 0xf;=0A= + sc->hw_type =3D (IWN_READ(sc, IWN_HW_REV) >> IWN_HW_REV_TYPE_SHIFT)=0A= + & IWN_HW_REV_TYPE_MASK;=0A= if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_4965)=0A= error =3D iwn4965_attach(sc, pci_get_device(dev));=0A= else=0A= Index: sys/dev/iwn/if_iwn_devid.h=0A= =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=0A= --- sys/dev/iwn/if_iwn_devid.h (revision 0)=0A= +++ sys/dev/iwn/if_iwn_devid.h (working copy)=0A= @@ -0,0 +1,294 @@=0A= +/*-=0A= + * Copyright (c) 2013 Cedric GROSS =0A= + *=0A= + * Permission to use, copy, modify, and distribute this software for any=0A= + * purpose with or without fee is hereby granted, provided that the = above=0A= + * copyright notice and this permission notice appear in all copies.=0A= + *=0A= + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL = WARRANTIES=0A= + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF=0A= + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE = FOR=0A= + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY = DAMAGES=0A= + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN=0A= + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT = OF=0A= + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.=0A= + *=0A= + * $FreeBSD$=0A= + */=0A= +=0A= +#ifndef __IF_IWN_DEVID_H__=0A= +#define __IF_IWN_DEVID_H__=0A= +=0A= +#define IWN_HW_REV_TYPE_SHIFT 4=0A= +#define IWN_HW_REV_TYPE_MASK 0x1f=0A= +=0A= +/* Device revision */=0A= +#define IWN_HW_REV_TYPE_4965 0=0A= +#define IWN_HW_REV_TYPE_5300 2=0A= +#define IWN_HW_REV_TYPE_5350 3=0A= +#define IWN_HW_REV_TYPE_5150 4=0A= +#define IWN_HW_REV_TYPE_5100 5=0A= +#define IWN_HW_REV_TYPE_1000 6=0A= +#define IWN_HW_REV_TYPE_6000 7=0A= +#define IWN_HW_REV_TYPE_6050 8=0A= +#define IWN_HW_REV_TYPE_6005 11=0A= +#define IWN_HW_REV_TYPE_2030 12=0A= +#define IWN_HW_REV_TYPE_2000 16=0A= +#define IWN_HW_REV_TYPE_105 17=0A= +#define IWN_HW_REV_TYPE_135 18=0A= +=0A= + /* = =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=3D=3D=3D=3D=3D=3D=3D=0A= + * DEVICE ID BLOCK=0A= + * = =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=3D=3D=3D=3D=3D=3D=3D=0A= +*/=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 2x30 series=0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_2x30_1 0x0887=0A= +#define IWN_DID_2x30_2 0x0888=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_2x30_1 0x4062=0A= +#define IWN_SDID_2x30_2 0x4262=0A= +#define IWN_SDID_2x30_3 0x4462=0A= +#define IWN_SDID_2x30_4 0x4066=0A= +#define IWN_SDID_2x30_5 0x4266=0A= +#define IWN_SDID_2x30_6 0x4466=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 1000 series=0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_1000_1 0x0083=0A= +#define IWN_DID_1000_2 0x0084=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_1000_1 0x1205=0A= +#define IWN_SDID_1000_2 0x1305=0A= +#define IWN_SDID_1000_3 0x1225=0A= +#define IWN_SDID_1000_4 0x1325=0A= +#define IWN_SDID_1000_5 0x1215=0A= +#define IWN_SDID_1000_6 0x1315=0A= +#define IWN_SDID_1000_7 0x1206=0A= +#define IWN_SDID_1000_8 0x1306=0A= +#define IWN_SDID_1000_9 0x1226=0A= +#define IWN_SDID_1000_10 0x1326=0A= +#define IWN_SDID_1000_11 0x1216=0A= +#define IWN_SDID_1000_12 0x1316=0A= +=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 6x00 series=0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_6x00_1 0x422B=0A= +#define IWN_DID_6x00_2 0x422C=0A= +#define IWN_DID_6x00_3 0x4238=0A= +#define IWN_DID_6x00_4 0x4239=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_6x00_1 0x1101=0A= +#define IWN_SDID_6x00_2 0x1121=0A= +#define IWN_SDID_6x00_3 0x1301=0A= +#define IWN_SDID_6x00_4 0x1306=0A= +#define IWN_SDID_6x00_5 0x1307=0A= +#define IWN_SDID_6x00_6 0x1321=0A= +#define IWN_SDID_6x00_7 0x1326=0A= +#define IWN_SDID_6x00_8 0x1111=0A= +#define IWN_SDID_6x00_9 0x1311=0A= +#define IWN_SDID_6x00_10 0x1316=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 6x05 series=0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_6x05_1 0x0082=0A= +#define IWN_DID_6x05_2 0x0085=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_6x05_1 0x1301=0A= +#define IWN_SDID_6x05_2 0x1306=0A= +#define IWN_SDID_6x05_3 0x1307=0A= +#define IWN_SDID_6x05_4 0x1321=0A= +#define IWN_SDID_6x05_5 0x1326=0A= +#define IWN_SDID_6x05_6 0x1311=0A= +#define IWN_SDID_6x05_7 0x1316=0A= +#define IWN_SDID_6x05_8 0xC020=0A= +#define IWN_SDID_6x05_9 0xC220=0A= +#define IWN_SDID_6x05_10 0x4820=0A= +#define IWN_SDID_6x05_11 0x1304=0A= +#define IWN_SDID_6x05_12 0x1305=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 6050 WiFi/WiMax Series=0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_6050_1 0x0087=0A= +#define IWN_DID_6050_2 0x0089=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_6050_1 0x1301=0A= +#define IWN_SDID_6050_2 0x1306=0A= +#define IWN_SDID_6050_3 0x1321=0A= +#define IWN_SDID_6050_4 0x1326=0A= +#define IWN_SDID_6050_5 0x1311=0A= +#define IWN_SDID_6050_6 0x1316=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 6150 Series=0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_6150_1 0x0885=0A= +#define IWN_DID_6150_2 0x0886=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_6150_1 0x1305=0A= +#define IWN_SDID_6150_2 0x1307=0A= +#define IWN_SDID_6150_3 0x1325=0A= +#define IWN_SDID_6150_4 0x1327=0A= +#define IWN_SDID_6150_5 0x1315=0A= +#define IWN_SDID_6150_6 0x1317=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 6035 Series=0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_6035_1 0x088E=0A= +#define IWN_DID_6035_2 0x088F=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_6035_1 0x4060=0A= +#define IWN_SDID_6035_2 0x4260=0A= +#define IWN_SDID_6035_3 0x4460=0A= +#define IWN_SDID_6035_4 0x4860=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 1030 and 6030 Series=0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_x030_1 0x008A=0A= +#define IWN_DID_x030_2 0x008B=0A= +#define IWN_DID_x030_3 0x0090=0A= +#define IWN_DID_x030_4 0x0091=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_x030_1 0x5305=0A= +#define IWN_SDID_x030_2 0x5307=0A= +#define IWN_SDID_x030_3 0x5325=0A= +#define IWN_SDID_x030_4 0x5327=0A= +#define IWN_SDID_x030_5 0x5315=0A= +#define IWN_SDID_x030_6 0x5317=0A= +#define IWN_SDID_x030_7 0x5211=0A= +#define IWN_SDID_x030_8 0x5215=0A= +#define IWN_SDID_x030_9 0x5216=0A= +#define IWN_SDID_x030_10 0x5201=0A= +#define IWN_SDID_x030_11 0x5205=0A= +#define IWN_SDID_x030_12 0x5206=0A= +#define IWN_SDID_x030_13 0x5207=0A= +#define IWN_SDID_x030_14 0x5221=0A= +#define IWN_SDID_x030_15 0x5225=0A= +#define IWN_SDID_x030_16 0x5226=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 130 Series=0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_130_1 0x0896=0A= +#define IWN_DID_130_2 0x0897=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_130_1 0x5005=0A= +#define IWN_SDID_130_2 0x5007=0A= +#define IWN_SDID_130_3 0x5015=0A= +#define IWN_SDID_130_4 0x5017=0A= +#define IWN_SDID_130_5 0x5025=0A= +#define IWN_SDID_130_6 0x5027=0A= +=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 100 Series=0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_100_1 0x08AE=0A= +#define IWN_DID_100_2 0x08AF=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_100_1 0x1005=0A= +#define IWN_SDID_100_2 0x1007=0A= +#define IWN_SDID_100_3 0x1015=0A= +#define IWN_SDID_100_4 0x1017=0A= +#define IWN_SDID_100_5 0x1025=0A= +#define IWN_SDID_100_6 0x1027=0A= +=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 5x00 Series=0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_5x00_1 0x4232=0A= +#define IWN_DID_5x00_2 0x4237=0A= +#define IWN_DID_5x00_3 0x4235=0A= +#define IWN_DID_5x00_4 0x4236=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_5x00_1 0x1201=0A= +#define IWN_SDID_5x00_2 0x1301=0A= +#define IWN_SDID_5x00_3 0x1204=0A= +#define IWN_SDID_5x00_4 0x1304=0A= +#define IWN_SDID_5x00_5 0x1205=0A= +#define IWN_SDID_5x00_6 0x1305=0A= +#define IWN_SDID_5x00_7 0x1206=0A= +#define IWN_SDID_5x00_8 0x1306=0A= +#define IWN_SDID_5x00_9 0x1221=0A= +#define IWN_SDID_5x00_10 0x1321=0A= +#define IWN_SDID_5x00_11 0x1224=0A= +#define IWN_SDID_5x00_12 0x1324=0A= +#define IWN_SDID_5x00_13 0x1225=0A= +#define IWN_SDID_5x00_14 0x1325=0A= +#define IWN_SDID_5x00_15 0x1226=0A= +#define IWN_SDID_5x00_16 0x1326=0A= +#define IWN_SDID_5x00_17 0x1211=0A= +#define IWN_SDID_5x00_18 0x1311=0A= +#define IWN_SDID_5x00_19 0x1214=0A= +#define IWN_SDID_5x00_20 0x1314=0A= +#define IWN_SDID_5x00_21 0x1215=0A= +#define IWN_SDID_5x00_22 0x1315=0A= +#define IWN_SDID_5x00_23 0x1216=0A= +#define IWN_SDID_5x00_24 0x1316=0A= +#define IWN_SDID_5x00_25 0x1021=0A= +#define IWN_SDID_5x00_26 0x1121=0A= +#define IWN_SDID_5x00_27 0x1024=0A= +#define IWN_SDID_5x00_28 0x1124=0A= +#define IWN_SDID_5x00_29 0x1001=0A= +#define IWN_SDID_5x00_30 0x1101=0A= +#define IWN_SDID_5x00_31 0x1004=0A= +#define IWN_SDID_5x00_32 0x1104=0A= +#define IWN_SDID_5x00_33 0x1011=0A= +#define IWN_SDID_5x00_34 0x1111=0A= +#define IWN_SDID_5x00_35 0x1014=0A= +#define IWN_SDID_5x00_36 0x1114=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 5x50 Series=0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_5x50_1 0x423A=0A= +#define IWN_DID_5x50_2 0x423B=0A= +#define IWN_DID_5x50_3 0x423C=0A= +#define IWN_DID_5x50_4 0x423D=0A= +/* SubDevice ID */=0A= +#define IWN_SDID_5x50_1 0x1001=0A= +#define IWN_SDID_5x50_2 0x1021=0A= +#define IWN_SDID_5x50_3 0x1011=0A= +#define IWN_SDID_5x50_4 0x1201=0A= +#define IWN_SDID_5x50_5 0x1301=0A= +#define IWN_SDID_5x50_6 0x1206=0A= +#define IWN_SDID_5x50_7 0x1306=0A= +#define IWN_SDID_5x50_8 0x1221=0A= +#define IWN_SDID_5x50_9 0x1321=0A= +#define IWN_SDID_5x50_10 0x1211=0A= +#define IWN_SDID_5x50_11 0x1311=0A= +#define IWN_SDID_5x50_12 0x1216=0A= +#define IWN_SDID_5x50_13 0x1316=0A= +/*=0A= + * = -------------------------------------------------------------------------= -=0A= + * Device ID for 4965 Series=0A= + * = -------------------------------------------------------------------------= -=0A= + */=0A= +#define IWN_DID_4965_1 0x4229=0A= +#define IWN_DID_4965_2 0x422d=0A= +#define IWN_DID_4965_3 0x4230=0A= +#define IWN_DID_4965_4 0x4233=0A= +=0A= +#endif /* ! __IF_IWN_DEVID_H__ */=0A= Index: sys/dev/iwn/if_iwnreg.h=0A= =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=0A= --- sys/dev/iwn/if_iwnreg.h (revision 2)=0A= +++ sys/dev/iwn/if_iwnreg.h (working copy)=0A= @@ -200,19 +200,6 @@=0A= #define IWN_GP_CNTRL_SLEEP (1 << 4)=0A= #define IWN_GP_CNTRL_RFKILL (1 << 27)=0A= =0A= -/* Possible flags for register IWN_HW_REV. */=0A= -#define IWN_HW_REV_TYPE_SHIFT 4=0A= -#define IWN_HW_REV_TYPE_MASK 0x000000f0=0A= -#define IWN_HW_REV_TYPE_4965 0=0A= -#define IWN_HW_REV_TYPE_5300 2=0A= -#define IWN_HW_REV_TYPE_5350 3=0A= -#define IWN_HW_REV_TYPE_5150 4=0A= -#define IWN_HW_REV_TYPE_5100 5=0A= -#define IWN_HW_REV_TYPE_1000 6=0A= -#define IWN_HW_REV_TYPE_6000 7=0A= -#define IWN_HW_REV_TYPE_6050 8=0A= -#define IWN_HW_REV_TYPE_6005 11=0A= -=0A= /* Possible flags for register IWN_GIO_CHICKEN. */=0A= #define IWN_GIO_CHICKEN_L1A_NO_L0S_RX (1 << 23)=0A= #define IWN_GIO_CHICKEN_DIS_L0S_TIMER (1 << 29)=0A= ------=_NextPart_000_00A7_01CE8C9B.B59E40F0-- From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 18:41:31 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2FE60D20 for ; Mon, 29 Jul 2013 18:41:31 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [178.32.219.166]) by mx1.freebsd.org (Postfix) with ESMTP id BB1822801 for ; Mon, 29 Jul 2013 18:41:30 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id B8E70795 for ; Mon, 29 Jul 2013 20:41:29 +0200 (CEST) From: "Cedric GROSS" To: Subject: Wifi rates Date: Mon, 29 Jul 2013 20:41:27 +0200 Message-ID: <00b101ce8c8b$3db5f200$b921d600$@info> MIME-Version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 thread-index: Ac6MfuQE0Z6YtXc+QXitGXkyDnxdtQ== Content-Language: fr Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 18:41:31 -0000 Hello, Part of splitting work, I continue to investigate on my side for my NIC (Centrino 2230). I notice that from ifconfig wlan0 : media: IEEE 802.11 Wireless Ethernet DS/1Mbps mode 11ng Rate is very slow and should be 54Mbps. I try to understand how rates is determined but it's really a mess. So first question : From where ifconfig get rate ? What's CCK, MCS, plcp stand for and what is relationship with rate ? I try following linux kernel also but it's a nightmare. Thanks. Cedric From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 18:54:01 2013 Return-Path: Delivered-To: wireless@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 511313E5; Mon, 29 Jul 2013 18:54:01 +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 8C65928B0; Mon, 29 Jul 2013 18:54:00 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id a12so1440668wgh.6 for ; Mon, 29 Jul 2013 11:53:59 -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; bh=PtxsHCd0/rhtsZ/5V80UsIFd70ZHi2SfB3mTMdiCD/Q=; b=Z5CxXws4898ZjSiqjjOGNZW7m0O62Mk5bKvHv60fMKz+mbrjrA4gr+p4wJ8aszZkF1 oL3xB+RLugHHdvzXzr/J0jLdcwbqODujlgdaHDqUhrRqKSEok71eHo+aRqHp5xjDr+wH zdD0kQ6IHl+RE0Tgkfv/QtUROWUqj4v7Raa9qahTcDYih5/VME2eG4GsfQ942E9UFv0V 0B3Bfakk+E7QA6Nnt7KBJWIxzPioPkTTR7lZBihKu1nL2TLdX1ri1JFZ4o2ha5gPBHfG o74koGSyvskJPhGnK0Naz7ZPRbUHclkvvIOl6UQTm4RUMEMZR6qP4akczWFnVc0IxWw6 kOBw== MIME-Version: 1.0 X-Received: by 10.180.20.116 with SMTP id m20mr8050510wie.46.1375124038955; Mon, 29 Jul 2013 11:53:58 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Mon, 29 Jul 2013 11:53:58 -0700 (PDT) In-Reply-To: <20130729140353.GA41336@e-new.0x20.net> References: <51F26CEB.9010200@dumbbell.fr> <20130729095946.GK59101@e-new.0x20.net> <51F6758C.9020004@dumbbell.fr> <20130729140353.GA41336@e-new.0x20.net> Date: Mon, 29 Jul 2013 11:53:58 -0700 X-Google-Sender-Auth: 9mkOJqg0yNJLVvsAzGnj_wIu0do Message-ID: Subject: Re: 802.1X: dhclient started before the auth. process ends From: Adrian Chadd To: Lars Engels Content-Type: text/plain; charset=ISO-8859-1 Cc: =?ISO-8859-1?Q?Jean=2DS=E9bastien_P=E9dron?= , freebsd-current@freebsd.org, wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 18:54:01 -0000 ... wait, so the new version of wpa_supplicant takes 10 seconds to even start doing anything? Or are the rc scripts to blame? -adrian From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 19:00:12 2013 Return-Path: Delivered-To: freebsd-wireless@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 E0299599; Mon, 29 Jul 2013 19:00:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 36BA328F8; Mon, 29 Jul 2013 19:00:12 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r6TJ03MF075661; Mon, 29 Jul 2013 22:00:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r6TJ03MF075661 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r6TJ03UL075657; Mon, 29 Jul 2013 22:00:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 29 Jul 2013 22:00:03 +0300 From: Konstantin Belousov To: Warner Losh Subject: Re: My WLI-UC-GNM up crash Message-ID: <20130729190003.GP4972@kib.kiev.ua> References: <3571E4A7-D153-448E-A234-302C9C5603E9@bsdimp.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9DptZICXTlJ7FQ09" Content-Disposition: inline In-Reply-To: <3571E4A7-D153-448E-A234-302C9C5603E9@bsdimp.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: freebsd-arm , freebsd-wireless@freebsd.org, Hans Petter Selasky X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 19:00:13 -0000 --9DptZICXTlJ7FQ09 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 29, 2013 at 12:34:00PM -0600, Warner Losh wrote: >=20 > On Jul 29, 2013, at 11:58 AM, Hans Petter Selasky wrote: >=20 > > The aligned will make sure that the structure gets padded properly to t= he size specified. Only on ARM/MIPS etc, structures get automatically align= ed according to the element in the structure requiring the greatest alignme= nt. >=20 > I'd turn this around and say only on x86 do structures not get aligned th= is way. On any riscy architecture, unaligned accesses are expensive, which = is why the ABI there mandates this. >=20 The alignment of the structure to the largest alignment of the member is required by the ABIs on i386 and amd64 as well. --9DptZICXTlJ7FQ09 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJR9ruyAAoJEJDCuSvBvK1B2OUQAKYEH7zcCVXK+9U4FBXwJHJc qvtKSL3WGoevcYmf3YWSJ0nlQahEv5eP+q5VHQXdoKykHzhhVhNuKAOSZ3Eyv6Lj Pr/05y0f6uiF9lrbDDjv7g2+dqBP+oWFkLl5bmRESyAaivEtDmn9ST3Xun+YUyEA Qqxg4ye/fU83juWIHPifY6VHp/BZ7TqSIn9HGWXu38Rdi7QkZFgXrWXmWrKJ+59X IvmUdT6UF0BxGiqnYrKRMxKEHYHeNbU+MgUL1r+6AuzT2yG8rMaONm1UADjvMm6d jq77QSc20W1sbm5pYv1ZnwUi3QgttywDJqIXOB8o4J04XUt6fybVnubCHr1PzrHL TKV038Zc5EUZBhfEZQDdUvrJf38VRNr2AFdjgqMRu//Wz9KPTCmvxKPLMsL+DEPL y+qXcY3VCyYtbnE5aJIg5bW1LvSAjbXVUzMFho0AZlChIrXxG0VBwR0guPVITzBu A6/XBAd6idMlz4Umg8QffXkaQv0rU23EZXoAo7J7IJsUqPb+Z04lC4S0/dohqFJW kvYvSHBc210d3ufmQoUY/5gpH4Be+cOgW4xnbLL73LkH+GhywyY4Cg+cbwuKd6kl QhW3rzFs7TTMn0a9hILTOxAmooDu3S93EqSQ4+lGTrHTD4TEdjDq/9PbXPsb6WP6 CQTfviFDirW97Cnp9Xx0 =Rrlz -----END PGP SIGNATURE----- --9DptZICXTlJ7FQ09-- From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 19:08:09 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A2EC97F2 for ; Mon, 29 Jul 2013 19:08:09 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c:c05::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3B2B92993 for ; Mon, 29 Jul 2013 19:08:09 +0000 (UTC) Received: by mail-wi0-f180.google.com with SMTP id f14so1269788wiw.7 for ; Mon, 29 Jul 2013 12:08: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; bh=/eF6Po/rUfht5Atfjkjj9jE2FpBa3Rl5JHMpxvlIfYk=; b=CgmtwIIj1d2iNBmfPq+bhm7fserYpHd1Sn+P32WFqHT2/LcbgmirF/QXmfLwykdfTc V8iAvvG5+ylN5eGajApShrzHKiCzAh/8D1wRmnn7iRoJQ8Yga0FBStaewa32x+fVQgip VkxXVOLrbtCQL8RJEZ39C/wMpOYbz3w8kwXRO20fzSHQti3pe8F3Z5QaHJJU3Lt5+iln IO+fEiwC1U4iy4otQHn/Ah39jtT00HwfIsGKPXQE4FGfN1HdifTIfvbLNxAAEfZDVsww qozGc7GKvp0WmT1wzZJ66E71U2lXBsksm+29tpfqiyuOR4wczfKsLOU+x+MmHyXL/6y7 UabA== MIME-Version: 1.0 X-Received: by 10.180.160.165 with SMTP id xl5mr8081005wib.46.1375124887617; Mon, 29 Jul 2013 12:08:07 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Mon, 29 Jul 2013 12:08:07 -0700 (PDT) In-Reply-To: <00b101ce8c8b$3db5f200$b921d600$@info> References: <00b101ce8c8b$3db5f200$b921d600$@info> Date: Mon, 29 Jul 2013 12:08:07 -0700 X-Google-Sender-Auth: z4AHTvnndamMlbddoJEaL6HkyEg Message-ID: Subject: Re: Wifi rates From: Adrian Chadd To: Cedric GROSS Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 19:08:09 -0000 Hi, So the trick here is that iwn uses the net80211 rate control API for doing things. Look at if_iwn.c for "ratectl". There's a spot in the TX path where it calls it to look up the rate. It then converts that rate to the iwn PLCP format for the given transmission rate. You can google "PLCP". Intel has a few extra bits in that field for controlling the NIC behaviour. THat bit is straight forward. Anyway - the trick here is that the net80211 rate control (amrr by default) is going to be selecting transmission rates. You can see the current rate by doing 'ifconfig wlan0 list sta'. Now, if you're running -HEAD net80211 / iwn then AMRR knows about 11n and if_iwn will happily use it. In the past it was hackier - AMRR didn't know about 11n rates and so iwn "faked" things by pretending it was doing non-11n, and then translating these to 11n rates. Hopefully you're running -HEAD and this is no longer a problem. So - do an "ifconfig -v wlan0 list sta" to list the station negotiation. It looks like it's doing 11ng but its downgraded to 11n. If you have IEEE80211_DEBUG defined in your kernel config - and you're building the modules correctly, rather than just "make" in the modules directory, which is _not the correct way_ - then you can use "wlandebug -i wlanX +rate" to see the AMRR rate selection debugging. Do that before you associate and it'll tell you as it's making rate decisions. HTH, -adrian On 29 July 2013 11:41, Cedric GROSS wrote: > Hello, > > > > Part of splitting work, I continue to investigate on my side for my NIC > (Centrino 2230). > > > > I notice that from ifconfig wlan0 : > > media: IEEE 802.11 Wireless Ethernet DS/1Mbps mode 11ng > > > > Rate is very slow and should be 54Mbps. > > > > I try to understand how rates is determined but it's really a mess. > > So first question : From where ifconfig get rate ? > > > > What's CCK, MCS, plcp stand for and what is relationship with rate ? > > > > I try following linux kernel also but it's a nightmare. > > > > Thanks. > > > > Cedric > > _______________________________________________ > 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" From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 19:56:41 2013 Return-Path: Delivered-To: wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B2A2CB98; Mon, 29 Jul 2013 19:56:41 +0000 (UTC) (envelope-from rpaulo@felyko.com) Received: from felyko.com (felyko.com [174.136.100.2]) by mx1.freebsd.org (Postfix) with ESMTP id 96FE22C5D; Mon, 29 Jul 2013 19:56:41 +0000 (UTC) Received: from [IPv6:2601:9:4d00:119:d5bd:470c:54f0:ad1c] (unknown [IPv6:2601:9:4d00:119:d5bd:470c:54f0:ad1c]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 9D8623982B; Mon, 29 Jul 2013 12:56:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1375127800; bh=THwjFTgHyKUTPQmZVvUi857CdVlGRoMd4JnV5VNK5mY=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=MzrlKPwt/FHpgYGe8S7MzLd5VQ8LR+tnX6X2lPhJq+HKR1nCMAKg+tpgCJfLZYCFq 42IinXY5K6zcO3SCagg+Z6B0eoly4UX3K+L5G4r72eoL7RiPx+FWIH1X0mAyyDR/se 22CjtDNCwZqJdC3Y4cG9T1v9Tq0rjCB4d1KBKJeI= Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: 802.1X: dhclient started before the auth. process ends From: Rui Paulo In-Reply-To: <51F6758C.9020004@dumbbell.fr> Date: Mon, 29 Jul 2013 12:56:40 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <5FE3C8E1-E073-423D-84E2-242D16CA31E4@felyko.com> References: <51F26CEB.9010200@dumbbell.fr> <20130729095946.GK59101@e-new.0x20.net> <51F6758C.9020004@dumbbell.fr> To: =?iso-8859-1?Q?Jean-S=E9bastien_P=E9dron?= X-Mailer: Apple Mail (2.1508) Cc: freebsd-current@freebsd.org, wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 19:56:41 -0000 On 29 Jul 2013, at 07:00, Jean-S=E9bastien P=E9dron = wrote: > On 29.07.2013 15:34, Adrian Chadd wrote: >> I think you were lucky. >=20 > I think you're right. >=20 > It works perfectly on FreeBSD 9.1, because wpa_supplicant finishes the > auth process really quickly, ie. before dhclient receives an answer = from > dhcpd from the unauthenticated network: >=20 > Jul 29 15:39:46 - kernel: bge0: link state changed to UP > Jul 29 15:39:46 - dhclient[46150]: DHCPREQUEST on bge0 to > 255.255.255.255 port 67 > Jul 29 15:39:47 - wpa_supplicant[46119]: CTRL-EVENT-EAP-STARTED EAP > authentication started > ... > Jul 29 15:39:47 - wpa_supplicant[46119]: CTRL-EVENT-EAP-SUCCESS EAP > authentication completed successfully > Jul 29 15:39:48 - dhclient[46150]: DHCPREQUEST on bge0 to > 255.255.255.255 port 67 > Jul 29 15:39:48 - dhclient[46150]: DHCPACK from 192.168.200.224 > Jul 29 15:39:48 - dhclient: New IP Address (bge0): 192.168.200.91 > Jul 29 15:39:48 - dhclient: New Subnet Mask (bge0): 255.255.255.0 > Jul 29 15:39:48 - dhclient: New Broadcast Address (bge0): = 192.168.200.255 > Jul 29 15:39:48 - dhclient: New Routers (bge0): 192.168.200.254 >=20 > On -CURRENT, wpa_supplicant is started more than 10 seconds after the > interface is UP and dhclient sent its request > (http://pastebin.com/ZHcbHLQZ). Therefore, a lease from the > unauthenticated network arrives first. It was working with a previous > -CURRENT (buildworld from around April if memory serves). Disable all the configuration settings and run wpa_supplicant -ddd -- Rui Paulo From owner-freebsd-wireless@FreeBSD.ORG Mon Jul 29 21:15:54 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 21437F1; Mon, 29 Jul 2013 21:15:54 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E8E7D2141; Mon, 29 Jul 2013 21:15:53 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id r6TLFeV2037401 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 29 Jul 2013 14:15:40 -0700 (PDT) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id r6TLFe26037400; Mon, 29 Jul 2013 14:15:40 -0700 (PDT) (envelope-from jmg) Date: Mon, 29 Jul 2013 14:15:40 -0700 From: John-Mark Gurney To: Hans Petter Selasky Subject: Re: My WLI-UC-GNM up crash Message-ID: <20130729211540.GZ26412@funkthat.com> Mail-Followup-To: Hans Petter Selasky , Warner Losh , Adrian Chadd , freebsd-arm , "freebsd-wireless@freebsd.org" References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Mon, 29 Jul 2013 14:15:40 -0700 (PDT) Cc: "freebsd-wireless@freebsd.org" , freebsd-arm , Warner Losh X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jul 2013 21:15:54 -0000 Hans Petter Selasky wrote this message on Mon, Jul 29, 2013 at 19:58 +0200: > The aligned will make sure that the structure gets padded properly to the size specified. Only on ARM/MIPS etc, structures get automatically aligned according to the element in the structure requiring the greatest alignment. I've test-compiled the USB WLAN drivers, and the aligned makes a difference. The problem is that the radiotap header skews some following elements, so that they are no longer aligned. The radiotap header itself is packed, and this is not a problem. Ouch, has anyone looked at the code that caused this? in ieee80211_radiotap.c, it looks like the original fault was in either set_channel, or set_xchannel, and both do (the equivalent of): struct { uint16_t freq; uint16_t flags; } *rc = p; rc->freq = htole16(c->ic_freq); rc->flags = htole16(c->ic_flags); And then there is complicated code that calculates offsets, etc, in radiotap_offset.. What we probably really need is to mark the above as __packed or equiv so that we don't assume that the passed in pointer is aligned... The whole management of this radiochan and radiotap_offset is pretty nasty... If marking the structures __packed works, it's probably because two bugs are offsetting, and magicly making things align again... > -----Original message----- > > From:Warner Losh > > > Sent: Monday 29th July 2013 17:04 > > To: Adrian Chadd > > > Cc: Hans Petter Selasky >; freebsd-arm >; freebsd-wireless@freebsd.org > > Subject: Re: My WLI-UC-GNM up crash > > > > Aren't structures already aligned to 4 bytes when placed inside other structures (unless marked __packed)? > > > > Warner > > > > On Jul 28, 2013, at 11:50 AM, Adrian Chadd wrote: > > > > > As long as that results in the radiotap structures being 4 or 8 byte > > > padded when it's embedded in the softc - then yes, indeed. > > > > > > Xiao, can you try? > > > > > > > > > -adrian > > > > > > On 28 July 2013 03:35, Hans Petter Selasky > wrote: > > >> Hi, > > >> > > >> Can you try the attached patch? > > >> > > >> --HPS > > > _______________________________________________ > > > freebsd-arm@freebsd.org mailing list > > > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > > > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org " > > > > > > _______________________________________________ > freebsd-arm@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-freebsd-wireless@FreeBSD.ORG Tue Jul 30 02:25:06 2013 Return-Path: Delivered-To: freebsd-wireless@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 618EC74C; Tue, 30 Jul 2013 02:25:06 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 24A8D2D3A; Tue, 30 Jul 2013 02:25:05 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1V3zcQ-0003qn-LO; Tue, 30 Jul 2013 02:24:58 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r6U2Otlr017693; Mon, 29 Jul 2013 20:24:55 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+E1uPtrsStc5/oJSWS8JDY Subject: Re: My WLI-UC-GNM up crash From: Ian Lepore To: John-Mark Gurney In-Reply-To: <20130729211540.GZ26412@funkthat.com> References: <20130729211540.GZ26412@funkthat.com> Content-Type: text/plain; charset="us-ascii" Date: Mon, 29 Jul 2013 20:24:55 -0600 Message-ID: <1375151095.45247.54.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-arm , "freebsd-wireless@freebsd.org" , Hans Petter Selasky X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jul 2013 02:25:06 -0000 On Mon, 2013-07-29 at 14:15 -0700, John-Mark Gurney wrote: > Hans Petter Selasky wrote this message on Mon, Jul 29, 2013 at 19:58 +0200: > > The aligned will make sure that the structure gets padded properly to the size specified. Only on ARM/MIPS etc, structures get automatically aligned according to the element in the structure requiring the greatest alignment. I've test-compiled the USB WLAN drivers, and the aligned makes a difference. The problem is that the radiotap header skews some following elements, so that they are no longer aligned. The radiotap header itself is packed, and this is not a problem. > > Ouch, has anyone looked at the code that caused this? > > in ieee80211_radiotap.c, it looks like the original fault was in either > set_channel, or set_xchannel, and both do (the equivalent of): > struct { > uint16_t freq; > uint16_t flags; > } *rc = p; > > rc->freq = htole16(c->ic_freq); > rc->flags = htole16(c->ic_flags); > If there's any chance the pointer isn't aligned in code like this, then htole16() is the wrong function, it should be using le16enc() such as le16enc(&rc->freq, c->ic_freq); le16enc(&rc->flags, c->ic_flags); With any luck, an x86 compiler can optimize the inline code for the endian enc/dec functions to take advantage of the platform's ability to do unaligned accesses. But that's a side issue to code correctness -- portable code has to get these things right even when it's inefficient. -- Ian > And then there is complicated code that calculates offsets, etc, in > radiotap_offset.. What we probably really need is to mark the above > as __packed or equiv so that we don't assume that the passed in pointer > is aligned... > > The whole management of this radiochan and radiotap_offset is pretty > nasty... If marking the structures __packed works, it's probably > because two bugs are offsetting, and magicly making things align > again... > > > -----Original message----- > > > From:Warner Losh > > > > Sent: Monday 29th July 2013 17:04 > > > To: Adrian Chadd > > > > Cc: Hans Petter Selasky >; freebsd-arm >; freebsd-wireless@freebsd.org > > > Subject: Re: My WLI-UC-GNM up crash > > > > > > Aren't structures already aligned to 4 bytes when placed inside other structures (unless marked __packed)? > > > > > > Warner > > > > > > On Jul 28, 2013, at 11:50 AM, Adrian Chadd wrote: > > > > > > > As long as that results in the radiotap structures being 4 or 8 byte > > > > padded when it's embedded in the softc - then yes, indeed. > > > > > > > > Xiao, can you try? > > > > > > > > > > > > -adrian > > > > > > > > On 28 July 2013 03:35, Hans Petter Selasky > wrote: > > > >> Hi, > > > >> > > > >> Can you try the attached patch? > > > >> > > > >> --HPS > > > > _______________________________________________ > > > > freebsd-arm@freebsd.org mailing list > > > > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > > > > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org " > > > > > > > > > > _______________________________________________ > > freebsd-arm@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" > From owner-freebsd-wireless@FreeBSD.ORG Tue Jul 30 09:33:19 2013 Return-Path: Delivered-To: freebsd-wireless@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 6E9A3ABD; Tue, 30 Jul 2013 09:33:19 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [IPv6:2001:41d0:8:dda6::1]) by mx1.freebsd.org (Postfix) with ESMTP id EA03620EC; Tue, 30 Jul 2013 09:33:18 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id EBF53916; Tue, 30 Jul 2013 11:33:16 +0200 (CEST) From: "Cedric GROSS" To: References: <00b101ce8c8b$3db5f200$b921d600$@info> In-Reply-To: Subject: RE: Wifi rates Date: Tue, 30 Jul 2013 11:33:12 +0200 Message-ID: <000c01ce8d07$d10a6550$731f2ff0$@info> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac6Mjvog19mySsMYQzutQzryQZdlswAdQbrA Content-Language: fr X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jul 2013 09:33:19 -0000 > De=A0: adrian.chadd@gmail.com [mailto:adrian.chadd@gmail.com] De la = part > de Adrian Chadd > Envoy=E9=A0: lundi 29 juillet 2013 21:08 > =C0=A0: Cedric GROSS > Cc=A0: freebsd-wireless@freebsd.org > Objet=A0: Re: Wifi rates >=20 > Hi, >=20 > So the trick here is that iwn uses the net80211 rate control API for > doing things. >=20 > Look at if_iwn.c for "ratectl". There's a spot in the TX path where it > calls it to look up the rate. >=20 > It then converts that rate to the iwn PLCP format for the given > transmission rate. You can google "PLCP". Intel has a few extra bits = in > that field for controlling the NIC behaviour. THat bit is straight > forward. >=20 > Anyway - the trick here is that the net80211 rate control (amrr by > default) is going to be selecting transmission rates. You can see the > current rate by doing 'ifconfig wlan0 list sta'. Now, if you're = running > -HEAD net80211 / iwn then AMRR knows about 11n and if_iwn will happily > use it. In the past it was hackier - AMRR didn't know about 11n rates > and so iwn "faked" things by pretending it was doing non-11n, and then > translating these to 11n rates. Hopefully you're running -HEAD and = this > is no longer a problem. >=20 > So - do an "ifconfig -v wlan0 list sta" to list the station > negotiation. It looks like it's doing 11ng but its downgraded to 11n. Right : [root@Test]/root#ifconfig -v wlan0 wlan0: flags=3D8843 metric 0 mtu = 1500 ether 60:36:dd:93:34:56 inet 192.168.1.20 netmask 0xffffff00 broadcast 192.168.1.255 nd6 options=3D29 media: IEEE 802.11 Wireless Ethernet MCS mode 11ng status: associated ssid WLenine channel 5 (2432 MHz 11g ht/20) bssid = 00:24:d4:97:80:20 regdomain 0 country US anywhere -ecm authmode WPA2/802.11i -wps = -tsn privacy ON deftxkey UNDEF AES-CCM 2:128-bit powersavemode OFF powersavesleep 100 txpower = 15 txpowmax 50.0 -dotd rtsthreshold 2346 fragthreshold 2346 bmiss = 10 11a ucast NONE mgmt 6 Mb/s mcast 6 Mb/s maxretry 6 11b ucast NONE mgmt 1 Mb/s mcast 1 Mb/s maxretry 6 11g ucast NONE mgmt 1 Mb/s mcast 1 Mb/s maxretry 6 turboA ucast NONE mgmt 6 Mb/s mcast 6 Mb/s maxretry 6 turboG ucast NONE mgmt 1 Mb/s mcast 1 Mb/s maxretry 6 sturbo ucast NONE mgmt 6 Mb/s mcast 6 Mb/s maxretry 6 11na ucast NONE mgmt 12 MCS mcast 12 MCS maxretry 6 11ng ucast NONE mgmt 2 MCS mcast 2 MCS maxretry 6 half ucast NONE mgmt 3 Mb/s mcast 3 Mb/s maxretry 6 quarter ucast NONE mgmt 1 Mb/s mcast 1 Mb/s maxretry 6 scanvalid 450 bgscan bgscanintvl 300 bgscanidle 250 roam:11a rssi 7dBm rate 12 Mb/s roam:11b rssi 7dBm rate 1 Mb/s roam:11g rssi 7dBm rate 5 Mb/s roam:turboA rssi 7dBm rate 12 Mb/s roam:turboG rssi 7dBm rate 12 Mb/s roam:sturbo rssi 7dBm rate 12 Mb/s roam:11na rssi 7dBm MCS 1 roam:11ng rssi 7dBm MCS 1 roam:half rssi 7dBm rate 6 Mb/s roam:quarter rssi 7dBm rate 3 Mb/s -pureg protmode CTS ht htcompat ampdu ampdulimit 64k = ampdudensity NA -amsdutx amsdurx shortgi htprotmode RTSCTS -puren -smps -rifs = wme -burst -dwds roaming MANUAL bintval 96 AC_BE cwmin 4 cwmax 10 aifs 3 txopLimit 0 -acm ack cwmin 4 cwmax 10 aifs 3 txopLimit 0 -acm AC_BK cwmin 4 cwmax 10 aifs 7 txopLimit 0 -acm ack cwmin 4 cwmax 10 aifs 7 txopLimit 0 -acm AC_VI cwmin 3 cwmax 4 aifs 2 txopLimit 94 -acm ack cwmin 3 cwmax 4 aifs 2 txopLimit 94 -acm AC_VO cwmin 2 cwmax 3 aifs 2 txopLimit 47 -acm ack cwmin 2 cwmax 3 aifs 2 txopLimit 47 -acm groups: wlan [root@Test]/root#ifconfig -v wlan0 list sta ADDR AID CHAN RATE RSSI IDLE TXSEQ RXSEQ CAPS FLAG 00:24:d4:97:80:20 2 5 6M 18.5 0 1162 58480 EP AQEHTRS SSID RATES DSPARMS<5> ERP<0x4> XRATES<48,72,96,108> RSN HTCAP HTINFO WME [root@Test]/root#ifconfig -v wlan0 list chan Channel 5 : 2432 MHz 11b Channel 5 : 2432 MHz 11g Channel 5 : 2432 MHz 11g ht/20 Channel 5 : 2432 MHz 11g ht/40+ Channel 5 : 2432 MHz 11g ht/40- And the amrr output : Test kernel: wlan0: [00:24:d4:97:80:20] amrr_node_init: non-11n node Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: nrates=3D0, initial rate 0 Test kernel: wlan0: [00:24:d4:97:80:20] amrr_node_init: 11n node Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: nrates=3D16, initial rate = 128 Test kernel: wlan0: [00:24:d4:97:80:20] recv auth frame with algorithm 0 = seq 2 Test kernel: wlan0: [00:24:d4:97:80:20] amrr_node_init: 11n node Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: nrates=3D16, initial rate = 128 Test kernel: wlan0: link state changed to UP Test dhclient: New IP Address (wlan0): 192.168.1.20 Test dhclient: New Subnet Mask (wlan0): 255.255.255.0 Test dhclient: New Broadcast Address (wlan0): 192.168.1.255 Test dhclient: New Routers (wlan0): 192.168.1.254 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, = txcnt=3D12, retrycnt=3D144 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR decreasing rate 14 = (txcnt=3D12 retrycnt=3D144) Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 14, = txcnt=3D12, retrycnt=3D192 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR decreasing rate 13 = (txcnt=3D12 retrycnt=3D192) Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 13, = txcnt=3D11, retrycnt=3D176 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR decreasing rate 12 = (txcnt=3D11 retrycnt=3D176) ... And so on until Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 0, = txcnt=3D11, retrycnt=3D176 Test last message repeated 2 times Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 0, = txcnt=3D12, retrycnt=3D192 What is 'nrates' and 'rate' in start of output ? Is nrates an index in = rate table ? After the dhclient, I started a ftp file transfer. As you can see rate decrease to 0 very quickly. Is the 'current rate' same as initial nrates value ? I've found this for MCS : http://www.digitalairwireless.com/wireless-blog/recent/demystifying-modul= ati on-and-coding-scheme-index-values.html From owner-freebsd-wireless@FreeBSD.ORG Tue Jul 30 12:44:11 2013 Return-Path: Delivered-To: wireless@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 A1C33569; Tue, 30 Jul 2013 12:44:11 +0000 (UTC) (envelope-from jean-sebastien.pedron@dumbbell.fr) Received: from mail.made4.biz (unknown [IPv6:2001:41d0:1:7018::1:3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5DDB72F74; Tue, 30 Jul 2013 12:44:11 +0000 (UTC) Received: from [2001:1b48:10b:cafe:225:64ff:febe:589f] (helo=viking.yzserv.com) by mail.made4.biz with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1V49Hb-000Da6-W0; Tue, 30 Jul 2013 14:44:08 +0200 Message-ID: <51F7B50E.30708@dumbbell.fr> Date: Tue, 30 Jul 2013 14:43:58 +0200 From: =?ISO-8859-1?Q?Jean-S=E9bastien_P=E9dron?= User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130626 Thunderbird/17.0.7 MIME-Version: 1.0 To: Rui Paulo Subject: Re: 802.1X: dhclient started before the auth. process ends References: <51F26CEB.9010200@dumbbell.fr> <20130729095946.GK59101@e-new.0x20.net> <51F6758C.9020004@dumbbell.fr> <5FE3C8E1-E073-423D-84E2-242D16CA31E4@felyko.com> In-Reply-To: <5FE3C8E1-E073-423D-84E2-242D16CA31E4@felyko.com> X-Enigmail-Version: 1.5.1 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2FJUOAEFCEQQIEVNILNSV" Cc: freebsd-current@freebsd.org, wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jul 2013 12:44:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2FJUOAEFCEQQIEVNILNSV Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 29.07.2013 21:56, Rui Paulo wrote: > Disable all the configuration settings and run wpa_supplicant -ddd > I'm not sure I understand what you mean by "disable all the configuration settings" but I did some more tests by running wpa_supplicant manually (ie. not using netif script) with the same optio= ns. I found that when the interface (here, bge0) is already UP before running wpa_supplicant, the authentication process is fast. However, when the interface is DOWN, wpa_supplicant "associates" quickly but the authentication process starts between 5 and 20 seconds after. Here's a log with both run (with interface UP then DOWN): http://pastebin.com/f5ydiBpV This delay is new with the recent 10-CURRENT. A comment about the behavior I would expect (but keep in mind I'm a dumb user here, not a network expert at all). I see in the logs that when issueing "service netif restart bge0": 1. the interface is put DOWN, which terminates a previous dhclient 2. wpa_supplicant is stopped 3. wpa_supplicant is started again 4. wpa_supplicant associates with a remote peer, which puts the interface UP and triggers dhclient I guess that this works for a Wifi network because the association is only valid after the authentication finishes successfully. However, with 802.1X not involving Wifi (only wired), the association is made right at the beginning (see the logs I pasted), putting the interface UP (and triggering dhclient) before the authentication starts. --=20 Jean-S=E9bastien P=E9dron ------enig2FJUOAEFCEQQIEVNILNSV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlH3tRcACgkQa+xGJsFYOlNWewCfbGiWPrxkAGtJSpfvJgpqEmqN 4hYAn2fJw0Ko+AwOEYd62a8cCb7GMRjE =34Q/ -----END PGP SIGNATURE----- ------enig2FJUOAEFCEQQIEVNILNSV-- From owner-freebsd-wireless@FreeBSD.ORG Tue Jul 30 17:19:28 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C01CF219 for ; Tue, 30 Jul 2013 17:19:28 +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 44E3A2044 for ; Tue, 30 Jul 2013 17:19:28 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id a12so2462476wgh.6 for ; Tue, 30 Jul 2013 10:19:26 -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; bh=SKHboYZ+XJJbaw6TH5YKWJxqwJFpDNBixRr8XTmRFmk=; b=JuxQQsdJCa6rg2ibqBdF5OfvSSoZGxwb+i2LTy8C78u/ih+/0/LGB7W3itGekGtK6r KJH4/N3kQC+4xt7b8lyyFCmsnIoz3mkAAx21Cxa0AXephEYyxTVhaxE33GSdgZMxJd/l /3xe7nXXK58X2ieziXV43emIdAL9+gxdRHsOJltIEI+7KREnMrz+iSqsIcrGvuH7xMY0 5FPgk8XALjg0J2+baVCHcSnHy4R1l9iCZR1AgvJThZ4n6dHA1hKbkOO7AQ34GG+06H9X 5FE7gmRgu/pwA6NKRT7oZ//nWO6l5miqZqME+vvFhE6QTUq7C2+mLVFx17fSlMZLTh/J p91w== MIME-Version: 1.0 X-Received: by 10.180.39.212 with SMTP id r20mr1691449wik.30.1375204766352; Tue, 30 Jul 2013 10:19:26 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Tue, 30 Jul 2013 10:19:26 -0700 (PDT) In-Reply-To: <000c01ce8d07$d10a6550$731f2ff0$@info> References: <00b101ce8c8b$3db5f200$b921d600$@info> <000c01ce8d07$d10a6550$731f2ff0$@info> Date: Tue, 30 Jul 2013 10:19:26 -0700 X-Google-Sender-Auth: FEyB4CwyuKWt7YNwtFyrVH7EBDE Message-ID: Subject: Re: Wifi rates From: Adrian Chadd To: Cedric GROSS Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jul 2013 17:19:28 -0000 On 30 July 2013 02:33, Cedric GROSS wrote: > [root@Test]/root#ifconfig -v wlan0 list sta > ADDR AID CHAN RATE RSSI IDLE TXSEQ RXSEQ CAPS FLAG > 00:24:d4:97:80:20 2 5 6M 18.5 0 1162 58480 EP AQEHTRS > SSID RATES B22,12,18,24,36> DSPARMS<5> ERP<0x4> XRATES<48,72,96,108> RSN uc:AES-CCMP km:8021X-PS > K> HTCAP > HTINFO asicmcs[]> WME cwmin 4 cwmax 10 txop 0] V > O[aifsn 2 cwmin 3 cwmax 4 txop 94] VI[aifsn 2 cwmin 2 cwmax 3 txop 47]> Right, there's HT elements in there, so it looks likely you properly negotiated HT. > And the amrr output : > Test kernel: wlan0: [00:24:d4:97:80:20] amrr_node_init: non-11n node > Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: nrates=0, initial rate 0 That's the initial "I don't know what you are yet" selection. > Test kernel: wlan0: [00:24:d4:97:80:20] amrr_node_init: 11n node > Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: nrates=16, initial rate 128 Here it negotiated 11n. The initial rate is 0x80, so MCS 0. > Test kernel: wlan0: [00:24:d4:97:80:20] recv auth frame with algorithm 0 seq > 2 > Test kernel: wlan0: [00:24:d4:97:80:20] amrr_node_init: 11n node > Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: nrates=16, initial rate 128 > Test kernel: wlan0: link state changed to UP > Test dhclient: New IP Address (wlan0): 192.168.1.20 > Test dhclient: New Subnet Mask (wlan0): 255.255.255.0 > Test dhclient: New Broadcast Address (wlan0): 192.168.1.255 > Test dhclient: New Routers (wlan0): 192.168.1.254 > Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=12, > retrycnt=144 The rate index starts at MCS0. > Test kernel: wlan0: [00:24:d4:97:80:20] AMRR decreasing rate 14 (txcnt=12 > retrycnt=144) > Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 14, txcnt=12, > retrycnt=192 > Test kernel: wlan0: [00:24:d4:97:80:20] AMRR decreasing rate 13 (txcnt=12 > retrycnt=192) > Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 13, txcnt=11, > retrycnt=176 > Test kernel: wlan0: [00:24:d4:97:80:20] AMRR decreasing rate 12 (txcnt=11 > retrycnt=176) > ... > And so on until > Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 0, txcnt=11, > retrycnt=176 > Test last message repeated 2 times > Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 0, txcnt=12, > retrycnt=192 And since there's errors at all transmission rates (look at the retrycnt), it eventually drops you down to 1mb. > What is 'nrates' and 'rate' in start of output ? Is nrates an index in rate > table ? Yes, look in ieee80211_phy.c . > After the dhclient, I started a ftp file transfer. As you can see rate > decrease to 0 very quickly. > Is the 'current rate' same as initial nrates value ? Nope. The debugging isn't very clear and I should fix it. But it's starting in the 11n rate table at MCS0 and it's going down very quickly into the non-11n rates. > I've found this for MCS : > http://www.digitalairwireless.com/wireless-blog/recent/demystifying-modulati > on-and-coding-scheme-index-values.html MCS is the 11n encoding scheme. So you're seeing significant transmit retries. That's worth investigating. (We still have to merge more code into -HEAD though.) -adrian From owner-freebsd-wireless@FreeBSD.ORG Wed Jul 31 08:36:31 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3264B408 for ; Wed, 31 Jul 2013 08:36:31 +0000 (UTC) (envelope-from ghw@7axu.com) Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B876B21B6 for ; Wed, 31 Jul 2013 08:36:30 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id l18so330416wgh.23 for ; Wed, 31 Jul 2013 01:36:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding :x-gm-message-state; bh=CvzjtvkqZyAc5cgn6ZqHgcdiB3Bi2xhpAPPvhJBbz7I=; b=MjDHRFB/yimg1sNMY6NAQK+1jkakVATlaojKKLOgg63QacRDLBtiJZywqf1YnpQWhm cOf/alkIjb5KZd+NAt749Rk5HyMf3VuzCH4B3JkytIBD5bCUFlWbA3P8A5uaCa1b3+iV u71MtB8WaLFy9VZ2gGTSXDJEbfYzANiiDsspltPnz8LgXmF5R4WU5mr9FmDO6CV8/Zac kiYswr2dn4pRoQpqlwdeqLXPIpJ0cV9C8v6cfs16XBBSGzBs9hvKB7/WZjLfyiy2Rzx1 yVmmdMFdgE9HRkuxJleESy4ySBgWkyteijByVzEzTNkulD+S5QYHZfV3UomUqpkHZoBQ 1+1g== X-Received: by 10.194.20.163 with SMTP id o3mr7951350wje.53.1375259337809; Wed, 31 Jul 2013 01:28:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.93.34 with HTTP; Wed, 31 Jul 2013 01:28:17 -0700 (PDT) X-Originating-IP: [54.249.112.206] In-Reply-To: <1375151095.45247.54.camel@revolution.hippie.lan> References: <20130729211540.GZ26412@funkthat.com> <1375151095.45247.54.camel@revolution.hippie.lan> From: XiaoQI Ge Date: Wed, 31 Jul 2013 16:28:17 +0800 Message-ID: Subject: Re: My WLI-UC-GNM up crash To: Ian Lepore Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQmH7KOWrbJSxGGYAqeIn6W14mEU3Ob/FgJiYZeGB7Mde+krJaZWyWjhEF0IWJDNi2QhHZ9W Cc: John-Mark Gurney , "freebsd-wireless@freebsd.org" , freebsd-arm , Hans Petter Selasky X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2013 08:36:31 -0000 Last night, I use the latest FreeBSD source (r253827) and crochet-freebsd compile img My WLI-UC-GNM will be disconnected after a period of operation run0: device timeout run0: at uhub0, port 1, addr 2 (disconnected) Another log prompted ti_mmchs0: Error: current cmd NULL, already done? My BB-Black broken? -- Regards. By: XiaoQI Ge; PGP:8B09D5F7 WWW: https://www.7axu.com/ 2013/7/30 Ian Lepore : > On Mon, 2013-07-29 at 14:15 -0700, John-Mark Gurney wrote: >> Hans Petter Selasky wrote this message on Mon, Jul 29, 2013 at 19:58 +02= 00: >> > The aligned will make sure that the structure gets padded properly to = the size specified. Only on ARM/MIPS etc, structures get automatically alig= ned according to the element in the structure requiring the greatest alignm= ent. I've test-compiled the USB WLAN drivers, and the aligned makes a diffe= rence. The problem is that the radiotap header skews some following element= s, so that they are no longer aligned. The radiotap header itself is packed= , and this is not a problem. >> >> Ouch, has anyone looked at the code that caused this? >> >> in ieee80211_radiotap.c, it looks like the original fault was in either >> set_channel, or set_xchannel, and both do (the equivalent of): >> struct { >> uint16_t freq; >> uint16_t flags; >> } *rc =3D p; >> >> rc->freq =3D htole16(c->ic_freq); >> rc->flags =3D htole16(c->ic_flags); >> > > If there's any chance the pointer isn't aligned in code like this, then > htole16() is the wrong function, it should be using le16enc() such as > > le16enc(&rc->freq, c->ic_freq); > le16enc(&rc->flags, c->ic_flags); > > With any luck, an x86 compiler can optimize the inline code for the > endian enc/dec functions to take advantage of the platform's ability to > do unaligned accesses. But that's a side issue to code correctness -- > portable code has to get these things right even when it's inefficient. > > -- Ian > >> And then there is complicated code that calculates offsets, etc, in >> radiotap_offset.. What we probably really need is to mark the above >> as __packed or equiv so that we don't assume that the passed in pointer >> is aligned... >> >> The whole management of this radiochan and radiotap_offset is pretty >> nasty... If marking the structures __packed works, it's probably >> because two bugs are offsetting, and magicly making things align >> again... >> >> > -----Original message----- >> > > From:Warner Losh > >> > > Sent: Monday 29th July 2013 17:04 >> > > To: Adrian Chadd > >> > > Cc: Hans Petter Selasky >; freebsd-arm >; freebsd-wireless@freebsd.org >> > > Subject: Re: My WLI-UC-GNM up crash >> > > >> > > Aren't structures already aligned to 4 bytes when placed inside othe= r structures (unless marked __packed)? >> > > >> > > Warner >> > > >> > > On Jul 28, 2013, at 11:50 AM, Adrian Chadd wrote: >> > > >> > > > As long as that results in the radiotap structures being 4 or 8 by= te >> > > > padded when it's embedded in the softc - then yes, indeed. >> > > > >> > > > Xiao, can you try? >> > > > >> > > > >> > > > -adrian >> > > > >> > > > On 28 July 2013 03:35, Hans Petter Selasky > wrote: >> > > >> Hi, >> > > >> >> > > >> Can you try the attached patch? >> > > >> >> > > >> --HPS >> > > > _______________________________________________ >> > > > freebsd-arm@freebsd.org mailing = list >> > > > http://lists.freebsd.org/mailman/listinfo/freebsd-arm >> > > > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.= org " >> > > >> > > >> > >> > _______________________________________________ >> > freebsd-arm@freebsd.org mailing list >> > http://lists.freebsd.org/mailman/listinfo/freebsd-arm >> > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" >> > > > _______________________________________________ > freebsd-arm@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" From owner-freebsd-wireless@FreeBSD.ORG Wed Jul 31 13:37:01 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2C20A15C; Wed, 31 Jul 2013 13:37:01 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [IPv6:2001:41d0:8:dda6::1]) by mx1.freebsd.org (Postfix) with ESMTP id 8D633226F; Wed, 31 Jul 2013 13:37:00 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id 3D228BC5; Wed, 31 Jul 2013 15:36:56 +0200 (CEST) From: "Cedric GROSS" To: References: <00b101ce8c8b$3db5f200$b921d600$@info> <000c01ce8d07$d10a6550$731f2ff0$@info> In-Reply-To: Subject: RE: Wifi rates Date: Wed, 31 Jul 2013 15:36:53 +0200 Message-ID: <001e01ce8df3$06377470$12a65d50$@info> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac6NSPW45DbHGgUjS02Rdd+WAsvLVgApwmbg Content-Language: fr X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2013 13:37:01 -0000 Hello, > > Right, there's HT elements in there, so it looks likely you properly > negotiated HT. > > > > And the amrr output : > > Test kernel: wlan0: [00:24:d4:97:80:20] amrr_node_init: non-11n node > > Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: nrates=0, initial rate > 0 > > That's the initial "I don't know what you are yet" selection. > > > Test kernel: wlan0: [00:24:d4:97:80:20] amrr_node_init: 11n node Test > > kernel: wlan0: [00:24:d4:97:80:20] AMRR: nrates=16, initial rate 128 > > Here it negotiated 11n. The initial rate is 0x80, so MCS 0. > I made progress : Jul 31 14:59:40 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=11, retrycnt=0 Jul 31 14:59:48 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=11, retrycnt=0 Jul 31 14:59:50 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=11, retrycnt=0 Jul 31 14:59:59 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=11, retrycnt=0 Jul 31 15:00:01 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=11, retrycnt=0 Jul 31 15:00:02 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=158, retrycnt=0 Jul 31 15:00:02 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=255, retrycnt=0 Jul 31 15:00:03 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=260, retrycnt=4 Jul 31 15:00:03 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=160, retrycnt=0 Jul 31 15:00:04 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=132, retrycnt=0 Jul 31 15:00:04 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=213, retrycnt=0 Jul 31 15:00:05 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=203, retrycnt=0 Jul 31 15:00:05 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=214, retrycnt=0 Jul 31 15:00:06 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=186, retrycnt=1 Jul 31 15:00:06 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=216, retrycnt=2 Jul 31 15:00:07 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=243, retrycnt=1 Jul 31 15:00:08 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=185, retrycnt=0 Jul 31 15:00:08 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=122, retrycnt=0 Jul 31 15:00:09 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=133, retrycnt=0 Jul 31 15:00:09 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=185, retrycnt=2 Jul 31 15:00:10 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=165, retrycnt=0 Jul 31 15:00:11 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=114, retrycnt=0 Jul 31 15:00:28 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=11, retrycnt=0 Jul 31 15:00:29 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=227, retrycnt=0 Jul 31 15:00:29 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=255, retrycnt=0 Jul 31 15:00:30 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=241, retrycnt=0 Jul 31 15:00:30 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=99, retrycnt=0 Jul 31 15:00:31 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=199, retrycnt=0 Jul 31 15:00:31 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=111, retrycnt=2 Jul 31 15:00:32 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=171, retrycnt=0 Jul 31 15:00:33 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=210, retrycnt=3 Jul 31 15:00:33 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=122, retrycnt=1 Jul 31 15:00:34 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=218, retrycnt=0 Jul 31 15:00:35 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=95, retrycnt=1 Jul 31 15:00:43 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=11, retrycnt=0 Jul 31 15:00:44 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, txcnt=22, retrycnt=0 Jul 31 15:01:56 Test kernel: wlan0: [60:36:dd:93:34:56] amrr_node_init: non-11n node Jul 31 15:01:56 Test kernel: wlan0: [60:36:dd:93:34:56] AMRR: nrates=0, initial rate 0 File transfer is still chaotic but start well. I've done a TCP dump during transfer. It's seem that TCP window fill up and it's why transfer stop and speed going down. Sometime transfer restart, sometime just hang. Just to be sure: window size value in TCP packet is the window size available from emitter ? > > > -adrian Cedric From owner-freebsd-wireless@FreeBSD.ORG Wed Jul 31 13:41:24 2013 Return-Path: Delivered-To: freebsd-wireless@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0C2D5262; Wed, 31 Jul 2013 13:41:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D4D7522B1; Wed, 31 Jul 2013 13:41:23 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1V4WeT-000JlP-IZ; Wed, 31 Jul 2013 13:41:17 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r6VDfCUP020048; Wed, 31 Jul 2013 07:41:12 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19sf/dPQ27yttnY07OIdUyK Subject: Re: My WLI-UC-GNM up crash From: Ian Lepore To: XiaoQI Ge In-Reply-To: References: <20130729211540.GZ26412@funkthat.com> <1375151095.45247.54.camel@revolution.hippie.lan> Content-Type: text/plain; charset="us-ascii" Date: Wed, 31 Jul 2013 07:41:11 -0600 Message-ID: <1375278071.45247.144.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-arm , "freebsd-wireless@freebsd.org" , Hans Petter Selasky X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2013 13:41:24 -0000 On Wed, 2013-07-31 at 16:28 +0800, XiaoQI Ge wrote: > Last night, I use the latest FreeBSD source (r253827) and > crochet-freebsd compile img > My WLI-UC-GNM will be disconnected after a period of operation > > run0: device timeout > run0: at uhub0, port 1, addr 2 (disconnected) > > Another log prompted > ti_mmchs0: Error: current cmd NULL, already done? > > My BB-Black broken? The ti_mmchs0 error is not new. My old BBW has done that for months. I'm not sure it's totally harmless, but it's not related to the run0 timeouts. -- Ian From owner-freebsd-wireless@FreeBSD.ORG Wed Jul 31 15:01:44 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 12BE8CD for ; Wed, 31 Jul 2013 15:01:44 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 866C626DF for ; Wed, 31 Jul 2013 15:01:43 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id l18so696799wgh.23 for ; Wed, 31 Jul 2013 08:01:41 -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; bh=edjtaddPUZtIB/qPMlvvE1pbD5JGzaEBHcvcrjXXezs=; b=oCiNolRnX1K+wM01Gt9YbdA86e43vo78p3yf8FiOKz/XwsFowUIMUZeKhXXnkM2dh/ PUph/MKjU8lvQYDMFk6cntdDEGgdoMZjPd5+lqJRICCrM7OZAxYZo3mJ89WudjMr2fQe crjLeN2Yt2qyIMEotoUvtBzRaGqwMrmgGWdy3LYvhgUPwXzNRs0QFXqxvIenL/ONjG2o MHmFLj9d3ONmWSrfZi+71v/HEfyBXyHs97IoN/7leWNpsRe4Opb/Dq/oNOrXz+W2vlHN nL8PCE1sxT9w2iuoT3hG0I/Ft2OwV7duivT4d0fd2SX80Z/fkeQjS53lh56CalELgERi AN7A== MIME-Version: 1.0 X-Received: by 10.194.201.202 with SMTP id kc10mr10836647wjc.1.1375282901676; Wed, 31 Jul 2013 08:01:41 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Wed, 31 Jul 2013 08:01:41 -0700 (PDT) In-Reply-To: <001e01ce8df3$06377470$12a65d50$@info> References: <00b101ce8c8b$3db5f200$b921d600$@info> <000c01ce8d07$d10a6550$731f2ff0$@info> <001e01ce8df3$06377470$12a65d50$@info> Date: Wed, 31 Jul 2013 08:01:41 -0700 X-Google-Sender-Auth: zutj7nRZg3T-R6ORP14GrZcZCtM Message-ID: Subject: Re: Wifi rates From: Adrian Chadd To: Cedric GROSS Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2013 15:01:44 -0000 Hi, Let's merge some more stuff into -HEAD first. it's likely there's some RF configuration problem which we can dig into in more detail but I can't do it whilst we've got broken Intel 5100 support (as then MY laptop doesn't work!) I have a spectrum analyser and I'm not afraid to use it. -adrian On 31 July 2013 06:36, Cedric GROSS wrote: > Hello, > >> >> Right, there's HT elements in there, so it looks likely you properly >> negotiated HT. >> >> >> > And the amrr output : >> > Test kernel: wlan0: [00:24:d4:97:80:20] amrr_node_init: non-11n node >> > Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: nrates=0, initial rate >> 0 >> >> That's the initial "I don't know what you are yet" selection. >> >> > Test kernel: wlan0: [00:24:d4:97:80:20] amrr_node_init: 11n node Test >> > kernel: wlan0: [00:24:d4:97:80:20] AMRR: nrates=16, initial rate 128 >> >> Here it negotiated 11n. The initial rate is 0x80, so MCS 0. >> > > I made progress : > Jul 31 14:59:40 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=11, retrycnt=0 > Jul 31 14:59:48 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=11, retrycnt=0 > Jul 31 14:59:50 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=11, retrycnt=0 > Jul 31 14:59:59 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=11, retrycnt=0 > Jul 31 15:00:01 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=11, retrycnt=0 > Jul 31 15:00:02 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=158, retrycnt=0 > Jul 31 15:00:02 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=255, retrycnt=0 > Jul 31 15:00:03 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=260, retrycnt=4 > Jul 31 15:00:03 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=160, retrycnt=0 > Jul 31 15:00:04 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=132, retrycnt=0 > Jul 31 15:00:04 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=213, retrycnt=0 > Jul 31 15:00:05 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=203, retrycnt=0 > Jul 31 15:00:05 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=214, retrycnt=0 > Jul 31 15:00:06 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=186, retrycnt=1 > Jul 31 15:00:06 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=216, retrycnt=2 > Jul 31 15:00:07 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=243, retrycnt=1 > Jul 31 15:00:08 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=185, retrycnt=0 > Jul 31 15:00:08 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=122, retrycnt=0 > Jul 31 15:00:09 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=133, retrycnt=0 > Jul 31 15:00:09 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=185, retrycnt=2 > Jul 31 15:00:10 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=165, retrycnt=0 > Jul 31 15:00:11 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=114, retrycnt=0 > Jul 31 15:00:28 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=11, retrycnt=0 > Jul 31 15:00:29 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=227, retrycnt=0 > Jul 31 15:00:29 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=255, retrycnt=0 > Jul 31 15:00:30 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=241, retrycnt=0 > Jul 31 15:00:30 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=99, retrycnt=0 > Jul 31 15:00:31 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=199, retrycnt=0 > Jul 31 15:00:31 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=111, retrycnt=2 > Jul 31 15:00:32 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=171, retrycnt=0 > Jul 31 15:00:33 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=210, retrycnt=3 > Jul 31 15:00:33 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=122, retrycnt=1 > Jul 31 15:00:34 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=218, retrycnt=0 > Jul 31 15:00:35 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=95, retrycnt=1 > Jul 31 15:00:43 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=11, retrycnt=0 > Jul 31 15:00:44 Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate > 15, txcnt=22, retrycnt=0 > Jul 31 15:01:56 Test kernel: wlan0: [60:36:dd:93:34:56] amrr_node_init: > non-11n node > Jul 31 15:01:56 Test kernel: wlan0: [60:36:dd:93:34:56] AMRR: nrates=0, > initial rate 0 > > File transfer is still chaotic but start well. > I've done a TCP dump during transfer. It's seem that TCP window fill up and > it's why transfer stop and speed going down. > Sometime transfer restart, sometime just hang. > > Just to be sure: window size value in TCP packet is the window size > available from emitter ? > >> >> >> -adrian > > Cedric > From owner-freebsd-wireless@FreeBSD.ORG Wed Jul 31 15:08:30 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8F32724B for ; Wed, 31 Jul 2013 15:08:30 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x235.google.com (mail-wg0-x235.google.com [IPv6:2a00:1450:400c:c00::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 228BE272E for ; Wed, 31 Jul 2013 15:08:29 +0000 (UTC) Received: by mail-wg0-f53.google.com with SMTP id c11so723798wgh.32 for ; Wed, 31 Jul 2013 08:08:28 -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; bh=ftkn8Cxf7DFYOZeBK4UI5R9WmXGhEGVssQyrUrfnpME=; b=efREXIFRKa2EirHGUEp57AD2EwmuRBYT0hfcJoszU05jsqqovjNvKiD6LBDY4lOzkM kGCwcHWpnJljWW1ttBf/rqlQSQO3faz9GHtAHVlW6T/YA1rG5qc8I0xq6NiCLH1ngq6P USnIIC7941GARaRBYNiVxTNufiDeK8ZNDQSUqzDIFCGkz5EMsloKgwgjLxAAkwneXQR1 lgJjGDABjU0mzW7WMi7mLNyZGH2sU5NKk/5fwNij3kGha4EAVvFzjyxTyWxRR1NQULrS SA3VTuEzkbGlM3CqkOodHT1JWd5TqizpT1JSRCFFk+Q+klkXD0jSbXnvkiziFXW4fwqM lUDQ== MIME-Version: 1.0 X-Received: by 10.180.82.196 with SMTP id k4mr4742159wiy.0.1375283308294; Wed, 31 Jul 2013 08:08:28 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Wed, 31 Jul 2013 08:08:28 -0700 (PDT) In-Reply-To: <002d01ce8c46$a13b23d0$e3b16b70$@info> References: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> <002d01ce8c46$a13b23d0$e3b16b70$@info> Date: Wed, 31 Jul 2013 08:08:28 -0700 X-Google-Sender-Auth: -MYQU4-5r8eIUuMXaoUOLZHahjk Message-ID: Subject: Re: [IWN] Reviw split 2 From: Adrian Chadd To: Cedric GROSS Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2013 15:08:30 -0000 Hi, There's some more whitespace things to fix in your diff. - ->......>.......>.......bus_dmamap_sync(sc->rxq.data_dmat, data->map, ->......>.......>....... BUS_DMASYNC_POSTREAD); ->......>.......>.......DPRINTF(sc, IWN_DEBUG_ANY, +>......>.......>.......>.......DPRINTF(sc, IWN_DEBUG_ANY, >......>.......>....... "%s: scanning channel %d status %x\n", >......>.......>....... __func__, scan->chan, le32toh(scan->status)); .. notice how you've indented DPRINTF there? You should fix that. :) +#ifdef>IWN_DEBUG +#define IWN_DESC(x) case x:>...return #x +#define COUNTOF(array) (sizeof(array) / sizeof(array[0])) There should be a tab between the #define and the thing you're defining, rather than a space. + * This function print firmawre register .. typo, that should be "firmware" :) +>......}; +>......DPRINTF(sc, IWN_DEBUG_REGISTER, + "CSR values: (2nd byte of IWN_INT_COALESCING is IWN_INT_PERIODIC)%s", + "\n"); +>......for (i = 0; i < COUNTOF(csr_tbl); i++){ .. there needs to be a tab in front of the two lines after the DPRINTF(). Well, strictly speaking, there should be a tab (to bring it to the same indent level) and then four spaces (as it's a continuation of the line above it.) Now, you're making IWN_DEBUG an option, right? Once you've done this, I'll go make sure you can put it in the kernel config file as a build option (and I'll enable it by default on i386/amd64.) Thanks! -adrian From owner-freebsd-wireless@FreeBSD.ORG Wed Jul 31 15:36:42 2013 Return-Path: Delivered-To: freebsd-wireless@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 A34EF6EC; Wed, 31 Jul 2013 15:36:42 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [IPv6:2001:41d0:8:dda6::1]) by mx1.freebsd.org (Postfix) with ESMTP id EB936285F; Wed, 31 Jul 2013 15:36:41 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id F10C2C2F; Wed, 31 Jul 2013 17:36:40 +0200 (CEST) From: "Cedric GROSS" To: "'Adrian Chadd'" References: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> <002d01ce8c46$a13b23d0$e3b16b70$@info> In-Reply-To: Subject: RE: [IWN] Reviw split 2 Date: Wed, 31 Jul 2013 17:36:37 +0200 Message-ID: <002701ce8e03$c033f640$409be2c0$@info> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0028_01CE8E14.83BCC640" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac6N/9POFFLLrjYzQjuKzsYNvbnwdgAA3uHw Content-Language: fr Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2013 15:36:42 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_0028_01CE8E14.83BCC640 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > -----Message d'origine----- > De=A0: adrian.chadd@gmail.com [mailto:adrian.chadd@gmail.com] De la = part > de Adrian Chadd > Envoy=E9=A0: mercredi 31 juillet 2013 17:08 > =C0=A0: Cedric GROSS > Cc=A0: freebsd-wireless@freebsd.org > Objet=A0: Re: [IWN] Reviw split 2 >=20 > Hi, >=20 > There's some more whitespace things to fix in your diff. >=20 > - > ->......>.......>.......bus_dmamap_sync(sc->rxq.data_dmat, data->map, > ->......>.......>....... BUS_DMASYNC_POSTREAD); > ->......>.......>.......DPRINTF(sc, IWN_DEBUG_ANY, > +>......>.......>.......>.......DPRINTF(sc, IWN_DEBUG_ANY, > >......>.......>....... "%s: scanning channel %d status %x\n", > >......>.......>....... __func__, scan->chan, le32toh(scan- > >status)); >=20 > .. notice how you've indented DPRINTF there? You should fix that. :) Fixed. >=20 > +#ifdef>IWN_DEBUG > +#define IWN_DESC(x) case x:>...return #x #define COUNTOF(array) > +(sizeof(array) / sizeof(array[0])) >=20 > There should be a tab between the #define and the thing you're > defining, rather than a space. Done. >=20 > + * This function print firmawre register >=20 > .. typo, that should be "firmware" :) Yep fixed. >=20 > +>......}; > +>......DPRINTF(sc, IWN_DEBUG_REGISTER, > + "CSR values: (2nd byte of IWN_INT_COALESCING is > IWN_INT_PERIODIC)%s", > + "\n"); > +>......for (i =3D 0; i < COUNTOF(csr_tbl); i++){ >=20 > .. there needs to be a tab in front of the two lines after the > DPRINTF(). Well, strictly speaking, there should be a tab (to bring it > to the same indent level) and then four spaces (as it's a continuation > of the line above it.) Fixed >=20 > Now, you're making IWN_DEBUG an option, right? Once you've done this, > I'll go make sure you can put it in the kernel config file as a build > option (and I'll enable it by default on i386/amd64.) Yes, I think should be a good thing. >=20 > Thanks! >=20 >=20 > -adrian ------=_NextPart_000_0028_01CE8E14.83BCC640 Content-Type: application/octet-stream; name="register3.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="register3.patch" Index: sys/dev/iwn/if_iwn.c=0A= =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=0A= --- sys/dev/iwn/if_iwn.c (revision 253764)=0A= +++ sys/dev/iwn/if_iwn.c (working copy)=0A= @@ -160,7 +160,9 @@=0A= static int iwn_read_eeprom(struct iwn_softc *,=0A= uint8_t macaddr[IEEE80211_ADDR_LEN]);=0A= static void iwn4965_read_eeprom(struct iwn_softc *);=0A= +#ifdef IWN_DEBUG=0A= static void iwn4965_print_power_group(struct iwn_softc *, int);=0A= +#endif=0A= static void iwn5000_read_eeprom(struct iwn_softc *);=0A= static uint32_t iwn_eeprom_channel_flags(struct iwn_eeprom_chan *);=0A= static void iwn_read_eeprom_band(struct iwn_softc *, int);=0A= @@ -320,9 +322,12 @@=0A= static void iwn_scan_curchan(struct ieee80211_scan_state *, unsigned = long);=0A= static void iwn_scan_mindwell(struct ieee80211_scan_state *);=0A= static void iwn_hw_reset(void *, int);=0A= +#ifdef IWN_DEBUG=0A= +static char *iwn_get_csr_string(int);=0A= +static void iwn_debug_register(struct iwn_softc *);=0A= +#endif=0A= =0A= -#define IWN_DEBUG=0A= -#ifdef IWN_DEBUG=0A= +#ifdef IWN_DEBUG=0A= enum {=0A= IWN_DEBUG_XMIT =3D 0x00000001, /* basic xmit operation */=0A= IWN_DEBUG_RECV =3D 0x00000002, /* basic recv operation */=0A= @@ -339,6 +344,7 @@=0A= IWN_DEBUG_CMD =3D 0x00001000, /* cmd submission */=0A= IWN_DEBUG_TXRATE =3D 0x00002000, /* TX rate debugging */=0A= IWN_DEBUG_PWRSAVE =3D 0x00004000, /* Power save operations */=0A= + IWN_DEBUG_REGISTER =3D 0x20000000, /* print chipset register */=0A= IWN_DEBUG_TRACE =3D 0x40000000, /* Print begin and start driver = function */=0A= IWN_DEBUG_FATAL =3D 0x80000000, /* fatal errors */=0A= IWN_DEBUG_ANY =3D 0xffffffff=0A= @@ -924,6 +930,8 @@=0A= struct ieee80211com *ic;=0A= int qid;=0A= =0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= +=0A= if (ifp !=3D NULL) {=0A= ic =3D ifp->if_l2com;=0A= =0A= @@ -961,7 +969,7 @@=0A= if (ifp !=3D NULL)=0A= if_free(ifp);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s done\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n", __func__);=0A= IWN_LOCK_DESTROY(sc);=0A= return 0;=0A= }=0A= @@ -3202,8 +3210,6 @@=0A= }=0A= case IWN_STATE_CHANGED:=0A= {=0A= - uint32_t *status =3D (uint32_t *)(desc + 1);=0A= -=0A= /*=0A= * State change allows hardware switch change to be=0A= * noted. However, we handle this in iwn_intr as we=0A= @@ -3211,32 +3217,37 @@=0A= */=0A= bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= BUS_DMASYNC_POSTREAD);=0A= +#ifdef IWN_DEBUG=0A= + uint32_t *status =3D (uint32_t *)(desc + 1);=0A= DPRINTF(sc, IWN_DEBUG_INTR, "state changed to %x\n",=0A= le32toh(*status));=0A= +#endif=0A= break;=0A= }=0A= case IWN_START_SCAN:=0A= {=0A= + bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= + BUS_DMASYNC_POSTREAD);=0A= +#ifdef IWN_DEBUG=0A= struct iwn_start_scan *scan =3D=0A= (struct iwn_start_scan *)(desc + 1);=0A= -=0A= - bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= - BUS_DMASYNC_POSTREAD);=0A= - DPRINTF(sc, IWN_DEBUG_ANY,=0A= + DPRINTF(sc, IWN_DEBUG_ANY,=0A= "%s: scanning channel %d status %x\n",=0A= __func__, scan->chan, le32toh(scan->status));=0A= +#endif=0A= break;=0A= }=0A= case IWN_STOP_SCAN:=0A= {=0A= + bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= + BUS_DMASYNC_POSTREAD);=0A= +#ifdef IWN_DEBUG=0A= struct iwn_stop_scan *scan =3D=0A= (struct iwn_stop_scan *)(desc + 1);=0A= -=0A= - bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= - BUS_DMASYNC_POSTREAD);=0A= DPRINTF(sc, IWN_DEBUG_STATE,=0A= "scan finished nchan=3D%d status=3D%d chan=3D%d\n",=0A= scan->nchan, scan->status, scan->chan);=0A= +#endif=0A= =0A= IWN_UNLOCK(sc);=0A= ieee80211_scan_next(vap);=0A= @@ -3416,6 +3427,9 @@=0A= if (r1 & (IWN_INT_SW_ERR | IWN_INT_HW_ERR)) {=0A= device_printf(sc->sc_dev, "%s: fatal firmware error\n",=0A= __func__);=0A= +#ifdef IWN_DEBUG=0A= + iwn_debug_register(sc);=0A= +#endif=0A= /* Dump firmware error log and stop. */=0A= iwn_fatal_intr(sc);=0A= ifp->if_flags &=3D ~IFF_UP;=0A= @@ -7467,3 +7481,85 @@=0A= iwn_init(sc);=0A= ieee80211_notify_radio(ic, 1);=0A= }=0A= +#ifdef IWN_DEBUG=0A= +#define IWN_DESC(x) case x: return #x=0A= +#define COUNTOF(array) (sizeof(array) / sizeof(array[0]))=0A= +=0A= +/*=0A= + * Transate CSR code to string=0A= + */=0A= +static char *iwn_get_csr_string(int csr)=0A= +{=0A= + switch (csr) {=0A= + IWN_DESC(IWN_HW_IF_CONFIG);=0A= + IWN_DESC(IWN_INT_COALESCING);=0A= + IWN_DESC(IWN_INT);=0A= + IWN_DESC(IWN_INT_MASK);=0A= + IWN_DESC(IWN_FH_INT);=0A= + IWN_DESC(IWN_GPIO_IN);=0A= + IWN_DESC(IWN_RESET);=0A= + IWN_DESC(IWN_GP_CNTRL);=0A= + IWN_DESC(IWN_HW_REV);=0A= + IWN_DESC(IWN_EEPROM);=0A= + IWN_DESC(IWN_EEPROM_GP);=0A= + IWN_DESC(IWN_OTP_GP);=0A= + IWN_DESC(IWN_GIO);=0A= + IWN_DESC(IWN_GP_UCODE);=0A= + IWN_DESC(IWN_GP_DRIVER);=0A= + IWN_DESC(IWN_UCODE_GP1);=0A= + IWN_DESC(IWN_UCODE_GP2);=0A= + IWN_DESC(IWN_LED);=0A= + IWN_DESC(IWN_DRAM_INT_TBL);=0A= + IWN_DESC(IWN_GIO_CHICKEN);=0A= + IWN_DESC(IWN_ANA_PLL);=0A= + IWN_DESC(IWN_HW_REV_WA);=0A= + IWN_DESC(IWN_DBG_HPET_MEM);=0A= + default:=0A= + return "UNKNOWN CSR";=0A= + }=0A= +}=0A= +=0A= +/*=0A= + * This function print firmware register=0A= + */=0A= +static void=0A= +iwn_debug_register(struct iwn_softc *sc)=0A= +{=0A= + int i;=0A= + static const uint32_t csr_tbl[] =3D {=0A= + IWN_HW_IF_CONFIG,=0A= + IWN_INT_COALESCING,=0A= + IWN_INT,=0A= + IWN_INT_MASK,=0A= + IWN_FH_INT,=0A= + IWN_GPIO_IN,=0A= + IWN_RESET,=0A= + IWN_GP_CNTRL,=0A= + IWN_HW_REV,=0A= + IWN_EEPROM,=0A= + IWN_EEPROM_GP,=0A= + IWN_OTP_GP,=0A= + IWN_GIO,=0A= + IWN_GP_UCODE,=0A= + IWN_GP_DRIVER,=0A= + IWN_UCODE_GP1,=0A= + IWN_UCODE_GP2,=0A= + IWN_LED,=0A= + IWN_DRAM_INT_TBL,=0A= + IWN_GIO_CHICKEN,=0A= + IWN_ANA_PLL,=0A= + IWN_HW_REV_WA,=0A= + IWN_DBG_HPET_MEM,=0A= + };=0A= + DPRINTF(sc, IWN_DEBUG_REGISTER,=0A= + "CSR values: (2nd byte of IWN_INT_COALESCING is = IWN_INT_PERIODIC)%s",=0A= + "\n");=0A= + for (i =3D 0; i < COUNTOF(csr_tbl); i++){=0A= + DPRINTF(sc, IWN_DEBUG_REGISTER," %10s: 0x%08x ",=0A= + iwn_get_csr_string(csr_tbl[i]), IWN_READ(sc, csr_tbl[i]));=0A= + if ((i+1) % 3 =3D=3D 0)=0A= + DPRINTF(sc, IWN_DEBUG_REGISTER,"%s","\n");=0A= + }=0A= + DPRINTF(sc, IWN_DEBUG_REGISTER,"%s","\n");=0A= +}=0A= +#endif=0A= Index: sys/dev/iwn/if_iwnreg.h=0A= =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=0A= --- sys/dev/iwn/if_iwnreg.h (revision 253764)=0A= +++ sys/dev/iwn/if_iwnreg.h (working copy)=0A= @@ -62,6 +62,7 @@=0A= #define IWN_INT 0x008=0A= #define IWN_INT_MASK 0x00c=0A= #define IWN_FH_INT 0x010=0A= +#define IWN_GPIO_IN 0x018 /* read external chip pins */=0A= #define IWN_RESET 0x020=0A= #define IWN_GP_CNTRL 0x024=0A= #define IWN_HW_REV 0x028=0A= @@ -69,8 +70,12 @@=0A= #define IWN_EEPROM_GP 0x030=0A= #define IWN_OTP_GP 0x034=0A= #define IWN_GIO 0x03c=0A= +#define IWN_GP_UCODE 0x048=0A= #define IWN_GP_DRIVER 0x050=0A= +#define IWN_UCODE_GP1 0x054=0A= +#define IWN_UCODE_GP1_SET 0x058=0A= #define IWN_UCODE_GP1_CLR 0x05c=0A= +#define IWN_UCODE_GP2 0x060=0A= #define IWN_LED 0x094=0A= #define IWN_DRAM_INT_TBL 0x0a0=0A= #define IWN_SHADOW_REG_CTRL 0x0a8=0A= @@ -79,6 +84,7 @@=0A= #define IWN_HW_REV_WA 0x22c=0A= #define IWN_DBG_HPET_MEM 0x240=0A= #define IWN_DBG_LINK_PWR_MGMT 0x250=0A= +/* Need nic_lock for use above */=0A= #define IWN_MEM_RADDR 0x40c=0A= #define IWN_MEM_WADDR 0x410=0A= #define IWN_MEM_WDATA 0x418=0A= Index: sys/modules/iwn/Makefile=0A= =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=0A= --- sys/modules/iwn/Makefile (revision 253764)=0A= +++ sys/modules/iwn/Makefile (working copy)=0A= @@ -5,4 +5,12 @@=0A= KMOD =3D if_iwn=0A= SRCS =3D if_iwn.c device_if.h bus_if.h pci_if.h=0A= =0A= +.if !defined(KERNBUILDDIR)=0A= +opt_wlan.h:=0A= + echo "#define IEEE80211_DEBUG 1" > ${.TARGET}=0A= +.endif=0A= +.if IWN_DEBUG=0A= +CFLAGS+=3D-DIWN_DEBUG=0A= +.endif=0A= +=0A= .include =0A= ------=_NextPart_000_0028_01CE8E14.83BCC640-- From owner-freebsd-wireless@FreeBSD.ORG Wed Jul 31 16:15:29 2013 Return-Path: Delivered-To: freebsd-wireless@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 845BA4D7 for ; Wed, 31 Jul 2013 16:15:29 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-x22c.google.com (mail-we0-x22c.google.com [IPv6:2a00:1450:400c:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 176402A12 for ; Wed, 31 Jul 2013 16:15:28 +0000 (UTC) Received: by mail-we0-f172.google.com with SMTP id t61so808062wes.31 for ; Wed, 31 Jul 2013 09:15:27 -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=yhJLENB9bynAHrbrjJqo8NSF9v5ZRgSJmRWSlMZIrLo=; b=CoufzKdEi0kXSzA2VxCmOCxNSrvikehWquFwdUKyXmM4gbXe3XttyCQ7Ax0xGBNEJb HbhkekBIlPnvL734+el7gtfYcz3U+YfaRG3oyUGpp2GZCAW6WFpKQmKCIp/zdRU6PwBF 2libUK7OFiSMIxYyrF/qvybxeu7aw9C9P8lcqSyRWVETC5+qqalTvqPrc63LuYB0m5uU zN+0LepqVX6IuNVftRm6rh/gPsIA+xukSBufc0SYTfh+C+RwsQPtIUf+2KC0OdR3cQKm uRfknohOuzc2c+kTmau9E1TlOApMhh0RRQZfCNGcZIb0X6fXywV5iQmwzikw1Ci79ept OA2g== MIME-Version: 1.0 X-Received: by 10.180.185.148 with SMTP id fc20mr4946335wic.0.1375287327250; Wed, 31 Jul 2013 09:15:27 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Wed, 31 Jul 2013 09:15:27 -0700 (PDT) In-Reply-To: <002701ce8e03$c033f640$409be2c0$@info> References: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> <002d01ce8c46$a13b23d0$e3b16b70$@info> <002701ce8e03$c033f640$409be2c0$@info> Date: Wed, 31 Jul 2013 09:15:27 -0700 X-Google-Sender-Auth: -6YfCcrgd4ZXyX7F3GoGkCHGxbQ Message-ID: Subject: Re: [IWN] Reviw split 2 From: Adrian Chadd To: Cedric GROSS Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2013 16:15:29 -0000 Looks good! I'll commit this soon. Thanks! -adrian On 31 July 2013 08:36, Cedric GROSS wrote: >> -----Message d'origine----- >> De : adrian.chadd@gmail.com [mailto:adrian.chadd@gmail.com] De la part >> de Adrian Chadd >> Envoy=E9 : mercredi 31 juillet 2013 17:08 >> =C0 : Cedric GROSS >> Cc : freebsd-wireless@freebsd.org >> Objet : Re: [IWN] Reviw split 2 >> >> Hi, >> >> There's some more whitespace things to fix in your diff. >> >> - >> ->......>.......>.......bus_dmamap_sync(sc->rxq.data_dmat, data->map, >> ->......>.......>....... BUS_DMASYNC_POSTREAD); >> ->......>.......>.......DPRINTF(sc, IWN_DEBUG_ANY, >> +>......>.......>.......>.......DPRINTF(sc, IWN_DEBUG_ANY, >> >......>.......>....... "%s: scanning channel %d status %x\n", >> >......>.......>....... __func__, scan->chan, le32toh(scan- >> >status)); >> >> .. notice how you've indented DPRINTF there? You should fix that. :) > > Fixed. > >> >> +#ifdef>IWN_DEBUG >> +#define IWN_DESC(x) case x:>...return #x #define COUNTOF(array) >> +(sizeof(array) / sizeof(array[0])) >> >> There should be a tab between the #define and the thing you're >> defining, rather than a space. > > Done. > >> >> + * This function print firmawre register >> >> .. typo, that should be "firmware" :) > > Yep fixed. > >> >> +>......}; >> +>......DPRINTF(sc, IWN_DEBUG_REGISTER, >> + "CSR values: (2nd byte of IWN_INT_COALESCING is >> IWN_INT_PERIODIC)%s", >> + "\n"); >> +>......for (i =3D 0; i < COUNTOF(csr_tbl); i++){ >> >> .. there needs to be a tab in front of the two lines after the >> DPRINTF(). Well, strictly speaking, there should be a tab (to bring it >> to the same indent level) and then four spaces (as it's a continuation >> of the line above it.) > > Fixed > >> >> Now, you're making IWN_DEBUG an option, right? Once you've done this, >> I'll go make sure you can put it in the kernel config file as a build >> option (and I'll enable it by default on i386/amd64.) > > Yes, I think should be a good thing. > >> >> Thanks! >> >> >> -adrian From owner-freebsd-wireless@FreeBSD.ORG Wed Jul 31 16:21:45 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8A400649 for ; Wed, 31 Jul 2013 16:21:45 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x236.google.com (mail-wg0-x236.google.com [IPv6:2a00:1450:400c:c00::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1B2DD2A4B for ; Wed, 31 Jul 2013 16:21:44 +0000 (UTC) Received: by mail-wg0-f54.google.com with SMTP id n11so807445wgh.9 for ; Wed, 31 Jul 2013 09:21:43 -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; bh=VX4yHWTrloOR5Xj1HDdbpzBwVV/ggQk8wU6atL9WfgE=; b=DV362LGptG82Ai313cZgegSTyU/+05vrwIXHiI5R52TAXagFyVOjQau4JCbIR7hM0O 41ORqoezkuK3dr4kDL0hKrwWJaGVNSkNGxIci71Cy4ZJfu2H26fI4fMyE7eiPzoKozB7 oMLacWqBc9LgqUpIezVyr7UNz/gUaDpBEcme0n7nVyGCbejsFNeL2MkCGrLjN243QMY8 hfCxqsC6yCSkW4wrz7PAZAIyMprXG3Au7lmTUcy6dYKP5Mncn1M9P6VTCcoNg1/5z7+F B6iw0sr0444Opxg6T6fElEzz2PbtZGDUcITrCDRqbV363oDFK74CBAtlFnCJ+iLC+CuV AM4w== MIME-Version: 1.0 X-Received: by 10.180.82.196 with SMTP id k4mr4964102wiy.0.1375287703259; Wed, 31 Jul 2013 09:21:43 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Wed, 31 Jul 2013 09:21:43 -0700 (PDT) In-Reply-To: References: Date: Wed, 31 Jul 2013 09:21:43 -0700 X-Google-Sender-Auth: jgRdNccfQKr9sdLhrMDgI5ds9AI Message-ID: Subject: Re: Chenchong's work on net80211_ratectl From: Adrian Chadd To: Chenchong Qin Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2013 16:21:45 -0000 Boo! Do you have another update? -adrian On 24 July 2013 06:44, Adrian Chadd wrote: > On 24 July 2013 06:38, Chenchong Qin wrote: >> >> My pleasure! >> >> It's also against HEAD. >> >> Thanks! > > Ok. This is looking great! > > Next - we need to update the rate control API to now populate an rc > array rather than just returning the rix. > > This is the tricky part - as we're going to have to modify all the > drivers that use the rate control API to use this. > Which is fine, as there's only a handful. It's just annoying. > > Then we have to provide the rate control information during frame > _completion_, so the rate control code knows which transmission rates > succeeded or failed. I'm still not sure what to do about it here. > Maybe do something like Linux and attach TX rate control and > completion information as an mbuf tag? > > _Then_ we can start doing interesting thing with it. :) > > > > -adrian From owner-freebsd-wireless@FreeBSD.ORG Wed Jul 31 18:03:23 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E149E597; Wed, 31 Jul 2013 18:03:23 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x231.google.com (mail-wg0-x231.google.com [IPv6:2a00:1450:400c:c00::231]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1EF10204D; Wed, 31 Jul 2013 18:03:22 +0000 (UTC) Received: by mail-wg0-f49.google.com with SMTP id y10so904002wgg.16 for ; Wed, 31 Jul 2013 11:03:21 -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; bh=yYBXG42RQYfpzSrl9PPjVM0Wine8nq6tRX4KVjSX1A4=; b=tyIxBipfRANqKz8i3ayQa6QX5ffqgcN/HAGhYAkrGzuXfVTjXc6GhGyRdkacbe1ERr UFp4Ef7ssgaP0dyE8L+58ExFZ0sm1AxwbNiMrJN3O8dBX8TCT2gsZSETn1EzQ436aKwb fb0ZoRcLqhuUEREJoHIOnwKon1bxQBf3Z1qwXwVrQTRsBosjJebIFXeNe+x2NjDY7lbt gXIZV/6PW5SpE2L9V63Dup0iUITBXBjXi6p0q7TnmdRLyDsQRPOLL/GKLtkyVJLzQ9BY KxEtElRESTtWSN9BBeE06mf25QJjYFUNrQizX1zEdF5hqWmRpeLtwl64+BD60/o63g9L kwbQ== MIME-Version: 1.0 X-Received: by 10.180.160.165 with SMTP id xl5mr5075937wib.46.1375293801214; Wed, 31 Jul 2013 11:03:21 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Wed, 31 Jul 2013 11:03:21 -0700 (PDT) In-Reply-To: <1375278071.45247.144.camel@revolution.hippie.lan> References: <20130729211540.GZ26412@funkthat.com> <1375151095.45247.54.camel@revolution.hippie.lan> <1375278071.45247.144.camel@revolution.hippie.lan> Date: Wed, 31 Jul 2013 11:03:21 -0700 X-Google-Sender-Auth: dnxYblXgcInRIP13JuLr74Of5rw Message-ID: Subject: Re: My WLI-UC-GNM up crash From: Adrian Chadd To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-arm , "freebsd-wireless@freebsd.org" , Hans Petter Selasky X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2013 18:03:24 -0000 No idea about the device disconnect, sorry. is it a power draw problem? -adrian On 31 July 2013 06:41, Ian Lepore wrote: > On Wed, 2013-07-31 at 16:28 +0800, XiaoQI Ge wrote: >> Last night, I use the latest FreeBSD source (r253827) and >> crochet-freebsd compile img >> My WLI-UC-GNM will be disconnected after a period of operation >> >> run0: device timeout >> run0: at uhub0, port 1, addr 2 (disconnected) >> >> Another log prompted >> ti_mmchs0: Error: current cmd NULL, already done? >> >> My BB-Black broken? > > The ti_mmchs0 error is not new. My old BBW has done that for months. > I'm not sure it's totally harmless, but it's not related to the run0 > timeouts. > > -- Ian > > _______________________________________________ > freebsd-arm@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arm > To unsubscribe, send any mail to "freebsd-arm-unsubscribe@freebsd.org" From owner-freebsd-wireless@FreeBSD.ORG Wed Jul 31 19:46:08 2013 Return-Path: Delivered-To: freebsd-wireless@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 94CD29E1; Wed, 31 Jul 2013 19:46:08 +0000 (UTC) (envelope-from hans.petter.selasky@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id 16CE024AA; Wed, 31 Jul 2013 19:46:07 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id 3B7477A13E; Wed, 31 Jul 2013 21:46:07 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 0129C8F0EC1; Wed, 31 Jul 2013 21:46:13 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VuCmYRxCY3fA; Wed, 31 Jul 2013 21:46:12 +0200 (CEST) Received: from mail.lockless.no (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 0DCD88F0EC0; Wed, 31 Jul 2013 21:46:12 +0200 (CEST) Subject: RE: My WLI-UC-GNM up crash From: =?utf-8?Q?Hans_Petter_Selasky?= To: =?utf-8?Q?Adrian_Chadd?= , =?utf-8?Q?Ian_Lepore?= Date: Wed, 31 Jul 2013 21:46:11 +0200 Mime-Version: 1.0 In-Reply-To: References: X-Priority: 3 (Normal) X-Mailer: Zarafa 7.1.4-41394 Message-Id: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: =?utf-8?Q?freebsd-arm?= , =?utf-8?Q?freebsd-wireless=40freebsd=2Eorg?= X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Jul 2013 19:46:08 -0000 Hi,=0D=0A=0D=0ATypically this means the USB firmware died, or some comman= d needs to be re-transmitted.=0D=0A=0D=0ASee:=0D=0A=0D=0Ausbdump -i usbus= X -s 65536=0D=0A=0D=0AWhat is really going on.=0D=0A=0D=0A--HPS=0D=0A=20=0D= =0A=20=0D=0A-----Original message-----=0D=0A> From:Adrian Chadd >=0D=0A> Sent: Wednesday 31st July= 2013 20:03=0D=0A> To: Ian Lepore >=0D=0A> Cc: freebsd-arm >; freebsd-wireless@freebsd.org ; Hans Petter Selasky >=0D=0A> Subject: Re: My WLI-UC-GNM up c= rash=0D=0A>=20=0D=0A> No idea about the device disconnect, sorry. is it a= power draw problem=3F=0D=0A>=20=0D=0A>=20=0D=0A> -adrian=0D=0A>=20=0D=0A= > On 31 July 2013 06:41, Ian Lepore > wrote:=0D=0A> > On Wed, 2013-07-31 at 16:28 +0800, XiaoQI Ge wrote= :=0D=0A> >> Last night, I use the latest FreeBSD source (r253827) and=0D=0A= > >> crochet-freebsd compile img=0D=0A> >> My WLI-UC-GNM will be disconne= cted after a period of operation=0D=0A> >>=0D=0A> >> run0: device timeout= =0D=0A> >> run0: at uhub0, port 1, addr 2 (disconnected)=0D=0A> >>=0D=0A>= >> Another log prompted=0D=0A> >> ti_mmchs0: Error: current cmd NULL, al= ready done=3F=0D=0A> >>=0D=0A> >> My BB-Black broken=3F=0D=0A> >=0D=0A> >= The ti_mmchs0 error is not new. My old BBW has done that for months.=0D= =0A> > I'm not sure it's totally harmless, but it's not related to the ru= n0=0D=0A> > timeouts.=0D=0A> >=0D=0A> > -- Ian=0D=0A> >=0D=0A> > ________= _______________________________________=0D=0A> > freebsd-arm@freebsd.org = mailing list=0D=0A> > http://lists.free= bsd.org/mailman/listinfo/freebsd-arm =20=0D=0A> > To unsubscribe, send any mail to "freebsd= -arm-unsubscribe@freebsd.org = "=0D=0A> _______________________________________________=0D=0A> freebsd-= arm@freebsd.org mailing list=0D=0A> htt= p://lists.freebsd.org/mailman/listinfo/freebsd-arm =20=0D=0A> To unsubscribe, send any mail= to "freebsd-arm-unsubscribe@freebsd.org "=0D=0A>=20=0D=0A=0D=0A From owner-freebsd-wireless@FreeBSD.ORG Thu Aug 1 06:27:32 2013 Return-Path: Delivered-To: freebsd-wireless@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 9A984391; Thu, 1 Aug 2013 06:27:32 +0000 (UTC) (envelope-from rpaulo@felyko.com) Received: from felyko.com (felyko.com [174.136.100.2]) by mx1.freebsd.org (Postfix) with ESMTP id 7E4632BBC; Thu, 1 Aug 2013 06:27:32 +0000 (UTC) Received: from [IPv6:2601:9:4d00:119:c060:f1df:12a7:d6c4] (unknown [IPv6:2601:9:4d00:119:c060:f1df:12a7:d6c4]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id D1F9B3982B; Wed, 31 Jul 2013 23:27:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1375338446; bh=kBxnkNzrv6vJgjU0JHtW/yLZv1s1bjllwBHhUqB/+nU=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=FW782fvPcutsGqDGmqg+uH5kqXR/PIhQOFSar9p3fMJ5QPJQioh0jCBKyZzxGjrp3 Q9L/XbocQBCN3at+j9Xxx0Kbxg2NteCLYArcvYnjTBZXRZCv6Aty/IMdf/Y168x7AK Z1ivoZx0gB/G9d0x9Dc0l9vFfgu+kaym2BjZxHdk= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: My WLI-UC-GNM up crash From: Rui Paulo In-Reply-To: Date: Wed, 31 Jul 2013 23:27:25 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <4A2B91AC-286D-4D13-8C1B-DA4822FEDE98@felyko.com> References: <20130729211540.GZ26412@funkthat.com> <1375151095.45247.54.camel@revolution.hippie.lan> To: XiaoQI Ge X-Mailer: Apple Mail (2.1508) Cc: freebsd-arm , "freebsd-wireless@freebsd.org" , Ian Lepore , Hans Petter Selasky X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2013 06:27:32 -0000 On 31 Jul 2013, at 01:28, XiaoQI Ge wrote: > Last night, I use the latest FreeBSD source (r253827) and > crochet-freebsd compile img > My WLI-UC-GNM will be disconnected after a period of operation >=20 > run0: device timeout > run0: at uhub0, port 1, addr 2 (disconnected) If you are using the USB cable to power the BBB, then that's your = problem. You need a 5V 1A+ power adapter to be able to use USB WiFi = cards with the BeagleBone. -- Rui Paulo From owner-freebsd-wireless@FreeBSD.ORG Thu Aug 1 07:24:09 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 104E4DE6 for ; Thu, 1 Aug 2013 07:24:09 +0000 (UTC) (envelope-from ghw@7axu.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9468E2E71 for ; Thu, 1 Aug 2013 07:24:08 +0000 (UTC) Received: by mail-we0-f182.google.com with SMTP id u55so1401082wes.27 for ; Thu, 01 Aug 2013 00:24:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-originating-ip:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:x-gm-message-state; bh=VM7yR0DWGXlbFynaqR3BSbSt/cFA8UnhP/kx1QUEMtw=; b=noKLOboch6FNCSaPPqEFeX5a0zjNn35l7HvP/G0BXVfxEX/b5vn1GkuZubVJF9OvtN yVAZc56fhorflSp3kcsHOq8vHhMcHLDF1RSi1PGBakBZvPTDMTGgPdWYGvlGTWgxe8/N HzX3RgtbUP7TEqijwKfia/KSx+6khdvNm9mGstH73i8s6niwhsnBJQyO1u8iUPjUEuGR YDBntrPfqOCRnk+qKmGMNEAGP0N9tg/cr3tfYVOULFzWJNI9+K4jx1aTGUNwmscEcRm/ qP2KPDMMplJ0kcjMZNczHw6bBfZXbhRy2vnSe3prhiW5CIv12e/FZ+w333CtC7FLRZ6v ZGmQ== X-Received: by 10.180.82.196 with SMTP id k4mr6897981wiy.0.1375341537274; Thu, 01 Aug 2013 00:18:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.93.34 with HTTP; Thu, 1 Aug 2013 00:18:17 -0700 (PDT) X-Originating-IP: [54.249.112.206] In-Reply-To: <4A2B91AC-286D-4D13-8C1B-DA4822FEDE98@felyko.com> References: <20130729211540.GZ26412@funkthat.com> <1375151095.45247.54.camel@revolution.hippie.lan> <4A2B91AC-286D-4D13-8C1B-DA4822FEDE98@felyko.com> From: XiaoQI Ge Date: Thu, 1 Aug 2013 15:18:17 +0800 Message-ID: Subject: Re: My WLI-UC-GNM up crash To: Rui Paulo Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnJ58A0SCtoILuKzGca/GgqzQJDwUc+O09wPJWy0Tp7olQzeRgEyV9zco9VsRzmwFsQEELR Cc: freebsd-arm , "freebsd-wireless@freebsd.org" , Ian Lepore , Hans Petter Selasky X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2013 07:24:09 -0000 Before using the computer USB power supply, the implementation of usbdump, the kernel Panic Some log: http://pastebin.com/wPURnAg5 http://img.vim-cn.com/5f/576bc22abaadb1014dae4c4e73b07f48579e8e.bmp addr2line information: http://pastebin.com/sE5C7bqi 1A is used after the power supply Enter no response, TTL did not show additional information -- Regards. By: XiaoQI Ge; PGP:8B09D5F7 WWW: https://www.7axu.com/ 2013/8/1 Rui Paulo : > On 31 Jul 2013, at 01:28, XiaoQI Ge wrote: > >> Last night, I use the latest FreeBSD source (r253827) and >> crochet-freebsd compile img >> My WLI-UC-GNM will be disconnected after a period of operation >> >> run0: device timeout >> run0: at uhub0, port 1, addr 2 (disconnected) > > If you are using the USB cable to power the BBB, then that's your problem. You need a 5V 1A+ power adapter to be able to use USB WiFi cards with the BeagleBone. > > -- > Rui Paulo > From owner-freebsd-wireless@FreeBSD.ORG Thu Aug 1 12:17:52 2013 Return-Path: Delivered-To: freebsd-wireless@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 F27C4B3E; Thu, 1 Aug 2013 12:17:51 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (mail.farley.org [IPv6:2001:470:1f07:14d3:2::11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B1CFF2E5A; Thu, 1 Aug 2013 12:17:51 +0000 (UTC) Received: from thor.farley.org (HPooka@thor.farley.org [192.168.1.5]) by mail.farley.org (8.14.7/8.14.7) with ESMTP id r71CHnFp013728; Thu, 1 Aug 2013 08:17:49 -0400 (EDT) (envelope-from scf@FreeBSD.org) Date: Thu, 1 Aug 2013 08:17:49 -0400 (EDT) From: "Sean C. Farley" To: Adrian Chadd Subject: Re: iwn firmware sysassert In-Reply-To: Message-ID: References: User-Agent: Alpine 2.02 (BSF 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-2.9 required=4.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.farley.org Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2013 12:17:52 -0000 On Fri, 26 Jul 2013, Adrian Chadd wrote: > Try just doing ifconfig wlan0 -ht > > See if that helps I finally made it back to the wireless router that was having issues. I found that my NIC has no trouble with the router at work with 40MHz. However, my router at home is setup for 20MHz. The complete setup is 2.4 GHz band, mixed mode (B and G) and 20 MHz width. Disabling high throughput stops the firmware assertion and wireless works. I tried -ht, -ht20 and -ht40 each with a reboot for a fresh start and received the same results. > On 25 July 2013 17:10, Sean C. Farley wrote: >> On Thu, 25 Jul 2013, Adrian Chadd wrote: >> >>> Ok, then I have no idea. >>> >>> There's active work on iwn going on in -HEAD. I suggest updating to >>> that and then tracking development. No, I won't be backporting >>> anything to -9 or -8; someone else will have to take charge of that >>> (and field support queries when things don't work.) >> >> >> I experimented a bit. A workaround for me is to set the mode to 11b on >> wlan0. While not the best solution, it hopefully narrows down the issue. I >> will at the code later for some ideas of what changed. >> >> >> >>> On 25 July 2013 16:38, Sean C. Farley wrote: >>>> >>>> On Thu, 25 Jul 2013, Adrian Chadd wrote: >>>> >>>>> Try jsut doing: >>>>> >>>>> ifconfig wlan0 create wlandev iwn0 >>>>> wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf >>>>> >>>>> .. ie, don't do an ifconfig iwn0 up >>>> >>>> >>>> >>>> Same result. I ran with ifconfig_wlan0="WPA" removed from /etc/rc.conf >>>> else >>>> wpa_supplicant would start: >>>> ifconfig wlan0 destroy >>>> >>>> ifconfig wlan0 create wlandev iwn0 >>>> wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf >>>> >>>> >>>>> On 25 July 2013 15:25, Sean C. Farley wrote: >>>>>> >>>>>> >>>>>> After upgrading my laptop from 8.4-STABLE to 9-STABLE, I have been >>>>>> unable >>>>>> to >>>>>> use the wireless NIC. The indicator light will flash for a moment and >>>>>> surrender. The error is always the same and reproducible with >>>>>> "ifconfig >>>>>> iwn0 up". The system is 9-STABLE (r253048). This appears to be the >>>>>> same >>>>>> or >>>>>> similar to PR 175053: >>>>>> http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/175053 >>>>>> >>>>>> Boot: >>>>>> iwn0: mem 0xf8000000-0xf8001fff irq >>>>>> 17 >>>>>> at >>>>>> device 0.0 on pci4 >>>>>> >>>>>> Card details: >>>>>> iwn0@pci0:4:0:0: class=0x028000 card=0x11218086 chip=0x42358086 >>>>>> rev=0x00 hdr=0x00 >>>>>> vendor = 'Intel Corporation' >>>>>> device = 'Ultimate N WiFi Link 5300' >>>>>> class = network >>>>>> bar [10] = type Memory, range 64, base 0xf8000000, size 8192, >>>>>> enabled >>>>>> cap 01[c8] = powerspec 3 supports D0 D3 current D0 >>>>>> cap 05[d0] = MSI supports 1 message, 64 bit enabled with 1 message >>>>>> cap 10[e0] = PCI-Express 1 endpoint max data 128(128) FLR link >>>>>> x1(x1) >>>>>> speed 2.5(2.5) ASPM L1(L0s/L1) >>>>>> ecap 0001[100] = AER 1 0 fatal 0 non-fatal 1 corrected >>>>>> ecap 0003[140] = Serial 1 00216affff985c6e >>>>>> >>>>>> Error (same each time except for time): >>>>>> wlan0: link state changed to UP >>>>>> iwn0: iwn_intr: fatal firmware error >>>>>> firmware error log: >>>>>> error type = "SYSASSERT" (0x00000005) >>>>>> program counter = 0x00003130 >>>>>> source line = 0x00000585 >>>>>> error data = 0x0000000100000000 >>>>>> branch link = 0x0000312A0000312A >>>>>> interrupt link = 0x0000091600000000 >>>>>> time = 1611815765 >>>>>> driver status: >>>>>> tx ring 0: qid=0 cur=0 queued=0 >>>>>> tx ring 1: qid=1 cur=0 queued=0 >>>>>> tx ring 2: qid=2 cur=0 queued=0 >>>>>> tx ring 3: qid=3 cur=2 queued=0 >>>>>> tx ring 4: qid=4 cur=67 queued=0 >>>>>> tx ring 5: qid=5 cur=0 queued=0 >>>>>> tx ring 6: qid=6 cur=0 queued=0 >>>>>> tx ring 7: qid=7 cur=0 queued=0 >>>>>> tx ring 8: qid=8 cur=0 queued=0 >>>>>> tx ring 9: qid=9 cur=0 queued=0 >>>>>> tx ring 10: qid=10 cur=0 queued=0 >>>>>> tx ring 11: qid=11 cur=0 queued=0 >>>>>> tx ring 12: qid=12 cur=0 queued=0 >>>>>> tx ring 13: qid=13 cur=0 queued=0 >>>>>> tx ring 14: qid=14 cur=0 queued=0 >>>>>> tx ring 15: qid=15 cur=0 queued=0 >>>>>> tx ring 16: qid=16 cur=0 queued=0 >>>>>> tx ring 17: qid=17 cur=0 queued=0 >>>>>> tx ring 18: qid=18 cur=0 queued=0 >>>>>> tx ring 19: qid=19 cur=0 queued=0 >>>>>> rx ring: cur=0 >>>>>> wlan0: link state changed to DOWN >>>>>> >>>>>> vmstat -i: >>>>>> ... >>>>>> irq258: iwn0 973 0 >>>>>> ... >>>>>> >>>>>> Any ideas on what is broken and how to get it to work? >>>>>> >>>>>> Please Cc me as I am not on this specific list. >>>>>> >>>>>> Thank you. Sean -- scf@FreeBSD.org From owner-freebsd-wireless@FreeBSD.ORG Thu Aug 1 21:49:22 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 472C5387 for ; Thu, 1 Aug 2013 21:49:22 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D002F2CC8 for ; Thu, 1 Aug 2013 21:49:21 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id l18so2094770wgh.11 for ; Thu, 01 Aug 2013 14:49:20 -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:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=6eCiYUZyhZiNz4ZWfPTPfv7DZIQTvzh7xk77vajAab4=; b=StUzGVmKMhrBM8JDKp13DANC/uReEpyFG2K4R1YiFrQfIX0oHEcX8r6tPO0YVFPFfS WZ7i/hQJE3dMrmse7U2Fv/kZPzZO6d6jkF7g1F5ko6kHSO25ca6nzZ31AlL7T36ZC9Q8 KPeK5QbEfQW3/xHwL0cWqPWbwNFFXrvQMX0gx0MxrsUH3VNiwhQLLTWWC77Wp5eWiaZM CEgPuEEJo9jZv5fQtAMIy7Z7vmT2ShR2XRv6L6IZr4Xk9cEKm2G0PJP+CQTH4Tq+VTVj Y0ymf9M8dBmBGTxMYep0WlhY+LfMBS99dWK4k8ItmkVDAmcN+NbQGv6Ems+iWoOXURCc Uvsg== MIME-Version: 1.0 X-Received: by 10.180.160.165 with SMTP id xl5mr3654wib.46.1375393760158; Thu, 01 Aug 2013 14:49:20 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Thu, 1 Aug 2013 14:49:20 -0700 (PDT) In-Reply-To: <002701ce8e03$c033f640$409be2c0$@info> References: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> <002d01ce8c46$a13b23d0$e3b16b70$@info> <002701ce8e03$c033f640$409be2c0$@info> Date: Thu, 1 Aug 2013 14:49:20 -0700 X-Google-Sender-Auth: 8W95Qaze6qge0MvxNMSgxRBCNM8 Message-ID: Subject: Re: [IWN] Reviw split 2 From: Adrian Chadd To: Cedric GROSS Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Aug 2013 21:49:22 -0000 Committed! I'm about to commit the config options change so you can add IWN_DEBUG to your kernel config. Next! Want to send out an updated diff? -adrian On 31 July 2013 08:36, Cedric GROSS wrote: >> -----Message d'origine----- >> De : adrian.chadd@gmail.com [mailto:adrian.chadd@gmail.com] De la part >> de Adrian Chadd >> Envoy=E9 : mercredi 31 juillet 2013 17:08 >> =C0 : Cedric GROSS >> Cc : freebsd-wireless@freebsd.org >> Objet : Re: [IWN] Reviw split 2 >> >> Hi, >> >> There's some more whitespace things to fix in your diff. >> >> - >> ->......>.......>.......bus_dmamap_sync(sc->rxq.data_dmat, data->map, >> ->......>.......>....... BUS_DMASYNC_POSTREAD); >> ->......>.......>.......DPRINTF(sc, IWN_DEBUG_ANY, >> +>......>.......>.......>.......DPRINTF(sc, IWN_DEBUG_ANY, >> >......>.......>....... "%s: scanning channel %d status %x\n", >> >......>.......>....... __func__, scan->chan, le32toh(scan- >> >status)); >> >> .. notice how you've indented DPRINTF there? You should fix that. :) > > Fixed. > >> >> +#ifdef>IWN_DEBUG >> +#define IWN_DESC(x) case x:>...return #x #define COUNTOF(array) >> +(sizeof(array) / sizeof(array[0])) >> >> There should be a tab between the #define and the thing you're >> defining, rather than a space. > > Done. > >> >> + * This function print firmawre register >> >> .. typo, that should be "firmware" :) > > Yep fixed. > >> >> +>......}; >> +>......DPRINTF(sc, IWN_DEBUG_REGISTER, >> + "CSR values: (2nd byte of IWN_INT_COALESCING is >> IWN_INT_PERIODIC)%s", >> + "\n"); >> +>......for (i =3D 0; i < COUNTOF(csr_tbl); i++){ >> >> .. there needs to be a tab in front of the two lines after the >> DPRINTF(). Well, strictly speaking, there should be a tab (to bring it >> to the same indent level) and then four spaces (as it's a continuation >> of the line above it.) > > Fixed > >> >> Now, you're making IWN_DEBUG an option, right? Once you've done this, >> I'll go make sure you can put it in the kernel config file as a build >> option (and I'll enable it by default on i386/amd64.) > > Yes, I think should be a good thing. > >> >> Thanks! >> >> >> -adrian From owner-freebsd-wireless@FreeBSD.ORG Fri Aug 2 09:09:30 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id C2AD8DEE; Fri, 2 Aug 2013 09:09:30 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [IPv6:2001:41d0:8:dda6::1]) by mx1.freebsd.org (Postfix) with ESMTP id 88CD72CD1; Fri, 2 Aug 2013 09:09:30 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id A14D91F4; Fri, 2 Aug 2013 11:09:28 +0200 (CEST) From: "Cedric GROSS" To: "'Adrian Chadd'" References: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> <002d01ce8c46$a13b23d0$e3b16b70$@info> <002701ce8e03$c033f640$409be2c0$@info> In-Reply-To: Subject: RE: [IWN] Reviw split 2 Date: Fri, 2 Aug 2013 11:09:22 +0200 Message-ID: <002401ce8f5f$fc5ad780$f5108680$@info> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac6PAP5TwEtvW5yeQAShjPoK3ti0qgAXnbhw Content-Language: fr Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Aug 2013 09:09:30 -0000 > -----Message d'origine----- > De=A0: adrian.chadd@gmail.com [mailto:adrian.chadd@gmail.com] De la = part > de Adrian Chadd > Envoy=E9=A0: jeudi 1 ao=FBt 2013 23:49 > =C0=A0: Cedric GROSS > Cc=A0: freebsd-wireless@freebsd.org > Objet=A0: Re: [IWN] Reviw split 2 >=20 > Committed! >=20 > I'm about to commit the config options change so you can add IWN_DEBUG > to your kernel config. >=20 > Next! Want to send out an updated diff? >=20 You already have the split 3 (previously sent).=20 I test it, it's still apply well against -HEAD. Cedric From owner-freebsd-wireless@FreeBSD.ORG Fri Aug 2 11:12:47 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AA55C7C6 for ; Fri, 2 Aug 2013 11:12:47 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [178.32.219.166]) by mx1.freebsd.org (Postfix) with ESMTP id 3217A2207 for ; Fri, 2 Aug 2013 11:12:46 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id 416D040B for ; Fri, 2 Aug 2013 13:12:39 +0200 (CEST) From: "Cedric GROSS" To: Subject: [iwn] Review split 4 Date: Fri, 2 Aug 2013 13:12:33 +0200 Message-ID: <003001ce8f71$31aa64d0$94ff2e70$@info> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0031_01CE8F81.F53334D0" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac6PcS/Gc0FvxHCLTheaZZCg8n7t4w== Content-Language: fr X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Aug 2013 11:12:47 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_0031_01CE8F81.F53334D0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello, After split 3 applied and committed , you will find split 4. This one modify if_iwnreg.h Add nearly everything we will need for later use. Cedric ------=_NextPart_000_0031_01CE8F81.F53334D0 Content-Type: application/octet-stream; name="define.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="define.patch" Index: sys/dev/iwn/if_iwnreg.h=0A= =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=0A= --- sys/dev/iwn/if_iwnreg.h (revision 11)=0A= +++ sys/dev/iwn/if_iwnreg.h (working copy)=0A= @@ -18,6 +18,9 @@=0A= * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.=0A= */=0A= =0A= +#define IWN_CT_KILL_THRESHOLD 114 /* in Celsius */=0A= +#define IWN_CT_KILL_EXIT_THRESHOLD 95 /* in Celsius */=0A= +=0A= #define IWN_TX_RING_COUNT 256=0A= #define IWN_TX_RING_LOMARK 192=0A= #define IWN_TX_RING_HIMARK 224=0A= @@ -38,6 +41,10 @@=0A= #define IWN_ICT_SIZE 4096=0A= #define IWN_ICT_COUNT (IWN_ICT_SIZE / sizeof (uint32_t))=0A= =0A= +/* For cards with PAN command, default is IWN_CMD_QUEUE_NUM */=0A= +#define IWN_CMD_QUEUE_NUM 4=0A= +#define IWN_PAN_CMD_QUEUE 9=0A= +=0A= /* Maximum number of DMA segments for TX. */=0A= #define IWN_MAX_SCATTER 20=0A= =0A= @@ -89,6 +96,7 @@=0A= #define IWN_MEM_WADDR 0x410=0A= #define IWN_MEM_WDATA 0x418=0A= #define IWN_MEM_RDATA 0x41c=0A= +#define IWN_TARG_MBX_C 0x430=0A= #define IWN_PRPH_WADDR 0x444=0A= #define IWN_PRPH_RADDR 0x448=0A= #define IWN_PRPH_WDATA 0x44c=0A= @@ -213,17 +221,45 @@=0A= #define IWN_GP_DRIVER_RADIO_2X2_IPA (2 << 0)=0A= #define IWN_GP_DRIVER_CALIB_VER6 (1 << 2)=0A= #define IWN_GP_DRIVER_6050_1X2 (1 << 3)=0A= +#define IWN_GP_DRIVER_REG_BIT_RADIO_IQ_INVERT (1 << 7)=0A= =0A= /* Possible flags for register IWN_UCODE_GP1_CLR. */=0A= #define IWN_UCODE_GP1_RFKILL (1 << 1)=0A= #define IWN_UCODE_GP1_CMD_BLOCKED (1 << 2)=0A= #define IWN_UCODE_GP1_CTEMP_STOP_RF (1 << 3)=0A= +#define IWN_UCODE_GP1_CFG_COMPLETE (1 << 5)=0A= =0A= /* Possible flags/values for register IWN_LED. */=0A= #define IWN_LED_BSM_CTRL (1 << 5)=0A= #define IWN_LED_OFF 0x00000038=0A= #define IWN_LED_ON 0x00000078=0A= =0A= +#define IWN_MAX_BLINK_TBL 10=0A= +#define IWN_LED_STATIC_ON 0=0A= +#define IWN_LED_STATIC_OFF 1=0A= +#define IWN_LED_SLOW_BLINK 2=0A= +#define IWN_LED_INT_BLINK 3=0A= +#define IWN_LED_UNIT 0x1388 /* 5 ms */=0A= +=0A= +static const struct {=0A= + uint16_t tpt; /* Mb/s */=0A= + uint8_t on_time;=0A= + uint8_t off_time;=0A= +} blink_tbl[] =3D=0A= +{=0A= + {300, 5, 5},=0A= + {200, 8, 8},=0A= + {100, 11, 11},=0A= + {70, 13, 13},=0A= + {50, 15, 15},=0A= + {20, 17, 17},=0A= + {10, 19, 19},=0A= + {5, 22, 22},=0A= + {1, 26, 26},=0A= + {0, 33, 33},=0A= + /* SOLID_ON */=0A= +};=0A= +=0A= /* Possible flags for register IWN_DRAM_INT_TBL. */=0A= #define IWN_DRAM_INT_TBL_WRAP_CHECK (1 << 27)=0A= #define IWN_DRAM_INT_TBL_ENABLE (1 << 31)=0A= @@ -370,14 +406,26 @@=0A= } __packed;=0A= =0A= struct iwn_rx_desc {=0A= + /*=0A= + * The first 4 bytes of the RX frame header contain both the RX frame=0A= + * size and some flags.=0A= + * Bit fields:=0A= + * 31: flag flush RB request=0A= + * 30: flag ignore TC (terminal counter) request=0A= + * 29: flag fast IRQ request=0A= + * 28-14: Reserved=0A= + * 13-00: RX frame size=0A= + */=0A= uint32_t len;=0A= uint8_t type;=0A= #define IWN_UC_READY 1=0A= #define IWN_ADD_NODE_DONE 24=0A= #define IWN_TX_DONE 28=0A= +#define IWN_REPLY_LED_CMD 72=0A= #define IWN5000_CALIBRATION_RESULT 102=0A= #define IWN5000_CALIBRATION_DONE 103=0A= #define IWN_START_SCAN 130=0A= +#define IWN_NOTIF_SCAN_RESULT 131=0A= #define IWN_STOP_SCAN 132=0A= #define IWN_RX_STATISTICS 156=0A= #define IWN_BEACON_STATISTICS 157=0A= @@ -388,11 +436,23 @@=0A= #define IWN_RX_DONE 195=0A= #define IWN_RX_COMPRESSED_BA 197=0A= =0A= - uint8_t flags;=0A= - uint8_t idx;=0A= + uint8_t flags; /* 0:5 reserved, 6 abort, 7 internal */=0A= + uint8_t idx; /* position within TX queue */=0A= uint8_t qid;=0A= + /* 0:4 TX queue id - 5:6 reserved - 7 unsolicited RX=0A= + * or uCode-originated notification=0A= + */=0A= } __packed;=0A= =0A= +#define IWN_RX_DESC_QID_MSK 0x1F=0A= +#define IWN_UNSOLICITED_RX_NOTIF 0x80=0A= +=0A= +/* CARD_STATE_NOTIFICATION */=0A= +#define IWN_STATE_CHANGE_HW_CARD_DISABLED 0x01=0A= +#define IWN_STATE_CHANGE_SW_CARD_DISABLED 0x02=0A= +#define IWN_STATE_CHANGE_CT_CARD_DISABLED 0x04=0A= +#define IWN_STATE_CHANGE_RXON_CARD_DISABLED 0x10=0A= +=0A= /* Possible RX status flags. */=0A= #define IWN_RX_NO_CRC_ERR (1 << 0)=0A= #define IWN_RX_NO_OVFL_ERR (1 << 1)=0A= @@ -416,6 +476,7 @@=0A= #define IWN_CMD_LINK_QUALITY 78=0A= #define IWN_CMD_SET_LED 72=0A= #define IWN5000_CMD_WIMAX_COEX 90=0A= +#define IWN_TEMP_NOTIFICATION 98=0A= #define IWN5000_CMD_CALIB_CONFIG 101=0A= #define IWN5000_CMD_CALIB_RESULT 102=0A= #define IWN5000_CMD_CALIB_COMPLETE 103=0A= @@ -432,6 +493,17 @@=0A= #define IWN_CMD_PHY_CALIB 176=0A= #define IWN_CMD_BT_COEX_PRIOTABLE 204=0A= #define IWN_CMD_BT_COEX_PROT 205=0A= +#define IWN_CMD_BT_COEX_NOTIF 206=0A= +/* PAN commands */=0A= +#define IWN_CMD_WIPAN_PARAMS 0xb2=0A= +#define IWN_CMD_WIPAN_RXON 0xb3=0A= +#define IWN_CMD_WIPAN_RXON_TIMING 0xb4=0A= +#define IWN_CMD_WIPAN_RXON_ASSOC 0xb6=0A= +#define IWN_CMD_WIPAN_QOS_PARAM 0xb7=0A= +#define IWN_CMD_WIPAN_WEPKEY 0xb8=0A= +#define IWN_CMD_WIPAN_P2P_CHANNEL_SWITCH 0xb9=0A= +#define IWN_CMD_WIPAN_NOA_NOTIFICATION 0xbc=0A= +#define IWN_CMD_WIPAN_DEACTIVATION_COMPLETE 0xbd=0A= =0A= uint8_t flags;=0A= uint8_t idx;=0A= @@ -439,6 +511,27 @@=0A= uint8_t data[136];=0A= } __packed;=0A= =0A= +/*=0A= + * Structure for IWN_CMD_GET_STATISTICS =3D (0x9c) 156=0A= + * all devices identical.=0A= + *=0A= + * This command triggers an immediate response containing uCode = statistics.=0A= + * The response is in the same format as IWN_BEACON_STATISTICS (0x9d) = 157.=0A= + *=0A= + * If the CLEAR_STATS configuration flag is set, uCode will clear its=0A= + * internal copy of the statistics (counters) after issuing the = response.=0A= + * This flag does not affect IWN_BEACON_STATISTICS after beacons (see = below).=0A= + *=0A= + * If the DISABLE_NOTIF configuration flag is set, uCode will not issue=0A= + * IWN_BEACON_STATISTICS after received beacons. This flag=0A= + * does not affect the response to the IWN_CMD_GET_STATISTICS 0x9c = itself.=0A= + */=0A= +struct iwn_statistics_cmd {=0A= + uint32_t configuration_flags;=0A= +#define IWN_STATS_CONF_CLEAR_STATS htole32(0x1)=0A= +#define IWN_STATS_CONF_DISABLE_NOTIF htole32(0x2)=0A= +} __packed;=0A= +=0A= /* Antenna flags, used in various commands. */=0A= #define IWN_ANT_A (1 << 0)=0A= #define IWN_ANT_B (1 << 1)=0A= @@ -446,6 +539,7 @@=0A= /* Shortcuts. */=0A= #define IWN_ANT_AB (IWN_ANT_A | IWN_ANT_B)=0A= #define IWN_ANT_BC (IWN_ANT_B | IWN_ANT_C)=0A= +#define IWN_ANT_AC (IWN_ANT_A | IWN_ANT_C)=0A= #define IWN_ANT_ABC (IWN_ANT_A | IWN_ANT_B | IWN_ANT_C)=0A= =0A= /* Structure for command IWN_CMD_RXON. */=0A= @@ -461,6 +555,8 @@=0A= #define IWN_MODE_STA 3=0A= #define IWN_MODE_IBSS 4=0A= #define IWN_MODE_MONITOR 6=0A= +#define IWN_MODE_2STA 8=0A= +#define IWN_MODE_P2P 9=0A= =0A= uint8_t air;=0A= uint16_t rxchain;=0A= @@ -544,7 +640,8 @@=0A= uint16_t atim;=0A= uint32_t binitval;=0A= uint16_t lintval;=0A= - uint16_t reserved;=0A= + uint8_t dtim_period;=0A= + uint8_t delta_cp_bss_tbtts;=0A= } __packed;=0A= =0A= /* Structure for command IWN_CMD_ADD_NODE. */=0A= @@ -558,6 +655,9 @@=0A= uint16_t reserved2;=0A= uint8_t id;=0A= #define IWN_ID_BSS 0=0A= +#define IWN_STA_ID 1=0A= +=0A= +#define IWN_PAN_ID_BCAST 14=0A= #define IWN5000_ID_BROADCAST 15=0A= #define IWN4965_ID_BROADCAST 31=0A= =0A= @@ -759,6 +859,11 @@=0A= #define IWN_PS_SLEEP_OVER_DTIM (1 << 2)=0A= #define IWN_PS_PCI_PMGT (1 << 3)=0A= #define IWN_PS_FAST_PD (1 << 4)=0A= +#define IWN_PS_BEACON_FILTERING (1 << 5)=0A= +#define IWN_PS_SHADOW_REG (1 << 6)=0A= +#define IWN_PS_CT_KILL (1 << 7)=0A= +#define IWN_PS_BT_SCD (1 << 8)=0A= +#define IWN_PS_ADVANCED_PM (1 << 9)=0A= =0A= uint8_t keepalive;=0A= uint8_t debug;=0A= @@ -796,6 +901,7 @@=0A= =0A= struct iwn_scan_chan {=0A= uint32_t flags;=0A= +#define IWN_CHAN_PASSIVE (0 << 0)=0A= #define IWN_CHAN_ACTIVE (1 << 0)=0A= #define IWN_CHAN_NPBREQS(x) (((1 << (x)) - 1) << 1)=0A= =0A= @@ -806,9 +912,25 @@=0A= uint16_t passive; /* msecs */=0A= } __packed;=0A= =0A= +#define IWN_SCAN_CRC_TH_DISABLED 0=0A= +#define IWN_SCAN_CRC_TH_DEFAULT htole16(1)=0A= +#define IWN_SCAN_CRC_TH_NEVER htole16(0xffff)=0A= +=0A= /* Maximum size of a scan command. */=0A= #define IWN_SCAN_MAXSZ (MCLBYTES - 4)=0A= =0A= +#define IWN_ACTIVE_DWELL_TIME_24 (30) /* all times in msec */=0A= +#define IWN_ACTIVE_DWELL_TIME_52 (20)=0A= +#define IWN_ACTIVE_DWELL_FACTOR_24 (3)=0A= +#define IWN_ACTIVE_DWELL_FACTOR_52 (2)=0A= +=0A= +#define IWN_PASSIVE_DWELL_TIME_24 (20) /* all times in msec */=0A= +#define IWN_PASSIVE_DWELL_TIME_52 (10)=0A= +#define IWN_PASSIVE_DWELL_BASE (100)=0A= +#define IWN_CHANNEL_TUNE_TIME (5)=0A= +=0A= +#define IWN_SCAN_CHAN_TIMEOUT 2=0A= +=0A= /* Structure for command IWN_CMD_TXPOWER (4965AGN only.) */=0A= #define IWN_RIDX_MAX 32=0A= struct iwn4965_cmd_txpower {=0A= @@ -855,6 +977,16 @@=0A= =0A= struct iwn6000_btcoex_config {=0A= uint8_t flags;=0A= +#define IWN_BT_FLAG_COEX6000_CHAN_INHIBITION 1=0A= +#define IWN_BT_FLAG_COEX6000_MODE_MASK ((1 << 3) | (1 << 4) | (1 << 5 = ))=0A= +#define IWN_BT_FLAG_COEX6000_MODE_SHIFT 3=0A= +#define IWN_BT_FLAG_COEX6000_MODE_DISABLED 0=0A= +#define IWN_BT_FLAG_COEX6000_MODE_LEGACY_2W 1=0A= +#define IWN_BT_FLAG_COEX6000_MODE_3W 2=0A= +#define IWN_BT_FLAG_COEX6000_MODE_4W 3=0A= +=0A= +#define IWN_BT_FLAG_UCODE_DEFAULT (1 << 6)=0A= +#define IWN_BT_FLAG_SYNC_2_BT_DISABLE (1 << 7)=0A= uint8_t lead_time;=0A= uint8_t max_kill;=0A= uint8_t bt3_t7_timer;=0A= @@ -871,6 +1003,28 @@=0A= uint16_t rx_prio_boost;=0A= } __packed;=0A= =0A= +/* Structure for enhanced command IWN_CMD_BLUETOOTH for 2000 Series. */=0A= +struct iwn2000_btcoex_config {=0A= + uint8_t flags; /* Cf Flags in iwn6000_btcoex_config */=0A= + uint8_t lead_time;=0A= + uint8_t max_kill;=0A= + uint8_t bt3_t7_timer;=0A= + uint32_t kill_ack;=0A= + uint32_t kill_cts;=0A= + uint8_t sample_time;=0A= + uint8_t bt3_t2_timer;=0A= + uint16_t bt4_reaction;=0A= + uint32_t lookup_table[12];=0A= + uint16_t bt4_decision;=0A= + uint16_t valid;=0A= +=0A= + uint32_t prio_boost; /* size change prior to iwn6000_btcoex_config */=0A= + uint8_t reserved; /* added prior to iwn6000_btcoex_config */=0A= +=0A= + uint8_t tx_prio_boost;=0A= + uint16_t rx_prio_boost;=0A= +} __packed;=0A= +=0A= struct iwn_btcoex_priotable {=0A= uint8_t calib_init1;=0A= uint8_t calib_init2;=0A= @@ -989,6 +1143,17 @@=0A= uint16_t reserved;=0A= } __packed;=0A= =0A= +struct iwn5000_phy_calib_temp_offsetv2 {=0A= + uint8_t code;=0A= + uint8_t group;=0A= + uint8_t ngroups;=0A= + uint8_t isvalid;=0A= + int16_t offset_high;=0A= + int16_t offset_low;=0A= + int16_t burnt_voltage_ref;=0A= + int16_t reserved;=0A= +} __packed;=0A= +=0A= struct iwn_phy_calib_gain {=0A= uint8_t code;=0A= uint8_t group;=0A= @@ -1056,6 +1221,10 @@=0A= } __packed;=0A= =0A= /* Structures for IWN_TX_DONE notification. */=0A= +#define IWN_TX_STATUS_MSK 0xff=0A= +#define TX_STATUS_SUCCESS 0x01=0A= +#define TX_STATUS_DIRECT_DONE 0x02=0A= +=0A= #define IWN_TX_SUCCESS 0x00=0A= #define IWN_TX_FAIL 0x80 /* all failures have 0x80 set */=0A= #define IWN_TX_FAIL_SHORT_LIMIT 0x82 /* too many RTS retries */=0A= @@ -1077,7 +1246,7 @@=0A= } __packed;=0A= =0A= struct iwn5000_tx_stat {=0A= - uint8_t nframes;=0A= + uint8_t nframes; /* 1 no aggregation, >1 aggregation */=0A= uint8_t btkillcnt;=0A= uint8_t rtsfailcnt;=0A= uint8_t ackfailcnt;=0A= @@ -1089,7 +1258,7 @@=0A= uint16_t seq;=0A= uint16_t len;=0A= uint8_t tlc;=0A= - uint8_t ratid;=0A= + uint8_t ratid; /* tid (0:3), sta_id (4:7) */=0A= uint8_t fc[2];=0A= uint16_t status;=0A= uint16_t sequence;=0A= @@ -1137,6 +1306,42 @@=0A= uint16_t chan;=0A= uint8_t phybuf[32];=0A= uint32_t rate;=0A= +/*=0A= + * rate bit fields=0A= + *=0A= + * High-throughput (HT) rate format for bits 7:0 (bit 8 must be "1"):=0A= + * 2-0: 0) 6 Mbps=0A= + * 1) 12 Mbps=0A= + * 2) 18 Mbps=0A= + * 3) 24 Mbps=0A= + * 4) 36 Mbps=0A= + * 5) 48 Mbps=0A= + * 6) 54 Mbps=0A= + * 7) 60 Mbps=0A= + *=0A= + * 4-3: 0) Single stream (SISO)=0A= + * 1) Dual stream (MIMO)=0A= + * 2) Triple stream (MIMO)=0A= + *=0A= + * 5: Value of 0x20 in bits 7:0 indicates 6 Mbps HT40 duplicate data=0A= + *=0A= + * Legacy OFDM rate format for bits 7:0 (bit 8 must be "0", bit 9 "0"):=0A= + * 3-0: 0xD) 6 Mbps=0A= + * 0xF) 9 Mbps=0A= + * 0x5) 12 Mbps=0A= + * 0x7) 18 Mbps=0A= + * 0x9) 24 Mbps=0A= + * 0xB) 36 Mbps=0A= + * 0x1) 48 Mbps=0A= + * 0x3) 54 Mbps=0A= + *=0A= + * Legacy CCK rate format for bits 7:0 (bit 8 must be "0", bit 9 "1"):=0A= + * 6-0: 10) 1 Mbps=0A= + * 20) 2 Mbps=0A= + * 55) 5.5 Mbps=0A= + * 110) 11 Mbps=0A= + *=0A= + */=0A= uint16_t len;=0A= uint16_t reserve3;=0A= } __packed;=0A= @@ -1359,8 +1564,18 @@=0A= #define IWN_FW_TLV_INIT_DATA 4=0A= #define IWN_FW_TLV_BOOT_TEXT 5=0A= #define IWN_FW_TLV_PBREQ_MAXLEN 6=0A= +#define IWN_FW_TLV_PAN 7=0A= +#define IWN_FW_TLV_RUNT_EVTLOG_PTR 8=0A= +#define IWN_FW_TLV_RUNT_EVTLOG_SIZE 9=0A= +#define IWN_FW_TLV_RUNT_ERRLOG_PTR 10=0A= +#define IWN_FW_TLV_INIT_EVTLOG_PTR 11=0A= +#define IWN_FW_TLV_INIT_EVTLOG_SIZE 12=0A= +#define IWN_FW_TLV_INIT_ERRLOG_PTR 13=0A= #define IWN_FW_TLV_ENH_SENS 14=0A= #define IWN_FW_TLV_PHY_CALIB 15=0A= +#define IWN_FW_TLV_WOWLAN_INST 16=0A= +#define IWN_FW_TLV_WOWLAN_DATA 17=0A= +#define IWN_FW_TLV_FLAGS 18=0A= =0A= uint16_t alt;=0A= uint32_t len;=0A= @@ -1394,6 +1609,7 @@=0A= #define IWN4965_EEPROM_VOLTAGE 0x0e9=0A= #define IWN4965_EEPROM_BANDS 0x0ea=0A= /* Indirect offsets. */=0A= +#define IWN5000_EEPROM_NO_HT40 0x000=0A= #define IWN5000_EEPROM_DOMAIN 0x001=0A= #define IWN5000_EEPROM_BAND1 0x004=0A= #define IWN5000_EEPROM_BAND2 0x013=0A= @@ -1505,6 +1721,16 @@=0A= IWN5000_EEPROM_BAND7=0A= };=0A= =0A= +static const uint32_t iwn1000_regulatory_bands[IWN_NBANDS] =3D {=0A= + IWN5000_EEPROM_BAND1,=0A= + IWN5000_EEPROM_BAND2,=0A= + IWN5000_EEPROM_BAND3,=0A= + IWN5000_EEPROM_BAND4,=0A= + IWN5000_EEPROM_BAND5,=0A= + IWN5000_EEPROM_BAND6,=0A= + IWN5000_EEPROM_NO_HT40,=0A= +};=0A= +=0A= #define IWN_CHAN_BANDS_COUNT 7=0A= #define IWN_MAX_CHAN_PER_BAND 14=0A= static const struct iwn_chan_band {=0A= @@ -1524,6 +1750,13 @@=0A= { 11, { 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157 } }=0A= };=0A= =0A= +static const uint8_t iwn_bss_ac_to_queue[] =3D {=0A= + 2, 3, 1, 0,=0A= +};=0A= +=0A= +static const uint8_t iwn_pan_ac_to_queue[] =3D {=0A= + 5, 4, 6, 7,=0A= +};=0A= #define IWN1000_OTP_NBLOCKS 3 =0A= #define IWN6000_OTP_NBLOCKS 4 =0A= #define IWN6050_OTP_NBLOCKS 7=0A= @@ -1533,7 +1766,15 @@=0A= #define IWN_RIDX_OFDM6 4=0A= =0A= #define IWN4965_MAX_PWR_INDEX 107=0A= +#define IWN_POWERSAVE_LVL_NONE 0=0A= +#define IWN_POWERSAVE_LVL_VOIP_COMPATIBLE 1=0A= +#define IWN_POWERSAVE_LVL_MAX 5=0A= =0A= +#define IWN_POWERSAVE_LVL_DEFAULT IWN_POWERSAVE_LVL_NONE=0A= +=0A= +/* DTIM value to pass in for IWN_POWERSAVE_LVL_VOIP_COMPATIBLE */=0A= +#define IWN_POWERSAVE_DTIM_VOIP_COMPATIBLE 2=0A= +=0A= /*=0A= * RF Tx gain values from highest to lowest power (values obtained from=0A= * the reference driver.)=0A= @@ -1715,6 +1956,19 @@=0A= 100=0A= };=0A= =0A= +/* Get value from linux kernel 3.2.+ in = Drivers/net/wireless/iwlwifi/iwl-2000.c*/=0A= +static const struct iwn_sensitivity_limits iwn2030_sensitivity_limits = =3D {=0A= + 105,110,=0A= + 128,232,=0A= + 80,145,=0A= + 128,232,=0A= + 125,175,=0A= + 160,310,=0A= + 97,=0A= + 97,=0A= + 110=0A= +};=0A= +=0A= /* Map TID to TX scheduler's FIFO. */=0A= static const uint8_t iwn_tid2fifo[] =3D {=0A= 1, 0, 0, 1, 2, 2, 3, 3, 7, 7, 7, 7, 7, 7, 7, 7, 3=0A= ------=_NextPart_000_0031_01CE8F81.F53334D0-- From owner-freebsd-wireless@FreeBSD.ORG Fri Aug 2 16:17:04 2013 Return-Path: Delivered-To: freebsd-wireless@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 DE5D8E1A; Fri, 2 Aug 2013 16:17:04 +0000 (UTC) (envelope-from qinchenchong@gmail.com) Received: from mail-vb0-x234.google.com (mail-vb0-x234.google.com [IPv6:2607:f8b0:400c:c02::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 885EE2EEC; Fri, 2 Aug 2013 16:17:04 +0000 (UTC) Received: by mail-vb0-f52.google.com with SMTP id f12so790230vbg.25 for ; Fri, 02 Aug 2013 09:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=sYHwg71w2ZZ8f4QOCKCRmmk/4ImQ1yaHJEbCYnw2GJc=; b=tyl62bS30E62/lnND60FymR/M7t91v1uo94+X0NefibwumW266s36KyhRj3IV79Bp1 +SKPzbXgNe4M0TJlrMMnpwiI5aXOtN6QztX3cVEEGjG/jcbgYepo3IjUPAsJUr9A7miJ P7B1F+TNAfboAE/f6nIF5hVIiuUhy+kOrmlCEKncBrYhLxSWV0ut7bp68RINQfKmOGr9 pb1S7RzUQYCcyvGBzIJXD84Kx1HrZnKbc4sVoKpgHyU4i4FYUcIJ2Ze9wSr1P/hBocCJ yR8vnQyDAAnt7vrdEoNtjEt/9VqgkdX284CGRN48vj+UI/I40J3p5YwTGlFBmvSxMVgY rKeQ== MIME-Version: 1.0 X-Received: by 10.220.191.5 with SMTP id dk5mr2254294vcb.47.1375460223027; Fri, 02 Aug 2013 09:17:03 -0700 (PDT) Received: by 10.220.57.142 with HTTP; Fri, 2 Aug 2013 09:17:02 -0700 (PDT) In-Reply-To: References: Date: Sat, 3 Aug 2013 00:17:02 +0800 Message-ID: Subject: Re: Chenchong's work on net80211_ratectl From: Chenchong Qin To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Aug 2013 16:17:04 -0000 Hi! These days, I'm taking a further look at what Linux done for the _completion_ of a frame. Some updates will be posted here later. And, with ir_rates, we can return/fill an rc array rather than just returning the rix. Thanks! Chenchong On Thu, Aug 1, 2013 at 12:21 AM, Adrian Chadd wrote: > Boo! > > Do you have another update? > > > > -adrian > > On 24 July 2013 06:44, Adrian Chadd wrote: > > On 24 July 2013 06:38, Chenchong Qin wrote: > >> > >> My pleasure! > >> > >> It's also against HEAD. > >> > >> Thanks! > > > > Ok. This is looking great! > > > > Next - we need to update the rate control API to now populate an rc > > array rather than just returning the rix. > > > > This is the tricky part - as we're going to have to modify all the > > drivers that use the rate control API to use this. > > Which is fine, as there's only a handful. It's just annoying. > > > > Then we have to provide the rate control information during frame > > _completion_, so the rate control code knows which transmission rates > > succeeded or failed. I'm still not sure what to do about it here. > > Maybe do something like Linux and attach TX rate control and > > completion information as an mbuf tag? > > > > _Then_ we can start doing interesting thing with it. :) > > > > > > > > -adrian > From owner-freebsd-wireless@FreeBSD.ORG Fri Aug 2 17:30:55 2013 Return-Path: Delivered-To: freebsd-wireless@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 5B4D5C48 for ; Fri, 2 Aug 2013 17:30:55 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E29692224 for ; Fri, 2 Aug 2013 17:30:54 +0000 (UTC) Received: by mail-wi0-f182.google.com with SMTP id hi8so803828wib.3 for ; Fri, 02 Aug 2013 10:30:51 -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; bh=FB+Fhv5XuWsdk0ETOgacWM9ZC6BcNkbjXIADClhL0c4=; b=AapdfIQTJo2WXILVpzk5zt1CxOdBjwje2Dy4hfIFCYebBgDBcFMtJO3lpxNlHEiqNC nEcTtU2WwXeJImZ9IRPqBRBmElMFZKfboHrX7WpDxQUVNuFvoZy2DxXAnDoSA9/P1oZ+ FrLZ++hPSerSSRxtnnuzfldNvet9ecJDiTOo/HMgYfEmu3CKbfHHyZVa1yK3t4/GYChN 9JBgM5eHCiRPWgKj5cMBRwoxV5vWFlYDkdBZNpjK5sNFAL9BE68BNNawXRVT3R5DaPh0 /P5iV9WJh4XwZeirdBQY9UFZ5ntty6b/d1H6++V5l2Orqm2zZ9GO2N1HCpx+L26Dl7Tz cvjA== MIME-Version: 1.0 X-Received: by 10.194.11.67 with SMTP id o3mr5851590wjb.0.1375464651887; Fri, 02 Aug 2013 10:30:51 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Fri, 2 Aug 2013 10:30:51 -0700 (PDT) In-Reply-To: References: Date: Fri, 2 Aug 2013 10:30:51 -0700 X-Google-Sender-Auth: DQ301wZkoYSP0M3K_gUateQ2BN0 Message-ID: Subject: Re: Chenchong's work on net80211_ratectl From: Adrian Chadd To: Chenchong Qin Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Aug 2013 17:30:55 -0000 Well just remember you can always ask me/us questions! What's your latest diff against -HEAD? Maybe I can start looking at including parts of it in the tree. -adrian On 2 August 2013 09:17, Chenchong Qin wrote: > Hi! > > These days, I'm taking a further look at what Linux done for the > _completion_ of a > frame. Some updates will be posted here later. > > And, with ir_rates, we can return/fill an rc array rather than just > returning the rix. > > Thanks! > > Chenchong > > > > > > On Thu, Aug 1, 2013 at 12:21 AM, Adrian Chadd wrote: >> >> Boo! >> >> Do you have another update? >> >> >> >> -adrian >> >> On 24 July 2013 06:44, Adrian Chadd wrote: >> > On 24 July 2013 06:38, Chenchong Qin wrote: >> >> >> >> My pleasure! >> >> >> >> It's also against HEAD. >> >> >> >> Thanks! >> > >> > Ok. This is looking great! >> > >> > Next - we need to update the rate control API to now populate an rc >> > array rather than just returning the rix. >> > >> > This is the tricky part - as we're going to have to modify all the >> > drivers that use the rate control API to use this. >> > Which is fine, as there's only a handful. It's just annoying. >> > >> > Then we have to provide the rate control information during frame >> > _completion_, so the rate control code knows which transmission rates >> > succeeded or failed. I'm still not sure what to do about it here. >> > Maybe do something like Linux and attach TX rate control and >> > completion information as an mbuf tag? >> > >> > _Then_ we can start doing interesting thing with it. :) >> > >> > >> > >> > -adrian > > From owner-freebsd-wireless@FreeBSD.ORG Fri Aug 2 21:23:42 2013 Return-Path: Delivered-To: freebsd-wireless@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 2012C34E for ; Fri, 2 Aug 2013 21:23:42 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AB56A2B84 for ; Fri, 2 Aug 2013 21:23:41 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id l18so898774wgh.11 for ; Fri, 02 Aug 2013 14:23:39 -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=1c9J9sbV4LsbdzER3jtfLLgrFo5wFvLN0QVJ09bWB1s=; b=amslRsCTUd32zvSwk2CBIfI9UV72+5XK5F1g8GOW4Om7VHjva1XklNorgIVw3fn8zR IjuBvewhPe3b1PGms3nHV9Ggz+Oxh/G15vFbEvYzDQWIJlmyK69fy3nYNNr3Fokow3hL 9Pvcb0l3uIgCS6cBjhKNR+bFcG+5EHXqSEPpHTWF8u00DX9MlQoQSn8BeXQI8GLstDyD IzW111s+1hEXaqMPZFsiT3zYEiAmCs8ar9G+6U6LwUk/dYuK4raBi6b53UxDf3tQkyol +cOHwOTYd3Rz9D2Pg8SnZGMAm4WiYtgFkPrcjykqCxi7mT6eRk4S+zuNAqVCB/uoBdi+ dYkg== MIME-Version: 1.0 X-Received: by 10.180.20.116 with SMTP id m20mr105059wie.46.1375478619798; Fri, 02 Aug 2013 14:23:39 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Fri, 2 Aug 2013 14:23:39 -0700 (PDT) In-Reply-To: <00a601ce8c8a$f21570f0$d64052d0$@info> References: <007601ce8c73$2b508cf0$81f1a6d0$@info> <00a601ce8c8a$f21570f0$d64052d0$@info> Date: Fri, 2 Aug 2013 14:23:39 -0700 X-Google-Sender-Auth: iDCeEN6Ue6vBMdzsVoog7wYOduw Message-ID: Subject: Re: [iwn] Review split 3 From: Adrian Chadd To: Cedric GROSS Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Aug 2013 21:23:42 -0000 Committed ,thanks! -adrian On 29 July 2013 11:39, Cedric GROSS wrote: > > >> De : Warren Block [mailto:wblock@wonkity.com] >> Envoy=E9 : lundi 29 juillet 2013 20:11 >> =C0 : Adrian Chadd >> Cc : Cedric GROSS; freebsd-wireless@freebsd.org >> >> On Mon, 29 Jul 2013, Adrian Chadd wrote: >> >> > Hi! >> > >> > Cool! ok, the style niggles. >> > >> > * Your #define IWN_blah needs a TAB between #define and the IWN_blah >> > value. Right now you have spaces. > > Ok, I tough you need spaces between #define and values... > > standard single-include stuff : Done > $FreeBSD$ : Moved > > Each file is different. Really hard to find something common. Man 9 style= is > quite useful but enough precise for tab and space usage I think. > >> >> There is whitespace at the end of some of the comment lines also. >> >> textproc/igor will find problems like that: >> >> igor -R filename | less -RS > > Thanks for that Warren ! From owner-freebsd-wireless@FreeBSD.ORG Fri Aug 2 21:28:46 2013 Return-Path: Delivered-To: freebsd-wireless@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 20E8F568 for ; Fri, 2 Aug 2013 21:28:46 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x232.google.com (mail-wi0-x232.google.com [IPv6:2a00:1450:400c:c05::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD8BD2BAC for ; Fri, 2 Aug 2013 21:28:45 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id j17so993119wiw.17 for ; Fri, 02 Aug 2013 14:28:43 -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; bh=Aw5/7yPHF1oPIgWmIQI5R1p51w3NL3+Qj6xk5x1pR/I=; b=SwVyTw9qeynlAb//lwRhFIQbZNNF8WivWHPIxQHJBrig/sJYSj75ag+NihRGHIxC5p zhmyIeEbU01D+/n7PoYWsIzRxcHES5NJexEDsOZBXgR/WcBgweuCG2U5tZvDQE+W02Mt u/gQ1EAlCF0OOvSrpzlhnvlYpUUuWSuJPnMeb2x12EdCkdKo8vk4NuzJ3fdn/QgQZ98R EroR986SVUTkeaEYwZvx9nZ9RnHBEDeUl4nBGKr4r8KjITAqbqkkyGH5mcYCbfkZw/Rx QYXgVJMbsBuIwhl23HVCC/Wj3R/0WlU/OWTejKyqHDuElXl8tcm/OTP2v07jmqgcl5zA gluw== MIME-Version: 1.0 X-Received: by 10.180.185.148 with SMTP id fc20mr203812wic.0.1375478923937; Fri, 02 Aug 2013 14:28:43 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Fri, 2 Aug 2013 14:28:43 -0700 (PDT) In-Reply-To: <003001ce8f71$31aa64d0$94ff2e70$@info> References: <003001ce8f71$31aa64d0$94ff2e70$@info> Date: Fri, 2 Aug 2013 14:28:43 -0700 X-Google-Sender-Auth: buhqXUtE61ngNKzNptRQevQQY8c Message-ID: Subject: Re: [iwn] Review split 4 From: Adrian Chadd To: Cedric GROSS Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Aug 2013 21:28:46 -0000 Committed! Thanks! -adrian On 2 August 2013 04:12, Cedric GROSS wrote: > Hello, > > > > After split 3 applied and committed , you will find split 4. > > This one modify if_iwnreg.h > > > > Add nearly everything we will need for later use. > > > > Cedric > > > _______________________________________________ > 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" From owner-freebsd-wireless@FreeBSD.ORG Fri Aug 2 21:29:48 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F23395E4 for ; Fri, 2 Aug 2013 21:29:48 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-x22b.google.com (mail-we0-x22b.google.com [IPv6:2a00:1450:400c:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8725D2BB8 for ; Fri, 2 Aug 2013 21:29:48 +0000 (UTC) Received: by mail-we0-f171.google.com with SMTP id q55so934430wes.16 for ; Fri, 02 Aug 2013 14:29:46 -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; bh=1jvCaGmriUdiEaSqwcUz6ap7gl8PZG9WcYKXUIIfHMc=; b=itFxYxyUSBEJmLG046F9pNY0clj4eCnrP/W9oizbidfoMa3wQU6miPHNMshYvvxkGR tS2kcBHip8pTqQnDzRX5pyV6aZIr9tAI58EGCHcWlvPWGP5juUd4rCSUlLaLhAKW66HK Y+ibEXYowGVcrzLFSM9JXTLKiWUjtoWcN9bVizSyf902Lfi6y9ssPMRbsAKmrzvhXaHe ZzFJy/rDvWJlLqFmYEsV/y1Oi1h/GBHI+As8FVjM9y3yzv1D/7LawOUwq2MVCTiCquo6 pBXw1sn7BBFaqqrLf34+Boqya/UygKnvSlNKW6TOpzDe3YomoRaJOV1dAhW069opgBDm ufxw== MIME-Version: 1.0 X-Received: by 10.180.211.206 with SMTP id ne14mr146394wic.30.1375478986782; Fri, 02 Aug 2013 14:29:46 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Fri, 2 Aug 2013 14:29:46 -0700 (PDT) In-Reply-To: <002401ce8f5f$fc5ad780$f5108680$@info> References: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> <002d01ce8c46$a13b23d0$e3b16b70$@info> <002701ce8e03$c033f640$409be2c0$@info> <002401ce8f5f$fc5ad780$f5108680$@info> Date: Fri, 2 Aug 2013 14:29:46 -0700 X-Google-Sender-Auth: zkyMuns3qk3-v7TULphvV5t5jU8 Message-ID: Subject: Re: [IWN] Reviw split 2 From: Adrian Chadd To: Cedric GROSS Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Aug 2013 21:29:49 -0000 I've committed -3 and -4 from your work. Can you please post an updated diff against what's in -HEAD now? I have updated firmware here that I'm going to commit soon, including the newer device firmware. But I do want to test on the 4965 first just to make sure it still 'works'. Thanks! -adrian From owner-freebsd-wireless@FreeBSD.ORG Sat Aug 3 02:17:33 2013 Return-Path: Delivered-To: freebsd-wireless@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 3B0CD9AC for ; Sat, 3 Aug 2013 02:17:33 +0000 (UTC) (envelope-from hwn@jasperdisplay.com) Received: from mail-oa0-f48.google.com (mail-oa0-f48.google.com [209.85.219.48]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C3AE12345 for ; Sat, 3 Aug 2013 02:17:32 +0000 (UTC) Received: by mail-oa0-f48.google.com with SMTP id o17so2767594oag.35 for ; Fri, 02 Aug 2013 19:17:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type :x-gm-message-state; bh=W4s8x/AHLsUvUYqxFi73D0zud/c2p+CbmOFx3nqT1wc=; b=O8njTK8N0mmVgS5znb/q8bhI6gfO7XIlqeaM42Y4K3ILUBRETLQNKjhcmmREqtJPqh bBdPUTheCI+AX0TfNwig/XDotiKowbfT1MUYNlMVKbwL/F8GW5VYiDQGTsgd4gBud2IY LGEPllvgegcWbp6WOt1v+QDaAD1Tv/Aca5pFCanG2iF3V3SAjgsfwHeOCP/V6f3CoFHv lLq03tyYLZjzJaF7xJQmv8wILts/0Gn/uxPLlxjLcfOCv8dXF073IVpWtpvC+GbbCT07 F8J9bwNt0suPVcEnqciUaqaLU0xqNZOeog8flpak3xu7S1LQNXw1TgoQUXfAqGdysJh5 FNSw== MIME-Version: 1.0 X-Received: by 10.60.142.103 with SMTP id rv7mr7513844oeb.13.1375496245986; Fri, 02 Aug 2013 19:17:25 -0700 (PDT) Received: by 10.76.84.100 with HTTP; Fri, 2 Aug 2013 19:17:25 -0700 (PDT) Date: Fri, 2 Aug 2013 19:17:25 -0700 Message-ID: Subject: atheros ar9485 From: "H.W. Neff" To: freebsd-wireless@freebsd.org X-Gm-Message-State: ALoCoQkDA9puRSrdhhUivhthua7xEcPOH99Gr6M877ZW4+1mVY1u2JJNL4yC+NhBLwyru+mcl9rq Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Aug 2013 02:17:33 -0000 hi. what is the status of the/any driver for the atheros ar9485 wifi adapter? cheers! hwn From owner-freebsd-wireless@FreeBSD.ORG Sat Aug 3 03:25:56 2013 Return-Path: Delivered-To: freebsd-wireless@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 A3BA33FA for ; Sat, 3 Aug 2013 03:25:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-x22c.google.com (mail-we0-x22c.google.com [IPv6:2a00:1450:400c:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3BE802582 for ; Sat, 3 Aug 2013 03:25:56 +0000 (UTC) Received: by mail-we0-f172.google.com with SMTP id t61so1084992wes.3 for ; Fri, 02 Aug 2013 20:25:54 -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; bh=Llvdb9Pe4W0uqhiPIgNo7VqMJJNgN7TBibILsjJOkPs=; b=PalQrg/M7tzjAsgxPuuhz7FMC/Gar6k26Dz88TvJDGk43id4AWkzGRbRF7fmYtusrS IAeR2Cwvd1m8gwgjALLYRJIM2VIF8O0o8xXoH9+EoZIOADQe71O2ZDBBGnflZBCAwnrh IxCvxx2KFLmyFwqh+j82AtMpqYzTYjBwq1KWlSKqIPKC8UVeh3PpxtpMhaQ1uF9S6R1Y CAx6SLOoWFqP5aMaUAIHh704yaxASAgV3rYt6GkjS4Kb6xFPIKz8rlRCcEsW5NAC8x6k u4QAPi1zpSnLv1EPw10VKgB14PrDIhA4NgFvgHRDvwwoaQbLZjShM7ZIwA/GFJDlsl5n NWdw== MIME-Version: 1.0 X-Received: by 10.180.20.116 with SMTP id m20mr668719wie.46.1375500354058; Fri, 02 Aug 2013 20:25:54 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Fri, 2 Aug 2013 20:25:53 -0700 (PDT) In-Reply-To: References: Date: Fri, 2 Aug 2013 20:25:53 -0700 X-Google-Sender-Auth: zWdFVDsEXn8ZZMngu1NYbv91YkA Message-ID: Subject: Re: atheros ar9485 From: Adrian Chadd To: "H.W. Neff" Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Aug 2013 03:25:56 -0000 it's in -head. ;) -adrian On 2 August 2013 19:17, H.W. Neff wrote: > hi. > > what is the status of the/any driver for the atheros ar9485 wifi adapter? > > cheers! > hwn > _______________________________________________ > 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" From owner-freebsd-wireless@FreeBSD.ORG Sat Aug 3 11:23:54 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3D8D0359; Sat, 3 Aug 2013 11:23:54 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [178.32.219.166]) by mx1.freebsd.org (Postfix) with ESMTP id 4D9312F7C; Sat, 3 Aug 2013 11:23:52 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id 100925BF; Sat, 3 Aug 2013 13:23:43 +0200 (CEST) From: "Cedric GROSS" To: "'Adrian Chadd'" References: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> <002d01ce8c46$a13b23d0$e3b16b70$@info> <002701ce8e03$c033f640$409be2c0$@info> <002401ce8f5f$fc5ad780$f5108680$@info> In-Reply-To: Subject: RE: [IWN] Reviw split 2 Date: Sat, 3 Aug 2013 13:23:36 +0200 Message-ID: <001001ce903b$e77a5f70$b66f1e50$@info> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0011_01CE904C.AB032F70" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac6Px2z71TtND6R9S1eMSwSByMYisAAdAAaA Content-Language: fr Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Aug 2013 11:23:54 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_0011_01CE904C.AB032F70 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable > De=A0: adrian.chadd@gmail.com [mailto:adrian.chadd@gmail.com] De la = part > de Adrian Chadd > Envoy=E9=A0: vendredi 2 ao=FBt 2013 23:30 >=20 > I've committed -3 and -4 from your work. Great. >=20 > Can you please post an updated diff against what's in -HEAD now? As requested here is full patch. >=20 > I have updated firmware here that I'm going to commit soon, including > the newer device firmware. But I do want to test on the 4965 first = just > to make sure it still 'works'. It should. 4965 part was not impacted. But Don't you said that full = patch break your 5100 ? >=20 > Thanks! >=20 >=20 > -adrian Cedric ------=_NextPart_000_0011_01CE904C.AB032F70 Content-Type: application/octet-stream; name="full.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="full.patch" Index: if_iwn.c=0A= =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=0A= --- if_iwn.c (revision 253911)=0A= +++ if_iwn.c (working copy)=0A= @@ -1,4 +1,6 @@=0A= /*-=0A= + * Copyright (c) 2013 Cedric GROSS =0A= + * Copyright (c) 2011 Intel Corporation=0A= * Copyright (c) 2007-2009=0A= * Damien Bergamini =0A= * Copyright (c) 2008=0A= @@ -233,7 +235,8 @@=0A= static int iwn_add_broadcast_node(struct iwn_softc *, int);=0A= static int iwn_updateedca(struct ieee80211com *);=0A= static void iwn_update_mcast(struct ifnet *);=0A= -static void iwn_set_led(struct iwn_softc *, uint8_t, uint8_t, uint8_t);=0A= +static void iwn_set_led(struct iwn_softc *, uint8_t, uint8_t, uint8_t,=0A= + uint8_t);=0A= static int iwn_set_critical_temp(struct iwn_softc *);=0A= static int iwn_set_timing(struct iwn_softc *, struct ieee80211_node *);=0A= static void iwn4965_power_calibration(struct iwn_softc *, int);=0A= @@ -259,7 +262,6 @@=0A= static int iwn_set_pslevel(struct iwn_softc *, int, int, int);=0A= static int iwn_send_btcoex(struct iwn_softc *);=0A= static int iwn_send_advanced_btcoex(struct iwn_softc *);=0A= -static int iwn5000_runtime_calib(struct iwn_softc *);=0A= static int iwn_config(struct iwn_softc *);=0A= static uint8_t *ieee80211_add_ssid(uint8_t *, const uint8_t *, u_int);=0A= static int iwn_scan(struct iwn_softc *);=0A= @@ -290,6 +292,7 @@=0A= static int iwn5000_send_wimax_coex(struct iwn_softc *);=0A= static int iwn5000_crystal_calib(struct iwn_softc *);=0A= static int iwn5000_temp_offset_calib(struct iwn_softc *);=0A= +static int iwn5000_temp_offset_calibv2(struct iwn_softc *);=0A= static int iwn4965_post_alive(struct iwn_softc *);=0A= static int iwn5000_post_alive(struct iwn_softc *);=0A= static int iwn4965_load_bootcode(struct iwn_softc *, const uint8_t *,=0A= @@ -328,6 +331,23 @@=0A= static char *iwn_get_csr_string(int);=0A= static void iwn_debug_register(struct iwn_softc *);=0A= #endif=0A= +static int iwn_config_specific(struct iwn_softc *,uint16_t);=0A= +static int iwn_set_statistics_request(struct iwn_softc *, bool, bool, = int);=0A= +static int iwn_cfg_ucode_post_alive(struct iwn_softc *);=0A= +static int iwn_iv_reset(struct ieee80211vap *, u_long);=0A= +static int iwn_newstate_u1(struct ieee80211vap *, enum ieee80211_state, = int);=0A= +static int iwn_auth_u1(struct iwn_softc *, struct ieee80211vap *);=0A= +static int iwn_run_u1(struct iwn_softc *, struct ieee80211vap *);=0A= +static int iwn_set_timing_u1(struct iwn_softc *);=0A= +static int iwn_config_u1(struct iwn_softc *);=0A= +static int iwn_set_pan_params(struct iwn_softc *);=0A= +static int iwn_updateedca_u1(struct ieee80211com *);=0A= +static int iwn_add_broadcast_node_u1(struct iwn_softc *, int );=0A= +static uint16_t iwn_get_active_dwell(struct iwn_softc *,=0A= + struct ieee80211_channel *);=0A= +static uint16_t iwn_get_passive_dwell(struct iwn_softc *,=0A= + struct ieee80211_channel *);=0A= +static void iwn_led_pattern(struct iwn_softc *);=0A= =0A= #ifdef IWN_DEBUG=0A= enum {=0A= @@ -353,7 +373,7 @@=0A= };=0A= =0A= #define DPRINTF(sc, m, fmt, ...) do { \=0A= - if (sc->sc_debug & (m)) \=0A= + if ((sc->sc_debug & (m))=3D=3D (m)) \=0A= printf(fmt, __VA_ARGS__); \=0A= } while (0)=0A= =0A= @@ -374,6 +394,7 @@=0A= case IWN_RX_PHY: return "RX_PHY";=0A= case IWN_MPDU_RX_DONE: return "MPDU_RX_DONE";=0A= case IWN_RX_DONE: return "RX_DONE";=0A= + case IWN_TEMP_NOTIFICATION: return "TEMPERATURE_NOTIFICATION";=0A= =0A= /* Command Notifications */=0A= case IWN_CMD_RXON: return "IWN_CMD_RXON";=0A= @@ -396,6 +417,23 @@=0A= case IWN_CMD_SET_CRITICAL_TEMP: return "IWN_CMD_SET_CRITICAL_TEMP";=0A= case IWN_CMD_SET_SENSITIVITY: return "IWN_CMD_SET_SENSITIVITY";=0A= case IWN_CMD_PHY_CALIB: return "IWN_CMD_PHY_CALIB";=0A= + case IWN_CMD_BT_COEX_PRIOTABLE: return "IWN_CMD_BT_COEX_PRIOTABLE";=0A= + case IWN_CMD_BT_COEX_PROT: return "IWN_CMD_BT_COEX_PROT";=0A= + case IWN_CMD_BT_COEX_NOTIF: return "IWN_CMD_BT_COEX_NOTIF";=0A= + /* PAN commands */=0A= + case IWN_CMD_WIPAN_PARAMS: return "IWN_CMD_WIPAN_PARAMS";=0A= + case IWN_CMD_WIPAN_RXON: return "IWN_CMD_WIPAN_RXON";=0A= + case IWN_CMD_WIPAN_RXON_TIMING: return "IWN_CMD_WIPAN_RXON_TIMING";=0A= + case IWN_CMD_WIPAN_RXON_ASSOC: return "IWN_CMD_WIPAN_RXON_ASSOC";=0A= + case IWN_CMD_WIPAN_QOS_PARAM: return "IWN_CMD_WIPAN_QOS_PARAM";=0A= + case IWN_CMD_WIPAN_WEPKEY: return "IWN_CMD_WIPAN_WEPKEY";=0A= + case IWN_CMD_WIPAN_P2P_CHANNEL_SWITCH:=0A= + return "IWN_CMD_WIPAN_P2P_CHANNEL_SWITCH";=0A= + case IWN_CMD_WIPAN_NOA_NOTIFICATION:=0A= + return "IWN_CMD_WIPAN_NOA_NOTIFICATION";=0A= + case IWN_CMD_WIPAN_DEACTIVATION_COMPLETE:=0A= + return "IWN_CMD_WIPAN_DEACTIVATION_COMPLETE";=0A= +=0A= }=0A= return "UNKNOWN INTR NOTIF/CMD";=0A= }=0A= @@ -454,6 +492,10 @@=0A= int i, error, result;=0A= uint8_t macaddr[IEEE80211_ADDR_LEN];=0A= =0A= + sc->desired_pwrsave_level =3D IWN_POWERSAVE_LVL_DEFAULT;=0A= + sc->current_pwrsave_level =3D -1; /* signifies uninitialized */=0A= +=0A= +=0A= sc->sc_dev =3D dev;=0A= =0A= #ifdef IWN_DEBUG=0A= @@ -465,7 +507,7 @@=0A= sc->sc_debug =3D 0;=0A= #endif=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: begin\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_RESET, "->%s: begin\n",__func__);=0A= =0A= /*=0A= * Get the offset of the PCI Express Capability Structure in PCI=0A= @@ -521,6 +563,8 @@=0A= /* Read hardware revision and attach. */=0A= sc->hw_type =3D (IWN_READ(sc, IWN_HW_REV) >> IWN_HW_REV_TYPE_SHIFT)=0A= & IWN_HW_REV_TYPE_MASK;=0A= + sc->subdevice_id=3Dpci_get_subdevice(dev);=0A= +=0A= if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_4965)=0A= error =3D iwn4965_attach(sc, pci_get_device(dev));=0A= else=0A= @@ -612,6 +656,11 @@=0A= | IEEE80211_C_WME /* WME */=0A= | IEEE80211_C_PMGT /* Station-side power mgmt */=0A= ;=0A= + if (sc->base_params->support_hostap) {=0A= + ic->ic_caps |=3D IEEE80211_C_HOSTAP ;/* HOSTAP mode supported */=0A= + } else {=0A= + ic->ic_caps &=3D ~ IEEE80211_C_HOSTAP ; /* HOSTAP mode not supported = */=0A= + }=0A= =0A= /* Read MAC address, channels, etc from EEPROM. */=0A= if ((error =3D iwn_read_eeprom(sc, macaddr)) !=3D 0) {=0A= @@ -695,10 +744,19 @@=0A= ic->ic_scan_mindwell =3D iwn_scan_mindwell;=0A= ic->ic_setregdomain =3D iwn_setregdomain;=0A= =0A= + sc->sc_led.led_cur_mode =3D IWN_LED_STATIC_OFF;=0A= + sc->sc_led.led_cur_tpt =3D 0;=0A= + sc->sc_led.led_last_tpt =3D 0;=0A= + sc->sc_led.led_cur_time =3D 0;=0A= + sc->sc_led.led_last_time =3D 0;=0A= +=0A= +=0A= +=0A= iwn_radiotap_attach(sc);=0A= =0A= callout_init_mtx(&sc->calib_to, &sc->sc_mtx, 0);=0A= callout_init_mtx(&sc->watchdog_to, &sc->sc_mtx, 0);=0A= + callout_init_mtx(&sc->ct_kill_exit_to, &sc->sc_mtx, 0);=0A= TASK_INIT(&sc->sc_reinit_task, 0, iwn_hw_reset, sc);=0A= TASK_INIT(&sc->sc_radioon_task, 0, iwn_radio_on, sc);=0A= TASK_INIT(&sc->sc_radiooff_task, 0, iwn_radio_off, sc);=0A= @@ -715,14 +773,21 @@=0A= error);=0A= goto fail;=0A= }=0A= + /* update ic->ic_flags to the default power save mode */=0A= + if (IWN_POWERSAVE_LVL_DEFAULT !=3D IWN_POWERSAVE_LVL_NONE)=0A= + ic->ic_flags |=3D IEEE80211_F_PMGTON;=0A= + else=0A= + ic->ic_flags &=3D ~IEEE80211_F_PMGTON;=0A= =0A= +=0A= if (bootverbose)=0A= ieee80211_announce(ic);=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s: end\n",__func__);=0A= return 0;=0A= fail:=0A= iwn_detach(dev);=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET | IWN_DEBUG_FATAL,=0A= + "->%s: end in error\n",__func__);=0A= return error;=0A= }=0A= =0A= @@ -772,7 +837,7 @@=0A= {=0A= struct iwn_ops *ops =3D &sc->ops;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= ops->load_firmware =3D iwn5000_load_firmware;=0A= ops->read_eeprom =3D iwn5000_read_eeprom;=0A= @@ -801,59 +866,7 @@=0A= sc->reset_noise_gain =3D IWN5000_PHY_CALIB_RESET_NOISE_GAIN;=0A= sc->noise_gain =3D IWN5000_PHY_CALIB_NOISE_GAIN;=0A= =0A= - switch (sc->hw_type) {=0A= - case IWN_HW_REV_TYPE_5100:=0A= - sc->limits =3D &iwn5000_sensitivity_limits;=0A= - sc->fwname =3D "iwn5000fw";=0A= - /* Override chains masks, ROM is known to be broken. */=0A= - sc->txchainmask =3D IWN_ANT_B;=0A= - sc->rxchainmask =3D IWN_ANT_AB;=0A= - break;=0A= - case IWN_HW_REV_TYPE_5150:=0A= - sc->limits =3D &iwn5150_sensitivity_limits;=0A= - sc->fwname =3D "iwn5150fw";=0A= - break;=0A= - case IWN_HW_REV_TYPE_5300:=0A= - case IWN_HW_REV_TYPE_5350:=0A= - sc->limits =3D &iwn5000_sensitivity_limits;=0A= - sc->fwname =3D "iwn5000fw";=0A= - break;=0A= - case IWN_HW_REV_TYPE_1000:=0A= - sc->limits =3D &iwn1000_sensitivity_limits;=0A= - sc->fwname =3D "iwn1000fw";=0A= - break;=0A= - case IWN_HW_REV_TYPE_6000:=0A= - sc->limits =3D &iwn6000_sensitivity_limits;=0A= - sc->fwname =3D "iwn6000fw";=0A= - if (pid =3D=3D 0x422c || pid =3D=3D 0x4239) {=0A= - sc->sc_flags |=3D IWN_FLAG_INTERNAL_PA;=0A= - /* Override chains masks, ROM is known to be broken. */=0A= - sc->txchainmask =3D IWN_ANT_BC;=0A= - sc->rxchainmask =3D IWN_ANT_BC;=0A= - }=0A= - break;=0A= - case IWN_HW_REV_TYPE_6050:=0A= - sc->limits =3D &iwn6000_sensitivity_limits;=0A= - sc->fwname =3D "iwn6050fw";=0A= - /* Override chains masks, ROM is known to be broken. */=0A= - sc->txchainmask =3D IWN_ANT_AB;=0A= - sc->rxchainmask =3D IWN_ANT_AB;=0A= - break;=0A= - case IWN_HW_REV_TYPE_6005:=0A= - sc->limits =3D &iwn6000_sensitivity_limits;=0A= - if (pid !=3D 0x0082 && pid !=3D 0x0085) {=0A= - sc->fwname =3D "iwn6000g2bfw";=0A= - sc->sc_flags |=3D IWN_FLAG_ADV_BTCOEX;=0A= - } else=0A= - sc->fwname =3D "iwn6000g2afw";=0A= - break;=0A= - default:=0A= - device_printf(sc->sc_dev, "adapter type %d not supported\n",=0A= - sc->hw_type);=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__);=0A= - return ENOTSUP;=0A= - }=0A= - return 0;=0A= + return iwn_config_specific(sc,pid);=0A= }=0A= =0A= /*=0A= @@ -864,13 +877,13 @@=0A= {=0A= struct ifnet *ifp =3D sc->sc_ifp;=0A= struct ieee80211com *ic =3D ifp->if_l2com;=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= ieee80211_radiotap_attach(ic,=0A= &sc->sc_txtap.wt_ihdr, sizeof(sc->sc_txtap),=0A= IWN_TX_RADIOTAP_PRESENT,=0A= &sc->sc_rxtap.wr_ihdr, sizeof(sc->sc_rxtap),=0A= IWN_RX_RADIOTAP_PRESENT);=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= }=0A= =0A= static void=0A= @@ -894,19 +907,54 @@=0A= {=0A= struct iwn_vap *ivp;=0A= struct ieee80211vap *vap;=0A= + uint8_t mac1[IEEE80211_ADDR_LEN];=0A= + struct iwn_softc *sc =3D ic->ic_ifp->if_softc;=0A= =0A= - if (!TAILQ_EMPTY(&ic->ic_vaps)) /* only one at a time */=0A= - return NULL;=0A= +=0A= + if (sc->base_params->no_multi_vaps) {=0A= + if (!TAILQ_EMPTY(&ic->ic_vaps)) /* only one at a time */=0A= + return NULL;=0A= + }=0A= +=0A= + IEEE80211_ADDR_COPY(mac1, mac);=0A= +=0A= + if(unit =3D=3D 1) {=0A= + if(!(sc->sc_flags & IWN_FLAG_PAN_SUPPORT))=0A= + return NULL;=0A= + mac1[5] +=3D 1;=0A= + sc->ctx =3D IWN_RXON_PAN_CTX;=0A= + }=0A= +=0A= ivp =3D (struct iwn_vap *) malloc(sizeof(struct iwn_vap),=0A= M_80211_VAP, M_NOWAIT | M_ZERO);=0A= if (ivp =3D=3D NULL)=0A= return NULL;=0A= vap =3D &ivp->iv_vap;=0A= - ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac);=0A= +=0A= + ieee80211_vap_setup(ic, vap, name, unit, opmode, flags, bssid, mac1);=0A= +=0A= + if(unit =3D=3D 1) {=0A= + ivp->ctx =3D IWN_RXON_PAN_CTX;=0A= + ivp->iv_newstate =3D vap->iv_newstate;=0A= + vap->iv_newstate =3D iwn_newstate_u1;=0A= + IEEE80211_ADDR_COPY(ivp->macaddr, mac1);=0A= + memset(&sc->rx_on[IWN_RXON_PAN_CTX], 0, sizeof (struct iwn_rxon));=0A= + memcpy(&sc->rx_on[IWN_RXON_PAN_CTX], &sc->rx_on[IWN_RXON_BSS_CTX], = sc->rxonsz);=0A= + IEEE80211_ADDR_COPY(sc->rx_on[IWN_RXON_PAN_CTX].myaddr, mac1);=0A= + sc->rx_on[IWN_RXON_PAN_CTX].mode =3D IWN_MODE_2STA;=0A= + sc->ivap[IWN_RXON_PAN_CTX] =3D vap;=0A= + }=0A= + else {=0A= + ivp->ctx =3D IWN_RXON_BSS_CTX;=0A= + IEEE80211_ADDR_COPY(ivp->macaddr, mac1);=0A= + ivp->iv_newstate =3D vap->iv_newstate;=0A= + vap->iv_newstate =3D iwn_newstate;=0A= + sc->ivap[IWN_RXON_BSS_CTX] =3D vap;=0A= + }=0A= +=0A= vap->iv_bmissthreshold =3D 10; /* override default */=0A= - /* Override with driver methods. */=0A= - ivp->iv_newstate =3D vap->iv_newstate;=0A= - vap->iv_newstate =3D iwn_newstate;=0A= + /* handler for setting change (partial 're'set) requested via ioctl */=0A= + vap->iv_reset =3D iwn_iv_reset;=0A= =0A= ieee80211_ratectl_init(vap);=0A= /* Complete setup. */=0A= @@ -919,7 +967,12 @@=0A= iwn_vap_delete(struct ieee80211vap *vap)=0A= {=0A= struct iwn_vap *ivp =3D IWN_VAP(vap);=0A= + struct iwn_softc *sc =3D vap->iv_ic->ic_ifp->if_softc;=0A= =0A= + if(ivp->ctx =3D=3D IWN_RXON_PAN_CTX)=0A= + sc->ctx =3D 0;=0A= +=0A= +=0A= ieee80211_ratectl_deinit(vap);=0A= ieee80211_vap_detach(vap);=0A= free(ivp, M_80211_VAP);=0A= @@ -933,7 +986,7 @@=0A= struct ieee80211com *ic;=0A= int qid;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= if (ifp !=3D NULL) {=0A= ic =3D ifp->if_l2com;=0A= @@ -944,6 +997,7 @@=0A= =0A= iwn_stop(sc);=0A= callout_drain(&sc->watchdog_to);=0A= + callout_drain(&sc->ct_kill_exit_to);=0A= callout_drain(&sc->calib_to);=0A= ieee80211_ifdetach(ic);=0A= }=0A= @@ -972,7 +1026,8 @@=0A= if (ifp !=3D NULL)=0A= if_free(ifp);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s: end\n",__func__);=0A= +=0A= IWN_LOCK_DESTROY(sc);=0A= return 0;=0A= }=0A= @@ -991,8 +1046,15 @@=0A= {=0A= struct iwn_softc *sc =3D device_get_softc(dev);=0A= struct ieee80211com *ic =3D sc->sc_ifp->if_l2com;=0A= + struct ieee80211vap *vap =3D TAILQ_FIRST(&ic->ic_vaps);=0A= =0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing = %s\n",__func__);=0A= +=0A= ieee80211_suspend_all(ic);=0A= + iwn_stop(sc);=0A= + if (vap !=3D NULL)=0A= + ieee80211_stop(vap);=0A= +=0A= return 0;=0A= }=0A= =0A= @@ -1000,12 +1062,23 @@=0A= iwn_resume(device_t dev)=0A= {=0A= struct iwn_softc *sc =3D device_get_softc(dev);=0A= - struct ieee80211com *ic =3D sc->sc_ifp->if_l2com;=0A= + struct ifnet *ifp =3D sc->sc_ifp;=0A= + struct ieee80211com *ic =3D ifp->if_l2com;=0A= + struct ieee80211vap *vap =3D TAILQ_FIRST(&ic->ic_vaps);=0A= =0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s\n", = __func__);=0A= /* Clear device-specific "PCI retry timeout" register (41h). */=0A= pci_write_config(dev, 0x41, 0, 1);=0A= =0A= ieee80211_resume_all(ic);=0A= + if (ifp->if_flags & IFF_UP) {=0A= + iwn_init(sc);=0A= + if (vap !=3D NULL)=0A= + ieee80211_init(vap);=0A= + if (ifp->if_drv_flags & IFF_DRV_RUNNING)=0A= + iwn_start(ifp);=0A= + }=0A= +=0A= return 0;=0A= }=0A= =0A= @@ -1025,6 +1098,8 @@=0A= return 0;=0A= DELAY(10);=0A= }=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_FATAL, "->%s timeout\n", = __func__);=0A= +=0A= return ETIMEDOUT;=0A= }=0A= =0A= @@ -1133,7 +1208,7 @@=0A= DELAY(10);=0A= }=0A= }=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end timeout\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_FATAL, "->%s end timeout\n", = __func__);=0A= return ETIMEDOUT;=0A= }=0A= =0A= @@ -1153,7 +1228,7 @@=0A= uint16_t prev, base, next;=0A= int count, error;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE| IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= /* Wait for clock stabilization before accessing prph. */=0A= if ((error =3D iwn_clock_wait(sc)) !=3D 0)=0A= @@ -1167,7 +1242,7 @@=0A= iwn_nic_unlock(sc);=0A= =0A= /* Set auto clock gate disable bit for HW with OTP shadow RAM. */=0A= - if (sc->hw_type !=3D IWN_HW_REV_TYPE_1000) {=0A= + if (sc->base_params->shadow_ram_support) {=0A= IWN_SETBITS(sc, IWN_DBG_LINK_PWR_MGMT,=0A= IWN_RESET_LINK_PWR_MGMT_DIS);=0A= }=0A= @@ -1180,11 +1255,11 @@=0A= * Find the block before last block (contains the EEPROM image)=0A= * for HW without OTP shadow RAM.=0A= */=0A= - if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_1000) {=0A= + if (!(sc->base_params->shadow_ram_support)) {=0A= /* Switch to absolute addressing mode. */=0A= IWN_CLRBITS(sc, IWN_OTP_GP, IWN_OTP_GP_RELATIVE_ACCESS);=0A= base =3D prev =3D 0;=0A= - for (count =3D 0; count < IWN1000_OTP_NBLOCKS; count++) {=0A= + for (count =3D 0; count < sc->base_params->max_ll_items; count++) {=0A= error =3D iwn_read_prom_data(sc, base, &next, 2);=0A= if (error !=3D 0)=0A= return error;=0A= @@ -1193,13 +1268,13 @@=0A= prev =3D base;=0A= base =3D le16toh(next);=0A= }=0A= - if (count =3D=3D 0 || count =3D=3D IWN1000_OTP_NBLOCKS)=0A= + if (count =3D=3D 0 || count =3D=3D sc->base_params->max_ll_items)=0A= return EIO;=0A= /* Skip "next" word. */=0A= sc->prom_base =3D prev + 1;=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= =0A= return 0;=0A= }=0A= @@ -1211,7 +1286,7 @@=0A= uint32_t val, tmp;=0A= int ntries;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= addr +=3D sc->prom_base;=0A= for (; count > 0; count -=3D 2, addr++) {=0A= @@ -1246,7 +1321,7 @@=0A= *out++ =3D val >> 24;=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= =0A= return 0;=0A= }=0A= @@ -1304,7 +1379,7 @@=0A= bus_dmamap_sync(dma->tag, dma->map,=0A= BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);=0A= bus_dmamap_unload(dma->tag, dma->map);=0A= - bus_dmamem_free(dma->tag, dma->vaddr, dma->map);=0A= + bus_dmamem_free(dma->tag, &dma->vaddr, dma->map);=0A= dma->vaddr =3D NULL;=0A= }=0A= bus_dmamap_destroy(dma->tag, dma->map);=0A= @@ -1378,7 +1453,7 @@=0A= =0A= ring->cur =3D 0;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= /* Allocate RX descriptors (256-byte aligned). */=0A= size =3D IWN_RX_RING_COUNT * sizeof (uint32_t);=0A= @@ -1428,7 +1503,7 @@=0A= goto fail;=0A= }=0A= =0A= - data->m =3D m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR,=0A= + data->m =3D m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR,=0A= IWN_RBUF_SIZE);=0A= if (data->m =3D=3D NULL) {=0A= device_printf(sc->sc_dev,=0A= @@ -1454,13 +1529,13 @@=0A= bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map,=0A= BUS_DMASYNC_PREWRITE);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s: end\n",__func__);=0A= =0A= return 0;=0A= =0A= fail: iwn_free_rx_ring(sc, ring);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s: end in = error\n",__func__);=0A= =0A= return error;=0A= }=0A= @@ -1470,7 +1545,7 @@=0A= {=0A= int ntries;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s\n", = __func__);=0A= =0A= if (iwn_nic_lock(sc) =3D=3D 0) {=0A= IWN_WRITE(sc, IWN_FH_RX_CONFIG, 0);=0A= @@ -1491,7 +1566,7 @@=0A= {=0A= int i;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s \n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s \n", = __func__);=0A= =0A= iwn_dma_contig_free(&ring->desc_dma);=0A= iwn_dma_contig_free(&ring->stat_dma);=0A= @@ -1526,7 +1601,7 @@=0A= ring->queued =3D 0;=0A= ring->cur =3D 0;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= /* Allocate TX descriptors (256-byte aligned). */=0A= size =3D IWN_TX_RING_COUNT * sizeof (struct iwn_tx_desc);=0A= @@ -1577,12 +1652,12 @@=0A= }=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= =0A= return 0;=0A= =0A= fail: iwn_free_tx_ring(sc, ring);=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end in error\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end in error\n", = __func__);=0A= return error;=0A= }=0A= =0A= @@ -1591,7 +1666,7 @@=0A= {=0A= int i;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->doing %s \n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->doing %s \n", = __func__);=0A= =0A= for (i =3D 0; i < IWN_TX_RING_COUNT; i++) {=0A= struct iwn_tx_data *data =3D &ring->data[i];=0A= @@ -1618,7 +1693,7 @@=0A= {=0A= int i;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s \n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s \n", = __func__);=0A= =0A= iwn_dma_contig_free(&ring->desc_dma);=0A= iwn_dma_contig_free(&ring->cmd_dma);=0A= @@ -1644,6 +1719,9 @@=0A= static void=0A= iwn5000_ict_reset(struct iwn_softc *sc)=0A= {=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= +=0A= /* Disable interrupts. */=0A= IWN_WRITE(sc, IWN_INT_MASK, 0);=0A= =0A= @@ -1664,6 +1742,9 @@=0A= /* Re-enable interrupts. */=0A= IWN_WRITE(sc, IWN_INT, 0xffffffff);=0A= IWN_WRITE(sc, IWN_INT_MASK, sc->int_mask);=0A= +=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= }=0A= =0A= static int=0A= @@ -1673,7 +1754,7 @@=0A= uint16_t val;=0A= int error;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= /* Check whether adapter has an EEPROM or an OTPROM. */=0A= if (sc->hw_type >=3D IWN_HW_REV_TYPE_1000 &&=0A= @@ -1733,7 +1814,7 @@=0A= =0A= iwn_eeprom_unlock(sc);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= =0A= return 0;=0A= }=0A= @@ -1829,12 +1910,11 @@=0A= {=0A= struct iwn5000_eeprom_calib_hdr hdr;=0A= int32_t volt;=0A= - uint32_t base, addr;=0A= + uint32_t base;=0A= uint16_t val;=0A= int i;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= -=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= /* Read regulatory domain (4 ASCII characters). */=0A= iwn_read_prom_data(sc, IWN5000_EEPROM_REG, &val, 2);=0A= base =3D le16toh(val);=0A= @@ -1842,16 +1922,12 @@=0A= sc->eeprom_domain, 4);=0A= =0A= /* Read the list of authorized channels (20MHz ones only). */=0A= - for (i =3D 0; i < 7; i++) {=0A= - if (sc->hw_type >=3D IWN_HW_REV_TYPE_6000)=0A= - addr =3D base + iwn6000_regulatory_bands[i];=0A= - else=0A= - addr =3D base + iwn5000_regulatory_bands[i];=0A= - iwn_read_eeprom_channels(sc, i, addr);=0A= + for (i =3D 0; i < (IWN_NBANDS - 1); i++) {=0A= + iwn_read_eeprom_channels(sc, i, = base+sc->base_params->regulatory_bands[i]);=0A= }=0A= =0A= /* Read enhanced TX power information for 6000 Series. */=0A= - if (sc->hw_type >=3D IWN_HW_REV_TYPE_6000)=0A= + if (sc->base_params->enhanced_TX_power)=0A= iwn_read_eeprom_enhinfo(sc);=0A= =0A= iwn_read_prom_data(sc, IWN5000_EEPROM_CAL, &val, 2);=0A= @@ -1862,6 +1938,14 @@=0A= hdr.version, hdr.pa_type, le16toh(hdr.volt));=0A= sc->calib_ver =3D hdr.version;=0A= =0A= + if (sc->base_params->calib_need & = IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSETv2) {=0A= + sc->eeprom_voltage =3D le16toh(hdr.volt);=0A= + iwn_read_prom_data(sc, base + IWN5000_EEPROM_TEMP, &val, 2);=0A= + sc->eeprom_temp_high=3Dle16toh(val);=0A= + iwn_read_prom_data(sc, base + IWN5000_EEPROM_VOLT, &val, 2);=0A= + sc->eeprom_temp =3D le16toh(val);=0A= + }=0A= +=0A= if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_5150) {=0A= /* Compute temperature offset. */=0A= iwn_read_prom_data(sc, base + IWN5000_EEPROM_TEMP, &val, 2);=0A= @@ -1878,9 +1962,8 @@=0A= DPRINTF(sc, IWN_DEBUG_CALIBRATE, "crystal calibration 0x%08x\n",=0A= le32toh(sc->eeprom_crystal));=0A= }=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= -=0A= }=0A= =0A= /*=0A= @@ -1916,7 +1999,7 @@=0A= uint8_t chan;=0A= int i, nflags;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= for (i =3D 0; i < band->nchan; i++) {=0A= if (!(channels[i].flags & IWN_EEPROM_CHAN_VALID)) {=0A= @@ -1961,7 +2044,7 @@=0A= }=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= =0A= }=0A= =0A= @@ -1978,8 +2061,8 @@=0A= =0A= DPRINTF(sc, IWN_DEBUG_TRACE, "->%s start\n", __func__);=0A= =0A= - if (!(sc->sc_flags & IWN_FLAG_HAS_11N)) {=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end no 11n\n", __func__);=0A= + if (!(sc->sc_flags & IWN_FLAG_HAS_11N)){=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end no 11n\n", = __func__);=0A= return;=0A= }=0A= =0A= @@ -2030,7 +2113,7 @@=0A= c->ic_flags |=3D IEEE80211_CHAN_HT40D | nflags;=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= =0A= }=0A= =0A= @@ -2115,7 +2198,7 @@=0A= uint8_t flags;=0A= int i, j;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= iwn_read_prom_data(sc, IWN5000_EEPROM_REG, &val, 2);=0A= base =3D le16toh(val);=0A= @@ -2168,7 +2251,7 @@=0A= }=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s end\n", __func__);=0A= =0A= }=0A= =0A= @@ -2316,8 +2399,7 @@=0A= struct iwn_softc *sc =3D ic->ic_ifp->if_softc;=0A= int error =3D 0;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= -=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_STATE, "->%s begin\n", = __func__);=0A= DPRINTF(sc, IWN_DEBUG_STATE, "%s: %s -> %s\n", __func__,=0A= ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate]);=0A= =0A= @@ -2325,6 +2407,8 @@=0A= IWN_LOCK(sc);=0A= callout_stop(&sc->calib_to);=0A= =0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A= +=0A= switch (nstate) {=0A= case IEEE80211_S_ASSOC:=0A= if (vap->iv_state !=3D IEEE80211_S_RUN)=0A= @@ -2338,8 +2422,8 @@=0A= * !AUTH -> AUTH transition requires state reset to handle=0A= * reassociations correctly.=0A= */=0A= - sc->rxon.associd =3D 0;=0A= - sc->rxon.filter &=3D ~htole32(IWN_FILTER_BSS);=0A= + sc->rxon->associd =3D 0;=0A= + sc->rxon->filter &=3D ~htole32(IWN_FILTER_BSS);=0A= sc->calib.state =3D IWN_CALIB_STATE_INIT;=0A= =0A= if ((error =3D iwn_auth(sc, vap)) !=3D 0) {=0A= @@ -2378,11 +2462,11 @@=0A= IWN_UNLOCK(sc);=0A= IEEE80211_LOCK(ic);=0A= if (error !=3D 0){=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end in error\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_STATE, "->%s end in error\n", = __func__);=0A= return error;=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_STATE, "->%s: end\n",__func__);=0A= =0A= return ivp->iv_newstate(vap, nstate, arg);=0A= }=0A= @@ -2396,12 +2480,7 @@=0A= =0A= /* Force automatic TX power calibration every 60 secs. */=0A= if (++sc->calib_cnt >=3D 120) {=0A= - uint32_t flags =3D 0;=0A= -=0A= - DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s\n",=0A= - "sending request for statistics");=0A= - (void)iwn_cmd(sc, IWN_CMD_GET_STATISTICS, &flags,=0A= - sizeof flags, 1);=0A= + iwn_set_statistics_request(sc,true,false,1);=0A= sc->calib_cnt =3D 0;=0A= }=0A= callout_reset(&sc->calib_to, msecs_to_ticks(500), iwn_calib_timeout,=0A= @@ -2447,7 +2526,7 @@=0A= uint32_t flags;=0A= int error, len, rssi, nf;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RECV, "->%s begin\n", = __func__);=0A= =0A= if (desc->type =3D=3D IWN_MPDU_RX_DONE) {=0A= /* Check for prior RX_PHY notification. */=0A= @@ -2494,7 +2573,7 @@=0A= return;=0A= }=0A= =0A= - m1 =3D m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, IWN_RBUF_SIZE);=0A= + m1 =3D m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, IWN_RBUF_SIZE);=0A= if (m1 =3D=3D NULL) {=0A= DPRINTF(sc, IWN_DEBUG_ANY, "%s: no mbuf to restock ring\n",=0A= __func__);=0A= @@ -2554,6 +2633,7 @@=0A= tap->wr_dbm_antsignal =3D (int8_t)rssi;=0A= tap->wr_dbm_antnoise =3D (int8_t)nf;=0A= tap->wr_tsft =3D stat->tstamp;=0A= + /* XXX rate contain also antenna information */=0A= switch (stat->rate) {=0A= /* CCK rates. */=0A= case 10: tap->wr_rate =3D 2; break;=0A= @@ -2570,9 +2650,13 @@=0A= case 0x1: tap->wr_rate =3D 96; break;=0A= case 0x3: tap->wr_rate =3D 108; break;=0A= /* Unknown rate: should not happen. */=0A= - default: tap->wr_rate =3D 0;=0A= + default:=0A= + tap->wr_rate =3D 0;=0A= + DPRINTF(sc, IWN_DEBUG_RECV,=0A= + "Rate found: 0x%08x and not translated\n", stat->rate);=0A= }=0A= }=0A= + DPRINTF(sc, IWN_DEBUG_RECV, "Tstmp : %lu\n",stat->tstamp);=0A= =0A= IWN_UNLOCK(sc);=0A= =0A= @@ -2588,7 +2672,7 @@=0A= =0A= IWN_LOCK(sc);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RECV, "->%s: end\n",__func__);=0A= =0A= }=0A= =0A= @@ -2611,7 +2695,7 @@=0A= uint8_t tid;=0A= int ackfailcnt =3D 0, i, lastidx, qid, *res, shift;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RECV, "->%s begin\n", = __func__);=0A= =0A= bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD);=0A= =0A= @@ -2685,7 +2769,7 @@=0A= bitmap >>=3D 1;=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RECV, "->%s: end\n",__func__);=0A= =0A= }=0A= =0A= @@ -2700,11 +2784,10 @@=0A= struct iwn_phy_calib *calib =3D (struct iwn_phy_calib *)(desc + 1);=0A= int len, idx =3D -1;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= -=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s begin\n", = __func__);=0A= /* Runtime firmware should not send such a notification. */=0A= if (sc->sc_flags & IWN_FLAG_CALIB_DONE){=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s received after clib done\n",=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s received = after clib done\n",=0A= __func__);=0A= return;=0A= }=0A= @@ -2713,29 +2796,30 @@=0A= =0A= switch (calib->code) {=0A= case IWN5000_PHY_CALIB_DC:=0A= - if ((sc->sc_flags & IWN_FLAG_INTERNAL_PA) =3D=3D 0 &&=0A= - (sc->hw_type =3D=3D IWN_HW_REV_TYPE_5150 ||=0A= - sc->hw_type >=3D IWN_HW_REV_TYPE_6000) &&=0A= - sc->hw_type !=3D IWN_HW_REV_TYPE_6050)=0A= + if (sc->base_params->calib_need & IWN_FLG_NEED_PHY_CALIB_DC)=0A= idx =3D 0;=0A= break;=0A= case IWN5000_PHY_CALIB_LO:=0A= - idx =3D 1;=0A= + if (sc->base_params->calib_need & IWN_FLG_NEED_PHY_CALIB_LO)=0A= + idx =3D 1;=0A= break;=0A= case IWN5000_PHY_CALIB_TX_IQ:=0A= - idx =3D 2;=0A= + if (sc->base_params->calib_need & IWN_FLG_NEED_PHY_CALIB_TX_IQ)=0A= + idx =3D 2;=0A= break;=0A= case IWN5000_PHY_CALIB_TX_IQ_PERIODIC:=0A= - if (sc->hw_type < IWN_HW_REV_TYPE_6000 &&=0A= - sc->hw_type !=3D IWN_HW_REV_TYPE_5150)=0A= + if (sc->base_params->calib_need & = IWN_FLG_NEED_PHY_CALIB_TX_IQ_PERIODIC)=0A= idx =3D 3;=0A= break;=0A= case IWN5000_PHY_CALIB_BASE_BAND:=0A= - idx =3D 4;=0A= + if (sc->base_params->calib_need & IWN_FLG_NEED_PHY_CALIB_BASE_BAND)=0A= + idx =3D 4;=0A= break;=0A= }=0A= - if (idx =3D=3D -1) /* Ignore other results. */=0A= + if (idx =3D=3D -1) { /* Ignore other results. */=0A= + DPRINTF(sc,IWN_DEBUG_CALIBRATE,"Ignoring calib result = %d",calib->code);=0A= return;=0A= + }=0A= =0A= /* Save calibration result. */=0A= if (sc->calibcmd[idx].buf !=3D NULL)=0A= @@ -2751,6 +2835,7 @@=0A= "saving calibration result code=3D%d len=3D%d\n", calib->code, = len);=0A= sc->calibcmd[idx].len =3D len;=0A= memcpy(sc->calibcmd[idx].buf, calib, len);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s end\n", = __func__);=0A= }=0A= =0A= /*=0A= @@ -2767,18 +2852,59 @@=0A= struct ieee80211vap *vap =3D TAILQ_FIRST(&ic->ic_vaps);=0A= struct iwn_calib_state *calib =3D &sc->calib;=0A= struct iwn_stats *stats =3D (struct iwn_stats *)(desc + 1);=0A= + struct ieee80211_node *ni =3D vap->iv_bss;=0A= + struct ieee80211_nodestats ns =3D ni->ni_stats;=0A= + struct bintime bt;=0A= +=0A= + struct ieee80211vap *vap1;=0A= +=0A= int temp;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s begin\n", = __func__);=0A= =0A= /* Ignore statistics received during a scan. */=0A= if (vap->iv_state !=3D IEEE80211_S_RUN ||=0A= (ic->ic_flags & IEEE80211_F_SCAN)){=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s received during calib\n",=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s received = during calib\n",=0A= __func__);=0A= return;=0A= }=0A= + if(sc->ctx =3D=3D IWN_RXON_PAN_CTX) {=0A= + vap1 =3D sc->ivap[IWN_RXON_PAN_CTX];=0A= + /* Ignore statistics received during a scan. */=0A= + if (vap1->iv_state !=3D IEEE80211_S_RUN ||=0A= + (ic->ic_flags & IEEE80211_F_SCAN))=0A= + return;=0A= + }=0A= =0A= + getbinuptime(&bt);=0A= + sc->sc_led.led_cur_time =3D bt.sec;=0A= + int time_diff =3D (sc->sc_led.led_cur_time - sc->sc_led.led_last_time);=0A= +=0A= + if(time_diff >=3D 4) {=0A= + if(vap->iv_state =3D=3D IEEE80211_S_RUN) {=0A= + sc->sc_led.led_cur_bt =3D (ns.ns_rx_bytes + ns.ns_tx_bytes);=0A= + if(sc->sc_led.led_cur_bt < sc->sc_led.led_last_bt) {=0A= + sc->sc_led.led_cur_bt =3D 0;=0A= + sc->sc_led.led_last_bt =3D 0;=0A= + }=0A= + sc->sc_led.led_bt_diff =3D (sc->sc_led.led_cur_bt - = sc->sc_led.led_last_bt);=0A= + sc->sc_led.led_last_bt =3D sc->sc_led.led_cur_bt;=0A= + sc->sc_led.led_cur_tpt =3D (sc->sc_led.led_bt_diff / time_diff);=0A= + sc->sc_led.led_last_time =3D sc->sc_led.led_cur_time;=0A= +=0A= + if(sc->sc_led.led_cur_tpt > 0) {=0A= + sc->sc_led.led_cur_mode =3D IWN_LED_INT_BLINK;=0A= + iwn_led_pattern(sc);=0A= + } else {=0A= + sc->sc_led.led_cur_mode =3D IWN_LED_STATIC_ON;=0A= + iwn_set_led(sc, IWN_LED_LINK, 0, 1, IWN_LED_STATIC_ON);=0A= + }=0A= +=0A= + sc->sc_led.led_last_tpt =3D sc->sc_led.led_cur_tpt;=0A= + }=0A= + }=0A= +=0A= bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD);=0A= =0A= DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: received statistics, cmd %d\n",=0A= @@ -2816,7 +2942,7 @@=0A= else if (calib->state =3D=3D IWN_CALIB_STATE_RUN)=0A= iwn_tune_sensitivity(sc, &stats->rx);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s: = end\n",__func__);=0A= }=0A= =0A= /*=0A= @@ -2858,7 +2984,7 @@=0A= struct iwn_tx_ring *ring;=0A= int qid;=0A= =0A= - qid =3D desc->qid & 0xf;=0A= + qid =3D desc->qid & IWN_RX_DESC_QID_MSK;=0A= ring =3D &sc->txq[qid];=0A= =0A= DPRINTF(sc, IWN_DEBUG_XMIT, "%s: "=0A= @@ -2865,11 +2991,11 @@=0A= "qid %d idx %d retries %d nkill %d rate %x duration %d status = %x\n",=0A= __func__, desc->qid, desc->idx, stat->ackfailcnt,=0A= stat->btkillcnt, stat->rate, le16toh(stat->duration),=0A= - le32toh(stat->status));=0A= -=0A= + le16toh(stat->status) & IWN_TX_STATUS_MSK);=0A= + DPRINTF(sc, IWN_DEBUG_XMIT, "%s: Agg : %d\n", __func__, stat->nframes);=0A= #ifdef notyet=0A= /* Reset TX scheduler slot. */=0A= - iwn5000_reset_sched(sc, desc->qid & 0xf, desc->idx);=0A= + iwn5000_reset_sched(sc, desc->qid & IWN_RX_DESC_QID_MSK, desc->idx);=0A= #endif=0A= =0A= bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD);=0A= @@ -2878,7 +3004,7 @@=0A= &stat->status);=0A= } else {=0A= iwn_tx_done(sc, desc, stat->ackfailcnt,=0A= - le16toh(stat->status) & 0xff);=0A= + le16toh(stat->status) & IWN_TX_STATUS_MSK);=0A= }=0A= }=0A= =0A= @@ -2890,15 +3016,20 @@=0A= uint8_t status)=0A= {=0A= struct ifnet *ifp =3D sc->sc_ifp;=0A= - struct iwn_tx_ring *ring =3D &sc->txq[desc->qid & 0xf];=0A= + struct iwn_tx_ring *ring =3D &sc->txq[desc->qid & IWN_RX_DESC_QID_MSK];=0A= struct iwn_tx_data *data =3D &ring->data[desc->idx];=0A= +=0A= + struct iwn_tx_cmd *cmd;=0A= + struct iwn_cmd_data *tx;=0A= +=0A= struct mbuf *m;=0A= struct ieee80211_node *ni;=0A= struct ieee80211vap *vap;=0A= + struct ieee80211_frame *wh;=0A= =0A= KASSERT(data->ni !=3D NULL, ("no node"));=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s begin\n", = __func__);=0A= =0A= /* Unmap and free mbuf. */=0A= bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTWRITE);=0A= @@ -2905,9 +3036,19 @@=0A= bus_dmamap_unload(ring->data_dmat, data->map);=0A= m =3D data->m, data->m =3D NULL;=0A= ni =3D data->ni, data->ni =3D NULL;=0A= + uint8_t type;=0A= vap =3D ni->ni_vap;=0A= =0A= + cmd =3D &ring->cmd[desc->idx];=0A= + tx =3D (struct iwn_cmd_data *)cmd->data;=0A= + wh =3D (struct ieee80211_frame *)(tx + 1);=0A= +=0A= + type =3D wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK;=0A= +=0A= +=0A= +=0A= if (m->m_flags & M_TXCB) {=0A= + DPRINTF(sc, IWN_DEBUG_XMIT, "%s: M_TXCB found\n",__func__);=0A= /*=0A= * Channels marked for "radar" require traffic to be received=0A= * to unlock before we can transmit. Until traffic is seen=0A= @@ -2934,10 +3075,14 @@=0A= * Update rate control statistics for the node.=0A= */=0A= if (status & IWN_TX_FAIL) {=0A= + DPRINTF(sc, IWN_DEBUG_XMIT, "%s: Status failed ackcnt: %d\n",=0A= + __func__, ackfailcnt);=0A= ifp->if_oerrors++;=0A= ieee80211_ratectl_tx_complete(vap, ni,=0A= IEEE80211_RATECTL_TX_FAILURE, &ackfailcnt, NULL);=0A= } else {=0A= + DPRINTF(sc, IWN_DEBUG_XMIT, "%s: Status OK ackcnt: %d\n",=0A= + __func__, ackfailcnt);=0A= ifp->if_opackets++;=0A= ieee80211_ratectl_tx_complete(vap, ni,=0A= IEEE80211_RATECTL_TX_SUCCESS, &ackfailcnt, NULL);=0A= @@ -2955,7 +3100,7 @@=0A= }=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s: end\n",__func__);=0A= =0A= }=0A= =0A= @@ -2966,12 +3111,24 @@=0A= static void=0A= iwn_cmd_done(struct iwn_softc *sc, struct iwn_rx_desc *desc)=0A= {=0A= - struct iwn_tx_ring *ring =3D &sc->txq[4];=0A= + struct iwn_tx_ring *ring;=0A= struct iwn_tx_data *data;=0A= + int cmd_queue_num;=0A= =0A= - if ((desc->qid & 0xf) !=3D 4)=0A= + if(sc->sc_flags & IWN_FLAG_PAN_SUPPORT)=0A= + cmd_queue_num =3D IWN_PAN_CMD_QUEUE;=0A= + else=0A= + cmd_queue_num =3D IWN_CMD_QUEUE_NUM;=0A= +=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_CMD, "%s: qid: %d PAN Active : %d\n",=0A= + __func__, (desc->qid & IWN_RX_DESC_QID_MSK),(sc->sc_flags & = IWN_FLAG_PAN_SUPPORT) );=0A= +=0A= +=0A= + if ((desc->qid & IWN_RX_DESC_QID_MSK) !=3D cmd_queue_num)=0A= return; /* Not a command ack. */=0A= =0A= + ring =3D &sc->txq[cmd_queue_num];=0A= data =3D &ring->data[desc->idx];=0A= =0A= /* If the command was mapped in an mbuf, free it. */=0A= @@ -3004,7 +3161,7 @@=0A= uint8_t tid;=0A= int bit, i, lastidx, *res, seqno, shift, start;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s begin\n", = __func__);=0A= =0A= #ifdef NOT_YET=0A= if (nframes =3D=3D 1) {=0A= @@ -3093,7 +3250,7 @@=0A= }=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s: end\n",__func__);=0A= =0A= }=0A= =0A= @@ -3106,7 +3263,9 @@=0A= struct iwn_ops *ops =3D &sc->ops;=0A= struct ifnet *ifp =3D sc->sc_ifp;=0A= struct ieee80211com *ic =3D ifp->if_l2com;=0A= - struct ieee80211vap *vap =3D TAILQ_FIRST(&ic->ic_vaps);=0A= + struct ieee80211_scan_state *ss =3D ic->ic_scan;=0A= + struct ieee80211vap *vapscan =3D ss->ss_vap;=0A= +=0A= uint16_t hw;=0A= =0A= bus_dmamap_sync(sc->rxq.stat_dma.tag, sc->rxq.stat_dma.map,=0A= @@ -3123,11 +3282,13 @@=0A= =0A= DPRINTF(sc, IWN_DEBUG_RECV,=0A= "%s: qid %x idx %d flags %x type %d(%s) len %d\n",=0A= - __func__, desc->qid & 0xf, desc->idx, desc->flags,=0A= + __func__, desc->qid & IWN_RX_DESC_QID_MSK, desc->idx, desc->flags,=0A= desc->type, iwn_intr_str(desc->type),=0A= le16toh(desc->len));=0A= -=0A= - if (!(desc->qid & 0x80)) /* Reply to a command. */=0A= + if (le16toh(desc->len) =3D=3D 8)=0A= + DPRINTF(sc, IWN_DEBUG_RECV, "%s: strange inter values: 0x%08x\n",=0A= + __func__,le32toh(desc->len));=0A= + if (!(desc->qid & IWN_UNSOLICITED_RX_NOTIF)) /* Reply to a command. */=0A= iwn_cmd_done(sc, desc);=0A= =0A= switch (desc->type) {=0A= @@ -3161,23 +3322,42 @@=0A= struct iwn_beacon_missed *miss =3D=0A= (struct iwn_beacon_missed *)(desc + 1);=0A= int misses;=0A= + int iv_bmissthreshold;=0A= + int DoReinit =3D0 ;=0A= + struct ieee80211vap *vap0 =3D sc->ivap[IWN_RXON_BSS_CTX];=0A= + struct ieee80211vap *vap1 =3D sc->ivap[IWN_RXON_PAN_CTX];=0A= =0A= +=0A= bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= BUS_DMASYNC_POSTREAD);=0A= misses =3D le32toh(miss->consecutive);=0A= =0A= DPRINTF(sc, IWN_DEBUG_STATE,=0A= - "%s: beacons missed %d/%d\n", __func__,=0A= - misses, le32toh(miss->total));=0A= + "%s: beacons missed %d/%d rcv %d expect %d\n", __func__,=0A= + misses, le32toh(miss->total), le32toh(miss->received),=0A= + le32toh(miss->expected));=0A= +=0A= + iv_bmissthreshold =3D vap0->iv_bmissthreshold;=0A= +=0A= + if(sc->ctx =3D=3D IWN_RXON_PAN_CTX) {=0A= + iv_bmissthreshold =3D vap1->iv_bmissthreshold;=0A= + if (vap0->iv_state =3D=3D IEEE80211_S_RUN &&=0A= + vap1->iv_state =3D=3D IEEE80211_S_RUN &&=0A= + (ic->ic_flags & IEEE80211_F_SCAN) =3D=3D 0)=0A= + DoReinit =3D 1;=0A= + }=0A= + else if (vap0->iv_state =3D=3D IEEE80211_S_RUN &&=0A= + (ic->ic_flags & IEEE80211_F_SCAN) =3D=3D 0)=0A= + DoReinit =3D 1;=0A= +=0A= /*=0A= * If more than 5 consecutive beacons are missed,=0A= * reinitialize the sensitivity state machine.=0A= */=0A= - if (vap->iv_state =3D=3D IEEE80211_S_RUN &&=0A= - (ic->ic_flags & IEEE80211_F_SCAN) =3D=3D 0) {=0A= + if (DoReinit=3D=3D1) {=0A= if (misses > 5)=0A= (void)iwn_init_sensitivity(sc);=0A= - if (misses >=3D vap->iv_bmissthreshold) {=0A= + if (misses >=3D iv_bmissthreshold) {=0A= IWN_UNLOCK(sc);=0A= ieee80211_beacon_miss(ic);=0A= IWN_LOCK(sc);=0A= @@ -3187,6 +3367,13 @@=0A= }=0A= case IWN_UC_READY:=0A= {=0A= +/**=0A= + * uCode issues this "alive" notification once the runtime image is = ready=0A= + * to receive commands from the driver. This is the *second* "alive"=0A= + * notification that the driver will receive after rebooting uCode;=0A= + * this "alive" is indicated by subtype field !=3D 9.=0A= + *=0A= + **/=0A= struct iwn_ucode_info *uc =3D=0A= (struct iwn_ucode_info *)(desc + 1);=0A= =0A= @@ -3213,6 +3400,8 @@=0A= }=0A= case IWN_STATE_CHANGED:=0A= {=0A= + uint32_t *status =3D (uint32_t *)(desc + 1);=0A= +=0A= /*=0A= * State change allows hardware switch change to be=0A= * noted. However, we handle this in iwn_intr as we=0A= @@ -3219,12 +3408,33 @@=0A= * get both the enable/disble intr.=0A= */=0A= bus_dmamap_sync(sc->rxq.data_dmat, data->map,=0A= - BUS_DMASYNC_POSTREAD);=0A= -#ifdef IWN_DEBUG=0A= - uint32_t *status =3D (uint32_t *)(desc + 1);=0A= - DPRINTF(sc, IWN_DEBUG_INTR, "state changed to %x\n",=0A= + BUS_DMASYNC_POSTREAD);=0A= + if (*status & (IWN_STATE_CHANGE_HW_CARD_DISABLED | = IWN_STATE_CHANGE_CT_CARD_DISABLED |IWN_STATE_CHANGE_SW_CARD_DISABLED)){=0A= + IWN_WRITE(sc, IWN_UCODE_GP1_SET, IWN_UCODE_GP1_CMD_BLOCKED);=0A= + IWN_WRITE(sc,IWN_TARG_MBX_C, 0x00000004);=0A= +=0A= + if (!(*status & IWN_STATE_CHANGE_RXON_CARD_DISABLED)) {=0A= + IWN_WRITE(sc, IWN_UCODE_GP1_CLR, IWN_UCODE_GP1_CMD_BLOCKED);=0A= + IWN_WRITE(sc, IWN_TARG_MBX_C, 0x00000004);=0A= + }=0A= +=0A= + if(*status & IWN_STATE_CHANGE_CT_CARD_DISABLED) {=0A= + device_printf(sc->sc_dev,"critical temp. reached\n");=0A= + /* XXX: enter CT kill */=0A= + }=0A= + }=0A= + if(!(*status & IWN_STATE_CHANGE_CT_CARD_DISABLED)){=0A= + callout_stop(&sc->ct_kill_exit_to);=0A= + /* XXX: exit CT kill */=0A= + }=0A= + /*=0A= + * State change allows hardware switch change to be=0A= + * noted. However, we handle this in iwn_intr as we=0A= + * get both the enable/disble intr.=0A= + */=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_INTR, "state changed to %x\n",=0A= le32toh(*status));=0A= -#endif=0A= break;=0A= }=0A= case IWN_START_SCAN:=0A= @@ -3253,7 +3463,7 @@=0A= #endif=0A= =0A= IWN_UNLOCK(sc);=0A= - ieee80211_scan_next(vap);=0A= + ieee80211_scan_next(vapscan);=0A= IWN_LOCK(sc);=0A= break;=0A= }=0A= @@ -3265,6 +3475,9 @@=0A= sc->sc_flags |=3D IWN_FLAG_CALIB_DONE;=0A= wakeup(sc);=0A= break;=0A= + default:=0A= + DPRINTF(sc,IWN_DEBUG_INTR,"Interrupt type %d not managed\n",=0A= + desc->type);=0A= }=0A= =0A= sc->rxq.cur =3D (sc->rxq.cur + 1) % IWN_RX_RING_COUNT;=0A= @@ -3323,6 +3536,7 @@=0A= struct iwn_fw_dump dump;=0A= int i;=0A= =0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= IWN_LOCK_ASSERT(sc);=0A= =0A= /* Force a complete recalibration on next init. */=0A= @@ -3372,6 +3586,7 @@=0A= i, ring->qid, ring->cur, ring->queued);=0A= }=0A= printf(" rx ring: cur=3D%d\n", sc->rxq.cur);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= }=0A= =0A= static void=0A= @@ -3408,8 +3623,6 @@=0A= r2 =3D IWN_READ(sc, IWN_FH_INT);=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_INTR, "interrupt reg1=3D0x%08x reg2=3D0x%08x\n"=0A= - , r1, r2);=0A= =0A= if (r1 =3D=3D 0 && r2 =3D=3D 0)=0A= goto done; /* Interrupt not for us. */=0A= @@ -3419,6 +3632,9 @@=0A= if (!(sc->sc_flags & IWN_FLAG_USE_ICT))=0A= IWN_WRITE(sc, IWN_FH_INT, r2);=0A= =0A= +=0A= + DPRINTF(sc, IWN_DEBUG_INTR, "Acked interupt reg1=3D0x%08x = reg2=3D0x%08x\n", r1, r2);=0A= +=0A= if (r1 & IWN_INT_RF_TOGGLED) {=0A= iwn_rftoggle_intr(sc);=0A= goto done;=0A= @@ -3521,7 +3737,7 @@=0A= {=0A= uint16_t *w =3D &sc->sched[qid * IWN5000_SCHED_COUNT + idx];=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s\n", = __func__);=0A= =0A= *w =3D (*w & htole16(0xf000)) | htole16(1);=0A= bus_dmamap_sync(sc->sched_dma.tag, sc->sched_dma.map,=0A= @@ -3556,8 +3772,9 @@=0A= bus_dma_segment_t *seg, segs[IWN_MAX_SCATTER];=0A= uint8_t tid, ridx, txant, type;=0A= int ac, i, totlen, error, pad, nsegs =3D 0, rate;=0A= + struct iwn_vap *ivp =3D IWN_VAP(vap);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s begin\n", = __func__);=0A= =0A= IWN_LOCK_ASSERT(sc);=0A= =0A= @@ -3573,21 +3790,24 @@=0A= qos =3D 0;=0A= tid =3D 0;=0A= }=0A= - ac =3D M_WME_GETAC(m);=0A= - if (m->m_flags & M_AMPDU_MPDU) {=0A= +=0A= + if(ivp->ctx =3D=3D IWN_RXON_PAN_CTX)=0A= + ac =3D iwn_pan_ac_to_queue[M_WME_GETAC(m)];=0A= + else=0A= + ac =3D iwn_bss_ac_to_queue[M_WME_GETAC(m)];=0A= +=0A= +=0A= + if (IEEE80211_QOS_HAS_SEQ(wh) &&=0A= + IEEE80211_AMPDU_RUNNING(&ni->ni_tx_ampdu[ac])) {=0A= struct ieee80211_tx_ampdu *tap =3D &ni->ni_tx_ampdu[ac];=0A= =0A= - if (!IEEE80211_AMPDU_RUNNING(tap)) {=0A= - m_freem(m);=0A= - return EINVAL;=0A= - }=0A= -=0A= - ac =3D *(int *)tap->txa_private;=0A= + ring =3D &sc->txq[*(int *)tap->txa_private];=0A= *(uint16_t *)wh->i_seq =3D=0A= htole16(ni->ni_txseqs[tid] << IEEE80211_SEQ_SEQ_SHIFT);=0A= ni->ni_txseqs[tid]++;=0A= - }=0A= - ring =3D &sc->txq[ac];=0A= + } else=0A= + ring =3D &sc->txq[ac];=0A= +=0A= desc =3D &ring->desc[ring->cur];=0A= data =3D &ring->data[ring->cur];=0A= =0A= @@ -3679,10 +3899,12 @@=0A= }=0A= }=0A= =0A= - if (IEEE80211_IS_MULTICAST(wh->i_addr1) ||=0A= - type !=3D IEEE80211_FC0_TYPE_DATA)=0A= - tx->id =3D sc->broadcast_id;=0A= - else=0A= + if (IEEE80211_IS_MULTICAST(wh->i_addr1) || type !=3D = IEEE80211_FC0_TYPE_DATA) {=0A= + if(ivp->ctx =3D=3D IWN_RXON_PAN_CTX)=0A= + tx->id =3D IWN_PAN_ID_BCAST;=0A= + else=0A= + tx->id =3D IWN5000_ID_BROADCAST;=0A= + } else=0A= tx->id =3D wn->id;=0A= =0A= if (type =3D=3D IEEE80211_FC0_TYPE_MGT) {=0A= @@ -3712,7 +3934,7 @@=0A= tx->data_ntries =3D 15;=0A= tx->lifetime =3D htole32(IWN_LIFETIME_INFINITE);=0A= tx->rate =3D iwn_rate_to_plcp(sc, ni, rate);=0A= - if (tx->id =3D=3D sc->broadcast_id) {=0A= + if ((tx->id =3D=3D IWN_PAN_ID_BCAST) || (tx->id =3D=3D = IWN5000_ID_BROADCAST)) {=0A= /* Group or management frame. */=0A= tx->linkq =3D 0;=0A= /* XXX Alternate between antenna A and B? */=0A= @@ -3744,7 +3966,7 @@=0A= return error;=0A= }=0A= /* Too many DMA segments, linearize mbuf. */=0A= - m1 =3D m_collapse(m, M_NOWAIT, IWN_MAX_SCATTER);=0A= + m1 =3D m_collapse(m, M_DONTWAIT, IWN_MAX_SCATTER);=0A= if (m1 =3D=3D NULL) {=0A= device_printf(sc->sc_dev,=0A= "%s: could not defrag mbuf\n", __func__);=0A= @@ -3803,9 +4025,8 @@=0A= /* Mark TX ring as full if we reach a certain threshold. */=0A= if (++ring->queued > IWN_TX_RING_HIMARK)=0A= sc->qfullmsk |=3D 1 << ring->qid;=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s: end\n",__func__);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= -=0A= return 0;=0A= }=0A= =0A= @@ -3829,9 +4050,9 @@=0A= u_int hdrlen;=0A= int ac, totlen, error, pad, nsegs =3D 0, i, rate;=0A= uint8_t ridx, type, txant;=0A= + struct iwn_vap *ivp =3D IWN_VAP(vap);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s begin\n", = __func__);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= -=0A= IWN_LOCK_ASSERT(sc);=0A= =0A= wh =3D mtod(m, struct ieee80211_frame *);=0A= @@ -3919,7 +4140,10 @@=0A= =0A= tx->len =3D htole16(totlen);=0A= tx->tid =3D 0;=0A= - tx->id =3D sc->broadcast_id;=0A= + if(ivp->ctx =3D=3D IWN_RXON_PAN_CTX)=0A= + tx->id =3D IWN_PAN_ID_BCAST;=0A= + else=0A= + tx->id =3D IWN5000_ID_BROADCAST;=0A= tx->rts_ntries =3D params->ibp_try1;=0A= tx->data_ntries =3D params->ibp_try0;=0A= tx->lifetime =3D htole32(IWN_LIFETIME_INFINITE);=0A= @@ -3957,7 +4181,7 @@=0A= return error;=0A= }=0A= /* Too many DMA segments, linearize mbuf. */=0A= - m1 =3D m_collapse(m, M_NOWAIT, IWN_MAX_SCATTER);=0A= + m1 =3D m_collapse(m, M_DONTWAIT, IWN_MAX_SCATTER);=0A= if (m1 =3D=3D NULL) {=0A= device_printf(sc->sc_dev,=0A= "%s: could not defrag mbuf\n", __func__);=0A= @@ -4017,7 +4241,7 @@=0A= if (++ring->queued > IWN_TX_RING_HIMARK)=0A= sc->qfullmsk |=3D 1 << ring->qid;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s: end\n",__func__);=0A= =0A= return 0;=0A= }=0A= @@ -4031,7 +4255,7 @@=0A= struct iwn_softc *sc =3D ifp->if_softc;=0A= int error =3D 0;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s begin\n", = __func__);=0A= =0A= if ((ifp->if_drv_flags & IFF_DRV_RUNNING) =3D=3D 0) {=0A= ieee80211_free_node(ni);=0A= @@ -4062,7 +4286,7 @@=0A= =0A= IWN_UNLOCK(sc);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_XMIT, "->%s: end\n",__func__);=0A= =0A= return error;=0A= }=0A= @@ -4114,12 +4338,15 @@=0A= struct iwn_softc *sc =3D arg;=0A= struct ifnet *ifp =3D sc->sc_ifp;=0A= struct ieee80211com *ic =3D ifp->if_l2com;=0A= + struct ieee80211_scan_state *ss =3D ic->ic_scan;=0A= + struct ieee80211vap *vapscan =3D ss->ss_vap;=0A= =0A= +=0A= IWN_LOCK_ASSERT(sc);=0A= =0A= KASSERT(ifp->if_drv_flags & IFF_DRV_RUNNING, ("not running"));=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s\n", = __func__);=0A= =0A= if (sc->sc_tx_timer > 0) {=0A= if (--sc->sc_tx_timer =3D=3D 0) {=0A= @@ -4128,6 +4355,12 @@=0A= return;=0A= }=0A= }=0A= +=0A= + if (sc->sc_scan_timer > 0) {=0A= + if (--sc->sc_scan_timer =3D=3D 0)=0A= + ieee80211_scan_next(vapscan);=0A= + }=0A= +=0A= callout_reset(&sc->watchdog_to, hz, iwn_watchdog, sc);=0A= }=0A= =0A= @@ -4180,7 +4413,7 @@=0A= static int=0A= iwn_cmd(struct iwn_softc *sc, int code, const void *buf, int size, int = async)=0A= {=0A= - struct iwn_tx_ring *ring =3D &sc->txq[4];=0A= + struct iwn_tx_ring *ring;=0A= struct iwn_tx_desc *desc;=0A= struct iwn_tx_data *data;=0A= struct iwn_tx_cmd *cmd;=0A= @@ -4187,12 +4420,25 @@=0A= struct mbuf *m;=0A= bus_addr_t paddr;=0A= int totlen, error;=0A= + int cmd_queue_num;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + if((sc->uc_scan_progress =3D=3D 1) && (code !=3D IWN_CMD_SCAN)) {=0A= + DPRINTF(sc,IWN_DEBUG_CMD,"Scanning in progress..not sending cmd = %x.\n",code);=0A= + return 0;=0A= + }=0A= =0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CMD, "->%s begin\n", __func__);=0A= +=0A= if (async =3D=3D 0)=0A= IWN_LOCK_ASSERT(sc);=0A= =0A= + if(sc->sc_flags & IWN_FLAG_PAN_SUPPORT)=0A= + cmd_queue_num =3D IWN_PAN_CMD_QUEUE;=0A= + else=0A= + cmd_queue_num =3D IWN_CMD_QUEUE_NUM;=0A= +=0A= + ring =3D &sc->txq[cmd_queue_num];=0A= +=0A= desc =3D &ring->desc[ring->cur];=0A= data =3D &ring->data[ring->cur];=0A= totlen =3D 4 + size;=0A= @@ -4201,7 +4447,7 @@=0A= /* Command is too large to fit in a descriptor. */=0A= if (totlen > MCLBYTES)=0A= return EINVAL;=0A= - m =3D m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE);=0A= + m =3D m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, MJUMPAGESIZE);=0A= if (m =3D=3D NULL)=0A= return ENOMEM;=0A= cmd =3D mtod(m, struct iwn_tx_cmd *);=0A= @@ -4227,8 +4473,8 @@=0A= desc->segs[0].addr =3D htole32(IWN_LOADDR(paddr));=0A= desc->segs[0].len =3D htole16(IWN_HIADDR(paddr) | totlen << 4);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_CMD, "%s: %s (0x%x) flags %d qid %d idx %d\n",=0A= - __func__, iwn_intr_str(cmd->code), cmd->code,=0A= + DPRINTF(sc, IWN_DEBUG_CMD, "Sending %s (0x%x) flags %d qid %d idx = %d\n",=0A= + iwn_intr_str(cmd->code), cmd->code,=0A= cmd->flags, cmd->qid, cmd->idx);=0A= =0A= if (size > sizeof cmd->data) {=0A= @@ -4245,7 +4491,7 @@=0A= ring->cur =3D (ring->cur + 1) % IWN_TX_RING_COUNT;=0A= IWN_WRITE(sc, IWN_HBUS_TARG_WRPTR, ring->qid << 8 | ring->cur);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CMD, "->%s: end\n",__func__);=0A= =0A= return async ? 0 : msleep(desc, &sc->sc_mtx, PCATCH, "iwncmd", hz);=0A= }=0A= @@ -4276,7 +4522,14 @@=0A= {=0A= =0A= DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= -=0A= + if (node->control =3D=3D 0)=0A= + DPRINTF(sc, IWN_DEBUG_NODE,=0A= + "Adding node id : %d MAC : %6D flags: 0x%x\n", node->id,=0A= + node->macaddr,":", node->flags);=0A= + else=0A= + DPRINTF(sc, IWN_DEBUG_NODE,=0A= + "Updating node id : %d MAC : %6D flags: 0x%x\n", node->id,=0A= + node->macaddr,":", node->flags);=0A= /* Direct mapping. */=0A= return iwn_cmd(sc, IWN_CMD_ADD_NODE, node, sizeof (*node), async);=0A= }=0A= @@ -4351,11 +4604,13 @@=0A= uint8_t txant;=0A= int i, error;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s: = begin\n",__func__);=0A= =0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A= +=0A= memset(&node, 0, sizeof node);=0A= IEEE80211_ADDR_COPY(node.macaddr, ifp->if_broadcastaddr);=0A= - node.id =3D sc->broadcast_id;=0A= + node.id =3D IWN5000_ID_BROADCAST;=0A= DPRINTF(sc, IWN_DEBUG_RESET, "%s: adding broadcast node\n", __func__);=0A= if ((error =3D ops->add_node(sc, &node, async)) !=3D 0)=0A= return error;=0A= @@ -4364,7 +4619,7 @@=0A= txant =3D IWN_LSB(sc->txchainmask);=0A= =0A= memset(&linkq, 0, sizeof linkq);=0A= - linkq.id =3D sc->broadcast_id;=0A= + linkq.id =3D IWN5000_ID_BROADCAST;=0A= linkq.antmsk_1stream =3D txant;=0A= linkq.antmsk_2stream =3D IWN_ANT_AB;=0A= linkq.ampdu_max =3D 64;=0A= @@ -4382,7 +4637,7 @@=0A= linkq.retry[i] =3D linkq.retry[0];=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s: end\n",__func__);=0A= =0A= return iwn_cmd(sc, IWN_CMD_LINK_QUALITY, &linkq, sizeof linkq, async);=0A= }=0A= @@ -4427,19 +4682,25 @@=0A= }=0A= =0A= static void=0A= -iwn_set_led(struct iwn_softc *sc, uint8_t which, uint8_t off, uint8_t = on)=0A= +iwn_set_led(struct iwn_softc *sc, uint8_t which, uint8_t off, uint8_t = on, uint8_t mode)=0A= {=0A= struct iwn_cmd_led led;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_LED, "->Doing %s\n", __func__);=0A= =0A= /* Clear microcode LED ownership. */=0A= IWN_CLRBITS(sc, IWN_LED, IWN_LED_BSM_CTRL);=0A= =0A= led.which =3D which;=0A= - led.unit =3D htole32(10000); /* on/off in unit of 100ms */=0A= +=0A= + if(mode =3D=3D IWN_LED_SLOW_BLINK)=0A= + led.unit =3D htole32(IWN_LED_UNIT * 5); /* on/off in unit of 10ms */=0A= + else=0A= + led.unit =3D htole32(IWN_LED_UNIT);=0A= +=0A= led.off =3D off;=0A= - led.on =3D on;=0A= + led.on =3D on;=0A= +=0A= (void)iwn_cmd(sc, IWN_CMD_SET_LED, &led, sizeof led, 1);=0A= }=0A= =0A= @@ -4451,21 +4712,32 @@=0A= iwn_set_critical_temp(struct iwn_softc *sc)=0A= {=0A= struct iwn_critical_temp crit;=0A= - int32_t temp;=0A= + int32_t ct_enter,ct_exit;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s\n", = __func__);=0A= =0A= IWN_WRITE(sc, IWN_UCODE_GP1_CLR, IWN_UCODE_GP1_CTEMP_STOP_RF);=0A= =0A= - if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_5150)=0A= - temp =3D (IWN_CTOK(110) - sc->temp_off) * -5;=0A= - else if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_4965)=0A= - temp =3D IWN_CTOK(110);=0A= - else=0A= - temp =3D 110;=0A= + ct_enter =3D IWN_CT_KILL_THRESHOLD;=0A= + ct_exit =3D IWN_CT_KILL_EXIT_THRESHOLD;=0A= +=0A= + if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_5150) {=0A= + ct_enter =3D (IWN_CTOK(IWN_CT_KILL_THRESHOLD) - sc->temp_off) * -5;=0A= + ct_exit =3D 0;=0A= +#ifdef IWN_4569=0A= + } else if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_4965) {=0A= + ct_enter =3D IWN_CTOK(IWN_CT_KILL_THRESHOLD);=0A= + ct_exit =3D 0;=0A= +#endif=0A= + } else {=0A= + ct_enter =3D IWN_CT_KILL_THRESHOLD;=0A= + ct_exit =3D IWN_CT_KILL_EXIT_THRESHOLD;=0A= + }=0A= +=0A= memset(&crit, 0, sizeof crit);=0A= - crit.tempR =3D htole32(temp);=0A= - DPRINTF(sc, IWN_DEBUG_RESET, "setting critical temp to %d\n", temp);=0A= + crit.tempR =3D htole32(ct_enter);=0A= + crit.tempM =3D htole32(ct_exit);=0A= + DPRINTF(sc, IWN_DEBUG_RESET, "setting critical temp to %d and exit to = %d \n", ct_enter,ct_exit);=0A= return iwn_cmd(sc, IWN_CMD_SET_CRITICAL_TEMP, &crit, sizeof crit, 0);=0A= }=0A= =0A= @@ -4475,7 +4747,7 @@=0A= struct iwn_cmd_timing cmd;=0A= uint64_t val, mod;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s\n", = __func__);=0A= =0A= memset(&cmd, 0, sizeof cmd);=0A= memcpy(&cmd.tstamp, ni->ni_tstamp.data, sizeof (uint64_t));=0A= @@ -4487,8 +4759,10 @@=0A= mod =3D le64toh(cmd.tstamp) % val;=0A= cmd.binitval =3D htole32((uint32_t)(val - mod));=0A= =0A= +// cmd.dtim_period=3D1; //XXX It's defined in linux kernel=0A= +=0A= DPRINTF(sc, IWN_DEBUG_RESET, "timing bintval=3D%u tstamp=3D%ju, = init=3D%u\n",=0A= - ni->ni_intval, le64toh(cmd.tstamp), (uint32_t)(val - mod));=0A= + le16toh(cmd.bintval), le64toh(cmd.tstamp), (uint32_t)(val - mod));=0A= =0A= return iwn_cmd(sc, IWN_CMD_TIMING, &cmd, sizeof cmd, 1);=0A= }=0A= @@ -4537,7 +4811,7 @@=0A= uint8_t chan;=0A= =0A= /* Retrieve current channel from last RXON. */=0A= - chan =3D sc->rxon.chan;=0A= + chan =3D sc->rxon->chan;=0A= DPRINTF(sc, IWN_DEBUG_RESET, "setting TX power for channel %d\n",=0A= chan);=0A= =0A= @@ -4672,7 +4946,7 @@=0A= {=0A= struct iwn5000_cmd_txpower cmd;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_TXPOW, "->Doing %s\n", = __func__);=0A= =0A= /*=0A= * TX power calibration is handled automatically by the firmware=0A= @@ -4721,19 +4995,22 @@=0A= {=0A= struct iwn5000_rx_phystat *phy =3D (void *)stat->phybuf;=0A= uint8_t agc;=0A= - int rssi;=0A= + int rssi, rssi_a, rssi_b, rssi_c;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RECV, "->Doing %s\n", = __func__);=0A= =0A= - agc =3D (le32toh(phy->agc) >> 9) & 0x7f;=0A= + agc =3D (le32toh(phy->agc) >> 9) & 0x7f; /* 0x7f =3D=3D (0xfe00 >> 9) = */=0A= =0A= - rssi =3D MAX(le16toh(phy->rssi[0]) & 0xff,=0A= - le16toh(phy->rssi[1]) & 0xff);=0A= - rssi =3D MAX(le16toh(phy->rssi[2]) & 0xff, rssi);=0A= + rssi_a =3D le16toh(phy->rssi[0]) & 0xff;=0A= + rssi_b =3D le16toh(phy->rssi[1]) & 0xff;=0A= + rssi_c =3D le16toh(phy->rssi[2]) & 0xff;=0A= =0A= + rssi =3D MAX(rssi_a, rssi_b);=0A= + rssi =3D MAX(rssi_c, rssi);=0A= +=0A= DPRINTF(sc, IWN_DEBUG_RECV,=0A= - "%s: agc %d rssi %d %d %d result %d\n", __func__, agc,=0A= - phy->rssi[0], phy->rssi[1], phy->rssi[2],=0A= + "%s: agc %d rssi ANT_A:%d ANT_B:%d ANT_C:%d result %d dBm\n", = __func__, agc,=0A= + rssi_a, rssi_b, rssi_c,=0A= rssi - agc - IWN_RSSI_TO_DBM);=0A= return rssi - agc - IWN_RSSI_TO_DBM;=0A= }=0A= @@ -4792,7 +5069,7 @@=0A= {=0A= int32_t temp;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->Doing %s\n", = __func__);=0A= =0A= /*=0A= * Temperature is not used by the driver for 5000 Series because=0A= @@ -4803,6 +5080,8 @@=0A= temp =3D (temp / -5) + sc->temp_off;=0A= temp =3D IWN_KTOC(temp);=0A= }=0A= + DPRINTF(sc,IWN_DEBUG_CALIBRATE,"Temperature %d\n",temp);=0A= + //XXX: handle thermal throttling state machine=0A= return temp;=0A= }=0A= =0A= @@ -4814,10 +5093,9 @@=0A= {=0A= struct iwn_ops *ops =3D &sc->ops;=0A= struct iwn_calib_state *calib =3D &sc->calib;=0A= - uint32_t flags;=0A= int error;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->Doing %s\n", = __func__);=0A= =0A= /* Reset calibration state machine. */=0A= memset(calib, 0, sizeof (*calib));=0A= @@ -4828,9 +5106,10 @@=0A= calib->ofdm_mrc_x1 =3D sc->limits->min_ofdm_mrc_x1;=0A= calib->ofdm_x4 =3D sc->limits->min_ofdm_x4;=0A= calib->ofdm_mrc_x4 =3D sc->limits->min_ofdm_mrc_x4;=0A= - calib->cck_x4 =3D 125;=0A= + calib->cck_x4 =3D sc->limits->min_cck_x4;=0A= calib->cck_mrc_x4 =3D sc->limits->min_cck_mrc_x4;=0A= calib->energy_cck =3D sc->limits->energy_cck;=0A= + calib->corr_barker_mrc =3D sc->limits->min_corr_barker_mrc;=0A= =0A= /* Write initial sensitivity. */=0A= if ((error =3D iwn_send_sensitivity(sc)) !=3D 0)=0A= @@ -4841,10 +5120,7 @@=0A= return error;=0A= =0A= /* Request statistics at each beacon interval. */=0A= - flags =3D 0;=0A= - DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: sending request for = statistics\n",=0A= - __func__);=0A= - return iwn_cmd(sc, IWN_CMD_GET_STATISTICS, &flags, sizeof flags, 1);=0A= + return iwn_set_statistics_request(sc,true,false,1);=0A= }=0A= =0A= /*=0A= @@ -4863,7 +5139,7 @@=0A= uint32_t val;=0A= int i;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s begin\n", = __func__);=0A= =0A= /* Accumulate RSSI and noise for all 3 antennas. */=0A= for (i =3D 0; i < 3; i++) {=0A= @@ -4896,8 +5172,8 @@=0A= =0A= #ifdef notyet=0A= /* XXX Disable RX chains with no antennas connected. */=0A= - sc->rxon.rxchain =3D htole16(IWN_RXCHAIN_SEL(sc->chainmask));=0A= - (void)iwn_cmd(sc, IWN_CMD_RXON, &sc->rxon, sc->rxonsz, 1);=0A= + sc->rxon->rxchain =3D htole16(IWN_RXCHAIN_SEL(sc->chainmask));=0A= + (void)iwn_cmd(sc, IWN_CMD_RXON, sc->rxon, sc->rxonsz, 1);=0A= #endif=0A= =0A= /* Enable power-saving mode if requested by user. */=0A= @@ -4904,7 +5180,7 @@=0A= if (ic->ic_flags & IEEE80211_F_PMGTON)=0A= (void)iwn_set_pslevel(sc, 0, 3, 1);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s: = end\n",__func__);=0A= =0A= }=0A= =0A= @@ -4928,7 +5204,7 @@=0A= {=0A= struct iwn_phy_calib cmd;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->Doing %s\n", = __func__);=0A= =0A= memset(&cmd, 0, sizeof cmd);=0A= cmd.code =3D sc->reset_noise_gain;=0A= @@ -4981,7 +5257,7 @@=0A= struct iwn_phy_calib_gain cmd;=0A= int i, ant, div, delta;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->Doing %s\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->Doing %s\n", = __func__);=0A= =0A= /* We collected 20 beacons and !=3D6050 need a 1.5 factor. */=0A= div =3D (sc->hw_type =3D=3D IWN_HW_REV_TYPE_6050) ? 20 : 30;=0A= @@ -5041,11 +5317,11 @@=0A= uint8_t noise[3], noise_ref;=0A= int i, needs_update =3D 0;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s begin\n", = __func__);=0A= =0A= /* Check that we've been enabled long enough. */=0A= if ((rxena =3D le32toh(stats->general.load)) =3D=3D 0){=0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end not so long\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s end not so = long\n", __func__);=0A= return;=0A= }=0A= =0A= @@ -5166,7 +5442,7 @@=0A= if (needs_update)=0A= (void)iwn_send_sensitivity(sc);=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_CALIBRATE, "->%s: = end\n",__func__);=0A= =0A= #undef dec=0A= #undef inc=0A= @@ -5187,7 +5463,8 @@=0A= cmd.corr_ofdm_mrc_x1 =3D htole16(calib->ofdm_mrc_x1);=0A= cmd.corr_ofdm_x4 =3D htole16(calib->ofdm_x4);=0A= cmd.corr_ofdm_mrc_x4 =3D htole16(calib->ofdm_mrc_x4);=0A= - cmd.energy_ofdm =3D htole16(sc->limits->energy_ofdm);=0A= + cmd.energy_ofdm =3D htole16(calib->energy_ofdm);=0A= + /* Value energy_ofdm_th doesn't change across series in linux Kernel */=0A= cmd.energy_ofdm_th =3D htole16(62);=0A= /* CCK modulation. */=0A= cmd.corr_cck_x4 =3D htole16(calib->cck_x4);=0A= @@ -5195,7 +5472,7 @@=0A= cmd.energy_cck =3D htole16(calib->energy_cck);=0A= /* Barker modulation: use default values. */=0A= cmd.corr_barker =3D htole16(190);=0A= - cmd.corr_barker_mrc =3D htole16(390);=0A= + cmd.corr_barker_mrc =3D htole16(calib->corr_barker_mrc);=0A= =0A= DPRINTF(sc, IWN_DEBUG_CALIBRATE,=0A= "%s: set sensitivity %d/%d/%d/%d/%d/%d/%d\n", __func__,=0A= @@ -5222,6 +5499,8 @@=0A= /*=0A= * Set STA mode power saving level (between 0 and 5).=0A= * Level 0 is CAM (Continuously Aware Mode), 5 is for maximum power = saving.=0A= + * DTIM value passed in will if so configured, be ignored and taken from=0A= + * the value set at the AP.=0A= */=0A= static int=0A= iwn_set_pslevel(struct iwn_softc *sc, int dtim, int level, int async)=0A= @@ -5230,8 +5509,25 @@=0A= const struct iwn_pmgt *pmgt;=0A= uint32_t max, skip_dtim;=0A= uint32_t reg;=0A= - int i;=0A= + int i, retval;=0A= + struct ifnet *ifp =3D sc->sc_ifp;=0A= + struct ieee80211com *ic =3D ifp->if_l2com;=0A= =0A= + if(!TAILQ_EMPTY(&ic->ic_vaps)) {=0A= + /* At present the driver supports only a single vap. */=0A= + struct ieee80211vap *vap =3D TAILQ_FIRST(&ic->ic_vaps);=0A= +=0A= + /* XXX confirm PS level setting validity for various modes */=0A= + if(vap->iv_opmode =3D=3D IEEE80211_M_HOSTAP ||=0A= + vap->iv_opmode =3D=3D IEEE80211_M_MONITOR)=0A= + return 0;=0A= +=0A= + #ifdef IWN_DTIM_INDICATES_UNICAST_PENDING_AT_AP=0A= + if (vap->iv_state =3D=3D IEEE80211_S_RUN)=0A= + dtim =3D vap->iv_bss->ni_dtim_period;=0A= + #endif=0A= + }=0A= +=0A= DPRINTF(sc, IWN_DEBUG_PWRSAVE,=0A= "%s: dtim=3D%d, level=3D%d, async=3D%d\n",=0A= __func__,=0A= @@ -5249,7 +5545,7 @@=0A= =0A= memset(&cmd, 0, sizeof cmd);=0A= if (level !=3D 0) /* not CAM */=0A= - cmd.flags |=3D htole16(IWN_PS_ALLOW_SLEEP);=0A= + cmd.flags |=3D = htole16(IWN_PS_ALLOW_SLEEP)|htole16(IWN_PS_ADVANCED_PM);=0A= if (level =3D=3D 5)=0A= cmd.flags |=3D htole16(IWN_PS_FAST_PD);=0A= /* Retrieve PCIe Active State Power Management (ASPM). */=0A= @@ -5276,9 +5572,18 @@=0A= for (i =3D 0; i < 5; i++)=0A= cmd.intval[i] =3D htole32(MIN(max, pmgt->intval[i]));=0A= =0A= - DPRINTF(sc, IWN_DEBUG_RESET, "setting power saving level to %d\n",=0A= + DPRINTF(sc, IWN_DEBUG_PWRSAVE, "setting power saving level to %d\n",=0A= level);=0A= - return iwn_cmd(sc, IWN_CMD_SET_POWER_MODE, &cmd, sizeof cmd, async);=0A= + retval =3D iwn_cmd(sc, IWN_CMD_SET_POWER_MODE, &cmd, sizeof cmd, = async);=0A= + /*=0A= + * XXX: update current_pwrsave_level using completion notification=0A= + * in case of async mode=0A= + */=0A= + if(retval=3D=3D0)=0A= + sc->current_pwrsave_level =3D level;=0A= +=0A= + return retval;=0A= +=0A= }=0A= =0A= static int=0A= @@ -5304,25 +5609,61 @@=0A= 0xc0004000, 0x00004000, 0xf0005000, 0xf0005000,=0A= };=0A= struct iwn6000_btcoex_config btconfig;=0A= + struct iwn2000_btcoex_config btconfig2k;=0A= struct iwn_btcoex_priotable btprio;=0A= struct iwn_btcoex_prot btprot;=0A= int error, i;=0A= + uint8_t flags;=0A= =0A= memset(&btconfig, 0, sizeof btconfig);=0A= - btconfig.flags =3D 145;=0A= - btconfig.max_kill =3D 5;=0A= - btconfig.bt3_t7_timer =3D 1;=0A= - btconfig.kill_ack =3D htole32(0xffff0000);=0A= - btconfig.kill_cts =3D htole32(0xffff0000);=0A= - btconfig.sample_time =3D 2;=0A= - btconfig.bt3_t2_timer =3D 0xc;=0A= - for (i =3D 0; i < 12; i++)=0A= - btconfig.lookup_table[i] =3D htole32(btcoex_3wire[i]);=0A= - btconfig.valid =3D htole16(0xff);=0A= - btconfig.prio_boost =3D 0xf0;=0A= - DPRINTF(sc, IWN_DEBUG_RESET,=0A= - "%s: configuring advanced bluetooth coexistence\n", __func__);=0A= - error =3D iwn_cmd(sc, IWN_CMD_BT_COEX, &btconfig, sizeof(btconfig), 1);=0A= + memset(&btconfig2k, 0, sizeof btconfig2k);=0A= +=0A= + flags =3D IWN_BT_FLAG_COEX6000_MODE_3W << = IWN_BT_FLAG_COEX6000_MODE_SHIFT; // Done as is in linux kernel 3.2=0A= +=0A= + if (sc->base_params->bt_sco_disable)=0A= + flags &=3D ~IWN_BT_FLAG_SYNC_2_BT_DISABLE;=0A= + else=0A= + flags |=3D IWN_BT_FLAG_SYNC_2_BT_DISABLE;=0A= +=0A= + flags |=3D IWN_BT_FLAG_COEX6000_CHAN_INHIBITION;=0A= +=0A= +=0A= + /* Default flags result is 145 as old value */=0A= +=0A= + /* Flags value has to be review. Values must change if we which to = disable it */=0A= + if (sc->base_params->bt_session_2) {=0A= + btconfig2k.flags =3D flags;=0A= + btconfig2k.max_kill =3D 5;=0A= + btconfig2k.bt3_t7_timer =3D 1;=0A= + btconfig2k.kill_ack =3D htole32(0xffff0000);=0A= + btconfig2k.kill_cts =3D htole32(0xffff0000);=0A= + btconfig2k.sample_time =3D 2;=0A= + btconfig2k.bt3_t2_timer =3D 0xc;=0A= +=0A= + for (i =3D 0; i < 12; i++)=0A= + btconfig2k.lookup_table[i] =3D htole32(btcoex_3wire[i]);=0A= + btconfig2k.valid =3D htole16(0xff);=0A= + btconfig2k.prio_boost =3D htole32(0xf0);=0A= + DPRINTF(sc, IWN_DEBUG_RESET,=0A= + "%s: configuring advanced bluetooth coexistence session 2, flags : = 0X%x\n", __func__,flags);=0A= + error =3D iwn_cmd(sc, IWN_CMD_BT_COEX, &btconfig2k, = sizeof(btconfig2k), 1);=0A= + } else {=0A= + btconfig.flags =3D flags;=0A= + btconfig.max_kill =3D 5;=0A= + btconfig.bt3_t7_timer =3D 1;=0A= + btconfig.kill_ack =3D htole32(0xffff0000);=0A= + btconfig.kill_cts =3D htole32(0xffff0000);=0A= + btconfig.sample_time =3D 2;=0A= + btconfig.bt3_t2_timer =3D 0xc;=0A= +=0A= + for (i =3D 0; i < 12; i++)=0A= + btconfig.lookup_table[i] =3D htole32(btcoex_3wire[i]);=0A= + btconfig.valid =3D htole16(0xff);=0A= + btconfig.prio_boost =3D 0xf0;=0A= + DPRINTF(sc, IWN_DEBUG_RESET,=0A= + "%s: configuring advanced bluetooth coexistence, flags : 0X%x\n", = __func__,flags);=0A= + error =3D iwn_cmd(sc, IWN_CMD_BT_COEX, &btconfig, sizeof(btconfig), = 1);=0A= + }=0A= if (error !=3D 0)=0A= return error;=0A= =0A= @@ -5353,19 +5694,6 @@=0A= }=0A= =0A= static int=0A= -iwn5000_runtime_calib(struct iwn_softc *sc)=0A= -{=0A= - struct iwn5000_calib_config cmd;=0A= -=0A= - memset(&cmd, 0, sizeof cmd);=0A= - cmd.ucode.once.enable =3D 0xffffffff;=0A= - cmd.ucode.once.start =3D IWN5000_CALIB_DC;=0A= - DPRINTF(sc, IWN_DEBUG_CALIBRATE,=0A= - "%s: configuring runtime calibration\n", __func__);=0A= - return iwn_cmd(sc, IWN5000_CMD_CALIB_CONFIG, &cmd, sizeof(cmd), 0);=0A= -}=0A= -=0A= -static int=0A= iwn_config(struct iwn_softc *sc)=0A= {=0A= struct iwn_ops *ops =3D &sc->ops;=0A= @@ -5375,30 +5703,44 @@=0A= uint16_t rxchain;=0A= int error;=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s begin\n", = __func__);=0A= =0A= - if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_6005) {=0A= - /* Set radio temperature sensor offset. */=0A= + if ((sc->base_params->calib_need & IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET) = && (sc->base_params->calib_need & = IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSETv2)) {=0A= + device_printf(sc->sc_dev,"%s: temp_offset and temp_offsetv2 are = exclusive each together. Review NIC config file. Conf : 0x%08x Flags : = 0x%08x \n", = __func__,sc->base_params->calib_need,(IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET = | IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSETv2));=0A= + return EINVAL;=0A= + }=0A= + /* Compute temperature calib if needed. Will be send by send calib */=0A= + if (sc->base_params->calib_need & IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET) {=0A= error =3D iwn5000_temp_offset_calib(sc);=0A= if (error !=3D 0) {=0A= device_printf(sc->sc_dev,=0A= - "%s: could not set temperature offset\n", __func__);=0A= + "%s: could not compute temperature offset\n", __func__);=0A= return error;=0A= }=0A= - }=0A= -=0A= - if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_6050) {=0A= - /* Configure runtime DC calibration. */=0A= - error =3D iwn5000_runtime_calib(sc);=0A= + } else if (sc->base_params->calib_need & = IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSETv2) {=0A= + error =3D iwn5000_temp_offset_calibv2(sc);=0A= if (error !=3D 0) {=0A= device_printf(sc->sc_dev,=0A= - "%s: could not configure runtime calibration\n",=0A= - __func__);=0A= + "%s: could not compute temperature offset v2\n", __func__);=0A= return error;=0A= }=0A= }=0A= =0A= + /* Configure bluetooth coexistence. */=0A= + if (sc->base_params->advanced_bt_coexist)=0A= + error =3D iwn_send_advanced_btcoex(sc);=0A= + else=0A= + error =3D iwn_send_btcoex(sc);=0A= +=0A= + if (error !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not configure bluetooth coexistence, error %d\n",=0A= + __func__, error);=0A= + return error;=0A= + }=0A= +=0A= /* Configure valid TX chains for >=3D5000 Series. */=0A= +=0A= if (sc->hw_type !=3D IWN_HW_REV_TYPE_4965) {=0A= txmask =3D htole32(sc->txchainmask);=0A= DPRINTF(sc, IWN_DEBUG_RESET,=0A= @@ -5413,34 +5755,24 @@=0A= }=0A= }=0A= =0A= - /* Configure bluetooth coexistence. */=0A= - if (sc->sc_flags & IWN_FLAG_ADV_BTCOEX)=0A= - error =3D iwn_send_advanced_btcoex(sc);=0A= - else=0A= - error =3D iwn_send_btcoex(sc);=0A= - if (error !=3D 0) {=0A= - device_printf(sc->sc_dev,=0A= - "%s: could not configure bluetooth coexistence, error %d\n",=0A= - __func__, error);=0A= - return error;=0A= - }=0A= =0A= /* Set mode, channel, RX filter and enable RX. */=0A= - memset(&sc->rxon, 0, sizeof (struct iwn_rxon));=0A= - IEEE80211_ADDR_COPY(sc->rxon.myaddr, IF_LLADDR(ifp));=0A= - IEEE80211_ADDR_COPY(sc->rxon.wlap, IF_LLADDR(ifp));=0A= - sc->rxon.chan =3D ieee80211_chan2ieee(ic, ic->ic_curchan);=0A= - sc->rxon.flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A= + memset(sc->rxon, 0, sizeof (struct iwn_rxon));=0A= + IEEE80211_ADDR_COPY(sc->rxon->myaddr, IF_LLADDR(ifp));=0A= + IEEE80211_ADDR_COPY(sc->rxon->wlap, IF_LLADDR(ifp));=0A= + sc->rxon->chan =3D ieee80211_chan2ieee(ic, ic->ic_curchan);=0A= + sc->rxon->flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A= if (IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan))=0A= - sc->rxon.flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= switch (ic->ic_opmode) {=0A= case IEEE80211_M_STA:=0A= - sc->rxon.mode =3D IWN_MODE_STA;=0A= - sc->rxon.filter =3D htole32(IWN_FILTER_MULTICAST);=0A= + sc->rxon->mode =3D IWN_MODE_STA;=0A= + sc->rxon->filter =3D htole32(IWN_FILTER_MULTICAST);=0A= break;=0A= case IEEE80211_M_MONITOR:=0A= - sc->rxon.mode =3D IWN_MODE_MONITOR;=0A= - sc->rxon.filter =3D htole32(IWN_FILTER_MULTICAST |=0A= + sc->rxon->mode =3D IWN_MODE_MONITOR;=0A= + sc->rxon->filter =3D htole32(IWN_FILTER_MULTICAST |=0A= IWN_FILTER_CTL | IWN_FILTER_PROMISC);=0A= break;=0A= default:=0A= @@ -5447,18 +5779,20 @@=0A= /* Should not get there. */=0A= break;=0A= }=0A= - sc->rxon.cck_mask =3D 0x0f; /* not yet negotiated */=0A= - sc->rxon.ofdm_mask =3D 0xff; /* not yet negotiated */=0A= - sc->rxon.ht_single_mask =3D 0xff;=0A= - sc->rxon.ht_dual_mask =3D 0xff;=0A= - sc->rxon.ht_triple_mask =3D 0xff;=0A= +=0A= + sc->rxon->cck_mask =3D 0x0f; /* not yet negotiated */=0A= + sc->rxon->ofdm_mask =3D 0xff; /* not yet negotiated */=0A= + sc->rxon->ht_single_mask =3D 0xff;=0A= + sc->rxon->ht_dual_mask =3D 0xff;=0A= + sc->rxon->ht_triple_mask =3D 0xff;=0A= rxchain =3D=0A= IWN_RXCHAIN_VALID(sc->rxchainmask) |=0A= IWN_RXCHAIN_MIMO_COUNT(2) |=0A= IWN_RXCHAIN_IDLE_COUNT(2);=0A= - sc->rxon.rxchain =3D htole16(rxchain);=0A= + sc->rxon->rxchain =3D htole16(rxchain);=0A= +=0A= DPRINTF(sc, IWN_DEBUG_RESET, "%s: setting configuration\n", __func__);=0A= - error =3D iwn_cmd(sc, IWN_CMD_RXON, &sc->rxon, sc->rxonsz, 0);=0A= + error =3D iwn_cmd(sc, IWN_CMD_RXON, sc->rxon, sc->rxonsz, 0);=0A= if (error !=3D 0) {=0A= device_printf(sc->sc_dev, "%s: RXON command failed\n",=0A= __func__);=0A= @@ -5484,14 +5818,24 @@=0A= return error;=0A= }=0A= =0A= - /* Set power saving level to CAM during initialization. */=0A= - if ((error =3D iwn_set_pslevel(sc, 0, 0, 0)) !=3D 0) {=0A= + /*=0A= + * Any vap's iv_flags are cloned from ic->ic_flags. Setting the flags=0A= + * on ic will allow a vap to get the correct powersave level once=0A= + * it is created.=0A= + */=0A= + if(sc->desired_pwrsave_level!=3DIWN_POWERSAVE_LVL_NONE)=0A= + ic->ic_flags |=3D IEEE80211_F_PMGTON;=0A= + else=0A= + ic->ic_flags &=3D ~IEEE80211_F_PMGTON;=0A= +=0A= + if ((error =3D iwn_set_pslevel(sc, IWN_POWERSAVE_DTIM_VOIP_COMPATIBLE,=0A= + sc->desired_pwrsave_level, 0)) !=3D 0) {=0A= device_printf(sc->sc_dev,=0A= "%s: could not set power saving level\n", __func__);=0A= return error;=0A= }=0A= =0A= - DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE | IWN_DEBUG_RESET, "->%s: end\n",__func__);=0A= =0A= return 0;=0A= }=0A= @@ -5526,9 +5870,20 @@=0A= uint16_t rxchain;=0A= uint8_t txant;=0A= int buflen, error;=0A= + uint8_t new_scan_threshold;=0A= + struct iwn_eeprom_chan *channel;=0A= =0A= DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= =0A= +=0A= + struct ieee80211vap *vap =3D ni->ni_vap;=0A= + struct iwn_vap *ivp =3D IWN_VAP(vap);=0A= +=0A= + if(ivp->ctx =3D=3D IWN_RXON_BSS_CTX)=0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A= + else if(ivp->ctx =3D=3D IWN_RXON_PAN_CTX)=0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_PAN_CTX];=0A= +=0A= buf =3D malloc(IWN_SCAN_MAXSZ, M_DEVBUF, M_NOWAIT | M_ZERO);=0A= if (buf =3D=3D NULL) {=0A= device_printf(sc->sc_dev,=0A= @@ -5560,7 +5915,11 @@=0A= =0A= tx =3D (struct iwn_cmd_data *)(hdr + 1);=0A= tx->flags =3D htole32(IWN_TX_AUTO_SEQ);=0A= - tx->id =3D sc->broadcast_id;=0A= + if(ivp->ctx =3D=3D IWN_RXON_PAN_CTX)=0A= + tx->id =3D IWN_PAN_ID_BCAST;=0A= + else=0A= + tx->id =3D IWN5000_ID_BROADCAST;=0A= +=0A= tx->lifetime =3D htole32(IWN_LIFETIME_INFINITE);=0A= =0A= if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan)) {=0A= @@ -5570,7 +5929,7 @@=0A= } else {=0A= hdr->flags =3D htole32(IWN_RXON_24GHZ | IWN_RXON_AUTO);=0A= if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_4965 &&=0A= - sc->rxon.associd && sc->rxon.chan > 14)=0A= + sc->rxon->associd && sc->rxon->chan > 14)=0A= tx->rate =3D htole32(0xd);=0A= else {=0A= /* Send probe requests at 1Mbps. */=0A= @@ -5597,7 +5956,7 @@=0A= IEEE80211_FC0_SUBTYPE_PROBE_REQ;=0A= wh->i_fc[1] =3D IEEE80211_FC1_DIR_NODS;=0A= IEEE80211_ADDR_COPY(wh->i_addr1, ifp->if_broadcastaddr);=0A= - IEEE80211_ADDR_COPY(wh->i_addr2, IF_LLADDR(ifp));=0A= + IEEE80211_ADDR_COPY(wh->i_addr2, ivp->macaddr);=0A= IEEE80211_ADDR_COPY(wh->i_addr3, ifp->if_broadcastaddr);=0A= *(uint16_t *)&wh->i_dur[0] =3D 0; /* filled by HW */=0A= *(uint16_t *)&wh->i_seq[0] =3D 0; /* filled by HW */=0A= @@ -5619,36 +5978,61 @@=0A= chan->flags =3D 0;=0A= if (ss->ss_nssid > 0)=0A= chan->flags |=3D htole32(IWN_CHAN_NPBREQS(1));=0A= - chan->dsp_gain =3D 0x6e;=0A= - if (IEEE80211_IS_CHAN_5GHZ(c) &&=0A= - !(c->ic_flags & IEEE80211_CHAN_PASSIVE)) {=0A= - chan->rf_gain =3D 0x3b;=0A= - chan->active =3D htole16(24);=0A= - chan->passive =3D htole16(110);=0A= - chan->flags |=3D htole32(IWN_CHAN_ACTIVE);=0A= - } else if (IEEE80211_IS_CHAN_5GHZ(c)) {=0A= - chan->rf_gain =3D 0x3b;=0A= - chan->active =3D htole16(24);=0A= - if (sc->rxon.associd)=0A= - chan->passive =3D htole16(78);=0A= + /*=0A= + * If active scanning is requested but a certain channel is=0A= + * marked passive, we can do active scanning if we detect=0A= + * transmissions.=0A= + *=0A= + * There is an issue with some firmware versions that triggers=0A= + * a sysassert on a "good CRC threshold" of zero (=3D=3D disabled),=0A= + * on a radar channel even though this means that we should NOT=0A= + * send probes.=0A= + *=0A= + * The "good CRC threshold" is the number of frames that we=0A= + * need to receive during our dwell time on a channel before=0A= + * sending out probes -- setting this to a huge value will=0A= + * mean we never reach it, but at the same time work around=0A= + * the aforementioned issue. Thus use IWN_SCAN_CRC_TH_NEVER=0A= + * here instead of IWN_SCAN_CRC_TH_DISABLED.=0A= + *=0A= + * This was fixed in later versions along with some other=0A= + * scan changes, and the threshold behaves as a flag in those=0A= + * versions.=0A= + */=0A= +=0A= + channel =3D iwn_find_eeprom_channel(sc, c);=0A= + if (channel =3D=3D NULL) {=0A= + if_printf(ic->ic_ifp,=0A= + "%s: invalid channel %u freq %u/0x%x\n",=0A= + __func__, c->ic_ieee, c->ic_freq, c->ic_flags);=0A= + return EINVAL;=0A= + }=0A= +=0A= + new_scan_threshold =3D ((sc->tlv_feature_flags &=0A= + (1<> = IWN_FW_TLV_FLAGS_NEW_SCAN_BITPOS);=0A= +=0A= + /* Selection criteria for Active/Passive scanning */=0A= + if ((ss->ss_nssid =3D=3D 0) || ((channel->flags & = IWN_EEPROM_CHAN_ACTIVE) =3D=3D 0) ||=0A= + (c->ic_flags & IEEE80211_CHAN_PASSIVE)) {=0A= + chan->flags |=3D htole32(IWN_CHAN_PASSIVE);=0A= + if (new_scan_threshold =3D=3D 1)=0A= + hdr->crc_threshold =3D IWN_SCAN_CRC_TH_DISABLED;=0A= else=0A= - chan->passive =3D htole16(110);=0A= - hdr->crc_threshold =3D 0xffff;=0A= - } else if (!(c->ic_flags & IEEE80211_CHAN_PASSIVE)) {=0A= - chan->rf_gain =3D 0x28;=0A= - chan->active =3D htole16(36);=0A= - chan->passive =3D htole16(120);=0A= + hdr->crc_threshold =3D IWN_SCAN_CRC_TH_NEVER;=0A= + } else {=0A= chan->flags |=3D htole32(IWN_CHAN_ACTIVE);=0A= - } else {=0A= - chan->rf_gain =3D 0x28;=0A= - chan->active =3D htole16(36);=0A= - if (sc->rxon.associd)=0A= - chan->passive =3D htole16(88);=0A= - else=0A= - chan->passive =3D htole16(120);=0A= - hdr->crc_threshold =3D 0xffff;=0A= + hdr->crc_threshold =3D IWN_SCAN_CRC_TH_DEFAULT;=0A= }=0A= =0A= + chan->dsp_gain =3D 0x6e;=0A= + if (IEEE80211_IS_CHAN_5GHZ(c))=0A= + chan->rf_gain =3D 0x3b;=0A= + else=0A= + chan->rf_gain =3D 0x28;=0A= +=0A= + chan->active =3D htole16(iwn_get_active_dwell(sc, c));=0A= + chan->passive =3D htole16(iwn_get_passive_dwell(sc, c));=0A= +=0A= DPRINTF(sc, IWN_DEBUG_STATE,=0A= "%s: chan %u flags 0x%x rf_gain 0x%x "=0A= "dsp_gain 0x%x active 0x%x passive 0x%x\n", __func__,=0A= @@ -5662,6 +6046,9 @@=0A= =0A= DPRINTF(sc, IWN_DEBUG_STATE, "sending scan command nchan=3D%d\n",=0A= hdr->nchan);=0A= +=0A= + sc->sc_scan_timer =3D IWN_SCAN_CHAN_TIMEOUT;=0A= +=0A= error =3D iwn_cmd(sc, IWN_CMD_SCAN, buf, buflen, 1);=0A= free(buf, M_DEVBUF);=0A= =0A= @@ -5681,31 +6068,32 @@=0A= =0A= DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= =0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A= /* Update adapter configuration. */=0A= - IEEE80211_ADDR_COPY(sc->rxon.bssid, ni->ni_bssid);=0A= - sc->rxon.chan =3D ieee80211_chan2ieee(ic, ni->ni_chan);=0A= - sc->rxon.flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A= + IEEE80211_ADDR_COPY(sc->rxon->bssid, ni->ni_bssid);=0A= + sc->rxon->chan =3D ieee80211_chan2ieee(ic, ni->ni_chan);=0A= + sc->rxon->flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A= if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))=0A= - sc->rxon.flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= if (ic->ic_flags & IEEE80211_F_SHSLOT)=0A= - sc->rxon.flags |=3D htole32(IWN_RXON_SHSLOT);=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_SHSLOT);=0A= if (ic->ic_flags & IEEE80211_F_SHPREAMBLE)=0A= - sc->rxon.flags |=3D htole32(IWN_RXON_SHPREAMBLE);=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_SHPREAMBLE);=0A= if (IEEE80211_IS_CHAN_A(ni->ni_chan)) {=0A= - sc->rxon.cck_mask =3D 0;=0A= - sc->rxon.ofdm_mask =3D 0x15;=0A= + sc->rxon->cck_mask =3D 0;=0A= + sc->rxon->ofdm_mask =3D 0x15;=0A= } else if (IEEE80211_IS_CHAN_B(ni->ni_chan)) {=0A= - sc->rxon.cck_mask =3D 0x03;=0A= - sc->rxon.ofdm_mask =3D 0;=0A= + sc->rxon->cck_mask =3D 0x03;=0A= + sc->rxon->ofdm_mask =3D 0;=0A= } else {=0A= /* Assume 802.11b/g. */=0A= - sc->rxon.cck_mask =3D 0x0f;=0A= - sc->rxon.ofdm_mask =3D 0x15;=0A= + sc->rxon->cck_mask =3D 0x0f;=0A= + sc->rxon->ofdm_mask =3D 0x15;=0A= }=0A= DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x cck %x ofdm %x\n",=0A= - sc->rxon.chan, sc->rxon.flags, sc->rxon.cck_mask,=0A= - sc->rxon.ofdm_mask);=0A= - error =3D iwn_cmd(sc, IWN_CMD_RXON, &sc->rxon, sc->rxonsz, 1);=0A= + sc->rxon->chan, sc->rxon->flags, sc->rxon->cck_mask,=0A= + sc->rxon->ofdm_mask);=0A= + error =3D iwn_cmd(sc, IWN_CMD_RXON, sc->rxon, sc->rxonsz, 1);=0A= if (error !=3D 0) {=0A= device_printf(sc->sc_dev, "%s: RXON command failed, error %d\n",=0A= __func__, error);=0A= @@ -5747,9 +6135,20 @@=0A= =0A= DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= =0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_BSS_CTX];=0A= +=0A= + if(sc->ctx =3D=3D IWN_RXON_PAN_CTX) {=0A= + if ((error =3D iwn_set_pan_params(sc)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: iwn_set_pan_params error %d\n", __func__, error);=0A= + return error;=0A= + }=0A= + }=0A= +=0A= +=0A= if (ic->ic_opmode =3D=3D IEEE80211_M_MONITOR) {=0A= /* Link LED blinks while monitoring. */=0A= - iwn_set_led(sc, IWN_LED_LINK, 5, 5);=0A= + iwn_set_led(sc, IWN_LED_LINK, 5, 5,IWN_LED_INT_BLINK);=0A= return 0;=0A= }=0A= if ((error =3D iwn_set_timing(sc, ni)) !=3D 0) {=0A= @@ -5759,26 +6158,26 @@=0A= }=0A= =0A= /* Update adapter configuration. */=0A= - IEEE80211_ADDR_COPY(sc->rxon.bssid, ni->ni_bssid);=0A= - sc->rxon.associd =3D htole16(IEEE80211_AID(ni->ni_associd));=0A= - sc->rxon.chan =3D ieee80211_chan2ieee(ic, ni->ni_chan);=0A= - sc->rxon.flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A= + IEEE80211_ADDR_COPY(sc->rxon->bssid, ni->ni_bssid);=0A= + sc->rxon->associd =3D htole16(IEEE80211_AID(ni->ni_associd));=0A= + sc->rxon->chan =3D ieee80211_chan2ieee(ic, ni->ni_chan);=0A= + sc->rxon->flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A= if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))=0A= - sc->rxon.flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= if (ic->ic_flags & IEEE80211_F_SHSLOT)=0A= - sc->rxon.flags |=3D htole32(IWN_RXON_SHSLOT);=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_SHSLOT);=0A= if (ic->ic_flags & IEEE80211_F_SHPREAMBLE)=0A= - sc->rxon.flags |=3D htole32(IWN_RXON_SHPREAMBLE);=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_SHPREAMBLE);=0A= if (IEEE80211_IS_CHAN_A(ni->ni_chan)) {=0A= - sc->rxon.cck_mask =3D 0;=0A= - sc->rxon.ofdm_mask =3D 0x15;=0A= + sc->rxon->cck_mask =3D 0;=0A= + sc->rxon->ofdm_mask =3D 0x15;=0A= } else if (IEEE80211_IS_CHAN_B(ni->ni_chan)) {=0A= - sc->rxon.cck_mask =3D 0x03;=0A= - sc->rxon.ofdm_mask =3D 0;=0A= + sc->rxon->cck_mask =3D 0x03;=0A= + sc->rxon->ofdm_mask =3D 0;=0A= } else {=0A= /* Assume 802.11b/g. */=0A= - sc->rxon.cck_mask =3D 0x0f;=0A= - sc->rxon.ofdm_mask =3D 0x15;=0A= + sc->rxon->cck_mask =3D 0x0f;=0A= + sc->rxon->ofdm_mask =3D 0x15;=0A= }=0A= if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) {=0A= htflags |=3D IWN_RXON_HT_PROTMODE(ic->ic_curhtprotmode);=0A= @@ -5795,11 +6194,11 @@=0A= if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan))=0A= htflags |=3D IWN_RXON_HT_HT40MINUS;=0A= }=0A= - sc->rxon.flags |=3D htole32(htflags);=0A= - sc->rxon.filter |=3D htole32(IWN_FILTER_BSS);=0A= + sc->rxon->flags |=3D htole32(htflags);=0A= + sc->rxon->filter |=3D htole32(IWN_FILTER_BSS);=0A= DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x\n",=0A= - sc->rxon.chan, sc->rxon.flags);=0A= - error =3D iwn_cmd(sc, IWN_CMD_RXON, &sc->rxon, sc->rxonsz, 1);=0A= + sc->rxon->chan, sc->rxon->flags);=0A= + error =3D iwn_cmd(sc, IWN_CMD_RXON, sc->rxon, sc->rxonsz, 1);=0A= if (error !=3D 0) {=0A= device_printf(sc->sc_dev,=0A= "%s: could not update configuration, error %d\n", __func__,=0A= @@ -5837,7 +6236,7 @@=0A= node.htflags |=3D htole32(IWN_NODE_HT40);=0A= }=0A= DPRINTF(sc, IWN_DEBUG_STATE, "%s: adding BSS node\n", __func__);=0A= - error =3D ops->add_node(sc, &node, 1);=0A= + error =3D ops->add_node(sc, &node, 0);=0A= if (error !=3D 0) {=0A= device_printf(sc->sc_dev,=0A= "%s: could not add BSS node, error %d\n", __func__, error);=0A= @@ -5865,11 +6264,17 @@=0A= sc);=0A= =0A= /* Link LED always on while associated. */=0A= - iwn_set_led(sc, IWN_LED_LINK, 0, 1);=0A= + iwn_set_led(sc, IWN_LED_LINK, 0, 1,IWN_LED_STATIC_ON);=0A= =0A= DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);=0A= =0A= - return 0;=0A= +#ifdef IWN_DTIM_INDICATES_UNICAST_PENDING_AT_AP=0A= + return iwn_set_pslevel(sc, IWN_POWERSAVE_DTIM_VOIP_COMPATIBLE,=0A= + sc->desired_pwrsave_level, 0);=0A= +#else=0A= + return 0;=0A= +#endif=0A= +=0A= }=0A= =0A= /*=0A= @@ -6222,9 +6627,15 @@=0A= {=0A= int idx, error;=0A= =0A= - for (idx =3D 0; idx < 5; idx++) {=0A= - if (sc->calibcmd[idx].buf =3D=3D NULL)=0A= - continue; /* No results available. */=0A= + for (idx =3D 0; idx < IWN5000_PHY_CALIB_MAX_RESULT ; idx++) {=0A= + if (!(sc->base_params->calib_need & (1<calibcmd[idx].buf =3D=3D NULL) {=0A= + DPRINTF(sc, IWN_DEBUG_CALIBRATE, "Need calib idx : %d but no = available data\n",idx);=0A= + continue;=0A= + }=0A= DPRINTF(sc, IWN_DEBUG_CALIBRATE,=0A= "send calibration result idx=3D%d len=3D%d\n", idx,=0A= sc->calibcmd[idx].len);=0A= @@ -6356,6 +6767,32 @@=0A= return 0;=0A= }=0A= =0A= +static int=0A= +iwn5000_temp_offset_calibv2(struct iwn_softc *sc)=0A= +{=0A= + struct iwn5000_phy_calib_temp_offsetv2 cmd;=0A= +=0A= + memset(&cmd, 0, sizeof cmd);=0A= + cmd.code =3D IWN5000_PHY_CALIB_TEMP_OFFSET;=0A= + cmd.ngroups =3D 1;=0A= + cmd.isvalid =3D 1;=0A= + if (sc->eeprom_temp !=3D 0) {=0A= + cmd.offset_low =3D htole16(sc->eeprom_temp);=0A= + cmd.offset_high =3D htole16(sc->eeprom_temp_high);=0A= + } else {=0A= + cmd.offset_low =3D htole16(IWN_DEFAULT_TEMP_OFFSET);=0A= + cmd.offset_high =3D htole16(IWN_DEFAULT_TEMP_OFFSET);=0A= + }=0A= + cmd.burnt_voltage_ref =3D htole16(sc->eeprom_voltage);=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_CALIBRATE, "setting radio sensor low offset to = %d, high offset to %d, voltage to %d\n",=0A= + le16toh(cmd.offset_low),=0A= + le16toh(cmd.offset_high),=0A= + le16toh(cmd.burnt_voltage_ref));=0A= +=0A= + return iwn_cmd(sc, IWN_CMD_PHY_CALIB, &cmd, sizeof cmd, 0);=0A= +}=0A= +=0A= /*=0A= * This function is called after the initialization or runtime firmware=0A= * notifies us of its readiness (called in a process context).=0A= @@ -6386,7 +6823,11 @@=0A= IWN_SETBITS(sc, IWN_FH_TX_CHICKEN, IWN_FH_TX_CHICKEN_SCHED_RETRY);=0A= =0A= /* Enable chain mode for all queues, except command queue. */=0A= - iwn_prph_write(sc, IWN5000_SCHED_QCHAIN_SEL, 0xfffef);=0A= + if(sc->sc_flags & IWN_FLAG_PAN_SUPPORT)=0A= + iwn_prph_write(sc, IWN5000_SCHED_QCHAIN_SEL, 0xffdff);=0A= + else=0A= + iwn_prph_write(sc, IWN5000_SCHED_QCHAIN_SEL, 0xfffef);=0A= +=0A= iwn_prph_write(sc, IWN5000_SCHED_AGGR_SEL, 0);=0A= =0A= for (qid =3D 0; qid < IWN5000_NTXQUEUES; qid++) {=0A= @@ -6406,32 +6847,29 @@=0A= /* Identify TX FIFO rings (0-7). */=0A= iwn_prph_write(sc, IWN5000_SCHED_TXFACT, 0xff);=0A= =0A= - /* Mark TX rings (4 EDCA + cmd + 2 HCCA) as active. */=0A= - for (qid =3D 0; qid < 7; qid++) {=0A= - static uint8_t qid2fifo[] =3D { 3, 2, 1, 0, 7, 5, 6 };=0A= - iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid),=0A= - IWN5000_TXQ_STATUS_ACTIVE | qid2fifo[qid]);=0A= + if(sc->sc_flags & IWN_FLAG_PAN_SUPPORT) {=0A= + /* Mark TX rings as active. */=0A= + for (qid =3D 0; qid < 11; qid++) {=0A= + static uint8_t qid2fifo[] =3D { 3, 2, 1, 0, 0, 4, 2, 5, 4, 7, 5 };=0A= + iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid),=0A= + IWN5000_TXQ_STATUS_ACTIVE | qid2fifo[qid]);=0A= + }=0A= + } else {=0A= + /* Mark TX rings (4 EDCA + cmd + 2 HCCA) as active. */=0A= + for (qid =3D 0; qid < 7; qid++) {=0A= + static uint8_t qid2fifo[] =3D { 3, 2, 1, 0, 7, 5, 6 };=0A= + iwn_prph_write(sc, IWN5000_SCHED_QUEUE_STATUS(qid),=0A= + IWN5000_TXQ_STATUS_ACTIVE | qid2fifo[qid]);=0A= + }=0A= }=0A= iwn_nic_unlock(sc);=0A= =0A= - /* Configure WiMAX coexistence for combo adapters. */=0A= - error =3D iwn5000_send_wimax_coex(sc);=0A= - if (error !=3D 0) {=0A= - device_printf(sc->sc_dev,=0A= - "%s: could not configure WiMAX coexistence, error %d\n",=0A= - __func__, error);=0A= +=0A= + if ((error=3Diwn_cfg_ucode_post_alive(sc))!=3D0) {=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end in error\n", __func__);=0A= return error;=0A= }=0A= - if (sc->hw_type !=3D IWN_HW_REV_TYPE_5150) {=0A= - /* Perform crystal calibration. */=0A= - error =3D iwn5000_crystal_calib(sc);=0A= - if (error !=3D 0) {=0A= - device_printf(sc->sc_dev,=0A= - "%s: crystal calibration failed, error %d\n",=0A= - __func__, error);=0A= - return error;=0A= - }=0A= - }=0A= +=0A= if (!(sc->sc_flags & IWN_FLAG_CALIB_DONE)) {=0A= /* Query calibration from the initialization firmware. */=0A= if ((error =3D iwn5000_query_calibration(sc)) !=3D 0) {=0A= @@ -6781,6 +7219,25 @@=0A= sc->noise_gain =3D tmp + 1;=0A= }=0A= break;=0A= + case IWN_FW_TLV_PAN:=0A= + sc->sc_flags |=3D IWN_FLAG_PAN_SUPPORT;=0A= + DPRINTF(sc, IWN_DEBUG_RESET,"PAN Support found : %d\n", 1);=0A= + break;=0A= + case IWN_FW_TLV_FLAGS :=0A= + sc->tlv_feature_flags =3D htole32(*ptr);=0A= + break;=0A= + case IWN_FW_TLV_PBREQ_MAXLEN:=0A= + case IWN_FW_TLV_RUNT_EVTLOG_PTR:=0A= + case IWN_FW_TLV_RUNT_EVTLOG_SIZE:=0A= + case IWN_FW_TLV_RUNT_ERRLOG_PTR:=0A= + case IWN_FW_TLV_INIT_EVTLOG_PTR:=0A= + case IWN_FW_TLV_INIT_EVTLOG_SIZE:=0A= + case IWN_FW_TLV_INIT_ERRLOG_PTR:=0A= + case IWN_FW_TLV_WOWLAN_INST:=0A= + case IWN_FW_TLV_WOWLAN_DATA:=0A= + DPRINTF(sc, IWN_DEBUG_RESET,=0A= + "TLV type %d reconized but not handled\n", le16toh(tlv->type));=0A= + break;=0A= default:=0A= DPRINTF(sc, IWN_DEBUG_RESET,=0A= "TLV type %d not handled\n", le16toh(tlv->type));=0A= @@ -6902,9 +7359,8 @@=0A= else=0A= IWN_CLRBITS(sc, IWN_GIO, IWN_GIO_L0S_ENA);=0A= =0A= - if (sc->hw_type !=3D IWN_HW_REV_TYPE_4965 &&=0A= - sc->hw_type <=3D IWN_HW_REV_TYPE_1000)=0A= - IWN_SETBITS(sc, IWN_ANA_PLL, IWN_ANA_PLL_INIT);=0A= + if (sc->base_params->pll_cfg_val)=0A= + IWN_SETBITS(sc, IWN_ANA_PLL, sc->base_params->pll_cfg_val);=0A= =0A= /* Wait for clock stabilization before accessing prph. */=0A= if ((error =3D iwn_clock_wait(sc)) !=3D 0)=0A= @@ -7016,13 +7472,13 @@=0A= /* Use internal power amplifier only. */=0A= IWN_WRITE(sc, IWN_GP_DRIVER, IWN_GP_DRIVER_RADIO_2X2_IPA);=0A= }=0A= - if ((sc->hw_type =3D=3D IWN_HW_REV_TYPE_6050 ||=0A= - sc->hw_type =3D=3D IWN_HW_REV_TYPE_6005) && sc->calib_ver >=3D 6) = {=0A= + if (sc->base_params->additional_nic_config && sc->calib_ver >=3D 6) {=0A= /* Indicate that ROM calibration version is >=3D6. */=0A= IWN_SETBITS(sc, IWN_GP_DRIVER, IWN_GP_DRIVER_CALIB_VER6);=0A= }=0A= - if (sc->hw_type =3D=3D IWN_HW_REV_TYPE_6005)=0A= - IWN_SETBITS(sc, IWN_GP_DRIVER, IWN_GP_DRIVER_6050_1X2);=0A= + if (sc->base_params->additional_gp_drv_bit)=0A= + IWN_SETBITS(sc, IWN_GP_DRIVER, = sc->base_params->additional_gp_drv_bit);=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= return 0;=0A= }=0A= =0A= @@ -7157,7 +7613,7 @@=0A= IWN_WRITE(sc, IWN_UCODE_GP1_CLR, IWN_UCODE_GP1_RFKILL);=0A= =0A= /* Enable shadow registers. */=0A= - if (sc->hw_type >=3D IWN_HW_REV_TYPE_6000)=0A= + if (sc->base_params->shadow_reg_enable)=0A= IWN_SETBITS(sc, IWN_SHADOW_REG_CTRL, 0x800fffff);=0A= =0A= if ((error =3D ops->load_firmware(sc)) !=3D 0) {=0A= @@ -7228,6 +7684,12 @@=0A= iwn_nic_unlock(sc);=0A= }=0A= DELAY(5);=0A= +=0A= + if (sc->sc_led.led_cur_mode !=3D IWN_LED_STATIC_OFF) {=0A= + sc->sc_led.led_cur_mode =3D IWN_LED_STATIC_OFF;=0A= + iwn_set_led(sc, IWN_LED_LINK, 1, 0, IWN_LED_STATIC_OFF);=0A= + }=0A= +=0A= /* Power OFF adapter. */=0A= iwn_apm_stop(sc);=0A= }=0A= @@ -7362,6 +7824,7 @@=0A= IWN_LOCK_ASSERT(sc);=0A= =0A= sc->sc_tx_timer =3D 0;=0A= + sc->sc_scan_timer =3D 0;=0A= callout_stop(&sc->watchdog_to);=0A= callout_stop(&sc->calib_to);=0A= ifp->if_drv_flags &=3D ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);=0A= @@ -7386,10 +7849,24 @@=0A= {=0A= struct ifnet *ifp =3D ic->ic_ifp;=0A= struct iwn_softc *sc =3D ifp->if_softc;=0A= + struct ieee80211_scan_state *ss =3D ic->ic_scan;=0A= + struct ieee80211vap *vap =3D ss->ss_vap;=0A= =0A= +=0A= IWN_LOCK(sc);=0A= +=0A= + sc->uc_scan_progress =3D 1;=0A= + if(sc->ctx =3D=3D IWN_RXON_PAN_CTX)=0A= + iwn_set_pan_params(sc);=0A= +=0A= /* make the link LED blink while we're scanning */=0A= - iwn_set_led(sc, IWN_LED_LINK, 20, 2);=0A= + if (vap->iv_state !=3D IEEE80211_S_RUN) {=0A= + if(sc->sc_led.led_cur_mode !=3D IWN_LED_SLOW_BLINK) {=0A= + sc->sc_led.led_cur_mode =3D IWN_LED_SLOW_BLINK;=0A= + iwn_set_led(sc, IWN_LED_LINK, 190, 10,IWN_LED_SLOW_BLINK);=0A= + }=0A= + }=0A= +=0A= IWN_UNLOCK(sc);=0A= }=0A= =0A= @@ -7401,12 +7878,20 @@=0A= {=0A= struct ifnet *ifp =3D ic->ic_ifp;=0A= struct iwn_softc *sc =3D ifp->if_softc;=0A= - struct ieee80211vap *vap =3D TAILQ_FIRST(&ic->ic_vaps);=0A= + struct ieee80211_scan_state *ss =3D ic->ic_scan;=0A= + struct ieee80211vap *vap =3D ss->ss_vap;=0A= =0A= +=0A= IWN_LOCK(sc);=0A= +=0A= + sc->uc_scan_progress =3D 0;=0A= + sc->sc_scan_timer =3D 0;=0A= + if(sc->ctx =3D=3D IWN_RXON_PAN_CTX)=0A= + iwn_set_pan_params(sc);=0A= +=0A= if (vap->iv_state =3D=3D IEEE80211_S_RUN) {=0A= - /* Set link LED to ON status if we are associated */=0A= - iwn_set_led(sc, IWN_LED_LINK, 0, 1);=0A= + sc->sc_led.led_cur_mode =3D IWN_LED_STATIC_ON;=0A= + iwn_set_led(sc, IWN_LED_LINK, 0, 1,IWN_LED_STATIC_ON);=0A= }=0A= IWN_UNLOCK(sc);=0A= }=0A= @@ -7454,10 +7939,14 @@=0A= int error;=0A= =0A= IWN_LOCK(sc);=0A= + sc->sc_scan_timer =3D 0;=0A= error =3D iwn_scan(sc);=0A= IWN_UNLOCK(sc);=0A= - if (error !=3D 0)=0A= + if (error !=3D 0) {=0A= + sc->uc_scan_progress =3D 0;=0A= + sc->sc_scan_timer =3D 0;=0A= ieee80211_cancel_scan(vap);=0A= + }=0A= }=0A= =0A= /*=0A= @@ -7566,3 +8055,1018 @@=0A= DPRINTF(sc, IWN_DEBUG_REGISTER,"%s","\n");=0A= }=0A= #endif=0A= +=0A= +=0A= +/* Define specific configuration based on device id and subdevice id=0A= + * pid : PCI device id=0A= + */=0A= +static int=0A= +iwn_config_specific(struct iwn_softc *sc,uint16_t pid)=0A= +{=0A= + switch(pid) {=0A= +/* 1000 Series */=0A= + case IWN_DID_1000_1:=0A= + case IWN_DID_1000_2:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_1000_1:=0A= + case IWN_SDID_1000_2:=0A= + case IWN_SDID_1000_3:=0A= + case IWN_SDID_1000_4:=0A= + case IWN_SDID_1000_5:=0A= + case IWN_SDID_1000_6:=0A= + case IWN_SDID_1000_7:=0A= + case IWN_SDID_1000_8:=0A= + case IWN_SDID_1000_9:=0A= + case IWN_SDID_1000_10:=0A= + case IWN_SDID_1000_11:=0A= + case IWN_SDID_1000_12:=0A= + sc->limits =3D &iwn1000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_1000_base_params;=0A= + sc->fwname =3D "iwn1000fw";=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 6x00 Series */=0A= + case IWN_DID_6x00_2:=0A= + case IWN_DID_6x00_4:=0A= + case IWN_DID_6x00_1:=0A= + case IWN_DID_6x00_3:=0A= + sc->fwname =3D "iwn6000fw";=0A= + sc->limits =3D &iwn6000_sensitivity_limits;=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_6x00_1:=0A= + case IWN_SDID_6x00_2:=0A= + case IWN_SDID_6x00_8:=0A= + sc->base_params =3D &iwn_6000_base_params;=0A= + break;=0A= + case IWN_SDID_6x00_3:=0A= + case IWN_SDID_6x00_6:=0A= + case IWN_SDID_6x00_9:=0A= + case IWN_SDID_6x00_4:=0A= + case IWN_SDID_6x00_7:=0A= + case IWN_SDID_6x00_10:=0A= + case IWN_SDID_6x00_5:=0A= + sc->base_params =3D &iwn_6000i_base_params;=0A= + sc->sc_flags |=3D IWN_FLAG_INTERNAL_PA;=0A= + sc->txchainmask =3D IWN_ANT_BC;=0A= + sc->rxchainmask =3D IWN_ANT_BC;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 6x05 Series */=0A= + case IWN_DID_6x05_1:=0A= + case IWN_DID_6x05_2:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_6x05_1:=0A= + case IWN_SDID_6x05_4:=0A= + case IWN_SDID_6x05_6:=0A= + case IWN_SDID_6x05_2:=0A= + case IWN_SDID_6x05_5:=0A= + case IWN_SDID_6x05_7:=0A= + case IWN_SDID_6x05_3:=0A= + case IWN_SDID_6x05_8:=0A= + case IWN_SDID_6x05_9:=0A= + case IWN_SDID_6x05_10:=0A= + case IWN_SDID_6x05_11:=0A= + case IWN_SDID_6x05_12:=0A= + sc->fwname =3D "iwn6000g2afw";=0A= + sc->limits =3D &iwn6000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_6000g2_base_params;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 6x35 Series */=0A= + case IWN_DID_6035_1:=0A= + case IWN_DID_6035_2:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_6035_1:=0A= + case IWN_SDID_6035_2:=0A= + case IWN_SDID_6035_3:=0A= + case IWN_SDID_6035_4:=0A= + sc->fwname =3D "iwn6000g2bfw";=0A= + sc->limits =3D &iwn6000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_6000g2b_base_params;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 6x50 WiFi/WiMax Series */=0A= + case IWN_DID_6050_1:=0A= + case IWN_DID_6050_2:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_6050_1:=0A= + case IWN_SDID_6050_3:=0A= + case IWN_SDID_6050_5:=0A= + case IWN_SDID_6050_2:=0A= + case IWN_SDID_6050_4:=0A= + case IWN_SDID_6050_6:=0A= + sc->fwname =3D "iwn6050fw";=0A= + sc->txchainmask =3D IWN_ANT_AB;=0A= + sc->rxchainmask =3D IWN_ANT_AB;=0A= + sc->limits =3D &iwn6000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_6050_base_params;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 6150 WiFi/WiMax Series */=0A= + case IWN_DID_6150_1:=0A= + case IWN_DID_6150_2:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_6150_1:=0A= + case IWN_SDID_6150_3:=0A= + case IWN_SDID_6150_5:=0A= + case IWN_SDID_6150_2:=0A= + case IWN_SDID_6150_4:=0A= + case IWN_SDID_6150_6:=0A= + sc->fwname =3D "iwn6050fw";=0A= + sc->limits =3D &iwn6000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_6150_base_params;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 6030 Series and 1030 Series */=0A= + case IWN_DID_x030_1:=0A= + case IWN_DID_x030_2:=0A= + case IWN_DID_x030_3:=0A= + case IWN_DID_x030_4:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_x030_1:=0A= + case IWN_SDID_x030_3:=0A= + case IWN_SDID_x030_5:=0A= + case IWN_SDID_x030_2:=0A= + case IWN_SDID_x030_4:=0A= + case IWN_SDID_x030_6:=0A= + case IWN_SDID_x030_7:=0A= + case IWN_SDID_x030_10:=0A= + case IWN_SDID_x030_14:=0A= + case IWN_SDID_x030_8:=0A= + case IWN_SDID_x030_11:=0A= + case IWN_SDID_x030_15:=0A= + case IWN_SDID_x030_9:=0A= + case IWN_SDID_x030_12:=0A= + case IWN_SDID_x030_16:=0A= + case IWN_SDID_x030_13:=0A= + sc->fwname =3D "iwn6000g2bfw";=0A= + sc->limits =3D &iwn6000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_6000g2b_base_params;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 130 Series WiFi */=0A= +/* XXX: This series will need adjustement for rate=0A= + * see rx_with_siso_diversity in linux kernel=0A= + */=0A= + case IWN_DID_130_1:=0A= + case IWN_DID_130_2:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_130_1:=0A= + case IWN_SDID_130_3:=0A= + case IWN_SDID_130_5:=0A= + case IWN_SDID_130_2:=0A= + case IWN_SDID_130_4:=0A= + case IWN_SDID_130_6:=0A= + sc->fwname =3D "iwn6000g2bfw";=0A= + sc->limits =3D &iwn6000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_6000g2b_base_params;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 100 Series WiFi */=0A= + case IWN_DID_100_1:=0A= + case IWN_DID_100_2:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_100_1:=0A= + case IWN_SDID_100_2:=0A= + case IWN_SDID_100_3:=0A= + case IWN_SDID_100_4:=0A= + case IWN_SDID_100_5:=0A= + case IWN_SDID_100_6:=0A= + sc->limits =3D &iwn1000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_1000_base_params;=0A= + sc->fwname =3D "iwn100fw";=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +=0A= +/* 2x30 Series */=0A= + case IWN_DID_2x30_1:=0A= + case IWN_DID_2x30_2:=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_2x30_1:=0A= + case IWN_SDID_2x30_3:=0A= + case IWN_SDID_2x30_5:=0A= + case IWN_SDID_2x30_2:=0A= + case IWN_SDID_2x30_4:=0A= + case IWN_SDID_2x30_6:=0A= + sc->limits =3D &iwn2030_sensitivity_limits;=0A= + sc->base_params =3D &iwn2030_base_params;=0A= + sc->fwname =3D "iwn2030fw";=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 5x00 Series */=0A= + case IWN_DID_5x00_1:=0A= + case IWN_DID_5x00_2:=0A= + case IWN_DID_5x00_3:=0A= + case IWN_DID_5x00_4:=0A= + sc->limits =3D &iwn5000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_default_base_params;=0A= + sc->fwname =3D "iwn5000fw";=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_5x00_1:=0A= + case IWN_SDID_5x00_2:=0A= + case IWN_SDID_5x00_3:=0A= + case IWN_SDID_5x00_4:=0A= + case IWN_SDID_5x00_9:=0A= + case IWN_SDID_5x00_10:=0A= + case IWN_SDID_5x00_11:=0A= + case IWN_SDID_5x00_12:=0A= + case IWN_SDID_5x00_17:=0A= + case IWN_SDID_5x00_18:=0A= + case IWN_SDID_5x00_19:=0A= + case IWN_SDID_5x00_20:=0A= + sc->txchainmask =3D IWN_ANT_B;=0A= + sc->rxchainmask =3D IWN_ANT_AB;=0A= + break;=0A= + case IWN_SDID_5x00_5:=0A= + case IWN_SDID_5x00_6:=0A= + case IWN_SDID_5x00_13:=0A= + case IWN_SDID_5x00_14:=0A= + case IWN_SDID_5x00_21:=0A= + case IWN_SDID_5x00_22:=0A= + sc->txchainmask =3D IWN_ANT_B;=0A= + sc->rxchainmask =3D IWN_ANT_AB;=0A= + break;=0A= + case IWN_SDID_5x00_7:=0A= + case IWN_SDID_5x00_8:=0A= + case IWN_SDID_5x00_15:=0A= + case IWN_SDID_5x00_16:=0A= + case IWN_SDID_5x00_23:=0A= + case IWN_SDID_5x00_24:=0A= + sc->txchainmask =3D IWN_ANT_B;=0A= + sc->rxchainmask =3D IWN_ANT_AB;=0A= + break;=0A= + case IWN_SDID_5x00_25:=0A= + case IWN_SDID_5x00_26:=0A= + case IWN_SDID_5x00_27:=0A= + case IWN_SDID_5x00_28:=0A= + case IWN_SDID_5x00_29:=0A= + case IWN_SDID_5x00_30:=0A= + case IWN_SDID_5x00_31:=0A= + case IWN_SDID_5x00_32:=0A= + case IWN_SDID_5x00_33:=0A= + case IWN_SDID_5x00_34:=0A= + case IWN_SDID_5x00_35:=0A= + case IWN_SDID_5x00_36:=0A= + sc->txchainmask =3D IWN_ANT_ABC;=0A= + sc->rxchainmask =3D IWN_ANT_ABC;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= +/* 5x50 Series */=0A= + case IWN_DID_5x50_1:=0A= + case IWN_DID_5x50_2:=0A= + case IWN_DID_5x50_3:=0A= + case IWN_DID_5x50_4:=0A= + sc->limits =3D &iwn5000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_default_base_params;=0A= + sc->fwname =3D "iwn5000fw";=0A= + switch(sc->subdevice_id) {=0A= + case IWN_SDID_5x50_1:=0A= + case IWN_SDID_5x50_2:=0A= + case IWN_SDID_5x50_3:=0A= + sc->limits =3D &iwn5000_sensitivity_limits;=0A= + sc->base_params =3D &iwn_default_base_params;=0A= + sc->fwname =3D "iwn5000fw";=0A= + break;=0A= + case IWN_SDID_5x50_4:=0A= + case IWN_SDID_5x50_5:=0A= + case IWN_SDID_5x50_8:=0A= + case IWN_SDID_5x50_9:=0A= + case IWN_SDID_5x50_10:=0A= + case IWN_SDID_5x50_11:=0A= + case IWN_SDID_5x50_6:=0A= + case IWN_SDID_5x50_7:=0A= + case IWN_SDID_5x50_12:=0A= + case IWN_SDID_5x50_13:=0A= + sc->limits =3D &iwn5000_sensitivity_limits;=0A= + sc->fwname =3D "iwn5150fw";=0A= + sc->base_params =3D &iwn_5x50_base_params;=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev %d not supported (subdevice) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + break;=0A= + default:=0A= + device_printf(sc->sc_dev, "adapter type id : 0x%04x sub id : 0x%04x = rev 0x%08x not supported (device) \n",pid,sc->subdevice_id,sc->hw_type);=0A= + return ENOTSUP;=0A= + }=0A= + return 0;=0A= +}=0A= +/*=0A= + * Send IWN_CMD_GET_STATISTICS to ucode.=0A= + * @enable: activate sending statistics from uCode=0A= + * @clear : ask uCode to clear internal counter=0A= + * @async : Sync mode for command (1=3D ASYNC, 0=3DSYNC)=0A= +*/=0A= +static int=0A= +iwn_set_statistics_request(struct iwn_softc *sc,bool enable,bool = clear,int async)=0A= +{=0A= + struct iwn_statistics_cmd cmd;=0A= +=0A= + if (enable)=0A= + cmd.configuration_flags=3D clear ? IWN_STATS_CONF_CLEAR_STATS :0;=0A= + else=0A= + cmd.configuration_flags=3D IWN_STATS_CONF_DISABLE_NOTIF;=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_CALIBRATE, "%s: sending request for statistics"=0A= + " flags : 0x%x\n", __func__,cmd.configuration_flags);=0A= + return iwn_cmd(sc, IWN_CMD_GET_STATISTICS, &cmd, sizeof cmd, async ? = 1:0);=0A= +}=0A= +=0A= +static int=0A= +iwn_cfg_ucode_post_alive(struct iwn_softc *sc)=0A= +{=0A= + int error;=0A= +=0A= + /* Configure WiMAX coexistence for combo adapters. */=0A= + error =3D iwn5000_send_wimax_coex(sc);=0A= + if (error !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not configure WiMAX coexistence, error %d\n",=0A= + __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + if (!(sc->base_params->no_crystal_calibration)) {=0A= + DPRINTF(sc, IWN_DEBUG_RESET, "Doing calib in %s\n",__func__);=0A= + error =3D iwn5000_crystal_calib(sc);=0A= + if (error !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: crystal calibration failed, error %d\n",=0A= + __func__, error);=0A= + return error;=0A= + }=0A= + } else=0A= + DPRINTF(sc, IWN_DEBUG_RESET, "Crystal calibration disable in %s\n",=0A= + __func__);=0A= +=0A= + return 0;=0A= +}=0A= +//----------------- NEW----------------------=0A= +/*=0A= + * Handles ioctl change requests for power management state etc.=0A= + */=0A= +static int iwn_iv_reset(struct ieee80211vap *vap, u_long cmd)=0A= +{=0A= + int error =3D 0;=0A= + switch (cmd) {=0A= + case IEEE80211_IOC_POWERSAVE:{=0A= + struct iwn_softc * sc =3D (struct iwn_softc *)=0A= + (vap->iv_ic->ic_ifp->if_softc);=0A= + IWN_LOCK(sc);=0A= +=0A= + /* XXX to discuss */=0A= + int dtim =3D IWN_POWERSAVE_DTIM_VOIP_COMPATIBLE;=0A= +=0A= + int async =3D 0;=0A= +=0A= + /*=0A= + * At present the powersave level is set to 0 (receiver=0A= + * continuously on) if power save is disabled, and set to=0A= + * IWN_POWERSAVE_LVL_VOIP_COMPATIBLE otherwise.=0A= + * Later the power levels 0-5 could be exposed to the user.=0A= + */=0A= + if (vap->iv_flags & IEEE80211_F_PMGTON) {=0A= + /*=0A= + * In ieee80211_vap_setup() we have:=0A= + * vap->iv_flags =3D ic->ic_flags;=0A= + * i.e. any vap's iv_flags initialize to ic->ic_flags.=0A= + * Setting the flags on ic will allow a vap to get=0A= + * the correct powersave level once it is created.=0A= + */=0A= + vap->iv_ic->ic_flags |=3D IEEE80211_F_PMGTON;=0A= + sc->desired_pwrsave_level =3D=0A= + IWN_POWERSAVE_LVL_VOIP_COMPATIBLE;=0A= + } else {=0A= + vap->iv_ic->ic_flags &=3D ~IEEE80211_F_PMGTON;=0A= + sc->desired_pwrsave_level =3D IWN_POWERSAVE_LVL_NONE;=0A= + }=0A= + error =3D iwn_set_pslevel(sc, dtim, sc->desired_pwrsave_level,=0A= + async);=0A= + IWN_UNLOCK(sc);=0A= + }=0A= + break;=0A= + default:=0A= + /*=0A= + * For unhandled ioctls, ENETRESET has to be passed back to=0A= + * net80211 layer, which will in turn call the function to=0A= + * reinitialize the entire device.=0A= + */=0A= + error =3D ENETRESET;=0A= + break;=0A= + }=0A= + return error;=0A= +}=0A= +=0A= +static int=0A= +iwn_newstate_u1(struct ieee80211vap *vap, enum ieee80211_state nstate, = int arg)=0A= +{=0A= + struct iwn_vap *ivp =3D IWN_VAP(vap);=0A= + struct ieee80211com *ic =3D vap->iv_ic;=0A= + struct iwn_softc *sc =3D ic->ic_ifp->if_softc;=0A= +=0A= + int error =3D 0;=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_STATE, "%s: %s -> %s\n", __func__,=0A= + ieee80211_state_name[vap->iv_state], ieee80211_state_name[nstate]);=0A= +=0A= + IEEE80211_UNLOCK(ic);=0A= + IWN_LOCK(sc);=0A= + callout_stop(&sc->calib_to);=0A= +=0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_PAN_CTX];=0A= +=0A= + switch (nstate) {=0A= + case IEEE80211_S_ASSOC:=0A= + if (vap->iv_state !=3D IEEE80211_S_RUN)=0A= + break;=0A= + /* FALLTHROUGH */=0A= + case IEEE80211_S_AUTH:=0A= + if (vap->iv_state =3D=3D IEEE80211_S_AUTH)=0A= + break;=0A= +=0A= + /*=0A= + * !AUTH -> AUTH transition requires state reset to handle=0A= + * reassociations correctly.=0A= + */=0A= + sc->rxon->associd =3D 0;=0A= + sc->rxon->filter &=3D ~htole32(IWN_FILTER_BSS);=0A= + sc->calib.state =3D IWN_CALIB_STATE_INIT;=0A= +=0A= + if ((error =3D iwn_auth_u1(sc, vap)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not move to auth state\n", __func__);=0A= + }=0A= + break;=0A= +=0A= + case IEEE80211_S_SCAN:=0A= +=0A= +=0A= + if ((error =3D iwn_set_timing_u1(sc)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: iwn_set_timing_u1 error %d\n", __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + break;=0A= +=0A= + case IEEE80211_S_RUN:=0A= +=0A= + /*=0A= + * RUN -> RUN transition; Just restart the timers.=0A= + */=0A= + if (vap->iv_state =3D=3D IEEE80211_S_RUN) {=0A= + sc->calib_cnt =3D 0;=0A= + break;=0A= + }=0A= +=0A= + /*=0A= + * !RUN -> RUN requires setting the association id=0A= + * which is done with a firmware cmd. We also defer=0A= + * starting the timers until that work is done.=0A= + */=0A= + if ((error =3D iwn_run_u1(sc, vap)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not move to run state\n", __func__);=0A= + }=0A= + break;=0A= +=0A= + case IEEE80211_S_INIT:=0A= + sc->calib.state =3D IWN_CALIB_STATE_INIT;=0A= + break;=0A= +=0A= + default:=0A= + break;=0A= + }=0A= + IWN_UNLOCK(sc);=0A= + IEEE80211_LOCK(ic);=0A= + if (error !=3D 0) {=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end in error\n", __func__);=0A= + return error;=0A= + }=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= + return ivp->iv_newstate(vap, nstate, arg);=0A= +}=0A= +=0A= +static int=0A= +iwn_auth_u1(struct iwn_softc *sc, struct ieee80211vap *vap)=0A= +{=0A= + struct iwn_ops *ops =3D &sc->ops;=0A= + struct ifnet *ifp =3D sc->sc_ifp;=0A= + struct ieee80211com *ic =3D ifp->if_l2com;=0A= + struct ieee80211_node *ni =3D vap->iv_bss;=0A= + int error;=0A= + struct iwn_vap *ivp =3D IWN_VAP(vap);=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= +=0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_PAN_CTX];=0A= + IEEE80211_ADDR_COPY(sc->rxon->myaddr, ivp->macaddr);=0A= + IEEE80211_ADDR_COPY(sc->rxon->wlap, IF_LLADDR(ifp));=0A= + /* Update adapter configuration. */=0A= + IEEE80211_ADDR_COPY(sc->rxon->bssid, ni->ni_bssid);=0A= + sc->rxon->chan =3D ieee80211_chan2ieee(ic, ni->ni_chan);=0A= + sc->rxon->flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A= + if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= + if (ic->ic_flags & IEEE80211_F_SHSLOT)=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_SHSLOT);=0A= + if (ic->ic_flags & IEEE80211_F_SHPREAMBLE)=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_SHPREAMBLE);=0A= + if (IEEE80211_IS_CHAN_A(ni->ni_chan)) {=0A= + sc->rxon->cck_mask =3D 0;=0A= + sc->rxon->ofdm_mask =3D 0x15;=0A= + } else if (IEEE80211_IS_CHAN_B(ni->ni_chan)) {=0A= + sc->rxon->cck_mask =3D 0x03;=0A= + sc->rxon->ofdm_mask =3D 0;=0A= + } else {=0A= + /* Assume 802.11b/g. */=0A= + sc->rxon->cck_mask =3D 0x0f;=0A= + sc->rxon->ofdm_mask =3D 0x15;=0A= + }=0A= + DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x cck %x ofdm %x\n",=0A= + sc->rxon->chan, sc->rxon->flags, sc->rxon->cck_mask,=0A= + sc->rxon->ofdm_mask);=0A= + sc->rxon->mode =3D IWN_MODE_2STA;=0A= + error =3D iwn_cmd(sc, IWN_CMD_WIPAN_RXON, sc->rxon, sc->rxonsz, 0);=0A= + if (error !=3D 0) {=0A= + device_printf(sc->sc_dev, "%s: RXON command failed, error %d\n",=0A= + __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + /* Configuration has changed, set TX power accordingly. */=0A= + if ((error =3D ops->set_txpower(sc, ni->ni_chan, 1)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not set TX power, error %d\n", __func__, error);=0A= + return error;=0A= + }=0A= + /*=0A= + * Reconfiguring RXON clears the firmware nodes table so we must=0A= + * add the broadcast node again.=0A= + */=0A= + if ((error =3D iwn_add_broadcast_node_u1(sc, 0)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not add broadcast node, error %d\n", __func__,=0A= + error);=0A= + return error;=0A= + }=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= +=0A= + return 0;=0A= +}=0A= +=0A= +static int=0A= +iwn_run_u1(struct iwn_softc *sc, struct ieee80211vap *vap)=0A= +{=0A= + struct iwn_ops *ops =3D &sc->ops;=0A= + struct ifnet *ifp =3D sc->sc_ifp;=0A= + struct ieee80211com *ic =3D ifp->if_l2com;=0A= + struct ieee80211_node *ni =3D vap->iv_bss;=0A= + struct iwn_node_info node;=0A= + uint32_t htflags =3D 0;=0A= + int error;=0A= + struct iwn_vap *ivp =3D IWN_VAP(vap);=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= +=0A= + if (ic->ic_opmode =3D=3D IEEE80211_M_MONITOR) {=0A= + /* Link LED blinks while monitoring. */=0A= + return 0;=0A= + }=0A= +=0A= + if ((error =3D iwn_set_timing_u1(sc)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not set timing, error %d\n", __func__, error);=0A= + }=0A= +=0A= + if ((error =3D iwn_updateedca_u1(ic)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: iwn_updateedca_u1, error %d\n", __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_PAN_CTX];=0A= + IEEE80211_ADDR_COPY(sc->rxon->myaddr, ivp->macaddr);=0A= + IEEE80211_ADDR_COPY(sc->rxon->wlap, IF_LLADDR(ifp));=0A= + /* Update adapter configuration. */=0A= + IEEE80211_ADDR_COPY(sc->rxon->bssid, ni->ni_bssid);=0A= + sc->rxon->associd =3D htole16(IEEE80211_AID(ni->ni_associd));=0A= + sc->rxon->chan =3D ieee80211_chan2ieee(ic, ni->ni_chan);=0A= + sc->rxon->flags =3D htole32(IWN_RXON_TSF | IWN_RXON_CTS_TO_SELF);=0A= + if (IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= + if (ic->ic_flags & IEEE80211_F_SHSLOT)=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_SHSLOT);=0A= + if (ic->ic_flags & IEEE80211_F_SHPREAMBLE)=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_SHPREAMBLE);=0A= + if (IEEE80211_IS_CHAN_A(ni->ni_chan)) {=0A= + sc->rxon->cck_mask =3D 0;=0A= + sc->rxon->ofdm_mask =3D 0x15;=0A= + } else if (IEEE80211_IS_CHAN_B(ni->ni_chan)) {=0A= + sc->rxon->cck_mask =3D 0x03;=0A= + sc->rxon->ofdm_mask =3D 0;=0A= + } else {=0A= + /* Assume 802.11b/g. */=0A= + sc->rxon->cck_mask =3D 0x0f;=0A= + sc->rxon->ofdm_mask =3D 0x15;=0A= + }=0A= + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) {=0A= + htflags |=3D IWN_RXON_HT_PROTMODE(ic->ic_curhtprotmode);=0A= + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) {=0A= + switch (ic->ic_curhtprotmode) {=0A= + case IEEE80211_HTINFO_OPMODE_HT20PR:=0A= + htflags |=3D IWN_RXON_HT_MODEPURE40;=0A= + break;=0A= + default:=0A= + htflags |=3D IWN_RXON_HT_MODEMIXED;=0A= + break;=0A= + }=0A= + }=0A= + if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan))=0A= + htflags |=3D IWN_RXON_HT_HT40MINUS;=0A= + }=0A= + sc->rxon->flags |=3D htole32(htflags);=0A= + sc->rxon->filter |=3D htole32(IWN_FILTER_BSS);=0A= + DPRINTF(sc, IWN_DEBUG_STATE, "rxon chan %d flags %x\n",=0A= + sc->rxon->chan, sc->rxon->flags);=0A= + sc->rxon->mode =3D IWN_MODE_2STA;=0A= + error =3D iwn_cmd(sc, IWN_CMD_WIPAN_RXON, sc->rxon, sc->rxonsz, 0);=0A= + if (error !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not update configuration, error %d\n", __func__,=0A= + error);=0A= + return error;=0A= + }=0A= +=0A= + /* Configuration has changed, set TX power accordingly. */=0A= + if ((error =3D ops->set_txpower(sc, ni->ni_chan, 1)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not set TX power, error %d\n", __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + /* Fake a join to initialize the TX rate. */=0A= + ((struct iwn_node *)ni)->id =3D IWN_STA_ID;=0A= + iwn_newassoc(ni, 1);=0A= +=0A= + /* Add BSS node. */=0A= + memset(&node, 0, sizeof node);=0A= + node.htflags |=3D htole32(IWN_STA_FLAG_PAN_STATION);=0A= + IEEE80211_ADDR_COPY(node.macaddr, ni->ni_macaddr);=0A= + node.id =3D IWN_STA_ID;=0A= + if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) {=0A= + switch (ni->ni_htcap & IEEE80211_HTCAP_SMPS) {=0A= + case IEEE80211_HTCAP_SMPS_ENA:=0A= + node.htflags |=3D htole32(IWN_SMPS_MIMO_DIS);=0A= + break;=0A= + case IEEE80211_HTCAP_SMPS_DYNAMIC:=0A= + node.htflags |=3D htole32(IWN_SMPS_MIMO_PROT);=0A= + break;=0A= + }=0A= + node.htflags |=3D htole32(IWN_AMDPU_SIZE_FACTOR(3) |=0A= + IWN_AMDPU_DENSITY(5)); /* 4us */=0A= + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan))=0A= + node.htflags |=3D htole32(IWN_NODE_HT40);=0A= + }=0A= + DPRINTF(sc, IWN_DEBUG_STATE, "%s: adding BSS node1\n", __func__);=0A= + error =3D ops->add_node(sc, &node, 0);=0A= + if (error !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: could not add BSS node1, error %d\n", __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + /* Setting the initial rate for node */=0A= + ni->ni_txrate =3D ni->ni_rates.rs_rates[0];=0A= +=0A= + /* XXX: init rate scaling */=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= +=0A= + #ifdef IWN_DTIM_INDICATES_UNICAST_PENDING_AT_AP=0A= + return iwn_set_pslevel(sc, IWN_POWERSAVE_DTIM_VOIP_COMPATIBLE,=0A= + sc->desired_pwrsave_level, 0);=0A= + #else=0A= + return 0;=0A= + #endif=0A= +=0A= +}=0A= +=0A= +static int=0A= +iwn_set_timing_u1(struct iwn_softc *sc)=0A= +{=0A= + struct iwn_cmd_timing cmd;=0A= + int error =3D 0;=0A= + struct ieee80211vap *vap;=0A= + struct iwn_vap *ivp;=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= +=0A= + vap =3D sc->ivap[IWN_RXON_PAN_CTX];=0A= + ivp =3D IWN_VAP(vap);=0A= +=0A= + if ((error =3D iwn_config_u1(sc)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: iwn_config1 error %d\n", __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + if ((error =3D iwn_set_pan_params(sc)) !=3D 0) {=0A= + device_printf(sc->sc_dev,=0A= + "%s: iwn_set_pan_params error %d\n", __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + memset(&cmd, 0, sizeof cmd);=0A= + cmd.lintval =3D htole16(10);=0A= + cmd.bintval =3D htole16(IWN_BEACON_INTERVAL_DEFAULT);=0A= + ivp->beacon_int =3D cmd.bintval;=0A= + cmd.binitval =3D htole32(0x032000);=0A= + cmd.dtim_period =3D 1;=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= +=0A= + return iwn_cmd(sc, IWN_CMD_WIPAN_RXON_TIMING, &cmd, sizeof cmd, 0);=0A= +}=0A= +=0A= +static int=0A= +iwn_config_u1(struct iwn_softc *sc)=0A= +{=0A= + struct ifnet *ifp =3D sc->sc_ifp;=0A= + struct ieee80211com *ic =3D ifp->if_l2com;=0A= + uint16_t rxchain;=0A= + int error;=0A= + struct ieee80211vap *vap =3D sc->ivap[IWN_RXON_PAN_CTX];=0A= + struct iwn_vap *ivp =3D IWN_VAP(vap);=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= +=0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_PAN_CTX];=0A= + IEEE80211_ADDR_COPY(sc->rxon->myaddr, ivp->macaddr);=0A= + IEEE80211_ADDR_COPY(sc->rxon->wlap, IF_LLADDR(ifp));=0A= + sc->rxon->chan =3D ieee80211_chan2ieee(ic, ic->ic_curchan);=0A= + sc->rxon->flags =3D htole32(IWN_RXON_TSF);=0A= + if (IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan))=0A= + sc->rxon->flags |=3D htole32(IWN_RXON_AUTO | IWN_RXON_24GHZ);=0A= + sc->rxon->mode =3D IWN_MODE_P2P;=0A= + sc->rxon->filter =3D htole32(IWN_FILTER_MULTICAST);=0A= + sc->rxon->cck_mask =3D 0x0f; /* not yet negotiated */=0A= + sc->rxon->ofdm_mask =3D 0xff; /* not yet negotiated */=0A= + sc->rxon->ht_single_mask =3D 0xff;=0A= + sc->rxon->ht_dual_mask =3D 0xff;=0A= + sc->rxon->ht_triple_mask =3D 0xff;=0A= + rxchain =3D=0A= + IWN_RXCHAIN_VALID(sc->rxchainmask) |=0A= + IWN_RXCHAIN_MIMO_COUNT(2) |=0A= + IWN_RXCHAIN_IDLE_COUNT(2);=0A= + sc->rxon->rxchain =3D htole16(rxchain);=0A= + sc->rxon->associd =3D 0;=0A= + sc->rxon->filter &=3D ~htole32(IWN_FILTER_BSS);=0A= +=0A= + error =3D iwn_cmd(sc, IWN_CMD_WIPAN_RXON, sc->rxon, sc->rxonsz, 0);=0A= + if (error !=3D 0) {=0A= + device_printf(sc->sc_dev, "%s: IWN_CMD_WIPAN_RXON command failed\n",=0A= + __func__);=0A= + return error;=0A= + }=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= +=0A= + return 0;=0A= +}=0A= +=0A= +static int=0A= +iwn_set_pan_params(struct iwn_softc *sc)=0A= +{=0A= + struct iwn_pan_params_cmd cmd;=0A= + int slot0 =3D 300, slot1 =3D 0;=0A= + int bcnint;=0A= + int error =3D 0;=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= +=0A= + /*=0A= + * If the PAN context is inactive, then we don't need=0A= + * to update the PAN parameters=0A= + */=0A= + if (sc->ctx !=3D IWN_RXON_PAN_CTX) {=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end with no need to do that\n", = __func__);=0A= + return 0;=0A= + }=0A= +=0A= + memset(&cmd, 0, sizeof(cmd));=0A= +=0A= + /* only 2 slots are currently allowed */=0A= + cmd.num_slots =3D 2;=0A= +=0A= + cmd.slots[0].type =3D IWN_RXON_BSS_CTX; /* BSS */=0A= + cmd.slots[1].type =3D IWN_RXON_PAN_CTX; /* PAN */=0A= +=0A= + cmd.flags |=3D htole16(IWN_PAN_PARAMS_FLG_SLOTTED_MODE);=0A= + bcnint =3D IWN_BEACON_INTERVAL_DEFAULT;=0A= + slot0 =3D (bcnint >> 1);=0A= + slot1 =3D (bcnint - slot0);=0A= +=0A= + if(sc->uc_scan_progress =3D=3D 1) {=0A= + slot0 =3D bcnint * 3 - IWN_SLOT_TIME_MIN;=0A= + slot1 =3D IWN_SLOT_TIME_MIN;=0A= + }=0A= + cmd.slots[0].time =3D htole16(slot0);=0A= + cmd.slots[1].time =3D htole16(slot1);=0A= +=0A= + error =3D iwn_cmd(sc, IWN_CMD_WIPAN_PARAMS, &cmd, sizeof(cmd), 0);=0A= + if (error !=3D 0) {=0A= + device_printf(sc->sc_dev, "%s: IWN_CMD_WIPAN_PARAMS command failed, = error %d\n",=0A= + __func__, error);=0A= + return error;=0A= + }=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= +=0A= + return 0;=0A= +}=0A= +=0A= +static int=0A= +iwn_updateedca_u1(struct ieee80211com *ic)=0A= +{=0A= +#define IWN_EXP2(x) ((1 << (x)) - 1) /* CWmin =3D 2^ECWmin - 1 */=0A= + struct iwn_softc *sc =3D ic->ic_ifp->if_softc;=0A= + struct iwn_edca_params cmd;=0A= + int aci;=0A= +=0A= + memset(&cmd, 0, sizeof cmd);=0A= + cmd.flags =3D htole32(IWN_EDCA_UPDATE);=0A= + for (aci =3D 0; aci < WME_NUM_AC; aci++) {=0A= + const struct wmeParams *ac =3D=0A= + &ic->ic_wme.wme_chanParams.cap_wmeParams[aci];=0A= + cmd.ac[aci].aifsn =3D ac->wmep_aifsn;=0A= + cmd.ac[aci].cwmin =3D htole16(IWN_EXP2(ac->wmep_logcwmin));=0A= + cmd.ac[aci].cwmax =3D htole16(IWN_EXP2(ac->wmep_logcwmax));=0A= + cmd.ac[aci].txoplimit =3D=0A= + htole16(IEEE80211_TXOP_TO_US(ac->wmep_txopLimit));=0A= + }=0A= + return iwn_cmd(sc, IWN_CMD_WIPAN_QOS_PARAM, &cmd, sizeof cmd, 1);=0A= +#undef IWN_EXP2=0A= +}=0A= +=0A= +/*=0A= + * Broadcast node is used to send group-addressed and management frames.=0A= + */=0A= +static int=0A= +iwn_add_broadcast_node_u1(struct iwn_softc *sc, int async)=0A= +{=0A= + struct iwn_ops *ops =3D &sc->ops;=0A= + struct ifnet *ifp =3D sc->sc_ifp;=0A= + struct ieee80211com *ic =3D ifp->if_l2com;=0A= + struct iwn_node_info node;=0A= + struct iwn_cmd_link_quality linkq;=0A= + uint8_t txant;=0A= + int i, error;=0A= +=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s begin\n", __func__);=0A= +=0A= + sc->rxon =3D &sc->rx_on[IWN_RXON_PAN_CTX];=0A= +=0A= + memset(&node, 0, sizeof node);=0A= + IEEE80211_ADDR_COPY(node.macaddr, ifp->if_broadcastaddr);=0A= +=0A= + node.id =3D IWN_PAN_ID_BCAST;=0A= + node.htflags |=3D htole32(IWN_STA_FLAG_PAN_STATION);=0A= + DPRINTF(sc, IWN_DEBUG_RESET, "%s: adding broadcast node1\n", __func__);=0A= + if ((error =3D ops->add_node(sc, &node, async)) !=3D 0)=0A= + return error;=0A= +=0A= + /* Use the first valid TX antenna. */=0A= + txant =3D IWN_LSB(sc->txchainmask);=0A= +=0A= + memset(&linkq, 0, sizeof linkq);=0A= + linkq.id =3D IWN_PAN_ID_BCAST;=0A= + linkq.antmsk_1stream =3D txant;=0A= + linkq.antmsk_2stream =3D IWN_ANT_AB;=0A= + linkq.ampdu_max =3D 64;=0A= + linkq.ampdu_threshold =3D 3;=0A= + linkq.ampdu_limit =3D htole16(4000); /* 4ms */=0A= +=0A= + /* Use lowest mandatory bit-rate. */=0A= + if (IEEE80211_IS_CHAN_5GHZ(ic->ic_curchan))=0A= + linkq.retry[0] =3D htole32(0xd);=0A= + else=0A= + linkq.retry[0] =3D htole32(10 | IWN_RFLAG_CCK);=0A= + linkq.retry[0] |=3D htole32(IWN_RFLAG_ANT(txant));=0A= + /* Use same bit-rate for all TX retries. */=0A= + for (i =3D 1; i < IWN_MAX_TX_RETRIES; i++) {=0A= + linkq.retry[i] =3D linkq.retry[0];=0A= + }=0A= + DPRINTF(sc, IWN_DEBUG_TRACE, "->%s end\n", __func__);=0A= +=0A= + return iwn_cmd(sc, IWN_CMD_LINK_QUALITY, &linkq, sizeof linkq, async);=0A= +}=0A= +=0A= +static uint16_t=0A= +iwn_get_active_dwell(struct iwn_softc *sc, struct ieee80211_channel *c)=0A= +{=0A= + int n_probes =3D 1;=0A= +=0A= + if (IEEE80211_IS_CHAN_5GHZ(c))=0A= + return IWN_ACTIVE_DWELL_TIME_52 +=0A= + IWN_ACTIVE_DWELL_FACTOR_52 * (n_probes + 1);=0A= + else=0A= + return IWN_ACTIVE_DWELL_TIME_24 +=0A= + IWN_ACTIVE_DWELL_FACTOR_24 * (n_probes + 1);=0A= +}=0A= +=0A= +static uint16_t=0A= +iwn_get_passive_dwell(struct iwn_softc *sc, struct ieee80211_channel *c)=0A= +{=0A= + uint8_t ctx_id =3D 0;=0A= + uint16_t beacon_int;=0A= + struct ieee80211vap *vap;=0A= + struct iwn_vap *ivp;=0A= + uint16_t dwell_time;=0A= +=0A= + dwell_time =3D (IEEE80211_IS_CHAN_2GHZ(c)) ?=0A= + IWN_PASSIVE_DWELL_BASE + IWN_PASSIVE_DWELL_TIME_24 :=0A= + IWN_PASSIVE_DWELL_BASE + IWN_PASSIVE_DWELL_TIME_52;=0A= +=0A= + for (ctx_id =3D 0; ctx_id < IWN_NUM_RXON_CTX; ctx_id++) {=0A= + vap =3D sc->ivap[ctx_id];=0A= + ivp =3D IWN_VAP(vap);=0A= + sc->rxon =3D &sc->rx_on[ctx_id];=0A= + if (!sc->rxon->associd)=0A= + continue;=0A= + beacon_int =3D ivp->beacon_int;=0A= + if (!beacon_int)=0A= + beacon_int =3D IWN_PASSIVE_DWELL_BASE;=0A= + beacon_int =3D (beacon_int * 98) / 100 - IWN_CHANNEL_TUNE_TIME * 2;=0A= + dwell_time =3D min(beacon_int, dwell_time);=0A= + if(sc->ctx !=3D IWN_RXON_PAN_CTX) break;=0A= + }=0A= +=0A= + return dwell_time;=0A= +}=0A= +static void=0A= +iwn_led_pattern(struct iwn_softc *sc)=0A= +{=0A= + int i,j;=0A= +=0A= + for(i =3D 0; i < IWN_MAX_BLINK_TBL; i++) {=0A= + if((sc->sc_led.led_last_tpt) > (blink_tbl[i].tpt * 1024 * 1024))=0A= + break;=0A= + }=0A= +=0A= + for(j =3D 0; j < IWN_MAX_BLINK_TBL; j++) {=0A= + if((sc->sc_led.led_cur_tpt) > (blink_tbl[j].tpt * 1024 * 1024))=0A= + break;=0A= + }=0A= +=0A= + if (i !=3D j)=0A= + iwn_set_led(sc, IWN_LED_LINK,blink_tbl[j].off_time,=0A= + blink_tbl[j].on_time, IWN_LED_INT_BLINK);=0A= +}=0A= +=0A= Index: if_iwnreg.h=0A= =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=0A= --- if_iwnreg.h (revision 253911)=0A= +++ if_iwnreg.h (working copy)=0A= @@ -2,6 +2,8 @@=0A= /* $OpenBSD: if_iwnreg.h,v 1.40 2010/05/05 19:41:57 damien Exp $ */=0A= =0A= /*-=0A= + * Copyright (c) 2013 Cedric GROSS =0A= + * Copyright (c) 2011 Intel Corporation=0A= * Copyright (c) 2007, 2008=0A= * Damien Bergamini =0A= *=0A= @@ -1046,8 +1048,8 @@=0A= =0A= /* Structure for command IWN_CMD_SET_CRITICAL_TEMP. */=0A= struct iwn_critical_temp {=0A= + uint32_t tempM;=0A= uint32_t reserved;=0A= - uint32_t tempM;=0A= uint32_t tempR;=0A= /* degK <-> degC conversion macros. */=0A= #define IWN_CTOK(c) ((c) + 273)=0A= @@ -1102,6 +1104,10 @@=0A= uint16_t reserved;=0A= } __packed;=0A= =0A= +/* Define maximal number of calib result send to runtime firmware=0A= + * Nota : TEMP_OFFSET count for 2 (std and v2)=0A= +*/=0A= +#define IWN5000_PHY_CALIB_MAX_RESULT 8=0A= /* Structures for command IWN_CMD_PHY_CALIB. */=0A= struct iwn_phy_calib {=0A= uint8_t code;=0A= @@ -1122,6 +1128,15 @@=0A= uint8_t isvalid;=0A= } __packed;=0A= =0A= +#define IWN_BUF_IX_PHY_CALIB_DC 0=0A= +#define IWN_BUF_IX_PHY_CALIB_LO 1=0A= +#define IWN_BUF_IX_PHY_CALIB_TX_IQ 2=0A= +#define IWN_BUF_IX_PHY_CALIB_CRYSTAL 3=0A= +#define IWN_BUF_IX_PHY_CALIB_BASE_BAND 4=0A= +#define IWN_BUF_IX_PHY_CALIB_TX_IQ_PERIODIC 5=0A= +#define IWN_BUF_IX_PHY_CALIB_TEMP_OFFSET 6=0A= +#define IWN_BUF_IX_PHY_CALIB_TEMP_OFFSETv2 7=0A= +=0A= struct iwn5000_phy_calib_crystal {=0A= uint8_t code;=0A= uint8_t group;=0A= @@ -1581,6 +1596,8 @@=0A= uint32_t len;=0A= } __packed;=0A= =0A= +#define IWN_FW_TLV_FLAGS_NEW_SCAN_BITPOS 1=0A= +=0A= #define IWN4965_FW_TEXT_MAXSZ ( 96 * 1024)=0A= #define IWN4965_FW_DATA_MAXSZ ( 40 * 1024)=0A= #define IWN5000_FW_TEXT_MAXSZ (256 * 1024)=0A= @@ -1687,7 +1704,14 @@=0A= uint8_t hi; /* high channel number */=0A= struct iwn4965_eeprom_chan_samples chans[2];=0A= } __packed;=0A= +/* ADD / MODIFY STATION Command (Op Code 18) - byte 76-18 -bit13=0A= + STA_FLAG_PAN_STATION bit:=0A= + This bit is set (1) for a station in PAN mode */=0A= +#define IWN_STA_FLAG_PAN_STATION (1 << 13)=0A= =0A= +#define IWN_BEACON_INTERVAL_DEFAULT 200=0A= +#define IWN_SLOT_TIME_MIN 20=0A= +=0A= /*=0A= * Offsets of channels descriptions in EEPROM.=0A= */=0A= @@ -1834,6 +1858,7 @@=0A= 0x62, 0x6e, 0x68, 0x62, 0x6e, 0x68, 0x62, 0x6e, 0x68, 0x62, 0x6e,=0A= 0x68, 0x62, 0x6e, 0x68, 0x62, 0x5d, 0x58, 0x53, 0x4e=0A= };=0A= +#define IWN_DTIM_INDICATES_UNICAST_PENDING_AT_AP=0A= =0A= /*=0A= * Power saving settings (values obtained from the reference driver.)=0A= @@ -1891,6 +1916,7 @@=0A= uint32_t min_energy_cck;=0A= uint32_t energy_cck;=0A= uint32_t energy_ofdm;=0A= + uint32_t min_corr_barker_mrc;=0A= };=0A= =0A= /*=0A= @@ -1917,7 +1943,8 @@=0A= 170, 400,=0A= 95,=0A= 95,=0A= - 95=0A= + 95,=0A= + 390=0A= };=0A= =0A= static const struct iwn_sensitivity_limits iwn5150_sensitivity_limits = =3D {=0A= @@ -1929,7 +1956,8 @@=0A= 170, 400,=0A= 95,=0A= 95,=0A= - 95=0A= + 95,=0A= + 390=0A= };=0A= =0A= static const struct iwn_sensitivity_limits iwn1000_sensitivity_limits = =3D {=0A= @@ -1941,7 +1969,8 @@=0A= 170, 400,=0A= 95,=0A= 95,=0A= - 95=0A= + 95,=0A= + 390=0A= };=0A= =0A= static const struct iwn_sensitivity_limits iwn6000_sensitivity_limits = =3D {=0A= @@ -1951,9 +1980,10 @@=0A= 128, 232,=0A= 125, 175,=0A= 160, 310,=0A= - 97,=0A= - 97,=0A= - 100=0A= + 110,=0A= + 110,=0A= + 110,=0A= + 336=0A= };=0A= =0A= /* Get value from linux kernel 3.2.+ in = Drivers/net/wireless/iwlwifi/iwl-2000.c*/=0A= @@ -2052,3 +2082,281 @@=0A= #define IWN_BARRIER_READ_WRITE(sc) \=0A= bus_space_barrier((sc)->sc_st, (sc)->sc_sh, 0, (sc)->sc_sz, \=0A= BUS_SPACE_BARRIER_READ | BUS_SPACE_BARRIER_WRITE)=0A= +=0A= +static const uint32_t iwn2030_regulatory_bands[IWN_NBANDS] =3D {=0A= + IWN5000_EEPROM_BAND1,=0A= + IWN5000_EEPROM_BAND2,=0A= + IWN5000_EEPROM_BAND3,=0A= + IWN5000_EEPROM_BAND4,=0A= + IWN5000_EEPROM_BAND5,=0A= + IWN6000_EEPROM_BAND6,=0A= + IWN5000_EEPROM_BAND7=0A= +};=0A= +=0A= +/* = =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=3D=3D=3D=3D=3D=3D=3D=0A= + * NIC PARAMETERS=0A= + * = =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=3D=3D=3D=3D=3D=3D=3D=0A= + */=0A= +=0A= +/* Flags for managing calibration result. See calib_need=0A= + * in iwn_base_params struct=0A= + */=0A= +#define IWN_FLG_NEED_PHY_CALIB_DC (1<<0)=0A= +#define IWN_FLG_NEED_PHY_CALIB_LO (1<<1)=0A= +#define IWN_FLG_NEED_PHY_CALIB_TX_IQ (1<<2)=0A= +#define IWN_FLG_NEED_PHY_CALIB_CRYSTAL (1<<3)=0A= +#define IWN_FLG_NEED_PHY_CALIB_BASE_BAND (1<<4)=0A= +#define IWN_FLG_NEED_PHY_CALIB_TX_IQ_PERIODIC (1<<5)=0A= +#define IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET (1<<6)=0A= +#define IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSETv2 (1<<7)=0A= +=0A= +/* Define some parameters for managing different NIC.=0A= + * Refer to linux specific file like iwl-xxxx.c to determine correct = value=0A= + * for NIC.=0A= + *=0A= + * @max_ll_items: max number of OTP blocks=0A= + * @shadow_ram_support: shadow support for OTP memory=0A= + * @led_compensation: compensate on the led on/off time per HW according=0A= + * to the deviation to achieve the desired led frequency.=0A= + * The detail algorithm is described in iwl-led.c=0A= + * @chain_noise_num_beacons: number of beacons used to compute chain = noise=0A= + * @adv_thermal_throttle: support advance thermal throttle=0A= + * @support_ct_kill_exit: support ct kill exit condition=0A= + * @support_wimax_coexist: support wimax/wifi co-exist=0A= + * @plcp_delta_threshold: plcp error rate threshold used to trigger=0A= + * radio tuning when there is a high receiving plcp error rate=0A= + * @chain_noise_scale: default chain noise scale used for gain = computation=0A= + * @wd_timeout: TX queues watchdog timeout=0A= + * @max_event_log_size: size of event log buffer size for ucode event = logging=0A= + * @shadow_reg_enable: HW shadhow register bit=0A= + * @no_idle_support: do not support idle mode=0A= + * @hd_v2: v2 of enhanced sensitivity value, used for 2000 series and up=0A= + * advanced_bt_coexist : Advanced BT management=0A= + * bt_session_2 : NIC need a new struct for configure BT coexistence. = Needed=0A= + * only if advanced_bt_coexist is true=0A= + * bt_sco_disable :=0A= + * additional_nic_config: For 6005 series=0A= + * iq_invert : ? But need it for N 2000 series=0A= + * regulatory_bands :=0A= + * enhanced_TX_power : EEPROM Has advanced TX power options. Set 'True'=0A= + * if update_enhanced_txpower =3D iwl_eeprom_enhanced_txpower=0A= + * need_temp_offset_calib : Need to compute some temp offset for = calibration.=0A= + * calib_need : Use IWN_FLG_NEED_PHY_CALIB_* flags to specify which=0A= + * calibration data ucode need. See calib_init_cfg in iwl-xxxx.c=0A= + * linux kernel file=0A= + * additional_gp_drv_bit : Specific bit to defined during nic_config=0A= + */=0A= +struct iwn_base_params {=0A= + uint32_t pll_cfg_val;=0A= + const uint16_t max_ll_items;=0A= +#define IWN_OTP_MAX_LL_ITEMS_1000 (3) /* OTP blocks for 1000 */=0A= +#define IWN_OTP_MAX_LL_ITEMS_6x00 (4) /* OTP blocks for 6x00 */=0A= +#define IWN_OTP_MAX_LL_ITEMS_6x50 (7) /* OTP blocks for 6x50 */=0A= +#define IWN_OTP_MAX_LL_ITEMS_2x00 (4) /* OTP blocks for 2x00 */=0A= + const bool shadow_ram_support;=0A= + const bool shadow_reg_enable;=0A= + const bool advanced_bt_coexist;=0A= + const bool bt_session_2;=0A= + const bool bt_sco_disable;=0A= + const bool additional_nic_config;=0A= + const uint32_t *regulatory_bands;=0A= + const bool enhanced_TX_power; /* See iwl-agn-devices.c file to=0A= + determine that(enhanced_txpower). */=0A= + const uint16_t calib_need;=0A= + const bool no_crystal_calibration; /* see no_xtal_calib in linux */=0A= + const bool support_hostap; /* Define IEEE80211_C_HOSTAP for ic_caps */=0A= + const bool no_multi_vaps; /* see iwn_vap_create */=0A= + uint8_t additional_gp_drv_bit;=0A= +};=0A= +=0A= +/* NOTA : Values with comments BEFORE are not yet used in driver */=0A= +static struct iwn_base_params iwn_default_base_params =3D {=0A= + IWN_ANA_PLL_INIT, // pll_cfg_val=0A= + 4, //max_ll_items=0A= + true, // shadow_ram_support=0A= + false, //shadow_reg_enable=0A= + false, // advanced_bt_coexist=0A= + false, // bt_session_2=0A= + true, // bt_sco_disable=0A= + false, //additional_nic_config=0A= + iwn5000_regulatory_bands, //regulatory_bands=0A= + false, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO |=0A= + IWN_FLG_NEED_PHY_CALIB_TX_IQ | IWN_FLG_NEED_PHY_CALIB_BASE_BAND ), = //calib_need=0A= + false, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, // no_multi_vaps=0A= + 0, //additional_gp_drv_bit=0A= +};=0A= +=0A= +static struct iwn_base_params iwn2030_base_params =3D {=0A= + 0, //pll_cfg_val=0A= + IWN_OTP_MAX_LL_ITEMS_2x00, //max_ll_items=0A= + true, //shadow_ram_support=0A= + false, //shadow_reg_enable=0A= + true, //advanced_bt_coexist=0A= + true, //bt_session_2=0A= + true, //bt_sco_disable=0A= + false, //additional_nic_config=0A= + iwn2030_regulatory_bands, //regulatory_bands=0A= + true, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO |=0A= + IWN_FLG_NEED_PHY_CALIB_TX_IQ | IWN_FLG_NEED_PHY_CALIB_BASE_BAND |=0A= + IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSETv2 ), //calib_need=0A= + false, //no_crystal_calibration=0A= + true, //support_hostap=0A= + false, //no_multi_vaps=0A= + IWN_GP_DRIVER_REG_BIT_RADIO_IQ_INVERT, // additional_gp_drv_bit=0A= +};=0A= +=0A= +=0A= +static struct iwn_base_params iwn_1000_base_params =3D {=0A= + IWN_ANA_PLL_INIT, //pll_cfg_val=0A= + IWN_OTP_MAX_LL_ITEMS_1000, //max_ll_items=0A= + false, //shadow_ram_support=0A= + false, //shadow_reg_enable=0A= + false, //advanced_bt_coexist=0A= + false, //bt_session_2=0A= + false, //bt_sco_disable=0A= + false, //additional_nic_config=0A= + iwn5000_regulatory_bands, //regulatory_bands=0A= + false, //enhanced_TX_power=0A= + ( IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO |=0A= + IWN_FLG_NEED_PHY_CALIB_TX_IQ | IWN_FLG_NEED_PHY_CALIB_BASE_BAND ), = //calib_need=0A= + false, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, //no_multi_vaps=0A= + 0, //additional_gp_drv_bit=0A= +};=0A= +static struct iwn_base_params iwn_6000_base_params =3D {=0A= + 0, //pll_cfg_val=0A= + IWN_OTP_MAX_LL_ITEMS_6x00, // max_ll_items=0A= + true, //shadow_ram_support=0A= + false, //shadow_reg_enable=0A= + false, // advanced_bt_coexist=0A= + false, //bt_session_2=0A= + false, //bt_sco_disable=0A= + false, //additional_nic_config=0A= + iwn6000_regulatory_bands, //regulatory_bands=0A= + true, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO |=0A= + IWN_FLG_NEED_PHY_CALIB_TX_IQ | IWN_FLG_NEED_PHY_CALIB_BASE_BAND ), = //calib_need=0A= + false, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, //no_multi_vaps=0A= + 0, //additional_gp_drv_bit=0A= +};=0A= +static struct iwn_base_params iwn_6000i_base_params =3D {=0A= + 0, //pll_cfg_val=0A= + IWN_OTP_MAX_LL_ITEMS_6x00, // max_ll_items=0A= + true, //shadow_ram_support=0A= + false, //shadow_reg_enable=0A= + false, // advanced_bt_coexist=0A= + false, //bt_session_2=0A= + true, //bt_sco_disable=0A= + false, //additional_nic_config=0A= + iwn6000_regulatory_bands, //regulatory_bands=0A= + true, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO |=0A= + IWN_FLG_NEED_PHY_CALIB_TX_IQ | IWN_FLG_NEED_PHY_CALIB_BASE_BAND ), = //calib_need=0A= + false, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, //no_multi_vaps=0A= + 0, //additional_gp_drv_bit=0A= +};=0A= +static struct iwn_base_params iwn_6000g2_base_params =3D {=0A= + 0, //pll_cfg_val=0A= + IWN_OTP_MAX_LL_ITEMS_6x00, // max_ll_items=0A= + true, //shadow_ram_support=0A= + false, //shadow_reg_enable=0A= + false, // advanced_bt_coexist=0A= + false, //bt_session_2=0A= + true, //bt_sco_disable=0A= + false, //additional_nic_config=0A= + iwn6000_regulatory_bands, //regulatory_bands=0A= + true, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO |=0A= + IWN_FLG_NEED_PHY_CALIB_TX_IQ | IWN_FLG_NEED_PHY_CALIB_BASE_BAND |=0A= + IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET ), //calib_need=0A= + false, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, //no_multi_vaps=0A= + 0, //additional_gp_drv_bit=0A= +};=0A= +static struct iwn_base_params iwn_6050_base_params =3D {=0A= + 0, //pll_cfg_val=0A= + IWN_OTP_MAX_LL_ITEMS_6x50, // max_ll_items=0A= + true, //shadow_ram_support=0A= + false, //shadow_reg_enable=0A= + false, // advanced_bt_coexist=0A= + false, //bt_session_2=0A= + true, //bt_sco_disable=0A= + true, //additional_nic_config=0A= + iwn6000_regulatory_bands, //regulatory_bands=0A= + true, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO |=0A= + IWN_FLG_NEED_PHY_CALIB_TX_IQ | IWN_FLG_NEED_PHY_CALIB_BASE_BAND |=0A= + IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET ), //calib_need=0A= + false, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, //no_multi_vaps=0A= + 0, //additional_gp_drv_bit=0A= +};=0A= +static struct iwn_base_params iwn_6150_base_params =3D {=0A= + 0, //pll_cfg_val=0A= + IWN_OTP_MAX_LL_ITEMS_6x50, // max_ll_items=0A= + true, //shadow_ram_support=0A= + false, //shadow_reg_enable=0A= + false, // advanced_bt_coexist=0A= + false, //bt_session_2=0A= + true, //bt_sco_disable=0A= + true, //additional_nic_config=0A= + iwn6000_regulatory_bands, //regulatory_bands=0A= + true, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO |=0A= + IWN_FLG_NEED_PHY_CALIB_TX_IQ | IWN_FLG_NEED_PHY_CALIB_BASE_BAND |=0A= + IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET ), //calib_need=0A= + false, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, //no_multi_vaps=0A= + IWN_GP_DRIVER_6050_1X2, //additional_gp_drv_bit=0A= +};=0A= +//IWL_DEVICE_6035 & IWL_DEVICE_6030=0A= +static struct iwn_base_params iwn_6000g2b_base_params =3D {=0A= + 0, //pll_cfg_val=0A= + IWN_OTP_MAX_LL_ITEMS_6x00, // max_ll_items=0A= + true, //shadow_ram_support=0A= + false, //shadow_reg_enable=0A= + true, // advanced_bt_coexist=0A= + false, //bt_session_2=0A= + true, //bt_sco_disable=0A= + false, //additional_nic_config=0A= + iwn6000_regulatory_bands, //regulatory_bands=0A= + true, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO |=0A= + IWN_FLG_NEED_PHY_CALIB_TX_IQ | IWN_FLG_NEED_PHY_CALIB_BASE_BAND |=0A= + IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSET ), //calib_need=0A= + false, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, //no_multi_vaps=0A= + 0, //additional_gp_drv_bit=0A= +};=0A= +static struct iwn_base_params iwn_5x50_base_params =3D {=0A= + IWN_ANA_PLL_INIT, // pll_cfg_val=0A= + 4, //max_ll_items=0A= + true, // shadow_ram_support=0A= + false, //shadow_reg_enable=0A= + false, // advanced_bt_coexist=0A= + false, // bt_session_2=0A= + true, // bt_sco_disable=0A= + false, //additional_nic_config=0A= + iwn5000_regulatory_bands, //regulatory_bands=0A= + false, //enhanced_TX_power=0A= + (IWN_FLG_NEED_PHY_CALIB_DC | IWN_FLG_NEED_PHY_CALIB_LO |=0A= + IWN_FLG_NEED_PHY_CALIB_TX_IQ | IWN_FLG_NEED_PHY_CALIB_BASE_BAND ), = //calib_need=0A= + true, //no_crystal_calibration=0A= + false, //support_hostap=0A= + true, // no_multi_vaps=0A= + 0, //additional_gp_drv_bit=0A= +};=0A= +=0A= Index: if_iwnvar.h=0A= =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=0A= --- if_iwnvar.h (revision 253911)=0A= +++ if_iwnvar.h (working copy)=0A= @@ -2,6 +2,8 @@=0A= /* $OpenBSD: if_iwnvar.h,v 1.18 2010/04/30 16:06:46 damien Exp $ */=0A= =0A= /*-=0A= + * Copyright (c) 2013 Cedric GROSS =0A= + * Copyright (c) 2011 Intel Corporation=0A= * Copyright (c) 2007, 2008=0A= * Damien Bergamini =0A= * Copyright (c) 2008 Sam Leffler, Errno Consulting=0A= @@ -18,7 +20,39 @@=0A= * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT = OF=0A= * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.=0A= */=0A= +enum iwn_rxon_ctx_id {=0A= + IWN_RXON_BSS_CTX,=0A= + IWN_RXON_PAN_CTX,=0A= + IWN_NUM_RXON_CTX=0A= +};=0A= =0A= +struct iwn_pan_slot {=0A= + uint16_t time;=0A= + uint8_t type;=0A= + uint8_t reserved;=0A= +} __packed;=0A= +=0A= +struct iwn_pan_params_cmd {=0A= + uint16_t flags;=0A= +#define IWN_PAN_PARAMS_FLG_SLOTTED_MODE (1 << 3)=0A= +=0A= + uint8_t reserved;=0A= + uint8_t num_slots;=0A= + struct iwn_pan_slot slots[10];=0A= +} __packed;=0A= +=0A= +struct iwn_led_mode=0A= +{=0A= + uint8_t led_cur_mode;=0A= + uint64_t led_cur_bt;=0A= + uint64_t led_last_bt;=0A= + uint64_t led_cur_tpt;=0A= + uint64_t led_last_tpt;=0A= + uint64_t led_bt_diff;=0A= + int led_cur_time;=0A= + int led_last_time;=0A= +};=0A= +=0A= struct iwn_rx_radiotap_header {=0A= struct ieee80211_radiotap_header wr_ihdr;=0A= uint64_t wr_tsft;=0A= @@ -140,6 +174,9 @@=0A= uint32_t energy_samples[10];=0A= u_int cur_energy_sample;=0A= uint32_t energy_cck;=0A= +=0A= + uint32_t corr_barker_mrc;=0A= + uint32_t energy_ofdm;=0A= };=0A= =0A= struct iwn_calib_info {=0A= @@ -191,6 +228,10 @@=0A= =0A= int (*iv_newstate)(struct ieee80211vap *,=0A= enum ieee80211_state, int);=0A= + int ctx;=0A= + int beacon_int;=0A= + uint8_t macaddr[IEEE80211_ADDR_LEN];=0A= +=0A= };=0A= #define IWN_VAP(_vap) ((struct iwn_vap *)(_vap))=0A= =0A= @@ -210,8 +251,11 @@=0A= #define IWN_FLAG_HAS_11N (1 << 6)=0A= #define IWN_FLAG_ENH_SENS (1 << 7)=0A= #define IWN_FLAG_ADV_BTCOEX (1 << 8)=0A= +#define IWN_FLAG_PAN_SUPPORT (1 << 9)=0A= =0A= uint8_t hw_type;=0A= + /* subdevice_id used to adjust configuration */=0A= + uint16_t subdevice_id;=0A= =0A= struct iwn_ops ops;=0A= const char *fwname;=0A= @@ -272,15 +316,20 @@=0A= int calib_cnt;=0A= struct iwn_calib_state calib;=0A= struct callout watchdog_to;=0A= -=0A= + struct callout ct_kill_exit_to;=0A= struct iwn_fw_info fw;=0A= - struct iwn_calib_info calibcmd[5];=0A= + struct iwn_calib_info calibcmd[IWN5000_PHY_CALIB_MAX_RESULT];=0A= uint32_t errptr;=0A= =0A= struct iwn_rx_stat last_rx_stat;=0A= int last_rx_valid;=0A= struct iwn_ucode_info ucode_info;=0A= - struct iwn_rxon rxon;=0A= + struct iwn_rxon rx_on[IWN_NUM_RXON_CTX];=0A= + struct iwn_rxon *rxon;=0A= + int ctx;=0A= + struct ieee80211vap *ivap[IWN_NUM_RXON_CTX];=0A= + uint8_t uc_pan_support; /*CG: PAN support */=0A= + uint8_t uc_scan_progress;=0A= uint32_t rawtemp;=0A= int temp;=0A= int noise;=0A= @@ -295,11 +344,14 @@=0A= char eeprom_domain[4];=0A= uint32_t eeprom_crystal;=0A= int16_t eeprom_temp;=0A= + int16_t eeprom_temp_high;=0A= int16_t eeprom_voltage;=0A= int8_t maxpwr2GHz;=0A= int8_t maxpwr5GHz;=0A= int8_t maxpwr[IEEE80211_CHAN_MAX];=0A= =0A= + uint32_t tlv_feature_flags;=0A= +=0A= int32_t temp_off;=0A= uint32_t int_mask;=0A= uint8_t ntxchains;=0A= @@ -309,6 +361,7 @@=0A= uint8_t chainmask;=0A= =0A= int sc_tx_timer;=0A= + int sc_scan_timer;=0A= =0A= struct ieee80211_tx_ampdu *qid2tap[IWN5000_NTXQUEUES];=0A= =0A= @@ -323,9 +376,22 @@=0A= void (*sc_addba_stop)(struct ieee80211_node *,=0A= struct ieee80211_tx_ampdu *);=0A= =0A= + struct iwn_led_mode sc_led;=0A= =0A= struct iwn_rx_radiotap_header sc_rxtap;=0A= struct iwn_tx_radiotap_header sc_txtap;=0A= +=0A= +=0A= + /* The power save level originally configured by user */=0A= + int desired_pwrsave_level;=0A= +=0A= + /* The current power save level, this may differ from the configured = value due to=0A= + * thermal throttling etc.=0A= + * */=0A= + int current_pwrsave_level;=0A= +=0A= + /* For specifique params */=0A= + struct iwn_base_params *base_params;=0A= };=0A= =0A= #define IWN_LOCK_INIT(_sc) \=0A= ------=_NextPart_000_0011_01CE904C.AB032F70-- From owner-freebsd-wireless@FreeBSD.ORG Sat Aug 3 18:19:42 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4AB8C8DC for ; Sat, 3 Aug 2013 18:19:42 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x236.google.com (mail-wg0-x236.google.com [IPv6:2a00:1450:400c:c00::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D31EB29BA for ; Sat, 3 Aug 2013 18:19:41 +0000 (UTC) Received: by mail-wg0-f54.google.com with SMTP id e12so311621wgh.9 for ; Sat, 03 Aug 2013 11:19:40 -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; bh=8Fpyx92qe+dMCOy88mzOlQoHPfj3CPoA3wLmX1IAnPM=; b=v6vH1QrMYoHBeQp24E5tAmFjkyQa9TxXJV5mxu9ONRCpt47ir+ZtyCkkv59GokUG4P sMxWet9MwtwvzYsz60qCVpRnGLIhGh3PD1suUvXWzy3K7vruJ6iYyaP7n4asga1dxOdi dF+hvfO9/7o8LbhpH6jPHTbcdhtCjp4+Hv+8yivHYY3CDDGWf7ThV+Laadkgvuf1QAz3 rkYt2nmHQ+A0H1tdf3JfSRGumwydcBSAChc44tN5bZ1Kl9sdPEhREg0Wo4z3/nv9mWWb mxIXOTvem9XY0f7milZIjnwEPdOIjBfy1fkIHb6QTbqd3u9ekwnvc+c7H6+xnP/nQRxa 7k1Q== MIME-Version: 1.0 X-Received: by 10.194.201.202 with SMTP id kc10mr8584330wjc.1.1375553980103; Sat, 03 Aug 2013 11:19:40 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Sat, 3 Aug 2013 11:19:40 -0700 (PDT) In-Reply-To: <001001ce903b$e77a5f70$b66f1e50$@info> References: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> <002d01ce8c46$a13b23d0$e3b16b70$@info> <002701ce8e03$c033f640$409be2c0$@info> <002401ce8f5f$fc5ad780$f5108680$@info> <001001ce903b$e77a5f70$b66f1e50$@info> Date: Sat, 3 Aug 2013 11:19:40 -0700 X-Google-Sender-Auth: wYCe01ljp4jiF9Ncackx2Ew3x3M Message-ID: Subject: Re: [IWN] Reviw split 2 From: Adrian Chadd To: Cedric GROSS Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Aug 2013 18:19:42 -0000 On 3 August 2013 04:23, Cedric GROSS wrote: >> Can you please post an updated diff against what's in -HEAD now? > > As requested here is full patch. Thanks! > It should. 4965 part was not impacted. But Don't you said that full patch > break your 5100 ? Yup, it is breaking it very quickly. I'll try this patch against -HEAD and see what happens. But, there's ~ 4000 lines of patch to review. Some bits are easy to merge, some bits aren't easy to merge. :) Thanks! What would you like to merge next? -adrian From owner-freebsd-wireless@FreeBSD.ORG Sat Aug 3 19:23:39 2013 Return-Path: Delivered-To: freebsd-wireless@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 430EC98B; Sat, 3 Aug 2013 19:23:39 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [IPv6:2001:41d0:8:dda6::1]) by mx1.freebsd.org (Postfix) with ESMTP id 07D962B5A; Sat, 3 Aug 2013 19:23:38 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id A077B5F7; Sat, 3 Aug 2013 21:23:36 +0200 (CEST) From: "Cedric GROSS" To: "'Adrian Chadd'" References: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> <002d01ce8c46$a13b23d0$e3b16b70$@info> <002701ce8e03$c033f640$409be2c0$@info> <002401ce8f5f$fc5ad780$f5108680$@info> <001001ce903b$e77a5f70$b66f1e50$@info> In-Reply-To: Subject: RE: [IWN] Reviw split 2 Date: Sat, 3 Aug 2013 21:23:31 +0200 Message-ID: <001e01ce907e$f1daf220$d590d660$@info> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac6QdgjjWcDsF0dqT62EkSMM8lCKBAABvIjg Content-Language: fr Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Aug 2013 19:23:39 -0000 > De=A0: adrian.chadd@gmail.com [mailto:adrian.chadd@gmail.com] De la = part > de Adrian Chadd > Envoy=E9=A0: samedi 3 ao=FBt 2013 20:20 > =C0=A0: Cedric GROSS > Cc=A0: freebsd-wireless@freebsd.org > Objet=A0: Re: [IWN] Reviw split 2 >=20 > On 3 August 2013 04:23, Cedric GROSS wrote: >=20 > >> Can you please post an updated diff against what's in -HEAD now? > > > > As requested here is full patch. >=20 > Thanks! >=20 > > It should. 4965 part was not impacted. But Don't you said that full > > patch break your 5100 ? >=20 > Yup, it is breaking it very quickly. I'll try this patch against -HEAD > and see what happens. Ok. >=20 > But, there's ~ 4000 lines of patch to review. Some bits are easy to > merge, some bits aren't easy to merge. :) >=20 It's surely in parameters part that there's a fail. May be will end by = that. > Thanks! What would you like to merge next? Prepare for context switching (the sc->rxon modification), it's still modification without adding functionality.=20 And after that, adding context switching with PAN support, should not = break your NIC. Next, may be parameter by parameter, so we will see where is break. With bapt help, I'm also pointing a problem with AMRR. With time, rate = is still decreasing because of cumulative ackfailcnt transmit to ieee80211_ratectl_tx_complete. What kind of value does this function wait ? Absolute number or relative = to the previous call ? Also, why do you send it by ref in iwn_tx_done ? >=20 > -adrian Cedric From owner-freebsd-wireless@FreeBSD.ORG Sat Aug 3 19:36:48 2013 Return-Path: Delivered-To: freebsd-wireless@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 C370CD23 for ; Sat, 3 Aug 2013 19:36:48 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-x22b.google.com (mail-we0-x22b.google.com [IPv6:2a00:1450:400c:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 566F82BBB for ; Sat, 3 Aug 2013 19:36:48 +0000 (UTC) Received: by mail-we0-f171.google.com with SMTP id q55so1428909wes.16 for ; Sat, 03 Aug 2013 12:36:46 -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; bh=Pm38EmwMiJf6t8Tq6fxGh/GZQE5tAki9Kg/AlrZ81pk=; b=bsJ+EjRX20GERHDpspHLVpKqrVxSDmn+joVi4RMatwy/ll+0maxlWRT0+p5w8q+3k2 129NIFCRsJLQhbnJJ08PRfn2oUXPXDT32HHgzaBxMXd9UrIHx6YZm8ZrGKqGFy6x/+kj nZWNSOB1N7cpgkRyAAcxWac7rawaD4944obfWXon37bEGk4NTfWFz1ziX5yK3bapmq2S tO7ZHtgRYZ6jJ1BcxeTi7zM3lnfJLxmiEOpAQHYQfry85enV9ZH76Ikhj46N1DgZh8eM 9u7rdJ5wDP/GtN6XxT0SCER+MbNnU8Ag7b8xfzD4QRkO0iKOMyMUYX4aNIf+0su8D0e8 eyOQ== MIME-Version: 1.0 X-Received: by 10.194.201.202 with SMTP id kc10mr8697040wjc.1.1375558606627; Sat, 03 Aug 2013 12:36:46 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Sat, 3 Aug 2013 12:36:46 -0700 (PDT) In-Reply-To: <001e01ce907e$f1daf220$d590d660$@info> References: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> <002d01ce8c46$a13b23d0$e3b16b70$@info> <002701ce8e03$c033f640$409be2c0$@info> <002401ce8f5f$fc5ad780$f5108680$@info> <001001ce903b$e77a5f70$b66f1e50$@info> <001e01ce907e$f1daf220$d590d660$@info> Date: Sat, 3 Aug 2013 12:36:46 -0700 X-Google-Sender-Auth: W2uCzztsqwJUOV3WITpoHh3Xu60 Message-ID: Subject: Re: [IWN] Reviw split 2 From: Adrian Chadd To: Cedric GROSS Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Aug 2013 19:36:48 -0000 Ok, why'd you change the debug print macro to check if the debug flags match the check, rather than if the debug flags are set in the check? ie (f) & (v) versus ( (f) & (v) == (v) ) ? I'd like to tidy up the debugging changes that are left in your source file before we move onto the next bits. -adrian From owner-freebsd-wireless@FreeBSD.ORG Sat Aug 3 19:43:22 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 59CABD90; Sat, 3 Aug 2013 19:43:22 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [IPv6:2001:41d0:8:dda6::1]) by mx1.freebsd.org (Postfix) with ESMTP id 1B9292BD9; Sat, 3 Aug 2013 19:43:22 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id 5168B60B; Sat, 3 Aug 2013 21:43:21 +0200 (CEST) From: "Cedric GROSS" To: "'Adrian Chadd'" References: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> <002d01ce8c46$a13b23d0$e3b16b70$@info> <002701ce8e03$c033f640$409be2c0$@info> <002401ce8f5f$fc5ad780$f5108680$@info> <001001ce903b$e77a5f70$b66f1e50$@info> <001e01ce907e$f1daf220$d590d660$@info> In-Reply-To: Subject: RE: [IWN] Reviw split 2 Date: Sat, 3 Aug 2013 21:43:15 +0200 Message-ID: <003201ce9081$b401a270$1c04e750$@info> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac6QgM4zaN939jPUTx6MEv02PZZw6gAAGQ2w Content-Language: fr Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Aug 2013 19:43:22 -0000 > De=A0: adrian.chadd@gmail.com [mailto:adrian.chadd@gmail.com] De la = part > de Adrian Chadd > Envoy=E9=A0: samedi 3 ao=FBt 2013 21:37 > =C0=A0: Cedric GROSS > Cc=A0: freebsd-wireless@freebsd.org > Objet=A0: Re: [IWN] Reviw split 2 >=20 > Ok, why'd you change the debug print macro to check if the debug flags > match the check, rather than if the debug flags are set in the check? >=20 > ie >=20 > (f) & (v) >=20 > versus > ( (f) & (v) =3D=3D (v) ) >=20 > ? It's for reducing tracing verbosity and just do trace when associate = with another IWN_DEBUG_* So if you wish to debug only XMIT, trace also print only associate with = that level (ie IWN_DEBUG_TRACE | IWN_DEBUG_XMIT) >=20 > I'd like to tidy up the debugging changes that are left in your source > file before we move onto the next bits. >=20 >=20 >=20 >=20 > -adrian From owner-freebsd-wireless@FreeBSD.ORG Sat Aug 3 19:49:43 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id CB841DD2 for ; Sat, 3 Aug 2013 19:49:43 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x22e.google.com (mail-wg0-x22e.google.com [IPv6:2a00:1450:400c:c00::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E7542BEE for ; Sat, 3 Aug 2013 19:49:43 +0000 (UTC) Received: by mail-wg0-f46.google.com with SMTP id k13so1389645wgh.13 for ; Sat, 03 Aug 2013 12:49:41 -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:message-id:subject :from:to:cc:content-type; bh=2MtzhwqTOC9Ym0zv8SBeI7j8XJmrmT6FwEQygBFW0Pg=; b=VoKa70rRnf04fcIv2G+P4SduF/6M164byIhKcezo0lAEdupErXCO0xOwQ7vwnA4ZRd 4xpFTJKIq2020k6ZJS3d+mitppREgKSRFn6dRd148eRCdm7kx/ty/JEKcMX8lACrdjOG 57RbgiGNILr8+VflQeZ7wm8k5hlttOMDp74JbOTLfUJyoln6HbojyXBnA8xvy5DNrqXd aOW0JEmo5LqgpI0j43luDW1kHzgeiSHCkdH335QgZ0v37R5PA9KgTJLKzYrf2vBaRP1f ASGUsCexhpWrNP49X4hTovnMI5pjVDgY8AuJNAq7v/oV6eBiLO9PeISuNFgbSYwqkQND dFtQ== MIME-Version: 1.0 X-Received: by 10.180.160.165 with SMTP id xl5mr2365438wib.46.1375559381638; Sat, 03 Aug 2013 12:49:41 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Sat, 3 Aug 2013 12:49:41 -0700 (PDT) In-Reply-To: <003201ce9081$b401a270$1c04e750$@info> References: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> <002d01ce8c46$a13b23d0$e3b16b70$@info> <002701ce8e03$c033f640$409be2c0$@info> <002401ce8f5f$fc5ad780$f5108680$@info> <001001ce903b$e77a5f70$b66f1e50$@info> <001e01ce907e$f1daf220$d590d660$@info> <003201ce9081$b401a270$1c04e750$@info> Date: Sat, 3 Aug 2013 12:49:41 -0700 X-Google-Sender-Auth: r4HLsznKrMTTDk3O8PxfEhXdHjQ Message-ID: Subject: Re: [IWN] Reviw split 2 From: Adrian Chadd To: Cedric GROSS Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Aug 2013 19:49:43 -0000 On 3 August 2013 12:43, Cedric GROSS wrote: >> Ok, why'd you change the debug print macro to check if the debug flags >> match the check, rather than if the debug flags are set in the check? >> >> ie >> >> (f) & (v) >> >> versus >> ( (f) & (v) == (v) ) >> >> ? > > It's for reducing tracing verbosity and just do trace when associate with > another IWN_DEBUG_* > So if you wish to debug only XMIT, trace also print only associate with that > level (ie IWN_DEBUG_TRACE | IWN_DEBUG_XMIT) Ok. I like the general idea, but I think overloading that for the general case is against POLA. Eg, ath(4), ath_hal(4), net80211(4) all have the mask idea, rather than the exact match idea. So there are cases where multiple bits are set in a debug mask (eg some INPUT and 11N flags in net80211) since they're relevant for both. So I'd like to come up with an alternative way to do trace debugging like you ask. Maybe what we should do is add a DPRINTF_TRACE() macro for things that are specifically _trace_ events, then have a separate trace bitmap for trace debugging. -adrian From owner-freebsd-wireless@FreeBSD.ORG Sat Aug 3 21:12:42 2013 Return-Path: Delivered-To: freebsd-wireless@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 C0D1CEC1; Sat, 3 Aug 2013 21:12:42 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [178.32.219.166]) by mx1.freebsd.org (Postfix) with ESMTP id 83CB32E22; Sat, 3 Aug 2013 21:12:42 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id C0BAA61C; Sat, 3 Aug 2013 23:12:40 +0200 (CEST) From: "Cedric GROSS" To: "'Adrian Chadd'" References: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> <002d01ce8c46$a13b23d0$e3b16b70$@info> <002701ce8e03$c033f640$409be2c0$@info> <002401ce8f5f$fc5ad780$f5108680$@info> <001001ce903b$e77a5f70$b66f1e50$@info> <001e01ce907e$f1daf220$d590d660$@info> <003201ce9081$b401a270$1c04e750$@info> In-Reply-To: Subject: RE: [IWN] Reviw split 2 Date: Sat, 3 Aug 2013 23:12:35 +0200 Message-ID: <003501ce908e$2e9d2750$8bd775f0$@info> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac6QgpwiK4H6n3H/QhKxoH70IF3XAgAC3+RQ Content-Language: fr Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Aug 2013 21:12:42 -0000 > -----Message d'origine----- > De=A0: adrian.chadd@gmail.com [mailto:adrian.chadd@gmail.com] De la = part > de Adrian Chadd > Envoy=E9=A0: samedi 3 ao=FBt 2013 21:50 > =C0=A0: Cedric GROSS > Cc=A0: freebsd-wireless@freebsd.org > Objet=A0: Re: [IWN] Reviw split 2 >=20 > On 3 August 2013 12:43, Cedric GROSS wrote: >=20 > >> Ok, why'd you change the debug print macro to check if the debug > >> flags match the check, rather than if the debug flags are set in = the > check? > >> > >> ie > >> > >> (f) & (v) > >> > >> versus > >> ( (f) & (v) =3D=3D (v) ) > >> > >> ? > > > > It's for reducing tracing verbosity and just do trace when associate > > with another IWN_DEBUG_* So if you wish to debug only XMIT, trace > also > > print only associate with that level (ie IWN_DEBUG_TRACE | > > IWN_DEBUG_XMIT) >=20 > Ok. I like the general idea, but I think overloading that for the > general case is against POLA. >=20 > Eg, ath(4), ath_hal(4), net80211(4) all have the mask idea, rather = than > the exact match idea. So there are cases where multiple bits are set = in > a debug mask (eg some INPUT and 11N flags in net80211) since they're > relevant for both. >=20 > So I'd like to come up with an alternative way to do trace debugging > like you ask. >=20 > Maybe what we should do is add a DPRINTF_TRACE() macro for things that > are specifically _trace_ events, then have a separate trace bitmap for > trace debugging. Ok, I'll do that. >=20 >=20 >=20 > -adrian From owner-freebsd-wireless@FreeBSD.ORG Sat Aug 3 21:21:04 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A81FA93 for ; Sat, 3 Aug 2013 21:21:04 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-x22a.google.com (mail-we0-x22a.google.com [IPv6:2a00:1450:400c:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 37CA12E4C for ; Sat, 3 Aug 2013 21:21:04 +0000 (UTC) Received: by mail-we0-f170.google.com with SMTP id w60so1484263wes.15 for ; Sat, 03 Aug 2013 14:21:02 -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; bh=7bwq7yPsHwQls7BHsyPl+IOh8lD0iYCVOCeLHax9buc=; b=KkVICvpqv/ZSt5iV4EEKCN3DG4kLC/XBeEhE6Q2YWWh1Yuy8l7oBT6xpJgZHQSc90m Y7Qpkzqs7jTyHUKZWFli1yEC54MRDgmZGJuK4J6HFoToocYbPhHeNy0kxhPeCSo5agbp KrrmJSd1KrZuK6EHL/1Y9Z/HqKxdJv8Bv2epW/ip3mdld0VEnw1/ExwsSppxhA5ZD9hj 2MQ87n1YQVG9xAlt9UqEYxLZ0kWzN84e8pxzhMYKzWMu5D1ubCC9e8Q+WwlJ5ma5Gh4r RaBlzto/MA5Ys3RUnKYZ3PbChSvDTrZnlTh//5y5PwuTBpUD2uF3jfbZr57AkQZ/nd9r QkdQ== MIME-Version: 1.0 X-Received: by 10.180.211.206 with SMTP id ne14mr2533060wic.30.1375564862478; Sat, 03 Aug 2013 14:21:02 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.94.132 with HTTP; Sat, 3 Aug 2013 14:21:02 -0700 (PDT) In-Reply-To: <003501ce908e$2e9d2750$8bd775f0$@info> References: <51f3f0ce.055a420a.2e1e.fffff220SMTPIN_ADDED_BROKEN@mx.google.com> <002d01ce8c46$a13b23d0$e3b16b70$@info> <002701ce8e03$c033f640$409be2c0$@info> <002401ce8f5f$fc5ad780$f5108680$@info> <001001ce903b$e77a5f70$b66f1e50$@info> <001e01ce907e$f1daf220$d590d660$@info> <003201ce9081$b401a270$1c04e750$@info> <003501ce908e$2e9d2750$8bd775f0$@info> Date: Sat, 3 Aug 2013 14:21:02 -0700 X-Google-Sender-Auth: McUQhP9wi2Zrd0gCJMJTWsHRhCc Message-ID: Subject: Re: [IWN] Reviw split 2 From: Adrian Chadd To: Cedric GROSS Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-wireless@freebsd.org X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Aug 2013 21:21:04 -0000 Nah, let's take it easier for now. Just leave the trace flags where they are in your diff, remove the flags check so the debug mask works the way it is, and submit a diff with _just_ the remaining debug flags line changes. That way we know what the required changes are, it will only bug people doing active testing (ie, you, me and -wireless) and we have the flags there for when we do sit down and figure out the right way to do trace debugging. Let's get these debug flags for trace in the tree, shorten the diff, and move onto the next set of structural changes. -adrian