Skip to content

Commit 9ea7187

Browse files
author
Samuel Ortiz
committed
NFC: netlink: Rename CMD_FW_UPLOAD to CMD_FW_DOWNLOAD
Loading a firmware into a target is typically called firmware download, not firmware upload. So we rename the netlink API to NFC_CMD_FW_DOWNLOAD in order to avoid any terminology confusion from userspace. Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
1 parent 7427b37 commit 9ea7187

File tree

7 files changed

+29
-29
lines changed

7 files changed

+29
-29
lines changed

include/net/nfc/hci.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct nfc_hci_ops {
5959
struct nfc_target *target);
6060
int (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event,
6161
struct sk_buff *skb);
62-
int (*fw_upload)(struct nfc_hci_dev *hdev, const char *firmware_name);
62+
int (*fw_download)(struct nfc_hci_dev *hdev, const char *firmware_name);
6363
int (*discover_se)(struct nfc_hci_dev *dev);
6464
int (*enable_se)(struct nfc_hci_dev *dev, u32 se_idx);
6565
int (*disable_se)(struct nfc_hci_dev *dev, u32 se_idx);

include/net/nfc/nfc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct nfc_ops {
6868
void *cb_context);
6969
int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb);
7070
int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target);
71-
int (*fw_upload)(struct nfc_dev *dev, const char *firmware_name);
71+
int (*fw_download)(struct nfc_dev *dev, const char *firmware_name);
7272

