Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFC: add rx delay sysfs parameter for nfcsim workqueue

added the rx delay parameter as a device tunable parameter.

Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

authored by

Saurabh Sengar and committed by
Samuel Ortiz
a440f1aa c6b5df0d

+7 -3
+7 -3
drivers/nfc/nfcsim.c
··· 32 32 #define NFCSIM_POLL_TARGET 2 33 33 #define NFCSIM_POLL_DUAL (NFCSIM_POLL_INITIATOR | NFCSIM_POLL_TARGET) 34 34 35 + #define RX_DEFAULT_DELAY 5 36 + 35 37 struct nfcsim { 36 38 struct nfc_dev *nfc_dev; 37 39 ··· 52 50 u8 up; 53 51 54 52 u8 initiator; 53 + 54 + u32 rx_delay; 55 55 56 56 data_exchange_cb_t cb; 57 57 void *cb_context; ··· 324 320 * If packet transmission occurs immediately between them, we have a 325 321 * non-stop flow of several tens of thousands SYMM packets per second 326 322 * and a burning cpu. 327 - * 328 - * TODO: Add support for a sysfs entry to control this delay. 329 323 */ 330 - queue_delayed_work(wq, &peer->recv_work, msecs_to_jiffies(5)); 324 + queue_delayed_work(wq, &peer->recv_work, 325 + msecs_to_jiffies(dev->rx_delay)); 331 326 332 327 mutex_unlock(&peer->lock); 333 328 ··· 464 461 if (rc) 465 462 goto free_nfc_dev; 466 463 464 + dev->rx_delay = RX_DEFAULT_DELAY; 467 465 return dev; 468 466 469 467 free_nfc_dev: