/* * Copyright (c) 2004-2011 Atheros Communications Inc. * Copyright (c) 2011-2012 Qualcomm Atheros, Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
int ath6kl_core_init(struct ath6kl *ar, enum ath6kl_htc_type htc_type)
{ struct ath6kl_bmi_target_info targ_info; struct wireless_dev *wdev; int ret = 0, i;
switch (htc_type) { case ATH6KL_HTC_TYPE_MBOX:
ath6kl_htc_mbox_attach(ar); break; case ATH6KL_HTC_TYPE_PIPE:
ath6kl_htc_pipe_attach(ar); break; default:
WARN_ON(1); return -ENOMEM;
}
ar->ath6kl_wq = create_singlethread_workqueue("ath6kl"); if (!ar->ath6kl_wq) return -ENOMEM;
ret = ath6kl_bmi_init(ar); if (ret) goto err_wq;
/* * Turn on power to get hardware (target) version and leave power * on deliberately as we will boot the hardware anyway within few * seconds.
*/
ret = ath6kl_hif_power_on(ar); if (ret) goto err_bmi_cleanup;
ret = ath6kl_bmi_get_target_info(ar, &targ_info); if (ret) goto err_power_off;
ret = ath6kl_init_hw_params(ar); if (ret) goto err_power_off;
ar->htc_target = ath6kl_htc_create(ar);
if (!ar->htc_target) {
ret = -ENOMEM; goto err_power_off;
}
ar->testmode = testmode;
ret = ath6kl_init_fetch_firmwares(ar); if (ret) goto err_htc_cleanup;
/* FIXME: we should free all firmwares in the error cases below */
/* * Backwards compatibility support for older ar6004 firmware images * which do not set these feature flags.
*/ if (ar->target_type == TARGET_TYPE_AR6004 &&
ar->fw_api <= 4) {
__set_bit(ATH6KL_FW_CAPABILITY_64BIT_RATES,
ar->fw_capabilities);
__set_bit(ATH6KL_FW_CAPABILITY_AP_INACTIVITY_MINS,
ar->fw_capabilities);
if (ar->hw.id == AR6004_HW_1_3_VERSION)
__set_bit(ATH6KL_FW_CAPABILITY_MAP_LP_ENDPOINT,
ar->fw_capabilities);
}
/* Indicate that WMI is enabled (although not ready yet) */
set_bit(WMI_ENABLED, &ar->flag);
ar->wmi = ath6kl_wmi_init(ar); if (!ar->wmi) {
ath6kl_err("failed to initialize wmi\n");
ret = -EIO; goto err_htc_cleanup;
}
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.