From owner-freebsd-current@FreeBSD.ORG Wed Sep 7 10:10:32 2011 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 382B5106566C for ; Wed, 7 Sep 2011 10:10:32 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id BDAA98FC12 for ; Wed, 7 Sep 2011 10:10:31 +0000 (UTC) Received: from [127.0.0.1] (kevlo@kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.3/8.14.3) with ESMTP id p87AAQTI027964; Wed, 7 Sep 2011 18:10:27 +0800 (CST) From: Kevin Lo To: Tz-Huan Huang In-Reply-To: References: Content-Type: multipart/mixed; boundary="=-8DjMLoIOJUGcuHjd8u8v" Date: Wed, 07 Sep 2011 18:10:25 +0800 Message-ID: <1315390225.3285.5.camel@esl.kevlo.org.kevlo.org> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: freebsd-current@FreeBSD.org Subject: Re: "Intel Centrino Advanced-N + WiMAX 6250" doesn't work X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Sep 2011 10:10:32 -0000 --=-8DjMLoIOJUGcuHjd8u8v Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Tz-Huan Huang wrote: > Hi, > > I have a lenovo X201s with a "Intel Centrino Advanced-N + WiMAX 6250" bundled. > The device seems recognized as iwn0 correctly but it just doesn't work. > The command "ifconfig wlan0 up scan" return immediately and nothing showed. > > Is the device not supported, or do I miss something? > Any suggestion is welcome, thanks. > > Here is some information: > > $ uname -a > FreeBSD bud 9.0-BETA2 FreeBSD 9.0-BETA2 #2: Tue Sep 6 16:50:09 CST > 2011 root@bud:/usr/obj/usr/src/sys/BUD amd64 > > dmesg -a: > http://www.csie.ntu.edu.tw/~b90093/tmp/dmesg.txt > > rc.conf: > http://www.csie.ntu.edu.tw/~b90093/tmp/rc.conf > > kldstat -v > http://www.csie.ntu.edu.tw/~b90093/tmp/kldstat.txt Please try attached patch. It seems like OpenBSD added support for 6205, but I'm not sure if it works for 6250. > Tz-Huan Kevin --=-8DjMLoIOJUGcuHjd8u8v Content-Disposition: attachment; filename="patch-iwn" Content-Type: text/x-patch; name="patch-iwn"; charset="UTF-8" Content-Transfer-Encoding: 7bit Index: sys/dev/iwn/if_iwnreg.h =================================================================== --- sys/dev/iwn/if_iwnreg.h (revision 225433) +++ sys/dev/iwn/if_iwnreg.h (working copy) @@ -739,6 +739,8 @@ struct iwn5000_calib_elem { uint32_t enable; uint32_t start; +#define IWN5000_CALIB_DC (1 << 1) + uint32_t send; uint32_t apply; uint32_t reserved; Index: sys/dev/iwn/if_iwn.c =================================================================== --- sys/dev/iwn/if_iwn.c (revision 225433) +++ sys/dev/iwn/if_iwn.c (working copy) @@ -245,6 +245,7 @@ static int iwn_set_pslevel(struct iwn_softc *, int, int, int); static int iwn_send_btcoex(struct iwn_softc *); static int iwn_send_advanced_btcoex(struct iwn_softc *); +static int iwn5000_runtime_calib(struct iwn_softc *); static int iwn_config(struct iwn_softc *); static uint8_t *ieee80211_add_ssid(uint8_t *, const uint8_t *, u_int); static int iwn_scan(struct iwn_softc *); @@ -2594,6 +2595,14 @@ return; } + /* + * XXX Differential gain calibration makes the 6005 firmware + * crap out, so skip it for now. This effectively disables + * sensitivity tuning as well. + */ + if (sc->hw_type == IWN_HW_REV_TYPE_6005) + return; + if (calib->state == IWN_CALIB_STATE_ASSOC) iwn_collect_noise(sc, &stats->rx.general); else if (calib->state == IWN_CALIB_STATE_RUN) @@ -4995,6 +5004,19 @@ } static int +iwn5000_runtime_calib(struct iwn_softc *sc) +{ + struct iwn5000_calib_config cmd; + + memset(&cmd, 0, sizeof cmd); + cmd.ucode.once.enable = 0xffffffff; + cmd.ucode.once.start = IWN5000_CALIB_DC; + DPRINTF(sc, IWN_DEBUG_CALIBRATE, + "%s: configuring runtime calibration\n", __func__); + return iwn_cmd(sc, IWN5000_CMD_CALIB_CONFIG, &cmd, sizeof(cmd), 0); +} + +static int iwn_config(struct iwn_softc *sc) { struct iwn_ops *ops = &sc->ops; @@ -5014,6 +5036,18 @@ } } + if (sc->hw_type == IWN_HW_REV_TYPE_6050 || + sc->hw_type == IWN_HW_REV_TYPE_6005) { + /* Configure runtime DC calibration. */ + error = iwn5000_runtime_calib(sc); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: could not configure runtime calibration\n", + __func__); + return error; + } + } + /* Configure valid TX chains for >=5000 Series. */ if (sc->hw_type != IWN_HW_REV_TYPE_4965) { txmask = htole32(sc->txchainmask); --=-8DjMLoIOJUGcuHjd8u8v--