int wl1251_hw_init_hwenc_config(struct wl1251 *wl)
{ int ret;
ret = wl1251_acx_feature_cfg(wl, 0); if (ret < 0) {
wl1251_warning("couldn't set feature config"); return ret;
}
ret = wl1251_acx_default_key(wl, wl->default_key); if (ret < 0) {
wl1251_warning("couldn't set default key"); return ret;
}
return 0;
}
int wl1251_hw_init_templates_config(struct wl1251 *wl)
{ int ret;
u8 partial_vbm[PARTIAL_VBM_MAX];
/* send empty templates for fw memory reservation */
ret = wl1251_cmd_template_set(wl, CMD_PROBE_REQ, NULL, sizeof(struct wl12xx_probe_req_template)); if (ret < 0) return ret;
ret = wl1251_cmd_template_set(wl, CMD_NULL_DATA, NULL, sizeof(struct wl12xx_null_data_template)); if (ret < 0) return ret;
ret = wl1251_cmd_template_set(wl, CMD_PS_POLL, NULL, sizeof(struct wl12xx_ps_poll_template)); if (ret < 0) return ret;
ret = wl1251_cmd_template_set(wl, CMD_QOS_NULL_DATA, NULL, sizeof
(struct wl12xx_qos_null_data_template)); if (ret < 0) return ret;
ret = wl1251_cmd_template_set(wl, CMD_PROBE_RESP, NULL, sizeof
(struct wl12xx_probe_resp_template)); if (ret < 0) return ret;
ret = wl1251_cmd_template_set(wl, CMD_BEACON, NULL, sizeof
(struct wl12xx_beacon_template)); if (ret < 0) return ret;
/* tim templates, first reserve space then allocate an empty one */
memset(partial_vbm, 0, PARTIAL_VBM_MAX);
ret = wl1251_cmd_vbm(wl, TIM_ELE_ID, partial_vbm, PARTIAL_VBM_MAX, 0); if (ret < 0) return ret;
ret = wl1251_cmd_vbm(wl, TIM_ELE_ID, partial_vbm, 1, 0); if (ret < 0) return ret;
return 0;
}
int wl1251_hw_init_rx_config(struct wl1251 *wl, u32 config, u32 filter)
{ int ret;
ret = wl1251_acx_rx_msdu_life_time(wl, RX_MSDU_LIFETIME_DEF); if (ret < 0) return ret;
ret = wl1251_acx_rx_config(wl, config, filter); if (ret < 0) return ret;
return 0;
}
int wl1251_hw_init_phy_config(struct wl1251 *wl)
{ int ret;
ret = wl1251_acx_pd_threshold(wl); if (ret < 0) return ret;
ret = wl1251_acx_slot(wl, DEFAULT_SLOT_TIME); if (ret < 0) return ret;
ret = wl1251_acx_group_address_tbl(wl, true, NULL, 0); if (ret < 0) return ret;
ret = wl1251_acx_service_period_timeout(wl); if (ret < 0) return ret;
ret = wl1251_acx_rts_threshold(wl, RTS_THRESHOLD_DEF); if (ret < 0) return ret;
return 0;
}
int wl1251_hw_init_beacon_filter(struct wl1251 *wl)
{ int ret;
/* disable beacon filtering at this stage */
ret = wl1251_acx_beacon_filter_opt(wl, false); if (ret < 0) return ret;
ret = wl1251_acx_beacon_filter_table(wl); if (ret < 0) return ret;
return 0;
}
int wl1251_hw_init_pta(struct wl1251 *wl)
{ int ret;
ret = wl1251_acx_sg_enable(wl); if (ret < 0) return ret;
ret = wl1251_acx_sg_cfg(wl); if (ret < 0) return ret;
return 0;
}
int wl1251_hw_init_energy_detection(struct wl1251 *wl)
{ int ret;
ret = wl1251_acx_cca_threshold(wl); if (ret < 0) return ret;
return 0;
}
int wl1251_hw_init_beacon_broadcast(struct wl1251 *wl)
{ int ret;
ret = wl1251_acx_bcn_dtim_options(wl); if (ret < 0) return ret;
return 0;
}
int wl1251_hw_init_power_auth(struct wl1251 *wl)
{ return wl1251_acx_sleep_auth(wl, WL1251_PSM_CAM);
}
int wl1251_hw_init_mem_config(struct wl1251 *wl)
{ int ret;
ret = wl1251_acx_mem_cfg(wl); if (ret < 0) return ret;
/* we now ask for the firmware built memory map */
ret = wl1251_acx_mem_map(wl, wl->target_mem_map, sizeof(struct wl1251_acx_mem_map)); if (ret < 0) {
wl1251_error("couldn't retrieve firmware memory map");
kfree(wl->target_mem_map);
wl->target_mem_map = NULL; return ret;
}
staticint wl1251_hw_init_data_path_config(struct wl1251 *wl)
{ int ret;
/* asking for the data path parameters */
wl->data_path = kzalloc(sizeof(struct acx_data_path_params_resp),
GFP_KERNEL); if (!wl->data_path) return -ENOMEM;
ret = wl1251_acx_data_path_params(wl, wl->data_path); if (ret < 0) {
kfree(wl->data_path);
wl->data_path = NULL; return ret;
}
return 0;
}
int wl1251_hw_init(struct wl1251 *wl)
{ struct wl1251_acx_mem_map *wl_mem_map; int ret;
ret = wl1251_hw_init_hwenc_config(wl); if (ret < 0) return ret;
/* Template settings */
ret = wl1251_hw_init_templates_config(wl); if (ret < 0) return ret;
/* Default memory configuration */
ret = wl1251_hw_init_mem_config(wl); if (ret < 0) return ret;
/* Default data path configuration */
ret = wl1251_hw_init_data_path_config(wl); if (ret < 0) goto out_free_memmap;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.