NFC: Remove the static supported_se field
authorSamuel Ortiz <sameo@linux.intel.com>
Tue, 7 May 2013 17:22:11 +0000 (19:22 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 14 Jun 2013 11:44:19 +0000 (13:44 +0200)
Supported secure elements are typically found during a discovery process
initiated when the NFC controller is up and running. For a given NFC
chipset there can be many configurations (embedded SE or not, with or
without a SIM card wired to the NFC controller SWP interface, etc...) and
thus driver code will never know before hand which SEs are available.
So we remove this field, it will be replaced by a real SE discovery
mechanism.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 files changed:
drivers/nfc/microread/microread.c
drivers/nfc/nfcwilink.c
drivers/nfc/pn533.c
drivers/nfc/pn544/pn544.c
include/net/nfc/hci.h
include/net/nfc/nci_core.h
include/net/nfc/nfc.h
net/nfc/core.c
net/nfc/hci/core.c
net/nfc/nci/core.c
net/nfc/nci/spi.c
net/nfc/netlink.c

index 3420d833db170e2e308e48d3bedab2b988dba29f..cdb9f6de132a5c16b564e2a1228bbc3ae594ec2f 100644 (file)
@@ -650,7 +650,7 @@ int microread_probe(void *phy_id, struct nfc_phy_ops *phy_ops, char *llc_name,
 {
        struct microread_info *info;
        unsigned long quirks = 0;
-       u32 protocols, se;
+       u32 protocols;
        struct nfc_hci_init_data init_data;
        int r;
 
@@ -678,10 +678,8 @@ int microread_probe(void *phy_id, struct nfc_phy_ops *phy_ops, char *llc_name,
                    NFC_PROTO_ISO14443_B_MASK |
                    NFC_PROTO_NFC_DEP_MASK;
 
-       se = NFC_SE_UICC | NFC_SE_EMBEDDED;
-
        info->hdev = nfc_hci_allocate_device(&microread_hci_ops, &init_data,
-                                            quirks, protocols, se, llc_name,
+                                            quirks, protocols, llc_name,
                                             phy_headroom +
                                             MICROREAD_CMDS_HEADROOM,
                                             phy_tailroom +
index 41cf8f70a6adf8780c44e56e263f30531a917f65..59f95d8fc98c887228d15e0421c69906bdd85154 100644 (file)
@@ -535,7 +535,6 @@ static int nfcwilink_probe(struct platform_device *pdev)
 
        drv->ndev = nci_allocate_device(&nfcwilink_ops,
                                        protocols,
-                                       NFC_SE_NONE,
                                        NFCWILINK_HDR_LEN,
                                        0);
        if (!drv->ndev) {
index e196bdfcfc30afb222e4c095983de017a697ff21..a1b46aa7b4d55d9ac4f0c092d9bb7e249f0eee95 100644 (file)
@@ -2791,7 +2791,6 @@ static int pn533_probe(struct usb_interface *interface,
 
 
        dev->nfc_dev = nfc_allocate_device(&pn533_nfc_ops, protocols,
-                                          NFC_SE_NONE,
                                           dev->ops->tx_header_len +
                                           PN533_CMD_DATAEXCH_HEAD_LEN,
                                           dev->ops->tx_tail_len);
index 84b5168b603c08a88fd6de5fbb14069e4cee4f0f..0d17da7675b75b245a26d79498fc58418054f71d 100644 (file)
@@ -803,7 +803,7 @@ int pn544_hci_probe(void *phy_id, struct nfc_phy_ops *phy_ops, char *llc_name,
                    struct nfc_hci_dev **hdev)
 {
        struct pn544_hci_info *info;
-       u32 protocols, se;
+       u32 protocols;
        struct nfc_hci_init_data init_data;
        int r;
 
@@ -836,10 +836,8 @@ int pn544_hci_probe(void *phy_id, struct nfc_phy_ops *phy_ops, char *llc_name,
                    NFC_PROTO_ISO14443_B_MASK |
                    NFC_PROTO_NFC_DEP_MASK;
 
-       se = NFC_SE_UICC | NFC_SE_EMBEDDED;
-
        info->hdev = nfc_hci_allocate_device(&pn544_hci_ops, &init_data, 0,
-                                            protocols, se, llc_name,
+                                            protocols, llc_name,
                                             phy_headroom + PN544_CMDS_HEADROOM,
                                             phy_tailroom, phy_payload);
        if (!info->hdev) {
index 14faf2dc7a4878d3c49e1cde13b902290b0a396e..eca8846a63d6ebca22568040c965c740733091a7 100644 (file)
@@ -153,7 +153,6 @@ struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops,
                                            struct nfc_hci_init_data *init_data,
                                            unsigned long quirks,
                                            u32 protocols,
-                                           u32 supported_se,
                                            const char *llc_name,
                                            int tx_headroom,
                                            int tx_tailroom,
index fc1296db237b9fa6fcdaef7826472039f26164d5..99fc1f3a392af172b2c3d5b5b499898f5cfbae39 100644 (file)
@@ -148,7 +148,6 @@ struct nci_dev {
 /* ----- NCI Devices ----- */
 struct nci_dev *nci_allocate_device(struct nci_ops *ops,
                                    __u32 supported_protocols,
-                                   __u32 supported_se,
                                    int tx_headroom,
                                    int tx_tailroom);
 void nci_free_device(struct nci_dev *ndev);
index 8fc1784a264d24a4c0bee8c5a0ee43432b687198..9900c0f5d6bde9857df8afac5eca4271184193e0 100644 (file)
@@ -115,7 +115,6 @@ struct nfc_dev {
        struct nfc_genl_data genl_data;
        u32 supported_protocols;
 
-       u32 supported_se;
        u32 active_se;
 
        int tx_headroom;
@@ -136,7 +135,6 @@ extern struct class nfc_class;
 
 struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops,
                                    u32 supported_protocols,
-                                   u32 supported_se,
                                    int tx_headroom,
                                    int tx_tailroom);
 
index eb3cecf1764ecb12bef5b17f92f5991d59158cc1..334954a1d6e86476b5bb04505d20f157ed820bef 100644 (file)
@@ -832,7 +832,6 @@ struct nfc_dev *nfc_get_device(unsigned int idx)
  */
 struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops,
                                    u32 supported_protocols,
-                                   u32 supported_se,
                                    int tx_headroom, int tx_tailroom)
 {
        struct nfc_dev *dev;
@@ -850,7 +849,6 @@ struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops,
 
        dev->ops = ops;
        dev->supported_protocols = supported_protocols;
-       dev->supported_se = supported_se;
        dev->active_se = NFC_SE_NONE;
        dev->tx_headroom = tx_headroom;
        dev->tx_tailroom = tx_tailroom;
index d2ef1e2ee0c6998947ab01eae21c011ba851d5ce..9c8a63d341d3abc9d191207a7048137142836c3d 100644 (file)
@@ -808,7 +808,6 @@ struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops,
                                            struct nfc_hci_init_data *init_data,
                                            unsigned long quirks,
                                            u32 protocols,
-                                           u32 supported_se,
                                            const char *llc_name,
                                            int tx_headroom,
                                            int tx_tailroom,
@@ -834,7 +833,7 @@ struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops,
                return NULL;
        }
 
-       hdev->ndev = nfc_allocate_device(&hci_nfc_ops, protocols, supported_se,
+       hdev->ndev = nfc_allocate_device(&hci_nfc_ops, protocols,
                                         tx_headroom + HCI_CMDS_HEADROOM,
                                         tx_tailroom);
        if (!hdev->ndev) {
index 8e0dbbeee9e333d4ff27ad9f1a65c55053dd64f6..145bad15e1131bd23f327abb0b8b45b22e56405b 100644 (file)
@@ -658,7 +658,6 @@ static struct nfc_ops nci_nfc_ops = {
  */
 struct nci_dev *nci_allocate_device(struct nci_ops *ops,
                                    __u32 supported_protocols,
-                                   __u32 supported_se,
                                    int tx_headroom, int tx_tailroom)
 {
        struct nci_dev *ndev;
@@ -681,7 +680,6 @@ struct nci_dev *nci_allocate_device(struct nci_ops *ops,
 
        ndev->nfc_dev = nfc_allocate_device(&nci_nfc_ops,
                                            supported_protocols,
-                                           supported_se,
                                            tx_headroom + NCI_DATA_HDR_SIZE,
                                            tx_tailroom);
        if (!ndev->nfc_dev)
index 70afc387a9659f1bb28ea977b28aaebcfe8bc6c0..c7cf37ba729819ab49c22f5b462320f633cdab5c 100644 (file)
@@ -162,8 +162,7 @@ struct nci_spi_dev *nci_spi_allocate_device(struct spi_device *spi,
                tailroom += NCI_SPI_CRC_LEN;
 
        ndev->nci_dev = nci_allocate_device(&nci_spi_ops, supported_protocols,
-                                           supported_se, NCI_SPI_HDR_LEN,
-                                           tailroom);
+                                           NCI_SPI_HDR_LEN, tailroom);
        if (!ndev->nci_dev)
                return NULL;
 
index 1deadad9a285bdb61d842fe6c237452b986b53dd..fdbc662c564a65ca722bfdcc1180b0b7ddcb21ca 100644 (file)
@@ -444,7 +444,6 @@ static int nfc_genl_send_device(struct sk_buff *msg, struct nfc_dev *dev,
        if (nla_put_string(msg, NFC_ATTR_DEVICE_NAME, nfc_device_name(dev)) ||
            nla_put_u32(msg, NFC_ATTR_DEVICE_INDEX, dev->idx) ||
            nla_put_u32(msg, NFC_ATTR_PROTOCOLS, dev->supported_protocols) ||
-           nla_put_u32(msg, NFC_ATTR_SE, dev->supported_se) ||
            nla_put_u8(msg, NFC_ATTR_DEVICE_POWERED, dev->dev_up) ||
            nla_put_u8(msg, NFC_ATTR_RF_MODE, dev->rf_mode))
                goto nla_put_failure;