• Home
  • Raw
  • Download

Lines Matching refs:msg

57 static int nfc_genl_send_target(struct sk_buff *msg, struct nfc_target *target,  in nfc_genl_send_target()  argument
62 hdr = genlmsg_put(msg, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, in nfc_genl_send_target()
69 if (nla_put_u32(msg, NFC_ATTR_TARGET_INDEX, target->idx) || in nfc_genl_send_target()
70 nla_put_u32(msg, NFC_ATTR_PROTOCOLS, target->supported_protocols) || in nfc_genl_send_target()
71 nla_put_u16(msg, NFC_ATTR_TARGET_SENS_RES, target->sens_res) || in nfc_genl_send_target()
72 nla_put_u8(msg, NFC_ATTR_TARGET_SEL_RES, target->sel_res)) in nfc_genl_send_target()
75 nla_put(msg, NFC_ATTR_TARGET_NFCID1, target->nfcid1_len, in nfc_genl_send_target()
79 nla_put(msg, NFC_ATTR_TARGET_SENSB_RES, target->sensb_res_len, in nfc_genl_send_target()
83 nla_put(msg, NFC_ATTR_TARGET_SENSF_RES, target->sensf_res_len, in nfc_genl_send_target()
88 if (nla_put_u8(msg, NFC_ATTR_TARGET_ISO15693_DSFID, in nfc_genl_send_target()
90 nla_put(msg, NFC_ATTR_TARGET_ISO15693_UID, in nfc_genl_send_target()
95 genlmsg_end(msg, hdr); in nfc_genl_send_target()
99 genlmsg_cancel(msg, hdr); in nfc_genl_send_target()
176 struct sk_buff *msg; in nfc_genl_targets_found() local
181 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); in nfc_genl_targets_found()
182 if (!msg) in nfc_genl_targets_found()
185 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, in nfc_genl_targets_found()
190 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) in nfc_genl_targets_found()
193 genlmsg_end(msg, hdr); in nfc_genl_targets_found()
195 return genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); in nfc_genl_targets_found()
199 nlmsg_free(msg); in nfc_genl_targets_found()
205 struct sk_buff *msg; in nfc_genl_target_lost() local
208 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nfc_genl_target_lost()
209 if (!msg) in nfc_genl_target_lost()
212 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, in nfc_genl_target_lost()
217 if (nla_put_string(msg, NFC_ATTR_DEVICE_NAME, nfc_device_name(dev)) || in nfc_genl_target_lost()
218 nla_put_u32(msg, NFC_ATTR_TARGET_INDEX, target_idx)) in nfc_genl_target_lost()
221 genlmsg_end(msg, hdr); in nfc_genl_target_lost()
223 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); in nfc_genl_target_lost()
229 nlmsg_free(msg); in nfc_genl_target_lost()
235 struct sk_buff *msg; in nfc_genl_tm_activated() local
238 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nfc_genl_tm_activated()
239 if (!msg) in nfc_genl_tm_activated()
242 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, in nfc_genl_tm_activated()
247 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) in nfc_genl_tm_activated()
249 if (nla_put_u32(msg, NFC_ATTR_TM_PROTOCOLS, protocol)) in nfc_genl_tm_activated()
252 genlmsg_end(msg, hdr); in nfc_genl_tm_activated()
254 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); in nfc_genl_tm_activated()
260 nlmsg_free(msg); in nfc_genl_tm_activated()
266 struct sk_buff *msg; in nfc_genl_tm_deactivated() local
269 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nfc_genl_tm_deactivated()
270 if (!msg) in nfc_genl_tm_deactivated()
273 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, in nfc_genl_tm_deactivated()
278 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) in nfc_genl_tm_deactivated()
281 genlmsg_end(msg, hdr); in nfc_genl_tm_deactivated()
283 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); in nfc_genl_tm_deactivated()
289 nlmsg_free(msg); in nfc_genl_tm_deactivated()
293 static int nfc_genl_setup_device_added(struct nfc_dev *dev, struct sk_buff *msg) in nfc_genl_setup_device_added() argument
295 if (nla_put_string(msg, NFC_ATTR_DEVICE_NAME, nfc_device_name(dev)) || in nfc_genl_setup_device_added()
296 nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) || in nfc_genl_setup_device_added()
297 nla_put_u32(msg, NFC_ATTR_PROTOCOLS, dev->supported_protocols) || in nfc_genl_setup_device_added()
298 nla_put_u8(msg, NFC_ATTR_DEVICE_POWERED, dev->dev_up) || in nfc_genl_setup_device_added()
299 nla_put_u8(msg, NFC_ATTR_RF_MODE, dev->rf_mode)) in nfc_genl_setup_device_added()
306 struct sk_buff *msg; in nfc_genl_device_added() local
309 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nfc_genl_device_added()
310 if (!msg) in nfc_genl_device_added()
313 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, in nfc_genl_device_added()
318 if (nfc_genl_setup_device_added(dev, msg)) in nfc_genl_device_added()
321 genlmsg_end(msg, hdr); in nfc_genl_device_added()
323 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); in nfc_genl_device_added()
329 nlmsg_free(msg); in nfc_genl_device_added()
335 struct sk_buff *msg; in nfc_genl_device_removed() local
338 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nfc_genl_device_removed()
339 if (!msg) in nfc_genl_device_removed()
342 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, in nfc_genl_device_removed()
347 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) in nfc_genl_device_removed()
350 genlmsg_end(msg, hdr); in nfc_genl_device_removed()
352 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); in nfc_genl_device_removed()
358 nlmsg_free(msg); in nfc_genl_device_removed()
364 struct sk_buff *msg; in nfc_genl_llc_send_sdres() local
372 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nfc_genl_llc_send_sdres()
373 if (!msg) in nfc_genl_llc_send_sdres()
376 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, in nfc_genl_llc_send_sdres()
381 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) in nfc_genl_llc_send_sdres()
384 sdp_attr = nla_nest_start_noflag(msg, NFC_ATTR_LLC_SDP); in nfc_genl_llc_send_sdres()
394 uri_attr = nla_nest_start_noflag(msg, i++); in nfc_genl_llc_send_sdres()
400 if (nla_put_u8(msg, NFC_SDP_ATTR_SAP, sdres->sap)) in nfc_genl_llc_send_sdres()
403 if (nla_put_string(msg, NFC_SDP_ATTR_URI, sdres->uri)) in nfc_genl_llc_send_sdres()
406 nla_nest_end(msg, uri_attr); in nfc_genl_llc_send_sdres()
413 nla_nest_end(msg, sdp_attr); in nfc_genl_llc_send_sdres()
415 genlmsg_end(msg, hdr); in nfc_genl_llc_send_sdres()
417 return genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); in nfc_genl_llc_send_sdres()
421 nlmsg_free(msg); in nfc_genl_llc_send_sdres()
430 struct sk_buff *msg; in nfc_genl_se_added() local
433 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nfc_genl_se_added()
434 if (!msg) in nfc_genl_se_added()
437 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, in nfc_genl_se_added()
442 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) || in nfc_genl_se_added()
443 nla_put_u32(msg, NFC_ATTR_SE_INDEX, se_idx) || in nfc_genl_se_added()
444 nla_put_u8(msg, NFC_ATTR_SE_TYPE, type)) in nfc_genl_se_added()
447 genlmsg_end(msg, hdr); in nfc_genl_se_added()
449 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); in nfc_genl_se_added()
455 nlmsg_free(msg); in nfc_genl_se_added()
461 struct sk_buff *msg; in nfc_genl_se_removed() local
464 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nfc_genl_se_removed()
465 if (!msg) in nfc_genl_se_removed()
468 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, in nfc_genl_se_removed()
473 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) || in nfc_genl_se_removed()
474 nla_put_u32(msg, NFC_ATTR_SE_INDEX, se_idx)) in nfc_genl_se_removed()
477 genlmsg_end(msg, hdr); in nfc_genl_se_removed()
479 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); in nfc_genl_se_removed()
485 nlmsg_free(msg); in nfc_genl_se_removed()
493 struct sk_buff *msg; in nfc_genl_se_transaction() local
496 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nfc_genl_se_transaction()
497 if (!msg) in nfc_genl_se_transaction()
500 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, in nfc_genl_se_transaction()
509 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) || in nfc_genl_se_transaction()
510 nla_put_u32(msg, NFC_ATTR_SE_INDEX, se_idx) || in nfc_genl_se_transaction()
511 nla_put_u8(msg, NFC_ATTR_SE_TYPE, se->type) || in nfc_genl_se_transaction()
512 nla_put(msg, NFC_ATTR_SE_AID, evt_transaction->aid_len, in nfc_genl_se_transaction()
514 nla_put(msg, NFC_ATTR_SE_PARAMS, evt_transaction->params_len, in nfc_genl_se_transaction()
521 genlmsg_end(msg, hdr); in nfc_genl_se_transaction()
523 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); in nfc_genl_se_transaction()
531 nlmsg_free(msg); in nfc_genl_se_transaction()
538 struct sk_buff *msg; in nfc_genl_se_connectivity() local
541 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nfc_genl_se_connectivity()
542 if (!msg) in nfc_genl_se_connectivity()
545 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, in nfc_genl_se_connectivity()
554 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) || in nfc_genl_se_connectivity()
555 nla_put_u32(msg, NFC_ATTR_SE_INDEX, se_idx) || in nfc_genl_se_connectivity()
556 nla_put_u8(msg, NFC_ATTR_SE_TYPE, se->type)) in nfc_genl_se_connectivity()
559 genlmsg_end(msg, hdr); in nfc_genl_se_connectivity()
561 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); in nfc_genl_se_connectivity()
567 nlmsg_free(msg); in nfc_genl_se_connectivity()
571 static int nfc_genl_send_device(struct sk_buff *msg, struct nfc_dev *dev, in nfc_genl_send_device() argument
578 hdr = genlmsg_put(msg, portid, seq, &nfc_genl_family, flags, in nfc_genl_send_device()
586 if (nfc_genl_setup_device_added(dev, msg)) in nfc_genl_send_device()
589 genlmsg_end(msg, hdr); in nfc_genl_send_device()
593 genlmsg_cancel(msg, hdr); in nfc_genl_send_device()
652 struct sk_buff *msg; in nfc_genl_dep_link_up_event() local
657 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); in nfc_genl_dep_link_up_event()
658 if (!msg) in nfc_genl_dep_link_up_event()
661 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, NFC_CMD_DEP_LINK_UP); in nfc_genl_dep_link_up_event()
665 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) in nfc_genl_dep_link_up_event()
668 nla_put_u32(msg, NFC_ATTR_TARGET_INDEX, target_idx)) in nfc_genl_dep_link_up_event()
670 if (nla_put_u8(msg, NFC_ATTR_COMM_MODE, comm_mode) || in nfc_genl_dep_link_up_event()
671 nla_put_u8(msg, NFC_ATTR_RF_MODE, rf_mode)) in nfc_genl_dep_link_up_event()
674 genlmsg_end(msg, hdr); in nfc_genl_dep_link_up_event()
678 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); in nfc_genl_dep_link_up_event()
684 nlmsg_free(msg); in nfc_genl_dep_link_up_event()
690 struct sk_buff *msg; in nfc_genl_dep_link_down_event() local
695 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); in nfc_genl_dep_link_down_event()
696 if (!msg) in nfc_genl_dep_link_down_event()
699 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, in nfc_genl_dep_link_down_event()
704 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) in nfc_genl_dep_link_down_event()
707 genlmsg_end(msg, hdr); in nfc_genl_dep_link_down_event()
709 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); in nfc_genl_dep_link_down_event()
715 nlmsg_free(msg); in nfc_genl_dep_link_down_event()
721 struct sk_buff *msg; in nfc_genl_get_device() local
735 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nfc_genl_get_device()
736 if (!msg) { in nfc_genl_get_device()
741 rc = nfc_genl_send_device(msg, dev, info->snd_portid, info->snd_seq, in nfc_genl_get_device()
748 return genlmsg_reply(msg, info); in nfc_genl_get_device()
751 nlmsg_free(msg); in nfc_genl_get_device()
989 static int nfc_genl_send_params(struct sk_buff *msg, in nfc_genl_send_params() argument
995 hdr = genlmsg_put(msg, portid, seq, &nfc_genl_family, 0, in nfc_genl_send_params()
1000 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, local->dev->idx) || in nfc_genl_send_params()
1001 nla_put_u8(msg, NFC_ATTR_LLC_PARAM_LTO, local->lto) || in nfc_genl_send_params()
1002 nla_put_u8(msg, NFC_ATTR_LLC_PARAM_RW, local->rw) || in nfc_genl_send_params()
1003 nla_put_u16(msg, NFC_ATTR_LLC_PARAM_MIUX, be16_to_cpu(local->miux))) in nfc_genl_send_params()
1006 genlmsg_end(msg, hdr); in nfc_genl_send_params()
1010 genlmsg_cancel(msg, hdr); in nfc_genl_send_params()
1019 struct sk_buff *msg = NULL; in nfc_genl_llc_get_params() local
1040 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nfc_genl_llc_get_params()
1041 if (!msg) { in nfc_genl_llc_get_params()
1046 rc = nfc_genl_send_params(msg, local, info->snd_portid, info->snd_seq); in nfc_genl_llc_get_params()
1054 if (msg) in nfc_genl_llc_get_params()
1055 nlmsg_free(msg); in nfc_genl_llc_get_params()
1060 return genlmsg_reply(msg, info); in nfc_genl_llc_get_params()
1245 struct sk_buff *msg; in nfc_genl_fw_download_done() local
1248 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in nfc_genl_fw_download_done()
1249 if (!msg) in nfc_genl_fw_download_done()
1252 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, in nfc_genl_fw_download_done()
1257 if (nla_put_string(msg, NFC_ATTR_FIRMWARE_NAME, firmware_name) || in nfc_genl_fw_download_done()
1258 nla_put_u32(msg, NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS, result) || in nfc_genl_fw_download_done()
1259 nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx)) in nfc_genl_fw_download_done()
1262 genlmsg_end(msg, hdr); in nfc_genl_fw_download_done()
1264 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); in nfc_genl_fw_download_done()
1270 nlmsg_free(msg); in nfc_genl_fw_download_done()
1320 static int nfc_genl_send_se(struct sk_buff *msg, struct nfc_dev *dev, in nfc_genl_send_se() argument
1329 hdr = genlmsg_put(msg, portid, seq, &nfc_genl_family, flags, in nfc_genl_send_se()
1337 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) || in nfc_genl_send_se()
1338 nla_put_u32(msg, NFC_ATTR_SE_INDEX, se->idx) || in nfc_genl_send_se()
1339 nla_put_u8(msg, NFC_ATTR_SE_TYPE, se->type)) in nfc_genl_send_se()
1342 genlmsg_end(msg, hdr); in nfc_genl_send_se()
1348 genlmsg_cancel(msg, hdr); in nfc_genl_send_se()
1457 struct sk_buff *msg; in se_io_cb() local
1460 msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); in se_io_cb()
1461 if (!msg) { in se_io_cb()
1466 hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, in se_io_cb()
1471 if (nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, ctx->dev_idx) || in se_io_cb()
1472 nla_put_u32(msg, NFC_ATTR_SE_INDEX, ctx->se_idx) || in se_io_cb()
1473 nla_put(msg, NFC_ATTR_SE_APDU, apdu_len, apdu)) in se_io_cb()
1476 genlmsg_end(msg, hdr); in se_io_cb()
1478 genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); in se_io_cb()
1486 nlmsg_free(msg); in se_io_cb()