summaryrefslogtreecommitdiff
path: root/net/nfc/core.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-03-05 04:03:50 +0400
committerJohn W. Linville <linville@tuxdriver.com>2012-03-07 00:16:23 +0400
commit47807d3dbb62e93850cbcb797db1a9ee1806f986 (patch)
treef8e1970083547290e35830e5bedb4a4ce7237f97 /net/nfc/core.c
parent9dda50f4c98f84e32a5f6dc4d9dd7af6085add43 (diff)
downloadlinux-47807d3dbb62e93850cbcb797db1a9ee1806f986.tar.xz
NFC: Remove the rf mode parameter from the DEP link up routine
When calling nfc_dep_link_up, we implicitely are in initiator mode. Which means we also can provide the general bytes as a function argument, as all drivers will eventually request them. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/nfc/core.c')
-rw-r--r--net/nfc/core.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/net/nfc/core.c b/net/nfc/core.c
index 6089aca67b14..f4f526f73217 100644
--- a/net/nfc/core.c
+++ b/net/nfc/core.c
@@ -181,13 +181,13 @@ error:
return rc;
}
-int nfc_dep_link_up(struct nfc_dev *dev, int target_index,
- u8 comm_mode, u8 rf_mode)
+int nfc_dep_link_up(struct nfc_dev *dev, int target_index, u8 comm_mode)
{
int rc = 0;
+ u8 *gb;
+ size_t gb_len;
- pr_debug("dev_name=%s comm:%d rf:%d\n",
- dev_name(&dev->dev), comm_mode, rf_mode);
+ pr_debug("dev_name=%s comm %d\n", dev_name(&dev->dev), comm_mode);
if (!dev->ops->dep_link_up)
return -EOPNOTSUPP;
@@ -204,7 +204,13 @@ int nfc_dep_link_up(struct nfc_dev *dev, int target_index,
goto error;
}
- rc = dev->ops->dep_link_up(dev, target_index, comm_mode, rf_mode);
+ gb = nfc_llcp_general_bytes(dev, &gb_len);
+ if (gb_len > NFC_MAX_GT_LEN) {
+ rc = -EINVAL;
+ goto error;
+ }
+
+ rc = dev->ops->dep_link_up(dev, target_index, comm_mode, gb, gb_len);
error:
device_unlock(&dev->dev);
@@ -367,12 +373,6 @@ int nfc_set_remote_general_bytes(struct nfc_dev *dev, u8 *gb, u8 gb_len)
}
EXPORT_SYMBOL(nfc_set_remote_general_bytes);
-u8 *nfc_get_local_general_bytes(struct nfc_dev *dev, u8 *gt_len)
-{
- return nfc_llcp_general_bytes(dev, gt_len);
-}
-EXPORT_SYMBOL(nfc_get_local_general_bytes);
-
/**
* nfc_alloc_send_skb - allocate a skb for data exchange responses
*