From owner-freebsd-drivers@FreeBSD.ORG Thu Jul 26 23:11:44 2012 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 830A5106566C for ; Thu, 26 Jul 2012 23:11:44 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id 644DE8FC08 for ; Thu, 26 Jul 2012 23:11:44 +0000 (UTC) Received: from epsilon.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 0EA2CBE55; Thu, 26 Jul 2012 16:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1343344304; bh=HCipNwek4FB9FjLxR/x0IUq1XghpmslG5b6TlOGgDH8=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=pjR2vPZ9Tz7BunLtiZXm6c1hRVH+YU/RErGzaOs+BA+h0q1FihrUTGE9MPJSKUYFY ukPtVDXW8rO7F8zTF29LNTwD9leOIkul6kEuDCFPOHOBV8VbstWKtq0ZG+v1JPZMwV MOKToSleAT7ZW8XMGgT1AcovoBht4wdb5J+knewE= Message-ID: <5011CEAE.1070608@delphij.net> Date: Thu, 26 Jul 2012 16:11:42 -0700 From: Xin Li Organization: The freeBSD Project User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.5) Gecko/20120720 Thunderbird/10.0.5 MIME-Version: 1.0 To: nvangogh References: <50018B36.4000207@gmail.com> In-Reply-To: <50018B36.4000207@gmail.com> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-drivers@freebsd.org Subject: Re: Precisely what hardware information is required? X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jul 2012 23:11:44 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 07/14/12 08:07, nvangogh wrote: > Hello, I am a novice as far as FreeBSD is concerned. However, I am > interested in device driver development methodology and code. > > My question relates specifically to a particular wireless chipset > for wifi. There is currently no device driver available under > FreeBSD for the RTL 8191 SE chipset. Realtek have a web page > explaining the features of the chip in general terms. There is > source code available for certain linux distributions. Now I > understand that it would be impossible to build such source code on > FreeBSD. > > However, according to the documentation, the source code is divided > into two parts i.e : > > 1. Firmware for the chip. There is a folder that contains 7 small > files (on average 70kb) and they end with .bin.fw - I believe that > these are the files containing assembly code for the chipset. How > would one go about writing such code from scratch, with only > general information about the driver? Would it be necessary to have > technical information such as the number of registers in the > chipset and eg how they interact? Or Is there a generic codebase of > 'firmware' that will work with most wifi chipsets? What does the > firmware actually do? Normally you don't rewrite firmware (many of the times the source of firmware are not disclosed by the way). From the driver standpoint, firmwares are opaque and hides the detail of underlying hardware, generally speaking, they simplify or offload the work of the OS driver and sometimes can workaround bugs of hardware design, etc., and most firmware are loaded at the time we initialize the hardware. If you want to redistribute the driver with FreeBSD, vendor permission will be required. FreeBSD is flexible wrt firmware, as long as we can distribute the binary, it's fine. Of course, it would be nice if the vendor would agree to redistribute the firmware in source code form, however, they may have reasons to refuse it and it's not a requirement. > 2. Source code. This is written in c. At this stage I have no > questions about it. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJQEc6uAAoJEG80Jeu8UPuzJfsH+QF2HuvU4Os9tywbl1hdVJb9 vt2crOb1Yv5zX7of2yLpvA2mZsalaeGwj4v7AAsHozBBSy4q/eXy70F74W7O7IGp ta5+AEYN3lgVNxteIezCxmUu0klKLkoROrxGYKnFW+YK4hjJuwySwDwQv7xTBU4t cSbe+O3Biqu8sUCawBFHeF9DVUiOQ1AJwSrIIIBHEaCDsYRsg20sXV1PCN0ujR52 mGEa7mA/detiyoDBsBedlFZrDVVC/phkH8qrxfUDiS4/lgzYXXDdBdQ3WUyagdWV RQmVEowOvlkWqal60EYlFOJMBoNJ+h5GDoIX4YCXAM6O3+X1YLZDKPx2nPMQ9DM= =T3Z1 -----END PGP SIGNATURE-----