Эх сурвалжийг харах

qcacmn: Add QDF type to define a bitmap based on bits size

The bitmaps used in the driver are defined either as a single
or array of unsigned longs or some other types.

The bitmap variable size is different based on the platform(32/64 bit),
for unsigned long types.

Add support to have a platform agnostic consistent bitmap size
using the Linux provided interface for defining bitmaps.

CRs-Fixed: 2660881
Change-Id: I901778625ef9aaccc994d914c8adf98fbffeb980
Vivek 5 жил өмнө
parent
commit
a7412197a6

+ 9 - 1
qdf/inc/qdf_util.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -132,6 +132,14 @@ typedef __qdf_wait_queue_head_t qdf_wait_queue_head_t;
 
 #define qdf_ewma_rx_rssi_read(rx_rssi) \
 	__qdf_ewma_rx_rssi_read(rx_rssi)
+
+#define QDF_CHAR_BIT 8
+
+/**
+ * qdf_bitmap - Define a bitmap
+ */
+#define qdf_bitmap(name, bits) __qdf_bitmap(name, bits)
+
 /**
  * qdf_set_bit() - set bit in address
  * @nr: bit number to be set

+ 3 - 1
qdf/linux/src/i_qdf_util.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -77,6 +77,8 @@ typedef wait_queue_head_t __qdf_wait_queue_head_t;
 #define __qdf_unlikely(_expr)   unlikely(_expr)
 #define __qdf_likely(_expr)     likely(_expr)
 
+#define __qdf_bitmap(name, bits) DECLARE_BITMAP(name, bits)
+
 /**
  * __qdf_set_bit() - set bit in address
  * @nr: bit number to be set