Skip to contentSkip to conversation

backports: add NFC patches

PATCH In review Thierry Escande 3 participants 4 messages Apr 5, 2013 – Apr 6, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v3 6/8 backports: add NFC patches

These are NFC patches refreshed on next-20130404

---
 .../0005-netlink-portid/net_nfc_netlink.patch      |   71 ++++++++++++++++++++
 .../network/53-pr_fmt/net_nfc_core.patch           |   13 ++++
 .../network/53-pr_fmt/net_nfc_hci_command.patch    |   13 ++++
 .../network/53-pr_fmt/net_nfc_hci_core.patch       |   13 ++++
 .../network/53-pr_fmt/net_nfc_hci_hcp.patch        |   13 ++++
 .../network/53-pr_fmt/net_nfc_hci_llc_shdlc.patch  |   13 ++++
 .../network/53-pr_fmt/net_nfc_llcp_commands.patch  |   13 ++++
 .../network/53-pr_fmt/net_nfc_llcp_llcp.patch      |   13 ++++
 .../network/53-pr_fmt/net_nfc_llcp_sock.patch      |   13 ++++
 .../network/53-pr_fmt/net_nfc_nci_core.patch       |   13 ++++
 .../network/53-pr_fmt/net_nfc_nci_data.patch       |   13 ++++
 .../network/53-pr_fmt/net_nfc_nci_ntf.patch        |   13 ++++
 .../network/53-pr_fmt/net_nfc_nci_rsp.patch        |   12 ++++
 .../network/53-pr_fmt/net_nfc_netlink.patch        |   13 ++++
 .../network/53-pr_fmt/net_nfc_rawsock.patch        |   13 ++++
 .../network/74-driver-core-constify-data/INFO      |    7 ++
 .../net_nfc_core.patch                             |   14 ++++
 17 files changed, 273 insertions(+)
 create mode 100644 patches/collateral-evolutions/network/0005-netlink-portid/net_nfc_netlink.patch
 create mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_nfc_core.patch
 create mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_nfc_hci_command.patch
 create mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_nfc_hci_core.patch
 create mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_nfc_hci_hcp.patch
 create mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_nfc_hci_llc_shdlc.patch
 create mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_nfc_llcp_commands.patch
 create mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_nfc_llcp_llcp.patch
 create mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_nfc_llcp_sock.patch
 create mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_nfc_nci_core.patch
 create mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_nfc_nci_data.patch
 create mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_nfc_nci_ntf.patch
 create mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_nfc_nci_rsp.patch
 create mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_nfc_netlink.patch
 create mode 100644 patches/collateral-evolutions/network/53-pr_fmt/net_nfc_rawsock.patch
 create mode 100644 patches/collateral-evolutions/network/74-driver-core-constify-data/INFO
 create mode 100644 patches/collateral-evolutions/network/74-driver-core-constify-data/net_nfc_core.patch
