From owner-freebsd-wireless@freebsd.org Sun Mar 19 02:28:27 2017 Return-Path: Delivered-To: freebsd-wireless@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72013D08CC8 for ; Sun, 19 Mar 2017 02:28:27 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06CE71300 for ; Sun, 19 Mar 2017 02:28:27 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x22e.google.com with SMTP id v203so13657174wmg.0 for ; Sat, 18 Mar 2017 19:28:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=emGM3Us6UrR1ROKfNIp8JcY0PFGp7C2xdoZrUEBi9a0=; b=KntHYU+1BrVTBh5+/WgRGOKjp4aJBiiY8gJtVGEfD6a+x+0VeOS8XZZzA8c644TJvf t6UcjXMb0y8U1iaAVhHQZIf5oXl6cazV2rWLrmyF/9VfPXQ8IOxGn+Xp150HiDuGVn5j rJa2WjvBsk2FWEEF4kAlp/8Ww0VWMBqz8Oycrx3WVLr3hmnhUlHN9F7NoRb8Nw/HXPn4 sYQQ1neVdh0zaFWw+iTToYj9OsOqI8jjVdVJKbMxKtFBaOKD3haCmf4AQSSDaMBeep4v NOll1FUXXCpNdQW1ILXCdkeHMgdle+Az/o3Ef4w89FEGdDEU7AvucdVpem0i2uHEiTDB KavQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=emGM3Us6UrR1ROKfNIp8JcY0PFGp7C2xdoZrUEBi9a0=; b=MvtbrfKrP3cuIHlzMuhiaX5slxNOR+STizgqCvD4I26+fhW+avSaYSVtUCDyPwbGwW W/5Y2xGNwKQD6xiQijD6t1QCitjeta9vHesNJdgm6mC0f+KFo7B7j1HuuEotlrDARefQ 6ftZXJtn+lRWK3t64r/OFrMmlBn5Cafx9HkhsZB98ERM8+FMao5xMTlrXi8278jyg/Hs ZBTaFNoEMbaELcwI8rfh3xHD93NzO0WUcsMbEbWU1TcpNtsC32QCD0mqd5x3ZQflFVzH XiB0aU0m1PJ3GO16lS4SmdG2XTlCdd4tj0tbvbr9ry3P6XgJT4i5WNdIe6oCu2IdhC6e m9Rw== X-Gm-Message-State: AFeK/H0BHLA36Q6hwL7ECNj85sIGg8SiHd/vUKqHTsASYe2zV0zHzbXLjj7ZWAgbNwoM7gNbaG65sVPKiA/66g== X-Received: by 10.28.220.132 with SMTP id t126mr4128565wmg.138.1489890505357; Sat, 18 Mar 2017 19:28:25 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.28.128.133 with HTTP; Sat, 18 Mar 2017 19:28:24 -0700 (PDT) In-Reply-To: References: From: Adrian Chadd Date: Sat, 18 Mar 2017 19:28:24 -0700 X-Google-Sender-Auth: EVOQVRXahP9CrE8Aa1cKIcOo_kg Message-ID: Subject: Re: Trouble writing rtl8188ee driver To: Farhan Khan Cc: Andriy Voskoboinyk , "freebsd-wireless@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.23 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, 19 Mar 2017 02:28:27 -0000 yay great progress! -adrian On 18 March 2017 at 19:26, Farhan Khan wrote: > That was it!!! Thank you! Wow! I have been on this for weeks now! My > debugging output displays as follows: > > id: 8129 > hpon: Render How? > clk: 0 > rf_board_option: 0 > rf_feature_option: 0 > rf_bt_setting: 10 > Version: 0 > customer_id: 0 > rf_antenna_option: 2 > MAC Address: 40:49:f:a9:b7:61 > vid: 10ec > did: 8179 > svid: 103c > smid: 197d > Board type: 0 > Regulatory: 0 > > However, your email might change my direction to just extend the rtl8188e > code and add the PCI bits. > This is my first time hacking the kernel and I hope to contribute back. > > Thanks again! > > -- > Farhan Khan > PGP Fingerprint: 782F 342B 5B08 0D2F F4E8 82C3 FFA1 CAE1 6536 51CA > > On Sat, Mar 18, 2017 at 7:28 PM, Andriy Voskoboinyk > wrote: > >> Sat, 18 Mar 2017 22:21:51 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Farhan Khan < >> khanzf@gmail.com>: >> >> Hi, >> >> there is no need to create an additional rtl8188ee[e] directories / file= s; >> AFAIK, rtl8188ee is just a PCI-E version of rtl8188e chipset (and rtl818= 8eu >> is an USB-based version); you should just separate pci / usb code inside >> rtl8188e directory (most of it will be the same; you can use rtl8192c as= an >> example (but you should use rtl8188eu as an template - they are somewhat >> different)) >> >> About this particular bug: you don't have RTWN_FLAG_EXT_HDR set >> (non-rtl8192c >> chipsets may contain an 'extended header' in encoded ROM image; it is >> generally used to extend maximum ROM image size over 128 bytes) >> >> Hi team, >>> >>> I'm toothe from the IRC channel. I hope you all are doing well :) Let m= e >>> tell you where I am in writing my code. In short, I am stuck and need >>> asisstance. >>> >>> I created a copy of the rtl8192c code, and placed it here: >>> https://github.com/khanzf/freebsd/tree/master/sys/dev/rtwn/rtl8188ee >>> >>> I zero'd out all functions and went one-by-one to replace them as >>> necessary. The section of code that I am stuck at is reading the >>> EEPROM/ROM >>> from the chip. I backed into the ROM image for the first 222 bytes by >>> using >>> the Linux source as documentation and created this: ( >>> https://github.com/khanzf/freebsd/blob/master/sys/dev/rtwn/ >>> rtl8188ee/r88ee_rom_image.h#L56) >>> When >>> I read from the ROM, I basically get 500~ bytes of 0xFF - the first 10 = or >>> so are set properly, suggesting that I am reading from the right memory >>> segment. Specifically, the first 2 bytes are 0x8129, which is accurate = per >>> the Linux driver. But why is everything else coming up as 0xFF's? >>> >>> I delved into how FreeBSD's rtwn and Linux's rtl8188ee drivers work. Th= e >>> efuse code is very similiar, of course, but I do not understand the >>> reasoning for what is occurring. The main difference I found, so far, w= as >>> that the Linux driver will read from EFUSE_CTRL + an offset (1, 2 or 3)= , >>> whereas the FreeBSD driver does not use an offset. >>> >>> This is where I am stuck. I would easily just change the code over to a= dd >>> the offset on the FreeBSD code, but it is in sys/dev/rtwn/if_rtwn_efuse= .c, >>> which is used by multiple drivers. >>> >>> I am unsure what is wrong or how to diagnose it. Can you please provide= me >>> some guidance? I have been stuck on this same issue for a little more t= han >>> a month. >>> >>> Thank you! >>> >>> -- >>> Farhan Khan >>> PGP Fingerprint: 782F 342B 5B08 0D2F F4E8 82C3 FFA1 CAE1 6536 51CA >>> _______________________________________________ >>> freebsd-wireless@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/freebsd-wireless >>> To unsubscribe, send any mail to "freebsd-wireless-unsubscribe@ >>> freebsd.org" >>> >> > _______________________________________________ > freebsd-wireless@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-wireless > To unsubscribe, send any mail to "freebsd-wireless-unsubscribe@freebsd.or= g"