URL
https://opencores.org/ocsvn/test_project/test_project/trunk
Subversion Repositories test_project
[/] [test_project/] [trunk/] [linux_sd_driver/] [Documentation/] [SubmittingDrivers] - Rev 62
Compare with Previous | Blame | View Log
Submitting Drivers For The Linux Kernel---------------------------------------This document is intended to explain how to submit device drivers to thevarious kernel trees. Note that if you are interested in video card driversyou should probably talk to XFree86 (http://www.xfree86.org/) and/or X.Org(http://x.org/) instead.Also read the Documentation/SubmittingPatches document.Allocating Device Numbers-------------------------Major and minor numbers for block and character devices are allocatedby the Linux assigned name and number authority (currently this isTorben Mathiasen). The site is http://www.lanana.org/. Thisalso deals with allocating numbers for devices that are not going tobe submitted to the mainstream kernel.See Documentation/devices.txt for more information on this.If you don't use assigned numbers then when your device is submitted it willbe given an assigned number even if that is different from values you mayhave shipped to customers before.Who To Submit Drivers To------------------------Linux 2.0:No new drivers are accepted for this kernel tree.Linux 2.2:No new drivers are accepted for this kernel tree.Linux 2.4:If the code area has a general maintainer then please submit it tothe maintainer listed in MAINTAINERS in the kernel file. If themaintainer does not respond or you cannot find the appropriatemaintainer then please contact Willy Tarreau <w@1wt.eu>.Linux 2.6:The same rules apply as 2.4 except that you should follow linux-kernelto track changes in API's. The final contact point for Linux 2.6submissions is Andrew Morton <akpm@osdl.org>.What Criteria Determine Acceptance----------------------------------Licensing: The code must be released to us under theGNU General Public License. We don't insist on any kindof exclusive GPL licensing, and if you wish the driverto be useful to other communities such as BSD you may wellwish to release under multiple licenses.See accepted licenses at include/linux/module.hCopyright: The copyright owner must agree to use of GPL.It's best if the submitter and copyright ownerare the same person/entity. If not, the name ofthe person/entity authorizing use of GPL should belisted in case it's necessary to verify the will ofthe copyright owner.Interfaces: If your driver uses existing interfaces and behaves likeother drivers in the same class it will be much more likelyto be accepted than if it invents gratuitous new ones.If you need to implement a common API over Linux and NTdrivers do it in userspace.Code: Please use the Linux style of code formatting as documentedin Documentation/CodingStyle. If you have sections of codethat need to be in other formats, for example because theyare shared with a windows driver kit and you want tomaintain them just once separate them out nicely and notethis fact.Portability: Pointers are not always 32bits, not all computers are littleendian, people do not all have floating point and youshouldn't use inline x86 assembler in your driver withoutcareful thought. Pure x86 drivers generally are not popular.If you only have x86 hardware it is hard to test portabilitybut it is easy to make sure the code can easily be madeportable.Clarity: It helps if anyone can see how to fix the driver. It helpsyou because you get patches not bug reports. If you submit adriver that intentionally obfuscates how the hardware worksit will go in the bitbucket.PM support: Since Linux is used on many portable and desktop systems, yourdriver is likely to be used on such a system and therefore itshould support basic power management by implementing, ifnecessary, the .suspend and .resume methods used during thesystem-wide suspend and resume transitions. You should verifythat your driver correctly handles the suspend and resume, butif you are unable to ensure that, please at least define the.suspend method returning the -ENOSYS ("Function notimplemented") error. You should also try to make sure that yourdriver uses as little power as possible when it's not doinganything. For the driver testing instructions seeDocumentation/power/drivers-testing.txt and for a relativelycomplete overview of the power management issues related todrivers see Documentation/power/devices.txt .Control: In general if there is active maintainance of a driver bythe author then patches will be redirected to them unlessthey are totally obvious and without need of checking.If you want to be the contact and update point for thedriver it is a good idea to state this in the comments,and include an entry in MAINTAINERS for your driver.What Criteria Do Not Determine Acceptance-----------------------------------------Vendor: Being the hardware vendor and maintaining the driver isoften a good thing. If there is a stable working driver fromother people already in the tree don't expect 'we are thevendor' to get your driver chosen. Ideally work with theexisting driver author to build a single perfect driver.Author: It doesn't matter if a large Linux company wrote the driver,or you did. Nobody has any special access to the kerneltree. Anyone who tells you otherwise isn't telling thewhole story.Resources---------Linux kernel master tree:ftp.??.kernel.org:/pub/linux/kernel/...?? == your country code, such as "us", "uk", "fr", etc.Linux kernel mailing list:linux-kernel@vger.kernel.org[mail majordomo@vger.kernel.org to subscribe]Linux Device Drivers, Third Edition (covers 2.6.10):http://lwn.net/Kernel/LDD3/ (free version)LWN.net:Weekly summary of kernel development activity - http://lwn.net/2.6 API changes:http://lwn.net/Articles/2.6-kernel-api/Porting drivers from prior kernels to 2.6:http://lwn.net/Articles/driver-porting/KernelTrap:Occasional Linux kernel articles and developer interviewshttp://kerneltrap.org/KernelNewbies:Documentation and assistance for new kernel programmershttp://kernelnewbies.org/Linux USB project:http://www.linux-usb.org/How to NOT write kernel driver by Arjan van de Ven:http://www.fenrus.org/how-to-not-write-a-device-driver-paper.pdfKernel Janitor:http://janitor.kernelnewbies.org/
