Source
static int process_state_init(struct nfcmrvl_private *priv, struct sk_buff *skb)
/*
* Marvell NFC driver: Firmware downloader
*
* Copyright (C) 2015, Marvell International Ltd.
*
* This software file (the "File") is distributed by Marvell International
* Ltd. under the terms of the GNU General Public License Version 2, June 1991
* (the "License"). You may use, redistribute and/or modify this File in
* accordance with the terms and conditions of the License, a copy of which
* is available on the worldwide web at
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
*
* THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND, AND THE
* IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE
* ARE EXPRESSLY DISCLAIMED. The License provides additional details about
* this warranty disclaimer.
*/
/* FW download states */
enum {
STATE_RESET = 0,
STATE_INIT,
STATE_SET_REF_CLOCK,
STATE_SET_HI_CONFIG,
STATE_OPEN_LC,
STATE_FW_DNLD,
STATE_CLOSE_LC,
STATE_BOOT
};
enum {
SUBSTATE_WAIT_COMMAND = 0,
SUBSTATE_WAIT_ACK_CREDIT,
SUBSTATE_WAIT_NACK_CREDIT,
SUBSTATE_WAIT_DATA_CREDIT,
};
/*
** Patterns for responses
*/
static const uint8_t nci_pattern_core_reset_ntf[] = {
0x60, 0x00, 0x02, 0xA0, 0x01
};
static const uint8_t nci_pattern_core_init_rsp[] = {
0x40, 0x01, 0x11
};