aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Escande <thierry.escande@linux.intel.com>2012-10-05 05:05:45 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2012-10-26 12:26:47 -0400
commit5bcf099c17323a8760620511b1b8e415c2783571 (patch)
tree60f922dba9f36caefb69a269352e28c6ae899701
parent19cfe5843e86cc95542d9d875c9386e197956d75 (diff)
NFC: Set rf_mode to NFC_RF_NONE where necessary
rf_mode is now set to NFC_RF_NONE when a device gets allocated, when the link goes down, and when stop polling. Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--net/nfc/core.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/nfc/core.c b/net/nfc/core.c
index 4cb069766ce..f1c33f23331 100644
--- a/net/nfc/core.c
+++ b/net/nfc/core.c
@@ -181,6 +181,7 @@ int nfc_stop_poll(struct nfc_dev *dev)
181 181
182 dev->ops->stop_poll(dev); 182 dev->ops->stop_poll(dev);
183 dev->polling = false; 183 dev->polling = false;
184 dev->rf_mode = NFC_RF_NONE;
184 185
185error: 186error:
186 device_unlock(&dev->dev); 187 device_unlock(&dev->dev);
@@ -274,12 +275,14 @@ int nfc_dep_link_down(struct nfc_dev *dev)
274 if (!rc) { 275 if (!rc) {
275 dev->dep_link_up = false; 276 dev->dep_link_up = false;
276 dev->active_target = NULL; 277 dev->active_target = NULL;
278 dev->rf_mode = NFC_RF_NONE;
277 nfc_llcp_mac_is_down(dev); 279 nfc_llcp_mac_is_down(dev);
278 nfc_genl_dep_link_down_event(dev); 280 nfc_genl_dep_link_down_event(dev);
279 } 281 }
280 282
281error: 283error:
282 device_unlock(&dev->dev); 284 device_unlock(&dev->dev);
285
283 return rc; 286 return rc;
284} 287}
285 288
@@ -503,6 +506,7 @@ EXPORT_SYMBOL(nfc_tm_activated);
503int nfc_tm_deactivated(struct nfc_dev *dev) 506int nfc_tm_deactivated(struct nfc_dev *dev)
504{ 507{
505 dev->dep_link_up = false; 508 dev->dep_link_up = false;
509 dev->rf_mode = NFC_RF_NONE;
506 510
507 return nfc_genl_tm_deactivated(dev); 511 return nfc_genl_tm_deactivated(dev);
508} 512}
@@ -782,6 +786,7 @@ struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops,
782 786
783 nfc_genl_data_init(&dev->genl_data); 787 nfc_genl_data_init(&dev->genl_data);
784 788
789 dev->rf_mode = NFC_RF_NONE;
785 790
786 /* first generation must not be 0 */ 791 /* first generation must not be 0 */
787 dev->targets_generation = 1; 792 dev->targets_generation = 1;