Skip to content

Commit

Permalink
NFC: Remove the static supported_se field
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Samuel Ortiz committed Jun 14, 2013
1 parent 322bce9 commit 0b456c4
Show file tree
Hide file tree
Showing 12 changed files with 6 additions and 23 deletions.
6 changes: 2 additions & 4 deletions drivers/nfc/microread/microread.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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 +
Expand Down
1 change: 0 additions & 1 deletion drivers/nfc/nfcwilink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion drivers/nfc/pn533.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 2 additions & 4 deletions drivers/nfc/pn544/pn544.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion include/net/nfc/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion include/net/nfc/nci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions include/net/nfc/nfc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);

Expand Down
2 changes: 0 additions & 2 deletions net/nfc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions net/nfc/hci/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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) {
Expand Down
2 changes: 0 additions & 2 deletions net/nfc/nci/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions net/nfc/nci/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion net/nfc/netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0b456c4

Please sign in to comment.