Lines Matching refs:nfc_dev
22 #define DEV_ERR(_dev, fmt, args...) nfc_err(&_dev->nfc_dev->dev, \
25 #define DEV_DBG(_dev, fmt, args...) dev_dbg(&_dev->nfc_dev->dev, \
36 struct nfc_dev *nfc_dev; member
92 nfc_targets_found(dev->nfc_dev, &nfc_tgt, 1); in nfcsim_target_found()
97 static int nfcsim_dev_up(struct nfc_dev *nfc_dev) in nfcsim_dev_up() argument
99 struct nfcsim *dev = nfc_get_drvdata(nfc_dev); in nfcsim_dev_up()
112 static int nfcsim_dev_down(struct nfc_dev *nfc_dev) in nfcsim_dev_down() argument
114 struct nfcsim *dev = nfc_get_drvdata(nfc_dev); in nfcsim_dev_down()
127 static int nfcsim_dep_link_up(struct nfc_dev *nfc_dev, in nfcsim_dep_link_up() argument
132 struct nfcsim *dev = nfc_get_drvdata(nfc_dev); in nfcsim_dep_link_up()
141 nfc_tm_activated(peer->nfc_dev, NFC_PROTO_NFC_DEP_MASK, in nfcsim_dep_link_up()
144 remote_gb = nfc_get_local_general_bytes(peer->nfc_dev, &remote_gb_len); in nfcsim_dep_link_up()
156 rc = nfc_set_remote_general_bytes(nfc_dev, remote_gb, remote_gb_len); in nfcsim_dep_link_up()
163 rc = nfc_dep_link_is_up(nfc_dev, target->idx, NFC_COMM_ACTIVE, in nfcsim_dep_link_up()
171 static int nfcsim_dep_link_down(struct nfc_dev *nfc_dev) in nfcsim_dep_link_down() argument
173 struct nfcsim *dev = nfc_get_drvdata(nfc_dev); in nfcsim_dep_link_down()
182 static int nfcsim_start_poll(struct nfc_dev *nfc_dev, in nfcsim_start_poll() argument
185 struct nfcsim *dev = nfc_get_drvdata(nfc_dev); in nfcsim_start_poll()
223 static void nfcsim_stop_poll(struct nfc_dev *nfc_dev) in nfcsim_stop_poll() argument
225 struct nfcsim *dev = nfc_get_drvdata(nfc_dev); in nfcsim_stop_poll()
238 static int nfcsim_activate_target(struct nfc_dev *nfc_dev, in nfcsim_activate_target() argument
241 struct nfcsim *dev = nfc_get_drvdata(nfc_dev); in nfcsim_activate_target()
248 static void nfcsim_deactivate_target(struct nfc_dev *nfc_dev, in nfcsim_deactivate_target() argument
251 struct nfcsim *dev = nfc_get_drvdata(nfc_dev); in nfcsim_deactivate_target()
278 nfc_tm_data_received(dev->nfc_dev, dev->clone_skb); in nfcsim_wq_recv()
287 static int nfcsim_tx(struct nfc_dev *nfc_dev, struct nfc_target *target, in nfcsim_tx() argument
291 struct nfcsim *dev = nfc_get_drvdata(nfc_dev); in nfcsim_tx()
337 static int nfcsim_im_transceive(struct nfc_dev *nfc_dev, in nfcsim_im_transceive() argument
341 return nfcsim_tx(nfc_dev, target, skb, cb, cb_context); in nfcsim_im_transceive()
344 static int nfcsim_tm_send(struct nfc_dev *nfc_dev, struct sk_buff *skb) in nfcsim_tm_send() argument
346 return nfcsim_tx(nfc_dev, NULL, skb, NULL, NULL); in nfcsim_tm_send()
452 dev->nfc_dev = nfc_allocate_device(&nfcsim_nfc_ops, in nfcsim_init_dev()
455 if (!dev->nfc_dev) in nfcsim_init_dev()
458 nfc_set_drvdata(dev->nfc_dev, dev); in nfcsim_init_dev()
460 rc = nfc_register_device(dev->nfc_dev); in nfcsim_init_dev()
467 nfc_free_device(dev->nfc_dev); in nfcsim_init_dev()
477 nfc_unregister_device(dev->nfc_dev); in nfcsim_free_device()
479 nfc_free_device(dev->nfc_dev); in nfcsim_free_device()