summaryrefslogtreecommitdiffstats
path: root/net/nfc
diff options
context:
space:
mode:
authorRobert Dolca <robert.dolca@intel.com>2015-10-22 12:11:34 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2015-10-25 19:11:42 +0100
commit2663589ce67e5429bac89544bb0e102bb1fcf617 (patch)
treee96bcdecd2780609370d590988b0410e56c6b90b /net/nfc
parentea785c094d38bc5eae8011330759d68f45236559 (diff)
downloadlinux-2663589ce67e5429bac89544bb0e102bb1fcf617.tar.bz2
NFC: nci: Add function to get max packet size for conn
FDP driver needs to send the firmware as regular packets (not fragmented). The driver should have a way to get the max packet size for a given connection. Signed-off-by: Robert Dolca <robert.dolca@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'net/nfc')
-rw-r--r--net/nfc/nci/data.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/nfc/nci/data.c b/net/nfc/nci/data.c
index 83acd189c13a..dbd24254412a 100644
--- a/net/nfc/nci/data.c
+++ b/net/nfc/nci/data.c
@@ -90,6 +90,18 @@ static inline void nci_push_data_hdr(struct nci_dev *ndev,
nci_pbf_set((__u8 *)hdr, pbf);
}
+int nci_conn_max_data_pkt_payload_size(struct nci_dev *ndev, __u8 conn_id)
+{
+ struct nci_conn_info *conn_info;
+
+ conn_info = nci_get_conn_info_by_conn_id(ndev, conn_id);
+ if (!conn_info)
+ return -EPROTO;
+
+ return conn_info->max_pkt_payload_len;
+}
+EXPORT_SYMBOL(nci_conn_max_data_pkt_payload_size);
+
static int nci_queue_tx_data_frags(struct nci_dev *ndev,
__u8 conn_id,
struct sk_buff *skb) {