summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap/wl1271/0005-wl1271-set-wl-vif-only-if-add_interface-succeeded.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap/wl1271/0005-wl1271-set-wl-vif-only-if-add_interface-succeeded.patch')
-rw-r--r--extras/recipes-kernel/linux/linux-omap/wl1271/0005-wl1271-set-wl-vif-only-if-add_interface-succeeded.patch86
1 files changed, 86 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap/wl1271/0005-wl1271-set-wl-vif-only-if-add_interface-succeeded.patch b/extras/recipes-kernel/linux/linux-omap/wl1271/0005-wl1271-set-wl-vif-only-if-add_interface-succeeded.patch
new file mode 100644
index 00000000..3707b7c3
--- /dev/null
+++ b/extras/recipes-kernel/linux/linux-omap/wl1271/0005-wl1271-set-wl-vif-only-if-add_interface-succeeded.patch
@@ -0,0 +1,86 @@
1From dd812452fb91de492a8fd8d838d16cfc67cbfcf4 Mon Sep 17 00:00:00 2001
2From: Eliad Peller <eliad@wizery.com>
3Date: Thu, 28 Oct 2010 21:46:43 +0200
4Subject: [PATCH 05/15] wl1271: set wl->vif only if add_interface succeeded.
5
6set wl->vif to the newly created interface only after the firmware booted
7successfully. on the way - make the function flow more clear.
8
9Signed-off-by: Eliad Peller <eliad@wizery.com>
10Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
11Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
12---
13 drivers/net/wireless/wl12xx/wl1271_main.c | 33 +++++++++++++++++-----------
14 1 files changed, 20 insertions(+), 13 deletions(-)
15
16diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
17index 49ec0ef..78273c9 100644
18--- a/drivers/net/wireless/wl12xx/wl1271_main.c
19+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
20@@ -939,18 +939,19 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
21 struct wiphy *wiphy = hw->wiphy;
22 int retries = WL1271_BOOT_RETRIES;
23 int ret = 0;
24+ bool booted = false;
25
26 wl1271_debug(DEBUG_MAC80211, "mac80211 add interface type %d mac %pM",
27 vif->type, vif->addr);
28
29 mutex_lock(&wl->mutex);
30 if (wl->vif) {
31+ wl1271_debug(DEBUG_MAC80211,
32+ "multiple vifs are not supported yet");
33 ret = -EBUSY;
34 goto out;
35 }
36
37- wl->vif = vif;
38-
39 switch (vif->type) {
40 case NL80211_IFTYPE_STATION:
41 wl->bss_type = BSS_TYPE_STA_BSS;
42@@ -988,15 +989,8 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
43 if (ret < 0)
44 goto irq_disable;
45
46- wl->state = WL1271_STATE_ON;
47- wl1271_info("firmware booted (%s)", wl->chip.fw_ver);
48-
49- /* update hw/fw version info in wiphy struct */
50- wiphy->hw_version = wl->chip.id;
51- strncpy(wiphy->fw_version, wl->chip.fw_ver,
52- sizeof(wiphy->fw_version));
53-
54- goto out;
55+ booted = true;
56+ break;
57
58 irq_disable:
59 wl1271_disable_interrupts(wl);
60@@ -1014,8 +1008,21 @@ power_off:
61 wl1271_power_off(wl);
62 }
63
64- wl1271_error("firmware boot failed despite %d retries",
65- WL1271_BOOT_RETRIES);
66+ if (!booted) {
67+ wl1271_error("firmware boot failed despite %d retries",
68+ WL1271_BOOT_RETRIES);
69+ goto out;
70+ }
71+
72+ wl->vif = vif;
73+ wl->state = WL1271_STATE_ON;
74+ wl1271_info("firmware booted (%s)", wl->chip.fw_ver);
75+
76+ /* update hw/fw version info in wiphy struct */
77+ wiphy->hw_version = wl->chip.id;
78+ strncpy(wiphy->fw_version, wl->chip.fw_ver,
79+ sizeof(wiphy->fw_version));
80+
81 out:
82 mutex_unlock(&wl->mutex);
83
84--
851.6.6.1
86