7373
/* Secure Element API */
7474
int (*discover_se)(struct nfc_dev *dev);
@@ -127,7 +127,7 @@ struct nfc_dev {
127127
int targets_generation;
128128
struct device dev;
129129
bool dev_up;
130-
bool fw_upload_in_progress;
130+
bool fw_download_in_progress;
131131
u8 rf_mode;
132132
bool polling;
133133
struct nfc_target *active_target;

include/uapi/linux/nfc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@
6969
* starting a poll from a device which has a secure element enabled means
7070
* we want to do SE based card emulation.
7171
* @NFC_CMD_DISABLE_SE: Disable the physical link to a specific secure element.
72-
* @NFC_CMD_FW_UPLOAD: Request to Load/flash firmware, or event to inform that
73-
* some firmware was loaded
72+
* @NFC_CMD_FW_DOWNLOAD: Request to Load/flash firmware, or event to inform
73+
* that some firmware was loaded
7474
*/
7575
enum nfc_commands {
7676
NFC_CMD_UNSPEC,
@@ -94,7 +94,7 @@ enum nfc_commands {
9494
NFC_CMD_DISABLE_SE,
9595
NFC_CMD_LLC_SDREQ,
9696
NFC_EVENT_LLC_SDRES,
97-
NFC_CMD_FW_UPLOAD,
97+
NFC_CMD_FW_DOWNLOAD,
9898
NFC_EVENT_SE_ADDED,
9999
NFC_EVENT_SE_REMOVED,
100100
/* private: internal use only */

net/nfc/core.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ DEFINE_MUTEX(nfc_devlist_mutex);
4444
/* NFC device ID bitmap */
4545
static DEFINE_IDA(nfc_index_ida);
4646

47-
int nfc_fw_upload(struct nfc_dev *dev, const char *firmware_name)
47+
int nfc_fw_download(struct nfc_dev *dev, const char *firmware_name)
4848
{
4949
int rc = 0;
5050

@@ -62,28 +62,28 @@ int nfc_fw_upload(struct nfc_dev *dev, const char *firmware_name)
6262
goto error;
6363
}
6464

65-
if (!dev->ops->fw_upload) {
65+
if (!dev->ops->fw_download) {
6666
rc = -EOPNOTSUPP;
6767
goto error;
6868
}
6969

70-
dev->fw_upload_in_progress = true;
71-
rc = dev->ops->fw_upload(dev, firmware_name);
70+
dev->fw_download_in_progress = true;
71+
rc = dev->ops->fw_download(dev, firmware_name);
7272
if (rc)
73-
dev->fw_upload_in_progress = false;
73+
dev->fw_download_in_progress = false;
7474

7575
error:
7676
device_unlock(&dev->dev);
7777
return rc;
7878
}
7979

80-
int nfc_fw_upload_done(struct nfc_dev *dev, const char *firmware_name)
80+
int nfc_fw_download_done(struct nfc_dev *dev, const char *firmware_name)
8181
{
82-
dev->fw_upload_in_progress = false;
82+
dev->fw_download_in_progress = false;
8383

84-
return nfc_genl_fw_upload_done(dev, firmware_name);
84+
return nfc_genl_fw_download_done(dev, firmware_name);
8585
}
86-
EXPORT_SYMBOL(nfc_fw_upload_done);
86+
EXPORT_SYMBOL(nfc_fw_download_done);
8787

8888
/**
8989
* nfc_dev_up - turn on the NFC device
@@ -110,7 +110,7 @@ int nfc_dev_up(struct nfc_dev *dev)
110110
goto error;
111111
}
112112

113-
if (dev->fw_upload_in_progress) {
113+
if (dev->fw_download_in_progress) {
114114
rc = -EBUSY;
115115
goto error;
116116
}

net/nfc/hci/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -809,14 +809,14 @@ static void nfc_hci_recv_from_llc(struct nfc_hci_dev *hdev, struct sk_buff *skb)
809809
}
810810
}
811811

812-
static int hci_fw_upload(struct nfc_dev *nfc_dev, const char *firmware_name)
812+
static int hci_fw_download(struct nfc_dev *nfc_dev, const char *firmware_name)
813813
{
814814
struct nfc_hci_dev *hdev = nfc_get_drvdata(nfc_dev);
815815

816-
if (!hdev->ops->fw_upload)
816+
if (!hdev->ops->fw_download)
817817
return -ENOTSUPP;
818818

819-
return hdev->ops->fw_upload(hdev, firmware_name);
819+
return hdev->ops->fw_download(hdev, firmware_name);
820820
}
821821

822822
static struct nfc_ops hci_nfc_ops = {
@@ -831,7 +831,7 @@ static struct nfc_ops hci_nfc_ops = {
831831
.im_transceive = hci_transceive,
832832
.tm_send = hci_tm_send,
833833
.check_presence = hci_check_presence,
834-
.fw_upload = hci_fw_upload,
834+
.fw_download = hci_fw_download,
835835
.discover_se = hci_discover_se,
836836
.enable_se = hci_enable_se,
837837
.disable_se = hci_disable_se,

net/nfc/netlink.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ static int nfc_genl_llc_sdreq(struct sk_buff *skb, struct genl_info *info)
10891089
return rc;
10901090
}
10911091

1092-
static int nfc_genl_fw_upload(struct sk_buff *skb, struct genl_info *info)
1092+
static int nfc_genl_fw_download(struct sk_buff *skb, struct genl_info *info)
10931093
{
10941094
struct nfc_dev *dev;
10951095
int rc;
@@ -1108,13 +1108,13 @@ static int nfc_genl_fw_upload(struct sk_buff *skb, struct genl_info *info)
11081108
nla_strlcpy(firmware_name, info->attrs[NFC_ATTR_FIRMWARE_NAME],
11091109
sizeof(firmware_name));
11101110

1111-
rc = nfc_fw_upload(dev, firmware_name);
1111+
rc = nfc_fw_download(dev, firmware_name);
11121112

11131113
nfc_put_device(dev);
11141114
return rc;
11151115
}
11161116

1117-
int nfc_genl_fw_upload_done(struct nfc_dev *dev, const char *firmware_name)
1117+
int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name)
11181118
{
11191119
struct sk_buff *msg;
11201120
void *hdr;
@@ -1124,7 +1124,7 @@ int nfc_genl_fw_upload_done(struct nfc_dev *dev, const char *firmware_name)
11241124
return -ENOMEM;
11251125

11261126
hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0,
1127-
NFC_CMD_FW_UPLOAD);
1127+
NFC_CMD_FW_DOWNLOAD);
11281128
if (!hdr)
11291129
goto free_msg;
11301130

@@ -1251,8 +1251,8 @@ static struct genl_ops nfc_genl_ops[] = {
12511251
.policy = nfc_genl_policy,
12521252
},
12531253
{
1254-
.cmd = NFC_CMD_FW_UPLOAD,
1255-
.doit = nfc_genl_fw_upload,
1254+
.cmd = NFC_CMD_FW_DOWNLOAD,
1255+
.doit = nfc_genl_fw_download,
12561256
.policy = nfc_genl_policy,
12571257
},
12581258
{

net/nfc/nfc.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ static inline void nfc_device_iter_exit(struct class_dev_iter *iter)
123123
class_dev_iter_exit(iter);
124124
}
125125

126-
int nfc_fw_upload(struct nfc_dev *dev, const char *firmware_name);
127-
int nfc_genl_fw_upload_done(struct nfc_dev *dev, const char *firmware_name);
126+
int nfc_fw_download(struct nfc_dev *dev, const char *firmware_name);
127+
int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name);
128128

129-
int nfc_fw_upload_done(struct nfc_dev *dev, const char *firmware_name);
129+
int nfc_fw_download_done(struct nfc_dev *dev, const char *firmware_name);
130130

131131
int nfc_dev_up(struct nfc_dev *dev);
132132

0 commit comments

Comments
 (0)