Skip to content

Commit

Permalink
NFC: Removal of unused operations for NCI spec 1.0 d18
Browse files Browse the repository at this point in the history
Remove unused NCI operations, e.g. create static rf connection.

Signed-off-by: Ilan Elias <ilane@ti.com>
Acked-by: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Ilan Elias authored and John W. Linville committed Nov 11, 2011
1 parent e8c0dac commit ee4c64f
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 74 deletions.
27 changes: 0 additions & 27 deletions include/net/nfc/nci.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,6 @@ struct nci_core_reset_cmd {

#define NCI_OP_CORE_INIT_CMD nci_opcode_pack(NCI_GID_CORE, 0x01)

#define NCI_OP_CORE_SET_CONFIG_CMD nci_opcode_pack(NCI_GID_CORE, 0x02)

#define NCI_OP_CORE_CONN_CREATE_CMD nci_opcode_pack(NCI_GID_CORE, 0x04)
struct nci_core_conn_create_cmd {
__u8 target_handle;
__u8 num_target_specific_params;
} __packed;

#define NCI_OP_CORE_CONN_CLOSE_CMD nci_opcode_pack(NCI_GID_CORE, 0x06)

#define NCI_OP_RF_DISCOVER_MAP_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x00)
struct disc_map_config {
__u8 rf_protocol;
Expand Down Expand Up @@ -262,18 +252,6 @@ struct nci_core_init_rsp_2 {
__le32 manufact_specific_info;
} __packed;

#define NCI_OP_CORE_SET_CONFIG_RSP nci_opcode_pack(NCI_GID_CORE, 0x02)

#define NCI_OP_CORE_CONN_CREATE_RSP nci_opcode_pack(NCI_GID_CORE, 0x04)
struct nci_core_conn_create_rsp {
__u8 status;
__u8 max_pkt_payload_size;
__u8 initial_num_credits;
__u8 conn_id;
} __packed;

#define NCI_OP_CORE_CONN_CLOSE_RSP nci_opcode_pack(NCI_GID_CORE, 0x06)

#define NCI_OP_RF_DISCOVER_MAP_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x00)

#define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03)
Expand All @@ -294,11 +272,6 @@ struct nci_core_conn_credit_ntf {
struct conn_credit_entry conn_entries[NCI_MAX_NUM_CONN];
} __packed;

#define NCI_OP_RF_FIELD_INFO_NTF nci_opcode_pack(NCI_GID_CORE, 0x08)
struct nci_rf_field_info_ntf {
__u8 rf_field_status;
} __packed;

#define NCI_OP_RF_INTF_ACTIVATED_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x05)
struct rf_tech_specific_params_nfca_poll {
__u16 sens_res;
Expand Down
4 changes: 0 additions & 4 deletions include/net/nfc/nci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ struct nci_dev {
__u8 manufact_id;
__u32 manufact_specific_info;

/* received during NCI_OP_CORE_CONN_CREATE_RSP for static conn 0 */
__u8 max_pkt_payload_size;
__u8 conn_id;

/* stored during nci_data_exchange */
data_exchange_cb_t data_exchange_cb;
void *data_exchange_cb_context;
Expand Down
6 changes: 0 additions & 6 deletions net/nfc/nci/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,11 @@ static void nci_init_req(struct nci_dev *ndev, unsigned long opt)

static void nci_init_complete_req(struct nci_dev *ndev, unsigned long opt)
{
struct nci_core_conn_create_cmd conn_cmd;
struct nci_rf_disc_map_cmd cmd;
struct disc_map_config *cfg = cmd.mapping_configs;
__u8 *num = &cmd.num_mapping_configs;
int i;

/* create static rf connection */
conn_cmd.target_handle = 0;
conn_cmd.num_target_specific_params = 0;
nci_send_cmd(ndev, NCI_OP_CORE_CONN_CREATE_CMD, 2, &conn_cmd);

/* set rf mapping configurations */
*num = 0;

Expand Down
15 changes: 3 additions & 12 deletions net/nfc/nci/ntf.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,6 @@ static void nci_core_conn_credits_ntf_packet(struct nci_dev *ndev,
queue_work(ndev->tx_wq, &ndev->tx_work);
}

static void nci_rf_field_info_ntf_packet(struct nci_dev *ndev,
struct sk_buff *skb)
{
struct nci_rf_field_info_ntf *ntf = (void *) skb->data;

nfc_dbg("entry, rf_field_status %d", ntf->rf_field_status);
}

static __u8 *nci_extract_rf_params_nfca_passive_poll(struct nci_dev *ndev,
struct nci_rf_intf_activated_ntf *ntf, __u8 *data)
{
Expand Down Expand Up @@ -251,6 +243,9 @@ static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev,
ndev->rx_data_reassembly = 0;
}

/* set the available credits to initial value */
atomic_set(&ndev->credits_cnt, ndev->initial_num_credits);

/* complete the data exchange transaction, if exists */
if (test_bit(NCI_DATA_EXCHANGE, &ndev->flags))
nci_data_exchange_complete(ndev, NULL, -EIO);
Expand All @@ -274,10 +269,6 @@ void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb)
nci_core_conn_credits_ntf_packet(ndev, skb);
break;

case NCI_OP_RF_FIELD_INFO_NTF:
nci_rf_field_info_ntf_packet(ndev, skb);
break;

case NCI_OP_RF_INTF_ACTIVATED_NTF:
nci_rf_intf_activated_ntf_packet(ndev, skb);
break;
Expand Down
25 changes: 0 additions & 25 deletions net/nfc/nci/rsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,27 +128,6 @@ static void nci_core_init_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
nci_req_complete(ndev, rsp_1->status);
}

static void nci_core_conn_create_rsp_packet(struct nci_dev *ndev,
struct sk_buff *skb)
{
struct nci_core_conn_create_rsp *rsp = (void *) skb->data;

nfc_dbg("entry, status 0x%x", rsp->status);

if (rsp->status != NCI_STATUS_OK)
return;

ndev->max_pkt_payload_size = rsp->max_pkt_payload_size;
ndev->initial_num_credits = rsp->initial_num_credits;
ndev->conn_id = rsp->conn_id;

atomic_set(&ndev->credits_cnt, ndev->initial_num_credits);

nfc_dbg("max_pkt_payload_size %d", ndev->max_pkt_payload_size);
nfc_dbg("initial_num_credits %d", ndev->initial_num_credits);
nfc_dbg("conn_id %d", ndev->conn_id);
}

static void nci_rf_disc_map_rsp_packet(struct nci_dev *ndev,
struct sk_buff *skb)
{
Expand Down Expand Up @@ -208,10 +187,6 @@ void nci_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb)
nci_core_init_rsp_packet(ndev, skb);
break;

case NCI_OP_CORE_CONN_CREATE_RSP:
nci_core_conn_create_rsp_packet(ndev, skb);
break;

case NCI_OP_RF_DISCOVER_MAP_RSP:
nci_rf_disc_map_rsp_packet(ndev, skb);
break;
Expand Down

0 comments on commit ee4c64f

Please sign in to comment.