提交 63a2f310 编写于 作者: D David S. Miller

Merge tag 'wireless-drivers-next-for-davem-2017-06-12' of...

Merge tag 'wireless-drivers-next-for-davem-2017-06-12' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next

Kalle Valo says:

====================
wireless-drivers-next patches for 4.13

The first pull request for 4.13. We have a new driver qtnfmac, but
also rsi driver got a support for new firmware and supporting ath10k
SDIO devices was started.

Major changes:

ath10k

* add initial SDIO support (still work in progress)

rsi

* new loading for the new firmware version

rtlwifi

* final patches for the new btcoex support

rt2x00

* add device ID for Epson WN7512BEP

qtnfmac

* new driver for Quantenna QSR10G chipsets
====================
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
...@@ -10634,6 +10634,14 @@ L: qemu-devel@nongnu.org ...@@ -10634,6 +10634,14 @@ L: qemu-devel@nongnu.org
S: Maintained S: Maintained
F: drivers/firmware/qemu_fw_cfg.c F: drivers/firmware/qemu_fw_cfg.c
QUANTENNA QTNFMAC WIRELESS DRIVER
M: Igor Mitsyanko <imitsyanko@quantenna.com>
M: Avinash Patil <avinashp@quantenna.com>
M: Sergey Matyukevich <smatyukevich@quantenna.com>
L: linux-wireless@vger.kernel.org
S: Maintained
F: drivers/net/wireless/quantenna
RADOS BLOCK DEVICE (RBD) RADOS BLOCK DEVICE (RBD)
M: Ilya Dryomov <idryomov@gmail.com> M: Ilya Dryomov <idryomov@gmail.com>
M: Sage Weil <sage@redhat.com> M: Sage Weil <sage@redhat.com>
......
...@@ -45,6 +45,7 @@ source "drivers/net/wireless/rsi/Kconfig" ...@@ -45,6 +45,7 @@ source "drivers/net/wireless/rsi/Kconfig"
source "drivers/net/wireless/st/Kconfig" source "drivers/net/wireless/st/Kconfig"
source "drivers/net/wireless/ti/Kconfig" source "drivers/net/wireless/ti/Kconfig"
source "drivers/net/wireless/zydas/Kconfig" source "drivers/net/wireless/zydas/Kconfig"
source "drivers/net/wireless/quantenna/Kconfig"
config PCMCIA_RAYCS config PCMCIA_RAYCS
tristate "Aviator/Raytheon 2.4GHz wireless support" tristate "Aviator/Raytheon 2.4GHz wireless support"
......
...@@ -17,6 +17,7 @@ obj-$(CONFIG_WLAN_VENDOR_RSI) += rsi/ ...@@ -17,6 +17,7 @@ obj-$(CONFIG_WLAN_VENDOR_RSI) += rsi/
obj-$(CONFIG_WLAN_VENDOR_ST) += st/ obj-$(CONFIG_WLAN_VENDOR_ST) += st/
obj-$(CONFIG_WLAN_VENDOR_TI) += ti/ obj-$(CONFIG_WLAN_VENDOR_TI) += ti/
obj-$(CONFIG_WLAN_VENDOR_ZYDAS) += zydas/ obj-$(CONFIG_WLAN_VENDOR_ZYDAS) += zydas/
obj-$(CONFIG_WLAN_VENDOR_QUANTENNA) += quantenna/
# 16-bit wireless PCMCIA client drivers # 16-bit wireless PCMCIA client drivers
obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o
......
...@@ -22,6 +22,13 @@ config ATH10K_AHB ...@@ -22,6 +22,13 @@ config ATH10K_AHB
---help--- ---help---
This module adds support for AHB bus This module adds support for AHB bus
config ATH10K_SDIO
tristate "Atheros ath10k SDIO support (EXPERIMENTAL)"
depends on ATH10K && MMC
---help---
This module adds experimental support for SDIO/MMC bus. Currently
work in progress and will not fully work.
config ATH10K_DEBUG config ATH10K_DEBUG
bool "Atheros ath10k debugging" bool "Atheros ath10k debugging"
depends on ATH10K depends on ATH10K
......
...@@ -27,5 +27,8 @@ ath10k_pci-y += pci.o \ ...@@ -27,5 +27,8 @@ ath10k_pci-y += pci.o \
ath10k_pci-$(CONFIG_ATH10K_AHB) += ahb.o ath10k_pci-$(CONFIG_ATH10K_AHB) += ahb.o
obj-$(CONFIG_ATH10K_SDIO) += ath10k_sdio.o
ath10k_sdio-y += sdio.o
# for tracing framework to find trace.h # for tracing framework to find trace.h
CFLAGS_trace.o := -I$(src) CFLAGS_trace.o := -I$(src)
...@@ -97,6 +97,77 @@ int ath10k_bmi_get_target_info(struct ath10k *ar, ...@@ -97,6 +97,77 @@ int ath10k_bmi_get_target_info(struct ath10k *ar,
return 0; return 0;
} }
#define TARGET_VERSION_SENTINAL 0xffffffffu
int ath10k_bmi_get_target_info_sdio(struct ath10k *ar,
struct bmi_target_info *target_info)
{
struct bmi_cmd cmd;
union bmi_resp resp;
u32 cmdlen = sizeof(cmd.id) + sizeof(cmd.get_target_info);
u32 resplen, ver_len;
__le32 tmp;
int ret;
ath10k_dbg(ar, ATH10K_DBG_BMI, "bmi get target info SDIO\n");
if (ar->bmi.done_sent) {
ath10k_warn(ar, "BMI Get Target Info Command disallowed\n");
return -EBUSY;
}
cmd.id = __cpu_to_le32(BMI_GET_TARGET_INFO);
/* Step 1: Read 4 bytes of the target info and check if it is
* the special sentinal version word or the first word in the
* version response.
*/
resplen = sizeof(u32);
ret = ath10k_hif_exchange_bmi_msg(ar, &cmd, cmdlen, &tmp, &resplen);
if (ret) {
ath10k_warn(ar, "unable to read from device\n");
return ret;
}
/* Some SDIO boards have a special sentinal byte before the real
* version response.
*/
if (__le32_to_cpu(tmp) == TARGET_VERSION_SENTINAL) {
/* Step 1b: Read the version length */
resplen = sizeof(u32);
ret = ath10k_hif_exchange_bmi_msg(ar, NULL, 0, &tmp,
&resplen);
if (ret) {
ath10k_warn(ar, "unable to read from device\n");
return ret;
}
}
ver_len = __le32_to_cpu(tmp);
/* Step 2: Check the target info length */
if (ver_len != sizeof(resp.get_target_info)) {
ath10k_warn(ar, "Unexpected target info len: %u. Expected: %zu\n",
ver_len, sizeof(resp.get_target_info));
return -EINVAL;
}
/* Step 3: Read the rest of the version response */
resplen = sizeof(resp.get_target_info) - sizeof(u32);
ret = ath10k_hif_exchange_bmi_msg(ar, NULL, 0,
&resp.get_target_info.version,
&resplen);
if (ret) {
ath10k_warn(ar, "unable to read from device\n");
return ret;
}
target_info->version = __le32_to_cpu(resp.get_target_info.version);
target_info->type = __le32_to_cpu(resp.get_target_info.type);
return 0;
}
int ath10k_bmi_read_memory(struct ath10k *ar, int ath10k_bmi_read_memory(struct ath10k *ar,
u32 address, void *buffer, u32 length) u32 address, void *buffer, u32 length)
{ {
......
...@@ -198,6 +198,8 @@ void ath10k_bmi_start(struct ath10k *ar); ...@@ -198,6 +198,8 @@ void ath10k_bmi_start(struct ath10k *ar);
int ath10k_bmi_done(struct ath10k *ar); int ath10k_bmi_done(struct ath10k *ar);
int ath10k_bmi_get_target_info(struct ath10k *ar, int ath10k_bmi_get_target_info(struct ath10k *ar,
struct bmi_target_info *target_info); struct bmi_target_info *target_info);
int ath10k_bmi_get_target_info_sdio(struct ath10k *ar,
struct bmi_target_info *target_info);
int ath10k_bmi_read_memory(struct ath10k *ar, u32 address, int ath10k_bmi_read_memory(struct ath10k *ar, u32 address,
void *buffer, u32 length); void *buffer, u32 length);
int ath10k_bmi_write_memory(struct ath10k *ar, u32 address, int ath10k_bmi_write_memory(struct ath10k *ar, u32 address,
......
...@@ -389,6 +389,21 @@ static void ath10k_send_suspend_complete(struct ath10k *ar) ...@@ -389,6 +389,21 @@ static void ath10k_send_suspend_complete(struct ath10k *ar)
complete(&ar->target_suspend); complete(&ar->target_suspend);
} }
static void ath10k_init_sdio(struct ath10k *ar)
{
u32 param = 0;
ath10k_bmi_write32(ar, hi_mbox_io_block_sz, 256);
ath10k_bmi_write32(ar, hi_mbox_isr_yield_limit, 99);
ath10k_bmi_read32(ar, hi_acs_flags, &param);
param |= (HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET |
HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET |
HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE);
ath10k_bmi_write32(ar, hi_acs_flags, param);
}
static int ath10k_init_configure_target(struct ath10k *ar) static int ath10k_init_configure_target(struct ath10k *ar)
{ {
u32 param_host; u32 param_host;
...@@ -1395,7 +1410,18 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name, ...@@ -1395,7 +1410,18 @@ int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
static void ath10k_core_get_fw_name(struct ath10k *ar, char *fw_name, static void ath10k_core_get_fw_name(struct ath10k *ar, char *fw_name,
size_t fw_name_len, int fw_api) size_t fw_name_len, int fw_api)
{ {
scnprintf(fw_name, fw_name_len, "%s-%d.bin", ATH10K_FW_FILE_BASE, fw_api); switch (ar->hif.bus) {
case ATH10K_BUS_SDIO:
scnprintf(fw_name, fw_name_len, "%s-%s-%d.bin",
ATH10K_FW_FILE_BASE, ath10k_bus_str(ar->hif.bus),
fw_api);
break;
case ATH10K_BUS_PCI:
case ATH10K_BUS_AHB:
scnprintf(fw_name, fw_name_len, "%s-%d.bin",
ATH10K_FW_FILE_BASE, fw_api);
break;
}
} }
static int ath10k_core_fetch_firmware_files(struct ath10k *ar) static int ath10k_core_fetch_firmware_files(struct ath10k *ar)
...@@ -1953,6 +1979,9 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode, ...@@ -1953,6 +1979,9 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
if (status) if (status)
goto err; goto err;
if (ar->hif.bus == ATH10K_BUS_SDIO)
ath10k_init_sdio(ar);
ar->htc.htc_ops.target_send_suspend_complete = ar->htc.htc_ops.target_send_suspend_complete =
ath10k_send_suspend_complete; ath10k_send_suspend_complete;
...@@ -2200,7 +2229,10 @@ static int ath10k_core_probe_fw(struct ath10k *ar) ...@@ -2200,7 +2229,10 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
} }
memset(&target_info, 0, sizeof(target_info)); memset(&target_info, 0, sizeof(target_info));
ret = ath10k_bmi_get_target_info(ar, &target_info); if (ar->hif.bus == ATH10K_BUS_SDIO)
ret = ath10k_bmi_get_target_info_sdio(ar, &target_info);
else
ret = ath10k_bmi_get_target_info(ar, &target_info);
if (ret) { if (ret) {
ath10k_err(ar, "could not get target info (%d)\n", ret); ath10k_err(ar, "could not get target info (%d)\n", ret);
goto err_power_down; goto err_power_down;
......
...@@ -91,6 +91,7 @@ struct ath10k; ...@@ -91,6 +91,7 @@ struct ath10k;
enum ath10k_bus { enum ath10k_bus {
ATH10K_BUS_PCI, ATH10K_BUS_PCI,
ATH10K_BUS_AHB, ATH10K_BUS_AHB,
ATH10K_BUS_SDIO,
}; };
static inline const char *ath10k_bus_str(enum ath10k_bus bus) static inline const char *ath10k_bus_str(enum ath10k_bus bus)
...@@ -100,6 +101,8 @@ static inline const char *ath10k_bus_str(enum ath10k_bus bus) ...@@ -100,6 +101,8 @@ static inline const char *ath10k_bus_str(enum ath10k_bus bus)
return "pci"; return "pci";
case ATH10K_BUS_AHB: case ATH10K_BUS_AHB:
return "ahb"; return "ahb";
case ATH10K_BUS_SDIO:
return "sdio";
} }
return "unknown"; return "unknown";
......
...@@ -625,17 +625,21 @@ static ssize_t ath10k_write_simulate_fw_crash(struct file *file, ...@@ -625,17 +625,21 @@ static ssize_t ath10k_write_simulate_fw_crash(struct file *file,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct ath10k *ar = file->private_data; struct ath10k *ar = file->private_data;
char buf[32]; char buf[32] = {0};
ssize_t rc;
int ret; int ret;
simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); /* filter partial writes and invalid commands */
if (*ppos != 0 || count >= sizeof(buf) || count == 0)
return -EINVAL;
/* make sure that buf is null terminated */ rc = simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
buf[sizeof(buf) - 1] = 0; if (rc < 0)
return rc;
/* drop the possible '\n' from the end */ /* drop the possible '\n' from the end */
if (buf[count - 1] == '\n') if (buf[*ppos - 1] == '\n')
buf[count - 1] = 0; buf[*ppos - 1] = '\0';
mutex_lock(&ar->conf_mutex); mutex_lock(&ar->conf_mutex);
......
...@@ -38,6 +38,8 @@ enum ath10k_debug_mask { ...@@ -38,6 +38,8 @@ enum ath10k_debug_mask {
ATH10K_DBG_WMI_PRINT = 0x00002000, ATH10K_DBG_WMI_PRINT = 0x00002000,
ATH10K_DBG_PCI_PS = 0x00004000, ATH10K_DBG_PCI_PS = 0x00004000,
ATH10K_DBG_AHB = 0x00008000, ATH10K_DBG_AHB = 0x00008000,
ATH10K_DBG_SDIO = 0x00010000,
ATH10K_DBG_SDIO_DUMP = 0x00020000,
ATH10K_DBG_ANY = 0xffffffff, ATH10K_DBG_ANY = 0xffffffff,
}; };
......
...@@ -57,8 +57,8 @@ static inline void ath10k_htc_restore_tx_skb(struct ath10k_htc *htc, ...@@ -57,8 +57,8 @@ static inline void ath10k_htc_restore_tx_skb(struct ath10k_htc *htc,
skb_pull(skb, sizeof(struct ath10k_htc_hdr)); skb_pull(skb, sizeof(struct ath10k_htc_hdr));
} }
static void ath10k_htc_notify_tx_completion(struct ath10k_htc_ep *ep, void ath10k_htc_notify_tx_completion(struct ath10k_htc_ep *ep,
struct sk_buff *skb) struct sk_buff *skb)
{ {
struct ath10k *ar = ep->htc->ar; struct ath10k *ar = ep->htc->ar;
...@@ -75,6 +75,7 @@ static void ath10k_htc_notify_tx_completion(struct ath10k_htc_ep *ep, ...@@ -75,6 +75,7 @@ static void ath10k_htc_notify_tx_completion(struct ath10k_htc_ep *ep,
ep->ep_ops.ep_tx_complete(ep->htc->ar, skb); ep->ep_ops.ep_tx_complete(ep->htc->ar, skb);
} }
EXPORT_SYMBOL(ath10k_htc_notify_tx_completion);
static void ath10k_htc_prepare_tx_skb(struct ath10k_htc_ep *ep, static void ath10k_htc_prepare_tx_skb(struct ath10k_htc_ep *ep,
struct sk_buff *skb) struct sk_buff *skb)
...@@ -230,12 +231,79 @@ ath10k_htc_process_credit_report(struct ath10k_htc *htc, ...@@ -230,12 +231,79 @@ ath10k_htc_process_credit_report(struct ath10k_htc *htc,
spin_unlock_bh(&htc->tx_lock); spin_unlock_bh(&htc->tx_lock);
} }
static int ath10k_htc_process_trailer(struct ath10k_htc *htc, static int
u8 *buffer, ath10k_htc_process_lookahead(struct ath10k_htc *htc,
int length, const struct ath10k_htc_lookahead_report *report,
enum ath10k_htc_ep_id src_eid) int len,
enum ath10k_htc_ep_id eid,
void *next_lookaheads,
int *next_lookaheads_len)
{ {
struct ath10k *ar = htc->ar; struct ath10k *ar = htc->ar;
/* Invalid lookahead flags are actually transmitted by
* the target in the HTC control message.
* Since this will happen at every boot we silently ignore
* the lookahead in this case
*/
if (report->pre_valid != ((~report->post_valid) & 0xFF))
return 0;
if (next_lookaheads && next_lookaheads_len) {
ath10k_dbg(ar, ATH10K_DBG_HTC,
"htc rx lookahead found pre_valid 0x%x post_valid 0x%x\n",
report->pre_valid, report->post_valid);
/* look ahead bytes are valid, copy them over */
memcpy((u8 *)next_lookaheads, report->lookahead, 4);
*next_lookaheads_len = 1;
}
return 0;
}
static int
ath10k_htc_process_lookahead_bundle(struct ath10k_htc *htc,
const struct ath10k_htc_lookahead_bundle *report,
int len,
enum ath10k_htc_ep_id eid,
void *next_lookaheads,
int *next_lookaheads_len)
{
struct ath10k *ar = htc->ar;
int bundle_cnt = len / sizeof(*report);
if (!bundle_cnt || (bundle_cnt > HTC_HOST_MAX_MSG_PER_BUNDLE)) {
ath10k_warn(ar, "Invalid lookahead bundle count: %d\n",
bundle_cnt);
return -EINVAL;
}
if (next_lookaheads && next_lookaheads_len) {
int i;
for (i = 0; i < bundle_cnt; i++) {
memcpy(((u8 *)next_lookaheads) + 4 * i,
report->lookahead, 4);
report++;
}
*next_lookaheads_len = bundle_cnt;
}
return 0;
}
int ath10k_htc_process_trailer(struct ath10k_htc *htc,
u8 *buffer,
int length,
enum ath10k_htc_ep_id src_eid,
void *next_lookaheads,
int *next_lookaheads_len)
{
struct ath10k_htc_lookahead_bundle *bundle;
struct ath10k *ar = htc->ar;
int status = 0; int status = 0;
struct ath10k_htc_record *record; struct ath10k_htc_record *record;
u8 *orig_buffer; u8 *orig_buffer;
...@@ -274,6 +342,29 @@ static int ath10k_htc_process_trailer(struct ath10k_htc *htc, ...@@ -274,6 +342,29 @@ static int ath10k_htc_process_trailer(struct ath10k_htc *htc,
record->hdr.len, record->hdr.len,
src_eid); src_eid);
break; break;
case ATH10K_HTC_RECORD_LOOKAHEAD:
len = sizeof(struct ath10k_htc_lookahead_report);
if (record->hdr.len < len) {
ath10k_warn(ar, "Lookahead report too long\n");
status = -EINVAL;
break;
}
status = ath10k_htc_process_lookahead(htc,
record->lookahead_report,
record->hdr.len,
src_eid,
next_lookaheads,
next_lookaheads_len);
break;
case ATH10K_HTC_RECORD_LOOKAHEAD_BUNDLE:
bundle = record->lookahead_bundle;
status = ath10k_htc_process_lookahead_bundle(htc,
bundle,
record->hdr.len,
src_eid,
next_lookaheads,
next_lookaheads_len);
break;
default: default:
ath10k_warn(ar, "Unhandled record: id:%d length:%d\n", ath10k_warn(ar, "Unhandled record: id:%d length:%d\n",
record->hdr.id, record->hdr.len); record->hdr.id, record->hdr.len);
...@@ -294,6 +385,7 @@ static int ath10k_htc_process_trailer(struct ath10k_htc *htc, ...@@ -294,6 +385,7 @@ static int ath10k_htc_process_trailer(struct ath10k_htc *htc,
return status; return status;
} }
EXPORT_SYMBOL(ath10k_htc_process_trailer);
void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb) void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb)
{ {
...@@ -360,7 +452,8 @@ void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb) ...@@ -360,7 +452,8 @@ void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb)
trailer += payload_len; trailer += payload_len;
trailer -= trailer_len; trailer -= trailer_len;
status = ath10k_htc_process_trailer(htc, trailer, status = ath10k_htc_process_trailer(htc, trailer,
trailer_len, hdr->eid); trailer_len, hdr->eid,
NULL, NULL);
if (status) if (status)
goto out; goto out;
...@@ -371,42 +464,6 @@ void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb) ...@@ -371,42 +464,6 @@ void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb)
/* zero length packet with trailer data, just drop these */ /* zero length packet with trailer data, just drop these */
goto out; goto out;
if (eid == ATH10K_HTC_EP_0) {
struct ath10k_htc_msg *msg = (struct ath10k_htc_msg *)skb->data;
switch (__le16_to_cpu(msg->hdr.message_id)) {
case ATH10K_HTC_MSG_READY_ID:
case ATH10K_HTC_MSG_CONNECT_SERVICE_RESP_ID:
/* handle HTC control message */
if (completion_done(&htc->ctl_resp)) {
/*
* this is a fatal error, target should not be
* sending unsolicited messages on the ep 0
*/
ath10k_warn(ar, "HTC rx ctrl still processing\n");
complete(&htc->ctl_resp);
goto out;
}
htc->control_resp_len =
min_t(int, skb->len,
ATH10K_HTC_MAX_CTRL_MSG_LEN);
memcpy(htc->control_resp_buffer, skb->data,
htc->control_resp_len);
complete(&htc->ctl_resp);
break;
case ATH10K_HTC_MSG_SEND_SUSPEND_COMPLETE:
htc->htc_ops.target_send_suspend_complete(ar);
break;
default:
ath10k_warn(ar, "ignoring unsolicited htc ep0 event\n");
break;
}
goto out;
}
ath10k_dbg(ar, ATH10K_DBG_HTC, "htc rx completion ep %d skb %pK\n", ath10k_dbg(ar, ATH10K_DBG_HTC, "htc rx completion ep %d skb %pK\n",
eid, skb); eid, skb);
ep->ep_ops.ep_rx_complete(ar, skb); ep->ep_ops.ep_rx_complete(ar, skb);
...@@ -421,10 +478,40 @@ EXPORT_SYMBOL(ath10k_htc_rx_completion_handler); ...@@ -421,10 +478,40 @@ EXPORT_SYMBOL(ath10k_htc_rx_completion_handler);
static void ath10k_htc_control_rx_complete(struct ath10k *ar, static void ath10k_htc_control_rx_complete(struct ath10k *ar,
struct sk_buff *skb) struct sk_buff *skb)
{ {
/* This is unexpected. FW is not supposed to send regular rx on this struct ath10k_htc *htc = &ar->htc;
* endpoint. struct ath10k_htc_msg *msg = (struct ath10k_htc_msg *)skb->data;
*/
ath10k_warn(ar, "unexpected htc rx\n"); switch (__le16_to_cpu(msg->hdr.message_id)) {
case ATH10K_HTC_MSG_READY_ID:
case ATH10K_HTC_MSG_CONNECT_SERVICE_RESP_ID:
/* handle HTC control message */
if (completion_done(&htc->ctl_resp)) {
/* this is a fatal error, target should not be
* sending unsolicited messages on the ep 0
*/
ath10k_warn(ar, "HTC rx ctrl still processing\n");
complete(&htc->ctl_resp);
goto out;
}
htc->control_resp_len =
min_t(int, skb->len,
ATH10K_HTC_MAX_CTRL_MSG_LEN);
memcpy(htc->control_resp_buffer, skb->data,
htc->control_resp_len);
complete(&htc->ctl_resp);
break;
case ATH10K_HTC_MSG_SEND_SUSPEND_COMPLETE:
htc->htc_ops.target_send_suspend_complete(ar);
break;
default:
ath10k_warn(ar, "ignoring unsolicited htc ep0 event\n");
break;
}
out:
kfree_skb(skb); kfree_skb(skb);
} }
...@@ -497,12 +584,8 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc) ...@@ -497,12 +584,8 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc)
struct ath10k *ar = htc->ar; struct ath10k *ar = htc->ar;
int i, status = 0; int i, status = 0;
unsigned long time_left; unsigned long time_left;
struct ath10k_htc_svc_conn_req conn_req;
struct ath10k_htc_svc_conn_resp conn_resp;
struct ath10k_htc_msg *msg; struct ath10k_htc_msg *msg;
u16 message_id; u16 message_id;
u16 credit_count;
u16 credit_size;
time_left = wait_for_completion_timeout(&htc->ctl_resp, time_left = wait_for_completion_timeout(&htc->ctl_resp,
ATH10K_HTC_WAIT_TIMEOUT_HZ); ATH10K_HTC_WAIT_TIMEOUT_HZ);
...@@ -539,16 +622,14 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc) ...@@ -539,16 +622,14 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc)
msg = (struct ath10k_htc_msg *)htc->control_resp_buffer; msg = (struct ath10k_htc_msg *)htc->control_resp_buffer;
message_id = __le16_to_cpu(msg->hdr.message_id); message_id = __le16_to_cpu(msg->hdr.message_id);
credit_count = __le16_to_cpu(msg->ready.credit_count);
credit_size = __le16_to_cpu(msg->ready.credit_size);
if (message_id != ATH10K_HTC_MSG_READY_ID) { if (message_id != ATH10K_HTC_MSG_READY_ID) {
ath10k_err(ar, "Invalid HTC ready msg: 0x%x\n", message_id); ath10k_err(ar, "Invalid HTC ready msg: 0x%x\n", message_id);
return -ECOMM; return -ECOMM;
} }
htc->total_transmit_credits = credit_count; htc->total_transmit_credits = __le16_to_cpu(msg->ready.credit_count);
htc->target_credit_size = credit_size; htc->target_credit_size = __le16_to_cpu(msg->ready.credit_size);
ath10k_dbg(ar, ATH10K_DBG_HTC, ath10k_dbg(ar, ATH10K_DBG_HTC,
"Target ready! transmit resources: %d size:%d\n", "Target ready! transmit resources: %d size:%d\n",
...@@ -561,20 +642,17 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc) ...@@ -561,20 +642,17 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc)
return -ECOMM; return -ECOMM;
} }
/* setup our pseudo HTC control endpoint connection */ /* The only way to determine if the ready message is an extended
memset(&conn_req, 0, sizeof(conn_req)); * message is from the size.
memset(&conn_resp, 0, sizeof(conn_resp)); */
conn_req.ep_ops.ep_tx_complete = ath10k_htc_control_tx_complete; if (htc->control_resp_len >=
conn_req.ep_ops.ep_rx_complete = ath10k_htc_control_rx_complete; sizeof(msg->hdr) + sizeof(msg->ready_ext)) {
conn_req.max_send_queue_depth = ATH10K_NUM_CONTROL_TX_BUFFERS; htc->max_msgs_per_htc_bundle =
conn_req.service_id = ATH10K_HTC_SVC_ID_RSVD_CTRL; min_t(u8, msg->ready_ext.max_msgs_per_htc_bundle,
HTC_HOST_MAX_MSG_PER_BUNDLE);
/* connect fake service */ ath10k_dbg(ar, ATH10K_DBG_HTC,
status = ath10k_htc_connect_service(htc, &conn_req, &conn_resp); "Extended ready message. RX bundle size: %d\n",
if (status) { htc->max_msgs_per_htc_bundle);
ath10k_err(ar, "could not connect to htc service (%d)\n",
status);
return status;
} }
return 0; return 0;
...@@ -772,6 +850,13 @@ int ath10k_htc_start(struct ath10k_htc *htc) ...@@ -772,6 +850,13 @@ int ath10k_htc_start(struct ath10k_htc *htc)
msg->hdr.message_id = msg->hdr.message_id =
__cpu_to_le16(ATH10K_HTC_MSG_SETUP_COMPLETE_EX_ID); __cpu_to_le16(ATH10K_HTC_MSG_SETUP_COMPLETE_EX_ID);
if (ar->hif.bus == ATH10K_BUS_SDIO) {
/* Extra setup params used by SDIO */
msg->setup_complete_ext.flags =
__cpu_to_le32(ATH10K_HTC_SETUP_COMPLETE_FLAGS_RX_BNDL_EN);
msg->setup_complete_ext.max_msgs_per_bundled_recv =
htc->max_msgs_per_htc_bundle;
}
ath10k_dbg(ar, ATH10K_DBG_HTC, "HTC is using TX credit flow control\n"); ath10k_dbg(ar, ATH10K_DBG_HTC, "HTC is using TX credit flow control\n");
status = ath10k_htc_send(htc, ATH10K_HTC_EP_0, skb); status = ath10k_htc_send(htc, ATH10K_HTC_EP_0, skb);
...@@ -786,8 +871,10 @@ int ath10k_htc_start(struct ath10k_htc *htc) ...@@ -786,8 +871,10 @@ int ath10k_htc_start(struct ath10k_htc *htc)
/* registered target arrival callback from the HIF layer */ /* registered target arrival callback from the HIF layer */
int ath10k_htc_init(struct ath10k *ar) int ath10k_htc_init(struct ath10k *ar)
{ {
struct ath10k_htc_ep *ep = NULL; int status;
struct ath10k_htc *htc = &ar->htc; struct ath10k_htc *htc = &ar->htc;
struct ath10k_htc_svc_conn_req conn_req;
struct ath10k_htc_svc_conn_resp conn_resp;
spin_lock_init(&htc->tx_lock); spin_lock_init(&htc->tx_lock);
...@@ -795,10 +882,21 @@ int ath10k_htc_init(struct ath10k *ar) ...@@ -795,10 +882,21 @@ int ath10k_htc_init(struct ath10k *ar)
htc->ar = ar; htc->ar = ar;
/* Get HIF default pipe for HTC message exchange */ /* setup our pseudo HTC control endpoint connection */
ep = &htc->endpoint[ATH10K_HTC_EP_0]; memset(&conn_req, 0, sizeof(conn_req));
memset(&conn_resp, 0, sizeof(conn_resp));
conn_req.ep_ops.ep_tx_complete = ath10k_htc_control_tx_complete;
conn_req.ep_ops.ep_rx_complete = ath10k_htc_control_rx_complete;
conn_req.max_send_queue_depth = ATH10K_NUM_CONTROL_TX_BUFFERS;
conn_req.service_id = ATH10K_HTC_SVC_ID_RSVD_CTRL;
ath10k_hif_get_default_pipe(ar, &ep->ul_pipe_id, &ep->dl_pipe_id); /* connect fake service */
status = ath10k_htc_connect_service(htc, &conn_req, &conn_resp);
if (status) {
ath10k_err(ar, "could not connect to htc service (%d)\n",
status);
return status;
}
init_completion(&htc->ctl_resp); init_completion(&htc->ctl_resp);
......
...@@ -50,6 +50,8 @@ struct ath10k; ...@@ -50,6 +50,8 @@ struct ath10k;
* 4-byte aligned. * 4-byte aligned.
*/ */
#define HTC_HOST_MAX_MSG_PER_BUNDLE 8
enum ath10k_htc_tx_flags { enum ath10k_htc_tx_flags {
ATH10K_HTC_FLAG_NEED_CREDIT_UPDATE = 0x01, ATH10K_HTC_FLAG_NEED_CREDIT_UPDATE = 0x01,
ATH10K_HTC_FLAG_SEND_BUNDLE = 0x02 ATH10K_HTC_FLAG_SEND_BUNDLE = 0x02
...@@ -110,6 +112,10 @@ enum ath10k_htc_conn_svc_status { ...@@ -110,6 +112,10 @@ enum ath10k_htc_conn_svc_status {
ATH10K_HTC_CONN_SVC_STATUS_NO_MORE_EP = 4 ATH10K_HTC_CONN_SVC_STATUS_NO_MORE_EP = 4
}; };
enum ath10k_htc_setup_complete_flags {
ATH10K_HTC_SETUP_COMPLETE_FLAGS_RX_BNDL_EN = 1
};
struct ath10k_ath10k_htc_msg_hdr { struct ath10k_ath10k_htc_msg_hdr {
__le16 message_id; /* @enum htc_message_id */ __le16 message_id; /* @enum htc_message_id */
} __packed; } __packed;
...@@ -174,8 +180,10 @@ struct ath10k_htc_msg { ...@@ -174,8 +180,10 @@ struct ath10k_htc_msg {
} __packed __aligned(4); } __packed __aligned(4);
enum ath10k_ath10k_htc_record_id { enum ath10k_ath10k_htc_record_id {
ATH10K_HTC_RECORD_NULL = 0, ATH10K_HTC_RECORD_NULL = 0,
ATH10K_HTC_RECORD_CREDITS = 1 ATH10K_HTC_RECORD_CREDITS = 1,
ATH10K_HTC_RECORD_LOOKAHEAD = 2,
ATH10K_HTC_RECORD_LOOKAHEAD_BUNDLE = 3,
}; };
struct ath10k_ath10k_htc_record_hdr { struct ath10k_ath10k_htc_record_hdr {
...@@ -192,10 +200,28 @@ struct ath10k_htc_credit_report { ...@@ -192,10 +200,28 @@ struct ath10k_htc_credit_report {
u8 pad1; u8 pad1;
} __packed; } __packed;
struct ath10k_htc_lookahead_report {
u8 pre_valid;
u8 pad0;
u8 pad1;
u8 pad2;
u8 lookahead[4];
u8 post_valid;
u8 pad3;
u8 pad4;
u8 pad5;
} __packed;
struct ath10k_htc_lookahead_bundle {
u8 lookahead[4];
} __packed;
struct ath10k_htc_record { struct ath10k_htc_record {
struct ath10k_ath10k_htc_record_hdr hdr; struct ath10k_ath10k_htc_record_hdr hdr;
union { union {
struct ath10k_htc_credit_report credit_report[0]; struct ath10k_htc_credit_report credit_report[0];
struct ath10k_htc_lookahead_report lookahead_report[0];
struct ath10k_htc_lookahead_bundle lookahead_bundle[0];
u8 pauload[0]; u8 pauload[0];
}; };
} __packed __aligned(4); } __packed __aligned(4);
...@@ -338,6 +364,7 @@ struct ath10k_htc { ...@@ -338,6 +364,7 @@ struct ath10k_htc {
int total_transmit_credits; int total_transmit_credits;
int target_credit_size; int target_credit_size;
u8 max_msgs_per_htc_bundle;
}; };
int ath10k_htc_init(struct ath10k *ar); int ath10k_htc_init(struct ath10k *ar);
...@@ -351,5 +378,13 @@ int ath10k_htc_send(struct ath10k_htc *htc, enum ath10k_htc_ep_id eid, ...@@ -351,5 +378,13 @@ int ath10k_htc_send(struct ath10k_htc *htc, enum ath10k_htc_ep_id eid,
struct sk_buff *ath10k_htc_alloc_skb(struct ath10k *ar, int size); struct sk_buff *ath10k_htc_alloc_skb(struct ath10k *ar, int size);
void ath10k_htc_tx_completion_handler(struct ath10k *ar, struct sk_buff *skb); void ath10k_htc_tx_completion_handler(struct ath10k *ar, struct sk_buff *skb);
void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb); void ath10k_htc_rx_completion_handler(struct ath10k *ar, struct sk_buff *skb);
void ath10k_htc_notify_tx_completion(struct ath10k_htc_ep *ep,
struct sk_buff *skb);
int ath10k_htc_process_trailer(struct ath10k_htc *htc,
u8 *buffer,
int length,
enum ath10k_htc_ep_id src_eid,
void *next_lookaheads,
int *next_lookaheads_len);
#endif #endif
...@@ -863,6 +863,59 @@ ath10k_rx_desc_get_l3_pad_bytes(struct ath10k_hw_params *hw, ...@@ -863,6 +863,59 @@ ath10k_rx_desc_get_l3_pad_bytes(struct ath10k_hw_params *hw,
#define QCA9887_EEPROM_ADDR_LO_MASK 0x00ff0000 #define QCA9887_EEPROM_ADDR_LO_MASK 0x00ff0000
#define QCA9887_EEPROM_ADDR_LO_LSB 16 #define QCA9887_EEPROM_ADDR_LO_LSB 16
#define MBOX_RESET_CONTROL_ADDRESS 0x00000000
#define MBOX_HOST_INT_STATUS_ADDRESS 0x00000800
#define MBOX_HOST_INT_STATUS_ERROR_LSB 7
#define MBOX_HOST_INT_STATUS_ERROR_MASK 0x00000080
#define MBOX_HOST_INT_STATUS_CPU_LSB 6
#define MBOX_HOST_INT_STATUS_CPU_MASK 0x00000040
#define MBOX_HOST_INT_STATUS_COUNTER_LSB 4
#define MBOX_HOST_INT_STATUS_COUNTER_MASK 0x00000010
#define MBOX_CPU_INT_STATUS_ADDRESS 0x00000801
#define MBOX_ERROR_INT_STATUS_ADDRESS 0x00000802
#define MBOX_ERROR_INT_STATUS_WAKEUP_LSB 2
#define MBOX_ERROR_INT_STATUS_WAKEUP_MASK 0x00000004
#define MBOX_ERROR_INT_STATUS_RX_UNDERFLOW_LSB 1
#define MBOX_ERROR_INT_STATUS_RX_UNDERFLOW_MASK 0x00000002
#define MBOX_ERROR_INT_STATUS_TX_OVERFLOW_LSB 0
#define MBOX_ERROR_INT_STATUS_TX_OVERFLOW_MASK 0x00000001
#define MBOX_COUNTER_INT_STATUS_ADDRESS 0x00000803
#define MBOX_COUNTER_INT_STATUS_COUNTER_LSB 0
#define MBOX_COUNTER_INT_STATUS_COUNTER_MASK 0x000000ff
#define MBOX_RX_LOOKAHEAD_VALID_ADDRESS 0x00000805
#define MBOX_INT_STATUS_ENABLE_ADDRESS 0x00000828
#define MBOX_INT_STATUS_ENABLE_ERROR_LSB 7
#define MBOX_INT_STATUS_ENABLE_ERROR_MASK 0x00000080
#define MBOX_INT_STATUS_ENABLE_CPU_LSB 6
#define MBOX_INT_STATUS_ENABLE_CPU_MASK 0x00000040
#define MBOX_INT_STATUS_ENABLE_INT_LSB 5
#define MBOX_INT_STATUS_ENABLE_INT_MASK 0x00000020
#define MBOX_INT_STATUS_ENABLE_COUNTER_LSB 4
#define MBOX_INT_STATUS_ENABLE_COUNTER_MASK 0x00000010
#define MBOX_INT_STATUS_ENABLE_MBOX_DATA_LSB 0
#define MBOX_INT_STATUS_ENABLE_MBOX_DATA_MASK 0x0000000f
#define MBOX_CPU_INT_STATUS_ENABLE_ADDRESS 0x00000819
#define MBOX_CPU_INT_STATUS_ENABLE_BIT_LSB 0
#define MBOX_CPU_INT_STATUS_ENABLE_BIT_MASK 0x000000ff
#define MBOX_ERROR_STATUS_ENABLE_ADDRESS 0x0000081a
#define MBOX_ERROR_STATUS_ENABLE_RX_UNDERFLOW_LSB 1
#define MBOX_ERROR_STATUS_ENABLE_RX_UNDERFLOW_MASK 0x00000002
#define MBOX_ERROR_STATUS_ENABLE_TX_OVERFLOW_LSB 0
#define MBOX_ERROR_STATUS_ENABLE_TX_OVERFLOW_MASK 0x00000001
#define MBOX_COUNTER_INT_STATUS_ENABLE_ADDRESS 0x0000081b
#define MBOX_COUNTER_INT_STATUS_ENABLE_BIT_LSB 0
#define MBOX_COUNTER_INT_STATUS_ENABLE_BIT_MASK 0x000000ff
#define MBOX_COUNT_ADDRESS 0x00000820
#define MBOX_COUNT_DEC_ADDRESS 0x00000840
#define MBOX_WINDOW_DATA_ADDRESS 0x00000874
#define MBOX_WINDOW_WRITE_ADDR_ADDRESS 0x00000878
#define MBOX_WINDOW_READ_ADDR_ADDRESS 0x0000087c
#define MBOX_CPU_DBG_SEL_ADDRESS 0x00000883
#define MBOX_CPU_DBG_ADDRESS 0x00000884
#define MBOX_RTC_BASE_ADDRESS 0x00000000
#define MBOX_GPIO_BASE_ADDRESS 0x00005000
#define MBOX_MBOX_BASE_ADDRESS 0x00008000
#define RTC_STATE_V_GET(x) (((x) & RTC_STATE_V_MASK) >> RTC_STATE_V_LSB) #define RTC_STATE_V_GET(x) (((x) & RTC_STATE_V_MASK) >> RTC_STATE_V_LSB)
/* Register definitions for first generation ath10k cards. These cards include /* Register definitions for first generation ath10k cards. These cards include
......
此差异已折叠。
/*
* Copyright (c) 2004-2011 Atheros Communications Inc.
* Copyright (c) 2011-2012 Qualcomm Atheros, Inc.
* Copyright (c) 2016-2017 Erik Stromdahl <erik.stromdahl@gmail.com>
*
* 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.
*/
#ifndef _SDIO_H_
#define _SDIO_H_
#define ATH10K_HIF_MBOX_BLOCK_SIZE 256
#define QCA_MANUFACTURER_ID_BASE GENMASK(11, 8)
#define QCA_MANUFACTURER_ID_AR6005_BASE 0x5
#define QCA_MANUFACTURER_ID_QCA9377_BASE 0x7
#define QCA_SDIO_ID_AR6005_BASE 0x500
#define QCA_SDIO_ID_QCA9377_BASE 0x700
#define QCA_MANUFACTURER_ID_REV_MASK 0x00FF
#define QCA_MANUFACTURER_CODE 0x271 /* Qualcomm/Atheros */
#define ATH10K_SDIO_MAX_BUFFER_SIZE 4096 /*Unsure of this constant*/
/* Mailbox address in SDIO address space */
#define ATH10K_HIF_MBOX_BASE_ADDR 0x1000
#define ATH10K_HIF_MBOX_WIDTH 0x800
#define ATH10K_HIF_MBOX_TOT_WIDTH \
(ATH10K_HIF_MBOX_NUM_MAX * ATH10K_HIF_MBOX_WIDTH)
#define ATH10K_HIF_MBOX0_EXT_BASE_ADDR 0x5000
#define ATH10K_HIF_MBOX0_EXT_WIDTH (36 * 1024)
#define ATH10K_HIF_MBOX0_EXT_WIDTH_ROME_2_0 (56 * 1024)
#define ATH10K_HIF_MBOX1_EXT_WIDTH (36 * 1024)
#define ATH10K_HIF_MBOX_DUMMY_SPACE_SIZE (2 * 1024)
#define ATH10K_HTC_MBOX_MAX_PAYLOAD_LENGTH \
(ATH10K_SDIO_MAX_BUFFER_SIZE - sizeof(struct ath10k_htc_hdr))
#define ATH10K_HIF_MBOX_NUM_MAX 4
#define ATH10K_SDIO_BUS_REQUEST_MAX_NUM 64
#define ATH10K_SDIO_HIF_COMMUNICATION_TIMEOUT_HZ (100 * HZ)
/* HTC runs over mailbox 0 */
#define ATH10K_HTC_MAILBOX 0
#define ATH10K_HTC_MAILBOX_MASK BIT(ATH10K_HTC_MAILBOX)
/* GMBOX addresses */
#define ATH10K_HIF_GMBOX_BASE_ADDR 0x7000
#define ATH10K_HIF_GMBOX_WIDTH 0x4000
/* Modified versions of the sdio.h macros.
* The macros in sdio.h can't be used easily with the FIELD_{PREP|GET}
* macros in bitfield.h, so we define our own macros here.
*/
#define ATH10K_SDIO_DRIVE_DTSX_MASK \
(SDIO_DRIVE_DTSx_MASK << SDIO_DRIVE_DTSx_SHIFT)
#define ATH10K_SDIO_DRIVE_DTSX_TYPE_B 0
#define ATH10K_SDIO_DRIVE_DTSX_TYPE_A 1
#define ATH10K_SDIO_DRIVE_DTSX_TYPE_C 2
#define ATH10K_SDIO_DRIVE_DTSX_TYPE_D 3
/* SDIO CCCR register definitions */
#define CCCR_SDIO_IRQ_MODE_REG 0xF0
#define CCCR_SDIO_IRQ_MODE_REG_SDIO3 0x16
#define CCCR_SDIO_DRIVER_STRENGTH_ENABLE_ADDR 0xF2
#define CCCR_SDIO_DRIVER_STRENGTH_ENABLE_A 0x02
#define CCCR_SDIO_DRIVER_STRENGTH_ENABLE_C 0x04
#define CCCR_SDIO_DRIVER_STRENGTH_ENABLE_D 0x08
#define CCCR_SDIO_ASYNC_INT_DELAY_ADDRESS 0xF0
#define CCCR_SDIO_ASYNC_INT_DELAY_MASK 0xC0
/* mode to enable special 4-bit interrupt assertion without clock */
#define SDIO_IRQ_MODE_ASYNC_4BIT_IRQ BIT(0)
#define SDIO_IRQ_MODE_ASYNC_4BIT_IRQ_SDIO3 BIT(1)
#define ATH10K_SDIO_TARGET_DEBUG_INTR_MASK 0x01
/* The theoretical maximum number of RX messages that can be fetched
* from the mbox interrupt handler in one loop is derived in the following
* way:
*
* Let's assume that each packet in a bundle of the maximum bundle size
* (HTC_HOST_MAX_MSG_PER_BUNDLE) has the HTC header bundle count set
* to the maximum value (HTC_HOST_MAX_MSG_PER_BUNDLE).
*
* in this case the driver must allocate
* (HTC_HOST_MAX_MSG_PER_BUNDLE * HTC_HOST_MAX_MSG_PER_BUNDLE) skb's.
*/
#define ATH10K_SDIO_MAX_RX_MSGS \
(HTC_HOST_MAX_MSG_PER_BUNDLE * HTC_HOST_MAX_MSG_PER_BUNDLE)
#define ATH10K_FIFO_TIMEOUT_AND_CHIP_CONTROL 0x00000868u
#define ATH10K_FIFO_TIMEOUT_AND_CHIP_CONTROL_DISABLE_SLEEP_OFF 0xFFFEFFFF
#define ATH10K_FIFO_TIMEOUT_AND_CHIP_CONTROL_DISABLE_SLEEP_ON 0x10000
struct ath10k_sdio_bus_request {
struct list_head list;
/* sdio address */
u32 address;
struct sk_buff *skb;
enum ath10k_htc_ep_id eid;
int status;
/* Specifies if the current request is an HTC message.
* If not, the eid is not applicable an the TX completion handler
* associated with the endpoint will not be invoked.
*/
bool htc_msg;
/* Completion that (if set) will be invoked for non HTC requests
* (htc_msg == false) when the request has been processed.
*/
struct completion *comp;
};
struct ath10k_sdio_rx_data {
struct sk_buff *skb;
size_t alloc_len;
size_t act_len;
enum ath10k_htc_ep_id eid;
bool part_of_bundle;
bool last_in_bundle;
bool trailer_only;
int status;
};
struct ath10k_sdio_irq_proc_regs {
u8 host_int_status;
u8 cpu_int_status;
u8 error_int_status;
u8 counter_int_status;
u8 mbox_frame;
u8 rx_lookahead_valid;
u8 host_int_status2;
u8 gmbox_rx_avail;
__le32 rx_lookahead[2];
__le32 rx_gmbox_lookahead_alias[2];
};
struct ath10k_sdio_irq_enable_regs {
u8 int_status_en;
u8 cpu_int_status_en;
u8 err_int_status_en;
u8 cntr_int_status_en;
};
struct ath10k_sdio_irq_data {
/* protects irq_proc_reg and irq_en_reg below.
* We use a mutex here and not a spinlock since we will have the
* mutex locked while calling the sdio_memcpy_ functions.
* These function require non atomic context, and hence, spinlocks
* can be held while calling these functions.
*/
struct mutex mtx;
struct ath10k_sdio_irq_proc_regs *irq_proc_reg;
struct ath10k_sdio_irq_enable_regs *irq_en_reg;
};
struct ath10k_mbox_ext_info {
u32 htc_ext_addr;
u32 htc_ext_sz;
};
struct ath10k_mbox_info {
u32 htc_addr;
struct ath10k_mbox_ext_info ext_info[2];
u32 block_size;
u32 block_mask;
u32 gmbox_addr;
u32 gmbox_sz;
};
struct ath10k_sdio {
struct sdio_func *func;
struct ath10k_mbox_info mbox_info;
bool swap_mbox;
u32 mbox_addr[ATH10K_HTC_EP_COUNT];
u32 mbox_size[ATH10K_HTC_EP_COUNT];
/* available bus requests */
struct ath10k_sdio_bus_request bus_req[ATH10K_SDIO_BUS_REQUEST_MAX_NUM];
/* free list of bus requests */
struct list_head bus_req_freeq;
/* protects access to bus_req_freeq */
spinlock_t lock;
struct ath10k_sdio_rx_data rx_pkts[ATH10K_SDIO_MAX_RX_MSGS];
size_t n_rx_pkts;
struct ath10k *ar;
struct ath10k_sdio_irq_data irq_data;
/* temporary buffer for BMI requests */
u8 *bmi_buf;
wait_queue_head_t irq_wq;
bool is_disabled;
struct workqueue_struct *workqueue;
struct work_struct wr_async_work;
struct list_head wr_asyncq;
/* protects access to wr_asyncq */
spinlock_t wr_async_lock;
};
static inline struct ath10k_sdio *ath10k_sdio_priv(struct ath10k *ar)
{
return (struct ath10k_sdio *)ar->drv_priv;
}
#endif
...@@ -205,6 +205,24 @@ struct host_interest { ...@@ -205,6 +205,24 @@ struct host_interest {
*/ */
/* Bit 1 - unused */ /* Bit 1 - unused */
u32 hi_fw_swap; /* 0x104 */ u32 hi_fw_swap; /* 0x104 */
/* global arenas pointer address, used by host driver debug */
u32 hi_dynamic_mem_arenas_addr; /* 0x108 */
/* allocated bytes of DRAM use by allocated */
u32 hi_dynamic_mem_allocated; /* 0x10C */
/* remaining bytes of DRAM */
u32 hi_dynamic_mem_remaining; /* 0x110 */
/* memory track count, configured by host */
u32 hi_dynamic_mem_track_max; /* 0x114 */
/* minidump buffer */
u32 hi_minidump; /* 0x118 */
/* bdata's sig and key addr */
u32 hi_bd_sig_key; /* 0x11c */
} __packed; } __packed;
#define HI_ITEM(item) offsetof(struct host_interest, item) #define HI_ITEM(item) offsetof(struct host_interest, item)
...@@ -319,6 +337,12 @@ struct host_interest { ...@@ -319,6 +337,12 @@ struct host_interest {
#define HI_ACS_FLAGS_USE_WWAN (1 << 1) #define HI_ACS_FLAGS_USE_WWAN (1 << 1)
/* Use test VAP */ /* Use test VAP */
#define HI_ACS_FLAGS_TEST_VAP (1 << 2) #define HI_ACS_FLAGS_TEST_VAP (1 << 2)
/* SDIO/mailbox ACS flag definitions */
#define HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_SET (1 << 0)
#define HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_SET (1 << 1)
#define HI_ACS_FLAGS_ALT_DATA_CREDIT_SIZE (1 << 2)
#define HI_ACS_FLAGS_SDIO_SWAP_MAILBOX_FW_ACK (1 << 16)
#define HI_ACS_FLAGS_SDIO_REDUCE_TX_COMPL_FW_ACK (1 << 17)
/* /*
* CONSOLE FLAGS * CONSOLE FLAGS
......
...@@ -137,6 +137,13 @@ static int ath10k_tm_cmd_get_version(struct ath10k *ar, struct nlattr *tb[]) ...@@ -137,6 +137,13 @@ static int ath10k_tm_cmd_get_version(struct ath10k *ar, struct nlattr *tb[])
return ret; return ret;
} }
ret = nla_put_u32(skb, ATH10K_TM_ATTR_WMI_OP_VERSION,
ar->normal_mode_fw.fw_file.wmi_op_version);
if (ret) {
kfree_skb(skb);
return ret;
}
return cfg80211_testmode_reply(skb); return cfg80211_testmode_reply(skb);
} }
......
...@@ -33,6 +33,7 @@ enum ath10k_tm_attr { ...@@ -33,6 +33,7 @@ enum ath10k_tm_attr {
ATH10K_TM_ATTR_WMI_CMDID = 3, ATH10K_TM_ATTR_WMI_CMDID = 3,
ATH10K_TM_ATTR_VERSION_MAJOR = 4, ATH10K_TM_ATTR_VERSION_MAJOR = 4,
ATH10K_TM_ATTR_VERSION_MINOR = 5, ATH10K_TM_ATTR_VERSION_MINOR = 5,
ATH10K_TM_ATTR_WMI_OP_VERSION = 6,
/* keep last */ /* keep last */
__ATH10K_TM_ATTR_AFTER_LAST, __ATH10K_TM_ATTR_AFTER_LAST,
......
...@@ -938,7 +938,10 @@ static int open_file_eeprom(struct inode *inode, struct file *file) ...@@ -938,7 +938,10 @@ static int open_file_eeprom(struct inode *inode, struct file *file)
} }
for (i = 0; i < eesize; ++i) { for (i = 0; i < eesize; ++i) {
AR5K_EEPROM_READ(i, val); if (!ath5k_hw_nvram_read(ah, i, &val)) {
ret = -EIO;
goto freebuf;
}
buf[i] = val; buf[i] = val;
} }
......
...@@ -399,15 +399,10 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -399,15 +399,10 @@ int ath6kl_data_tx(struct sk_buff *skb, struct net_device *dev)
csum_dest = skb->csum_offset + csum_start; csum_dest = skb->csum_offset + csum_start;
} }
if (skb_headroom(skb) < dev->needed_headroom) { if (skb_cow_head(skb, dev->needed_headroom)) {
struct sk_buff *tmp_skb = skb; dev->stats.tx_dropped++;
kfree_skb(skb);
skb = skb_realloc_headroom(skb, dev->needed_headroom); return 0;
kfree_skb(tmp_skb);
if (skb == NULL) {
dev->stats.tx_dropped++;
return 0;
}
} }
if (ath6kl_wmi_dix_2_dot3(ar->wmi, skb)) { if (ath6kl_wmi_dix_2_dot3(ar->wmi, skb)) {
......
...@@ -369,7 +369,7 @@ void ath9k_cmn_update_txpow(struct ath_hw *ah, u16 cur_txpow, ...@@ -369,7 +369,7 @@ void ath9k_cmn_update_txpow(struct ath_hw *ah, u16 cur_txpow,
{ {
struct ath_regulatory *reg = ath9k_hw_regulatory(ah); struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
if (reg->power_limit != new_txpow) if (ah->curchan && reg->power_limit != new_txpow)
ath9k_hw_set_txpowerlimit(ah, new_txpow, false); ath9k_hw_set_txpowerlimit(ah, new_txpow, false);
/* read back in case value is clamped */ /* read back in case value is clamped */
......
...@@ -143,7 +143,7 @@ bool ath9k_hw_nvram_read(struct ath_hw *ah, u32 off, u16 *data) ...@@ -143,7 +143,7 @@ bool ath9k_hw_nvram_read(struct ath_hw *ah, u32 off, u16 *data)
if (ah->eeprom_blob) if (ah->eeprom_blob)
ret = ath9k_hw_nvram_read_firmware(ah->eeprom_blob, off, data); ret = ath9k_hw_nvram_read_firmware(ah->eeprom_blob, off, data);
else if (pdata && !pdata->use_eeprom && pdata->eeprom_data) else if (pdata && !pdata->use_eeprom)
ret = ath9k_hw_nvram_read_pdata(pdata, off, data); ret = ath9k_hw_nvram_read_pdata(pdata, off, data);
else else
ret = common->bus_ops->eeprom_read(common, off, data); ret = common->bus_ops->eeprom_read(common, off, data);
......
...@@ -153,7 +153,7 @@ static int ath9k_tx99_init(struct ath_softc *sc) ...@@ -153,7 +153,7 @@ static int ath9k_tx99_init(struct ath_softc *sc)
sc->tx99_power, sc->tx99_power,
sc->tx99_power / 2); sc->tx99_power / 2);
/* We leave the harware awake as it will be chugging on */ /* We leave the hardware awake as it will be chugging on */
return 0; return 0;
} }
......
...@@ -795,15 +795,11 @@ static ssize_t wil_write_file_txmgmt(struct file *file, const char __user *buf, ...@@ -795,15 +795,11 @@ static ssize_t wil_write_file_txmgmt(struct file *file, const char __user *buf,
struct wireless_dev *wdev = wil_to_wdev(wil); struct wireless_dev *wdev = wil_to_wdev(wil);
struct cfg80211_mgmt_tx_params params; struct cfg80211_mgmt_tx_params params;
int rc; int rc;
void *frame = kmalloc(len, GFP_KERNEL); void *frame;
if (!frame) frame = memdup_user(buf, len);
return -ENOMEM; if (IS_ERR(frame))
return PTR_ERR(frame);
if (copy_from_user(frame, buf, len)) {
kfree(frame);
return -EIO;
}
params.buf = frame; params.buf = frame;
params.len = len; params.len = len;
......
...@@ -71,8 +71,18 @@ MODULE_FIRMWARE("b43/ucode11.fw"); ...@@ -71,8 +71,18 @@ MODULE_FIRMWARE("b43/ucode11.fw");
MODULE_FIRMWARE("b43/ucode13.fw"); MODULE_FIRMWARE("b43/ucode13.fw");
MODULE_FIRMWARE("b43/ucode14.fw"); MODULE_FIRMWARE("b43/ucode14.fw");
MODULE_FIRMWARE("b43/ucode15.fw"); MODULE_FIRMWARE("b43/ucode15.fw");
MODULE_FIRMWARE("b43/ucode16_lp.fw");
MODULE_FIRMWARE("b43/ucode16_mimo.fw"); MODULE_FIRMWARE("b43/ucode16_mimo.fw");
MODULE_FIRMWARE("b43/ucode24_lcn.fw");
MODULE_FIRMWARE("b43/ucode25_lcn.fw");
MODULE_FIRMWARE("b43/ucode25_mimo.fw");
MODULE_FIRMWARE("b43/ucode26_mimo.fw");
MODULE_FIRMWARE("b43/ucode29_mimo.fw");
MODULE_FIRMWARE("b43/ucode33_lcn40.fw");
MODULE_FIRMWARE("b43/ucode30_mimo.fw");
MODULE_FIRMWARE("b43/ucode5.fw"); MODULE_FIRMWARE("b43/ucode5.fw");
MODULE_FIRMWARE("b43/ucode40.fw");
MODULE_FIRMWARE("b43/ucode42.fw");
MODULE_FIRMWARE("b43/ucode9.fw"); MODULE_FIRMWARE("b43/ucode9.fw");
static int modparam_bad_frames_preempt; static int modparam_bad_frames_preempt;
......
...@@ -380,9 +380,7 @@ int brcmf_btcoex_attach(struct brcmf_cfg80211_info *cfg) ...@@ -380,9 +380,7 @@ int brcmf_btcoex_attach(struct brcmf_cfg80211_info *cfg)
/* Set up timer for BT */ /* Set up timer for BT */
btci->timer_on = false; btci->timer_on = false;
btci->timeout = BRCMF_BTCOEX_OPPR_WIN_TIME; btci->timeout = BRCMF_BTCOEX_OPPR_WIN_TIME;
init_timer(&btci->timer); setup_timer(&btci->timer, brcmf_btcoex_timerfunc, (ulong)btci);
btci->timer.data = (ulong)btci;
btci->timer.function = brcmf_btcoex_timerfunc;
btci->cfg = cfg; btci->cfg = cfg;
btci->saved_regs_part1 = false; btci->saved_regs_part1 = false;
btci->saved_regs_part2 = false; btci->saved_regs_part2 = false;
......
...@@ -4674,9 +4674,6 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) ...@@ -4674,9 +4674,6 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0); err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_AP, 0);
if (err < 0) if (err < 0)
brcmf_err("setting AP mode failed %d\n", err); brcmf_err("setting AP mode failed %d\n", err);
err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_INFRA, 0);
if (err < 0)
brcmf_err("setting INFRA mode failed %d\n", err);
if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS))
brcmf_fil_iovar_int_set(ifp, "mbss", 0); brcmf_fil_iovar_int_set(ifp, "mbss", 0);
brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY,
...@@ -6378,16 +6375,6 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp) ...@@ -6378,16 +6375,6 @@ static int brcmf_setup_ifmodes(struct wiphy *wiphy, struct brcmf_if *ifp)
return -ENOMEM; return -ENOMEM;
} }
static void brcmf_wiphy_pno_params(struct wiphy *wiphy)
{
/* scheduled scan settings */
wiphy->max_sched_scan_reqs = 1;
wiphy->max_sched_scan_ssids = BRCMF_PNO_MAX_PFN_COUNT;
wiphy->max_match_sets = BRCMF_PNO_MAX_PFN_COUNT;
wiphy->max_sched_scan_ie_len = BRCMF_SCAN_IE_LEN_MAX;
wiphy->max_sched_scan_plan_interval = BRCMF_PNO_SCHED_SCAN_MAX_PERIOD;
}
#ifdef CONFIG_PM #ifdef CONFIG_PM
static const struct wiphy_wowlan_support brcmf_wowlan_support = { static const struct wiphy_wowlan_support brcmf_wowlan_support = {
.flags = WIPHY_WOWLAN_MAGIC_PKT | WIPHY_WOWLAN_DISCONNECT, .flags = WIPHY_WOWLAN_MAGIC_PKT | WIPHY_WOWLAN_DISCONNECT,
...@@ -6434,6 +6421,7 @@ static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) ...@@ -6434,6 +6421,7 @@ static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp)
const struct ieee80211_iface_combination *combo; const struct ieee80211_iface_combination *combo;
struct ieee80211_supported_band *band; struct ieee80211_supported_band *band;
u16 max_interfaces = 0; u16 max_interfaces = 0;
bool gscan;
__le32 bandlist[3]; __le32 bandlist[3];
u32 n_bands; u32 n_bands;
int err, i; int err, i;
...@@ -6483,9 +6471,10 @@ static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp) ...@@ -6483,9 +6471,10 @@ static int brcmf_setup_wiphy(struct wiphy *wiphy, struct brcmf_if *ifp)
wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM; wiphy->flags |= WIPHY_FLAG_SUPPORTS_FW_ROAM;
wiphy->mgmt_stypes = brcmf_txrx_stypes; wiphy->mgmt_stypes = brcmf_txrx_stypes;
wiphy->max_remain_on_channel_duration = 5000; wiphy->max_remain_on_channel_duration = 5000;
if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_PNO)) if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_PNO)) {
brcmf_wiphy_pno_params(wiphy); gscan = brcmf_feat_is_enabled(ifp, BRCMF_FEAT_GSCAN);
brcmf_pno_wiphy_params(wiphy, gscan);
}
/* vendor commands/events support */ /* vendor commands/events support */
wiphy->vendor_commands = brcmf_vendor_cmds; wiphy->vendor_commands = brcmf_vendor_cmds;
wiphy->n_vendor_commands = BRCMF_VNDR_CMDS_LAST - 1; wiphy->n_vendor_commands = BRCMF_VNDR_CMDS_LAST - 1;
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include "fwil_types.h" #include "fwil_types.h"
#include "p2p.h" #include "p2p.h"
#define BRCMF_SCAN_IE_LEN_MAX 2048
#define WL_NUM_SCAN_MAX 10 #define WL_NUM_SCAN_MAX 10
#define WL_TLV_INFO_MAX 1024 #define WL_TLV_INFO_MAX 1024
#define WL_BSS_INFO_MAX 2048 #define WL_BSS_INFO_MAX 2048
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "feature.h" #include "feature.h"
#include "common.h" #include "common.h"
#define BRCMF_FW_UNSUPPORTED 23
/* /*
* expand feature list to array of feature strings. * expand feature list to array of feature strings.
...@@ -113,6 +114,22 @@ static void brcmf_feat_iovar_int_get(struct brcmf_if *ifp, ...@@ -113,6 +114,22 @@ static void brcmf_feat_iovar_int_get(struct brcmf_if *ifp,
} }
} }
static void brcmf_feat_iovar_data_set(struct brcmf_if *ifp,
enum brcmf_feat_id id, char *name,
const void *data, size_t len)
{
int err;
err = brcmf_fil_iovar_data_set(ifp, name, data, len);
if (err != -BRCMF_FW_UNSUPPORTED) {
brcmf_dbg(INFO, "enabling feature: %s\n", brcmf_feat_names[id]);
ifp->drvr->feat_flags |= BIT(id);
} else {
brcmf_dbg(TRACE, "%s feature check failed: %d\n",
brcmf_feat_names[id], err);
}
}
static void brcmf_feat_firmware_capabilities(struct brcmf_if *ifp) static void brcmf_feat_firmware_capabilities(struct brcmf_if *ifp)
{ {
char caps[256]; char caps[256];
...@@ -136,11 +153,14 @@ void brcmf_feat_attach(struct brcmf_pub *drvr) ...@@ -136,11 +153,14 @@ void brcmf_feat_attach(struct brcmf_pub *drvr)
{ {
struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0); struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0);
struct brcmf_pno_macaddr_le pfn_mac; struct brcmf_pno_macaddr_le pfn_mac;
struct brcmf_gscan_config gscan_cfg;
u32 wowl_cap; u32 wowl_cap;
s32 err; s32 err;
brcmf_feat_firmware_capabilities(ifp); brcmf_feat_firmware_capabilities(ifp);
memset(&gscan_cfg, 0, sizeof(gscan_cfg));
brcmf_feat_iovar_data_set(ifp, BRCMF_FEAT_GSCAN, "pfn_gscan_cfg",
&gscan_cfg, sizeof(gscan_cfg));
brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_PNO, "pfn"); brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_PNO, "pfn");
if (drvr->bus_if->wowl_supported) if (drvr->bus_if->wowl_supported)
brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_WOWL, "wowl"); brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_WOWL, "wowl");
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
* WOWL_GTK: (WOWL) GTK rekeying offload * WOWL_GTK: (WOWL) GTK rekeying offload
* WOWL_ARP_ND: ARP and Neighbor Discovery offload support during WOWL. * WOWL_ARP_ND: ARP and Neighbor Discovery offload support during WOWL.
* MFP: 802.11w Management Frame Protection. * MFP: 802.11w Management Frame Protection.
* GSCAN: enhanced scan offload feature.
*/ */
#define BRCMF_FEAT_LIST \ #define BRCMF_FEAT_LIST \
BRCMF_FEAT_DEF(MBSS) \ BRCMF_FEAT_DEF(MBSS) \
...@@ -44,7 +45,8 @@ ...@@ -44,7 +45,8 @@
BRCMF_FEAT_DEF(WOWL_ND) \ BRCMF_FEAT_DEF(WOWL_ND) \
BRCMF_FEAT_DEF(WOWL_GTK) \ BRCMF_FEAT_DEF(WOWL_GTK) \
BRCMF_FEAT_DEF(WOWL_ARP_ND) \ BRCMF_FEAT_DEF(WOWL_ARP_ND) \
BRCMF_FEAT_DEF(MFP) BRCMF_FEAT_DEF(MFP) \
BRCMF_FEAT_DEF(GSCAN)
/* /*
* Quirks: * Quirks:
......
...@@ -835,4 +835,63 @@ struct brcmf_gtk_keyinfo_le { ...@@ -835,4 +835,63 @@ struct brcmf_gtk_keyinfo_le {
u8 replay_counter[BRCMF_RSN_REPLAY_LEN]; u8 replay_counter[BRCMF_RSN_REPLAY_LEN];
}; };
/**
* struct brcmf_gscan_bucket_config - configuration data for channel bucket.
*
* @bucket_end_index: !unknown!
* @bucket_freq_multiple: !unknown!
* @flag: !unknown!
* @reserved: !unknown!
* @repeat: !unknown!
* @max_freq_multiple: !unknown!
*/
struct brcmf_gscan_bucket_config {
u8 bucket_end_index;
u8 bucket_freq_multiple;
u8 flag;
u8 reserved;
__le16 repeat;
__le16 max_freq_multiple;
};
/* version supported which must match firmware */
#define BRCMF_GSCAN_CFG_VERSION 1
/**
* enum brcmf_gscan_cfg_flags - bit values for gscan flags.
*
* @BRCMF_GSCAN_CFG_FLAGS_ALL_RESULTS: send probe responses/beacons to host.
* @BRCMF_GSCAN_CFG_FLAGS_CHANGE_ONLY: indicated only flags member is changed.
*/
enum brcmf_gscan_cfg_flags {
BRCMF_GSCAN_CFG_FLAGS_ALL_RESULTS = BIT(0),
BRCMF_GSCAN_CFG_FLAGS_CHANGE_ONLY = BIT(7),
};
/**
* struct brcmf_gscan_config - configuration data for gscan.
*
* @version: version of the api to match firmware.
* @flags: flags according %enum brcmf_gscan_cfg_flags.
* @buffer_threshold: percentage threshold of buffer to generate an event.
* @swc_nbssid_threshold: number of BSSIDs with significant change that
* will generate an event.
* @swc_rssi_window_size: size of rssi cache buffer (max=8).
* @count_of_channel_buckets: number of array members in @bucket.
* @retry_threshold: !unknown!
* @lost_ap_window: !unknown!
* @bucket: array of channel buckets.
*/
struct brcmf_gscan_config {
__le16 version;
u8 flags;
u8 buffer_threshold;
u8 swc_nbssid_threshold;
u8 swc_rssi_window_size;
u8 count_of_channel_buckets;
u8 retry_threshold;
__le16 lost_ap_window;
struct brcmf_gscan_bucket_config bucket[1];
};
#endif /* FWIL_TYPES_H_ */ #endif /* FWIL_TYPES_H_ */
...@@ -239,3 +239,13 @@ int brcmf_pno_start_sched_scan(struct brcmf_if *ifp, ...@@ -239,3 +239,13 @@ int brcmf_pno_start_sched_scan(struct brcmf_if *ifp,
return ret; return ret;
} }
void brcmf_pno_wiphy_params(struct wiphy *wiphy, bool gscan)
{
/* scheduled scan settings */
wiphy->max_sched_scan_reqs = gscan ? 2 : 1;
wiphy->max_sched_scan_ssids = BRCMF_PNO_MAX_PFN_COUNT;
wiphy->max_match_sets = BRCMF_PNO_MAX_PFN_COUNT;
wiphy->max_sched_scan_ie_len = BRCMF_SCAN_IE_LEN_MAX;
wiphy->max_sched_scan_plan_interval = BRCMF_PNO_SCHED_SCAN_MAX_PERIOD;
}
...@@ -37,4 +37,12 @@ int brcmf_pno_clean(struct brcmf_if *ifp); ...@@ -37,4 +37,12 @@ int brcmf_pno_clean(struct brcmf_if *ifp);
int brcmf_pno_start_sched_scan(struct brcmf_if *ifp, int brcmf_pno_start_sched_scan(struct brcmf_if *ifp,
struct cfg80211_sched_scan_request *req); struct cfg80211_sched_scan_request *req);
/**
* brcmf_pno_wiphy_params - fill scheduled scan parameters in wiphy instance.
*
* @wiphy: wiphy instance to be used.
* @gscan: indicates whether the device has support for g-scan feature.
*/
void brcmf_pno_wiphy_params(struct wiphy *wiphy, bool gscan);
#endif /* _BRCMF_PNO_H */ #endif /* _BRCMF_PNO_H */
...@@ -5147,6 +5147,8 @@ il_mac_config(struct ieee80211_hw *hw, u32 changed) ...@@ -5147,6 +5147,8 @@ il_mac_config(struct ieee80211_hw *hw, u32 changed)
if (changed & (IEEE80211_CONF_CHANGE_PS | IEEE80211_CONF_CHANGE_IDLE)) { if (changed & (IEEE80211_CONF_CHANGE_PS | IEEE80211_CONF_CHANGE_IDLE)) {
il->power_data.ps_disabled = !(conf->flags & IEEE80211_CONF_PS); il->power_data.ps_disabled = !(conf->flags & IEEE80211_CONF_PS);
if (!il->power_data.ps_disabled)
IL_WARN_ONCE("Enabling power save might cause firmware crashes\n");
ret = il_power_update_mode(il, false); ret = il_power_update_mode(il, false);
if (ret) if (ret)
D_MAC80211("Error setting sleep level\n"); D_MAC80211("Error setting sleep level\n");
......
...@@ -45,6 +45,7 @@ struct il_tx_queue; ...@@ -45,6 +45,7 @@ struct il_tx_queue;
#define IL_ERR(f, a...) dev_err(&il->pci_dev->dev, f, ## a) #define IL_ERR(f, a...) dev_err(&il->pci_dev->dev, f, ## a)
#define IL_WARN(f, a...) dev_warn(&il->pci_dev->dev, f, ## a) #define IL_WARN(f, a...) dev_warn(&il->pci_dev->dev, f, ## a)
#define IL_WARN_ONCE(f, a...) dev_warn_once(&il->pci_dev->dev, f, ## a)
#define IL_INFO(f, a...) dev_info(&il->pci_dev->dev, f, ## a) #define IL_INFO(f, a...) dev_info(&il->pci_dev->dev, f, ## a)
#define RX_QUEUE_SIZE 256 #define RX_QUEUE_SIZE 256
......
...@@ -190,7 +190,7 @@ static inline void __hostap_cmd_queue_free(local_info_t *local, ...@@ -190,7 +190,7 @@ static inline void __hostap_cmd_queue_free(local_info_t *local,
} }
} }
if (atomic_dec_and_test(&entry->usecnt) && entry->del_req) if (refcount_dec_and_test(&entry->usecnt) && entry->del_req)
kfree(entry); kfree(entry);
} }
...@@ -228,7 +228,7 @@ static void prism2_clear_cmd_queue(local_info_t *local) ...@@ -228,7 +228,7 @@ static void prism2_clear_cmd_queue(local_info_t *local)
spin_lock_irqsave(&local->cmdlock, flags); spin_lock_irqsave(&local->cmdlock, flags);
list_for_each_safe(ptr, n, &local->cmd_queue) { list_for_each_safe(ptr, n, &local->cmd_queue) {
entry = list_entry(ptr, struct hostap_cmd_queue, list); entry = list_entry(ptr, struct hostap_cmd_queue, list);
atomic_inc(&entry->usecnt); refcount_inc(&entry->usecnt);
printk(KERN_DEBUG "%s: removed pending cmd_queue entry " printk(KERN_DEBUG "%s: removed pending cmd_queue entry "
"(type=%d, cmd=0x%04x, param0=0x%04x)\n", "(type=%d, cmd=0x%04x, param0=0x%04x)\n",
local->dev->name, entry->type, entry->cmd, local->dev->name, entry->type, entry->cmd,
...@@ -350,7 +350,7 @@ static int hfa384x_cmd(struct net_device *dev, u16 cmd, u16 param0, ...@@ -350,7 +350,7 @@ static int hfa384x_cmd(struct net_device *dev, u16 cmd, u16 param0,
if (entry == NULL) if (entry == NULL)
return -ENOMEM; return -ENOMEM;
atomic_set(&entry->usecnt, 1); refcount_set(&entry->usecnt, 1);
entry->type = CMD_SLEEP; entry->type = CMD_SLEEP;
entry->cmd = cmd; entry->cmd = cmd;
entry->param0 = param0; entry->param0 = param0;
...@@ -516,7 +516,7 @@ static int hfa384x_cmd_callback(struct net_device *dev, u16 cmd, u16 param0, ...@@ -516,7 +516,7 @@ static int hfa384x_cmd_callback(struct net_device *dev, u16 cmd, u16 param0,
if (entry == NULL) if (entry == NULL)
return -ENOMEM; return -ENOMEM;
atomic_set(&entry->usecnt, 1); refcount_set(&entry->usecnt, 1);
entry->type = CMD_CALLBACK; entry->type = CMD_CALLBACK;
entry->cmd = cmd; entry->cmd = cmd;
entry->param0 = param0; entry->param0 = param0;
...@@ -666,7 +666,7 @@ static void prism2_cmd_ev(struct net_device *dev) ...@@ -666,7 +666,7 @@ static void prism2_cmd_ev(struct net_device *dev)
if (!list_empty(&local->cmd_queue)) { if (!list_empty(&local->cmd_queue)) {
entry = list_entry(local->cmd_queue.next, entry = list_entry(local->cmd_queue.next,
struct hostap_cmd_queue, list); struct hostap_cmd_queue, list);
atomic_inc(&entry->usecnt); refcount_inc(&entry->usecnt);
list_del_init(&entry->list); list_del_init(&entry->list);
local->cmd_queue_len--; local->cmd_queue_len--;
...@@ -718,7 +718,7 @@ static void prism2_cmd_ev(struct net_device *dev) ...@@ -718,7 +718,7 @@ static void prism2_cmd_ev(struct net_device *dev)
entry = NULL; entry = NULL;
} }
if (entry) if (entry)
atomic_inc(&entry->usecnt); refcount_inc(&entry->usecnt);
} }
spin_unlock(&local->cmdlock); spin_unlock(&local->cmdlock);
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/refcount.h>
#include <net/iw_handler.h> #include <net/iw_handler.h>
#include <net/ieee80211_radiotap.h> #include <net/ieee80211_radiotap.h>
#include <net/lib80211.h> #include <net/lib80211.h>
...@@ -557,7 +558,7 @@ struct hostap_cmd_queue { ...@@ -557,7 +558,7 @@ struct hostap_cmd_queue {
u16 resp0, res; u16 resp0, res;
volatile int issued, issuing; volatile int issued, issuing;
atomic_t usecnt; refcount_t usecnt;
int del_req; int del_req;
}; };
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/wireless.h> #include <linux/wireless.h>
#include <linux/firmware.h> #include <linux/firmware.h>
#include <linux/refcount.h>
#include "mic.h" #include "mic.h"
#include "orinoco.h" #include "orinoco.h"
...@@ -268,7 +269,7 @@ enum ezusb_state { ...@@ -268,7 +269,7 @@ enum ezusb_state {
struct request_context { struct request_context {
struct list_head list; struct list_head list;
atomic_t refcount; refcount_t refcount;
struct completion done; /* Signals that CTX is dead */ struct completion done; /* Signals that CTX is dead */
int killed; int killed;
struct urb *outurb; /* OUT for req pkt */ struct urb *outurb; /* OUT for req pkt */
...@@ -298,7 +299,7 @@ static inline u8 ezusb_reply_inc(u8 count) ...@@ -298,7 +299,7 @@ static inline u8 ezusb_reply_inc(u8 count)
static void ezusb_request_context_put(struct request_context *ctx) static void ezusb_request_context_put(struct request_context *ctx)
{ {
if (!atomic_dec_and_test(&ctx->refcount)) if (!refcount_dec_and_test(&ctx->refcount))
return; return;
WARN_ON(!ctx->done.done); WARN_ON(!ctx->done.done);
...@@ -328,7 +329,7 @@ static void ezusb_request_timerfn(u_long _ctx) ...@@ -328,7 +329,7 @@ static void ezusb_request_timerfn(u_long _ctx)
} else { } else {
ctx->state = EZUSB_CTX_RESP_TIMEOUT; ctx->state = EZUSB_CTX_RESP_TIMEOUT;
dev_dbg(&ctx->outurb->dev->dev, "couldn't unlink\n"); dev_dbg(&ctx->outurb->dev->dev, "couldn't unlink\n");
atomic_inc(&ctx->refcount); refcount_inc(&ctx->refcount);
ctx->killed = 1; ctx->killed = 1;
ezusb_ctx_complete(ctx); ezusb_ctx_complete(ctx);
ezusb_request_context_put(ctx); ezusb_request_context_put(ctx);
...@@ -361,7 +362,7 @@ static struct request_context *ezusb_alloc_ctx(struct ezusb_priv *upriv, ...@@ -361,7 +362,7 @@ static struct request_context *ezusb_alloc_ctx(struct ezusb_priv *upriv,
ctx->out_rid = out_rid; ctx->out_rid = out_rid;
ctx->in_rid = in_rid; ctx->in_rid = in_rid;
atomic_set(&ctx->refcount, 1); refcount_set(&ctx->refcount, 1);
init_completion(&ctx->done); init_completion(&ctx->done);
setup_timer(&ctx->timer, ezusb_request_timerfn, (u_long)ctx); setup_timer(&ctx->timer, ezusb_request_timerfn, (u_long)ctx);
...@@ -469,7 +470,7 @@ static void ezusb_req_queue_run(struct ezusb_priv *upriv) ...@@ -469,7 +470,7 @@ static void ezusb_req_queue_run(struct ezusb_priv *upriv)
list_move_tail(&ctx->list, &upriv->req_active); list_move_tail(&ctx->list, &upriv->req_active);
if (ctx->state == EZUSB_CTX_QUEUED) { if (ctx->state == EZUSB_CTX_QUEUED) {
atomic_inc(&ctx->refcount); refcount_inc(&ctx->refcount);
result = usb_submit_urb(ctx->outurb, GFP_ATOMIC); result = usb_submit_urb(ctx->outurb, GFP_ATOMIC);
if (result) { if (result) {
ctx->state = EZUSB_CTX_REQSUBMIT_FAIL; ctx->state = EZUSB_CTX_REQSUBMIT_FAIL;
...@@ -507,7 +508,7 @@ static void ezusb_req_enqueue_run(struct ezusb_priv *upriv, ...@@ -507,7 +508,7 @@ static void ezusb_req_enqueue_run(struct ezusb_priv *upriv,
spin_unlock_irqrestore(&upriv->req_lock, flags); spin_unlock_irqrestore(&upriv->req_lock, flags);
goto done; goto done;
} }
atomic_inc(&ctx->refcount); refcount_inc(&ctx->refcount);
list_add_tail(&ctx->list, &upriv->req_pending); list_add_tail(&ctx->list, &upriv->req_pending);
spin_unlock_irqrestore(&upriv->req_lock, flags); spin_unlock_irqrestore(&upriv->req_lock, flags);
...@@ -1477,7 +1478,7 @@ static inline void ezusb_delete(struct ezusb_priv *upriv) ...@@ -1477,7 +1478,7 @@ static inline void ezusb_delete(struct ezusb_priv *upriv)
int err; int err;
ctx = list_entry(item, struct request_context, list); ctx = list_entry(item, struct request_context, list);
atomic_inc(&ctx->refcount); refcount_inc(&ctx->refcount);
ctx->outurb->transfer_flags |= URB_ASYNC_UNLINK; ctx->outurb->transfer_flags |= URB_ASYNC_UNLINK;
err = usb_unlink_urb(ctx->outurb); err = usb_unlink_urb(ctx->outurb);
......
...@@ -176,8 +176,9 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw) ...@@ -176,8 +176,9 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)
* keeping a extra list for uploaded keys. * keeping a extra list for uploaded keys.
*/ */
priv->used_rxkeys = kzalloc(BITS_TO_LONGS( priv->used_rxkeys = kcalloc(BITS_TO_LONGS(priv->rx_keycache_size),
priv->rx_keycache_size), GFP_KERNEL); sizeof(long),
GFP_KERNEL);
if (!priv->used_rxkeys) if (!priv->used_rxkeys)
return -ENOMEM; return -ENOMEM;
......
...@@ -443,17 +443,12 @@ static int lbs_cfg_set_monitor_channel(struct wiphy *wiphy, ...@@ -443,17 +443,12 @@ static int lbs_cfg_set_monitor_channel(struct wiphy *wiphy,
struct lbs_private *priv = wiphy_priv(wiphy); struct lbs_private *priv = wiphy_priv(wiphy);
int ret = -ENOTSUPP; int ret = -ENOTSUPP;
lbs_deb_enter_args(LBS_DEB_CFG80211, "freq %d, type %d",
chandef->chan->center_freq,
cfg80211_get_chandef_type(chandef));
if (cfg80211_get_chandef_type(chandef) != NL80211_CHAN_NO_HT) if (cfg80211_get_chandef_type(chandef) != NL80211_CHAN_NO_HT)
goto out; goto out;
ret = lbs_set_channel(priv, chandef->chan->hw_value); ret = lbs_set_channel(priv, chandef->chan->hw_value);
out: out:
lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
return ret; return ret;
} }
...@@ -464,16 +459,12 @@ static int lbs_cfg_set_mesh_channel(struct wiphy *wiphy, ...@@ -464,16 +459,12 @@ static int lbs_cfg_set_mesh_channel(struct wiphy *wiphy,
struct lbs_private *priv = wiphy_priv(wiphy); struct lbs_private *priv = wiphy_priv(wiphy);
int ret = -ENOTSUPP; int ret = -ENOTSUPP;
lbs_deb_enter_args(LBS_DEB_CFG80211, "iface %s freq %d",
netdev_name(netdev), channel->center_freq);
if (netdev != priv->mesh_dev) if (netdev != priv->mesh_dev)
goto out; goto out;
ret = lbs_mesh_set_channel(priv, channel->hw_value); ret = lbs_mesh_set_channel(priv, channel->hw_value);
out: out:
lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
return ret; return ret;
} }
...@@ -512,8 +503,6 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy, ...@@ -512,8 +503,6 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy,
int i; int i;
int ret = -EILSEQ; int ret = -EILSEQ;
lbs_deb_enter(LBS_DEB_CFG80211);
bsssize = get_unaligned_le16(&scanresp->bssdescriptsize); bsssize = get_unaligned_le16(&scanresp->bssdescriptsize);
lbs_deb_scan("scan response: %d BSSs (%d bytes); resp size %d bytes\n", lbs_deb_scan("scan response: %d BSSs (%d bytes); resp size %d bytes\n",
...@@ -665,7 +654,6 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy, ...@@ -665,7 +654,6 @@ static int lbs_ret_scan(struct lbs_private *priv, unsigned long dummy,
ret = 0; ret = 0;
done: done:
lbs_deb_leave_args(LBS_DEB_SCAN, "ret %d", ret);
return ret; return ret;
} }
...@@ -693,11 +681,9 @@ static void lbs_scan_worker(struct work_struct *work) ...@@ -693,11 +681,9 @@ static void lbs_scan_worker(struct work_struct *work)
int last_channel; int last_channel;
int running, carrier; int running, carrier;
lbs_deb_enter(LBS_DEB_SCAN);
scan_cmd = kzalloc(LBS_SCAN_MAX_CMD_SIZE, GFP_KERNEL); scan_cmd = kzalloc(LBS_SCAN_MAX_CMD_SIZE, GFP_KERNEL);
if (scan_cmd == NULL) if (scan_cmd == NULL)
goto out_no_scan_cmd; return;
/* prepare fixed part of scan command */ /* prepare fixed part of scan command */
scan_cmd->bsstype = CMD_BSS_TYPE_ANY; scan_cmd->bsstype = CMD_BSS_TYPE_ANY;
...@@ -766,16 +752,11 @@ static void lbs_scan_worker(struct work_struct *work) ...@@ -766,16 +752,11 @@ static void lbs_scan_worker(struct work_struct *work)
lbs_deb_scan("scan: waking up waiters\n"); lbs_deb_scan("scan: waking up waiters\n");
wake_up_all(&priv->scan_q); wake_up_all(&priv->scan_q);
} }
out_no_scan_cmd:
lbs_deb_leave(LBS_DEB_SCAN);
} }
static void _internal_start_scan(struct lbs_private *priv, bool internal, static void _internal_start_scan(struct lbs_private *priv, bool internal,
struct cfg80211_scan_request *request) struct cfg80211_scan_request *request)
{ {
lbs_deb_enter(LBS_DEB_CFG80211);
lbs_deb_scan("scan: ssids %d, channels %d, ie_len %zd\n", lbs_deb_scan("scan: ssids %d, channels %d, ie_len %zd\n",
request->n_ssids, request->n_channels, request->ie_len); request->n_ssids, request->n_channels, request->ie_len);
...@@ -785,8 +766,6 @@ static void _internal_start_scan(struct lbs_private *priv, bool internal, ...@@ -785,8 +766,6 @@ static void _internal_start_scan(struct lbs_private *priv, bool internal,
queue_delayed_work(priv->work_thread, &priv->scan_work, queue_delayed_work(priv->work_thread, &priv->scan_work,
msecs_to_jiffies(50)); msecs_to_jiffies(50));
lbs_deb_leave(LBS_DEB_CFG80211);
} }
/* /*
...@@ -815,8 +794,6 @@ static int lbs_cfg_scan(struct wiphy *wiphy, ...@@ -815,8 +794,6 @@ static int lbs_cfg_scan(struct wiphy *wiphy,
struct lbs_private *priv = wiphy_priv(wiphy); struct lbs_private *priv = wiphy_priv(wiphy);
int ret = 0; int ret = 0;
lbs_deb_enter(LBS_DEB_CFG80211);
if (priv->scan_req || delayed_work_pending(&priv->scan_work)) { if (priv->scan_req || delayed_work_pending(&priv->scan_work)) {
/* old scan request not yet processed */ /* old scan request not yet processed */
ret = -EAGAIN; ret = -EAGAIN;
...@@ -829,7 +806,6 @@ static int lbs_cfg_scan(struct wiphy *wiphy, ...@@ -829,7 +806,6 @@ static int lbs_cfg_scan(struct wiphy *wiphy,
ret = -EIO; ret = -EIO;
out: out:
lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
return ret; return ret;
} }
...@@ -843,18 +819,12 @@ static int lbs_cfg_scan(struct wiphy *wiphy, ...@@ -843,18 +819,12 @@ static int lbs_cfg_scan(struct wiphy *wiphy,
void lbs_send_disconnect_notification(struct lbs_private *priv, void lbs_send_disconnect_notification(struct lbs_private *priv,
bool locally_generated) bool locally_generated)
{ {
lbs_deb_enter(LBS_DEB_CFG80211);
cfg80211_disconnected(priv->dev, 0, NULL, 0, locally_generated, cfg80211_disconnected(priv->dev, 0, NULL, 0, locally_generated,
GFP_KERNEL); GFP_KERNEL);
lbs_deb_leave(LBS_DEB_CFG80211);
} }
void lbs_send_mic_failureevent(struct lbs_private *priv, u32 event) void lbs_send_mic_failureevent(struct lbs_private *priv, u32 event)
{ {
lbs_deb_enter(LBS_DEB_CFG80211);
cfg80211_michael_mic_failure(priv->dev, cfg80211_michael_mic_failure(priv->dev,
priv->assoc_bss, priv->assoc_bss,
event == MACREG_INT_CODE_MIC_ERR_MULTICAST ? event == MACREG_INT_CODE_MIC_ERR_MULTICAST ?
...@@ -863,8 +833,6 @@ void lbs_send_mic_failureevent(struct lbs_private *priv, u32 event) ...@@ -863,8 +833,6 @@ void lbs_send_mic_failureevent(struct lbs_private *priv, u32 event)
-1, -1,
NULL, NULL,
GFP_KERNEL); GFP_KERNEL);
lbs_deb_leave(LBS_DEB_CFG80211);
} }
...@@ -883,8 +851,6 @@ static int lbs_remove_wep_keys(struct lbs_private *priv) ...@@ -883,8 +851,6 @@ static int lbs_remove_wep_keys(struct lbs_private *priv)
struct cmd_ds_802_11_set_wep cmd; struct cmd_ds_802_11_set_wep cmd;
int ret; int ret;
lbs_deb_enter(LBS_DEB_CFG80211);
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
cmd.hdr.size = cpu_to_le16(sizeof(cmd)); cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.keyindex = cpu_to_le16(priv->wep_tx_key); cmd.keyindex = cpu_to_le16(priv->wep_tx_key);
...@@ -892,7 +858,6 @@ static int lbs_remove_wep_keys(struct lbs_private *priv) ...@@ -892,7 +858,6 @@ static int lbs_remove_wep_keys(struct lbs_private *priv)
ret = lbs_cmd_with_response(priv, CMD_802_11_SET_WEP, &cmd); ret = lbs_cmd_with_response(priv, CMD_802_11_SET_WEP, &cmd);
lbs_deb_leave(LBS_DEB_CFG80211);
return ret; return ret;
} }
...@@ -905,8 +870,6 @@ static int lbs_set_wep_keys(struct lbs_private *priv) ...@@ -905,8 +870,6 @@ static int lbs_set_wep_keys(struct lbs_private *priv)
int i; int i;
int ret; int ret;
lbs_deb_enter(LBS_DEB_CFG80211);
/* /*
* command 13 00 * command 13 00
* size 50 00 * size 50 00
...@@ -956,7 +919,6 @@ static int lbs_set_wep_keys(struct lbs_private *priv) ...@@ -956,7 +919,6 @@ static int lbs_set_wep_keys(struct lbs_private *priv)
ret = lbs_remove_wep_keys(priv); ret = lbs_remove_wep_keys(priv);
} }
lbs_deb_leave(LBS_DEB_CFG80211);
return ret; return ret;
} }
...@@ -969,8 +931,6 @@ static int lbs_enable_rsn(struct lbs_private *priv, int enable) ...@@ -969,8 +931,6 @@ static int lbs_enable_rsn(struct lbs_private *priv, int enable)
struct cmd_ds_802_11_enable_rsn cmd; struct cmd_ds_802_11_enable_rsn cmd;
int ret; int ret;
lbs_deb_enter_args(LBS_DEB_CFG80211, "%d", enable);
/* /*
* cmd 2f 00 * cmd 2f 00
* size 0c 00 * size 0c 00
...@@ -986,7 +946,6 @@ static int lbs_enable_rsn(struct lbs_private *priv, int enable) ...@@ -986,7 +946,6 @@ static int lbs_enable_rsn(struct lbs_private *priv, int enable)
ret = lbs_cmd_with_response(priv, CMD_802_11_ENABLE_RSN, &cmd); ret = lbs_cmd_with_response(priv, CMD_802_11_ENABLE_RSN, &cmd);
lbs_deb_leave(LBS_DEB_CFG80211);
return ret; return ret;
} }
...@@ -1014,8 +973,6 @@ static int lbs_set_key_material(struct lbs_private *priv, ...@@ -1014,8 +973,6 @@ static int lbs_set_key_material(struct lbs_private *priv,
struct cmd_key_material cmd; struct cmd_key_material cmd;
int ret; int ret;
lbs_deb_enter(LBS_DEB_CFG80211);
/* /*
* Example for WPA (TKIP): * Example for WPA (TKIP):
* *
...@@ -1044,7 +1001,6 @@ static int lbs_set_key_material(struct lbs_private *priv, ...@@ -1044,7 +1001,6 @@ static int lbs_set_key_material(struct lbs_private *priv,
ret = lbs_cmd_with_response(priv, CMD_802_11_KEY_MATERIAL, &cmd); ret = lbs_cmd_with_response(priv, CMD_802_11_KEY_MATERIAL, &cmd);
lbs_deb_leave(LBS_DEB_CFG80211);
return ret; return ret;
} }
...@@ -1061,8 +1017,6 @@ static int lbs_set_authtype(struct lbs_private *priv, ...@@ -1061,8 +1017,6 @@ static int lbs_set_authtype(struct lbs_private *priv,
struct cmd_ds_802_11_authenticate cmd; struct cmd_ds_802_11_authenticate cmd;
int ret; int ret;
lbs_deb_enter_args(LBS_DEB_CFG80211, "%d", sme->auth_type);
/* /*
* cmd 11 00 * cmd 11 00
* size 19 00 * size 19 00
...@@ -1085,7 +1039,6 @@ static int lbs_set_authtype(struct lbs_private *priv, ...@@ -1085,7 +1039,6 @@ static int lbs_set_authtype(struct lbs_private *priv,
ret = lbs_cmd_with_response(priv, CMD_802_11_AUTHENTICATE, &cmd); ret = lbs_cmd_with_response(priv, CMD_802_11_AUTHENTICATE, &cmd);
done: done:
lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
return ret; return ret;
} }
...@@ -1116,8 +1069,6 @@ static int lbs_associate(struct lbs_private *priv, ...@@ -1116,8 +1069,6 @@ static int lbs_associate(struct lbs_private *priv,
u8 *pos; u8 *pos;
u8 *tmp; u8 *tmp;
lbs_deb_enter(LBS_DEB_CFG80211);
if (!cmd) { if (!cmd) {
ret = -ENOMEM; ret = -ENOMEM;
goto done; goto done;
...@@ -1262,7 +1213,6 @@ static int lbs_associate(struct lbs_private *priv, ...@@ -1262,7 +1213,6 @@ static int lbs_associate(struct lbs_private *priv,
kfree(cmd); kfree(cmd);
done: done:
lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
return ret; return ret;
} }
...@@ -1329,8 +1279,6 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -1329,8 +1279,6 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
if (dev == priv->mesh_dev) if (dev == priv->mesh_dev)
return -EOPNOTSUPP; return -EOPNOTSUPP;
lbs_deb_enter(LBS_DEB_CFG80211);
if (!sme->bssid) { if (!sme->bssid) {
struct cfg80211_scan_request *creq; struct cfg80211_scan_request *creq;
...@@ -1442,7 +1390,6 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev, ...@@ -1442,7 +1390,6 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
done: done:
if (bss) if (bss)
cfg80211_put_bss(wiphy, bss); cfg80211_put_bss(wiphy, bss);
lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
return ret; return ret;
} }
...@@ -1478,8 +1425,6 @@ static int lbs_cfg_disconnect(struct wiphy *wiphy, struct net_device *dev, ...@@ -1478,8 +1425,6 @@ static int lbs_cfg_disconnect(struct wiphy *wiphy, struct net_device *dev,
if (dev == priv->mesh_dev) if (dev == priv->mesh_dev)
return -EOPNOTSUPP; return -EOPNOTSUPP;
lbs_deb_enter_args(LBS_DEB_CFG80211, "reason_code %d", reason_code);
/* store for lbs_cfg_ret_disconnect() */ /* store for lbs_cfg_ret_disconnect() */
priv->disassoc_reason = reason_code; priv->disassoc_reason = reason_code;
...@@ -1496,8 +1441,6 @@ static int lbs_cfg_set_default_key(struct wiphy *wiphy, ...@@ -1496,8 +1441,6 @@ static int lbs_cfg_set_default_key(struct wiphy *wiphy,
if (netdev == priv->mesh_dev) if (netdev == priv->mesh_dev)
return -EOPNOTSUPP; return -EOPNOTSUPP;
lbs_deb_enter(LBS_DEB_CFG80211);
if (key_index != priv->wep_tx_key) { if (key_index != priv->wep_tx_key) {
lbs_deb_assoc("set_default_key: to %d\n", key_index); lbs_deb_assoc("set_default_key: to %d\n", key_index);
priv->wep_tx_key = key_index; priv->wep_tx_key = key_index;
...@@ -1520,8 +1463,6 @@ static int lbs_cfg_add_key(struct wiphy *wiphy, struct net_device *netdev, ...@@ -1520,8 +1463,6 @@ static int lbs_cfg_add_key(struct wiphy *wiphy, struct net_device *netdev,
if (netdev == priv->mesh_dev) if (netdev == priv->mesh_dev)
return -EOPNOTSUPP; return -EOPNOTSUPP;
lbs_deb_enter(LBS_DEB_CFG80211);
lbs_deb_assoc("add_key: cipher 0x%x, mac_addr %pM\n", lbs_deb_assoc("add_key: cipher 0x%x, mac_addr %pM\n",
params->cipher, mac_addr); params->cipher, mac_addr);
lbs_deb_assoc("add_key: key index %d, key len %d\n", lbs_deb_assoc("add_key: key index %d, key len %d\n",
...@@ -1575,8 +1516,6 @@ static int lbs_cfg_del_key(struct wiphy *wiphy, struct net_device *netdev, ...@@ -1575,8 +1516,6 @@ static int lbs_cfg_del_key(struct wiphy *wiphy, struct net_device *netdev,
u8 key_index, bool pairwise, const u8 *mac_addr) u8 key_index, bool pairwise, const u8 *mac_addr)
{ {
lbs_deb_enter(LBS_DEB_CFG80211);
lbs_deb_assoc("del_key: key_idx %d, mac_addr %pM\n", lbs_deb_assoc("del_key: key_idx %d, mac_addr %pM\n",
key_index, mac_addr); key_index, mac_addr);
...@@ -1619,8 +1558,6 @@ static int lbs_cfg_get_station(struct wiphy *wiphy, struct net_device *dev, ...@@ -1619,8 +1558,6 @@ static int lbs_cfg_get_station(struct wiphy *wiphy, struct net_device *dev,
int ret; int ret;
size_t i; size_t i;
lbs_deb_enter(LBS_DEB_CFG80211);
sinfo->filled |= BIT(NL80211_STA_INFO_TX_BYTES) | sinfo->filled |= BIT(NL80211_STA_INFO_TX_BYTES) |
BIT(NL80211_STA_INFO_TX_PACKETS) | BIT(NL80211_STA_INFO_TX_PACKETS) |
BIT(NL80211_STA_INFO_RX_BYTES) | BIT(NL80211_STA_INFO_RX_BYTES) |
...@@ -1675,15 +1612,12 @@ static int lbs_change_intf(struct wiphy *wiphy, struct net_device *dev, ...@@ -1675,15 +1612,12 @@ static int lbs_change_intf(struct wiphy *wiphy, struct net_device *dev,
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
lbs_deb_enter(LBS_DEB_CFG80211);
if (priv->iface_running) if (priv->iface_running)
ret = lbs_set_iface_type(priv, type); ret = lbs_set_iface_type(priv, type);
if (!ret) if (!ret)
priv->wdev->iftype = type; priv->wdev->iftype = type;
lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
return ret; return ret;
} }
...@@ -1713,8 +1647,6 @@ static void lbs_join_post(struct lbs_private *priv, ...@@ -1713,8 +1647,6 @@ static void lbs_join_post(struct lbs_private *priv,
u8 *fake = fake_ie; u8 *fake = fake_ie;
struct cfg80211_bss *bss; struct cfg80211_bss *bss;
lbs_deb_enter(LBS_DEB_CFG80211);
/* /*
* For cfg80211_inform_bss, we'll need a fake IE, as we can't get * For cfg80211_inform_bss, we'll need a fake IE, as we can't get
* the real IE from the firmware. So we fabricate a fake IE based on * the real IE from the firmware. So we fabricate a fake IE based on
...@@ -1777,8 +1709,6 @@ static void lbs_join_post(struct lbs_private *priv, ...@@ -1777,8 +1709,6 @@ static void lbs_join_post(struct lbs_private *priv,
netif_carrier_on(priv->dev); netif_carrier_on(priv->dev);
if (!priv->tx_pending_len) if (!priv->tx_pending_len)
netif_wake_queue(priv->dev); netif_wake_queue(priv->dev);
lbs_deb_leave(LBS_DEB_CFG80211);
} }
static int lbs_ibss_join_existing(struct lbs_private *priv, static int lbs_ibss_join_existing(struct lbs_private *priv,
...@@ -1790,8 +1720,6 @@ static int lbs_ibss_join_existing(struct lbs_private *priv, ...@@ -1790,8 +1720,6 @@ static int lbs_ibss_join_existing(struct lbs_private *priv,
u8 preamble = RADIO_PREAMBLE_SHORT; u8 preamble = RADIO_PREAMBLE_SHORT;
int ret = 0; int ret = 0;
lbs_deb_enter(LBS_DEB_CFG80211);
/* TODO: set preamble based on scan result */ /* TODO: set preamble based on scan result */
ret = lbs_set_radio(priv, preamble, 1); ret = lbs_set_radio(priv, preamble, 1);
if (ret) if (ret)
...@@ -1888,7 +1816,6 @@ static int lbs_ibss_join_existing(struct lbs_private *priv, ...@@ -1888,7 +1816,6 @@ static int lbs_ibss_join_existing(struct lbs_private *priv,
lbs_join_post(priv, params, bss->bssid, bss->capability); lbs_join_post(priv, params, bss->bssid, bss->capability);
out: out:
lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
return ret; return ret;
} }
...@@ -1904,8 +1831,6 @@ static int lbs_ibss_start_new(struct lbs_private *priv, ...@@ -1904,8 +1831,6 @@ static int lbs_ibss_start_new(struct lbs_private *priv,
int ret = 0; int ret = 0;
u16 capability; u16 capability;
lbs_deb_enter(LBS_DEB_CFG80211);
ret = lbs_set_radio(priv, preamble, 1); ret = lbs_set_radio(priv, preamble, 1);
if (ret) if (ret)
goto out; goto out;
...@@ -1975,7 +1900,6 @@ static int lbs_ibss_start_new(struct lbs_private *priv, ...@@ -1975,7 +1900,6 @@ static int lbs_ibss_start_new(struct lbs_private *priv,
lbs_join_post(priv, params, resp->bssid, capability); lbs_join_post(priv, params, resp->bssid, capability);
out: out:
lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
return ret; return ret;
} }
...@@ -1990,8 +1914,6 @@ static int lbs_join_ibss(struct wiphy *wiphy, struct net_device *dev, ...@@ -1990,8 +1914,6 @@ static int lbs_join_ibss(struct wiphy *wiphy, struct net_device *dev,
if (dev == priv->mesh_dev) if (dev == priv->mesh_dev)
return -EOPNOTSUPP; return -EOPNOTSUPP;
lbs_deb_enter(LBS_DEB_CFG80211);
if (!params->chandef.chan) { if (!params->chandef.chan) {
ret = -ENOTSUPP; ret = -ENOTSUPP;
goto out; goto out;
...@@ -2015,7 +1937,6 @@ static int lbs_join_ibss(struct wiphy *wiphy, struct net_device *dev, ...@@ -2015,7 +1937,6 @@ static int lbs_join_ibss(struct wiphy *wiphy, struct net_device *dev,
out: out:
lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
return ret; return ret;
} }
...@@ -2029,8 +1950,6 @@ static int lbs_leave_ibss(struct wiphy *wiphy, struct net_device *dev) ...@@ -2029,8 +1950,6 @@ static int lbs_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
if (dev == priv->mesh_dev) if (dev == priv->mesh_dev)
return -EOPNOTSUPP; return -EOPNOTSUPP;
lbs_deb_enter(LBS_DEB_CFG80211);
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
cmd.hdr.size = cpu_to_le16(sizeof(cmd)); cmd.hdr.size = cpu_to_le16(sizeof(cmd));
ret = lbs_cmd_with_response(priv, CMD_802_11_AD_HOC_STOP, &cmd); ret = lbs_cmd_with_response(priv, CMD_802_11_AD_HOC_STOP, &cmd);
...@@ -2038,7 +1957,6 @@ static int lbs_leave_ibss(struct wiphy *wiphy, struct net_device *dev) ...@@ -2038,7 +1957,6 @@ static int lbs_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
/* TODO: consider doing this at MACREG_INT_CODE_ADHOC_BCN_LOST time */ /* TODO: consider doing this at MACREG_INT_CODE_ADHOC_BCN_LOST time */
lbs_mac_event_disconnected(priv, true); lbs_mac_event_disconnected(priv, true);
lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
return ret; return ret;
} }
...@@ -2114,8 +2032,6 @@ struct wireless_dev *lbs_cfg_alloc(struct device *dev) ...@@ -2114,8 +2032,6 @@ struct wireless_dev *lbs_cfg_alloc(struct device *dev)
int ret = 0; int ret = 0;
struct wireless_dev *wdev; struct wireless_dev *wdev;
lbs_deb_enter(LBS_DEB_CFG80211);
wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL); wdev = kzalloc(sizeof(struct wireless_dev), GFP_KERNEL);
if (!wdev) if (!wdev)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
...@@ -2127,12 +2043,10 @@ struct wireless_dev *lbs_cfg_alloc(struct device *dev) ...@@ -2127,12 +2043,10 @@ struct wireless_dev *lbs_cfg_alloc(struct device *dev)
goto err_wiphy_new; goto err_wiphy_new;
} }
lbs_deb_leave(LBS_DEB_CFG80211);
return wdev; return wdev;
err_wiphy_new: err_wiphy_new:
kfree(wdev); kfree(wdev);
lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
...@@ -2155,15 +2069,11 @@ static void lbs_cfg_set_regulatory_hint(struct lbs_private *priv) ...@@ -2155,15 +2069,11 @@ static void lbs_cfg_set_regulatory_hint(struct lbs_private *priv)
}; };
size_t i; size_t i;
lbs_deb_enter(LBS_DEB_CFG80211);
for (i = 0; i < ARRAY_SIZE(regmap); i++) for (i = 0; i < ARRAY_SIZE(regmap); i++)
if (regmap[i].code == priv->regioncode) { if (regmap[i].code == priv->regioncode) {
regulatory_hint(priv->wdev->wiphy, regmap[i].cn); regulatory_hint(priv->wdev->wiphy, regmap[i].cn);
break; break;
} }
lbs_deb_leave(LBS_DEB_CFG80211);
} }
static void lbs_reg_notifier(struct wiphy *wiphy, static void lbs_reg_notifier(struct wiphy *wiphy,
...@@ -2171,15 +2081,9 @@ static void lbs_reg_notifier(struct wiphy *wiphy, ...@@ -2171,15 +2081,9 @@ static void lbs_reg_notifier(struct wiphy *wiphy,
{ {
struct lbs_private *priv = wiphy_priv(wiphy); struct lbs_private *priv = wiphy_priv(wiphy);
lbs_deb_enter_args(LBS_DEB_CFG80211, "cfg80211 regulatory domain "
"callback for domain %c%c\n", request->alpha2[0],
request->alpha2[1]);
memcpy(priv->country_code, request->alpha2, sizeof(request->alpha2)); memcpy(priv->country_code, request->alpha2, sizeof(request->alpha2));
if (lbs_iface_active(priv)) if (lbs_iface_active(priv))
lbs_set_11d_domain_info(priv); lbs_set_11d_domain_info(priv);
lbs_deb_leave(LBS_DEB_CFG80211);
} }
/* /*
...@@ -2192,8 +2096,6 @@ int lbs_cfg_register(struct lbs_private *priv) ...@@ -2192,8 +2096,6 @@ int lbs_cfg_register(struct lbs_private *priv)
struct wireless_dev *wdev = priv->wdev; struct wireless_dev *wdev = priv->wdev;
int ret; int ret;
lbs_deb_enter(LBS_DEB_CFG80211);
wdev->wiphy->max_scan_ssids = 1; wdev->wiphy->max_scan_ssids = 1;
wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; wdev->wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM;
...@@ -2229,13 +2131,11 @@ int lbs_cfg_register(struct lbs_private *priv) ...@@ -2229,13 +2131,11 @@ int lbs_cfg_register(struct lbs_private *priv)
lbs_cfg_set_regulatory_hint(priv); lbs_cfg_set_regulatory_hint(priv);
lbs_deb_leave_args(LBS_DEB_CFG80211, "ret %d", ret);
return ret; return ret;
} }
void lbs_scan_deinit(struct lbs_private *priv) void lbs_scan_deinit(struct lbs_private *priv)
{ {
lbs_deb_enter(LBS_DEB_CFG80211);
cancel_delayed_work_sync(&priv->scan_work); cancel_delayed_work_sync(&priv->scan_work);
} }
...@@ -2244,8 +2144,6 @@ void lbs_cfg_free(struct lbs_private *priv) ...@@ -2244,8 +2144,6 @@ void lbs_cfg_free(struct lbs_private *priv)
{ {
struct wireless_dev *wdev = priv->wdev; struct wireless_dev *wdev = priv->wdev;
lbs_deb_enter(LBS_DEB_CFG80211);
if (!wdev) if (!wdev)
return; return;
......
...@@ -91,8 +91,6 @@ int lbs_update_hw_spec(struct lbs_private *priv) ...@@ -91,8 +91,6 @@ int lbs_update_hw_spec(struct lbs_private *priv)
int ret = -1; int ret = -1;
u32 i; u32 i;
lbs_deb_enter(LBS_DEB_CMD);
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
cmd.hdr.size = cpu_to_le16(sizeof(cmd)); cmd.hdr.size = cpu_to_le16(sizeof(cmd));
memcpy(cmd.permanentaddr, priv->current_addr, ETH_ALEN); memcpy(cmd.permanentaddr, priv->current_addr, ETH_ALEN);
...@@ -159,14 +157,12 @@ int lbs_update_hw_spec(struct lbs_private *priv) ...@@ -159,14 +157,12 @@ int lbs_update_hw_spec(struct lbs_private *priv)
} }
out: out:
lbs_deb_leave(LBS_DEB_CMD);
return ret; return ret;
} }
static int lbs_ret_host_sleep_cfg(struct lbs_private *priv, unsigned long dummy, static int lbs_ret_host_sleep_cfg(struct lbs_private *priv, unsigned long dummy,
struct cmd_header *resp) struct cmd_header *resp)
{ {
lbs_deb_enter(LBS_DEB_CMD);
if (priv->is_host_sleep_activated) { if (priv->is_host_sleep_activated) {
priv->is_host_sleep_configured = 0; priv->is_host_sleep_configured = 0;
if (priv->psstate == PS_STATE_FULL_POWER) { if (priv->psstate == PS_STATE_FULL_POWER) {
...@@ -176,7 +172,7 @@ static int lbs_ret_host_sleep_cfg(struct lbs_private *priv, unsigned long dummy, ...@@ -176,7 +172,7 @@ static int lbs_ret_host_sleep_cfg(struct lbs_private *priv, unsigned long dummy,
} else { } else {
priv->is_host_sleep_configured = 1; priv->is_host_sleep_configured = 1;
} }
lbs_deb_leave(LBS_DEB_CMD);
return 0; return 0;
} }
...@@ -236,8 +232,6 @@ int lbs_set_ps_mode(struct lbs_private *priv, u16 cmd_action, bool block) ...@@ -236,8 +232,6 @@ int lbs_set_ps_mode(struct lbs_private *priv, u16 cmd_action, bool block)
struct cmd_ds_802_11_ps_mode cmd; struct cmd_ds_802_11_ps_mode cmd;
int ret = 0; int ret = 0;
lbs_deb_enter(LBS_DEB_CMD);
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
cmd.hdr.size = cpu_to_le16(sizeof(cmd)); cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(cmd_action); cmd.action = cpu_to_le16(cmd_action);
...@@ -262,7 +256,6 @@ int lbs_set_ps_mode(struct lbs_private *priv, u16 cmd_action, bool block) ...@@ -262,7 +256,6 @@ int lbs_set_ps_mode(struct lbs_private *priv, u16 cmd_action, bool block)
lbs_cmd_async(priv, CMD_802_11_PS_MODE, &cmd.hdr, sizeof (cmd)); lbs_cmd_async(priv, CMD_802_11_PS_MODE, &cmd.hdr, sizeof (cmd));
out: out:
lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
return ret; return ret;
} }
...@@ -272,8 +265,6 @@ int lbs_cmd_802_11_sleep_params(struct lbs_private *priv, uint16_t cmd_action, ...@@ -272,8 +265,6 @@ int lbs_cmd_802_11_sleep_params(struct lbs_private *priv, uint16_t cmd_action,
struct cmd_ds_802_11_sleep_params cmd; struct cmd_ds_802_11_sleep_params cmd;
int ret; int ret;
lbs_deb_enter(LBS_DEB_CMD);
if (cmd_action == CMD_ACT_GET) { if (cmd_action == CMD_ACT_GET) {
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
} else { } else {
...@@ -304,7 +295,6 @@ int lbs_cmd_802_11_sleep_params(struct lbs_private *priv, uint16_t cmd_action, ...@@ -304,7 +295,6 @@ int lbs_cmd_802_11_sleep_params(struct lbs_private *priv, uint16_t cmd_action,
sp->sp_reserved = le16_to_cpu(cmd.reserved); sp->sp_reserved = le16_to_cpu(cmd.reserved);
} }
lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
return ret; return ret;
} }
...@@ -312,8 +302,6 @@ static int lbs_wait_for_ds_awake(struct lbs_private *priv) ...@@ -312,8 +302,6 @@ static int lbs_wait_for_ds_awake(struct lbs_private *priv)
{ {
int ret = 0; int ret = 0;
lbs_deb_enter(LBS_DEB_CMD);
if (priv->is_deep_sleep) { if (priv->is_deep_sleep) {
if (!wait_event_interruptible_timeout(priv->ds_awake_q, if (!wait_event_interruptible_timeout(priv->ds_awake_q,
!priv->is_deep_sleep, (10 * HZ))) { !priv->is_deep_sleep, (10 * HZ))) {
...@@ -322,7 +310,6 @@ static int lbs_wait_for_ds_awake(struct lbs_private *priv) ...@@ -322,7 +310,6 @@ static int lbs_wait_for_ds_awake(struct lbs_private *priv)
} }
} }
lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
return ret; return ret;
} }
...@@ -330,8 +317,6 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep) ...@@ -330,8 +317,6 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep)
{ {
int ret = 0; int ret = 0;
lbs_deb_enter(LBS_DEB_CMD);
if (deep_sleep) { if (deep_sleep) {
if (priv->is_deep_sleep != 1) { if (priv->is_deep_sleep != 1) {
lbs_deb_cmd("deep sleep: sleep\n"); lbs_deb_cmd("deep sleep: sleep\n");
...@@ -358,7 +343,6 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep) ...@@ -358,7 +343,6 @@ int lbs_set_deep_sleep(struct lbs_private *priv, int deep_sleep)
} }
} }
lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
return ret; return ret;
} }
...@@ -366,10 +350,9 @@ static int lbs_ret_host_sleep_activate(struct lbs_private *priv, ...@@ -366,10 +350,9 @@ static int lbs_ret_host_sleep_activate(struct lbs_private *priv,
unsigned long dummy, unsigned long dummy,
struct cmd_header *cmd) struct cmd_header *cmd)
{ {
lbs_deb_enter(LBS_DEB_FW);
priv->is_host_sleep_activated = 1; priv->is_host_sleep_activated = 1;
wake_up_interruptible(&priv->host_sleep_q); wake_up_interruptible(&priv->host_sleep_q);
lbs_deb_leave(LBS_DEB_FW);
return 0; return 0;
} }
...@@ -379,8 +362,6 @@ int lbs_set_host_sleep(struct lbs_private *priv, int host_sleep) ...@@ -379,8 +362,6 @@ int lbs_set_host_sleep(struct lbs_private *priv, int host_sleep)
int ret = 0; int ret = 0;
uint32_t criteria = EHS_REMOVE_WAKEUP; uint32_t criteria = EHS_REMOVE_WAKEUP;
lbs_deb_enter(LBS_DEB_CMD);
if (host_sleep) { if (host_sleep) {
if (priv->is_host_sleep_activated != 1) { if (priv->is_host_sleep_activated != 1) {
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
...@@ -438,8 +419,6 @@ int lbs_set_snmp_mib(struct lbs_private *priv, u32 oid, u16 val) ...@@ -438,8 +419,6 @@ int lbs_set_snmp_mib(struct lbs_private *priv, u32 oid, u16 val)
struct cmd_ds_802_11_snmp_mib cmd; struct cmd_ds_802_11_snmp_mib cmd;
int ret; int ret;
lbs_deb_enter(LBS_DEB_CMD);
memset(&cmd, 0, sizeof (cmd)); memset(&cmd, 0, sizeof (cmd));
cmd.hdr.size = cpu_to_le16(sizeof(cmd)); cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(CMD_ACT_SET); cmd.action = cpu_to_le16(CMD_ACT_SET);
...@@ -470,7 +449,6 @@ int lbs_set_snmp_mib(struct lbs_private *priv, u32 oid, u16 val) ...@@ -470,7 +449,6 @@ int lbs_set_snmp_mib(struct lbs_private *priv, u32 oid, u16 val)
ret = lbs_cmd_with_response(priv, CMD_802_11_SNMP_MIB, &cmd); ret = lbs_cmd_with_response(priv, CMD_802_11_SNMP_MIB, &cmd);
out: out:
lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
return ret; return ret;
} }
...@@ -488,8 +466,6 @@ int lbs_get_snmp_mib(struct lbs_private *priv, u32 oid, u16 *out_val) ...@@ -488,8 +466,6 @@ int lbs_get_snmp_mib(struct lbs_private *priv, u32 oid, u16 *out_val)
struct cmd_ds_802_11_snmp_mib cmd; struct cmd_ds_802_11_snmp_mib cmd;
int ret; int ret;
lbs_deb_enter(LBS_DEB_CMD);
memset(&cmd, 0, sizeof (cmd)); memset(&cmd, 0, sizeof (cmd));
cmd.hdr.size = cpu_to_le16(sizeof(cmd)); cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(CMD_ACT_GET); cmd.action = cpu_to_le16(CMD_ACT_GET);
...@@ -513,7 +489,6 @@ int lbs_get_snmp_mib(struct lbs_private *priv, u32 oid, u16 *out_val) ...@@ -513,7 +489,6 @@ int lbs_get_snmp_mib(struct lbs_private *priv, u32 oid, u16 *out_val)
} }
out: out:
lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
return ret; return ret;
} }
...@@ -533,8 +508,6 @@ int lbs_get_tx_power(struct lbs_private *priv, s16 *curlevel, s16 *minlevel, ...@@ -533,8 +508,6 @@ int lbs_get_tx_power(struct lbs_private *priv, s16 *curlevel, s16 *minlevel,
struct cmd_ds_802_11_rf_tx_power cmd; struct cmd_ds_802_11_rf_tx_power cmd;
int ret; int ret;
lbs_deb_enter(LBS_DEB_CMD);
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
cmd.hdr.size = cpu_to_le16(sizeof(cmd)); cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(CMD_ACT_GET); cmd.action = cpu_to_le16(CMD_ACT_GET);
...@@ -548,7 +521,6 @@ int lbs_get_tx_power(struct lbs_private *priv, s16 *curlevel, s16 *minlevel, ...@@ -548,7 +521,6 @@ int lbs_get_tx_power(struct lbs_private *priv, s16 *curlevel, s16 *minlevel,
*maxlevel = cmd.maxlevel; *maxlevel = cmd.maxlevel;
} }
lbs_deb_leave(LBS_DEB_CMD);
return ret; return ret;
} }
...@@ -565,8 +537,6 @@ int lbs_set_tx_power(struct lbs_private *priv, s16 dbm) ...@@ -565,8 +537,6 @@ int lbs_set_tx_power(struct lbs_private *priv, s16 dbm)
struct cmd_ds_802_11_rf_tx_power cmd; struct cmd_ds_802_11_rf_tx_power cmd;
int ret; int ret;
lbs_deb_enter(LBS_DEB_CMD);
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
cmd.hdr.size = cpu_to_le16(sizeof(cmd)); cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(CMD_ACT_SET); cmd.action = cpu_to_le16(CMD_ACT_SET);
...@@ -576,7 +546,6 @@ int lbs_set_tx_power(struct lbs_private *priv, s16 dbm) ...@@ -576,7 +546,6 @@ int lbs_set_tx_power(struct lbs_private *priv, s16 dbm)
ret = lbs_cmd_with_response(priv, CMD_802_11_RF_TX_POWER, &cmd); ret = lbs_cmd_with_response(priv, CMD_802_11_RF_TX_POWER, &cmd);
lbs_deb_leave(LBS_DEB_CMD);
return ret; return ret;
} }
...@@ -608,7 +577,6 @@ int lbs_set_monitor_mode(struct lbs_private *priv, int enable) ...@@ -608,7 +577,6 @@ int lbs_set_monitor_mode(struct lbs_private *priv, int enable)
ARPHRD_ETHER; ARPHRD_ETHER;
} }
lbs_deb_leave(LBS_DEB_CMD);
return ret; return ret;
} }
...@@ -624,8 +592,6 @@ static int lbs_get_channel(struct lbs_private *priv) ...@@ -624,8 +592,6 @@ static int lbs_get_channel(struct lbs_private *priv)
struct cmd_ds_802_11_rf_channel cmd; struct cmd_ds_802_11_rf_channel cmd;
int ret = 0; int ret = 0;
lbs_deb_enter(LBS_DEB_CMD);
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
cmd.hdr.size = cpu_to_le16(sizeof(cmd)); cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_GET); cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_GET);
...@@ -638,7 +604,6 @@ static int lbs_get_channel(struct lbs_private *priv) ...@@ -638,7 +604,6 @@ static int lbs_get_channel(struct lbs_private *priv)
lbs_deb_cmd("current radio channel is %d\n", ret); lbs_deb_cmd("current radio channel is %d\n", ret);
out: out:
lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
return ret; return ret;
} }
...@@ -647,14 +612,12 @@ int lbs_update_channel(struct lbs_private *priv) ...@@ -647,14 +612,12 @@ int lbs_update_channel(struct lbs_private *priv)
int ret; int ret;
/* the channel in f/w could be out of sync; get the current channel */ /* the channel in f/w could be out of sync; get the current channel */
lbs_deb_enter(LBS_DEB_ASSOC);
ret = lbs_get_channel(priv); ret = lbs_get_channel(priv);
if (ret > 0) { if (ret > 0) {
priv->channel = ret; priv->channel = ret;
ret = 0; ret = 0;
} }
lbs_deb_leave_args(LBS_DEB_ASSOC, "ret %d", ret);
return ret; return ret;
} }
...@@ -674,8 +637,6 @@ int lbs_set_channel(struct lbs_private *priv, u8 channel) ...@@ -674,8 +637,6 @@ int lbs_set_channel(struct lbs_private *priv, u8 channel)
#endif #endif
int ret = 0; int ret = 0;
lbs_deb_enter(LBS_DEB_CMD);
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
cmd.hdr.size = cpu_to_le16(sizeof(cmd)); cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_SET); cmd.action = cpu_to_le16(CMD_OPT_802_11_RF_CHANNEL_SET);
...@@ -690,7 +651,6 @@ int lbs_set_channel(struct lbs_private *priv, u8 channel) ...@@ -690,7 +651,6 @@ int lbs_set_channel(struct lbs_private *priv, u8 channel)
priv->channel); priv->channel);
out: out:
lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
return ret; return ret;
} }
...@@ -708,8 +668,6 @@ int lbs_get_rssi(struct lbs_private *priv, s8 *rssi, s8 *nf) ...@@ -708,8 +668,6 @@ int lbs_get_rssi(struct lbs_private *priv, s8 *rssi, s8 *nf)
struct cmd_ds_802_11_rssi cmd; struct cmd_ds_802_11_rssi cmd;
int ret = 0; int ret = 0;
lbs_deb_enter(LBS_DEB_CMD);
BUG_ON(rssi == NULL); BUG_ON(rssi == NULL);
BUG_ON(nf == NULL); BUG_ON(nf == NULL);
...@@ -724,7 +682,6 @@ int lbs_get_rssi(struct lbs_private *priv, s8 *rssi, s8 *nf) ...@@ -724,7 +682,6 @@ int lbs_get_rssi(struct lbs_private *priv, s8 *rssi, s8 *nf)
*rssi = CAL_RSSI(le16_to_cpu(cmd.n_or_snr), le16_to_cpu(cmd.nf)); *rssi = CAL_RSSI(le16_to_cpu(cmd.n_or_snr), le16_to_cpu(cmd.nf));
} }
lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
return ret; return ret;
} }
...@@ -752,7 +709,6 @@ int lbs_set_11d_domain_info(struct lbs_private *priv) ...@@ -752,7 +709,6 @@ int lbs_set_11d_domain_info(struct lbs_private *priv)
size_t triplet_size; size_t triplet_size;
int ret = 0; int ret = 0;
lbs_deb_enter(LBS_DEB_11D);
if (!priv->country_code[0]) if (!priv->country_code[0])
goto out; goto out;
...@@ -849,7 +805,6 @@ int lbs_set_11d_domain_info(struct lbs_private *priv) ...@@ -849,7 +805,6 @@ int lbs_set_11d_domain_info(struct lbs_private *priv)
ret = lbs_cmd_with_response(priv, CMD_802_11D_DOMAIN_INFO, &cmd); ret = lbs_cmd_with_response(priv, CMD_802_11D_DOMAIN_INFO, &cmd);
out: out:
lbs_deb_leave_args(LBS_DEB_11D, "ret %d", ret);
return ret; return ret;
} }
...@@ -869,8 +824,6 @@ int lbs_get_reg(struct lbs_private *priv, u16 reg, u16 offset, u32 *value) ...@@ -869,8 +824,6 @@ int lbs_get_reg(struct lbs_private *priv, u16 reg, u16 offset, u32 *value)
struct cmd_ds_reg_access cmd; struct cmd_ds_reg_access cmd;
int ret = 0; int ret = 0;
lbs_deb_enter(LBS_DEB_CMD);
BUG_ON(value == NULL); BUG_ON(value == NULL);
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
...@@ -894,7 +847,6 @@ int lbs_get_reg(struct lbs_private *priv, u16 reg, u16 offset, u32 *value) ...@@ -894,7 +847,6 @@ int lbs_get_reg(struct lbs_private *priv, u16 reg, u16 offset, u32 *value)
} }
out: out:
lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
return ret; return ret;
} }
...@@ -914,8 +866,6 @@ int lbs_set_reg(struct lbs_private *priv, u16 reg, u16 offset, u32 value) ...@@ -914,8 +866,6 @@ int lbs_set_reg(struct lbs_private *priv, u16 reg, u16 offset, u32 value)
struct cmd_ds_reg_access cmd; struct cmd_ds_reg_access cmd;
int ret = 0; int ret = 0;
lbs_deb_enter(LBS_DEB_CMD);
memset(&cmd, 0, sizeof(cmd)); memset(&cmd, 0, sizeof(cmd));
cmd.hdr.size = cpu_to_le16(sizeof(cmd)); cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(CMD_ACT_SET); cmd.action = cpu_to_le16(CMD_ACT_SET);
...@@ -933,7 +883,6 @@ int lbs_set_reg(struct lbs_private *priv, u16 reg, u16 offset, u32 value) ...@@ -933,7 +883,6 @@ int lbs_set_reg(struct lbs_private *priv, u16 reg, u16 offset, u32 value)
ret = lbs_cmd_with_response(priv, reg, &cmd); ret = lbs_cmd_with_response(priv, reg, &cmd);
out: out:
lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
return ret; return ret;
} }
...@@ -943,15 +892,13 @@ static void lbs_queue_cmd(struct lbs_private *priv, ...@@ -943,15 +892,13 @@ static void lbs_queue_cmd(struct lbs_private *priv,
unsigned long flags; unsigned long flags;
int addtail = 1; int addtail = 1;
lbs_deb_enter(LBS_DEB_HOST);
if (!cmdnode) { if (!cmdnode) {
lbs_deb_host("QUEUE_CMD: cmdnode is NULL\n"); lbs_deb_host("QUEUE_CMD: cmdnode is NULL\n");
goto done; return;
} }
if (!cmdnode->cmdbuf->size) { if (!cmdnode->cmdbuf->size) {
lbs_deb_host("DNLD_CMD: cmd size is zero\n"); lbs_deb_host("DNLD_CMD: cmd size is zero\n");
goto done; return;
} }
cmdnode->result = 0; cmdnode->result = 0;
...@@ -979,9 +926,6 @@ static void lbs_queue_cmd(struct lbs_private *priv, ...@@ -979,9 +926,6 @@ static void lbs_queue_cmd(struct lbs_private *priv,
lbs_deb_host("QUEUE_CMD: inserted command 0x%04x into cmdpendingq\n", lbs_deb_host("QUEUE_CMD: inserted command 0x%04x into cmdpendingq\n",
le16_to_cpu(cmdnode->cmdbuf->command)); le16_to_cpu(cmdnode->cmdbuf->command));
done:
lbs_deb_leave(LBS_DEB_HOST);
} }
static void lbs_submit_command(struct lbs_private *priv, static void lbs_submit_command(struct lbs_private *priv,
...@@ -994,8 +938,6 @@ static void lbs_submit_command(struct lbs_private *priv, ...@@ -994,8 +938,6 @@ static void lbs_submit_command(struct lbs_private *priv,
int timeo = 3 * HZ; int timeo = 3 * HZ;
int ret; int ret;
lbs_deb_enter(LBS_DEB_HOST);
cmd = cmdnode->cmdbuf; cmd = cmdnode->cmdbuf;
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
...@@ -1036,8 +978,6 @@ static void lbs_submit_command(struct lbs_private *priv, ...@@ -1036,8 +978,6 @@ static void lbs_submit_command(struct lbs_private *priv,
/* Setup the timer after transmit command */ /* Setup the timer after transmit command */
mod_timer(&priv->command_timer, jiffies + timeo); mod_timer(&priv->command_timer, jiffies + timeo);
} }
lbs_deb_leave(LBS_DEB_HOST);
} }
/* /*
...@@ -1047,10 +987,8 @@ static void lbs_submit_command(struct lbs_private *priv, ...@@ -1047,10 +987,8 @@ static void lbs_submit_command(struct lbs_private *priv,
static void __lbs_cleanup_and_insert_cmd(struct lbs_private *priv, static void __lbs_cleanup_and_insert_cmd(struct lbs_private *priv,
struct cmd_ctrl_node *cmdnode) struct cmd_ctrl_node *cmdnode)
{ {
lbs_deb_enter(LBS_DEB_HOST);
if (!cmdnode) if (!cmdnode)
goto out; return;
cmdnode->callback = NULL; cmdnode->callback = NULL;
cmdnode->callback_arg = 0; cmdnode->callback_arg = 0;
...@@ -1058,8 +996,6 @@ static void __lbs_cleanup_and_insert_cmd(struct lbs_private *priv, ...@@ -1058,8 +996,6 @@ static void __lbs_cleanup_and_insert_cmd(struct lbs_private *priv,
memset(cmdnode->cmdbuf, 0, LBS_CMD_BUFFER_SIZE); memset(cmdnode->cmdbuf, 0, LBS_CMD_BUFFER_SIZE);
list_add_tail(&cmdnode->list, &priv->cmdfreeq); list_add_tail(&cmdnode->list, &priv->cmdfreeq);
out:
lbs_deb_leave(LBS_DEB_HOST);
} }
static void lbs_cleanup_and_insert_cmd(struct lbs_private *priv, static void lbs_cleanup_and_insert_cmd(struct lbs_private *priv,
...@@ -1107,8 +1043,6 @@ int lbs_set_radio(struct lbs_private *priv, u8 preamble, u8 radio_on) ...@@ -1107,8 +1043,6 @@ int lbs_set_radio(struct lbs_private *priv, u8 preamble, u8 radio_on)
struct cmd_ds_802_11_radio_control cmd; struct cmd_ds_802_11_radio_control cmd;
int ret = -EINVAL; int ret = -EINVAL;
lbs_deb_enter(LBS_DEB_CMD);
cmd.hdr.size = cpu_to_le16(sizeof(cmd)); cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(CMD_ACT_SET); cmd.action = cpu_to_le16(CMD_ACT_SET);
cmd.control = 0; cmd.control = 0;
...@@ -1141,7 +1075,6 @@ int lbs_set_radio(struct lbs_private *priv, u8 preamble, u8 radio_on) ...@@ -1141,7 +1075,6 @@ int lbs_set_radio(struct lbs_private *priv, u8 preamble, u8 radio_on)
ret = lbs_cmd_with_response(priv, CMD_802_11_RADIO_CONTROL, &cmd); ret = lbs_cmd_with_response(priv, CMD_802_11_RADIO_CONTROL, &cmd);
out: out:
lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
return ret; return ret;
} }
...@@ -1149,15 +1082,11 @@ void lbs_set_mac_control(struct lbs_private *priv) ...@@ -1149,15 +1082,11 @@ void lbs_set_mac_control(struct lbs_private *priv)
{ {
struct cmd_ds_mac_control cmd; struct cmd_ds_mac_control cmd;
lbs_deb_enter(LBS_DEB_CMD);
cmd.hdr.size = cpu_to_le16(sizeof(cmd)); cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(priv->mac_control); cmd.action = cpu_to_le16(priv->mac_control);
cmd.reserved = 0; cmd.reserved = 0;
lbs_cmd_async(priv, CMD_MAC_CONTROL, &cmd.hdr, sizeof(cmd)); lbs_cmd_async(priv, CMD_MAC_CONTROL, &cmd.hdr, sizeof(cmd));
lbs_deb_leave(LBS_DEB_CMD);
} }
int lbs_set_mac_control_sync(struct lbs_private *priv) int lbs_set_mac_control_sync(struct lbs_private *priv)
...@@ -1165,14 +1094,11 @@ int lbs_set_mac_control_sync(struct lbs_private *priv) ...@@ -1165,14 +1094,11 @@ int lbs_set_mac_control_sync(struct lbs_private *priv)
struct cmd_ds_mac_control cmd; struct cmd_ds_mac_control cmd;
int ret = 0; int ret = 0;
lbs_deb_enter(LBS_DEB_CMD);
cmd.hdr.size = cpu_to_le16(sizeof(cmd)); cmd.hdr.size = cpu_to_le16(sizeof(cmd));
cmd.action = cpu_to_le16(priv->mac_control); cmd.action = cpu_to_le16(priv->mac_control);
cmd.reserved = 0; cmd.reserved = 0;
ret = lbs_cmd_with_response(priv, CMD_MAC_CONTROL, &cmd); ret = lbs_cmd_with_response(priv, CMD_MAC_CONTROL, &cmd);
lbs_deb_leave(LBS_DEB_CMD);
return ret; return ret;
} }
...@@ -1191,8 +1117,6 @@ int lbs_allocate_cmd_buffer(struct lbs_private *priv) ...@@ -1191,8 +1117,6 @@ int lbs_allocate_cmd_buffer(struct lbs_private *priv)
u32 i; u32 i;
struct cmd_ctrl_node *cmdarray; struct cmd_ctrl_node *cmdarray;
lbs_deb_enter(LBS_DEB_HOST);
/* Allocate and initialize the command array */ /* Allocate and initialize the command array */
bufsize = sizeof(struct cmd_ctrl_node) * LBS_NUM_CMD_BUFFERS; bufsize = sizeof(struct cmd_ctrl_node) * LBS_NUM_CMD_BUFFERS;
if (!(cmdarray = kzalloc(bufsize, GFP_KERNEL))) { if (!(cmdarray = kzalloc(bufsize, GFP_KERNEL))) {
...@@ -1219,7 +1143,6 @@ int lbs_allocate_cmd_buffer(struct lbs_private *priv) ...@@ -1219,7 +1143,6 @@ int lbs_allocate_cmd_buffer(struct lbs_private *priv)
ret = 0; ret = 0;
done: done:
lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret);
return ret; return ret;
} }
...@@ -1235,8 +1158,6 @@ int lbs_free_cmd_buffer(struct lbs_private *priv) ...@@ -1235,8 +1158,6 @@ int lbs_free_cmd_buffer(struct lbs_private *priv)
struct cmd_ctrl_node *cmdarray; struct cmd_ctrl_node *cmdarray;
unsigned int i; unsigned int i;
lbs_deb_enter(LBS_DEB_HOST);
/* need to check if cmd array is allocated or not */ /* need to check if cmd array is allocated or not */
if (priv->cmd_array == NULL) { if (priv->cmd_array == NULL) {
lbs_deb_host("FREE_CMD_BUF: cmd_array is NULL\n"); lbs_deb_host("FREE_CMD_BUF: cmd_array is NULL\n");
...@@ -1260,7 +1181,6 @@ int lbs_free_cmd_buffer(struct lbs_private *priv) ...@@ -1260,7 +1181,6 @@ int lbs_free_cmd_buffer(struct lbs_private *priv)
} }
done: done:
lbs_deb_leave(LBS_DEB_HOST);
return 0; return 0;
} }
...@@ -1278,8 +1198,6 @@ static struct cmd_ctrl_node *lbs_get_free_cmd_node(struct lbs_private *priv) ...@@ -1278,8 +1198,6 @@ static struct cmd_ctrl_node *lbs_get_free_cmd_node(struct lbs_private *priv)
struct cmd_ctrl_node *tempnode; struct cmd_ctrl_node *tempnode;
unsigned long flags; unsigned long flags;
lbs_deb_enter(LBS_DEB_HOST);
if (!priv) if (!priv)
return NULL; return NULL;
...@@ -1296,7 +1214,6 @@ static struct cmd_ctrl_node *lbs_get_free_cmd_node(struct lbs_private *priv) ...@@ -1296,7 +1214,6 @@ static struct cmd_ctrl_node *lbs_get_free_cmd_node(struct lbs_private *priv)
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
lbs_deb_leave(LBS_DEB_HOST);
return tempnode; return tempnode;
} }
...@@ -1318,8 +1235,6 @@ int lbs_execute_next_command(struct lbs_private *priv) ...@@ -1318,8 +1235,6 @@ int lbs_execute_next_command(struct lbs_private *priv)
/* Debug group is LBS_DEB_THREAD and not LBS_DEB_HOST, because the /* Debug group is LBS_DEB_THREAD and not LBS_DEB_HOST, because the
* only caller to us is lbs_thread() and we get even when a * only caller to us is lbs_thread() and we get even when a
* data packet is received */ * data packet is received */
lbs_deb_enter(LBS_DEB_THREAD);
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
if (priv->cur_cmd) { if (priv->cur_cmd) {
...@@ -1440,7 +1355,6 @@ int lbs_execute_next_command(struct lbs_private *priv) ...@@ -1440,7 +1355,6 @@ int lbs_execute_next_command(struct lbs_private *priv)
ret = 0; ret = 0;
done: done:
lbs_deb_leave(LBS_DEB_THREAD);
return ret; return ret;
} }
...@@ -1449,7 +1363,6 @@ static void lbs_send_confirmsleep(struct lbs_private *priv) ...@@ -1449,7 +1363,6 @@ static void lbs_send_confirmsleep(struct lbs_private *priv)
unsigned long flags; unsigned long flags;
int ret; int ret;
lbs_deb_enter(LBS_DEB_HOST);
lbs_deb_hex(LBS_DEB_HOST, "sleep confirm", (u8 *) &confirm_sleep, lbs_deb_hex(LBS_DEB_HOST, "sleep confirm", (u8 *) &confirm_sleep,
sizeof(confirm_sleep)); sizeof(confirm_sleep));
...@@ -1457,7 +1370,7 @@ static void lbs_send_confirmsleep(struct lbs_private *priv) ...@@ -1457,7 +1370,7 @@ static void lbs_send_confirmsleep(struct lbs_private *priv)
sizeof(confirm_sleep)); sizeof(confirm_sleep));
if (ret) { if (ret) {
netdev_alert(priv->dev, "confirm_sleep failed\n"); netdev_alert(priv->dev, "confirm_sleep failed\n");
goto out; return;
} }
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
...@@ -1475,9 +1388,6 @@ static void lbs_send_confirmsleep(struct lbs_private *priv) ...@@ -1475,9 +1388,6 @@ static void lbs_send_confirmsleep(struct lbs_private *priv)
priv->psstate = PS_STATE_SLEEP; priv->psstate = PS_STATE_SLEEP;
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
out:
lbs_deb_leave(LBS_DEB_HOST);
} }
/** /**
...@@ -1493,8 +1403,6 @@ void lbs_ps_confirm_sleep(struct lbs_private *priv) ...@@ -1493,8 +1403,6 @@ void lbs_ps_confirm_sleep(struct lbs_private *priv)
unsigned long flags =0; unsigned long flags =0;
int allowed = 1; int allowed = 1;
lbs_deb_enter(LBS_DEB_HOST);
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
if (priv->dnld_sent) { if (priv->dnld_sent) {
allowed = 0; allowed = 0;
...@@ -1520,8 +1428,6 @@ void lbs_ps_confirm_sleep(struct lbs_private *priv) ...@@ -1520,8 +1428,6 @@ void lbs_ps_confirm_sleep(struct lbs_private *priv)
} else { } else {
lbs_deb_host("sleep confirm has been delayed\n"); lbs_deb_host("sleep confirm has been delayed\n");
} }
lbs_deb_leave(LBS_DEB_HOST);
} }
...@@ -1596,8 +1502,6 @@ struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv, ...@@ -1596,8 +1502,6 @@ struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv,
{ {
struct cmd_ctrl_node *cmdnode; struct cmd_ctrl_node *cmdnode;
lbs_deb_enter(LBS_DEB_HOST);
if (priv->surpriseremoved) { if (priv->surpriseremoved) {
lbs_deb_host("PREP_CMD: card removed\n"); lbs_deb_host("PREP_CMD: card removed\n");
cmdnode = ERR_PTR(-ENOENT); cmdnode = ERR_PTR(-ENOENT);
...@@ -1643,17 +1547,14 @@ struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv, ...@@ -1643,17 +1547,14 @@ struct cmd_ctrl_node *__lbs_cmd_async(struct lbs_private *priv,
wake_up(&priv->waitq); wake_up(&priv->waitq);
done: done:
lbs_deb_leave_args(LBS_DEB_HOST, "ret %p", cmdnode);
return cmdnode; return cmdnode;
} }
void lbs_cmd_async(struct lbs_private *priv, uint16_t command, void lbs_cmd_async(struct lbs_private *priv, uint16_t command,
struct cmd_header *in_cmd, int in_cmd_size) struct cmd_header *in_cmd, int in_cmd_size)
{ {
lbs_deb_enter(LBS_DEB_CMD);
__lbs_cmd_async(priv, command, in_cmd, in_cmd_size, __lbs_cmd_async(priv, command, in_cmd, in_cmd_size,
lbs_cmd_async_callback, 0); lbs_cmd_async_callback, 0);
lbs_deb_leave(LBS_DEB_CMD);
} }
int __lbs_cmd(struct lbs_private *priv, uint16_t command, int __lbs_cmd(struct lbs_private *priv, uint16_t command,
...@@ -1665,8 +1566,6 @@ int __lbs_cmd(struct lbs_private *priv, uint16_t command, ...@@ -1665,8 +1566,6 @@ int __lbs_cmd(struct lbs_private *priv, uint16_t command,
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
lbs_deb_enter(LBS_DEB_HOST);
cmdnode = __lbs_cmd_async(priv, command, in_cmd, in_cmd_size, cmdnode = __lbs_cmd_async(priv, command, in_cmd, in_cmd_size,
callback, callback_arg); callback, callback_arg);
if (IS_ERR(cmdnode)) { if (IS_ERR(cmdnode)) {
...@@ -1693,7 +1592,6 @@ int __lbs_cmd(struct lbs_private *priv, uint16_t command, ...@@ -1693,7 +1592,6 @@ int __lbs_cmd(struct lbs_private *priv, uint16_t command,
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
done: done:
lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(__lbs_cmd); EXPORT_SYMBOL_GPL(__lbs_cmd);
...@@ -32,8 +32,6 @@ void lbs_mac_event_disconnected(struct lbs_private *priv, ...@@ -32,8 +32,6 @@ void lbs_mac_event_disconnected(struct lbs_private *priv,
if (priv->connect_status != LBS_CONNECTED) if (priv->connect_status != LBS_CONNECTED)
return; return;
lbs_deb_enter(LBS_DEB_ASSOC);
/* /*
* Cisco AP sends EAP failure and de-auth in less than 0.5 ms. * Cisco AP sends EAP failure and de-auth in less than 0.5 ms.
* It causes problem in the Supplicant * It causes problem in the Supplicant
...@@ -61,7 +59,6 @@ void lbs_mac_event_disconnected(struct lbs_private *priv, ...@@ -61,7 +59,6 @@ void lbs_mac_event_disconnected(struct lbs_private *priv,
lbs_deb_cmd("disconnected, so exit PS mode\n"); lbs_deb_cmd("disconnected, so exit PS mode\n");
lbs_set_ps_mode(priv, PS_MODE_ACTION_EXIT_PS, false); lbs_set_ps_mode(priv, PS_MODE_ACTION_EXIT_PS, false);
} }
lbs_deb_leave(LBS_DEB_ASSOC);
} }
int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len) int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
...@@ -72,8 +69,6 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len) ...@@ -72,8 +69,6 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
unsigned long flags; unsigned long flags;
uint16_t result; uint16_t result;
lbs_deb_enter(LBS_DEB_HOST);
mutex_lock(&priv->lock); mutex_lock(&priv->lock);
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
...@@ -221,7 +216,6 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len) ...@@ -221,7 +216,6 @@ int lbs_process_command_response(struct lbs_private *priv, u8 *data, u32 len)
done: done:
mutex_unlock(&priv->lock); mutex_unlock(&priv->lock);
lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret);
return ret; return ret;
} }
...@@ -230,8 +224,6 @@ int lbs_process_event(struct lbs_private *priv, u32 event) ...@@ -230,8 +224,6 @@ int lbs_process_event(struct lbs_private *priv, u32 event)
int ret = 0; int ret = 0;
struct cmd_header cmd; struct cmd_header cmd;
lbs_deb_enter(LBS_DEB_CMD);
switch (event) { switch (event) {
case MACREG_INT_CODE_LINK_SENSED: case MACREG_INT_CODE_LINK_SENSED:
lbs_deb_cmd("EVENT: link sensed\n"); lbs_deb_cmd("EVENT: link sensed\n");
...@@ -359,6 +351,5 @@ int lbs_process_event(struct lbs_private *priv, u32 event) ...@@ -359,6 +351,5 @@ int lbs_process_event(struct lbs_private *priv, u32 event)
break; break;
} }
lbs_deb_leave_args(LBS_DEB_CMD, "ret %d", ret);
return ret; return ret;
} }
...@@ -55,15 +55,6 @@ do { if ((lbs_debug & (grp)) == (grp)) \ ...@@ -55,15 +55,6 @@ do { if ((lbs_debug & (grp)) == (grp)) \
#define LBS_DEB_LL(grp, grpnam, fmt, args...) do {} while (0) #define LBS_DEB_LL(grp, grpnam, fmt, args...) do {} while (0)
#endif #endif
#define lbs_deb_enter(grp) \
LBS_DEB_LL(grp | LBS_DEB_ENTER, " enter", "%s()\n", __func__);
#define lbs_deb_enter_args(grp, fmt, args...) \
LBS_DEB_LL(grp | LBS_DEB_ENTER, " enter", "%s(" fmt ")\n", __func__, ## args);
#define lbs_deb_leave(grp) \
LBS_DEB_LL(grp | LBS_DEB_LEAVE, " leave", "%s()\n", __func__);
#define lbs_deb_leave_args(grp, fmt, args...) \
LBS_DEB_LL(grp | LBS_DEB_LEAVE, " leave", "%s(), " fmt "\n", \
__func__, ##args);
#define lbs_deb_main(fmt, args...) LBS_DEB_LL(LBS_DEB_MAIN, " main", fmt, ##args) #define lbs_deb_main(fmt, args...) LBS_DEB_LL(LBS_DEB_MAIN, " main", fmt, ##args)
#define lbs_deb_net(fmt, args...) LBS_DEB_LL(LBS_DEB_NET, " net", fmt, ##args) #define lbs_deb_net(fmt, args...) LBS_DEB_LL(LBS_DEB_NET, " net", fmt, ##args)
#define lbs_deb_mesh(fmt, args...) LBS_DEB_LL(LBS_DEB_MESH, " mesh", fmt, ##args) #define lbs_deb_mesh(fmt, args...) LBS_DEB_LL(LBS_DEB_MESH, " mesh", fmt, ##args)
......
...@@ -41,8 +41,6 @@ static int lbs_ethtool_get_eeprom(struct net_device *dev, ...@@ -41,8 +41,6 @@ static int lbs_ethtool_get_eeprom(struct net_device *dev,
struct cmd_ds_802_11_eeprom_access cmd; struct cmd_ds_802_11_eeprom_access cmd;
int ret; int ret;
lbs_deb_enter(LBS_DEB_ETHTOOL);
if (eeprom->offset + eeprom->len > LBS_EEPROM_LEN || if (eeprom->offset + eeprom->len > LBS_EEPROM_LEN ||
eeprom->len > LBS_EEPROM_READ_LEN) { eeprom->len > LBS_EEPROM_READ_LEN) {
ret = -EINVAL; ret = -EINVAL;
...@@ -59,7 +57,6 @@ static int lbs_ethtool_get_eeprom(struct net_device *dev, ...@@ -59,7 +57,6 @@ static int lbs_ethtool_get_eeprom(struct net_device *dev,
memcpy(bytes, cmd.value, eeprom->len); memcpy(bytes, cmd.value, eeprom->len);
out: out:
lbs_deb_leave_args(LBS_DEB_ETHTOOL, "ret %d", ret);
return ret; return ret;
} }
......
...@@ -336,13 +336,11 @@ static inline u32 get_model(u16 manf_id, u16 card_id) ...@@ -336,13 +336,11 @@ static inline u32 get_model(u16 manf_id, u16 card_id)
static inline void if_cs_enable_ints(struct if_cs_card *card) static inline void if_cs_enable_ints(struct if_cs_card *card)
{ {
lbs_deb_enter(LBS_DEB_CS);
if_cs_write16(card, IF_CS_HOST_INT_MASK, 0); if_cs_write16(card, IF_CS_HOST_INT_MASK, 0);
} }
static inline void if_cs_disable_ints(struct if_cs_card *card) static inline void if_cs_disable_ints(struct if_cs_card *card)
{ {
lbs_deb_enter(LBS_DEB_CS);
if_cs_write16(card, IF_CS_HOST_INT_MASK, IF_CS_BIT_MASK); if_cs_write16(card, IF_CS_HOST_INT_MASK, IF_CS_BIT_MASK);
} }
...@@ -355,7 +353,6 @@ static int if_cs_send_cmd(struct lbs_private *priv, u8 *buf, u16 nb) ...@@ -355,7 +353,6 @@ static int if_cs_send_cmd(struct lbs_private *priv, u8 *buf, u16 nb)
int ret = -1; int ret = -1;
int loops = 0; int loops = 0;
lbs_deb_enter(LBS_DEB_CS);
if_cs_disable_ints(card); if_cs_disable_ints(card);
/* Is hardware ready? */ /* Is hardware ready? */
...@@ -388,7 +385,6 @@ static int if_cs_send_cmd(struct lbs_private *priv, u8 *buf, u16 nb) ...@@ -388,7 +385,6 @@ static int if_cs_send_cmd(struct lbs_private *priv, u8 *buf, u16 nb)
done: done:
if_cs_enable_ints(card); if_cs_enable_ints(card);
lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret);
return ret; return ret;
} }
...@@ -400,7 +396,6 @@ static void if_cs_send_data(struct lbs_private *priv, u8 *buf, u16 nb) ...@@ -400,7 +396,6 @@ static void if_cs_send_data(struct lbs_private *priv, u8 *buf, u16 nb)
struct if_cs_card *card = (struct if_cs_card *)priv->card; struct if_cs_card *card = (struct if_cs_card *)priv->card;
u16 status; u16 status;
lbs_deb_enter(LBS_DEB_CS);
if_cs_disable_ints(card); if_cs_disable_ints(card);
status = if_cs_read16(card, IF_CS_CARD_STATUS); status = if_cs_read16(card, IF_CS_CARD_STATUS);
...@@ -416,8 +411,6 @@ static void if_cs_send_data(struct lbs_private *priv, u8 *buf, u16 nb) ...@@ -416,8 +411,6 @@ static void if_cs_send_data(struct lbs_private *priv, u8 *buf, u16 nb)
if_cs_write16(card, IF_CS_HOST_STATUS, IF_CS_BIT_TX); if_cs_write16(card, IF_CS_HOST_STATUS, IF_CS_BIT_TX);
if_cs_write16(card, IF_CS_HOST_INT_CAUSE, IF_CS_BIT_TX); if_cs_write16(card, IF_CS_HOST_INT_CAUSE, IF_CS_BIT_TX);
if_cs_enable_ints(card); if_cs_enable_ints(card);
lbs_deb_leave(LBS_DEB_CS);
} }
/* /*
...@@ -429,8 +422,6 @@ static int if_cs_receive_cmdres(struct lbs_private *priv, u8 *data, u32 *len) ...@@ -429,8 +422,6 @@ static int if_cs_receive_cmdres(struct lbs_private *priv, u8 *data, u32 *len)
int ret = -1; int ret = -1;
u16 status; u16 status;
lbs_deb_enter(LBS_DEB_CS);
/* is hardware ready? */ /* is hardware ready? */
status = if_cs_read16(priv->card, IF_CS_CARD_STATUS); status = if_cs_read16(priv->card, IF_CS_CARD_STATUS);
if ((status & IF_CS_BIT_RESP) == 0) { if ((status & IF_CS_BIT_RESP) == 0) {
...@@ -463,7 +454,6 @@ static int if_cs_receive_cmdres(struct lbs_private *priv, u8 *data, u32 *len) ...@@ -463,7 +454,6 @@ static int if_cs_receive_cmdres(struct lbs_private *priv, u8 *data, u32 *len)
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
out: out:
lbs_deb_leave_args(LBS_DEB_CS, "ret %d, len %d", ret, *len);
return ret; return ret;
} }
...@@ -473,8 +463,6 @@ static struct sk_buff *if_cs_receive_data(struct lbs_private *priv) ...@@ -473,8 +463,6 @@ static struct sk_buff *if_cs_receive_data(struct lbs_private *priv)
u16 len; u16 len;
u8 *data; u8 *data;
lbs_deb_enter(LBS_DEB_CS);
len = if_cs_read16(priv->card, IF_CS_READ_LEN); len = if_cs_read16(priv->card, IF_CS_READ_LEN);
if (len == 0 || len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) { if (len == 0 || len > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE) {
netdev_err(priv->dev, netdev_err(priv->dev,
...@@ -501,7 +489,6 @@ static struct sk_buff *if_cs_receive_data(struct lbs_private *priv) ...@@ -501,7 +489,6 @@ static struct sk_buff *if_cs_receive_data(struct lbs_private *priv)
if_cs_write16(priv->card, IF_CS_HOST_INT_CAUSE, IF_CS_BIT_RX); if_cs_write16(priv->card, IF_CS_HOST_INT_CAUSE, IF_CS_BIT_RX);
out: out:
lbs_deb_leave_args(LBS_DEB_CS, "ret %p", skb);
return skb; return skb;
} }
...@@ -511,8 +498,6 @@ static irqreturn_t if_cs_interrupt(int irq, void *data) ...@@ -511,8 +498,6 @@ static irqreturn_t if_cs_interrupt(int irq, void *data)
struct lbs_private *priv = card->priv; struct lbs_private *priv = card->priv;
u16 cause; u16 cause;
lbs_deb_enter(LBS_DEB_CS);
/* Ask card interrupt cause register if there is something for us */ /* Ask card interrupt cause register if there is something for us */
cause = if_cs_read16(card, IF_CS_CARD_INT_CAUSE); cause = if_cs_read16(card, IF_CS_CARD_INT_CAUSE);
lbs_deb_cs("cause 0x%04x\n", cause); lbs_deb_cs("cause 0x%04x\n", cause);
...@@ -569,7 +554,6 @@ static irqreturn_t if_cs_interrupt(int irq, void *data) ...@@ -569,7 +554,6 @@ static irqreturn_t if_cs_interrupt(int irq, void *data)
/* Clear interrupt cause */ /* Clear interrupt cause */
if_cs_write16(card, IF_CS_CARD_INT_CAUSE, cause & IF_CS_BIT_MASK); if_cs_write16(card, IF_CS_CARD_INT_CAUSE, cause & IF_CS_BIT_MASK);
lbs_deb_leave(LBS_DEB_CS);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -591,8 +575,6 @@ static int if_cs_prog_helper(struct if_cs_card *card, const struct firmware *fw) ...@@ -591,8 +575,6 @@ static int if_cs_prog_helper(struct if_cs_card *card, const struct firmware *fw)
int sent = 0; int sent = 0;
u8 scratch; u8 scratch;
lbs_deb_enter(LBS_DEB_CS);
/* /*
* This is the only place where an unaligned register access happens on * This is the only place where an unaligned register access happens on
* the CF8305 card, therefore for the sake of speed of the driver, we do * the CF8305 card, therefore for the sake of speed of the driver, we do
...@@ -671,7 +653,6 @@ static int if_cs_prog_helper(struct if_cs_card *card, const struct firmware *fw) ...@@ -671,7 +653,6 @@ static int if_cs_prog_helper(struct if_cs_card *card, const struct firmware *fw)
} }
done: done:
lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret);
return ret; return ret;
} }
...@@ -683,8 +664,6 @@ static int if_cs_prog_real(struct if_cs_card *card, const struct firmware *fw) ...@@ -683,8 +664,6 @@ static int if_cs_prog_real(struct if_cs_card *card, const struct firmware *fw)
int len = 0; int len = 0;
int sent; int sent;
lbs_deb_enter(LBS_DEB_CS);
lbs_deb_cs("fw size %td\n", fw->size); lbs_deb_cs("fw size %td\n", fw->size);
ret = if_cs_poll_while_fw_download(card, IF_CS_SQ_READ_LOW, ret = if_cs_poll_while_fw_download(card, IF_CS_SQ_READ_LOW,
...@@ -734,7 +713,6 @@ static int if_cs_prog_real(struct if_cs_card *card, const struct firmware *fw) ...@@ -734,7 +713,6 @@ static int if_cs_prog_real(struct if_cs_card *card, const struct firmware *fw)
pr_err("firmware download failed\n"); pr_err("firmware download failed\n");
done: done:
lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret);
return ret; return ret;
} }
...@@ -792,8 +770,6 @@ static int if_cs_host_to_card(struct lbs_private *priv, ...@@ -792,8 +770,6 @@ static int if_cs_host_to_card(struct lbs_private *priv,
{ {
int ret = -1; int ret = -1;
lbs_deb_enter_args(LBS_DEB_CS, "type %d, bytes %d", type, nb);
switch (type) { switch (type) {
case MVMS_DAT: case MVMS_DAT:
priv->dnld_sent = DNLD_DATA_SENT; priv->dnld_sent = DNLD_DATA_SENT;
...@@ -809,7 +785,6 @@ static int if_cs_host_to_card(struct lbs_private *priv, ...@@ -809,7 +785,6 @@ static int if_cs_host_to_card(struct lbs_private *priv,
__func__, type); __func__, type);
} }
lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret);
return ret; return ret;
} }
...@@ -818,14 +793,10 @@ static void if_cs_release(struct pcmcia_device *p_dev) ...@@ -818,14 +793,10 @@ static void if_cs_release(struct pcmcia_device *p_dev)
{ {
struct if_cs_card *card = p_dev->priv; struct if_cs_card *card = p_dev->priv;
lbs_deb_enter(LBS_DEB_CS);
free_irq(p_dev->irq, card); free_irq(p_dev->irq, card);
pcmcia_disable_device(p_dev); pcmcia_disable_device(p_dev);
if (card->iobase) if (card->iobase)
ioport_unmap(card->iobase); ioport_unmap(card->iobase);
lbs_deb_leave(LBS_DEB_CS);
} }
...@@ -850,8 +821,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev) ...@@ -850,8 +821,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
struct lbs_private *priv; struct lbs_private *priv;
struct if_cs_card *card; struct if_cs_card *card;
lbs_deb_enter(LBS_DEB_CS);
card = kzalloc(sizeof(struct if_cs_card), GFP_KERNEL); card = kzalloc(sizeof(struct if_cs_card), GFP_KERNEL);
if (!card) if (!card)
goto out; goto out;
...@@ -961,7 +930,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev) ...@@ -961,7 +930,6 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
out1: out1:
pcmcia_disable_device(p_dev); pcmcia_disable_device(p_dev);
out: out:
lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret);
return ret; return ret;
} }
...@@ -970,15 +938,11 @@ static void if_cs_detach(struct pcmcia_device *p_dev) ...@@ -970,15 +938,11 @@ static void if_cs_detach(struct pcmcia_device *p_dev)
{ {
struct if_cs_card *card = p_dev->priv; struct if_cs_card *card = p_dev->priv;
lbs_deb_enter(LBS_DEB_CS);
lbs_stop_card(card->priv); lbs_stop_card(card->priv);
lbs_remove_card(card->priv); lbs_remove_card(card->priv);
if_cs_disable_ints(card); if_cs_disable_ints(card);
if_cs_release(p_dev); if_cs_release(p_dev);
kfree(card); kfree(card);
lbs_deb_leave(LBS_DEB_CS);
} }
......
...@@ -466,8 +466,6 @@ static int if_spi_prog_helper_firmware(struct if_spi_card *card, ...@@ -466,8 +466,6 @@ static int if_spi_prog_helper_firmware(struct if_spi_card *card,
const u8 *fw; const u8 *fw;
u8 temp[HELPER_FW_LOAD_CHUNK_SZ]; u8 temp[HELPER_FW_LOAD_CHUNK_SZ];
lbs_deb_enter(LBS_DEB_SPI);
err = spu_set_interrupt_mode(card, 1, 0); err = spu_set_interrupt_mode(card, 1, 0);
if (err) if (err)
goto out; goto out;
...@@ -533,7 +531,7 @@ static int if_spi_prog_helper_firmware(struct if_spi_card *card, ...@@ -533,7 +531,7 @@ static int if_spi_prog_helper_firmware(struct if_spi_card *card,
out: out:
if (err) if (err)
pr_err("failed to load helper firmware (err=%d)\n", err); pr_err("failed to load helper firmware (err=%d)\n", err);
lbs_deb_leave_args(LBS_DEB_SPI, "err %d", err);
return err; return err;
} }
...@@ -588,8 +586,6 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card, ...@@ -588,8 +586,6 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card,
const u8 *fw; const u8 *fw;
u16 num_crc_errs; u16 num_crc_errs;
lbs_deb_enter(LBS_DEB_SPI);
err = spu_set_interrupt_mode(card, 1, 0); err = spu_set_interrupt_mode(card, 1, 0);
if (err) if (err)
goto out; goto out;
...@@ -666,7 +662,7 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card, ...@@ -666,7 +662,7 @@ static int if_spi_prog_main_firmware(struct if_spi_card *card,
out: out:
if (err) if (err)
pr_err("failed to load firmware (err=%d)\n", err); pr_err("failed to load firmware (err=%d)\n", err);
lbs_deb_leave_args(LBS_DEB_SPI, "err %d", err);
return err; return err;
} }
...@@ -699,8 +695,6 @@ static int if_spi_c2h_cmd(struct if_spi_card *card) ...@@ -699,8 +695,6 @@ static int if_spi_c2h_cmd(struct if_spi_card *card)
*/ */
BUILD_BUG_ON(IF_SPI_CMD_BUF_SIZE % 4 != 0); BUILD_BUG_ON(IF_SPI_CMD_BUF_SIZE % 4 != 0);
lbs_deb_enter(LBS_DEB_SPI);
/* How many bytes are there to read? */ /* How many bytes are there to read? */
err = spu_read_u16(card, IF_SPI_SCRATCH_2_REG, &len); err = spu_read_u16(card, IF_SPI_SCRATCH_2_REG, &len);
if (err) if (err)
...@@ -735,7 +729,7 @@ static int if_spi_c2h_cmd(struct if_spi_card *card) ...@@ -735,7 +729,7 @@ static int if_spi_c2h_cmd(struct if_spi_card *card)
out: out:
if (err) if (err)
netdev_err(priv->dev, "%s: err=%d\n", __func__, err); netdev_err(priv->dev, "%s: err=%d\n", __func__, err);
lbs_deb_leave(LBS_DEB_SPI);
return err; return err;
} }
...@@ -748,8 +742,6 @@ static int if_spi_c2h_data(struct if_spi_card *card) ...@@ -748,8 +742,6 @@ static int if_spi_c2h_data(struct if_spi_card *card)
u16 len; u16 len;
int err = 0; int err = 0;
lbs_deb_enter(LBS_DEB_SPI);
/* How many bytes are there to read? */ /* How many bytes are there to read? */
err = spu_read_u16(card, IF_SPI_SCRATCH_1_REG, &len); err = spu_read_u16(card, IF_SPI_SCRATCH_1_REG, &len);
if (err) if (err)
...@@ -794,7 +786,7 @@ static int if_spi_c2h_data(struct if_spi_card *card) ...@@ -794,7 +786,7 @@ static int if_spi_c2h_data(struct if_spi_card *card)
out: out:
if (err) if (err)
netdev_err(priv->dev, "%s: err=%d\n", __func__, err); netdev_err(priv->dev, "%s: err=%d\n", __func__, err);
lbs_deb_leave(LBS_DEB_SPI);
return err; return err;
} }
...@@ -870,8 +862,6 @@ static void if_spi_host_to_card_worker(struct work_struct *work) ...@@ -870,8 +862,6 @@ static void if_spi_host_to_card_worker(struct work_struct *work)
card = container_of(work, struct if_spi_card, packet_work); card = container_of(work, struct if_spi_card, packet_work);
priv = card->priv; priv = card->priv;
lbs_deb_enter(LBS_DEB_SPI);
/* /*
* Read the host interrupt status register to see what we * Read the host interrupt status register to see what we
* can do. * can do.
...@@ -943,8 +933,6 @@ static void if_spi_host_to_card_worker(struct work_struct *work) ...@@ -943,8 +933,6 @@ static void if_spi_host_to_card_worker(struct work_struct *work)
err: err:
if (err) if (err)
netdev_err(priv->dev, "%s: got error %d\n", __func__, err); netdev_err(priv->dev, "%s: got error %d\n", __func__, err);
lbs_deb_leave(LBS_DEB_SPI);
} }
/* /*
...@@ -962,8 +950,6 @@ static int if_spi_host_to_card(struct lbs_private *priv, ...@@ -962,8 +950,6 @@ static int if_spi_host_to_card(struct lbs_private *priv,
struct if_spi_packet *packet; struct if_spi_packet *packet;
u16 blen; u16 blen;
lbs_deb_enter_args(LBS_DEB_SPI, "type %d, bytes %d", type, nb);
if (nb == 0) { if (nb == 0) {
netdev_err(priv->dev, "%s: invalid size requested: %d\n", netdev_err(priv->dev, "%s: invalid size requested: %d\n",
__func__, nb); __func__, nb);
...@@ -1004,7 +990,6 @@ static int if_spi_host_to_card(struct lbs_private *priv, ...@@ -1004,7 +990,6 @@ static int if_spi_host_to_card(struct lbs_private *priv,
/* Queue spi xfer work */ /* Queue spi xfer work */
queue_work(card->workqueue, &card->packet_work); queue_work(card->workqueue, &card->packet_work);
out: out:
lbs_deb_leave_args(LBS_DEB_SPI, "err=%d", err);
return err; return err;
} }
...@@ -1035,8 +1020,6 @@ static int if_spi_init_card(struct if_spi_card *card) ...@@ -1035,8 +1020,6 @@ static int if_spi_init_card(struct if_spi_card *card)
const struct firmware *helper = NULL; const struct firmware *helper = NULL;
const struct firmware *mainfw = NULL; const struct firmware *mainfw = NULL;
lbs_deb_enter(LBS_DEB_SPI);
err = spu_init(card, card->pdata->use_dummy_writes); err = spu_init(card, card->pdata->use_dummy_writes);
if (err) if (err)
goto out; goto out;
...@@ -1093,7 +1076,6 @@ static int if_spi_init_card(struct if_spi_card *card) ...@@ -1093,7 +1076,6 @@ static int if_spi_init_card(struct if_spi_card *card)
goto out; goto out;
out: out:
lbs_deb_leave_args(LBS_DEB_SPI, "err %d\n", err);
return err; return err;
} }
...@@ -1126,8 +1108,6 @@ static int if_spi_probe(struct spi_device *spi) ...@@ -1126,8 +1108,6 @@ static int if_spi_probe(struct spi_device *spi)
struct libertas_spi_platform_data *pdata = dev_get_platdata(&spi->dev); struct libertas_spi_platform_data *pdata = dev_get_platdata(&spi->dev);
int err = 0; int err = 0;
lbs_deb_enter(LBS_DEB_SPI);
if (!pdata) { if (!pdata) {
err = -EINVAL; err = -EINVAL;
goto out; goto out;
...@@ -1221,7 +1201,6 @@ static int if_spi_probe(struct spi_device *spi) ...@@ -1221,7 +1201,6 @@ static int if_spi_probe(struct spi_device *spi)
if (pdata->teardown) if (pdata->teardown)
pdata->teardown(spi); pdata->teardown(spi);
out: out:
lbs_deb_leave_args(LBS_DEB_SPI, "err %d\n", err);
return err; return err;
} }
...@@ -1231,7 +1210,6 @@ static int libertas_spi_remove(struct spi_device *spi) ...@@ -1231,7 +1210,6 @@ static int libertas_spi_remove(struct spi_device *spi)
struct lbs_private *priv = card->priv; struct lbs_private *priv = card->priv;
lbs_deb_spi("libertas_spi_remove\n"); lbs_deb_spi("libertas_spi_remove\n");
lbs_deb_enter(LBS_DEB_SPI);
cancel_work_sync(&card->resume_work); cancel_work_sync(&card->resume_work);
...@@ -1243,7 +1221,7 @@ static int libertas_spi_remove(struct spi_device *spi) ...@@ -1243,7 +1221,7 @@ static int libertas_spi_remove(struct spi_device *spi)
if (card->pdata->teardown) if (card->pdata->teardown)
card->pdata->teardown(spi); card->pdata->teardown(spi);
free_if_spi_card(card); free_if_spi_card(card);
lbs_deb_leave(LBS_DEB_SPI);
return 0; return 0;
} }
...@@ -1297,18 +1275,16 @@ static struct spi_driver libertas_spi_driver = { ...@@ -1297,18 +1275,16 @@ static struct spi_driver libertas_spi_driver = {
static int __init if_spi_init_module(void) static int __init if_spi_init_module(void)
{ {
int ret = 0; int ret = 0;
lbs_deb_enter(LBS_DEB_SPI);
printk(KERN_INFO "libertas_spi: Libertas SPI driver\n"); printk(KERN_INFO "libertas_spi: Libertas SPI driver\n");
ret = spi_register_driver(&libertas_spi_driver); ret = spi_register_driver(&libertas_spi_driver);
lbs_deb_leave(LBS_DEB_SPI);
return ret; return ret;
} }
static void __exit if_spi_exit_module(void) static void __exit if_spi_exit_module(void)
{ {
lbs_deb_enter(LBS_DEB_SPI);
spi_unregister_driver(&libertas_spi_driver); spi_unregister_driver(&libertas_spi_driver);
lbs_deb_leave(LBS_DEB_SPI);
} }
module_init(if_spi_init_module); module_init(if_spi_init_module);
......
...@@ -65,8 +65,6 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) ...@@ -65,8 +65,6 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb)
0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
}; };
lbs_deb_enter(LBS_DEB_RX);
BUG_ON(!skb); BUG_ON(!skb);
skb->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
...@@ -158,7 +156,6 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb) ...@@ -158,7 +156,6 @@ int lbs_process_rxed_packet(struct lbs_private *priv, struct sk_buff *skb)
ret = 0; ret = 0;
done: done:
lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret);
return ret; return ret;
} }
EXPORT_SYMBOL_GPL(lbs_process_rxed_packet); EXPORT_SYMBOL_GPL(lbs_process_rxed_packet);
...@@ -221,8 +218,6 @@ static int process_rxed_802_11_packet(struct lbs_private *priv, ...@@ -221,8 +218,6 @@ static int process_rxed_802_11_packet(struct lbs_private *priv,
struct rx_radiotap_hdr radiotap_hdr; struct rx_radiotap_hdr radiotap_hdr;
struct rx_radiotap_hdr *pradiotap_hdr; struct rx_radiotap_hdr *pradiotap_hdr;
lbs_deb_enter(LBS_DEB_RX);
p_rx_pkt = (struct rx80211packethdr *) skb->data; p_rx_pkt = (struct rx80211packethdr *) skb->data;
prxpd = &p_rx_pkt->rx_pd; prxpd = &p_rx_pkt->rx_pd;
...@@ -281,6 +276,5 @@ static int process_rxed_802_11_packet(struct lbs_private *priv, ...@@ -281,6 +276,5 @@ static int process_rxed_802_11_packet(struct lbs_private *priv,
ret = 0; ret = 0;
done: done:
lbs_deb_leave_args(LBS_DEB_RX, "ret %d", ret);
return ret; return ret;
} }
...@@ -70,8 +70,6 @@ netdev_tx_t lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -70,8 +70,6 @@ netdev_tx_t lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
uint16_t pkt_len; uint16_t pkt_len;
netdev_tx_t ret = NETDEV_TX_OK; netdev_tx_t ret = NETDEV_TX_OK;
lbs_deb_enter(LBS_DEB_TX);
/* We need to protect against the queues being restarted before /* We need to protect against the queues being restarted before
we get round to stopping them */ we get round to stopping them */
spin_lock_irqsave(&priv->driver_lock, flags); spin_lock_irqsave(&priv->driver_lock, flags);
...@@ -166,7 +164,6 @@ netdev_tx_t lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -166,7 +164,6 @@ netdev_tx_t lbs_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
spin_unlock_irqrestore(&priv->driver_lock, flags); spin_unlock_irqrestore(&priv->driver_lock, flags);
wake_up(&priv->waitq); wake_up(&priv->waitq);
lbs_deb_leave_args(LBS_DEB_TX, "ret %d", ret);
return ret; return ret;
} }
......
此差异已折叠。
#
# Copyright (c) 2015-2016 Quantenna Communications, Inc.
# All rights reserved.
#
obj-$(CONFIG_QTNFMAC) += qtnfmac/
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册