Commit 241b128b authored by Kalle Valo's avatar Kalle Valo

ath6kl: add back beginnings of USB support

John Linville had to revert the part of USB support which was already
in ath6kl due to build problems in commit cb00ec38 ("ath6kl: revert
USB support"). Now that I fixed the build problems properly by adding
ath6kl_core.ko kernel module it's possible to add back the
(incomplete) USB support. This patch is a revert of John's patch and
adds back the USB code which as already in ath6kl, only difference
being minor changes in Makefile and adapting usb.c to new core
function names.

Note that USB support in ath6kl is not complete yet. This code only
makes it possible to boot firmware but as HTC layer does not yet
support USB it's not possible to send any WMI commands nor data
packets to the firmware. That will be added soon.
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent d6a434d6
config ATH6KL config ATH6KL
tristate "Atheros ath6kl support" tristate "Atheros mobile chipsets support"
config ATH6KL_SDIO
tristate "Atheros ath6kl SDIO support"
depends on ATH6KL
depends on MMC depends on MMC
depends on CFG80211 depends on CFG80211
---help--- ---help---
This module adds support for wireless adapters based on This module adds support for wireless adapters based on
Atheros AR6003 chipset running over SDIO. If you choose to Atheros AR6003 and AR6004 chipsets running over SDIO. If you
build it as a module, it will be called ath6kl. Pls note choose to build it as a module, it will be called ath6kl_sdio.
that AR6002 and AR6001 are not supported by this driver. Please note that AR6002 and AR6001 are not supported by this
driver.
config ATH6KL_USB
tristate "Atheros ath6kl USB support"
depends on ATH6KL
depends on USB
depends on CFG80211
depends on EXPERIMENTAL
---help---
This module adds support for wireless adapters based on
Atheros AR6004 chipset running over USB. This is still under
implementation and it isn't functional. If you choose to
build it as a module, it will be called ath6kl_usb.
config ATH6KL_DEBUG config ATH6KL_DEBUG
bool "Atheros ath6kl debugging" bool "Atheros ath6kl debugging"
......
...@@ -36,3 +36,6 @@ ath6kl_core-$(CONFIG_NL80211_TESTMODE) += testmode.o ...@@ -36,3 +36,6 @@ ath6kl_core-$(CONFIG_NL80211_TESTMODE) += testmode.o
obj-$(CONFIG_ATH6KL_SDIO) += ath6kl_sdio.o obj-$(CONFIG_ATH6KL_SDIO) += ath6kl_sdio.o
ath6kl_sdio-y += sdio.o ath6kl_sdio-y += sdio.o
obj-$(CONFIG_ATH6KL_USB) += ath6kl_usb.o
ath6kl_usb-y += usb.o
...@@ -57,8 +57,14 @@ int ath6kl_bmi_get_target_info(struct ath6kl *ar, ...@@ -57,8 +57,14 @@ int ath6kl_bmi_get_target_info(struct ath6kl *ar,
return ret; return ret;
} }
ret = ath6kl_hif_bmi_read(ar, (u8 *)&targ_info->version, if (ar->hif_type == ATH6KL_HIF_TYPE_USB) {
sizeof(targ_info->version)); ret = ath6kl_hif_bmi_read(ar, (u8 *)targ_info,
sizeof(*targ_info));
} else {
ret = ath6kl_hif_bmi_read(ar, (u8 *)&targ_info->version,
sizeof(targ_info->version));
}
if (ret) { if (ret) {
ath6kl_err("Unable to recv target info: %d\n", ret); ath6kl_err("Unable to recv target info: %d\n", ret);
return ret; return ret;
......
...@@ -41,6 +41,7 @@ enum ATH6K_DEBUG_MASK { ...@@ -41,6 +41,7 @@ enum ATH6K_DEBUG_MASK {
ATH6KL_DBG_BOOT = BIT(18), /* driver init and fw boot */ ATH6KL_DBG_BOOT = BIT(18), /* driver init and fw boot */
ATH6KL_DBG_WMI_DUMP = BIT(19), ATH6KL_DBG_WMI_DUMP = BIT(19),
ATH6KL_DBG_SUSPEND = BIT(20), ATH6KL_DBG_SUSPEND = BIT(20),
ATH6KL_DBG_USB = BIT(21),
ATH6KL_DBG_ANY = 0xffffffff /* enable all logs */ ATH6KL_DBG_ANY = 0xffffffff /* enable all logs */
}; };
......
...@@ -693,6 +693,11 @@ int ath6kl_hif_setup(struct ath6kl_device *dev) ...@@ -693,6 +693,11 @@ int ath6kl_hif_setup(struct ath6kl_device *dev)
ath6kl_dbg(ATH6KL_DBG_HIF, "hif block size %d mbox addr 0x%x\n", ath6kl_dbg(ATH6KL_DBG_HIF, "hif block size %d mbox addr 0x%x\n",
dev->htc_cnxt->block_sz, dev->ar->mbox_info.htc_addr); dev->htc_cnxt->block_sz, dev->ar->mbox_info.htc_addr);
/* usb doesn't support enabling interrupts */
/* FIXME: remove check once USB support is implemented */
if (dev->ar->hif_type == ATH6KL_HIF_TYPE_USB)
return 0;
status = ath6kl_hif_disable_intrs(dev); status = ath6kl_hif_disable_intrs(dev);
fail_setup: fail_setup:
......
...@@ -2544,6 +2544,12 @@ int ath6kl_htc_wait_target(struct htc_target *target) ...@@ -2544,6 +2544,12 @@ int ath6kl_htc_wait_target(struct htc_target *target)
struct htc_service_connect_resp resp; struct htc_service_connect_resp resp;
int status; int status;
/* FIXME: remove once USB support is implemented */
if (target->dev->ar->hif_type == ATH6KL_HIF_TYPE_USB) {
ath6kl_err("HTC doesn't support USB yet. Patience!\n");
return -EOPNOTSUPP;
}
/* we should be getting 1 control message that the target is ready */ /* we should be getting 1 control message that the target is ready */
packet = htc_wait_for_ctrl_msg(target); packet = htc_wait_for_ctrl_msg(target);
...@@ -2773,7 +2779,9 @@ void ath6kl_htc_cleanup(struct htc_target *target) ...@@ -2773,7 +2779,9 @@ void ath6kl_htc_cleanup(struct htc_target *target)
{ {
struct htc_packet *packet, *tmp_packet; struct htc_packet *packet, *tmp_packet;
ath6kl_hif_cleanup_scatter(target->dev->ar); /* FIXME: remove check once USB support is implemented */
if (target->dev->ar->hif_type != ATH6KL_HIF_TYPE_USB)
ath6kl_hif_cleanup_scatter(target->dev->ar);
list_for_each_entry_safe(packet, tmp_packet, list_for_each_entry_safe(packet, tmp_packet,
&target->free_ctrl_txbuf, list) { &target->free_ctrl_txbuf, list) {
......
...@@ -1330,7 +1330,7 @@ static const struct sdio_device_id ath6kl_sdio_devices[] = { ...@@ -1330,7 +1330,7 @@ static const struct sdio_device_id ath6kl_sdio_devices[] = {
MODULE_DEVICE_TABLE(sdio, ath6kl_sdio_devices); MODULE_DEVICE_TABLE(sdio, ath6kl_sdio_devices);
static struct sdio_driver ath6kl_sdio_driver = { static struct sdio_driver ath6kl_sdio_driver = {
.name = "ath6kl", .name = "ath6kl_sdio",
.id_table = ath6kl_sdio_devices, .id_table = ath6kl_sdio_devices,
.probe = ath6kl_sdio_probe, .probe = ath6kl_sdio_probe,
.remove = ath6kl_sdio_remove, .remove = ath6kl_sdio_remove,
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment