summaryrefslogtreecommitdiff
path: root/drivers/nfc/pn533.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2012-03-05 00:03:50 (GMT)
committerJohn W. Linville <linville@tuxdriver.com>2012-03-06 20:16:23 (GMT)
commit47807d3dbb62e93850cbcb797db1a9ee1806f986 (patch)
treef8e1970083547290e35830e5bedb4a4ce7237f97 /drivers/nfc/pn533.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 'drivers/nfc/pn533.c')
-rw-r--r--drivers/nfc/pn533.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
index ef33f64..cb6204f 100644
--- a/drivers/nfc/pn533.c
+++ b/drivers/nfc/pn533.c
@@ -1340,21 +1340,15 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
}
static int pn533_dep_link_up(struct nfc_dev *nfc_dev, int target_idx,
- u8 comm_mode, u8 rf_mode)
+ u8 comm_mode, u8* gb, size_t gb_len)
{
struct pn533 *dev = nfc_get_drvdata(nfc_dev);
struct pn533_cmd_jump_dep *cmd;
- u8 cmd_len, local_gt_len, *local_gt;
+ u8 cmd_len;
int rc;
nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
- if (rf_mode == NFC_RF_TARGET) {
- nfc_dev_err(&dev->interface->dev, "Target mode not supported");
- return -EOPNOTSUPP;
- }
-
-
if (dev->poll_mod_count) {
nfc_dev_err(&dev->interface->dev,
"Cannot bring the DEP link up while polling");
@@ -1367,11 +1361,7 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, int target_idx,
return -EBUSY;
}
- local_gt = nfc_get_local_general_bytes(dev->nfc_dev, &local_gt_len);
- if (local_gt_len > NFC_MAX_GT_LEN)
- return -EINVAL;
-
- cmd_len = sizeof(struct pn533_cmd_jump_dep) + local_gt_len;
+ cmd_len = sizeof(struct pn533_cmd_jump_dep) + gb_len;
cmd = kzalloc(cmd_len, GFP_KERNEL);
if (cmd == NULL)
return -ENOMEM;
@@ -1380,9 +1370,9 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, int target_idx,
cmd->active = !comm_mode;
cmd->baud = 0;
- if (local_gt != NULL) {
+ if (gb != NULL && gb_len > 0) {
cmd->next = 4; /* We have some Gi */
- memcpy(cmd->gt, local_gt, local_gt_len);
+ memcpy(cmd->gt, gb, gb_len);
} else {
cmd->next = 0;
}