From owner-freebsd-wireless@freebsd.org Sat Mar 18 20:22:12 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 6AFF3D123C4 for ; Sat, 18 Mar 2017 20:22:12 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: from mail-pg0-x22a.google.com (mail-pg0-x22a.google.com [IPv6:2607:f8b0:400e:c05::22a]) (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 389B314B9 for ; Sat, 18 Mar 2017 20:22:12 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: by mail-pg0-x22a.google.com with SMTP id g2so58238661pge.3 for ; Sat, 18 Mar 2017 13:22:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=sZQQHOiu9vb76T3UdUUCAtq745twayflYolxUJ6Kk6w=; b=kNg/2Q9DAUmPIS3glMTFmbabKefJNSnH+yNn9nJ7LjGDNVZZrh4QChh0JuzWDe2mKB Zp0qyh5QXTG8Ey1be8Zr9Guu5WkeCwxy8VE/9MPYBKITRCLOW+OkOrO55mx65IVLFb5Y jJIKhsXLIlj6Lu3gm3N8tcXwAx3hjbEx4DEcQXdA624ssNpoPVo4Dijp7Tg0wDu/Bq2k l+bJ/wj7Q8KArEl0sAn+ee0vOScnxpkADOO1X8cTqef5j1/qZ5iDW43TEj5dl/W0aCwM 12s9Fvddz7a4Vj17H189aGifywaVjS7pzaArkSFznDI/3QVBv8pMUsPBCn4YQuuXOrT+ TmPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=sZQQHOiu9vb76T3UdUUCAtq745twayflYolxUJ6Kk6w=; b=NFVWG0zczJMQHdHQuFTIQcZYHH40odBu7XWploM0skatMK5nUZ8q96YSrjU+HubhL5 oaXib9B5WRzgoFSNh0CURhdL3FMl/Vd/MHjHqL18qo8Q1VFQyf74lYpHpRyUcfOWDnAU LYviTN7Y3pJI2YWB2nIuGS8S21dHyYPBliZ3OpnCUVLj7juct9L0hFzc0derVyQgAbXX H9rC5uIKf4zeGC1YhG7I6NpQgO2V1B+oGEhtQOBFJL6mwP0+ZySqJ7QX3+1YfCV44m6N fmUp4fGFKQHzjrGCR4+ZkE3nQIPu4mXbTsnlJ6RgH9361z2KxuOpJbi4A9k/0SHxCVn3 j79Q== X-Gm-Message-State: AFeK/H00ZpQ+4gPPEptAsHv2+m1hetdpY83rz7ukIOoiSKbDTb8jdDzggXV/FFosyi+fQ3HGIYWOAM8WZytOLA== X-Received: by 10.98.66.155 with SMTP id h27mr23747770pfd.182.1489868531617; Sat, 18 Mar 2017 13:22:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.179.37 with HTTP; Sat, 18 Mar 2017 13:21:51 -0700 (PDT) From: Farhan Khan Date: Sat, 18 Mar 2017 16:21:51 -0400 Message-ID: Subject: Trouble writing rtl8188ee driver To: freebsd-wireless@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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: Sat, 18 Mar 2017 20:22:12 -0000 Hi team, I'm toothe from the IRC channel. I hope you all are doing well :) Let me 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. The 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, was 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 add 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 than a month. Thank you! -- Farhan Khan PGP Fingerprint: 782F 342B 5B08 0D2F F4E8 82C3 FFA1 CAE1 6536 51CA