u8 tgt_available_prots;
u8 tgt_active_prot;
+ u8 tgt_mode;
};
struct pn533_frame {
if (params_len > 0 && params[0] != 0) {
nfc_tm_deactivated(dev->nfc_dev);
+ dev->tgt_mode = 0;
+
kfree_skb(skb_resp);
return 0;
}
return rc;
}
+ dev->tgt_mode = 1;
+
queue_work(dev->wq, &dev->tg_work);
return 0;
return -EBUSY;
}
+ if (dev->tgt_mode) {
+ nfc_dev_err(&dev->interface->dev,
+ "Cannot poll while already being activated");
+ return -EBUSY;
+ }
+
if (tm_protocols) {
dev->gb = nfc_get_local_general_bytes(nfc_dev, &dev->gb_len);
if (dev->gb == NULL)
pn533_poll_reset_mod_list(dev);
- pn533_deactivate_target(nfc_dev, 0);
+ if (dev->tgt_mode || dev->tgt_active_prot) {
+ pn533_send_ack(dev, GFP_KERNEL);
+ usb_kill_urb(dev->in_urb);
+ }
+
+ dev->tgt_active_prot = 0;
+ dev->tgt_mode = 0;
+
+ skb_queue_purge(&dev->resp_q);
return 0;
}
if (params_len > 0 && params[0] != 0) {
nfc_tm_deactivated(dev->nfc_dev);
+ dev->tgt_mode = 0;
+
return 0;
}