netlink.c (5bbcc0f595fadb4cac0eddc4401035ec0bd95b09) netlink.c (0a833c29d89656025443cb9f0ebff7052dd95ce0)
1/*
2 * Copyright (C) 2011 Instituto Nokia de Tecnologia
3 *
4 * Authors:
5 * Lauro Ramos Venancio <lauro.venancio@openbossa.org>
6 * Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
7 *
8 * Vendor commands implementation based on net/wireless/nl80211.c

--- 61 unchanged lines hidden (view full) ---

70{
71 void *hdr;
72
73 hdr = genlmsg_put(msg, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
74 &nfc_genl_family, flags, NFC_CMD_GET_TARGET);
75 if (!hdr)
76 return -EMSGSIZE;
77
1/*
2 * Copyright (C) 2011 Instituto Nokia de Tecnologia
3 *
4 * Authors:
5 * Lauro Ramos Venancio <lauro.venancio@openbossa.org>
6 * Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
7 *
8 * Vendor commands implementation based on net/wireless/nl80211.c

--- 61 unchanged lines hidden (view full) ---

70{
71 void *hdr;
72
73 hdr = genlmsg_put(msg, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq,
74 &nfc_genl_family, flags, NFC_CMD_GET_TARGET);
75 if (!hdr)
76 return -EMSGSIZE;
77
78 genl_dump_check_consistent(cb, hdr, &nfc_genl_family);
78 genl_dump_check_consistent(cb, hdr);
79
80 if (nla_put_u32(msg, NFC_ATTR_TARGET_INDEX, target->idx) ||
81 nla_put_u32(msg, NFC_ATTR_PROTOCOLS, target->supported_protocols) ||
82 nla_put_u16(msg, NFC_ATTR_TARGET_SENS_RES, target->sens_res) ||
83 nla_put_u8(msg, NFC_ATTR_TARGET_SEL_RES, target->sel_res))
84 goto nla_put_failure;
85 if (target->nfcid1_len > 0 &&
86 nla_put(msg, NFC_ATTR_TARGET_NFCID1, target->nfcid1_len,

--- 511 unchanged lines hidden (view full) ---

598 void *hdr;
599
600 hdr = genlmsg_put(msg, portid, seq, &nfc_genl_family, flags,
601 NFC_CMD_GET_DEVICE);
602 if (!hdr)
603 return -EMSGSIZE;
604
605 if (cb)
79
80 if (nla_put_u32(msg, NFC_ATTR_TARGET_INDEX, target->idx) ||
81 nla_put_u32(msg, NFC_ATTR_PROTOCOLS, target->supported_protocols) ||
82 nla_put_u16(msg, NFC_ATTR_TARGET_SENS_RES, target->sens_res) ||
83 nla_put_u8(msg, NFC_ATTR_TARGET_SEL_RES, target->sel_res))
84 goto nla_put_failure;
85 if (target->nfcid1_len > 0 &&
86 nla_put(msg, NFC_ATTR_TARGET_NFCID1, target->nfcid1_len,

--- 511 unchanged lines hidden (view full) ---

598 void *hdr;
599
600 hdr = genlmsg_put(msg, portid, seq, &nfc_genl_family, flags,
601 NFC_CMD_GET_DEVICE);
602 if (!hdr)
603 return -EMSGSIZE;
604
605 if (cb)
606 genl_dump_check_consistent(cb, hdr, &nfc_genl_family);
606 genl_dump_check_consistent(cb, hdr);
607
608 if (nfc_genl_setup_device_added(dev, msg))
609 goto nla_put_failure;
610
611 genlmsg_end(msg, hdr);
612 return 0;
613
614nla_put_failure:

--- 736 unchanged lines hidden (view full) ---

1351
1352 list_for_each_entry_safe(se, n, &dev->secure_elements, list) {
1353 hdr = genlmsg_put(msg, portid, seq, &nfc_genl_family, flags,
1354 NFC_CMD_GET_SE);
1355 if (!hdr)
1356 goto nla_put_failure;
1357
1358 if (cb)
607
608 if (nfc_genl_setup_device_added(dev, msg))
609 goto nla_put_failure;
610
611 genlmsg_end(msg, hdr);
612 return 0;
613
614nla_put_failure:

--- 736 unchanged lines hidden (view full) ---

1351
1352 list_for_each_entry_safe(se, n, &dev->secure_elements, list) {
1353 hdr = genlmsg_put(msg, portid, seq, &nfc_genl_family, flags,
1354 NFC_CMD_GET_SE);
1355 if (!hdr)
1356 goto nla_put_failure;
1357
1358 if (cb)
1359 genl_dump_check_consistent(cb, hdr, &nfc_genl_family);
1359 genl_dump_check_consistent(cb, hdr);
1360
1361 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) ||
1362 nla_put_u32(msg, NFC_ATTR_SE_INDEX, se->idx) ||
1363 nla_put_u8(msg, NFC_ATTR_SE_TYPE, se->type))
1364 goto nla_put_failure;
1365
1366 genlmsg_end(msg, hdr);
1367 }

--- 533 unchanged lines hidden ---
1360
1361 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) ||
1362 nla_put_u32(msg, NFC_ATTR_SE_INDEX, se->idx) ||
1363 nla_put_u8(msg, NFC_ATTR_SE_TYPE, se->type))
1364 goto nla_put_failure;
1365
1366 genlmsg_end(msg, hdr);
1367 }

--- 533 unchanged lines hidden ---