diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-01-05 10:12:45 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-01-05 10:13:24 -0500 |
commit | 1032c736e81cdf490ae62f86da7efe67c3c3e61d (patch) | |
tree | a0c3919849f97dbbc5ea7c6a9ac1d7a639e44a73 /drivers/net/wireless/ath | |
parent | 117ff42fd43e92d24c6aa6f3e4f0f1e1edada140 (diff) | |
parent | cb00ec382b57d35b955c085198cd54a0c1fcdc94 (diff) | |
download | talos-obmc-linux-1032c736e81cdf490ae62f86da7efe67c3c3e61d.tar.gz talos-obmc-linux-1032c736e81cdf490ae62f86da7efe67c3c3e61d.zip |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts:
drivers/net/wireless/b43legacy/dma.c
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath5k/trace.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/Kconfig | 25 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/Makefile | 37 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/bmi.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/debug.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/hif.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/htc.c | 10 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/sdio.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/usb.c | 431 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_mac.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_mac.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9003_rtt.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/beacon.c | 7 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/mci.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ath/carl9170/fw.c | 97 |
19 files changed, 99 insertions, 549 deletions
diff --git a/drivers/net/wireless/ath/ath5k/trace.h b/drivers/net/wireless/ath/ath5k/trace.h index 39f002ed4a88..00f015819344 100644 --- a/drivers/net/wireless/ath/ath5k/trace.h +++ b/drivers/net/wireless/ath/ath5k/trace.h @@ -3,7 +3,8 @@ #include <linux/tracepoint.h> -#ifndef CONFIG_ATH5K_TRACER + +#if !defined(CONFIG_ATH5K_TRACER) || defined(__CHECKER__) #undef TRACE_EVENT #define TRACE_EVENT(name, proto, ...) \ static inline void trace_ ## name(proto) {} @@ -93,7 +94,7 @@ TRACE_EVENT(ath5k_tx_complete, #endif /* __TRACE_ATH5K_H */ -#ifdef CONFIG_ATH5K_TRACER +#if defined(CONFIG_ATH5K_TRACER) && !defined(__CHECKER__) #undef TRACE_INCLUDE_PATH #define TRACE_INCLUDE_PATH ../../drivers/net/wireless/ath/ath5k diff --git a/drivers/net/wireless/ath/ath6kl/Kconfig b/drivers/net/wireless/ath/ath6kl/Kconfig index d755a5e7ed20..3d5f8be20eac 100644 --- a/drivers/net/wireless/ath/ath6kl/Kconfig +++ b/drivers/net/wireless/ath/ath6kl/Kconfig @@ -1,29 +1,12 @@ config ATH6KL - tristate "Atheros mobile chipsets support" - -config ATH6KL_SDIO - tristate "Atheros ath6kl SDIO support" - depends on ATH6KL + tristate "Atheros ath6kl support" depends on MMC depends on CFG80211 ---help--- This module adds support for wireless adapters based on - Atheros AR6003 and AR6004 chipsets running over SDIO. If you - choose to build it as a module, it will be called ath6kl_sdio. - 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. + Atheros AR6003 chipset running over SDIO. If you choose to + build it as a module, it will be called ath6kl. Pls note + that AR6002 and AR6001 are not supported by this driver. config ATH6KL_DEBUG bool "Atheros ath6kl debugging" diff --git a/drivers/net/wireless/ath/ath6kl/Makefile b/drivers/net/wireless/ath/ath6kl/Makefile index e14cef9c3c0e..707069303550 100644 --- a/drivers/net/wireless/ath/ath6kl/Makefile +++ b/drivers/net/wireless/ath/ath6kl/Makefile @@ -21,30 +21,17 @@ # Author(s): ="Atheros" #------------------------------------------------------------------------------ -obj-$(CONFIG_ATH6KL_SDIO) := ath6kl_sdio.o -ath6kl_sdio-y += debug.o -ath6kl_sdio-y += hif.o -ath6kl_sdio-y += htc.o -ath6kl_sdio-y += bmi.o -ath6kl_sdio-y += cfg80211.o -ath6kl_sdio-y += init.o -ath6kl_sdio-y += main.o -ath6kl_sdio-y += txrx.o -ath6kl_sdio-y += wmi.o -ath6kl_sdio-y += sdio.o -ath6kl_sdio-$(CONFIG_NL80211_TESTMODE) += testmode.o - -obj-$(CONFIG_ATH6KL_USB) += ath6kl_usb.o -ath6kl_usb-y += debug.o -ath6kl_usb-y += hif.o -ath6kl_usb-y += htc.o -ath6kl_usb-y += bmi.o -ath6kl_usb-y += cfg80211.o -ath6kl_usb-y += init.o -ath6kl_usb-y += main.o -ath6kl_usb-y += txrx.o -ath6kl_usb-y += wmi.o -ath6kl_usb-y += usb.o -ath6kl_usb-$(CONFIG_NL80211_TESTMODE) += testmode.o +obj-$(CONFIG_ATH6KL) := ath6kl.o +ath6kl-y += debug.o +ath6kl-y += hif.o +ath6kl-y += htc.o +ath6kl-y += bmi.o +ath6kl-y += cfg80211.o +ath6kl-y += init.o +ath6kl-y += main.o +ath6kl-y += txrx.o +ath6kl-y += wmi.o +ath6kl-y += sdio.o +ath6kl-$(CONFIG_NL80211_TESTMODE) += testmode.o ccflags-y += -D__CHECK_ENDIAN__ diff --git a/drivers/net/wireless/ath/ath6kl/bmi.c b/drivers/net/wireless/ath/ath6kl/bmi.c index aef00d5a1438..bce3575c310a 100644 --- a/drivers/net/wireless/ath/ath6kl/bmi.c +++ b/drivers/net/wireless/ath/ath6kl/bmi.c @@ -57,14 +57,8 @@ int ath6kl_bmi_get_target_info(struct ath6kl *ar, return ret; } - if (ar->hif_type == ATH6KL_HIF_TYPE_USB) { - 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)); - } - + ret = ath6kl_hif_bmi_read(ar, (u8 *)&targ_info->version, + sizeof(targ_info->version)); if (ret) { ath6kl_err("Unable to recv target info: %d\n", ret); return ret; diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h index e569c652e35c..9853c9c125c1 100644 --- a/drivers/net/wireless/ath/ath6kl/debug.h +++ b/drivers/net/wireless/ath/ath6kl/debug.h @@ -41,7 +41,6 @@ enum ATH6K_DEBUG_MASK { ATH6KL_DBG_BOOT = BIT(18), /* driver init and fw boot */ ATH6KL_DBG_WMI_DUMP = BIT(19), ATH6KL_DBG_SUSPEND = BIT(20), - ATH6KL_DBG_USB = BIT(21), ATH6KL_DBG_ANY = 0xffffffff /* enable all logs */ }; diff --git a/drivers/net/wireless/ath/ath6kl/hif.c b/drivers/net/wireless/ath/ath6kl/hif.c index 0772ef650174..e57da35e59fa 100644 --- a/drivers/net/wireless/ath/ath6kl/hif.c +++ b/drivers/net/wireless/ath/ath6kl/hif.c @@ -689,11 +689,6 @@ int ath6kl_hif_setup(struct ath6kl_device *dev) 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); - /* 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); fail_setup: diff --git a/drivers/net/wireless/ath/ath6kl/htc.c b/drivers/net/wireless/ath/ath6kl/htc.c index b01702258faf..f3b63ca25c7e 100644 --- a/drivers/net/wireless/ath/ath6kl/htc.c +++ b/drivers/net/wireless/ath/ath6kl/htc.c @@ -2543,12 +2543,6 @@ int ath6kl_htc_wait_target(struct htc_target *target) struct htc_service_connect_resp resp; 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 */ packet = htc_wait_for_ctrl_msg(target); @@ -2778,9 +2772,7 @@ void ath6kl_htc_cleanup(struct htc_target *target) { struct htc_packet *packet, *tmp_packet; - /* 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); + ath6kl_hif_cleanup_scatter(target->dev->ar); list_for_each_entry_safe(packet, tmp_packet, &target->free_ctrl_txbuf, list) { diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c index 15c3f56caf4f..9475e2d0d0b7 100644 --- a/drivers/net/wireless/ath/ath6kl/sdio.c +++ b/drivers/net/wireless/ath/ath6kl/sdio.c @@ -1332,7 +1332,7 @@ static const struct sdio_device_id ath6kl_sdio_devices[] = { MODULE_DEVICE_TABLE(sdio, ath6kl_sdio_devices); static struct sdio_driver ath6kl_sdio_driver = { - .name = "ath6kl_sdio", + .name = "ath6kl", .id_table = ath6kl_sdio_devices, .probe = ath6kl_sdio_probe, .remove = ath6kl_sdio_remove, diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c deleted file mode 100644 index e3cf397fcafe..000000000000 --- a/drivers/net/wireless/ath/ath6kl/usb.c +++ /dev/null @@ -1,431 +0,0 @@ -/* - * Copyright (c) 2007-2011 Atheros Communications 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. - */ - -#include <linux/module.h> -#include <linux/usb.h> - -#include "debug.h" -#include "core.h" - -/* usb device object */ -struct ath6kl_usb { - struct usb_device *udev; - struct usb_interface *interface; - u8 *diag_cmd_buffer; - u8 *diag_resp_buffer; - struct ath6kl *ar; -}; - -/* diagnostic command defnitions */ -#define ATH6KL_USB_CONTROL_REQ_SEND_BMI_CMD 1 -#define ATH6KL_USB_CONTROL_REQ_RECV_BMI_RESP 2 -#define ATH6KL_USB_CONTROL_REQ_DIAG_CMD 3 -#define ATH6KL_USB_CONTROL_REQ_DIAG_RESP 4 - -#define ATH6KL_USB_CTRL_DIAG_CC_READ 0 -#define ATH6KL_USB_CTRL_DIAG_CC_WRITE 1 - -struct ath6kl_usb_ctrl_diag_cmd_write { - __le32 cmd; - __le32 address; - __le32 value; - __le32 _pad[1]; -} __packed; - -struct ath6kl_usb_ctrl_diag_cmd_read { - __le32 cmd; - __le32 address; -} __packed; - -struct ath6kl_usb_ctrl_diag_resp_read { - __le32 value; -} __packed; - -#define ATH6KL_USB_MAX_DIAG_CMD (sizeof(struct ath6kl_usb_ctrl_diag_cmd_write)) -#define ATH6KL_USB_MAX_DIAG_RESP (sizeof(struct ath6kl_usb_ctrl_diag_resp_read)) - -static void ath6kl_usb_destroy(struct ath6kl_usb *ar_usb) -{ - usb_set_intfdata(ar_usb->interface, NULL); - - kfree(ar_usb->diag_cmd_buffer); - kfree(ar_usb->diag_resp_buffer); - - kfree(ar_usb); -} - -static struct ath6kl_usb *ath6kl_usb_create(struct usb_interface *interface) -{ - struct ath6kl_usb *ar_usb = NULL; - struct usb_device *dev = interface_to_usbdev(interface); - int status = 0; - - ar_usb = kzalloc(sizeof(struct ath6kl_usb), GFP_KERNEL); - if (ar_usb == NULL) - goto fail_ath6kl_usb_create; - - memset(ar_usb, 0, sizeof(struct ath6kl_usb)); - usb_set_intfdata(interface, ar_usb); - ar_usb->udev = dev; - ar_usb->interface = interface; - - ar_usb->diag_cmd_buffer = kzalloc(ATH6KL_USB_MAX_DIAG_CMD, GFP_KERNEL); - if (ar_usb->diag_cmd_buffer == NULL) { - status = -ENOMEM; - goto fail_ath6kl_usb_create; - } - - ar_usb->diag_resp_buffer = kzalloc(ATH6KL_USB_MAX_DIAG_RESP, - GFP_KERNEL); - if (ar_usb->diag_resp_buffer == NULL) { - status = -ENOMEM; - goto fail_ath6kl_usb_create; - } - -fail_ath6kl_usb_create: - if (status != 0) { - ath6kl_usb_destroy(ar_usb); - ar_usb = NULL; - } - return ar_usb; -} - -static void ath6kl_usb_device_detached(struct usb_interface *interface) -{ - struct ath6kl_usb *ar_usb; - - ar_usb = usb_get_intfdata(interface); - if (ar_usb == NULL) - return; - - ath6kl_stop_txrx(ar_usb->ar); - - ath6kl_core_cleanup(ar_usb->ar); - - ath6kl_usb_destroy(ar_usb); -} - -static int ath6kl_usb_submit_ctrl_out(struct ath6kl_usb *ar_usb, - u8 req, u16 value, u16 index, void *data, - u32 size) -{ - u8 *buf = NULL; - int ret; - - if (size > 0) { - buf = kmalloc(size, GFP_KERNEL); - if (buf == NULL) - return -ENOMEM; - - memcpy(buf, data, size); - } - - /* note: if successful returns number of bytes transfered */ - ret = usb_control_msg(ar_usb->udev, - usb_sndctrlpipe(ar_usb->udev, 0), - req, - USB_DIR_OUT | USB_TYPE_VENDOR | - USB_RECIP_DEVICE, value, index, buf, - size, 1000); - - if (ret < 0) { - ath6kl_dbg(ATH6KL_DBG_USB, "%s failed,result = %d\n", - __func__, ret); - } - - kfree(buf); - - return 0; -} - -static int ath6kl_usb_submit_ctrl_in(struct ath6kl_usb *ar_usb, - u8 req, u16 value, u16 index, void *data, - u32 size) -{ - u8 *buf = NULL; - int ret; - - if (size > 0) { - buf = kmalloc(size, GFP_KERNEL); - if (buf == NULL) - return -ENOMEM; - } - - /* note: if successful returns number of bytes transfered */ - ret = usb_control_msg(ar_usb->udev, - usb_rcvctrlpipe(ar_usb->udev, 0), - req, - USB_DIR_IN | USB_TYPE_VENDOR | - USB_RECIP_DEVICE, value, index, buf, - size, 2 * HZ); - - if (ret < 0) { - ath6kl_dbg(ATH6KL_DBG_USB, "%s failed,result = %d\n", - __func__, ret); - } - - memcpy((u8 *) data, buf, size); - - kfree(buf); - - return 0; -} - -static int ath6kl_usb_ctrl_msg_exchange(struct ath6kl_usb *ar_usb, - u8 req_val, u8 *req_buf, u32 req_len, - u8 resp_val, u8 *resp_buf, u32 *resp_len) -{ - int ret; - - /* send command */ - ret = ath6kl_usb_submit_ctrl_out(ar_usb, req_val, 0, 0, - req_buf, req_len); - - if (ret != 0) - return ret; - - if (resp_buf == NULL) { - /* no expected response */ - return ret; - } - - /* get response */ - ret = ath6kl_usb_submit_ctrl_in(ar_usb, resp_val, 0, 0, - resp_buf, *resp_len); - - return ret; -} - -static int ath6kl_usb_diag_read32(struct ath6kl *ar, u32 address, u32 *data) -{ - struct ath6kl_usb *ar_usb = ar->hif_priv; - struct ath6kl_usb_ctrl_diag_resp_read *resp; - struct ath6kl_usb_ctrl_diag_cmd_read *cmd; - u32 resp_len; - int ret; - - cmd = (struct ath6kl_usb_ctrl_diag_cmd_read *) ar_usb->diag_cmd_buffer; - - memset(cmd, 0, sizeof(*cmd)); - cmd->cmd = ATH6KL_USB_CTRL_DIAG_CC_READ; - cmd->address = cpu_to_le32(address); - resp_len = sizeof(*resp); - - ret = ath6kl_usb_ctrl_msg_exchange(ar_usb, - ATH6KL_USB_CONTROL_REQ_DIAG_CMD, - (u8 *) cmd, - sizeof(struct ath6kl_usb_ctrl_diag_cmd_write), - ATH6KL_USB_CONTROL_REQ_DIAG_RESP, - ar_usb->diag_resp_buffer, &resp_len); - - if (ret) - return ret; - - resp = (struct ath6kl_usb_ctrl_diag_resp_read *) - ar_usb->diag_resp_buffer; - - *data = le32_to_cpu(resp->value); - - return ret; -} - -static int ath6kl_usb_diag_write32(struct ath6kl *ar, u32 address, __le32 data) -{ - struct ath6kl_usb *ar_usb = ar->hif_priv; - struct ath6kl_usb_ctrl_diag_cmd_write *cmd; - - cmd = (struct ath6kl_usb_ctrl_diag_cmd_write *) ar_usb->diag_cmd_buffer; - - memset(cmd, 0, sizeof(struct ath6kl_usb_ctrl_diag_cmd_write)); - cmd->cmd = cpu_to_le32(ATH6KL_USB_CTRL_DIAG_CC_WRITE); - cmd->address = cpu_to_le32(address); - cmd->value = data; - - return ath6kl_usb_ctrl_msg_exchange(ar_usb, - ATH6KL_USB_CONTROL_REQ_DIAG_CMD, - (u8 *) cmd, - sizeof(*cmd), - 0, NULL, NULL); - -} - -static int ath6kl_usb_bmi_read(struct ath6kl *ar, u8 *buf, u32 len) -{ - struct ath6kl_usb *ar_usb = ar->hif_priv; - int ret; - - /* get response */ - ret = ath6kl_usb_submit_ctrl_in(ar_usb, - ATH6KL_USB_CONTROL_REQ_RECV_BMI_RESP, - 0, 0, buf, len); - if (ret != 0) { - ath6kl_err("Unable to read the bmi data from the device: %d\n", - ret); - return ret; - } - - return 0; -} - -static int ath6kl_usb_bmi_write(struct ath6kl *ar, u8 *buf, u32 len) -{ - struct ath6kl_usb *ar_usb = ar->hif_priv; - int ret; - - /* send command */ - ret = ath6kl_usb_submit_ctrl_out(ar_usb, - ATH6KL_USB_CONTROL_REQ_SEND_BMI_CMD, - 0, 0, buf, len); - if (ret != 0) { - ath6kl_err("unable to send the bmi data to the device: %d\n", - ret); - return ret; - } - - return 0; -} - -static int ath6kl_usb_power_on(struct ath6kl *ar) -{ - return 0; -} - -static int ath6kl_usb_power_off(struct ath6kl *ar) -{ - return 0; -} - -static const struct ath6kl_hif_ops ath6kl_usb_ops = { - .diag_read32 = ath6kl_usb_diag_read32, - .diag_write32 = ath6kl_usb_diag_write32, - .bmi_read = ath6kl_usb_bmi_read, - .bmi_write = ath6kl_usb_bmi_write, - .power_on = ath6kl_usb_power_on, - .power_off = ath6kl_usb_power_off, -}; - -/* ath6kl usb driver registered functions */ -static int ath6kl_usb_probe(struct usb_interface *interface, - const struct usb_device_id *id) -{ - struct usb_device *dev = interface_to_usbdev(interface); - struct ath6kl *ar; - struct ath6kl_usb *ar_usb = NULL; - int vendor_id, product_id; - int ret = 0; - - usb_get_dev(dev); - - vendor_id = le16_to_cpu(dev->descriptor.idVendor); - product_id = le16_to_cpu(dev->descriptor.idProduct); - - ath6kl_dbg(ATH6KL_DBG_USB, "vendor_id = %04x\n", vendor_id); - ath6kl_dbg(ATH6KL_DBG_USB, "product_id = %04x\n", product_id); - - if (interface->cur_altsetting) - ath6kl_dbg(ATH6KL_DBG_USB, "USB Interface %d\n", - interface->cur_altsetting->desc.bInterfaceNumber); - - - if (dev->speed == USB_SPEED_HIGH) - ath6kl_dbg(ATH6KL_DBG_USB, "USB 2.0 Host\n"); - else - ath6kl_dbg(ATH6KL_DBG_USB, "USB 1.1 Host\n"); - - ar_usb = ath6kl_usb_create(interface); - - if (ar_usb == NULL) { - ret = -ENOMEM; - goto err_usb_put; - } - - ar = ath6kl_core_alloc(&ar_usb->udev->dev); - if (ar == NULL) { - ath6kl_err("Failed to alloc ath6kl core\n"); - ret = -ENOMEM; - goto err_usb_destroy; - } - - ar->hif_priv = ar_usb; - ar->hif_type = ATH6KL_HIF_TYPE_USB; - ar->hif_ops = &ath6kl_usb_ops; - ar->mbox_info.block_size = 16; - ar->bmi.max_data_size = 252; - - ar_usb->ar = ar; - - ret = ath6kl_core_init(ar); - if (ret) { - ath6kl_err("Failed to init ath6kl core: %d\n", ret); - goto err_core_free; - } - - return ret; - -err_core_free: - ath6kl_core_free(ar); -err_usb_destroy: - ath6kl_usb_destroy(ar_usb); -err_usb_put: - usb_put_dev(dev); - - return ret; -} - -static void ath6kl_usb_remove(struct usb_interface *interface) -{ - usb_put_dev(interface_to_usbdev(interface)); - ath6kl_usb_device_detached(interface); -} - -/* table of devices that work with this driver */ -static struct usb_device_id ath6kl_usb_ids[] = { - {USB_DEVICE(0x0cf3, 0x9374)}, - { /* Terminating entry */ }, -}; - -MODULE_DEVICE_TABLE(usb, ath6kl_usb_ids); - -static struct usb_driver ath6kl_usb_driver = { - .name = "ath6kl_usb", - .probe = ath6kl_usb_probe, - .disconnect = ath6kl_usb_remove, - .id_table = ath6kl_usb_ids, -}; - -static int ath6kl_usb_init(void) -{ - usb_register(&ath6kl_usb_driver); - return 0; -} - -static void ath6kl_usb_exit(void) -{ - usb_deregister(&ath6kl_usb_driver); -} - -module_init(ath6kl_usb_init); -module_exit(ath6kl_usb_exit); - -MODULE_AUTHOR("Atheros Communications, Inc."); -MODULE_DESCRIPTION("Driver support for Atheros AR600x USB devices"); -MODULE_LICENSE("Dual BSD/GPL"); -MODULE_FIRMWARE(AR6004_HW_1_0_FIRMWARE_FILE); -MODULE_FIRMWARE(AR6004_HW_1_0_BOARD_DATA_FILE); -MODULE_FIRMWARE(AR6004_HW_1_0_DEFAULT_BOARD_DATA_FILE); -MODULE_FIRMWARE(AR6004_HW_1_1_FIRMWARE_FILE); -MODULE_FIRMWARE(AR6004_HW_1_1_BOARD_DATA_FILE); -MODULE_FIRMWARE(AR6004_HW_1_1_DEFAULT_BOARD_DATA_FILE); diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index 391def99314c..9fbcbddea165 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c @@ -3538,13 +3538,13 @@ static void ar9003_hw_xpa_bias_level_apply(struct ath_hw *ah, bool is2ghz) static u16 ar9003_switch_com_spdt_get(struct ath_hw *ah, bool is_2ghz) { struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep; - __le32 val; + __le16 val; if (is_2ghz) val = eep->modalHeader2G.switchcomspdt; else val = eep->modalHeader5G.switchcomspdt; - return le32_to_cpu(val); + return le16_to_cpu(val); } diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c index 4a315155d779..88c81c5706b2 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c @@ -583,7 +583,7 @@ void ath9k_hw_reset_txstatus_ring(struct ath_hw *ah) void ath9k_hw_setup_statusring(struct ath_hw *ah, void *ts_start, u32 ts_paddr_start, - u8 size) + u16 size) { ah->ts_paddr_start = ts_paddr_start; diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.h b/drivers/net/wireless/ath/ath9k/ar9003_mac.h index c50449387bf1..e203b51e968b 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.h @@ -118,5 +118,5 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, void ath9k_hw_reset_txstatus_ring(struct ath_hw *ah); void ath9k_hw_setup_statusring(struct ath_hw *ah, void *ts_start, u32 ts_paddr_start, - u8 size); + u16 size); #endif diff --git a/drivers/net/wireless/ath/ath9k/ar9003_rtt.c b/drivers/net/wireless/ath/ath9k/ar9003_rtt.c index 48803ee9c0d6..458bedf0b0ae 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_rtt.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_rtt.c @@ -16,6 +16,7 @@ #include "hw.h" #include "ar9003_phy.h" +#include "ar9003_rtt.h" #define RTT_RESTORE_TIMEOUT 1000 #define RTT_ACCESS_TIMEOUT 100 diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 95276e914c1b..b30e9fc6433f 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h @@ -97,7 +97,7 @@ enum buffer_type { #define bf_isampdu(bf) (bf->bf_state.bf_type & BUF_AMPDU) #define bf_isaggr(bf) (bf->bf_state.bf_type & BUF_AGGR) -#define ATH_TXSTATUS_RING_SIZE 64 +#define ATH_TXSTATUS_RING_SIZE 512 #define DS2PHYS(_dd, _ds) \ ((_dd)->dd_desc_paddr + ((caddr_t)(_ds) - (caddr_t)(_dd)->dd_desc)) diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c index dc5fd569690f..b8967e482e6e 100644 --- a/drivers/net/wireless/ath/ath9k/beacon.c +++ b/drivers/net/wireless/ath/ath9k/beacon.c @@ -356,6 +356,7 @@ void ath_beacon_tasklet(unsigned long data) struct ath_buf *bf = NULL; struct ieee80211_vif *vif; struct ath_tx_status ts; + bool edma = !!(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA); int slot; u32 bfaddr, bc = 0; @@ -456,10 +457,12 @@ void ath_beacon_tasklet(unsigned long data) if (bfaddr != 0) { /* NB: cabq traffic should already be queued and primed */ ath9k_hw_puttxbuf(ah, sc->beacon.beaconq, bfaddr); - ath9k_hw_txstart(ah, sc->beacon.beaconq); + + if (!edma) + ath9k_hw_txstart(ah, sc->beacon.beaconq); sc->beacon.ast_be_xmit += bc; /* XXX per-vif? */ - if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) { + if (edma) { spin_lock_bh(&sc->sc_pcu_lock); ath9k_hw_txprocdesc(ah, bf->bf_desc, (void *)&ts); spin_unlock_bh(&sc->sc_pcu_lock); diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 48205c2960b5..6a29004a71b0 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h @@ -1016,7 +1016,7 @@ struct ath_hw { u32 ts_paddr_start; u32 ts_paddr_end; u16 ts_tail; - u8 ts_size; + u16 ts_size; u32 bb_watchdog_last_status; u32 bb_watchdog_timeout_ms; /* in ms, 0 to disable */ diff --git a/drivers/net/wireless/ath/ath9k/mci.c b/drivers/net/wireless/ath/ath9k/mci.c index fee8c6f0b251..05c23ea4c633 100644 --- a/drivers/net/wireless/ath/ath9k/mci.c +++ b/drivers/net/wireless/ath/ath9k/mci.c @@ -20,7 +20,7 @@ #include "ath9k.h" #include "mci.h" -u8 ath_mci_duty_cycle[] = { 0, 50, 60, 70, 80, 85, 90, 95, 98 }; +static const u8 ath_mci_duty_cycle[] = { 0, 50, 60, 70, 80, 85, 90, 95, 98 }; static struct ath_mci_profile_info* ath_mci_find_profile(struct ath_mci_profile *mci, diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 9aa01997b1ea..3182408ffe35 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c @@ -105,16 +105,19 @@ static int ath_max_4ms_framelen[4][32] = { /*********************/ static void ath_txq_lock(struct ath_softc *sc, struct ath_txq *txq) + __acquires(&txq->axq_lock) { spin_lock_bh(&txq->axq_lock); } static void ath_txq_unlock(struct ath_softc *sc, struct ath_txq *txq) + __releases(&txq->axq_lock) { spin_unlock_bh(&txq->axq_lock); } static void ath_txq_unlock_complete(struct ath_softc *sc, struct ath_txq *txq) + __releases(&txq->axq_lock) { struct sk_buff_head q; struct sk_buff *skb; diff --git a/drivers/net/wireless/ath/carl9170/fw.c b/drivers/net/wireless/ath/carl9170/fw.c index cba9d0435dc4..3de61adacd34 100644 --- a/drivers/net/wireless/ath/carl9170/fw.c +++ b/drivers/net/wireless/ath/carl9170/fw.c @@ -146,13 +146,15 @@ static bool valid_cpu_addr(const u32 address) return false; } -static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len) +static int carl9170_fw_checksum(struct ar9170 *ar, const __u8 *data, + size_t len) { const struct carl9170fw_otus_desc *otus_desc; - const struct carl9170fw_chk_desc *chk_desc; const struct carl9170fw_last_desc *last_desc; - const struct carl9170fw_txsq_desc *txsq_desc; - u16 if_comb_types; + const struct carl9170fw_chk_desc *chk_desc; + unsigned long fin, diff; + unsigned int dsc_len; + u32 crc32; last_desc = carl9170_fw_find_desc(ar, LAST_MAGIC, sizeof(*last_desc), CARL9170FW_LAST_DESC_CUR_VER); @@ -170,36 +172,68 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len) chk_desc = carl9170_fw_find_desc(ar, CHK_MAGIC, sizeof(*chk_desc), CARL9170FW_CHK_DESC_CUR_VER); - if (chk_desc) { - unsigned long fin, diff; - unsigned int dsc_len; - u32 crc32; + if (!chk_desc) { + dev_warn(&ar->udev->dev, "Unprotected firmware image.\n"); + return 0; + } - dsc_len = min_t(unsigned int, len, + dsc_len = min_t(unsigned int, len, (unsigned long)chk_desc - (unsigned long)otus_desc); - fin = (unsigned long) last_desc + sizeof(*last_desc); - diff = fin - (unsigned long) otus_desc; + fin = (unsigned long) last_desc + sizeof(*last_desc); + diff = fin - (unsigned long) otus_desc; - if (diff < len) - len -= diff; + if (diff < len) + len -= diff; - if (len < 256) - return -EIO; + if (len < 256) + return -EIO; - crc32 = crc32_le(~0, data, len); - if (cpu_to_le32(crc32) != chk_desc->fw_crc32) { - dev_err(&ar->udev->dev, "fw checksum test failed.\n"); - return -ENOEXEC; - } + crc32 = crc32_le(~0, data, len); + if (cpu_to_le32(crc32) != chk_desc->fw_crc32) { + dev_err(&ar->udev->dev, "fw checksum test failed.\n"); + return -ENOEXEC; + } + + crc32 = crc32_le(crc32, (void *)otus_desc, dsc_len); + if (cpu_to_le32(crc32) != chk_desc->hdr_crc32) { + dev_err(&ar->udev->dev, "descriptor check failed.\n"); + return -EINVAL; + } + return 0; +} - crc32 = crc32_le(crc32, (void *)otus_desc, dsc_len); - if (cpu_to_le32(crc32) != chk_desc->hdr_crc32) { - dev_err(&ar->udev->dev, "descriptor check failed.\n"); +static int carl9170_fw_tx_sequence(struct ar9170 *ar) +{ + const struct carl9170fw_txsq_desc *txsq_desc; + + txsq_desc = carl9170_fw_find_desc(ar, TXSQ_MAGIC, sizeof(*txsq_desc), + CARL9170FW_TXSQ_DESC_CUR_VER); + if (txsq_desc) { + ar->fw.tx_seq_table = le32_to_cpu(txsq_desc->seq_table_addr); + if (!valid_cpu_addr(ar->fw.tx_seq_table)) return -EINVAL; - } } else { - dev_warn(&ar->udev->dev, "Unprotected firmware image.\n"); + ar->fw.tx_seq_table = 0; + } + + return 0; +} + +static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len) +{ + const struct carl9170fw_otus_desc *otus_desc; + int err; + u16 if_comb_types; + + err = carl9170_fw_checksum(ar, data, len); + if (err) + return err; + + otus_desc = carl9170_fw_find_desc(ar, OTUS_MAGIC, + sizeof(*otus_desc), CARL9170FW_OTUS_DESC_CUR_VER); + if (!otus_desc) { + return -ENODATA; } #define SUPP(feat) \ @@ -321,19 +355,8 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len) ar->hw->wiphy->interface_modes |= if_comb_types; - txsq_desc = carl9170_fw_find_desc(ar, TXSQ_MAGIC, - sizeof(*txsq_desc), CARL9170FW_TXSQ_DESC_CUR_VER); - - if (txsq_desc) { - ar->fw.tx_seq_table = le32_to_cpu(txsq_desc->seq_table_addr); - if (!valid_cpu_addr(ar->fw.tx_seq_table)) - return -EINVAL; - } else { - ar->fw.tx_seq_table = 0; - } - #undef SUPPORTED - return 0; + return carl9170_fw_tx_sequence(ar); } static struct carl9170fw_desc_head * |