All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NFC: added the rx delay parameter for nfcsim workqueue
@ 2015-12-20 18:59 Saurabh Sengar
  2015-12-20 23:08 ` Samuel Ortiz
  0 siblings, 1 reply; 2+ messages in thread
From: Saurabh Sengar @ 2015-12-20 18:59 UTC (permalink / raw)
  To: lauro.venancio, aloisio.almeida, sameo, linux-wireless, linux-kernel
  Cc: Saurabh Sengar

added the rx delay parameter as a device tunable parameter.

Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
---
This is a follow up patch after the review comments by Samuel Ortiz
on the initial patch.
Below is the link to original patch which implemented this parameter
as sysfs entry:
https://lkml.org/lkml/2015/12/20/118
 drivers/nfc/nfcsim.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/nfc/nfcsim.c b/drivers/nfc/nfcsim.c
index 26ac9e5..93aaca5 100644
--- a/drivers/nfc/nfcsim.c
+++ b/drivers/nfc/nfcsim.c
@@ -32,6 +32,8 @@
 #define NFCSIM_POLL_TARGET	2
 #define NFCSIM_POLL_DUAL	(NFCSIM_POLL_INITIATOR | NFCSIM_POLL_TARGET)
 
+#define RX_DEFAULT_DELAY	5
+
 struct nfcsim {
 	struct nfc_dev *nfc_dev;
 
@@ -51,6 +53,8 @@ struct nfcsim {
 
 	u8 initiator;
 
+	u32 rx_delay;
+
 	data_exchange_cb_t cb;
 	void *cb_context;
 
@@ -320,10 +324,9 @@ static int nfcsim_tx(struct nfc_dev *nfc_dev, struct nfc_target *target,
 	 * If packet transmission occurs immediately between them, we have a
 	 * non-stop flow of several tens of thousands SYMM packets per second
 	 * and a burning cpu.
-	 *
-	 * TODO: Add support for a sysfs entry to control this delay.
 	 */
-	queue_delayed_work(wq, &peer->recv_work, msecs_to_jiffies(5));
+	queue_delayed_work(wq, &peer->recv_work,
+			msecs_to_jiffies(dev->rx_delay));
 
 	mutex_unlock(&peer->lock);
 
@@ -461,6 +464,7 @@ static struct nfcsim *nfcsim_init_dev(void)
 	if (rc)
 		goto free_nfc_dev;
 
+	dev->rx_delay = RX_DEFAULT_DELAY;
 	return dev;
 
 free_nfc_dev:
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] NFC: added the rx delay parameter for nfcsim workqueue
  2015-12-20 18:59 [PATCH] NFC: added the rx delay parameter for nfcsim workqueue Saurabh Sengar
@ 2015-12-20 23:08 ` Samuel Ortiz
  0 siblings, 0 replies; 2+ messages in thread
From: Samuel Ortiz @ 2015-12-20 23:08 UTC (permalink / raw)
  To: Saurabh Sengar
  Cc: lauro.venancio, aloisio.almeida, linux-wireless, linux-kernel

Hi Saurabh,

On Mon, Dec 21, 2015 at 12:29:30AM +0530, Saurabh Sengar wrote:
> added the rx delay parameter as a device tunable parameter.
> 
> Signed-off-by: Saurabh Sengar <saurabh.truth@gmail.com>
> ---
> This is a follow up patch after the review comments by Samuel Ortiz
> on the initial patch.
> Below is the link to original patch which implemented this parameter
> as sysfs entry:
> https://lkml.org/lkml/2015/12/20/118
>  drivers/nfc/nfcsim.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
Applied to nfc-next, thanks.

Cheers,
Samuel.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-20 23:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-20 18:59 [PATCH] NFC: added the rx delay parameter for nfcsim workqueue Saurabh Sengar
2015-12-20 23:08 ` Samuel Ortiz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.