lib.c (251f39fe42dae863bd24e30864e6b66076ba076d) lib.c (637d85a7cdfe4240a56da7d70cf95cca65ea21d3)
1/*
2 * The NFC Controller Interface is the communication protocol between an
3 * NFC Controller (NFCC) and a Device Host (DH).
4 *
5 * Copyright (C) 2011 Texas Instruments, Inc.
6 *
7 * Written by Ilan Elias <ilane@ti.com>
8 *

--- 28 unchanged lines hidden (view full) ---

37{
38 switch (code) {
39 case NCI_STATUS_OK:
40 return 0;
41
42 case NCI_STATUS_REJECTED:
43 return -EBUSY;
44
1/*
2 * The NFC Controller Interface is the communication protocol between an
3 * NFC Controller (NFCC) and a Device Host (DH).
4 *
5 * Copyright (C) 2011 Texas Instruments, Inc.
6 *
7 * Written by Ilan Elias <ilane@ti.com>
8 *

--- 28 unchanged lines hidden (view full) ---

37{
38 switch (code) {
39 case NCI_STATUS_OK:
40 return 0;
41
42 case NCI_STATUS_REJECTED:
43 return -EBUSY;
44
45 case NCI_STATUS_MESSAGE_CORRUPTED:
45 case NCI_STATUS_RF_FRAME_CORRUPTED:
46 return -EBADMSG;
47
46 return -EBADMSG;
47
48 case NCI_STATUS_BUFFER_FULL:
49 return -ENOBUFS;
50
51 case NCI_STATUS_NOT_INITIALIZED:
52 return -EHOSTDOWN;
53
54 case NCI_STATUS_SYNTAX_ERROR:
55 case NCI_STATUS_SEMANTIC_ERROR:
56 case NCI_STATUS_INVALID_PARAM:
57 case NCI_STATUS_RF_PROTOCOL_ERROR:
58 case NCI_STATUS_NFCEE_PROTOCOL_ERROR:

--- 16 unchanged lines hidden (view full) ---

75 case NCI_STATUS_RF_TRANSMISSION_ERROR:
76 case NCI_STATUS_NFCEE_TRANSMISSION_ERROR:
77 return -ECOMM;
78
79 case NCI_STATUS_RF_TIMEOUT_ERROR:
80 case NCI_STATUS_NFCEE_TIMEOUT_ERROR:
81 return -ETIMEDOUT;
82
48 case NCI_STATUS_NOT_INITIALIZED:
49 return -EHOSTDOWN;
50
51 case NCI_STATUS_SYNTAX_ERROR:
52 case NCI_STATUS_SEMANTIC_ERROR:
53 case NCI_STATUS_INVALID_PARAM:
54 case NCI_STATUS_RF_PROTOCOL_ERROR:
55 case NCI_STATUS_NFCEE_PROTOCOL_ERROR:

--- 16 unchanged lines hidden (view full) ---

72 case NCI_STATUS_RF_TRANSMISSION_ERROR:
73 case NCI_STATUS_NFCEE_TRANSMISSION_ERROR:
74 return -ECOMM;
75
76 case NCI_STATUS_RF_TIMEOUT_ERROR:
77 case NCI_STATUS_NFCEE_TIMEOUT_ERROR:
78 return -ETIMEDOUT;
79
83 case NCI_STATUS_RF_LINK_LOSS_ERROR:
84 return -ENOLINK;
85
86 case NCI_STATUS_MAX_ACTIVE_NFCEE_INTERFACES_REACHED:
87 return -EDQUOT;
88
89 case NCI_STATUS_FAILED:
90 default:
91 return -ENOSYS;
92 }
93}
94EXPORT_SYMBOL(nci_to_errno);
80 case NCI_STATUS_FAILED:
81 default:
82 return -ENOSYS;
83 }
84}
85EXPORT_SYMBOL(nci_to_errno);