summaryrefslogtreecommitdiff
path: root/patches/collateral-evolutions/nfc/01-netlink-portid/net_nfc_netlink.patch
blob: 61770ce8b5993ae8f1e6173a106aeec272d3168b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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);
 	}