3 Submitting Drivers For The Linux Kernel
4 =======================================
6 This document is intended to explain how to submit device drivers to the
7 various kernel trees. Note that if you are interested in video card drivers
8 you should probably talk to XFree86 (http://www.xfree86.org/) and/or X.Org
9 (http://x.org/) instead.
11 Also read the Documentation/SubmittingPatches document.
14 Allocating Device Numbers
15 -------------------------
17 Major and minor numbers for block and character devices are allocated
18 by the Linux assigned name and number authority (currently this is
19 Torben Mathiasen). The site is http://www.lanana.org/. This
20 also deals with allocating numbers for devices that are not going to
21 be submitted to the mainstream kernel.
22 See Documentation/devices.txt for more information on this.
24 If you don't use assigned numbers then when your device is submitted it will
25 be given an assigned number even if that is different from values you may
26 have shipped to customers before.
28 Who To Submit Drivers To
29 ------------------------
32 No new drivers are accepted for this kernel tree.
35 No new drivers are accepted for this kernel tree.
38 If the code area has a general maintainer then please submit it to
39 the maintainer listed in MAINTAINERS in the kernel file. If the
40 maintainer does not respond or you cannot find the appropriate
41 maintainer then please contact Willy Tarreau <w@1wt.eu>.
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.
48 What Criteria Determine Acceptance
49 ----------------------------------
52 The code must be released to us under the
53 GNU General Public License. We don't insist on any kind
54 of exclusive GPL licensing, and if you wish the driver
55 to be useful to other communities such as BSD you may well
56 wish to release under multiple licenses.
57 See accepted licenses at include/linux/module.h
60 The copyright owner must agree to use of GPL.
61 It's best if the submitter and copyright owner
62 are the same person/entity. If not, the name of
63 the person/entity authorizing use of GPL should be
64 listed in case it's necessary to verify the will of
68 If your driver uses existing interfaces and behaves like
69 other drivers in the same class it will be much more likely
70 to be accepted than if it invents gratuitous new ones.
71 If you need to implement a common API over Linux and NT
72 drivers do it in userspace.
75 Please use the Linux style of code formatting as documented
76 in Documentation/CodingStyle. If you have sections of code
77 that need to be in other formats, for example because they
78 are shared with a windows driver kit and you want to
79 maintain them just once separate them out nicely and note
83 Pointers are not always 32bits, not all computers are little
84 endian, people do not all have floating point and you
85 shouldn't use inline x86 assembler in your driver without
86 careful thought. Pure x86 drivers generally are not popular.
87 If you only have x86 hardware it is hard to test portability
88 but it is easy to make sure the code can easily be made
92 It helps if anyone can see how to fix the driver. It helps
93 you because you get patches not bug reports. If you submit a
94 driver that intentionally obfuscates how the hardware works
95 it will go in the bitbucket.
98 Since Linux is used on many portable and desktop systems, your
99 driver is likely to be used on such a system and therefore it
100 should support basic power management by implementing, if
101 necessary, the .suspend and .resume methods used during the
102 system-wide suspend and resume transitions. You should verify
103 that your driver correctly handles the suspend and resume, but
104 if you are unable to ensure that, please at least define the
105 .suspend method returning the -ENOSYS ("Function not
106 implemented") error. You should also try to make sure that your
107 driver uses as little power as possible when it's not doing
108 anything. For the driver testing instructions see
109 Documentation/power/drivers-testing.txt and for a relatively
110 complete overview of the power management issues related to
111 drivers see Documentation/power/devices.txt .
114 In general if there is active maintenance of a driver by
115 the author then patches will be redirected to them unless
116 they are totally obvious and without need of checking.
117 If you want to be the contact and update point for the
118 driver it is a good idea to state this in the comments,
119 and include an entry in MAINTAINERS for your driver.
121 What Criteria Do Not Determine Acceptance
122 -----------------------------------------
125 Being the hardware vendor and maintaining the driver is
126 often a good thing. If there is a stable working driver from
127 other people already in the tree don't expect 'we are the
128 vendor' to get your driver chosen. Ideally work with the
129 existing driver author to build a single perfect driver.
132 It doesn't matter if a large Linux company wrote the driver,
133 or you did. Nobody has any special access to the kernel
134 tree. Anyone who tells you otherwise isn't telling the
141 Linux kernel master tree:
142 ftp.\ *country_code*\ .kernel.org:/pub/linux/kernel/...
144 where *country_code* == your country code, such as
145 **us**, **uk**, **fr**, etc.
147 http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git
149 Linux kernel mailing list:
150 linux-kernel@vger.kernel.org
151 [mail majordomo@vger.kernel.org to subscribe]
153 Linux Device Drivers, Third Edition (covers 2.6.10):
154 http://lwn.net/Kernel/LDD3/ (free version)
157 Weekly summary of kernel development activity - http://lwn.net/
161 http://lwn.net/Articles/2.6-kernel-api/
163 Porting drivers from prior kernels to 2.6:
165 http://lwn.net/Articles/driver-porting/
168 Documentation and assistance for new kernel programmers
170 http://kernelnewbies.org/
173 http://www.linux-usb.org/
175 How to NOT write kernel driver by Arjan van de Ven:
176 http://www.fenrus.org/how-to-not-write-a-device-driver-paper.pdf
179 http://kernelnewbies.org/KernelJanitors
181 GIT, Fast Version Control System: