update dhd to 100.10.545.11 [1/1]
[GitHub/LineageOS/G12/android_hardware_amlogic_kernel-modules_dhd-driver.git] / bcmdhd.100.10.315.x / wl_android.h
index 3e989d2d0b680734261e48c68e88bda7b2c11002..f05470dffd1f8dddf223d38230dc5003efe635d2 100644 (file)
@@ -82,6 +82,29 @@ typedef struct _compat_android_wifi_priv_cmd {
                } \
        } while (0)
 
+#define WL_MSG_PRINT_RATE_LIMIT_PERIOD 1000000000u /* 1s in units of ns */
+#define WL_MSG_RLMT(name, cmp, size, arg1, args...) \
+do {   \
+       if (android_msg_level & ANDROID_MSG_LEVEL) {    \
+               static uint64 __err_ts = 0; \
+               static uint32 __err_cnt = 0; \
+               uint64 __cur_ts = 0; \
+               static uint8 static_tmp[size]; \
+               __cur_ts = local_clock(); \
+               if (__err_ts == 0 || (__cur_ts > __err_ts && \
+               (__cur_ts - __err_ts > WL_MSG_PRINT_RATE_LIMIT_PERIOD)) || \
+               memcmp(&static_tmp, cmp, size)) { \
+                       __err_ts = __cur_ts; \
+                       memcpy(static_tmp, cmp, size); \
+                       printk(KERN_ERR "[dhd-%s] %s : [%u times] " arg1, \
+                               name, __func__, __err_cnt, ## args); \
+                       __err_cnt = 0; \
+               } else { \
+                       ++__err_cnt; \
+               } \
+       }       \
+} while (0)
+
 /**
  * wl_android_init will be called from module init function (dhd_module_init now), similarly
  * wl_android_exit will be called from module exit function (dhd_module_cleanup now)
@@ -97,17 +120,22 @@ int wl_handle_private_cmd(struct net_device *net, char *command, u32 cmd_len);
 int wl_ext_iapsta_attach_netdev(struct net_device *net, int ifidx, uint8 bssidx);
 int wl_ext_iapsta_attach_name(struct net_device *net, int ifidx);
 int wl_ext_iapsta_dettach_netdev(struct net_device *net, int ifidx);
-u32 wl_ext_iapsta_update_channel(dhd_pub_t *dhd, struct net_device *dev, u32 channel);
+int wl_ext_iapsta_update_net_device(struct net_device *net, int ifidx);
+void wl_ext_add_remove_pm_enable_work(struct net_device *dev, bool add);
+#ifdef PROPTX_MAXCOUNT
+void wl_ext_update_wlfc_maxcount(struct dhd_pub *dhd);
+int wl_ext_get_wlfc_maxcount(struct dhd_pub *dhd, int ifidx);
+#endif /* PROPTX_MAXCOUNT */
 int wl_ext_iapsta_alive_preinit(struct net_device *dev);
 int wl_ext_iapsta_alive_postinit(struct net_device *dev);
 int wl_ext_iapsta_attach(dhd_pub_t *pub);
 void wl_ext_iapsta_dettach(dhd_pub_t *pub);
-bool wl_ext_check_mesh_creating(struct net_device *net);
 #ifdef WL_CFG80211
+u32 wl_ext_iapsta_update_channel(dhd_pub_t *dhd, struct net_device *dev, u32 channel);
 void wl_ext_iapsta_update_iftype(struct net_device *net, int ifidx, int wl_iftype);
-#endif
-#ifdef WL_STATIC_IF
+bool wl_ext_iapsta_iftype_enabled(struct net_device *net, int wl_iftype);
 void wl_ext_iapsta_ifadding(struct net_device *net, int ifidx);
+bool wl_ext_iapsta_mesh_creating(struct net_device *net);
 #endif
 extern int op_mode;
 #endif
@@ -117,6 +145,8 @@ typedef struct bcol_gtk_para {
        char ptk[64];
        char replay[8];
 } bcol_gtk_para_t;
+#define ACS_FW_BIT             (1<<0)
+#define ACS_DRV_BIT            (1<<1)
 #if defined(WL_EXT_IAPSTA) || defined(USE_IW)
 typedef enum WL_EVENT_PRIO {
        PRIO_EVENT_IAPSTA,
@@ -133,9 +163,18 @@ void wl_ext_event_deregister(struct net_device *dev, dhd_pub_t *dhd,
        uint32 event, void *cb_func);
 void wl_ext_event_send(void *params, const wl_event_msg_t * e, void *data);
 #endif
+int wl_ext_autochannel(struct net_device *dev, uint acs, uint32 band);
 int wl_android_ext_priv_cmd(struct net_device *net, char *command, int total_len,
        int *bytes_written);
 void wl_ext_get_sec(struct net_device *dev, int ifmode, char *sec, int total_len);
+bool wl_ext_check_scan(struct net_device *dev, dhd_pub_t *dhdp);
+#if defined(WL_CFG80211) || defined(WL_ESCAN)
+void wl_ext_user_sync(struct dhd_pub *dhd, int ifidx, bool lock);
+bool wl_ext_event_complete(struct dhd_pub *dhd, int ifidx);
+#endif
+#if defined(WL_CFG80211)
+void wl_ext_bss_iovar_war(struct net_device *dev, s32 *val);
+#endif
 enum wl_ext_status {
        WL_EXT_STATUS_DISCONNECTING = 0,
        WL_EXT_STATUS_DISCONNECTED,
@@ -323,7 +362,7 @@ int wl_update_rssi_offset(struct net_device *net, int rssi);
 typedef struct wl_bss_cache {
        struct wl_bss_cache *next;
        int dirty;
-       struct timeval tv;
+       struct osl_timespec tv;
        wl_scan_results_t results;
 } wl_bss_cache_t;