Browse Source

qcacmn: Add APIs to get lower 32 and upper 32 bits

Add APIs to get lower 32 and upper 32 bits from an
address.

Change-Id: I283792333075c11219a491d305b2822849c025f3
CRs-Fixed: 1062916
Himanshu Agarwal 8 years ago
parent
commit
ccd38dc2b4
2 changed files with 57 additions and 0 deletions
  1. 28 0
      qdf/inc/qdf_util.h
  2. 29 0
      qdf/linux/src/i_qdf_util.h

+ 28 - 0
qdf/inc/qdf_util.h

@@ -439,4 +439,32 @@ uint64_t qdf_get_totalramsize(void)
 	return __qdf_get_totalramsize();
 }
 
+/**
+ * qdf_get_lower_32_bits() - get lower 32 bits from an address.
+ * @addr: address
+ *
+ * This api returns the lower 32 bits of an address.
+ *
+ * Return: lower 32 bits.
+ */
+static inline
+uint32_t qdf_get_lower_32_bits(qdf_dma_addr_t addr)
+{
+	return __qdf_get_lower_32_bits(addr);
+}
+
+/**
+ * qdf_get_upper_32_bits() - get upper 32 bits from an address.
+ * @addr: address
+ *
+ * This api returns the upper 32 bits of an address.
+ *
+ * Return: upper 32 bits.
+ */
+static inline
+uint32_t qdf_get_upper_32_bits(qdf_dma_addr_t addr)
+{
+	return __qdf_get_upper_32_bits(addr);
+}
+
 #endif /*_QDF_UTIL_H*/

+ 29 - 0
qdf/linux/src/i_qdf_util.h

@@ -292,4 +292,33 @@ __qdf_get_totalramsize(void)
 	return MEMINFO_KB(meminfo.totalram);
 }
 
+/**
+ * __qdf_get_lower_32_bits() - get lower 32 bits from an address.
+ * @addr: address
+ *
+ * This api returns the lower 32 bits of an address.
+ *
+ * Return: lower 32 bits.
+ */
+static inline
+uint32_t __qdf_get_lower_32_bits(__qdf_dma_addr_t addr)
+{
+	return lower_32_bits(addr);
+}
+
+/**
+ * __qdf_get_upper_32_bits() - get upper 32 bits from an address.
+ * @addr: address
+ *
+ * This api returns the upper 32 bits of an address.
+ *
+ * Return: upper 32 bits.
+ */
+static inline
+uint32_t __qdf_get_upper_32_bits(__qdf_dma_addr_t addr)
+{
+	return upper_32_bits(addr);
+}
+
+
 #endif /*_I_QDF_UTIL_H*/