From: Samuel Ortiz Date: Fri, 20 Apr 2012 16:37:03 +0000 (+0200) Subject: adapter: Make adapter_set_dep_state private to neard core X-Git-Tag: 0.3~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05ba4086637962b26bf44c33f69b9e9adb92265a;p=platform%2Fupstream%2Fneard.git adapter: Make adapter_set_dep_state private to neard core Plugins don't need to call thsi routine. --- diff --git a/include/adapter.h b/include/adapter.h index 3526493..faf32ba 100644 --- a/include/adapter.h +++ b/include/adapter.h @@ -32,8 +32,5 @@ int near_adapter_connect(uint32_t idx, uint32_t target_idx, uint8_t protocol); int near_adapter_disconnect(uint32_t idx); int near_adapter_send(uint32_t idx, uint8_t *buf, size_t length, near_recv rx_cb, void *data); int near_adapter_recv(uint32_t idx, uint8_t *buf, size_t length); -int near_adapter_get_dep_state(uint32_t idx); -int near_adapter_set_dep_state(uint32_t idx, near_bool_t dep); - #endif diff --git a/src/adapter.c b/src/adapter.c index f7f124e..eafb6cf 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -789,20 +789,7 @@ struct near_adapter *__near_adapter_get(uint32_t idx) return g_hash_table_lookup(adapter_hash, GINT_TO_POINTER(idx)); } -int near_adapter_get_dep_state(uint32_t idx) -{ - struct near_adapter *adapter; - - DBG("idx %d", idx); - - adapter = g_hash_table_lookup(adapter_hash, GINT_TO_POINTER(idx)); - if (adapter == NULL) - return -ENODEV; - - return adapter->dep_up; -} - -int near_adapter_set_dep_state(uint32_t idx, near_bool_t dep) +int __near_adapter_set_dep_state(uint32_t idx, near_bool_t dep) { struct near_adapter *adapter; diff --git a/src/near.h b/src/near.h index 0155533..246ad79 100644 --- a/src/near.h +++ b/src/near.h @@ -81,6 +81,7 @@ int __near_adapter_add_target(uint32_t idx, uint32_t target_idx, uint32_t protocols, uint16_t sens_res, uint8_t sel_res, uint8_t *nfcid, uint8_t nfcid_len); int __near_adapter_remove_target(uint32_t idx, uint32_t target_idx); +int __near_adapter_set_dep_state(uint32_t idx, near_bool_t dep); void __near_adapter_tags_changed(uint32_t adapter_idx); void __near_adapter_devices_changed(uint32_t adapter_idx); void __near_adapter_list(DBusMessageIter *iter, void *user_data); diff --git a/src/netlink.c b/src/netlink.c index ca635fd..cbf74e6 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -556,7 +556,7 @@ static int nfc_netlink_event_dep_up(struct genlmsghdr *gnlh) DBG("%d %d", idx, target_idx); - return near_adapter_set_dep_state(idx, TRUE); + return __near_adapter_set_dep_state(idx, TRUE); } else { return -EOPNOTSUPP; } @@ -578,7 +578,7 @@ static int nfc_netlink_event_dep_down(struct genlmsghdr *gnlh) idx = nla_get_u32(attrs[NFC_ATTR_DEVICE_INDEX]); - near_adapter_set_dep_state(idx, FALSE); + __near_adapter_set_dep_state(idx, FALSE); return 0; }