// SPDX-License-Identifier: GPL-2.0-only /* * The NFC Controller Interface is the communication protocol between an * NFC Controller (NFCC) and a Device Host (DH). * * Copyright (C) 2011 Texas Instruments, Inc. * Copyright (C) 2014 Marvell International Ltd. * * Written by Ilan Elias <ilane@ti.com>
*/
/* check if the packet need to be fragmented */ if (skb->len <= conn_info->max_pkt_payload_len) { /* no need to fragment packet */
nci_push_data_hdr(ndev, conn_id, skb, NCI_PBF_LAST);
skb_queue_tail(&ndev->tx_q, skb);
} else { /* fragment packet and queue the fragments */
rc = nci_queue_tx_data_frags(ndev, conn_id, skb); if (rc) {
pr_err("failed to fragment tx data packet\n"); goto free_exit;
}
}
/* ----------------- NCI RX Data ----------------- */
staticvoid nci_add_rx_data_frag(struct nci_dev *ndev, struct sk_buff *skb,
__u8 pbf, __u8 conn_id, __u8 status)
{ int reassembly_len; int err = 0;
if (status) {
err = status; gotoexit;
}
if (ndev->rx_data_reassembly) {
reassembly_len = ndev->rx_data_reassembly->len;
/* first, make enough room for the already accumulated data */ if (skb_cow_head(skb, reassembly_len)) {
pr_err("error adding room for accumulated rx data\n");
if (pbf == NCI_PBF_CONT) { /* need to wait for next fragment, store skb and exit */
ndev->rx_data_reassembly = skb; return;
}
exit: if (ndev->nfc_dev->rf_mode == NFC_RF_TARGET) { /* Data received in Target mode, forward to nfc core */
err = nfc_tm_data_received(ndev->nfc_dev, skb); if (err)
pr_err("unable to handle received data\n");
} else {
nci_data_exchange_complete(ndev, skb, conn_id, err);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.