patches/collateral-evolutions/network/0005-netlink-portid/net_nfc_netlink.patch new file +71 -0
new file mode 100644
index 0000000..61770ce
@@ -0,0 +1,71 @@
+--- a/net/nfc/netlink.c
++++ b/net/nfc/netlink.c
+@@ -69,7 +69,7 @@ static int nfc_genl_send_target(struct s
+ {
+ 	void *hdr;
+ 
+-	hdr = genlmsg_put(msg, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
++	hdr = genlmsg_put(msg, NETLINK_CB_PORTID(cb->skb), cb->nlh->nlmsg_seq,
+ 			  &nfc_genl_family, flags, NFC_CMD_GET_TARGET);
+ 	if (!hdr)
+ 		return -EMSGSIZE;
+@@ -482,7 +482,7 @@ static int nfc_genl_dump_devices(struct
+ 	while (dev) {
+ 		int rc;
+ 
+-		rc = nfc_genl_send_device(skb, dev, NETLINK_CB(cb->skb).portid,
++		rc = nfc_genl_send_device(skb, dev, NETLINK_CB_PORTID(cb->skb),
+ 					  cb->nlh->nlmsg_seq, cb, NLM_F_MULTI);
+ 		if (rc < 0)
+ 			break;
+@@ -601,7 +601,7 @@ static int nfc_genl_get_device(struct sk
+ 		goto out_putdev;
+ 	}
+ 
+-	rc = nfc_genl_send_device(msg, dev, info->snd_portid, info->snd_seq,
++	rc = nfc_genl_send_device(msg, dev, genl_info_snd_portid(info), info->snd_seq,
+ 				  NULL, 0);
+ 	if (rc < 0)
+ 		goto out_free;
+@@ -692,7 +692,7 @@ static int nfc_genl_start_poll(struct sk
+ 
+ 	rc = nfc_start_poll(dev, im_protocols, tm_protocols);
+ 	if (!rc)
+-		dev->genl_data.poll_req_portid = info->snd_portid;
++		dev->genl_data.poll_req_portid = genl_info_snd_portid(info);
+ 
+ 	mutex_unlock(&dev->genl_data.genl_data_mutex);
+ 
+@@ -726,7 +726,7 @@ static int nfc_genl_stop_poll(struct sk_
+ 
+ 	mutex_lock(&dev->genl_data.genl_data_mutex);
+ 
+-	if (dev->genl_data.poll_req_portid != info->snd_portid) {
++	if (dev->genl_data.poll_req_portid != genl_info_snd_portid(info)) {
+ 		rc = -EBUSY;
+ 		goto out;
+ 	}
+@@ -852,7 +852,7 @@ static int nfc_genl_llc_get_params(struc
+ 		goto exit;
+ 	}
+ 
+-	rc = nfc_genl_send_params(msg, local, info->snd_portid, info->snd_seq);
++	rc = nfc_genl_send_params(msg, local, genl_info_snd_portid(info), info->snd_seq);
+ 
+ exit:
+ 	device_unlock(&dev->dev);
+@@ -1135,12 +1135,12 @@ static int nfc_genl_rcv_nl_event(struct
+ 	if (event != NETLINK_URELEASE || n->protocol != NETLINK_GENERIC)
+ 		goto out;
+ 
+-	pr_debug("NETLINK_URELEASE event from id %d\n", n->portid);
++	pr_debug("NETLINK_URELEASE event from id %d\n", netlink_notify_portid(n));
+ 
+ 	w = kmalloc(sizeof(*w), GFP_ATOMIC);
+ 	if (w) {
+ 		INIT_WORK((struct work_struct *) w, nfc_urelease_event_work);
+-		w->portid = n->portid;
++		w->portid = netlink_notify_portid(n);
+ 		schedule_work((struct work_struct *) w);
+ 	}
+ 
patches/collateral-evolutions/network/53-pr_fmt/net_nfc_core.patch new file +13 -0
new file mode 100644
index 0000000..feffc96
@@ -0,0 +1,13 @@
+--- a/net/nfc/core.c
++++ b/net/nfc/core.c
+@@ -21,8 +21,10 @@
+  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+  */
+ 
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
+ 
++#include <linux/printk.h>
+ #include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/module.h>
patches/collateral-evolutions/network/53-pr_fmt/net_nfc_hci_command.patch new file +13 -0
new file mode 100644
index 0000000..97ea3b4
@@ -0,0 +1,13 @@
+--- a/net/nfc/hci/command.c
++++ b/net/nfc/hci/command.c
+@@ -17,8 +17,10 @@
+  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+  */
+ 
++#undef pr_fmt
+ #define pr_fmt(fmt) "hci: %s: " fmt, __func__
+ 
++#include <linux/printk.h>
+ #include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/sched.h>
patches/collateral-evolutions/network/53-pr_fmt/net_nfc_hci_core.patch new file +13 -0
new file mode 100644
index 0000000..9b29afb
@@ -0,0 +1,13 @@
+--- a/net/nfc/hci/core.c
++++ b/net/nfc/hci/core.c
+@@ -17,8 +17,10 @@
+  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+  */
+ 
++#undef pr_fmt
+ #define pr_fmt(fmt) "hci: %s: " fmt, __func__
+ 
++#include <linux/printk.h>
+ #include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/module.h>
patches/collateral-evolutions/network/53-pr_fmt/net_nfc_hci_hcp.patch new file +13 -0
new file mode 100644
index 0000000..38c9484
@@ -0,0 +1,13 @@
+--- a/net/nfc/hci/hcp.c
++++ b/net/nfc/hci/hcp.c
+@@ -17,8 +17,10 @@
+  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+  */
+ 
++#undef pr_fmt
+ #define pr_fmt(fmt) "hci: %s: " fmt, __func__
+ 
++#include <linux/printk.h>
+ #include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/module.h>
patches/collateral-evolutions/network/53-pr_fmt/net_nfc_hci_llc_shdlc.patch new file +13 -0
new file mode 100644
index 0000000..5088e2f
@@ -0,0 +1,13 @@
+--- a/net/nfc/hci/llc_shdlc.c
++++ b/net/nfc/hci/llc_shdlc.c
+@@ -18,8 +18,10 @@
+  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+  */
+ 
++#undef pr_fmt
+ #define pr_fmt(fmt) "shdlc: %s: " fmt, __func__
+ 
++#include <linux/printk.h>
+ #include <linux/types.h>
+ #include <linux/sched.h>
+ #include <linux/wait.h>
patches/collateral-evolutions/network/53-pr_fmt/net_nfc_llcp_commands.patch new file +13 -0
new file mode 100644
index 0000000..b896f67
@@ -0,0 +1,13 @@
+--- a/net/nfc/llcp/commands.c
++++ b/net/nfc/llcp/commands.c
+@@ -17,8 +17,10 @@
+  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+  */
+ 
++#undef pr_fmt
+ #define pr_fmt(fmt) "llcp: %s: " fmt, __func__
+ 
++#include <linux/printk.h>
+ #include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/module.h>
patches/collateral-evolutions/network/53-pr_fmt/net_nfc_llcp_llcp.patch new file +13 -0
new file mode 100644
index 0000000..33abb45
@@ -0,0 +1,13 @@
+--- a/net/nfc/llcp/llcp.c
++++ b/net/nfc/llcp/llcp.c
+@@ -17,8 +17,10 @@
+  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+  */
+ 
++#undef pr_fmt
+ #define pr_fmt(fmt) "llcp: %s: " fmt, __func__
+ 
++#include <linux/printk.h>
+ #include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/list.h>
patches/collateral-evolutions/network/53-pr_fmt/net_nfc_llcp_sock.patch new file +13 -0
new file mode 100644
index 0000000..90cee84
@@ -0,0 +1,13 @@
+--- a/net/nfc/llcp/sock.c
++++ b/net/nfc/llcp/sock.c
+@@ -17,8 +17,10 @@
+  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+  */
+ 
++#undef pr_fmt
+ #define pr_fmt(fmt) "llcp: %s: " fmt, __func__
+ 
++#include <linux/printk.h>
+ #include <linux/init.h>
+ #include <linux/kernel.h>
+ #include <linux/module.h>
patches/collateral-evolutions/network/53-pr_fmt/net_nfc_nci_core.patch new file +13 -0
new file mode 100644
index 0000000..f38a7e0
@@ -0,0 +1,13 @@
+--- a/net/nfc/nci/core.c
++++ b/net/nfc/nci/core.c
+@@ -25,8 +25,10 @@
+  *
+  */
+ 
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
+ 
++#include <linux/printk.h>
+ #include <linux/module.h>
+ #include <linux/types.h>
+ #include <linux/workqueue.h>
patches/collateral-evolutions/network/53-pr_fmt/net_nfc_nci_data.patch new file +13 -0
new file mode 100644
index 0000000..bc9c53c
@@ -0,0 +1,13 @@
+--- a/net/nfc/nci/data.c
++++ b/net/nfc/nci/data.c
+@@ -21,8 +21,10 @@
+  *
+  */
+ 
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
+ 
++#include <linux/printk.h>
+ #include <linux/types.h>
+ #include <linux/interrupt.h>
+ #include <linux/wait.h>
patches/collateral-evolutions/network/53-pr_fmt/net_nfc_nci_ntf.patch new file +13 -0
new file mode 100644
index 0000000..f5708b7
@@ -0,0 +1,13 @@
+--- a/net/nfc/nci/ntf.c
++++ b/net/nfc/nci/ntf.c
+@@ -25,8 +25,10 @@
+  *
+  */
+ 
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
+ 
++#include <linux/printk.h>
+ #include <linux/types.h>
+ #include <linux/interrupt.h>
+ #include <linux/bitops.h>
patches/collateral-evolutions/network/53-pr_fmt/net_nfc_nci_rsp.patch new file +12 -0
new file mode 100644
index 0000000..27f264b
@@ -0,0 +1,12 @@
+--- a/net/nfc/nci/rsp.c
++++ b/net/nfc/nci/rsp.c
+@@ -25,7 +25,9 @@
+  *
+  */
+ 
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
++#include <linux/printk.h>
+ 
+ #include <linux/types.h>
+ #include <linux/interrupt.h>
patches/collateral-evolutions/network/53-pr_fmt/net_nfc_netlink.patch new file +13 -0
new file mode 100644
index 0000000..916410c
@@ -0,0 +1,13 @@
+--- a/net/nfc/netlink.c
++++ b/net/nfc/netlink.c
+@@ -21,8 +21,10 @@
+  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+  */
+ 
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
+ 
++#include <linux/printk.h>
+ #include <net/genetlink.h>
+ #include <linux/nfc.h>
+ #include <linux/slab.h>
patches/collateral-evolutions/network/53-pr_fmt/net_nfc_rawsock.patch new file +13 -0
new file mode 100644
index 0000000..a2090b1
@@ -0,0 +1,13 @@
+--- a/net/nfc/rawsock.c
++++ b/net/nfc/rawsock.c
+@@ -21,8 +21,10 @@
+  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+  */
+ 
++#undef pr_fmt
+ #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
+ 
++#include <linux/printk.h>
+ #include <net/tcp_states.h>
+ #include <linux/nfc.h>
+ #include <linux/export.h>
patches/collateral-evolutions/network/74-driver-core-constify-data/INFO new file +7 -0
new file mode 100644
index 0000000..1ea1662
@@ -0,0 +1,7 @@
+This backports:
+
+commit 9f3b795a626ee79574595e06d1437fe0c7d51d29
+Author: Michał Mirosław <[email protected]>
+Date:   Fri Feb 1 20:40:17 2013 +0100
+
+    driver-core: constify data for class_find_device()
patches/collateral-evolutions/network/74-driver-core-constify-data/net_nfc_core.patch new file +14 -0
new file mode 100644
index 0000000..d09365f
@@ -0,0 +1,14 @@
+--- a/net/nfc/core.c
++++ b/net/nfc/core.c
+@@ -732,7 +732,11 @@ struct class nfc_class = {
+ };
+ EXPORT_SYMBOL(nfc_class);
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
+ static int match_idx(struct device *d, const void *data)
++#else
++static int match_idx(struct device *d, void *data)
++#endif
+ {
+ 	struct nfc_dev *dev = to_nfc_dev(d);
+ 	const unsigned int *idx = data;
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 6 lines · Thierry Escande
 .../network/53-pr_fmt/net_nfc_core.patch           |   13 ++++
 .../network/53-pr_fmt/net_nfc_hci_command.patch    |   13 ++++
 .../network/53-pr_fmt/net_nfc_hci_core.patch       |   13 ++++
 .../network/53-pr_fmt/net_nfc_hci_hcp.patch        |   13 ++++
 .../network/53-pr_fmt/net_nfc_hci_llc_shdlc.patch  |   13 ++++
 .../network/53-pr_fmt/net_nfc_llcp_commands.patch  |   13 ++++
Quoted 8 lines
 .../network/53-pr_fmt/net_nfc_llcp_llcp.patch      |   13 ++++
 .../network/53-pr_fmt/net_nfc_llcp_sock.patch      |   13 ++++
 .../network/53-pr_fmt/net_nfc_nci_core.patch       |   13 ++++
 .../network/53-pr_fmt/net_nfc_nci_data.patch       |   13 ++++
 .../network/53-pr_fmt/net_nfc_nci_ntf.patch        |   13 ++++
 .../network/53-pr_fmt/net_nfc_nci_rsp.patch        |   12 ++++
 .../network/53-pr_fmt/net_nfc_netlink.patch        |   13 ++++
 .../network/53-pr_fmt/net_nfc_rawsock.patch        |   13 ++++

FWIW, it's probably more efficient to just put them all into one net_nfc.patch file. The only reason they're split by *file* rather than by *logical group* right now is that it was easy to do automatically and solved the problem I had (of wanting to copy only some drivers and then applying only some patches). For this it's not really needed or even useful to split by file, it was just the fastest way :-)

So I think it'd make sense to put it into a single file, but I'm happy to apply it as-is as well (though I want to give others more time to review, so I'll not do it today)

johannes

#2 lore raw
Quoted 23 lines · Johannes Berg
Quoted 15 lines
 .../network/53-pr_fmt/net_nfc_core.patch           |   13 ++++
 .../network/53-pr_fmt/net_nfc_hci_command.patch    |   13 ++++
 .../network/53-pr_fmt/net_nfc_hci_core.patch       |   13 ++++
 .../network/53-pr_fmt/net_nfc_hci_hcp.patch        |   13 ++++
 .../network/53-pr_fmt/net_nfc_hci_llc_shdlc.patch  |   13 ++++
 .../network/53-pr_fmt/net_nfc_llcp_commands.patch  |   13 ++++
 .../network/53-pr_fmt/net_nfc_llcp_llcp.patch      |   13 ++++
 .../network/53-pr_fmt/net_nfc_llcp_sock.patch      |   13 ++++
 .../network/53-pr_fmt/net_nfc_nci_core.patch       |   13 ++++
 .../network/53-pr_fmt/net_nfc_nci_data.patch       |   13 ++++
 .../network/53-pr_fmt/net_nfc_nci_ntf.patch        |   13 ++++
 .../network/53-pr_fmt/net_nfc_nci_rsp.patch        |   12 ++++
 .../network/53-pr_fmt/net_nfc_netlink.patch        |   13 ++++
 .../network/53-pr_fmt/net_nfc_rawsock.patch        |   13 ++++

FWIW, it's probably more efficient to just put them all into one net_nfc.patch file. The only reason they're split by *file* rather than by *logical group* right now is that it was easy to do automatically and solved the problem I had (of wanting to copy only some drivers and then applying only some patches). For this it's not really needed or even useful to split by file, it was just the fastest way :-)

Quoted 3 lines

So I think it'd make sense to put it into a single file, but I'm happy to apply it as-is as well (though I want to give others more time to review, so I'll not do it today)

How about a directory alone for NFC patches as we do for DRM. In fact perhaps Bluetooth should be split out from network as well, just as ethernet. That is, per subsystem.

Luis

#3 lore raw
Quoted 7 lines · Luis R. Rodriguez
Quoted 7 lines

FWIW, it's probably more efficient to just put them all into one net_nfc.patch file. The only reason they're split by *file* rather than by *logical group* right now is that it was easy to do automatically and solved the problem I had (of wanting to copy only some drivers and then applying only some patches). For this it's not really needed or even useful to split by file, it was just the fastest way :-)

Quoted 7 lines
Quoted 3 lines

So I think it'd make sense to put it into a single file, but I'm happy to apply it as-is as well (though I want to give others more time to review, so I'll not do it today)

How about a directory alone for NFC patches as we do for DRM. In fact perhaps Bluetooth should be split out from network as well, just as ethernet. That is, per subsystem.

Personally, I don't care. In fact, I'm going to change the apply process a bit to just read any *.patch file, sort the list and then see if they need to applied (in that order) -- that way we don't have to put things all those levels down etc. and can split it up in any logical way we like.

johannes