[wlan][iwlwifi] change code for C++ compiler.

Header files will be included for unit test code (C++).
So change code for C++ compiler.

BUG=WLAN-1129
TEST=Compile in local.

Change-Id: I67e78d3b0df0602974b02e6b99a70045c0c0f751
diff --git a/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/fuchsia_porting.h b/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/fuchsia_porting.h
index c28f349..83d68bb 100644
--- a/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/fuchsia_porting.h
+++ b/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/fuchsia_porting.h
@@ -107,21 +107,52 @@
 #define rcu_read_lock() do {} while (0);
 #define rcu_read_unlock() do {} while (0);
 
+// NEEDS_PORTING: Below structures are only referenced in function prototype.
+//                Doesn't need a dummy byte.
+struct dentry;
+struct device;
+struct wait_queue;
+struct wiphy;
+
 // NEEDS_PORTING: Below structures are used in code but not ported yet.
-struct delayed_work {};
-struct dentry {};
-struct device {};
-struct ewma_rate {};
-struct inet6_dev {};
-struct mac_address {};
-struct napi_struct {};
-struct rcu_head {};
-struct sk_buff_head {};
-struct timer_list {};
-struct wait_queue {};
-struct wait_queue_head {};
-struct wiphy {};
-struct work_struct {};
+// A dummy byte is required to suppress the C++ warning message for empty struct.
+struct delayed_work {
+    char dummy;
+};
+
+struct ewma_rate {
+    char dummy;
+};
+
+struct inet6_dev;
+
+struct mac_address {
+    char dummy;
+};
+
+struct napi_struct {
+    char dummy;
+};
+
+struct rcu_head {
+    char dummy;
+};
+
+struct sk_buff_head {
+    char dummy;
+};
+
+struct timer_list {
+    char dummy;
+};
+
+struct wait_queue_head {
+    char dummy;
+};
+
+struct work_struct {
+    char dummy;
+};
 
 struct firmware {
     zx_handle_t vmo;
@@ -130,7 +161,7 @@
 };
 
 struct page {
-    void* virtual;
+    void* virtual_addr;
 };
 
 struct wireless_dev {
@@ -186,7 +217,7 @@
 
 static inline void *page_address(const struct page *page)
 {
-    return page->virtual;
+    return page->virtual_addr;
 }
 
 #endif  // SRC_CONNECTIVITY_WLAN_DRIVERS_THIRD_PARTY_INTEL_IWLWIFI_FUCHSIA_PORTING_H_
diff --git a/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/fw/error-dump.h b/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/fw/error-dump.h
index b4fa1d03..08963c7 100644
--- a/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/fw/error-dump.h
+++ b/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/fw/error-dump.h
@@ -296,7 +296,7 @@
  */
 static inline struct iwl_fw_error_dump_data* iwl_fw_error_next_data(
     struct iwl_fw_error_dump_data* data) {
-    return (void*)(data->data + le32_to_cpu(data->len));
+    return (struct iwl_fw_error_dump_data*)(data->data + le32_to_cpu(data->len));
 }
 
 /**
diff --git a/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/ieee80211.h b/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/ieee80211.h
index b081063..013ba77 100644
--- a/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/ieee80211.h
+++ b/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/ieee80211.h
@@ -116,27 +116,57 @@
     IEEE80211_STA_AUTHORIZED,
 };
 
-// empty structs
-struct cfg80211_chan_def {};
-struct cfg80211_gtk_rekey_data {};
-struct cfg80211_nan_conf {};
-struct cfg80211_nan_func {};
-struct cfg80211_scan_request {};
-struct cfg80211_sched_scan_request {};
-struct cfg80211_wowlan {};
-struct ieee80211_channel {};
-struct ieee80211_cipher_scheme {};
-struct ieee80211_hdr {};
-struct ieee80211_key_conf {};
-struct ieee80211_ops {};
-struct ieee80211_p2p_noa_desc {};
-struct ieee80211_sta_ht_cap {};
-struct ieee80211_rx_status {};
-struct ieee80211_scan_ies {};
-struct ieee80211_supported_band {};
-struct ieee80211_tdls_ch_sw_params {};
-struct ieee80211_tx_queue_params {};
-struct ieee80211_tx_rate {};
+// NEEDS_PORTING: Below structures are only referenced in function prototype.
+//                Doesn't need a dummy byte.
+struct cfg80211_gtk_rekey_data;
+struct cfg80211_nan_conf;
+struct cfg80211_nan_func;
+struct cfg80211_scan_request;
+struct cfg80211_sched_scan_request;
+struct cfg80211_wowlan;
+struct ieee80211_key_conf;
+struct ieee80211_sta_ht_cap;
+struct ieee80211_rx_status;
+struct ieee80211_scan_ies;
+struct ieee80211_tdls_ch_sw_params;
+
+// NEEDS_PORTING: Below structures are used in code but not ported yet.
+// A dummy byte is required to suppress the C++ warning message for empty struct.
+struct cfg80211_chan_def {
+    char dummy;
+};
+
+struct ieee80211_channel {
+    char dummy;
+};
+
+struct ieee80211_cipher_scheme {
+    char dummy;
+};
+
+struct ieee80211_hdr {
+    char dummy;
+};
+
+struct ieee80211_ops {
+    char dummy;
+};
+
+struct ieee80211_p2p_noa_desc {
+    char dummy;
+};
+
+struct ieee80211_supported_band {
+    char dummy;
+};
+
+struct ieee80211_tx_queue_params {
+    char dummy;
+};
+
+struct ieee80211_tx_rate {
+    char dummy;
+};
 
 // dummy structs
 struct ieee80211_hw {
diff --git a/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/mvm/mvm.h b/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/mvm/mvm.h
index 03ba901..80cab59 100644
--- a/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/mvm/mvm.h
+++ b/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/mvm/mvm.h
@@ -61,6 +61,10 @@
 #include "src/connectivity/wlan/drivers/third_party/intel/iwlwifi/lte-coex.h"
 #endif
 
+#ifdef __cplusplus
+using std::atomic_int;
+#endif  // __cplusplus
+
 #define IWL_MVM_MAX_ADDRESSES 5
 /* RSSI offset for WkP */
 #define IWL_RSSI_OFFSET 50
@@ -453,7 +457,7 @@
 
 static inline struct iwl_mvm_vif* iwl_mvm_vif_from_mac80211(struct ieee80211_vif* vif) {
     if (!vif) { return NULL; }
-    return (void*)vif->drv_priv;
+    return (struct iwl_mvm_vif*)vif->drv_priv;
 }
 
 extern const uint8_t tid_to_mac80211_ac[];
@@ -736,8 +740,9 @@
 
 static inline struct iwl_mvm_baid_data* iwl_mvm_baid_data_from_reorder_buf(
     struct iwl_mvm_reorder_buffer* buf) {
-    return (void*)((uint8_t*)buf - offsetof(struct iwl_mvm_baid_data, reorder_buf) -
-                   sizeof(*buf) * buf->queue);
+    return (struct iwl_mvm_baid_data*)((uint8_t*)buf -
+                                       offsetof(struct iwl_mvm_baid_data, reorder_buf) -
+                                       sizeof(*buf) * buf->queue);
 }
 
 /*
@@ -790,13 +795,13 @@
 };
 
 static inline struct iwl_mvm_txq* iwl_mvm_txq_from_mac80211(struct ieee80211_txq* txq) {
-    return (void*)txq->drv_priv;
+    return (struct iwl_mvm_txq*)txq->drv_priv;
 }
 
 static inline struct iwl_mvm_txq* iwl_mvm_txq_from_tid(struct ieee80211_sta* sta, uint8_t tid) {
     if (tid == IWL_MAX_TID_COUNT) { tid = IEEE80211_NUM_TIDS; }
 
-    return (void*)sta->txq[tid]->drv_priv;
+    return (struct iwl_mvm_txq*)(sta->txq[tid]->drv_priv);
 }
 
 /**
diff --git a/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/mvm/sta.h b/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/mvm/sta.h
index 5adae38..e35a9da 100644
--- a/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/mvm/sta.h
+++ b/src/connectivity/wlan/drivers/third_party/intel/iwlwifi/mvm/sta.h
@@ -415,7 +415,7 @@
 uint16_t iwl_mvm_tid_queued(struct iwl_mvm* mvm, struct iwl_mvm_tid_data* tid_data);
 
 static inline struct iwl_mvm_sta* iwl_mvm_sta_from_mac80211(struct ieee80211_sta* sta) {
-    return (void*)sta->drv_priv;
+    return (struct iwl_mvm_sta*)sta->drv_priv;
 }
 
 /**