Difference between revisions of "Development: Submitting Drivers"

From LinuxTVWiki
Jump to: navigation, search
(http://webdesignzones.com/PhpHostBot/sd99/images/article1035.html)
(Who To Submit Drivers To)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[http://webdesignzones.com/PhpHostBot/sd99/images/article1035.html personal protective equipment] [http://reupnetwork.com/wp-content/uploads/2007/comment-1411.html motor cycle parts] [http://reupnetwork.com/wp-content/uploads/2007/comment-1514.html homes for sale in kentucky] [http://webdesignzones.com/PhpHostBot/sd99/images/article618.html unique ceiling fans] [http://webdesignzones.com/PhpHostBot/sd99/images/article1054.html network everywhere fast ethernet 10100 network card driver]
+
The following content is a copy of the <code>/usr/src/linux/Documentation/SubmittingDrivers</code> file (modified slightly for visual presentation). A current copy can also be found online [http://lxr.linux.no/source/Documentation/SubmittingDrivers here].
This article is intended to explain how to submit device drivers to the various development trees of the Linux kernel. Note that if you are interested in video card drivers you should probably talk to [http://x.org/ X.Org] and/or [http://www.xfree86.org/ XFree86] instead.
+
  
Also read the [[SubmittingPatches|Documentation/SubmittingPatches]] document.
 
  
 +
<center>'''Submitting Drivers For The Linux Kernel'''</center>
 +
 +
This document is intended to explain how to submit device drivers to the various development trees of the Linux kernel. Note that if you are interested in video card drivers you should probably talk to [http://x.org/ X.Org] and/or [http://www.xfree86.org/ XFree86] instead.
 +
 +
Also read the [[Development: Submitting Patches|Documentation/SubmittingPatches]] document.
  
 
== Allocating Device Numbers ==
 
== Allocating Device Numbers ==
Line 10: Line 13:
 
If you don't use assigned numbers then when you device is submitted it will get given an assigned number even if that is different from values you may
 
If you don't use assigned numbers then when you device is submitted it will get given an assigned number even if that is different from values you may
 
have shipped to customers before.
 
have shipped to customers before.
 
  
 
== Who To Submit Drivers To ==
 
== Who To Submit Drivers To ==
;Linux 2.0: No new drivers are accepted for this kernel tree
+
;Linux 3.x: Any patches for a media driver (drivers/media) should be submitted to the Linux Media Mailing list <linux-media@vger.kernel.org>
 
+
;Linux 2.6: A patch that also applies to an stable kernel should have a "Cc: stable@kernel.org" in the body of the email. Once reached upstream, it will be sent to the Stable maintainer. If there's already a patch for it upstream, you can submit it directly to the stable Mailing list (stable@kernel.org).
;Linux 2.2: If the code area has a general maintainer then please submit it to the maintainer listed in MAINTAINERS in the kernel file. If the maintainer does not respond or you cannot find the appropriate maintainer then please contact Alan Cox <alan@lxorguk.ukuu.org.uk>
+
 
+
;Linux 2.4: The same rules apply as 2.2. The final contact point for Linux 2.4 submissions is Marcelo Tosatti <marcelo.tosatti@cyclades.com>.
+
 
+
;Linux 2.6: The same rules apply as 2.4 except that you should follow linux-kernel to track changes in API's. The final contact point for Linux 2.6 submissions is Andrew Morton <akpm@osdl.org>.
+
 
+
  
 
== What Criteria Determine Acceptance ==
 
== What Criteria Determine Acceptance ==
Line 36: Line 32:
  
 
;Control: In general if there is active maintainance of a driver by the author then patches will be redirected to them unless they are totally obvious and without need of checking.  If you want to be the contact and update point for the driver it is a good idea to state this in the comments, and include an entry in MAINTAINERS for your driver.
 
;Control: In general if there is active maintainance of a driver by the author then patches will be redirected to them unless they are totally obvious and without need of checking.  If you want to be the contact and update point for the driver 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 ==
 
== What Criteria Do Not Determine Acceptance ==
 
 
;Vendor: Being the hardware vendor and maintaining the driver is often a good thing. If there is a stable working driver from other people already in the tree don't expect 'we are the vendor' to get your driver chosen. Ideally work with the existing driver author to build a single perfect driver.  
 
;Vendor: Being the hardware vendor and maintaining the driver is often a good thing. If there is a stable working driver from other people already in the tree don't expect 'we are the vendor' to get your driver chosen. Ideally work with the existing driver author to build a single perfect driver.  
  
Line 60: Line 54:
 
 
 
;Linux USB project [http://sourceforge.net/projects/linux-usb/]: Helpful for the development of USB based device drivers
 
;Linux USB project [http://sourceforge.net/projects/linux-usb/]: Helpful for the development of USB based device drivers
 +
 +
 +
[[Category:Development]]

Latest revision as of 01:23, 11 July 2011

The following content is a copy of the /usr/src/linux/Documentation/SubmittingDrivers file (modified slightly for visual presentation). A current copy can also be found online here.


Submitting Drivers For The Linux Kernel

This document is intended to explain how to submit device drivers to the various development trees of the Linux kernel. Note that if you are interested in video card drivers you should probably talk to X.Org and/or XFree86 instead.

Also read the Documentation/SubmittingPatches document.

Allocating Device Numbers

Major and minor numbers for block and character devices are allocated by the Linux assigned name and number authority (currently better known as H Peter Anvin). The site is http://www.lanana.org/. This also deals with allocating numbers for devices that are not going to be submitted to the mainstream kernel.

If you don't use assigned numbers then when you device is submitted it will get given an assigned number even if that is different from values you may have shipped to customers before.

Who To Submit Drivers To

Linux 3.x
Any patches for a media driver (drivers/media) should be submitted to the Linux Media Mailing list <linux-media@vger.kernel.org>
Linux 2.6
A patch that also applies to an stable kernel should have a "Cc: stable@kernel.org" in the body of the email. Once reached upstream, it will be sent to the Stable maintainer. If there's already a patch for it upstream, you can submit it directly to the stable Mailing list (stable@kernel.org).

What Criteria Determine Acceptance

Licensing
The code must be released to us under the GNU General Public License. We don't insist on any kind of exclusively GPL licensing, and if you wish the driver to be useful to other communities such as BSD you may well wish to release under multiple licenses.
Copyright
The copyright owner must agree to use of GPL. It's best if the submitter and copyright owner are the same person/entity. If not, the name of the person/entity authorizing use of GPL should be listed in case it's necessary to verify the will of the copright owner.
Interfaces: If your driver uses existing interfaces and behaves like other drivers in the same class it will be much more likely to be accepted than if it invents gratuitous new ones. If you need to implement a common API over Linux and NT drivers do it in userspace.
Code
Please use the Linux style of code formatting as documented in Documentation/CodingStyle. If you have sections of code that need to be in other formats, for example because they are shared with a windows driver kit and you want to maintain them just once separate them out nicely and note this fact.
Portability
Pointers are not always 32bits, not all computers are little endian, people do not all have floating point and you shouldn't use inline x86 assembler in your driver without careful thought. Pure x86 drivers generally are not popular. If you only have x86 hardware it is hard to test portability but it is easy to make sure the code can easily be made portable.
Clarity
It helps if anyone can see how to fix the driver. It helps you because you get patches not bug reports. If you submit a driver that intentionally obfuscates how the hardware works it will go in the bitbucket.
Control
In general if there is active maintainance of a driver by the author then patches will be redirected to them unless they are totally obvious and without need of checking. If you want to be the contact and update point for the driver 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 is often a good thing. If there is a stable working driver from other people already in the tree don't expect 'we are the vendor' to get your driver chosen. Ideally work with the existing 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 kernel tree. Anyone who tells you otherwise isn't telling the whole story.

Resources

Linux kernel master tree
ftp.??.kernel.org:/pub/linux/kernel/...
where ?? is 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)
Kernel traffic [1]
Weekly summary of kernel list activity (much easier to read)
LWN.net [2]
Weekly summary of kernel development activity
* 2.6 API changes
* Porting drivers from prior kernels to 2.6
KernelTrap [3]
Occasional Linux kernel articles and developer interviews
KernelNewbies [4]
Documentation and assistance for new kernel programmers
Linux USB project [5]
Helpful for the development of USB based device drivers