aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-12-14 15:51:52 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-12-16 15:25:37 -0500
commitf4528696d803749892eac27422a6fd7748cffee1 (patch)
treea890593a549c95c417e9092d1893c6df3efc42dd /drivers/staging
parent12b9d5bf76bfa20d3207ef24fca9c8254a586a58 (diff)
staging: brcm80211: Fix WL_<type> logging macros
These macros use the equivalent of "#define WL_<type>(x) printk x" which requires an extra level of parentheses. Convert the macros to use the normal WL_<type>(fmt, args...) style and remove the extra parentheses from the uses. Add format argument verification using no_printk as appropriate. Couple of spelling typo fixes in the formats and argument alignment at the same time. Also coalesced long formats. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c34
-rw-r--r--drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c518
-rw-r--r--drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h46
-rw-r--r--drivers/staging/brcm80211/brcmfmac/wl_iw.c480
-rw-r--r--drivers/staging/brcm80211/brcmfmac/wl_iw.h2
-rw-r--r--drivers/staging/brcm80211/sys/wl_dbg.h72
-rw-r--r--drivers/staging/brcm80211/sys/wl_mac80211.c247
-rw-r--r--drivers/staging/brcm80211/sys/wlc_alloc.c2
-rw-r--r--drivers/staging/brcm80211/sys/wlc_ampdu.c99
-rw-r--r--drivers/staging/brcm80211/sys/wlc_antsel.c4
-rw-r--r--drivers/staging/brcm80211/sys/wlc_bmac.c285
-rw-r--r--drivers/staging/brcm80211/sys/wlc_channel.c45
-rw-r--r--drivers/staging/brcm80211/sys/wlc_event.c4
-rw-r--r--drivers/staging/brcm80211/sys/wlc_mac80211.c340
-rw-r--r--drivers/staging/brcm80211/sys/wlc_phy_shim.c3
-rw-r--r--drivers/staging/brcm80211/sys/wlc_stf.c12
16 files changed, 1136 insertions, 1057 deletions
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c b/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
index bb3c7b8c4b98..c3f18bb3b27c 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
@@ -24,8 +24,8 @@
24#include <wlioctl.h> 24#include <wlioctl.h>
25#include <wl_iw.h> 25#include <wl_iw.h>
26 26
27#define WL_ERROR(x) printf x 27#define WL_ERROR(fmt, args...) printk(fmt, ##args)
28#define WL_TRACE(x) 28#define WL_TRACE(fmt, args...) no_printk(fmt, ##args)
29 29
30#ifdef CUSTOMER_HW 30#ifdef CUSTOMER_HW
31extern void bcm_wlan_power_off(int); 31extern void bcm_wlan_power_off(int);
@@ -67,13 +67,13 @@ int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr)
67#endif 67#endif
68 68
69 if (dhd_oob_gpio_num < 0) { 69 if (dhd_oob_gpio_num < 0) {
70 WL_ERROR(("%s: ERROR customer specific Host GPIO is NOT defined\n", 70 WL_ERROR("%s: ERROR customer specific Host GPIO is NOT defined\n",
71 __func__)); 71 __func__);
72 return dhd_oob_gpio_num; 72 return dhd_oob_gpio_num;
73 } 73 }
74 74
75 WL_ERROR(("%s: customer specific Host GPIO number is (%d)\n", 75 WL_ERROR("%s: customer specific Host GPIO number is (%d)\n",
76 __func__, dhd_oob_gpio_num)); 76 __func__, dhd_oob_gpio_num);
77 77
78#if defined CUSTOMER_HW 78#if defined CUSTOMER_HW
79 host_oob_irq = MSM_GPIO_TO_INT(dhd_oob_gpio_num); 79 host_oob_irq = MSM_GPIO_TO_INT(dhd_oob_gpio_num);
@@ -93,40 +93,40 @@ void dhd_customer_gpio_wlan_ctrl(int onoff)
93{ 93{
94 switch (onoff) { 94 switch (onoff) {
95 case WLAN_RESET_OFF: 95 case WLAN_RESET_OFF:
96 WL_TRACE(("%s: call customer specific GPIO to insert WLAN RESET\n", 96 WL_TRACE("%s: call customer specific GPIO to insert WLAN RESET\n",
97 __func__)); 97 __func__);
98#ifdef CUSTOMER_HW 98#ifdef CUSTOMER_HW
99 bcm_wlan_power_off(2); 99 bcm_wlan_power_off(2);
100#endif /* CUSTOMER_HW */ 100#endif /* CUSTOMER_HW */
101#ifdef CUSTOMER_HW2 101#ifdef CUSTOMER_HW2
102 wifi_set_power(0, 0); 102 wifi_set_power(0, 0);
103#endif 103#endif
104 WL_ERROR(("=========== WLAN placed in RESET ========\n")); 104 WL_ERROR("=========== WLAN placed in RESET ========\n");
105 break; 105 break;
106 106
107 case WLAN_RESET_ON: 107 case WLAN_RESET_ON:
108 WL_TRACE(("%s: callc customer specific GPIO to remove WLAN RESET\n", 108 WL_TRACE("%s: callc customer specific GPIO to remove WLAN RESET\n",
109 __func__)); 109 __func__);
110#ifdef CUSTOMER_HW 110#ifdef CUSTOMER_HW
111 bcm_wlan_power_on(2); 111 bcm_wlan_power_on(2);
112#endif /* CUSTOMER_HW */ 112#endif /* CUSTOMER_HW */
113#ifdef CUSTOMER_HW2 113#ifdef CUSTOMER_HW2
114 wifi_set_power(1, 0); 114 wifi_set_power(1, 0);
115#endif 115#endif
116 WL_ERROR(("=========== WLAN going back to live ========\n")); 116 WL_ERROR("=========== WLAN going back to live ========\n");
117 break; 117 break;
118 118
119 case WLAN_POWER_OFF: 119 case WLAN_POWER_OFF:
120 WL_TRACE(("%s: call customer specific GPIO to turn off WL_REG_ON\n", 120 WL_TRACE("%s: call customer specific GPIO to turn off WL_REG_ON\n",
121 __func__)); 121 __func__);
122#ifdef CUSTOMER_HW 122#ifdef CUSTOMER_HW
123 bcm_wlan_power_off(1); 123 bcm_wlan_power_off(1);
124#endif /* CUSTOMER_HW */ 124#endif /* CUSTOMER_HW */
125 break; 125 break;
126 126
127 case WLAN_POWER_ON: 127 case WLAN_POWER_ON:
128 WL_TRACE(("%s: call customer specific GPIO to turn on WL_REG_ON\n", 128 WL_TRACE("%s: call customer specific GPIO to turn on WL_REG_ON\n",
129 __func__)); 129 __func__);
130#ifdef CUSTOMER_HW 130#ifdef CUSTOMER_HW
131 bcm_wlan_power_on(1); 131 bcm_wlan_power_on(1);
132#endif /* CUSTOMER_HW */ 132#endif /* CUSTOMER_HW */
@@ -140,7 +140,7 @@ void dhd_customer_gpio_wlan_ctrl(int onoff)
140/* Function to get custom MAC address */ 140/* Function to get custom MAC address */
141int dhd_custom_get_mac_address(unsigned char *buf) 141int dhd_custom_get_mac_address(unsigned char *buf)
142{ 142{
143 WL_TRACE(("%s Enter\n", __func__)); 143 WL_TRACE("%s Enter\n", __func__);
144 if (!buf) 144 if (!buf)
145 return -EINVAL; 145 return -EINVAL;
146 146
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 1e92f2e230fe..991463f4a7f4 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -337,7 +337,7 @@ static void wl_debugfs_remove_netdev(struct wl_priv *wl);
337 struct wl_iface *ci; \ 337 struct wl_iface *ci; \
338 if (unlikely(!(wl_cfg80211_dev && \ 338 if (unlikely(!(wl_cfg80211_dev && \
339 (ci = wl_get_drvdata(wl_cfg80211_dev))))) { \ 339 (ci = wl_get_drvdata(wl_cfg80211_dev))))) { \
340 WL_ERR(("wl_cfg80211_dev is unavailable\n")); \ 340 WL_ERR("wl_cfg80211_dev is unavailable\n"); \
341 BUG(); \ 341 BUG(); \
342 } \ 342 } \
343 ci_to_wl(ci); \ 343 ci_to_wl(ci); \
@@ -347,8 +347,8 @@ static void wl_debugfs_remove_netdev(struct wl_priv *wl);
347do { \ 347do { \
348 struct wl_priv *wl = wiphy_to_wl(wiphy); \ 348 struct wl_priv *wl = wiphy_to_wl(wiphy); \
349 if (unlikely(!test_bit(WL_STATUS_READY, &wl->status))) { \ 349 if (unlikely(!test_bit(WL_STATUS_READY, &wl->status))) { \
350 WL_INFO(("device is not ready : status (%d)\n", \ 350 WL_INFO("device is not ready : status (%d)\n", \
351 (int)wl->status)); \ 351 (int)wl->status); \
352 return -EIO; \ 352 return -EIO; \
353 } \ 353 } \
354} while (0) 354} while (0)
@@ -613,8 +613,8 @@ wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
613 switch (type) { 613 switch (type) {
614 case NL80211_IFTYPE_MONITOR: 614 case NL80211_IFTYPE_MONITOR:
615 case NL80211_IFTYPE_WDS: 615 case NL80211_IFTYPE_WDS:
616 WL_ERR(("type (%d) : currently we do not support this type\n", 616 WL_ERR("type (%d) : currently we do not support this type\n",
617 type)); 617 type);
618 return -EOPNOTSUPP; 618 return -EOPNOTSUPP;
619 case NL80211_IFTYPE_ADHOC: 619 case NL80211_IFTYPE_ADHOC:
620 wl->conf->mode = WL_MODE_IBSS; 620 wl->conf->mode = WL_MODE_IBSS;
@@ -630,15 +630,15 @@ wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
630 ap = htod32(ap); 630 ap = htod32(ap);
631 wdev = ndev->ieee80211_ptr; 631 wdev = ndev->ieee80211_ptr;
632 wdev->iftype = type; 632 wdev->iftype = type;
633 WL_DBG(("%s : ap (%d), infra (%d)\n", ndev->name, ap, infra)); 633 WL_DBG("%s : ap (%d), infra (%d)\n", ndev->name, ap, infra);
634 err = wl_dev_ioctl(ndev, WLC_SET_INFRA, &infra, sizeof(infra)); 634 err = wl_dev_ioctl(ndev, WLC_SET_INFRA, &infra, sizeof(infra));
635 if (unlikely(err)) { 635 if (unlikely(err)) {
636 WL_ERR(("WLC_SET_INFRA error (%d)\n", err)); 636 WL_ERR("WLC_SET_INFRA error (%d)\n", err);
637 return err; 637 return err;
638 } 638 }
639 err = wl_dev_ioctl(ndev, WLC_SET_AP, &ap, sizeof(ap)); 639 err = wl_dev_ioctl(ndev, WLC_SET_AP, &ap, sizeof(ap));
640 if (unlikely(err)) { 640 if (unlikely(err)) {
641 WL_ERR(("WLC_SET_AP error (%d)\n", err)); 641 WL_ERR("WLC_SET_AP error (%d)\n", err);
642 return err; 642 return err;
643 } 643 }
644 644
@@ -717,9 +717,9 @@ wl_run_iscan(struct wl_iscan_ctrl *iscan, struct wlc_ssid *ssid, u16 action)
717 iscan->ioctl_buf, WLC_IOCTL_SMLEN); 717 iscan->ioctl_buf, WLC_IOCTL_SMLEN);
718 if (unlikely(err)) { 718 if (unlikely(err)) {
719 if (err == -EBUSY) { 719 if (err == -EBUSY) {
720 WL_INFO(("system busy : iscan canceled\n")); 720 WL_INFO("system busy : iscan canceled\n");
721 } else { 721 } else {
722 WL_ERR(("error (%d)\n", err)); 722 WL_ERR("error (%d)\n", err);
723 } 723 }
724 } 724 }
725 kfree(params); 725 kfree(params);
@@ -743,7 +743,7 @@ static s32 wl_do_iscan(struct wl_priv *wl)
743 err = wl_dev_ioctl(wl_to_ndev(wl), WLC_SET_PASSIVE_SCAN, 743 err = wl_dev_ioctl(wl_to_ndev(wl), WLC_SET_PASSIVE_SCAN,
744 &passive_scan, sizeof(passive_scan)); 744 &passive_scan, sizeof(passive_scan));
745 if (unlikely(err)) { 745 if (unlikely(err)) {
746 WL_DBG(("error (%d)\n", err)); 746 WL_DBG("error (%d)\n", err);
747 return err; 747 return err;
748 } 748 }
749 wl_set_mpc(ndev, 0); 749 wl_set_mpc(ndev, 0);
@@ -769,12 +769,12 @@ __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
769 s32 err = 0; 769 s32 err = 0;
770 770
771 if (unlikely(test_bit(WL_STATUS_SCANNING, &wl->status))) { 771 if (unlikely(test_bit(WL_STATUS_SCANNING, &wl->status))) {
772 WL_ERR(("Scanning already : status (%d)\n", (int)wl->status)); 772 WL_ERR("Scanning already : status (%d)\n", (int)wl->status);
773 return -EAGAIN; 773 return -EAGAIN;
774 } 774 }
775 if (unlikely(test_bit(WL_STATUS_SCAN_ABORTING, &wl->status))) { 775 if (unlikely(test_bit(WL_STATUS_SCAN_ABORTING, &wl->status))) {
776 WL_ERR(("Scanning being aborted : status (%d)\n", 776 WL_ERR("Scanning being aborted : status (%d)\n",
777 (int)wl->status)); 777 (int)wl->status);
778 return -EAGAIN; 778 return -EAGAIN;
779 } 779 }
780 780
@@ -806,26 +806,26 @@ __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
806 else 806 else
807 goto scan_out; 807 goto scan_out;
808 } else { 808 } else {
809 WL_DBG(("ssid \"%s\", ssid_len (%d)\n", 809 WL_DBG("ssid \"%s\", ssid_len (%d)\n",
810 ssids->ssid, ssids->ssid_len)); 810 ssids->ssid, ssids->ssid_len);
811 memset(&sr->ssid, 0, sizeof(sr->ssid)); 811 memset(&sr->ssid, 0, sizeof(sr->ssid));
812 sr->ssid.SSID_len = 812 sr->ssid.SSID_len =
813 min_t(u8, sizeof(sr->ssid.SSID), ssids->ssid_len); 813 min_t(u8, sizeof(sr->ssid.SSID), ssids->ssid_len);
814 if (sr->ssid.SSID_len) { 814 if (sr->ssid.SSID_len) {
815 memcpy(sr->ssid.SSID, ssids->ssid, sr->ssid.SSID_len); 815 memcpy(sr->ssid.SSID, ssids->ssid, sr->ssid.SSID_len);
816 sr->ssid.SSID_len = htod32(sr->ssid.SSID_len); 816 sr->ssid.SSID_len = htod32(sr->ssid.SSID_len);
817 WL_DBG(("Specific scan ssid=\"%s\" len=%d\n", 817 WL_DBG("Specific scan ssid=\"%s\" len=%d\n",
818 sr->ssid.SSID, sr->ssid.SSID_len)); 818 sr->ssid.SSID, sr->ssid.SSID_len);
819 spec_scan = true; 819 spec_scan = true;
820 } else { 820 } else {
821 WL_DBG(("Broadcast scan\n")); 821 WL_DBG("Broadcast scan\n");
822 } 822 }
823 WL_DBG(("sr->ssid.SSID_len (%d)\n", sr->ssid.SSID_len)); 823 WL_DBG("sr->ssid.SSID_len (%d)\n", sr->ssid.SSID_len);
824 passive_scan = wl->active_scan ? 0 : 1; 824 passive_scan = wl->active_scan ? 0 : 1;
825 err = wl_dev_ioctl(ndev, WLC_SET_PASSIVE_SCAN, 825 err = wl_dev_ioctl(ndev, WLC_SET_PASSIVE_SCAN,
826 &passive_scan, sizeof(passive_scan)); 826 &passive_scan, sizeof(passive_scan));
827 if (unlikely(err)) { 827 if (unlikely(err)) {
828 WL_ERR(("WLC_SET_PASSIVE_SCAN error (%d)\n", err)); 828 WL_ERR("WLC_SET_PASSIVE_SCAN error (%d)\n", err);
829 goto scan_out; 829 goto scan_out;
830 } 830 }
831 wl_set_mpc(ndev, 0); 831 wl_set_mpc(ndev, 0);
@@ -833,10 +833,10 @@ __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
833 sizeof(sr->ssid)); 833 sizeof(sr->ssid));
834 if (err) { 834 if (err) {
835 if (err == -EBUSY) { 835 if (err == -EBUSY) {
836 WL_INFO(("system busy : scan for \"%s\" " 836 WL_INFO("system busy : scan for \"%s\" canceled\n",
837 "canceled\n", sr->ssid.SSID)); 837 sr->ssid.SSID);
838 } else { 838 } else {
839 WL_ERR(("WLC_SCAN error (%d)\n", err)); 839 WL_ERR("WLC_SCAN error (%d)\n", err);
840 } 840 }
841 wl_set_mpc(ndev, 1); 841 wl_set_mpc(ndev, 1);
842 goto scan_out; 842 goto scan_out;
@@ -860,7 +860,7 @@ wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
860 CHECK_SYS_UP(); 860 CHECK_SYS_UP();
861 err = __wl_cfg80211_scan(wiphy, ndev, request, NULL); 861 err = __wl_cfg80211_scan(wiphy, ndev, request, NULL);
862 if (unlikely(err)) { 862 if (unlikely(err)) {
863 WL_DBG(("scan error (%d)\n", err)); 863 WL_DBG("scan error (%d)\n", err);
864 return err; 864 return err;
865 } 865 }
866 866
@@ -879,7 +879,7 @@ static s32 wl_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
879 879
880 err = wl_dev_ioctl(dev, WLC_SET_VAR, buf, len); 880 err = wl_dev_ioctl(dev, WLC_SET_VAR, buf, len);
881 if (unlikely(err)) { 881 if (unlikely(err)) {
882 WL_ERR(("error (%d)\n", err)); 882 WL_ERR("error (%d)\n", err);
883 } 883 }
884 884
885 return err; 885 return err;
@@ -902,7 +902,7 @@ wl_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
902 BUG_ON(unlikely(!len)); 902 BUG_ON(unlikely(!len));
903 err = wl_dev_ioctl(dev, WLC_GET_VAR, &var, len); 903 err = wl_dev_ioctl(dev, WLC_GET_VAR, &var, len);
904 if (unlikely(err)) { 904 if (unlikely(err)) {
905 WL_ERR(("error (%d)\n", err)); 905 WL_ERR("error (%d)\n", err);
906 } 906 }
907 *retval = dtoh32(var.val); 907 *retval = dtoh32(var.val);
908 908
@@ -915,7 +915,7 @@ static s32 wl_set_rts(struct net_device *dev, u32 rts_threshold)
915 915
916 err = wl_dev_intvar_set(dev, "rtsthresh", rts_threshold); 916 err = wl_dev_intvar_set(dev, "rtsthresh", rts_threshold);
917 if (unlikely(err)) { 917 if (unlikely(err)) {
918 WL_ERR(("Error (%d)\n", err)); 918 WL_ERR("Error (%d)\n", err);
919 return err; 919 return err;
920 } 920 }
921 return err; 921 return err;
@@ -927,7 +927,7 @@ static s32 wl_set_frag(struct net_device *dev, u32 frag_threshold)
927 927
928 err = wl_dev_intvar_set(dev, "fragthresh", frag_threshold); 928 err = wl_dev_intvar_set(dev, "fragthresh", frag_threshold);
929 if (unlikely(err)) { 929 if (unlikely(err)) {
930 WL_ERR(("Error (%d)\n", err)); 930 WL_ERR("Error (%d)\n", err);
931 return err; 931 return err;
932 } 932 }
933 return err; 933 return err;
@@ -941,7 +941,7 @@ static s32 wl_set_retry(struct net_device *dev, u32 retry, bool l)
941 retry = htod32(retry); 941 retry = htod32(retry);
942 err = wl_dev_ioctl(dev, cmd, &retry, sizeof(retry)); 942 err = wl_dev_ioctl(dev, cmd, &retry, sizeof(retry));
943 if (unlikely(err)) { 943 if (unlikely(err)) {
944 WL_ERR(("cmd (%d) , error (%d)\n", cmd, err)); 944 WL_ERR("cmd (%d) , error (%d)\n", cmd, err);
945 return err; 945 return err;
946 } 946 }
947 return err; 947 return err;
@@ -1001,7 +1001,7 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
1001 1001
1002 CHECK_SYS_UP(); 1002 CHECK_SYS_UP();
1003 if (params->bssid) { 1003 if (params->bssid) {
1004 WL_ERR(("Invalid bssid\n")); 1004 WL_ERR("Invalid bssid\n");
1005 return -EOPNOTSUPP; 1005 return -EOPNOTSUPP;
1006 } 1006 }
1007 bss = cfg80211_get_ibss(wiphy, NULL, params->ssid, params->ssid_len); 1007 bss = cfg80211_get_ibss(wiphy, NULL, params->ssid, params->ssid_len);
@@ -1027,7 +1027,7 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
1027 } 1027 }
1028 if (bss) { 1028 if (bss) {
1029 wl->ibss_starter = false; 1029 wl->ibss_starter = false;
1030 WL_DBG(("Found IBSS\n")); 1030 WL_DBG("Found IBSS\n");
1031 } else { 1031 } else {
1032 wl->ibss_starter = true; 1032 wl->ibss_starter = true;
1033 } 1033 }
@@ -1051,7 +1051,7 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
1051 err = wl_dev_ioctl(dev, WLC_SET_SSID, &join_params, 1051 err = wl_dev_ioctl(dev, WLC_SET_SSID, &join_params,
1052 sizeof(join_params)); 1052 sizeof(join_params));
1053 if (unlikely(err)) { 1053 if (unlikely(err)) {
1054 WL_ERR(("Error (%d)\n", err)); 1054 WL_ERR("Error (%d)\n", err);
1055 return err; 1055 return err;
1056 } 1056 }
1057 return err; 1057 return err;
@@ -1082,10 +1082,10 @@ wl_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sme)
1082 val = WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED; 1082 val = WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED;
1083 else 1083 else
1084 val = WPA_AUTH_DISABLED; 1084 val = WPA_AUTH_DISABLED;
1085 WL_DBG(("setting wpa_auth to 0x%0x\n", val)); 1085 WL_DBG("setting wpa_auth to 0x%0x\n", val);
1086 err = wl_dev_intvar_set(dev, "wpa_auth", val); 1086 err = wl_dev_intvar_set(dev, "wpa_auth", val);
1087 if (unlikely(err)) { 1087 if (unlikely(err)) {
1088 WL_ERR(("set wpa_auth failed (%d)\n", err)); 1088 WL_ERR("set wpa_auth failed (%d)\n", err);
1089 return err; 1089 return err;
1090 } 1090 }
1091 sec = wl_read_prof(wl, WL_PROF_SEC); 1091 sec = wl_read_prof(wl, WL_PROF_SEC);
@@ -1104,27 +1104,27 @@ wl_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
1104 switch (sme->auth_type) { 1104 switch (sme->auth_type) {
1105 case NL80211_AUTHTYPE_OPEN_SYSTEM: 1105 case NL80211_AUTHTYPE_OPEN_SYSTEM:
1106 val = 0; 1106 val = 0;
1107 WL_DBG(("open system\n")); 1107 WL_DBG("open system\n");
1108 break; 1108 break;
1109 case NL80211_AUTHTYPE_SHARED_KEY: 1109 case NL80211_AUTHTYPE_SHARED_KEY:
1110 val = 1; 1110 val = 1;
1111 WL_DBG(("shared key\n")); 1111 WL_DBG("shared key\n");
1112 break; 1112 break;
1113 case NL80211_AUTHTYPE_AUTOMATIC: 1113 case NL80211_AUTHTYPE_AUTOMATIC:
1114 val = 2; 1114 val = 2;
1115 WL_DBG(("automatic\n")); 1115 WL_DBG("automatic\n");
1116 break; 1116 break;
1117 case NL80211_AUTHTYPE_NETWORK_EAP: 1117 case NL80211_AUTHTYPE_NETWORK_EAP:
1118 WL_DBG(("network eap\n")); 1118 WL_DBG("network eap\n");
1119 default: 1119 default:
1120 val = 2; 1120 val = 2;
1121 WL_ERR(("invalid auth type (%d)\n", sme->auth_type)); 1121 WL_ERR("invalid auth type (%d)\n", sme->auth_type);
1122 break; 1122 break;
1123 } 1123 }
1124 1124
1125 err = wl_dev_intvar_set(dev, "auth", val); 1125 err = wl_dev_intvar_set(dev, "auth", val);
1126 if (unlikely(err)) { 1126 if (unlikely(err)) {
1127 WL_ERR(("set auth failed (%d)\n", err)); 1127 WL_ERR("set auth failed (%d)\n", err);
1128 return err; 1128 return err;
1129 } 1129 }
1130 sec = wl_read_prof(wl, WL_PROF_SEC); 1130 sec = wl_read_prof(wl, WL_PROF_SEC);
@@ -1157,8 +1157,8 @@ wl_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme)
1157 pval = AES_ENABLED; 1157 pval = AES_ENABLED;
1158 break; 1158 break;
1159 default: 1159 default:
1160 WL_ERR(("invalid cipher pairwise (%d)\n", 1160 WL_ERR("invalid cipher pairwise (%d)\n",
1161 sme->crypto.ciphers_pairwise[0])); 1161 sme->crypto.ciphers_pairwise[0]);
1162 return -EINVAL; 1162 return -EINVAL;
1163 } 1163 }
1164 } 1164 }
@@ -1178,16 +1178,16 @@ wl_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme)
1178 gval = AES_ENABLED; 1178 gval = AES_ENABLED;
1179 break; 1179 break;
1180 default: 1180 default:
1181 WL_ERR(("invalid cipher group (%d)\n", 1181 WL_ERR("invalid cipher group (%d)\n",
1182 sme->crypto.cipher_group)); 1182 sme->crypto.cipher_group);
1183 return -EINVAL; 1183 return -EINVAL;
1184 } 1184 }
1185 } 1185 }
1186 1186
1187 WL_DBG(("pval (%d) gval (%d)\n", pval, gval)); 1187 WL_DBG("pval (%d) gval (%d)\n", pval, gval);
1188 err = wl_dev_intvar_set(dev, "wsec", pval | gval); 1188 err = wl_dev_intvar_set(dev, "wsec", pval | gval);
1189 if (unlikely(err)) { 1189 if (unlikely(err)) {
1190 WL_ERR(("error (%d)\n", err)); 1190 WL_ERR("error (%d)\n", err);
1191 return err; 1191 return err;
1192 } 1192 }
1193 1193
@@ -1209,7 +1209,7 @@ wl_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
1209 if (sme->crypto.n_akm_suites) { 1209 if (sme->crypto.n_akm_suites) {
1210 err = wl_dev_intvar_get(dev, "wpa_auth", &val); 1210 err = wl_dev_intvar_get(dev, "wpa_auth", &val);
1211 if (unlikely(err)) { 1211 if (unlikely(err)) {
1212 WL_ERR(("could not get wpa_auth (%d)\n", err)); 1212 WL_ERR("could not get wpa_auth (%d)\n", err);
1213 return err; 1213 return err;
1214 } 1214 }
1215 if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED)) { 1215 if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED)) {
@@ -1221,8 +1221,8 @@ wl_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
1221 val = WPA_AUTH_PSK; 1221 val = WPA_AUTH_PSK;
1222 break; 1222 break;
1223 default: 1223 default:
1224 WL_ERR(("invalid cipher group (%d)\n", 1224 WL_ERR("invalid cipher group (%d)\n",
1225 sme->crypto.cipher_group)); 1225 sme->crypto.cipher_group);
1226 return -EINVAL; 1226 return -EINVAL;
1227 } 1227 }
1228 } else if (val & (WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED)) { 1228 } else if (val & (WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED)) {
@@ -1234,16 +1234,16 @@ wl_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
1234 val = WPA2_AUTH_PSK; 1234 val = WPA2_AUTH_PSK;
1235 break; 1235 break;
1236 default: 1236 default:
1237 WL_ERR(("invalid cipher group (%d)\n", 1237 WL_ERR("invalid cipher group (%d)\n",
1238 sme->crypto.cipher_group)); 1238 sme->crypto.cipher_group);
1239 return -EINVAL; 1239 return -EINVAL;
1240 } 1240 }
1241 } 1241 }
1242 1242
1243 WL_DBG(("setting wpa_auth to %d\n", val)); 1243 WL_DBG("setting wpa_auth to %d\n", val);
1244 err = wl_dev_intvar_set(dev, "wpa_auth", val); 1244 err = wl_dev_intvar_set(dev, "wpa_auth", val);
1245 if (unlikely(err)) { 1245 if (unlikely(err)) {
1246 WL_ERR(("could not set wpa_auth (%d)\n", err)); 1246 WL_ERR("could not set wpa_auth (%d)\n", err);
1247 return err; 1247 return err;
1248 } 1248 }
1249 } 1249 }
@@ -1263,11 +1263,11 @@ wl_set_set_sharedkey(struct net_device *dev,
1263 s32 val; 1263 s32 val;
1264 s32 err = 0; 1264 s32 err = 0;
1265 1265
1266 WL_DBG(("key len (%d)\n", sme->key_len)); 1266 WL_DBG("key len (%d)\n", sme->key_len);
1267 if (sme->key_len) { 1267 if (sme->key_len) {
1268 sec = wl_read_prof(wl, WL_PROF_SEC); 1268 sec = wl_read_prof(wl, WL_PROF_SEC);
1269 WL_DBG(("wpa_versions 0x%x cipher_pairwise 0x%x\n", 1269 WL_DBG("wpa_versions 0x%x cipher_pairwise 0x%x\n",
1270 sec->wpa_versions, sec->cipher_pairwise)); 1270 sec->wpa_versions, sec->cipher_pairwise);
1271 if (! 1271 if (!
1272 (sec->wpa_versions & (NL80211_WPA_VERSION_1 | 1272 (sec->wpa_versions & (NL80211_WPA_VERSION_1 |
1273 NL80211_WPA_VERSION_2)) 1273 NL80211_WPA_VERSION_2))
@@ -1277,7 +1277,7 @@ wl_set_set_sharedkey(struct net_device *dev,
1277 key.len = (u32) sme->key_len; 1277 key.len = (u32) sme->key_len;
1278 key.index = (u32) sme->key_idx; 1278 key.index = (u32) sme->key_idx;
1279 if (unlikely(key.len > sizeof(key.data))) { 1279 if (unlikely(key.len > sizeof(key.data))) {
1280 WL_ERR(("Too long key length (%u)\n", key.len)); 1280 WL_ERR("Too long key length (%u)\n", key.len);
1281 return -EINVAL; 1281 return -EINVAL;
1282 } 1282 }
1283 memcpy(key.data, sme->key, key.len); 1283 memcpy(key.data, sme->key, key.len);
@@ -1290,27 +1290,27 @@ wl_set_set_sharedkey(struct net_device *dev,
1290 key.algo = CRYPTO_ALGO_WEP128; 1290 key.algo = CRYPTO_ALGO_WEP128;
1291 break; 1291 break;
1292 default: 1292 default:
1293 WL_ERR(("Invalid algorithm (%d)\n", 1293 WL_ERR("Invalid algorithm (%d)\n",
1294 sme->crypto.ciphers_pairwise[0])); 1294 sme->crypto.ciphers_pairwise[0]);
1295 return -EINVAL; 1295 return -EINVAL;
1296 } 1296 }
1297 /* Set the new key/index */ 1297 /* Set the new key/index */
1298 WL_DBG(("key length (%d) key index (%d) algo (%d)\n", 1298 WL_DBG("key length (%d) key index (%d) algo (%d)\n",
1299 key.len, key.index, key.algo)); 1299 key.len, key.index, key.algo);
1300 WL_DBG(("key \"%s\"\n", key.data)); 1300 WL_DBG("key \"%s\"\n", key.data);
1301 swap_key_from_BE(&key); 1301 swap_key_from_BE(&key);
1302 err = wl_dev_ioctl(dev, WLC_SET_KEY, &key, 1302 err = wl_dev_ioctl(dev, WLC_SET_KEY, &key,
1303 sizeof(key)); 1303 sizeof(key));
1304 if (unlikely(err)) { 1304 if (unlikely(err)) {
1305 WL_ERR(("WLC_SET_KEY error (%d)\n", err)); 1305 WL_ERR("WLC_SET_KEY error (%d)\n", err);
1306 return err; 1306 return err;
1307 } 1307 }
1308 if (sec->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) { 1308 if (sec->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) {
1309 WL_DBG(("set auth_type to shared key\n")); 1309 WL_DBG("set auth_type to shared key\n");
1310 val = 1; /* shared key */ 1310 val = 1; /* shared key */
1311 err = wl_dev_intvar_set(dev, "auth", val); 1311 err = wl_dev_intvar_set(dev, "auth", val);
1312 if (unlikely(err)) { 1312 if (unlikely(err)) {
1313 WL_ERR(("set auth failed (%d)\n", err)); 1313 WL_ERR("set auth failed (%d)\n", err);
1314 return err; 1314 return err;
1315 } 1315 }
1316 } 1316 }
@@ -1332,15 +1332,15 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
1332 1332
1333 CHECK_SYS_UP(); 1333 CHECK_SYS_UP();
1334 if (unlikely(!sme->ssid)) { 1334 if (unlikely(!sme->ssid)) {
1335 WL_ERR(("Invalid ssid\n")); 1335 WL_ERR("Invalid ssid\n");
1336 return -EOPNOTSUPP; 1336 return -EOPNOTSUPP;
1337 } 1337 }
1338 if (chan) { 1338 if (chan) {
1339 wl->channel = ieee80211_frequency_to_channel(chan->center_freq); 1339 wl->channel = ieee80211_frequency_to_channel(chan->center_freq);
1340 WL_DBG(("channel (%d), center_req (%d)\n", wl->channel, 1340 WL_DBG("channel (%d), center_req (%d)\n",
1341 chan->center_freq)); 1341 wl->channel, chan->center_freq);
1342 } 1342 }
1343 WL_DBG(("ie (%p), ie_len (%zd)\n", sme->ie, sme->ie_len)); 1343 WL_DBG("ie (%p), ie_len (%zd)\n", sme->ie, sme->ie_len);
1344 err = wl_set_wpa_version(dev, sme); 1344 err = wl_set_wpa_version(dev, sme);
1345 if (unlikely(err)) 1345 if (unlikely(err))
1346 return err; 1346 return err;
@@ -1376,15 +1376,15 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
1376 memcpy(&join_params.params.bssid, &ether_bcast, ETH_ALEN); 1376 memcpy(&join_params.params.bssid, &ether_bcast, ETH_ALEN);
1377 1377
1378 wl_ch_to_chanspec(wl->channel, &join_params, &join_params_size); 1378 wl_ch_to_chanspec(wl->channel, &join_params, &join_params_size);
1379 WL_DBG(("join_param_size %d\n", join_params_size)); 1379 WL_DBG("join_param_size %d\n", join_params_size);
1380 1380
1381 if (join_params.ssid.SSID_len < IEEE80211_MAX_SSID_LEN) { 1381 if (join_params.ssid.SSID_len < IEEE80211_MAX_SSID_LEN) {
1382 WL_DBG(("ssid \"%s\", len (%d)\n", join_params.ssid.SSID, 1382 WL_DBG("ssid \"%s\", len (%d)\n",
1383 join_params.ssid.SSID_len)); 1383 join_params.ssid.SSID, join_params.ssid.SSID_len);
1384 } 1384 }
1385 err = wl_dev_ioctl(dev, WLC_SET_SSID, &join_params, join_params_size); 1385 err = wl_dev_ioctl(dev, WLC_SET_SSID, &join_params, join_params_size);
1386 if (unlikely(err)) { 1386 if (unlikely(err)) {
1387 WL_ERR(("error (%d)\n", err)); 1387 WL_ERR("error (%d)\n", err);
1388 return err; 1388 return err;
1389 } 1389 }
1390 set_bit(WL_STATUS_CONNECTING, &wl->status); 1390 set_bit(WL_STATUS_CONNECTING, &wl->status);
@@ -1401,7 +1401,7 @@ wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
1401 bool act = false; 1401 bool act = false;
1402 s32 err = 0; 1402 s32 err = 0;
1403 1403
1404 WL_DBG(("Reason %d\n", reason_code)); 1404 WL_DBG("Reason %d\n", reason_code);
1405 CHECK_SYS_UP(); 1405 CHECK_SYS_UP();
1406 act = *(bool *) wl_read_prof(wl, WL_PROF_ACT); 1406 act = *(bool *) wl_read_prof(wl, WL_PROF_ACT);
1407 if (likely(act)) { 1407 if (likely(act)) {
@@ -1411,7 +1411,7 @@ wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
1411 err = wl_dev_ioctl(dev, WLC_DISASSOC, &scbval, 1411 err = wl_dev_ioctl(dev, WLC_DISASSOC, &scbval,
1412 sizeof(scb_val_t)); 1412 sizeof(scb_val_t));
1413 if (unlikely(err)) { 1413 if (unlikely(err)) {
1414 WL_ERR(("error (%d)\n", err)); 1414 WL_ERR("error (%d)\n", err);
1415 return err; 1415 return err;
1416 } 1416 }
1417 } 1417 }
@@ -1436,13 +1436,13 @@ wl_cfg80211_set_tx_power(struct wiphy *wiphy,
1436 break; 1436 break;
1437 case NL80211_TX_POWER_LIMITED: 1437 case NL80211_TX_POWER_LIMITED:
1438 if (dbm < 0) { 1438 if (dbm < 0) {
1439 WL_ERR(("TX_POWER_LIMITTED - dbm is negative\n")); 1439 WL_ERR("TX_POWER_LIMITED - dbm is negative\n");
1440 return -EINVAL; 1440 return -EINVAL;
1441 } 1441 }
1442 break; 1442 break;
1443 case NL80211_TX_POWER_FIXED: 1443 case NL80211_TX_POWER_FIXED:
1444 if (dbm < 0) { 1444 if (dbm < 0) {
1445 WL_ERR(("TX_POWER_FIXED - dbm is negative..\n")); 1445 WL_ERR("TX_POWER_FIXED - dbm is negative\n");
1446 return -EINVAL; 1446 return -EINVAL;
1447 } 1447 }
1448 break; 1448 break;
@@ -1452,7 +1452,7 @@ wl_cfg80211_set_tx_power(struct wiphy *wiphy,
1452 disable = htod32(disable); 1452 disable = htod32(disable);
1453 err = wl_dev_ioctl(ndev, WLC_SET_RADIO, &disable, sizeof(disable)); 1453 err = wl_dev_ioctl(ndev, WLC_SET_RADIO, &disable, sizeof(disable));
1454 if (unlikely(err)) { 1454 if (unlikely(err)) {
1455 WL_ERR(("WLC_SET_RADIO error (%d)\n", err)); 1455 WL_ERR("WLC_SET_RADIO error (%d)\n", err);
1456 return err; 1456 return err;
1457 } 1457 }
1458 1458
@@ -1463,7 +1463,7 @@ wl_cfg80211_set_tx_power(struct wiphy *wiphy,
1463 err = wl_dev_intvar_set(ndev, "qtxpower", 1463 err = wl_dev_intvar_set(ndev, "qtxpower",
1464 (s32) (bcm_mw_to_qdbm(txpwrmw))); 1464 (s32) (bcm_mw_to_qdbm(txpwrmw)));
1465 if (unlikely(err)) { 1465 if (unlikely(err)) {
1466 WL_ERR(("qtxpower error (%d)\n", err)); 1466 WL_ERR("qtxpower error (%d)\n", err);
1467 return err; 1467 return err;
1468 } 1468 }
1469 wl->conf->tx_power = dbm; 1469 wl->conf->tx_power = dbm;
@@ -1482,7 +1482,7 @@ static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
1482 CHECK_SYS_UP(); 1482 CHECK_SYS_UP();
1483 err = wl_dev_intvar_get(ndev, "qtxpower", &txpwrdbm); 1483 err = wl_dev_intvar_get(ndev, "qtxpower", &txpwrdbm);
1484 if (unlikely(err)) { 1484 if (unlikely(err)) {
1485 WL_ERR(("error (%d)\n", err)); 1485 WL_ERR("error (%d)\n", err);
1486 return err; 1486 return err;
1487 } 1487 }
1488 result = (u8) (txpwrdbm & ~WL_TXPWR_OVERRIDE); 1488 result = (u8) (txpwrdbm & ~WL_TXPWR_OVERRIDE);
@@ -1499,12 +1499,12 @@ wl_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
1499 s32 wsec; 1499 s32 wsec;
1500 s32 err = 0; 1500 s32 err = 0;
1501 1501
1502 WL_DBG(("key index (%d)\n", key_idx)); 1502 WL_DBG("key index (%d)\n", key_idx);
1503 CHECK_SYS_UP(); 1503 CHECK_SYS_UP();
1504 1504
1505 err = wl_dev_ioctl(dev, WLC_GET_WSEC, &wsec, sizeof(wsec)); 1505 err = wl_dev_ioctl(dev, WLC_GET_WSEC, &wsec, sizeof(wsec));
1506 if (unlikely(err)) { 1506 if (unlikely(err)) {
1507 WL_ERR(("WLC_GET_WSEC error (%d)\n", err)); 1507 WL_ERR("WLC_GET_WSEC error (%d)\n", err);
1508 return err; 1508 return err;
1509 } 1509 }
1510 wsec = dtoh32(wsec); 1510 wsec = dtoh32(wsec);
@@ -1515,7 +1515,7 @@ wl_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
1515 err = wl_dev_ioctl(dev, WLC_SET_KEY_PRIMARY, &index, 1515 err = wl_dev_ioctl(dev, WLC_SET_KEY_PRIMARY, &index,
1516 sizeof(index)); 1516 sizeof(index));
1517 if (unlikely(err)) { 1517 if (unlikely(err)) {
1518 WL_ERR(("error (%d)\n", err)); 1518 WL_ERR("error (%d)\n", err);
1519 } 1519 }
1520 } 1520 }
1521 return err; 1521 return err;
@@ -1541,16 +1541,16 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
1541 swap_key_from_BE(&key); 1541 swap_key_from_BE(&key);
1542 err = wl_dev_ioctl(dev, WLC_SET_KEY, &key, sizeof(key)); 1542 err = wl_dev_ioctl(dev, WLC_SET_KEY, &key, sizeof(key));
1543 if (unlikely(err)) { 1543 if (unlikely(err)) {
1544 WL_ERR(("key delete error (%d)\n", err)); 1544 WL_ERR("key delete error (%d)\n", err);
1545 return err; 1545 return err;
1546 } 1546 }
1547 } else { 1547 } else {
1548 if (key.len > sizeof(key.data)) { 1548 if (key.len > sizeof(key.data)) {
1549 WL_ERR(("Invalid key length (%d)\n", key.len)); 1549 WL_ERR("Invalid key length (%d)\n", key.len);
1550 return -EINVAL; 1550 return -EINVAL;
1551 } 1551 }
1552 1552
1553 WL_DBG(("Setting the key index %d\n", key.index)); 1553 WL_DBG("Setting the key index %d\n", key.index);
1554 memcpy(key.data, params->key, key.len); 1554 memcpy(key.data, params->key, key.len);
1555 1555
1556 if (params->cipher == WLAN_CIPHER_SUITE_TKIP) { 1556 if (params->cipher == WLAN_CIPHER_SUITE_TKIP) {
@@ -1574,26 +1574,26 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
1574 switch (params->cipher) { 1574 switch (params->cipher) {
1575 case WLAN_CIPHER_SUITE_WEP40: 1575 case WLAN_CIPHER_SUITE_WEP40:
1576 key.algo = CRYPTO_ALGO_WEP1; 1576 key.algo = CRYPTO_ALGO_WEP1;
1577 WL_DBG(("WLAN_CIPHER_SUITE_WEP40\n")); 1577 WL_DBG("WLAN_CIPHER_SUITE_WEP40\n");
1578 break; 1578 break;
1579 case WLAN_CIPHER_SUITE_WEP104: 1579 case WLAN_CIPHER_SUITE_WEP104:
1580 key.algo = CRYPTO_ALGO_WEP128; 1580 key.algo = CRYPTO_ALGO_WEP128;
1581 WL_DBG(("WLAN_CIPHER_SUITE_WEP104\n")); 1581 WL_DBG("WLAN_CIPHER_SUITE_WEP104\n");
1582 break; 1582 break;
1583 case WLAN_CIPHER_SUITE_TKIP: 1583 case WLAN_CIPHER_SUITE_TKIP:
1584 key.algo = CRYPTO_ALGO_TKIP; 1584 key.algo = CRYPTO_ALGO_TKIP;
1585 WL_DBG(("WLAN_CIPHER_SUITE_TKIP\n")); 1585 WL_DBG("WLAN_CIPHER_SUITE_TKIP\n");
1586 break; 1586 break;
1587 case WLAN_CIPHER_SUITE_AES_CMAC: 1587 case WLAN_CIPHER_SUITE_AES_CMAC:
1588 key.algo = CRYPTO_ALGO_AES_CCM; 1588 key.algo = CRYPTO_ALGO_AES_CCM;
1589 WL_DBG(("WLAN_CIPHER_SUITE_AES_CMAC\n")); 1589 WL_DBG("WLAN_CIPHER_SUITE_AES_CMAC\n");
1590 break; 1590 break;
1591 case WLAN_CIPHER_SUITE_CCMP: 1591 case WLAN_CIPHER_SUITE_CCMP:
1592 key.algo = CRYPTO_ALGO_AES_CCM; 1592 key.algo = CRYPTO_ALGO_AES_CCM;
1593 WL_DBG(("WLAN_CIPHER_SUITE_CCMP\n")); 1593 WL_DBG("WLAN_CIPHER_SUITE_CCMP\n");
1594 break; 1594 break;
1595 default: 1595 default:
1596 WL_ERR(("Invalid cipher (0x%x)\n", params->cipher)); 1596 WL_ERR("Invalid cipher (0x%x)\n", params->cipher);
1597 return -EINVAL; 1597 return -EINVAL;
1598 } 1598 }
1599 swap_key_from_BE(&key); 1599 swap_key_from_BE(&key);
@@ -1601,7 +1601,7 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
1601 dhd_wait_pend8021x(dev); 1601 dhd_wait_pend8021x(dev);
1602 err = wl_dev_ioctl(dev, WLC_SET_KEY, &key, sizeof(key)); 1602 err = wl_dev_ioctl(dev, WLC_SET_KEY, &key, sizeof(key));
1603 if (unlikely(err)) { 1603 if (unlikely(err)) {
1604 WL_ERR(("WLC_SET_KEY error (%d)\n", err)); 1604 WL_ERR("WLC_SET_KEY error (%d)\n", err);
1605 return err; 1605 return err;
1606 } 1606 }
1607 } 1607 }
@@ -1618,7 +1618,7 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
1618 s32 wsec; 1618 s32 wsec;
1619 s32 err = 0; 1619 s32 err = 0;
1620 1620
1621 WL_DBG(("key index (%d)\n", key_idx)); 1621 WL_DBG("key index (%d)\n", key_idx);
1622 CHECK_SYS_UP(); 1622 CHECK_SYS_UP();
1623 1623
1624 if (mac_addr) 1624 if (mac_addr)
@@ -1629,7 +1629,7 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
1629 key.index = (u32) key_idx; 1629 key.index = (u32) key_idx;
1630 1630
1631 if (unlikely(key.len > sizeof(key.data))) { 1631 if (unlikely(key.len > sizeof(key.data))) {
1632 WL_ERR(("Too long key length (%u)\n", key.len)); 1632 WL_ERR("Too long key length (%u)\n", key.len);
1633 return -EINVAL; 1633 return -EINVAL;
1634 } 1634 }
1635 memcpy(key.data, params->key, key.len); 1635 memcpy(key.data, params->key, key.len);
@@ -1638,26 +1638,26 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
1638 switch (params->cipher) { 1638 switch (params->cipher) {
1639 case WLAN_CIPHER_SUITE_WEP40: 1639 case WLAN_CIPHER_SUITE_WEP40:
1640 key.algo = CRYPTO_ALGO_WEP1; 1640 key.algo = CRYPTO_ALGO_WEP1;
1641 WL_DBG(("WLAN_CIPHER_SUITE_WEP40\n")); 1641 WL_DBG("WLAN_CIPHER_SUITE_WEP40\n");
1642 break; 1642 break;
1643 case WLAN_CIPHER_SUITE_WEP104: 1643 case WLAN_CIPHER_SUITE_WEP104:
1644 key.algo = CRYPTO_ALGO_WEP128; 1644 key.algo = CRYPTO_ALGO_WEP128;
1645 WL_DBG(("WLAN_CIPHER_SUITE_WEP104\n")); 1645 WL_DBG("WLAN_CIPHER_SUITE_WEP104\n");
1646 break; 1646 break;
1647 case WLAN_CIPHER_SUITE_TKIP: 1647 case WLAN_CIPHER_SUITE_TKIP:
1648 key.algo = CRYPTO_ALGO_TKIP; 1648 key.algo = CRYPTO_ALGO_TKIP;
1649 WL_DBG(("WLAN_CIPHER_SUITE_TKIP\n")); 1649 WL_DBG("WLAN_CIPHER_SUITE_TKIP\n");
1650 break; 1650 break;
1651 case WLAN_CIPHER_SUITE_AES_CMAC: 1651 case WLAN_CIPHER_SUITE_AES_CMAC:
1652 key.algo = CRYPTO_ALGO_AES_CCM; 1652 key.algo = CRYPTO_ALGO_AES_CCM;
1653 WL_DBG(("WLAN_CIPHER_SUITE_AES_CMAC\n")); 1653 WL_DBG("WLAN_CIPHER_SUITE_AES_CMAC\n");
1654 break; 1654 break;
1655 case WLAN_CIPHER_SUITE_CCMP: 1655 case WLAN_CIPHER_SUITE_CCMP:
1656 key.algo = CRYPTO_ALGO_AES_CCM; 1656 key.algo = CRYPTO_ALGO_AES_CCM;
1657 WL_DBG(("WLAN_CIPHER_SUITE_CCMP\n")); 1657 WL_DBG("WLAN_CIPHER_SUITE_CCMP\n");
1658 break; 1658 break;
1659 default: 1659 default:
1660 WL_ERR(("Invalid cipher (0x%x)\n", params->cipher)); 1660 WL_ERR("Invalid cipher (0x%x)\n", params->cipher);
1661 return -EINVAL; 1661 return -EINVAL;
1662 } 1662 }
1663 1663
@@ -1665,21 +1665,21 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
1665 swap_key_from_BE(&key); 1665 swap_key_from_BE(&key);
1666 err = wl_dev_ioctl(dev, WLC_SET_KEY, &key, sizeof(key)); 1666 err = wl_dev_ioctl(dev, WLC_SET_KEY, &key, sizeof(key));
1667 if (unlikely(err)) { 1667 if (unlikely(err)) {
1668 WL_ERR(("WLC_SET_KEY error (%d)\n", err)); 1668 WL_ERR("WLC_SET_KEY error (%d)\n", err);
1669 return err; 1669 return err;
1670 } 1670 }
1671 1671
1672 val = WEP_ENABLED; 1672 val = WEP_ENABLED;
1673 err = wl_dev_intvar_get(dev, "wsec", &wsec); 1673 err = wl_dev_intvar_get(dev, "wsec", &wsec);
1674 if (unlikely(err)) { 1674 if (unlikely(err)) {
1675 WL_ERR(("get wsec error (%d)\n", err)); 1675 WL_ERR("get wsec error (%d)\n", err);
1676 return err; 1676 return err;
1677 } 1677 }
1678 wsec &= ~(WEP_ENABLED); 1678 wsec &= ~(WEP_ENABLED);
1679 wsec |= val; 1679 wsec |= val;
1680 err = wl_dev_intvar_set(dev, "wsec", wsec); 1680 err = wl_dev_intvar_set(dev, "wsec", wsec);
1681 if (unlikely(err)) { 1681 if (unlikely(err)) {
1682 WL_ERR(("set wsec error (%d)\n", err)); 1682 WL_ERR("set wsec error (%d)\n", err);
1683 return err; 1683 return err;
1684 } 1684 }
1685 1685
@@ -1687,7 +1687,7 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
1687 val = htod32(val); 1687 val = htod32(val);
1688 err = wl_dev_ioctl(dev, WLC_SET_AUTH, &val, sizeof(val)); 1688 err = wl_dev_ioctl(dev, WLC_SET_AUTH, &val, sizeof(val));
1689 if (unlikely(err)) { 1689 if (unlikely(err)) {
1690 WL_ERR(("WLC_SET_AUTH error (%d)\n", err)); 1690 WL_ERR("WLC_SET_AUTH error (%d)\n", err);
1691 return err; 1691 return err;
1692 } 1692 }
1693 return err; 1693 return err;
@@ -1709,7 +1709,7 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
1709 key.flags = WL_PRIMARY_KEY; 1709 key.flags = WL_PRIMARY_KEY;
1710 key.algo = CRYPTO_ALGO_OFF; 1710 key.algo = CRYPTO_ALGO_OFF;
1711 1711
1712 WL_DBG(("key index (%d)\n", key_idx)); 1712 WL_DBG("key index (%d)\n", key_idx);
1713 /* Set the new key/index */ 1713 /* Set the new key/index */
1714 swap_key_from_BE(&key); 1714 swap_key_from_BE(&key);
1715 err = wl_dev_ioctl(dev, WLC_SET_KEY, &key, sizeof(key)); 1715 err = wl_dev_ioctl(dev, WLC_SET_KEY, &key, sizeof(key));
@@ -1717,10 +1717,10 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
1717 if (err == -EINVAL) { 1717 if (err == -EINVAL) {
1718 if (key.index >= DOT11_MAX_DEFAULT_KEYS) { 1718 if (key.index >= DOT11_MAX_DEFAULT_KEYS) {
1719 /* we ignore this key index in this case */ 1719 /* we ignore this key index in this case */
1720 WL_DBG(("invalid key index (%d)\n", key_idx)); 1720 WL_DBG("invalid key index (%d)\n", key_idx);
1721 } 1721 }
1722 } else { 1722 } else {
1723 WL_ERR(("WLC_SET_KEY error (%d)\n", err)); 1723 WL_ERR("WLC_SET_KEY error (%d)\n", err);
1724 } 1724 }
1725 return err; 1725 return err;
1726 } 1726 }
@@ -1728,14 +1728,14 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
1728 val = 0; 1728 val = 0;
1729 err = wl_dev_intvar_get(dev, "wsec", &wsec); 1729 err = wl_dev_intvar_get(dev, "wsec", &wsec);
1730 if (unlikely(err)) { 1730 if (unlikely(err)) {
1731 WL_ERR(("get wsec error (%d)\n", err)); 1731 WL_ERR("get wsec error (%d)\n", err);
1732 return err; 1732 return err;
1733 } 1733 }
1734 wsec &= ~(WEP_ENABLED); 1734 wsec &= ~(WEP_ENABLED);
1735 wsec |= val; 1735 wsec |= val;
1736 err = wl_dev_intvar_set(dev, "wsec", wsec); 1736 err = wl_dev_intvar_set(dev, "wsec", wsec);
1737 if (unlikely(err)) { 1737 if (unlikely(err)) {
1738 WL_ERR(("set wsec error (%d)\n", err)); 1738 WL_ERR("set wsec error (%d)\n", err);
1739 return err; 1739 return err;
1740 } 1740 }
1741 1741
@@ -1743,7 +1743,7 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
1743 val = htod32(val); 1743 val = htod32(val);
1744 err = wl_dev_ioctl(dev, WLC_SET_AUTH, &val, sizeof(val)); 1744 err = wl_dev_ioctl(dev, WLC_SET_AUTH, &val, sizeof(val));
1745 if (unlikely(err)) { 1745 if (unlikely(err)) {
1746 WL_ERR(("WLC_SET_AUTH error (%d)\n", err)); 1746 WL_ERR("WLC_SET_AUTH error (%d)\n", err);
1747 return err; 1747 return err;
1748 } 1748 }
1749 return err; 1749 return err;
@@ -1761,7 +1761,7 @@ wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
1761 s32 wsec; 1761 s32 wsec;
1762 s32 err = 0; 1762 s32 err = 0;
1763 1763
1764 WL_DBG(("key index (%d)\n", key_idx)); 1764 WL_DBG("key index (%d)\n", key_idx);
1765 CHECK_SYS_UP(); 1765 CHECK_SYS_UP();
1766 1766
1767 memset(&key, 0, sizeof(key)); 1767 memset(&key, 0, sizeof(key));
@@ -1773,7 +1773,7 @@ wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
1773 1773
1774 err = wl_dev_ioctl(dev, WLC_GET_WSEC, &wsec, sizeof(wsec)); 1774 err = wl_dev_ioctl(dev, WLC_GET_WSEC, &wsec, sizeof(wsec));
1775 if (unlikely(err)) { 1775 if (unlikely(err)) {
1776 WL_ERR(("WLC_GET_WSEC error (%d)\n", err)); 1776 WL_ERR("WLC_GET_WSEC error (%d)\n", err);
1777 return err; 1777 return err;
1778 } 1778 }
1779 wsec = dtoh32(wsec); 1779 wsec = dtoh32(wsec);
@@ -1782,22 +1782,22 @@ wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
1782 sec = wl_read_prof(wl, WL_PROF_SEC); 1782 sec = wl_read_prof(wl, WL_PROF_SEC);
1783 if (sec->cipher_pairwise & WLAN_CIPHER_SUITE_WEP40) { 1783 if (sec->cipher_pairwise & WLAN_CIPHER_SUITE_WEP40) {
1784 params.cipher = WLAN_CIPHER_SUITE_WEP40; 1784 params.cipher = WLAN_CIPHER_SUITE_WEP40;
1785 WL_DBG(("WLAN_CIPHER_SUITE_WEP40\n")); 1785 WL_DBG("WLAN_CIPHER_SUITE_WEP40\n");
1786 } else if (sec->cipher_pairwise & WLAN_CIPHER_SUITE_WEP104) { 1786 } else if (sec->cipher_pairwise & WLAN_CIPHER_SUITE_WEP104) {
1787 params.cipher = WLAN_CIPHER_SUITE_WEP104; 1787 params.cipher = WLAN_CIPHER_SUITE_WEP104;
1788 WL_DBG(("WLAN_CIPHER_SUITE_WEP104\n")); 1788 WL_DBG("WLAN_CIPHER_SUITE_WEP104\n");
1789 } 1789 }
1790 break; 1790 break;
1791 case TKIP_ENABLED: 1791 case TKIP_ENABLED:
1792 params.cipher = WLAN_CIPHER_SUITE_TKIP; 1792 params.cipher = WLAN_CIPHER_SUITE_TKIP;
1793 WL_DBG(("WLAN_CIPHER_SUITE_TKIP\n")); 1793 WL_DBG("WLAN_CIPHER_SUITE_TKIP\n");
1794 break; 1794 break;
1795 case AES_ENABLED: 1795 case AES_ENABLED:
1796 params.cipher = WLAN_CIPHER_SUITE_AES_CMAC; 1796 params.cipher = WLAN_CIPHER_SUITE_AES_CMAC;
1797 WL_DBG(("WLAN_CIPHER_SUITE_AES_CMAC\n")); 1797 WL_DBG("WLAN_CIPHER_SUITE_AES_CMAC\n");
1798 break; 1798 break;
1799 default: 1799 default:
1800 WL_ERR(("Invalid algo (0x%x)\n", wsec)); 1800 WL_ERR("Invalid algo (0x%x)\n", wsec);
1801 return -EINVAL; 1801 return -EINVAL;
1802 } 1802 }
1803 1803
@@ -1809,7 +1809,7 @@ static s32
1809wl_cfg80211_config_default_mgmt_key(struct wiphy *wiphy, 1809wl_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
1810 struct net_device *dev, u8 key_idx) 1810 struct net_device *dev, u8 key_idx)
1811{ 1811{
1812 WL_INFO(("Not supported\n")); 1812 WL_INFO("Not supported\n");
1813 CHECK_SYS_UP(); 1813 CHECK_SYS_UP();
1814 return -EOPNOTSUPP; 1814 return -EOPNOTSUPP;
1815} 1815}
@@ -1827,19 +1827,19 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
1827 CHECK_SYS_UP(); 1827 CHECK_SYS_UP();
1828 if (unlikely 1828 if (unlikely
1829 (memcmp(mac, wl_read_prof(wl, WL_PROF_BSSID), ETH_ALEN))) { 1829 (memcmp(mac, wl_read_prof(wl, WL_PROF_BSSID), ETH_ALEN))) {
1830 WL_ERR(("Wrong Mac address\n")); 1830 WL_ERR("Wrong Mac address\n");
1831 return -ENOENT; 1831 return -ENOENT;
1832 } 1832 }
1833 1833
1834 /* Report the current tx rate */ 1834 /* Report the current tx rate */
1835 err = wl_dev_ioctl(dev, WLC_GET_RATE, &rate, sizeof(rate)); 1835 err = wl_dev_ioctl(dev, WLC_GET_RATE, &rate, sizeof(rate));
1836 if (err) { 1836 if (err) {
1837 WL_ERR(("Could not get rate (%d)\n", err)); 1837 WL_ERR("Could not get rate (%d)\n", err);
1838 } else { 1838 } else {
1839 rate = dtoh32(rate); 1839 rate = dtoh32(rate);
1840 sinfo->filled |= STATION_INFO_TX_BITRATE; 1840 sinfo->filled |= STATION_INFO_TX_BITRATE;
1841 sinfo->txrate.legacy = rate * 5; 1841 sinfo->txrate.legacy = rate * 5;
1842 WL_DBG(("Rate %d Mbps\n", (rate / 2))); 1842 WL_DBG("Rate %d Mbps\n", rate / 2);
1843 } 1843 }
1844 1844
1845 if (test_bit(WL_STATUS_CONNECTED, &wl->status)) { 1845 if (test_bit(WL_STATUS_CONNECTED, &wl->status)) {
@@ -1847,13 +1847,13 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
1847 err = wl_dev_ioctl(dev, WLC_GET_RSSI, &scb_val, 1847 err = wl_dev_ioctl(dev, WLC_GET_RSSI, &scb_val,
1848 sizeof(scb_val_t)); 1848 sizeof(scb_val_t));
1849 if (unlikely(err)) { 1849 if (unlikely(err)) {
1850 WL_ERR(("Could not get rssi (%d)\n", err)); 1850 WL_ERR("Could not get rssi (%d)\n", err);
1851 return err; 1851 return err;
1852 } 1852 }
1853 rssi = dtoh32(scb_val.val); 1853 rssi = dtoh32(scb_val.val);
1854 sinfo->filled |= STATION_INFO_SIGNAL; 1854 sinfo->filled |= STATION_INFO_SIGNAL;
1855 sinfo->signal = rssi; 1855 sinfo->signal = rssi;
1856 WL_DBG(("RSSI %d dBm\n", rssi)); 1856 WL_DBG("RSSI %d dBm\n", rssi);
1857 } 1857 }
1858 1858
1859 return err; 1859 return err;
@@ -1869,13 +1869,13 @@ wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
1869 CHECK_SYS_UP(); 1869 CHECK_SYS_UP();
1870 pm = enabled ? PM_FAST : PM_OFF; 1870 pm = enabled ? PM_FAST : PM_OFF;
1871 pm = htod32(pm); 1871 pm = htod32(pm);
1872 WL_DBG(("power save %s\n", (pm ? "enabled" : "disabled"))); 1872 WL_DBG("power save %s\n", (pm ? "enabled" : "disabled"));
1873 err = wl_dev_ioctl(dev, WLC_SET_PM, &pm, sizeof(pm)); 1873 err = wl_dev_ioctl(dev, WLC_SET_PM, &pm, sizeof(pm));
1874 if (unlikely(err)) { 1874 if (unlikely(err)) {
1875 if (err == -ENODEV) 1875 if (err == -ENODEV)
1876 WL_DBG(("net_device is not ready yet\n")); 1876 WL_DBG("net_device is not ready yet\n");
1877 else 1877 else
1878 WL_ERR(("error (%d)\n", err)); 1878 WL_ERR("error (%d)\n", err);
1879 return err; 1879 return err;
1880 } 1880 }
1881 return err; 1881 return err;
@@ -1927,7 +1927,7 @@ wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
1927 err = wl_dev_ioctl(dev, WLC_GET_CURR_RATESET, &rateset, 1927 err = wl_dev_ioctl(dev, WLC_GET_CURR_RATESET, &rateset,
1928 sizeof(rateset)); 1928 sizeof(rateset));
1929 if (unlikely(err)) { 1929 if (unlikely(err)) {
1930 WL_ERR(("could not get current rateset (%d)\n", err)); 1930 WL_ERR("could not get current rateset (%d)\n", err);
1931 return err; 1931 return err;
1932 } 1932 }
1933 1933
@@ -1947,7 +1947,7 @@ wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
1947 rate = val / 500000; 1947 rate = val / 500000;
1948 } 1948 }
1949 1949
1950 WL_DBG(("rate %d mbps\n", (rate / 2))); 1950 WL_DBG("rate %d mbps\n", rate / 2);
1951 1951
1952 /* 1952 /*
1953 * 1953 *
@@ -1957,7 +1957,7 @@ wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
1957 err_bg = wl_dev_intvar_set(dev, "bg_rate", rate); 1957 err_bg = wl_dev_intvar_set(dev, "bg_rate", rate);
1958 err_a = wl_dev_intvar_set(dev, "a_rate", rate); 1958 err_a = wl_dev_intvar_set(dev, "a_rate", rate);
1959 if (unlikely(err_bg && err_a)) { 1959 if (unlikely(err_bg && err_a)) {
1960 WL_ERR(("could not set fixed rate (%d) (%d)\n", err_bg, err_a)); 1960 WL_ERR("could not set fixed rate (%d) (%d)\n", err_bg, err_a);
1961 return err_bg | err_a; 1961 return err_bg | err_a;
1962 } 1962 }
1963 1963
@@ -2002,12 +2002,12 @@ wl_update_pmklist(struct net_device *dev, struct wl_pmk_list *pmk_list,
2002{ 2002{
2003 int i, j; 2003 int i, j;
2004 2004
2005 WL_DBG(("No of elements %d\n", pmk_list->pmkids.npmkid)); 2005 WL_DBG("No of elements %d\n", pmk_list->pmkids.npmkid);
2006 for (i = 0; i < pmk_list->pmkids.npmkid; i++) { 2006 for (i = 0; i < pmk_list->pmkids.npmkid; i++) {
2007 WL_DBG(("PMKID[%d]: %pM =\n", i, 2007 WL_DBG("PMKID[%d]: %pM =\n", i,
2008 &pmk_list->pmkids.pmkid[i].BSSID)); 2008 &pmk_list->pmkids.pmkid[i].BSSID);
2009 for (j = 0; j < WPA2_PMKID_LEN; j++) { 2009 for (j = 0; j < WPA2_PMKID_LEN; j++) {
2010 WL_DBG(("%02x\n", pmk_list->pmkids.pmkid[i].PMKID[j])); 2010 WL_DBG("%02x\n", pmk_list->pmkids.pmkid[i].PMKID[j]);
2011 } 2011 }
2012 } 2012 }
2013 if (likely(!err)) { 2013 if (likely(!err)) {
@@ -2041,12 +2041,12 @@ wl_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
2041 } else { 2041 } else {
2042 err = -EINVAL; 2042 err = -EINVAL;
2043 } 2043 }
2044 WL_DBG(("set_pmksa,IW_PMKSA_ADD - PMKID: %pM =\n", 2044 WL_DBG("set_pmksa,IW_PMKSA_ADD - PMKID: %pM =\n",
2045 &wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid].BSSID)); 2045 &wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid].BSSID);
2046 for (i = 0; i < WPA2_PMKID_LEN; i++) { 2046 for (i = 0; i < WPA2_PMKID_LEN; i++) {
2047 WL_DBG(("%02x\n", 2047 WL_DBG("%02x\n",
2048 wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid]. 2048 wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid].
2049 PMKID[i])); 2049 PMKID[i]);
2050 } 2050 }
2051 2051
2052 err = wl_update_pmklist(dev, wl->pmk_list, err); 2052 err = wl_update_pmklist(dev, wl->pmk_list, err);
@@ -2067,10 +2067,10 @@ wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
2067 memcpy(&pmkid.pmkid[0].BSSID, pmksa->bssid, ETH_ALEN); 2067 memcpy(&pmkid.pmkid[0].BSSID, pmksa->bssid, ETH_ALEN);
2068 memcpy(&pmkid.pmkid[0].PMKID, pmksa->pmkid, WPA2_PMKID_LEN); 2068 memcpy(&pmkid.pmkid[0].PMKID, pmksa->pmkid, WPA2_PMKID_LEN);
2069 2069
2070 WL_DBG(("del_pmksa,IW_PMKSA_REMOVE - PMKID: %pM =\n", 2070 WL_DBG("del_pmksa,IW_PMKSA_REMOVE - PMKID: %pM =\n",
2071 &pmkid.pmkid[0].BSSID)); 2071 &pmkid.pmkid[0].BSSID);
2072 for (i = 0; i < WPA2_PMKID_LEN; i++) { 2072 for (i = 0; i < WPA2_PMKID_LEN; i++) {
2073 WL_DBG(("%02x\n", pmkid.pmkid[0].PMKID[i])); 2073 WL_DBG("%02x\n", pmkid.pmkid[0].PMKID[i]);
2074 } 2074 }
2075 2075
2076 for (i = 0; i < wl->pmk_list->pmkids.npmkid; i++) 2076 for (i = 0; i < wl->pmk_list->pmkids.npmkid; i++)
@@ -2163,13 +2163,13 @@ static struct wireless_dev *wl_alloc_wdev(s32 sizeof_iface,
2163 2163
2164 wdev = kzalloc(sizeof(*wdev), GFP_KERNEL); 2164 wdev = kzalloc(sizeof(*wdev), GFP_KERNEL);
2165 if (unlikely(!wdev)) { 2165 if (unlikely(!wdev)) {
2166 WL_ERR(("Could not allocate wireless device\n")); 2166 WL_ERR("Could not allocate wireless device\n");
2167 return ERR_PTR(-ENOMEM); 2167 return ERR_PTR(-ENOMEM);
2168 } 2168 }
2169 wdev->wiphy = 2169 wdev->wiphy =
2170 wiphy_new(&wl_cfg80211_ops, sizeof(struct wl_priv) + sizeof_iface); 2170 wiphy_new(&wl_cfg80211_ops, sizeof(struct wl_priv) + sizeof_iface);
2171 if (unlikely(!wdev->wiphy)) { 2171 if (unlikely(!wdev->wiphy)) {
2172 WL_ERR(("Couldn not allocate wiphy device\n")); 2172 WL_ERR("Couldn not allocate wiphy device\n");
2173 err = -ENOMEM; 2173 err = -ENOMEM;
2174 goto wiphy_new_out; 2174 goto wiphy_new_out;
2175 } 2175 }
@@ -2199,7 +2199,7 @@ static struct wireless_dev *wl_alloc_wdev(s32 sizeof_iface,
2199#endif /* !WL_POWERSAVE_DISABLED */ 2199#endif /* !WL_POWERSAVE_DISABLED */
2200 err = wiphy_register(wdev->wiphy); 2200 err = wiphy_register(wdev->wiphy);
2201 if (unlikely(err < 0)) { 2201 if (unlikely(err < 0)) {
2202 WL_ERR(("Couldn not register wiphy device (%d)\n", err)); 2202 WL_ERR("Couldn not register wiphy device (%d)\n", err);
2203 goto wiphy_register_out; 2203 goto wiphy_register_out;
2204 } 2204 }
2205 return wdev; 2205 return wdev;
@@ -2218,7 +2218,7 @@ static void wl_free_wdev(struct wl_priv *wl)
2218 struct wireless_dev *wdev = wl_to_wdev(wl); 2218 struct wireless_dev *wdev = wl_to_wdev(wl);
2219 2219
2220 if (unlikely(!wdev)) { 2220 if (unlikely(!wdev)) {
2221 WL_ERR(("wdev is invalid\n")); 2221 WL_ERR("wdev is invalid\n");
2222 return; 2222 return;
2223 } 2223 }
2224 wiphy_unregister(wdev->wiphy); 2224 wiphy_unregister(wdev->wiphy);
@@ -2236,11 +2236,11 @@ static s32 wl_inform_bss(struct wl_priv *wl)
2236 2236
2237 bss_list = wl->bss_list; 2237 bss_list = wl->bss_list;
2238 if (unlikely(bss_list->version != WL_BSS_INFO_VERSION)) { 2238 if (unlikely(bss_list->version != WL_BSS_INFO_VERSION)) {
2239 WL_ERR(("Version %d != WL_BSS_INFO_VERSION\n", 2239 WL_ERR("Version %d != WL_BSS_INFO_VERSION\n",
2240 bss_list->version)); 2240 bss_list->version);
2241 return -EOPNOTSUPP; 2241 return -EOPNOTSUPP;
2242 } 2242 }
2243 WL_DBG(("scanned AP count (%d)\n", bss_list->count)); 2243 WL_DBG("scanned AP count (%d)\n", bss_list->count);
2244 bi = next_bss(bss_list, bi); 2244 bi = next_bss(bss_list, bi);
2245 for_each_bss(bss_list, bi, i) { 2245 for_each_bss(bss_list, bi, i) {
2246 err = wl_inform_single_bss(wl, bi); 2246 err = wl_inform_single_bss(wl, bi);
@@ -2265,14 +2265,14 @@ static s32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi)
2265 s32 err = 0; 2265 s32 err = 0;
2266 2266
2267 if (unlikely(dtoh32(bi->length) > WL_BSS_INFO_MAX)) { 2267 if (unlikely(dtoh32(bi->length) > WL_BSS_INFO_MAX)) {
2268 WL_DBG(("Beacon is larger than buffer. Discarding\n")); 2268 WL_DBG("Beacon is larger than buffer. Discarding\n");
2269 return err; 2269 return err;
2270 } 2270 }
2271 notif_bss_info = 2271 notif_bss_info =
2272 kzalloc(sizeof(*notif_bss_info) + sizeof(*mgmt) - sizeof(u8) + 2272 kzalloc(sizeof(*notif_bss_info) + sizeof(*mgmt) - sizeof(u8) +
2273 WL_BSS_INFO_MAX, GFP_KERNEL); 2273 WL_BSS_INFO_MAX, GFP_KERNEL);
2274 if (unlikely(!notif_bss_info)) { 2274 if (unlikely(!notif_bss_info)) {
2275 WL_ERR(("notif_bss_info alloc failed\n")); 2275 WL_ERR("notif_bss_info alloc failed\n");
2276 return -ENOMEM; 2276 return -ENOMEM;
2277 } 2277 }
2278 mgmt = (struct ieee80211_mgmt *)notif_bss_info->frame_buf; 2278 mgmt = (struct ieee80211_mgmt *)notif_bss_info->frame_buf;
@@ -2316,17 +2316,17 @@ static s32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi)
2316 freq = ieee80211_channel_to_frequency(notif_bss_info->channel); 2316 freq = ieee80211_channel_to_frequency(notif_bss_info->channel);
2317 channel = ieee80211_get_channel(wiphy, freq); 2317 channel = ieee80211_get_channel(wiphy, freq);
2318 2318
2319 WL_DBG(("SSID : \"%s\", rssi %d, channel %d, capability : 0x04%x, bssid %pM\n", 2319 WL_DBG("SSID : \"%s\", rssi %d, channel %d, capability : 0x04%x, bssid %pM\n",
2320 bi->SSID, 2320 bi->SSID,
2321 notif_bss_info->rssi, notif_bss_info->channel, 2321 notif_bss_info->rssi, notif_bss_info->channel,
2322 mgmt->u.beacon.capab_info, &bi->BSSID)); 2322 mgmt->u.beacon.capab_info, &bi->BSSID);
2323 2323
2324 signal = notif_bss_info->rssi * 100; 2324 signal = notif_bss_info->rssi * 100;
2325 if (unlikely(!cfg80211_inform_bss_frame(wiphy, channel, mgmt, 2325 if (unlikely(!cfg80211_inform_bss_frame(wiphy, channel, mgmt,
2326 le16_to_cpu 2326 le16_to_cpu
2327 (notif_bss_info->frame_len), 2327 (notif_bss_info->frame_len),
2328 signal, GFP_KERNEL))) { 2328 signal, GFP_KERNEL))) {
2329 WL_ERR(("cfg80211_inform_bss_frame error\n")); 2329 WL_ERR("cfg80211_inform_bss_frame error\n");
2330 kfree(notif_bss_info); 2330 kfree(notif_bss_info);
2331 return -EINVAL; 2331 return -EINVAL;
2332 } 2332 }
@@ -2394,12 +2394,12 @@ wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
2394 if (wl_is_ibssmode(wl)) { 2394 if (wl_is_ibssmode(wl)) {
2395 cfg80211_ibss_joined(ndev, (s8 *)&e->addr, 2395 cfg80211_ibss_joined(ndev, (s8 *)&e->addr,
2396 GFP_KERNEL); 2396 GFP_KERNEL);
2397 WL_DBG(("joined in IBSS network\n")); 2397 WL_DBG("joined in IBSS network\n");
2398 } else { 2398 } else {
2399 wl_bss_connect_done(wl, ndev, e, data, true); 2399 wl_bss_connect_done(wl, ndev, e, data, true);
2400 WL_DBG(("joined in BSS network \"%s\"\n", 2400 WL_DBG("joined in BSS network \"%s\"\n",
2401 ((struct wlc_ssid *) 2401 ((struct wlc_ssid *)
2402 wl_read_prof(wl, WL_PROF_SSID))->SSID)); 2402 wl_read_prof(wl, WL_PROF_SSID))->SSID);
2403 } 2403 }
2404 act = true; 2404 act = true;
2405 wl_update_prof(wl, e, &act, WL_PROF_ACT); 2405 wl_update_prof(wl, e, &act, WL_PROF_ACT);
@@ -2454,7 +2454,7 @@ wl_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
2454 err = wl_dev_ioctl(dev, WLC_GET_VAR, (void *)wl->ioctl_buf, 2454 err = wl_dev_ioctl(dev, WLC_GET_VAR, (void *)wl->ioctl_buf,
2455 WL_IOCTL_LEN_MAX); 2455 WL_IOCTL_LEN_MAX);
2456 if (unlikely(err)) { 2456 if (unlikely(err)) {
2457 WL_ERR(("error (%d)\n", err)); 2457 WL_ERR("error (%d)\n", err);
2458 return err; 2458 return err;
2459 } 2459 }
2460 memcpy(buf, wl->ioctl_buf, buf_len); 2460 memcpy(buf, wl->ioctl_buf, buf_len);
@@ -2474,7 +2474,7 @@ static s32 wl_get_assoc_ies(struct wl_priv *wl)
2474 err = wl_dev_bufvar_get(ndev, "assoc_info", wl->extra_buf, 2474 err = wl_dev_bufvar_get(ndev, "assoc_info", wl->extra_buf,
2475 WL_ASSOC_INFO_MAX); 2475 WL_ASSOC_INFO_MAX);
2476 if (unlikely(err)) { 2476 if (unlikely(err)) {
2477 WL_ERR(("could not get assoc info (%d)\n", err)); 2477 WL_ERR("could not get assoc info (%d)\n", err);
2478 return err; 2478 return err;
2479 } 2479 }
2480 assoc_info = (struct wl_assoc_ielen *)wl->extra_buf; 2480 assoc_info = (struct wl_assoc_ielen *)wl->extra_buf;
@@ -2484,7 +2484,7 @@ static s32 wl_get_assoc_ies(struct wl_priv *wl)
2484 err = wl_dev_bufvar_get(ndev, "assoc_req_ies", wl->extra_buf, 2484 err = wl_dev_bufvar_get(ndev, "assoc_req_ies", wl->extra_buf,
2485 WL_ASSOC_INFO_MAX); 2485 WL_ASSOC_INFO_MAX);
2486 if (unlikely(err)) { 2486 if (unlikely(err)) {
2487 WL_ERR(("could not get assoc req (%d)\n", err)); 2487 WL_ERR("could not get assoc req (%d)\n", err);
2488 return err; 2488 return err;
2489 } 2489 }
2490 conn_info->req_ie_len = req_len; 2490 conn_info->req_ie_len = req_len;
@@ -2498,7 +2498,7 @@ static s32 wl_get_assoc_ies(struct wl_priv *wl)
2498 err = wl_dev_bufvar_get(ndev, "assoc_resp_ies", wl->extra_buf, 2498 err = wl_dev_bufvar_get(ndev, "assoc_resp_ies", wl->extra_buf,
2499 WL_ASSOC_INFO_MAX); 2499 WL_ASSOC_INFO_MAX);
2500 if (unlikely(err)) { 2500 if (unlikely(err)) {
2501 WL_ERR(("could not get assoc resp (%d)\n", err)); 2501 WL_ERR("could not get assoc resp (%d)\n", err);
2502 return err; 2502 return err;
2503 } 2503 }
2504 conn_info->resp_ie_len = resp_len; 2504 conn_info->resp_ie_len = resp_len;
@@ -2508,8 +2508,8 @@ static s32 wl_get_assoc_ies(struct wl_priv *wl)
2508 conn_info->resp_ie_len = 0; 2508 conn_info->resp_ie_len = 0;
2509 conn_info->resp_ie = NULL; 2509 conn_info->resp_ie = NULL;
2510 } 2510 }
2511 WL_DBG(("req len (%d) resp len (%d)\n", conn_info->req_ie_len, 2511 WL_DBG("req len (%d) resp len (%d)\n",
2512 conn_info->resp_ie_len)); 2512 conn_info->req_ie_len, conn_info->resp_ie_len);
2513 2513
2514 return err; 2514 return err;
2515} 2515}
@@ -2542,8 +2542,8 @@ static void wl_ch_to_chanspec(int ch, struct wl_join_params *join_params,
2542 join_params->params.chanspec_num = 2542 join_params->params.chanspec_num =
2543 htod32(join_params->params.chanspec_num); 2543 htod32(join_params->params.chanspec_num);
2544 2544
2545 WL_DBG(("join_params->params.chanspec_list[0]= %#X, channel %d, chanspec %#X\n", 2545 WL_DBG("join_params->params.chanspec_list[0]= %#X, channel %d, chanspec %#X\n",
2546 join_params->params.chanspec_list[0], ch, chanspec)); 2546 join_params->params.chanspec_list[0], ch, chanspec);
2547 } 2547 }
2548} 2548}
2549 2549
@@ -2570,12 +2570,12 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
2570 2570
2571 rtnl_lock(); 2571 rtnl_lock();
2572 if (unlikely(!bss)) { 2572 if (unlikely(!bss)) {
2573 WL_DBG(("Could not find the AP\n")); 2573 WL_DBG("Could not find the AP\n");
2574 *(u32 *) wl->extra_buf = htod32(WL_EXTRA_BUF_MAX); 2574 *(u32 *) wl->extra_buf = htod32(WL_EXTRA_BUF_MAX);
2575 err = wl_dev_ioctl(wl_to_ndev(wl), WLC_GET_BSS_INFO, 2575 err = wl_dev_ioctl(wl_to_ndev(wl), WLC_GET_BSS_INFO,
2576 wl->extra_buf, WL_EXTRA_BUF_MAX); 2576 wl->extra_buf, WL_EXTRA_BUF_MAX);
2577 if (unlikely(err)) { 2577 if (unlikely(err)) {
2578 WL_ERR(("Could not get bss info %d\n", err)); 2578 WL_ERR("Could not get bss info %d\n", err);
2579 goto update_bss_info_out; 2579 goto update_bss_info_out;
2580 } 2580 }
2581 bi = (struct wl_bss_info *)(wl->extra_buf + 4); 2581 bi = (struct wl_bss_info *)(wl->extra_buf + 4);
@@ -2591,7 +2591,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
2591 ie_len = bi->ie_length; 2591 ie_len = bi->ie_length;
2592 beacon_interval = cpu_to_le16(bi->beacon_period); 2592 beacon_interval = cpu_to_le16(bi->beacon_period);
2593 } else { 2593 } else {
2594 WL_DBG(("Found the AP in the list - BSSID %pM\n", bss->bssid)); 2594 WL_DBG("Found the AP in the list - BSSID %pM\n", bss->bssid);
2595 ie = bss->information_elements; 2595 ie = bss->information_elements;
2596 ie_len = bss->len_information_elements; 2596 ie_len = bss->len_information_elements;
2597 beacon_interval = bss->beacon_interval; 2597 beacon_interval = bss->beacon_interval;
@@ -2610,7 +2610,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
2610 err = wl_dev_ioctl(wl_to_ndev(wl), WLC_GET_DTIMPRD, 2610 err = wl_dev_ioctl(wl_to_ndev(wl), WLC_GET_DTIMPRD,
2611 &dtim_period, sizeof(dtim_period)); 2611 &dtim_period, sizeof(dtim_period));
2612 if (unlikely(err)) { 2612 if (unlikely(err)) {
2613 WL_ERR(("WLC_GET_DTIMPRD error (%d)\n", err)); 2613 WL_ERR("WLC_GET_DTIMPRD error (%d)\n", err);
2614 goto update_bss_info_out; 2614 goto update_bss_info_out;
2615 } 2615 }
2616 } 2616 }
@@ -2637,7 +2637,7 @@ wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
2637 (u8 *)&wl->bssid, 2637 (u8 *)&wl->bssid,
2638 conn_info->req_ie, conn_info->req_ie_len, 2638 conn_info->req_ie, conn_info->req_ie_len,
2639 conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL); 2639 conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL);
2640 WL_DBG(("Report roaming result\n")); 2640 WL_DBG("Report roaming result\n");
2641 2641
2642 set_bit(WL_STATUS_CONNECTED, &wl->status); 2642 set_bit(WL_STATUS_CONNECTED, &wl->status);
2643 2643
@@ -2663,15 +2663,15 @@ wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
2663 conn_info->resp_ie_len, 2663 conn_info->resp_ie_len,
2664 completed ? WLAN_STATUS_SUCCESS : WLAN_STATUS_AUTH_TIMEOUT, 2664 completed ? WLAN_STATUS_SUCCESS : WLAN_STATUS_AUTH_TIMEOUT,
2665 GFP_KERNEL); 2665 GFP_KERNEL);
2666 WL_DBG(("Report connect result - connection %s\n", 2666 WL_DBG("Report connect result - connection %s\n",
2667 completed ? "succeeded" : "failed")); 2667 completed ? "succeeded" : "failed");
2668 } else { 2668 } else {
2669 cfg80211_roamed(ndev, 2669 cfg80211_roamed(ndev,
2670 (u8 *)&wl->bssid, 2670 (u8 *)&wl->bssid,
2671 conn_info->req_ie, conn_info->req_ie_len, 2671 conn_info->req_ie, conn_info->req_ie_len,
2672 conn_info->resp_ie, conn_info->resp_ie_len, 2672 conn_info->resp_ie, conn_info->resp_ie_len,
2673 GFP_KERNEL); 2673 GFP_KERNEL);
2674 WL_DBG(("Report roaming result\n")); 2674 WL_DBG("Report roaming result\n");
2675 } 2675 }
2676 set_bit(WL_STATUS_CONNECTED, &wl->status); 2676 set_bit(WL_STATUS_CONNECTED, &wl->status);
2677 2677
@@ -2711,7 +2711,7 @@ wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
2711 return wl_wakeup_iscan(wl_to_iscan(wl)); 2711 return wl_wakeup_iscan(wl_to_iscan(wl));
2712 2712
2713 if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING, &wl->status))) { 2713 if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING, &wl->status))) {
2714 WL_ERR(("Scan complete while device not scanning\n")); 2714 WL_ERR("Scan complete while device not scanning\n");
2715 return -EINVAL; 2715 return -EINVAL;
2716 } 2716 }
2717 if (unlikely(!wl->scan_request)) { 2717 if (unlikely(!wl->scan_request)) {
@@ -2720,14 +2720,14 @@ wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
2720 err = wl_dev_ioctl(ndev, WLC_GET_CHANNEL, &channel_inform, 2720 err = wl_dev_ioctl(ndev, WLC_GET_CHANNEL, &channel_inform,
2721 sizeof(channel_inform)); 2721 sizeof(channel_inform));
2722 if (unlikely(err)) { 2722 if (unlikely(err)) {
2723 WL_ERR(("scan busy (%d)\n", err)); 2723 WL_ERR("scan busy (%d)\n", err);
2724 goto scan_done_out; 2724 goto scan_done_out;
2725 } 2725 }
2726 channel_inform.scan_channel = dtoh32(channel_inform.scan_channel); 2726 channel_inform.scan_channel = dtoh32(channel_inform.scan_channel);
2727 if (unlikely(channel_inform.scan_channel)) { 2727 if (unlikely(channel_inform.scan_channel)) {
2728 2728
2729 WL_DBG(("channel_inform.scan_channel (%d)\n", 2729 WL_DBG("channel_inform.scan_channel (%d)\n",
2730 channel_inform.scan_channel)); 2730 channel_inform.scan_channel);
2731 } 2731 }
2732 wl->bss_list = wl->scan_results; 2732 wl->bss_list = wl->scan_results;
2733 bss_list = wl->bss_list; 2733 bss_list = wl->bss_list;
@@ -2735,7 +2735,7 @@ wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
2735 bss_list->buflen = htod32(len); 2735 bss_list->buflen = htod32(len);
2736 err = wl_dev_ioctl(ndev, WLC_SCAN_RESULTS, bss_list, len); 2736 err = wl_dev_ioctl(ndev, WLC_SCAN_RESULTS, bss_list, len);
2737 if (unlikely(err)) { 2737 if (unlikely(err)) {
2738 WL_ERR(("%s Scan_results error (%d)\n", ndev->name, err)); 2738 WL_ERR("%s Scan_results error (%d)\n", ndev->name, err);
2739 err = -EINVAL; 2739 err = -EINVAL;
2740 goto scan_done_out; 2740 goto scan_done_out;
2741 } 2741 }
@@ -2791,52 +2791,52 @@ static s32 wl_init_priv_mem(struct wl_priv *wl)
2791{ 2791{
2792 wl->scan_results = kzalloc(WL_SCAN_BUF_MAX, GFP_KERNEL); 2792 wl->scan_results = kzalloc(WL_SCAN_BUF_MAX, GFP_KERNEL);
2793 if (unlikely(!wl->scan_results)) { 2793 if (unlikely(!wl->scan_results)) {
2794 WL_ERR(("Scan results alloc failed\n")); 2794 WL_ERR("Scan results alloc failed\n");
2795 goto init_priv_mem_out; 2795 goto init_priv_mem_out;
2796 } 2796 }
2797 wl->conf = kzalloc(sizeof(*wl->conf), GFP_KERNEL); 2797 wl->conf = kzalloc(sizeof(*wl->conf), GFP_KERNEL);
2798 if (unlikely(!wl->conf)) { 2798 if (unlikely(!wl->conf)) {
2799 WL_ERR(("wl_conf alloc failed\n")); 2799 WL_ERR("wl_conf alloc failed\n");
2800 goto init_priv_mem_out; 2800 goto init_priv_mem_out;
2801 } 2801 }
2802 wl->profile = kzalloc(sizeof(*wl->profile), GFP_KERNEL); 2802 wl->profile = kzalloc(sizeof(*wl->profile), GFP_KERNEL);
2803 if (unlikely(!wl->profile)) { 2803 if (unlikely(!wl->profile)) {
2804 WL_ERR(("wl_profile alloc failed\n")); 2804 WL_ERR("wl_profile alloc failed\n");
2805 goto init_priv_mem_out; 2805 goto init_priv_mem_out;
2806 } 2806 }
2807 wl->bss_info = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL); 2807 wl->bss_info = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL);
2808 if (unlikely(!wl->bss_info)) { 2808 if (unlikely(!wl->bss_info)) {
2809 WL_ERR(("Bss information alloc failed\n")); 2809 WL_ERR("Bss information alloc failed\n");
2810 goto init_priv_mem_out; 2810 goto init_priv_mem_out;
2811 } 2811 }
2812 wl->scan_req_int = kzalloc(sizeof(*wl->scan_req_int), GFP_KERNEL); 2812 wl->scan_req_int = kzalloc(sizeof(*wl->scan_req_int), GFP_KERNEL);
2813 if (unlikely(!wl->scan_req_int)) { 2813 if (unlikely(!wl->scan_req_int)) {
2814 WL_ERR(("Scan req alloc failed\n")); 2814 WL_ERR("Scan req alloc failed\n");
2815 goto init_priv_mem_out; 2815 goto init_priv_mem_out;
2816 } 2816 }
2817 wl->ioctl_buf = kzalloc(WL_IOCTL_LEN_MAX, GFP_KERNEL); 2817 wl->ioctl_buf = kzalloc(WL_IOCTL_LEN_MAX, GFP_KERNEL);
2818 if (unlikely(!wl->ioctl_buf)) { 2818 if (unlikely(!wl->ioctl_buf)) {
2819 WL_ERR(("Ioctl buf alloc failed\n")); 2819 WL_ERR("Ioctl buf alloc failed\n");
2820 goto init_priv_mem_out; 2820 goto init_priv_mem_out;
2821 } 2821 }
2822 wl->extra_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL); 2822 wl->extra_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL);
2823 if (unlikely(!wl->extra_buf)) { 2823 if (unlikely(!wl->extra_buf)) {
2824 WL_ERR(("Extra buf alloc failed\n")); 2824 WL_ERR("Extra buf alloc failed\n");
2825 goto init_priv_mem_out; 2825 goto init_priv_mem_out;
2826 } 2826 }
2827 wl->iscan = kzalloc(sizeof(*wl->iscan), GFP_KERNEL); 2827 wl->iscan = kzalloc(sizeof(*wl->iscan), GFP_KERNEL);
2828 if (unlikely(!wl->iscan)) { 2828 if (unlikely(!wl->iscan)) {
2829 WL_ERR(("Iscan buf alloc failed\n")); 2829 WL_ERR("Iscan buf alloc failed\n");
2830 goto init_priv_mem_out; 2830 goto init_priv_mem_out;
2831 } 2831 }
2832 wl->fw = kzalloc(sizeof(*wl->fw), GFP_KERNEL); 2832 wl->fw = kzalloc(sizeof(*wl->fw), GFP_KERNEL);
2833 if (unlikely(!wl->fw)) { 2833 if (unlikely(!wl->fw)) {
2834 WL_ERR(("fw object alloc failed\n")); 2834 WL_ERR("fw object alloc failed\n");
2835 goto init_priv_mem_out; 2835 goto init_priv_mem_out;
2836 } 2836 }
2837 wl->pmk_list = kzalloc(sizeof(*wl->pmk_list), GFP_KERNEL); 2837 wl->pmk_list = kzalloc(sizeof(*wl->pmk_list), GFP_KERNEL);
2838 if (unlikely(!wl->pmk_list)) { 2838 if (unlikely(!wl->pmk_list)) {
2839 WL_ERR(("pmk list alloc failed\n")); 2839 WL_ERR("pmk list alloc failed\n");
2840 goto init_priv_mem_out; 2840 goto init_priv_mem_out;
2841 } 2841 }
2842 2842
@@ -2878,7 +2878,7 @@ static s32 wl_create_event_handler(struct wl_priv *wl)
2878 wl->event_tsk = kthread_run(wl_event_handler, wl, "wl_event_handler"); 2878 wl->event_tsk = kthread_run(wl_event_handler, wl, "wl_event_handler");
2879 if (IS_ERR(wl->event_tsk)) { 2879 if (IS_ERR(wl->event_tsk)) {
2880 wl->event_tsk = NULL; 2880 wl->event_tsk = NULL;
2881 WL_ERR(("failed to create event thread\n")); 2881 WL_ERR("failed to create event thread\n");
2882 return -ENOMEM; 2882 return -ENOMEM;
2883 } 2883 }
2884 return 0; 2884 return 0;
@@ -2911,7 +2911,7 @@ static void wl_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted)
2911 struct net_device *ndev = wl_to_ndev(wl); 2911 struct net_device *ndev = wl_to_ndev(wl);
2912 2912
2913 if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING, &wl->status))) { 2913 if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING, &wl->status))) {
2914 WL_ERR(("Scan complete while device not scanning\n")); 2914 WL_ERR("Scan complete while device not scanning\n");
2915 return; 2915 return;
2916 } 2916 }
2917 if (likely(wl->scan_request)) { 2917 if (likely(wl->scan_request)) {
@@ -2925,7 +2925,7 @@ static void wl_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted)
2925static s32 wl_wakeup_iscan(struct wl_iscan_ctrl *iscan) 2925static s32 wl_wakeup_iscan(struct wl_iscan_ctrl *iscan)
2926{ 2926{
2927 if (likely(iscan->state != WL_ISCAN_STATE_IDLE)) { 2927 if (likely(iscan->state != WL_ISCAN_STATE_IDLE)) {
2928 WL_DBG(("wake up iscan\n")); 2928 WL_DBG("wake up iscan\n");
2929 up(&iscan->sync); 2929 up(&iscan->sync);
2930 return 0; 2930 return 0;
2931 } 2931 }
@@ -2955,14 +2955,14 @@ wl_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
2955 WL_ISCAN_RESULTS_FIXED_SIZE, iscan->scan_buf, 2955 WL_ISCAN_RESULTS_FIXED_SIZE, iscan->scan_buf,
2956 WL_ISCAN_BUF_MAX); 2956 WL_ISCAN_BUF_MAX);
2957 if (unlikely(err)) { 2957 if (unlikely(err)) {
2958 WL_ERR(("error (%d)\n", err)); 2958 WL_ERR("error (%d)\n", err);
2959 return err; 2959 return err;
2960 } 2960 }
2961 results->buflen = dtoh32(results->buflen); 2961 results->buflen = dtoh32(results->buflen);
2962 results->version = dtoh32(results->version); 2962 results->version = dtoh32(results->version);
2963 results->count = dtoh32(results->count); 2963 results->count = dtoh32(results->count);
2964 WL_DBG(("results->count = %d\n", results->count)); 2964 WL_DBG("results->count = %d\n", results->count);
2965 WL_DBG(("results->buflen = %d\n", results->buflen)); 2965 WL_DBG("results->buflen = %d\n", results->buflen);
2966 *status = dtoh32(list_buf->status); 2966 *status = dtoh32(list_buf->status);
2967 *bss_list = results; 2967 *bss_list = results;
2968 2968
@@ -3047,7 +3047,7 @@ static s32 wl_iscan_thread(void *data)
3047 err = wl_get_iscan_results(iscan, &status, &wl->bss_list); 3047 err = wl_get_iscan_results(iscan, &status, &wl->bss_list);
3048 if (unlikely(err)) { 3048 if (unlikely(err)) {
3049 status = WL_SCAN_RESULTS_ABORTED; 3049 status = WL_SCAN_RESULTS_ABORTED;
3050 WL_ERR(("Abort iscan\n")); 3050 WL_ERR("Abort iscan\n");
3051 } 3051 }
3052 rtnl_unlock(); 3052 rtnl_unlock();
3053 el->handler[status] (wl); 3053 el->handler[status] (wl);
@@ -3056,7 +3056,7 @@ static s32 wl_iscan_thread(void *data)
3056 del_timer_sync(&iscan->timer); 3056 del_timer_sync(&iscan->timer);
3057 iscan->timer_on = 0; 3057 iscan->timer_on = 0;
3058 } 3058 }
3059 WL_DBG(("%s was terminated\n", __func__)); 3059 WL_DBG("%s was terminated\n", __func__);
3060 3060
3061 return 0; 3061 return 0;
3062} 3062}
@@ -3067,7 +3067,7 @@ static void wl_iscan_timer(unsigned long data)
3067 3067
3068 if (iscan) { 3068 if (iscan) {
3069 iscan->timer_on = 0; 3069 iscan->timer_on = 0;
3070 WL_DBG(("timer expired\n")); 3070 WL_DBG("timer expired\n");
3071 wl_wakeup_iscan(iscan); 3071 wl_wakeup_iscan(iscan);
3072 } 3072 }
3073} 3073}
@@ -3082,7 +3082,7 @@ static s32 wl_invoke_iscan(struct wl_priv *wl)
3082 sema_init(&iscan->sync, 0); 3082 sema_init(&iscan->sync, 0);
3083 iscan->tsk = kthread_run(wl_iscan_thread, iscan, "wl_iscan"); 3083 iscan->tsk = kthread_run(wl_iscan_thread, iscan, "wl_iscan");
3084 if (IS_ERR(iscan->tsk)) { 3084 if (IS_ERR(iscan->tsk)) {
3085 WL_ERR(("Could not create iscan thread\n")); 3085 WL_ERR("Could not create iscan thread\n");
3086 iscan->tsk = NULL; 3086 iscan->tsk = NULL;
3087 return -ENOMEM; 3087 return -ENOMEM;
3088 } 3088 }
@@ -3117,7 +3117,7 @@ static s32 wl_init_iscan(struct wl_priv *wl)
3117 sema_init(&iscan->sync, 0); 3117 sema_init(&iscan->sync, 0);
3118 iscan->tsk = kthread_run(wl_iscan_thread, iscan, "wl_iscan"); 3118 iscan->tsk = kthread_run(wl_iscan_thread, iscan, "wl_iscan");
3119 if (IS_ERR(iscan->tsk)) { 3119 if (IS_ERR(iscan->tsk)) {
3120 WL_ERR(("Could not create iscan thread\n")); 3120 WL_ERR("Could not create iscan thread\n");
3121 iscan->tsk = NULL; 3121 iscan->tsk = NULL;
3122 return -ENOMEM; 3122 return -ENOMEM;
3123 } 3123 }
@@ -3186,15 +3186,15 @@ s32 wl_cfg80211_attach(struct net_device *ndev, void *data)
3186 s32 err = 0; 3186 s32 err = 0;
3187 3187
3188 if (unlikely(!ndev)) { 3188 if (unlikely(!ndev)) {
3189 WL_ERR(("ndev is invaild\n")); 3189 WL_ERR("ndev is invalid\n");
3190 return -ENODEV; 3190 return -ENODEV;
3191 } 3191 }
3192 wl_cfg80211_dev = kzalloc(sizeof(struct wl_dev), GFP_KERNEL); 3192 wl_cfg80211_dev = kzalloc(sizeof(struct wl_dev), GFP_KERNEL);
3193 if (unlikely(!wl_cfg80211_dev)) { 3193 if (unlikely(!wl_cfg80211_dev)) {
3194 WL_ERR(("wl_cfg80211_dev is invalid\n")); 3194 WL_ERR("wl_cfg80211_dev is invalid\n");
3195 return -ENOMEM; 3195 return -ENOMEM;
3196 } 3196 }
3197 WL_DBG(("func %p\n", wl_cfg80211_get_sdio_func())); 3197 WL_DBG("func %p\n", wl_cfg80211_get_sdio_func());
3198 wdev = wl_alloc_wdev(sizeof(struct wl_iface), &wl_cfg80211_get_sdio_func()->dev); 3198 wdev = wl_alloc_wdev(sizeof(struct wl_iface), &wl_cfg80211_get_sdio_func()->dev);
3199 if (IS_ERR(wdev)) 3199 if (IS_ERR(wdev))
3200 return -ENOMEM; 3200 return -ENOMEM;
@@ -3210,7 +3210,7 @@ s32 wl_cfg80211_attach(struct net_device *ndev, void *data)
3210 wdev->netdev = ndev; 3210 wdev->netdev = ndev;
3211 err = wl_init_priv(wl); 3211 err = wl_init_priv(wl);
3212 if (unlikely(err)) { 3212 if (unlikely(err)) {
3213 WL_ERR(("Failed to init iwm_priv (%d)\n", err)); 3213 WL_ERR("Failed to init iwm_priv (%d)\n", err);
3214 goto cfg80211_attach_out; 3214 goto cfg80211_attach_out;
3215 } 3215 }
3216 wl_set_drvdata(wl_cfg80211_dev, ci); 3216 wl_set_drvdata(wl_cfg80211_dev, ci);
@@ -3255,19 +3255,19 @@ static s32 wl_event_handler(void *data)
3255 break; 3255 break;
3256 e = wl_deq_event(wl); 3256 e = wl_deq_event(wl);
3257 if (unlikely(!e)) { 3257 if (unlikely(!e)) {
3258 WL_ERR(("eqeue empty..\n")); 3258 WL_ERR("event queue empty...\n");
3259 BUG(); 3259 BUG();
3260 } 3260 }
3261 WL_DBG(("event type (%d)\n", e->etype)); 3261 WL_DBG("event type (%d)\n", e->etype);
3262 if (wl->el.handler[e->etype]) { 3262 if (wl->el.handler[e->etype]) {
3263 wl->el.handler[e->etype] (wl, wl_to_ndev(wl), &e->emsg, 3263 wl->el.handler[e->etype] (wl, wl_to_ndev(wl), &e->emsg,
3264 e->edata); 3264 e->edata);
3265 } else { 3265 } else {
3266 WL_DBG(("Unknown Event (%d): ignoring\n", e->etype)); 3266 WL_DBG("Unknown Event (%d): ignoring\n", e->etype);
3267 } 3267 }
3268 wl_put_event(e); 3268 wl_put_event(e);
3269 } 3269 }
3270 WL_DBG(("%s was terminated\n", __func__)); 3270 WL_DBG("%s was terminated\n", __func__);
3271 return 0; 3271 return 0;
3272} 3272}
3273 3273
@@ -3280,7 +3280,7 @@ wl_cfg80211_event(struct net_device *ndev, const wl_event_msg_t * e, void *data)
3280 s8 *estr = (event_type <= sizeof(wl_dbg_estr) / WL_DBG_ESTR_MAX - 1) ? 3280 s8 *estr = (event_type <= sizeof(wl_dbg_estr) / WL_DBG_ESTR_MAX - 1) ?
3281 wl_dbg_estr[event_type] : (s8 *) "Unknown"; 3281 wl_dbg_estr[event_type] : (s8 *) "Unknown";
3282#endif /* (WL_DBG_LEVEL > 0) */ 3282#endif /* (WL_DBG_LEVEL > 0) */
3283 WL_DBG(("event_type (%d):" "WLC_E_" "%s\n", event_type, estr)); 3283 WL_DBG("event_type (%d):" "WLC_E_" "%s\n", event_type, estr);
3284 if (likely(!wl_enq_event(wl, event_type, e, data))) 3284 if (likely(!wl_enq_event(wl, event_type, e, data)))
3285 wl_wakeup_event(wl); 3285 wl_wakeup_event(wl);
3286} 3286}
@@ -3335,7 +3335,7 @@ wl_enq_event(struct wl_priv *wl, u32 event, const wl_event_msg_t *msg,
3335 3335
3336 e = kzalloc(sizeof(struct wl_event_q), GFP_KERNEL); 3336 e = kzalloc(sizeof(struct wl_event_q), GFP_KERNEL);
3337 if (unlikely(!e)) { 3337 if (unlikely(!e)) {
3338 WL_ERR(("event alloc failed\n")); 3338 WL_ERR("event alloc failed\n");
3339 return -ENOMEM; 3339 return -ENOMEM;
3340 } 3340 }
3341 3341
@@ -3379,8 +3379,8 @@ static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype)
3379 switch (iftype) { 3379 switch (iftype) {
3380 case NL80211_IFTYPE_MONITOR: 3380 case NL80211_IFTYPE_MONITOR:
3381 case NL80211_IFTYPE_WDS: 3381 case NL80211_IFTYPE_WDS:
3382 WL_ERR(("type (%d) : currently we do not support this mode\n", 3382 WL_ERR("type (%d) : currently we do not support this mode\n",
3383 iftype)); 3383 iftype);
3384 err = -EINVAL; 3384 err = -EINVAL;
3385 return err; 3385 return err;
3386 case NL80211_IFTYPE_ADHOC: 3386 case NL80211_IFTYPE_ADHOC:
@@ -3390,20 +3390,20 @@ static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype)
3390 break; 3390 break;
3391 default: 3391 default:
3392 err = -EINVAL; 3392 err = -EINVAL;
3393 WL_ERR(("invalid type (%d)\n", iftype)); 3393 WL_ERR("invalid type (%d)\n", iftype);
3394 return err; 3394 return err;
3395 } 3395 }
3396 infra = htod32(infra); 3396 infra = htod32(infra);
3397 ap = htod32(ap); 3397 ap = htod32(ap);
3398 WL_DBG(("%s ap (%d), infra (%d)\n", ndev->name, ap, infra)); 3398 WL_DBG("%s ap (%d), infra (%d)\n", ndev->name, ap, infra);
3399 err = wl_dev_ioctl(ndev, WLC_SET_INFRA, &infra, sizeof(infra)); 3399 err = wl_dev_ioctl(ndev, WLC_SET_INFRA, &infra, sizeof(infra));
3400 if (unlikely(err)) { 3400 if (unlikely(err)) {
3401 WL_ERR(("WLC_SET_INFRA error (%d)\n", err)); 3401 WL_ERR("WLC_SET_INFRA error (%d)\n", err);
3402 return err; 3402 return err;
3403 } 3403 }
3404 err = wl_dev_ioctl(ndev, WLC_SET_AP, &ap, sizeof(ap)); 3404 err = wl_dev_ioctl(ndev, WLC_SET_AP, &ap, sizeof(ap));
3405 if (unlikely(err)) { 3405 if (unlikely(err)) {
3406 WL_ERR(("WLC_SET_AP error (%d)\n", err)); 3406 WL_ERR("WLC_SET_AP error (%d)\n", err);
3407 return err; 3407 return err;
3408 } 3408 }
3409 3409
@@ -3425,7 +3425,7 @@ static s32 wl_dongle_up(struct net_device *ndev, u32 up)
3425 3425
3426 err = wl_dev_ioctl(ndev, WLC_UP, &up, sizeof(up)); 3426 err = wl_dev_ioctl(ndev, WLC_UP, &up, sizeof(up));
3427 if (unlikely(err)) { 3427 if (unlikely(err)) {
3428 WL_ERR(("WLC_UP error (%d)\n", err)); 3428 WL_ERR("WLC_UP error (%d)\n", err);
3429 } 3429 }
3430 return err; 3430 return err;
3431} 3431}
@@ -3436,7 +3436,7 @@ static s32 wl_dongle_power(struct net_device *ndev, u32 power_mode)
3436 3436
3437 err = wl_dev_ioctl(ndev, WLC_SET_PM, &power_mode, sizeof(power_mode)); 3437 err = wl_dev_ioctl(ndev, WLC_SET_PM, &power_mode, sizeof(power_mode));
3438 if (unlikely(err)) { 3438 if (unlikely(err)) {
3439 WL_ERR(("WLC_SET_PM error (%d)\n", err)); 3439 WL_ERR("WLC_SET_PM error (%d)\n", err);
3440 } 3440 }
3441 return err; 3441 return err;
3442} 3442}
@@ -3453,14 +3453,14 @@ wl_dongle_glom(struct net_device *ndev, u32 glom, u32 dongle_align)
3453 sizeof(iovbuf)); 3453 sizeof(iovbuf));
3454 err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); 3454 err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
3455 if (unlikely(err)) { 3455 if (unlikely(err)) {
3456 WL_ERR(("txglomalign error (%d)\n", err)); 3456 WL_ERR("txglomalign error (%d)\n", err);
3457 goto dongle_glom_out; 3457 goto dongle_glom_out;
3458 } 3458 }
3459 /* disable glom option per default */ 3459 /* disable glom option per default */
3460 bcm_mkiovar("bus:txglom", (char *)&glom, 4, iovbuf, sizeof(iovbuf)); 3460 bcm_mkiovar("bus:txglom", (char *)&glom, 4, iovbuf, sizeof(iovbuf));
3461 err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); 3461 err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
3462 if (unlikely(err)) { 3462 if (unlikely(err)) {
3463 WL_ERR(("txglom error (%d)\n", err)); 3463 WL_ERR("txglom error (%d)\n", err);
3464 goto dongle_glom_out; 3464 goto dongle_glom_out;
3465 } 3465 }
3466dongle_glom_out: 3466dongle_glom_out:
@@ -3481,7 +3481,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
3481 sizeof(iovbuf)); 3481 sizeof(iovbuf));
3482 err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); 3482 err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
3483 if (unlikely(err)) { 3483 if (unlikely(err)) {
3484 WL_ERR(("bcn_timeout error (%d)\n", err)); 3484 WL_ERR("bcn_timeout error (%d)\n", err);
3485 goto dongle_rom_out; 3485 goto dongle_rom_out;
3486 } 3486 }
3487 } 3487 }
@@ -3490,7 +3490,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
3490 bcm_mkiovar("roam_off", (char *)&roamvar, 4, iovbuf, sizeof(iovbuf)); 3490 bcm_mkiovar("roam_off", (char *)&roamvar, 4, iovbuf, sizeof(iovbuf));
3491 err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); 3491 err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
3492 if (unlikely(err)) { 3492 if (unlikely(err)) {
3493 WL_ERR(("roam_off error (%d)\n", err)); 3493 WL_ERR("roam_off error (%d)\n", err);
3494 goto dongle_rom_out; 3494 goto dongle_rom_out;
3495 } 3495 }
3496dongle_rom_out: 3496dongle_rom_out:
@@ -3510,7 +3510,7 @@ static s32 wl_dongle_eventmsg(struct net_device *ndev)
3510 sizeof(iovbuf)); 3510 sizeof(iovbuf));
3511 err = wl_dev_ioctl(ndev, WLC_GET_VAR, iovbuf, sizeof(iovbuf)); 3511 err = wl_dev_ioctl(ndev, WLC_GET_VAR, iovbuf, sizeof(iovbuf));
3512 if (unlikely(err)) { 3512 if (unlikely(err)) {
3513 WL_ERR(("Get event_msgs error (%d)\n", err)); 3513 WL_ERR("Get event_msgs error (%d)\n", err);
3514 goto dongle_eventmsg_out; 3514 goto dongle_eventmsg_out;
3515 } 3515 }
3516 memcpy(eventmask, iovbuf, WL_EVENTING_MASK_LEN); 3516 memcpy(eventmask, iovbuf, WL_EVENTING_MASK_LEN);
@@ -3538,7 +3538,7 @@ static s32 wl_dongle_eventmsg(struct net_device *ndev)
3538 sizeof(iovbuf)); 3538 sizeof(iovbuf));
3539 err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); 3539 err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
3540 if (unlikely(err)) { 3540 if (unlikely(err)) {
3541 WL_ERR(("Set event_msgs error (%d)\n", err)); 3541 WL_ERR("Set event_msgs error (%d)\n", err);
3542 goto dongle_eventmsg_out; 3542 goto dongle_eventmsg_out;
3543 } 3543 }
3544 3544
@@ -3556,9 +3556,9 @@ wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
3556 sizeof(scan_assoc_time)); 3556 sizeof(scan_assoc_time));
3557 if (err) { 3557 if (err) {
3558 if (err == -EOPNOTSUPP) { 3558 if (err == -EOPNOTSUPP) {
3559 WL_INFO(("Scan assoc time is not supported\n")); 3559 WL_INFO("Scan assoc time is not supported\n");
3560 } else { 3560 } else {
3561 WL_ERR(("Scan assoc time error (%d)\n", err)); 3561 WL_ERR("Scan assoc time error (%d)\n", err);
3562 } 3562 }
3563 goto dongle_scantime_out; 3563 goto dongle_scantime_out;
3564 } 3564 }
@@ -3566,9 +3566,9 @@ wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
3566 sizeof(scan_unassoc_time)); 3566 sizeof(scan_unassoc_time));
3567 if (err) { 3567 if (err) {
3568 if (err == -EOPNOTSUPP) { 3568 if (err == -EOPNOTSUPP) {
3569 WL_INFO(("Scan unassoc time is not supported\n")); 3569 WL_INFO("Scan unassoc time is not supported\n");
3570 } else { 3570 } else {
3571 WL_ERR(("Scan unassoc time error (%d)\n", err)); 3571 WL_ERR("Scan unassoc time error (%d)\n", err);
3572 } 3572 }
3573 goto dongle_scantime_out; 3573 goto dongle_scantime_out;
3574 } 3574 }
@@ -3589,9 +3589,9 @@ wl_dongle_offload(struct net_device *ndev, s32 arpoe, s32 arp_ol)
3589 err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); 3589 err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
3590 if (err) { 3590 if (err) {
3591 if (err == -EOPNOTSUPP) 3591 if (err == -EOPNOTSUPP)
3592 WL_INFO(("arpoe is not supported\n")); 3592 WL_INFO("arpoe is not supported\n");
3593 else 3593 else
3594 WL_ERR(("arpoe error (%d)\n", err)); 3594 WL_ERR("arpoe error (%d)\n", err);
3595 3595
3596 goto dongle_offload_out; 3596 goto dongle_offload_out;
3597 } 3597 }
@@ -3599,9 +3599,9 @@ wl_dongle_offload(struct net_device *ndev, s32 arpoe, s32 arp_ol)
3599 err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); 3599 err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
3600 if (err) { 3600 if (err) {
3601 if (err == -EOPNOTSUPP) 3601 if (err == -EOPNOTSUPP)
3602 WL_INFO(("arp_ol is not supported\n")); 3602 WL_INFO("arp_ol is not supported\n");
3603 else 3603 else
3604 WL_ERR(("arp_ol error (%d)\n", err)); 3604 WL_ERR("arp_ol error (%d)\n", err);
3605 3605
3606 goto dongle_offload_out; 3606 goto dongle_offload_out;
3607 } 3607 }
@@ -3614,12 +3614,12 @@ static s32 wl_pattern_atoh(s8 *src, s8 *dst)
3614{ 3614{
3615 int i; 3615 int i;
3616 if (strncmp(src, "0x", 2) != 0 && strncmp(src, "0X", 2) != 0) { 3616 if (strncmp(src, "0x", 2) != 0 && strncmp(src, "0X", 2) != 0) {
3617 WL_ERR(("Mask invalid format. Needs to start with 0x\n")); 3617 WL_ERR("Mask invalid format. Needs to start with 0x\n");
3618 return -1; 3618 return -1;
3619 } 3619 }
3620 src = src + 2; /* Skip past 0x */ 3620 src = src + 2; /* Skip past 0x */
3621 if (strlen(src) % 2 != 0) { 3621 if (strlen(src) % 2 != 0) {
3622 WL_ERR(("Mask invalid format. Needs to be of even length\n")); 3622 WL_ERR("Mask invalid format. Needs to be of even length\n");
3623 return -1; 3623 return -1;
3624 } 3624 }
3625 for (i = 0; *src != '\0'; i++) { 3625 for (i = 0; *src != '\0'; i++) {
@@ -3678,7 +3678,7 @@ static s32 wl_dongle_filter(struct net_device *ndev, u32 filter_mode)
3678 mask_and_pattern[mask_size])); 3678 mask_and_pattern[mask_size]));
3679 3679
3680 if (mask_size != pattern_size) { 3680 if (mask_size != pattern_size) {
3681 WL_ERR(("Mask and pattern not the same size\n")); 3681 WL_ERR("Mask and pattern not the same size\n");
3682 err = -EINVAL; 3682 err = -EINVAL;
3683 goto dongle_filter_out; 3683 goto dongle_filter_out;
3684 } 3684 }
@@ -3698,9 +3698,9 @@ static s32 wl_dongle_filter(struct net_device *ndev, u32 filter_mode)
3698 err = wl_dev_ioctl(ndev, WLC_SET_VAR, buf, buf_len); 3698 err = wl_dev_ioctl(ndev, WLC_SET_VAR, buf, buf_len);
3699 if (err) { 3699 if (err) {
3700 if (err == -EOPNOTSUPP) { 3700 if (err == -EOPNOTSUPP) {
3701 WL_INFO(("filter not supported\n")); 3701 WL_INFO("filter not supported\n");
3702 } else { 3702 } else {
3703 WL_ERR(("filter (%d)\n", err)); 3703 WL_ERR("filter (%d)\n", err);
3704 } 3704 }
3705 goto dongle_filter_out; 3705 goto dongle_filter_out;
3706 } 3706 }
@@ -3711,9 +3711,9 @@ static s32 wl_dongle_filter(struct net_device *ndev, u32 filter_mode)
3711 err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf)); 3711 err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
3712 if (err) { 3712 if (err) {
3713 if (err == -EOPNOTSUPP) { 3713 if (err == -EOPNOTSUPP) {
3714 WL_INFO(("filter_mode not supported\n")); 3714 WL_INFO("filter_mode not supported\n");
3715 } else { 3715 } else {
3716 WL_ERR(("filter_mode (%d)\n", err)); 3716 WL_ERR("filter_mode (%d)\n", err);
3717 } 3717 }
3718 goto dongle_filter_out; 3718 goto dongle_filter_out;
3719 } 3719 }
@@ -3794,12 +3794,12 @@ static s32 wl_update_wiphybands(struct wl_priv *wl)
3794 err = wl_dev_ioctl(wl_to_ndev(wl), WLC_GET_PHYLIST, &phy_list, 3794 err = wl_dev_ioctl(wl_to_ndev(wl), WLC_GET_PHYLIST, &phy_list,
3795 sizeof(phy_list)); 3795 sizeof(phy_list));
3796 if (unlikely(err)) { 3796 if (unlikely(err)) {
3797 WL_ERR(("error (%d)\n", err)); 3797 WL_ERR("error (%d)\n", err);
3798 return err; 3798 return err;
3799 } 3799 }
3800 3800
3801 phy = ((char *)&phy_list)[1]; 3801 phy = ((char *)&phy_list)[1];
3802 WL_DBG(("%c phy\n", phy)); 3802 WL_DBG("%c phy\n", phy);
3803 if (phy == 'n' || phy == 'a') { 3803 if (phy == 'n' || phy == 'a') {
3804 wiphy = wl_to_wiphy(wl); 3804 wiphy = wl_to_wiphy(wl);
3805 wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n; 3805 wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n;
@@ -3905,7 +3905,7 @@ static void *wl_read_prof(struct wl_priv *wl, s32 item)
3905 case WL_PROF_SSID: 3905 case WL_PROF_SSID:
3906 return &wl->profile->ssid; 3906 return &wl->profile->ssid;
3907 } 3907 }
3908 WL_ERR(("invalid item (%d)\n", item)); 3908 WL_ERR("invalid item (%d)\n", item);
3909 return NULL; 3909 return NULL;
3910} 3910}
3911 3911
@@ -3943,7 +3943,7 @@ wl_update_prof(struct wl_priv *wl, const wl_event_msg_t *e, void *data,
3943 wl->profile->dtim_period = *(u8 *)data; 3943 wl->profile->dtim_period = *(u8 *)data;
3944 break; 3944 break;
3945 default: 3945 default:
3946 WL_ERR(("unsupported item (%d)\n", item)); 3946 WL_ERR("unsupported item (%d)\n", item);
3947 err = -EOPNOTSUPP; 3947 err = -EOPNOTSUPP;
3948 break; 3948 break;
3949 } 3949 }
@@ -3985,7 +3985,7 @@ static __used s32 wl_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v)
3985 s32 err = 0; 3985 s32 err = 0;
3986 3986
3987 if (unlikely(ie->offset + l + 2 > WL_TLV_INFO_MAX)) { 3987 if (unlikely(ie->offset + l + 2 > WL_TLV_INFO_MAX)) {
3988 WL_ERR(("ei crosses buffer boundary\n")); 3988 WL_ERR("ei crosses buffer boundary\n");
3989 return -ENOSPC; 3989 return -ENOSPC;
3990 } 3990 }
3991 ie->buf[ie->offset] = t; 3991 ie->buf[ie->offset] = t;
@@ -4002,7 +4002,7 @@ static s32 wl_mrg_ie(struct wl_priv *wl, u8 *ie_stream, u16 ie_size)
4002 s32 err = 0; 4002 s32 err = 0;
4003 4003
4004 if (unlikely(ie->offset + ie_size > WL_TLV_INFO_MAX)) { 4004 if (unlikely(ie->offset + ie_size > WL_TLV_INFO_MAX)) {
4005 WL_ERR(("ei_stream crosses buffer boundary\n")); 4005 WL_ERR("ei_stream crosses buffer boundary\n");
4006 return -ENOSPC; 4006 return -ENOSPC;
4007 } 4007 }
4008 memcpy(&ie->buf[ie->offset], ie_stream, ie_size); 4008 memcpy(&ie->buf[ie->offset], ie_stream, ie_size);
@@ -4017,7 +4017,7 @@ static s32 wl_cp_ie(struct wl_priv *wl, u8 *dst, u16 dst_size)
4017 s32 err = 0; 4017 s32 err = 0;
4018 4018
4019 if (unlikely(ie->offset > dst_size)) { 4019 if (unlikely(ie->offset > dst_size)) {
4020 WL_ERR(("dst_size is not enough\n")); 4020 WL_ERR("dst_size is not enough\n");
4021 return -ENOSPC; 4021 return -ENOSPC;
4022 } 4022 }
4023 memcpy(dst, &ie->buf[0], ie->offset); 4023 memcpy(dst, &ie->buf[0], ie->offset);
@@ -4117,37 +4117,37 @@ void *wl_cfg80211_request_fw(s8 *file_name)
4117 const struct firmware *fw_entry = NULL; 4117 const struct firmware *fw_entry = NULL;
4118 s32 err = 0; 4118 s32 err = 0;
4119 4119
4120 WL_DBG(("file name : \"%s\"\n", file_name)); 4120 WL_DBG("file name : \"%s\"\n", file_name);
4121 wl = WL_PRIV_GET(); 4121 wl = WL_PRIV_GET();
4122 4122
4123 if (!test_bit(WL_FW_LOADING_DONE, &wl->fw->status)) { 4123 if (!test_bit(WL_FW_LOADING_DONE, &wl->fw->status)) {
4124 err = request_firmware(&wl->fw->fw_entry, file_name, 4124 err = request_firmware(&wl->fw->fw_entry, file_name,
4125 &wl_cfg80211_get_sdio_func()->dev); 4125 &wl_cfg80211_get_sdio_func()->dev);
4126 if (unlikely(err)) { 4126 if (unlikely(err)) {
4127 WL_ERR(("Could not download fw (%d)\n", err)); 4127 WL_ERR("Could not download fw (%d)\n", err);
4128 goto req_fw_out; 4128 goto req_fw_out;
4129 } 4129 }
4130 set_bit(WL_FW_LOADING_DONE, &wl->fw->status); 4130 set_bit(WL_FW_LOADING_DONE, &wl->fw->status);
4131 fw_entry = wl->fw->fw_entry; 4131 fw_entry = wl->fw->fw_entry;
4132 if (fw_entry) { 4132 if (fw_entry) {
4133 WL_DBG(("fw size (%zd), data (%p)\n", fw_entry->size, 4133 WL_DBG("fw size (%zd), data (%p)\n",
4134 fw_entry->data)); 4134 fw_entry->size, fw_entry->data);
4135 } 4135 }
4136 } else if (!test_bit(WL_NVRAM_LOADING_DONE, &wl->fw->status)) { 4136 } else if (!test_bit(WL_NVRAM_LOADING_DONE, &wl->fw->status)) {
4137 err = request_firmware(&wl->fw->fw_entry, file_name, 4137 err = request_firmware(&wl->fw->fw_entry, file_name,
4138 &wl_cfg80211_get_sdio_func()->dev); 4138 &wl_cfg80211_get_sdio_func()->dev);
4139 if (unlikely(err)) { 4139 if (unlikely(err)) {
4140 WL_ERR(("Could not download nvram (%d)\n", err)); 4140 WL_ERR("Could not download nvram (%d)\n", err);
4141 goto req_fw_out; 4141 goto req_fw_out;
4142 } 4142 }
4143 set_bit(WL_NVRAM_LOADING_DONE, &wl->fw->status); 4143 set_bit(WL_NVRAM_LOADING_DONE, &wl->fw->status);
4144 fw_entry = wl->fw->fw_entry; 4144 fw_entry = wl->fw->fw_entry;
4145 if (fw_entry) { 4145 if (fw_entry) {
4146 WL_DBG(("nvram size (%zd), data (%p)\n", fw_entry->size, 4146 WL_DBG("nvram size (%zd), data (%p)\n",
4147 fw_entry->data)); 4147 fw_entry->size, fw_entry->data);
4148 } 4148 }
4149 } else { 4149 } else {
4150 WL_DBG(("Downloading already done. Nothing to do more\n")); 4150 WL_DBG("Downloading already done. Nothing to do more\n");
4151 err = -EPERM; 4151 err = -EPERM;
4152 } 4152 }
4153 4153
@@ -4183,10 +4183,10 @@ static void wl_set_mpc(struct net_device *ndev, int mpc)
4183 4183
4184 err = wl_dev_intvar_set(ndev, "mpc", mpc); 4184 err = wl_dev_intvar_set(ndev, "mpc", mpc);
4185 if (unlikely(err)) { 4185 if (unlikely(err)) {
4186 WL_ERR(("fail to set mpc\n")); 4186 WL_ERR("fail to set mpc\n");
4187 return; 4187 return;
4188 } 4188 }
4189 WL_DBG(("MPC : %d\n", mpc)); 4189 WL_DBG("MPC : %d\n", mpc);
4190} 4190}
4191 4191
4192static int wl_debugfs_add_netdev_params(struct wl_priv *wl) 4192static int wl_debugfs_add_netdev_params(struct wl_priv *wl)
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index 1069e65f8ce6..482691be210a 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -54,34 +54,36 @@ struct wl_ibss;
54 54
55#define WL_DBG_LEVEL 1 /* 0 invalidates all debug messages. 55#define WL_DBG_LEVEL 1 /* 0 invalidates all debug messages.
56 default is 1 */ 56 default is 1 */
57#define WL_ERR(args) \ 57#define WL_ERR(fmt, args...) \
58do { \ 58do { \
59 if (wl_dbg_level & WL_DBG_ERR) { \ 59 if (wl_dbg_level & WL_DBG_ERR) { \
60 if (net_ratelimit()) { \ 60 if (net_ratelimit()) { \
61 printk(KERN_ERR "ERROR @%s : ", __func__); \ 61 printk(KERN_ERR "ERROR @%s : " fmt, \
62 printk args; \ 62 __func__, ##args); \
63 } \ 63 } \
64 } \ 64 } \
65} while (0) 65} while (0)
66#define WL_INFO(args) \ 66
67do { \ 67#define WL_INFO(fmt, args...) \
68 if (wl_dbg_level & WL_DBG_INFO) { \ 68do { \
69 if (net_ratelimit()) { \ 69 if (wl_dbg_level & WL_DBG_INFO) { \
70 printk(KERN_ERR "INFO @%s : ", __func__); \ 70 if (net_ratelimit()) { \
71 printk args; \ 71 printk(KERN_ERR "INFO @%s : " fmt, \
72 } \ 72 __func__, ##args); \
73 } \ 73 } \
74 } \
74} while (0) 75} while (0)
76
75#if (WL_DBG_LEVEL > 0) 77#if (WL_DBG_LEVEL > 0)
76#define WL_DBG(args) \ 78#define WL_DBG(fmt, args...) \
77do { \ 79do { \
78 if (wl_dbg_level & WL_DBG_DBG) { \ 80 if (wl_dbg_level & WL_DBG_DBG) { \
79 printk(KERN_ERR "DEBUG @%s :", __func__); \ 81 printk(KERN_ERR "DEBUG @%s :" fmt, \
80 printk args; \ 82 __func__, ##args); \
81 } \ 83 } \
82} while (0) 84} while (0)
83#else /* !(WL_DBG_LEVEL > 0) */ 85#else /* !(WL_DBG_LEVEL > 0) */
84#define WL_DBG(args) 86#define WL_DBG(fmt, args...) noprintk(fmt, ##args)
85#endif /* (WL_DBG_LEVEL > 0) */ 87#endif /* (WL_DBG_LEVEL > 0) */
86 88
87#define WL_SCAN_RETRY_MAX 3 /* used for ibss scan */ 89#define WL_SCAN_RETRY_MAX 3 /* used for ibss scan */
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/drivers/staging/brcm80211/brcmfmac/wl_iw.c
index 14580b2ea198..db6e68eab290 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_iw.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.c
@@ -39,12 +39,11 @@ typedef const struct si_pub si_t;
39#include <dngl_stats.h> 39#include <dngl_stats.h>
40#include <dhd.h> 40#include <dhd.h>
41 41
42#define WL_ERROR(x) printf x 42#define WL_ERROR(fmt, args...) printk(fmt, ##args)
43#define WL_TRACE(x) 43#define WL_TRACE(fmt, args...) no_printk(fmt, ##args)
44#define WL_ASSOC(x) 44#define WL_INFORM(fmt, args...) no_printk(fmt, ##args)
45#define WL_INFORM(x) 45#define WL_WSEC(fmt, args...) no_printk(fmt, ##args)
46#define WL_WSEC(x) 46#define WL_SCAN(fmt, args...) no_printk(fmt, ##args)
47#define WL_SCAN(x)
48 47
49#include <wl_iw.h> 48#include <wl_iw.h>
50 49
@@ -187,12 +186,12 @@ static int dev_wlc_ioctl(struct net_device *dev, int cmd, void *arg, int len)
187 int ret = -EINVAL; 186 int ret = -EINVAL;
188 187
189 if (!dev) { 188 if (!dev) {
190 WL_ERROR(("%s: dev is null\n", __func__)); 189 WL_ERROR("%s: dev is null\n", __func__);
191 return ret; 190 return ret;
192 } 191 }
193 192
194 WL_INFORM(("\n%s, PID:%x: send Local IOCTL -> dhd: cmd:0x%x, buf:%p, " 193 WL_INFORM("\n%s, PID:%x: send Local IOCTL -> dhd: cmd:0x%x, buf:%p, len:%d\n",
195 "len:%d ,\n", __func__, current->pid, cmd, arg, len)); 194 __func__, current->pid, cmd, arg, len);
196 195
197 if (g_onoff == G_WLAN_SET_ON) { 196 if (g_onoff == G_WLAN_SET_ON) {
198 memset(&ioc, 0, sizeof(ioc)); 197 memset(&ioc, 0, sizeof(ioc));
@@ -205,7 +204,7 @@ static int dev_wlc_ioctl(struct net_device *dev, int cmd, void *arg, int len)
205 204
206 ret = dev_open(dev); 205 ret = dev_open(dev);
207 if (ret) { 206 if (ret) {
208 WL_ERROR(("%s: Error dev_open: %d\n", __func__, ret)); 207 WL_ERROR("%s: Error dev_open: %d\n", __func__, ret);
209 return ret; 208 return ret;
210 } 209 }
211 210
@@ -214,7 +213,7 @@ static int dev_wlc_ioctl(struct net_device *dev, int cmd, void *arg, int len)
214 ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE); 213 ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
215 set_fs(fs); 214 set_fs(fs);
216 } else { 215 } else {
217 WL_TRACE(("%s: call after driver stop : ignored\n", __func__)); 216 WL_TRACE("%s: call after driver stop : ignored\n", __func__);
218 } 217 }
219 return ret; 218 return ret;
220} 219}
@@ -335,7 +334,7 @@ wl_iw_config_commit(struct net_device *dev,
335 int error; 334 int error;
336 struct sockaddr bssid; 335 struct sockaddr bssid;
337 336
338 WL_TRACE(("%s: SIOCSIWCOMMIT\n", dev->name)); 337 WL_TRACE("%s: SIOCSIWCOMMIT\n", dev->name);
339 338
340 error = dev_wlc_ioctl(dev, WLC_GET_SSID, &ssid, sizeof(ssid)); 339 error = dev_wlc_ioctl(dev, WLC_GET_SSID, &ssid, sizeof(ssid));
341 if (error) 340 if (error)
@@ -349,8 +348,8 @@ wl_iw_config_commit(struct net_device *dev,
349 memset(&bssid, 0, sizeof(struct sockaddr)); 348 memset(&bssid, 0, sizeof(struct sockaddr));
350 error = dev_wlc_ioctl(dev, WLC_REASSOC, &bssid, ETH_ALEN); 349 error = dev_wlc_ioctl(dev, WLC_REASSOC, &bssid, ETH_ALEN);
351 if (error) { 350 if (error) {
352 WL_ERROR(("%s: WLC_REASSOC to %s failed\n", __func__, 351 WL_ERROR("%s: WLC_REASSOC to %s failed\n",
353 ssid.SSID)); 352 __func__, ssid.SSID);
354 return error; 353 return error;
355 } 354 }
356 355
@@ -361,7 +360,7 @@ static int
361wl_iw_get_name(struct net_device *dev, 360wl_iw_get_name(struct net_device *dev,
362 struct iw_request_info *info, char *cwrq, char *extra) 361 struct iw_request_info *info, char *cwrq, char *extra)
363{ 362{
364 WL_TRACE(("%s: SIOCGIWNAME\n", dev->name)); 363 WL_TRACE("%s: SIOCGIWNAME\n", dev->name);
365 364
366 strcpy(cwrq, "IEEE 802.11-DS"); 365 strcpy(cwrq, "IEEE 802.11-DS");
367 366
@@ -375,7 +374,7 @@ wl_iw_set_freq(struct net_device *dev,
375 int error, chan; 374 int error, chan;
376 uint sf = 0; 375 uint sf = 0;
377 376
378 WL_TRACE(("\n %s %s: SIOCSIWFREQ\n", __func__, dev->name)); 377 WL_TRACE("\n %s %s: SIOCSIWFREQ\n", __func__, dev->name);
379 378
380 if (fwrq->e == 0 && fwrq->m < MAXCHANNEL) { 379 if (fwrq->e == 0 && fwrq->m < MAXCHANNEL) {
381 chan = fwrq->m; 380 chan = fwrq->m;
@@ -410,7 +409,7 @@ wl_iw_get_freq(struct net_device *dev,
410 channel_info_t ci; 409 channel_info_t ci;
411 int error; 410 int error;
412 411
413 WL_TRACE(("%s: SIOCGIWFREQ\n", dev->name)); 412 WL_TRACE("%s: SIOCGIWFREQ\n", dev->name);
414 413
415 error = dev_wlc_ioctl(dev, WLC_GET_CHANNEL, &ci, sizeof(ci)); 414 error = dev_wlc_ioctl(dev, WLC_GET_CHANNEL, &ci, sizeof(ci));
416 if (error) 415 if (error)
@@ -427,7 +426,7 @@ wl_iw_set_mode(struct net_device *dev,
427{ 426{
428 int infra = 0, ap = 0, error = 0; 427 int infra = 0, ap = 0, error = 0;
429 428
430 WL_TRACE(("%s: SIOCSIWMODE\n", dev->name)); 429 WL_TRACE("%s: SIOCSIWMODE\n", dev->name);
431 430
432 switch (*uwrq) { 431 switch (*uwrq) {
433 case IW_MODE_MASTER: 432 case IW_MODE_MASTER:
@@ -462,7 +461,7 @@ wl_iw_get_mode(struct net_device *dev,
462{ 461{
463 int error, infra = 0, ap = 0; 462 int error, infra = 0, ap = 0;
464 463
465 WL_TRACE(("%s: SIOCGIWMODE\n", dev->name)); 464 WL_TRACE("%s: SIOCGIWMODE\n", dev->name);
466 465
467 error = dev_wlc_ioctl(dev, WLC_GET_INFRA, &infra, sizeof(infra)); 466 error = dev_wlc_ioctl(dev, WLC_GET_INFRA, &infra, sizeof(infra));
468 if (error) 467 if (error)
@@ -501,14 +500,14 @@ wl_iw_get_range(struct net_device *dev,
501 {30, 60, 90, 120, 180, 240, 270, 300} 500 {30, 60, 90, 120, 180, 240, 270, 300}
502 }; 501 };
503 502
504 WL_TRACE(("%s: SIOCGIWRANGE\n", dev->name)); 503 WL_TRACE("%s: SIOCGIWRANGE\n", dev->name);
505 504
506 if (!extra) 505 if (!extra)
507 return -EINVAL; 506 return -EINVAL;
508 507
509 channels = kmalloc((MAXCHANNEL + 1) * 4, GFP_KERNEL); 508 channels = kmalloc((MAXCHANNEL + 1) * 4, GFP_KERNEL);
510 if (!channels) { 509 if (!channels) {
511 WL_ERROR(("Could not alloc channels\n")); 510 WL_ERROR("Could not alloc channels\n");
512 return -ENOMEM; 511 return -ENOMEM;
513 } 512 }
514 list = (wl_u32_list_t *) channels; 513 list = (wl_u32_list_t *) channels;
@@ -684,7 +683,7 @@ wl_iw_set_spy(struct net_device *dev,
684 struct sockaddr *addr = (struct sockaddr *)extra; 683 struct sockaddr *addr = (struct sockaddr *)extra;
685 int i; 684 int i;
686 685
687 WL_TRACE(("%s: SIOCSIWSPY\n", dev->name)); 686 WL_TRACE("%s: SIOCSIWSPY\n", dev->name);
688 687
689 if (!extra) 688 if (!extra)
690 return -EINVAL; 689 return -EINVAL;
@@ -706,7 +705,7 @@ wl_iw_get_spy(struct net_device *dev,
706 struct iw_quality *qual = (struct iw_quality *)&addr[iw->spy_num]; 705 struct iw_quality *qual = (struct iw_quality *)&addr[iw->spy_num];
707 int i; 706 int i;
708 707
709 WL_TRACE(("%s: SIOCGIWSPY\n", dev->name)); 708 WL_TRACE("%s: SIOCGIWSPY\n", dev->name);
710 709
711 if (!extra) 710 if (!extra)
712 return -EINVAL; 711 return -EINVAL;
@@ -751,8 +750,8 @@ wl_iw_ch_to_chanspec(int ch, wl_join_params_t *join_params,
751 join_params->params.chanspec_num = 750 join_params->params.chanspec_num =
752 htod32(join_params->params.chanspec_num); 751 htod32(join_params->params.chanspec_num);
753 752
754 WL_TRACE(("%s join_params->params.chanspec_list[0]= %X\n", 753 WL_TRACE("%s join_params->params.chanspec_list[0]= %X\n",
755 __func__, join_params->params.chanspec_list[0])); 754 __func__, join_params->params.chanspec_list[0]);
756 } 755 }
757 return 1; 756 return 1;
758} 757}
@@ -765,10 +764,10 @@ wl_iw_set_wap(struct net_device *dev,
765 wl_join_params_t join_params; 764 wl_join_params_t join_params;
766 int join_params_size; 765 int join_params_size;
767 766
768 WL_TRACE(("%s: SIOCSIWAP\n", dev->name)); 767 WL_TRACE("%s: SIOCSIWAP\n", dev->name);
769 768
770 if (awrq->sa_family != ARPHRD_ETHER) { 769 if (awrq->sa_family != ARPHRD_ETHER) {
771 WL_ERROR(("Invalid Header...sa_family\n")); 770 WL_ERROR("Invalid Header...sa_family\n");
772 return -EINVAL; 771 return -EINVAL;
773 } 772 }
774 773
@@ -788,21 +787,21 @@ wl_iw_set_wap(struct net_device *dev,
788 join_params.ssid.SSID_len = htod32(g_ssid.SSID_len); 787 join_params.ssid.SSID_len = htod32(g_ssid.SSID_len);
789 memcpy(&join_params.params.bssid, awrq->sa_data, ETH_ALEN); 788 memcpy(&join_params.params.bssid, awrq->sa_data, ETH_ALEN);
790 789
791 WL_TRACE(("%s target_channel=%d\n", __func__, 790 WL_TRACE("%s target_channel=%d\n",
792 g_wl_iw_params.target_channel)); 791 __func__, g_wl_iw_params.target_channel);
793 wl_iw_ch_to_chanspec(g_wl_iw_params.target_channel, &join_params, 792 wl_iw_ch_to_chanspec(g_wl_iw_params.target_channel, &join_params,
794 &join_params_size); 793 &join_params_size);
795 794
796 error = dev_wlc_ioctl(dev, WLC_SET_SSID, &join_params, 795 error = dev_wlc_ioctl(dev, WLC_SET_SSID, &join_params,
797 join_params_size); 796 join_params_size);
798 if (error) { 797 if (error) {
799 WL_ERROR(("%s Invalid ioctl data=%d\n", __func__, error)); 798 WL_ERROR("%s Invalid ioctl data=%d\n", __func__, error);
800 } 799 }
801 800
802 if (g_ssid.SSID_len) { 801 if (g_ssid.SSID_len) {
803 WL_TRACE(("%s: join SSID=%s BSSID=%pM ch=%d\n", 802 WL_TRACE("%s: join SSID=%s BSSID=%pM ch=%d\n",
804 __func__, g_ssid.SSID, awrq->sa_data, 803 __func__, g_ssid.SSID, awrq->sa_data,
805 g_wl_iw_params.target_channel)); 804 g_wl_iw_params.target_channel);
806 } 805 }
807 806
808 memset(&g_ssid, 0, sizeof(g_ssid)); 807 memset(&g_ssid, 0, sizeof(g_ssid));
@@ -813,7 +812,7 @@ static int
813wl_iw_get_wap(struct net_device *dev, 812wl_iw_get_wap(struct net_device *dev,
814 struct iw_request_info *info, struct sockaddr *awrq, char *extra) 813 struct iw_request_info *info, struct sockaddr *awrq, char *extra)
815{ 814{
816 WL_TRACE(("%s: SIOCGIWAP\n", dev->name)); 815 WL_TRACE("%s: SIOCGIWAP\n", dev->name);
817 816
818 awrq->sa_family = ARPHRD_ETHER; 817 awrq->sa_family = ARPHRD_ETHER;
819 memset(awrq->sa_data, 0, ETH_ALEN); 818 memset(awrq->sa_data, 0, ETH_ALEN);
@@ -832,11 +831,11 @@ wl_iw_mlme(struct net_device *dev,
832 scb_val_t scbval; 831 scb_val_t scbval;
833 int error = -EINVAL; 832 int error = -EINVAL;
834 833
835 WL_TRACE(("%s: SIOCSIWMLME DISASSOC/DEAUTH\n", dev->name)); 834 WL_TRACE("%s: SIOCSIWMLME DISASSOC/DEAUTH\n", dev->name);
836 835
837 mlme = (struct iw_mlme *)extra; 836 mlme = (struct iw_mlme *)extra;
838 if (mlme == NULL) { 837 if (mlme == NULL) {
839 WL_ERROR(("Invalid ioctl data.\n")); 838 WL_ERROR("Invalid ioctl data\n");
840 return error; 839 return error;
841 } 840 }
842 841
@@ -854,7 +853,7 @@ wl_iw_mlme(struct net_device *dev,
854 dev_wlc_ioctl(dev, WLC_SCB_DEAUTHENTICATE_FOR_REASON, 853 dev_wlc_ioctl(dev, WLC_SCB_DEAUTHENTICATE_FOR_REASON,
855 &scbval, sizeof(scb_val_t)); 854 &scbval, sizeof(scb_val_t));
856 } else { 855 } else {
857 WL_ERROR(("Invalid ioctl data.\n")); 856 WL_ERROR("Invalid ioctl data\n");
858 return error; 857 return error;
859 } 858 }
860 859
@@ -875,7 +874,7 @@ wl_iw_get_aplist(struct net_device *dev,
875 int error, i; 874 int error, i;
876 uint buflen = dwrq->length; 875 uint buflen = dwrq->length;
877 876
878 WL_TRACE(("%s: SIOCGIWAPLIST\n", dev->name)); 877 WL_TRACE("%s: SIOCGIWAPLIST\n", dev->name);
879 878
880 if (!extra) 879 if (!extra)
881 return -EINVAL; 880 return -EINVAL;
@@ -887,7 +886,7 @@ wl_iw_get_aplist(struct net_device *dev,
887 list->buflen = htod32(buflen); 886 list->buflen = htod32(buflen);
888 error = dev_wlc_ioctl(dev, WLC_SCAN_RESULTS, list, buflen); 887 error = dev_wlc_ioctl(dev, WLC_SCAN_RESULTS, list, buflen);
889 if (error) { 888 if (error) {
890 WL_ERROR(("%d: Scan results error %d\n", __LINE__, error)); 889 WL_ERROR("%d: Scan results error %d\n", __LINE__, error);
891 kfree(list); 890 kfree(list);
892 return error; 891 return error;
893 } 892 }
@@ -895,8 +894,8 @@ wl_iw_get_aplist(struct net_device *dev,
895 list->version = dtoh32(list->version); 894 list->version = dtoh32(list->version);
896 list->count = dtoh32(list->count); 895 list->count = dtoh32(list->count);
897 if (list->version != WL_BSS_INFO_VERSION) { 896 if (list->version != WL_BSS_INFO_VERSION) {
898 WL_ERROR(("%s : list->version %d != WL_BSS_INFO_VERSION\n", 897 WL_ERROR("%s : list->version %d != WL_BSS_INFO_VERSION\n",
899 __func__, list->version)); 898 __func__, list->version);
900 kfree(list); 899 kfree(list);
901 return -EINVAL; 900 return -EINVAL;
902 } 901 }
@@ -953,13 +952,13 @@ wl_iw_iscan_get_aplist(struct net_device *dev,
953 wl_bss_info_t *bi = NULL; 952 wl_bss_info_t *bi = NULL;
954 int i; 953 int i;
955 954
956 WL_TRACE(("%s: SIOCGIWAPLIST\n", dev->name)); 955 WL_TRACE("%s: SIOCGIWAPLIST\n", dev->name);
957 956
958 if (!extra) 957 if (!extra)
959 return -EINVAL; 958 return -EINVAL;
960 959
961 if ((!iscan) || (!iscan->sysioc_tsk)) { 960 if ((!iscan) || (!iscan->sysioc_tsk)) {
962 WL_ERROR(("%s error\n", __func__)); 961 WL_ERROR("%s error\n", __func__);
963 return 0; 962 return 0;
964 } 963 }
965 964
@@ -967,9 +966,8 @@ wl_iw_iscan_get_aplist(struct net_device *dev,
967 while (buf) { 966 while (buf) {
968 list = &((wl_iscan_results_t *) buf->iscan_buf)->results; 967 list = &((wl_iscan_results_t *) buf->iscan_buf)->results;
969 if (list->version != WL_BSS_INFO_VERSION) { 968 if (list->version != WL_BSS_INFO_VERSION) {
970 WL_ERROR(("%s : list->version %d != " 969 WL_ERROR("%s : list->version %d != WL_BSS_INFO_VERSION\n",
971 "WL_BSS_INFO_VERSION\n", 970 __func__, list->version);
972 __func__, list->version));
973 return -EINVAL; 971 return -EINVAL;
974 } 972 }
975 973
@@ -1044,15 +1042,15 @@ static int wl_iw_iscan(iscan_info_t *iscan, wlc_ssid_t *ssid, u16 action)
1044 iscan->iscan_ex_params_p->action = htod16(action); 1042 iscan->iscan_ex_params_p->action = htod16(action);
1045 iscan->iscan_ex_params_p->scan_duration = htod16(0); 1043 iscan->iscan_ex_params_p->scan_duration = htod16(0);
1046 1044
1047 WL_SCAN(("%s : nprobes=%d\n", __func__, 1045 WL_SCAN("%s : nprobes=%d\n",
1048 iscan->iscan_ex_params_p->params.nprobes)); 1046 __func__, iscan->iscan_ex_params_p->params.nprobes);
1049 WL_SCAN(("active_time=%d\n", 1047 WL_SCAN("active_time=%d\n",
1050 iscan->iscan_ex_params_p->params.active_time)); 1048 iscan->iscan_ex_params_p->params.active_time);
1051 WL_SCAN(("passive_time=%d\n", 1049 WL_SCAN("passive_time=%d\n",
1052 iscan->iscan_ex_params_p->params.passive_time)); 1050 iscan->iscan_ex_params_p->params.passive_time);
1053 WL_SCAN(("home_time=%d\n", iscan->iscan_ex_params_p->params.home_time)); 1051 WL_SCAN("home_time=%d\n", iscan->iscan_ex_params_p->params.home_time);
1054 WL_SCAN(("scan_type=%d\n", iscan->iscan_ex_params_p->params.scan_type)); 1052 WL_SCAN("scan_type=%d\n", iscan->iscan_ex_params_p->params.scan_type);
1055 WL_SCAN(("bss_type=%d\n", iscan->iscan_ex_params_p->params.bss_type)); 1053 WL_SCAN("bss_type=%d\n", iscan->iscan_ex_params_p->params.bss_type);
1056 1054
1057 (void)dev_iw_iovar_setbuf(iscan->dev, "iscan", iscan->iscan_ex_params_p, 1055 (void)dev_iw_iovar_setbuf(iscan->dev, "iscan", iscan->iscan_ex_params_p,
1058 iscan->iscan_ex_param_size, iscan->ioctlbuf, 1056 iscan->iscan_ex_param_size, iscan->ioctlbuf,
@@ -1067,7 +1065,7 @@ static void wl_iw_timerfunc(unsigned long data)
1067 if (iscan) { 1065 if (iscan) {
1068 iscan->timer_on = 0; 1066 iscan->timer_on = 0;
1069 if (iscan->iscan_state != ISCAN_STATE_IDLE) { 1067 if (iscan->iscan_state != ISCAN_STATE_IDLE) {
1070 WL_TRACE(("timer trigger\n")); 1068 WL_TRACE("timer trigger\n");
1071 up(&iscan->sysioc_sem); 1069 up(&iscan->sysioc_sem);
1072 } 1070 }
1073 } 1071 }
@@ -1102,8 +1100,8 @@ static u32 wl_iw_iscan_get(iscan_info_t *iscan)
1102 } else { 1100 } else {
1103 buf = kmalloc(sizeof(iscan_buf_t), GFP_KERNEL); 1101 buf = kmalloc(sizeof(iscan_buf_t), GFP_KERNEL);
1104 if (!buf) { 1102 if (!buf) {
1105 WL_ERROR(("%s can't alloc iscan_buf_t : going to abort " 1103 WL_ERROR("%s can't alloc iscan_buf_t : going to abort current iscan\n",
1106 "currect iscan\n", __func__)); 1104 __func__);
1107 MUTEX_UNLOCK_WL_SCAN_SET(); 1105 MUTEX_UNLOCK_WL_SCAN_SET();
1108 return WL_SCAN_RESULTS_NO_MEM; 1106 return WL_SCAN_RESULTS_NO_MEM;
1109 } 1107 }
@@ -1136,11 +1134,11 @@ static u32 wl_iw_iscan_get(iscan_info_t *iscan)
1136 results->buflen = dtoh32(results->buflen); 1134 results->buflen = dtoh32(results->buflen);
1137 results->version = dtoh32(results->version); 1135 results->version = dtoh32(results->version);
1138 results->count = dtoh32(results->count); 1136 results->count = dtoh32(results->count);
1139 WL_TRACE(("results->count = %d\n", results->count)); 1137 WL_TRACE("results->count = %d\n", results->count);
1140 WL_TRACE(("results->buflen = %d\n", results->buflen)); 1138 WL_TRACE("results->buflen = %d\n", results->buflen);
1141 status = dtoh32(list_buf->status); 1139 status = dtoh32(list_buf->status);
1142 } else { 1140 } else {
1143 WL_ERROR(("%s returns error %d\n", __func__, res)); 1141 WL_ERROR("%s returns error %d\n", __func__, res);
1144 status = WL_SCAN_RESULTS_NO_MEM; 1142 status = WL_SCAN_RESULTS_NO_MEM;
1145 } 1143 }
1146 MUTEX_UNLOCK_WL_SCAN_SET(); 1144 MUTEX_UNLOCK_WL_SCAN_SET();
@@ -1149,8 +1147,8 @@ static u32 wl_iw_iscan_get(iscan_info_t *iscan)
1149 1147
1150static void wl_iw_force_specific_scan(iscan_info_t *iscan) 1148static void wl_iw_force_specific_scan(iscan_info_t *iscan)
1151{ 1149{
1152 WL_TRACE(("%s force Specific SCAN for %s\n", __func__, 1150 WL_TRACE("%s force Specific SCAN for %s\n",
1153 g_specific_ssid.SSID)); 1151 __func__, g_specific_ssid.SSID);
1154 rtnl_lock(); 1152 rtnl_lock();
1155 1153
1156 (void)dev_wlc_ioctl(iscan->dev, WLC_SCAN, &g_specific_ssid, 1154 (void)dev_wlc_ioctl(iscan->dev, WLC_SCAN, &g_specific_ssid,
@@ -1167,7 +1165,7 @@ static void wl_iw_send_scan_complete(iscan_info_t *iscan)
1167 memset(&wrqu, 0, sizeof(wrqu)); 1165 memset(&wrqu, 0, sizeof(wrqu));
1168 1166
1169 wireless_send_event(iscan->dev, SIOCGIWSCAN, &wrqu, NULL); 1167 wireless_send_event(iscan->dev, SIOCGIWSCAN, &wrqu, NULL);
1170 WL_TRACE(("Send Event ISCAN complete\n")); 1168 WL_TRACE("Send Event ISCAN complete\n");
1171#endif 1169#endif
1172} 1170}
1173 1171
@@ -1191,8 +1189,8 @@ static int _iscan_sysioc_thread(void *data)
1191 status = wl_iw_iscan_get(iscan); 1189 status = wl_iw_iscan_get(iscan);
1192 rtnl_unlock(); 1190 rtnl_unlock();
1193 if (g_scan_specified_ssid && (iscan_pass_abort == true)) { 1191 if (g_scan_specified_ssid && (iscan_pass_abort == true)) {
1194 WL_TRACE(("%s Get results from specific scan " 1192 WL_TRACE("%s Get results from specific scan status = %d\n",
1195 "status = %d\n", __func__, status)); 1193 __func__, status);
1196 wl_iw_send_scan_complete(iscan); 1194 wl_iw_send_scan_complete(iscan);
1197 iscan_pass_abort = false; 1195 iscan_pass_abort = false;
1198 status = -1; 1196 status = -1;
@@ -1200,7 +1198,7 @@ static int _iscan_sysioc_thread(void *data)
1200 1198
1201 switch (status) { 1199 switch (status) {
1202 case WL_SCAN_RESULTS_PARTIAL: 1200 case WL_SCAN_RESULTS_PARTIAL:
1203 WL_TRACE(("iscanresults incomplete\n")); 1201 WL_TRACE("iscanresults incomplete\n");
1204 rtnl_lock(); 1202 rtnl_lock();
1205 wl_iw_iscan(iscan, NULL, WL_SCAN_ACTION_CONTINUE); 1203 wl_iw_iscan(iscan, NULL, WL_SCAN_ACTION_CONTINUE);
1206 rtnl_unlock(); 1204 rtnl_unlock();
@@ -1209,18 +1207,18 @@ static int _iscan_sysioc_thread(void *data)
1209 iscan->timer_on = 1; 1207 iscan->timer_on = 1;
1210 break; 1208 break;
1211 case WL_SCAN_RESULTS_SUCCESS: 1209 case WL_SCAN_RESULTS_SUCCESS:
1212 WL_TRACE(("iscanresults complete\n")); 1210 WL_TRACE("iscanresults complete\n");
1213 iscan->iscan_state = ISCAN_STATE_IDLE; 1211 iscan->iscan_state = ISCAN_STATE_IDLE;
1214 wl_iw_send_scan_complete(iscan); 1212 wl_iw_send_scan_complete(iscan);
1215 break; 1213 break;
1216 case WL_SCAN_RESULTS_PENDING: 1214 case WL_SCAN_RESULTS_PENDING:
1217 WL_TRACE(("iscanresults pending\n")); 1215 WL_TRACE("iscanresults pending\n");
1218 mod_timer(&iscan->timer, 1216 mod_timer(&iscan->timer,
1219 jiffies + iscan->timer_ms * HZ / 1000); 1217 jiffies + iscan->timer_ms * HZ / 1000);
1220 iscan->timer_on = 1; 1218 iscan->timer_on = 1;
1221 break; 1219 break;
1222 case WL_SCAN_RESULTS_ABORTED: 1220 case WL_SCAN_RESULTS_ABORTED:
1223 WL_TRACE(("iscanresults aborted\n")); 1221 WL_TRACE("iscanresults aborted\n");
1224 iscan->iscan_state = ISCAN_STATE_IDLE; 1222 iscan->iscan_state = ISCAN_STATE_IDLE;
1225 if (g_scan_specified_ssid == 0) 1223 if (g_scan_specified_ssid == 0)
1226 wl_iw_send_scan_complete(iscan); 1224 wl_iw_send_scan_complete(iscan);
@@ -1230,12 +1228,12 @@ static int _iscan_sysioc_thread(void *data)
1230 } 1228 }
1231 break; 1229 break;
1232 case WL_SCAN_RESULTS_NO_MEM: 1230 case WL_SCAN_RESULTS_NO_MEM:
1233 WL_TRACE(("iscanresults can't alloc memory: skip\n")); 1231 WL_TRACE("iscanresults can't alloc memory: skip\n");
1234 iscan->iscan_state = ISCAN_STATE_IDLE; 1232 iscan->iscan_state = ISCAN_STATE_IDLE;
1235 break; 1233 break;
1236 default: 1234 default:
1237 WL_TRACE(("iscanresults returned unknown status %d\n", 1235 WL_TRACE("iscanresults returned unknown status %d\n",
1238 status)); 1236 status);
1239 break; 1237 break;
1240 } 1238 }
1241 } 1239 }
@@ -1254,11 +1252,11 @@ wl_iw_set_scan(struct net_device *dev,
1254 union iwreq_data *wrqu, char *extra) 1252 union iwreq_data *wrqu, char *extra)
1255{ 1253{
1256 int error; 1254 int error;
1257 WL_TRACE(("\n:%s dev:%s: SIOCSIWSCAN : SCAN\n", __func__, dev->name)); 1255 WL_TRACE("\n:%s dev:%s: SIOCSIWSCAN : SCAN\n", __func__, dev->name);
1258 1256
1259 g_set_essid_before_scan = false; 1257 g_set_essid_before_scan = false;
1260#if defined(CSCAN) 1258#if defined(CSCAN)
1261 WL_ERROR(("%s: Scan from SIOCGIWSCAN not supported\n", __func__)); 1259 WL_ERROR("%s: Scan from SIOCGIWSCAN not supported\n", __func__);
1262 return -EINVAL; 1260 return -EINVAL;
1263#endif 1261#endif
1264 1262
@@ -1275,9 +1273,8 @@ wl_iw_set_scan(struct net_device *dev,
1275 if (wrqu->data.flags & IW_SCAN_THIS_ESSID) { 1273 if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
1276 struct iw_scan_req *req = (struct iw_scan_req *)extra; 1274 struct iw_scan_req *req = (struct iw_scan_req *)extra;
1277 if (g_scan_specified_ssid) { 1275 if (g_scan_specified_ssid) {
1278 WL_TRACE(("%s Specific SCAN is not done ignore " 1276 WL_TRACE("%s Specific SCAN is not done ignore scan for = %s\n",
1279 "scan for = %s\n", 1277 __func__, req->essid);
1280 __func__, req->essid));
1281 return -EBUSY; 1278 return -EBUSY;
1282 } else { 1279 } else {
1283 g_specific_ssid.SSID_len = min_t(size_t, 1280 g_specific_ssid.SSID_len = min_t(size_t,
@@ -1288,9 +1285,9 @@ wl_iw_set_scan(struct net_device *dev,
1288 g_specific_ssid.SSID_len = 1285 g_specific_ssid.SSID_len =
1289 htod32(g_specific_ssid.SSID_len); 1286 htod32(g_specific_ssid.SSID_len);
1290 g_scan_specified_ssid = 1; 1287 g_scan_specified_ssid = 1;
1291 WL_TRACE(("### Specific scan ssid=%s len=%d\n", 1288 WL_TRACE("### Specific scan ssid=%s len=%d\n",
1292 g_specific_ssid.SSID, 1289 g_specific_ssid.SSID,
1293 g_specific_ssid.SSID_len)); 1290 g_specific_ssid.SSID_len);
1294 } 1291 }
1295 } 1292 }
1296 } 1293 }
@@ -1298,8 +1295,8 @@ wl_iw_set_scan(struct net_device *dev,
1298 error = dev_wlc_ioctl(dev, WLC_SCAN, &g_specific_ssid, 1295 error = dev_wlc_ioctl(dev, WLC_SCAN, &g_specific_ssid,
1299 sizeof(g_specific_ssid)); 1296 sizeof(g_specific_ssid));
1300 if (error) { 1297 if (error) {
1301 WL_TRACE(("#### Set SCAN for %s failed with %d\n", 1298 WL_TRACE("#### Set SCAN for %s failed with %d\n",
1302 g_specific_ssid.SSID, error)); 1299 g_specific_ssid.SSID, error);
1303 g_scan_specified_ssid = 0; 1300 g_scan_specified_ssid = 0;
1304 return -EBUSY; 1301 return -EBUSY;
1305 } 1302 }
@@ -1318,7 +1315,7 @@ int wl_iw_iscan_set_scan_broadcast_prep(struct net_device *dev, uint flag)
1318 1315
1319 wl_iw_set_event_mask(dev); 1316 wl_iw_set_event_mask(dev);
1320 1317
1321 WL_TRACE(("+++: Set Broadcast ISCAN\n")); 1318 WL_TRACE("+++: Set Broadcast ISCAN\n");
1322 memset(&ssid, 0, sizeof(ssid)); 1319 memset(&ssid, 0, sizeof(ssid));
1323 1320
1324 iscan->list_cur = iscan->list_hdr; 1321 iscan->list_cur = iscan->list_hdr;
@@ -1347,20 +1344,20 @@ wl_iw_iscan_set_scan(struct net_device *dev,
1347 wlc_ssid_t ssid; 1344 wlc_ssid_t ssid;
1348 iscan_info_t *iscan = g_iscan; 1345 iscan_info_t *iscan = g_iscan;
1349 1346
1350 WL_TRACE(("%s: SIOCSIWSCAN : ISCAN\n", dev->name)); 1347 WL_TRACE("%s: SIOCSIWSCAN : ISCAN\n", dev->name);
1351 1348
1352#if defined(CSCAN) 1349#if defined(CSCAN)
1353 WL_ERROR(("%s: Scan from SIOCGIWSCAN not supported\n", __func__)); 1350 WL_ERROR("%s: Scan from SIOCGIWSCAN not supported\n", __func__);
1354 return -EINVAL; 1351 return -EINVAL;
1355#endif 1352#endif
1356 1353
1357 if (g_onoff == G_WLAN_SET_OFF) { 1354 if (g_onoff == G_WLAN_SET_OFF) {
1358 WL_TRACE(("%s: driver is not up yet after START\n", __func__)); 1355 WL_TRACE("%s: driver is not up yet after START\n", __func__);
1359 return 0; 1356 return 0;
1360 } 1357 }
1361#ifdef PNO_SUPPORT 1358#ifdef PNO_SUPPORT
1362 if (dhd_dev_get_pno_status(dev)) { 1359 if (dhd_dev_get_pno_status(dev)) {
1363 WL_ERROR(("%s: Scan called when PNO is active\n", __func__)); 1360 WL_ERROR("%s: Scan called when PNO is active\n", __func__);
1364 } 1361 }
1365#endif 1362#endif
1366 1363
@@ -1368,8 +1365,8 @@ wl_iw_iscan_set_scan(struct net_device *dev,
1368 return wl_iw_set_scan(dev, info, wrqu, extra); 1365 return wl_iw_set_scan(dev, info, wrqu, extra);
1369 1366
1370 if (g_scan_specified_ssid) { 1367 if (g_scan_specified_ssid) {
1371 WL_TRACE(("%s Specific SCAN already running ignoring BC scan\n", 1368 WL_TRACE("%s Specific SCAN already running ignoring BC scan\n",
1372 __func__)); 1369 __func__);
1373 return EBUSY; 1370 return EBUSY;
1374 } 1371 }
1375 1372
@@ -1387,8 +1384,8 @@ wl_iw_iscan_set_scan(struct net_device *dev,
1387 g_scan_specified_ssid = 0; 1384 g_scan_specified_ssid = 0;
1388 1385
1389 if (iscan->iscan_state == ISCAN_STATE_SCANING) { 1386 if (iscan->iscan_state == ISCAN_STATE_SCANING) {
1390 WL_TRACE(("%s ISCAN already in progress \n", 1387 WL_TRACE("%s ISCAN already in progress\n",
1391 __func__)); 1388 __func__);
1392 return 0; 1389 return 0;
1393 } 1390 }
1394 } 1391 }
@@ -1502,9 +1499,8 @@ wl_iw_get_scan_prep(wl_scan_results_t *list,
1502 1499
1503 for (i = 0; i < list->count && i < IW_MAX_AP; i++) { 1500 for (i = 0; i < list->count && i < IW_MAX_AP; i++) {
1504 if (list->version != WL_BSS_INFO_VERSION) { 1501 if (list->version != WL_BSS_INFO_VERSION) {
1505 WL_ERROR(("%s : list->version %d != " 1502 WL_ERROR("%s : list->version %d != WL_BSS_INFO_VERSION\n",
1506 "WL_BSS_INFO_VERSION\n", 1503 __func__, list->version);
1507 __func__, list->version));
1508 return ret; 1504 return ret;
1509 } 1505 }
1510 1506
@@ -1512,7 +1508,7 @@ wl_iw_get_scan_prep(wl_scan_results_t *list,
1512 dtoh32(bi->length)) : list-> 1508 dtoh32(bi->length)) : list->
1513 bss_info; 1509 bss_info;
1514 1510
1515 WL_TRACE(("%s : %s\n", __func__, bi->SSID)); 1511 WL_TRACE("%s : %s\n", __func__, bi->SSID);
1516 1512
1517 iwe.cmd = SIOCGIWAP; 1513 iwe.cmd = SIOCGIWAP;
1518 iwe.u.ap_addr.sa_family = ARPHRD_ETHER; 1514 iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
@@ -1591,11 +1587,11 @@ wl_iw_get_scan_prep(wl_scan_results_t *list,
1591 1587
1592 ret = event - extra; 1588 ret = event - extra;
1593 if (ret < 0) { 1589 if (ret < 0) {
1594 WL_ERROR(("==> Wrong size\n")); 1590 WL_ERROR("==> Wrong size\n");
1595 ret = 0; 1591 ret = 0;
1596 } 1592 }
1597 WL_TRACE(("%s: size=%d bytes prepared\n", __func__, 1593 WL_TRACE("%s: size=%d bytes prepared\n",
1598 (unsigned int)(event - extra))); 1594 __func__, (unsigned int)(event - extra));
1599 return (uint)ret; 1595 return (uint)ret;
1600} 1596}
1601 1597
@@ -1615,10 +1611,10 @@ wl_iw_get_scan(struct net_device *dev,
1615 iscan_buf_t *p_buf; 1611 iscan_buf_t *p_buf;
1616#endif 1612#endif
1617 1613
1618 WL_TRACE(("%s: buflen_from_user %d: \n", dev->name, buflen_from_user)); 1614 WL_TRACE("%s: buflen_from_user %d:\n", dev->name, buflen_from_user);
1619 1615
1620 if (!extra) { 1616 if (!extra) {
1621 WL_TRACE(("%s: wl_iw_get_scan return -EINVAL\n", dev->name)); 1617 WL_TRACE("%s: wl_iw_get_scan return -EINVAL\n", dev->name);
1622 return -EINVAL; 1618 return -EINVAL;
1623 } 1619 }
1624 1620
@@ -1632,8 +1628,8 @@ wl_iw_get_scan(struct net_device *dev,
1632 if (g_scan_specified_ssid) { 1628 if (g_scan_specified_ssid) {
1633 list = kmalloc(len, GFP_KERNEL); 1629 list = kmalloc(len, GFP_KERNEL);
1634 if (!list) { 1630 if (!list) {
1635 WL_TRACE(("%s: wl_iw_get_scan return -ENOMEM\n", 1631 WL_TRACE("%s: wl_iw_get_scan return -ENOMEM\n",
1636 dev->name)); 1632 dev->name);
1637 g_scan_specified_ssid = 0; 1633 g_scan_specified_ssid = 0;
1638 return -ENOMEM; 1634 return -ENOMEM;
1639 } 1635 }
@@ -1643,8 +1639,8 @@ wl_iw_get_scan(struct net_device *dev,
1643 list->buflen = htod32(len); 1639 list->buflen = htod32(len);
1644 error = dev_wlc_ioctl(dev, WLC_SCAN_RESULTS, list, len); 1640 error = dev_wlc_ioctl(dev, WLC_SCAN_RESULTS, list, len);
1645 if (error) { 1641 if (error) {
1646 WL_ERROR(("%s: %s : Scan_results ERROR %d\n", dev->name, 1642 WL_ERROR("%s: %s : Scan_results ERROR %d\n",
1647 __func__, error)); 1643 dev->name, __func__, error);
1648 dwrq->length = len; 1644 dwrq->length = len;
1649 if (g_scan_specified_ssid) { 1645 if (g_scan_specified_ssid) {
1650 g_scan_specified_ssid = 0; 1646 g_scan_specified_ssid = 0;
@@ -1657,8 +1653,8 @@ wl_iw_get_scan(struct net_device *dev,
1657 list->count = dtoh32(list->count); 1653 list->count = dtoh32(list->count);
1658 1654
1659 if (list->version != WL_BSS_INFO_VERSION) { 1655 if (list->version != WL_BSS_INFO_VERSION) {
1660 WL_ERROR(("%s : list->version %d != WL_BSS_INFO_VERSION\n", 1656 WL_ERROR("%s : list->version %d != WL_BSS_INFO_VERSION\n",
1661 __func__, list->version)); 1657 __func__, list->version);
1662 if (g_scan_specified_ssid) { 1658 if (g_scan_specified_ssid) {
1663 g_scan_specified_ssid = 0; 1659 g_scan_specified_ssid = 0;
1664 kfree(list); 1660 kfree(list);
@@ -1667,8 +1663,8 @@ wl_iw_get_scan(struct net_device *dev,
1667 } 1663 }
1668 1664
1669 if (g_scan_specified_ssid) { 1665 if (g_scan_specified_ssid) {
1670 WL_TRACE(("%s: Specified scan APs in the list =%d\n", 1666 WL_TRACE("%s: Specified scan APs in the list =%d\n",
1671 __func__, list->count)); 1667 __func__, list->count);
1672 len_ret = 1668 len_ret =
1673 (__u16) wl_iw_get_scan_prep(list, info, extra, 1669 (__u16) wl_iw_get_scan_prep(list, info, extra,
1674 buflen_from_user); 1670 buflen_from_user);
@@ -1679,8 +1675,8 @@ wl_iw_get_scan(struct net_device *dev,
1679 while (p_buf != iscan->list_cur) { 1675 while (p_buf != iscan->list_cur) {
1680 list_merge = 1676 list_merge =
1681 &((wl_iscan_results_t *) p_buf->iscan_buf)->results; 1677 &((wl_iscan_results_t *) p_buf->iscan_buf)->results;
1682 WL_TRACE(("%s: Bcast APs list=%d\n", __func__, 1678 WL_TRACE("%s: Bcast APs list=%d\n",
1683 list_merge->count)); 1679 __func__, list_merge->count);
1684 if (list_merge->count > 0) 1680 if (list_merge->count > 0)
1685 len_ret += 1681 len_ret +=
1686 (__u16) wl_iw_get_scan_prep(list_merge, 1682 (__u16) wl_iw_get_scan_prep(list_merge,
@@ -1690,8 +1686,8 @@ wl_iw_get_scan(struct net_device *dev,
1690 } 1686 }
1691#else 1687#else
1692 list_merge = (wl_scan_results_t *) g_scan; 1688 list_merge = (wl_scan_results_t *) g_scan;
1693 WL_TRACE(("%s: Bcast APs list=%d\n", __func__, 1689 WL_TRACE("%s: Bcast APs list=%d\n",
1694 list_merge->count)); 1690 __func__, list_merge->count);
1695 if (list_merge->count > 0) 1691 if (list_merge->count > 0)
1696 len_ret += 1692 len_ret +=
1697 (__u16) wl_iw_get_scan_prep(list_merge, info, 1693 (__u16) wl_iw_get_scan_prep(list_merge, info,
@@ -1715,8 +1711,8 @@ wl_iw_get_scan(struct net_device *dev,
1715 dwrq->length = len; 1711 dwrq->length = len;
1716 dwrq->flags = 0; 1712 dwrq->flags = 0;
1717 1713
1718 WL_TRACE(("%s return to WE %d bytes APs=%d\n", __func__, 1714 WL_TRACE("%s return to WE %d bytes APs=%d\n",
1719 dwrq->length, list->count)); 1715 __func__, dwrq->length, list->count);
1720 return 0; 1716 return 0;
1721} 1717}
1722 1718
@@ -1737,26 +1733,26 @@ wl_iw_iscan_get_scan(struct net_device *dev,
1737 u32 counter = 0; 1733 u32 counter = 0;
1738 u8 channel; 1734 u8 channel;
1739 1735
1740 WL_TRACE(("%s %s buflen_from_user %d:\n", dev->name, __func__, 1736 WL_TRACE("%s %s buflen_from_user %d:\n",
1741 dwrq->length)); 1737 dev->name, __func__, dwrq->length);
1742 1738
1743 if (!extra) { 1739 if (!extra) {
1744 WL_TRACE(("%s: INVALID SIOCGIWSCAN GET bad parameter\n", 1740 WL_TRACE("%s: INVALID SIOCGIWSCAN GET bad parameter\n",
1745 dev->name)); 1741 dev->name);
1746 return -EINVAL; 1742 return -EINVAL;
1747 } 1743 }
1748 1744
1749 if ((!iscan) || (!iscan->sysioc_tsk)) { 1745 if ((!iscan) || (!iscan->sysioc_tsk)) {
1750 WL_ERROR(("%ssysioc_tsk\n", __func__)); 1746 WL_ERROR("%ssysioc_tsk\n", __func__);
1751 return wl_iw_get_scan(dev, info, dwrq, extra); 1747 return wl_iw_get_scan(dev, info, dwrq, extra);
1752 } 1748 }
1753 1749
1754 if (iscan->iscan_state == ISCAN_STATE_SCANING) { 1750 if (iscan->iscan_state == ISCAN_STATE_SCANING) {
1755 WL_TRACE(("%s: SIOCGIWSCAN GET still scanning\n", dev->name)); 1751 WL_TRACE("%s: SIOCGIWSCAN GET still scanning\n", dev->name);
1756 return -EAGAIN; 1752 return -EAGAIN;
1757 } 1753 }
1758 1754
1759 WL_TRACE(("%s: SIOCGIWSCAN GET broadcast results\n", dev->name)); 1755 WL_TRACE("%s: SIOCGIWSCAN GET broadcast results\n", dev->name);
1760 apcnt = 0; 1756 apcnt = 0;
1761 p_buf = iscan->list_hdr; 1757 p_buf = iscan->list_hdr;
1762 while (p_buf != iscan->list_cur) { 1758 while (p_buf != iscan->list_cur) {
@@ -1765,9 +1761,8 @@ wl_iw_iscan_get_scan(struct net_device *dev,
1765 counter += list->count; 1761 counter += list->count;
1766 1762
1767 if (list->version != WL_BSS_INFO_VERSION) { 1763 if (list->version != WL_BSS_INFO_VERSION) {
1768 WL_ERROR(("%s : list->version %d != " 1764 WL_ERROR("%s : list->version %d != WL_BSS_INFO_VERSION\n",
1769 "WL_BSS_INFO_VERSION\n", 1765 __func__, list->version);
1770 __func__, list->version));
1771 return -EINVAL; 1766 return -EINVAL;
1772 } 1767 }
1773 1768
@@ -1877,8 +1872,8 @@ wl_iw_iscan_get_scan(struct net_device *dev,
1877 dwrq->length = event - extra; 1872 dwrq->length = event - extra;
1878 dwrq->flags = 0; 1873 dwrq->flags = 0;
1879 1874
1880 WL_TRACE(("%s return to WE %d bytes APs=%d\n", __func__, 1875 WL_TRACE("%s return to WE %d bytes APs=%d\n",
1881 dwrq->length, counter)); 1876 __func__, dwrq->length, counter);
1882 1877
1883 if (!dwrq->length) 1878 if (!dwrq->length)
1884 return -EAGAIN; 1879 return -EAGAIN;
@@ -1896,7 +1891,7 @@ wl_iw_set_essid(struct net_device *dev,
1896 wl_join_params_t join_params; 1891 wl_join_params_t join_params;
1897 int join_params_size; 1892 int join_params_size;
1898 1893
1899 WL_TRACE(("%s: SIOCSIWESSID\n", dev->name)); 1894 WL_TRACE("%s: SIOCSIWESSID\n", dev->name);
1900 1895
1901 if (g_set_essid_before_scan) 1896 if (g_set_essid_before_scan)
1902 return -EAGAIN; 1897 return -EAGAIN;
@@ -1932,11 +1927,11 @@ wl_iw_set_essid(struct net_device *dev,
1932 error = dev_wlc_ioctl(dev, WLC_SET_SSID, &join_params, 1927 error = dev_wlc_ioctl(dev, WLC_SET_SSID, &join_params,
1933 join_params_size); 1928 join_params_size);
1934 if (error) 1929 if (error)
1935 WL_ERROR(("Invalid ioctl data=%d\n", error)); 1930 WL_ERROR("Invalid ioctl data=%d\n", error);
1936 1931
1937 if (g_ssid.SSID_len) { 1932 if (g_ssid.SSID_len) {
1938 WL_TRACE(("%s: join SSID=%s ch=%d\n", __func__, 1933 WL_TRACE("%s: join SSID=%s ch=%d\n",
1939 g_ssid.SSID, g_wl_iw_params.target_channel)); 1934 __func__, g_ssid.SSID, g_wl_iw_params.target_channel);
1940 } 1935 }
1941 return 0; 1936 return 0;
1942} 1937}
@@ -1949,14 +1944,14 @@ wl_iw_get_essid(struct net_device *dev,
1949 wlc_ssid_t ssid; 1944 wlc_ssid_t ssid;
1950 int error; 1945 int error;
1951 1946
1952 WL_TRACE(("%s: SIOCGIWESSID\n", dev->name)); 1947 WL_TRACE("%s: SIOCGIWESSID\n", dev->name);
1953 1948
1954 if (!extra) 1949 if (!extra)
1955 return -EINVAL; 1950 return -EINVAL;
1956 1951
1957 error = dev_wlc_ioctl(dev, WLC_GET_SSID, &ssid, sizeof(ssid)); 1952 error = dev_wlc_ioctl(dev, WLC_GET_SSID, &ssid, sizeof(ssid));
1958 if (error) { 1953 if (error) {
1959 WL_ERROR(("Error getting the SSID\n")); 1954 WL_ERROR("Error getting the SSID\n");
1960 return error; 1955 return error;
1961 } 1956 }
1962 1957
@@ -1977,7 +1972,7 @@ wl_iw_set_nick(struct net_device *dev,
1977{ 1972{
1978 wl_iw_t *iw = *(wl_iw_t **) netdev_priv(dev); 1973 wl_iw_t *iw = *(wl_iw_t **) netdev_priv(dev);
1979 1974
1980 WL_TRACE(("%s: SIOCSIWNICKN\n", dev->name)); 1975 WL_TRACE("%s: SIOCSIWNICKN\n", dev->name);
1981 1976
1982 if (!extra) 1977 if (!extra)
1983 return -EINVAL; 1978 return -EINVAL;
@@ -1997,7 +1992,7 @@ wl_iw_get_nick(struct net_device *dev,
1997{ 1992{
1998 wl_iw_t *iw = *(wl_iw_t **) netdev_priv(dev); 1993 wl_iw_t *iw = *(wl_iw_t **) netdev_priv(dev);
1999 1994
2000 WL_TRACE(("%s: SIOCGIWNICKN\n", dev->name)); 1995 WL_TRACE("%s: SIOCGIWNICKN\n", dev->name);
2001 1996
2002 if (!extra) 1997 if (!extra)
2003 return -EINVAL; 1998 return -EINVAL;
@@ -2015,7 +2010,7 @@ wl_iw_set_rate(struct net_device *dev,
2015 wl_rateset_t rateset; 2010 wl_rateset_t rateset;
2016 int error, rate, i, error_bg, error_a; 2011 int error, rate, i, error_bg, error_a;
2017 2012
2018 WL_TRACE(("%s: SIOCSIWRATE\n", dev->name)); 2013 WL_TRACE("%s: SIOCSIWRATE\n", dev->name);
2019 2014
2020 error = dev_wlc_ioctl(dev, WLC_GET_CURR_RATESET, &rateset, 2015 error = dev_wlc_ioctl(dev, WLC_GET_CURR_RATESET, &rateset,
2021 sizeof(rateset)); 2016 sizeof(rateset));
@@ -2064,7 +2059,7 @@ wl_iw_get_rate(struct net_device *dev,
2064{ 2059{
2065 int error, rate; 2060 int error, rate;
2066 2061
2067 WL_TRACE(("%s: SIOCGIWRATE\n", dev->name)); 2062 WL_TRACE("%s: SIOCGIWRATE\n", dev->name);
2068 2063
2069 error = dev_wlc_ioctl(dev, WLC_GET_RATE, &rate, sizeof(rate)); 2064 error = dev_wlc_ioctl(dev, WLC_GET_RATE, &rate, sizeof(rate));
2070 if (error) 2065 if (error)
@@ -2081,7 +2076,7 @@ wl_iw_set_rts(struct net_device *dev,
2081{ 2076{
2082 int error, rts; 2077 int error, rts;
2083 2078
2084 WL_TRACE(("%s: SIOCSIWRTS\n", dev->name)); 2079 WL_TRACE("%s: SIOCSIWRTS\n", dev->name);
2085 2080
2086 if (vwrq->disabled) 2081 if (vwrq->disabled)
2087 rts = DOT11_DEFAULT_RTS_LEN; 2082 rts = DOT11_DEFAULT_RTS_LEN;
@@ -2103,7 +2098,7 @@ wl_iw_get_rts(struct net_device *dev,
2103{ 2098{
2104 int error, rts; 2099 int error, rts;
2105 2100
2106 WL_TRACE(("%s: SIOCGIWRTS\n", dev->name)); 2101 WL_TRACE("%s: SIOCGIWRTS\n", dev->name);
2107 2102
2108 error = dev_wlc_intvar_get(dev, "rtsthresh", &rts); 2103 error = dev_wlc_intvar_get(dev, "rtsthresh", &rts);
2109 if (error) 2104 if (error)
@@ -2122,7 +2117,7 @@ wl_iw_set_frag(struct net_device *dev,
2122{ 2117{
2123 int error, frag; 2118 int error, frag;
2124 2119
2125 WL_TRACE(("%s: SIOCSIWFRAG\n", dev->name)); 2120 WL_TRACE("%s: SIOCSIWFRAG\n", dev->name);
2126 2121
2127 if (vwrq->disabled) 2122 if (vwrq->disabled)
2128 frag = DOT11_DEFAULT_FRAG_LEN; 2123 frag = DOT11_DEFAULT_FRAG_LEN;
@@ -2144,7 +2139,7 @@ wl_iw_get_frag(struct net_device *dev,
2144{ 2139{
2145 int error, fragthreshold; 2140 int error, fragthreshold;
2146 2141
2147 WL_TRACE(("%s: SIOCGIWFRAG\n", dev->name)); 2142 WL_TRACE("%s: SIOCGIWFRAG\n", dev->name);
2148 2143
2149 error = dev_wlc_intvar_get(dev, "fragthresh", &fragthreshold); 2144 error = dev_wlc_intvar_get(dev, "fragthresh", &fragthreshold);
2150 if (error) 2145 if (error)
@@ -2164,7 +2159,7 @@ wl_iw_set_txpow(struct net_device *dev,
2164{ 2159{
2165 int error, disable; 2160 int error, disable;
2166 u16 txpwrmw; 2161 u16 txpwrmw;
2167 WL_TRACE(("%s: SIOCSIWTXPOW\n", dev->name)); 2162 WL_TRACE("%s: SIOCSIWTXPOW\n", dev->name);
2168 2163
2169 disable = vwrq->disabled ? WL_RADIO_SW_DISABLE : 0; 2164 disable = vwrq->disabled ? WL_RADIO_SW_DISABLE : 0;
2170 disable += WL_RADIO_SW_DISABLE << 16; 2165 disable += WL_RADIO_SW_DISABLE << 16;
@@ -2201,7 +2196,7 @@ wl_iw_get_txpow(struct net_device *dev,
2201 int error, disable, txpwrdbm; 2196 int error, disable, txpwrdbm;
2202 u8 result; 2197 u8 result;
2203 2198
2204 WL_TRACE(("%s: SIOCGIWTXPOW\n", dev->name)); 2199 WL_TRACE("%s: SIOCGIWTXPOW\n", dev->name);
2205 2200
2206 error = dev_wlc_ioctl(dev, WLC_GET_RADIO, &disable, sizeof(disable)); 2201 error = dev_wlc_ioctl(dev, WLC_GET_RADIO, &disable, sizeof(disable));
2207 if (error) 2202 if (error)
@@ -2230,7 +2225,7 @@ wl_iw_set_retry(struct net_device *dev,
2230{ 2225{
2231 int error, lrl, srl; 2226 int error, lrl, srl;
2232 2227
2233 WL_TRACE(("%s: SIOCSIWRETRY\n", dev->name)); 2228 WL_TRACE("%s: SIOCSIWRETRY\n", dev->name);
2234 2229
2235 if (vwrq->disabled || (vwrq->flags & IW_RETRY_LIFETIME)) 2230 if (vwrq->disabled || (vwrq->flags & IW_RETRY_LIFETIME))
2236 return -EINVAL; 2231 return -EINVAL;
@@ -2278,7 +2273,7 @@ wl_iw_get_retry(struct net_device *dev,
2278{ 2273{
2279 int error, lrl, srl; 2274 int error, lrl, srl;
2280 2275
2281 WL_TRACE(("%s: SIOCGIWRETRY\n", dev->name)); 2276 WL_TRACE("%s: SIOCGIWRETRY\n", dev->name);
2282 2277
2283 vwrq->disabled = 0; 2278 vwrq->disabled = 0;
2284 2279
@@ -2318,7 +2313,7 @@ wl_iw_set_encode(struct net_device *dev,
2318 wl_wsec_key_t key; 2313 wl_wsec_key_t key;
2319 int error, val, wsec; 2314 int error, val, wsec;
2320 2315
2321 WL_TRACE(("%s: SIOCSIWENCODE\n", dev->name)); 2316 WL_TRACE("%s: SIOCSIWENCODE\n", dev->name);
2322 2317
2323 memset(&key, 0, sizeof(key)); 2318 memset(&key, 0, sizeof(key));
2324 2319
@@ -2410,7 +2405,7 @@ wl_iw_get_encode(struct net_device *dev,
2410 wl_wsec_key_t key; 2405 wl_wsec_key_t key;
2411 int error, val, wsec, auth; 2406 int error, val, wsec, auth;
2412 2407
2413 WL_TRACE(("%s: SIOCGIWENCODE\n", dev->name)); 2408 WL_TRACE("%s: SIOCGIWENCODE\n", dev->name);
2414 2409
2415 memset(&key, 0, sizeof(wl_wsec_key_t)); 2410 memset(&key, 0, sizeof(wl_wsec_key_t));
2416 2411
@@ -2466,7 +2461,7 @@ wl_iw_set_power(struct net_device *dev,
2466{ 2461{
2467 int error, pm; 2462 int error, pm;
2468 2463
2469 WL_TRACE(("%s: SIOCSIWPOWER\n", dev->name)); 2464 WL_TRACE("%s: SIOCSIWPOWER\n", dev->name);
2470 2465
2471 pm = vwrq->disabled ? PM_OFF : PM_MAX; 2466 pm = vwrq->disabled ? PM_OFF : PM_MAX;
2472 2467
@@ -2485,7 +2480,7 @@ wl_iw_get_power(struct net_device *dev,
2485{ 2480{
2486 int error, pm; 2481 int error, pm;
2487 2482
2488 WL_TRACE(("%s: SIOCGIWPOWER\n", dev->name)); 2483 WL_TRACE("%s: SIOCGIWPOWER\n", dev->name);
2489 2484
2490 error = dev_wlc_ioctl(dev, WLC_GET_PM, &pm, sizeof(pm)); 2485 error = dev_wlc_ioctl(dev, WLC_GET_PM, &pm, sizeof(pm));
2491 if (error) 2486 if (error)
@@ -2504,7 +2499,7 @@ wl_iw_set_wpaie(struct net_device *dev,
2504 struct iw_request_info *info, struct iw_point *iwp, char *extra) 2499 struct iw_request_info *info, struct iw_point *iwp, char *extra)
2505{ 2500{
2506 2501
2507 WL_TRACE(("%s: SIOCSIWGENIE\n", dev->name)); 2502 WL_TRACE("%s: SIOCSIWGENIE\n", dev->name);
2508 2503
2509 CHECK_EXTRA_FOR_NULL(extra); 2504 CHECK_EXTRA_FOR_NULL(extra);
2510 2505
@@ -2517,7 +2512,7 @@ static int
2517wl_iw_get_wpaie(struct net_device *dev, 2512wl_iw_get_wpaie(struct net_device *dev,
2518 struct iw_request_info *info, struct iw_point *iwp, char *extra) 2513 struct iw_request_info *info, struct iw_point *iwp, char *extra)
2519{ 2514{
2520 WL_TRACE(("%s: SIOCGIWGENIE\n", dev->name)); 2515 WL_TRACE("%s: SIOCGIWGENIE\n", dev->name);
2521 iwp->length = 64; 2516 iwp->length = 64;
2522 dev_wlc_bufvar_get(dev, "wpaie", extra, iwp->length); 2517 dev_wlc_bufvar_get(dev, "wpaie", extra, iwp->length);
2523 return 0; 2518 return 0;
@@ -2532,7 +2527,7 @@ wl_iw_set_encodeext(struct net_device *dev,
2532 int error; 2527 int error;
2533 struct iw_encode_ext *iwe; 2528 struct iw_encode_ext *iwe;
2534 2529
2535 WL_TRACE(("%s: SIOCSIWENCODEEXT\n", dev->name)); 2530 WL_TRACE("%s: SIOCSIWENCODEEXT\n", dev->name);
2536 2531
2537 CHECK_EXTRA_FOR_NULL(extra); 2532 CHECK_EXTRA_FOR_NULL(extra);
2538 2533
@@ -2555,8 +2550,8 @@ wl_iw_set_encodeext(struct net_device *dev,
2555 2550
2556 if (key.len == 0) { 2551 if (key.len == 0) {
2557 if (iwe->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { 2552 if (iwe->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
2558 WL_WSEC(("Changing the the primary Key to %d\n", 2553 WL_WSEC("Changing the the primary Key to %d\n",
2559 key.index)); 2554 key.index);
2560 key.index = htod32(key.index); 2555 key.index = htod32(key.index);
2561 error = dev_wlc_ioctl(dev, WLC_SET_KEY_PRIMARY, 2556 error = dev_wlc_ioctl(dev, WLC_SET_KEY_PRIMARY,
2562 &key.index, sizeof(key.index)); 2557 &key.index, sizeof(key.index));
@@ -2570,9 +2565,9 @@ wl_iw_set_encodeext(struct net_device *dev,
2570 if (iwe->key_len > sizeof(key.data)) 2565 if (iwe->key_len > sizeof(key.data))
2571 return -EINVAL; 2566 return -EINVAL;
2572 2567
2573 WL_WSEC(("Setting the key index %d\n", key.index)); 2568 WL_WSEC("Setting the key index %d\n", key.index);
2574 if (iwe->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { 2569 if (iwe->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
2575 WL_WSEC(("key is a Primary Key\n")); 2570 WL_WSEC("key is a Primary Key\n");
2576 key.flags = WL_PRIMARY_KEY; 2571 key.flags = WL_PRIMARY_KEY;
2577 } 2572 }
2578 2573
@@ -2639,14 +2634,14 @@ wl_iw_set_pmksa(struct net_device *dev,
2639 uint i; 2634 uint i;
2640 int ret = 0; 2635 int ret = 0;
2641 2636
2642 WL_WSEC(("%s: SIOCSIWPMKSA\n", dev->name)); 2637 WL_WSEC("%s: SIOCSIWPMKSA\n", dev->name);
2643 2638
2644 CHECK_EXTRA_FOR_NULL(extra); 2639 CHECK_EXTRA_FOR_NULL(extra);
2645 2640
2646 iwpmksa = (struct iw_pmksa *)extra; 2641 iwpmksa = (struct iw_pmksa *)extra;
2647 2642
2648 if (iwpmksa->cmd == IW_PMKSA_FLUSH) { 2643 if (iwpmksa->cmd == IW_PMKSA_FLUSH) {
2649 WL_WSEC(("wl_iw_set_pmksa - IW_PMKSA_FLUSH\n")); 2644 WL_WSEC("wl_iw_set_pmksa - IW_PMKSA_FLUSH\n");
2650 memset((char *)&pmkid_list, 0, sizeof(pmkid_list)); 2645 memset((char *)&pmkid_list, 0, sizeof(pmkid_list));
2651 } 2646 }
2652 2647
@@ -2661,11 +2656,11 @@ wl_iw_set_pmksa(struct net_device *dev,
2661 bcopy(&iwpmksa->pmkid[0], &pmkidptr->pmkid[0].PMKID, 2656 bcopy(&iwpmksa->pmkid[0], &pmkidptr->pmkid[0].PMKID,
2662 WPA2_PMKID_LEN); 2657 WPA2_PMKID_LEN);
2663 2658
2664 WL_WSEC(("wl_iw_set_pmksa:IW_PMKSA_REMOVE:PMKID: " 2659 WL_WSEC("wl_iw_set_pmksa:IW_PMKSA_REMOVE:PMKID: %pM = ",
2665 "%pM = ", &pmkidptr->pmkid[0].BSSID)); 2660 &pmkidptr->pmkid[0].BSSID);
2666 for (j = 0; j < WPA2_PMKID_LEN; j++) 2661 for (j = 0; j < WPA2_PMKID_LEN; j++)
2667 WL_WSEC(("%02x ", pmkidptr->pmkid[0].PMKID[j])); 2662 WL_WSEC("%02x ", pmkidptr->pmkid[0].PMKID[j]);
2668 WL_WSEC(("\n")); 2663 WL_WSEC("\n");
2669 } 2664 }
2670 2665
2671 for (i = 0; i < pmkid_list.pmkids.npmkid; i++) 2666 for (i = 0; i < pmkid_list.pmkids.npmkid; i++)
@@ -2711,25 +2706,25 @@ wl_iw_set_pmksa(struct net_device *dev,
2711 uint j; 2706 uint j;
2712 uint k; 2707 uint k;
2713 k = pmkid_list.pmkids.npmkid; 2708 k = pmkid_list.pmkids.npmkid;
2714 WL_WSEC(("wl_iw_set_pmksa,IW_PMKSA_ADD - PMKID: %pM = ", 2709 WL_WSEC("wl_iw_set_pmksa,IW_PMKSA_ADD - PMKID: %pM = ",
2715 &pmkid_list.pmkids.pmkid[k].BSSID)); 2710 &pmkid_list.pmkids.pmkid[k].BSSID);
2716 for (j = 0; j < WPA2_PMKID_LEN; j++) 2711 for (j = 0; j < WPA2_PMKID_LEN; j++)
2717 WL_WSEC(("%02x ", 2712 WL_WSEC("%02x ",
2718 pmkid_list.pmkids.pmkid[k].PMKID[j])); 2713 pmkid_list.pmkids.pmkid[k].PMKID[j]);
2719 WL_WSEC(("\n")); 2714 WL_WSEC("\n");
2720 } 2715 }
2721 } 2716 }
2722 WL_WSEC(("PRINTING pmkid LIST - No of elements %d\n", 2717 WL_WSEC("PRINTING pmkid LIST - No of elements %d\n",
2723 pmkid_list.pmkids.npmkid)); 2718 pmkid_list.pmkids.npmkid);
2724 for (i = 0; i < pmkid_list.pmkids.npmkid; i++) { 2719 for (i = 0; i < pmkid_list.pmkids.npmkid; i++) {
2725 uint j; 2720 uint j;
2726 WL_WSEC(("PMKID[%d]: %pM = ", i, 2721 WL_WSEC("PMKID[%d]: %pM = ",
2727 &pmkid_list.pmkids.pmkid[i].BSSID)); 2722 i, &pmkid_list.pmkids.pmkid[i].BSSID);
2728 for (j = 0; j < WPA2_PMKID_LEN; j++) 2723 for (j = 0; j < WPA2_PMKID_LEN; j++)
2729 WL_WSEC(("%02x ", pmkid_list.pmkids.pmkid[i].PMKID[j])); 2724 WL_WSEC("%02x ", pmkid_list.pmkids.pmkid[i].PMKID[j]);
2730 WL_WSEC(("\n")); 2725 WL_WSEC("\n");
2731 } 2726 }
2732 WL_WSEC(("\n")); 2727 WL_WSEC("\n");
2733 2728
2734 if (!ret) 2729 if (!ret)
2735 ret = dev_wlc_bufvar_set(dev, "pmkid_info", (char *)&pmkid_list, 2730 ret = dev_wlc_bufvar_set(dev, "pmkid_info", (char *)&pmkid_list,
@@ -2743,7 +2738,7 @@ wl_iw_get_encodeext(struct net_device *dev,
2743 struct iw_request_info *info, 2738 struct iw_request_info *info,
2744 struct iw_param *vwrq, char *extra) 2739 struct iw_param *vwrq, char *extra)
2745{ 2740{
2746 WL_TRACE(("%s: SIOCGIWENCODEEXT\n", dev->name)); 2741 WL_TRACE("%s: SIOCGIWENCODEEXT\n", dev->name);
2747 return 0; 2742 return 0;
2748} 2743}
2749 2744
@@ -2758,13 +2753,13 @@ wl_iw_set_wpaauth(struct net_device *dev,
2758 int val = 0; 2753 int val = 0;
2759 wl_iw_t *iw = *(wl_iw_t **) netdev_priv(dev); 2754 wl_iw_t *iw = *(wl_iw_t **) netdev_priv(dev);
2760 2755
2761 WL_TRACE(("%s: SIOCSIWAUTH\n", dev->name)); 2756 WL_TRACE("%s: SIOCSIWAUTH\n", dev->name);
2762 2757
2763 paramid = vwrq->flags & IW_AUTH_INDEX; 2758 paramid = vwrq->flags & IW_AUTH_INDEX;
2764 paramval = vwrq->value; 2759 paramval = vwrq->value;
2765 2760
2766 WL_TRACE(("%s: SIOCSIWAUTH, paramid = 0x%0x, paramval = 0x%0x\n", 2761 WL_TRACE("%s: SIOCSIWAUTH, paramid = 0x%0x, paramval = 0x%0x\n",
2767 dev->name, paramid, paramval)); 2762 dev->name, paramid, paramval);
2768 2763
2769 switch (paramid) { 2764 switch (paramid) {
2770 case IW_AUTH_WPA_VERSION: 2765 case IW_AUTH_WPA_VERSION:
@@ -2774,8 +2769,8 @@ wl_iw_set_wpaauth(struct net_device *dev,
2774 val = WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED; 2769 val = WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED;
2775 else if (paramval & IW_AUTH_WPA_VERSION_WPA2) 2770 else if (paramval & IW_AUTH_WPA_VERSION_WPA2)
2776 val = WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED; 2771 val = WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED;
2777 WL_INFORM(("%s: %d: setting wpa_auth to 0x%0x\n", __func__, 2772 WL_INFORM("%s: %d: setting wpa_auth to 0x%0x\n",
2778 __LINE__, val)); 2773 __func__, __LINE__, val);
2779 error = dev_wlc_intvar_set(dev, "wpa_auth", val); 2774 error = dev_wlc_intvar_set(dev, "wpa_auth", val);
2780 if (error) 2775 if (error)
2781 return error; 2776 return error;
@@ -2798,20 +2793,19 @@ wl_iw_set_wpaauth(struct net_device *dev,
2798 } 2793 }
2799 2794
2800 if (iw->privacy_invoked && !val) { 2795 if (iw->privacy_invoked && !val) {
2801 WL_WSEC(("%s: %s: 'Privacy invoked' true but clearing " 2796 WL_WSEC("%s: %s: 'Privacy invoked' true but clearing wsec, assuming we're a WPS enrollee\n",
2802 "wsec, assuming " "we're a WPS enrollee\n", 2797 dev->name, __func__);
2803 dev->name, __func__));
2804 error = dev_wlc_intvar_set(dev, "is_WPS_enrollee", 2798 error = dev_wlc_intvar_set(dev, "is_WPS_enrollee",
2805 true); 2799 true);
2806 if (error) { 2800 if (error) {
2807 WL_WSEC(("Failed to set is_WPS_enrollee\n")); 2801 WL_WSEC("Failed to set is_WPS_enrollee\n");
2808 return error; 2802 return error;
2809 } 2803 }
2810 } else if (val) { 2804 } else if (val) {
2811 error = dev_wlc_intvar_set(dev, "is_WPS_enrollee", 2805 error = dev_wlc_intvar_set(dev, "is_WPS_enrollee",
2812 false); 2806 false);
2813 if (error) { 2807 if (error) {
2814 WL_WSEC(("Failed to clear is_WPS_enrollee\n")); 2808 WL_WSEC("Failed to clear is_WPS_enrollee\n");
2815 return error; 2809 return error;
2816 } 2810 }
2817 } 2811 }
@@ -2838,8 +2832,8 @@ wl_iw_set_wpaauth(struct net_device *dev,
2838 else 2832 else
2839 val = WPA2_AUTH_UNSPECIFIED; 2833 val = WPA2_AUTH_UNSPECIFIED;
2840 } 2834 }
2841 WL_INFORM(("%s: %d: setting wpa_auth to %d\n", __func__, 2835 WL_INFORM("%s: %d: setting wpa_auth to %d\n",
2842 __LINE__, val)); 2836 __func__, __LINE__, val);
2843 error = dev_wlc_intvar_set(dev, "wpa_auth", val); 2837 error = dev_wlc_intvar_set(dev, "wpa_auth", val);
2844 if (error) 2838 if (error)
2845 return error; 2839 return error;
@@ -2851,7 +2845,7 @@ wl_iw_set_wpaauth(struct net_device *dev,
2851 break; 2845 break;
2852 2846
2853 case IW_AUTH_80211_AUTH_ALG: 2847 case IW_AUTH_80211_AUTH_ALG:
2854 WL_INFORM(("Setting the D11auth %d\n", paramval)); 2848 WL_INFORM("Setting the D11auth %d\n", paramval);
2855 if (paramval == IW_AUTH_ALG_OPEN_SYSTEM) 2849 if (paramval == IW_AUTH_ALG_OPEN_SYSTEM)
2856 val = 0; 2850 val = 0;
2857 else if (paramval == IW_AUTH_ALG_SHARED_KEY) 2851 else if (paramval == IW_AUTH_ALG_SHARED_KEY)
@@ -2880,8 +2874,8 @@ wl_iw_set_wpaauth(struct net_device *dev,
2880 dev_wlc_intvar_set(dev, "wsec", val); 2874 dev_wlc_intvar_set(dev, "wsec", val);
2881 } 2875 }
2882 val = 0; 2876 val = 0;
2883 WL_INFORM(("%s: %d: setting wpa_auth to %d\n", 2877 WL_INFORM("%s: %d: setting wpa_auth to %d\n",
2884 __func__, __LINE__, val)); 2878 __func__, __LINE__, val);
2885 dev_wlc_intvar_set(dev, "wpa_auth", 0); 2879 dev_wlc_intvar_set(dev, "wpa_auth", 0);
2886 return error; 2880 return error;
2887 } 2881 }
@@ -2898,7 +2892,7 @@ wl_iw_set_wpaauth(struct net_device *dev,
2898 2892
2899#if WIRELESS_EXT > 17 2893#if WIRELESS_EXT > 17
2900 case IW_AUTH_ROAMING_CONTROL: 2894 case IW_AUTH_ROAMING_CONTROL:
2901 WL_INFORM(("%s: IW_AUTH_ROAMING_CONTROL\n", __func__)); 2895 WL_INFORM("%s: IW_AUTH_ROAMING_CONTROL\n", __func__);
2902 break; 2896 break;
2903 case IW_AUTH_PRIVACY_INVOKED: 2897 case IW_AUTH_PRIVACY_INVOKED:
2904 { 2898 {
@@ -2909,8 +2903,7 @@ wl_iw_set_wpaauth(struct net_device *dev,
2909 error = dev_wlc_intvar_set(dev, 2903 error = dev_wlc_intvar_set(dev,
2910 "is_WPS_enrollee", false); 2904 "is_WPS_enrollee", false);
2911 if (error) { 2905 if (error) {
2912 WL_WSEC(("Failed to clear iovar " 2906 WL_WSEC("Failed to clear iovar is_WPS_enrollee\n");
2913 "is_WPS_enrollee\n"));
2914 return error; 2907 return error;
2915 } 2908 }
2916 } else { 2909 } else {
@@ -2924,8 +2917,7 @@ wl_iw_set_wpaauth(struct net_device *dev,
2924 "is_WPS_enrollee", 2917 "is_WPS_enrollee",
2925 true); 2918 true);
2926 if (error) { 2919 if (error) {
2927 WL_WSEC(("Failed to set iovar " 2920 WL_WSEC("Failed to set iovar is_WPS_enrollee\n");
2928 "is_WPS_enrollee\n"));
2929 return error; 2921 return error;
2930 } 2922 }
2931 } else { 2923 } else {
@@ -2933,8 +2925,7 @@ wl_iw_set_wpaauth(struct net_device *dev,
2933 "is_WPS_enrollee", 2925 "is_WPS_enrollee",
2934 false); 2926 false);
2935 if (error) { 2927 if (error) {
2936 WL_WSEC(("Failed to clear " 2928 WL_WSEC("Failed to clear is_WPS_enrollee\n");
2937 "is_WPS_enrollee\n"));
2938 return error; 2929 return error;
2939 } 2930 }
2940 } 2931 }
@@ -2961,7 +2952,7 @@ wl_iw_get_wpaauth(struct net_device *dev,
2961 int val; 2952 int val;
2962 wl_iw_t *iw = *(wl_iw_t **) netdev_priv(dev); 2953 wl_iw_t *iw = *(wl_iw_t **) netdev_priv(dev);
2963 2954
2964 WL_TRACE(("%s: SIOCGIWAUTH\n", dev->name)); 2955 WL_TRACE("%s: SIOCGIWAUTH\n", dev->name);
2965 2956
2966 paramid = vwrq->flags & IW_AUTH_INDEX; 2957 paramid = vwrq->flags & IW_AUTH_INDEX;
2967 2958
@@ -3041,7 +3032,7 @@ wl_iw_get_wpaauth(struct net_device *dev,
3041 break; 3032 break;
3042#if WIRELESS_EXT > 17 3033#if WIRELESS_EXT > 17
3043 case IW_AUTH_ROAMING_CONTROL: 3034 case IW_AUTH_ROAMING_CONTROL:
3044 WL_ERROR(("%s: IW_AUTH_ROAMING_CONTROL\n", __func__)); 3035 WL_ERROR("%s: IW_AUTH_ROAMING_CONTROL\n", __func__);
3045 break; 3036 break;
3046 case IW_AUTH_PRIVACY_INVOKED: 3037 case IW_AUTH_PRIVACY_INVOKED:
3047 paramval = iw->privacy_invoked; 3038 paramval = iw->privacy_invoked;
@@ -3158,19 +3149,19 @@ int wl_iw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
3158 char *extra = NULL; 3149 char *extra = NULL;
3159 int token_size = 1, max_tokens = 0, ret = 0; 3150 int token_size = 1, max_tokens = 0, ret = 0;
3160 3151
3161 WL_TRACE(("\n%s, cmd:%x alled via dhd->do_ioctl()entry point\n", 3152 WL_TRACE("\n%s, cmd:%x alled via dhd->do_ioctl()entry point\n",
3162 __func__, cmd)); 3153 __func__, cmd);
3163 if (cmd < SIOCIWFIRST || 3154 if (cmd < SIOCIWFIRST ||
3164 IW_IOCTL_IDX(cmd) >= ARRAY_SIZE(wl_iw_handler)) { 3155 IW_IOCTL_IDX(cmd) >= ARRAY_SIZE(wl_iw_handler)) {
3165 WL_ERROR(("%s: error in cmd=%x : out of range\n", __func__, 3156 WL_ERROR("%s: error in cmd=%x : out of range\n",
3166 cmd)); 3157 __func__, cmd);
3167 return -EOPNOTSUPP; 3158 return -EOPNOTSUPP;
3168 } 3159 }
3169 3160
3170 handler = wl_iw_handler[IW_IOCTL_IDX(cmd)]; 3161 handler = wl_iw_handler[IW_IOCTL_IDX(cmd)];
3171 if (!handler) { 3162 if (!handler) {
3172 WL_ERROR(("%s: error in cmd=%x : not supported\n", 3163 WL_ERROR("%s: error in cmd=%x : not supported\n",
3173 __func__, cmd)); 3164 __func__, cmd);
3174 return -EOPNOTSUPP; 3165 return -EOPNOTSUPP;
3175 } 3166 }
3176 3167
@@ -3235,9 +3226,8 @@ int wl_iw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
3235 3226
3236 if (max_tokens && wrq->u.data.pointer) { 3227 if (max_tokens && wrq->u.data.pointer) {
3237 if (wrq->u.data.length > max_tokens) { 3228 if (wrq->u.data.length > max_tokens) {
3238 WL_ERROR(("%s: error in cmd=%x wrq->u.data.length=%d " 3229 WL_ERROR("%s: error in cmd=%x wrq->u.data.length=%d > max_tokens=%d\n",
3239 "> max_tokens=%d\n", 3230 __func__, cmd, wrq->u.data.length, max_tokens);
3240 __func__, cmd, wrq->u.data.length, max_tokens));
3241 return -E2BIG; 3231 return -E2BIG;
3242 } 3232 }
3243 extra = kmalloc(max_tokens * token_size, GFP_KERNEL); 3233 extra = kmalloc(max_tokens * token_size, GFP_KERNEL);
@@ -3340,7 +3330,7 @@ wl_iw_conn_status_str(u32 event_type, u32 status, u32 reason,
3340 memset(stringBuf, 0, buflen); 3330 memset(stringBuf, 0, buflen);
3341 snprintf(stringBuf, buflen, "%s %s %02d %02d", 3331 snprintf(stringBuf, buflen, "%s %s %02d %02d",
3342 name, cause, status, reason); 3332 name, cause, status, reason);
3343 WL_INFORM(("Connection status: %s\n", stringBuf)); 3333 WL_INFORM("Connection status: %s\n", stringBuf);
3344 return true; 3334 return true;
3345 } else { 3335 } else {
3346 return false; 3336 return false;
@@ -3384,13 +3374,13 @@ void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data)
3384 iw = 0; 3374 iw = 0;
3385 3375
3386 if (!dev) { 3376 if (!dev) {
3387 WL_ERROR(("%s: dev is null\n", __func__)); 3377 WL_ERROR("%s: dev is null\n", __func__);
3388 return; 3378 return;
3389 } 3379 }
3390 3380
3391 iw = *(wl_iw_t **) netdev_priv(dev); 3381 iw = *(wl_iw_t **) netdev_priv(dev);
3392 3382
3393 WL_TRACE(("%s: dev=%s event=%d\n", __func__, dev->name, event_type)); 3383 WL_TRACE("%s: dev=%s event=%d\n", __func__, dev->name, event_type);
3394 3384
3395 switch (event_type) { 3385 switch (event_type) {
3396 case WLC_E_TXFAIL: 3386 case WLC_E_TXFAIL:
@@ -3423,7 +3413,7 @@ void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data)
3423 20 * HZ); 3413 20 * HZ);
3424 } else { 3414 } else {
3425 memcpy(wrqu.addr.sa_data, &e->addr, ETH_ALEN); 3415 memcpy(wrqu.addr.sa_data, &e->addr, ETH_ALEN);
3426 WL_TRACE(("Link UP\n")); 3416 WL_TRACE("Link UP\n");
3427 3417
3428 } 3418 }
3429 wrqu.addr.sa_family = ARPHRD_ETHER; 3419 wrqu.addr.sa_family = ARPHRD_ETHER;
@@ -3434,8 +3424,8 @@ void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data)
3434 wrqu.data.length = datalen + 1; 3424 wrqu.data.length = datalen + 1;
3435 extra[0] = WLC_E_ACTION_FRAME; 3425 extra[0] = WLC_E_ACTION_FRAME;
3436 memcpy(&extra[1], data, datalen); 3426 memcpy(&extra[1], data, datalen);
3437 WL_TRACE(("WLC_E_ACTION_FRAME len %d \n", 3427 WL_TRACE("WLC_E_ACTION_FRAME len %d\n",
3438 wrqu.data.length)); 3428 wrqu.data.length);
3439 } 3429 }
3440 break; 3430 break;
3441 3431
@@ -3516,13 +3506,13 @@ void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data)
3516 } else { 3506 } else {
3517 cmd = SIOCGIWSCAN; 3507 cmd = SIOCGIWSCAN;
3518 wrqu.data.length = strlen(extra); 3508 wrqu.data.length = strlen(extra);
3519 WL_TRACE(("Event WLC_E_SCAN_COMPLETE from specific " 3509 WL_TRACE("Event WLC_E_SCAN_COMPLETE from specific scan %d\n",
3520 "scan %d\n", g_iscan->iscan_state)); 3510 g_iscan->iscan_state);
3521 } 3511 }
3522#else 3512#else
3523 cmd = SIOCGIWSCAN; 3513 cmd = SIOCGIWSCAN;
3524 wrqu.data.length = strlen(extra); 3514 wrqu.data.length = strlen(extra);
3525 WL_TRACE(("Event WLC_E_SCAN_COMPLETE\n")); 3515 WL_TRACE("Event WLC_E_SCAN_COMPLETE\n");
3526#endif 3516#endif
3527 break; 3517 break;
3528 3518
@@ -3530,9 +3520,9 @@ void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data)
3530 { 3520 {
3531 wlc_ssid_t *ssid; 3521 wlc_ssid_t *ssid;
3532 ssid = (wlc_ssid_t *) data; 3522 ssid = (wlc_ssid_t *) data;
3533 WL_ERROR(("%s Event WLC_E_PFN_NET_FOUND, send %s up : " 3523 WL_ERROR("%s Event WLC_E_PFN_NET_FOUND, send %s up : find %s len=%d\n",
3534 "find %s len=%d\n", __func__, PNO_EVENT_UP, 3524 __func__, PNO_EVENT_UP,
3535 ssid->SSID, ssid->SSID_len)); 3525 ssid->SSID, ssid->SSID_len);
3536 WAKE_LOCK_TIMEOUT(iw->pub, WAKE_LOCK_PNO_FIND_TMOUT, 3526 WAKE_LOCK_TIMEOUT(iw->pub, WAKE_LOCK_PNO_FIND_TMOUT,
3537 20 * HZ); 3527 20 * HZ);
3538 cmd = IWEVCUSTOM; 3528 cmd = IWEVCUSTOM;
@@ -3543,7 +3533,7 @@ void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data)
3543 break; 3533 break;
3544 3534
3545 default: 3535 default:
3546 WL_TRACE(("Unknown Event %d: ignoring\n", event_type)); 3536 WL_TRACE("Unknown Event %d: ignoring\n", event_type);
3547 break; 3537 break;
3548 } 3538 }
3549#ifndef SANDGATE2G 3539#ifndef SANDGATE2G
@@ -3584,7 +3574,7 @@ wl_iw_get_wireless_stats(struct net_device *dev, struct iw_statistics *wstats)
3584 goto done; 3574 goto done;
3585 3575
3586 phy_noise = dtoh32(phy_noise); 3576 phy_noise = dtoh32(phy_noise);
3587 WL_TRACE(("wl_iw_get_wireless_stats phy noise=%d\n", phy_noise)); 3577 WL_TRACE("wl_iw_get_wireless_stats phy noise=%d\n", phy_noise);
3588 3578
3589 memset(&scb_val, 0, sizeof(scb_val_t)); 3579 memset(&scb_val, 0, sizeof(scb_val_t));
3590 res = dev_wlc_ioctl(dev, WLC_GET_RSSI, &scb_val, sizeof(scb_val_t)); 3580 res = dev_wlc_ioctl(dev, WLC_GET_RSSI, &scb_val, sizeof(scb_val_t));
@@ -3592,7 +3582,7 @@ wl_iw_get_wireless_stats(struct net_device *dev, struct iw_statistics *wstats)
3592 goto done; 3582 goto done;
3593 3583
3594 rssi = dtoh32(scb_val.val); 3584 rssi = dtoh32(scb_val.val);
3595 WL_TRACE(("wl_iw_get_wireless_stats rssi=%d\n", rssi)); 3585 WL_TRACE("wl_iw_get_wireless_stats rssi=%d\n", rssi);
3596 if (rssi <= WL_IW_RSSI_NO_SIGNAL) 3586 if (rssi <= WL_IW_RSSI_NO_SIGNAL)
3597 wstats->qual.qual = 0; 3587 wstats->qual.qual = 0;
3598 else if (rssi <= WL_IW_RSSI_VERY_LOW) 3588 else if (rssi <= WL_IW_RSSI_VERY_LOW)
@@ -3615,23 +3605,21 @@ wl_iw_get_wireless_stats(struct net_device *dev, struct iw_statistics *wstats)
3615#endif 3605#endif
3616 3606
3617#if WIRELESS_EXT > 11 3607#if WIRELESS_EXT > 11
3618 WL_TRACE(("wl_iw_get_wireless_stats counters=%d\n", 3608 WL_TRACE("wl_iw_get_wireless_stats counters=%zu\n", sizeof(wl_cnt_t));
3619 (int)sizeof(wl_cnt_t)));
3620 3609
3621 memset(&cnt, 0, sizeof(wl_cnt_t)); 3610 memset(&cnt, 0, sizeof(wl_cnt_t));
3622 res = 3611 res =
3623 dev_wlc_bufvar_get(dev, "counters", (char *)&cnt, sizeof(wl_cnt_t)); 3612 dev_wlc_bufvar_get(dev, "counters", (char *)&cnt, sizeof(wl_cnt_t));
3624 if (res) { 3613 if (res) {
3625 WL_ERROR(("wl_iw_get_wireless_stats counters failed error=%d\n", 3614 WL_ERROR("wl_iw_get_wireless_stats counters failed error=%d\n",
3626 res)); 3615 res);
3627 goto done; 3616 goto done;
3628 } 3617 }
3629 3618
3630 cnt.version = dtoh16(cnt.version); 3619 cnt.version = dtoh16(cnt.version);
3631 if (cnt.version != WL_CNT_T_VERSION) { 3620 if (cnt.version != WL_CNT_T_VERSION) {
3632 WL_TRACE(("\tIncorrect version of counters struct: expected " 3621 WL_TRACE("\tIncorrect version of counters struct: expected %d; got %d\n",
3633 "%d; got %d\n", 3622 WL_CNT_T_VERSION, cnt.version);
3634 WL_CNT_T_VERSION, cnt.version));
3635 goto done; 3623 goto done;
3636 } 3624 }
3637 3625
@@ -3642,22 +3630,22 @@ wl_iw_get_wireless_stats(struct net_device *dev, struct iw_statistics *wstats)
3642 wstats->discard.misc = dtoh32(cnt.rxrunt) + dtoh32(cnt.rxgiant); 3630 wstats->discard.misc = dtoh32(cnt.rxrunt) + dtoh32(cnt.rxgiant);
3643 wstats->miss.beacon = 0; 3631 wstats->miss.beacon = 0;
3644 3632
3645 WL_TRACE(("wl_iw_get_wireless_stats counters txframe=%d txbyte=%d\n", 3633 WL_TRACE("wl_iw_get_wireless_stats counters txframe=%d txbyte=%d\n",
3646 dtoh32(cnt.txframe), dtoh32(cnt.txbyte))); 3634 dtoh32(cnt.txframe), dtoh32(cnt.txbyte));
3647 WL_TRACE(("wl_iw_get_wireless_stats counters rxfrmtoolong=%d\n", 3635 WL_TRACE("wl_iw_get_wireless_stats counters rxfrmtoolong=%d\n",
3648 dtoh32(cnt.rxfrmtoolong))); 3636 dtoh32(cnt.rxfrmtoolong));
3649 WL_TRACE(("wl_iw_get_wireless_stats counters rxbadplcp=%d\n", 3637 WL_TRACE("wl_iw_get_wireless_stats counters rxbadplcp=%d\n",
3650 dtoh32(cnt.rxbadplcp))); 3638 dtoh32(cnt.rxbadplcp));
3651 WL_TRACE(("wl_iw_get_wireless_stats counters rxundec=%d\n", 3639 WL_TRACE("wl_iw_get_wireless_stats counters rxundec=%d\n",
3652 dtoh32(cnt.rxundec))); 3640 dtoh32(cnt.rxundec));
3653 WL_TRACE(("wl_iw_get_wireless_stats counters rxfragerr=%d\n", 3641 WL_TRACE("wl_iw_get_wireless_stats counters rxfragerr=%d\n",
3654 dtoh32(cnt.rxfragerr))); 3642 dtoh32(cnt.rxfragerr));
3655 WL_TRACE(("wl_iw_get_wireless_stats counters txfail=%d\n", 3643 WL_TRACE("wl_iw_get_wireless_stats counters txfail=%d\n",
3656 dtoh32(cnt.txfail))); 3644 dtoh32(cnt.txfail));
3657 WL_TRACE(("wl_iw_get_wireless_stats counters rxrunt=%d\n", 3645 WL_TRACE("wl_iw_get_wireless_stats counters rxrunt=%d\n",
3658 dtoh32(cnt.rxrunt))); 3646 dtoh32(cnt.rxrunt));
3659 WL_TRACE(("wl_iw_get_wireless_stats counters rxgiant=%d\n", 3647 WL_TRACE("wl_iw_get_wireless_stats counters rxgiant=%d\n",
3660 dtoh32(cnt.rxgiant))); 3648 dtoh32(cnt.rxgiant));
3661#endif /* WIRELESS_EXT > 11 */ 3649#endif /* WIRELESS_EXT > 11 */
3662 3650
3663done: 3651done:
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.h b/drivers/staging/brcm80211/brcmfmac/wl_iw.h
index edbf61f30b47..c8637c50dc17 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_iw.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.h
@@ -78,7 +78,7 @@ typedef struct wl_iw_extra_params {
78 78
79#define CHECK_EXTRA_FOR_NULL(extra) \ 79#define CHECK_EXTRA_FOR_NULL(extra) \
80if (!extra) { \ 80if (!extra) { \
81 WL_ERROR(("%s: error : extra is null pointer\n", __func__)); \ 81 WL_ERROR("%s: error : extra is null pointer\n", __func__); \
82 return -EINVAL; \ 82 return -EINVAL; \
83} 83}
84 84
diff --git a/drivers/staging/brcm80211/sys/wl_dbg.h b/drivers/staging/brcm80211/sys/wl_dbg.h
index e63b27ebad5e..54af257598c2 100644
--- a/drivers/staging/brcm80211/sys/wl_dbg.h
+++ b/drivers/staging/brcm80211/sys/wl_dbg.h
@@ -20,15 +20,20 @@
20/* wl_msg_level is a bit vector with defs in wlioctl.h */ 20/* wl_msg_level is a bit vector with defs in wlioctl.h */
21extern u32 wl_msg_level; 21extern u32 wl_msg_level;
22 22
23#define WL_PRINT(args) printf args 23#define WL_NONE(fmt, args...) no_printk(fmt, ##args)
24#define WL_NONE(args) 24
25#define WL_PRINT(level, fmt, args...) \
26do { \
27 if (wl_msg_level & level) \
28 printk(fmt, ##args); \
29} while (0)
25 30
26#ifdef BCMDBG 31#ifdef BCMDBG
27 32
28#define WL_ERROR(args) do {if ((wl_msg_level & WL_ERROR_VAL)) WL_PRINT(args); } while (0) 33#define WL_ERROR(fmt, args...) WL_PRINT(WL_ERROR_VAL, fmt, ##args)
29#define WL_TRACE(args) do {if (wl_msg_level & WL_TRACE_VAL) WL_PRINT(args); } while (0) 34#define WL_TRACE(fmt, args...) WL_PRINT(WL_TRACE_VAL, fmt, ##args)
30#define WL_AMPDU(args) do {if (wl_msg_level & WL_AMPDU_VAL) WL_PRINT(args); } while (0) 35#define WL_AMPDU(fmt, args...) WL_PRINT(WL_AMPDU_VAL, fmt, ##args)
31#define WL_FFPLD(args) do {if (wl_msg_level & WL_FFPLD_VAL) WL_PRINT(args); } while (0) 36#define WL_FFPLD(fmt, args...) WL_PRINT(WL_FFPLD_VAL, fmt, ##args)
32 37
33#define WL_ERROR_ON() (wl_msg_level & WL_ERROR_VAL) 38#define WL_ERROR_ON() (wl_msg_level & WL_ERROR_VAL)
34 39
@@ -44,35 +49,50 @@ extern u32 wl_msg_level;
44 49
45extern u32 wl_ampdu_dbg; 50extern u32 wl_ampdu_dbg;
46 51
47#define WL_AMPDU_UPDN(args) do {if (wl_ampdu_dbg & WL_AMPDU_UPDN_VAL) {WL_AMPDU(args); } } while (0) 52#define WL_AMPDU_PRINT(level, fmt, args...) \
48#define WL_AMPDU_RX(args) do {if (wl_ampdu_dbg & WL_AMPDU_RX_VAL) {WL_AMPDU(args); } } while (0) 53do { \
49#define WL_AMPDU_ERR(args) do {if (wl_ampdu_dbg & WL_AMPDU_ERR_VAL) {WL_AMPDU(args); } } while (0) 54 if (wl_ampdu_dbg & level) { \
50#define WL_AMPDU_TX(args) do {if (wl_ampdu_dbg & WL_AMPDU_TX_VAL) {WL_AMPDU(args); } } while (0) 55 WL_AMPDU(fmt, ##args); \
51#define WL_AMPDU_CTL(args) do {if (wl_ampdu_dbg & WL_AMPDU_CTL_VAL) {WL_AMPDU(args); } } while (0) 56 } \
52#define WL_AMPDU_HW(args) do {if (wl_ampdu_dbg & WL_AMPDU_HW_VAL) {WL_AMPDU(args); } } while (0) 57} while (0)
53#define WL_AMPDU_HWTXS(args) do {if (wl_ampdu_dbg & WL_AMPDU_HWTXS_VAL) {WL_AMPDU(args); } } while (0) 58
54#define WL_AMPDU_HWDBG(args) do {if (wl_ampdu_dbg & WL_AMPDU_HWDBG_VAL) {WL_AMPDU(args); } } while (0) 59#define WL_AMPDU_UPDN(fmt, args...) \
60 WL_AMPDU_PRINT(WL_AMPDU_UPDN_VAL, fmt, ##args)
61#define WL_AMPDU_RX(fmt, args...) \
62 WL_AMPDU_PRINT(WL_AMPDU_RX_VAL, fmt, ##args)
63#define WL_AMPDU_ERR(fmt, args...) \
64 WL_AMPDU_PRINT(WL_AMPDU_ERR_VAL, fmt, ##args)
65#define WL_AMPDU_TX(fmt, args...) \
66 WL_AMPDU_PRINT(WL_AMPDU_TX_VAL, fmt, ##args)
67#define WL_AMPDU_CTL(fmt, args...) \
68 WL_AMPDU_PRINT(WL_AMPDU_CTL_VAL, fmt, ##args)
69#define WL_AMPDU_HW(fmt, args...) \
70 WL_AMPDU_PRINT(WL_AMPDU_HW_VAL, fmt, ##args)
71#define WL_AMPDU_HWTXS(fmt, args...) \
72 WL_AMPDU_PRINT(WL_AMPDU_HWTXS_VAL, fmt, ##args)
73#define WL_AMPDU_HWDBG(fmt, args...) \
74 WL_AMPDU_PRINT(WL_AMPDU_HWDBG_VAL, fmt, ##args)
55#define WL_AMPDU_ERR_ON() (wl_ampdu_dbg & WL_AMPDU_ERR_VAL) 75#define WL_AMPDU_ERR_ON() (wl_ampdu_dbg & WL_AMPDU_ERR_VAL)
56#define WL_AMPDU_HW_ON() (wl_ampdu_dbg & WL_AMPDU_HW_VAL) 76#define WL_AMPDU_HW_ON() (wl_ampdu_dbg & WL_AMPDU_HW_VAL)
57#define WL_AMPDU_HWTXS_ON() (wl_ampdu_dbg & WL_AMPDU_HWTXS_VAL) 77#define WL_AMPDU_HWTXS_ON() (wl_ampdu_dbg & WL_AMPDU_HWTXS_VAL)
58 78
59#else /* BCMDBG */ 79#else /* BCMDBG */
60 80
61#define WL_ERROR(args) 81#define WL_ERROR(fmt, args...) no_printk(fmt, ##args)
62#define WL_TRACE(args) 82#define WL_TRACE(fmt, args...) no_printk(fmt, ##args)
63#define WL_AMPDU(args) 83#define WL_AMPDU(fmt, args...) no_printk(fmt, ##args)
64#define WL_FFPLD(args) 84#define WL_FFPLD(fmt, args...) no_printk(fmt, ##args)
65 85
66#define WL_ERROR_ON() 0 86#define WL_ERROR_ON() 0
67 87
68#define WL_AMPDU_UPDN(args) 88#define WL_AMPDU_UPDN(fmt, args...) no_printk(fmt, ##args)
69#define WL_AMPDU_RX(args) 89#define WL_AMPDU_RX(fmt, args...) no_printk(fmt, ##args)
70#define WL_AMPDU_ERR(args) 90#define WL_AMPDU_ERR(fmt, args...) no_printk(fmt, ##args)
71#define WL_AMPDU_TX(args) 91#define WL_AMPDU_TX(fmt, args...) no_printk(fmt, ##args)
72#define WL_AMPDU_CTL(args) 92#define WL_AMPDU_CTL(fmt, args...) no_printk(fmt, ##args)
73#define WL_AMPDU_HW(args) 93#define WL_AMPDU_HW(fmt, args...) no_printk(fmt, ##args)
74#define WL_AMPDU_HWTXS(args) 94#define WL_AMPDU_HWTXS(fmt, args...) no_printk(fmt, ##args)
75#define WL_AMPDU_HWDBG(args) 95#define WL_AMPDU_HWDBG(fmt, args...) no_printk(fmt, ##args)
76#define WL_AMPDU_ERR_ON() 0 96#define WL_AMPDU_ERR_ON() 0
77#define WL_AMPDU_HW_ON() 0 97#define WL_AMPDU_HW_ON() 0
78#define WL_AMPDU_HWTXS_ON() 0 98#define WL_AMPDU_HWTXS_ON() 0
diff --git a/drivers/staging/brcm80211/sys/wl_mac80211.c b/drivers/staging/brcm80211/sys/wl_mac80211.c
index 4ae99749ac70..bdd629d72a75 100644
--- a/drivers/staging/brcm80211/sys/wl_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wl_mac80211.c
@@ -179,7 +179,7 @@ static int wl_ops_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
179 struct wl_info *wl = hw->priv; 179 struct wl_info *wl = hw->priv;
180 WL_LOCK(wl); 180 WL_LOCK(wl);
181 if (!wl->pub->up) { 181 if (!wl->pub->up) {
182 WL_ERROR(("ops->tx called while down\n")); 182 WL_ERROR("ops->tx called while down\n");
183 status = -ENETDOWN; 183 status = -ENETDOWN;
184 goto done; 184 goto done;
185 } 185 }
@@ -192,8 +192,10 @@ static int wl_ops_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
192static int wl_ops_start(struct ieee80211_hw *hw) 192static int wl_ops_start(struct ieee80211_hw *hw)
193{ 193{
194 struct wl_info *wl = hw->priv; 194 struct wl_info *wl = hw->priv;
195 /* struct ieee80211_channel *curchan = hw->conf.channel; */ 195 /*
196 WL_NONE(("%s : Initial channel: %d\n", __func__, curchan->hw_value)); 196 struct ieee80211_channel *curchan = hw->conf.channel;
197 WL_NONE("%s : Initial channel: %d\n", __func__, curchan->hw_value);
198 */
197 199
198 WL_LOCK(wl); 200 WL_LOCK(wl);
199 ieee80211_wake_queues(hw); 201 ieee80211_wake_queues(hw);
@@ -226,8 +228,8 @@ wl_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
226 vif->type != NL80211_IFTYPE_STATION && 228 vif->type != NL80211_IFTYPE_STATION &&
227 vif->type != NL80211_IFTYPE_WDS && 229 vif->type != NL80211_IFTYPE_WDS &&
228 vif->type != NL80211_IFTYPE_ADHOC) { 230 vif->type != NL80211_IFTYPE_ADHOC) {
229 WL_ERROR(("%s: Attempt to add type %d, only STA for now\n", 231 WL_ERROR("%s: Attempt to add type %d, only STA for now\n",
230 __func__, vif->type)); 232 __func__, vif->type);
231 return -EOPNOTSUPP; 233 return -EOPNOTSUPP;
232 } 234 }
233 235
@@ -237,7 +239,7 @@ wl_ops_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
237 WL_UNLOCK(wl); 239 WL_UNLOCK(wl);
238 240
239 if (err != 0) 241 if (err != 0)
240 WL_ERROR(("%s: wl_up() returned %d\n", __func__, err)); 242 WL_ERROR("%s: wl_up() returned %d\n", __func__, err);
241 return err; 243 return err;
242} 244}
243 245
@@ -263,8 +265,7 @@ ieee_set_channel(struct ieee80211_hw *hw, struct ieee80211_channel *chan,
263 break; 265 break;
264 case NL80211_CHAN_HT40MINUS: 266 case NL80211_CHAN_HT40MINUS:
265 case NL80211_CHAN_HT40PLUS: 267 case NL80211_CHAN_HT40PLUS:
266 WL_ERROR(("%s: Need to implement 40 Mhz Channels!\n", 268 WL_ERROR("%s: Need to implement 40 Mhz Channels!\n", __func__);
267 __func__));
268 break; 269 break;
269 } 270 }
270 271
@@ -281,12 +282,12 @@ static int wl_ops_config(struct ieee80211_hw *hw, u32 changed)
281 int new_int; 282 int new_int;
282 283
283 if (changed & IEEE80211_CONF_CHANGE_LISTEN_INTERVAL) { 284 if (changed & IEEE80211_CONF_CHANGE_LISTEN_INTERVAL) {
284 WL_NONE(("%s: Setting listen interval to %d\n", 285 WL_NONE("%s: Setting listen interval to %d\n",
285 __func__, conf->listen_interval)); 286 __func__, conf->listen_interval);
286 if (wlc_iovar_setint 287 if (wlc_iovar_setint
287 (wl->wlc, "bcn_li_bcn", conf->listen_interval)) { 288 (wl->wlc, "bcn_li_bcn", conf->listen_interval)) {
288 WL_ERROR(("%s: Error setting listen_interval\n", 289 WL_ERROR("%s: Error setting listen_interval\n",
289 __func__)); 290 __func__);
290 err = -EIO; 291 err = -EIO;
291 goto config_out; 292 goto config_out;
292 } 293 }
@@ -294,41 +295,42 @@ static int wl_ops_config(struct ieee80211_hw *hw, u32 changed)
294 ASSERT(new_int == conf->listen_interval); 295 ASSERT(new_int == conf->listen_interval);
295 } 296 }
296 if (changed & IEEE80211_CONF_CHANGE_MONITOR) 297 if (changed & IEEE80211_CONF_CHANGE_MONITOR)
297 WL_NONE(("Need to set monitor mode\n")); 298 WL_NONE("Need to set monitor mode\n");
298 if (changed & IEEE80211_CONF_CHANGE_PS) 299 if (changed & IEEE80211_CONF_CHANGE_PS)
299 WL_NONE(("Need to set Power-save mode\n")); 300 WL_NONE("Need to set Power-save mode\n");
300 301
301 if (changed & IEEE80211_CONF_CHANGE_POWER) { 302 if (changed & IEEE80211_CONF_CHANGE_POWER) {
302 WL_NONE(("%s: Setting tx power to %d dbm\n", __func__, 303 WL_NONE("%s: Setting tx power to %d dbm\n",
303 conf->power_level)); 304 __func__, conf->power_level);
304 if (wlc_iovar_setint 305 if (wlc_iovar_setint
305 (wl->wlc, "qtxpower", conf->power_level * 4)) { 306 (wl->wlc, "qtxpower", conf->power_level * 4)) {
306 WL_ERROR(("%s: Error setting power_level\n", __func__)); 307 WL_ERROR("%s: Error setting power_level\n", __func__);
307 err = -EIO; 308 err = -EIO;
308 goto config_out; 309 goto config_out;
309 } 310 }
310 wlc_iovar_getint(wl->wlc, "qtxpower", &new_int); 311 wlc_iovar_getint(wl->wlc, "qtxpower", &new_int);
311 if (new_int != (conf->power_level * 4)) 312 if (new_int != (conf->power_level * 4))
312 WL_ERROR(("%s: Power level req != actual, %d %d\n", 313 WL_ERROR("%s: Power level req != actual, %d %d\n",
313 __func__, conf->power_level * 4, new_int)); 314 __func__, conf->power_level * 4, new_int);
314 } 315 }
315 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { 316 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
316 err = ieee_set_channel(hw, conf->channel, conf->channel_type); 317 err = ieee_set_channel(hw, conf->channel, conf->channel_type);
317 } 318 }
318 if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS) { 319 if (changed & IEEE80211_CONF_CHANGE_RETRY_LIMITS) {
319 WL_NONE(("%s: srl %d, lrl %d\n", __func__, 320 WL_NONE("%s: srl %d, lrl %d\n",
320 conf->short_frame_max_tx_count, 321 __func__,
321 conf->long_frame_max_tx_count)); 322 conf->short_frame_max_tx_count,
323 conf->long_frame_max_tx_count);
322 if (wlc_set 324 if (wlc_set
323 (wl->wlc, WLC_SET_SRL, 325 (wl->wlc, WLC_SET_SRL,
324 conf->short_frame_max_tx_count) < 0) { 326 conf->short_frame_max_tx_count) < 0) {
325 WL_ERROR(("%s: Error setting srl\n", __func__)); 327 WL_ERROR("%s: Error setting srl\n", __func__);
326 err = -EIO; 328 err = -EIO;
327 goto config_out; 329 goto config_out;
328 } 330 }
329 if (wlc_set(wl->wlc, WLC_SET_LRL, conf->long_frame_max_tx_count) 331 if (wlc_set(wl->wlc, WLC_SET_LRL, conf->long_frame_max_tx_count)
330 < 0) { 332 < 0) {
331 WL_ERROR(("%s: Error setting lrl\n", __func__)); 333 WL_ERROR("%s: Error setting lrl\n", __func__);
332 err = -EIO; 334 err = -EIO;
333 goto config_out; 335 goto config_out;
334 } 336 }
@@ -348,24 +350,24 @@ wl_ops_bss_info_changed(struct ieee80211_hw *hw,
348 350
349 351
350 if (changed & BSS_CHANGED_ASSOC) { 352 if (changed & BSS_CHANGED_ASSOC) {
351 WL_ERROR(("Associated:\t%s\n", info->assoc ? "True" : "False")); 353 WL_ERROR("Associated:\t%s\n", info->assoc ? "True" : "False");
352 /* association status changed (associated/disassociated) 354 /* association status changed (associated/disassociated)
353 * also implies a change in the AID. 355 * also implies a change in the AID.
354 */ 356 */
355 } 357 }
356 if (changed & BSS_CHANGED_ERP_CTS_PROT) { 358 if (changed & BSS_CHANGED_ERP_CTS_PROT) {
357 WL_NONE(("Use_cts_prot:\t%s Implement me\n", 359 WL_NONE("Use_cts_prot:\t%s Implement me\n",
358 info->use_cts_prot ? "True" : "False")); 360 info->use_cts_prot ? "True" : "False");
359 /* CTS protection changed */ 361 /* CTS protection changed */
360 } 362 }
361 if (changed & BSS_CHANGED_ERP_PREAMBLE) { 363 if (changed & BSS_CHANGED_ERP_PREAMBLE) {
362 WL_NONE(("Short preamble:\t%s Implement me\n", 364 WL_NONE("Short preamble:\t%s Implement me\n",
363 info->use_short_preamble ? "True" : "False")); 365 info->use_short_preamble ? "True" : "False");
364 /* preamble changed */ 366 /* preamble changed */
365 } 367 }
366 if (changed & BSS_CHANGED_ERP_SLOT) { 368 if (changed & BSS_CHANGED_ERP_SLOT) {
367 WL_NONE(("Changing short slot:\t%s\n", 369 WL_NONE("Changing short slot:\t%s\n",
368 info->use_short_slot ? "True" : "False")); 370 info->use_short_slot ? "True" : "False");
369 if (info->use_short_slot) 371 if (info->use_short_slot)
370 val = 1; 372 val = 1;
371 else 373 else
@@ -375,34 +377,34 @@ wl_ops_bss_info_changed(struct ieee80211_hw *hw,
375 } 377 }
376 378
377 if (changed & BSS_CHANGED_HT) { 379 if (changed & BSS_CHANGED_HT) {
378 WL_NONE(("%s: HT mode - Implement me\n", __func__)); 380 WL_NONE("%s: HT mode - Implement me\n", __func__);
379 /* 802.11n parameters changed */ 381 /* 802.11n parameters changed */
380 } 382 }
381 if (changed & BSS_CHANGED_BASIC_RATES) { 383 if (changed & BSS_CHANGED_BASIC_RATES) {
382 WL_NONE(("Need to change Basic Rates:\t0x%x! Implement me\n", 384 WL_NONE("Need to change Basic Rates:\t0x%x! Implement me\n",
383 (u32) info->basic_rates)); 385 (u32) info->basic_rates);
384 /* Basic rateset changed */ 386 /* Basic rateset changed */
385 } 387 }
386 if (changed & BSS_CHANGED_BEACON_INT) { 388 if (changed & BSS_CHANGED_BEACON_INT) {
387 WL_NONE(("Beacon Interval:\t%d Implement me\n", 389 WL_NONE("Beacon Interval:\t%d Implement me\n",
388 info->beacon_int)); 390 info->beacon_int);
389 /* Beacon interval changed */ 391 /* Beacon interval changed */
390 } 392 }
391 if (changed & BSS_CHANGED_BSSID) { 393 if (changed & BSS_CHANGED_BSSID) {
392 WL_NONE(("new BSSID:\taid %d bss:%pM\n", info->aid, 394 WL_NONE("new BSSID:\taid %d bss:%pM\n",
393 info->bssid)); 395 info->aid, info->bssid);
394 /* BSSID changed, for whatever reason (IBSS and managed mode) */ 396 /* BSSID changed, for whatever reason (IBSS and managed mode) */
395 /* FIXME: need to store bssid in bsscfg */ 397 /* FIXME: need to store bssid in bsscfg */
396 wlc_set_addrmatch(wl->wlc, RCM_BSSID_OFFSET, 398 wlc_set_addrmatch(wl->wlc, RCM_BSSID_OFFSET,
397 (struct ether_addr *)info->bssid); 399 (struct ether_addr *)info->bssid);
398 } 400 }
399 if (changed & BSS_CHANGED_BEACON) { 401 if (changed & BSS_CHANGED_BEACON) {
400 WL_ERROR(("BSS_CHANGED_BEACON\n")); 402 WL_ERROR("BSS_CHANGED_BEACON\n");
401 /* Beacon data changed, retrieve new beacon (beaconing modes) */ 403 /* Beacon data changed, retrieve new beacon (beaconing modes) */
402 } 404 }
403 if (changed & BSS_CHANGED_BEACON_ENABLED) { 405 if (changed & BSS_CHANGED_BEACON_ENABLED) {
404 WL_ERROR(("Beacon enabled:\t%s\n", 406 WL_ERROR("Beacon enabled:\t%s\n",
405 info->enable_beacon ? "True" : "False")); 407 info->enable_beacon ? "True" : "False");
406 /* Beaconing should be enabled/disabled (beaconing modes) */ 408 /* Beaconing should be enabled/disabled (beaconing modes) */
407 } 409 }
408 return; 410 return;
@@ -418,19 +420,19 @@ wl_ops_configure_filter(struct ieee80211_hw *hw,
418 changed_flags &= MAC_FILTERS; 420 changed_flags &= MAC_FILTERS;
419 *total_flags &= MAC_FILTERS; 421 *total_flags &= MAC_FILTERS;
420 if (changed_flags & FIF_PROMISC_IN_BSS) 422 if (changed_flags & FIF_PROMISC_IN_BSS)
421 WL_ERROR(("FIF_PROMISC_IN_BSS\n")); 423 WL_ERROR("FIF_PROMISC_IN_BSS\n");
422 if (changed_flags & FIF_ALLMULTI) 424 if (changed_flags & FIF_ALLMULTI)
423 WL_ERROR(("FIF_ALLMULTI\n")); 425 WL_ERROR("FIF_ALLMULTI\n");
424 if (changed_flags & FIF_FCSFAIL) 426 if (changed_flags & FIF_FCSFAIL)
425 WL_ERROR(("FIF_FCSFAIL\n")); 427 WL_ERROR("FIF_FCSFAIL\n");
426 if (changed_flags & FIF_PLCPFAIL) 428 if (changed_flags & FIF_PLCPFAIL)
427 WL_ERROR(("FIF_PLCPFAIL\n")); 429 WL_ERROR("FIF_PLCPFAIL\n");
428 if (changed_flags & FIF_CONTROL) 430 if (changed_flags & FIF_CONTROL)
429 WL_ERROR(("FIF_CONTROL\n")); 431 WL_ERROR("FIF_CONTROL\n");
430 if (changed_flags & FIF_OTHER_BSS) 432 if (changed_flags & FIF_OTHER_BSS)
431 WL_ERROR(("FIF_OTHER_BSS\n")); 433 WL_ERROR("FIF_OTHER_BSS\n");
432 if (changed_flags & FIF_BCN_PRBRESP_PROMISC) { 434 if (changed_flags & FIF_BCN_PRBRESP_PROMISC) {
433 WL_NONE(("FIF_BCN_PRBRESP_PROMISC\n")); 435 WL_NONE("FIF_BCN_PRBRESP_PROMISC\n");
434 WL_LOCK(wl); 436 WL_LOCK(wl);
435 if (*total_flags & FIF_BCN_PRBRESP_PROMISC) { 437 if (*total_flags & FIF_BCN_PRBRESP_PROMISC) {
436 wl->pub->mac80211_state |= MAC80211_PROMISC_BCNS; 438 wl->pub->mac80211_state |= MAC80211_PROMISC_BCNS;
@@ -447,25 +449,25 @@ wl_ops_configure_filter(struct ieee80211_hw *hw,
447static int 449static int
448wl_ops_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set) 450wl_ops_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set)
449{ 451{
450 WL_ERROR(("%s: Enter\n", __func__)); 452 WL_ERROR("%s: Enter\n", __func__);
451 return 0; 453 return 0;
452} 454}
453 455
454static void wl_ops_sw_scan_start(struct ieee80211_hw *hw) 456static void wl_ops_sw_scan_start(struct ieee80211_hw *hw)
455{ 457{
456 WL_NONE(("Scan Start\n")); 458 WL_NONE("Scan Start\n");
457 return; 459 return;
458} 460}
459 461
460static void wl_ops_sw_scan_complete(struct ieee80211_hw *hw) 462static void wl_ops_sw_scan_complete(struct ieee80211_hw *hw)
461{ 463{
462 WL_NONE(("Scan Complete\n")); 464 WL_NONE("Scan Complete\n");
463 return; 465 return;
464} 466}
465 467
466static void wl_ops_set_tsf(struct ieee80211_hw *hw, u64 tsf) 468static void wl_ops_set_tsf(struct ieee80211_hw *hw, u64 tsf)
467{ 469{
468 WL_ERROR(("%s: Enter\n", __func__)); 470 WL_ERROR("%s: Enter\n", __func__);
469 return; 471 return;
470} 472}
471 473
@@ -473,13 +475,13 @@ static int
473wl_ops_get_stats(struct ieee80211_hw *hw, 475wl_ops_get_stats(struct ieee80211_hw *hw,
474 struct ieee80211_low_level_stats *stats) 476 struct ieee80211_low_level_stats *stats)
475{ 477{
476 WL_ERROR(("%s: Enter\n", __func__)); 478 WL_ERROR("%s: Enter\n", __func__);
477 return 0; 479 return 0;
478} 480}
479 481
480static int wl_ops_set_rts_threshold(struct ieee80211_hw *hw, u32 value) 482static int wl_ops_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
481{ 483{
482 WL_ERROR(("%s: Enter\n", __func__)); 484 WL_ERROR("%s: Enter\n", __func__);
483 return 0; 485 return 0;
484} 486}
485 487
@@ -487,10 +489,10 @@ static void
487wl_ops_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 489wl_ops_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
488 enum sta_notify_cmd cmd, struct ieee80211_sta *sta) 490 enum sta_notify_cmd cmd, struct ieee80211_sta *sta)
489{ 491{
490 WL_NONE(("%s: Enter\n", __func__)); 492 WL_NONE("%s: Enter\n", __func__);
491 switch (cmd) { 493 switch (cmd) {
492 default: 494 default:
493 WL_ERROR(("%s: Uknown cmd = %d\n", __func__, cmd)); 495 WL_ERROR("%s: Unknown cmd = %d\n", __func__, cmd);
494 break; 496 break;
495 } 497 }
496 return; 498 return;
@@ -502,9 +504,9 @@ wl_ops_conf_tx(struct ieee80211_hw *hw, u16 queue,
502{ 504{
503 struct wl_info *wl = hw->priv; 505 struct wl_info *wl = hw->priv;
504 506
505 WL_NONE(("%s: Enter (WME config)\n", __func__)); 507 WL_NONE("%s: Enter (WME config)\n", __func__);
506 WL_NONE(("queue %d, txop %d, cwmin %d, cwmax %d, aifs %d\n", queue, 508 WL_NONE("queue %d, txop %d, cwmin %d, cwmax %d, aifs %d\n", queue,
507 params->txop, params->cw_min, params->cw_max, params->aifs)); 509 params->txop, params->cw_min, params->cw_max, params->aifs);
508 510
509 WL_LOCK(wl); 511 WL_LOCK(wl);
510 wlc_wme_setparams(wl->wlc, queue, (void *)params, true); 512 wlc_wme_setparams(wl->wlc, queue, (void *)params, true);
@@ -515,7 +517,7 @@ wl_ops_conf_tx(struct ieee80211_hw *hw, u16 queue,
515 517
516static u64 wl_ops_get_tsf(struct ieee80211_hw *hw) 518static u64 wl_ops_get_tsf(struct ieee80211_hw *hw)
517{ 519{
518 WL_ERROR(("%s: Enter\n", __func__)); 520 WL_ERROR("%s: Enter\n", __func__);
519 return 0; 521 return 0;
520} 522}
521 523
@@ -558,7 +560,7 @@ static int
558wl_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 560wl_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
559 struct ieee80211_sta *sta) 561 struct ieee80211_sta *sta)
560{ 562{
561 WL_NONE(("%s: Enter\n", __func__)); 563 WL_NONE("%s: Enter\n", __func__);
562 return 0; 564 return 0;
563} 565}
564 566
@@ -576,14 +578,14 @@ wl_ampdu_action(struct ieee80211_hw *hw,
576 ASSERT(scb->magic == SCB_MAGIC); 578 ASSERT(scb->magic == SCB_MAGIC);
577 switch (action) { 579 switch (action) {
578 case IEEE80211_AMPDU_RX_START: 580 case IEEE80211_AMPDU_RX_START:
579 WL_NONE(("%s: action = IEEE80211_AMPDU_RX_START\n", __func__)); 581 WL_NONE("%s: action = IEEE80211_AMPDU_RX_START\n", __func__);
580 break; 582 break;
581 case IEEE80211_AMPDU_RX_STOP: 583 case IEEE80211_AMPDU_RX_STOP:
582 WL_NONE(("%s: action = IEEE80211_AMPDU_RX_STOP\n", __func__)); 584 WL_NONE("%s: action = IEEE80211_AMPDU_RX_STOP\n", __func__);
583 break; 585 break;
584 case IEEE80211_AMPDU_TX_START: 586 case IEEE80211_AMPDU_TX_START:
585 if (!wlc_aggregatable(wl->wlc, tid)) { 587 if (!wlc_aggregatable(wl->wlc, tid)) {
586 /* WL_ERROR(("START: tid %d is not agg' able, return FAILURE to stack\n", tid)); */ 588 /* WL_ERROR("START: tid %d is not agg' able, return FAILURE to stack\n", tid); */
587 return -1; 589 return -1;
588 } 590 }
589 /* XXX: Use the starting sequence number provided ... */ 591 /* XXX: Use the starting sequence number provided ... */
@@ -597,11 +599,11 @@ wl_ampdu_action(struct ieee80211_hw *hw,
597 case IEEE80211_AMPDU_TX_OPERATIONAL: 599 case IEEE80211_AMPDU_TX_OPERATIONAL:
598 /* Not sure what to do here */ 600 /* Not sure what to do here */
599 /* Power save wakeup */ 601 /* Power save wakeup */
600 WL_NONE(("%s: action = IEEE80211_AMPDU_TX_OPERATIONAL\n", 602 WL_NONE("%s: action = IEEE80211_AMPDU_TX_OPERATIONAL\n",
601 __func__)); 603 __func__);
602 break; 604 break;
603 default: 605 default:
604 WL_ERROR(("%s: Invalid command, ignoring\n", __func__)); 606 WL_ERROR("%s: Invalid command, ignoring\n", __func__);
605 } 607 }
606 608
607 return 0; 609 return 0;
@@ -632,8 +634,8 @@ static const struct ieee80211_ops wl_ops = {
632 634
633static int wl_set_hint(struct wl_info *wl, char *abbrev) 635static int wl_set_hint(struct wl_info *wl, char *abbrev)
634{ 636{
635 WL_ERROR(("%s: Sending country code %c%c to MAC80211\n", __func__, 637 WL_ERROR("%s: Sending country code %c%c to MAC80211\n",
636 abbrev[0], abbrev[1])); 638 __func__, abbrev[0], abbrev[1]);
637 return regulatory_hint(wl->pub->ieee_hw->wiphy, abbrev); 639 return regulatory_hint(wl->pub->ieee_hw->wiphy, abbrev);
638} 640}
639 641
@@ -663,7 +665,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
663 err = 0; 665 err = 0;
664 666
665 if (unit < 0) { 667 if (unit < 0) {
666 WL_ERROR(("wl%d: unit number overflow, exiting\n", unit)); 668 WL_ERROR("wl%d: unit number overflow, exiting\n", unit);
667 return NULL; 669 return NULL;
668 } 670 }
669 671
@@ -691,13 +693,13 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
691 /* Do nothing */ 693 /* Do nothing */
692 } else { 694 } else {
693 bustype = PCI_BUS; 695 bustype = PCI_BUS;
694 WL_TRACE(("force to PCI\n")); 696 WL_TRACE("force to PCI\n");
695 } 697 }
696 wl->bcm_bustype = bustype; 698 wl->bcm_bustype = bustype;
697 699
698 wl->regsva = ioremap_nocache(base_addr, PCI_BAR0_WINSZ); 700 wl->regsva = ioremap_nocache(base_addr, PCI_BAR0_WINSZ);
699 if (wl->regsva == NULL) { 701 if (wl->regsva == NULL) {
700 WL_ERROR(("wl%d: ioremap() failed\n", unit)); 702 WL_ERROR("wl%d: ioremap() failed\n", unit);
701 goto fail; 703 goto fail;
702 } 704 }
703 spin_lock_init(&wl->lock); 705 spin_lock_init(&wl->lock);
@@ -729,13 +731,12 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
729 731
730 732
731 if (wlc_iovar_setint(wl->wlc, "mpc", 0)) { 733 if (wlc_iovar_setint(wl->wlc, "mpc", 0)) {
732 WL_ERROR(("wl%d: Error setting MPC variable to 0\n", 734 WL_ERROR("wl%d: Error setting MPC variable to 0\n", unit);
733 unit));
734 } 735 }
735 736
736 /* register our interrupt handler */ 737 /* register our interrupt handler */
737 if (request_irq(irq, wl_isr, IRQF_SHARED, KBUILD_MODNAME, wl)) { 738 if (request_irq(irq, wl_isr, IRQF_SHARED, KBUILD_MODNAME, wl)) {
738 WL_ERROR(("wl%d: request_irq() failed\n", unit)); 739 WL_ERROR("wl%d: request_irq() failed\n", unit);
739 goto fail; 740 goto fail;
740 } 741 }
741 wl->irq = irq; 742 wl->irq = irq;
@@ -745,7 +746,7 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
745 NULL); 746 NULL);
746 747
747 if (ieee_hw_init(hw)) { 748 if (ieee_hw_init(hw)) {
748 WL_ERROR(("wl%d: %s: ieee_hw_init failed!\n", unit, __func__)); 749 WL_ERROR("wl%d: %s: ieee_hw_init failed!\n", unit, __func__);
749 goto fail; 750 goto fail;
750 } 751 }
751 752
@@ -755,8 +756,8 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
755 756
756 err = ieee80211_register_hw(hw); 757 err = ieee80211_register_hw(hw);
757 if (err) { 758 if (err) {
758 WL_ERROR(("%s: ieee80211_register_hw failed, status %d\n", 759 WL_ERROR("%s: ieee80211_register_hw failed, status %d\n",
759 __func__, err)); 760 __func__, err);
760 } 761 }
761 762
762 if (wl->pub->srom_ccode[0]) 763 if (wl->pub->srom_ccode[0])
@@ -764,11 +765,11 @@ static struct wl_info *wl_attach(u16 vendor, u16 device, unsigned long regs,
764 else 765 else
765 err = wl_set_hint(wl, "US"); 766 err = wl_set_hint(wl, "US");
766 if (err) { 767 if (err) {
767 WL_ERROR(("%s: regulatory_hint failed, status %d\n", __func__, 768 WL_ERROR("%s: regulatory_hint failed, status %d\n",
768 err)); 769 __func__, err);
769 } 770 }
770 WL_ERROR(("wl%d: Broadcom BCM43xx 802.11 MAC80211 Driver " 771 WL_ERROR("wl%d: Broadcom BCM43xx 802.11 MAC80211 Driver (" PHY_VERSION_STR ")",
771 " (" PHY_VERSION_STR ")", unit)); 772 unit);
772 773
773#ifdef BCMDBG 774#ifdef BCMDBG
774 printf(" (Compiled at " __TIME__ " on " __DATE__ ")"); 775 printf(" (Compiled at " __TIME__ " on " __DATE__ ")");
@@ -964,9 +965,9 @@ static int ieee_hw_rate_init(struct ieee80211_hw *hw)
964 hw->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL; 965 hw->wiphy->bands[IEEE80211_BAND_5GHZ] = NULL;
965 966
966 if (wlc_get(wl->wlc, WLC_GET_PHYLIST, (int *)&phy_list) < 0) { 967 if (wlc_get(wl->wlc, WLC_GET_PHYLIST, (int *)&phy_list) < 0) {
967 WL_ERROR(("Phy list failed\n")); 968 WL_ERROR("Phy list failed\n");
968 } 969 }
969 WL_NONE(("%s: phylist = %c\n", __func__, phy_list[0])); 970 WL_NONE("%s: phylist = %c\n", __func__, phy_list[0]);
970 971
971 if (phy_list[0] == 'n' || phy_list[0] == 'c') { 972 if (phy_list[0] == 'n' || phy_list[0] == 'c') {
972 if (phy_list[0] == 'c') { 973 if (phy_list[0] == 'c') {
@@ -991,7 +992,7 @@ static int ieee_hw_rate_init(struct ieee80211_hw *hw)
991 } 992 }
992 } 993 }
993 994
994 WL_NONE(("%s: 2ghz = %d, 5ghz = %d\n", __func__, 1, has_5g)); 995 WL_NONE("%s: 2ghz = %d, 5ghz = %d\n", __func__, 1, has_5g);
995 996
996 return 0; 997 return 0;
997} 998}
@@ -1039,9 +1040,9 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1039 1040
1040 ASSERT(pdev); 1041 ASSERT(pdev);
1041 1042
1042 WL_TRACE(("%s: bus %d slot %d func %d irq %d\n", __func__, 1043 WL_TRACE("%s: bus %d slot %d func %d irq %d\n",
1043 pdev->bus->number, PCI_SLOT(pdev->devfn), 1044 __func__, pdev->bus->number, PCI_SLOT(pdev->devfn),
1044 PCI_FUNC(pdev->devfn), pdev->irq)); 1045 PCI_FUNC(pdev->devfn), pdev->irq);
1045 1046
1046 if ((pdev->vendor != PCI_VENDOR_ID_BROADCOM) || 1047 if ((pdev->vendor != PCI_VENDOR_ID_BROADCOM) ||
1047 (((pdev->device & 0xff00) != 0x4300) && 1048 (((pdev->device & 0xff00) != 0x4300) &&
@@ -1051,9 +1052,9 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1051 1052
1052 rc = pci_enable_device(pdev); 1053 rc = pci_enable_device(pdev);
1053 if (rc) { 1054 if (rc) {
1054 WL_ERROR(("%s: Cannot enable device %d-%d_%d\n", __func__, 1055 WL_ERROR("%s: Cannot enable device %d-%d_%d\n",
1055 pdev->bus->number, PCI_SLOT(pdev->devfn), 1056 __func__, pdev->bus->number, PCI_SLOT(pdev->devfn),
1056 PCI_FUNC(pdev->devfn))); 1057 PCI_FUNC(pdev->devfn));
1057 return -ENODEV; 1058 return -ENODEV;
1058 } 1059 }
1059 pci_set_master(pdev); 1060 pci_set_master(pdev);
@@ -1064,7 +1065,7 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1064 1065
1065 hw = ieee80211_alloc_hw(sizeof(struct wl_info), &wl_ops); 1066 hw = ieee80211_alloc_hw(sizeof(struct wl_info), &wl_ops);
1066 if (!hw) { 1067 if (!hw) {
1067 WL_ERROR(("%s: ieee80211_alloc_hw failed\n", __func__)); 1068 WL_ERROR("%s: ieee80211_alloc_hw failed\n", __func__);
1068 rc = -ENOMEM; 1069 rc = -ENOMEM;
1069 goto err_1; 1070 goto err_1;
1070 } 1071 }
@@ -1079,13 +1080,13 @@ wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1079 PCI_BUS, pdev, pdev->irq); 1080 PCI_BUS, pdev, pdev->irq);
1080 1081
1081 if (!wl) { 1082 if (!wl) {
1082 WL_ERROR(("%s: %s: wl_attach failed!\n", 1083 WL_ERROR("%s: %s: wl_attach failed!\n",
1083 KBUILD_MODNAME, __func__)); 1084 KBUILD_MODNAME, __func__);
1084 return -ENODEV; 1085 return -ENODEV;
1085 } 1086 }
1086 return 0; 1087 return 0;
1087 err_1: 1088 err_1:
1088 WL_ERROR(("%s: err_1: Major hoarkage\n", __func__)); 1089 WL_ERROR("%s: err_1: Major hoarkage\n", __func__);
1089 return 0; 1090 return 0;
1090} 1091}
1091 1092
@@ -1095,12 +1096,12 @@ static int wl_suspend(struct pci_dev *pdev, pm_message_t state)
1095 struct wl_info *wl; 1096 struct wl_info *wl;
1096 struct ieee80211_hw *hw; 1097 struct ieee80211_hw *hw;
1097 1098
1098 WL_TRACE(("wl: wl_suspend\n")); 1099 WL_TRACE("wl: wl_suspend\n");
1099 1100
1100 hw = pci_get_drvdata(pdev); 1101 hw = pci_get_drvdata(pdev);
1101 wl = HW_TO_WL(hw); 1102 wl = HW_TO_WL(hw);
1102 if (!wl) { 1103 if (!wl) {
1103 WL_ERROR(("wl: wl_suspend: pci_get_drvdata failed\n")); 1104 WL_ERROR("wl: wl_suspend: pci_get_drvdata failed\n");
1104 return -ENODEV; 1105 return -ENODEV;
1105 } 1106 }
1106 1107
@@ -1120,11 +1121,11 @@ static int wl_resume(struct pci_dev *pdev)
1120 int err = 0; 1121 int err = 0;
1121 u32 val; 1122 u32 val;
1122 1123
1123 WL_TRACE(("wl: wl_resume\n")); 1124 WL_TRACE("wl: wl_resume\n");
1124 hw = pci_get_drvdata(pdev); 1125 hw = pci_get_drvdata(pdev);
1125 wl = HW_TO_WL(hw); 1126 wl = HW_TO_WL(hw);
1126 if (!wl) { 1127 if (!wl) {
1127 WL_ERROR(("wl: wl_resume: pci_get_drvdata failed\n")); 1128 WL_ERROR("wl: wl_resume: pci_get_drvdata failed\n");
1128 return -ENODEV; 1129 return -ENODEV;
1129 } 1130 }
1130 1131
@@ -1160,11 +1161,11 @@ static void wl_remove(struct pci_dev *pdev)
1160 hw = pci_get_drvdata(pdev); 1161 hw = pci_get_drvdata(pdev);
1161 wl = HW_TO_WL(hw); 1162 wl = HW_TO_WL(hw);
1162 if (!wl) { 1163 if (!wl) {
1163 WL_ERROR(("wl: wl_remove: pci_get_drvdata failed\n")); 1164 WL_ERROR("wl: wl_remove: pci_get_drvdata failed\n");
1164 return; 1165 return;
1165 } 1166 }
1166 if (!wlc_chipmatch(pdev->vendor, pdev->device)) { 1167 if (!wlc_chipmatch(pdev->vendor, pdev->device)) {
1167 WL_ERROR(("wl: wl_remove: wlc_chipmatch failed\n")); 1168 WL_ERROR("wl: wl_remove: wlc_chipmatch failed\n");
1168 return; 1169 return;
1169 } 1170 }
1170 if (wl->wlc) { 1171 if (wl->wlc) {
@@ -1172,7 +1173,7 @@ static void wl_remove(struct pci_dev *pdev)
1172 WL_LOCK(wl); 1173 WL_LOCK(wl);
1173 wl_down(wl); 1174 wl_down(wl);
1174 WL_UNLOCK(wl); 1175 WL_UNLOCK(wl);
1175 WL_NONE(("%s: Down\n", __func__)); 1176 WL_NONE("%s: Down\n", __func__);
1176 } 1177 }
1177 pci_disable_device(pdev); 1178 pci_disable_device(pdev);
1178 1179
@@ -1334,12 +1335,12 @@ wl_start_int(struct wl_info *wl, struct ieee80211_hw *hw, struct sk_buff *skb)
1334void wl_txflowcontrol(struct wl_info *wl, struct wl_if *wlif, bool state, 1335void wl_txflowcontrol(struct wl_info *wl, struct wl_if *wlif, bool state,
1335 int prio) 1336 int prio)
1336{ 1337{
1337 WL_ERROR(("Shouldn't be here %s\n", __func__)); 1338 WL_ERROR("Shouldn't be here %s\n", __func__);
1338} 1339}
1339 1340
1340void wl_init(struct wl_info *wl) 1341void wl_init(struct wl_info *wl)
1341{ 1342{
1342 WL_TRACE(("wl%d: wl_init\n", wl->pub->unit)); 1343 WL_TRACE("wl%d: wl_init\n", wl->pub->unit);
1343 1344
1344 wl_reset(wl); 1345 wl_reset(wl);
1345 1346
@@ -1348,7 +1349,7 @@ void wl_init(struct wl_info *wl)
1348 1349
1349uint wl_reset(struct wl_info *wl) 1350uint wl_reset(struct wl_info *wl)
1350{ 1351{
1351 WL_TRACE(("wl%d: wl_reset\n", wl->pub->unit)); 1352 WL_TRACE("wl%d: wl_reset\n", wl->pub->unit);
1352 1353
1353 wlc_reset(wl->wlc); 1354 wlc_reset(wl->wlc);
1354 1355
@@ -1494,12 +1495,12 @@ static void BCMFASTPATH wl_dpc(unsigned long data)
1494 1495
1495static void wl_link_up(struct wl_info *wl, char *ifname) 1496static void wl_link_up(struct wl_info *wl, char *ifname)
1496{ 1497{
1497 WL_ERROR(("wl%d: link up (%s)\n", wl->pub->unit, ifname)); 1498 WL_ERROR("wl%d: link up (%s)\n", wl->pub->unit, ifname);
1498} 1499}
1499 1500
1500static void wl_link_down(struct wl_info *wl, char *ifname) 1501static void wl_link_down(struct wl_info *wl, char *ifname)
1501{ 1502{
1502 WL_ERROR(("wl%d: link down (%s)\n", wl->pub->unit, ifname)); 1503 WL_ERROR("wl%d: link down (%s)\n", wl->pub->unit, ifname);
1503} 1504}
1504 1505
1505void wl_event(struct wl_info *wl, char *ifname, wlc_event_t *e) 1506void wl_event(struct wl_info *wl, char *ifname, wlc_event_t *e)
@@ -1551,7 +1552,7 @@ wl_timer_t *wl_init_timer(struct wl_info *wl, void (*fn) (void *arg), void *arg,
1551 1552
1552 t = kmalloc(sizeof(wl_timer_t), GFP_ATOMIC); 1553 t = kmalloc(sizeof(wl_timer_t), GFP_ATOMIC);
1553 if (!t) { 1554 if (!t) {
1554 WL_ERROR(("wl%d: wl_init_timer: out of memory\n", wl->pub->unit)); 1555 WL_ERROR("wl%d: wl_init_timer: out of memory\n", wl->pub->unit);
1555 return 0; 1556 return 0;
1556 } 1557 }
1557 1558
@@ -1582,8 +1583,8 @@ void wl_add_timer(struct wl_info *wl, wl_timer_t *t, uint ms, int periodic)
1582{ 1583{
1583#ifdef BCMDBG 1584#ifdef BCMDBG
1584 if (t->set) { 1585 if (t->set) {
1585 WL_ERROR(("%s: Already set. Name: %s, per %d\n", 1586 WL_ERROR("%s: Already set. Name: %s, per %d\n",
1586 __func__, t->name, periodic)); 1587 __func__, t->name, periodic);
1587 } 1588 }
1588#endif 1589#endif
1589 ASSERT(!t->set); 1590 ASSERT(!t->set);
@@ -1752,7 +1753,7 @@ static int wl_request_fw(struct wl_info *wl, struct pci_dev *pdev)
1752 break; 1753 break;
1753 sprintf(fw_name, "%s-%d.fw", wl_firmwares[i], 1754 sprintf(fw_name, "%s-%d.fw", wl_firmwares[i],
1754 UCODE_LOADER_API_VER); 1755 UCODE_LOADER_API_VER);
1755 WL_NONE(("request fw %s\n", fw_name)); 1756 WL_NONE("request fw %s\n", fw_name);
1756 status = request_firmware(&wl->fw.fw_bin[i], fw_name, device); 1757 status = request_firmware(&wl->fw.fw_bin[i], fw_name, device);
1757 if (status) { 1758 if (status) {
1758 printf("%s: fail to load firmware %s\n", 1759 printf("%s: fail to load firmware %s\n",
@@ -1760,7 +1761,7 @@ static int wl_request_fw(struct wl_info *wl, struct pci_dev *pdev)
1760 wl_release_fw(wl); 1761 wl_release_fw(wl);
1761 return status; 1762 return status;
1762 } 1763 }
1763 WL_NONE(("request fw %s\n", fw_name)); 1764 WL_NONE("request fw %s\n", fw_name);
1764 sprintf(fw_name, "%s_hdr-%d.fw", wl_firmwares[i], 1765 sprintf(fw_name, "%s_hdr-%d.fw", wl_firmwares[i],
1765 UCODE_LOADER_API_VER); 1766 UCODE_LOADER_API_VER);
1766 status = request_firmware(&wl->fw.fw_hdr[i], fw_name, device); 1767 status = request_firmware(&wl->fw.fw_hdr[i], fw_name, device);
@@ -1772,8 +1773,8 @@ static int wl_request_fw(struct wl_info *wl, struct pci_dev *pdev)
1772 } 1773 }
1773 wl->fw.hdr_num_entries[i] = 1774 wl->fw.hdr_num_entries[i] =
1774 wl->fw.fw_hdr[i]->size / (sizeof(struct wl_fw_hdr)); 1775 wl->fw.fw_hdr[i]->size / (sizeof(struct wl_fw_hdr));
1775 WL_NONE(("request fw %s find: %d entries\n", fw_name, 1776 WL_NONE("request fw %s find: %d entries\n",
1776 wl->fw.hdr_num_entries[i])); 1777 fw_name, wl->fw.hdr_num_entries[i]);
1777 } 1778 }
1778 wl->fw.fw_cnt = i; 1779 wl->fw.fw_cnt = i;
1779 return wl_ucode_data_init(wl); 1780 return wl_ucode_data_init(wl);
@@ -1811,16 +1812,16 @@ int wl_check_firmwares(struct wl_info *wl)
1811 if (fw == NULL && fw_hdr == NULL) { 1812 if (fw == NULL && fw_hdr == NULL) {
1812 break; 1813 break;
1813 } else if (fw == NULL || fw_hdr == NULL) { 1814 } else if (fw == NULL || fw_hdr == NULL) {
1814 WL_ERROR(("%s: invalid bin/hdr fw\n", __func__)); 1815 WL_ERROR("%s: invalid bin/hdr fw\n", __func__);
1815 rc = -EBADF; 1816 rc = -EBADF;
1816 } else if (fw_hdr->size % sizeof(struct wl_fw_hdr)) { 1817 } else if (fw_hdr->size % sizeof(struct wl_fw_hdr)) {
1817 WL_ERROR(("%s: non integral fw hdr file size %d/%d\n", 1818 WL_ERROR("%s: non integral fw hdr file size %d/%zu\n",
1818 __func__, fw_hdr->size, 1819 __func__, fw_hdr->size,
1819 sizeof(struct wl_fw_hdr))); 1820 sizeof(struct wl_fw_hdr));
1820 rc = -EBADF; 1821 rc = -EBADF;
1821 } else if (fw->size < MIN_FW_SIZE || fw->size > MAX_FW_SIZE) { 1822 } else if (fw->size < MIN_FW_SIZE || fw->size > MAX_FW_SIZE) {
1822 WL_ERROR(("%s: out of bounds fw file size %d\n", 1823 WL_ERROR("%s: out of bounds fw file size %d\n",
1823 __func__, fw->size)); 1824 __func__, fw->size);
1824 rc = -EBADF; 1825 rc = -EBADF;
1825 } else { 1826 } else {
1826 /* check if ucode section overruns firmware image */ 1827 /* check if ucode section overruns firmware image */
@@ -1829,15 +1830,15 @@ int wl_check_firmwares(struct wl_info *wl)
1829 entry++, ucode_hdr++) { 1830 entry++, ucode_hdr++) {
1830 if (ucode_hdr->offset + ucode_hdr->len > 1831 if (ucode_hdr->offset + ucode_hdr->len >
1831 fw->size) { 1832 fw->size) {
1832 WL_ERROR(("%s: conflicting bin/hdr\n", 1833 WL_ERROR("%s: conflicting bin/hdr\n",
1833 __func__)); 1834 __func__);
1834 rc = -EBADF; 1835 rc = -EBADF;
1835 } 1836 }
1836 } 1837 }
1837 } 1838 }
1838 } 1839 }
1839 if (rc == 0 && wl->fw.fw_cnt != i) { 1840 if (rc == 0 && wl->fw.fw_cnt != i) {
1840 WL_ERROR(("%s: invalid fw_cnt=%d\n", __func__, wl->fw.fw_cnt)); 1841 WL_ERROR("%s: invalid fw_cnt=%d\n", __func__, wl->fw.fw_cnt);
1841 rc = -EBADF; 1842 rc = -EBADF;
1842 } 1843 }
1843 return rc; 1844 return rc;
diff --git a/drivers/staging/brcm80211/sys/wlc_alloc.c b/drivers/staging/brcm80211/sys/wlc_alloc.c
index 9af2d17a40c0..746439e8fd57 100644
--- a/drivers/staging/brcm80211/sys/wlc_alloc.c
+++ b/drivers/staging/brcm80211/sys/wlc_alloc.c
@@ -43,7 +43,7 @@ void *wlc_calloc(struct osl_info *osh, uint unit, uint size)
43 43
44 item = kzalloc(size, GFP_ATOMIC); 44 item = kzalloc(size, GFP_ATOMIC);
45 if (item == NULL) 45 if (item == NULL)
46 WL_ERROR(("wl%d: %s: out of memory\n", unit, __func__)); 46 WL_ERROR("wl%d: %s: out of memory\n", unit, __func__);
47 return item; 47 return item;
48} 48}
49 49
diff --git a/drivers/staging/brcm80211/sys/wlc_ampdu.c b/drivers/staging/brcm80211/sys/wlc_ampdu.c
index 0419c528e40e..d749917f5912 100644
--- a/drivers/staging/brcm80211/sys/wlc_ampdu.c
+++ b/drivers/staging/brcm80211/sys/wlc_ampdu.c
@@ -174,7 +174,8 @@ struct ampdu_info *wlc_ampdu_attach(struct wlc_info *wlc)
174 174
175 ampdu = kzalloc(sizeof(struct ampdu_info), GFP_ATOMIC); 175 ampdu = kzalloc(sizeof(struct ampdu_info), GFP_ATOMIC);
176 if (!ampdu) { 176 if (!ampdu) {
177 WL_ERROR(("wl%d: wlc_ampdu_attach: out of mem\n", wlc->pub->unit)); 177 WL_ERROR("wl%d: wlc_ampdu_attach: out of mem\n",
178 wlc->pub->unit);
178 return NULL; 179 return NULL;
179 } 180 }
180 ampdu->wlc = wlc; 181 ampdu->wlc = wlc;
@@ -244,7 +245,7 @@ void scb_ampdu_cleanup(struct ampdu_info *ampdu, struct scb *scb)
244 scb_ampdu_t *scb_ampdu = SCB_AMPDU_CUBBY(ampdu, scb); 245 scb_ampdu_t *scb_ampdu = SCB_AMPDU_CUBBY(ampdu, scb);
245 u8 tid; 246 u8 tid;
246 247
247 WL_AMPDU_UPDN(("scb_ampdu_cleanup: enter\n")); 248 WL_AMPDU_UPDN("scb_ampdu_cleanup: enter\n");
248 ASSERT(scb_ampdu); 249 ASSERT(scb_ampdu);
249 250
250 for (tid = 0; tid < AMPDU_MAX_SCB_TID; tid++) { 251 for (tid = 0; tid < AMPDU_MAX_SCB_TID; tid++) {
@@ -257,7 +258,7 @@ void scb_ampdu_cleanup(struct ampdu_info *ampdu, struct scb *scb)
257 */ 258 */
258void wlc_ampdu_reset(struct ampdu_info *ampdu) 259void wlc_ampdu_reset(struct ampdu_info *ampdu)
259{ 260{
260 WL_NONE(("%s: Entering\n", __func__)); 261 WL_NONE("%s: Entering\n", __func__);
261} 262}
262 263
263static void scb_ampdu_update_config(struct ampdu_info *ampdu, struct scb *scb) 264static void scb_ampdu_update_config(struct ampdu_info *ampdu, struct scb *scb)
@@ -338,7 +339,7 @@ static int wlc_ffpld_check_txfunfl(struct wlc_info *wlc, int fid)
338 M_UCODE_MACSTAT + offsetof(macstat_t, txfunfl[fid])); 339 M_UCODE_MACSTAT + offsetof(macstat_t, txfunfl[fid]));
339 new_txunfl = (u16) (cur_txunfl - fifo->prev_txfunfl); 340 new_txunfl = (u16) (cur_txunfl - fifo->prev_txfunfl);
340 if (new_txunfl == 0) { 341 if (new_txunfl == 0) {
341 WL_FFPLD(("check_txunfl : TX status FRAG set but no tx underflows\n")); 342 WL_FFPLD("check_txunfl : TX status FRAG set but no tx underflows\n");
342 return -1; 343 return -1;
343 } 344 }
344 fifo->prev_txfunfl = cur_txunfl; 345 fifo->prev_txfunfl = cur_txunfl;
@@ -348,7 +349,7 @@ static int wlc_ffpld_check_txfunfl(struct wlc_info *wlc, int fid)
348 349
349 /* check if fifo is big enough */ 350 /* check if fifo is big enough */
350 if (wlc_xmtfifo_sz_get(wlc, fid, &xmtfifo_sz)) { 351 if (wlc_xmtfifo_sz_get(wlc, fid, &xmtfifo_sz)) {
351 WL_FFPLD(("check_txunfl : get xmtfifo_sz failed.\n")); 352 WL_FFPLD("check_txunfl : get xmtfifo_sz failed\n");
352 return -1; 353 return -1;
353 } 354 }
354 355
@@ -362,8 +363,8 @@ static int wlc_ffpld_check_txfunfl(struct wlc_info *wlc, int fid)
362 if (fifo->accum_txfunfl < 10) 363 if (fifo->accum_txfunfl < 10)
363 return 0; 364 return 0;
364 365
365 WL_FFPLD(("ampdu_count %d tx_underflows %d\n", 366 WL_FFPLD("ampdu_count %d tx_underflows %d\n",
366 current_ampdu_cnt, fifo->accum_txfunfl)); 367 current_ampdu_cnt, fifo->accum_txfunfl);
367 368
368 /* 369 /*
369 compute the current ratio of tx unfl per ampdu. 370 compute the current ratio of tx unfl per ampdu.
@@ -416,8 +417,8 @@ static int wlc_ffpld_check_txfunfl(struct wlc_info *wlc, int fid)
416 (max_mpdu * FFPLD_MPDU_SIZE - fifo->ampdu_pld_size)) 417 (max_mpdu * FFPLD_MPDU_SIZE - fifo->ampdu_pld_size))
417 / (max_mpdu * FFPLD_MPDU_SIZE)) * 100; 418 / (max_mpdu * FFPLD_MPDU_SIZE)) * 100;
418 419
419 WL_FFPLD(("DMA estimated transfer rate %d; pre-load size %d\n", 420 WL_FFPLD("DMA estimated transfer rate %d; pre-load size %d\n",
420 fifo->dmaxferrate, fifo->ampdu_pld_size)); 421 fifo->dmaxferrate, fifo->ampdu_pld_size);
421 } else { 422 } else {
422 423
423 /* decrease ampdu size */ 424 /* decrease ampdu size */
@@ -552,7 +553,7 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
552 wlc_ampdu_agg(ampdu, scb, p, tid); 553 wlc_ampdu_agg(ampdu, scb, p, tid);
553 554
554 if (wlc->block_datafifo) { 555 if (wlc->block_datafifo) {
555 WL_ERROR(("%s: Fifo blocked\n", __func__)); 556 WL_ERROR("%s: Fifo blocked\n", __func__);
556 return BCME_BUSY; 557 return BCME_BUSY;
557 } 558 }
558 rr_retry_limit = ampdu->rr_retry_limit_tid[tid]; 559 rr_retry_limit = ampdu->rr_retry_limit_tid[tid];
@@ -567,7 +568,7 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
567 if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) { 568 if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
568 err = wlc_prep_pdu(wlc, p, &fifo); 569 err = wlc_prep_pdu(wlc, p, &fifo);
569 } else { 570 } else {
570 WL_ERROR(("%s: AMPDU flag is off!\n", __func__)); 571 WL_ERROR("%s: AMPDU flag is off!\n", __func__);
571 *pdu = NULL; 572 *pdu = NULL;
572 err = 0; 573 err = 0;
573 break; 574 break;
@@ -575,14 +576,16 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
575 576
576 if (err) { 577 if (err) {
577 if (err == BCME_BUSY) { 578 if (err == BCME_BUSY) {
578 WL_ERROR(("wl%d: wlc_sendampdu: prep_xdu retry; seq 0x%x\n", wlc->pub->unit, seq)); 579 WL_ERROR("wl%d: wlc_sendampdu: prep_xdu retry; seq 0x%x\n",
580 wlc->pub->unit, seq);
579 WLCNTINCR(ampdu->cnt->sduretry); 581 WLCNTINCR(ampdu->cnt->sduretry);
580 *pdu = p; 582 *pdu = p;
581 break; 583 break;
582 } 584 }
583 585
584 /* error in the packet; reject it */ 586 /* error in the packet; reject it */
585 WL_AMPDU_ERR(("wl%d: wlc_sendampdu: prep_xdu rejected; seq 0x%x\n", wlc->pub->unit, seq)); 587 WL_AMPDU_ERR("wl%d: wlc_sendampdu: prep_xdu rejected; seq 0x%x\n",
588 wlc->pub->unit, seq);
586 WLCNTINCR(ampdu->cnt->sdurejected); 589 WLCNTINCR(ampdu->cnt->sdurejected);
587 590
588 *pdu = NULL; 591 *pdu = NULL;
@@ -624,8 +627,8 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
624 ndelim = txh->RTSPLCPFallback[AMPDU_FBR_NULL_DELIM]; 627 ndelim = txh->RTSPLCPFallback[AMPDU_FBR_NULL_DELIM];
625 seg_cnt += 1; 628 seg_cnt += 1;
626 629
627 WL_AMPDU_TX(("wl%d: wlc_sendampdu: mpdu %d plcp_len %d\n", 630 WL_AMPDU_TX("wl%d: wlc_sendampdu: mpdu %d plcp_len %d\n",
628 wlc->pub->unit, count, len)); 631 wlc->pub->unit, count, len);
629 632
630 /* 633 /*
631 * aggregateable mpdu. For ucode/hw agg, 634 * aggregateable mpdu. For ucode/hw agg,
@@ -656,7 +659,8 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
656 659
657 dma_len += (u16) pkttotlen(osh, p); 660 dma_len += (u16) pkttotlen(osh, p);
658 661
659 WL_AMPDU_TX(("wl%d: wlc_sendampdu: ampdu_len %d seg_cnt %d null delim %d\n", wlc->pub->unit, ampdu_len, seg_cnt, ndelim)); 662 WL_AMPDU_TX("wl%d: wlc_sendampdu: ampdu_len %d seg_cnt %d null delim %d\n",
663 wlc->pub->unit, ampdu_len, seg_cnt, ndelim);
660 664
661 txh->MacTxControlLow = htol16(mcl); 665 txh->MacTxControlLow = htol16(mcl);
662 666
@@ -686,8 +690,8 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
686 min(scb_ampdu->max_rxlen, 690 min(scb_ampdu->max_rxlen,
687 ampdu->max_txlen[mcs][is40][sgi]); 691 ampdu->max_txlen[mcs][is40][sgi]);
688 692
689 WL_NONE(("sendampdu: sgi %d, is40 %d, mcs %d\n", sgi, 693 WL_NONE("sendampdu: sgi %d, is40 %d, mcs %d\n",
690 is40, mcs)); 694 sgi, is40, mcs);
691 695
692 maxlen = 64 * 1024; /* XXX Fix me to honor real max_rxlen */ 696 maxlen = 64 * 1024; /* XXX Fix me to honor real max_rxlen */
693 697
@@ -730,13 +734,14 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
730 /* test whether to add more */ 734 /* test whether to add more */
731 if ((MCS_RATE(mcs, true, false) >= f->dmaxferrate) && 735 if ((MCS_RATE(mcs, true, false) >= f->dmaxferrate) &&
732 (count == f->mcs2ampdu_table[mcs])) { 736 (count == f->mcs2ampdu_table[mcs])) {
733 WL_AMPDU_ERR(("wl%d: PR 37644: stopping ampdu at %d for mcs %d", wlc->pub->unit, count, mcs)); 737 WL_AMPDU_ERR("wl%d: PR 37644: stopping ampdu at %d for mcs %d\n",
738 wlc->pub->unit, count, mcs);
734 break; 739 break;
735 } 740 }
736 741
737 if (count == scb_ampdu->max_pdu) { 742 if (count == scb_ampdu->max_pdu) {
738 WL_NONE(("Stop taking from q, reached %d deep\n", 743 WL_NONE("Stop taking from q, reached %d deep\n",
739 scb_ampdu->max_pdu)); 744 scb_ampdu->max_pdu);
740 break; 745 break;
741 } 746 }
742 747
@@ -754,15 +759,16 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
754 759
755 if ((plen + ampdu_len) > maxlen) { 760 if ((plen + ampdu_len) > maxlen) {
756 p = NULL; 761 p = NULL;
757 WL_ERROR(("%s: Bogus plen #1\n", 762 WL_ERROR("%s: Bogus plen #1\n",
758 __func__)); 763 __func__);
759 ASSERT(3 == 4); 764 ASSERT(3 == 4);
760 continue; 765 continue;
761 } 766 }
762 767
763 /* check if there are enough descriptors available */ 768 /* check if there are enough descriptors available */
764 if (TXAVAIL(wlc, fifo) <= (seg_cnt + 1)) { 769 if (TXAVAIL(wlc, fifo) <= (seg_cnt + 1)) {
765 WL_ERROR(("%s: No fifo space !!!!!!\n", __func__)); 770 WL_ERROR("%s: No fifo space !!!!!!\n",
771 __func__);
766 p = NULL; 772 p = NULL;
767 continue; 773 continue;
768 } 774 }
@@ -869,13 +875,14 @@ wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
869 WLC_SET_MIMO_PLCP_AMPDU(txh->FragPLCPFallback); 875 WLC_SET_MIMO_PLCP_AMPDU(txh->FragPLCPFallback);
870 } 876 }
871 877
872 WL_AMPDU_TX(("wl%d: wlc_sendampdu: count %d ampdu_len %d\n", 878 WL_AMPDU_TX("wl%d: wlc_sendampdu: count %d ampdu_len %d\n",
873 wlc->pub->unit, count, ampdu_len)); 879 wlc->pub->unit, count, ampdu_len);
874 880
875 /* inform rate_sel if it this is a rate probe pkt */ 881 /* inform rate_sel if it this is a rate probe pkt */
876 frameid = ltoh16(txh->TxFrameID); 882 frameid = ltoh16(txh->TxFrameID);
877 if (frameid & TXFID_RATE_PROBE_MASK) { 883 if (frameid & TXFID_RATE_PROBE_MASK) {
878 WL_ERROR(("%s: XXX what to do with TXFID_RATE_PROBE_MASK!?\n", __func__)); 884 WL_ERROR("%s: XXX what to do with TXFID_RATE_PROBE_MASK!?\n",
885 __func__);
879 } 886 }
880 for (i = 0; i < count; i++) 887 for (i = 0; i < count; i++)
881 wlc_txfifo(wlc, fifo, pkt[i], i == (count - 1), 888 wlc_txfifo(wlc, fifo, pkt[i], i == (count - 1),
@@ -1029,13 +1036,16 @@ wlc_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
1029 if (supr_status) { 1036 if (supr_status) {
1030 update_rate = false; 1037 update_rate = false;
1031 if (supr_status == TX_STATUS_SUPR_BADCH) { 1038 if (supr_status == TX_STATUS_SUPR_BADCH) {
1032 WL_ERROR(("%s: Pkt tx suppressed, illegal channel possibly %d\n", __func__, CHSPEC_CHANNEL(wlc->default_bss->chanspec))); 1039 WL_ERROR("%s: Pkt tx suppressed, illegal channel possibly %d\n",
1040 __func__,
1041 CHSPEC_CHANNEL(wlc->default_bss->chanspec));
1033 } else { 1042 } else {
1034 if (supr_status == TX_STATUS_SUPR_FRAG) 1043 if (supr_status == TX_STATUS_SUPR_FRAG)
1035 WL_NONE(("%s: AMPDU frag err\n", 1044 WL_NONE("%s: AMPDU frag err\n",
1036 __func__)); 1045 __func__);
1037 else 1046 else
1038 WL_ERROR(("%s: wlc_ampdu_dotxstatus: supr_status 0x%x\n", __func__, supr_status)); 1047 WL_ERROR("%s: wlc_ampdu_dotxstatus: supr_status 0x%x\n",
1048 __func__, supr_status);
1039 } 1049 }
1040 /* no need to retry for badch; will fail again */ 1050 /* no need to retry for badch; will fail again */
1041 if (supr_status == TX_STATUS_SUPR_BADCH || 1051 if (supr_status == TX_STATUS_SUPR_BADCH ||
@@ -1059,7 +1069,8 @@ wlc_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
1059 } else if (txs->phyerr) { 1069 } else if (txs->phyerr) {
1060 update_rate = false; 1070 update_rate = false;
1061 WLCNTINCR(wlc->pub->_cnt->txphyerr); 1071 WLCNTINCR(wlc->pub->_cnt->txphyerr);
1062 WL_ERROR(("wl%d: wlc_ampdu_dotxstatus: tx phy error (0x%x)\n", wlc->pub->unit, txs->phyerr)); 1072 WL_ERROR("wl%d: wlc_ampdu_dotxstatus: tx phy error (0x%x)\n",
1073 wlc->pub->unit, txs->phyerr);
1063 1074
1064#ifdef BCMDBG 1075#ifdef BCMDBG
1065 if (WL_ERROR_ON()) { 1076 if (WL_ERROR_ON()) {
@@ -1091,10 +1102,9 @@ wlc_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
1091 if (ba_recd) { 1102 if (ba_recd) {
1092 bindex = MODSUB_POW2(seq, start_seq, SEQNUM_MAX); 1103 bindex = MODSUB_POW2(seq, start_seq, SEQNUM_MAX);
1093 1104
1094 WL_AMPDU_TX(("%s: tid %d seq is %d, start_seq is %d, " 1105 WL_AMPDU_TX("%s: tid %d seq is %d, start_seq is %d, bindex is %d set %d, index %d\n",
1095 "bindex is %d set %d, index %d\n", 1106 __func__, tid, seq, start_seq, bindex,
1096 __func__, tid, seq, start_seq, bindex, 1107 isset(bitmap, bindex), index);
1097 isset(bitmap, bindex), index));
1098 1108
1099 /* if acked then clear bit and free packet */ 1109 /* if acked then clear bit and free packet */
1100 if ((bindex < AMPDU_TX_BA_MAX_WSIZE) 1110 if ((bindex < AMPDU_TX_BA_MAX_WSIZE)
@@ -1147,7 +1157,8 @@ wlc_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
1147 IEEE80211_TX_STAT_AMPDU_NO_BACK; 1157 IEEE80211_TX_STAT_AMPDU_NO_BACK;
1148 skb_pull(p, D11_PHY_HDR_LEN); 1158 skb_pull(p, D11_PHY_HDR_LEN);
1149 skb_pull(p, D11_TXH_LEN); 1159 skb_pull(p, D11_TXH_LEN);
1150 WL_ERROR(("%s: BA Timeout, seq %d, in_transit %d\n", SHORTNAME, seq, ini->tx_in_transit)); 1160 WL_ERROR("%s: BA Timeout, seq %d, in_transit %d\n",
1161 SHORTNAME, seq, ini->tx_in_transit);
1151 ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw, 1162 ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw,
1152 p); 1163 p);
1153 } 1164 }
@@ -1183,8 +1194,8 @@ ampdu_cleanup_tid_ini(struct ampdu_info *ampdu, scb_ampdu_t *scb_ampdu, u8 tid,
1183 if (!ini) 1194 if (!ini)
1184 return; 1195 return;
1185 1196
1186 WL_AMPDU_CTL(("wl%d: ampdu_cleanup_tid_ini: tid %d\n", 1197 WL_AMPDU_CTL("wl%d: ampdu_cleanup_tid_ini: tid %d\n",
1187 ampdu->wlc->pub->unit, tid)); 1198 ampdu->wlc->pub->unit, tid);
1188 1199
1189 if (ini->tx_in_transit && !force) 1200 if (ini->tx_in_transit && !force)
1190 return; 1201 return;
@@ -1210,7 +1221,7 @@ static scb_ampdu_tid_ini_t *wlc_ampdu_init_tid_ini(struct ampdu_info *ampdu,
1210 1221
1211 /* check for per-tid control of ampdu */ 1222 /* check for per-tid control of ampdu */
1212 if (!ampdu->ini_enable[tid]) { 1223 if (!ampdu->ini_enable[tid]) {
1213 WL_ERROR(("%s: Rejecting tid %d\n", __func__, tid)); 1224 WL_ERROR("%s: Rejecting tid %d\n", __func__, tid);
1214 return NULL; 1225 return NULL;
1215 } 1226 }
1216 1227
@@ -1231,13 +1242,13 @@ int wlc_ampdu_set(struct ampdu_info *ampdu, bool on)
1231 1242
1232 if (on) { 1243 if (on) {
1233 if (!N_ENAB(wlc->pub)) { 1244 if (!N_ENAB(wlc->pub)) {
1234 WL_AMPDU_ERR(("wl%d: driver not nmode enabled\n", 1245 WL_AMPDU_ERR("wl%d: driver not nmode enabled\n",
1235 wlc->pub->unit)); 1246 wlc->pub->unit);
1236 return BCME_UNSUPPORTED; 1247 return BCME_UNSUPPORTED;
1237 } 1248 }
1238 if (!wlc_ampdu_cap(ampdu)) { 1249 if (!wlc_ampdu_cap(ampdu)) {
1239 WL_AMPDU_ERR(("wl%d: device not ampdu capable\n", 1250 WL_AMPDU_ERR("wl%d: device not ampdu capable\n",
1240 wlc->pub->unit)); 1251 wlc->pub->unit);
1241 return BCME_UNSUPPORTED; 1252 return BCME_UNSUPPORTED;
1242 } 1253 }
1243 wlc->pub->_ampdu = on; 1254 wlc->pub->_ampdu = on;
diff --git a/drivers/staging/brcm80211/sys/wlc_antsel.c b/drivers/staging/brcm80211/sys/wlc_antsel.c
index 27558fa02ba7..402ddf8f3371 100644
--- a/drivers/staging/brcm80211/sys/wlc_antsel.c
+++ b/drivers/staging/brcm80211/sys/wlc_antsel.c
@@ -102,7 +102,7 @@ struct antsel_info *wlc_antsel_attach(struct wlc_info *wlc,
102 102
103 asi = kzalloc(sizeof(struct antsel_info), GFP_ATOMIC); 103 asi = kzalloc(sizeof(struct antsel_info), GFP_ATOMIC);
104 if (!asi) { 104 if (!asi) {
105 WL_ERROR(("wl%d: wlc_antsel_attach: out of mem\n", pub->unit)); 105 WL_ERROR("wl%d: wlc_antsel_attach: out of mem\n", pub->unit);
106 return NULL; 106 return NULL;
107 } 107 }
108 108
@@ -131,7 +131,7 @@ struct antsel_info *wlc_antsel_attach(struct wlc_info *wlc,
131 asi->antsel_avail = false; 131 asi->antsel_avail = false;
132 } else { 132 } else {
133 asi->antsel_avail = false; 133 asi->antsel_avail = false;
134 WL_ERROR(("wlc_antsel_attach: 2o3 board cfg invalid\n")); 134 WL_ERROR("wlc_antsel_attach: 2o3 board cfg invalid\n");
135 ASSERT(0); 135 ASSERT(0);
136 } 136 }
137 break; 137 break;
diff --git a/drivers/staging/brcm80211/sys/wlc_bmac.c b/drivers/staging/brcm80211/sys/wlc_bmac.c
index 0c2625dc440b..69f600affa46 100644
--- a/drivers/staging/brcm80211/sys/wlc_bmac.c
+++ b/drivers/staging/brcm80211/sys/wlc_bmac.c
@@ -217,18 +217,20 @@ static void WLBANDINITFN(wlc_ucode_bsinit) (struct wlc_hw_info *wlc_hw)
217 if (WLCISNPHY(wlc_hw->band)) { 217 if (WLCISNPHY(wlc_hw->band)) {
218 wlc_write_inits(wlc_hw, d11n0bsinitvals16); 218 wlc_write_inits(wlc_hw, d11n0bsinitvals16);
219 } else { 219 } else {
220 WL_ERROR(("%s: wl%d: unsupported phy in corerev %d\n", 220 WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n",
221 __func__, wlc_hw->unit, wlc_hw->corerev)); 221 __func__, wlc_hw->unit, wlc_hw->corerev);
222 } 222 }
223 } else { 223 } else {
224 if (D11REV_IS(wlc_hw->corerev, 24)) { 224 if (D11REV_IS(wlc_hw->corerev, 24)) {
225 if (WLCISLCNPHY(wlc_hw->band)) { 225 if (WLCISLCNPHY(wlc_hw->band)) {
226 wlc_write_inits(wlc_hw, d11lcn0bsinitvals24); 226 wlc_write_inits(wlc_hw, d11lcn0bsinitvals24);
227 } else 227 } else
228 WL_ERROR(("%s: wl%d: unsupported phy in corerev %d\n", __func__, wlc_hw->unit, wlc_hw->corerev)); 228 WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n",
229 __func__, wlc_hw->unit,
230 wlc_hw->corerev);
229 } else { 231 } else {
230 WL_ERROR(("%s: wl%d: unsupported corerev %d\n", 232 WL_ERROR("%s: wl%d: unsupported corerev %d\n",
231 __func__, wlc_hw->unit, wlc_hw->corerev)); 233 __func__, wlc_hw->unit, wlc_hw->corerev);
232 } 234 }
233 } 235 }
234} 236}
@@ -240,7 +242,7 @@ static u32 WLBANDINITFN(wlc_setband_inact) (struct wlc_info *wlc, uint bandunit)
240 u32 macintmask; 242 u32 macintmask;
241 u32 tmp; 243 u32 tmp;
242 244
243 WL_TRACE(("wl%d: wlc_setband_inact\n", wlc_hw->unit)); 245 WL_TRACE("wl%d: wlc_setband_inact\n", wlc_hw->unit);
244 246
245 ASSERT(bandunit != wlc_hw->band->bandunit); 247 ASSERT(bandunit != wlc_hw->band->bandunit);
246 ASSERT(si_iscoreup(wlc_hw->sih)); 248 ASSERT(si_iscoreup(wlc_hw->sih));
@@ -281,7 +283,7 @@ wlc_bmac_recv(struct wlc_hw_info *wlc_hw, uint fifo, bool bound)
281 u32 tsf_h, tsf_l; 283 u32 tsf_h, tsf_l;
282 wlc_d11rxhdr_t *wlc_rxhdr = NULL; 284 wlc_d11rxhdr_t *wlc_rxhdr = NULL;
283 285
284 WL_TRACE(("wl%d: %s\n", wlc_hw->unit, __func__)); 286 WL_TRACE("wl%d: %s\n", wlc_hw->unit, __func__);
285 /* gather received frames */ 287 /* gather received frames */
286 while ((p = dma_rx(wlc_hw->di[fifo]))) { 288 while ((p = dma_rx(wlc_hw->di[fifo]))) {
287 289
@@ -333,7 +335,7 @@ bool BCMFASTPATH wlc_dpc(struct wlc_info *wlc, bool bounded)
333 bool fatal = false; 335 bool fatal = false;
334 336
335 if (DEVICEREMOVED(wlc)) { 337 if (DEVICEREMOVED(wlc)) {
336 WL_ERROR(("wl%d: %s: dead chip\n", wlc_hw->unit, __func__)); 338 WL_ERROR("wl%d: %s: dead chip\n", wlc_hw->unit, __func__);
337 wl_down(wlc->wl); 339 wl_down(wlc->wl);
338 return false; 340 return false;
339 } 341 }
@@ -342,8 +344,8 @@ bool BCMFASTPATH wlc_dpc(struct wlc_info *wlc, bool bounded)
342 macintstatus = wlc->macintstatus; 344 macintstatus = wlc->macintstatus;
343 wlc->macintstatus = 0; 345 wlc->macintstatus = 0;
344 346
345 WL_TRACE(("wl%d: wlc_dpc: macintstatus 0x%x\n", wlc_hw->unit, 347 WL_TRACE("wl%d: wlc_dpc: macintstatus 0x%x\n",
346 macintstatus)); 348 wlc_hw->unit, macintstatus);
347 349
348 if (macintstatus & MI_PRQ) { 350 if (macintstatus & MI_PRQ) {
349 /* Process probe request FIFO */ 351 /* Process probe request FIFO */
@@ -366,7 +368,7 @@ bool BCMFASTPATH wlc_dpc(struct wlc_info *wlc, bool bounded)
366 if (wlc_bmac_txstatus(wlc->hw, bounded, &fatal)) 368 if (wlc_bmac_txstatus(wlc->hw, bounded, &fatal))
367 wlc->macintstatus |= MI_TFS; 369 wlc->macintstatus |= MI_TFS;
368 if (fatal) { 370 if (fatal) {
369 WL_ERROR(("MI_TFS: fatal\n")); 371 WL_ERROR("MI_TFS: fatal\n");
370 goto fatal; 372 goto fatal;
371 } 373 }
372 } 374 }
@@ -376,7 +378,7 @@ bool BCMFASTPATH wlc_dpc(struct wlc_info *wlc, bool bounded)
376 378
377 /* ATIM window end */ 379 /* ATIM window end */
378 if (macintstatus & MI_ATIMWINEND) { 380 if (macintstatus & MI_ATIMWINEND) {
379 WL_TRACE(("wlc_isr: end of ATIM window\n")); 381 WL_TRACE("wlc_isr: end of ATIM window\n");
380 382
381 OR_REG(wlc_hw->osh, &regs->maccommand, wlc->qvalid); 383 OR_REG(wlc_hw->osh, &regs->maccommand, wlc->qvalid);
382 wlc->qvalid = 0; 384 wlc->qvalid = 0;
@@ -397,7 +399,7 @@ bool BCMFASTPATH wlc_dpc(struct wlc_info *wlc, bool bounded)
397 /* TX FIFO suspend/flush completion */ 399 /* TX FIFO suspend/flush completion */
398 if (macintstatus & MI_TXSTOP) { 400 if (macintstatus & MI_TXSTOP) {
399 if (wlc_bmac_tx_fifo_suspended(wlc_hw, TX_DATA_FIFO)) { 401 if (wlc_bmac_tx_fifo_suspended(wlc_hw, TX_DATA_FIFO)) {
400 /* WL_ERROR(("dpc: fifo_suspend_comlete\n")); */ 402 /* WL_ERROR("dpc: fifo_suspend_comlete\n"); */
401 } 403 }
402 } 404 }
403 405
@@ -407,7 +409,8 @@ bool BCMFASTPATH wlc_dpc(struct wlc_info *wlc, bool bounded)
407 } 409 }
408 410
409 if (macintstatus & MI_GP0) { 411 if (macintstatus & MI_GP0) {
410 WL_ERROR(("wl%d: PSM microcode watchdog fired at %d (seconds). Resetting.\n", wlc_hw->unit, wlc_hw->now)); 412 WL_ERROR("wl%d: PSM microcode watchdog fired at %d (seconds). Resetting.\n",
413 wlc_hw->unit, wlc_hw->now);
411 414
412 printk_once("%s : PSM Watchdog, chipid 0x%x, chiprev 0x%x\n", 415 printk_once("%s : PSM Watchdog, chipid 0x%x, chiprev 0x%x\n",
413 __func__, wlc_hw->sih->chip, 416 __func__, wlc_hw->sih->chip,
@@ -429,7 +432,8 @@ bool BCMFASTPATH wlc_dpc(struct wlc_info *wlc, bool bounded)
429 u32 rfd = R_REG(wlc_hw->osh, &regs->phydebug) & PDBG_RFD; 432 u32 rfd = R_REG(wlc_hw->osh, &regs->phydebug) & PDBG_RFD;
430#endif 433#endif
431 434
432 WL_ERROR(("wl%d: MAC Detected a change on the RF Disable Input 0x%x\n", wlc_hw->unit, rfd)); 435 WL_ERROR("wl%d: MAC Detected a change on the RF Disable Input 0x%x\n",
436 wlc_hw->unit, rfd);
433 437
434 WLCNTINCR(wlc->pub->_cnt->rfdisable); 438 WLCNTINCR(wlc->pub->_cnt->rfdisable);
435 } 439 }
@@ -457,7 +461,7 @@ void wlc_bmac_watchdog(void *arg)
457 struct wlc_info *wlc = (struct wlc_info *) arg; 461 struct wlc_info *wlc = (struct wlc_info *) arg;
458 struct wlc_hw_info *wlc_hw = wlc->hw; 462 struct wlc_hw_info *wlc_hw = wlc->hw;
459 463
460 WL_TRACE(("wl%d: wlc_bmac_watchdog\n", wlc_hw->unit)); 464 WL_TRACE("wl%d: wlc_bmac_watchdog\n", wlc_hw->unit);
461 465
462 if (!wlc_hw->up) 466 if (!wlc_hw->up)
463 return; 467 return;
@@ -483,8 +487,8 @@ wlc_bmac_set_chanspec(struct wlc_hw_info *wlc_hw, chanspec_t chanspec,
483{ 487{
484 uint bandunit; 488 uint bandunit;
485 489
486 WL_TRACE(("wl%d: wlc_bmac_set_chanspec 0x%x\n", wlc_hw->unit, 490 WL_TRACE("wl%d: wlc_bmac_set_chanspec 0x%x\n",
487 chanspec)); 491 wlc_hw->unit, chanspec);
488 492
489 wlc_hw->chanspec = chanspec; 493 wlc_hw->chanspec = chanspec;
490 494
@@ -594,7 +598,8 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme)
594 dma_addrwidth(wlc_hw->sih, DMAREG(wlc_hw, DMA_TX, 0)); 598 dma_addrwidth(wlc_hw->sih, DMAREG(wlc_hw, DMA_TX, 0));
595 599
596 if (!wl_alloc_dma_resources(wlc_hw->wlc->wl, addrwidth)) { 600 if (!wl_alloc_dma_resources(wlc_hw->wlc->wl, addrwidth)) {
597 WL_ERROR(("wl%d: wlc_attach: alloc_dma_resources failed\n", unit)); 601 WL_ERROR("wl%d: wlc_attach: alloc_dma_resources failed\n",
602 unit);
598 return false; 603 return false;
599 } 604 }
600 605
@@ -667,8 +672,7 @@ static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme)
667/* Cleaner to leave this as if with AP defined */ 672/* Cleaner to leave this as if with AP defined */
668 673
669 if (dma_attach_err) { 674 if (dma_attach_err) {
670 WL_ERROR(("wl%d: wlc_attach: dma_attach failed\n", 675 WL_ERROR("wl%d: wlc_attach: dma_attach failed\n", unit);
671 unit));
672 return false; 676 return false;
673 } 677 }
674 678
@@ -717,8 +721,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
717 bool wme = false; 721 bool wme = false;
718 shared_phy_params_t sha_params; 722 shared_phy_params_t sha_params;
719 723
720 WL_TRACE(("wl%d: wlc_bmac_attach: vendor 0x%x device 0x%x\n", unit, 724 WL_TRACE("wl%d: wlc_bmac_attach: vendor 0x%x device 0x%x\n",
721 vendor, device)); 725 unit, vendor, device);
722 726
723 ASSERT(sizeof(wlc_d11rxhdr_t) <= WL_HWRXOFF); 727 ASSERT(sizeof(wlc_d11rxhdr_t) <= WL_HWRXOFF);
724 728
@@ -742,7 +746,7 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
742 wlc_hw->sih = si_attach((uint) device, osh, regsva, bustype, btparam, 746 wlc_hw->sih = si_attach((uint) device, osh, regsva, bustype, btparam,
743 &wlc_hw->vars, &wlc_hw->vars_size); 747 &wlc_hw->vars, &wlc_hw->vars_size);
744 if (wlc_hw->sih == NULL) { 748 if (wlc_hw->sih == NULL) {
745 WL_ERROR(("wl%d: wlc_bmac_attach: si_attach failed\n", unit)); 749 WL_ERROR("wl%d: wlc_bmac_attach: si_attach failed\n", unit);
746 err = 11; 750 err = 11;
747 goto fail; 751 goto fail;
748 } 752 }
@@ -762,21 +766,22 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
762 var = getvar(vars, "vendid"); 766 var = getvar(vars, "vendid");
763 if (var) { 767 if (var) {
764 vendor = (u16) simple_strtoul(var, NULL, 0); 768 vendor = (u16) simple_strtoul(var, NULL, 0);
765 WL_ERROR(("Overriding vendor id = 0x%x\n", vendor)); 769 WL_ERROR("Overriding vendor id = 0x%x\n", vendor);
766 } 770 }
767 var = getvar(vars, "devid"); 771 var = getvar(vars, "devid");
768 if (var) { 772 if (var) {
769 u16 devid = (u16) simple_strtoul(var, NULL, 0); 773 u16 devid = (u16) simple_strtoul(var, NULL, 0);
770 if (devid != 0xffff) { 774 if (devid != 0xffff) {
771 device = devid; 775 device = devid;
772 WL_ERROR(("Overriding device id = 0x%x\n", 776 WL_ERROR("Overriding device id = 0x%x\n",
773 device)); 777 device);
774 } 778 }
775 } 779 }
776 780
777 /* verify again the device is supported */ 781 /* verify again the device is supported */
778 if (!wlc_chipmatch(vendor, device)) { 782 if (!wlc_chipmatch(vendor, device)) {
779 WL_ERROR(("wl%d: wlc_bmac_attach: Unsupported vendor/device (0x%x/0x%x)\n", unit, vendor, device)); 783 WL_ERROR("wl%d: wlc_bmac_attach: Unsupported vendor/device (0x%x/0x%x)\n",
784 unit, vendor, device);
780 err = 12; 785 err = 12;
781 goto fail; 786 goto fail;
782 } 787 }
@@ -811,7 +816,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
811 wlc_bmac_corereset(wlc_hw, WLC_USE_COREFLAGS); 816 wlc_bmac_corereset(wlc_hw, WLC_USE_COREFLAGS);
812 817
813 if (!wlc_bmac_validate_chip_access(wlc_hw)) { 818 if (!wlc_bmac_validate_chip_access(wlc_hw)) {
814 WL_ERROR(("wl%d: wlc_bmac_attach: validate_chip_access failed\n", unit)); 819 WL_ERROR("wl%d: wlc_bmac_attach: validate_chip_access failed\n",
820 unit);
815 err = 14; 821 err = 14;
816 goto fail; 822 goto fail;
817 } 823 }
@@ -823,7 +829,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
823 j = BOARDREV_PROMOTED; 829 j = BOARDREV_PROMOTED;
824 wlc_hw->boardrev = (u16) j; 830 wlc_hw->boardrev = (u16) j;
825 if (!wlc_validboardtype(wlc_hw)) { 831 if (!wlc_validboardtype(wlc_hw)) {
826 WL_ERROR(("wl%d: wlc_bmac_attach: Unsupported Broadcom board type (0x%x)" " or revision level (0x%x)\n", unit, wlc_hw->sih->boardtype, wlc_hw->boardrev)); 832 WL_ERROR("wl%d: wlc_bmac_attach: Unsupported Broadcom board type (0x%x)" " or revision level (0x%x)\n",
833 unit, wlc_hw->sih->boardtype, wlc_hw->boardrev);
827 err = 15; 834 err = 15;
828 goto fail; 835 goto fail;
829 } 836 }
@@ -865,8 +872,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
865 wlc_hw->physhim = wlc_phy_shim_attach(wlc_hw, wlc->wl, wlc); 872 wlc_hw->physhim = wlc_phy_shim_attach(wlc_hw, wlc->wl, wlc);
866 873
867 if (wlc_hw->physhim == NULL) { 874 if (wlc_hw->physhim == NULL) {
868 WL_ERROR(("wl%d: wlc_bmac_attach: wlc_phy_shim_attach failed\n", 875 WL_ERROR("wl%d: wlc_bmac_attach: wlc_phy_shim_attach failed\n",
869 unit)); 876 unit);
870 err = 25; 877 err = 25;
871 goto fail; 878 goto fail;
872 } 879 }
@@ -933,7 +940,8 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
933 wlc_hw->band->pi = wlc_phy_attach(wlc_hw->phy_sh, 940 wlc_hw->band->pi = wlc_phy_attach(wlc_hw->phy_sh,
934 (void *)regs, wlc_hw->band->bandtype, vars); 941 (void *)regs, wlc_hw->band->bandtype, vars);
935 if (wlc_hw->band->pi == NULL) { 942 if (wlc_hw->band->pi == NULL) {
936 WL_ERROR(("wl%d: wlc_bmac_attach: wlc_phy_attach failed\n", unit)); 943 WL_ERROR("wl%d: wlc_bmac_attach: wlc_phy_attach failed\n",
944 unit);
937 err = 17; 945 err = 17;
938 goto fail; 946 goto fail;
939 } 947 }
@@ -963,7 +971,9 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
963 goto bad_phy; 971 goto bad_phy;
964 } else { 972 } else {
965 bad_phy: 973 bad_phy:
966 WL_ERROR(("wl%d: wlc_bmac_attach: unsupported phy type/rev (%d/%d)\n", unit, wlc_hw->band->phytype, wlc_hw->band->phyrev)); 974 WL_ERROR("wl%d: wlc_bmac_attach: unsupported phy type/rev (%d/%d)\n",
975 unit,
976 wlc_hw->band->phytype, wlc_hw->band->phyrev);
967 err = 18; 977 err = 18;
968 goto fail; 978 goto fail;
969 } 979 }
@@ -1018,27 +1028,27 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
1018 /* init etheraddr state variables */ 1028 /* init etheraddr state variables */
1019 macaddr = wlc_get_macaddr(wlc_hw); 1029 macaddr = wlc_get_macaddr(wlc_hw);
1020 if (macaddr == NULL) { 1030 if (macaddr == NULL) {
1021 WL_ERROR(("wl%d: wlc_bmac_attach: macaddr not found\n", unit)); 1031 WL_ERROR("wl%d: wlc_bmac_attach: macaddr not found\n", unit);
1022 err = 21; 1032 err = 21;
1023 goto fail; 1033 goto fail;
1024 } 1034 }
1025 bcm_ether_atoe(macaddr, &wlc_hw->etheraddr); 1035 bcm_ether_atoe(macaddr, &wlc_hw->etheraddr);
1026 if (is_broadcast_ether_addr(wlc_hw->etheraddr.octet) || 1036 if (is_broadcast_ether_addr(wlc_hw->etheraddr.octet) ||
1027 is_zero_ether_addr(wlc_hw->etheraddr.octet)) { 1037 is_zero_ether_addr(wlc_hw->etheraddr.octet)) {
1028 WL_ERROR(("wl%d: wlc_bmac_attach: bad macaddr %s\n", unit, 1038 WL_ERROR("wl%d: wlc_bmac_attach: bad macaddr %s\n",
1029 macaddr)); 1039 unit, macaddr);
1030 err = 22; 1040 err = 22;
1031 goto fail; 1041 goto fail;
1032 } 1042 }
1033 1043
1034 WL_ERROR(("%s:: deviceid 0x%x nbands %d board 0x%x macaddr: %s\n", 1044 WL_ERROR("%s:: deviceid 0x%x nbands %d board 0x%x macaddr: %s\n",
1035 __func__, wlc_hw->deviceid, wlc_hw->_nbands, 1045 __func__, wlc_hw->deviceid, wlc_hw->_nbands,
1036 wlc_hw->sih->boardtype, macaddr)); 1046 wlc_hw->sih->boardtype, macaddr);
1037 1047
1038 return err; 1048 return err;
1039 1049
1040 fail: 1050 fail:
1041 WL_ERROR(("wl%d: wlc_bmac_attach: failed with err %d\n", unit, err)); 1051 WL_ERROR("wl%d: wlc_bmac_attach: failed with err %d\n", unit, err);
1042 return err; 1052 return err;
1043} 1053}
1044 1054
@@ -1122,7 +1132,7 @@ int wlc_bmac_detach(struct wlc_info *wlc)
1122 1132
1123void wlc_bmac_reset(struct wlc_hw_info *wlc_hw) 1133void wlc_bmac_reset(struct wlc_hw_info *wlc_hw)
1124{ 1134{
1125 WL_TRACE(("wl%d: wlc_bmac_reset\n", wlc_hw->unit)); 1135 WL_TRACE("wl%d: wlc_bmac_reset\n", wlc_hw->unit);
1126 1136
1127 WLCNTINCR(wlc_hw->wlc->pub->_cnt->reset); 1137 WLCNTINCR(wlc_hw->wlc->pub->_cnt->reset);
1128 1138
@@ -1143,7 +1153,7 @@ wlc_bmac_init(struct wlc_hw_info *wlc_hw, chanspec_t chanspec,
1143 bool fastclk; 1153 bool fastclk;
1144 struct wlc_info *wlc = wlc_hw->wlc; 1154 struct wlc_info *wlc = wlc_hw->wlc;
1145 1155
1146 WL_TRACE(("wl%d: wlc_bmac_init\n", wlc_hw->unit)); 1156 WL_TRACE("wl%d: wlc_bmac_init\n", wlc_hw->unit);
1147 1157
1148 /* request FAST clock if not on */ 1158 /* request FAST clock if not on */
1149 fastclk = wlc_hw->forcefastclk; 1159 fastclk = wlc_hw->forcefastclk;
@@ -1192,7 +1202,7 @@ int wlc_bmac_up_prep(struct wlc_hw_info *wlc_hw)
1192{ 1202{
1193 uint coremask; 1203 uint coremask;
1194 1204
1195 WL_TRACE(("wl%d: %s:\n", wlc_hw->unit, __func__)); 1205 WL_TRACE("wl%d: %s:\n", wlc_hw->unit, __func__);
1196 1206
1197 ASSERT(wlc_hw->wlc->pub->hw_up && wlc_hw->wlc->macintmask == 0); 1207 ASSERT(wlc_hw->wlc->pub->hw_up && wlc_hw->wlc->macintmask == 0);
1198 1208
@@ -1238,7 +1248,7 @@ int wlc_bmac_up_prep(struct wlc_hw_info *wlc_hw)
1238 1248
1239int wlc_bmac_up_finish(struct wlc_hw_info *wlc_hw) 1249int wlc_bmac_up_finish(struct wlc_hw_info *wlc_hw)
1240{ 1250{
1241 WL_TRACE(("wl%d: %s:\n", wlc_hw->unit, __func__)); 1251 WL_TRACE("wl%d: %s:\n", wlc_hw->unit, __func__);
1242 1252
1243 wlc_hw->up = true; 1253 wlc_hw->up = true;
1244 wlc_phy_hw_state_upd(wlc_hw->band->pi, true); 1254 wlc_phy_hw_state_upd(wlc_hw->band->pi, true);
@@ -1255,7 +1265,7 @@ int wlc_bmac_down_prep(struct wlc_hw_info *wlc_hw)
1255 bool dev_gone; 1265 bool dev_gone;
1256 uint callbacks = 0; 1266 uint callbacks = 0;
1257 1267
1258 WL_TRACE(("wl%d: %s:\n", wlc_hw->unit, __func__)); 1268 WL_TRACE("wl%d: %s:\n", wlc_hw->unit, __func__);
1259 1269
1260 if (!wlc_hw->up) 1270 if (!wlc_hw->up)
1261 return callbacks; 1271 return callbacks;
@@ -1283,7 +1293,7 @@ int wlc_bmac_down_finish(struct wlc_hw_info *wlc_hw)
1283 uint callbacks = 0; 1293 uint callbacks = 0;
1284 bool dev_gone; 1294 bool dev_gone;
1285 1295
1286 WL_TRACE(("wl%d: %s:\n", wlc_hw->unit, __func__)); 1296 WL_TRACE("wl%d: %s:\n", wlc_hw->unit, __func__);
1287 1297
1288 if (!wlc_hw->up) 1298 if (!wlc_hw->up)
1289 return callbacks; 1299 return callbacks;
@@ -1719,7 +1729,7 @@ wlc_bmac_set_rcmta(struct wlc_hw_info *wlc_hw, int idx,
1719 u16 mac_l; 1729 u16 mac_l;
1720 struct osl_info *osh; 1730 struct osl_info *osh;
1721 1731
1722 WL_TRACE(("wl%d: %s\n", wlc_hw->unit, __func__)); 1732 WL_TRACE("wl%d: %s\n", wlc_hw->unit, __func__);
1723 1733
1724 ASSERT(wlc_hw->corerev > 4); 1734 ASSERT(wlc_hw->corerev > 4);
1725 1735
@@ -1752,7 +1762,7 @@ wlc_bmac_set_addrmatch(struct wlc_hw_info *wlc_hw, int match_reg_offset,
1752 u16 mac_h; 1762 u16 mac_h;
1753 struct osl_info *osh; 1763 struct osl_info *osh;
1754 1764
1755 WL_TRACE(("wl%d: wlc_bmac_set_addrmatch\n", wlc_hw->unit)); 1765 WL_TRACE("wl%d: wlc_bmac_set_addrmatch\n", wlc_hw->unit);
1756 1766
1757 ASSERT((match_reg_offset < RCM_SIZE) || (wlc_hw->corerev == 4)); 1767 ASSERT((match_reg_offset < RCM_SIZE) || (wlc_hw->corerev == 4));
1758 1768
@@ -1783,7 +1793,7 @@ wlc_bmac_write_template_ram(struct wlc_hw_info *wlc_hw, int offset, int len,
1783#endif /* IL_BIGENDIAN */ 1793#endif /* IL_BIGENDIAN */
1784 struct osl_info *osh; 1794 struct osl_info *osh;
1785 1795
1786 WL_TRACE(("wl%d: wlc_bmac_write_template_ram\n", wlc_hw->unit)); 1796 WL_TRACE("wl%d: wlc_bmac_write_template_ram\n", wlc_hw->unit);
1787 1797
1788 regs = wlc_hw->regs; 1798 regs = wlc_hw->regs;
1789 osh = wlc_hw->osh; 1799 osh = wlc_hw->osh;
@@ -1937,8 +1947,8 @@ WLBANDINITFN(wlc_bmac_bsinit) (struct wlc_info *wlc, chanspec_t chanspec)
1937{ 1947{
1938 struct wlc_hw_info *wlc_hw = wlc->hw; 1948 struct wlc_hw_info *wlc_hw = wlc->hw;
1939 1949
1940 WL_TRACE(("wl%d: wlc_bmac_bsinit: bandunit %d\n", wlc_hw->unit, 1950 WL_TRACE("wl%d: wlc_bmac_bsinit: bandunit %d\n",
1941 wlc_hw->band->bandunit)); 1951 wlc_hw->unit, wlc_hw->band->bandunit);
1942 1952
1943 /* sanity check */ 1953 /* sanity check */
1944 if (PHY_TYPE(R_REG(wlc_hw->osh, &wlc_hw->regs->phyversion)) != 1954 if (PHY_TYPE(R_REG(wlc_hw->osh, &wlc_hw->regs->phyversion)) !=
@@ -1974,7 +1984,7 @@ WLBANDINITFN(wlc_bmac_bsinit) (struct wlc_info *wlc, chanspec_t chanspec)
1974 1984
1975void wlc_bmac_core_phy_clk(struct wlc_hw_info *wlc_hw, bool clk) 1985void wlc_bmac_core_phy_clk(struct wlc_hw_info *wlc_hw, bool clk)
1976{ 1986{
1977 WL_TRACE(("wl%d: wlc_bmac_core_phy_clk: clk %d\n", wlc_hw->unit, clk)); 1987 WL_TRACE("wl%d: wlc_bmac_core_phy_clk: clk %d\n", wlc_hw->unit, clk);
1978 1988
1979 wlc_hw->phyclk = clk; 1989 wlc_hw->phyclk = clk;
1980 1990
@@ -1999,7 +2009,7 @@ void wlc_bmac_core_phy_clk(struct wlc_hw_info *wlc_hw, bool clk)
1999/* Perform a soft reset of the PHY PLL */ 2009/* Perform a soft reset of the PHY PLL */
2000void wlc_bmac_core_phypll_reset(struct wlc_hw_info *wlc_hw) 2010void wlc_bmac_core_phypll_reset(struct wlc_hw_info *wlc_hw)
2001{ 2011{
2002 WL_TRACE(("wl%d: wlc_bmac_core_phypll_reset\n", wlc_hw->unit)); 2012 WL_TRACE("wl%d: wlc_bmac_core_phypll_reset\n", wlc_hw->unit);
2003 2013
2004 si_corereg(wlc_hw->sih, SI_CC_IDX, 2014 si_corereg(wlc_hw->sih, SI_CC_IDX,
2005 offsetof(chipcregs_t, chipcontrol_addr), ~0, 0); 2015 offsetof(chipcregs_t, chipcontrol_addr), ~0, 0);
@@ -2045,7 +2055,7 @@ void wlc_bmac_phy_reset(struct wlc_hw_info *wlc_hw)
2045 u32 phy_bw_clkbits; 2055 u32 phy_bw_clkbits;
2046 bool phy_in_reset = false; 2056 bool phy_in_reset = false;
2047 2057
2048 WL_TRACE(("wl%d: wlc_bmac_phy_reset\n", wlc_hw->unit)); 2058 WL_TRACE("wl%d: wlc_bmac_phy_reset\n", wlc_hw->unit);
2049 2059
2050 if (pih == NULL) 2060 if (pih == NULL)
2051 return; 2061 return;
@@ -2127,7 +2137,7 @@ WLBANDINITFN(wlc_bmac_setband) (struct wlc_hw_info *wlc_hw, uint bandunit,
2127/* low-level band switch utility routine */ 2137/* low-level band switch utility routine */
2128void WLBANDINITFN(wlc_setxband) (struct wlc_hw_info *wlc_hw, uint bandunit) 2138void WLBANDINITFN(wlc_setxband) (struct wlc_hw_info *wlc_hw, uint bandunit)
2129{ 2139{
2130 WL_TRACE(("wl%d: wlc_setxband: bandunit %d\n", wlc_hw->unit, bandunit)); 2140 WL_TRACE("wl%d: wlc_setxband: bandunit %d\n", wlc_hw->unit, bandunit);
2131 2141
2132 wlc_hw->band = wlc_hw->bandstate[bandunit]; 2142 wlc_hw->band = wlc_hw->bandstate[bandunit];
2133 2143
@@ -2146,7 +2156,7 @@ static bool wlc_isgoodchip(struct wlc_hw_info *wlc_hw)
2146 2156
2147 /* reject unsupported corerev */ 2157 /* reject unsupported corerev */
2148 if (!VALID_COREREV(wlc_hw->corerev)) { 2158 if (!VALID_COREREV(wlc_hw->corerev)) {
2149 WL_ERROR(("unsupported core rev %d\n", wlc_hw->corerev)); 2159 WL_ERROR("unsupported core rev %d\n", wlc_hw->corerev);
2150 return false; 2160 return false;
2151 } 2161 }
2152 2162
@@ -2194,7 +2204,8 @@ static char *wlc_get_macaddr(struct wlc_hw_info *wlc_hw)
2194 2204
2195 macaddr = getvar(wlc_hw->vars, varname); 2205 macaddr = getvar(wlc_hw->vars, varname);
2196 if (macaddr == NULL) { 2206 if (macaddr == NULL) {
2197 WL_ERROR(("wl%d: wlc_get_macaddr: macaddr getvar(%s) not found\n", wlc_hw->unit, varname)); 2207 WL_ERROR("wl%d: wlc_get_macaddr: macaddr getvar(%s) not found\n",
2208 wlc_hw->unit, varname);
2198 } 2209 }
2199 2210
2200 return macaddr; 2211 return macaddr;
@@ -2257,7 +2268,7 @@ void wlc_bmac_hw_up(struct wlc_hw_info *wlc_hw)
2257 if (wlc_hw->wlc->pub->hw_up) 2268 if (wlc_hw->wlc->pub->hw_up)
2258 return; 2269 return;
2259 2270
2260 WL_TRACE(("wl%d: %s:\n", wlc_hw->unit, __func__)); 2271 WL_TRACE("wl%d: %s:\n", wlc_hw->unit, __func__);
2261 2272
2262 /* 2273 /*
2263 * Enable pll and xtal, initialize the power control registers, 2274 * Enable pll and xtal, initialize the power control registers,
@@ -2312,7 +2323,8 @@ static bool wlc_dma_rxreset(struct wlc_hw_info *wlc_hw, uint fifo)
2312 50000); 2323 50000);
2313 2324
2314 if (!rxidle && (rcv_frm_cnt != 0)) 2325 if (!rxidle && (rcv_frm_cnt != 0))
2315 WL_ERROR(("wl%d: %s: rxdma[%d] not idle && rcv_frm_cnt(%d) not zero\n", wlc_hw->unit, __func__, fifo, rcv_frm_cnt)); 2326 WL_ERROR("wl%d: %s: rxdma[%d] not idle && rcv_frm_cnt(%d) not zero\n",
2327 wlc_hw->unit, __func__, fifo, rcv_frm_cnt);
2316 mdelay(2); 2328 mdelay(2);
2317 } 2329 }
2318 2330
@@ -2337,7 +2349,7 @@ void wlc_bmac_corereset(struct wlc_hw_info *wlc_hw, u32 flags)
2337 if (flags == WLC_USE_COREFLAGS) 2349 if (flags == WLC_USE_COREFLAGS)
2338 flags = (wlc_hw->band->pi ? wlc_hw->band->core_flags : 0); 2350 flags = (wlc_hw->band->pi ? wlc_hw->band->core_flags : 0);
2339 2351
2340 WL_TRACE(("wl%d: %s\n", wlc_hw->unit, __func__)); 2352 WL_TRACE("wl%d: %s\n", wlc_hw->unit, __func__);
2341 2353
2342 regs = wlc_hw->regs; 2354 regs = wlc_hw->regs;
2343 2355
@@ -2350,17 +2362,20 @@ void wlc_bmac_corereset(struct wlc_hw_info *wlc_hw, u32 flags)
2350 if (si_iscoreup(wlc_hw->sih)) { 2362 if (si_iscoreup(wlc_hw->sih)) {
2351 for (i = 0; i < NFIFO; i++) 2363 for (i = 0; i < NFIFO; i++)
2352 if ((wlc_hw->di[i]) && (!dma_txreset(wlc_hw->di[i]))) { 2364 if ((wlc_hw->di[i]) && (!dma_txreset(wlc_hw->di[i]))) {
2353 WL_ERROR(("wl%d: %s: dma_txreset[%d]: cannot stop dma\n", wlc_hw->unit, __func__, i)); 2365 WL_ERROR("wl%d: %s: dma_txreset[%d]: cannot stop dma\n",
2366 wlc_hw->unit, __func__, i);
2354 } 2367 }
2355 2368
2356 if ((wlc_hw->di[RX_FIFO]) 2369 if ((wlc_hw->di[RX_FIFO])
2357 && (!wlc_dma_rxreset(wlc_hw, RX_FIFO))) { 2370 && (!wlc_dma_rxreset(wlc_hw, RX_FIFO))) {
2358 WL_ERROR(("wl%d: %s: dma_rxreset[%d]: cannot stop dma\n", wlc_hw->unit, __func__, RX_FIFO)); 2371 WL_ERROR("wl%d: %s: dma_rxreset[%d]: cannot stop dma\n",
2372 wlc_hw->unit, __func__, RX_FIFO);
2359 } 2373 }
2360 if (D11REV_IS(wlc_hw->corerev, 4) 2374 if (D11REV_IS(wlc_hw->corerev, 4)
2361 && wlc_hw->di[RX_TXSTATUS_FIFO] 2375 && wlc_hw->di[RX_TXSTATUS_FIFO]
2362 && (!wlc_dma_rxreset(wlc_hw, RX_TXSTATUS_FIFO))) { 2376 && (!wlc_dma_rxreset(wlc_hw, RX_TXSTATUS_FIFO))) {
2363 WL_ERROR(("wl%d: %s: dma_rxreset[%d]: cannot stop dma\n", wlc_hw->unit, __func__, RX_TXSTATUS_FIFO)); 2377 WL_ERROR("wl%d: %s: dma_rxreset[%d]: cannot stop dma\n",
2378 wlc_hw->unit, __func__, RX_TXSTATUS_FIFO);
2364 } 2379 }
2365 } 2380 }
2366 /* if noreset, just stop the psm and return */ 2381 /* if noreset, just stop the psm and return */
@@ -2491,7 +2506,7 @@ static void wlc_coreinit(struct wlc_info *wlc)
2491 regs = wlc_hw->regs; 2506 regs = wlc_hw->regs;
2492 osh = wlc_hw->osh; 2507 osh = wlc_hw->osh;
2493 2508
2494 WL_TRACE(("wl%d: wlc_coreinit\n", wlc_hw->unit)); 2509 WL_TRACE("wl%d: wlc_coreinit\n", wlc_hw->unit);
2495 2510
2496 /* reset PSM */ 2511 /* reset PSM */
2497 wlc_bmac_mctrl(wlc_hw, ~0, (MCTL_IHR_EN | MCTL_PSM_JMP_0 | MCTL_WAKE)); 2512 wlc_bmac_mctrl(wlc_hw, ~0, (MCTL_IHR_EN | MCTL_PSM_JMP_0 | MCTL_WAKE));
@@ -2514,8 +2529,8 @@ static void wlc_coreinit(struct wlc_info *wlc)
2514 SPINWAIT(((R_REG(osh, &regs->macintstatus) & MI_MACSSPNDD) == 0), 2529 SPINWAIT(((R_REG(osh, &regs->macintstatus) & MI_MACSSPNDD) == 0),
2515 1000 * 1000); 2530 1000 * 1000);
2516 if ((R_REG(osh, &regs->macintstatus) & MI_MACSSPNDD) == 0) 2531 if ((R_REG(osh, &regs->macintstatus) & MI_MACSSPNDD) == 0)
2517 WL_ERROR(("wl%d: wlc_coreinit: ucode did not self-suspend!\n", 2532 WL_ERROR("wl%d: wlc_coreinit: ucode did not self-suspend!\n",
2518 wlc_hw->unit)); 2533 wlc_hw->unit);
2519 2534
2520 wlc_gpio_init(wlc); 2535 wlc_gpio_init(wlc);
2521 2536
@@ -2525,18 +2540,18 @@ static void wlc_coreinit(struct wlc_info *wlc)
2525 if (WLCISNPHY(wlc_hw->band)) 2540 if (WLCISNPHY(wlc_hw->band))
2526 wlc_write_inits(wlc_hw, d11n0initvals16); 2541 wlc_write_inits(wlc_hw, d11n0initvals16);
2527 else 2542 else
2528 WL_ERROR(("%s: wl%d: unsupported phy in corerev %d\n", 2543 WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n",
2529 __func__, wlc_hw->unit, wlc_hw->corerev)); 2544 __func__, wlc_hw->unit, wlc_hw->corerev);
2530 } else if (D11REV_IS(wlc_hw->corerev, 24)) { 2545 } else if (D11REV_IS(wlc_hw->corerev, 24)) {
2531 if (WLCISLCNPHY(wlc_hw->band)) { 2546 if (WLCISLCNPHY(wlc_hw->band)) {
2532 wlc_write_inits(wlc_hw, d11lcn0initvals24); 2547 wlc_write_inits(wlc_hw, d11lcn0initvals24);
2533 } else { 2548 } else {
2534 WL_ERROR(("%s: wl%d: unsupported phy in corerev %d\n", 2549 WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n",
2535 __func__, wlc_hw->unit, wlc_hw->corerev)); 2550 __func__, wlc_hw->unit, wlc_hw->corerev);
2536 } 2551 }
2537 } else { 2552 } else {
2538 WL_ERROR(("%s: wl%d: unsupported corerev %d\n", 2553 WL_ERROR("%s: wl%d: unsupported corerev %d\n",
2539 __func__, wlc_hw->unit, wlc_hw->corerev)); 2554 __func__, wlc_hw->unit, wlc_hw->corerev);
2540 } 2555 }
2541 2556
2542 /* For old ucode, txfifo sizes needs to be modified(increased) for Corerev >= 9 */ 2557 /* For old ucode, txfifo sizes needs to be modified(increased) for Corerev >= 9 */
@@ -2578,7 +2593,8 @@ static void wlc_coreinit(struct wlc_info *wlc)
2578 err = -1; 2593 err = -1;
2579 } 2594 }
2580 if (err != 0) { 2595 if (err != 0) {
2581 WL_ERROR(("wlc_coreinit: txfifo mismatch: ucode size %d driver size %d index %d\n", buf[i], wlc_hw->xmtfifo_sz[i], i)); 2596 WL_ERROR("wlc_coreinit: txfifo mismatch: ucode size %d driver size %d index %d\n",
2597 buf[i], wlc_hw->xmtfifo_sz[i], i);
2582 /* DO NOT ASSERT corerev < 4 even there is a mismatch 2598 /* DO NOT ASSERT corerev < 4 even there is a mismatch
2583 * shmem, since driver don't overwrite those chip and 2599 * shmem, since driver don't overwrite those chip and
2584 * ucode initialize data will be used. 2600 * ucode initialize data will be used.
@@ -2797,16 +2813,16 @@ static void wlc_ucode_download(struct wlc_hw_info *wlc_hw)
2797 bcm43xx_16_mimosz); 2813 bcm43xx_16_mimosz);
2798 wlc_hw->ucode_loaded = true; 2814 wlc_hw->ucode_loaded = true;
2799 } else 2815 } else
2800 WL_ERROR(("%s: wl%d: unsupported phy in corerev %d\n", 2816 WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n",
2801 __func__, wlc_hw->unit, wlc_hw->corerev)); 2817 __func__, wlc_hw->unit, wlc_hw->corerev);
2802 } else if (D11REV_IS(wlc_hw->corerev, 24)) { 2818 } else if (D11REV_IS(wlc_hw->corerev, 24)) {
2803 if (WLCISLCNPHY(wlc_hw->band)) { 2819 if (WLCISLCNPHY(wlc_hw->band)) {
2804 wlc_ucode_write(wlc_hw, bcm43xx_24_lcn, 2820 wlc_ucode_write(wlc_hw, bcm43xx_24_lcn,
2805 bcm43xx_24_lcnsz); 2821 bcm43xx_24_lcnsz);
2806 wlc_hw->ucode_loaded = true; 2822 wlc_hw->ucode_loaded = true;
2807 } else { 2823 } else {
2808 WL_ERROR(("%s: wl%d: unsupported phy in corerev %d\n", 2824 WL_ERROR("%s: wl%d: unsupported phy in corerev %d\n",
2809 __func__, wlc_hw->unit, wlc_hw->corerev)); 2825 __func__, wlc_hw->unit, wlc_hw->corerev);
2810 } 2826 }
2811 } 2827 }
2812} 2828}
@@ -2820,7 +2836,7 @@ static void wlc_ucode_write(struct wlc_hw_info *wlc_hw, const u32 ucode[],
2820 2836
2821 osh = wlc_hw->osh; 2837 osh = wlc_hw->osh;
2822 2838
2823 WL_TRACE(("wl%d: wlc_ucode_write\n", wlc_hw->unit)); 2839 WL_TRACE("wl%d: wlc_ucode_write\n", wlc_hw->unit);
2824 2840
2825 ASSERT(IS_ALIGNED(nbytes, sizeof(u32))); 2841 ASSERT(IS_ALIGNED(nbytes, sizeof(u32)));
2826 2842
@@ -2838,7 +2854,7 @@ static void wlc_write_inits(struct wlc_hw_info *wlc_hw, const d11init_t *inits)
2838 struct osl_info *osh; 2854 struct osl_info *osh;
2839 volatile u8 *base; 2855 volatile u8 *base;
2840 2856
2841 WL_TRACE(("wl%d: wlc_write_inits\n", wlc_hw->unit)); 2857 WL_TRACE("wl%d: wlc_write_inits\n", wlc_hw->unit);
2842 2858
2843 osh = wlc_hw->osh; 2859 osh = wlc_hw->osh;
2844 base = (volatile u8 *)wlc_hw->regs; 2860 base = (volatile u8 *)wlc_hw->regs;
@@ -2914,44 +2930,45 @@ void wlc_bmac_fifoerrors(struct wlc_hw_info *wlc_hw)
2914 if (!intstatus) 2930 if (!intstatus)
2915 continue; 2931 continue;
2916 2932
2917 WL_TRACE(("wl%d: wlc_bmac_fifoerrors: intstatus%d 0x%x\n", unit, 2933 WL_TRACE("wl%d: wlc_bmac_fifoerrors: intstatus%d 0x%x\n",
2918 idx, intstatus)); 2934 unit, idx, intstatus);
2919 2935
2920 if (intstatus & I_RO) { 2936 if (intstatus & I_RO) {
2921 WL_ERROR(("wl%d: fifo %d: receive fifo overflow\n", 2937 WL_ERROR("wl%d: fifo %d: receive fifo overflow\n",
2922 unit, idx)); 2938 unit, idx);
2923 WLCNTINCR(wlc_hw->wlc->pub->_cnt->rxoflo); 2939 WLCNTINCR(wlc_hw->wlc->pub->_cnt->rxoflo);
2924 fatal = true; 2940 fatal = true;
2925 } 2941 }
2926 2942
2927 if (intstatus & I_PC) { 2943 if (intstatus & I_PC) {
2928 WL_ERROR(("wl%d: fifo %d: descriptor error\n", unit, 2944 WL_ERROR("wl%d: fifo %d: descriptor error\n",
2929 idx)); 2945 unit, idx);
2930 WLCNTINCR(wlc_hw->wlc->pub->_cnt->dmade); 2946 WLCNTINCR(wlc_hw->wlc->pub->_cnt->dmade);
2931 fatal = true; 2947 fatal = true;
2932 } 2948 }
2933 2949
2934 if (intstatus & I_PD) { 2950 if (intstatus & I_PD) {
2935 WL_ERROR(("wl%d: fifo %d: data error\n", unit, idx)); 2951 WL_ERROR("wl%d: fifo %d: data error\n", unit, idx);
2936 WLCNTINCR(wlc_hw->wlc->pub->_cnt->dmada); 2952 WLCNTINCR(wlc_hw->wlc->pub->_cnt->dmada);
2937 fatal = true; 2953 fatal = true;
2938 } 2954 }
2939 2955
2940 if (intstatus & I_DE) { 2956 if (intstatus & I_DE) {
2941 WL_ERROR(("wl%d: fifo %d: descriptor protocol error\n", 2957 WL_ERROR("wl%d: fifo %d: descriptor protocol error\n",
2942 unit, idx)); 2958 unit, idx);
2943 WLCNTINCR(wlc_hw->wlc->pub->_cnt->dmape); 2959 WLCNTINCR(wlc_hw->wlc->pub->_cnt->dmape);
2944 fatal = true; 2960 fatal = true;
2945 } 2961 }
2946 2962
2947 if (intstatus & I_RU) { 2963 if (intstatus & I_RU) {
2948 WL_ERROR(("wl%d: fifo %d: receive descriptor underflow\n", unit, idx)); 2964 WL_ERROR("wl%d: fifo %d: receive descriptor underflow\n",
2965 idx, unit);
2949 WLCNTINCR(wlc_hw->wlc->pub->_cnt->rxuflo[idx]); 2966 WLCNTINCR(wlc_hw->wlc->pub->_cnt->rxuflo[idx]);
2950 } 2967 }
2951 2968
2952 if (intstatus & I_XU) { 2969 if (intstatus & I_XU) {
2953 WL_ERROR(("wl%d: fifo %d: transmit fifo underflow\n", 2970 WL_ERROR("wl%d: fifo %d: transmit fifo underflow\n",
2954 idx, unit)); 2971 idx, unit);
2955 WLCNTINCR(wlc_hw->wlc->pub->_cnt->txuflo); 2972 WLCNTINCR(wlc_hw->wlc->pub->_cnt->txuflo);
2956 fatal = true; 2973 fatal = true;
2957 } 2974 }
@@ -3185,7 +3202,7 @@ static inline u32 wlc_intstatus(struct wlc_info *wlc, bool in_isr)
3185 /* macintstatus includes a DMA interrupt summary bit */ 3202 /* macintstatus includes a DMA interrupt summary bit */
3186 macintstatus = R_REG(osh, &regs->macintstatus); 3203 macintstatus = R_REG(osh, &regs->macintstatus);
3187 3204
3188 WL_TRACE(("wl%d: macintstatus: 0x%x\n", wlc_hw->unit, macintstatus)); 3205 WL_TRACE("wl%d: macintstatus: 0x%x\n", wlc_hw->unit, macintstatus);
3189 3206
3190 /* detect cardbus removed, in power down(suspend) and in reset */ 3207 /* detect cardbus removed, in power down(suspend) and in reset */
3191 if (DEVICEREMOVED(wlc)) 3208 if (DEVICEREMOVED(wlc))
@@ -3225,7 +3242,9 @@ static inline u32 wlc_intstatus(struct wlc_info *wlc, bool in_isr)
3225 R_REG(osh, 3242 R_REG(osh,
3226 &regs->intctrlregs[RX_TXSTATUS_FIFO]. 3243 &regs->intctrlregs[RX_TXSTATUS_FIFO].
3227 intstatus); 3244 intstatus);
3228 WL_TRACE(("wl%d: intstatus_rxfifo 0x%x, intstatus_txsfifo 0x%x\n", wlc_hw->unit, intstatus_rxfifo, intstatus_txsfifo)); 3245 WL_TRACE("wl%d: intstatus_rxfifo 0x%x, intstatus_txsfifo 0x%x\n",
3246 wlc_hw->unit,
3247 intstatus_rxfifo, intstatus_txsfifo);
3229 3248
3230 /* defer unsolicited interrupt hints */ 3249 /* defer unsolicited interrupt hints */
3231 intstatus_rxfifo &= DEF_RXINTMASK; 3250 intstatus_rxfifo &= DEF_RXINTMASK;
@@ -3301,7 +3320,7 @@ bool BCMFASTPATH wlc_isr(struct wlc_info *wlc, bool *wantdpc)
3301 macintstatus = wlc_intstatus(wlc, true); 3320 macintstatus = wlc_intstatus(wlc, true);
3302 3321
3303 if (macintstatus == 0xffffffff) 3322 if (macintstatus == 0xffffffff)
3304 WL_ERROR(("DEVICEREMOVED detected in the ISR code path.\n")); 3323 WL_ERROR("DEVICEREMOVED detected in the ISR code path\n");
3305 3324
3306 /* it is not for us */ 3325 /* it is not for us */
3307 if (macintstatus == 0) 3326 if (macintstatus == 0)
@@ -3325,7 +3344,7 @@ static bool wlc_bmac_txstatus_corerev4(struct wlc_hw_info *wlc_hw)
3325 struct osl_info *osh; 3344 struct osl_info *osh;
3326 bool fatal = false; 3345 bool fatal = false;
3327 3346
3328 WL_TRACE(("wl%d: wlc_txstatusrecv\n", wlc_hw->unit)); 3347 WL_TRACE("wl%d: wlc_txstatusrecv\n", wlc_hw->unit);
3329 3348
3330 osh = wlc_hw->osh; 3349 osh = wlc_hw->osh;
3331 3350
@@ -3378,7 +3397,7 @@ wlc_bmac_txstatus(struct wlc_hw_info *wlc_hw, bool bound, bool *fatal)
3378 bool morepending = false; 3397 bool morepending = false;
3379 struct wlc_info *wlc = wlc_hw->wlc; 3398 struct wlc_info *wlc = wlc_hw->wlc;
3380 3399
3381 WL_TRACE(("wl%d: wlc_bmac_txstatus\n", wlc_hw->unit)); 3400 WL_TRACE("wl%d: wlc_bmac_txstatus\n", wlc_hw->unit);
3382 3401
3383 if (D11REV_IS(wlc_hw->corerev, 4)) { 3402 if (D11REV_IS(wlc_hw->corerev, 4)) {
3384 /* to retire soon */ 3403 /* to retire soon */
@@ -3403,8 +3422,8 @@ wlc_bmac_txstatus(struct wlc_hw_info *wlc_hw, bool bound, bool *fatal)
3403 && (s1 = R_REG(osh, &regs->frmtxstatus)) & TXS_V) { 3422 && (s1 = R_REG(osh, &regs->frmtxstatus)) & TXS_V) {
3404 3423
3405 if (s1 == 0xffffffff) { 3424 if (s1 == 0xffffffff) {
3406 WL_ERROR(("wl%d: %s: dead chip\n", 3425 WL_ERROR("wl%d: %s: dead chip\n",
3407 wlc_hw->unit, __func__)); 3426 wlc_hw->unit, __func__);
3408 ASSERT(s1 != 0xffffffff); 3427 ASSERT(s1 != 0xffffffff);
3409 return morepending; 3428 return morepending;
3410 } 3429 }
@@ -3444,8 +3463,8 @@ void wlc_suspend_mac_and_wait(struct wlc_info *wlc)
3444 u32 mc, mi; 3463 u32 mc, mi;
3445 struct osl_info *osh; 3464 struct osl_info *osh;
3446 3465
3447 WL_TRACE(("wl%d: wlc_suspend_mac_and_wait: bandunit %d\n", wlc_hw->unit, 3466 WL_TRACE("wl%d: wlc_suspend_mac_and_wait: bandunit %d\n",
3448 wlc_hw->band->bandunit)); 3467 wlc_hw->unit, wlc_hw->band->bandunit);
3449 3468
3450 /* 3469 /*
3451 * Track overlapping suspend requests 3470 * Track overlapping suspend requests
@@ -3462,7 +3481,7 @@ void wlc_suspend_mac_and_wait(struct wlc_info *wlc)
3462 mc = R_REG(osh, &regs->maccontrol); 3481 mc = R_REG(osh, &regs->maccontrol);
3463 3482
3464 if (mc == 0xffffffff) { 3483 if (mc == 0xffffffff) {
3465 WL_ERROR(("wl%d: %s: dead chip\n", wlc_hw->unit, __func__)); 3484 WL_ERROR("wl%d: %s: dead chip\n", wlc_hw->unit, __func__);
3466 wl_down(wlc->wl); 3485 wl_down(wlc->wl);
3467 return; 3486 return;
3468 } 3487 }
@@ -3472,7 +3491,7 @@ void wlc_suspend_mac_and_wait(struct wlc_info *wlc)
3472 3491
3473 mi = R_REG(osh, &regs->macintstatus); 3492 mi = R_REG(osh, &regs->macintstatus);
3474 if (mi == 0xffffffff) { 3493 if (mi == 0xffffffff) {
3475 WL_ERROR(("wl%d: %s: dead chip\n", wlc_hw->unit, __func__)); 3494 WL_ERROR("wl%d: %s: dead chip\n", wlc_hw->unit, __func__);
3476 wl_down(wlc->wl); 3495 wl_down(wlc->wl);
3477 return; 3496 return;
3478 } 3497 }
@@ -3484,15 +3503,18 @@ void wlc_suspend_mac_and_wait(struct wlc_info *wlc)
3484 WLC_MAX_MAC_SUSPEND); 3503 WLC_MAX_MAC_SUSPEND);
3485 3504
3486 if (!(R_REG(osh, &regs->macintstatus) & MI_MACSSPNDD)) { 3505 if (!(R_REG(osh, &regs->macintstatus) & MI_MACSSPNDD)) {
3487 WL_ERROR(("wl%d: wlc_suspend_mac_and_wait: waited %d uS and " 3506 WL_ERROR("wl%d: wlc_suspend_mac_and_wait: waited %d uS and MI_MACSSPNDD is still not on.\n",
3488 "MI_MACSSPNDD is still not on.\n", 3507 wlc_hw->unit, WLC_MAX_MAC_SUSPEND);
3489 wlc_hw->unit, WLC_MAX_MAC_SUSPEND)); 3508 WL_ERROR("wl%d: psmdebug 0x%08x, phydebug 0x%08x, psm_brc 0x%04x\n",
3490 WL_ERROR(("wl%d: psmdebug 0x%08x, phydebug 0x%08x, psm_brc 0x%04x\n", wlc_hw->unit, R_REG(osh, &regs->psmdebug), R_REG(osh, &regs->phydebug), R_REG(osh, &regs->psm_brc))); 3509 wlc_hw->unit,
3510 R_REG(osh, &regs->psmdebug),
3511 R_REG(osh, &regs->phydebug),
3512 R_REG(osh, &regs->psm_brc));
3491 } 3513 }
3492 3514
3493 mc = R_REG(osh, &regs->maccontrol); 3515 mc = R_REG(osh, &regs->maccontrol);
3494 if (mc == 0xffffffff) { 3516 if (mc == 0xffffffff) {
3495 WL_ERROR(("wl%d: %s: dead chip\n", wlc_hw->unit, __func__)); 3517 WL_ERROR("wl%d: %s: dead chip\n", wlc_hw->unit, __func__);
3496 wl_down(wlc->wl); 3518 wl_down(wlc->wl);
3497 return; 3519 return;
3498 } 3520 }
@@ -3508,8 +3530,8 @@ void wlc_enable_mac(struct wlc_info *wlc)
3508 u32 mc, mi; 3530 u32 mc, mi;
3509 struct osl_info *osh; 3531 struct osl_info *osh;
3510 3532
3511 WL_TRACE(("wl%d: wlc_enable_mac: bandunit %d\n", wlc_hw->unit, 3533 WL_TRACE("wl%d: wlc_enable_mac: bandunit %d\n",
3512 wlc->band->bandunit)); 3534 wlc_hw->unit, wlc->band->bandunit);
3513 3535
3514 /* 3536 /*
3515 * Track overlapping suspend requests 3537 * Track overlapping suspend requests
@@ -3671,7 +3693,7 @@ bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw)
3671 volatile u16 *reg16; 3693 volatile u16 *reg16;
3672 struct osl_info *osh; 3694 struct osl_info *osh;
3673 3695
3674 WL_TRACE(("wl%d: validate_chip_access\n", wlc_hw->unit)); 3696 WL_TRACE("wl%d: validate_chip_access\n", wlc_hw->unit);
3675 3697
3676 regs = wlc_hw->regs; 3698 regs = wlc_hw->regs;
3677 osh = wlc_hw->osh; 3699 osh = wlc_hw->osh;
@@ -3691,7 +3713,8 @@ bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw)
3691 (void)R_REG(osh, &regs->objaddr); 3713 (void)R_REG(osh, &regs->objaddr);
3692 val = R_REG(osh, &regs->objdata); 3714 val = R_REG(osh, &regs->objdata);
3693 if (val != (u32) 0xaa5555aa) { 3715 if (val != (u32) 0xaa5555aa) {
3694 WL_ERROR(("wl%d: validate_chip_access: SHM = 0x%x, expected 0xaa5555aa\n", wlc_hw->unit, val)); 3716 WL_ERROR("wl%d: validate_chip_access: SHM = 0x%x, expected 0xaa5555aa\n",
3717 wlc_hw->unit, val);
3695 return false; 3718 return false;
3696 } 3719 }
3697 3720
@@ -3703,7 +3726,8 @@ bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw)
3703 (void)R_REG(osh, &regs->objaddr); 3726 (void)R_REG(osh, &regs->objaddr);
3704 val = R_REG(osh, &regs->objdata); 3727 val = R_REG(osh, &regs->objdata);
3705 if (val != (u32) 0x55aaaa55) { 3728 if (val != (u32) 0x55aaaa55) {
3706 WL_ERROR(("wl%d: validate_chip_access: SHM = 0x%x, expected 0x55aaaa55\n", wlc_hw->unit, val)); 3729 WL_ERROR("wl%d: validate_chip_access: SHM = 0x%x, expected 0x55aaaa55\n",
3730 wlc_hw->unit, val);
3707 return false; 3731 return false;
3708 } 3732 }
3709 3733
@@ -3733,12 +3757,14 @@ bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw)
3733 /* verify with the 16 bit registers that have no side effects */ 3757 /* verify with the 16 bit registers that have no side effects */
3734 val = R_REG(osh, &regs->tsf_cfpstrt_l); 3758 val = R_REG(osh, &regs->tsf_cfpstrt_l);
3735 if (val != (uint) 0xBBBB) { 3759 if (val != (uint) 0xBBBB) {
3736 WL_ERROR(("wl%d: validate_chip_access: tsf_cfpstrt_l = 0x%x, expected" " 0x%x\n", wlc_hw->unit, val, 0xBBBB)); 3760 WL_ERROR("wl%d: validate_chip_access: tsf_cfpstrt_l = 0x%x, expected 0x%x\n",
3761 wlc_hw->unit, val, 0xBBBB);
3737 return false; 3762 return false;
3738 } 3763 }
3739 val = R_REG(osh, &regs->tsf_cfpstrt_h); 3764 val = R_REG(osh, &regs->tsf_cfpstrt_h);
3740 if (val != (uint) 0xCCCC) { 3765 if (val != (uint) 0xCCCC) {
3741 WL_ERROR(("wl%d: validate_chip_access: tsf_cfpstrt_h = 0x%x, expected" " 0x%x\n", wlc_hw->unit, val, 0xCCCC)); 3766 WL_ERROR("wl%d: validate_chip_access: tsf_cfpstrt_h = 0x%x, expected 0x%x\n",
3767 wlc_hw->unit, val, 0xCCCC);
3742 return false; 3768 return false;
3743 } 3769 }
3744 3770
@@ -3750,7 +3776,10 @@ bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw)
3750 w = R_REG(osh, &regs->maccontrol); 3776 w = R_REG(osh, &regs->maccontrol);
3751 if ((w != (MCTL_IHR_EN | MCTL_WAKE)) && 3777 if ((w != (MCTL_IHR_EN | MCTL_WAKE)) &&
3752 (w != (MCTL_IHR_EN | MCTL_GMODE | MCTL_WAKE))) { 3778 (w != (MCTL_IHR_EN | MCTL_GMODE | MCTL_WAKE))) {
3753 WL_ERROR(("wl%d: validate_chip_access: maccontrol = 0x%x, expected 0x%x or 0x%x\n", wlc_hw->unit, w, (MCTL_IHR_EN | MCTL_WAKE), (MCTL_IHR_EN | MCTL_GMODE | MCTL_WAKE))); 3779 WL_ERROR("wl%d: validate_chip_access: maccontrol = 0x%x, expected 0x%x or 0x%x\n",
3780 wlc_hw->unit, w,
3781 (MCTL_IHR_EN | MCTL_WAKE),
3782 (MCTL_IHR_EN | MCTL_GMODE | MCTL_WAKE));
3754 return false; 3783 return false;
3755 } 3784 }
3756 3785
@@ -3765,7 +3794,7 @@ void wlc_bmac_core_phypll_ctl(struct wlc_hw_info *wlc_hw, bool on)
3765 struct osl_info *osh; 3794 struct osl_info *osh;
3766 u32 tmp; 3795 u32 tmp;
3767 3796
3768 WL_TRACE(("wl%d: wlc_bmac_core_phypll_ctl\n", wlc_hw->unit)); 3797 WL_TRACE("wl%d: wlc_bmac_core_phypll_ctl\n", wlc_hw->unit);
3769 3798
3770 tmp = 0; 3799 tmp = 0;
3771 regs = wlc_hw->regs; 3800 regs = wlc_hw->regs;
@@ -3786,8 +3815,8 @@ void wlc_bmac_core_phypll_ctl(struct wlc_hw_info *wlc_hw, bool on)
3786 tmp = R_REG(osh, &regs->clk_ctl_st); 3815 tmp = R_REG(osh, &regs->clk_ctl_st);
3787 if ((tmp & (CCS_ERSRC_AVAIL_HT)) != 3816 if ((tmp & (CCS_ERSRC_AVAIL_HT)) !=
3788 (CCS_ERSRC_AVAIL_HT)) { 3817 (CCS_ERSRC_AVAIL_HT)) {
3789 WL_ERROR(("%s: turn on PHY PLL failed\n", 3818 WL_ERROR("%s: turn on PHY PLL failed\n",
3790 __func__)); 3819 __func__);
3791 ASSERT(0); 3820 ASSERT(0);
3792 } 3821 }
3793 } else { 3822 } else {
@@ -3804,8 +3833,8 @@ void wlc_bmac_core_phypll_ctl(struct wlc_hw_info *wlc_hw, bool on)
3804 (CCS_ERSRC_AVAIL_D11PLL | CCS_ERSRC_AVAIL_PHYPLL)) 3833 (CCS_ERSRC_AVAIL_D11PLL | CCS_ERSRC_AVAIL_PHYPLL))
3805 != 3834 !=
3806 (CCS_ERSRC_AVAIL_D11PLL | CCS_ERSRC_AVAIL_PHYPLL)) { 3835 (CCS_ERSRC_AVAIL_D11PLL | CCS_ERSRC_AVAIL_PHYPLL)) {
3807 WL_ERROR(("%s: turn on PHY PLL failed\n", 3836 WL_ERROR("%s: turn on PHY PLL failed\n",
3808 __func__)); 3837 __func__);
3809 ASSERT(0); 3838 ASSERT(0);
3810 } 3839 }
3811 } 3840 }
@@ -3822,7 +3851,7 @@ void wlc_coredisable(struct wlc_hw_info *wlc_hw)
3822{ 3851{
3823 bool dev_gone; 3852 bool dev_gone;
3824 3853
3825 WL_TRACE(("wl%d: %s\n", wlc_hw->unit, __func__)); 3854 WL_TRACE("wl%d: %s\n", wlc_hw->unit, __func__);
3826 3855
3827 ASSERT(!wlc_hw->up); 3856 ASSERT(!wlc_hw->up);
3828 3857
@@ -3860,7 +3889,7 @@ void wlc_coredisable(struct wlc_hw_info *wlc_hw)
3860/* power both the pll and external oscillator on/off */ 3889/* power both the pll and external oscillator on/off */
3861void wlc_bmac_xtal(struct wlc_hw_info *wlc_hw, bool want) 3890void wlc_bmac_xtal(struct wlc_hw_info *wlc_hw, bool want)
3862{ 3891{
3863 WL_TRACE(("wl%d: wlc_bmac_xtal: want %d\n", wlc_hw->unit, want)); 3892 WL_TRACE("wl%d: wlc_bmac_xtal: want %d\n", wlc_hw->unit, want);
3864 3893
3865 /* dont power down if plldown is false or we must poll hw radio disable */ 3894 /* dont power down if plldown is false or we must poll hw radio disable */
3866 if (!want && wlc_hw->pllreq) 3895 if (!want && wlc_hw->pllreq)
@@ -3889,8 +3918,8 @@ static void wlc_flushqueues(struct wlc_info *wlc)
3889 if (wlc_hw->di[i]) { 3918 if (wlc_hw->di[i]) {
3890 dma_txreclaim(wlc_hw->di[i], HNDDMA_RANGE_ALL); 3919 dma_txreclaim(wlc_hw->di[i], HNDDMA_RANGE_ALL);
3891 TXPKTPENDCLR(wlc, i); 3920 TXPKTPENDCLR(wlc, i);
3892 WL_TRACE(("wlc_flushqueues: pktpend fifo %d cleared\n", 3921 WL_TRACE("wlc_flushqueues: pktpend fifo %d cleared\n",
3893 i)); 3922 i);
3894 } 3923 }
3895 3924
3896 /* free any posted rx packets */ 3925 /* free any posted rx packets */
@@ -4023,8 +4052,8 @@ wlc_bmac_copyfrom_objmem(struct wlc_hw_info *wlc_hw, uint offset, void *buf,
4023 4052
4024void wlc_bmac_copyfrom_vars(struct wlc_hw_info *wlc_hw, char **buf, uint *len) 4053void wlc_bmac_copyfrom_vars(struct wlc_hw_info *wlc_hw, char **buf, uint *len)
4025{ 4054{
4026 WL_TRACE(("wlc_bmac_copyfrom_vars, nvram vars totlen=%d\n", 4055 WL_TRACE("wlc_bmac_copyfrom_vars, nvram vars totlen=%d\n",
4027 wlc_hw->vars_size)); 4056 wlc_hw->vars_size);
4028 4057
4029 *buf = wlc_hw->vars; 4058 *buf = wlc_hw->vars;
4030 *len = wlc_hw->vars_size; 4059 *len = wlc_hw->vars_size;
@@ -4133,7 +4162,7 @@ void wlc_gpio_fast_deinit(struct wlc_hw_info *wlc_hw)
4133 (wlc_hw->sih->buscorerev >= 13))))) 4162 (wlc_hw->sih->buscorerev >= 13)))))
4134 return; 4163 return;
4135 4164
4136 WL_TRACE(("wl%d: %s\n", wlc_hw->unit, __func__)); 4165 WL_TRACE("wl%d: %s\n", wlc_hw->unit, __func__);
4137 return; 4166 return;
4138} 4167}
4139 4168
diff --git a/drivers/staging/brcm80211/sys/wlc_channel.c b/drivers/staging/brcm80211/sys/wlc_channel.c
index 33041e36585c..a35c15214880 100644
--- a/drivers/staging/brcm80211/sys/wlc_channel.c
+++ b/drivers/staging/brcm80211/sys/wlc_channel.c
@@ -567,8 +567,8 @@ struct chan20_info chan20_info[] = {
567const locale_info_t *wlc_get_locale_2g(u8 locale_idx) 567const locale_info_t *wlc_get_locale_2g(u8 locale_idx)
568{ 568{
569 if (locale_idx >= ARRAY_SIZE(g_locale_2g_table)) { 569 if (locale_idx >= ARRAY_SIZE(g_locale_2g_table)) {
570 WL_ERROR(("%s: locale 2g index size out of range %d\n", 570 WL_ERROR("%s: locale 2g index size out of range %d\n",
571 __func__, locale_idx)); 571 __func__, locale_idx);
572 ASSERT(locale_idx < ARRAY_SIZE(g_locale_2g_table)); 572 ASSERT(locale_idx < ARRAY_SIZE(g_locale_2g_table));
573 return NULL; 573 return NULL;
574 } 574 }
@@ -578,8 +578,8 @@ const locale_info_t *wlc_get_locale_2g(u8 locale_idx)
578const locale_info_t *wlc_get_locale_5g(u8 locale_idx) 578const locale_info_t *wlc_get_locale_5g(u8 locale_idx)
579{ 579{
580 if (locale_idx >= ARRAY_SIZE(g_locale_5g_table)) { 580 if (locale_idx >= ARRAY_SIZE(g_locale_5g_table)) {
581 WL_ERROR(("%s: locale 5g index size out of range %d\n", 581 WL_ERROR("%s: locale 5g index size out of range %d\n",
582 __func__, locale_idx)); 582 __func__, locale_idx);
583 ASSERT(locale_idx < ARRAY_SIZE(g_locale_5g_table)); 583 ASSERT(locale_idx < ARRAY_SIZE(g_locale_5g_table));
584 return NULL; 584 return NULL;
585 } 585 }
@@ -589,8 +589,8 @@ const locale_info_t *wlc_get_locale_5g(u8 locale_idx)
589const locale_mimo_info_t *wlc_get_mimo_2g(u8 locale_idx) 589const locale_mimo_info_t *wlc_get_mimo_2g(u8 locale_idx)
590{ 590{
591 if (locale_idx >= ARRAY_SIZE(g_mimo_2g_table)) { 591 if (locale_idx >= ARRAY_SIZE(g_mimo_2g_table)) {
592 WL_ERROR(("%s: mimo 2g index size out of range %d\n", __func__, 592 WL_ERROR("%s: mimo 2g index size out of range %d\n",
593 locale_idx)); 593 __func__, locale_idx);
594 return NULL; 594 return NULL;
595 } 595 }
596 return g_mimo_2g_table[locale_idx]; 596 return g_mimo_2g_table[locale_idx];
@@ -599,8 +599,8 @@ const locale_mimo_info_t *wlc_get_mimo_2g(u8 locale_idx)
599const locale_mimo_info_t *wlc_get_mimo_5g(u8 locale_idx) 599const locale_mimo_info_t *wlc_get_mimo_5g(u8 locale_idx)
600{ 600{
601 if (locale_idx >= ARRAY_SIZE(g_mimo_5g_table)) { 601 if (locale_idx >= ARRAY_SIZE(g_mimo_5g_table)) {
602 WL_ERROR(("%s: mimo 5g index size out of range %d\n", __func__, 602 WL_ERROR("%s: mimo 5g index size out of range %d\n",
603 locale_idx)); 603 __func__, locale_idx);
604 return NULL; 604 return NULL;
605 } 605 }
606 return g_mimo_5g_table[locale_idx]; 606 return g_mimo_5g_table[locale_idx];
@@ -614,11 +614,11 @@ wlc_cm_info_t *wlc_channel_mgr_attach(struct wlc_info *wlc)
614 struct wlc_pub *pub = wlc->pub; 614 struct wlc_pub *pub = wlc->pub;
615 char *ccode; 615 char *ccode;
616 616
617 WL_TRACE(("wl%d: wlc_channel_mgr_attach\n", wlc->pub->unit)); 617 WL_TRACE("wl%d: wlc_channel_mgr_attach\n", wlc->pub->unit);
618 618
619 wlc_cm = kzalloc(sizeof(wlc_cm_info_t), GFP_ATOMIC); 619 wlc_cm = kzalloc(sizeof(wlc_cm_info_t), GFP_ATOMIC);
620 if (wlc_cm == NULL) { 620 if (wlc_cm == NULL) {
621 WL_ERROR(("wl%d: %s: out of memory", pub->unit, __func__)); 621 WL_ERROR("wl%d: %s: out of memory", pub->unit, __func__);
622 return NULL; 622 return NULL;
623 } 623 }
624 wlc_cm->pub = pub; 624 wlc_cm->pub = pub;
@@ -629,8 +629,9 @@ wlc_cm_info_t *wlc_channel_mgr_attach(struct wlc_info *wlc)
629 ccode = getvar(wlc->pub->vars, "ccode"); 629 ccode = getvar(wlc->pub->vars, "ccode");
630 if (ccode) { 630 if (ccode) {
631 strncpy(wlc->pub->srom_ccode, ccode, WLC_CNTRY_BUF_SZ - 1); 631 strncpy(wlc->pub->srom_ccode, ccode, WLC_CNTRY_BUF_SZ - 1);
632 WL_NONE(("%s: SROM country code is %c%c\n", __func__, 632 WL_NONE("%s: SROM country code is %c%c\n",
633 wlc->pub->srom_ccode[0], wlc->pub->srom_ccode[1])); 633 __func__,
634 wlc->pub->srom_ccode[0], wlc->pub->srom_ccode[1]);
634 } 635 }
635 636
636 /* internal country information which must match regulatory constraints in firmware */ 637 /* internal country information which must match regulatory constraints in firmware */
@@ -716,7 +717,9 @@ wlc_set_countrycode_rev(wlc_cm_info_t *wlc_cm,
716 char mapped_ccode[WLC_CNTRY_BUF_SZ]; 717 char mapped_ccode[WLC_CNTRY_BUF_SZ];
717 uint mapped_regrev; 718 uint mapped_regrev;
718 719
719 WL_NONE(("%s: (country_abbrev \"%s\", ccode \"%s\", regrev %d) SPROM \"%s\"/%u\n", __func__, country_abbrev, ccode, regrev, wlc_cm->srom_ccode, wlc_cm->srom_regrev)); 720 WL_NONE("%s: (country_abbrev \"%s\", ccode \"%s\", regrev %d) SPROM \"%s\"/%u\n",
721 __func__, country_abbrev, ccode, regrev,
722 wlc_cm->srom_ccode, wlc_cm->srom_regrev);
720 723
721 /* if regrev is -1, lookup the mapped country code, 724 /* if regrev is -1, lookup the mapped country code,
722 * otherwise use the ccode and regrev directly 725 * otherwise use the ccode and regrev directly
@@ -827,8 +830,8 @@ static const country_info_t *wlc_countrycode_map(wlc_cm_info_t *wlc_cm,
827 830
828 /* check for currently supported ccode size */ 831 /* check for currently supported ccode size */
829 if (strlen(ccode) > (WLC_CNTRY_BUF_SZ - 1)) { 832 if (strlen(ccode) > (WLC_CNTRY_BUF_SZ - 1)) {
830 WL_ERROR(("wl%d: %s: ccode \"%s\" too long for match\n", 833 WL_ERROR("wl%d: %s: ccode \"%s\" too long for match\n",
831 wlc->pub->unit, __func__, ccode)); 834 wlc->pub->unit, __func__, ccode);
832 return NULL; 835 return NULL;
833 } 836 }
834 837
@@ -843,7 +846,7 @@ static const country_info_t *wlc_countrycode_map(wlc_cm_info_t *wlc_cm,
843 if (!strcmp(srom_ccode, ccode)) { 846 if (!strcmp(srom_ccode, ccode)) {
844 *mapped_regrev = srom_regrev; 847 *mapped_regrev = srom_regrev;
845 mapped = 0; 848 mapped = 0;
846 WL_ERROR(("srom_code == ccode %s\n", __func__)); 849 WL_ERROR("srom_code == ccode %s\n", __func__);
847 ASSERT(0); 850 ASSERT(0);
848 } else { 851 } else {
849 mapped = 852 mapped =
@@ -895,7 +898,7 @@ static const country_info_t *wlc_country_lookup_direct(const char *ccode,
895 } 898 }
896 } 899 }
897 900
898 WL_ERROR(("%s: Returning NULL\n", __func__)); 901 WL_ERROR("%s: Returning NULL\n", __func__);
899 ASSERT(0); 902 ASSERT(0);
900 return NULL; 903 return NULL;
901} 904}
@@ -974,7 +977,9 @@ static void wlc_channels_commit(wlc_cm_info_t *wlc_cm)
974 if (chan == INVCHANNEL) { 977 if (chan == INVCHANNEL) {
975 /* country/locale with no valid channels, set the radio disable bit */ 978 /* country/locale with no valid channels, set the radio disable bit */
976 mboolset(wlc->pub->radio_disabled, WL_RADIO_COUNTRY_DISABLE); 979 mboolset(wlc->pub->radio_disabled, WL_RADIO_COUNTRY_DISABLE);
977 WL_ERROR(("wl%d: %s: no valid channel for \"%s\" nbands %d bandlocked %d\n", wlc->pub->unit, __func__, wlc_cm->country_abbrev, NBANDS(wlc), wlc->bandlocked)); 980 WL_ERROR("wl%d: %s: no valid channel for \"%s\" nbands %d bandlocked %d\n",
981 wlc->pub->unit, __func__,
982 wlc_cm->country_abbrev, NBANDS(wlc), wlc->bandlocked);
978 } else 983 } else
979 if (mboolisset(wlc->pub->radio_disabled, 984 if (mboolisset(wlc->pub->radio_disabled,
980 WL_RADIO_COUNTRY_DISABLE)) { 985 WL_RADIO_COUNTRY_DISABLE)) {
@@ -1538,8 +1543,8 @@ wlc_valid_chanspec_ext(wlc_cm_info_t *wlc_cm, chanspec_t chspec, bool dualband)
1538 1543
1539 /* check the chanspec */ 1544 /* check the chanspec */
1540 if (wf_chspec_malformed(chspec)) { 1545 if (wf_chspec_malformed(chspec)) {
1541 WL_ERROR(("wl%d: malformed chanspec 0x%x\n", wlc->pub->unit, 1546 WL_ERROR("wl%d: malformed chanspec 0x%x\n",
1542 chspec)); 1547 wlc->pub->unit, chspec);
1543 ASSERT(0); 1548 ASSERT(0);
1544 return false; 1549 return false;
1545 } 1550 }
diff --git a/drivers/staging/brcm80211/sys/wlc_event.c b/drivers/staging/brcm80211/sys/wlc_event.c
index 9b503d839aae..dabd7094cd73 100644
--- a/drivers/staging/brcm80211/sys/wlc_event.c
+++ b/drivers/staging/brcm80211/sys/wlc_event.c
@@ -75,8 +75,8 @@ wlc_eventq_t *wlc_eventq_attach(struct wlc_pub *pub, struct wlc_info *wlc,
75 75
76 eq->timer = wl_init_timer(eq->wl, wlc_timer_cb, eq, "eventq"); 76 eq->timer = wl_init_timer(eq->wl, wlc_timer_cb, eq, "eventq");
77 if (!eq->timer) { 77 if (!eq->timer) {
78 WL_ERROR(("wl%d: wlc_eventq_attach: timer failed\n", 78 WL_ERROR("wl%d: wlc_eventq_attach: timer failed\n",
79 pub->unit)); 79 pub->unit);
80 kfree(eq); 80 kfree(eq);
81 return NULL; 81 return NULL;
82 } 82 }
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c
index 8a89b5fe8e60..1d5d01ac0a9b 100644
--- a/drivers/staging/brcm80211/sys/wlc_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c
@@ -306,7 +306,7 @@ void wlc_get_rcmta(struct wlc_info *wlc, int idx, struct ether_addr *addr)
306 u32 v32; 306 u32 v32;
307 struct osl_info *osh; 307 struct osl_info *osh;
308 308
309 WL_TRACE(("wl%d: %s\n", WLCWLUNIT(wlc), __func__)); 309 WL_TRACE("wl%d: %s\n", WLCWLUNIT(wlc), __func__);
310 310
311 ASSERT(wlc->pub->corerev > 4); 311 ASSERT(wlc->pub->corerev > 4);
312 312
@@ -364,7 +364,7 @@ bool wlc_ps_allowed(struct wlc_info *wlc)
364 364
365void wlc_reset(struct wlc_info *wlc) 365void wlc_reset(struct wlc_info *wlc)
366{ 366{
367 WL_TRACE(("wl%d: wlc_reset\n", wlc->pub->unit)); 367 WL_TRACE("wl%d: wlc_reset\n", wlc->pub->unit);
368 368
369 wlc->check_for_unaligned_tbtt = false; 369 wlc->check_for_unaligned_tbtt = false;
370 370
@@ -385,7 +385,7 @@ void wlc_reset(struct wlc_info *wlc)
385 385
386void wlc_fatal_error(struct wlc_info *wlc) 386void wlc_fatal_error(struct wlc_info *wlc)
387{ 387{
388 WL_ERROR(("wl%d: fatal error, reinitializing\n", wlc->pub->unit)); 388 WL_ERROR("wl%d: fatal error, reinitializing\n", wlc->pub->unit);
389 wl_init(wlc->wl); 389 wl_init(wlc->wl);
390} 390}
391 391
@@ -426,7 +426,7 @@ void wlc_init(struct wlc_info *wlc)
426 wlc_bsscfg_t *bsscfg; 426 wlc_bsscfg_t *bsscfg;
427 bool mute = false; 427 bool mute = false;
428 428
429 WL_TRACE(("wl%d: wlc_init\n", wlc->pub->unit)); 429 WL_TRACE("wl%d: wlc_init\n", wlc->pub->unit);
430 430
431 regs = wlc->regs; 431 regs = wlc->regs;
432 432
@@ -605,8 +605,8 @@ bool wlc_ps_check(struct wlc_info *wlc)
605 * to avoid assert 605 * to avoid assert
606 */ 606 */
607 if (tmp == 0xffffffff) { 607 if (tmp == 0xffffffff) {
608 WL_ERROR(("wl%d: %s: dead chip\n", wlc->pub->unit, 608 WL_ERROR("wl%d: %s: dead chip\n",
609 __func__)); 609 wlc->pub->unit, __func__);
610 return DEVICEREMOVED(wlc); 610 return DEVICEREMOVED(wlc);
611 } 611 }
612 612
@@ -615,7 +615,8 @@ bool wlc_ps_check(struct wlc_info *wlc)
615 if (hps != ((tmp & MCTL_HPS) != 0)) { 615 if (hps != ((tmp & MCTL_HPS) != 0)) {
616 int idx; 616 int idx;
617 wlc_bsscfg_t *cfg; 617 wlc_bsscfg_t *cfg;
618 WL_ERROR(("wl%d: hps not sync, sw %d, maccontrol 0x%x\n", wlc->pub->unit, hps, tmp)); 618 WL_ERROR("wl%d: hps not sync, sw %d, maccontrol 0x%x\n",
619 wlc->pub->unit, hps, tmp);
619 FOREACH_BSS(wlc, idx, cfg) { 620 FOREACH_BSS(wlc, idx, cfg) {
620 if (!BSSCFG_STA(cfg)) 621 if (!BSSCFG_STA(cfg))
621 continue; 622 continue;
@@ -629,7 +630,8 @@ bool wlc_ps_check(struct wlc_info *wlc)
629 wake = STAY_AWAKE(wlc) || wlc->hw->wake_override; 630 wake = STAY_AWAKE(wlc) || wlc->hw->wake_override;
630 wake_ok = (wake == ((tmp & MCTL_WAKE) != 0)); 631 wake_ok = (wake == ((tmp & MCTL_WAKE) != 0));
631 if (hps && !wake_ok) { 632 if (hps && !wake_ok) {
632 WL_ERROR(("wl%d: wake not sync, sw %d maccontrol 0x%x\n", wlc->pub->unit, wake, tmp)); 633 WL_ERROR("wl%d: wake not sync, sw %d maccontrol 0x%x\n",
634 wlc->pub->unit, wake, tmp);
633 res = false; 635 res = false;
634 } 636 }
635 } 637 }
@@ -647,8 +649,8 @@ void wlc_set_ps_ctrl(struct wlc_info *wlc)
647 hps = PS_ALLOWED(wlc); 649 hps = PS_ALLOWED(wlc);
648 wake = hps ? (STAY_AWAKE(wlc)) : true; 650 wake = hps ? (STAY_AWAKE(wlc)) : true;
649 651
650 WL_TRACE(("wl%d: wlc_set_ps_ctrl: hps %d wake %d\n", wlc->pub->unit, 652 WL_TRACE("wl%d: wlc_set_ps_ctrl: hps %d wake %d\n",
651 hps, wake)); 653 wlc->pub->unit, hps, wake);
652 654
653 v1 = R_REG(wlc->osh, &wlc->regs->maccontrol); 655 v1 = R_REG(wlc->osh, &wlc->regs->maccontrol);
654 v2 = 0; 656 v2 = 0;
@@ -806,8 +808,8 @@ void wlc_set_chanspec(struct wlc_info *wlc, chanspec_t chanspec)
806 chanspec_t old_chanspec = wlc->chanspec; 808 chanspec_t old_chanspec = wlc->chanspec;
807 809
808 if (!wlc_valid_chanspec_db(wlc->cmi, chanspec)) { 810 if (!wlc_valid_chanspec_db(wlc->cmi, chanspec)) {
809 WL_ERROR(("wl%d: %s: Bad channel %d\n", 811 WL_ERROR("wl%d: %s: Bad channel %d\n",
810 wlc->pub->unit, __func__, CHSPEC_CHANNEL(chanspec))); 812 wlc->pub->unit, __func__, CHSPEC_CHANNEL(chanspec));
811 ASSERT(wlc_valid_chanspec_db(wlc->cmi, chanspec)); 813 ASSERT(wlc_valid_chanspec_db(wlc->cmi, chanspec));
812 return; 814 return;
813 } 815 }
@@ -818,7 +820,9 @@ void wlc_set_chanspec(struct wlc_info *wlc, chanspec_t chanspec)
818 if (wlc->band->bandunit != bandunit || wlc->bandinit_pending) { 820 if (wlc->band->bandunit != bandunit || wlc->bandinit_pending) {
819 switchband = true; 821 switchband = true;
820 if (wlc->bandlocked) { 822 if (wlc->bandlocked) {
821 WL_ERROR(("wl%d: %s: chspec %d band is locked!\n", wlc->pub->unit, __func__, CHSPEC_CHANNEL(chanspec))); 823 WL_ERROR("wl%d: %s: chspec %d band is locked!\n",
824 wlc->pub->unit, __func__,
825 CHSPEC_CHANNEL(chanspec));
822 return; 826 return;
823 } 827 }
824 /* BMAC_NOTE: should the setband call come after the wlc_bmac_chanspec() ? 828 /* BMAC_NOTE: should the setband call come after the wlc_bmac_chanspec() ?
@@ -1120,7 +1124,7 @@ void wlc_beacon_phytxctl_txant_upd(struct wlc_info *wlc, ratespec_t bcn_rspec)
1120*/ 1124*/
1121void wlc_protection_upd(struct wlc_info *wlc, uint idx, int val) 1125void wlc_protection_upd(struct wlc_info *wlc, uint idx, int val)
1122{ 1126{
1123 WL_TRACE(("wlc_protection_upd: idx %d, val %d\n", idx, val)); 1127 WL_TRACE("wlc_protection_upd: idx %d, val %d\n", idx, val);
1124 1128
1125 switch (idx) { 1129 switch (idx) {
1126 case WLC_PROT_G_SPEC: 1130 case WLC_PROT_G_SPEC:
@@ -1228,7 +1232,7 @@ static void wlc_bandinit_ordered(struct wlc_info *wlc, chanspec_t chanspec)
1228 uint parkband; 1232 uint parkband;
1229 uint i, band_order[2]; 1233 uint i, band_order[2];
1230 1234
1231 WL_TRACE(("wl%d: wlc_bandinit_ordered\n", wlc->pub->unit)); 1235 WL_TRACE("wl%d: wlc_bandinit_ordered\n", wlc->pub->unit);
1232 /* 1236 /*
1233 * We might have been bandlocked during down and the chip power-cycled (hibernate). 1237 * We might have been bandlocked during down and the chip power-cycled (hibernate).
1234 * figure out the right band to park on 1238 * figure out the right band to park on
@@ -1271,8 +1275,8 @@ static void wlc_bandinit_ordered(struct wlc_info *wlc, chanspec_t chanspec)
1271/* band-specific init */ 1275/* band-specific init */
1272static void WLBANDINITFN(wlc_bsinit) (struct wlc_info *wlc) 1276static void WLBANDINITFN(wlc_bsinit) (struct wlc_info *wlc)
1273{ 1277{
1274 WL_TRACE(("wl%d: wlc_bsinit: bandunit %d\n", wlc->pub->unit, 1278 WL_TRACE("wl%d: wlc_bsinit: bandunit %d\n",
1275 wlc->band->bandunit)); 1279 wlc->pub->unit, wlc->band->bandunit);
1276 1280
1277 /* write ucode ACK/CTS rate table */ 1281 /* write ucode ACK/CTS rate table */
1278 wlc_set_ratetable(wlc); 1282 wlc_set_ratetable(wlc);
@@ -1348,7 +1352,7 @@ void wlc_wme_setparams(struct wlc_info *wlc, u16 aci, void *arg, bool suspend)
1348 1352
1349 /* Only apply params if the core is out of reset and has clocks */ 1353 /* Only apply params if the core is out of reset and has clocks */
1350 if (!wlc->clk) { 1354 if (!wlc->clk) {
1351 WL_ERROR(("wl%d: %s : no-clock\n", wlc->pub->unit, __func__)); 1355 WL_ERROR("wl%d: %s : no-clock\n", wlc->pub->unit, __func__);
1352 return; 1356 return;
1353 } 1357 }
1354 1358
@@ -1380,8 +1384,8 @@ void wlc_wme_setparams(struct wlc_info *wlc, u16 aci, void *arg, bool suspend)
1380 1384
1381 if (acp_shm.aifs < EDCF_AIFSN_MIN 1385 if (acp_shm.aifs < EDCF_AIFSN_MIN
1382 || acp_shm.aifs > EDCF_AIFSN_MAX) { 1386 || acp_shm.aifs > EDCF_AIFSN_MAX) {
1383 WL_ERROR(("wl%d: wlc_edcf_setparams: bad aifs %d\n", 1387 WL_ERROR("wl%d: wlc_edcf_setparams: bad aifs %d\n",
1384 wlc->pub->unit, acp_shm.aifs)); 1388 wlc->pub->unit, acp_shm.aifs);
1385 continue; 1389 continue;
1386 } 1390 }
1387 1391
@@ -1464,8 +1468,8 @@ void wlc_edcf_setparams(wlc_bsscfg_t *cfg, bool suspend)
1464 1468
1465 if (acp_shm.aifs < EDCF_AIFSN_MIN 1469 if (acp_shm.aifs < EDCF_AIFSN_MIN
1466 || acp_shm.aifs > EDCF_AIFSN_MAX) { 1470 || acp_shm.aifs > EDCF_AIFSN_MAX) {
1467 WL_ERROR(("wl%d: wlc_edcf_setparams: bad aifs %d\n", 1471 WL_ERROR("wl%d: wlc_edcf_setparams: bad aifs %d\n",
1468 wlc->pub->unit, acp_shm.aifs)); 1472 wlc->pub->unit, acp_shm.aifs);
1469 continue; 1473 continue;
1470 } 1474 }
1471 1475
@@ -1512,15 +1516,14 @@ bool wlc_timers_init(struct wlc_info *wlc, int unit)
1512 wlc->wdtimer = wl_init_timer(wlc->wl, wlc_watchdog_by_timer, 1516 wlc->wdtimer = wl_init_timer(wlc->wl, wlc_watchdog_by_timer,
1513 wlc, "watchdog"); 1517 wlc, "watchdog");
1514 if (!wlc->wdtimer) { 1518 if (!wlc->wdtimer) {
1515 WL_ERROR(("wl%d: wl_init_timer for wdtimer failed\n", unit)); 1519 WL_ERROR("wl%d: wl_init_timer for wdtimer failed\n", unit);
1516 goto fail; 1520 goto fail;
1517 } 1521 }
1518 1522
1519 wlc->radio_timer = wl_init_timer(wlc->wl, wlc_radio_timer, 1523 wlc->radio_timer = wl_init_timer(wlc->wl, wlc_radio_timer,
1520 wlc, "radio"); 1524 wlc, "radio");
1521 if (!wlc->radio_timer) { 1525 if (!wlc->radio_timer) {
1522 WL_ERROR(("wl%d: wl_init_timer for radio_timer failed\n", 1526 WL_ERROR("wl%d: wl_init_timer for radio_timer failed\n", unit);
1523 unit));
1524 goto fail; 1527 goto fail;
1525 } 1528 }
1526 1529
@@ -1667,15 +1670,14 @@ static uint wlc_attach_module(struct wlc_info *wlc)
1667 1670
1668 wlc->asi = wlc_antsel_attach(wlc, wlc->osh, wlc->pub, wlc->hw); 1671 wlc->asi = wlc_antsel_attach(wlc, wlc->osh, wlc->pub, wlc->hw);
1669 if (wlc->asi == NULL) { 1672 if (wlc->asi == NULL) {
1670 WL_ERROR(("wl%d: wlc_attach: wlc_antsel_attach failed\n", 1673 WL_ERROR("wl%d: wlc_attach: wlc_antsel_attach failed\n", unit);
1671 unit));
1672 err = 44; 1674 err = 44;
1673 goto fail; 1675 goto fail;
1674 } 1676 }
1675 1677
1676 wlc->ampdu = wlc_ampdu_attach(wlc); 1678 wlc->ampdu = wlc_ampdu_attach(wlc);
1677 if (wlc->ampdu == NULL) { 1679 if (wlc->ampdu == NULL) {
1678 WL_ERROR(("wl%d: wlc_attach: wlc_ampdu_attach failed\n", unit)); 1680 WL_ERROR("wl%d: wlc_attach: wlc_ampdu_attach failed\n", unit);
1679 err = 50; 1681 err = 50;
1680 goto fail; 1682 goto fail;
1681 } 1683 }
@@ -1684,13 +1686,13 @@ static uint wlc_attach_module(struct wlc_info *wlc)
1684 wlc->eventq = 1686 wlc->eventq =
1685 wlc_eventq_attach(wlc->pub, wlc, wlc->wl, wlc_process_eventq); 1687 wlc_eventq_attach(wlc->pub, wlc, wlc->wl, wlc_process_eventq);
1686 if (wlc->eventq == NULL) { 1688 if (wlc->eventq == NULL) {
1687 WL_ERROR(("wl%d: wlc_attach: wlc_eventq_attachfailed\n", unit)); 1689 WL_ERROR("wl%d: wlc_attach: wlc_eventq_attachfailed\n", unit);
1688 err = 57; 1690 err = 57;
1689 goto fail; 1691 goto fail;
1690 } 1692 }
1691 1693
1692 if ((wlc_stf_attach(wlc) != 0)) { 1694 if ((wlc_stf_attach(wlc) != 0)) {
1693 WL_ERROR(("wl%d: wlc_attach: wlc_stf_attach failed\n", unit)); 1695 WL_ERROR("wl%d: wlc_attach: wlc_stf_attach failed\n", unit);
1694 err = 68; 1696 err = 68;
1695 goto fail; 1697 goto fail;
1696 } 1698 }
@@ -1719,8 +1721,8 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
1719 wlc_txq_info_t *qi; 1721 wlc_txq_info_t *qi;
1720 uint n_disabled; 1722 uint n_disabled;
1721 1723
1722 WL_NONE(("wl%d: %s: vendor 0x%x device 0x%x\n", unit, __func__, vendor, 1724 WL_NONE("wl%d: %s: vendor 0x%x device 0x%x\n",
1723 device)); 1725 unit, __func__, vendor, device);
1724 1726
1725 ASSERT(WSEC_MAX_RCMTA_KEYS <= WSEC_MAX_KEYS); 1727 ASSERT(WSEC_MAX_RCMTA_KEYS <= WSEC_MAX_KEYS);
1726 ASSERT(WSEC_MAX_DEFAULT_KEYS == WLC_DEFAULT_KEYS); 1728 ASSERT(WSEC_MAX_DEFAULT_KEYS == WLC_DEFAULT_KEYS);
@@ -1897,7 +1899,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
1897 goto fail; 1899 goto fail;
1898 1900
1899 if (!wlc_timers_init(wlc, unit)) { 1901 if (!wlc_timers_init(wlc, unit)) {
1900 WL_ERROR(("wl%d: %s: wlc_init_timer failed\n", unit, __func__)); 1902 WL_ERROR("wl%d: %s: wlc_init_timer failed\n", unit, __func__);
1901 err = 32; 1903 err = 32;
1902 goto fail; 1904 goto fail;
1903 } 1905 }
@@ -1905,8 +1907,8 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
1905 /* depend on rateset, gmode */ 1907 /* depend on rateset, gmode */
1906 wlc->cmi = wlc_channel_mgr_attach(wlc); 1908 wlc->cmi = wlc_channel_mgr_attach(wlc);
1907 if (!wlc->cmi) { 1909 if (!wlc->cmi) {
1908 WL_ERROR(("wl%d: %s: wlc_channel_mgr_attach failed\n", unit, 1910 WL_ERROR("wl%d: %s: wlc_channel_mgr_attach failed\n",
1909 __func__)); 1911 unit, __func__);
1910 err = 33; 1912 err = 33;
1911 goto fail; 1913 goto fail;
1912 } 1914 }
@@ -1921,8 +1923,8 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
1921 /* allocate our initial queue */ 1923 /* allocate our initial queue */
1922 qi = wlc_txq_alloc(wlc, osh); 1924 qi = wlc_txq_alloc(wlc, osh);
1923 if (qi == NULL) { 1925 if (qi == NULL) {
1924 WL_ERROR(("wl%d: %s: failed to malloc tx queue\n", unit, 1926 WL_ERROR("wl%d: %s: failed to malloc tx queue\n",
1925 __func__)); 1927 unit, __func__);
1926 err = 100; 1928 err = 100;
1927 goto fail; 1929 goto fail;
1928 } 1930 }
@@ -2008,7 +2010,7 @@ void *wlc_attach(void *wl, u16 vendor, u16 device, uint unit, bool piomode,
2008 return (void *)wlc; 2010 return (void *)wlc;
2009 2011
2010 fail: 2012 fail:
2011 WL_ERROR(("wl%d: %s: failed with err %d\n", unit, __func__, err)); 2013 WL_ERROR("wl%d: %s: failed with err %d\n", unit, __func__, err);
2012 if (wlc) 2014 if (wlc)
2013 wlc_detach(wlc); 2015 wlc_detach(wlc);
2014 2016
@@ -2026,7 +2028,8 @@ static void wlc_attach_antgain_init(struct wlc_info *wlc)
2026 /* default antenna gain for srom rev 1 is 2 dBm (8 qdbm) */ 2028 /* default antenna gain for srom rev 1 is 2 dBm (8 qdbm) */
2027 wlc->band->antgain = 8; 2029 wlc->band->antgain = 8;
2028 } else if (wlc->band->antgain == -1) { 2030 } else if (wlc->band->antgain == -1) {
2029 WL_ERROR(("wl%d: %s: Invalid antennas available in srom, using 2dB\n", unit, __func__)); 2031 WL_ERROR("wl%d: %s: Invalid antennas available in srom, using 2dB\n",
2032 unit, __func__);
2030 wlc->band->antgain = 8; 2033 wlc->band->antgain = 8;
2031 } else { 2034 } else {
2032 s8 gain, fract; 2035 s8 gain, fract;
@@ -2065,7 +2068,8 @@ static bool wlc_attach_stf_ant_init(struct wlc_info *wlc)
2065 aa = (s8) getintvar(vars, 2068 aa = (s8) getintvar(vars,
2066 (BAND_5G(bandtype) ? "aa1" : "aa0")); 2069 (BAND_5G(bandtype) ? "aa1" : "aa0"));
2067 if ((aa < 1) || (aa > 15)) { 2070 if ((aa < 1) || (aa > 15)) {
2068 WL_ERROR(("wl%d: %s: Invalid antennas available in srom (0x%x), using 3.\n", unit, __func__, aa)); 2071 WL_ERROR("wl%d: %s: Invalid antennas available in srom (0x%x), using 3\n",
2072 unit, __func__, aa);
2069 aa = 3; 2073 aa = 3;
2070 } 2074 }
2071 2075
@@ -2132,7 +2136,7 @@ uint wlc_detach(struct wlc_info *wlc)
2132 if (wlc == NULL) 2136 if (wlc == NULL)
2133 return 0; 2137 return 0;
2134 2138
2135 WL_TRACE(("wl%d: %s\n", wlc->pub->unit, __func__)); 2139 WL_TRACE("wl%d: %s\n", wlc->pub->unit, __func__);
2136 2140
2137 ASSERT(!wlc->pub->up); 2141 ASSERT(!wlc->pub->up);
2138 2142
@@ -2340,7 +2344,7 @@ static void wlc_radio_timer(void *arg)
2340 struct wlc_info *wlc = (struct wlc_info *) arg; 2344 struct wlc_info *wlc = (struct wlc_info *) arg;
2341 2345
2342 if (DEVICEREMOVED(wlc)) { 2346 if (DEVICEREMOVED(wlc)) {
2343 WL_ERROR(("wl%d: %s: dead chip\n", wlc->pub->unit, __func__)); 2347 WL_ERROR("wl%d: %s: dead chip\n", wlc->pub->unit, __func__);
2344 wl_down(wlc->wl); 2348 wl_down(wlc->wl);
2345 return; 2349 return;
2346 } 2350 }
@@ -2441,13 +2445,13 @@ static void wlc_watchdog(void *arg)
2441 int i; 2445 int i;
2442 wlc_bsscfg_t *cfg; 2446 wlc_bsscfg_t *cfg;
2443 2447
2444 WL_TRACE(("wl%d: wlc_watchdog\n", wlc->pub->unit)); 2448 WL_TRACE("wl%d: wlc_watchdog\n", wlc->pub->unit);
2445 2449
2446 if (!wlc->pub->up) 2450 if (!wlc->pub->up)
2447 return; 2451 return;
2448 2452
2449 if (DEVICEREMOVED(wlc)) { 2453 if (DEVICEREMOVED(wlc)) {
2450 WL_ERROR(("wl%d: %s: dead chip\n", wlc->pub->unit, __func__)); 2454 WL_ERROR("wl%d: %s: dead chip\n", wlc->pub->unit, __func__);
2451 wl_down(wlc->wl); 2455 wl_down(wlc->wl);
2452 return; 2456 return;
2453 } 2457 }
@@ -2519,7 +2523,7 @@ static void wlc_watchdog(void *arg)
2519/* make interface operational */ 2523/* make interface operational */
2520int wlc_up(struct wlc_info *wlc) 2524int wlc_up(struct wlc_info *wlc)
2521{ 2525{
2522 WL_TRACE(("wl%d: %s:\n", wlc->pub->unit, __func__)); 2526 WL_TRACE("wl%d: %s:\n", wlc->pub->unit, __func__);
2523 2527
2524 /* HW is turned off so don't try to access it */ 2528 /* HW is turned off so don't try to access it */
2525 if (wlc->pub->hw_off || DEVICEREMOVED(wlc)) 2529 if (wlc->pub->hw_off || DEVICEREMOVED(wlc))
@@ -2564,7 +2568,8 @@ int wlc_up(struct wlc_info *wlc)
2564 if (!BSSCFG_STA(bsscfg) 2568 if (!BSSCFG_STA(bsscfg)
2565 || !bsscfg->enable || !bsscfg->BSS) 2569 || !bsscfg->enable || !bsscfg->BSS)
2566 continue; 2570 continue;
2567 WL_ERROR(("wl%d.%d: wlc_up: rfdisable -> " "wlc_bsscfg_disable()\n", wlc->pub->unit, idx)); 2571 WL_ERROR("wl%d.%d: wlc_up: rfdisable -> " "wlc_bsscfg_disable()\n",
2572 wlc->pub->unit, idx);
2568 } 2573 }
2569 } 2574 }
2570 } else 2575 } else
@@ -2664,12 +2669,12 @@ uint wlc_down(struct wlc_info *wlc)
2664 bool dev_gone = false; 2669 bool dev_gone = false;
2665 wlc_txq_info_t *qi; 2670 wlc_txq_info_t *qi;
2666 2671
2667 WL_TRACE(("wl%d: %s:\n", wlc->pub->unit, __func__)); 2672 WL_TRACE("wl%d: %s:\n", wlc->pub->unit, __func__);
2668 2673
2669 /* check if we are already in the going down path */ 2674 /* check if we are already in the going down path */
2670 if (wlc->going_down) { 2675 if (wlc->going_down) {
2671 WL_ERROR(("wl%d: %s: Driver going down so return\n", 2676 WL_ERROR("wl%d: %s: Driver going down so return\n",
2672 wlc->pub->unit, __func__)); 2677 wlc->pub->unit, __func__);
2673 return 0; 2678 return 0;
2674 } 2679 }
2675 if (!wlc->pub->up) 2680 if (!wlc->pub->up)
@@ -2728,8 +2733,8 @@ uint wlc_down(struct wlc_info *wlc)
2728 2733
2729 /* Verify all packets are flushed from the driver */ 2734 /* Verify all packets are flushed from the driver */
2730 if (wlc->osh->pktalloced != 0) { 2735 if (wlc->osh->pktalloced != 0) {
2731 WL_ERROR(("%d packets not freed at wlc_down!!!!!!\n", 2736 WL_ERROR("%d packets not freed at wlc_down!!!!!!\n",
2732 wlc->osh->pktalloced)); 2737 wlc->osh->pktalloced);
2733 } 2738 }
2734#ifdef BCMDBG 2739#ifdef BCMDBG
2735 /* Since all the packets should have been freed, 2740 /* Since all the packets should have been freed,
@@ -2826,8 +2831,8 @@ int wlc_set_gmode(struct wlc_info *wlc, u8 gmode, bool config)
2826 2831
2827 default: 2832 default:
2828 /* Error */ 2833 /* Error */
2829 WL_ERROR(("wl%d: %s: invalid gmode %d\n", wlc->pub->unit, 2834 WL_ERROR("wl%d: %s: invalid gmode %d\n",
2830 __func__, gmode)); 2835 wlc->pub->unit, __func__, gmode);
2831 return BCME_UNSUPPORTED; 2836 return BCME_UNSUPPORTED;
2832 } 2837 }
2833 2838
@@ -3082,7 +3087,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
3082 3087
3083 /* If the device is turned off, then it's not "removed" */ 3088 /* If the device is turned off, then it's not "removed" */
3084 if (!wlc->pub->hw_off && DEVICEREMOVED(wlc)) { 3089 if (!wlc->pub->hw_off && DEVICEREMOVED(wlc)) {
3085 WL_ERROR(("wl%d: %s: dead chip\n", wlc->pub->unit, __func__)); 3090 WL_ERROR("wl%d: %s: dead chip\n", wlc->pub->unit, __func__);
3086 wl_down(wlc->wl); 3091 wl_down(wlc->wl);
3087 return BCME_ERROR; 3092 return BCME_ERROR;
3088 } 3093 }
@@ -3102,8 +3107,8 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
3102 bool_val = val != 0; 3107 bool_val = val != 0;
3103 3108
3104 if (cmd != WLC_SET_CHANNEL) 3109 if (cmd != WLC_SET_CHANNEL)
3105 WL_NONE(("WLC_IOCTL: cmd %d val 0x%x (%d) len %d\n", cmd, 3110 WL_NONE("WLC_IOCTL: cmd %d val 0x%x (%d) len %d\n",
3106 (uint) val, val, len)); 3111 cmd, (uint)val, val, len);
3107 3112
3108 bcmerror = 0; 3113 bcmerror = 0;
3109 regs = wlc->regs; 3114 regs = wlc->regs;
@@ -3123,8 +3128,8 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
3123 3128
3124 default: 3129 default:
3125 if ((arg == NULL) || (len <= 0)) { 3130 if ((arg == NULL) || (len <= 0)) {
3126 WL_ERROR(("wl%d: %s: Command %d needs arguments\n", 3131 WL_ERROR("wl%d: %s: Command %d needs arguments\n",
3127 wlc->pub->unit, __func__, cmd)); 3132 wlc->pub->unit, __func__, cmd);
3128 bcmerror = BCME_BADARG; 3133 bcmerror = BCME_BADARG;
3129 goto done; 3134 goto done;
3130 } 3135 }
@@ -3457,8 +3462,8 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
3457 /* 4322 supports antdiv in phy, no need to set it to ucode */ 3462 /* 4322 supports antdiv in phy, no need to set it to ucode */
3458 if (WLCISNPHY(wlc->band) 3463 if (WLCISNPHY(wlc->band)
3459 && D11REV_IS(wlc->pub->corerev, 16)) { 3464 && D11REV_IS(wlc->pub->corerev, 16)) {
3460 WL_ERROR(("wl%d: can't set ucantdiv for 4322\n", 3465 WL_ERROR("wl%d: can't set ucantdiv for 4322\n",
3461 wlc->pub->unit)); 3466 wlc->pub->unit);
3462 bcmerror = BCME_UNSUPPORTED; 3467 bcmerror = BCME_UNSUPPORTED;
3463 } else 3468 } else
3464 wlc_mhf(wlc, MHF1, MHF1_ANTDIV, 3469 wlc_mhf(wlc, MHF1, MHF1_ANTDIV,
@@ -3555,8 +3560,8 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
3555 if ((radiomask == 0) || (radiomask & ~validbits) 3560 if ((radiomask == 0) || (radiomask & ~validbits)
3556 || (radioval & ~validbits) 3561 || (radioval & ~validbits)
3557 || ((radioval & ~radiomask) != 0)) { 3562 || ((radioval & ~radiomask) != 0)) {
3558 WL_ERROR(("SET_RADIO with wrong bits 0x%x\n", 3563 WL_ERROR("SET_RADIO with wrong bits 0x%x\n",
3559 val)); 3564 val);
3560 bcmerror = BCME_RANGE; 3565 bcmerror = BCME_RANGE;
3561 break; 3566 break;
3562 } 3567 }
@@ -4192,7 +4197,7 @@ _wlc_ioctl(struct wlc_info *wlc, int cmd, void *arg, int len,
4192#endif 4197#endif
4193 4198
4194 case WLC_LAST: 4199 case WLC_LAST:
4195 WL_ERROR(("%s: WLC_LAST\n", __func__)); 4200 WL_ERROR("%s: WLC_LAST\n", __func__);
4196 } 4201 }
4197 done: 4202 done:
4198 4203
@@ -4402,8 +4407,8 @@ wlc_iovar_op(struct wlc_info *wlc, const char *name,
4402 4407
4403 if (!set && (len == sizeof(int)) && 4408 if (!set && (len == sizeof(int)) &&
4404 !(IS_ALIGNED((unsigned long)(arg), (uint) sizeof(int)))) { 4409 !(IS_ALIGNED((unsigned long)(arg), (uint) sizeof(int)))) {
4405 WL_ERROR(("wl%d: %s unaligned get ptr for %s\n", 4410 WL_ERROR("wl%d: %s unaligned get ptr for %s\n",
4406 wlc->pub->unit, __func__, name)); 4411 wlc->pub->unit, __func__, name);
4407 ASSERT(0); 4412 ASSERT(0);
4408 } 4413 }
4409 4414
@@ -4530,7 +4535,7 @@ wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid,
4530 bool bool_val2; 4535 bool bool_val2;
4531 wlc_bss_info_t *current_bss; 4536 wlc_bss_info_t *current_bss;
4532 4537
4533 WL_TRACE(("wl%d: %s\n", wlc->pub->unit, __func__)); 4538 WL_TRACE("wl%d: %s\n", wlc->pub->unit, __func__);
4534 4539
4535 bsscfg = NULL; 4540 bsscfg = NULL;
4536 current_bss = NULL; 4541 current_bss = NULL;
@@ -4553,8 +4558,8 @@ wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid,
4553 bool_val = (int_val != 0) ? true : false; 4558 bool_val = (int_val != 0) ? true : false;
4554 bool_val2 = (int_val2 != 0) ? true : false; 4559 bool_val2 = (int_val2 != 0) ? true : false;
4555 4560
4556 WL_TRACE(("wl%d: %s: id %d\n", wlc->pub->unit, __func__, 4561 WL_TRACE("wl%d: %s: id %d\n",
4557 IOV_ID(actionid))); 4562 wlc->pub->unit, __func__, IOV_ID(actionid));
4558 /* Do the actual parameter implementation */ 4563 /* Do the actual parameter implementation */
4559 switch (actionid) { 4564 switch (actionid) {
4560 4565
@@ -4612,7 +4617,7 @@ wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid,
4612 break; 4617 break;
4613 4618
4614 default: 4619 default:
4615 WL_ERROR(("wl%d: %s: unsupported\n", wlc->pub->unit, __func__)); 4620 WL_ERROR("wl%d: %s: unsupported\n", wlc->pub->unit, __func__);
4616 err = BCME_UNSUPPORTED; 4621 err = BCME_UNSUPPORTED;
4617 break; 4622 break;
4618 } 4623 }
@@ -4747,8 +4752,8 @@ void wlc_statsupd(struct wlc_info *wlc)
4747 /* check for rx fifo 0 overflow */ 4752 /* check for rx fifo 0 overflow */
4748 delta = (u16) (wlc->core->macstat_snapshot->rxf0ovfl - rxf0ovfl); 4753 delta = (u16) (wlc->core->macstat_snapshot->rxf0ovfl - rxf0ovfl);
4749 if (delta) 4754 if (delta)
4750 WL_ERROR(("wl%d: %u rx fifo 0 overflows!\n", wlc->pub->unit, 4755 WL_ERROR("wl%d: %u rx fifo 0 overflows!\n",
4751 delta)); 4756 wlc->pub->unit, delta);
4752 4757
4753 /* check for tx fifo underflows */ 4758 /* check for tx fifo underflows */
4754 for (i = 0; i < NFIFO; i++) { 4759 for (i = 0; i < NFIFO; i++) {
@@ -4756,8 +4761,8 @@ void wlc_statsupd(struct wlc_info *wlc)
4756 (u16) (wlc->core->macstat_snapshot->txfunfl[i] - 4761 (u16) (wlc->core->macstat_snapshot->txfunfl[i] -
4757 txfunfl[i]); 4762 txfunfl[i]);
4758 if (delta) 4763 if (delta)
4759 WL_ERROR(("wl%d: %u tx fifo %d underflows!\n", 4764 WL_ERROR("wl%d: %u tx fifo %d underflows!\n",
4760 wlc->pub->unit, delta, i)); 4765 wlc->pub->unit, delta, i);
4761 } 4766 }
4762#endif /* BCMDBG */ 4767#endif /* BCMDBG */
4763 4768
@@ -4806,7 +4811,7 @@ void wlc_statsupd(struct wlc_info *wlc)
4806bool wlc_chipmatch(u16 vendor, u16 device) 4811bool wlc_chipmatch(u16 vendor, u16 device)
4807{ 4812{
4808 if (vendor != VENDOR_BROADCOM) { 4813 if (vendor != VENDOR_BROADCOM) {
4809 WL_ERROR(("wlc_chipmatch: unknown vendor id %04x\n", vendor)); 4814 WL_ERROR("wlc_chipmatch: unknown vendor id %04x\n", vendor);
4810 return false; 4815 return false;
4811 } 4816 }
4812 4817
@@ -4818,7 +4823,7 @@ bool wlc_chipmatch(u16 vendor, u16 device)
4818 if ((device == BCM43236_D11N_ID) || (device == BCM43236_D11N2G_ID)) 4823 if ((device == BCM43236_D11N_ID) || (device == BCM43236_D11N2G_ID))
4819 return true; 4824 return true;
4820 4825
4821 WL_ERROR(("wlc_chipmatch: unknown device id %04x\n", device)); 4826 WL_ERROR("wlc_chipmatch: unknown device id %04x\n", device);
4822 return false; 4827 return false;
4823} 4828}
4824 4829
@@ -5009,8 +5014,8 @@ wlc_prec_enq_head(struct wlc_info *wlc, struct pktq *q, struct sk_buff *pkt,
5009 p = pktq_peek_tail(q, &eprec); 5014 p = pktq_peek_tail(q, &eprec);
5010 ASSERT(p != NULL); 5015 ASSERT(p != NULL);
5011 if (eprec > prec) { 5016 if (eprec > prec) {
5012 WL_ERROR(("%s: Failing: eprec %d > prec %d\n", __func__, 5017 WL_ERROR("%s: Failing: eprec %d > prec %d\n",
5013 eprec, prec)); 5018 __func__, eprec, prec);
5014 return false; 5019 return false;
5015 } 5020 }
5016 } 5021 }
@@ -5026,8 +5031,8 @@ wlc_prec_enq_head(struct wlc_info *wlc, struct pktq *q, struct sk_buff *pkt,
5026 5031
5027 /* Refuse newer packet unless configured to discard oldest */ 5032 /* Refuse newer packet unless configured to discard oldest */
5028 if (eprec == prec && !discard_oldest) { 5033 if (eprec == prec && !discard_oldest) {
5029 WL_ERROR(("%s: No where to go, prec == %d\n", __func__, 5034 WL_ERROR("%s: No where to go, prec == %d\n",
5030 prec)); 5035 __func__, prec);
5031 return false; 5036 return false;
5032 } 5037 }
5033 5038
@@ -5075,8 +5080,8 @@ void BCMFASTPATH wlc_txq_enq(void *ctx, struct scb *scb, struct sk_buff *sdu,
5075 if (!wlc_prec_enq(wlc, q, sdu, prec)) { 5080 if (!wlc_prec_enq(wlc, q, sdu, prec)) {
5076 if (!EDCF_ENAB(wlc->pub) 5081 if (!EDCF_ENAB(wlc->pub)
5077 || (wlc->pub->wlfeatureflag & WL_SWFL_FLOWCONTROL)) 5082 || (wlc->pub->wlfeatureflag & WL_SWFL_FLOWCONTROL))
5078 WL_ERROR(("wl%d: wlc_txq_enq: txq overflow\n", 5083 WL_ERROR("wl%d: wlc_txq_enq: txq overflow\n",
5079 wlc->pub->unit)); 5084 wlc->pub->unit);
5080 5085
5081 /* ASSERT(9 == 8); *//* XXX we might hit this condtion in case packet flooding from mac80211 stack */ 5086 /* ASSERT(9 == 8); *//* XXX we might hit this condtion in case packet flooding from mac80211 stack */
5082 pkt_buf_free_skb(wlc->osh, sdu, true); 5087 pkt_buf_free_skb(wlc->osh, sdu, true);
@@ -5252,8 +5257,8 @@ wlc_txfifo(struct wlc_info *wlc, uint fifo, struct sk_buff *p, bool commit,
5252 */ 5257 */
5253 if (commit) { 5258 if (commit) {
5254 TXPKTPENDINC(wlc, fifo, txpktpend); 5259 TXPKTPENDINC(wlc, fifo, txpktpend);
5255 WL_TRACE(("wlc_txfifo, pktpend inc %d to %d\n", txpktpend, 5260 WL_TRACE("wlc_txfifo, pktpend inc %d to %d\n",
5256 TXPKTPENDGET(wlc, fifo))); 5261 txpktpend, TXPKTPENDGET(wlc, fifo));
5257 } 5262 }
5258 5263
5259 /* Commit BCMC sequence number in the SHM frame ID location */ 5264 /* Commit BCMC sequence number in the SHM frame ID location */
@@ -5261,7 +5266,7 @@ wlc_txfifo(struct wlc_info *wlc, uint fifo, struct sk_buff *p, bool commit,
5261 BCMCFID(wlc, frameid); 5266 BCMCFID(wlc, frameid);
5262 5267
5263 if (dma_txfast(wlc->hw->di[fifo], p, commit) < 0) { 5268 if (dma_txfast(wlc->hw->di[fifo], p, commit) < 0) {
5264 WL_ERROR(("wlc_txfifo: fatal, toss frames !!!\n")); 5269 WL_ERROR("wlc_txfifo: fatal, toss frames !!!\n");
5265 } 5270 }
5266} 5271}
5267 5272
@@ -5301,7 +5306,8 @@ wlc_compute_airtime(struct wlc_info *wlc, ratespec_t rspec, uint length)
5301 usec = (length << 3) / 11; 5306 usec = (length << 3) / 11;
5302 break; 5307 break;
5303 default: 5308 default:
5304 WL_ERROR(("wl%d: wlc_compute_airtime: unsupported rspec 0x%x\n", wlc->pub->unit, rspec)); 5309 WL_ERROR("wl%d: wlc_compute_airtime: unsupported rspec 0x%x\n",
5310 wlc->pub->unit, rspec);
5305 ASSERT((const char *)"Bad phy_rate" == NULL); 5311 ASSERT((const char *)"Bad phy_rate" == NULL);
5306 break; 5312 break;
5307 } 5313 }
@@ -5397,7 +5403,7 @@ static void wlc_cck_plcp_set(int rate_500, uint length, u8 *plcp)
5397 break; 5403 break;
5398 5404
5399 default: 5405 default:
5400 WL_ERROR(("wlc_cck_plcp_set: unsupported rate %d\n", rate_500)); 5406 WL_ERROR("wlc_cck_plcp_set: unsupported rate %d\n", rate_500);
5401 rate_500 = WLC_RATE_1M; 5407 rate_500 = WLC_RATE_1M;
5402 usec = length << 3; 5408 usec = length << 3;
5403 break; 5409 break;
@@ -5537,7 +5543,8 @@ u16 BCMFASTPATH wlc_phytxctl1_calc(struct wlc_info *wlc, ratespec_t rspec)
5537 bw = RSPEC_GET_BW(rspec); 5543 bw = RSPEC_GET_BW(rspec);
5538 /* 10Mhz is not supported yet */ 5544 /* 10Mhz is not supported yet */
5539 if (bw < PHY_TXC1_BW_20MHZ) { 5545 if (bw < PHY_TXC1_BW_20MHZ) {
5540 WL_ERROR(("wlc_phytxctl1_calc: bw %d is not supported yet, set to 20L\n", bw)); 5546 WL_ERROR("wlc_phytxctl1_calc: bw %d is not supported yet, set to 20L\n",
5547 bw);
5541 bw = PHY_TXC1_BW_20MHZ; 5548 bw = PHY_TXC1_BW_20MHZ;
5542 } 5549 }
5543 5550
@@ -5562,7 +5569,7 @@ u16 BCMFASTPATH wlc_phytxctl1_calc(struct wlc_info *wlc, ratespec_t rspec)
5562 /* get the phyctl byte from rate phycfg table */ 5569 /* get the phyctl byte from rate phycfg table */
5563 phycfg = wlc_rate_legacy_phyctl(RSPEC2RATE(rspec)); 5570 phycfg = wlc_rate_legacy_phyctl(RSPEC2RATE(rspec));
5564 if (phycfg == -1) { 5571 if (phycfg == -1) {
5565 WL_ERROR(("wlc_phytxctl1_calc: wrong legacy OFDM/CCK rate\n")); 5572 WL_ERROR("wlc_phytxctl1_calc: wrong legacy OFDM/CCK rate\n");
5566 ASSERT(0); 5573 ASSERT(0);
5567 phycfg = 0; 5574 phycfg = 0;
5568 } 5575 }
@@ -5722,8 +5729,8 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
5722 /* non-AP STA should never use BCMC queue */ 5729 /* non-AP STA should never use BCMC queue */
5723 ASSERT(queue != TX_BCMC_FIFO); 5730 ASSERT(queue != TX_BCMC_FIFO);
5724 if (queue == TX_BCMC_FIFO) { 5731 if (queue == TX_BCMC_FIFO) {
5725 WL_ERROR(("wl%d: %s: ASSERT queue == TX_BCMC!\n", 5732 WL_ERROR("wl%d: %s: ASSERT queue == TX_BCMC!\n",
5726 WLCWLUNIT(wlc), __func__)); 5733 WLCWLUNIT(wlc), __func__);
5727 frameid = bcmc_fid_generate(wlc, NULL, txh); 5734 frameid = bcmc_fid_generate(wlc, NULL, txh);
5728 } else { 5735 } else {
5729 /* Increment the counter for first fragment */ 5736 /* Increment the counter for first fragment */
@@ -5901,7 +5908,8 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
5901 5908
5902 if ((txrate[k]->flags & IEEE80211_TX_RC_MCS) 5909 if ((txrate[k]->flags & IEEE80211_TX_RC_MCS)
5903 && (!IS_MCS(rspec[k]))) { 5910 && (!IS_MCS(rspec[k]))) {
5904 WL_ERROR(("wl%d: %s: IEEE80211_TX_RC_MCS != IS_MCS(rspec)\n", WLCWLUNIT(wlc), __func__)); 5911 WL_ERROR("wl%d: %s: IEEE80211_TX_RC_MCS != IS_MCS(rspec)\n",
5912 WLCWLUNIT(wlc), __func__);
5905 ASSERT(0 && "Rate mismatch"); 5913 ASSERT(0 && "Rate mismatch");
5906 } 5914 }
5907 5915
@@ -6295,12 +6303,16 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
6295 } 6303 }
6296 } 6304 }
6297 } else 6305 } else
6298 WL_ERROR(("wl%d: %s txop invalid for rate %d\n", 6306 WL_ERROR("wl%d: %s txop invalid for rate %d\n",
6299 wlc->pub->unit, fifo_names[queue], 6307 wlc->pub->unit, fifo_names[queue],
6300 RSPEC2RATE(rspec[0]))); 6308 RSPEC2RATE(rspec[0]));
6301 6309
6302 if (dur > wlc->edcf_txop[ac]) 6310 if (dur > wlc->edcf_txop[ac])
6303 WL_ERROR(("wl%d: %s: %s txop exceeded phylen %d/%d dur %d/%d\n", wlc->pub->unit, __func__, fifo_names[queue], phylen, wlc->fragthresh[queue], dur, wlc->edcf_txop[ac])); 6311 WL_ERROR("wl%d: %s: %s txop exceeded phylen %d/%d dur %d/%d\n",
6312 wlc->pub->unit, __func__,
6313 fifo_names[queue],
6314 phylen, wlc->fragthresh[queue],
6315 dur, wlc->edcf_txop[ac]);
6304 } 6316 }
6305 } 6317 }
6306 6318
@@ -6406,8 +6418,8 @@ void wlc_high_dpc(struct wlc_info *wlc, u32 macintstatus)
6406 if (macintstatus & ~(MI_TBTT | MI_TXSTOP)) { 6418 if (macintstatus & ~(MI_TBTT | MI_TXSTOP)) {
6407 bcm_format_flags(int_flags, macintstatus, flagstr, 6419 bcm_format_flags(int_flags, macintstatus, flagstr,
6408 sizeof(flagstr)); 6420 sizeof(flagstr));
6409 WL_TRACE(("wl%d: macintstatus 0x%x %s\n", wlc->pub->unit, 6421 WL_TRACE("wl%d: macintstatus 0x%x %s\n",
6410 macintstatus, flagstr)); 6422 wlc->pub->unit, macintstatus, flagstr);
6411 } 6423 }
6412#endif /* BCMDBG */ 6424#endif /* BCMDBG */
6413 6425
@@ -6422,7 +6434,8 @@ void wlc_high_dpc(struct wlc_info *wlc, u32 macintstatus)
6422 wlc_tbtt(wlc, regs); 6434 wlc_tbtt(wlc, regs);
6423 6435
6424 if (macintstatus & MI_GP0) { 6436 if (macintstatus & MI_GP0) {
6425 WL_ERROR(("wl%d: PSM microcode watchdog fired at %d (seconds). Resetting.\n", wlc->pub->unit, wlc->pub->now)); 6437 WL_ERROR("wl%d: PSM microcode watchdog fired at %d (seconds). Resetting.\n",
6438 wlc->pub->unit, wlc->pub->now);
6426 6439
6427 printk_once("%s : PSM Watchdog, chipid 0x%x, chiprev 0x%x\n", 6440 printk_once("%s : PSM Watchdog, chipid 0x%x, chiprev 0x%x\n",
6428 __func__, wlc->pub->sih->chip, 6441 __func__, wlc->pub->sih->chip,
@@ -6440,7 +6453,9 @@ void wlc_high_dpc(struct wlc_info *wlc, u32 macintstatus)
6440 } 6453 }
6441 6454
6442 if (macintstatus & MI_RFDISABLE) { 6455 if (macintstatus & MI_RFDISABLE) {
6443 WL_ERROR(("wl%d: MAC Detected a change on the RF Disable Input 0x%x\n", wlc->pub->unit, R_REG(wlc->osh, &regs->phydebug) & PDBG_RFD)); 6456 WL_ERROR("wl%d: MAC Detected a change on the RF Disable Input 0x%x\n",
6457 wlc->pub->unit,
6458 R_REG(wlc->osh, &regs->phydebug) & PDBG_RFD);
6444 /* delay the cleanup to wl_down in IBSS case */ 6459 /* delay the cleanup to wl_down in IBSS case */
6445 if ((R_REG(wlc->osh, &regs->phydebug) & PDBG_RFD)) { 6460 if ((R_REG(wlc->osh, &regs->phydebug) & PDBG_RFD)) {
6446 int idx; 6461 int idx;
@@ -6449,7 +6464,8 @@ void wlc_high_dpc(struct wlc_info *wlc, u32 macintstatus)
6449 if (!BSSCFG_STA(bsscfg) || !bsscfg->enable 6464 if (!BSSCFG_STA(bsscfg) || !bsscfg->enable
6450 || !bsscfg->BSS) 6465 || !bsscfg->BSS)
6451 continue; 6466 continue;
6452 WL_ERROR(("wl%d: wlc_dpc: rfdisable -> wlc_bsscfg_disable()\n", wlc->pub->unit)); 6467 WL_ERROR("wl%d: wlc_dpc: rfdisable -> wlc_bsscfg_disable()\n",
6468 wlc->pub->unit);
6453 } 6469 }
6454 } 6470 }
6455 } 6471 }
@@ -6485,7 +6501,8 @@ static void *wlc_15420war(struct wlc_info *wlc, uint queue)
6485 if (dma_txactive(wlc->hw->di[queue]) == 0) { 6501 if (dma_txactive(wlc->hw->di[queue]) == 0) {
6486 WLCNTINCR(wlc->pub->_cnt->txdmawar); 6502 WLCNTINCR(wlc->pub->_cnt->txdmawar);
6487 if (!dma_txreset(di)) 6503 if (!dma_txreset(di))
6488 WL_ERROR(("wl%d: %s: dma_txreset[%d]: cannot stop dma\n", wlc->pub->unit, __func__, queue)); 6504 WL_ERROR("wl%d: %s: dma_txreset[%d]: cannot stop dma\n",
6505 wlc->pub->unit, __func__, queue);
6489 dma_txinit(di); 6506 dma_txinit(di);
6490 } 6507 }
6491 return p; 6508 return p;
@@ -6538,7 +6555,7 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2)
6538 ((txs-> 6555 ((txs->
6539 status & TX_STATUS_FRM_RTX_MASK) >> 6556 status & TX_STATUS_FRM_RTX_MASK) >>
6540 TX_STATUS_FRM_RTX_SHIFT)); 6557 TX_STATUS_FRM_RTX_SHIFT));
6541 WL_ERROR(("%s: INTERMEDIATE but not AMPDU\n", __func__)); 6558 WL_ERROR("%s: INTERMEDIATE but not AMPDU\n", __func__);
6542 return false; 6559 return false;
6543 } 6560 }
6544 6561
@@ -6563,8 +6580,8 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2)
6563 mcl = ltoh16(txh->MacTxControlLow); 6580 mcl = ltoh16(txh->MacTxControlLow);
6564 6581
6565 if (txs->phyerr) { 6582 if (txs->phyerr) {
6566 WL_ERROR(("phyerr 0x%x, rate 0x%x\n", txs->phyerr, 6583 WL_ERROR("phyerr 0x%x, rate 0x%x\n",
6567 txh->MainRates)); 6584 txs->phyerr, txh->MainRates);
6568 wlc_print_txdesc(txh); 6585 wlc_print_txdesc(txh);
6569 wlc_print_txstatus(txs); 6586 wlc_print_txstatus(txs);
6570 } 6587 }
@@ -6595,8 +6612,8 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2)
6595 6612
6596 supr_status = txs->status & TX_STATUS_SUPR_MASK; 6613 supr_status = txs->status & TX_STATUS_SUPR_MASK;
6597 if (supr_status == TX_STATUS_SUPR_BADCH) 6614 if (supr_status == TX_STATUS_SUPR_BADCH)
6598 WL_NONE(("%s: Pkt tx suppressed, possibly channel %d\n", 6615 WL_NONE("%s: Pkt tx suppressed, possibly channel %d\n",
6599 __func__, CHSPEC_CHANNEL(wlc->default_bss->chanspec))); 6616 __func__, CHSPEC_CHANNEL(wlc->default_bss->chanspec));
6600 6617
6601 tx_rts = htol16(txh->MacTxControlLow) & TXC_SENDRTS; 6618 tx_rts = htol16(txh->MacTxControlLow) & TXC_SENDRTS;
6602 tx_frame_count = 6619 tx_frame_count =
@@ -6607,7 +6624,7 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2)
6607 lastframe = (fc & FC_MOREFRAG) == 0; 6624 lastframe = (fc & FC_MOREFRAG) == 0;
6608 6625
6609 if (!lastframe) { 6626 if (!lastframe) {
6610 WL_ERROR(("Not last frame!\n")); 6627 WL_ERROR("Not last frame!\n");
6611 } else { 6628 } else {
6612 u16 sfbl, lfbl; 6629 u16 sfbl, lfbl;
6613 ieee80211_tx_info_clear_status(tx_info); 6630 ieee80211_tx_info_clear_status(tx_info);
@@ -6658,8 +6675,8 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2)
6658 ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw, p); 6675 ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw, p);
6659 WLCNTINCR(wlc->pub->_cnt->ieee_tx_status); 6676 WLCNTINCR(wlc->pub->_cnt->ieee_tx_status);
6660 } else { 6677 } else {
6661 WL_ERROR(("%s: Not last frame => not calling tx_status\n", 6678 WL_ERROR("%s: Not last frame => not calling tx_status\n",
6662 __func__)); 6679 __func__);
6663 } 6680 }
6664 6681
6665 return false; 6682 return false;
@@ -6677,8 +6694,8 @@ void BCMFASTPATH
6677wlc_txfifo_complete(struct wlc_info *wlc, uint fifo, s8 txpktpend) 6694wlc_txfifo_complete(struct wlc_info *wlc, uint fifo, s8 txpktpend)
6678{ 6695{
6679 TXPKTPENDDEC(wlc, fifo, txpktpend); 6696 TXPKTPENDDEC(wlc, fifo, txpktpend);
6680 WL_TRACE(("wlc_txfifo_complete, pktpend dec %d to %d\n", txpktpend, 6697 WL_TRACE("wlc_txfifo_complete, pktpend dec %d to %d\n",
6681 TXPKTPENDGET(wlc, fifo))); 6698 txpktpend, TXPKTPENDGET(wlc, fifo));
6682 6699
6683 /* There is more room; mark precedences related to this FIFO sendable */ 6700 /* There is more room; mark precedences related to this FIFO sendable */
6684 WLC_TX_FIFO_ENAB(wlc, fifo); 6701 WLC_TX_FIFO_ENAB(wlc, fifo);
@@ -6872,19 +6889,19 @@ prep_mac80211_status(struct wlc_info *wlc, d11rxhdr_t *rxh, struct sk_buff *p,
6872 rx_status->rate_idx = 11; 6889 rx_status->rate_idx = 11;
6873 break; 6890 break;
6874 default: 6891 default:
6875 WL_ERROR(("%s: Unknown rate\n", __func__)); 6892 WL_ERROR("%s: Unknown rate\n", __func__);
6876 } 6893 }
6877 6894
6878 /* Determine short preamble and rate_idx */ 6895 /* Determine short preamble and rate_idx */
6879 preamble = 0; 6896 preamble = 0;
6880 if (IS_CCK(rspec)) { 6897 if (IS_CCK(rspec)) {
6881 if (rxh->PhyRxStatus_0 & PRXS0_SHORTH) 6898 if (rxh->PhyRxStatus_0 & PRXS0_SHORTH)
6882 WL_ERROR(("Short CCK\n")); 6899 WL_ERROR("Short CCK\n");
6883 rx_status->flag |= RX_FLAG_SHORTPRE; 6900 rx_status->flag |= RX_FLAG_SHORTPRE;
6884 } else if (IS_OFDM(rspec)) { 6901 } else if (IS_OFDM(rspec)) {
6885 rx_status->flag |= RX_FLAG_SHORTPRE; 6902 rx_status->flag |= RX_FLAG_SHORTPRE;
6886 } else { 6903 } else {
6887 WL_ERROR(("%s: Unknown modulation\n", __func__)); 6904 WL_ERROR("%s: Unknown modulation\n", __func__);
6888 } 6905 }
6889 } 6906 }
6890 6907
@@ -6893,11 +6910,11 @@ prep_mac80211_status(struct wlc_info *wlc, d11rxhdr_t *rxh, struct sk_buff *p,
6893 6910
6894 if (rxh->RxStatus1 & RXS_DECERR) { 6911 if (rxh->RxStatus1 & RXS_DECERR) {
6895 rx_status->flag |= RX_FLAG_FAILED_PLCP_CRC; 6912 rx_status->flag |= RX_FLAG_FAILED_PLCP_CRC;
6896 WL_ERROR(("%s: RX_FLAG_FAILED_PLCP_CRC\n", __func__)); 6913 WL_ERROR("%s: RX_FLAG_FAILED_PLCP_CRC\n", __func__);
6897 } 6914 }
6898 if (rxh->RxStatus1 & RXS_FCSERR) { 6915 if (rxh->RxStatus1 & RXS_FCSERR) {
6899 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; 6916 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
6900 WL_ERROR(("%s: RX_FLAG_FAILED_FCS_CRC\n", __func__)); 6917 WL_ERROR("%s: RX_FLAG_FAILED_FCS_CRC\n", __func__);
6901 } 6918 }
6902} 6919}
6903 6920
@@ -6943,7 +6960,7 @@ void wlc_bss_list_free(struct wlc_info *wlc, wlc_bss_list_t *bss_list)
6943 wlc_bss_info_t *bi; 6960 wlc_bss_info_t *bi;
6944 6961
6945 if (!bss_list) { 6962 if (!bss_list) {
6946 WL_ERROR(("%s: Attempting to free NULL list\n", __func__)); 6963 WL_ERROR("%s: Attempting to free NULL list\n", __func__);
6947 return; 6964 return;
6948 } 6965 }
6949 /* inspect all BSS descriptor */ 6966 /* inspect all BSS descriptor */
@@ -6975,7 +6992,7 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p)
6975 uint len; 6992 uint len;
6976 bool is_amsdu; 6993 bool is_amsdu;
6977 6994
6978 WL_TRACE(("wl%d: wlc_recv\n", wlc->pub->unit)); 6995 WL_TRACE("wl%d: wlc_recv\n", wlc->pub->unit);
6979 6996
6980 osh = wlc->osh; 6997 osh = wlc->osh;
6981 6998
@@ -6992,8 +7009,8 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p)
6992 if (rxh->RxStatus1 & RXS_PBPRES) { 7009 if (rxh->RxStatus1 & RXS_PBPRES) {
6993 if (p->len < 2) { 7010 if (p->len < 2) {
6994 WLCNTINCR(wlc->pub->_cnt->rxrunt); 7011 WLCNTINCR(wlc->pub->_cnt->rxrunt);
6995 WL_ERROR(("wl%d: wlc_recv: rcvd runt of len %d\n", 7012 WL_ERROR("wl%d: wlc_recv: rcvd runt of len %d\n",
6996 wlc->pub->unit, p->len)); 7013 wlc->pub->unit, p->len);
6997 goto toss; 7014 goto toss;
6998 } 7015 }
6999 skb_pull(p, 2); 7016 skb_pull(p, 2);
@@ -7004,10 +7021,10 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p)
7004 7021
7005 if (rxh->RxStatus1 & RXS_FCSERR) { 7022 if (rxh->RxStatus1 & RXS_FCSERR) {
7006 if (wlc->pub->mac80211_state & MAC80211_PROMISC_BCNS) { 7023 if (wlc->pub->mac80211_state & MAC80211_PROMISC_BCNS) {
7007 WL_ERROR(("FCSERR while scanning******* - tossing\n")); 7024 WL_ERROR("FCSERR while scanning******* - tossing\n");
7008 goto toss; 7025 goto toss;
7009 } else { 7026 } else {
7010 WL_ERROR(("RCSERR!!!\n")); 7027 WL_ERROR("RCSERR!!!\n");
7011 goto toss; 7028 goto toss;
7012 } 7029 }
7013 } 7030 }
@@ -7028,9 +7045,8 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p)
7028 if (FC_TYPE(fc) == FC_TYPE_DATA || FC_TYPE(fc) == FC_TYPE_MNG) { 7045 if (FC_TYPE(fc) == FC_TYPE_DATA || FC_TYPE(fc) == FC_TYPE_MNG) {
7029 if ((is_zero_ether_addr(h->a2.octet) || 7046 if ((is_zero_ether_addr(h->a2.octet) ||
7030 is_multicast_ether_addr(h->a2.octet))) { 7047 is_multicast_ether_addr(h->a2.octet))) {
7031 WL_ERROR(("wl%d: %s: dropping a frame with " 7048 WL_ERROR("wl%d: %s: dropping a frame with invalid src mac address, a2: %pM\n",
7032 "invalid src mac address, a2: %pM\n", 7049 wlc->pub->unit, __func__, &h->a2);
7033 wlc->pub->unit, __func__, &h->a2));
7034 WLCNTINCR(wlc->pub->_cnt->rxbadsrcmac); 7050 WLCNTINCR(wlc->pub->_cnt->rxbadsrcmac);
7035 goto toss; 7051 goto toss;
7036 } 7052 }
@@ -7045,7 +7061,7 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p)
7045 } 7061 }
7046 7062
7047 if (is_amsdu) { 7063 if (is_amsdu) {
7048 WL_ERROR(("%s: is_amsdu causing toss\n", __func__)); 7064 WL_ERROR("%s: is_amsdu causing toss\n", __func__);
7049 goto toss; 7065 goto toss;
7050 } 7066 }
7051 7067
@@ -7067,8 +7083,8 @@ wlc_calc_lsig_len(struct wlc_info *wlc, ratespec_t ratespec, uint mac_len)
7067{ 7083{
7068 uint nsyms, len = 0, kNdps; 7084 uint nsyms, len = 0, kNdps;
7069 7085
7070 WL_TRACE(("wl%d: wlc_calc_lsig_len: rate %d, len%d\n", wlc->pub->unit, 7086 WL_TRACE("wl%d: wlc_calc_lsig_len: rate %d, len%d\n",
7071 RSPEC2RATE(ratespec), mac_len)); 7087 wlc->pub->unit, RSPEC2RATE(ratespec), mac_len);
7072 7088
7073 if (IS_MCS(ratespec)) { 7089 if (IS_MCS(ratespec)) {
7074 uint mcs = ratespec & RSPEC_RATE_MASK; 7090 uint mcs = ratespec & RSPEC_RATE_MASK;
@@ -7112,11 +7128,12 @@ wlc_calc_frame_time(struct wlc_info *wlc, ratespec_t ratespec, u8 preamble_type,
7112 7128
7113 if (rate == 0) { 7129 if (rate == 0) {
7114 ASSERT(0); 7130 ASSERT(0);
7115 WL_ERROR(("wl%d: WAR: using rate of 1 mbps\n", wlc->pub->unit)); 7131 WL_ERROR("wl%d: WAR: using rate of 1 mbps\n", wlc->pub->unit);
7116 rate = WLC_RATE_1M; 7132 rate = WLC_RATE_1M;
7117 } 7133 }
7118 7134
7119 WL_TRACE(("wl%d: wlc_calc_frame_time: rspec 0x%x, preamble_type %d, len%d\n", wlc->pub->unit, ratespec, preamble_type, mac_len)); 7135 WL_TRACE("wl%d: wlc_calc_frame_time: rspec 0x%x, preamble_type %d, len%d\n",
7136 wlc->pub->unit, ratespec, preamble_type, mac_len);
7120 7137
7121 if (IS_MCS(ratespec)) { 7138 if (IS_MCS(ratespec)) {
7122 uint mcs = ratespec & RSPEC_RATE_MASK; 7139 uint mcs = ratespec & RSPEC_RATE_MASK;
@@ -7180,7 +7197,8 @@ wlc_calc_frame_len(struct wlc_info *wlc, ratespec_t ratespec, u8 preamble_type,
7180 uint nsyms, mac_len, Ndps, kNdps; 7197 uint nsyms, mac_len, Ndps, kNdps;
7181 uint rate = RSPEC2RATE(ratespec); 7198 uint rate = RSPEC2RATE(ratespec);
7182 7199
7183 WL_TRACE(("wl%d: wlc_calc_frame_len: rspec 0x%x, preamble_type %d, dur %d\n", wlc->pub->unit, ratespec, preamble_type, dur)); 7200 WL_TRACE("wl%d: wlc_calc_frame_len: rspec 0x%x, preamble_type %d, dur %d\n",
7201 wlc->pub->unit, ratespec, preamble_type, dur);
7184 7202
7185 if (IS_MCS(ratespec)) { 7203 if (IS_MCS(ratespec)) {
7186 uint mcs = ratespec & RSPEC_RATE_MASK; 7204 uint mcs = ratespec & RSPEC_RATE_MASK;
@@ -7222,8 +7240,8 @@ wlc_calc_frame_len(struct wlc_info *wlc, ratespec_t ratespec, u8 preamble_type,
7222static uint 7240static uint
7223wlc_calc_ba_time(struct wlc_info *wlc, ratespec_t rspec, u8 preamble_type) 7241wlc_calc_ba_time(struct wlc_info *wlc, ratespec_t rspec, u8 preamble_type)
7224{ 7242{
7225 WL_TRACE(("wl%d: wlc_calc_ba_time: rspec 0x%x, preamble_type %d\n", 7243 WL_TRACE("wl%d: wlc_calc_ba_time: rspec 0x%x, preamble_type %d\n",
7226 wlc->pub->unit, rspec, preamble_type)); 7244 wlc->pub->unit, rspec, preamble_type);
7227 /* Spec 9.6: ack rate is the highest rate in BSSBasicRateSet that is less than 7245 /* Spec 9.6: ack rate is the highest rate in BSSBasicRateSet that is less than
7228 * or equal to the rate of the immediately previous frame in the FES 7246 * or equal to the rate of the immediately previous frame in the FES
7229 */ 7247 */
@@ -7241,8 +7259,8 @@ wlc_calc_ack_time(struct wlc_info *wlc, ratespec_t rspec, u8 preamble_type)
7241{ 7259{
7242 uint dur = 0; 7260 uint dur = 0;
7243 7261
7244 WL_TRACE(("wl%d: wlc_calc_ack_time: rspec 0x%x, preamble_type %d\n", 7262 WL_TRACE("wl%d: wlc_calc_ack_time: rspec 0x%x, preamble_type %d\n",
7245 wlc->pub->unit, rspec, preamble_type)); 7263 wlc->pub->unit, rspec, preamble_type);
7246 /* Spec 9.6: ack rate is the highest rate in BSSBasicRateSet that is less than 7264 /* Spec 9.6: ack rate is the highest rate in BSSBasicRateSet that is less than
7247 * or equal to the rate of the immediately previous frame in the FES 7265 * or equal to the rate of the immediately previous frame in the FES
7248 */ 7266 */
@@ -7259,8 +7277,8 @@ wlc_calc_ack_time(struct wlc_info *wlc, ratespec_t rspec, u8 preamble_type)
7259static uint 7277static uint
7260wlc_calc_cts_time(struct wlc_info *wlc, ratespec_t rspec, u8 preamble_type) 7278wlc_calc_cts_time(struct wlc_info *wlc, ratespec_t rspec, u8 preamble_type)
7261{ 7279{
7262 WL_TRACE(("wl%d: wlc_calc_cts_time: ratespec 0x%x, preamble_type %d\n", 7280 WL_TRACE("wl%d: wlc_calc_cts_time: ratespec 0x%x, preamble_type %d\n",
7263 wlc->pub->unit, rspec, preamble_type)); 7281 wlc->pub->unit, rspec, preamble_type);
7264 return wlc_calc_ack_time(wlc, rspec, preamble_type); 7282 return wlc_calc_ack_time(wlc, rspec, preamble_type);
7265} 7283}
7266 7284
@@ -7289,7 +7307,8 @@ void wlc_rate_lookup_init(struct wlc_info *wlc, wlc_rateset_t *rateset)
7289 rate = (rateset->rates[i] & RATE_MASK); 7307 rate = (rateset->rates[i] & RATE_MASK);
7290 7308
7291 if (rate > WLC_MAXRATE) { 7309 if (rate > WLC_MAXRATE) {
7292 WL_ERROR(("wlc_rate_lookup_init: invalid rate 0x%X in rate set\n", rateset->rates[i])); 7310 WL_ERROR("wlc_rate_lookup_init: invalid rate 0x%X in rate set\n",
7311 rateset->rates[i]);
7293 continue; 7312 continue;
7294 } 7313 }
7295 7314
@@ -7468,7 +7487,8 @@ bool wlc_valid_rate(struct wlc_info *wlc, ratespec_t rspec, int band,
7468 return true; 7487 return true;
7469 error: 7488 error:
7470 if (verbose) { 7489 if (verbose) {
7471 WL_ERROR(("wl%d: wlc_valid_rate: rate spec 0x%x not in hw_rateset\n", wlc->pub->unit, rspec)); 7490 WL_ERROR("wl%d: wlc_valid_rate: rate spec 0x%x not in hw_rateset\n",
7491 wlc->pub->unit, rspec);
7472 } 7492 }
7473 7493
7474 return false; 7494 return false;
@@ -7550,8 +7570,8 @@ wlc_compute_bcntsfoff(struct wlc_info *wlc, ratespec_t rspec,
7550 uint bcntsfoff = 0; 7570 uint bcntsfoff = 0;
7551 7571
7552 if (IS_MCS(rspec)) { 7572 if (IS_MCS(rspec)) {
7553 WL_ERROR(("wl%d: recd beacon with mcs rate; rspec 0x%x\n", 7573 WL_ERROR("wl%d: recd beacon with mcs rate; rspec 0x%x\n",
7554 wlc->pub->unit, rspec)); 7574 wlc->pub->unit, rspec);
7555 } else if (IS_OFDM(rspec)) { 7575 } else if (IS_OFDM(rspec)) {
7556 /* tx delay from MAC through phy to air (2.1 usec) + 7576 /* tx delay from MAC through phy to air (2.1 usec) +
7557 * phy header time (preamble + PLCP SIGNAL == 20 usec) + 7577 * phy header time (preamble + PLCP SIGNAL == 20 usec) +
@@ -7979,8 +7999,8 @@ mac80211_wlc_set_nrate(struct wlc_info *wlc, struct wlcband *cur_band,
7979 if (N_ENAB(wlc->pub) && ismcs) { 7999 if (N_ENAB(wlc->pub) && ismcs) {
7980 /* mcs only allowed when nmode */ 8000 /* mcs only allowed when nmode */
7981 if (stf > PHY_TXC1_MODE_SDM) { 8001 if (stf > PHY_TXC1_MODE_SDM) {
7982 WL_ERROR(("wl%d: %s: Invalid stf\n", WLCWLUNIT(wlc), 8002 WL_ERROR("wl%d: %s: Invalid stf\n",
7983 __func__)); 8003 WLCWLUNIT(wlc), __func__);
7984 bcmerror = BCME_RANGE; 8004 bcmerror = BCME_RANGE;
7985 goto done; 8005 goto done;
7986 } 8006 }
@@ -7990,8 +8010,8 @@ mac80211_wlc_set_nrate(struct wlc_info *wlc, struct wlcband *cur_band,
7990 if (!CHSPEC_IS40(wlc->home_chanspec) || 8010 if (!CHSPEC_IS40(wlc->home_chanspec) ||
7991 ((stf != PHY_TXC1_MODE_SISO) 8011 ((stf != PHY_TXC1_MODE_SISO)
7992 && (stf != PHY_TXC1_MODE_CDD))) { 8012 && (stf != PHY_TXC1_MODE_CDD))) {
7993 WL_ERROR(("wl%d: %s: Invalid mcs 32\n", 8013 WL_ERROR("wl%d: %s: Invalid mcs 32\n",
7994 WLCWLUNIT(wlc), __func__)); 8014 WLCWLUNIT(wlc), __func__);
7995 bcmerror = BCME_RANGE; 8015 bcmerror = BCME_RANGE;
7996 goto done; 8016 goto done;
7997 } 8017 }
@@ -7999,7 +8019,8 @@ mac80211_wlc_set_nrate(struct wlc_info *wlc, struct wlcband *cur_band,
7999 } else if (rate > HIGHEST_SINGLE_STREAM_MCS) { 8019 } else if (rate > HIGHEST_SINGLE_STREAM_MCS) {
8000 /* mcs > 7 must use stf SDM */ 8020 /* mcs > 7 must use stf SDM */
8001 if (stf != PHY_TXC1_MODE_SDM) { 8021 if (stf != PHY_TXC1_MODE_SDM) {
8002 WL_TRACE(("wl%d: %s: enabling SDM mode for mcs %d\n", WLCWLUNIT(wlc), __func__, rate)); 8022 WL_TRACE("wl%d: %s: enabling SDM mode for mcs %d\n",
8023 WLCWLUNIT(wlc), __func__, rate);
8003 stf = PHY_TXC1_MODE_SDM; 8024 stf = PHY_TXC1_MODE_SDM;
8004 } 8025 }
8005 } else { 8026 } else {
@@ -8007,37 +8028,37 @@ mac80211_wlc_set_nrate(struct wlc_info *wlc, struct wlcband *cur_band,
8007 if ((stf > PHY_TXC1_MODE_STBC) || 8028 if ((stf > PHY_TXC1_MODE_STBC) ||
8008 (!WLC_STBC_CAP_PHY(wlc) 8029 (!WLC_STBC_CAP_PHY(wlc)
8009 && (stf == PHY_TXC1_MODE_STBC))) { 8030 && (stf == PHY_TXC1_MODE_STBC))) {
8010 WL_ERROR(("wl%d: %s: Invalid STBC\n", 8031 WL_ERROR("wl%d: %s: Invalid STBC\n",
8011 WLCWLUNIT(wlc), __func__)); 8032 WLCWLUNIT(wlc), __func__);
8012 bcmerror = BCME_RANGE; 8033 bcmerror = BCME_RANGE;
8013 goto done; 8034 goto done;
8014 } 8035 }
8015 } 8036 }
8016 } else if (IS_OFDM(rate)) { 8037 } else if (IS_OFDM(rate)) {
8017 if ((stf != PHY_TXC1_MODE_CDD) && (stf != PHY_TXC1_MODE_SISO)) { 8038 if ((stf != PHY_TXC1_MODE_CDD) && (stf != PHY_TXC1_MODE_SISO)) {
8018 WL_ERROR(("wl%d: %s: Invalid OFDM\n", WLCWLUNIT(wlc), 8039 WL_ERROR("wl%d: %s: Invalid OFDM\n",
8019 __func__)); 8040 WLCWLUNIT(wlc), __func__);
8020 bcmerror = BCME_RANGE; 8041 bcmerror = BCME_RANGE;
8021 goto done; 8042 goto done;
8022 } 8043 }
8023 } else if (IS_CCK(rate)) { 8044 } else if (IS_CCK(rate)) {
8024 if ((cur_band->bandtype != WLC_BAND_2G) 8045 if ((cur_band->bandtype != WLC_BAND_2G)
8025 || (stf != PHY_TXC1_MODE_SISO)) { 8046 || (stf != PHY_TXC1_MODE_SISO)) {
8026 WL_ERROR(("wl%d: %s: Invalid CCK\n", WLCWLUNIT(wlc), 8047 WL_ERROR("wl%d: %s: Invalid CCK\n",
8027 __func__)); 8048 WLCWLUNIT(wlc), __func__);
8028 bcmerror = BCME_RANGE; 8049 bcmerror = BCME_RANGE;
8029 goto done; 8050 goto done;
8030 } 8051 }
8031 } else { 8052 } else {
8032 WL_ERROR(("wl%d: %s: Unknown rate type\n", WLCWLUNIT(wlc), 8053 WL_ERROR("wl%d: %s: Unknown rate type\n",
8033 __func__)); 8054 WLCWLUNIT(wlc), __func__);
8034 bcmerror = BCME_RANGE; 8055 bcmerror = BCME_RANGE;
8035 goto done; 8056 goto done;
8036 } 8057 }
8037 /* make sure multiple antennae are available for non-siso rates */ 8058 /* make sure multiple antennae are available for non-siso rates */
8038 if ((stf != PHY_TXC1_MODE_SISO) && (wlc->stf->txstreams == 1)) { 8059 if ((stf != PHY_TXC1_MODE_SISO) && (wlc->stf->txstreams == 1)) {
8039 WL_ERROR(("wl%d: %s: SISO antenna but !SISO request\n", 8060 WL_ERROR("wl%d: %s: SISO antenna but !SISO request\n",
8040 WLCWLUNIT(wlc), __func__)); 8061 WLCWLUNIT(wlc), __func__);
8041 bcmerror = BCME_RANGE; 8062 bcmerror = BCME_RANGE;
8042 goto done; 8063 goto done;
8043 } 8064 }
@@ -8068,7 +8089,7 @@ mac80211_wlc_set_nrate(struct wlc_info *wlc, struct wlcband *cur_band,
8068 8089
8069 return rspec; 8090 return rspec;
8070 done: 8091 done:
8071 WL_ERROR(("Hoark\n")); 8092 WL_ERROR("Hoark\n");
8072 return rate; 8093 return rate;
8073} 8094}
8074 8095
@@ -8082,8 +8103,7 @@ wlc_duty_cycle_set(struct wlc_info *wlc, int duty_cycle, bool isOFDM,
8082 isOFDM ? M_TX_IDLE_BUSY_RATIO_X_16_OFDM : 8103 isOFDM ? M_TX_IDLE_BUSY_RATIO_X_16_OFDM :
8083 M_TX_IDLE_BUSY_RATIO_X_16_CCK; 8104 M_TX_IDLE_BUSY_RATIO_X_16_CCK;
8084 if (duty_cycle > 100 || duty_cycle < 0) { 8105 if (duty_cycle > 100 || duty_cycle < 0) {
8085 WL_ERROR(("wl%d: duty cycle value off limit\n", 8106 WL_ERROR("wl%d: duty cycle value off limit\n", wlc->pub->unit);
8086 wlc->pub->unit));
8087 return BCME_RANGE; 8107 return BCME_RANGE;
8088 } 8108 }
8089 if (duty_cycle) 8109 if (duty_cycle)
@@ -8282,7 +8302,7 @@ void wlc_txflowcontrol(struct wlc_info *wlc, wlc_txq_info_t *qi,
8282 uint prio_bits; 8302 uint prio_bits;
8283 uint cur_bits; 8303 uint cur_bits;
8284 8304
8285 WL_ERROR(("%s: flow contro kicks in\n", __func__)); 8305 WL_ERROR("%s: flow control kicks in\n", __func__);
8286 8306
8287 if (prio == ALLPRIO) { 8307 if (prio == ALLPRIO) {
8288 prio_bits = TXQ_STOP_FOR_PRIOFC_MASK; 8308 prio_bits = TXQ_STOP_FOR_PRIOFC_MASK;
diff --git a/drivers/staging/brcm80211/sys/wlc_phy_shim.c b/drivers/staging/brcm80211/sys/wlc_phy_shim.c
index 5dcaa7d70045..8bd4ede4c92a 100644
--- a/drivers/staging/brcm80211/sys/wlc_phy_shim.c
+++ b/drivers/staging/brcm80211/sys/wlc_phy_shim.c
@@ -70,7 +70,8 @@ wlc_phy_shim_info_t *wlc_phy_shim_attach(struct wlc_hw_info *wlc_hw,
70 70
71 physhim = kzalloc(sizeof(wlc_phy_shim_info_t), GFP_ATOMIC); 71 physhim = kzalloc(sizeof(wlc_phy_shim_info_t), GFP_ATOMIC);
72 if (!physhim) { 72 if (!physhim) {
73 WL_ERROR(("wl%d: wlc_phy_shim_attach: out of mem\n", wlc_hw->unit)); 73 WL_ERROR("wl%d: wlc_phy_shim_attach: out of mem\n",
74 wlc_hw->unit);
74 return NULL; 75 return NULL;
75 } 76 }
76 physhim->wlc_hw = wlc_hw; 77 physhim->wlc_hw = wlc_hw;
diff --git a/drivers/staging/brcm80211/sys/wlc_stf.c b/drivers/staging/brcm80211/sys/wlc_stf.c
index 01ac0d2b3cdb..8975b09a7438 100644
--- a/drivers/staging/brcm80211/sys/wlc_stf.c
+++ b/drivers/staging/brcm80211/sys/wlc_stf.c
@@ -196,8 +196,8 @@ bool wlc_stf_stbc_rx_set(struct wlc_info *wlc, s32 int_val)
196 196
197static int wlc_stf_txcore_set(struct wlc_info *wlc, u8 Nsts, u8 core_mask) 197static int wlc_stf_txcore_set(struct wlc_info *wlc, u8 Nsts, u8 core_mask)
198{ 198{
199 WL_TRACE(("wl%d: %s: Nsts %d core_mask %x\n", 199 WL_TRACE("wl%d: %s: Nsts %d core_mask %x\n",
200 wlc->pub->unit, __func__, Nsts, core_mask)); 200 wlc->pub->unit, __func__, Nsts, core_mask);
201 201
202 ASSERT((Nsts > 0) && (Nsts <= MAX_STREAMS_SUPPORTED)); 202 ASSERT((Nsts > 0) && (Nsts <= MAX_STREAMS_SUPPORTED));
203 203
@@ -236,7 +236,7 @@ static int wlc_stf_spatial_policy_set(struct wlc_info *wlc, int val)
236 int i; 236 int i;
237 u8 core_mask = 0; 237 u8 core_mask = 0;
238 238
239 WL_TRACE(("wl%d: %s: val %x\n", wlc->pub->unit, __func__, val)); 239 WL_TRACE("wl%d: %s: val %x\n", wlc->pub->unit, __func__, val);
240 240
241 wlc->stf->spatial_policy = (s8) val; 241 wlc->stf->spatial_policy = (s8) val;
242 for (i = 1; i <= MAX_STREAMS_SUPPORTED; i++) { 242 for (i = 1; i <= MAX_STREAMS_SUPPORTED; i++) {
@@ -278,13 +278,15 @@ int wlc_stf_txchain_set(struct wlc_info *wlc, s32 int_val, bool force)
278 if (RSPEC_STF(wlc->bandstate[i]->rspec_override) 278 if (RSPEC_STF(wlc->bandstate[i]->rspec_override)
279 != PHY_TXC1_MODE_SISO) { 279 != PHY_TXC1_MODE_SISO) {
280 wlc->bandstate[i]->rspec_override = 0; 280 wlc->bandstate[i]->rspec_override = 0;
281 WL_ERROR(("%s(): temp sense override non-SISO" " rspec_override.\n", __func__)); 281 WL_ERROR("%s(): temp sense override non-SISO rspec_override\n",
282 __func__);
282 } 283 }
283 if (RSPEC_STF 284 if (RSPEC_STF
284 (wlc->bandstate[i]->mrspec_override) != 285 (wlc->bandstate[i]->mrspec_override) !=
285 PHY_TXC1_MODE_SISO) { 286 PHY_TXC1_MODE_SISO) {
286 wlc->bandstate[i]->mrspec_override = 0; 287 wlc->bandstate[i]->mrspec_override = 0;
287 WL_ERROR(("%s(): temp sense override non-SISO" " mrspec_override.\n", __func__)); 288 WL_ERROR("%s(): temp sense override non-SISO mrspec_override\n",
289 __func__);
288 } 290 }
289 } 291 }
290 } 292 }