Hopefully get the Kconfig PCI stuff right, finally.
[linux-2.6/linux-mips.git] / Documentation / SubmittingDrivers
blobc127eff47bd71901777d9c53068d7455d000c04c
1 Submitting Drivers For The Linux Kernel
2 ---------------------------------------
4 This document is intended to explain how to submit device drivers to the
5 various kernel trees. Note that if you are interested in video card drivers
6 you should probably talk to XFree86 (http://www.xfree86.org) instead.
8 Also read the Documentation/SubmittingPatches document.
11 Allocating Device Numbers
12 -------------------------
14 Major and minor numbers for block and character devices are allocated
15 by the Linux assigned name and number authority (currently better
16 known as H Peter Anvin). The site is http://www.lanana.org/. This
17 also deals with allocating numbers for devices that are not going to
18 be submitted to the mainstream kernel.
20 If you don't use assigned numbers then when you device is submitted it will
21 get given an assigned number even if that is different from values you may
22 have shipped to customers before.
24 Who To Submit Drivers To
25 ------------------------
27 Linux 2.0:
28         No new drivers are accepted for this kernel tree
30 Linux 2.2:
31         If the code area has a general maintainer then please submit it to
32         the maintainer listed in MAINTAINERS in the kernel file. If the
33         maintainer does not respond or you cannot find the appropriate
34         maintainer then please contact Alan Cox <alan@lxorguk.ukuu.org.uk>
36 Linux 2.4:
37         The same rules apply as 2.2 but this kernel tree is under active
38         development. The final contact point for Linux 2.4 submissions is
39         Marcelo Tosatti <marcelo@conectiva.com.br>.
41 Linux 2.5:
42         The same rules apply as 2.4 except that you should follow linux-kernel
43         to track changes in API's. The final contact point for Linux 2.5
44         submissions is Linus Torvalds <torvalds@transmeta.com>.
46 What Criteria Determine Acceptance
47 ----------------------------------
49 Licensing:      The code must be released to us under the
50                 GNU General Public License. We don't insist on any kind
51                 of exclusively GPL licensing, and if you wish the driver
52                 to be useful to other communities such as BSD you may well
53                 wish to release under multiple licenses.
55 Interfaces:     If your driver uses existing interfaces and behaves like
56                 other drivers in the same class it will be much more likely
57                 to be accepted than if it invents gratuitous new ones. 
58                 If you need to implement a common API over Linux and NT
59                 drivers do it in userspace.
61 Code:           Please use the Linux style of code formatting as documented
62                 in Documentation/CodingStyle. If you have sections of code
63                 that need to be in other formats, for example because they
64                 are shared with a windows driver kit and you want to
65                 maintain them just once separate them out nicely and note
66                 this fact.
68 Portability:    Pointers are not always 32bits, not all computers are little
69                 endian, people do not all have floating point and you
70                 shouldn't use inline x86 assembler in your driver without
71                 careful thought. Pure x86 drivers generally are not popular.
72                 If you only have x86 hardware it is hard to test portability
73                 but it is easy to make sure the code can easily be made
74                 portable.
76 Clarity:        It helps if anyone can see how to fix the driver. It helps
77                 you because you get patches not bug reports. If you submit a
78                 driver that intentionally obfuscates how the hardware works
79                 it will go in the bitbucket.
81 Control:        In general if there is active maintainance of a driver by
82                 the author then patches will be redirected to them unless 
83                 they are totally obvious and without need of checking.
84                 If you want to be the contact and update point for the
85                 driver it is a good idea to state this in the comments,
86                 and include an entry in MAINTAINERS for your driver.
88 What Criteria Do Not Determine Acceptance
89 -----------------------------------------
91 Vendor:         Being the hardware vendor and maintaining the driver is
92                 often a good thing. If there is a stable working driver from
93                 other people already in the tree don't expect 'we are the
94                 vendor' to get your driver chosen. Ideally work with the 
95                 existing driver author to build a single perfect driver.
97 Author:         It doesn't matter if a large Linux company wrote the driver,
98                 or you did. Nobody has any special access to the kernel
99                 tree. Anyone who tells you otherwise isn't telling the
100                 whole story.
103 Resources
104 ---------
106 Linux kernel master tree:
107         ftp.??.kernel.org:/pub/linux/kernel/...
108         ?? == your country code, such as "us", "uk", "fr", etc.
110 Linux kernel mailing list:              
111         linux-kernel@vger.kernel.org
112         [mail majordomo@vger.kernel.org to subscribe]
114 Kernel traffic:
115         Weekly summary of kernel list activity (much easier to read)
116         [http://kt.zork.net/kernel-traffic]
118 Linux USB project:
119         http://sourceforge.net/projects/linux-usb/