Skip to content

Instantly share code, notes, and snippets.

@thoemy
Created September 22, 2013 19:06
Show Gist options
  • Save thoemy/6662786 to your computer and use it in GitHub Desktop.
Save thoemy/6662786 to your computer and use it in GitHub Desktop.
HTC wireless compat changes
From abdfb65a1b2a18f795c922b509beb6d9df61867c Mon Sep 17 00:00:00 2001
From: Thomas Wendt <[email protected]>
Date: Wed, 4 Sep 2013 21:32:58 +0200
Subject: [PATCH] HTC changes
---
Makefile | 8 +-
code-metrics.txt | 16 +-
compat_base_tree_version | 2 +-
compat_version | 2 +-
drivers/net/wireless/Makefile | 2 +-
drivers/net/wireless/wl12xx/Makefile | 8 +-
drivers/net/wireless/wl12xx/acx.c | 11 +
drivers/net/wireless/wl12xx/cmd.c | 3 +-
drivers/net/wireless/wl12xx/conf.h | 2 +-
drivers/net/wireless/wl12xx/debugfs.c | 2 +-
drivers/net/wireless/wl12xx/event.c | 18 +-
drivers/net/wireless/wl12xx/init.c | 4 +-
drivers/net/wireless/wl12xx/main.c | 411 +++++++++++++++++++++++++++++++---
drivers/net/wireless/wl12xx/ps.c | 35 ++-
drivers/net/wireless/wl12xx/rx.c | 36 ++-
drivers/net/wireless/wl12xx/scan.c | 3 +-
drivers/net/wireless/wl12xx/sdio.c | 56 ++++-
drivers/net/wireless/wl12xx/tx.c | 42 +++-
drivers/net/wireless/wl12xx/tx.h | 1 +
drivers/net/wireless/wl12xx/version.h | 2 +-
drivers/net/wireless/wl12xx/wl12xx.h | 5 +
include/linux/compat-2.6.36.h | 3 +-
include/linux/export.h | 2 +-
include/linux/wl12xx.h | 2 -
modules | 0
net/mac80211/debugfs.c | 35 +++
net/mac80211/debugfs.h | 5 +
net/mac80211/main.c | 5 +
net/mac80211/mlme.c | 14 +-
net/mac80211/status.c | 31 ++-
net/wireless/core.c | 1 +
net/wireless/mlme.c | 31 +++
net/wireless/nl80211.c | 4 +-
33 files changed, 714 insertions(+), 88 deletions(-)
create mode 100644 modules
diff --git a/Makefile b/Makefile
index a020661..56a63fd 100644
--- a/Makefile
+++ b/Makefile
@@ -28,8 +28,8 @@ obj-$(CONFIG_COMPAT_WIRELESS) += net/wireless/ net/mac80211/
obj-$(CONFIG_COMPAT_WIRELESS_MODULES) += drivers/net/wireless/
-obj-$(CONFIG_COMPAT_NETWORK_MODULES) += drivers/net/ethernet/atheros/
-obj-$(CONFIG_COMPAT_NETWORK_MODULES) += drivers/net/ethernet/broadcom/
+#obj-$(CONFIG_COMPAT_NETWORK_MODULES) += drivers/net/ethernet/atheros/
+#obj-$(CONFIG_COMPAT_NETWORK_MODULES) += drivers/net/ethernet/broadcom/
ifeq ($(CONFIG_STAGING_EXCLUDE_BUILD),)
@@ -37,8 +37,8 @@ endif
endif
-obj-$(CONFIG_COMPAT_BLUETOOTH) += net/bluetooth/
-obj-$(CONFIG_COMPAT_BLUETOOTH_MODULES) += drivers/bluetooth/
+#obj-$(CONFIG_COMPAT_BLUETOOTH) += net/bluetooth/
+#obj-$(CONFIG_COMPAT_BLUETOOTH_MODULES) += drivers/bluetooth/
else
diff --git a/code-metrics.txt b/code-metrics.txt
index 12ee7fa..097661c 100644
--- a/code-metrics.txt
+++ b/code-metrics.txt
@@ -1,14 +1,14 @@
compat-wireless code metrics
- 830120 - Total upstream lines of code being pulled
- 1916 - backport code changes
- 1612 - backport code additions
- 304 - backport code deletions
+ 828647 - Total upstream lines of code being pulled
+ 2271 - backport code changes
+ 1938 - backport code additions
+ 333 - backport code deletions
 8885 - backport from compat module
