qcacld-3.0: Replace hdd_adapter_t in wlan_hdd_tsf.[ch]
The Linux Coding Style enumerates a few special cases where typedefs
are useful, but stresses "NEVER EVER use a typedef unless you can
clearly match one of those rules." The hdd_adapter_t typedef does not
meet any of those criteria, so replace references to it with a
reference to the underlying struct.
Change-Id: I2fd1dec7120e0c0a21b51080d654b5dc653e2589
CRs-Fixed: 2101074
diff --git a/core/hdd/inc/wlan_hdd_tsf.h b/core/hdd/inc/wlan_hdd_tsf.h
index f8e5ed3..384ee2c 100644
--- a/core/hdd/inc/wlan_hdd_tsf.h
+++ b/core/hdd/inc/wlan_hdd_tsf.h
@@ -178,7 +178,7 @@
*
* Return: Describe the execute result of this routine
*/
-int hdd_start_tsf_sync(hdd_adapter_t *adapter);
+int hdd_start_tsf_sync(struct hdd_adapter *adapter);
/**
* hdd_stop_tsf_sync() - stop tsf sync
@@ -188,7 +188,7 @@
*
* Return: Describe the execute result of this routine
*/
-int hdd_stop_tsf_sync(hdd_adapter_t *adapter);
+int hdd_stop_tsf_sync(struct hdd_adapter *adapter);
/**
* hdd_tsf_notify_wlan_state_change() -
@@ -201,7 +201,7 @@
*
* Return: nothing
*/
-void hdd_tsf_notify_wlan_state_change(hdd_adapter_t *adapter,
+void hdd_tsf_notify_wlan_state_change(struct hdd_adapter *adapter,
eConnectionState old_state,
eConnectionState new_state);
@@ -231,18 +231,18 @@
*/
int hdd_rx_timestamp(qdf_nbuf_t netbuf, uint64_t target_time);
#else
-static inline int hdd_start_tsf_sync(hdd_adapter_t *adapter)
+static inline int hdd_start_tsf_sync(struct hdd_adapter *adapter)
{
return -ENOTSUPP;
}
-static inline int hdd_stop_tsf_sync(hdd_adapter_t *adapter)
+static inline int hdd_stop_tsf_sync(struct hdd_adapter *adapter)
{
return -ENOTSUPP;
}
static inline
-void hdd_tsf_notify_wlan_state_change(hdd_adapter_t *adapter,
+void hdd_tsf_notify_wlan_state_change(struct hdd_adapter *adapter,
eConnectionState old_state,
eConnectionState new_state)
diff --git a/core/hdd/src/wlan_hdd_tsf.c b/core/hdd/src/wlan_hdd_tsf.c
index b08a43a..bfacfe1 100644
--- a/core/hdd/src/wlan_hdd_tsf.c
+++ b/core/hdd/src/wlan_hdd_tsf.c
@@ -49,27 +49,27 @@
};
#ifdef WLAN_FEATURE_TSF_PLUS
-static inline void hdd_set_th_sync_status(hdd_adapter_t *adapter,
+static inline void hdd_set_th_sync_status(struct hdd_adapter *adapter,
bool initialized)
{
qdf_atomic_set(&adapter->tsf_sync_ready_flag,
(initialized ? 1 : 0));
}
-static inline bool hdd_get_th_sync_status(hdd_adapter_t *adapter)
+static inline bool hdd_get_th_sync_status(struct hdd_adapter *adapter)
{
return qdf_atomic_read(&adapter->tsf_sync_ready_flag) != 0;
}
#else
-static inline bool hdd_get_th_sync_status(hdd_adapter_t *adapter)
+static inline bool hdd_get_th_sync_status(struct hdd_adapter *adapter)
{
return true;
}
#endif
static
-enum hdd_tsf_get_state hdd_tsf_check_conn_state(hdd_adapter_t *adapter)
+enum hdd_tsf_get_state hdd_tsf_check_conn_state(struct hdd_adapter *adapter)
{
enum hdd_tsf_get_state ret = TSF_RETURN;
struct hdd_station_ctx *hdd_sta_ctx;
@@ -92,7 +92,7 @@
return ret;
}
-static bool hdd_tsf_is_initialized(hdd_adapter_t *adapter)
+static bool hdd_tsf_is_initialized(struct hdd_adapter *adapter)
{
struct hdd_context *hddctx;
@@ -151,7 +151,7 @@
#endif
static enum hdd_tsf_op_result hdd_capture_tsf_internal(
- hdd_adapter_t *adapter, uint32_t *buf, int len)
+ struct hdd_adapter *adapter, uint32_t *buf, int len)
{
int ret;
struct hdd_context *hddctx;
@@ -210,7 +210,7 @@
}
static enum hdd_tsf_op_result hdd_indicate_tsf_internal(
- hdd_adapter_t *adapter, uint32_t *buf, int len)
+ struct hdd_adapter *adapter, uint32_t *buf, int len)
{
int ret;
struct hdd_context *hddctx;
@@ -302,7 +302,7 @@
};
static
-enum hdd_tsf_op_result __hdd_start_tsf_sync(hdd_adapter_t *adapter)
+enum hdd_tsf_op_result __hdd_start_tsf_sync(struct hdd_adapter *adapter)
{
QDF_STATUS ret;
@@ -321,7 +321,7 @@
}
static
-enum hdd_tsf_op_result __hdd_stop_tsf_sync(hdd_adapter_t *adapter)
+enum hdd_tsf_op_result __hdd_stop_tsf_sync(struct hdd_adapter *adapter)
{
QDF_STATUS ret;
@@ -338,7 +338,7 @@
return HDD_TSF_OP_SUCC;
}
-static inline void hdd_reset_timestamps(hdd_adapter_t *adapter)
+static inline void hdd_reset_timestamps(struct hdd_adapter *adapter)
{
qdf_spin_lock_bh(&adapter->host_target_sync_lock);
adapter->cur_host_time = 0;
@@ -413,7 +413,7 @@
return HDD_TS_STATUS_READY;
}
-static void hdd_update_timestamp(hdd_adapter_t *adapter,
+static void hdd_update_timestamp(struct hdd_adapter *adapter,
uint64_t target_time, uint64_t host_time)
{
int interval = 0;
@@ -480,7 +480,7 @@
qdf_mc_timer_start(&adapter->host_target_sync_timer, interval);
}
-static inline bool hdd_tsf_is_in_cap(hdd_adapter_t *adapter)
+static inline bool hdd_tsf_is_in_cap(struct hdd_adapter *adapter)
{
struct hdd_context *hddctx;
@@ -533,7 +533,7 @@
}
static inline int32_t hdd_get_hosttime_from_targettime(
- hdd_adapter_t *adapter, uint64_t target_time,
+ struct hdd_adapter *adapter, uint64_t target_time,
uint64_t *host_time)
{
int32_t ret = -EINVAL;
@@ -571,7 +571,7 @@
}
static inline int32_t hdd_get_targettime_from_hosttime(
- hdd_adapter_t *adapter, uint64_t host_time,
+ struct hdd_adapter *adapter, uint64_t host_time,
uint64_t *target_time)
{
int32_t ret = -EINVAL;
@@ -613,13 +613,13 @@
struct device_attribute *attr, char *buf)
{
struct hdd_station_ctx *hdd_sta_ctx;
- hdd_adapter_t *adapter;
+ struct hdd_adapter *adapter;
ssize_t size;
uint64_t host_time, target_time;
struct net_device *net_dev = container_of(dev, struct net_device, dev);
- adapter = (hdd_adapter_t *)(netdev_priv(net_dev));
+ adapter = (struct hdd_adapter *)(netdev_priv(net_dev));
if (adapter->magic != WLAN_HDD_ADAPTER_MAGIC)
return scnprintf(buf, PAGE_SIZE, "Invalid device\n");
@@ -659,18 +659,18 @@
static void hdd_capture_tsf_timer_expired_handler(void *arg)
{
uint32_t tsf_op_resp;
- hdd_adapter_t *adapter;
+ struct hdd_adapter *adapter;
if (!arg)
return;
- adapter = (hdd_adapter_t *)arg;
+ adapter = (struct hdd_adapter *)arg;
hdd_capture_tsf_internal(adapter, &tsf_op_resp, 1);
}
static irqreturn_t hdd_tsf_captured_irq_handler(int irq, void *arg)
{
- hdd_adapter_t *adapter;
+ struct hdd_adapter *adapter;
struct hdd_context *hdd_ctx;
uint64_t host_time;
char *name = NULL;
@@ -701,7 +701,7 @@
return IRQ_HANDLED;
}
-static enum hdd_tsf_op_result hdd_tsf_sync_init(hdd_adapter_t *adapter)
+static enum hdd_tsf_op_result hdd_tsf_sync_init(struct hdd_adapter *adapter)
{
QDF_STATUS ret;
struct hdd_context *hddctx;
@@ -750,7 +750,7 @@
return HDD_TSF_OP_FAIL;
}
-static enum hdd_tsf_op_result hdd_tsf_sync_deinit(hdd_adapter_t *adapter)
+static enum hdd_tsf_op_result hdd_tsf_sync_deinit(struct hdd_adapter *adapter)
{
QDF_STATUS ret;
struct hdd_context *hddctx;
@@ -795,7 +795,7 @@
return HDD_TSF_OP_SUCC;
}
-static inline void hdd_update_tsf(hdd_adapter_t *adapter, uint64_t tsf)
+static inline void hdd_update_tsf(struct hdd_adapter *adapter, uint64_t tsf)
{
uint32_t tsf_op_resp[3];
@@ -807,13 +807,13 @@
enum hdd_tsf_op_result hdd_netbuf_timestamp(qdf_nbuf_t netbuf,
uint64_t target_time)
{
- hdd_adapter_t *adapter;
+ struct hdd_adapter *adapter;
struct net_device *net_dev = netbuf->dev;
if (!net_dev)
return HDD_TSF_OP_FAIL;
- adapter = (hdd_adapter_t *)(netdev_priv(net_dev));
+ adapter = (struct hdd_adapter *)(netdev_priv(net_dev));
if (adapter && adapter->magic == WLAN_HDD_ADAPTER_MAGIC &&
hdd_get_th_sync_status(adapter)) {
uint64_t host_time;
@@ -828,7 +828,7 @@
return HDD_TSF_OP_FAIL;
}
-int hdd_start_tsf_sync(hdd_adapter_t *adapter)
+int hdd_start_tsf_sync(struct hdd_adapter *adapter)
{
enum hdd_tsf_op_result ret;
@@ -845,7 +845,7 @@
HDD_TSF_OP_SUCC) ? 0 : -EINVAL;
}
-int hdd_stop_tsf_sync(hdd_adapter_t *adapter)
+int hdd_stop_tsf_sync(struct hdd_adapter *adapter)
{
enum hdd_tsf_op_result ret;
@@ -912,7 +912,7 @@
return -EINVAL;
}
-static inline int __hdd_capture_tsf(hdd_adapter_t *adapter,
+static inline int __hdd_capture_tsf(struct hdd_adapter *adapter,
uint32_t *buf, int len)
{
if (!adapter || !buf) {
@@ -928,7 +928,7 @@
return 0;
}
-static inline int __hdd_indicate_tsf(hdd_adapter_t *adapter,
+static inline int __hdd_indicate_tsf(struct hdd_adapter *adapter,
uint32_t *buf, int len)
{
if (!adapter || !buf) {
@@ -982,7 +982,7 @@
return HDD_TSF_OP_SUCC;
}
-void hdd_tsf_notify_wlan_state_change(hdd_adapter_t *adapter,
+void hdd_tsf_notify_wlan_state_change(struct hdd_adapter *adapter,
eConnectionState old_state,
eConnectionState new_state)
{
@@ -997,18 +997,18 @@
hdd_stop_tsf_sync(adapter);
}
#else
-static inline void hdd_update_tsf(hdd_adapter_t *adapter, uint64_t tsf)
+static inline void hdd_update_tsf(struct hdd_adapter *adapter, uint64_t tsf)
{
}
-static inline int __hdd_indicate_tsf(hdd_adapter_t *adapter,
+static inline int __hdd_indicate_tsf(struct hdd_adapter *adapter,
uint32_t *buf, int len)
{
return (hdd_indicate_tsf_internal(adapter, buf, len) ==
HDD_TSF_OP_SUCC) ? 0 : -EINVAL;
}
-static inline int __hdd_capture_tsf(hdd_adapter_t *adapter,
+static inline int __hdd_capture_tsf(struct hdd_adapter *adapter,
uint32_t *buf, int len)
{
return (hdd_capture_tsf_internal(adapter, buf, len) ==
@@ -1028,12 +1028,12 @@
}
#endif /* WLAN_FEATURE_TSF_PLUS */
-int hdd_capture_tsf(hdd_adapter_t *adapter, uint32_t *buf, int len)
+int hdd_capture_tsf(struct hdd_adapter *adapter, uint32_t *buf, int len)
{
return __hdd_capture_tsf(adapter, buf, len);
}
-int hdd_indicate_tsf(hdd_adapter_t *adapter, uint32_t *buf, int len)
+int hdd_indicate_tsf(struct hdd_adapter *adapter, uint32_t *buf, int len)
{
return __hdd_indicate_tsf(adapter, buf, len);
}
@@ -1115,7 +1115,7 @@
int data_len)
{
struct net_device *dev = wdev->netdev;
- hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
+ struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
struct nlattr *tb_vendor[QCA_WLAN_VENDOR_ATTR_TSF_MAX + 1];
int status, ret;