diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2012-03-04 19:03:53 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-06 15:16:25 -0500 |
commit | 0a40acb24602783fcf6881f915659148aa9807d7 (patch) | |
tree | aad4a42c270c615fdc67f454f974794e8fcd2160 /net/nfc | |
parent | 427a2eb1f568c9c5934a36105232c94553db9b69 (diff) |
NFC: Core code identation fixes
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/nfc')
-rw-r--r-- | net/nfc/af_nfc.c | 2 | ||||
-rw-r--r-- | net/nfc/core.c | 28 | ||||
-rw-r--r-- | net/nfc/netlink.c | 57 | ||||
-rw-r--r-- | net/nfc/nfc.h | 13 | ||||
-rw-r--r-- | net/nfc/rawsock.c | 16 |
5 files changed, 54 insertions, 62 deletions
diff --git a/net/nfc/af_nfc.c b/net/nfc/af_nfc.c index da67756425ce..9d68441e2a5a 100644 --- a/net/nfc/af_nfc.c +++ b/net/nfc/af_nfc.c | |||
@@ -30,7 +30,7 @@ static DEFINE_RWLOCK(proto_tab_lock); | |||
30 | static const struct nfc_protocol *proto_tab[NFC_SOCKPROTO_MAX]; | 30 | static const struct nfc_protocol *proto_tab[NFC_SOCKPROTO_MAX]; |
31 | 31 | ||
32 | static int nfc_sock_create(struct net *net, struct socket *sock, int proto, | 32 | static int nfc_sock_create(struct net *net, struct socket *sock, int proto, |
33 | int kern) | 33 | int kern) |
34 | { | 34 | { |
35 | int rc = -EPROTONOSUPPORT; | 35 | int rc = -EPROTONOSUPPORT; |
36 | 36 | ||
diff --git a/net/nfc/core.c b/net/nfc/core.c index f4f526f73217..295d129864d2 100644 --- a/net/nfc/core.c +++ b/net/nfc/core.c | |||
@@ -256,7 +256,7 @@ error: | |||
256 | } | 256 | } |
257 | 257 | ||
258 | int nfc_dep_link_is_up(struct nfc_dev *dev, u32 target_idx, | 258 | int nfc_dep_link_is_up(struct nfc_dev *dev, u32 target_idx, |
259 | u8 comm_mode, u8 rf_mode) | 259 | u8 comm_mode, u8 rf_mode) |
260 | { | 260 | { |
261 | dev->dep_link_up = true; | 261 | dev->dep_link_up = true; |
262 | dev->dep_rf_mode = rf_mode; | 262 | dev->dep_rf_mode = rf_mode; |
@@ -336,10 +336,8 @@ error: | |||
336 | * | 336 | * |
337 | * The user must wait for the callback before calling this function again. | 337 | * The user must wait for the callback before calling this function again. |
338 | */ | 338 | */ |
339 | int nfc_data_exchange(struct nfc_dev *dev, u32 target_idx, | 339 | int nfc_data_exchange(struct nfc_dev *dev, u32 target_idx, struct sk_buff *skb, |
340 | struct sk_buff *skb, | 340 | data_exchange_cb_t cb, void *cb_context) |
341 | data_exchange_cb_t cb, | ||
342 | void *cb_context) | ||
343 | { | 341 | { |
344 | int rc; | 342 | int rc; |
345 | 343 | ||
@@ -363,8 +361,7 @@ error: | |||
363 | 361 | ||
364 | int nfc_set_remote_general_bytes(struct nfc_dev *dev, u8 *gb, u8 gb_len) | 362 | int nfc_set_remote_general_bytes(struct nfc_dev *dev, u8 *gb, u8 gb_len) |
365 | { | 363 | { |
366 | pr_debug("dev_name=%s gb_len=%d\n", | 364 | pr_debug("dev_name=%s gb_len=%d\n", dev_name(&dev->dev), gb_len); |
367 | dev_name(&dev->dev), gb_len); | ||
368 | 365 | ||
369 | if (gb_len > NFC_MAX_GT_LEN) | 366 | if (gb_len > NFC_MAX_GT_LEN) |
370 | return -EINVAL; | 367 | return -EINVAL; |
@@ -380,8 +377,8 @@ EXPORT_SYMBOL(nfc_set_remote_general_bytes); | |||
380 | * @gfp: gfp flags | 377 | * @gfp: gfp flags |
381 | */ | 378 | */ |
382 | struct sk_buff *nfc_alloc_send_skb(struct nfc_dev *dev, struct sock *sk, | 379 | struct sk_buff *nfc_alloc_send_skb(struct nfc_dev *dev, struct sock *sk, |
383 | unsigned int flags, unsigned int size, | 380 | unsigned int flags, unsigned int size, |
384 | unsigned int *err) | 381 | unsigned int *err) |
385 | { | 382 | { |
386 | struct sk_buff *skb; | 383 | struct sk_buff *skb; |
387 | unsigned int total_size; | 384 | unsigned int total_size; |
@@ -428,8 +425,8 @@ EXPORT_SYMBOL(nfc_alloc_recv_skb); | |||
428 | * are found. After calling this function, the device driver must stop | 425 | * are found. After calling this function, the device driver must stop |
429 | * polling for targets. | 426 | * polling for targets. |
430 | */ | 427 | */ |
431 | int nfc_targets_found(struct nfc_dev *dev, struct nfc_target *targets, | 428 | int nfc_targets_found(struct nfc_dev *dev, |
432 | int n_targets) | 429 | struct nfc_target *targets, int n_targets) |
433 | { | 430 | { |
434 | pr_debug("dev_name=%s n_targets=%d\n", dev_name(&dev->dev), n_targets); | 431 | pr_debug("dev_name=%s n_targets=%d\n", dev_name(&dev->dev), n_targets); |
435 | 432 | ||
@@ -441,7 +438,7 @@ int nfc_targets_found(struct nfc_dev *dev, struct nfc_target *targets, | |||
441 | 438 | ||
442 | kfree(dev->targets); | 439 | kfree(dev->targets); |
443 | dev->targets = kmemdup(targets, n_targets * sizeof(struct nfc_target), | 440 | dev->targets = kmemdup(targets, n_targets * sizeof(struct nfc_target), |
444 | GFP_ATOMIC); | 441 | GFP_ATOMIC); |
445 | 442 | ||
446 | if (!dev->targets) { | 443 | if (!dev->targets) { |
447 | dev->n_targets = 0; | 444 | dev->n_targets = 0; |
@@ -501,15 +498,14 @@ struct nfc_dev *nfc_get_device(unsigned idx) | |||
501 | * @supported_protocols: NFC protocols supported by the device | 498 | * @supported_protocols: NFC protocols supported by the device |
502 | */ | 499 | */ |
503 | struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops, | 500 | struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops, |
504 | u32 supported_protocols, | 501 | u32 supported_protocols, |
505 | int tx_headroom, | 502 | int tx_headroom, int tx_tailroom) |
506 | int tx_tailroom) | ||
507 | { | 503 | { |
508 | static atomic_t dev_no = ATOMIC_INIT(0); | 504 | static atomic_t dev_no = ATOMIC_INIT(0); |
509 | struct nfc_dev *dev; | 505 | struct nfc_dev *dev; |
510 | 506 | ||
511 | if (!ops->start_poll || !ops->stop_poll || !ops->activate_target || | 507 | if (!ops->start_poll || !ops->stop_poll || !ops->activate_target || |
512 | !ops->deactivate_target || !ops->data_exchange) | 508 | !ops->deactivate_target || !ops->data_exchange) |
513 | return NULL; | 509 | return NULL; |
514 | 510 | ||
515 | if (!supported_protocols) | 511 | if (!supported_protocols) |
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c index fa620d03799e..6404052d6c07 100644 --- a/net/nfc/netlink.c +++ b/net/nfc/netlink.c | |||
@@ -52,31 +52,30 @@ static const struct nla_policy nfc_genl_policy[NFC_ATTR_MAX + 1] = { | |||
52 | }; | 52 | }; |
53 | 53 | ||
54 | static int nfc_genl_send_target(struct sk_buff *msg, struct nfc_target *target, | 54 | static int nfc_genl_send_target(struct sk_buff *msg, struct nfc_target *target, |
55 | struct netlink_callback *cb, int flags) | 55 | struct netlink_callback *cb, int flags) |
56 | { | 56 | { |
57 | void *hdr; | 57 | void *hdr; |
58 | 58 | ||
59 | hdr = genlmsg_put(msg, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, | 59 | hdr = genlmsg_put(msg, NETLINK_CB(cb->skb).pid, cb->nlh->nlmsg_seq, |
60 | &nfc_genl_family, flags, NFC_CMD_GET_TARGET); | 60 | &nfc_genl_family, flags, NFC_CMD_GET_TARGET); |
61 | if (!hdr) | 61 | if (!hdr) |
62 | return -EMSGSIZE; | 62 | return -EMSGSIZE; |
63 | 63 | ||
64 | genl_dump_check_consistent(cb, hdr, &nfc_genl_family); | 64 | genl_dump_check_consistent(cb, hdr, &nfc_genl_family); |
65 | 65 | ||
66 | NLA_PUT_U32(msg, NFC_ATTR_TARGET_INDEX, target->idx); | 66 | NLA_PUT_U32(msg, NFC_ATTR_TARGET_INDEX, target->idx); |
67 | NLA_PUT_U32(msg, NFC_ATTR_PROTOCOLS, | 67 | NLA_PUT_U32(msg, NFC_ATTR_PROTOCOLS, target->supported_protocols); |
68 | target->supported_protocols); | ||
69 | NLA_PUT_U16(msg, NFC_ATTR_TARGET_SENS_RES, target->sens_res); | 68 | NLA_PUT_U16(msg, NFC_ATTR_TARGET_SENS_RES, target->sens_res); |
70 | NLA_PUT_U8(msg, NFC_ATTR_TARGET_SEL_RES, target->sel_res); | 69 | NLA_PUT_U8(msg, NFC_ATTR_TARGET_SEL_RES, target->sel_res); |
71 | if (target->nfcid1_len > 0) | 70 | if (target->nfcid1_len > 0) |
72 | NLA_PUT(msg, NFC_ATTR_TARGET_NFCID1, target->nfcid1_len, | 71 | NLA_PUT(msg, NFC_ATTR_TARGET_NFCID1, target->nfcid1_len, |
73 | target->nfcid1); | 72 | target->nfcid1); |
74 | if (target->sensb_res_len > 0) | 73 | if (target->sensb_res_len > 0) |
75 | NLA_PUT(msg, NFC_ATTR_TARGET_SENSB_RES, target->sensb_res_len, | 74 | NLA_PUT(msg, NFC_ATTR_TARGET_SENSB_RES, target->sensb_res_len, |
76 | target->sensb_res); | 75 | target->sensb_res); |
77 | if (target->sensf_res_len > 0) | 76 | if (target->sensf_res_len > 0) |
78 | NLA_PUT(msg, NFC_ATTR_TARGET_SENSF_RES, target->sensf_res_len, | 77 | NLA_PUT(msg, NFC_ATTR_TARGET_SENSF_RES, target->sensf_res_len, |
79 | target->sensf_res); | 78 | target->sensf_res); |
80 | 79 | ||
81 | return genlmsg_end(msg, hdr); | 80 | return genlmsg_end(msg, hdr); |
82 | 81 | ||
@@ -92,9 +91,9 @@ static struct nfc_dev *__get_device_from_cb(struct netlink_callback *cb) | |||
92 | u32 idx; | 91 | u32 idx; |
93 | 92 | ||
94 | rc = nlmsg_parse(cb->nlh, GENL_HDRLEN + nfc_genl_family.hdrsize, | 93 | rc = nlmsg_parse(cb->nlh, GENL_HDRLEN + nfc_genl_family.hdrsize, |
95 | nfc_genl_family.attrbuf, | 94 | nfc_genl_family.attrbuf, |
96 | nfc_genl_family.maxattr, | 95 | nfc_genl_family.maxattr, |
97 | nfc_genl_policy); | 96 | nfc_genl_policy); |
98 | if (rc < 0) | 97 | if (rc < 0) |
99 | return ERR_PTR(rc); | 98 | return ERR_PTR(rc); |
100 | 99 | ||
@@ -111,7 +110,7 @@ static struct nfc_dev *__get_device_from_cb(struct netlink_callback *cb) | |||
111 | } | 110 | } |
112 | 111 | ||
113 | static int nfc_genl_dump_targets(struct sk_buff *skb, | 112 | static int nfc_genl_dump_targets(struct sk_buff *skb, |
114 | struct netlink_callback *cb) | 113 | struct netlink_callback *cb) |
115 | { | 114 | { |
116 | int i = cb->args[0]; | 115 | int i = cb->args[0]; |
117 | struct nfc_dev *dev = (struct nfc_dev *) cb->args[1]; | 116 | struct nfc_dev *dev = (struct nfc_dev *) cb->args[1]; |
@@ -131,7 +130,7 @@ static int nfc_genl_dump_targets(struct sk_buff *skb, | |||
131 | 130 | ||
132 | while (i < dev->n_targets) { | 131 | while (i < dev->n_targets) { |
133 | rc = nfc_genl_send_target(skb, &dev->targets[i], cb, | 132 | rc = nfc_genl_send_target(skb, &dev->targets[i], cb, |
134 | NLM_F_MULTI); | 133 | NLM_F_MULTI); |
135 | if (rc < 0) | 134 | if (rc < 0) |
136 | break; | 135 | break; |
137 | 136 | ||
@@ -167,7 +166,7 @@ int nfc_genl_targets_found(struct nfc_dev *dev) | |||
167 | return -ENOMEM; | 166 | return -ENOMEM; |
168 | 167 | ||
169 | hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, | 168 | hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, |
170 | NFC_EVENT_TARGETS_FOUND); | 169 | NFC_EVENT_TARGETS_FOUND); |
171 | if (!hdr) | 170 | if (!hdr) |
172 | goto free_msg; | 171 | goto free_msg; |
173 | 172 | ||
@@ -194,7 +193,7 @@ int nfc_genl_device_added(struct nfc_dev *dev) | |||
194 | return -ENOMEM; | 193 | return -ENOMEM; |
195 | 194 | ||
196 | hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, | 195 | hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, |
197 | NFC_EVENT_DEVICE_ADDED); | 196 | NFC_EVENT_DEVICE_ADDED); |
198 | if (!hdr) | 197 | if (!hdr) |
199 | goto free_msg; | 198 | goto free_msg; |
200 | 199 | ||
@@ -226,7 +225,7 @@ int nfc_genl_device_removed(struct nfc_dev *dev) | |||
226 | return -ENOMEM; | 225 | return -ENOMEM; |
227 | 226 | ||
228 | hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, | 227 | hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, |
229 | NFC_EVENT_DEVICE_REMOVED); | 228 | NFC_EVENT_DEVICE_REMOVED); |
230 | if (!hdr) | 229 | if (!hdr) |
231 | goto free_msg; | 230 | goto free_msg; |
232 | 231 | ||
@@ -246,14 +245,14 @@ free_msg: | |||
246 | } | 245 | } |
247 | 246 | ||
248 | static int nfc_genl_send_device(struct sk_buff *msg, struct nfc_dev *dev, | 247 | static int nfc_genl_send_device(struct sk_buff *msg, struct nfc_dev *dev, |
249 | u32 pid, u32 seq, | 248 | u32 pid, u32 seq, |
250 | struct netlink_callback *cb, | 249 | struct netlink_callback *cb, |
251 | int flags) | 250 | int flags) |
252 | { | 251 | { |
253 | void *hdr; | 252 | void *hdr; |
254 | 253 | ||
255 | hdr = genlmsg_put(msg, pid, seq, &nfc_genl_family, flags, | 254 | hdr = genlmsg_put(msg, pid, seq, &nfc_genl_family, flags, |
256 | NFC_CMD_GET_DEVICE); | 255 | NFC_CMD_GET_DEVICE); |
257 | if (!hdr) | 256 | if (!hdr) |
258 | return -EMSGSIZE; | 257 | return -EMSGSIZE; |
259 | 258 | ||
@@ -273,7 +272,7 @@ nla_put_failure: | |||
273 | } | 272 | } |
274 | 273 | ||
275 | static int nfc_genl_dump_devices(struct sk_buff *skb, | 274 | static int nfc_genl_dump_devices(struct sk_buff *skb, |
276 | struct netlink_callback *cb) | 275 | struct netlink_callback *cb) |
277 | { | 276 | { |
278 | struct class_dev_iter *iter = (struct class_dev_iter *) cb->args[0]; | 277 | struct class_dev_iter *iter = (struct class_dev_iter *) cb->args[0]; |
279 | struct nfc_dev *dev = (struct nfc_dev *) cb->args[1]; | 278 | struct nfc_dev *dev = (struct nfc_dev *) cb->args[1]; |
@@ -300,8 +299,7 @@ static int nfc_genl_dump_devices(struct sk_buff *skb, | |||
300 | int rc; | 299 | int rc; |
301 | 300 | ||
302 | rc = nfc_genl_send_device(skb, dev, NETLINK_CB(cb->skb).pid, | 301 | rc = nfc_genl_send_device(skb, dev, NETLINK_CB(cb->skb).pid, |
303 | cb->nlh->nlmsg_seq, | 302 | cb->nlh->nlmsg_seq, cb, NLM_F_MULTI); |
304 | cb, NLM_F_MULTI); | ||
305 | if (rc < 0) | 303 | if (rc < 0) |
306 | break; | 304 | break; |
307 | 305 | ||
@@ -326,7 +324,7 @@ static int nfc_genl_dump_devices_done(struct netlink_callback *cb) | |||
326 | } | 324 | } |
327 | 325 | ||
328 | int nfc_genl_dep_link_up_event(struct nfc_dev *dev, u32 target_idx, | 326 | int nfc_genl_dep_link_up_event(struct nfc_dev *dev, u32 target_idx, |
329 | u8 comm_mode, u8 rf_mode) | 327 | u8 comm_mode, u8 rf_mode) |
330 | { | 328 | { |
331 | struct sk_buff *msg; | 329 | struct sk_buff *msg; |
332 | void *hdr; | 330 | void *hdr; |
@@ -337,8 +335,7 @@ int nfc_genl_dep_link_up_event(struct nfc_dev *dev, u32 target_idx, | |||
337 | if (!msg) | 335 | if (!msg) |
338 | return -ENOMEM; | 336 | return -ENOMEM; |
339 | 337 | ||
340 | hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, | 338 | hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, NFC_CMD_DEP_LINK_UP); |
341 | NFC_CMD_DEP_LINK_UP); | ||
342 | if (!hdr) | 339 | if (!hdr) |
343 | goto free_msg; | 340 | goto free_msg; |
344 | 341 | ||
@@ -375,7 +372,7 @@ int nfc_genl_dep_link_down_event(struct nfc_dev *dev) | |||
375 | return -ENOMEM; | 372 | return -ENOMEM; |
376 | 373 | ||
377 | hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, | 374 | hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, |
378 | NFC_CMD_DEP_LINK_DOWN); | 375 | NFC_CMD_DEP_LINK_DOWN); |
379 | if (!hdr) | 376 | if (!hdr) |
380 | goto free_msg; | 377 | goto free_msg; |
381 | 378 | ||
@@ -417,7 +414,7 @@ static int nfc_genl_get_device(struct sk_buff *skb, struct genl_info *info) | |||
417 | } | 414 | } |
418 | 415 | ||
419 | rc = nfc_genl_send_device(msg, dev, info->snd_pid, info->snd_seq, | 416 | rc = nfc_genl_send_device(msg, dev, info->snd_pid, info->snd_seq, |
420 | NULL, 0); | 417 | NULL, 0); |
421 | if (rc < 0) | 418 | if (rc < 0) |
422 | goto out_free; | 419 | goto out_free; |
423 | 420 | ||
@@ -484,7 +481,7 @@ static int nfc_genl_start_poll(struct sk_buff *skb, struct genl_info *info) | |||
484 | pr_debug("Poll start\n"); | 481 | pr_debug("Poll start\n"); |
485 | 482 | ||
486 | if (!info->attrs[NFC_ATTR_DEVICE_INDEX] || | 483 | if (!info->attrs[NFC_ATTR_DEVICE_INDEX] || |
487 | !info->attrs[NFC_ATTR_PROTOCOLS]) | 484 | !info->attrs[NFC_ATTR_PROTOCOLS]) |
488 | return -EINVAL; | 485 | return -EINVAL; |
489 | 486 | ||
490 | idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX]); | 487 | idx = nla_get_u32(info->attrs[NFC_ATTR_DEVICE_INDEX]); |
@@ -640,7 +637,7 @@ static struct genl_ops nfc_genl_ops[] = { | |||
640 | }; | 637 | }; |
641 | 638 | ||
642 | static int nfc_genl_rcv_nl_event(struct notifier_block *this, | 639 | static int nfc_genl_rcv_nl_event(struct notifier_block *this, |
643 | unsigned long event, void *ptr) | 640 | unsigned long event, void *ptr) |
644 | { | 641 | { |
645 | struct netlink_notify *n = ptr; | 642 | struct netlink_notify *n = ptr; |
646 | struct class_dev_iter iter; | 643 | struct class_dev_iter iter; |
@@ -693,7 +690,7 @@ int __init nfc_genl_init(void) | |||
693 | int rc; | 690 | int rc; |
694 | 691 | ||
695 | rc = genl_register_family_with_ops(&nfc_genl_family, nfc_genl_ops, | 692 | rc = genl_register_family_with_ops(&nfc_genl_family, nfc_genl_ops, |
696 | ARRAY_SIZE(nfc_genl_ops)); | 693 | ARRAY_SIZE(nfc_genl_ops)); |
697 | if (rc) | 694 | if (rc) |
698 | return rc; | 695 | return rc; |
699 | 696 | ||
diff --git a/net/nfc/nfc.h b/net/nfc/nfc.h index 2fd83b16df68..ec8794c1099c 100644 --- a/net/nfc/nfc.h +++ b/net/nfc/nfc.h | |||
@@ -32,7 +32,7 @@ struct nfc_protocol { | |||
32 | struct proto *proto; | 32 | struct proto *proto; |
33 | struct module *owner; | 33 | struct module *owner; |
34 | int (*create)(struct net *net, struct socket *sock, | 34 | int (*create)(struct net *net, struct socket *sock, |
35 | const struct nfc_protocol *nfc_proto); | 35 | const struct nfc_protocol *nfc_proto); |
36 | }; | 36 | }; |
37 | 37 | ||
38 | struct nfc_rawsock { | 38 | struct nfc_rawsock { |
@@ -65,7 +65,7 @@ static inline void nfc_llcp_mac_is_down(struct nfc_dev *dev) | |||
65 | } | 65 | } |
66 | 66 | ||
67 | static inline void nfc_llcp_mac_is_up(struct nfc_dev *dev, u32 target_idx, | 67 | static inline void nfc_llcp_mac_is_up(struct nfc_dev *dev, u32 target_idx, |
68 | u8 comm_mode, u8 rf_mode) | 68 | u8 comm_mode, u8 rf_mode) |
69 | { | 69 | { |
70 | } | 70 | } |
71 | 71 | ||
@@ -78,7 +78,8 @@ static inline void nfc_llcp_unregister_device(struct nfc_dev *dev) | |||
78 | { | 78 | { |
79 | } | 79 | } |
80 | 80 | ||
81 | static inline int nfc_llcp_set_remote_gb(struct nfc_dev *dev, u8 *gb, u8 gb_len) | 81 | static inline int nfc_llcp_set_remote_gb(struct nfc_dev *dev, |
82 | u8 *gb, u8 gb_len) | ||
82 | { | 83 | { |
83 | return 0; | 84 | return 0; |
84 | } | 85 | } |
@@ -168,9 +169,7 @@ int nfc_activate_target(struct nfc_dev *dev, u32 target_idx, u32 protocol); | |||
168 | 169 | ||
169 | int nfc_deactivate_target(struct nfc_dev *dev, u32 target_idx); | 170 | int nfc_deactivate_target(struct nfc_dev *dev, u32 target_idx); |
170 | 171 | ||
171 | int nfc_data_exchange(struct nfc_dev *dev, u32 target_idx, | 172 | int nfc_data_exchange(struct nfc_dev *dev, u32 target_idx, struct sk_buff *skb, |
172 | struct sk_buff *skb, | 173 | data_exchange_cb_t cb, void *cb_context); |
173 | data_exchange_cb_t cb, | ||
174 | void *cb_context); | ||
175 | 174 | ||
176 | #endif /* __LOCAL_NFC_H */ | 175 | #endif /* __LOCAL_NFC_H */ |
diff --git a/net/nfc/rawsock.c b/net/nfc/rawsock.c index 5325439b0c60..5a839ceb2e82 100644 --- a/net/nfc/rawsock.c +++ b/net/nfc/rawsock.c | |||
@@ -63,7 +63,7 @@ static int rawsock_release(struct socket *sock) | |||
63 | } | 63 | } |
64 | 64 | ||
65 | static int rawsock_connect(struct socket *sock, struct sockaddr *_addr, | 65 | static int rawsock_connect(struct socket *sock, struct sockaddr *_addr, |
66 | int len, int flags) | 66 | int len, int flags) |
67 | { | 67 | { |
68 | struct sock *sk = sock->sk; | 68 | struct sock *sk = sock->sk; |
69 | struct sockaddr_nfc *addr = (struct sockaddr_nfc *)_addr; | 69 | struct sockaddr_nfc *addr = (struct sockaddr_nfc *)_addr; |
@@ -73,7 +73,7 @@ static int rawsock_connect(struct socket *sock, struct sockaddr *_addr, | |||
73 | pr_debug("sock=%p sk=%p flags=%d\n", sock, sk, flags); | 73 | pr_debug("sock=%p sk=%p flags=%d\n", sock, sk, flags); |
74 | 74 | ||
75 | if (!addr || len < sizeof(struct sockaddr_nfc) || | 75 | if (!addr || len < sizeof(struct sockaddr_nfc) || |
76 | addr->sa_family != AF_NFC) | 76 | addr->sa_family != AF_NFC) |
77 | return -EINVAL; | 77 | return -EINVAL; |
78 | 78 | ||
79 | pr_debug("addr dev_idx=%u target_idx=%u protocol=%u\n", | 79 | pr_debug("addr dev_idx=%u target_idx=%u protocol=%u\n", |
@@ -120,7 +120,7 @@ static int rawsock_add_header(struct sk_buff *skb) | |||
120 | } | 120 | } |
121 | 121 | ||
122 | static void rawsock_data_exchange_complete(void *context, struct sk_buff *skb, | 122 | static void rawsock_data_exchange_complete(void *context, struct sk_buff *skb, |
123 | int err) | 123 | int err) |
124 | { | 124 | { |
125 | struct sock *sk = (struct sock *) context; | 125 | struct sock *sk = (struct sock *) context; |
126 | 126 | ||
@@ -173,7 +173,7 @@ static void rawsock_tx_work(struct work_struct *work) | |||
173 | 173 | ||
174 | sock_hold(sk); | 174 | sock_hold(sk); |
175 | rc = nfc_data_exchange(dev, target_idx, skb, | 175 | rc = nfc_data_exchange(dev, target_idx, skb, |
176 | rawsock_data_exchange_complete, sk); | 176 | rawsock_data_exchange_complete, sk); |
177 | if (rc) { | 177 | if (rc) { |
178 | rawsock_report_error(sk, rc); | 178 | rawsock_report_error(sk, rc); |
179 | sock_put(sk); | 179 | sock_put(sk); |
@@ -181,7 +181,7 @@ static void rawsock_tx_work(struct work_struct *work) | |||
181 | } | 181 | } |
182 | 182 | ||
183 | static int rawsock_sendmsg(struct kiocb *iocb, struct socket *sock, | 183 | static int rawsock_sendmsg(struct kiocb *iocb, struct socket *sock, |
184 | struct msghdr *msg, size_t len) | 184 | struct msghdr *msg, size_t len) |
185 | { | 185 | { |
186 | struct sock *sk = sock->sk; | 186 | struct sock *sk = sock->sk; |
187 | struct nfc_dev *dev = nfc_rawsock(sk)->dev; | 187 | struct nfc_dev *dev = nfc_rawsock(sk)->dev; |
@@ -218,7 +218,7 @@ static int rawsock_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
218 | } | 218 | } |
219 | 219 | ||
220 | static int rawsock_recvmsg(struct kiocb *iocb, struct socket *sock, | 220 | static int rawsock_recvmsg(struct kiocb *iocb, struct socket *sock, |
221 | struct msghdr *msg, size_t len, int flags) | 221 | struct msghdr *msg, size_t len, int flags) |
222 | { | 222 | { |
223 | int noblock = flags & MSG_DONTWAIT; | 223 | int noblock = flags & MSG_DONTWAIT; |
224 | struct sock *sk = sock->sk; | 224 | struct sock *sk = sock->sk; |
@@ -274,7 +274,7 @@ static void rawsock_destruct(struct sock *sk) | |||
274 | 274 | ||
275 | if (sk->sk_state == TCP_ESTABLISHED) { | 275 | if (sk->sk_state == TCP_ESTABLISHED) { |
276 | nfc_deactivate_target(nfc_rawsock(sk)->dev, | 276 | nfc_deactivate_target(nfc_rawsock(sk)->dev, |
277 | nfc_rawsock(sk)->target_idx); | 277 | nfc_rawsock(sk)->target_idx); |
278 | nfc_put_device(nfc_rawsock(sk)->dev); | 278 | nfc_put_device(nfc_rawsock(sk)->dev); |
279 | } | 279 | } |
280 | 280 | ||
@@ -287,7 +287,7 @@ static void rawsock_destruct(struct sock *sk) | |||
287 | } | 287 | } |
288 | 288 | ||
289 | static int rawsock_create(struct net *net, struct socket *sock, | 289 | static int rawsock_create(struct net *net, struct socket *sock, |
290 | const struct nfc_protocol *nfc_proto) | 290 | const struct nfc_protocol *nfc_proto) |
291 | { | 291 | { |
292 | struct sock *sk; | 292 | struct sock *sk; |
293 | 293 | ||