From owner-freebsd-current@FreeBSD.ORG Mon Mar 1 23:37:13 2010 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D7EC1065670 for ; Mon, 1 Mar 2010 23:37:13 +0000 (UTC) (envelope-from weongyo.jeong@gmail.com) Received: from mail-qy0-f194.google.com (mail-qy0-f194.google.com [209.85.221.194]) by mx1.freebsd.org (Postfix) with ESMTP id DE1E88FC19 for ; Mon, 1 Mar 2010 23:37:12 +0000 (UTC) Received: by qyk32 with SMTP id 32so1771274qyk.28 for ; Mon, 01 Mar 2010 15:37:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent:organization:x-operation-sytem; bh=1dHnWyjrQ+LSHXJgCY3d/pcZIhT26JtikzDkxDPJHdg=; b=nUfWs6yc6AwjZu+YD4iZoOAPASwLSClpeh+hWFLNgVoZgEYbn4RCJaQUq4s4rfxZKq o4EkDKxgjZxO6kwRI6mI0WnRpOee+gUM+02UeD3fBsNjtGmPlS2C5Uno9I2+HgqP4f0w aEocFosD6qX2YZHo5MIhGzWnTGcRCsIRviUTA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent:organization:x-operation-sytem; b=JAI5/7Yx45yEgkquTnCiLBjrRevnPhYWmeNPqT7lBKUoR5n8cc/kaR7X4tuGHdxxy/ 0/B29dnmWZ3IHkh4Q8GO/uZUGE53ND9Ii9tGRVZ7vSbopuSIYMkfRa7KSdO64jdWZdGn tGcBRecUObYuPQe8t1Kdrvo8uoOyZVRybSWsI= Received: by 10.224.66.144 with SMTP id n16mr2857741qai.141.1267486627215; Mon, 01 Mar 2010 15:37:07 -0800 (PST) Received: from weongyo ([174.35.1.224]) by mx.google.com with ESMTPS id 23sm2755671qyk.15.2010.03.01.15.37.05 (version=SSLv3 cipher=RC4-MD5); Mon, 01 Mar 2010 15:37:06 -0800 (PST) Received: by weongyo (sSMTP sendmail emulation); Mon, 1 Mar 2010 15:37:06 -0800 From: Weongyo Jeong Date: Mon, 1 Mar 2010 15:37:06 -0800 To: Joe Marcus Clarke Message-ID: <20100301233706.GH1295@weongyo> Mail-Followup-To: Joe Marcus Clarke , current References: <1267388668.39569.2410.camel@shumai.marcuscom.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="1ccMZA6j1vT5UqiK" Content-Disposition: inline In-Reply-To: <1267388668.39569.2410.camel@shumai.marcuscom.com> User-Agent: Mutt/1.4.2.3i Organization: CDNetworks. X-Operation-Sytem: FreeBSD Cc: current Subject: Re: Problem with new bwn driver on -CURRENT X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Weongyo Jeong List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2010 23:37:13 -0000 --1ccMZA6j1vT5UqiK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Feb 28, 2010 at 03:24:28PM -0500, Joe Marcus Clarke wrote: > I was extremely pleased to see this driver, so I could get off of the > flaky NDIS version. I have a Dell Vostra 2510 with a LP bwn mini-PCI > card. I have set if_bwn_load="YES" in /boot/loader.conf. I also have > bwn_v4_lp_ucode_load="YES" set. > > The firmware and driver loads. However, if_bwn doesn't attach to the > card. Once the OS is fully booted, I kldunload if_bwn, then reload it, > and the driver attaches just fine. This issue is reported by some people and I'm looking codes. > Once it is attached, however, I can > pass traffic just fine, but I get a large number of these messages on > the console, and the traffic rate is not what it was with the NDIS > driver: Could you please elaborate the traffic rate? You mean the traffic rate is lower or higher than NDIS driver? > > bwn0: out of bounds of the square-root table (-770884) > bwn0: out of bounds of the square-root table (-225625) > bwn0: out of bounds of the square-root table (-240100) Patch is attached with email and it'll fix this message. Could you please test with it? Was it successful to associate with AP? > When I boot with verbose mode, I only see the siba driver attach to the > card: > > siba_bwn0: mem 0xf4000000-0xf4003fff irq 19 at device 0.0 on pci6 > > My pciconf output is: > > siba_bwn0@pci0:6:0:0: class=0x028000 card=0x000b1028 chip=0x431514e4 rev=0x01 hdr=0x00 > vendor = 'Broadcom Corporation' > device = 'Broadcom Wireless b/g (BCM4315/BCM22062000)' > class = network > > When the driver does attach, I see: > > bwn0 on siba_bwn0 > bwn0: WLAN (chipid 0x4312 rev 15) PHY (analog 6 type 5 rev 1) RADIO (manuf 0x17f > bwn0: DMA (64 bits) > bwn0: MSI count : 1 > siba_bwn0: attempting to allocate 1 MSI vectors (1 supported) > msi: routing MSI IRQ 258 to local APIC 1 vector 54 > siba_bwn0: using IRQ 258 for MSI > bwn0: Using 1 MSI messages > bwn0: [MPSAFE] > bwn0: [FILTER] > bwn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps > bwn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36M > bps 48Mbps 54Mbps > wlan0: bpf attached > wlan0: bpf attached > > Am I missing anything to get this to attach at boot time? Thanks. Maybe nothing. It looks there's a bug to attach bwn on boot time. One thing FYI is that bwn(4)'s LP implementation has some problems to calibrate TX so sometimes TX speed could be unstable and fluctuate. regards, Weongyo Jeong --1ccMZA6j1vT5UqiK Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch_bwn_20100301.diff" Index: if_bwn.c =================================================================== --- if_bwn.c (revision 204437) +++ if_bwn.c (working copy) @@ -12846,7 +12846,6 @@ static unsigned int bwn_sqrt(struct bwn_mac *mac, unsigned int x) { - struct bwn_softc *sc = mac->mac_sc; /* Table holding (10 * sqrt(x)) for x between 1 and 256. */ static uint8_t sqrt_table[256] = { 10, 14, 17, 20, 22, 24, 26, 28, @@ -12886,9 +12885,11 @@ if (x == 0) return (0); if (x >= 256) { - device_printf(sc->sc_dev, - "out of bounds of the square-root table (%d)\n", x); - return (16); + unsigned int tmp; + + for (tmp = 0; x >= (2 * tmp) + 1; x -= (2 * tmp++) + 1) + /* do nothing */ ; + return (tmp); } return (sqrt_table[x - 1] / 10); } --1ccMZA6j1vT5UqiK--