diff options
author | Ilan Elias <ilane@ti.com> | 2011-11-09 05:09:14 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-11-11 12:32:50 -0500 |
commit | e8c0dacd9836dc2dcb28d236c9cc3cfaa9965a20 (patch) | |
tree | afc78589cb1a21a25d6ef0e1ad5532451bc47838 /net/nfc/nci | |
parent | e999882a052a2959571989b2db2b51893d23c0bb (diff) |
NFC: Update names and structs to NCI spec 1.0 d18
Addition, deletion and modification of NCI constants.
Changes in NCI commands, responses and notifications structures.
Signed-off-by: Ilan Elias <ilane@ti.com>
Acked-by: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/nfc/nci')
-rw-r--r-- | net/nfc/nci/core.c | 7 | ||||
-rw-r--r-- | net/nfc/nci/data.c | 5 | ||||
-rw-r--r-- | net/nfc/nci/lib.c | 8 | ||||
-rw-r--r-- | net/nfc/nci/ntf.c | 137 | ||||
-rw-r--r-- | net/nfc/nci/rsp.c | 58 |
5 files changed, 131 insertions, 84 deletions
diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c index 4047e29acb3b..557fe92d29c7 100644 --- a/net/nfc/nci/core.c +++ b/net/nfc/nci/core.c | |||
@@ -125,7 +125,10 @@ static inline int nci_request(struct nci_dev *ndev, | |||
125 | 125 | ||
126 | static void nci_reset_req(struct nci_dev *ndev, unsigned long opt) | 126 | static void nci_reset_req(struct nci_dev *ndev, unsigned long opt) |
127 | { | 127 | { |
128 | nci_send_cmd(ndev, NCI_OP_CORE_RESET_CMD, 0, NULL); | 128 | struct nci_core_reset_cmd cmd; |
129 | |||
130 | cmd.reset_type = NCI_RESET_TYPE_RESET_CONFIG; | ||
131 | nci_send_cmd(ndev, NCI_OP_CORE_RESET_CMD, 1, &cmd); | ||
129 | } | 132 | } |
130 | 133 | ||
131 | static void nci_init_req(struct nci_dev *ndev, unsigned long opt) | 134 | static void nci_init_req(struct nci_dev *ndev, unsigned long opt) |
@@ -469,7 +472,7 @@ static int nci_data_exchange(struct nfc_dev *nfc_dev, __u32 target_idx, | |||
469 | ndev->data_exchange_cb = cb; | 472 | ndev->data_exchange_cb = cb; |
470 | ndev->data_exchange_cb_context = cb_context; | 473 | ndev->data_exchange_cb_context = cb_context; |
471 | 474 | ||
472 | rc = nci_send_data(ndev, ndev->conn_id, skb); | 475 | rc = nci_send_data(ndev, NCI_STATIC_RF_CONN_ID, skb); |
473 | if (rc) | 476 | if (rc) |
474 | clear_bit(NCI_DATA_EXCHANGE, &ndev->flags); | 477 | clear_bit(NCI_DATA_EXCHANGE, &ndev->flags); |
475 | 478 | ||
diff --git a/net/nfc/nci/data.c b/net/nfc/nci/data.c index e5ed90fc1a9c..511fb96e21bc 100644 --- a/net/nfc/nci/data.c +++ b/net/nfc/nci/data.c | |||
@@ -95,7 +95,8 @@ static int nci_queue_tx_data_frags(struct nci_dev *ndev, | |||
95 | __skb_queue_head_init(&frags_q); | 95 | __skb_queue_head_init(&frags_q); |
96 | 96 | ||
97 | while (total_len) { | 97 | while (total_len) { |
98 | frag_len = min_t(int, total_len, ndev->max_pkt_payload_size); | 98 | frag_len = |
99 | min_t(int, total_len, ndev->max_data_pkt_payload_size); | ||
99 | 100 | ||
100 | skb_frag = nci_skb_alloc(ndev, | 101 | skb_frag = nci_skb_alloc(ndev, |
101 | (NCI_DATA_HDR_SIZE + frag_len), | 102 | (NCI_DATA_HDR_SIZE + frag_len), |
@@ -151,7 +152,7 @@ int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb) | |||
151 | nfc_dbg("entry, conn_id 0x%x, plen %d", conn_id, skb->len); | 152 | nfc_dbg("entry, conn_id 0x%x, plen %d", conn_id, skb->len); |
152 | 153 | ||
153 | /* check if the packet need to be fragmented */ | 154 | /* check if the packet need to be fragmented */ |
154 | if (skb->len <= ndev->max_pkt_payload_size) { | 155 | if (skb->len <= ndev->max_data_pkt_payload_size) { |
155 | /* no need to fragment packet */ | 156 | /* no need to fragment packet */ |
156 | nci_push_data_hdr(ndev, conn_id, skb, NCI_PBF_LAST); | 157 | nci_push_data_hdr(ndev, conn_id, skb, NCI_PBF_LAST); |
157 | 158 | ||
diff --git a/net/nfc/nci/lib.c b/net/nfc/nci/lib.c index b19dc2fa90e1..e99adcfb1bcf 100644 --- a/net/nfc/nci/lib.c +++ b/net/nfc/nci/lib.c | |||
@@ -42,12 +42,9 @@ int nci_to_errno(__u8 code) | |||
42 | case NCI_STATUS_REJECTED: | 42 | case NCI_STATUS_REJECTED: |
43 | return -EBUSY; | 43 | return -EBUSY; |
44 | 44 | ||
45 | case NCI_STATUS_MESSAGE_CORRUPTED: | 45 | case NCI_STATUS_RF_FRAME_CORRUPTED: |
46 | return -EBADMSG; | 46 | return -EBADMSG; |
47 | 47 | ||
48 | case NCI_STATUS_BUFFER_FULL: | ||
49 | return -ENOBUFS; | ||
50 | |||
51 | case NCI_STATUS_NOT_INITIALIZED: | 48 | case NCI_STATUS_NOT_INITIALIZED: |
52 | return -EHOSTDOWN; | 49 | return -EHOSTDOWN; |
53 | 50 | ||
@@ -80,9 +77,6 @@ int nci_to_errno(__u8 code) | |||
80 | case NCI_STATUS_NFCEE_TIMEOUT_ERROR: | 77 | case NCI_STATUS_NFCEE_TIMEOUT_ERROR: |
81 | return -ETIMEDOUT; | 78 | return -ETIMEDOUT; |
82 | 79 | ||
83 | case NCI_STATUS_RF_LINK_LOSS_ERROR: | ||
84 | return -ENOLINK; | ||
85 | |||
86 | case NCI_STATUS_MAX_ACTIVE_NFCEE_INTERFACES_REACHED: | 80 | case NCI_STATUS_MAX_ACTIVE_NFCEE_INTERFACES_REACHED: |
87 | return -EDQUOT; | 81 | return -EDQUOT; |
88 | 82 | ||
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c index 96633f5cda4f..6789f4828c0b 100644 --- a/net/nfc/nci/ntf.c +++ b/net/nfc/nci/ntf.c | |||
@@ -54,7 +54,7 @@ static void nci_core_conn_credits_ntf_packet(struct nci_dev *ndev, | |||
54 | ntf->conn_entries[i].conn_id, | 54 | ntf->conn_entries[i].conn_id, |
55 | ntf->conn_entries[i].credits); | 55 | ntf->conn_entries[i].credits); |
56 | 56 | ||
57 | if (ntf->conn_entries[i].conn_id == ndev->conn_id) { | 57 | if (ntf->conn_entries[i].conn_id == NCI_STATIC_RF_CONN_ID) { |
58 | /* found static rf connection */ | 58 | /* found static rf connection */ |
59 | atomic_add(ntf->conn_entries[i].credits, | 59 | atomic_add(ntf->conn_entries[i].credits, |
60 | &ndev->credits_cnt); | 60 | &ndev->credits_cnt); |
@@ -74,14 +74,12 @@ static void nci_rf_field_info_ntf_packet(struct nci_dev *ndev, | |||
74 | nfc_dbg("entry, rf_field_status %d", ntf->rf_field_status); | 74 | nfc_dbg("entry, rf_field_status %d", ntf->rf_field_status); |
75 | } | 75 | } |
76 | 76 | ||
77 | static int nci_rf_activate_nfca_passive_poll(struct nci_dev *ndev, | 77 | static __u8 *nci_extract_rf_params_nfca_passive_poll(struct nci_dev *ndev, |
78 | struct nci_rf_activate_ntf *ntf, __u8 *data) | 78 | struct nci_rf_intf_activated_ntf *ntf, __u8 *data) |
79 | { | 79 | { |
80 | struct rf_tech_specific_params_nfca_poll *nfca_poll; | 80 | struct rf_tech_specific_params_nfca_poll *nfca_poll; |
81 | struct activation_params_nfca_poll_iso_dep *nfca_poll_iso_dep; | ||
82 | 81 | ||
83 | nfca_poll = &ntf->rf_tech_specific_params.nfca_poll; | 82 | nfca_poll = &ntf->rf_tech_specific_params.nfca_poll; |
84 | nfca_poll_iso_dep = &ntf->activation_params.nfca_poll_iso_dep; | ||
85 | 83 | ||
86 | nfca_poll->sens_res = __le16_to_cpu(*((__u16 *)data)); | 84 | nfca_poll->sens_res = __le16_to_cpu(*((__u16 *)data)); |
87 | data += 2; | 85 | data += 2; |
@@ -100,32 +98,32 @@ static int nci_rf_activate_nfca_passive_poll(struct nci_dev *ndev, | |||
100 | if (nfca_poll->sel_res_len != 0) | 98 | if (nfca_poll->sel_res_len != 0) |
101 | nfca_poll->sel_res = *data++; | 99 | nfca_poll->sel_res = *data++; |
102 | 100 | ||
103 | ntf->rf_interface_type = *data++; | 101 | nfc_dbg("sel_res_len %d, sel_res 0x%x", |
104 | ntf->activation_params_len = *data++; | ||
105 | |||
106 | nfc_dbg("sel_res_len %d, sel_res 0x%x, rf_interface_type %d, activation_params_len %d", | ||
107 | nfca_poll->sel_res_len, | 102 | nfca_poll->sel_res_len, |
108 | nfca_poll->sel_res, | 103 | nfca_poll->sel_res); |
109 | ntf->rf_interface_type, | 104 | |
110 | ntf->activation_params_len); | 105 | return data; |
111 | 106 | } | |
112 | switch (ntf->rf_interface_type) { | 107 | |
113 | case NCI_RF_INTERFACE_ISO_DEP: | 108 | static int nci_extract_activation_params_iso_dep(struct nci_dev *ndev, |
114 | nfca_poll_iso_dep->rats_res_len = *data++; | 109 | struct nci_rf_intf_activated_ntf *ntf, __u8 *data) |
115 | if (nfca_poll_iso_dep->rats_res_len > 0) { | 110 | { |
116 | memcpy(nfca_poll_iso_dep->rats_res, | 111 | struct activation_params_nfca_poll_iso_dep *nfca_poll; |
112 | |||
113 | switch (ntf->activation_rf_tech_and_mode) { | ||
114 | case NCI_NFC_A_PASSIVE_POLL_MODE: | ||
115 | nfca_poll = &ntf->activation_params.nfca_poll_iso_dep; | ||
116 | nfca_poll->rats_res_len = *data++; | ||
117 | if (nfca_poll->rats_res_len > 0) { | ||
118 | memcpy(nfca_poll->rats_res, | ||
117 | data, | 119 | data, |
118 | nfca_poll_iso_dep->rats_res_len); | 120 | nfca_poll->rats_res_len); |
119 | } | 121 | } |
120 | break; | 122 | break; |
121 | 123 | ||
122 | case NCI_RF_INTERFACE_FRAME: | ||
123 | /* no activation params */ | ||
124 | break; | ||
125 | |||
126 | default: | 124 | default: |
127 | nfc_err("unsupported rf_interface_type 0x%x", | 125 | nfc_err("unsupported activation_rf_tech_and_mode 0x%x", |
128 | ntf->rf_interface_type); | 126 | ntf->activation_rf_tech_and_mode); |
129 | return -EPROTO; | 127 | return -EPROTO; |
130 | } | 128 | } |
131 | 129 | ||
@@ -133,7 +131,7 @@ static int nci_rf_activate_nfca_passive_poll(struct nci_dev *ndev, | |||
133 | } | 131 | } |
134 | 132 | ||
135 | static void nci_target_found(struct nci_dev *ndev, | 133 | static void nci_target_found(struct nci_dev *ndev, |
136 | struct nci_rf_activate_ntf *ntf) | 134 | struct nci_rf_intf_activated_ntf *ntf) |
137 | { | 135 | { |
138 | struct nfc_target nfc_tgt; | 136 | struct nfc_target nfc_tgt; |
139 | 137 | ||
@@ -141,6 +139,8 @@ static void nci_target_found(struct nci_dev *ndev, | |||
141 | nfc_tgt.supported_protocols = NFC_PROTO_MIFARE_MASK; | 139 | nfc_tgt.supported_protocols = NFC_PROTO_MIFARE_MASK; |
142 | else if (ntf->rf_protocol == NCI_RF_PROTOCOL_ISO_DEP) /* 4A */ | 140 | else if (ntf->rf_protocol == NCI_RF_PROTOCOL_ISO_DEP) /* 4A */ |
143 | nfc_tgt.supported_protocols = NFC_PROTO_ISO14443_MASK; | 141 | nfc_tgt.supported_protocols = NFC_PROTO_ISO14443_MASK; |
142 | else | ||
143 | nfc_tgt.supported_protocols = 0; | ||
144 | 144 | ||
145 | nfc_tgt.sens_res = ntf->rf_tech_specific_params.nfca_poll.sens_res; | 145 | nfc_tgt.sens_res = ntf->rf_tech_specific_params.nfca_poll.sens_res; |
146 | nfc_tgt.sel_res = ntf->rf_tech_specific_params.nfca_poll.sel_res; | 146 | nfc_tgt.sel_res = ntf->rf_tech_specific_params.nfca_poll.sel_res; |
@@ -158,49 +158,86 @@ static void nci_target_found(struct nci_dev *ndev, | |||
158 | nfc_targets_found(ndev->nfc_dev, &nfc_tgt, 1); | 158 | nfc_targets_found(ndev->nfc_dev, &nfc_tgt, 1); |
159 | } | 159 | } |
160 | 160 | ||
161 | static void nci_rf_activate_ntf_packet(struct nci_dev *ndev, | 161 | static void nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev, |
162 | struct sk_buff *skb) | 162 | struct sk_buff *skb) |
163 | { | 163 | { |
164 | struct nci_rf_activate_ntf ntf; | 164 | struct nci_rf_intf_activated_ntf ntf; |
165 | __u8 *data = skb->data; | 165 | __u8 *data = skb->data; |
166 | int rc = -1; | 166 | int err = 0; |
167 | 167 | ||
168 | clear_bit(NCI_DISCOVERY, &ndev->flags); | 168 | clear_bit(NCI_DISCOVERY, &ndev->flags); |
169 | set_bit(NCI_POLL_ACTIVE, &ndev->flags); | 169 | set_bit(NCI_POLL_ACTIVE, &ndev->flags); |
170 | 170 | ||
171 | ntf.target_handle = *data++; | 171 | ntf.rf_discovery_id = *data++; |
172 | ntf.rf_interface_type = *data++; | ||
172 | ntf.rf_protocol = *data++; | 173 | ntf.rf_protocol = *data++; |
173 | ntf.rf_tech_and_mode = *data++; | 174 | ntf.activation_rf_tech_and_mode = *data++; |
174 | ntf.rf_tech_specific_params_len = *data++; | 175 | ntf.rf_tech_specific_params_len = *data++; |
175 | 176 | ||
176 | nfc_dbg("target_handle %d, rf_protocol 0x%x, rf_tech_and_mode 0x%x, rf_tech_specific_params_len %d", | 177 | nfc_dbg("rf_discovery_id %d", ntf.rf_discovery_id); |
177 | ntf.target_handle, | 178 | nfc_dbg("rf_interface_type 0x%x", ntf.rf_interface_type); |
178 | ntf.rf_protocol, | 179 | nfc_dbg("rf_protocol 0x%x", ntf.rf_protocol); |
179 | ntf.rf_tech_and_mode, | 180 | nfc_dbg("activation_rf_tech_and_mode 0x%x", |
181 | ntf.activation_rf_tech_and_mode); | ||
182 | nfc_dbg("rf_tech_specific_params_len %d", | ||
180 | ntf.rf_tech_specific_params_len); | 183 | ntf.rf_tech_specific_params_len); |
181 | 184 | ||
182 | switch (ntf.rf_tech_and_mode) { | 185 | if (ntf.rf_tech_specific_params_len > 0) { |
183 | case NCI_NFC_A_PASSIVE_POLL_MODE: | 186 | switch (ntf.activation_rf_tech_and_mode) { |
184 | rc = nci_rf_activate_nfca_passive_poll(ndev, &ntf, | 187 | case NCI_NFC_A_PASSIVE_POLL_MODE: |
185 | data); | 188 | data = nci_extract_rf_params_nfca_passive_poll(ndev, |
186 | break; | 189 | &ntf, data); |
190 | break; | ||
191 | |||
192 | default: | ||
193 | nfc_err("unsupported activation_rf_tech_and_mode 0x%x", | ||
194 | ntf.activation_rf_tech_and_mode); | ||
195 | return; | ||
196 | } | ||
197 | } | ||
187 | 198 | ||
188 | default: | 199 | ntf.data_exch_rf_tech_and_mode = *data++; |
189 | nfc_err("unsupported rf_tech_and_mode 0x%x", | 200 | ntf.data_exch_tx_bit_rate = *data++; |
190 | ntf.rf_tech_and_mode); | 201 | ntf.data_exch_rx_bit_rate = *data++; |
191 | return; | 202 | ntf.activation_params_len = *data++; |
203 | |||
204 | nfc_dbg("data_exch_rf_tech_and_mode 0x%x", | ||
205 | ntf.data_exch_rf_tech_and_mode); | ||
206 | nfc_dbg("data_exch_tx_bit_rate 0x%x", | ||
207 | ntf.data_exch_tx_bit_rate); | ||
208 | nfc_dbg("data_exch_rx_bit_rate 0x%x", | ||
209 | ntf.data_exch_rx_bit_rate); | ||
210 | nfc_dbg("activation_params_len %d", | ||
211 | ntf.activation_params_len); | ||
212 | |||
213 | if (ntf.activation_params_len > 0) { | ||
214 | switch (ntf.rf_interface_type) { | ||
215 | case NCI_RF_INTERFACE_ISO_DEP: | ||
216 | err = nci_extract_activation_params_iso_dep(ndev, | ||
217 | &ntf, data); | ||
218 | break; | ||
219 | |||
220 | case NCI_RF_INTERFACE_FRAME: | ||
221 | /* no activation params */ | ||
222 | break; | ||
223 | |||
224 | default: | ||
225 | nfc_err("unsupported rf_interface_type 0x%x", | ||
226 | ntf.rf_interface_type); | ||
227 | return; | ||
228 | } | ||
192 | } | 229 | } |
193 | 230 | ||
194 | if (!rc) | 231 | if (!err) |
195 | nci_target_found(ndev, &ntf); | 232 | nci_target_found(ndev, &ntf); |
196 | } | 233 | } |
197 | 234 | ||
198 | static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev, | 235 | static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev, |
199 | struct sk_buff *skb) | 236 | struct sk_buff *skb) |
200 | { | 237 | { |
201 | __u8 type = skb->data[0]; | 238 | struct nci_rf_deactivate_ntf *ntf = (void *) skb->data; |
202 | 239 | ||
203 | nfc_dbg("entry, type 0x%x", type); | 240 | nfc_dbg("entry, type 0x%x, reason 0x%x", ntf->type, ntf->reason); |
204 | 241 | ||
205 | clear_bit(NCI_POLL_ACTIVE, &ndev->flags); | 242 | clear_bit(NCI_POLL_ACTIVE, &ndev->flags); |
206 | ndev->target_active_prot = 0; | 243 | ndev->target_active_prot = 0; |
@@ -241,8 +278,8 @@ void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb) | |||
241 | nci_rf_field_info_ntf_packet(ndev, skb); | 278 | nci_rf_field_info_ntf_packet(ndev, skb); |
242 | break; | 279 | break; |
243 | 280 | ||
244 | case NCI_OP_RF_ACTIVATE_NTF: | 281 | case NCI_OP_RF_INTF_ACTIVATED_NTF: |
245 | nci_rf_activate_ntf_packet(ndev, skb); | 282 | nci_rf_intf_activated_ntf_packet(ndev, skb); |
246 | break; | 283 | break; |
247 | 284 | ||
248 | case NCI_OP_RF_DEACTIVATE_NTF: | 285 | case NCI_OP_RF_DEACTIVATE_NTF: |
diff --git a/net/nfc/nci/rsp.c b/net/nfc/nci/rsp.c index 0403d4cd0917..64fc58a6e28b 100644 --- a/net/nfc/nci/rsp.c +++ b/net/nfc/nci/rsp.c | |||
@@ -42,10 +42,11 @@ static void nci_core_reset_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb) | |||
42 | 42 | ||
43 | nfc_dbg("entry, status 0x%x", rsp->status); | 43 | nfc_dbg("entry, status 0x%x", rsp->status); |
44 | 44 | ||
45 | if (rsp->status == NCI_STATUS_OK) | 45 | if (rsp->status == NCI_STATUS_OK) { |
46 | ndev->nci_ver = rsp->nci_ver; | 46 | ndev->nci_ver = rsp->nci_ver; |
47 | 47 | nfc_dbg("nci_ver 0x%x, config_status 0x%x", | |
48 | nfc_dbg("nci_ver 0x%x", ndev->nci_ver); | 48 | rsp->nci_ver, rsp->config_status); |
49 | } | ||
49 | 50 | ||
50 | nci_req_complete(ndev, rsp->status); | 51 | nci_req_complete(ndev, rsp->status); |
51 | } | 52 | } |
@@ -58,13 +59,13 @@ static void nci_core_init_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb) | |||
58 | nfc_dbg("entry, status 0x%x", rsp_1->status); | 59 | nfc_dbg("entry, status 0x%x", rsp_1->status); |
59 | 60 | ||
60 | if (rsp_1->status != NCI_STATUS_OK) | 61 | if (rsp_1->status != NCI_STATUS_OK) |
61 | return; | 62 | goto exit; |
62 | 63 | ||
63 | ndev->nfcc_features = __le32_to_cpu(rsp_1->nfcc_features); | 64 | ndev->nfcc_features = __le32_to_cpu(rsp_1->nfcc_features); |
64 | ndev->num_supported_rf_interfaces = rsp_1->num_supported_rf_interfaces; | 65 | ndev->num_supported_rf_interfaces = rsp_1->num_supported_rf_interfaces; |
65 | 66 | ||
66 | if (ndev->num_supported_rf_interfaces > | 67 | if (ndev->num_supported_rf_interfaces > |
67 | NCI_MAX_SUPPORTED_RF_INTERFACES) { | 68 | NCI_MAX_SUPPORTED_RF_INTERFACES) { |
68 | ndev->num_supported_rf_interfaces = | 69 | ndev->num_supported_rf_interfaces = |
69 | NCI_MAX_SUPPORTED_RF_INTERFACES; | 70 | NCI_MAX_SUPPORTED_RF_INTERFACES; |
70 | } | 71 | } |
@@ -73,20 +74,26 @@ static void nci_core_init_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb) | |||
73 | rsp_1->supported_rf_interfaces, | 74 | rsp_1->supported_rf_interfaces, |
74 | ndev->num_supported_rf_interfaces); | 75 | ndev->num_supported_rf_interfaces); |
75 | 76 | ||
76 | rsp_2 = (void *) (skb->data + 6 + ndev->num_supported_rf_interfaces); | 77 | rsp_2 = (void *) (skb->data + 6 + rsp_1->num_supported_rf_interfaces); |
77 | 78 | ||
78 | ndev->max_logical_connections = | 79 | ndev->max_logical_connections = |
79 | rsp_2->max_logical_connections; | 80 | rsp_2->max_logical_connections; |
80 | ndev->max_routing_table_size = | 81 | ndev->max_routing_table_size = |
81 | __le16_to_cpu(rsp_2->max_routing_table_size); | 82 | __le16_to_cpu(rsp_2->max_routing_table_size); |
82 | ndev->max_control_packet_payload_length = | 83 | ndev->max_ctrl_pkt_payload_len = |
83 | rsp_2->max_control_packet_payload_length; | 84 | rsp_2->max_ctrl_pkt_payload_len; |
84 | ndev->rf_sending_buffer_size = | 85 | ndev->max_size_for_large_params = |
85 | __le16_to_cpu(rsp_2->rf_sending_buffer_size); | 86 | __le16_to_cpu(rsp_2->max_size_for_large_params); |
86 | ndev->rf_receiving_buffer_size = | 87 | ndev->max_data_pkt_payload_size = |
87 | __le16_to_cpu(rsp_2->rf_receiving_buffer_size); | 88 | rsp_2->max_data_pkt_payload_size; |
88 | ndev->manufacturer_id = | 89 | ndev->initial_num_credits = |
89 | __le16_to_cpu(rsp_2->manufacturer_id); | 90 | rsp_2->initial_num_credits; |
91 | ndev->manufact_id = | ||
92 | rsp_2->manufact_id; | ||
93 | ndev->manufact_specific_info = | ||
94 | __le32_to_cpu(rsp_2->manufact_specific_info); | ||
95 | |||
96 | atomic_set(&ndev->credits_cnt, ndev->initial_num_credits); | ||
90 | 97 | ||
91 | nfc_dbg("nfcc_features 0x%x", | 98 | nfc_dbg("nfcc_features 0x%x", |
92 | ndev->nfcc_features); | 99 | ndev->nfcc_features); |
@@ -104,15 +111,20 @@ static void nci_core_init_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb) | |||
104 | ndev->max_logical_connections); | 111 | ndev->max_logical_connections); |
105 | nfc_dbg("max_routing_table_size %d", | 112 | nfc_dbg("max_routing_table_size %d", |
106 | ndev->max_routing_table_size); | 113 | ndev->max_routing_table_size); |
107 | nfc_dbg("max_control_packet_payload_length %d", | 114 | nfc_dbg("max_ctrl_pkt_payload_len %d", |
108 | ndev->max_control_packet_payload_length); | 115 | ndev->max_ctrl_pkt_payload_len); |
109 | nfc_dbg("rf_sending_buffer_size %d", | 116 | nfc_dbg("max_size_for_large_params %d", |
110 | ndev->rf_sending_buffer_size); | 117 | ndev->max_size_for_large_params); |
111 | nfc_dbg("rf_receiving_buffer_size %d", | 118 | nfc_dbg("max_data_pkt_payload_size %d", |
112 | ndev->rf_receiving_buffer_size); | 119 | ndev->max_data_pkt_payload_size); |
113 | nfc_dbg("manufacturer_id 0x%x", | 120 | nfc_dbg("initial_num_credits %d", |
114 | ndev->manufacturer_id); | 121 | ndev->initial_num_credits); |
115 | 122 | nfc_dbg("manufact_id 0x%x", | |
123 | ndev->manufact_id); | ||
124 | nfc_dbg("manufact_specific_info 0x%x", | ||
125 | ndev->manufact_specific_info); | ||
126 | |||
127 | exit: | ||
116 | nci_req_complete(ndev, rsp_1->status); | 128 | nci_req_complete(ndev, rsp_1->status); |
117 | } | 129 | } |
118 | 130 | ||