net: rkwifi: auto recognize nvram file
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rkwifi / bcmdhd / dhd_config.h
old mode 100644 (file)
new mode 100755 (executable)
index ac05262..dfd205d
@@ -7,15 +7,66 @@
 #include <dhd.h>\r
 #include <wlioctl.h>\r
 #include <proto/802.11.h>\r
-#ifdef POWER_OFF_IN_SUSPEND\r
-#include <wl_android.h>\r
-#include <bcmsdbus.h>\r
-#include <linux/mmc/sdio_func.h>\r
-#endif\r
 \r
 #define FW_PATH_AUTO_SELECT 1\r
+//#define CONFIG_PATH_AUTO_SELECT\r
 extern char firmware_path[MOD_PARAM_PATHLEN];\r
 extern int disable_proptx;\r
+extern uint dhd_rxbound;
+extern uint dhd_txbound;
+#define TXGLOM_RECV_OFFSET 8
+#ifdef BCMSDIO\r
+extern uint dhd_doflow;\r
+extern uint dhd_slpauto;\r
+\r
+#define BCM43362A0_CHIP_REV     0\r
+#define BCM43362A2_CHIP_REV     1\r
+#define BCM43430A0_CHIP_REV     0\r
+#define BCM43430A1_CHIP_REV     1\r
+#define BCM4330B2_CHIP_REV      4\r
+#define BCM4334B1_CHIP_REV      3\r
+#define BCM43341B0_CHIP_REV     2\r
+#define BCM43241B4_CHIP_REV     5\r
+#define BCM4335A0_CHIP_REV      2\r
+#define BCM4339A0_CHIP_REV      1\r
+#define BCM43455C0_CHIP_REV     6\r
+#define BCM4354A1_CHIP_REV      1\r
+#define BCM4359B1_CHIP_REV      5\r
+#endif\r
+#define BCM4356A2_CHIP_REV      2\r
+\r
+/* mac range */\r
+typedef struct wl_mac_range {\r
+       uint32 oui;\r
+       uint32 nic_start;\r
+       uint32 nic_end;\r
+} wl_mac_range_t;\r
+\r
+/* mac list */\r
+typedef struct wl_mac_list {\r
+       int count;\r
+       wl_mac_range_t *mac;\r
+       char name[MOD_PARAM_PATHLEN];           /* path */\r
+} wl_mac_list_t;\r
+\r
+/* mac list head */\r
+typedef struct wl_mac_list_ctrl {\r
+       int count;\r
+       struct wl_mac_list *m_mac_list_head;\r
+} wl_mac_list_ctrl_t;\r
+\r
+/* chip_nv_path */\r
+typedef struct wl_chip_nv_path {\r
+       uint chip;\r
+       uint chiprev;\r
+       char name[MOD_PARAM_PATHLEN];           /* path */\r
+} wl_chip_nv_path_t;\r
+\r
+/* chip_nv_path list head */\r
+typedef struct wl_chip_nv_path_list_ctrl {\r
+       int count;\r
+       struct wl_chip_nv_path *m_chip_nv_path_head;\r
+} wl_chip_nv_path_list_ctrl_t;\r
 \r
 /* channel list */\r
 typedef struct wl_channel_list {\r
@@ -31,10 +82,42 @@ typedef struct wmes_param {
        int cwmax[AC_COUNT];\r
 } wme_param_t;\r
 \r
+#ifdef PKT_FILTER_SUPPORT\r
+#define DHD_CONF_FILTER_MAX    8\r
+/* filter list */\r
+#define PKT_FILTER_LEN 300\r
+typedef struct conf_pkt_filter_add {\r
+       /* in - # of channels, out - # of entries */\r
+       uint32 count;\r
+       /* variable length filter list */\r
+       char filter[DHD_CONF_FILTER_MAX][PKT_FILTER_LEN];\r
+} conf_pkt_filter_add_t;\r
+\r
+/* pkt_filter_del list */\r
+typedef struct conf_pkt_filter_del {\r
+       /* in - # of channels, out - # of entries */\r
+       uint32 count;\r
+       /* variable length filter list */\r
+       uint32 id[DHD_CONF_FILTER_MAX];\r
+} conf_pkt_filter_del_t;\r
+#endif\r
+\r
+#define CONFIG_COUNTRY_LIST_SIZE 100\r
+/* country list */\r
+typedef struct conf_country_list {\r
+       uint32 count;\r
+       wl_country_t cspec[CONFIG_COUNTRY_LIST_SIZE];\r
+} conf_country_list_t;\r
+\r
 typedef struct dhd_conf {\r
-       char fw_path[MOD_PARAM_PATHLEN];                /* Firmware path */\r
-       char nv_path[MOD_PARAM_PATHLEN];                /* NVRAM path */\r
-       uint band;                      /* Band, b:2.4G only, otherwise for auto */\r
+       uint    chip;                   /* chip number */
+       uint    chiprev;                /* chip revision */\r
+       wl_mac_list_ctrl_t fw_by_mac;   /* Firmware auto selection by MAC */\r
+       wl_mac_list_ctrl_t nv_by_mac;   /* NVRAM auto selection by MAC */\r
+       wl_chip_nv_path_list_ctrl_t nv_by_chip; /* NVRAM auto selection by chip */\r
+       conf_country_list_t country_list; /* Country list */\r
+       int band;                       /* Band, b:2.4G only, otherwise for auto */\r
+       int mimo_bw_cap;                        /* Bandwidth, 0:HT20ALL, 1: HT40ALL, 2:HT20IN2G_HT40PIN5G */\r
        wl_country_t cspec;             /* Country */\r
        wl_channel_list_t channels;     /* Support channels */\r
        uint roam_off;          /* Roaming, 0:enable, 1:disable */\r
@@ -43,50 +126,91 @@ typedef struct dhd_conf {
        int roam_scan_period[2];        /* Roaming scan period */\r
        int roam_delta[2];                      /* Roaming candidate qualification delta */\r
        int fullroamperiod;                     /* Full Roaming period */\r
-       uint filter_out_all_packets;    /* Filter out all packets in early suspend */\r
        uint keep_alive_period;         /* The perioid in ms to send keep alive packet */\r
-       uint force_wme_ac;\r
+       int force_wme_ac;\r
        wme_param_t wme;        /* WME parameters */\r
        int stbc;                       /* STBC for Tx/Rx */\r
        int phy_oclscdenable;           /* phy_oclscdenable */\r
+#ifdef PKT_FILTER_SUPPORT\r
+       conf_pkt_filter_add_t pkt_filter_add;           /* Packet filter add */\r
+       conf_pkt_filter_del_t pkt_filter_del;           /* Packet filter add */\r
+       bool pkt_filter_magic;\r
+#endif\r
+       int srl;        /* short retry limit */\r
+       int lrl;        /* long retry limit */\r
+       uint bcn_timeout;       /* beacon timeout */\r
+       bool kso_enable;\r
+       int spect;\r
+       int txbf;\r
+       int lpc;\r
+       int disable_proptx;\r
+       int bus_txglom; /* bus:txglom */\r
+       int use_rxchain;\r
+       bool bus_rxglom;        /* bus:rxglom */\r
+       uint txglomsize;\r
+       int ampdu_ba_wsize;\r
+       int dpc_cpucore;\r
+       int frameburst;\r
+       bool deepsleep;\r
+       int pm;\r
+       uint8 tcpack_sup_mode;\r
+       int dhd_poll;\r
+       uint deferred_tx_len;\r
+       int pktprio8021x;\r
+       bool txctl_tmo_fix;\r
+       bool swtxglom; /* SW TXGLOM */\r
+       bool txglom_ext; /* Only for 43362/4330/43340/43341/43241 */
+       /*txglom_bucket_size:
+        * 43362/4330: 1680
+        * 43340/43341/43241: 1684
+        */
+       int txglom_bucket_size;
+       int tx_max_offset;\r
+       bool tx_in_rx; // Skip tx before rx, in order to get more glomed in tx\r
+       int rsdb_mode;\r
+       bool txglom_mode;\r
 } dhd_conf_t;\r
 \r
-void dhd_conf_set_fw_name_by_chip(dhd_pub_t *dhd, char *dst, char *src);\r
+#ifdef BCMSDIO\r
+int dhd_conf_get_mac(dhd_pub_t *dhd, bcmsdh_info_t *sdh, uint8 *mac);\r
+void dhd_conf_set_fw_name_by_mac(dhd_pub_t *dhd, bcmsdh_info_t *sdh, char *fw_path);\r
+void dhd_conf_set_nv_name_by_mac(dhd_pub_t *dhd, bcmsdh_info_t *sdh, char *nv_path);\r
+#if defined(HW_OOB) || defined(FORCE_WOWLAN)\r
 void dhd_conf_set_hw_oob_intr(bcmsdh_info_t *sdh, uint chip);\r
-void dhd_conf_set_fw_path(dhd_pub_t *dhd, char *fw_path);\r
-void dhd_conf_set_nv_path(dhd_pub_t *dhd, char *nv_path);\r
-int dhd_conf_set_band(dhd_pub_t *dhd);\r
+#endif\r
+#endif\r
+void dhd_conf_set_fw_name_by_chip(dhd_pub_t *dhd, char *fw_path, char *nv_path);
+void dhd_conf_set_nv_name_by_chip(dhd_pub_t *dhd, char *nv_path);\r
+void dhd_conf_set_conf_path_by_nv_path(dhd_pub_t *dhd, char *conf_path, char *nv_path);\r
+#ifdef CONFIG_PATH_AUTO_SELECT\r
+void dhd_conf_set_conf_name_by_chip(dhd_pub_t *dhd, char *conf_path);\r
+#endif\r
+int dhd_conf_set_fw_int_cmd(dhd_pub_t *dhd, char *name, uint cmd, int val, int def, bool down);\r
+int dhd_conf_set_fw_string_cmd(dhd_pub_t *dhd, char *cmd, int val, int def, bool down);\r
 uint dhd_conf_get_band(dhd_pub_t *dhd);\r
 int dhd_conf_set_country(dhd_pub_t *dhd);\r
-int dhd_conf_get_country(dhd_pub_t *dhd);\r
+int dhd_conf_get_country(dhd_pub_t *dhd, wl_country_t *cspec);\r
+int dhd_conf_get_country_from_config(dhd_pub_t *dhd, wl_country_t *cspec);\r
+int dhd_conf_fix_country(dhd_pub_t *dhd);\r
 bool dhd_conf_match_channel(dhd_pub_t *dhd, uint32 channel);\r
 int dhd_conf_set_roam(dhd_pub_t *dhd);\r
-void dhd_conf_set_bw(dhd_pub_t *dhd);\r
-void dhd_conf_force_wme(dhd_pub_t *dhd);\r
 void dhd_conf_get_wme(dhd_pub_t *dhd, edcf_acparam_t *acp);\r
 void dhd_conf_set_wme(dhd_pub_t *dhd);\r
-void dhd_conf_set_stbc(dhd_pub_t *dhd);\r
-void dhd_conf_set_phyoclscdenable(dhd_pub_t *dhd);\r
-int dhd_conf_download_config(dhd_pub_t *dhd);\r
+void dhd_conf_add_pkt_filter(dhd_pub_t *dhd);\r
+bool dhd_conf_del_pkt_filter(dhd_pub_t *dhd, uint32 id);\r
+void dhd_conf_discard_pkt_filter(dhd_pub_t *dhd);\r
+void dhd_conf_set_disable_proptx(dhd_pub_t *dhd);\r
+int dhd_conf_read_config(dhd_pub_t *dhd, char *conf_path);\r
+int dhd_conf_set_chiprev(dhd_pub_t *dhd, uint chip, uint chiprev);\r
+uint dhd_conf_get_chip(void *context);\r
+uint dhd_conf_get_chiprev(void *context);\r
+void dhd_conf_set_txglom_params(dhd_pub_t *dhd, bool enable);\r
+int dhd_conf_get_pm(dhd_pub_t *dhd);\r
+int dhd_conf_get_tcpack_sup_mode(dhd_pub_t *dhd);\r
 int dhd_conf_preinit(dhd_pub_t *dhd);\r
+int dhd_conf_reset(dhd_pub_t *dhd);\r
 int dhd_conf_attach(dhd_pub_t *dhd);\r
 void dhd_conf_detach(dhd_pub_t *dhd);\r
-\r
-extern void *bcmsdh_get_drvdata(void);\r
-\r
-#ifdef POWER_OFF_IN_SUSPEND\r
-extern struct net_device *g_netdev;\r
-#if defined(CONFIG_HAS_EARLYSUSPEND)\r
-extern int g_wifi_on;\r
-#ifdef WL_CFG80211\r
-void wl_cfg80211_stop(void);\r
-void wl_cfg80211_send_disconnect(void);\r
-void wl_cfg80211_user_sync(bool lock);\r
-#endif\r
-#endif\r
-void dhd_conf_wifi_suspend(struct sdio_func *func);\r
-void dhd_conf_register_wifi_suspend(struct sdio_func *func);\r
-void dhd_conf_unregister_wifi_suspend(struct sdio_func *func);\r
-#endif\r
+void *dhd_get_pub(struct net_device *dev);\r
 \r
 #endif /* _dhd_config_ */\r