aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-03-24 19:01:40 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-03-24 19:07:02 +0100
commit0a8308764c6e1a309842629b23e6ed17cfc755c7 (patch)
tree53fd78d763be7f2f4a1a64f418b5e53f1f14960b /include
parent953d4eda472c7b28b1f5d24dbd71247a80c0f08b (diff)
mtp: Implement reading the OPC/DPC for little endian
Diffstat (limited to 'include')
-rw-r--r--include/mtp/mtp_level3.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/mtp/mtp_level3.h b/include/mtp/mtp_level3.h
index 2395041..eed3762 100644
--- a/include/mtp/mtp_level3.h
+++ b/include/mtp/mtp_level3.h
@@ -71,6 +71,10 @@
((link) & MTP_LINK_MASK) << 28)
#define MTP_MAKE_APOC(apoc) \
(apoc & 0x3fff)
+#define MTP_READ_DPC(addr) \
+ (((addr) >> 0) & MTP_ADDR_MASK)
+#define MTP_READ_OPC(addr) \
+ (((addr) >> 14) & MTP_ADDR_MASK)
#elif OSMO_IS_BIG_ENDIAN
static inline uint32_t c_swap_32(uint32_t in)
{
@@ -91,6 +95,7 @@ static inline uint16_t c_swap_16(uint16_t in)
((link) & MTP_LINK_MASK) << 28)
#define MTP_MAKE_APOC(apoc) \
c_swap_16((apoc & 0x3fff))
+#error "Need to add MTP_READ_DPC/MTP_READ_OPC for big endian"
#endif