Signed-off-by: Jiri Benc <jb...@redhat.com>
---
 pmc_common.c |   16 ++++++++++++++--
 pmc_common.h |    2 +-
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/pmc_common.c b/pmc_common.c
index 061529e25b83..763b06e8e4c5 100644
--- a/pmc_common.c
+++ b/pmc_common.c
@@ -260,12 +260,14 @@ int pmc_send_get_action(struct pmc *pmc, int id)
        return 0;
 }
 
-int pmc_send_set_action(struct pmc *pmc, int id, void *data, int datasize)
+static int pmc_send_data_action(struct pmc *pmc, int action, int id,
+                               void *data, int datasize)
 {
        int pdulen;
        struct ptp_message *msg;
        struct management_tlv *mgt;
-       msg = pmc_message(pmc, SET);
+
+       msg = pmc_message(pmc, action);
        if (!msg) {
                return -1;
        }
@@ -283,6 +285,16 @@ int pmc_send_set_action(struct pmc *pmc, int id, void 
*data, int datasize)
        return 0;
 }
 
+int pmc_send_set_action(struct pmc *pmc, int id, void *data, int datasize)
+{
+       return pmc_send_data_action(pmc, GET, id, data, datasize);
+}
+
+int pmc_send_command_action(struct pmc *pmc, int id, void *data, int datasize)
+{
+       return pmc_send_data_action(pmc, COMMAND, id, data, datasize);
+}
+
 struct ptp_message *pmc_recv(struct pmc *pmc)
 {
        struct ptp_message *msg;
diff --git a/pmc_common.h b/pmc_common.h
index d55dfba56e7c..c56c50ada06a 100644
--- a/pmc_common.h
+++ b/pmc_common.h
@@ -34,8 +34,8 @@ void pmc_destroy(struct pmc *pmc);
 int pmc_get_transport_fd(struct pmc *pmc);
 
 int pmc_send_get_action(struct pmc *pmc, int id);
-
 int pmc_send_set_action(struct pmc *pmc, int id, void *data, int datasize);
+int pmc_send_command_action(struct pmc *pmc, int id, void *data, int datasize);
 
 struct ptp_message *pmc_recv(struct pmc *pmc);
 
-- 
1.7.6.5


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to