NFC: Add firmware upload netlink command

As several NFC chipsets can have their firmwares upgraded and
reflashed, this patchset adds a new netlink command to trigger
that the driver loads or flashes a new firmware. This will allows
userspace triggered firmware upgrade through netlink.
The firmware name or hint is passed as a parameter, and the driver
will eventually fetch the firmware binary through the request_firmware
API.
The cmd can only be executed when the nfc dev is not in use. Actual
firmware loading/flashing is an asynchronous operation. Result of the
operation shall send a new event up to user space through the nfc dev
multicast socket. During operation, the nfc dev is not openable and
thus not usable.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Eric Lapuyade
2013-04-29 17:13:27 +02:00
committed by Samuel Ortiz
parent 1095e69f47
commit 9674da8759
5 changed files with 122 additions and 0 deletions

View File

@@ -70,6 +70,7 @@ struct nfc_ops {
int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target);
int (*enable_se)(struct nfc_dev *dev, u32 secure_element);
int (*disable_se)(struct nfc_dev *dev, u32 secure_element);
int (*fw_upload)(struct nfc_dev *dev, const char *firmware_name);
};
#define NFC_TARGET_IDX_ANY -1
@@ -104,6 +105,7 @@ struct nfc_dev {
int targets_generation;
struct device dev;
bool dev_up;
bool fw_upload_in_progress;
u8 rf_mode;
bool polling;
struct nfc_target *active_target;