wl1271: Add config structure for RX path parameters
[linux-2.6.git] / drivers / net / wireless / wl12xx / wl1271_init.c
index eb6b91ab968a7966d55d7f079bb81b14c731dfd5..57382631c1adbf505fff80d3c40179a1e6e518c8 100644 (file)
@@ -94,7 +94,7 @@ static int wl1271_init_rx_config(struct wl1271 *wl, u32 config, u32 filter)
 {
        int ret;
 
-       ret = wl1271_acx_rx_msdu_life_time(wl, RX_MSDU_LIFETIME_DEF);
+       ret = wl1271_acx_rx_msdu_life_time(wl);
        if (ret < 0)
                return ret;
 
@@ -117,7 +117,7 @@ static int wl1271_init_phy_config(struct wl1271 *wl)
        if (ret < 0)
                return ret;
 
-       ret = wl1271_acx_group_address_tbl(wl);
+       ret = wl1271_acx_group_address_tbl(wl, true, NULL, 0);
        if (ret < 0)
                return ret;
 
@@ -125,7 +125,7 @@ static int wl1271_init_phy_config(struct wl1271 *wl)
        if (ret < 0)
                return ret;
 
-       ret = wl1271_acx_rts_threshold(wl, RTS_THRESHOLD_DEF);
+       ret = wl1271_acx_rts_threshold(wl, wl->conf.rx.rts_threshold);
        if (ret < 0)
                return ret;
 
@@ -136,7 +136,8 @@ static int wl1271_init_beacon_filter(struct wl1271 *wl)
 {
        int ret;
 
-       ret = wl1271_acx_beacon_filter_opt(wl);
+       /* disable beacon filtering at this stage */
+       ret = wl1271_acx_beacon_filter_opt(wl, false);
        if (ret < 0)
                return ret;
 
@@ -195,13 +196,20 @@ static int wl1271_init_general_parms(struct wl1271 *wl)
 
        gen_parms->id = TEST_CMD_INI_FILE_GENERAL_PARAM;
 
-       gen_parms->ref_clk = REF_CLK_38_4_E;
+       /*
+        * FIXME: The firmware crashes on boot with REF_CLK_38_4_E as clock.
+        *        according to TI engineers, ref clk 5 is an unofficial
+        *        38.4 XTAL clock config, which seems to boot the device.
+        *        Restore correct value once the real problem source is
+        *        identified.
+        */
+       gen_parms->ref_clk = 5; /* REF_CLK_38_4_E; */
        /* FIXME: magic numbers */
        gen_parms->settling_time = 5;
        gen_parms->clk_valid_on_wakeup = 0;
        gen_parms->dc2dcmode = 0;
        gen_parms->single_dual_band = 0;
-       gen_parms->tx_bip_fem_autodetect = 1;
+       gen_parms->tx_bip_fem_autodetect = 0;
        gen_parms->tx_bip_fem_manufacturer = 1;
        gen_parms->settings = 1;
 
@@ -323,6 +331,11 @@ int wl1271_hw_init(struct wl1271 *wl)
        if (ret < 0)
                goto out_free_memmap;
 
+       /* Initialize connection monitoring thresholds */
+       ret = wl1271_acx_conn_monit_params(wl);
+       if (ret < 0)
+               goto out_free_memmap;
+
        /* Beacon filtering */
        ret = wl1271_init_beacon_filter(wl);
        if (ret < 0)
@@ -388,10 +401,16 @@ int wl1271_hw_init(struct wl1271 *wl)
        if (ret < 0)
                goto out_free_memmap;
 
+       /* Configure smart reflex */
+       ret = wl1271_acx_smart_reflex(wl);
+       if (ret < 0)
+               goto out_free_memmap;
+
        return 0;
 
  out_free_memmap:
        kfree(wl->target_mem_map);
+       wl->target_mem_map = NULL;
 
        return ret;
 }