- 10801 - total backport code
- 1.3011 - % of code consists of backport work
+ 11156 - total backport code
+ 1.3463 - % of code consists of backport work
Base tree: wl12xx.git
-Base tree version: ol_R5.SP3.01
-compat-wireless release: ol_R5.SP3.06
+Base tree version: ol_R5.00.21-23-g618c7e5
+compat-wireless release: ol_R5.00.14
diff --git a/compat_base_tree_version b/compat_base_tree_version
index f239ece..3599572 100644
--- a/compat_base_tree_version
+++ b/compat_base_tree_version
@@ -1 +1 @@
-ol_R5.SP3.01
+ol_R5.00.21-23-g618c7e5
diff --git a/compat_version b/compat_version
index b498a06..d175ad1 100644
--- a/compat_version
+++ b/compat_version
@@ -1 +1 @@
-ol_R5.SP3.06
+ol_R5.00.14
diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile
index 068f0d3..de1c0ca 100644
--- a/drivers/net/wireless/Makefile
+++ b/drivers/net/wireless/Makefile
@@ -1,3 +1,3 @@
-obj-$(CONFIG_WL1251) += wl1251/
+#obj-$(CONFIG_WL1251) += wl1251/
obj-$(CONFIG_WL12XX) += wl12xx/
obj-$(CONFIG_WL12XX_PLATFORM_DATA) += wl12xx/
diff --git a/drivers/net/wireless/wl12xx/Makefile b/drivers/net/wireless/wl12xx/Makefile
index 823dccb..c85d2b7 100644
--- a/drivers/net/wireless/wl12xx/Makefile
+++ b/drivers/net/wireless/wl12xx/Makefile
@@ -4,10 +4,10 @@ wl12xx-objs = main.o cmd.o io.o event.o tx.o rx.o ps.o acx.o \
define filechk_version.h
(echo 'static const char *wl12xx_timestamp = __TIMESTAMP__;'; \
echo 'static const char *wl12xx_git_head = \
- "$(shell git describe --dirty)";')
+ "<unknown>";')
endef
-$(obj)/version.h: .git/HEAD .git/index .git/refs/tags
+$(obj)/version.h:
@$(call filechk,version.h)
$(obj)/main.c: $(src)/version.h
@@ -18,12 +18,12 @@ $(shell echo $(wl12xx-objs) |
awk '{for (i=1;i<=NF;i++) {printf "$(src)/%s ", $$i} }')
endef
-wl12xx_spi-objs = spi.o
+#wl12xx_spi-objs = spi.o
wl12xx_sdio-objs = sdio.o
wl12xx-$(CONFIG_NL80211_TESTMODE) += testmode.o
obj-$(CONFIG_WL12XX) += wl12xx.o
-obj-$(CONFIG_WL12XX_SPI) += wl12xx_spi.o
+#obj-$(CONFIG_WL12XX_SPI) += wl12xx_spi.o
obj-$(CONFIG_COMPAT_WL12XX_SDIO) += wl12xx_sdio.o
# small builtin driver bit
diff --git a/drivers/net/wireless/wl12xx/acx.c b/drivers/net/wireless/wl12xx/acx.c
index 56ec78e..efcfff0 100644
--- a/drivers/net/wireless/wl12xx/acx.c
+++ b/drivers/net/wireless/wl12xx/acx.c
@@ -449,6 +449,13 @@ int wl1271_acx_conn_monit_params(struct wl1271 *wl, struct wl12xx_vif *wlvif,
u32 timeout = ACX_CONN_MONIT_DISABLE_VALUE;
int ret;
+//HTC_WIFI_START
+ if(enable)
+ printk("wl1271_acx_conn_monit_params enable = true\n");
+ else
+ printk("wl1271_acx_conn_monit_params enable = false\n");
+//HTC_WIFI_END
+
wl1271_debug(DEBUG_ACX, "acx connection monitor parameters: %s",
enable ? "enabled" : "disabled");
@@ -461,6 +468,10 @@ int wl1271_acx_conn_monit_params(struct wl1271 *wl, struct wl12xx_vif *wlvif,
if (enable) {
threshold = wl->conf.conn.synch_fail_thold;
timeout = wl->conf.conn.bss_lose_timeout;
+ //HTC_WIFI_START
+ printk("beacon miss threshold = %d\n",threshold);
+ printk("timeout = %d\n",timeout);
+ //HTC_WIFI_END
}
acx->role_id = wlvif->role_id;
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
index fe8d3e1..cb1b57f 100644
--- a/drivers/net/wireless/wl12xx/cmd.c
+++ b/drivers/net/wireless/wl12xx/cmd.c
@@ -1439,7 +1439,8 @@ int wl1271_cmd_set_sta_key(struct wl1271 *wl, struct wl12xx_vif *wlvif,
cmd->hlid = wlvif->sta.hlid;
- if (key_type == KEY_WEP)
+ //Fix Can't connect to Apple Express Wi-Fi AP with "wep" that always shows obtaining IP address.
+ if (key_type == KEY_WEP && wlvif->encryption_type == KEY_NONE) //HTC_WIFI
cmd->lid_key_type = WEP_DEFAULT_LID_TYPE;
else if (is_broadcast_ether_addr(addr))
cmd->lid_key_type = BROADCAST_LID_TYPE;
diff --git a/drivers/net/wireless/wl12xx/conf.h b/drivers/net/wireless/wl12xx/conf.h
index 33bcce7..2c828c6 100644
--- a/drivers/net/wireless/wl12xx/conf.h
+++ b/drivers/net/wireless/wl12xx/conf.h
@@ -1385,7 +1385,7 @@ struct conf_drv_settings {
struct conf_fm_coex fm_coex;
struct conf_rx_streaming_settings rx_streaming;
struct conf_fwlog fwlog;
- struct conf_core_dump core_dump;
+ struct conf_core_dump core_dump;
struct conf_rate_policy_settings rate;
struct conf_hangover_settings hangover;
u8 hci_io_ds;
diff --git a/drivers/net/wireless/wl12xx/debugfs.c b/drivers/net/wireless/wl12xx/debugfs.c
index fdd4762..5e6f156 100644
--- a/drivers/net/wireless/wl12xx/debugfs.c
+++ b/drivers/net/wireless/wl12xx/debugfs.c
@@ -354,7 +354,7 @@ static ssize_t dynamic_ps_timeout_write(struct file *file,
wl1271_warning("dyanmic_ps_timeout is not in valid range");
return -ERANGE;
}
-
+
mutex_lock(&wl->mutex);
wl->conf.conn.dynamic_ps_timeout = value;
diff --git a/drivers/net/wireless/wl12xx/event.c b/drivers/net/wireless/wl12xx/event.c
index 81ef17b..904f871 100644
--- a/drivers/net/wireless/wl12xx/event.c
+++ b/drivers/net/wireless/wl12xx/event.c
@@ -112,6 +112,8 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox)
vector = le32_to_cpu(mbox->events_vector);
vector &= ~(le32_to_cpu(mbox->events_mask));
wl1271_debug(DEBUG_EVENT, "vector: 0x%x", vector);
+
+ printk("[WLAN] vector: 0x%x\n",vector); //HTC_WIFI
if (vector & SCAN_COMPLETE_EVENT_ID) {
wl1271_debug(DEBUG_EVENT, "status: 0x%x",
@@ -151,6 +153,7 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox)
*/
if (vector & BSS_LOSE_EVENT_ID) {
/* TODO: check for multi-role */
+ printk("[WLAN] EVENT: BSS_LOSE_EVENT\n"); //HTC_WIFI
wl1271_info("Beacon loss detected.");
/* indicate to the stack, that beacons have been lost */
@@ -159,6 +162,7 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox)
if (vector & RSSI_SNR_TRIGGER_0_EVENT_ID) {
/* TODO: check actual multi-role support */
+ printk("[WLAN] EVENT: RSSI_SNR_TRIGGER_0_EVENT\n"); //HTC_WIFI
wl1271_debug(DEBUG_EVENT, "RSSI_SNR_TRIGGER_0_EVENT");
wl12xx_for_each_wlvif_sta(wl, wlvif) {
wl1271_event_rssi_trigger(wl, wlvif, mbox);
@@ -167,6 +171,7 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox)
if (vector & BA_SESSION_RX_CONSTRAINT_EVENT_ID) {
u8 role_id = mbox->role_id;
+ printk("[WLAN] EVENT: BA_SESSION_RX_CONSTRAINT_EVENT\n"); //HTC_WIFI
wl1271_debug(DEBUG_EVENT, "BA_SESSION_RX_CONSTRAINT_EVENT_ID. "
"ba_allowed = 0x%x, role_id=%d",
mbox->rx_ba_allowed, role_id);
@@ -182,6 +187,7 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox)
}
if (vector & CHANNEL_SWITCH_COMPLETE_EVENT_ID) {
+ printk("[WLAN] EVENT: CHANNEL_SWITCH_COMPLETE_EVENT\n"); //HTC_WIFI
wl1271_debug(DEBUG_EVENT, "CHANNEL_SWITCH_COMPLETE_EVENT_ID. "
"status = 0x%x",
mbox->channel_switch_status);
@@ -242,11 +248,19 @@ static int wl1271_event_process(struct wl1271 *wl, struct event_mailbox *mbox)
*/
if (vector & MAX_TX_RETRY_EVENT_ID) {
wl1271_debug(DEBUG_EVENT, "MAX_TX_RETRY_EVENT_ID");
- sta_bitmap |= le16_to_cpu(mbox->sta_tx_retry_exceeded);
- disconnect_sta = true;
+ //HTC_WIFI_START
+ //Sometimes dongle will not reply ACK, this will cause device disconnect to dongle.
+ //we don't want to disconnect dongle for this case.
+ if (ieee80211_get_open_count(wl->hw, NULL) > 1) {
+ printk("[WLAN] do nothing for Concurrent case\n");
+ } else { //HTC_WIFI_END
+ sta_bitmap |= le16_to_cpu(mbox->sta_tx_retry_exceeded);
+ disconnect_sta = true;
+ } //HTC_WIFI
}
if (vector & INACTIVE_STA_EVENT_ID) {
+ printk("[WLAN] EVENT: INACTIVE_STA_EVENT\n"); //HTC_WIFI
wl1271_debug(DEBUG_EVENT, "INACTIVE_STA_EVENT_ID");
sta_bitmap |= le16_to_cpu(mbox->sta_aging_status);
disconnect_sta = true;
diff --git a/drivers/net/wireless/wl12xx/init.c b/drivers/net/wireless/wl12xx/init.c
index 66c26dc..aee3f9b 100644
--- a/drivers/net/wireless/wl12xx/init.c
+++ b/drivers/net/wireless/wl12xx/init.c
@@ -477,8 +477,8 @@ int wl1271_init_ap_rates(struct wl1271 *wl, struct wl12xx_vif *wlvif)
/* configure unicast TX rate classes */
for (i = 0; i < wl->conf.tx.ac_conf_count; i++) {
rc.enabled_rates = supported_rates;
- rc.short_retry_limit = 10;
- rc.long_retry_limit = 10;
+ rc.short_retry_limit = 50; //HTC_WIFI, extend to 50 to solve CT2 buffering issue
+ rc.long_retry_limit = 50; //HTC_WIFI, extend to 50 to solve CT2 buffering issue
rc.aflags = 0;
ret = wl1271_acx_ap_rate_policy(wl, &rc,
wlvif->ap.ucast_rate_idx[i]);
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 6c8292b..eb5cc65 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -51,6 +51,46 @@
#include "scan.h"
#include "version.h"
+/* HTC_WIFI_START */
+#define CONFIG_WIFI_NVS_PROC_CREATE 1
+int stop_wifi_driver_flag = 0;
+EXPORT_SYMBOL(stop_wifi_driver_flag);
+
+#ifdef CONFIG_WIFI_NVS_PROC_CREATE
+extern unsigned char *get_wifi_nvs_ram( void );
+unsigned char *nvs_ram=NULL;
+#endif
+/*HTC_WIFI_END */
+
+//HTC_WIFI_START
+//Vito Smart Qos feature 0128
+#define DEFAULT_CHANNEL_BANDWIDTH 20
+struct ieee80211_hw *priv_hw;
+static int cur_phy_rate = 0;
+
+int htc_wake_debug = 0; //HTC_CSP
+
+typedef struct sqos_wifi_info {
+ int chbandw;
+ int mode;
+ int product;
+}sqos_wifi_info_t;
+
+typedef struct sqos_wifi_data {
+ int phy_rate;
+ int txfail;
+ int qlen;
+ int rssi;
+
+ int status;
+
+}sqos_wifi_data_t;
+int cur_rssi = 0;
+int pre_drop = 0;
+//int sqos_flag = 0;
+//HTC_WIFI_END
+
+
#define WL1271_BOOT_RETRIES 3
#define WL12XX_CORE_DUMP_CHUNK_SIZE (4 * PAGE_SIZE)
@@ -128,7 +168,7 @@ static struct conf_drv_settings default_conf = {
.rx = {
.rx_msdu_life_time = 512000,
.packet_detection_threshold = 0,
- .ps_poll_timeout = 15,
+ .ps_poll_timeout = 60, //HTC_WIFI_START, change from 15 to 60
.upsd_timeout = 15,
.rts_threshold = IEEE80211_MAX_RTS_THRESHOLD,
.rx_cca_threshold = 0,
@@ -141,8 +181,8 @@ static struct conf_drv_settings default_conf = {
.tx_energy_detection = 0,
.sta_rc_conf = {
.enabled_rates = 0,
- .short_retry_limit = 10,
- .long_retry_limit = 10,
+ .short_retry_limit = 100, //HTC_WIFI_START, change from 10 to 100
+ .long_retry_limit = 100, //HTC_WIFI_START, change from 10 to 100
.aflags = 0,
},
.ac_conf_count = 4,
@@ -244,8 +284,8 @@ static struct conf_drv_settings default_conf = {
},
},
- .synch_fail_thold = 12,
- .bss_lose_timeout = 400,
+ .synch_fail_thold = 10, //HTC_WIFI_START
+ .bss_lose_timeout = 100, //HTC_WIFI_START
.cons_bcn_loss_time = 5000,
.max_bcn_loss_time = 10000,
.beacon_rx_timeout = 10000,
@@ -285,7 +325,7 @@ static struct conf_drv_settings default_conf = {
.max_dwell_time_active = 50000,
.min_dwell_time_passive = 100000,
.max_dwell_time_passive = 100000,
- .num_probe_reqs = 2,
+ .num_probe_reqs = 3,
.split_scan_timeout = 50000,
},
.sched_scan = {
@@ -553,12 +593,15 @@ static int wl1271_dev_notify(struct notifier_block *me, unsigned long what,
return NOTIFY_DONE;
wl_temp = hw->priv;
+ printk("wl1271_dev_notify mutex_lock 1\n");
mutex_lock(&wl_list_mutex);
+ printk("wl1271_dev_notify mutex_lock 2\n");
list_for_each_entry(wl, &wl_list, list) {
if (wl == wl_temp)
break;
}
mutex_unlock(&wl_list_mutex);
+ printk("wl1271_dev_notify mutex_lock 3\n");
if (wl != wl_temp)
return NOTIFY_DONE;
@@ -1185,6 +1228,7 @@ static int wl12xx_irq_locked(struct wl1271 *wl)
}
if (likely(intr & WL1271_ACX_INTR_DATA)) {
+ if (htc_wake_debug == 1) printk("[WLAN] %s WL1271_ACX_INTR_DATA\n", __func__); //HTC_CSP
wl1271_debug(DEBUG_IRQ, "WL1271_ACX_INTR_DATA");
ret = wl12xx_rx(wl, wl->fw_status);
@@ -1220,9 +1264,11 @@ static int wl12xx_irq_locked(struct wl1271 *wl)
skb_queue_len(&wl->deferred_rx_queue);
if (defer_count > WL1271_DEFERRED_QUEUE_LIMIT)
wl1271_flush_deferred_work(wl);
+
}
if (intr & WL1271_ACX_INTR_EVENT_A) {
+ if (htc_wake_debug == 1) printk("[WLAN] %s WL1271_ACX_INTR_EVENT_A\n", __func__); //HTC_CSP
wl1271_debug(DEBUG_IRQ, "WL1271_ACX_INTR_EVENT_A");
ret = wl1271_event_handle(wl, 0);
if (ret < 0)
@@ -1230,23 +1276,30 @@ static int wl12xx_irq_locked(struct wl1271 *wl)
}
if (intr & WL1271_ACX_INTR_EVENT_B) {
+ if (htc_wake_debug == 1) printk("[WLAN] %s WL1271_ACX_INTR_EVENT_B\n", __func__); //HTC_CSP
wl1271_debug(DEBUG_IRQ, "WL1271_ACX_INTR_EVENT_B");
ret = wl1271_event_handle(wl, 1);
if (ret < 0)
goto out;
}
- if (intr & WL1271_ACX_INTR_INIT_COMPLETE)
+ if (intr & WL1271_ACX_INTR_INIT_COMPLETE) {
+ if (htc_wake_debug == 1) printk("[WLAN] %s WL1271_ACX_INTR_INIT_COMPLETE\n", __func__); //HTC_CSP
wl1271_debug(DEBUG_IRQ,
- "WL1271_ACX_INTR_INIT_COMPLETE");
+ "WL1271_ACX_INTR_INIT_COMPLETE");
+ }
- if (intr & WL1271_ACX_INTR_HW_AVAILABLE)
+ if (intr & WL1271_ACX_INTR_HW_AVAILABLE) {
+ if (htc_wake_debug == 1) printk("[WLAN] %s WL1271_ACX_INTR_HW_AVAILABLE\n", __func__); //HTC_CSP
wl1271_debug(DEBUG_IRQ, "WL1271_ACX_INTR_HW_AVAILABLE");
+ }
+ htc_wake_debug = 0; //HTC_CSP
}
wl1271_ps_elp_sleep(wl);
out:
+ htc_wake_debug = 0; //HTC_CSP
return ret;
}
@@ -1384,13 +1437,64 @@ static int wl1271_fetch_nvs(struct wl1271 *wl)
const struct firmware *fw;
int ret;
- ret = request_firmware(&fw, WL12XX_NVS_NAME, wl->dev);
+//HTC_WIFI_START
+#ifdef CONFIG_WIFI_NVS_PROC_CREATE
+
+ int calibration_data_length = 0;
+ nvs_ram = get_wifi_nvs_ram();
+ calibration_data_length = nvs_ram[13]*16*16 + nvs_ram[12];
+ printk("[WLAN] Calibration data length: %d\n",calibration_data_length);
+ if(calibration_data_length != 468) {
+ printk("[WLAN] download calibration from %s\n",WL12XX_NVS_NAME_CALIBRATED_AUTO);
+ ret = request_firmware(&fw, WL12XX_NVS_NAME_CALIBRATED_AUTO, wl->dev);
+ if (ret < 0) {
+ wl1271_error("could not get calibrated nvs file %s: %d", WL12XX_NVS_NAME_CALIBRATED_AUTO,
+ ret);
+
+ ret = request_firmware(&fw, WL12XX_NVS_NAME, wl->dev);
+
+ if (ret < 0) {
+ wl1271_error("could not get nvs file %s: %d", WL12XX_NVS_NAME,
+ ret);
+ return ret;
+ }
+ }
+ } else {
+ printk("[WLAN] download calibration from %s\n",WL12XX_NVS_NAME_CALIBRATED);
+ ret = request_firmware(&fw, WL12XX_NVS_NAME_CALIBRATED, wl->dev);
+ if (ret < 0) {
+ wl1271_error("could not get calibrated nvs file %s: %d", WL12XX_NVS_NAME_CALIBRATED,
+ ret);
+
+ ret = request_firmware(&fw, WL12XX_NVS_NAME, wl->dev);
+
+ if (ret < 0) {
+ wl1271_error("could not get nvs file %s: %d", WL12XX_NVS_NAME,
+ ret);
+ return ret;
+ }
+ }
+ }
+
+#else
+ ret = request_firmware(&fw, WL12XX_NVS_NAME_CALIBRATED, wl->dev);
+//HTC_WIFI_END
if (ret < 0) {
- wl1271_error("could not get nvs file %s: %d", WL12XX_NVS_NAME,
+ wl1271_error("could not get calibrated nvs file %s: %d", WL12XX_NVS_NAME_CALIBRATED,
ret);
- return ret;
+
+ ret = request_firmware(&fw, WL12XX_NVS_NAME, wl->dev);
+
+ if (ret < 0) {
+ wl1271_error("could not get nvs file %s: %d", WL12XX_NVS_NAME,
+ ret);
+ return ret;
+ }
}
+//HTC_WIFI_START
+#endif
+//HTC_WIFI_END
wl->nvs = kmemdup(fw->data, fw->size, GFP_KERNEL);
@@ -1674,12 +1778,14 @@ static void wl1271_recovery_work(struct work_struct *work)
}
/* reboot the chipset */
+ printk("wl1271_recovery_work 1\n");
while (!list_empty(&wl->wlvif_list)) {
wlvif = list_first_entry(&wl->wlvif_list,
struct wl12xx_vif, list);
vif = wl12xx_wlvif_to_vif(wlvif);
__wl1271_op_remove_interface(wl, vif, false);
}
+ printk("wl1271_recovery_work 2\n");
wl1271_op_stop_locked(wl);
ieee80211_restart_hw(wl->hw);
@@ -2293,11 +2399,18 @@ err:
return ret;
}
+//HTC_WIFI_START
+struct cfg80211_wowlan *__local_wow;
+//HTC_WIFI_END
int wl1271_configure_wowlan(struct wl1271 *wl, struct cfg80211_wowlan *wow)
{
int i, ret;
- wl1271_debug(DEBUG_MAC80211, "configure_wowlan: wow %p", wow);
+//HTC_WIFI_START
+ __local_wow = wow;
+//HTC_WIFI_END
+
+ wl1271_debug(DEBUG_MAC80211, "configure_wowlan: wow %p", wow);
if (!wow || wow->any || !wow->n_patterns) {
ret = wl1271_rx_data_filtering_enable(wl, 0, FILTER_SIGNAL);
@@ -2337,6 +2450,17 @@ int wl1271_configure_wowlan(struct wl1271 *wl, struct cfg80211_wowlan *wow)
p = &wow->patterns[i];
+ /* HTC_WIFI_START, disable broadcast in suspend mode
+ * wow_enabled is set trued in suspend mode
+ */
+ if (wl->wow_enabled && p->pattern && p->pattern_len) {
+ if (p->pattern[0] & 0x1) { /* multicast or broadcast */
+ pr_info("ignore non-unicast rule: pat[0] 0x%02x\n", p->pattern[0]);
+ continue;
+ }
+ }
+ //HTC_WIFI_END
+
ret = wl1271_convert_wowlan_pattern_to_rx_filter(p, &filter);
if (ret) {
wl1271_warning("convert_wowlan_pattern_to_rx_filter "
@@ -2364,6 +2488,29 @@ out:
return ret;
}
+//HTC_WIFI_START
+//force power save to ensure we write to the ELP reg
+static int wl12xx_force_auto_psm(struct wl1271 *wl, struct wl12xx_vif *wlvif)
+{
+ int ret;
+ u16 timeout = wl->conf.conn.dynamic_ps_timeout;
+
+ ret = wl1271_cmd_ps_mode(wl, wlvif, STATION_AUTO_PS_MODE, timeout);
+ if (ret < 0)
+ return ret;
+
+ set_bit(WLVIF_FLAG_IN_PS, &wlvif->flags);
+
+ /* enable beacon early termination. Not relevant for 5GHz */
+ if (wlvif->band == IEEE80211_BAND_2GHZ) {
+ ret = wl1271_acx_bet_enable(wl, wlvif, true);
+ if (ret < 0)
+ return ret;
+ }
+ return ret; //liushoubin 20120222 compile error
+}
+//HTC_WIFI_END
+
static int wl1271_configure_suspend_sta(struct wl1271 *wl,
struct wl12xx_vif *wlvif,
struct cfg80211_wowlan *wow)
@@ -2377,6 +2524,11 @@ static int wl1271_configure_suspend_sta(struct wl1271 *wl,
if (ret < 0)
goto out;
+//HTC_WIFI_START
+ /* re-configure again */
+ ret = wl1271_configure_wowlan(wl, wow);
+//HTC_WIFI_END
+
ret = wl1271_acx_wake_up_conditions(wl, wlvif,
wl->conf.conn.suspend_wake_up_event,
wl->conf.conn.suspend_listen_interval);
@@ -2384,6 +2536,12 @@ static int wl1271_configure_suspend_sta(struct wl1271 *wl,
if (ret < 0)
wl1271_error("suspend: set wake up conditions failed: %d", ret);
+//HTC_WIFI_START
+//force power save to ensure we write to the ELP reg
+ if (!test_bit(WL1271_FLAG_IN_ELP, &wl->flags))
+ ret = wl12xx_force_auto_psm(wl, wlvif); //force power save to ensure we write to the ELP reg
+//HTC_WIFI_END
+
wl1271_ps_elp_sleep(wl);
out:
@@ -2429,6 +2587,16 @@ static void wl1271_configure_resume(struct wl1271 *wl,
bool is_ap = wlvif->bss_type == BSS_TYPE_AP_BSS;
bool is_sta = wlvif->bss_type == BSS_TYPE_STA_BSS;
+ //HTC_WIFI_START
+ /* update wow_enabled before return. */
+ wl->wow_enabled = false;
+
+ if (test_bit(WL1271_FLAG_INTENDED_FW_RECOVERY, &wl->flags) || wl->state == WLCORE_STATE_OFF) {
+ wl1271_warning("resmue: in FW_RECOVERY or STATE_OFF");
+ return;
+ }
+ //HTC_WIFI_END
+
if ((!is_ap) && (!is_sta))
return;
@@ -2437,6 +2605,12 @@ static void wl1271_configure_resume(struct wl1271 *wl,
return;
if (is_sta) {
+
+ //HTC_WIFI_START
+ /* re-conifugre again */
+ ret = wl1271_configure_wowlan(wl, __local_wow);
+ //HTC_WIFI_END
+
ret = wl1271_acx_wake_up_conditions(wl, wlvif,
wl->conf.conn.wake_up_event,
wl->conf.conn.listen_interval);
@@ -2584,14 +2758,21 @@ static int wl1271_op_start(struct ieee80211_hw *hw)
* is added. That is where we will initialize the hardware.
*/
+/* HTC_WIFI_START */
+ wl1271_info("set stop_wifi_driver_flag = 0");
+ stop_wifi_driver_flag = 0;
+/* HTC_WIFI_END */
- /*
+ /*
* store wl in the global wl_list, used to find wl
* in the wl1271_dev_notify callback
*/
+ printk("wl1271_op_start mutex_lock 1\n");
mutex_lock(&wl_list_mutex);
- list_add(&wl->list, &wl_list);
+ printk("wl1271_op_start mutex_lock 2\n");
+ list_add(&wl->list, &wl_list);
mutex_unlock(&wl_list_mutex);
+ printk("wl1271_op_start mutex_lock 3\n");
return 0;
}
@@ -2620,9 +2801,12 @@ static void wl1271_op_stop_locked(struct wl1271 *wl)
wlcore_disable_interrupts_nosync(wl);
mutex_unlock(&wl->mutex);
+ printk("wl1271_op_stop_locked mutex_lock 1\n");
mutex_lock(&wl_list_mutex);
+ printk("wl1271_op_stop_locked mutex_lock 2\n");
list_del(&wl->list);
mutex_unlock(&wl_list_mutex);
+ printk("wl1271_op_stop_locked mutex_lock 3\n");
wlcore_synchronize_interrupts(wl);
cancel_delayed_work_sync(&wl->delayed_recovery);
@@ -2666,7 +2850,7 @@ static void wl1271_op_stop_locked(struct wl1271 *wl)
memset(wl->links_map, 0, sizeof(wl->links_map));
memset(wl->roc_map, 0, sizeof(wl->roc_map));
wl->active_sta_count = 0;
- wl->wowlan_patterns = NULL;
+ wl->wowlan_patterns = NULL;
/* The system link is always allocated */
__set_bit(WL12XX_SYSTEM_HLID, wl->links_map);
@@ -2706,6 +2890,11 @@ static void wl1271_op_stop(struct ieee80211_hw *hw)
wl1271_op_stop_locked(wl);
mutex_unlock(&wl->mutex);
+
+/* HTC_WIFI_START */
+ wl1271_info("set stop_wifi_driver_flag = 1");
+ stop_wifi_driver_flag = 1;
+/* HTC_WIFI_END */
}
static int wl12xx_allocate_rate_policy(struct wl1271 *wl, u8 *idx)
@@ -3180,6 +3369,7 @@ static void __wl1271_op_remove_interface(struct wl1271 *wl,
if (ret < 0)
goto sleep;
}
+
sleep:
wl1271_ps_elp_sleep(wl);
}
@@ -5051,7 +5241,7 @@ static int wl12xx_op_set_rx_filters(struct ieee80211_hw *hw,
if (unlikely(wl->state != WLCORE_STATE_ON)) {
ret = -EOPNOTSUPP;
goto out;
- }
+ }
ret = wl1271_ps_elp_wakeup(wl);
if (ret < 0)
@@ -5065,7 +5255,7 @@ static int wl12xx_op_set_rx_filters(struct ieee80211_hw *hw,
}
wl->wowlan_patterns = wowlan;
-
+
out_sleep:
wl1271_ps_elp_sleep(wl);
out:
@@ -5544,6 +5734,7 @@ static void wl12xx_op_channel_switch(struct ieee80211_hw *hw,
*/
if (wl->fw_type == WL12XX_FW_TYPE_MULTI) {
wl1271_debug(DEBUG_MAC80211, "mac80211 dropping ch switch");
+ wl1271_info("mac80211 dropping ch switch");
wl12xx_for_each_wlvif_sta(wl, wlvif) {
struct ieee80211_vif *vif = wl12xx_wlvif_to_vif(wlvif);
ieee80211_chswitch_done(vif, false);
@@ -6224,7 +6415,15 @@ static void wl12xx_derive_mac_addresses(struct wl1271 *wl,
u32 oui, u32 nic, int n)
{
int i;
- u32 cur_nic;
+ /*
+ * HTC_WIFI_START
+ * We modify the MAC address as below,
+ * For p2p0 interface, we will set LAA bit and toggle one specific bit.
+ * For third interface (wlan1 or wifi direct), we will set LAA bit only.
+ * HTC_WIFI_END
+ */
+ u32 cur_oui;
+ u32 cur_nic;
wl1271_debug(DEBUG_PROBE, "base address: oui %06x nic %06x, n %d",
oui, nic, n);
@@ -6232,26 +6431,24 @@ static void wl12xx_derive_mac_addresses(struct wl1271 *wl,
if (nic + n - 1 > 0xffffff)
wl1271_warning("NIC part of the MAC address wraps around!");
- cur_nic = nic;
- for (i = 0; i < 2; i++) {
- wl->addresses[i].addr[0] = (u8)(oui >> 16);
- wl->addresses[i].addr[1] = (u8)(oui >> 8);
- wl->addresses[i].addr[2] = (u8) oui;
+ for (i = 0; i < n; i++) {
+ cur_oui = oui;
+ cur_nic = nic;
+ if (i == 1) {
+ /* turn on the "LAA bit" & toggle specific bit in the second mac address (p2p0) */
+ cur_oui |= BIT(17);
+ cur_nic ^= BIT(15);
+ } else if (i == 2) {
+ /* turn on LAA bit only in the third mac address (wlan1 or wifi direct interface) */
+ cur_oui |= BIT(17);
+ }
+
+ wl->addresses[i].addr[0] = (u8)(cur_oui >> 16);
+ wl->addresses[i].addr[1] = (u8)(cur_oui >> 8);
+ wl->addresses[i].addr[2] = (u8) cur_oui;
wl->addresses[i].addr[3] = (u8)(cur_nic >> 16);
wl->addresses[i].addr[4] = (u8)(cur_nic >> 8);
wl->addresses[i].addr[5] = (u8) cur_nic;
- cur_nic++;
- }
-
- /* turn on the LAA bit in the third mac address */
- if (n == 3) {
- oui |= BIT(17);
- wl->addresses[2].addr[0] = (u8)(oui >> 16);
- wl->addresses[2].addr[1] = (u8)(oui >> 8);
- wl->addresses[2].addr[2] = (u8) oui;
- wl->addresses[2].addr[3] = (u8)(nic >> 16);
- wl->addresses[2].addr[4] = (u8)(nic >> 8);
- wl->addresses[2].addr[5] = (u8) nic;
}
wl->hw->wiphy->n_addresses = n;
@@ -6352,11 +6549,23 @@ out:
return ret;
}
+/* HTC_WIFI_START */
+#ifdef CONFIG_WIFI_NVS_PROC_CREATE
+extern unsigned char *get_wifi_nvs_ram( void );
+#endif
+/* HTC_WIFI_END */
+
static int wl1271_register_hw(struct wl1271 *wl)
{
int ret;
u32 oui_addr = 0, nic_addr = 0;
+/* HTC_WIFI_START */
+#ifdef CONFIG_WIFI_NVS_PROC_CREATE
+ unsigned char *nvs_ram=NULL;
+#endif
+/* HTC_WIFI_END */
+
if (wl->mac80211_registered)
return 0;
@@ -6370,14 +6579,32 @@ static int wl1271_register_hw(struct wl1271 *wl)
if (ret == 0) {
/* NOTE: The wl->nvs->nvs element must be first, in
* order to simplify the casting, we assume it is at
- * the beginning of the wl->nvs structure.
+ * the beginniead MAC from calibration dang of the wl->nvs structure.
*/
u8 *nvs_ptr = (u8 *)wl->nvs;
+//HTC_WIFI_START
+#ifdef CONFIG_WIFI_NVS_PROC_CREATE
+ nvs_ram = get_wifi_nvs_ram();
+ printk("[WLAN] Read MAC from calibration data\n");
+ printk("[WLAN] Data length: 0x%x%x\n",nvs_ram[13],nvs_ram[12]);
+ oui_addr =
+ (nvs_ram[75] << 16) + (nvs_ram[74] << 8) + nvs_ram[70];
+ nic_addr =
+ (nvs_ram[69] << 16) + (nvs_ram[68] << 8) + nvs_ram[67];
+ printk("[WLAN] MAC: %x:%x:%x:%x:%x:%x\n",
+ nvs_ram[75],nvs_ram[74],nvs_ram[70],
+ nvs_ram[69],nvs_ram[68],nvs_ram[67]);
+
+#else
+//HTC_WIFI_END
oui_addr =
(nvs_ptr[11] << 16) + (nvs_ptr[10] << 8) + nvs_ptr[6];
nic_addr =
(nvs_ptr[5] << 16) + (nvs_ptr[4] << 8) + nvs_ptr[3];
+//HTC_WIFI_START
+#endif
+//HTC_WIFI_END
}
/* if the MAC address is zeroed in the NVS derive from fuse */
@@ -6842,6 +7069,11 @@ static int __devinit wl12xx_probe(struct platform_device *pdev)
ret = PTR_ERR(hw);
goto out;
}
+//HTC_WIFI_START
+//Vito Smart Qos feature 0206
+ priv_hw = hw;
+ //printk("SQOS priv_hw = %p\n",priv_hw);
+//HTC_WIFI_END
wl = hw->priv;
wl->irq = platform_get_irq(pdev, 0);
@@ -6979,7 +7211,112 @@ static struct platform_driver wl12xx_driver = {
.owner = THIS_MODULE,
}
};
+//HTC_WIFI_START
+//Vito Smart Qos feature 0128
+//// SQOS start ////
+static const int index_to_phy_rate[] = {
+ /* MCS rates are used only with 11n */
+ 145, /* CONF_HW_RXTX_RATE_MCS7_SGI */
+ 130, /* CONF_HW_RXTX_RATE_MCS7 */
+ 117, /* CONF_HW_RXTX_RATE_MCS6 */
+ 104, /* CONF_HW_RXTX_RATE_MCS5 */
+ 78, /* CONF_HW_RXTX_RATE_MCS4 */
+ 52, /* CONF_HW_RXTX_RATE_MCS3 */
+ 39, /* CONF_HW_RXTX_RATE_MCS2 */
+ 26, /* CONF_HW_RXTX_RATE_MCS1 */
+ 13, /* CONF_HW_RXTX_RATE_MCS0 */
+
+
+ 108, /* CONF_HW_RXTX_RATE_54 */
+ 96, /* CONF_HW_RXTX_RATE_48 */
+ 72, /* CONF_HW_RXTX_RATE_36 */
+ 48, /* CONF_HW_RXTX_RATE_24 */
+
+ /* TI-specific rate */
+ 44, /* CONF_HW_RXTX_RATE_22 */
+
+ 36, /* CONF_HW_RXTX_RATE_18 */
+ 24, /* CONF_HW_RXTX_RATE_12 */
+ 22, /* CONF_HW_RXTX_RATE_11 */
+ 18, /* CONF_HW_RXTX_RATE_9 */
+ 12, /* CONF_HW_RXTX_RATE_6 */
+ 11, /* CONF_HW_RXTX_RATE_5_5 */
+ 4, /* CONF_HW_RXTX_RATE_2 */
+ 2 /* CONF_HW_RXTX_RATE_1 */
+};
+/*
+ * function : sqos_phy_rate_get
+ * purpose : for sqos get phy_rate
+ */
+int sqos_phy_rate_get(int index)
+{
+ int ret;
+ ret = index_to_phy_rate[index];
+ if (ret > 0)
+ cur_phy_rate = ret;
+ else
+ printk("SQOS phy_rate < 0 \n");
+ return 0;
+}
+/*
+int SQOS_channel_bandwidth_from_wifi_driver(sqos_wifi_info_t *wifi_info)
+{
+ wifi_info->chbandw = DEFAULT_CHANNEL_BANDWIDTH;
+ wifi_info->mode = 0;
+ wifi_info->product = 0;
+
+ return 0;
+}
+*/
+int SQOS_channel_bandwidth_from_wifi_driver(void)
+{
+ return DEFAULT_CHANNEL_BANDWIDTH;
+}
+
+
+int SQOS_data_from_wifi_driver(sqos_wifi_data_t *wifi_data)
+{
+ int tx_drop = 0;
+ struct ieee80211_hw *sqos_priv_hw = priv_hw;
+ struct wl1271 *wl = priv_hw->priv;
+
+ if((wl == NULL) || (sqos_priv_hw == NULL))
+ {
+ printk("wl = %p , priv_hw = %p",wl,sqos_priv_hw);
+ return -1;
+ }
+ /*1 phyrate*/
+ wifi_data->phy_rate = cur_phy_rate;
+ /*2 txfail txtran */
+// wifi_data->txfail = sqos_tx_fail_get();
+ tx_drop = sqos_tx_fail_get();
+ wifi_data->txfail = tx_drop - pre_drop ;
+ pre_drop = tx_drop;
+
+ /*3 qlen */
+ wifi_data->qlen = wl1271_tx_total_queue_count(wl);
+
+ /*4 rssi */
+ if(cur_rssi < 256)
+ wifi_data->rssi = 256 - cur_rssi ;
+ else if (cur_rssi == 256) // disconnect
+ wifi_data->rssi = cur_rssi;
+ /*5 status */
+ wifi_data->status = 0;
+
+ wl1271_debug(DEBUG_TX, "get phy_rate= %d ,tx_drop= %d ,qlen= %d .\n",wifi_data->phy_rate,wifi_data->txfail,wifi_data->qlen);
+// printk("SQos rate= %d ,drop= %d ,qlen= %d rssi = %d.\n",wifi_data->phy_rate,
+// wifi_data->txfail ,wifi_data->qlen,(256 - wifi_data->rssi));
+
+
+
+ return 0;
+}
+EXPORT_SYMBOL(SQOS_channel_bandwidth_from_wifi_driver);
+EXPORT_SYMBOL(SQOS_data_from_wifi_driver);
+//// SQOS end ////
+//HTC_WIFI_END
static int __init wl12xx_init(void)
{
wl1271_info("driver version: %s", wl12xx_git_head);
diff --git a/drivers/net/wireless/wl12xx/ps.c b/drivers/net/wireless/wl12xx/ps.c
index 907c76f..d61ce7b 100644
--- a/drivers/net/wireless/wl12xx/ps.c
+++ b/drivers/net/wireless/wl12xx/ps.c
@@ -29,6 +29,8 @@
#define WL1271_WAKEUP_TIMEOUT 500
+extern int htc_wake_debug; //HTC_CSP
+
void wl1271_elp_work(struct work_struct *work)
{
struct delayed_work *dwork;
@@ -41,25 +43,43 @@ void wl1271_elp_work(struct work_struct *work)
wl1271_debug(DEBUG_PSM, "elp work");
+ //HTC_WIFI_START
+ /* wow_enabled is set during suspending */
+ if (wl->wow_enabled)
+ wl1271_info("@@@ elp work..");
+ //HTC_WIFI_END
+
mutex_lock(&wl->mutex);
if (unlikely(wl->state != WLCORE_STATE_ON))
goto out;
/* our work might have been already cancelled */
- if (unlikely(!test_bit(WL1271_FLAG_ELP_REQUESTED, &wl->flags)))
+ if (unlikely(!test_bit(WL1271_FLAG_ELP_REQUESTED, &wl->flags))) {
+ if (wl->wow_enabled)
+ wl1271_info("@@@ goto out due to WL1271_FLAG_ELP_REQUESTED..");
goto out;
+ }
- if (test_bit(WL1271_FLAG_IN_ELP, &wl->flags))
+ if (test_bit(WL1271_FLAG_IN_ELP, &wl->flags)) {
+ if (wl->wow_enabled)
+ wl1271_info("@@@ goto out due to WL1271_FLAG_IN_ELP..");
goto out;
+ }
wl12xx_for_each_wlvif(wl, wlvif) {
- if (wlvif->bss_type == BSS_TYPE_AP_BSS)
+ if (wlvif->bss_type == BSS_TYPE_AP_BSS) {
+ if (wl->wow_enabled)
+ wl1271_info("@@@ goto out due to BSS_TYPE_AP_BSS..");
goto out;
+ }
if (!test_bit(WLVIF_FLAG_IN_PS, &wlvif->flags) &&
- test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags))
+ test_bit(WLVIF_FLAG_IN_USE, &wlvif->flags)) {
+ if (wl->wow_enabled)
+ wl1271_info("@@@ goto out due to WLVIF_FLAG_IN_USE..");
goto out;
+ }
}
wl1271_debug(DEBUG_PSM, "chip to elp");
@@ -72,6 +92,11 @@ void wl1271_elp_work(struct work_struct *work)
set_bit(WL1271_FLAG_IN_ELP, &wl->flags);
+ /* wow_enabled is set during suspending */
+ if (wl->wow_enabled) {
+ wl1271_info("@@@ chip to elp..");
+ htc_wake_debug = 1; //HTC_CSP
+ }
out:
mutex_unlock(&wl->mutex);
}
@@ -100,7 +125,7 @@ void wl1271_ps_elp_sleep(struct wl1271 *wl)
if (wl->conf.conn.forced_ps)
timeout = ELP_ENTRY_DELAY;
else
- timeout = wl->conf.conn.elp_timeout;
+ timeout = ELP_ENTRY_DELAY; //wl->conf.conn.elp_timeout; //HTC_WIFI, reduce the delay before we send ELP command
ieee80211_queue_delayed_work(wl->hw, &wl->elp_work,
msecs_to_jiffies(timeout));
diff --git a/drivers/net/wireless/wl12xx/rx.c b/drivers/net/wireless/wl12xx/rx.c
index 472643f..a3d59d6 100644
--- a/drivers/net/wireless/wl12xx/rx.c
+++ b/drivers/net/wireless/wl12xx/rx.c
@@ -32,6 +32,8 @@
#include "tx.h"
#include "io.h"
+extern int htc_wake_debug; //HTC_CSP
+
static u8 wl12xx_rx_get_mem_block(struct wl12xx_fw_status *status,
u32 drv_rx_counter)
{
@@ -116,6 +118,10 @@ static int wl1271_rx_handle_data(struct wl1271 *wl, u8 *data, u32 length,
if (unlikely(wl->plt))
return -EINVAL;
+ if (htc_wake_debug == 1) {
+ printk("[WLAN] %s \n", __func__);
+ //htc_wake_debug = 0;
+ }
/* the data read starts with the descriptor */
desc = (struct wl1271_rx_descriptor *) data;
@@ -164,14 +170,31 @@ static int wl1271_rx_handle_data(struct wl1271 *wl, u8 *data, u32 length,
*hlid = desc->hlid;
hdr = (struct ieee80211_hdr *)skb->data;
- if (ieee80211_is_beacon(hdr->frame_control))
+ if (ieee80211_is_beacon(hdr->frame_control)){
+ if (htc_wake_debug == 1) printk("[WLAN] ieee80211_is_beacon \n");
beacon = 1;
- if (ieee80211_is_data_present(hdr->frame_control))
+ }
+ if (ieee80211_is_data_present(hdr->frame_control)){
+ if (htc_wake_debug == 1) printk("[WLAN] ieee80211_is_data_present \n");
is_data = 1;
+ }
+//HTC_WIFI_STARTi
+//TI patch 0012
+ if (ieee80211_is_deauth(hdr->frame_control) ||
+ ieee80211_is_disassoc(hdr->frame_control))
+ wl1271_dump(DEBUG_MAC80211, "DISPACKET: ",
+ skb->data, skb->len - desc->pad_len);
+//HTC_WIFI_END
wl1271_rx_status(wl, desc, IEEE80211_SKB_RXCB(skb), beacon);
seq_num = (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4;
+ if (htc_wake_debug == 1) {
+ printk("[WLAN] rx skb 0x%p: %d B %s seq %d hlid %d\n", skb,
+ skb->len - desc->pad_len,
+ beacon ? "beacon" : "",
+ seq_num, *hlid);
+ }
wl1271_debug(DEBUG_RX, "rx skb 0x%p: %d B %s seq %d hlid %d", skb,
skb->len - desc->pad_len,
beacon ? "beacon" : "",
@@ -184,7 +207,7 @@ static int wl1271_rx_handle_data(struct wl1271 *wl, u8 *data, u32 length,
#ifdef CONFIG_HAS_WAKELOCK
/* let the frame some time to propagate to user-space */
- wake_lock_timeout(&wl->rx_wake, HZ);
+ wake_lock_timeout(&wl->rx_wake, HZ/2); //HTC_WIFI, modify from HZ to HZ/2
#endif
return is_data;
@@ -222,6 +245,13 @@ int wl12xx_rx(struct wl1271 *wl, struct wl12xx_fw_status *status)
break;
}
+//HTC_CSP_START
+ if (htc_wake_debug == 1) {
+ printk("[WLAN] %s received data\n", __func__);
+ //htc_wake_debug = 0;
+ }
+//HTC_CSP_END
+
if (wl->chip.id != CHIP_ID_1283_PG20) {
/*
* Choose the block we want to read
diff --git a/drivers/net/wireless/wl12xx/scan.c b/drivers/net/wireless/wl12xx/scan.c
index 4600255..9752cc5 100644
--- a/drivers/net/wireless/wl12xx/scan.c
+++ b/drivers/net/wireless/wl12xx/scan.c
@@ -42,7 +42,7 @@ void wl1271_scan_complete_work(struct work_struct *work)
dwork = container_of(work, struct delayed_work, work);
wl = container_of(dwork, struct wl1271, scan_complete_work);
- wl1271_debug(DEBUG_SCAN, "Scanning complete");
+ wl1271_debug(DEBUG_MAC80211, "Scanning complete");//HTC_WIFI, add debug message
mutex_lock(&wl->mutex);
@@ -77,6 +77,7 @@ void wl1271_scan_complete_work(struct work_struct *work)
wl1271_ps_elp_sleep(wl);
+ wl1271_debug(DEBUG_MAC80211, "%s: failed: %d", __func__, wl->scan.failed); //HTC_WIFI, add debug message
if (wl->scan.failed) {
wl1271_info("Scan completed due to error.");
wl12xx_queue_recovery_work(wl);
diff --git a/drivers/net/wireless/wl12xx/sdio.c b/drivers/net/wireless/wl12xx/sdio.c
index c7505d0..c63c254 100644
--- a/drivers/net/wireless/wl12xx/sdio.c
+++ b/drivers/net/wireless/wl12xx/sdio.c
@@ -33,6 +33,12 @@
#include <linux/wl12xx.h>
#include <linux/pm_runtime.h>
+//HTC_WIFI_START
+#ifdef CONFIG_HAS_WAKELOCK
+#include <linux/wakelock.h>
+#endif
+//HTC_WIFI_END
+
#include "wl12xx.h"
#include "wl12xx_80211.h"
#include "io.h"
@@ -45,9 +51,19 @@
#define SDIO_DEVICE_ID_TI_WL1271 0x4076
#endif
+/* HTC_CSP_START */
+extern int stop_wifi_driver_flag;
+extern void set_wifi_is_on(int on);
+/* HTC_CSP_END */
+
struct wl12xx_sdio_glue {
struct device *dev;
struct platform_device *core;
+/* HTC_CSP_START */
+#ifdef CONFIG_HAS_WAKELOCK
+ struct wake_lock wake_lock_probe;
+#endif
+/* HTC_CSP_END */
};
static const struct sdio_device_id wl1271_devices[] __devinitconst = {
@@ -215,6 +231,15 @@ static int __devinit wl1271_probe(struct sdio_func *func,
goto out;
}
+//HTC_WIFI_START
+#ifdef CONFIG_HAS_WAKELOCK
+ printk("[WLAN] wl1271_probe init wake_lock_probe and hold wake lock 2 secs for turning on wifi\n");
+ wake_lock_init(&glue->wake_lock_probe, WAKE_LOCK_SUSPEND, "wake_lock_probe");
+ /* give us a grace period for turning on wifi */
+ wake_lock_timeout(&glue->wake_lock_probe, 2 * HZ);
+#endif
+//HTC_WIFI_END
+
glue->dev = &func->dev;
/* Grab access to FN0 for ELP reg. */
@@ -294,6 +319,12 @@ static void __devexit wl1271_remove(struct sdio_func *func)
struct wl12xx_sdio_glue *glue = sdio_get_drvdata(func);
/* Undo decrement done above in wl1271_probe */
+//HTC_WIFI_START
+#ifdef CONFIG_HAS_WAKELOCK
+ printk("[WLAN] wl1271_remove & destroy wake_lock_probe\n");
+ wake_lock_destroy(&glue->wake_lock_probe);
+#endif
+//HTC_WIFI_END
pm_runtime_get_noresume(&func->dev);
platform_device_del(glue->core);
@@ -315,6 +346,21 @@ static int wl1271_suspend(struct device *dev)
dev_dbg(dev, "wl1271 suspend. wow_enabled: %d\n",
wl->wow_enabled);
+/* HTC_WIFI_START */
+ if(wl == NULL) {
+ dev_err(dev, "wl1271_suspend wl : 0x%x return 0 directly! & stop_wifi_driver_flag = %d",wl,stop_wifi_driver_flag);
+ if(!stop_wifi_driver_flag) {
+ dev_err(dev, "release sdio host & sdio_set_host_pm_flags");
+ ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
+ if (ret) {
+ dev_err(dev, "error while trying to keep power\n");
+ goto out;
+ }
+ }
+ return 0;
+ }
+/* HTC_WIFI_END */
+
/* check whether sdio should keep power */
if (wl->wow_enabled) {
sdio_flags = sdio_get_host_pm_caps(func);
@@ -364,12 +410,20 @@ static struct sdio_driver wl1271_sdio_driver = {
static int __init wl1271_init(void)
{
+//HTC_WIFI_START
+ set_wifi_is_on(1);
+ printk("set wifi_is_on = 1\n");
+//HTC_WIFI_END
return sdio_register_driver(&wl1271_sdio_driver);
}
static void __exit wl1271_exit(void)
{
sdio_unregister_driver(&wl1271_sdio_driver);
+//HTC_WIFI_START
+ set_wifi_is_on(0);
+ printk("set wifi_is_on = 0\n");
+//HTC_WIFI_END
}
module_init(wl1271_init);
@@ -383,4 +437,4 @@ MODULE_FIRMWARE(WL127X_FW_NAME_MULTI);
MODULE_FIRMWARE(WL128X_FW_NAME_SINGLE);
MODULE_FIRMWARE(WL128X_FW_NAME_MULTI);
MODULE_FIRMWARE(WL127X_PLT_FW_NAME);
-MODULE_FIRMWARE(WL128X_PLT_FW_NAME);
\ No newline at end of file
+MODULE_FIRMWARE(WL128X_PLT_FW_NAME);
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c
index baa7d4a..27cf01b 100644
--- a/drivers/net/wireless/wl12xx/tx.c
+++ b/drivers/net/wireless/wl12xx/tx.c
@@ -840,6 +840,9 @@ static u8 wl1271_tx_get_rate_flags(u8 rate_class_index)
return flags;
}
+//HTC_WIFI_START
+extern int stop_wifi_driver_flag;
+//HTC_WIFI_END
static void wl1271_tx_complete_packet(struct wl1271 *wl,
struct wl1271_tx_hw_res_descr *result)
{
@@ -858,8 +861,19 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
return;
}
+ //HTC_WIFI_START
+ if (stop_wifi_driver_flag) {
+ wl1271_warning("=== driver is under stopping ===\n");
+ return;
+ }
+ //HTC_WIFI_END
+
skb = wl->tx_frames[id];
- info = IEEE80211_SKB_CB(skb);
+ if(skb) //HTC_WIFI
+ info = IEEE80211_SKB_CB(skb);
+ else //HTC_WIFI_START
+ printk("[WLAN] skb is null for id=%d\n",id);
+ //HTC_WIFI_END
if (wl12xx_is_dummy_packet(wl, skb)) {
wl1271_free_tx_id(wl, id);
@@ -876,6 +890,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
info->flags |= IEEE80211_TX_STAT_ACK;
rate = wl1271_rate_to_idx(result->rate_class_index,
wlvif->band);
+ sqos_phy_rate_get(result->rate_class_index);// for SQOS //HTC_WIFI, Vito Smart Qos feature 0128
rate_flags = wl1271_tx_get_rate_flags(result->rate_class_index);
retries = result->ack_failures;
} else if (result->status == TX_RETRY_EXCEEDED) {
@@ -932,15 +947,25 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
wl1271_free_tx_id(wl, result->id);
}
+extern int htc_wake_debug; //HTC_CSP
+
/* Called upon reception of a TX complete interrupt */
int wl1271_tx_complete(struct wl1271 *wl)
{
+ static int is_in = 0;//HTC_WIFI
struct wl1271_acx_mem_map *memmap =
(struct wl1271_acx_mem_map *)wl->target_mem_map;
u32 count, fw_counter;
u32 i;
int ret;
+ //HTC_WIFI_START
+ if (is_in)
+ printk("HTC - we were preemted in wl1271_tx_complete, is_in = %d\n",is_in);
+
+ is_in++;
+ //HTC_WIFI_END
+
/* read the tx results from the chipset */
ret = wl1271_read(wl, le32_to_cpu(memmap->tx_result),
wl->tx_res_if, sizeof(*wl->tx_res_if), false);
@@ -959,6 +984,13 @@ int wl1271_tx_complete(struct wl1271 *wl)
count = fw_counter - wl->tx_results_count;
wl1271_debug(DEBUG_TX, "tx_complete received, packets: %d", count);
+//HTC_CSP_START
+ if (htc_wake_debug == 1) {
+ printk("[WLAN] %s tx_complete received, packets: %d\n", __func__, count);
+ htc_wake_debug = 0;
+ }
+//HTC_CSP_END
+
/* verify that the result buffer is not getting overrun */
if (unlikely(count > TX_HW_RESULT_QUEUE_LEN))
wl1271_warning("TX result overflow from chipset: %d", count);
@@ -970,11 +1002,15 @@ int wl1271_tx_complete(struct wl1271 *wl)
/* process the packet */
result = &(wl->tx_res_if->tx_results_queue[offset]);
- wl1271_tx_complete_packet(wl, result);
+ if (result) //HTC_WIFI
+ wl1271_tx_complete_packet(wl, result);
+ else //HTC_WIFI_START
+ printk("HTC - result is NULL at offset = %d and count = %d\n",offset,count);
+ //HTC_WIFI_END
wl->tx_results_count++;
}
-
+ is_in--; //HTC_WIFI
out:
return ret;
}
diff --git a/drivers/net/wireless/wl12xx/tx.h b/drivers/net/wireless/wl12xx/tx.h
index a90ef8a..2a25fc4 100644
--- a/drivers/net/wireless/wl12xx/tx.h
+++ b/drivers/net/wireless/wl12xx/tx.h
@@ -247,5 +247,6 @@ bool wlcore_is_queue_stopped(struct wl1271 *wl, u8 queue);
/* from main.c */
void wl1271_free_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 hlid);
void wl12xx_rearm_tx_watchdog_locked(struct wl1271 *wl);
+int sqos_phy_rate_get(int index); //HTC_WIFI, Vito Smart Qos feature 0128
#endif
diff --git a/drivers/net/wireless/wl12xx/version.h b/drivers/net/wireless/wl12xx/version.h
index 9818e63..4c8f343 100644
--- a/drivers/net/wireless/wl12xx/version.h
+++ b/drivers/net/wireless/wl12xx/version.h
@@ -1,2 +1,2 @@
static const char *wl12xx_timestamp = __TIMESTAMP__;
-static const char *wl12xx_git_head = "ol_R5.SP3.01";
+static const char *wl12xx_git_head = "";
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index d2b52ce..1868d17 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -37,6 +37,7 @@
#include "conf.h"
#include "ini.h"
+int sqos_tx_fail_get(void); //HTC_WIFI, Vito Smart Qos feature 0128
#define WL127X_FW_NAME_MULTI "ti-connectivity/wl127x-fw-4-mr.bin"
#define WL127X_FW_NAME_SINGLE "ti-connectivity/wl127x-fw-4-sr.bin"
@@ -52,6 +53,10 @@
* the correct NVS size in wl1271_boot_upload_nvs().
*/
#define WL12XX_NVS_NAME "ti-connectivity/wl1271-nvs.bin"
+//HTC_WIFI_START
+#define WL12XX_NVS_NAME_CALIBRATED "../../../data/misc/wifi/wl1271-nvs-calibrated.bin"
+#define WL12XX_NVS_NAME_CALIBRATED_AUTO "../../../data/misc/wifi/wl1271-nvs-calibrated_auto.bin"
+//HTC_WIFI_END
#define WL1271_TX_SECURITY_LO16(s) ((u16)((s) & 0xffff))
#define WL1271_TX_SECURITY_HI32(s) ((u32)(((s) >> 16) & 0xffffffff))
diff --git a/include/linux/compat-2.6.36.h b/include/linux/compat-2.6.36.h
index b5d9975..defd366 100644
--- a/include/linux/compat-2.6.36.h
+++ b/include/linux/compat-2.6.36.h
@@ -60,7 +60,7 @@ static inline int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t wh
conf_reg_t reg = { 0, CS_WRITE, where, val };
return pcmcia_access_configuration_register(p_dev, &reg);
}
-
+#if defined(CONFIG_MACH_ENDEAVORU) || defined(CONFIG_MACH_ENDEAVORTD)
struct pm_qos_request_list {
u32 qos;
void *request;
@@ -94,6 +94,7 @@ struct pm_qos_request_list {
#endif
+#endif
/*
* Dummy printk for disabled debugging statements to use whilst maintaining
* gcc's format and side-effect checking.
diff --git a/include/linux/export.h b/include/linux/export.h
index f7842b7..1495986 100644
--- a/include/linux/export.h
+++ b/include/linux/export.h
@@ -3,7 +3,7 @@
#include <linux/version.h>
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
#include_next <linux/export.h>
#else
#include <linux/module.h>
diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h
index 535058e..0d63731 100644
--- a/include/linux/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -54,8 +54,6 @@ struct wl12xx_platform_data {
int board_ref_clock;
int board_tcxo_clock;
unsigned long platform_quirks;
- int bt_enable_gpio;
- int wlan_enable_gpio;
bool pwr_in_suspend;
struct wl1271_if_operations *ops;
diff --git a/modules b/modules
new file mode 100644
index 0000000..e69de29
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 90baea5..e9d0438 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -341,6 +341,15 @@ static const struct file_operations stats_ ##name## _ops = { \
#define DEBUGFS_STATS_ADD(name, field) \
debugfs_create_u32(#name, 0400, statsd, (u32 *) &field);
+
+//HTC_WIFI_START
+//HTC_WIFI_OFFLOAD+
+struct dentry *tx_track;
+#define DEBUGFS_STATS_ADD_MODE(name, mode , field) \
+ debugfs_create_u32(#name, mode, tx_track, (u32 *) &field);
+//HTC_WIFI_OFFLOAD-
+//HTC_WIFI_END
+
#define DEBUGFS_DEVSTATS_ADD(name) \
debugfs_create_file(#name, 0400, statsd, local, &stats_ ##name## _ops);
@@ -354,9 +363,25 @@ void debugfs_hw_add(struct ieee80211_local *local)
struct dentry *phyd = local->hw.wiphy->debugfsdir;
struct dentry *statsd;
+//HTC_WIFI_START
+//HTC_WIFI_OFFLOAD+
+ tx_track = debugfs_create_dir("wifi_tx", NULL);
+ if (!tx_track)
+ return;
+//HTC_WIFI_OFFLOAD-
+//HTC_WIFI_END
+
if (!phyd)
return;
+//HTC_WIFI_START
+//HTC_WIFI_OFFLOAD+
+ DEBUGFS_STATS_ADD_MODE(failed_count, 0444, local->dot11FailedCount);
+ DEBUGFS_STATS_ADD_MODE(retry_count, 0444, local->dot11RetryCount);
+ DEBUGFS_STATS_ADD_MODE(transmitted_frame_count, 0444, local->dot11TransmittedFrameCount);
+//HTC_WIFI_OFFLOAD-
+//HTC_WIFI_END
+
local->debugfs.keys = debugfs_create_dir("keys", phyd);
DEBUGFS_ADD(frequency);
@@ -434,3 +459,13 @@ void debugfs_hw_add(struct ieee80211_local *local)
DEBUGFS_DEVSTATS_ADD(dot11FCSErrorCount);
DEBUGFS_DEVSTATS_ADD(dot11RTSSuccessCount);
}
+
+//HTC_WIFI_START
+//HTC_WIFI_OFFLOAD+
+void debugfs_hw_remove()
+{
+ if (tx_track != NULL)
+ debugfs_remove_recursive(tx_track);
+}
+//HTC_WIFI_OFFLOAD-
+//HTC_WIFI_END
diff --git a/net/mac80211/debugfs.h b/net/mac80211/debugfs.h
index 7c87529..8323974 100644
--- a/net/mac80211/debugfs.h
+++ b/net/mac80211/debugfs.h
@@ -3,6 +3,11 @@
#ifdef CONFIG_MAC80211_DEBUGFS
extern void debugfs_hw_add(struct ieee80211_local *local);
+//HTC_WIFI_START
+//HTC_WIFI_OFFLOAD+
+extern void debugfs_hw_remove();
+//HTC_WIFI_OFFLOAD-
+//HTC_WIFI_END
extern int mac80211_open_file_generic(struct inode *inode, struct file *file);
extern int mac80211_format_buffer(char __user *userbuf, size_t count,
loff_t *ppos, char *fmt, ...);
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 34d7f53..b36d441 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1038,6 +1038,11 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
destroy_workqueue(local->workqueue);
wiphy_unregister(local->hw.wiphy);
+ //HTC_WIFI_STATR
+ //HTC_WIFI_OFFLOAD+
+ debugfs_hw_remove();
+ //HTC_WIFI_OFFLOAD-
+ //HTC_WIFI_END
sta_info_stop(local);
ieee80211_wep_free(local);
ieee80211_led_exit(local);
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 203669e..d598c9e 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2095,6 +2095,10 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
struct ieee80211_local *local = sdata->local;
struct ieee80211_work *tmp, *wk = NULL;
+
+ printk("%s: deauth: bssid: %pM sa: %pM\n",
+ __func__, mgmt->bssid, mgmt->sa);//HTC_WIFI, add debug message
+
mutex_lock(&local->mtx);
list_for_each_entry(tmp, &local->work_list, list) {
if (tmp->sdata != sdata)
@@ -2195,6 +2199,9 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
u8 bssid[ETH_ALEN];
int max_tries;
+ printk("%s: nullfunc_failed: %d probe_send_count: %d\n",
+ __func__, ifmgd->nullfunc_failed, ifmgd->probe_send_count);//HTC_WIFI, add debug message
+
memcpy(bssid, ifmgd->associated->bssid, ETH_ALEN);
if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)
@@ -2547,10 +2554,11 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
wk->probe_auth.privacy = req->bss->capability & WLAN_CAPABILITY_PRIVACY;
/* if we already have a probe, don't probe again */
- if (req->bss->proberesp_ies)
+ printk("We don't want to use direct probe, we will auth directly\n"); //HTC_WIFI
+// if (req->bss->proberesp_ies) //austin disable direct probe to prevent prefer 5G issue //HTC_WIFI
wk->type = IEEE80211_WORK_AUTH;
- else
- wk->type = IEEE80211_WORK_DIRECT_PROBE;
+// else //austin disable direct probe to prevent prefer 5G issue //HTC_WIFI
+// wk->type = IEEE80211_WORK_DIRECT_PROBE; //HTC_WIFI austin disable direct probe to prevent prefer 5G issue
wk->chan = req->bss->channel;
wk->chan_type = NL80211_CHAN_NO_HT;
wk->sdata = sdata;
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 4de881b..835122f 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -16,8 +16,15 @@
#include "mesh.h"
#include "led.h"
#include "wme.h"
-
-
+//HTC_WIFI_START
+//Vito Smart Qos feature 0128
+int cur_tx_fail;
+int sqos_tx_fail_get(void)
+{
+ return cur_tx_fail;
+}
+EXPORT_SYMBOL(sqos_tx_fail_get);
+//HTC_WIFI_END
void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
struct sk_buff *skb)
{
@@ -457,7 +464,21 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
if (info->flags & IEEE80211_TX_STAT_ACK) {
if (sta->lost_packets)
sta->lost_packets = 0;
- } else if (++sta->lost_packets >= STA_LOST_PKT_THRESHOLD) {
+ //HTC_WIFI_START
+ //Sometimes dongle will not reply ACK, this will cause device disconnect dongle.
+ //we don't want to disconnect dongle for this case.
+ //For concurrent case, use 300 for STA_LOST_PKT_THRESHOLD
+ } else if (ieee80211_get_open_count(hw, NULL) > 1) {
+ if (++sta->lost_packets >= 300) {
+ cfg80211_cqm_pktloss_notify(sta->sdata->dev,
+ sta->sta.addr,
+ sta->lost_packets,
+ GFP_ATOMIC);
+ sta->lost_packets = 0;
+ }
+ }
+ //HTC_WIFI_END
+ else if (++sta->lost_packets >= STA_LOST_PKT_THRESHOLD) {
cfg80211_cqm_pktloss_notify(sta->sdata->dev,
sta->sta.addr,
sta->lost_packets,
@@ -496,7 +517,11 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
local->dot11TransmittedFragmentCount++;
} else {
if (ieee80211_is_first_frag(hdr->seq_ctrl))
+ {
local->dot11FailedCount++;
+ //HTC_WIFI_START Vito Smart Qos feature 0206
+ cur_tx_fail = local->dot11FailedCount;
+ } //HTC_WIFI_END Vito Smart Qos feature 0206
}
if (ieee80211_is_nullfunc(fc) && ieee80211_has_pm(fc) &&
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 3077f1f..7783654 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -741,6 +741,7 @@ void cfg80211_dev_free(struct cfg80211_registered_device *rdev)
mutex_destroy(&rdev->sched_scan_mtx);
list_for_each_entry_safe(scan, tmp, &rdev->bss_list, list)
cfg80211_put_bss(&scan->pub);
+ printk("[WLAN] cfg80211_dev_free, free wowlan\n"); //HTC_WIFI
cfg80211_rdev_free_wowlan(rdev);
kfree(rdev);
}
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index b189cb7..66cceb0 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -492,6 +492,7 @@ int cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
{
int err;
+ printk("[WLAN] cfg80211_mlme_auth\n");
wdev_lock(dev->ieee80211_ptr);
err = __cfg80211_mlme_auth(rdev, dev, chan, auth_type, bssid,
ssid, ssid_len, ie, ie_len,
@@ -609,6 +610,7 @@ int cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev = dev->ieee80211_ptr;
int err;
+ printk("[WLAN] cfg80211_mlme_assoc\n");
wdev_lock(wdev);
err = __cfg80211_mlme_assoc(rdev, dev, chan, bssid, prev_bssid,
ssid, ssid_len, ie, ie_len, use_mfp, crypt,
@@ -664,6 +666,7 @@ int cfg80211_mlme_deauth(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev = dev->ieee80211_ptr;
int err;
+ printk("[WLAN] cfg80211_mlme_deauth\n");
wdev_lock(wdev);
err = __cfg80211_mlme_deauth(rdev, dev, bssid, ie, ie_len, reason,
local_state_change);
@@ -709,6 +712,7 @@ int cfg80211_mlme_disassoc(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev = dev->ieee80211_ptr;
int err;
+ printk("[WLAN] cfg80211_mlme_disassoc\n");
wdev_lock(wdev);
err = __cfg80211_mlme_disassoc(rdev, dev, bssid, ie, ie_len, reason,
local_state_change);
@@ -1087,10 +1091,35 @@ EXPORT_SYMBOL(cfg80211_rx_mgmt);
void cfg80211_mgmt_tx_status(struct net_device *dev, u64 cookie,
const u8 *buf, size_t len, bool ack, gfp_t gfp)
{
+#if 0
struct wireless_dev *wdev = dev->ieee80211_ptr;
struct wiphy *wiphy = wdev->wiphy;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
+#else
+//HTC_CSP_START
+ struct wireless_dev *wdev;
+ struct wiphy *wiphy;
+ struct cfg80211_registered_device *rdev;
+
+ if (!dev) {
+ printk("[WLAN] %s, dev is null\n", __func__);
+ return;
+ }
+ wdev = dev->ieee80211_ptr;
+
+ if (!wdev) {
+ printk("[WLAN] %s, wdev is null\n", __func__);
+ return;
+ }
+ wiphy = wdev->wiphy;
+ if (!wiphy) {
+ printk("[WLAN] %s, wiphy is null\n", __func__);
+ return;
+ }
+ rdev = wiphy_to_dev(wiphy);
+//HTC_CSP_END
+#endif
/* Indicate TX status of the Action frame to user space */
nl80211_send_mgmt_tx_status(rdev, dev, cookie, buf, len, ack, gfp);
}
@@ -1104,6 +1133,7 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev,
struct wiphy *wiphy = wdev->wiphy;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
+ printk("[WLAN] cfg80211_cqm_rssi_notify\n");
/* Indicate roaming trigger event to user space */
nl80211_send_cqm_rssi_notify(rdev, dev, rssi_event, gfp);
}
@@ -1116,6 +1146,7 @@ void cfg80211_cqm_pktloss_notify(struct net_device *dev,
struct wiphy *wiphy = wdev->wiphy;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
+ printk("[WLAN] cfg80211_cqm_pktloss_notify\n");
/* Indicate roaming trigger event to user space */
nl80211_send_cqm_pktloss_notify(rdev, dev, peer, num_packets, gfp);
}
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 31118df..42defe5 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3652,8 +3652,10 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
if (!rdev->ops->scan)
return -EOPNOTSUPP;
- if (rdev->scan_req)
+ if (rdev->scan_req) {
+ printk("[WLAN] %s: EBUST - scan_req is not null\n", __func__); //HTC_WIFI, add debug message
return -EBUSY;
+ }
if (info->attrs[NL80211_ATTR_SCAN_FREQUENCIES]) {
n_channels = validate_scan_freqs(
--
1.8.4.rc3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment