blob: c3cca924e94b4accf6848e9338d12c1ca863bb36 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001Submitting Drivers For The Linux Kernel
2---------------------------------------
3
4This document is intended to explain how to submit device drivers to the
5various kernel trees. Note that if you are interested in video card drivers
6you should probably talk to XFree86 (http://www.xfree86.org/) and/or X.Org
7(http://x.org/) instead.
8
9Also read the Documentation/SubmittingPatches document.
10
11
12Allocating Device Numbers
13-------------------------
14
15Major and minor numbers for block and character devices are allocated
Randy Dunlap84da7c02005-06-28 20:45:30 -070016by the Linux assigned name and number authority (currently this is
17Torben Mathiasen). The site is http://www.lanana.org/. This
Linus Torvalds1da177e2005-04-16 15:20:36 -070018also deals with allocating numbers for devices that are not going to
19be submitted to the mainstream kernel.
Randy Dunlap84da7c02005-06-28 20:45:30 -070020See Documentation/devices.txt for more information on this.
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
Randy Dunlap84da7c02005-06-28 20:45:30 -070022If you don't use assigned numbers then when your device is submitted it will
23be given an assigned number even if that is different from values you may
Linus Torvalds1da177e2005-04-16 15:20:36 -070024have shipped to customers before.
25
26Who To Submit Drivers To
27------------------------
28
29Linux 2.0:
30 No new drivers are accepted for this kernel tree
31
32Linux 2.2:
33 If the code area has a general maintainer then please submit it to
34 the maintainer listed in MAINTAINERS in the kernel file. If the
35 maintainer does not respond or you cannot find the appropriate
Randy Dunlap84da7c02005-06-28 20:45:30 -070036 maintainer then please contact the 2.2 kernel maintainer:
37 Marc-Christian Petersen <m.c.p@wolk-project.de>.
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
39Linux 2.4:
40 The same rules apply as 2.2. The final contact point for Linux 2.4
41 submissions is Marcelo Tosatti <marcelo.tosatti@cyclades.com>.
42
43Linux 2.6:
44 The same rules apply as 2.4 except that you should follow linux-kernel
45 to track changes in API's. The final contact point for Linux 2.6
46 submissions is Andrew Morton <akpm@osdl.org>.
47
48What Criteria Determine Acceptance
49----------------------------------
50
51Licensing: The code must be released to us under the
52 GNU General Public License. We don't insist on any kind
Randy Dunlap84da7c02005-06-28 20:45:30 -070053 of exclusive GPL licensing, and if you wish the driver
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 to be useful to other communities such as BSD you may well
55 wish to release under multiple licenses.
56
57Copyright: The copyright owner must agree to use of GPL.
58 It's best if the submitter and copyright owner
59 are the same person/entity. If not, the name of
60 the person/entity authorizing use of GPL should be
61 listed in case it's necessary to verify the will of
62 the copright owner.
63
64Interfaces: If your driver uses existing interfaces and behaves like
65 other drivers in the same class it will be much more likely
66 to be accepted than if it invents gratuitous new ones.
67 If you need to implement a common API over Linux and NT
68 drivers do it in userspace.
69
70Code: Please use the Linux style of code formatting as documented
71 in Documentation/CodingStyle. If you have sections of code
72 that need to be in other formats, for example because they
73 are shared with a windows driver kit and you want to
74 maintain them just once separate them out nicely and note
75 this fact.
76
77Portability: Pointers are not always 32bits, not all computers are little
78 endian, people do not all have floating point and you
79 shouldn't use inline x86 assembler in your driver without
80 careful thought. Pure x86 drivers generally are not popular.
81 If you only have x86 hardware it is hard to test portability
82 but it is easy to make sure the code can easily be made
83 portable.
84
85Clarity: It helps if anyone can see how to fix the driver. It helps
86 you because you get patches not bug reports. If you submit a
87 driver that intentionally obfuscates how the hardware works
88 it will go in the bitbucket.
89
90Control: In general if there is active maintainance of a driver by
91 the author then patches will be redirected to them unless
92 they are totally obvious and without need of checking.
93 If you want to be the contact and update point for the
94 driver it is a good idea to state this in the comments,
95 and include an entry in MAINTAINERS for your driver.
96
97What Criteria Do Not Determine Acceptance
98-----------------------------------------
99
100Vendor: Being the hardware vendor and maintaining the driver is
101 often a good thing. If there is a stable working driver from
102 other people already in the tree don't expect 'we are the
103 vendor' to get your driver chosen. Ideally work with the
104 existing driver author to build a single perfect driver.
105
106Author: It doesn't matter if a large Linux company wrote the driver,
107 or you did. Nobody has any special access to the kernel
108 tree. Anyone who tells you otherwise isn't telling the
109 whole story.
110
111
112Resources
113---------
114
115Linux kernel master tree:
116 ftp.??.kernel.org:/pub/linux/kernel/...
117 ?? == your country code, such as "us", "uk", "fr", etc.
118
119Linux kernel mailing list:
120 linux-kernel@vger.kernel.org
121 [mail majordomo@vger.kernel.org to subscribe]
122
123Linux Device Drivers, Third Edition (covers 2.6.10):
124 http://lwn.net/Kernel/LDD3/ (free version)
125
126Kernel traffic:
127 Weekly summary of kernel list activity (much easier to read)
128 http://www.kerneltraffic.org/kernel-traffic/
129
130LWN.net:
131 Weekly summary of kernel development activity - http://lwn.net/
132 2.6 API changes:
133 http://lwn.net/Articles/2.6-kernel-api/
134 Porting drivers from prior kernels to 2.6:
135 http://lwn.net/Articles/driver-porting/
136
137KernelTrap:
138 Occasional Linux kernel articles and developer interviews
139 http://kerneltrap.org/
140
141KernelNewbies:
142 Documentation and assistance for new kernel programmers
143 http://kernelnewbies.org/
144
145Linux USB project:
146 http://sourceforge.net/projects/linux-usb/
147