NOTE: this page is for archival only, see the note at the end of the page.

TableOfContents

About this guide

This guide is designed to give you an idea of how to write linux-wireless patches.

Prior to sending patches

Please DO NOT PGP sign patches sent to linux-wireless. The reason is that signing patches will normalize the and use qp-encoding (Quoated Printable) for the patch. Quoted-Printable encoding replaces characters you can't have in 7-bit by =XX where XX is the hex code. As you can imagine applying such patches will simply not work. Also, please note that we prefer patches inline rather than attachments.

Who to address

If you intend on getting your patch committed address your e-mail as follows:

To: ''John Linville''
CC: ''linux-wireless'', Driver Maintainers, Other Developers

Where [http://linuxwireless.org/en/developers/maintainers Driver Maintainers] contains the list of maintianers for the driver you are patching. Other Developers in this case can be a list of developers who you think may like to review this patch.

Subject name

If what you are sending is a patch you can use a subject as follows:

[PATCH] driver_name: fix foo and optimize bar

If your patch is just a proposal you can use this format for your subject:

[RFC][PATCH] driver_name: a new way to do foo

Sending large patches or multiple patches

You should only send a large patch if your patch does one specific task, or a few of them if they are easy to review. If your work consists of multiple tasks you must split your tasks into separate patches. Each patch must address a small set of tasks to help the maintainers with revision. The rule of thumb here is if you read your patch and if its not clear what the patch is doing then better break it down into separate patches.

If you are sending multiple patches which depend on each other you can use this format for the subjects:

[PATCH 0/4] driver_name: introduce foo and bar
[PATCH 1/4] driver_name: introduce get_foo_bars()
[PATCH 2/4] driver_name: fix locking on bar_by_foo()
[PATCH 3/4] driver_name: use foo when barring
[PATCH 4/4] driver_name: optimize bar at init time

[PATCH 0/4] in this case would give a brief overview of all the changes, no patch should be included in that e-mail.

Format of patches

We prefer patches to be inline-text at the end of the body of the e-mail. You can use git-diff or the like to generate the patch. Additionally note that we prefer to apply patches with -p1. A header as follows is then acceptable:

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 9b4b4a2..4832e6a 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h

Footnote on patches

After the stupid SCO incident (which they lost BTW) we figured it'd be best to add new policies to help keep track of provenance of patches. This also helps developers review who was in the line of a patch work, who submitted it, and who reviewed it. This information is available from the git-log. We currently use, Signed-off-by, Acked-by and Cc. It has been proposed to add a new Reviewed-by and even a Tested-by.

Signed-off-by, Acked-by, Reviewed-by, Tested-by

Quoting Andrew Morton:

  • the Signed-off-by: tag implies that the signer was involved in the development of the patch, or that he/she was in the patch's delivery path. If a person was not directly involved in the preparation or handling of a patch but wishes to signify and record their approval of it then they can arrange to have an Acked-by: line added to the patch's changelog. – [http://kerneltrap.org/node/8329 From Kerneltrap, on Linux: Using Acked-by Tags]

As a patch submitter, the Signed-off-by: can be put right before the patch and diffstat (diffstat is optional). After the Signed-off-by: you can put . Reviewed-by tags are something new and it was proposed as many developers were using Acked-by to simply indicate they agree with a patch but not necessarily that they did an actual review of the code involved. You can use Reviewed-by if you want to make clear you actually did do a good amount of review, however Acked-by can be used as that is what its purpose was after all.

Tested-by can be used to indicate testers of the patch.

Examples of a patches

Below are a few examples of a patches. Only the header is provided for long patches.

  • Single patch

From: Michael Buesch
To: John Linville
Cc: linux-wireless, Bcm43xx-dev, Larry Finger
Subject: [PATCH] b43: Remove the "radio hw enabled" message on startup.

This message is useless. Only report state changes.

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Cc: Larry Finger <larry.finger@lwfinger.net>

Index: wireless-dev/drivers/net/wireless/b43/main.c
===================================================================
--- wireless-dev.orig/drivers/net/wireless/b43/main.c   2007-09-20 19:39:06.000000000 +0200
+++ wireless-dev/drivers/net/wireless/b43/main.c        2007-09-20 20:06:24.000000000 +0200
@@ -2227,9 +2227,6 @@ static int b43_chip_init(struct b43_wlde
       if (err)
               goto err_gpio_cleanup;
       b43_radio_turn_on(dev);
-       dev->radio_hw_enable = b43_is_hw_radio_enabled(dev);
-       b43dbg(dev->wl, "Radio %s by hardware\n",
-              dev->radio_hw_enable ? "enabled" : "disabled");

       b43_write16(dev, 0x03E6, 0x0000);
       err = b43_phy_init(dev);
@@ -3251,6 +3248,9 @@ static void setup_struct_wldev_for_init(
 {
       /* Flags */
       dev->reg124_set_0x4 = 0;
+       /* Assume the radio is enabled. If it's not enabled, the state will
+        * immediately get fixed on the first periodic work run. */
+       dev->radio_hw_enable = 1;

       /* Stats */
       memset(&dev->stats, 0, sizeof(dev->stats));
-
  • Multiple patches

From: Luis R. Rodriguez
To: John Linville
Cc: linux-wireless, Michael Wu, Johannes Berg, Daniel Drake, Larry Finger
Subject: [PATCH 3/5] Wireless: add IEEE-802.11 regualtory domain module

This adds the regulatory domain module. It provides a way to
allocate and construct a regulatory domain based on the current
map. This module provides no enforcement, it just does the actual
building of the regdomain and returns it as defined in ieee80211_regdomains.h

This module depends on the ISO3166-1 module.

Signed-off-by: Luis R. Rodriguez <mcgrof@foo.com>
---
 include/net/ieee80211_regdomains.h |  196 ++++++++
 net/wireless/Kconfig               |   16 +
 net/wireless/Makefile              |    1 +
 net/wireless/reg_common.h          |  138 ++++++
 net/wireless/regdomains.c          |  751 ++++++++++++++++++++++++++++++
 net/wireless/regulatory_map.h      |  887 ++++++++++++++++++++++++++++++++++++
 6 files changed, 1989 insertions(+), 0 deletions(-)
 create mode 100644 include/net/ieee80211_regdomains.h
 create mode 100644 net/wireless/reg_common.h
 create mode 100644 net/wireless/regdomains.c
 create mode 100644 net/wireless/regulatory_map.h

diff --git a/include/net/ieee80211_regdomains.h b/include/net/ieee80211_regdomains.h
new file mode 100644
index 0000000..adf4de4
--- /dev/null
+++ b/include/net/ieee80211_regdomains.h
@@ -0,0 +1,196 @@
+#ifndef _IEEE80211_REGDOMAIN_H
+#define _IEEE80211_REGDOMAIN_H
+/*
... ETC ...

This is a static dump of the wiki, taken after locking it in January 2015. The new wiki is at https://wireless.wiki.kernel.org/.
versions of this page: last, v25, v24, v23, v22, v21, v20, v19, v18, v17, v16, v15, v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1