[ar71xx] fix GPIO function select bit definitions (based on a patch by Jonas <jmajau...
[openwrt.git] / target / linux / s3c24xx / patches-2.6.26 / 1105-fix-wlan-disable.patch.patch
1 From 2d1fed81a5bac8db65fcfd9eabfb76d4c3deab31 Mon Sep 17 00:00:00 2001
2 From: Sameo <sameo@openedhand.com>
3 Date: Fri, 25 Jul 2008 23:06:04 +0100
4 Subject: [PATCH] fix-wlan-disable.patch
5
6 see
7 http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=1288
8 ---
9 .../sdio/function/wlan/ar6000/ar6000/ar6000_drv.c | 1 +
10 .../sdio/function/wlan/ar6000/ar6000/ar6000_drv.h | 1 +
11 .../function/wlan/ar6000/ar6000/wireless_ext.c | 19 +++++++++--
12 .../sdio/function/wlan/ar6000/include/wmi_api.h | 1 +
13 drivers/sdio/function/wlan/ar6000/wmi/wmi.c | 33 ++++++++++++++++++++
14 5 files changed, 52 insertions(+), 3 deletions(-)
15
16 diff --git a/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c b/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c
17 index bb9ef55..d35f31c 100644
18 --- a/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c
19 +++ b/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.c
20 @@ -704,6 +704,7 @@ ar6000_avail_ev(HTC_HANDLE HTCHandle)
21 ar->arHtcTarget = HTCHandle;
22 ar->arHifDevice = HTCGetHifDevice(HTCHandle);
23 ar->arWlanState = WLAN_ENABLED;
24 + ar->arRadioSwitch = WLAN_ENABLED;
25 ar->arDeviceIndex = device_index;
26
27 A_INIT_TIMER(&ar->arHBChallengeResp.timer, ar6000_detect_error, dev);
28 diff --git a/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h b/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h
29 index c7b6ec4..655288b 100644
30 --- a/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h
31 +++ b/drivers/sdio/function/wlan/ar6000/ar6000/ar6000_drv.h
32 @@ -201,6 +201,7 @@ typedef struct ar6_softc {
33 A_BOOL arWmiEnabled;
34 A_BOOL arWmiReady;
35 A_BOOL arConnected;
36 + A_BOOL arRadioSwitch;
37 HTC_HANDLE arHtcTarget;
38 void *arHifDevice;
39 spinlock_t arLock;
40 diff --git a/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c b/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c
41 index d775e4d..db749e2 100644
42 --- a/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c
43 +++ b/drivers/sdio/function/wlan/ar6000/ar6000/wireless_ext.c
44 @@ -649,8 +649,16 @@ ar6000_ioctl_siwtxpow(struct net_device *dev,
45 return -EIO;
46 }
47
48 - if (rrq->disabled) {
49 - return -EOPNOTSUPP;
50 + if (ar->arRadioSwitch == WLAN_ENABLED
51 + && rrq->disabled) {
52 + if (wmi_switch_radio(ar->arWmi, WLAN_DISABLED) < 0)
53 + return -EIO;
54 + ar->arRadioSwitch = WLAN_DISABLED;
55 + } else if (ar->arRadioSwitch == WLAN_DISABLED
56 + && !rrq->disabled) {
57 + if (wmi_switch_radio(ar->arWmi, WLAN_ENABLED) < 0)
58 + return -EIO;
59 + ar->arRadioSwitch = WLAN_ENABLED;
60 }
61
62 if (rrq->fixed) {
63 @@ -686,6 +694,11 @@ ar6000_ioctl_giwtxpow(struct net_device *dev,
64 return -EIO;
65 }
66
67 + if (ar->arRadioSwitch == WLAN_DISABLED) {
68 + rrq->disabled = 1;
69 + return 0;
70 + }
71 +
72 if (down_interruptible(&ar->arSem)) {
73 return -ERESTARTSYS;
74 }
75 @@ -1610,7 +1623,7 @@ ar6000_ioctl_giwrange(struct net_device *dev,
76 data->length = sizeof(struct iw_range);
77 A_MEMZERO(range, sizeof(struct iw_range));
78
79 - range->txpower_capa = 0;
80 + range->txpower_capa = IW_TXPOW_DBM;
81
82 range->min_pmp = 1 * 1024;
83 range->max_pmp = 65535 * 1024;
84 diff --git a/drivers/sdio/function/wlan/ar6000/include/wmi_api.h b/drivers/sdio/function/wlan/ar6000/include/wmi_api.h
85 index aa9a9c6..267edfd 100644
86 --- a/drivers/sdio/function/wlan/ar6000/include/wmi_api.h
87 +++ b/drivers/sdio/function/wlan/ar6000/include/wmi_api.h
88 @@ -168,6 +168,7 @@ A_STATUS wmi_set_pmkid_list_cmd(struct wmi_t *wmip,
89 WMI_SET_PMKID_LIST_CMD *pmkInfo);
90 A_STATUS wmi_set_txPwr_cmd(struct wmi_t *wmip, A_UINT8 dbM);
91 A_STATUS wmi_get_txPwr_cmd(struct wmi_t *wmip);
92 +A_STATUS wmi_switch_radio(struct wmi_t *wmip, A_UINT8 on);
93 A_STATUS wmi_addBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex, A_UINT8 *bssid);
94 A_STATUS wmi_deleteBadAp_cmd(struct wmi_t *wmip, A_UINT8 apIndex);
95 A_STATUS wmi_set_tkip_countermeasures_cmd(struct wmi_t *wmip, A_BOOL en);
96 diff --git a/drivers/sdio/function/wlan/ar6000/wmi/wmi.c b/drivers/sdio/function/wlan/ar6000/wmi/wmi.c
97 index 0e0e6ba..d322cf3 100644
98 --- a/drivers/sdio/function/wlan/ar6000/wmi/wmi.c
99 +++ b/drivers/sdio/function/wlan/ar6000/wmi/wmi.c
100 @@ -2990,6 +2990,39 @@ wmi_get_txPwr_cmd(struct wmi_t *wmip)
101 return (wmi_cmd_send(wmip, osbuf, WMI_GET_TX_PWR_CMDID, NO_SYNC_WMIFLAG));
102 }
103
104 +A_STATUS
105 +wmi_switch_radio(struct wmi_t *wmip, A_UINT8 on)
106 +{
107 + WMI_SCAN_PARAMS_CMD scParams = {0, 0, 0, 0, 0,
108 + WMI_SHORTSCANRATIO_DEFAULT,
109 + DEFAULT_SCAN_CTRL_FLAGS,
110 + 0};
111 +
112 + if (on) {
113 + /* Enable foreground scanning */
114 + if (wmi_scanparams_cmd(wmip, scParams.fg_start_period,
115 + scParams.fg_end_period,
116 + scParams.bg_period,
117 + scParams.minact_chdwell_time,
118 + scParams.maxact_chdwell_time,
119 + scParams.pas_chdwell_time,
120 + scParams.shortScanRatio,
121 + scParams.scanCtrlFlags,
122 + scParams.max_dfsch_act_time) != A_OK) {
123 + return -EIO;
124 + }
125 + } else {
126 + wmi_disconnect_cmd(wmip);
127 + if (wmi_scanparams_cmd(wmip, 0xFFFF, 0, 0, 0,
128 + 0, 0, 0, 0xFF, 0) != A_OK) {
129 + return -EIO;
130 + }
131 + }
132 +
133 + return A_OK;
134 +}
135 +
136 +
137 A_UINT16
138 wmi_get_mapped_qos_queue(struct wmi_t *wmip, A_UINT8 trafficClass)
139 {
140 --
141 1.5.6.3
142
This page took 0.050802 seconds and 5 git commands to generate.