diff options
author | Vincent Cuissard <cuissard@marvell.com> | 2015-06-11 12:25:44 +0300 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2015-06-12 00:24:31 +0300 |
commit | e1bf80c2a59895f12f596608b91856bab1c562bb (patch) | |
tree | 4df38467c97bb32f5e6b44a379be2710b6958d99 /drivers/nfc/nfcmrvl/main.c | |
parent | f1f1a7da2b3853bf55ee5aab47c8916454b65fa8 (diff) | |
download | linux-e1bf80c2a59895f12f596608b91856bab1c562bb.tar.xz |
NFC: nfcmrvl: update nci recv frame API
Update internal nci recv frame API to use skbuff phy management
to generic part of the driver.
Signed-off-by: Vincent Cuissard <cuissard@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc/nfcmrvl/main.c')
-rw-r--r-- | drivers/nfc/nfcmrvl/main.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/nfc/nfcmrvl/main.c b/drivers/nfc/nfcmrvl/main.c index 48d8b00744df..e7f579b2d987 100644 --- a/drivers/nfc/nfcmrvl/main.c +++ b/drivers/nfc/nfcmrvl/main.c @@ -153,16 +153,8 @@ void nfcmrvl_nci_unregister_dev(struct nfcmrvl_private *priv) } EXPORT_SYMBOL_GPL(nfcmrvl_nci_unregister_dev); -int nfcmrvl_nci_recv_frame(struct nfcmrvl_private *priv, void *data, int count) +int nfcmrvl_nci_recv_frame(struct nfcmrvl_private *priv, struct sk_buff *skb) { - struct sk_buff *skb; - - skb = nci_skb_alloc(priv->ndev, count, GFP_ATOMIC); - if (!skb) - return -ENOMEM; - - memcpy(skb_put(skb, count), data, count); - if (priv->hci_muxed) { if (skb->data[0] == NFCMRVL_HCI_EVENT_CODE && skb->data[1] == NFCMRVL_HCI_NFC_EVENT_CODE) { @@ -175,9 +167,15 @@ int nfcmrvl_nci_recv_frame(struct nfcmrvl_private *priv, void *data, int count) } } - nci_recv_frame(priv->ndev, skb); + if (test_bit(NFCMRVL_NCI_RUNNING, &priv->flags)) + nci_recv_frame(priv->ndev, skb); + else { + /* Drop this packet since nobody wants it */ + kfree_skb(skb); + return 0; + } - return count; + return 0; } EXPORT_SYMBOL_GPL(nfcmrvl_nci_recv_frame); |