fw_dnld.c (4df864c1d9afb46e2461a9f808d9f11a42d31bad) fw_dnld.c (634fef61076d644b989b86abc2f560d81a089a31)
1/*
2 * Marvell NFC driver: Firmware downloader
3 *
4 * Copyright (C) 2015, Marvell International Ltd.
5 *
6 * This software file (the "File") is distributed by Marvell International
7 * Ltd. under the terms of the GNU General Public License Version 2, June 1991
8 * (the "License"). You may use, redistribute and/or modify this File in

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

287 memcpy(&comp_len, skb->data, 2);
288 skb_pull(skb, 2);
289 if (((~len) & 0xFFFF) != comp_len) {
290 nfc_err(priv->dev, "bad len complement: %x %x %x",
291 len, comp_len, (~len & 0xFFFF));
292 out_skb = alloc_lc_skb(priv, 1);
293 if (!out_skb)
294 return -ENOMEM;
1/*
2 * Marvell NFC driver: Firmware downloader
3 *
4 * Copyright (C) 2015, Marvell International Ltd.
5 *
6 * This software file (the "File") is distributed by Marvell International
7 * Ltd. under the terms of the GNU General Public License Version 2, June 1991
8 * (the "License"). You may use, redistribute and/or modify this File in

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

287 memcpy(&comp_len, skb->data, 2);
288 skb_pull(skb, 2);
289 if (((~len) & 0xFFFF) != comp_len) {
290 nfc_err(priv->dev, "bad len complement: %x %x %x",
291 len, comp_len, (~len & 0xFFFF));
292 out_skb = alloc_lc_skb(priv, 1);
293 if (!out_skb)
294 return -ENOMEM;
295 *(u8 *)skb_put(out_skb, 1) = 0xBF;
295 skb_put_u8(out_skb, 0xBF);
296 nci_send_frame(priv->ndev, out_skb);
297 priv->fw_dnld.substate = SUBSTATE_WAIT_NACK_CREDIT;
298 return 0;
299 }
300 priv->fw_dnld.chunk_len = len;
301 out_skb = alloc_lc_skb(priv, 1);
302 if (!out_skb)
303 return -ENOMEM;
296 nci_send_frame(priv->ndev, out_skb);
297 priv->fw_dnld.substate = SUBSTATE_WAIT_NACK_CREDIT;
298 return 0;
299 }
300 priv->fw_dnld.chunk_len = len;
301 out_skb = alloc_lc_skb(priv, 1);
302 if (!out_skb)
303 return -ENOMEM;
304 *(u8 *)skb_put(out_skb, 1) = HELPER_ACK_PACKET_FORMAT;
304 skb_put_u8(out_skb, HELPER_ACK_PACKET_FORMAT);
305 nci_send_frame(priv->ndev, out_skb);
306 priv->fw_dnld.substate = SUBSTATE_WAIT_ACK_CREDIT;
307 break;
308
309 case SUBSTATE_WAIT_ACK_CREDIT:
310 if (sizeof(nci_pattern_core_conn_credits_ntf) != skb->len ||
311 memcmp(nci_pattern_core_conn_credits_ntf, skb->data,
312 skb->len)) {

--- 245 unchanged lines hidden ---
305 nci_send_frame(priv->ndev, out_skb);
306 priv->fw_dnld.substate = SUBSTATE_WAIT_ACK_CREDIT;
307 break;
308
309 case SUBSTATE_WAIT_ACK_CREDIT:
310 if (sizeof(nci_pattern_core_conn_credits_ntf) != skb->len ||
311 memcmp(nci_pattern_core_conn_credits_ntf, skb->data,
312 skb->len)) {

--- 245 unchanged lines hidden ---