SubmittingDrivers 5.3 KB

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