SubmittingDrivers 5.4 KB

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